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kB,iBAAiB,SAAU1gD,IAC9BqgD,EAAOrgD,MAEH,QAAR,EAAAy/C,gBAAA,mBAAUM,YAAV,SAAgBC,YAAYR,OC3FjC,SAASmB,EAA8Bv+C,GAC1C,OAAO,IAAIw+C,EAAAA,aAAyC,UAAWx+C,EAAQ,+BDavEm8C,EAAAA,EAAAA,IAAAA,CADCvwC,EAAAA,IACD,+BA+CAuwC,EAAAA,EAAAA,IAAAA,CADCvwC,EAAAA,IACD,+BCzDJ,MAIa6yC,GAA6B7wC,EAAAA,EAAAA,IAA2B,CACjEhC,OAA6C8yC,EAAAA,iBAC7C7yC,MAN2CkB,GACpCwxC,EAA8B,IAAIjC,KAQ7C,WCxBAqC,EAAOC,QAAUj7C,cCAjBg7C,EAAOC,QAAUC","sources":["webpack://mattressfirm/./src/Utilities/analytics/utagCaller.ts?3814","webpack://mattressfirm/./src/Utilities/cart-utils.ts?6ba1","webpack://mattressfirm/./src/Utilities/doRetryCallBack.ts?72a9","webpack://mattressfirm/./src/Utilities/generateURLforPDP.ts?65a6","webpack://mattressfirm/./src/Utilities/get-block-message.tsx?29cd","webpack://mattressfirm/./src/Utilities/get-delivery-by-message.tsx?05db","webpack://mattressfirm/./src/Utilities/get-inventory-quantity.tsx?d0aa","webpack://mattressfirm/./src/Utilities/get-product-brand.tsx?2b65","webpack://mattressfirm/./src/Utilities/get-view-port.tsx?4210","webpack://mattressfirm/./src/Utilities/get-zipcode.ts?4f03","webpack://mattressfirm/./src/Utilities/one-year-from-now.ts?0f43","webpack://mattressfirm/./src/Utilities/order-summary-lineitem.tsx?2af7","webpack://mattressfirm/./src/Utilities/product-search-result-utils.tsx?58f2","webpack://mattressfirm/./src/actions/bonus-coupon-details.action.ts?7fb2","webpack://mattressfirm/./src/actions/bonus-item-product.action.ts?0b53","webpack://mattressfirm/./src/actions/get-mfrm-products-category-paths.action.ts?dc81","webpack://mattressfirm/./src/actions/get-recycle-fee-checkout.action.ts?9366","webpack://mattressfirm/./src/actions/get-sm-inventory-status.action.ts?cb72","webpack://mattressfirm/./src/actions/trigger-special-synchrony-financing.action.ts?1948","webpack://mattressfirm/./src/data-actions/bonuscoupons-action.action.ts?e535","webpack://mattressfirm/./src/data-actions/cart-state-sharing-action.ts?a139","webpack://mattressfirm/./src/data-actions/get-product-attributes-cartlines.ts?b10f","webpack://mattressfirm/./src/data-actions/mfrm-notification.action.ts?70c5","webpack://mattressfirm/./src/modules/mfrm-cart/components/mfrm-cart-line-groups.tsx?0b2e","webpack://mattressfirm/./src/modules/mfrm-cart/components/mfrm-cart-line-items-promotion.tsx?cdf4","webpack://mattressfirm/./src/modules/mfrm-cart/components/mfrm-cart-line-items.tsx?6160","webpack://mattressfirm/./src/modules/mfrm-cart/components/mfrm-cart-pick-up-in-store.tsx?c5f4","webpack://mattressfirm/./src/modules/mfrm-cart/mfrm-cart.tsx?cac9","webpack://mattressfirm/./src/modules/mfrm-cart/mfrm-cart.view.tsx?a38d","webpack://mattressfirm/./src/modules/mfrm-cart/utils/get-promotion-in-mfrm-cart.ts?da41","webpack://mattressfirm/./lib/mfrm-cart/module-registration.js?6d74","webpack://mattressfirm/./src/store-selector-state-manager/base-store-selector-state-manager.ts?281e","webpack://mattressfirm/./src/store-selector-state-manager/map-store-selector-state-manager.ts?2ae0","webpack://mattressfirm/./src/store-selector-state-manager/store-selector-state-manager-data-action.ts?bd3e","webpack://mattressfirm/external var \"React\"?0d3b","webpack://mattressfirm/external var \"ReactDOM\"?853b"],"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}\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};","import MsDyn365 from '@msdyn365-commerce/core';\r\nimport {IProductDetails,IProductBonusItems, IProductBonusWithBrandName } from '../modules/mfrm-cart/mfrm-cart';\r\nimport {IMFIBonusItemsResponse, IMFIGetBonusCouponsDetailsResponse} from '../actions/BonusItemDataServiceEntities.g';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\nexport interface IMFRMDateGroupedProducts {\r\n dateStr: string;\r\n days?: string;\r\n productVariantRecordIds: number[];\r\n productItemIds: string[];\r\n productsType: string;\r\n}\r\n\r\nconst getSetLocalStorage = (key: string, getSet: string, valueToSet?: any, returnType?: any) => {\r\n if (MsDyn365.isBrowser) {\r\n switch (getSet) {\r\n case 'set':\r\n return localStorage.setItem(key, JSON.stringify(valueToSet || returnType));\r\n case 'get':\r\n return JSON.parse(localStorage.getItem(key) || '[]');\r\n default:\r\n return returnType;\r\n }\r\n } else {\r\n return returnType;\r\n }\r\n};\r\n\r\nexport const getSetProductData = (getSet: string, products?: IProductDetails[]) => {\r\n return getSetLocalStorage('product_details', getSet, products, []);\r\n};\r\n\r\nexport const getSetProductSpec = (getSet: string, products?: IProductDetails[]) => {\r\n return getSetLocalStorage('product_specification', getSet, products, []);\r\n};\r\n\r\nexport const getSetPromoCodeApplyList = (getSet: string) => {\r\n return getSetLocalStorage('promo_code_apply_list', getSet, [], []);\r\n};\r\n\r\nexport const getSetPromoCode = (getSet: string) => {\r\n return getSetLocalStorage('promoCode', getSet, [], []);\r\n};\r\n\r\nexport const getSetGrandTotal = (getSet: string, total?: string) => {\r\n return getSetLocalStorage('grand_total', getSet, total, 0);\r\n};\r\n\r\nexport const getSetBonusItemProd = (getSet: string, globalBonusItems?: IMFIBonusItemsResponse[])=>{\r\n return getSetLocalStorage('BonusItemProduct', getSet, globalBonusItems, []);\r\n};\r\n\r\nexport const getSetSelectedBonasItem = (getSet: string, bonusItemArray?: IProductBonusItems[]) => {\r\n return getSetLocalStorage('selectedBonasItems', getSet, bonusItemArray, []);\r\n};\r\n\r\nexport const getSetBonusCouponDetail = (getSet: string, getCoupons?: IMFIGetBonusCouponsDetailsResponse[])=>{\r\n return getSetLocalStorage('bonusCouponsDetail', getSet, getCoupons, []);\r\n};\r\n\r\nexport const getSetPrevBonasModalState = (getSet: string, previousBonasModal?: IProductBonusItems[]) => {\r\n return getSetLocalStorage('previousBonasModalState', getSet, previousBonasModal, []);\r\n};\r\n\r\nexport const getSetBonusItemBrandName = (getSet: string, bonusItemsBrandName?: IProductBonusWithBrandName[]) => {\r\n return getSetLocalStorage('bonusItmesWithBrand', getSet, bonusItemsBrandName, []);\r\n};\r\n\r\nexport const getSetDateGroupedProducts = (getSet: string, products?: IMFRMDateGroupedProducts[]) => {\r\n return getSetLocalStorage('date_grouped_products', getSet, products, []);\r\n};\r\nexport const getSetWmapCartLines = (getSet: string, products?: { product: SimpleProduct, count: number }[]) => {\r\n return getSetLocalStorage('wmapCartLines', getSet, products, []);\r\n};","import { IActionContext } from '@msdyn365-commerce/core';\r\nimport { addCartLinesAsync, removeCartLinesAsync, updateCartLinesAsync, updateLineDeliverySpecificationsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\r\nimport { Cart, CartLine, LineDeliverySpecification } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { ICartActionResultWithCart } from '@msdyn365-commerce/global-state';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\n\r\nexport const cartOperationDoRetry = async (callback: () => Promise , cartState: ICartState) => {\r\n let callbackResult = await callback();\r\n if (callbackResult.status === 'SUCCESS') {\r\n if (callbackResult) {\r\n await cartState.updateCart({newCartObject: callbackResult.cart!}).then(null);\r\n }\r\n } else {\r\n const refreshCartResult = await cartState.refreshCart({});\r\n if (refreshCartResult.status === 'SUCCESS') {\r\n callbackResult = await callback();\r\n\r\n if (callbackResult.status === 'SUCCESS') {\r\n if (callbackResult.cart) {\r\n void cartState.updateCart({newCartObject: callbackResult.cart}).then(null);\r\n }\r\n }\r\n }\r\n }\r\n return callbackResult?.cart;\r\n};\r\n\r\nexport const updateCartLineDeliverySpecificationsInternal = async (cart: Readonly, cartLineDeliverySpecifications: LineDeliverySpecification[], actionContext: IActionContext): Promise => {\r\n if (!cart || !cart.CartLines || cartLineDeliverySpecifications.length === 0) {\r\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\r\n }\r\n\r\n return updateLineDeliverySpecificationsAsync(\r\n { callerContext: actionContext },\r\n cart.Id,\r\n cartLineDeliverySpecifications\r\n )\r\n .then(newCart => {\r\n return { cart: newCart, status: 'SUCCESS' };\r\n }).catch(error => {\r\n actionContext.telemetry.warning(error);\r\n actionContext.telemetry.debug('Unable to updateLineDeliverySpecificationsAsync');\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\r\n return { cart: undefined, status: 'FAILED', errorDetails: { LocalizedMessage: error.message } };\r\n });\r\n};\r\n\r\nexport const updateCartLineInternal = async (cart: Readonly, cartLineDeliverySpecifications: LineDeliverySpecification[], actionContext: IActionContext): Promise => {\r\n if (!cart || !cart.CartLines || cartLineDeliverySpecifications.length === 0) {\r\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\r\n }\r\n\r\n return updateCartLinesAsync(\r\n { callerContext: actionContext },\r\n cart.Id,\r\n cartLineDeliverySpecifications\r\n )\r\n .then(newCart => {\r\n return { cart: newCart, status: 'SUCCESS' };\r\n }).catch(error => {\r\n actionContext.telemetry.warning(error);\r\n actionContext.telemetry.debug('Unable to updateLineDeliverySpecificationsAsync');\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\r\n return { cart: undefined, status: 'FAILED', errorDetails: { LocalizedMessage: error.message } };\r\n });\r\n};\r\n\r\nexport const addCartLineInternal = async (cart: Readonly, cartLineDeliverySpecifications: CartLine[], actionContext: IActionContext): Promise => {\r\n if (!cart || !cart.CartLines || cartLineDeliverySpecifications.length === 0) {\r\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\r\n }\r\n\r\n return addCartLinesAsync(\r\n { callerContext: actionContext },\r\n cart.Id,\r\n cartLineDeliverySpecifications\r\n )\r\n .then(newCart => {\r\n return { cart: newCart, status: 'SUCCESS' };\r\n }).catch(error => {\r\n actionContext.telemetry.warning(error);\r\n actionContext.telemetry.debug('Unable to updateLineDeliverySpecificationsAsync');\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\r\n return { cart: undefined, status: 'FAILED', errorDetails: { LocalizedMessage: error.message } };\r\n });\r\n};\r\n\r\nexport default async function removeCartLinesInternal(cart: Readonly, cartLineIds: string[], actionContext: IActionContext): Promise {\r\n if (!cart) {\r\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\r\n }\r\n\r\n return removeCartLinesAsync({ callerContext: actionContext }, cart.Id, cartLineIds)\r\n .then(newCart => {\r\n // This is because of a TSProxy typing error\r\n const returnedCart = Array.isArray(newCart) ? newCart[0] : newCart;\r\n\r\n return { cart: returnedCart, status: 'SUCCESS' };\r\n })\r\n .catch(error => {\r\n actionContext.telemetry.warning(error);\r\n actionContext.telemetry.debug('Unable to Remove Cart Line');\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\r\n return { cart: undefined, status: 'FAILED', errorDetails: { LocalizedMessage: error.message } };\r\n });\r\n}","import { SimpleProduct} from '@msdyn365-commerce/retail-proxy';\r\nimport { getProductUrlSync } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\r\nconst generateURLForPDP = (product: SimpleProduct, context: ICoreContext>) => {\r\n let newURL = '';\r\n if(product) {\r\n const variantProductId = product.RecordId;\r\n newURL = getProductUrlSync(product, context.actionContext, undefined);\r\n if(context.app.config.queryBasedVariantSelection) {\r\n newURL = `${newURL}?variantid=${variantProductId}`;\r\n }\r\n return newURL;\r\n }\r\n return newURL;\r\n};\r\nexport default generateURLForPDP;","export interface IMfrmStatesValues {\r\n stateName: string;\r\n message: string;\r\n zipcodeMessage: string;\r\n hasStore:boolean;\r\n hideCheckoutState:boolean;\r\n}\r\n\r\nexport const getBlockZipCodeMessage = (stateName: string, blockStatesArray: IMfrmStatesValues[]) => {\r\n if (blockStatesArray) {\r\n return blockStatesArray.filter((blockstate: IMfrmStatesValues) => {\r\n return blockstate.stateName === stateName;\r\n });\r\n }\r\n return [];\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 { IMFICLDeliveryScheduleParameters } from '../actions/CoreProductDataServiceEntities.g';\r\nimport getATPInventoryStatusAction, { GetATPInventoryStatusInput } from '../actions/get-sm-inventory-status.action';\r\n\r\nconst _getInventoryQuantity = async (\r\n request: IMFICLDeliveryScheduleParameters,\r\n context: ICoreContext>,\r\n isCached?: boolean\r\n) => {\r\n if (request) {\r\n const getATPInventoryStatusInput = new GetATPInventoryStatusInput(request, isCached);\r\n try {\r\n const result = await getATPInventoryStatusAction(getATPInventoryStatusInput, 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 _getInventoryQuantity;\r\n","import { IGridSettings, IImageSettings, Image } from '@msdyn365-commerce/core';\r\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy';\r\nimport React from 'react';\r\nimport { IBrandListData } from '../modules/mfrm-buybox/mfrm-buybox.view';\r\nimport { IProductBonusWithBrandName } from '../modules/mfrm-cart/mfrm-cart';\r\nimport {hasArray} from './emtpyChecker';\r\nimport MsDyn365 from '@msdyn365-commerce/core';\r\n\r\nconst fallBackBrandAttribute = 'VENDOR BRAND';\r\n\r\n// tslint:disable-next-line: cyclomatic-complexity\r\nexport const parseBrandData = (\r\n attributes: AttributeValue[] | undefined,\r\n backendAttribute: string,\r\n gridSettings: IGridSettings,\r\n renderBrandNameOnly: Boolean = false,\r\n brandList: IBrandListData[],\r\n imageSettings?: IImageSettings\r\n): JSX.Element | undefined => {\r\n const attribute = backendAttribute || fallBackBrandAttribute;\r\n const productBrandName =\r\n attributes &&\r\n attributes.find(currAttribute => currAttribute.Name && currAttribute.Name.toLowerCase().trim() === attribute.toLowerCase().trim())\r\n ?.TextValue;\r\n\r\n if (renderBrandNameOnly) {\r\n return {productBrandName};\r\n }\r\n\r\n const selectedBrand =\r\n (brandList &&\r\n productBrandName &&\r\n brandList.find(\r\n (brand: IBrandListData) => brand && brand.brandName.toLowerCase().trim() === productBrandName.toLowerCase().trim()\r\n )) ||\r\n undefined;\r\n\r\n if (!selectedBrand) {\r\n return undefined;\r\n }\r\n\r\n const copySelectedBrand: IBrandListData = selectedBrand;\r\n // set alt text to brand name if no alt text is configured\r\n if (copySelectedBrand && _useDefaultAltText(copySelectedBrand) && copySelectedBrand.brandLogo) {\r\n copySelectedBrand.brandLogo.altText = productBrandName;\r\n }\r\n\r\n // set height to configured value or the default\r\n const height = copySelectedBrand && copySelectedBrand.logoHeight !== undefined ? copySelectedBrand.logoHeight : 22;\r\n const brandImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: `w=0&h=25&m=6`, w: 0, h: 25 },\r\n lg: { q: `w=0&h=25&m=6`, w: 0, h: 25 },\r\n xl: { q: `w=0&h=25&m=6`, w: 0, h: 25 }\r\n },\r\n lazyload: false\r\n };\r\n\r\n const brandLogo = copySelectedBrand && copySelectedBrand.brandLogo && (\r\n \r\n );\r\n // place logo inside a link if configured to\r\n const brandLink =\r\n copySelectedBrand &&\r\n copySelectedBrand.brandLink &&\r\n copySelectedBrand.brandLink.linkUrl &&\r\n copySelectedBrand.brandLink.linkUrl.destinationUrl &&\r\n copySelectedBrand.brandLink;\r\n const linkElement = brandLink && (\r\n \r\n {brandLogo}\r\n \r\n );\r\n\r\n return linkElement || brandLogo;\r\n};\r\n// get only brandName\r\nexport const parseBrandName = (attributes: AttributeValue[] | undefined, backendAttribute: string, recordId?: number): string | undefined => {\r\n const attribute = backendAttribute || fallBackBrandAttribute;\r\n let productBrandName = hasArray(attributes)?.find((currAttribute: AttributeValue) => currAttribute?.Name?.toLowerCase().trim() === attribute?.toLowerCase().trim())?.TextValue;\r\n if (!productBrandName && MsDyn365.isBrowser) {\r\n const getLocalStorage = localStorage.getItem('bonusItmesWithBrand');\r\n let bonusItemArray: IProductBonusWithBrandName[] = [];\r\n if (getLocalStorage) {\r\n bonusItemArray = JSON.parse(getLocalStorage);\r\n }\r\n const checkBrandName = bonusItemArray.find(item => item.productId === recordId)?.brandName;\r\n if(checkBrandName) {\r\n productBrandName = checkBrandName;\r\n } else {\r\n return undefined;\r\n }\r\n }\r\n return productBrandName;\r\n};\r\n\r\nexport const parseBrandNameUnbxd = (attributes: any | undefined, backendAttribute: string, recordId?: number): string | undefined => {\r\n const attribute = backendAttribute || fallBackBrandAttribute;\r\n // let productBrandName = hasArray(attributes)?.find((currAttribute: AttributeValue) => currAttribute?.Name?.toLowerCase().trim() === attribute?.toLowerCase().trim())?.TextValue;\r\n // eslint-disable-next-line security/detect-object-injection\r\n let productBrandName = attributes && attributes[attribute];\r\n if (!productBrandName && MsDyn365.isBrowser) {\r\n const getLocalStorage = localStorage.getItem('bonusItmesWithBrand');\r\n let bonusItemArray: IProductBonusWithBrandName[] = [];\r\n if (getLocalStorage) {\r\n bonusItemArray = JSON.parse(getLocalStorage);\r\n }\r\n const checkBrandName = bonusItemArray.find(item => item.productId === recordId)?.brandName;\r\n if(checkBrandName) {\r\n productBrandName = checkBrandName;\r\n } else {\r\n return undefined;\r\n }\r\n }\r\n return productBrandName;\r\n};\r\n\r\n// get only brandName\r\nexport const getBrandNameCheck = (attributes: AttributeValue[] | undefined, backendAttribute: string): string | undefined => {\r\n const productBrandName =\r\n attributes &&\r\n attributes.find(\r\n currAttribute => currAttribute.Name && currAttribute.Name.toLowerCase().trim() === backendAttribute.toLowerCase().trim()\r\n )?.TextValue;\r\n if (!productBrandName) {\r\n return undefined;\r\n }\r\n return productBrandName;\r\n};\r\n\r\n// get the appropriate image alt text\r\nconst _useDefaultAltText = (selectedBrand: IBrandListData): boolean => {\r\n const configuredAltText = selectedBrand.brandLogo?.altText;\r\n return !(configuredAltText && configuredAltText.trim() && configuredAltText !== 'No Data Available');\r\n};\r\n","import MsDyn365, { ICoreContext } from '@msdyn365-commerce/core';\r\nexport type GridSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\r\n\r\nconst _getViewPort = (context: ICoreContext): GridSize => {\r\n if (MsDyn365.isBrowser && window.innerWidth) {\r\n const gridSettings = context.request.gridSettings;\r\n if (gridSettings) {\r\n if (gridSettings.xs && window.innerWidth <= gridSettings.xs.w) {\r\n return 'xs';\r\n } else if (gridSettings.sm && window.innerWidth <= gridSettings.sm.w) {\r\n return 'sm';\r\n } else if (gridSettings.md && window.innerWidth <= gridSettings.md.w) {\r\n return 'md';\r\n } else if (gridSettings.lg && window.innerWidth <= gridSettings.lg.w) {\r\n return 'lg';\r\n } else {\r\n return 'xl';\r\n }\r\n }\r\n }\r\n return 'xs';\r\n};\r\n\r\nexport default _getViewPort;\r\n","import { IActionContext } from '@msdyn365-commerce/core';\r\nimport Cookies from 'universal-cookie';\r\nexport const getZipCode = (ctx: IActionContext): string | undefined => {\r\n //@ts-ignore\r\n const geolocationZipCode = ctx.requestContext.geoLocation?.zipCode ? ctx.requestContext.geoLocation.zipCode : ctx.requestContext.geoLocation?.res?.zipCode;\r\n const cookie = new Cookies();\r\n const zipcode = cookie.get('zip_code') ? cookie.get('zip_code') : geolocationZipCode;\r\n return zipcode ?? undefined;\r\n};\r\nexport const getGeoLocationZipCode = (ctx: IActionContext): string | undefined => {\r\n //@ts-ignore\r\n const zipCode = ctx.requestContext.geoLocation?.zipCode ? ctx.requestContext.geoLocation.zipCode : ctx.requestContext.geoLocation?.res?.zipCode;\r\n return zipCode ?? null;\r\n};\r\n","export const oneYearFromNow = (): Date => {\r\n const now = new Date();\r\n return new Date(now.setFullYear(now.getFullYear() + 1));\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 { PriceComponent } from '@msdyn365-commerce/components';\r\nimport {ICoreContext, ITelemetry} from '@msdyn365-commerce/core';\r\nimport { ICheckoutState, IGiftCardExtend } from '@msdyn365-commerce/global-state';\r\nimport { Cart, ChannelConfiguration, ChannelDeliveryOptionConfiguration} from '@msdyn365-commerce/retail-proxy';\r\nimport * as React from 'react';\r\n\r\nexport interface IOrderSummaryProps {\r\n subTotalLabel: string;\r\n shippingLabel: string;\r\n taxLabel: string;\r\n orderTotalLabel: string;\r\n loyaltyLabel?:string;\r\n giftcardLabel?:string;\r\n totalDiscountsLabel: string;\r\n context: ICoreContext;\r\n telemetry: ITelemetry;\r\n cart: Cart;\r\n channelConfiguration: ChannelConfiguration;\r\n id: string;\r\n typeName: string;\r\n otherChargeLabel?: string;\r\n freeText?:string;\r\n toBeCalculatedText?: string;\r\n checkoutState?: ICheckoutState;\r\n retailMultiplePickUpOptionEnabled?: boolean;\r\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n mattressRecyclingFee: {label:string; value:number | string};\r\n deliveryFee: {label:string; value:number | string};\r\n}\r\n\r\nexport interface IOrderSummaryLines {\r\n mattressRecyclingFee: React.ReactNode;\r\n deliveryFee: React.ReactNode;\r\n subtotal: React.ReactNode;\r\n shipping?: React.ReactNode;\r\n otherCharge?: React.ReactNode;\r\n tax: React.ReactNode;\r\n orderTotal: React.ReactNode;\r\n totalDiscounts?: React.ReactNode;\r\n giftCard?:React.ReactNode;\r\n loyalty?: React.ReactNode;\r\n}\r\n\r\ninterface IOrderSummaryLineProps {\r\n label: string;\r\n context: ICoreContext;\r\n telemetry: ITelemetry;\r\n price?: number;\r\n freeText?:string;\r\n toBeCalculatedText?: string;\r\n id: string;\r\n typeName: string;\r\n cssLabel: string;\r\n}\r\n\r\ninterface IShippingOrderLine {\r\n cart: Cart;\r\n channelConfiguration: ChannelConfiguration;\r\n canShip?: boolean;\r\n hasDeliveryMethod?: boolean;\r\n hasShippingMethod?: boolean;\r\n freightFee?: number;\r\n}\r\n\r\nconst OrderSummaryLine: React.FC = ({\r\n price,\r\n label,\r\n context,\r\n id,\r\n typeName,\r\n toBeCalculatedText,\r\n freeText,\r\n cssLabel\r\n}) => {\r\n return(\r\n

\r\n {label}\r\n {price || price === 0 ? (\r\n \r\n ) : (\r\n {toBeCalculatedText}\r\n )}\r\n

\r\n );\r\n};\r\nconst MattressRecyclingFee: React.FC<{ label: string; value: string | number }> = () => {\r\n return (\r\n <>\r\n );\r\n};\r\n\r\nconst DeliveryFeeShow: React.FC<{ label: string; value: string | number }> = () => {\r\n return (\r\n <>\r\n );\r\n};\r\n\r\nconst _buildOrderSummarySection = (\r\n props: IOrderSummaryProps,\r\n price: number | undefined,\r\n cssLabel: string,\r\n label: string = ''\r\n):React.ReactNode => {\r\n return (\r\n \r\n );\r\n};\r\n\r\nconst _computedLoyaltyAmount = (checkoutState: ICheckoutState): number => {\r\n return (checkoutState && checkoutState.loyaltyAmount) || 0;\r\n};\r\n\r\nconst _computeGiftCardAmount = (checkoutState: ICheckoutState, cart: Cart): number => {\r\n\r\n const giftCardCounter = (count: number, giftCard: IGiftCardExtend) => {\r\n return count + (giftCard.Balance || 0);\r\n };\r\n const giftCardTotalValue = (checkoutState.giftCardExtends || []).reduce(giftCardCounter, 0);\r\n const amount = (cart.TotalAmount || 0) - _computedLoyaltyAmount(checkoutState);\r\n return Math.min(giftCardTotalValue, amount);\r\n};\r\n\r\nconst getDeliveryConfiguration = (cart: Cart, channelConfiguration: ChannelConfiguration, channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration, retailMultiplePickUpOptionEnabled?: boolean):IShippingOrderLine => {\r\n\r\n const pickupDeliveryModeCode = channelConfiguration && channelConfiguration.PickupDeliveryModeCode;\r\n const emailDeliveryModeCode = channelConfiguration && channelConfiguration.EmailDeliveryModeCode;\r\n const cartLines = cart.CartLines || [];\r\n const deliveryModes = cartLines.map(cartLine => cartLine.DeliveryMode);\r\n\r\n const freightFee = cart.ShippingChargeAmount;\r\n const canShip = deliveryModes.some(deliveryMode =>\r\n (deliveryMode !== '' && (deliveryMode === getDeliveryMode(deliveryMode, retailMultiplePickUpOptionEnabled, channelDeliveryOptionConfig, pickupDeliveryModeCode) || deliveryMode === emailDeliveryModeCode)) ? false : true);\r\n const hasDeliveryMethod = deliveryModes.some(deliveryMode => !!deliveryMode && deliveryMode !== emailDeliveryModeCode);\r\n const hasShippingMethod = deliveryModes.some(deliveryMode =>\r\n !!deliveryMode && deliveryMode !== getDeliveryMode(deliveryMode, retailMultiplePickUpOptionEnabled, channelDeliveryOptionConfig, pickupDeliveryModeCode) && deliveryMode !== emailDeliveryModeCode);\r\n return {\r\n canShip,\r\n hasDeliveryMethod,\r\n hasShippingMethod,\r\n freightFee\r\n } as IShippingOrderLine;\r\n};\r\n\r\nconst getDeliveryMode = (deliveryMode?: string, featureSate: boolean = false, channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration, pickupDeliveryMode?: string) => {\r\n if(!featureSate) {\r\n return pickupDeliveryMode;\r\n } else {\r\n return channelDeliveryOptionConfig?.PickupDeliveryModeCodes?.find(dM => dM === deliveryMode);\r\n }\r\n};\r\n\r\nexport const OrderSummary = (props: IOrderSummaryProps) => {\r\n const { SubtotalAmount, TaxAmount, DiscountAmountWithoutTax = 0, TotalAmount, OtherChargeAmount, DiscountAmount = 0 } = props.cart;\r\n const { label, value } = props.mattressRecyclingFee;\r\n const deliveryObject = props.deliveryFee;\r\n const { canShip, hasDeliveryMethod, hasShippingMethod, freightFee } = getDeliveryConfiguration(props.cart, props.channelConfiguration, props.channelDeliveryOptionConfig, props.retailMultiplePickUpOptionEnabled);\r\n const reactNodes:IOrderSummaryLines = {\r\n subtotal: _buildOrderSummarySection(props, SubtotalAmount, 'sub-total', props.subTotalLabel),\r\n tax: _buildOrderSummarySection(props, hasDeliveryMethod ? TaxAmount: undefined, 'tax-amount', props.taxLabel),\r\n mattressRecyclingFee: ,\r\n deliveryFee: ,\r\n orderTotal: _buildOrderSummarySection(props, TotalAmount, 'total', props.orderTotalLabel),\r\n otherCharge: OtherChargeAmount && _buildOrderSummarySection(props, OtherChargeAmount,'other-charges', props.otherChargeLabel) || undefined\r\n };\r\n\r\n if(canShip) {\r\n reactNodes.shipping =_buildOrderSummarySection(props, hasShippingMethod ? freightFee : undefined, 'shipping', props.shippingLabel);\r\n }\r\n if(props.checkoutState) {\r\n const giftCardAmount = _computeGiftCardAmount(props.checkoutState, props.cart);\r\n const loyaltyAmount = _computedLoyaltyAmount(props.checkoutState);\r\n const totalAmountAfterGiftCard = (TotalAmount || 0) - giftCardAmount - loyaltyAmount;\r\n\r\n if(loyaltyAmount > 0) {\r\n reactNodes.loyalty = _buildOrderSummarySection(props, -loyaltyAmount, 'loyalty', props.loyaltyLabel || 'Loyalty amount');\r\n }\r\n\r\n if(giftCardAmount > 0) {\r\n reactNodes.giftCard = _buildOrderSummarySection(props, -giftCardAmount, 'gift-card', props.giftcardLabel || 'Gift card amount');\r\n }\r\n\r\n reactNodes.orderTotal = _buildOrderSummarySection({...props, freeText: undefined }, totalAmountAfterGiftCard, 'total', props.orderTotalLabel);\r\n }\r\n\r\n if(DiscountAmountWithoutTax > 0) {\r\n reactNodes.totalDiscounts = _buildOrderSummarySection(props, -DiscountAmountWithoutTax, 'total-discounts', props.totalDiscountsLabel);\r\n }\r\n\r\n if(DiscountAmount > 0) {\r\n reactNodes.totalDiscounts = _buildOrderSummarySection(props, -DiscountAmount, 'total-discounts', props.totalDiscountsLabel);\r\n }\r\n\r\n return reactNodes;\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\n\r\nexport const _getEyebrowMessage = async (products: IMFIItem[], context: ICoreContext>) => {\r\n const priceGroupForAPICall = context.app && context.app.config.priceGroup;\r\n if (products && products.length > 0 && (priceGroupForAPICall !== '' || priceGroupForAPICall !== undefined)) {\r\n const items: IMFIItem[] | undefined = [];\r\n products.map(item => {\r\n const singleItem: IMFIItem = {\r\n ItemId: item.ItemId,\r\n DistinctProductVariant: item.DistinctProductVariant\r\n };\r\n items.push(singleItem);\r\n });\r\n\r\n const requestBody: IMFIAvailablePromotionDescription = {\r\n PriceGroup: priceGroupForAPICall,\r\n Items: items\r\n };\r\n const getEyebrowMessageInput = new GetEyebrowMessageInput(requestBody, undefined, true);\r\n try {\r\n const result = await getEyebrowAction(getEyebrowMessageInput, context.actionContext);\r\n if (result) {\r\n return result;\r\n }\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n }\r\n return null;\r\n};\r\n\r\nexport const _makeDeliveryMessage = (days: string) => {\r\n if (days === '' || days === undefined || days === null) {\r\n return '';\r\n }\r\n\r\n let deliveryByMessage = '';\r\n let date = new Date();\r\n const daysSpan = days.split('-');\r\n let deliveryDate = Date.now();\r\n if (daysSpan && daysSpan[1] !== undefined && daysSpan.length) {\r\n let deliveryByMessageRange = '';\r\n daysSpan.map((item: string) => {\r\n date = new Date();\r\n deliveryDate = Date.now();\r\n if (parseInt(item, 10) > 0) {\r\n let numberOfDays = parseInt(item, 10);\r\n let newDate = deliveryDate;\r\n while (numberOfDays > 0) {\r\n newDate = date.setDate(date.getDate() + 1);\r\n if (dayjs(newDate).format('d') !== '0' && dayjs(newDate).format('d') !== '6') {\r\n numberOfDays--;\r\n }\r\n }\r\n deliveryByMessage = dayjs(newDate).format('MMM D');\r\n if (deliveryByMessageRange !== '') {\r\n deliveryByMessageRange = `${deliveryByMessageRange} to ${deliveryByMessage}`;\r\n } else {\r\n deliveryByMessageRange = deliveryByMessage;\r\n newDate = date.setDate(date.getDate() - parseInt(item[0], 10));\r\n }\r\n }\r\n });\r\n return `Delivery by ${deliveryByMessageRange}`;\r\n } else {\r\n deliveryByMessage = dayjs(deliveryDate).format('MMM D');\r\n let numberOfDays = parseInt(days, 10);\r\n let newDate = deliveryDate;\r\n let flag = true;\r\n while (numberOfDays > 0) {\r\n newDate = date.setDate(date.getDate() + 1);\r\n if (dayjs(newDate).format('d') !== '0' && dayjs(newDate).format('d') !== '6') {\r\n numberOfDays--;\r\n } else {\r\n flag = false;\r\n }\r\n }\r\n deliveryByMessage =\r\n flag && days === '1'\r\n ? `Tomorrow ${dayjs(Date.now()).format('MMM D')}`\r\n : dayjs(newDate).format('ddd MMM, D');\r\n return `Delivery by ${deliveryByMessage}`;\r\n }\r\n};\r\n\r\n// tslint:disable-next-line: no-any\r\nexport const _coreProductATPCall = async (\r\n itemLines: IMFICartLine[],\r\n setCoreProductATPData: React.Dispatch,\r\n context: ICoreContext>\r\n) => {\r\n const cookies = new Cookies();\r\n const zipcode = cookies.get('zip_code');\r\n if (itemLines && itemLines.length === 0) {\r\n setCoreProductATPData([]);\r\n }\r\n const currentDate = Date.now();\r\n const requestBody: IMFICLDeliveryScheduleParameters = {\r\n InventoryType: 'Delivery',\r\n Weeks: context.app.config.weeksPDPforATPCall,\r\n StoreId: '',\r\n Page: 'plp',\r\n RequestedDate: dayjs(currentDate).format('MM/DD/YYYY'),\r\n ZipCode: zipcode,\r\n ItemLines: itemLines\r\n };\r\n const getDeliveryByMessage = _getDeliveryByMessage(requestBody, context);\r\n getDeliveryByMessage\r\n .then(result => {\r\n if (result !== undefined && result?.ATPInventoryData && result?.ATPInventoryData.length > 0) {\r\n setCoreProductATPData(result?.ATPInventoryData);\r\n } else {\r\n setCoreProductATPData([]);\r\n }\r\n })\r\n .catch(e => {\r\n console.log('Error', e);\r\n });\r\n};\r\n\r\nconst _setTime = (time: string | undefined) => {\r\n if (time !== undefined && time !== '') {\r\n const temp = time.split(' ');\r\n if (temp && temp.length > 0) {\r\n let newDatewithTime = dayjs(Date.now()).format('M/D/YYYY');\r\n newDatewithTime = `${newDatewithTime} ${temp[0]}:00 ${temp[1].toUpperCase()}`;\r\n return newDatewithTime;\r\n }\r\n }\r\n return '';\r\n};\r\n\r\nexport interface IATPInventoryData {\r\n deliveryByMessage: string;\r\n locationId: string;\r\n}\r\n\r\nexport const _getSoonestDeliveryDate = (coreProductATPData: IMFIATPInventoryEntity[]): IATPInventoryData => {\r\n let deliveryDetails = {\r\n deliveryByMessage: '',\r\n locationId: ''\r\n };\r\n if (!coreProductATPData || !coreProductATPData.length) {\r\n return deliveryDetails;\r\n }\r\n for (let index = 0; index < coreProductATPData.length; index++) {\r\n const item = coreProductATPData[index];\r\n if (item.Available === 'YES' && item.ATPQuantity !== undefined && parseInt(item.ATPQuantity, 10) > 0) {\r\n const date = new Date();\r\n const today = dayjs(Date.now()).format('D M YY');\r\n const deliveryDate = dayjs(item.SlotDate).format('D M YY');\r\n const currHour = dayjs(Date.now()).format('H');\r\n if (today === deliveryDate) {\r\n const deliveryMessage =\r\n _setTime(item.StartTime) !== ''\r\n ? parseInt(dayjs(_setTime(item.StartTime)).format('H'), 10) < 14 && parseInt(currHour, 10) < 14\r\n ? `Delivery by Today ${dayjs(Date.now()).format('MMM D')}`\r\n : `Delivery by Tomorrow ${dayjs(date.setDate(date.getDate() + 1)).format('MMM D')}`\r\n : '';\r\n deliveryDetails = {\r\n deliveryByMessage: deliveryMessage,\r\n locationId: item.Location1!\r\n };\r\n break;\r\n } else {\r\n const deliveryMessage = `Delivery by ${dayjs(item.SlotDate).format('MMM D')}`;\r\n deliveryDetails = {\r\n deliveryByMessage: deliveryMessage,\r\n locationId: item.Location1!\r\n };\r\n break;\r\n }\r\n }\r\n }\r\n return deliveryDetails;\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * BonusCouponDetails Input Action\r\n */\r\nexport class BonusCouponDetailsInput implements Msdyn365.IActionInput {\r\n\r\n // TODO: 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 = () => `bonusCouponDetail`;\r\n public getCacheObjectType = () => 'bonusCouponDetail';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IBonusCouponDetailsData {\r\n bonusCouponDetail: string;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new BonusCouponDetailsInput();\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: BonusCouponDetailsInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { bonusCouponDetail: '' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'BonusCouponDetails',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * BonusItemProduct Input Action\r\n */\r\nexport class BonusItemProductInput implements Msdyn365.IActionInput {\r\n\r\n // TODO: 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 = () => `TODO`;\r\n public getCacheObjectType = () => 'TODO';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IBonusItemProductData {\r\n bonusItemProduct: string;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new BonusItemProductInput();\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: BonusItemProductInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { bonusItemProduct: '' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'BonusItemProduct',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","import {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICommerceApiSettings,\r\n ICreateActionContext,\r\n IGeneric,\r\n IRequestContext\r\n} from '@msdyn365-commerce/core';\r\n// import { ICategoryPath, ICategoryUrl } from '@msdyn365-commerce/core-internal/dist/types/interfaces/ICategoryPathInterfaces';\r\nimport { getCategoryPathsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { CategoryPathLookup, CategoryPathResult } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { hasArray } from '../Utilities/emtpyChecker';\r\n\r\n/**\r\n * Category path input\r\n */\r\nexport class GetCategoryPathsInput implements IActionInput {\r\n public readonly ChannelId: number;\r\n public CatalogId?: number;\r\n public productIds?: number[];\r\n // public readonly categoryPathLooksups: CategoryPathLookup[];\r\n public readonly apiSettings: ICommerceApiSettings;\r\n // @ts-ignore\r\n private constructedCacheKey: string | undefined;\r\n\r\n constructor(context: IRequestContext, catalogId?: number, productIds?: number[]) {\r\n this.ChannelId = context.apiSettings.channelId;\r\n this.CatalogId = catalogId; // context.apiSettings.catalogId || 0;\r\n this.productIds = productIds;\r\n // this.categoryPathLooksups = categoryPathLooksups;\r\n this.apiSettings = context.apiSettings;\r\n this.constructedCacheKey = '';\r\n // categoryPathLooksups.forEach(categoryPath=> {\r\n // this.constructedCacheKey+=`${categoryPath.ProductId && categoryPath.ProductId.toString()}|`;\r\n // });\r\n this.constructedCacheKey = this.productIds?.map(ids => ids).join('-').toString();\r\n this.constructedCacheKey += `${this.ChannelId?.toString()}|`;\r\n this.constructedCacheKey += `${this.CatalogId?.toString()}|`;\r\n }\r\n\r\n public getCacheKey = () => `MFRMProductCategoryPath-${this.constructedCacheKey}`;\r\n public getCacheObjectType = () => 'MFRMProductCategoryPath';\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\n/**\r\n * Creates the input required to make the getCategoryPath retail api call\r\n */\r\nexport const createGetCategoryPathsInput = (\r\n inputData: GetCategoryPathsInput,\r\n context: ICreateActionContext>\r\n): IActionInput => {\r\n const productId = inputData.productIds;\r\n if (productId) {\r\n return new GetCategoryPathsInput(context.requestContext, inputData.CatalogId, inputData.productIds);\r\n } else {\r\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\r\n }\r\n};\r\n\r\n/**\r\n * Calls the Retail API and returns the category path for a product\r\n */\r\nexport async function getProductsCategoryPathsAction(input: GetCategoryPathsInput, ctx: IActionContext): Promise {\r\n const catPaths: CategoryPathLookup[] = [];\r\n if (!hasArray(input.productIds)) {\r\n return [];\r\n }\r\n for (let productsIter = 0; productsIter < input.productIds!.length; productsIter++) {\r\n catPaths.push({ ProductId: input.productIds![productsIter] });\r\n }\r\n try {\r\n return await getCategoryPathsAsync({ callerContext: ctx, queryResultSettings: { Paging: { Top: input.productIds!.length }, Sorting: {} } }, input.ChannelId, input.CatalogId!, catPaths);\r\n } catch (err) {\r\n console.log(err);\r\n return [];\r\n }\r\n}\r\n\r\nexport const getCategoryPathsActionDataAction = createObservableDataAction({\r\n id: 'GetMFRMProductsCategoryPaths',\r\n action: >getProductsCategoryPathsAction,\r\n input: createGetCategoryPathsInput\r\n});\r\n\r\nexport default getCategoryPathsActionDataAction;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport interface ICheckoutRecycleFeeTaxUpdate {\r\n recycleFee: number | null;\r\n tax: number | null;\r\n}\r\n/**\r\n * GetRecycleFeeCheckout Input Action\r\n */\r\nexport class GetRecycleFeeCheckoutInput implements Msdyn365.IActionInput {\r\n\r\n // TODO: 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 = () => `CheckoutUpdateRecycleFee`;\r\n public getCacheObjectType = () => 'CheckoutUpdateRecycleFee';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetRecycleFeeCheckoutInput();\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: GetRecycleFeeCheckoutInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n return {recycleFee: null , tax: null};\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'GetRecycleFeeCheckout',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { mFIATPInventoryStatusAsync } from './CoreProductDataActionExtension.g';\r\nimport { IMFIATPInventoryStatusResponse, IMFICLDeliveryScheduleParameters } from './CoreProductDataServiceEntities.g';\r\n\r\n/**\r\n * GetDeliveryMessage Input Action\r\n */\r\n\r\nexport class GetATPInventoryStatusInput implements Msdyn365.IActionInput {\r\n // TODO: 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 // TODO: 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 const key = Array.prototype.map.call(this.input.ItemLines, (item) => { return item.VariantRecordId; }).sort().join(\",\");\r\n return `Get-Inventory-Status${this.input.ZipCode}-${this.input.ItemLines![0].ItemId}-${key}-${\r\n this.input?.Weeks\r\n }-${this.input?.RequestedDate}`;\r\n };\r\n // public getCacheKey = () => 'do';\r\n public getCacheObjectType = () => 'GetATPInventoryStatusResult';\r\n public dataCacheType = (): Msdyn365.CacheType => (this.isCached ? 'request' : 'none');\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\n\r\n/**\r\n * TODO: 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 * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function getATPInventoryStatusAction(\r\n request: GetATPInventoryStatusInput,\r\n ctx: Msdyn365.IActionContext\r\n): Promise {\r\n if (request.input) {\r\n try {\r\n const result = await mFIATPInventoryStatusAsync({ 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: >getATPInventoryStatusAction,\r\n // TODO: Give your data action a unique id\r\n id: 'GetATPInventoryStatus'\r\n // input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * TriggerSpecialSynchronyFinancing Input Action\r\n */\r\nexport class TriggerSpecialSynchronyFinancingInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // TODO: 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 = () => `TriggerSpecialSynchronyFinancing`;\r\n public getCacheObjectType = () => 'TriggerSpecialSynchronyFinancing';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface ITriggerSpecialSynchronyFinancingData {\r\n triggerSpecialFinancing: boolean;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new TriggerSpecialSynchronyFinancingInput();\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: TriggerSpecialSynchronyFinancingInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { triggerSpecialFinancing: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'TriggerSpecialSynchronyFinancing',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport { mFIGetBonusCouponsDetailsAsync } from '../actions/BonusItemDataActionExtension.g';\r\nimport { IMFIGetBonusCouponsDetailsResponse } from '../actions/BonusItemDataServiceEntities.g';\r\n\r\n// tslint:disable-next-line: completed-docs\r\nexport class BonusCouponsInfoInput implements IActionInput {\r\n public bonusCoupon: string;\r\n constructor(bonusCoupon: string) {\r\n this.bonusCoupon = bonusCoupon;\r\n }\r\n public getCacheKey = () => `MFRMBonusCouponsInfoInput-${this.bonusCoupon}`;\r\n public getCacheObjectType = () => 'MFRMBonusCouponsInfoInput';\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\nexport interface IMFRMBonusCouponsDetailData {\r\n couponsDetails: IMFIGetBonusCouponsDetailsResponse;\r\n}\r\n\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new BonusCouponsInfoInput('');\r\n};\r\n\r\nexport async function getAllBonusCouponsDetails(\r\n input: BonusCouponsInfoInput,\r\n ctx: IActionContext\r\n): Promise {\r\n try {\r\n const result = await mFIGetBonusCouponsDetailsAsync({ callerContext: ctx }, input.bonusCoupon);\r\n if (result) {\r\n return {couponsDetails: result};\r\n }\r\n } catch (error) {\r\n ctx.telemetry.warning(JSON.stringify(error));\r\n ctx.telemetry.debug('Unable to get Bonus Coupons Details when get all coupons');\r\n }\r\n return {couponsDetails: {}};\r\n}\r\n\r\nexport default createObservableDataAction({\r\n action: >getAllBonusCouponsDetails,\r\n input: createInput\r\n});\r\n","import { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\r\n\r\nexport interface ICartProductInfo {\r\n productId: number;\r\n typeOfProduct: string;\r\n deliveryDate: string;\r\n}\r\nexport interface ICartDataInfoState {\r\n cartProductsInfo: ICartProductInfo[];\r\n delMessageDropShipLatest: string;\r\n delMessageParcelLatest: string;\r\n}\r\n\r\n/**\r\n * SampleState - action input\r\n */\r\nexport class CartDataInfoInput implements IActionInput {\r\n public getCacheKey = () => `CartDataInfoInput`;\r\n public getCacheObjectType = () => 'CartDataInfoInput';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n/**\r\n * SampleState - action\r\n */\r\nexport async function updateCartDataInfoAction(input: CartDataInfoInput, ctx: IActionContext): Promise {\r\n return { cartProductsInfo: [], delMessageDropShipLatest: '', delMessageParcelLatest: '' };\r\n}\r\n\r\n/**\r\n * SampleState - create new input for create action\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new CartDataInfoInput();\r\n};\r\n\r\n/**\r\n * SampleState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >updateCartDataInfoAction,\r\n input: createInput\r\n});","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport { AttributeValue, CategoryPathLookup } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n getAttributeValuesAsync, getCategoryPathsAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n\r\nimport {\r\n ActiveCartProductsInput,\r\n getActiveCartProductsAction\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { hasArray } from '../Utilities/emtpyChecker';\r\n\r\n// tslint:disable-next-line: completed-docs\r\nexport class AttributesForSelectedVariantInput implements IActionInput {\r\n public channelId: number;\r\n public catalogId: number;\r\n\r\n constructor(channelId: number, catalogId?: number) {\r\n this.channelId = channelId;\r\n this.catalogId = catalogId || 0;\r\n }\r\n\r\n public getCacheKey = () => `AttributesForSelectedVariant`;\r\n public getCacheObjectType = () => 'AttributesForSelectedVariant';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\nexport const createAttributesForSelectedVariantInput = (inputData: ICreateActionContext>): AttributesForSelectedVariantInput => {\r\n\r\n return new AttributesForSelectedVariantInput(+inputData.requestContext.apiSettings.channelId);\r\n};\r\n\r\nexport interface IProductWithAttribute {\r\n productId: number;\r\n attributeValue: AttributeValue[];\r\n Name:string | undefined;\r\n PrimaryImageUrl: string | undefined;\r\n categoryName: string | undefined;\r\n}\r\n\r\n/**\r\n * Calls the Retail API to get the product attributes for items in the cart.\r\n * @param input\r\n * @param ctx\r\n */\r\nexport async function getAttributesForCartLineItems(\r\n input: AttributesForSelectedVariantInput,\r\n ctx: IActionContext\r\n): Promise {\r\n // let productAttributes: AttributeValue[][] = [];\r\n // let productAttributes: number[] = [];\r\n const productAttributes: IProductWithAttribute[] = [];\r\n\r\n const products = (await getActiveCartProductsAction(new ActiveCartProductsInput(), ctx)).filter(Boolean);\r\n const catPaths: CategoryPathLookup[] = [];\r\n const idArray: any[] = [];\r\n products.map(items => idArray.push(items.RecordId));\r\n if(!hasArray(idArray)) {\r\n return [];\r\n }\r\n for (let productsIter = 0; productsIter < idArray.length; productsIter++) {\r\n catPaths.push({ ProductId: idArray[productsIter] });\r\n }\r\n for(let i = 0 ; i < products?.length ; i++) {\r\n const productId = products[i].RecordId;\r\n const Name = products[i].Name;\r\n const PrimaryImageUrl = products[i].PrimaryImageUrl;\r\n try {\r\n const productSpecificationData: AttributeValue[] = await getAttributeValuesAsync({ callerContext: ctx, queryResultSettings: {} }, productId, ctx.requestContext.apiSettings.channelId, ctx.requestContext.apiSettings.catalogId);\r\n const attributeValue = productSpecificationData.filter(Boolean);\r\n\r\n const getCategory = await getCategoryPathsAsync({ callerContext: ctx, queryResultSettings: { Paging: { Top: idArray.length }, Sorting: {} } }, ctx.requestContext.apiSettings.channelId, ctx.requestContext.apiSettings.catalogId, catPaths);\r\n const checkCategory = getCategory.find(data => data.ProductId === products[i].RecordId);\r\n const getSegments = checkCategory && checkCategory.CategoryPath && checkCategory.CategoryPath[0]?.Segments;\r\n let categoryName;\r\n if (getSegments) {\r\n categoryName = getSegments[getSegments?.length - 1].CategoryName!;\r\n }\r\n productAttributes.push({\r\n productId,\r\n attributeValue,\r\n Name,\r\n PrimaryImageUrl,\r\n categoryName\r\n });\r\n } catch (error) {\r\n throw new Error(`Unable to get data: ${error}`);\r\n }\r\n }\r\n\r\n return productAttributes;\r\n}\r\n\r\n/**\r\n * Calls the Retail API to get the product availabilities for items in the cart.\r\n * @param input\r\n * @param ctx\r\n */\r\n\r\nexport const getAvailabilitiesForCartLineItemsDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/get-product-attributes-cartlines',\r\n action: >getAttributesForCartLineItems,\r\n input: createAttributesForSelectedVariantInput\r\n});\r\n\r\nexport default getAvailabilitiesForCartLineItemsDataAction;\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\r\n/**\r\n * MfrmNotification Input Action\r\n */\r\n\r\nexport class MfrmNotificationInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n\r\n // TODO: 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 = () => `promoCode`;\r\n public getCacheObjectType = () => 'promoCode';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IMfrmNotificationState {\r\n notifications: [INotification];\r\n}\r\n\r\nexport interface INotification {\r\n id?: number | string | undefined;\r\n type?: string;\r\n value?: string | undefined;\r\n status?: string | undefined;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new MfrmNotificationInput();\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: MfrmNotificationInput, ctx: Msdyn365.IActionContext): Promise {\r\n // tslint:disable-next-line: no-unnecessary-local-variable\r\n const notifications: INotification[] = [];\r\n return notifications;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'MfrmNotification',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\n/* tslint:disable: no-duplicate-imports */\r\nimport { CartLine, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport groupBy from 'lodash/groupBy';\r\nimport { assembleCartlines, ICartLineItemsProps, ICartlinesViewProps } from './mfrm-cart-line-items';\r\n\r\nconst _assembleGroupCartlines = (\r\n cartlines: CartLine[],\r\n products: SimpleProduct[] | undefined,\r\n props: ICartLineItemsProps\r\n): ICartlinesViewProps[][] | null => {\r\n const reactNodes: ICartlinesViewProps[][] = [];\r\n if (!products || products.length === 0) {\r\n props.context.telemetry.warning('Products content is empty, module wont render');\r\n return null;\r\n }\r\n\r\n const getGroupByStorePickup = (items: CartLine[]) => groupBy(items, item => item.FulfillmentStoreId);\r\n const getGroupByDelivery = (items: CartLine[]) => groupBy(items, item => item.DeliveryMode);\r\n const groupDelivery = getGroupByDelivery(cartlines);\r\n const cartLinesGroup: CartLine[] = [];\r\n\r\n // 1) Group by store and pick up mode\r\n Object.entries(groupDelivery).forEach(([deliveryType, groupByDeliveryType]) => {\r\n // @ts-ignore\r\n groupDelivery[deliveryType] = getGroupByStorePickup(groupByDeliveryType);\r\n cartLinesGroup.push(getGroupByStorePickup(groupByDeliveryType));\r\n });\r\n\r\n // 2) Create cartlines group\r\n Object.keys(cartLinesGroup).forEach(key => {\r\n const cartLines = cartLinesGroup[key];\r\n Object.keys(cartLines).forEach(index => {\r\n const cartLine = cartLines[index];\r\n const carLineViewProps = assembleCartlines(cartLine, products, props);\r\n if (carLineViewProps !== null) {\r\n reactNodes.push(carLineViewProps);\r\n }\r\n });\r\n });\r\n\r\n return reactNodes;\r\n};\r\n\r\n/**\r\n * CartLine Group component\r\n */\r\nexport const CartLineGroupItems = (props: ICartLineItemsProps) => {\r\n const { products, cartlines } = props;\r\n return _assembleGroupCartlines(cartlines, products, props);\r\n};\r\n","/* tslint:disable: no-duplicate-imports */\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { INodeProps, Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\r\nimport { CartPromotionLine } from '@msdyn365-commerce/retail-proxy';\r\nimport React from 'react';\r\n\r\nexport interface ICartLineItemPromotion {\r\n id: string;\r\n showPromotionPopup: boolean;\r\n promotions: CartPromotionLine[] | undefined;\r\n resources: ICartLineItemPromotionResourceString;\r\n onSeeAllClick(event: React.MouseEvent): void;\r\n onCloseButtonClick(): void;\r\n}\r\n\r\nexport interface ICartLineItemViewProps {\r\n promotionMessageWrapper: INodeProps;\r\n promotionMessage: React.ReactNode;\r\n promotionSeeAllLink: React.ReactElement;\r\n promotionDialog: React.ReactNode;\r\n}\r\n\r\nexport interface ICartLineItemPromotionResourceString {\r\n promotionLinkText: string;\r\n promotionStringHeading: string;\r\n promotionPopupHeading: string;\r\n promotionCloseButtonAriaLabel: string;\r\n}\r\n\r\nexport const cartPromotions = (props: ICartLineItemPromotion): ICartLineItemViewProps | undefined => {\r\n const {\r\n id,\r\n showPromotionPopup,\r\n promotions,\r\n resources: { promotionLinkText, promotionPopupHeading },\r\n onCloseButtonClick,\r\n onSeeAllClick\r\n } = props;\r\n\r\n if (!ArrayExtensions.hasElements(promotions)) {\r\n return;\r\n }\r\n\r\n const titleId = `${id}_title`;\r\n const className = 'msc-cart__promotion';\r\n return {\r\n promotionMessageWrapper: {\r\n className: 'msc-cart__promotion'\r\n },\r\n promotionMessage: (\r\n \r\n \r\n {props.resources.promotionStringHeading}\r\n \r\n ),\r\n promotionSeeAllLink: (\r\n \r\n {' '}\r\n {promotionLinkText}{' '}\r\n \r\n ),\r\n promotionDialog: (\r\n \r\n \r\n
\r\n {promotionPopupHeading}\r\n
\r\n
\r\n \r\n
    \r\n {promotions.map(_promotion => {\r\n return (\r\n
  • \r\n {_promotion.Promotion?.OfferName}{' '}\r\n
  • \r\n );\r\n })}\r\n
\r\n
\r\n \r\n
\r\n )\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\n/* tslint:disable: no-duplicate-imports */\r\nimport { IStoreSelectorStateManager } from '@msdyn365-commerce-modules/bopis-utilities';\r\nimport {\r\n IProductInventoryInformation,\r\n ObjectExtensions,\r\n OrderTemplate\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { Button, getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport {\r\n AddToOrderTemplateComponent,\r\n AddToWishlistComponent,\r\n IAddToOrderTemplateDialogResources,\r\n ICartlineResourceString,\r\n IDuplicateItemsWhenAddingToOrderTemplateDialogResources,\r\n IItemAddedToOrderTemplateDialogResources,\r\n IOrderTemplateNameDialogResources,\r\n IWishlistActionSuccessResult\r\n} from '@msdyn365-commerce/components';\r\nimport { ICoreContext, IGridSettings, IImageSettings, ITelemetry, TelemetryEvent } from '@msdyn365-commerce/core';\r\nimport MsDyn365 from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport { CartLine, ChannelDeliveryOptionConfiguration, CommerceList, Customer, format, LineDataValidationFailure, OrgUnitLocation, ProductDeliveryOptions, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n// Todo : need to import ProductDimensionType later on\r\nimport { CategoryPathResult, ReleasedProductType } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport * as React from 'react';\r\nimport Cookies from 'universal-cookie';\r\n/* VSI customization START */\r\nimport { IMFIBonusCouponsDetail, IMFIBonusItemDetails, IMFIBonusItemsResponse } from '../../../actions/BonusItemDataServiceEntities.g';\r\nimport {IProductWithAttribute} from '../../../data-actions/get-product-attributes-cartlines';\r\nimport { CartLineItemComponent } from '../../../themes/mattressfirm/views/components/cartlineitem.component';\r\nimport { hasArray } from '../../../Utilities/emtpyChecker';\r\nimport { IAttributeValueProduct, ICoreDeliveryByMessage, IProductBonusItems } from '../mfrm-cart';\r\n/* VSI customization END */\r\nimport { IPickUpInStoreViewProps, PickUpInStore } from './mfrm-cart-pick-up-in-store';\r\nimport generateURLForPDP from '../../../Utilities/generateURLforPDP';\r\n\r\nexport interface IBonusItems {\r\n isParent: boolean;\r\n itemId: string | undefined;\r\n productId: string | undefined;\r\n totalBonusProducts?: number;\r\n showButton?: boolean;\r\n children?: IBonusItems[];\r\n}\r\nexport interface ICartLineItemsProps {\r\n cartlines: CartLine[];\r\n cartlinesErrors: LineDataValidationFailure[];\r\n cartState: ICartState | undefined;\r\n orgUnitLocations: OrgUnitLocation[] | undefined;\r\n resources: IOutOfStockMessage;\r\n productAvailabilites: IProductInventoryInformation[] | undefined;\r\n products: SimpleProduct[] | undefined;\r\n productSpecifications: IAttributeValueProduct[];\r\n productCategoryPath: CategoryPathResult[];\r\n productDeliveryOptions: ProductDeliveryOptions[] | undefined;\r\n pickupDeliveryModeCode?: string;\r\n /** GridSettings for the product image in cartline */\r\n gridSettings: IGridSettings;\r\n /** ImageSettings for the product image in cartline */\r\n imageSettings: IImageSettings;\r\n id: string;\r\n typeName: string;\r\n context: ICoreContext;\r\n telemetry: ITelemetry;\r\n removeButtonText: string;\r\n addToWishlistButtonText: string;\r\n removeFromWishlistButtonText: string;\r\n shipItText: string;\r\n pickitUpText: string;\r\n changeStoreText: string;\r\n outOfStockText: string;\r\n /* VSI customization START */\r\n mfrmCtaGiftText?: string;\r\n mfrmBonusModalHeading?: string;\r\n mfrmBonusSubHeading?: string;\r\n mfrmBonusAppliedCodeText?: string;\r\n mfrmAddItemToCartText?: string;\r\n /* VSI customization END */\r\n outOfRangeOneText: string;\r\n outOfRangeFormatText: string;\r\n storeSelectorStateManager: IStoreSelectorStateManager | undefined;\r\n isStockCheckEnabled: boolean;\r\n wishlists: CommerceList[] | undefined;\r\n defaultWishlistName: string;\r\n maxCartlineQuantity: number;\r\n includeErrors?: boolean;\r\n showShippingChargesForLineItems?: boolean;\r\n telemetryContent?: ITelemetryContent;\r\n isQuantityLimitsFeatureEnabled: boolean;\r\n storeSelectorModuleId?: string;\r\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n\r\n addToOrderTemplateDialogResources: IAddToOrderTemplateDialogResources;\r\n createOrderTemplateDialogResources: IOrderTemplateNameDialogResources;\r\n itemAddedToOrderTemplateDialogResources: IItemAddedToOrderTemplateDialogResources;\r\n duplicateItemsWhenAddingToOrderTemplateDialogResources: IDuplicateItemsWhenAddingToOrderTemplateDialogResources;\r\n\r\n addToOrderTemplateButtonText: string;\r\n addToOrderTemplateButtonTooltip: string;\r\n addToOrderTemplateMessage: string;\r\n addItemToOrderTemplateError: string;\r\n orderTemplates: OrderTemplate[] | undefined;\r\n customerInformation: Customer | undefined;\r\n /* VSI customization START */\r\n bonusItemsProductDetails?: IMFIBonusItemsResponse[];\r\n GiftCtaButton?: boolean;\r\n isGiftCoupon?: IMFIBonusCouponsDetail[];\r\n sendState: IProductBonusItems[];\r\n deliveryByMessagesCore: ICoreDeliveryByMessage[];\r\n deliveryByMessageSPDS: ICoreDeliveryByMessage[];\r\n hideDeliveryMessage:boolean;\r\n productAttributes: IProductWithAttribute[] | undefined;\r\n // tslint:disable-next-line\r\n ctaGiftHandler?(cartline: CartLine, context: any): void;\r\n recievedBonusProduct?(productId: number | undefined, bonusItemsProducts: IMFIBonusItemDetails[], productQuantityCount: number): void;\r\n setCartLineItems?(bonusItemsFromModal: IProductBonusItems): void;\r\n // VSI Customization - ends\r\n\r\n removeItemClickHandler(cartlineToRemove: CartLine , url:string): void;\r\n moveToWishlistSuccessHandler(result: IWishlistActionSuccessResult, cartlineId: CartLine): void;\r\n updateCartLinesQuantitySuccessHandler(cartline: CartLine, quantity: number): Promise;\r\n locationChangedHandler(): void;\r\n onEditGift?(): void;\r\n sleepExpertContact: string | undefined;\r\n sleepExpertChat: string | undefined;\r\n pleaseContactExpertForOrder: string | undefined;\r\n}\r\n\r\nexport interface ICartlinesViewProps {\r\n cartline: React.ReactNode;\r\n pickUpInStore?: IPickUpInStoreViewProps;\r\n remove: React.ReactNode;\r\n outOfStock: React.ReactNode;\r\n QuantityMessage: React.ReactNode;\r\n errorDelivery: React.ReactNode;\r\n addToWishlist: React.ReactNode | undefined;\r\n addToOrderTemplate: React.ReactNode | undefined;\r\n bonusItemsProductDetails?: IMFIBonusItemsResponse[];\r\n GiftCtaButton?: boolean;\r\n\r\n error?: string;\r\n\r\n data?: {\r\n product?: SimpleProduct;\r\n cartline: CartLine;\r\n };\r\n}\r\nexport interface IOutOfStockMessage extends ICartlineResourceString {\r\n outOfStockMsgText: string;\r\n removeFromCartText: string;\r\n similarAvailableProductText: string;\r\n removeFromCartTextWithoutBeforeCheckout: string;\r\n homeDeliveryText: string;\r\n itemsQuantityText: string;\r\n // VSI Customization - {#52133}\r\n productAriaText: string;\r\n variantAriaText: string;\r\n promoAriaText: string;\r\n priceAriaText: string;\r\n productPageLinkAriaLabel: string;\r\n discountPercentageAriaText: string;\r\n editGiftCtaText: string;\r\n dialogAriaText: string;\r\n removeButtonAriaText: string;\r\n appliedPromoText: string;\r\n notAppliedPromoText: string;\r\n // VSI Customization - {#52133} End\r\n}\r\n\r\nconst _getProduct = (productId: number | undefined, products?: SimpleProduct[]): SimpleProduct | undefined => {\r\n if (productId !== undefined && products) {\r\n return products.find(product => {\r\n return productId === product.RecordId;\r\n });\r\n }\r\n return undefined;\r\n};\r\n\r\nconst _getCartItemMaxQuantity = (\r\n maxCartlineQuantity: number,\r\n isStockCheckEnabled: boolean,\r\n productAvailability?: IProductInventoryInformation,\r\n productMaxQuantity?: number\r\n) => {\r\n const lineMaxQuantity = productMaxQuantity ? productMaxQuantity : maxCartlineQuantity;\r\n if (isStockCheckEnabled) {\r\n if (\r\n !productAvailability ||\r\n !productAvailability.ProductAvailableQuantity ||\r\n !productAvailability.IsProductAvailable ||\r\n !productAvailability.ProductAvailableQuantity.AvailableQuantity\r\n ) {\r\n return 0;\r\n }\r\n return productAvailability.ProductAvailableQuantity.AvailableQuantity >= lineMaxQuantity\r\n ? lineMaxQuantity\r\n : productAvailability.ProductAvailableQuantity.AvailableQuantity;\r\n }\r\n\r\n return lineMaxQuantity;\r\n};\r\n\r\nconst _getErrorMessage = (\r\n maxQuantity: number,\r\n currentQuantity: number,\r\n props: ICartLineItemsProps,\r\n lineIndex: number,\r\n isServiceItem: boolean\r\n): string | undefined => {\r\n const finalErrorMessage: string[] = [];\r\n if (props.includeErrors) {\r\n if (props.isStockCheckEnabled && !isServiceItem) {\r\n if (maxQuantity <= 0) {\r\n finalErrorMessage.push(props.outOfStockText);\r\n } else if (maxQuantity < currentQuantity) {\r\n if (maxQuantity === 1) {\r\n finalErrorMessage.push(props.outOfRangeOneText);\r\n } else {\r\n finalErrorMessage.push(props.outOfRangeFormatText.replace('{numLeft}', maxQuantity.toString()));\r\n }\r\n }\r\n }\r\n }\r\n\r\n // server-side validation\r\n props.cartlinesErrors\r\n .filter(i => i.LineIndex === lineIndex)\r\n .forEach(i => {\r\n if (i.DataValidationFailure?.ErrorContext) {\r\n finalErrorMessage.push(i.DataValidationFailure.ErrorContext);\r\n }\r\n });\r\n\r\n if (finalErrorMessage.length > 0) {\r\n return finalErrorMessage.join(' ');\r\n }\r\n\r\n return undefined;\r\n};\r\n\r\nconst _findDropShip = (productID: number, productSpecifications: IAttributeValueProduct[]): Boolean => {\r\n const getFilterArray = productSpecifications.find(item => item.VariantRecordId === productID);\r\n return getFilterArray?.outOfStock!;\r\n};\r\n\r\nconst _findQuantityMessage = (productID: number, productSpecifications: IAttributeValueProduct[]): Boolean => {\r\n const getFilterArray = productSpecifications.find(item => item.VariantRecordId === productID);\r\n return getFilterArray?.quantityMessage!;\r\n};\r\n\r\nconst _findDeliveryError = (productID: number, productSpecifications: IAttributeValueProduct[]): Boolean => {\r\n const getFilterArray = productSpecifications.find(item => item.VariantRecordId === productID);\r\n return getFilterArray?.zipCodeError!;\r\n};\r\n\r\nconst _getUrlProductCategory = (productCategoryPath: CategoryPathResult[] , productID: number): String => {\r\n const findCategoryPath = productCategoryPath.find(item => item.ProductId === productID);\r\n const getSegments = findCategoryPath && findCategoryPath.CategoryPath && findCategoryPath.CategoryPath[0]?.Segments;\r\n const pagePath = MsDyn365.isBrowser ? (window.location.origin ? window.location.origin : window.location.origin) : '';\r\n let makeStringURL = pagePath;\r\n getSegments?.forEach((item , index , array) => {\r\n if (index === array.length - 1) {\r\n makeStringURL += `/${item.CategoryName}`;\r\n makeStringURL += `/${item.CategoryId}.c`;\r\n } else {\r\n if(index > 0) {\r\n makeStringURL += `/${item.CategoryName}`;\r\n }\r\n }\r\n });\r\n let newCategory = '';\r\n const nameCategory = makeStringURL?.split('&');\r\n nameCategory.map((item , index) => {\r\n if (index > 0) {\r\n newCategory += `-${item.trim().replace(/\\s/g, '-')}`;\r\n } else {\r\n newCategory += item.trim().replace(/\\s/g, '-');\r\n }\r\n });\r\n return newCategory.toLowerCase();\r\n};\r\n\r\n// tslint:disable:max-func-body-length\r\n// tslint:disable-next-line:cyclomatic-complexity\r\nconst _assembleNode = (\r\n cartline: CartLine,\r\n product: SimpleProduct | undefined,\r\n props: ICartLineItemsProps,\r\n index: number,\r\n foundProductAvailability?: IProductInventoryInformation,\r\n foundProductDeliveryOptions?: ProductDeliveryOptions,\r\n displayAddGiftCta?: boolean)\r\n : ICartlinesViewProps => {\r\n let timer: NodeJS.Timeout;\r\n const { imageSettings, gridSettings, id, typeName, context, resources, removeButtonText,\r\n removeItemClickHandler, moveToWishlistSuccessHandler, addToOrderTemplateButtonText, addToOrderTemplateButtonTooltip,\r\n addToOrderTemplateDialogResources, createOrderTemplateDialogResources,\r\n itemAddedToOrderTemplateDialogResources, duplicateItemsWhenAddingToOrderTemplateDialogResources,\r\n addToWishlistButtonText, removeFromWishlistButtonText, orderTemplates, customerInformation,\r\n wishlists, defaultWishlistName, storeSelectorModuleId, productAttributes } = props;\r\n const isAuthenticated = context.request.user.isAuthenticated;\r\n const nameOfWishlist = wishlists && wishlists.length > 0 && wishlists[0].Name ? wishlists[0].Name : defaultWishlistName;\r\n const maxQuantity =\r\n product &&\r\n _getCartItemMaxQuantity(\r\n props.maxCartlineQuantity,\r\n props.isStockCheckEnabled,\r\n foundProductAvailability,\r\n props.isQuantityLimitsFeatureEnabled ? product.Behavior?.MaximumQuantity : undefined\r\n );\r\n\r\n // check if the product is service or not by product type\r\n const PRODUCTASSERVICE = 2 as ReleasedProductType.Service;\r\n const isServiceItem = product?.ItemTypeValue === PRODUCTASSERVICE;\r\n\r\n const errorMessage = ObjectExtensions.isNullOrUndefined(maxQuantity)\r\n ? undefined\r\n : _getErrorMessage(maxQuantity, cartline.Quantity!, props, index, isServiceItem);\r\n\r\n const onRemoveClickHandler = (event: React.MouseEvent) => { removeItemClickHandler(cartline , ''); };\r\n const payload = getPayloadObject(TelemetryEvent.RemoveFromCart, props.telemetryContent!, removeButtonText, '');\r\n const attributes = getTelemetryAttributes(props.telemetryContent!, payload);\r\n const cookies = new Cookies();\r\n const inventoryLbl = foundProductAvailability?.StockLevelLabel;\r\n const inventoryCode = foundProductAvailability ? `ms-cart-line__inventory-code-${foundProductAvailability.StockLevelCode?.toLowerCase()}` : undefined;\r\n const zipcode = cookies.get('zip_code');\r\n const isCustomPriceSelected = product?.Dimensions?.find(dimension => dimension.DimensionTypeValue === 4)?.DimensionValue?.Value === 'Custom';\r\n const productID = cartline.ProductId;\r\n const {productSpecifications , productCategoryPath} = props;\r\n const checkProductStock = _findDropShip(productID!, productSpecifications);\r\n const quantityValeStock = cartline.Quantity!;\r\n const checkQuantityMessage = _findQuantityMessage(productID!, productSpecifications);\r\n const checkErrorDelivery = _findDeliveryError(productID!, productSpecifications);\r\n const getProductCategoryUrl = _getUrlProductCategory(productCategoryPath , productID!);\r\n const handleRedirect = async () => {\r\n const url = `${getProductCategoryUrl}`;\r\n window.location.href = `${url}`;\r\n };\r\n const productURL = product && generateURLForPDP(product, props.context);\r\n const invalidProductHelpMessageChat = props.pleaseContactExpertForOrder?.split('{chat}');\r\n const invalidProductHelpPhoneNo = invalidProductHelpMessageChat && invalidProductHelpMessageChat[0]?.split('{phone}');\r\n\r\n const phoneNumber = props.sleepExpertContact ? `tel:+${props.sleepExpertContact?.toString()}` : '';\r\n\r\n const _onChatClick = (event: React.SyntheticEvent) => {\r\n event.preventDefault();\r\n timer = setTimeout(function () {\r\n // eslint-disable-next-line no-eval\r\n eval(\r\n `var elems = document.querySelectorAll('.uiButton.helpButtonEnabled, .minimizedContainer.helpButton, .sidebarHeader.minimizedContainer'); if(elems != undefined && elems.length > 0) { if(elems.length > 1){elems[1].click()} else {elems[0].click()}}`\r\n );\r\n // eslint-disable-next-line no-eval\r\n eval(\r\n `document.querySelectorAll('.embeddedServiceHelpButton')?.[0]?.classList.add('show-chat');`\r\n );\r\n }, 1000);\r\n\r\n // @ts-ignore\r\n if (utag) {\r\n // @ts-ignore\r\n // tslint:disable-next-line: object-literal-key-quotes\r\n utag.link({\r\n event: 'chat-widget-initiated',\r\n event_type: 'chat_click',\r\n event_category: 'chat',\r\n event_action: 'click',\r\n event_label: 'chat engagement'\r\n });\r\n }\r\n return () => {\r\n clearTimeout(timer);\r\n };\r\n };\r\n\r\n const _onChatKeyUp = (e: React.KeyboardEvent) => {\r\n if (e.keyCode === 13) {\r\n _onChatClick;\r\n }\r\n };\r\n\r\n return {\r\n data: {\r\n product: product,\r\n cartline: cartline\r\n },\r\n error: errorMessage,\r\n cartline: (\r\n ),\r\n pickUpInStore: product ? (\r\n PickUpInStore({\r\n storeSelectorModuleId: storeSelectorModuleId,\r\n cartState: props.cartState,\r\n cartline: cartline,\r\n product: product,\r\n shipitText: props.shipItText,\r\n pickUpInStoreText: props.pickitUpText,\r\n changeStoreText: props.changeStoreText,\r\n storeSelectorStateManager: props.storeSelectorStateManager,\r\n orgUnitLocations: props.orgUnitLocations,\r\n deliveryOptions: foundProductDeliveryOptions,\r\n pickupDeliveryModeCode: cartline.DeliveryMode !== (undefined || '') ? cartline.DeliveryMode : props.pickupDeliveryModeCode,\r\n locationChangedHandler: props.locationChangedHandler\r\n })\r\n ) : undefined,\r\n outOfStock: checkProductStock ? (\r\n // VSI Customization - {#52133} - Added tabIndex only\r\n
\r\n

{resources.outOfStockMsgText}

\r\n
\r\n

{resources.removeFromCartText}

\r\n
\r\n {resources.similarAvailableProductText}\r\n
\r\n ): undefined,\r\n QuantityMessage : checkQuantityMessage ? (\r\n
\r\n

{format(resources.itemsQuantityText, quantityValeStock)}

\r\n
\r\n ) : undefined,\r\n errorDelivery: checkErrorDelivery ? (\r\n
\r\n

{resources.homeDeliveryText} {zipcode}

\r\n
\r\n

{resources.removeFromCartTextWithoutBeforeCheckout}

\r\n {props.pleaseContactExpertForOrder && invalidProductHelpMessageChat && invalidProductHelpPhoneNo &&\r\n

\r\n {invalidProductHelpPhoneNo[0]}\r\n {invalidProductHelpMessageChat[0]?.includes('{phone}') && {props.sleepExpertContact?.toString()}}\r\n {invalidProductHelpPhoneNo[1] && invalidProductHelpPhoneNo[1]}\r\n {props.pleaseContactExpertForOrder?.includes('{chat}') && {props.sleepExpertChat?.toString()}}\r\n {invalidProductHelpMessageChat[1] && invalidProductHelpMessageChat[1]}\r\n

\r\n }\r\n
\r\n {resources.similarAvailableProductText}\r\n
\r\n ): undefined,\r\n remove: (\r\n \r\n ),\r\n addToWishlist:\r\n isAuthenticated && product && !isCustomPriceSelected ? (\r\n \r\n ) : (\r\n undefined\r\n ),\r\n addToOrderTemplate:\r\n isAuthenticated && orderTemplates && product && !isCustomPriceSelected ? (\r\n \r\n ) : (\r\n undefined\r\n )\r\n };\r\n};\r\n\r\nconst _getBonusItemDetails = (): IBonusItems[] => {\r\n if(!MsDyn365.isBrowser) {\r\n return[];\r\n }\r\n const getLocalStorage = localStorage.getItem('BonusItemProduct');\r\n let bonusItemArray: IMFIBonusItemsResponse[] = [];\r\n const bonusItemsParent: IBonusItems[] = [];\r\n if (getLocalStorage) {\r\n const localStorageBonusInfo = getLocalStorage && JSON.parse(getLocalStorage);\r\n // get bonus item array from localstorage\r\n if(!hasArray(localStorageBonusInfo)) {\r\n if(localStorageBonusInfo && hasArray(localStorageBonusInfo.BonusItemsDetails)) {\r\n bonusItemArray = [localStorageBonusInfo];\r\n }\r\n } else {\r\n bonusItemArray = localStorageBonusInfo;\r\n }\r\n hasArray(bonusItemArray)?.map((bonusitemdetail: IMFIBonusItemsResponse) => {\r\n bonusitemdetail.BonusItemsDetails?.map(bonusitem => {\r\n bonusitem.Items?.map(item => {\r\n const temp: IBonusItems[] = [];\r\n let count = 0;\r\n item.BonusItems &&\r\n item.BonusItems.map(bonus => {\r\n const child = {\r\n isParent: false,\r\n itemId: bonus.BonusItemId,\r\n productId: bonus.BonusProductId\r\n };\r\n count = count + 1;\r\n temp.push(child);\r\n });\r\n const product = {\r\n isParent: true,\r\n itemId: item.QualifyingItemId,\r\n productId: item.QualifyingProductId,\r\n totalBonusProducts: item.BonusProductQty,\r\n children: temp\r\n };\r\n if (bonusItemsParent.length === 0) {\r\n bonusItemsParent.push(product);\r\n } else {\r\n bonusItemsParent.map(parent => {\r\n if (parent.itemId !== item.QualifyingItemId) {\r\n bonusItemsParent.push(product);\r\n }\r\n });\r\n }\r\n });\r\n });\r\n });\r\n }\r\n return bonusItemsParent;\r\n};\r\nexport const assembleCartlines = (\r\n cartlines: CartLine[],\r\n products: SimpleProduct[] | undefined,\r\n props: ICartLineItemsProps\r\n): ICartlinesViewProps[] | null => {\r\n const couponsApplied =\r\n props.cartState && props.cartState?.cart && props.cartState?.cart?.Coupons && props.cartState?.cart?.Coupons.length;\r\n const reactNodes: ICartlinesViewProps[] = [];\r\n const bonusItemDetails = _getBonusItemDetails();\r\n cartlines.map((cartline, index) => {\r\n let showAddCTAButton = false;\r\n const parentInCart = bonusItemDetails.find(bonusLineItem => cartline?.ProductId && cartline?.ProductId.toString() === bonusLineItem.productId);\r\n if(parentInCart !== undefined && parentInCart.children !== undefined && !parentInCart.showButton) {\r\n let checkAtLeastOneBonusLineAdded = 0;\r\n parentInCart.children && parentInCart.children.map((childBonusLine: IBonusItems) => {\r\n const childInCart = parentInCart.children && cartlines.find(lineItem => lineItem.ProductId && childBonusLine && lineItem?.ProductId.toString() === childBonusLine.productId);\r\n if(childInCart !== undefined && couponsApplied && couponsApplied > 0) {\r\n checkAtLeastOneBonusLineAdded = checkAtLeastOneBonusLineAdded + 1;\r\n }\r\n });\r\n if(parentInCart.totalBonusProducts === checkAtLeastOneBonusLineAdded && couponsApplied && couponsApplied > 0) {\r\n showAddCTAButton = false;\r\n parentInCart.showButton = false;\r\n } else if(couponsApplied && couponsApplied > 0) {\r\n showAddCTAButton = true;\r\n parentInCart.showButton = true;\r\n }\r\n }\r\n const product = _getProduct(cartline.ProductId, products);\r\n let foundProductAvailability: IProductInventoryInformation | undefined;\r\n if (props.productAvailabilites && props.productAvailabilites.length > 0) {\r\n foundProductAvailability = props.productAvailabilites.find(productAvailability => {\r\n return (\r\n productAvailability.ProductAvailableQuantity?.ProductId === cartline.ProductId &&\r\n productAvailability.InventLocationId === cartline.WarehouseId\r\n );\r\n });\r\n }\r\n let foundProductDeliveryOption: ProductDeliveryOptions | undefined;\r\n if (props.productDeliveryOptions && props.productDeliveryOptions.length > 0) {\r\n foundProductDeliveryOption = props.productDeliveryOptions.find(deliveryOption => {\r\n return deliveryOption && deliveryOption.ProductId === cartline.ProductId;\r\n });\r\n }\r\n // if (props.productSpecifications?.length) {\r\n // props.productSpecifications.map((item) => {\r\n // if (item.VariantRecordId === cartline.ProductId) {\r\n // if (item.outOfStock) {\r\n // reactNodes.unshift(_assembleNode(cartline, product, props, index, foundProductAvailability, foundProductDeliveryOption, showAddCTAButton));\r\n // } else {\r\n // reactNodes.push(_assembleNode(cartline, product, props, index, foundProductAvailability, foundProductDeliveryOption, showAddCTAButton));\r\n // }\r\n // } else {\r\n // reactNodes.push(_assembleNode(cartline, product, props, index, foundProductAvailability, foundProductDeliveryOption, showAddCTAButton));\r\n // }\r\n // });\r\n // } else {\r\n reactNodes.push(_assembleNode(cartline, product, props, index, foundProductAvailability, foundProductDeliveryOption, showAddCTAButton));\r\n // }\r\n });\r\n\r\n return reactNodes;\r\n};\r\n\r\n/**\r\n * CartLineItems component\r\n */\r\nexport const CartLineItems = (props: ICartLineItemsProps) => {\r\n const { products, cartlines } = props;\r\n return assembleCartlines(cartlines, products, props);\r\n};\r\n","/* tslint:disable: no-duplicate-imports */\r\nimport { IStoreSelectorStateManager } from '@msdyn365-commerce-modules/bopis-utilities';\r\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport { CartLine, OrgUnitLocation, ProductDeliveryOptions, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport * as React from 'react';\r\n\r\nexport interface IPickUpInStoreViewProps {\r\n callbacks: {\r\n toggleBopis(isBopisSelected: boolean): void;\r\n };\r\n defaultComponent?: React.ReactNode;\r\n orgUnitName?: string;\r\n isBopisSelected: boolean;\r\n ContainerProps: INodeProps;\r\n deliveryOption?: string;\r\n}\r\n\r\nexport interface IPickUpInStoreProps {\r\n cartline: CartLine;\r\n product: SimpleProduct;\r\n shipitText: string;\r\n pickUpInStoreText: string;\r\n changeStoreText: string;\r\n cartState: ICartState | undefined;\r\n storeSelectorStateManager: IStoreSelectorStateManager | undefined;\r\n orgUnitLocations?: OrgUnitLocation[] | undefined;\r\n deliveryOptions?: ProductDeliveryOptions;\r\n pickupDeliveryModeCode?: string;\r\n storeSelectorModuleId?: string;\r\n locationChangedHandler(): void;\r\n}\r\n\r\n// tslint:disable-next-line:max-func-body-length\r\nexport const PickUpInStore = (props: IPickUpInStoreProps): IPickUpInStoreViewProps | undefined => {\r\n const _onLocationChangedCallback = (\r\n orgUnitLocation: OrgUnitLocation,\r\n cartState: ICartState | undefined,\r\n cartline: CartLine,\r\n deliveryMode?: string\r\n ) => {\r\n if (!cartState) {\r\n return Promise.resolve();\r\n }\r\n return cartState\r\n .updateCartLinePickupLocation({ cartLineId: cartline.LineId!, location: orgUnitLocation, deliveryMode })\r\n .then(result => {\r\n if (result.status === 'SUCCESS') {\r\n props.locationChangedHandler();\r\n }\r\n })\r\n .catch(error => {\r\n return;\r\n });\r\n };\r\n\r\n const _toggleBOPIS = (isBopisSelected: boolean) => {\r\n const { storeSelectorStateManager, product, cartline, cartState, storeSelectorModuleId } = props;\r\n\r\n if (isBopisSelected) {\r\n if (!storeSelectorStateManager) {\r\n return;\r\n }\r\n storeSelectorStateManager\r\n .openDialog({\r\n id: storeSelectorModuleId,\r\n product,\r\n alreadySelectedLocation: {\r\n OrgUnitNumber: cartline.FulfillmentStoreId\r\n },\r\n deliveryOptions: props.deliveryOptions,\r\n onLocationSelected: (orgUnitLocation, deliveryMode: string | undefined) => {\r\n return _onLocationChangedCallback(orgUnitLocation, cartState, cartline, deliveryMode);\r\n }\r\n })\r\n .catch(error => {\r\n return;\r\n });\r\n } else {\r\n if (!cartState) {\r\n return;\r\n }\r\n cartline.DeliveryMode = '';\r\n cartline.FulfillmentStoreId = '';\r\n cartline.ShippingAddress = {};\r\n cartState\r\n .clearCartLinePickupLocation({ cartLineId: cartline.LineId! })\r\n .then(result => {\r\n if (result.status === 'SUCCESS') {\r\n props.locationChangedHandler();\r\n }\r\n })\r\n .catch(error => {\r\n return;\r\n });\r\n }\r\n };\r\n\r\n const _getOrgUnitName = (fulfillmentStoreId: string | undefined, orgUnitLocations: OrgUnitLocation[] | undefined) => {\r\n if (!orgUnitLocations || !fulfillmentStoreId || !(orgUnitLocations.length > 0)) {\r\n return '';\r\n }\r\n\r\n const foundLocation = orgUnitLocations.find(orgUnitLocation => {\r\n return orgUnitLocation.OrgUnitNumber === fulfillmentStoreId;\r\n });\r\n\r\n if (foundLocation) {\r\n return foundLocation.OrgUnitName;\r\n } else {\r\n return fulfillmentStoreId;\r\n }\r\n };\r\n\r\n const _renderShippingMethod = (\r\n cartLine: CartLine,\r\n shipItText: string,\r\n pickupInStoretext: string,\r\n changeStoreText: string,\r\n orgUnitLocations: OrgUnitLocation[] | undefined\r\n ): JSX.Element => {\r\n const orgUnitName = _getOrgUnitName(cartLine.FulfillmentStoreId, orgUnitLocations);\r\n const bopisSelected = cartLine.FulfillmentStoreId ? true : false;\r\n\r\n const toggleBOPIS = (isBopisSelected: boolean) => {\r\n return () => _toggleBOPIS(isBopisSelected);\r\n };\r\n\r\n return (\r\n <>\r\n \r\n \r\n {cartLine.FulfillmentStoreId ? (\r\n
\r\n {orgUnitName}\r\n \r\n
\r\n ) : null}\r\n \r\n );\r\n };\r\n\r\n const _getDeliveryOption = (pickupStore: IPickUpInStoreProps, deliveryOptions: ProductDeliveryOptions) => {\r\n const delivery = deliveryOptions?.DeliveryOptions?.find(option => option.Code === pickupStore.pickupDeliveryModeCode);\r\n return delivery?.Description;\r\n };\r\n\r\n // If no delivery options present on the product, or none of the delivery options\r\n // match the PickupDeliveryModeCode, that means the item cannot be used for BOPIS\r\n if (\r\n !props.deliveryOptions ||\r\n !props.deliveryOptions.DeliveryOptions ||\r\n !props.pickupDeliveryModeCode ||\r\n !props.deliveryOptions.DeliveryOptions.find(option => option.Code === props.pickupDeliveryModeCode)\r\n ) {\r\n return undefined;\r\n }\r\n\r\n return {\r\n callbacks: {\r\n toggleBopis: _toggleBOPIS\r\n },\r\n defaultComponent: _renderShippingMethod(\r\n props.cartline,\r\n props.shipitText,\r\n props.pickUpInStoreText,\r\n props.changeStoreText,\r\n props.orgUnitLocations\r\n ),\r\n orgUnitName: _getOrgUnitName(props.cartline.FulfillmentStoreId, props.orgUnitLocations),\r\n isBopisSelected: props.cartline.FulfillmentStoreId ? true : false,\r\n deliveryOption: _getDeliveryOption(props, props.deliveryOptions),\r\n ContainerProps: {\r\n className: 'msc-cart-line__bopis-container'\r\n }\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 classnames from 'classnames';\r\nimport { reaction } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport dayjs, { Dayjs } from 'dayjs';\r\nimport React from 'react';\r\n/* VSI customization START */\r\nimport Cookies from 'universal-cookie';\r\n/* tslint:disable: no-duplicate-imports */\r\nimport { ArrayExtensions, getFallbackImageUrl } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n addThrottledEvent, Alert, Button, getPayloadObject, getTelemetryAttributes, getTelemetryObject,\r\n INodeProps, IPayLoad, ITelemetryContent, Node, TelemetryConstant, Waiting\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport {\r\n IAddToOrderTemplateDialogResources, IDuplicateItemsWhenAddingToOrderTemplateDialogResources,\r\n IItemAddedToOrderTemplateDialogResources, ILinesAddedToOrderTemplateDialogResources,\r\n IOrderTemplateNameDialogResources, IWishlistActionSuccessResult,\r\n SaveCartToOrderTemplateComponent\r\n} from '@msdyn365-commerce/components';\r\nimport MsDyn365, {\r\n getUrlSync, IAny, ICoreContext, IGeneric, IImageSettings, RichTextComponent\r\n} from '@msdyn365-commerce/core'; // 22192 MsDyn365\r\nimport { getCartState, ICartActionResult, ICartState } from '@msdyn365-commerce/global-state';\r\nimport {\r\n AsyncResult, AttributeValue, CartLine, CartLineValidationResults, LineDataValidationFailure\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n addCartLinesAsync, updateCartLinesAsync,\r\n validateForCheckoutAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\r\nimport {\r\n getAttributeValuesAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport {\r\n getAddressFromZipCodeAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\r\nimport {\r\n CategoryPathResult, LineDeliverySpecification, ReleasedProductType, SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n// import { BonusCouponDetailsInput } from '../../actions/bonus-coupon-details.action';\r\n/* VSI customization START */\r\nimport {\r\n IMFIBonusCouponsDetail, IMFIBonusItemDetails, IMFIBonusItemsResponse,\r\n IMFIGetBonusCouponsDetailsResponse, IMFIGetBonusItemsParameters\r\n} from '../../actions/BonusItemDataServiceEntities.g';\r\nimport {\r\n GetCategoryPathsInput, getProductsCategoryPathsAction\r\n} from '../../actions/get-mfrm-products-category-paths.action';\r\nimport { GetRecycleFeeCheckoutInput } from '../../actions/get-recycle-fee-checkout.action';\r\nimport { CartDataInfoInput, ICartProductInfo } from '../../data-actions/cart-state-sharing-action';\r\nimport {\r\n AttributesForSelectedVariantInput, getAttributesForCartLineItems, // , IProductWithAttribute\r\n IProductWithAttribute\r\n} from '../../data-actions/get-product-attributes-cartlines';\r\nimport { PromoCodeComponent } from '../../themes/mattressfirm/views/components/promocode.component';\r\nimport { callUtagLink, callUtagView } from '../../Utilities/analytics/utagCaller';\r\nimport { getSetProductData, getSetProductSpec, getSetBonusItemProd, getSetSelectedBonasItem, getSetBonusCouponDetail, getSetPrevBonasModalState, getSetBonusItemBrandName, IMFRMDateGroupedProducts, getSetDateGroupedProducts } from '../../Utilities/cart-utils';\r\nimport { cartOperationDoRetry, updateCartLineDeliverySpecificationsInternal } from '../../Utilities/doRetryCallBack';\r\nimport { hasArray } from '../../Utilities/emtpyChecker';\r\nimport { getBlockZipCodeMessage } from '../../Utilities/get-block-message';\r\nimport { _getBonusCouponsDetails, _getMFIGetBonusItems } from '../../Utilities/get-bonus-items';\r\nimport _getInventoryQuantity from '../../Utilities/get-inventory-quantity';\r\nimport _getViewPort from '../../Utilities/get-view-port';\r\nimport { IOrderSummaryLines, OrderSummary } from '../../Utilities/order-summary-lineitem';\r\nimport { IBrandListData } from '../mfrm-buybox/mfrm-buybox.view';\r\n/* VSI customization END */\r\nimport { CartLineGroupItems } from './components/mfrm-cart-line-groups';\r\nimport { CartLineItems, ICartlinesViewProps } from './components/mfrm-cart-line-items';\r\nimport {\r\n cartPromotions, ICartLineItemViewProps\r\n} from './components/mfrm-cart-line-items-promotion';\r\nimport { IMfrmCartData } from './mfrm-cart.data';\r\nimport { IMfrmCartProps, IMfrmCartResources } from './mfrm-cart.props.autogenerated';\r\nimport { IDeliveryProps } from './mfrm-cart.view';\r\nimport {\r\n _coreProductATPCall, getSetBasketCookie, IBasketCookie, reshuffleItems, isOneOfChildBonusCoupons, setTealiumCartVariables\r\n} from './utils/cart-utils';\r\nimport { getProductUrlSync } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getPromotionData, IPromotionData } from './utils/get-promotion-in-mfrm-cart';\r\nimport { PromoCodeAppliedOnCartInput } from '../../data-actions/promocode-applied-in-progress.action';\r\nimport { TriggerSpecialSynchronyFinancingInput } from '../../actions/trigger-special-synchrony-financing.action';\r\nimport { parseBrandName } from '../../Utilities/get-product-brand';\r\nimport { oneYearFromNow } from '../../Utilities/one-year-from-now';\r\nimport { MFIbonusitemsInput } from '../../data-actions/mfrm-mfi-bonusitem.action';\r\nimport { getGeoLocationZipCode } from '../../Utilities/get-zipcode';\r\nexport interface ICartViewProps extends IMfrmCartProps {\r\n className: string;\r\n title?: React.ReactNode;\r\n CartlinesWrapper: INodeProps;\r\n cartlines?: ICartlinesViewProps[];\r\n cartLinesGroup?: ICartlinesViewProps[][];\r\n cart: ICartState | undefined;\r\n orderSummaryHeading: React.ReactNode;\r\n orderSummaryLineitems?: IOrderSummaryLines;\r\n OrderSummaryWrapper: INodeProps;\r\n OrderSummaryItems: INodeProps;\r\n OrderSummaryErrors?: IOrderSummaryErrors;\r\n checkoutAsGuestButton: React.ReactNode;\r\n checkoutAsSignInUserButton: React.ReactNode;\r\n storeSelector?: React.ReactNode;\r\n backToShoppingButton: React.ReactNode;\r\n waitingComponent: React.ReactNode;\r\n promotionOptions?: ICartLineItemViewProps;\r\n promoCode: React.ReactNode;\r\n cartLoadingStatus: string;\r\n cartDataResult: boolean;\r\n mulitplePickUpEnabled?: boolean;\r\n createTemplateFromCartButton: React.ReactNode;\r\n telemetryContent?: ITelemetryContent;\r\n isTabletView: boolean;\r\n _renderUpdateZipCode: JSX.Element;\r\n _productDetails: IProductTealiums;\r\n disableCheckoutButtonState: boolean;\r\n showDeliveryStepper: boolean;\r\n // VSI Customization 52133\r\n showRemoveNotification?: boolean;\r\n showProductTitle?: string;\r\n isMobile: boolean;\r\n isDesktop: boolean;\r\n calculateTaxOnCart?: boolean;\r\n onOrderSummaryZipcodeClick(): void;\r\n handleTealiumClick(): void;\r\n removeItemClickHandler(cartlineToRemove: CartLine, url?: string): void;\r\n moveToWishlistSuccessHandler(result: IWishlistActionSuccessResult, cartlineId: CartLine): void;\r\n}\r\n\r\nexport interface IOrderSummaryErrors {\r\n Wrapper: INodeProps;\r\n\r\n header: React.ReactNode;\r\n errors: React.ReactNode[];\r\n}\r\n\r\nexport interface ICartWithStatus {\r\n cart: ICartState | undefined;\r\n status: string;\r\n}\r\n\r\nexport interface IAttributeValueProduct extends AttributeValue {\r\n VariantRecordId?: number;\r\n Quantity?: number;\r\n ItemId?: string;\r\n leadTimeVal?: string;\r\n brandLeadTime?: string;\r\n outOfStock?: boolean;\r\n zipCodeError?: boolean;\r\n outOfStockSmallParcel?: boolean;\r\n availableQuantity?: number;\r\n categoryName?: string;\r\n revenueCategory?: string;\r\n quantityMessage?: boolean;\r\n\r\n}\r\n\r\nexport interface ICoreDeliveryByMessage {\r\n itemID: string;\r\n variantID: string;\r\n deliveryByMessage: string;\r\n daySpan?: string;\r\n locationId?: string;\r\n}\r\nexport interface ICartComponentState {\r\n mattressRecyclingFee: number | string;\r\n showPromotionDialog: boolean;\r\n cartlinesErrors: LineDataValidationFailure[];\r\n promotionData: IPromotionData;\r\n isTablet: boolean;\r\n cartRender?: boolean;\r\n showProductModal: boolean;\r\n addCtaGift: boolean;\r\n selectedBonusItems: IProductBonusItems[];\r\n ctaGiftButtonBoolean: boolean;\r\n isInput: boolean;\r\n isOrderSummaryZipCodeClicked: boolean;\r\n newZipCode: string;\r\n showZipCodeDelivery: string;\r\n showError: boolean;\r\n errorZipCode: string;\r\n showFindStore: boolean;\r\n disableCheckoutButton: boolean;\r\n productSpecifications: IProductDetails[];\r\n productCategoryPath: CategoryPathResult[];\r\n deliveryByMessagesCore: ICoreDeliveryByMessage[];\r\n deliveryByMessageSPDS: ICoreDeliveryByMessage[];\r\n productDetails: IProductDetails[];\r\n oomZipCode: boolean;\r\n showDeliveryStepper: boolean;\r\n previousBonasModal: IProductBonusItems[];\r\n currCartState?: ICartState;\r\n // VSI Customization 52133\r\n showRemoveNotification?: boolean;\r\n showProductTitle?: string;\r\n buttonDisabled?: boolean;\r\n isMobile?: boolean;\r\n isDesktop?: boolean;\r\n isBonusItemProductUpdated?: boolean;// Bug 71000 - Set true when BonusItemProduct value is being set\r\n // Store small parcel location in state\r\n smallParcelLocationDetails?: IProductLocationDetails[];\r\n productAttributes?: IProductWithAttribute[];\r\n pageCount: number;\r\n}\r\n// Small parcel locations\r\nexport interface IProductLocationDetails {\r\n itemId?: string;\r\n productId?: string;\r\n location?: string;\r\n}\r\n\r\nexport interface IProductBonusItems {\r\n parentId: number | undefined;\r\n children: IMFIBonusItemDetails[];\r\n}\r\n\r\nexport interface IProductBonusWithBrandName {\r\n productId: number | undefined;\r\n brandName: string;\r\n}\r\n\r\nexport interface IRevenueDetails {\r\n Name: string;\r\n CategoryName: string;\r\n}\r\n\r\nexport interface IProductTealiums {\r\n quantity?: string,\r\n subTotal?: string,\r\n productQuantity?: string[],\r\n productSize?: string[],\r\n productIDsArray?: string[],\r\n productNameArray?: string[],\r\n productPriceArray?: string[],\r\n cartProductPriceArray?: string[],\r\n variantRecord?: string[],\r\n productImageUrl?: string[],\r\n cartUrl?: string[]\r\n siteCookie?: string;\r\n productURL?: string;\r\n productCatgoryArray?: string;\r\n productBrandName?: string;\r\n productDiscountArray?: string;\r\n isCoreItem?: string;\r\n funnelType?: string;\r\n}\r\n\r\nexport interface IProductDetails {\r\n typeOfProduct: string;\r\n VariantRecordId: number;\r\n outOfStock: boolean;\r\n Quantity: number;\r\n ItemId: string;\r\n leadTimeVal?: string;\r\n brandLeadTime?: string;\r\n ProducName?: string;\r\n MasterProductId?: number;\r\n zipCodeError?: boolean;\r\n outOfStockSmallParcel?: boolean;\r\n availableQuantity?: number;\r\n categoryName?: string;\r\n revenueCategory?: string;\r\n name: string;\r\n variantType: string;\r\n primaryImageUrl: string;\r\n fallbackImageUrl: string;\r\n quantityMessage: boolean;\r\n netPrice?: number;\r\n netAmountWithoutTax?: number;\r\n price?: number;\r\n discountedAmount?: number;\r\n brandName?: string;\r\n variantIDString?: string;\r\n brandAndProductName?: string;\r\n InventLocationId?: string;\r\n DeliveryDate?: string;\r\n deliveryTime?: string;\r\n RequestedDeliveryDate?: string;\r\n collection?: string;\r\n}\r\n\r\n/**\r\n *\r\n * Cart component\r\n * @extends {React.PureComponent>}\r\n */\r\n@observer\r\nclass Cart extends React.Component, ICartComponentState> {\r\n /* VSI customization START */\r\n public globalBonusItems: IMFIBonusItemsResponse[] = [];\r\n public callFirstTime: boolean = false;\r\n public ctaGiftButton: boolean = false;\r\n public isGiftCoupon: IMFIBonusCouponsDetail[] = [];\r\n public getCoupons: IMFIGetBonusCouponsDetailsResponse[] = [];\r\n /* VSI customization END */\r\n private telemetryContent: ITelemetryContent;\r\n private payLoad: IPayLoad;\r\n private isQuantityLimitsFeatureEnabled: boolean = false;\r\n private readonly promotionPopupId: string = 'cart-promotion-popup';\r\n private resizeThrottledEventHandler?: (event: Event) => void;\r\n private coreProdLatestDelMsg: string = '';\r\n private timer: NodeJS.Timeout | null;\r\n\r\n constructor(props: IMfrmCartProps) {\r\n super(props);\r\n this.state = {\r\n cartlinesErrors: [],\r\n showPromotionDialog: false,\r\n promotionData: {},\r\n isTablet: false,\r\n cartRender: false,\r\n showProductModal: false,\r\n addCtaGift: false,\r\n selectedBonusItems: [],\r\n ctaGiftButtonBoolean: false,\r\n isInput: false,\r\n isOrderSummaryZipCodeClicked: false,\r\n newZipCode: '',\r\n showZipCodeDelivery: '',\r\n showError: false,\r\n errorZipCode: '',\r\n showFindStore: false,\r\n disableCheckoutButton: false,\r\n productSpecifications: [],\r\n productCategoryPath: [],\r\n deliveryByMessagesCore: [],\r\n deliveryByMessageSPDS: [],\r\n productDetails: [],\r\n oomZipCode: false,\r\n mattressRecyclingFee: this.props.resources.yetToBeCalculatedText,\r\n showDeliveryStepper: false,\r\n previousBonasModal: [],\r\n showRemoveNotification: false,\r\n showProductTitle: '',\r\n buttonDisabled: true,\r\n isBonusItemProductUpdated: false,\r\n productAttributes: this.props.data.productAttributes.result,\r\n pageCount: 0\r\n };\r\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!, this.props.friendlyName, this.props.telemetry);\r\n this.payLoad = getPayloadObject('click', this.telemetryContent, '');\r\n this.promotionLinkClick = this.promotionLinkClick.bind(this);\r\n this.promotionCloseButtonclick = this.promotionCloseButtonclick.bind(this);\r\n this.timer = null;\r\n }\r\n\r\n public async componentWillMount() {\r\n // tslint:disable-next-line: no-floating-promises\r\n void this.tealiumCallOnViewCart(this.props.data.products).then();\r\n }\r\n // VSI Customization {52133} temp disabled max-func-body-length\r\n // tslint:disable-next-line:max-func-body-length\r\n public async componentDidMount(): Promise {\r\n const {\r\n config: config,\r\n context: {\r\n actionContext: actionContext,\r\n request\r\n }\r\n } = this.props;\r\n const cookies = new Cookies();\r\n cookies.remove('cInfo_city');\r\n const zipcode = cookies.get('zip_code');\r\n const qtys = request.query?.qtys?.split(',');\r\n const pIds = request.query?.pids?.split(',');\r\n /* eslint-disable @typescript-eslint/no-floating-promises */\r\n !request.user.isAuthenticated && this.addLastAddedItemsIfCartEmpty();\r\n cookies.set('current_step', -1);\r\n cookies.set(`payment_review_dropship_latest_del_msg`, '', { path: '/' });\r\n cookies.set(`payment_review_parcel_latest_del_msg`, '', { path: '/' });\r\n cookies.set(`payment_review_latest_core_prod_msg`, '', { path: '/' });\r\n this.resetPromoStorageIfCartExpired();\r\n /* VSI customization START */\r\n const getLocalStorage = getSetSelectedBonasItem('get');\r\n // const getLocalStorage = localStorage.getItem('selectedBonasItems');\r\n /* VSI customization END*/\r\n let bonusItemArray: IProductBonusItems[] = [];\r\n if (getLocalStorage) {\r\n bonusItemArray = getLocalStorage;\r\n }\r\n getSetProductData('set', []);\r\n /* VSI customization START */\r\n getSetProductSpec('set', []);\r\n // localStorage.setItem('product_specification', '');\r\n /* VSI customization END*/\r\n const defaultZipCode = getGeoLocationZipCode(actionContext) || '';\r\n const directZipCode = zipcode || defaultZipCode;\r\n this.setState({ newZipCode: zipcode || defaultZipCode, showZipCodeDelivery: zipcode || defaultZipCode });\r\n if (qtys && pIds) {\r\n await this.addCartFromUrl();\r\n } else {\r\n const specifications = await this.getProductsSpecifications(this.props);\r\n this.setState({\r\n productSpecifications: specifications,\r\n selectedBonusItems: bonusItemArray\r\n });\r\n this._getStateFromZipCode(this.props, directZipCode, true);\r\n }\r\n this.setState({\r\n selectedBonusItems: bonusItemArray\r\n });\r\n\r\n this.isQuantityLimitsFeatureEnabled = await this._getOrderQuantityLimitsFeatureFlag();\r\n if (this.isQuantityLimitsFeatureEnabled) {\r\n await this._validateCart();\r\n }\r\n\r\n if (config.showAvailablePromotions) {\r\n if (this.props.data.cart.result?.cart.CartLines) {\r\n this.setState({ promotionData: await getPromotionData(actionContext) });\r\n }\r\n\r\n reaction(\r\n () => this.props.data.cart.result?.cart.CartLines,\r\n async () => {\r\n this.setState({ promotionData: await getPromotionData(actionContext) });\r\n }\r\n );\r\n }\r\n /* VSI customization START */\r\n reaction(\r\n () => this.props.data.cart.result?.cart.Coupons,\r\n async () => {\r\n /* VSI customization START */\r\n const getBonasItemProduct: string | null = getSetBonusItemProd('get');\r\n // const getBonasItemProduct: string | null = localStorage.getItem('BonusItemProduct');\r\n /* VSI customization END*/\r\n if (getBonasItemProduct === null || getBonasItemProduct === undefined) {\r\n this.props.data.cart.result?.cart.Coupons && this.props.data.cart.result.cart.Coupons?.length > 0 ? this._checkPromoCode(this.props) : '';\r\n this.callFirstTime = true;\r\n }\r\n }\r\n );\r\n reaction(\r\n () => this.props.data.userDefinedPromoCode.result?.userDefinedPromos,\r\n async () => {\r\n if (this.props.data.userDefinedPromoCode.result && this.props.data.userDefinedPromoCode.result?.userDefinedPromos && this.props.data.userDefinedPromoCode.result?.userDefinedPromos.length > 0) {\r\n await this._validateCart();\r\n this._checkPromoCode(this.props);\r\n const addedProds = getSetProductData('get');\r\n // VSI Customization {52133} temp disabled no-floating-promises\r\n // tslint:disable-next-line: no-floating-promises\r\n this.checkSmallParcelOutOfStock(addedProds, this.props.context);\r\n }\r\n }\r\n );\r\n\r\n reaction(\r\n () => this.props.data.productAttributes.result,\r\n async () => {\r\n const specificationsData = await this.getProductsSpecifications(this.props);\r\n this.setState({\r\n productSpecifications: specificationsData\r\n });\r\n const categoryPath = await this.getProductsCategoryPath(this.props, specificationsData);\r\n this.setState({\r\n productCategoryPath: categoryPath\r\n });\r\n const cookies = new Cookies();\r\n const zip = cookies.get(`zip_code`);\r\n this._getStateFromZipCode(this.props, zip || directZipCode, true);\r\n }\r\n );\r\n if (MsDyn365.isBrowser) {\r\n this.resizeThrottledEventHandler = addThrottledEvent(window, 'resize', () => this.updateViewPort(this.props.context));\r\n }\r\n this.updateViewPort(this.props.context);\r\n this._addGiftCta();\r\n // tslint:disable-next-line: no-floating-promises\r\n this.updateCartDataSharing();\r\n // Resetting phone number\r\n cookies.set('customer_phone', '');\r\n cookies.set('selected_delivery_service', -2);\r\n // const cartState = await getCartState(this.props.context.actionContext);\r\n // this.setState({currCartState: cartState, showRemoveNotification: false});\r\n this.setState({ showRemoveNotification: false, showProductTitle: '' });\r\n const showProductData = getSetProductData('get');\r\n showProductData.map((item: IProductDetails) => {\r\n if (item.brandName === 'Beautyrest' && (item.collection === 'Beyond' || item.collection === 'Beyond Hybrid')) {\r\n this.props.context.actionContext.update(new TriggerSpecialSynchronyFinancingInput(), { triggerSpecialFinancing: true });\r\n }\r\n });\r\n this._getAllCoupons(this.props);\r\n if (MsDyn365.isBrowser) {\r\n const cookie = new Cookies();\r\n cookie.set(`checkoutCurrentStep`, -1);\r\n }\r\n /* VSI customization END */\r\n }\r\n\r\n public async componentDidUpdate(): Promise {\r\n const {\r\n data: {\r\n cart: { result }\r\n },\r\n context: {\r\n app: { config }\r\n }\r\n } = this.props;\r\n let isCoreItem: string;\r\n let funnelType: string;\r\n const isCheckCore = this.coreProductAvailable();\r\n if (isCheckCore) {\r\n isCoreItem = \"true\";\r\n funnelType = \"full funnel\";\r\n } else {\r\n isCoreItem = \"false\";\r\n funnelType = \"no core item\";\r\n }\r\n const cartLinesData = result?.cart.CartLines;\r\n const isCartEmpty = cartLinesData && cartLinesData.length === 0;\r\n const quantity = `${result?.cart.TotalItems}`;\r\n const subTotal = `${result?.cart.SubtotalAmount}`;\r\n const productQuantity: string[] = [];\r\n const { deliveryServices } = config;\r\n const CartArrayRemove: CartLine[] = [];\r\n cartLinesData?.map((item) => {\r\n const checkExists = !!deliveryServices?.find((val: { serviceProductRecId: number }) => val.serviceProductRecId === item.ProductId);\r\n if (checkExists) {\r\n CartArrayRemove.push(item);\r\n } else {\r\n productQuantity.push(`${item.Quantity}`);\r\n }\r\n });\r\n if (isCartEmpty) {\r\n if ('utag_data' in window) {\r\n // @ts-ignore\r\n utag_data['is_cart_active'] = \"false\";\r\n [\r\n 'cart_product_id',\r\n 'cart_product_category',\r\n 'cart_product_name',\r\n 'cart_product_price',\r\n 'cart_product_quantity',\r\n 'cart_product_variant',\r\n 'cart_product_size',\r\n 'cart_product_image_url',\r\n 'cart_product_url',\r\n 'cart_total_quantity',\r\n 'cart_subtotal',\r\n 'cart_product_name_1',\r\n 'cart_product_name_2',\r\n 'cart_product_name_3',\r\n 'cart_product_image_url_1',\r\n 'cart_product_image_url_2',\r\n 'cart_product_image_url_3',\r\n 'cart_url',\r\n 'core_item_flag',\r\n 'funnel_type'\r\n // @ts-ignore\r\n ].forEach(e => delete utag_data[e]);\r\n }\r\n } else {\r\n const productDetailsUpdated = this.generateProductUpdateStrings();\r\n if ('utag_data' in window) {\r\n // @ts-ignore\r\n utag_data['cart_subtotal'] = `${productDetailsUpdated?.subTotal}`;\r\n // @ts-ignore\r\n utag_data['cart_total_quantity'] = `${productDetailsUpdated?.quantity}`;\r\n // @ts-ignore\r\n utag_data['cart_product_price'] = productDetailsUpdated?.cartProductPriceArray;\r\n // @ts-ignore\r\n utag_data['cart_product_id'] = productDetailsUpdated?.productIDsArray;\r\n // @ts-ignore\r\n utag_data['cart_product_image_url'] = productDetailsUpdated?.productImageUrl;\r\n // @ts-ignore\r\n utag_data['cart_product_quantity'] = productDetailsUpdated?.productQuantity;\r\n // @ts-ignore\r\n utag_data['cart_product_variant'] = productDetailsUpdated?.variantRecord;\r\n // @ts-ignore\r\n utag_data['cart_product_name'] = productDetailsUpdated?.productNameArray;\r\n // @ts-ignore\r\n utag_data['cart_url'] = productDetailsUpdated?.cartUrl;\r\n // @ts-ignore\r\n utag_data['cart_product_url'] = productDetailsUpdated?.productURL;\r\n // @ts-ignore\r\n utag_data['cart_product_size'] = productDetailsUpdated?.productSize;\r\n // @ts-ignore\r\n utag_data['cart_product_category'] = productDetailsUpdated?.productCatgoryArray;\r\n // @ts-ignore\r\n utag_data['cart_product_name_1'] = productDetailsUpdated?.productNameArray[0];\r\n // @ts-ignore\r\n utag_data['cart_product_name_2'] = productDetailsUpdated?.productNameArray[1];\r\n // @ts-ignore\r\n utag_data['cart_product_name_3'] = productDetailsUpdated?.productNameArray[2];\r\n // @ts-ignore\r\n utag_data['cart_product_image_url_1'] = productDetailsUpdated?.productImageUrl[0];\r\n // @ts-ignore\r\n utag_data['cart_product_image_url_2'] = productDetailsUpdated?.productImageUrl[1];\r\n // @ts-ignore\r\n utag_data['cart_product_image_url_3'] = productDetailsUpdated?.productImageUrl[2];\r\n // @ts-ignore\r\n utag_data['product_price'] = productDetailsUpdated?.productPriceArray;\r\n // @ts-ignore\r\n utag_data['product_id'] = productDetailsUpdated?.productIDsArray;\r\n // @ts-ignore\r\n utag_data['product_image_url'] = productDetailsUpdated?.productImageUrl;\r\n // @ts-ignore\r\n utag_data['product_quantity'] = productDetailsUpdated?.productQuantity;\r\n // @ts-ignore\r\n utag_data['product_variant'] = productDetailsUpdated?.variantRecord;\r\n // @ts-ignore\r\n utag_data['product_name'] = productDetailsUpdated?.productNameArray;\r\n // @ts-ignore\r\n utag_data['product_url'] = productDetailsUpdated?.productURL;\r\n // @ts-ignore\r\n utag_data['product_size'] = productDetailsUpdated?.productSize;\r\n // @ts-ignore\r\n utag_data['product_category'] = productDetailsUpdated?.productCatgoryArray;\r\n // @ts-ignore\r\n utag_data['product_brand'] = productDetailsUpdated?.productBrandName;\r\n // @ts-ignore\r\n utag_data['product_discount'] = productDetailsUpdated?.productDiscountArray;\r\n // @ts-ignore\r\n utag_data['core_item_flag'] = productDetailsUpdated?.isCoreItem;\r\n // @ts-ignore\r\n utag_data['funnel_type'] = productDetailsUpdated?.funnelType;\r\n }\r\n }\r\n const productDetails = { productQuantity, quantity, subTotal, isCoreItem, funnelType };\r\n setTealiumCartVariables('tealium_cart_products_quantity' , this.props.context, productDetails );\r\n if (CartArrayRemove.length > 0) {\r\n /* eslint-disable @typescript-eslint/no-floating-promises */\r\n // tslint:disable-next-line: no-floating-promises\r\n this._onlyRemoveItemFromCartHandler(CartArrayRemove[0]);\r\n }\r\n if (this.state.isOrderSummaryZipCodeClicked) {\r\n /* eslint-disable no-eval */\r\n // tslint:disable-next-line: no-eval\r\n eval(`var elem = document.querySelectorAll('.field-control--value'); if(elem != null && elem != undefined && elem.length > 0){ setTimeout(function(){elem[0].focus();}, 250);} else {console.log('element not found');}`);\r\n this.setState({ isOrderSummaryZipCodeClicked: false });\r\n }\r\n // tslint:disable: no-floating-promises\r\n this.checkAndUpdateBasketAndCartCookie();\r\n this.updateDateGroupedProductsData();\r\n if ((this.props.data.promoCodeApplicationState?.result?.isInProcess !== undefined && this.props.data.promoCodeApplicationState?.result?.isInProcess !== null) && (this.state.buttonDisabled !== this.props.data.promoCodeApplicationState?.result?.isInProcess)) {\r\n this.setState({ buttonDisabled: this.props.data.promoCodeApplicationState?.result?.isInProcess });\r\n }\r\n\r\n }\r\n\r\n /* VSI customization START create cart from URL*/\r\n public addCartFromUrl = async () => {\r\n const {\r\n data: {\r\n cart: { result }\r\n },\r\n context: {\r\n actionContext,\r\n request: {\r\n apiSettings: { channelId, catalogId },\r\n query\r\n }\r\n },\r\n telemetry\r\n } = this.props;\r\n const cookies = new Cookies();\r\n const zipcode = cookies.get('zip_code');\r\n const addProductToCart: CartLine[] = [];\r\n\r\n const qtys = query?.qtys?.split(',');\r\n const pIds = query?.pids?.split(',');\r\n const cartId = result?.cart?.Id!;\r\n const cartState = await getCartState(actionContext);\r\n\r\n if (qtys && pIds) {\r\n pIds.map((id, i) => {\r\n const checkExist = hasArray(cartState?.cart?.CartLines)?.find(item => item.ProductId === Number(id));\r\n if (!checkExist) {\r\n addProductToCart.push({\r\n Quantity: Number(qtys[i]),\r\n ProductId: Number(id)\r\n });\r\n }\r\n });\r\n\r\n if (!hasArray(result?.cart?.CartLines)) {\r\n await this._validateCart().then(async () => {\r\n await addCartLinesAsync({ callerContext: actionContext }, cartId, addProductToCart).then(async newCart => {\r\n await cartState.updateCart({ newCartObject: newCart });\r\n getAttributesForCartLineItems(new AttributesForSelectedVariantInput(channelId, catalogId), actionContext).then((res) => {\r\n actionContext.update(new AttributesForSelectedVariantInput(channelId, catalogId), res);\r\n this.returnCoreProductCheck();\r\n this._checkPromoCode(this.props);\r\n }).catch((error) => {\r\n telemetry.warning(error);\r\n telemetry.debug('Unable to getAttributesForCartLineItems on product added Cart URLS');\r\n });\r\n });\r\n }).catch((error) => {\r\n telemetry.warning(error);\r\n telemetry.debug('Unable to validate Cart on product added Cart URLS');\r\n });\r\n } else {\r\n if (addProductToCart.length > 0) {\r\n const cart = cartState.cart;\r\n // clear the delivery information on retail server, so GetDeliveryOptions charge calculation works correctly\r\n await cartState.clearCartLinesDeliveryInformation({ cart });\r\n await this._validateCart().then(async () => {\r\n await addCartLinesAsync({ callerContext: actionContext }, cartId, addProductToCart).then(async newCart => {\r\n await cartState.updateCart({ newCartObject: newCart });\r\n getAttributesForCartLineItems(new AttributesForSelectedVariantInput(channelId, catalogId), actionContext).then((res) => {\r\n actionContext.update(new AttributesForSelectedVariantInput(channelId, catalogId), res);\r\n this.returnCoreProductCheck();\r\n this._checkPromoCode(this.props);\r\n }).catch((error) => {\r\n telemetry.warning(error);\r\n telemetry.debug('Unable to getAttributesForCartLineItems on product already added Cart URLS');\r\n });\r\n });\r\n }).catch((error) => {\r\n telemetry.warning(error);\r\n telemetry.debug('Unable to validate Cart on product already added Cart URLS');\r\n });\r\n } else {\r\n const specifications = await this.getProductsSpecifications(this.props);\r\n this.setState({\r\n productSpecifications: specifications\r\n });\r\n const categoryPath = await this.getProductsCategoryPath(this.props, specifications);\r\n this.setState({\r\n productCategoryPath: categoryPath\r\n });\r\n this._getStateFromZipCode(this.props, zipcode, false);\r\n }\r\n }\r\n }\r\n };\r\n /* VSI customization END - create cart from URL */\r\n\r\n public resetPromoStorageIfCartExpired = () => {\r\n const { telemetry } = this.props;\r\n const cookies = new Cookies();\r\n const lastCartExpiryTime = cookies.get('last_cart_expiry_time');\r\n const currDate = new Date();\r\n const lastCartExpiryDate = new Date(lastCartExpiryTime);\r\n try {\r\n if (currDate > lastCartExpiryDate) {\r\n localStorage.removeItem('promo_code_apply_list');\r\n localStorage.removeItem('promoCode');\r\n localStorage.removeItem('selectedBonasItems');\r\n }\r\n } catch (error) {\r\n telemetry.warning(error);\r\n telemetry.debug('Unable to remove items');\r\n }\r\n };\r\n\r\n public coreProductAvailable = (): boolean => {\r\n const {\r\n data: {\r\n productAttributes\r\n }\r\n } = this.props;\r\n const productAttributesData = productAttributes.result;\r\n let isCheckItemCore = false;\r\n for (let i = 0; i < productAttributesData?.length!; i++) {\r\n const newProductSpecificationData = productAttributesData![i].attributeValue;\r\n newProductSpecificationData.map((item) => {\r\n if (item.Name === 'shippingInformation') {\r\n if (item?.TextValue?.trim().toLocaleLowerCase() === 'delivery') {\r\n isCheckItemCore = true;\r\n }\r\n }\r\n });\r\n }\r\n return isCheckItemCore;\r\n };\r\n\r\n public addProductToDropShipDateGroup = (deliveryDate: string, productVariantRecordId: number, daySpan?: string) => {\r\n const dateGroupedData: IMFRMDateGroupedProducts[] = getSetDateGroupedProducts('get');\r\n if (dateGroupedData && hasArray(dateGroupedData)) {\r\n for (const productData of dateGroupedData) {\r\n if (productData.productsType?.toLowerCase() === 'drop ship') {\r\n if (productData.dateStr === deliveryDate) {\r\n if (productData.productVariantRecordIds && (!productData.productVariantRecordIds.includes(productVariantRecordId))) {\r\n productData.productVariantRecordIds.push(productVariantRecordId);\r\n getSetDateGroupedProducts('set', dateGroupedData);\r\n return;\r\n } else if (productData.productVariantRecordIds && (productData.productVariantRecordIds.includes(productVariantRecordId))) {\r\n return;\r\n }\r\n }\r\n }\r\n }\r\n const newDateEntry: IMFRMDateGroupedProducts = { dateStr: deliveryDate, productVariantRecordIds: [productVariantRecordId], productsType: 'drop ship', productItemIds: [], days: daySpan };\r\n dateGroupedData.push(newDateEntry);\r\n getSetDateGroupedProducts('set', dateGroupedData);\r\n return;\r\n } else {\r\n const newDateGroupedProducts: IMFRMDateGroupedProducts[] = [];\r\n const newDateEntry: IMFRMDateGroupedProducts = { dateStr: deliveryDate, productVariantRecordIds: [productVariantRecordId], productsType: 'drop ship', productItemIds: [], days: daySpan };\r\n newDateGroupedProducts.push(newDateEntry);\r\n getSetDateGroupedProducts('set', newDateGroupedProducts);\r\n }\r\n };\r\n\r\n public addProductToSmallParcelDateGroup = (deliveryDate: string, productVariantRecordId: number, daySpan?: string) => {\r\n const dateGroupedData: IMFRMDateGroupedProducts[] = getSetDateGroupedProducts('get');\r\n if (dateGroupedData && hasArray(dateGroupedData)) {\r\n for (const productData of dateGroupedData) {\r\n if (productData.productsType?.toLowerCase() === 'parcel') {\r\n if (productData.dateStr === deliveryDate) {\r\n if (productData.productVariantRecordIds && (!productData.productVariantRecordIds.includes(productVariantRecordId))) {\r\n productData.productVariantRecordIds.push(productVariantRecordId);\r\n getSetDateGroupedProducts('set', dateGroupedData);\r\n return;\r\n } else if (productData.productVariantRecordIds && (productData.productVariantRecordIds.includes(productVariantRecordId))) {\r\n return;\r\n }\r\n }\r\n }\r\n }\r\n const newDateEntry: IMFRMDateGroupedProducts = { dateStr: deliveryDate, productVariantRecordIds: [productVariantRecordId], productsType: 'parcel', productItemIds: [], days: daySpan };\r\n dateGroupedData.push(newDateEntry);\r\n getSetDateGroupedProducts('set', dateGroupedData);\r\n return;\r\n } else {\r\n const newDateGroupedProducts: IMFRMDateGroupedProducts[] = [];\r\n const newDateEntry: IMFRMDateGroupedProducts = { dateStr: deliveryDate, productVariantRecordIds: [productVariantRecordId], productsType: 'parcel', productItemIds: [], days: daySpan };\r\n newDateGroupedProducts.push(newDateEntry);\r\n getSetDateGroupedProducts('set', newDateGroupedProducts);\r\n }\r\n };\r\n\r\n public updateDateGroupedProductsData = () => {\r\n const productsData: IProductDetails[] = getSetProductData('get');\r\n getSetDateGroupedProducts('set', []);\r\n if (productsData && hasArray(productsData)) {\r\n for (const productData of productsData) {\r\n if (productData.typeOfProduct?.toLowerCase() === 'parcel') {\r\n if (hasArray(this.state.deliveryByMessageSPDS)) {\r\n for (const deliveryByMessage of this.state.deliveryByMessageSPDS) {\r\n if (deliveryByMessage.variantID === productData.VariantRecordId?.toString()) {\r\n this.addProductToSmallParcelDateGroup(deliveryByMessage.deliveryByMessage, productData.VariantRecordId, deliveryByMessage.daySpan);\r\n }\r\n }\r\n }\r\n } else if (productData.typeOfProduct?.toLowerCase() === 'drop ship') {\r\n if (hasArray(this.state.deliveryByMessageSPDS)) {\r\n for (const deliveryByMessage of this.state.deliveryByMessageSPDS) {\r\n if (deliveryByMessage.variantID === productData.VariantRecordId?.toString()) {\r\n this.addProductToDropShipDateGroup(deliveryByMessage.deliveryByMessage, productData.VariantRecordId, deliveryByMessage.daySpan);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n };\r\n\r\n public checkAndUpdateBasketAndCartCookie = async () => {\r\n const {\r\n data: {\r\n cart: { result }\r\n },\r\n context\r\n } = this.props;\r\n const basketCookie: IBasketCookie = getSetBasketCookie('get', this.props.context);\r\n // Only store cartlines for guest user in basket cookie\r\n if (!basketCookie && !context.request.user.isAuthenticated) {\r\n const bCookie: IBasketCookie = {};\r\n bCookie.cartId = result?.cart.Id;\r\n getSetBasketCookie('set', context, bCookie, result?.cart?.CartLines);\r\n } else {\r\n if (result?.cart?.CartLines) {\r\n const baskCartInfo = basketCookie.cartDataInfo;\r\n if (baskCartInfo) {\r\n if (result?.cart.CartLines?.length !== baskCartInfo.length) {\r\n this.refreshCartCookie();\r\n } else {\r\n let requiresUpdate = false;\r\n for (const c of result?.cart?.CartLines) {\r\n let cartItemFound = false;\r\n for (const bci of baskCartInfo) {\r\n if (bci.productId === c.ProductId && bci.itemId === c.ItemId && bci.quantity === c.Quantity) {\r\n cartItemFound = true;\r\n }\r\n }\r\n if (!cartItemFound) {\r\n requiresUpdate = true;\r\n break;\r\n }\r\n }\r\n if (requiresUpdate) {\r\n this.refreshCartCookie();\r\n }\r\n }\r\n } else {\r\n this.refreshCartCookie();\r\n }\r\n }\r\n }\r\n };\r\n\r\n public addLastAddedItemsIfCartEmpty = async () => {\r\n const {\r\n data: {\r\n cart: { result }\r\n },\r\n context: { actionContext, request: { apiSettings: { channelId, catalogId } }\r\n }, telemetry\r\n } = this.props;\r\n if (hasArray(result?.cart?.CartLines)) {\r\n return;\r\n }\r\n if (result?.cart?.Id) {\r\n const basketCookie: IBasketCookie = getSetBasketCookie('get', this.props.context);\r\n if (basketCookie) {\r\n const basketCLs = basketCookie.cartDataInfo;\r\n if (basketCLs && basketCLs.length) {\r\n const lastAddedCartlines: CartLine[] = [];\r\n for (const bcl of basketCLs) {\r\n lastAddedCartlines.push({ ProductId: bcl.productId, ItemId: bcl.itemId, Quantity: bcl.quantity, EntryMethodTypeValue: 5 });\r\n }\r\n const cartState = await getCartState(actionContext);\r\n await addCartLinesAsync({ callerContext: actionContext }, result?.cart.Id, lastAddedCartlines).then(async newCart => {\r\n await cartState.refreshCart({});\r\n\r\n // Call attributes API to get attributes after adding cartlines\r\n getAttributesForCartLineItems(new AttributesForSelectedVariantInput(channelId, catalogId), actionContext).then((res) => {\r\n actionContext.update(new AttributesForSelectedVariantInput(channelId, catalogId), res);\r\n this.returnCoreProductCheck();\r\n this._checkPromoCode(this.props);\r\n this.setState({ productAttributes: res });\r\n })\r\n .catch((error) => {\r\n telemetry.warning(error);\r\n telemetry.debug('Unable to getAttributesForCartLineItems when click to checkout');\r\n });\r\n this.refreshCartCookie();\r\n\r\n const cookieForRefresh = new Cookies();\r\n const zipCodeForRefresh = cookieForRefresh.get(`zip_code`);\r\n this._getStateFromZipCode(this.props, zipCodeForRefresh, true);\r\n });\r\n }\r\n }\r\n }\r\n };\r\n\r\n public prepareProductDataForTealiumCall = async (products: AsyncResult, deletedItemId?: string | undefined) => {\r\n const {\r\n data: {\r\n cart: {\r\n result: cart\r\n },\r\n productAttributes: { result: productAttributes }\r\n }\r\n } = this.props;\r\n const cartLinesData: CartLine[] | undefined = cart?.cart.CartLines;\r\n const originUrl = this.props.context.request.url.requestUrl.origin;\r\n const productIdArray: (string | undefined)[] = [];\r\n const productImageUrl: string[] = [];\r\n const productNameArray: (string | undefined)[] = [];\r\n const productCategoryArray: (string | undefined)[] = [];\r\n const productBrandArray: (string | undefined)[] = [];\r\n const productVariantIdArray: (string | undefined)[] = [];\r\n const productPriceArray: (string | undefined)[] = [];\r\n const productQuantityArray: (string | undefined)[] = [];\r\n const productSize: string[] = [];\r\n const productURL: string[] = [];\r\n const prodSpec = getSetProductData('get');\r\n /* VSI customization START - 79266 Tracking */\r\n let isCoreItem: string;\r\n let funnelType: string;\r\n const isCheckCore = this.coreProductAvailable();\r\n if (isCheckCore) {\r\n isCoreItem = \"true\";\r\n funnelType = \"full funnel\";\r\n } else {\r\n isCoreItem = \"false\";\r\n funnelType = \"no core item\";\r\n }\r\n /* VSI customization END - 79266 Tracking */\r\n hasArray(products?.result)?.map(item => {\r\n productIdArray.push(item?.ItemId);\r\n productNameArray.push(item?.Name);\r\n productImageUrl.push(`${item?.PrimaryImageUrl}`);\r\n const urlProduct = this.generateURLForPDP(item, this.props.context);\r\n productURL.push(`${originUrl}${urlProduct}`);\r\n const attr = hasArray(productAttributes)?.find(p => p?.productId === item?.RecordId)?.attributeValue;\r\n const brandName = parseBrandName(attr, this.props.context.app.config.brandBackofficeAttributePdp, item?.RecordId);\r\n productBrandArray.push(`${brandName}`);\r\n productCategoryArray.push(`${hasArray(productAttributes)?.find(p => p?.productId === item?.RecordId)?.categoryName}`);\r\n });\r\n hasArray(cartLinesData)?.map((items) => {\r\n let productDiscount: number = 0;\r\n items.DiscountLines?.map((sales: { DiscountCode: string; EffectiveAmount: number; }) => {\r\n if (sales.DiscountCode) {\r\n productDiscount = productDiscount + sales.EffectiveAmount;\r\n }\r\n });\r\n const updatedPrice = Number(items.NetAmountWithoutTax!) + Number(productDiscount);\r\n productPriceArray.push(`${updatedPrice}`);\r\n productVariantIdArray.push(items?.Barcode);\r\n productQuantityArray.push(items?.Quantity?.toString());\r\n productSize.push(`${this.getVariant(this.getProduct(this.props.data.products.result!, items)).toString().replace(/,/g, '')}`);\r\n });\r\n /* VSI customization START - Tracking 79374 */\r\n if (deletedItemId) {\r\n const allProductsId = [...productIdArray];\r\n const indexOfDeletedItem = allProductsId?.indexOf(deletedItemId);\r\n allProductsId?.splice(indexOfDeletedItem, 1);\r\n const checkForCore = allProductsId?.find((item, i) => { return item === prodSpec[i]?.ItemId && prodSpec[i]?.typeOfProduct?.toLowerCase() === 'core'; });\r\n if (checkForCore) {\r\n isCoreItem = \"true\";\r\n funnelType = \"full funnel\";\r\n }\r\n else {\r\n isCoreItem = \"false\";\r\n funnelType = \"no core item\";\r\n }\r\n }\r\n /* VSI customization END - Tracking 79374 */\r\n return {\r\n productIdArray,\r\n productNameArray,\r\n productCategoryArray,\r\n productBrandArray,\r\n productVariantIdArray,\r\n productPriceArray,\r\n productQuantityArray,\r\n productImageUrl,\r\n productURL,\r\n productSize,\r\n isCoreItem,\r\n funnelType\r\n };\r\n };\r\n public tealiumCallOnViewCart = async (products: AsyncResult) => {\r\n const getProduct = await this.prepareProductDataForTealiumCall(products);\r\n\r\n await callUtagLink(\r\n {\r\n event: 'checkout-steps',\r\n event_category: 'ecommerce',\r\n event_action: 'checkout steps',\r\n event_label: 'Step 1 : View Order',\r\n event_noninteraction: 'false',\r\n enhanced_action: 'checkout',\r\n event_type: 'view cart',\r\n checkout_step: '1',\r\n product_id: getProduct?.productIdArray,\r\n product_name: getProduct?.productNameArray,\r\n product_category: getProduct?.productCategoryArray,\r\n product_brand: getProduct?.productBrandArray,\r\n product_variant: getProduct?.productVariantIdArray,\r\n product_price: getProduct?.productPriceArray,\r\n product_quantity: getProduct?.productQuantityArray,\r\n product_size: getProduct?.productSize,\r\n product_url: getProduct?.productURL,\r\n product_image_url: getProduct?.productImageUrl,\r\n core_item_flag: getProduct?.isCoreItem,\r\n funnel_type: getProduct?.funnelType\r\n }\r\n );\r\n };\r\n\r\n /* VSI customization START - Tracking 79374 */\r\n public tealiumCallOnRemoveForGA = async (products: AsyncResult, deletedItemId?: string | undefined) => {\r\n const getProduct = await this.prepareProductDataForTealiumCall(products, deletedItemId);\r\n const pageName = `https://www.mattressfirm.com/cart?remove_item_${this.state.pageCount}`;\r\n await callUtagView(\r\n {\r\n ga_title: \"Cart\",\r\n ga_location: pageName,\r\n core_item_flag: getProduct?.isCoreItem,\r\n funnel_type: getProduct?.funnelType\r\n }\r\n );\r\n this.setState({\r\n pageCount : this.state.pageCount + 1\r\n });\r\n };\r\n /* VSI customization END - Tracking 79374 */\r\n\r\n public onOrderSummaryZipcodeClick = () => {\r\n this.setState({ isInput: true, newZipCode: this.state.newZipCode, isOrderSummaryZipCodeClicked: true });\r\n };\r\n public handleTealiumClick = () => {\r\n const {\r\n context: { actionContext },\r\n app: {\r\n routes: {\r\n backToShopping: { destinationUrl }\r\n }\r\n }\r\n } = this.props;\r\n const backToShoppingUrl = getUrlSync('home', actionContext);\r\n const backToShoppingUrlNavigate = destinationUrl || getUrlSync('home', actionContext);\r\n const getPath = MsDyn365.isBrowser && window.location.pathname;\r\n\r\n void callUtagLink(\r\n {\r\n event: 'internal-navigation',\r\n event_category: 'internal links',\r\n event_action: `to ${backToShoppingUrl}`,\r\n event_label: `from continue shopping btn: ${getPath}`,\r\n event_noninteraction: 'false'\r\n }\r\n );\r\n\r\n window.location.href = backToShoppingUrlNavigate;\r\n };\r\n public componentWillUnmount(): void {\r\n MsDyn365.isBrowser && window.removeEventListener('resize', this.resizeThrottledEventHandler!, false);\r\n if (this.timer) {\r\n clearTimeout(this.timer);\r\n }\r\n }\r\n\r\n public refreshCartCookie = () => {\r\n const {\r\n context,\r\n data: {\r\n cart: { result }\r\n }\r\n } = this.props;\r\n const basketCookie: IBasketCookie = getSetBasketCookie('get', context);\r\n // Basket cookie only stores guest user's cartlines\r\n if (basketCookie && !context.request.user.isAuthenticated) {\r\n basketCookie.cartId = result?.cart.Id;\r\n getSetBasketCookie('set', context, basketCookie, result?.cart?.CartLines);\r\n }\r\n };\r\n\r\n public handleClickCheckout = async () => {\r\n const {\r\n context: {\r\n actionContext\r\n },\r\n data: {\r\n cart: { result: cart }\r\n },\r\n telemetry\r\n } = this.props;\r\n if (this.state.showError) {\r\n return;\r\n }\r\n const cartLinesData: CartLine[] | undefined = cart?.cart.CartLines;\r\n const sepcProducts = this.state.productSpecifications;\r\n const removeOutStockCartLines: string[] = [];\r\n const guestCheckoutUrl = getUrlSync('checkout', actionContext) || '';\r\n const itemsIDs: string[] = [];\r\n const result: CartLine[] | undefined = cartLinesData?.filter(itemCart => sepcProducts.some(itemProduct => itemCart.ProductId === itemProduct.VariantRecordId && (itemProduct.outOfStock === true || itemProduct.zipCodeError === true)));\r\n result?.forEach((item) => {\r\n removeOutStockCartLines.push(item.LineId?.toString()!);\r\n itemsIDs.push(item?.ItemId?.toString()!);\r\n });\r\n if (removeOutStockCartLines.length > 0) {\r\n const input = {\r\n cartLineIds: removeOutStockCartLines\r\n };\r\n await cart?.removeCartLines(input).then(() => {\r\n this._validateCart()\r\n .catch((error) => {\r\n telemetry.warning(error);\r\n telemetry.debug('Unable to validate Cart when remove cart lines');\r\n });\r\n this.setState({\r\n cartRender: false\r\n });\r\n this._getUpdateLinbeDeliveryCall(this.props, this.state.newZipCode, this.state.errorZipCode, '');\r\n this.refreshCartCookie();\r\n itemsIDs.map((items) => {\r\n const productSpecificationsCookieData = getSetProductData('get');\r\n const producDetailsCookieData = getSetProductData('get');\r\n const checkAvailable = productSpecificationsCookieData && productSpecificationsCookieData.filter((singleItem: IProductDetails) => singleItem.ItemId !== items);\r\n const checkAvailableData = producDetailsCookieData && producDetailsCookieData.filter((singleItem: IProductDetails) => singleItem.ItemId !== items);\r\n getSetProductData('set', checkAvailableData);\r\n getSetProductSpec('set', checkAvailable);\r\n });\r\n const cartLinesUpdateData: CartLine[] | undefined = cart?.cart.CartLines;\r\n if (cartLinesUpdateData?.length! > 0) {\r\n window.location.href = guestCheckoutUrl;\r\n }\r\n })\r\n .catch((error) => {\r\n telemetry.warning(error);\r\n telemetry.debug('Unable to Remove Cart Line when click to checkout');\r\n });\r\n } else {\r\n window.location.href = guestCheckoutUrl;\r\n }\r\n };\r\n\r\n public returnCoreProductCheck = () => {\r\n const { data } = this.props;\r\n const { productAttributes } = this.state;\r\n let showDeliveryStep: boolean = false;\r\n // if(!MsDyn365.isBrowser) {\r\n // If attribute array is empty after updating something, use state attributes\r\n let productAttributesList: IProductWithAttribute[] | undefined;\r\n if (productAttributesList && productAttributesList.length > 0) {\r\n productAttributesList = data?.productAttributes.result;\r\n } else {\r\n productAttributesList = productAttributes;\r\n }\r\n if (productAttributesList && productAttributesList.length > 0) {\r\n for (const productSpecItem of productAttributesList) {\r\n productSpecItem.attributeValue.find((shippingData) => {\r\n if (shippingData?.TextValue && shippingData.TextValue.trim().toLocaleLowerCase() === 'delivery') {\r\n showDeliveryStep = true;\r\n }\r\n });\r\n }\r\n }\r\n return showDeliveryStep;\r\n };\r\n\r\n public getFinalPrice = () => {\r\n const {\r\n data: {\r\n cart: { result: cart }\r\n }\r\n } = this.props;\r\n const TotalSalesAmount = cart?.cart.TotalSalesAmount || 0;\r\n const finalPrice = this.state.isTablet ? ` - ${TotalSalesAmount.toLocaleString('en-US', {\r\n style: 'currency',\r\n currency: 'USD'\r\n })\r\n }` : '';\r\n return finalPrice ? finalPrice : '';\r\n };\r\n\r\n // tslint:disable-next-line:max-func-body-length cyclomatic-complexity\r\n public render(): JSX.Element | null {\r\n const {\r\n data: {\r\n cart: { result: cart },\r\n products: { result: products }\r\n },\r\n context: {\r\n request: {\r\n user: {\r\n isAuthenticated\r\n /* VSI customization START - 22192 */\r\n // signInUrl\r\n /* VSI customization END - 22192 */\r\n }\r\n },\r\n actionContext\r\n\r\n },\r\n resources\r\n } = this.props;\r\n const { buttonDisabled } = this.state;\r\n !this.callFirstTime && this._checkPromoCode(this.props);\r\n let cartLines = this._getCartLines();\r\n const totalPrice = this.getFinalPrice();\r\n const zipCartLines: ICartlinesViewProps[] | null = [];\r\n const outOfStockCartLines: ICartlinesViewProps[] | null = [];\r\n let sortCartLine: ICartlinesViewProps[] | null = [];\r\n if (this.state.productSpecifications.length > 0) {\r\n cartLines?.map((data) => {\r\n const productID = data.data?.product?.RecordId;\r\n const findProduct = this.state.productSpecifications.find(item => item?.VariantRecordId === productID);\r\n if (findProduct) {\r\n if (productID === findProduct.VariantRecordId) {\r\n if (findProduct.zipCodeError) {\r\n zipCartLines.push(data);\r\n } else if (findProduct.outOfStock) {\r\n outOfStockCartLines.unshift(data);\r\n } else {\r\n const checkProductStockCart = outOfStockCartLines.includes(data);\r\n if (!checkProductStockCart) {\r\n outOfStockCartLines.push(data);\r\n }\r\n }\r\n }\r\n } else {\r\n const checkProductStockCart = outOfStockCartLines.includes(data);\r\n if (!checkProductStockCart) {\r\n outOfStockCartLines.push(data);\r\n }\r\n }\r\n });\r\n }\r\n sortCartLine = [...zipCartLines, ...outOfStockCartLines];\r\n if (sortCartLine.length > 0) {\r\n cartLines = sortCartLine;\r\n }\r\n const backToShoppingUrl = getUrlSync('home', actionContext) || '';\r\n /* VSI customization START - 22192 */\r\n // const checkoutURL = this._getCheckoutURL(isAuthenticated, guestCheckoutUrl, signInUrl || '');\r\n /* VSI customization END */\r\n const isCartEmpty = cart && cart.cart.CartLines && cart.cart.CartLines.length === 0;\r\n /* VSI customization START */\r\n // this._addGiftCta();\r\n const newCartLine: ICartlinesViewProps[] | null = [];\r\n const defualtCartLines: ICartlinesViewProps[] | null = [];\r\n // add bonus product beneath parent code if cartline item greater than 2\r\n if (cartLines && cartLines?.length > 2) {\r\n if (MsDyn365.isBrowser) {\r\n /* VSI customization START */\r\n const getLocalStorageData = getSetBonusItemProd('get');\r\n // const getLocalStorageData = localStorage.getItem('BonusItemProduct');\r\n /* VSI customization END*/\r\n let bonusItemArrayData: IMFIBonusItemsResponse[] = [];\r\n if (getLocalStorageData) {\r\n bonusItemArrayData = getLocalStorageData;\r\n hasArray(bonusItemArrayData)?.map((bonusItemArray: IMFIBonusItemsResponse) => {\r\n bonusItemArray.BonusItemsDetails?.map((BonusItemsDetail) => {\r\n BonusItemsDetail.Items?.map((item) => {\r\n // filter out parent product from previous cartline\r\n cartLines?.filter((cartlineData) => {\r\n if (item.QualifyingItemId === cartlineData.data?.cartline.ItemId) {\r\n newCartLine.push(cartlineData);\r\n }\r\n item.BonusItems?.map((bonusItemfinal) => {\r\n // filter out child product from previous cartline\r\n if (bonusItemfinal.BonusItemId === cartlineData.data?.cartline.ItemId) {\r\n newCartLine.push(cartlineData);// child\r\n }\r\n });\r\n });\r\n });\r\n });\r\n });\r\n }\r\n }\r\n\r\n const newCartLinesItemIds: string[] = [];\r\n newCartLine.map((item) => {\r\n if (item.data?.cartline.ItemId !== undefined) {\r\n newCartLinesItemIds.push(item.data?.cartline.ItemId);\r\n }\r\n });\r\n\r\n cartLines?.filter((cartLineSingleData: ICartlinesViewProps) => {\r\n if (cartLineSingleData.data?.cartline.ItemId !== undefined && newCartLinesItemIds.indexOf(cartLineSingleData.data?.cartline.ItemId) === -1) {\r\n defualtCartLines.push(cartLineSingleData);\r\n }\r\n });\r\n }\r\n // merge parent product and child product with previous cartline.\r\n for (let i = 0; i < defualtCartLines.length; i++) {\r\n newCartLine.unshift(defualtCartLines[i]);\r\n // cartLines = newCartLine;\r\n }\r\n /* VSI customization END */\r\n const RetailMulitplePickupFeatureState = this.props.data.featureState.result?.find(featureState => featureState.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature');\r\n const cartLinesGroup = RetailMulitplePickupFeatureState?.IsEnabled ? this._getCartLinesGroup() : null;\r\n\r\n this.payLoad.contentAction.etext = TelemetryConstant.Checkout;\r\n const checkoutBySignInAttributes = getTelemetryAttributes(this.telemetryContent, this.payLoad);\r\n this.payLoad.contentAction.etext = TelemetryConstant.GuestCheckout;\r\n const checkoutByGuestAttributes = getTelemetryAttributes(this.telemetryContent, this.payLoad);\r\n this.payLoad.contentAction.etext = TelemetryConstant.BackToShopping;\r\n const backtoShoppingAttributes = getTelemetryAttributes(this.telemetryContent, this.payLoad);\r\n const hasErrors = cartLines ? cartLines.some(cartline => cartline.error !== undefined) : false;\r\n reshuffleItems(cart?.cart?.CartLines ? cart?.cart?.CartLines : []);\r\n // tslint:disable-next-line:max-func-body-length\r\n const viewProps = {\r\n ...this.props,\r\n className: classnames('ms-cart'),\r\n title:

{resources.cartTitle}

,\r\n CartlinesWrapper: { className: 'msc-cartline-wraper' },\r\n OrderSummaryWrapper: { className: 'msc-order-summary-wrapper' },\r\n OrderSummaryItems: { className: 'msc-order-summary__items' },\r\n cartlines: cartLines,\r\n // VSI Cust 52133\r\n showRemoveNotification: this.state.showRemoveNotification,\r\n showProductTitle: this.state.showProductTitle,\r\n cartLinesGroup: cartLinesGroup,\r\n promoCode: this._getPromoCode(),\r\n promotionOptions: this._getPromotions(),\r\n cart: this.props.data.cart.result,\r\n context: this.props.context,\r\n typeName: this.props.typeName,\r\n telemetry: this.props.telemetry,\r\n _renderUpdateZipCode: this._renderUpdateZipCode(),\r\n _productDetails: this.generateProductData(),\r\n disableCheckoutButtonState: this.state.disableCheckoutButton,\r\n id: this.props.id,\r\n mulitplePickUpEnabled: RetailMulitplePickupFeatureState?.IsEnabled,\r\n removePromoAriaLabelFormat: resources.removePromoAriaLabelFormat,\r\n orderSummaryHeading: ArrayExtensions.hasElements(cart?.cart.CartLines) ?\r\n (\r\n

{resources.orderSummaryTitle}

\r\n ) : null,\r\n orderSummaryLineitems: this._getOrderSummaryLineItems(),\r\n checkoutAsSignInUserButton: (!isCartEmpty) ?\r\n (\r\n \r\n ) : null,\r\n checkoutAsGuestButton: (!isCartEmpty && !isAuthenticated) ?\r\n (\r\n // tslint:disable-next-line: max-line-length\r\n \r\n ) : null,\r\n backToShoppingButton: ,\r\n createTemplateFromCartButton: (this._displayAddCartToTemplate() && products) ?\r\n (\r\n \r\n ) : null,\r\n storeSelector: this.props.slots.storeSelector && this.props.slots.storeSelector.length > 0 ? this.props.slots.storeSelector[0] : null,\r\n removeItemClickHandler: this._removeItemFromCartHandler,\r\n moveToWishlistSuccessHandler: this._moveToWishlistSuccessHandler,\r\n waitingComponent: ,\r\n cartLoadingStatus: this.props.data.cart.status === 'FAILED' ? this.props.resources.cartLoadingErrorMessage : null,\r\n cartDataResult: this.props.data.cart.result && this.props.data.cart.result.isEmpty,\r\n OrderSummaryErrors: this._getOrderSummaryErrors(cartLines),\r\n telemetryContent: this.telemetryContent,\r\n isTabletView: this.state.isTablet,\r\n calculateTaxOnCart: this.props.context.app.config.calculateTaxOnCart,\r\n onOrderSummaryZipcodeClick: this.onOrderSummaryZipcodeClick,\r\n handleTealiumClick: this.handleTealiumClick,\r\n showDeliveryStepper: this.returnCoreProductCheck(), // this.state.showDeliveryStepper\r\n isDesktop: this.state.isDesktop,\r\n isMobile: this.state.isMobile\r\n };\r\n\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n ///// for payment review //////////\r\n private updateCartDataSharing = () => {\r\n // ontext.actionContext.update(new CheckoutZipCodeInfoInput(), { isValidZipCode: flag, updatedZipCode: zip });\r\n const cartProductsData: ICartProductInfo[] = [];\r\n const productSpecificationsCookieData = getSetProductData('get');\r\n if (productSpecificationsCookieData) {\r\n for (const productSpecItem of productSpecificationsCookieData) {\r\n const cLines = this.props.data.cart.result?.cart.CartLines;\r\n if (cLines) {\r\n for (const cl of cLines) {\r\n if (cl.ProductId === productSpecItem.VariantRecordId) {\r\n cartProductsData.push({ productId: cl.ProductId ? cl.ProductId : -1, typeOfProduct: productSpecItem.typeOfProduct, deliveryDate: '' });\r\n }\r\n }\r\n }\r\n }\r\n }\r\n this.props.context.actionContext.update(new CartDataInfoInput(), { cartProductsInfo: cartProductsData });\r\n };\r\n\r\n // tslint:disable: no-floating-promises\r\n // tslint:disable-next-line: cyclomatic-complexity\r\n private async _updateATPMessagesForCoreProducts(): Promise {\r\n const {\r\n data: {\r\n cart: { result }\r\n },\r\n context: {\r\n app: {\r\n config: { defaultDeliveryMessage }\r\n }\r\n },\r\n telemetry\r\n } = this.props;\r\n const cookies = new Cookies();\r\n cookies.set(`payment_review_latest_core_prod_msg`, '', { path: '/' });\r\n this.coreProdLatestDelMsg = '';\r\n const productSpecificationsCookieData = getSetProductData('get');\r\n const allCoreProdMsgs: ICoreDeliveryByMessage[] = [];\r\n if (productSpecificationsCookieData) {\r\n for (const productSpecItem of productSpecificationsCookieData) {\r\n if (productSpecItem.typeOfProduct === 'Core') {\r\n const cLines = result?.cart.CartLines;\r\n if (cLines) {\r\n for (const cl of cLines) {\r\n if (cl.ProductId === productSpecItem.VariantRecordId) {\r\n const respStr = await _coreProductATPCall(this.props, productSpecItem.VariantRecordId, productSpecItem.ItemId, cl.Quantity ? cl.Quantity : productSpecItem.Quantity);\r\n const splittedData = respStr.split(',');\r\n if (splittedData && splittedData.length && splittedData[2]) {\r\n if (splittedData[2] === defaultDeliveryMessage) {\r\n cookies.set(`payment_review_latest_core_prod_msg`, defaultDeliveryMessage, { path: '/' });\r\n this.coreProdLatestDelMsg = defaultDeliveryMessage;\r\n }\r\n }\r\n // MMM D\r\n if (this.coreProdLatestDelMsg === '') {\r\n cookies.set(`payment_review_latest_core_prod_msg`, splittedData[3] === 'yes' ? '' : splittedData[2], { path: '/' });\r\n this.coreProdLatestDelMsg = splittedData[3] === 'yes' ? '' : splittedData[2];\r\n } else if (splittedData[2] === defaultDeliveryMessage) {\r\n cookies.set(`payment_review_latest_core_prod_msg`, splittedData[3] === 'yes' ? '' : splittedData[2], { path: '/' });\r\n this.coreProdLatestDelMsg = splittedData[3] === 'yes' ? '' : splittedData[2];\r\n } else if ((splittedData[2] !== defaultDeliveryMessage || !splittedData[2].includes(defaultDeliveryMessage)) && this.coreProdLatestDelMsg.includes('Delivery by ')\r\n && (this.coreProdLatestDelMsg !== defaultDeliveryMessage || !this.coreProdLatestDelMsg.includes(defaultDeliveryMessage))) {\r\n const thisMsgSplitted = splittedData[2].split('Delivery by ');\r\n const thisMsgDate = dayjs(thisMsgSplitted[1]).format('MMM D');\r\n const latestMsgSplitted = this.coreProdLatestDelMsg.split('Delivery by ');\r\n const latestMsgDate = dayjs(latestMsgSplitted[1]).format('MMM D');\r\n if (thisMsgDate > latestMsgDate) {\r\n cookies.set(`payment_review_latest_core_prod_msg`, splittedData[3] === 'yes' ? '' : splittedData[2], { path: '/' });\r\n this.coreProdLatestDelMsg = splittedData[3] === 'yes' ? '' : splittedData[2];\r\n }\r\n } else {\r\n cookies.set(`payment_review_latest_core_prod_msg`, defaultDeliveryMessage, { path: '/' });\r\n this.coreProdLatestDelMsg = defaultDeliveryMessage;\r\n }\r\n allCoreProdMsgs.push({\r\n itemID: splittedData[0],\r\n variantID: splittedData[1],\r\n deliveryByMessage: splittedData[3] === 'yes' ? '' : splittedData[2],\r\n locationId: splittedData[4]\r\n });\r\n if (splittedData[3] === 'yes') {\r\n this.setState({ oomZipCode: true });\r\n const result = this.checkCoreProductErrorZipCode(this.state.productDetails);\r\n result.then((products) => {\r\n this.setState({\r\n productSpecifications: products,\r\n productDetails: products,\r\n showDeliveryStepper: true\r\n });\r\n getSetProductData('set', products);\r\n }).catch((error) => {\r\n telemetry.warning(error);\r\n telemetry.debug('Unable to Check core product zip code out of market');\r\n });\r\n } else {\r\n const result = this.checkCoreProductErrorZipCode(this.state.productDetails);\r\n result.then((products) => {\r\n this.setState({\r\n productSpecifications: products,\r\n productDetails: products,\r\n showDeliveryStepper: true\r\n });\r\n getSetProductData('set', products);\r\n }).catch((error) => {\r\n telemetry.warning(error);\r\n telemetry.debug('Unable to Check core product zip code');\r\n });\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (allCoreProdMsgs.length > 0) {\r\n this.setState({ deliveryByMessagesCore: allCoreProdMsgs, showDeliveryStepper: true });\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Get value from ATP calls and Update warehouseId & fulfillmentStore ID against each cartline respectively\r\n private _updateCartLineWarehouseDetails = async () => {\r\n try {\r\n // Make a new array of small parcel and core products for location details\r\n const allProductLocations: IProductLocationDetails[] = [];\r\n // Core products's warehouse will only be set if calculateTaxOnCart is true\r\n this.props.context.app.config.calculateTaxOnCart && this.state.deliveryByMessagesCore?.forEach(prodMsg => {\r\n\r\n allProductLocations.push({\r\n itemId: prodMsg.itemID,\r\n productId: prodMsg.variantID,\r\n location: prodMsg.locationId === 'undefined' || prodMsg.locationId === 'null' ? '' : prodMsg.locationId\r\n });\r\n });\r\n // Small parcel products\r\n this.state.smallParcelLocationDetails?.forEach(prodMsg => {\r\n allProductLocations.push({\r\n itemId: prodMsg.itemId,\r\n productId: prodMsg.productId,\r\n location: prodMsg.location === 'undefined' || prodMsg.location === 'null' ? '' : prodMsg.location\r\n });\r\n });\r\n\r\n // Now as zip code is updated so get locationId from 'MFIATPInventoryStatus' API response above and updateCartLines()\r\n const cartState = await getCartState(this.props.context.actionContext);\r\n const currentCartLines = cartState.cart.CartLines;\r\n // Dropship Default Warehouse\r\n const defaultWarehouse = this.props.context.app.config.dropShipDefaultWarehouse || '099012';\r\n\r\n if (currentCartLines && currentCartLines.length > 0) {\r\n // Add locationId in CartLines to pass in payload\r\n const updatedCartLines = currentCartLines.map(cartLine => {\r\n // Check if product is dropShip type\r\n const checkProduct = this.state.productSpecifications.find((item) => item.VariantRecordId === cartLine.ProductId);\r\n const typeProduct = checkProduct?.typeOfProduct;\r\n if (typeProduct?.toLowerCase() === 'drop ship') {\r\n // Set default warehouse\r\n // cartLine.FulfillmentStoreId = defaultWarehouse;\r\n cartLine.WarehouseId = defaultWarehouse;\r\n } else {\r\n const cartLineLocationDetails = allProductLocations.find(cartLineDeliveryData => cartLineDeliveryData.itemId === cartLine.ItemId && cartLineDeliveryData.productId === cartLine.ProductId?.toString())?.location;\r\n const locationId = cartLineLocationDetails ? cartLineLocationDetails : '';\r\n // cartLine.FulfillmentStoreId = locationId;\r\n cartLine.WarehouseId = locationId;\r\n }\r\n return cartLine;\r\n });\r\n await updateCartLinesAsync({ callerContext: this.props.context.actionContext }, cartState.cart.Id, updatedCartLines).then(async result => {\r\n const updatedCartState = await getCartState(this.props.context.actionContext);\r\n await updatedCartState.refreshCart({});\r\n }).catch();\r\n }\r\n } catch (error) {\r\n this.props.telemetry.debug('Unable to update cartlines');\r\n }\r\n };\r\n\r\n private updateViewPort = (context: ICoreContext): void => {\r\n const viewport = _getViewPort(context);\r\n if (viewport === 'xs' || viewport === 'sm' || viewport === 'md') {\r\n this.setState({\r\n isTablet: true,\r\n isMobile: true,\r\n isDesktop: false\r\n });\r\n } else {\r\n this.setState({\r\n isTablet: false,\r\n isMobile: false,\r\n isDesktop: true\r\n });\r\n }\r\n };\r\n\r\n private promotionLinkClick = (event: React.MouseEvent) => {\r\n this.setState({\r\n showPromotionDialog: !this.state.showPromotionDialog\r\n });\r\n };\r\n\r\n // tslint:disable-next-line: function-name\r\n private async getProductsSpecifications(props: IMfrmCartProps): Promise {\r\n const {\r\n data: {\r\n products: { result: products },\r\n productAttributes\r\n },\r\n context: {\r\n app: {\r\n config: {\r\n brandBackofficeAttributePdp,\r\n brandList,\r\n smallParcelAttributeKey,\r\n outOfStockProductKey,\r\n deliveryMessageManagementValues,\r\n leadTime\r\n }\r\n },\r\n actionContext\r\n }\r\n } = props;\r\n const getProducts: SimpleProduct[] | undefined = products?.filter(Boolean);\r\n const productAttributesData = productAttributes.result;\r\n if (productAttributesData && productAttributesData.length > 0) {\r\n for (const productSpecItem of productAttributesData) {\r\n\r\n // if(productSpecItem. === 'Core') {\r\n // includeDeliveryInStepper = true;\r\n // }\r\n productSpecItem.attributeValue.find((shippingData) => {\r\n if (shippingData?.TextValue && shippingData.TextValue.trim().toLocaleLowerCase() === 'delivery') {\r\n // includeDeliveryInStepper = true;\r\n this.setState({ showDeliveryStepper: true });\r\n }\r\n });\r\n }\r\n }\r\n const detailsProduct: IProductDetails[] = [];\r\n const localStorageProductDetails: IProductDetails[] = [];\r\n for (let i = 0; i < productAttributesData?.length!; i++) {\r\n const productRecordId = productAttributesData![i].productId;\r\n const newProductSpecificationData = productAttributesData![i].attributeValue;\r\n let typeOfProduct = '';\r\n let outOfStock: boolean = false;\r\n let outOfStockSmallParcel: boolean = false;\r\n let leadTimeVal: string | undefined = '';\r\n let brandLeadTime: string = '';\r\n let collection: string | undefined = '';\r\n collection = (newProductSpecificationData.find(item => item.Name?.trim().toLocaleLowerCase() === 'Collection'?.trim().toLocaleLowerCase())?.TextValue);\r\n const brand = brandBackofficeAttributePdp && newProductSpecificationData?.find(attr => attr.Name?.trim() === brandBackofficeAttributePdp)?.TextValue?.toLowerCase();\r\n if (!!brand) {\r\n brandList?.map((brandList: IBrandListData) => {\r\n if (brandList.brandName.toLowerCase() === brand) {\r\n brandLeadTime = (brandList?.brandLeadtime !== undefined && brandList?.brandLeadtime !== '' && brandList?.brandLeadtime !== null) ? brandList?.brandLeadtime : '';\r\n }\r\n });\r\n }\r\n deliveryMessageManagementValues?.map((value: { shippingInformation: string }) => {\r\n const getShippingInfo = !!newProductSpecificationData.find(item => item.Name === smallParcelAttributeKey && item.TextValue && item.TextValue?.trim().toLowerCase() === value.shippingInformation?.trim().toLowerCase());\r\n leadTimeVal = (newProductSpecificationData.find(item => item.Name?.trim().toLocaleLowerCase() === leadTime?.trim().toLocaleLowerCase())?.TextValue);\r\n if (getShippingInfo) {\r\n typeOfProduct = (value.shippingInformation.trim().toLocaleLowerCase() === 'delivery') ? 'Core' : value.shippingInformation;\r\n if (typeOfProduct?.toLowerCase() !== 'core') {\r\n outOfStock = !!newProductSpecificationData.find(item => item.Name === outOfStockProductKey && item.BooleanValue === true);\r\n }\r\n }\r\n });\r\n const Quantity = await this._getCartLinesData(productRecordId);\r\n const brandName = parseBrandName(newProductSpecificationData, this.props.context.app.config.brandBackofficeAttributePdp, productAttributesData![i].productId);\r\n const ItemId = getProducts![i]?.ItemId || '';\r\n const VariantRecordId = productAttributesData![i].productId;\r\n const ProductCategoryName = productAttributesData![i].categoryName;\r\n const zipCodeError = false;\r\n outOfStockSmallParcel = outOfStock;\r\n ///// For payment Review ///////////\r\n const name: string = (productAttributesData![i].Name !== undefined) ? productAttributesData![i].Name! : '';\r\n let dimStr = '';\r\n const dimStrArr: string[] = [];\r\n if (getProducts![i].Dimensions) {\r\n for (const dim of getProducts![i].Dimensions!) {\r\n if (dim.DimensionTypeValue === 1 || dim.DimensionTypeValue === 3) {\r\n dimStrArr.push(dim.DimensionValue?.Value ? dim.DimensionValue?.Value : '');\r\n }\r\n }\r\n }\r\n dimStr = dimStrArr.toString();\r\n dimStr = dimStr.replace(',', ', ');\r\n const variantType: string = dimStr;\r\n const quantityMessage = false;\r\n const primaryImageUrl: string = (productAttributesData![i].PrimaryImageUrl !== undefined) ? productAttributesData![i].PrimaryImageUrl! : '';\r\n const fallbackImageUrl = getFallbackImageUrl(getProducts![i].ItemId, actionContext.requestContext?.apiSettings);\r\n const brandAndProductName = brandName ? `${brandName} ${name}` : name;\r\n const ProducName = name ? name : '';\r\n const MasterProductId = getProducts![i].MasterProductId;\r\n detailsProduct.push({\r\n typeOfProduct, outOfStock, Quantity, ItemId, VariantRecordId, zipCodeError, leadTimeVal, brandLeadTime, collection,\r\n outOfStockSmallParcel, name: brandAndProductName, variantType: '', primaryImageUrl: '', quantityMessage, fallbackImageUrl: '', brandName, brandAndProductName, categoryName: ProductCategoryName\r\n });\r\n localStorageProductDetails.push({\r\n typeOfProduct, outOfStock, Quantity, ItemId, VariantRecordId, zipCodeError, leadTimeVal, brandLeadTime, collection, ProducName, MasterProductId,\r\n outOfStockSmallParcel, name: brandAndProductName, variantType, primaryImageUrl, quantityMessage, fallbackImageUrl: fallbackImageUrl ? fallbackImageUrl : '', brandName\r\n });\r\n }\r\n this.setState({ productDetails: detailsProduct });\r\n getSetProductData('set', detailsProduct);\r\n /* VSI customization START */\r\n getSetProductSpec('set', localStorageProductDetails);\r\n this.tealiumCartDetails(detailsProduct, localStorageProductDetails);\r\n const categoryPath = await this.getProductsCategoryPath(this.props, detailsProduct);\r\n this.setState({\r\n productCategoryPath: categoryPath\r\n });\r\n // localStorage.setItem('product_specification', JSON.stringify(localStorageProductDetails));\r\n /* VSI customization END */\r\n return detailsProduct;\r\n }\r\n\r\n public tealiumCartDetails = async (detailsProduct: IProductDetails[], localStorageProductDetails: IProductDetails[]) => {\r\n const { context, data: {\r\n cart: { result: cart },\r\n productAttributes: { result: productAttributes }\r\n } } = this.props;\r\n\r\n const originUrl = this.props.context.request.url.requestUrl.origin;\r\n const cartState = await getCartState(context.actionContext);\r\n const quantity = cartState && cartState.cart.TotalItems;\r\n const subTotal = cartState && cartState.cart.SubtotalAmount;\r\n const productImageUrl: string[] = [];\r\n const productQuantity: string[] = [];\r\n const productRecordIdArray: number[] = [];\r\n const productURL: string[] = [];\r\n const productIDsArray: string[] = [];\r\n const productNameArray: string[] = [];\r\n const productSize: string[] = [];\r\n const productPriceArray: string[] = [];\r\n const cartProductPriceArray: string[] = [];\r\n const variantRecord: string[] = [];\r\n const productCatgoryArray: string[] = [];\r\n const productBrandName: (string | undefined)[] = [];\r\n const productDiscountArray: string[] = [];\r\n detailsProduct?.map(details => {\r\n productQuantity.push(`${details?.Quantity}`);\r\n productRecordIdArray.push(details?.VariantRecordId);\r\n productIDsArray.push(details?.ItemId);\r\n productNameArray.push(details?.brandAndProductName!);\r\n });\r\n cart?.cart.CartLines?.map((items) => {\r\n let productDiscount = 0.00;\r\n variantRecord.push(items.Barcode!);\r\n\r\n items.DiscountLines?.map(sales => {\r\n if (sales.DiscountCode) {\r\n productDiscount = productDiscount + sales.EffectiveAmount!;\r\n }\r\n });\r\n const updatedPrice = items.NetAmountWithoutTax! + productDiscount;\r\n cartProductPriceArray.push(`${items.NetAmountWithoutTax}`);\r\n productPriceArray.push(`${updatedPrice?.toFixed(2)?.toString()}`);\r\n productDiscountArray.push(`${productDiscount?.toFixed(2)?.toString()}`);\r\n });\r\n localStorageProductDetails?.map(items => {\r\n productImageUrl.push(items?.primaryImageUrl);\r\n productSize.push(items?.variantType);\r\n\r\n });\r\n this.props.data.products.result?.map(item => {\r\n const urlProduct = this.generateURLForPDP(item, this.props.context);\r\n productURL.push(`${originUrl}${urlProduct}`);\r\n productCatgoryArray.push(`${hasArray(productAttributes)?.find(p => p?.productId === item?.RecordId)?.categoryName}`);\r\n const attr = hasArray(productAttributes)?.find(p => p?.productId === item?.RecordId)?.attributeValue;\r\n const brandName = parseBrandName(attr, this.props.context.app.config.brandBackofficeAttributePdp, item?.RecordId);\r\n productBrandName.push(brandName);\r\n });\r\n const cartUrl = `${originUrl}/cart?qtys=${productQuantity?.join()}&pids=${productRecordIdArray?.join()}&utm_content=MainHero`;\r\n const productDetailsData = {\r\n quantity,\r\n subTotal,\r\n productQuantity,\r\n productSize,\r\n productIDsArray,\r\n productNameArray,\r\n productPriceArray,\r\n variantRecord,\r\n productCatgoryArray,\r\n productBrandName,\r\n productDiscountArray,\r\n cartProductPriceArray\r\n };\r\n const cartProductUrl = { productImageUrl, productURL, cartUrl };\r\n setTealiumCartVariables('tealium_cart_products_details', this.props.context, productDetailsData);\r\n setTealiumCartVariables('tealium_cart_products_url', this.props.context, cartProductUrl);\r\n };\r\n\r\n public generateURLForPDP = (product: SimpleProduct, context: ICoreContext>) => {\r\n let newURL = '';\r\n if (product) {\r\n const variantProductId = product.RecordId;\r\n newURL = getProductUrlSync(product, context.actionContext, undefined);\r\n if (context.app.config.queryBasedVariantSelection) {\r\n newURL = `${newURL}?variantid=${variantProductId}`;\r\n }\r\n return newURL;\r\n }\r\n return newURL;\r\n };\r\n\r\n public generateProductUpdateStrings = () => {\r\n const { data: {\r\n cart: { result: cart },\r\n productAttributes\r\n } } = this.props;\r\n const cookies = new Cookies();\r\n const siteCookie = cookies.get('d365_site');\r\n const originUrl = this.props.context.request.url.requestUrl.origin;\r\n const quantity = cart?.cart.TotalItems;\r\n const subTotal = cart?.cart.SubtotalAmount;\r\n const productPriceArray: string[] = [];\r\n const cartProductPriceArray: string[] = [];\r\n const productIDsArray: string[] = [];\r\n const productImageUrl: string[] = [];\r\n const productQuantity: string[] = [];\r\n const variantRecord: string[] = [];\r\n const productRecordIdArray: string[] = [];\r\n const productNameArray: string[] = [];\r\n const productURL: string[] = [];\r\n const productSize: string[] = [];\r\n const productCatgoryArray: string[] = [];\r\n const productBrandName: string[] = [];\r\n const productDiscountArray: string[] = [];\r\n const urlQuantity: number[] = [];\r\n let isCoreItem: string;\r\n let funnelType: string;\r\n const isCheckCore = this.coreProductAvailable();\r\n if (isCheckCore) {\r\n isCoreItem = \"true\";\r\n funnelType = \"full funnel\";\r\n } else {\r\n isCoreItem = \"false\";\r\n funnelType = \"no core item\";\r\n }\r\n this.props.data.products.result?.map((items) => {\r\n productIDsArray.push(`${items.ItemId}`);\r\n productImageUrl.push(`${items.PrimaryImageUrl}`);\r\n productRecordIdArray.push(`${items.RecordId}`);\r\n const attr = hasArray(productAttributes)?.find(p => p?.productId === items?.RecordId)?.attributeValue;\r\n const brandName = parseBrandName(attr, this.props.context.app.config.brandBackofficeAttributePdp, items?.RecordId);\r\n const nameWithBrand = `${brandName} ${items.Name}`;\r\n productNameArray.push(`${nameWithBrand.toString()}`);\r\n const urlProduct = this.generateURLForPDP(items, this.props.context);\r\n productBrandName.push(`${brandName}`);\r\n productURL.push(`${originUrl}${urlProduct}`);\r\n productCatgoryArray.push(hasArray(productAttributes)?.find(p => p?.productId === items?.RecordId)?.categoryName);\r\n });\r\n cart?.cart.CartLines?.map((items) => {\r\n let productDiscount = 0;\r\n\r\n variantRecord.push(`${items.Barcode}`);\r\n productQuantity.push(`${items.Quantity}`);\r\n urlQuantity.push(items.Quantity!);\r\n productSize.push(`${this.getVariant(this.getProduct(this.props.data.products.result!, items)).toString().replace(/,/g, '')}`);\r\n items.DiscountLines?.map(sales => {\r\n if (sales.DiscountCode) {\r\n productDiscount = productDiscount + sales.EffectiveAmount!;\r\n }\r\n });\r\n const updatedPrice = items.NetAmountWithoutTax! + productDiscount;\r\n cartProductPriceArray.push(`${items.NetAmountWithoutTax!}`);\r\n productPriceArray.push(`${updatedPrice?.toFixed(2)}`);\r\n productDiscountArray.push(`${productDiscount?.toFixed(2)?.toString()}`);\r\n });\r\n const cartUrl = `${originUrl}/cart?qtys=${urlQuantity?.join()}&pids=${productRecordIdArray?.join()}&utm_content=MainHero`;\r\n const productDetailsData = {\r\n productPriceArray,\r\n productIDsArray,\r\n productImageUrl,\r\n productQuantity,\r\n variantRecord,\r\n productNameArray,\r\n quantity,\r\n subTotal,\r\n cartUrl,\r\n siteCookie,\r\n productURL,\r\n productSize,\r\n productCatgoryArray,\r\n productBrandName,\r\n productDiscountArray,\r\n cartProductPriceArray,\r\n isCoreItem,\r\n funnelType\r\n };\r\n\r\n return productDetailsData;\r\n };\r\n\r\n public generateProductData = () => {\r\n const { data: {\r\n cart: { result: cart },\r\n productAttributes\r\n } } = this.props;\r\n const cookies = new Cookies();\r\n const siteCookie = cookies.get('d365_site');\r\n const originUrl = this.props.context.request.url.requestUrl.origin;\r\n const quantity = cart?.cart.TotalItems;\r\n const subTotal = cart?.cart.SubtotalAmount;\r\n const productPriceArray: string[] = [];\r\n const cartProductPriceArray: string[] = [];\r\n const productIDsArray: string[] = [];\r\n const productImageUrl: string[] = [];\r\n const productQuantity: string[] = [];\r\n const variantRecord: string[] = [];\r\n const productRecordIdArray: string[] = [];\r\n const productNameArray: string[] = [];\r\n const productURL: string[] = [];\r\n const productSize: string[] = [];\r\n const productCatgoryArray: string[] = [];\r\n const productBrandName: string[] = [];\r\n const productDiscountArray: string[] = [];\r\n const urlQuantity: number[] = [];\r\n let isCoreItem: string;\r\n let funnelType: string;\r\n this.props.data.products.result?.map((items) => {\r\n productIDsArray.push(`\"${items.ItemId}\"`);\r\n productImageUrl.push(`\"${items.PrimaryImageUrl}\"`);\r\n productRecordIdArray.push(`${items.RecordId}`);\r\n const attr = hasArray(productAttributes)?.find(p => p?.productId === items?.RecordId)?.attributeValue;\r\n const brandName = parseBrandName(attr, this.props.context.app.config.brandBackofficeAttributePdp, items?.RecordId);\r\n const nameWithBrand = `${brandName?.replace(/'/g, \"\")} ${items.Name?.replace(/'/g, \"\")}`;\r\n productNameArray.push(`'${nameWithBrand.toString()}'`);\r\n const urlProduct = this.generateURLForPDP(items, this.props.context);\r\n productURL.push(`\"${originUrl}${urlProduct}\"`);\r\n productBrandName.push(`\"${brandName?.replace(/'/g, \"\")}\"`);\r\n productCatgoryArray.push(`\"${hasArray(productAttributes)?.find(p => p?.productId === items?.RecordId)?.categoryName}\"`);\r\n });\r\n cart?.cart.CartLines?.map((items) => {\r\n let productDiscount = 0.00;\r\n variantRecord.push(`\"${items.Barcode}\"`);\r\n productQuantity.push(`\"${items.Quantity}\"`);\r\n urlQuantity.push(items.Quantity!);\r\n productSize.push(`'${this.getVariant(this.getProduct(this.props.data.products.result!, items)).toString().replace(/,/g, '')}'`);\r\n items.DiscountLines?.map((sales) => {\r\n if (sales.DiscountCode) {\r\n productDiscount = productDiscount + sales.EffectiveAmount!;\r\n }\r\n });\r\n const updatedPrice = items.NetAmountWithoutTax! + productDiscount;\r\n cartProductPriceArray.push(`\"${items.NetAmountWithoutTax}\"`);\r\n productPriceArray.push(`\"${updatedPrice?.toFixed(2)}\"`);\r\n productDiscountArray.push(`'${productDiscount?.toFixed(2)?.toString()}'`);\r\n });\r\n const isCheckCore = this.coreProductAvailable();\r\n if (isCheckCore) {\r\n isCoreItem = \"true\";\r\n funnelType = \"full funnel\";\r\n } else {\r\n isCoreItem = \"false\";\r\n funnelType = \"no core item\";\r\n }\r\n const cartUrl = `${originUrl}/cart?qtys=${urlQuantity?.join()}&pids=${productRecordIdArray?.join()}&utm_content=MainHero`;\r\n const productDetailsData = {\r\n productPriceArray,\r\n productIDsArray,\r\n productImageUrl,\r\n productQuantity,\r\n variantRecord,\r\n productNameArray,\r\n quantity,\r\n subTotal,\r\n cartUrl,\r\n siteCookie,\r\n productURL,\r\n productSize,\r\n productCatgoryArray,\r\n productBrandName,\r\n productDiscountArray,\r\n cartProductPriceArray,\r\n isCoreItem,\r\n funnelType\r\n };\r\n\r\n return productDetailsData;\r\n };\r\n\r\n\r\n private getProduct = (prods: SimpleProduct[], cartLine: CartLine): SimpleProduct | null => {\r\n for (const pr of prods) {\r\n if (pr.RecordId === cartLine.ProductId) {\r\n return pr;\r\n }\r\n }\r\n return null;\r\n };\r\n\r\n public getVariant = (product: SimpleProduct | null) => {\r\n if (product === null) {\r\n return '';\r\n }\r\n let dimensionValueCustom = '';\r\n product.Dimensions?.map((item, index) => {\r\n if (item.DimensionValue?.Value !== 'Prime') {\r\n if (index === 0) {\r\n dimensionValueCustom += item.DimensionValue?.Value!;\r\n }\r\n else {\r\n dimensionValueCustom += ' , ' + `${item.DimensionValue?.Value!}`;\r\n }\r\n }\r\n });\r\n return dimensionValueCustom;\r\n };\r\n\r\n\r\n private async _getCartLinesData\r\n (recordID: number): Promise {\r\n const { context } = this.props;\r\n const cartState = await getCartState(context.actionContext);\r\n let quantity = 0;\r\n const getQuantity = cartState.cart.CartLines?.find(item => item.ProductId === recordID);\r\n if (getQuantity) {\r\n quantity = getQuantity.Quantity ? getQuantity.Quantity : 0;\r\n }\r\n return quantity;\r\n }\r\n // tslint:disable-next-line: function-name TODO\r\n // private getProductBrandName = (productSpec: IAttributeValueProduct[]): string => {\r\n // const { context } = this.props;\r\n // let brandName = '';\r\n // productSpec?.map((item) => {\r\n // if (item.Name?.toLowerCase() === context.app.config.brandBackofficeAttributePdp?.toLowerCase()) {\r\n // brandName = item.TextValue!;\r\n // }\r\n // });\r\n // return brandName;\r\n // };\r\n\r\n // tslint:disable-next-line:function-name max-line-length cyclomatic-complexity\r\n private async checkSmallParcelOutOfStock(detailsProduct: IProductDetails[], context: ICoreContext>): Promise {\r\n const cookies = new Cookies();\r\n const zipcode = cookies.get('zip_code');\r\n const date = new Date();\r\n const currentDate = date.setDate(date.getDate());\r\n const tempProducts: { ItemId: string; Quantity: number; VariantRecordId: string }[] = [];\r\n // Store small parcel products with their location ids\r\n const smallParcelLocations: IProductLocationDetails[] = [];\r\n\r\n detailsProduct?.forEach((item) => {\r\n if (item?.typeOfProduct === 'Parcel' && !item?.outOfStockSmallParcel) {\r\n tempProducts.push({\r\n ItemId: item.ItemId,\r\n Quantity: 1, // item.Quantity,\r\n VariantRecordId: item.VariantRecordId?.toString()\r\n });\r\n }\r\n });\r\n if (tempProducts?.length) {\r\n const requestBody = {\r\n InventoryType: 'Delivery',\r\n StoreId: '',\r\n Weeks: context.app && context.app.config.weeksPDPforATPCall,\r\n RequestedDate: dayjs(currentDate).format('MM/DD/YYYY'),\r\n ZipCode: zipcode, // '77047',\r\n ItemLines: tempProducts,\r\n NoOfPriorityDC: context.app.config.NoOfPriorityDC ? context.app.config.NoOfPriorityDC : 0\r\n };\r\n const result = await _getInventoryQuantity(requestBody, context, false);\r\n detailsProduct.forEach((prod) => {\r\n result?.ATPInventoryStatusData?.forEach((item) => {\r\n if (item && prod && (prod.VariantRecordId?.toString() === item.VariantRecordId?.toString())) {\r\n prod.outOfStock = item.Available === 'NO';\r\n prod.InventLocationId = item.Location;\r\n prod.deliveryTime = item.Date?.trim().substring(10);\r\n const numberQuantity = item.Quantity;\r\n if (numberQuantity) {\r\n prod.availableQuantity = +numberQuantity;\r\n }\r\n // Check small parcel locations to update in cartLines\r\n const smallParcelDetails: IProductLocationDetails = {\r\n itemId: item.ItemId!,\r\n productId: item.VariantRecordId,\r\n location: item.Location!\r\n };\r\n smallParcelLocations.push(smallParcelDetails);\r\n\r\n }\r\n });\r\n });\r\n\r\n if (result && result.ATPInventoryStatusData && result.ATPInventoryStatusData.length) {\r\n this.setState({ smallParcelLocationDetails: smallParcelLocations }); // Set small parcel location to be used in updateCart api call to set location\r\n for (const invData of result.ATPInventoryStatusData) {\r\n if (this.props.data.cart.result?.cart.CartLines && this.props.data.cart.result?.cart.CartLines.length) {\r\n for (const cLin of this.props.data.cart.result?.cart.CartLines) {\r\n const pId = cLin.ProductId;\r\n if (pId?.toString() === invData.VariantRecordId) {\r\n const invQuantity = (invData.Quantity && invData.Quantity?.length) ? parseInt(invData.Quantity, 10) : 0;\r\n if (cLin.Quantity && (cLin.Quantity > invQuantity) && invData.Available !== 'NO') {\r\n await this._updateCartlineQuantityWithAvailableQuantity(cLin, invQuantity);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if (detailsProduct && detailsProduct.length > 0) {\r\n this.setState({\r\n productSpecifications: detailsProduct,\r\n productDetails: detailsProduct\r\n });\r\n getSetProductData('set', detailsProduct);\r\n }\r\n detailsProduct && detailsProduct.length > 0 && this.renderDeliveryMessage(detailsProduct);\r\n return detailsProduct;\r\n }\r\n\r\n // tslint:disable: max-func-body-length\r\n private renderDeliveryMessage = (collectiveProductDetails: IProductDetails[]) => {\r\n const { context } = this.props;\r\n const parcelDropShipProducts: IProductDetails[] = [];\r\n const allDropParceldMsgs: ICoreDeliveryByMessage[] = [];\r\n const newSPDS_Att: ICoreDeliveryByMessage[] = [];\r\n let smallParcelLatestDay: Dayjs;\r\n let dropShipLatestDay: Dayjs;\r\n let lastSmallParcelDay: Dayjs;\r\n let lastDropShipDay: Dayjs;\r\n const cookies = new Cookies();\r\n collectiveProductDetails?.map((item, index) => {\r\n if (item.typeOfProduct.toLowerCase() === 'parcel' || item.typeOfProduct.toLowerCase() === 'drop ship') {\r\n parcelDropShipProducts.push(item);\r\n }\r\n });\r\n // tslint:disable: cyclomatic-complexity\r\n parcelDropShipProducts?.map((itemsMessage) => {\r\n const deliveryDays = itemsMessage.leadTimeVal || itemsMessage.brandLeadTime;\r\n if (!itemsMessage.outOfStock && deliveryDays !== undefined && deliveryDays !== '') {\r\n let deliveryByMessage = '';\r\n let deliveryByMessageRange: string = '';\r\n let date = new Date();\r\n const daysSpan = deliveryDays?.split('-');\r\n const deliveryDate = date.setDate(date.getDate());\r\n if (daysSpan && daysSpan[1] !== undefined && daysSpan.length) {\r\n daysSpan.map((item: string, index: number) => {\r\n if (parseInt(item, 10) > 0) {\r\n let numberOfDays = parseInt(item, 10);\r\n let newDate = deliveryDate;\r\n date = new Date();\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} - ${deliveryByMessage}`;\r\n } else {\r\n deliveryByMessageRange = deliveryByMessage;\r\n newDate = date.setDate(date.getDate() - parseInt(item[0], 10));\r\n }\r\n ///// for payment review //////////\r\n if (itemsMessage.typeOfProduct.toLowerCase() === 'parcel') {\r\n if (smallParcelLatestDay === undefined || smallParcelLatestDay === null) {\r\n smallParcelLatestDay = dayjs(newDate);\r\n } else if (dayjs(newDate) > smallParcelLatestDay) {\r\n smallParcelLatestDay = dayjs(newDate);\r\n }\r\n } else if (itemsMessage.typeOfProduct.toLowerCase() === 'drop ship') {\r\n if (dropShipLatestDay === undefined || dropShipLatestDay === null) {\r\n dropShipLatestDay = dayjs(newDate);\r\n } else if (dayjs(newDate) > dropShipLatestDay) {\r\n dropShipLatestDay = dayjs(newDate);\r\n }\r\n }\r\n ///// for payment review //////////\r\n }\r\n });\r\n deliveryByMessage = deliveryByMessageRange;\r\n ///// for payment review //////////\r\n if (itemsMessage.typeOfProduct.toLowerCase() === 'parcel') {\r\n if (lastSmallParcelDay === undefined || lastSmallParcelDay === null) {\r\n lastSmallParcelDay = smallParcelLatestDay;\r\n context.actionContext.update(new CartDataInfoInput(), { delMessageParcelLatest: deliveryByMessage });\r\n cookies.set(`payment_review_parcel_latest_del_msg`, deliveryByMessage, { path: '/' });\r\n } else if (lastSmallParcelDay < smallParcelLatestDay) {\r\n lastSmallParcelDay = smallParcelLatestDay;\r\n context.actionContext.update(new CartDataInfoInput(), { delMessageParcelLatest: deliveryByMessage });\r\n cookies.set(`payment_review_parcel_latest_del_msg`, deliveryByMessage, { path: '/' });\r\n }\r\n } else if (itemsMessage.typeOfProduct.toLowerCase() === 'drop ship') {\r\n if (lastDropShipDay === undefined || lastDropShipDay === null) {\r\n lastDropShipDay = dropShipLatestDay;\r\n context.actionContext.update(new CartDataInfoInput(), { delMessageDropShipLatest: deliveryByMessage });\r\n cookies.set(`payment_review_dropship_latest_del_msg`, deliveryByMessage, { path: '/' });\r\n } else if (lastDropShipDay < dropShipLatestDay) {\r\n lastDropShipDay = dropShipLatestDay;\r\n context.actionContext.update(new CartDataInfoInput(), { delMessageDropShipLatest: deliveryByMessage });\r\n cookies.set(`payment_review_dropship_latest_del_msg`, deliveryByMessage, { path: '/' });\r\n }\r\n }\r\n ///// for payment review //////////\r\n allDropParceldMsgs.push({\r\n itemID: itemsMessage.ItemId,\r\n variantID: itemsMessage.VariantRecordId.toString(),\r\n deliveryByMessage: `Delivery by ${deliveryByMessage}`,\r\n daySpan: deliveryDays\r\n });\r\n newSPDS_Att.push({\r\n itemID: itemsMessage.ItemId,\r\n variantID: itemsMessage.VariantRecordId.toString(),\r\n deliveryByMessage: `${deliveryByMessage}`,\r\n daySpan: deliveryDays\r\n });\r\n } else {\r\n deliveryByMessage = this._deliveryMessage(deliveryDays);\r\n ///// for payment review //////////\r\n if (itemsMessage.typeOfProduct.toLowerCase() === 'parcel') {\r\n if (smallParcelLatestDay === undefined || smallParcelLatestDay === null) {\r\n smallParcelLatestDay = dayjs(deliveryDays);\r\n } else if (dayjs(deliveryDays) > smallParcelLatestDay) {\r\n smallParcelLatestDay = dayjs(deliveryDays);\r\n }\r\n } else if (itemsMessage.typeOfProduct.toLowerCase() === 'drop ship') {\r\n if (dropShipLatestDay === undefined || dropShipLatestDay === null) {\r\n dropShipLatestDay = dayjs(deliveryDays);\r\n } else if (dayjs(deliveryDays) > dropShipLatestDay) {\r\n dropShipLatestDay = dayjs(deliveryDays);\r\n }\r\n }\r\n\r\n if (itemsMessage.typeOfProduct.toLowerCase() === 'parcel') {\r\n if (lastSmallParcelDay === undefined || lastSmallParcelDay === null) {\r\n lastSmallParcelDay = smallParcelLatestDay;\r\n context.actionContext.update(new CartDataInfoInput(), { delMessageParcelLatest: deliveryByMessage });\r\n cookies.set(`payment_review_parcel_latest_del_msg`, deliveryByMessage, { path: '/' });\r\n } else if (lastSmallParcelDay < smallParcelLatestDay) {\r\n lastSmallParcelDay = smallParcelLatestDay;\r\n context.actionContext.update(new CartDataInfoInput(), { delMessageParcelLatest: deliveryByMessage });\r\n cookies.set(`payment_review_parcel_latest_del_msg`, deliveryByMessage, { path: '/' });\r\n }\r\n } else if (itemsMessage.typeOfProduct.toLowerCase() === 'drop ship') {\r\n if (lastDropShipDay === undefined || lastDropShipDay === null) {\r\n lastDropShipDay = dropShipLatestDay;\r\n context.actionContext.update(new CartDataInfoInput(), { delMessageDropShipLatest: deliveryByMessage });\r\n cookies.set(`payment_review_dropship_latest_del_msg`, deliveryByMessage, { path: '/' });\r\n } else if (lastDropShipDay < dropShipLatestDay) {\r\n lastDropShipDay = dropShipLatestDay;\r\n context.actionContext.update(new CartDataInfoInput(), { delMessageDropShipLatest: deliveryByMessage });\r\n cookies.set(`payment_review_dropship_latest_del_msg`, deliveryByMessage, { path: '/' });\r\n }\r\n }\r\n newSPDS_Att.push({\r\n itemID: itemsMessage.ItemId,\r\n variantID: itemsMessage.VariantRecordId.toString(),\r\n deliveryByMessage: `${deliveryByMessage}`,\r\n daySpan: deliveryDays\r\n });\r\n ///// for payment review //////////\r\n allDropParceldMsgs.push({\r\n itemID: itemsMessage.ItemId,\r\n variantID: itemsMessage.VariantRecordId.toString(),\r\n deliveryByMessage: `Delivery by ${deliveryByMessage}`,\r\n daySpan: deliveryDays\r\n });\r\n }\r\n }\r\n });\r\n if (allDropParceldMsgs && allDropParceldMsgs.length > 0) {\r\n this.setState({ deliveryByMessageSPDS: allDropParceldMsgs });\r\n }\r\n if (newSPDS_Att && newSPDS_Att.length > 0) {\r\n const newProductDetails: IProductDetails[] = [];\r\n this.state.productDetails?.map((items) => {\r\n const getDateDetails = newSPDS_Att?.find(data => Number(data?.variantID) === Number(items?.VariantRecordId));\r\n if (getDateDetails) {\r\n let currentYear = dayjs().year();\r\n const datedValues = items?.leadTimeVal?.split('-') || [];\r\n if (datedValues?.length > 1) {\r\n const numberOfDays = Number(datedValues[0]) + Number(datedValues[1]);\r\n currentYear = dayjs().add(numberOfDays, 'd').year();\r\n } else if (datedValues?.length === 1) {\r\n currentYear = dayjs().add(Number(datedValues[0]), 'd').year();\r\n }\r\n const date = getDateDetails?.deliveryByMessage?.split('-');\r\n if (date?.length > 1) {\r\n const getDate = dayjs(`${date[1]} ${currentYear}`).format('MM/DD/YYYY');\r\n const fullDate = `${getDate} ${items?.deliveryTime ? items?.deliveryTime : '12:00:00 AM'}`;\r\n const formatDeliveryDate = dayjs(fullDate).format('YYYY-MM-DDTHH:mm:ss');\r\n items.DeliveryDate = formatDeliveryDate;\r\n items.RequestedDeliveryDate = fullDate;\r\n } else {\r\n const getDate = dayjs(`${date[0]} ${currentYear}`).format('MM/DD/YYYY');\r\n const fullDate = `${getDate} ${items?.deliveryTime ? items?.deliveryTime : '12:00:00 AM'}`;\r\n const formatDeliveryDate = dayjs(fullDate).format('YYYY-MM-DDTHH:mm:ss');\r\n items.DeliveryDate = formatDeliveryDate;\r\n items.RequestedDeliveryDate = fullDate;\r\n }\r\n }\r\n newProductDetails.push(items);\r\n });\r\n getSetProductData('set', newProductDetails);\r\n }\r\n };\r\n\r\n private _deliveryMessage = (days: string) => {\r\n const date = new Date();\r\n const deliveryDate = date.setDate(date.getDate());\r\n let deliveryByMessage = '';\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 = (flag && days === '1') ? `Tomorrow ${dayjs(date.setDate(date.getDate())).format('MMM D')}` : dayjs(newDate).format('ddd, MMM D');\r\n return deliveryByMessage;\r\n };\r\n\r\n // tslint:disable-next-line:function-name\r\n private async checkCoreProductErrorZipCode(detailsProduct: IProductDetails[]): Promise {\r\n const { oomZipCode } = this.state;\r\n detailsProduct?.forEach((item) => {\r\n if (item?.typeOfProduct === 'Core') {\r\n if (oomZipCode) {\r\n item.zipCodeError = true;\r\n item.outOfStock = false;\r\n } else {\r\n item.zipCodeError = false;\r\n }\r\n }\r\n });\r\n return detailsProduct;\r\n }\r\n // tslint:disable-next-line: function-name\r\n private async getProductsCategoryPath(props: IMfrmCartProps, detailsProduct: IProductDetails[]): Promise {\r\n const {\r\n data: {\r\n products: { result: products }\r\n },\r\n app: { config },\r\n context: {\r\n request: {\r\n apiSettings: {\r\n catalogId\r\n }\r\n }\r\n }\r\n } = props;\r\n const getProducts: SimpleProduct[] = products || [];\r\n const getProductIdArray = [];\r\n for (let i = 0; i < getProducts?.length; i++) {\r\n getProductIdArray.push(getProducts[i].RecordId);\r\n }\r\n const productsCategories = await getProductsCategoryPathsAction(new GetCategoryPathsInput(props.context.request, catalogId, getProductIdArray), props.context.actionContext);\r\n const getSpecifications = detailsProduct;\r\n const revenueCategoryConfig = this.props.app.config.revenueCategory;\r\n const newProductSpecification = getSpecifications?.map((item) => {\r\n const checkCategory = productsCategories.find(data => data.ProductId === item.VariantRecordId);\r\n const getSegments = checkCategory && checkCategory.CategoryPath && checkCategory.CategoryPath;\r\n let stopProccess = false;\r\n getSegments?.forEach((path) => {\r\n path && path.Segments && path.Segments?.forEach((itemName) => {\r\n const checkExist = revenueCategoryConfig.find((revenueItemName: IRevenueDetails) => itemName?.CategoryName?.toLowerCase()?.trim() === revenueItemName?.CategoryName?.toLowerCase()?.trim());\r\n if (checkExist) {\r\n stopProccess = true;\r\n item.revenueCategory = checkExist?.Name;\r\n item.categoryName = checkExist?.CategoryName;\r\n } else {\r\n if (itemName?.CategoryName === this.props.resources.mattresses\r\n || itemName?.CategoryName === this.props.resources.adjustableBases\r\n || itemName?.CategoryName === this.props.resources.boxSprings\r\n || itemName?.CategoryName === this.props.resources.pillows\r\n || itemName?.CategoryName === this.props.resources.babyAndKids) {\r\n item.categoryName = itemName?.CategoryName;\r\n }\r\n if (!stopProccess) {\r\n item.revenueCategory = config.otherRevenueDetail;\r\n }\r\n }\r\n });\r\n });\r\n return item;\r\n });\r\n this.setState({ productDetails: newProductSpecification, productSpecifications: newProductSpecification });\r\n getSetProductData('set', newProductSpecification);\r\n return productsCategories?.filter(Boolean);\r\n }\r\n\r\n // tslint:disable-next-line: no-any\r\n /* eslint-disable @typescript-eslint/no-floating-promises */\r\n private _giftCart = (cartlineTo: CartLine, context: any) => {\r\n this._showCtaGiftProducts(cartlineTo, context, this.props.data.cart.result?.cart.CartLines);\r\n };\r\n\r\n private promotionCloseButtonclick = () => {\r\n this._hidePromotionDialog();\r\n };\r\n\r\n private _hidePromotionDialog(): void {\r\n this.setState({\r\n showPromotionDialog: false\r\n });\r\n }\r\n\r\n /*============================Zip-Code merging=================================*/\r\n private _renderUpdateZipCode = (): JSX.Element => {\r\n const {\r\n context: {\r\n app: { config: findStoreRedirectLink }\r\n }\r\n } = this.props;\r\n // const cookies = new Cookies();\r\n // const zipcode = cookies.get('zip_code');\r\n // const defaultZipCode = geoLocation?.zipCode || '';\r\n // this.setState({newZipCode:zipcode || defaultZipCode});\r\n const findstoreLink = findStoreRedirectLink ? findStoreRedirectLink : '';\r\n const _onChangeInput = (event: React.ChangeEvent): void => {\r\n const pattern = /[^0-9]/g;\r\n if (!pattern.test(event.target.value)) {\r\n this.setState({ newZipCode: event.target.value, showError: false });\r\n // setNewZipCode(event.target.value);\r\n // setShowError(false);\r\n }\r\n };\r\n\r\n const _onFormSubmit = (event: React.FormEvent) => {\r\n event.preventDefault();\r\n if (this._updateZipCode(this.state.newZipCode, this.props, this.state.errorZipCode, this.state.showError)) {\r\n // this.setState({isInput:!this.state.isInput ? true:false});\r\n // setIsInput(prevState => !prevState);\r\n }\r\n };\r\n\r\n const _showZipCodeInput = () => {\r\n this.setState({ isInput: !this.state.isInput ? true : false, newZipCode: this.state.newZipCode });\r\n // setIsInput(prevState => !prevState);\r\n // setNewZipCode(newZipCode);\r\n };\r\n const _onFocusInput = (event: React.FocusEvent) => {\r\n event.currentTarget.select();\r\n };\r\n\r\n const addSpacesZipCode = (zipCode: string) => {\r\n return zipCode?.toString().split('').join(' ');\r\n };\r\n return (\r\n \r\n {/* VSI Customization {52133} */}\r\n \r\n \r\n {`${this.props.resources.cartDeliveryText} ${addSpacesZipCode(this.state.showZipCodeDelivery)}`}\r\n \r\n \r\n \r\n {this.state.isInput ?\r\n <>\r\n \r\n \r\n Zip Code\r\n \r\n {this.props.resources.updateZipCodeButtonText}\r\n \r\n \r\n {this.state.showError ? \r\n {this.props.resources.cartInvalidZipCode}\r\n : <>}\r\n \r\n :\r\n <>\r\n \r\n {this.props.resources.changeZipCodeButtonText}\r\n {addSpacesZipCode(this.state.showZipCodeDelivery)}\r\n \r\n {/* VSI Customization {52133} End*/}\r\n {this.state.errorZipCode !== '' ?
: <>}\r\n {this.state.showFindStore && \r\n {this.props.resources.findStoreText}\r\n }\r\n \r\n }\r\n \r\n );\r\n };\r\n\r\n private _getStateFromZipCode = (props: IMfrmCartProps, zipcode: string, disabled: boolean) => {\r\n disabled && this.props.context.actionContext.update(new PromoCodeAppliedOnCartInput(), { isInProcess: true });\r\n const { telemetry, resources } = this.props;\r\n if (!hasArray(this.props.data.cart.result?.cart?.CartLines) || !zipcode) {\r\n if (!zipcode) {\r\n this.props.context.actionContext.update(new PromoCodeAppliedOnCartInput(), { isInProcess: true });\r\n this.setState({ errorZipCode: resources.cartInvalidZipCode, showError: true, isInput: true });\r\n }\r\n return;\r\n }\r\n this.setState({ errorZipCode: '', disableCheckoutButton: false, showFindStore: false, oomZipCode: false });\r\n // disableCheckoutButton = false;\r\n getAddressFromZipCodeAsync({ callerContext: props.context.actionContext }, 'USA', zipcode)\r\n .then(async zipcodes => {\r\n if (zipcodes && zipcodes.length) {\r\n const stateObj = zipcodes[0];\r\n const cookies = new Cookies();\r\n cookies.set(`zip_code`, zipcode, { path: '/', expires: oneYearFromNow() });\r\n this.setState({ isInput: false, showZipCodeDelivery: zipcode });\r\n const getMessageValue = getBlockZipCodeMessage(stateObj.StateId || '', props.context.app.config.blockedStates);\r\n if (getMessageValue && getMessageValue.length > 0) {\r\n this.setState({ errorZipCode: getMessageValue[0].message, disableCheckoutButton: true });\r\n if (getMessageValue && getMessageValue[0].hasStore) {\r\n this.setState({ showFindStore: true });\r\n }\r\n const result = this.checkCoreProductErrorZipCode(this.state.productDetails);\r\n result.then((products) => {\r\n this.setState({\r\n productSpecifications: products,\r\n productDetails: products,\r\n showDeliveryStepper: false\r\n });\r\n getSetProductData('set', products);\r\n this.props.context.actionContext.update(new PromoCodeAppliedOnCartInput(), { isInProcess: false });\r\n }).catch((error) => {\r\n this.props.context.actionContext.update(new PromoCodeAppliedOnCartInput(), { isInProcess: false });\r\n telemetry.warning(error);\r\n telemetry.debug('Unable to Check core product zip code when change zip code');\r\n });\r\n // disableCheckoutButton = true;\r\n } else {\r\n await this.checkSmallParcelOutOfStock(this.state.productDetails, props.context);\r\n this._updateATPMessagesForCoreProducts().then(async res => {\r\n const cartState = await getCartState(props.context.actionContext);\r\n if (cartState && cartState?.cart.CartLines?.length! > 0 && this.props.context.app.config.calculateTaxOnCart) {\r\n await this._getUpdatedTaxValue(this.props, stateObj.CityName, stateObj.StateId, stateObj.CountryRegionId);\r\n }\r\n });\r\n this.props.context.actionContext.update(new PromoCodeAppliedOnCartInput(), { isInProcess: false });\r\n // this.getProductsSpecifications(this.props);\r\n }\r\n } else if (zipcodes && zipcodes.length === 0) {\r\n this.props.context.actionContext.update(new PromoCodeAppliedOnCartInput(), { isInProcess: false });\r\n this.setState({ errorZipCode: resources.cartInvalidZipCode, showError: true, isInput: true });\r\n }\r\n })\r\n .catch((error) => {\r\n this.props.context.actionContext.update(new PromoCodeAppliedOnCartInput(), { isInProcess: false });\r\n telemetry.warning(error);\r\n telemetry.debug('Unable to getAddressFromZipCodeAsync when change zip code');\r\n });\r\n };\r\n\r\n private _getUpdateLinbeDeliveryCall = (props: IMfrmCartProps, zipcode: string, setErrorZipCode: string, typeProduct: string) => {\r\n const { telemetry, resources } = this.props;\r\n this.setState({ errorZipCode: '', disableCheckoutButton: false, showFindStore: false, oomZipCode: false });\r\n // disableCheckoutButton = false;\r\n getAddressFromZipCodeAsync({ callerContext: props.context.actionContext }, 'USA', zipcode)\r\n .then(async zipcodes => {\r\n if (zipcodes && zipcodes.length) {\r\n const stateObj = zipcodes[0];\r\n const cookies = new Cookies();\r\n cookies.set(`zip_code`, zipcode, { path: '/', expires: oneYearFromNow() });\r\n this.setState({ isInput: false, showZipCodeDelivery: zipcode });\r\n const getMessageValue = getBlockZipCodeMessage(stateObj.StateId || '', props.context.app.config.blockedStates);\r\n if (getMessageValue && getMessageValue.length > 0) {\r\n this.setState({ errorZipCode: getMessageValue[0].message, disableCheckoutButton: true });\r\n if (getMessageValue && getMessageValue[0].hasStore) {\r\n this.setState({ showFindStore: true });\r\n }\r\n const result = this.checkCoreProductErrorZipCode(this.state.productDetails);\r\n result.then((products) => {\r\n this.setState({\r\n productSpecifications: products,\r\n productDetails: products,\r\n showDeliveryStepper: false\r\n });\r\n getSetProductData('set', products);\r\n }).catch((error) => {\r\n telemetry.warning(error);\r\n telemetry.debug('Unable to checkCoreProductErrorZipCode when cart update');\r\n });\r\n // disableCheckoutButton = true;\r\n } else {\r\n const cartState = await getCartState(props.context.actionContext);\r\n if (cartState && cartState?.cart.CartLines?.length! > 0 && this.props.context.app.config.calculateTaxOnCart) {\r\n await this._getUpdatedTaxValue(this.props, stateObj.CityName, stateObj.StateId, stateObj.CountryRegionId);\r\n }\r\n if (typeProduct.toLowerCase() === 'parcel') {\r\n this.renderDeliveryMessage(this.state.productDetails);\r\n // this.getProductsSpecifications(this.props);\r\n }\r\n }\r\n } else if (zipcodes && zipcodes.length === 0) {\r\n this.setState({ errorZipCode: resources.cartInvalidZipCode, showError: true, isInput: true });\r\n }\r\n })\r\n .catch((error) => {\r\n telemetry.warning(error);\r\n telemetry.debug('Unable to getAddressFromZipCodeAsync when cart update');\r\n });\r\n };\r\n\r\n private _updateZipCode = (newZipCode: string, props: IMfrmCartProps, setErrorZipCode: string, setShowError: boolean) => {\r\n if (newZipCode.length === 5) {\r\n this._getStateFromZipCode(props, newZipCode, true);\r\n this.setState({ newZipCode: newZipCode });\r\n\r\n return true;\r\n }\r\n this.setState({ showError: true });\r\n // setShowError(true);\r\n return false;\r\n };\r\n\r\n private _getUpdatedTaxValue = async (props: IMfrmCartProps, cityName: string | undefined, StateId: string | undefined, threeLetterISOId: string | undefined) => {\r\n const {\r\n data: { cart: result },\r\n context: {\r\n app: { config }\r\n },\r\n telemetry\r\n } = props;\r\n const { deliveryMessageManagementValues, TaxGroup, RecycleFeeAttribute } = config;\r\n const cartState = await getCartState(props.context.actionContext);\r\n const cartData = (await result)?.cart;\r\n const cookies = new Cookies();\r\n let typeOfProduct: string = '';\r\n const cartId = (await result)?.cart?.Id;\r\n const zipCode = cookies.get('zip_code');\r\n const lineDeliverySpecificationValue: LineDeliverySpecification[] = [];\r\n const { deliveryServices } = this.props.app.config;\r\n const newCartLineData: CartLine[] = [];\r\n (await result)?.cart?.CartLines?.map((item) => {\r\n const checkExist = !!deliveryServices.find((val: { serviceProductRecId: number }) => val.serviceProductRecId === item.ProductId);\r\n if (!checkExist) {\r\n newCartLineData.push(item);\r\n }\r\n });\r\n const productspecificationsDetails: IProductDetails[] = getSetProductData('get');\r\n const productTypesSpec = this.state.productDetails.length > 0 ? this.state.productDetails : productspecificationsDetails;\r\n\r\n newCartLineData?.map((lineItems, index) => {\r\n productTypesSpec?.map((prductItems) => {\r\n if (lineItems.ProductId === prductItems.VariantRecordId) {\r\n const checkType = deliveryMessageManagementValues.find((item: { shippingInformation: string }) => item.shippingInformation === prductItems.typeOfProduct);\r\n typeOfProduct = prductItems.typeOfProduct === 'Core' ? 'Delivery' : checkType?.MOD;\r\n }\r\n });\r\n lineDeliverySpecificationValue.push({\r\n LineId: lineItems.LineId,\r\n DeliverySpecification: {\r\n DeliveryModeId: typeOfProduct,\r\n DeliveryPreferenceTypeValue: 1,\r\n DeliveryAddress: {\r\n Name: '',\r\n AddressTypeValue: 6,\r\n City: cityName,\r\n State: StateId,\r\n Street: '',\r\n ZipCode: zipCode,\r\n ThreeLetterISORegionName: threeLetterISOId,\r\n TaxGroup: TaxGroup\r\n }\r\n }\r\n });\r\n });\r\n if (cartId) {\r\n try {\r\n const deliverySpecification = await cartOperationDoRetry(() => updateCartLineDeliverySpecificationsInternal(cartData, lineDeliverySpecificationValue, this.props.context.actionContext), cartState);\r\n if (config.enableCheckoutSalesTaxSolution) {\r\n await this._updateCartLineWarehouseDetails();\r\n }\r\n const fee = deliverySpecification?.ExtensionProperties?.find((item) => item.Key?.toLowerCase() === RecycleFeeAttribute?.toLowerCase())?.Value?.DecimalValue!;\r\n cookies.set(`recycleFee`, fee);\r\n this.props.context.actionContext.update(new GetRecycleFeeCheckoutInput(), { recycleFee: Number(fee), tax: Number(deliverySpecification?.TaxAmount) });\r\n this.setState({\r\n mattressRecyclingFee: props.context.cultureFormatter.formatCurrency(fee)\r\n });\r\n } catch (error) {\r\n telemetry.warning(error);\r\n telemetry.debug('Unable to updateCartLineDelivery to get updated tax');\r\n /* eslint-disable @typescript-eslint/no-floating-promises */\r\n\r\n this.setState({ mattressRecyclingFee: props.resources.yetToBeCalculatedText });\r\n }\r\n }\r\n };\r\n\r\n private _displayAddCartToTemplate(): boolean {\r\n const RetailB2BEcommerceFeatureState = this.props.data.featureState.result?.find(featureState => featureState.Name === 'Dynamics.AX.Application.RetailB2BEcommerceFeature');\r\n if (RetailB2BEcommerceFeatureState?.IsEnabled && this.props.data.customerInformation.result?.IsB2b && this.props.data.orderTemplates.result &&\r\n this.props.data.cart.result?.cart?.CartLines?.length && this.props.data.cart.result.cart.CartLines.length > 0 &&\r\n this.props.data.customerInformation.result) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private _getPromotions(): React.ReactNode {\r\n return (\r\n this.props.config.showAvailablePromotions &&\r\n cartPromotions({\r\n id: this.promotionPopupId,\r\n showPromotionPopup: this.state.showPromotionDialog,\r\n onSeeAllClick: this.promotionLinkClick,\r\n onCloseButtonClick: this.promotionCloseButtonclick,\r\n promotions: this.state.promotionData.promotionOptions,\r\n resources: {\r\n promotionStringHeading: this.props.resources.promotionStringHeading,\r\n promotionLinkText: this.props.resources.promotionLinkText,\r\n promotionPopupHeading: this.props.resources.promotionPopupHeading,\r\n promotionCloseButtonAriaLabel: this.props.resources.promotionCloseButtonAriaLabel\r\n }\r\n })\r\n );\r\n }\r\n\r\n private _getOrderSummaryErrors(cartLines: ICartlinesViewProps[] | null): IOrderSummaryErrors | undefined {\r\n const allErrors = cartLines && cartLines.map((cartline, i) => {\r\n // check if the product is service or not by product type\r\n const PRODUCTASSERVICE = 2 as ReleasedProductType.Service;\r\n const isServiceItem = cartline.data?.product?.ItemTypeValue === PRODUCTASSERVICE;\r\n if (!isServiceItem && cartline.error) {\r\n const fullError = (cartline.data && cartline.data.product?.Name) ? `${cartline.data.product.Name}: ${cartline.error}` : cartline.error;\r\n\r\n return (\r\n
{fullError}
\r\n );\r\n }\r\n\r\n return null;\r\n }).filter((line): line is JSX.Element => !!line) || [];\r\n\r\n return {\r\n Wrapper: {\r\n tag: Alert,\r\n className: 'msc-alert',\r\n isOpen: allErrors.length > 0,\r\n color: 'danger',\r\n assertive: true,\r\n 'aria-label': this.props.resources.outOfStockErrorMessageHeader\r\n },\r\n header: (\r\n \r\n ),\r\n errors: allErrors\r\n };\r\n }\r\n\r\n private deliveryFee = (cartLines: CartLine[] | undefined, deliveryOptions: IDeliveryProps[]): number => {\r\n let deliveryFee: number | undefined = 0;\r\n cartLines?.map((item) => {\r\n const checkExist = deliveryOptions?.find(item2 => item.ProductId === item2.serviceProductRecId);\r\n if (checkExist) {\r\n deliveryFee = item.Price;\r\n }\r\n });\r\n return deliveryFee;\r\n };\r\n private _getOrderSummaryLineItems(): IOrderSummaryLines | undefined {\r\n const {\r\n data: {\r\n cart: { result: cart },\r\n channelDeliveryOptionConfig\r\n },\r\n telemetry,\r\n context,\r\n resources\r\n } = this.props;\r\n // this.refreshCartForTax();\r\n const channelConfiguration = context && context.request && context.request.channel;\r\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n const featureState = this.props?.data?.featureState;\r\n const retailMultiplePickUpOptionEnabled = featureState?.result?.find(item => item.Name === multiplePickupStoreSwitchName)?.IsEnabled;\r\n const DeliveryFee = this.deliveryFee(cart?.cart.CartLines, this.props.app.config?.deliveryServices);\r\n return channelConfiguration && ArrayExtensions.hasElements(cart?.cart.CartLines) ?\r\n (\r\n OrderSummary({\r\n cart: cart!.cart,\r\n subTotalLabel: resources.itemsWithCountLabel,\r\n shippingLabel: resources.estimatedShippingLabel,\r\n otherChargeLabel: resources.otherCharges,\r\n mattressRecyclingFee: { label: resources.mattressRecyclingFeeLabel, value: this.state.mattressRecyclingFee },\r\n deliveryFee: { label: resources.deliveryFeeLabel, value: DeliveryFee },\r\n taxLabel: `${resources.estimatedTaxLabel} - ${this.state.showZipCodeDelivery}`,\r\n orderTotalLabel: resources.orderTotal,\r\n totalDiscountsLabel: resources.totalDiscountsLabel,\r\n context: this.props.context,\r\n typeName: this.props.typeName,\r\n id: this.props.id,\r\n toBeCalculatedText: resources.yetToBeCalculatedText,\r\n freeText: resources.priceFree,\r\n channelConfiguration: channelConfiguration,\r\n retailMultiplePickUpOptionEnabled: retailMultiplePickUpOptionEnabled,\r\n channelDeliveryOptionConfig: channelDeliveryOptionConfig?.result,\r\n telemetry: telemetry\r\n })\r\n ) : undefined;\r\n }\r\n\r\n private _getPromoCode(): React.ReactNode {\r\n const {\r\n data: {\r\n cart: { result: cart }\r\n },\r\n resources\r\n } = this.props;\r\n\r\n return cart && (\r\n \r\n );\r\n }\r\n\r\n private _generateAddToOrderTemplateDialogResources(resources: IMfrmCartResources): IAddToOrderTemplateDialogResources {\r\n return {\r\n addToOrderTemplateHeader: resources.addToOrderTemplateHeader,\r\n\r\n noOrderTemplatesMessage: resources.noOrderTemplatesMessage,\r\n noOrderTemplatesDescription: resources.noOrderTemplatesDescription,\r\n\r\n createAnOrderTemplateButtonText: resources.createAnOrderTemplateButtonText,\r\n createNewOrderTemplateButtonText: resources.createNewOrderTemplateButtonText,\r\n cancelOrderTemplateCreationButtonText: resources.cancelOrderTemplateCreationButtonText,\r\n\r\n selectTemplatesText: resources.selectTemplatesText,\r\n addToTemplateButtonText: resources.addToTemplateButtonText,\r\n lineItemsText: resources.lineItemsText\r\n };\r\n }\r\n\r\n private _generateItemAddedToOrderTemplateDialogResources(resources: IMfrmCartResources): IItemAddedToOrderTemplateDialogResources {\r\n return {\r\n viewOrderTemplateButtonText: resources.viewOrderTemplateButtonText,\r\n continueShoppingButtonText: resources.continueShoppingButtonText,\r\n itemAddedToOrderTemplateHeaderItemOneText: resources.itemAddedToOrderTemplateHeaderItemOneText,\r\n itemAddedToOrderTemplateHeaderItemFormatText: resources.itemAddedToOrderTemplateHeaderItemFormatText,\r\n itemAddedToOrderTemplateHeaderMessageText: resources.itemAddedToOrderTemplateHeaderMessageText,\r\n freePriceText: resources.freePriceText,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText\r\n };\r\n }\r\n\r\n private _generateLinesAddedToOrderTemplateDialogResources(resources: IMfrmCartResources): ILinesAddedToOrderTemplateDialogResources {\r\n return {\r\n viewOrderTemplateButtonText: resources.viewOrderTemplateButtonText,\r\n continueShoppingButtonText: resources.continueShoppingButtonText,\r\n linesAddedToOrderTemplateHeaderItemsOneText: resources.linesAddedToOrderTemplateHeaderItemsOneText,\r\n linesAddedToOrderTemplateHeaderItemsFormatText: resources.linesAddedToOrderTemplateHeaderItemsFormatText,\r\n linesAddedToOrderTemplateHeaderLinesOneText: resources.linesAddedToOrderTemplateHeaderLinesOneText,\r\n linesAddedToOrderTemplateHeaderLinesFormatText: resources.linesAddedToOrderTemplateHeaderLinesFormatText,\r\n linesAddedToOrderTemplateHeaderMessageText: resources.linesAddedToOrderTemplateHeaderMessageText\r\n };\r\n }\r\n\r\n private _generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(resources: IMfrmCartResources): IDuplicateItemsWhenAddingToOrderTemplateDialogResources {\r\n return {\r\n duplicatedProductsHeader: resources.duplicatedProductsHeader,\r\n duplicatedProductsDescription: resources.duplicatedProductsDescription,\r\n updateQuantityButtonText: resources.updateQuantityButtonText,\r\n cancelDuplicateItemsButtonText: resources.cancelDuplicateItemsButtonText\r\n };\r\n }\r\n\r\n private _generateOrderTemplateNameDialogResources(resources: IMfrmCartResources): IOrderTemplateNameDialogResources {\r\n return {\r\n orderTemplateHeaderLabel: resources.createOrderTemplateHeader,\r\n orderTemplateTitleLabel: resources.orderTemplateTitle,\r\n orderTemplateNameAriaLabel: resources.orderTemplateNameAriaLabel,\r\n orderTemplateDescription: resources.createOrderTemplateDescription,\r\n\r\n defaultOrderTemplateName: resources.defaultOrderTemplateName,\r\n\r\n orderTemplateButtonLabel: resources.createOrderTemplateButtonText,\r\n orderTemplateCancelButtonLabel: resources.cancelNewOrderTemplateCreationButtonText\r\n };\r\n }\r\n /* VSI customization START */\r\n // tslint:disable-next-line: max-func-body-length\r\n private _getCartLines(): ICartlinesViewProps[] | null {\r\n const {\r\n data: {\r\n cart: { result: cart },\r\n wishlists: { result: wishlists },\r\n orderTemplates: { result: orderTemplates },\r\n customerInformation: { result: customerInformation },\r\n productAttributes: { result: productAttributes }\r\n },\r\n context: {\r\n request: {\r\n channel: {\r\n PickupDeliveryModeCode\r\n } = { PickupDeliveryModeCode: undefined }\r\n }\r\n },\r\n config: config,\r\n telemetry,\r\n resources,\r\n modules\r\n } = this.props;\r\n\r\n const imageSettings = this._getImageSettings(config.imageSettings);\r\n\r\n const cartlinesErrors: LineDataValidationFailure[] = this.state.cartlinesErrors;\r\n let storeSelectorId: string = '';\r\n if (modules && Object.keys(modules).length > 0 && modules.storeSelector && modules.storeSelector.length > 0) {\r\n storeSelectorId = modules.storeSelector[0].id;\r\n }\r\n return ArrayExtensions.hasElements(cart?.cart.CartLines) ? (\r\n CartLineItems({\r\n cartlines: cart!.cart.CartLines,\r\n storeSelectorModuleId: storeSelectorId,\r\n cartlinesErrors: cartlinesErrors,\r\n products: this.props.data.products.result,\r\n productSpecifications: this.state.productSpecifications,\r\n productCategoryPath: this.state.productCategoryPath,\r\n productAvailabilites: this.props.data.productAvailabilites.result,\r\n productAttributes,\r\n productDeliveryOptions: this.props.data.deliveryOptions.result,\r\n imageSettings: imageSettings,\r\n isStockCheckEnabled: this.props.context.app.config.enableStockCheck || false,\r\n maxCartlineQuantity: this.props.context.app.config.maxQuantityForCartLineItem,\r\n gridSettings: this.props.context.request.gridSettings!,\r\n context: this.props.context,\r\n typeName: this.props.typeName,\r\n id: this.props.id,\r\n pleaseContactExpertForOrder: this.props.config.pleaseContactExpertForOrder,\r\n sleepExpertContact: this.props.config.sleepExpertContact,\r\n sleepExpertChat: this.props.config.sleepExpertChat,\r\n resources: {\r\n sizeString: resources.productDimensionTypeSize,\r\n colorString: resources.productDimensionTypeColor,\r\n configString: resources.productDimensionTypeConfiguration,\r\n styleString: resources.productDimensionTypeStyle,\r\n amountString: resources.productDimensionTypeAmount,\r\n quantityDisplayString: resources.quantityDisplayText,\r\n inputQuantityAriaLabel: resources.inputQuantityAriaLabel,\r\n productPageLinkAriaLabel: resources.productPageLinkAriaLabel,\r\n decrementButtonAriaLabel: resources.decrementButtonAriaLabel,\r\n incrementButtonAriaLabel: resources.incrementButtonAriaLabel,\r\n discountStringText: resources.discountStringText,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText,\r\n shippingChargesText: resources.shippingCharges,\r\n outOfStockMsgText: resources.outOfStockMsgText,\r\n removeFromCartText: resources.removeFromCartText,\r\n similarAvailableProductText: resources.similarAvailableProductText,\r\n removeFromCartTextWithoutBeforeCheckout: resources.removeFromCartTextWithoutBeforeCheckout,\r\n homeDeliveryText: resources.homeDeliveryText,\r\n // VSI Customization {52133}\r\n itemsQuantityText: resources.itemsQuantityText,\r\n productAriaText: resources.productAriaText,\r\n variantAriaText: resources.variantAriaText,\r\n promoAriaText: resources.promoAriaText,\r\n priceAriaText: resources.priceAriaText,\r\n discountPercentageAriaText: resources.discountPercentageAriaText,\r\n editGiftCtaText: resources.editGiftCtaText,\r\n dialogAriaText: resources.dialogAriaText,\r\n removeButtonAriaText: resources.removeButtonAriaText,\r\n appliedPromoText: resources.appliedPromoText,\r\n notAppliedPromoText: resources.notAppliedPromoText\r\n // VSI Customization {52133} End\r\n },\r\n telemetry: telemetry,\r\n addToWishlistButtonText: resources.addToWishlistButtonText,\r\n removeFromWishlistButtonText: resources.removeFromWishlistButtonText,\r\n removeButtonText: resources.removeCartButtonText,\r\n shipItText: resources.shipInsteadDisplayText,\r\n mfrmCtaGiftText: resources.mfrmGiftCtaText,\r\n pickitUpText: resources.pickItUpDisplayText,\r\n changeStoreText: resources.changeStoreDisplayText,\r\n storeSelectorStateManager: this.props.data.storeSelectorStateManager.result,\r\n outOfStockText: resources.outOfStockErrorMessage,\r\n outOfRangeOneText: resources.errorMessageOutOfRangeOneLeft,\r\n outOfRangeFormatText: resources.errorMessageOutOfRangeFormat,\r\n cartState: this.props.data.cart.result,\r\n orgUnitLocations: undefined,\r\n removeItemClickHandler: this._removeItemFromCartHandler,\r\n moveToWishlistSuccessHandler: this._moveToWishlistSuccessHandler,\r\n updateCartLinesQuantitySuccessHandler: this._updateCartlineQuantity,\r\n locationChangedHandler: this._fulfillmentStoreIdUpdated,\r\n wishlists: wishlists,\r\n defaultWishlistName: resources.defaultWishlistName,\r\n pickupDeliveryModeCode: PickupDeliveryModeCode,\r\n includeErrors: config.showOutOfStockErrors,\r\n showShippingChargesForLineItems: config.showShippingChargesForLineItems,\r\n telemetryContent: this.telemetryContent,\r\n isQuantityLimitsFeatureEnabled: this.isQuantityLimitsFeatureEnabled,\r\n\r\n addToOrderTemplateDialogResources: this._generateAddToOrderTemplateDialogResources(resources),\r\n createOrderTemplateDialogResources: this._generateOrderTemplateNameDialogResources(resources),\r\n itemAddedToOrderTemplateDialogResources: this._generateItemAddedToOrderTemplateDialogResources(resources),\r\n duplicateItemsWhenAddingToOrderTemplateDialogResources: this._generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(resources),\r\n\r\n addToOrderTemplateButtonText: resources.addToOrderTemplateButtonText,\r\n addToOrderTemplateButtonTooltip: resources.addToOrderTemplateButtonTooltip,\r\n addToOrderTemplateMessage: resources.addToOrderTemplateMessage,\r\n addItemToOrderTemplateError: resources.addItemToOrderTemplateError,\r\n orderTemplates: orderTemplates,\r\n customerInformation: customerInformation,\r\n bonusItemsProductDetails: this.globalBonusItems,\r\n mfrmBonusModalHeading: resources.mfrmBonusModalHeading,\r\n mfrmBonusSubHeading: resources.mfrmBonusSubHeading,\r\n mfrmBonusAppliedCodeText: resources.mfrmBonusAppliedCodeText,\r\n mfrmAddItemToCartText: resources.mfrmAddItemToCartText,\r\n GiftCtaButton: this.ctaGiftButton,\r\n // ctaGiftHandler: this._showCtaGiftProducts,\r\n recievedBonusProduct: this._addCartlineFromModal,\r\n // sendState: this._sendSatateToCartLine,\r\n sendState: this.state.selectedBonusItems,\r\n setCartLineItems: this._setStateCartLine,\r\n // GiftCtaButton: this.ctaGiftButton, // this.state.ctaGiftButtonBoolean ? this.ctaGiftButton : this.state.ctaGiftButtonBoolean,\r\n ctaGiftHandler: this._giftCart,\r\n isGiftCoupon: this.isGiftCoupon,\r\n deliveryByMessagesCore: this.state.deliveryByMessagesCore,\r\n deliveryByMessageSPDS: this.state.deliveryByMessageSPDS,\r\n hideDeliveryMessage: this.state.disableCheckoutButton,\r\n onEditGift: this._onEditGift\r\n })\r\n ) : null;\r\n }\r\n\r\n // 22192\r\n /* private _getCheckoutURL(isAuthenticated: boolean, guestCheckoutUrl: string, signInUrl: string): string {\r\n if (isAuthenticated) {\r\n return guestCheckoutUrl;\r\n }\r\n\r\n const absoluteUrlRegExp = new RegExp('^(?:[a-z]+:)?//', 'i');\r\n const isAbsoluteUrl = absoluteUrlRegExp.test(guestCheckoutUrl);\r\n let returnURL = guestCheckoutUrl;\r\n if (MsDyn365.isBrowser && !isAbsoluteUrl) {\r\n returnURL = `${window.location.origin}${guestCheckoutUrl}`;\r\n }\r\n\r\n return `${signInUrl}${signInUrl.indexOf('?') === -1 ? '?' : '&'}ru=${returnURL}`;\r\n }*/\r\n /* VSI customization END */\r\n\r\n private _getImageSettings = (imageSettings: IImageSettings | undefined): IImageSettings => {\r\n return imageSettings || {\r\n viewports: {\r\n xs: { q: `w=80&h=94&m=6`, w: 0, h: 0 },\r\n sm: { q: `w=148&h=174&m=6`, w: 0, h: 0 },\r\n lg: { q: `w=148&h=174&m=6`, w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n };\r\n };\r\n private getProductCategory = async (productVariantIdArray: (number)[]): Promise => {\r\n const {\r\n context: {\r\n request: {\r\n apiSettings: {\r\n catalogId\r\n }\r\n }\r\n }\r\n } = this.props;\r\n const productsCategories = await getProductsCategoryPathsAction(new GetCategoryPathsInput(this.props.context.request, catalogId, productVariantIdArray), this.props.context.actionContext);\r\n\r\n const checkCategory = productsCategories.find(data => data.ProductId === productVariantIdArray[0]);\r\n const getSegments = checkCategory && checkCategory.CategoryPath && checkCategory.CategoryPath[0]?.Segments;\r\n let categoryName;\r\n if (getSegments) {\r\n categoryName = getSegments[getSegments?.length - 1]?.CategoryName!;\r\n }\r\n return categoryName;\r\n };\r\n\r\n private getProductBrand = async (productVariantIdArray: (number | undefined)[]): Promise => {\r\n const {\r\n context: {\r\n actionContext: ctx,\r\n request: {\r\n apiSettings: {\r\n channelId\r\n }\r\n }\r\n }\r\n } = this.props;\r\n const productSpecificationData: IAttributeValueProduct[] = await getAttributeValuesAsync({ callerContext: ctx, queryResultSettings: {} }, productVariantIdArray[0]!, channelId, 0);\r\n const newProductSpecificationData = productSpecificationData.filter(Boolean);\r\n let brandNameGet;\r\n if (newProductSpecificationData) {\r\n brandNameGet = newProductSpecificationData.find(item => item.Name === 'Brand')?.TextValue!;\r\n }\r\n return brandNameGet;\r\n };\r\n\r\n private _onEditGift = () => {\r\n let bonusItemArray: IProductBonusItems[] = [];\r\n /* VSI customization START */\r\n const getLocalStorage = getSetSelectedBonasItem('get');\r\n // const getLocalStorage = localStorage.getItem('selectedBonasItems');\r\n /* VSI customization END*/\r\n if (getLocalStorage) {\r\n bonusItemArray = getLocalStorage;\r\n }\r\n this.setState({\r\n selectedBonusItems: bonusItemArray\r\n });\r\n };\r\n\r\n private _tealiumCallonRemove = async (cartlineToRemove: CartLine, newQuantity: number): Promise => {\r\n const {\r\n data: {\r\n products: { result }\r\n }\r\n } = this.props;\r\n const productVariantIdArray: (number)[] = [cartlineToRemove.ProductId!];\r\n const ProductDetail = result?.find(item => item.RecordId === cartlineToRemove.ProductId);\r\n const getCategory = await this.getProductCategory(productVariantIdArray);\r\n const getBrandName = await this.getProductBrand(productVariantIdArray);\r\n let exactQuantity = cartlineToRemove.Quantity;\r\n if (newQuantity) {\r\n exactQuantity = cartlineToRemove.Quantity! - newQuantity;\r\n }\r\n const productNameArray = [ProductDetail?.Name];\r\n const productPrice = [ProductDetail?.Price?.toString()];\r\n const itemIdArray = [cartlineToRemove.ItemId];\r\n const productQuantityArray = [exactQuantity?.toString()];\r\n const productCategoryArray = [getCategory];\r\n const productBrandNameArray = [getBrandName];\r\n\r\n await callUtagLink(\r\n {\r\n event: 'remove-from-cart',\r\n enhanced_action: 'remove',\r\n event_category: 'ecommerce',\r\n event_action: 'remove from cart',\r\n event_label: `DL - ${cartlineToRemove.ItemId} : DL - ${productNameArray[0]}`,\r\n event_noninteraction: 'false',\r\n product_id: itemIdArray,\r\n product_name: productNameArray,\r\n product_category: productCategoryArray,\r\n product_brand: productBrandNameArray,\r\n product_variant: productVariantIdArray,\r\n product_price: productPrice,\r\n product_quantity: productQuantityArray\r\n }\r\n );\r\n };\r\n private _selectedBonasItems = async (ProductId: number) => {\r\n /* VSI customization START */\r\n const getLocalStorage = getSetSelectedBonasItem('get');\r\n // const getLocalStorage = localStorage.getItem('selectedBonasItems');\r\n /* VSI customization END*/\r\n let bonusItemArray: IProductBonusItems[] = [];\r\n if (getLocalStorage) {\r\n bonusItemArray = getLocalStorage;\r\n }\r\n const newBonasState: IProductBonusItems[] = [];\r\n const getInitialSelectedItems = this.state.selectedBonusItems.length === 0 ? bonusItemArray : this.state.selectedBonusItems;\r\n getInitialSelectedItems.map((itemBonas) => {\r\n const newChildItems = itemBonas.children.filter(childData => Number(childData.BonusProductId) !== ProductId);\r\n itemBonas.children = newChildItems;\r\n newBonasState.push(itemBonas);\r\n });\r\n this.setState({\r\n selectedBonusItems: newBonasState,\r\n previousBonasModal: newBonasState\r\n });\r\n /* VSI customization START */\r\n getSetSelectedBonasItem('set', newBonasState);\r\n // localStorage.setItem('selectedBonasItems', JSON.stringify(newBonasState));\r\n /* VSI customization END*/\r\n };\r\n\r\n private getCartlineProductName = (cartlineToRemove: CartLine) => {\r\n const productDetails: IProductDetails[] = getSetProductData('get');\r\n if (hasArray(productDetails)) {\r\n for (const p of productDetails) {\r\n if (p.VariantRecordId === cartlineToRemove.ProductId) {\r\n return p.brandAndProductName;\r\n }\r\n }\r\n }\r\n return '';\r\n };\r\n\r\n /* eslint-disable @typescript-eslint/no-floating-promises */\r\n private _removeItemFromCartHandler = async (cartlineToRemove: CartLine, url?: String) => {\r\n const {\r\n context: {\r\n actionContext,\r\n request: {\r\n apiSettings: { channelId, catalogId }\r\n }\r\n },\r\n telemetry,\r\n data: { cart: result }\r\n } = this.props;\r\n const productName = this.getCartlineProductName(cartlineToRemove);\r\n this._tealiumCallonRemove(cartlineToRemove, 0);\r\n if (await result) {\r\n const input = {\r\n cartLineIds: [cartlineToRemove.LineId!.toString()]\r\n };\r\n const productSpecificationsCookieData = getSetProductData('get');\r\n /* VSI customization START */\r\n const psp = getSetProductSpec('get');\r\n // const psp = localStorage.getItem('product_specification');\r\n /* VSI customization END*/\r\n let pspData: IProductDetails[] = [];\r\n if (!psp) {\r\n pspData = [];\r\n } else {\r\n pspData = psp;\r\n }\r\n const saveProdForCatch = [...productSpecificationsCookieData];\r\n const saveProdForLocalStorageInCatch = [...pspData];\r\n if (productSpecificationsCookieData) {\r\n productSpecificationsCookieData.map((productSpec: IProductDetails, index: number) => {\r\n if (productSpec && productSpec.VariantRecordId === cartlineToRemove.ProductId) {\r\n productSpecificationsCookieData.splice(index, 1);\r\n pspData.splice(index, 1);\r\n }\r\n });\r\n getSetProductData('set', productSpecificationsCookieData);\r\n /* VSI customization START */\r\n getSetProductSpec('set', pspData);\r\n // localStorage.setItem('product_specification', JSON.stringify(pspData));\r\n /* VSI customization END*/\r\n }\r\n this.props.context.actionContext.update(new PromoCodeAppliedOnCartInput(), { isInProcess: true });\r\n (await result).removeCartLines(input)\r\n .then(async () => {\r\n /* VSI customization START - Tracking 79374 */\r\n this.tealiumCallOnRemoveForGA(this.props.data.products, cartlineToRemove?.ItemId);\r\n /* VSI customization END - Tracking 79374 */\r\n this.props.context.actionContext.update(new PromoCodeAppliedOnCartInput(), { isInProcess: false });\r\n this._validateCart()\r\n .catch((error) => {\r\n telemetry.warning(error);\r\n telemetry.debug('Unable to validate Cart when Remove items');\r\n });\r\n this.setState({ showRemoveNotification: true, showProductTitle: productName });\r\n this.timer = setTimeout(() => {\r\n this.setState({ showRemoveNotification: false, showProductTitle: '' });\r\n }, 8000);\r\n await this._selectedBonasItems(cartlineToRemove.ProductId!);\r\n const updatedProductSpecificationsCookieData = getSetProductData('get');\r\n const CheckforSpecialOffer = updatedProductSpecificationsCookieData.find((item: IProductDetails) => item.brandName === 'Beautyrest' && (item.collection === 'Beyond' || item.collection === 'Beyond Hybrid'));\r\n if (CheckforSpecialOffer) {\r\n this.props.context.actionContext.update(new TriggerSpecialSynchronyFinancingInput(), { triggerSpecialFinancing: true });\r\n } else {\r\n this.props.context.actionContext.update(new TriggerSpecialSynchronyFinancingInput(), { triggerSpecialFinancing: false });\r\n }\r\n this.setState({\r\n cartRender: false\r\n });\r\n getAttributesForCartLineItems(new AttributesForSelectedVariantInput(channelId, catalogId), this.props.context.actionContext).then((res) => {\r\n actionContext.update(new AttributesForSelectedVariantInput(channelId, catalogId), res);\r\n this.returnCoreProductCheck();\r\n this.setState({ productAttributes: res });\r\n }).catch((error) => {\r\n telemetry.warning(error);\r\n telemetry.debug('Unable to validate Attributes CartLine Items when Remove items');\r\n });\r\n this.setState({ productDetails: productSpecificationsCookieData });\r\n this._getUpdateLinbeDeliveryCall(this.props, this.state.newZipCode, this.state.errorZipCode, '');\r\n if (url) {\r\n window.location.href = `${url}`;\r\n }\r\n this.refreshCartCookie();\r\n this.tealiumCartDetails(productSpecificationsCookieData, pspData);\r\n const cookies = new Cookies();\r\n const zipCode = cookies.get(`zip_code`);\r\n if(zipCode){\r\n this._getStateFromZipCode(this.props, zipCode, true);\r\n }\r\n })\r\n .catch((error) => {\r\n getSetProductData('set', saveProdForCatch);\r\n /* VSI customization START */\r\n getSetProductSpec('set', saveProdForLocalStorageInCatch);\r\n // localStorage.setItem('product_specification', JSON.stringify(saveProdForLocalStorageInCatch));\r\n /* VSI customization END*/\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to Remove Cart Line when remove items');\r\n });\r\n }\r\n };\r\n\r\n private _onlyRemoveItemFromCartHandler = async (cartlineToRemove: CartLine) => {\r\n const {\r\n data: { cart: result },\r\n telemetry\r\n } = this.props;\r\n if (await result) {\r\n const productSpecificationsCookieData = getSetProductData('get');\r\n if (productSpecificationsCookieData) {\r\n const newProductSpecificationsCookieData = productSpecificationsCookieData.filter((item: { VariantRecordId: number }) => item.VariantRecordId !== cartlineToRemove.ProductId);\r\n getSetProductData('set', newProductSpecificationsCookieData);\r\n }\r\n const input = {\r\n cartLineIds: [cartlineToRemove.LineId!.toString()]\r\n };\r\n (await result).removeCartLines(input)\r\n .then(() => {\r\n this._validateCart()\r\n .catch((error) => {\r\n telemetry.warning(error);\r\n telemetry.debug('Unable to validate Cart when remove service item');\r\n });\r\n this.refreshCartCookie();\r\n })\r\n .catch((error) => {\r\n telemetry.warning(error);\r\n telemetry.debug('Unable to Remove Cart Line when reomve service item');\r\n });\r\n }\r\n };\r\n\r\n private _tealiumCallonAddQuantity = async (cartlineToRemove: CartLine, newQuantity: number): Promise => {\r\n const {\r\n data: {\r\n products: { result }\r\n }\r\n } = this.props;\r\n const productVariantIdArray: (number)[] = [cartlineToRemove.ProductId!];\r\n const ProductDetail = result?.find(item => item.RecordId === cartlineToRemove.ProductId);\r\n const getCategory = await this.getProductCategory(productVariantIdArray);\r\n const getBrandName = await this.getProductBrand(productVariantIdArray);\r\n let exactQuantity = cartlineToRemove.Quantity;\r\n if (newQuantity) {\r\n exactQuantity = newQuantity - cartlineToRemove.Quantity!;\r\n }\r\n const productNameArray = [ProductDetail?.Name];\r\n const productPrice = [ProductDetail?.Price?.toString()];\r\n const itemIdArray = [cartlineToRemove.ItemId];\r\n const productQuantityArray = [exactQuantity?.toString()];\r\n const productCategoryArray = [getCategory];\r\n const productBrandNameArray = [getBrandName];\r\n\r\n await callUtagLink(\r\n {\r\n event: 'add-from-cart',\r\n enhanced_action: 'add',\r\n event_category: 'ecommerce',\r\n event_action: 'add from cart',\r\n event_label: `DL - ${cartlineToRemove.ItemId} : DL - ${productNameArray[0]}`,\r\n event_noninteraction: 'false',\r\n product_id: itemIdArray,\r\n product_name: productNameArray,\r\n product_category: productCategoryArray,\r\n product_brand: productBrandNameArray,\r\n product_variant: productVariantIdArray,\r\n product_price: productPrice,\r\n product_quantity: productQuantityArray\r\n }\r\n );\r\n };\r\n\r\n /* eslint-disable @typescript-eslint/no-floating-promises */\r\n private _moveToWishlistSuccessHandler = (result: IWishlistActionSuccessResult, cartline?: CartLine) => {\r\n if (result.status === 'ADDED' && cartline) {\r\n this._removeItemFromCartHandler(cartline);\r\n }\r\n };\r\n\r\n // tslint:disable: no-floating-promises\r\n private async _updateDeliveryMessageForUpdatedQuantityOfCoreProduct(cartlineToUpdate: CartLine, quantity: number): Promise {\r\n let coreDelMsgUpdated = false;\r\n const productSpecificationsCookieData = getSetProductData('get');\r\n const updatedCoreDelMsgItems: ICoreDeliveryByMessage[] = [];\r\n for (const coreProdMsg of this.state.deliveryByMessagesCore) {\r\n updatedCoreDelMsgItems.push(coreProdMsg);\r\n for (const productSpecItem of productSpecificationsCookieData) {\r\n if (productSpecItem.VariantRecordId === cartlineToUpdate.ProductId && productSpecItem.typeOfProduct === 'Core' && coreProdMsg.variantID === cartlineToUpdate.ProductId?.toString()) {\r\n const delMsgObj = await _coreProductATPCall(this.props, cartlineToUpdate.ProductId, cartlineToUpdate.ItemId, quantity);\r\n const delMsgObjSplitted = delMsgObj.split(',');\r\n updatedCoreDelMsgItems[updatedCoreDelMsgItems.length - 1].deliveryByMessage = delMsgObjSplitted[2];\r\n coreDelMsgUpdated = true;\r\n }\r\n }\r\n }\r\n if (coreDelMsgUpdated) {\r\n this.setState({ deliveryByMessagesCore: updatedCoreDelMsgItems });\r\n }\r\n }\r\n private _updateCartLineUpdateQuantity = async (cartlineToUpdate: CartLine, quantity: number) => {\r\n const { ProductId } = cartlineToUpdate;\r\n const newSepecifications = this.state.productDetails.map((item) => {\r\n if (item.VariantRecordId === ProductId) {\r\n item.Quantity = quantity;\r\n }\r\n return item;\r\n });\r\n this.setState({ productSpecifications: newSepecifications, productDetails: newSepecifications });\r\n getSetProductData('set', newSepecifications);\r\n };\r\n\r\n /* eslint-disable @typescript-eslint/no-floating-promises */\r\n private _updateCartlineQuantityWithAvailableQuantity = async (cartlineToUpdate: CartLine, quantity: number): Promise => {\r\n const { ProductId, Quantity } = cartlineToUpdate;\r\n let fixedQuantity = quantity;\r\n const checkProduct = this.state.productSpecifications.find((item) => item.VariantRecordId === ProductId);\r\n const typeProduct = checkProduct?.typeOfProduct;\r\n if (Quantity! > quantity) {\r\n this._tealiumCallonRemove(cartlineToUpdate, quantity);\r\n } else {\r\n this._tealiumCallonAddQuantity(cartlineToUpdate, quantity);\r\n }\r\n fixedQuantity = quantity;\r\n await this._updateCartLineUpdateQuantity(cartlineToUpdate, fixedQuantity);\r\n this.setState({\r\n cartRender: true\r\n });\r\n this._updateDeliveryMessageForUpdatedQuantityOfCoreProduct(cartlineToUpdate, fixedQuantity);\r\n if (this.props.data.cart.result) {\r\n // const getLocalStorage = localStorage.getItem('BonusItemProduct');\r\n // const cartId = this.props.data.cart.result.cart.Id;\r\n // const context = this.props.context;\r\n const parentProduct = this._checkCartLineId(cartlineToUpdate);\r\n // const cartLinesInCart = this.props.data.cart.result?.cart.CartLines;\r\n // const bonusItemArray: IMFIBonusItemsResponse[] = [];\r\n // const bonusItemsCartLine: CartLine[] = [];\r\n if (parentProduct) {\r\n // bonusItemArray = getLocalStorage && JSON.parse(getLocalStorage);\r\n // // get bonus item array from localstorage\r\n // bonusItemArray.map((bonusItemsArray) => {\r\n // // bonus product array against applied promocode\r\n // bonusItemsArray.BonusItemsDetails?.map((bonusItemDetail) => {\r\n // // bonus item details array with items of parent product\r\n // bonusItemDetail.Items?.map((item) => {\r\n // // check if cartlineId is equal to parent or qualifying Id\r\n // if (item.QualifyingItemId === cartlineToUpdate.ItemId) {\r\n // bonusItemsCartLine.push(cartlineToUpdate);\r\n // item.BonusItems?.map((bonusItems) => {\r\n // cartLinesInCart?.filter((lines) => {\r\n // if (bonusItems.BonusItemId === lines.ItemId) {\r\n // bonusItemsCartLine.push(lines);\r\n // }\r\n // });\r\n // });\r\n // }\r\n // });\r\n // });\r\n // });\r\n // bonusItemsCartLine.filter((bonusLine) => {\r\n // bonusLine.Quantity = fixedQuantity;\r\n // });\r\n // const updateCart = updateCartLinesAsync({ callerContext: context.actionContext }, cartId, bonusItemsCartLine);\r\n // updateCart.then(async (result) => {\r\n // this.setState({\r\n // cartRender: false\r\n // });\r\n // const cartState = await getCartState(context.actionContext);\r\n // await cartState.refreshCart({});\r\n // }).catch((e) => {\r\n // console.log(e, 'Error');\r\n // });\r\n } else {\r\n const input = {\r\n cartLineId: cartlineToUpdate.LineId!.toString(),\r\n newQuantity: fixedQuantity,\r\n additionalProperties: { orderQuantityLimitsFeatureIsEnabled: this.isQuantityLimitsFeatureEnabled }\r\n };\r\n this.props.context.actionContext.update(new PromoCodeAppliedOnCartInput(), { isInProcess: true });\r\n this.props.data.cart.result.updateCartLineQuantity(input)\r\n .then(async (result: ICartActionResult) => {\r\n this.setState({\r\n cartRender: false\r\n });\r\n this.props.context.actionContext.update(new PromoCodeAppliedOnCartInput(), { isInProcess: false });\r\n this.refreshCartCookie();\r\n const newSepecifications = this.state.productSpecifications.map((item) => {\r\n if (item.VariantRecordId === ProductId) {\r\n item.quantityMessage = true;\r\n }\r\n return item;\r\n });\r\n this.setState({ productSpecifications: newSepecifications, productDetails: newSepecifications });\r\n getSetProductData('set', newSepecifications);\r\n this.timer = setTimeout(() => {\r\n const newSpecifications = this.state.productSpecifications.map((item) => {\r\n if (item.VariantRecordId === ProductId) {\r\n item.quantityMessage = false;\r\n }\r\n return item;\r\n });\r\n this.setState({ productSpecifications: newSpecifications, productDetails: newSpecifications });\r\n getSetProductData('set', newSpecifications);\r\n }, 5000);\r\n if (result.status === 'SUCCESS') {\r\n this._getUpdateLinbeDeliveryCall(this.props, this.state.newZipCode, this.state.errorZipCode, typeProduct!);\r\n this._validateCart().catch((error) => {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to validate Cart when update quantity');\r\n });\r\n return true;\r\n }\r\n return false;\r\n })\r\n .catch((error) => {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to update Cart Line quantity when change quantity');\r\n this.props.context.actionContext.update(new PromoCodeAppliedOnCartInput(), { isInProcess: false });\r\n });\r\n }\r\n\r\n return false;\r\n }\r\n return false;\r\n };\r\n\r\n private hasSameDiscountCodes = (qualifyingItem: CartLine, bonusItem: CartLine) => {\r\n const qualifyingDiscountLines = qualifyingItem.DiscountLines;\r\n const bonusItemDiscountLines = bonusItem.DiscountLines;\r\n if (hasArray(qualifyingDiscountLines) && hasArray(bonusItemDiscountLines)) {\r\n for (const qdl of qualifyingDiscountLines!) {\r\n for (const bdl of bonusItemDiscountLines!) {\r\n if ((qdl.DiscountCode === bdl.DiscountCode) && qdl.DiscountCode && this._isBonusCoupons(qdl.DiscountCode)) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n return false;\r\n };\r\n\r\n private _isBonusCoupons = (appliedPromoCoupons: string): boolean => {\r\n let checkBonusCoupons: boolean | undefined = false;\r\n /* VSI customization START */\r\n const getLocalstorageBonusCoupons = getSetBonusCouponDetail('get');\r\n // const getLocalstorageBonusCoupons = localStorage.getItem('bonusCouponsDetail');\r\n /* VSI customization END*/\r\n if (getLocalstorageBonusCoupons) {\r\n const bonusCouponsArray: IMFIGetBonusCouponsDetailsResponse[] = getLocalstorageBonusCoupons;\r\n bonusCouponsArray?.map(coupons => {\r\n checkBonusCoupons = coupons.BonusCoupons?.some(item => item.BonusCoupon?.toUpperCase() === appliedPromoCoupons.toUpperCase() || (item.BonusCoupon && (isOneOfChildBonusCoupons(appliedPromoCoupons, item.BonusCoupon))));\r\n return checkBonusCoupons;\r\n });\r\n }\r\n return checkBonusCoupons;\r\n };\r\n\r\n /* eslint-disable @typescript-eslint/no-floating-promises */\r\n private _updateCartlineQuantity = async (cartlineToUpdate: CartLine, quantity: number): Promise => {\r\n const { ProductId, Quantity } = cartlineToUpdate;\r\n let fixedQuantity = quantity;\r\n const checkProduct = this.state.productSpecifications.find((item) => item.VariantRecordId === ProductId);\r\n const typeProduct = checkProduct?.typeOfProduct;\r\n let avialbleQuantity = checkProduct?.availableQuantity;\r\n if (typeProduct?.toLowerCase() === 'parcel') {\r\n avialbleQuantity = await this.checkUniqueSmallParcelProduct(checkProduct?.VariantRecordId!, checkProduct?.ItemId!);\r\n }\r\n if (Quantity! > quantity) {\r\n this._tealiumCallonRemove(cartlineToUpdate, quantity);\r\n } else {\r\n this._tealiumCallonAddQuantity(cartlineToUpdate, quantity);\r\n }\r\n if (avialbleQuantity) {\r\n if (quantity > avialbleQuantity) {\r\n fixedQuantity = avialbleQuantity;\r\n }\r\n }\r\n await this._updateCartLineUpdateQuantity(cartlineToUpdate, fixedQuantity);\r\n this.setState({\r\n cartRender: true\r\n });\r\n this._updateDeliveryMessageForUpdatedQuantityOfCoreProduct(cartlineToUpdate, fixedQuantity);\r\n if (this.props.data.cart.result) {\r\n /* VSI customization START */\r\n const getLocalStorage = getSetBonusItemProd('get');\r\n // const getLocalStorage = localStorage.getItem('BonusItemProduct');\r\n /* VSI customization END*/\r\n const cartId = this.props.data.cart.result.cart.Id;\r\n const context = this.props.context;\r\n const parentProduct = this._checkCartLineId(cartlineToUpdate);\r\n const cartLinesInCart = this.props.data.cart.result?.cart.CartLines;\r\n let bonusItemArray: IMFIBonusItemsResponse[] = [];\r\n const bonusItemsCartLine: CartLine[] = [];\r\n if (parentProduct) {\r\n if (!hasArray(getLocalStorage)) {\r\n if (getLocalStorage && hasArray(getLocalStorage.BonusItemsDetails)) {\r\n bonusItemArray = [getLocalStorage];\r\n }\r\n } else {\r\n bonusItemArray = getLocalStorage;\r\n }\r\n // get bonus item array from localstorage\r\n bonusItemArray.map((bonusItemsArray) => {\r\n // bonus product array against applied promocode\r\n bonusItemsArray.BonusItemsDetails?.map((bonusItemDetail) => {\r\n // bonus item details array with items of parent product\r\n bonusItemDetail.Items?.map((item) => {\r\n // check if cartlineId is equal to parent or qualifying Id\r\n if (item.QualifyingItemId === cartlineToUpdate.ItemId && item.QualifyingProductId?.toString() === cartlineToUpdate.ProductId?.toString()) {\r\n bonusItemsCartLine.push(cartlineToUpdate);\r\n item.BonusItems?.map((bonusItems) => {\r\n cartLinesInCart?.filter((lines) => {\r\n if ((bonusItems.BonusItemId === lines.ItemId) && this.hasSameDiscountCodes(cartlineToUpdate, lines)) {\r\n bonusItemsCartLine.push(lines);\r\n }\r\n });\r\n });\r\n }\r\n });\r\n });\r\n });\r\n bonusItemsCartLine.filter((bonusLine) => {\r\n bonusLine.Quantity = fixedQuantity;\r\n });\r\n const updateCart = updateCartLinesAsync({ callerContext: context.actionContext }, cartId, bonusItemsCartLine);\r\n this.props.context.actionContext.update(new PromoCodeAppliedOnCartInput(), { isInProcess: true });\r\n updateCart.then(async (result) => {\r\n this.props.context.actionContext.update(new PromoCodeAppliedOnCartInput(), { isInProcess: false });\r\n this.setState({\r\n cartRender: false\r\n });\r\n const cartState = await getCartState(context.actionContext);\r\n await cartState.refreshCart({});\r\n this._getUpdateLinbeDeliveryCall(this.props, this.state.newZipCode, this.state.errorZipCode, typeProduct!);\r\n this._validateCart().catch((error) => {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to validate Cart when update quantiy with available');\r\n });\r\n }).catch((error) => {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to updateCartLinesAsync with available quantity');\r\n this.props.context.actionContext.update(new PromoCodeAppliedOnCartInput(), { isInProcess: false });\r\n });\r\n } else {\r\n const input = {\r\n cartLineId: cartlineToUpdate.LineId!.toString(),\r\n newQuantity: fixedQuantity,\r\n additionalProperties: { orderQuantityLimitsFeatureIsEnabled: this.isQuantityLimitsFeatureEnabled }\r\n };\r\n this.props.context.actionContext.update(new PromoCodeAppliedOnCartInput(), { isInProcess: true });\r\n this.props.data.cart.result.updateCartLineQuantity(input)\r\n .then(async (result: ICartActionResult) => {\r\n this.props.context.actionContext.update(new PromoCodeAppliedOnCartInput(), { isInProcess: false });\r\n this.setState({\r\n cartRender: false\r\n });\r\n this.refreshCartCookie();\r\n if (avialbleQuantity) {\r\n if (quantity > avialbleQuantity) {\r\n const newSepecifications = this.state.productSpecifications.map((item) => {\r\n if (item.VariantRecordId === ProductId) {\r\n item.quantityMessage = true;\r\n }\r\n return item;\r\n });\r\n this.setState({ productSpecifications: newSepecifications, productDetails: newSepecifications });\r\n getSetProductData('set', newSepecifications);\r\n } else {\r\n const newSepecifications = this.state.productSpecifications.map((item) => {\r\n if (item.VariantRecordId === ProductId) {\r\n item.quantityMessage = false;\r\n }\r\n return item;\r\n });\r\n this.setState({ productSpecifications: newSepecifications, productDetails: newSepecifications });\r\n getSetProductData('set', newSepecifications);\r\n }\r\n if (quantity > avialbleQuantity) {\r\n this.timer = setTimeout(() => {\r\n const newSepecifications = this.state.productSpecifications.map((item) => {\r\n if (item.VariantRecordId === ProductId) {\r\n item.quantityMessage = false;\r\n }\r\n return item;\r\n });\r\n this.setState({ productSpecifications: newSepecifications, productDetails: newSepecifications });\r\n getSetProductData('set', newSepecifications);\r\n }, 5000);\r\n }\r\n }\r\n if (result.status === 'SUCCESS') {\r\n this._getUpdateLinbeDeliveryCall(this.props, this.state.newZipCode, this.state.errorZipCode, typeProduct!);\r\n this._validateCart().catch((error) => {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to validate Cart when success full update quantiy');\r\n });\r\n return true;\r\n }\r\n return false;\r\n })\r\n .catch((error) => {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to update Cart Line quantity when success full update quantiy');\r\n });\r\n }\r\n\r\n return false;\r\n }\r\n return false;\r\n };\r\n\r\n // tslint:disable-next-line: function-name\r\n private async checkUniqueSmallParcelProduct(VariantRecordId: number, ItemId: string): Promise {\r\n const cookies = new Cookies();\r\n const zipcode = cookies.get('zip_code');\r\n const date = new Date();\r\n const productsSpecChange = this.state.productSpecifications;\r\n let quantity: number = 0;\r\n const currentDate = date.setDate(date.getDate());\r\n const tempProducts: { ItemId: string; Quantity: number; VariantRecordId: string }[] = [];\r\n tempProducts.push({\r\n ItemId: ItemId,\r\n Quantity: 1,\r\n VariantRecordId: VariantRecordId?.toString()\r\n });\r\n if (tempProducts?.length) {\r\n const requestBody = {\r\n InventoryType: 'Delivery',\r\n StoreId: '',\r\n Weeks: this.props.context.app && this.props.context.app.config.weeksPDPforATPCall,\r\n RequestedDate: dayjs(currentDate).format('MM/DD/YYYY'),\r\n ZipCode: zipcode, // '77047',\r\n ItemLines: tempProducts,\r\n NoOfPriorityDC: this.props.context.app.config.NoOfPriorityDC ? this.props.context.app.config.NoOfPriorityDC : 0\r\n };\r\n const result = await _getInventoryQuantity(requestBody, this.props.context, false);\r\n const quantityAvailable: string | null | undefined = result && result.ATPInventoryStatusData && result.ATPInventoryStatusData[0]?.Quantity;\r\n if (result && result.ATPInventoryStatusData && result.ATPInventoryStatusData[0]?.Available !== 'NO') {\r\n productsSpecChange.forEach((prod) => {\r\n if (prod.VariantRecordId === VariantRecordId) {\r\n prod.outOfStock = false;\r\n }\r\n });\r\n this.setState({\r\n productSpecifications: productsSpecChange,\r\n productDetails: productsSpecChange\r\n });\r\n getSetProductData('set', productsSpecChange);\r\n }\r\n if (quantityAvailable) {\r\n quantity = +quantityAvailable;\r\n }\r\n }\r\n return quantity;\r\n }\r\n\r\n // check cartline id is parent ID or not\r\n private _checkCartLineId = (cartlineToUpdate: CartLine): boolean => {\r\n /* VSI customization START */\r\n const getLocalStorage = getSetBonusItemProd('get');\r\n // const getLocalStorage = localStorage.getItem('BonusItemProduct');\r\n /* VSI customization END*/\r\n let bonusItemArray: IMFIBonusItemsResponse[] = [];\r\n let parenProduct: boolean = false;\r\n if (getLocalStorage) {\r\n if (!hasArray(getLocalStorage)) {\r\n if (getLocalStorage && hasArray(getLocalStorage.BonusItemsDetails)) {\r\n bonusItemArray = [getLocalStorage];\r\n }\r\n } else {\r\n bonusItemArray = getLocalStorage;\r\n }\r\n // get bonus item array from localstorage\r\n bonusItemArray.map((bonusItemsArray) => {\r\n // bonus product array against applied promocode\r\n bonusItemsArray.BonusItemsDetails?.map((bonusItemDetail) => {\r\n // bonus item details array with items of parent product\r\n bonusItemDetail.Items?.map((item) => {\r\n // check if cartlineId is equal to parent or qualifying Id\r\n if (item.QualifyingItemId === cartlineToUpdate.ItemId && item.QualifyingProductId?.toString() === cartlineToUpdate.ProductId?.toString()) {\r\n return parenProduct = true;\r\n }\r\n return;\r\n });\r\n });\r\n });\r\n }\r\n return parenProduct ? true : false;\r\n };\r\n\r\n // private _sendSatateToCartLine = () => {\r\n // return this.state.selectedBonusItems;\r\n // }\r\n\r\n private _setStateCartLine = (bonusItemsFromModal: IProductBonusItems) => {\r\n const elementsIndex = this.state.selectedBonusItems.findIndex(element => element?.parentId === bonusItemsFromModal?.parentId);\r\n const newArray = this.state.selectedBonusItems;\r\n if (elementsIndex > -1) {\r\n newArray[elementsIndex] = bonusItemsFromModal;\r\n } else {\r\n newArray.push(bonusItemsFromModal);\r\n }\r\n this.setState({\r\n selectedBonusItems: newArray\r\n });\r\n };\r\n\r\n // private _getParentID = async (productId: number): Promise => {\r\n // let productParentId: number = 0;\r\n // const getLocalStorage = localStorage.getItem('BonusItemProduct');\r\n // let bonusItemArray: IMFIBonusItemsResponse[] = [];\r\n // if (getLocalStorage) {\r\n // bonusItemArray = JSON.parse(getLocalStorage);\r\n // }\r\n // bonusItemArray?.map((bonusitemdetail) => {\r\n // bonusitemdetail?.BonusItemsDetails?.map((bonusitem) => {\r\n // bonusitem.Items?.map((item) => {\r\n // if(Number(item.QualifyingProductId) === productId) {\r\n // productParentId = Number(item.QualifyingProductId);\r\n // } else {\r\n // item?.BonusItems!.map((bonasData) => {\r\n // if(Number(bonasData.BonusProductId) === productId) {\r\n // productParentId = Number(item.QualifyingProductId);\r\n // }\r\n // });\r\n // }\r\n // });\r\n // });\r\n // });\r\n // return productParentId;\r\n // }\r\n\r\n private _addCartlineFromModal = async (productId: number | undefined, bonusItemsFromModal: IMFIBonusItemDetails[], productQuantityCount: number) => {\r\n const elementsIndex = this.state.selectedBonusItems.findIndex(element => element?.parentId === productId);\r\n const {\r\n context: {\r\n request: {\r\n apiSettings: {\r\n channelId,\r\n catalogId\r\n }\r\n }\r\n }\r\n } = this.props;\r\n /* VSI customization START */\r\n const getLocalStorage = getSetPrevBonasModalState('get');\r\n // const getLocalStorage = localStorage.getItem('previousBonasModalState');\r\n /* VSI customization END*/\r\n let bonusItemArray: IProductBonusItems[] = [];\r\n if (getLocalStorage) {\r\n bonusItemArray = getLocalStorage;\r\n }\r\n const getParentId = productId;\r\n const getStateBonasItems = this.state.previousBonasModal.length === 0 ? bonusItemArray : this.state.previousBonasModal;\r\n const newPreviousData: IProductBonusItems[] = [];\r\n const bonasPrevoiusArray = [];\r\n const bonasPreviousData = { parentId: getParentId, children: bonusItemsFromModal };\r\n bonasPrevoiusArray.push(bonasPreviousData);\r\n let removeBonusArray: IMFIBonusItemDetails[] = [];\r\n if (getStateBonasItems.length > 0) {\r\n getStateBonasItems.map((item) => {\r\n if (item.parentId !== getParentId) {\r\n const checkIfExist = !!getStateBonasItems.find(itemFilter => itemFilter.parentId === getParentId);\r\n if (!checkIfExist) {\r\n newPreviousData.push(bonasPreviousData);\r\n }\r\n const checkUpdate = newPreviousData.includes(item);\r\n if (!checkUpdate) {\r\n newPreviousData.push(item);\r\n }\r\n } else {\r\n let result: IMFIBonusItemDetails[] = [];\r\n const childDataArray = item.children;\r\n result = childDataArray.filter(data => bonusItemsFromModal.every(bonasItem => data.BonusProductId !== bonasItem.BonusProductId));\r\n removeBonusArray = result;\r\n item.children = bonusItemsFromModal;\r\n if (bonusItemsFromModal.length > 0) {\r\n newPreviousData.push(item);\r\n }\r\n }\r\n });\r\n\r\n // this.setState({\r\n // previousBonasModal: newPreviousData\r\n // });\r\n } else {\r\n newPreviousData.push(bonasPreviousData);\r\n }\r\n const productArrayData = [];\r\n const procductData = {};\r\n procductData[productId!] = bonusItemsFromModal;\r\n productArrayData.push(procductData);\r\n const { data: { cart: { result: cart } } } = this.props;\r\n const cartId = cart?.cart.Id;\r\n // const cartVersion = (await this.props.data.cart).cart.Version;\r\n const newArray = this.state.selectedBonusItems;\r\n if (elementsIndex > -1) {\r\n newArray[elementsIndex] = { parentId: productId, children: bonusItemsFromModal };\r\n } else {\r\n newArray.push({ parentId: productId, children: bonusItemsFromModal });\r\n }\r\n this.setState({\r\n selectedBonusItems: newArray\r\n });\r\n /* VSI customization START */\r\n getSetSelectedBonasItem('set', newArray);\r\n // localStorage.setItem('selectedBonasItems', JSON.stringify(newArray));\r\n /* VSI customization END*/\r\n const deletedCartLines: string[] = [];\r\n\r\n // let onlyInA = this.props.data.cart.result?.cart.CartLines?.filter(this.comparer(bonusItemsFromModal))\r\n // const getLocalStorage = localStorage.getItem('BonusItemProduct');\r\n const bonusCartlines: CartLine[] | null = [];\r\n // let parentItemId: string | undefined = '';\r\n // let bonusItemArray: IMFIBonusItemsResponse[] = [];\r\n // if (getLocalStorage) {\r\n // bonusItemArray = JSON.parse(getLocalStorage);\r\n // }\r\n // bonusItemArray?.map((bonusitemdetail) => {\r\n // bonusitemdetail?.BonusItemsDetails?.map((bonusitem) => {\r\n // bonusitem.Items?.map((item) => {\r\n // parentItemId = item?.QualifyingItemId;\r\n // });\r\n // });\r\n // });\r\n /* VSI customization START */\r\n getSetPrevBonasModalState('set', newPreviousData);\r\n // localStorage.setItem('previousBonasModalState', JSON.stringify(newPreviousData));\r\n /* VSI customization END*/\r\n this.setState({\r\n previousBonasModal: newPreviousData\r\n });\r\n this.props.data.cart.result?.cart.CartLines?.map((cartline) => {\r\n const checkCartLine = !!removeBonusArray.find(remove => remove.BonusItemId === cartline.ItemId);\r\n if (checkCartLine) {\r\n deletedCartLines.push(cartline.LineId!);\r\n }\r\n });\r\n if (this.props.data.cart.result) {\r\n if (deletedCartLines.length > 0) {\r\n // deletedCartLines.map(async(item) => {\r\n // await this._removeItemFromCartHandler(item);\r\n // });\r\n const input = {\r\n cartLineIds: deletedCartLines\r\n };\r\n await this.props.data.cart.result.removeCartLines(input)\r\n .then(() => {\r\n this._validateCart()\r\n .catch((error) => {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to validate Cart when deleted cart line from modal');\r\n });\r\n this.refreshCartCookie();\r\n })\r\n .catch((error) => {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to Remove Cart Line when add cart line from modal');\r\n });\r\n }\r\n }\r\n if (bonusItemsFromModal.length > 0) {\r\n const cartState = await getCartState(this.props.context.actionContext);\r\n let updatedParentQuantity = 0;\r\n hasArray(this.props.data.cart.result?.cart?.CartLines)?.filter((cartline) => {\r\n if (cartline.ProductId === productId) {\r\n updatedParentQuantity = cartline.Quantity ? cartline.Quantity : 0;\r\n }\r\n });\r\n bonusItemsFromModal?.map((product) => {\r\n let checkItemAlredyInCart: boolean = false;\r\n hasArray(this.props.data.cart.result?.cart?.CartLines)?.filter((cartline) => {\r\n if (product.BonusItemId === cartline.ItemId) {\r\n checkItemAlredyInCart = true;\r\n }\r\n });\r\n if (!checkItemAlredyInCart && product.AdditionToCart === 'Manual') {\r\n const productToAdd = {\r\n ProductId: Number(product.BonusProductId),\r\n // ProductTypeValue: 5,\r\n EntryMethodTypeValue: 5,\r\n ItemId: product.BonusItemId,\r\n Quantity: updatedParentQuantity\r\n };\r\n bonusCartlines.push(productToAdd);\r\n }\r\n });\r\n const cookies = new Cookies();\r\n const zipcode = cookies.get('zip_code');\r\n // const cartID = (await this.props.data.cart).cart.Id;\r\n if (bonusCartlines.length > 0) {\r\n this._validateCart().then(async () => {\r\n this.props.context.actionContext.update(new PromoCodeAppliedOnCartInput(), { isInProcess: true });\r\n await addCartLinesAsync({ callerContext: this.props.context.actionContext }, cartId!, bonusCartlines).then(async newCart => {\r\n await cartState.refreshCart({});\r\n this.props.context.actionContext.update(new PromoCodeAppliedOnCartInput(), { isInProcess: false });\r\n reshuffleItems(this.props.data.cart.result?.cart.CartLines ? this.props.data.cart.result?.cart.CartLines : []);\r\n this.refreshCartCookie();\r\n this._getStateFromZipCode(this.props, zipcode, true);\r\n getAttributesForCartLineItems(new AttributesForSelectedVariantInput(channelId, catalogId), this.props.context.actionContext).then((res) => {\r\n this.props.context.actionContext.update(new AttributesForSelectedVariantInput(channelId, catalogId), res);\r\n this.returnCoreProductCheck();\r\n }).catch((error) => {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to validate Attributes CartLine Items when add cart line from modal');\r\n });\r\n });\r\n }).catch((error) => {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to validate Cart when add cart line from modal');\r\n });\r\n }\r\n }\r\n };\r\n\r\n private _fulfillmentStoreIdUpdated = () => {\r\n this._validateCart().catch((error) => {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to validate Cart _fulfillmentStoreIdUpdated');\r\n });\r\n };\r\n\r\n private async _validateCart(retry: boolean = true): Promise {\r\n if (!this.isQuantityLimitsFeatureEnabled) {\r\n return AsyncResult.resolve();\r\n }\r\n\r\n const {\r\n data: { cart: cart },\r\n telemetry\r\n } = this.props;\r\n let cartResult: ICartState;\r\n try {\r\n cartResult = await cart;\r\n } catch (error) {\r\n telemetry.warning(error);\r\n telemetry.debug('Unable to get cart validateCart');\r\n return AsyncResult.resolve();\r\n }\r\n const cartVersion = cartResult.cart?.Version;\r\n if (cartVersion) {\r\n try {\r\n const validationResult: CartLineValidationResults = await validateForCheckoutAsync({ callerContext: this.props.context.actionContext }, cartResult?.cart?.Id, cartVersion);\r\n this.setState({ cartlinesErrors: validationResult.ValidationFailuresByCartLines || [] });\r\n return AsyncResult.resolve();\r\n } catch (error) {\r\n if (retry && error.name === 'Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion') {\r\n try {\r\n await cartResult.refreshCart({});\r\n } catch (refreshError) {\r\n telemetry.warning(refreshError);\r\n telemetry.debug('Unable to refresh Cart validateCart');\r\n return AsyncResult.resolve();\r\n }\r\n try {\r\n await this._validateCart(false);\r\n return AsyncResult.resolve();\r\n } catch (validateError) {\r\n telemetry.warning(validateError);\r\n telemetry.debug('Unable to validate Cart');\r\n return AsyncResult.resolve();\r\n }\r\n }\r\n\r\n telemetry.warning(error);\r\n telemetry.debug('Unable to validate Cart validateForCheckoutAsync');\r\n return AsyncResult.resolve();\r\n }\r\n } else {\r\n telemetry.warning('Cart version not found for Cart validation request.');\r\n return AsyncResult.resolve();\r\n }\r\n }\r\n\r\n private async _getOrderQuantityLimitsFeatureFlag(): Promise {\r\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'none') {\r\n return false;\r\n }\r\n\r\n try {\r\n const featureStatuses = await this.props.data.featureState;\r\n const isQuantityLimitsFeatureEnabledInHq = featureStatuses\r\n .find(featureState => featureState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature')?.IsEnabled || false;\r\n if (!isQuantityLimitsFeatureEnabledInHq) {\r\n return false;\r\n }\r\n } catch (error) {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to get feature states');\r\n return false;\r\n }\r\n\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\r\n return true;\r\n }\r\n try {\r\n const customerInfo = await this.props.data.customerInformation;\r\n return !!customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b));\r\n } catch (error) {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to get customer info order quantity');\r\n return false;\r\n }\r\n }\r\n\r\n // tslint:disable-next-line: max-func-body-length\r\n private _getCartLinesGroup(): ICartlinesViewProps[][] | null {\r\n const {\r\n data: {\r\n cart: { result: cart },\r\n wishlists: { result: wishlists },\r\n orderTemplates: { result: orderTemplates },\r\n customerInformation: { result: customerInformation },\r\n productAttributes: { result: productAttributes }\r\n },\r\n context: {\r\n request: {\r\n channel: {\r\n PickupDeliveryModeCode\r\n } = { PickupDeliveryModeCode: undefined }\r\n }\r\n },\r\n config: config,\r\n telemetry,\r\n resources,\r\n modules\r\n } = this.props;\r\n\r\n const imageSettings = this._getImageSettings(config.imageSettings);\r\n const isQuantityLimitsFeatureEnabled = this.props.data.featureState.result?.\r\n find(featureState => featureState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature')?.IsEnabled || false;\r\n const cartlinesErrors: LineDataValidationFailure[] = this.state.cartlinesErrors;\r\n let storeSelectorId: string = '';\r\n if (modules && Object.keys(modules).length > 0 && modules.storeSelector && modules.storeSelector.length > 0) {\r\n storeSelectorId = modules.storeSelector[0].id;\r\n }\r\n\r\n return this.props.data.products && this.props.data.products.result && cart && cart.cart.CartLines && cart.cart.CartLines.length > 0 && this.props.data.channelDeliveryOptionConfig?.result ? (\r\n CartLineGroupItems({\r\n cartlines: cart.cart.CartLines,\r\n storeSelectorModuleId: storeSelectorId,\r\n cartlinesErrors: cartlinesErrors,\r\n products: this.props.data.products.result,\r\n productSpecifications: this.state.productSpecifications,\r\n productCategoryPath: this.state.productCategoryPath,\r\n productAvailabilites: this.props.data.productAvailabilites.result,\r\n productDeliveryOptions: this.props.data.deliveryOptions.result,\r\n imageSettings: imageSettings,\r\n isStockCheckEnabled: this.props.context.app.config.enableStockCheck || false,\r\n maxCartlineQuantity: this.props.context.app.config.maxQuantityForCartLineItem,\r\n gridSettings: this.props.context.request.gridSettings!,\r\n context: this.props.context,\r\n typeName: this.props.typeName,\r\n id: this.props.id,\r\n productAttributes,\r\n pleaseContactExpertForOrder: this.props.config.pleaseContactExpertForOrder,\r\n sleepExpertContact: this.props.config.sleepExpertContact,\r\n sleepExpertChat: this.props.config.sleepExpertChat,\r\n resources: {\r\n sizeString: resources.productDimensionTypeSize,\r\n colorString: resources.productDimensionTypeColor,\r\n configString: resources.productDimensionTypeConfiguration,\r\n styleString: resources.productDimensionTypeStyle,\r\n amountString: resources.productDimensionTypeAmount,\r\n quantityDisplayString: resources.quantityDisplayText,\r\n inputQuantityAriaLabel: resources.inputQuantityAriaLabel,\r\n productPageLinkAriaLabel: resources.productPageLinkAriaLabel,\r\n decrementButtonAriaLabel: resources.decrementButtonAriaLabel,\r\n incrementButtonAriaLabel: resources.incrementButtonAriaLabel,\r\n discountStringText: resources.discountStringText,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText,\r\n shippingChargesText: resources.shippingCharges,\r\n outOfStockMsgText: resources.outOfStockMsgText,\r\n removeFromCartText: resources.removeFromCartText,\r\n similarAvailableProductText: resources.similarAvailableProductText,\r\n removeFromCartTextWithoutBeforeCheckout: resources.removeFromCartTextWithoutBeforeCheckout,\r\n homeDeliveryText: resources.homeDeliveryText,\r\n // VSI Customization {52133}\r\n itemsQuantityText: resources.itemsQuantityText,\r\n productAriaText: resources.productAriaText,\r\n variantAriaText: resources.variantAriaText,\r\n promoAriaText: resources.promoAriaText,\r\n priceAriaText: resources.priceAriaText,\r\n discountPercentageAriaText: resources.discountPercentageAriaText,\r\n editGiftCtaText: resources.editGiftCtaText,\r\n dialogAriaText: resources.dialogAriaText,\r\n removeButtonAriaText: resources.removeButtonAriaText,\r\n appliedPromoText: resources.appliedPromoText,\r\n notAppliedPromoText: resources.notAppliedPromoText\r\n // VSI Customization {52133} End\r\n },\r\n telemetry: telemetry,\r\n addToWishlistButtonText: resources.addToWishlistButtonText,\r\n removeFromWishlistButtonText: resources.removeFromWishlistButtonText,\r\n removeButtonText: resources.removeCartButtonText,\r\n shipItText: resources.shipInsteadDisplayText,\r\n pickitUpText: resources.pickItUpDisplayText,\r\n changeStoreText: resources.changeStoreDisplayText,\r\n storeSelectorStateManager: this.props.data.storeSelectorStateManager.result,\r\n outOfStockText: resources.outOfStockErrorMessage,\r\n outOfRangeOneText: resources.errorMessageOutOfRangeOneLeft,\r\n outOfRangeFormatText: resources.errorMessageOutOfRangeFormat,\r\n cartState: this.props.data.cart.result,\r\n orgUnitLocations: this.props.data.orgUnitLocations.result,\r\n removeItemClickHandler: this._removeItemFromCartHandler,\r\n moveToWishlistSuccessHandler: this._moveToWishlistSuccessHandler,\r\n updateCartLinesQuantitySuccessHandler: this._updateCartlineQuantity,\r\n locationChangedHandler: this._fulfillmentStoreIdUpdated,\r\n wishlists: wishlists,\r\n defaultWishlistName: resources.defaultWishlistName,\r\n pickupDeliveryModeCode: PickupDeliveryModeCode,\r\n includeErrors: config.showOutOfStockErrors,\r\n showShippingChargesForLineItems: config.showShippingChargesForLineItems,\r\n telemetryContent: this.telemetryContent,\r\n isQuantityLimitsFeatureEnabled: isQuantityLimitsFeatureEnabled,\r\n addToOrderTemplateDialogResources: this._generateAddToOrderTemplateDialogResources(resources),\r\n createOrderTemplateDialogResources: this._generateOrderTemplateNameDialogResources(resources),\r\n itemAddedToOrderTemplateDialogResources: this._generateItemAddedToOrderTemplateDialogResources(resources),\r\n duplicateItemsWhenAddingToOrderTemplateDialogResources: this._generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(resources),\r\n addToOrderTemplateButtonText: resources.addToOrderTemplateButtonText,\r\n addToOrderTemplateButtonTooltip: resources.addToOrderTemplateButtonTooltip,\r\n addToOrderTemplateMessage: resources.addToOrderTemplateMessage,\r\n addItemToOrderTemplateError: resources.addItemToOrderTemplateError,\r\n orderTemplates: orderTemplates,\r\n customerInformation: customerInformation,\r\n channelDeliveryOptionConfig: this.props.data.channelDeliveryOptionConfig?.result,\r\n sendState: this.state.selectedBonusItems,\r\n deliveryByMessagesCore: this.state.deliveryByMessagesCore,\r\n deliveryByMessageSPDS: this.state.deliveryByMessageSPDS,\r\n hideDeliveryMessage: this.state.disableCheckoutButton\r\n })\r\n ) : null;\r\n }\r\n /* VSI customization START */\r\n private _getAllCoupons(props: IMfrmCartProps): void {\r\n if (!hasArray(this.props.data.cart.result?.cart?.CartLines)) {\r\n return;\r\n }\r\n // const { context } = props;\r\n // const getAllBonusCoupons = _getBonusCouponsDetails(context, '');\r\n // getAllBonusCoupons.then((result) => {\r\n // if (result && result !== undefined) {\r\n // this.getCoupons.push(result);\r\n // localStorage.setItem('bonusCouponsDetail', JSON.stringify(this.getCoupons));\r\n // // this.props.context.actionContext.update(new BonusCouponDetailsInput(), { bonusCouponDetail: JSON.stringify(this.getCoupons) });\r\n // }\r\n // }).catch((error) => {\r\n // this.props.telemetry.warning(error);\r\n // this.props.telemetry.debug('Unable to get Bonus Coupons Details when get all coupons');\r\n // });\r\n if (this.props.data.bonusCouponsDetails?.result) {\r\n this.getCoupons.push(this.props.data.bonusCouponsDetails.result.couponsDetails);\r\n /* VSI customization START */\r\n getSetBonusCouponDetail('set', this.getCoupons);\r\n // localStorage.setItem('bonusCouponsDetail', JSON.stringify(this.getCoupons));\r\n /* VSI customization END*/\r\n }\r\n }\r\n\r\n private _checkPromoCode(props: IMfrmCartProps): void {\r\n this.isGiftCoupon = [];\r\n this.props.data.cart.result?.cart && this.props.data.cart.result?.cart.Coupons?.map((userDefinePromo) => {\r\n this.getCoupons.map((bonusCoupons) => {\r\n bonusCoupons.BonusCoupons?.map((coupons) => {\r\n\r\n if (coupons.BonusCoupon === userDefinePromo.Code) {\r\n this.isGiftCoupon.push(coupons);\r\n } else {\r\n coupons.ChildCoupons?.map((childCoupons) => {\r\n if (childCoupons === userDefinePromo.Code) {\r\n if (this.isGiftCoupon.indexOf(coupons) === -1) {\r\n this.isGiftCoupon.push(coupons);\r\n }\r\n }\r\n });\r\n }\r\n\r\n return [];\r\n });\r\n });\r\n });\r\n if (this.isGiftCoupon && this.isGiftCoupon.length > 0) {\r\n this._getBonusItems(this.isGiftCoupon, this.props);\r\n this.callFirstTime = true;\r\n }\r\n }\r\n // tslint:disable-next-line: typedef\r\n private _reconstructData = async (globalBonusItems: IMFIBonusItemsResponse[]) => {\r\n const testVarStruct = globalBonusItems;\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 }\r\n }\r\n }\r\n }\r\n return testVarStruct;\r\n };\r\n\r\n // tslint:disable-next-line: typedef\r\n private _getBonusItemsBrandName = async (globalBonusItems: IMFIBonusItemsResponse[]) => {\r\n const {\r\n context: {\r\n actionContext: ctx,\r\n request: {\r\n apiSettings: {\r\n channelId\r\n }\r\n }\r\n }\r\n } = this.props;\r\n const testVarStruct = globalBonusItems;\r\n const bonusItemsBrandName: IProductBonusWithBrandName[] = [];\r\n testVarStruct.map((obj) => {\r\n const deets = obj.BonusItemsDetails;\r\n deets?.map((items) => {\r\n items?.Items?.map((bonasItems) => {\r\n bonasItems.BonusItems?.map(async (bonusArray) => {\r\n const productId = Number(bonusArray.BonusProductId);\r\n const productSpecificationData: IAttributeValueProduct[] = await getAttributeValuesAsync({ callerContext: ctx, queryResultSettings: {} }, productId, channelId, 0);\r\n const newProductSpecificationData = productSpecificationData.filter(Boolean);\r\n let brandNameGet = '';\r\n if (newProductSpecificationData) {\r\n brandNameGet = newProductSpecificationData.find(item => item.Name === 'Brand')?.TextValue!;\r\n }\r\n const productWithBrand = { productId, brandName: brandNameGet };\r\n const getExist = bonusItemsBrandName.includes(productWithBrand);\r\n if (!getExist) {\r\n bonusItemsBrandName.push(productWithBrand);\r\n }\r\n /* VSI customization START */\r\n getSetBonusItemBrandName('set', bonusItemsBrandName);\r\n // localStorage.setItem('bonusItmesWithBrand', JSON.stringify(bonusItemsBrandName));\r\n /* VSI customization END*/\r\n });\r\n });\r\n });\r\n });\r\n };\r\n\r\n // tslint:disable-next-line:max-func-body-length\r\n private _getBonusItems(bonusItems: IMFIBonusCouponsDetail[], props: IMfrmCartProps): void {\r\n const {\r\n context,\r\n data: {\r\n cart: { result: cart }\r\n },\r\n telemetry\r\n } = props;\r\n this.globalBonusItems = [];\r\n let productQuantityCount: number | undefined;\r\n const bonusItemsParams: string[] = [];\r\n const bonusCartlines: CartLine[] | null = [];\r\n bonusItems.map((bonusValue) => {\r\n if (bonusValue.BonusCoupon) {\r\n bonusItemsParams.push(bonusValue.BonusCoupon);\r\n }\r\n });\r\n if (props.data.cart.result?.cart.Id) {\r\n localStorage.removeItem('BonusItemProduct');\r\n const requestBodyMFIBonus: IMFIGetBonusItemsParameters = {\r\n CartId: props.data.cart.result?.cart.Id,\r\n Coupons: bonusItemsParams\r\n };\r\n // After applying promotion, used stored mfiBonusItems API response to prevent duplicate calls\r\n const mfiBonusItems = this.props.data.mfiBonusItems.result;\r\n const getBonusItemsProducts = _getMFIGetBonusItems(context, requestBodyMFIBonus, mfiBonusItems);\r\n\r\n getBonusItemsProducts.then(async (bonusItemsResponse) => {\r\n this.props.context.actionContext.update(new MFIbonusitemsInput(), bonusItemsResponse?.BonusItemsDetails);\r\n // this.props.context.actionContext.update(new MFIbonusitemsInput(), { bonusItems: bonusItemsResponse?.BonusItemsDetails, message: bonusItemsResponse?.Message });\r\n\r\n if (bonusItemsResponse !== undefined) {\r\n // bonusItemsResponse !== null && localStorage.setItem('BonusItemProduct', JSON.stringify(bonusItemsResponse));\r\n const bonusItemResult = bonusItemsResponse;\r\n const checkExist = this.globalBonusItems.includes(bonusItemResult!);\r\n if (!checkExist) {\r\n bonusItemResult && this.globalBonusItems.push(bonusItemResult);\r\n }\r\n const cartState = await getCartState(props.context.actionContext);\r\n this._getBonusItemsBrandName(this.globalBonusItems);\r\n const bonusLocalStorageData = await this._reconstructData(this.globalBonusItems);\r\n /* VSI customization START */\r\n getSetBonusItemProd('set', bonusLocalStorageData);\r\n this.setState({ isBonusItemProductUpdated: true });\r\n // localStorage.setItem('BonusItemProduct', JSON.stringify(bonusLocalStorageData));\r\n /* VSI customization END*/\r\n bonusItemResult?.BonusItemsDetails?.map((bonusItemProducts) => {\r\n bonusItemProducts.Items?.map((item) => {\r\n cart?.cart.CartLines?.filter((cartline: CartLine) => {\r\n if (item.QualifyingItemId === cartline.ItemId) {\r\n productQuantityCount = cartline.Quantity;\r\n }\r\n });\r\n item.BonusItems?.map(async (product) => {\r\n\r\n let checkItemAlredyInCart: boolean = false;\r\n cart?.cart.CartLines?.filter((cartline: CartLine) => {\r\n if (product.BonusItemId === cartline.ItemId) {\r\n checkItemAlredyInCart = true;\r\n }\r\n });\r\n\r\n if (!checkItemAlredyInCart && product.AdditionToCart === 'Auto') {\r\n const productToAdd = {\r\n ProductId: Number(product.BonusProductId),\r\n // ProductTypeValue: 5,\r\n EntryMethodTypeValue: 5,\r\n ItemId: product.BonusItemId,\r\n Quantity: productQuantityCount\r\n };\r\n bonusCartlines.push(productToAdd);\r\n }\r\n this._addGiftCta();\r\n });\r\n });\r\n });\r\n const {\r\n context: {\r\n request: {\r\n apiSettings: {\r\n channelId,\r\n catalogId\r\n }\r\n }\r\n }\r\n } = this.props;\r\n const cookies = new Cookies();\r\n const zipcode = cookies.get('zip_code');\r\n if (bonusCartlines && bonusCartlines.length > 0) {\r\n this._validateCart().then(async () => {\r\n this.props.context.actionContext.update(new PromoCodeAppliedOnCartInput(), { isInProcess: true });\r\n await addCartLinesAsync({ callerContext: this.props.context.actionContext }, cart!.cart.Id, bonusCartlines).then(async newCart => {\r\n await cartState.refreshCart({});\r\n this.props.context.actionContext.update(new PromoCodeAppliedOnCartInput(), { isInProcess: false });\r\n reshuffleItems(this.props.data.cart.result?.cart.CartLines ? this.props.data.cart.result?.cart.CartLines : []);\r\n this.refreshCartCookie();\r\n this._getStateFromZipCode(this.props, zipcode, true);\r\n getAttributesForCartLineItems(new AttributesForSelectedVariantInput(channelId, catalogId), this.props.context.actionContext).then((res) => {\r\n this.props.context.actionContext.update(new AttributesForSelectedVariantInput(channelId, catalogId), res);\r\n this.returnCoreProductCheck();\r\n this.setState({ productAttributes: res });\r\n }).catch((error) => {\r\n telemetry.warning(error);\r\n telemetry.debug('Unable to validate Attributes CartLine Items');\r\n });\r\n });\r\n }).catch((error) => {\r\n telemetry.warning(error);\r\n telemetry.debug('Unable to validate Cart when get bonus items');\r\n });\r\n }\r\n }\r\n }).catch((error) => {\r\n telemetry.warning(error);\r\n telemetry.debug('Unable to mFIGetBonusItemsDetailAsync when get bonus items');\r\n });\r\n }\r\n }\r\n\r\n private _addGiftCta(): void {\r\n /* VSI customization START */\r\n const getLocalStorage = getSetBonusItemProd('get');\r\n // const getLocalStorage = localStorage.getItem('BonusItemProduct');\r\n /* VSI customization END*/\r\n let bonusItemArray: IMFIBonusItemsResponse[] = [];\r\n let bonusProductCount: number = 0;\r\n let bonusItemLength: number | undefined;\r\n let bonusProductActualStatus: number = 0;\r\n let manualBoniusItems: number = 0;\r\n const bonusItemsArrayProduct = [];\r\n if (getLocalStorage) {\r\n bonusItemArray = getLocalStorage;\r\n if (hasArray(bonusItemArray)) {\r\n bonusItemArray?.map((bonusitemdetail) => {\r\n bonusitemdetail.BonusItemsDetails?.map((bonusitem) => {\r\n bonusitem.Items?.map((item) => {\r\n bonusItemLength = item.BonusItems?.length;\r\n bonusProductActualStatus = item.BonusProductQty;\r\n\r\n item.BonusItems?.map((finalItem) => {\r\n this.props.data.cart.result?.cart.CartLines?.filter((cartline) => {\r\n if (finalItem.AdditionToCart === 'Manual') {\r\n bonusItemsArrayProduct.push(finalItem);\r\n }\r\n if (finalItem.BonusItemId === cartline.ItemId) {\r\n bonusProductCount++;\r\n }\r\n if (finalItem.BonusItemId === cartline.ItemId && finalItem.AdditionToCart === 'Manual') {\r\n manualBoniusItems++;\r\n }\r\n });\r\n });\r\n\r\n });\r\n });\r\n });\r\n }\r\n if (bonusItemsArrayProduct.length > 0) {\r\n if (bonusProductActualStatus === manualBoniusItems) {\r\n this.ctaGiftButton = false;\r\n } else {\r\n this.ctaGiftButton = false;\r\n }\r\n } else {\r\n if (bonusItemLength === bonusProductCount) {\r\n this.ctaGiftButton = false;\r\n } else {\r\n this.ctaGiftButton = false;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // tslint:disable-next-line\r\n private async _showCtaGiftProducts(cartlineTo: CartLine, context: any, cartlines: CartLine[] | undefined): Promise {\r\n const {\r\n data: {\r\n cart: { result: cart }\r\n },\r\n telemetry,\r\n context: {\r\n actionContext: actionContext\r\n }\r\n } = this.props;\r\n /* VSI customization START */\r\n const getLocalStorage = getSetBonusItemProd('get');\r\n // const getLocalStorage = localStorage.getItem('BonusItemProduct');\r\n /* VSI customization END*/\r\n const cartState = await getCartState(actionContext);\r\n const bonusCartlines: CartLine[] | null = [];\r\n let bonusItemArray: IMFIBonusItemsResponse[] = [];\r\n let productQuantityCount: number | undefined;\r\n if (getLocalStorage) {\r\n bonusItemArray = getLocalStorage;\r\n bonusItemArray?.map((bonusitemdetail) => {\r\n bonusitemdetail.BonusItemsDetails?.map((bonusitem) => {\r\n bonusitem.Items?.map((item) => {\r\n if (item.QualifyingItemId === cartlineTo.ItemId) {\r\n productQuantityCount = cartlineTo.Quantity;\r\n item.BonusItems?.map(async (product) => {\r\n let checkItemAlredyInCart: boolean = false;\r\n cartlines?.filter((cartline: CartLine) => {\r\n if (product.BonusItemId === cartline.ItemId) {\r\n checkItemAlredyInCart = true;\r\n }\r\n });\r\n\r\n if (!checkItemAlredyInCart && product.AdditionToCart === 'Auto') {\r\n const productToAdd = {\r\n ProductId: Number(product.BonusProductId),\r\n // ProductTypeValue: 5,\r\n EntryMethodTypeValue: 5,\r\n ItemId: product.BonusItemId,\r\n Quantity: productQuantityCount\r\n };\r\n bonusCartlines.push(productToAdd);\r\n }\r\n });\r\n }\r\n });\r\n });\r\n });\r\n if (bonusCartlines.length > 0) {\r\n const {\r\n context: {\r\n request: {\r\n apiSettings: {\r\n channelId,\r\n catalogId\r\n }\r\n }\r\n }\r\n } = this.props;\r\n const cookies = new Cookies();\r\n const zipcode = cookies.get('zip_code');\r\n this._validateCart().then(async () => {\r\n this.props.context.actionContext.update(new PromoCodeAppliedOnCartInput(), { isInProcess: true });\r\n await addCartLinesAsync({ callerContext: actionContext }, cart!.cart.Id, bonusCartlines).then(async newCart => {\r\n await cartState.refreshCart({});\r\n this.props.context.actionContext.update(new PromoCodeAppliedOnCartInput(), { isInProcess: false });\r\n reshuffleItems(this.props.data.cart.result?.cart.CartLines ? this.props.data.cart.result?.cart.CartLines : []);\r\n this.refreshCartCookie();\r\n this._getStateFromZipCode(this.props, zipcode, true);\r\n getAttributesForCartLineItems(new AttributesForSelectedVariantInput(channelId, catalogId), actionContext).then((res) => {\r\n actionContext.update(new AttributesForSelectedVariantInput(channelId, catalogId), res);\r\n this.returnCoreProductCheck();\r\n this.setState({ productAttributes: res });\r\n }).catch((error) => {\r\n telemetry.warning(error);\r\n telemetry.debug('Unable to validate Attributes CartLine Items show gift products');\r\n });\r\n });\r\n }).catch((error) => {\r\n telemetry.warning(error);\r\n telemetry.debug('Unable to validate Cart show gift products');\r\n });\r\n }\r\n }\r\n }\r\n\r\n /* VSI customization END */\r\n}\r\n\r\nexport default Cart;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport { IOrderSummaryErrors } from '@msdyn365-commerce-modules/cart/src/modules/cart/./cart';\r\nimport { ICartLineItemViewProps } from '@msdyn365-commerce-modules/cart/src/modules/cart/./components//cart-line-items-promotion';\r\nimport { ICartlinesViewProps } from '@msdyn365-commerce-modules/cart/src/modules/cart/./components/cart-line-items';\r\nimport { Button, format, INodeProps, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport get from 'lodash/get';\r\nimport Stepper from 'mfcl/Stepper';\r\nimport * as React from 'react';\r\nimport Cookies from 'universal-cookie';\r\n/* VSI Customization - Start - */\r\nimport { INotification } from '../../data-actions/mfrm-notification.action';\r\n// import { IMfrmNotifications } from './mfrm-cart.da';\r\n// import PromoCodeComponent from './components/promocode.component';\r\nimport PromoCodeComponent from '../../themes/mattressfirm/views/components/promocode.component';\r\nimport { IOrderSummaryLines } from '../../Utilities/order-summary-lineitem';\r\nimport { ICartViewProps } from './mfrm-cart';\r\nimport { IMfrmCartData } from './mfrm-cart.data';\r\nimport { IMfrmCartProps } from './mfrm-cart.props.autogenerated';\r\nimport _getViewPort from '../../Utilities/get-view-port';\r\n\r\n\r\nexport interface ICartlinesProps extends ICartlinesViewProps {\r\n outOfStock?: React.ReactNode | undefined;\r\n errorDelivery?: React.ReactNode | undefined;\r\n QuantityMessage?: React.ReactNode | undefined;\r\n}\r\n\r\nexport interface IDeliveryChildService {\r\n addKeyInPrice: boolean;\r\n excludeZipCode: boolean;\r\n redeliveryMessage: string;\r\n active?: boolean;\r\n productRectId?: number;\r\n serviceName?: string;\r\n serviceSKU?: string;\r\n zipCode?: string;\r\n alternativeSolution: boolean;\r\n}\r\n\r\nexport interface IDeliveryProps {\r\n childService: IDeliveryChildService[];\r\n DefaultStateWithDeliveryExpanded: boolean;\r\n active: boolean;\r\n adjustableBase: string;\r\n boxSpring: string;\r\n callOrTextMessage: string;\r\n defaultStateWithWillCallExpanded: boolean;\r\n descriptionMessage: string;\r\n displayServiceSku: boolean;\r\n mattresses: string;\r\n redeliveryMessage: string;\r\n serviceId: number;\r\n serviceName: string;\r\n serviceProductRecId: number;\r\n serviceSku: string;\r\n switchableServiceIds: string;\r\n warningMessage: string;\r\n willCallMessage: string;\r\n addKeyInPrice?: boolean;\r\n}\r\n\r\n/* VSI Customization - End - */\r\n\r\nconst _renderCartlines = (cartLines: ICartlinesProps[] | undefined, cartEmptyText: string, CartlinesWrapper: INodeProps, storeSelector: React.ReactNode | undefined,\r\n backToShoppingButton: React.ReactNode, waitingComponent: React.ReactNode, cartLoadingStatus: string, cartDataResult: boolean, productCollectionSlot: React.ReactNode[] , deliveryServices:IDeliveryProps[]): JSX.Element[] | JSX.Element => {\r\n if (cartLoadingStatus) {\r\n return <>{cartLoadingStatus};\r\n }\r\n if (cartLines) {\r\n return cartLines.map((cartLine) => {\r\n /** VSI Customization - Start - 21-12-2020 */\r\n /** VSI RecordId of product data is added instead of index to fix the outline issue on remove icon */\r\n const recordId = cartLine.data && cartLine.data.product && cartLine.data.product.RecordId;\r\n const checkExist = !!deliveryServices.find((val: {serviceProductRecId: number}) => val?.serviceProductRecId === recordId);\r\n return (\r\n // tslint:disable: jsx-key\r\n /* eslint-disable react/jsx-key */\r\n
\r\n {cartLine.QuantityMessage}\r\n
\r\n {cartLine.cartline}\r\n {\r\n cartLine.addToOrderTemplate ? (\r\n
\r\n {cartLine.remove}\r\n {/* VSI Customization - Hide add to wishlist button */}\r\n {/* {cartLine.addToWishlist} */}\r\n {/* {cartLine.addToOrderTemplate} */}\r\n
\r\n ) : (\r\n <>\r\n {cartLine.remove}\r\n {/* {cartLine.addToWishlist} */}\r\n {/* VSI Customization End - Hide add to wishlist button */}\r\n \r\n )\r\n }\r\n
\r\n {cartLine.outOfStock}\r\n {cartLine.errorDelivery}\r\n\r\n
\r\n );\r\n /** VSI Customization - End - 21-12-2020 */\r\n });\r\n } else {\r\n return (cartDataResult ?\r\n (\r\n <>\r\n
\r\n
\r\n

{cartEmptyText}

\r\n {backToShoppingButton}\r\n
\r\n
\r\n {productCollectionSlot && productCollectionSlot.length > 0 &&\r\n productCollectionSlot.map((children: React.ReactNode, index: number) => {\r\n return (\r\n
\r\n {children}\r\n
\r\n );\r\n })}\r\n \r\n ) : <>{waitingComponent}\r\n );\r\n }\r\n};\r\n\r\nconst _renderErrorBlock = (errorData: IOrderSummaryErrors | undefined): JSX.Element | null => {\r\n if (!errorData || errorData.errors.length === 0) {\r\n return null;\r\n }\r\n return (\r\n \r\n {errorData.header}\r\n {errorData.errors}\r\n \r\n );\r\n};\r\n\r\nconst getTotalPrice = (orderSummaryLines: IOrderSummaryLines | undefined) => {\r\n const delivery = get(orderSummaryLines?.deliveryFee, 'props.value') || 0;\r\n const price = get(orderSummaryLines?.orderTotal, 'props.price');\r\n return parseFloat(price) + getSavings(orderSummaryLines) - getTax(orderSummaryLines) - _parseRecyclingFee(orderSummaryLines) - delivery;\r\n};\r\nconst getSavings = (orderSummaryLines: IOrderSummaryLines | undefined) => {\r\n const savings = get(orderSummaryLines?.totalDiscounts, 'props.price');\r\n if(savings) {\r\n return parseFloat(Math.abs(savings).toFixed(2));\r\n }\r\n return 0;\r\n};\r\n\r\nconst getFinalPrice = (orderSummaryLines: IOrderSummaryLines | undefined, mattressRecyclingFee?: number, props?: ICartViewProps) => {\r\n const totalPrice = getTotalPrice(orderSummaryLines);\r\n const savings = getSavings(orderSummaryLines);\r\n const tax = props?.calculateTaxOnCart ? getTax(orderSummaryLines) : 0.0;\r\n const finalPrice = totalPrice - (savings ? savings : 0) + (tax ? tax : 0) + (props?.calculateTaxOnCart ? (mattressRecyclingFee ? mattressRecyclingFee : 0) : 0);\r\n return parseFloat(finalPrice.toFixed(2));\r\n};\r\n\r\nconst getTax = (orderSummaryLines: IOrderSummaryLines | undefined) => {\r\n let price = get(orderSummaryLines?.tax, 'props.price');\r\n price = price - _parseRecyclingFee(orderSummaryLines);\r\n return price ? parseFloat(price) : 0;\r\n};\r\n\r\nconst _getRecyclingFee = (orderSummaryLines: IOrderSummaryLines | undefined) => {\r\n const label = get(orderSummaryLines?.mattressRecyclingFee, 'props.label');\r\n const value = get(orderSummaryLines?.mattressRecyclingFee, 'props.value');\r\n return {label, value};\r\n};\r\n// const _getDeliveryFee = (orderSummaryLines: IOrderSummaryLines | undefined) => {\r\n// const label = get(orderSummaryLines?.deliveryFee, 'props.label');\r\n// const value = get(orderSummaryLines?.deliveryFee, 'props.value');\r\n// return {label, value};\r\n// };\r\nlet yetToBeCalculated = '';\r\nlet recyclingFeeCart = 0;\r\nconst _parseRecyclingFee = (orderSummaryLines: IOrderSummaryLines | undefined) => {\r\n const value = get(orderSummaryLines?.mattressRecyclingFee, 'props.value');\r\n return value.toLowerCase() === yetToBeCalculated ? (recyclingFeeCart || 0) : Number(value.split('$')[1]);\r\n};\r\n\r\nconst formatNumber = (num: number) => {\r\n return parseFloat(num.toFixed(2)).toLocaleString('en-US', {\r\n style: 'currency',\r\n currency: 'USD'\r\n });\r\n};\r\n\r\nconst getCartItemsQuantity = (cartLines?: ICartlinesViewProps[]): number => {\r\n let totalItems = 0;\r\n if(cartLines) {\r\n for(const cl of cartLines) {\r\n totalItems = totalItems + (cl.data?.cartline.Quantity ? cl.data?.cartline.Quantity : 0);\r\n }\r\n }\r\n return totalItems;\r\n};\r\n\r\nconst _renderOrderSummarylines = (orderSummaryLines: IOrderSummaryLines | undefined, OrderSummaryItems: INodeProps,\r\n props: ICartViewProps, notificationItems: INotification[] | undefined, tax?: number, mattressRecyclingFee?: number): JSX.Element | null => {\r\n if (!orderSummaryLines) {\r\n props.context.telemetry.warning('OrderSummary content is empty, module wont render');\r\n return null;\r\n }\r\n getCartItemsQuantity(props.cartlines);\r\n yetToBeCalculated = props.resources.yetToBeCalculatedText.toLowerCase();\r\n const feeFromCart = props.data.cart.result?.cart.ExtensionProperties?.[0]?.Value?.DecimalValue!;\r\n recyclingFeeCart = feeFromCart;\r\n const finalRecyclingFee = feeFromCart ? props.context.cultureFormatter.formatCurrency(feeFromCart) : _getRecyclingFee(orderSummaryLines).value;\r\n const { deliveryServices } = props.app.config;\r\n const checkCartLines: (ICartlinesViewProps[] | undefined)[] = [];\r\n deliveryServices.forEach((item: {serviceProductRecId: number}) => {\r\n const checkExists = props.cartlines?.filter(val => val.data?.cartline.ProductId === item.serviceProductRecId);\r\n if(checkExists?.length! > 0) {\r\n checkCartLines.push(checkExists);\r\n }\r\n });\r\n const cookies = new Cookies();\r\n const zipCode = cookies.get('zip_code');\r\n const itemsReduce = checkCartLines?.length;\r\n const totalCartlineItems = getCartItemsQuantity(props.cartlines);\r\n const zipCodeRef = React.useRef(null);\r\n const zipCodeText = zipCodeRef.current?.innerHTML.split('').join(' ');\r\n return (\r\n \r\n {/* VSI Customization - Start {unknown} + {52133} */}\r\n {_renderPromoCode(props, notificationItems)}\r\n
\r\n
\r\n {`${props.resources.itemsString}, ${totalCartlineItems > 0 ? (totalCartlineItems - itemsReduce) : totalCartlineItems}, ${formatNumber(getTotalPrice(orderSummaryLines))}`}\r\n \r\n
\r\n {orderSummaryLines.totalDiscounts &&\r\n
\r\n {`${props.resources.savingsString}, minus${formatNumber(getSavings(orderSummaryLines))}`}\r\n \r\n
\r\n }\r\n {!!(feeFromCart || _parseRecyclingFee(orderSummaryLines)) && props.calculateTaxOnCart &&\r\n
\r\n {`${_getRecyclingFee(orderSummaryLines).label}, ${finalRecyclingFee}`}\r\n \r\n
\r\n }\r\n
\r\n {`${props.resources.taxString}, ${formatNumber(getTax(orderSummaryLines))}`}\r\n

\r\n \r\n \r\n \r\n \r\n \r\n

\r\n
\r\n
\r\n
\r\n {`${props.resources.subTotalString}, ${formatNumber(getFinalPrice(orderSummaryLines, _parseRecyclingFee(orderSummaryLines), props))}`}\r\n \r\n
\r\n {/* VSI Customization - End - */}\r\n
\r\n );\r\n};\r\n\r\n/* VSI Customization - Start - */\r\nconst _renderPromoCode = (props: ICartViewProps, notificationItems: INotification[] | undefined): React.ReactNode => {\r\n const {\r\n data: {\r\n cart: { result: cart }\r\n },\r\n resources\r\n } = props;\r\n\r\n return cart && (\r\n \r\n );\r\n};\r\n/* VSI Customization - End - */\r\n\r\nconst _renderPromotions = (promotions: ICartLineItemViewProps): JSX.Element | undefined => {\r\n return (\r\n \r\n \r\n {promotions.promotionMessage}\r\n {promotions.promotionSeeAllLink}\r\n {promotions.promotionDialog}\r\n \r\n \r\n );\r\n};\r\n\r\n// tslint:disable-next-line: cyclomatic-complexity\r\nconst CartView: React.FC> = (props) => {\r\n /** VSI Customization - Start - */\r\n const { resources,_renderUpdateZipCode, _productDetails, disableCheckoutButtonState, slots: { productCollection, buyNowPayLaterOptions }, config: { continueShoppingButtonTitle }, data: { cart: { result: cart } } } = props;\r\n const backToShoppingButton = ;\r\n const isCartEmpty = cart && cart.cart.CartLines && cart.cart.CartLines.length === 0;\r\n const productAttributes = props.data.productAttributes.result;\r\n const Value:boolean = false;\r\n const getSavings = get(props.orderSummaryLineitems?.totalDiscounts, 'props.price');\r\n const savings = parseFloat(Math.abs(getSavings).toFixed(2));\r\n if(productAttributes && productAttributes.length > 0) {\r\n for(const productSpecItem of productAttributes) {\r\n\r\n // if(productSpecItem. === 'Core') {\r\n // includeDeliveryInStepper = true;\r\n // }\r\n productSpecItem.attributeValue.find((shippingData) => {\r\n if(shippingData?.TextValue && shippingData.TextValue.trim().toLocaleLowerCase() === 'delivery') {\r\n // includeDeliveryInStepper = true;\r\n // props.showDeliveryStepper = true;\r\n // this.setState({showDeliveryStepper:true});\r\n }\r\n });\r\n }\r\n }\r\n const checkoutDisableButton = !isCartEmpty ? : null;\r\n /** VSI Customization - End - */\r\n const appendedClassName = props.cartlines && props.cartlines.length > 0 ? props.className : `${props.className} ms-cart-empty`;\r\n const stepClassName = 'mfrm-stepper__step';\r\n let steps: (() => { label: string; color: string; icon: JSX.Element; className: string; ariaLabel?: string; }[]) | { label: string; color: string; icon: JSX.Element; className: string; ariaLabel?: string }[];\r\n if (props.showDeliveryStepper) {\r\n steps = [\r\n {\r\n label: `${resources.stepperLabelCart}`,\r\n ariaLabel: `Step 1,`,\r\n color: '#D63426',\r\n icon: (),\r\n className: `${stepClassName}--inactive`\r\n },\r\n {\r\n label: `${resources.stepperLabelCustInfo}`,\r\n ariaLabel: `Step 2,`,\r\n color: '#B3B5B7',\r\n icon: (),\r\n className: `${stepClassName}--inactive`\r\n },\r\n {\r\n label: `${resources.stepperLabelDelivery}`,\r\n ariaLabel: `Step 3,`,\r\n color: '#B3B5B7',\r\n icon: (),\r\n className: `${stepClassName}--inactive`\r\n },\r\n {\r\n label: `${resources.stepperLabelPayment}`,\r\n ariaLabel: `Step 4,`,\r\n color: '#B3B5B7',\r\n icon: (),\r\n className: `${stepClassName}--inactive`\r\n }\r\n ];\r\n } else {\r\n steps = [\r\n {\r\n label: `${resources.stepperLabelCart}`,\r\n ariaLabel: `Step 1,`,\r\n color: '#D63426',\r\n icon: (),\r\n className: `${stepClassName}--inactive`\r\n },\r\n {\r\n label: `${resources.stepperLabelCustInfo}`,\r\n ariaLabel: `Step 2,`,\r\n color: '#B3B5B7',\r\n icon: (),\r\n className: `${stepClassName}--inactive`\r\n },\r\n {\r\n label: `${resources.stepperLabelPayment}`,\r\n ariaLabel: `Step 3,`,\r\n color: '#B3B5B7',\r\n icon: (),\r\n className: `${stepClassName}--inactive`\r\n }\r\n ];\r\n }\r\n const newTealiumData = `is_cart_active: ${\r\n isCartEmpty ? '\"false\"' : '\"true\"'\r\n } , new_site: \"true\" , page_context_type: \"checkout\" , page_type: \"checkout\" , page_name: \"cart\", cart_total_quantity: '${\r\n _productDetails?.quantity\r\n }' , cart_subtotal: '${_productDetails?.subTotal}' , cart_product_price: [${\r\n _productDetails?.cartProductPriceArray\r\n }] , cart_product_image_url: [${_productDetails?.productImageUrl}] , cart_product_id: [${\r\n _productDetails?.productIDsArray\r\n }] , cart_product_quantity: [${_productDetails?.productQuantity}] , cart_product_variant: [${\r\n _productDetails?.variantRecord\r\n }] , cart_product_category: [${_productDetails?.productCatgoryArray}] , cart_product_size: [${\r\n _productDetails?.productSize\r\n }] , cart_product_name: [${_productDetails?.productNameArray}] , cart_product_name_1: ${\r\n _productDetails?.productNameArray?.[0]\r\n } , cart_product_name_2: ${_productDetails?.productNameArray?.[1]} , cart_product_name_3: ${\r\n _productDetails?.productNameArray?.[2]\r\n } , cart_product_url: [${_productDetails?.productURL}] , cart_product_image_url_1: ${\r\n _productDetails?.productImageUrl?.[0]\r\n } , cart_product_image_url_2: ${_productDetails?.productImageUrl?.[1]} , cart_product_image_url_3: ${\r\n _productDetails?.productImageUrl?.[2]\r\n } , cart_url: '${_productDetails?.cartUrl}' , product_price: [${\r\n _productDetails?.productPriceArray\r\n }] , product_image_url: [${_productDetails?.productImageUrl}] , product_id: [${\r\n _productDetails?.productIDsArray\r\n }] , product_quantity: [${_productDetails?.productQuantity}] , product_variant: [${\r\n _productDetails?.variantRecord\r\n }] , product_category: [${_productDetails?.productCatgoryArray}] , product_size: [${\r\n _productDetails?.productSize\r\n }] , product_name: [${_productDetails?.productNameArray}] , product_url: [${_productDetails?.productURL}] , product_brand: [${_productDetails?.productBrandName}] , product_discount: [${_productDetails?.productDiscountArray}] , core_item_flag: \"${_productDetails?.isCoreItem}\" , funnel_type: \"${_productDetails?.funnelType}\"`;\r\n\r\n const newTealiumEmpty = `is_cart_active: '\"false\"' , new_site: \"true\" , page_context_type: \"checkout\" , page_type: \"checkout\"`;\r\n const realTealiumObject = isCartEmpty ? newTealiumEmpty : newTealiumData;\r\n const scriptHtml = ``;\r\n const { deliveryServices } = props.app.config;\r\n return (\r\n
\r\n {/** VSI Customization - Start - */}\r\n
\r\n \r\n 0 ? '' : 'empty'}`}>\r\n
\r\n {props.title}\r\n {getSavings &&

{format(resources.cartHeadingSavingLabel, props.context.cultureFormatter.formatCurrency(savings))}

}\r\n
\r\n {(props.cartlines && props.cartlines.length > 0) && props.isMobile &&
{ }} steps={steps} />
}\r\n {props.promotionOptions && _renderPromotions(props.promotionOptions)}\r\n {/* {props.cartlines && props.cartlines.length > 0 && backToShoppingButton} */}\r\n
\r\n {/** VSI Customization - End - */}\r\n {props.showRemoveNotification && {format(resources.removedFromCartText, props.showProductTitle)}}\r\n {props.cartlines && props.cartlines.length > 0 && _renderUpdateZipCode}\r\n {/** VSI Customization - Start - 14-12-2020 */}\r\n {/** Added a node and spans for static resource display */}\r\n {props.cartlines && props.cartlines.length > 0 &&\r\n \r\n {resources.mfrmCartTitleProduct}\r\n {resources.mfrmCartTitleQuantity}\r\n {resources.mfrmCartTitlePrice}\r\n \r\n }\r\n {/** VSI Customization - End - 12-12-2020 */}\r\n {/** VSI Customization - Start - */}\r\n {Value}\r\n \r\n {_renderCartlines(props.cartlines, resources.emptyCartText, props.CartlinesWrapper,\r\n props.storeSelector, backToShoppingButton, props.waitingComponent, props.cartLoadingStatus, props.cartDataResult, productCollection, deliveryServices)}\r\n {props.isDesktop && props.cartlines && props.cartlines.length > 0 && buyNowPayLaterOptions[0]}\r\n \r\n\r\n {/** VSI Customization - End - */}\r\n
\r\n {props.orderSummaryHeading &&\r\n \r\n {(props.cartlines && props.cartlines.length > 0) && props.isDesktop &&
{ }} steps={steps} />
}\r\n \r\n \r\n {/* VSI Customization - Start - */}\r\n {/* {props.orderSummaryHeading} */}\r\n {props.cartlines && props.cartlines.length > 0 && _renderUpdateZipCode}\r\n {_renderOrderSummarylines(props.orderSummaryLineitems, props.OrderSummaryItems, props, props.data.notifications.result)}\r\n {/* VSI Customization - End - */}\r\n {_renderErrorBlock(props.OrderSummaryErrors)}\r\n {/** VSI Customization - Start - */}\r\n {<> {!disableCheckoutButtonState ? props.checkoutAsSignInUserButton : checkoutDisableButton} }\r\n {/* props.checkoutAsGuestButton */}\r\n {/** VSI Customization - End - */}\r\n {props.createTemplateFromCartButton}\r\n \r\n \r\n }\r\n {props.isMobile && props.cartlines && props.cartlines.length > 0 && buyNowPayLaterOptions[0]}\r\n { {!disableCheckoutButtonState ? props.checkoutAsSignInUserButton : checkoutDisableButton}}\r\n {props.storeSelector}\r\n
\r\n );\r\n};\r\n\r\nexport default CartView;","/* tslint:disable: no-duplicate-imports */\r\nimport { getPromotionOptionsForCartLineItems, PromotionOptionsForCartLineItems } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { CartPromotionLine } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * IPromotionData entity interface.\r\n */\r\nexport interface IPromotionData {\r\n promotionOptions?: CartPromotionLine[];\r\n}\r\n\r\n/**\r\n * Calls the Retail API and returns a promotion data\r\n */\r\nexport async function getPromotionData(ctx: IActionContext): Promise {\r\n const promotionData: IPromotionData = {};\r\n\r\n await getPromotionOptionsForCartLineItems(\r\n new PromotionOptionsForCartLineItems(ctx.requestContext.apiSettings),\r\n ctx\r\n ) .then(promotionOptions => {\r\n if (promotionOptions) {\r\n promotionData.promotionOptions = promotionOptions;\r\n }\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n return {};\r\n });\r\n\r\n return promotionData;\r\n}","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['mfrm-cart'] = {\n c: () => require('partner/modules/mfrm-cart/mfrm-cart.tsx'),\n $type: 'containerModule',\n da: [{name:'bonusCouponDetail', path:'actions/bonus-coupon-details.action', runOn: 0},{name:'bonusCouponsDetails', path:'data-actions/bonuscoupons-action.action', runOn: 0},{name:'bonusItemProduct', path:'actions/bonus-item-product.action', runOn: 0},{name:'cart', path:'@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action', runOn: 0},{name:'channelDeliveryOptionConfig', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration', runOn: 0},{name:'customerInformation', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer', runOn: 0},{name:'deliveryOptions', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-cartlines', runOn: 0},{name:'featureState', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state', runOn: 0},{name:'mfiBonusItems', path:'data-actions/mfrm-mfi-bonusitem.action', runOn: 0},{name:'notifications', path:'data-actions/mfrm-notification.action', runOn: 0},{name:'orderTemplates', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/order-templates/get-order-templates-preview', runOn: 1},{name:'productAttributes', path:'data-actions/get-product-attributes-cartlines', runOn: 0},{name:'productAvailabilites', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-availabilities-cartlines', runOn: 0},{name:'products', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-products-in-active-cart', runOn: 0},{name:'promoCodeApplicationState', path:'data-actions/promocode-applied-in-progress.action', runOn: 0},{name:'specialSynchrony', path:'actions/trigger-special-synchrony-financing.action', runOn: 0},{name:'storeSelectorStateManager', path:'@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action', runOn: 0},{name:'userDefinedPromoCode', path:'actions/user-defined-promocode.action', runOn: 0},{name:'wishlistItems', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-items-in-wishlist', runOn: 1},{name:'wishlists', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id', runOn: 1}],\n \n iNM: false,\n ns: '__local__',\n n: 'mfrm-cart',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/mfrm-cart'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action';\n let dataAction = require('@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-availabilities-cartlines';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-availabilities-cartlines');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-cartlines';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-cartlines');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-items-in-wishlist';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-items-in-wishlist');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-products-in-active-cart';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-products-in-active-cart');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/order-templates/get-order-templates-preview';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/order-templates/get-order-templates-preview');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action';\n let dataAction = require('@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/bonus-coupon-details.action';\n let dataAction = require('partner/actions/bonus-coupon-details.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/bonus-item-product.action';\n let dataAction = require('partner/actions/bonus-item-product.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/trigger-special-synchrony-financing.action';\n let dataAction = require('partner/actions/trigger-special-synchrony-financing.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/user-defined-promocode.action';\n let dataAction = require('partner/actions/user-defined-promocode.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'data-actions/bonuscoupons-action.action';\n let dataAction = require('partner/data-actions/bonuscoupons-action.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'data-actions/get-product-attributes-cartlines';\n let dataAction = require('partner/data-actions/get-product-attributes-cartlines');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'data-actions/mfrm-mfi-bonusitem.action';\n let dataAction = require('partner/data-actions/mfrm-mfi-bonusitem.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'data-actions/mfrm-notification.action';\n let dataAction = require('partner/data-actions/mfrm-notification.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'data-actions/promocode-applied-in-progress.action';\n let dataAction = require('partner/data-actions/promocode-applied-in-progress.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|mfrm-cart|mfrm-cart'] = {\n c: () => require('partner/modules/mfrm-cart/mfrm-cart.view.tsx'),\n cn: '__local__-__local__-mfrm-cart'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport MsDyn365, { IActionContext } from '@msdyn365-commerce/core';\nimport { action, computed, observable } from 'mobx';\n\nimport { IListMapViewState, ILoadMapApiInput, IStoreInfo, IStoreSelectionStateContext, IStoreSelectorLocation, IStoreSelectorStateManager } from './i-store-selection-state-manager';\n\n/**\n * Abstract instance of IStoreSelectorStateManager with base implementation\n * of everything except the geoLocate function.\n */\nexport abstract class BaseStoreSelectorStateManager implements IStoreSelectorStateManager {\n\n @computed public get isDialogOpen(): Readonly {\n return this._context !== undefined;\n }\n\n @computed public get context(): Readonly {\n return this._context;\n }\n\n @observable public isMapApiLoaded?: boolean;\n\n @observable public selectedStoreLocationId?: string;\n\n @observable public preferredStore?: IStoreInfo;\n\n @observable public listMapViewState: IListMapViewState = { displayList: true, displayMap: false };\n\n @observable public isMapModuleLoaded?: boolean;\n\n @observable public lastInlineShownStoreInfo?: IStoreInfo;\n\n @observable protected _context?: IStoreSelectionStateContext;\n\n private readonly preferredStoreLocalStorageKey: string = '_msdyn365__preferredStore_';\n\n constructor() {\n this.isMapModuleLoaded = false;\n const value = this._readFromToCookie(this.preferredStoreLocalStorageKey);\n try {\n const storeInfo: IStoreInfo | undefined = value ? JSON.parse(value) : undefined;\n if (storeInfo) {\n this.preferredStore = storeInfo;\n }\n } catch {\n this.preferredStore = undefined;\n }\n\n }\n\n public abstract geoLocate(searchTerm: string, actionContext: IActionContext): Promise;\n\n public abstract loadMapApi(input: ILoadMapApiInput): Promise;\n\n @action\n public async toggleListMapViewState(): Promise {\n this.listMapViewState = {\n displayList: !this.listMapViewState.displayList,\n displayMap: !this.listMapViewState.displayMap\n };\n }\n\n @action\n public async setMapModuleLoaded(input: boolean): Promise {\n this.isMapModuleLoaded = input;\n }\n\n @action\n public async setOrgUnitStoreInformation(input: IStoreSelectionStateContext): Promise {\n this._context = input;\n }\n\n @action\n public async setSelectedStoreLocationId(storeId: string | undefined): Promise {\n this.selectedStoreLocationId = storeId;\n }\n\n @action\n public async setPreferredStoreLocation(storeId?: string, storeName?: string | undefined, writeToCookie: boolean = false, latitude?: number, longitude?: number): Promise {\n const storeInfo: IStoreInfo = { StoreId: storeId, StoreName: storeName, Latitude: latitude, Longitude: longitude };\n this.preferredStore = storeInfo;\n if (writeToCookie) {\n this._writeToCookie(this.preferredStoreLocalStorageKey, JSON.stringify(storeInfo));\n }\n }\n\n @action\n public async setLastInlineStoreInfo(latitude?: number, longitude?: number): Promise {\n const storeInfo: IStoreInfo = { StoreId: '', StoreName: '', Latitude: latitude, Longitude: longitude };\n this.lastInlineShownStoreInfo = storeInfo;\n }\n\n @action\n public async clearPreferredStore(writeToCookie: boolean): Promise {\n this.preferredStore = undefined;\n if (writeToCookie) {\n this._removeCookie(this.preferredStoreLocalStorageKey);\n }\n }\n\n @action\n public async openDialog(input: IStoreSelectionStateContext): Promise {\n if (this._context && this._context.id === input.id) {\n throw new Error('Dialog is already opened');\n }\n\n this._context = input;\n }\n\n @action\n public async closeDialog(): Promise {\n this._context = undefined;\n }\n\n private _removeCookie(key: string): void {\n if (!key) {\n return;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n storage.removeItem(key);\n }\n }\n\n private _writeToCookie(key: string, value: string | undefined): void {\n if (!key || !value) {\n return;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n storage.setItem(key, value);\n }\n }\n\n private _readFromToCookie(key: string): string | undefined {\n if (!key) {\n return undefined;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n const cookieValue = storage.getItem(key);\n if (cookieValue) {\n return cookieValue;\n }\n }\n\n return undefined;\n }\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { action } from 'mobx';\n\nimport { BaseStoreSelectorStateManager } from './base-store-selector-state-manager';\nimport { ILoadMapApiInput, IStoreSelectorLocation } from './i-store-selection-state-manager';\nimport { IMapWindow, MapLocationsResult } from './models/map-data';\n\ndeclare const window: IMapWindow;\n\n/**\n * Instance of IStoreSelectorStateManager manager that uses Map service\n * for geo location.\n */\nexport class MapStoreSelectorStateManager extends BaseStoreSelectorStateManager {\n private readonly SERVICE_ENDPOINT: string = 'https://dev.virtualearth.net/REST/v1/';\n\n private readonly MAP_API_ENDPOINT: string = 'https://www.bing.com/api/maps/mapcontrol?callback=mapAPIReady';\n\n @action\n public async geoLocate(searchTerm: string, actionContext: IActionContext): Promise {\n if (!searchTerm ||\n !actionContext.requestContext.channel ||\n !actionContext.requestContext.channel.BingMapsApiKey ||\n !actionContext.requestContext.channel.BingMapsEnabled) {\n return undefined;\n }\n\n let searchContent: string = searchTerm;\n\n const jsonp = `mapSearchCallback_${crypto.getRandomValues(new Uint32Array(1))[0]}`;\n\n if (actionContext.requestContext.channel.ChannelCountryRegionISOCode) {\n searchContent = `${searchTerm.trim()} ${actionContext.requestContext.channel.ChannelCountryRegionISOCode}`;\n }\n\n const query = encodeURI(searchContent);\n const key = encodeURI(actionContext.requestContext.channel.BingMapsApiKey);\n\n const geolocationApiUrl = actionContext.requestContext.app && actionContext.requestContext.app.config && actionContext.requestContext.app.config.geolocationApiUrl;\n const requestUrl = `${geolocationApiUrl ? geolocationApiUrl : this.SERVICE_ENDPOINT}/Locations?query=${query}&key=${key}&jsonp=${jsonp}`;\n\n return new Promise((resolve) => {\n const script = document.createElement('script');\n script.setAttribute('type', 'text/javascript');\n script.setAttribute('src', requestUrl);\n\n window[jsonp] = (data: MapLocationsResult) => {\n delete window[jsonp];\n script.remove();\n\n if (data && data.resourceSets && data.resourceSets.length > 0 && data.resourceSets[0].resources.length > 0) {\n resolve({\n latitude: data.resourceSets[0].resources[0].point.coordinates[0],\n longitude: data.resourceSets[0].resources[0].point.coordinates[1]\n });\n }\n\n resolve(undefined);\n };\n\n document.body.appendChild(script);\n });\n\n }\n\n @action\n public async loadMapApi(input: ILoadMapApiInput): Promise {\n if (StringExtensions.isNullOrEmpty(input.key)) {\n return Promise.resolve();\n }\n\n const isScriptAlreadyLoaded = !!document?.getElementById('msdyn_map-api-script');\n\n if (isScriptAlreadyLoaded) {\n // Prevents from loading multiple script into the body\n return Promise.resolve();\n }\n\n const url = `${this.MAP_API_ENDPOINT}${input.key ? `&key=${input.key}` : ''}${input.lang ? `&setLang=${input.lang}` : ''}${input.market ? `&setMkt=${input.market}` : ''}`;\n\n return new Promise((resolve, reject) => {\n const script = document?.createElement('script');\n script.type = 'text/javascript';\n script.async = true;\n script.defer = true;\n script.src = url;\n script.id = 'msdyn_map-api-script';\n if (window) {\n window.mapAPIReady = () => {\n this.isMapApiLoaded = true;\n resolve();\n };\n }\n script.addEventListener('error', (error: string | Event) => {\n reject(error);\n });\n document?.body?.appendChild(script);\n });\n }\n\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { createObservableDataAction, IAction, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\nimport { GenericInput, getGenericAction } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IStoreSelectorStateManager } from './i-store-selection-state-manager';\nimport { MapStoreSelectorStateManager } from './map-store-selector-state-manager';\n\nexport function createStoreSelectorStateInput(result: IStoreSelectorStateManager): GenericInput {\n return new GenericInput('mapSSSM', result, 'IStoreSelectorStateManager');\n}\n\nconst createStoreSelectorStateInputInternal = (inputData: ICreateActionContext>): IActionInput => {\n return createStoreSelectorStateInput(new MapStoreSelectorStateManager());\n};\n\nexport const getGenericActionDataAction = createObservableDataAction({\n action: >getGenericAction,\n input: createStoreSelectorStateInputInternal\n});\n\nexport default getGenericActionDataAction;\n","module.exports = React;","module.exports = ReactDOM;"],"names":["callUtag","async","callUtagLink","objToCall","Object","keys","forEach","key","utag","global","hasOwnProperty","link","e","console","log","callUtagView","view","getSetLocalStorage","getSet","valueToSet","returnType","MsDyn365","localStorage","setItem","JSON","stringify","parse","getItem","getSetProductData","products","getSetProductSpec","getSetPromoCodeApplyList","getSetPromoCode","getSetGrandTotal","total","getSetBonusItemProd","globalBonusItems","getSetSelectedBonasItem","bonusItemArray","getSetBonusCouponDetail","getCoupons","getSetPrevBonasModalState","previousBonasModal","getSetBonusItemBrandName","bonusItemsBrandName","getSetDateGroupedProducts","getSetWmapCartLines","cartOperationDoRetry","callback","cartState","callbackResult","status","updateCart","newCartObject","cart","then","refreshCart","updateCartLineDeliverySpecificationsInternal","cartLineDeliverySpecifications","actionContext","CartLines","length","updateLineDeliverySpecificationsAsync","callerContext","Id","newCart","catch","error","telemetry","warning","debug","undefined","errorDetails","LocalizedMessage","message","substatus","updateCartLineInternal","updateCartLinesAsync","addCartLineInternal","addCartLinesAsync","removeCartLinesInternal","cartLineIds","removeCartLinesAsync","Array","isArray","product","context","newURL","variantProductId","RecordId","getProductUrlSync","app","config","queryBasedVariantSelection","getBlockZipCodeMessage","stateName","blockStatesArray","filter","blockstate","request","isCached","getDeliveryMessageActionInput","GetDeliveryMessageInput","result","getDeliveryMessageAction","getATPInventoryStatusInput","GetATPInventoryStatusInput","getATPInventoryStatusAction","fallBackBrandAttribute","parseBrandName","attributes","backendAttribute","recordId","attribute","productBrandName","hasArray","find","currAttribute","Name","toLowerCase","trim","TextValue","getLocalStorage","checkBrandName","item","productId","brandName","parseBrandNameUnbxd","getBrandNameCheck","window","innerWidth","gridSettings","xs","w","sm","md","lg","getZipCode","ctx","geolocationZipCode","requestContext","geoLocation","zipCode","res","cookie","Cookies","zipcode","get","getGeoLocationZipCode","oneYearFromNow","now","Date","setFullYear","getFullYear","OrderSummaryLine","price","label","id","typeName","toBeCalculatedText","freeText","cssLabel","React","className","PriceComponent","data","CustomerContextualPrice","freePriceText","MattressRecyclingFee","DeliveryFeeShow","_buildOrderSummarySection","props","_computedLoyaltyAmount","checkoutState","loyaltyAmount","getDeliveryMode","deliveryMode","featureSate","channelDeliveryOptionConfig","pickupDeliveryMode","PickupDeliveryModeCodes","dM","OrderSummary","SubtotalAmount","TaxAmount","DiscountAmountWithoutTax","TotalAmount","OtherChargeAmount","DiscountAmount","value","mattressRecyclingFee","deliveryObject","deliveryFee","canShip","hasDeliveryMethod","hasShippingMethod","freightFee","channelConfiguration","retailMultiplePickUpOptionEnabled","pickupDeliveryModeCode","PickupDeliveryModeCode","emailDeliveryModeCode","EmailDeliveryModeCode","deliveryModes","map","cartLine","DeliveryMode","ShippingChargeAmount","some","getDeliveryConfiguration","reactNodes","subtotal","subTotalLabel","tax","taxLabel","orderTotal","orderTotalLabel","otherCharge","otherChargeLabel","shipping","shippingLabel","giftCardAmount","giftCardTotalValue","giftCardExtends","reduce","count","giftCard","Balance","amount","Math","min","_computeGiftCardAmount","totalAmountAfterGiftCard","loyalty","loyaltyLabel","giftcardLabel","totalDiscounts","totalDiscountsLabel","_getEyebrowMessage","priceGroupForAPICall","priceGroup","items","singleItem","ItemId","DistinctProductVariant","push","requestBody","PriceGroup","Items","getEyebrowMessageInput","GetEyebrowMessageInput","getEyebrowAction","_makeDeliveryMessage","days","deliveryByMessage","date","daysSpan","split","deliveryDate","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","BonusCouponDetailsInput","constructor","getCacheKey","getCacheObjectType","dataCacheType","Msdyn365","action","input","bonusCouponDetail","args","BonusItemProductInput","bonusItemProduct","GetCategoryPathsInput","catalogId","productIds","this","constructedCacheKey","ChannelId","apiSettings","channelId","CatalogId","ids","join","toString","createGetCategoryPathsInput","inputData","Error","getProductsCategoryPathsAction","catPaths","productsIter","ProductId","getCategoryPathsAsync","queryResultSettings","Paging","Top","Sorting","err","getCategoryPathsActionDataAction","createObservableDataAction","GetRecycleFeeCheckoutInput","recycleFee","prototype","call","ItemLines","VariantRecordId","sort","ZipCode","Weeks","RequestedDate","mFIATPInventoryStatusAsync","TriggerSpecialSynchronyFinancingInput","triggerSpecialFinancing","BonusCouponsInfoInput","bonusCoupon","getAllBonusCouponsDetails","mFIGetBonusCouponsDetailsAsync","couponsDetails","CartDataInfoInput","updateCartDataInfoAction","cartProductsInfo","delMessageDropShipLatest","delMessageParcelLatest","AttributesForSelectedVariantInput","createAttributesForSelectedVariantInput","getAttributesForCartLineItems","productAttributes","getActiveCartProductsAction","ActiveCartProductsInput","Boolean","idArray","i","PrimaryImageUrl","attributeValue","getAttributeValuesAsync","checkCategory","getSegments","CategoryPath","Segments","categoryName","CategoryName","getAvailabilitiesForCartLineItemsDataAction","MfrmNotificationInput","CartLineGroupItems","cartlines","getGroupByStorePickup","groupBy","FulfillmentStoreId","groupDelivery","cartLinesGroup","entries","deliveryType","groupByDeliveryType","cartLines","carLineViewProps","assembleCartlines","_assembleGroupCartlines","cartPromotions","showPromotionPopup","promotions","resources","promotionLinkText","promotionPopupHeading","onCloseButtonClick","onSeeAllClick","ArrayExtensions","titleId","promotionMessageWrapper","promotionMessage","promotionStringHeading","promotionSeeAllLink","role","onClick","href","promotionDialog","Modal","isOpen","toggle","ModalHeader","ModalBody","_promotion","LineId","Promotion","OfferName","ModalFooter","_getProduct","_getCartItemMaxQuantity","maxCartlineQuantity","isStockCheckEnabled","productAvailability","productMaxQuantity","lineMaxQuantity","ProductAvailableQuantity","IsProductAvailable","AvailableQuantity","_getErrorMessage","maxQuantity","currentQuantity","lineIndex","isServiceItem","finalErrorMessage","includeErrors","outOfStockText","outOfRangeOneText","outOfRangeFormatText","replace","cartlinesErrors","LineIndex","DataValidationFailure","ErrorContext","_findDropShip","productID","productSpecifications","getFilterArray","outOfStock","_findQuantityMessage","quantityMessage","_findDeliveryError","zipCodeError","_getUrlProductCategory","productCategoryPath","findCategoryPath","makeStringURL","location","origin","array","CategoryId","newCategory","_assembleNode","cartline","foundProductAvailability","foundProductDeliveryOptions","displayAddGiftCta","timer","isAuthenticated","user","nameOfWishlist","wishlists","defaultWishlistName","isQuantityLimitsFeatureEnabled","Behavior","MaximumQuantity","PRODUCTASSERVICE","ItemTypeValue","errorMessage","ObjectExtensions","Quantity","onRemoveClickHandler","event","removeItemClickHandler","payload","getPayloadObject","TelemetryEvent","telemetryContent","removeButtonText","getTelemetryAttributes","cookies","inventoryLbl","StockLevelLabel","inventoryCode","StockLevelCode","isCustomPriceSelected","Dimensions","dimension","DimensionTypeValue","DimensionValue","Value","checkProductStock","quantityValeStock","checkQuantityMessage","checkErrorDelivery","getProductCategoryUrl","handleRedirect","url","productURL","generateURLForPDP","invalidProductHelpMessageChat","pleaseContactExpertForOrder","invalidProductHelpPhoneNo","phoneNumber","sleepExpertContact","_onChatClick","preventDefault","setTimeout","eval","event_type","event_category","event_action","event_label","clearTimeout","_onChatKeyUp","keyCode","CartLineItemComponent","isOutOfStock","imageSettings","productUrl","isQuantityEditable","quantityOnChange","updateCartLinesQuantitySuccessHandler","primaryImageUrl","inventoryInformationLabel","inventoryLabelClassName","isCartStateReady","showShippingChargesForLineItems","bonusItemsProductDetails","GiftCtaButton","ctaGiftHandler","recievedBonusProductFromCartLine","recievedBonusProduct","mfrmCtaGiftText","mfrmBonusModalHeading","mfrmBonusSubHeading","mfrmBonusAppliedCodeText","mfrmAddItemToCartText","sendStateValue","sendState","setCartLine","setCartLineItems","deliveryByMessagesCore","deliveryByMessageSPDS","hideDeliveryMessage","onEditGift","pickUpInStore","PickUpInStore","storeSelectorModuleId","shipitText","shipItText","pickUpInStoreText","pickitUpText","changeStoreText","storeSelectorStateManager","orgUnitLocations","deliveryOptions","locationChangedHandler","tabIndex","outOfStockMsgText","removeFromCartText","similarAvailableProductText","QuantityMessage","itemsQuantityText","errorDelivery","homeDeliveryText","removeFromCartTextWithoutBeforeCheckout","includes","onKeyUp","sleepExpertChat","remove","Button","title","removeButtonAriaText","addToWishlist","AddToWishlistComponent","addToWishlistButtonText","removeFromWishlistButtonText","showButtonText","showStatusMessage","showRemoveButton","showButtonTooltip","onSuccess","moveToWishlistSuccessHandler","addToOrderTemplate","orderTemplates","AddToOrderTemplateComponent","addToOrderTemplateButtonText","addToOrderTemplateButtonTooltip","addToOrderTemplateDialogResources","createOrderTemplateDialogResources","itemAddedToOrderTemplateDialogResources","duplicateItemsWhenAddingToOrderTemplateDialogResources","quantity","customerInformation","_getBonusItemDetails","bonusItemsParent","localStorageBonusInfo","BonusItemsDetails","bonusitemdetail","bonusitem","BonusItems","bonus","child","isParent","itemId","BonusItemId","BonusProductId","QualifyingItemId","QualifyingProductId","totalBonusProducts","BonusProductQty","children","parent","couponsApplied","Coupons","bonusItemDetails","showAddCTAButton","parentInCart","bonusLineItem","showButton","checkAtLeastOneBonusLineAdded","childBonusLine","lineItem","foundProductDeliveryOption","productAvailabilites","InventLocationId","WarehouseId","productDeliveryOptions","deliveryOption","CartLineItems","_toggleBOPIS","isBopisSelected","openDialog","alreadySelectedLocation","OrgUnitNumber","onLocationSelected","orgUnitLocation","updateCartLinePickupLocation","cartLineId","Promise","resolve","_onLocationChangedCallback","ShippingAddress","clearCartLinePickupLocation","_getOrgUnitName","fulfillmentStoreId","foundLocation","OrgUnitName","DeliveryOptions","option","Code","callbacks","toggleBopis","defaultComponent","pickupInStoretext","orgUnitName","bopisSelected","toggleBOPIS","type","name","onChange","checked","_renderShippingMethod","pickupStore","delivery","Description","_getDeliveryOption","ContainerProps","Cart","super","callFirstTime","ctaGiftButton","isGiftCoupon","promotionPopupId","coreProdLatestDelMsg","addCartFromUrl","query","addProductToCart","qtys","pIds","pids","cartId","getCartState","Number","clearCartLinesDeliveryInformation","_validateCart","update","returnCoreProductCheck","_checkPromoCode","specifications","getProductsSpecifications","setState","categoryPath","getProductsCategoryPath","_getStateFromZipCode","resetPromoStorageIfCartExpired","lastCartExpiryTime","currDate","lastCartExpiryDate","removeItem","coreProductAvailable","productAttributesData","isCheckItemCore","toLocaleLowerCase","addProductToDropShipDateGroup","productVariantRecordId","daySpan","dateGroupedData","productData","productsType","dateStr","productVariantRecordIds","newDateEntry","productItemIds","newDateGroupedProducts","addProductToSmallParcelDateGroup","updateDateGroupedProductsData","productsData","typeOfProduct","state","variantID","checkAndUpdateBasketAndCartCookie","basketCookie","getSetBasketCookie","baskCartInfo","cartDataInfo","refreshCartCookie","requiresUpdate","c","cartItemFound","bci","bCookie","addLastAddedItemsIfCartEmpty","basketCLs","lastAddedCartlines","bcl","EntryMethodTypeValue","zipCodeForRefresh","prepareProductDataForTealiumCall","deletedItemId","cartLinesData","originUrl","requestUrl","productIdArray","productImageUrl","productNameArray","productCategoryArray","productBrandArray","productVariantIdArray","productPriceArray","productQuantityArray","productSize","prodSpec","isCoreItem","funnelType","urlProduct","attr","p","brandBackofficeAttributePdp","productDiscount","DiscountLines","sales","DiscountCode","EffectiveAmount","updatedPrice","NetAmountWithoutTax","Barcode","getVariant","getProduct","allProductsId","indexOfDeletedItem","indexOf","splice","tealiumCallOnViewCart","event_noninteraction","enhanced_action","checkout_step","product_id","product_name","product_category","product_brand","product_variant","product_price","product_quantity","product_size","product_url","product_image_url","core_item_flag","funnel_type","tealiumCallOnRemoveForGA","pageName","pageCount","ga_title","ga_location","onOrderSummaryZipcodeClick","isInput","newZipCode","isOrderSummaryZipCodeClicked","handleTealiumClick","routes","backToShopping","destinationUrl","backToShoppingUrl","getUrlSync","backToShoppingUrlNavigate","getPath","pathname","handleClickCheckout","showError","sepcProducts","removeOutStockCartLines","guestCheckoutUrl","itemsIDs","itemCart","itemProduct","removeCartLines","cartRender","_getUpdateLinbeDeliveryCall","errorZipCode","productSpecificationsCookieData","producDetailsCookieData","checkAvailable","checkAvailableData","cartLinesUpdateData","productAttributesList","showDeliveryStep","productSpecItem","shippingData","getFinalPrice","TotalSalesAmount","finalPrice","isTablet","toLocaleString","style","currency","updateCartDataSharing","cartProductsData","cLines","cl","_updateCartLineWarehouseDetails","allProductLocations","calculateTaxOnCart","prodMsg","itemID","smallParcelLocationDetails","currentCartLines","defaultWarehouse","dropShipDefaultWarehouse","updatedCartLines","checkProduct","typeProduct","cartLineLocationDetails","cartLineDeliveryData","updatedCartState","updateViewPort","viewport","_getViewPort","isMobile","isDesktop","promotionLinkClick","showPromotionDialog","tealiumCartDetails","detailsProduct","localStorageProductDetails","TotalItems","subTotal","productQuantity","productRecordIdArray","productIDsArray","cartProductPriceArray","variantRecord","productCatgoryArray","productDiscountArray","details","brandAndProductName","toFixed","variantType","cartUrl","productDetailsData","cartProductUrl","setTealiumCartVariables","generateProductUpdateStrings","siteCookie","urlQuantity","nameWithBrand","generateProductData","prods","pr","dimensionValueCustom","renderDeliveryMessage","collectiveProductDetails","parcelDropShipProducts","allDropParceldMsgs","newSPDS_Att","smallParcelLatestDay","dropShipLatestDay","lastSmallParcelDay","lastDropShipDay","itemsMessage","deliveryDays","leadTimeVal","brandLeadTime","set","path","_deliveryMessage","newProductDetails","productDetails","getDateDetails","currentYear","year","datedValues","add","fullDate","deliveryTime","formatDeliveryDate","DeliveryDate","RequestedDeliveryDate","_giftCart","cartlineTo","_showCtaGiftProducts","promotionCloseButtonclick","_hidePromotionDialog","_renderUpdateZipCode","findStoreRedirectLink","findstoreLink","addSpacesZipCode","Node","tag","cartDeliveryText","showZipCodeDelivery","onSubmit","_updateZipCode","pattern","maxLength","autoFocus","onFocus","currentTarget","select","test","target","inputMode","updateZipCodeButtonText","cartInvalidZipCode","changeZipCodeButtonText","RichTextComponent","text","showFindStore","findStoreText","disabled","PromoCodeAppliedOnCartInput","isInProcess","disableCheckoutButton","oomZipCode","getAddressFromZipCodeAsync","zipcodes","stateObj","expires","getMessageValue","StateId","blockedStates","hasStore","checkCoreProductErrorZipCode","showDeliveryStepper","checkSmallParcelOutOfStock","_updateATPMessagesForCoreProducts","_getUpdatedTaxValue","CityName","CountryRegionId","setErrorZipCode","setShowError","cityName","threeLetterISOId","deliveryMessageManagementValues","TaxGroup","RecycleFeeAttribute","cartData","lineDeliverySpecificationValue","deliveryServices","newCartLineData","val","serviceProductRecId","productspecificationsDetails","productTypesSpec","lineItems","prductItems","checkType","shippingInformation","MOD","DeliverySpecification","DeliveryModeId","DeliveryPreferenceTypeValue","DeliveryAddress","AddressTypeValue","City","State","Street","ThreeLetterISORegionName","deliverySpecification","enableCheckoutSalesTaxSolution","fee","ExtensionProperties","Key","DecimalValue","cultureFormatter","formatCurrency","yetToBeCalculatedText","item2","Price","_getImageSettings","viewports","q","h","lazyload","getProductCategory","getProductBrand","newProductSpecificationData","brandNameGet","_onEditGift","selectedBonusItems","_tealiumCallonRemove","cartlineToRemove","newQuantity","ProductDetail","getCategory","getBrandName","exactQuantity","productPrice","itemIdArray","productBrandNameArray","_selectedBonasItems","newBonasState","itemBonas","newChildItems","childData","getCartlineProductName","_removeItemFromCartHandler","productName","psp","pspData","saveProdForCatch","saveProdForLocalStorageInCatch","productSpec","showRemoveNotification","showProductTitle","collection","_onlyRemoveItemFromCartHandler","newProductSpecificationsCookieData","_tealiumCallonAddQuantity","_moveToWishlistSuccessHandler","_updateCartLineUpdateQuantity","cartlineToUpdate","newSepecifications","_updateCartlineQuantityWithAvailableQuantity","fixedQuantity","_updateDeliveryMessageForUpdatedQuantityOfCoreProduct","_checkCartLineId","additionalProperties","orderQuantityLimitsFeatureIsEnabled","updateCartLineQuantity","newSpecifications","hasSameDiscountCodes","qualifyingItem","bonusItem","qualifyingDiscountLines","bonusItemDiscountLines","qdl","bdl","_isBonusCoupons","appliedPromoCoupons","checkBonusCoupons","getLocalstorageBonusCoupons","bonusCouponsArray","coupons","BonusCoupons","BonusCoupon","isOneOfChildBonusCoupons","_updateCartlineQuantity","avialbleQuantity","availableQuantity","checkUniqueSmallParcelProduct","parentProduct","cartLinesInCart","bonusItemsCartLine","bonusItemsArray","bonusItemDetail","bonusItems","lines","bonusLine","parenProduct","_setStateCartLine","bonusItemsFromModal","elementsIndex","findIndex","element","parentId","newArray","_addCartlineFromModal","productQuantityCount","getParentId","getStateBonasItems","newPreviousData","bonasPreviousData","removeBonusArray","itemFilter","every","bonasItem","procductData","deletedCartLines","bonusCartlines","updatedParentQuantity","checkItemAlredyInCart","AdditionToCart","productToAdd","reshuffleItems","_fulfillmentStoreIdUpdated","_reconstructData","testVarStruct","obj","deets","dt","coupon","Coupon","itms","it","qItemId","qpId","itm","_getBonusItemsBrandName","bonasItems","bonusArray","productWithBrand","promotionData","showProductModal","addCtaGift","ctaGiftButtonBoolean","buttonDisabled","isBonusItemProductUpdated","getTelemetryObject","telemetryPageName","friendlyName","payLoad","bind","defaultZipCode","directZipCode","_getOrderQuantityLimitsFeatureFlag","showAvailablePromotions","getPromotionData","reaction","getBonasItemProduct","userDefinedPromoCode","userDefinedPromos","addedProds","specificationsData","zip","resizeThrottledEventHandler","addThrottledEvent","_addGiftCta","_getAllCoupons","isCheckCore","isCartEmpty","CartArrayRemove","utag_data","productDetailsUpdated","promoCodeApplicationState","componentWillUnmount","removeEventListener","render","_getCartLines","totalPrice","zipCartLines","outOfStockCartLines","sortCartLine","findProduct","unshift","newCartLine","defualtCartLines","getLocalStorageData","bonusItemArrayData","BonusItemsDetail","cartlineData","bonusItemfinal","newCartLinesItemIds","cartLineSingleData","RetailMulitplePickupFeatureState","featureState","IsEnabled","_getCartLinesGroup","contentAction","etext","TelemetryConstant","checkoutBySignInAttributes","checkoutByGuestAttributes","backtoShoppingAttributes","hasErrors","viewProps","classnames","cartTitle","CartlinesWrapper","OrderSummaryWrapper","OrderSummaryItems","promoCode","_getPromoCode","promotionOptions","_getPromotions","_productDetails","disableCheckoutButtonState","mulitplePickUpEnabled","removePromoAriaLabelFormat","orderSummaryHeading","orderSummaryTitle","orderSummaryLineitems","_getOrderSummaryLineItems","checkoutAsSignInUserButton","checkoutButtonTitle","checkoutAsGuestButton","guestCheckoutButtonTitle","backToShoppingButton","backToShoppingButtonTitle","createTemplateFromCartButton","_displayAddCartToTemplate","SaveCartToOrderTemplateComponent","_generateAddToOrderTemplateDialogResources","_generateOrderTemplateNameDialogResources","linesAddedToOrderTemplateDialogResources","_generateLinesAddedToOrderTemplateDialogResources","createOrderTemplateFromCartButton","createOrderTemplateFromCartButtonTooltip","storeSelector","slots","waitingComponent","Waiting","cartLoadingStatus","cartLoadingErrorMessage","cartDataResult","isEmpty","OrderSummaryErrors","_getOrderSummaryErrors","isTabletView","renderView","defaultDeliveryMessage","allCoreProdMsgs","splittedData","_coreProductATPCall","thisMsgSplitted","thisMsgDate","latestMsgSplitted","brandList","smallParcelAttributeKey","outOfStockProductKey","leadTime","getProducts","productRecordId","outOfStockSmallParcel","brand","brandLeadtime","getShippingInfo","BooleanValue","_getCartLinesData","ProductCategoryName","dimStr","dimStrArr","dim","fallbackImageUrl","getFallbackImageUrl","ProducName","MasterProductId","recordID","getQuantity","currentDate","tempProducts","smallParcelLocations","InventoryType","StoreId","weeksPDPforATPCall","NoOfPriorityDC","_getInventoryQuantity","prod","ATPInventoryStatusData","Location","substring","numberQuantity","smallParcelDetails","invData","cLin","pId","invQuantity","getProductIdArray","productsCategories","getSpecifications","revenueCategoryConfig","revenueCategory","newProductSpecification","stopProccess","itemName","checkExist","revenueItemName","mattresses","adjustableBases","boxSprings","pillows","babyAndKids","otherRevenueDetail","RetailB2BEcommerceFeatureState","IsB2b","promotionCloseButtonAriaLabel","allErrors","fullError","line","Wrapper","Alert","color","assertive","outOfStockErrorMessageHeader","header","errors","channel","DeliveryFee","itemsWithCountLabel","estimatedShippingLabel","otherCharges","mattressRecyclingFeeLabel","deliveryFeeLabel","estimatedTaxLabel","priceFree","PromoCodeComponent","promoCodeHeadingText","promoPlaceholderText","promoCodeApplyButtonText","appliedPromoCodeHeadingText","collapseTimeOut","removePromoText","invalidPromoCodeErrorText","failedToAddPromoCodeErrorText","failedToRemovePromoCodeErrorText","duplicatePromoCodeErrorText","duplicatePromotionErrorText","mfrmExpiredPromoCodeErrorText","mfrmDoesNotApplyToCartPromoCodeErrorText","mfrmCannotBeCombinedPromoCodeErrorText","mfrmUsageLimitPromoCodeErrorText","appliedPromoText","notAppliedPromoText","bonusItemsStateShare","mfiBonusItems","addToOrderTemplateHeader","noOrderTemplatesMessage","noOrderTemplatesDescription","createAnOrderTemplateButtonText","createNewOrderTemplateButtonText","cancelOrderTemplateCreationButtonText","selectTemplatesText","addToTemplateButtonText","lineItemsText","_generateItemAddedToOrderTemplateDialogResources","viewOrderTemplateButtonText","continueShoppingButtonText","itemAddedToOrderTemplateHeaderItemOneText","itemAddedToOrderTemplateHeaderItemFormatText","itemAddedToOrderTemplateHeaderMessageText","originalPriceText","currentPriceText","linesAddedToOrderTemplateHeaderItemsOneText","linesAddedToOrderTemplateHeaderItemsFormatText","linesAddedToOrderTemplateHeaderLinesOneText","linesAddedToOrderTemplateHeaderLinesFormatText","linesAddedToOrderTemplateHeaderMessageText","_generateDuplicateItemsWhenAddingToOrderTemplateDialogResources","duplicatedProductsHeader","duplicatedProductsDescription","updateQuantityButtonText","cancelDuplicateItemsButtonText","orderTemplateHeaderLabel","createOrderTemplateHeader","orderTemplateTitleLabel","orderTemplateTitle","orderTemplateNameAriaLabel","orderTemplateDescription","createOrderTemplateDescription","defaultOrderTemplateName","orderTemplateButtonLabel","createOrderTemplateButtonText","orderTemplateCancelButtonLabel","cancelNewOrderTemplateCreationButtonText","modules","storeSelectorId","enableStockCheck","maxQuantityForCartLineItem","sizeString","productDimensionTypeSize","colorString","productDimensionTypeColor","configString","productDimensionTypeConfiguration","styleString","productDimensionTypeStyle","amountString","productDimensionTypeAmount","quantityDisplayString","quantityDisplayText","inputQuantityAriaLabel","productPageLinkAriaLabel","decrementButtonAriaLabel","incrementButtonAriaLabel","discountStringText","shippingChargesText","shippingCharges","productAriaText","variantAriaText","promoAriaText","priceAriaText","discountPercentageAriaText","editGiftCtaText","dialogAriaText","removeCartButtonText","shipInsteadDisplayText","mfrmGiftCtaText","pickItUpDisplayText","changeStoreDisplayText","outOfStockErrorMessage","errorMessageOutOfRangeOneLeft","errorMessageOutOfRangeFormat","showOutOfStockErrors","addToOrderTemplateMessage","addItemToOrderTemplateError","coreDelMsgUpdated","updatedCoreDelMsgItems","coreProdMsg","delMsgObjSplitted","productsSpecChange","quantityAvailable","retry","AsyncResult","cartResult","cartVersion","Version","validationResult","validateForCheckoutAsync","ValidationFailuresByCartLines","refreshError","validateError","defaultOrderQuantityLimitsFeatureConfig","platform","enableDefaultOrderQuantityLimits","featureStatuses","customerInfo","bonusCouponsDetails","userDefinePromo","bonusCoupons","ChildCoupons","childCoupons","_getBonusItems","bonusItemsParams","bonusValue","requestBodyMFIBonus","CartId","_getMFIGetBonusItems","MFIbonusitemsInput","bonusItemsResponse","bonusItemResult","bonusLocalStorageData","bonusItemProducts","bonusItemLength","bonusProductActualStatus","bonusItemsArrayProduct","finalItem","bonusProductCount","manualBoniusItems","observer","getTotalPrice","orderSummaryLines","parseFloat","getSavings","getTax","_parseRecyclingFee","savings","abs","_getRecyclingFee","yetToBeCalculated","recyclingFeeCart","formatNumber","num","getCartItemsQuantity","totalItems","_renderOrderSummarylines","notificationItems","feeFromCart","finalRecyclingFee","checkCartLines","checkExists","itemsReduce","totalCartlineItems","zipCodeRef","zipCodeText","current","innerHTML","_renderPromoCode","itemsString","savingsString","taxString","ref","subTotalString","notifications","productCollection","buyNowPayLaterOptions","continueShoppingButtonTitle","checkoutDisableButton","appendedClassName","stepClassName","steps","stepperLabelCart","ariaLabel","icon","stepperLabelCustInfo","stepperLabelDelivery","stepperLabelPayment","newTealiumData","scriptHtml","renderModuleAttributes","dangerouslySetInnerHTML","__html","cartHeadingSavingLabel","Stepper","activeStep","selectIndex","removedFromCartText","mfrmCartTitleProduct","mfrmCartTitleQuantity","mfrmCartTitlePrice","cartEmptyText","productCollectionSlot","_renderCartlines","emptyCartText","errorData","getPromotionOptionsForCartLineItems","PromotionOptionsForCartLineItems","exception","binding","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","RegistrationId","require","$type","da","runOn","iNM","ns","n","pdp","__bindings__","viewDictionary","cn","BaseStoreSelectorStateManager","listMapViewState","displayList","displayMap","preferredStoreLocalStorageKey","isMapModuleLoaded","_readFromToCookie","storeInfo","preferredStore","_context","storeId","selectedStoreLocationId","storeName","writeToCookie","StoreName","Latitude","Longitude","_writeToCookie","latitude","longitude","lastInlineShownStoreInfo","_removeCookie","cookieValue","__decorate","computed","observable","MapStoreSelectorStateManager","SERVICE_ENDPOINT","MAP_API_ENDPOINT","searchTerm","BingMapsApiKey","BingMapsEnabled","searchContent","jsonp","crypto","getRandomValues","Uint32Array","ChannelCountryRegionISOCode","encodeURI","geolocationApiUrl","script","document","createElement","setAttribute","resourceSets","point","coordinates","body","appendChild","StringExtensions","getElementById","lang","market","reject","defer","src","mapAPIReady","isMapApiLoaded","addEventListener","createStoreSelectorStateInput","GenericInput","getGenericActionDataAction","getGenericAction","module","exports","ReactDOM"],"sourceRoot":""}