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./src/actions/get-selected-variant.ts?43b0","webpack://bestseller.commerce.online/./src/modules/ext-buybox/components/ext-buybox-find-in-store.tsx?bc24","webpack://bestseller.commerce.online/./src/modules/ext-buybox/ext-buybox.tsx?a7de","webpack://bestseller.commerce.online/./src/modules/ext-buybox/ext-buybox.view.tsx?db6f","webpack://bestseller.commerce.online/./src/shared/components/price.component.tsx?0789","webpack://bestseller.commerce.online/./src/shared/functions/get-commercial-name.ts?6aba","webpack://bestseller.commerce.online/./src/themes/only/views/components/buybox-add-to-order-template.tsx?346b","webpack://bestseller.commerce.online/./src/themes/only/views/ext-buybox.view.tsx?aac9","webpack://bestseller.commerce.online/./lib/ext-buybox/module-registration.js?db97","webpack://bestseller.commerce.online/./src/store-selector-state-manager/base-store-selector-state-manager.ts?281e","webpack://bestseller.commerce.online/./src/store-selector-state-manager/map-store-selector-state-manager.ts?2ae0","webpack://bestseller.commerce.online/./src/store-selector-state-manager/store-selector-state-manager-data-action.ts?bd3e","webpack://bestseller.commerce.online/external var \"React\"?0d3b","webpack://bestseller.commerce.online/external var \"ReactDOM\"?853b"],"sourcesContent":["/*!\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 { IProductDimensionsWithAvailabilitiesFull } from '@msdyn365-commerce/commerce-entities';\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 IRequestContext\r\n} from '@msdyn365-commerce/core';\r\nimport {\r\n BypassCache,\r\n ProductDimension,\r\n ProductDimensionAvailabilitySearchCriteria,\r\n ProductsDataActions,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ArrayExtensions,\r\n QueryResultSettingsProxy,\r\n generateProductImageUrl,\r\n getDimensionValuesFromQuery,\r\n getSelectedProductIdFromActionInput,\r\n createInventoryAvailabilitySearchCriteria\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getCommercialName } from '../shared/functions/get-commercial-name';\r\n\r\n/**\r\n * Stores data about the selected product.\r\n */\r\nexport interface ISelectedProduct extends SimpleProduct {\r\n productVariant?: SimpleProduct;\r\n}\r\n\r\n/**\r\n * Get selected variant action input class.\r\n */\r\nexport class SelectedVariantInput implements IActionInput {\r\n public productId: number;\r\n\r\n public channelId: number;\r\n\r\n public matchingDimensionValues?: ProductDimension[];\r\n\r\n public bypassCache?: BypassCache;\r\n\r\n public catalogId?: number;\r\n\r\n public constructor(\r\n productId: number,\r\n channelId: number,\r\n matchingDimensionValues?: ProductDimension[],\r\n bypassCache?: BypassCache,\r\n requestContext?: IRequestContext\r\n ) {\r\n this.productId = productId;\r\n this.channelId = channelId;\r\n this.matchingDimensionValues = matchingDimensionValues;\r\n this.bypassCache = bypassCache;\r\n\r\n if (requestContext) {\r\n this.catalogId = getCatalogId(requestContext);\r\n }\r\n }\r\n\r\n /**\r\n * Cache key.\r\n * @returns String.\r\n */\r\n public getCacheKey: () => string = () => 'SelectedVariant';\r\n\r\n /**\r\n * Cache object type.\r\n * @returns String.\r\n */\r\n public getCacheObjectType: () => string = () => 'SimpleProduct';\r\n\r\n /**\r\n * Cache type.\r\n * @returns String.\r\n */\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\n/**\r\n * CreateInput method for the getSelectedVariant data action.\r\n * @param inputData - The input data passed to the createInput method.\r\n * @returns The input for the ata action getSelectedVariantNewAction.\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): SelectedVariantInput => {\r\n const productId = getSelectedProductIdFromActionInput(inputData);\r\n\r\n if (productId) {\r\n return new SelectedVariantInput(\r\n +productId,\r\n +inputData.requestContext.apiSettings.channelId,\r\n undefined,\r\n undefined,\r\n inputData.requestContext\r\n );\r\n }\r\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\r\n};\r\n\r\n/**\r\n * Checks if given product has any unmatched dimensions.\r\n * Modifies product entity to use matched dimension values.\r\n * @param product - The product to analyze and modify.\r\n * @param matchingDimensionValues - Matched dimensions.\r\n * @returns True if has any unmatched dimension, false if all dimensions are specified.\r\n */\r\nconst checkIfHasUnmatchedDimensions = (product: SimpleProduct, matchingDimensionValues: ProductDimension[]): boolean => {\r\n let hasUnmatchedDimension: boolean = false;\r\n if (product.Dimensions) {\r\n product.Dimensions = product.Dimensions.map(dimension => {\r\n return { ...dimension };\r\n });\r\n for (const dimension of product.Dimensions) {\r\n const matchedTargetDimension = matchingDimensionValues.find(\r\n targetDimension => targetDimension.DimensionTypeValue === dimension.DimensionTypeValue\r\n );\r\n\r\n if (matchedTargetDimension) {\r\n dimension.DimensionValue = matchedTargetDimension.DimensionValue;\r\n } else {\r\n hasUnmatchedDimension = true;\r\n }\r\n }\r\n }\r\n return hasUnmatchedDimension;\r\n};\r\n\r\n/**\r\n * Retrieves product dimensions with availabilities.\r\n * @param product - Product for which the dimensions need to be retrieved.\r\n * @param matchingDimensionValues - Selected dimensions - filter criteria for the dimensions API.\r\n * @param context - Action context.\r\n * @param catalogId - Catalog id.\r\n * @returns Array of dimensions.\r\n */\r\nconst getFullDimensions = async (\r\n product: SimpleProduct,\r\n matchingDimensionValues: ProductDimension[],\r\n context: IActionContext,\r\n catalogId?: number\r\n) => {\r\n let fullDimensions: IProductDimensionsWithAvailabilitiesFull[] = [];\r\n const fullDimensionPromises = (product.Dimensions ?? []).map(dimension => {\r\n const shippingInventoryConfiguration = createInventoryAvailabilitySearchCriteria(context, [], true, undefined, undefined);\r\n const searchCriteria: ProductDimensionAvailabilitySearchCriteria = {\r\n RequestedDimensionTypeValue: dimension.DimensionTypeValue,\r\n MatchingDimensionValues: matchingDimensionValues,\r\n DefaultWarehouseOnly: shippingInventoryConfiguration.DefaultWarehouseOnly,\r\n FilterByChannelFulfillmentGroup: shippingInventoryConfiguration.FilterByChannelFulfillmentGroup,\r\n DeliveryModeTypeFilterValue: shippingInventoryConfiguration.DeliveryModeTypeFilterValue,\r\n CatalogId: catalogId\r\n };\r\n const dimensionValuesPromise = ProductsDataActions.getDimensionValuesWithEstimatedAvailabilitiesAsync(\r\n { callerContext: context, queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context) },\r\n product.MasterProductId ? product.MasterProductId : product.RecordId,\r\n searchCriteria\r\n );\r\n\r\n return dimensionValuesPromise.then(dimensionValues => {\r\n const fullDimension: IProductDimensionsWithAvailabilitiesFull = {\r\n ...dimension,\r\n dimensionValuesWithInventory: dimensionValues\r\n };\r\n return fullDimension;\r\n });\r\n });\r\n fullDimensions = await Promise.all(fullDimensionPromises);\r\n return fullDimensions;\r\n};\r\n\r\n/**\r\n * Retrieves product variant for the given input or undefined if not found.\r\n * @param input - Action input.\r\n * @param context - Action context.\r\n * @param fullDimensions - Product dimensions with availabilities.\r\n * @returns A product variant that is available or undefined.\r\n */\r\nconst getProductVariant = async (\r\n input: SelectedVariantInput,\r\n context: IActionContext,\r\n fullDimensions: IProductDimensionsWithAvailabilitiesFull[]\r\n) => {\r\n let productVariant: SimpleProduct | undefined;\r\n if (\r\n ArrayExtensions.hasElements(fullDimensions) &&\r\n ArrayExtensions.hasElements(fullDimensions[0].dimensionValuesWithInventory) &&\r\n ArrayExtensions.hasElements(fullDimensions[0].dimensionValuesWithInventory[0].ProductIds)\r\n ) {\r\n const variantProductId = fullDimensions[0].dimensionValuesWithInventory[0].ProductIds[0];\r\n const result = await ProductsDataActions.getByIdsAsync(\r\n {\r\n callerContext: context,\r\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context),\r\n bypassCache: input.bypassCache\r\n },\r\n input.channelId,\r\n [variantProductId],\r\n null,\r\n input.catalogId ?? 0\r\n );\r\n productVariant = result[0];\r\n productVariant = { ...productVariant };\r\n const variantImageUrl = generateProductImageUrl(productVariant, context.requestContext.apiSettings);\r\n\r\n if (variantImageUrl) {\r\n productVariant.PrimaryImageUrl = variantImageUrl;\r\n }\r\n\r\n if (productVariant && context.requestContext.app.config?.useCommercialStyleName) {\r\n var attributes = await ProductsDataActions.getAttributeValuesAsync(\r\n {\r\n callerContext: context,\r\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context)\r\n },\r\n productVariant.RecordId,\r\n input.channelId,\r\n input.catalogId ?? 0\r\n );\r\n productVariant.Name = getCommercialName(\r\n attributes,\r\n productVariant.Name,\r\n context.requestContext.app.config?.commercialStyleNameAttribute\r\n );\r\n }\r\n }\r\n\r\n return productVariant;\r\n};\r\n\r\n/**\r\n * Action method for the getSelectedVariant data action.\r\n * @param input - The action input class.\r\n * @param context - The action context.\r\n * @returns Simple product.\r\n */\r\nasync function getSelectedVariantAction(input: SelectedVariantInput, context: IActionContext): Promise {\r\n const matchingDimensionValues = input.matchingDimensionValues ?? getDimensionValuesFromQuery(context.requestContext.url.requestUrl);\r\n\r\n const result = await ProductsDataActions.getByIdsAsync(\r\n {\r\n callerContext: context,\r\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context),\r\n bypassCache: input.bypassCache\r\n },\r\n input.channelId,\r\n [input.productId],\r\n null,\r\n input.catalogId ?? 0\r\n );\r\n let product = result[0];\r\n\r\n // Need to dereference this before editing it. Otherwise we might not\r\n // properly get the mobx events because if things aren't properly observable\r\n // they won't fire when you set them, and then if you don't deref the value in\r\n // the cache will match the value when you try to save it, so it won't detect any\r\n // changes there either\r\n product = { ...product };\r\n\r\n const hasUnmatchedDimension = checkIfHasUnmatchedDimensions(product, matchingDimensionValues);\r\n\r\n const newImageUrl = generateProductImageUrl(product, context.requestContext.apiSettings);\r\n\r\n if (newImageUrl) {\r\n product.PrimaryImageUrl = newImageUrl;\r\n }\r\n\r\n const fullDimensions: IProductDimensionsWithAvailabilitiesFull[] = await getFullDimensions(\r\n product,\r\n matchingDimensionValues,\r\n context,\r\n input.catalogId\r\n );\r\n\r\n // Retrieve product variants only if matching dimensions are provided.\r\n const productVariant: SimpleProduct | undefined = ArrayExtensions.hasElements(matchingDimensionValues)\r\n ? await getProductVariant(input, context, fullDimensions)\r\n : undefined;\r\n\r\n // Update dimension value back to the one that comes from API since the URL query might have a different format for the dimension values.\r\n if (productVariant?.Dimensions && product.Dimensions) {\r\n for (const dimension of product.Dimensions) {\r\n const matchedTargetDimensionFromApi = productVariant.Dimensions.find(\r\n targetDimension => targetDimension.DimensionTypeValue === dimension.DimensionTypeValue\r\n );\r\n const matchedTargetDimensionFromSearch = matchingDimensionValues.find(\r\n targetDimension => targetDimension.DimensionTypeValue === dimension.DimensionTypeValue\r\n );\r\n\r\n if (matchedTargetDimensionFromSearch && matchedTargetDimensionFromApi) {\r\n dimension.DimensionValue = matchedTargetDimensionFromApi.DimensionValue;\r\n }\r\n }\r\n }\r\n\r\n if (!hasUnmatchedDimension && ArrayExtensions.hasElements(matchingDimensionValues) && productVariant) {\r\n return productVariant;\r\n }\r\n\r\n if (product && context.requestContext.app.config?.useCommercialStyleName) {\r\n var attributes = await ProductsDataActions.getAttributeValuesAsync(\r\n {\r\n callerContext: context,\r\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context)\r\n },\r\n product.RecordId,\r\n input.channelId,\r\n input.catalogId ?? 0\r\n );\r\n product.Name = getCommercialName(attributes, product.Name, context.requestContext.app.config?.commercialStyleNameAttribute);\r\n }\r\n\r\n const selectedProduct: ISelectedProduct = product;\r\n selectedProduct.productVariant = productVariant;\r\n return selectedProduct;\r\n}\r\n\r\n/**\r\n * The complete getSelectedVariant data action.\r\n */\r\nexport const getSelectedVariantActionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/get-selected-variant',\r\n action: getSelectedVariantAction as IAction,\r\n input: createInput\r\n});\r\n\r\nexport default getSelectedVariantActionDataAction;\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 { DeliveryOption, FeatureState, OrgUnitLocation, ProductAvailableQuantity, ProductDimension } 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, IPopupProps, Popup } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { BuyboxErrorBlock } from '@msdyn365-commerce-modules/buybox';\r\nimport { IBuyboxCallbacks, IBuyboxState } from '@msdyn365-commerce-modules/buybox';\r\nimport { getConfigureErrors, getGenericError } from '@msdyn365-commerce-modules/buybox';\r\nimport { IExtBuyboxData } from '../ext-buybox.data';\r\nimport { IExtBuyboxProps, IExtBuyboxResources } from '../ext-buybox.props.autogenerated';\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\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: IExtBuyboxProps,\r\n state: IBuyboxState,\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: IExtBuyboxResources,\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\nexport function getBuyboxFindInStore(\r\n props: IExtBuyboxProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks\r\n): IBuyboxFindInStoreViewProps | undefined {\r\n const {\r\n data,\r\n slots: { storeSelector },\r\n resources: {\r\n priceFree,\r\n originalPriceText,\r\n currentPriceText,\r\n findInStoreHeaderText,\r\n buyBoxGoToCartText,\r\n buyBoxContinueShoppingText,\r\n closeNotificationLabel,\r\n buyBoxSingleItemText,\r\n buyBoxMultiLineItemFormatText,\r\n buyBoxHeaderMessageText,\r\n descriptionTextToShowAllPickupOptions\r\n },\r\n context: {\r\n request: { channel: { PickupDeliveryModeCode } = { PickupDeliveryModeCode: undefined } }\r\n }\r\n } = props;\r\n\r\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n const product = data?.product?.result;\r\n const price = data?.productPrice?.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 modalOpen,\r\n quantity\r\n } = state;\r\n\r\n const { isSectionDisabled, buttonText, description } = 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 || !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 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: props.context,\r\n className: 'ms-buybox',\r\n id: props.id,\r\n typeName: props.typeName,\r\n data: { product: props.data.product?.result, price: props.data.productPrice?.result },\r\n dialogStrings,\r\n imageSettings: defaultImageSettings,\r\n gridSettings: props.context.request.gridSettings,\r\n productQuantity: quantity,\r\n priceComponent,\r\n navigationUrl: getUrlSync('cart', props.context.actionContext),\r\n modalOpen,\r\n setModalOpen: callbacks.changeModalOpen\r\n };\r\n const renderModalPopup = ;\r\n\r\n return {\r\n ContainerProps: {\r\n className: 'ms-buybox__find-in-store'\r\n },\r\n\r\n storeSelector: storeSelector[0],\r\n\r\n openFindInStoreDialog: onClickFindInStoreHandler(props, state, callbacks),\r\n\r\n heading: ,\r\n\r\n description:

