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qBAAsBR,EAAkB,CAAES,QAAS3K,IAC9D,MAAM4K,EAAST,EAAOjE,IAAI,qBAC1BiE,EAAOO,IAAI,oBAAqBE,EAAQ,CAAED,QAAS3K,IACnDmK,EAAOO,IAAI,wBAAyB1K,IAE1C,MAAOvB,GACLhB,QAAQC,IAAI,QAASe,IAG7B,OAAOyL,GAGEW,EAAoB,KAC7B,MAAMV,EAAS,IAAIlE,EAAAA,EACbjG,EAAO,IAAIC,KACjBD,EAAKU,QAAQV,EAAKW,UAAY,GAC9BwJ,EAAOO,IAAI,qBAAsB,GAAI,CAAEC,QAAS3K,KAIvC8K,EAA0B,CAACC,EAAc7M,EAA8C8M,KAChG,MAAMb,EAAS,IAAIlE,EAAAA,EACbjG,EAAO,IAAIC,KACPmK,EAAyBlM,EAAQW,KAAOX,EAAQW,IAAIwL,UAAYnM,EAAQW,IAAIwL,SAASD,uBAA0B,EACrH,IACI,GAAIY,EAAgB,CAChB,MAAMV,EAAkC/J,SAAS6J,EAAuB,IACxEpK,EAAKU,QAAQV,EAAKW,UAAY2J,GAC9BH,EAAOO,IAAP,UAAcK,GAAQC,EAAgB,CAAEL,QAAS3K,KAEvD,MAAOvB,GACLhB,QAAQC,IAAI,QAASe,GAE7B,OAAOqM","sources":["webpack://mattressfirm/./src/Utilities/analytics/utagCaller.ts?3814","webpack://mattressfirm/./src/Utilities/emtpyChecker.ts?e2f5","webpack://mattressfirm/./src/Utilities/get-delivery-by-message.tsx?05db","webpack://mattressfirm/./src/Utilities/product-search-result-utils.tsx?58f2","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/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}\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) { 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};","// tslint:disable\r\nexport const hasArray = (values: any): any[] | undefined => {\r\n return (typeof values !== 'string') && values && values.length ? values : undefined;\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","// 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 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\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 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\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 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: 'Delivery',\r\n Weeks: props.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 = props.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 || props.context.app.config.responseMessageForItemOutOfMarketOOZ === resultmMSg?.slice(0, 31)) {\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 : props.context.app.config.defaultDeliveryMessage ? props.context.app.config.defaultDeliveryMessage : '';\r\n if (msg === undefined || msg === '') {\r\n msg = props.context.app.config.defaultDeliveryMessage;\r\n }\r\n return `${itemId ? itemId : ''},${recordId.toString()},${msg} ,${outOfMarket},${deliveryDetails?.locationId}`;\r\n\r\n};\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: 'Delivery',\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 === resultmMSg?.slice(0, 31)) {\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","hasArray","values","length","undefined","request","context","isCached","getDeliveryMessageActionInput","GetDeliveryMessageInput","result","getDeliveryMessageAction","actionContext","error","_getEyebrowMessage","products","priceGroupForAPICall","app","config","priceGroup","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","MFIPromotionExtensionClass","constructor","odataObject","this","EyeBrows","i","className","substr","lastIndexOf","concat","EntityClasses","ExtensionProperties","createMFIGetAvailablePromotionsDescriptionInput","queryResultSettings","availablePromotionsDescription","itemId","DataServiceQuery","DataServiceEntities","availablePromotionsDescriptionsQuery","resultSettings","createDataServiceRequestForOperation","bypassCache","returnEntity","pageType","getCacheKey","createCacheKey","getCacheObjectType","dataCacheType","obj","join","toString","Msdyn365","action","input","ctx","callActionOrExecute","callerContext","mFIGetAvailablePromotionsDescriptionAsync","Paging","Top","id","isOneOfChildBonusCoupons","discountCode","appliedCoupon","MsDyn365","getLocalstorageBonusCoupons","localStorage","getItem","bonusCouponsArray","JSON","parse","bonusCoupons","BonusCoupons","coupons","BonusCoupon","ChildCoupons","childCoupons","_coreProductATPCall","props","recordId","quantity","zipcode","Cookies","get","itemLinesArray","itemLines","Quantity","VariantRecordId","currentDate","InventoryType","Weeks","weeksPDPforATPCall","StoreId","Page","RequestedDate","ZipCode","ItemLines","outOfMarket","outOfMarketMsg","responseMessageForItemOutOfMarketZip","msgOutOfMarket","slice","_getDeliveryByMessage","resultmMSg","Message","responseMessageForItemOutOfMarketOOZ","ATPInventoryData","msg","defaultDeliveryMessage","_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","sbi","children","childd","parentId","prodIndex","QualifyingProductId","getSetBasketCookie","method","basketCookieData","cookie","cartSessionExpiration","platform","cartSessionExpirationDateInDays","cartDataInfo","cln","productId","set","expires","cartId","resetBasketCookie","setTealiumCartVariables","name","productDetails"],"sourceRoot":""}