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XlM,OAAO6wB,aAAalB,YAAWxrB,EAAAA,EAAA,GAC5BnE,OAAO6wB,aAAalB,aAAe,IACnCD,EAAQC,aAEY,MAAMmB,EAAiB,GAC9BA,EAAe,2DAA6D,CACpF9S,EAAGA,IAAMkS,EAAQ,MACjBa,GAAI,qCAEpB/wB,OAAO6wB,aAAe7wB,OAAO6wB,cAAgB,GAC7C7wB,OAAO6wB,aAAaC,eAAc3sB,EAAAA,EAAA,GACPnE,OAAO6wB,aAAaC,gBAAkB,IACtCA,UCnM3BE,EAAOC,QAAUvwB,cCAjBswB,EAAOC,QAAUC","sources":["webpack://henrys-ecommerce/./src/actions/get-attributes-for-selected-variant.action.ts?8d1d","webpack://henrys-ecommerce/./src/actions/get-media-locations-for-selected-variant.action.ts?5dc9","webpack://henrys-ecommerce/./src/common/getProductVariantUrl.ts?9182","webpack://henrys-ecommerce/./src/common/utilities/makeAbsUrl.ts?817a","webpack://henrys-ecommerce/./src/modules/hei-buybox-v2/components/swatch.tsx?18a8","webpack://henrys-ecommerce/./src/modules/hei-buybox-v2/components/dropdown.tsx?eddd","webpack://henrys-ecommerce/./src/modules/hei-buybox-v2/components/buybox-product-configure.tsx?faa3","webpack://henrys-ecommerce/./src/modules/hei-buybox-v2/components/hei-buybox-v2-find-in-store.tsx?a24b","webpack://henrys-ecommerce/./src/modules/hei-buybox-v2/components/price.tsx?cc00","webpack://henrys-ecommerce/./src/modules/hei-buybox-v2/components/getBuyboxProductPrice.tsx?12e4","webpack://henrys-ecommerce/./src/modules/hei-buybox-v2/hei-buybox-v2.tsx?0132","webpack://henrys-ecommerce/./src/modules/hei-buybox-v2/components/AuthorizedDealerBadge.tsx?ec73","webpack://henrys-ecommerce/./src/modules/hei-buybox-v2/components/ProductCode.tsx?d059","webpack://henrys-ecommerce/./src/modules/hei-buybox-v2/components/ProductBadge.tsx?099f","webpack://henrys-ecommerce/./src/modules/hei-buybox-v2/components/Promotions.tsx?191f","webpack://henrys-ecommerce/./src/modules/hei-buybox-v2/components/WarrantySection.tsx?e651","webpack://henrys-ecommerce/./src/modules/hei-buybox-v2/components/ShopUsed.tsx?cc12","webpack://henrys-ecommerce/./src/modules/hei-buybox-v2/components/FloatingSummary.tsx?4e19","webpack://henrys-ecommerce/./src/modules/hei-buybox-v2/hei-buybox-v2.view.tsx?581a","webpack://henrys-ecommerce/./lib/hei-buybox-v2/module-registration.js?b8d2","webpack://henrys-ecommerce/external var \"React\"?0d3b","webpack://henrys-ecommerce/external var \"ReactDOM\"?853b"],"sourcesContent":["// base on @msdyn365-commerce-modules/retail-actions/get-attributes-for-selected-variant\r\n\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n getCatalogId,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport { AttributeValue, ProductsDataActions, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport {\r\n getSelectedProductIdFromActionInput,\r\n SelectedVariantInput,\r\n getSelectedVariantActionDataAction\r\n // QueryResultSettingsProxy\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\n\r\n/**\r\n * Chains getting the SelectedVariant with GetActivePrice.\r\n */\r\nexport class AttributesForSelectedVariantInput implements IActionInput {\r\n public productId: number;\r\n\r\n public channelId: number;\r\n\r\n public catalogId: number;\r\n\r\n public selectedProduct: SimpleProduct | undefined;\r\n\r\n constructor(productId: number, channelId: number, selectedProduct?: SimpleProduct, catalogId?: number) {\r\n this.productId = productId;\r\n this.channelId = channelId;\r\n this.selectedProduct = selectedProduct;\r\n this.catalogId = catalogId || 0;\r\n }\r\n\r\n public getCacheKey = () => 'AttributesForSelectedVariant';\r\n\r\n public getCacheObjectType = () => 'ProductAttributeValue';\r\n\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\nexport const createAttributesForSelectedVariantInput = (\r\n inputData: ICreateActionContext>\r\n): AttributesForSelectedVariantInput => {\r\n const productId = getSelectedProductIdFromActionInput(inputData);\r\n const catalogId = getCatalogId(inputData.requestContext);\r\n\r\n if (productId) {\r\n return new AttributesForSelectedVariantInput(+productId, +inputData.requestContext.apiSettings.channelId, undefined, catalogId);\r\n }\r\n throw new Error('Unable to create PriceForSelectedVariantInput, no productId found on module config or query');\r\n};\r\n\r\n/**\r\n * Calls the Retail API a get a list of dimension values for a given product.\r\n * @param input\r\n * @param ctx\r\n */\r\nexport async function getAttributesForSelectedVariantAction(\r\n input: AttributesForSelectedVariantInput,\r\n ctx: IActionContext\r\n): Promise {\r\n return Promise.resolve()\r\n .then(() => {\r\n const activeProduct: SimpleProduct | undefined = input.selectedProduct;\r\n\r\n if (!activeProduct) {\r\n const selectedVariantInput = new SelectedVariantInput(\r\n input.productId,\r\n input.channelId,\r\n undefined,\r\n undefined,\r\n ctx.requestContext\r\n );\r\n\r\n return getSelectedVariantActionDataAction(selectedVariantInput, ctx);\r\n }\r\n\r\n return activeProduct;\r\n })\r\n .then((productResult: SimpleProduct | null) => {\r\n const activeProduct: SimpleProduct | undefined = productResult;\r\n\r\n if (activeProduct) {\r\n return ProductsDataActions.getAttributeValuesAsync(\r\n {\r\n callerContext: ctx\r\n // queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(ctx)\r\n },\r\n activeProduct.RecordId,\r\n input.channelId,\r\n input.catalogId\r\n );\r\n }\r\n\r\n return null;\r\n })\r\n .then((attributeValues: AttributeValue[] | null) => {\r\n const resultArray = attributeValues;\r\n if (resultArray) {\r\n return resultArray;\r\n }\r\n\r\n return [];\r\n })\r\n .catch((error: Error) => {\r\n ctx.trace(error.message);\r\n ctx.telemetry.exception(error);\r\n ctx.telemetry.debug('[getPriceForSelectedVariantAction]Error executing action');\r\n throw new Error('[getPriceForSelectedVariantAction]Error executing action');\r\n });\r\n}\r\n\r\nexport const getAttributesForSelectedVariantActionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/get-attributes-for-selected-variant',\r\n action: >getAttributesForSelectedVariantAction,\r\n input: createAttributesForSelectedVariantInput\r\n});\r\n\r\nexport default getAttributesForSelectedVariantActionDataAction;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n getCatalogId,\r\n getMediaLocationsForProductAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric,\r\n MediaLocationsInput\r\n} from '@msdyn365-commerce/core';\r\nimport { AsyncResult, MediaLocation, ProductsDataActions, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport { getMediaLocationsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport {\r\n QueryResultSettingsProxy,\r\n generateImageUrl,\r\n getSelectedProductIdFromActionInput,\r\n getSelectedVariant,\r\n SelectedVariantInput,\r\n IDimensionForSelectedVariant,\r\n ArrayExtensions\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport getAllDimensionsForProductActionDataAction, { GetAllDimensionsForProductInput } from './get-all-dimensions-for-product';\r\n\r\n/**\r\n * The action input class for the getMediaLocationsForSelectedVariant data action.\r\n */\r\nexport class MediaLocationsForSelectedVariantInput implements IActionInput {\r\n public productId: number;\r\n\r\n public channelId: number;\r\n\r\n public catalogId: number;\r\n\r\n public selectedProduct: SimpleProduct | undefined;\r\n\r\n constructor(productId: number, channelId: number, selectedProduct?: SimpleProduct, catalogId?: number) {\r\n this.productId = productId;\r\n this.channelId = channelId;\r\n this.catalogId = catalogId || 0;\r\n this.selectedProduct = selectedProduct;\r\n }\r\n\r\n public getCacheKey = () => 'MediaLocationsForSelectedVariant';\r\n\r\n public getCacheObjectType = () => 'MediaLocations';\r\n\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\n/**\r\n * The createInput method for the getMediaLocationsForSelectedVariant data action.\r\n * @param inputData The input data passed to the createInput method.\r\n */\r\nexport const createMediaLocationsForSelectedVariantInput = (\r\n inputData: ICreateActionContext>\r\n): MediaLocationsForSelectedVariantInput => {\r\n const productId = getSelectedProductIdFromActionInput(inputData);\r\n const catalogId = getCatalogId(inputData.requestContext);\r\n\r\n if (productId) {\r\n return new MediaLocationsForSelectedVariantInput(+productId, +inputData.requestContext.apiSettings.channelId, undefined, catalogId);\r\n }\r\n throw new Error('Unable to create MediaLocationsForSelectedVariantInput, no productId found on module config or query');\r\n};\r\n\r\n/**\r\n * The action method for the getMediaLocationsForSelectedVariant data action.\r\n * @param input\r\n * @param ctx\r\n */\r\nexport async function getMediaLocationsForSelectedVariantAction(\r\n input: MediaLocationsForSelectedVariantInput,\r\n ctx: IActionContext\r\n): Promise {\r\n return AsyncResult.resolve()\r\n .then(() => {\r\n const activeProduct: SimpleProduct | undefined = input.selectedProduct;\r\n\r\n if (!activeProduct) {\r\n const selectedVariantInput = new SelectedVariantInput(\r\n input.productId,\r\n input.channelId,\r\n undefined,\r\n undefined,\r\n ctx.requestContext\r\n );\r\n return getSelectedVariant(selectedVariantInput, ctx);\r\n }\r\n\r\n return activeProduct;\r\n })\r\n .then(productResult => {\r\n const activeProduct = productResult;\r\n\r\n const newProductRecId = activeProduct?.ExtensionProperties?.find(ep => ep.Key === 'NewSku')?.Value?.StringValue?.split(':')[0];\r\n if (activeProduct && newProductRecId && +newProductRecId) {\r\n process.env.NODE_ENV === 'development' && console.log('get-media-locations-for-selected-variant', newProductRecId);\r\n const getAllDimensionsForProductInput = new GetAllDimensionsForProductInput(+newProductRecId, input.channelId);\r\n return getAllDimensionsForProductActionDataAction(getAllDimensionsForProductInput, ctx).then(\r\n (dimensions: IDimensionForSelectedVariant[]) => {\r\n const validProducts: Record> = {};\r\n\r\n dimensions.forEach(d => {\r\n d.dimensionValuesWithInventory?.forEach(inv => {\r\n inv.ProductIds?.forEach(variantId => {\r\n const variantDims = validProducts[variantId] ?? (validProducts[variantId] = {});\r\n variantDims[d.DimensionTypeValue] = inv.DimensionValue?.Value ?? '';\r\n });\r\n });\r\n });\r\n\r\n var variantId = ArrayExtensions.firstOrDefault(\r\n Object.keys(validProducts)\r\n .filter(variantId => Object.keys(validProducts[variantId]).length === dimensions.length)\r\n .filter(variantId => {\r\n const mismatched = activeProduct.Dimensions?.filter(d => d.DimensionTypeValue !== 4).find(\r\n d =>\r\n (d.DimensionValue?.Value?.toLowerCase() ?? '') !==\r\n (validProducts[variantId][d.DimensionTypeValue] ?? '').toLowerCase()\r\n );\r\n\r\n return !mismatched;\r\n })\r\n );\r\n\r\n // process.env.NODE_ENV === 'development' &&\r\n // console.log('get-media-locations-for-selected-variant', variantId, activeProduct.Dimensions, validProducts);\r\n if (variantId && +variantId) {\r\n return ProductsDataActions.getByIdAsync({ callerContext: ctx }, +variantId, input.channelId).then(product => {\r\n // process.env.NODE_ENV === 'development' &&\r\n // console.log('get-media-locations-for-selected-variant', JSON.parse(JSON.stringify(product)));\r\n return product;\r\n });\r\n }\r\n\r\n return activeProduct;\r\n }\r\n );\r\n }\r\n\r\n return activeProduct;\r\n })\r\n .then(productResult => {\r\n const activeProduct = productResult;\r\n\r\n if (activeProduct) {\r\n if (ctx.requestContext.app?.config?.OmniChannelMedia) {\r\n const mediaLocationsInput = new MediaLocationsInput(\r\n ctx.requestContext,\r\n activeProduct.RecordId,\r\n input.channelId,\r\n input.catalogId\r\n );\r\n return getMediaLocationsForProductAction(mediaLocationsInput, ctx);\r\n }\r\n return getMediaLocationsAsync(\r\n { callerContext: ctx, queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(ctx) },\r\n activeProduct.RecordId,\r\n input.channelId,\r\n input.catalogId\r\n ).then(response => {\r\n return response.map(\r\n (mediaLocation: MediaLocation): MediaLocation => {\r\n mediaLocation.Uri = generateImageUrl(mediaLocation.Uri, ctx.requestContext.apiSettings);\r\n mediaLocation.AltText = mediaLocation.AltText ? mediaLocation.AltText : activeProduct.Name;\r\n return mediaLocation;\r\n }\r\n );\r\n });\r\n }\r\n\r\n return [];\r\n })\r\n .catch(error => {\r\n ctx.trace(error);\r\n ctx.telemetry.error(error.message);\r\n ctx.telemetry.debug('[getMediaLocationsForSelectedVariantAction]Error executing action');\r\n throw new Error('[getMediaLocationsForSelectedVariantAction]Error executing action');\r\n });\r\n}\r\n\r\n/**\r\n * The getMediaLocationsForSelectedVariant data action\r\n * Gets the currently selected variant for the page via the getSelectedVariant data action,\r\n * and then gets the media location information for the variant via the MediaLocations RetailServer API.\r\n */\r\nexport const getMediaLocationsForSelectedVariantActionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/get-media-locations-for-selected-variant',\r\n action: >getMediaLocationsForSelectedVariantAction,\r\n input: createMediaLocationsForSelectedVariantInput\r\n});\r\n\r\nexport default getMediaLocationsForSelectedVariantActionDataAction;\r\n","import { IActionContext } from '@msdyn365-commerce/core';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { createCanonicalUrl } from './utilities/createCanonicalUrl';\r\n\r\nexport const getProductVariantUrl = (productDetails: SimpleProduct, context: IActionContext) => {\r\n const title = productDetails.Name ?? '';\r\n let normalizedCanonicalUrl = createCanonicalUrl(\r\n context,\r\n [title ?? ''],\r\n `${productDetails.MasterProductId ?? productDetails.RecordId}.p`\r\n ).toLowerCase();\r\n\r\n const dimParams = productDetails.Dimensions?.map(dim => {\r\n if (dim.DimensionTypeValue === 1 && dim.DimensionValue?.Value) {\r\n return `color=${encodeURIComponent(dim.DimensionValue.Value).replace(/%20/g, '+')}`;\r\n }\r\n\r\n if (dim.DimensionTypeValue === 3 && dim.DimensionValue?.Value) {\r\n return `size=${encodeURIComponent(dim.DimensionValue.Value).replace(/%20/g, '+')}`;\r\n }\r\n\r\n if (dim.DimensionTypeValue === 4 && dim.DimensionValue?.Value) {\r\n return `style=${encodeURIComponent(dim.DimensionValue.Value).replace(/%20/g, '+')}`;\r\n }\r\n\r\n return null;\r\n })\r\n .filter(p => !!p)\r\n .join('&');\r\n\r\n if (dimParams) {\r\n normalizedCanonicalUrl = `${normalizedCanonicalUrl}?${dimParams}`;\r\n }\r\n\r\n return normalizedCanonicalUrl;\r\n};\r\n","import { IActionContext } from '@msdyn365-commerce/core';\r\n\r\nexport const makeAbsUrl = (context: IActionContext, url: string) => {\r\n if (url[0] === '/') {\r\n let origin = `https://${window.location.host}`;\r\n\r\n if (context.requestContext.sitePath && process.env.NODE_ENV !== 'development') {\r\n origin += context.requestContext.sitePath;\r\n }\r\n\r\n return `${origin}${url}`;\r\n }\r\n\r\n return url;\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { ICommerceApiSettings } from '@msdyn365-commerce/core-internal';\r\nimport { ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\n\r\nimport { ISwatchItem, SwatchItemComponent } from '@msdyn365-commerce/components';\r\n\r\n/**\r\n * Swatch item configuration.\r\n */\r\nexport interface ISwatchProps {\r\n className?: string;\r\n apiSettings: ICommerceApiSettings;\r\n\r\n list: ISwatchItem[];\r\n isSelectionEnabled?: boolean;\r\n isRefineItem?: boolean;\r\n\r\n onSelectItem?(item: ISwatchItem): void;\r\n}\r\n\r\n/**\r\n * Represents a single item for swatch.\r\n * @param props - Item configuration.\r\n * @returns React node.\r\n */\r\nexport const SwatchComponent: React.FC = (props: ISwatchProps) => {\r\n const containerClassName = 'msc-swatch-container';\r\n\r\n const [selectedItemId, setSelectedItemId] = React.useState(undefined);\r\n\r\n const isSelectionEnabled = props.isSelectionEnabled ?? true;\r\n\r\n const onSelectItemCallback = props.onSelectItem;\r\n\r\n const onSelectItem = React.useCallback(\r\n (item: ISwatchItem) => {\r\n setSelectedItemId(item.itemId);\r\n if (!ObjectExtensions.isNullOrUndefined(onSelectItemCallback)) {\r\n onSelectItemCallback(item);\r\n }\r\n },\r\n [setSelectedItemId, onSelectItemCallback]\r\n );\r\n\r\n React.useEffect(() => {\r\n const defaultItem = props.list.find(item => item.isDefault);\r\n if (defaultItem && defaultItem.itemId !== selectedItemId) {\r\n setSelectedItemId(defaultItem.itemId);\r\n if (!ObjectExtensions.isNullOrUndefined(onSelectItemCallback)) {\r\n onSelectItemCallback(defaultItem);\r\n }\r\n }\r\n }, [props.list]);\r\n\r\n return (\r\n \r\n {props.list.map(item => {\r\n const itemId = item.itemId;\r\n const isSelected = selectedItemId === itemId;\r\n\r\n return (\r\n \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 */\r\n\r\nimport { ISwatchItem } from '@msdyn365-commerce/components';\r\nimport { DimensionTypes } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getPayloadObject, getTelemetryAttributes, IPayLoad } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IDropdownItemProps, IDropdownProps, SelectionType } from '@msdyn365-commerce-modules/buybox';\r\nimport { SwatchComponent } from './swatch';\r\n\r\n/**\r\n * State for a dropdown component.\r\n */\r\ninterface IDropdownState {\r\n /**\r\n * @friendlyName selectedIndex\r\n * @description Selected index.\r\n */\r\n selectedIndex: string;\r\n}\r\n\r\n/**\r\n *\r\n * DropDown component.\r\n * @extends {React.PureComponent}\r\n */\r\nexport class Dropdown extends React.PureComponent {\r\n private readonly selectMenu: React.RefObject = React.createRef();\r\n\r\n private readonly payLoad: IPayLoad;\r\n\r\n public constructor(props: IDropdownProps, state: IDropdownState) {\r\n super(props);\r\n\r\n const selectedItem = this.props.dropdownList.find(item => item.isDefault);\r\n if (selectedItem) {\r\n this.state = {\r\n selectedIndex: selectedItem.id.toString()\r\n };\r\n if (this.props.onChange) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises -- Update for default.\r\n this.props.onChange({\r\n dropdownId: this.props.dropdownId,\r\n selectId: selectedItem.id,\r\n selectedValue: selectedItem.value\r\n });\r\n }\r\n } else {\r\n this.state = {\r\n selectedIndex: ''\r\n };\r\n }\r\n this.payLoad = getPayloadObject('click', props.telemetryContent!, this.props.dropdownName);\r\n }\r\n\r\n public render(): JSX.Element {\r\n if (this.props.apiSettings && this.props.selectionType === SelectionType.swatch) {\r\n return this._renderSwatch();\r\n }\r\n\r\n return this._renderDropdown();\r\n }\r\n\r\n private _renderDropdown(): JSX.Element {\r\n const { dropdownId, dropdownList, dropdownName, dropdownToggleName } = this.props;\r\n const attribute = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\r\n return (\r\n \r\n \r\n {dropdownList.map(\r\n (item: IDropdownItemProps) =>\r\n item && (\r\n \r\n {item.value}\r\n \r\n )\r\n )}\r\n \r\n );\r\n }\r\n\r\n private _renderSwatch(): JSX.Element {\r\n const swatchItems = this.props.dropdownList.map(item => {\r\n return {\r\n ...item,\r\n itemId: item.id,\r\n dimensionType: this.props.dropdownName as DimensionTypes\r\n };\r\n });\r\n\r\n return ;\r\n }\r\n\r\n /**\r\n * Updates state on swatch selection.\r\n * @param item - Selected swatch item.\r\n */\r\n private readonly _selectSwatch = async (item: ISwatchItem) => {\r\n this.setState({ selectedIndex: item.itemId });\r\n\r\n if (this.props.onChange) {\r\n await this.props.onChange({\r\n dropdownId: this.props.dropdownId,\r\n selectId: item.itemId,\r\n selectedValue: item.value\r\n });\r\n }\r\n };\r\n\r\n private readonly _onChanged = async (event: React.ChangeEvent) => {\r\n this.setState({ selectedIndex: event.target.value });\r\n\r\n if (this.props.onChange) {\r\n await this.props.onChange({\r\n dropdownId: this.props.dropdownId,\r\n selectId: event.target.value,\r\n selectedValue: event.target.innerText\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 */\r\n\r\nimport { ICoreContext } from '@msdyn365-commerce/core-internal';\r\nimport { ProductDimension, ProductDimensionType } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ArrayExtensions,\r\n convertProductDimensionTypeToDimensionTypes,\r\n DimensionTypes,\r\n getDimensionValuesFromQuery,\r\n getInventoryLevelCodeFromDimensionValue,\r\n IDimensionForSelectedVariant,\r\n IDimensionsApp,\r\n IDimensionValueForSelectedVariant,\r\n InventoryLevelValues,\r\n ObjectExtensions,\r\n InventoryLevels\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { format, getTelemetryObject, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport {\r\n IBuyboxCallbacks,\r\n IBuyboxCommonData,\r\n IBuyboxCommonResources,\r\n IBuyboxExtentedProps,\r\n IBuyboxProductConfigureDropdownViewProps,\r\n IBuyboxProductConfigureViewProps,\r\n IBuyboxState,\r\n IProductDetails,\r\n IDropdownItemProps,\r\n IDropdownOnSelectionChangeNotification,\r\n SelectionType\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport memoize from 'memoize-one';\r\nimport { IHeiBuyboxCallbacks } from '../hei-buybox-v2.data';\r\nimport { Dropdown } from './dropdown';\r\n\r\nlet telemetryContent: ITelemetryContent;\r\n\r\n/**\r\n * Dimension pre-processing info.\r\n */\r\ninterface IProductDimensionInfo {\r\n dropdownName: string;\r\n dropdownId: string;\r\n dropdownList: IDropdownItemProps[];\r\n}\r\n\r\n/**\r\n * Props for rendering a dropdown.\r\n */\r\ninterface IProductDimensionDropdownProps extends IProductDimensionInfo {\r\n resources: IBuyboxCommonResources;\r\n className: string;\r\n context: ICoreContext;\r\n\r\n configureErrors: { [configureId: string]: string | undefined };\r\n\r\n getDropdownName(dimensionType: number, resources: IBuyboxCommonResources): string;\r\n dropdownCallback(notification: IDropdownOnSelectionChangeNotification): Promise;\r\n}\r\n\r\nconst mapProductDimensionFullToDropdownViewProps = (props: IProductDimensionDropdownProps): IBuyboxProductConfigureDropdownViewProps => {\r\n const dimensionId = Number.parseInt(props.dropdownId, 10) as ProductDimensionType;\r\n const dropdownToggleName = format(props.resources.selectDimensionFormatString, props.dropdownName);\r\n\r\n const errorMessage = props.configureErrors[props.dropdownId];\r\n\r\n let dimensionSelectionType = SelectionType.dropdown;\r\n\r\n const dimensionType = convertProductDimensionTypeToDimensionTypes(dimensionId);\r\n\r\n const dimensionsAsSwatchConfiguration = props.context.app.config.dimensionsAsSwatchType;\r\n if (\r\n ArrayExtensions.hasElements(dimensionsAsSwatchConfiguration) &&\r\n !dimensionsAsSwatchConfiguration.includes(DimensionTypes.none) &&\r\n dimensionsAsSwatchConfiguration.includes(dimensionType)\r\n ) {\r\n dimensionSelectionType = SelectionType.swatch;\r\n }\r\n\r\n return {\r\n ContainerProps: {\r\n key: dimensionId,\r\n className: `${props.className}__dropdown ${props.className}__dimension-${props.dropdownId}`\r\n },\r\n LabelContainerProps: {\r\n tag: 'label',\r\n className: `${props.className}__dropdown-quantity-label`,\r\n htmlFor: `${props.className}__dropown-quantity-input-${props.dropdownId}`\r\n },\r\n errors: errorMessage && (\r\n \r\n \r\n ),\r\n heading:
{props.dropdownName}
,\r\n select: (\r\n \r\n )\r\n };\r\n};\r\n\r\nconst getDimensionCombinations = memoize((allDimensions: IDimensionForSelectedVariant[]) => {\r\n const productIdsToDimensions: Record> = {};\r\n for (const dimension of allDimensions) {\r\n for (const dimensionValueWithInventory of dimension.dimensionValuesWithInventory ?? []) {\r\n for (const productId of dimensionValueWithInventory.ProductIds ?? []) {\r\n const productIdToDimensions = productIdsToDimensions[productId] ?? (productIdsToDimensions[productId] = {});\r\n productIdToDimensions[+dimension.DimensionTypeValue] = {\r\n id: dimensionValueWithInventory.DimensionValue?.RecordId ?? 0,\r\n value: dimensionValueWithInventory.DimensionValue?.Value ?? ''\r\n };\r\n }\r\n }\r\n }\r\n\r\n const dimensionCombinations = Object.keys(productIdsToDimensions).map(\r\n productId => productIdsToDimensions[productId] as Record\r\n );\r\n\r\n process.env.NODE_ENV === 'development' && console.log('getBuyboxProductConfigure', 'getDimensionCombinations', dimensionCombinations);\r\n return dimensionCombinations;\r\n});\r\n\r\nconst getDimensionValuesFromQueryMemoized = memoize((url: string) => getDimensionValuesFromQuery(new URL(url)));\r\n\r\nconst mapDimensionsInfo = memoize(\r\n (\r\n productDimensions: IDimensionForSelectedVariant[],\r\n matchedDimensions: ProductDimension[],\r\n enableStockCheck: boolean,\r\n inventoryLevel: InventoryLevels | undefined,\r\n getDropdownName: IBuyboxCallbacks['getDropdownName'],\r\n resources: IBuyboxCommonResources\r\n ): IProductDimensionInfo[] => {\r\n const dimensionsInfo = productDimensions.map(productDimensionFull => {\r\n const dropdownName = getDropdownName(productDimensionFull.DimensionTypeValue, resources);\r\n const dropdownId = productDimensionFull.DimensionTypeValue.toString();\r\n\r\n const dimensions = (productDimensionFull.dimensionValuesWithInventory ??\r\n productDimensionFull.DimensionValues ??\r\n []) as IDimensionValueForSelectedVariant[];\r\n const validProductDimensionsFull = dimensions.filter(\r\n value => !ObjectExtensions.isNullOrUndefined(value.DimensionValue?.RecordId ?? value.RecordId)\r\n );\r\n\r\n const dropdownList: IDropdownItemProps[] = validProductDimensionsFull.map(dimensionValuesWithInventory => {\r\n const dimensionValue = dimensionValuesWithInventory.DimensionValue ?? dimensionValuesWithInventory;\r\n const inventoryLevelCode = getInventoryLevelCodeFromDimensionValue(dimensionValuesWithInventory, inventoryLevel);\r\n return {\r\n value: dimensionValue.Value ?? '',\r\n id: dimensionValue.RecordId.toString(),\r\n colorHexCode: dimensionValue.ColorHexCode,\r\n imageUrl: dimensionValue.ImageUrl,\r\n isDisabled: enableStockCheck && inventoryLevelCode === InventoryLevelValues.outOfStock,\r\n swatchItemAriaLabel: resources.swatchItemAriaLabel ? resources.swatchItemAriaLabel : ''\r\n };\r\n });\r\n return {\r\n dropdownName,\r\n dropdownId,\r\n dropdownList\r\n };\r\n });\r\n\r\n for (const dimensionInfo of dimensionsInfo) {\r\n const currentDimensionsFromQuery = matchedDimensions.filter(\r\n dimensionFromQuery => dimensionFromQuery.DimensionTypeValue.toString() === dimensionInfo.dropdownId\r\n );\r\n if (!ArrayExtensions.hasElements(currentDimensionsFromQuery)) {\r\n continue;\r\n }\r\n\r\n const currentDimensionFromQuery = currentDimensionsFromQuery[0];\r\n const selectedDimensionItem = dimensionInfo.dropdownList.filter(\r\n dimensionItem =>\r\n dimensionItem.value.toLocaleLowerCase() === currentDimensionFromQuery.DimensionValue?.Value?.toLocaleLowerCase()\r\n );\r\n if (!ArrayExtensions.hasElements(selectedDimensionItem)) {\r\n continue;\r\n }\r\n\r\n process.env.NODE_ENV === 'development' &&\r\n console.log('getBuyboxProductConfigure', 'set', selectedDimensionItem[0].id, '=', selectedDimensionItem[0].value);\r\n selectedDimensionItem[0].isDefault = true;\r\n }\r\n\r\n const dimensionCombinations = getDimensionCombinations(productDimensions);\r\n\r\n for (const dimensionInfo of dimensionsInfo) {\r\n const otherDimensionsFromQuery = matchedDimensions.filter(\r\n dimensionFromQuery => dimensionFromQuery.DimensionTypeValue !== +dimensionInfo.dropdownId\r\n );\r\n\r\n // valid dimensions where match the other selected values\r\n const validDimensionValues = dimensionCombinations\r\n .filter(dc => dc[+dimensionInfo.dropdownId])\r\n .filter(dc => {\r\n const unmatched = otherDimensionsFromQuery.find(\r\n od => (dc[od.DimensionTypeValue]?.value.toLowerCase() ?? '') !== (od.DimensionValue?.Value?.toLowerCase() ?? '')\r\n );\r\n\r\n return !unmatched;\r\n })\r\n .map(dc => dc[+dimensionInfo.dropdownId]);\r\n\r\n // process.env.NODE_ENV === 'development' &&\r\n // console.log(\r\n // 'getBuyboxProductConfigure',\r\n // 'when',\r\n // otherDimensionsFromQuery\r\n // .map(d => `${getDropdownName(d.DimensionTypeValue, resources)}='${d.DimensionValue?.Value}'`)\r\n // .join(', '),\r\n // dimensionInfo.dropdownName,\r\n // 'in',\r\n // validDimensionValues.map(v => `'${v?.value}'`).join(', ')\r\n // );\r\n dimensionInfo.dropdownList.forEach(dl => {\r\n if (!validDimensionValues.find(val => val.value === dl.value)) {\r\n dl.isDisabled = true;\r\n // process.env.NODE_ENV === 'development' && console.log('getBuyboxProductConfigure', 'disable', `'${dl.value}'`);\r\n }\r\n });\r\n\r\n // process.env.NODE_ENV === 'development' &&\r\n // console.log('getBuyboxProductConfigure', 'mapDimensionsInfo', dimensionInfo, validDimensionCombinations);\r\n }\r\n\r\n return dimensionsInfo;\r\n }\r\n);\r\n\r\nexport function getBuyboxProductConfigure(\r\n props: IBuyboxExtentedProps,\r\n state: IBuyboxState,\r\n callbacks: IHeiBuyboxCallbacks,\r\n productDetails?: IProductDetails,\r\n selectedDimensions?: ProductDimension[],\r\n allDimensions?: IDimensionForSelectedVariant[]\r\n): IBuyboxProductConfigureViewProps | undefined {\r\n const { resources, typeName } = props;\r\n\r\n const {\r\n errorState: { configureErrors }\r\n } = state;\r\n\r\n const { getDropdownName } = callbacks;\r\n\r\n const context = props.context as ICoreContext;\r\n\r\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\r\n const product = props.data.product?.result ? props.data.product.result : productDetails?.product;\r\n\r\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\r\n const productDimensionsData = allDimensions ?? props.data.productDimensions?.result ?? productDetails?.productDimensions;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access -- app context is generic\r\n const enableStockCheck = props.context.app.config.enableStockCheck;\r\n\r\n const hasProductDimensions = ArrayExtensions.hasElements(productDimensionsData);\r\n\r\n // process.env.NODE_ENV === 'development' && console.log('getBuyboxProductConfigure', 'dimensionsInfo', product);\r\n if (!product || !hasProductDimensions) {\r\n return undefined;\r\n }\r\n\r\n const className = _getClassNamePrefix(typeName);\r\n\r\n if (!telemetryContent) {\r\n telemetryContent = getTelemetryObject(context.request.telemetryPageName!, props.typeName, props.telemetry);\r\n }\r\n\r\n const inventoryLevel = context.app.config.inventoryLevel;\r\n\r\n const productDimensions = productDimensionsData as IDimensionForSelectedVariant[];\r\n const dimensionCombinations = getDimensionCombinations(productDimensions);\r\n const matchedDimensions = selectedDimensions ?? getDimensionValuesFromQueryMemoized(context.request.url.requestUrl.toString());\r\n\r\n const onChanged = async (notification: IDropdownOnSelectionChangeNotification) => {\r\n const possibleDimensions = dimensionCombinations.filter(\r\n dc => dc[+notification.dropdownId]?.id.toString() === notification.selectId\r\n );\r\n\r\n const otherDimensions = matchedDimensions.filter(\r\n dimensionFromQuery => dimensionFromQuery.DimensionTypeValue !== +notification.dropdownId\r\n );\r\n\r\n const isOtherDimensionsValid = possibleDimensions.find(pd => {\r\n const unmatched = otherDimensions.find(\r\n od => (pd[od.DimensionTypeValue]?.value.toLowerCase() ?? '') !== (od.DimensionValue?.Value?.toLowerCase() ?? '')\r\n );\r\n\r\n return !unmatched;\r\n });\r\n\r\n const dimensionsSelected: Record = {};\r\n if (!isOtherDimensionsValid && ArrayExtensions.hasElements(possibleDimensions)) {\r\n const nextDimensions = possibleDimensions[0];\r\n Object.keys(nextDimensions).forEach(\r\n dimensionTypeValue => (dimensionsSelected[+dimensionTypeValue] = nextDimensions[+dimensionTypeValue].id.toString())\r\n );\r\n } else {\r\n dimensionsSelected[+notification.dropdownId] = notification.selectId;\r\n }\r\n await callbacks.dimensionsSelectedAsync(dimensionsSelected);\r\n };\r\n\r\n const dimensionsInfo = mapDimensionsInfo(\r\n productDimensions,\r\n matchedDimensions,\r\n enableStockCheck,\r\n inventoryLevel,\r\n getDropdownName,\r\n resources\r\n );\r\n\r\n // process.env.NODE_ENV === 'development' && console.log('getBuyboxProductConfigure', 'dimensionsInfo', dimensionsInfo);\r\n const dropdowns: IBuyboxProductConfigureDropdownViewProps[] = dimensionsInfo.map(dimensionInfo => {\r\n return mapProductDimensionFullToDropdownViewProps({\r\n ...dimensionInfo,\r\n resources,\r\n configureErrors,\r\n getDropdownName,\r\n dropdownCallback: onChanged,\r\n className,\r\n context\r\n });\r\n });\r\n\r\n return {\r\n ContainerProps: {\r\n className: `${className}__configure hei-buybox-configure`\r\n },\r\n dropdowns\r\n };\r\n}\r\n\r\nconst _getClassNamePrefix = (typeName: string): string => {\r\n return typeName.toLocaleLowerCase() === 'quickview' ? 'ms-quickView' : 'ms-buybox';\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport {\r\n AddToCartBehavior,\r\n IAddToCartFailureResult,\r\n IAddToCartResources,\r\n ItemSuccessfullyAddedToCartNotification,\r\n PriceComponent\r\n} from '@msdyn365-commerce/components';\r\nimport { getUrlSync, ICoreContext, IImageSettings } from '@msdyn365-commerce/core';\r\nimport { ICartActionResult } from '@msdyn365-commerce/global-state';\r\nimport {\r\n CartLine,\r\n DeliveryOption,\r\n FeatureState,\r\n OrgUnitLocation,\r\n ProductAvailableQuantity,\r\n ProductDimension,\r\n ProductsDataActions,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { NotificationsManager } from '@msdyn365-commerce-modules/notifications-core';\r\nimport {\r\n ArrayExtensions,\r\n DeliveryMode,\r\n IProductInventoryInformation,\r\n isAggregatedInventory\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getTelemetryObject, Heading, INodeProps } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { BuyboxErrorBlock } from '@msdyn365-commerce-modules/buybox';\r\nimport { IBuyboxCallbacks } from '@msdyn365-commerce-modules/buybox';\r\nimport { getConfigureErrors, getGenericError } from '@msdyn365-commerce-modules/buybox';\r\nimport { IHeiBuyboxState, IHeiBuyboxV2Data } from '../hei-buybox-v2.data';\r\nimport { IHeiBuyboxV2Props, IHeiBuyboxV2Resources } from '../hei-buybox-v2.props.autogenerated';\r\nimport { sendGoogleAnalyticsEvent } from '../../../common/sendGoogleAnalyticsEvent';\r\nimport { getBonusItemsForAddToCart } from '../../hei-buybox/components/add-to-cart.component';\r\nimport Popup, { IPopupProps } from '../../hei-buybox/components/Popup';\r\nimport { getLineIdFromExtProps } from '../../cart/components/cart-pick-up-in-store';\r\n\r\nconst modalCloseButtonReference: React.RefObject = React.createRef();\r\n\r\n/**\r\n * FindinStore failure Interface.\r\n */\r\nexport interface IFindInStoreFailureResult {\r\n missingDimensions?: ProductDimension[];\r\n}\r\n\r\ninterface IAddCartLine {\r\n product: SimpleProduct;\r\n count?: number;\r\n location?: OrgUnitLocation;\r\n additionalProperties?: object;\r\n availableQuantity?: number;\r\n enableStockCheck?: boolean;\r\n isAddEmailDeliveryItemToCart?: boolean;\r\n isPriceKeyedIn?: boolean;\r\n customPrice?: number;\r\n deliveryMode?: string;\r\n shouldSkipSiteSettings?: boolean;\r\n}\r\n\r\n/**\r\n * BuyBoxFindinStore View Props Interface.\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/**\r\n * On click find store handler.\r\n * @param props -Buybox data.\r\n * @param state -Buybox state.\r\n * @param callbacks -Buybox callbacks.\r\n * @returns Find in store.\r\n */\r\nconst onClickFindInStoreHandler = (\r\n props: IHeiBuyboxV2Props,\r\n state: IHeiBuyboxState,\r\n callbacks: IBuyboxCallbacks\r\n) => async () => {\r\n await findInStoreOnClick(props, state, callbacks);\r\n};\r\n\r\n/**\r\n * Inventory settings based on the inventory policy for aggregated availability.\r\n */\r\ninterface IInventorySettingsProps {\r\n isSectionDisabled: boolean;\r\n description: string;\r\n buttonText: string;\r\n}\r\n\r\n/**\r\n * The function defines the settings values for a given inventory configuration.\r\n * @param context - The context.\r\n * @param isStockCheck - Flag to enable inventory validation.\r\n * @param productAvailability - The product inventory information.\r\n * @param buyboxResources - The buybox string resources.\r\n * @param isLoading - Is loading.\r\n * @returns Boolean.\r\n */\r\nfunction getFindInStoreInventorySettings(\r\n context: ICoreContext,\r\n isStockCheck: boolean,\r\n productAvailability: IProductInventoryInformation[] | undefined,\r\n buyboxResources: IHeiBuyboxV2Resources,\r\n isLoading?: boolean\r\n): IInventorySettingsProps {\r\n // If shouldValidateAggregation is true then is required to check for the product inventory, based on this the messaging will change\r\n // and the find in store button will be ensbled or disabled\r\n\r\n let isSectionDisabled: boolean;\r\n let buttonText;\r\n let description: string;\r\n\r\n let pickupInventory: IProductInventoryInformation | undefined;\r\n\r\n if (!isStockCheck || isLoading) {\r\n return {\r\n isSectionDisabled: false,\r\n buttonText: buyboxResources.findInStoreLinkText,\r\n description: buyboxResources.findInStoreDescriptionText\r\n };\r\n }\r\n\r\n if (productAvailability) {\r\n pickupInventory = productAvailability.find(pickup => pickup.deliveryType === DeliveryMode.pickup);\r\n }\r\n\r\n // If aggregated is enabled, then we need to validate the inventor check for find in store.\r\n // If an individual is selected, then we will always show a find in store button.\r\n if (isAggregatedInventory(context.actionContext)) {\r\n if (productAvailability && pickupInventory?.IsProductAvailable) {\r\n isSectionDisabled = false;\r\n buttonText = buyboxResources.findInStoreLinkText;\r\n description = buyboxResources.findInStoreDescriptionText;\r\n } else {\r\n isSectionDisabled = true;\r\n buttonText = buyboxResources.findInStoreNotAvailableTextButton;\r\n description = buyboxResources.findInStoreNotAvailableDescription;\r\n }\r\n } else {\r\n isSectionDisabled = false;\r\n buttonText = buyboxResources.findInStoreLinkText;\r\n description = buyboxResources.findInStoreDescriptionText;\r\n }\r\n\r\n return {\r\n isSectionDisabled,\r\n description,\r\n buttonText\r\n };\r\n}\r\n\r\n/**\r\n * Method to check if we have atleast one common delivery code between product and channel.\r\n * @param productdeliveryOptions - Product DeliveryOption List.\r\n * @param storePickUpOptionList - Channel DeliveryOption List.\r\n * @returns Boolean flag.\r\n */\r\nconst matchDeliveryOptions = (\r\n productdeliveryOptions: DeliveryOption[] | undefined,\r\n storePickUpOptionList: string[] | undefined\r\n): boolean => {\r\n const deliveryOption: string[] = [];\r\n productdeliveryOptions?.map(delivery => {\r\n const pickup = storePickUpOptionList?.find(deliveryCode => deliveryCode === delivery.Code);\r\n if (pickup) {\r\n deliveryOption.push(pickup);\r\n }\r\n return deliveryOption;\r\n });\r\n\r\n return ArrayExtensions.hasElements(deliveryOption);\r\n};\r\n\r\nconst PopupComponent = (props: {\r\n buyBoxProps: IHeiBuyboxV2Props;\r\n buyBoxState: IHeiBuyboxState;\r\n callbacks: IBuyboxCallbacks;\r\n}) => {\r\n const { buyBoxProps, buyBoxState, callbacks } = props;\r\n const {\r\n resources: {\r\n priceFree,\r\n originalPriceText,\r\n currentPriceText,\r\n buyBoxGoToCartText,\r\n buyBoxContinueShoppingText,\r\n closeNotificationLabel,\r\n buyBoxSingleItemText,\r\n buyBoxMultiLineItemFormatText,\r\n buyBoxHeaderMessageText\r\n }\r\n } = buyBoxProps;\r\n const { modalOpen, quantity, productPromotions, productPrice, selectedProduct } = buyBoxState;\r\n\r\n const [bonusProducts, setBonusProducts] = React.useState();\r\n const bonusProductIds = productPromotions?.FreeItemProductIds;\r\n React.useEffect(() => {\r\n if (bonusProductIds) {\r\n void ProductsDataActions.getByIdsAsync(\r\n { callerContext: buyBoxProps.context.actionContext },\r\n buyBoxProps.context.request.apiSettings.channelId,\r\n bonusProductIds\r\n ).then(resp => setBonusProducts(resp || []));\r\n } else {\r\n setBonusProducts([]);\r\n }\r\n }, [bonusProductIds]);\r\n\r\n const [productVariant, setProductVariant] = React.useState();\r\n React.useEffect(() => {\r\n if (bonusProductIds) {\r\n void ProductsDataActions.getByIdsAsync(\r\n { callerContext: buyBoxProps.context.actionContext },\r\n buyBoxProps.context.request.apiSettings.channelId,\r\n bonusProductIds\r\n ).then(resp => setBonusProducts(resp || []));\r\n } else {\r\n setBonusProducts([]);\r\n }\r\n }, [bonusProductIds]);\r\n\r\n React.useEffect(() => {\r\n selectedProduct?.then(p => setProductVariant(p ?? undefined));\r\n }, [selectedProduct]);\r\n\r\n if (!bonusProducts || !productVariant) {\r\n return null;\r\n }\r\n\r\n const price = productPrice;\r\n\r\n const dialogStrings = {\r\n goToCartText: buyBoxGoToCartText,\r\n continueShoppingText: buyBoxContinueShoppingText,\r\n closeNotificationLabel,\r\n headerItemOneText: buyBoxSingleItemText,\r\n headerItemFormatText: buyBoxMultiLineItemFormatText,\r\n headerMessageText: buyBoxHeaderMessageText,\r\n freePriceText: priceFree,\r\n originalPriceText,\r\n currentPriceText\r\n };\r\n\r\n const priceComponent = price ? (\r\n \r\n ) : (\r\n ''\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: buyBoxProps.context,\r\n className: 'ms-buybox',\r\n id: buyBoxProps.id,\r\n typeName: buyBoxProps.typeName,\r\n data: { product: productVariant, price: productPrice, bonusProducts: bonusProducts },\r\n dialogStrings,\r\n imageSettings: defaultImageSettings,\r\n gridSettings: buyBoxProps.context.request.gridSettings,\r\n productQuantity: quantity,\r\n priceComponent,\r\n navigationUrl: getUrlSync('cart', buyBoxProps.context.actionContext),\r\n modalOpen,\r\n setModalOpen: callbacks.changeModalOpen\r\n };\r\n\r\n return ;\r\n};\r\n\r\nexport function getBuyboxFindInStore(\r\n props: IHeiBuyboxV2Props,\r\n state: IHeiBuyboxState,\r\n callbacks: IBuyboxCallbacks\r\n): IBuyboxFindInStoreViewProps | undefined {\r\n const {\r\n data,\r\n slots: { storeSelector },\r\n resources: { unavailableForPickupText, availableForPickupText },\r\n context: {\r\n request: { channel: { PickupDeliveryModeCode } = { PickupDeliveryModeCode: undefined } }\r\n }\r\n } = props;\r\n\r\n // wait for availabilities check for pickup\r\n if (state.storeAvailabilities === undefined) {\r\n return undefined;\r\n } else if (state.storeAvailabilities.length === 0) {\r\n return {\r\n ContainerProps: {\r\n className: 'ms-buybox__find-in-store'\r\n },\r\n openFindInStoreDialog: () => Promise.resolve(),\r\n heading: \r\n };\r\n }\r\n\r\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n const product = data?.product?.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 productAvailability = data.productAvailableQuantity?.result;\r\n const retailMulitplePickupMFeatureState = data?.featureState?.result?.find(\r\n (featureState: FeatureState) => featureState.Name === multiplePickupStoreSwitchName\r\n )?.IsEnabled;\r\n const channelDeliveryOptionConfig = data?.channelDeliveryOptionConfig?.result;\r\n\r\n const missingDimensions = product?.Dimensions?.filter(dimension => !dimension.DimensionValue?.Value);\r\n\r\n const {\r\n errorState: { configureErrors, quantityError, otherError, errorHost }\r\n } = state;\r\n\r\n const { isSectionDisabled, buttonText } = getFindInStoreInventorySettings(\r\n props.context,\r\n props.context.app.config.enableStockCheck,\r\n productAvailability,\r\n props.resources,\r\n props.data.productAvailableQuantity.status === 'LOADING' || ArrayExtensions.hasElements(missingDimensions)\r\n );\r\n\r\n if (!product || !storeSelectorStateManager || !ArrayExtensions.hasElements(storeSelector)) {\r\n return undefined;\r\n }\r\n\r\n if (!deliveryOptions || !deliveryOptions.DeliveryOptions) {\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 (retailMulitplePickupMFeatureState && channelDeliveryOptionConfig) {\r\n if (!matchDeliveryOptions(deliveryOptions.DeliveryOptions, channelDeliveryOptionConfig?.PickupDeliveryModeCodes)) {\r\n return undefined;\r\n }\r\n } else if (\r\n !PickupDeliveryModeCode ||\r\n !deliveryOptions.DeliveryOptions.find((option: DeliveryOption) => option.Code === PickupDeliveryModeCode)\r\n ) {\r\n return undefined;\r\n }\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: onClickFindInStoreHandler(props, state, callbacks),\r\n\r\n heading: ,\r\n\r\n description:

Pick up near you

,\r\n productPickupOptionList: null,\r\n errors: (\r\n \r\n ),\r\n\r\n button: (\r\n \r\n {buttonText}\r\n \r\n ),\r\n\r\n modal: \r\n };\r\n}\r\n\r\n/**\r\n * Handler for find in store button.\r\n * @param props - BuyBox data.\r\n * @param state - BuyBox state.\r\n * @param callbacks - BuyBox callbacks.\r\n * @returns - Promise.\r\n */\r\nasync function findInStoreOnClick(\r\n props: IHeiBuyboxV2Props,\r\n state: IHeiBuyboxState,\r\n callbacks: IBuyboxCallbacks\r\n): 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 { selectedProduct, quantity } = state;\r\n\r\n let dataProduct = props.data.product.result;\r\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n const retailMulitplePickupMFeatureState = props.data?.featureState?.result?.find(\r\n (featureState: FeatureState) => featureState.Name === multiplePickupStoreSwitchName\r\n )?.IsEnabled;\r\n\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 =\r\n product.Dimensions &&\r\n 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 errorHost: 'FINDINSTORE',\r\n configureErrors: getConfigureErrors(missingDimensions, resources)\r\n });\r\n }\r\n } else {\r\n storeSelectorStateManager\r\n .openDialog({\r\n product,\r\n id: storeSelectorId,\r\n parentElementRef: modalCloseButtonReference,\r\n deliveryOptions: retailMulitplePickupMFeatureState ? props.data.deliveryOptions.result : undefined,\r\n onLocationSelected: async (orgUnitLocation: OrgUnitLocation, deliveryMode: string) => {\r\n if (!cart) {\r\n return Promise.resolve();\r\n }\r\n\r\n const productsToAdd: IAddCartLine[] = [];\r\n productsToAdd.push({\r\n product: product,\r\n count: quantity,\r\n enableStockCheck: props.context.app.config.enableStockCheck,\r\n location: orgUnitLocation,\r\n deliveryMode: deliveryMode\r\n });\r\n const behavior = props.context?.app?.config?.addToCartBehavior;\r\n if (state.selectedWarranty) {\r\n const warrantyProduct = state.selectedWarranty;\r\n productsToAdd.push({\r\n product: warrantyProduct,\r\n count: quantity,\r\n location: orgUnitLocation,\r\n additionalProperties: {\r\n warrantyProduct: product.RecordId\r\n },\r\n deliveryMode: deliveryMode\r\n });\r\n }\r\n\r\n // add bonus items\r\n const bonusItemIds = props.data.productPromotions.result?.FreeItemProductIds;\r\n if (bonusItemIds && bonusItemIds.length > 0) {\r\n const bonusItems = await getBonusItemsForAddToCart({\r\n context: props.context,\r\n bonusItemIds: bonusItemIds,\r\n quantity\r\n });\r\n\r\n for (const p of bonusItems) {\r\n productsToAdd.push({\r\n ...p,\r\n location: orgUnitLocation,\r\n deliveryMode: deliveryMode,\r\n additionalProperties: {\r\n isBonus: true\r\n }\r\n });\r\n }\r\n }\r\n\r\n const currentCartLinesCount = cart.cart.CartLines?.length ?? 0;\r\n return cart\r\n .addProductsToCart(productsToAdd)\r\n .then(async (result: ICartActionResult) => {\r\n if (result.status === 'FAILED' && result.substatus === 'MAXQUANTITY') {\r\n callbacks.changeModalOpen(false);\r\n let productAvailability: ProductAvailableQuantity | undefined;\r\n if (state.productAvailableQuantity) {\r\n productAvailability = state.productAvailableQuantity.ProductAvailableQuantity;\r\n } else if (productAvailableQuantity && ArrayExtensions.hasElements(productAvailableQuantity)) {\r\n const shippingInventory = productAvailableQuantity.find(\r\n shipping => shipping.deliveryType === DeliveryMode.pickup\r\n );\r\n productAvailability = shippingInventory?.ProductAvailableQuantity;\r\n } else {\r\n productAvailability = undefined;\r\n }\r\n const failureResult: IAddToCartFailureResult = {\r\n failureReason: 'CARTACTIONFAILED',\r\n cartActionResult: { status: result.status, substatus: result.substatus }\r\n };\r\n callbacks.updateErrorState({\r\n errorHost: 'ADDTOCART',\r\n configureErrors: {},\r\n otherError: getGenericError(\r\n failureResult,\r\n cart,\r\n resources,\r\n context,\r\n product,\r\n productAvailability,\r\n orgUnitLocation\r\n )\r\n });\r\n } else {\r\n const cartLines = cart.cart.CartLines ?? [];\r\n const itemsAdded = cartLines.length - currentCartLinesCount;\r\n\r\n process.env.NODE_ENV === 'development' &&\r\n console.log('BuyboxView', 'addProductsToCart', result, itemsAdded);\r\n\r\n if (itemsAdded > 1) {\r\n const productLine = cartLines[currentCartLinesCount];\r\n const updatedCartLinesObject: CartLine[] = [];\r\n\r\n // Link warranty if selected\r\n const warrantyLine = cartLines[currentCartLinesCount + 1];\r\n if (productLine && warrantyLine?.ProductId === state.selectedWarranty?.RecordId) {\r\n warrantyLine.WarrantableLineNumber = productLine.LineNumber;\r\n warrantyLine.IsWarrantyLine = true;\r\n\r\n const [productLineId, productLineUpdated] = getLineIdFromExtProps(productLine);\r\n\r\n if (!warrantyLine.ExtensionProperties) {\r\n warrantyLine.ExtensionProperties = [];\r\n }\r\n\r\n warrantyLine.ExtensionProperties.push({\r\n Key: 'warrantable-line-id',\r\n Value: {\r\n StringValue: productLineId\r\n }\r\n });\r\n\r\n updatedCartLinesObject.push(warrantyLine);\r\n if (productLineUpdated) {\r\n updatedCartLinesObject.push(productLine);\r\n }\r\n }\r\n\r\n // check if there's bonus item\r\n for (let idx = currentCartLinesCount + 1; idx < cartLines.length; idx++) {\r\n const bonusCartLine = cartLines[idx];\r\n if (!bonusCartLine.IsWarrantyLine) {\r\n if (!bonusCartLine.ExtensionProperties) {\r\n bonusCartLine.ExtensionProperties = [];\r\n }\r\n\r\n const [productLineId, productLineUpdated] = getLineIdFromExtProps(productLine);\r\n\r\n bonusCartLine.ExtensionProperties.push({\r\n Key: 'bonus-for-line-id',\r\n Value: {\r\n StringValue: productLineId\r\n }\r\n });\r\n\r\n updatedCartLinesObject.push(bonusCartLine);\r\n\r\n if (productLineUpdated) {\r\n updatedCartLinesObject.push(productLine);\r\n }\r\n }\r\n }\r\n\r\n if (updatedCartLinesObject.length > 0) {\r\n await cart.updateCartLines({ updatedCartLinesObject });\r\n }\r\n }\r\n\r\n await sendGoogleAnalyticsEvent(productsToAdd, props.context.actionContext);\r\n\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) {\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(\r\n props.context.request.telemetryPageName!,\r\n props.friendlyName,\r\n props.telemetry\r\n );\r\n const dialogStrings: IAddToCartResources = {\r\n goToCartText: resources.buyBoxGoToCartText,\r\n continueShoppingText: resources.buyBoxContinueShoppingText,\r\n closeNotificationLabel: resources.closeNotificationLabel,\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 };\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 productsToAdd.length === 2 ? quantity + 1 : 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 })\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 });\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 });\r\n }\r\n}\r\n","import classnames from 'classnames';\r\nimport * as React from 'react';\r\n\r\n/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\nimport { IComponent, IComponentProps } from '@msdyn365-commerce/core';\r\nimport { AttributeValue, ProductPrice } from '@msdyn365-commerce/retail-proxy';\r\n\r\nexport interface IPriceComponentProps extends IComponentProps<{ price: ProductPrice }> {\r\n className?: string;\r\n savingsText?: string;\r\n freePriceText?: string;\r\n originalPriceText?: string;\r\n currentPriceText?: string;\r\n attributeValues?: AttributeValue[];\r\n resources: {\r\n seePriceInCartLabel: string;\r\n };\r\n}\r\nexport interface IPriceComponent extends IComponent {}\r\n\r\nconst Price: React.FC = (props: IPriceComponentProps) => {\r\n const { attributeValues, resources } = props;\r\n\r\n const seePriceInCart = React.useMemo(() => {\r\n const attr = attributeValues?.find(av => av.Name === 'See Price In Cart');\r\n return attr?.BooleanValue ?? false;\r\n }, [attributeValues]);\r\n\r\n if (seePriceInCart) {\r\n return

{resources.seePriceInCartLabel}

;\r\n }\r\n\r\n // CustomerContextualPrice could be 0\r\n if (props.data.price.CustomerContextualPrice === undefined) {\r\n return null;\r\n }\r\n return (\r\n \r\n {showStrikethroughPricing(props) ? renderCurrentPriceWithOriginalPrice(props) : renderCurrentPrice(props)}\r\n \r\n );\r\n};\r\n\r\nconst showStrikethroughPricing = (props: IPriceComponentProps) => {\r\n const originalPrice = getOriginalPrice(props);\r\n if (originalPrice && props.data.price.CustomerContextualPrice) {\r\n return originalPrice > props.data.price.CustomerContextualPrice;\r\n }\r\n\r\n return false;\r\n};\r\n\r\nconst getOriginalPrice = (props: IPriceComponentProps) => {\r\n return props.data.price.TradeAgreementPrice || props.data.price.BasePrice || 0;\r\n};\r\n\r\nconst renderCurrentPrice = (props: IPriceComponentProps): JSX.Element | undefined => {\r\n const initialPrice = formatCurrency(props, props.data.price.CustomerContextualPrice);\r\n return (\r\n \r\n {initialPrice}\r\n \r\n );\r\n};\r\n\r\nconst formatCurrency = (props: IPriceComponentProps, price: number | undefined): string | undefined => {\r\n if (price === undefined) {\r\n return undefined;\r\n }\r\n\r\n if (price === 0 && props.freePriceText) {\r\n return props.freePriceText;\r\n }\r\n\r\n return props.context.cultureFormatter.formatCurrency(price);\r\n};\r\n\r\nconst renderCurrentPriceWithOriginalPrice = (props: IPriceComponentProps): JSX.Element | null => {\r\n const originalPrice = getOriginalPrice(props);\r\n const initialPrice = formatCurrency(props, originalPrice);\r\n let discountAmount = formatCurrency(props, props.data.price.DiscountAmount);\r\n let discountPrice = 0;\r\n if (props.data.price.CustomerContextualPrice && initialPrice !== undefined) {\r\n discountPrice = originalPrice - props.data.price.CustomerContextualPrice;\r\n discountAmount = formatCurrency(props, originalPrice - props.data.price.CustomerContextualPrice);\r\n }\r\n\r\n return (\r\n <>\r\n \r\n {props.originalPriceText} {initialPrice} {props.currentPriceText} {renderCurrentPrice(props)}\r\n \r\n \r\n\r\n \r\n {discountPrice > 0 ? Instant Savings: {discountAmount} : null}\r\n \r\n );\r\n};\r\n\r\nexport default Price;\r\n","import { IHeiBuyboxState, IHeiBuyboxV2Data } from '../hei-buybox-v2.data';\r\nimport { IHeiBuyboxV2Props } from '../hei-buybox-v2.props.autogenerated';\r\nimport Price from './price';\r\nimport * as React from 'react';\r\n\r\nexport function getBuyboxProductPrice(props: IHeiBuyboxV2Props, state: IHeiBuyboxState): React.ReactElement | undefined {\r\n const {\r\n id,\r\n typeName,\r\n context,\r\n resources,\r\n data: {\r\n attributeValues: { result: attributeValues }\r\n }\r\n } = props;\r\n\r\n return (\r\n state.productPrice && (\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 */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { getCatalogId, ICoreContext, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport {\r\n CommerceProperty,\r\n ProductCatalog,\r\n ProductDeliveryOptions,\r\n ProductDimensionValue,\r\n ProductDimensionValueInventoryAvailability,\r\n ProductPrice,\r\n ProductsDataActions,\r\n ProductWarehouseInventoryInformation,\r\n ReleasedProductType,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { BulkPurchase } from '@msdyn365-commerce-modules/bulk-purchase';\r\nimport {\r\n ArrayExtensions,\r\n DeliveryMode,\r\n FinitePromiseQueue,\r\n FinitePromiseQueueError,\r\n getDeliveryOptionsForSelectedVariant,\r\n GetDeliveryOptionsForSelectedVariantInput,\r\n getDimensionsForSelectedVariant,\r\n GetDimensionsForSelectedVariantInput,\r\n getInventoryLevelCodeFromDimensionValue,\r\n getPriceForSelectedVariant,\r\n getProductAvailabilitiesForSelectedVariant,\r\n getSelectedVariant,\r\n IDimensionsApp,\r\n IDimensionValueForSelectedVariant,\r\n InventoryLevelValues,\r\n IProductInventoryInformation,\r\n IPromiseQueue,\r\n PriceForSelectedVariantInput,\r\n ProductAvailabilitiesForSelectedVariantInput,\r\n SelectedVariantInput,\r\n mapProductInventoryInformation,\r\n createInventoryAvailabilitySearchCriteria,\r\n getDimensionValuesFromQuery,\r\n setDimensionValuesToQuery\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n Button,\r\n getTelemetryObject,\r\n IModuleProps,\r\n INodeProps,\r\n ITelemetryContent,\r\n updateMaxQuantityForCartLineItem\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\n\r\nimport {\r\n getBuyBoxInventoryLabel,\r\n getBuyboxKeyInPrice,\r\n getBuyboxProductAddToOrderTemplate,\r\n getBuyboxProductAddToWishlist,\r\n getBuyboxProductComparisonButton,\r\n getBuyboxProductDescription,\r\n getBuyboxProductQuantity,\r\n getBuyboxProductRating,\r\n getBuyboxProductTitle,\r\n getBuyboxProductUnitOfMeasure,\r\n getBuyboxShopSimilarButton,\r\n getQuantityLimitsMessages,\r\n RetailDefaultOrderQuantityLimitsFeatureName\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport { getBuyboxProductConfigure } from './components/buybox-product-configure';\r\nimport {\r\n IBuyboxAddToCartViewProps,\r\n IBuyboxAddToOrderTemplateViewProps,\r\n IBuyboxAddToWishlistViewProps,\r\n IBuyboxCommonData,\r\n IBuyboxExtentedProps,\r\n IBuyboxKeyInPriceViewProps,\r\n IBuyboxProductConfigureViewProps,\r\n IBuyboxProductQuantityViewProps,\r\n IBuyboxShopSimilarLookViewProps,\r\n IBuyboxState,\r\n IErrorState,\r\n ShopSimiliarButtonType\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport { IHeiBuyboxCallbacks, IHeiBuyboxState, IHeiBuyboxV2Data } from './hei-buybox-v2.data';\r\nimport { IHeiBuyboxV2Props, IHeiBuyboxV2Resources } from './hei-buybox-v2.props.autogenerated';\r\nimport { getBuyboxFindInStore, IBuyboxFindInStoreViewProps } from './components/hei-buybox-v2-find-in-store';\r\nimport { RecentlyViewedState } from '@msdyn365-commerce-modules/buybox';\r\nimport getProductPromotionsAction, { GetProductPromotionsInput } from '../../actions/get-product-promotions.action';\r\nimport { getApplicableWarrantiesAction, getApplicableWarrantiesInput } from '../../actions/get-applicable-warranties.action';\r\nimport { getBuyboxAddToCart } from '../hei-buybox/common/buybox-components';\r\nimport { mergeBonusProductInventoryInformation } from '../../actions/get-full-available-inventory-nearby.action';\r\nimport { IGetProductPromotionResponse } from '../../actions/DataServiceEntities.g';\r\nimport getMediaLocationsForSelectedVariantActionDataAction, {\r\n MediaLocationsForSelectedVariantInput\r\n} from '../../actions/get-media-locations-for-selected-variant.action';\r\nimport { getBuyboxProductPrice } from './components/getBuyboxProductPrice';\r\n\r\nexport interface IBuyboxViewProps extends IHeiBuyboxV2Props {\r\n state: IHeiBuyboxState;\r\n ModuleProps: IModuleProps;\r\n ProductInfoContainerProps: INodeProps;\r\n MediaGalleryContainerProps: INodeProps;\r\n callbacks: IHeiBuyboxCallbacks;\r\n mediaGallery?: React.ReactNode;\r\n title?: React.ReactNode;\r\n description?: React.ReactNode;\r\n rating?: React.ReactNode;\r\n price?: React.ReactNode;\r\n productComparisonButton?: React.ReactNode;\r\n bulkPurchaseLink?: React.ReactNode;\r\n addToOrderTemplate?: IBuyboxAddToOrderTemplateViewProps;\r\n addToWishlist?: IBuyboxAddToWishlistViewProps;\r\n max: number | undefined;\r\n addToCart: IBuyboxAddToCartViewProps;\r\n findInStore?: IBuyboxFindInStoreViewProps;\r\n quantity?: IBuyboxProductQuantityViewProps;\r\n configure?: IBuyboxProductConfigureViewProps;\r\n inventoryLabel?: React.ReactNode;\r\n shopSimilarLook?: IBuyboxShopSimilarLookViewProps;\r\n shopSimilarDescription?: IBuyboxShopSimilarLookViewProps;\r\n quantityLimitsMessages: React.ReactNode;\r\n telemetryContent?: ITelemetryContent;\r\n keyInPrice?: IBuyboxKeyInPriceViewProps;\r\n unitOfMeasure?: React.ReactNode;\r\n catalogs?: ProductCatalog[] | undefined;\r\n}\r\n\r\n/**\r\n * Buybox Module.\r\n */\r\nclass Buybox extends React.PureComponent, IHeiBuyboxState> {\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 private readonly dimensionUpdateQueue: IPromiseQueue = new FinitePromiseQueue(2);\r\n\r\n private dimensions: { [id: number]: string } = {};\r\n\r\n private readonly buyboxCallbacks: IHeiBuyboxCallbacks = {\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\r\n this.setState({ quantity: newQuantity, errorState });\r\n return true;\r\n },\r\n updateErrorState: (newErrorState: IErrorState): void => {\r\n this.setState({ errorState: newErrorState });\r\n },\r\n updateSelectedProduct: (\r\n newSelectedProduct: Promise,\r\n newInventory: IProductInventoryInformation | undefined,\r\n newPrice: ProductPrice | undefined,\r\n newDeliveryOptions: ProductDeliveryOptions | undefined\r\n ): void => {\r\n this.setState({\r\n selectedProduct: newSelectedProduct,\r\n productAvailableQuantity: newInventory,\r\n productDeliveryOptions: newDeliveryOptions\r\n });\r\n this._updatePrice(newPrice);\r\n },\r\n dimensionSelectedAsync: async (selectedDimensionId: number, selectedDimensionValueId: string): Promise => {\r\n const selecedDimensions: Record = {};\r\n selecedDimensions[selectedDimensionId] = selectedDimensionValueId;\r\n return this.buyboxCallbacks.dimensionsSelectedAsync(selecedDimensions);\r\n },\r\n dimensionsSelectedAsync: async (selecedDimensions: Record): Promise => {\r\n Object.keys(selecedDimensions).forEach(\r\n selectedDimensionId => (this.dimensions[+selectedDimensionId] = selecedDimensions[selectedDimensionId])\r\n );\r\n\r\n process.env.NODE_ENV === 'development' && console.log('Buybox', 'dimensionsSelectedAsync', selecedDimensions, this.dimensions);\r\n return this.dimensionUpdateQueue\r\n .enqueue(async () => {\r\n return this._updateDimensions();\r\n })\r\n .catch((error: unknown) => {\r\n // Ignore discarded processes.\r\n if (error !== FinitePromiseQueueError.ProcessWasDiscardedFromTheQueue) {\r\n throw error;\r\n }\r\n });\r\n },\r\n getDropdownName: (dimensionType: number, resources: IHeiBuyboxV2Resources): 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 });\r\n },\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\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 });\r\n this._updatePrice(this.state.productPrice, customPrice);\r\n },\r\n\r\n setSelectedWarranty: (warranty: SimpleProduct | null): void => {\r\n this.setState({ selectedWarranty: warranty });\r\n }\r\n };\r\n\r\n private readonly telemetryContent: ITelemetryContent;\r\n\r\n private readonly mountCategories: { [category: string]: boolean } = {};\r\n private readonly packSizeCategories: { [category: string]: boolean } = {};\r\n\r\n public constructor(props: IHeiBuyboxV2Props, state: IBuyboxState) {\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\r\n modalOpen: false,\r\n isUpdatingDimension: false,\r\n isUpdatingDeliveryOptions: false,\r\n selectedWarranty: null,\r\n productPromotions: undefined,\r\n storeAvailabilities: undefined,\r\n applicableWarranties: undefined,\r\n mediaLocations: undefined\r\n };\r\n this.telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.friendlyName, props.telemetry);\r\n\r\n if (props.config.mountCategories) {\r\n for (const c of props.config.mountCategories.split('|')) {\r\n this.mountCategories[c] = true;\r\n }\r\n }\r\n\r\n if (props.config.packSizeCategories === 'string') {\r\n for (const c of props.config.packSizeCategories.split('|')) {\r\n this.packSizeCategories[c] = true;\r\n }\r\n }\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n const {\r\n data: {\r\n product: { result: product },\r\n productPromotions,\r\n applicableWarranties,\r\n productPrice,\r\n allDimensions\r\n },\r\n context\r\n } = this.props;\r\n\r\n const matchedDimensions = getDimensionValuesFromQuery(context.request.url.requestUrl);\r\n await allDimensions.then(async productDimensionsData => {\r\n let dimensionUpdated = false;\r\n for (const productDimensionFull of productDimensionsData) {\r\n if (!ArrayExtensions.hasElements(productDimensionFull.DimensionValues)) {\r\n continue;\r\n }\r\n\r\n const dropdownId = productDimensionFull.DimensionTypeValue.toString();\r\n const dimensionFromQuery = matchedDimensions.find(\r\n dimensionFromQuery => dimensionFromQuery.DimensionTypeValue.toString() === dropdownId\r\n );\r\n\r\n // no dimension selected from URL\r\n if (!dimensionFromQuery) {\r\n let autoSelectValue = productDimensionFull.dimensionValuesWithInventory?.find(\r\n dvi => dvi.PhysicalAvailableInventoryLevelCode !== 'OOS'\r\n )?.DimensionValue;\r\n\r\n if (!autoSelectValue) {\r\n // style or condition, try to select '9'\r\n if (productDimensionFull.DimensionTypeValue === 4) {\r\n autoSelectValue =\r\n productDimensionFull.DimensionValues.find(dv => dv.Value === '9') ??\r\n productDimensionFull.DimensionValues[0];\r\n } else {\r\n autoSelectValue = productDimensionFull.DimensionValues[0];\r\n }\r\n }\r\n\r\n process.env.NODE_ENV === 'development' && console.log('Buybox dim', dropdownId, '=>', autoSelectValue.Value);\r\n\r\n this.dimensions[productDimensionFull.DimensionTypeValue] = autoSelectValue.RecordId.toString();\r\n dimensionUpdated = true;\r\n }\r\n }\r\n\r\n process.env.NODE_ENV === 'development' &&\r\n console.log('Buybox dim', 'matchedDimensions', matchedDimensions, this.dimensions, 'updated=', dimensionUpdated);\r\n\r\n if (dimensionUpdated) {\r\n process.env.NODE_ENV === 'development' && console.log('Buybox auto select dim', dimensionUpdated);\r\n await this._updateDimensions();\r\n }\r\n });\r\n\r\n await productPrice.then(async result => {\r\n this._updatePrice(result);\r\n });\r\n\r\n if (product) {\r\n // Check if the product is service or not by product type\r\n if (product.ItemTypeValue === ReleasedProductType.Service) {\r\n this.setState({ isServiceItem: true });\r\n }\r\n await this._updateQuantitiesInState(product);\r\n }\r\n\r\n if (product && context.app.config.maxRecentlyViewedItemsCount > 0) {\r\n RecentlyViewedState.instance(this.props.context, context.app.config.maxRecentlyViewedItemsCount, product.RecordId);\r\n }\r\n\r\n await productPromotions.then(async result => {\r\n this.setState({ productPromotions: result });\r\n });\r\n\r\n await applicableWarranties.then(async result => {\r\n this.setState({ applicableWarranties: result });\r\n });\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const {\r\n slots: { mediaGallery, productComparisonButton },\r\n data: {\r\n product: { result: product }\r\n },\r\n config: { className = '' }\r\n } = this.props;\r\n\r\n const { max } = this.state;\r\n\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\r\n const props = this.props as IBuyboxExtentedProps;\r\n const defaultMinimumKeyInPrice = 10;\r\n const defaultMaximumKeyInPrice = 100;\r\n\r\n const context = this.props.context as ICoreContext;\r\n const inventoryLevel = context.app.config.inventoryLevel;\r\n const dimensionValuesWithInventory = ArrayExtensions.flatten(\r\n ArrayExtensions.validValues(this.props.data.allDimensions.result?.map(value => value.dimensionValuesWithInventory))\r\n );\r\n const hasAvailableProducts =\r\n !ArrayExtensions.hasElements(dimensionValuesWithInventory) ||\r\n dimensionValuesWithInventory.some((value: unknown) => {\r\n const inventoryLevelCode = getInventoryLevelCodeFromDimensionValue(\r\n value as ProductDimensionValueInventoryAvailability,\r\n inventoryLevel\r\n );\r\n return inventoryLevelCode !== InventoryLevelValues.outOfStock;\r\n });\r\n const catalogId = getCatalogId(this.props.context.request);\r\n\r\n const hasSerialNumber = product?.Behavior?.HasSerialNumber || false;\r\n\r\n const viewProps: IBuyboxViewProps = {\r\n ...(this.props as IHeiBuyboxV2Props),\r\n state: this.state,\r\n mediaGallery: mediaGallery && mediaGallery.length > 0 ? mediaGallery[0] : undefined,\r\n ModuleProps: {\r\n moduleProps: this.props,\r\n className: classnames('ms-buybox', 'hei-buybox-v2', 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),\r\n description: getBuyboxProductDescription(props),\r\n bulkPurchaseLink: this._renderBuyboxBulkPurchaseLink(),\r\n unitOfMeasure: getBuyboxProductUnitOfMeasure(props),\r\n configure: getBuyboxProductConfigure(\r\n props,\r\n this.state,\r\n this.buyboxCallbacks,\r\n undefined,\r\n undefined,\r\n this.props.data.allDimensions.result\r\n ),\r\n findInStore: getBuyboxFindInStore(this.props, this.state, this.buyboxCallbacks),\r\n price: getBuyboxProductPrice(this.props, this.state),\r\n addToCart: getBuyboxAddToCart(\r\n props,\r\n this.state,\r\n this.buyboxCallbacks,\r\n defaultMinimumKeyInPrice,\r\n defaultMaximumKeyInPrice,\r\n undefined,\r\n hasAvailableProducts,\r\n this.state.productPromotions?.FreeItemProductIds\r\n ),\r\n productComparisonButton: ArrayExtensions.hasElements(productComparisonButton)\r\n ? getBuyboxProductComparisonButton(\r\n productComparisonButton[0],\r\n product,\r\n getCatalogId(this.props.context.request),\r\n this.state\r\n )\r\n : undefined,\r\n addToOrderTemplate: getBuyboxProductAddToOrderTemplate(props, this.state, this.buyboxCallbacks),\r\n addToWishlist: getBuyboxProductAddToWishlist(props, this.state, this.buyboxCallbacks),\r\n rating: !props.context.app.config.hideRating && getBuyboxProductRating(props),\r\n quantity: product.IsGiftCard || hasSerialNumber ? undefined : getBuyboxProductQuantity(props, this.state, this.buyboxCallbacks),\r\n inventoryLabel: getBuyBoxInventoryLabel(props),\r\n shopSimilarLook:\r\n this.props.config.enableShopSimilarLooks && !product.IsGiftCard\r\n ? getBuyboxShopSimilarButton(props, ShopSimiliarButtonType.Looks)\r\n : undefined,\r\n shopSimilarDescription:\r\n this.props.config.enableShopSimilarDescription && !product.IsGiftCard\r\n ? getBuyboxShopSimilarButton(props, ShopSimiliarButtonType.Description)\r\n : undefined,\r\n keyInPrice:\r\n this.props.config.enableKeyInPrice && this.state.isCustomPriceSelected\r\n ? getBuyboxKeyInPrice(props, this.state, this.buyboxCallbacks)\r\n : undefined,\r\n quantityLimitsMessages: getQuantityLimitsMessages(props, this.state),\r\n max,\r\n catalogs: this._validateCatalogDetails(catalogId)\r\n };\r\n\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n /**\r\n * Handles anchor click event and scrolls to the given bulk purchase module.\r\n * @param bulkPurchaseModule - Bulk purchase module.\r\n * @returns Handler.\r\n */\r\n private readonly _onBulkPurchaseLinkClick = (bulkPurchaseModule: Element) => () => {\r\n const boundingRect = bulkPurchaseModule.getBoundingClientRect();\r\n window.scrollTo(boundingRect.left, boundingRect.top);\r\n };\r\n\r\n private _renderBuyboxBulkPurchaseLink(): React.ReactNode {\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Temporary switch for the feature which is under development.\r\n if (!this.props.context.app.config.isBulkPurchaseEnabled) {\r\n return null;\r\n }\r\n\r\n if (!msdyn365Commerce.isBrowser) {\r\n return null;\r\n }\r\n\r\n const bulkPurchaseModules = Array.from(document.getElementsByClassName(BulkPurchase.className));\r\n\r\n if (!ArrayExtensions.hasElements(bulkPurchaseModules)) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n {this.props.resources.bulkPurchaseLinkText}\r\n \r\n );\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 }\r\n\r\n private _getProductVariant(dimensionsToUpdate: { [id: number]: string }) {\r\n const {\r\n data: {\r\n product: { result: product }\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\r\n const productDimensions = this.props.data.allDimensions.result!;\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 mappedDimensions = productDimensions\r\n .map(dimension => {\r\n const dimensions = (dimension.dimensionValuesWithInventory ??\r\n dimension.DimensionValues ??\r\n []) as IDimensionValueForSelectedVariant[];\r\n return {\r\n DimensionTypeValue: dimension.DimensionTypeValue,\r\n DimensionValue:\r\n dimensions.find(\r\n value => value.DimensionValue?.RecordId.toString() === dimensionsToUpdate[dimension.DimensionTypeValue]\r\n )?.DimensionValue ?? dimension.DimensionValue,\r\n ExtensionProperties: dimension.ExtensionProperties\r\n };\r\n })\r\n .filter(dimension => dimension.DimensionValue);\r\n setDimensionValuesToQuery(this.props.context.actionContext.requestContext.url.requestUrl, mappedDimensions);\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 selectedProductPromise = getSelectedVariant(\r\n new SelectedVariantInput(\r\n product!.MasterProductId ? product!.MasterProductId : product!.RecordId,\r\n channelId,\r\n undefined,\r\n undefined,\r\n this.props.context.request\r\n ),\r\n actionContext\r\n );\r\n this.setState({ selectedProduct: selectedProductPromise });\r\n\r\n return { productVariantPromise: selectedProductPromise, mappedDimensions };\r\n }\r\n\r\n private readonly _updateDimensions = async (): Promise => {\r\n const product = this.props.data.product.result;\r\n\r\n const productDimensions = this.props.data.allDimensions.result;\r\n\r\n const hasProductDimensions = ArrayExtensions.hasElements(productDimensions);\r\n\r\n if (!product || !hasProductDimensions) {\r\n return;\r\n }\r\n\r\n const dimensionsToUpdate: { [id: number]: string } = { ...this.dimensions };\r\n this.setState({ isUpdatingDimension: true, isUpdatingDeliveryOptions: true });\r\n\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 this.setState(previousState => {\r\n const errorState = previousState.errorState;\r\n errorState.configureErrors[key] = undefined;\r\n return { errorState };\r\n });\r\n }\r\n }\r\n\r\n const data = this._getProductVariant(dimensionsToUpdate);\r\n const productVariant: SimpleProduct | null = await data.productVariantPromise;\r\n process.env.NODE_ENV === 'development' && console.log('Buybox', 'productVariant', JSON.parse(JSON.stringify(productVariant)));\r\n\r\n if (!productVariant) {\r\n return;\r\n }\r\n\r\n const promises: Promise[] = [\r\n this._getDimensionsForSelectedVariant(productVariant, data.mappedDimensions),\r\n this._hydrateInventoryInfo(productVariant),\r\n this._hydratePrice(productVariant),\r\n this._hydrateDeliveryOptions(productVariant),\r\n this._updateQuantitiesInState(productVariant),\r\n this._updatePromotions(productVariant),\r\n this._updateWarranties(productVariant),\r\n this._updateSelectedProduct(productVariant),\r\n this._mediaLocations(productVariant)\r\n ];\r\n\r\n await Promise.all(promises);\r\n };\r\n\r\n private async _getDimensionsForSelectedVariant(\r\n productVariant: SimpleProduct,\r\n mappedDimensions: {\r\n /* eslint-disable @typescript-eslint/naming-convention -- Retail proxy values */\r\n DimensionTypeValue: number;\r\n DimensionValue: ProductDimensionValue | undefined;\r\n ExtensionProperties: CommerceProperty[] | undefined;\r\n /* eslint-enable @typescript-eslint/naming-convention -- Retail proxy values */\r\n }[]\r\n ): Promise {\r\n await getDimensionsForSelectedVariant(\r\n new GetDimensionsForSelectedVariantInput(\r\n productVariant.MasterProductId ? productVariant.MasterProductId : productVariant.RecordId,\r\n this.props.context.request.apiSettings.channelId,\r\n mappedDimensions,\r\n this.props.context.request\r\n ),\r\n this.props.context.actionContext\r\n );\r\n }\r\n\r\n private async _hydrateInventoryInfo(productVariant: SimpleProduct): Promise {\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(productVariant.RecordId, this.props.context.request.apiSettings.channelId),\r\n this.props.context.actionContext\r\n );\r\n\r\n const newShippingQuantity = newAvailableQuantity?.find(\r\n // @ts-expect-error\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (shipping: { deliveryType: any }) => shipping.deliveryType === DeliveryMode.shipping\r\n );\r\n const isCustomPriceSelected = productVariant.Dimensions?.find(\r\n dimension =>\r\n dimension.DimensionTypeValue === 4 && dimension.DimensionValue && dimension.DimensionValue.Value?.toLowerCase() === 'custom'\r\n );\r\n if (isCustomPriceSelected) {\r\n this.setState({ isCustomPriceSelected: true });\r\n } else {\r\n this.setState(previousState => {\r\n const errorState = previousState.errorState;\r\n errorState.customAmountError = undefined;\r\n return { isCustomPriceSelected: false, isPriceKeyedIn: false, errorState };\r\n });\r\n }\r\n\r\n if (newShippingQuantity) {\r\n this.setState({ productAvailableQuantity: newShippingQuantity });\r\n } else {\r\n this.setState({ productAvailableQuantity: undefined });\r\n }\r\n }\r\n\r\n private async _hydratePrice(productVariant: SimpleProduct): Promise {\r\n // Step 6. Use these dimensions hydrate the product price.\r\n const newPrice = await getPriceForSelectedVariant(\r\n new PriceForSelectedVariantInput(productVariant.RecordId, this.props.context.request.apiSettings.channelId),\r\n this.props.context.actionContext\r\n );\r\n\r\n if (newPrice) {\r\n this._updatePrice(newPrice);\r\n }\r\n }\r\n\r\n private async _hydrateDeliveryOptions(productVariant: SimpleProduct): Promise {\r\n const retailMultiplePickupFeatureState = this.props.data.featureState.result?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature'\r\n );\r\n\r\n // Step 7. Use these dimensions hydrate the product delivery options.\r\n const newDeliveryOptions = await getDeliveryOptionsForSelectedVariant(\r\n new GetDeliveryOptionsForSelectedVariantInput(\r\n productVariant.RecordId,\r\n this.props.context.request.apiSettings.channelId,\r\n undefined,\r\n undefined,\r\n retailMultiplePickupFeatureState?.IsEnabled\r\n ),\r\n this.props.context.actionContext\r\n );\r\n\r\n if (newDeliveryOptions) {\r\n this.setState({ productDeliveryOptions: newDeliveryOptions });\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 min: product.Behavior?.MinimumQuantity || 1,\r\n\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 : updateMaxQuantityForCartLineItem(this.props.context.app.config.maxQuantityForCartLineItem)\r\n });\r\n } else {\r\n this.setState({\r\n min: 1,\r\n max: updateMaxQuantityForCartLineItem(this.props.context.app.config.maxQuantityForCartLineItem)\r\n });\r\n }\r\n }\r\n\r\n private readonly _getDropdownName = (dimensionType: number, resources: IHeiBuyboxV2Resources): string => {\r\n const isGiftCard = this.props.data.product.result?.IsGiftCard;\r\n\r\n const leafCategories = this.props.data.product.result?.ExtensionProperties?.find(p => p.Key === 'LeafCategories')?.Value\r\n ?.StringValue;\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 if (leafCategories) {\r\n for (const leafCategory of leafCategories.split('|')) {\r\n if (this.mountCategories[leafCategory]) {\r\n return resources.productDimensionTypeMount;\r\n }\r\n }\r\n }\r\n\r\n return resources.productDimensionTypeSize;\r\n case 4: // ProductDimensionType.Style\r\n if (leafCategories) {\r\n for (const leafCategory of leafCategories.split('|')) {\r\n if (this.packSizeCategories[leafCategory]) {\r\n return resources.productDimensionTypePackSize;\r\n }\r\n }\r\n }\r\n\r\n return isGiftCard ? resources.productDimensionTypeAmount : resources.productDimensionTypeStyle;\r\n default:\r\n return '';\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 const featureStatuses = await this.props.data.featureState;\r\n const isFeatureEnabledInHq = featureStatuses?.find(\r\n featureState => featureState.Name === RetailDefaultOrderQuantityLimitsFeatureName\r\n )?.IsEnabled;\r\n if (!isFeatureEnabledInHq) {\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 _validateCatalogDetails(catalogId: number): ProductCatalog[] | undefined {\r\n const catalogs = this.props.data.catalogs?.result?.filter(item => item.RecordId === catalogId);\r\n if (ArrayExtensions.hasElements(catalogs) && catalogs[0].RecordId === 0) {\r\n return;\r\n }\r\n\r\n return catalogs;\r\n }\r\n\r\n private async _updateAvailableForPickup(productVariant: SimpleProduct, promotions: IGetProductPromotionResponse) {\r\n const ctx = this.props.context.actionContext;\r\n const bonusItemIds = promotions.FreeItemProductIds ?? [];\r\n const searchCriteria = createInventoryAvailabilitySearchCriteria(\r\n ctx,\r\n [productVariant.RecordId, ...bonusItemIds],\r\n false,\r\n true,\r\n {},\r\n DeliveryMode.pickup\r\n );\r\n\r\n const productInventoryInformation = await ProductsDataActions.getEstimatedAvailabilityAsync(\r\n { callerContext: ctx },\r\n searchCriteria\r\n ).then(async (productWarehouseInformation: ProductWarehouseInventoryInformation) => {\r\n // For store selector, inventory should always come from an individual store\r\n const productInventoryInformation = mapProductInventoryInformation(\r\n ctx,\r\n productWarehouseInformation.ProductWarehouseInventoryAvailabilities\r\n );\r\n\r\n process.env.NODE_ENV === 'development' && console.log('getFullAvailableInventoryNearbyAction', productInventoryInformation);\r\n\r\n return mergeBonusProductInventoryInformation(productInventoryInformation, productVariant.RecordId, bonusItemIds);\r\n });\r\n\r\n // Ensure inventory data is for the selected variant\r\n if (productVariant.RecordId === this.state.productVariantData?.RecordId) {\r\n const storeAvailabilities = productInventoryInformation?.filter(a => (a.ProductAvailableQuantity.AvailableQuantity ?? 0) > 0);\r\n\r\n process.env.NODE_ENV === 'development' &&\r\n console.log(\r\n 'Buybox',\r\n 'storeAvailabilities',\r\n productVariant.RecordId,\r\n JSON.parse(JSON.stringify(storeAvailabilities)),\r\n JSON.parse(JSON.stringify(productInventoryInformation))\r\n );\r\n\r\n this.setState({ storeAvailabilities: storeAvailabilities });\r\n }\r\n }\r\n\r\n private async _updatePromotions(productVariant: SimpleProduct) {\r\n const product = this.props.data.product.result;\r\n\r\n if (product) {\r\n const promotions = await getProductPromotionsAction(\r\n new GetProductPromotionsInput(product.RecordId, productVariant.Dimensions ?? []),\r\n this.props.context.actionContext\r\n );\r\n\r\n process.env.NODE_ENV === 'development' && console.log('Buybox', 'productPromotions', promotions);\r\n this.setState({ productPromotions: promotions });\r\n\r\n const productPromotionsChangeEvent = new CustomEvent('onProductPromotionsChange', {\r\n detail: promotions\r\n });\r\n\r\n window.dispatchEvent(productPromotionsChangeEvent);\r\n\r\n await this._updateAvailableForPickup(productVariant, promotions);\r\n }\r\n }\r\n\r\n private async _updateWarranties(productVariant: SimpleProduct) {\r\n const product = this.props.data.product.result;\r\n\r\n if (product) {\r\n const applicableWarranties = await getApplicableWarrantiesAction(\r\n new getApplicableWarrantiesInput(product.RecordId, productVariant.Dimensions ?? []),\r\n this.props.context.actionContext\r\n );\r\n\r\n let selectedWarranty = this.state.selectedWarranty;\r\n\r\n if (!ArrayExtensions.hasElements(applicableWarranties)) {\r\n // no applicable warranties for the selected variant\r\n selectedWarranty = null;\r\n } else if (selectedWarranty) {\r\n // different set of warranties for the selected variant\r\n if (!Boolean(applicableWarranties[0].Warranties?.find(aw => aw.RecordId === selectedWarranty!.RecordId))) {\r\n selectedWarranty = null;\r\n }\r\n }\r\n\r\n this.setState({ applicableWarranties: applicableWarranties, selectedWarranty: selectedWarranty });\r\n }\r\n }\r\n\r\n private async _mediaLocations(productVariant: SimpleProduct) {\r\n const input = new MediaLocationsForSelectedVariantInput(\r\n productVariant.RecordId,\r\n this.props.context.actionContext.requestContext.apiSettings.channelId,\r\n productVariant,\r\n this.props.context.actionContext.requestContext.apiSettings.catalogId\r\n );\r\n\r\n const mediaLocations = await getMediaLocationsForSelectedVariantActionDataAction(input, this.props.context.actionContext);\r\n process.env.NODE_ENV === 'development' && console.log('_mediaLocations', JSON.parse(JSON.stringify(mediaLocations)));\r\n this.setState({ mediaLocations: mediaLocations ?? [] });\r\n }\r\n\r\n private async _updateSelectedProduct(productVariant: SimpleProduct) {\r\n this.setState({ productVariantData: productVariant });\r\n }\r\n}\r\n\r\nexport default Buybox;\r\n","import React from 'react';\r\nimport { IRequestContext } from '@msdyn365-commerce/core';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { generateImageUrl } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\nconst AuthorizedDealerBadge = ({ product, requestContext }: { product?: SimpleProduct; requestContext: IRequestContext }) => {\r\n const brand = React.useMemo(() => {\r\n const brandFromExt = product?.ExtensionProperties?.find(p => p.Key === 'Brand')?.Value?.StringValue;\r\n if (brandFromExt) {\r\n return brandFromExt;\r\n }\r\n\r\n return null;\r\n }, [product]);\r\n\r\n if (brand && requestContext.gridSettings) {\r\n const locale = requestContext.locale;\r\n const fileName = `Catalogs/${locale}/${brand.toUpperCase()}_AuthDLR_${locale}.png`;\r\n const categoryImageUrl = generateImageUrl(fileName, requestContext.apiSettings);\r\n\r\n if (categoryImageUrl) {\r\n const ImageData: Msdyn365.IImageData = { src: categoryImageUrl };\r\n return (\r\n
\r\n \r\n
\r\n );\r\n }\r\n }\r\n\r\n return null;\r\n};\r\n\r\nexport { AuthorizedDealerBadge };\r\n","import React from 'react';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\nconst ProductCode = ({\r\n product,\r\n resources\r\n}: {\r\n product?: SimpleProduct;\r\n resources: {\r\n webCodeLabel: string;\r\n mfrCodeLabel: string;\r\n };\r\n}) => {\r\n const [itemId, mfrCode] = React.useMemo(() => {\r\n const mfrCode = product?.ExtensionProperties?.find(p => p.Key === 'MfrCode')?.Value?.StringValue;\r\n return [product?.ItemId, mfrCode];\r\n }, [product]);\r\n\r\n return (\r\n \r\n {resources.webCodeLabel}: {itemId ?? ''}\r\n {mfrCode && ` ${String.fromCharCode(183)} ${resources.mfrCodeLabel}: ${mfrCode}`}\r\n \r\n );\r\n};\r\n\r\nexport { ProductCode };\r\n","import React, { useMemo } from 'react';\r\nimport { IRequestContext } from '@msdyn365-commerce/core';\r\nimport { AttributeValue, ProductPrice } from '@msdyn365-commerce/retail-proxy';\r\nimport { buildProductBadgeUrl } from '../../../common/utilities/productListExtensionHelpers';\r\n\r\nconst ProductBadge = ({\r\n attributeValues,\r\n productPrice,\r\n requestContext\r\n}: {\r\n attributeValues?: AttributeValue[];\r\n requestContext: IRequestContext;\r\n productPrice?: ProductPrice;\r\n}) => {\r\n const badgeValue = useMemo(() => {\r\n const discountAmount = productPrice?.DiscountAmount;\r\n if (discountAmount && discountAmount > 0) {\r\n process.env.NODE_ENV === 'development' && console.log('onsale', 'show', discountAmount);\r\n return 'on_sale';\r\n }\r\n\r\n var badgeAttr = attributeValues?.find(\r\n av => av.Name === 'Product Badge Status' && av.TextValue && av.TextValue.toLocaleLowerCase() !== 'none'\r\n );\r\n return badgeAttr?.TextValue ?? null;\r\n }, [productPrice, attributeValues]);\r\n\r\n if (badgeValue) {\r\n const badgeUrl = buildProductBadgeUrl(requestContext.locale, badgeValue, requestContext.apiSettings.baseImageUrl, '_PDP');\r\n const badgeName = badgeValue.replace(/_/, ' ');\r\n return {badgeName};\r\n }\r\n\r\n return null;\r\n};\r\n\r\nexport { ProductBadge };\r\n","import React, { useMemo } from 'react';\r\nimport { IProductPromotion } from '../../../actions/DataServiceEntities.g';\r\n\r\ntype Props = {\r\n sitePath?: string;\r\n promotions?: IProductPromotion[];\r\n};\r\n\r\nconst Promotions = ({ sitePath, promotions }: Props) => {\r\n const importantPromos = useMemo(() => {\r\n return promotions?.filter(p => p.IsImportant) ?? [];\r\n }, [promotions]);\r\n\r\n if (promotions && promotions.length > 0) {\r\n const heading = promotions.length > 1 ? `${promotions.length} Special Offers Available!` : '1 Special Offer Available!';\r\n return (\r\n
\r\n
{heading}
\r\n {importantPromos.length > 0 && (\r\n
    \r\n {importantPromos\r\n .filter(p => p.IsImportant)\r\n .map(o => {\r\n return (\r\n
  • \r\n {o.Name}\r\n
  • \r\n );\r\n })}\r\n
\r\n )}\r\n \r\n See all offers\r\n \r\n
\r\n );\r\n }\r\n\r\n return null;\r\n};\r\n\r\nexport { Promotions };\r\n","import React, { useMemo } from 'react';\r\nimport { ICoreContext, Image, IImageData } from '@msdyn365-commerce/core';\r\nimport { SimpleProduct, Warranty, WarrantyGroup } from '@msdyn365-commerce/retail-proxy';\r\nimport classnames from 'classnames';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { makeAbsUrl } from '../../../common/utilities/makeAbsUrl';\r\n\r\ntype Props = {\r\n warrantyGroups?: WarrantyGroup[];\r\n logo?: IImageData;\r\n\r\n selectedWarranty: SimpleProduct | null;\r\n setSelectedWarranty: (warranty: SimpleProduct | null) => void;\r\n coreContext: ICoreContext;\r\n};\r\n\r\nconst WarrantyOptionButton = (props: {\r\n warranty: Warranty;\r\n isSelected: boolean;\r\n coreContext: ICoreContext;\r\n onClick: (warranty: SimpleProduct | null) => void;\r\n}) => {\r\n const { warranty, isSelected, coreContext, onClick } = props;\r\n const unit = warranty.DurationUnitValue ?? 0;\r\n const duration = warranty.Duration ?? 0;\r\n const label =\r\n unit === 1\r\n ? duration > 1\r\n ? 'Days'\r\n : 'Day'\r\n : unit === 2\r\n ? duration > 1\r\n ? 'Months'\r\n : 'Month'\r\n : unit === 3\r\n ? duration > 1\r\n ? 'Years'\r\n : 'Year'\r\n : '';\r\n\r\n const formatedPrice = useMemo(() => coreContext.cultureFormatter.formatCurrency(warranty.AdjustedPrice || warranty.BasePrice), [\r\n warranty,\r\n coreContext\r\n ]);\r\n\r\n return (\r\n onClick(warranty)}\r\n >\r\n {`${duration} ${label}`}\r\n {formatedPrice}\r\n \r\n );\r\n};\r\n\r\nconst WarrantySection = ({ warrantyGroups, logo, setSelectedWarranty, selectedWarranty, coreContext }: Props) => {\r\n const { actionContext } = coreContext;\r\n const warranties = ArrayExtensions.hasElements(warrantyGroups) ? warrantyGroups[0].Warranties : undefined;\r\n\r\n if (!warranties) {\r\n return null;\r\n }\r\n\r\n return (\r\n
\r\n
\r\n
\r\n
\r\n
\r\n {logo && (\r\n \r\n )}\r\n
\r\n
Henry's Extended Life Plan
\r\n
\r\n \r\n View all benefits\r\n \r\n
\r\n
\r\n
\r\n {warranties.map((w, idx) => (\r\n setSelectedWarranty(w)}\r\n />\r\n ))}\r\n setSelectedWarranty(null)}\r\n >\r\n {`No coverage`}\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n );\r\n};\r\n\r\nexport { WarrantySection };\r\n","import React, { useEffect, useState } from 'react';\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { IDimensionForSelectedVariant, ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { ProductsDataActions, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport getAllDimensionsForProductActionDataAction, {\r\n GetAllDimensionsForProductInput\r\n} from '../../../actions/get-all-dimensions-for-product';\r\nimport { getProductVariantUrl } from '../../../common/getProductVariantUrl';\r\n\r\nconst ShopUsed = ({\r\n product,\r\n resources,\r\n context\r\n}: {\r\n product?: SimpleProduct;\r\n context: IActionContext;\r\n resources: {\r\n shopUsedText: string;\r\n };\r\n}) => {\r\n const [usedProductUrl, setUsedProductUrl] = useState('');\r\n const [recId, itemId] = React.useMemo(() => {\r\n const values = product?.ExtensionProperties?.find(ep => ep.Key === 'UsedSku')?.Value?.StringValue?.split(':');\r\n\r\n return values && values.length === 2 ? [+values[0], values[1]] : [0, null];\r\n }, [product]);\r\n\r\n useEffect(() => {\r\n setUsedProductUrl('');\r\n if (!recId) {\r\n return;\r\n }\r\n\r\n const input = new GetAllDimensionsForProductInput(recId, context.requestContext.apiSettings.channelId);\r\n void getAllDimensionsForProductActionDataAction(input, context)\r\n .then((dimensions: IDimensionForSelectedVariant[]) => {\r\n const validProducts: Record> = {};\r\n\r\n dimensions.forEach(d => {\r\n d.dimensionValuesWithInventory?.forEach(inv => {\r\n inv.ProductIds?.forEach(variantId => {\r\n const variantDims = validProducts[variantId] ?? (validProducts[variantId] = {});\r\n variantDims[d.DimensionTypeValue] = inv.DimensionValue?.Value ?? '';\r\n });\r\n });\r\n });\r\n\r\n var variantId = ArrayExtensions.firstOrDefault(\r\n Object.keys(validProducts).filter(variantId => Object.keys(validProducts[variantId]).length === dimensions.length)\r\n );\r\n\r\n return variantId ? +variantId : 0;\r\n })\r\n .then(variantId => {\r\n if (variantId) {\r\n void ProductsDataActions.getByIdAsync(\r\n { callerContext: context },\r\n +variantId,\r\n context.requestContext.apiSettings.channelId\r\n ).then(productDetails => {\r\n const usedProductUrl = getProductVariantUrl(productDetails, context);\r\n setUsedProductUrl(usedProductUrl);\r\n });\r\n }\r\n });\r\n }, [context, recId]);\r\n\r\n if (!usedProductUrl) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport { ShopUsed };\r\n","import { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport { Image, IImageData } from '@msdyn365-commerce/core';\r\nimport * as React from 'react';\r\n\r\nimport { IBuyboxAddToCartViewProps } from '@msdyn365-commerce-modules/buybox';\r\nimport { IBuyboxViewProps } from '../hei-buybox-v2';\r\nimport { ProductCode } from './ProductCode';\r\nimport classnames from 'classnames';\r\nimport { ArrayExtensions, getFallbackImageUrl } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\nconst FloatingSummary = ({\r\n addToCart,\r\n price,\r\n title,\r\n data: { product },\r\n isInViewport,\r\n state,\r\n context,\r\n resources\r\n}: IBuyboxViewProps & { isInViewport: boolean }) => {\r\n const { mediaLocations } = state;\r\n\r\n const image: IImageData | null = ArrayExtensions.hasElements(mediaLocations)\r\n ? {\r\n src: mediaLocations[0].Uri,\r\n altText: mediaLocations[0].AltText\r\n }\r\n : null;\r\n\r\n const fallbackImageUrl = getFallbackImageUrl(product.result?.ItemId, context.actionContext.requestContext.apiSettings);\r\n\r\n return (\r\n \r\n
\r\n {image && (\r\n
\r\n \r\n
\r\n )}\r\n
\r\n
\r\n {title}\r\n \r\n
\r\n
{price}
\r\n
\r\n
{addToCart && _renderAddToCart(addToCart)}
\r\n
\r\n \r\n );\r\n};\r\n\r\nconst _renderAddToCart = (addToCart: IBuyboxAddToCartViewProps): JSX.Element => {\r\n const { ContainerProps, errorBlock, button } = addToCart;\r\n\r\n return (\r\n \r\n {errorBlock}\r\n {button}\r\n \r\n );\r\n};\r\n\r\nexport { FloatingSummary };\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport {\r\n IBuyboxAddToCartViewProps,\r\n IBuyboxAddToOrderTemplateViewProps,\r\n IBuyboxAddToWishlistViewProps,\r\n IBuyboxKeyInPriceViewProps,\r\n IBuyboxProductConfigureDropdownViewProps,\r\n IBuyboxProductConfigureViewProps,\r\n IBuyboxProductQuantityViewProps,\r\n IBuyboxShopSimilarLookViewProps\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport { ArrayExtensions, DeliveryMode } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { IBuyboxViewProps } from './hei-buybox-v2';\r\nimport { IBuyboxFindInStoreViewProps } from './components/hei-buybox-v2-find-in-store';\r\nimport { AuthorizedDealerBadge } from './components/AuthorizedDealerBadge';\r\nimport { ProductCode } from './components/ProductCode';\r\nimport { ProductBadge } from './components/ProductBadge';\r\nimport Bazzarvoice from '../bazzarvoice-widget/components/Bazzarvoice';\r\nimport { widgetType } from '../bazzarvoice-widget/bazzarvoice-widget.props.autogenerated';\r\nimport { Promotions } from './components/Promotions';\r\nimport { WarrantySection } from './components/WarrantySection';\r\nimport useIsInViewport from 'use-is-in-viewport';\r\nimport { ShopUsed } from './components/ShopUsed';\r\nimport { FloatingSummary } from './components/FloatingSummary';\r\nimport { MediaGalleryOverlay } from './components/MediaGalleryOverlay';\r\nimport { JsonLinkingData } from './components/JsonLinkingData';\r\nimport { GaPayload } from '../../common/pushGoogleAnalyticsEvent';\r\nimport { useGoogleAnalytics } from '../../common/useGoogleAnalytics';\r\n\r\nconst BuyboxView: React.FC = props => {\r\n const {\r\n ModuleProps,\r\n MediaGalleryContainerProps,\r\n ProductInfoContainerProps,\r\n addToCart,\r\n // addToOrderTemplate,\r\n addToWishlist,\r\n configure,\r\n description,\r\n findInStore,\r\n quantity,\r\n price,\r\n title,\r\n inventoryLabel,\r\n // shopSimilarLook,\r\n // keyInPrice,\r\n // shopSimilarDescription,\r\n // unitOfMeasure,\r\n // productComparisonButton,\r\n context,\r\n data: { product, attributeValues, categoryPaths },\r\n config: { helpLogo },\r\n state,\r\n callbacks,\r\n resources\r\n } = props;\r\n const { request } = context;\r\n const { productPromotions, applicableWarranties, productPrice, productVariantData } = state;\r\n const promotions = React.useMemo(() => {\r\n const promotions = productPromotions?.Promotions ?? [];\r\n if (promotions.length > 0) {\r\n promotions[0].IsImportant = true;\r\n }\r\n\r\n return promotions;\r\n }, [productPromotions?.Promotions]);\r\n const [isInViewport, targetRef] = useIsInViewport();\r\n // process.env.NODE_ENV === 'development' && console.log('BuyboxView', 'isInViewport', isInViewport);\r\n\r\n const gaPayload = React.useMemo(() => {\r\n if (productVariantData && productPrice) {\r\n const hasUnselectedOption = productVariantData.Dimensions?.find(d => Boolean(!d.DimensionValue));\r\n\r\n if (hasUnselectedOption) {\r\n return undefined;\r\n }\r\n\r\n var brand = productVariantData?.ExtensionProperties?.find(ep => ep.Key === 'Brand')?.Value?.StringValue;\r\n\r\n const paths = categoryPaths?.result?.map(p => p.Name) ?? [];\r\n const variant = productVariantData.Dimensions?.map(d => d.DimensionValue?.Value).join(',');\r\n const discount = productPrice.DiscountAmount ?? 0;\r\n const payload: GaPayload = {\r\n event: 'view_item',\r\n ecommerce: {\r\n currency: productPrice.CurrencyCode,\r\n value: productPrice.CustomerContextualPrice ?? 0,\r\n items: [\r\n {\r\n item_id: productVariantData.ProductNumber ?? productVariantData.ItemId ?? '',\r\n item_name: productVariantData.Name ?? '',\r\n item_brand: brand ?? undefined,\r\n item_variant: variant,\r\n item_category: paths[0],\r\n item_category2: paths[1],\r\n item_category3: paths[2],\r\n item_category4: paths[3],\r\n item_category5: paths[4],\r\n price: (productPrice.BasePrice ?? 0) - discount,\r\n discount: discount,\r\n quantity: 1,\r\n pid: productVariantData.ItemId ?? '',\r\n index: 0\r\n }\r\n ]\r\n }\r\n };\r\n\r\n return payload;\r\n }\r\n\r\n return undefined;\r\n }, [productVariantData, productPrice, categoryPaths]);\r\n\r\n useGoogleAnalytics(gaPayload);\r\n\r\n return (\r\n \r\n
\r\n \r\n
\r\n {title} \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n {props.mediaGallery}\r\n \r\n \r\n
\r\n {description &&
About this product
}\r\n
\r\n {description}\r\n \r\n Find out more\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n {title} \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n {price}\r\n
\r\n \r\n {/* {unitOfMeasure} */}\r\n {/* {props.bulkPurchaseLink} */}\r\n
\r\n \r\n
\r\n
About this product
\r\n
\r\n {description}\r\n \r\n Find out more\r\n \r\n
\r\n
\r\n
\r\n
\r\n callbacks.setSelectedWarranty(w)}\r\n logo={helpLogo}\r\n />\r\n {/* {keyInPrice && _renderKeyInPrice(keyInPrice)} */}\r\n
\r\n
\r\n {inventoryLabel}\r\n {_renderAvailability(props) || (findInStore && _renderFindInStore(findInStore))}\r\n
\r\n
\r\n {quantity && _renderQuantity(quantity)}\r\n {addToCart && _renderAddToCart(addToCart)}\r\n {addToWishlist && _renderAddToWishlist(addToWishlist)}\r\n {/* {productComparisonButton} */}\r\n
\r\n
\r\n {/* {addToOrderTemplate && _renderAddToOrderTemplate(addToOrderTemplate)} */}\r\n {/* {_renderSocialShare(props.slots && props.slots.socialShare)} */}\r\n {configure && _renderConfigure(configure)}\r\n {/* {shopSimilarLook && _renderShopSimilarItem(shopSimilarLook)} */}\r\n {/* {shopSimilarDescription && _renderShopSimilarItem(shopSimilarDescription)} */}\r\n \r\n
\r\n \r\n
\r\n \r\n
\r\n );\r\n};\r\n\r\nconst _renderAddToCart = (addToCart: IBuyboxAddToCartViewProps): JSX.Element => {\r\n const { ContainerProps, errorBlock, button } = addToCart;\r\n\r\n return (\r\n \r\n {errorBlock}\r\n {button}\r\n \r\n );\r\n};\r\n\r\n// @ts-ignore\r\nconst _renderAddToOrderTemplate = (addToOrderTemplate: IBuyboxAddToOrderTemplateViewProps): JSX.Element => {\r\n const { ContainerProps, errorBlock, button } = addToOrderTemplate;\r\n\r\n return (\r\n \r\n {errorBlock}\r\n {button}\r\n \r\n );\r\n};\r\n\r\nconst _renderAddToWishlist = (addToWishlist: IBuyboxAddToWishlistViewProps): JSX.Element => {\r\n const { ContainerProps, errorBlock, button } = addToWishlist;\r\n\r\n return (\r\n \r\n {errorBlock}\r\n {button}\r\n \r\n );\r\n};\r\n\r\nconst _renderConfigure = (configure: IBuyboxProductConfigureViewProps): JSX.Element => {\r\n const { ContainerProps, dropdowns } = configure;\r\n\r\n return {dropdowns.map(_renderConfigureDropdown)};\r\n};\r\n\r\n// @ts-ignore\r\nconst _renderSocialShare = (socialShare: React.ReactNode[]): JSX.Element | undefined => {\r\n if (!socialShare || socialShare.length === 0) {\r\n return undefined;\r\n }\r\n\r\n return <>{socialShare[0]};\r\n};\r\n\r\nconst _renderConfigureDropdown = (dropdown: IBuyboxProductConfigureDropdownViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, errors, select } = dropdown;\r\n\r\n return (\r\n \r\n \r\n {heading}\r\n {errors}\r\n \r\n {select}\r\n \r\n );\r\n};\r\n\r\nconst _renderFindInStore = (findInStore: IBuyboxFindInStoreViewProps): JSX.Element => {\r\n const { ContainerProps, storeSelector, heading, description, errors, button, modal, productPickupOptionList } = findInStore;\r\n\r\n return (\r\n \r\n {storeSelector}\r\n {heading}\r\n {productPickupOptionList}\r\n {description}\r\n {errors}\r\n {button}\r\n {modal}\r\n \r\n );\r\n};\r\n\r\nconst _renderQuantity = (quantity: IBuyboxProductQuantityViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, input, errors } = quantity;\r\n\r\n return (\r\n \r\n {input}\r\n \r\n {heading}\r\n {errors}\r\n \r\n \r\n );\r\n};\r\n\r\n// @ts-ignore\r\nconst _renderKeyInPrice = (keyInPrice: IBuyboxKeyInPriceViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, input } = keyInPrice;\r\n\r\n return (\r\n \r\n {heading}\r\n {input}\r\n \r\n );\r\n};\r\n\r\nconst _renderAvailability = (props: IBuyboxViewProps) => {\r\n let productAvailableQuantity = props.state.productAvailableQuantity;\r\n\r\n if (!productAvailableQuantity && ArrayExtensions.hasElements(props.data.productAvailableQuantity.result)) {\r\n productAvailableQuantity = props.data.productAvailableQuantity.result.find(\r\n shipping => shipping.deliveryType === DeliveryMode.shipping\r\n );\r\n }\r\n const extensionProperties = (props.state.productVariantData ?? props.data.product.result)?.ExtensionProperties;\r\n\r\n const availDate = extensionProperties?.find(ep => ep.Key === 'AvailDate')?.Value?.StringValue;\r\n const isBopisOnly = Boolean(extensionProperties?.find(ep => ep.Key === 'Bopis' && ep.Value?.StringValue === 'Yes'));\r\n\r\n process.env.NODE_ENV === 'development' && console.log('_renderAvailability', availDate, isBopisOnly);\r\n\r\n if (isBopisOnly || !availDate || !productAvailableQuantity) {\r\n return undefined;\r\n }\r\n\r\n if (productAvailableQuantity) {\r\n process.env.NODE_ENV === 'development' && console.log('_renderAvailability', productAvailableQuantity.StockLevelCode);\r\n if (productAvailableQuantity.StockLevelCode === 'AVAIL') {\r\n return (\r\n

\r\n {props.resources.expectedAvailabilityLabel}:\r\n
\r\n {availDate}\r\n

\r\n );\r\n }\r\n }\r\n\r\n return undefined;\r\n};\r\n\r\n// @ts-ignore\r\nconst _renderShopSimilarItem = (shopSimilarItem: IBuyboxShopSimilarLookViewProps): JSX.Element => {\r\n const { ContainerProps, errors, input } = shopSimilarItem;\r\n\r\n return (\r\n \r\n {errors}\r\n {input}\r\n \r\n );\r\n};\r\nexport default BuyboxView;\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['hei-buybox-v2'] = {\n c: () => require('partner/modules/hei-buybox-v2/hei-buybox-v2.tsx'),\n $type: 'containerModule',\n da: [{name:'allDimensions', path:'actions/get-all-dimensions-for-product', runOn: 0},{name:'applicableWarranties', path:'actions/get-applicable-warranties.action', runOn: 0},{name:'attributeValues', path:'actions/get-attributes-for-selected-variant.action', runOn: 0},{name:'cart', path:'@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action', runOn: 0},{name:'catalogs', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs', runOn: 0},{name:'categoryPaths', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-category-paths', runOn: 0},{name:'channelDeliveryOptionConfig', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration', runOn: 0},{name:'customerInformation', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer', runOn: 0},{name:'deliveryOptions', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-selected-variant', runOn: 0},{name:'featureState', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state', runOn: 0},{name:'orderTemplates', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/order-templates/get-order-templates-preview', runOn: 1},{name:'product', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant', runOn: 0},{name:'productAvailableQuantity', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-product-availabilities-for-selected-variant', runOn: 0},{name:'productPrice', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant', runOn: 0},{name:'productPromotions', path:'actions/get-product-promotions.action', runOn: 0},{name:'storeSelectorStateManager', path:'@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action', runOn: 1},{name:'wishlists', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id', runOn: 1}],\n \n iNM: false,\n ns: '__local__',\n n: 'hei-buybox-v2',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/hei-buybox-v2'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action';\n let dataAction = require('@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-category-paths';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-category-paths');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-product-availabilities-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-product-availabilities-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/order-templates/get-order-templates-preview';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/order-templates/get-order-templates-preview');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action';\n let dataAction = require('@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/get-all-dimensions-for-product';\n let dataAction = require('partner/actions/get-all-dimensions-for-product');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/get-applicable-warranties.action';\n let dataAction = require('partner/actions/get-applicable-warranties.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/get-attributes-for-selected-variant.action';\n let dataAction = require('partner/actions/get-attributes-for-selected-variant.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/get-product-promotions.action';\n let dataAction = require('partner/actions/get-product-promotions.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|hei-buybox-v2|hei-buybox-v2'] = {\n c: () => require('partner/modules/hei-buybox-v2/hei-buybox-v2.view.tsx'),\n cn: '__local__-__local__-hei-buybox-v2'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["AttributesForSelectedVariantInput","constructor","productId","channelId","selectedProduct","catalogId","getCacheKey","getCacheObjectType","dataCacheType","this","createAttributesForSelectedVariantInput","inputData","getSelectedProductIdFromActionInput","getCatalogId","requestContext","apiSettings","undefined","Error","async","getAttributesForSelectedVariantAction","input","ctx","Promise","resolve","then","activeProduct","selectedVariantInput","SelectedVariantInput","getSelectedVariantActionDataAction","productResult","ProductsDataActions","callerContext","RecordId","attributeValues","catch","error","trace","message","telemetry","exception","debug","getAttributesForSelectedVariantActionDataAction","createObservableDataAction","id","action","MediaLocationsForSelectedVariantInput","createMediaLocationsForSelectedVariantInput","getMediaLocationsForSelectedVariantAction","AsyncResult","getSelectedVariant","_activeProduct$Extens","newProductRecId","ExtensionProperties","find","ep","Key","Value","StringValue","split","getAllDimensionsForProductInput","GetAllDimensionsForProductInput","getAllDimensionsForProductActionDataAction","dimensions","validProducts","forEach","d","_d$dimensionValuesWit","dimensionValuesWithInventory","inv","_inv$ProductIds","ProductIds","variantId","_validProducts$varian","_inv$DimensionValue$V","_inv$DimensionValue","DimensionTypeValue","DimensionValue","ArrayExtensions","firstOrDefault","Object","keys","filter","length","_activeProduct$Dimens","Dimensions","_d$DimensionValue$Val","_d$DimensionValue","_validProducts$varian2","toLowerCase","product","_ctx$requestContext$a","app","config","OmniChannelMedia","mediaLocationsInput","MediaLocationsInput","getMediaLocationsForProductAction","getMediaLocationsAsync","queryResultSettings","QueryResultSettingsProxy","getPagingFromInputDataOrDefaultValue","response","map","mediaLocation","Uri","generateImageUrl","AltText","Name","getMediaLocationsForSelectedVariantActionDataAction","getProductVariantUrl","productDetails","context","_productDetails$Name","_productDetails$Maste","_productDetails$Dimen","title","normalizedCanonicalUrl","createCanonicalUrl","MasterProductId","dimParams","dim","_dim$DimensionValue","_dim$DimensionValue2","_dim$DimensionValue3","encodeURIComponent","replace","p","join","makeAbsUrl","url","origin","window","location","host","sitePath","SwatchComponent","props","_props$isSelectionEna","containerClassName","selectedItemId","setSelectedItemId","React","isSelectionEnabled","onSelectItemCallback","onSelectItem","item","itemId","ObjectExtensions","isNullOrUndefined","defaultItem","list","isDefault","assign","role","className","classnames","isRefineItem","isSelected","SwatchItemComponent","key","isDisabled","Dropdown","state","super","selectMenu","_selectSwatch","setState","selectedIndex","onChange","dropdownId","selectId","selectedValue","value","_onChanged","event","target","innerText","selectedItem","dropdownList","toString","payLoad","getPayloadObject","telemetryContent","dropdownName","render","selectionType","SelectionType","swatch","_renderSwatch","_renderDropdown","dropdownToggleName","attribute","getTelemetryAttributes","ref","selected","hidden","disabled","swatchItems","_objectSpread","dimensionType","getDimensionCombinations","memoize","allDimensions","productIdsToDimensions","dimension","dimensionValueWithInventory","_dimension$dimensionV","_dimensionValueWithIn","_productIdsToDimensio","_dimensionValueWithIn2","_dimensionValueWithIn3","_dimensionValueWithIn4","_dimensionValueWithIn5","getDimensionValuesFromQueryMemoized","getDimensionValuesFromQuery","URL","mapDimensionsInfo","productDimensions","matchedDimensions","enableStockCheck","inventoryLevel","getDropdownName","resources","dimensionsInfo","productDimensionFull","_ref","_productDimensionFull","DimensionValues","_value$DimensionValue","_value$DimensionValue2","_dimensionValuesWithI","_dimensionValue$Value","dimensionValue","inventoryLevelCode","getInventoryLevelCodeFromDimensionValue","colorHexCode","ColorHexCode","imageUrl","ImageUrl","InventoryLevelValues","outOfStock","swatchItemAriaLabel","dimensionInfo","currentDimensionsFromQuery","dimensionFromQuery","hasElements","currentDimensionFromQuery","selectedDimensionItem","dimensionItem","_currentDimensionFrom","toLocaleLowerCase","dimensionCombinations","otherDimensionsFromQuery","validDimensionValues","dc","od","_dc$od$DimensionTypeV","_dc$od$DimensionTypeV2","_od$DimensionValue$Va","_od$DimensionValue","dl","val","getBuyboxProductConfigure","callbacks","selectedDimensions","_props$data$product","_ref2","_props$data$productDi","typeName","errorState","configureErrors","data","result","productDimensionsData","hasProductDimensions","_getClassNamePrefix","getTelemetryObject","request","telemetryPageName","requestUrl","onChanged","possibleDimensions","_dc$notification$drop","notification","otherDimensions","isOtherDimensionsValid","pd","_pd$od$DimensionTypeV","_pd$od$DimensionTypeV2","_od$DimensionValue$Va2","_od$DimensionValue2","dimensionsSelected","nextDimensions","dimensionTypeValue","dimensionsSelectedAsync","dropdowns","dimensionId","Number","parseInt","format","selectDimensionFormatString","errorMessage","dimensionSelectionType","dropdown","convertProductDimensionTypeToDimensionTypes","dimensionsAsSwatchConfiguration","dimensionsAsSwatchType","includes","DimensionTypes","none","ContainerProps","LabelContainerProps","tag","htmlFor","errors","heading","select","dropdownCallback","mapProductDimensionFullToDropdownViewProps","modalCloseButtonReference","onClickFindInStoreHandler","_props$data","storeSelectorStateManager","cart","productAvailableQuantity","modules","quantity","dataProduct","multiplePickupStoreSwitchName","retailMulitplePickupMFeatureState","featureState","IsEnabled","missingDimensions","storeSelectorId","storeSelector","updateErrorState","errorHost","getConfigureErrors","openDialog","parentElementRef","deliveryOptions","onLocationSelected","orgUnitLocation","deliveryMode","_props$context","_props$data$productPr","_cart$cart$CartLines$","_cart$cart$CartLines","productsToAdd","push","count","behavior","addToCartBehavior","selectedWarranty","warrantyProduct","additionalProperties","bonusItemIds","productPromotions","FreeItemProductIds","bonusItems","getBonusItemsForAddToCart","isBonus","currentCartLinesCount","CartLines","addProductsToCart","status","substatus","productAvailability","changeModalOpen","ProductAvailableQuantity","shippingInventory","shipping","deliveryType","DeliveryMode","pickup","failureResult","failureReason","cartActionResult","otherError","getGenericError","_cart$cart$CartLines2","cartLines","_state$selectedWarran","productLine","updatedCartLinesObject","warrantyLine","ProductId","WarrantableLineNumber","LineNumber","IsWarrantyLine","productLineId","productLineUpdated","getLineIdFromExtProps","idx","bonusCartLine","updateCartLines","sendGoogleAnalyticsEvent","actionContext","navigationUrl","getUrlSync","AddToCartBehavior","goToCart","showModal","showNotification","_props$data$productPr2","defaultImageSettings","viewports","xs","q","w","h","lg","xl","lazyload","friendlyName","dialogStrings","goToCartText","buyBoxGoToCartText","continueShoppingText","buyBoxContinueShoppingText","closeNotificationLabel","headerItemOneText","buyBoxSingleItemText","headerItemFormatText","buyBoxMultiLineItemFormatText","headerMessageText","buyBoxHeaderMessageText","freePriceText","priceFree","originalPriceText","currentPriceText","addedQuantityText","ItemSuccessfullyAddedToCartNotification","gridSettings","productPrice","NotificationsManager","instance","addNotification","findInStoreOnClick","PopupComponent","buyBoxProps","buyBoxState","modalOpen","bonusProducts","setBonusProducts","bonusProductIds","resp","productVariant","setProductVariant","price","priceComponent","PriceComponent","popupProps","imageSettings","productQuantity","setModalOpen","Popup","getBuyboxFindInStore","_data$product","_data$storeSelectorSt","_data$cart","_data$deliveryOptions","_data$productAvailabl","_data$featureState","_data$channelDelivery","_product$Dimensions","slots","unavailableForPickupText","availableForPickupText","channel","PickupDeliveryModeCode","storeAvailabilities","openFindInStoreDialog","Heading","headingTag","text","channelDeliveryOptionConfig","_dimension$DimensionV","quantityError","isSectionDisabled","buttonText","isStockCheck","buyboxResources","isLoading","description","pickupInventory","findInStoreLinkText","findInStoreDescriptionText","isAggregatedInventory","_pickupInventory","IsProductAvailable","findInStoreNotAvailableTextButton","findInStoreNotAvailableDescription","getFindInStoreInventorySettings","DeliveryOptions","matchDeliveryOptions","productdeliveryOptions","storePickUpOptionList","deliveryOption","delivery","deliveryCode","Code","PickupDeliveryModeCodes","option","productPickupOptionList","BuyboxErrorBlock","showError","button","onClick","color","modal","showStrikethroughPricing","originalPrice","getOriginalPrice","CustomerContextualPrice","TradeAgreementPrice","BasePrice","renderCurrentPrice","initialPrice","formatCurrency","itemProp","cultureFormatter","renderCurrentPriceWithOriginalPrice","discountAmount","DiscountAmount","discountPrice","_attr$BooleanValue","attr","av","BooleanValue","seePriceInCartLabel","getBuyboxProductPrice","Price","Buybox","dimensionUpdateQueue","FinitePromiseQueue","buyboxCallbacks","updateQuantity","newQuantity","newErrorState","updateSelectedProduct","newSelectedProduct","newInventory","newPrice","newDeliveryOptions","productDeliveryOptions","_updatePrice","dimensionSelectedAsync","selectedDimensionId","selectedDimensionValueId","selecedDimensions","enqueue","_updateDimensions","FinitePromiseQueueError","ProcessWasDiscardedFromTheQueue","_getDropdownName","isModalOpen","changeUpdatingDimension","isUpdatingDimension","changeUpdatingDeliveryOptions","isUpdatingDeliveryOptions","updateKeyInPrice","customPrice","customAmountError","isPriceKeyedIn","keyInPriceAmount","setSelectedWarranty","warranty","mountCategories","packSizeCategories","_onBulkPurchaseLinkClick","bulkPurchaseModule","boundingRect","getBoundingClientRect","scrollTo","left","top","dimensionsToUpdate","clearErrorState","previousState","_getProductVariant","productVariantPromise","promises","_getDimensionsForSelectedVariant","mappedDimensions","_hydrateInventoryInfo","_hydratePrice","_hydrateDeliveryOptions","_updateQuantitiesInState","_updatePromotions","_updateWarranties","_updateSelectedProduct","_mediaLocations","all","_this$props$data$prod","_this$props$data$prod2","isGiftCard","IsGiftCard","leafCategories","productDimensionTypeColor","productDimensionTypeConfiguration","leafCategory","productDimensionTypeMount","productDimensionTypeSize","productDimensionTypePackSize","productDimensionTypeAmount","productDimensionTypeStyle","min","max","applicableWarranties","mediaLocations","c","dimensionUpdated","autoSelectValue","dvi","PhysicalAvailableInventoryLevelCode","_productDimensionFull2","dv","ItemTypeValue","ReleasedProductType","Service","isServiceItem","maxRecentlyViewedItemsCount","RecentlyViewedState","_this$props$data$allD","_product$Behavior","_this$state$productPr","mediaGallery","productComparisonButton","flatten","validValues","hasAvailableProducts","some","hasSerialNumber","Behavior","HasSerialNumber","viewProps","ModuleProps","moduleProps","ProductInfoContainerProps","MediaGalleryContainerProps","getBuyboxProductTitle","getBuyboxProductDescription","bulkPurchaseLink","_renderBuyboxBulkPurchaseLink","unitOfMeasure","getBuyboxProductUnitOfMeasure","configure","findInStore","addToCart","getBuyboxAddToCart","getBuyboxProductComparisonButton","addToOrderTemplate","getBuyboxProductAddToOrderTemplate","addToWishlist","getBuyboxProductAddToWishlist","rating","hideRating","getBuyboxProductRating","getBuyboxProductQuantity","inventoryLabel","getBuyBoxInventoryLabel","shopSimilarLook","enableShopSimilarLooks","getBuyboxShopSimilarButton","ShopSimiliarButtonType","Looks","shopSimilarDescription","enableShopSimilarDescription","Description","keyInPrice","enableKeyInPrice","isCustomPriceSelected","getBuyboxKeyInPrice","quantityLimitsMessages","getQuantityLimitsMessages","catalogs","_validateCatalogDetails","renderView","isBulkPurchaseEnabled","msdyn365Commerce","isBrowser","bulkPurchaseModules","Array","from","document","getElementsByClassName","BulkPurchase","Button","bulkPurchaseLinkText","arguments","_dimensions$find$Dime","_dimensions$find","setDimensionValuesToQuery","selectedProductPromise","getDimensionsForSelectedVariant","GetDimensionsForSelectedVariantInput","_productVariant$Dimen","newAvailableQuantity","getProductAvailabilitiesForSelectedVariant","ProductAvailabilitiesForSelectedVariantInput","newShippingQuantity","getPriceForSelectedVariant","PriceForSelectedVariantInput","_this$props$data$feat","retailMultiplePickupFeatureState","getDeliveryOptionsForSelectedVariant","GetDeliveryOptionsForSelectedVariantInput","_product$Behavior2","_product$Behavior3","_product$Behavior4","_product$Behavior5","_isOrderQuantityLimitsFeatureEnabled","MinimumQuantity","MaximumQuantity","updateMaxQuantityForCartLineItem","maxQuantityForCartLineItem","_this$props$context","_featureStatuses$find","defaultOrderQuantityLimitsFeatureConfig","platform","enableDefaultOrderQuantityLimits","featureStatuses","RetailDefaultOrderQuantityLimitsFeatureName","customerInfo","customerInformation","information","IsB2b","_this$props$data$cata","promotions","_promotions$FreeItemP","_this$state$productVa","searchCriteria","createInventoryAvailabilitySearchCriteria","productInventoryInformation","mapProductInventoryInformation","productWarehouseInformation","ProductWarehouseInventoryAvailabilities","mergeBonusProductInventoryInformation","productVariantData","a","_a$ProductAvailableQu","AvailableQuantity","_productVariant$Dimen2","getProductPromotionsAction","GetProductPromotionsInput","productPromotionsChangeEvent","CustomEvent","detail","dispatchEvent","_updateAvailableForPickup","_productVariant$Dimen3","getApplicableWarrantiesAction","getApplicableWarrantiesInput","_applicableWarranties","Boolean","Warranties","aw","AuthorizedDealerBadge","brand","_product$ExtensionPro","brandFromExt","locale","fileName","toUpperCase","categoryImageUrl","ImageData","src","Msdyn365","altText","loadFailureBehavior","ProductCode","mfrCode","ItemId","webCodeLabel","String","fromCharCode","mfrCodeLabel","ProductBadge","badgeValue","useMemo","_badgeAttr$TextValue","badgeAttr","TextValue","badgeUrl","buildProductBadgeUrl","baseImageUrl","badgeName","alt","Promotions","importantPromos","_promotions$filter","IsImportant","o","_o$OfferId","OfferId","href","WarrantyOptionButton","_warranty$DurationUni","_warranty$Duration","coreContext","unit","DurationUnitValue","duration","Duration","label","formatedPrice","AdjustedPrice","active","type","WarrantySection","warrantyGroups","logo","warranties","Image","bypassHideOnFailure","_w$ItemId","ShopUsed","_resources$shopUsedTe","usedProductUrl","setUsedProductUrl","useState","recId","values","useEffect","shopUsedText","FloatingSummary","_product$result","isInViewport","image","fallbackImageUrl","getFallbackImageUrl","fallBackSrc","_renderAddToCart","errorBlock","Node","_renderAddToWishlist","_renderConfigure","_renderConfigureDropdown","_renderFindInStore","_renderQuantity","_renderAvailability","_props$state$productV","_extensionProperties$","extensionProperties","availDate","_ep$Value","StockLevelCode","expectedAvailabilityLabel","categoryPaths","helpLogo","_productPromotions$Pr","targetRef","useIsInViewport","gaPayload","_productVariantData$D","_productVariantData$E","_categoryPaths$result","_categoryPaths$result2","_productVariantData$D2","_productPrice$Discoun","_productPrice$Custome","_productVariantData$P","_productVariantData$N","_productPrice$BasePri","_productVariantData$I","paths","variant","discount","ecommerce","currency","CurrencyCode","items","item_id","ProductNumber","item_name","item_brand","item_variant","item_category","item_category2","item_category3","item_category4","item_category5","pid","index","useGoogleAnalytics","Module","MediaGalleryOverlay","Bazzarvoice","widgetType","rating_summary","JsonLinkingData","productInfo","binding","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","require","$type","da","name","path","runOn","iNM","ns","n","pdp","md","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}