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ACN3R,EAAMgW,uBAGN,OAAO,EAGX,IAAKhW,EAAMW,OAASX,EAAMW,KAAKC,QAAQjD,SAEnC,OAAO,EAGX,aAAIqC,EAAMW,KAAKC,eAAf,OAAI,EAAoB6Z,aACpB,UAAIza,EAAMW,KAAKC,QAAQ6Z,kBAAvB,OAAI,EAA+ByB,MAAKjN,KAAeA,EAAUyL,gBAAkBzL,EAAUyL,eAAexb,UAExG,OAAO,EAGf,MAAM2+B,EAAyBD,GAA0B59B,EAAMmR,SAAWnR,EAAMmR,SAAW,EAE3F,QAAOnR,EAAMsN,0BACuC7M,IAAhDT,EAAMsN,oBAAoBiB,mBAC1BvO,EAAMsN,oBAAoBiB,mBAAqBsvB,IAKjDX,EAAuBl9B,IAA4C,MACjC,EAApC,aAAIA,EAAMW,KAAKC,eAAf,OAAI,EAAoB6Z,aACpB,UAAIza,EAAMW,KAAKC,QAAQ6Z,kBAAvB,OAAI,EAA+ByB,MAAKjN,KAAeA,EAAUyL,gBAAkBzL,EAAUyL,eAAexb,UAGxG,OAAO,EAKf,SAAKc,EAAMiT,YAAcjT,EAAM2R,sBAO7ByqB,EAAkB,CAACp8B,EAAiC9C,KAClD8C,EAAMuW,OACNvW,EAAMuW,MAAMrZ,IAIdw+B,EAAiB,CAAC17B,EAAiC9C,KACjD8C,EAAMwU,SACNxU,EAAMwU,QAAQtX,IAIT+W,EAAwE6pB,EAAAA,GAAAA,wBAGnF,iXAHmF,EAGpEC,UAAW1B,GAAclC,IAE1C","sources":["webpack://mattressfirm/./src/Utilities/get-inventory-quantity.tsx?d0aa","webpack://mattressfirm/./src/Utilities/get-utag-product-category.ts?a69d","webpack://mattressfirm/./src/Utilities/get-utag-variant-id.ts?ea12","webpack://mattressfirm/./src/Utilities/get-view-port.tsx?4210","webpack://mattressfirm/./src/Utilities/mfrm-buybox-utils.ts?ef8b","webpack://mattressfirm/./src/Utilities/plp-url-utils.ts?728b","webpack://mattressfirm/./src/actions/get-sm-inventory-status.action.ts?cb72","webpack://mattressfirm/./src/actions/TryInStoreDataServiceEntities.g.ts?ea57","webpack://mattressfirm/./src/actions/TryInStoreDataActionExtension.g.ts?c8db","webpack://mattressfirm/./src/actions/get-try-in-store-info.action.ts?dff9","webpack://mattressfirm/./src/data-actions/buybox-get-all-variants-list.ts?6ad4","webpack://mattressfirm/./src/Utilities/get-eyebrow-message.tsx?2bcd","webpack://mattressfirm/./src/modules/mfrm-buybox/common/utilities/error-utilities.ts?bd84","webpack://mattressfirm/./src/modules/mfrm-buybox/common/buybox-components.tsx?bf31","webpack://mattressfirm/./src/modules/mfrm-buybox/components/mfrm-buybox-find-in-store.tsx?97b6","webpack://mattressfirm/./src/modules/mfrm-buybox/mfrm-buybox.tsx?cc50","webpack://mattressfirm/./src/modules/mfrm-store-selector/components/store-selector-location-line-item/date-time-helpers.ts?8535","webpack://mattressfirm/./src/themes/mattressfirm/views/components/addtocart/addtocart.component.tsx?5783"],"sourcesContent":["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 { getCategoryPathsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { IActionContext } from '@msdyn365-commerce/core-internal';\r\nexport const getUtagProductCategory = async (actionContext: IActionContext, channelId: number, catalogId: number = 0, RecordId: number) => {\r\n //context, channelId, catalogId, categoryPathLookups\r\n const categoryPathResults = await getCategoryPathsAsync(\r\n { callerContext: actionContext, queryResultSettings: {} },\r\n channelId,\r\n catalogId,\r\n [{ ProductId: RecordId }]\r\n );\r\n const categoryPath = categoryPathResults[0]?.CategoryPath?.[0] && categoryPathResults[0].CategoryPath[0];\r\n if (!categoryPath?.Segments?.length) {\r\n return [];\r\n }\r\n return [categoryPath.Segments[categoryPath.Segments.length - 1].CategoryName!];\r\n};\r\n","import { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport getAllProductVariants, { BuyboxGetDimensionVariantAvailabilityInput } from '../data-actions/buybox-get-all-variants-list';\r\nimport { IActionContext } from '@msdyn365-commerce/core-internal';\r\n\r\nexport const getUtagVariantId = async (\r\n MasterProductId: number,\r\n channelId: number,\r\n actionContext: IActionContext,\r\n RecordId: number,\r\n ItemId: string\r\n) => {\r\n if (MasterProductId && MasterProductId > 0) {\r\n const input = new BuyboxGetDimensionVariantAvailabilityInput(MasterProductId, channelId);\r\n const variantsResp: SimpleProduct[] = await getAllProductVariants(input, actionContext);\r\n for (let variantIter = 0; variantIter < variantsResp.length; variantIter++) {\r\n if (variantsResp[variantIter].RecordId === RecordId) {\r\n const ePropsVariant = variantsResp[variantIter].ExtensionProperties!;\r\n if (ePropsVariant?.length > 0) {\r\n for (let eIter = 0; eIter < ePropsVariant?.length; eIter++) {\r\n if (ePropsVariant[eIter].Key === 'RetailVariantId') {\r\n return [ePropsVariant[eIter].Value?.StringValue];\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n const variantofId = `V000${ItemId}`;\r\n return [variantofId?.slice(0, -1)];\r\n};\r\n\r\nexport const getUtagRetailVariantIdAndRecId = async (\r\n MasterProductId: number,\r\n channelId: number,\r\n actionContext: IActionContext,\r\n RecordId: number,\r\n ItemId: string\r\n) => {\r\n if (MasterProductId && MasterProductId > 0) {\r\n const input = new BuyboxGetDimensionVariantAvailabilityInput(MasterProductId, channelId);\r\n const variantsResp: SimpleProduct[] = await getAllProductVariants(input, actionContext);\r\n for (let variantIter = 0; variantIter < variantsResp.length; variantIter++) {\r\n if (variantsResp[variantIter].RecordId === RecordId) {\r\n const ePropsVariant = variantsResp[variantIter].ExtensionProperties!;\r\n if (ePropsVariant?.length > 0) {\r\n for (let eIter = 0; eIter < ePropsVariant?.length; eIter++) {\r\n if (ePropsVariant[eIter].Key === 'RetailVariantId') {\r\n return { 'retailVariantId': ePropsVariant[eIter].Value?.StringValue, 'recordId': RecordId };\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n const variantofId = `V000${ItemId}`;\r\n return { 'retailVariantId': variantofId?.slice(0, -1), 'recordId': RecordId };\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 { getActivePricesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport dayjs from 'dayjs';\r\nimport Cookies from 'universal-cookie';\r\nimport { IMFIATPInventoryStatusEntity, IMFIATPInventoryStatusResponse, IMFICartLine, IMFICLDeliveryScheduleParameters } from '../actions/CoreProductDataServiceEntities.g';\r\nimport { IBuyboxGetDimensionPricingActionData } from '../data-actions/buybox-get-dimension-pricing-action';\r\nimport { IBuyboxGetDimensionVariantAvailabilityActionData } from '../data-actions/buybox-get-dimension-variants-availability-action';\r\nimport { IBuyboxViewProps, IMFIATPInventoryStatusResponseEx } from '../modules/mfrm-buybox/mfrm-buybox';\r\nimport { IMfrmBuyboxProps } from '../modules/mfrm-buybox/mfrm-buybox.props.autogenerated';\r\nimport { IMfrmBuyBoxData } from '../modules/mfrm-buybox/mfrm-buybox.view';\r\nimport _getDeliveryByMessage from './get-delivery-by-message';\r\nimport _getEyebrowMessage from './get-eyebrow-message';\r\nimport _getInventoryQuantity from './get-inventory-quantity';\r\n// tslint:disable-next-line: max-line-length no-any\r\nexport const _coreProductATPCall = async (\r\n props: IBuyboxViewProps & IMfrmBuyboxProps,\r\n setCoreProductATPData: React.Dispatch,\r\n recordId: number,\r\n itemId: string | undefined,\r\n setATPCallMessage: React.Dispatch,\r\n setIsAtpCallReturned: React.Dispatch,\r\n isCached?: boolean\r\n) => {\r\n const { context } = props;\r\n const cookies = new Cookies();\r\n const zipcode = cookies.get('zip_code');\r\n if (zipcode === \"\" || zipcode === undefined) {\r\n return;\r\n }\r\n const itemLinesArray = [];\r\n if (props.data.product.result) {\r\n const itemLines: IMFICartLine = {\r\n ItemId: itemId,\r\n Quantity: 1,\r\n VariantRecordId: recordId?.toString()\r\n };\r\n\r\n itemLinesArray.push(itemLines);\r\n const currentDate = Date.now();\r\n const requestBody: IMFICLDeliveryScheduleParameters = {\r\n InventoryType: 'Delivery',\r\n Weeks: props.context.app.config.weeksPDPforATPCall,\r\n StoreId: '',\r\n Page: 'pdp',\r\n RequestedDate: dayjs(currentDate).format('MM/DD/YYYY'),\r\n ZipCode: zipcode,\r\n ItemLines: itemLinesArray\r\n };\r\n await _getDeliveryByMessage(requestBody, context, isCached)\r\n .then(result => {\r\n setIsAtpCallReturned(true);\r\n if (result !== undefined && result?.ATPInventoryData && result?.ATPInventoryData.length > 0) {\r\n setCoreProductATPData(result?.ATPInventoryData);\r\n } else {\r\n // VSI Customization - START\r\n setCoreProductATPData([]);\r\n // VSI Customization - End\r\n }\r\n setATPCallMessage(result?.Message);\r\n })\r\n .catch(e => {\r\n console.log('Error', e);\r\n });\r\n }\r\n};\r\n\r\nexport const _coreProductATPCallForInventoryStatus = async (\r\n props: IBuyboxViewProps & IMfrmBuyboxProps,\r\n recordId: number,\r\n itemId: string | undefined,\r\n allVariants: IBuyboxGetDimensionVariantAvailabilityActionData[],\r\n index: number\r\n) => {\r\n const { context } = props;\r\n // this commented code will removed when general data appeared\r\n const cookies = new Cookies();\r\n const zipcode = cookies.get('zip_code');\r\n if (zipcode === \"\" || zipcode === undefined) {\r\n return;\r\n }\r\n const itemLinesArray = [];\r\n if (props.data.product.result) {\r\n const itemLines: IMFICartLine = {\r\n ItemId: itemId,\r\n Quantity: 1,\r\n VariantRecordId: recordId?.toString()\r\n };\r\n itemLinesArray.push(itemLines);\r\n const currentDate = Date.now();\r\n const requestBody: IMFICLDeliveryScheduleParameters = {\r\n InventoryType: 'Delivery',\r\n Weeks: props.context.app.config.weeksPDPforATPCall,\r\n StoreId: '',\r\n Page: 'pdp',\r\n RequestedDate: dayjs(currentDate).format('MM/DD/YYYY'),\r\n ZipCode: zipcode, // '77047',\r\n ItemLines: itemLinesArray\r\n };\r\n const getInventoryQuantity = _getInventoryQuantity(requestBody, context);\r\n getInventoryQuantity.then((result) => {\r\n if (result !== undefined && result?.ATPInventoryStatusData && result?.ATPInventoryStatusData.length > 0) {\r\n const coreProductAtpData = result?.ATPInventoryStatusData;\r\n coreProductAtpData?.length && coreProductAtpData.map((item: IMFIATPInventoryStatusEntity) => {\r\n // TODO: remove console logs after testing\r\n if (item.Available === 'YES' && item.Quantity !== undefined && parseInt(item.Quantity, 10) > 0) {\r\n allVariants[index].isAvailable = true;\r\n return true;\r\n }\r\n allVariants[index].isAvailable = false;\r\n return false;\r\n });\r\n }\r\n }).catch((e) => {\r\n console.log('Error', e);\r\n });\r\n }\r\n};\r\n\r\nexport const _getActivePrices = async (\r\n pricingData: IBuyboxGetDimensionPricingActionData[],\r\n ctx: IActionContext\r\n): Promise => {\r\n const date = new Date();\r\n const productIds: number[] = [];\r\n for (let i = 0; i < pricingData.length; i++) {\r\n productIds.push(pricingData[i].productId);\r\n }\r\n await getActivePricesAsync(\r\n { callerContext: ctx },\r\n { ChannelId: ctx.requestContext.apiSettings.channelId, CatalogId: ctx.requestContext.apiSettings.catalogId },\r\n productIds,\r\n date,\r\n null,\r\n [],\r\n true\r\n ).then(dimPricesResult => {\r\n dimPricesResult?.map((item, index) => {\r\n pricingData[index].discountAmount = item.DiscountAmount;\r\n });\r\n });\r\n return pricingData;\r\n};\r\n\r\nexport const _smallParcelProductATPCallForInventoryStatus = async (\r\n props: IBuyboxViewProps & IMfrmBuyboxProps,\r\n recordId: number,\r\n itemId: string | undefined,\r\n // tslint:disable-next-line: no-any\r\n SetoutOfStockSmallParcelState: React.Dispatch,\r\n isCached?: boolean\r\n) => {\r\n const { context } = props;\r\n // this commented code will removed when general data appeared\r\n const cookies = new Cookies();\r\n const zipcode = cookies.get('zip_code');\r\n if (zipcode === \"\" || zipcode === undefined) {\r\n return;\r\n }\r\n const itemLinesArray = [];\r\n if (props.data.product.result) {\r\n const itemLines: IMFICartLine = {\r\n ItemId: itemId,\r\n Quantity: 1,\r\n VariantRecordId: recordId.toString()\r\n };\r\n itemLinesArray.push(itemLines);\r\n const currentDate = Date.now();\r\n const requestBody: IMFICLDeliveryScheduleParameters = {\r\n InventoryType: 'Delivery',\r\n Weeks: props.context.app.config.weeksPDPforATPCall,\r\n StoreId: '',\r\n Page: 'pdp',\r\n RequestedDate: dayjs(currentDate).format('MM/DD/YYYY'),\r\n ZipCode: zipcode, // '77047',\r\n ItemLines: itemLinesArray\r\n };\r\n await _getInventoryQuantity(requestBody, context, isCached)\r\n .then(result => {\r\n if (result !== undefined && result?.ATPInventoryStatusData && result?.ATPInventoryStatusData.length > 0) {\r\n const coreProductAtpData = result?.ATPInventoryStatusData;\r\n coreProductAtpData &&\r\n coreProductAtpData.length &&\r\n coreProductAtpData.map((item: IMFIATPInventoryStatusEntity) => {\r\n // TODO: remove console logs after testing\r\n if (item.Available === 'YES' && item.Quantity !== undefined && parseInt(item.Quantity, 10) > 0) {\r\n // allVariants[index].isAvailable = true;\r\n SetoutOfStockSmallParcelState(false);\r\n return true;\r\n } else {\r\n SetoutOfStockSmallParcelState(true);\r\n }\r\n // allVariants[index].isAvailable = false;\r\n return false;\r\n });\r\n }\r\n })\r\n .catch(e => {\r\n console.log('Error', e);\r\n });\r\n }\r\n};\r\n\r\nexport const _coreProductATPCallForInventoryStatusForAllVariants = async (\r\n props: IMfrmBuyboxProps,\r\n recordIds: number[],\r\n itemId: string | undefined,\r\n allVariants: IBuyboxGetDimensionVariantAvailabilityActionData[]\r\n): Promise => {\r\n const { context } = props;\r\n // this commented code will removed when general data appeared\r\n const cookies = new Cookies();\r\n const zipcode: any = cookies.get('zip_code');\r\n if (zipcode === '' || zipcode === undefined) {\r\n return null;\r\n }\r\n const itemLinesArray = [];\r\n if (props.data.product.result) {\r\n for (let ridIter = 0; ridIter < recordIds.length; ridIter++) {\r\n const itemLines: IMFICartLine = {\r\n ItemId: itemId,\r\n Quantity: 1,\r\n VariantRecordId: recordIds[ridIter].toString()\r\n };\r\n itemLinesArray.push(itemLines);\r\n }\r\n\r\n const currentDate = Date.now();\r\n const requestBody: IMFICLDeliveryScheduleParameters = {\r\n InventoryType: 'Delivery',\r\n Weeks: props.context.app.config.weeksPDPforATPCall,\r\n StoreId: '',\r\n Page: 'pdp',\r\n RequestedDate: dayjs(currentDate).format('MM/DD/YYYY'),\r\n ZipCode: zipcode, // '77047',\r\n ItemLines: itemLinesArray\r\n };\r\n\r\n const result: IMFIATPInventoryStatusResponse | null = await _getInventoryQuantity(requestBody, context, true);\r\n if (result !== undefined && result?.ATPInventoryStatusData && result?.ATPInventoryStatusData.length > 0) {\r\n const coreProductAtpData = result?.ATPInventoryStatusData;\r\n coreProductAtpData && coreProductAtpData.length && coreProductAtpData.map((item: IMFIATPInventoryStatusEntity) => {\r\n\r\n for (let iter = 0; iter < allVariants.length; iter++) {\r\n // TODO: remove console logs after testing\r\n if (item.Available === 'YES' && item.Quantity !== undefined && parseInt(item.Quantity, 10) > 0 && allVariants[iter].variantID.toString() === item.VariantRecordId) {\r\n allVariants[iter].isAvailable = true;\r\n break;\r\n }\r\n else if (item.Available === 'NO' && allVariants[iter].variantID.toString() === item.VariantRecordId) {\r\n allVariants[iter].isAvailable = false;\r\n break;\r\n }\r\n }\r\n });\r\n }\r\n const finalResult: IMFIATPInventoryStatusResponseEx = {\r\n ...result,\r\n zipCode: requestBody?.ZipCode\r\n };\r\n return finalResult;\r\n }\r\n return null;\r\n};\r\n","import { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport { IRequestContext } from '@msdyn365-commerce/core';\r\nimport { ProductRefinerValue } from '@msdyn365-commerce/retail-proxy';\r\nexport interface IVirtualRefinersConfig {\r\n order: number;\r\n refinerName: string;\r\n enableForMattresses: boolean;\r\n enableForOtherCategories: boolean;\r\n allowDuplicate: boolean;\r\n}\r\n\r\n/**\r\n * This will create the canonicalURL as per 7924 requirement\r\n * @param requestContext\r\n * @returns string of canonical URL\r\n */\r\nexport const canonicalURL = (requestContext: IRequestContext): string => {\r\n const requestUrl = requestContext.url.requestUrl;\r\n const origin = requestUrl.origin;\r\n const path = requestUrl.pathname.toLowerCase();\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('/').splice(1);\r\n\r\n // remove double values containing pipe sign\r\n if (path.match(/%7c/)) {\r\n urlParts = removePipeSignValue(urlParts);\r\n }\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n const filteredPath = urlParts?.join('/');\r\n\r\n return `${origin}/${filteredPath}`;\r\n};\r\n\r\nexport const filteredURL = (requestContext: IRequestContext): string => {\r\n const requestUrl = requestContext.url.requestUrl;\r\n const path = requestUrl.pathname.toLowerCase();\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('/').splice(1);\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n const filteredPath = urlParts?.join('/');\r\n\r\n return `/${filteredPath}`;\r\n};\r\n\r\n/**\r\n * This will create the canonicalURL as per 7924 requirement\r\n * @param requestContext\r\n * @returns string of canonical URL\r\n */\r\nexport const canonicalURLWithoutBaseUrl = (requestContext: IRequestContext): string => {\r\n const requestUrl = requestContext.url.requestUrl;\r\n const path = requestUrl.pathname.toLowerCase();\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('\\/').splice(1);\r\n\r\n // remove double values containing pipe sign\r\n if (path.match(/%7c/)) {\r\n urlParts = removePipeSignValue(urlParts);\r\n }\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n return urlParts?.join('\\/');\r\n};\r\n\r\n/**\r\n * This will remove the Pipe sign value set from urlParts\r\n * @param urlParts\r\n * @returns\r\n */\r\nexport const removePipeSignValue = (urlParts: string[]) => {\r\n // urlParts.forEach((part, index) => {\r\n // const indexOfValue = urlParts.indexOf('%7c');\r\n // if (indexOfValue !== -1) {\r\n // urlParts.splice(indexOfValue, 1);\r\n // }\r\n // });\r\n\r\n if (urlParts !== undefined && urlParts.length > 0) {\r\n urlParts = urlParts.filter(urlPart => urlPart.indexOf('%7c') === -1);\r\n }\r\n\r\n return urlParts;\r\n};\r\n\r\n/**\r\n * This will remove the keywords from urlParts array which were received from\r\n * the app.settings.json/CMS Extensions\r\n * @param urlParts\r\n * @param requestContext\r\n * @returns urlParts array filtered\r\n */\r\nexport const removeKeywords = (urlParts: string[], requestContext: IRequestContext): string[] => {\r\n const removeKeywordFromUrl = requestContext.app.config.removeKeywordFromUrl;\r\n\r\n if (urlParts.length > 0 && removeKeywordFromUrl && removeKeywordFromUrl.length > 0) {\r\n const removeKeywordFromUrlArray: string[] = removeKeywordFromUrl?.trim().split(',');\r\n removeKeywordFromUrlArray?.length > 0 &&\r\n urlParts.forEach(_part => {\r\n removeKeywordFromUrlArray.forEach(removeKeyword => {\r\n const trimmedKeyword = removeKeyword.trim().toLowerCase();\r\n const indexOfValue = urlParts.indexOf(trimmedKeyword);\r\n if (trimmedKeyword.length > 0 && indexOfValue !== -1) {\r\n urlParts.splice(indexOfValue, 1);\r\n }\r\n });\r\n });\r\n }\r\n\r\n return urlParts;\r\n};\r\n\r\n/**\r\n * This will sort the Virtual refiner config based on order and return\r\n * only active virtual refiner configs based on isMattress category will\r\n * be returned\r\n * @param requestContext\r\n * @param isMattressesCategory boolean | undefined\r\n * @returns IVirtualRefinersConfig[] | undefined\r\n */\r\nexport const getSortedVirtualRefinerConfig = (\r\n requestContext: IRequestContext,\r\n isMattressesCategory: boolean | undefined\r\n): IVirtualRefinersConfig[] | undefined => {\r\n let appConfigSorted = getVirtualRefinerConfig(requestContext);\r\n\r\n // sort the config by provided config\r\n if (appConfigSorted) {\r\n if (isMattressesCategory === true) {\r\n appConfigSorted = appConfigSorted.filter(appConfig => {\r\n return appConfig.enableForMattresses;\r\n });\r\n } else if (isMattressesCategory === false) {\r\n appConfigSorted = appConfigSorted.filter(appConfig => {\r\n return appConfig.enableForOtherCategories;\r\n });\r\n }\r\n appConfigSorted.sort((a: IVirtualRefinersConfig, b: IVirtualRefinersConfig) => {\r\n return a.order - b.order;\r\n });\r\n }\r\n\r\n return appConfigSorted;\r\n};\r\n\r\n/**\r\n * Virtual refiner names from the app.settings.json will be returned which can be used\r\n * to filter out refiners data based upon active virtual refiners\r\n * @param requestContext\r\n * @param isMattressesCategory boolean | undefined\r\n * @returns string[]\r\n */\r\nexport const getVirtualRefinerNames = (requestContext: IRequestContext, isMattressesCategory: boolean | undefined): string[] => {\r\n const sortedVirtualRefinerConfig = getSortedVirtualRefinerConfig(requestContext, isMattressesCategory);\r\n\r\n const appConfigRefinerNames: string[] = [];\r\n\r\n sortedVirtualRefinerConfig &&\r\n sortedVirtualRefinerConfig.forEach(sortedConfig => {\r\n appConfigRefinerNames.push(sortedConfig.refinerName.trim().toLowerCase());\r\n });\r\n\r\n return appConfigRefinerNames;\r\n};\r\n\r\n/**\r\n * This will return the value of virtual refiner configuration\r\n * @param requestContext\r\n * @returns IVirtualRefinersConfig[] | undefined\r\n */\r\nexport const getVirtualRefinerConfig = (requestContext: IRequestContext): IVirtualRefinersConfig[] => {\r\n return requestContext.app.config.urlModifications;\r\n};\r\n\r\nexport async function getVirtualRefinerValues(\r\n requestContext: IRequestContext,\r\n virtualRefiners: IProductRefinerHierarchy[]\r\n): Promise {\r\n const virtualRefinerValues: ProductRefinerValue[] = [];\r\n if (virtualRefiners.length === 0) {\r\n return virtualRefinerValues;\r\n }\r\n const requestUrl = requestContext.url.requestUrl;\r\n // const origin = requestUrl.origin;\r\n const path = requestUrl.pathname;\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('/').splice(1);\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n // remove category id {categoryid}.c\r\n const categoryIdToken = requestContext.urlTokens.recordId;\r\n const categoryId = categoryIdToken ? `${categoryIdToken}.c` : undefined;\r\n\r\n if (categoryId) {\r\n urlParts.splice(-1);\r\n }\r\n\r\n // run loop for each url part and get values from refiners for further usage\r\n const finalizedUrlParts: string[] = [];\r\n urlParts.forEach(plainUrlPart => {\r\n const urlPart = decodeURIComponent(plainUrlPart);\r\n if (urlPart.indexOf('|') !== -1) {\r\n const splitOnPipeSign = urlPart?.split('|');\r\n const filteredParts = splitOnPipeSign.filter(part => part.length > 0);\r\n filteredParts.forEach(filteredPart => {\r\n finalizedUrlParts.push(filteredPart.toLowerCase().trim());\r\n });\r\n }\r\n finalizedUrlParts.push(urlPart);\r\n });\r\n finalizedUrlParts.forEach((urlPart) => {\r\n virtualRefiners.forEach((mainRefiner) => {\r\n mainRefiner.Values.forEach((refinerValue) => {\r\n const refinerValueKeyName = refinerValue.LeftValueBoundString?.toLowerCase().trim().split(' ')?.join('-').replace(/\\&/g, 'and').replace(regExSpecialChars(requestContext.app.config.canonicalUrlspecialCharIncludeList), '-');\r\n if (refinerValueKeyName && refinerValueKeyName === urlPart) {\r\n virtualRefinerValues.push(refinerValue);\r\n }\r\n });\r\n });\r\n });\r\n\r\n return virtualRefinerValues;\r\n}\r\n\r\n/**\r\n * For navigation menu links, it will remove keywords configured in global configurations from the navigation link\r\n * and clp link and return url path string\r\n * @param link\r\n * @param requestContext\r\n * @returns string\r\n */\r\nexport const navLinkKeywordRemoval = (link: string, requestContext: IRequestContext): string => {\r\n // Using the rest operator in case there is a weirdly formatted URL with multiple question marks.\r\n const [linkBase, ...linkParams] = link?.split('?');\r\n\r\n // Only apply to category links and product links, which end in .c or .p. Check that a keyword is configured.\r\n if (!linkBase.endsWith('.c') && !linkBase.endsWith('.p') || !requestContext.app.config) {\r\n return link;\r\n }\r\n\r\n // Separate out url parts split on forward /\r\n let urlParts = linkBase?.split('\\/');\r\n\r\n // Remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n // Glue the URL params back together\r\n const linkParam = linkParams.map(param => `?${param}`)?.join('');\r\n\r\n // Rebuild URL by joining with forward slash and appending any URL parameters\r\n const filteredLink = `${urlParts?.join('/')}${linkParam}`;\r\n return `${filteredLink}`;\r\n};\r\nexport const regExSpecialChars = (includeConfigList: string): RegExp => {\r\n let includeConfig = '';\r\n if (includeConfigList !== undefined && includeConfigList !== '') {\r\n includeConfig = includeConfigList?.trim().split(',')?.join('\\\\\\\\');\r\n includeConfig = includeConfig && includeConfig !== '' ? `\\\\\\\\${includeConfig}` : '';\r\n const pattern = `[^\\\\w\\\\&\\\\|${includeConfig}]`;\r\n return new RegExp(pattern, 'gi');\r\n } else {\r\n\r\n const pattern = `[^\\\\w\\\\&\\\\|]`;\r\n return new RegExp(pattern, 'gi');\r\n }\r\n};\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { 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","// tslint:disable\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as Entities from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n/**\r\n * MFITryInStore entity interface.\r\n */\r\nexport interface IMFITryInStore {\r\n ZipCode?: string;\r\n StoreId: string;\r\n Products?: string;\r\n Limit: number;\r\n Radius: number;\r\n ExtensionProperties?: Entities.CommerceProperty[];\r\n}\r\n\r\n/**\r\n * MFITryInStoreInfoResponse entity interface.\r\n */\r\nexport interface IMFITryInStoreInfoResponse {\r\n Status?: string;\r\n Message?: string;\r\n StoreId?: string;\r\n Inventory?: string[];\r\n}\r\n\r\n/**\r\n * MFITryInStore entity class.\r\n */\r\nexport class MFITryInStoreExtensionClass implements IMFITryInStore {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ZipCode: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public StoreId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Products: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Limit: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Radius: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ExtensionProperties: Entities.CommerceProperty[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ZipCode = odataObject.ZipCode;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.StoreId = odataObject.StoreId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Products = odataObject.Products;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Limit = odataObject.Limit;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Radius = odataObject.Radius;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties = undefined;\r\n if (odataObject.ExtensionProperties) {\r\n this.ExtensionProperties = [];\r\n for (let i = 0; i < odataObject.ExtensionProperties.length; i++) {\r\n if (odataObject.ExtensionProperties[i]) {\r\n if (odataObject.ExtensionProperties[i]['@odata.type']) {\r\n let className: string = odataObject.ExtensionProperties[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.ExtensionProperties[i] = new EntityClasses[className](odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n this.ExtensionProperties[i] = new EntityClasses.CommercePropertyClass(odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * MFITryInStoreInfoResponse entity class.\r\n */\r\nexport class MFITryInStoreInfoResponseExtensionClass implements IMFITryInStoreInfoResponse {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Status: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Message: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public StoreId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Inventory: string[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Status = odataObject.Status;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Message = odataObject.Message;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.StoreId = odataObject.StoreId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Inventory = undefined;\r\n if (odataObject.Inventory) {\r\n this.Inventory = [];\r\n for (let i = 0; i < odataObject.Inventory.length; i++) {\r\n if (odataObject.Inventory[i]) {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Inventory[i] = odataObject.Inventory[i];\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Inventory[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n * THIS FILE IS AN AUTOGENERATED TYPESCRIPT PROXY EXTENSION.\r\n * TO USE THIS FILE, IT MUST BE ADDED TO A D365COMMERCE APPLICATION\r\n */\r\n// tslint:disable\r\nimport { AsyncResult, callActionOrExecute, DataServiceQuery, IContext, IDataServiceRequest } from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as DataServiceEntities from './TryInStoreDataServiceEntities.g';\r\n\r\n// @ts-ignore\r\nfunction tryInStoresQuery(storeId?: string): DataServiceQuery {\r\n const key = storeId ? { StoreId: storeId } : null;\r\n return new DataServiceQuery('TryInStores', 'MFITryInStore', DataServiceEntities.MFITryInStoreExtensionClass, key);\r\n}\r\n\r\nexport function createMFIGetTryInStoreInfoInput(tryInStoreProductIDs: DataServiceEntities.IMFITryInStore): IDataServiceRequest {\r\n const query = tryInStoresQuery();\r\n return query.createDataServiceRequestForOperation(\r\n 'MFIGetTryInStoreInfo',\r\n true,\r\n DataServiceEntities.MFITryInStoreInfoResponseExtensionClass,\r\n 'false',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IMFITryInStoreInfoResponse' },\r\n { tryInStoreProductIDs: tryInStoreProductIDs }\r\n );\r\n}\r\n\r\nexport function mFIGetTryInStoreInfoAsync(\r\n context: IContext,\r\n tryInStoreProductIDs: DataServiceEntities.IMFITryInStore\r\n): AsyncResult {\r\n const request = createMFIGetTryInStoreInfoInput(tryInStoreProductIDs);\r\n return callActionOrExecute(request, context.callerContext);\r\n}\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { mFIGetTryInStoreInfoAsync } from './TryInStoreDataActionExtension.g';\r\nimport { IMFITryInStore, IMFITryInStoreInfoResponse } from './TryInStoreDataServiceEntities.g';\r\n\r\n/**\r\n * GetTryInStoreInfo Input Action\r\n */\r\n\r\nexport class GetTryInStoreInfoInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public input: IMFITryInStore;\r\n constructor(input: IMFITryInStore) {\r\n this.input = input;\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 `Try-In-Store${this.input.StoreId}-${this.input.ZipCode}-${this.input.Radius}-${this.input.Limit}-${this.input.Products}`;\r\n public getCacheObjectType = () => 'GetTryInStoreInfo';\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\n// const createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n// return new GetTryInStoreInfoInput();\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 getTryInStoreAction(\r\n request: GetTryInStoreInfoInput,\r\n ctx: Msdyn365.IActionContext\r\n): Promise {\r\n if (request.input) {\r\n try {\r\n const result = await mFIGetTryInStoreInfoAsync({ 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 {};\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getTryInStoreAction,\r\n // TODO: Give your data action a unique id\r\n id: 'GetTryInStoreInfo'\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 { getByIdAsync, getVariantsByDimensionValuesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n// tslint:disable-next-line: completed-docs\r\nexport class BuyboxGetDimensionVariantAvailabilityInput implements IActionInput {\r\n public channelId: number;\r\n public productId: number;\r\n constructor(productId: number, channelId: number) {\r\n this.channelId = channelId;\r\n this.productId = productId;\r\n }\r\n public getCacheKey = () => `AllMFRMProductVariantIDs-${this.productId}`;\r\n public getCacheObjectType = () => 'AllMFRMProductVariantIDs';\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\nexport interface IBuyboxGetDimensionVariantAvailabilityActionData {\r\n variantID: number;\r\n dimensionRecordID: number;\r\n itemID: string;\r\n sizeValue: string;\r\n isAvailable: boolean;\r\n}\r\n\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n if (inputData && inputData.requestContext && inputData.requestContext.query && inputData.requestContext.query.productId) {\r\n return new BuyboxGetDimensionVariantAvailabilityInput(\r\n +inputData.requestContext.query.productId,\r\n +inputData.requestContext.apiSettings.channelId\r\n );\r\n } else if (inputData && inputData.requestContext && inputData.requestContext.urlTokens && inputData.requestContext.urlTokens.itemId) {\r\n return new BuyboxGetDimensionVariantAvailabilityInput(\r\n +inputData.requestContext.urlTokens.itemId,\r\n +inputData.requestContext.apiSettings.channelId\r\n );\r\n } else if (inputData && inputData.config && inputData.config.productId) {\r\n return new BuyboxGetDimensionVariantAvailabilityInput(inputData.config.productId, inputData.requestContext.apiSettings.channelId);\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\nexport async function getAllVariantsForProduct(\r\n input: BuyboxGetDimensionVariantAvailabilityInput,\r\n ctx: IActionContext\r\n): Promise {\r\n const productResponse = await getByIdAsync(\r\n { callerContext: ctx, queryResultSettings: { Paging: { Top: 1 } } },\r\n input.productId,\r\n input.channelId\r\n );\r\n const baseProduct = Array.isArray(productResponse) ? productResponse[0] : productResponse;\r\n try {\r\n return await getVariantsByDimensionValuesAsync(\r\n { callerContext: ctx, queryResultSettings: { Paging: { Top: 500 } } },\r\n baseProduct.MasterProductId || input.productId,\r\n input.channelId,\r\n []\r\n );\r\n } catch (error) {\r\n ctx.telemetry.exception(error);\r\n throw new Error('[IBuyboxGetDimensionPricingActionData]Unable to retieve data');\r\n }\r\n}\r\n\r\nexport default createObservableDataAction({\r\n action: >getAllVariantsForProduct,\r\n input: createInput\r\n});\r\n","import { IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\r\nimport { IMFIAvailablePromotionDescription, IMFIItem } from '../actions/EyebrowMessageDataServiceEntities.g';\r\nimport getEyebrowAction, { GetEyebrowMessageInput } from '../actions/get-eyebrow-message.action';\r\n\r\nconst _getEyebrowMessage = async (products: IMFIItem[], context: ICoreContext>, isCached?: boolean, pageType?: string) => {\r\n const priceGroupForAPICall = context.app && context.app.config.priceGroup;\r\n if (products?.length > 0 && priceGroupForAPICall) {\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, pageType, isCached);\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 default _getEyebrowMessage;\r\n","import { IBuyboxCommonResources } from '@msdyn365-commerce-modules/buybox';\r\nimport { IAddToCartFailureResult } from '@msdyn365-commerce/components';\r\nimport { IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport { OrgUnitLocation, ProductAvailableQuantity, ProductDimension, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\nexport function getQuantityError(stockLeft: number | undefined, resources: IBuyboxCommonResources): string | undefined {\r\n if (!stockLeft || stockLeft <= 0) {\r\n return resources.errorMessageOutOfStock;\r\n } else if (stockLeft === 1) {\r\n return resources.errorMessageOutOfRangeOneLeft;\r\n } else {\r\n return resources.errorMessageOutOfRangeFormat.replace('{numLeft}', stockLeft.toString());\r\n }\r\n}\r\n\r\n// tslint:disable-next-line:cyclomatic-complexity\r\nexport function getGenericError(\r\n result: IAddToCartFailureResult,\r\n cart: ICartState | undefined,\r\n resources: IBuyboxCommonResources,\r\n context: ICoreContext>,\r\n product: SimpleProduct | undefined,\r\n productAvailability: ProductAvailableQuantity | undefined,\r\n location: OrgUnitLocation | undefined)\r\n : string | undefined {\r\n if (result.failureReason === 'EMPTYINPUT') {\r\n return resources.addedToCartFailureMessage;\r\n } else if (result.failureReason === 'CARTACTIONFAILED') {\r\n if (result.cartActionResult && result.cartActionResult.substatus === 'MAXQUANTITY') {\r\n // get the quantity of the product in cart\r\n let elementFoundAt: number = -1;\r\n const productIdToFind = product?.RecordId;\r\n\r\n for (let i = 0; i < cart!.cart.CartLines!.length; i++) {\r\n if (cart!.cart.CartLines![i].ProductId === productIdToFind &&\r\n (cart!.cart.CartLines![i].DeliveryMode || '') === (location && context.actionContext.requestContext.channel?.PickupDeliveryModeCode || '') &&\r\n (cart!.cart.CartLines![i].FulfillmentStoreId || '') === (location?.OrgUnitNumber || '')) {\r\n elementFoundAt = i;\r\n\r\n break;\r\n }\r\n }\r\n\r\n let curQuantity: number = 0;\r\n\r\n if (elementFoundAt !== -1) {\r\n const cartLineToUpdate = { ...cart!.cart.CartLines![elementFoundAt] };\r\n curQuantity = cartLineToUpdate.Quantity || 0;\r\n }\r\n\r\n // get the quantity limit for the product\r\n const maxQuantityForCartLineItem = context.app.config.maxQuantityForCartLineItem;\r\n const availableQty = productAvailability?.AvailableQuantity;\r\n\r\n let quantityLimit: number;\r\n\r\n if (maxQuantityForCartLineItem === undefined && availableQty === undefined) {\r\n quantityLimit = 10;\r\n } else if (availableQty === undefined) {\r\n quantityLimit = maxQuantityForCartLineItem;\r\n } else if (maxQuantityForCartLineItem === undefined) {\r\n quantityLimit = availableQty;\r\n } else {\r\n quantityLimit = Math.min(maxQuantityForCartLineItem, availableQty);\r\n }\r\n\r\n return resources.maxQuantityLimitText.replace('{curQuantity}', curQuantity.toString()).replace('{maxQuantity}', quantityLimit.toString());\r\n } else if (result.cartActionResult && (result.cartActionResult.substatus === 'QUANTITYLIMITS' || result.cartActionResult.substatus === 'INVOICEINCART')) {\r\n return result.cartActionResult?.errorDetails?.LocalizedMessage;\r\n }\r\n\r\n return resources.addedToCartFailureMessage;\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\nexport function getConfigureErrors(result: ProductDimension[] | undefined, resources: IBuyboxCommonResources, isGiftCard?: Boolean): { [configureId: string]: string | undefined } {\r\n if (!result) {\r\n return {};\r\n }\r\n\r\n const dimensions: { [configureId: string]: string | undefined } = {};\r\n\r\n result.forEach(dimension => {\r\n dimensions[dimension.DimensionTypeValue] = getDimensionErrorString(dimension.DimensionTypeValue, resources, isGiftCard);\r\n });\r\n\r\n return dimensions;\r\n}\r\n\r\nexport function getDimensionErrorString(dimensionTypeValue: number, resources: IBuyboxCommonResources, isGiftCard?: Boolean): string {\r\n switch (dimensionTypeValue) {\r\n case 1: // ProductDimensionType.Color\r\n return resources.productDimensionTypeColorErrorMessage;\r\n case 2: // ProductDimensionType.Configuration\r\n return resources.productDimensionTypeConfigurationErrorMessage;\r\n case 3: // ProductDimensionType.Size\r\n return resources.productDimensionTypeSizeErrorMessage;\r\n case 4: // ProductDimensionType.Style\r\n return isGiftCard ? resources.productDimensionTypeAmountErrorMessage : resources.productDimensionTypeStyleErrorMessage;\r\n default:\r\n return '';\r\n }\r\n}","import { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { Alert, Button, format, getPayloadObject, getTelemetryAttributes, getTelemetryObject, Heading, ITelemetryContent, Node, Quantity, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\r\nimport {\r\n AddToCartComponent, AddToOrderTemplateComponent, AddToWishlistComponent, IAddToCartFailureResult, IAddToCartResources, IAddToOrderTemplateDialogResources,\r\n IDuplicateItemsWhenAddingToOrderTemplateDialogResources, IItemAddedToOrderTemplateDialogResources, IOrderTemplateActionErrorResult, IOrderTemplateNameDialogResources, IWishlistActionErrorResult,\r\n PriceComponent, RatingComponent\r\n} from '@msdyn365-commerce/components';\r\nimport MSDyn365, { getUrlSync, IImageSettings } from '@msdyn365-commerce/core';\r\nimport { ICartActionResult } from '@msdyn365-commerce/global-state';\r\nimport * as React from 'react';\r\nimport { getConfigureErrors, getGenericError, getQuantityError } from './utilities/error-utilities';\r\n\r\nimport {\r\n IBuyboxAddToCartViewProps, IBuyboxAddToOrderTemplateViewProps, IBuyboxAddToWishlistViewProps, IBuyboxCallbacks, IBuyboxCommonData, IBuyboxCommonResources,\r\n IBuyboxErrorBlockProps, IBuyboxExtentedProps, IBuyboxKeyInPriceViewProps, IBuyboxProductQuantityViewProps, IBuyboxShopSimilarLookViewProps, IBuyboxState,\r\n IProductDetails, ShopSimiliarButtonType\r\n} from '@msdyn365-commerce-modules/buybox';\r\n\r\nexport function getBuyBoxInventoryLabel(props: IBuyboxExtentedProps, productDetails?: IProductDetails): React.ReactElement | undefined {\r\n const { typeName } = props;\r\n const productAvailableQuantity = props.data.productAvailableQuantity?.result ? props.data.productAvailableQuantity?.result : productDetails?.productAvailableQuantity!;\r\n\r\n const className = _getClassNamePrefix(typeName);\r\n if (!productAvailableQuantity || !productAvailableQuantity.length) {\r\n return undefined;\r\n }\r\n if (productAvailableQuantity &&\r\n productAvailableQuantity.length &&\r\n productAvailableQuantity[0].StockLevelLabel) {\r\n const inventoryClassName = productAvailableQuantity[0].StockLevelCode ?\r\n `${className}__inventory-label ${className}__inventory-code-${productAvailableQuantity[0].StockLevelCode.toLowerCase()}` :\r\n `${className}__inventory-label`;\r\n return (
{productAvailableQuantity[0].StockLevelLabel}
);\r\n }\r\n\r\n return undefined;\r\n\r\n}\r\n\r\nexport function getBuyboxProductTitle(props: IBuyboxExtentedProps, productDetails?: IProductDetails, brandName?: string): React.ReactElement | undefined {\r\n const {\r\n config: { titleHeadingTag = 'h1' },\r\n typeName\r\n } = props;\r\n const className = typeName && _getClassNamePrefix(typeName);\r\n\r\n const product = props.data.product?.result ? props.data.product.result : productDetails?.product!;\r\n const title = brandName ? `${brandName} ${product.Name}` : product.Name;\r\n return product && (\r\n \r\n );\r\n}\r\n\r\nexport function getBuyboxProductDescription(props: IBuyboxExtentedProps, productDetails?: IProductDetails): React.ReactElement | undefined {\r\n const { typeName } = props;\r\n const className = _getClassNamePrefix(typeName);\r\n const product = props.data.product?.result ? props.data.product?.result : productDetails?.product!;\r\n\r\n return product && (\r\n

{product.Description}

\r\n );\r\n}\r\n\r\nlet telemetryContent: ITelemetryContent;\r\n\r\n// tslint:disable-next-line:max-func-body-length\r\nexport function getBuyboxAddToCart(props: IBuyboxExtentedProps, state: IBuyboxState, callbacks: IBuyboxCallbacks,\r\n defaultMinimumKeyInPrice: number, defaultMaximumKeyInPrice: number, productDetails?: IProductDetails): IBuyboxAddToCartViewProps {\r\n const {\r\n id,\r\n typeName,\r\n context,\r\n resources,\r\n config: { minimumKeyInPrice, maximumKeyInPrice }\r\n } = props;\r\n\r\n const product = props.data?.product?.result ? props.data.product.result : productDetails?.product!;\r\n const cart = props.data?.cart?.result ? props.data.cart.result : productDetails?.cart!;\r\n const productAvailableQuantity = props.data?.productAvailableQuantity?.result ? props.data.productAvailableQuantity.result : productDetails?.productAvailableQuantity!;\r\n\r\n const {\r\n quantity,\r\n errorState: {\r\n configureErrors,\r\n quantityError,\r\n customAmountError,\r\n otherError,\r\n errorHost\r\n },\r\n selectedProduct,\r\n isUpdatingDimension,\r\n isUpdatingDeliveryOptions,\r\n isServiceItem,\r\n keyInPriceAmount\r\n } = state;\r\n\r\n const productAvailability = state.productAvailableQuantity ?\r\n state.productAvailableQuantity.ProductAvailableQuantity :\r\n productAvailableQuantity && productAvailableQuantity.length ?\r\n productAvailableQuantity[0].ProductAvailableQuantity : undefined;\r\n\r\n const onAddToCartFailed = (result: IAddToCartFailureResult) => {\r\n let quantityErrorForState: string | undefined;\r\n let customAmountErrorForState: string | undefined;\r\n let otherErrorForState: string | undefined = getGenericError(result, cart, resources, context, product, productAvailability, undefined);\r\n\r\n if (result?.failureReason === 'OUTOFSTOCK') {\r\n quantityErrorForState = result.failureReason === 'OUTOFSTOCK' ? getQuantityError(result.stockLeft, resources) : undefined;\r\n } else if (result && result.failureReason === 'CARTACTIONFAILED'\r\n && result.cartActionResult\r\n && (result.cartActionResult.substatus === 'MAXQUANTITY' || result.cartActionResult?.substatus === 'QUANTITYLIMITS')) {\r\n quantityErrorForState = getGenericError(result, cart, resources, context, product, productAvailability, undefined);\r\n otherErrorForState = undefined; // prevent error duplication in otherError and quantityError\r\n }\r\n\r\n if (result?.failureReason === 'INVALIDCUSTOMAMOUNT') {\r\n if (keyInPriceAmount === undefined || keyInPriceAmount < (minimumKeyInPrice || defaultMinimumKeyInPrice)) {\r\n const formatedAmountLimit = props.context.cultureFormatter?.formatCurrency(minimumKeyInPrice || defaultMinimumKeyInPrice);\r\n customAmountErrorForState = resources.invalidSmallCustomAmountText?.replace('{minAmount}', formatedAmountLimit);\r\n } else if (keyInPriceAmount > (maximumKeyInPrice || defaultMaximumKeyInPrice)) {\r\n const formatedAmountLimit = props.context.cultureFormatter?.formatCurrency(maximumKeyInPrice || defaultMaximumKeyInPrice);\r\n customAmountErrorForState = resources.invalidLargeCustomAmountText?.replace('{maxAmount}', formatedAmountLimit);\r\n }\r\n }\r\n\r\n callbacks.updateErrorState({\r\n errorHost: 'ADDTOCART',\r\n quantityError: quantityErrorForState,\r\n configureErrors: result?.failureReason === 'MISSINGDIMENSION' ? getConfigureErrors(result?.missingDimensions, resources, product?.IsGiftCard) : {},\r\n customAmountError: customAmountErrorForState,\r\n otherError: otherErrorForState\r\n });\r\n };\r\n\r\n const dialogStrings: IAddToCartResources = {\r\n goToCartText: resources.buyBoxGoToCartText,\r\n continueShoppingText: resources.buyBoxContinueShoppingText,\r\n headerItemOneText: resources.buyBoxSingleItemText,\r\n headerItemFormatText: resources.buyBoxMultiLineItemFormatText,\r\n headerMessageText: resources.buyBoxHeaderMessageText,\r\n freePriceText: resources.priceFree,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText,\r\n addedQuantityText: resources.addedQuantityText,\r\n closeNotificationLabel: resources.closeNotificationLabel\r\n };\r\n\r\n const defaultImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: `w=240&h=240&m=6`, w: 0, h: 0 },\r\n lg: { q: `w=240&h=240&m=6`, w: 0, h: 0 },\r\n xl: { q: `w=240&h=240&m=6`, w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n };\r\n\r\n const isLoading = typeName !== 'quickview' && props.data.productAvailableQuantity?.status === 'LOADING';\r\n if (isLoading) {\r\n callbacks.changeUpdatingDimension(false);\r\n }\r\n\r\n const isLoadingDeliveryOptions = typeName !== 'quickview' && props.data.deliveryOptions?.status === 'LOADING';\r\n if (isLoadingDeliveryOptions && callbacks.changeUpdatingDeliveryOptions) {\r\n callbacks.changeUpdatingDeliveryOptions(false);\r\n }\r\n\r\n telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.typeName, props.telemetry);\r\n\r\n // check if the product delivery mode is electronic\r\n const emailDeliveryModeCode = props.context.actionContext.requestContext.channel?.EmailDeliveryModeCode;\r\n const deliveryOptions = props.data.deliveryOptions?.result;\r\n const isEmailDelivery = ArrayExtensions.hasElements(deliveryOptions?.DeliveryOptions) && deliveryOptions!.DeliveryOptions[0].Code === emailDeliveryModeCode;\r\n const className = _getClassNamePrefix(typeName);\r\n\r\n const onItemAddedToCart = (result: ICartActionResult) => {\r\n if (typeName === 'quickview') {\r\n callbacks.changeModalOpen(false);\r\n }\r\n };\r\n\r\n return {\r\n ContainerProps: {\r\n className: `${className}__add-to-cart-container`\r\n },\r\n button: product && (\r\n \r\n ),\r\n errorBlock: (\r\n \r\n )\r\n };\r\n}\r\n\r\nexport function getBuyboxProductPrice(props: IBuyboxExtentedProps, state: IBuyboxState): React.ReactElement | undefined {\r\n const {\r\n id,\r\n typeName,\r\n context,\r\n resources\r\n } = props;\r\n\r\n return state.productPrice && (\r\n \r\n );\r\n}\r\n\r\nexport function getBuyboxProductRating(props: IBuyboxExtentedProps, productDetails?: IProductDetails): React.ReactElement | undefined {\r\n const {\r\n id,\r\n typeName,\r\n context,\r\n resources\r\n } = props;\r\n\r\n const ratingsSummary = props.data.ratingsSummary?.result ? props.data.ratingsSummary?.result : productDetails?.ratingsSummary!;\r\n\r\n const ratingComponent = ratingsSummary?.averageRating && (\r\n \r\n ) || undefined;\r\n\r\n return ratingsSummary && ratingComponent && (\r\n ratingComponent\r\n );\r\n}\r\n\r\nfunction generateAddToOrderTemplateDialogResources(resources: IBuyboxCommonResources): 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\nfunction generateOrderTemplateNameDialogResources(resources: IBuyboxCommonResources): 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\r\nfunction generateItemAddedToOrderTemplateDialogResources(resources: IBuyboxCommonResources): 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.priceFree,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText\r\n };\r\n}\r\n\r\nfunction generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(resources: IBuyboxCommonResources): 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\nexport function getBuyboxProductAddToOrderTemplate(props: IBuyboxExtentedProps, state: IBuyboxState, callbacks: IBuyboxCallbacks): IBuyboxAddToOrderTemplateViewProps | undefined {\r\n const {\r\n id,\r\n typeName,\r\n context,\r\n data: {\r\n product: { result: product },\r\n orderTemplates: { result: orderTemplates },\r\n customerInformation: { result: customerInformation }\r\n },\r\n resources\r\n } = props;\r\n\r\n const\r\n {\r\n errorState: {\r\n configureErrors,\r\n quantityError,\r\n customAmountError,\r\n otherError,\r\n errorHost\r\n },\r\n quantity\r\n } = state;\r\n\r\n // If custom amount is selected, add-to-orderTemplate is disabled\r\n if (state.isCustomPriceSelected) {\r\n return undefined;\r\n }\r\n const className = _getClassNamePrefix(typeName);\r\n const onAddToOrderTemplateFailed = (result: IOrderTemplateActionErrorResult) => {\r\n callbacks.updateErrorState({\r\n errorHost: 'ORDER_TEMPLATE',\r\n configureErrors: result?.status === 'MISSING_DIMENSION' ? getConfigureErrors(result?.missingDimensions, resources, product?.IsGiftCard) : {}\r\n });\r\n };\r\n\r\n return {\r\n ContainerProps: {\r\n className: `${className}__add-to-order-template-container`\r\n },\r\n button: product && orderTemplates && (\r\n \r\n ),\r\n errorBlock: (\r\n \r\n )\r\n };\r\n}\r\n\r\nexport function getBuyboxProductAddToWishlist(props: IBuyboxExtentedProps, state: IBuyboxState, callbacks: IBuyboxCallbacks, productDetails?: IProductDetails): IBuyboxAddToWishlistViewProps | undefined {\r\n const {\r\n id,\r\n typeName,\r\n context,\r\n data: {\r\n wishlists: { result: wishlists }\r\n },\r\n resources\r\n } = props;\r\n\r\n const product = props.data.product?.result ? props.data.product?.result : productDetails?.product!;\r\n\r\n const\r\n {\r\n errorState: {\r\n configureErrors,\r\n quantityError,\r\n customAmountError,\r\n otherError,\r\n errorHost\r\n },\r\n selectedProduct\r\n } = state;\r\n\r\n // If custom amount is selected, add-to-wishlist is disabled\r\n if (state.isCustomPriceSelected) {\r\n return undefined;\r\n }\r\n\r\n const onAddToWishlistFailed = (result: IWishlistActionErrorResult) => {\r\n callbacks.updateErrorState({\r\n errorHost: 'WISHLIST',\r\n configureErrors: result?.status === 'MISSINGDIMENSION' ? getConfigureErrors(result?.missingDimensions, resources, product?.IsGiftCard) : {}\r\n });\r\n };\r\n const className = _getClassNamePrefix(typeName);\r\n\r\n return {\r\n ContainerProps: {\r\n className: `${className}__add-to-wishlist-container`\r\n },\r\n button: product && (\r\n \r\n ),\r\n errorBlock: (\r\n \r\n )\r\n };\r\n}\r\n\r\nexport function getBuyboxProductQuantity(props: IBuyboxExtentedProps, state: IBuyboxState, callbacks: IBuyboxCallbacks): IBuyboxProductQuantityViewProps {\r\n const {\r\n resources,\r\n typeName\r\n } = props;\r\n\r\n const\r\n {\r\n quantity,\r\n max,\r\n errorState: {\r\n quantityError\r\n }\r\n } = state;\r\n\r\n const onChange = (newValue: number) => {\r\n if (callbacks.updateQuantity) {\r\n callbacks.updateQuantity(newValue);\r\n }\r\n };\r\n const className = _getClassNamePrefix(typeName);\r\n\r\n return {\r\n ContainerProps: {\r\n className: `${className}__quantity`\r\n },\r\n LabelContainerProps: {\r\n tag: 'label',\r\n className: `${className}__product-quantity-label`,\r\n htmlFor: `${className}__product-quantity-input`\r\n },\r\n heading: (\r\n
{resources.productQuantityHeading}
\r\n ),\r\n errors: quantityError && (\r\n \r\n \r\n ),\r\n input: (\r\n \r\n )\r\n };\r\n}\r\n\r\nexport function getBuyboxShopSimilarButton(props: IBuyboxExtentedProps, buttonType: ShopSimiliarButtonType): IBuyboxShopSimilarLookViewProps {\r\n const {\r\n resources,\r\n context,\r\n data: {\r\n product: { result: product }\r\n },\r\n typeName\r\n } = props;\r\n\r\n const className = _getClassNamePrefix(typeName);\r\n const navigationUrl = (shopSimiliarButtonType: ShopSimiliarButtonType) => () => {\r\n const searchURL = getUrlSync('search', context?.actionContext);\r\n const separator = searchURL!.includes('?') ? '&' : '?';\r\n if (MSDyn365.isBrowser) {\r\n document.location.href = `${searchURL}${separator}productId=${product?.RecordId}&recommendation=${shopSimiliarButtonType}`;\r\n }\r\n };\r\n const telemetryText = buttonType === ShopSimiliarButtonType.Looks ? TelemetryConstant.ShopSimliarLooks : TelemetryConstant.ShopSimliarDescription;\r\n const payLoad = getPayloadObject('click', telemetryContent, telemetryText);\r\n const attribute = getTelemetryAttributes(telemetryContent, payLoad);\r\n const text = buttonType === ShopSimiliarButtonType.Looks ? resources.shopSimilarLooksText : resources.shopSimilarDescriptionText;\r\n\r\n return {\r\n ContainerProps: {\r\n className: `${className}__shopsimilar${buttonType}`\r\n },\r\n input: (\r\n \r\n {text}\r\n \r\n )\r\n };\r\n}\r\n\r\nexport function getBuyboxKeyInPrice(props: IBuyboxExtentedProps, state: IBuyboxState, callbacks: IBuyboxCallbacks): IBuyboxKeyInPriceViewProps {\r\n const {\r\n config,\r\n resources\r\n } = props;\r\n\r\n const\r\n {\r\n errorState: { }\r\n } = state;\r\n\r\n const className = _getClassNamePrefix(props.typeName);\r\n const onChange = (e: React.ChangeEvent) => {\r\n const value = e.currentTarget.value;\r\n callbacks.updateKeyInPrice(value.length ? Number(value) : parseFloat(value));\r\n };\r\n\r\n return {\r\n ContainerProps: {\r\n className: `${className}__key_in_price`\r\n },\r\n LabelContainerProps: {\r\n tag: 'label',\r\n className: `${className}__key_in_price-label`,\r\n htmlFor: `${className}__key_in_price`\r\n },\r\n heading: (\r\n
{resources.buyboxKeyInPriceLabelHeading}
\r\n ),\r\n input: (\r\n \r\n )\r\n };\r\n\r\n}\r\n\r\nexport const BuyboxErrorBlock: React.FC = ({ showError, configureErrors, quantityError, customAmountError, otherError, resources }) => {\r\n let errorMessages: (string | undefined)[] = [];\r\n\r\n errorMessages = Object.values(configureErrors).filter(message => message !== undefined);\r\n\r\n if (quantityError) {\r\n errorMessages.push(quantityError);\r\n }\r\n\r\n if (customAmountError) {\r\n errorMessages.push(customAmountError);\r\n }\r\n\r\n if (otherError) {\r\n errorMessages.push(otherError);\r\n }\r\n\r\n return (\r\n 0} color='danger' assertive={true} aria-label={resources.buyboxErrorMessageHeader} >\r\n \r\n {errorMessages.map((message, index) => {\r\n return (\r\n
{message}
\r\n );\r\n })}\r\n
\r\n );\r\n};\r\n\r\nexport function getQuantityLimitsMessages(props: IBuyboxExtentedProps, state: IBuyboxState): React.ReactElement | undefined {\r\n const {\r\n resources\r\n } = props;\r\n\r\n const\r\n {\r\n min,\r\n max\r\n } = state;\r\n\r\n if (!_isOrderQuantityLimitsFeatureEnabled(props)) {\r\n return undefined;\r\n }\r\n\r\n return (\r\n \r\n {_renderMaxLabel(max, resources.maxQuantityText)}\r\n {_renderMinLabel(min, resources.minQuantityText)}\r\n \r\n );\r\n}\r\n\r\nexport const RetailDefaultOrderQuantityLimitsFeatureName: string = 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature';\r\n\r\nconst _renderMaxLabel = (max: number | undefined, maxQuantityText: string, typeName?: string): React.ReactElement | undefined => {\r\n const className = _getClassNamePrefix(typeName ? typeName : '');\r\n if (max && max !== 0 && max !== Number.MAX_VALUE) {\r\n return (\r\n

