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A,cAAA,OAAKI,UAAWW,GAChBf,EAAAA,cAAA,UAAQI,UAAU,mCACdJ,EAAAA,cAAA,KACI,WAAUL,EAAMqB,OAAO,GAAGjB,IAC1BoB,KAAK,IACLC,SAAS,MACTC,QAAUC,IACNA,EAAEC,iBACFX,EAAiB,EAAE,EAEvBR,UAAU,gBACVoB,IAAI,WACJC,wBAAyB,CACrBC,OAAQ/B,EAAMqB,OAAO,GAAGW,UAKnChC,EAAMqB,OAAOC,OAAS,GACnBjB,EAAAA,cAAA,OAAKI,UAAU,0EACVT,EAAMqB,OAAOxB,KACV,CAACoC,EAAOlC,IACJA,EAAQ,GACJM,EAAAA,cAAA,OACII,UAAU,mCACVH,IAAKP,GAELM,EAAAA,cAAA,KACI,WAAU4B,EAAM7B,IAChBoB,KAAK,IACLC,SAAS,MACTC,QAAUC,IACNA,EAAEC,iBACFX,EAAiBlB,EAAM,EAE3BU,UAAU,gBACVoB,IAAI,WACJC,wBAAyB,CACrBC,OACI/B,EAAMqB,OAAOtB,GAAOiC,aAUhE3B,EAAAA,cAAC6B,IAAK,CACFC,aAAa,EACbC,eAAe,EACfC,OAAQ5D,EACR6D,eAAgBvB,EAChBR,MAAO1B,EACP0D,2BAA2B,GAE3BlC,EAAAA,cAACmC,EAAAA,GAAQC,EAAA,GACDrD,EAAgB,CACpBsD,aAAc3C,EACdU,UAAU,YACVkC,aAAchD,IAEbK,EAAMqB,OAAOxB,KAAI,CAAC+C,EAAO7C,IACtBM,EAAAA,cAAA,OACIC,IAAK,SAASP,IACdU,UAAU,wBAEVJ,EAAAA,cAAA,UACIqB,QAASX,EACTN,UAAU,wBACb,KAGDJ,EAAAA,cAAA,OAAKD,IAAKwC,EAAMxC,IAAKK,UAAU,0BAMtD,C","sources":["webpack:///./Scripts/Actions/LightboxImages.action.js","webpack:///./Scripts/Components/LightboxImages.js"],"sourcesContent":["import {\n    LIGHTBOX_IMAGES_SET_CURRENT_IMAGE,\n    LIGHTBOX_IMAGES_SHOW,\n} from '../constants';\n\nexport const setCurrentIndex = (index) => ({\n    type: LIGHTBOX_IMAGES_SET_CURRENT_IMAGE,\n    payload: {\n        index,\n    },\n});\n\nexport const show = (visible) => ({\n    type: LIGHTBOX_IMAGES_SHOW,\n    payload: {\n        visible,\n    },\n});\n","import React, { Fragment, useCallback } from 'react';\nimport Modal from 'react-modal';\nimport 'react-responsive-carousel/lib/styles/carousel.min.css';\nimport { Carousel as Lightbox } from 'react-responsive-carousel';\nimport { useSelector, useDispatch } from 'react-redux';\nimport { show, setCurrentIndex } from '../Actions/LightboxImages.action';\n\nconst customStyles = {\n    content: {\n        background: 'none',\n        padding: 0,\n        border: 'none',\n    },\n    overlay: {\n        background: 'rgba(0, 0, 0, 0.8)',\n        zIndex: 2003,\n    },\n};\nconst LightboxSettings = {\n    showStatus: false,\n    showIndicators: false,\n    useKeyboardArrows: true,\n    thumbWidth: 50,\n    autoPlay: false,\n    autoFocus: true,\n};\n\nconst renderThumbnails = (children) => {\n    const images = children.map((item, index) => {\n        if (!item || !item.props || !item.props.children) {\n            return undefined;\n        }\n\n        // find img to get source\n        const imageElement = item.props.children.find(\n            (ele) => ele.type === 'img'\n        );\n        if (!imageElement || !imageElement.props || !imageElement.props.src) {\n            return undefined;\n        }\n\n        return (\n            <div\n                key={index}\n                style={{\n                    backgroundImage: 'url(' + imageElement.props.src + ')',\n                }}\n                className=\"thumbnail__image\"\n            />\n        );\n    });\n\n    return images;\n};\n\nconst LightboxImages = (props) => {\n    const dispatch = useDispatch();\n    const { visible, index } = useSelector((state) => state.lightboxImages);\n    const onClose = useCallback(() => dispatch(show(false)), [dispatch]);\n    const onClickThumbnail = (index) => {\n        dispatch(show(true));\n        dispatch(setCurrentIndex(index));\n    };\n    const mainImageCssClass = props.images && props.images.length > 1 ? \"small-12 large-9 columns large-order-1\" : \"small-12 columns large-order-1\";\n    return !props.images || props.images.length < 1 ? (\n        <Fragment />\n    ) : (\n        <Fragment>\n            <div className=\"row product-images\">\n                    <div className={mainImageCssClass}>\n                    <figure className=\"product-detail__image-container\">\n                        <a\n                            data-src={props.images[0].src}\n                            href=\"#\"\n                            itemProp=\"url\"\n                            onClick={(e) => {\n                                e.preventDefault();\n                                onClickThumbnail(0);\n                            }}\n                            className=\"product-image\"\n                            rel=\"nofollow\"\n                            dangerouslySetInnerHTML={{\n                                __html: props.images[0].html,\n                            }}\n                        ></a>\n                    </figure>\n                    </div>\n                    {props.images.length > 1 &&\n                        <div className=\"small-12 large-3 columns medium-flex-dir-column product-detail__thumbs\">\n                            {props.images.map(\n                                (image, index) =>\n                                    index > 0 && (\n                                        <div\n                                            className=\"product-detail__thumbs-container\"\n                                            key={index}\n                                        >\n                                            <a\n                                                data-src={image.src}\n                                                href=\"#\"\n                                                itemProp=\"url\"\n                                                onClick={(e) => {\n                                                    e.preventDefault();\n                                                    onClickThumbnail(index);\n                                                }}\n                                                className=\"product-image\"\n                                                rel=\"nofollow\"\n                                                dangerouslySetInnerHTML={{\n                                                    __html:\n                                                        props.images[index].html,\n                                                }}\n                                            ></a>\n                                        </div>\n                                    )\n                            )}\n                        </div>\n                    }\n\n            </div>\n            <Modal\n                ariaHideApp={false}\n                preventScroll={true}\n                isOpen={visible}\n                onRequestClose={onClose}\n                style={customStyles}\n                shouldCloseOnOverlayClick={false}\n            >\n                <Lightbox\n                    {...LightboxSettings}\n                    selectedItem={index}\n                    className=\"light-box\"\n                    renderThumbs={renderThumbnails}\n                >\n                    {props.images.map((value, index) => (\n                        <div\n                            key={`figure${index}`}\n                            className=\"light-box__container\"\n                        >\n                            <button\n                                onClick={onClose}\n                                className=\"light-box__close-btn\"\n                            >\n                                &times;\n                            </button>\n                            <img src={value.src} className=\"light-box__image\" />\n                        </div>\n                    ))}\n                </Lightbox>\n            </Modal>\n        </Fragment>\n    );\n};\n\nexport default LightboxImages;\n"],"names":["show","visible","type","LIGHTBOX_IMAGES_SHOW","payload","customStyles","content","background","padding","border","overlay","zIndex","LightboxSettings","showStatus","showIndicators","useKeyboardArrows","thumbWidth","autoPlay","autoFocus","renderThumbnails","children","map","item","index","props","imageElement","find","ele","src","React","key","style","backgroundImage","className","dispatch","useDispatch","useSelector","state","lightboxImages","onClose","useCallback","onClickThumbnail","LIGHTBOX_IMAGES_SET_CURRENT_IMAGE","setCurrentIndex","mainImageCssClass","images","length","Fragment","href","itemProp","onClick","e","preventDefault","rel","dangerouslySetInnerHTML","__html","html","image","Modal","ariaHideApp","preventScroll","isOpen","onRequestClose","shouldCloseOnOverlayClick","Lightbox","_extends","selectedItem","renderThumbs","value"],"sourceRoot":""}