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ACXO,EAAQ,MAQzBP,EAF4B,6CACXO,EAAQ,MAQzBP,EAF4B,+CACXO,EAAQ,MAQzBP,EAF4B,mDACXO,EAAQ,MAMjCxZ,OAAOoa,aAAepa,OAAOoa,cAAgB,GAC7Cpa,OAAOoa,aAAarB,QAAOpK,EAAAA,EAAA,GACpB3O,OAAOoa,aAAarB,SAAW,IAC/BD,EAAQC,SAGX/Y,OAAOoa,aAAapB,YAAWrK,EAAAA,EAAA,GAC5B3O,OAAOoa,aAAapB,aAAe,IACnCF,EAAQE,aAEY,MAAMqB,EAAiB,GAC9BA,EAAe,6EAA+E,CACtGd,EAAGA,IAAMC,EAAQ,MACjBc,GAAI,8CAEpBta,OAAOoa,aAAepa,OAAOoa,cAAgB,GAC7Cpa,OAAOoa,aAAaC,eAAc1L,EAAAA,EAAA,GACP3O,OAAOoa,aAAaC,gBAAkB,IACtCA,UC/G3BE,EAAOC,QAAU7Z,cCAjB4Z,EAAOC,QAAUC","sources":["webpack://mattressfirm/./src/Utilities/components/BVRatingSummary.tsx?6e2e","webpack://mattressfirm/./src/Utilities/getAttributeUtils.ts?f2d8","webpack://mattressfirm/./src/Utilities/product-search-result-utils.tsx?58f2","webpack://mattressfirm/./src/actions/complete-your-bed-pillow.action.ts?db7f","webpack://mattressfirm/./src/actions/complete-your-bed-protector.action.ts?82b2","webpack://mattressfirm/./src/actions/fetch-complete-your-bed.action.ts?ea35","webpack://mattressfirm/./src/actions/EyebrowMessageDataServiceEntities.g.ts?c30c","webpack://mattressfirm/./src/actions/EyebrowMessageDataActionExtension.g.ts?1765","webpack://mattressfirm/./src/actions/get-eyebrow-message.action.ts?b0a0","webpack://mattressfirm/./src/data-actions/get-attributes-for-selected-variant.ts?4859","webpack://mattressfirm/./src/modules/mfrm-complete-your-bed/mfrm-complete-your-bed.tsx?0ab0","webpack://mattressfirm/./src/modules/mfrm-complete-your-bed/util/renderBaseImage.tsx?1323","webpack://mattressfirm/./src/modules/mfrm-complete-your-bed/util/hasDiscount.tsx?c72f","webpack://mattressfirm/./src/modules/mfrm-complete-your-bed/mfrm-complete-your-bed.view.tsx?d7c3","webpack://mattressfirm/./src/themes/mattressfirm/views/components/delivery-message/deliverymessage.component.tsx?e440","webpack://mattressfirm/./src/themes/mattressfirm/views/components/price/split-price.tsx?ee35","webpack://mattressfirm/./src/themes/mattressfirm/views/components/price/price.component.tsx?5d2f","webpack://mattressfirm/./src/themes/mattressfirm/views/components/selectable-card/selectable-card.component.tsx?a7a2","webpack://mattressfirm/./lib/mfrm-complete-your-bed/module-registration.js?70e6","webpack://mattressfirm/external var \"React\"?0d3b","webpack://mattressfirm/external var \"ReactDOM\"?853b"],"sourcesContent":["import React, { useState, useEffect, useRef } from 'react';\r\n\r\nexport const BVRatingSummary = ({\r\n itemId,\r\n onClick,\r\n variantId,\r\n hideReadReviewsButton\r\n}: {\r\n itemId: string | undefined;\r\n onClick?: () => void;\r\n variantId?: number | undefined;\r\n hideReadReviewsButton?: boolean\r\n}) => {\r\n const [dataBvProductIdAttr, setDataBvProductIdAttr] = useState(itemId);\r\n const wrapper = useRef(null);\r\n const interval = useRef(-1);\r\n const [numReviews, setNumReviews] = useState();\r\n\r\n useEffect(() => {\r\n setDataBvProductIdAttr(itemId);\r\n }, [itemId]);\r\n\r\n useEffect(() => {\r\n setDataBvProductIdAttr('bv-refresh');\r\n }, [variantId]);\r\n\r\n useEffect(() => {\r\n if (dataBvProductIdAttr === 'bv-refresh') {\r\n setDataBvProductIdAttr(itemId);\r\n }\r\n }, [dataBvProductIdAttr]);\r\n useEffect(() => {\r\n const pollInterval = window.setInterval(() => {\r\n const numReviewsHTML = wrapper.current?.querySelector('.bv_numReviews_text')?.innerHTML.match(/\\(([^)]+)\\)/)?.[1];\r\n if (numReviewsHTML) {\r\n setNumReviews(numReviewsHTML);\r\n clearInterval(pollInterval);\r\n }\r\n }, 0);\r\n });\r\n useEffect(() => {\r\n if (wrapper.current) {\r\n numReviews === '0' ? wrapper.current.style.display = 'none' : wrapper.current.style.display = 'flex';\r\n }\r\n }, [numReviews]);\r\n\r\n return (\r\n {\r\n if (hideReadReviewsButton) {\r\n interval.current = window.setInterval(() => {\r\n const button: Element | undefined = Array.from(document.querySelectorAll('.bv_button_buttonFull')).find((button) => {\r\n return button?.innerHTML === `Read ${numReviews} Reviews`;\r\n });\r\n if (button) {\r\n button.outerHTML = '';\r\n }\r\n });\r\n }\r\n }}\r\n onMouseLeave={() => {\r\n if (hideReadReviewsButton) {\r\n clearInterval(interval.current);\r\n }\r\n }}\r\n data-bv-show='rating_summary'\r\n data-bv-product-id={dataBvProductIdAttr}\r\n onClick={onClick}\r\n ref={wrapper}\r\n />\r\n );\r\n};\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};","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\nimport { IMFIATPInventoryEntityPLP } from '../actions/BatchCoreProductDataServiceEntities.g';\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\nexport const _getDeliveryDate = (coreProductATPData: IMFIATPInventoryEntityPLP) => {\r\n let deliveryDetails = {\r\n deliveryByMessage: '',\r\n locationId: ''\r\n };\r\n const item = coreProductATPData;\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 const startTimeHour = item.StartTime?.substring(0,2) || \"14\";\r\n if (today === deliveryDate) {\r\n const deliveryMessage =\r\n parseInt(startTimeHour, 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 deliveryDetails = {\r\n deliveryByMessage: deliveryMessage,\r\n locationId: item.Location1!\r\n };\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 }\r\n }\r\n return deliveryDetails;\r\n};\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 { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * CompleteyourBedPillow Input Action\r\n */\r\nexport class CompleteYourBedPillowInput implements Msdyn365.IActionInput {\r\n public pillow: SimpleProduct | undefined | null;\r\n // Construct the input needed to run the action\r\n constructor(pillow: SimpleProduct | undefined | null) {\r\n this.pillow = pillow;\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 = () => `CompleteyourBedPillow`;\r\n public getCacheObjectType = () => 'CompleteyourBedPillow';\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 ICompleteYourBedPillowData {\r\n pillow: SimpleProduct | undefined | null;\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 CompleteYourBedPillowInput(args?.config?.pillow);\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: CompleteYourBedPillowInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\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 { pillow: input.pillow };\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: 'CompleteyourBedPillow',\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 { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * CompleteyourBedProtector Input Action\r\n */\r\nexport class CompleteyourBedProtectorInput implements Msdyn365.IActionInput {\r\n public protector: SimpleProduct | undefined | null;\r\n // Construct the input needed to run the action\r\n constructor(protector: SimpleProduct | undefined | null) {\r\n this.protector = protector;\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 = () => `CompleteyourBedProtector`;\r\n public getCacheObjectType = () => 'CompleteyourBedProtector';\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 ICompleteYourBedProtectorData {\r\n protector: SimpleProduct | undefined | null;\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 CompleteyourBedProtectorInput(args?.config?.protector);\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: CompleteyourBedProtectorInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\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 { protector: input.protector };\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: 'CompleteyourBedProtector',\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 { AsyncResult } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * FetchcompleteYourBedData Input Action\r\n */\r\nexport class FetchCompleteYourBedDataInput implements Msdyn365.IActionInput {\r\n public jsonData: string;\r\n // Construct the input needed to run the action\r\n constructor(jsonData: string) {\r\n this.jsonData = jsonData;\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 = () => `completeYourBedData`;\r\n public getCacheObjectType = () => 'completeYourBedDataObject';\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 IFetchcompleteYourBedData {\r\n text: string;\r\n jsonData: string;\r\n}\r\n\r\nexport interface IDataRow {\r\n mattressVariantReqId: string;\r\n buyAllVariantRecIds:any;\r\n}\r\n\r\nexport interface foo {\r\n data: 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 FetchCompleteYourBedDataInput(args?.config?.jsonData!);\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: FetchCompleteYourBedDataInput, ctx: Msdyn365.IActionContext): Promise {\r\n\r\n const res = await Msdyn365.sendRequest(input.jsonData, 'get');\r\n const data = res.data;\r\n return data;\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: 'FetchcompleteYourBedData',\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","// tslint:disable\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as Entities from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n/**\r\n * MFIPromotion entity interface.\r\n */\r\nexport interface IMFIPromotion {\r\n ItemId: string;\r\n DistinctProductVariant?: string;\r\n EyeBrows?: Entities.Promotion[];\r\n ExtensionProperties?: Entities.CommerceProperty[];\r\n}\r\n\r\n/**\r\n * MFIAvailablePromotionDescription entity interface.\r\n */\r\nexport interface IMFIAvailablePromotionDescription {\r\n PriceGroup?: string;\r\n Items?: IMFIItem[];\r\n}\r\n\r\n/**\r\n * MFIItem entity interface.\r\n */\r\nexport interface IMFIItem {\r\n ItemId?: string;\r\n DistinctProductVariant?: string;\r\n}\r\n\r\n/**\r\n * MFIPromotion entity class.\r\n */\r\nexport class MFIPromotionExtensionClass implements IMFIPromotion {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ItemId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public DistinctProductVariant: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public EyeBrows: Entities.Promotion[];\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ExtensionProperties: Entities.CommerceProperty[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ItemId = odataObject.ItemId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.DistinctProductVariant = odataObject.DistinctProductVariant;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.EyeBrows = undefined;\r\n if (odataObject.EyeBrows) {\r\n this.EyeBrows = [];\r\n for (let i = 0; i < odataObject.EyeBrows.length; i++) {\r\n if (odataObject.EyeBrows[i]) {\r\n if (odataObject.EyeBrows[i]['@odata.type']) {\r\n let className: string = odataObject.EyeBrows[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.EyeBrows[i] = new EntityClasses[className](odataObject.EyeBrows[i]);\r\n }\r\n } else {\r\n this.EyeBrows[i] = new EntityClasses.PromotionClass(odataObject.EyeBrows[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.EyeBrows[i] = undefined;\r\n }\r\n }\r\n }\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties = undefined;\r\n if (odataObject.ExtensionProperties) {\r\n this.ExtensionProperties = [];\r\n for (let i = 0; i < odataObject.ExtensionProperties.length; i++) {\r\n if (odataObject.ExtensionProperties[i]) {\r\n if (odataObject.ExtensionProperties[i]['@odata.type']) {\r\n let className: string = odataObject.ExtensionProperties[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.ExtensionProperties[i] = new EntityClasses[className](odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n this.ExtensionProperties[i] = new EntityClasses.CommercePropertyClass(odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * MFIAvailablePromotionDescription entity class.\r\n */\r\nexport class MFIAvailablePromotionDescriptionExtensionClass implements IMFIAvailablePromotionDescription {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public PriceGroup: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Items: IMFIItem[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.PriceGroup = odataObject.PriceGroup;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Items = undefined;\r\n if (odataObject.Items) {\r\n this.Items = [];\r\n for (let i = 0; i < odataObject.Items.length; i++) {\r\n if (odataObject.Items[i]) {\r\n if (odataObject.Items[i]['@odata.type']) {\r\n let className: string = odataObject.Items[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.Items[i] = new EntityClasses[className](odataObject.Items[i]);\r\n }\r\n } else {\r\n this.Items[i] = new MFIItemExtensionClass(odataObject.Items[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Items[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * MFIItem entity class.\r\n */\r\nexport class MFIItemExtensionClass implements IMFIItem {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ItemId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public DistinctProductVariant: string;\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ItemId = odataObject.ItemId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.DistinctProductVariant = odataObject.DistinctProductVariant;\r\n }\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 * THIS FILE IS AN AUTOGENERATED TYPESCRIPT PROXY EXTENSION.\r\n * TO USE THIS FILE, IT MUST BE ADDED TO A D365COMMERCE APPLICATION\r\n */\r\n// tslint:disable\r\nimport {\r\n AsyncResult,\r\n callActionOrExecute,\r\n DataServiceQuery,\r\n IContext,\r\n IDataServiceRequest,\r\n IQueryResultSettings\r\n} from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as DataServiceEntities from './EyebrowMessageDataServiceEntities.g';\r\n\r\n// @ts-ignore\r\nfunction availablePromotionsDescriptionsQuery(itemId?: string): DataServiceQuery {\r\n const key = itemId ? { ItemId: itemId } : null;\r\n return new DataServiceQuery('AvailablePromotionsDescriptions', 'MFIPromotion', DataServiceEntities.MFIPromotionExtensionClass, key);\r\n}\r\n\r\nexport function createMFIGetAvailablePromotionsDescriptionInput(\r\n queryResultSettings: IQueryResultSettings,\r\n availablePromotionsDescription: DataServiceEntities.IMFIAvailablePromotionDescription\r\n): IDataServiceRequest {\r\n const query = availablePromotionsDescriptionsQuery().resultSettings(queryResultSettings);\r\n return query.createDataServiceRequestForOperation(\r\n 'MFIGetAvailablePromotionsDescription',\r\n true,\r\n DataServiceEntities.MFIPromotionExtensionClass,\r\n 'true',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IMFIPromotion' },\r\n { availablePromotionsDescription: availablePromotionsDescription }\r\n );\r\n}\r\n\r\nexport function mFIGetAvailablePromotionsDescriptionAsync(\r\n context: IContext,\r\n availablePromotionsDescription: DataServiceEntities.IMFIAvailablePromotionDescription\r\n): AsyncResult {\r\n const request = createMFIGetAvailablePromotionsDescriptionInput(context.queryResultSettings || {}, availablePromotionsDescription);\r\n return callActionOrExecute(request, context.callerContext);\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 * as Msdyn365 from '@msdyn365-commerce/core';\r\n// tslint:disable-next-line: no-duplicate-imports\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { CacheType } from '@msdyn365-commerce/retail-proxy';\r\nimport { mFIGetAvailablePromotionsDescriptionAsync } from './EyebrowMessageDataActionExtension.g';\r\nimport { IMFIAvailablePromotionDescription, IMFIPromotion } from './EyebrowMessageDataServiceEntities.g';\r\n/**\r\n * GetEyebrowMessage Input Action\r\n */\r\n\r\nexport class GetEyebrowMessageInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n public item: IMFIAvailablePromotionDescription;\r\n public isCached?: boolean;\r\n public pageType?: string;\r\n private readonly createCacheKey: string | '';\r\n constructor(item: IMFIAvailablePromotionDescription, pageType?: string, isCached?: boolean) {\r\n this.item = item;\r\n this.isCached = isCached;\r\n this.pageType = pageType;\r\n // incase of pdp cache key will be based on variantId and on PLP will be basded on ItemId\r\n this.createCacheKey =\r\n this.item.Items?.map(obj => (this.pageType === 'pdp' ? obj?.DistinctProductVariant : obj?.ItemId))\r\n .join('-')\r\n .toString() || '';\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 = () => `Get-Eyebrow-Message-${this.createCacheKey}`;\r\n // public getCacheKey = () => 'EyebrowMessage';\r\n public getCacheObjectType = () => 'EyebrowMessage';\r\n public dataCacheType = (): CacheType => (this.isCached ? 'application' : 'application');\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\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 getEyebrowAction(input: GetEyebrowMessageInput, ctx: IActionContext): Promise {\r\n try {\r\n const result = await mFIGetAvailablePromotionsDescriptionAsync(\r\n { callerContext: ctx, queryResultSettings: { Paging: { Top: 50 } } },\r\n input.item\r\n );\r\n if (result) {\r\n return result;\r\n }\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n return null;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getEyebrowAction,\r\n // Give your data action a unique id\r\n id: 'GetEyebrowMessage'\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","import {\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 { AttributeValue, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport { getSelectedProductIdFromActionInput, getSelectedVariant, SelectedVariantInput } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getAttributeValuesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n\r\n/**\r\n * Chains getting the SelectedVariant with GetActivePrice\r\n */\r\nexport class AttributesForSelectedVariantInput implements IActionInput {\r\n public productId: number;\r\n public channelId: number;\r\n public catalogId: number;\r\n public selectedProduct: SimpleProduct | undefined;\r\n\r\n constructor(productId: number, channelId: number, selectedProduct?: SimpleProduct, catalogId?: number) {\r\n this.productId = productId;\r\n this.channelId = channelId;\r\n this.selectedProduct = selectedProduct;\r\n this.catalogId = catalogId || 0;\r\n }\r\n\r\n public getCacheKey = () => `AttributesForSelectedVariant`;\r\n public getCacheObjectType = () => 'ProductAttributeValue';\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\nexport const createAttributesForSelectedVariantInput = (\r\n inputData: ICreateActionContext>\r\n): AttributesForSelectedVariantInput => {\r\n const productId = getSelectedProductIdFromActionInput(inputData);\r\n if (productId) {\r\n return new AttributesForSelectedVariantInput(+productId, +inputData.requestContext.apiSettings.channelId);\r\n } else {\r\n throw new Error('Unable to create PriceForSelectedVariantInput, no productId found on module config or query');\r\n }\r\n};\r\n\r\n/**\r\n * Calls the Retail API a get a list of dimension values for a given product.\r\n */\r\nexport async function getAttributesForSelectedVariantAction(\r\n input: AttributesForSelectedVariantInput,\r\n ctx: IActionContext\r\n): Promise {\r\n // @ts-ignore: Promise vs. ObservablePromise typing conflict\r\n return Promise.resolve()\r\n .then(() => {\r\n const activeProduct: SimpleProduct | undefined = input.selectedProduct;\r\n\r\n if (!activeProduct) {\r\n const selectedVariantInput = new SelectedVariantInput(input.productId, input.channelId);\r\n\r\n return getSelectedVariant(selectedVariantInput, ctx);\r\n }\r\n\r\n return activeProduct;\r\n })\r\n .then((productResult: SimpleProduct | null) => {\r\n const activeProduct: SimpleProduct | undefined = productResult;\r\n\r\n if (activeProduct) {\r\n return getAttributeValuesAsync(\r\n { callerContext: ctx, queryResultSettings: {} },\r\n activeProduct.RecordId,\r\n input.channelId,\r\n input.catalogId\r\n );\r\n }\r\n\r\n return null;\r\n })\r\n .then((attributeValues: AttributeValue[] | null) => {\r\n const resultArray = attributeValues;\r\n if (resultArray) {\r\n return resultArray;\r\n }\r\n\r\n return [];\r\n })\r\n .catch((error: Error) => {\r\n ctx.trace(error.message);\r\n throw new Error(`[getPriceForSelectedVariantAction]Error executing action ${error.message}`);\r\n });\r\n}\r\n\r\nexport default createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/product-info/get-attributes-for-selected-variant',\r\n action: >getAttributesForSelectedVariantAction,\r\n input: createAttributesForSelectedVariantInput\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\n\r\nimport React, { useEffect } from 'react';\r\n\r\nimport { IMfrmCompleteYourBedData } from './mfrm-complete-your-bed.data';\r\nimport { IMfrmCompleteYourBedProps } from './mfrm-complete-your-bed.props.autogenerated';\r\nimport { getActivePricesAsync, getAttributeValuesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { ProductSearchCriteria, ProductSearchResult, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { getBVAttributeValues } from '../../Utilities/get-bv-attributes';\r\nimport { getByIdsAsync, searchByCriteriaAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport fetchCompleteYourBedDataDataAction, { FetchCompleteYourBedDataInput, IDataRow } from '../../actions/fetch-complete-your-bed.action';\r\nimport { CompleteYourBedPillowInput } from '../../actions/complete-your-bed-pillow.action';\r\nimport { generateImageUrl } from '../../data-actions/utilities/utils';\r\nimport { CompleteyourBedProtectorInput } from '../../actions/complete-your-bed-protector.action';\r\nimport { getAttributeByName } from '../../Utilities/getAttributeUtils';\r\nimport { _getProductType } from '../../themes/mattressfirm/views/components/delivery-message/deliverymessage.component';\r\nimport { _smallParcelProductATPBooleanStatus } from '../../Utilities/mfrm-buybox-utils';\r\n\r\nexport interface IMfrmCompleteYourBedViewProps extends IMfrmCompleteYourBedProps {\r\n product: SimpleProduct;\r\n items: MergedProduct[];\r\n protectorData: MergedProduct[];\r\n onUnselect(arg0: SimpleProduct, arg1: number): void;\r\n onSelect(arg0: SimpleProduct, arg1: number, arg2: boolean | undefined): void;\r\n onUnselectProtector(arg0: SimpleProduct, arg1: number): void;\r\n onSelectProtector(arg0: SimpleProduct, arg1: number, arg2: boolean | undefined): void;\r\n matressProtectorData: any;\r\n protectorSelected: boolean;\r\n pillowSelected: boolean;\r\n}\r\nexport interface MergedProduct extends SimpleProduct {\r\n productName?: string;\r\n ItemId?: string;\r\n CustomerContextualPrice: number | undefined;\r\n DiscountAmount: number | undefined;\r\n TotalRatings: number | undefined;\r\n AverageRating: number | undefined;\r\n brand?: string;\r\n PrimaryImageUrl?: string;\r\n isSelected: boolean;\r\n inventoryStatus: { outOfStock: boolean | undefined, productType: string | undefined };\r\n}\r\n/**\r\n *\r\n * MfrmCompleteYourBed component\r\n * @extends {React.PureComponent>}\r\n */\r\n\r\nexport const MfrmCompleteYourBed: React.FC> = props => {\r\n // let smallParcelData: any[] = [];\r\n const [items, setItems] = React.useState([]);\r\n const [protectorData, setProtectorData] = React.useState([]);\r\n // const [matressProtectorData, setMatressProtectorData] = React.useState(null);\r\n const [protectorSelected, setProtectorSelected] = React.useState(false);\r\n const [pillowSelected, setPillowSelected] = React.useState(false);\r\n const [database, setDatabase] = React.useState(null);\r\n const {\r\n data: {\r\n product: { result: productResult },\r\n productCompareBuyboxStateSharing: { result: buyboxState }\r\n }\r\n } = props;\r\n const getVariantIds = (RecordId: any) => {\r\n const databaseRow: IDataRow = database.find((item: any /* this is obvi */) => item.mattressVariantReqId === `${RecordId}`);\r\n setItems([]);\r\n setProtectorData([]);\r\n props.context.actionContext.update(new CompleteYourBedPillowInput(null), { pillow: null });\r\n props.context.actionContext.update(new CompleteyourBedProtectorInput(null), { protector: null });\r\n const buyAll3Array = databaseRow?.buyAllVariantRecIds;\r\n if (buyAll3Array && buyAll3Array.length > 0) {\r\n buyAll3Array[0] && buyAll3Array && getProductsFromProductId(Number(buyAll3Array[0]), \"pillow\");\r\n if (buyAll3Array.length > 1) {\r\n buyAll3Array[1] && buyAll3Array && getProductsFromProductId(Number(buyAll3Array[1]), \"protector\");\r\n }\r\n }\r\n };\r\n const getProductsFromProductId = async (RecordId: number, type: string) => {\r\n\r\n const products = await getByIdsAsync(\r\n { callerContext: props.context.actionContext },\r\n props.context.request.apiSettings.channelId,\r\n [RecordId]\r\n );\r\n const inventoryStatus = await getInventoryStatus(RecordId, products[0]?.ItemId?.toString(), undefined, undefined);\r\n const productPrices = await getActivePricesAsync(\r\n { callerContext: props.context.actionContext },\r\n {\r\n ChannelId: props.context.actionContext.requestContext.apiSettings.channelId,\r\n CatalogId: props.context.actionContext.requestContext.apiSettings.catalogId\r\n },\r\n [RecordId],\r\n new Date(),\r\n null,\r\n [],\r\n true\r\n );\r\n let productSearchResults: ProductSearchResult[] = [];\r\n if (products.length) {\r\n const productSearchCriteria: ProductSearchCriteria = {\r\n Ids: [...new Set(products.map(item => item.MasterProductId ?? 0))],\r\n Context: {\r\n ChannelId: +props.context.actionContext.requestContext.apiSettings.channelId,\r\n CatalogId: +props.context.actionContext.requestContext.apiSettings.catalogId\r\n },\r\n IncludeAttributes: true,\r\n SearchCondition: '*'\r\n };\r\n productSearchResults = await searchByCriteriaAsync({ callerContext: props.context.actionContext }, productSearchCriteria);\r\n }\r\n const _parseValue = (productRating?: string | number): number => {\r\n const value = +(productRating || 0);\r\n return Math.round(value * 10) / 10;\r\n };\r\n const MergedProducts: any[] = products.map((product, i) => {\r\n const productImageUrl = product.PrimaryImageUrl;\r\n return {\r\n ...product,\r\n productName: product.Name,\r\n ItemId: product.ItemId,\r\n CustomerContextualPrice: productPrices[i].CustomerContextualPrice,\r\n DiscountAmount: productPrices[i].DiscountAmount,\r\n AverageRating:\r\n getBVAttributeValues(\r\n productSearchResults.find(item => item.MasterProductId === product.MasterProductId)?.AttributeValues,\r\n 'BVAverageOverallRating'\r\n ) ?? _parseValue(productSearchResults.find(item => item.MasterProductId === product.MasterProductId)?.AverageRating),\r\n TotalRatings:\r\n getBVAttributeValues(\r\n productSearchResults.find(item => item.MasterProductId === product.MasterProductId)?.AttributeValues,\r\n 'BVTotalReviewCount'\r\n ) ?? _parseValue(productSearchResults.find(item => item.MasterProductId === product.MasterProductId)?.TotalRatings),\r\n brand: productSearchResults.find(item => item.MasterProductId === product.MasterProductId)?.AttributeValues?.find(attr => attr.KeyName?.trim() === 'VendorBrand')?.TextValue,\r\n PrimaryImageUrl: generateImageUrl(productImageUrl, props.context.request.apiSettings),\r\n inventoryStatus\r\n };\r\n });\r\n\r\n type === \"pillow\" ? setItems(MergedProducts) : setProtectorData(MergedProducts);\r\n type === \"protector\" && MergedProducts && protectorSelected && props.context.actionContext.update(new CompleteyourBedProtectorInput(MergedProducts[0]), { protector: MergedProducts[0], listPosition: 0 });\r\n type === \"pillow\" && MergedProducts && pillowSelected && props.context.actionContext.update(new CompleteYourBedPillowInput(MergedProducts[0]), { pillow: MergedProducts[0], listPosition: 0 });\r\n };\r\n\r\n const getInventoryStatus = async (variantId: number, itemId: string | undefined, productTypeArg: string | undefined, outOfStock: boolean | undefined, isZipCodeChnaged: boolean = false):\r\n Promise<{ productType: string, outOfStock: boolean | undefined }> => {\r\n if (!productTypeArg) {\r\n const attributeValues = await getAttributeValuesAsync(\r\n {\r\n callerContext: props.context.actionContext,\r\n queryResultSettings: {}\r\n },\r\n variantId,\r\n props.context.actionContext.requestContext.apiSettings.channelId,\r\n props.context.actionContext.requestContext.apiSettings.catalogId\r\n );\r\n productTypeArg = _getProductType(getAttributeByName(attributeValues, 'shippingInformation')?.TextValue).toLowerCase();\r\n outOfStock = getAttributeByName(attributeValues, 'Out of Stock')?.BooleanValue ?? false;\r\n }\r\n if (productTypeArg === 'small parcel' && (isZipCodeChnaged || !outOfStock)) {\r\n outOfStock = await _smallParcelProductATPBooleanStatus(variantId, itemId, props.context.app.config.weeksPDPforATPCall, props.context);\r\n }\r\n return { productType: productTypeArg, outOfStock };\r\n };\r\n\r\n const onSelectPillow = (product: SimpleProduct | null | undefined, index: any, outOfStock?: boolean | undefined) => {\r\n if (outOfStock) {\r\n return;\r\n }\r\n props.context.actionContext.update(new CompleteYourBedPillowInput(product), { pillow: product, listPosition: index });\r\n const clone = items.map((item, i) => {\r\n if (index === i) {\r\n item.isSelected = true;\r\n }\r\n\r\n return item;\r\n });\r\n setItems(clone);\r\n setPillowSelected(true);\r\n\r\n };\r\n\r\n const onSelectProtector = (product: SimpleProduct | null | undefined, index: any, outOfStock?: boolean | undefined) => {\r\n if (outOfStock) {\r\n return;\r\n }\r\n props.context.actionContext.update(new CompleteyourBedProtectorInput(product), { protector: product, listPosition: index });\r\n const clone = protectorData.map((item, i) => {\r\n if (index === i) {\r\n item.isSelected = true;\r\n }\r\n\r\n return item;\r\n });\r\n setProtectorData(clone);\r\n setProtectorSelected(true);\r\n\r\n };\r\n\r\n const onUnselectPillow = (product: SimpleProduct | null | undefined, index: any, outOfStock?: boolean | undefined) => {\r\n props.context.actionContext.update(new CompleteYourBedPillowInput(null), { pillow: null });\r\n const clone = items.map((item, i) => {\r\n if (index === i) {\r\n item.isSelected = false;\r\n if (outOfStock) {\r\n item.inventoryStatus.outOfStock = outOfStock;\r\n }\r\n }\r\n\r\n return item;\r\n });\r\n setItems(clone);\r\n setPillowSelected(false);\r\n\r\n };\r\n const onUnselectProtector = (product: SimpleProduct | null | undefined, index: any, outOfStock?: boolean | undefined) => {\r\n props.context.actionContext.update(new CompleteyourBedProtectorInput(null), { protector: null });\r\n const clone = protectorData.map((item, i) => {\r\n if (index === i) {\r\n item.isSelected = false;\r\n if (outOfStock) {\r\n item.inventoryStatus.outOfStock = outOfStock;\r\n }\r\n }\r\n\r\n return item;\r\n });\r\n setProtectorData(clone);\r\n setProtectorSelected(false);\r\n\r\n };\r\n\r\n const inventoryCheckZipCode = async () => {\r\n if (buyboxState?.zipCode) {\r\n if (items?.length > 0 && (items[0].inventoryStatus?.productType === 'small parcel')) {\r\n await getInventoryStatus(items[0]?.RecordId, items[0]?.ItemId?.toString(), items[0].inventoryStatus?.productType, items[0].inventoryStatus?.outOfStock, true).then((status: any) => {\r\n setItems(prevState => {\r\n const newItems = [...prevState];\r\n newItems[0] = { ...newItems[0], inventoryStatus: { productType: newItems[0].inventoryStatus.productType, outOfStock: status?.outOfStock } };\r\n return newItems;\r\n });\r\n if (status?.outOfStock && pillowSelected) {\r\n onUnselectPillow(null, 0, status?.outOfStock);\r\n }\r\n }).catch((err) => console.log(err));\r\n }\r\n if (protectorData?.length > 0 && (protectorData[0].inventoryStatus?.productType === 'small parcel')) {\r\n await getInventoryStatus(protectorData[0]?.RecordId, protectorData[0]?.ItemId?.toString(), protectorData[0].inventoryStatus?.productType, protectorData[0].inventoryStatus?.outOfStock, true).then((status: any) => {\r\n setProtectorData(prevState => {\r\n const newItems = [...prevState];\r\n newItems[0] = { ...newItems[0], inventoryStatus: { productType: newItems[0].inventoryStatus.productType, outOfStock: status?.outOfStock } };\r\n return newItems;\r\n });\r\n if (status?.outOfStock && protectorSelected) {\r\n onUnselectProtector(null, 0, status?.outOfStock);\r\n }\r\n }\r\n ).catch((err) => console.log(err));\r\n }\r\n }\r\n };\r\n useEffect(() => {\r\n const actionInput = new FetchCompleteYourBedDataInput(props.context.app.config.jsonSrc);\r\n fetchCompleteYourBedDataDataAction(actionInput, props.context.actionContext)\r\n .then(data => setDatabase(data))\r\n .catch(e => {\r\n console.error('Error fetching database', e);\r\n });\r\n }, []);\r\n useEffect(() => {\r\n void inventoryCheckZipCode();\r\n }, [buyboxState?.zipCode]);\r\n useEffect(() => {\r\n database && productResult?.RecordId && getVariantIds(productResult?.RecordId);\r\n }, [productResult?.RecordId, database !== null]);\r\n return props.renderView({\r\n ...props,\r\n items,\r\n onSelect: onSelectPillow,\r\n onSelectProtector: onSelectProtector,\r\n onUnselect: onUnselectPillow,\r\n onUnselectProtector: onUnselectProtector,\r\n protectorData: protectorData,\r\n protectorSelected: protectorSelected,\r\n pillowSelected: pillowSelected\r\n });\r\n};\r\n\r\nexport default MfrmCompleteYourBed;\r\n\r\n\r\n","import React from 'react';\r\nimport { IGridSettings, IImageData, IImageSettings, Image } from '@msdyn365-commerce/core';\r\n\r\n\r\nexport const renderBaseImage = (\r\n gridSettings?: IGridSettings,\r\n PrimaryImageUrl?: string,\r\n altText?: string,\r\n fallbackImageUrl?: any\r\n): JSX.Element | null => {\r\n if (!PrimaryImageUrl || !gridSettings) {\r\n return null;\r\n }\r\n const defaultImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: `w=240&h=240&m=6`, w: 0, h: 0 },\r\n lg: { q: `w=240&h=240&m=6`, w: 0, h: 0 },\r\n xl: { q: `w=240&h=240&m=6`, w: 0, h: 0 }\r\n },\r\n lazyload: false\r\n };\r\n\r\n const img: IImageData = {\r\n src: PrimaryImageUrl ? PrimaryImageUrl : '',\r\n altText: altText ? altText : ''\r\n };\r\n return (\r\n \r\n );\r\n};","import { MergedProduct } from \"../mfrm-complete-your-bed\";\r\nexport const hasDiscount = (item: MergedProduct) => {\r\n return typeof item.DiscountAmount !== 'undefined' && item.DiscountAmount > 0;\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 React from 'react';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport { IMfrmCompleteYourBedViewProps } from './mfrm-complete-your-bed';\r\nimport SelectableCard from '../../themes/mattressfirm/views/components/selectable-card';\r\nimport { renderBaseImage } from './util/renderBaseImage';\r\nimport { hasDiscount } from './util/hasDiscount';\r\nimport { getFallbackImageUrl } from '../../data-actions/utilities/utils';\r\nimport Price from '../../themes/mattressfirm/views/components/price/price.component';\r\nimport { BVRatingSummary } from '../../Utilities/components/BVRatingSummary';\r\nimport { renderRating } from '../../Utilities/get-rating';\r\n\r\nexport default (props: IMfrmCompleteYourBedViewProps) => {\r\n const { items, protectorData, onSelect, onUnselect, onSelectProtector, onUnselectProtector, protectorSelected, pillowSelected } = props;\r\n const renderBadge = (outOfStock: boolean | undefined, text: string | undefined) => {\r\n if (outOfStock) {\r\n return {text};\r\n }\r\n return null;\r\n };\r\n const renderCard = items.map((item, i) => {\r\n const onchange = (e: boolean | React.ChangeEvent | any) => {\r\n const checkbox = e.target;\r\n const checkboxIsChecked = checkbox.checked;\r\n if (checkboxIsChecked === true) {\r\n onSelect(item, i, item.inventoryStatus?.outOfStock);\r\n } else {\r\n onUnselect(item, i);\r\n }\r\n };\r\n\r\n const htmlCheckboxId = \"mfrm-complete-your-bed-checkbox-pillow\";\r\n return (\r\n <>\r\n {renderBadge(item.inventoryStatus?.outOfStock, props.resources.outOfStockText)}\r\n onchange(e)}\r\n disabled={item.inventoryStatus?.outOfStock}\r\n />\r\n \r\n : renderRating(\r\n props.context,\r\n props.typeName,\r\n props.id,\r\n item.AverageRating,\r\n item.TotalRatings,\r\n props.resources.ratingAriaLabel\r\n )}\r\n standardPrice={\r\n typeof item.CustomerContextualPrice === 'number' &&\r\n typeof item.DiscountAmount === 'number' &&\r\n item.CustomerContextualPrice + item.DiscountAmount\r\n }\r\n isActive={!item.inventoryStatus?.outOfStock}\r\n currentPrice={hasDiscount(item) && item.CustomerContextualPrice} />\r\n \r\n {pillowSelected && Added!}\r\n );\r\n });\r\n\r\n const renderProtectorCard = protectorData && protectorData.map((protector, i) => {\r\n const onchange = (e: boolean | React.ChangeEvent | any) => {\r\n const checkbox = e.target;\r\n const checkboxIsChecked = checkbox.checked;\r\n if (checkboxIsChecked === true) {\r\n onSelectProtector(protector, i, protector?.inventoryStatus?.outOfStock);\r\n } else {\r\n onUnselectProtector(protector, i);\r\n }\r\n };\r\n\r\n const htmlCheckboxId = \"mfrm-complete-your-bed-checkbox-protector\";\r\n return (\r\n <>\r\n {renderBadge(protector?.inventoryStatus?.outOfStock, props.resources.outOfStockText)}\r\n onchange(e)}\r\n disabled={protector?.inventoryStatus?.outOfStock}\r\n />\r\n \r\n
\r\n
{renderBaseImage(\r\n props.context.request.gridSettings,\r\n protector.PrimaryImageUrl,\r\n protector.productName,\r\n getFallbackImageUrl(protector.ItemId, props.context.request.apiSettings)\r\n )}
\r\n
\r\n
{''}
\r\n
{protector.productName ? protector.brand ? `${protector.brand} ${protector.productName}` : `${protector.productName}` : ''}
\r\n {protector.TotalRatings !== undefined && protector.AverageRating !== undefined && (\r\n
\r\n {props.config.showBVRatings ? (\r\n \r\n ) : (\r\n \r\n {renderRating(\r\n props.context,\r\n props.typeName,\r\n props.id,\r\n protector.AverageRating,\r\n protector.TotalRatings,\r\n props.resources.ratingAriaLabel\r\n )}\r\n \r\n )}\r\n
\r\n )}\r\n {protector.CustomerContextualPrice && }\r\n
\r\n
\r\n \r\n {protectorSelected && Added!} \r\n );\r\n });\r\n\r\n return (\r\n (items.length !== 0 || protectorData.length !== 0) && < div className='mfrm-complete-your-bed' >\r\n\r\n

{props.config.titleHeadingTag ? props.config.titleHeadingTag : \"Complete Your Bed\"}

\r\n {\r\n items.length !== 0 &&
\r\n {renderCard}\r\n
\r\n }\r\n {\r\n protectorData.length !== 0 &&
\r\n {renderProtectorCard}\r\n
\r\n }\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;","export const splitPrice = (price: number | boolean | undefined) => {\r\n if (price === 0) {\r\n return { dollars: \"0\", cents: \"\" };\r\n }\r\n const formattedPrice = price?.toLocaleString(\"en-US\", {\r\n style: \"currency\",\r\n currency: \"USD\"\r\n });\r\n\r\n const priceArr = formattedPrice?.match(/(\\d|,)+/g);\r\n\r\n const dollars = priceArr?.[0] || \"0\";\r\n const cents = priceArr?.[1] || \"00\";\r\n\r\n return { dollars, cents };\r\n};\r\n","import React from 'react';\r\nimport { splitPrice } from \"./split-price\";\r\n\r\nexport interface PriceProps {\r\n standard: number;\r\n current: number | false | undefined;\r\n}\r\n\r\nexport const Price:React.FC = ({ standard, current }) => {\r\n const { dollars: standardDollars, cents: standardCents } = splitPrice(\r\n standard\r\n );\r\n const { dollars: currentDollars, cents: currentCents } = splitPrice(current);\r\n\r\n return (\r\n
\r\n {current && (\r\n
\r\n ${currentDollars}\r\n {currentCents}\r\n
\r\n )}\r\n
\r\n ${standardDollars}\r\n {standardCents}\r\n {current &&
}\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default Price;\r\n","import React from 'react';\r\nimport { Price } from '../price/price.component';\r\nexport interface SelectableCardProps {\r\n img: React.ReactNode;\r\n productName: string;\r\n ratings?: React.ReactNode;\r\n standardPrice?: false | number;\r\n currentPrice?: false | number | undefined;\r\n eyebrowText?: string;\r\n isActive?: boolean\r\n}\r\n\r\nconst SelectableCard:React.FC = ({ img, productName, ratings, standardPrice, currentPrice, eyebrowText, isActive = true }) => {\r\n return (\r\n
\r\n
{img}
\r\n
\r\n
{eyebrowText}
\r\n
{productName}
\r\n {ratings && (\r\n
\r\n {ratings}\r\n
\r\n )}\r\n {standardPrice && }\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default SelectableCard;","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-complete-your-bed'] = {\n c: () => require('partner/modules/mfrm-complete-your-bed/mfrm-complete-your-bed.tsx'),\n $type: 'contentModule',\n da: [{name:'completeYourBedPillow', path:'actions/complete-your-bed-pillow.action', runOn: 0},{name:'completeYourBedProtector', path:'actions/complete-your-bed-protector.action', runOn: 0},{name:'product', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant', runOn: 0},{name:'productCompareBuyboxStateSharing', path:'actions/product-compare-buybox-state-sharing', runOn: 0},{name:'productSpecificationData', path:'data-actions/get-attributes-for-selected-variant', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'mfrm-complete-your-bed',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/mfrm-complete-your-bed'\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/complete-your-bed-pillow.action';\n let dataAction = require('partner/actions/complete-your-bed-pillow.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/complete-your-bed-protector.action';\n let dataAction = require('partner/actions/complete-your-bed-protector.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-attributes-for-selected-variant';\n let dataAction = require('partner/data-actions/get-attributes-for-selected-variant');\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-complete-your-bed|mfrm-complete-your-bed'] = {\n c: () => require('partner/modules/mfrm-complete-your-bed/mfrm-complete-your-bed.view.tsx'),\n cn: '__local__-__local__-mfrm-complete-your-bed'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["BVRatingSummary","_ref","itemId","onClick","variantId","hideReadReviewsButton","dataBvProductIdAttr","setDataBvProductIdAttr","useState","wrapper","useRef","interval","numReviews","setNumReviews","useEffect","pollInterval","window","setInterval","_wrapper$current","numReviewsHTML","current","querySelector","innerHTML","match","clearInterval","style","display","React","onMouseEnter","button","Array","from","document","querySelectorAll","find","outerHTML","onMouseLeave","ref","getAttributeByName","attributeValues","keyValue","currAttribute","Name","toLowerCase","trim","getAttributeValueByNameUnbxd","list","getAttributeArrayValueByNameUnbxd","getunbxdAttributeNameByCRTName","crtName","mapList","_mapList$find","isArray","attr","CRTName","UnbxdName","_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","_getDeliveryDate","_item$StartTime","startTimeHour","substring","CompleteYourBedPillowInput","constructor","pillow","getCacheKey","getCacheObjectType","dataCacheType","this","Msdyn365","action","input","ctx","id","args","_args$config","CompleteyourBedProtectorInput","protector","FetchCompleteYourBedDataInput","jsonData","data","MFIPromotionExtensionClass","odataObject","EyeBrows","i","className","substr","lastIndexOf","concat","EntityClasses","ExtensionProperties","createMFIGetAvailablePromotionsDescriptionInput","queryResultSettings","availablePromotionsDescription","key","DataServiceQuery","DataServiceEntities","availablePromotionsDescriptionsQuery","resultSettings","createDataServiceRequestForOperation","bypassCache","returnEntity","pageType","isCached","_this$item$Items","createCacheKey","obj","join","toString","request","callActionOrExecute","callerContext","mFIGetAvailablePromotionsDescriptionAsync","Paging","Top","AttributesForSelectedVariantInput","productId","channelId","selectedProduct","catalogId","createAttributesForSelectedVariantInput","inputData","getSelectedProductIdFromActionInput","requestContext","apiSettings","Error","getAttributesForSelectedVariantAction","Promise","resolve","then","activeProduct","selectedVariantInput","SelectedVariantInput","getSelectedVariant","productResult","getAttributeValuesAsync","RecordId","catch","trace","message","createObservableDataAction","MfrmCompleteYourBed","props","setItems","protectorData","setProtectorData","protectorSelected","setProtectorSelected","pillowSelected","setPillowSelected","database","setDatabase","product","productCompareBuyboxStateSharing","buyboxState","getProductsFromProductId","type","_products$","getByIdsAsync","inventoryStatus","getInventoryStatus","productPrices","getActivePricesAsync","ChannelId","CatalogId","productSearchResults","productSearchCriteria","Ids","Set","_item$MasterProductId","MasterProductId","Context","IncludeAttributes","SearchCondition","searchByCriteriaAsync","_parseValue","productRating","value","Math","round","MergedProducts","_getBVAttributeValues","_productSearchResults","_productSearchResults2","_getBVAttributeValues2","_productSearchResults3","_productSearchResults4","_productSearchResults5","productImageUrl","PrimaryImageUrl","_objectSpread","productName","CustomerContextualPrice","DiscountAmount","AverageRating","getBVAttributeValues","AttributeValues","TotalRatings","brand","_attr$KeyName","KeyName","TextValue","generateImageUrl","update","listPosition","productTypeArg","outOfStock","isZipCodeChnaged","arguments","_getAttributeByName","_getAttributeByName$B","_getAttributeByName2","_getProductType","BooleanValue","_smallParcelProductATPBooleanStatus","weeksPDPforATPCall","productType","onUnselectPillow","clone","isSelected","onUnselectProtector","actionInput","jsonSrc","fetchCompleteYourBedDataDataAction","e","zipCode","_items$0$inventorySta","_protectorData$0$inve","_items$","_items$2","_items$0$inventorySta2","_items$0$inventorySta3","_protectorData$","_protectorData$2","_protectorData$0$inve2","_protectorData$0$inve3","status","prevState","newItems","err","inventoryCheckZipCode","databaseRow","mattressVariantReqId","buyAll3Array","buyAllVariantRecIds","Number","getVariantIds","renderView","onSelect","onSelectPillow","onSelectProtector","onUnselect","renderBaseImage","gridSettings","altText","fallbackImageUrl","defaultImageSettings","viewports","xs","q","w","h","lg","xl","lazyload","img","src","Image","Object","assign","fallBackSrc","imageSettings","bypassHideOnFailure","imageFallbackOptimize","hasDiscount","renderBadge","text","Node","renderCard","_item$inventoryStatus2","_item$inventoryStatus3","_item$inventoryStatus4","htmlCheckboxId","resources","outOfStockText","checked","onChange","_item$inventoryStatus","target","onchange","disabled","htmlFor","SelectableCard","getFallbackImageUrl","eyebrowText","ratings","showBVRatings","renderRating","typeName","ratingAriaLabel","standardPrice","isActive","currentPrice","renderProtectorCard","_protector$inventoryS2","_protector$inventoryS3","_protector$inventoryS4","_protector$inventoryS","Price","standard","titleHeadingTag","shippingInformation","computeItemLines","defaultVariantId","lowestPriceVariantRecordId","IsMasterProduct","_attributeValues$find","_extensionProperties$","extensionProperties","productDeliveryMessage","shippingInformationSmall","_attr$Name","smallParcelAttributeKey","defaultVariantShippingInformation","property","Key","Value","StringValue","_product$deliveryByMe","_attributeValues$find2","deliveryDays","_attr$Name2","leadTime","brandList","_attributeValues$find3","_attr$Name3","brandBackofficeAttributePlp","singleBrand","brandName","brandLeadtime","CustomSkeleton","splitPrice","price","dollars","cents","formattedPrice","toLocaleString","currency","priceArr","standardDollars","standardCents","currentDollars","currentCents","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}