{description}

,\r\n productPickupOptionList:\r\n retailMulitplePickupMFeatureState && !isSectionDisabled ? (\r\n <>\r\n

{descriptionTextToShowAllPickupOptions}

\r\n
    \r\n {deliveryOptions.DeliveryOptions.map((item: DeliveryOption) => {\r\n return (\r\n
  • \r\n {item.Description}\r\n
  • \r\n );\r\n })}\r\n
\r\n \r\n ) : 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: renderModalPopup\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(props: IExtBuyboxProps, state: IBuyboxState, callbacks: IBuyboxCallbacks): Promise {\r\n const {\r\n data: {\r\n storeSelectorStateManager: { result: storeSelectorStateManager },\r\n cart: { result: cart },\r\n productAvailableQuantity: { result: productAvailableQuantity }\r\n },\r\n resources,\r\n context,\r\n modules\r\n } = props;\r\n\r\n const { 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 behavior = props.context?.app?.config?.addToCartBehavior;\r\n\r\n return cart\r\n .addProductToCart({ product, count: quantity, location: orgUnitLocation, deliveryMode })\r\n .then((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 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 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","/*!\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\n/* eslint-disable security/detect-object-injection */\r\nimport { getCatalogId, ICoreContext, msdyn365Commerce } from '@msdyn365-commerce/core-internal';\r\nimport {\r\n CommerceProperty,\r\n ProductCatalog,\r\n ProductDeliveryOptions,\r\n ProductDimensionValue,\r\n ProductDimensionValueInventoryAvailability,\r\n ProductPrice,\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 IDimensionsApp,\r\n IDimensionValueForSelectedVariant,\r\n InventoryLevelValues,\r\n IProductInventoryInformation,\r\n IPromiseQueue,\r\n PriceForSelectedVariantInput,\r\n ProductAvailabilitiesForSelectedVariantInput,\r\n SelectedVariantInput,\r\n setDimensionValuesToQuery,\r\n validateCatalogId\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\nimport { getSelectedVariantActionDataAction } from '../../actions/get-selected-variant';\r\n\r\nimport {\r\n getBuyboxAddToCart,\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 EcommerceQuantityLimitConfigurationsFeatureName,\r\n RevertToSiteBuilderOrderQuantityLimitsSettingsCRTFeatureName\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport { getBuyboxProductConfigure } from '@msdyn365-commerce-modules/buybox';\r\nimport {\r\n IBuyboxAddToCartViewProps,\r\n IBuyboxAddToOrderTemplateViewProps,\r\n IBuyboxAddToWishlistViewProps,\r\n IBuyboxCallbacks,\r\n IBuyboxCommonData,\r\n IBuyboxExtentedProps,\r\n IBuyboxKeyInPriceViewProps,\r\n IBuyboxProductConfigureViewProps,\r\n IBuyboxProductQuantityViewProps,\r\n IBuyboxShopSimilarLookViewProps,\r\n IBuyboxState,\r\n IErrorState,\r\n ShopSimiliarButtonType\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport { IExtBuyboxData } from './ext-buybox.data';\r\nimport { IExtBuyboxProps, IExtBuyboxResources } from './ext-buybox.props.autogenerated';\r\nimport { getBuyboxFindInStore, IBuyboxFindInStoreViewProps } from './components/ext-buybox-find-in-store';\r\nimport { RecentlyViewedState } from '@msdyn365-commerce-modules/buybox';\r\nimport PriceComponent from '../../shared/components/price.component';\r\n\r\nexport interface IBuyboxViewProps extends IExtBuyboxProps {\r\n state: IBuyboxState;\r\n ModuleProps: IModuleProps;\r\n ProductInfoContainerProps: INodeProps;\r\n MediaGalleryContainerProps: INodeProps;\r\n callbacks: IBuyboxCallbacks;\r\n mediaGallery?: React.ReactNode;\r\n title?: React.ReactNode;\r\n description?: React.ReactNode;\r\n rating?: React.ReactNode;\r\n price?: React.ReactNode;\r\n productComparisonButton?: React.ReactNode;\r\n bulkPurchaseLink?: React.ReactNode;\r\n addToOrderTemplate?: IBuyboxAddToOrderTemplateViewProps;\r\n addToWishlist?: IBuyboxAddToWishlistViewProps;\r\n min?: number | undefined;\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 isChannelMultipleCatalogsFeatureEnabled?: boolean;\r\n currentCatalogId?: number;\r\n applyDefaultOrderSettings?: boolean;\r\n variantColorName?: string;\r\n}\r\n\r\n/**\r\n * Buybox Module.\r\n */\r\nclass Buybox extends React.PureComponent, IBuyboxState> {\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 private initializedDimensions: Set = new Set();\r\n\r\n private readonly buyboxCallbacks: IBuyboxCallbacks = {\r\n updateQuantity: (newQuantity: number): boolean => {\r\n const errorState = { ...this.state.errorState };\r\n errorState.quantityError = undefined;\r\n errorState.otherError = undefined;\r\n\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 initializeDimension: (initializedDimension: string): void => {\r\n if (initializedDimension) {\r\n this.initializedDimensions.add(initializedDimension);\r\n }\r\n },\r\n dimensionSelectedAsync: async (selectedDimensionId: number, selectedDimensionValueId: string): Promise => {\r\n this.dimensions[selectedDimensionId] = selectedDimensionValueId;\r\n // Only trigger _updateDimensions when all dimensions are initialized\r\n if (this.initializedDimensions.size === (this.props.data.product.result?.Dimensions?.length || 0)) {\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 },\r\n getDropdownName: (dimensionType: number, resources: IExtBuyboxResources): 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\r\n private readonly telemetryContent: ITelemetryContent;\r\n\r\n public constructor(props: IExtBuyboxProps, 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 isPriceApiCalled: false\r\n };\r\n this.telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.friendlyName, props.telemetry);\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n const {\r\n data: {\r\n product: { result: product },\r\n productPrice\r\n },\r\n context\r\n } = this.props;\r\n\r\n // Sets the gender to be male if the product is from SONS - so we can target the correct audience\r\n if (this.props.config.targetGender && product && product.ItemId?.startsWith('22')) {\r\n const url = new URL(location.href);\r\n if (url.searchParams.get('gender') !== 'm') {\r\n url.searchParams.set('gender', 'm');\r\n //This refreshes the page so that the target can apply\r\n window.location.search = url.searchParams.toString();\r\n }\r\n }\r\n\r\n // There are multiple sources triggering the callback function dimensionSelectedAsync calling the GetActivePrice api before componentDidMount and after componentDidMount.\r\n // Set isPriceApiCalled to false here to prevent redundant API call after componentDidMount:\r\n // If the price has not been hydrated before, this means the component was just loaded for the first time with variant selected.\r\n // We will skip calling RS API in this case as the price data has already been fetched via module data action in node server.\r\n this.setState({ isPriceApiCalled: false });\r\n // eslint-disable-next-line\r\n 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 //Customization that defaults to the first available color if no color is selected (DimensionValue 1 is Color dimension) - or the first color if no colors are available\r\n if (!this.dimensions[1]) {\r\n //TOOD: should be information telemetry\r\n this.props.telemetry.warning('No color dimension, finding default color');\r\n if (this.props.data.productDimensions.status === 'SUCCESS') {\r\n var colorDimension = this.props.data.productDimensions.result?.find(x => x.DimensionTypeValue === 1);\r\n if (colorDimension && colorDimension.dimensionValuesWithInventory) {\r\n for (const element of colorDimension.dimensionValuesWithInventory) {\r\n if (element.TotalAvailableInventoryLevelCode === 'AVAIL' && element?.DimensionValue) {\r\n this.dimensions[1] = element?.DimensionValue?.RecordId.toString();\r\n this._updateDimensions();\r\n break;\r\n }\r\n }\r\n //If no colors are in stock - default to first color\r\n //TOOD: should be information telemetry\r\n this.props.telemetry.warning('No color dimension, no colors available');\r\n this.dimensions[1] = colorDimension?.dimensionValuesWithInventory[0]?.DimensionValue?.RecordId.toString() ?? '';\r\n this._updateDimensions();\r\n }\r\n }\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\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 { min, 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.productDimensions.result?.map(value => value.dimensionValuesWithInventory))\r\n );\r\n const applyDefaultOrderSettings =\r\n (this.props.data.featureState?.result?.find(featureState => featureState.Name === RetailDefaultOrderQuantityLimitsFeatureName)\r\n ?.IsEnabled ??\r\n false) &&\r\n (this.props.data.cartConfiguration?.result?.ValidateDefaultOrderSettingsPerLine ?? false);\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 validateCatalogId(catalogId);\r\n\r\n //Get variant color name\r\n var variantColorName;\r\n if (\r\n this.props.config.showColorName &&\r\n this.props.data.productDimensions.status === 'SUCCESS' &&\r\n this.props.data.productDimensions.result\r\n ) {\r\n const productColor = product?.Dimensions?.find(item => {\r\n return item.DimensionTypeValue === 1;\r\n });\r\n const dimension = this.props.data.productDimensions.result.find(item => {\r\n return item.DimensionTypeValue === 1;\r\n });\r\n const color = dimension?.DimensionValues?.find(item => {\r\n return item.Value === productColor?.DimensionValue?.Value;\r\n });\r\n if (color?.RefinerGroup && productColor?.DimensionValue?.Value) {\r\n variantColorName = `${color?.RefinerGroup} / ${productColor?.DimensionValue?.Value}`;\r\n }\r\n }\r\n\r\n const viewProps: IBuyboxViewProps = {\r\n ...(this.props as IExtBuyboxProps),\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', 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: !this.props.config.hideDescription ? undefined : getBuyboxProductDescription(props),\r\n bulkPurchaseLink: this._renderBuyboxBulkPurchaseLink(),\r\n unitOfMeasure: getBuyboxProductUnitOfMeasure(props),\r\n configure: getBuyboxProductConfigure(props, this.state, this.buyboxCallbacks),\r\n findInStore: getBuyboxFindInStore(this.props, this.state, this.buyboxCallbacks),\r\n price: this._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 ),\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(\r\n props,\r\n this.state,\r\n this.buyboxCallbacks,\r\n this._isChannelMultipleCatalogsFeatureEnabled(),\r\n catalogId\r\n ),\r\n addToWishlist: getBuyboxProductAddToWishlist(props, this.state, this.buyboxCallbacks),\r\n rating: !props.context.app.config.hideRating && getBuyboxProductRating(props),\r\n quantity: product.IsGiftCard ? 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 min: applyDefaultOrderSettings ? min : 1,\r\n max,\r\n applyDefaultOrderSettings: applyDefaultOrderSettings,\r\n isChannelMultipleCatalogsFeatureEnabled: this._isChannelMultipleCatalogsFeatureEnabled(),\r\n currentCatalogId: catalogId,\r\n catalogs: this._validateCatalogDetails(catalogId),\r\n variantColorName: variantColorName\r\n };\r\n\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n //Imported from the buybox components in order to use shared price component - note that it uses the extended props unlike all the others\r\n private _getBuyboxProductPrice(props: IExtBuyboxProps, state: IBuyboxState): React.ReactElement | undefined {\r\n const { id, typeName, context, resources } = props;\r\n\r\n return (\r\n state.productPrice && (\r\n featureState.Name === 'Dynamics.AX.Application.RetailSearchPriceRangeFeature'\r\n )?.IsEnabled\r\n }\r\n isSalesAgreementPriceFeatureEnabled={\r\n props.data.featureState.result?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailSalesAgreementPriceSupportFeature'\r\n )?.IsEnabled\r\n }\r\n priceResources={{\r\n priceRangeSeparator: resources.priceRangeSeparator,\r\n salesAgreementPricePrompt: resources.salesAgreementPricePrompt,\r\n salesAgreementExpirationDatePrompt: resources.salesAgreementExpirationDatePrompt,\r\n salesAgreementCommittedQuantityPrompt: resources.salesAgreementCommittedQuantityPrompt,\r\n salesAgreementRemainingQuantityPrompt: resources.salesAgreementRemainingQuantityPrompt,\r\n memberPriceMessage: resources.memberPriceMessage,\r\n saleMessage: resources.saleMessage\r\n }}\r\n freePriceText={resources.priceFree}\r\n originalPriceText={resources.originalPriceText}\r\n currentPriceText={resources.currentPriceText}\r\n showDiscountBox={false}\r\n />\r\n )\r\n );\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 const scrollX = boundingRect.left + window.pageXOffset;\r\n const scrollY = boundingRect.top + window.pageYOffset;\r\n\r\n window.scrollTo(scrollX, scrollY);\r\n };\r\n private readonly _isChannelMultipleCatalogsFeatureEnabled = (): boolean => {\r\n let isMultipleCatalogFeatureEnabledInHq = false;\r\n if (this.props.data.featureState) {\r\n isMultipleCatalogFeatureEnabledInHq =\r\n this.props.data.featureState.result?.find(\r\n feature => feature.Name === 'Dynamics.AX.Application.ChannelMultipleCatalogsFeature'\r\n )?.IsEnabled || false;\r\n }\r\n return isMultipleCatalogFeatureEnabledInHq;\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.productDimensions.result!;\r\n\r\n //Always default the \"Style\" dimension (4) to None\r\n dimensionsToUpdate[4] = productDimensions\r\n .find(dimension => dimension.DimensionTypeValue === 4)\r\n ?.DimensionValues![0]?.RecordId.toString()!;\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 = getSelectedVariantActionDataAction(\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.productDimensions.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\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\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 ];\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(\r\n productVariant.RecordId,\r\n this.props.context.request.apiSettings.channelId,\r\n productVariant\r\n ),\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 // This function is invoked when dimensionSelectedAsync get called.\r\n // If the price has not been hydrated before, this means the component was just loaded for the first time with variant selected.\r\n // We will skip calling RS API in this case as the price data has already been fetched via module data action in node server.\r\n if (!this.state.isPriceApiCalled) {\r\n this.setState({ isPriceApiCalled: true });\r\n return;\r\n }\r\n\r\n // Step 6. Use these dimensions hydrate the product price.\r\n const newPrice = await getPriceForSelectedVariant(\r\n new PriceForSelectedVariantInput(productVariant.RecordId, this.props.context.request.apiSettings.channelId, productVariant),\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 productVariant,\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 const isChannelLimitsFeatureEnabled = await this._isChannelLimitsFeatureEnabled();\r\n\r\n const min: number = this._getMinQuantityForCartLineItem(isOrderQuantityLimitsFeatureEnabled, product);\r\n const max: number = this._getMaxQuantityForCartLineItem(\r\n isChannelLimitsFeatureEnabled || isOrderQuantityLimitsFeatureEnabled,\r\n product\r\n );\r\n let quantity: number = this._getQuantity(product, isOrderQuantityLimitsFeatureEnabled);\r\n quantity = Math.max(quantity, min);\r\n\r\n this.setState({\r\n min,\r\n max,\r\n quantity\r\n });\r\n }\r\n\r\n private _getMinQuantityForCartLineItem(isOrderQuantityLimitsFeatureEnabled: boolean, product: SimpleProduct): number {\r\n if (isOrderQuantityLimitsFeatureEnabled && product?.Behavior?.MinimumQuantity && product.Behavior.MinimumQuantity > 0) {\r\n return product.Behavior.MinimumQuantity;\r\n }\r\n\r\n return 1;\r\n }\r\n\r\n private _getMaxQuantityForCartLineItem(isQuantityLimitsFeatureEnabled: boolean, product: SimpleProduct): number {\r\n if (isQuantityLimitsFeatureEnabled && product?.Behavior?.MaximumQuantity && product.Behavior.MaximumQuantity > 0) {\r\n return product.Behavior.MaximumQuantity;\r\n }\r\n\r\n return updateMaxQuantityForCartLineItem(this.props.context.app.config.maxQuantityForCartLineItem);\r\n }\r\n\r\n private _getQuantity(product: SimpleProduct, isOrderQuantityLimitsFeatureEnabled: boolean): number {\r\n const { quantity } = this.state;\r\n let defaultQuantity = 1;\r\n\r\n if (quantity !== defaultQuantity || !isOrderQuantityLimitsFeatureEnabled) {\r\n return quantity;\r\n }\r\n\r\n const cartConfiguration = this.props.data.cartConfiguration;\r\n const applyDefaultOrderSettingsForCartLine = cartConfiguration?.result?.ValidateDefaultOrderSettingsPerLine ?? false;\r\n if (!applyDefaultOrderSettingsForCartLine) {\r\n return quantity;\r\n }\r\n\r\n if (product?.Behavior?.DefaultQuantity && product.Behavior.DefaultQuantity > 0) {\r\n defaultQuantity = product.Behavior.DefaultQuantity;\r\n }\r\n\r\n return defaultQuantity;\r\n }\r\n\r\n private readonly _getDropdownName = (dimensionType: number, resources: IExtBuyboxResources): string => {\r\n const isGiftCard = this.props.data.product.result?.IsGiftCard;\r\n\r\n switch (dimensionType) {\r\n case 1: // ProductDimensionType.Color\r\n return resources.productDimensionTypeColor;\r\n case 2: // ProductDimensionType.Configuration\r\n return resources.productDimensionTypeConfiguration;\r\n case 3: // ProductDimensionType.Size\r\n return resources.productDimensionTypeSize;\r\n case 4: // ProductDimensionType.Style\r\n return isGiftCard ? resources.productDimensionTypeAmount : resources.productDimensionTypeStyle;\r\n default:\r\n return '';\r\n }\r\n };\r\n\r\n private async _isOrderQuantityLimitsFeatureEnabled(): Promise {\r\n const featureStatuses = await this.props.data.featureState;\r\n\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 const useSiteBuilderSettings = featureStatuses?.find(\r\n featureState => featureState.Name === RevertToSiteBuilderOrderQuantityLimitsSettingsCRTFeatureName\r\n )?.IsEnabled;\r\n\r\n if (useSiteBuilderSettings) {\r\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'none') {\r\n return false;\r\n }\r\n\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\r\n return true;\r\n }\r\n let customerInfo;\r\n try {\r\n customerInfo = await this.props.data.customerInformation;\r\n } catch (error) {\r\n this.props.telemetry.information(error);\r\n this.props.telemetry.debug('Unable to receive Customer Information. May be user is not authorized');\r\n return false;\r\n }\r\n\r\n return (\r\n customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b))\r\n );\r\n } else {\r\n const cartConfiguration = await this.props.data.cartConfiguration;\r\n return !(cartConfiguration?.IgnoreOrderSettings ?? false);\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 _isChannelLimitsFeatureEnabled(): Promise {\r\n const featureStatuses = await this.props.data.featureState;\r\n\r\n const isChannelLimitsFeatureEnabledInHq = featureStatuses?.find(\r\n featureState => featureState.Name === EcommerceQuantityLimitConfigurationsFeatureName\r\n )?.IsEnabled;\r\n\r\n return isChannelLimitsFeatureEnabledInHq ?? false;\r\n }\r\n}\r\n\r\nexport default Buybox;\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 { IBuyboxViewProps } from './ext-buybox';\r\nimport { IBuyboxFindInStoreViewProps } from './components/ext-buybox-find-in-store';\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 rating,\r\n inventoryLabel,\r\n shopSimilarLook,\r\n keyInPrice,\r\n shopSimilarDescription,\r\n unitOfMeasure,\r\n productComparisonButton,\r\n variantColorName\r\n } = props;\r\n\r\n return (\r\n \r\n {props.mediaGallery}\r\n \r\n {title}\r\n {price}\r\n {unitOfMeasure}\r\n {props.bulkPurchaseLink}\r\n {description}\r\n {rating}\r\n {props.config.showColorName && variantColorName && {variantColorName}}\r\n {configure && _renderConfigure(configure)}\r\n {keyInPrice && _renderKeyInPrice(keyInPrice)}\r\n {quantity && _renderQuantity(quantity)}\r\n {inventoryLabel}\r\n {addToCart && _renderAddToCart(addToCart)}\r\n {findInStore && _renderFindInStore(findInStore)}\r\n {addToOrderTemplate && _renderAddToOrderTemplate(addToOrderTemplate)}\r\n {addToWishlist && _renderAddToWishlist(addToWishlist)}\r\n {_renderSocialShare(props.slots && props.slots.socialShare)}\r\n {productComparisonButton}\r\n {shopSimilarLook && _renderShopSimilarItem(shopSimilarLook)}\r\n {shopSimilarDescription && _renderShopSimilarItem(shopSimilarDescription)}\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\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\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 \r\n {heading}\r\n {errors}\r\n \r\n {input}\r\n \r\n );\r\n};\r\n\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 _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","/*!\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 { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport { ProductPrice, ProductType, SalesAgreementPriceLine, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { Button, format, ICollapseProps } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\n\r\nconst defaultPrice: number = 0;\r\nconst freePrice: number = 0;\r\n\r\n/**\r\n * Interface for price component resources.\r\n * @param {string} priceRangeSeparator - The price range separator.\r\n */\r\nexport interface IPriceComponentResources {\r\n priceRangeSeparator?: string;\r\n salesAgreementPricePrompt?: string;\r\n salesAgreementExpirationDatePrompt?: string;\r\n salesAgreementCommittedQuantityPrompt?: string;\r\n salesAgreementRemainingQuantityPrompt?: string;\r\n memberPriceMessage?: string;\r\n saleMessage?: string;\r\n}\r\n\r\n/**\r\n * Interface for price component props.\r\n * @param {boolean} isPriceMinMaxEnabled - Whether the price range feature is enabled or not.\r\n * @param {IPriceComponentResources} priceResources - The price range resources.\r\n */\r\nexport interface IPriceComponentProps extends IComponentProps<{ price: ProductPrice }> {\r\n className?: string;\r\n product?: SimpleProduct;\r\n savingsText?: string;\r\n freePriceText?: string;\r\n originalPriceText?: string;\r\n currentPriceText?: string;\r\n isPriceMinMaxEnabled?: boolean;\r\n isSalesAgreementPriceFeatureEnabled?: boolean;\r\n salesAgreementLineId?: number;\r\n priceResources?: IPriceComponentResources;\r\n salesAgreementDetailCollapseProps?: ICollapseProps;\r\n currencyCode?: string;\r\n showDiscountBox?: boolean;\r\n salesAgreementDetailOnClick?(event: React.MouseEvent | React.KeyboardEvent): void;\r\n}\r\n\r\n/**\r\n * The interface of price component.\r\n */\r\nexport interface IPriceComponent extends IComponent {}\r\n\r\nconst priceComponentActions = {};\r\n\r\n/**\r\n * Get the original price from price component props.\r\n * @param props - The IPriceComponentProps.\r\n * @returns The original price.\r\n */\r\nconst getOriginalPrice = (props: IPriceComponentProps): number => {\r\n return Math.max(\r\n props.data.price.BasePrice || defaultPrice,\r\n props.data.price.TradeAgreementPrice || defaultPrice,\r\n props.data.price.AdjustedPrice || defaultPrice\r\n );\r\n};\r\n\r\nconst getActivePrice = (props: IPriceComponentProps): number => {\r\n if (showPriceRangeForMasterProduct(props) && props.data.price.MinVariantPrice !== undefined) {\r\n return props.data.price.MinVariantPrice;\r\n }\r\n\r\n if (props.data.price.CustomerContextualPrice !== undefined) {\r\n return props.data.price.CustomerContextualPrice;\r\n }\r\n\r\n return getOriginalPrice(props);\r\n};\r\n\r\n/**\r\n * Get the formatted currency.\r\n * @param props - The props.\r\n * @param price - The price.\r\n * @param shouldUseFreePriceText - The shouldUseFreePriceText.\r\n * @returns The formatted currency.\r\n */\r\nconst formatCurrency = (\r\n props: IPriceComponentProps,\r\n price: number | undefined,\r\n shouldUseFreePriceText: boolean | undefined,\r\n currencyCode?: string | undefined\r\n): string => {\r\n if (price === undefined) {\r\n return '';\r\n }\r\n\r\n if (shouldUseFreePriceText && price === freePrice && props.freePriceText) {\r\n return props.freePriceText;\r\n }\r\n\r\n return props.context.cultureFormatter.formatCurrency(price, currencyCode);\r\n};\r\n\r\nconst showPriceRangeForMasterProduct = (props: IPriceComponentProps): boolean => {\r\n return (\r\n (props.isPriceMinMaxEnabled ?? false) &&\r\n (props.product?.ProductTypeValue === ProductType.Master || props.product?.ProductTypeValue === ProductType.KitMaster) &&\r\n props.data.price.MinVariantPrice !== undefined &&\r\n props.data.price.MaxVariantPrice !== undefined\r\n );\r\n};\r\n\r\n/**\r\n * ShowStrikethroughPricing.\r\n * @param props - The props.\r\n * @returns True if showStrikethroughPricing, false otherwise.\r\n */\r\nconst showStrikethroughPricing = (props: IPriceComponentProps): boolean => {\r\n const originalSalesPrice = getOriginalPrice(props);\r\n const activeSalesPrice = showPriceRangeForMasterProduct(props)\r\n ? props.data.price.MinVariantPrice\r\n : props.data.price.CustomerContextualPrice;\r\n\r\n if (activeSalesPrice && originalSalesPrice) {\r\n return activeSalesPrice < originalSalesPrice;\r\n }\r\n\r\n return false;\r\n};\r\n\r\n/**\r\n * Render current price.\r\n * @param props - The props.\r\n * @returns The JSX.Element.\r\n */\r\nconst renderCurrentPrice = (\r\n props: IPriceComponentProps,\r\n priceClass: string = 'msc-price__actual',\r\n isMemberDiscount: boolean = false\r\n): JSX.Element => {\r\n const maxVariantPrice: string = formatCurrency(props, props.data.price.MaxVariantPrice, false, props.currencyCode);\r\n const minVariantPrice: string = formatCurrency(props, props.data.price.MinVariantPrice, false, props.currencyCode);\r\n if (\r\n props.isPriceMinMaxEnabled &&\r\n props.data.price.MaxVariantPrice &&\r\n props.data.price.MinVariantPrice &&\r\n props.data.price.MaxVariantPrice > props.data.price.MinVariantPrice\r\n ) {\r\n return (\r\n \r\n \r\n {minVariantPrice}\r\n \r\n \r\n {props.priceResources?.priceRangeSeparator}\r\n \r\n \r\n {maxVariantPrice}\r\n \r\n \r\n );\r\n }\r\n\r\n return (\r\n \r\n {isMemberDiscount && !props.showDiscountBox && `${props.priceResources?.memberPriceMessage} `}\r\n {formatCurrency(props, getActivePrice(props), true, props.currencyCode)}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Render active sales price with original sales price.\r\n * @param props - The props.\r\n * @returns The JSX.Element.\r\n */\r\nconst renderCurrentPriceWithOriginalPrice = (props: IPriceComponentProps): JSX.Element => {\r\n const initialPrice: string = formatCurrency(props, getOriginalPrice(props), true);\r\n return (\r\n <>\r\n \r\n {` `}\r\n {props.originalPriceText}\r\n {` `}\r\n {initialPrice}\r\n {` `}\r\n {props.currentPriceText}\r\n {` `}\r\n {renderCurrentPrice(props, 'msc-price__discount')}\r\n \r\n \r\n \r\n {props.savingsText && {props.savingsText}}\r\n \r\n );\r\n};\r\n\r\nconst renderSalesAgreementDetail = (props: IPriceComponentProps): JSX.Element => {\r\n // In most cases there should be only one sales agreement line.\r\n // If there are more than one, only the first one will be shown.\r\n const firstPriceLine: SalesAgreementPriceLine = (props.data.price.AttainablePriceLines ?? [])[0] as SalesAgreementPriceLine;\r\n return (\r\n

\r\n

\r\n {/* Available date */}\r\n {` · ${format(\r\n props.priceResources?.salesAgreementExpirationDatePrompt ?? '',\r\n props.context.cultureFormatter.formatDate(firstPriceLine.EffectiveDate as Date),\r\n props.context.cultureFormatter.formatDate(firstPriceLine.ExpirationDate as Date)\r\n )}`}\r\n

\r\n

\r\n {/* Quantity commitment */}\r\n {` · ${format(props.priceResources?.salesAgreementCommittedQuantityPrompt ?? '', firstPriceLine.CommittedQuantity)}`}\r\n

\r\n

\r\n {/* Remaining quantity to qualify */}\r\n {` · ${format(props.priceResources?.salesAgreementRemainingQuantityPrompt ?? '', firstPriceLine.RemainingQuantity)}`}\r\n

\r\n

\r\n );\r\n};\r\n\r\n/**\r\n * Render member price.\r\n * @param props - The props.\r\n * @returns The JSX.Element.\r\n */\r\nconst renderMemberPrice = (props: IPriceComponentProps): JSX.Element => {\r\n const initialPrice: string = formatCurrency(props, getOriginalPrice(props), true);\r\n //No strikethrough in member price\r\n return (\r\n <>\r\n \r\n {` `}\r\n {props.originalPriceText}\r\n {` `}\r\n {initialPrice}\r\n {` `}\r\n {props.currentPriceText}\r\n {` `}\r\n {renderCurrentPrice(props, 'msc-price__discount__member', true)}\r\n \r\n \r\n \r\n {props.savingsText && {props.savingsText}}\r\n \r\n );\r\n};\r\n\r\nfunction renderDiscountBox(props: IPriceComponentProps, isMemberDiscount: boolean) {\r\n var discount = 0;\r\n if (props.data.price.CustomerContextualPrice !== undefined && props.data.price.BasePrice !== undefined) {\r\n var diff = props.data.price.CustomerContextualPrice - props.data.price.BasePrice;\r\n discount = (diff / props.data.price.BasePrice) * 100;\r\n }\r\n if (props.data.price?.BasePrice !== props.data.price?.CustomerContextualPrice) {\r\n if (isMemberDiscount) {\r\n return (\r\n
\r\n

{`${props.priceResources?.memberPriceMessage} `}

\r\n
\r\n );\r\n } else {\r\n return (\r\n
\r\n

{`${props.priceResources?.saleMessage}${Math.abs(discount).toFixed(0)}%`}

\r\n
\r\n );\r\n }\r\n } else {\r\n return null;\r\n }\r\n}\r\n\r\n/**\r\n * Price.\r\n * @param props - The props.\r\n * @returns The JSX.Element.\r\n */\r\nconst Price: React.FC = (props: IPriceComponentProps): JSX.Element | null => {\r\n // CustomerContextualPrice could be zero\r\n if (props.data.price.CustomerContextualPrice === undefined) {\r\n return null;\r\n }\r\n\r\n //TODO: Not a priority - but should be fixed\r\n var isMemberDiscount = false;\r\n props.data.price.DiscountLines?.forEach(discount => {\r\n if (discount.OfferName?.toLowerCase().includes(props.context.request.app.config.loyaltyDiscountIdentifier)) {\r\n isMemberDiscount = true;\r\n }\r\n });\r\n\r\n // Determine if contract price is avaiable/applied by:\r\n // isFeatureEnabled and SA price != 0, for PDP.\r\n // SA line id != 0, for cart line.\r\n if (props.isSalesAgreementPriceFeatureEnabled && props.data.price.SalesAgreementPrice !== 0) {\r\n const [isExpanded, setIsExpanded] = React.useState(false);\r\n const toggle = () => {\r\n setIsExpanded(!isExpanded);\r\n };\r\n return (\r\n \r\n \r\n

\r\n {formatCurrency(props, props.data.price.SalesAgreementPrice ?? props.data.price.CustomerContextualPrice, true)}\r\n

\r\n \r\n {props.priceResources?.salesAgreementPricePrompt}\r\n \r\n {isExpanded && renderSalesAgreementDetail(props)}\r\n
\r\n
\r\n );\r\n }\r\n\r\n return (\r\n
\r\n {isMemberDiscount ? (\r\n {renderMemberPrice(props)}\r\n ) : (\r\n \r\n {showStrikethroughPricing(props) ? renderCurrentPriceWithOriginalPrice(props) : renderCurrentPrice(props)}\r\n \r\n )}\r\n {props.showDiscountBox && renderDiscountBox(props, isMemberDiscount)}\r\n
\r\n );\r\n};\r\n\r\n/**\r\n * The PriceComponent.\r\n */\r\nexport const PriceComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride(\r\n 'Price',\r\n { component: Price, ...priceComponentActions }\r\n);\r\n\r\nexport default PriceComponent;\r\n","/**\r\n * Centralised location for checkout generic data updates\r\n */\r\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * Gets the CommercialName from a list of attributes - returns the product name if no commercial name attribute is present\r\n * @param attributes\r\n * @param productName\r\n * @param commercialStyleNameAttribute\r\n * @returns\r\n */\r\nexport const getCommercialName = (\r\n attributes: AttributeValue[] = [],\r\n productName: string = '',\r\n commercialStyleNameAttribute: string = 'CommercialStyleName'\r\n): string => {\r\n var styleName = attributes.find(x => x.Name === commercialStyleNameAttribute);\r\n var productBrand = productName?.split(' ')[0] ?? '';\r\n if (styleName?.TextValue) {\r\n return `${productBrand} ${styleName?.TextValue}`;\r\n }\r\n\r\n return productName;\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 {\r\n AddToOrderTemplateComponent,\r\n IAddToOrderTemplateDialogResources,\r\n IDuplicateItemsWhenAddingToOrderTemplateDialogResources,\r\n IItemAddedToOrderTemplateDialogResources,\r\n IOrderTemplateActionErrorResult,\r\n IOrderTemplateNameDialogResources\r\n} from '@msdyn365-commerce/components';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n getConfigureErrors,\r\n IBuyboxCallbacks,\r\n IBuyboxCommonResources,\r\n IBuyboxData,\r\n IBuyboxState,\r\n IBuyboxViewProps\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport * as React from 'react';\r\n\r\nimport { IBuyboxProps as IBuyboxExtentionProps } from '../../definition-extensions/buybox.ext.props.autogenerated';\r\n\r\n/**\r\n * To generate AddToOrderTemplateDialog resources.\r\n * @param resources - The resources.\r\n * @returns -- Returns the list of AddToOrderTemplateDialog resources..\r\n */\r\nfunction generateAddToOrderTemplateDialogResources(resources: IBuyboxCommonResources): IAddToOrderTemplateDialogResources {\r\n return {\r\n addToOrderTemplateHeader: resources.addToOrderTemplateHeader,\r\n\r\n noOrderTemplatesMessage: resources.noOrderTemplatesMessage,\r\n noOrderTemplatesDescription: resources.noOrderTemplatesDescription,\r\n\r\n createAnOrderTemplateButtonText: resources.createAnOrderTemplateButtonText,\r\n createNewOrderTemplateButtonText: resources.createNewOrderTemplateButtonText,\r\n cancelOrderTemplateCreationButtonText: resources.cancelOrderTemplateCreationButtonText,\r\n\r\n selectTemplatesText: resources.selectTemplatesText,\r\n addToTemplateButtonText: resources.addToTemplateButtonText,\r\n lineItemsText: resources.lineItemsText\r\n };\r\n}\r\n\r\n/**\r\n * To generate OrderTemplateNameDialog resources.\r\n * @param resources - The resources.\r\n * @returns -- Returns the list of OrderTemplateNameDialog resources..\r\n */\r\nfunction generateOrderTemplateNameDialogResources(resources: IBuyboxCommonResources): IOrderTemplateNameDialogResources {\r\n return {\r\n orderTemplateHeaderLabel: resources.createOrderTemplateHeader,\r\n orderTemplateTitleLabel: resources.orderTemplateTitle,\r\n orderTemplateNameAriaLabel: resources.orderTemplateNameAriaLabel,\r\n orderTemplateDescription: resources.createOrderTemplateDescription,\r\n\r\n defaultOrderTemplateName: resources.defaultOrderTemplateName,\r\n\r\n orderTemplateButtonLabel: resources.createOrderTemplateButtonText,\r\n orderTemplateCancelButtonLabel: resources.cancelNewOrderTemplateCreationButtonText\r\n };\r\n}\r\n\r\n/**\r\n * To generate ItemAddedToOrderTemplateDialog resources.\r\n * @param resources - The resources.\r\n * @returns -- Returns the list of ItemAddedToOrderTemplateDialog resources..\r\n */\r\nfunction generateItemAddedToOrderTemplateDialogResources(resources: IBuyboxCommonResources): IItemAddedToOrderTemplateDialogResources {\r\n return {\r\n viewOrderTemplateButtonText: resources.viewOrderTemplateButtonText,\r\n continueShoppingButtonText: resources.continueShoppingButtonText,\r\n itemAddedToOrderTemplateHeaderItemOneText: resources.itemAddedToOrderTemplateHeaderItemOneText,\r\n itemAddedToOrderTemplateHeaderItemFormatText: resources.itemAddedToOrderTemplateHeaderItemFormatText,\r\n itemAddedToOrderTemplateHeaderMessageText: resources.itemAddedToOrderTemplateHeaderMessageText,\r\n freePriceText: resources.priceFree,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText\r\n };\r\n}\r\n\r\n/**\r\n * To generate DuplicateItemsWhenAddingToOrderTemplateDialog resources.\r\n * @param resources - The resources.\r\n * @returns -- Returns the list of DuplicateItemsWhenAddingToOrderTemplateDialog resources..\r\n */\r\nfunction generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(\r\n resources: IBuyboxCommonResources\r\n): IDuplicateItemsWhenAddingToOrderTemplateDialogResources {\r\n return {\r\n duplicatedProductsHeader: resources.duplicatedProductsHeader,\r\n duplicatedProductsDescription: resources.duplicatedProductsDescription,\r\n updateQuantityButtonText: resources.updateQuantityButtonText,\r\n cancelDuplicateItemsButtonText: resources.cancelDuplicateItemsButtonText\r\n };\r\n}\r\n\r\n/**\r\n * Add to wishlist failed function.\r\n * @param callbacks -Buybox callbacks.\r\n * @param resources -Buybox resources.\r\n * @param product -Simple product.\r\n * @returns Update error state.\r\n */\r\nconst onAddToOrderTemplateFailed = (callbacks: IBuyboxCallbacks, resources: IBuyboxCommonResources, product: SimpleProduct | undefined) => (\r\n result: IOrderTemplateActionErrorResult\r\n) => {\r\n callbacks.updateErrorState({\r\n errorHost: 'ORDER_TEMPLATE',\r\n configureErrors:\r\n result.status === 'MISSING_DIMENSION' ? getConfigureErrors(result.missingDimensions, resources, product?.IsGiftCard) : {}\r\n });\r\n};\r\n\r\n/**\r\n * RenderAddToOrderTemplateButton.\r\n * @param props - Buybox view props.\r\n * @param state - Buybox state.\r\n * @param callbacks - Buybox callbacks.\r\n * @param product - Product data.\r\n * @returns -- Returns JSX element.\r\n */\r\nexport const renderAddToOrderTemplateButton = (\r\n props: IBuyboxViewProps & IBuyboxExtentionProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks,\r\n product: SimpleProduct\r\n): React.ReactNode => {\r\n const {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from module file.\r\n id,\r\n typeName,\r\n context,\r\n data: {\r\n orderTemplates: { result: orderTemplates },\r\n customerInformation: { result: customerInformation }\r\n },\r\n resources,\r\n config\r\n } = props;\r\n\r\n const { quantity } = state;\r\n\r\n const isShowButtonText = true;\r\n const isMultipleCatalogsFeatureEnabled = props.isChannelMultipleCatalogsFeatureEnabled || false;\r\n return (\r\n orderTemplates && (\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 { AddToWishlistComponent, IWishlistActionErrorResult } from '@msdyn365-commerce/components';\r\nimport { format, ItemAvailability, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { IStoreInfo } from '@msdyn365-commerce-modules/bopis-utilities';\r\nimport {\r\n getConfigureErrors,\r\n IBuyboxAddToCartViewProps,\r\n IBuyboxCallbacks,\r\n IBuyboxCommonResources,\r\n IBuyboxData,\r\n IBuyboxFindInStoreViewProps,\r\n IBuyboxKeyInPriceViewProps,\r\n IBuyboxProductConfigureDropdownViewProps,\r\n IBuyboxProductConfigureViewProps,\r\n IBuyboxProductQuantityViewProps,\r\n IBuyboxResources as IBuyboxExtentionResources,\r\n IBuyboxShopSimilarLookViewProps,\r\n IBuyboxState\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport {\r\n ArrayExtensions,\r\n getFullAvailableInventoryNearby,\r\n GetFullAvailableInventoryNearbyInput,\r\n IFullOrgUnitAvailability\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { IncrementalQuantity, INodeProps, ITelemetryContent, Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport { reaction } from 'mobx';\r\nimport * as React from 'react';\r\n\r\nimport { IBuyboxProps as IBuyboxExtentionProps, IBuyboxProps } from '../definition-extensions/buybox.ext.props.autogenerated';\r\nimport { renderAddToOrderTemplateButton } from './components/buybox-add-to-order-template';\r\nimport { IExtBuyboxProps } from '../definition-extensions/ext-buybox.ext.props.autogenerated';\r\nimport { IBuyboxViewProps } from '../../../modules/ext-buybox';\r\n\r\n/**\r\n * BuyBoxConstants enum.\r\n */\r\nexport enum BuyBoxConstants {\r\n zero = 0\r\n}\r\n\r\n/**\r\n * On Change function.\r\n * @param callbacks -Callbacks.\r\n * @returns Update quantity.\r\n */\r\nconst onChangeHandler = (callbacks: IBuyboxCallbacks) => (newValue: number): boolean => {\r\n if (callbacks.updateQuantity) {\r\n return callbacks.updateQuantity(newValue);\r\n }\r\n return true;\r\n};\r\n\r\n/**\r\n * RenderQuantity.\r\n * @param quantityComponent - QuantityComponent.\r\n * @param callbacks - Callbacks.\r\n * @param props - Props.\r\n * @param state - State.\r\n * @param extentionResources - ExtentionResources.\r\n * @param quantityLimitsMessages - QuantityLimitsMessages.\r\n * @param max - Max.\r\n * @param telemetryContent - TelemetryContent.\r\n * @param unitOfMeasure - Unit Of Measure.\r\n * @returns -- Returns.\r\n */\r\nconst renderQuantity = (\r\n quantityComponent: IBuyboxProductQuantityViewProps,\r\n callbacks: IBuyboxCallbacks,\r\n props: IBuyboxProps,\r\n state: IBuyboxState,\r\n extentionResources: IBuyboxExtentionResources,\r\n quantityLimitsMessages: React.ReactNode,\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\r\n max: number | undefined,\r\n telemetryContent?: ITelemetryContent,\r\n unitOfMeasure?: React.ReactNode\r\n): JSX.Element => {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\r\n const { ContainerProps, LabelContainerProps, heading, errors } = quantityComponent;\r\n\r\n const { resources } = props;\r\n\r\n const { quantity } = state;\r\n\r\n return (\r\n \r\n \r\n {heading}\r\n {errors}\r\n \r\n\r\n \r\n {unitOfMeasure}\r\n {quantityLimitsMessages}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Render key in price function.\r\n * @param keyInPrice - KeyInPrice.\r\n * @returns -- Returns.\r\n */\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\n/**\r\n * RenderAddToCart.\r\n * @param addToCart - AddToCart.\r\n * @returns -- Returns.\r\n */\r\nconst renderAddToCart = (addToCart: IBuyboxAddToCartViewProps): JSX.Element => {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\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/**\r\n * RenderFindInStore.\r\n * @param findInStore - FindInStore.\r\n * @returns -- Returns.\r\n */\r\nconst renderFindInStore = (findInStore: IBuyboxFindInStoreViewProps): JSX.Element => {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\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\n/**\r\n * RenderAddToOrderTemplate.\r\n * @param props - Buybox view props.\r\n * @param state - Buybox state.\r\n * @param callbacks - Buybox callbacks.\r\n * @returns -- Returns.\r\n */\r\nconst renderAddToOrderTemplate = (\r\n props: IBuyboxViewProps & IBuyboxExtentionProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks\r\n): JSX.Element | null => {\r\n const product = props.data.product.result;\r\n if (!props.addToOrderTemplate || !product) {\r\n return null;\r\n }\r\n\r\n const orderTemplateButton = renderAddToOrderTemplateButton(props, state, callbacks, product);\r\n\r\n return (\r\n \r\n {props.addToOrderTemplate.errorBlock}\r\n {orderTemplateButton}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Add to wishlist failed function.\r\n * @param callbacks -Buybox callbacks.\r\n * @param resources -Buybox resources.\r\n * @param product -Simple product.\r\n * @returns Update error state.\r\n */\r\nconst onAddToWishlistFailed = (callbacks: IBuyboxCallbacks, resources: IBuyboxCommonResources, product: SimpleProduct | undefined) => (\r\n result: IWishlistActionErrorResult\r\n) => {\r\n callbacks.updateErrorState({\r\n errorHost: 'WISHLIST',\r\n configureErrors:\r\n result.status === 'MISSINGDIMENSION' ? getConfigureErrors(result.missingDimensions, resources, product?.IsGiftCard) : {}\r\n });\r\n};\r\n\r\n/**\r\n * RenderAddToWishlist.\r\n * @param props - Buybox view props.\r\n * @param state - Buybox state.\r\n * @param callbacks - Buybox callbacks.\r\n * @param product - Product data.\r\n * @returns -- Returns.\r\n */\r\nconst renderAddtoWishlistButton = (\r\n props: IBuyboxViewProps & IBuyboxExtentionProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks,\r\n product: SimpleProduct\r\n): React.ReactNode => {\r\n const { context, resources } = props;\r\n const wishlists = props.data.wishlists.result;\r\n const isShowWishlitButtonText = true;\r\n return (\r\n \r\n );\r\n};\r\n\r\n/**\r\n * RenderAddToWishlist.\r\n * @param props - Buybox viewprops.\r\n * @param state - Buybox state.\r\n * @param callbacks - Buybox callbacks.\r\n * @returns -- Returns.\r\n */\r\nconst renderAddToWishlist = (\r\n props: IBuyboxViewProps & IBuyboxExtentionProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks\r\n): JSX.Element | null => {\r\n const product = props.data.product.result;\r\n if (!props.addToWishlist || !product) {\r\n return null;\r\n }\r\n\r\n if (!props.config.enableWishlist) {\r\n return null;\r\n }\r\n\r\n const wishlistButton = renderAddtoWishlistButton(props, state, callbacks, product);\r\n return (\r\n \r\n {props.addToWishlist.errorBlock}\r\n {wishlistButton}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * RRenderShopSimilarItem.\r\n * @param shopSimilarItem - ShopSimilarItem.\r\n * @returns -- Returns.\r\n */\r\nconst renderShopSimilarItem = (shopSimilarItem: IBuyboxShopSimilarLookViewProps): JSX.Element => {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\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\n\r\n/**\r\n * RenderSocialShare.\r\n * @param socialShare - Social share react node array.\r\n * @returns -- Returns.\r\n */\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\n/**\r\n * RenderConfigureDropdown.\r\n * @param dropdown - Buybox product configure dropdown view props.\r\n * @returns -- Returns JSX.Element.\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 {heading}\r\n {select}\r\n {errors}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * RenderConfigure.\r\n * @param configure - Buybox product configure view props.\r\n * @returns -- Returns JSX.Element.\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/**\r\n * BuyboxView.\r\n * @param props - Props.\r\n * @returns -- Returns.\r\n */\r\nconst BuyboxView: React.FC> = props => {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\r\n const {\r\n ModuleProps,\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\r\n MediaGalleryContainerProps,\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\r\n ProductInfoContainerProps,\r\n addToCart,\r\n addToOrderTemplate,\r\n addToWishlist,\r\n productComparisonButton,\r\n configure,\r\n description,\r\n findInStore,\r\n quantity,\r\n price,\r\n title,\r\n rating,\r\n inventoryLabel,\r\n shopSimilarLook,\r\n keyInPrice,\r\n shopSimilarDescription,\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\r\n max,\r\n unitOfMeasure,\r\n callbacks,\r\n state,\r\n resources,\r\n quantityLimitsMessages,\r\n telemetryContent,\r\n app: { config: appConfig },\r\n catalogs,\r\n variantColorName\r\n } = props;\r\n let skuText: string = props.resources.skuText;\r\n skuText += props.data.product.result?.ItemId;\r\n const preferredStoreInfo: IStoreInfo | undefined = props.data.storeSelectorStateManager.result?.preferredStore;\r\n const preferredStoreId = preferredStoreInfo?.StoreId ? preferredStoreInfo.StoreId : '';\r\n const preferredStoreName = preferredStoreInfo?.StoreName ? preferredStoreInfo.StoreName : '';\r\n\r\n const [availability, setAvailability] = React.useState('');\r\n const [isStoreChange, setIsStoreChange] = React.useState(false);\r\n\r\n /**\r\n * GetStockInventoryLabel.\r\n * @param availabilityWithHours - Stock availability with hours.\r\n * @returns -- Returns.\r\n */\r\n const getStockInventoryLabel = (availabilityWithHours: IFullOrgUnitAvailability | undefined): string | undefined => {\r\n if (availabilityWithHours && ArrayExtensions.hasElements(availabilityWithHours.ProductInventoryInformation)) {\r\n for (const productInventoryInformation of availabilityWithHours.ProductInventoryInformation) {\r\n if (\r\n availabilityWithHours.OrgUnitAvailability?.OrgUnitLocation?.InventoryLocationId ===\r\n productInventoryInformation.InventLocationId\r\n ) {\r\n return productInventoryInformation.StockLevelLabel;\r\n }\r\n }\r\n }\r\n\r\n return undefined;\r\n };\r\n\r\n const getInventory = React.useCallback(async () => {\r\n const input = new GetFullAvailableInventoryNearbyInput(\r\n props.data.product.result?.RecordId,\r\n BuyBoxConstants.zero,\r\n BuyBoxConstants.zero,\r\n BuyBoxConstants.zero,\r\n BuyBoxConstants.zero,\r\n true\r\n );\r\n\r\n /**\r\n * IsProductInStock.\r\n * @param itemAvailabilities - Item availability array.\r\n * @returns -- Returns.\r\n */\r\n const isProductInStock = (itemAvailabilities: ItemAvailability[] | undefined): boolean => {\r\n if (!appConfig.enableStockCheck) {\r\n return true;\r\n }\r\n\r\n if (ArrayExtensions.hasElements(itemAvailabilities)) {\r\n return itemAvailabilities[BuyBoxConstants.zero].AvailableQuantity! > BuyBoxConstants.zero;\r\n }\r\n\r\n return false;\r\n };\r\n\r\n await getFullAvailableInventoryNearby(input, props.context.actionContext)\r\n .catch((error: Error) => {\r\n props.telemetry.error(error.message);\r\n })\r\n .then(response => {\r\n if (response && ArrayExtensions.hasElements(response)) {\r\n const isPreferredStore = (value: IFullOrgUnitAvailability) =>\r\n value.OrgUnitAvailability?.OrgUnitLocation?.OrgUnitNumber === preferredStoreId;\r\n const filteredFullOrgUnitAvailability = response.filter(isPreferredStore);\r\n const preferredStoreAvailability = ArrayExtensions.hasElements(filteredFullOrgUnitAvailability)\r\n ? filteredFullOrgUnitAvailability[BuyBoxConstants.zero]\r\n : undefined;\r\n const stockStatusLabel: string | undefined = getStockInventoryLabel(preferredStoreAvailability);\r\n const isInStock = isProductInStock(preferredStoreAvailability?.OrgUnitAvailability?.ItemAvailabilities);\r\n const resourceLabel = isInStock ? props.resources.inStockText : props.resources.outOfStockText;\r\n const stockText: string | undefined = stockStatusLabel ? stockStatusLabel : resourceLabel;\r\n const preferredStoreAvailabilityText = `${format(\r\n props.resources.availabilityAtPreferredStoreText,\r\n preferredStoreName\r\n )} ${stockText}`;\r\n setAvailability(preferredStoreAvailabilityText);\r\n }\r\n });\r\n\r\n setIsStoreChange(false);\r\n }, [\r\n props.data.product.result?.RecordId,\r\n appConfig.enableStockCheck,\r\n preferredStoreId,\r\n preferredStoreName,\r\n props.context.actionContext,\r\n props.resources.availabilityAtPreferredStoreText,\r\n props.resources.inStockText,\r\n props.resources.outOfStockText,\r\n props.telemetry\r\n ]);\r\n\r\n React.useEffect(() => {\r\n if (props.config.displayStockAvailability) {\r\n getInventory().catch((error: Error) => {\r\n props.telemetry.error(error.message);\r\n });\r\n }\r\n }, [getInventory, isStoreChange, props.telemetry, props.config.displayStockAvailability]);\r\n\r\n reaction(\r\n () => props.data.storeSelectorStateManager.result?.selectedStoreLocationId,\r\n () => {\r\n setIsStoreChange(true);\r\n }\r\n );\r\n\r\n /**\r\n * RenderAvailabiltyAtPreferredStore.\r\n * @returns -- Returns.\r\n */\r\n const renderAvailabilityAtPreferredStore = (): JSX.Element | undefined => {\r\n const hasProductDimensions = ArrayExtensions.hasElements(props.data.product.result?.Dimensions);\r\n if (hasProductDimensions && props.data.product.result?.MasterProductId === undefined) {\r\n return undefined;\r\n }\r\n const containerProps: INodeProps = {\r\n className: 'ms-buybox__preferred-store-availability',\r\n tag: 'span'\r\n };\r\n\r\n return {availability};\r\n };\r\n return (\r\n \r\n {props.mediaGallery}\r\n \r\n {catalogs && catalogs[0].Name}\r\n {title}\r\n \r\n
{skuText}
\r\n {rating}\r\n
\r\n \r\n
{props.resources.priceText}
\r\n {price}\r\n
\r\n {configure && renderConfigure(configure)}\r\n {props.config.showColorName && {variantColorName}}\r\n {keyInPrice && renderKeyInPrice(keyInPrice)}\r\n \r\n
\r\n {quantity &&\r\n renderQuantity(\r\n quantity,\r\n callbacks,\r\n props,\r\n state,\r\n resources,\r\n quantityLimitsMessages,\r\n max,\r\n telemetryContent,\r\n unitOfMeasure\r\n )}\r\n {props.bulkPurchaseLink}\r\n
\r\n
\r\n {props.config.displayStockAvailability && preferredStoreId && renderAvailabilityAtPreferredStore()}\r\n {inventoryLabel}\r\n {renderAddToCart(addToCart)}\r\n {findInStore && renderFindInStore(findInStore)}\r\n {addToWishlist && renderAddToWishlist(props, state, callbacks)}\r\n {productComparisonButton}\r\n {addToOrderTemplate && renderAddToOrderTemplate(props, state, callbacks)}\r\n {findInStore?.productPickupOptionList ? (\r\n
{findInStore.productPickupOptionList}
\r\n ) : null}\r\n {_renderSocialShare(props.slots && props.slots.socialShare)}\r\n
{props.resources.shopText}
\r\n \r\n {shopSimilarLook && renderShopSimilarItem(shopSimilarLook)}\r\n {shopSimilarDescription && renderShopSimilarItem(shopSimilarDescription)}\r\n \r\n {!props.config.hideDescription && \r\n
{props.resources.descriptionText}
\r\n {description}\r\n
}\r\n {ArrayExtensions.hasElements(props.slots.productSpecification) ? (\r\n {props.slots.productSpecification[0]}\r\n ) : null}\r\n
\r\n
\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['ext-buybox'] = {\n c: () => require('partner/modules/ext-buybox/ext-buybox.tsx'),\n $type: 'containerModule',\n da: [{name:'cart', path:'@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action', runOn: 0},{name:'cartConfiguration', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-cart-configuration', runOn: 0},{name:'catalogs', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs', 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: 1},{name:'productAvailableQuantity', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-product-availabilities-for-selected-variant', runOn: 1},{name:'productDimensions', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-dimensions-for-selected-variant', runOn: 0},{name:'productPrice', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant', runOn: 1},{name:'ratingsSummary', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-ratings-summary', runOn: 1},{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: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'ext-buybox',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/ext-buybox'\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-cart-configuration';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-cart-configuration');\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-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-dimensions-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-dimensions-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-ratings-summary';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-ratings-summary');\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 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|ext-buybox|ext-buybox'] = {\n c: () => require('partner/modules/ext-buybox/ext-buybox.view.tsx'),\n cn: '__local__-__local__-ext-buybox'\n };\nviewDictionary['__local__|__local__|themes|only|views|ext-buybox'] = {\n c: () => require('partner/themes/only/views/ext-buybox.view.tsx'),\n cn: '__local__-__local__-ext-buybox'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport MsDyn365, { IActionContext } from '@msdyn365-commerce/core';\nimport { action, computed, observable } from 'mobx';\n\nimport {\n IListMapViewState,\n ILoadMapApiInput,\n IStoreInfo,\n IStoreSelectionStateContext,\n IStoreSelectorLocation,\n IStoreSelectorStateManager\n} from './i-store-selection-state-manager';\n\n/**\n * Abstract instance of IStoreSelectorStateManager with base implementation\n * of everything except the geoLocate function.\n */\nexport abstract class BaseStoreSelectorStateManager implements IStoreSelectorStateManager {\n @computed public get isDialogOpen(): Readonly {\n return this._context !== undefined;\n }\n\n @computed public get context(): Readonly {\n return this._context;\n }\n\n @observable public isMapApiLoaded?: boolean;\n\n @observable public selectedStoreLocationId?: string;\n\n @observable public preferredStore?: IStoreInfo;\n\n @observable public listMapViewState: IListMapViewState = { displayList: true, displayMap: false };\n\n @observable public isMapModuleLoaded?: boolean;\n\n @observable public lastInlineShownStoreInfo?: IStoreInfo;\n\n @observable protected _context?: IStoreSelectionStateContext;\n\n private readonly preferredStoreLocalStorageKey: string = '_msdyn365__preferredStore_';\n\n constructor() {\n this.isMapModuleLoaded = false;\n const value = this._readFromToCookie(this.preferredStoreLocalStorageKey);\n try {\n const storeInfo: IStoreInfo | undefined = value ? JSON.parse(value) : undefined;\n if (storeInfo) {\n this.preferredStore = storeInfo;\n }\n } catch {\n this.preferredStore = undefined;\n }\n }\n\n public abstract geoLocate(searchTerm: string, actionContext: IActionContext): Promise;\n\n public abstract loadMapApi(input: ILoadMapApiInput): Promise;\n\n @action\n public async toggleListMapViewState(): Promise {\n this.listMapViewState = {\n displayList: !this.listMapViewState.displayList,\n displayMap: !this.listMapViewState.displayMap\n };\n }\n\n @action\n public async setMapModuleLoaded(input: boolean): Promise {\n this.isMapModuleLoaded = input;\n }\n\n @action\n public async setOrgUnitStoreInformation(input: IStoreSelectionStateContext): Promise {\n this._context = input;\n }\n\n @action\n public async setSelectedStoreLocationId(storeId: string | undefined): Promise {\n this.selectedStoreLocationId = storeId;\n }\n\n @action\n public async setPreferredStoreLocation(\n storeId?: string,\n storeName?: string | undefined,\n writeToCookie: boolean = false,\n latitude?: number,\n longitude?: number\n ): Promise {\n const storeInfo: IStoreInfo = { StoreId: storeId, StoreName: storeName, Latitude: latitude, Longitude: longitude };\n this.preferredStore = storeInfo;\n if (writeToCookie) {\n this._writeToCookie(this.preferredStoreLocalStorageKey, JSON.stringify(storeInfo));\n }\n }\n\n @action\n public async setLastInlineStoreInfo(latitude?: number, longitude?: number): Promise {\n const storeInfo: IStoreInfo = { StoreId: '', StoreName: '', Latitude: latitude, Longitude: longitude };\n this.lastInlineShownStoreInfo = storeInfo;\n }\n\n @action\n public async clearPreferredStore(writeToCookie: boolean): Promise {\n this.preferredStore = undefined;\n if (writeToCookie) {\n this._removeCookie(this.preferredStoreLocalStorageKey);\n }\n }\n\n @action\n public async openDialog(input: IStoreSelectionStateContext): Promise {\n if (this._context && this._context.id === input.id) {\n throw new Error('Dialog is already opened');\n }\n\n this._context = input;\n }\n\n @action\n public async closeDialog(): Promise {\n this._context = undefined;\n }\n\n private _removeCookie(key: string): void {\n if (!key) {\n return;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n storage.removeItem(key);\n }\n }\n\n private _writeToCookie(key: string, value: string | undefined): void {\n if (!key || !value) {\n return;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n storage.setItem(key, value);\n }\n }\n\n private _readFromToCookie(key: string): string | undefined {\n if (!key) {\n return undefined;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n const cookieValue = storage.getItem(key);\n if (cookieValue) {\n return cookieValue;\n }\n }\n\n return undefined;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { action } from 'mobx';\n\nimport { BaseStoreSelectorStateManager } from './base-store-selector-state-manager';\nimport { ILoadMapApiInput, IStoreSelectorLocation } from './i-store-selection-state-manager';\nimport { IMapWindow, MapLocationsResult } from './models/map-data';\n\ndeclare const window: IMapWindow;\n\n/**\n * Instance of IStoreSelectorStateManager manager that uses Map service\n * for geo location.\n */\nexport class MapStoreSelectorStateManager extends BaseStoreSelectorStateManager {\n private readonly SERVICE_ENDPOINT: string = 'https://dev.virtualearth.net/REST/v1/';\n\n private readonly MAP_API_ENDPOINT: string = 'https://www.bing.com/api/maps/mapcontrol?callback=mapAPIReady';\n\n @action\n public async geoLocate(searchTerm: string, actionContext: IActionContext): Promise {\n if (\n !searchTerm ||\n !actionContext.requestContext.channel ||\n !actionContext.requestContext.channel.BingMapsApiKey ||\n !actionContext.requestContext.channel.BingMapsEnabled\n ) {\n return undefined;\n }\n\n let searchContent: string = searchTerm;\n\n const jsonp = `mapSearchCallback_${crypto.getRandomValues(new Uint32Array(1))[0]}`;\n\n if (actionContext.requestContext.channel.ChannelCountryRegionISOCode) {\n searchContent = `${searchTerm.trim()} ${actionContext.requestContext.channel.ChannelCountryRegionISOCode}`;\n }\n\n const query = encodeURI(searchContent);\n const key = encodeURI(actionContext.requestContext.channel.BingMapsApiKey);\n\n const geolocationApiUrl =\n actionContext.requestContext.app &&\n actionContext.requestContext.app.config &&\n actionContext.requestContext.app.config.geolocationApiUrl;\n const requestUrl = `${\n geolocationApiUrl ? geolocationApiUrl : this.SERVICE_ENDPOINT\n }/Locations?query=${query}&key=${key}&jsonp=${jsonp}`;\n\n return new Promise(resolve => {\n const script = document.createElement('script');\n script.setAttribute('type', 'text/javascript');\n script.setAttribute('src', requestUrl);\n\n window[jsonp] = (data: MapLocationsResult) => {\n delete window[jsonp];\n script.remove();\n\n if (data && data.resourceSets && data.resourceSets.length > 0 && data.resourceSets[0].resources.length > 0) {\n resolve({\n latitude: data.resourceSets[0].resources[0].point.coordinates[0],\n longitude: data.resourceSets[0].resources[0].point.coordinates[1]\n });\n }\n\n resolve(undefined);\n };\n\n document.body.appendChild(script);\n });\n }\n\n @action\n public async loadMapApi(input: ILoadMapApiInput): Promise {\n if (StringExtensions.isNullOrEmpty(input.key)) {\n return Promise.resolve();\n }\n\n const isScriptAlreadyLoaded = !!document?.getElementById('msdyn_map-api-script');\n\n if (isScriptAlreadyLoaded) {\n if (window) {\n const currentWindowAPI = window.mapAPIReady;\n window.mapAPIReady = () => {\n if (currentWindowAPI) {\n currentWindowAPI();\n }\n this.isMapApiLoaded = true;\n };\n }\n // Prevents from loading multiple script into the body\n return Promise.resolve();\n }\n\n const url = `${this.MAP_API_ENDPOINT}${input.key ? `&key=${input.key}` : ''}${input.lang ? `&setLang=${input.lang}` : ''}${\n input.market ? `&setMkt=${input.market}` : ''\n }`;\n\n return new Promise((resolve, reject) => {\n const script = document?.createElement('script');\n script.type = 'text/javascript';\n script.async = true;\n script.defer = true;\n script.src = url;\n script.id = 'msdyn_map-api-script';\n if (window) {\n window.mapAPIReady = () => {\n this.isMapApiLoaded = true;\n resolve();\n };\n }\n script.addEventListener('error', (error: string | Event) => {\n reject(error);\n });\n document?.body?.appendChild(script);\n });\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction, IAction, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\nimport { GenericInput, getGenericAction } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IStoreSelectorStateManager } from './i-store-selection-state-manager';\nimport { MapStoreSelectorStateManager } from './map-store-selector-state-manager';\n\nexport function createStoreSelectorStateInput(result: IStoreSelectorStateManager): GenericInput {\n return new GenericInput('mapSSSM', result, 'IStoreSelectorStateManager');\n}\n\nconst createStoreSelectorStateInputInternal = (inputData: ICreateActionContext>): IActionInput => {\n return createStoreSelectorStateInput(new MapStoreSelectorStateManager());\n};\n\nexport const getGenericActionDataAction = createObservableDataAction({\n action: >getGenericAction,\n input: createStoreSelectorStateInputInternal\n});\n\nexport default getGenericActionDataAction;\n","module.exports = React;","module.exports = ReactDOM;"],"names":["SelectedVariantInput","constructor","productId","channelId","matchingDimensionValues","bypassCache","requestContext","getCacheKey","getCacheObjectType","dataCacheType","this","catalogId","getCatalogId","getSelectedVariantActionDataAction","createObservableDataAction","id","action","async","input","context","_input$matchingDimens","_input$catalogId3","_context$requestConte3","getDimensionValuesFromQuery","url","requestUrl","product","ProductsDataActions","callerContext","queryResultSettings","QueryResultSettingsProxy","getPagingFromInputDataOrDefaultValue","_objectSpread","hasUnmatchedDimension","checkIfHasUnmatchedDimensions","Dimensions","map","dimension","matchedTargetDimension","find","targetDimension","DimensionTypeValue","DimensionValue","newImageUrl","generateProductImageUrl","apiSettings","PrimaryImageUrl","fullDimensions","_product$Dimensions","fullDimensionPromises","shippingInventoryConfiguration","createInventoryAvailabilitySearchCriteria","undefined","searchCriteria","RequestedDimensionTypeValue","MatchingDimensionValues","DefaultWarehouseOnly","FilterByChannelFulfillmentGroup","DeliveryModeTypeFilterValue","CatalogId","MasterProductId","RecordId","then","dimensionValues","dimensionValuesWithInventory","Promise","all","getFullDimensions","productVariant","ArrayExtensions","hasElements","ProductIds","_input$catalogId","_context$requestConte","variantProductId","variantImageUrl","app","config","useCommercialStyleName","_input$catalogId2","_context$requestConte2","attributes","Name","getCommercialName","commercialStyleNameAttribute","getProductVariant","matchedTargetDimensionFromApi","_input$catalogId4","_context$requestConte4","selectedProduct","inputData","getSelectedProductIdFromActionInput","Error","modalCloseButtonReference","React","onClickFindInStoreHandler","props","state","callbacks","_props$data","data","storeSelectorStateManager","result","cart","productAvailableQuantity","resources","modules","quantity","dataProduct","multiplePickupStoreSwitchName","retailMulitplePickupMFeatureState","featureState","IsEnabled","missingDimensions","filter","Value","storeSelectorId","Object","keys","length","storeSelector","updateErrorState","errorHost","configureErrors","getConfigureErrors","openDialog","parentElementRef","deliveryOptions","onLocationSelected","orgUnitLocation","deliveryMode","_props$context","resolve","behavior","addToCartBehavior","addProductToCart","count","location","status","substatus","productAvailability","changeModalOpen","ProductAvailableQuantity","shippingInventory","shipping","deliveryType","DeliveryMode","pickup","failureResult","failureReason","cartActionResult","otherError","getGenericError","navigationUrl","getUrlSync","actionContext","AddToCartBehavior","goToCart","window","assign","showModal","showNotification","_props$data$productPr2","defaultImageSettings","viewports","xs","q","w","h","lg","xl","lazyload","telemetryContent","getTelemetryObject","request","telemetryPageName","friendlyName","telemetry","dialogStrings","goToCartText","buyBoxGoToCartText","continueShoppingText","buyBoxContinueShoppingText","closeNotificationLabel","headerItemOneText","buyBoxSingleItemText","headerItemFormatText","buyBoxMultiLineItemFormatText","headerMessageText","buyBoxHeaderMessageText","freePriceText","priceFree","originalPriceText","currentPriceText","addedQuantityText","notification","ItemSuccessfullyAddedToCartNotification","gridSettings","productPrice","typeName","NotificationsManager","instance","addNotification","catch","error","exception","debug","message","findInStoreOnClick","getBuyboxFindInStore","_data$product","_data$productPrice","_data$cart","_data$deliveryOptions","_data$productAvailabl","_data$featureState","_data$channelDelivery","_props$data$product","_props$data$productPr","slots","findInStoreHeaderText","descriptionTextToShowAllPickupOptions","channel","PickupDeliveryModeCode","price","channelDeliveryOptionConfig","_dimension$DimensionV","errorState","quantityError","modalOpen","isSectionDisabled","buttonText","description","isStockCheck","buyboxResources","isLoading","pickupInventory","findInStoreLinkText","findInStoreDescriptionText","isAggregatedInventory","_pickupInventory","IsProductAvailable","findInStoreNotAvailableTextButton","findInStoreNotAvailableDescription","getFindInStoreInventorySettings","enableStockCheck","DeliveryOptions","matchDeliveryOptions","productdeliveryOptions","storePickUpOptionList","deliveryOption","delivery","deliveryCode","Code","push","PickupDeliveryModeCodes","option","priceComponent","PriceComponent","popupProps","className","imageSettings","productQuantity","setModalOpen","renderModalPopup","Popup","ContainerProps","openFindInStoreDialog","heading","Heading","headingTag","text","productPickupOptionList","item","Description","key","errors","BuyboxErrorBlock","showError","button","onClick","color","ref","disabled","title","modal","Buybox","super","dimensionUpdateQueue","FinitePromiseQueue","dimensions","initializedDimensions","Set","buyboxCallbacks","updateQuantity","newQuantity","setState","newErrorState","updateSelectedProduct","newSelectedProduct","newInventory","newPrice","newDeliveryOptions","productDeliveryOptions","_updatePrice","initializeDimension","initializedDimension","add","dimensionSelectedAsync","selectedDimensionId","selectedDimensionValueId","_this$props$data$prod","size","enqueue","_updateDimensions","FinitePromiseQueueError","ProcessWasDiscardedFromTheQueue","getDropdownName","dimensionType","_getDropdownName","isModalOpen","changeUpdatingDimension","isUpdatingDimension","changeUpdatingDeliveryOptions","isUpdatingDeliveryOptions","updateKeyInPrice","customPrice","customAmountError","isPriceKeyedIn","keyInPriceAmount","_onBulkPurchaseLinkClick","bulkPurchaseModule","boundingRect","getBoundingClientRect","scrollX","left","pageXOffset","scrollY","top","pageYOffset","scrollTo","_isChannelMultipleCatalogsFeatureEnabled","isMultipleCatalogFeatureEnabledInHq","_this$props$data$feat","feature","productDimensions","hasProductDimensions","dimensionsToUpdate","clearErrorState","previousState","_getProductVariant","productVariantPromise","promises","_getDimensionsForSelectedVariant","mappedDimensions","_hydrateInventoryInfo","_hydratePrice","_hydrateDeliveryOptions","_updateQuantitiesInState","_this$props$data$prod2","isGiftCard","IsGiftCard","productDimensionTypeColor","productDimensionTypeConfiguration","productDimensionTypeSize","productDimensionTypeAmount","productDimensionTypeStyle","min","max","isPriceApiCalled","_product$ItemId","targetGender","ItemId","startsWith","URL","href","searchParams","get","set","search","toString","ItemTypeValue","ReleasedProductType","Service","isServiceItem","warning","_this$props$data$prod3","colorDimension","x","_colorDimension$dimen","_colorDimension$dimen2","element","TotalAvailableInventoryLevelCode","_element$DimensionVal","maxRecentlyViewedItemsCount","RecentlyViewedState","render","_this$props$data$prod4","_this$props$data$feat2","_this$props$data$feat3","_this$props$data$cart","_this$props$data$cart2","mediaGallery","productComparisonButton","inventoryLevel","flatten","validValues","value","applyDefaultOrderSettings","RetailDefaultOrderQuantityLimitsFeatureName","cartConfiguration","ValidateDefaultOrderSettingsPerLine","hasAvailableProducts","some","getInventoryLevelCodeFromDimensionValue","InventoryLevelValues","outOfStock","variantColorName","validateCatalogId","showColorName","_productColor$Dimensi2","productColor","DimensionValues","_productColor$Dimensi","_productColor$Dimensi3","RefinerGroup","viewProps","ModuleProps","moduleProps","classnames","ProductInfoContainerProps","MediaGalleryContainerProps","getBuyboxProductTitle","hideDescription","getBuyboxProductDescription","bulkPurchaseLink","_renderBuyboxBulkPurchaseLink","unitOfMeasure","getBuyboxProductUnitOfMeasure","configure","getBuyboxProductConfigure","findInStore","_getBuyboxProductPrice","addToCart","getBuyboxAddToCart","getBuyboxProductComparisonButton","addToOrderTemplate","getBuyboxProductAddToOrderTemplate","addToWishlist","getBuyboxProductAddToWishlist","rating","hideRating","getBuyboxProductRating","getBuyboxProductQuantity","inventoryLabel","getBuyBoxInventoryLabel","shopSimilarLook","enableShopSimilarLooks","getBuyboxShopSimilarButton","ShopSimiliarButtonType","Looks","shopSimilarDescription","enableShopSimilarDescription","keyInPrice","enableKeyInPrice","isCustomPriceSelected","getBuyboxKeyInPrice","quantityLimitsMessages","getQuantityLimitsMessages","isChannelMultipleCatalogsFeatureEnabled","currentCatalogId","catalogs","_validateCatalogDetails","renderView","_props$data$featureSt","_props$data$featureSt2","isPriceMinMaxEnabled","isSalesAgreementPriceFeatureEnabled","priceResources","priceRangeSeparator","salesAgreementPricePrompt","salesAgreementExpirationDatePrompt","salesAgreementCommittedQuantityPrompt","salesAgreementRemainingQuantityPrompt","memberPriceMessage","saleMessage","showDiscountBox","isBulkPurchaseEnabled","msdyn365Commerce","isBrowser","bulkPurchaseModules","Array","from","document","getElementsByClassName","BulkPurchase","Button","bulkPurchaseLinkText","arguments","CustomerContextualPrice","_productDimensions$fi","_ref","_dimension$dimensionV","_dimensions$find$Dime","_dimensions$find","_value$DimensionValue","ExtensionProperties","setDimensionValuesToQuery","selectedProductPromise","getDimensionsForSelectedVariant","GetDimensionsForSelectedVariantInput","_productVariant$Dimen","newAvailableQuantity","getProductAvailabilitiesForSelectedVariant","ProductAvailabilitiesForSelectedVariantInput","newShippingQuantity","_dimension$DimensionV2","toLowerCase","getPriceForSelectedVariant","PriceForSelectedVariantInput","_this$props$data$feat4","retailMultiplePickupFeatureState","getDeliveryOptionsForSelectedVariant","GetDeliveryOptionsForSelectedVariantInput","isOrderQuantityLimitsFeatureEnabled","_isOrderQuantityLimitsFeatureEnabled","isChannelLimitsFeatureEnabled","_isChannelLimitsFeatureEnabled","_getMinQuantityForCartLineItem","_getMaxQuantityForCartLineItem","_getQuantity","Math","_product$Behavior","Behavior","MinimumQuantity","isQuantityLimitsFeatureEnabled","_product$Behavior2","MaximumQuantity","updateMaxQuantityForCartLineItem","maxQuantityForCartLineItem","_cartConfiguration$re","_cartConfiguration$re2","_product$Behavior3","defaultQuantity","DefaultQuantity","_featureStatuses$find","_featureStatuses$find2","featureStatuses","RevertToSiteBuilderOrderQuantityLimitsSettingsCRTFeatureName","_this$props$context","defaultOrderQuantityLimitsFeatureConfig","platform","enableDefaultOrderQuantityLimits","customerInfo","customerInformation","information","IsB2b","_cartConfiguration$Ig","IgnoreOrderSettings","_this$props$data$cata","_featureStatuses$find3","isChannelLimitsFeatureEnabledInHq","EcommerceQuantityLimitConfigurationsFeatureName","_renderAddToCart","errorBlock","Node","_renderAddToOrderTemplate","_renderAddToWishlist","_renderConfigure","dropdowns","_renderConfigureDropdown","_renderSocialShare","socialShare","dropdown","LabelContainerProps","select","_renderFindInStore","_renderQuantity","_renderKeyInPrice","_renderShopSimilarItem","shopSimilarItem","Module","getOriginalPrice","BasePrice","TradeAgreementPrice","AdjustedPrice","getActivePrice","showPriceRangeForMasterProduct","MinVariantPrice","formatCurrency","shouldUseFreePriceText","currencyCode","cultureFormatter","_props$isPriceMinMaxE","_props$product","_props$product2","ProductTypeValue","ProductType","Master","KitMaster","MaxVariantPrice","renderCurrentPrice","_props$priceResources2","priceClass","isMemberDiscount","maxVariantPrice","minVariantPrice","_props$priceResources","itemProp","createComponentOverride","component","_props$data$price$Dis","DiscountLines","forEach","discount","_discount$OfferName","OfferName","includes","loyaltyDiscountIdentifier","SalesAgreementPrice","_props$data$price$Sal","_props$priceResources11","_props$priceResources12","isExpanded","setIsExpanded","toggle","tabIndex","_props$data$price$Att","_props$priceResources3","_props$priceResources4","_props$priceResources5","_props$priceResources6","_props$priceResources7","_props$priceResources8","firstPriceLine","AttainablePriceLines","format","formatDate","EffectiveDate","ExpirationDate","CommittedQuantity","RemainingQuantity","renderSalesAgreementDetail","initialPrice","savingsText","renderMemberPrice","originalSalesPrice","activeSalesPrice","showStrikethroughPricing","renderCurrentPriceWithOriginalPrice","_props$data$price","_props$data$price2","_props$priceResources9","_props$priceResources10","abs","toFixed","renderDiscountBox","_productName$split$","productName","styleName","productBrand","split","TextValue","generateAddToOrderTemplateDialogResources","addToOrderTemplateHeader","noOrderTemplatesMessage","noOrderTemplatesDescription","createAnOrderTemplateButtonText","createNewOrderTemplateButtonText","cancelOrderTemplateCreationButtonText","selectTemplatesText","addToTemplateButtonText","lineItemsText","generateOrderTemplateNameDialogResources","orderTemplateHeaderLabel","createOrderTemplateHeader","orderTemplateTitleLabel","orderTemplateTitle","orderTemplateNameAriaLabel","orderTemplateDescription","createOrderTemplateDescription","defaultOrderTemplateName","orderTemplateButtonLabel","createOrderTemplateButtonText","orderTemplateCancelButtonLabel","cancelNewOrderTemplateCreationButtonText","generateItemAddedToOrderTemplateDialogResources","viewOrderTemplateButtonText","continueShoppingButtonText","itemAddedToOrderTemplateHeaderItemOneText","itemAddedToOrderTemplateHeaderItemFormatText","itemAddedToOrderTemplateHeaderMessageText","generateDuplicateItemsWhenAddingToOrderTemplateDialogResources","duplicatedProductsHeader","duplicatedProductsDescription","updateQuantityButtonText","cancelDuplicateItemsButtonText","onAddToOrderTemplateFailed","BuyBoxConstants","onChangeHandler","newValue","renderAddToOrderTemplate","orderTemplateButton","renderAddToOrderTemplateButton","orderTemplates","isMultipleCatalogsFeatureEnabled","AddToOrderTemplateComponent","addToOrderTemplateButtonText","addToOrderTemplateButtonTooltip","addToOrderTemplateDialogResources","createOrderTemplateDialogResources","itemAddedToOrderTemplateDialogResources","duplicateItemsWhenAddingToOrderTemplateDialogResources","onError","shouldShowButtonFailedTooltip","showButtonTooltip","showButtonText","onAddToWishlistFailed","renderAddToWishlist","enableWishlist","wishlistButton","renderAddtoWishlistButton","wishlists","AddToWishlistComponent","addToWishlistButtonText","removeFromWishlistButtonText","addToWishlistMessage","removedFromWishlistMessage","addItemToWishlistError","removeItemFromWishlistError","nameOfWishlist","ariaRole","getSelectedProduct","renderShopSimilarItem","renderConfigureDropdown","_props$data$product$r","_props$data$storeSele","_props$data$product$r3","appConfig","skuText","preferredStoreInfo","preferredStore","preferredStoreId","StoreId","preferredStoreName","StoreName","availability","setAvailability","isStoreChange","setIsStoreChange","getInventory","_props$data$product$r2","GetFullAvailableInventoryNearbyInput","zero","getFullAvailableInventoryNearby","response","_preferredStoreAvaila","isPreferredStore","_value$OrgUnitAvailab","OrgUnitAvailability","OrgUnitLocation","OrgUnitNumber","filteredFullOrgUnitAvailability","preferredStoreAvailability","stockStatusLabel","availabilityWithHours","ProductInventoryInformation","productInventoryInformation","_availabilityWithHour","InventoryLocationId","InventLocationId","StockLevelLabel","getStockInventoryLabel","resourceLabel","itemAvailabilities","ItemAvailabilities","AvailableQuantity","inStockText","outOfStockText","stockText","preferredStoreAvailabilityText","availabilityAtPreferredStoreText","displayStockAvailability","reaction","_props$data$storeSele2","selectedStoreLocationId","priceText","renderConfigure","renderKeyInPrice","renderQuantity","quantityComponent","extentionResources","IncrementalQuantity","currentCount","onChange","inputQuantityAriaLabel","decrementButtonAriaLabel","incrementButtonAriaLabel","minQuantityText","maxQuantityText","renderAvailabilityAtPreferredStore","_props$data$product$r4","_props$data$product$r5","tag","renderAddToCart","renderFindInStore","shopText","descriptionText","productSpecification","binding","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","__bindings__","viewDictionary","cn","BaseStoreSelectorStateManager","listMapViewState","displayList","displayMap","preferredStoreLocalStorageKey","isMapModuleLoaded","_readFromToCookie","storeInfo","JSON","parse","_unused","_context","storeId","storeName","writeToCookie","Latitude","Longitude","_writeToCookie","stringify","latitude","longitude","lastInlineShownStoreInfo","_removeCookie","MsDyn365","localStorage","removeItem","setItem","cookieValue","getItem","__decorate","computed","observable","MapStoreSelectorStateManager","SERVICE_ENDPOINT","MAP_API_ENDPOINT","searchTerm","BingMapsApiKey","BingMapsEnabled","searchContent","jsonp","crypto","getRandomValues","Uint32Array","ChannelCountryRegionISOCode","trim","query","encodeURI","geolocationApiUrl","script","createElement","setAttribute","remove","resourceSets","point","coordinates","body","appendChild","_document","StringExtensions","isNullOrEmpty","getElementById","currentWindowAPI","mapAPIReady","isMapApiLoaded","lang","market","reject","_document2","_document3","type","defer","src","addEventListener","createStoreSelectorStateInput","GenericInput","getGenericActionDataAction","getGenericAction","module","exports","ReactDOM"],"sourceRoot":""}