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ities/get-core-delivery-batch.ts?5a2b","webpack://mattressfirm/./src/Utilities/get-product-brand.tsx?2b65","webpack://mattressfirm/./src/Utilities/get-view-port.tsx?4210","webpack://mattressfirm/./src/Utilities/getAttributeUtils.ts?f2d8","webpack://mattressfirm/./src/actions/fetch-choose-your-foundation-database.action.ts?867b","webpack://mattressfirm/./src/actions/fetch-core-delivery-list.action.ts?41e3","webpack://mattressfirm/./src/data-actions/get-comfort-type.action.ts?e535","webpack://mattressfirm/./src/data-actions/get-product-benefits-data.action.ts?1d43","webpack://mattressfirm/./src/data-actions/get-selected-variant.override.action.ts?02a3","webpack://mattressfirm/./src/modules/mfrm-products-compare/get-unbxd-collection-compare-data.action.ts?e1f9","webpack://mattressfirm/./src/modules/mfrm-products-compare/components/product-mattribute.tsx?5c13","webpack://mattressfirm/./src/modules/mfrm-products-compare/components/product-compare-carousel-item.tsx?5085","webpack://mattressfirm/./src/Utilities/get-delivery-message-batch.ts?dcce","webpack://mattressfirm/./src/modules/mfrm-products-compare/mfrm-products-compare.tsx?d723","webpack://mattressfirm/./src/modules/mfrm-products-compare/mfrm-products-compare.view.tsx?d21c","webpack://mattressfirm/./src/themes/mattressfirm/views/components/delivery-message/deliverymessage.component.tsx?e440","webpack://mattressfirm/./lib/mfrm-products-compare/module-registration.js?e7eb","webpack://mattressfirm/external var \"React\"?0d3b","webpack://mattressfirm/external var \"ReactDOM\"?853b","webpack://mattressfirm/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.promise.all-settled.js?91e9","webpack://mattressfirm/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/esnext.promise.all-settled.js?9450"],"sourcesContent":["import { ICoreContext } from '@msdyn365-commerce/core';\r\nexport const emailRegex = (emailValue: string) => {\r\n // eslint-disable-next-line security/detect-unsafe-regex\r\n const validationEmail = /^[-a-z0-9!#$%&'*+/=?^_`{|}~]+(?:\\.[-a-z0-9!#$%&'*+/=?^_`{|}~]+)*@(?:[a-z0-9]+(?:-+[a-z0-9]+)*\\.)+(?:xn--[a-z0-9]+|[a-z]{2,16})$/i;\r\n\r\n return validationEmail.test(emailValue);\r\n};\r\n\r\n/**\r\n * Method to remove special characters for product name from product URL\r\n * @param str string\r\n * @param ctx ICoreContext\r\n * @returns string\r\n */\r\n\r\nexport const removeSpecialChars = (str: string, ctx: ICoreContext): string => {\r\n if (ctx && ctx.request.app?.config.removeSpecialCharsPDP) {\r\n return str?.replace(/[^a-zA-Z0-9- ]/g, '');\r\n }\r\n return str;\r\n};\r\n\r\n\r\n/**\r\n * Method to remove special characters for product URL's path\r\n * @param str string\r\n * @param ctx ICoreContext\r\n * @returns string\r\n */\r\n\r\nexport const removeSpecialCharsFromURLPath = (str: string, ctx: ICoreContext): string => {\r\n if (ctx && ctx.request.app?.config.removeSpecialCharsPDP) {\r\n const urlPath = decodeURIComponent(str.split('.p')[0])?.replace(/[^a-zA-Z0-9-/ ]/g, '');\r\n return `${urlPath}.p`;\r\n }\r\n return str;\r\n};\r\n\r\n// Following phone format is used on customer info section at checkout page\r\nexport const customerInfoPhoneRegex = /^\\(?([2-9][0-8][0-9])\\)?[ . ]?([2-9][0-9]{2})[\\-\\. ]?([0-9]{4})(\\s*x[0-9]+)?$/; // Valid USA number in format (xxx) xxx-xxxx\r\n\r\n/*\r\nThis regex object has 2 patterns:\r\n'nameRegex' matches names with letters, spaces, apostrophes, periods, and dashes.\r\n'addressInputRegex' matches alphanumeric characters and printable ASCII symbols.\r\n*/\r\nexport const inputRegexObj = {\r\n nameRegex: /^[\\p{L}\\s.'-]+$/u,\r\n addressInputRegex: /^[a-zA-Z0-9\\x20-\\x7E]*$/,\r\n phoneNumerRegex: customerInfoPhoneRegex\r\n};\r\n\r\n// This regex allows us to effectively validate and extract delivery messages\r\nexport const cartDeliveryMsgRegex = /[A-Za-z]{3} \\d{1,2}(?: - [A-Za-z]{3} \\d{1,2})?/;","import { IRequestContext } from '@msdyn365-commerce/core';\r\nimport { getFallbackImageUrl } from '../data-actions/utilities/utils';\r\n\r\nexport const urlFallBackImage = (imageUrl: string, itemId: string | undefined, apiSettings: IRequestContext) => {\r\n let fallbackImageUrl = getFallbackImageUrl(itemId, apiSettings?.apiSettings);\r\n if (imageUrl && fallbackImageUrl) {\r\n fallbackImageUrl = `${fallbackImageUrl},${imageUrl}`;\r\n }\r\n return fallbackImageUrl;\r\n};","import * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport dayjs from 'dayjs';\r\nimport { IMFIATPInventoryEntityPLP, IMFIATPInventoryPLPResponse, IMFICartLine } from '../actions/BatchCoreProductDataServiceEntities.g';\r\nimport fetchCoreDeliveryListAction, { FetchCoreDeliveryListInput } from \"../actions/fetch-core-delivery-list.action\";\r\n\r\nexport interface IMFIATPInventoryEntityPLPEx extends IMFIATPInventoryEntityPLP {\r\n deliveryMessage: string | undefined;\r\n}\r\n\r\nasync function getListOfCoreDeliveryMessage(ctx: Msdyn365.IActionContext, cartLines: IMFICartLine[], zipCode?: string): Promise {\r\n const data: IMFIATPInventoryPLPResponse = await fetchCoreDeliveryListAction(new FetchCoreDeliveryListInput(cartLines, zipCode), ctx);\r\n const updatedResponse: IMFIATPInventoryEntityPLPEx[] | undefined = data?.ATPInventoryPLPData?.map((deliveryItem: IMFIATPInventoryEntityPLP, i: number) => {\r\n let deliveryMessage = '';\r\n if (deliveryItem.Available === 'YES' && deliveryItem.ATPQuantity !== undefined && parseInt(deliveryItem.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(deliveryItem.SlotDate).format('D M YY');\r\n if (today === deliveryDate) {\r\n deliveryMessage = `Delivery by Today ${dayjs(deliveryItem.SlotDate).format('MMM D')}`;\r\n } else if (deliveryDate === dayjs(date.setDate(date.getDate() + 1)).format('D M YY')) {\r\n deliveryMessage = `Delivery by Tomorrow ${dayjs(deliveryItem.SlotDate).format('MMM D')}`;\r\n } else {\r\n deliveryMessage = `Delivery by ${dayjs(deliveryItem.SlotDate).format('MMM D')}`;\r\n }\r\n } else {\r\n deliveryMessage = ctx.requestContext.app.config.defaultDeliveryMessage ? ctx.requestContext.app.config.defaultDeliveryMessage : '';\r\n }\r\n return { ...deliveryItem, deliveryMessage };\r\n });\r\n return updatedResponse;\r\n}\r\n\r\nexport default getListOfCoreDeliveryMessage;","import { IGridSettings, IImageSettings, Image } from '@msdyn365-commerce/core';\r\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy';\r\nimport React from 'react';\r\nimport { IBrandListData } from '../modules/mfrm-buybox/mfrm-buybox.view';\r\nimport { IProductBonusWithBrandName } from '../modules/mfrm-cart/mfrm-cart';\r\nimport {hasArray} from './emtpyChecker';\r\nimport MsDyn365 from '@msdyn365-commerce/core';\r\n\r\nconst fallBackBrandAttribute = 'VENDOR BRAND';\r\n\r\n// tslint:disable-next-line: cyclomatic-complexity\r\nexport const parseBrandData = (\r\n attributes: AttributeValue[] | undefined,\r\n backendAttribute: string,\r\n gridSettings: IGridSettings,\r\n renderBrandNameOnly: Boolean = false,\r\n brandList: IBrandListData[],\r\n imageSettings?: IImageSettings\r\n): JSX.Element | undefined => {\r\n const attribute = backendAttribute || fallBackBrandAttribute;\r\n const productBrandName =\r\n attributes &&\r\n attributes.find(currAttribute => currAttribute.Name && currAttribute.Name.toLowerCase().trim() === attribute.toLowerCase().trim())\r\n ?.TextValue;\r\n\r\n if (renderBrandNameOnly) {\r\n return {productBrandName};\r\n }\r\n\r\n const selectedBrand =\r\n (brandList &&\r\n productBrandName &&\r\n brandList.find(\r\n (brand: IBrandListData) => brand && brand.brandName.toLowerCase().trim() === productBrandName.toLowerCase().trim()\r\n )) ||\r\n undefined;\r\n\r\n if (!selectedBrand) {\r\n return undefined;\r\n }\r\n\r\n const copySelectedBrand: IBrandListData = selectedBrand;\r\n // set alt text to brand name if no alt text is configured\r\n if (copySelectedBrand && _useDefaultAltText(copySelectedBrand) && copySelectedBrand.brandLogo) {\r\n copySelectedBrand.brandLogo.altText = productBrandName;\r\n }\r\n\r\n // set height to configured value or the default\r\n const height = copySelectedBrand && copySelectedBrand.logoHeight !== undefined ? copySelectedBrand.logoHeight : 22;\r\n const brandImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: `w=0&h=25&m=6`, w: 0, h: 25 },\r\n lg: { q: `w=0&h=25&m=6`, w: 0, h: 25 },\r\n xl: { q: `w=0&h=25&m=6`, w: 0, h: 25 }\r\n },\r\n lazyload: false\r\n };\r\n\r\n const brandLogo = copySelectedBrand && copySelectedBrand.brandLogo && (\r\n \r\n );\r\n // place logo inside a link if configured to\r\n const brandLink =\r\n copySelectedBrand &&\r\n copySelectedBrand.brandLink &&\r\n copySelectedBrand.brandLink.linkUrl &&\r\n copySelectedBrand.brandLink.linkUrl.destinationUrl &&\r\n copySelectedBrand.brandLink;\r\n const linkElement = brandLink && (\r\n \r\n {brandLogo}\r\n \r\n );\r\n\r\n return linkElement || brandLogo;\r\n};\r\n// get only brandName\r\nexport const parseBrandName = (attributes: AttributeValue[] | undefined, backendAttribute: string, recordId?: number): string | undefined => {\r\n const attribute = backendAttribute || fallBackBrandAttribute;\r\n let productBrandName = hasArray(attributes)?.find((currAttribute: AttributeValue) => currAttribute?.Name?.toLowerCase().trim() === attribute?.toLowerCase().trim())?.TextValue;\r\n if (!productBrandName && MsDyn365.isBrowser) {\r\n const getLocalStorage = localStorage.getItem('bonusItmesWithBrand');\r\n let bonusItemArray: IProductBonusWithBrandName[] = [];\r\n if (getLocalStorage) {\r\n bonusItemArray = JSON.parse(getLocalStorage);\r\n }\r\n const checkBrandName = bonusItemArray.find(item => item.productId === recordId)?.brandName;\r\n if(checkBrandName) {\r\n productBrandName = checkBrandName;\r\n } else {\r\n return undefined;\r\n }\r\n }\r\n return productBrandName;\r\n};\r\n\r\nexport const parseBrandNameUnbxd = (attributes: any | undefined, backendAttribute: string, recordId?: number): string | undefined => {\r\n const attribute = backendAttribute || fallBackBrandAttribute;\r\n // let productBrandName = hasArray(attributes)?.find((currAttribute: AttributeValue) => currAttribute?.Name?.toLowerCase().trim() === attribute?.toLowerCase().trim())?.TextValue;\r\n let productBrandName = attributes && attributes[attribute];\r\n if (!productBrandName && MsDyn365.isBrowser) {\r\n const getLocalStorage = localStorage.getItem('bonusItmesWithBrand');\r\n let bonusItemArray: IProductBonusWithBrandName[] = [];\r\n if (getLocalStorage) {\r\n bonusItemArray = JSON.parse(getLocalStorage);\r\n }\r\n const checkBrandName = bonusItemArray.find(item => item.productId === recordId)?.brandName;\r\n if(checkBrandName) {\r\n productBrandName = checkBrandName;\r\n } else {\r\n return undefined;\r\n }\r\n }\r\n return productBrandName;\r\n};\r\n\r\n// get only brandName\r\nexport const getBrandNameCheck = (attributes: AttributeValue[] | undefined, backendAttribute: string): string | undefined => {\r\n const productBrandName =\r\n attributes &&\r\n attributes.find(\r\n currAttribute => currAttribute.Name && currAttribute.Name.toLowerCase().trim() === backendAttribute.toLowerCase().trim()\r\n )?.TextValue;\r\n if (!productBrandName) {\r\n return undefined;\r\n }\r\n return productBrandName;\r\n};\r\n\r\n// get the appropriate image alt text\r\nconst _useDefaultAltText = (selectedBrand: IBrandListData): boolean => {\r\n const configuredAltText = selectedBrand.brandLogo?.altText;\r\n return !(configuredAltText && configuredAltText.trim() && configuredAltText !== 'No Data Available');\r\n};\r\n","import MsDyn365, { ICoreContext } from '@msdyn365-commerce/core';\r\nexport type GridSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\r\n\r\nconst _getViewPort = (context: ICoreContext): GridSize => {\r\n if (MsDyn365.isBrowser && window.innerWidth) {\r\n const gridSettings = context.request.gridSettings;\r\n if (gridSettings) {\r\n if (gridSettings.xs && window.innerWidth <= gridSettings.xs.w) {\r\n return 'xs';\r\n } else if (gridSettings.sm && window.innerWidth <= gridSettings.sm.w) {\r\n return 'sm';\r\n } else if (gridSettings.md && window.innerWidth <= gridSettings.md.w) {\r\n return 'md';\r\n } else if (gridSettings.lg && window.innerWidth <= gridSettings.lg.w) {\r\n return 'lg';\r\n } else {\r\n return 'xl';\r\n }\r\n }\r\n }\r\n return 'xs';\r\n};\r\n\r\nexport default _getViewPort;\r\n","import { AttributeValue } from \"@msdyn365-commerce/retail-proxy\";\r\n\r\nexport const getAttributeByName = (attributeValues: AttributeValue[] | undefined, keyValue: string): AttributeValue | undefined => {\r\n return attributeValues && attributeValues.find(currAttribute => currAttribute.Name && currAttribute.Name.toLowerCase().trim() === keyValue.toLowerCase().trim());\r\n};\r\nexport const getAttributeValueByNameUnbxd = (list: any[] | undefined, keyValue: string | undefined): string | undefined => {\r\n return keyValue && list && list[keyValue];\r\n};\r\nexport const getAttributeArrayValueByNameUnbxd = (list: any[] | undefined, keyValue: string | undefined): string[] | undefined => {\r\n return keyValue && list && list[keyValue];\r\n};\r\nexport const getAttributeTextValue = (attribute: AttributeValue | undefined): string | undefined => {\r\n return attribute && attribute.TextValue;\r\n};\r\nexport const getunbxdAttributeNameByCRTName = (crtName: string | undefined, mapList: any): string | undefined => {\r\n return mapList && Array.isArray(mapList) && mapList?.find((attr: any) => crtName && attr?.CRTName.toLowerCase().trim() === crtName.toLowerCase().trim())?.UnbxdName;\r\n};","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { AsyncResult } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * FetchChooseYourFoundationDatabase Input Action\r\n */\r\nexport class FetchChooseYourFoundationDatabaseInput implements Msdyn365.IActionInput {\r\n public jsonSrc: string;\r\n // Construct the input needed to run the action\r\n constructor(jsonSrc: string) {\r\n this.jsonSrc = jsonSrc;\r\n }\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `ChooseYourFoundationDatabase`;\r\n public getCacheObjectType = () => 'ChooseYourFoundationDatabase';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IFetchChooseYourFoundationDatabaseData {\r\n text: string;\r\n jsonSrc: string;\r\n}\r\n\r\nexport interface IDatabaseRow {\r\n mattressVariantReqId: string;\r\n baseVariantReqIdList: string[];\r\n recommendedBaseVariantReqId: string;\r\n splitVariantReqIdList: string[];\r\n}\r\n\r\nexport interface foo {\r\n database: AsyncResult;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new FetchChooseYourFoundationDatabaseInput(args?.requestContext.app.config.jsonSrc!);\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: FetchChooseYourFoundationDatabaseInput, ctx: Msdyn365.IActionContext): Promise {\r\n const res = await Msdyn365.sendRequest(input.jsonSrc, 'get');\r\n const database = res.data;\r\n return database;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'FetchChooseYourFoundationDatabase',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { getZipCode } from '../Utilities/get-zipcode';\r\nimport dayjs from 'dayjs';\r\nimport { mFIATPInventoryPLPAsync } from './BatchCoreProductDataActionExtension.g';\r\nimport { IMFIATPInventoryPLPResponse, IMFICartLine, IMFIDeliveryScheduleParameters } from './BatchCoreProductDataServiceEntities.g';\r\n\r\n/**\r\n * FetchCoreDeliveryList Input Action\r\n */\r\nexport class FetchCoreDeliveryListInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n public cartLines: IMFICartLine[];\r\n public zipCode?: string;\r\n constructor(cartLines: IMFICartLine[], zipCode?: string) {\r\n this.cartLines = cartLines;\r\n this.zipCode = zipCode;\r\n }\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => {\r\n return this.cartLines?.sort((a, b) => a?.VariantRecordId && b?.VariantRecordId && a?.VariantRecordId > b?.VariantRecordId ? 1 : -1).map(item => `FetchCoreDeliveryList-${item.VariantRecordId}-${this.zipCode}-${item.VariantRecordId?.length}`).toString();\r\n };\r\n public getCacheObjectType = () => 'FetchCoreDeliveryList';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IFetchCoreDeliveryListData {\r\n text: string;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\n// const createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n// return new FetchCoreDeliveryListInput();\r\n// };\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function fetchCoreDeliveryAction(input: FetchCoreDeliveryListInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n const atpInput: IMFIDeliveryScheduleParameters = {\r\n Weeks: 6,\r\n InventoryType: 'Delivery',\r\n StoreId: '',\r\n RequestedDate: dayjs(Date.now()).format('MM/DD/YYYY'),\r\n ZipCode: input.zipCode ?? getZipCode(ctx),\r\n ItemLines: input.cartLines,\r\n CustomerRequestTime: dayjs(Date.now()).format('MM/DD/YYYY HH:mm:ss'),\r\n Id: 0,\r\n NoOfPriorityDC: 0\r\n };\r\n const response = await mFIATPInventoryPLPAsync({ callerContext: ctx }, atpInput);\r\n // Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return response;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >fetchCoreDeliveryAction,\r\n // Give your data action a unique id\r\n id: 'FetchCoreDeliveryList'\r\n // input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\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\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nexport class GetComfortTypesData extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n private comfortTypesDataUrl: string = '';\r\n constructor(comfortTypesDataUrl: string) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'comfortTypesDataCache', cacheKey: 'comfortTypesDataCache' });\r\n this.comfortTypesDataUrl = comfortTypesDataUrl;\r\n }\r\n public getComfortTypesDataUrl = () => this.comfortTypesDataUrl;\r\n public getCacheKey = () => `comfortTypesDataCache`;\r\n public getCacheObjectType = () => 'comfortTypesDataCache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n if (inputData.config && inputData.config.comfortTypesDataUrl) {\r\n return new GetComfortTypesData(inputData.config.comfortTypesDataUrl);\r\n }\r\n return new GetComfortTypesData('');\r\n};\r\nasync function action(input: GetComfortTypesData, ctx: Msdyn365.IActionContext): Promise {\r\n const comfortTypesDataJsonUrl = ctx.requestContext.app.config.comfortTypesDataJsonUrl;\r\n const jsonUrl = comfortTypesDataJsonUrl || '';\r\n const res = await Msdyn365.sendRequest(jsonUrl, 'get');\r\n const comfortTypesData = res.data && res.data;\r\n return comfortTypesData;\r\n}\r\nexport default Msdyn365.createObservableDataAction({\r\n id: 'ComfortTypesDataCache',\r\n action: >action,\r\n input: createInput\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\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nexport class GetProductBenefitsData extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n private productBenefitsDataUrl: string = '';\r\n constructor(productBenefitsDataUrl: string) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'productBenefitsDataCache', cacheKey: 'productBenefitsDataCache' });\r\n this.productBenefitsDataUrl = productBenefitsDataUrl;\r\n }\r\n public getProductBenefitsDataUrl = () => this.productBenefitsDataUrl;\r\n public getCacheKey = () => `productBenefitsDataCache`;\r\n public getCacheObjectType = () => 'productBenefitsDataCache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n if (inputData.config && inputData.config.productBenefitsDataUrl) {\r\n return new GetProductBenefitsData(inputData.config.productBenefitsDataUrl);\r\n }\r\n return new GetProductBenefitsData('');\r\n};\r\nasync function action(input: GetProductBenefitsData, ctx: Msdyn365.IActionContext): Promise {\r\n const productBenefitsDataJsonUrl = ctx.requestContext.app.config.productBenefitsDataUrl;\r\n const jsonUrl = productBenefitsDataJsonUrl || '';\r\n const res = await Msdyn365.sendRequest(jsonUrl, 'get');\r\n const productBenefitsData = res.data && res.data;\r\n return productBenefitsData;\r\n}\r\nexport default Msdyn365.createObservableDataAction({\r\n id: 'productBenefitsData',\r\n action: >action,\r\n input: createInput\r\n});","import { generateProductImageUrl, getSelectedProductIdFromActionInput } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { ProductDimensionFull } from '@msdyn365-commerce/commerce-entities';\r\nimport MsDyn365, {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport {\r\n getByIdAsync,\r\n getDimensionValuesAsync,\r\n getVariantsByDimensionValuesAsync,\r\n searchByCriteriaAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport {\r\n AttributeValue,\r\n CommerceProperty,\r\n ProductDimension,\r\n ProductDimensionValue,\r\n ProductSearchCriteria,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { variantQueryStringName } from '../Utilities/constants';\r\nimport getAttributesForSelectedVariant, { AttributesForSelectedVariantInput } from './get-attributes-for-selected-variant';\r\nimport { getQueryParamsFromQueryByName } from './utilities/utils';\r\n// import { AttributesForSelectedVariantInput, getAttributesForSelectedVariantAction } from '@msdyn365-commerce-modules/product-specification/src/dataActions/get-attributes-for-selected-variant';\r\n\r\nexport interface IDefaultDimension {\r\n dimensionType: number;\r\n dimensionValue: string;\r\n}\r\n\r\nlet shouldDefaultSet: boolean = true;\r\n/**\r\n * Get selected variant action input class\r\n */\r\nexport class SelectedVariantInput implements IActionInput {\r\n public productId: number;\r\n public channelId: number;\r\n public matchingDimensionValues: ProductDimension[];\r\n\r\n constructor(productId: number, channelId: number, matchingDimensionValues?: ProductDimension[]) {\r\n this.productId = productId;\r\n this.channelId = channelId;\r\n this.matchingDimensionValues = matchingDimensionValues || [];\r\n }\r\n\r\n public getCacheKey = () => `SelectedVariant`;\r\n public getCacheObjectType = () => 'SimpleProduct';\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\n/**\r\n * CreateInput method for the getSelectedVariant data action\r\n * @param inputData The input data passed to the createInput method\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): SelectedVariantInput => {\r\n const productId = getSelectedProductIdFromActionInput(inputData);\r\n if (productId) {\r\n return new SelectedVariantInput(+productId, +inputData.requestContext.apiSettings.channelId, []);\r\n } else {\r\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\r\n }\r\n};\r\n\r\n/**\r\n * Action method for the getSelectedVariant data aciton\r\n * @param input The action input class\r\n * @param ctx The action context\r\n */\r\n// tslint:disable-next-line:cyclomatic-complexity max-func-body-length\r\nasync function getSelectedVariantAction(input: SelectedVariantInput, ctx: IActionContext): Promise {\r\n //TODO: what is the use case for `matchingDimensionValues` to ever have values?\r\n // the `createInput` always passes an empty array to the input constructor. Where\r\n // else / how else is this getting called that would pass a populated array?\r\n const matchingDimensionValues = input.matchingDimensionValues ?? [];\r\n const variantId = ctx.requestContext.app.config.queryBasedVariantSelection\r\n ? getQueryParamsFromQueryByName(\r\n MsDyn365.isBrowser\r\n ? new URL(window.location.href.toString())\r\n : ctx.requestContext.url.requestUrl,\r\n variantQueryStringName)\r\n : undefined;\r\n let getByIdResponse;\r\n try {\r\n getByIdResponse = await getByIdAsync(\r\n { callerContext: ctx },\r\n matchingDimensionValues?.length === 0 && variantId && !Number.isNaN(Number(variantId))\r\n ? Number(variantId)\r\n : await getDefaultVariantId(input.productId, ctx) ?? input.productId,\r\n input.channelId);\r\n } catch (error) {\r\n console.log('[getByIdAsync Error calling API]', error);\r\n }\r\n // bellow cond will only be 1 if we have invalid variantid\r\n if (!getByIdResponse && variantId) {\r\n getByIdResponse = await getByIdAsync(\r\n { callerContext: ctx },\r\n input.productId,\r\n input.channelId);\r\n }\r\n\r\n // below condition will only be true if we have masterid in url and query\r\n if (getByIdResponse && !getByIdResponse?.MasterProductId) {\r\n getByIdResponse = await getByIdAsync(\r\n { callerContext: ctx },\r\n await getDefaultVariantId(getByIdResponse.RecordId, ctx) ?? input.productId,\r\n input.channelId);\r\n }\r\n\r\n const baseProduct: SimpleProduct = Array.isArray(getByIdResponse)\r\n ? getByIdResponse[0]\r\n : getByIdResponse;\r\n // Need to dereference this before editing it. Otherwise we might not\r\n // properly get the mobx events because if things aren't properly observable\r\n // they won't fire when you set them, and then if you don't deref the value in\r\n // the cache will match the value when you try to save it, so it won't detect any\r\n // changes there either\r\n let product: SimpleProduct | null = { ...baseProduct };\r\n const originalDimensionLength = product.Dimensions ? product.Dimensions.length : 0;\r\n\r\n if (product && product.RecordId > 0) {\r\n let baseProductHadUnmatchedDimension: boolean = false;\r\n\r\n product.Dimensions?.forEach(dimension => {\r\n const matchedTargetDimension = matchingDimensionValues.find(\r\n targetDimension => targetDimension.DimensionTypeValue === dimension.DimensionTypeValue\r\n );\r\n\r\n if (matchedTargetDimension) {\r\n dimension.DimensionValue = matchedTargetDimension?.DimensionValue;\r\n } else {\r\n baseProductHadUnmatchedDimension = true;\r\n }\r\n });\r\n\r\n const actionInput = new AttributesForSelectedVariantInput(\r\n product.RecordId,\r\n input.channelId,\r\n product\r\n );\r\n const productSpecificationData: AttributeValue[] = await getAttributesForSelectedVariant(actionInput, ctx)\r\n .catch((error: Error) => {\r\n error;\r\n }) || [];\r\n\r\n // check if default variant is given for product\r\n // const productSpecificationData: AttributeValue[] = await getAttributeValuesAsync({ callerContext: ctx, queryResultSettings: {} }, product.RecordId, input.channelId, 0);\r\n const defaultValues = productSpecificationData.find(data => data.Name?.toLowerCase().trim() === 'default variants')?.TextValue;\r\n const parsedDefaultData = defaultValues\r\n ? parseDefaultDimensionsData(defaultValues)\r\n : undefined;\r\n const productPreSelectionDimensions: ProductDimensionFull[] = [];\r\n\r\n //new - literally 10x faster!\r\n if (!product.MasterProductId) {\r\n // const now = (new Date()).valueOf()\r\n // console.time(`productPreSelectionDimensions${now}`);\r\n const asyncCalls = product.Dimensions?.map(async dimension => {\r\n const dimensionValues = await getDimensionValuesAsync(\r\n { callerContext: ctx, queryResultSettings: {} },\r\n product?.MasterProductId\r\n ? product.MasterProductId\r\n // @ts-ignore: nested in `if(product && product.RecordId > 0)`\r\n : product.RecordId,\r\n input.channelId,\r\n dimension.DimensionTypeValue,\r\n matchingDimensionValues.filter(value => value.DimensionTypeValue !== dimension.DimensionTypeValue),\r\n null\r\n );\r\n\r\n // if dimensionValues have a length of exactly one then we need to make\r\n // it as selected dimension for getting variant of the product\r\n if (dimensionValues.length === 1 && shouldDefaultSet) {\r\n dimension.DimensionValue = dimensionValues[0];\r\n } else {\r\n // search through default dimensions to find current dimension\r\n const defaultValueToFind = parsedDefaultData\r\n ?.find(defaultData => defaultData.dimensionType === dimension.DimensionTypeValue)\r\n ?.dimensionValue.toLowerCase()\r\n .trim();\r\n\r\n // look through all dimension values to find the default one\r\n const defaultDimension: ProductDimensionValue | undefined = dimensionValues.find(\r\n availableDimensionValue => availableDimensionValue.Value?.toLowerCase().trim() === defaultValueToFind || availableDimensionValue.DimensionId?.toLowerCase().trim() === defaultValueToFind\r\n );\r\n\r\n if (defaultDimension && shouldDefaultSet) {\r\n dimension.DimensionValue = defaultDimension;\r\n }\r\n }\r\n\r\n const fullDimension: ProductDimensionFull = {\r\n ...dimension,\r\n DimensionValues: dimensionValues\r\n };\r\n\r\n productPreSelectionDimensions.push(fullDimension);\r\n }) || [];\r\n\r\n await Promise.allSettled(asyncCalls);\r\n }\r\n //*/\r\n\r\n // if there is any selection in productPreSelectionDimensions array then get the variant\r\n if (productPreSelectionDimensions.length > 0) {\r\n const mappedDimensions = productPreSelectionDimensions\r\n .filter(dimension => dimension && dimension.DimensionValue)\r\n .map(dimension => {\r\n return {\r\n DimensionTypeValue: dimension.DimensionTypeValue,\r\n DimensionValue: dimension.DimensionValue,\r\n ExtensionProperties: dimension.ExtensionProperties\r\n };\r\n });\r\n //console.log(\"mappedDimensions: \",mappedDimensions)\r\n if (originalDimensionLength > 0 && originalDimensionLength === mappedDimensions.length) {\r\n const variants = await getVariantsByDimensionValuesAsync(\r\n { callerContext: ctx, queryResultSettings: {} },\r\n baseProduct.RecordId,\r\n input.channelId,\r\n mappedDimensions\r\n );\r\n if (variants && variants.length === 1) {\r\n //TODO: why is the `product` variable that has been built up through the rest of the code\r\n // being overwriten in the final steps?\r\n product = variants[0];\r\n }\r\n }\r\n }\r\n else if (productPreSelectionDimensions.length === 0 && !baseProductHadUnmatchedDimension && matchingDimensionValues.length > 0) {\r\n const variants = await getVariantsByDimensionValuesAsync(\r\n { callerContext: ctx, queryResultSettings: {} },\r\n baseProduct.RecordId,\r\n input.channelId,\r\n matchingDimensionValues\r\n );\r\n\r\n if (variants && variants.length > 0) {\r\n //TODO: why is the `product` variable that has been built up through the rest of the code\r\n // being overwriten in the final steps?\r\n product = variants[0];\r\n }\r\n }\r\n else {\r\n //TODO: what should happen here??\r\n //console.log(\"in 'else' for getVariantsByDimensionValuesAsync\")\r\n }\r\n\r\n const newImageUrl = generateProductImageUrl(product, ctx.requestContext.apiSettings);\r\n\r\n if (newImageUrl) {\r\n product.PrimaryImageUrl = newImageUrl;\r\n }\r\n }\r\n\r\n shouldDefaultSet = false;\r\n\r\n return product;\r\n}\r\n\r\nconst parseDefaultDimensionsData = (defaultValue: string): IDefaultDimension[] | undefined => {\r\n try {\r\n const defaultDimensions: IDefaultDimension[] = [];\r\n\r\n const splitDimensionTypes = defaultValue.split(',');\r\n splitDimensionTypes.forEach(dimensionData => {\r\n const [dimensionTypeString, dimensionValue] = dimensionData.split('_');\r\n const dimensionType = parseInt(dimensionTypeString, 10);\r\n defaultDimensions.push({\r\n dimensionType,\r\n dimensionValue\r\n });\r\n });\r\n\r\n return defaultDimensions;\r\n } catch (e) {\r\n console.log(e);\r\n }\r\n\r\n return undefined;\r\n};\r\n\r\nexport const getDefaultVariantId = async (masterId: number, context: IActionContext): Promise => {\r\n const productSearchCriteria: ProductSearchCriteria = {\r\n Ids: [masterId],\r\n Context: {\r\n ChannelId: +context.requestContext.apiSettings.channelId,\r\n CatalogId: +context.requestContext.apiSettings.catalogId\r\n },\r\n IncludeAttributes: true,\r\n SearchCondition: '*'\r\n };\r\n try {\r\n const productSearchResults = await searchByCriteriaAsync(\r\n { callerContext: context },\r\n productSearchCriteria\r\n );\r\n // If the ProductSearchResult API finds the products then populate the product image urls and return\r\n // otherwise if the API does not exist or does not return products proceed to the legacy flows for legacy/backward compatibility reasons\r\n context.telemetry.debug('Product search results returned', JSON.stringify(productSearchResults));\r\n if (productSearchResults.length > 0) {\r\n const defaultVariantId = productSearchResults[0]?.ExtensionProperties && productSearchResults[0]?.ExtensionProperties.find(\r\n (property: CommerceProperty) => property?.Key === \"Unbxd_DefaultVariantID\"\r\n )?.Value?.LongValue;\r\n return !defaultVariantId || defaultVariantId === 0 ? undefined : defaultVariantId;\r\n }\r\n return undefined;\r\n } catch (e) {\r\n // In case of an error fall back to legacy flow\r\n context.telemetry.error(`Error while getting productSearchResult: ${e}`);\r\n return undefined;\r\n }\r\n};\r\n\r\n/**\r\n * The complete getSelectedVariant data action\r\n */\r\nexport default createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/get-selected-variant',\r\n action: >getSelectedVariantAction,\r\n input: createInput\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365All from '@msdyn365-commerce/core';\r\nimport Msdyn365 from '@msdyn365-commerce/core';\r\nimport fetchChooseYourFoundationDatabaseDataAction, { FetchChooseYourFoundationDatabaseInput } from '../../actions/fetch-choose-your-foundation-database.action';\r\nimport { getQueryParamsFromQueryByName, getSelectedProductIdFromActionInput } from '../../data-actions/utilities/utils';\r\nimport { getDefaultVariantId } from '../../data-actions/get-selected-variant.override.action';\r\nimport { variantQueryStringName } from '../../Utilities/constants';\r\n\r\n/**\r\n * GetUnbxdCollectionCompareData Input Action\r\n */\r\nexport class GetUnbxdCollectionCompareDataInput implements Msdyn365All.IActionInput {\r\n // Construct the input needed to run the action\r\n public configs?: any;\r\n public recordId?: string;\r\n constructor(configs?: any, recordId?: string) {\r\n this.configs = configs;\r\n this.recordId = recordId;\r\n }\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `VariantIDs-${this.recordId}`;\r\n public getCacheObjectType = () => 'VariantIDs';\r\n public dataCacheType = (): Msdyn365All.CacheType => 'request';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IGetUnbxdCollectionCompareDataData {\r\n collectionData: any | null;\r\n productId: number | undefined | null;\r\n variantIds: string[] | undefined;\r\n collectionDescription: string | undefined;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365All.ICreateActionContext): Msdyn365All.IActionInput => {\r\n const variantId = args.requestContext.app.config.queryBasedVariantSelection\r\n ? getQueryParamsFromQueryByName(\r\n Msdyn365.isBrowser\r\n ? new URL(window.location.href.toString())\r\n : args.requestContext.url.requestUrl,\r\n variantQueryStringName)\r\n : undefined;\r\n return new GetUnbxdCollectionCompareDataInput(args, variantId);\r\n};\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function getUnbxdCollectionCompare(input: GetUnbxdCollectionCompareDataInput, ctx: Msdyn365All.IActionContext): Promise {\r\n let variantIdNumber: number | null | undefined;\r\n const actionInput = new FetchChooseYourFoundationDatabaseInput(ctx.requestContext.app.config.jsonSrc);\r\n const unbxdApiKey = ctx.requestContext.app.config.unbxdApiKey;\r\n const unbxdSiteKey = ctx.requestContext.app.config.unbxdSiteKey;\r\n const collectionJson: any = await fetchChooseYourFoundationDatabaseDataAction(actionInput, ctx);\r\n let collectionData: any | null = {};\r\n let variantIds: string[] | undefined = [];\r\n let collectionDescription: string | undefined;\r\n let response: any = {};\r\n if (collectionJson) {\r\n const baseURL = 'https://search.unbxd.io';\r\n variantIdNumber = input.recordId && !Number.isNaN(Number(input.recordId))\r\n ? Number(input.recordId)\r\n : await getDefaultVariantId(Number(getSelectedProductIdFromActionInput(ctx)), ctx);\r\n if (collectionJson.length > 0 && variantIdNumber) {\r\n variantIds = collectionJson?.find((item: any) => Number(item.mattressVariantReqId) === variantIdNumber)?.mattressComparisonReqIdList?.map((value: any) => value);\r\n collectionDescription = collectionJson?.find((item: any) => Number(item.mattressVariantReqId) === variantIdNumber)?.collectionDescription;\r\n variantIds && variantIds?.length >= 1 && variantIds?.unshift(`${variantIdNumber}`);\r\n let collectionCompareIds = '';\r\n if (variantIds && variantIds?.length >= 2) {\r\n for (let index = 0; index < variantIds?.length; index++) {\r\n collectionCompareIds += index === 0 ? `variantId:${variantIds[index]}` : ` OR variantId:${variantIds[index]}`;\r\n }\r\n } else {\r\n return { collectionData: null, productId: null, variantIds: undefined, collectionDescription };\r\n }\r\n if (collectionCompareIds.length) {\r\n const unbxdUrl = `${baseURL}/${unbxdApiKey}/${unbxdSiteKey}/search?q=*&variants=true&variants.count=*&filter= ${collectionCompareIds}`;\r\n response = await Msdyn365All.sendRequest(unbxdUrl, 'get');\r\n } else {\r\n return { collectionData: null, productId: null, variantIds: undefined, collectionDescription };\r\n }\r\n\r\n collectionData = response?.data?.response;\r\n return { collectionData, productId: variantIdNumber, variantIds: variantIds, collectionDescription };\r\n }\r\n }\r\n // Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { collectionData: null, productId: null, variantIds: undefined, collectionDescription };\r\n}\r\n\r\nexport default Msdyn365All.createObservableDataAction({\r\n action: >getUnbxdCollectionCompare,\r\n // Give your data action a unique id\r\n id: 'GetUnbxdCollectionCompareData',\r\n input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n\r\n\r\n","import React from 'react';\r\nimport { IBooleanMattributesData } from '../mfrm-products-compare.props.autogenerated';\r\nexport interface IProductMattributeProps {\r\n mattributeName?: string | undefined,\r\n mattributeScore?: any | undefined,\r\n mattributeValue?: string | undefined,\r\n booleanMattributes?: IBooleanMattributesData[] | undefined;\r\n}\r\n\r\nexport const ProductMattribute: React.FC = (props) => {\r\n const { mattributeName, mattributeScore, mattributeValue, booleanMattributes} = props;\r\n const mattributescore = mattributeScore && Number(mattributeScore) / 2;\r\n if (booleanMattributes?.find(m => m?.mattributeName?.toLowerCase().trim() === mattributeName?.toLowerCase().trim())) {\r\n return (\r\n
\r\n
{mattributeName}
\r\n {mattributeValue === '1' ? YES : NO}\r\n
\r\n );\r\n }\r\n return (\r\n
\r\n
{mattributeName}
\r\n
    \r\n {[...Array(5)].map((_, i) =>\r\n i < mattributescore && i + 1 > mattributescore ?\r\n (
  • )\r\n : i < mattributescore ? (
  • )\r\n : mattributescore === 0 || !mattributescore ? (
  • )\r\n : (
  • )\r\n )}\r\n\r\n
\r\n
\r\n );\r\n};\r\n","import React from 'react';\r\nimport 'mfcl/variables.scss';\r\nimport { ProductPrice } from '@msdyn365-commerce/retail-proxy';\r\n//** currently marking all as optional to excape errors */\r\nimport { ProductMattribute } from './product-mattribute';\r\nimport MsDyn365 from '@msdyn365-commerce/core';\r\nimport { SimpleProductAndAttributes } from '../mfrm-products-compare';\r\nimport { getAttributeArrayValueByNameUnbxd, getAttributeValueByNameUnbxd } from '../../../Utilities/getAttributeUtils';\r\nimport { IBooleanMattributesData } from '../mfrm-products-compare.props.autogenerated';\r\nexport interface IProductCompareCarouselItemProps {\r\n productUrl?: string | undefined,\r\n zipCode?: string | undefined,\r\n title: string | undefined,\r\n price: number | undefined,\r\n image: JSX.Element | null,\r\n basePrice: number,\r\n productBadge: JSX.Element | undefined,\r\n ratings: React.ReactNode | undefined,\r\n deliveryMessage?: React.ReactNode | undefined\r\n mattributeData?: any[],\r\n index: number,\r\n comfort?: string,\r\n mattressType?: string,\r\n heigth?: string,\r\n bestFor?: string,\r\n product?: SimpleProductAndAttributes,\r\n brandName?: string,\r\n context?: any,\r\n comfortIcon?: any,\r\n booleanMattributes?: IBooleanMattributesData[] | undefined;\r\n}\r\n\r\nexport const ProductCompareCarouselItem: React.FC = (props) => {\r\n const { product, brandName, productUrl, price, image, title,\r\n basePrice, productBadge, ratings, deliveryMessage,\r\n mattributeData, index, comfort, mattressType, heigth, bestFor, comfortIcon, booleanMattributes } = props;\r\n function renderPrice(\r\n productPrice?: number,\r\n basePrice?: number\r\n ): JSX.Element | null {\r\n const price: ProductPrice = {\r\n BasePrice: basePrice,\r\n AdjustedPrice: basePrice,\r\n CustomerContextualPrice: productPrice\r\n };\r\n\r\n return basePrice ? (\r\n
\r\n {price.AdjustedPrice && price.CustomerContextualPrice && price.CustomerContextualPrice < price.AdjustedPrice ? <>\r\n ${price.CustomerContextualPrice}\r\n \r\n \r\n ${price.AdjustedPrice}\r\n \r\n \r\n :\r\n \r\n ${price.BasePrice}\r\n }\r\n
\r\n ) : null;\r\n }\r\n\r\n function renderMattributes(\r\n mattributeData: any,\r\n booleanMattributes?: IBooleanMattributesData[] | undefined\r\n ): JSX.Element | null {\r\n return mattributeData ? (\r\n
\r\n

Mattributes

\r\n {mattributeData?.sort((a: any, b: any) => a?.mattributeName > b?.mattributeName ? 1 : -1)?.sort((a: any, b: any) => {\r\n if (booleanMattributes?.find(e => e?.mattributeName?.toUpperCase() === a?.mattributeName?.toUpperCase())) {\r\n return 1;\r\n } else if (booleanMattributes?.find(e => e?.mattributeName?.toUpperCase() === b?.mattributeName?.toUpperCase())) {\r\n return -1;\r\n } else {\r\n return 0;\r\n }\r\n }).map((mattribute: any, index: number) => {\r\n return ;\r\n })}\r\n
\r\n ) : null;\r\n }\r\n const callTealiumOnClick = async (): Promise => {\r\n const productName = product?.Name;\r\n const variantID = getAttributeValueByNameUnbxd(product as any, 'v_VariantId');\r\n const productCategory = getAttributeArrayValueByNameUnbxd(product as any, 'categoryPathId2')?.at(-2)?.split('|')[1] ?? '';\r\n\r\n // @ts-ignore\r\n if ('utag' in window) {\r\n // @ts-ignore\r\n // tslint:disable-next-line: object-literal-key-quotes\r\n // eslint-disable-next-line security/detect-non-literal-fs-filename\r\n utag.link({\r\n event: 'product-click',\r\n enhanced_action: 'product_click',\r\n event_category: 'ecommerce',\r\n event_action: 'product click',\r\n event_label: `${product?.ItemId}: ${productName}`,\r\n event_noninteraction: 'false',\r\n product_list_name: [`PDP Collection Compare`],\r\n product_position: [`${index}`],\r\n product_id: [`${product?.ItemId}`],\r\n product_name: [`${productName}`],\r\n product_category: [`${productCategory}`],\r\n product_brand: [`${brandName}`],\r\n product_variant: [`${variantID}`]\r\n });\r\n }\r\n };\r\n const scrollToBuybox = () => {\r\n if(MsDyn365.isBrowser){\r\n const currentProduct= document.getElementById('mfrm-buybox');\r\n currentProduct?.scrollIntoView({\r\n behavior: 'smooth'\r\n });\r\n }\r\n };\r\n\r\n const renderCompareCard = () => {\r\n return (\r\n <>\r\n
\r\n {productBadge}\r\n
\r\n
index !== 0 && callTealiumOnClick()}>\r\n {image}\r\n
\r\n
\r\n \r\n
\r\n \r\n {title}\r\n \r\n
\r\n
\r\n {renderPrice(\r\n price, basePrice)\r\n }\r\n
\r\n
\r\n {ratings}\r\n
\r\n {deliveryMessage}\r\n
\r\n
\r\n
\r\n Comfort\r\n
\r\n

