{"version":3,"file":"generic-products-53e1121b.js","sources":["../../../client/src/javascripts/customer_pages/_utils/product-thumbnails-styles-helper.js","../../../client/src/javascripts/customer_pages/_utils/new-product-thumbnail.jsx","../../../client/src/javascripts/customer_pages/_utils/new-image-thumbnail-spinner.jsx","../../../client/src/javascripts/customer_pages/_utils/new-product-image-thumbnail.jsx","../../../client/src/javascripts/customer_pages/_utils/remaining-thumbnails.jsx","../../../client/src/javascripts/customer_pages/_utils/new-product.jsx","../../../client/src/javascripts/customer_pages/_shelf-category/types/pre-selections-type.js","../../../client/src/javascripts/customer_pages/_shelf-category/generic-products.jsx"],"sourcesContent":["function foldedStyles(ratio) {\n let styles;\n const orientation = ratio > 1 ? 'landscape' : 'portrait';\n\n switch (orientation) {\n case 'landscape':\n styles = {\n left: '100%',\n width: '8%',\n \"max-height\": 'inherit'\n }\n break;\n case 'portrait':\n styles = {\n width: '100%',\n height: 'auto',\n top: '-5%',\n \"max-height\": 'inherit'\n }\n break;\n }\n\n return styles;\n}\n\nfunction cornerStyles(ratio) {\n let styles;\n const orientation = ratio > 1 ? 'landscape' : 'portrait';\n\n switch (orientation) {\n case 'landscape':\n styles = {\n width: '100%',\n \"max-height\": 'inherit'\n }\n break;\n case 'portrait':\n styles = {\n height: '100%',\n width: '100%',\n \"max-height\": 'inherit'\n }\n break;\n }\n\n return styles;\n}\n\nfunction foldedSrc(ratio) {\n let backgroundImage;\n const orientation = ratio > 1 ? 'landscape' : 'portrait';\n\n switch (orientation) {\n case 'landscape':\n backgroundImage = '/stylesheets/walmart/images/fake_folded_card_backs/landscape.png';\n break;\n case 'portrait':\n backgroundImage = '/stylesheets/walmart/images/fake_folded_card_backs/portrait.png';\n break; \n }\n\n return backgroundImage;\n}\n\nfunction roundedSrc(ratio) {\n return `/stylesheets/walmart/images/rounded_corners/ratio_${ratio}.svg`;\n}\n\nfunction maskSrc(cornerType, ratio) {\n const getSVGSource = (cornerType, ratio) => {\n const imageOrientation = ratio > 1 ? 'landscape' : 'portrait';\n return `/stylesheets/walmart/images/scalloped_edges_and_elegant_corners/5x7_${cornerType.replace(\n 'ed',\n ''\n )}_mask_${imageOrientation}.svg`;\n };\n const SVGSource = getSVGSource(cornerType, ratio);\n\n return SVGSource;\n}\nexport { cornerStyles, foldedStyles, foldedSrc, roundedSrc, maskSrc };\n","import React, { useState } from 'react';\nimport classNames from 'classnames';\nimport ProductThumbnailSpinner from './product-thumbnail-loading-spinner';\nimport {\n foldedStyles,\n cornerStyles,\n foldedSrc,\n roundedSrc,\n maskSrc\n} from './product-thumbnails-styles-helper';\nimport screenAndStyle from './screen-and-style';\nimport { getViewport } from '../_utils/hoc/with-viewport-size';\n\n// -----------------------------------------------------------\n// NewProductThumbnail\n// -----------------------------------------------------------\nconst NewProductThumbnail = ({\n thumbnails,\n imageIndex,\n isLoading,\n isCard,\n children,\n roundedCorners,\n foldedCard,\n scallopedEdges,\n elegantCorners,\n altTag,\n}) => {\n const [values, setValues] = useState({\n srcUrl: thumbnails[imageIndex],\n loading: isLoading,\n dimensions: { width: null, height: null },\n ratio: null,\n orientation: null,\n isMobile: getViewport().isMobile,\n });\n const cornerType = (() => {\n if (scallopedEdges) {\n return 'scalloped';\n }\n if (elegantCorners) {\n return 'elegant';\n }\n return null;\n })();\n const previewIndex = React.useRef(imageIndex);\n const srcRef = React.useRef();\n const minHeight = React.useRef();\n const intervalRef = React.useRef(); //create a ref for interval\n const over = React.useRef(false);\n const styleClasses =\n screenAndStyle.isSafari() &&\n screenAndStyle.isMobileBrowser() &&\n roundedCorners\n ? 'double-background-image-edge'\n : '';\n\n React.useEffect(() => {\n let isMounted = true;\n if (isMounted) { // to prevent state update in unmounted component\n setValues({ ...values, loading: true });\n const img = new Image();\n img.src = thumbnails[imageIndex];\n img.onload = () => {\n const ratio = (img.width / img.height).toFixed(2);\n minHeight.current = ratio > 1 ? img.width : img.height;\n srcRef.current = src(ratio);\n if (isMounted) { // to prevent state update in unmounted component\n setValues(prevValues => {\n return {\n ...prevValues,\n loading: false,\n srcUrl: thumbnails[imageIndex],\n dimensions: { width: img.width, height: img.height },\n ratio: ratio,\n orientation: ratio > 1 ? 'landscape' : 'portrait',\n };\n });\n }\n }\n return () => { isMounted = false };\n };\n img.onerror = () => {\n setValues({ ...values, loading: false });\n };\n }, [imageIndex]);\n\n function src(ratio) {\n if (foldedCard) {\n return foldedSrc(ratio);\n }\n\n if (roundedCorners) {\n return roundedSrc(ratio);\n }\n\n if (scallopedEdges || elegantCorners) {\n return maskSrc(cornerType, ratio);\n }\n }\n\n function handleMouseEnter() {\n if ((thumbnails || []).length < 2) {\n return;\n }\n\n over.current = true;\n\n setTimeout(() => debouncedHandler(), 200);\n async function debouncedHandler() {\n if (!values.loading) {\n const promises = [];\n\n setValues(prevValues => {\n return { ...prevValues, loading: true };\n });\n thumbnails.forEach(thumbnail => {\n promises.push(\n new Promise((resolve, reject) => {\n const image = new Image();\n\n image.onload = function() {\n resolve();\n };\n\n image.src = thumbnail;\n })\n );\n });\n await Promise.all(promises);\n onLoaded();\n }\n }\n function onLoaded() {\n setValues(prevValues => {\n return { ...prevValues, loading: false };\n });\n\n if (over.current) {\n start();\n }\n }\n }\n\n function start() {\n load(previewIndex.current);\n intervalRef.current = setInterval(() => {\n load();\n }, 800);\n }\n\n function stop() {\n clearInterval(intervalRef.current);\n load(0);\n }\n\n function handleMouseLeave() {\n over.current = false;\n setValues(prevValues => {\n return { ...prevValues, loading: false };\n });\n stop();\n }\n\n function load(newPreviewIndex) {\n if (typeof newPreviewIndex === 'undefined') {\n newPreviewIndex = previewIndex.current + 1;\n }\n const index = newPreviewIndex % thumbnails.length;\n const image = new Image();\n\n image.onload = function() {\n previewIndex.current = index;\n const ratio = (image.width / image.height).toFixed(2);\n srcRef.current = src(ratio);\n setValues(prevValues => {\n return {\n loading: false,\n srcUrl: thumbnails[index],\n dimensions: { width: image.width, height: image.height },\n ratio,\n orientation: ratio > 1 ? 'landscape' : 'portrait',\n };\n });\n };\n image.src = thumbnails[index];\n }\n\n function renderOverlay() {\n if (roundedCorners || foldedCard || scallopedEdges || elegantCorners) {\n return (\n \n );\n }\n }\n\n return (\n \n
\n {renderOverlay()}\n \n
\n \n {children}\n \n );\n};\n\nexport default NewProductThumbnail;\n","import React from 'react';\nimport Spinner from './spinner';\n\nconst NewImageThumbnailSpinner = () => {\n return (\n
\n \n
\n );\n}\n\nexport default NewImageThumbnailSpinner;\n","// Import Libraries\nimport React, { useState } from 'react';\n// Import JS Modules\nimport classNames from 'classnames';\nimport NewImageThumbnailSpinner from './new-image-thumbnail-spinner';\n\n// -----------------------------------------------------------\n// NewProductImageThumbnail\n// -----------------------------------------------------------\nconst NewProductImageThumbnail = ({\n thumbnail,\n isLoading,\n selected,\n onClickAction,\n index,\n viewClass,\n}) => {\n const [loading, setLoading] = useState(isLoading);\n const [className, setClassName] = useState(viewClass);\n\n React.useEffect(() => {\n const img = new Image();\n img.src = thumbnail;\n img.onload = () => {\n setLoading(false);\n };\n img.onerror = () => {\n setLoading(false);\n };\n }, []);\n\n React.useEffect(() => {\n setClassName(viewClass);\n }, [viewClass]);\n\n return (\n
  • \n \n \n \n \n
  • \n );\n\n function handleClick(event) {\n event.stopPropagation();\n\n onClickAction(index);\n }\n};\n\nexport default NewProductImageThumbnail;\n","import React from 'react';\n\nfunction RemainingThumbnails({ quantity, viewClass }) {\n return (\n <>\n
  • \n
    \n +{quantity}\n
    \n
  • \n \n )\n}\n\nexport default RemainingThumbnails;\n\n","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nimport ProductPrice from '../_utils/product-price';\nimport getOrientation from './get-orientation';\nimport UrlBuilder from './url-building';\nimport Favouritable from './favouritable';\nimport wasPriceType from './types/was-price-type';\nimport NewProductThumbnail from './new-product-thumbnail';\nimport NewProductImageThumbnail from './new-product-image-thumbnail';\nimport RemainingThumbnails from './remaining-thumbnails';\nimport ProductFlags from './product-flags';\n\nconst NewProduct = ({\n category_title: categoryTitle,\n design_code: designCode,\n theme_name: themeName,\n price_range: priceRange,\n delivery_option_keys,\n handleModalContent,\n handleOnClick,\n preSelections,\n preview_images,\n price,\n set_size,\n stacked,\n theme_title,\n title,\n url,\n was_price,\n max_age,\n featured,\n sales_total,\n images,\n extraClasses,\n is_card,\n flag,\n roundOption,\n favourites,\n showThumbnailImages,\n variants,\n\tproductsWithMultipleVariants,\n selectedDeliveryOptions\n}) => {\n const defaultVariant = (variants || []).find(variant => variant.default);\n const defaultVariantImages = defaultVariant && defaultVariant.images;\n const [selectedVariant, setSelectedVariant] = useState(defaultVariant);\n const [deliveryOptions, setDeliveryOptions] = useState(selectedDeliveryOptions)\n const [productImages, setProductImages] = useState(\n defaultVariantImages || images\n );\n\n const desktop = 1280;\n const tablet = 601;\n const calculateQuantity = () => {\n let _quantity = 5,\n _className = 'desktop';\n const windowSize = window.innerWidth;\n if (windowSize < tablet) {\n _quantity = 3;\n _className = 'mobile';\n }\n if (windowSize < desktop && windowSize > tablet) {\n _quantity = 4;\n _className = 'tablet';\n }\n if (windowSize >= desktop) {\n _quantity = 5;\n _className = 'desktop';\n }\n return { quantity: _quantity, viewName: _className };\n };\n\n let { quantity, viewName } = calculateQuantity();\n\n const [values, setValues] = useState({\n index: 0,\n isLoading: false,\n showQuantity: quantity,\n viewClass: viewName,\n });\n const handleClickAndSetContent = e => {\n const orientation = getOrientation({ title });\n handleOnClick(e);\n handleModalContent({\n themeTitle: theme_title,\n url: getUrl(),\n priceInfo: {\n price: price,\n price_range: priceRange,\n set_size: set_size,\n was_price: was_price,\n },\n previewImages: preview_images,\n deliveryOptionKeys: delivery_option_keys,\n orientation,\n });\n };\n\n React.useEffect(() => {\n const handleWindowResize = () => {\n const { quantity, viewName } = calculateQuantity();\n setValues({ ...values, showQuantity: quantity, viewClass: viewName });\n };\n window.addEventListener('resize', handleWindowResize);\n return () => window.removeEventListener('resize', handleWindowResize);\n }, []);\n\n React.useEffect(() => {\n setDeliveryOptions(selectedDeliveryOptions);\n }, [selectedDeliveryOptions]);\n\n const updateImage = newIndex => {\n setValues({ ...values, isLoading: true, index: newIndex });\n };\n\n let $favoritable;\n\n if (favourites && (typeof App !== 'undefined' && App.order.logged_in())) {\n $favoritable = (\n \n );\n }\n function handleColourSwatchClick(variantName) {\n const variantClicked = variants.find((variant) => variant.name === variantName);\n setSelectedVariant(variantClicked);\n setProductImages(variantClicked.images);\n }\n const getUrl = () => {\n const params = {};\n // for zero down time: add hash as product param\n // urls were of the form category/XXX#{product.to_param}\n // maybe removed later - kamal Need to discuss seem not needed as we have no # in urls\n (() => {\n const hashIndex = url.indexOf('#');\n if (hashIndex > -1) {\n params.product = url.substr(hashIndex + 1);\n url = url.substr(0, hashIndex);\n }\n })();\n\n // pass on any pre-existing query params\n (() => {\n const queryIndex = url.indexOf('?');\n if (queryIndex > -1) {\n for (const [key, value] of url\n .substr(queryIndex + 1)\n .split('&')\n .map(pair => pair.split('='))) {\n params[key] = value;\n }\n url = url.substr(0, queryIndex);\n }\n })();\n\n params.theme = themeName;\n params.design_code = designCode;\n\n if (selectedVariant) {\n params.variant_name = selectedVariant.name;\n }\n\n if (deliveryOptions !== ''){\n params.selected_delivery_options = deliveryOptions;\n }\n\n for (const selection in preSelections) {\n if (\n preSelections.hasOwnProperty(selection) &&\n preSelections[selection].length === 1\n ) {\n params[selection] = preSelections[selection][0];\n }\n }\n\n if (stacked) {\n delete params.product;\n }\n return `${url}?${UrlBuilder.buildURLQuery(params)}`;\n };\n\n function renderTitle() {\n const Title = () => {\n if (stacked) {\n return {categoryTitle};\n }\n\n return title;\n };\n\n return (\n

    \n \n {theme_title}\n \n \n
    \n {Title()}\n
    \n

    \n );\n }\n\n const $thumbnails = productImages.slice(0, values.showQuantity).map((image, i) => {\n return \n })\n\n const isRoundedCorners = () => roundOption;\n const isScallopedEdges = () => is_card && /Scalloped/i.test(title);\n const isElegantCorners = () => is_card && /Elegant/i.test(title);\n const isFoldedCard = () => {\n return [/Folded Card/i, /Note Card/i].some(regex => regex.test(title));\n };\n\n function renderThumbnail() {\n return (\n \n \n \n );\n }\n\n const multiplePreviews = (productImages || []).length > 2;\n return (\n
    \n \n {$favoritable}\n
    \n
    \n {renderThumbnail()}\n
    1 })}>\n {\n variants && variants.length > 1 && variants.map((variant, i) => {\n if (variant.dominant_colours && variant.dominant_colours.length > 0) {\n return (\n \n handleColourSwatchClick(variant.name)}\n type='button'\n />\n
    \n );\n }\n })\n }\n
    \n
    \n
    \n
      \n {showThumbnailImages &&\n multiplePreviews &&\n $thumbnails}\n {showThumbnailImages &&\n (productImages || []).length > values.showQuantity && (\n \n )}\n
    \n
    \n
    \n
    \n\n \n
    \n
    \n \n
    \n {renderTitle()}\n
    \n
    \n
    \n \n \n );\n};\n\nNewProduct.propTypes = {\n handleOnClick: PropTypes.func,\n handleModalContent: PropTypes.func,\n image_previews: PropTypes.arrayOf(PropTypes.string),\n price: PropTypes.number,\n price_range: PropTypes.arrayOf(PropTypes.number),\n set_size: PropTypes.number,\n was_price: wasPriceType,\n delivery_option_keys: PropTypes.arrayOf(PropTypes.number),\n theme_title: PropTypes.string,\n};\n\nNewProduct.defaultProps = {\n handleOnClick: () => {},\n handleModalContent: () => {},\n image_previews: null,\n delivery_option_keys: null,\n price: null,\n price_range: null,\n set_size: null,\n was_price: null,\n theme_title: null,\n};\n\nexport default NewProduct;\n","import PropTypes from 'prop-types';\n\nconst preSelectionsType = PropTypes.shape({\n page: PropTypes.number,\n search: PropTypes.string,\n showMobileFiltersFullScreen: PropTypes.bool,\n sort: PropTypes.string,\n});\n\nexport default preSelectionsType;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport NewProduct from '../_utils/new-product';\nimport productType from './types/product-type';\nimport preSelectionsType from './types/pre-selections-type';\n\nfunction GenericProducts({\n favourites,\n preSelections,\n products,\n roundOption,\n showThumbnailImages,\n productsWithMultipleVariants,\n selectedDeliveryOptions\n}) {\n\n return (\n
    \n {products.map(product => (\n \n ))}\n
    \n );\n}\n\nGenericProducts.propTypes = {\n favourites: PropTypes.arrayOf(PropTypes.string),\n preSelections: preSelectionsType.isRequired,\n products: PropTypes.arrayOf(productType).isRequired,\n roundOption: PropTypes.bool.isRequired,\n showThumbnailImages: PropTypes.bool,\n selectedDeliveryOptions: PropTypes.string\n};\n\nGenericProducts.defaultProps = {\n favourites: null,\n showThumbnailImages: null\n};\n\nexport default GenericProducts;\n"],"names":["foldedStyles","ratio","styles","cornerStyles","foldedSrc","backgroundImage","roundedSrc","maskSrc","cornerType","imageOrientation","NewProductThumbnail","thumbnails","imageIndex","isLoading","isCard","children","roundedCorners","foldedCard","scallopedEdges","elegantCorners","altTag","values","setValues","useState","getViewport","previewIndex","React","srcRef","minHeight","intervalRef","over","styleClasses","screenAndStyle","isMounted","img","src","prevValues","handleMouseEnter","debouncedHandler","promises","thumbnail","resolve","reject","image","onLoaded","start","load","stop","handleMouseLeave","newPreviewIndex","index","renderOverlay","classNames","ProductThumbnailSpinner","NewImageThumbnailSpinner","Spinner","NewProductImageThumbnail","selected","onClickAction","viewClass","loading","setLoading","className","setClassName","handleClick","event","RemainingThumbnails","quantity","NewProduct","categoryTitle","designCode","themeName","priceRange","delivery_option_keys","handleModalContent","handleOnClick","preSelections","preview_images","price","set_size","stacked","theme_title","title","url","was_price","max_age","featured","sales_total","images","extraClasses","is_card","flag","roundOption","favourites","showThumbnailImages","variants","productsWithMultipleVariants","selectedDeliveryOptions","defaultVariant","variant","defaultVariantImages","selectedVariant","setSelectedVariant","deliveryOptions","setDeliveryOptions","productImages","setProductImages","desktop","tablet","calculateQuantity","_quantity","_className","windowSize","viewName","handleClickAndSetContent","e","orientation","getOrientation","getUrl","handleWindowResize","updateImage","newIndex","$favoritable","Favouritable","handleColourSwatchClick","variantName","variantClicked","params","hashIndex","queryIndex","key","value","pair","selection","UrlBuilder","renderTitle","Title","$thumbnails","i","isRoundedCorners","isScallopedEdges","isElegantCorners","isFoldedCard","regex","renderThumbnail","ProductFlags","multiplePreviews","ProductPrice","PropTypes","wasPriceType","preSelectionsType","GenericProducts","products","product","productType"],"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