{"version":3,"sources":["webpack:///./Scripts/Components/SliderThumbnails.js","webpack:///./Scripts/Components/FullscreenImageSlider.js","webpack:///./Scripts/Components/ProductImageSlider.js"],"names":["images","sliderRef","activeSlide","isMobile","useIsMobile","className","map","img","index","key","thumbnailSrc","onClick","current","slickGoTo","src","alt","showCloseButton","initialSlide","onClosed","showThumbnails","props","dispatch","useDispatch","contentRef","createRef","open","setOpen","useState","zoomed","setZoomed","zoomClickPos","setZoomClickPos","visible","setVisible","currentSlide","setCurrentSlide","isSliding","setIsSliding","doubleClickMode","setDoubleClickMode","swipingEnabled","setSwipingEnabled","transformComponentRefs","useRef","settings","lazyLoad","infinite","speed","slidesToShow","slidesToScroll","arrows","swipe","beforeChange","_","forEach","ref","resetTransform","onSwipe","afterChange","onKeyDown","e","useEffect","addOverlay","document","addEventListener","removeEventListener","removeOverlay","onZoom","stopPropagation","didZoomIn","clickPos","pageY","windowHeight","getBoundingClientRect","height","percentage","centeredClickPos","scrollHeight","scrollTo","top","behavior","onMobileZoom","idx","setTimeout","doubleClickModeCopy","Object","assign","Math","round","state","scale","ReactDOM","size","color","touchThreshold","centerOnInit","wheel","wheelDisabled","panning","disabled","velocityDisabled","limitToBounds","velocityAnimation","doubleClick","mode","onPanningStop","onZoomStop","wrapperClass","contentClass","hdSrc","loading","originalSrc","length","slickPrev","slickNext","body","minHeight","otherProductTags","hasConfigurator","setActiveSlide","showFullscreenImages","setShowFullscreenImages","selectedVariant","useSelector","productPage","imageUrls","imageIndex","findIndex","indexOf","sliderSettings","style","position","tag","translate"],"mappings":"yOAIA,MAqBA,EArByB,EAAGA,SAAQC,YAAWC,kBAC7C,MAAMC,GAAWC,SACjB,OACE,uBAAKC,UAAU,sBACXF,GACAH,EAAOM,KAAI,CAACC,EAAKC,IACf,uBACEC,IAAKF,EAAIG,aACTL,UAAWH,GAAeM,EAAQ,SAAW,IAE7C,uBACEG,QAAS,IAAMV,EAAUW,QAAQC,UAAUL,GAC3CM,IAAKP,EAAIG,aACTK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AAMrB,GAAa,IAGlC,OACE,gCACE,gBAAC,EAAD,CACErC,OAAQA,EACRC,UAAWA,EACXC,YAAaA,IAEdsH,GACC,gBAAC,EAAD,CACExH,OAAQA,EACRkB,SAAU,IAAMuG,GAAwB,GACxCxG,aAAcf,IAGlB,uBAAKgI,MAAO,CAAEC,SAAU,aACtB,gBAAC,IAAD,KACMF,EADN,CAEE1E,IAAKtD,EACLiI,MAAO,CAAEd,UAAWjH,EAAW,EAAIiH,EAAY,QAE9CpH,EAAOM,KAAKC,GACX,uBACEE,IAAKF,EAAIO,IACTH,QAAS,KAAOyB,GAAaqF,GAAwB,IAErD,uBAAK3G,IAAKP,EAAIO,IAAKC,IAAKR,EAAIQ,UAIlC,uBAAKV,UAAU,gDACZgH,GAAkB/G,KAAI,CAAC8H,EAAKlD,IAC3B,wBAAM7E,UAAU,oBAAoBI,IAAKyE,EAAMkD,GAC5CA,KAGJd,GACC,wBAAMjH,UAAU,sBACbgI,OAAU,0BArCvB,C","file":"480.e3b57687.js","sourcesContent":["import React from 'react';\nimport { ArrowLeft, ArrowRight } from 'phosphor-react';\nimport useIsMobile from '../Hooks/useIsMobile';\n\nconst SliderThumbnails = ({ images, sliderRef, activeSlide }) => {\n const isMobile = useIsMobile();\n return (\n
\n {!isMobile &&\n images.map((img, index) => (\n \n sliderRef.current.slickGoTo(index)}\n src={img.thumbnailSrc}\n alt={img.alt}\n />\n
\n ))}\n \n );\n};\n\nexport default SliderThumbnails;\n","import React, { createRef, useEffect, useRef, useState } from 'react';\nimport ReactDOM from 'react-dom';\nimport { ArrowLeft, ArrowRight, X as CloseIcon } from 'phosphor-react';\nimport { useDispatch } from 'react-redux';\nimport { addOverlay, removeOverlay } from '../Actions/Overlay.action';\nimport { TransformWrapper, TransformComponent } from 'react-zoom-pan-pinch';\nimport Slider from 'react-slick';\nimport 'slick-carousel/slick/slick.css';\n\nimport useIsMobile from '../Hooks/useIsMobile';\nimport SliderThumbnails from './SliderThumbnails';\nimport slider from 'react-slick/lib/slider';\n\nconst FullscreenImageSlider = ({\n showCloseButton = true,\n images,\n initialSlide = 0,\n onClosed,\n showThumbnails = true,\n} = props) => {\n const dispatch = useDispatch();\n const contentRef = createRef();\n const isMobile = useIsMobile();\n\n const [open, setOpen] = useState(true);\n const [zoomed, setZoomed] = useState(false);\n const [zoomClickPos, setZoomClickPos] = useState(0);\n const [visible, setVisible] = useState(false);\n const [currentSlide, setCurrentSlide] = useState(initialSlide);\n const [isSliding, setIsSliding] = useState(false);\n const [doubleClickMode, setDoubleClickMode] = useState(\n images.map(() => 'zoomIn')\n );\n const [swipingEnabled, setSwipingEnabled] = useState(true);\n const [transformComponentRefs] = useState(images.map(() => createRef()));\n const sliderRef = useRef();\n\n const settings = {\n lazyLoad: true,\n infinite: true,\n speed: 200,\n slidesToShow: 1,\n slidesToScroll: 1,\n arrows: false,\n swipe: swipingEnabled,\n initialSlide: initialSlide,\n beforeChange: (_, index) => {\n setCurrentSlide(index);\n transformComponentRefs.forEach((ref) => ref?.current?.resetTransform());\n setSwipingEnabled(true);\n },\n onSwipe: () => setIsSliding(true),\n afterChange: (index) => {\n setIsSliding(false);\n },\n };\n\n const onKeyDown = (e) => {\n if (e.key == 'Escape') {\n setOpen(false);\n }\n };\n\n /**\n * Set \"open\" to true on mount\n */\n useEffect(() => {\n setVisible(true);\n dispatch(\n addOverlay('FullscreenWindow', () => {\n setOpen(false);\n })\n );\n document.addEventListener('keydown', onKeyDown, false);\n\n return () => {\n document.removeEventListener('keydown', onKeyDown, false);\n };\n }, []);\n\n useEffect(() => {\n if (!open) {\n dispatch(removeOverlay('FullscreenWindow'));\n onClosed && onClosed();\n }\n }, [open]);\n\n const onZoom = (e) => {\n if (isSliding) return;\n\n e.stopPropagation();\n const didZoomIn = !zoomed;\n const clickPos = e.pageY;\n setZoomClickPos(didZoomIn ? clickPos : 0);\n setZoomed(didZoomIn);\n };\n\n useEffect(() => {\n if (zoomed) {\n const windowHeight = contentRef.current.getBoundingClientRect().height;\n const percentage = zoomClickPos / windowHeight;\n const upScaledClickPos = contentRef.current.scrollHeight * percentage;\n const centeredClickPos = upScaledClickPos - windowHeight / 2;\n contentRef.current.scrollTo({ top: centeredClickPos, behavior: 'auto' });\n }\n }, [zoomClickPos]);\n\n const onMobileZoom = (e, idx) => {\n setTimeout(() => {\n let doubleClickModeCopy = Object.assign([], doubleClickMode);\n doubleClickModeCopy[idx] =\n Math.round(e.state.scale) >= 8 ? 'reset' : 'zoomIn';\n\n setDoubleClickMode(doubleClickModeCopy);\n setSwipingEnabled(e.state.scale <= 1);\n }, 200);\n };\n return (\n open &&\n ReactDOM.createPortal(\n \n
\n {showCloseButton && (\n setOpen(false)}\n >\n \n
\n )}\n \n {images.map((img, idx) => (\n
\n {/* Use \"zoom\" library on mobile */}\n {isMobile && (\n onMobileZoom(e, idx)}\n onZoomStop={(e) => onMobileZoom(e, idx)}\n >\n \n \n \n \n )}\n\n {/* Use zoom-on-click in desktop*/}\n {!isMobile && (\n \n )}\n
\n ))}\n
\n
\n
\n {currentSlide + 1} / {images.length}\n
\n
\n sliderRef.current.slickPrev()}\n aria-label=\"Previous slide\"\n >\n \n \n sliderRef.current.slickNext()}\n aria-label=\"Next slide\"\n >\n \n \n
\n
\n {showThumbnails && (\n \n )}\n \n ,\n document.body\n )\n );\n};\n\nexport default FullscreenImageSlider;\n","import React, { useEffect, useRef, useState } from 'react';\nimport { useSelector } from 'react-redux';\nimport Slider from 'react-slick';\nimport useIsMobile from '../Hooks/useIsMobile';\nimport { translate } from '../Services/translation';\nimport FullscreenImageSlider from './FullscreenImageSlider';\nimport SliderThumbnails from './SliderThumbnails';\n\nconst ProductImageSlider = ({\n images,\n minHeight,\n otherProductTags,\n hasConfigurator,\n}) => {\n const sliderRef = useRef();\n const [activeSlide, setActiveSlide] = useState(0);\n const [showFullscreenImages, setShowFullscreenImages] = useState(false);\n const [isSliding, setIsSliding] = useState(false);\n const isMobile = useIsMobile();\n\n const { selectedVariant } = useSelector((state) => state.productPage);\n\n useEffect(() => {\n if (!selectedVariant || !sliderRef?.current) return;\n if (selectedVariant.imageUrls?.length > 0) {\n const imageIndex = images.findIndex(\n (img) => img.src.indexOf(selectedVariant.imageUrls[0]) != -1\n );\n if (imageIndex == -1) return;\n sliderRef.current.slickGoTo(imageIndex);\n }\n }, [selectedVariant, sliderRef, images]);\n\n const sliderSettings = {\n lazyLoad: false,\n infinite: false,\n speed: 200,\n slidesToShow: isMobile ? 1.4 : 1,\n slidesToScroll: 1,\n arrows: false,\n beforeChange: (_, index) => setActiveSlide(Math.round(index)),\n onSwipe: () => setIsSliding(true),\n afterChange: () => setIsSliding(false),\n };\n\n return (\n <>\n \n {showFullscreenImages && (\n setShowFullscreenImages(false)}\n initialSlide={activeSlide}\n />\n )}\n
\n \n {images.map((img) => (\n !isSliding && setShowFullscreenImages(true)}\n >\n {img.alt}\n
\n ))}\n \n
\n {otherProductTags?.map((tag, idx) => (\n \n {tag}\n \n ))}\n {hasConfigurator && (\n \n {translate('product.custom-size')}\n \n )}\n
\n \n \n );\n};\n\nexport default ProductImageSlider;\n"],"sourceRoot":""}