{comfort ? comfort : '--'}

\r\n {`${comfort}\r\n
\r\n
\r\n
\r\n Best For\r\n

{bestFor ? bestFor : '--'}

\r\n
\r\n
\r\n Mattress Type\r\n

{mattressType ? mattressType : '--'}

\r\n
\r\n
\r\n Height\r\n

{heigth ? heigth : '--'}

\r\n
\r\n
\r\n {renderMattributes(mattributeData, booleanMattributes)}\r\n
index !== 0 && callTealiumOnClick()}>\r\n {index === 0 ? scrollToBuybox()}>Shop Now\r\n : Shop Now}\r\n
\r\n
\r\n \r\n );\r\n };\r\n\r\n return (\r\n
\r\n {index === 0 ?\r\n
scrollToBuybox()}>\r\n {renderCompareCard()}\r\n
\r\n :\r\n \r\n {renderCompareCard()}\r\n \r\n }\r\n
\r\n );\r\n};","import dayjs from \"dayjs\";\r\nimport { IBrandListData } from \"../modules/mfrm-buybox/mfrm-buybox.view\";\r\nimport { _deliveryMessage } from \"../modules/mfrm-buybox/components/buybox-devliery-by-message\";\r\nimport { _getProductType } from \"../themes/mattressfirm/views/components/delivery-message/deliverymessage.component\";\r\n\r\nexport interface IBatchDeliveryMessage {\r\n ItemId: string | undefined;\r\n Brand: string | undefined;\r\n brandList: any;\r\n deliveryDays: string | undefined;\r\n VariantId: number;\r\n ShippingInfo: string;\r\n DeliveryMessage: string | undefined;\r\n coreDefaultMessage: string | undefined\r\n}\r\nconst GetBatchDeliveryMessage = (prductIdsAndTypes: IBatchDeliveryMessage[]): IBatchDeliveryMessage[] => {\r\n return prductIdsAndTypes?.map((product: IBatchDeliveryMessage) => {\r\n let deliveryByMessage: string | undefined = '';\r\n let deliveryByMessageRange = '';\r\n const productType = _getProductType(product.ShippingInfo);\r\n if (productType.toLowerCase() === \"core\") {\r\n deliveryByMessage = product.coreDefaultMessage;\r\n }\r\n else if (productType.toLowerCase() === \"drop ship\" || productType.toLowerCase() === \"small parcel\" || !deliveryByMessage) {\r\n let deliveryDays = product.deliveryDays;\r\n if (\r\n !deliveryDays &&\r\n product.brandList &&\r\n product.brandList?.length > 0) {\r\n if (product.Brand) {\r\n product.brandList?.map((brandList: IBrandListData) => {\r\n if (brandList?.brandName?.toLowerCase() === product.Brand) {\r\n deliveryDays =\r\n brandList.brandLeadtime !== undefined && brandList.brandLeadtime !== '' && brandList.brandLeadtime !== null\r\n ? brandList.brandLeadtime\r\n : '';\r\n }\r\n });\r\n }\r\n }\r\n if (deliveryByMessage === '' && deliveryDays && deliveryDays !== '' && deliveryDays !== undefined) {\r\n const daysSpan = deliveryDays?.split('-');\r\n if (daysSpan && daysSpan[1] !== undefined && daysSpan.length) {\r\n daysSpan?.map((item: string, index: number) => {\r\n const date = new Date();\r\n const deliveryDate = date.setDate(date.getDate());\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 deliveryByMessage = deliveryByMessageRange;\r\n } else {\r\n deliveryByMessage = _deliveryMessage(deliveryDays);\r\n }\r\n }\r\n }\r\n return {\r\n ...product,\r\n DeliveryMessage: deliveryByMessage\r\n };\r\n });\r\n};\r\nexport default GetBatchDeliveryMessage;","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { AttributeValue, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport * as React from 'react';\r\nimport MsDyn365, { ICoreContext ,IGridSettings, IImageData, IImageSettings,Image } from '@msdyn365-commerce/core';\r\nimport { addThrottledEvent } from '@msdyn365-commerce-modules/utilities';\r\nimport { getProductPageUrlSync } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { IMfrmProductsCompareData } from './mfrm-products-compare.data';\r\nimport { IMfrmProductsCompareProps } from './mfrm-products-compare.props.autogenerated';\r\nimport { ProductCompareCarouselItem } from './components/product-compare-carousel-item';\r\nimport { variantQueryStringName } from '../../Utilities/constants';\r\nimport { renderProductBadge } from '../../Utilities/get-product-badge';\r\nimport { parseBrandNameUnbxd } from '../../Utilities/get-product-brand';\r\nimport _getViewPort from '../../Utilities/get-view-port';\r\nimport GetBatchDeliveryMessage, { IBatchDeliveryMessage } from '../../Utilities/get-delivery-message-batch';\r\nimport { getAttributeArrayValueByNameUnbxd, getAttributeValueByNameUnbxd, getunbxdAttributeNameByCRTName } from '../../Utilities/getAttributeUtils';\r\nimport Cookies from 'universal-cookie';\r\nimport { _getProductType } from '../../themes/mattressfirm/views/components/delivery-message/deliverymessage.component';\r\nimport { _getSoonestDeliveryDate } from '../../Utilities/product-search-result-utils';\r\nimport { IFetchedCategoryIds } from '../mfrm-product-recommendations/mfrm-product-recommendations';\r\nimport { useInView } from 'react-intersection-observer';\r\nimport getUnbxdCollectionCompare, { GetUnbxdCollectionCompareDataInput, IGetUnbxdCollectionCompareDataData } from './get-unbxd-collection-compare-data.action';\r\nimport { IMFICartLine } from '../../actions/BatchCoreProductDataServiceEntities.g';\r\nimport getListOfCoreDeliveryMessage, { IMFIATPInventoryEntityPLPEx } from '../../Utilities/get-core-delivery-batch';\r\nimport { getZipCode } from '../../Utilities/get-zipcode';\r\nimport { BVRatingSummary } from '../../Utilities/components/BVRatingSummary';\r\nimport { getBVAttributeValuesUnbxd } from '../../Utilities/get-bv-attributes';\r\nimport { renderRating } from '../../Utilities/get-rating';\r\nimport { removeSpecialChars } from '../../Utilities/allRegex';\r\nimport { urlFallBackImage } from '../../Utilities/fallbackImageUrl';\r\nimport { generateImageUrl } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\n\r\nexport interface IMfrmProductsCompareViewProps extends IMfrmProductsCompareProps {\r\n carouselItems: React.ReactNode[] | null;\r\n mattributeHeadings: string[],\r\n compareProductsList: SimpleProductAndAttributes[],\r\n isDesktop: boolean,\r\n collectionDescription: string | undefined\r\n compareRef?: (node?: Element | null | undefined) => void\r\n}\r\nexport interface IMfrmAttributesList {\r\n RecordId: string | undefined;\r\n status: string | undefined;\r\n value: AttributeValue[] | undefined;\r\n}\r\nexport interface SimpleProductAndAttributes extends SimpleProduct {\r\n Attributes?: AttributeValue[] | undefined;\r\n Category?: IFetchedCategoryIds | undefined;\r\n}\r\n\r\n/**\r\n *\r\n * MfrmProductsCompare component\r\n * @extends {React.PureComponent>}\r\n */\r\nexport const MfrmProductsCompare: React.FC> = props => {\r\n\r\n let resizeThrottledEventHandler: (event: Event) => void;\r\n const [compareData, setCompareData] = React.useState(undefined);\r\n const [isDesktop, setIsDesktop] = React.useState(false);\r\n const [deliveryMessages, setDeliveryMessages] = React.useState([]);\r\n const [coreDeliveryMessages, setCoreDeliveryMessages] = React.useState([]);\r\n const onInitial = React.useRef(true);\r\n const unbxdData = props.data.unbxdCollectionCompare?.result;\r\n let collectionDescription = unbxdData?.collectionDescription;\r\n const cookies = new Cookies();\r\n const zipcode = cookies.get('zip_code');\r\n const attrListName = props.context.app.config?.attributeNamesMapingCrtToUnbxd;\r\n const updateViewPort = (context: ICoreContext): void => {\r\n const viewport = _getViewPort(context);\r\n if (viewport === 'lg' || viewport === 'xl') {\r\n setIsDesktop(true);\r\n } else {\r\n setIsDesktop(false);\r\n }\r\n };\r\n const defaultImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: `w=0&h=210&m=6`, w: 0, h: 0 },\r\n lg: { q: `w=0&h=210&m=6`, w: 0, h: 0 },\r\n xl: { q: `w=0&h=210&m=6`, w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n };\r\n\r\n const getVariantsList = (): any[] => {\r\n const variantsData: any[] = [];\r\n const currentProductId = unbxdData?.productId;\r\n if (currentProductId && currentProductId === props?.data?.product?.result?.RecordId) {\r\n unbxdData?.collectionData?.products.map((product: any) => {\r\n product?.variants?.map((variant: any, index: number) => {\r\n variantsData.push(variant);\r\n });\r\n });\r\n collectionDescription = unbxdData?.collectionDescription;\r\n }\r\n else if (compareData?.collectionData?.products) {\r\n compareData?.collectionData?.products.map((product: any) => {\r\n product?.variants?.map((variant: any, index: number) => {\r\n variantsData.push(variant);\r\n });\r\n });\r\n collectionDescription = compareData?.collectionDescription;\r\n }\r\n return variantsData;\r\n };\r\n const compareProductsList = getVariantsList();\r\n\r\n const callTealiumOnLoad = async () => {\r\n if (compareProductsList.length) {\r\n // @ts-ignore\r\n if ('utag' in window) {\r\n const positions: string[] = [];\r\n const productPIds: string[] = [];\r\n const productsName: string[] = [];\r\n const productsCategory: string[] = [];\r\n const productsBrand: string[] = [];\r\n const productsVariant: string[] = [];\r\n const productsPrice: string[] = [];\r\n compareProductsList.slice(1).forEach((item: any, index: number) => {\r\n const retailVariantid = getAttributeValueByNameUnbxd(item, 'v_VariantId');\r\n const count = index + 1;\r\n positions.push(`${count}`);\r\n item?.ItemId && productPIds.push(item?.ItemId);\r\n item?.Name && productsName.push(item?.Name);\r\n item?.categoryPathId2.length && productsCategory.push(getAttributeArrayValueByNameUnbxd(item, 'categoryPathId2')?.at(-2)?.split('|')[1] ?? '');\r\n productsBrand.push(parseBrandNameUnbxd(item, getunbxdAttributeNameByCRTName(props?.context?.app?.config?.brandBackofficeAttributePdp, attrListName) ?? '') || '');\r\n retailVariantid && productsVariant.push(retailVariantid?.toString());\r\n productsPrice.push(item?.v_Price?.toString());\r\n });\r\n // @ts-ignore\r\n // tslint:disable-next-line: object-literal-key-quotes\r\n // eslint-disable-next-line security/detect-non-literal-fs-filename\r\n utag.link({\r\n event: 'product-impression',\r\n enhanced_action: 'product_impression',\r\n event_category: 'ecommerce',\r\n event_action: 'product impression',\r\n event_label: getPagePath() ?? '',\r\n event_noninteraction: 'true',\r\n product_impression_list_name: [`PDP Collection Compare`],\r\n product_impression_position: positions,\r\n product_impression_id: productPIds,\r\n product_impression_name: productsName,\r\n product_impression_category: productsCategory,\r\n product_impression_brand: productsBrand,\r\n product_impression_variant: productsVariant,\r\n product_impression_price: productsPrice\r\n });\r\n }\r\n }\r\n };\r\n\r\n const getPagePath = (): string => {\r\n return MsDyn365.isBrowser\r\n ? window.location.href.split(location.host)[1].includes('?')\r\n ? window.location.href.split(location.host)[1].split('?')[0]\r\n : window.location.href.split(location.host)[1]\r\n : '';\r\n };\r\n\r\n const getMattributeData = (attributes: any | undefined, uniqueHeadings: string[]): any => {\r\n const mattributeData: any = [];\r\n uniqueHeadings &&\r\n uniqueHeadings.length > 0 &&\r\n uniqueHeadings.map((item, index) => {\r\n const scoreAttribute = attributes && attributes[getunbxdAttributeNameByCRTName(`${item} score`?.toLowerCase(), attrListName) ?? ''];\r\n const mattributeValue = attributes && attributes[getunbxdAttributeNameByCRTName(`${item}`?.toLowerCase(), attrListName) ?? ''];\r\n const obj = {\r\n mattributeName: item,\r\n score: scoreAttribute,\r\n mattributeValue\r\n };\r\n mattributeData.push(obj);\r\n });\r\n return mattributeData;\r\n };\r\n\r\n const getUniqueMattributeData = (): string[] => {\r\n const mattributeHeadings: string[] = [];\r\n compareProductsList?.map((product: any) => {\r\n const spotlightAttributeKey = product && product[getunbxdAttributeNameByCRTName('PDP_Feature Spotlight_Sequence', attrListName) ?? ''];\r\n const spotlightValues = spotlightAttributeKey ?? undefined;\r\n if (spotlightValues !== undefined) {\r\n const spotlightValuesArr = spotlightValues && spotlightValues.split(',');\r\n spotlightValuesArr &&\r\n spotlightValuesArr.length > 0 &&\r\n spotlightValuesArr.map((item: any, index: number) => {\r\n const attribute = product && product[getunbxdAttributeNameByCRTName(item, attrListName) ?? ''];\r\n attribute && !!attribute && mattributeHeadings.push(item);\r\n });\r\n }\r\n });\r\n return [...new Set(mattributeHeadings)]?.sort((a, b) => a.toUpperCase() > b.toUpperCase() ? 1 : -1)?.sort((a: any, b: any) => {\r\n if (props.config.booleanMattributes?.find(e => e?.mattributeName?.toUpperCase() === a?.toUpperCase())) {\r\n return 1;\r\n } else if (props.config.booleanMattributes?.find(e => e?.mattributeName?.toUpperCase() === b?.toUpperCase())) {\r\n return -1;\r\n } else {\r\n return 0;\r\n }\r\n });\r\n };\r\n\r\n const getRatings = (attributes: any | undefined): React.ReactNode | undefined => {\r\n return attributes && renderRating(\r\n props.context,\r\n props.typeName,\r\n props.id,\r\n getBVAttributeValuesUnbxd(attributes, getunbxdAttributeNameByCRTName('BVAverageOverallRating', attrListName) ?? ''),\r\n getBVAttributeValuesUnbxd(attributes, getunbxdAttributeNameByCRTName('BVTotalReviewCount', attrListName) ?? ''),\r\n props.resources.ratingAriaLabel\r\n );\r\n };\r\n\r\n const _renderDeliveryMessage = (recordId: number | undefined, shippingInfo: string | undefined) => {\r\n if (!deliveryMessages || deliveryMessages.length < 1) {\r\n return <>;\r\n }\r\n let deliveryMessage: string | undefined = '';\r\n if (_getProductType(shippingInfo).toLowerCase() === 'core' && coreDeliveryMessages && coreDeliveryMessages.find((item: any) => Number(item.VariantRecordId) === recordId)) {\r\n const atpDeliveryMsg = coreDeliveryMessages.find((item: any) => Number(item.VariantRecordId) === recordId)?.deliveryMessage;\r\n if (atpDeliveryMsg && atpDeliveryMsg !== '') {\r\n deliveryMessage = atpDeliveryMsg;\r\n\r\n }\r\n }\r\n if (!deliveryMessage || deliveryMessage === '') {\r\n deliveryMessage = deliveryMessages?.find(msg => msg?.VariantId === recordId)?.DeliveryMessage;\r\n }\r\n\r\n return (\r\n
\r\n {props.resources.deliveryBy}\r\n
\r\n {deliveryMessage}\r\n {zipcode && <> to{zipcode}}\r\n
\r\n
\r\n );\r\n };\r\n\r\n const [compareRef, inView] = useInView({\r\n threshold: 0,\r\n triggerOnce: true\r\n });\r\n function renderImage(\r\n imageSettings?: IImageSettings,\r\n gridSettings?: IGridSettings,\r\n imageUrl?: string,\r\n fallbackImageUrl?: string,\r\n altText?: string\r\n ): JSX.Element | null {\r\n if (!fallbackImageUrl || !gridSettings || !imageSettings) {\r\n return null;\r\n }\r\n const img: IImageData = {\r\n src: imageUrl ? imageUrl : fallbackImageUrl,\r\n altText: altText ? altText : '',\r\n fallBackSrc: fallbackImageUrl\r\n };\r\n const imageProps = {\r\n gridSettings,\r\n imageSettings,\r\n fallbackImageUrl\r\n };\r\n imageProps.imageSettings.cropFocalRegion = true;\r\n return ;\r\n }\r\n\r\n const _renderCaouselItems = (): React.ReactNode[] | null => {\r\n const uniqueHeadings = getUniqueMattributeData();\r\n const sortedArray = compareData?.variantIds ?? unbxdData?.variantIds;\r\n return sortedArray && compareProductsList?.sort((a: any, b: any) => sortedArray?.indexOf(a?.variantId) - sortedArray?.indexOf(b?.variantId))?.map((product: any, index: number) => {\r\n const queryBasedSelection = props?.context?.app?.config?.queryBasedVariantSelection;\r\n let productUrl = getProductPageUrlSync(removeSpecialChars(product?.Name!, props.context) || '', queryBasedSelection ? product.MasterProductId || product.variantId : product.variantId, props.context && props.context.actionContext, undefined);\r\n if (queryBasedSelection && product.MasterProductId) {\r\n const variantIdQueryParams = productUrl.includes('?') ? `&${variantQueryStringName}=${product.variantId}` : `?${variantQueryStringName}=${product.variantId}`;\r\n productUrl += variantIdQueryParams;\r\n }\r\n const productMattributeData = getMattributeData(product, uniqueHeadings);\r\n const comfort = getAttributeValueByNameUnbxd(product, getunbxdAttributeNameByCRTName('Comfort', attrListName)) ?? \"\";\r\n const sleepPosition = getAttributeValueByNameUnbxd(product, getunbxdAttributeNameByCRTName('Sleep Position', attrListName)) ?? \"\";\r\n const bestFor = props.config.sleepStyleOptions?.find(option => option.selectedSleepStyle === sleepPosition);\r\n const mattressType = getAttributeValueByNameUnbxd(product, getunbxdAttributeNameByCRTName('Product Type', attrListName)) ?? \"\";\r\n const heigth = getAttributeValueByNameUnbxd(product, getunbxdAttributeNameByCRTName('Height', attrListName)) ?? \"\";\r\n const brandName = parseBrandNameUnbxd(product, getunbxdAttributeNameByCRTName(props?.context?.app?.config?.brandBackofficeAttributePdp, attrListName) ?? '') || '';\r\n const title = brandName ? `${brandName} ${product?.Name}` : product?.Name ?? '';\r\n const comfortIcons = props.data.comfortTypesData.result;\r\n const badgeValue = getAttributeValueByNameUnbxd(product, getunbxdAttributeNameByCRTName(props?.context?.app?.config?.productBadgeAttribute, attrListName));\r\n const deliveryByMessage = _renderDeliveryMessage(Number(product?.variantId), getAttributeValueByNameUnbxd(product, getunbxdAttributeNameByCRTName(props?.context?.app?.config?.smallParcelAttributeKey, attrListName)) ?? '');\r\n const emptyPlaceHolderImage = props.context.app.config?.placeholderImageName as string;\r\n const imageUrl = generateImageUrl(product?.PrimaryImageUrl, props.context.request.apiSettings);\r\n const fallBackImageUrl = urlFallBackImage(emptyPlaceHolderImage, product?.ItemId, props.context.actionContext.requestContext);\r\n return (\r\n : getRatings(product)}\r\n mattributeData={productMattributeData}\r\n productBadge={renderProductBadge(badgeValue, props?.context?.request)}\r\n deliveryMessage={deliveryByMessage}\r\n comfort={comfort}\r\n mattressType={mattressType}\r\n heigth={heigth}\r\n bestFor={bestFor?.sleepStyleDisplayName}\r\n product={product}\r\n brandName={brandName}\r\n context={props.context}\r\n comfortIcon={comfortIcons && comfortIcons[comfort] && comfortIcons[comfort]?.icon}\r\n booleanMattributes={props.config.booleanMattributes}\r\n />\r\n );\r\n });\r\n };\r\n\r\n const getDeliveryMessages = async (productIdsAndtype: IBatchDeliveryMessage[]) => {\r\n const data = GetBatchDeliveryMessage(productIdsAndtype);\r\n void getCoreProductsDelivery(productIdsAndtype);\r\n if (data) {\r\n setDeliveryMessages(data);\r\n }\r\n };\r\n const getCoreProductsDelivery = async (productIdsAndtype: IBatchDeliveryMessage[]) => {\r\n productIdsAndtype = productIdsAndtype.filter(product => _getProductType(product.ShippingInfo).toLowerCase() === 'core');\r\n const itemLines: IMFICartLine[] = productIdsAndtype?.map(product => {\r\n return {\r\n ItemId: product?.ItemId,\r\n Quantity: 1,\r\n VariantRecordId: product.VariantId.toString()\r\n };\r\n });\r\n if (itemLines && itemLines.length > 0) {\r\n const atpResponse = await getListOfCoreDeliveryMessage(props.context.actionContext, itemLines, getZipCode(props.context.actionContext));\r\n atpResponse !== undefined && setCoreDeliveryMessages(atpResponse);\r\n\r\n }\r\n };\r\n\r\n const UpdateProductsData = async () => {\r\n const currentProductId = unbxdData?.productId;\r\n if (!currentProductId || currentProductId !== props?.data?.product?.result?.RecordId) {\r\n // get data from dataAction\r\n const response: IGetUnbxdCollectionCompareDataData = await getUnbxdCollectionCompare(new GetUnbxdCollectionCompareDataInput(props.config, props?.data?.product?.result?.RecordId?.toString()), props.context.actionContext);\r\n if (response?.collectionData?.products) {\r\n setCompareData(response);\r\n } else {\r\n setCompareData(undefined);\r\n }\r\n }\r\n };\r\n\r\n React.useEffect(() => {\r\n void UpdateProductsData();\r\n }, [props?.data?.product?.result?.RecordId]);\r\n\r\n React.useEffect(() => {\r\n if (compareProductsList && compareProductsList.length && compareProductsList.length >= 1) {\r\n const productIdsAndtype: IBatchDeliveryMessage[] = compareProductsList.map((product: any) => {\r\n return {\r\n ItemId: product?.ItemId,\r\n VariantId: Number(product?.variantId),\r\n brandList: props.context.app.config.brandList,\r\n coreDefaultMessage: props.context.app.config.defaultDeliveryMessage,\r\n deliveryDays: product[getunbxdAttributeNameByCRTName(props.context.app.config.leadTime, attrListName) ?? ''] ?? '',\r\n Brand: product[getunbxdAttributeNameByCRTName(props.context.app.config.brandBackofficeAttributePdp, attrListName) ?? ''] ?? '',\r\n ShippingInfo: product[getunbxdAttributeNameByCRTName(props.context.app.config.smallParcelAttributeKey, attrListName) ?? ''] ?? '',\r\n DeliveryMessage: \"\"\r\n };\r\n });\r\n void getDeliveryMessages(productIdsAndtype);\r\n }\r\n }, [compareData, props?.data?.product?.result?.RecordId, zipcode]);\r\n\r\n React.useEffect(() => {\r\n if (inView) {\r\n void callTealiumOnLoad();\r\n }\r\n }, [inView]);\r\n\r\n React.useEffect(() => {\r\n if (MsDyn365.isBrowser) {\r\n resizeThrottledEventHandler = addThrottledEvent(window, 'resize', () => updateViewPort(props.context));\r\n }\r\n return () => {\r\n MsDyn365.isBrowser && window.removeEventListener('resize', resizeThrottledEventHandler!, false);\r\n };\r\n }, [props.context.request.gridSettings, MsDyn365.isBrowser && window.innerWidth]);\r\n\r\n React.useEffect(() => {\r\n if (onInitial.current) {\r\n onInitial.current = false;\r\n } else {\r\n void callTealiumOnLoad();\r\n }\r\n }, [props?.data?.product?.result?.RecordId]);\r\n\r\n if (!compareProductsList?.length) {\r\n return <>;\r\n }\r\n return props.renderView({\r\n ...props,\r\n carouselItems: compareProductsList ? _renderCaouselItems() : null,\r\n mattributeHeadings: getUniqueMattributeData(),\r\n compareProductsList: compareProductsList,\r\n isDesktop: isDesktop,\r\n collectionDescription,\r\n compareRef: compareRef\r\n });\r\n};\r\n\r\nexport default MfrmProductsCompare;","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { Heading } from '@msdyn365-commerce-modules/utilities';\r\nimport { IMfrmProductsCompareViewProps } from './mfrm-products-compare';\r\nimport { RichTextComponent } from '@msdyn365-commerce/core';\r\nimport Carousel from 'mfcl/Carousel';\r\n\r\nexport default (props: IMfrmProductsCompareViewProps) => {\r\n\r\n const { mattributeHeadings, carouselItems, compareRef, isDesktop, collectionDescription } = props;\r\n const { sleepExpertModuleSlot } = props.slots;\r\n if (!carouselItems?.length) {\r\n props.context.telemetry.error('Product Compare is empty, module wont render.');\r\n return null;\r\n }\r\n const mattributeIcons = props.data.productBenefitsData.result;\r\n return (\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
    \r\n
  • Price
  • \r\n
  • Deliver By
  • \r\n
  • Comfort
  • \r\n
  • Best For
  • \r\n
  • Mattress Type
  • \r\n
  • Height
  • \r\n
\r\n
\r\n
\r\n
    \r\n {mattributeHeadings.map((heading) =>\r\n (
  • \r\n {`${heading}\r\n {heading}\r\n
  • )\r\n )}\r\n
