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AAOzW,OAAQ,EACfyW,EAAOsB,OAAQ,EACftB,EAAOuB,IAAM/W,EACbwV,EAAO/X,GAAK,uBACRqW,SACAA,OAAOyC,YAAc,KACjBjY,KAAKkY,gBAAiB,EACtBjB,MAGRC,EAAOwB,iBAAiB,SAAUC,IAC9BN,EAAOM,MAEH,QAARJ,EAAApB,gBAAQ,IAAAoB,GAAM,QAANA,EAARA,EAAUb,YAAI,IAAAa,GAAdA,EAAgBZ,YAAYT,OC5GjC,SAAS0B,EAA8BhO,GAC1C,OAAO,IAAIiO,EAAAA,aAAyC,UAAWjO,EAAQ,+BDavEkL,EAAAA,EAAAA,IAAA,CADC1W,EAAAA,IAAM,+BAsDP0W,EAAAA,EAAAA,IAAA,CADC1W,EAAAA,IAAM,+BC9DX,MAIa0Z,GAA6B5Z,EAAAA,EAAAA,IAA2B,CACjEE,OAA6C2Z,EAAAA,iBAC7CzZ,MAN2CC,GACpCqZ,EAA8B,IAAI3C,KAQ7C","sources":["webpack://henrys-ecommerce/./src/actions/get-all-dimensions-for-product.ts?0098","webpack://henrys-ecommerce/./src/actions/get-applicable-warranties.action.ts?6ef5","webpack://henrys-ecommerce/./src/actions/get-product-promotions.action.ts?ea24","webpack://henrys-ecommerce/./src/actions/getProductVariantOrMaster.ts?9116","webpack://henrys-ecommerce/./src/common/useGoogleAnalytics.tsx?0c00","webpack://henrys-ecommerce/./src/common/utilities/createCanonicalUrl.ts?7ccf","webpack://henrys-ecommerce/./src/modules/hei-buybox-v2/components/JsonLinkingData.tsx?6594","webpack://henrys-ecommerce/./src/modules/hei-buybox-v2/components/MediaGalleryOverlay.tsx?350b","webpack://henrys-ecommerce/./src/modules/hei-buybox/common/buybox-components.tsx?a5b7","webpack://henrys-ecommerce/./src/store-selector-state-manager/base-store-selector-state-manager.ts?281e","webpack://henrys-ecommerce/./src/store-selector-state-manager/map-store-selector-state-manager.ts?2ae0","webpack://henrys-ecommerce/./src/store-selector-state-manager/store-selector-state-manager-data-action.ts?bd3e"],"sourcesContent":["import { createObservableDataAction, ICreateActionContext, IAction } from '@msdyn365-commerce/core';\r\nimport {\r\n IDimensionForSelectedVariant,\r\n getDimensionsForSelectedVariantAction,\r\n getSelectedProductIdFromActionInput,\r\n GetDimensionsForSelectedVariantInput\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\n\r\nexport class GetAllDimensionsForProductInput extends GetDimensionsForSelectedVariantInput {\r\n constructor(productId: number, channelId: number) {\r\n super(productId, channelId, []);\r\n }\r\n\r\n public getCacheObjectType = () => 'HEI-AllDimensionsForProduct';\r\n}\r\n\r\nconst createAllDimensionsForProductInput = (inputData: ICreateActionContext) => {\r\n const productId = getSelectedProductIdFromActionInput(inputData);\r\n\r\n // process.env.NODE_ENV === 'development' &&\r\n // console.log('hei-get-all-dimensions-for-product', 'createAllDimensionsForProductInput', productId, inputData);\r\n\r\n if (productId) {\r\n return new GetAllDimensionsForProductInput(+productId, +inputData.requestContext.apiSettings.channelId);\r\n }\r\n\r\n throw new Error('Unable to create AllDimensionsForProductInput, no productId found on module config or query');\r\n};\r\n\r\nexport const getAllDimensionsForProductActionDataAction = createObservableDataAction({\r\n id: 'hei-get-all-dimensions-for-product',\r\n action: >getDimensionsForSelectedVariantAction,\r\n input: createAllDimensionsForProductInput\r\n});\r\n\r\nexport default getAllDimensionsForProductActionDataAction;\r\n","import * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { createObservableDataAction, IAction, IActionContext } from '@msdyn365-commerce/core';\r\nimport { ProductsDataActions, WarrantyGroup, ProductDimension } from '@msdyn365-commerce/retail-proxy';\r\nimport { getSelectedProductIdFromActionInput, getDimensionValuesFromQuery } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getProductVariantOrMaster } from './getProductVariantOrMaster';\r\n\r\nexport class getApplicableWarrantiesInput implements Msdyn365.IActionInput {\r\n public readonly recordId: number;\r\n public readonly dimensionValues: ProductDimension[];\r\n\r\n constructor(recordId: number, dimensionValues: ProductDimension[]) {\r\n this.recordId = recordId;\r\n this.dimensionValues = dimensionValues;\r\n }\r\n\r\n public getCacheKey = () => `${this.recordId}-${this.dimensionValues.map(v => v.DimensionValue?.Value ?? '').join('|')}`;\r\n public getCacheObjectType = () => 'HEI-ApplicableWarranties';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\nconst createInput = (context: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n const matchingDimensionValues = getDimensionValuesFromQuery(context.requestContext.url.requestUrl);\r\n const productId = getSelectedProductIdFromActionInput(context);\r\n if (productId) {\r\n return new getApplicableWarrantiesInput(+productId, matchingDimensionValues);\r\n } else {\r\n throw new Error('Unable to create GetProductInfoInput, no productId found on module config or query');\r\n }\r\n};\r\n\r\nexport async function getApplicableWarrantiesAction(\r\n input: getApplicableWarrantiesInput,\r\n context: IActionContext\r\n): Promise {\r\n const matchingDimensionValues = input.dimensionValues;\r\n const productVariantOrMaster = await getProductVariantOrMaster(input.recordId, matchingDimensionValues, context);\r\n\r\n const applicableWarranties = await ProductsDataActions.getApplicableWarrantiesAsync(\r\n { callerContext: context },\r\n context.requestContext.apiSettings.catalogId,\r\n [productVariantOrMaster.RecordId]\r\n );\r\n\r\n const warrantyGroup = applicableWarranties.find(aw => aw.WarrantableProductId === productVariantOrMaster.RecordId);\r\n return warrantyGroup?.WarrantyGroups;\r\n}\r\n\r\n/**\r\n * The complete createGetApplicableWarrantiesInput data action.\r\n */\r\nexport const getApplicableWarrantiesActionDataAction = createObservableDataAction({\r\n id: 'hei-get-applicable-warranties',\r\n action: >getApplicableWarrantiesAction,\r\n input: createInput\r\n});\r\n\r\nexport default getApplicableWarrantiesActionDataAction;\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 * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { getSelectedProductIdFromActionInput, getDimensionValuesFromQuery } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { ProductDimension, retailAction } from '@msdyn365-commerce/retail-proxy';\r\nimport { IGetProductPromotionResponse } from './DataServiceEntities.g';\r\nimport { getProductPromotionsV2Input } from './DataActionExtension.g';\r\nimport { getProductVariantOrMaster } from './getProductVariantOrMaster';\r\n\r\n/**\r\n * GetProductPromotions Input Action\r\n */\r\nexport class GetProductPromotionsInput implements Msdyn365.IActionInput {\r\n public readonly recordId: number;\r\n public readonly dimensionValues: ProductDimension[];\r\n\r\n constructor(recordId: number, dimensionValues: ProductDimension[]) {\r\n this.recordId = recordId;\r\n this.dimensionValues = dimensionValues;\r\n }\r\n\r\n public getCacheKey = () => `${this.recordId}-${this.dimensionValues.map(v => v.DimensionValue?.Value ?? '').join('|')}`;\r\n public getCacheObjectType = () => 'HEI-ProductPromotions';\r\n public dataCacheType = (): Msdyn365.CacheType => (process.env.NODE_ENV === 'development' ? 'application' : 'none');\r\n}\r\n\r\nconst createInput = (context: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n const matchingDimensionValues = getDimensionValuesFromQuery(context.requestContext.url.requestUrl);\r\n const productId = getSelectedProductIdFromActionInput(context);\r\n if (productId) {\r\n return new GetProductPromotionsInput(+productId, matchingDimensionValues);\r\n } else {\r\n throw new Error('Unable to create GetProductPromotionsInput, no productId found on module config or query');\r\n }\r\n};\r\n\r\nexport async function getProductPromotionsAction(\r\n input: GetProductPromotionsInput,\r\n context: Msdyn365.IActionContext\r\n): Promise {\r\n const matchingDimensionValues = input.dimensionValues;\r\n process.env.NODE_ENV === 'development' && console.log('get-product-promotions.action', input.recordId, matchingDimensionValues);\r\n const productVariant = await getProductVariantOrMaster(input.recordId, matchingDimensionValues, context);\r\n\r\n const distinctProductVariantId = productVariant.RecordId;\r\n process.env.NODE_ENV === 'development' && console.log('get-product-promotions.action', input.recordId, distinctProductVariantId);\r\n const productPromotionsInput = getProductPromotionsV2Input(input.recordId, distinctProductVariantId);\r\n return retailAction(productPromotionsInput, context);\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getProductPromotionsAction,\r\n id: 'hei-get-product-promotions',\r\n input: createInput\r\n // isBatched: true\r\n});\r\n","import * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport {\r\n QueryResultSettingsProxy,\r\n generateProductImageUrl,\r\n createInventoryAvailabilitySearchCriteria,\r\n ArrayExtensions\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n ProductDimension,\r\n ProductDimensionAvailabilitySearchCriteria,\r\n ProductsDataActions,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { IProductDimensionsWithAvailabilitiesFull } from '@msdyn365-commerce/commerce-entities';\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: Msdyn365.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 (context: Msdyn365.IActionContext, fullDimensions: IProductDimensionsWithAvailabilitiesFull[]) => {\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 context.requestContext.apiSettings.channelId,\r\n [variantProductId],\r\n null,\r\n context.requestContext.apiSettings.catalogId\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\r\n return productVariant;\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\nconst getProductVariantOrMaster = async (\r\n productId: number,\r\n matchingDimensionValues: ProductDimension[],\r\n context: Msdyn365.IActionContext\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 context.requestContext.apiSettings.channelId,\r\n [productId],\r\n null,\r\n context.requestContext.apiSettings.catalogId\r\n );\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 // Not all dimensions are selected\r\n if (matchingDimensionValues.find(dv => !dv.DimensionValue)) {\r\n return product;\r\n }\r\n\r\n const hasUnmatchedDimension = checkIfHasUnmatchedDimensions(product, matchingDimensionValues);\r\n\r\n if (hasUnmatchedDimension) {\r\n return product;\r\n }\r\n\r\n const fullDimensions: IProductDimensionsWithAvailabilitiesFull[] = await getFullDimensions(\r\n product,\r\n matchingDimensionValues,\r\n context,\r\n context.requestContext.apiSettings.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(context, fullDimensions)\r\n : undefined;\r\n\r\n return productVariant ?? product;\r\n};\r\n\r\nexport { getProductVariantOrMaster };\r\n","import * as React from 'react';\r\nimport MsDyn365, { IActionContext } from '@msdyn365-commerce/core';\r\nimport { GaPayload, pushGoogleAnalyticsEvent } from './pushGoogleAnalyticsEvent';\r\n\r\nlet lastCached = '';\r\n\r\nconst useGoogleAnalytics = (payload?: GaPayload, actionContext?: IActionContext, deps?: React.DependencyList | undefined) => {\r\n const isBrowser = MsDyn365.isBrowser;\r\n\r\n const cacheKey = React.useMemo(() => {\r\n if (payload?.event === 'view_item' && payload.ecommerce?.items) {\r\n return payload.ecommerce?.items[0]?.item_id;\r\n } else if (payload?.event === 'purchase') {\r\n return payload.ecommerce?.transaction_id;\r\n } else if (payload?.event === 'begin_checkout' && payload.ecommerce?.items) {\r\n return payload.ecommerce?.items.map(i => i.item_id).join(',');\r\n }\r\n\r\n return '';\r\n }, [payload]);\r\n\r\n if (cacheKey) {\r\n // skip if the event is unrecognized\r\n lastCached = cacheKey;\r\n }\r\n\r\n process.env.NODE_ENV === 'development' && console.log('useGoogleAnalytics', 'cacheKey', cacheKey);\r\n\r\n React.useEffect(() => {\r\n if (isBrowser) {\r\n void pushGoogleAnalyticsEvent(payload, actionContext);\r\n }\r\n }, [isBrowser, cacheKey || lastCached, ...(deps ?? [])]);\r\n};\r\n\r\nexport { useGoogleAnalytics };\r\n","import { IActionContext } from '@msdyn365-commerce/core';\r\n\r\nexport const createCanonicalUrl = (context: IActionContext, paths: string[], page: string) => {\r\n let canonicalDomainHost = `https://${context.requestContext.canonicalDomain}`;\r\n if (process.env.NODE_ENV === 'development') {\r\n canonicalDomainHost = '';\r\n }\r\n\r\n const sitePath = context.requestContext.sitePath ?? '';\r\n\r\n const url = `${canonicalDomainHost}${sitePath}/${paths\r\n .map(p => toSlug(p))\r\n .filter(s => s.length > 0)\r\n .join('/')}/${page}`;\r\n return url;\r\n};\r\n\r\nconst toSlug = (text: string) => {\r\n const slug = text\r\n .toLowerCase()\r\n .replace(/[^A-Za-z\\u00C0-\\u017F0-9]/g, '-')\r\n .replace(/--+/g, '-')\r\n .replace(/^-/, '')\r\n .replace(/-$/, '');\r\n\r\n return slug;\r\n};\r\n","import { ProductPrice, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport React from 'react';\r\nimport { IActionContext, HtmlHeadInclude } from '@msdyn365-commerce/core';\r\nimport { getProductUrlSync } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { createCanonicalUrl } from '../../../common/utilities/createCanonicalUrl';\r\n\r\nconst getProductUrl = (simpleProductData: SimpleProduct, context: IActionContext) => {\r\n const productUrl = getProductUrlSync(simpleProductData, context);\r\n const canonicalDomain = context.requestContext.canonicalDomain;\r\n if (productUrl && canonicalDomain) {\r\n return `https://${canonicalDomain}${productUrl}`.toLocaleLowerCase();\r\n }\r\n\r\n return undefined;\r\n};\r\n\r\nconst JsonLinkingData = ({\r\n productInfo,\r\n actionContext,\r\n productPrice\r\n}: {\r\n productInfo?: SimpleProduct;\r\n actionContext: IActionContext;\r\n productPrice?: ProductPrice;\r\n}) => {\r\n const brand = productInfo?.ExtensionProperties?.find(ep => ep.Key === 'Brand')?.Value?.StringValue;\r\n const mfrCode = productInfo?.ExtensionProperties?.find(ep => ep.Key === 'MfrCode')?.Value?.StringValue;\r\n const request = actionContext.requestContext;\r\n\r\n if (!productInfo) {\r\n return null;\r\n }\r\n\r\n const canonicalUrl =\r\n createCanonicalUrl(actionContext, [productInfo.Name ?? ''], `${productInfo.RecordId}.p`) ||\r\n getProductUrl(productInfo, actionContext);\r\n const ld = {\r\n '@context': 'https://schema.org',\r\n '@type': 'Product',\r\n '@id': canonicalUrl,\r\n name: productInfo.Name || '',\r\n image: productInfo.PrimaryImageUrl && [productInfo.PrimaryImageUrl],\r\n description: productInfo.Description || undefined,\r\n sku: productInfo.ItemId,\r\n mpn: mfrCode,\r\n brand:\r\n (brand && {\r\n '@type': 'Brand',\r\n name: brand\r\n }) ||\r\n undefined,\r\n offers: {\r\n '@type': 'Offer',\r\n url: request.canonicalUrl || request.url.requestUrl,\r\n priceCurrency: request.channel?.Currency,\r\n price: productPrice?.CustomerContextualPrice ?? productInfo.Price\r\n }\r\n };\r\n\r\n return (\r\n \r\n {/* tslint:disable-next-line: react-no-dangerous-html */}\r\n \r\n \r\n );\r\n};\r\n\r\nexport { JsonLinkingData };\r\n","import React, { useMemo } from 'react';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\nconst MediaGalleryOverlay = ({\r\n product,\r\n resources\r\n}: {\r\n product?: SimpleProduct;\r\n resources: {\r\n usedProductImageOverlayText: string;\r\n };\r\n}) => {\r\n const isUsedSku = useMemo(() => !!product?.ExtensionProperties?.find(ep => ep.Key === 'NewSku')?.Value?.StringValue, [product]);\r\n\r\n if (!isUsedSku) {\r\n return null;\r\n }\r\n\r\n return (\r\n
\r\n
{resources.usedProductImageOverlayText}
\r\n
\r\n );\r\n};\r\n\r\nexport { MediaGalleryOverlay };\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 AddToWishlistComponent,\r\n IAddToCartFailureResult,\r\n IAddToCartResources,\r\n IAddToOrderTemplateDialogResources,\r\n IDuplicateItemsWhenAddingToOrderTemplateDialogResources,\r\n IItemAddedToOrderTemplateDialogResources,\r\n IOrderTemplateActionErrorResult,\r\n IOrderTemplateNameDialogResources,\r\n IWishlistActionErrorResult,\r\n PriceComponent,\r\n RatingComponent\r\n} from '@msdyn365-commerce/components';\r\nimport { getUrlSync, IImageSettings } from '@msdyn365-commerce/core';\r\nimport { ICartActionResult, ICartState } from '@msdyn365-commerce/global-state';\r\nimport { ProductAvailableQuantity, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { ArrayExtensions, DeliveryMode, validateCatalogId } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n Alert,\r\n Button,\r\n format,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n getTelemetryObject,\r\n Heading,\r\n ITelemetryContent,\r\n Node,\r\n Quantity,\r\n TelemetryConstant\r\n} 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 IBuyboxCallbacks,\r\n IBuyboxCommonData,\r\n IBuyboxCommonResources,\r\n IBuyboxErrorBlockProps,\r\n IBuyboxExtentedProps,\r\n IBuyboxKeyInPriceViewProps,\r\n IBuyboxProductQuantityViewProps,\r\n IBuyboxShopSimilarLookViewProps,\r\n IBuyboxState,\r\n IProductDetails,\r\n ShopSimiliarButtonType,\r\n getConfigureErrors,\r\n getGenericError,\r\n getQuantityError\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport { AddToCartComponent } from '../components/add-to-cart.component';\r\nimport { IHeiBuyboxState } from '../hei-buybox.data';\r\n\r\nconst _getClassNamePrefix = (typeName: string): string => {\r\n return typeName.toLocaleLowerCase() === 'quickview' ? 'ms-quickView' : 'ms-buybox';\r\n};\r\n\r\nexport function getBuyBoxInventoryLabel(\r\n props: IBuyboxExtentedProps,\r\n productDetails?: IProductDetails\r\n): React.ReactElement | undefined {\r\n const { typeName } = props;\r\n\r\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\r\n const productAvailableQuantity = props.data.productAvailableQuantity?.result ?? productDetails?.productAvailableQuantity;\r\n\r\n const className = _getClassNamePrefix(typeName);\r\n if (!productAvailableQuantity || !ArrayExtensions.hasElements(productAvailableQuantity)) {\r\n return undefined;\r\n }\r\n const shippingInventory = productAvailableQuantity.find(shipping => shipping.deliveryType === DeliveryMode.shipping);\r\n\r\n if (shippingInventory) {\r\n let inventoryClassName: string;\r\n if (shippingInventory.StockLevelCode) {\r\n inventoryClassName = `${className}__inventory-label ${className}__inventory-code-${shippingInventory.StockLevelCode.toLowerCase()}`;\r\n } else {\r\n inventoryClassName = `${className}__inventory-label`;\r\n }\r\n return (\r\n
\r\n {shippingInventory.StockLevelLabel}\r\n
\r\n );\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\nexport function getBuyboxProductTitle(\r\n props: IBuyboxExtentedProps,\r\n productDetails?: IProductDetails\r\n): React.ReactElement | undefined {\r\n const {\r\n config: { titleHeadingTag = 'h1' },\r\n typeName\r\n } = props;\r\n const className = _getClassNamePrefix(typeName);\r\n\r\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\r\n const product = props.data.product?.result ?? productDetails?.product ?? undefined;\r\n\r\n return product && ;\r\n}\r\n\r\nexport function getBuyboxProductDescription(\r\n props: IBuyboxExtentedProps,\r\n productDetails?: IProductDetails\r\n): React.ReactElement | undefined {\r\n const { typeName } = props;\r\n const className = _getClassNamePrefix(typeName);\r\n\r\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\r\n const product = props.data.product?.result ?? productDetails?.product ?? undefined;\r\n\r\n return product &&

{product.Description}

;\r\n}\r\n\r\n/**\r\n * Gets the react node for product unit of measure display.\r\n * @param {IBuyboxExtentedProps} props The buybox module props.\r\n * @param {IProductDetails} productDetails The product details to be displyed in buybox.\r\n * @returns {React.ReactElement} The node representing markup for unit of measure component.\r\n */\r\nexport function getBuyboxProductUnitOfMeasure(\r\n props: IBuyboxExtentedProps,\r\n productDetails?: IProductDetails\r\n): React.ReactElement | undefined {\r\n const { typeName } = props;\r\n const className = _getClassNamePrefix(typeName);\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Do not need type check for appsettings\r\n if (\r\n props.context.app.config &&\r\n (!props.context.app.config.unitOfMeasureDisplayType || props.context.app.config.unitOfMeasureDisplayType === 'none')\r\n ) {\r\n return undefined;\r\n }\r\n\r\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\r\n const product = props.data.product?.result ?? productDetails?.product;\r\n if (!product || !product.DefaultUnitOfMeasure) {\r\n props.telemetry.warning('Missing defult unit of measureor theproduct');\r\n return undefined;\r\n }\r\n\r\n return (\r\n
\r\n {product.DefaultUnitOfMeasure}\r\n
\r\n );\r\n}\r\n\r\nlet telemetryContent: ITelemetryContent;\r\n\r\n/**\r\n * On add to cart failed function.\r\n * @param props -The buybox module props.\r\n * @param state -The buybox module state.\r\n * @param callbacks -The buybox module callbacks.\r\n * @param defaultMinimumKeyInPrice -The default minimum key in price.\r\n * @param defaultMaximumKeyInPrice -The default maximum key in price.\r\n * @param cart -The cart state.\r\n * @param product -The simple product.\r\n * @param productAvailability -The product available quantity.\r\n * @returns Update error state.\r\n */\r\nconst onAddToCartFailed = (\r\n props: IBuyboxExtentedProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks,\r\n defaultMinimumKeyInPrice: number,\r\n defaultMaximumKeyInPrice: number,\r\n cart: ICartState,\r\n product: SimpleProduct,\r\n productAvailability: ProductAvailableQuantity | undefined\r\n) => (result: IAddToCartFailureResult) => {\r\n let quantityErrorForState: string | undefined;\r\n let customAmountErrorForState: string | undefined;\r\n let otherErrorForState: string | undefined = getGenericError(\r\n result,\r\n cart,\r\n props.resources,\r\n props.context,\r\n product,\r\n productAvailability,\r\n undefined\r\n );\r\n\r\n if (result.failureReason === 'OUTOFSTOCK') {\r\n quantityErrorForState = result.failureReason === 'OUTOFSTOCK' ? getQuantityError(result.stockLeft, props.resources) : undefined;\r\n } else if (\r\n result.failureReason === 'CARTACTIONFAILED' &&\r\n result.cartActionResult &&\r\n (result.cartActionResult.substatus === 'MAXQUANTITY' || result.cartActionResult.substatus === 'QUANTITYLIMITS')\r\n ) {\r\n quantityErrorForState = getGenericError(result, cart, props.resources, props.context, product, productAvailability, undefined);\r\n otherErrorForState = undefined; // Prevent error duplication in otherError and quantityError\r\n }\r\n\r\n if (result.failureReason === 'INVALIDCUSTOMAMOUNT') {\r\n if (state.keyInPriceAmount === undefined || state.keyInPriceAmount < (props.config.minimumKeyInPrice || defaultMinimumKeyInPrice)) {\r\n const formatedAmountLimit = props.context.cultureFormatter.formatCurrency(\r\n props.config.minimumKeyInPrice || defaultMinimumKeyInPrice\r\n );\r\n customAmountErrorForState = props.resources.invalidSmallCustomAmountText.replace('{minAmount}', formatedAmountLimit);\r\n } else if (state.keyInPriceAmount > (props.config.maximumKeyInPrice || defaultMaximumKeyInPrice)) {\r\n const formatedAmountLimit = props.context.cultureFormatter.formatCurrency(\r\n props.config.maximumKeyInPrice || defaultMaximumKeyInPrice\r\n );\r\n customAmountErrorForState = props.resources.invalidLargeCustomAmountText.replace('{maxAmount}', formatedAmountLimit);\r\n }\r\n }\r\n\r\n callbacks.updateErrorState({\r\n errorHost: 'ADDTOCART',\r\n quantityError: quantityErrorForState,\r\n configureErrors:\r\n result.failureReason === 'MISSINGDIMENSION'\r\n ? getConfigureErrors(result.missingDimensions, props.resources, product?.IsGiftCard)\r\n : {},\r\n customAmountError: customAmountErrorForState,\r\n otherError: otherErrorForState\r\n });\r\n};\r\n\r\n/**\r\n * On Item Add To Cart function.\r\n * @param typeName -Type name.\r\n * @param callbacks -Buybox Callbacks.\r\n * @returns Change modal open.\r\n */\r\nconst onItemAddedToCart = (typeName: string, callbacks: IBuyboxCallbacks) => (result: ICartActionResult) => {\r\n if (typeName === 'quickview') {\r\n callbacks.changeModalOpen(false);\r\n }\r\n};\r\n\r\nexport function getBuyboxAddToCart(\r\n props: IBuyboxExtentedProps,\r\n state: IHeiBuyboxState,\r\n callbacks: IBuyboxCallbacks,\r\n defaultMinimumKeyInPrice: number,\r\n defaultMaximumKeyInPrice: number,\r\n productDetails?: IProductDetails,\r\n hasAvailableProducts?: boolean,\r\n bonusItemIds?: number[]\r\n): IBuyboxAddToCartViewProps {\r\n const { id, typeName, context, resources } = props;\r\n // process.env.NODE_ENV === 'development' && console.log('BuyboxView', 'getBuyboxAddToCart', bonusItemIds);\r\n\r\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\r\n const product = props.data.product?.result ?? productDetails?.product;\r\n\r\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\r\n const cart = props.data.cart?.result ?? productDetails?.cart;\r\n\r\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\r\n const productAvailableQuantity = props.data.productAvailableQuantity?.result ?? productDetails?.productAvailableQuantity;\r\n\r\n const {\r\n quantity,\r\n errorState: { configureErrors, quantityError, customAmountError, otherError, errorHost },\r\n selectedProduct,\r\n isUpdatingDimension,\r\n isUpdatingDeliveryOptions,\r\n isServiceItem\r\n } = state;\r\n\r\n const productAvailability = state.productAvailableQuantity\r\n ? state.productAvailableQuantity.ProductAvailableQuantity\r\n : productAvailableQuantity && productAvailableQuantity.length > 0\r\n ? productAvailableQuantity[0].ProductAvailableQuantity\r\n : undefined;\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\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 isProductQuantityLoading = typeName !== 'quickview' && props.data.productAvailableQuantity.status === 'LOADING';\r\n if (isProductQuantityLoading) {\r\n callbacks.changeUpdatingDimension(false);\r\n }\r\n\r\n const isLoadingDeliveryOptions = typeName !== 'quickview' && props.data.deliveryOptions?.status === 'LOADING';\r\n if (isLoadingDeliveryOptions && callbacks.changeUpdatingDeliveryOptions) {\r\n callbacks.changeUpdatingDeliveryOptions(false);\r\n }\r\n\r\n const isBopisOnly = Boolean(product?.ExtensionProperties?.find(ep => ep.Key === 'Bopis' && ep.Value?.StringValue === 'Yes'));\r\n\r\n telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.typeName, props.telemetry);\r\n\r\n // Check if the product delivery mode is electronic\r\n const emailDeliveryModeCode = props.context.actionContext.requestContext.channel?.EmailDeliveryModeCode;\r\n // from quickview we are not getting deliveryoptions in props.data hence getting it from quickview state\r\n const deliveryOptions = typeName === 'quickview' ? state.productDeliveryOptions : props.data.deliveryOptions?.result;\r\n const isEmailDelivery =\r\n ArrayExtensions.hasElements(deliveryOptions?.DeliveryOptions) && deliveryOptions!.DeliveryOptions[0].Code === emailDeliveryModeCode;\r\n const className = _getClassNamePrefix(typeName);\r\n const isDisabled = isBopisOnly || (isUpdatingDimension && typeName === 'quickview');\r\n\r\n return {\r\n ContainerProps: {\r\n className: `${className}__add-to-cart-container`\r\n },\r\n button: product && !isBopisOnly && (\r\n \r\n ),\r\n errorBlock: (\r\n \r\n )\r\n };\r\n}\r\n\r\n/**\r\n * Get the React.ReactElement contains price.\r\n * @param props - The IBuyboxExtentedProps.\r\n * @param state - The buybox state.\r\n * @returns The React.ReactElement.\r\n */\r\nexport function getBuyboxProductPrice(props: IBuyboxExtentedProps, 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 }}\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\r\nexport function getBuyboxProductRating(\r\n props: IBuyboxExtentedProps,\r\n productDetails?: IProductDetails\r\n): React.ReactElement | undefined {\r\n const { id, typeName, context, resources } = props;\r\n\r\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\r\n const ratingsSummary = props.data.ratingsSummary?.result ?? productDetails?.ratingsSummary;\r\n if (!ratingsSummary || !ratingsSummary.averageRating) {\r\n return
;\r\n }\r\n const ratingComponent = (\r\n \r\n );\r\n\r\n return ratingComponent;\r\n}\r\n\r\nfunction generateAddToOrderTemplateDialogResources(resources: IBuyboxCommonResources): IAddToOrderTemplateDialogResources {\r\n return {\r\n addToOrderTemplateHeader: resources.addToOrderTemplateHeader,\r\n\r\n noOrderTemplatesMessage: resources.noOrderTemplatesMessage,\r\n noOrderTemplatesDescription: resources.noOrderTemplatesDescription,\r\n\r\n createAnOrderTemplateButtonText: resources.createAnOrderTemplateButtonText,\r\n createNewOrderTemplateButtonText: resources.createNewOrderTemplateButtonText,\r\n cancelOrderTemplateCreationButtonText: resources.cancelOrderTemplateCreationButtonText,\r\n\r\n selectTemplatesText: resources.selectTemplatesText,\r\n addToTemplateButtonText: resources.addToTemplateButtonText,\r\n lineItemsText: resources.lineItemsText\r\n };\r\n}\r\n\r\nfunction generateOrderTemplateNameDialogResources(resources: IBuyboxCommonResources): IOrderTemplateNameDialogResources {\r\n return {\r\n orderTemplateHeaderLabel: resources.createOrderTemplateHeader,\r\n orderTemplateTitleLabel: resources.orderTemplateTitle,\r\n orderTemplateNameAriaLabel: resources.orderTemplateNameAriaLabel,\r\n orderTemplateDescription: resources.createOrderTemplateDescription,\r\n\r\n defaultOrderTemplateName: resources.defaultOrderTemplateName,\r\n\r\n orderTemplateButtonLabel: resources.createOrderTemplateButtonText,\r\n orderTemplateCancelButtonLabel: resources.cancelNewOrderTemplateCreationButtonText\r\n };\r\n}\r\n\r\nfunction generateItemAddedToOrderTemplateDialogResources(resources: IBuyboxCommonResources): IItemAddedToOrderTemplateDialogResources {\r\n return {\r\n viewOrderTemplateButtonText: resources.viewOrderTemplateButtonText,\r\n continueShoppingButtonText: resources.continueShoppingButtonText,\r\n itemAddedToOrderTemplateHeaderItemOneText: resources.itemAddedToOrderTemplateHeaderItemOneText,\r\n itemAddedToOrderTemplateHeaderItemFormatText: resources.itemAddedToOrderTemplateHeaderItemFormatText,\r\n itemAddedToOrderTemplateHeaderMessageText: resources.itemAddedToOrderTemplateHeaderMessageText,\r\n freePriceText: resources.priceFree,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText\r\n };\r\n}\r\n\r\nfunction generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(\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 order template failed function.\r\n * @param callbacks -Buybox callbacks.\r\n * @param resources -Buybox common 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\nexport function getBuyboxProductAddToOrderTemplate(\r\n props: IBuyboxExtentedProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks\r\n): IBuyboxAddToOrderTemplateViewProps | undefined {\r\n const {\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 } = props;\r\n\r\n const product = props.data.product?.result;\r\n\r\n const {\r\n errorState: { configureErrors, quantityError, customAmountError, otherError, errorHost },\r\n quantity\r\n } = state;\r\n\r\n // If custom amount is selected, add-to-orderTemplate is disabled\r\n if (state.isCustomPriceSelected) {\r\n return undefined;\r\n }\r\n const className = _getClassNamePrefix(typeName);\r\n\r\n return {\r\n ContainerProps: {\r\n className: `${className}__add-to-order-template-container`\r\n },\r\n button: product && orderTemplates && (\r\n \r\n ),\r\n errorBlock: (\r\n \r\n )\r\n };\r\n}\r\n\r\n/**\r\n * Renders add to comparison button for the given product.\r\n * @param productComparisonButton - React element of the button.\r\n * @param product - Product information.\r\n * @param catalogId - Current catalog.\r\n * @param state - Buybox state.\r\n * @returns React element of the button.\r\n */\r\nexport function getBuyboxProductComparisonButton(\r\n productComparisonButton: React.ReactNode,\r\n product: SimpleProduct,\r\n catalogId: number,\r\n state: IBuyboxState\r\n): JSX.Element | undefined {\r\n if (state.isCustomPriceSelected) {\r\n return undefined;\r\n }\r\n\r\n validateCatalogId(catalogId);\r\n return React.cloneElement(productComparisonButton as React.ReactElement, { product, catalogId });\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\nexport function getBuyboxProductAddToWishlist(\r\n props: IBuyboxExtentedProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks,\r\n productDetails?: IProductDetails\r\n): IBuyboxAddToWishlistViewProps | undefined {\r\n const {\r\n id,\r\n typeName,\r\n context,\r\n data: {\r\n wishlists: { result: wishlists }\r\n },\r\n resources\r\n } = props;\r\n\r\n const product = props.data.product?.result ? props.data.product.result : productDetails?.product;\r\n\r\n const {\r\n errorState: { configureErrors, quantityError, customAmountError, otherError, errorHost },\r\n selectedProduct\r\n } = state;\r\n\r\n // If custom amount is selected, add-to-wishlist is disabled\r\n if (state.isCustomPriceSelected) {\r\n return undefined;\r\n }\r\n\r\n const className = _getClassNamePrefix(typeName);\r\n\r\n return {\r\n ContainerProps: {\r\n className: `${className}__add-to-wishlist-container`\r\n },\r\n button: product && (\r\n \r\n ),\r\n errorBlock: (\r\n \r\n )\r\n };\r\n}\r\n\r\n/**\r\n * On quantity change function.\r\n * @param callbacks -Buybox callbacks.\r\n * @returns Update quantity.\r\n */\r\nconst onQuantityChangeHandler = (callbacks: IBuyboxCallbacks) => (newValue: number) => {\r\n if (callbacks.updateQuantity) {\r\n callbacks.updateQuantity(newValue);\r\n }\r\n};\r\n\r\nexport function getBuyboxProductQuantity(\r\n props: IBuyboxExtentedProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks\r\n): IBuyboxProductQuantityViewProps {\r\n const { resources, typeName } = props;\r\n\r\n const {\r\n quantity,\r\n max,\r\n errorState: { quantityError }\r\n } = state;\r\n\r\n const className = _getClassNamePrefix(typeName);\r\n\r\n return {\r\n ContainerProps: {\r\n className: `${className}__quantity`\r\n },\r\n LabelContainerProps: {\r\n tag: 'label',\r\n className: `${className}__product-quantity-label`,\r\n htmlFor: `${className}__product-quantity-input`\r\n },\r\n heading:
{resources.productQuantityHeading}
,\r\n errors: quantityError && (\r\n \r\n \r\n ),\r\n input: (\r\n \r\n )\r\n };\r\n}\r\n\r\nexport function getBuyboxShopSimilarButton(\r\n props: IBuyboxExtentedProps,\r\n buttonType: ShopSimiliarButtonType\r\n): IBuyboxShopSimilarLookViewProps {\r\n const { resources, context, typeName } = props;\r\n const product = props.data.product?.result;\r\n\r\n const className = _getClassNamePrefix(typeName);\r\n const navigationUrl = (shopSimiliarButtonType: ShopSimiliarButtonType) => () => {\r\n const searchURL = getUrlSync('search', context && context.actionContext);\r\n const separator = searchURL!.includes('?') ? '&' : '?';\r\n document.location.href = `${searchURL}${separator}productId=${product &&\r\n product.RecordId}&recommendation=${shopSimiliarButtonType}`;\r\n };\r\n const telemetryText =\r\n buttonType === ShopSimiliarButtonType.Looks ? TelemetryConstant.ShopSimliarLooks : TelemetryConstant.ShopSimliarDescription;\r\n const payLoad = getPayloadObject('click', telemetryContent, telemetryText);\r\n const attribute = getTelemetryAttributes(telemetryContent, payLoad);\r\n const text = buttonType === ShopSimiliarButtonType.Looks ? resources.shopSimilarLooksText : resources.shopSimilarDescriptionText;\r\n\r\n return {\r\n ContainerProps: {\r\n className: `${className}__shopsimilar${buttonType}`\r\n },\r\n input: (\r\n \r\n {text}\r\n \r\n )\r\n };\r\n}\r\n\r\n/**\r\n * On price change function.\r\n * @param callbacks -Buybox callbacks.\r\n * @returns Update key in price.\r\n */\r\nconst onPriceChangeHandler = (callbacks: IBuyboxCallbacks) => (event: React.ChangeEvent) => {\r\n const value = event.currentTarget.value;\r\n callbacks.updateKeyInPrice(value.length > 0 ? Number(value) : Number.parseFloat(value));\r\n};\r\n\r\nexport function getBuyboxKeyInPrice(\r\n props: IBuyboxExtentedProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks\r\n): IBuyboxKeyInPriceViewProps {\r\n const { config, resources } = props;\r\n\r\n const {\r\n errorState: {}\r\n } = state;\r\n\r\n const className = _getClassNamePrefix(props.typeName);\r\n\r\n return {\r\n ContainerProps: {\r\n className: `${className}__key_in_price`\r\n },\r\n LabelContainerProps: {\r\n tag: 'label',\r\n className: `${className}__key_in_price-label`,\r\n htmlFor: `${className}__key_in_price`\r\n },\r\n heading:
{resources.buyboxKeyInPriceLabelHeading}
,\r\n input: (\r\n \r\n )\r\n };\r\n}\r\n\r\nexport const BuyboxErrorBlock: React.FC = ({\r\n showError,\r\n configureErrors,\r\n quantityError,\r\n customAmountError,\r\n otherError,\r\n resources\r\n}) => {\r\n let errorMessages: (string | undefined)[] = [];\r\n\r\n errorMessages = Object.values(configureErrors).filter(message => message !== undefined);\r\n\r\n if (quantityError) {\r\n errorMessages.push(quantityError);\r\n }\r\n\r\n if (customAmountError) {\r\n errorMessages.push(customAmountError);\r\n }\r\n\r\n if (otherError) {\r\n errorMessages.push(otherError);\r\n }\r\n\r\n return (\r\n 0} color='danger' assertive aria-label={resources.buyboxErrorMessageHeader}>\r\n \r\n {errorMessages.map((message, index) => {\r\n return (\r\n
\r\n {message}\r\n
\r\n );\r\n })}\r\n
\r\n );\r\n};\r\n\r\nexport function getQuantityLimitsMessages(\r\n props: IBuyboxExtentedProps,\r\n state: IBuyboxState\r\n): React.ReactElement | undefined {\r\n const { resources } = props;\r\n\r\n const { min, max } = state;\r\n\r\n if (!_isOrderQuantityLimitsFeatureEnabled(props)) {\r\n return undefined;\r\n }\r\n\r\n return (\r\n \r\n {_renderMaxLabel(props, max, resources.maxQuantityText)}\r\n {_renderMinLabel(props, min, resources.minQuantityText)}\r\n \r\n );\r\n}\r\n\r\nexport const RetailDefaultOrderQuantityLimitsFeatureName: string = 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature';\r\n\r\nconst _renderMaxLabel = (\r\n props: IBuyboxExtentedProps,\r\n max: number | undefined,\r\n maxQuantityText: string\r\n): React.ReactElement | undefined => {\r\n const { resources, typeName } = props;\r\n const className = _getClassNamePrefix(typeName);\r\n if (max && max !== 0 && max !== Number.MAX_VALUE) {\r\n return (\r\n

\r\n {resources.informationIconText}\r\n