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,MAnDzBrL,IAAAA,cAACuL,EAAAA,QAAe,CACZhM,QAAS+D,EAAK/D,QACdhG,QAASA,EACTqG,gBAAiBsH,EACjBrH,oBAAqBsH,EACrB1H,2BAA4BA,MAInCqL,EACKvL,EAAQ8K,MACJQ,GACE7K,IAAAA,cAACwL,EAAAA,EAA0B,CACvBC,SAAS,MACTnC,UAAWA,GACXoC,aAAcnM,EAAQ8K,MACtB9Q,QAASA,EACTsR,eAAgBA,EAChBc,qBAAiB9R,EACjB+R,eAAW/R,EACXgS,0BAAsBhS,IAG5BgR,EACJ,MA0BtB,IAA2BQ,KAjVG,KAke9B","sources":["webpack://mattressfirm/./src/Utilities/product-search-result-utils.tsx?58f2","webpack://mattressfirm/./src/data-actions/core-product-atp-info-action.ts?15b0","webpack://mattressfirm/./src/themes/mattressfirm/views/components/delivery-message/deliverymessage.component.tsx?e440","webpack://mattressfirm/./src/themes/mattressfirm/views/components/product.component.tsx?8ce2","webpack://mattressfirm/./src/Utilities/convert-to-titlecase.ts?8d6f"],"sourcesContent":["import { IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\r\nimport dayjs from 'dayjs';\r\nimport Cookies from 'universal-cookie';\r\nimport { IMFIATPInventoryEntity, IMFICartLine, IMFICLDeliveryScheduleParameters } from '../actions/CoreProductDataServiceEntities.g';\r\nimport { IMFIAvailablePromotionDescription, IMFIItem } from '../actions/EyebrowMessageDataServiceEntities.g';\r\nimport getEyebrowAction, { GetEyebrowMessageInput } from '../actions/get-eyebrow-message.action';\r\nimport _getDeliveryByMessage from './get-delivery-by-message';\r\n\r\nexport const _getEyebrowMessage = async (products: IMFIItem[], context: ICoreContext>) => {\r\n const priceGroupForAPICall = context.app && context.app.config.priceGroup;\r\n if (products && products.length > 0 && (priceGroupForAPICall !== '' || priceGroupForAPICall !== undefined)) {\r\n const items: IMFIItem[] | undefined = [];\r\n products.map(item => {\r\n const singleItem: IMFIItem = {\r\n ItemId: item.ItemId,\r\n DistinctProductVariant: item.DistinctProductVariant\r\n };\r\n items.push(singleItem);\r\n });\r\n\r\n const requestBody: IMFIAvailablePromotionDescription = {\r\n PriceGroup: priceGroupForAPICall,\r\n Items: items\r\n };\r\n const getEyebrowMessageInput = new GetEyebrowMessageInput(requestBody, undefined, true);\r\n try {\r\n const result = await getEyebrowAction(getEyebrowMessageInput, context.actionContext);\r\n if (result) {\r\n return result;\r\n }\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n }\r\n return null;\r\n};\r\n\r\nexport const _makeDeliveryMessage = (days: string) => {\r\n if (days === '' || days === undefined || days === null) {\r\n return '';\r\n }\r\n\r\n let deliveryByMessage = '';\r\n let date = new Date();\r\n const daysSpan = days.split('-');\r\n let deliveryDate = Date.now();\r\n if (daysSpan && daysSpan[1] !== undefined && daysSpan.length) {\r\n let deliveryByMessageRange = '';\r\n daysSpan.map((item: string) => {\r\n date = new Date();\r\n deliveryDate = Date.now();\r\n if (parseInt(item, 10) > 0) {\r\n let numberOfDays = parseInt(item, 10);\r\n let newDate = deliveryDate;\r\n while (numberOfDays > 0) {\r\n newDate = date.setDate(date.getDate() + 1);\r\n if (dayjs(newDate).format('d') !== '0' && dayjs(newDate).format('d') !== '6') {\r\n numberOfDays--;\r\n }\r\n }\r\n deliveryByMessage = dayjs(newDate).format('MMM D');\r\n if (deliveryByMessageRange !== '') {\r\n deliveryByMessageRange = `${deliveryByMessageRange} to ${deliveryByMessage}`;\r\n } else {\r\n deliveryByMessageRange = deliveryByMessage;\r\n newDate = date.setDate(date.getDate() - parseInt(item[0], 10));\r\n }\r\n }\r\n });\r\n return `Delivery by ${deliveryByMessageRange}`;\r\n } else {\r\n deliveryByMessage = dayjs(deliveryDate).format('MMM D');\r\n let numberOfDays = parseInt(days, 10);\r\n let newDate = deliveryDate;\r\n let flag = true;\r\n while (numberOfDays > 0) {\r\n newDate = date.setDate(date.getDate() + 1);\r\n if (dayjs(newDate).format('d') !== '0' && dayjs(newDate).format('d') !== '6') {\r\n numberOfDays--;\r\n } else {\r\n flag = false;\r\n }\r\n }\r\n deliveryByMessage =\r\n flag && days === '1'\r\n ? `Tomorrow ${dayjs(Date.now()).format('MMM D')}`\r\n : dayjs(newDate).format('ddd MMM, D');\r\n return `Delivery by ${deliveryByMessage}`;\r\n }\r\n};\r\n\r\n// tslint:disable-next-line: no-any\r\nexport const _coreProductATPCall = async (\r\n itemLines: IMFICartLine[],\r\n setCoreProductATPData: React.Dispatch,\r\n context: ICoreContext>\r\n) => {\r\n const cookies = new Cookies();\r\n const zipcode = cookies.get('zip_code');\r\n if (itemLines && itemLines.length === 0) {\r\n setCoreProductATPData([]);\r\n }\r\n const currentDate = Date.now();\r\n const requestBody: IMFICLDeliveryScheduleParameters = {\r\n InventoryType: 'Delivery',\r\n Weeks: context.app.config.weeksPDPforATPCall,\r\n StoreId: '',\r\n Page: 'plp',\r\n RequestedDate: dayjs(currentDate).format('MM/DD/YYYY'),\r\n ZipCode: zipcode,\r\n ItemLines: itemLines\r\n };\r\n const getDeliveryByMessage = _getDeliveryByMessage(requestBody, context);\r\n getDeliveryByMessage\r\n .then(result => {\r\n if (result !== undefined && result?.ATPInventoryData && result?.ATPInventoryData.length > 0) {\r\n setCoreProductATPData(result?.ATPInventoryData);\r\n } else {\r\n setCoreProductATPData([]);\r\n }\r\n })\r\n .catch(e => {\r\n console.log('Error', e);\r\n });\r\n};\r\n\r\nconst _setTime = (time: string | undefined) => {\r\n if (time !== undefined && time !== '') {\r\n const temp = time.split(' ');\r\n if (temp && temp.length > 0) {\r\n let newDatewithTime = dayjs(Date.now()).format('M/D/YYYY');\r\n newDatewithTime = `${newDatewithTime} ${temp[0]}:00 ${temp[1].toUpperCase()}`;\r\n return newDatewithTime;\r\n }\r\n }\r\n return '';\r\n};\r\n\r\nexport interface IATPInventoryData {\r\n deliveryByMessage: string;\r\n locationId: string;\r\n}\r\n\r\nexport const _getSoonestDeliveryDate = (coreProductATPData: IMFIATPInventoryEntity[]): IATPInventoryData => {\r\n let deliveryDetails = {\r\n deliveryByMessage: '',\r\n locationId: ''\r\n };\r\n if (!coreProductATPData || !coreProductATPData.length) {\r\n return deliveryDetails;\r\n }\r\n for (let index = 0; index < coreProductATPData.length; index++) {\r\n const item = coreProductATPData[index];\r\n if (item.Available === 'YES' && item.ATPQuantity !== undefined && parseInt(item.ATPQuantity, 10) > 0) {\r\n const date = new Date();\r\n const today = dayjs(Date.now()).format('D M YY');\r\n const deliveryDate = dayjs(item.SlotDate).format('D M YY');\r\n const currHour = dayjs(Date.now()).format('H');\r\n if (today === deliveryDate) {\r\n const deliveryMessage =\r\n _setTime(item.StartTime) !== ''\r\n ? parseInt(dayjs(_setTime(item.StartTime)).format('H'), 10) < 14 && parseInt(currHour, 10) < 14\r\n ? `Delivery by Today ${dayjs(Date.now()).format('MMM D')}`\r\n : `Delivery by Tomorrow ${dayjs(date.setDate(date.getDate() + 1)).format('MMM D')}`\r\n : '';\r\n deliveryDetails = {\r\n deliveryByMessage: deliveryMessage,\r\n locationId: item.Location1!\r\n };\r\n break;\r\n } else {\r\n const deliveryMessage = `Delivery by ${dayjs(item.SlotDate).format('MMM D')}`;\r\n deliveryDetails = {\r\n deliveryByMessage: deliveryMessage,\r\n locationId: item.Location1!\r\n };\r\n break;\r\n }\r\n }\r\n }\r\n return deliveryDetails;\r\n};\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICoreContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport dayjs from 'dayjs';\r\nimport Cookies from 'universal-cookie';\r\nimport { IMFIATPInventoryEntity, IMFICartLine, IMFICLDeliveryScheduleParameters } from '../actions/CoreProductDataServiceEntities.g';\r\nimport _getDeliveryByMessage from '../Utilities/get-delivery-by-message';\r\n// tslint:disable-next-line: completed-docs\r\nexport class CoreProductATPInfoInput implements IActionInput {\r\n public itemLine?: IMFICartLine;\r\n public ctx?: ICoreContext>;\r\n constructor(itemLine?: IMFICartLine, ctx?: ICoreContext>) {\r\n this.ctx = ctx;\r\n this.itemLine = itemLine;\r\n }\r\n public getCacheKey = () => `PLPCard${this.itemLine?.VariantRecordId?.toString()}`;\r\n public getCacheObjectType = () => `PLPCardIMFIATPInventoryEntity`;\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\nexport async function getATPInfoForProductAction(\r\n input: CoreProductATPInfoInput,\r\n actionContext: IActionContext\r\n): Promise {\r\n let coreProductATPInfo: IMFIATPInventoryEntity[] = [];\r\n\r\n const cookies = new Cookies();\r\n const zipcode = cookies.get('zip_code');\r\n const date = new Date();\r\n const currentDate = date.setDate(date.getDate());\r\n const requestBody: IMFICLDeliveryScheduleParameters = {\r\n InventoryType: 'Delivery',\r\n Weeks: input.ctx!.app.config.weeksPDPforATPCall,\r\n StoreId: '',\r\n Page: 'plp',\r\n RequestedDate: dayjs(currentDate).format('MM/DD/YYYY'),\r\n ZipCode: zipcode,\r\n ItemLines: [input.itemLine!]\r\n };\r\n const getDeliveryByMessage = _getDeliveryByMessage(requestBody, input.ctx!);\r\n await getDeliveryByMessage\r\n .then(result => {\r\n if (result !== undefined && result?.ATPInventoryData && result?.ATPInventoryData.length > 0) {\r\n coreProductATPInfo = result?.ATPInventoryData;\r\n return coreProductATPInfo;\r\n }\r\n return coreProductATPInfo;\r\n })\r\n .catch(e => {\r\n console.log('Error', e);\r\n });\r\n return coreProductATPInfo;\r\n}\r\n\r\nexport default createObservableDataAction({\r\n action: >getATPInfoForProductAction\r\n});\r\n","import { ICoreContext, IGeneric, IAny } from '@msdyn365-commerce/core';\r\nimport { AttributeValue, CommerceProperty } from '@msdyn365-commerce/retail-proxy';\r\nimport React, { useEffect } from 'react';\r\nimport { IMFICartLine } from '../../../../../actions/CoreProductDataServiceEntities.g';\r\nimport getATPInfoForProductAction, { CoreProductATPInfoInput } from '../../../../../data-actions/core-product-atp-info-action';\r\nimport { IBrandListData } from '../../../../../modules/mfrm-buybox/mfrm-buybox.view';\r\nimport { _getSoonestDeliveryDate, _makeDeliveryMessage } from '../../../../../Utilities/product-search-result-utils';\r\nimport { IProductComponentProps } from '../product.component';\r\n\r\ninterface IDeliveryMessage {\r\n product?: IProductComponentProps[\"data\"][\"product\"];\r\n context: ICoreContext>;\r\n isMasterProduct?: boolean;\r\n attributeValues?: AttributeValue[];\r\n extensionProperties?: CommerceProperty[];\r\n lowestPriceVariantRecordId?: string;\r\n}\r\n\r\n//TODO: common method; move to general utility file. AND change return type to an Enumeration\r\nexport const _getProductType = (shippingInformation: string | undefined): string => {\r\n if (shippingInformation && shippingInformation.toLowerCase() === 'delivery') {\r\n return 'Core';\r\n }\r\n if (shippingInformation && shippingInformation.toLowerCase() === 'parcel') {\r\n return 'Small Parcel';\r\n }\r\n if (shippingInformation && shippingInformation.toLowerCase() === 'drop ship') {\r\n return 'Drop Ship';\r\n }\r\n return '';\r\n};\r\n\r\nexport const computeItemLines = (\r\n product: IDeliveryMessage['product'],\r\n defaultVariantId: number | undefined,\r\n lowestPriceVariantRecordId: string | undefined\r\n) => {\r\n if (product?.IsMasterProduct) {\r\n if (defaultVariantId && defaultVariantId !== 0) {\r\n return defaultVariantId.toString();\r\n }\r\n if (lowestPriceVariantRecordId && lowestPriceVariantRecordId !== '') {\r\n return lowestPriceVariantRecordId;\r\n }\r\n }\r\n return product?.RecordId.toString();\r\n};\r\n\r\nconst DeliveryMessage: React.FC = ({\r\n product,\r\n context,\r\n attributeValues,\r\n extensionProperties,\r\n lowestPriceVariantRecordId\r\n}) => {\r\n const [productDeliveryMessage, setProductDeliveryMessage] = React.useState('');\r\n const { app } = context;\r\n const shippingInformationSmall = attributeValues && attributeValues.find(\r\n (attr: AttributeValue) => attr.Name?.trim() === app.config.smallParcelAttributeKey\r\n )?.TextValue?.toLowerCase();\r\n\r\n const defaultVariantId = extensionProperties && extensionProperties.find(\r\n (property: CommerceProperty) => property?.Key === \"Unbxd_DefaultVariantID\"\r\n )?.Value?.LongValue;\r\n\r\n const defaultVariantShippingInformation = extensionProperties && extensionProperties.find(\r\n (property: CommerceProperty) => property?.Key === \"Unbxd_DefaultVariantShippingInformation\"\r\n )?.Value?.StringValue;\r\n\r\n useEffect(() => {\r\n if ((_getProductType(defaultVariantShippingInformation || shippingInformationSmall)) === 'Core') {\r\n const itemLines: IMFICartLine = {\r\n ItemId: product?.ItemId,\r\n Quantity: 1,\r\n VariantRecordId: computeItemLines(product, defaultVariantId, lowestPriceVariantRecordId)\r\n };\r\n const ATPInfoInput: CoreProductATPInfoInput = new CoreProductATPInfoInput(itemLines, context);\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n getATPInfoForProductAction(ATPInfoInput, context?.actionContext).then(actionResults => {\r\n let delMsg = '';\r\n if (actionResults !== undefined && actionResults !== null && actionResults.length > 0) {\r\n delMsg = _getSoonestDeliveryDate(actionResults).deliveryByMessage;\r\n if (delMsg === '') {\r\n delMsg = app.config.defaultDeliveryMessage ? app.config.defaultDeliveryMessage : '';\r\n }\r\n } else {\r\n delMsg = app.config.defaultDeliveryMessage ? app.config.defaultDeliveryMessage : '';\r\n }\r\n setProductDeliveryMessage(delMsg);\r\n });\r\n } else if ((\r\n (_getProductType(defaultVariantShippingInformation || shippingInformationSmall)) === 'Small Parcel' ||\r\n (_getProductType(defaultVariantShippingInformation || shippingInformationSmall)) === 'Drop Ship'\r\n )) {\r\n let deliveryDays =\r\n attributeValues && attributeValues.find(attr => attr.Name?.trim() === app.config.leadTime)?.TextValue;\r\n if (\r\n (deliveryDays === '' || deliveryDays === undefined || deliveryDays === null) &&\r\n app.config.brandList &&\r\n app.config.brandList.length > 0\r\n ) {\r\n const brand =\r\n attributeValues &&\r\n attributeValues.find(\r\n attr =>\r\n app.config.brandBackofficeAttributePlp &&\r\n attr.Name?.trim() === app.config.brandBackofficeAttributePlp\r\n )?.TextValue?.toLowerCase();\r\n\r\n if (brand !== undefined && brand !== null && brand !== '') {\r\n app.config.brandList.map((singleBrand: IBrandListData) => {\r\n if (singleBrand.brandName.toLowerCase() === brand) {\r\n deliveryDays =\r\n singleBrand.brandLeadtime !== undefined &&\r\n singleBrand.brandLeadtime !== '' &&\r\n singleBrand.brandLeadtime !== null\r\n ? singleBrand.brandLeadtime\r\n : '';\r\n }\r\n });\r\n }\r\n deliveryDays = app.config.brandList[0].brandLeadtime;\r\n }\r\n if (deliveryDays && productDeliveryMessage === '') {\r\n setProductDeliveryMessage(_makeDeliveryMessage(deliveryDays));\r\n }\r\n }\r\n }, [defaultVariantId, defaultVariantShippingInformation]);\r\n\r\n return productDeliveryMessage ? (\r\n
\r\n {productDeliveryMessage}\r\n
\r\n ) : null;\r\n};\r\n\r\nexport default DeliveryMessage;","import { getProductPageUrlSync } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n Button,\r\n format,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n ITelemetryContent,\r\n onTelemetryClick\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport { PriceComponent, RatingComponent, IPriceComponentResources } from '@msdyn365-commerce/components';\r\nimport { CommerceProperty } from '@msdyn365-commerce/retail-proxy';\r\nimport MsDyn365, {\r\n IComponent,\r\n IComponentProps,\r\n ICoreContext,\r\n IGridSettings,\r\n IImageData,\r\n IImageSettings,\r\n Image,\r\n IRequestContext,\r\n msdyn365Commerce,\r\n RichTextComponent\r\n} from '@msdyn365-commerce/core';\r\nimport { AttributeValue, ProductPrice, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport React from 'react';\r\n// VSI Customization - starts\r\nimport { convertToTitlecase } from '../../../../Utilities/convert-to-titlecase';\r\nimport { getBVAttributeValues } from '../../../../Utilities/get-bv-attributes';\r\nimport { buildProductBadge, parseBadgeData } from '../../../../Utilities/get-product-badge';\r\nimport { parseBrandName } from '../../../../Utilities/get-product-brand';\r\nimport {\r\n _coreProductATPCall,\r\n _getEyebrowMessage,\r\n _getSoonestDeliveryDate,\r\n _makeDeliveryMessage\r\n} from '../../../../Utilities/product-search-result-utils';\r\nimport { FinancingPerMonthComponent } from '../../custom-components/financing-per-month-component';\r\nimport DeliveryMessage from './delivery-message';\r\n// VSI Customization - ends\r\nexport interface IProductComponentProps extends IComponentProps<{ product?: ProductSearchResult }> {\r\n className?: string;\r\n imageSettings?: IImageSettings;\r\n savingsText?: string;\r\n freePriceText?: string;\r\n originalPriceText?: string;\r\n currentPriceText?: string;\r\n ratingAriaLabel?: string;\r\n allowBack?: boolean;\r\n telemetryContent?: ITelemetryContent;\r\n quickViewButton?: React.ReactNode;\r\n eyebrowMessage?: string | undefined;\r\n badgeAttribute?: string;\r\n deliveryMessage?: string;\r\n isRefinersEnabled?: boolean;\r\n // VSI Customization - Copied following 3 props from OOTB product.component to be used in product recommendations for Cart\r\n ratingCountAriaLabel?: string;\r\n isPriceMinMaxEnabled?: boolean;\r\n priceResources?: IPriceComponentResources;\r\n // Customized props for product recommendation on Cart page\r\n displayShopNow?: boolean;\r\n shopNowBtnText?: string;\r\n}\r\n\r\nexport interface IEyebrowMessageDimensions {\r\n height: number;\r\n visibleHeight: number;\r\n}\r\n\r\nexport interface IProductComponent extends IComponent { }\r\n\r\nconst PriceComponentActions = {};\r\n\r\n// tslint:disable-next-line: max-func-body-length cyclomatic-complexity\r\nconst ProductCard: React.FC = ({\r\n data,\r\n context,\r\n imageSettings,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText,\r\n ratingAriaLabel,\r\n allowBack,\r\n typeName,\r\n id,\r\n telemetryContent,\r\n quickViewButton,\r\n eyebrowMessage,\r\n badgeAttribute,\r\n deliveryMessage,\r\n isRefinersEnabled,\r\n displayShopNow,\r\n shopNowBtnText\r\n}) => {\r\n // VSI Customization - starts\r\n const {\r\n app: {\r\n config: { brandBackofficeAttributePlp, enableAttributeBasedRating }\r\n }\r\n } = context;\r\n const getEyebrowElementRef = React.useRef(null);\r\n const eyebrowElement = getEyebrowElementRef.current?.querySelector('.mfrm-eyebrow__button-plp') as Element;\r\n const [isTruncated, setTruncated] = React.useState({\r\n height: eyebrowElement?.scrollHeight,\r\n visibleHeight: eyebrowElement?.clientHeight\r\n });\r\n\r\n const badgeAttributeToUse = context.app.config.productBadgeAttribute;\r\n // VSI Customization - ends\r\n const product = data.product;\r\n if (!product) {\r\n return null;\r\n }\r\n // VSI Customization - starts\r\n /** When enabled rating values will be picked from BazaarVoice attributes created on product.\r\n * If disabled rating will be shown from OOTB properties on a product.\r\n * This will be used for PLP and product-collection/product recommendations\r\n */\r\n const { AttributeValues, ExtensionProperties } = product;\r\n let isBVratings = false;\r\n if (AttributeValues && AttributeValues?.find(attr => attr.Name?.trim() === \"BVAverageOverallRating\")) {\r\n isBVratings = true;\r\n }\r\n const averageRating = enableAttributeBasedRating && AttributeValues && isBVratings ? getBVAttributeValues(AttributeValues, 'BVAverageOverallRating') : _parseValue(product?.AverageRating);\r\n const totalRatings = enableAttributeBasedRating && AttributeValues && isBVratings ? getBVAttributeValues(AttributeValues, 'BVTotalReviewCount') : _parseValue(product?.TotalRatings);\r\n React.useEffect(() => {\r\n function handleResize(): void {\r\n setTruncated({\r\n height: eyebrowElement?.scrollHeight,\r\n visibleHeight: eyebrowElement?.clientHeight\r\n });\r\n }\r\n handleResize();\r\n if (MsDyn365.isBrowser) {\r\n window.addEventListener('resize', handleResize);\r\n return () => window.removeEventListener('resize', handleResize);\r\n } else {\r\n return () => null;\r\n }\r\n }, [eyebrowElement?.scrollHeight, eyebrowElement?.clientHeight]);\r\n // VSI Customization - ends\r\n const lowestPriceVariantRecordId = AttributeValues?.find(\r\n attr => attr.Name?.trim() === context.app.config.EcomLowestPriceVariantRecIdKey\r\n )?.TextValue;\r\n const unbxdDefaultVariant = product && product.ExtensionProperties?.find((property: CommerceProperty) => property?.Key === \"Unbxd_DefaultVariantID\")?.Value?.LongValue;\r\n const isMasterProduct = product.IsMasterProduct;\r\n if (isMasterProduct && lowestPriceVariantRecordId !== undefined && lowestPriceVariantRecordId !== '') {\r\n product.RecordId = parseInt(lowestPriceVariantRecordId, 10);\r\n }\r\n const queryBasedSelection = context.app.config.queryBasedVariantSelection;\r\n const defaultOrLowestVariantRecordId = unbxdDefaultVariant! > 0 && !isRefinersEnabled ? unbxdDefaultVariant : product.RecordId;\r\n let productUrl = getProductPageUrlSync(product.Name || '', queryBasedSelection ? product.MasterProductId || product.RecordId : product.RecordId, context && context.actionContext, undefined);\r\n\r\n if (allowBack) {\r\n productUrl = updateProductUrl(productUrl, context);\r\n }\r\n if (queryBasedSelection) {\r\n const variantIdQueryParams = productUrl.includes('?') ? `&variantid=${defaultOrLowestVariantRecordId}` : `?variantid=${defaultOrLowestVariantRecordId}`;\r\n productUrl += variantIdQueryParams;\r\n }\r\n // Construct telemetry attribute to render\r\n const payLoad = getPayloadObject('click', telemetryContent!, '', defaultOrLowestVariantRecordId!.toString());\r\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\r\n // VSI Customization -starts\r\n // #17772: Check the master product, if false then add size Refinement property otherwise show Starting at\r\n let sizeValue =\r\n product && !product?.IsMasterProduct && product?.ExtensionProperties && product?.ExtensionProperties?.length > 0\r\n ? product?.ExtensionProperties.find(i => i.Key === \"Size\")?.Value?.StringValue\r\n : '';\r\n sizeValue = sizeValue && convertToTitlecase(sizeValue);\r\n\r\n // Flag used on cart page to display ratings & shop now button\r\n const isCustomizedDesign = displayShopNow;\r\n\r\n if (typeName === 'product-collection') {\r\n // VSI Customization -starts\r\n const brandName = parseBrandName(AttributeValues, brandBackofficeAttributePlp);\r\n const productTitleWithBrandname = brandName ? `${brandName} ${product.Name}` : product.Name;\r\n // VSI Customization -end\r\n // tslint:disable:max-line-length\r\n return (\r\n
\r\n \r\n {
{renderProductBadge(badgeAttributeToUse, AttributeValues, context.request)}
}\r\n
\r\n {renderProductPlacementImage(imageSettings, context.request.gridSettings, product.PrimaryImageUrl, product.Name)}\r\n
\r\n \r\n
\r\n {/* VSI Customization - START */}\r\n {/* (ADO:23447) Added only class name conditionally as discounted price based on product.component if BasePrice > Price then it will be discounted else not */}\r\n product.Price\r\n ? 'msc-product discounted'\r\n : 'msc-product'\r\n : 'msc-product'\r\n }\r\n href={productUrl}\r\n onClick={onTelemetryClick(telemetryContent!, payLoad, product.Name!)}\r\n aria-label={renderLabel(\r\n product.Name,\r\n context.cultureFormatter.formatCurrency(product.Price),\r\n product.AverageRating,\r\n ratingAriaLabel\r\n )}\r\n {...attribute}\r\n >\r\n {/* Todo: 'Starting at' string will be replaced with relevant resources */} {/* For cart page, price will be shown after name */}\r\n {!isCustomizedDesign &&\r\n <>\r\n {sizeValue ? sizeValue : product.Price !== 0 ? 'Starting at ' : ''}\r\n {renderPrice(\r\n context,\r\n typeName,\r\n id,\r\n product.BasePrice,\r\n product.Price,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText\r\n )}\r\n \r\n }\r\n {!isCustomizedDesign &&\r\n \r\n {productTitleWithBrandname && productTitleWithBrandname.length > 40\r\n ? `${productTitleWithBrandname.slice(0, 40)}...`\r\n : productTitleWithBrandname}\r\n \r\n }\r\n {isCustomizedDesign &&\r\n \r\n {productTitleWithBrandname}\r\n \r\n }\r\n {isCustomizedDesign &&\r\n
\r\n {renderPrice(\r\n context,\r\n typeName,\r\n id,\r\n product.BasePrice,\r\n product.Price,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText\r\n )}\r\n
\r\n }\r\n {/* todo : will be added when required in next sprints */}\r\n {!context.app.config.hideRating &&\r\n renderRating(context, typeName, id, averageRating, totalRatings, ratingAriaLabel)}\r\n {isCustomizedDesign &&\r\n \r\n }\r\n {/* VSI Customization - END */}\r\n \r\n
\r\n {/* OOB Quick View */}\r\n {/* {quickViewButton && renderQuickView(quickViewButton, product.RecordId)} */}\r\n
\r\n );\r\n } else {\r\n const priceComponent = renderPrice(\r\n context,\r\n typeName,\r\n id,\r\n product.BasePrice,\r\n product.Price,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText\r\n );\r\n const isSearchResultContainer = typeName === 'search-result-container' || typeName === 'mfrm-search-result-container';\r\n const brandName = parseBrandName(AttributeValues, brandBackofficeAttributePlp);\r\n return (\r\n // tslint:disable-next-line: react-this-binding-issue jsx-no-lambda\r\n
setProductUrl(productUrl)}>\r\n \r\n {isSearchResultContainer && (\r\n
\r\n {renderProductBadge(badgeAttributeToUse, AttributeValues, context.request)}\r\n
\r\n )}\r\n
\r\n {renderProductPlacementImage(imageSettings, context.request.gridSettings, product.PrimaryImageUrl, product.Name)}\r\n
\r\n \r\n\r\n
\r\n {/* VSI Customization - START */}\r\n
\r\n {/* VSI Customization - END */}\r\n {isSearchResultContainer && (\r\n
\r\n {eyebrowMessage && (\r\n
\r\n \r\n {isTruncated.height > isTruncated.visibleHeight ? (\r\n \r\n ) : (\r\n false\r\n )}\r\n
\r\n )}\r\n
\r\n )}\r\n {!context.app.config.hideRating && renderRating(context, typeName, id, averageRating, totalRatings, ratingAriaLabel)}\r\n {/* VSI Customization - START */}\r\n
\r\n {/* VSI Customization - END */}\r\n \r\n \r\n {brandName ? `${brandName} ${product.Name}` : product.Name}\r\n \r\n\r\n {/* original price */}\r\n {!isSearchResultContainer && priceComponent}\r\n {renderDescription(product.Description)}\r\n \r\n \r\n
\r\n {/* new price */}\r\n {isSearchResultContainer\r\n ? product.Price\r\n ? priceComponent && (\r\n \r\n )\r\n : priceComponent\r\n : null}\r\n {/* OOB Quick View */}\r\n {/* {quickViewButton && renderQuickView(quickViewButton, product.RecordId)} */}\r\n
\r\n );\r\n }\r\n // VSI Customization - Ends here\r\n};\r\n// VSI Customization - Starts here\r\nfunction _parseValue(productRating?: string | number): number {\r\n const value = +(productRating || 0);\r\n return Math.round(value * 10) / 10;\r\n}\r\n// VSI Customization - Ends here\r\nfunction renderLabel(name?: string, price?: string, rating?: number, ratingAriaLabel?: string): string {\r\n name = name || '';\r\n price = price || '';\r\n return `${name} ${price} ${getRatingAriaLabel(rating, ratingAriaLabel)}`;\r\n}\r\n\r\nfunction setProductUrl(productUrl: string): void {\r\n if (MsDyn365.isBrowser) {\r\n window.location.href = productUrl;\r\n }\r\n}\r\n\r\nfunction renderDescription(description?: string): JSX.Element | null {\r\n return