\r\n
\r\n
\r\n
\r\n {carouselItems && carouselItems[0]}\r\n
\r\n
\r\n {isDesktop ? \r\n {carouselItems && carouselItems.length > 1 && carouselItems.slice(1)}\r\n \r\n :\r\n carouselItems && carouselItems.length > 1 && carouselItems.slice(1).map((item) => {\r\n return item;\r\n })}\r\n
\r\n
\r\n
{sleepExpertModuleSlot}
\r\n
\r\n );\r\n};\r\n","import { ICoreContext, IGeneric, IAny } from '@msdyn365-commerce/core';\r\nimport { AttributeValue, CommerceProperty } from '@msdyn365-commerce/retail-proxy';\r\nimport React from 'react';\r\nimport { IBrandListData } from '../../../../../modules/mfrm-buybox/mfrm-buybox.view';\r\nimport { _getSoonestDeliveryDate, _makeDeliveryMessage } from '../../../../../Utilities/product-search-result-utils';\r\nimport { ProductSearchResultExtended } from '../../../custom-components/product-search-result-items';\r\nimport CustomSkeleton from '../../../custom-components/CustomSkeleton';\r\ninterface IDeliveryMessage {\r\n product?: ProductSearchResultExtended;\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 let productDeliveryMessage = '';\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 defaultVariantShippingInformation = extensionProperties && extensionProperties.find(\r\n (property: CommerceProperty) => property?.Key === \"Unbxd_DefaultVariantShippingInformation\"\r\n )?.Value?.StringValue;\r\n\r\n if ((_getProductType(defaultVariantShippingInformation || shippingInformationSmall)) === 'Core') {\r\n productDeliveryMessage = product?.deliveryByMessage ?? '';\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 productDeliveryMessage = _makeDeliveryMessage(deliveryDays);\r\n }\r\n }\r\n\r\n return productDeliveryMessage ? (\r\n
\r\n {productDeliveryMessage}\r\n
\r\n ) : ;\r\n};\r\n\r\nexport default DeliveryMessage;","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['mfrm-products-compare'] = {\n c: () => require('partner/modules/mfrm-products-compare/mfrm-products-compare.tsx'),\n $type: 'containerModule',\n da: [{name:'comfortTypesData', path:'data-actions/get-comfort-type.action', runOn: 0},{name:'product', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant', runOn: 0},{name:'productBenefitsData', path:'data-actions/get-product-benefits-data.action', runOn: 0},{name:'productCompareBuyboxStateSharing', path:'actions/product-compare-buybox-state-sharing', runOn: 0},{name:'productsCompareIds', path:'actions/fetch-choose-your-foundation-database.action', runOn: 0},{name:'unbxdCollectionCompare', path:'modules/mfrm-products-compare/get-unbxd-collection-compare-data.action', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'mfrm-products-compare',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/mfrm-products-compare'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/fetch-choose-your-foundation-database.action';\n let dataAction = require('partner/actions/fetch-choose-your-foundation-database.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/product-compare-buybox-state-sharing';\n let dataAction = require('partner/actions/product-compare-buybox-state-sharing');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'data-actions/get-comfort-type.action';\n let dataAction = require('partner/data-actions/get-comfort-type.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'data-actions/get-product-benefits-data.action';\n let dataAction = require('partner/data-actions/get-product-benefits-data.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'modules/mfrm-products-compare/get-unbxd-collection-compare-data.action';\n let dataAction = require('partner/modules/mfrm-products-compare/get-unbxd-collection-compare-data.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|mfrm-products-compare|mfrm-products-compare'] = {\n c: () => require('partner/modules/mfrm-products-compare/mfrm-products-compare.view.tsx'),\n cn: '__local__-__local__-mfrm-products-compare'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar iterate = require('../internals/iterate');\nvar PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration');\n\n// `Promise.allSettled` method\n// https://tc39.es/ecma262/#sec-promise.allsettled\n$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {\n allSettled: function allSettled(iterable) {\n var C = this;\n var capability = newPromiseCapabilityModule.f(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var promiseResolve = aCallable(C.resolve);\n var values = [];\n var counter = 0;\n var remaining = 1;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyCalled = false;\n remaining++;\n call(promiseResolve, C, promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = { status: 'fulfilled', value: value };\n --remaining || resolve(values);\n }, function (error) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = { status: 'rejected', reason: error };\n --remaining || resolve(values);\n });\n });\n --remaining || resolve(values);\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","'use strict';\n// TODO: Remove from `core-js@4`\nrequire('../modules/es.promise.all-settled.js');\n"],"names":["emailRegex","emailValue","test","removeSpecialChars","str","ctx","_ctx$request$app","request","app","config","removeSpecialCharsPDP","replace","removeSpecialCharsFromURLPath","_ctx$request$app2","_decodeURIComponent","decodeURIComponent","split","customerInfoPhoneRegex","inputRegexObj","nameRegex","addressInputRegex","phoneNumerRegex","cartDeliveryMsgRegex","urlFallBackImage","imageUrl","itemId","apiSettings","fallbackImageUrl","getFallbackImageUrl","async","cartLines","zipCode","_data$ATPInventoryPLP","data","fetchCoreDeliveryListAction","FetchCoreDeliveryListInput","ATPInventoryPLPData","map","deliveryItem","i","deliveryMessage","Available","undefined","ATPQuantity","parseInt","date","Date","today","dayjs","now","format","deliveryDate","SlotDate","setDate","getDate","requestContext","defaultDeliveryMessage","_objectSpread","fallBackBrandAttribute","parseBrandName","attributes","backendAttribute","recordId","_hasArray","attribute","productBrandName","hasArray","find","currAttribute","_currAttribute$Name","Name","toLowerCase","trim","TextValue","MsDyn365","isBrowser","_bonusItemArray$find","getLocalStorage","localStorage","getItem","bonusItemArray","JSON","parse","checkBrandName","item","productId","brandName","parseBrandNameUnbxd","_bonusItemArray$find2","getBrandNameCheck","_attributes$find2","context","window","innerWidth","gridSettings","xs","w","sm","md","lg","getAttributeByName","attributeValues","keyValue","getAttributeValueByNameUnbxd","list","getAttributeArrayValueByNameUnbxd","getunbxdAttributeNameByCRTName","crtName","mapList","_mapList$find","Array","isArray","attr","CRTName","UnbxdName","FetchChooseYourFoundationDatabaseInput","constructor","jsonSrc","getCacheKey","getCacheObjectType","dataCacheType","this","Msdyn365","action","input","id","args","_this$cartLines","sort","a","b","VariantRecordId","_item$VariantRecordId","length","toString","_input$zipCode","atpInput","Weeks","InventoryType","StoreId","RequestedDate","ZipCode","getZipCode","ItemLines","CustomerRequestTime","Id","NoOfPriorityDC","mFIATPInventoryPLPAsync","callerContext","GetComfortTypesData","comfortTypesDataUrl","super","shouldCacheOutput","cacheObjectType","cacheKey","getComfortTypesDataUrl","jsonUrl","comfortTypesDataJsonUrl","res","inputData","GetProductBenefitsData","productBenefitsDataUrl","getProductBenefitsDataUrl","shouldDefaultSet","SelectedVariantInput","channelId","matchingDimensionValues","parseDefaultDimensionsData","defaultValue","defaultDimensions","forEach","dimensionData","dimensionTypeString","dimensionValue","dimensionType","push","e","console","log","getDefaultVariantId","masterId","productSearchCriteria","Ids","Context","ChannelId","CatalogId","catalogId","IncludeAttributes","SearchCondition","productSearchResults","searchByCriteriaAsync","telemetry","debug","stringify","_productSearchResults","_productSearchResults2","defaultVariantId","ExtensionProperties","property","Key","Value","LongValue","error","createObservableDataAction","_input$matchingDimens","_getByIdResponse","variantId","queryBasedVariantSelection","getQueryParamsFromQueryByName","URL","location","href","url","requestUrl","variantQueryStringName","getByIdResponse","_await$getDefaultVari","getByIdAsync","Number","isNaN","_await$getDefaultVari2","MasterProductId","RecordId","baseProduct","product","originalDimensionLength","Dimensions","_product$Dimensions","_productSpecification","baseProductHadUnmatchedDimension","dimension","matchedTargetDimension","targetDimension","DimensionTypeValue","DimensionValue","actionInput","AttributesForSelectedVariantInput","defaultValues","getAttributesForSelectedVariant","catch","_data$Name","parsedDefaultData","productPreSelectionDimensions","_product$Dimensions2","asyncCalls","_product","dimensionValues","getDimensionValuesAsync","queryResultSettings","filter","value","_parsedDefaultData$fi","defaultValueToFind","defaultData","defaultDimension","availableDimensionValue","_availableDimensionVa","_availableDimensionVa2","DimensionId","fullDimension","DimensionValues","Promise","allSettled","mappedDimensions","variants","getVariantsByDimensionValuesAsync","newImageUrl","generateProductImageUrl","PrimaryImageUrl","getSelectedProductIdFromActionInput","Error","GetUnbxdCollectionCompareDataInput","configs","Msdyn365All","variantIdNumber","unbxdApiKey","unbxdSiteKey","collectionJson","fetchChooseYourFoundationDatabaseDataAction","collectionDescription","collectionData","variantIds","response","baseURL","_collectionJson$find","_collectionJson$find2","_variantIds","_variantIds2","_variantIds3","_response","mattressVariantReqId","mattressComparisonReqIdList","unshift","collectionCompareIds","index","_variantIds4","unbxdUrl","ProductMattribute","props","mattributeName","mattributeScore","mattributeValue","booleanMattributes","mattributescore","m","_m$mattributeName","React","className","_","key","ProductCompareCarouselItem","productUrl","price","image","title","basePrice","productBadge","ratings","mattributeData","comfort","mattressType","heigth","bestFor","comfortIcon","callTealiumOnClick","_getAttributeArrayVal","_getAttributeArrayVal2","productName","variantID","productCategory","at","utag","link","event","enhanced_action","event_category","event_action","event_label","ItemId","event_noninteraction","product_list_name","product_position","product_id","product_name","product_category","product_brand","product_variant","scrollToBuybox","currentProduct","document","getElementById","scrollIntoView","behavior","renderCompareCard","onClick","productPrice","BasePrice","AdjustedPrice","CustomerContextualPrice","renderPrice","src","alt","_mattributeData$sort","_e$mattributeName","_a$mattributeName","toUpperCase","_e$mattributeName2","_b$mattributeName","mattribute","score","renderMattributes","prductIdsAndTypes","deliveryByMessage","deliveryByMessageRange","productType","_getProductType","ShippingInfo","coreDefaultMessage","_product$brandList","deliveryDays","_product$brandList2","brandList","Brand","_brandList$brandName","brandLeadtime","_deliveryDays","daysSpan","numberOfDays","newDate","_deliveryMessage","DeliveryMessage","MfrmProductsCompare","_props$data$unbxdColl","_props$context$app$co","_props$data5","_props$data6","_props$data7","resizeThrottledEventHandler","compareData","setCompareData","isDesktop","setIsDesktop","deliveryMessages","setDeliveryMessages","coreDeliveryMessages","setCoreDeliveryMessages","onInitial","unbxdData","unbxdCollectionCompare","result","zipcode","Cookies","get","attrListName","attributeNamesMapingCrtToUnbxd","defaultImageSettings","viewports","q","h","xl","lazyload","compareProductsList","getVariantsList","_props$data","_compareData$collecti","variantsData","currentProductId","_unbxdData$collection","products","_product$variants","variant","_compareData$collecti2","_product$variants2","callTealiumOnLoad","_getPagePath","positions","productPIds","productsName","productsCategory","productsBrand","productsVariant","productsPrice","slice","_getunbxdAttributeNam","_props$context","_item$v_Price","retailVariantid","count","categoryPathId2","brandBackofficeAttributePdp","v_Price","getPagePath","product_impression_list_name","product_impression_position","product_impression_id","product_impression_name","product_impression_category","product_impression_brand","product_impression_variant","product_impression_price","host","includes","getUniqueMattributeData","_ref3","mattributeHeadings","_getunbxdAttributeNam4","spotlightAttributeKey","spotlightValues","spotlightValuesArr","_getunbxdAttributeNam5","Set","_props$config$boolean","_props$config$boolean2","compareRef","inView","useInView","threshold","triggerOnce","renderImage","imageSettings","altText","img","fallBackSrc","imageProps","cropFocalRegion","Image","Object","assign","imageFallbackOptimize","loadFailureBehavior","getCoreProductsDelivery","_productIdsAndtype","itemLines","productIdsAndtype","Quantity","VariantId","atpResponse","getListOfCoreDeliveryMessage","actionContext","_props$data3","_props$data4","_response$collectionD","getUnbxdCollectionCompare","UpdateProductsData","GetBatchDeliveryMessage","getDeliveryMessages","_getunbxdAttributeNam9","_product2","_getunbxdAttributeNam10","_product3","_getunbxdAttributeNam11","leadTime","smallParcelAttributeKey","addThrottledEvent","viewport","_getViewPort","updateViewPort","removeEventListener","current","renderView","carouselItems","_renderCaouselItems","_compareData$variantI","_compareProductsList$","uniqueHeadings","sortedArray","indexOf","_props$context2","_getAttributeValueByN","_getAttributeValueByN2","_props$config$sleepSt","_getAttributeValueByN3","_getAttributeValueByN4","_getunbxdAttributeNam8","_props$context3","_product$Name","_props$context4","_getAttributeValueByN5","_props$context5","_props$context$app$co2","_props$data2","_props$context6","_comfortIcons$comfort","queryBasedSelection","getProductPageUrlSync","variantIdQueryParams","productMattributeData","getMattributeData","_getunbxdAttributeNam2","_ref","_getunbxdAttributeNam3","_ref2","obj","sleepPosition","sleepStyleOptions","option","selectedSleepStyle","comfortIcons","comfortTypesData","badgeValue","productBadgeAttribute","_renderDeliveryMessage","shippingInfo","_coreDeliveryMessages","atpDeliveryMsg","_deliveryMessages$fin","msg","resources","deliveryBy","emptyPlaceHolderImage","placeholderImageName","generateImageUrl","fallBackImageUrl","v_AdjustedPrice","showBVRatings","BVRatingSummary","renderRating","typeName","getBVAttributeValuesUnbxd","_getunbxdAttributeNam6","_getunbxdAttributeNam7","ratingAriaLabel","renderProductBadge","sleepStyleDisplayName","icon","sleepExpertModuleSlot","slots","mattributeIcons","productBenefitsData","ref","Heading","heading","text","RichTextComponent","description","_mattributeIcons$head","Carousel","ariaLabel","layoutGap","controlStyle","variableWidth","controlAlignment","controlClass","itemsToShow","hideIndicators","disableEndButtons","hideControls","disableControls","shippingInformation","computeItemLines","lowestPriceVariantRecordId","IsMasterProduct","_attributeValues$find","_extensionProperties$","extensionProperties","productDeliveryMessage","shippingInformationSmall","_attr$Name","defaultVariantShippingInformation","StringValue","_product$deliveryByMe","_attributeValues$find2","_attr$Name2","_attributeValues$find3","brand","_attr$Name3","brandBackofficeAttributePlp","singleBrand","_makeDeliveryMessage","CustomSkeleton","type","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","__bindings__","viewDictionary","cn","module","exports","ReactDOM","$","call","aCallable","newPromiseCapabilityModule","perform","iterate","target","stat","forced","iterable","C","capability","f","resolve","reject","promiseResolve","values","counter","remaining","promise","alreadyCalled","then","status","reason"],"sourceRoot":""}