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,EAAKW,UAAY8K,GAC9BH,EAAOO,IAAI,GAAGK,IAAQC,EAAgB,CAAEL,QAAS9L,KAEvD,MAAOzB,GACLZ,QAAQC,IAAI,QAASW,GAE7B,OAAO0N","sources":["webpack://mattressfirm/./src/Utilities/analytics/utagCaller.ts?3814","webpack://mattressfirm/./src/Utilities/get-delivery-by-message.tsx?05db","webpack://mattressfirm/./src/Utilities/product-search-result-utils.tsx?58f2","webpack://mattressfirm/./src/actions/get-delivery-message.action.ts?965e","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/common/automation/data-testids.ts?225a","webpack://mattressfirm/./src/modules/mfrm-cart/utils/cart-utils.ts?3c24"],"sourcesContent":["import { IAnalyticsConfiguration } from './clickTrack';\r\n\r\n// Interface for 3rd-party function. AKA utag.\r\ninterface ITealium {\r\n link(data: {}): void | false;\r\n view(data: {}): void | false;\r\n data(data: {}): void | false;\r\n}\r\n\r\nexport interface IPromotionConfig {\r\n event?: string | null;\r\n event_name?: string | null;\r\n search_term?: string | null;\r\n search_type?: string | null;\r\n event_category?: string | null;\r\n event_action?: string | null;\r\n event_label?: string | null;\r\n event_type?: string | null;\r\n event_noninteraction?: string;\r\n enhanced_action?: string | null;\r\n customer_email?: string | undefined;\r\n customer_phone_number?: string | undefined;\r\n first_name?: string | undefined;\r\n last_name?: string | undefined;\r\n address1?: string | undefined;\r\n address2?: string | undefined;\r\n city?: string | undefined;\r\n state?: string | undefined;\r\n zip_code?: string | undefined;\r\n order_subtotal?: string | undefined;\r\n order_currency?: string | undefined;\r\n country?: string | undefined;\r\n // productConfig?: IProductDataConfig;\r\n checkout_step?: string;\r\n checkout_option?:(string | undefined)[];\r\n checkout_type?:(string | undefined)[];\r\n product_id?: (string | undefined)[];\r\n product_name?: (string | undefined)[];\r\n product_category?: (string | undefined)[];\r\n product_brand?: (string | undefined)[];\r\n product_variant?: (string | undefined | number)[];\r\n product_price?: (string | undefined)[];\r\n product_quantity?: (string | undefined)[];\r\n product_url?: (string | undefined)[];\r\n product_size?: (string | undefined)[];\r\n product_image_url?: (string | undefined)[];\r\n core_item_flag?: string | null;\r\n funnel_type?: string | null;\r\n ga_title?: string | null;\r\n ga_location?: string | null;\r\n order_quantity?: string | null;\r\n}\r\n\r\ninterface IProductDataConfig {\r\n product_variant?: (string | undefined)[];\r\n product_price?: (string | undefined)[];\r\n}\r\n\r\nexport interface IAnalyticsConfigurationData {\r\n productConfig?: IProductDataConfig;\r\n}\r\n\r\n\r\n// Legacy function\r\nexport const callUtag = async (objToCall: IPromotionConfig) => {\r\n void await callUtagLink(objToCall);\r\n};\r\n\r\n/**\r\n * Tealium dispatch click tracking.\r\n * @param objToCall\r\n */\r\nexport const callUtagLink = async (objToCall: IPromotionConfig | IAnalyticsConfiguration) => {\r\n try {\r\n Object.keys(objToCall).forEach(\r\n key => {\r\n if (objToCall[key] === null) {\r\n delete objToCall[key];\r\n }\r\n }\r\n );\r\n // If utag doesn't exist in the global scope, set as false.\r\n const utag: ITealium = global.hasOwnProperty('utag') ? global[\"utag\"] : false;\r\n if(utag) { utag.link(objToCall); }\r\n\r\n } catch (e) {\r\n console.log('Utag Error', e);\r\n }\r\n};\r\n\r\n/**\r\n * Tealium dispatch view tracking.\r\n * @param objToCall\r\n */\r\nexport const callUtagView = async (objToCall: {}) => {\r\n try {\r\n // If utag doesn't exist in the global scope, set as false.\r\n const utag: ITealium = global.hasOwnProperty('utag') ? global[\"utag\"] : false;\r\n if(utag) { utag.view(objToCall); }\r\n } catch (e) {\r\n console.log('utag View Error', e);\r\n }\r\n};\r\n\r\n/**\r\n * Not currently implemented.\r\n * @param objToCall\r\n * @param dataType\r\n */\r\nexport const callUtagData = ({ productConfig = {} }: IAnalyticsConfigurationData , dataType: string) => {\r\n try {\r\n // If utag doesn't exist in the global scope, set as false.\r\n const utag: ITealium = global.hasOwnProperty('utag') ? global[\"utag\"] : false;\r\n switch (dataType) {\r\n case 'data':\r\n // @ts-ignore\r\n if('utag' in window) { utag.data = {...utag.data, ...productConfig}; }\r\n break;\r\n case '_data':\r\n // @ts-ignore\r\n utag_data = {...utag_data , ...productConfig};\r\n break;\r\n default:\r\n null;\r\n }\r\n } catch (e) {\r\n console.log('Utag Error', e);\r\n }\r\n};","import { IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\r\nimport { IMFICLDeliveryScheduleParameters } from '../actions/CoreProductDataServiceEntities.g';\r\nimport getDeliveryMessageAction, { GetDeliveryMessageInput } from '../actions/get-delivery-message.action';\r\n\r\nconst _getDeliveryByMessage = async (request: IMFICLDeliveryScheduleParameters, context: ICoreContext>, isCached?: boolean) => {\r\n if (request) {\r\n const getDeliveryMessageActionInput = new GetDeliveryMessageInput(request, isCached);\r\n try {\r\n let result;\r\n // eslint-disable-next-line prefer-const\r\n result = await getDeliveryMessageAction(getDeliveryMessageActionInput, 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 default _getDeliveryByMessage;\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. 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\nimport { mFIATPInventoryAsync } from './CoreProductDataActionExtension.g';\r\nimport { IMFIATPInventoryResponse, IMFICLDeliveryScheduleParameters } from './CoreProductDataServiceEntities.g';\r\n\r\n/**\r\n * GetDeliveryMessage Input Action\r\n */\r\n\r\nexport class GetDeliveryMessageInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n public input: IMFICLDeliveryScheduleParameters;\r\n public isCached?: boolean;\r\n constructor(input: IMFICLDeliveryScheduleParameters, isCached: boolean = true) {\r\n this.input = input;\r\n this.isCached = isCached;\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 `Get-Delivery-Message${this.input.ZipCode}-${this.input.ItemLines![0].ItemId}-${this.input.ItemLines![0].VariantRecordId}`;\r\n // public getCacheKey = () => 'do';\r\n public getCacheObjectType = () => 'GetDeliveryMessageResult';\r\n public dataCacheType = (): Msdyn365.CacheType => (this.isCached ? 'request' : 'none');\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// const createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n// return new GetDeliveryMessageInput();\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 getDeliveryMessageAction(\r\n request: GetDeliveryMessageInput,\r\n ctx: Msdyn365.IActionContext\r\n): Promise {\r\n if (request.input) {\r\n try {\r\n const result = await mFIATPInventoryAsync({ callerContext: ctx }, request.input);\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 default Msdyn365.createObservableDataAction({\r\n action: >getDeliveryMessageAction,\r\n // Give your data action a unique id\r\n id: 'GetDeliveryMessage'\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","export enum CustomerInfoDataTestIds {\r\n customerInfoHeading = 'customerinfoCustomerInfoHeading',\r\n deliveryPageHeading = 'deliveryDeliveryHeading',\r\n paymentPageHeading = 'paymentPageTitle',\r\n FirstName = 'customerinfoShippingAddressFirstName',\r\n LastName = 'customerinfoShippingAddressLastName',\r\n Email = 'customerinfoShippingAddressEmail',\r\n Phone = 'customerinfoShippingAddressPhone',\r\n EmailMeNewsCheckBox = 'customerinfoEmailM',\r\n BillingAddressSameCheckBox = 'paymentCheckoutBillingAddressCheckBox',\r\n Address = 'customerinfoShippingAddressAddress',\r\n Apt = 'customerinfoShippingAddressApt',\r\n ZipCode = 'customerinfoShippingAddressZipCode',\r\n City = 'customerinfoShippingAddressCity',\r\n State = 'customerinfoShippingAddressState',\r\n ExpressCustomerInfo = 'customerinfoHeading'\r\n}\r\n\r\nexport enum CheckoutStepperDataTestIds {\r\n customerInfoStepper = 'customerinfoStepperModuleWrapper',\r\n deliveryInfoStepper = 'deliveryStepperModuleWrapper',\r\n paymentInfoStepper = 'paymentstepperModuleWrapper'\r\n}\r\n\r\nexport const SynchronyFinnacinTestIds = [\r\n { learnhow: 'paymentSynchrony6monthLearnHowLink', radio: 'paymentSynchrony6monthRadioSelect' },\r\n { learnhow: 'paymentSynchrony12monthLearnHowLink', radio: 'paymentSynchrony12monthRadioSelect' },\r\n { learnhow: 'paymentSynchrony24monthLearnHowLink', radio: 'paymentSynchrony24monthRadioSelect' }\r\n];\r\n\r\nexport enum PaymentSteppDataTestIds {\r\n CreditCardRadioSelect = \"paymentCreditCardRadioSelectButton\",\r\n Creditcardicons = \"paymentCreditCardIconsImage\",\r\n CheckoutBillingaddressCheckBox = \"paymentCheckoutBillingAddressCheckBox\",\r\n PayPalRadioSelect = \"paymentPayPalRadioSelectButton\",\r\n PayPalInstrumentalInfo = \"paymentPayPalInfo\",\r\n SynchronyRadioSelect = \"paymentSynchronyRadioSelectButton\",\r\n SynchronyImage = \"paymentSynchronyIconImage\",\r\n SynchronyPrequalify = \"paymentSynchronyPrequalifyButton\",\r\n Synchronyuseexistingaccount = \"paymentSynchronyUseExistingAccountButton\",\r\n Checkoutguidedcardcontent = \"paymentCheckoutGuidedCardContent\",\r\n Checkouteditcustomerinfo = \"paymentCheckoutEditCustomerInfoLink\",\r\n Deliverysummarycontent = \"paymentDeliverySummaryContent\",\r\n Deliverycontentedit = \"paymentDeliveryContentIdLink\",\r\n Submitorder = \"paymentSubmitOrderButton\"\r\n}\r\n\r\nexport enum CheckoutButtonDataTestIds {\r\n SubmitOrderId = 'paymentSubmitOrderButton',\r\n ContinueToDeliveryId = 'customerinfoContinueDeliveryButton',\r\n ContinueToPaymentId = 'deliveryContinueToPaymentButton'\r\n}\r\n\r\nexport enum DeliveryDataTestIds {\r\n DeliveryOptionSchedule = \"deliveryDeliveryOptionScheduleTitle\",\r\n DeliveryOptionsLinkWrapper = \"deliveryDeliveryOptionLinkWrapper\",\r\n DeliveryOptionScheduleDateButton = \"deliveryDeliveryOptionScheduleDateButton\",\r\n DeliveryTimeSelect = \"deliveryDeliveryTimeSelectOption\",\r\n DeliveryOptionHeading = \"deliveryDeliveryOptionTitle\",\r\n DeliveryOptionServiceWrapper = \"deliveryDeliveryOptionServiceWrapper\"\r\n}\r\n\r\nexport enum OrderSummaryCheckoutDataTestIds {\r\n OrderSummaryHeading = \"OrderSummaryHeading\",\r\n ItemsSubtotallabel = \"OrderSummaryLineSubTotalLabel\",\r\n ItemsSubtotal = \"OrderSummaryLineSubTotal\",\r\n SavingsLabel = \"OrderSummarySavingsLabel\",\r\n Savings = \"OrderSummarySavings\",\r\n TaxLabel = \"OrderSummaryTaxLabel\",\r\n Tax = \"OrderSummaryTax\",\r\n TotalLabel = \"OrderSummaryLineTotaLabel\",\r\n Total = \"OrderSummaryLineTotal\"\r\n}\r\n\r\nexport enum CartDataTestIds {\r\n PencilBanner = \"promoBanner\",\r\n StepperModuleWrapper = \"cartpageStepperModuleWrapper\",\r\n ShoppingCartHeading = \"cartpageShoppingCartHeading\",\r\n ZipCodeLink = \"cartpageDeliveryMessageLink\",\r\n QtyDropDown = \"cartpageQtySelectMenu\",\r\n DeleteItemLink = \"cartpageRemoveItemButton\",\r\n AddPromoCode = \"cartpageAddPromoCodeLink\",\r\n CheckoutButton = \"cartpageCheckoutButton\",\r\n PayPalButton = \"cartpagePaypalLogoButton\",\r\n CreditCardLearnHowLink = \"cartpageMattressfirmCreditCardLearnHowLink\",\r\n LookForLeaseLearnHowLink = \"cartpageLookForLeasetoOptionLearnHowLink\",\r\n SleepExpertLinks = \"cartpageTalkToSleepExpert{buttonType}Link\",\r\n}\r\n\r\nexport enum PaypalExpressDataTestIds {\r\n PaypalCustomerInfoHeading = 'PayPalExpresscustomerInfoHeading',\r\n PaypalStepperModule = 'PayPalExpressStepperModuleWrapper',\r\n PaypalFirstName = 'PayPalExpressshippingAddressfirstname',\r\n PaypalLastName = 'PayPalExpressshippingAddresslastname',\r\n PaypalEmail = 'PayPalExpressshippingAddressEmail',\r\n PaypalPhone = 'PayPalExpressshippingAddressPhone',\r\n PaypalAddress = 'PayPalExpressshippingAddressAddress',\r\n PaypalApt = 'customerinfoShippingAddressApt',\r\n PaypalZipCode = 'PayPalExpressshippingAddressZipcode',\r\n PaypalCity = 'PayPalExpressshippingAddressCity',\r\n SaveandContinueBtn = 'PayPalExpressSaveandContinueButton',\r\n ExpressDeliveryHeading = 'PayPalExpressdeliveryHeading',\r\n ExpressDeliveryContent = 'PayPalExpressdeliveryContent',\r\n ExpressDeliveryEditLink = 'PayPalExpressdeliveryEditLink',\r\n ExpressPaymentHeading = 'PayPalExpresspaymentMethodHeading',\r\n ExpressReviewEmail = 'PayPalExpressreviewEmail',\r\n ExpressPaymentEdit = 'PayPalExpresspaymentEditEditLink',\r\n ExpressOrderSummaryHeading = 'PayPalExpressorderSummaryHeading',\r\n ExpressItemsSubtotal = 'PayPalExpressorderSummarylineSubtotal',\r\n ExpressSavings = 'PayPalExpressorderSummarySavings',\r\n ExpressTax = 'PayPalExpressorderSummaryTax',\r\n ExpressTotal = 'PayPalExpressorderSummarylineTotal',\r\n ExpressorderReviewHeading = 'PayPalExpressorderReviewHeading',\r\n ExpressorderReviewContainer = 'PayPalExpressorderReviewPaypalExpressContainer',\r\n ExpresssubmitOrderBtn = 'PayPalExpresssubmitOrderButton'\r\n}\r\n\r\n//data testid's that will be used on OC page\r\nexport enum OrderConfirmationDataTestIds {\r\n ThanksTitle = \"confirmationThankYouTitle\",\r\n OrderNumber = \"confirmationOrderNumber\",\r\n OrderPlacedLabel = \"confirmationOrderPlacedLabel\",\r\n OrderPlacedDetails = \"confirmationOrderPlacedDetails\",\r\n OrderNumberDetails = \"confirmationOrderNumberDetails\",\r\n CustomerInfo = \"confirmationCustomerInfoSection\",\r\n DeliverySection = \"confirmationDeliverySection\",\r\n OrderSummary = \"confirmationOrderSummary\",\r\n OrderSummaryDeliveryLabel = \"confirmationSummaryDeliveryLabel\",\r\n OrderSummaryShippingLabel = \"confirmationSummaryShipLabel\",\r\n OrderSummaryShippingAmount = \"confirmationSummaryShipAmount\",\r\n DeliveryLabel = \"confirmationDeliveryLabel\",\r\n DeliveryProductName = \"confirmationProductName\",\r\n ProductDiscount = \"confirmationDiscountPrice\",\r\n ProductQuantity = \"confirmationQty\",\r\n DeliveryDate = \"confirmationDeliveryDate\",\r\n ProductSize = \"confirmationSize\",\r\n DiscountPercent = \"confirmationDiscountPercent\",\r\n OriginalPriceStrikeThrough = \"confirmationStrikethrough\",\r\n DeliveryProductPrice = \"confirmationNormalPrice\",\r\n TaxLabel = \"confirmationTaxLabel\",\r\n SavingsLabel = \"confirmationItemsSavingsLabel\",\r\n ItemsLabel = \"confirmationItemsLabel\",\r\n TotalLabel = \"confirmationTotalLabel\",\r\n TaxAmount = \"confirmationTaxAmount\",\r\n SavingsAmount = \"confirmationItemsSavingsAmount\",\r\n ItemsTotal = \"confirmationItemsTotal\",\r\n OrderSummaryDeliveryFee = \"confirmationDeliveryFee\",\r\n TotalAmount = \"confirmationTotalAmount\",\r\n PaymentLabel = \"confirmationPaymentLabel\",\r\n PaymentInfo = \"confirmationPaymentDetail\",\r\n DeliveryAddress = \"confirmationDeliveryAddress\",\r\n Email = \"confirmationEmail\",\r\n Phone = \"confirmationPhone\",\r\n BillingMessage = \"confirmationBillingMessage\",\r\n ContactMessage = \"confirmationContactMessage\",\r\n ReceiptEmail = \"confirmationSentEmailToMessage\",\r\n DeliveryTypeLabel = \"confirmationDeliveryTypeLabel\",\r\n ShippingProductName = \"confirmationShippingLineItem\",\r\n ShippingSection = \"confirmationShippingSection\",\r\n ShippingSectionTitle = \"confirmationShippingTitle\",\r\n ShippingNumber = \"confirmationShipmentNumber\",\r\n ShippingSectionSize = \"confirmationSectionSize\",\r\n ShippingSectionQuantity = \"confirmationSectionQTY\",\r\n ShippingSectionPrice = \"confirmationShipLineItemPrice\"\r\n}","import MsDyn365, { IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\r\nimport { CartLine } from '@msdyn365-commerce/retail-proxy';\r\nimport dayjs from 'dayjs';\r\nimport Cookies from 'universal-cookie';\r\nimport { IMFIGetBonusCouponsDetailsResponse } from '../../../actions/BonusItemDataServiceEntities.g';\r\nimport { IMFICartLine, IMFICLDeliveryScheduleParameters } from '../../../actions/CoreProductDataServiceEntities.g';\r\nimport { hasArray } from '../../../Utilities/emtpyChecker';\r\nimport _getDeliveryByMessage from '../../../Utilities/get-delivery-by-message';\r\nimport { _getSoonestDeliveryDate } from '../../../Utilities/product-search-result-utils';\r\nimport { IProductBonusItems } from '../mfrm-cart';\r\nimport { IMfrmCartData } from '../mfrm-cart.data';\r\nimport { IMfrmCartProps } from '../mfrm-cart.props.autogenerated';\r\nimport { DeliveryModes } from '../../../Utilities/enum';\r\n\r\nexport interface IBasketCookieCartInfo {\r\n productId: number;\r\n itemId: string;\r\n quantity: number;\r\n}\r\nexport interface IBasketCookie {\r\n firstName?: string;\r\n lastName?: string;\r\n email?: string;\r\n phoneNumber?: string;\r\n address1?: string;\r\n address2?: string;\r\n cartId?: string;\r\n selectedDeliveryService?: number;\r\n EmailMeCheckbox?: boolean;\r\n cartDataInfo?: IBasketCookieCartInfo[];\r\n}\r\n\r\nexport interface IProductDetails {\r\n typeOfProduct?: string;\r\n productQuantity?: string[];\r\n quantity?: string;\r\n subTotal?: string;\r\n}\r\n\r\nexport interface ICartProductUrl {\r\n productImageUrl?: string[];\r\n productURL?: string[];\r\n cartUrl?: string;\r\n}\r\n\r\nexport interface IProductDetailsData {\r\n quantity?: number | undefined;\r\n subTotal?: number | undefined;\r\n productQuantity?: string[];\r\n productSize?: string[];\r\n productIDsArray?: string[];\r\n productNameArray?: string[];\r\n productPriceArray?: string[];\r\n variantRecord?: (string | undefined)[]\r\n productCatgoryArray?: (string | undefined)[]\r\n productBrandName?: (string | undefined)[]\r\n productDiscountArray?: (string | undefined)[]\r\n cartProductPriceArray?: string[];\r\n\r\n\r\n}\r\n\r\nexport const isOneOfChildBonusCoupons = (discountCode: string, appliedCoupon: string) => {\r\n if (MsDyn365.isBrowser) {\r\n const getLocalstorageBonusCoupons = localStorage.getItem('bonusCouponsDetail');\r\n if (getLocalstorageBonusCoupons) {\r\n const bonusCouponsArray: IMFIGetBonusCouponsDetailsResponse[] = getLocalstorageBonusCoupons && JSON.parse(getLocalstorageBonusCoupons);\r\n // props.data.cartLine.DiscountLines && props.data.cartLine.DiscountLines.map((userDefinePromo) => {\r\n for (const bonusCoupons of bonusCouponsArray) {\r\n // bonusCouponsArray.map((bonusCoupons) => {\r\n if (bonusCoupons.BonusCoupons) {\r\n for (const coupons of bonusCoupons.BonusCoupons) {\r\n // bonusCoupons.BonusCoupons?.map((coupons) => {\r\n if ((coupons.BonusCoupon === appliedCoupon) && coupons.ChildCoupons) {\r\n for (const childCoupons of coupons.ChildCoupons) {\r\n // coupons.ChildCoupons?.map((childCoupons) => {\r\n if (childCoupons === discountCode) {\r\n return true;\r\n }\r\n // });\r\n }\r\n }\r\n // });\r\n }\r\n }\r\n // });\r\n }\r\n // });\r\n }\r\n }\r\n return false;\r\n};\r\n// VSI Customization - START\r\nconst getItemLines = (itemId: string | undefined, quantity: number, recordId: number) => {\r\n const itemLines: IMFICartLine = {\r\n ItemId: itemId,\r\n Quantity: quantity,\r\n VariantRecordId: recordId.toString()\r\n };\r\n return itemLines;\r\n};\r\n\r\nconst _callAtpCallProductAndOOM = async (itemId: string | undefined, quantity: number, recordId: number, zipcode: any, context: ICoreContext>) => {\r\n const itemLinesArray = [];\r\n const itemLines = getItemLines(itemId, quantity, recordId);\r\n itemLinesArray.push(itemLines);\r\n const date = new Date();\r\n const currentDate = date.setDate(date.getDate());\r\n const requestBody: IMFICLDeliveryScheduleParameters = {\r\n InventoryType: DeliveryModes.core,\r\n Weeks: context.app.config.weeksPDPforATPCall,\r\n StoreId: '',\r\n Page: 'pdp',\r\n RequestedDate: dayjs(currentDate).format('MM/DD/YYYY'),\r\n ZipCode: zipcode,\r\n ItemLines: itemLinesArray\r\n };\r\n let outOfMarket = '';\r\n const outOfMarketMsg = context.app.config.responseMessageForItemOutOfMarketZip;\r\n const msgOutOfMarket = outOfMarketMsg?.slice(0, 38);\r\n const result = await _getDeliveryByMessage(requestBody, context, false);\r\n const resultmMSg = result?.Message?.slice(12, 50);\r\n if (msgOutOfMarket === resultmMSg || context.app.config.responseMessageForItemOutOfMarketOOZ.slice(0, 31).trim().toLowerCase() === resultmMSg?.slice(0, 31).trim().toLowerCase()) {\r\n outOfMarket = 'yes';\r\n }\r\n const deliveryDetails = (result?.ATPInventoryData && result?.ATPInventoryData.length > 0) ? _getSoonestDeliveryDate(result?.ATPInventoryData) : undefined;\r\n let msg = deliveryDetails ? deliveryDetails.deliveryByMessage : context.app.config.defaultDeliveryMessage ? context.app.config.defaultDeliveryMessage : '';\r\n if (msg === undefined || msg === '') {\r\n msg = context.app.config.defaultDeliveryMessage;\r\n }\r\n return `${itemId ? itemId : ''},${recordId.toString()},${msg} ,${outOfMarket},${deliveryDetails?.locationId}`;\r\n};\r\n\r\nexport const _coreProductATPCall = async (props: IMfrmCartProps, recordId: number, itemId: string | undefined, quantity: number): Promise => {\r\n const { context } = props;\r\n const cookies = new Cookies();\r\n const zipcode = cookies.get('zip_code');\r\n return _callAtpCallProductAndOOM(itemId, quantity, recordId, zipcode, context);\r\n};\r\n// VSI Customization - End\r\n\r\n/** Skipping customization for _coreProductATPCallCheckForOOM function as it has a broader scope beyond the cart feature. Instead, I made other changes to ensure the code can be easily converted in the future, in adherence to the Open/Closed Principle.*/\r\n\r\nexport const _coreProductATPCallCheckForOOM = async (context: ICoreContext>, recordId: number, itemId: string | undefined, quantity: number, updatedZipCode: string): Promise => {\r\n const cookies = new Cookies();\r\n const zipcode = (updatedZipCode && updatedZipCode.length > 0 && updatedZipCode !== '00000') ? updatedZipCode : cookies.get('zip_code');\r\n const itemLinesArray = [];\r\n\r\n const itemLines: IMFICartLine = {\r\n ItemId: itemId,\r\n Quantity: quantity,\r\n VariantRecordId: recordId.toString()\r\n };\r\n\r\n itemLinesArray.push(itemLines);\r\n const date = new Date();\r\n const currentDate = date.setDate(date.getDate());\r\n const requestBody: IMFICLDeliveryScheduleParameters = {\r\n InventoryType: DeliveryModes.core,\r\n Weeks: context.app.config.weeksPDPforATPCall,\r\n StoreId: '',\r\n Page: 'pdp',\r\n RequestedDate: dayjs(currentDate).format('MM/DD/YYYY'),\r\n ZipCode: zipcode,\r\n ItemLines: itemLinesArray\r\n };\r\n let outOfMarket = '';\r\n const outOfMarketMsg = context.app.config.responseMessageForItemOutOfMarketZip;\r\n const msgOutOfMarket = outOfMarketMsg?.slice(0, 38);\r\n const result = await _getDeliveryByMessage(requestBody, context, false);\r\n const resultmMSg = result?.Message?.slice(12, 50);\r\n if (msgOutOfMarket === resultmMSg || context.app.config.responseMessageForItemOutOfMarketOOZ?.slice(0, 31).toLowerCase() === resultmMSg?.slice(0, 31).toLowerCase()) {\r\n outOfMarket = 'yes';\r\n }\r\n\r\n const deliveryDetails = (result?.ATPInventoryData && result?.ATPInventoryData.length > 0) ? _getSoonestDeliveryDate(result?.ATPInventoryData) : undefined;\r\n\r\n let msg = deliveryDetails ? deliveryDetails.deliveryByMessage : context.app.config.defaultDeliveryMessage ? context.app.config.defaultDeliveryMessage : '';\r\n if (msg === undefined || msg === '') {\r\n msg = context.app.config.defaultDeliveryMessage;\r\n }\r\n return `${itemId ? itemId : ''},${recordId.toString()},${msg} ,${outOfMarket},${deliveryDetails?.locationId}`;\r\n\r\n};\r\n\r\nconst findIndexOfItemInArray = (cartLines: CartLine[], prodId: string) => {\r\n if (cartLines && cartLines.length) {\r\n for (let c = 0; c < cartLines.length; c++) {\r\n if (cartLines[c].ProductId?.toString() === prodId) {\r\n return c;\r\n }\r\n }\r\n }\r\n return -1;\r\n};\r\nconst arraymove = (arr: CartLine[], fromIndex: number, toIndex: number) => {\r\n const element = arr[fromIndex];\r\n arr.splice(fromIndex, 1);\r\n arr.splice(toIndex, 0, element);\r\n return arr;\r\n};\r\nexport const reshuffleItems = (cartLines: CartLine[]) => {\r\n const cls: CartLine[] = cartLines;\r\n if (MsDyn365.isBrowser) {\r\n const bonusItemsInfoStr = localStorage.getItem('BonusItemProduct');\r\n if (bonusItemsInfoStr && bonusItemsInfoStr.length) {\r\n const bonusItems = JSON.parse(bonusItemsInfoStr);\r\n if (bonusItems && bonusItems.length) {\r\n const testVarStruct = bonusItems;\r\n for (const obj of testVarStruct) {\r\n const deets = obj.BonusItemsDetails;\r\n for (const dt of deets) {\r\n // const coupon = dt.Coupon;\r\n const itms = dt.Items;\r\n for (const it of itms) {\r\n const items = it.BonusItems;\r\n // const qItemId = it.QualifyingItemId;\r\n // const qpId = it.QualifyingProductId;\r\n for (const itm of items) {\r\n // itm.QualifyingItemId = qItemId;\r\n // itm.Coupon = coupon;\r\n // itm.QualifyingProductId = qpId;\r\n for (let c = 0; c < cls.length; c++) {\r\n if (cls[c].ProductId?.toString() === itm.BonusProductId) {\r\n const getLocalStorage = localStorage.getItem('selectedBonasItems');\r\n let selectedBonusItemArray: IProductBonusItems[] = [];\r\n if (getLocalStorage) {\r\n selectedBonusItemArray = JSON.parse(getLocalStorage);\r\n }\r\n let isSelectedManually = false;\r\n if (hasArray(selectedBonusItemArray)) {\r\n for (const sbi of selectedBonusItemArray) {\r\n if (hasArray(sbi.children)) {\r\n for (const childd of sbi.children) {\r\n if ((childd.BonusProductId?.toString() === itm.BonusProductId) && sbi.parentId) {\r\n const prodIndex = findIndexOfItemInArray(cls, sbi.parentId.toString());\r\n arraymove(cls, c, prodIndex + 1);\r\n isSelectedManually = true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if (!isSelectedManually) {\r\n const prodIndex = findIndexOfItemInArray(cls, itm.QualifyingProductId);\r\n arraymove(cls, c, prodIndex + 1);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return cls;\r\n};\r\n\r\nexport const getSetBasketCookie = (method: string, context: ICoreContext<{ [x: string]: any; }>, basketCookieData?: IBasketCookie, cartLines?: CartLine[]) => {\r\n const cookie = new Cookies();\r\n if (method === 'get') {\r\n return cookie.get('mfrm_basket_cookie');\r\n } else {\r\n const date = new Date();\r\n const cartSessionExpiration = (context.app && context.app.platform && context.app.platform.cartSessionExpiration) || 0;\r\n try {\r\n if (basketCookieData) {\r\n const cartSessionExpirationDateInDays = parseInt(cartSessionExpiration, 10);\r\n date.setDate(date.getDate() + cartSessionExpirationDateInDays);\r\n if (cartLines) {\r\n const cartDataInfo: IBasketCookieCartInfo[] = [];\r\n for (const cln of cartLines) {\r\n cartDataInfo.push({ productId: cln.ProductId ? cln.ProductId : -1, itemId: cln.ItemId ? cln.ItemId : '', quantity: cln.Quantity ? cln.Quantity : 0 });\r\n }\r\n basketCookieData.cartDataInfo = cartDataInfo;\r\n }\r\n cookie.set('mfrm_basket_cookie', basketCookieData, { expires: date });\r\n const cartId = cookie.get('_msdyn365___cart_');\r\n cookie.set('_msdyn365___cart_', cartId, { expires: date });\r\n cookie.set('last_cart_expiry_time', date);\r\n }\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n }\r\n return basketCookieData;\r\n};\r\n\r\nexport const resetBasketCookie = () => {\r\n const cookie = new Cookies();\r\n const date = new Date();\r\n date.setDate(date.getDate() - 1);\r\n cookie.set('mfrm_basket_cookie', {}, { expires: date });\r\n};\r\n\r\n\r\nexport const setTealiumCartVariables = (name: string, context: ICoreContext<{ [x: string]: any; }>, productDetails?: IProductDetails | IProductDetailsData | ICartProductUrl) => {\r\n const cookie = new Cookies();\r\n const date = new Date();\r\n const cartSessionExpiration = (context.app && context.app.platform && context.app.platform.cartSessionExpiration) || 0;\r\n try {\r\n if (productDetails) {\r\n const cartSessionExpirationDateInDays = parseInt(cartSessionExpiration, 10);\r\n date.setDate(date.getDate() + cartSessionExpirationDateInDays);\r\n cookie.set(`${name}`, productDetails, { expires: date });\r\n }\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n return setTealiumCartVariables;\r\n};"],"names":["callUtag","async","callUtagLink","objToCall","Object","keys","forEach","key","utag","global","hasOwnProperty","link","e","console","log","callUtagView","view","request","context","isCached","getDeliveryMessageActionInput","GetDeliveryMessageInput","result","getDeliveryMessageAction","actionContext","error","_getEyebrowMessage","products","priceGroupForAPICall","app","config","priceGroup","length","undefined","items","map","item","singleItem","ItemId","DistinctProductVariant","push","requestBody","PriceGroup","Items","getEyebrowMessageInput","GetEyebrowMessageInput","getEyebrowAction","_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","startTimeHour","substring","constructor","input","getCacheKey","this","ZipCode","ItemLines","VariantRecordId","getCacheObjectType","dataCacheType","Msdyn365","action","ctx","mFIATPInventoryAsync","callerContext","id","MFIPromotionExtensionClass","odataObject","EyeBrows","i","className","substr","lastIndexOf","concat","EntityClasses","ExtensionProperties","createMFIGetAvailablePromotionsDescriptionInput","queryResultSettings","availablePromotionsDescription","itemId","DataServiceQuery","DataServiceEntities","availablePromotionsDescriptionsQuery","resultSettings","createDataServiceRequestForOperation","bypassCache","returnEntity","pageType","createCacheKey","obj","join","toString","callActionOrExecute","mFIGetAvailablePromotionsDescriptionAsync","Paging","Top","CustomerInfoDataTestIds","CheckoutStepperDataTestIds","SynchronyFinnacinTestIds","learnhow","radio","PaymentSteppDataTestIds","CheckoutButtonDataTestIds","DeliveryDataTestIds","OrderSummaryCheckoutDataTestIds","CartDataTestIds","PaypalExpressDataTestIds","OrderConfirmationDataTestIds","isOneOfChildBonusCoupons","discountCode","appliedCoupon","MsDyn365","getLocalstorageBonusCoupons","localStorage","getItem","bonusCouponsArray","JSON","parse","bonusCoupons","BonusCoupons","coupons","BonusCoupon","ChildCoupons","childCoupons","_coreProductATPCall","props","recordId","quantity","zipcode","itemLinesArray","itemLines","Quantity","getItemLines","currentDate","InventoryType","DeliveryModes","Weeks","weeksPDPforATPCall","StoreId","Page","RequestedDate","outOfMarket","outOfMarketMsg","responseMessageForItemOutOfMarketZip","msgOutOfMarket","slice","_getDeliveryByMessage","resultmMSg","Message","responseMessageForItemOutOfMarketOOZ","trim","toLowerCase","ATPInventoryData","msg","defaultDeliveryMessage","_callAtpCallProductAndOOM","Cookies","get","_coreProductATPCallCheckForOOM","updatedZipCode","cookies","findIndexOfItemInArray","cartLines","prodId","c","ProductId","arraymove","arr","fromIndex","toIndex","element","splice","reshuffleItems","cls","bonusItemsInfoStr","bonusItems","testVarStruct","deets","BonusItemsDetails","dt","itms","it","BonusItems","itm","BonusProductId","getLocalStorage","selectedBonusItemArray","isSelectedManually","hasArray","sbi","children","childd","parentId","prodIndex","QualifyingProductId","getSetBasketCookie","method","basketCookieData","cookie","cartSessionExpiration","platform","cartSessionExpirationDateInDays","cartDataInfo","cln","productId","set","expires","cartId","resetBasketCookie","setTealiumCartVariables","name","productDetails"],"sourceRoot":""}