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,GACA8H,oBACEvL,MAAgCuE,GAClCrF,sBAAuBA,GACvBE,wBAAAA,KAIkB,SAAvBH,GACC6D,KACiB,QAAjB/H,EAAAA,EAAQyQ,iBAARzQ,IAAAA,OAAAA,EAAAA,EAAmB0Q,kBACF,QAAjB1Q,EAAAA,EAAQyQ,iBAARzQ,IAAAA,OAAAA,EAAAA,EAAmB2Q,yBACjB,SAACC,EAAAA,QAAsB,CACrBF,eAAgB1Q,EAAQyQ,UAAUC,eAClCG,mBAAoB7Q,EAAQyQ,UAAUE,0BAKlD,G,0JCljCa/D,C,IAAN,IAAMA,EAA4B,SACvCC,EACAC,EACAC,EACAhN,EACAiN,GAEA,OACEH,GAAqB,IACpBC,EAAc1H,MAAK,SAAC0L,G,MAAyB,mBAAfA,EAAMrQ,I,IAE9B,KAGLsM,EAEAhN,EAAa8B,OAAS,GACtB9B,EAAagR,OACX,SAAC1P,G,IAC8BtB,EAA7BsB,OAAAA,EAAOwL,qBAAqC,QAAf9M,EAAAA,EAAa,UAAbA,IAAAA,OAAAA,EAAAA,EAAiB8M,kB,IAGhD,CAAEG,cAAAA,EAAeH,kBAAAA,GACjB,KAEC,CAAEG,cAAAA,EAAeH,kBAAAA,EAC1B,C","sources":["webpack://webstaurantstore/./productListing/ProductBox/DisplayVirtualGroupingOptions.tsx","webpack://webstaurantstore/./productListing/ProductBox/components/QuantityCountBadge/index.tsx","webpack://webstaurantstore/./productListing/ProductBox/index.tsx","webpack://webstaurantstore/./productListing/ProductBox/module.ts"],"sourcesContent":["import React from \"react\";\nimport { Product } from \"~/common/Store/models/ProductListing\";\n\ninterface OverrideMap {\n [key: string]: string;\n}\n\nconst DisplayVirtualGroupingOptions: React.FC<{\n product: Product;\n itemHasBadge: boolean;\n isListView?: boolean;\n}> = ({ product, itemHasBadge, isListView = false }) => {\n const { groupingAttributes } = product;\n const { groupMembers } = groupingAttributes || {};\n const overrideNames =\n product.groupingAttributes.configurationOptionSummary || [];\n\n const overrideMap: OverrideMap = overrideNames.reduce(\n (acc: OverrideMap, override) => {\n const trimmedName = override.name.trim();\n acc[trimmedName] = override.overrideName;\n return acc;\n },\n {}\n );\n\n const numberOfGroupMembers = Array.isArray(\n groupMembers?.[0]?.configurationOptions\n )\n ? groupMembers?.[0]?.configurationOptions?.map((i) => i.name.trimEnd())\n : null;\n\n const uniqueOptions: { [key: string]: Set } = {};\n\n groupMembers.forEach((member) => {\n member.configurationOptions.forEach((option) => {\n if (!uniqueOptions[option.name]) {\n uniqueOptions[option.name] = new Set();\n }\n uniqueOptions[option.name]?.add(option.value);\n });\n });\n\n const numberOfUniqueOptions = Object.keys(uniqueOptions).length;\n\n const uniqueCounts = Object.keys(uniqueOptions).map((name) => ({\n name,\n count: uniqueOptions[name]?.size,\n }));\n\n const titleLength = numberOfGroupMembers?.join(\"\").length;\n if (!numberOfGroupMembers || titleLength === undefined) return null;\n\n const overrideNameLength = uniqueCounts.reduce((acc, { name }) => {\n const overrideName = overrideMap[name.trimEnd()];\n const displayName = overrideName || name.trimEnd();\n return acc + displayName.length;\n }, 0);\n\n const optionText = numberOfUniqueOptions > 1 ? \"Options\" : \"Option\";\n\n const textLengthCutoff = itemHasBadge && !isListView ? 7 : 21;\n const maxConfigurations = itemHasBadge && !isListView ? 1 : 2;\n\n const wrapperClassName = itemHasBadge\n ? \"border-l border-solid border-0 pl-1 ml-1 text-gray-800 text-xs font-semibold underline hover:no-underline leading-3\"\n : \"even:border-l even:border-solid even:border-0 even:pl-1 even:ml-1 text-gray-800 text-xs font-semibold underline hover:no-underline\";\n\n // due to text wrapping, if the titleLength and overrideNameLength is greater than 21 characters, we will display the number of options instead\n // if the productBox also displays a badge, cut off at 7 chars and only show 1 configuration as \"options\"\n if (\n numberOfGroupMembers?.length > maxConfigurations ||\n titleLength >= textLengthCutoff ||\n overrideNameLength >= textLengthCutoff\n ) {\n return (\n \n {numberOfUniqueOptions} {optionText}\n \n );\n }\n\n return (\n <>\n {uniqueCounts.map(({ name, count }) => {\n const key = `${name}_${count}`;\n const displayName = overrideMap[name.trimEnd()] || name.trimEnd();\n const addS = overrideMap[name.trimEnd()]\n ? !overrideMap[name.trimEnd()]?.endsWith(\"s\")\n : true;\n return (\n \n {/* Append 's' only if it's not an override name and if the last character of overrideName is not 's' */}\n {`${count} ${displayName}${addS ? \"s\" : \"\"}`}{\" \"}\n \n );\n })}\n \n );\n};\n\nexport default DisplayVirtualGroupingOptions;\n","import React from \"react\";\n\ninterface QuantityCountBadgeProps {\n unitDisplayText: string;\n quantity: number;\n isGridView: boolean;\n}\n\nconst QuantityCountBadge = ({\n unitDisplayText,\n quantity,\n isGridView,\n}: QuantityCountBadgeProps) => {\n const containerStyles = isGridView\n ? \"bottom-[4px] left-[4px]\"\n : \"bottom-[14px] left-[14px]\";\n // add commas to numbers with > 4 digits only\n const formattedQuantity =\n quantity > 9999 ? new Intl.NumberFormat().format(quantity) : quantity;\n return (\n \n \n {formattedQuantity}\n \n \n {unitDisplayText}\n \n \n );\n};\n\nexport default QuantityCountBadge;\n","import { Checkbox, PlusLink } from \"@clarkinc/zest-design-system\";\nimport { Icon, Tooltip } from \"@clarkinc/zest-design-system/ui\";\nimport { Image } from \"@wss/image\";\nimport React, { useEffect, useState } from \"react\";\nimport { connect } from \"react-redux\";\nimport { cls } from \"@wss/cls\";\nimport { Store } from \"@wss/store\";\nimport LimitedSaleStockNotice from \"~/EventDayPage/LimitedSaleStockNotice\";\nimport spritePath from \"~/common/Icon/critical-symbol.svg\";\nimport standardSpritePath from \"~/common/Icons/Standard/standard-sprite.svg\";\n\nimport zestSpritePath from \"~/common/Icons/Zest/remixicon.symbol.v1.svg\";\nimport type { User } from \"~/common/Store/connectUserAndChat\";\nimport Stars from \"../../common/Stars\";\nimport {\n Product,\n ProductComparisonItem,\n SelectedProduct,\n} from \"../../common/Store/models/ProductListing\";\nimport { RootState, UserState } from \"../../common/Store/models/RootReadonly\";\nimport { PurchasingGroupProps } from \"../PurchasingGroupPage/purchasingGroupPageResult\";\nimport AddToCartButton from \"./AddToCart\";\nimport DisplayVirtualGroupingOptions from \"./DisplayVirtualGroupingOptions\";\nimport GoodBetterBest from \"./GoodBetterBestRibbon\";\nimport PlatinumPlusExclusive from \"./PlatinumPlusExclusive\";\nimport Pricing from \"./Pricing\";\nimport Ribbon from \"./Ribbon\";\nimport getLowestPrice from \"./getLowestPrice\";\nimport getLowestPriceGroupMember from \"./getLowestPriceGroupMember\";\nimport isActiveSale from \"./isActiveSale\";\nimport isNonExclusiveForPlatinumPlusProduct from \"./isNonExclusivePlatinumPlusProduct\";\nimport setSelectedProductToGroupMember from \"./setSelectedProduct\";\nimport QuantityCountBadge from \"./components/QuantityCountBadge\";\nimport { sendGtmEvent } from \"~/analytics/definitions\";\nimport { CompareProductsState } from \"../compareProductStore\";\nimport { getQuantityCountBadgeData } from \"./module\";\n\ntype ProductListingView = {\n productListingView?: \"list\" | \"grid\";\n};\n\ntype ContainerProps = {\n isSelectedForCompare?: boolean;\n itemNumber: string;\n children: React.ReactNode;\n groupMemberItemNumbers?: string[];\n previouslyPurchased?: string;\n defaultTrackedGtmItemNumber?: string;\n isQuantityDiscountPopoverActive?: boolean;\n isOnCompareProductsPage?: boolean;\n} & ProductListingView;\n\nexport const Container = ({\n isSelectedForCompare,\n itemNumber,\n children,\n groupMemberItemNumbers = [],\n productListingView,\n previouslyPurchased = undefined,\n defaultTrackedGtmItemNumber,\n isOnCompareProductsPage = false,\n}: ContainerProps) => {\n let backgroundColor;\n\n if (isSelectedForCompare) {\n if (productListingView === \"grid\") {\n backgroundColor =\n \"bg-white/100 md:bg-white/10 md:bg-gradient-to-b md:from-transparent md:to-white\";\n } else {\n backgroundColor =\n \"bg-white/100 md:bg-white/10 md:bg-gradient-to-r md:from-transparent md:to-white\";\n }\n } else {\n backgroundColor = \"bg-white\";\n }\n const prevPurchasedStyles = previouslyPurchased ? \"pt-4\" : \"\";\n const compareStyles = isOnCompareProductsPage\n ? \"py-4 px-10 min-w-full\"\n : \"border-solid xsl:p-4\";\n\n const productBoxStyles =\n productListingView === \"grid\"\n ? `border-gray-200 border border-t-0 border-l-0 box-border flex flex-col p-2 relative ${prevPurchasedStyles} ${compareStyles}`\n : \"border-gray-200 border-solid border-0 border-b last:border-b-0 block m-0 first:mt-px pr-2 pb-2 relative xs:table xs:p-0 xs:w-full\";\n\n return (\n \n {children}\n \n );\n};\n\ntype ItemNumberProps = {\n itemsOnAutoReorder?: Readonly;\n product: Product;\n user: User;\n selectedProduct: SelectedProduct;\n userHasSelectedGroupMember: boolean;\n} & ProductListingView;\n\nconst ItemNumber = ({\n productListingView,\n selectedProduct,\n product,\n user,\n itemsOnAutoReorder = [],\n userHasSelectedGroupMember,\n}: ItemNumberProps) => {\n const { itemNumber } = userHasSelectedGroupMember ? selectedProduct : product;\n\n const calculateIsActiveAutoReorder = () => {\n return (\n itemsOnAutoReorder.includes(product.itemNumber) ||\n itemsOnAutoReorder.some(\n (autoReorderItem) =>\n product.groupingAttributes.groupMembers\n .map((member) => member.itemNumber)\n .indexOf(autoReorderItem) >= 0\n )\n );\n };\n\n const tooltipContent = calculateIsActiveAutoReorder()\n ? \"You have this item on Auto Reorder\"\n : \"Auto Reorder eligible\";\n\n return (\n \n \n \n Item number\n #\n \n {selectedProduct.isOutlet ||\n (product.groupingAttributes.isVirtual &&\n !userHasSelectedGroupMember)\n ? product.originalId\n : itemNumber}\n \n \n

