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AA,GAAKvE,GACLG,EACA0F,GAEJ9hB,EACA8iC,IAsDgB8U,CAAgB/hC,EAAUitB,GACtCiX,EACAzX,KAWJ8Z,EAA+D36C,IACxE,MAAM,UAAEo3C,EAAS,gBAAEC,EAAe,YAAE3rB,EAAW,eAAEqrB,GAAmB/2C,EACpE,OACIwK,EAAAA,cAAC4vC,EAAAA,OAAM7+B,OAAAwD,OAAA,GAAKq4B,IACNL,GAAkBM,EACnB3rB,GAAeyuB,EAAsBn6C,KAKlD","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/Utilities/product-badge-utils.tsx?2848","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/common/hooks/useVwoClientInstance.tsx?6f12","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/common/hooks/useIsDesktop.tsx?34b6","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-shop-similar-items.tsx?5f22","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-key-in-price.tsx?8f0c","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-customer-satisfaction-score/buybox-customer-satisfaction-score.tsx?80f4","webpack://mattressfirm/./src/Utilities/getProductSpecificationDataAttributeValue.ts?7e14","webpack://mattressfirm/./src/common/hooks/useClickOutside.tsx?c8a5","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-store-hours/buybox-store-hours.tsx?e128","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-store-details/buybox-store-details.tsx?972c","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-try-in-store-redesign/open.tsx?c9c5","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-try-in-store-redesign/buybox-try-in-store-redesign.tsx?5696","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-product-rating/buybox-product-rating.tsx?98b4","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/modules/mfrm-store-selector/components/store-selector-location-line-item/mfrm-store-selector-location-line-item.components.tsx?9f8c","webpack://mattressfirm/./src/themes/mattressfirm/views/components/addtocart/addtocart.component.tsx?5783","webpack://mattressfirm/./src/modules/quickview/utilities/get-valid-product-images.ts?78b7","webpack://mattressfirm/./src/modules/quickview/quickview.tsx?4080","webpack://mattressfirm/./src/modules/quickview/utilities/get-product-details.ts?5cc2","webpack://mattressfirm/./src/modules/quickview/quickview.view.tsx?ee5b"],"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, ICoreContext } 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 { IBuyboxViewPropsExtended, IMFIATPInventoryStatusResponseExtended } from '../modules/mfrm-buybox/types';\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: IBuyboxViewPropsExtended & 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: IBuyboxViewPropsExtended & 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: IBuyboxViewPropsExtended & 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: IMFIATPInventoryStatusResponseExtended = {\r\n ...result,\r\n zipCode: requestBody?.ZipCode\r\n };\r\n return finalResult;\r\n }\r\n return null;\r\n};\r\n\r\nexport const _smallParcelProductATPBooleanStatus = async (\r\n recordId: number,\r\n itemId: string | undefined,\r\n weeksPDPforATPCall: number | undefined,\r\n context: ICoreContext<{ [x: string]: any; }>\r\n // tslint:disable-next-line: no-any\r\n): Promise => {\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 false;\r\n }\r\n const itemLinesArray = [];\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: weeksPDPforATPCall ?? 6,\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 return _getInventoryQuantity(requestBody, context, true)\r\n .then(result => {\r\n if (result !== undefined && result?.ATPInventoryStatusData && result?.ATPInventoryStatusData.length > 0) {\r\n const coreProductAtpData = result?.ATPInventoryStatusData[0];\r\n if (coreProductAtpData.Available === 'YES' && coreProductAtpData.Quantity !== undefined && parseInt(coreProductAtpData.Quantity, 10) > 0) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n } else {\r\n return false;\r\n }\r\n })\r\n .catch(e => {\r\n console.log('Error', e);\r\n return false;\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 // eslint-disable-next-line security/detect-non-literal-regexp\r\n return new RegExp(pattern, 'gi');\r\n } else {\r\n\r\n const pattern = `[^\\\\w\\\\&\\\\|]`;\r\n // eslint-disable-next-line security/detect-non-literal-regexp\r\n return new RegExp(pattern, 'gi');\r\n }\r\n};\r\n","import { AttributeValue } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { buildProductBadge, parseBadgeData } from './get-product-badge';\r\nimport { ICoreContext } from '@msdyn365-commerce/core';\r\nimport React from 'react';\r\n\r\nexport const _getProductBadges = (\r\n context: ICoreContext<{\r\n [x: string]: any;\r\n }>,\r\n productAttributes: AttributeValue[]\r\n): JSX.Element | undefined => {\r\n // find the configured backend attribute\r\n const {\r\n request,\r\n actionContext: { requestContext: { app: { config: { productBadgeAttribute: attribute } } } }\r\n } = context;\r\n\r\n const badgeData =\r\n attribute &&\r\n productAttributes?.find(\r\n currAttribute => currAttribute.Name && currAttribute.Name.toLowerCase().trim() === attribute.toLowerCase().trim()\r\n )?.TextValue;\r\n\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\r\n return finalizedBadges && <>{finalizedBadges};\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 // 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 // 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// Create a data model here or import one to capture the response of the action\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\n// const createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n// return new GetTryInStoreInfoInput();\r\n// };\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function 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 // Give your data action a unique id\r\n id: 'GetTryInStoreInfo'\r\n // input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","import { useEffect, useState } from \"react\";\r\nimport vwoSDK, { vwoAsyncInstance } from 'vwo-node-sdk';\r\nimport { getCookie, setCookie } from \"../cookies/cookie-utils\";\r\nimport uuid from 'uuid';\r\n\r\n// Vwo's getSettingsFile method returns on abject and it isn't typed\r\ninterface IVwoSettingsResponse {\r\n accountId: number;\r\n campaignGroups: object;\r\n campaigns: any[];\r\n groups: object;\r\n isEventArchEnabled: boolean;\r\n sdkKey: string;\r\n version: number;\r\n}\r\n\r\nfunction getVwoUserId() {\r\n if (typeof window !== 'undefined') {\r\n let vwoUserId = getCookie('vwoUserId');\r\n\r\n if (!vwoUserId) {\r\n vwoUserId = uuid.v4();\r\n setCookie('vwoUserId', vwoUserId);\r\n }\r\n return vwoUserId;\r\n }\r\n return uuid.v4();\r\n}\r\n\r\nfunction useVwoClientInstance(accountId: string, sdkKey: string) {\r\n const [vwoClientInstance, setVWOClientInstance] = useState(null);\r\n const [vwoUserId, setVwoUserId] = useState(getVwoUserId());\r\n useEffect(() => {\r\n const initVwo = async () => {\r\n // NOTE: accountId and sdkKey from props.app.config\r\n // const accountId = '717583';\r\n // const sdkKey = 'ddd425ce4e9946c2ff2f252e4c6bfe48';\r\n if (!accountId || !sdkKey) {\r\n throw Error('Missing VWO settings');\r\n }\r\n const settingsFile = await vwoSDK.getSettingsFile(accountId, sdkKey);\r\n const clientInstance: vwoAsyncInstance = vwoSDK.launch({ settingsFile });\r\n if (clientInstance) {\r\n setVWOClientInstance(clientInstance);\r\n setVwoUserId(getVwoUserId());\r\n\r\n for (const campaign of (settingsFile as IVwoSettingsResponse).campaigns) {\r\n clientInstance.activate(campaign.key, vwoUserId);\r\n }\r\n }\r\n };\r\n initVwo();\r\n }, []);\r\n\r\n return [vwoClientInstance as vwoAsyncInstance, vwoUserId];\r\n}\r\n\r\nexport default useVwoClientInstance;","/*---------------------------------------------------------------------------------------------\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 id: 'AllMFRMProductVariantIDs',\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, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\r\nimport {\r\n AddToCartComponent, IAddToCartFailureResult, IAddToCartResources,\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, IBuyboxCommonData,\r\n IBuyboxErrorBlockProps, IBuyboxExtentedProps, IBuyboxKeyInPriceViewProps, IBuyboxShopSimilarLookViewProps, IBuyboxState,\r\n IProductDetails, ShopSimiliarButtonType\r\n} from '@msdyn365-commerce-modules/buybox';\r\n\r\nimport { IBuyboxCallbacksLite, IBuyboxModulePropsExtended } from '../types';\r\n\r\nexport function getBuyBoxInventoryLabel(props: IBuyboxModulePropsExtended, 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: IBuyboxModulePropsExtended, 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: IBuyboxModulePropsExtended, 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: IBuyboxModulePropsExtended, state: IBuyboxState, callbacks: IBuyboxCallbacksLite,\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\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: IBuyboxCallbacksLite): 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: IBuyboxModulePropsExtended, 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\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: IBuyboxModulePropsExtended): 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 { 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\nimport { IBuyboxCallbacksLite } from '../types';\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: IBuyboxCallbacksLite): 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: IBuyboxCallbacksLite): 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 React, {useState, useEffect, useRef} from \"react\";\r\nimport _getViewPort from \"../../Utilities/get-view-port\";\r\nimport MsDyn365, { ICoreContext, IModule } from '@msdyn365-commerce/core';\r\nimport { addThrottledEvent } from '@msdyn365-commerce-modules/utilities';\r\n\r\nconst updateViewPort = (context: ICoreContext): boolean => {\r\n const viewport = _getViewPort(context);\r\n if (viewport === 'lg' || viewport === 'xl') {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n};\r\n\r\n\r\nexport const useIsDesktop = (context: ICoreContext): boolean => {\r\n const [isDesktop, setIsDesktop] = useState(false);\r\n const resizeThrottledEventHandler = useRef<(this: Window, ev: UIEvent) => any>(() => {});\r\n useEffect(()=>{\r\n if (MsDyn365.isBrowser) {\r\n setIsDesktop(updateViewPort(context));\r\n resizeThrottledEventHandler.current = addThrottledEvent(window, 'resize', () => setIsDesktop(updateViewPort(context)));\r\n }\r\n return ()=>{\r\n MsDyn365.isBrowser && window.removeEventListener('resize', resizeThrottledEventHandler.current, false);\r\n };\r\n },[]);\r\n return isDesktop;\r\n};\r\n\r\nexport interface IWithIsDesktopProps {\r\n isDesktop: boolean;\r\n}\r\n\r\nexport const withIsDesktop =

