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A,CAAAA,wBAAqC,CAACjC,IAA0B,IAA6F,EAC9QU,GACLF,SAAA,CACDF,GACGlC,CAAAA,EAAAA,EAAAA,GAAAA,EAAA,QAAM4F,KAAK,MAAM,aAAY1D,CAAI,GAEpCE,EAAQ,EACP,EACH,EACI,EAI3B,CAEA6D,EAAA,QAAezG,CAAAA,EAAAA,EAAAA,EAAAA,EAAcoB,GAE7BA,EAAgBsF,YAAY,CAAG,CAC3B5B,gBAAiB,UACjB6B,UAAW,CAAC,CAAEC,SAAU,EAAGC,KAAM,CAAE,EAAE,CACrC1D,mBAAoB,CACxB","sources":["webpack://_N_E/./adapters/helpers/Hooks.js","webpack://_N_E/./components/Image/BackgroundImage/BackgroundImage.js"],"sourcesContent":["import React, { useState, useEffect, useLayoutEffect } from 'react';\n\n// https://github.com/streamich/react-use/blob/master/docs/useIsomorphicLayoutEffect.md\nexport const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n\nexport function useMatchMedia(mediaQueryString, initialValue = null) {\n const [match, setMatch] = useState(initialValue);\n\n useEffect(\n () => {\n if(!window.matchMedia) {\n return;\n }\n\n function handleMatch(event) {\n setMatch(event.matches);\n }\n\n const matchMedia = window.matchMedia(mediaQueryString);\n\n setMatch(matchMedia.matches);\n matchMedia.addListener(handleMatch);\n\n return () => {\n matchMedia.removeListener(handleMatch);\n };\n },\n [mediaQueryString]\n );\n\n return match;\n}\n\nexport const mediaQueryHOC = (Component) => {\n function MediaQueryHOC(props) {\n const isXSmall = useMatchMedia('(max-width: 375px)');\n const isSmall = useMatchMedia('(max-width: 479px)');\n const isMedium = useMatchMedia('(max-width: 767px)');\n const isLarge = useMatchMedia('(max-width: 991px)');\n const isXLarge = useMatchMedia('(max-width: 1023px)');\n return (\n \n );\n }\n return MediaQueryHOC;\n};\n\nlet listeners = [];\nlet state = { currentProductIndex: 0};\n\n\nconst setState = (newState) => {\n state = { ...state, ...newState };\n listeners.forEach((listener) => {\n listener(state);\n });\n};\n\nexport const updateCurrentProductIndex = () => {\n const newListener = useState()[1];\n useEffect(() => {\n listeners.push(newListener);\n }, []);\n return [state, setState];\n};\n","import React, { useEffect, useRef, useState } from 'react'\nimport PropTypes from 'prop-types'\nimport LazyLoad from 'react-lazy-load';\nimport throttle from 'lodash/throttle';\nimport Head from 'next/head'\nimport { useIsomorphicLayoutEffect } from '../../../adapters/helpers/Hooks';\nimport { getBackgroundImage, roundUpTheSize } from './BackgroundImage.helpers';\nimport { mediaQueryHOC } from '../../../adapters/helpers/Hooks'\nimport { ImageConstants } from '../../../adapters/helpers/Constants';\nimport ImageFactory from '../../../adapters/cloudinary/ImageFactory';\nimport { optimizeImage } from '../../../adapters/helpers/pagespeedHelper';\nfunction BackgroundImage(props) {\n const mobileBackgroundImageId = props?.mobileBackgroundImage?.asset?.fields?.file?.url || props.contentImageId;\n const desktopBackgroundImageId = props?.desktopBackgroundImage?.asset?.fields?.file?.url || props.contentImageId;\n const { backgroundOffsetTop: marginTop, backgroundPosition, alt = null, children = null, customStyles = null, ariaHidden = false } = props;\n const paddingTop = `${100 / props.widthToHeightRatio}%`;\n const isPreload = props.isPreload ? props.isPreload : false;\n const isBannerImage = props.isBannerImage ? props.isBannerImage : false;\n const nodeRef = useRef(null);\n const placeholderRef = useRef(null);\n const [isPageLoaded, setIsPageLoaded] = useState(false);\n const [width, setWidth] = useState(ImageConstants.defaultImageWindWidth);\n const [customClassName, setCustomClassName] = useState('');\n const [url, setUrl] = useState(`url(${optimizeImage (ImageFactory.buildContentfullImageUrl(props.contentImageId))})`);\n function updateWidth() {\n const node = nodeRef.current || placeholderRef.current;\n if (node) {\n setWidth(roundUpTheSize(node.getBoundingClientRect().width));\n }\n }\n\n useEffect(() => {\n setIsPageLoaded(true);\n if (width != 0) {\n // Set background width*2 for mobile because the background is larger than the with parent\n setUrl(getBackgroundImage(props.contentImageId, isPreload && isBannerImage && window.innerWidth < 400 ? 450 : props.isMedium ? width * 2 : width, props.transformations, props.format, props.isMedium));\n }\n }, [width, props.imageId, props.isMedium, isPageLoaded]);\n\n\n useEffect(\n () => {\n const handleResize = throttle(updateWidth, 100);\n\n window.addEventListener('resize', handleResize);\n\n return () => {\n window.removeEventListener('resize', handleResize);\n handleResize.cancel();\n };\n },\n []\n );\n\n useEffect(\n () => {\n setCustomClassName(props.customClassName);\n }, [props.customClassName]\n );\n\n useIsomorphicLayoutEffect(\n updateWidth,\n []\n );\n\n\n return (\n \n {isPreload && isBannerImage ?\n \n \n \n \n \n {/* Below code structure have implemented for pagespeed. */}\n {isPageLoaded ?\n \n {alt &&\n \n }\n {children}\n \n :\n \n \n {alt &&\n \n }\n {children}\n \n \n {alt &&\n \n }\n {children}\n \n \n }\n \n : \n }\n >\n <>\n \n {alt &&\n \n }\n {children}\n \n >\n }\n \n\n );\n}\n\nexport default mediaQueryHOC(BackgroundImage);\n\nBackgroundImage.defaultProps = {\n transformations: 'c_limit',\n fragments: [{ minWidth: 0, size: 1 }],\n widthToHeightRatio: 1\n}\n\nBackgroundImage.propTypes = {\n imageId: PropTypes.string,\n transformations: PropTypes.string,\n className: PropTypes.string,\n customClassName: PropTypes.string,\n fragments: PropTypes.array,\n widthToHeightRatio: PropTypes.number,\n children: PropTypes.node,\n backgroundOffsetTop: PropTypes.string,\n backgroundPosition: PropTypes.string,\n customStyles: PropTypes.object,\n format: PropTypes.any,\n isMedium: PropTypes.bool,\n ariaHidden: PropTypes.bool,\n alt: PropTypes.string,\n isPreload: PropTypes.bool,\n isBannerImage: PropTypes.bool,\n preloadImage: PropTypes.object,\n desktopBackgroundImage: PropTypes.any,\n mobileBackgroundImage: PropTypes.any\n}"],"names":["useIsomorphicLayoutEffect","useLayoutEffect","useMatchMedia","mediaQueryString","initialValue","arguments","length","undefined","_useState","useState","match","setMatch","useEffect","window","matchMedia","matches","addListener","handleMatch","removeListener","event","mediaQueryHOC","Component","props","isXSmall","isSmall","isMedium","isLarge","isXLarge","_jsx","_objectSpread","listeners","state","currentProductIndex","setState","newState","forEach","listener","updateCurrentProductIndex","newListener","push","BackgroundImage","_props$mobileBackgrou","_props$mobileBackgrou2","_props$mobileBackgrou3","_props$mobileBackgrou4","_props$desktopBackgro","_props$desktopBackgro2","_props$desktopBackgro3","_props$desktopBackgro4","mobileBackgroundImageId","mobileBackgroundImage","asset","fields","file","url","contentImageId","desktopBackgroundImageId","desktopBackgroundImage","marginTop","backgroundOffsetTop","backgroundPosition","_props$alt","alt","_props$children","children","_props$customStyles","customStyles","_props$ariaHidden","ariaHidden","paddingTop","concat","widthToHeightRatio","isPreload","isBannerImage","nodeRef","useRef","placeholderRef","isPageLoaded","setIsPageLoaded","_useState2","ImageConstants","defaultImageWindWidth","width","setWidth","_useState3","customClassName","setCustomClassName","_useState4","optimizeImage","ImageFactory","setUrl","updateWidth","node","current","roundUpTheSize","getBoundingClientRect","getBackgroundImage","innerWidth","transformations","format","imageId","handleResize","throttle","addEventListener","removeEventListener","cancel","React","_jsxs","Head","rel","href","as","media","mobile_max_width","desktop_min_width","className","ref","style","backgroundImage","imageQuality","role","LazyLoad","offset","placeholder","_Fragment","__webpack_exports__","defaultProps","fragments","minWidth","size"],"sourceRoot":""}