\n {user.registered && product.isAutomaticReorderEligible && (\n \n \n \n \n \n )}\n \n );\n};\n\ntype TitleProps = {\n descriptionHtml: string;\n link: string;\n oneToFiveStarRating: number;\n hasVirtualGrouping?: boolean;\n showBadge?: boolean;\n} & ProductListingView;\n\nconst Title = ({\n productListingView,\n descriptionHtml,\n link,\n hasVirtualGrouping,\n showBadge,\n}: TitleProps) => {\n let marginTop;\n\n if (productListingView === \"grid\") {\n marginTop = hasVirtualGrouping || showBadge ? \"mt-0\" : \"mt-6\";\n } else {\n marginTop = hasVirtualGrouping || showBadge ? \"mt-0\" : \"mt-2\";\n }\n\n return productListingView === \"grid\" ? (\n \n {descriptionHtml}\n \n ) : (\n \n {descriptionHtml}\n \n );\n};\n\ninterface Props extends ProductListingView {\n product: Product;\n mounted: boolean;\n user: UserState;\n lazyLoadImages: boolean;\n compareProductsStore?: Store;\n hasCustomizableProductsOverride?: boolean;\n purchasingGroupProps?: PurchasingGroupProps;\n itemsOnAutoReorder?: Readonly;\n isItemAlreadyInCart?: boolean;\n index?: number;\n discountCode?: string;\n showSaleStockNotice?: boolean;\n shouldPreselectVirtualGrouping?: boolean;\n facetsWithMultipleSelections?: string[];\n previouslyPurchased?: string;\n setIsQuantityDiscountPopoverOpen?: React.Dispatch<\n React.SetStateAction\n >;\n isQuantityDiscountPopoverOpen?: string;\n isOnCompareProductsPage?: boolean;\n handleCompareErrorModalOpen?: () => void;\n}\n\nconst ProductBox = ({\n product,\n user,\n mounted,\n lazyLoadImages,\n compareProductsStore,\n productListingView,\n hasCustomizableProductsOverride = false,\n purchasingGroupProps,\n itemsOnAutoReorder = [],\n isItemAlreadyInCart = false,\n discountCode,\n showSaleStockNotice = false,\n shouldPreselectVirtualGrouping,\n facetsWithMultipleSelections,\n previouslyPurchased = \"\",\n setIsQuantityDiscountPopoverOpen,\n isQuantityDiscountPopoverOpen = \"\",\n isOnCompareProductsPage = false,\n handleCompareErrorModalOpen,\n}: Props) => {\n const {\n altHtml,\n hasBadge,\n badgeImagePath,\n badgeDisplayText,\n customerExclusivity,\n isRequestAQuoteEnabled,\n qualityRatingMembership,\n oneToFiveStarRating,\n overallRating,\n } = product;\n\n const compareProducts = compareProductsStore?.useState((state) => state) || {\n active: false,\n items: [],\n };\n\n const [selectedProduct, setSelectedProduct] = useState({\n ...product,\n activeSale: product.price.displaySalePrice,\n isOutlet: product.outletAttributes && product.outletAttributes.isOutlet,\n price: {\n ...product.price,\n originalPrice:\n product.outletAttributes && product.outletAttributes.originalPrice,\n },\n });\n\n const [\n userHasSelectedGroupMember,\n setUserHasSelectedGroupMember,\n ] = useState(false);\n\n const [\n preselectedVgMemberItemNumber,\n setPreselectedVgMemberItemNumber,\n ] = useState(\"\");\n\n const {\n link,\n primaryImagePath,\n secondaryImagePath,\n descriptionHtml,\n isWebstaurantPlusEligible,\n isNewProduct,\n itemNumber,\n hasFreeShipping,\n } = userHasSelectedGroupMember ? selectedProduct : product;\n\n const vgCategory =\n product.groupingAttributes.groupMembers[0]?.configurationOptions[0]?.name;\n\n let hasMultipleVgFacets = false;\n\n facetsWithMultipleSelections?.forEach((facet) => {\n if (\n vgCategory?.toLowerCase().replace(/\\s+/g, \"-\") === facet?.toLowerCase()\n ) {\n hasMultipleVgFacets = true;\n }\n });\n\n /**\n * We may cache the HTML in a key value store or on a CDN so we'll double check if\n * the sale is active on the client.\n */\n useEffect(() => {\n const { groupMembers } = product.groupingAttributes;\n\n if (groupMembers === undefined || groupMembers.length === 0) {\n setSelectedProduct({\n ...selectedProduct,\n activeSale: isActiveSale(selectedProduct.price),\n });\n } else if (\n !hasMultipleVgFacets &&\n shouldPreselectVirtualGrouping &&\n product.groupingAttributes.isVirtual &&\n groupMembers.some((x) => x.itemNumber === product.itemNumber)\n ) {\n const groupMember = groupMembers.find(\n (x) => x.itemNumber === product.itemNumber\n );\n if (groupMember) {\n setPreselectedVgMemberItemNumber(groupMember.itemNumber);\n setSelectedProductToGroupMember(\n product,\n groupMember,\n setSelectedProduct\n );\n }\n } else {\n const defaultGroupMember = {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n ...getLowestPriceGroupMember(groupMembers, user, product.originalId)!,\n };\n\n const defaultIsInStock = groupMembers.some((member) => member.isInStock);\n\n /**\n * The isInStock override for the function below is provided so that the default isInStock value for the main ProductBox tile comes from there\n * being at least one VG item in stock\n */\n setSelectedProductToGroupMember(\n product,\n defaultGroupMember,\n setSelectedProduct,\n defaultIsInStock\n );\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [user.index]);\n\n const isSalePriceTheLowest = (() => {\n if (selectedProduct.price.salePrice <= 0) {\n return false;\n }\n\n const lowestPrice = getLowestPrice(\n selectedProduct.price,\n user,\n selectedProduct.activeSale,\n selectedProduct.showBelowMinimumAdvertisedPriceForLoggedInCustomers,\n selectedProduct.showBelowMinimumAdvertisedPriceForPlatinumAndPlusCustomers\n );\n\n return lowestPrice === selectedProduct.price.salePrice;\n })();\n\n const isNewProductOrQualityRating = isNewProduct || qualityRatingMembership;\n\n const showSaleRibbon = selectedProduct.activeSale && isSalePriceTheLowest;\n\n /**\n * Determines whether a margin bottom style should be added to a ribbon in grid view.\n * @remarks\n *\n * Order of visible ribbons in grid view: New, Quality Rating, Sale.\n *\n * Returns true if New product ribbon exists and either Sale or Quality Rating exists,\n * OR If Quality rating ribbon exists and Sale ribbon exists.\n *\n */\n const moreThanOneRibbon =\n (isNewProduct && !!(showSaleRibbon || qualityRatingMembership)) ||\n !!(qualityRatingMembership && showSaleRibbon);\n\n const showRibbonStack =\n isWebstaurantPlusEligible ||\n isNewProductOrQualityRating ||\n showSaleRibbon ||\n oneToFiveStarRating > 0;\n\n const compareItemNumbers = compareProducts.items.map(\n (item) => item.itemNumber\n );\n const isSelectedForCompare =\n compareProducts.active &&\n ((!product.groupingAttributes.isVirtual &&\n compareItemNumbers.includes(itemNumber)) ||\n // if item is vg and any members are selected, keep it selected\n (product.groupingAttributes.isVirtual &&\n [\n product.groupingAttributes.virtualGroupItemNumber,\n ...product.groupingAttributes.groupMembers.map((gm) => gm.itemNumber),\n ].some((iNum) => compareItemNumbers.includes(iNum))));\n\n const compareItemToAdd: ProductComparisonItem = {\n itemNumber,\n itemTitle: descriptionHtml,\n itemImage: primaryImagePath,\n itemLink: link,\n };\n\n useEffect(\n function itemNumberChangedEffect() {\n if (!compareProducts.active) {\n return;\n }\n\n const vgItemNumbers = [\n product.groupingAttributes.virtualGroupItemNumber,\n ...product.groupingAttributes.groupMembers.map((gm) => gm.itemNumber),\n ].filter((gm) => !!gm);\n\n if (vgItemNumbers.some((item) => compareItemNumbers.includes(item))) {\n const currentItemIndex = (\n compareProducts.items ?? []\n ).findIndex((item) => vgItemNumbers.includes(item.itemNumber));\n\n const items = [...(compareProducts.items ?? [])];\n\n items[currentItemIndex] = compareItemToAdd;\n\n compareProductsStore?.setState({\n items,\n });\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [itemNumber]\n );\n\n const handleCompareCheckboxClick: React.ChangeEventHandler = (\n event\n ) => {\n const vgItemNumbers = [\n product.groupingAttributes.virtualGroupItemNumber,\n ...product.groupingAttributes.groupMembers.map((gm) => gm.itemNumber),\n ].filter((gm) => gm);\n\n const currentVgItemIndex = compareItemNumbers.findIndex((iNum) =>\n vgItemNumbers.includes(iNum)\n );\n const currentItemIndex = (compareProducts.items ?? []).findIndex((item) =>\n vgItemNumbers.includes(item.itemNumber)\n );\n const itemNumbers = [...compareItemNumbers];\n const items = [...(compareProducts.items ?? [])];\n\n if (\n !isSelectedForCompare &&\n compareItemNumbers.length >= 4 &&\n handleCompareErrorModalOpen\n ) {\n event.preventDefault();\n handleCompareErrorModalOpen();\n return;\n }\n\n if (!isSelectedForCompare) {\n if (currentVgItemIndex >= 0) {\n itemNumbers[currentVgItemIndex] = itemNumber;\n } else {\n itemNumbers.push(itemNumber);\n }\n if (currentItemIndex >= 0) {\n items[currentItemIndex] = compareItemToAdd;\n } else {\n items.push(compareItemToAdd);\n }\n\n compareProductsStore?.setState({ items });\n } else {\n compareProductsStore?.setState({\n items: items.filter(\n (item) =>\n item.itemNumber !== itemNumber &&\n !vgItemNumbers.includes(item.itemNumber)\n ),\n });\n }\n };\n\n const groupMemberItemNumbers = product.groupingAttributes?.groupMembers?.map(\n (p) => p.itemNumber\n );\n\n const defaultTrackedGtmItemNumber =\n selectedProduct.isOutlet ||\n (product.groupingAttributes.isVirtual && !userHasSelectedGroupMember)\n ? product.originalId\n : itemNumber;\n\n const isQuantityDiscountPopoverActive =\n isQuantityDiscountPopoverOpen === itemNumber ||\n (!!groupMemberItemNumbers.length &&\n groupMemberItemNumbers.includes(isQuantityDiscountPopoverOpen));\n\n const shouldShowGbbRibbon =\n qualityRatingMembership &&\n qualityRatingMembership.groupItemNumbers?.length > 0;\n\n const gridQuoteStyles = isRequestAQuoteEnabled\n ? \"pt-5 xs:pt-7 xs:pb-2 leading-[13px]\"\n : \"pt-4\";\n const listQuoteStyles = isRequestAQuoteEnabled ? \"leading-[13px]\" : \"\";\n\n const pricingStyles =\n productListingView === \"grid\"\n ? `flex flex-col justify-center flex-auto text-center xs:min-h-11 ${gridQuoteStyles}`\n : `block text-left w-auto xs:table-cell xs:align-middle xs:text-center xs:w-3/12 ${listQuoteStyles}`;\n\n const showBadge = hasBadge && badgeDisplayText?.length > 0;\n\n const badgeData = getQuantityCountBadgeData(\n selectedProduct.unitsPerPackaging ?? 0,\n selectedProduct.productBadges ?? [],\n !!product.groupingAttributes?.isGroupMaster && !userHasSelectedGroupMember,\n product.groupingAttributes.groupMembers,\n selectedProduct.unitOfMeasure\n );\n\n const productBoxAnalyticsOnClick = () => {\n if (!badgeData) return;\n sendGtmEvent({\n event: \"ga4_event\",\n eventName: \"PLP Quantity Badge Tracking\",\n eventAction: `PLP Product Click ${product.itemNumber}`,\n eventLabel: \"Quantity Badge Visible\",\n eventCategory: window.location.href,\n });\n };\n\n return (\n \n <>\n {!compareProducts ||\n (compareProducts.active && (\n \n \n \n \n \n ))}\n\n {productListingView === \"grid\" ? (\n <>\n \n \n \n \n Last Purchased {previouslyPurchased}\n

\n \n {badgeData && (\n \n )}\n \n {secondaryImagePath && (\n \n )}\n \n {(showBadge || product.groupingAttributes.isVirtual) && (\n \n \n {showBadge && (\n <>\n \n

\n {badgeDisplayText}\n

\n \n )}\n {product.groupingAttributes.isVirtual && (\n \n )}\n
\n
\n )}\n \n \n \n {showRibbonStack && (\n \n {\" \"}\n {isWebstaurantPlusEligible && !isRequestAQuoteEnabled && (\n \n )}\n {isNewProduct && (\n \n New\n \n )}\n {shouldShowGbbRibbon && (\n \n )}\n \n )}\n \n ) : (\n \n \n {badgeData && (\n \n )}\n \n {secondaryImagePath && (\n \n )}\n \n \n )}\n \n\n \n {productListingView === \"list\" ? (\n \n \n Last Purchased {previouslyPurchased}\n

\n ) : null}\n\n {productListingView === \"list\" && (\n \n \n {showBadge && (\n <>\n \n \n {badgeDisplayText}\n \n \n )}\n {product.groupingAttributes.isVirtual && (\n \n )}\n \n \n )}\n {productListingView === \"list\" ? (\n \n ) : null}\n\n \n {isWebstaurantPlusEligible && !isRequestAQuoteEnabled && (\n \n )}\n {productListingView === \"grid\" && (\n
\n \n
\n )}\n \n \n {showRibbonStack && productListingView === \"list\" && (\n \n {\" \"}\n {isWebstaurantPlusEligible && !isRequestAQuoteEnabled && (\n \n )}\n {isNewProduct && (\n \n New\n \n )}\n {shouldShowGbbRibbon && (\n \n )}\n {productListingView === \"list\" && (\n
\n \n
\n )}\n \n )}\n \n \n \n {selectedProduct.isOutlet && product.outletAttributes.condition && (\n \n {product.outletAttributes.condition}\n \n )}\n {isRequestAQuoteEnabled ? (\n <>\n

\n Custom Pricing\n

\n

Made-to-Order

\n \n ) : (\n \n )}\n {hasFreeShipping && !user.hasWebPlus && !isRequestAQuoteEnabled && (\n
\n \n Free Shipping\n \n
\n )}\n \n {isNonExclusiveForPlatinumPlusProduct(customerExclusivity, user) && (\n \n )}\n {productListingView === \"grid\" &&\n showSaleStockNotice &&\n product.saleStock?.saleStockLimit &&\n product.saleStock?.remainingSaleQuantity && (\n \n )}\n \n );\n};\n\nexport const mapStateToProps = (state: RootState, ownProps: Props) => {\n if (!ownProps.mounted) return { user: ownProps.user };\n\n return { user: state.user };\n};\n\nexport default connect(mapStateToProps)(ProductBox);\n","import {\n GroupMember,\n ProductBadge,\n} from \"~/common/Store/models/ProductListing\";\n\ntype BadgeData = {\n unitOfMeasure: string;\n unitsPerPackaging: number;\n};\n\n// eslint-disable-next-line import/prefer-default-export\nexport const getQuantityCountBadgeData = (\n unitsPerPackaging: number,\n productBadges: ProductBadge[],\n isGroupMaster: boolean,\n groupMembers: GroupMember[],\n unitOfMeasure: string\n): BadgeData | null => {\n if (\n unitsPerPackaging <= 1 ||\n !productBadges.some((badge) => badge.name === \"Quantity Count\")\n ) {\n return null;\n }\n\n if (isGroupMaster) {\n const haveSameUnitsPerPackaging =\n groupMembers.length > 0 &&\n groupMembers.every(\n (member) =>\n member.unitsPerPackaging === groupMembers[0]?.unitsPerPackaging\n );\n return haveSameUnitsPerPackaging\n ? { unitOfMeasure, unitsPerPackaging }\n : null;\n }\n return { unitOfMeasure, unitsPerPackaging };\n};\n"],"names":["groupMembers","product","itemHasBadge","isListView","groupingAttributes","overrideMap","configurationOptionSummary","reduce","acc","override","name","trim","overrideName","numberOfGroupMembers","Array","isArray","configurationOptions","map","i","trimEnd","uniqueOptions","forEach","member","option","Set","add","value","numberOfUniqueOptions","Object","keys","length","uniqueCounts","count","size","titleLength","join","undefined","overrideNameLength","optionText","textLengthCutoff","maxConfigurations","wrapperClassName","span","className","key","displayName","addS","endsWith","unitDisplayText","quantity","containerStyles","isGridView","formattedQuantity","Intl","NumberFormat","format","data-testid","style","boxShadow","WebkitFontSmoothing","Container","mapStateToProps","backgroundColor","isSelectedForCompare","itemNumber","children","groupMemberItemNumbers","productListingView","previouslyPurchased","defaultTrackedGtmItemNumber","isOnCompareProductsPage","compareStyles","productBoxStyles","div","data-item-number","data-group-members","id","gtm-tracking-number","ItemNumber","selectedProduct","user","itemsOnAutoReorder","userHasSelectedGroupMember","calculateIsActiveAutoReorder","includes","some","autoReorderItem","indexOf","tooltipContent","p","color","fontSize","top","left","transform","aria-hidden","isOutlet","isVirtual","originalId","registered","isAutomaticReorderEligible","Tooltip","content","button","type","Icon","spriteSheetHref","standardSpritePath","cls","Title","marginTop","descriptionHtml","link","hasVirtualGrouping","showBadge","a","href","state","ownProps","mounted","connect","qualityRatingMembership","lazyLoadImages","compareProductsStore","hasCustomizableProductsOverride","purchasingGroupProps","isItemAlreadyInCart","discountCode","showSaleStockNotice","shouldPreselectVirtualGrouping","facetsWithMultipleSelections","setIsQuantityDiscountPopoverOpen","isQuantityDiscountPopoverOpen","handleCompareErrorModalOpen","altHtml","hasBadge","badgeImagePath","badgeDisplayText","customerExclusivity","isRequestAQuoteEnabled","oneToFiveStarRating","overallRating","compareProducts","useState","active","items","activeSale","price","displaySalePrice","outletAttributes","originalPrice","setSelectedProduct","setUserHasSelectedGroupMember","preselectedVgMemberItemNumber","setPreselectedVgMemberItemNumber","primaryImagePath","secondaryImagePath","isWebstaurantPlusEligible","isNewProduct","hasFreeShipping","vgCategory","hasMultipleVgFacets","facet","toLowerCase","replace","useEffect","isActiveSale","x","groupMember","find","setSelectedProductToGroupMember","defaultGroupMember","getLowestPriceGroupMember","defaultIsInStock","isInStock","index","isSalePriceTheLowest","salePrice","getLowestPrice","showBelowMinimumAdvertisedPriceForLoggedInCustomers","showBelowMinimumAdvertisedPriceForPlatinumAndPlusCustomers","isNewProductOrQualityRating","showSaleRibbon","moreThanOneRibbon","showRibbonStack","compareItemNumbers","item","virtualGroupItemNumber","gm","iNum","compareItemToAdd","itemTitle","itemImage","itemLink","vgItemNumbers","filter","currentItemIndex","findIndex","setState","badgeData","isQuantityDiscountPopoverActive","shouldShowGbbRibbon","groupItemNumbers","listQuoteStyles","pricingStyles","getQuantityCountBadgeData","unitsPerPackaging","productBadges","isGroupMaster","unitOfMeasure","productBoxAnalyticsOnClick","sendGtmEvent","event","eventName","eventAction","eventLabel","eventCategory","window","location","Checkbox","aria-label","aria-checked","label","theme","onChange","currentVgItemIndex","itemNumbers","preventDefault","push","checked","onClick","zestSpritePath","QuantityCountBadge","Image","alt","src","width","height","loading","fetchpriority","img","DisplayVirtualGroupingOptions","PlusLink","iconProps","spritePath","linkProps","rel","Ribbon","bgcolor","squareLeftSide","isoncompareproducts","GoodBetterBest","qualityRating","tabIndex","Stars","rating","containerClasses","PlatinumPlusExclusive","condition","data-component","Pricing","customizablePricingExtraClassTwo","hasWebPlus","isNonExclusiveForPlatinumPlusProduct","AddToCartButton","groupMemberSelected","saleStock","saleStockLimit","remainingSaleQuantity","LimitedSaleStockNotice","saleStockAvailable","badge","every"],"sourceRoot":""}