\r\n {maxQuantityText?.replace('{max}', max.toString())}\r\n

\r\n );\r\n } else {\r\n return undefined;\r\n }\r\n};\r\n\r\nconst _renderMinLabel = (min: number | undefined, minQuantityText: string, typeName?: string): JSX.Element | undefined => {\r\n const className = _getClassNamePrefix(typeName ? typeName : '');\r\n if (min && min > 1) {\r\n return (\r\n

\r\n {minQuantityText?.replace('{min}', min.toString())}\r\n

\r\n );\r\n } else {\r\n return undefined;\r\n }\r\n};\r\n\r\nconst _isOrderQuantityLimitsFeatureEnabled = (props: IBuyboxExtentedProps): boolean | undefined => {\r\n const defaultOrderQuantityLimitsFeatureConfig = props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'none') {\r\n return false;\r\n }\r\n\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\r\n return true;\r\n }\r\n\r\n const customerInfo = props.data.customerInformation.result;\r\n return customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b));\r\n};\r\n\r\nconst _getClassNamePrefix = (typeName: string | undefined): string => {\r\n return typeName?.toLowerCase() === 'quickview' ? 'ms-quickView' : 'ms-buybox';\r\n};\r\n","/* tslint:disable: no-duplicate-imports */\r\nimport { IBuyboxCallbacks, IBuyboxState } from '@msdyn365-commerce-modules/buybox';\r\nimport { NotificationsManager } from '@msdyn365-commerce-modules/notifications-core';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getTelemetryObject, Heading, INodeProps, IPopupProps, Popup } from '@msdyn365-commerce-modules/utilities';\r\nimport { AddToCartBehavior, IAddToCartFailureResult, IAddToCartResources, ItemSuccessfullyAddedToCartNotification, PriceComponent } from '@msdyn365-commerce/components';\r\nimport MsDyn365, { getUrlSync, IImageSettings } from '@msdyn365-commerce/core';\r\nimport { DeliveryOption, OrgUnitLocation, ProductDimension } from '@msdyn365-commerce/retail-proxy';\r\nimport * as React from 'react';\r\nimport { IMfrmBuyboxData } from '../mfrm-buybox.data';\r\nimport { IMfrmBuyboxProps } from '../mfrm-buybox.props.autogenerated';\r\n\r\nimport { BuyboxErrorBlock } from '@msdyn365-commerce-modules/buybox';\r\nimport { getConfigureErrors, getGenericError } from '@msdyn365-commerce-modules/buybox';\r\n\r\nimport { ICartActionResult } from '@msdyn365-commerce/global-state';\r\n\r\nexport interface IFindInStoreFailureResult {\r\n missingDimensions?: ProductDimension[];\r\n}\r\n\r\nexport interface IBuyboxFindInStoreViewProps {\r\n storeSelector?: React.ReactNode;\r\n heading?: React.ReactNode;\r\n description?: React.ReactNode;\r\n errors?: React.ReactNode;\r\n button?: React.ReactNode;\r\n productPickupOptionList?: React.ReactNode;\r\n\r\n modal?: React.ReactNode;\r\n\r\n ContainerProps: INodeProps;\r\n\r\n openFindInStoreDialog(): Promise;\r\n}\r\n\r\n// tslint:disable-next-line:max-func-body-length\r\nexport function getBuyboxFindInStore(props: IMfrmBuyboxProps, state: IBuyboxState, callbacks: IBuyboxCallbacks): IBuyboxFindInStoreViewProps | undefined {\r\n const {\r\n data,\r\n slots: {\r\n storeSelector\r\n },\r\n resources: {\r\n priceFree,\r\n originalPriceText,\r\n currentPriceText,\r\n findInStoreHeaderText,\r\n findInStoreDescriptionText,\r\n findInStoreLinkText,\r\n buyBoxGoToCartText,\r\n buyBoxContinueShoppingText,\r\n buyBoxSingleItemText,\r\n buyBoxMultiLineItemFormatText,\r\n buyBoxHeaderMessageText\r\n /*descriptionTextToShowAllPickupOptions*/\r\n },\r\n context: {\r\n request: {\r\n channel: {\r\n PickupDeliveryModeCode\r\n } = { PickupDeliveryModeCode: undefined }\r\n }\r\n }\r\n } = props;\r\n const product = data?.product?.result;\r\n const price = data?.productPrice?.result;\r\n const storeSelectorStateManager = data?.storeSelectorStateManager?.result;\r\n const cart = data?.cart?.result;\r\n const deliveryOptions = data?.deliveryOptions?.result;\r\n const\r\n {\r\n errorState: {\r\n configureErrors,\r\n quantityError,\r\n otherError,\r\n errorHost\r\n },\r\n modalOpen,\r\n quantity\r\n } = state;\r\n\r\n const onClick = () => findInStoreOnClick(props, state, callbacks);\r\n\r\n if (!product || !storeSelectorStateManager || !ArrayExtensions.hasElements(storeSelector)) {\r\n return undefined;\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 (!deliveryOptions ||\r\n !deliveryOptions.DeliveryOptions ||\r\n !PickupDeliveryModeCode ||\r\n !deliveryOptions.DeliveryOptions.find((option: DeliveryOption) => option.Code === PickupDeliveryModeCode)) {\r\n return undefined;\r\n }\r\n\r\n const dialogStrings = {\r\n goToCartText: buyBoxGoToCartText,\r\n continueShoppingText: buyBoxContinueShoppingText,\r\n headerItemOneText: buyBoxSingleItemText,\r\n headerItemFormatText: buyBoxMultiLineItemFormatText,\r\n headerMessageText: buyBoxHeaderMessageText,\r\n freePriceText: priceFree,\r\n originalPriceText: originalPriceText,\r\n currentPriceText: currentPriceText\r\n };\r\n\r\n const priceComponent = price ? (\r\n ) : '';\r\n\r\n const defaultImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: `w=240&h=240&m=6`, w: 0, h: 0 },\r\n lg: { q: `w=240&h=240&m=6`, w: 0, h: 0 },\r\n xl: { q: `w=240&h=240&m=6`, w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n };\r\n\r\n const popupProps: IPopupProps = {\r\n context: props.context,\r\n className: 'ms-buybox',\r\n id: props.id,\r\n typeName: props.typeName,\r\n data: { product: props.data.product?.result, price: props.data.productPrice?.result },\r\n dialogStrings: dialogStrings,\r\n imageSettings: defaultImageSettings,\r\n gridSettings: props.context.request.gridSettings,\r\n productQuantity: quantity,\r\n priceComponent: priceComponent,\r\n navigationUrl: getUrlSync('cart', props.context.actionContext),\r\n modalOpen: modalOpen,\r\n setModalOpen: callbacks.changeModalOpen\r\n };\r\n const renderModalPopup = ;\r\n\r\n return {\r\n ContainerProps: {\r\n className: 'ms-buybox__find-in-store'\r\n },\r\n\r\n storeSelector: storeSelector[0],\r\n\r\n openFindInStoreDialog: onClick,\r\n\r\n heading: (\r\n \r\n ),\r\n\r\n description: (\r\n

