{"version":3,"sources":["webpack:///./Scripts/Jicon/Actions/LightboxImages.action.js","webpack:///./Scripts/Jicon/Components/LightboxImages.js"],"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","key","style","backgroundImage","className","dispatch","useDispatch","useSelector","state","lightboxImages","onClose","useCallback","onClickThumbnail","LIGHTBOX_IMAGES_SET_CURRENT_IMAGE","setCurrentIndex","images","length","Fragment","href","itemProp","onClick","e","preventDefault","rel","dangerouslySetInnerHTML","__html","html","image","ariaHideApp","preventScroll","isOpen","onRequestClose","shouldCloseOnOverlayClick","selectedItem","renderThumbs","value"],"mappings":"0LAKO,MAOMA,EAAQC,IAAO,CACxBC,KAAMC,KACNC,QAAS,CACLH,a,oOCPR,MAAMI,EAAe,CACjBC,QAAS,CACLC,WAAY,OACZC,QAAS,EACTC,OAAQ,QAEZC,QAAS,CACLH,WAAY,qBACZI,OAAQ,OAGVC,EAAmB,CACrBC,YAAY,EACZC,gBAAgB,EAChBC,mBAAmB,EACnBC,WAAY,GACZC,UAAU,EACVC,WAAW,GAGTC,EAAoBC,GACPA,EAASC,KAAI,CAACC,EAAMC,KAC/B,IAAKD,IAASA,EAAKE,QAAUF,EAAKE,MAAMJ,SACpC,OAIJ,MAAMK,EAAeH,EAAKE,MAAMJ,SAASM,MACpCC,GAAqB,QAAbA,EAAIzB,OAEjB,OAAKuB,GAAiBA,EAAaD,OAAUC,EAAaD,MAAMI,IAK5D,uBACIC,IAAKN,EACLO,MAAO,CACHC,gBAAiB,OAASN,EAAaD,MAAMI,IAAM,KAEvDI,UAAU,0BAVlB,CAWM,IAqGd,EA9FwBR,IACpB,MAAMS,GAAWC,WACX,QAAEjC,EAAO,MAAEsB,IAAUY,SAAaC,GAAUA,EAAMC,iBAClDC,GAAUC,kBAAY,IAAMN,EAASjC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BOX_IMAGES_SET_CURRENT_IMAGE,\r\n LIGHTBOX_IMAGES_SHOW,\r\n} from '../constants';\r\n\r\nexport const setCurrentIndex = (index) => ({\r\n type: LIGHTBOX_IMAGES_SET_CURRENT_IMAGE,\r\n payload: {\r\n index,\r\n },\r\n});\r\n\r\nexport const show = (visible) => ({\r\n type: LIGHTBOX_IMAGES_SHOW,\r\n payload: {\r\n visible,\r\n },\r\n});\r\n","import React, { Fragment, useCallback, useState } from 'react';\r\nimport Modal from 'react-modal';\r\nimport 'react-responsive-carousel/lib/styles/carousel.min.css';\r\nimport { Carousel as Lightbox } from 'react-responsive-carousel';\r\nimport { useSelector, useDispatch } from 'react-redux';\r\nimport { show, setCurrentIndex } from '../Actions/LightboxImages.action';\r\nimport { translate } from '../Services/translation';\r\n\r\nconst customStyles = {\r\n content: {\r\n background: 'none',\r\n padding: 0,\r\n border: 'none',\r\n },\r\n overlay: {\r\n background: 'rgba(0, 0, 0, 0.8)',\r\n zIndex: 2003,\r\n },\r\n};\r\nconst LightboxSettings = {\r\n showStatus: false,\r\n showIndicators: false,\r\n useKeyboardArrows: true,\r\n thumbWidth: 50,\r\n autoPlay: false,\r\n autoFocus: true,\r\n};\r\n\r\nconst renderThumbnails = (children) => {\r\n const images = children.map((item, index) => {\r\n if (!item || !item.props || !item.props.children) {\r\n return undefined;\r\n }\r\n\r\n // find img to get source\r\n const imageElement = item.props.children.find(\r\n (ele) => ele.type === 'img'\r\n );\r\n if (!imageElement || !imageElement.props || !imageElement.props.src) {\r\n return undefined;\r\n }\r\n\r\n return (\r\n \r\n );\r\n });\r\n\r\n return images;\r\n};\r\n\r\nconst LightboxImages = (props) => {\r\n const dispatch = useDispatch();\r\n const { visible, index } = useSelector((state) => state.lightboxImages);\r\n const onClose = useCallback(() => dispatch(show(false)), [dispatch]);\r\n const onClickThumbnail = (index) => {\r\n dispatch(show(true));\r\n dispatch(setCurrentIndex(index));\r\n };\r\n\r\n return !props.images || props.images.length < 1 ? (\r\n \r\n ) : (\r\n \r\n
\r\n
\r\n
\r\n {\r\n e.preventDefault();\r\n onClickThumbnail(0);\r\n }}\r\n className=\"product-image\"\r\n rel=\"nofollow\"\r\n dangerouslySetInnerHTML={{\r\n __html: props.images[0].html,\r\n }}\r\n >\r\n
\r\n
\r\n
\r\n {props.images.map(\r\n (image, index) =>\r\n index > 0 && (\r\n \r\n {\r\n e.preventDefault();\r\n onClickThumbnail(index);\r\n }}\r\n className=\"product-image\"\r\n rel=\"nofollow\"\r\n dangerouslySetInnerHTML={{\r\n __html:\r\n props.images[index].html,\r\n }}\r\n >\r\n
\r\n )\r\n )}\r\n
\r\n \r\n \r\n \r\n {props.images.map((value, index) => (\r\n \r\n \r\n ×\r\n \r\n \r\n \r\n ))}\r\n \r\n \r\n
\r\n );\r\n};\r\n\r\nexport default LightboxImages;\r\n"],"sourceRoot":""}