{description}

;\r\n}\r\n\r\n// Render Quick View\r\n// function renderQuickView(quickview: React.ReactNode, item?: number): JSX.Element | undefined {\r\n// if (quickview === null) {\r\n// return undefined;\r\n// }\r\n// return React.cloneElement(quickview as React.ReactElement, { selectedProductId: item });\r\n// }\r\n\r\nfunction getRatingAriaLabel(rating?: number, ratingAriaLabel?: string): string {\r\n if (rating && ratingAriaLabel) {\r\n const roundedRating = rating.toFixed(2);\r\n return format(ratingAriaLabel || '', roundedRating, '5');\r\n }\r\n return '';\r\n}\r\n\r\nfunction updateProductUrl(productUrl: string, context: ICoreContext): string {\r\n const srcUrl = new URL(productUrl, context.request.apiSettings.baseUrl);\r\n const queryString = 'back=true';\r\n if (srcUrl.search) {\r\n srcUrl.search += `&${queryString}`;\r\n } else {\r\n srcUrl.search += queryString;\r\n }\r\n\r\n const updatedUrl = new URL(srcUrl.href);\r\n return updatedUrl.pathname + srcUrl.search;\r\n}\r\n\r\nfunction renderRating(\r\n context: ICoreContext,\r\n typeName: string,\r\n id: string,\r\n avgRating?: number,\r\n totalRatings?: number,\r\n ariaLabel?: string\r\n): JSX.Element | null {\r\n if (avgRating || avgRating === 0) {\r\n const numRatings = (totalRatings && totalRatings.toString()) || '0';\r\n const ratingAriaLabel = getRatingAriaLabel(avgRating, ariaLabel);\r\n\r\n return (\r\n \r\n );\r\n } else {\r\n return null;\r\n }\r\n}\r\n\r\nfunction renderPrice(\r\n context: ICoreContext,\r\n typeName: string,\r\n id: string,\r\n basePrice?: number,\r\n adjustedPrice?: number,\r\n savingsText?: string,\r\n freePriceText?: string,\r\n originalPriceText?: string,\r\n currentPriceText?: string\r\n): JSX.Element | null {\r\n const price: ProductPrice = {\r\n BasePrice: basePrice,\r\n AdjustedPrice: adjustedPrice,\r\n CustomerContextualPrice: adjustedPrice\r\n };\r\n return basePrice ? (\r\n \r\n ) : null;\r\n}\r\n\r\nfunction renderProductPlacementImage(\r\n imageSettings?: IImageSettings,\r\n gridSettings?: IGridSettings,\r\n imageUrl?: string,\r\n altText?: string\r\n): JSX.Element | null {\r\n if (!imageUrl || !gridSettings || !imageSettings) {\r\n return null;\r\n }\r\n const img: IImageData = {\r\n src: imageUrl,\r\n altText: altText ? altText : ''\r\n };\r\n const imageProps = {\r\n gridSettings,\r\n imageSettings\r\n };\r\n imageProps.imageSettings.cropFocalRegion = true;\r\n return ;\r\n}\r\n// VSI Customization - starts\r\n\r\nfunction renderProductBadge(\r\n attributeName: string | undefined,\r\n attributes: AttributeValue[] | undefined,\r\n requestContext: IRequestContext\r\n): JSX.Element | undefined {\r\n const badgeData =\r\n attributeName &&\r\n attributes?.find(\r\n currAttribute => currAttribute.Name && currAttribute.Name.toLowerCase().trim() === attributeName.toLowerCase().trim()\r\n )?.TextValue;\r\n if (!badgeData) {\r\n return;\r\n }\r\n\r\n // split badge data into its separate badges\r\n const badges = badgeData.split(',');\r\n\r\n // parse badge data to get its schedule and image src\r\n const parsedBadges = badges.map(badge => parseBadgeData(badge, requestContext));\r\n // build product badge image components\r\n const finalizedBadges = parsedBadges.map(parsedBadge => parsedBadge && buildProductBadge(parsedBadge, requestContext));\r\n\r\n return finalizedBadges && <>{finalizedBadges};\r\n}\r\n\r\n// VSI Customization - ends\r\n\r\n// @ts-ignore\r\nexport const ProductComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride<\r\n IProductComponent\r\n>('Product', { component: ProductCard, ...PriceComponentActions });\r\n\r\nexport default ProductComponent;\r\n","export const convertToTitlecase = (stringValue?: string, stopConvert?: boolean) => {\r\n // this stopConvert flag will use to stop conversion in specific scenario\r\n return stopConvert\r\n ? stringValue\r\n : stringValue?.replace(/\\w\\S*/g, txt => {\r\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\r\n });\r\n};\r\n"],"names":["_getEyebrowMessage","async","products","context","priceGroupForAPICall","app","config","priceGroup","length","undefined","items","map","item","singleItem","ItemId","DistinctProductVariant","push","requestBody","PriceGroup","Items","getEyebrowMessageInput","GetEyebrowMessageInput","result","getEyebrowAction","actionContext","error","console","log","_makeDeliveryMessage","days","deliveryByMessage","date","Date","daysSpan","split","deliveryDate","now","deliveryByMessageRange","parseInt","numberOfDays","newDate","setDate","getDate","dayjs","format","flag","_setTime","time","temp","newDatewithTime","toUpperCase","_getSoonestDeliveryDate","coreProductATPData","deliveryDetails","locationId","index","Available","ATPQuantity","today","SlotDate","currHour","StartTime","Location1","CoreProductATPInfoInput","constructor","itemLine","ctx","getCacheKey","this","VariantRecordId","toString","getCacheObjectType","dataCacheType","createObservableDataAction","action","input","coreProductATPInfo","zipcode","Cookies","get","currentDate","InventoryType","Weeks","weeksPDPforATPCall","StoreId","Page","RequestedDate","ZipCode","ItemLines","getDeliveryByMessage","_getDeliveryByMessage","then","ATPInventoryData","catch","e","_getProductType","shippingInformation","toLowerCase","computeItemLines","product","defaultVariantId","lowestPriceVariantRecordId","IsMasterProduct","RecordId","attributeValues","extensionProperties","productDeliveryMessage","setProductDeliveryMessage","React","shippingInformationSmall","find","attr","Name","trim","smallParcelAttributeKey","TextValue","property","Key","Value","LongValue","defaultVariantShippingInformation","StringValue","useEffect","itemLines","Quantity","ATPInfoInput","getATPInfoForProductAction","actionResults","delMsg","defaultDeliveryMessage","deliveryDays","leadTime","brandList","brand","brandBackofficeAttributePlp","singleBrand","brandName","brandLeadtime","className","_parseValue","productRating","value","Math","round","renderLabel","name","price","rating","ratingAriaLabel","getRatingAriaLabel","roundedRating","toFixed","renderRating","typeName","id","avgRating","totalRatings","ariaLabel","numRatings","RatingComponent","ratingCount","readOnly","data","renderPrice","basePrice","adjustedPrice","savingsText","freePriceText","originalPriceText","currentPriceText","BasePrice","AdjustedPrice","CustomerContextualPrice","PriceComponent","renderProductPlacementImage","imageSettings","gridSettings","imageUrl","altText","img","src","imageProps","cropFocalRegion","Image","Object","loadFailureBehavior","renderProductBadge","attributeName","attributes","requestContext","badgeData","currAttribute","finalizedBadges","badge","parseBadgeData","parsedBadge","buildProductBadge","ProductComponent","msdyn365Commerce","component","allowBack","telemetryContent","quickViewButton","eyebrowMessage","badgeAttribute","deliveryMessage","isRefinersEnabled","displayShopNow","shopNowBtnText","enableAttributeBasedRating","getEyebrowElementRef","eyebrowElement","current","querySelector","isTruncated","setTruncated","height","scrollHeight","visibleHeight","clientHeight","badgeAttributeToUse","productBadgeAttribute","AttributeValues","ExtensionProperties","isBVratings","averageRating","getBVAttributeValues","AverageRating","TotalRatings","handleResize","MsDyn365","window","addEventListener","removeEventListener","EcomLowestPriceVariantRecIdKey","unbxdDefaultVariant","queryBasedSelection","queryBasedVariantSelection","defaultOrLowestVariantRecordId","productUrl","getProductPageUrlSync","MasterProductId","srcUrl","URL","request","apiSettings","baseUrl","queryString","search","href","pathname","updateProductUrl","variantIdQueryParams","includes","payLoad","getPayloadObject","attribute","getTelemetryAttributes","sizeValue","i","stringValue","stopConvert","replace","txt","charAt","substr","isCustomizedDesign","parseBrandName","productTitleWithBrandname","onClick","onTelemetryClick","cultureFormatter","formatCurrency","Price","PrimaryImageUrl","title","slice","hideRating","Button","color","type","priceComponent","isSearchResultContainer","role","location","setProductUrl","ref","RichTextComponent","text","description","Description","DeliveryMessage","FinancingPerMonthComponent","pageType","sellingPrice","activeVariantId","productId","activeColorVariantId"],"sourceRoot":""}