\r\n {findInStoreDescriptionText}\r\n

\r\n ),\r\n productPickupOptionList: null,\r\n errors: (\r\n \r\n ),\r\n\r\n button: (\r\n \r\n {findInStoreLinkText}\r\n \r\n ),\r\n\r\n modal: renderModalPopup\r\n };\r\n}\r\n\r\n// tslint:disable-next-line: max-func-body-length\r\nasync function findInStoreOnClick(props: IMfrmBuyboxProps, state: IBuyboxState, callbacks: IBuyboxCallbacks): Promise {\r\n const {\r\n data: {\r\n storeSelectorStateManager: { result: storeSelectorStateManager },\r\n cart: { result: cart },\r\n productAvailableQuantity: { result: productAvailableQuantity }\r\n },\r\n resources,\r\n context,\r\n modules\r\n } = props;\r\n\r\n const {\r\n selectedProduct,\r\n quantity\r\n } = state;\r\n\r\n let dataProduct = props.data.product.result;\r\n if (selectedProduct) {\r\n dataProduct = (await selectedProduct) || dataProduct;\r\n }\r\n\r\n if (!dataProduct || !storeSelectorStateManager) {\r\n return;\r\n }\r\n\r\n const product = dataProduct;\r\n\r\n const missingDimensions = product.Dimensions && product.Dimensions.filter((dimension: ProductDimension) => !(dimension.DimensionValue && dimension.DimensionValue.Value));\r\n\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 if (missingDimensions && missingDimensions.length > 0) {\r\n if (callbacks.updateErrorState) {\r\n callbacks.updateErrorState(\r\n {\r\n errorHost: 'FINDINSTORE',\r\n configureErrors: getConfigureErrors(missingDimensions, resources)\r\n }\r\n );\r\n }\r\n } else {\r\n storeSelectorStateManager.openDialog({\r\n product,\r\n id: storeSelectorId,\r\n deliveryOptions: undefined,\r\n onLocationSelected: (orgUnitLocation: OrgUnitLocation, deliveryMode: string) => {\r\n if (!cart) {\r\n return Promise.resolve();\r\n }\r\n\r\n const behavior = props.context?.app?.config?.addToCartBehavior;\r\n\r\n return cart.addProductToCart({ product: product, count: quantity, location: orgUnitLocation, deliveryMode: deliveryMode })\r\n .then((result: ICartActionResult) => {\r\n if (result.status === 'FAILED' && result.substatus === 'MAXQUANTITY') {\r\n callbacks.changeModalOpen(false);\r\n\r\n const productAvailability = state.productAvailableQuantity ?\r\n state.productAvailableQuantity.ProductAvailableQuantity :\r\n productAvailableQuantity && productAvailableQuantity.length ?\r\n productAvailableQuantity[0].ProductAvailableQuantity : undefined;\r\n\r\n const failureResult: IAddToCartFailureResult = { failureReason: 'CARTACTIONFAILED', cartActionResult: { status: result.status, substatus: result.substatus } };\r\n callbacks.updateErrorState({\r\n errorHost: 'ADDTOCART',\r\n configureErrors: {},\r\n otherError: getGenericError(failureResult, cart, resources, context, product, productAvailability, orgUnitLocation)\r\n });\r\n } else {\r\n callbacks.updateErrorState({\r\n configureErrors: {}\r\n });\r\n const navigationUrl = getUrlSync('cart', context.actionContext);\r\n if ((behavior === undefined || behavior === AddToCartBehavior.goToCart)) {\r\n if (result.status === 'SUCCESS' && navigationUrl && MsDyn365.isBrowser) {\r\n window.location.assign(navigationUrl);\r\n }\r\n } else if (behavior === AddToCartBehavior.showModal) {\r\n callbacks.changeModalOpen(true);\r\n } else if (behavior === AddToCartBehavior.showNotification) {\r\n const defaultImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: `w=240&h=240&m=6`, w: 0, h: 0 },\r\n lg: { q: `w=240&h=240&m=6`, w: 0, h: 0 },\r\n xl: { q: `w=240&h=240&m=6`, w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n };\r\n const telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.friendlyName, props.telemetry);\r\n const dialogStrings: IAddToCartResources = {\r\n goToCartText: resources.buyBoxGoToCartText,\r\n continueShoppingText: resources.buyBoxContinueShoppingText,\r\n headerItemOneText: resources.buyBoxSingleItemText,\r\n headerItemFormatText: resources.buyBoxMultiLineItemFormatText,\r\n headerMessageText: resources.buyBoxHeaderMessageText,\r\n freePriceText: resources.priceFree,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText,\r\n addedQuantityText: resources.addedQuantityText,\r\n closeNotificationLabel: resources.closeNotificationLabel\r\n };\r\n const notification = new ItemSuccessfullyAddedToCartNotification(\r\n props.context,\r\n dialogStrings,\r\n defaultImageSettings,\r\n props.context.request.gridSettings,\r\n product,\r\n props.data.productPrice?.result,\r\n quantity,\r\n navigationUrl,\r\n telemetryContent,\r\n props.id,\r\n props.typeName\r\n );\r\n NotificationsManager.instance().addNotification(notification);\r\n }\r\n }\r\n }).catch((error: Error) => {\r\n if (props.telemetry) {\r\n props.telemetry.exception(error);\r\n props.telemetry.debug('Unable to add product to cart');\r\n }\r\n return;\r\n });\r\n }\r\n }).catch((error: Error) => {\r\n if (props.telemetry) {\r\n props.telemetry.error(error.message);\r\n props.telemetry.debug('Unable to find in store');\r\n }\r\n return;\r\n });\r\n }\r\n\r\n return;\r\n}","import {\r\n getBuyboxProductConfigure,\r\n getBuyboxProductDescription,\r\n getBuyboxShopSimilarButton,\r\n IBuyboxAddToCartViewProps,\r\n IBuyboxAddToOrderTemplateViewProps,\r\n IBuyboxAddToWishlistViewProps,\r\n IBuyboxCallbacks,\r\n IBuyboxCommonData,\r\n IBuyboxExtentedProps,\r\n IBuyboxKeyInPriceViewProps,\r\n IBuyboxProductConfigureViewProps,\r\n IBuyboxProductQuantityViewProps,\r\n IBuyboxShopSimilarLookViewProps,\r\n IBuyboxState,\r\n IErrorState,\r\n ShopSimiliarButtonType\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport {\r\n FinitePromiseQueue,\r\n FinitePromiseQueueError,\r\n getDeliveryOptionsForSelectedVariant,\r\n GetDeliveryOptionsForSelectedVariantInput,\r\n getPriceForSelectedVariant,\r\n getProductPageUrlSync,\r\n getProductAvailabilitiesForSelectedVariant,\r\n IProductInventoryInformation,\r\n IPromiseQueue,\r\n PriceForSelectedVariantInput,\r\n ProductAvailabilitiesForSelectedVariantInput\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { IBuyboxGetDimensionVariantAvailabilityActionData } from '../../data-actions/buybox-get-dimension-variants-availability-action';\r\nimport { format, getTelemetryObject, IModuleProps, INodeProps, ITelemetryContent, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport { ProductDimensionFull } from '@msdyn365-commerce/commerce-entities';\r\nimport { RatingComponent } from '@msdyn365-commerce/components';\r\nimport MsDyn365, { getUrlSync, ICoreContext, RichTextComponent, Text } from '@msdyn365-commerce/core';\r\nimport {\r\n AsyncResult,\r\n CommerceProperty,\r\n ProductDeliveryOptions,\r\n ProductDimensionValue,\r\n ProductPrice,\r\n SimpleProduct,\r\n OrgUnitContact\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { getAttributeValuesAsync, getDimensionValuesAsync, getVariantsByDimensionValuesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { AttributeValue, OrgUnitLocation, ReleasedProductType } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport classnames from 'classnames';\r\nimport { Popper, Tooltip, Rating } from 'mfcl';\r\nimport Info from 'mfcl/Icons/Info';\r\nimport dayjs from 'dayjs';\r\nimport * as React from 'react';\r\nimport Cookies from 'universal-cookie';\r\nimport _getViewPort from '../../Utilities/get-view-port';\r\nimport { addThrottledEvent } from '@msdyn365-commerce-modules/utilities';\r\nimport {\r\n IMFIATPInventoryEntity,\r\n IMFIATPInventoryStatusEntity,\r\n IMFIATPInventoryStatusResponse,\r\n IMFICartLine,\r\n IMFICLDeliveryScheduleParameters\r\n} from '../../actions/CoreProductDataServiceEntities.g';\r\nimport { IMFIItem, IMFIPromotion } from '../../actions/EyebrowMessageDataServiceEntities.g';\r\nimport getTryInStoreAction, { GetTryInStoreInfoInput } from '../../actions/get-try-in-store-info.action';\r\nimport { IMFITryInStore, IMFITryInStoreInfoResponse } from '../../actions/TryInStoreDataServiceEntities.g';\r\nimport getAllProductVariants, { BuyboxGetDimensionVariantAvailabilityInput } from '../../data-actions/buybox-get-all-variants-list';\r\nimport { IBuyboxGetDimensionPricingActionData } from '../../data-actions/buybox-get-dimension-pricing-action';\r\nimport { IStoreSelectorState } from '../../data-actions/store-selector-state';\r\nimport { fireAnalyticsLink } from '../../Utilities/analytics/clickTrack';\r\nimport { getBVAttributeValues } from '../../Utilities/get-bv-attributes';\r\nimport _getDeliveryByMessage from '../../Utilities/get-delivery-by-message';\r\nimport _getEyebrowMessage from '../../Utilities/get-eyebrow-message';\r\nimport _getInventoryQuantity from '../../Utilities/get-inventory-quantity';\r\nimport { buildProductBadge, parseBadgeData } from '../../Utilities/get-product-badge';\r\nimport { _coreProductATPCallForInventoryStatusForAllVariants, _getActivePrices } from '../../Utilities/mfrm-buybox-utils';\r\nimport { _getSoonestDeliveryDate } from '../../Utilities/product-search-result-utils';\r\nimport {\r\n getBuyboxAddToCart,\r\n getBuyBoxInventoryLabel,\r\n getBuyboxKeyInPrice,\r\n getBuyboxProductPrice,\r\n getBuyboxProductRating,\r\n getBuyboxProductTitle,\r\n getQuantityLimitsMessages\r\n} from './common/buybox-components';\r\nimport { getBuyboxFindInStore, IBuyboxFindInStoreViewProps } from './components/mfrm-buybox-find-in-store';\r\nimport { IMfrmBuyboxData } from './mfrm-buybox.data';\r\nimport { IMfrmBuyboxProps, IMfrmBuyboxResources } from './mfrm-buybox.props.autogenerated';\r\nimport { IVariantStockInfo } from './mfrm-buybox.view';\r\nimport { getTimeZoneAbbr, secondsToTime } from './../mfrm-store-selector/components/store-selector-location-line-item/date-time-helpers';\r\nimport { parseBrandName } from '../../Utilities/get-product-brand';\r\nimport { variantQueryStringName } from '../../Utilities/constants';\r\n\r\nexport interface IBuyboxViewProps extends IMfrmBuyboxProps {\r\n state: IMFRMBuyBoxState;\r\n ModuleProps: IModuleProps;\r\n ProductInfoContainerProps: INodeProps;\r\n MediaGalleryContainerProps: INodeProps;\r\n callbacks: IBuyboxCallbacks;\r\n mediaGallery?: React.ReactNode;\r\n title?: React.ReactNode;\r\n description?: React.ReactNode;\r\n rating?: React.ReactNode;\r\n price?: React.ReactNode;\r\n addToOrderTemplate?: IBuyboxAddToOrderTemplateViewProps;\r\n addToWishlist?: IBuyboxAddToWishlistViewProps;\r\n max: number | undefined;\r\n addToCart: IBuyboxAddToCartViewProps;\r\n viewCartLink: string | undefined;\r\n showViewCartLink: boolean;\r\n findInStore?: IBuyboxFindInStoreViewProps;\r\n quantity?: IBuyboxProductQuantityViewProps;\r\n configure?: IBuyboxProductConfigureViewProps;\r\n inventoryLabel?: React.ReactNode;\r\n shopSimilarLook?: IBuyboxShopSimilarLookViewProps;\r\n shopSimilarDescription?: IBuyboxShopSimilarLookViewProps;\r\n quantityLimitsMessages: React.ReactNode;\r\n telemetryContent?: ITelemetryContent;\r\n keyInPrice?: IBuyboxKeyInPriceViewProps;\r\n storeSelectorState?: AsyncResult;\r\n updateDimension?: boolean;\r\n promotionalMessage?: string | undefined;\r\n adjustableItemset?: SimpleProduct;\r\n pillow?: SimpleProduct;\r\n protector?: SimpleProduct;\r\n updateSuccessfulATC?(): void;\r\n getProductType(shippingInformation: string | undefined): string;\r\n setAllProductVariantsResult(result: IBuyboxGetDimensionVariantAvailabilityActionData[]): void;\r\n}\r\nexport interface IMFRMExtendCommonData extends IBuyboxCommonData {\r\n storeSelectorState?: AsyncResult;\r\n}\r\n// VSI Customization\r\nexport interface IMFRMBuyBoxState extends IBuyboxState {\r\n smallParcelATCallMade: boolean;\r\n StatusATPCall: boolean;\r\n ATPCall: boolean;\r\n recordId?: number;\r\n itemId?: string | undefined;\r\n masterProductId?: number | undefined;\r\n extensionProps: CommerceProperty[];\r\n eyebrowMessageResultState: IMFIPromotion[] | null;\r\n tryInStoresResults?: IMFITryInStoreInfoResponse | {};\r\n OrgUnitNumber?: string | undefined;\r\n deliveryMessage?: string;\r\n deliveryMessageATPResultState: IMFIATPInventoryEntity[] | null;\r\n inventoryStatusATPResultState: IMFIATPInventoryStatusEntity | null;\r\n successfulATC: boolean;\r\n currentProduct: SimpleProduct | undefined;\r\n currentProductDimensions: ProductDimensionFull[] | undefined;\r\n variantAvailibilityList: IBuyboxGetDimensionVariantAvailabilityActionData[];\r\n variantAvailibilityUpdating: boolean;\r\n batchedAtpInventoryStatusData: IMFIATPInventoryStatusResponseEx | null;\r\n variantIdForTracking: string;\r\n ecomAllVairantStockInfoConcatenated: string[];\r\n showViewCartLink: boolean;\r\n isStoreDetailsOpen: boolean;\r\n isDesktop: boolean\r\n}\r\nexport interface IMFRMNetworkCallsState {\r\n smallParcelATCallMade: boolean;\r\n StatusATPCall: boolean;\r\n ATPCall: boolean;\r\n setSmallParcelATPCallMade(atpCallMade: boolean): void;\r\n setStatusATPCall(atpCallMade: boolean): void;\r\n setATPCall(atpCallMade: boolean): void;\r\n}\r\n\r\nexport interface IMFIATPInventoryStatusResponseEx extends IMFIATPInventoryStatusResponse {\r\n zipCode?: string | undefined\r\n}\r\n\r\nexport interface IMFRMProductMExtensionPropsInfo {\r\n extensionProps?: CommerceProperty[];\r\n productBadges?: React.ReactNode | undefined;\r\n ratingComponent?: React.ReactNode | undefined;\r\n _renderTryInStore?: JSX.Element | null;\r\n _renderTryInStoreRedesign?: JSX.Element | null;\r\n eyeBrowMessage?: JSX.Element | null;\r\n deliveryMessage?: string;\r\n ATPDataFromBusiness?: IMFIATPInventoryEntity[] | null;\r\n ATPDataInventoryStausBusiness?: IMFIATPInventoryStatusEntity | null;\r\n ecomAllVairantStockInfoConcatenated: string[];\r\n customerSatisfactionScore?: JSX.Element;\r\n adjustableItem?: SimpleProduct;\r\n pillow?: SimpleProduct;\r\n protector?: SimpleProduct;\r\n}\r\n\r\nexport interface IExtendedSimpleProduct extends SimpleProduct {\r\n priceAfterDiscount?: number;\r\n price?: number;\r\n discount?: number;\r\n productSizeName?: string;\r\n}\r\n\r\nexport const getProductURLForUtag = (product: SimpleProduct | undefined, context: ICoreContext): string => {\r\n const productUrl = getProductPageUrlSync(product?.Name || '', product?.RecordId || 0, context?.actionContext, undefined);\r\n return `${context.request.url.requestUrl.origin}${productUrl}?variantid=${product?.RecordId}`;\r\n};\r\n\r\nexport const getProductSizeForUTag = (product: SimpleProduct | undefined): string | undefined => {\r\n //TODO remove magic numbers like 3 and use constant like DIMENSION_SIZE_TYPE\r\n return product?.Dimensions?.find(item => item.DimensionTypeValue === 3)?.DimensionValue?.Value?.toLowerCase();\r\n};\r\n\r\n\r\n/**\r\n * Buybox Module\r\n */\r\nclass Buybox extends React.PureComponent, IMFRMBuyBoxState> {\r\n private resizeThrottledEventHandler?: (event: Event) => void;\r\n /**\r\n * A queue of tasks of processing the changes in the dimensions.\r\n * Limit to two processes:\r\n * 1 - for the current process, which is under execution at the moment.\r\n * 2 - next process, which will process the latest version of data.\r\n * @remark Enqueueing new promises will discard the previous ones (except the one which is under processing).\r\n */\r\n //Constructor\r\n constructor(props: IMfrmBuyboxProps) {\r\n super(props);\r\n this.state = {\r\n errorState: {\r\n configureErrors: {}\r\n },\r\n quantity: 1,\r\n min: undefined,\r\n max: undefined,\r\n selectedProduct: undefined,\r\n productPrice: undefined,\r\n productDeliveryOptions: undefined,\r\n modalOpen: false,\r\n isUpdatingDimension: false,\r\n isUpdatingDeliveryOptions: false,\r\n smallParcelATCallMade: false,\r\n StatusATPCall: false,\r\n ATPCall: false,\r\n recordId: this.props.data.product.result?.RecordId,\r\n itemId: this.props.data.product.result?.ItemId,\r\n masterProductId: this.props.data.product.result?.MasterProductId,\r\n extensionProps: [],\r\n eyebrowMessageResultState: null,\r\n deliveryMessage: '',\r\n deliveryMessageATPResultState: null,\r\n inventoryStatusATPResultState: null,\r\n successfulATC: false,\r\n currentProduct: undefined,\r\n currentProductDimensions: undefined,\r\n variantAvailibilityList: [],\r\n variantAvailibilityUpdating: false,\r\n batchedAtpInventoryStatusData: null,\r\n variantIdForTracking: '',\r\n ecomAllVairantStockInfoConcatenated: [],\r\n showViewCartLink: false,\r\n isStoreDetailsOpen: false,\r\n isDesktop: false\r\n };\r\n this.telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.friendlyName, props.telemetry);\r\n this.updateSuccessfulATC = this.updateSuccessfulATC.bind(this);\r\n this._setAllProductVariantsResult = this._setAllProductVariantsResult.bind(this);\r\n this.timer = null;\r\n this.wrapperRef = React.createRef();\r\n this.handleClickOutside = this.handleClickOutside.bind(this);\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this._updateUtagDataOnInitialLoad();\r\n }\r\n //React Lifecycle methods\r\n public async componentDidMount(): Promise {\r\n const {\r\n data: {\r\n product: { result: product },\r\n productPrice,\r\n cart: { result: cart }\r\n },\r\n context: {\r\n request: { }\r\n }\r\n } = this.props;\r\n if (MsDyn365.isBrowser) {\r\n this.updateViewPort(this.props.context);\r\n }\r\n if (product?.MasterProductId) {\r\n await this._sendProductDataToTealium(\r\n this.props,\r\n product\r\n );\r\n }\r\n document.addEventListener(\"mousedown\", this.handleClickOutside);\r\n // set availability list for all variants\r\n if (this.props.data.productSpecificationData.result?.length) {\r\n this.props.data.allVariants.result &&\r\n this._updateAvailbilityForVariantsUpdated(\r\n this.props.data.allVariants.result,\r\n this.props,\r\n this.props.data.productSpecificationData.result\r\n );\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n productPrice.then(async result => {\r\n this._updatePrice(result);\r\n });\r\n if (product) {\r\n // check if the product is service or not by product type\r\n const PRODUCTASSERVICE = 2 as ReleasedProductType.Service;\r\n\r\n if (product.ItemTypeValue === PRODUCTASSERVICE) {\r\n this.setState({ isServiceItem: true });\r\n }\r\n await this._updateQuantitiesInState(product);\r\n // VSI - Customization Start 48959\r\n if (product.MasterProductId) {\r\n await this._eyeBrowMessageAsyncFunc(true);\r\n }\r\n // VSI - Customization End 48959\r\n const canTryInStores = this._getProductSpecificationAttributeByKeyName('try in store');\r\n canTryInStores && (await this._tryInStoreAsyncCall());\r\n }\r\n if (\r\n this.props.data.product.result?.RecordId !== this.state.recordId ||\r\n this.props.data.product.result?.ItemId !== this.state.itemId\r\n ) {\r\n this.setState({\r\n recordId: this.props.data.product.result!.RecordId,\r\n masterProductId: this.props.data.product.result!.MasterProductId,\r\n itemId: this.props.data.product.result!.ItemId\r\n });\r\n }\r\n if (this.state.recordId && this.state.masterProductId && this.state.itemId) {\r\n this._setRecentlyViewProducts(this.state.recordId, this.state.masterProductId);\r\n }\r\n const newCartTotalItems = cart && cart.totalItemsInCart ? cart.totalItemsInCart : 0;\r\n if (newCartTotalItems && newCartTotalItems > 0) {\r\n this.setState({\r\n showViewCartLink: true\r\n });\r\n }\r\n else {\r\n this.setState({\r\n showViewCartLink: false\r\n });\r\n\r\n }\r\n }\r\n\r\n // tslint:disable-next-line: cyclomatic-complexity\r\n public async componentDidUpdate(prevProps: IMfrmBuyboxProps, prevState: IMFRMBuyBoxState): Promise {\r\n const {\r\n data: {\r\n product: { result: product },\r\n cart: { result: cart }\r\n }\r\n } = this.props;\r\n if (MsDyn365.isBrowser) {\r\n this.resizeThrottledEventHandler = addThrottledEvent(window, 'resize', () => this.updateViewPort(this.props.context));\r\n }\r\n prevState.selectedProduct?.then(selProd => {\r\n this.state.selectedProduct?.then(async currSelProd => {\r\n if (selProd?.RecordId !== currSelProd?.RecordId) {\r\n this.setState({ smallParcelATCallMade: false });\r\n }\r\n });\r\n });\r\n\r\n if (\r\n this.props.data.product.result?.RecordId !== this.state.recordId ||\r\n this.props.data.product.result?.ItemId !== this.state.itemId\r\n ) {\r\n this.setState(\r\n {\r\n currentProduct: this.props.data.product.result,\r\n recordId: this.props.data.product.result!.RecordId,\r\n masterProductId: this.props.data.product.result!.MasterProductId,\r\n itemId: this.props.data.product.result!.ItemId,\r\n StatusATPCall: false,\r\n ATPCall: false\r\n },\r\n async () => {\r\n this.state.recordId && this._setRecentlyViewProducts(this.state.recordId, this.state.masterProductId);\r\n // VSI - Customization Start 48959\r\n const allVariants = this.props?.data?.allVariants?.result ? this.props?.data?.allVariants?.result : [];\r\n await this.setDefaultOOSVariant(allVariants);\r\n await this._eyeBrowMessageAsyncFunc(true);\r\n // VSI - Customization End 48959\r\n }\r\n );\r\n }\r\n const canTryInStores = this._getProductSpecificationAttributeByKeyName('try in store');\r\n const isSociEnabled = this.props.app.config.enableSociLocations || false;\r\n if (canTryInStores) {\r\n if (isSociEnabled) {\r\n await this._tryInStoreAsyncCall();\r\n } else {\r\n const preferredStore = this._getPreferredStore();\r\n if (preferredStore?.OrgUnitNumber && this.state.OrgUnitNumber && this.state.OrgUnitNumber !== preferredStore.OrgUnitNumber) {\r\n await this._tryInStoreAsyncCall();\r\n }\r\n }\r\n }\r\n\r\n if (this.state.extensionProps.length <= 0 && this.props.data.product.result) {\r\n if (this.props.data.product?.result?.ExtensionProperties && this.props.data.product?.result?.ExtensionProperties.length >= 1) {\r\n this.setState({ extensionProps: this.props.data.product.result.ExtensionProperties });\r\n }\r\n }\r\n const newCartTotalItems = cart && cart.totalItemsInCart ? cart.totalItemsInCart : 0;\r\n if (newCartTotalItems && newCartTotalItems > 0) {\r\n this.setState({\r\n showViewCartLink: true\r\n });\r\n }\r\n else {\r\n this.setState({\r\n showViewCartLink: false\r\n });\r\n }\r\n if (this.props.data.product.result?.RecordId !== this.state.recordId) {\r\n await this._sendProductDataToTealium(this.props, product);\r\n }\r\n }\r\n\r\n public async componentWillUnmount(): Promise {\r\n if (this.timer) {\r\n clearTimeout(this.timer);\r\n }\r\n document.removeEventListener(\"mousedown\", this.handleClickOutside);\r\n MsDyn365.isBrowser && window.removeEventListener('resize', this.resizeThrottledEventHandler!, false);\r\n }\r\n\r\n private updateViewPort = (context: ICoreContext): void => {\r\n const viewport = _getViewPort(context);\r\n if (viewport === 'lg' || viewport === 'xl') {\r\n this.setState({\r\n isDesktop: true\r\n });\r\n } else {\r\n this.setState({\r\n isDesktop: false\r\n });\r\n }\r\n };\r\n\r\n //Public methods\r\n public updateSuccessfulATC = (): void => {\r\n this.setState({ successfulATC: true });\r\n this.timer = setTimeout(() => {\r\n this.setState({ successfulATC: false });\r\n }, 4500);\r\n };\r\n\r\n public extendAllProductVariants(\r\n allProductVariants: SimpleProduct[] | undefined,\r\n prices: IBuyboxGetDimensionPricingActionData[]\r\n ): IExtendedSimpleProduct[] | undefined {\r\n let extendedAllProductVariants: IExtendedSimpleProduct[] | undefined =\r\n allProductVariants &&\r\n allProductVariants?.map(variant => {\r\n let extendedObj: IExtendedSimpleProduct = { ...variant };\r\n variant.Dimensions?.forEach(dimension => {\r\n if (dimension.DimensionTypeValue === 3) {\r\n extendedObj = { productSizeName: dimension.DimensionValue?.Value, ...variant };\r\n }\r\n });\r\n return extendedObj;\r\n });\r\n extendedAllProductVariants =\r\n extendedAllProductVariants &&\r\n extendedAllProductVariants.map(variant => {\r\n let extendedObj: IExtendedSimpleProduct = { ...variant };\r\n prices?.forEach(dimensionPrice => {\r\n if (dimensionPrice?.discountAmount && dimensionPrice?.name === variant?.productSizeName) {\r\n const priceAfterDiscount = Math.round(dimensionPrice?.price - dimensionPrice?.discountAmount);\r\n extendedObj = {\r\n discount: dimensionPrice?.discountAmount,\r\n price: dimensionPrice?.price,\r\n priceAfterDiscount: priceAfterDiscount,\r\n ...variant\r\n };\r\n }\r\n });\r\n return extendedObj;\r\n });\r\n return extendedAllProductVariants;\r\n }\r\n\r\n public handleClickOutside(event: any): void {\r\n if (this.wrapperRef && !this.wrapperRef.current?.contains(event.target)) {\r\n this.setState({ isStoreDetailsOpen: false });\r\n }\r\n\r\n }\r\n\r\n //Public async methods\r\n public async getNextInventoryProduct(\r\n product: SimpleProduct | undefined,\r\n productSpecificationData: AttributeValue[] | undefined,\r\n allProductVariants: IExtendedSimpleProduct[] | undefined,\r\n context: ICoreContext<{\r\n [x: string]: any;\r\n }>,\r\n variantAvailibilityList: IBuyboxGetDimensionVariantAvailabilityActionData[]\r\n ): Promise {\r\n const {\r\n app: {\r\n config: { smallParcelAttributeKey }\r\n }\r\n } = context;\r\n\r\n const smallParcelVariantsListObj = {};\r\n variantAvailibilityList?.forEach(obj => {\r\n const key = obj?.variantID;\r\n smallParcelVariantsListObj[key] = obj;\r\n });\r\n\r\n const shippingInformation = productSpecificationData\r\n ?.find(attr => attr.Name?.trim() === smallParcelAttributeKey)\r\n ?.TextValue?.toLowerCase();\r\n const productType = this._getProductType(shippingInformation).toLowerCase();\r\n let isProductFound = false;\r\n let inStockLowestPriceVariant;\r\n\r\n // to check that if current loaded variant is OOS or not\r\n for (const element of this.state.ecomAllVairantStockInfoConcatenated) {\r\n const [recordId, isInStock] = element && element.split('|');\r\n if (product?.RecordId.toString() === recordId && isInStock === '0') {\r\n // product found that is in stock then no need to loop through other values\r\n inStockLowestPriceVariant = product;\r\n isProductFound = true;\r\n break;\r\n } else if (product?.RecordId.toString() === recordId && isInStock === '1') {\r\n break;\r\n }\r\n }\r\n\r\n // if current loaded variant is OOS then check the others\r\n !isProductFound &&\r\n allProductVariants?.filter(variantObj => {\r\n if (!isProductFound) {\r\n for (const element of this.state.ecomAllVairantStockInfoConcatenated) {\r\n const [recordId, isInStock] = element && element.split('|');\r\n if (variantObj?.RecordId.toString() === recordId && isInStock === '0') {\r\n // product found that is in stock then no need to loop through other values\r\n const smallParcelProduct = smallParcelVariantsListObj[variantObj?.RecordId];\r\n if (productType === 'small parcel') {\r\n if (smallParcelProduct?.isAvailable === true &&\r\n variantObj?.RecordId === smallParcelProduct?.variantID) {\r\n inStockLowestPriceVariant = variantObj;\r\n isProductFound = true;\r\n break;\r\n }\r\n } else {\r\n inStockLowestPriceVariant = variantObj;\r\n isProductFound = true;\r\n break;\r\n }\r\n } else if (variantObj.RecordId.toString() === recordId) {\r\n // isInStock is 0 but record id is matched then no need to loop through other values\r\n break;\r\n }\r\n }\r\n }\r\n });\r\n return inStockLowestPriceVariant;\r\n }\r\n\r\n public async makeCoreProductDeliveryMessage(str: string): Promise {\r\n const {\r\n data: {\r\n productSpecificationData: { result: productSpecificationData }\r\n },\r\n context: {\r\n app: {\r\n config: { smallParcelAttributeKey }\r\n }\r\n }\r\n } = this.props;\r\n const outOfStock = productSpecificationData?.find(\r\n attr => attr.Name?.trim().toLowerCase() === this.props.context.app.config.outOfStockProductKey?.trim().toLowerCase()\r\n )?.BooleanValue;\r\n const shippingInformation = productSpecificationData\r\n ?.find(attr => attr.Name?.trim() === smallParcelAttributeKey)\r\n ?.TextValue?.toLowerCase();\r\n\r\n if (this._getProductType(shippingInformation).toLowerCase() === 'core' && !this.state.ATPCall && !outOfStock) {\r\n this.setState({ ATPCall: true });\r\n await this.getDeliverySlotFromATP(true);\r\n } else if (this._getProductType(shippingInformation).toLowerCase() === 'small parcel' && !outOfStock) {\r\n this.setState({ StatusATPCall: true });\r\n // await this.getInventoryStatusCall(true);\r\n const inventoryStatusData = this.state.batchedAtpInventoryStatusData?.ATPInventoryStatusData\r\n ? this.state.batchedAtpInventoryStatusData?.ATPInventoryStatusData\r\n : null;\r\n let selectedObj = inventoryStatusData\r\n ? inventoryStatusData?.find(item => item.VariantRecordId?.toString() === this.state.currentProduct?.RecordId?.toString())\r\n : null;\r\n selectedObj = selectedObj ? { ...selectedObj, zipCode: inventoryStatusData![0]?.zipCode } : null;\r\n this.setState({ inventoryStatusATPResultState: selectedObj });\r\n }\r\n }\r\n\r\n public async getVariantID(updatedProduct?: SimpleProduct | undefined): Promise {\r\n const {\r\n data: {\r\n product: { result: product }\r\n },\r\n context: { actionContext, request }\r\n } = this.props;\r\n const { RecordId, ItemId } = updatedProduct && updatedProduct !== undefined ? updatedProduct : product || {};\r\n let variantId: string | undefined;\r\n if (product?.MasterProductId && product?.MasterProductId > 0) {\r\n const input = new BuyboxGetDimensionVariantAvailabilityInput(product.MasterProductId, request.apiSettings.channelId);\r\n const variantsResp: SimpleProduct[] = await getAllProductVariants(input, actionContext);\r\n for (let variantIter = 0; variantIter < variantsResp.length; variantIter++) {\r\n if (variantsResp[variantIter].RecordId === RecordId) {\r\n const ePropsVariant = variantsResp[variantIter].ExtensionProperties!;\r\n if (ePropsVariant?.length > 0) {\r\n for (let eIter = 0; eIter < ePropsVariant?.length; eIter++) {\r\n if (ePropsVariant[eIter].Key === 'RetailVariantId') {\r\n variantId = ePropsVariant[eIter].Value?.StringValue;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n const variantofId = `V000${ItemId}`;\r\n variantId = variantofId?.slice(0, -1);\r\n }\r\n\r\n return variantId;\r\n }\r\n\r\n //Private methods\r\n private dimensionUpdateQueue: IPromiseQueue = new FinitePromiseQueue(2);\r\n private dimensions: { [id: number]: string } = {};\r\n private telemetryContent: ITelemetryContent;\r\n private timer: NodeJS.Timeout | null;\r\n private wrapperRef: React.RefObject;\r\n\r\n private buyboxCallbacks: IBuyboxCallbacks = {\r\n updateQuantity: (newQuantity: number): boolean => {\r\n const errorState = { ...this.state.errorState };\r\n errorState.quantityError = undefined;\r\n errorState.otherError = undefined;\r\n if (this.state.quantity !== newQuantity) {\r\n fireAnalyticsLink({\r\n eventName: 'PDP-card-action',\r\n eventCategory: 'PDP Card Action',\r\n eventAction: 'Change Quantity',\r\n eventLabel: 'Change Quantity PDP',\r\n eventNoninteraction: 'false',\r\n generalConfig: { enhanced_action: 'change_quantity' }\r\n });\r\n }\r\n\r\n this.setState({ quantity: newQuantity, errorState: errorState });\r\n return true;\r\n },\r\n updateErrorState: (newErrorState: IErrorState): void => {\r\n this.setState({ errorState: newErrorState });\r\n },\r\n updateSelectedProduct: (\r\n newSelectedProduct: Promise,\r\n newInventory: IProductInventoryInformation | undefined,\r\n newPrice: ProductPrice | undefined,\r\n newDeliveryOptions: ProductDeliveryOptions | undefined\r\n ): void => {\r\n this.setState({\r\n selectedProduct: newSelectedProduct,\r\n productAvailableQuantity: newInventory,\r\n productDeliveryOptions: newDeliveryOptions\r\n });\r\n this._updatePrice(newPrice);\r\n },\r\n dimensionSelectedAsync: (selectedDimensionId: number, selectedDimensionValueId: string): Promise => {\r\n this.dimensions[selectedDimensionId] = selectedDimensionValueId;\r\n return this.dimensionUpdateQueue\r\n .enqueue(() => {\r\n return this._updateDimensions();\r\n })\r\n .catch((reason: any) => {\r\n // tslint:disable-line:no-any\r\n // Ignore discarded processes.\r\n if (reason !== FinitePromiseQueueError.ProcessWasDiscardedFromTheQueue) {\r\n throw reason;\r\n }\r\n });\r\n },\r\n getDropdownName: (dimensionType: number, resources: IMfrmBuyboxResources): string => {\r\n return this._getDropdownName(dimensionType, resources);\r\n },\r\n changeModalOpen: (isModalOpen: boolean): void => {\r\n this.setState({ modalOpen: isModalOpen });\r\n },\r\n changeUpdatingDimension: (isUpdatingDimension: boolean): void => {\r\n this.setState({ isUpdatingDimension: isUpdatingDimension });\r\n },\r\n /**\r\n * Update isUpdatingDeliveryOptions state.\r\n *\r\n * @param isUpdatingDeliveryOptions - The status of updating delivery options.\r\n */\r\n changeUpdatingDeliveryOptions: (isUpdatingDeliveryOptions: boolean): void => {\r\n this.setState({ isUpdatingDeliveryOptions });\r\n },\r\n updateKeyInPrice: (customPrice: number): void => {\r\n // Remove custom amount error when updating the custom price\r\n const errorState = { ...this.state.errorState };\r\n errorState.customAmountError = undefined;\r\n\r\n this.setState({ isPriceKeyedIn: true, keyInPriceAmount: customPrice, errorState: errorState });\r\n this._updatePrice(this.state.productPrice, customPrice);\r\n }\r\n };\r\n\r\n private _updateURLWithoutReloading(product: SimpleProduct | undefined) {\r\n if (this.props.context.app.config.queryBasedVariantSelection) {\r\n try {\r\n if (MsDyn365.isBrowser) {\r\n const queryParamValue = variantQueryStringName;\r\n const masterId = product?.MasterProductId;\r\n const currUrl = window.location.href;\r\n const urlWithIgnoredCase = new URL(currUrl.toString().toLocaleLowerCase());\r\n if (masterId && currUrl.indexOf(`${masterId}.p`) !== -1) {\r\n if (urlWithIgnoredCase.searchParams.has(queryParamValue)) {\r\n if (urlWithIgnoredCase.searchParams.get(queryParamValue) === product?.RecordId?.toString()) {\r\n return;\r\n }\r\n }\r\n urlWithIgnoredCase.searchParams.set(queryParamValue, product?.RecordId.toString() || '');\r\n window.history.replaceState(window.history.state, '', urlWithIgnoredCase.toString().replace(urlWithIgnoredCase.host, window.location.host));\r\n } else if (masterId && currUrl.indexOf(`${masterId}.p`) === -1) {\r\n const productUrl = getProductPageUrlSync(\r\n product?.Name || '',\r\n masterId || 0,\r\n this.props.context && this.props.context.actionContext,\r\n undefined\r\n );\r\n if (urlWithIgnoredCase.searchParams.has(queryParamValue)) {\r\n if (urlWithIgnoredCase.searchParams.get(queryParamValue) === product?.RecordId?.toString()) {\r\n //pushstate only in this case, as here we need to update url with masterid\r\n window.history.pushState({}, '', urlWithIgnoredCase.search ? `${productUrl}${urlWithIgnoredCase.search}` : productUrl);\r\n return;\r\n }\r\n }\r\n urlWithIgnoredCase.searchParams.set(queryParamValue, product?.RecordId.toString() || '');\r\n window.history.pushState({}, '', urlWithIgnoredCase.search ? `${productUrl}${urlWithIgnoredCase.search}` : productUrl);\r\n }\r\n }\r\n } catch (error) {\r\n console.log('Error [_updateURLWithoutReloading]', error);\r\n }\r\n } else {\r\n const currUrl = window.location.href;\r\n let queryParams = '';\r\n if (currUrl.indexOf('?') !== -1) {\r\n queryParams = currUrl.split('?')[1];\r\n }\r\n const productUrl = getProductPageUrlSync(\r\n product?.Name || '',\r\n product?.RecordId || 0,\r\n this.props.context && this.props.context.actionContext,\r\n undefined\r\n );\r\n if (MsDyn365.isBrowser) {\r\n window.history.pushState({}, '', queryParams ? `${productUrl}?${queryParams}` : productUrl);\r\n }\r\n }\r\n }\r\n\r\n private _updateQueryParamVariantId = (variantId: Number | undefined) => {\r\n if (MsDyn365.isBrowser) {\r\n const currUrl = window.location.href;\r\n const urlWithIgnoredCase = new URL(currUrl.toString().toLocaleLowerCase());\r\n if (urlWithIgnoredCase.searchParams.has(variantQueryStringName)) {\r\n if (urlWithIgnoredCase.searchParams.get(variantQueryStringName) === variantId?.toString()) {\r\n return;\r\n }\r\n }\r\n // url is containing variantId\r\n urlWithIgnoredCase.searchParams.set(variantQueryStringName, variantId?.toString() || '');\r\n window.history.replaceState(window.history.state, '', urlWithIgnoredCase.toString().replace(urlWithIgnoredCase.host, window.location.host));\r\n // window.history.pushState({}, '', urlWithIgnoredCase.href);\r\n }\r\n };\r\n private _setAllProductVariantsResult(result: IBuyboxGetDimensionVariantAvailabilityActionData[]) {\r\n this.setState({ variantAvailibilityList: result });\r\n }\r\n\r\n /** Method for setting cookies for recently viewed products */\r\n private _setRecentlyViewProducts = (recordId: number, masterProductId: number | undefined): void => {\r\n const cookies = new Cookies();\r\n const date = new Date(); // Now\r\n date.setDate(date.getDate() + 30); // Set now + 30 days as the new date\r\n\r\n const product = {\r\n masterProductId: masterProductId,\r\n recordId: recordId,\r\n expiry: date\r\n };\r\n\r\n interface IRecentlyViewedProducts {\r\n masterProductId: number;\r\n recordId: number;\r\n expiry: number;\r\n }\r\n let inserted = false;\r\n\r\n let recentlyViewedProductsStored = cookies.get(`RecentlyViewedProducts`);\r\n if (masterProductId !== undefined) {\r\n if (recentlyViewedProductsStored === undefined || recentlyViewedProductsStored.length === 0) {\r\n const recentlyViewedProducts = [];\r\n recentlyViewedProducts.push(product);\r\n cookies.set(`RecentlyViewedProducts`, recentlyViewedProducts, { path: '/' });\r\n } else {\r\n recentlyViewedProductsStored?.map((item: IRecentlyViewedProducts, index: number) => {\r\n if (item.masterProductId === masterProductId) {\r\n recentlyViewedProductsStored?.splice(index, 1);\r\n recentlyViewedProductsStored = [product]?.concat(recentlyViewedProductsStored);\r\n cookies.set(`RecentlyViewedProducts`, recentlyViewedProductsStored, { path: '/' });\r\n inserted = true;\r\n }\r\n });\r\n\r\n if (!inserted) {\r\n if (recentlyViewedProductsStored.length >= 6) {\r\n recentlyViewedProductsStored?.splice(0, 1);\r\n recentlyViewedProductsStored = [product]?.concat(recentlyViewedProductsStored);\r\n cookies.set(`RecentlyViewedProducts`, recentlyViewedProductsStored, { path: '/' });\r\n } else {\r\n recentlyViewedProductsStored = [product]?.concat(recentlyViewedProductsStored);\r\n cookies.set(`RecentlyViewedProducts`, recentlyViewedProductsStored, { path: '/' });\r\n }\r\n inserted = false;\r\n }\r\n }\r\n }\r\n };\r\n private _setSmallParcelATPCallMade = (atpCallMade: boolean) => {\r\n this.setState({ smallParcelATCallMade: atpCallMade });\r\n };\r\n private _setStatusATPCall = (atpCallMade: boolean) => {\r\n this.setState({ StatusATPCall: atpCallMade });\r\n };\r\n private _setATPCall = (atpCallMade: boolean) => {\r\n this.setState({ ATPCall: atpCallMade });\r\n };\r\n\r\n private _updatePrice(newPrice: ProductPrice | undefined, customPrice: number | undefined = this.state.keyInPriceAmount): void {\r\n if (this.state.isCustomPriceSelected && newPrice) {\r\n newPrice.CustomerContextualPrice = customPrice;\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this._updateUtagData(this.props.data?.product?.result, newPrice?.CustomerContextualPrice);\r\n this.setState({ productPrice: newPrice });\r\n }\r\n\r\n private _updateDimensionValue = (\r\n productDimensionFull: ProductDimensionFull,\r\n newValueId: string | undefined\r\n ): ProductDimensionValue | undefined => {\r\n if (newValueId && productDimensionFull.DimensionValues) {\r\n return productDimensionFull.DimensionValues.find(dimension => dimension.RecordId === +newValueId);\r\n }\r\n\r\n return undefined;\r\n };\r\n\r\n private _getDropdownName = (dimensionType: number, resources: IMfrmBuyboxResources): string => {\r\n const isGiftCard = this.props.data.product.result?.IsGiftCard;\r\n\r\n switch (dimensionType) {\r\n case 1: // ProductDimensionType.Color\r\n return resources.productDimensionTypeColor;\r\n case 2: // ProductDimensionType.Configuration\r\n return resources.productDimensionTypeConfiguration;\r\n case 3: // ProductDimensionType.Size\r\n return resources.productDimensionTypeSize;\r\n case 4: // ProductDimensionType.Style\r\n return isGiftCard ? resources.productDimensionTypeAmount : resources.productDimensionTypeStyle;\r\n default:\r\n return '';\r\n }\r\n };\r\n\r\n private _scrollToBVHosted = () => {\r\n if (MsDyn365.isBrowser) {\r\n document?.getElementById('writeFirstReview')?.scrollIntoView({ behavior: 'smooth' });\r\n }\r\n };\r\n\r\n private _onHandleToggleAvailableStoreDetails = () => {\r\n this.setState({ isStoreDetailsOpen: !this.state.isStoreDetailsOpen });\r\n };\r\n\r\n private _getPreferredStore = (): OrgUnitLocation | undefined => {\r\n const props = this.props as IBuyboxExtentedProps & IBuyboxViewProps;\r\n const { storeSelectorState } = props;\r\n let preferredStore = (storeSelectorState && storeSelectorState.result && storeSelectorState.result.prefferedStore) || {};\r\n if (\r\n MsDyn365.isBrowser &&\r\n (!preferredStore.OrgUnitNumber || !preferredStore.Zip) &&\r\n localStorage.getItem('_mfrm__prefferedStore_')\r\n ) {\r\n preferredStore = JSON.parse(localStorage.getItem('_mfrm__prefferedStore_') || '');\r\n }\r\n return preferredStore || undefined;\r\n };\r\n private _getSociPreferredStore = (): any => {\r\n let preferredStore = {};\r\n if (MsDyn365.isBrowser && localStorage.getItem('_mfrm__prefferedStore_')) {\r\n preferredStore = JSON.parse(localStorage.getItem('_mfrm__prefferedStore_') || '');\r\n } else {\r\n preferredStore = {};\r\n }\r\n return preferredStore;\r\n };\r\n\r\n private _getProductSpecificationAttributeByKeyName = (attrName: string): boolean | undefined => {\r\n return (\r\n this.props.data.productSpecificationData &&\r\n this.props.data.productSpecificationData.result?.find(attr => attr.Name?.trim().toLowerCase() === attrName.trim().toLowerCase())\r\n ?.BooleanValue\r\n );\r\n };\r\n\r\n private _getProductType = (shippingInformation: string | undefined): string => {\r\n if (shippingInformation && shippingInformation.toLowerCase() === 'delivery') {\r\n return 'Core';\r\n }\r\n if (shippingInformation && shippingInformation.toLowerCase() === 'parcel') {\r\n return 'Small Parcel';\r\n }\r\n if (shippingInformation && shippingInformation.toLowerCase() === 'drop ship') {\r\n return 'Drop Ship';\r\n }\r\n return '';\r\n };\r\n\r\n private _updateUtagDataOnInitialLoad = async () => {\r\n const productprice = await this.props.data.productPrice;\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.props.data.product.then(product => {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.props.data.categoryPaths.then(category => {\r\n const allCategoriesArr = category;\r\n const categoryObj = allCategoriesArr && allCategoriesArr[allCategoriesArr?.length - 1];\r\n const categoryName: string | undefined = categoryObj ? `${categoryObj?.Name}` : undefined;\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.props.data.productSpecificationData.then(productAttribute => {\r\n const fallBackBrandAttribute = 'BRAND';\r\n const attribute = this.props.context.app.config.brandBackofficeAttributePdp || fallBackBrandAttribute;\r\n const attributes = this.props.data.productSpecificationData?.result;\r\n let productBrandName =\r\n attributes &&\r\n attributes.find(\r\n currAttribute =>\r\n currAttribute.Name && currAttribute.Name.toLowerCase().trim() === attribute.toLowerCase().trim()\r\n )?.TextValue;\r\n productBrandName = productBrandName ? `${productBrandName}` : undefined;\r\n const productSize = product?.Dimensions?.find(item => item.DimensionTypeValue === 3)?.DimensionValue?.Value?.toLowerCase();\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.props.data.listPageStateBuyBox\r\n .then(item => {\r\n item.itemId = product.ItemId;\r\n item.variantId = this._getVariantIDOnLoad();\r\n item.name = product.Name;\r\n item.categoryName = categoryName;\r\n item.productBrandName = productBrandName;\r\n item.price = productprice.CustomerContextualPrice ? productprice.CustomerContextualPrice.toString() : product.BasePrice.toString();\r\n item.productUrl = getProductURLForUtag(product, this.props.context);\r\n item.productImageUrl = `${product?.PrimaryImageUrl}`;\r\n item.productSize = productSize;\r\n })\r\n .catch(err => {\r\n console.log(err, 'stateSharingBuyboxError');\r\n });\r\n });\r\n });\r\n });\r\n };\r\n\r\n private _getVariantIDOnLoad = (): string | undefined => {\r\n const {\r\n data: {\r\n product: { result: product }\r\n }\r\n } = this.props;\r\n const { RecordId, ItemId } = product || {};\r\n let variantId: string | undefined;\r\n const variantsResp: SimpleProduct[] | undefined = this.props.data.allProductVariants?.result;\r\n if (variantsResp) {\r\n for (let variantIter = 0; variantIter < variantsResp.length; variantIter++) {\r\n if (variantsResp[variantIter].RecordId === RecordId) {\r\n const ePropsVariant = variantsResp[variantIter].ExtensionProperties!;\r\n if (ePropsVariant?.length > 0) {\r\n for (let eIter = 0; eIter < ePropsVariant?.length; eIter++) {\r\n if (ePropsVariant[eIter].Key === 'RetailVariantId') {\r\n variantId = ePropsVariant[eIter].Value?.StringValue;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n const variantofId = `V000${ItemId}`;\r\n variantId = variantofId?.slice(0, -1);\r\n }\r\n return variantId;\r\n };\r\n\r\n private _getProductAttributeUpdated = (productSpecificationData: AttributeValue[], props: IMfrmBuyboxProps) => {\r\n // shippingInformation product attribute value\r\n const shippingInformationSmall = productSpecificationData\r\n .find(attr => attr.Name?.trim() === props.context.app.config.smallParcelAttributeKey)\r\n ?.TextValue?.toLowerCase();\r\n\r\n return this._getProductType(shippingInformationSmall);\r\n };\r\n\r\n //private async methods\r\n // tslint:disable-next-line: max-line-length\r\n private _updateAvailbilityForVariantsUpdated = async (\r\n allVariants: IBuyboxGetDimensionVariantAvailabilityActionData[],\r\n props: IMfrmBuyboxProps,\r\n productSpecificationData: AttributeValue[]\r\n ) => {\r\n const variantsResult: IBuyboxGetDimensionVariantAvailabilityActionData[] = allVariants;\r\n const availableVariantIDs: number[] = [];\r\n const itemId = props?.data?.product?.result?.ItemId;\r\n const {\r\n context: {\r\n app: {\r\n config: {\r\n eComAllVariantsOOSMultiAttr,\r\n ecomAllVairantStockInfoKey,\r\n ecomAllVairantStockInfoKey1,\r\n ecomAllVairantStockInfoKey2,\r\n ecomAllVairantStockInfoKey3\r\n }\r\n }\r\n }\r\n } = this.props;\r\n let count = 0;\r\n if (this.state.masterProductId) {\r\n //calling this to get masterProductAttribute data when PDP is loading from variantId\r\n productSpecificationData = await getAttributeValuesAsync(\r\n { callerContext: props.context.actionContext, queryResultSettings: {} },\r\n this.state.masterProductId,\r\n props.context.request.apiSettings.channelId,\r\n 0\r\n );\r\n }\r\n let ecomAllVairantStockInfoConcatenated: any[] = [];\r\n // for backward compatiblity\r\n if (!eComAllVariantsOOSMultiAttr || eComAllVariantsOOSMultiAttr === undefined) {\r\n try {\r\n const eComJsonData = productSpecificationData.find(attr => attr.Name?.trim() === ecomAllVairantStockInfoKey)?.TextValue;\r\n const newAllVariantStockInfo = eComJsonData && JSON.parse(eComJsonData);\r\n ecomAllVairantStockInfoConcatenated = [\r\n ...ecomAllVairantStockInfoConcatenated,\r\n ...newAllVariantStockInfo.VariantList.map(\r\n (item: IVariantStockInfo) => `${item.VariantRecID}|${item.OutOfStock ? '1' : '0'}`\r\n )\r\n ];\r\n } catch (error) {\r\n this.telemetryContent.telemetry?.error(`Error ${error} [OOS Checking] ecomAllVairantStockInfoKey`);\r\n console.log(`Error ${error} [OOS Checking] ecomAllVairantStockInfoKey`);\r\n }\r\n } else {\r\n const ecomVairantStockInfoKey1 = ecomAllVairantStockInfoKey1 ? ecomAllVairantStockInfoKey1 : 'EcomAllVariantOOSInfo1';\r\n const ecomVairantStockInfoKey2 = ecomAllVairantStockInfoKey2 ? ecomAllVairantStockInfoKey2 : 'EcomAllVariantOOSInfo2';\r\n const ecomVairantStockInfoKey3 = ecomAllVairantStockInfoKey3 ? ecomAllVairantStockInfoKey3 : 'EcomAllVariantOOSInfo3';\r\n const ecomAllVairantStockInfo1 = productSpecificationData.find(attr => attr.Name?.trim() === ecomVairantStockInfoKey1)\r\n ?.TextValue;\r\n const ecomAllVairantStockInfo2 = productSpecificationData.find(attr => attr.Name?.trim() === ecomVairantStockInfoKey2)\r\n ?.TextValue;\r\n const ecomAllVairantStockInfo3 = productSpecificationData.find(attr => attr.Name?.trim() === ecomVairantStockInfoKey3)\r\n ?.TextValue;\r\n\r\n if (ecomAllVairantStockInfo1) {\r\n try {\r\n ecomAllVairantStockInfoConcatenated = [...ecomAllVairantStockInfoConcatenated, ...JSON.parse(ecomAllVairantStockInfo1)];\r\n } catch (error) {\r\n this.telemetryContent.telemetry?.error(`Error ${error} [OOS Checking] ecomAllVairantStockInfoKey1`);\r\n console.log(`Error ${error} [OOS Checking] ecomAllVairantStockInfoKey1`);\r\n }\r\n }\r\n if (ecomAllVairantStockInfo2) {\r\n try {\r\n ecomAllVairantStockInfoConcatenated = [...ecomAllVairantStockInfoConcatenated, ...JSON.parse(ecomAllVairantStockInfo2)];\r\n } catch (error) {\r\n this.telemetryContent.telemetry?.error(`Error ${error} [OOS Checking] ecomAllVairantStockInfoKey2`);\r\n console.log(`Error ${error} [OOS Checking] ecomAllVairantStockInfoKey2`);\r\n }\r\n }\r\n if (ecomAllVairantStockInfo3) {\r\n try {\r\n ecomAllVairantStockInfoConcatenated = [...ecomAllVairantStockInfoConcatenated, ...JSON.parse(ecomAllVairantStockInfo3)];\r\n } catch (error) {\r\n this.telemetryContent.telemetry?.error(`Error ${error} [OOS Checking] ecomAllVairantStockInfoKey3`);\r\n console.log(`Error ${error} [OOS Checking] ecomAllVairantStockInfoKey3`);\r\n }\r\n }\r\n }\r\n this.setState({ ecomAllVairantStockInfoConcatenated });\r\n variantsResult &&\r\n variantsResult.forEach(async variant => {\r\n // get specfication data for each variant\r\n count++;\r\n if (!productSpecificationData) {\r\n return;\r\n }\r\n let outOfStockBoolean = null;\r\n for (let i = 0; i < ecomAllVairantStockInfoConcatenated.length; i++) {\r\n if (\r\n ecomAllVairantStockInfoConcatenated &&\r\n ecomAllVairantStockInfoConcatenated[i].split('|')[0] === variant.variantID.toString()\r\n ) {\r\n outOfStockBoolean = !!Number(ecomAllVairantStockInfoConcatenated[i].split('|')[1]);\r\n break;\r\n }\r\n }\r\n outOfStockBoolean ? (variant.isAvailable = false) : (variant.isAvailable = true);\r\n if (outOfStockBoolean === null || outOfStockBoolean === undefined) {\r\n variant.isAvailable = false;\r\n }\r\n // get product type for each\r\n const productType = this._getProductAttributeUpdated(productSpecificationData, props);\r\n // set availability for each\r\n if (productType === 'Core') {\r\n if (outOfStockBoolean) {\r\n variant.isAvailable = false;\r\n } else {\r\n variant.isAvailable = true;\r\n }\r\n } else if (productType === 'Small Parcel') {\r\n if (outOfStockBoolean) {\r\n variant.isAvailable = false;\r\n } else {\r\n // tslint:disable: no-floating-promises\r\n availableVariantIDs.push(variant.variantID);\r\n variant.isAvailable = false;\r\n }\r\n }\r\n else if (productType === 'Drop Ship') {\r\n if (outOfStockBoolean) {\r\n variant.isAvailable = false;\r\n } else {\r\n variant.isAvailable = true;\r\n }\r\n }\r\n // update the state\r\n if (availableVariantIDs.length > 0 && count === variantsResult.length) {\r\n const batchedAtp = await _coreProductATPCallForInventoryStatusForAllVariants(\r\n props,\r\n availableVariantIDs,\r\n itemId,\r\n variantsResult\r\n );\r\n this.setState({ batchedAtpInventoryStatusData: batchedAtp });\r\n await this.setDefaultOOSVariant(variantsResult);\r\n } else if (count === variantsResult.length) {\r\n await this.setDefaultOOSVariant(variantsResult);\r\n }\r\n\r\n this.setState({ variantAvailibilityList: variantsResult });\r\n });\r\n };\r\n\r\n private _updateUtagData = async (updatedProduct: SimpleProduct | undefined, updatedPrice?: number) => {\r\n const variantId = await this.getVariantID(updatedProduct);\r\n const price = await this.props.data.productPrice;\r\n const finalPrice = updatedPrice ? updatedPrice : price?.CustomerContextualPrice;\r\n try {\r\n // @ts-ignore\r\n if (utag.data) {\r\n // @ts-ignore\r\n utag.data = {\r\n // @ts-ignore\r\n ...utag.data,\r\n product_price: [`${finalPrice}`],\r\n product_variant: [`${variantId}`],\r\n product_url: [getProductURLForUtag(updatedProduct, this.props.context)],\r\n product_image_url: [`${updatedProduct?.PrimaryImageUrl}`],\r\n product_size: [getProductSizeForUTag(updatedProduct)]\r\n };\r\n }\r\n // @ts-ignore\r\n if (utag_data) {\r\n // @ts-ignore\r\n utag_data = {\r\n // @ts-ignore\r\n ...utag_data,\r\n product_price: [`${finalPrice}`],\r\n product_variant: [`${variantId}`],\r\n product_url: [getProductURLForUtag(updatedProduct, this.props.context)],\r\n product_image_url: [`${updatedProduct?.PrimaryImageUrl}`],\r\n product_size: [getProductSizeForUTag(updatedProduct)]\r\n };\r\n }\r\n } catch (error) {\r\n console.log(error, '[utag_data not found]');\r\n }\r\n };\r\n\r\n private _sendProductDataToTealium = async (props: IMfrmBuyboxProps, product: SimpleProduct | undefined) => {\r\n const {\r\n data: {\r\n productSpecificationData: { result: productSpecificationData },\r\n productPrice,\r\n categoryPaths\r\n },\r\n context: {\r\n request: { }\r\n },\r\n app: {\r\n config: { brandBackofficeAttributePdp }\r\n }\r\n } = props;\r\n const allCategoriesArr = categoryPaths?.result;\r\n const categoryObj = allCategoriesArr && allCategoriesArr[allCategoriesArr?.length - 1];\r\n const categoryName: string | undefined = categoryObj ? `${categoryObj?.Name}` : undefined;\r\n const fallBackBrandAttribute = 'VENDOR BRAND';\r\n const attribute = brandBackofficeAttributePdp || fallBackBrandAttribute;\r\n let productBrandName =\r\n productSpecificationData &&\r\n productSpecificationData?.find(\r\n currAttribute => currAttribute.Name && currAttribute.Name.toLowerCase().trim() === attribute.toLowerCase().trim()\r\n )?.TextValue;\r\n productBrandName = productBrandName ? `${productBrandName}` : undefined;\r\n const variantsResp = await this.getVariantID();\r\n void productPrice.then(async result => {\r\n // @ts-ignore\r\n if (utag) {\r\n const { ItemId, Name } = product || {};\r\n // @ts-ignore\r\n // tslint:disable-next-line: object-literal-key-quotes\r\n utag.link({\r\n event: 'product-detail-view',\r\n event_category: 'ecommerce',\r\n event_action: 'product detail view',\r\n enhanced_action: 'detail',\r\n event_label: `${ItemId}:${Name}`,\r\n event_noninteraction: 'true',\r\n product_id: [`${ItemId}`],\r\n product_name: [`${Name}`],\r\n product_category: [categoryName],\r\n product_brand: [productBrandName],\r\n product_variant: [variantsResp],\r\n product_price: [`${result?.CustomerContextualPrice}`],\r\n product_url: [getProductURLForUtag(product, this.props.context)],\r\n product_image_url: [`${product?.PrimaryImageUrl}`],\r\n product_size: [getProductSizeForUTag(product)]\r\n });\r\n }\r\n });\r\n // VSI - Customization Start - 47480\r\n this.setState({ variantIdForTracking: variantsResp ? variantsResp : '' });\r\n // VSI - Customization End - 47480\r\n };\r\n\r\n private async setDefaultOOSVariant(\r\n variantAvailibilityList: IBuyboxGetDimensionVariantAvailabilityActionData[],\r\n updatedProductSpecificationData?: AttributeValue[] | undefined\r\n ) {\r\n if (variantAvailibilityList?.length > 0) {\r\n const {\r\n data: {\r\n product: { result: product },\r\n allProductVariants: { result: allProductVariants },\r\n productSpecificationData: { result: productSpecificationData },\r\n productDimensions: { result: productDimensions },\r\n dimensionPrices: { result: dimensionPrices }\r\n },\r\n context: {\r\n actionContext,\r\n request: {\r\n apiSettings: { channelId }\r\n }\r\n }\r\n } = this.props;\r\n const prodSpecficationData = updatedProductSpecificationData ? updatedProductSpecificationData : productSpecificationData;\r\n\r\n // VSI - Customization Start 42852\r\n const prices: IBuyboxGetDimensionPricingActionData[] | undefined =\r\n dimensionPrices && (await _getActivePrices(dimensionPrices, actionContext));\r\n let extendedAllProductVariants: IExtendedSimpleProduct[] | undefined =\r\n prices && prices[0].discountAmount ? this.extendAllProductVariants(allProductVariants, prices) : allProductVariants;\r\n extendedAllProductVariants =\r\n extendedAllProductVariants &&\r\n extendedAllProductVariants.sort(\r\n (a, b) =>\r\n (a?.priceAfterDiscount ? a?.priceAfterDiscount : a?.Price) -\r\n (b?.priceAfterDiscount ? b?.priceAfterDiscount : b?.Price)\r\n );\r\n const updatedProduct = await this.getNextInventoryProduct(\r\n product,\r\n prodSpecficationData,\r\n extendedAllProductVariants,\r\n this.props.context,\r\n this.state.variantAvailibilityList ?? variantAvailibilityList\r\n );\r\n if (updatedProduct && updatedProduct.Dimensions && updatedProduct.Dimensions.length > 0) {\r\n const dimensions: ProductDimensionFull[] = [];\r\n for (const dimension of updatedProduct.Dimensions) {\r\n const dimensionValues = await getDimensionValuesAsync(\r\n { callerContext: actionContext, queryResultSettings: {} },\r\n updatedProduct.MasterProductId ? updatedProduct.MasterProductId : updatedProduct.RecordId,\r\n channelId,\r\n dimension.DimensionTypeValue,\r\n [],\r\n null\r\n );\r\n const fullDimension = {\r\n ...dimension,\r\n DimensionValues: dimensionValues\r\n };\r\n dimensions.push(fullDimension);\r\n }\r\n this.setState({\r\n currentProduct: updatedProduct,\r\n currentProductDimensions: dimensions\r\n });\r\n // updated Product is a different product than product in props\r\n if (product?.RecordId !== updatedProduct?.RecordId) {\r\n await this._updateDimensions(updatedProduct, dimensions);\r\n await this._updateUtagData(updatedProduct);\r\n } else {\r\n this._updateURLWithoutReloading(updatedProduct);\r\n }\r\n } else {\r\n console.log('updated product doesnt have dimesions=>');\r\n this.setState({\r\n currentProduct: product,\r\n currentProductDimensions: productDimensions\r\n });\r\n this._updateURLWithoutReloading(product);\r\n await this._sendProductDataToTealium(this.props, product);\r\n }\r\n }\r\n }\r\n\r\n private async _isOrderQuantityLimitsFeatureEnabled(): 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 if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\r\n return true;\r\n }\r\n let customerInfo;\r\n try {\r\n customerInfo = await this.props.data.customerInformation;\r\n } catch (error) {\r\n // this.props.telemetry.information(error);\r\n this.props.telemetry.debug('Unable to receive Customer Information. May be user is not authorized');\r\n return false;\r\n }\r\n\r\n return (\r\n customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b))\r\n );\r\n }\r\n\r\n private async _updateQuantitiesInState(product: SimpleProduct): Promise {\r\n const isOrderQuantityLimitsFeatureEnabled = await this._isOrderQuantityLimitsFeatureEnabled();\r\n if (isOrderQuantityLimitsFeatureEnabled && product) {\r\n this.setState({\r\n quantity: product.Behavior?.DefaultQuantity || 1,\r\n min: product.Behavior?.MinimumQuantity || 1,\r\n // If max by feature in default order settings is not defined then use max from site settings or default max 10.\r\n max:\r\n product.Behavior?.MaximumQuantity && product.Behavior?.MaximumQuantity > 0\r\n ? product.Behavior?.MaximumQuantity\r\n : this.props.context.app.config.maxQuantityForCartLineItem || 10\r\n });\r\n } else {\r\n this.setState({\r\n min: 1,\r\n max: this.props.context.app.config.maxQuantityForCartLineItem || 10\r\n });\r\n }\r\n }\r\n\r\n private async _updateVariantIDForTracking(): Promise {\r\n const variantId = await this.getVariantID();\r\n this.setState({ variantIdForTracking: variantId ? variantId : '' });\r\n }\r\n\r\n private _eyeBrowMessageAsyncFunc = async (isCached: boolean): Promise => {\r\n const {\r\n context,\r\n data: {\r\n product: { result }\r\n }\r\n } = this.props;\r\n const priceGroupForAPICall = context.app.config.priceGroup;\r\n if (priceGroupForAPICall) {\r\n const productIdsArray: IMFIItem[] | undefined = [];\r\n const eyebrowMessageObj: IMFIItem = {\r\n ItemId: result?.ItemId === undefined ? '' : result?.ItemId,\r\n DistinctProductVariant: result?.RecordId?.toString()\r\n };\r\n productIdsArray.push(eyebrowMessageObj);\r\n if (productIdsArray && productIdsArray.length > 0) {\r\n const eyebrowMessageResult = _getEyebrowMessage(productIdsArray, context, isCached, 'pdp');\r\n eyebrowMessageResult\r\n ?.then((data: IMFIPromotion[] | null) => {\r\n this.setState({ eyebrowMessageResultState: data });\r\n })\r\n .catch(e => {\r\n console.log('Error', e);\r\n });\r\n }\r\n }\r\n };\r\n\r\n private getDeliverySlotFromATP = async (isCached: boolean): Promise => {\r\n const itemLinesArray = [];\r\n const {\r\n data: {\r\n product: { result: product }\r\n },\r\n context: {\r\n app: {\r\n config: { weeksPDPforATPCall }\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 (product) {\r\n const itemLines: IMFICartLine = {\r\n ItemId: product.ItemId,\r\n Quantity: 1,\r\n VariantRecordId: product.RecordId.toString()\r\n };\r\n itemLinesArray.push(itemLines);\r\n const currentDate = Date.now();\r\n const requestBody: IMFICLDeliveryScheduleParameters = {\r\n InventoryType: 'Delivery',\r\n Weeks: weeksPDPforATPCall,\r\n StoreId: '',\r\n Page: 'pdp',\r\n RequestedDate: dayjs(currentDate).format('MM/DD/YYYY'),\r\n ZipCode: zipcode,\r\n ItemLines: itemLinesArray\r\n };\r\n _getDeliveryByMessage(requestBody, this.props.context, isCached)\r\n .then(result => {\r\n if (result !== undefined && result?.ATPInventoryData) {\r\n // setCoreProductATPData(result?.ATPInventoryData);\r\n this.setState({\r\n deliveryMessageATPResultState: result?.ATPInventoryData\r\n });\r\n }\r\n })\r\n .catch(e => {\r\n console.log('Error', e);\r\n });\r\n }\r\n };\r\n\r\n private _tryInStoreAsyncCall = async () => {\r\n const {\r\n context: { actionContext, app },\r\n data: {\r\n product: { result: product }\r\n }\r\n } = this.props;\r\n // VSI Customization - Start\r\n const isSociEnabled = this.props.app.config.enableSociLocations || false;\r\n const preferredStore = isSociEnabled ? this._getSociPreferredStore() : this._getPreferredStore();\r\n\r\n // Todo: Zip code is being modified as we are not getting proper zip code.. It will be reverted back as it get modified/validate from backoffice\r\n const zipCodeModified = preferredStore && (!isSociEnabled ? preferredStore.Zip?.split('-')[0] : preferredStore?.Zip);\r\n const projectMetaSoci = isSociEnabled && preferredStore?.project_meta ? JSON.parse(preferredStore?.project_meta) : '';\r\n const sociStore = projectMetaSoci ? projectMetaSoci['Corporate ID'] : '';\r\n const sociStoreID = sociStore && (sociStore?.length > 6 ? sociStore : `000000${sociStore}`?.slice(-6));\r\n const tryInStoreProductIDs: IMFITryInStore = {\r\n ZipCode: zipCodeModified,\r\n StoreId: isSociEnabled ? sociStoreID : preferredStore?.OrgUnitNumber!,\r\n Products: product?.ItemId?.toString(),\r\n Limit: app.config.tryInStoreLimit || 10,\r\n Radius: app.config.tryInStoreLookupRadius || 50\r\n };\r\n const getTryInStoreInfoInput = new GetTryInStoreInfoInput(tryInStoreProductIDs);\r\n try {\r\n const response = await getTryInStoreAction(getTryInStoreInfoInput, actionContext);\r\n this.setState({\r\n tryInStoresResults: response,\r\n OrgUnitNumber: isSociEnabled ? sociStoreID : preferredStore && preferredStore.OrgUnitNumber ? preferredStore.OrgUnitNumber : '0'\r\n });\r\n } catch (error) {\r\n console.log(error);\r\n }\r\n };\r\n // tslint:disable-next-line:max-func-body-length\r\n private _updateDimensions = async (updatedProduct?: SimpleProduct, dimensions?: ProductDimensionFull[] | undefined): Promise => {\r\n const {\r\n data: {\r\n product: { result: prevProduct },\r\n productDimensions: { result: dimensionsArr }\r\n },\r\n context: {\r\n actionContext,\r\n request: {\r\n apiSettings: { channelId }\r\n }\r\n }\r\n } = this.props;\r\n const product = updatedProduct ? updatedProduct : prevProduct;\r\n const productDimensions = dimensions ? dimensions : dimensionsArr;\r\n if (!product || !productDimensions) {\r\n return;\r\n }\r\n\r\n const dimensionsToUpdate: { [id: number]: string } = { ...this.dimensions };\r\n // this._setSmallParcelATPCallMade(true);\r\n this.setState({ isUpdatingDimension: true, isUpdatingDeliveryOptions: true });\r\n // Step 1: Clear error state to display relevant errors\r\n if (this.state.errorState.otherError || this.state.errorState.quantityError) {\r\n const clearErrorState = { ...this.state.errorState };\r\n clearErrorState.otherError = undefined;\r\n if (this.state.errorState.errorHost === 'ADDTOCART') {\r\n clearErrorState.quantityError = undefined;\r\n clearErrorState.errorHost = undefined;\r\n }\r\n this.setState({ errorState: clearErrorState });\r\n }\r\n\r\n // Step 2: Clear any errors indicating the dimension wasn't selected\r\n for (const key of Object.keys(dimensionsToUpdate)) {\r\n if (this.state.errorState.configureErrors[key]) {\r\n const errorState = { ...this.state.errorState };\r\n errorState.configureErrors[key] = undefined;\r\n\r\n this.setState({ errorState: errorState });\r\n }\r\n }\r\n\r\n // Step 3, Build the actually selected dimensions, prioritizing the information in state\r\n // over the information in data\r\n const nextProductDimensions: ProductDimensionFull[] = [];\r\n const mappedDimensions =\r\n productDimensions?.length > 0\r\n ? productDimensions\r\n ?.map(dimension => {\r\n const obj = dimension && {\r\n DimensionTypeValue: dimension.DimensionTypeValue,\r\n DimensionValue:\r\n this._updateDimensionValue(dimension, dimensionsToUpdate[dimension.DimensionTypeValue]) ??\r\n dimension.DimensionValue ?? product.Dimensions?.find(dim => dim.DimensionTypeValue === dimension.DimensionTypeValue)?.DimensionValue,\r\n ExtensionProperties: dimension.ExtensionProperties,\r\n DimensionValues: dimension.DimensionValues\r\n };\r\n nextProductDimensions.push(obj);\r\n return (\r\n dimension && {\r\n DimensionTypeValue: dimension.DimensionTypeValue,\r\n DimensionValue:\r\n this._updateDimensionValue(dimension, dimensionsToUpdate[dimension.DimensionTypeValue]) ??\r\n dimension.DimensionValue ?? product.Dimensions?.find(dim => dim.DimensionTypeValue === dimension.DimensionTypeValue)?.DimensionValue,\r\n ExtensionProperties: dimension.ExtensionProperties\r\n }\r\n );\r\n })\r\n .filter(dimension => {\r\n return dimension?.DimensionValue;\r\n })\r\n : [];\r\n const variants = getVariantsByDimensionValuesAsync(\r\n { callerContext: actionContext, queryResultSettings: {} },\r\n product.MasterProductId ? product.MasterProductId : product.RecordId,\r\n channelId,\r\n mappedDimensions\r\n );\r\n\r\n // Step 4. Use these dimensions hydrate the product. Wrap this in a promise\r\n // so that places like add to cart can await it\r\n const selectedProduct = await variants;\r\n this.props.context.app.config.queryBasedVariantSelection && this._updateQueryParamVariantId(selectedProduct[0]?.RecordId);\r\n\r\n this.setState({ selectedProduct: variants[0] });\r\n const variantProduct = selectedProduct[0];\r\n\r\n if (variantProduct) {\r\n // Step 5. Use these dimensions hydrate the inventory. Wrap this in a promise\r\n // so that places like add to cart can await it\r\n const newAvailableQuantity = await getProductAvailabilitiesForSelectedVariant(\r\n new ProductAvailabilitiesForSelectedVariantInput(variantProduct.RecordId, channelId),\r\n actionContext\r\n );\r\n\r\n const isCustompriceSelected =\r\n variantProduct &&\r\n variantProduct.Dimensions &&\r\n variantProduct.Dimensions.find(\r\n dimension =>\r\n dimension.DimensionTypeValue === 4 && dimension.DimensionValue && dimension.DimensionValue.Value === 'Custom'\r\n );\r\n if (isCustompriceSelected) {\r\n this.setState({ isCustomPriceSelected: true });\r\n } else {\r\n // Remove custom amount error when unselect the custom amount\r\n const errorState = { ...this.state.errorState };\r\n errorState.customAmountError = undefined;\r\n\r\n this.setState({ isCustomPriceSelected: false, isPriceKeyedIn: false, errorState: errorState });\r\n }\r\n\r\n if (newAvailableQuantity?.length) {\r\n this.setState({ productAvailableQuantity: newAvailableQuantity[0] });\r\n } else {\r\n this.setState({ productAvailableQuantity: undefined });\r\n }\r\n\r\n // Step 6. Use these dimensions hydrate the product price.\r\n const newPrice = await getPriceForSelectedVariant(\r\n new PriceForSelectedVariantInput(variantProduct.RecordId, channelId),\r\n actionContext\r\n );\r\n\r\n if (newPrice) {\r\n this._updatePrice(newPrice);\r\n }\r\n\r\n // const RetailMulitplePickupMFeatureState = this.props.data.featureState.result?.find(featureState => featureState.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature');\r\n // Step 7. Use these dimensions hydrate the product delivery options.\r\n const newDeliveryOptions = await getDeliveryOptionsForSelectedVariant(\r\n new GetDeliveryOptionsForSelectedVariantInput(\r\n variantProduct.RecordId,\r\n channelId,\r\n undefined,\r\n undefined\r\n // RetailMulitplePickupMFeatureState?.IsEnabled\r\n ),\r\n actionContext\r\n );\r\n\r\n if (newDeliveryOptions) {\r\n this.setState({ productDeliveryOptions: newDeliveryOptions });\r\n }\r\n this.setState({\r\n currentProduct: variantProduct,\r\n currentProductDimensions: nextProductDimensions\r\n });\r\n await this._updateQuantitiesInState(variantProduct);\r\n await this.makeCoreProductDeliveryMessage('ATP update dimnesions');\r\n // VSI - Customization Start - 47480\r\n await this._updateVariantIDForTracking();\r\n // VSI - Customization End - 47480\r\n // VSI - Customization Start - 27818\r\n // VSI - Customization End - 27818\r\n // VSI - Customization Start - 42674\r\n this._updateURLWithoutReloading(variantProduct);\r\n // VSI - Customization End - 42674\r\n }\r\n };\r\n // Render()\r\n public render(): JSX.Element | null {\r\n const {\r\n slots: { mediaGallery },\r\n data: {\r\n product: { result: product },\r\n productSpecificationData: { result: productSpecificationData },\r\n selectedFoundation: { result: adjustableItem },\r\n completeYourBedPillow: { result: pillow },\r\n completeYourBedProtector:{result: protector}\r\n },\r\n config: { className = '' },\r\n app: { config: { brandBackofficeAttributePdp } }\r\n } = this.props;\r\n const { max } = this.state;\r\n if (!product) {\r\n this.props.context.telemetry.error('Product content is empty, module wont render');\r\n return null;\r\n }\r\n const props = (this.props as unknown) as IBuyboxExtentedProps;\r\n const defaultMinimumKeyInPrice = 10;\r\n const defaultMaximumKeyInPrice = 100;\r\n const brandName = parseBrandName(productSpecificationData, brandBackofficeAttributePdp) || '';\r\n const viewProps: IBuyboxViewProps & IMFRMNetworkCallsState & IMFRMProductMExtensionPropsInfo = {\r\n ...(this.props as IMfrmBuyboxProps),\r\n state: this.state,\r\n mediaGallery: mediaGallery?.length > 0 ? mediaGallery[0] : undefined,\r\n ModuleProps: {\r\n moduleProps: this.props,\r\n className: classnames('ms-buybox', className)\r\n },\r\n ProductInfoContainerProps: {\r\n className: 'ms-buybox__content'\r\n },\r\n MediaGalleryContainerProps: {\r\n className: 'ms-buybox__media-gallery'\r\n },\r\n telemetryContent: this.telemetryContent,\r\n callbacks: this.buyboxCallbacks,\r\n title: getBuyboxProductTitle(props, undefined, brandName),\r\n description: getBuyboxProductDescription(props),\r\n configure: getBuyboxProductConfigure(props, this.state, this.buyboxCallbacks),\r\n findInStore: getBuyboxFindInStore(this.props, this.state, this.buyboxCallbacks),\r\n price: getBuyboxProductPrice(props, this.state),\r\n addToCart: getBuyboxAddToCart(props, this.state, this.buyboxCallbacks, defaultMinimumKeyInPrice, defaultMaximumKeyInPrice),\r\n viewCartLink: getUrlSync('cart', props.context.actionContext),\r\n rating: !props.context.app.config.hideRating && getBuyboxProductRating(props),\r\n quantity: undefined,\r\n inventoryLabel: getBuyBoxInventoryLabel(props),\r\n shopSimilarLook:\r\n this.props.config.enableShopSimilarLooks && !product.IsGiftCard\r\n ? getBuyboxShopSimilarButton(props, ShopSimiliarButtonType.Looks)\r\n : undefined,\r\n shopSimilarDescription:\r\n this.props.config.enableShopSimilarDescription && !product.IsGiftCard\r\n ? getBuyboxShopSimilarButton(props, ShopSimiliarButtonType.Description)\r\n : undefined,\r\n keyInPrice:\r\n this.props.config.enableKeyInPrice && this.state.isCustomPriceSelected\r\n ? getBuyboxKeyInPrice(props, this.state, this.buyboxCallbacks)\r\n : undefined,\r\n quantityLimitsMessages: getQuantityLimitsMessages(props, this.state),\r\n max: max,\r\n smallParcelATCallMade: this.state.smallParcelATCallMade,\r\n setSmallParcelATPCallMade: this._setSmallParcelATPCallMade,\r\n StatusATPCall: this.state.StatusATPCall,\r\n setStatusATPCall: this._setStatusATPCall,\r\n ATPCall: this.state.ATPCall,\r\n setATPCall: this._setATPCall,\r\n extensionProps: this.state.extensionProps,\r\n productBadges:\r\n props.app.config.productBadgeAttribute &&\r\n this.props.data.productSpecificationData?.result?.length &&\r\n this._getProductBadges(),\r\n ratingComponent: !props.context.app.config?.hideRating && this._getBuyboxProductRating(),\r\n _renderTryInStoreRedesign: this._renderTryInStoreRedesign(),\r\n _renderTryInStore: this._renderTryInStore(),\r\n eyeBrowMessage: product && this._renderEyeBrowMessage(),\r\n promotionalMessage: this.state?.eyebrowMessageResultState?.[0]?.EyeBrows?.[0].Description?.split(\"|\")[1],\r\n deliveryMessage: this.state.deliveryMessage,\r\n ATPDataFromBusiness: this.state.deliveryMessageATPResultState,\r\n updateDimension: this.state.isUpdatingDimension,\r\n showViewCartLink: this.state.showViewCartLink,\r\n updateSuccessfulATC: this.updateSuccessfulATC,\r\n getProductType: this._getProductType,\r\n setAllProductVariantsResult: this._setAllProductVariantsResult,\r\n ecomAllVairantStockInfoConcatenated: this.state.ecomAllVairantStockInfoConcatenated,\r\n customerSatisfactionScore: this._renderCSATScore(),\r\n adjustableItem,\r\n pillow,\r\n protector\r\n };\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n //other methods that return JSX.Element\r\n // tslint:disable-next-line: cyclomatic-complexity\r\n private _getBuyboxProductRating = (): React.ReactElement | undefined => {\r\n const {\r\n id,\r\n typeName,\r\n context,\r\n data: {\r\n productSpecificationData: { result: productSpecification }\r\n },\r\n resources\r\n } = this.props;\r\n const averageRating = getBVAttributeValues(productSpecification, 'BVAverageOverallRating');\r\n const reviewsCount = getBVAttributeValues(productSpecification, 'BVTotalReviewCount');\r\n const ratingComponent = (\r\n \r\n {productSpecification && (averageRating || reviewsCount) ? (\r\n \r\n ) : (\r\n <>\r\n \r\n Write the first review\r\n \r\n )}\r\n \r\n );\r\n return productSpecification && ratingComponent && ratingComponent;\r\n };\r\n\r\n private _renderTryInStore = (): JSX.Element | null => {\r\n const {\r\n resources: { availableInStoresText, notAvailableInStoresText, onlineOnlyProductsText },\r\n context: {\r\n app: { config }\r\n }\r\n } = this.props;\r\n // VSI Customization - Start\r\n const preferredStore = this._getPreferredStore();\r\n // VSI Customization - END\r\n const isOnlineOnly = this._getProductSpecificationAttributeByKeyName(config?.onlineOnlyBackOfficeAttribute);\r\n const storeName: string | undefined =\r\n (preferredStore && preferredStore.ExtensionProperties?.find(x => x.Key === 'Yext_Store_Name')?.Value?.StringValue) ||\r\n (preferredStore && preferredStore.OrgUnitName);\r\n const storeNameWithState = `${storeName}, ${preferredStore?.State}`;\r\n const availableStoreText = storeName && availableInStoresText.replace('{storeName}', `${storeNameWithState}`);\r\n const notAvailableStoreText = storeName && notAvailableInStoresText.replace('{storeName}', `${storeNameWithState}`);\r\n const canTryInStores = this._getProductSpecificationAttributeByKeyName('try in store');\r\n const onHandleFindPreferredStore = async (): Promise => {\r\n const {\r\n data: {\r\n storeSelectorStateManager: { result: storeSelectorStateManager }\r\n },\r\n modules\r\n } = this.props;\r\n if (!storeSelectorStateManager) {\r\n return;\r\n }\r\n let storeSelectorId: string = '';\r\n if (modules && Object.keys(modules).length > 0 && modules.mfrmStoreSelector && modules.mfrmStoreSelector.length > 0) {\r\n storeSelectorId = modules.mfrmStoreSelector[0].id;\r\n }\r\n MsDyn365.isBrowser && document.body.classList.add('modal-store-locator-toggle-pdp');\r\n storeSelectorStateManager\r\n ?.openDialog({\r\n id: storeSelectorId,\r\n showMapViewLink: false,\r\n onLocationSelected: () => {\r\n return Promise.resolve();\r\n }\r\n })\r\n .catch((error: Error) => {\r\n if (this.props.telemetry) {\r\n this.props.telemetry.error(error.message);\r\n this.props.telemetry.debug('Unable to set preferred store');\r\n }\r\n return;\r\n });\r\n };\r\n\r\n const { Inventory, Status } = { ...this.state.tryInStoresResults };\r\n if (Status === 'Success' && canTryInStores) {\r\n return (\r\n \r\n {Inventory?.length !== 0 && }\r\n {Inventory?.length === 0 && }\r\n \r\n );\r\n } else if (!canTryInStores && isOnlineOnly) {\r\n return (\r\n \r\n {}\r\n \r\n );\r\n } else {\r\n return null;\r\n }\r\n };\r\n\r\n private _renderStoreHours = (location: OrgUnitLocation): JSX.Element | null => {\r\n const isClosedToday = location.ExtensionProperties?.find(x => x.Key === 'Yext_Today_IsClosed')?.Value?.BooleanValue;\r\n const isClosed = location.ExtensionProperties?.find(x => x.Key === 'Yext_Is_Store_Closed')?.Value?.BooleanValue;\r\n const startTime = location.ExtensionProperties?.find(x => x.Key === 'Yext_Today_OpenFrom')?.Value?.IntegerValue;\r\n const endTime = location.ExtensionProperties?.find(x => x.Key === 'Yext_Today_OpenTo')?.Value?.IntegerValue;\r\n const timeZone = location.ExtensionProperties?.find(x => x.Key === 'Channel_TimeZone_InfoId')?.Value?.StringValue;\r\n const timeZoneAbbr = getTimeZoneAbbr(timeZone);\r\n const { storeHoursClosedText, storeCloseAtHours, storeOpenAtHours } = this.props.resources;\r\n if (isClosedToday && isClosedToday !== null) {\r\n return (\r\n Today: {storeHoursClosedText}\r\n );\r\n } else if (startTime !== null || endTime !== null) {\r\n return (\r\n \r\n Today: {!isClosed\r\n ? `${storeCloseAtHours} ${secondsToTime(endTime)} ${timeZoneAbbr}`\r\n : `${storeOpenAtHours} ${secondsToTime(startTime)} ${timeZoneAbbr}`}\r\n \r\n );\r\n } else {\r\n return null;\r\n }\r\n };\r\n\r\n private _renderTryInStoreRedesign = (): JSX.Element | null => {\r\n const {\r\n resources: { availableInStoresTextV2, notAvailableInStoresTextV2, viewStoreDetailsText, changeStoreText },\r\n context: {\r\n app: { config }\r\n }\r\n } = this.props;\r\n // VSI Customization - Start\r\n const isSociEnabled = this.props.app.config.enableSociLocations;\r\n const preferredStore = this._getPreferredStore();\r\n const sociPrefferedStore = this._getSociPreferredStore();\r\n\r\n // VSI Customization - END\r\n const isOnlineOnly = this._getProductSpecificationAttributeByKeyName(config?.onlineOnlyBackOfficeAttribute);\r\n // eslint-disable-next-line\r\n const sociStoreName = isSociEnabled && sociPrefferedStore?.name || '';\r\n const storeName: string | undefined = preferredStore && ((preferredStore.ExtensionProperties?.find(x => x.Key === 'Yext_Store_Name')?.Value?.StringValue) || preferredStore?.OrgUnitName);\r\n const storeNameWithState = isSociEnabled ? `${sociStoreName}, ${sociPrefferedStore?.state}` : `${storeName}, ${preferredStore?.State}`;\r\n const canTryInStores = this._getProductSpecificationAttributeByKeyName('try in store');\r\n const onHandleFindPreferredStore = async (): Promise => {\r\n const {\r\n data: {\r\n storeSelectorStateManager: { result: storeSelectorStateManager }\r\n },\r\n modules\r\n } = this.props;\r\n if (!storeSelectorStateManager) {\r\n return;\r\n }\r\n let storeSelectorId: string = '';\r\n if (modules && Object.keys(modules).length > 0 && modules.mfrmStoreSelector && modules.mfrmStoreSelector.length > 0) {\r\n storeSelectorId = modules.mfrmStoreSelector[0].id;\r\n }\r\n MsDyn365.isBrowser && document.body.classList.add('modal-store-locator-toggle-pdp');\r\n this.setState({ isStoreDetailsOpen: false });\r\n storeSelectorStateManager\r\n ?.openDialog({\r\n id: storeSelectorId,\r\n showMapViewLink: false,\r\n onLocationSelected: () => {\r\n return Promise.resolve();\r\n }\r\n })\r\n .catch((error: Error) => {\r\n if (this.props.telemetry) {\r\n this.props.telemetry.error(error.message);\r\n this.props.telemetry.debug('Unable to set preferred store');\r\n }\r\n return;\r\n });\r\n };\r\n\r\n const { Inventory, Status } = { ...this.state.tryInStoresResults };\r\n if (Status === 'Success' && canTryInStores && Inventory?.length !== 0) {\r\n const { isStoreDetailsOpen } = this.state;\r\n const storeLocatorContext = preferredStore && preferredStore.Contacts ? preferredStore.Contacts.find(url => url.ContactTypeValue === 3) : undefined;\r\n const extractPhoneNumber = (contacts: OrgUnitContact[] | undefined): string | undefined => {\r\n if (!contacts) {\r\n return undefined;\r\n }\r\n const allPhoneContacts = contacts.filter(contact => contact.ContactTypeValue === 1 && !contact.IsPrivate);\r\n if (allPhoneContacts && allPhoneContacts.length > 0) {\r\n const primaryPhoneContact = allPhoneContacts.find(contact => contact.IsPrimary);\r\n if (primaryPhoneContact) {\r\n return primaryPhoneContact.Locator;\r\n }\r\n return allPhoneContacts[0].Locator;\r\n }\r\n return undefined;\r\n };\r\n const storeLocatorUrl: string | undefined = storeLocatorContext\r\n ? storeLocatorContext.Locator\r\n : `https://bing.com/maps/default.aspx?where1=${preferredStore?.Address}`;\r\n const sociStoreLocatorUrl: string | undefined = sociPrefferedStore?.website_url || '';\r\n const storeAddressLine1: string | undefined = isSociEnabled && sociPrefferedStore ? sociPrefferedStore.address1 : preferredStore?.Street;\r\n const storeAddressLine2: string | undefined = isSociEnabled && sociPrefferedStore ? sociPrefferedStore.address2 : `${preferredStore?.City}, ${preferredStore?.State} ${preferredStore?.Zip}`;\r\n\r\n // VSI Customization - ends\r\n const phoneNumber: string | undefined = isSociEnabled ? sociPrefferedStore?.phone: extractPhoneNumber(preferredStore?.Contacts);\r\n if (!isStoreDetailsOpen) {\r\n return (\r\n \r\n \r\n \r\n {availableInStoresTextV2}\r\n \r\n {storeNameWithState}\r\n \r\n \r\n \r\n );\r\n } else {\r\n return (\r\n \r\n \r\n \r\n \r\n {availableInStoresTextV2}\r\n {storeNameWithState}\r\n \r\n \r\n \r\n \r\n {isSociEnabled && sociPrefferedStore ? \r\n {storeAddressLine1}\r\n {storeAddressLine2}\r\n {sociPrefferedStore && {`${sociPrefferedStore.city}, ${sociPrefferedStore.state} ${sociPrefferedStore.postalcode}`}}\r\n :\r\n \r\n {storeAddressLine1}\r\n {storeAddressLine2}\r\n \r\n }\r\n {phoneNumber && {phoneNumber}}\r\n {!isSociEnabled && this._renderStoreHours(preferredStore!)}\r\n \r\n {viewStoreDetailsText}\r\n {changeStoreText}\r\n \r\n \r\n \r\n \r\n );\r\n }\r\n } else if (Status === 'Success' && canTryInStores && Inventory?.length === 0) {\r\n return (\r\n \r\n \r\n \r\n {notAvailableInStoresTextV2}\r\n \r\n {storeNameWithState}\r\n \r\n \r\n \r\n \r\n );\r\n } else if (storeName && !canTryInStores && isOnlineOnly) {\r\n // displaying not available to Try-In store as per ADO #64278\r\n return (\r\n \r\n \r\n \r\n {notAvailableInStoresTextV2}\r\n \r\n {storeNameWithState}\r\n \r\n \r\n \r\n \r\n );\r\n } else {\r\n return null;\r\n }\r\n };\r\n\r\n private _getProductBadges = (): JSX.Element | undefined => {\r\n // find the configured backend attribute\r\n const {\r\n context: { request },\r\n data: { productSpecificationData },\r\n app: {\r\n config: { productBadgeAttribute: attribute }\r\n }\r\n } = this.props;\r\n const badgeData =\r\n attribute &&\r\n productSpecificationData.result?.find(\r\n currAttribute => currAttribute.Name && currAttribute.Name.toLowerCase().trim() === attribute.toLowerCase().trim()\r\n )?.TextValue;\r\n if (!badgeData) {\r\n return;\r\n }\r\n\r\n // split badge data into its separate badges\r\n const badges = badgeData?.split(',');\r\n\r\n // parse badge data to get its schedule and image src\r\n const parsedBadges = badges?.map((badge: string) => parseBadgeData(badge, request));\r\n\r\n // build product badge image components\r\n // tslint:disable-next-line: no-any\r\n const finalizedBadges =\r\n parsedBadges && parsedBadges.map((parsedBadge: any) => parsedBadge && buildProductBadge(parsedBadge, request));\r\n return finalizedBadges && <>{finalizedBadges};\r\n };\r\n\r\n // tslint:disable-next-line: cyclomatic-complexity\r\n private _renderEyeBrowMessage = (): JSX.Element | undefined => {\r\n const {\r\n config: { targetAudienceGroup }\r\n } = this.props;\r\n // VSI Customization - START - 24659\r\n const trackingEyebrow = (message: string): void => {\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({ 'event': 'pdp-eyebrow-messages', 'event_category': 'pdp eyebrow message', 'event_action': 'eyebrow message click', 'event_label': `${message}`, 'event_noninteraction': 'false' });\r\n }\r\n };\r\n // VSI Customization - END - 24659\r\n /* VSI-Customization -- START Eyebrow message will render based on targetAudienceGroup config */\r\n const { eyebrowMessageResultState } = { ...this.state };\r\n let eyebrowMessage: string = '';\r\n if (eyebrowMessageResultState && eyebrowMessageResultState.length > 0) {\r\n if (\r\n eyebrowMessageResultState[0].EyeBrows &&\r\n eyebrowMessageResultState[0].EyeBrows.length &&\r\n eyebrowMessageResultState[0].EyeBrows.length > 0\r\n ) {\r\n // if value configured then match the audeinece group and return that message\r\n // if targetAudienceGroup not found return empty string (default 902 line #)\r\n if (targetAudienceGroup) {\r\n for (const eyebrow of eyebrowMessageResultState[0].EyeBrows) {\r\n const description = eyebrow.Description?.split('|')[2]?.toLowerCase();\r\n if (description === targetAudienceGroup.toLowerCase()) {\r\n eyebrowMessage = eyebrow?.Description!;\r\n break;\r\n }\r\n }\r\n // If no value configured then show the first EyebrowMessage without audienceGroup\r\n } else {\r\n for (const eyebrow of eyebrowMessageResultState[0].EyeBrows) {\r\n if (eyebrow.Description?.split('|').length === 2) {\r\n eyebrowMessage = eyebrow?.Description;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n /* VSI-Customization -- END */\r\n let splitMessage: string[] = [];\r\n let emptyClassName;\r\n let emptyClassNameButton;\r\n if (eyebrowMessage !== '') {\r\n splitMessage = eyebrowMessage?.split('|');\r\n if (splitMessage[1] === '' || splitMessage[1] === undefined) {\r\n emptyClassName = 'mfrm-eyebrow--empty';\r\n emptyClassNameButton = 'no-click';\r\n }\r\n }\r\n if (!eyebrowMessage) {\r\n return;\r\n }\r\n return (\r\n <>\r\n {/* // VSI Customization - START - 24659 */}\r\n {splitMessage && splitMessage?.length > 0 && (\r\n trackingEyebrow(splitMessage[1] ? splitMessage[1] : '')}\r\n role='button'\r\n >\r\n {/* // VSI Customization - END - 24659 */}\r\n }\r\n triggerClass={`mfrm-eyebrow__button ${emptyClassNameButton}`}\r\n contentClass={`mfrm-eyebrow__content ${emptyClassName}`}\r\n position={'bottom-end'}\r\n offsetY={10}\r\n outline='shadow'\r\n // @ts-ignore\r\n tooltipContent={splitMessage[1] && splitMessage[1] !== '' && }\r\n />\r\n \r\n )}\r\n \r\n );\r\n };\r\n\r\n private _renderCSATScore = (): JSX.Element => {\r\n const {\r\n data: { productSpecificationData },\r\n config\r\n } = this.props;\r\n const isDesktop = this.state.isDesktop;\r\n let unitsReturned: string | number | undefined = productSpecificationData?.result?.find(attr => attr.Name?.toLowerCase() === 'units_returned')?.TextValue;\r\n let unitsSold: string | number | undefined = productSpecificationData?.result?.find(attr => attr.Name?.toLowerCase() === 'units_sold')?.TextValue;\r\n if (!unitsSold || unitsSold === \"0\" || Number.isNaN(unitsSold)) { return <>; }\r\n unitsReturned = Number(unitsReturned);\r\n unitsReturned = Number.isNaN(unitsReturned) ? 0 : unitsReturned;\r\n unitsSold = Number(unitsSold);\r\n const unitsNotReturend = unitsSold - unitsReturned;\r\n const avgRating = (unitsNotReturend * 5) / unitsSold;\r\n const perNotReturned: number = Math.round(100 - (Number(unitsReturned) / Number(unitsSold)) * 100);\r\n return (\r\n \r\n {config.cSatRatingHeadingText && config.cSatRatingHeadingText.replace('{perNotReturned}', `${perNotReturned}%`)}\r\n }\r\n position=\"bottom-left\"\r\n hover={isDesktop}\r\n >\r\n
\r\n \r\n {config.cSatRatingPopoverText && config.cSatRatingPopoverText.replace('{unitsNotReturend}', unitsNotReturend.toLocaleString()).replace('{unitsSold}', unitsSold.toLocaleString())}\r\n \r\n \r\n \r\n
\r\n {`${perNotReturned}%`}\r\n {`(${(unitsNotReturend).toLocaleString()})`}\r\n
\r\n
\r\n
\r\n \r\n
\r\n );\r\n };\r\n\r\n}\r\n\r\nexport default Buybox;\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 { RegularStoreHours } from '@msdyn365-commerce/retail-proxy';\r\nimport get from 'lodash/get';\r\nimport { IStoreSelectorLocationLineItemResources } from '.';\r\n\r\nexport interface IHoursDisplayInfo {\r\n startDayShort: string;\r\n startDayFull: string;\r\n endDayShort?: string;\r\n endDayFull?: string;\r\n timeRange: string;\r\n}\r\n\r\nexport interface IHoursInfo {\r\n isClosed: boolean;\r\n openTime?: number;\r\n closeTime?: number;\r\n}\r\n\r\ntype DayType = 'MON' | 'TUE' | 'WED' | 'THU' | 'FRI' | 'SAT' | 'SUN';\r\n\r\nexport const secondsToTime = (seconds: number | undefined): string | undefined => {\r\n if (seconds === undefined) {\r\n return undefined;\r\n } else {\r\n let hours = Math.floor(seconds / (60 * 60));\r\n const ampm = hours >= 12 ? 'pm' : 'am';\r\n hours = hours % 12;\r\n hours = hours ? hours : 12;\r\n const divisorForMinutes = seconds % (60 * 60);\r\n const minutes =\r\n Math.floor(divisorForMinutes / 60) < 10 ? `0${Math.floor(divisorForMinutes / 60)}` : Math.floor(divisorForMinutes / 60);\r\n return `${hours}:${minutes} ${ampm}`;\r\n }\r\n};\r\n\r\nexport const getTimeZoneAbbr = (timeZone: string | undefined): string | undefined => {\r\n switch (timeZone) {\r\n case 'EASTERN STANDARD TIME':\r\n return 'EST';\r\n case 'EASTERN DAYLIGHT TIME':\r\n return 'EDT';\r\n case 'CENTRAL STANDARD TIME':\r\n return 'CST';\r\n case 'CENTRAL DAYLIGHT TIME':\r\n return 'CDT';\r\n case 'MOUNTAIN STANDARD TIME':\r\n return 'MST';\r\n case 'MOUNTAIN DAYLIGHT TIME':\r\n return 'MDT';\r\n case 'PACIFIC STANDARD TIME':\r\n return 'PST';\r\n case 'PACIFIC DAYLIGHT TIME':\r\n return 'PDT';\r\n default: // any other than USA TimeZone:\r\n return timeZone;\r\n }\r\n};\r\nconst getShortTimeString = (day: DayType, resources: IStoreSelectorLocationLineItemResources): string => {\r\n switch (day) {\r\n case 'MON':\r\n return resources.days.monday;\r\n case 'TUE':\r\n return resources.days.tuesday;\r\n case 'WED':\r\n return resources.days.wednesday;\r\n case 'THU':\r\n return resources.days.thursday;\r\n case 'FRI':\r\n return resources.days.friday;\r\n case 'SAT':\r\n return resources.days.saturday;\r\n default: // case 'SUN':\r\n return resources.days.sunday;\r\n }\r\n};\r\n\r\nconst getFullTimeString = (day: DayType, resources: IStoreSelectorLocationLineItemResources): string => {\r\n switch (day) {\r\n case 'MON':\r\n return resources.days.mondayFull;\r\n case 'TUE':\r\n return resources.days.tuesdayFull;\r\n case 'WED':\r\n return resources.days.wednesdayFull;\r\n case 'THU':\r\n return resources.days.thursdayFull;\r\n case 'FRI':\r\n return resources.days.fridayFull;\r\n case 'SAT':\r\n return resources.days.saturdayFull;\r\n default: // case 'SUN':\r\n return resources.days.sundayFull;\r\n }\r\n};\r\n\r\nconst buildHoursDisplayInfo = (startDay: DayType, endDay: DayType, hoursInfo: string, resources: IStoreSelectorLocationLineItemResources): IHoursDisplayInfo => {\r\n return {\r\n startDayShort: getShortTimeString(startDay, resources),\r\n startDayFull: getFullTimeString(startDay, resources),\r\n endDayShort: startDay !== endDay ? getShortTimeString(endDay, resources) : undefined,\r\n endDayFull: startDay !== endDay ? getFullTimeString(endDay, resources) : undefined,\r\n timeRange: hoursInfo\r\n };\r\n};\r\n\r\nconst shouldMergeLines = (firstLine: IHoursInfo, secondLine: IHoursInfo): boolean => {\r\n if (firstLine.isClosed && secondLine.isClosed) {\r\n return true;\r\n }\r\n\r\n if (!firstLine.isClosed && !secondLine.isClosed) {\r\n return firstLine.openTime === secondLine.openTime && firstLine.closeTime === secondLine.closeTime;\r\n }\r\n\r\n return false;\r\n};\r\n\r\nexport const getStoreHoursData = (storeHours: RegularStoreHours, dateForLookup: string): IHoursInfo => {\r\n return {\r\n isClosed: get(storeHours, `IsClosedOn${dateForLookup}`, false),\r\n openTime: get(storeHours, `${dateForLookup}OpenTime`, undefined),\r\n closeTime: get(storeHours, `${dateForLookup}CloseTime`, undefined)\r\n };\r\n};\r\n\r\nconst buildStoreHoursString = (hoursInfo: IHoursInfo, resources: IStoreSelectorLocationLineItemResources): string => {\r\n if (hoursInfo.isClosed) {\r\n return resources.closedText;\r\n } else {\r\n const openFrom: string | undefined = secondsToTime(hoursInfo.openTime);\r\n const openTo: string | undefined = secondsToTime(hoursInfo.closeTime);\r\n\r\n return `${openFrom}–${openTo}`;\r\n }\r\n};\r\n\r\nexport const buildStoreHours = (storeHours: RegularStoreHours, resources: IStoreSelectorLocationLineItemResources): IHoursDisplayInfo[] => {\r\n const storeHoursList: IHoursDisplayInfo[] = [];\r\n\r\n const mondayHours = getStoreHoursData(storeHours, 'Monday');\r\n const tuesdayHours = getStoreHoursData(storeHours, 'Tuesday');\r\n const wednesdayHours = getStoreHoursData(storeHours, 'Wednesday');\r\n const thursdayHours = getStoreHoursData(storeHours, 'Thursday');\r\n const fridayHours = getStoreHoursData(storeHours, 'Friday');\r\n const saturdayHours = getStoreHoursData(storeHours, 'Saturday');\r\n const sundayHours = getStoreHoursData(storeHours, 'Sunday');\r\n\r\n let periodStart: DayType = 'MON';\r\n let periodEnd: DayType = 'MON';\r\n\r\n if (!shouldMergeLines(mondayHours, tuesdayHours)) {\r\n storeHoursList.push(buildHoursDisplayInfo(periodStart, periodEnd, buildStoreHoursString(mondayHours, resources), resources));\r\n\r\n periodStart = 'TUE';\r\n }\r\n periodEnd = 'TUE';\r\n\r\n if (!shouldMergeLines(tuesdayHours, wednesdayHours)) {\r\n storeHoursList.push(buildHoursDisplayInfo(periodStart, periodEnd, buildStoreHoursString(tuesdayHours, resources), resources));\r\n\r\n periodStart = 'WED';\r\n }\r\n periodEnd = 'WED';\r\n\r\n if (!shouldMergeLines(wednesdayHours, thursdayHours)) {\r\n storeHoursList.push(buildHoursDisplayInfo(periodStart, periodEnd, buildStoreHoursString(wednesdayHours, resources), resources));\r\n\r\n periodStart = 'THU';\r\n }\r\n periodEnd = 'THU';\r\n\r\n if (!shouldMergeLines(thursdayHours, fridayHours)) {\r\n storeHoursList.push(buildHoursDisplayInfo(periodStart, periodEnd, buildStoreHoursString(thursdayHours, resources), resources));\r\n\r\n periodStart = 'FRI';\r\n }\r\n periodEnd = 'FRI';\r\n\r\n if (!shouldMergeLines(fridayHours, saturdayHours)) {\r\n storeHoursList.push(buildHoursDisplayInfo(periodStart, periodEnd, buildStoreHoursString(fridayHours, resources), resources));\r\n\r\n periodStart = 'SAT';\r\n }\r\n periodEnd = 'SAT';\r\n\r\n if (!shouldMergeLines(saturdayHours, sundayHours)) {\r\n storeHoursList.push(buildHoursDisplayInfo(periodStart, periodEnd, buildStoreHoursString(saturdayHours, resources), resources));\r\n\r\n periodStart = 'SUN';\r\n }\r\n periodEnd = 'SUN';\r\n\r\n storeHoursList.push(buildHoursDisplayInfo(periodStart, periodEnd, buildStoreHoursString(sundayHours, resources), resources));\r\n\r\n return storeHoursList;\r\n};\r\n","import classnames from 'classnames';\r\nimport React, { useState } from 'react';\r\n\r\nimport {\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n IPopupProps,\r\n ITelemetryContent,\r\n Popup,\r\n onTelemetryClick,\r\n getTelemetryObject\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport { PriceComponent } from '@msdyn365-commerce/components';\r\nimport MsDyn365, {\r\n IComponent,\r\n IComponentProps,\r\n IGridSettings,\r\n IImageSettings,\r\n msdyn365Commerce,\r\n TelemetryEvent\r\n} from '@msdyn365-commerce/core';\r\nimport { getCartState, ICartActionResult } from '@msdyn365-commerce/global-state';\r\nimport { CommerceProperty, ProductAvailableQuantity, ProductDimension, ProductPrice, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { navLinkKeywordRemoval } from '../../../../../Utilities/plp-url-utils';\r\nimport { getProductURLForUtag, getProductSizeForUTag } from '../../../../../modules/mfrm-buybox/mfrm-buybox';\r\nimport { getAttributeValuesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { getUtagProductCategory } from '../../../../../Utilities/get-utag-product-category';\r\nimport { getUtagVariantId } from '../../../../../Utilities/get-utag-variant-id';\r\nexport interface IAddToCartComponentProps extends IComponentProps<{ product: SimpleProduct; price?: ProductPrice }> {\r\n className?: string;\r\n addToCartText: string;\r\n addToCartProductsText: string;\r\n outOfStockText: string;\r\n disabled?: boolean;\r\n quantity?: number;\r\n navigationUrl?: string;\r\n productAvailability?: ProductAvailableQuantity;\r\n getSelectedProduct?: Promise;\r\n imageSettings?: IImageSettings;\r\n gridSettings?: IGridSettings;\r\n isLoading?: boolean;\r\n isUpdatingDimension?: boolean;\r\n isLoadingDeliveryOptions?: boolean;\r\n isUpdatingDeliveryOptions?: boolean;\r\n isAddServiceItemToCart?: boolean;\r\n isAddEmailDeliveryItemToCart?: boolean;\r\n isPriceKeyedIn?: boolean;\r\n customPriceAmount?: number;\r\n isOrderQuantityLimitsFeatureEnabled?: boolean;\r\n productIdPrefix?: string;\r\n dialogStrings?: {\r\n goToCartText: string;\r\n continueShoppingText: string;\r\n headerItemOneText: string;\r\n headerItemFormatText: string;\r\n headerMessageText: string;\r\n freePriceText: string;\r\n originalPriceText: string;\r\n currentPriceText: string;\r\n };\r\n telemetryContent?: ITelemetryContent;\r\n\r\n isCustomPriceSelected?: boolean;\r\n maximumKeyInPrice?: number;\r\n minimumKeyInPrice?: number;\r\n defaultMaximumKeyInPrice?: number;\r\n defaultMinimumKeyInPrice?: number;\r\n /** VSI Customization - Start */\r\n outOfStockBooleanValue?: boolean;\r\n outOfStockSmallParcel?: boolean;\r\n mfrmOutOfStockCustomText?: string;\r\n mfrmContinueShoppingText?: string;\r\n mfrmOutOfStockSmallParcell?: boolean;\r\n mfrmAddToCartDisableByState?: boolean;\r\n mfrmContinueShoppingLink?: IMfrmCategoryPath;\r\n itemOutOfMarket?: boolean;\r\n variantOutOfStock?: boolean;\r\n extensionProps?: CommerceProperty[];\r\n allProductVariants?: SimpleProduct[];\r\n productCategoryName?: string | undefined;\r\n productBrand?: string | undefined;\r\n successfulATC?: boolean;\r\n variantIdForTracking?: string;\r\n adjustableItem?: any;\r\n pillow?: any;\r\n protector?: any;\r\n updateSuccessfulATC?(): void;\r\n /** VSI Customization - End */\r\n onAdd?(result: ICartActionResult): void;\r\n onError?(result: IAddToCartFailureResult): void;\r\n changeUpdatingDimension?(isUpdatingDimension: boolean): void;\r\n changeUpdatingDeliveryOptions?(isUpdatingDeliveryOptions: boolean): void;\r\n allVariantOOS: boolean;\r\n}\r\n\r\n/** VSI Customization - Start */\r\nexport interface IMfrmCategoryPath {\r\n Name?: string;\r\n Url?: string;\r\n}\r\n\r\nexport interface IMfrmAtpObject {\r\n itemId: string;\r\n recordId: string;\r\n date: string;\r\n zipCode: string;\r\n weeks: number;\r\n}\r\n/** VSI Customization - End */\r\n\r\nexport declare type ICartActionFailureReason =\r\n | 'EMPTYINPUT'\r\n | 'MISSINGDIMENSION'\r\n | 'OUTOFSTOCK'\r\n | 'CARTACTIONFAILED'\r\n | 'INVALIDCUSTOMAMOUNT';\r\nexport interface IAddToCartFailureResult {\r\n failureReason: ICartActionFailureReason;\r\n\r\n stockLeft?: number;\r\n cartActionResult?: ICartActionResult;\r\n missingDimensions?: ProductDimension[];\r\n}\r\n\r\nexport interface IAddtoCartComponent extends IComponent {\r\n onClick(): (event: React.MouseEvent, props: IAddToCartComponentProps) => void;\r\n}\r\n\r\nexport interface UTAGAdjBaseAddToCart {\r\n event: string;\r\n enhanced_action: string;\r\n event_category: string;\r\n event_action: string;\r\n event_label: string;\r\n event_noninteraction: string;\r\n product_id: string[];\r\n product_name: string[];\r\n product_price: string[]\r\n product_quantity: string[];\r\n product_url: string[];\r\n product_image_url: string[];\r\n product_size: (string | undefined)[];\r\n product_list_name: string[];\r\n product_list_position: string[];\r\n product_brand?: string[];\r\n product_category?: string[];\r\n product_variant?: (string | undefined)[];\r\n}\r\nexport interface UTAGCompleteYourBedPillowAddToCart {\r\n event: string;\r\n enhanced_action: string;\r\n event_category: string;\r\n event_action: string;\r\n event_label: string;\r\n event_noninteraction: string;\r\n product_id: string[];\r\n product_name: string[];\r\n product_price: string[]\r\n product_quantity: string[];\r\n product_url: string[];\r\n product_image_url: string[];\r\n product_size: (string | undefined)[];\r\n product_brand?: string[];\r\n product_category?: string[];\r\n product_variant?: (string | undefined)[];\r\n}\r\n// tslint:disable: no-any\r\nconst onClick = async (\r\n _event: React.MouseEvent,\r\n props: IAddToCartComponentProps,\r\n setDisabled: (disabled: boolean) => void,\r\n openModal: (opened: boolean) => void,\r\n setSuccess: () => void\r\n): Promise => {\r\n const telemetryContent = getTelemetryObject('Product Details Page', props.telemetryContent?.moduleName!, props.telemetryContent?.telemetry!);\r\n const payLoad = getPayloadObject('click', telemetryContent, 'Add to Cart', '');\r\n onTelemetryClick(telemetryContent, payLoad, 'Add to Cart')();\r\n const cartError = addToCartError(props);\r\n let productToAdd = props.data.product;\r\n const productBrand = `${props.productBrand}`;\r\n const productPrice = props.data.price;\r\n const productCategory = `${props.productCategoryName}`;\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: 'add-to-cart',\r\n enhanced_action: 'add',\r\n event_category: 'ecommerce',\r\n event_action: 'add to cart',\r\n event_label: `${productToAdd?.ItemId}: ${productToAdd?.Name}`,\r\n event_noninteraction: 'false',\r\n product_id: [`${productToAdd?.ItemId}`],\r\n product_name: [`${productToAdd?.Name}`],\r\n product_category: [productCategory],\r\n product_brand: [productBrand],\r\n product_variant: [`${props?.variantIdForTracking}`],\r\n product_price: [`${productPrice?.CustomerContextualPrice}`],\r\n product_quantity: [`${props.quantity}`],\r\n product_url: [`${getProductURLForUtag(productToAdd, props.context)}`],\r\n product_image_url: [`${productToAdd?.PrimaryImageUrl}`],\r\n product_size: [getProductSizeForUTag(productToAdd)]\r\n });\r\n if (props?.adjustableItem?.foundation) {\r\n const { ItemId, Name, CustomerContextualPrice, PrimaryImageUrl, Dimensions, RecordId, MasterProductId } = props.adjustableItem.foundation;\r\n const listPosition = props.adjustableItem.listPosition;\r\n const productSpecificationData = await getAttributeValuesAsync(\r\n { callerContext: props.context.actionContext, queryResultSettings: {} },\r\n RecordId,\r\n props.context.request.apiSettings.channelId,\r\n props.context.request.apiSettings.catalogId || 0\r\n );\r\n\r\n\r\n const dimension = Dimensions?.find((Dimension: { DimensionTypeValue: number }) => Dimension.DimensionTypeValue === 3);\r\n const product_size = dimension?.DimensionValue?.Value;\r\n\r\n const utag_obj: UTAGAdjBaseAddToCart = {\r\n event: 'add-to-cart',\r\n enhanced_action: 'add',\r\n event_category: 'ecommerce',\r\n event_action: 'add to cart',\r\n event_label: `${ItemId}: ${Name}`,\r\n event_noninteraction: 'false',\r\n product_id: [`${ItemId}`],\r\n product_category: await getUtagProductCategory(\r\n props.context.actionContext,\r\n props.context.request.apiSettings.channelId,\r\n props.context.request.apiSettings.catalogId,\r\n RecordId\r\n ),\r\n product_name: [`${Name}`],\r\n product_price: [`${CustomerContextualPrice}`],\r\n product_quantity: ['1'],\r\n product_url: [getProductURLForUtag(props.adjustableItem.foundation, props.context)],\r\n product_image_url: [`${PrimaryImageUrl}`],\r\n product_size: [\r\n product_size\r\n ],\r\n product_list_name: ['PDP Add Base/Foundation'],\r\n product_list_position: [`${listPosition}`],\r\n product_variant: (MasterProductId && ItemId) ? await getUtagVariantId(MasterProductId, props.context.request.apiSettings.channelId, props.context.actionContext, RecordId, ItemId) : undefined\r\n };\r\n\r\n\r\n const brand = productSpecificationData.find(e => e.Name === 'Brand')?.TextValue;\r\n if (brand) {\r\n utag_obj.product_brand = [brand];\r\n }\r\n\r\n // @ts-ignore\r\n utag.link(utag_obj);\r\n }\r\n if (props?.pillow?.pillow) {\r\n const { ItemId, Name, CustomerContextualPrice, PrimaryImageUrl, Dimensions, RecordId, MasterProductId } = props.pillow.pillow;\r\n const productSpecificationData = await getAttributeValuesAsync(\r\n { callerContext: props.context.actionContext, queryResultSettings: {} },\r\n RecordId,\r\n props.context.request.apiSettings.channelId,\r\n props.context.request.apiSettings.catalogId || 0\r\n );\r\n const dimension = Dimensions?.find((Dimension: { DimensionTypeValue: number }) => Dimension.DimensionTypeValue === 3);\r\n const product_size = dimension?.DimensionValue?.Value;\r\n const utag_obj: UTAGCompleteYourBedPillowAddToCart = {\r\n event: 'add-to-cart',\r\n enhanced_action: 'add',\r\n event_category: 'ecommerce',\r\n event_action: 'add to cart',\r\n event_label: `${ItemId}: ${Name}`,\r\n event_noninteraction: 'false',\r\n product_id: [`${ItemId}`],\r\n product_category: await getUtagProductCategory(\r\n props.context.actionContext,\r\n props.context.request.apiSettings.channelId,\r\n props.context.request.apiSettings.catalogId,\r\n RecordId\r\n ),\r\n product_name: [`${Name}`],\r\n product_price: [`${CustomerContextualPrice}`],\r\n product_quantity: ['1'],\r\n product_url: [getProductURLForUtag(props.pillow.pillow, props.context)],\r\n product_image_url: [`${PrimaryImageUrl}`],\r\n product_size: [\r\n product_size\r\n ],\r\n product_variant: (MasterProductId && ItemId) ? await getUtagVariantId(MasterProductId, props.context.request.apiSettings.channelId, props.context.actionContext, RecordId, ItemId) : undefined\r\n };\r\n const brand = productSpecificationData.find(e => e.Name === 'Brand')?.TextValue;\r\n if (brand) {\r\n utag_obj.product_brand = [brand];\r\n }\r\n // @ts-ignore\r\n utag.link(utag_obj);\r\n }\r\n if (props?.protector?.protector) {\r\n const { ItemId, Name, CustomerContextualPrice, PrimaryImageUrl, Dimensions, RecordId, MasterProductId } = props.protector.protector;\r\n const productSpecificationData = await getAttributeValuesAsync(\r\n { callerContext: props.context.actionContext, queryResultSettings: {} },\r\n RecordId,\r\n props.context.request.apiSettings.channelId,\r\n props.context.request.apiSettings.catalogId || 0\r\n );\r\n const dimension = Dimensions?.find((Dimension: { DimensionTypeValue: number }) => Dimension.DimensionTypeValue === 3);\r\n const product_size = dimension?.DimensionValue?.Value;\r\n const utag_obj: UTAGCompleteYourBedPillowAddToCart = {\r\n event: 'add-to-cart',\r\n enhanced_action: 'add',\r\n event_category: 'ecommerce',\r\n event_action: 'add to cart',\r\n event_label: `${ItemId}: ${Name}`,\r\n event_noninteraction: 'false',\r\n product_id: [`${ItemId}`],\r\n product_category: await getUtagProductCategory(\r\n props.context.actionContext,\r\n props.context.request.apiSettings.channelId,\r\n props.context.request.apiSettings.catalogId,\r\n RecordId\r\n ),\r\n product_name: [`${Name}`],\r\n product_price: [`${CustomerContextualPrice}`],\r\n product_quantity: ['1'],\r\n product_url: [getProductURLForUtag(props.protector.protector, props.context)],\r\n product_image_url: [`${PrimaryImageUrl}`],\r\n product_size: [\r\n product_size\r\n ],\r\n product_variant: (MasterProductId && ItemId) ? await getUtagVariantId(MasterProductId, props.context.request.apiSettings.channelId, props.context.actionContext, RecordId, ItemId) : undefined\r\n };\r\n const brand = productSpecificationData.find(e => e.Name === 'Brand')?.TextValue;\r\n if (brand) {\r\n utag_obj.product_brand = [brand];\r\n }\r\n // @ts-ignore\r\n utag.link(utag_obj);\r\n }\r\n\r\n }\r\n if (cartError) {\r\n propagateError(props, cartError);\r\n return;\r\n }\r\n if (!(props.getSelectedProduct === undefined)) {\r\n productToAdd = (await props.getSelectedProduct) || props.data.product;\r\n // if props.getSelectedProduct has master product, than take it from data.product\r\n if (!productToAdd?.MasterProductId) {\r\n productToAdd = props.data.product;\r\n }\r\n }\r\n\r\n const productsToAdd: any = [\r\n {\r\n product: productToAdd,\r\n count: props.quantity,\r\n availableQuantity: props.productAvailability?.AvailableQuantity,\r\n additionalProperties: { orderQuantityLimitsFeatureIsEnabled: props.isOrderQuantityLimitsFeatureEnabled },\r\n enableStockCheck: props.context.app.config.enableStockCheck,\r\n isPriceKeyedIn: props.isPriceKeyedIn,\r\n customPrice: props.customPriceAmount,\r\n isAddEmailDeliveryItemToCart: props.isAddEmailDeliveryItemToCart\r\n }, ...(props.adjustableItem?.foundation ? [{\r\n product: props.adjustableItem?.foundation,\r\n count: props.quantity\r\n }] : []), ...(props.pillow?.pillow ? [{\r\n product: props.pillow?.pillow,\r\n count: props.quantity\r\n }] : []), ...(props.protector?.protector ? [{\r\n product: props.protector?.protector,\r\n count: props.quantity\r\n }] : [])\r\n ];\r\n const cartState = await getCartState(props.context.actionContext);\r\n // VSI CUSTOMIZATION - starts\r\n // Add product separately clear and the delivery information on retail server, so GetDeliveryOptions charge calculation works correctly\r\n const cart = cartState.cart;\r\n await cartState.clearCartLinesDeliveryInformation({ cart });\r\n // VSI CUSTOMIZATION - ends\r\n await cartState\r\n .addProductsToCart(productsToAdd)\r\n .then(result => {\r\n if (result.status === 'SUCCESS') {\r\n if (props.dialogStrings && props.context.app.config.addToCartBehavior === 'showModal') {\r\n setDisabled(false);\r\n openModal(true);\r\n } else if (\r\n MsDyn365.isBrowser &&\r\n props.navigationUrl &&\r\n (props.context.app.config.addToCartBehavior === undefined || props.context.app.config.addToCartBehavior === 'goToCart')\r\n ) {\r\n // MsDyn365.isBrowser && window.location.assign(props.navigationUrl);\r\n if (MsDyn365.isBrowser) {\r\n window.location.href = props.navigationUrl;\r\n }\r\n // VSI CUSTOMIZATION - starts\r\n setDisabled(true);\r\n // VSI CUSTOMIZATION - ends\r\n }\r\n propagateResult(props, result);\r\n setSuccess();\r\n } else {\r\n propagateError(props, { failureReason: 'CARTACTIONFAILED', cartActionResult: result });\r\n setDisabled(false);\r\n }\r\n })\r\n .catch(error => console.log('error[addProductToCart]', error));\r\n};\r\n\r\nconst AddToCartComponentActions = {\r\n onClick: onClick\r\n};\r\n\r\n// tslint:disable: cyclomatic-complexity\r\n// tslint:disable: max-func-body-length\r\n// tslint:disable: react-no-dangerous-html\r\nconst AddToCart: React.FC = (props: IAddToCartComponentProps) => {\r\n const [disabled, setDisabled] = useState(false);\r\n const [modalOpen, setModalOpen] = useState(false);\r\n\r\n const onClickHandler = async (event: React.MouseEvent) => {\r\n const setSuccess = props.updateSuccessfulATC ? props.updateSuccessfulATC : () => null;\r\n await AddToCartComponentActions.onClick(event, props, setDisabled, setModalOpen, setSuccess);\r\n };\r\n\r\n const priceComponent = props.data.price ? (\r\n \r\n ) : (\r\n ''\r\n );\r\n\r\n const popupProps: IPopupProps = {\r\n context: props.context,\r\n className: 'msc-add-to-cart',\r\n id: props.id,\r\n typeName: props.typeName,\r\n data: { product: props.data.product, price: props.data.price },\r\n dialogStrings: props.dialogStrings,\r\n imageSettings: props.imageSettings,\r\n gridSettings: props.context.request?.gridSettings,\r\n productQuantity: props.quantity !== undefined ? props.quantity : 1,\r\n priceComponent: priceComponent,\r\n navigationUrl: props.navigationUrl,\r\n modalOpen: modalOpen,\r\n setModalOpen: setModalOpen,\r\n telemetryContent: props.telemetryContent\r\n };\r\n\r\n const renderModalPopup = ;\r\n const label = getLinkText(props);\r\n const payload = getPayloadObject(TelemetryEvent.AddToCart, props.telemetryContent!, label, '');\r\n const attributes = getTelemetryAttributes(props.telemetryContent!, payload);\r\n\r\n // Todo: bug#22002 - Will be resolved later on - temp fix\r\n // const classToApply = props.mfrmOutOfStockSmallParcell ? 'out-of-stock msc-add-to-cart' : 'msc-add-to-cart';\r\n const classToApply = 'msc-add-to-cart';\r\n const OOMClass = props.itemOutOfMarket || props.variantOutOfStock || props.mfrmOutOfStockSmallParcell || props.allVariantOOS ? 'out-of-market disabled' : '';\r\n let disabledSmallParcel = false;\r\n // tslint:disable-next-line: max-line-length\r\n\r\n if (\r\n (props.disabled !== undefined ? props.disabled : false) ||\r\n disabled ||\r\n isIntermediateState(props) ||\r\n shouldShowOutOfStock(props, false) ||\r\n (props.mfrmAddToCartDisableByState !== undefined ? props.mfrmAddToCartDisableByState : false) ||\r\n props.itemOutOfMarket ||\r\n props.variantOutOfStock\r\n ) {\r\n disabledSmallParcel = true;\r\n }\r\n\r\n return (\r\n
\r\n {renderModalPopup}\r\n \r\n {props.mfrmOutOfStockSmallParcell || props.allVariantOOS ? props.mfrmOutOfStockCustomText : label}\r\n \r\n {props.mfrmOutOfStockSmallParcell && (\r\n \r\n {props.mfrmContinueShoppingText}\r\n \r\n )}\r\n {/** VSI Customization - End */}\r\n
\r\n );\r\n};\r\n\r\n// Set default props\r\nAddToCart.defaultProps = {\r\n quantity: 1\r\n};\r\n\r\nexport const getLinkText = (props: IAddToCartComponentProps): string => {\r\n if (props.itemOutOfMarket || props.variantOutOfStock) {\r\n return 'Item not available';\r\n }\r\n let productToAdd = props.data.product;\r\n if (!(props.getSelectedProduct === undefined)) {\r\n props.getSelectedProduct.\r\n then((product) => {\r\n productToAdd = product || props.data.product;\r\n }).\r\n catch((err) => console.log(err));\r\n // if props.getSelectedProduct has master product, than take it from data.product\r\n if (!productToAdd?.MasterProductId) {\r\n productToAdd = props.data.product;\r\n }\r\n }\r\n const getCount = [productToAdd, ...(props.adjustableItem.foundation ? [props.adjustableItem.foundation] : []), ...(props.pillow?.pillow ? [props.pillow.pillow] : []), ...(props.protector?.protector ? [props.protector.protector] : [])].length;\r\n return shouldShowOutOfStock(props, false) ? props.outOfStockText : (getCount > 1 ? props.addToCartProductsText?.replace('{itemcount}', getCount.toString()) : props.addToCartText);\r\n};\r\n\r\nconst addToCartError = (props: IAddToCartComponentProps): IAddToCartFailureResult | undefined => {\r\n const {\r\n data,\r\n productAvailability,\r\n isCustomPriceSelected,\r\n customPriceAmount,\r\n maximumKeyInPrice,\r\n minimumKeyInPrice,\r\n defaultMaximumKeyInPrice = 100,\r\n defaultMinimumKeyInPrice = 10\r\n } = props;\r\n\r\n if (!data || !data.product.RecordId) {\r\n // No product exists, won't be able to add to cart\r\n return { failureReason: 'EMPTYINPUT' };\r\n }\r\n\r\n if (data.product?.Dimensions) {\r\n const missingDimensions = data.product.Dimensions.filter(\r\n dimension => !(dimension.DimensionValue && dimension.DimensionValue?.Value)\r\n );\r\n\r\n if (missingDimensions?.length > 0) {\r\n // At least one dimension with no value exists on the product, won't be able to add to cart\r\n return { failureReason: 'MISSINGDIMENSION', missingDimensions: missingDimensions };\r\n }\r\n }\r\n\r\n if (shouldShowOutOfStock(props, true)) {\r\n const availableQuantity = (productAvailability && productAvailability.AvailableQuantity) || 0;\r\n const stockLeft = Math.max(availableQuantity, 0);\r\n\r\n return { failureReason: 'OUTOFSTOCK', stockLeft: stockLeft };\r\n }\r\n\r\n // When Custom price is selected, if there is no keyed-in price or keyed-in price is out of limit, should return error.\r\n if (\r\n isCustomPriceSelected &&\r\n (!customPriceAmount ||\r\n customPriceAmount > (maximumKeyInPrice || defaultMaximumKeyInPrice) ||\r\n customPriceAmount < (minimumKeyInPrice || defaultMinimumKeyInPrice))\r\n ) {\r\n return { failureReason: 'INVALIDCUSTOMAMOUNT' };\r\n }\r\n\r\n // Only allow adding to cart if not showing out of stock\r\n return undefined;\r\n};\r\n\r\nconst shouldShowOutOfStock = (props: IAddToCartComponentProps, includeCurrentQuantity: boolean): boolean => {\r\n if (\r\n props.context.app.config.enableStockCheck === undefined ||\r\n props.context.app.config.enableStockCheck === false ||\r\n props.isLoading ||\r\n props.isUpdatingDimension ||\r\n props.isAddServiceItemToCart\r\n ) {\r\n // Out of stock turn off, don't bother showing out of stock\r\n return false;\r\n }\r\n\r\n if (!props.data || !props.data.product.RecordId) {\r\n // No product exists, don't bother showing out of stock\r\n return false;\r\n }\r\n\r\n if (props.data.product?.Dimensions) {\r\n if (props.data.product.Dimensions?.find(dimension => !(dimension.DimensionValue && dimension.DimensionValue.Value))) {\r\n // At least one dimension with no value exists on the product, so also don't show out of stock\r\n return false;\r\n }\r\n }\r\n const includedQuantityNumber = includeCurrentQuantity && props.quantity ? props.quantity : 1;\r\n\r\n return props.productAvailability &&\r\n props.productAvailability.AvailableQuantity !== undefined &&\r\n props.productAvailability.AvailableQuantity >= includedQuantityNumber\r\n ? false\r\n : true;\r\n};\r\n\r\nconst isIntermediateState = (props: IAddToCartComponentProps): boolean => {\r\n if (props.data.product?.Dimensions) {\r\n if (props.data.product.Dimensions?.find(dimension => !(dimension.DimensionValue && dimension.DimensionValue.Value))) {\r\n // At least one dimension with no value exists on the product, so also not in intermediate state\r\n /** VSI Customization - Start */\r\n return true;\r\n /** VSI Customization - End */\r\n }\r\n }\r\n\r\n if (!props.isLoading && !props.isUpdatingDimension) {\r\n return false;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nconst propagateResult = (props: IAddToCartComponentProps, result: ICartActionResult): void => {\r\n if (props.onAdd) {\r\n props.onAdd(result);\r\n }\r\n};\r\n\r\nconst propagateError = (props: IAddToCartComponentProps, result: IAddToCartFailureResult): void => {\r\n if (props.onError) {\r\n props.onError(result);\r\n }\r\n};\r\n\r\nexport const AddToCartComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride<\r\n // @ts-ignore\r\n IAddtoCartComponent\r\n>('AddToCart', { component: AddToCart, ...AddToCartComponentActions });\r\n\r\nexport default AddToCartComponent;\r\n"],"names":["async","request","context","isCached","getATPInventoryStatusInput","GetATPInventoryStatusInput","result","getATPInventoryStatusAction","actionContext","error","console","log","getUtagProductCategory","channelId","catalogId","RecordId","categoryPathResults","getCategoryPathsAsync","callerContext","queryResultSettings","ProductId","categoryPath","CategoryPath","Segments","length","CategoryName","getUtagVariantId","MasterProductId","ItemId","input","BuyboxGetDimensionVariantAvailabilityInput","variantsResp","getAllProductVariants","variantIter","ePropsVariant","ExtensionProperties","eIter","Key","Value","StringValue","variantofId","slice","MsDyn365","window","innerWidth","gridSettings","xs","w","sm","md","lg","_coreProductATPCall","props","setCoreProductATPData","recordId","itemId","setATPCallMessage","setIsAtpCallReturned","zipcode","Cookies","get","undefined","itemLinesArray","data","product","itemLines","Quantity","VariantRecordId","toString","push","currentDate","Date","now","requestBody","InventoryType","Weeks","app","config","weeksPDPforATPCall","StoreId","Page","RequestedDate","dayjs","format","ZipCode","ItemLines","_getDeliveryByMessage","then","ATPInventoryData","Message","catch","e","_getActivePrices","pricingData","ctx","date","productIds","i","productId","getActivePricesAsync","ChannelId","requestContext","apiSettings","CatalogId","dimPricesResult","map","item","index","discountAmount","DiscountAmount","_smallParcelProductATPCallForInventoryStatus","SetoutOfStockSmallParcelState","_getInventoryQuantity","ATPInventoryStatusData","coreProductAtpData","Available","parseInt","_coreProductATPCallForInventoryStatusForAllVariants","recordIds","allVariants","ridIter","iter","variantID","isAvailable","zipCode","canonicalURL","requestUrl","url","origin","path","pathname","toLowerCase","urlParts","split","splice","match","removePipeSignValue","removeKeywords","filteredPath","join","filteredURL","filter","urlPart","indexOf","removeKeywordFromUrl","removeKeywordFromUrlArray","trim","forEach","_part","removeKeyword","trimmedKeyword","indexOfValue","getSortedVirtualRefinerConfig","isMattressesCategory","appConfigSorted","getVirtualRefinerConfig","appConfig","enableForMattresses","enableForOtherCategories","sort","a","b","order","getVirtualRefinerNames","sortedVirtualRefinerConfig","appConfigRefinerNames","sortedConfig","refinerName","urlModifications","getVirtualRefinerValues","virtualRefiners","virtualRefinerValues","categoryIdToken","urlTokens","finalizedUrlParts","plainUrlPart","decodeURIComponent","part","filteredPart","mainRefiner","Values","refinerValue","refinerValueKeyName","LeftValueBoundString","replace","regExSpecialChars","canonicalUrlspecialCharIncludeList","navLinkKeywordRemoval","link","linkBase","linkParams","endsWith","linkParam","param","filteredLink","includeConfigList","includeConfig","pattern","RegExp","constructor","getCacheKey","key","Array","prototype","call","this","getCacheObjectType","dataCacheType","Msdyn365","action","mFIATPInventoryStatusAsync","id","MFITryInStoreExtensionClass","odataObject","Products","Limit","Radius","className","substr","lastIndexOf","concat","EntityClasses","MFITryInStoreInfoResponseExtensionClass","Status","Inventory","createMFIGetTryInStoreInfoInput","tryInStoreProductIDs","storeId","DataServiceQuery","DataServiceEntities","tryInStoresQuery","createDataServiceRequestForOperation","bypassCache","returnEntity","GetTryInStoreInfoInput","callActionOrExecute","mFIGetTryInStoreInfoAsync","getAllVariantsForProduct","productResponse","getByIdAsync","Paging","Top","baseProduct","isArray","getVariantsByDimensionValuesAsync","telemetry","exception","Error","createObservableDataAction","inputData","query","products","pageType","priceGroupForAPICall","priceGroup","items","singleItem","DistinctProductVariant","PriceGroup","Items","getEyebrowMessageInput","GetEyebrowMessageInput","getEyebrowAction","getGenericError","cart","resources","productAvailability","location","failureReason","addedToCartFailureMessage","cartActionResult","substatus","elementFoundAt","productIdToFind","CartLines","DeliveryMode","channel","PickupDeliveryModeCode","FulfillmentStoreId","OrgUnitNumber","curQuantity","maxQuantityForCartLineItem","availableQty","AvailableQuantity","quantityLimit","Math","min","maxQuantityLimitText","errorDetails","LocalizedMessage","getConfigureErrors","isGiftCard","dimensions","dimension","DimensionTypeValue","dimensionTypeValue","productDimensionTypeColorErrorMessage","productDimensionTypeConfigurationErrorMessage","productDimensionTypeSizeErrorMessage","productDimensionTypeAmountErrorMessage","productDimensionTypeStyleErrorMessage","getDimensionErrorString","getBuyBoxInventoryLabel","productDetails","typeName","productAvailableQuantity","_getClassNamePrefix","StockLevelLabel","inventoryClassName","StockLevelCode","React","getBuyboxProductTitle","brandName","titleHeadingTag","title","Name","Heading","headingTag","text","telemetryContent","getBuyboxAddToCart","state","callbacks","defaultMinimumKeyInPrice","defaultMaximumKeyInPrice","minimumKeyInPrice","maximumKeyInPrice","quantity","errorState","configureErrors","quantityError","customAmountError","otherError","errorHost","selectedProduct","isUpdatingDimension","isUpdatingDeliveryOptions","isServiceItem","keyInPriceAmount","ProductAvailableQuantity","dialogStrings","goToCartText","buyBoxGoToCartText","continueShoppingText","buyBoxContinueShoppingText","headerItemOneText","buyBoxSingleItemText","headerItemFormatText","buyBoxMultiLineItemFormatText","headerMessageText","buyBoxHeaderMessageText","freePriceText","priceFree","originalPriceText","currentPriceText","addedQuantityText","closeNotificationLabel","isLoading","status","changeUpdatingDimension","isLoadingDeliveryOptions","deliveryOptions","changeUpdatingDeliveryOptions","getTelemetryObject","telemetryPageName","emailDeliveryModeCode","EmailDeliveryModeCode","isEmailDelivery","ArrayExtensions","DeliveryOptions","Code","ContainerProps","button","AddToCartComponent","addToCartText","outOfStockText","navigationUrl","getUrlSync","price","productPrice","onError","quantityErrorForState","customAmountErrorForState","otherErrorForState","stockLeft","errorMessageOutOfStock","errorMessageOutOfRangeOneLeft","errorMessageOutOfRangeFormat","getQuantityError","formatedAmountLimit","cultureFormatter","formatCurrency","invalidSmallCustomAmountText","invalidLargeCustomAmountText","updateErrorState","missingDimensions","IsGiftCard","getSelectedProduct","imageSettings","viewports","q","h","xl","lazyload","isAddServiceItemToCart","isPriceKeyedIn","customPriceAmount","isCustomPriceSelected","isOrderQuantityLimitsFeatureEnabled","_isOrderQuantityLimitsFeatureEnabled","isAddEmailDeliveryItemToCart","onAdd","changeModalOpen","isNavigationToCartPageDisabled","errorBlock","BuyboxErrorBlock","showError","getBuyboxProductPrice","PriceComponent","getBuyboxProductRating","ratingsSummary","ratingComponent","averageRating","RatingComponent","avgRating","readOnly","ariaLabel","averageRatingAriaLabel","ratingCount","reviewsCount","getBuyboxKeyInPrice","LabelContainerProps","tag","htmlFor","heading","buyboxKeyInPriceLabelHeading","type","onChange","value","currentTarget","updateKeyInPrice","Number","parseFloat","max","errorMessages","Object","values","message","Alert","isOpen","color","assertive","buyboxErrorMessageHeader","getQuantityLimitsMessages","Node","_renderMaxLabel","maxQuantityText","_renderMinLabel","minQuantityText","MAX_VALUE","defaultOrderQuantityLimitsFeatureConfig","platform","enableDefaultOrderQuantityLimits","customerInfo","customerInformation","IsB2b","getBuyboxFindInStore","slots","storeSelector","findInStoreHeaderText","findInStoreDescriptionText","findInStoreLinkText","storeSelectorStateManager","modalOpen","onClick","modules","dataProduct","Dimensions","DimensionValue","storeSelectorId","keys","openDialog","onLocationSelected","orgUnitLocation","deliveryMode","Promise","resolve","behavior","addToCartBehavior","addProductToCart","count","failureResult","AddToCartBehavior","assign","defaultImageSettings","friendlyName","notification","ItemSuccessfullyAddedToCartNotification","NotificationsManager","addNotification","debug","findInStoreOnClick","find","option","priceComponent","popupProps","productQuantity","setModalOpen","renderModalPopup","Popup","openFindInStoreDialog","description","productPickupOptionList","errors","disabled","modal","getProductURLForUtag","productUrl","getProductPageUrlSync","getProductSizeForUTag","Buybox","super","updateViewPort","viewport","_getViewPort","setState","isDesktop","updateSuccessfulATC","successfulATC","timer","setTimeout","dimensionUpdateQueue","FinitePromiseQueue","buyboxCallbacks","updateQuantity","newQuantity","fireAnalyticsLink","eventName","eventCategory","eventAction","eventLabel","eventNoninteraction","generalConfig","enhanced_action","newErrorState","updateSelectedProduct","newSelectedProduct","newInventory","newPrice","newDeliveryOptions","productDeliveryOptions","_updatePrice","dimensionSelectedAsync","selectedDimensionId","selectedDimensionValueId","enqueue","_updateDimensions","reason","FinitePromiseQueueError","getDropdownName","dimensionType","_getDropdownName","isModalOpen","customPrice","_updateQueryParamVariantId","variantId","currUrl","href","urlWithIgnoredCase","URL","toLocaleLowerCase","searchParams","has","variantQueryStringName","set","history","replaceState","host","_setRecentlyViewProducts","masterProductId","cookies","setDate","getDate","expiry","inserted","recentlyViewedProductsStored","recentlyViewedProducts","_setSmallParcelATPCallMade","atpCallMade","smallParcelATCallMade","_setStatusATPCall","StatusATPCall","_setATPCall","ATPCall","_updateDimensionValue","productDimensionFull","newValueId","DimensionValues","productDimensionTypeColor","productDimensionTypeConfiguration","productDimensionTypeSize","productDimensionTypeAmount","productDimensionTypeStyle","_scrollToBVHosted","document","getElementById","scrollIntoView","_onHandleToggleAvailableStoreDetails","isStoreDetailsOpen","_getPreferredStore","storeSelectorState","preferredStore","prefferedStore","Zip","localStorage","getItem","JSON","parse","_getSociPreferredStore","_getProductSpecificationAttributeByKeyName","attrName","productSpecificationData","attr","BooleanValue","_getProductType","shippingInformation","_updateUtagDataOnInitialLoad","productprice","categoryPaths","category","allCategoriesArr","categoryObj","categoryName","productAttribute","attribute","brandBackofficeAttributePdp","attributes","productBrandName","currAttribute","TextValue","productSize","listPageStateBuyBox","_getVariantIDOnLoad","name","CustomerContextualPrice","BasePrice","productImageUrl","PrimaryImageUrl","err","allProductVariants","_getProductAttributeUpdated","shippingInformationSmall","smallParcelAttributeKey","_updateAvailbilityForVariantsUpdated","variantsResult","availableVariantIDs","eComAllVariantsOOSMultiAttr","ecomAllVairantStockInfoKey","ecomAllVairantStockInfoKey1","ecomAllVairantStockInfoKey2","ecomAllVairantStockInfoKey3","getAttributeValuesAsync","ecomAllVairantStockInfoConcatenated","ecomVairantStockInfoKey1","ecomVairantStockInfoKey2","ecomVairantStockInfoKey3","ecomAllVairantStockInfo1","ecomAllVairantStockInfo2","ecomAllVairantStockInfo3","eComJsonData","newAllVariantStockInfo","VariantList","VariantRecID","OutOfStock","outOfStockBoolean","variant","productType","batchedAtp","batchedAtpInventoryStatusData","setDefaultOOSVariant","variantAvailibilityList","_updateUtagData","updatedProduct","updatedPrice","getVariantID","finalPrice","utag","product_price","product_variant","product_url","product_image_url","product_size","utag_data","_sendProductDataToTealium","event","event_category","event_action","event_label","event_noninteraction","product_id","product_name","product_category","product_brand","variantIdForTracking","_eyeBrowMessageAsyncFunc","productIdsArray","eyebrowMessageObj","eyebrowMessageResult","_getEyebrowMessage","eyebrowMessageResultState","getDeliverySlotFromATP","deliveryMessageATPResultState","_tryInStoreAsyncCall","isSociEnabled","enableSociLocations","zipCodeModified","projectMetaSoci","project_meta","sociStore","sociStoreID","tryInStoreLimit","tryInStoreLookupRadius","getTryInStoreInfoInput","response","getTryInStoreAction","tryInStoresResults","prevProduct","productDimensions","dimensionsArr","dimensionsToUpdate","clearErrorState","nextProductDimensions","mappedDimensions","obj","dim","variants","queryBasedVariantSelection","variantProduct","newAvailableQuantity","getProductAvailabilitiesForSelectedVariant","ProductAvailabilitiesForSelectedVariantInput","getPriceForSelectedVariant","PriceForSelectedVariantInput","getDeliveryOptionsForSelectedVariant","GetDeliveryOptionsForSelectedVariantInput","currentProduct","currentProductDimensions","_updateQuantitiesInState","makeCoreProductDeliveryMessage","_updateVariantIDForTracking","_updateURLWithoutReloading","_getBuyboxProductRating","productSpecification","getBVAttributeValues","role","_renderTryInStore","availableInStoresText","notAvailableInStoresText","onlineOnlyProductsText","isOnlineOnly","onlineOnlyBackOfficeAttribute","storeName","x","OrgUnitName","storeNameWithState","State","availableStoreText","notAvailableStoreText","canTryInStores","onHandleFindPreferredStore","mfrmStoreSelector","body","classList","add","showMapViewLink","Text","_renderStoreHours","isClosedToday","isClosed","startTime","IntegerValue","endTime","timeZone","timeZoneAbbr","getTimeZoneAbbr","storeHoursClosedText","storeCloseAtHours","storeOpenAtHours","secondsToTime","_renderTryInStoreRedesign","availableInStoresTextV2","notAvailableInStoresTextV2","viewStoreDetailsText","changeStoreText","sociPrefferedStore","sociStoreName","storeLocatorContext","Contacts","ContactTypeValue","extractPhoneNumber","contacts","allPhoneContacts","contact","IsPrivate","primaryPhoneContact","IsPrimary","Locator","storeLocatorUrl","Address","sociStoreLocatorUrl","website_url","storeAddressLine1","address1","Street","storeAddressLine2","address2","City","phoneNumber","phone","ref","wrapperRef","tabIndex","city","postalcode","target","_getProductBadges","productBadgeAttribute","badgeData","badges","parsedBadges","badge","parseBadgeData","finalizedBadges","parsedBadge","buildProductBadge","_renderEyeBrowMessage","targetAudienceGroup","eyebrowMessage","EyeBrows","eyebrow","Description","emptyClassName","emptyClassNameButton","splitMessage","trackingEyebrow","Popper","trigger","RichTextComponent","triggerClass","contentClass","position","offsetY","outline","tooltipContent","_renderCSATScore","unitsReturned","unitsSold","isNaN","unitsNotReturend","perNotReturned","round","cSatRatingHeadingText","Tooltip","Info","height","width","hover","cSatRatingPopoverText","toLocaleString","Rating","defaultValue","precision","extensionProps","deliveryMessage","inventoryStatusATPResultState","variantAvailibilityUpdating","showViewCartLink","bind","_setAllProductVariantsResult","handleClickOutside","addEventListener","PRODUCTASSERVICE","ItemTypeValue","newCartTotalItems","totalItemsInCart","prevProps","prevState","resizeThrottledEventHandler","addThrottledEvent","selProd","currSelProd","clearTimeout","removeEventListener","extendAllProductVariants","prices","extendedAllProductVariants","extendedObj","productSizeName","dimensionPrice","priceAfterDiscount","discount","current","contains","smallParcelVariantsListObj","inStockLowestPriceVariant","isProductFound","element","isInStock","variantObj","smallParcelProduct","str","outOfStock","outOfStockProductKey","inventoryStatusData","selectedObj","queryParamValue","masterId","pushState","search","queryParams","updatedProductSpecificationData","dimensionPrices","prodSpecficationData","Price","getNextInventoryProduct","dimensionValues","getDimensionValuesAsync","fullDimension","Behavior","DefaultQuantity","MinimumQuantity","MaximumQuantity","render","mediaGallery","selectedFoundation","adjustableItem","completeYourBedPillow","pillow","completeYourBedProtector","protector","parseBrandName","viewProps","ModuleProps","moduleProps","classnames","ProductInfoContainerProps","MediaGalleryContainerProps","getBuyboxProductDescription","configure","getBuyboxProductConfigure","findInStore","addToCart","viewCartLink","rating","hideRating","inventoryLabel","shopSimilarLook","enableShopSimilarLooks","getBuyboxShopSimilarButton","ShopSimiliarButtonType","shopSimilarDescription","enableShopSimilarDescription","keyInPrice","enableKeyInPrice","quantityLimitsMessages","setSmallParcelATPCallMade","setStatusATPCall","setATPCall","productBadges","eyeBrowMessage","promotionalMessage","ATPDataFromBusiness","updateDimension","getProductType","setAllProductVariantsResult","customerSatisfactionScore","renderView","seconds","hours","floor","ampm","divisorForMinutes","minutes","AddToCartComponentActions","_event","setDisabled","openModal","setSuccess","moduleName","payLoad","getPayloadObject","onTelemetryClick","cartError","addToCartError","productToAdd","productBrand","productCategory","productCategoryName","product_quantity","foundation","listPosition","Dimension","utag_obj","product_list_name","product_list_position","brand","propagateError","productsToAdd","availableQuantity","additionalProperties","orderQuantityLimitsFeatureIsEnabled","enableStockCheck","cartState","getCartState","clearCartLinesDeliveryInformation","addProductsToCart","propagateResult","AddToCart","useState","label","getLinkText","payload","TelemetryEvent","getTelemetryAttributes","OOMClass","itemOutOfMarket","variantOutOfStock","mfrmOutOfStockSmallParcell","allVariantOOS","disabledSmallParcel","isIntermediateState","shouldShowOutOfStock","mfrmAddToCartDisableByState","mfrmOutOfStockCustomText","mfrmContinueShoppingLink","Url","mfrmContinueShoppingText","defaultProps","getCount","addToCartProductsText","includeCurrentQuantity","includedQuantityNumber","msdyn365Commerce","component"],"sourceRoot":""}