(Component: React.ComponentType

) => {\r\n\r\n return (props:P) => {\r\n const isDesktop = useIsDesktop(props.context);\r\n return ;\r\n };\r\n};\r\n","import React from 'react';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport {\r\n IBuyboxShopSimilarLookViewProps\r\n} from '@msdyn365-commerce-modules/buybox';\r\n\r\nexport const BuyboxShopSimilarItems = (props: IBuyboxShopSimilarLookViewProps): JSX.Element => {\r\n const { ContainerProps, errors, input } = props;\r\n\r\n return (\r\n \r\n {errors}\r\n {input}\r\n \r\n );\r\n};","import React from 'react';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport {\r\n IBuyboxKeyInPriceViewProps\r\n} from '@msdyn365-commerce-modules/buybox';\r\n\r\nexport const BuyboxKeyInPrice = (props: IBuyboxKeyInPriceViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, input } = props;\r\n\r\n return (\r\n \r\n {heading}\r\n {input}\r\n \r\n );\r\n};\r\n","import { Tooltip, Rating } from 'mfcl';\r\nimport Info from 'mfcl/Icons/Info';\r\nimport React from 'react';\r\nimport { BuyboxCustomerSatisfactionScoreProps } from './buybox-customer-satisfaction-score.props';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\n\r\nexport const BuyboxCustomerSatisfactionScore = ({\r\n unitsReturned,\r\n unitsSold,\r\n headingText,\r\n popoverText,\r\n tooltipHover\r\n}: BuyboxCustomerSatisfactionScoreProps) => {\r\n if (!unitsSold) {\r\n return null;\r\n }\r\n\r\n const percentNotReturned: number = Math.round(100 - (Number(unitsReturned) / Number(unitsSold)) * 100);\r\n const unitsNotReturend = Number(unitsSold) - Number(unitsReturned);\r\n const avgRating = (unitsNotReturend * 5) / Number(unitsSold);\r\n return (\r\n \r\n {headingText?.replace('{perNotReturned}', `${percentNotReturned}%`)}\r\n } position='bottom-left' hover={tooltipHover}>\r\n

\r\n \r\n {popoverText\r\n ?.replace('{unitsNotReturend}', unitsNotReturend.toLocaleString())\r\n ?.replace('{unitsSold}', Number(unitsSold).toLocaleString())}\r\n \r\n \r\n \r\n
\r\n {`${percentNotReturned}%`}\r\n {`(${unitsNotReturend.toLocaleString()})`}\r\n
\r\n
\r\n
\r\n \r\n \r\n );\r\n};\r\n\r\nBuyboxCustomerSatisfactionScore.displayName = 'BuyboxCustomerSatisfactionScore';\r\n","import { AsyncResult, AttributeValue } from '@msdyn365-commerce/retail-proxy';\r\n\r\nexport function getProductSpecText(productSpecificationData: AsyncResult | undefined, Name: string): string | undefined {\r\n return productSpecificationData?.result?.find(e => e.Name?.trim().toLowerCase() === Name?.trim().toLowerCase())?.TextValue;\r\n}\r\n\r\nexport function getProductSpecNumber( // Alt name: getProductSpecTextToNumber\r\n productSpecificationData: AsyncResult | undefined,\r\n Name: string\r\n): number | undefined {\r\n const rawValue = getProductSpecText(productSpecificationData, Name);\r\n if (typeof rawValue === 'undefined') {\r\n return NaN;\r\n } else {\r\n return parseFloat(rawValue);\r\n }\r\n}\r\n\r\nexport function getProductSpecBoolean(\r\n productSpecificationData: AsyncResult | undefined,\r\n Name: string\r\n): boolean | undefined {\r\n return productSpecificationData?.result?.find(e => e.Name?.trim().toLowerCase() === Name?.trim().toLowerCase())?.BooleanValue;\r\n}","import { useRef, useEffect } from 'react';\r\n\r\ninterface Props {\r\n onClickOutside: (event: MouseEvent) => void;\r\n}\r\n\r\nconst useClickOutside = (props: Props) => {\r\n const ref = useRef(null);\r\n\r\n const handleClick = (event: MouseEvent) => {\r\n if (ref.current && !ref.current.contains(event.target as Node)) {\r\n props.onClickOutside(event);\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n document.addEventListener('click', handleClick);\r\n return () => {\r\n document.removeEventListener('click', handleClick);\r\n };\r\n });\r\n\r\n return ref;\r\n};\r\n\r\nexport default useClickOutside;\r\n","import React from 'react';\r\nimport {\r\n getTimeZoneAbbr,\r\n secondsToTime\r\n} from '../../../mfrm-store-selector/components/store-selector-location-line-item/date-time-helpers';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport { BuyboxStoreHoursProps } from './types';\r\nexport const BuyboxStoreHours = ({\r\n location,\r\n storeHoursClosedText,\r\n storeCloseAtHours,\r\n storeOpenAtHours\r\n}: BuyboxStoreHoursProps): 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 if (isClosedToday && isClosedToday !== null) {\r\n return (\r\n \r\n Today: {storeHoursClosedText}\r\n \r\n );\r\n } else if (startTime !== null || endTime !== null) {\r\n return (\r\n \r\n Today:{' '}\r\n {!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\nBuyboxStoreHours.displayName = 'BuyboxStoreHours';\r\n","import React from 'react';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport { BuyboxStoreHours } from '../buybox-store-hours/buybox-store-hours';\r\nimport { BuyboxStoreDetailsProps } from './types';\r\n\r\nexport const BuyboxStoreDetails = ({\r\n isSociEnabled,\r\n sociPrefferedStore,\r\n storeAddressLine1,\r\n storeAddressLine2,\r\n phoneNumber,\r\n preferredStore,\r\n storeHoursClosedText,\r\n storeCloseAtHours,\r\n storeOpenAtHours,\r\n sociStoreLocatorUrl,\r\n storeLocatorUrl,\r\n onClickNameOrDetails,\r\n viewStoreDetailsText,\r\n onClickChangeStore,\r\n changeStoreText\r\n}: BuyboxStoreDetailsProps) => {\r\n return (\r\n \r\n {isSociEnabled && sociPrefferedStore ? (\r\n \r\n \r\n {storeAddressLine1}\r\n \r\n \r\n {storeAddressLine2}\r\n \r\n {sociPrefferedStore && (\r\n {`${sociPrefferedStore.city}, ${sociPrefferedStore.state} ${sociPrefferedStore.postalcode}`}\r\n )}\r\n \r\n ) : (\r\n \r\n \r\n {storeAddressLine1}\r\n \r\n \r\n {storeAddressLine2}\r\n \r\n \r\n )}\r\n {phoneNumber && (\r\n \r\n {phoneNumber}\r\n \r\n )}\r\n {!isSociEnabled && (\r\n \r\n )}\r\n \r\n onClickNameOrDetails(event)}\r\n target='_blank'\r\n >\r\n {viewStoreDetailsText}\r\n \r\n \r\n {changeStoreText}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nBuyboxStoreDetails.displayName = 'BuyboxStoreDetails';\r\n","import React from \"react\";\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\n\r\ninterface OpenProps {\r\n children: React.ReactNode;\r\n isOpen: boolean;\r\n}\r\n\r\nexport const Open = React.forwardRef(({ isOpen, children }: OpenProps, ref) => {\r\n if (isOpen) {\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n } else {\r\n return <>{children};\r\n }\r\n});\r\n","import React from 'react';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport useClickOutside from '../../../../common/hooks/useClickOutside';\r\nimport { BuyboxStoreDetails } from '../buybox-store-details/buybox-store-details';\r\nimport { extractPhoneNumber } from '../../../mfrm-store-selector/components/store-selector-location-line-item';\r\nimport { Open } from './open';\r\nimport { BuyboxTryInStoreRedesignProps } from './types';\r\n\r\nexport const BuyboxTryInStoreRedesign = ({\r\n isSociEnabled,\r\n preferredStore,\r\n sociPrefferedStore,\r\n isOnlineOnly,\r\n availableInStoresTextV2,\r\n notAvailableInStoresTextV2,\r\n viewStoreDetailsText,\r\n changeStoreText,\r\n canTryInStores,\r\n onClickChangeStore,\r\n tryInStoresResults,\r\n isStoreDetailsOpen,\r\n storeHoursClosedText,\r\n storeCloseAtHours,\r\n storeOpenAtHours,\r\n onClickNameOrDetails,\r\n onClickOutside\r\n}: BuyboxTryInStoreRedesignProps): JSX.Element | null => {\r\n const ref = useClickOutside({\r\n onClickOutside: event => {\r\n if (isStoreDetailsOpen) {\r\n onClickOutside(event);\r\n }\r\n }\r\n });\r\n\r\n if (Object.keys(sociPrefferedStore)?.length === 0 && Object.keys(preferredStore)?.length === 0) {\r\n return null;\r\n }\r\n const sociStoreName = (isSociEnabled && sociPrefferedStore?.name) || '';\r\n const storeName: string | undefined =\r\n preferredStore &&\r\n (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 { Inventory, Status } = { ...tryInStoresResults };\r\n const isAvailable = !!(Status === 'Success' && canTryInStores && Inventory?.length !== 0);\r\n\r\n if (\r\n !isAvailable &&\r\n !(Status === 'Success' && canTryInStores && Inventory?.length === 0) &&\r\n !(storeName && !canTryInStores && isOnlineOnly)\r\n ) {\r\n return null;\r\n }\r\n\r\n const storeLocatorContext =\r\n preferredStore && preferredStore.Contacts ? preferredStore.Contacts.find(url => url.ContactTypeValue === 3) : undefined;\r\n\r\n // VSI Customization - ends\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n {isAvailable ? availableInStoresTextV2 : notAvailableInStoresTextV2}\r\n onClickNameOrDetails(isAvailable)}\r\n href='javascript:void(0)'\r\n >\r\n {storeNameWithState}\r\n \r\n \r\n \r\n {isStoreDetailsOpen && (\r\n onClickNameOrDetails(isAvailable)}\r\n viewStoreDetailsText={viewStoreDetailsText}\r\n onClickChangeStore={onClickChangeStore}\r\n changeStoreText={changeStoreText}\r\n />\r\n )}\r\n \r\n \r\n );\r\n};\r\n\r\nBuyboxTryInStoreRedesign.displayName = 'BuyboxTryInStoreRedesign';\r\n","import React from 'react';\r\nimport { BVRatingSummary } from '../../../../Utilities/components/BVRatingSummary';\r\nimport MsDyn365, { ICoreContext } from '@msdyn365-commerce/core';\r\nimport { getBVAttributeValues } from '../../../../Utilities/get-bv-attributes';\r\nimport { RatingComponent } from '@msdyn365-commerce/components';\r\nimport { format } from '@msdyn365-commerce-modules/utilities';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy';\r\nimport { IMfrmBuyboxResources } from '../../mfrm-buybox.props.autogenerated';\r\n\r\ninterface Props {\r\n hideRating: boolean;\r\n isBazaarVoice: boolean | undefined;\r\n itemId: string | undefined;\r\n variantId: number | undefined;\r\n id: string;\r\n typeName: string;\r\n context: ICoreContext<{\r\n [x: string]: any;\r\n }>;\r\n productSpecification: AttributeValue[] | undefined;\r\n resources: IMfrmBuyboxResources;\r\n}\r\n\r\nconst _scrollToBVHosted = () => {\r\n if (MsDyn365.isBrowser) {\r\n const ratingSection = document?.getElementById('writeFirstReview');\r\n const isRatingReviewsLoaded = ratingSection?.getElementsByTagName('div')[0]?.getAttribute('data-bv-ready');\r\n isRatingReviewsLoaded && ratingSection?.scrollIntoView({ behavior: 'smooth' });\r\n }\r\n};\r\n\r\nexport const BuyboxProductRating = ({\r\n hideRating,\r\n isBazaarVoice,\r\n itemId,\r\n variantId,\r\n id,\r\n typeName,\r\n context,\r\n productSpecification,\r\n resources\r\n}: Props) => {\r\n if (hideRating) {\r\n return null;\r\n }\r\n if (isBazaarVoice) {\r\n return ;\r\n }\r\n if (!productSpecification) {\r\n return null;\r\n }\r\n\r\n const averageRating = getBVAttributeValues(productSpecification, 'BVAverageOverallRating');\r\n const reviewsCount = getBVAttributeValues(productSpecification, 'BVTotalReviewCount');\r\n return (\r\n \r\n \r\n {!(productSpecification && (averageRating || reviewsCount)) && (\r\n \r\n Write the first review\r\n \r\n )}\r\n \r\n );\r\n};\r\n","import {\r\n getBuyboxProductDescription,\r\n getBuyboxShopSimilarButton,\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 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 { getTelemetryObject, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport { ProductDimensionFull } from '@msdyn365-commerce/commerce-entities';\r\nimport MsDyn365, { getUrlSync, ICoreContext } from '@msdyn365-commerce/core';\r\n\r\nimport {\r\n ProductDimensionValue,\r\n ProductPrice,\r\n SimpleProduct\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 } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport classnames from 'classnames';\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 {\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 } 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 { fireAnalyticsLink } from '../../Utilities/analytics/clickTrack';\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 { _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 getBuyboxProductTitle,\r\n getQuantityLimitsMessages\r\n} from './common/buybox-components';\r\nimport { getBuyboxFindInStore } from './components/mfrm-buybox-find-in-store';\r\nimport { IMfrmBuyboxProps as IBuyboxModuleProps, IMfrmBuyboxResources } from './mfrm-buybox.props.autogenerated';\r\nimport { IVariantStockInfo } from './mfrm-buybox.view';\r\nimport { parseBrandName } from '../../Utilities/get-product-brand';\r\nimport { variantQueryStringName } from '../../Utilities/constants';\r\nimport { getZipCode } from '../../Utilities/get-zipcode';\r\nimport { withIsDesktop } from '../../common/hooks/useIsDesktop';\r\nimport {\r\n IBuyboxModulePropsExtended,\r\n IBuyboxCallbacksLite,\r\n IBuyboxStateExtended,\r\n IBuyboxViewPropsExtended,\r\n ISimpleProductExtended\r\n} from './types';\r\nimport { IMfrmBuyboxData } from './mfrm-buybox.data';\r\nimport { BuyboxShopSimilarItems } from './components/buybox-shop-similar-items';\r\nimport { BuyboxKeyInPrice } from './components/buybox-key-in-price';\r\nimport { BuyboxCustomerSatisfactionScore } from './components/buybox-customer-satisfaction-score/buybox-customer-satisfaction-score';\r\nimport { getProductSpecNumber } from '../../Utilities/getProductSpecificationDataAttributeValue';\r\nimport { BuyboxTryInStoreRedesign } from './components/buybox-try-in-store-redesign/buybox-try-in-store-redesign';\r\nimport { BuyboxProductRating } from './components/buybox-product-rating/buybox-product-rating';\r\nimport { _getProductBadges } from '../../Utilities/product-badge-utils';\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 * Buybox Module\r\n */\r\nclass Buybox extends React.PureComponent {\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: IBuyboxModulePropsExtended) {\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 zipCode: '',\r\n isEyeBrowLoading: true,\r\n isStoreLoading: true,\r\n preferredStore: {},\r\n tealiumRecordIdFor: ''\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._updateUtagDataOnInitialLoad().catch(e => {\r\n throw e;\r\n });\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 // 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 this._updatePrice(await productPrice);\r\n if (product) {\r\n // check if the product is service or not by product type\r\n const PRODUCTASSERVICE = 2;\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 && this.setState({ isStoreLoading: false });\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 const zipCode = getZipCode(this.props.context.actionContext);\r\n zipCode && this.setState({ zipCode: zipCode });\r\n\r\n const isSociEnabled = this.props.app.config.enableSociLocations || false;\r\n const preferredStore = isSociEnabled ? this._getSociPreferredStore() : this._getPreferredStore();\r\n (!preferredStore || Object.keys(preferredStore).length === 0) && this.setState({ isStoreLoading: false });\r\n preferredStore && this.setState({ preferredStore: preferredStore });\r\n }\r\n\r\n // tslint:disable-next-line: cyclomatic-complexity\r\n public async componentDidUpdate(prevProps: IBuyboxModuleProps, prevState: IBuyboxStateExtended): 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 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\r\n if (this.state.tealiumRecordIdFor === '' || (this.props.data.product.result?.RecordId !== this.state.recordId)) {\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 await this._sendProductDataToTealium(this.props, product);\r\n break;\r\n } else if (product?.RecordId.toString() === recordId && isInStock === '1') {\r\n break;\r\n }\r\n }\r\n }\r\n const zipCode = getZipCode(this.props.context.actionContext);\r\n zipCode && zipCode !== this.state.zipCode && this.setState({ zipCode: zipCode });\r\n\r\n if (this.state.zipCode !== prevState.zipCode) {\r\n this.props.data.allVariants.result && this.props.data.productSpecificationData.result?.length &&\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 }\r\n\r\n public async componentWillUnmount(): Promise {\r\n if (this.timer) {\r\n clearTimeout(this.timer);\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 ): ISimpleProductExtended[] | undefined {\r\n let extendedAllProductVariants: ISimpleProductExtended[] | undefined =\r\n allProductVariants &&\r\n allProductVariants?.map(variant => {\r\n let extendedObj: ISimpleProductExtended = { ...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: ISimpleProductExtended = { ...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 async methods\r\n public async getNextInventoryProduct(\r\n product: SimpleProduct | undefined,\r\n productSpecificationData: AttributeValue[] | undefined,\r\n allProductVariants: ISimpleProductExtended[] | 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\r\n private buyboxCallbacks: IBuyboxCallbacksLite = {\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 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 _setZipCode = (zipCode: string) => {\r\n this.setState({ zipCode: zipCode });\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 this.setState({ productPrice: newPrice });\r\n this._updateUtagData(this.props.data?.product?.result, newPrice?.CustomerContextualPrice).catch(e => {\r\n throw e;\r\n });\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 _getPreferredStore = (): OrgUnitLocation => {\r\n if (!MsDyn365.isBrowser || typeof localStorage === 'undefined') {\r\n return {};\r\n } else {\r\n const localStoragePreferredStore = localStorage.getItem('_mfrm__prefferedStore_');\r\n if (localStoragePreferredStore) {\r\n return JSON.parse(localStoragePreferredStore);\r\n } else {\r\n return {};\r\n }\r\n }\r\n };\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 const product = await this.props.data.product;\r\n const category = await this.props.data.categoryPaths;\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 const fallBackBrandAttribute = 'BRAND';\r\n const attribute = this.props.context.app.config.brandBackofficeAttributePdp || fallBackBrandAttribute;\r\n let productBrandName =\r\n (await this.props.data.productSpecificationData).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 const item = await this.props.data.listPageStateBuyBox;\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\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: IBuyboxModuleProps) => {\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: IBuyboxModuleProps,\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 try {\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 availableVariantIDs.push(variant.variantID);\r\n variant.isAvailable = true;\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 } catch (error) {\r\n console.error(\"Variant result is not defined or empty\", error);\r\n }\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: IBuyboxModuleProps, 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 this.setState({ tealiumRecordIdFor: product?.RecordId.toString() });\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 // @ts-ignore\r\n if ('utag' in window) {\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: [`${(await productPrice)?.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 // 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: ISimpleProductExtended[] | 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, isEyeBrowLoading: false });\r\n })\r\n .catch(e => {\r\n this.setState({ isEyeBrowLoading: false });\r\n console.log('Error', e);\r\n });\r\n }\r\n } else {\r\n this.setState({ isEyeBrowLoading: false });\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 = this._getPreferredStore();\r\n const sociPreferredStore = this._getSociPreferredStore();\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 && sociPreferredStore?.project_meta ? JSON.parse(sociPreferredStore?.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 StoreId = isSociEnabled ? sociStoreID : preferredStore?.OrgUnitNumber!;\r\n if (StoreId && zipCodeModified && product?.ItemId?.toString()) {\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 isStoreLoading: false\r\n });\r\n } catch (error) {\r\n this.setState({ isStoreLoading: false });\r\n console.log(error);\r\n }\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\r\n private findPreferredStore = 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\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;\r\n const defaultMinimumKeyInPrice = 10;\r\n const defaultMaximumKeyInPrice = 100;\r\n const brandName = parseBrandName(productSpecificationData, brandBackofficeAttributePdp) || '';\r\n\r\n const viewProps: IBuyboxViewPropsExtended = {\r\n ...this.props,\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, config: {} }),\r\n findInStore: getBuyboxFindInStore(this.props, this.state, this.buyboxCallbacks),\r\n price: getBuyboxProductPrice({ ...props, config: {} }, this.state),\r\n addToCart: getBuyboxAddToCart(props, this.state, this.buyboxCallbacks, defaultMinimumKeyInPrice, defaultMaximumKeyInPrice),\r\n viewCartLink: getUrlSync('cart', props.context.actionContext),\r\n inventoryLabel: getBuyBoxInventoryLabel(props),\r\n shopSimilarLook:\r\n this.props.config.enableShopSimilarLooks\r\n && !product.IsGiftCard\r\n && ,\r\n keyInPrice:\r\n this.props.config.enableKeyInPrice && this.state.isCustomPriceSelected\r\n && ,\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 setZipCode: this._setZipCode,\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 _getProductBadges(this.props.context, this.props.data.productSpecificationData.result),\r\n ratingComponent: ,\r\n tryInStoreComponent: this.findPreferredStore()}\r\n onClickNameOrDetails={async (isAvailable) => {\r\n if (isAvailable) {\r\n this.setState(prevState => ({ isStoreDetailsOpen: !prevState.isStoreDetailsOpen }));\r\n } else {\r\n await this.findPreferredStore();\r\n }\r\n }}\r\n onClickOutside={() => {\r\n this.setState({ isStoreDetailsOpen: false });\r\n }}\r\n />,\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: ,\r\n adjustableItem,\r\n pillow,\r\n protector\r\n };\r\n return this.props.renderView(viewProps);\r\n }\r\n}\r\n\r\nexport default withIsDesktop(Buybox);","/*---------------------------------------------------------------------------------------------\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","/*---------------------------------------------------------------------------------------------\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 React from 'react';\r\n\r\nimport {\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n IPayLoad,\r\n ITelemetryContent,\r\n TelemetryConstant\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport MsDyn365 from '@msdyn365-commerce/core';\r\n// VSI Customization - starts\r\nimport { OrgUnitContact, OrgUnitLocation, StoreHours } from '@msdyn365-commerce/retail-proxy';\r\nimport { getTimeZoneAbbr, secondsToTime } from './date-time-helpers';\r\n// VSI Customization - ends\r\n\r\nexport interface IStoreSelectorLocationLineItemResources {\r\n contactInfoHeader: string;\r\n storeHoursHeader: string;\r\n availabilityInfoHeader: string;\r\n\r\n closedText: string;\r\n\r\n outOfStock: string;\r\n inStock: string;\r\n currentLocation: string;\r\n selectLocation: string;\r\n selectLocationAriaLabelFormat: string;\r\n setAsPreferredStoreText: string;\r\n setAsPreferredStoreTextAriaLabel: string;\r\n preferredStoreText: string;\r\n preferredStoreAriaLabel: string;\r\n\r\n days: {\r\n monday: string;\r\n tuesday: string;\r\n wednesday: string;\r\n thursday: string;\r\n friday: string;\r\n saturday: string;\r\n sunday: string;\r\n mondayFull: string;\r\n tuesdayFull: string;\r\n wednesdayFull: string;\r\n thursdayFull: string;\r\n fridayFull: string;\r\n saturdayFull: string;\r\n sundayFull: string;\r\n };\r\n // VSI Customization - starts\r\n viewStoreDetails: string;\r\n storeOpenAtHours: string;\r\n storeCloseAtHours: string;\r\n // VSI Customization - ends\r\n}\r\n\r\nexport interface IStoreSelectorLocationLineItemProps {\r\n location: OrgUnitLocation;\r\n storeHours?: StoreHours;\r\n\r\n hideStockStatus?: boolean;\r\n isInStock?: boolean;\r\n isCurrentLocation?: boolean;\r\n resources: IStoreSelectorLocationLineItemResources;\r\n stockStatusLabel?: string;\r\n storeLocatorView?: boolean;\r\n isPreferredStoreEnabled?: boolean;\r\n index: string;\r\n preferredStoreLocationId: string | null;\r\n /** The telemetry content */\r\n telemetryContent?: ITelemetryContent;\r\n preferredDistanceUnit: string;\r\n isLocationDisabled?: boolean;\r\n handlers: {\r\n onSelected(location: OrgUnitLocation): void;\r\n onSetAsPreferredStore(locationId: string | undefined): void;\r\n onRemovePreferredStore(): void;\r\n };\r\n}\r\n\r\nconst StoreSelectorLocationLineItemComponentActions = {\r\n onLocationSelected(props: IStoreSelectorLocationLineItemProps): void {\r\n props.handlers.onSelected(props.location);\r\n },\r\n onSetAsPreferredStore(props: IStoreSelectorLocationLineItemProps): void {\r\n props.handlers.onSetAsPreferredStore(props.location.OrgUnitNumber);\r\n },\r\n onRemovePreferredStore(props: IStoreSelectorLocationLineItemProps): void {\r\n props.handlers.onRemovePreferredStore();\r\n }\r\n};\r\n\r\nconst renderStoreHours = (\r\n location: OrgUnitLocation,\r\n resources: IStoreSelectorLocationLineItemResources,\r\n distanceAsString: string | undefined\r\n): 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 if (isClosedToday && isClosedToday !== null) {\r\n return (\r\n
\r\n
{resources.closedText}
\r\n
\r\n );\r\n } else if (startTime !== null || endTime !== null) {\r\n return (\r\n
\r\n
\r\n {!isClosed\r\n ? `${resources.storeCloseAtHours} ${secondsToTime(endTime)} ${timeZoneAbbr}`\r\n : `${resources.storeOpenAtHours} ${secondsToTime(startTime)} ${timeZoneAbbr}`}\r\n
\r\n
\r\n );\r\n } else {\r\n return null;\r\n }\r\n};\r\n\r\nconst buildDistanceString = (\r\n distance: number | undefined,\r\n preferredDistanceUnit: string,\r\n isLocationDisabled?: boolean\r\n): string | undefined => {\r\n if (distance === undefined || isLocationDisabled) {\r\n return undefined;\r\n } else if (distance < 1) {\r\n // VSI Customization - starts\r\n return `<1 ${preferredDistanceUnit}`;\r\n } else {\r\n return `${Math.floor(distance)} ${preferredDistanceUnit}`;\r\n // VSI Customization - ends\r\n }\r\n};\r\n\r\nexport const extractPhoneNumber = (contacts: OrgUnitContact[] | undefined): string | undefined => {\r\n if (!contacts) {\r\n return undefined;\r\n }\r\n\r\n const allPhoneContacts = contacts.filter(contact => contact.ContactTypeValue === 1 && !contact.IsPrivate);\r\n\r\n if (allPhoneContacts && allPhoneContacts.length > 0) {\r\n const primaryPhoneContact = allPhoneContacts.find(contact => contact.IsPrimary);\r\n\r\n if (primaryPhoneContact) {\r\n return primaryPhoneContact.Locator;\r\n }\r\n\r\n return allPhoneContacts[0].Locator;\r\n }\r\n\r\n return undefined;\r\n};\r\n\r\n// tslint:disable-next-line: cyclomatic-complexity max-func-body-length\r\nconst StoreSelectorLocationLineItem: React.FC = (props: IStoreSelectorLocationLineItemProps) => {\r\n const onClick = () => StoreSelectorLocationLineItemComponentActions.onLocationSelected(props);\r\n const _storeDetailsTracking = () => {\r\n // @ts-ignore\r\n if ('utag' in window) {\r\n const pageURL = MsDyn365.isBrowser && window.location.pathname;\r\n // @ts-ignore\r\n utag.link({\r\n event: \"store-locator-slideout-store-details\",\r\n event_category: \"store locator slideout\",\r\n event_action: \"store details link click\",\r\n event_label: `from: ${pageURL}`,\r\n event_noninteraction: \"false\"\r\n });\r\n }\r\n };\r\n const {\r\n hideStockStatus,\r\n isCurrentLocation,\r\n isInStock,\r\n location,\r\n resources,\r\n // storeHours,\r\n stockStatusLabel,\r\n storeLocatorView,\r\n index,\r\n preferredStoreLocationId,\r\n isPreferredStoreEnabled,\r\n isLocationDisabled,\r\n telemetryContent\r\n } = props;\r\n\r\n const storeName: string | undefined =\r\n location.ExtensionProperties?.find(x => x.Key === 'Yext_Store_Name')?.Value?.StringValue || location.OrgUnitName;\r\n const storeLocatorContext = location && location.Contacts ? location.Contacts.find(url => url.ContactTypeValue === 3) : undefined;\r\n const storeLocatorUrl: string | undefined = storeLocatorContext\r\n ? storeLocatorContext.Locator\r\n : `https://bing.com/maps/default.aspx?where1=${location.Address}`;\r\n const distanceAsString: string | undefined = buildDistanceString(location.Distance, props.preferredDistanceUnit, isLocationDisabled);\r\n const storeAddress: string | undefined = location.Address;\r\n // VSI Customization - starts\r\n const storeAddressLine1: string | undefined = location.Street;\r\n const storeAddressLine2: string | undefined = `${location.City}, ${location.State} ${location.Zip}`;\r\n // VSI Customization - ends\r\n const phoneNumber: string | undefined = extractPhoneNumber(location.Contacts);\r\n\r\n const resourceLabel = isInStock ? resources.inStock : resources.outOfStock;\r\n const stockLabel = stockStatusLabel ? stockStatusLabel : undefined;\r\n const stockText: string | undefined = hideStockStatus ? undefined : stockLabel ? stockLabel : resourceLabel;\r\n const canSelectLocation = hideStockStatus || isInStock;\r\n const pickupInStoreButtonText: string = resources.selectLocation;\r\n const pickupInStoreAriaLabel: string = resources.selectLocationAriaLabelFormat?.replace('{StoreName}', storeName || '');\r\n const isPreferredStore = preferredStoreLocationId === location.OrgUnitNumber;\r\n const payLoad: IPayLoad = getPayloadObject('click', telemetryContent!, TelemetryConstant.PickupInStore);\r\n const attributes = getTelemetryAttributes(telemetryContent!, payLoad);\r\n payLoad.contentAction.etext = TelemetryConstant.PreferredStore;\r\n const preferredStoreAttr = getTelemetryAttributes(telemetryContent!, payLoad);\r\n payLoad.contentAction.etext = TelemetryConstant.RemovePreferredStore;\r\n const RemovePreferredStoreAttr = getTelemetryAttributes(telemetryContent!, payLoad);\r\n const setAsPreferredStore = () => StoreSelectorLocationLineItemComponentActions.onSetAsPreferredStore(props);\r\n const removePreferredStore = () => StoreSelectorLocationLineItemComponentActions.onRemovePreferredStore(props);\r\n\r\n return (\r\n
\r\n
\r\n {storeLocatorView && {index}}\r\n {storeName}\r\n
\r\n {/* VSI Customization - starts */}\r\n
\r\n

{resources.storeHoursHeader}

\r\n {renderStoreHours(location, resources, distanceAsString)}\r\n {distanceAsString ? {distanceAsString} : false}\r\n
\r\n {/* VSI Customization - starts */}\r\n
\r\n
\r\n

{resources.contactInfoHeader}

\r\n {storeAddress && (\r\n
\r\n \r\n
\r\n

{storeAddressLine1}

\r\n

{storeAddressLine2}

\r\n
\r\n
\r\n )}\r\n {phoneNumber && (\r\n
\r\n \r\n {phoneNumber}\r\n
\r\n )}\r\n
\r\n {!storeLocatorView && (\r\n
\r\n

{resources.availabilityInfoHeader}

\r\n {stockText &&

{stockText}

}\r\n {isCurrentLocation ? (\r\n

{resources.currentLocation}

\r\n ) : canSelectLocation ? (\r\n \r\n {pickupInStoreButtonText}\r\n \r\n ) : (\r\n false\r\n )}\r\n
\r\n )}\r\n
\r\n {isPreferredStoreEnabled ? (\r\n isPreferredStore ? (\r\n \r\n {resources.preferredStoreText}\r\n \r\n ) : (\r\n \r\n {resources.setAsPreferredStoreText}\r\n \r\n )\r\n ) : null}\r\n \r\n {resources.viewStoreDetails}\r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport const StoreSelectorLocationLineItemComponent = StoreSelectorLocationLineItem as (\r\n props: IStoreSelectorLocationLineItemProps\r\n) => JSX.Element;\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} 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\nimport { getSetCartProductPrice, ICartProductPrice } from '../../../../../Utilities/cart-utils';\r\nimport useVwoClientInstance from '../../../../../common/hooks/useVwoClientInstance';\r\n\r\nexport interface IAddToCartComponentProps extends IComponentProps<{ product: SimpleProduct; price?: ProductPrice; productPrice?: 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 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' in window) {\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.adjustableItem?.foundation.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 productPriceHandler(productPrice);\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/*** VSI Customization - Buy side Save data custom event for check price mismatch details. * ticket - 95129 End. */\r\n const productPriceHandler = (productPrice?: ProductPrice) => {\r\n const getCartProductPriceArray = getSetCartProductPrice('get');\r\n const priceDetails: ICartProductPrice[] = [{variantRecordId: productPrice?.ProductId, price: productPrice?.AdjustedPrice}];\r\n getSetCartProductPrice('set', [...getCartProductPriceArray, ...priceDetails]);\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 // VWO Tracking\r\n const {vwoAccountId, vwoSdkKey} = props.context.app.config;\r\n const [ vwoClientInstance, vwoUserId ] = useVwoClientInstance((vwoAccountId ? vwoAccountId :'717583') , (vwoSdkKey ? vwoSdkKey : 'a537da7250fc410f83f9e8589efebe73'));\r\n const onClickHandler = async (event: React.MouseEvent) => {\r\n if( vwoClientInstance ){\r\n const campaignKey = null;\r\n const userId = vwoUserId;\r\n vwoClientInstance.track(campaignKey, userId, 'addToCartCTA');\r\n }\r\n const setSuccess = props.updateSuccessfulATC ? props.updateSuccessfulATC : () => null;\r\n await AddToCartComponentActions.onClick(event, props, setDisabled, setModalOpen, setSuccess);\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","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getCatalogId, IActionContext, IImageData, IImageSettings } from '@msdyn365-commerce/core';\nimport { MediaLocation, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { getMediaLocationsForSelectedVariant, MediaLocationsForSelectedVariantInput } from '@msdyn365-commerce-modules/retail-actions';\n\nexport async function getValidProductImages(\n productId: number,\n channelId: number,\n actionContext: IActionContext,\n imageSettings: IImageSettings,\n selectedProduct?: SimpleProduct\n): Promise {\n const catalogId = getCatalogId(actionContext.requestContext);\n const actionInput = new MediaLocationsForSelectedVariantInput(productId, channelId, selectedProduct, catalogId);\n\n return getMediaLocationsForSelectedVariant(actionInput, actionContext)\n .then(mediaLocations => {\n if (mediaLocations) {\n return Promise.all(mediaLocations.map(async mediaLocation => validateMediaLocaionAsync(mediaLocation, imageSettings))).then(\n pairs => {\n return pairs.filter(pair => pair[1]).map(pair => pair[0]);\n }\n );\n }\n return [];\n })\n .catch(error => {\n actionContext.telemetry.exception(error);\n actionContext.telemetry.debug('Unable to get Media Locations for Selected Variant');\n return [];\n });\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-unused-vars-experimental -- .\nasync function validateMediaLocaionAsync(mediaLocation: MediaLocation, imageSettings?: IImageSettings): Promise<[IImageData, boolean]> {\n const imageData = {\n src: mediaLocation.Uri || '',\n altText: mediaLocation.AltText || ''\n };\n\n if (imageData.src === '') {\n return [imageData, false];\n }\n\n return new Promise<[IImageData, boolean]>(resolve => {\n try {\n const http = new XMLHttpRequest();\n http.open('HEAD', imageData.src, true);\n\n http.addEventListener('load', () => {\n resolve([imageData, http.status === 200 || http.status === 201]);\n });\n\n http.addEventListener('error', () => {\n resolve([imageData, false]);\n });\n\n http.send();\n } catch {\n resolve([imageData, false]);\n }\n });\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ProductDimensionFull } from '@msdyn365-commerce/commerce-entities';\nimport { Carousel, ICarouselProps } from '@msdyn365-commerce/components';\nimport { IImageData, IImageSettings, Image } from '@msdyn365-commerce/core';\nimport {\n ProductDeliveryOptions,\n ProductDimension,\n ProductDimensionValue,\n ProductPrice,\n ReleasedProductType,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy';\nimport {\n ArrayExtensions,\n FinitePromiseQueue,\n FinitePromiseQueueError,\n getDeliveryOptionsForSelectedVariant,\n GetDeliveryOptionsForSelectedVariantInput,\n getDimensionsForSelectedVariant,\n GetDimensionsForSelectedVariantInput,\n getPriceForSelectedVariant,\n getProductAvailabilitiesForSelectedVariant,\n getProductPageUrlSync,\n getSelectedVariant,\n IProductInventoryInformation,\n IPromiseQueue,\n ISelectedProduct,\n ObjectExtensions,\n PriceForSelectedVariantInput,\n ProductAvailabilitiesForSelectedVariantInput,\n QueryResultSettingsProxy,\n SelectedVariantInput\n} from '@msdyn365-commerce-modules/retail-actions';\nimport {\n Button,\n format,\n getPayloadObject,\n getTelemetryAttributes,\n getTelemetryObject,\n IComponentNodeProps,\n IModuleProps,\n IncrementalQuantity,\n INodeProps,\n ISingleSlideCarouselProps,\n isMobile,\n ITelemetryContent,\n KeyCodes,\n Modal,\n ModalBody,\n ModalFooter,\n ModalHeader,\n NodeTag,\n onTelemetryClick,\n SingleSlideCarousel,\n TelemetryConstant,\n updateMaxQuantityForCartLineItem,\n VariantType\n} from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { Spinner, SpinnerSize } from 'office-ui-fabric-react';\nimport React, { ReactNode } from 'react';\n\nimport {\n getBuyboxAddToCart,\n getBuyBoxInventoryLabel,\n getBuyboxKeyInPrice,\n getBuyboxProductAddToWishlist,\n getBuyboxProductDescription,\n getBuyboxProductPrice,\n getBuyboxProductRating,\n getBuyboxProductTitle,\n getBuyboxProductUnitOfMeasure,\n getQuantityLimitsMessages,\n IBuyboxAddToCartViewProps,\n IBuyboxAddToOrderTemplateViewProps,\n IBuyboxAddToWishlistViewProps,\n IBuyboxCallbacks,\n IBuyboxCommonData,\n IBuyboxExtentedProps,\n IBuyboxKeyInPriceViewProps,\n IBuyboxProductConfigureViewProps,\n IBuyboxProductQuantityViewProps,\n IBuyboxState,\n IErrorState,\n IProductDetails,\n RetailDefaultOrderQuantityLimitsFeatureName\n} from '../../common';\nimport { getBuyboxProductConfigure } from '../../common/buybox-product-configure';\nimport { IQuickviewData } from './quickview.data';\nimport { IQuickviewProps, IQuickviewResources } from './quickview.props.autogenerated';\nimport { getProductDetails } from './utilities/get-product-details';\nimport { getValidProductImages } from './utilities/get-valid-product-images';\nimport { RecentlyViewedState } from '../recently-viewed';\nimport { getDeliveryOptionsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\n\n/**\n * QuickView props Interface.\n */\nexport interface IQuickviewViewProps extends IQuickviewProps {\n quickView: IModuleProps;\n quickViewButton: React.ReactNode;\n ModalContainer: IModuleProps;\n ModalHeaderContainer: INodeProps;\n ModalHeaderContent: React.ReactNode;\n ModalFooterContainer: INodeProps;\n ModalBodyContainer: INodeProps;\n cartContainerProps: INodeProps;\n state: IBuyboxState;\n ModuleProps?: IModuleProps;\n ProductInfoContainerProps: INodeProps;\n MediaGalleryContainerProps: INodeProps;\n callbacks?: IBuyboxCallbacks;\n title?: React.ReactNode;\n description?: React.ReactNode;\n configure?: IBuyboxProductConfigureViewProps;\n inventoryLabel?: React.ReactNode;\n rating?: React.ReactNode;\n price?: React.ReactNode;\n addToCart?: IBuyboxAddToCartViewProps;\n addToOrderTemplate?: IBuyboxAddToOrderTemplateViewProps;\n addToWishlist?: IBuyboxAddToWishlistViewProps;\n max: number | undefined;\n keyInPrice?: IBuyboxKeyInPriceViewProps;\n quantity?: IBuyboxProductQuantityViewProps;\n quantityLimitsMessages?: React.ReactNode;\n CarouselProps: INodeProps;\n Thumbnails: IQuickViewThumbnailsViewProps;\n seeDetailsbutton: React.ReactNode;\n isModalOpen: boolean;\n loading?: React.ReactNode;\n unitOfMeasure?: React.ReactNode;\n productDetails?: IProductDetails | undefined;\n isMobileDevice?: boolean;\n}\n\n/**\n * QuickView extend props Interface.\n */\nexport interface IQuickviewExtentedProps extends IQuickviewProps {\n selectedProductId?: number;\n selectedDimensions?: ProductDimension[];\n}\n\n/**\n * QuickView thumbnails props Interface.\n */\nexport interface IQuickViewThumbnailsViewProps {\n ThumbnailsContainerProps: INodeProps;\n SingleSlideCarouselComponentProps: INodeProps;\n items?: IQuickViewThumbnailItemViewProps[];\n}\n\n/**\n * QuickView thumbnail item view props Interface.\n */\nexport interface IQuickViewThumbnailItemViewProps {\n ThumbnailItemContainerProps: INodeProps;\n Picture: React.ReactElement;\n}\n\n/**\n * QuickView state Interface.\n */\nexport interface IQuickViewState extends IBuyboxState {\n isDataLoaded: boolean;\n}\n\n/**\n *\n * Quickview component.\n * @extends {React.Component>}\n */\nclass Quickview extends React.Component, IQuickViewState> {\n /**\n * A queue of tasks of processing the changes in the dimensions.\n * Limit to two processes:\n * 1 - for the current process, which is under execution at the moment.\n * 2 - next process, which will process the latest version of data.\n * @remark Enqueueing new promises will discard the previous ones (except the one which is under processing).\n */\n private readonly dimensionUpdateQueue: IPromiseQueue = new FinitePromiseQueue(2);\n\n private dimensions: { [id: number]: string } = {};\n\n private readonly telemetryContent: ITelemetryContent;\n\n private productDetails: IProductDetails | undefined;\n\n private readonly quickViewCallbacks: IBuyboxCallbacks = {\n updateQuantity: (newQuantity: number): boolean => {\n const errorState = { ...this.state.errorState };\n errorState.quantityError = undefined;\n errorState.otherError = undefined;\n\n this.setState({ quantity: newQuantity, errorState });\n return true;\n },\n updateErrorState: (newErrorState: IErrorState): void => {\n this.setState({ errorState: newErrorState });\n },\n updateSelectedProduct: (\n newSelectedProduct: Promise,\n newInventory: IProductInventoryInformation | undefined,\n newPrice: ProductPrice | undefined,\n newDeliveryOptions: ProductDeliveryOptions | undefined\n ): void => {\n this.setState({\n selectedProduct: newSelectedProduct,\n productAvailableQuantity: newInventory,\n productDeliveryOptions: newDeliveryOptions\n });\n this._updatePrice(newPrice);\n },\n dimensionSelectedAsync: async (selectedDimensionId: number, selectedDimensionValueId: string): Promise => {\n this.dimensions[selectedDimensionId] = selectedDimensionValueId;\n return this.dimensionUpdateQueue\n .enqueue(async () => {\n return this._updateDimensions();\n })\n .catch((error: unknown) => {\n // Ignore discarded processes.\n if (error !== FinitePromiseQueueError.ProcessWasDiscardedFromTheQueue) {\n throw error;\n }\n });\n },\n getDropdownName: (dimensionType: number, resources: IQuickviewResources): string => {\n return this._getDropdownName(dimensionType, resources);\n },\n changeModalOpen: (isModalOpen: boolean): void => {\n this._hideQuickViewDialog();\n },\n changeUpdatingDimension: (isUpdatingDimension: boolean): void => {\n this.setState({ isUpdatingDimension });\n },\n updateKeyInPrice: (customPrice: number): void => {\n // Remove custom amount error when updating the custom price\n const errorState = { ...this.state.errorState };\n errorState.customAmountError = undefined;\n\n this.setState({ isPriceKeyedIn: true, keyInPriceAmount: customPrice, errorState });\n this._updatePrice(this.state.productPrice, customPrice);\n }\n };\n\n private readonly defaultGalleryImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=767&h=767&m=8', w: 0, h: 0 },\n sm: { q: 'w=600&h=600&m=8', w: 0, h: 0 },\n md: { q: 'w=600&h=772&m=8', w: 0, h: 0 },\n lg: { q: 'h=772&m=8', w: 0, h: 0 }\n },\n lazyload: true,\n cropFocalRegion: true\n };\n\n private readonly defaultThumbnailImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=100&m=8', w: 100, h: 0 },\n lg: { q: 'w=100&m=8', w: 100, h: 0 }\n },\n lazyload: true,\n cropFocalRegion: true\n };\n\n public constructor(props: IQuickviewProps) {\n super(props);\n this.state = {\n modalOpen: false,\n quantity: 1,\n min: undefined,\n max: undefined,\n errorState: {\n configureErrors: {}\n },\n selectedProduct: undefined,\n productPrice: undefined,\n productDeliveryOptions: undefined,\n isUpdatingDimension: false,\n activeIndex: 0,\n animating: false,\n mediaGalleryItems: undefined,\n isDataLoaded: false\n };\n\n this._quickViewCloseButtonclick = this._quickViewCloseButtonclick.bind(this);\n this.telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.friendlyName, props.telemetry);\n }\n\n /**\n * React should component udpate function.\n * @param nextProps - Next Props.\n * @param nextState - Next State.\n * @returns Boolean - Whether the module will rerender or not.\n */\n public shouldComponentUpdate(nextProps: IQuickviewProps, nextState: IBuyboxState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n const {\n config: { className = '' },\n resources\n } = this.props;\n const { max } = this.state;\n const product = this.productDetails?.product ? this.productDetails.product : undefined;\n const props = this.props as IBuyboxExtentedProps;\n const defaultMinimumKeyInPrice = 10;\n const defaultMaximumKeyInPrice = 100;\n const isMobileDevice = isMobile({ variant: VariantType.Viewport, context: this.props.context.request }) === 'xs';\n const viewprops: IQuickviewViewProps = {\n ...(this.props as IQuickviewExtentedProps),\n state: this.state,\n productDetails: this.productDetails,\n isModalOpen: this.state.modalOpen!,\n quickView: {\n moduleProps: this.props,\n className: classnames('ms-quickView', className),\n tag: 'div'\n },\n isMobileDevice,\n quickViewButton: (\n \n ),\n ModalContainer: {\n moduleProps: this.props,\n tag: Modal,\n className: 'ms-quickView__dialog',\n isOpen: this.state.modalOpen,\n 'aria-label': format(resources.quickViewAriaLabel, this.productDetails?.product?.Name),\n toggle: this._quickViewCloseButtonclick,\n modalTransition: { timeout: 0 },\n shouldUpdateFocusToFirstElement: this.state.isDataLoaded\n },\n ModalHeaderContainer: {\n tag: ModalHeader,\n className: 'ms-quickView__header',\n toggle: this._quickViewCloseButtonclick\n },\n ModalFooterContainer: {\n tag: ModalFooter,\n className: 'ms-quickView__footer'\n },\n ModalHeaderContent: '',\n ModalBodyContainer: {\n tag: ModalBody,\n className: 'ms-quickView__body'\n },\n cartContainerProps: {\n className: 'ms-quickView__product-add-to-cart'\n },\n ProductInfoContainerProps: {\n className: 'ms-quickView__content'\n },\n MediaGalleryContainerProps: {\n className: 'ms-quickView__media-gallery'\n },\n seeDetailsbutton: this._renderSeeDetailButton(product),\n loading: !this.state.isDataLoaded && (\n \n ),\n callbacks: this.quickViewCallbacks,\n title: this.state.isDataLoaded && getBuyboxProductTitle(props, this.productDetails),\n description: this.state.isDataLoaded && getBuyboxProductDescription(props, this.productDetails),\n configure: this.state.isDataLoaded\n ? getBuyboxProductConfigure(props, this.state, this.quickViewCallbacks, this.productDetails, this.props.selectedDimensions)\n : undefined,\n price: this.state.isDataLoaded && getBuyboxProductPrice(props, this.state),\n unitOfMeasure: this.state.isDataLoaded && getBuyboxProductUnitOfMeasure(props, this.productDetails),\n rating:\n this.state.isDataLoaded && !this.props.context.app.config.hideRating && getBuyboxProductRating(props, this.productDetails),\n addToCart: this.state.isDataLoaded\n ? getBuyboxAddToCart(\n props,\n this.state,\n this.quickViewCallbacks,\n defaultMinimumKeyInPrice,\n defaultMaximumKeyInPrice,\n this.productDetails\n )\n : undefined,\n keyInPrice:\n this.state.isDataLoaded && this.props.config.enableKeyInPrice && this.state.isCustomPriceSelected\n ? getBuyboxKeyInPrice(props, this.state, this.quickViewCallbacks)\n : undefined,\n quantity: product?.IsGiftCard ? undefined : this._renderQuantity(this.props, this.state, this.quickViewCallbacks),\n inventoryLabel: this.state.isDataLoaded && getBuyBoxInventoryLabel(props, this.productDetails),\n addToWishlist: this.state.isDataLoaded\n ? getBuyboxProductAddToWishlist(props, this.state, this.quickViewCallbacks, this.productDetails)\n : undefined,\n quantityLimitsMessages: this.state.isDataLoaded && getQuantityLimitsMessages(props, this.state),\n max,\n CarouselProps: this._renderCarousel(),\n Thumbnails: this._renderThumbnails()\n };\n\n return this.props.renderView(viewprops) as React.ReactElement;\n }\n\n /**\n * Method to render detail button on quick view.\n * @param product - Simple product object.\n * @returns JSX element.\n */\n private readonly _renderSeeDetailButton = (product: SimpleProduct | undefined): JSX.Element => {\n const { config } = this.props;\n const payLoad = getPayloadObject('click', this.telemetryContent, TelemetryConstant.seeDetails, '');\n const attributes = getTelemetryAttributes(this.telemetryContent, payLoad);\n\n return (\n \n {config.seeDetailsLinkText}\n \n );\n };\n\n /**\n * Method to return carousel.\n * @returns Node props.\n */\n private readonly _renderCarousel = (): INodeProps => {\n const { config, resources } = this.props;\n let mediaGalleryItems: ReactNode[];\n let keys: (string | undefined)[];\n const galleryImageSettings = config.galleryImageSettings;\n if (galleryImageSettings) {\n galleryImageSettings.cropFocalRegion = true;\n }\n\n if (ArrayExtensions.hasElements(this.state.mediaGalleryItems)) {\n mediaGalleryItems = this.state.mediaGalleryItems.map((item: IImageData, index: number) => {\n return this._renderCarouselItemImageView(item, galleryImageSettings || this.defaultGalleryImageSettings, index);\n });\n keys = [...this.state.mediaGalleryItems.map(item => item.src)];\n } else {\n mediaGalleryItems = [this._renderEmptyImage(galleryImageSettings)];\n keys = ['empty'];\n }\n\n const props: IComponentNodeProps = {\n tag: Carousel,\n className: 'ms-media-gallery__carousel',\n items: mediaGalleryItems,\n activeIndex: this.state.activeIndex ?? 0,\n next: this.next,\n previous: this.previous,\n interval: false,\n directionTextPrev: resources.previousScreenshotFlipperText,\n directionTextNext: resources.nextScreenshotFlipperText,\n indicatorAriaText: resources.ariaLabelForSlide,\n onIndicatorsClickHandler: this.goToIndex,\n handleOnExited: this.onExited,\n handleOnExiting: this.onExiting,\n key: keys\n };\n\n return props;\n };\n\n /**\n * Method to render thumbnails.\n * @returns QuickView Thumbnails view props.\n */\n private readonly _renderThumbnails = (): IQuickViewThumbnailsViewProps => {\n const { config, id, resources } = this.props;\n\n const thumbnailImageSettings = config.thumbnailImageSettings;\n if (thumbnailImageSettings) {\n thumbnailImageSettings.cropFocalRegion = true;\n }\n\n let mediaGalleryItems: IQuickViewThumbnailItemViewProps[];\n let keys: (string | undefined)[];\n if (ArrayExtensions.hasElements(this.state.mediaGalleryItems)) {\n mediaGalleryItems = this.state.mediaGalleryItems.map((item: IImageData, index: number) => {\n return this._getThumbnailItem(\n item,\n thumbnailImageSettings ?? this.defaultThumbnailImageSettings,\n index,\n this.state.activeIndex!\n );\n });\n keys = [...this.state.mediaGalleryItems.map(item => item.src)];\n } else {\n mediaGalleryItems = [];\n keys = [];\n }\n\n return {\n ThumbnailsContainerProps: { className: 'ms-media-gallery__thumbnails-container' },\n SingleSlideCarouselComponentProps: {\n tag: SingleSlideCarousel,\n className: 'ms-media-gallery__thumbnails',\n flipperPrevLabel: resources.previousScreenshotFlipperText,\n flipperNextLabel: resources.nextScreenshotFlipperText,\n parentId: id,\n useTabList: true,\n key: JSON.stringify(keys)\n } as IComponentNodeProps,\n items: mediaGalleryItems\n };\n };\n\n private _updateMediaItems(lastUpdatedTime: number): void {\n const product = this.productDetails?.product;\n if (!this.state.mediaGalleryItems && product?.PrimaryImageUrl) {\n this.setState({\n mediaGalleryItems: [this._mapProductToImageData(product)],\n lastUpdate: lastUpdatedTime\n });\n }\n }\n\n private _updatePrice(newPrice: ProductPrice | undefined, customPrice: number | undefined = this.state.keyInPriceAmount): void {\n if (this.state.isCustomPriceSelected && newPrice) {\n newPrice.CustomerContextualPrice = customPrice;\n }\n this.setState({ productPrice: newPrice });\n }\n\n private readonly _updateDimensions = async (): Promise => {\n const {\n context: {\n actionContext,\n request: {\n apiSettings: { channelId }\n }\n }\n } = this.props;\n\n const { product, productDimensions } = this.productDetails!;\n\n if (!product || !productDimensions) {\n return;\n }\n\n const dimensionsToUpdate: { [id: number]: string } = { ...this.dimensions };\n this.setState({ isUpdatingDimension: true });\n\n // Step 1: Clear error state to display relevant errors\n if (this.state.errorState.otherError || this.state.errorState.quantityError) {\n const clearErrorState = { ...this.state.errorState };\n clearErrorState.otherError = undefined;\n if (this.state.errorState.errorHost === 'ADDTOCART') {\n clearErrorState.quantityError = undefined;\n clearErrorState.errorHost = undefined;\n }\n this.setState({ errorState: clearErrorState });\n }\n\n // Step 2: Clear any errors indicating the dimension wasn't selected\n for (const key of Object.keys(dimensionsToUpdate)) {\n if (this.state.errorState.configureErrors[key]) {\n const errorState = { ...this.state.errorState };\n errorState.configureErrors[key] = undefined;\n\n this.setState({ errorState });\n }\n }\n\n // Step 3, Build the actually selected dimensions, prioritizing the information in state\n // over the information in data\n const mappedDimensions = productDimensions\n .map(dimension => {\n return {\n DimensionTypeValue: dimension.DimensionTypeValue,\n DimensionValue:\n this._updateDimensionValue(dimension, dimensionsToUpdate[dimension.DimensionTypeValue]) || dimension.DimensionValue,\n ExtensionProperties: dimension.ExtensionProperties\n };\n })\n .filter(dimension => {\n return dimension && dimension.DimensionValue;\n });\n\n // Step 4. Use these dimensions hydrate the product. Wrap this in a promise\n // so that places like add to cart can await it\n const selectedProduct = new Promise(async resolve => {\n const newProduct = await getSelectedVariant(\n new SelectedVariantInput(\n product.MasterProductId ? product.MasterProductId : product.RecordId,\n channelId,\n mappedDimensions,\n undefined,\n this.props.context.request\n ),\n actionContext\n );\n if (newProduct) {\n // @ts-expect-error\n this.productDetails.productDimensions = await getDimensionsForSelectedVariant(\n new GetDimensionsForSelectedVariantInput(\n newProduct.MasterProductId ? newProduct.MasterProductId : newProduct.RecordId,\n channelId,\n mappedDimensions,\n this.props.context.request\n ),\n actionContext\n );\n }\n\n resolve(newProduct);\n });\n\n this.setState({ selectedProduct });\n const variantProduct = await selectedProduct;\n\n if (variantProduct && this.productDetails) {\n // Step 5. Use these dimensions hydrate the inventory. Wrap this in a promise\n // so that places like add to cart can await it\n this.productDetails.product = variantProduct;\n const images = await getValidProductImages(\n this.productDetails.product.RecordId || 0,\n +this.props.context.request.apiSettings.channelId,\n this.props.context.actionContext,\n this.props.config.thumbnailImageSettings || this.defaultThumbnailImageSettings,\n variantProduct.productVariant ?? variantProduct\n );\n this.setState({\n mediaGalleryItems: [...images],\n activeIndex: 0,\n lastUpdate: Date.now()\n });\n\n const newAvailableQuantity = await getProductAvailabilitiesForSelectedVariant(\n new ProductAvailabilitiesForSelectedVariantInput(variantProduct.RecordId, channelId),\n actionContext\n );\n\n this.productDetails.productAvailableQuantity = newAvailableQuantity!;\n\n const isCustompriceSelected = variantProduct.Dimensions?.find(\n dimension => dimension.DimensionTypeValue === 4 && dimension.DimensionValue?.Value?.toLowerCase() === 'custom'\n );\n\n if (isCustompriceSelected) {\n this.setState({ isCustomPriceSelected: true });\n } else {\n // Remove custom amount error when unselect the custom amount\n const errorState = { ...this.state.errorState };\n errorState.customAmountError = undefined;\n\n this.setState({ isCustomPriceSelected: false, isPriceKeyedIn: false, errorState });\n }\n\n if (newAvailableQuantity && newAvailableQuantity.length > 0) {\n this.setState({ productAvailableQuantity: newAvailableQuantity[0] });\n } else {\n this.setState({ productAvailableQuantity: undefined });\n }\n\n // Step 6. Use these dimensions hydrate the product price.\n const newPrice = await getPriceForSelectedVariant(\n new PriceForSelectedVariantInput(variantProduct.RecordId, channelId),\n actionContext\n );\n\n if (newPrice) {\n this._updatePrice(newPrice);\n }\n\n const RetailMulitplePickupMFeatureState = this.props.data.featureState.result?.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature'\n );\n\n // Step 7. Use these dimensions hydrate the product delivery options.\n const newDeliveryOptions = await getDeliveryOptionsForSelectedVariant(\n new GetDeliveryOptionsForSelectedVariantInput(\n variantProduct.RecordId,\n channelId,\n undefined,\n undefined,\n RetailMulitplePickupMFeatureState?.IsEnabled\n ),\n actionContext\n );\n\n if (newDeliveryOptions) {\n this.setState({ productDeliveryOptions: newDeliveryOptions });\n }\n\n this.setState({ isUpdatingDimension: false });\n await this._updateQuantitiesInState(variantProduct);\n }\n };\n\n private _getProductURL(product: SimpleProduct | undefined): string {\n if (product) {\n let producturl = ' ';\n producturl = getProductPageUrlSync(\n product.Name || '',\n product.RecordId,\n this.props.context && this.props.context.actionContext,\n undefined\n );\n return producturl;\n }\n return '';\n }\n\n private async _updateQuantitiesInState(product: SimpleProduct): Promise {\n const isOrderQuantityLimitsFeatureEnabled = await this._isOrderQuantityLimitsFeatureEnabled();\n const defaultQuantity = 1;\n if (isOrderQuantityLimitsFeatureEnabled && product) {\n // For some of the products the DefaultQuantity is zero\n this.setState({\n min: product.Behavior?.MinimumQuantity || defaultQuantity,\n\n // If max by feature in default order settings is not defined then use max from site settings or default max 10.\n max:\n product.Behavior?.MaximumQuantity && product.Behavior?.MaximumQuantity > 0\n ? product.Behavior?.MaximumQuantity\n : updateMaxQuantityForCartLineItem(this.props.context.app.config.maxQuantityForCartLineItem)\n });\n } else {\n this.setState({\n min: 1,\n max: updateMaxQuantityForCartLineItem(this.props.context.app.config.maxQuantityForCartLineItem)\n });\n }\n }\n\n private readonly _updateDimensionValue = (\n productDimensionFull: ProductDimensionFull,\n newValueId: string | undefined\n ): ProductDimensionValue | undefined => {\n if (newValueId && productDimensionFull.DimensionValues) {\n return productDimensionFull.DimensionValues.find(dimension => dimension.RecordId === +newValueId);\n }\n\n return undefined;\n };\n\n private readonly _getDropdownName = (dimensionType: number, resources: IQuickviewResources): string => {\n const isGiftCard = this.productDetails?.product?.IsGiftCard;\n\n switch (dimensionType) {\n case 1: // ProductDimensionType.Color\n return resources.productDimensionTypeColor;\n case 2: // ProductDimensionType.Configuration\n return resources.productDimensionTypeConfiguration;\n case 3: // ProductDimensionType.Size\n return resources.productDimensionTypeSize;\n case 4: // ProductDimensionType.Style\n return isGiftCard ? resources.productDimensionTypeAmount : resources.productDimensionTypeStyle;\n default:\n return '';\n }\n };\n\n private async _isOrderQuantityLimitsFeatureEnabled(): Promise {\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context.request.app.platform?.enableDefaultOrderQuantityLimits;\n if (defaultOrderQuantityLimitsFeatureConfig === 'none') {\n return false;\n }\n\n const featureStatuses = await this.props.data.featureState;\n const isFeatureEnabledInHq = featureStatuses.find(featureState => featureState.Name === RetailDefaultOrderQuantityLimitsFeatureName)\n ?.IsEnabled;\n if (!isFeatureEnabledInHq) {\n return false;\n }\n\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\n return true;\n }\n let customerInfo;\n try {\n customerInfo = await this.props.data.customerInformation;\n } catch (error) {\n this.props.telemetry.information(error);\n this.props.telemetry.debug('Unable to receive Customer Information. May be user is not authorized');\n return false;\n }\n\n return (\n customerInfo !== undefined &&\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b))\n );\n }\n\n private readonly onExiting = () => {\n this.setState({ animating: true });\n };\n\n private readonly onExited = () => {\n this.setState({ animating: false });\n };\n\n private readonly next = (): void => {\n if (this.isLastItem() === undefined) {\n return;\n }\n\n const nextIndex = this.isLastItem() ? 0 : this.state.activeIndex! + 1;\n this.goToIndex(nextIndex);\n };\n\n private readonly previous = (): void => {\n const nextIndex = this.isFirstItem()\n ? this.state.mediaGalleryItems\n ? this.state.mediaGalleryItems.length - 1\n : 0\n : this.state.activeIndex! - 1;\n this.goToIndex(nextIndex);\n };\n\n private readonly goToIndex = (index: number): void => {\n this.setState({ activeIndex: index });\n };\n\n private _renderCarouselItemImageView(image: IImageData, imageSettings: IImageSettings, index: number): React.ReactNode {\n return <>{this._getCarouselItem(image, imageSettings, index)};\n }\n\n private readonly _getCarouselItem = (image: IImageData, imageSettings: IImageSettings, index: number): React.ReactNode => (\n \n );\n\n private readonly _getThumbnailItem = (\n image: IImageData,\n imageSettings: IImageSettings,\n index: number,\n modifiedActiveIndex: number\n ): IQuickViewThumbnailItemViewProps => {\n const classes = classnames(\n 'ms-media-gallery__thumbnail-item',\n modifiedActiveIndex === index ? 'ms-media-gallery__thumbnail-item-active' : ''\n );\n\n return {\n ThumbnailItemContainerProps: {\n tag: 'li' as NodeTag,\n className: classes,\n role: 'tab',\n tabIndex: 0,\n key: index,\n 'aria-label': image.altText,\n 'aria-selected': modifiedActiveIndex === index,\n 'aria-controls': `${this.props.id}__carousel-item__${index}`,\n onClick: this._generateOnThumbnailClick(index),\n onKeyDown: this._generateOnThumbnailKeyDown(index)\n },\n Picture: (\n \n )\n };\n };\n\n private readonly _generateOnThumbnailKeyDown = (index: number) => {\n return (event: React.KeyboardEvent) => {\n if (event.which === KeyCodes.Enter || event.which === KeyCodes.Space) {\n event.preventDefault();\n this.goToIndex(index);\n }\n };\n };\n\n private readonly _generateOnThumbnailClick = (index: number) => {\n return (event: React.MouseEvent) => {\n event.preventDefault();\n this.goToIndex(index);\n };\n };\n\n private _mapProductToImageData(product: SimpleProduct): IImageData {\n return {\n src: product.PrimaryImageUrl || '',\n altText: product.Name\n };\n }\n\n private readonly isFirstItem = () => this.state.activeIndex === 0;\n\n private readonly isLastItem = () => this.state.mediaGalleryItems && this.state.activeIndex === this.state.mediaGalleryItems.length - 1;\n\n private readonly onClickHandler = async (event: React.MouseEvent) => {\n return this._onClick(event, this.props);\n };\n\n private readonly _onClick = async (_event: React.MouseEvent, props: IQuickviewExtentedProps) => {\n if (!ObjectExtensions.isNullOrUndefined(props.selectedProductId)) {\n const {\n context: {\n actionContext,\n request: {\n apiSettings: { channelId }\n }\n }\n } = this.props;\n\n if (this.props.selectedProductId) {\n this.setState({ modalOpen: true });\n const productId = this.props.selectedProductId;\n const selectedDimensions = this.props.selectedDimensions;\n this.productDetails = await getProductDetails(productId, channelId, actionContext, selectedDimensions);\n const { product, productPrice } = this.productDetails;\n const currentTime: number = Date.now();\n this._updateMediaItems(currentTime);\n if (productPrice) {\n this._updatePrice(productPrice);\n }\n\n if (product) {\n const { context } = this.props;\n if (context.app.config.maxRecentlyViewedItemsCount > 0) {\n RecentlyViewedState.instance(this.props.context, context.app.config.maxRecentlyViewedItemsCount, product.RecordId);\n }\n // Check if the product is service or not by product type\n if (product.ItemTypeValue === ReleasedProductType.Service) {\n this.setState({ isServiceItem: true });\n }\n await this._updateQuantitiesInState(product);\n const images = await getValidProductImages(\n product.RecordId,\n +this.props.context.request.apiSettings.channelId,\n this.props.context.actionContext,\n this.props.config.thumbnailImageSettings || this.defaultThumbnailImageSettings,\n product.productVariant ?? product\n );\n\n this.setState({\n mediaGalleryItems: [...images],\n activeIndex: 0,\n lastUpdate: currentTime\n });\n // update product delivery options on product on quickview popUp load\n const newDeliveryOptions = await getDeliveryOptionsAsync(\n {\n callerContext: this.props.context.actionContext,\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(\n this.props.context.actionContext\n )\n },\n [this.props.selectedProductId]\n );\n if (newDeliveryOptions && newDeliveryOptions.length > 0) {\n this.setState({ productDeliveryOptions: newDeliveryOptions[0] });\n }\n }\n this.setState({ isDataLoaded: true });\n }\n }\n };\n\n private readonly _quickViewCloseButtonclick = () => {\n this._hideQuickViewDialog();\n };\n\n private _hideQuickViewDialog(): void {\n this.dimensions = [];\n this.setState({\n modalOpen: false,\n quantity: 1,\n min: undefined,\n max: undefined,\n errorState: {\n configureErrors: {}\n },\n selectedProduct: undefined,\n productPrice: undefined,\n productDeliveryOptions: undefined,\n isUpdatingDimension: false,\n productAvailableQuantity: undefined,\n lastUpdate: undefined,\n activeIndex: undefined,\n animating: undefined,\n mediaGalleryItems: [],\n isDataLoaded: false\n });\n }\n\n /**\n * Quantity Change Handler.\n * @param callbacks -Buybox callbacks.\n * @returns Update quantity.\n */\n private readonly onChangeHandler = (callbacks: IBuyboxCallbacks) => (newValue: number): boolean => {\n if (callbacks.updateQuantity) {\n return callbacks.updateQuantity(newValue);\n }\n return true;\n };\n\n private readonly _renderQuantity = (\n props: IQuickviewExtentedProps,\n state: IBuyboxState,\n callbacks: IBuyboxCallbacks\n ): IBuyboxProductQuantityViewProps => {\n const { resources } = props;\n\n const {\n quantity,\n max,\n errorState: { quantityError }\n } = state;\n\n return {\n ContainerProps: {\n className: 'ms-quickView__quantity'\n },\n LabelContainerProps: {\n tag: 'label',\n className: 'ms-quickView__product-quantity-label',\n htmlFor: 'ms-quickView__product-quantity-input'\n },\n heading:
{resources.productQuantityHeading}
,\n errors: quantityError && (\n \n \n ),\n input: (\n \n )\n };\n };\n\n private _renderEmptyImage(imageSettings: IImageSettings | undefined): React.ReactNode {\n return (\n
\n \n
\n );\n }\n}\nexport default Quickview;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { getCartStateData, GetCartStateDataInput } from '@msdyn365-commerce/global-state';\nimport { ProductDimension } from '@msdyn365-commerce/retail-proxy';\nimport {\n getDimensionsForSelectedVariant,\n GetDimensionsForSelectedVariantInput,\n getPriceForSelectedVariant,\n getProductAvailabilitiesForSelectedVariant,\n getRatingsSummary,\n GetRatingsSummaryInput,\n getRnrEndpointId,\n getRnrPartnerId,\n getSelectedVariant,\n PriceForSelectedVariantInput,\n ProductAvailabilitiesForSelectedVariantInput,\n SelectedVariantInput\n} from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IProductDetails } from '../../../common/buyboxInterface';\n\n/**\n * Calls the Retail API and returns the product details.\n * @param productId\n * @param channelId\n * @param ctx\n * @param selectedDimensions - Dimensions previously selected for the product variant.\n */\nexport async function getProductDetails(\n productId: number,\n channelId: number,\n ctx: IActionContext,\n selectedDimensions?: ProductDimension[]\n): Promise {\n const productDetails: IProductDetails = {};\n\n if (productId > 0 && channelId > 0) {\n const tenantId = getRnrPartnerId(ctx);\n const serviceEndPoint = getRnrEndpointId(ctx);\n\n // Get Product Details\n await getSelectedVariant(new SelectedVariantInput(productId, channelId, selectedDimensions, 'get', ctx.requestContext), ctx)\n .then(async productResult => {\n if (productResult) {\n productDetails.product = productResult;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n });\n\n // Get Product Availability\n await getProductAvailabilitiesForSelectedVariant(new ProductAvailabilitiesForSelectedVariantInput(productId, channelId), ctx)\n .then(productAvailabilities => {\n if (productAvailabilities) {\n productDetails.productAvailableQuantity = productAvailabilities;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n });\n\n // Get Product Price\n await getPriceForSelectedVariant(new PriceForSelectedVariantInput(productId, channelId, undefined), ctx)\n .then(productPrice => {\n if (productPrice) {\n productDetails.productPrice = productPrice;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n });\n\n // Get product dimensions\n await getDimensionsForSelectedVariant(\n new GetDimensionsForSelectedVariantInput(productId, channelId, selectedDimensions, ctx.requestContext),\n ctx\n )\n .then(productDimensions => {\n if (productDimensions) {\n productDetails.productDimensions = productDimensions;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n });\n\n // Get Cart State\n await getCartStateData(new GetCartStateDataInput(ctx.requestContext.apiSettings, ctx.requestContext), ctx)\n .then(cartState => {\n productDetails.cart = cartState;\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n });\n\n // Get Product Ratings\n if (tenantId && serviceEndPoint) {\n await getRatingsSummary(new GetRatingsSummaryInput(productId.toString(), tenantId, serviceEndPoint), ctx)\n .then(ratingsSummaryData => {\n if (ratingsSummaryData) {\n productDetails.ratingsSummary = ratingsSummaryData;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n });\n }\n }\n\n return productDetails;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport {\n IBuyboxAddToCartViewProps,\n IBuyboxAddToWishlistViewProps,\n IBuyboxKeyInPriceViewProps,\n IBuyboxProductConfigureDropdownViewProps,\n IBuyboxProductConfigureViewProps,\n IBuyboxProductQuantityViewProps\n} from '../../common';\nimport { IQuickviewViewProps } from './quickview';\n\nconst _renderAddToCart = (addToCart: IBuyboxAddToCartViewProps): JSX.Element => {\n const { ContainerProps, errorBlock, button } = addToCart;\n\n return (\n \n {errorBlock}\n {button}\n \n );\n};\n\nconst _renderAddToWishlist = (addToWishlist: IBuyboxAddToWishlistViewProps): JSX.Element => {\n const { ContainerProps, errorBlock, button } = addToWishlist;\n\n return (\n \n {errorBlock}\n {button}\n \n );\n};\n\nconst _renderConfigureDropdown = (dropdown: IBuyboxProductConfigureDropdownViewProps): JSX.Element => {\n const { ContainerProps, LabelContainerProps, heading, errors, select } = dropdown;\n\n return (\n \n \n {heading}\n {errors}\n \n {select}\n \n );\n};\n\nconst _renderQuickViewPopup = (props: IQuickviewViewProps): JSX.Element => {\n const {\n ModalContainer,\n ModalHeaderContainer,\n ModalFooterContainer,\n ModalHeaderContent,\n ModalBodyContainer,\n addToWishlist,\n addToCart,\n cartContainerProps\n } = props;\n\n return (\n \n {ModalHeaderContent}\n {_renderBodyContent(props)}\n \n \n {addToCart && _renderAddToCart(addToCart)}\n {addToWishlist && _renderAddToWishlist(addToWishlist)}\n \n \n \n );\n};\n\nconst _renderQuantity = (quantity: IBuyboxProductQuantityViewProps, quantityLimitsMessages: React.ReactNode): JSX.Element => {\n const { ContainerProps, LabelContainerProps, heading, input, errors } = quantity;\n\n return (\n \n \n {heading}\n {errors}\n \n {input}\n {quantityLimitsMessages}\n \n );\n};\n\nconst _renderKeyInPrice = (keyInPrice: IBuyboxKeyInPriceViewProps): JSX.Element => {\n const { ContainerProps, LabelContainerProps, heading, input } = keyInPrice;\n\n return (\n \n {heading}\n {input}\n \n );\n};\n\nconst _renderConfigure = (configure: IBuyboxProductConfigureViewProps): JSX.Element => {\n const { ContainerProps, dropdowns } = configure;\n\n return {dropdowns.map(_renderConfigureDropdown)};\n};\n\nconst _renderBodyContent = (props: IQuickviewViewProps): JSX.Element => {\n const {\n title,\n price,\n rating,\n keyInPrice,\n quantity,\n configure,\n inventoryLabel,\n quantityLimitsMessages,\n seeDetailsbutton,\n loading,\n ProductInfoContainerProps,\n MediaGalleryContainerProps,\n CarouselProps,\n unitOfMeasure\n } = props;\n if (loading) {\n return <>{loading};\n }\n return (\n <>\n \n \n \n \n {title}\n {price}\n {unitOfMeasure}\n {rating}\n {configure && _renderConfigure(configure)}\n {keyInPrice && _renderKeyInPrice(keyInPrice)}\n {quantity && _renderQuantity(quantity, quantityLimitsMessages)}\n {seeDetailsbutton}\n {inventoryLabel}\n \n \n );\n};\n\n/**\n * Functional component which renders quick view button and popup based by the given props file.\n * @param {IQuickviewViewProps} props - Configuration for the quick view component.\n * @returns {React.FC} - Functional component of the quick view.\n */\nexport const QuickViewFunctionalComponent: React.FC = (props: IQuickviewViewProps) => {\n const { quickView, quickViewButton, isModalOpen, isMobileDevice } = props;\n return (\n \n {!isMobileDevice && quickViewButton}\n {isModalOpen && _renderQuickViewPopup(props)}\n \n );\n};\n\nexport default QuickViewFunctionalComponent;\n"],"names":["async","request","context","isCached","getATPInventoryStatusInput","GetATPInventoryStatusInput","result","getATPInventoryStatusAction","actionContext","error","console","log","getUtagProductCategory","channelId","_categoryPathResults$","_categoryPath$Segment","catalogId","arguments","length","undefined","RecordId","categoryPathResults","getCategoryPathsAsync","callerContext","queryResultSettings","ProductId","categoryPath","CategoryPath","Segments","CategoryName","getUtagVariantId","MasterProductId","ItemId","input","BuyboxGetDimensionVariantAvailabilityInput","variantsResp","getAllProductVariants","variantIter","ePropsVariant","ExtensionProperties","eIter","_ePropsVariant$eIter$","Key","Value","StringValue","variantofId","slice","MsDyn365","isBrowser","window","innerWidth","gridSettings","xs","w","sm","md","lg","_coreProductATPCall","props","setCoreProductATPData","recordId","itemId","setATPCallMessage","setIsAtpCallReturned","zipcode","Cookies","get","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","_objectSpread","zipCode","_smallParcelProductATPBooleanStatus","canonicalURL","_urlParts","requestUrl","url","origin","path","pathname","toLowerCase","urlParts","split","splice","match","removePipeSignValue","removeKeywords","join","filteredURL","_urlParts2","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","_refinerValue$LeftVal","refinerValueKeyName","LeftValueBoundString","replace","regExSpecialChars","canonicalUrlspecialCharIncludeList","navLinkKeywordRemoval","link","_linkParams$map","_urlParts4","linkBase","linkParams","endsWith","linkParam","param","includeConfigList","includeConfig","_includeConfigList$tr","RegExp","_getProductBadges","productAttributes","_productAttributes$fi","productBadgeAttribute","attribute","badgeData","find","currAttribute","Name","TextValue","badges","parsedBadges","badge","parseBadgeData","finalizedBadges","parsedBadge","buildProductBadge","React","MFITryInStoreExtensionClass","constructor","odataObject","this","Products","Limit","Radius","className","substr","lastIndexOf","concat","EntityClasses","MFITryInStoreInfoResponseExtensionClass","Status","Inventory","createMFIGetTryInStoreInfoInput","tryInStoreProductIDs","storeId","key","DataServiceQuery","DataServiceEntities","tryInStoresQuery","createDataServiceRequestForOperation","bypassCache","returnEntity","GetTryInStoreInfoInput","getCacheKey","getCacheObjectType","dataCacheType","Msdyn365","action","callActionOrExecute","mFIGetTryInStoreInfoAsync","id","getVwoUserId","vwoUserId","getCookie","uuid","setCookie","accountId","sdkKey","vwoClientInstance","setVWOClientInstance","useState","setVwoUserId","useEffect","Error","settingsFile","vwoSDK","clientInstance","campaign","campaigns","activate","initVwo","getAllVariantsForProduct","productResponse","getByIdAsync","Paging","Top","baseProduct","Array","isArray","getVariantsByDimensionValuesAsync","telemetry","exception","createObservableDataAction","inputData","query","products","pageType","priceGroupForAPICall","priceGroup","items","singleItem","DistinctProductVariant","PriceGroup","Items","getEyebrowMessageInput","GetEyebrowMessageInput","getEyebrowAction","getGenericError","cart","resources","productAvailability","location","failureReason","addedToCartFailureMessage","cartActionResult","substatus","_resources$maxQuantit","elementFoundAt","productIdToFind","CartLines","_context$actionContex","DeliveryMode","channel","PickupDeliveryModeCode","FulfillmentStoreId","OrgUnitNumber","curQuantity","maxQuantityForCartLineItem","availableQty","AvailableQuantity","quantityLimit","Math","min","maxQuantityLimitText","_result$cartActionRes","errorDetails","LocalizedMessage","getConfigureErrors","isGiftCard","dimensions","dimension","DimensionTypeValue","dimensionTypeValue","productDimensionTypeColorErrorMessage","productDimensionTypeConfigurationErrorMessage","productDimensionTypeSizeErrorMessage","productDimensionTypeAmountErrorMessage","productDimensionTypeStyleErrorMessage","getDimensionErrorString","getBuyBoxInventoryLabel","productDetails","_props$data$productAv","_props$data$productAv2","typeName","productAvailableQuantity","_getClassNamePrefix","StockLevelLabel","inventoryClassName","StockLevelCode","getBuyboxProductTitle","brandName","_props$data$product","titleHeadingTag","title","Heading","headingTag","text","telemetryContent","getBuyboxAddToCart","state","callbacks","defaultMinimumKeyInPrice","defaultMaximumKeyInPrice","_props$data","_props$data2","_props$data3","_props$data$productAv3","_props$data$deliveryO","_props$context$action","_props$data$deliveryO2","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","defaultImageSettings","viewports","q","h","xl","lazyload","isLoading","status","changeUpdatingDimension","isLoadingDeliveryOptions","deliveryOptions","changeUpdatingDeliveryOptions","getTelemetryObject","telemetryPageName","emailDeliveryModeCode","EmailDeliveryModeCode","isEmailDelivery","ArrayExtensions","hasElements","DeliveryOptions","Code","ContainerProps","button","AddToCartComponent","addToCartText","outOfStockText","navigationUrl","getUrlSync","price","productPrice","onError","quantityErrorForState","customAmountErrorForState","otherErrorForState","stockLeft","errorMessageOutOfStock","errorMessageOutOfRangeOneLeft","_resources$errorMessa","errorMessageOutOfRangeFormat","getQuantityError","_props$context$cultur","_resources$invalidSma","formatedAmountLimit","cultureFormatter","formatCurrency","invalidSmallCustomAmountText","_props$context$cultur2","_resources$invalidLar","invalidLargeCustomAmountText","updateErrorState","missingDimensions","IsGiftCard","getSelectedProduct","imageSettings","isAddServiceItemToCart","isPriceKeyedIn","customPriceAmount","isCustomPriceSelected","isOrderQuantityLimitsFeatureEnabled","_isOrderQuantityLimitsFeatureEnabled","isAddEmailDeliveryItemToCart","onAdd","changeModalOpen","isNavigationToCartPageDisabled","errorBlock","BuyboxErrorBlock","showError","getBuyboxProductPrice","PriceComponent","getBuyboxKeyInPrice","LabelContainerProps","tag","htmlFor","heading","buyboxKeyInPriceLabelHeading","type","onChange","value","currentTarget","updateKeyInPrice","Number","parseFloat","max","_ref","errorMessages","Object","values","message","Alert","isOpen","color","assertive","buyboxErrorMessageHeader","getQuantityLimitsMessages","Node","_renderMaxLabel","maxQuantityText","_renderMinLabel","minQuantityText","MAX_VALUE","_props$context","defaultOrderQuantityLimitsFeatureConfig","platform","enableDefaultOrderQuantityLimits","customerInfo","customerInformation","IsB2b","getBuyboxFindInStore","_data$product","_data$productPrice","_data$storeSelectorSt","_data$cart","_data$deliveryOptions","_props$data$productPr","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","goToCart","assign","showModal","showNotification","_props$data$productPr2","friendlyName","notification","ItemSuccessfullyAddedToCartNotification","NotificationsManager","instance","addNotification","debug","findInStoreOnClick","option","priceComponent","popupProps","productQuantity","setModalOpen","renderModalPopup","Popup","openFindInStoreDialog","description","productPickupOptionList","errors","disabled","modal","updateViewPort","viewport","_getViewPort","BuyboxShopSimilarItems","BuyboxKeyInPrice","BuyboxCustomerSatisfactionScore","_popoverText$replace","unitsReturned","unitsSold","headingText","popoverText","tooltipHover","percentNotReturned","round","unitsNotReturend","avgRating","Tooltip","trigger","Info","height","width","position","hover","toLocaleString","Rating","name","defaultValue","readOnly","precision","getProductSpecNumber","productSpecificationData","rawValue","_productSpecification","_e$Name","getProductSpecText","NaN","displayName","ref","useRef","handleClick","event","current","contains","target","onClickOutside","document","addEventListener","removeEventListener","BuyboxStoreHours","_location$ExtensionPr","_location$ExtensionPr2","_location$ExtensionPr3","_location$ExtensionPr4","_location$ExtensionPr5","storeHoursClosedText","storeCloseAtHours","storeOpenAtHours","isClosedToday","x","BooleanValue","isClosed","startTime","IntegerValue","endTime","timeZone","timeZoneAbbr","getTimeZoneAbbr","secondsToTime","BuyboxStoreDetails","isSociEnabled","sociPrefferedStore","storeAddressLine1","storeAddressLine2","phoneNumber","preferredStore","sociStoreLocatorUrl","storeLocatorUrl","onClickNameOrDetails","viewStoreDetailsText","onClickChangeStore","changeStoreText","city","postalcode","href","role","Open","children","BuyboxTryInStoreRedesign","_Object$keys","_Object$keys2","_preferredStore$Exten","isOnlineOnly","availableInStoresTextV2","notAvailableInStoresTextV2","canTryInStores","tryInStoresResults","isStoreDetailsOpen","useClickOutside","sociStoreName","storeName","OrgUnitName","storeNameWithState","State","storeLocatorContext","Contacts","ContactTypeValue","tabIndex","address1","Street","address2","City","Zip","phone","extractPhoneNumber","website_url","Locator","Address","_scrollToBVHosted","_document","_ratingSection$getEle","ratingSection","getElementById","getElementsByTagName","getAttribute","scrollIntoView","BuyboxProductRating","hideRating","isBazaarVoice","variantId","productSpecification","BVRatingSummary","averageRating","getBVAttributeValues","reviewsCount","RatingComponent","ariaLabel","averageRatingAriaLabel","ratingCount","getProductURLForUtag","productUrl","getProductPageUrlSync","getProductSizeForUTag","_product$Dimensions","Buybox","_this$props$data$prod3","_this$props$data$prod4","_this$props$data$prod5","super","updateSuccessfulATC","setState","successfulATC","timer","setTimeout","dimensionUpdateQueue","FinitePromiseQueue","buyboxCallbacks","updateQuantity","newQuantity","fireAnalyticsLink","eventName","eventCategory","eventAction","eventLabel","eventNoninteraction","generalConfig","enhanced_action","newErrorState","dimensionSelectedAsync","selectedDimensionId","selectedDimensionValueId","enqueue","_updateDimensions","reason","FinitePromiseQueueError","ProcessWasDiscardedFromTheQueue","getDropdownName","dimensionType","_getDropdownName","isModalOpen","customPrice","_updatePrice","_updateQueryParamVariantId","_window$history","_urlWithIgnoredCase$t","currUrl","urlWithIgnoredCase","URL","toLocaleLowerCase","searchParams","has","variantQueryStringName","set","history","replaceState","host","_setRecentlyViewProducts","masterProductId","cookies","setDate","getDate","expiry","inserted","recentlyViewedProductsStored","recentlyViewedProducts","_recentlyViewedProduc","_recentlyViewedProduc2","_recentlyViewedProduc3","_ref2","_ref3","_setSmallParcelATPCallMade","atpCallMade","smallParcelATCallMade","_setStatusATPCall","StatusATPCall","_setZipCode","_setATPCall","ATPCall","_updateDimensionValue","productDimensionFull","newValueId","DimensionValues","_this$props$data$prod","productDimensionTypeColor","productDimensionTypeConfiguration","productDimensionTypeSize","productDimensionTypeAmount","productDimensionTypeStyle","_getPreferredStore","localStorage","localStoragePreferredStore","getItem","JSON","parse","_getSociPreferredStore","_getProductSpecificationAttributeByKeyName","attrName","_this$props$data$prod2","attr","_attr$Name","_getProductType","shippingInformation","_updateUtagDataOnInitialLoad","_await$this$props$dat","_product$Dimensions2","productprice","allCategoriesArr","categoryPaths","categoryObj","categoryName","brandBackofficeAttributePdp","productBrandName","productSize","listPageStateBuyBox","_getVariantIDOnLoad","CustomerContextualPrice","BasePrice","productImageUrl","PrimaryImageUrl","_this$props$data$allP","allProductVariants","_getProductAttributeUpdated","shippingInformationSmall","_attr$Name2","smallParcelAttributeKey","_updateAvailbilityForVariantsUpdated","variantsResult","availableVariantIDs","eComAllVariantsOOSMultiAttr","ecomAllVairantStockInfoKey","ecomAllVairantStockInfoKey1","ecomAllVairantStockInfoKey2","ecomAllVairantStockInfoKey3","getAttributeValuesAsync","ecomAllVairantStockInfoConcatenated","_productSpecification3","_productSpecification4","_productSpecification5","ecomVairantStockInfoKey1","ecomVairantStockInfoKey2","ecomVairantStockInfoKey3","ecomAllVairantStockInfo1","_attr$Name4","ecomAllVairantStockInfo2","_attr$Name5","ecomAllVairantStockInfo3","_attr$Name6","_this$telemetryConten2","_this$telemetryConten3","_this$telemetryConten4","_productSpecification2","eComJsonData","_attr$Name3","newAllVariantStockInfo","VariantList","VariantRecID","OutOfStock","_this$telemetryConten","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","_productSpecification6","tealiumRecordIdFor","_await$productPrice","event_category","event_action","event_label","event_noninteraction","product_id","product_name","product_category","product_brand","variantIdForTracking","_eyeBrowMessageAsyncFunc","_result$RecordId","productIdsArray","eyebrowMessageObj","eyebrowMessageResult","_getEyebrowMessage","eyebrowMessageResultState","isEyeBrowLoading","getDeliverySlotFromATP","deliveryMessageATPResultState","_tryInStoreAsyncCall","_preferredStore$Zip","_ref4","_product$ItemId","enableSociLocations","sociPreferredStore","zipCodeModified","projectMetaSoci","project_meta","sociStore","sociStoreID","_product$ItemId2","tryInStoreLimit","tryInStoreLookupRadius","getTryInStoreInfoInput","response","getTryInStoreAction","isStoreLoading","_selectedProduct$","prevProduct","productDimensions","dimensionsArr","dimensionsToUpdate","clearErrorState","nextProductDimensions","mappedDimensions","_ref5","_this$_updateDimensio","_product$Dimensions3","_ref6","_this$_updateDimensio2","_product$Dimensions4","obj","dim","variants","queryBasedVariantSelection","variantProduct","newAvailableQuantity","getProductAvailabilitiesForSelectedVariant","ProductAvailabilitiesForSelectedVariantInput","newPrice","getPriceForSelectedVariant","PriceForSelectedVariantInput","newDeliveryOptions","getDeliveryOptionsForSelectedVariant","GetDeliveryOptionsForSelectedVariantInput","productDeliveryOptions","currentProduct","currentProductDimensions","_updateQuantitiesInState","makeCoreProductDeliveryMessage","_updateVariantIDForTracking","_updateURLWithoutReloading","findPreferredStore","mfrmStoreSelector","body","classList","add","showMapViewLink","extensionProps","deliveryMessage","inventoryStatusATPResultState","variantAvailibilityUpdating","showViewCartLink","bind","_setAllProductVariantsResult","_this$props$data$prod6","_this$props$data$prod7","_this$props$data$prod8","PRODUCTASSERVICE","ItemTypeValue","newCartTotalItems","totalItemsInCart","getZipCode","prevProps","prevState","_prevState$selectedPr","_this$props$data$prod9","_this$props$data$prod10","_this$props$data$prod13","selProd","_this$state$selectedP","currSelProd","_this$props","_this$props2","_this$props$data$prod11","_this$props$data$prod12","element","isInStock","_this$props$data$prod14","clearTimeout","extendAllProductVariants","prices","extendedAllProductVariants","_variant$Dimensions","extendedObj","_dimension$DimensionV","productSizeName","dimensionPrice","priceAfterDiscount","discount","_productSpecification7","smallParcelVariantsListObj","_attr$Name7","inStockLowestPriceVariant","isProductFound","variantObj","smallParcelProduct","str","_productSpecification8","_productSpecification9","outOfStock","_attr$Name8","_this$props$context$a","outOfStockProductKey","_attr$Name9","_this$state$batchedAt","_this$state$batchedAt2","_inventoryStatusData$","inventoryStatusData","selectedObj","_item$VariantRecordId","_this$state$currentPr","_ePropsVariant$eIter$2","queryParamValue","masterId","_window$history2","_urlWithIgnoredCase$t2","_product$RecordId","_product$RecordId2","pushState","search","queryParams","_this$props$data","updatedProductSpecificationData","_this$state$variantAv","dimensionPrices","prodSpecficationData","Price","getNextInventoryProduct","dimensionValues","getDimensionValuesAsync","fullDimension","_this$props$context","_product$Behavior","_product$Behavior2","_product$Behavior3","_product$Behavior4","_product$Behavior5","Behavior","DefaultQuantity","MinimumQuantity","MaximumQuantity","render","_this$props$data$prod15","_props$context$app$co","_props$data$product$r","_props$data$product$r2","_this$props$context$a2","_this$state","mediaGallery","selectedFoundation","adjustableItem","completeYourBedPillow","pillow","completeYourBedProtector","protector","parseBrandName","viewProps","ModuleProps","moduleProps","classnames","ProductInfoContainerProps","MediaGalleryContainerProps","getBuyboxProductDescription","findInStore","addToCart","viewCartLink","inventoryLabel","shopSimilarLook","enableShopSimilarLooks","getBuyboxShopSimilarButton","ShopSimiliarButtonType","Looks","keyInPrice","enableKeyInPrice","quantityLimitsMessages","setSmallParcelATPCallMade","setStatusATPCall","setZipCode","setATPCall","productBadges","ratingComponent","showBVRatings","tryInStoreComponent","onlineOnlyBackOfficeAttribute","promotionalMessage","EyeBrows","Description","ATPDataFromBusiness","updateDimension","getProductType","setAllProductVariantsResult","customerSatisfactionScore","cSatRatingHeadingText","cSatRatingPopoverText","isDesktop","renderView","Component","setIsDesktop","resizeThrottledEventHandler","addThrottledEvent","useIsDesktop","seconds","hours","floor","ampm","divisorForMinutes","StoreSelectorLocationLineItemComponentActions","handlers","onSelected","onSetAsPreferredStore","onRemovePreferredStore","contacts","allPhoneContacts","contact","IsPrivate","primaryPhoneContact","IsPrimary","StoreSelectorLocationLineItemComponent","_location$ExtensionPr6","_resources$selectLoca","hideStockStatus","isCurrentLocation","stockStatusLabel","storeLocatorView","preferredStoreLocationId","isPreferredStoreEnabled","isLocationDisabled","distanceAsString","buildDistanceString","distance","preferredDistanceUnit","Distance","storeAddress","resourceLabel","inStock","stockLabel","stockText","canSelectLocation","pickupInStoreButtonText","selectLocation","pickupInStoreAriaLabel","selectLocationAriaLabelFormat","isPreferredStore","payLoad","getPayloadObject","TelemetryConstant","PickupInStore","attributes","getTelemetryAttributes","contentAction","etext","PreferredStore","preferredStoreAttr","RemovePreferredStore","RemovePreferredStoreAttr","storeHoursHeader","renderStoreHours","closedText","contactInfoHeader","availabilityInfoHeader","currentLocation","preferredStoreAriaLabel","removePreferredStore","preferredStoreText","setAsPreferredStoreTextAriaLabel","setAsPreferredStore","setAsPreferredStoreText","_storeDetailsTracking","pageURL","viewStoreDetails","AddToCartComponentActions","_event","setDisabled","openModal","setSuccess","_props$productAvailab","_props$adjustableItem2","_props$adjustableItem3","_props$adjustableItem4","_props$pillow2","_props$pillow3","_props$protector2","_props$protector3","cartError","addToCartError","productToAdd","productBrand","productCategory","productCategoryName","_productToAdd","_productToAdd2","_productToAdd3","_productToAdd4","_productToAdd5","_props$adjustableItem","_props$pillow","_props$protector","product_quantity","foundation","listPosition","Dimension","utag_obj","product_list_name","product_list_position","brand","_dimension$DimensionV2","_dimension$DimensionV3","propagateError","_productToAdd6","productsToAdd","availableQuantity","additionalProperties","orderQuantityLimitsFeatureIsEnabled","enableStockCheck","cartState","getCartState","clearCartLinesDeliveryInformation","productPriceHandler","addProductsToCart","propagateResult","getCartProductPriceArray","getSetCartProductPrice","priceDetails","variantRecordId","AdjustedPrice","AddToCart","_props$dialogStrings","_props$dialogStrings2","_props$dialogStrings3","_props$context$reques","_props$mfrmContinueSh","vwoAccountId","vwoSdkKey","useVwoClientInstance","label","getLinkText","payload","TelemetryEvent","OOMClass","itemOutOfMarket","variantOutOfStock","mfrmOutOfStockSmallParcell","allVariantOOS","disabledSmallParcel","isIntermediateState","shouldShowOutOfStock","mfrmAddToCartDisableByState","campaignKey","userId","track","mfrmOutOfStockCustomText","mfrmContinueShoppingLink","Url","mfrmContinueShoppingText","defaultProps","_props$pillow4","_props$protector4","_props$addToCartProdu","_productToAdd7","err","getCount","addToCartProductsText","_dimension$DimensionV4","includeCurrentQuantity","_props$data$product$D","includedQuantityNumber","_props$data$product2","_props$data$product$D2","msdyn365Commerce","createComponentOverride","component","getValidProductImages","getCatalogId","actionInput","MediaLocationsForSelectedVariantInput","getMediaLocationsForSelectedVariant","mediaLocations","all","mediaLocation","imageData","src","Uri","altText","AltText","http","XMLHttpRequest","open","send","_unused","validateMediaLocaionAsync","pairs","pair","Quickview","quickViewCallbacks","updateSelectedProduct","newSelectedProduct","newInventory","_hideQuickViewDialog","defaultGalleryImageSettings","cropFocalRegion","defaultThumbnailImageSettings","_renderSeeDetailButton","seeDetails","Button","onTelemetryClick","seeDetailsLinkText","_getProductURL","_renderCarousel","_this$state$activeInd","mediaGalleryItems","galleryImageSettings","_renderCarouselItemImageView","_renderEmptyImage","Carousel","activeIndex","next","previous","interval","directionTextPrev","previousScreenshotFlipperText","directionTextNext","nextScreenshotFlipperText","indicatorAriaText","ariaLabelForSlide","onIndicatorsClickHandler","goToIndex","handleOnExited","onExited","handleOnExiting","onExiting","_renderThumbnails","thumbnailImageSettings","_getThumbnailItem","ThumbnailsContainerProps","SingleSlideCarouselComponentProps","SingleSlideCarousel","flipperPrevLabel","flipperNextLabel","parentId","useTabList","stringify","newProduct","getSelectedVariant","SelectedVariantInput","getDimensionsForSelectedVariant","GetDimensionsForSelectedVariantInput","_variantProduct$produ","_variantProduct$Dimen","_this$props$data$feat","images","productVariant","lastUpdate","RetailMulitplePickupMFeatureState","featureState","IsEnabled","_this$productDetails","animating","isLastItem","nextIndex","isFirstItem","_getCarouselItem","image","Image","loadFailureBehavior","modifiedActiveIndex","ThumbnailItemContainerProps","_generateOnThumbnailClick","onKeyDown","_generateOnThumbnailKeyDown","Picture","which","KeyCodes","Enter","Space","preventDefault","onClickHandler","_onClick","ObjectExtensions","isNullOrUndefined","selectedProductId","selectedDimensions","tenantId","getRnrPartnerId","serviceEndPoint","getRnrEndpointId","productResult","productAvailabilities","getCartStateData","GetCartStateDataInput","getRatingsSummary","GetRatingsSummaryInput","ratingsSummaryData","ratingsSummary","getProductDetails","currentTime","_updateMediaItems","_product$productVaria","maxRecentlyViewedItemsCount","RecentlyViewedState","ReleasedProductType","Service","getDeliveryOptionsAsync","QueryResultSettingsProxy","getPagingFromInputDataOrDefaultValue","isDataLoaded","_quickViewCloseButtonclick","onChangeHandler","newValue","_renderQuantity","productQuantityHeading","IncrementalQuantity","currentCount","inputQuantityAriaLabel","decrementButtonAriaLabel","incrementButtonAriaLabel","shouldComponentUpdate","nextProps","nextState","_this$productDetails2","_this$productDetails3","isMobileDevice","isMobile","VariantType","Viewport","viewprops","quickView","quickViewButton","quickViewbuttonText","ModalContainer","Modal","quickViewAriaLabel","toggle","modalTransition","timeout","shouldUpdateFocusToFirstElement","ModalHeaderContainer","ModalHeader","ModalFooterContainer","ModalFooter","ModalHeaderContent","ModalBodyContainer","ModalBody","cartContainerProps","seeDetailsbutton","loading","Spinner","loadingText","size","SpinnerSize","large","configure","getBuyboxProductConfigure","unitOfMeasure","getBuyboxProductUnitOfMeasure","rating","getBuyboxProductRating","addToWishlist","getBuyboxProductAddToWishlist","CarouselProps","Thumbnails","lastUpdatedTime","_this$productDetails4","_mapProductToImageData","producturl","updateMaxQuantityForCartLineItem","_this$props$context$r","_featureStatuses$find","RetailDefaultOrderQuantityLimitsFeatureName","information","_renderConfigureDropdown","dropdown","select","_renderQuickViewPopup","Module","_renderBodyContent","_renderAddToCart","_renderAddToWishlist","dropdowns","_renderConfigure","_renderKeyInPrice","QuickViewFunctionalComponent"],"sourceRoot":""}