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+D,IAAI,QAC9FlF,IAAAA,cAACsE,EAAAA,KAAI,CAACC,UAAU,wCAAwCW,IAAI,QACvDtI,GACG4B,GAAcyB,EACdzB,EACAwB,IAAAA,cAAAA,IAAAA,SAAA,KACKmB,GACG,YAEAnB,IAAAA,cAAAA,IAAAA,SAAA,KACqB,SAAhB7C,EAAyB,GAAKwC,EAAY0F,UAAUE,WAAU,IAAGrM,IAEvE,IAAG,MAIV,yBAGR8G,IAAAA,cAACsE,EAAAA,KAAI,CACDC,UAAU,4CACVW,IAAI,SACJC,KAAK,SACLK,SAAS,IAAG,eACC,QACbJ,QAAUP,IACNrE,GAAWyE,IAAcA,IACzBvI,EAAc8B,GACdqG,EAAMY,iBAEF,SAAUC,SACVb,EAAMY,iBAGNE,KAAKC,KAAK,CACNf,MAAO,kBACPgB,eAAgB,kBAChBC,aAAc,wBACdC,gBAAiB,iBACjBC,YAAa,sBACbC,qBAAsB,aAKjCrJ,GAAU4B,GAAcyB,EAAiBzB,GAA0BmB,EAAY0F,UAAUa,eAIpF,KAAjB/E,GACGnB,IAAAA,cAAA,OAAKuE,UAAU,yCAAyC4B,wBAAyB,CAAEC,OAAQjF,MAE3FnB,IAAAA,cAAAA,IAAAA,SAAA","sources":["webpack://mattressfirm/./src/Utilities/get-block-message.tsx?29cd","webpack://mattressfirm/./src/Utilities/get-product-brand.tsx?2b65","webpack://mattressfirm/./src/Utilities/one-year-from-now.ts?0f43","webpack://mattressfirm/./src/data-actions/get-address-from-zipcode.action.ts?d9c9","webpack://mattressfirm/./src/data-actions/get-attributes-for-selected-variant.ts?4859","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-devliery-by-message.tsx?ca39"],"sourcesContent":["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 { IGridSettings, IImageSettings, Image } from '@msdyn365-commerce/core';\r\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy';\r\nimport React from 'react';\r\nimport { IBrandListData } from '../modules/mfrm-buybox/mfrm-buybox.view';\r\nimport { IProductBonusWithBrandName } from '../modules/mfrm-cart/mfrm-cart';\r\nimport {hasArray} from './emtpyChecker';\r\nimport MsDyn365 from '@msdyn365-commerce/core';\r\n\r\nconst fallBackBrandAttribute = 'VENDOR BRAND';\r\n\r\n// tslint:disable-next-line: cyclomatic-complexity\r\nexport const parseBrandData = (\r\n attributes: AttributeValue[] | undefined,\r\n backendAttribute: string,\r\n gridSettings: IGridSettings,\r\n renderBrandNameOnly: Boolean = false,\r\n brandList: IBrandListData[],\r\n imageSettings?: IImageSettings\r\n): JSX.Element | undefined => {\r\n const attribute = backendAttribute || fallBackBrandAttribute;\r\n const productBrandName =\r\n attributes &&\r\n attributes.find(currAttribute => currAttribute.Name && currAttribute.Name.toLowerCase().trim() === attribute.toLowerCase().trim())\r\n ?.TextValue;\r\n\r\n if (renderBrandNameOnly) {\r\n return {productBrandName};\r\n }\r\n\r\n const selectedBrand =\r\n (brandList &&\r\n productBrandName &&\r\n brandList.find(\r\n (brand: IBrandListData) => brand && brand.brandName.toLowerCase().trim() === productBrandName.toLowerCase().trim()\r\n )) ||\r\n undefined;\r\n\r\n if (!selectedBrand) {\r\n return undefined;\r\n }\r\n\r\n const copySelectedBrand: IBrandListData = selectedBrand;\r\n // set alt text to brand name if no alt text is configured\r\n if (copySelectedBrand && _useDefaultAltText(copySelectedBrand) && copySelectedBrand.brandLogo) {\r\n copySelectedBrand.brandLogo.altText = productBrandName;\r\n }\r\n\r\n // set height to configured value or the default\r\n const height = copySelectedBrand && copySelectedBrand.logoHeight !== undefined ? copySelectedBrand.logoHeight : 22;\r\n const brandImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: `w=0&h=25&m=6`, w: 0, h: 25 },\r\n lg: { q: `w=0&h=25&m=6`, w: 0, h: 25 },\r\n xl: { q: `w=0&h=25&m=6`, w: 0, h: 25 }\r\n },\r\n lazyload: false\r\n };\r\n\r\n const brandLogo = copySelectedBrand && copySelectedBrand.brandLogo && (\r\n \r\n );\r\n // place logo inside a link if configured to\r\n const brandLink =\r\n copySelectedBrand &&\r\n copySelectedBrand.brandLink &&\r\n copySelectedBrand.brandLink.linkUrl &&\r\n copySelectedBrand.brandLink.linkUrl.destinationUrl &&\r\n copySelectedBrand.brandLink;\r\n const linkElement = brandLink && (\r\n \r\n {brandLogo}\r\n \r\n );\r\n\r\n return linkElement || brandLogo;\r\n};\r\n// get only brandName\r\nexport const parseBrandName = (attributes: AttributeValue[] | undefined, backendAttribute: string, recordId?: number): string | undefined => {\r\n const attribute = backendAttribute || fallBackBrandAttribute;\r\n let productBrandName = hasArray(attributes)?.find((currAttribute: AttributeValue) => currAttribute?.Name?.toLowerCase().trim() === attribute?.toLowerCase().trim())?.TextValue;\r\n if (!productBrandName && MsDyn365.isBrowser) {\r\n const getLocalStorage = localStorage.getItem('bonusItmesWithBrand');\r\n let bonusItemArray: IProductBonusWithBrandName[] = [];\r\n if (getLocalStorage) {\r\n bonusItemArray = JSON.parse(getLocalStorage);\r\n }\r\n const checkBrandName = bonusItemArray.find(item => item.productId === recordId)?.brandName;\r\n if(checkBrandName) {\r\n productBrandName = checkBrandName;\r\n } else {\r\n return undefined;\r\n }\r\n }\r\n return productBrandName;\r\n};\r\n\r\nexport const parseBrandNameUnbxd = (attributes: any | undefined, backendAttribute: string, recordId?: number): string | undefined => {\r\n const attribute = backendAttribute || fallBackBrandAttribute;\r\n // let productBrandName = hasArray(attributes)?.find((currAttribute: AttributeValue) => currAttribute?.Name?.toLowerCase().trim() === attribute?.toLowerCase().trim())?.TextValue;\r\n let productBrandName = attributes && attributes[attribute];\r\n if (!productBrandName && MsDyn365.isBrowser) {\r\n const getLocalStorage = localStorage.getItem('bonusItmesWithBrand');\r\n let bonusItemArray: IProductBonusWithBrandName[] = [];\r\n if (getLocalStorage) {\r\n bonusItemArray = JSON.parse(getLocalStorage);\r\n }\r\n const checkBrandName = bonusItemArray.find(item => item.productId === recordId)?.brandName;\r\n if(checkBrandName) {\r\n productBrandName = checkBrandName;\r\n } else {\r\n return undefined;\r\n }\r\n }\r\n return productBrandName;\r\n};\r\n\r\n// get only brandName\r\nexport const getBrandNameCheck = (attributes: AttributeValue[] | undefined, backendAttribute: string): string | undefined => {\r\n const productBrandName =\r\n attributes &&\r\n attributes.find(\r\n currAttribute => currAttribute.Name && currAttribute.Name.toLowerCase().trim() === backendAttribute.toLowerCase().trim()\r\n )?.TextValue;\r\n if (!productBrandName) {\r\n return undefined;\r\n }\r\n return productBrandName;\r\n};\r\n\r\n// get the appropriate image alt text\r\nconst _useDefaultAltText = (selectedBrand: IBrandListData): boolean => {\r\n const configuredAltText = selectedBrand.brandLogo?.altText;\r\n return !(configuredAltText && configuredAltText.trim() && configuredAltText !== 'No Data Available');\r\n};\r\n","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 * as Msdyn365 from '@msdyn365-commerce/core';\r\n// tslint:disable-next-line: no-duplicate-imports\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { CacheType, ZipCodeInfo } from '@msdyn365-commerce/retail-proxy';\r\nimport { getAddressFromZipCodeAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\r\n\r\n/**\r\n * GetEyebrowMessage Input Action\r\n */\r\n\r\nexport class GetAddressByZipcodeInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n public country: string;\r\n public zipcode: string;\r\n\r\n constructor(country: string, zipcode: string) {\r\n this.country = country;\r\n this.zipcode = zipcode;\r\n }\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `Get-Address-By-Zipcode-${this.zipcode}`;\r\n public getCacheObjectType = () => 'GetAddressByZipCode';\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function getAddressByZipcodeAction(input: GetAddressByZipcodeInput, ctx: IActionContext): Promise {\r\n const { zipcode, country } = input;\r\n const isValidZipcode = typeof zipcode === 'string' && zipcode?.trim()?.length === 5 && zipcode !== \"00000\";\r\n return isValidZipcode ? getAddressFromZipCodeAsync({ callerContext: ctx, queryResultSettings: { Paging: { Top: 1 } } }, country, zipcode) : null;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getAddressByZipcodeAction,\r\n // Give your data action a unique id\r\n id: 'GetAddressByZipcode'\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","import {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport { AttributeValue, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport { getSelectedProductIdFromActionInput, getSelectedVariant, SelectedVariantInput } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getAttributeValuesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n\r\n/**\r\n * Chains getting the SelectedVariant with GetActivePrice\r\n */\r\nexport class AttributesForSelectedVariantInput implements IActionInput {\r\n public productId: number;\r\n public channelId: number;\r\n public catalogId: number;\r\n public selectedProduct: SimpleProduct | undefined;\r\n\r\n constructor(productId: number, channelId: number, selectedProduct?: SimpleProduct, catalogId?: number) {\r\n this.productId = productId;\r\n this.channelId = channelId;\r\n this.selectedProduct = selectedProduct;\r\n this.catalogId = catalogId || 0;\r\n }\r\n\r\n public getCacheKey = () => `AttributesForSelectedVariant`;\r\n public getCacheObjectType = () => 'ProductAttributeValue';\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\nexport const createAttributesForSelectedVariantInput = (\r\n inputData: ICreateActionContext>\r\n): AttributesForSelectedVariantInput => {\r\n const productId = getSelectedProductIdFromActionInput(inputData);\r\n if (productId) {\r\n return new AttributesForSelectedVariantInput(+productId, +inputData.requestContext.apiSettings.channelId);\r\n } else {\r\n throw new Error('Unable to create PriceForSelectedVariantInput, no productId found on module config or query');\r\n }\r\n};\r\n\r\n/**\r\n * Calls the Retail API a get a list of dimension values for a given product.\r\n */\r\nexport async function getAttributesForSelectedVariantAction(\r\n input: AttributesForSelectedVariantInput,\r\n ctx: IActionContext\r\n): Promise {\r\n // @ts-ignore: Promise vs. ObservablePromise typing conflict\r\n return Promise.resolve()\r\n .then(() => {\r\n const activeProduct: SimpleProduct | undefined = input.selectedProduct;\r\n\r\n if (!activeProduct) {\r\n const selectedVariantInput = new SelectedVariantInput(input.productId, input.channelId);\r\n\r\n return getSelectedVariant(selectedVariantInput, ctx);\r\n }\r\n\r\n return activeProduct;\r\n })\r\n .then((productResult: SimpleProduct | null) => {\r\n const activeProduct: SimpleProduct | undefined = productResult;\r\n\r\n if (activeProduct) {\r\n return getAttributeValuesAsync(\r\n { callerContext: ctx, queryResultSettings: {} },\r\n activeProduct.RecordId,\r\n input.channelId,\r\n input.catalogId\r\n );\r\n }\r\n\r\n return null;\r\n })\r\n .then((attributeValues: AttributeValue[] | null) => {\r\n const resultArray = attributeValues;\r\n if (resultArray) {\r\n return resultArray;\r\n }\r\n\r\n return [];\r\n })\r\n .catch((error: Error) => {\r\n ctx.trace(error.message);\r\n throw new Error(`[getPriceForSelectedVariantAction]Error executing action ${error.message}`);\r\n });\r\n}\r\n\r\nexport default createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/product-info/get-attributes-for-selected-variant',\r\n action: >getAttributesForSelectedVariantAction,\r\n input: createAttributesForSelectedVariantInput\r\n});\r\n","import React from 'react';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\n\r\nimport { IBuyboxViewPropsExtended } from '../types';\r\nimport { IBrandListData, IMfrmAtpMessage } from '../mfrm-buybox.view';\r\nimport Cookies from 'universal-cookie';\r\nimport getAddressByZipcodeAction, { GetAddressByZipcodeInput } from '../../../data-actions/get-address-from-zipcode.action';\r\nimport { getBlockZipCodeMessage } from '../../../Utilities/get-block-message';\r\nimport { oneYearFromNow } from '../../../Utilities/one-year-from-now';\r\nimport { ProductCompareBuyboxStateSharing } from '../../../actions/product-compare-buybox-state-sharing';\r\nimport { IMFIATPInventoryEntity } from '../../../actions/CoreProductDataServiceEntities.g';\r\nimport dayjs from 'dayjs';\r\nimport {\r\n _coreProductATPCall,\r\n _coreProductATPCallForInventoryStatus,\r\n _coreProductATPCallForInventoryStatusForAllVariants,\r\n _smallParcelProductATPCallForInventoryStatus\r\n} from '../../../Utilities/mfrm-buybox-utils';\r\n\r\nconst _setTime = (time: string | undefined) => {\r\n if (time) {\r\n const temp = time.split(' ');\r\n if (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\nconst _getSoonestDeliveryDate = (coreProductATPData: IMFIATPInventoryEntity[]): string => {\r\n let deliveryByMessage = '';\r\n if (!coreProductATPData.length) {\r\n return deliveryByMessage;\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 deliveryByMessage =\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 break;\r\n } else {\r\n deliveryByMessage = `Delivery by ${dayjs(item.SlotDate).format('MMM D')} `;\r\n break;\r\n }\r\n }\r\n }\r\n return deliveryByMessage;\r\n};\r\n\r\n// tslint:disable-next-line: max-line-length\r\nconst smallParcelATPInventoryStatusCall = async (\r\n props: IBuyboxViewPropsExtended,\r\n outOfStockSmallParcelState: boolean,\r\n SetoutOfStockSmallParcelState: React.Dispatch,\r\n recordId?: number,\r\n itemId?: string | undefined,\r\n zipCode?: any,\r\n prevZipCode?: any\r\n) => {\r\n const inventoryStatusData = props.state.batchedAtpInventoryStatusData?.ATPInventoryStatusData\r\n ? props.state.batchedAtpInventoryStatusData?.ATPInventoryStatusData\r\n : null;\r\n const selectedObj = inventoryStatusData\r\n ? inventoryStatusData?.find(item => item.VariantRecordId?.toString() === props.state.currentProduct?.RecordId?.toString())\r\n : null;\r\n if (prevZipCode && prevZipCode !== zipCode && zipCode.length === 5) {\r\n if (recordId && props.data.product.result?.MasterProductId) {\r\n await _smallParcelProductATPCallForInventoryStatus(props, recordId, itemId, SetoutOfStockSmallParcelState, true)\r\n .then()\r\n .catch();\r\n }\r\n } else {\r\n if (selectedObj) {\r\n const item = selectedObj;\r\n if (item.Available === 'YES' && item.Quantity !== undefined && parseInt(item.Quantity, 10) > 0) {\r\n if (outOfStockSmallParcelState !== false) {\r\n SetoutOfStockSmallParcelState(false);\r\n }\r\n } else {\r\n if (outOfStockSmallParcelState !== true) {\r\n if (\r\n !inventoryStatusData?.some(\r\n variant => variant.Available && variant.VariantRecordId !== props.state.currentProduct?.RecordId?.toString()\r\n )\r\n ) {\r\n SetoutOfStockSmallParcelState(true);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n};\r\n\r\nconst _getProductAttribute = (props: IBuyboxViewPropsExtended) => {\r\n const {\r\n data: { productSpecificationData },\r\n getProductType\r\n } = props;\r\n // shippingInformation product attribute value\r\n const shippingInformationSmall = productSpecificationData.result\r\n ?.find(attr => attr.Name?.trim() === props.context.app.config.smallParcelAttributeKey)\r\n ?.TextValue?.toLowerCase();\r\n\r\n return getProductType(shippingInformationSmall);\r\n};\r\n\r\n// tslint:enable\r\nconst _validateZipCode = (\r\n props: IBuyboxViewPropsExtended,\r\n zipcode: string,\r\n setErrorZipCode: React.Dispatch,\r\n setItemOutOfMarket: React.Dispatch,\r\n setNewZipCode: React.Dispatch,\r\n setIsValidZipCode: React.Dispatch,\r\n initial: boolean,\r\n setIsOOMZipCode: React.Dispatch,\r\n isItemOom: boolean\r\n) => {\r\n setErrorZipCode('');\r\n const getAddressByZipcodeInput = new GetAddressByZipcodeInput('USA', zipcode);\r\n getAddressByZipcodeAction(getAddressByZipcodeInput, props.context.actionContext)\r\n // getAddressFromZipCodeAsync({ callerContext: props.context.actionContext }, 'USA', zipcode)\r\n .then(addressByZipcode => {\r\n if (addressByZipcode?.length) {\r\n setIsValidZipCode(true);\r\n const productType = _getProductAttribute(props);\r\n if (productType === 'Small Parcel' || productType === 'Drop Ship' || productType === 'Core') {\r\n const stateObj = addressByZipcode[0];\r\n const blockedStates = props.context.app.config.blockedStates;\r\n let oomZipCode = false;\r\n if (blockedStates !== undefined && blockedStates !== null) {\r\n for (let bStateIter = 0; bStateIter < blockedStates.length; bStateIter++) {\r\n if (blockedStates[bStateIter].stateName === stateObj.StateId) {\r\n oomZipCode = true;\r\n }\r\n }\r\n }\r\n if (!oomZipCode) {\r\n props.context.actionContext.update(new ProductCompareBuyboxStateSharing(zipcode), { zipCode: zipcode });\r\n }\r\n setIsOOMZipCode(oomZipCode);\r\n const getMessageValue = getBlockZipCodeMessage(stateObj.StateId || '', props.context.app.config.blockedStates);\r\n if (getMessageValue?.length > 0) {\r\n setErrorZipCode(getMessageValue[0].zipcodeMessage?.replace('{zipcode}', zipcode));\r\n setItemOutOfMarket(true);\r\n } else {\r\n !isItemOom && setItemOutOfMarket(false);\r\n }\r\n } else {\r\n setItemOutOfMarket(false);\r\n }\r\n } else {\r\n const cookies = new Cookies();\r\n setItemOutOfMarket(false);\r\n setIsValidZipCode(false);\r\n if (!initial) {\r\n setErrorZipCode('Please enter a valid zip code. ');\r\n cookies.set(`zip_code`, '', { path: '/', expires: oneYearFromNow() });\r\n } else {\r\n cookies.set(`zip_code`, '', { path: '/', expires: oneYearFromNow() });\r\n }\r\n }\r\n })\r\n .catch(e => {\r\n console.log(e, 'Error');\r\n });\r\n};\r\n\r\n// tslint:disable-next-line: max-line-length no-any\r\nconst _updateZipCode = (\r\n newZipCode: string,\r\n setNewZipCode: React.Dispatch,\r\n props: IBuyboxViewPropsExtended,\r\n setErrorZipCode: React.Dispatch,\r\n setItemOutOfMarket: React.Dispatch,\r\n setIsZipCodeChnaged: React.Dispatch,\r\n setIsValidZipCode: React.Dispatch,\r\n setCoreProductATPData: React.Dispatch,\r\n setATPCallMessage: React.Dispatch,\r\n setIsOOMZipCode: React.Dispatch,\r\n setIsItemOom: React.Dispatch,\r\n isItemOom: boolean\r\n) => {\r\n if (newZipCode.length === 5) {\r\n setCoreProductATPData([]);\r\n setATPCallMessage('');\r\n props.setStatusATPCall(false);\r\n props.setATPCall(false);\r\n _validateZipCode(\r\n props,\r\n newZipCode,\r\n setErrorZipCode,\r\n setItemOutOfMarket,\r\n setNewZipCode,\r\n setIsValidZipCode,\r\n false,\r\n setIsOOMZipCode,\r\n isItemOom\r\n );\r\n const cookies = new Cookies();\r\n setNewZipCode(newZipCode);\r\n setIsZipCodeChnaged(true);\r\n setIsItemOom(false);\r\n cookies.set(`zip_code`, newZipCode, { path: '/', expires: oneYearFromNow() });\r\n return true;\r\n // VSI customization - START - 24789\r\n } else if (newZipCode.length < 5) {\r\n setErrorZipCode('Please enter a valid zip code. ');\r\n }\r\n // VSI customization - END - 24789\r\n return false;\r\n};\r\n\r\nexport const _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.now()).format('MMM D')}` : dayjs(newDate).format('ddd MMM, D');\r\n return deliveryByMessage;\r\n};\r\n\r\nexport const BuyboxDeliveryByMessage = (props: {\r\n buyboxProps: IBuyboxViewPropsExtended;\r\n itemOutOfMarket: boolean;\r\n setItemOutOfMarket: React.Dispatch;\r\n SetoutOfStockSmallParcelState: React.Dispatch;\r\n outOfStockSmallParcelState: boolean;\r\n}): JSX.Element => {\r\n const { buyboxProps, itemOutOfMarket, setItemOutOfMarket, outOfStockSmallParcelState, SetoutOfStockSmallParcelState } = props;\r\n\r\n const {\r\n ATPDataFromBusiness,\r\n data: { productSpecificationData }\r\n } = buyboxProps;\r\n const prevZipCode = buyboxProps.state.batchedAtpInventoryStatusData?.zipCode;\r\n const cookies = new Cookies();\r\n const zipcode = cookies.get('zip_code');\r\n const productType = _getProductAttribute(buyboxProps);\r\n const [isZipCodeChnaged, setIsZipCodeChnaged] = React.useState(false);\r\n const [isValidZipCode, setIsValidZipCode] = React.useState(true);\r\n const [isOOMZipCode, setIsOOMZipCode] = React.useState(true);\r\n const [isItemOom, setIsItemOom] = React.useState(false);\r\n const [coreProductATPData, setCoreProductATPData] = React.useState(ATPDataFromBusiness);\r\n const [atpCallMessage, setATPCallMessage] = React.useState('');\r\n const [recordId, setRecordId] = React.useState(buyboxProps.data.product.result!.RecordId);\r\n const [itemId, setItemId] = React.useState(buyboxProps.data.product.result!.ItemId);\r\n const [isInput, setIsInput] = React.useState(false);\r\n const [isAtpCallReturned, setIsAtpCallReturned] = React.useState(false);\r\n const [newZipCode, setNewZipCode] = React.useState(zipcode !== undefined ? zipcode : '');\r\n const isCached = true;\r\n const {\r\n data: { storeSelectorState },\r\n state: { preferredStore }\r\n } = buyboxProps;\r\n let defaultError = '';\r\n\r\n if (storeSelectorState?.result?.prefferedStore?.Zip && storeSelectorState?.result?.prefferedStore?.Zip === newZipCode) {\r\n const getMessageValue = getBlockZipCodeMessage(\r\n storeSelectorState?.result?.prefferedStore?.State || '',\r\n buyboxProps.context.app.config.blockedStates\r\n );\r\n if (getMessageValue?.length > 0) {\r\n defaultError = getMessageValue[0].message;\r\n }\r\n }\r\n const [errorZipCode, setErrorZipCode] = React.useState(defaultError);\r\n\r\n // out of stock attribute value\r\n let outOfStock = productSpecificationData.result?.find(\r\n attr => attr.Name?.trim().toLowerCase() === buyboxProps.context.app.config.outOfStockProductKey?.trim().toLowerCase()\r\n )?.BooleanValue;\r\n\r\n //leadTime product attribute value\r\n let deliveryDays = productSpecificationData.result?.find(attr => attr.Name?.trim() === buyboxProps.context.app.config.leadTime)\r\n ?.TextValue;\r\n // eslint-disable-next-line prefer-const\r\n const { ecomAllVairantStockInfoConcatenated } = buyboxProps;\r\n if (ecomAllVairantStockInfoConcatenated && ecomAllVairantStockInfoConcatenated.length > 0) {\r\n for (let i = 0; i < buyboxProps.ecomAllVairantStockInfoConcatenated.length; i++) {\r\n const variantIdOOS = ecomAllVairantStockInfoConcatenated[i].split('|');\r\n if (variantIdOOS && variantIdOOS[0] === recordId.toString() && !!Number(variantIdOOS[1])) {\r\n outOfStock = true;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n let deliveryByMessage = '';\r\n let deliveryByMessageRange = '';\r\n let coreProductATPCall = false;\r\n // eslint-disable-next-line prefer-const\r\n if (buyboxProps.data.product.result!.RecordId !== recordId || buyboxProps.data.product.result!.ItemId !== itemId) {\r\n setRecordId(buyboxProps.data.product.result!.RecordId);\r\n setItemId(buyboxProps.data.product.result!.ItemId);\r\n }\r\n React.useEffect(() => {\r\n // TODO: Handle Promise in a appropriate way\r\n if (productType === 'Core' && !outOfStock) {\r\n isAtpCallReturned && setIsAtpCallReturned(false);\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n buyboxProps.data.product.result?.MasterProductId &&\r\n _coreProductATPCall(\r\n buyboxProps,\r\n setCoreProductATPData,\r\n recordId,\r\n itemId,\r\n setATPCallMessage,\r\n setIsAtpCallReturned,\r\n isCached\r\n );\r\n }\r\n }, [itemOutOfMarket]);\r\n\r\n React.useEffect(() => {\r\n // TODO: Handle Promise in a appropriate way\r\n if (productType === 'Core' && !outOfStock) {\r\n isAtpCallReturned && setIsAtpCallReturned(false);\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n buyboxProps.data.product.result?.MasterProductId &&\r\n _coreProductATPCall(\r\n buyboxProps,\r\n setCoreProductATPData,\r\n recordId,\r\n itemId,\r\n setATPCallMessage,\r\n setIsAtpCallReturned,\r\n isCached\r\n );\r\n } else if (productType === 'Small Parcel') {\r\n void smallParcelATPInventoryStatusCall(\r\n buyboxProps,\r\n outOfStockSmallParcelState,\r\n SetoutOfStockSmallParcelState,\r\n recordId,\r\n itemId,\r\n newZipCode,\r\n prevZipCode\r\n );\r\n }\r\n }, [recordId]);\r\n\r\n React.useEffect(() => {\r\n // TODO: Handle Promise in a appropriate way\r\n if (productType === 'Core' && !outOfStock) {\r\n isAtpCallReturned && setIsAtpCallReturned(false);\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n buyboxProps.data.product.result?.MasterProductId &&\r\n _coreProductATPCall(\r\n buyboxProps,\r\n setCoreProductATPData,\r\n recordId,\r\n itemId,\r\n setATPCallMessage,\r\n setIsAtpCallReturned,\r\n isCached\r\n );\r\n } else if (productType === 'Small Parcel') {\r\n void smallParcelATPInventoryStatusCall(\r\n buyboxProps,\r\n outOfStockSmallParcelState,\r\n SetoutOfStockSmallParcelState,\r\n recordId,\r\n itemId,\r\n newZipCode,\r\n prevZipCode\r\n );\r\n }\r\n }, [preferredStore.OrgUnitNumber]);\r\n\r\n React.useEffect(() => {\r\n if (productType === 'Core' && zipcode?.length > 0 && !isOOMZipCode && !buyboxProps.ATPCall && !outOfStock) {\r\n isAtpCallReturned && setIsAtpCallReturned(false);\r\n buyboxProps.setATPCall(true);\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n buyboxProps.data.product.result?.MasterProductId &&\r\n _coreProductATPCall(\r\n buyboxProps,\r\n setCoreProductATPData,\r\n recordId,\r\n itemId,\r\n setATPCallMessage,\r\n setIsAtpCallReturned,\r\n isCached\r\n );\r\n }\r\n setIsOOMZipCode(true);\r\n }, [isOOMZipCode]);\r\n\r\n React.useEffect(() => {\r\n setNewZipCode(zipcode ? zipcode : '');\r\n setCoreProductATPData([]);\r\n setATPCallMessage('');\r\n buyboxProps.setStatusATPCall(false);\r\n buyboxProps.setATPCall(false);\r\n _validateZipCode(\r\n buyboxProps,\r\n newZipCode,\r\n setErrorZipCode,\r\n setItemOutOfMarket,\r\n setNewZipCode,\r\n setIsValidZipCode,\r\n false,\r\n setIsOOMZipCode,\r\n isItemOom\r\n );\r\n setIsItemOom(false);\r\n setIsZipCodeChnaged(true);\r\n buyboxProps.setZipCode(zipcode);\r\n }, [zipcode]);\r\n\r\n React.useEffect(() => {\r\n if (productType === 'Core') {\r\n setItemOutOfMarket(isItemOom);\r\n }\r\n }, [isItemOom]);\r\n const firstUpdate = React.useRef(true);\r\n let initial = false;\r\n React.useEffect(() => {\r\n if (firstUpdate?.current) {\r\n firstUpdate.current = false;\r\n initial = true;\r\n }\r\n buyboxProps.data.product.result?.MasterProductId &&\r\n newZipCode &&\r\n _validateZipCode(\r\n buyboxProps,\r\n newZipCode,\r\n setErrorZipCode,\r\n setItemOutOfMarket,\r\n setNewZipCode,\r\n setIsValidZipCode,\r\n initial,\r\n setIsOOMZipCode,\r\n isItemOom\r\n );\r\n }, [productType]);\r\n\r\n /**\r\n * isMFICore = Yes, isParcelable = No, shippingInformation = Core\r\n * if Above Condtions are true then this is a Core Item\r\n * call ATP proxy and make delivery by message\r\n */\r\n if (productType === 'Drop Ship') {\r\n if (outOfStockSmallParcelState !== false) {\r\n SetoutOfStockSmallParcelState(false);\r\n }\r\n }\r\n if (productType === 'Core' && !outOfStock) {\r\n const messageItemOutOfMarket = buyboxProps.context.app.config.messageForItemOutOfMarket\r\n ? buyboxProps.context.app.config.messageForItemOutOfMarket?.replace('{zipcode}', zipcode)\r\n : '';\r\n // Core Product\r\n coreProductATPCall = true;\r\n // outOfStock = false;\r\n if (outOfStockSmallParcelState !== false) {\r\n SetoutOfStockSmallParcelState(false);\r\n }\r\n if (isZipCodeChnaged) {\r\n setIsZipCodeChnaged(false);\r\n }\r\n deliveryByMessage = coreProductATPData ? _getSoonestDeliveryDate(coreProductATPData) : '';\r\n if (deliveryByMessage === '') {\r\n if (ATPDataFromBusiness !== null && ATPDataFromBusiness !== undefined && !isAtpCallReturned) {\r\n deliveryByMessage = _getSoonestDeliveryDate(ATPDataFromBusiness);\r\n if (deliveryByMessage === undefined || deliveryByMessage === null || deliveryByMessage === '') {\r\n deliveryByMessage = `${buyboxProps.context.app.config.defaultDeliveryMessage} `;\r\n }\r\n }\r\n }\r\n // deliveryByMessage = deliveryMessage;\r\n const parsedMessage: IMfrmAtpMessage = atpCallMessage ? JSON.parse(`${atpCallMessage}`) : '';\r\n const noZipCodeGroup = buyboxProps.context.app.config.responseMessageForItemOutOfMarketZip?.replace('{zipcode}', zipcode);\r\n const outOfZone = buyboxProps.context.app.config.responseMessageForItemOutOfMarketOOZ;\r\n if (\r\n coreProductATPData?.length === 0 &&\r\n parsedMessage?.Message &&\r\n noZipCodeGroup &&\r\n outOfZone &&\r\n (parsedMessage?.Message?.toLowerCase() === outOfZone?.toLowerCase() ||\r\n parsedMessage?.Message?.toLowerCase() === noZipCodeGroup?.toLowerCase()) &&\r\n !itemOutOfMarket &&\r\n !isItemOom\r\n ) {\r\n setIsItemOom(true);\r\n setErrorZipCode(messageItemOutOfMarket);\r\n }\r\n\r\n if ((coreProductATPData?.length === 0 || deliveryByMessage === '') && isAtpCallReturned) {\r\n deliveryByMessage = itemOutOfMarket\r\n ? `Delivery `\r\n : buyboxProps.context.app.config.defaultDeliveryMessage\r\n ? `${buyboxProps.context.app.config.defaultDeliveryMessage?.trim()} `\r\n : '';\r\n }\r\n }\r\n /**\r\n * Check if no delivery days are found in product attribute then get it from site builder\r\n */\r\n if (\r\n (deliveryDays === '' || deliveryDays === undefined || deliveryDays === null) &&\r\n buyboxProps.context.app.config.brandList &&\r\n buyboxProps.context.app.config.brandList?.length > 0 &&\r\n !coreProductATPCall &&\r\n !outOfStockSmallParcelState\r\n ) {\r\n const brand =\r\n buyboxProps.context.app.config.brandBackofficeAttributePdp &&\r\n productSpecificationData.result\r\n ?.find(attr => attr.Name?.trim() === buyboxProps.context.app.config.brandBackofficeAttributePdp)\r\n ?.TextValue?.toLowerCase();\r\n if (brand) {\r\n buyboxProps.context.app.config.brandList?.map((brandList: IBrandListData) => {\r\n if (brandList?.brandName?.toLowerCase() === brand) {\r\n deliveryDays =\r\n brandList.brandLeadtime !== undefined && brandList.brandLeadtime !== '' && brandList.brandLeadtime !== null\r\n ? brandList.brandLeadtime\r\n : '';\r\n }\r\n });\r\n }\r\n }\r\n\r\n React.useEffect(() => {\r\n if (productType === 'Core' && ATPDataFromBusiness !== null && ATPDataFromBusiness !== undefined && !outOfStock) {\r\n deliveryByMessage = ATPDataFromBusiness ? _getSoonestDeliveryDate(ATPDataFromBusiness) : '';\r\n if (deliveryByMessage === undefined || deliveryByMessage === '') {\r\n deliveryByMessage = buyboxProps.context.app.config.defaultDeliveryMessage;\r\n }\r\n setCoreProductATPData(ATPDataFromBusiness);\r\n }\r\n }, [ATPDataFromBusiness]);\r\n\r\n /**\r\n * For Core item delivery message is empty and delivery days are found at any case then do following to get delivery by message\r\n */\r\n if (deliveryByMessage === '' && deliveryDays && deliveryDays !== '' && deliveryDays !== undefined) {\r\n const daysSpan = deliveryDays?.split('-');\r\n if (daysSpan && daysSpan[1] !== undefined && daysSpan.length) {\r\n daysSpan?.map((item: string, index: number) => {\r\n const date = new Date();\r\n const deliveryDate = date.setDate(date.getDate());\r\n if (parseInt(item, 10) > 0) {\r\n let numberOfDays = parseInt(item, 10);\r\n let newDate = deliveryDate;\r\n while (numberOfDays > 0) {\r\n newDate = date.setDate(date.getDate() + 1);\r\n if (dayjs(newDate).format('d') !== '0' && dayjs(newDate).format('d') !== '6') {\r\n numberOfDays--;\r\n }\r\n }\r\n deliveryByMessage = dayjs(newDate).format('MMM D');\r\n if (deliveryByMessageRange !== '') {\r\n deliveryByMessageRange = `${deliveryByMessageRange} to ${deliveryByMessage}`;\r\n } else {\r\n deliveryByMessageRange = deliveryByMessage;\r\n newDate = date.setDate(date.getDate() - parseInt(item[0], 10));\r\n }\r\n }\r\n });\r\n deliveryByMessage = deliveryByMessageRange;\r\n } else {\r\n deliveryByMessage = _deliveryMessage(deliveryDays);\r\n }\r\n }\r\n\r\n if (deliveryByMessage === '' || outOfStock) {\r\n return <>>;\r\n }\r\n return (\r\n \r\n {isInput ? (\r\n <>\r\n {/* // VSI customization - START - 24789 */}\r\n \r\n {\r\n setNewZipCode(event.target.value);\r\n setErrorZipCode('');\r\n }}\r\n onKeyUp={e => {\r\n if (\r\n e.which === 13 &&\r\n _updateZipCode(\r\n newZipCode,\r\n setNewZipCode,\r\n buyboxProps,\r\n setErrorZipCode,\r\n setItemOutOfMarket,\r\n setIsZipCodeChnaged,\r\n setIsValidZipCode,\r\n setCoreProductATPData,\r\n setATPCallMessage,\r\n setIsOOMZipCode,\r\n setIsItemOom,\r\n isItemOom\r\n )\r\n ) {\r\n setIsInput(prevState => !prevState);\r\n }\r\n }}\r\n />\r\n \r\n Zip Code\r\n \r\n {\r\n if (\r\n _updateZipCode(\r\n newZipCode,\r\n setNewZipCode,\r\n buyboxProps,\r\n setErrorZipCode,\r\n setItemOutOfMarket,\r\n setIsZipCodeChnaged,\r\n setIsValidZipCode,\r\n setCoreProductATPData,\r\n setATPCallMessage,\r\n setIsOOMZipCode,\r\n setIsItemOom,\r\n isItemOom\r\n )\r\n ) {\r\n setIsInput(prevState => !prevState);\r\n }\r\n }}\r\n >\r\n Update\r\n \r\n \r\n {errorZipCode !== '' ? (\r\n {buyboxProps.resources.mfrmInvalidZipCode}\r\n ) : (\r\n <>>\r\n )}\r\n {/* // VSI customization - END - 24789 */}\r\n >\r\n ) : (\r\n <>\r\n {\r\n \r\n \r\n {initial ? (\r\n newZipCode && isValidZipCode\r\n ) : newZipCode ? (\r\n <>\r\n {errorZipCode ? (\r\n 'Delivery '\r\n ) : (\r\n <>\r\n {productType === 'Core' ? '' : buyboxProps.resources.deliveryBy} {deliveryByMessage}\r\n >\r\n )}{' '}\r\n to\r\n >\r\n ) : (\r\n 'To Check Availability'\r\n )}\r\n \r\n ) => {\r\n setIsInput(prevState => !prevState);\r\n setNewZipCode(newZipCode);\r\n event.preventDefault();\r\n // @ts-ignore\r\n if ('utag' in window) {\r\n event.preventDefault();\r\n // @ts-ignore\r\n // tslint:disable-next-line: object-literal-key-quotes\r\n utag.link({\r\n event: 'PDP-card-action',\r\n event_category: 'PDP Card Action',\r\n event_action: 'Change Zip-Code Click',\r\n enhanced_action: 'change_zipcode',\r\n event_label: 'Change Zip-Code PDP',\r\n event_noninteraction: 'false'\r\n });\r\n }\r\n }}\r\n >\r\n {initial ? newZipCode && isValidZipCode : newZipCode ? newZipCode : buyboxProps.resources.enterZipCode}\r\n \r\n \r\n }\r\n {errorZipCode !== '' ? (\r\n \r\n ) : (\r\n <>>\r\n )}\r\n >\r\n )}\r\n \r\n );\r\n};\r\n"],"names":["getBlockZipCodeMessage","stateName","blockStatesArray","filter","blockstate","fallBackBrandAttribute","parseBrandName","attributes","backendAttribute","recordId","_hasArray","attribute","productBrandName","hasArray","find","currAttribute","_currAttribute$Name","Name","toLowerCase","trim","TextValue","MsDyn365","isBrowser","_bonusItemArray$find","getLocalStorage","localStorage","getItem","bonusItemArray","JSON","parse","checkBrandName","item","productId","brandName","parseBrandNameUnbxd","_bonusItemArray$find2","getBrandNameCheck","_attributes$find2","oneYearFromNow","now","Date","setFullYear","getFullYear","GetAddressByZipcodeInput","constructor","country","zipcode","getCacheKey","this","getCacheObjectType","dataCacheType","Msdyn365","action","async","input","ctx","_zipcode$trim","length","getAddressFromZipCodeAsync","callerContext","queryResultSettings","Paging","Top","id","AttributesForSelectedVariantInput","channelId","selectedProduct","catalogId","createAttributesForSelectedVariantInput","inputData","getSelectedProductIdFromActionInput","requestContext","apiSettings","Error","getAttributesForSelectedVariantAction","Promise","resolve","then","activeProduct","selectedVariantInput","SelectedVariantInput","getSelectedVariant","productResult","getAttributeValuesAsync","RecordId","attributeValues","catch","error","trace","message","createObservableDataAction","_setTime","time","temp","split","newDatewithTime","dayjs","format","toUpperCase","_getSoonestDeliveryDate","coreProductATPData","deliveryByMessage","index","Available","undefined","ATPQuantity","parseInt","date","today","deliveryDate","SlotDate","currHour","StartTime","setDate","getDate","smallParcelATPInventoryStatusCall","props","outOfStockSmallParcelState","SetoutOfStockSmallParcelState","itemId","zipCode","prevZipCode","_props$state$batchedA","_props$state$batchedA2","inventoryStatusData","state","batchedAtpInventoryStatusData","ATPInventoryStatusData","selectedObj","_item$VariantRecordId","_props$state$currentP","VariantRecordId","toString","currentProduct","_props$data$product$r","data","product","result","MasterProductId","_smallParcelProductATPCallForInventoryStatus","Quantity","some","variant","_props$state$currentP2","_getProductAttribute","_productSpecification","productSpecificationData","getProductType","attr","_attr$Name","context","app","config","smallParcelAttributeKey","_validateZipCode","setErrorZipCode","setItemOutOfMarket","setNewZipCode","setIsValidZipCode","initial","setIsOOMZipCode","isItemOom","getAddressByZipcodeInput","getAddressByZipcodeAction","actionContext","addressByZipcode","productType","stateObj","blockedStates","oomZipCode","bStateIter","StateId","update","ProductCompareBuyboxStateSharing","getMessageValue","_getMessageValue$0$zi","zipcodeMessage","replace","cookies","Cookies","set","path","expires","e","console","log","_updateZipCode","newZipCode","setIsZipCodeChnaged","setCoreProductATPData","setATPCallMessage","setIsItemOom","setStatusATPCall","setATPCall","_deliveryMessage","days","numberOfDays","newDate","flag","BuyboxDeliveryByMessage","_buyboxProps$state$ba","_storeSelectorState$r","_storeSelectorState$r2","_productSpecification2","_productSpecification3","_buyboxProps$context$5","buyboxProps","itemOutOfMarket","ATPDataFromBusiness","get","isZipCodeChnaged","React","isValidZipCode","isOOMZipCode","atpCallMessage","setRecordId","setItemId","ItemId","isInput","setIsInput","isAtpCallReturned","setIsAtpCallReturned","isCached","storeSelectorState","preferredStore","defaultError","prefferedStore","Zip","_storeSelectorState$r3","State","errorZipCode","outOfStock","_attr$Name2","_buyboxProps$context$","outOfStockProductKey","BooleanValue","deliveryDays","_attr$Name3","leadTime","ecomAllVairantStockInfoConcatenated","i","variantIdOOS","Number","deliveryByMessageRange","coreProductATPCall","_buyboxProps$data$pro","_coreProductATPCall","_buyboxProps$data$pro2","_buyboxProps$data$pro3","OrgUnitNumber","_buyboxProps$data$pro4","ATPCall","setZipCode","firstUpdate","_buyboxProps$data$pro5","current","_buyboxProps$context$2","_buyboxProps$context$3","_parsedMessage$Messag","_parsedMessage$Messag2","messageItemOutOfMarket","messageForItemOutOfMarket","defaultDeliveryMessage","parsedMessage","noZipCodeGroup","responseMessageForItemOutOfMarketZip","outOfZone","responseMessageForItemOutOfMarketOOZ","_buyboxProps$context$4","Message","brandList","_productSpecification4","brand","brandBackofficeAttributePdp","_attr$Name4","_buyboxProps$context$6","map","_brandList$brandName","brandLeadtime","_deliveryDays","daysSpan","Node","className","type","value","maxLength","autoFocus","onChange","event","target","onKeyUp","which","prevState","tag","role","onClick","resources","mfrmInvalidZipCode","deliveryBy","tabIndex","preventDefault","window","utag","link","event_category","event_action","enhanced_action","event_label","event_noninteraction","enterZipCode","dangerouslySetInnerHTML","__html"],"sourceRoot":""}