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GN,OAAO,EAGX,IAAKtZ,EAAMgJ,OAAShJ,EAAMgJ,KAAKlU,QAAQqD,SAEnC,OAAO,EAIX,KADuD,QAA7B6gB,EAAGhZ,EAAMuZ,4BAAoB,IAAAP,GAAAA,GAEnD,OAAO,EAGX,GAAIhZ,EAAMgJ,KAAKlU,QAAQkE,YACfgH,EAAMgJ,KAAKlU,QAAQkE,WAAWgB,MAAKye,KAAeA,EAAUrf,gBAAkBqf,EAAUrf,eAAeC,SAEvG,OAAO,EAIf,MAAMmgB,EAAyBT,GAA0B/Y,EAAM/E,SAAW+E,EAAM/E,SA9vB5D,EAgwBpB,QACI+E,EAAMwT,0BAC0C9d,IAAhDsK,EAAMwT,oBAAoBC,mBAC1BzT,EAAMwT,oBAAoBC,mBAAqB+F,IAIjD7B,EAAuB3X,IAA4C,IAAAyZ,EACrE,OAAc,QAAdA,EAAIzZ,EAAMgJ,YAAI,IAAAyQ,IAAVA,EAAY3kB,QAAQkE,aAChBgH,EAAMgJ,KAAKlU,QAAQkE,WAAWgB,MAAKye,KAAeA,EAAUrf,gBAAkBqf,EAAUrf,eAAeC,cAM1G2G,EAAMiZ,WAAcjZ,EAAMmZ,qBAAwBnZ,EAAMoZ,0BAA6BpZ,EAAMqZ,4BAQvFK,EAAwEC,EAAAA,GAAiBC,gBAClG,YAAWxL,EAAA,CACTyL,UAAW5E,GAAiCpC","sources":["webpack://henrys-ecommerce/./src/common/utilities/get-product-details.ts?0bb5","webpack://henrys-ecommerce/./src/common/createGoogleAnalyticsEvent.ts?b6fa","webpack://henrys-ecommerce/./src/common/pushGoogleAnalyticsEvent.tsx?9c4e","webpack://henrys-ecommerce/./src/common/sendGoogleAnalyticsEvent.ts?9ba5","webpack://henrys-ecommerce/./src/common/utilities/productListExtensionHelpers.ts?5897","webpack://henrys-ecommerce/./src/modules/bazzarvoice-widget/bazzarvoice-widget.props.autogenerated.ts?6162","webpack://henrys-ecommerce/./src/modules/bazzarvoice-widget/components/Bazzarvoice.tsx?245f","webpack://henrys-ecommerce/./src/modules/cart/components/cart-pick-up-in-store.tsx?7be5","webpack://henrys-ecommerce/./src/modules/hei-buybox/components/Popup.tsx?9e06","webpack://henrys-ecommerce/./src/modules/hei-buybox/components/add-to-cart.component.tsx?7602"],"sourcesContent":["/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { getCartStateData, GetCartStateDataInput } from '@msdyn365-commerce/global-state';\r\nimport { ProductsDataActions } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n getDimensionsForSelectedVariant,\r\n GetDimensionsForSelectedVariantInput,\r\n getPriceForSelectedVariant,\r\n getProductAvailabilitiesForSelectedVariant,\r\n getRatingsSummary,\r\n GetRatingsSummaryInput,\r\n getRnrEndpointId,\r\n getRnrPartnerId,\r\n PriceForSelectedVariantInput,\r\n ProductAvailabilitiesForSelectedVariantInput\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\n\r\nimport { IProductDetails } from '@msdyn365-commerce-modules/buybox';\r\n\r\n/**\r\n * Calls the Retail API and returns the product details.\r\n * @param productId\r\n * @param channelId\r\n * @param ctx\r\n * @param selectedDimensions - Dimensions previously selected for the product variant.\r\n */\r\nexport async function getProductDetails(productId: number, channelId: number, ctx: IActionContext): Promise {\r\n const productDetails: IProductDetails = {};\r\n\r\n if (productId > 0 && channelId > 0) {\r\n const tenantId = getRnrPartnerId(ctx);\r\n const serviceEndPoint = getRnrEndpointId(ctx);\r\n\r\n // Get Product Details\r\n const productResult = await ProductsDataActions.getByIdAsync({ callerContext: ctx }, productId, channelId);\r\n if (productResult) {\r\n productDetails.product = productResult;\r\n }\r\n\r\n // Get Product Availability\r\n await getProductAvailabilitiesForSelectedVariant(new ProductAvailabilitiesForSelectedVariantInput(productId, channelId), ctx)\r\n .then(productAvailabilities => {\r\n if (productAvailabilities) {\r\n productDetails.productAvailableQuantity = productAvailabilities;\r\n }\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n });\r\n\r\n // Get Product Price\r\n await getPriceForSelectedVariant(new PriceForSelectedVariantInput(productId, channelId, undefined), ctx)\r\n .then(productPrice => {\r\n if (productPrice) {\r\n productDetails.productPrice = productPrice;\r\n }\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n });\r\n\r\n // Get product dimensions\r\n await getDimensionsForSelectedVariant(new GetDimensionsForSelectedVariantInput(productId, channelId), ctx)\r\n .then(productDimensions => {\r\n if (productDimensions) {\r\n productDetails.productDimensions = productDimensions;\r\n }\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n });\r\n\r\n // Get Cart State\r\n await getCartStateData(new GetCartStateDataInput(ctx.requestContext.apiSettings), ctx)\r\n .then(cartState => {\r\n productDetails.cart = cartState;\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n });\r\n\r\n // Get Product Ratings\r\n if (tenantId && serviceEndPoint) {\r\n await getRatingsSummary(new GetRatingsSummaryInput(productId.toString(), tenantId, serviceEndPoint), ctx)\r\n .then(ratingsSummaryData => {\r\n if (ratingsSummaryData) {\r\n productDetails.ratingsSummary = ratingsSummaryData;\r\n }\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n });\r\n }\r\n }\r\n\r\n return productDetails;\r\n}\r\n","import { CacheType, getCatalogId, IActionContext, IActionInput, ICommerceApiSettings, IRequestContext } from '@msdyn365-commerce/core';\r\nimport { Cart, CategoryPathLookup } from '@msdyn365-commerce/retail-proxy';\r\nimport { GaEvent, GaItem, GaPayload } from './pushGoogleAnalyticsEvent';\r\nimport { getProductDetails } from './utilities/get-product-details';\r\n\r\nexport const buildCacheKey = (base: string, apiSettings: ICommerceApiSettings, locale?: string): string => {\r\n return `${base}-chanId:${apiSettings.channelId}-catId:${apiSettings.catalogId}${locale ? `-${locale}` : ''}`;\r\n};\r\n\r\n/**\r\n * Category path input.\r\n */\r\nexport class GetCategoryPathsInput implements IActionInput {\r\n public readonly ChannelId: number;\r\n\r\n public readonly CatalogId: number;\r\n\r\n public readonly categoryPathLooksups: CategoryPathLookup[];\r\n\r\n public readonly apiSettings: ICommerceApiSettings;\r\n\r\n private readonly locale: string;\r\n\r\n private constructedCacheKey: string;\r\n\r\n public constructor(context: IRequestContext, categoryPathLooksups: CategoryPathLookup[]) {\r\n this.ChannelId = context.apiSettings.channelId;\r\n this.CatalogId = getCatalogId(context);\r\n this.categoryPathLooksups = categoryPathLooksups;\r\n this.apiSettings = context.apiSettings;\r\n this.constructedCacheKey = '';\r\n categoryPathLooksups.forEach(categoryPath => {\r\n this.constructedCacheKey += `${categoryPath.ProductId && categoryPath.ProductId.toString()}|`;\r\n });\r\n this.constructedCacheKey += `${this.ChannelId.toString()}|`;\r\n this.constructedCacheKey += `${this.CatalogId.toString()}|`;\r\n this.locale = context.locale;\r\n }\r\n\r\n public getCacheKey = () => buildCacheKey(this.constructedCacheKey, this.apiSettings, this.locale);\r\n\r\n public getCacheObjectType = () => 'CategoryPath';\r\n\r\n public dataCacheType = (): CacheType => 'request';\r\n\r\n /**\r\n * Retrieves locale to use for the current API call.\r\n * @returns A string which represents locale.\r\n */\r\n public getLocale = (): string => this.locale;\r\n}\r\n\r\nconst createGoogleAnalyticsEvent = async (cart: Readonly, eventName: GaEvent, actionContext: IActionContext): Promise => {\r\n var channelId = actionContext.requestContext.channel?.RecordId;\r\n\r\n const items: GaItem[] = [];\r\n\r\n if (channelId && cart.CartLines) {\r\n let i = 0;\r\n for (const cartLine of cart.CartLines) {\r\n if (cartLine.ProductId) {\r\n const productDetails = await getProductDetails(cartLine.ProductId, channelId, actionContext);\r\n\r\n const product = productDetails.product;\r\n const variant = product?.Dimensions?.map(d => d.DimensionValue?.Value).join(',');\r\n\r\n process.env.NODE_ENV === 'development' &&\r\n console.log('createGoogleAnalyticsEvent', cartLine.ProductId, JSON.parse(JSON.stringify(product)));\r\n\r\n const discount = (cartLine.DiscountLines ?? []).reduce((a, b) => a + (b.Amount ?? 0), 0);\r\n\r\n var brand = product?.ExtensionProperties?.find(ep => ep.Key === 'Brand')?.Value?.StringValue;\r\n\r\n var item = {\r\n recId: cartLine.ProductId,\r\n item_id: product?.ProductNumber || product?.ItemId || cartLine.ItemId || '',\r\n item_name: product?.Name ?? '',\r\n index: i,\r\n item_variant: variant,\r\n price: (product?.Price ?? cartLine.Price ?? 0) - discount,\r\n discount: discount,\r\n pid: product?.ItemId || cartLine.ItemId || '',\r\n item_brand: brand,\r\n quantity: cartLine.Quantity ?? 0\r\n };\r\n\r\n items.push(item);\r\n }\r\n\r\n i++;\r\n }\r\n }\r\n\r\n const total = items.reduce((a, b) => a + (b.price ?? 0) * b.quantity, 0);\r\n\r\n return {\r\n event: eventName,\r\n ecommerce: {\r\n currency: 'CAD',\r\n value: total,\r\n items: items\r\n }\r\n };\r\n};\r\n\r\nexport { createGoogleAnalyticsEvent };\r\n","import { IActionContext } from '@msdyn365-commerce/core';\r\nimport { GetCategoryPathsInput } from './createGoogleAnalyticsEvent';\r\nimport { getCategoryPaths } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\nexport type GaDataLayer = {\r\n push: (payload: GaPayload) => void;\r\n};\r\n\r\nexport type GaItem = {\r\n item_id: string;\r\n item_name: string;\r\n affiliation?: string;\r\n coupon?: string;\r\n discount?: number;\r\n index: number;\r\n item_brand?: string;\r\n item_category?: string;\r\n item_category2?: string;\r\n item_category3?: string;\r\n item_category4?: string;\r\n item_category5?: string;\r\n item_list_id?: string;\r\n item_list_name?: string;\r\n item_variant?: string;\r\n location_id?: string;\r\n price: number;\r\n quantity: number;\r\n pid?: string;\r\n recId?: number;\r\n};\r\n\r\nexport type GaEvent =\r\n | 'view_item'\r\n | 'view_cart'\r\n | 'purchase'\r\n | 'begin_checkout'\r\n | 'add_to_cart'\r\n | 'add_to_wishlist'\r\n | 'remove_from_cart'\r\n | 'add_shipping_info'\r\n | 'add_payment_info';\r\n\r\nexport type GaPayload = {\r\n event?: GaEvent;\r\n ecommerce?: {\r\n transaction_id?: string;\r\n currency?: string;\r\n value: number;\r\n tax?: number;\r\n shipping?: number;\r\n shipping_tier?: string;\r\n payment_type?: string;\r\n coupon?: string;\r\n items?: GaItem[];\r\n } | null;\r\n};\r\n\r\nexport const pushGoogleAnalyticsEvent = async (payload?: GaPayload, actionContext?: IActionContext) => {\r\n const dataLayer = typeof window !== 'undefined' && (window['dataLayer'] as GaDataLayer);\r\n if (dataLayer) {\r\n process.env.NODE_ENV === 'development' && console.log('pushGoogleAnalyticsEvent', payload);\r\n dataLayer.push({ ecommerce: null });\r\n if (payload) {\r\n for (const gaItem of payload?.ecommerce?.items ?? []) {\r\n if (gaItem.recId) {\r\n if (actionContext) {\r\n const categoryPaths = await getCategoryPaths(\r\n new GetCategoryPathsInput(actionContext.requestContext, [{ ProductId: +gaItem.recId }]),\r\n actionContext\r\n );\r\n\r\n if (categoryPaths.length > 0) {\r\n gaItem.item_category = categoryPaths[0].Name ?? undefined;\r\n }\r\n if (categoryPaths.length > 1) {\r\n gaItem.item_category2 = categoryPaths[1].Name ?? undefined;\r\n }\r\n if (categoryPaths.length > 2) {\r\n gaItem.item_category3 = categoryPaths[2].Name ?? undefined;\r\n }\r\n if (categoryPaths.length > 3) {\r\n gaItem.item_category4 = categoryPaths[3].Name ?? undefined;\r\n }\r\n if (categoryPaths.length > 4) {\r\n gaItem.item_category5 = categoryPaths[4].Name ?? undefined;\r\n }\r\n }\r\n\r\n delete gaItem.recId;\r\n }\r\n }\r\n\r\n dataLayer.push(payload);\r\n }\r\n }\r\n};\r\n","import { IActionContext } from '@msdyn365-commerce/core';\r\nimport { GaItem, pushGoogleAnalyticsEvent } from './pushGoogleAnalyticsEvent';\r\nimport { OrgUnitLocation, ProductsDataActions, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\ninterface IAddCartLine {\r\n product: SimpleProduct;\r\n count?: number;\r\n location?: OrgUnitLocation;\r\n additionalProperties?: object;\r\n availableQuantity?: number;\r\n enableStockCheck?: boolean;\r\n isAddEmailDeliveryItemToCart?: boolean;\r\n isPriceKeyedIn?: boolean;\r\n customPrice?: number;\r\n deliveryMode?: string;\r\n catalogId?: number;\r\n shouldSkipSiteSettings?: boolean;\r\n}\r\n\r\nexport const sendGoogleAnalyticsEvent = async (products: IAddCartLine[], actionContext: IActionContext) => {\r\n try {\r\n const apiSettings = actionContext.requestContext.apiSettings;\r\n const gaItems: GaItem[] = [];\r\n\r\n const prices = await ProductsDataActions.getActivePricesAsync(\r\n { callerContext: actionContext },\r\n {\r\n ChannelId: apiSettings.channelId,\r\n CatalogId: apiSettings.catalogId\r\n },\r\n products.map(p => p.product.RecordId),\r\n new Date(),\r\n null,\r\n null,\r\n true,\r\n null,\r\n true\r\n );\r\n\r\n for (const p of products) {\r\n const product = p.product;\r\n const variant = product.Dimensions?.map(d => d.DimensionValue?.Value).join(',');\r\n const brandFromExt = product?.ExtensionProperties?.find(p => p.Key === 'Brand')?.Value?.StringValue;\r\n\r\n const productPrice = prices.find(price => price.ProductId === p.product.RecordId);\r\n\r\n const discount = (productPrice?.DiscountLines ?? []).reduce((a, b) => a + ((b.EffectiveAmount || b.Amount) ?? 0), 0);\r\n\r\n gaItems.push({\r\n recId: product.RecordId,\r\n item_id: product.ProductNumber || product.ItemId || '',\r\n item_name: product.Name ?? '',\r\n index: gaItems.length,\r\n item_variant: variant,\r\n price: product.Price - discount,\r\n discount: discount,\r\n pid: product.ItemId || '',\r\n item_brand: brandFromExt ?? undefined,\r\n quantity: p.count ?? 0\r\n });\r\n }\r\n\r\n const totalValue = gaItems.reduce((a, b) => a + (b.price ?? 0) * b.quantity, 0);\r\n\r\n await pushGoogleAnalyticsEvent(\r\n {\r\n event: 'add_to_cart',\r\n ecommerce: {\r\n currency: 'CAD',\r\n value: totalValue,\r\n items: gaItems\r\n }\r\n },\r\n actionContext\r\n );\r\n } catch (err) {\r\n console.error(err);\r\n }\r\n};\r\n","import { AttributeValue, CommerceProperty, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport enum ProductStockStatusEnum {\r\n OUT_OF_STOCK,\r\n IN_STORE,\r\n ONLINE\r\n}\r\n\r\nexport interface IProductBadgeStatus {\r\n url: string;\r\n badgeName: string;\r\n}\r\n\r\n/**\r\n * Retrieves attribute from attribute list given the name of the attribute\r\n * @param attributes attribute list\r\n * @param attributeName name of the attribute to find\r\n */\r\nexport const findAttribute = (attributes: AttributeValue[] | undefined, attributeName: string): AttributeValue | undefined => {\r\n if (!attributes) {\r\n return undefined;\r\n }\r\n return attributes.find(attr => attr.Name?.toLowerCase() === attributeName.toLowerCase());\r\n};\r\n\r\nexport const findAllAttributes = (attributes: AttributeValue[] | undefined, attributeName: string): AttributeValue[] => {\r\n if (!attributes) {\r\n return [];\r\n }\r\n return attributes.filter(attr => attr.Name?.toLowerCase() === attributeName.toLowerCase());\r\n};\r\n\r\n/**\r\n * Gets value of given attribute based on its DataTypeValue enum.\r\n * @param attribute attribute to retrieve value from\r\n */\r\nexport const findAttributeValue = (attribute: AttributeValue): string | Date | number | boolean | undefined => {\r\n switch (attribute.DataTypeValue) {\r\n case 1:\r\n return attribute.CurrencyCode;\r\n case 2:\r\n return attribute.DateTimeOffsetValue;\r\n case 3:\r\n return attribute.FloatValue;\r\n case 4:\r\n return attribute.IntegerValue;\r\n case 5:\r\n return attribute.TextValue;\r\n case 6:\r\n return attribute.BooleanValue;\r\n default:\r\n return undefined;\r\n }\r\n};\r\n\r\n/**\r\n * Builds URL to the product badge\r\n * @param locale current locale\r\n * @param badgeName name of the badge\r\n * @param baseUrl base url for images\r\n */\r\nexport const buildProductBadgeUrl = (locale: string, badgeName: string, baseUrl: string, suffix?: string): string => {\r\n return `${baseUrl}Catalogs/${locale}/${badgeName.toLowerCase().replace(/ /g, '_')}_${locale}${suffix || ''}.png`;\r\n};\r\n\r\n/**\r\n * Gets the correct product badge status from the product\r\n * @param product Product to get the badge for\r\n * @param locale current locale\r\n * @param baseUrl image base url\r\n * @returns product badge url\r\n */\r\nexport const getProductBadgeUrl = (\r\n product: ProductSearchResult,\r\n locale: string,\r\n baseUrl: string,\r\n suffix?: string\r\n): IProductBadgeStatus | null => {\r\n const badgeAttributeArray = findAllAttributes(product.AttributeValues, 'Product Badge Status');\r\n let badgeStatus: IProductBadgeStatus | null = null;\r\n if (badgeAttributeArray) {\r\n badgeAttributeArray.forEach(attr => {\r\n const badgeValue = findAttributeValue(attr);\r\n if (badgeValue && typeof badgeValue === 'string' && badgeValue.toLowerCase() !== 'none') {\r\n badgeStatus = { url: buildProductBadgeUrl(locale, badgeValue, baseUrl, suffix), badgeName: badgeValue.replace(/_/, ' ') };\r\n }\r\n });\r\n }\r\n if (badgeStatus) {\r\n return badgeStatus;\r\n } else if (product.BasePrice && product.Price !== product.BasePrice) {\r\n return { url: buildProductBadgeUrl(locale, 'on_sale', baseUrl, suffix), badgeName: 'On Sale' };\r\n }\r\n return null;\r\n};\r\n\r\n/**\r\n * gets product stock status value from extension properties\r\n * @param extensionProperties extension properties from product\r\n */\r\nexport const getProductStockStatus = (extensionProperties: CommerceProperty[]): ProductStockStatusEnum => {\r\n if (extensionProperties?.length) {\r\n const availableProperty = extensionProperties.find(xt => xt.Key === 'AvailabilityStatus');\r\n if (availableProperty && availableProperty.Value && availableProperty.Value.IntegerValue) {\r\n return availableProperty.Value.IntegerValue;\r\n }\r\n }\r\n return ProductStockStatusEnum.OUT_OF_STOCK;\r\n};\r\n\r\nexport const renderProductBadge = (request: Msdyn365.IRequestContext, badgeStatus: string, suffix: string) => {\r\n try {\r\n process.env.NODE_ENV === 'development' && console.log('renderProductBadge', badgeStatus, suffix);\r\n const mainImage = document?.querySelectorAll('.ms-buybox__media-gallery .msc-carousel__inner')[0];\r\n if (mainImage) {\r\n const currentBadge = mainImage.querySelector('.hei-badge');\r\n if (!currentBadge) {\r\n const badgeUrl = buildProductBadgeUrl(request.locale, badgeStatus, request.apiSettings.baseImageUrl, suffix);\r\n\r\n const badgeImage = document.createElement('img');\r\n badgeImage.src = badgeUrl;\r\n badgeImage.classList.add('msc-product__badge');\r\n badgeImage.classList.add('msc-product__badge--detail');\r\n badgeImage.classList.add('hei-badge');\r\n badgeImage.alt = badgeStatus;\r\n mainImage.appendChild(badgeImage);\r\n }\r\n\r\n return true;\r\n }\r\n } catch {\r\n return false;\r\n }\r\n\r\n return false;\r\n};\r\n","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. See License.txt in the project root for license information.\r\n * IBazzarvoiceWidget contentModule Interface Properties\r\n * THIS FILE IS AUTO-GENERATED - MANUAL MODIFICATIONS WILL BE LOST\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport const enum widgetType {\r\n reviews = 'reviews',\r\n questions = 'questions',\r\n rating_summary = 'rating_summary',\r\n inline_rating = 'inline_rating'\r\n}\r\n\r\nexport interface IBazzarvoiceWidgetConfig extends Msdyn365.IModuleConfig {\r\n widgetType?: widgetType;\r\n}\r\n\r\nexport interface IBazzarvoiceWidgetResources {}\r\n\r\nexport interface IBazzarvoiceWidgetProps extends Msdyn365.IModule {\r\n resources: IBazzarvoiceWidgetResources;\r\n config: IBazzarvoiceWidgetConfig;\r\n}\r\n","import * as React from 'react';\r\nimport { widgetType as WidgetType } from '../bazzarvoice-widget.props.autogenerated';\r\nimport MsDyn365 from '@msdyn365-commerce/core';\r\nimport classnames from 'classnames';\r\n\r\ntype BazzarvoiceProps = {\r\n itemId?: string;\r\n widgetType?: WidgetType;\r\n className?: string;\r\n disableSeo?: boolean;\r\n};\r\n\r\nconst Bazzarvoice = (props: BazzarvoiceProps) => {\r\n const { itemId, widgetType, className, disableSeo } = props;\r\n const divRef = React.useRef(null);\r\n const [initialized, setInitialized] = React.useState(false);\r\n\r\n const isBrowser = MsDyn365.isBrowser;\r\n React.useEffect(() => {\r\n const div = divRef.current;\r\n if (!initialized && isBrowser && div && itemId && widgetType) {\r\n setInitialized(true);\r\n\r\n div.innerHTML = `
`;\r\n }\r\n }, [isBrowser, initialized, itemId, widgetType, disableSeo, divRef]);\r\n\r\n return (\r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default Bazzarvoice;\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 { IActionContext } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n CartLine,\r\n ChannelDeliveryOptionConfiguration,\r\n DeliveryOption,\r\n OrgUnitLocation,\r\n ProductDeliveryOptions,\r\n ProductsDataActions,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { IStoreSelectorStateManager } from '@msdyn365-commerce-modules/bopis-utilities';\r\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nexport interface IPickUpInStoreViewProps {\r\n callbacks: {\r\n toggleBopis(isBopisSelected: boolean): void;\r\n };\r\n defaultComponent?: React.ReactNode;\r\n orgUnitName?: string;\r\n isBopisSelected: boolean;\r\n ContainerProps: INodeProps;\r\n deliveryOption?: string;\r\n}\r\n\r\nexport interface IPickUpInStoreProps {\r\n context: IActionContext;\r\n cartline: CartLine;\r\n product: SimpleProduct;\r\n shipitText: string;\r\n pickUpInStoreText: string;\r\n changeStoreText: string;\r\n cartState: ICartState | undefined;\r\n storeSelectorStateManager: IStoreSelectorStateManager | undefined;\r\n orgUnitLocations?: OrgUnitLocation[] | undefined;\r\n deliveryOptions?: ProductDeliveryOptions;\r\n pickupDeliveryModeCode?: string;\r\n storeSelectorModuleId?: string;\r\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n retailMulitplePickupFeatureState?: boolean;\r\n locationChangedHandler(): void;\r\n}\r\n\r\nexport const getLineIdFromExtProps = (cartLine: CartLine): [string, boolean] => {\r\n let lineId = cartLine.ExtensionProperties?.find(ep => ep.Key === 'line-id')?.Value?.StringValue;\r\n if (lineId) {\r\n return [lineId, false];\r\n }\r\n\r\n if (!cartLine.ExtensionProperties) {\r\n cartLine.ExtensionProperties = [];\r\n }\r\n\r\n // save the line id in ext properies incase the line id changed due to login\r\n lineId = cartLine.LineId ?? '';\r\n cartLine.ExtensionProperties.push({\r\n Key: 'line-id',\r\n Value: {\r\n StringValue: lineId\r\n }\r\n });\r\n\r\n return [lineId, true];\r\n};\r\n\r\nexport const getWarrantyLine = (productLineNumber: number, cartState?: ICartState) => {\r\n const cartLines = cartState?.cart.CartLines ?? [];\r\n const linkedCartLine = cartLines.find(cl => {\r\n return cl.WarrantableLineNumber === productLineNumber;\r\n });\r\n return linkedCartLine ?? null;\r\n};\r\n\r\nexport const getRelatedCartLines = (productCartLine: CartLine, cartState?: ICartState) => {\r\n const cartLinesToRemove: CartLine[] = [];\r\n const linkedCartLine = getWarrantyLine(productCartLine.LineNumber!, cartState);\r\n if (linkedCartLine) {\r\n cartLinesToRemove.push(linkedCartLine);\r\n }\r\n\r\n const [productLineId] = getLineIdFromExtProps(productCartLine);\r\n\r\n const cartLines = cartState?.cart.CartLines ?? [];\r\n for (const cartLine of cartLines) {\r\n if (\r\n cartLine.TotalAmount === 0 &&\r\n cartLine.ExtensionProperties?.find(ex => ex.Key === 'bonus-for-line-id' && ex.Value?.StringValue === productLineId)\r\n ) {\r\n cartLinesToRemove.push(cartLine);\r\n }\r\n }\r\n\r\n return cartLinesToRemove;\r\n};\r\n\r\nexport const PickUpInStore = (props: IPickUpInStoreProps): IPickUpInStoreViewProps | undefined => {\r\n const _onLocationChangedCallback = async (\r\n orgUnitLocation: OrgUnitLocation,\r\n cartState: ICartState | undefined,\r\n cartline: CartLine,\r\n deliveryMode?: string\r\n ) => {\r\n if (!cartState) {\r\n return;\r\n }\r\n\r\n const result = await cartState.updateCartLinePickupLocation({\r\n cartLineId: cartline.LineId!,\r\n location: orgUnitLocation,\r\n deliveryMode\r\n });\r\n\r\n process.env.NODE_ENV === 'development' && console.log('updateCartLinePickupLocation', result);\r\n if (result.status === 'SUCCESS') {\r\n const relatedLines = getRelatedCartLines(cartline, cartState);\r\n const bonusLines = relatedLines.filter(l => !l.IsWarrantyLine);\r\n\r\n const inStockAtStore: { [id: number]: boolean } = {};\r\n\r\n if (bonusLines.length > 0) {\r\n const warehouseAvailability = await ProductsDataActions.getEstimatedProductWarehouseAvailabilityAsync(\r\n {\r\n callerContext: props.context\r\n },\r\n bonusLines.map(p => ({\r\n ProductId: p.ProductId!,\r\n InventLocationId: orgUnitLocation.InventoryLocationId,\r\n DataAreaId: props.context.requestContext.channel?.InventLocationDataAreaId ?? 'hei'\r\n })),\r\n null\r\n );\r\n\r\n for (const availablity of warehouseAvailability.AggregatedProductInventoryAvailabilities ?? []) {\r\n inStockAtStore[availablity.ProductId!] = availablity.PhysicalAvailableInventoryLevelCode === 'INSTOCK';\r\n }\r\n\r\n process.env.NODE_ENV === 'development' &&\r\n console.log('updateCartLinePickupLocation', relatedLines, bonusLines, warehouseAvailability);\r\n }\r\n\r\n for (const relatedLine of relatedLines) {\r\n if (relatedLine.IsWarrantyLine || inStockAtStore[relatedLine.ProductId!]) {\r\n await cartState.updateCartLinePickupLocation({\r\n cartLineId: relatedLine.LineId!,\r\n location: orgUnitLocation,\r\n deliveryMode\r\n });\r\n } else {\r\n await cartState.clearCartLinePickupLocation({\r\n cartLineId: relatedLine.LineId!\r\n });\r\n }\r\n }\r\n }\r\n\r\n if (result.status === 'SUCCESS') {\r\n props.locationChangedHandler();\r\n }\r\n };\r\n\r\n const _toggleBOPIS = async (isBopisSelected: boolean) => {\r\n const { storeSelectorStateManager, product, cartline, cartState, storeSelectorModuleId } = props;\r\n\r\n if (isBopisSelected) {\r\n if (!storeSelectorStateManager) {\r\n return;\r\n }\r\n storeSelectorStateManager\r\n .openDialog({\r\n id: storeSelectorModuleId,\r\n product,\r\n alreadySelectedLocation: {\r\n OrgUnitNumber: cartline.FulfillmentStoreId\r\n },\r\n deliveryOptions: props.deliveryOptions,\r\n onLocationSelected: (orgUnitLocation, deliveryMode: string | undefined) => {\r\n return _onLocationChangedCallback(orgUnitLocation, cartState, cartline, deliveryMode);\r\n }\r\n })\r\n .catch(error => {});\r\n } else {\r\n if (!cartState) {\r\n return;\r\n }\r\n cartline.DeliveryMode = '';\r\n cartline.FulfillmentStoreId = '';\r\n cartline.ShippingAddress = {};\r\n const result = await cartState.clearCartLinePickupLocation({ cartLineId: cartline.LineId! });\r\n\r\n if (result.status === 'SUCCESS') {\r\n const relatedLines = getRelatedCartLines(cartline, cartState);\r\n process.env.NODE_ENV === 'development' && console.log('PickUpInStore', relatedLines);\r\n for (const relatedLine of relatedLines) {\r\n relatedLine.DeliveryMode = '';\r\n relatedLine.FulfillmentStoreId = '';\r\n relatedLine.ShippingAddress = {};\r\n await cartState.clearCartLinePickupLocation({\r\n cartLineId: relatedLine.LineId!\r\n });\r\n }\r\n }\r\n\r\n if (result.status === 'SUCCESS') {\r\n props.locationChangedHandler();\r\n }\r\n }\r\n };\r\n\r\n const _getOrgUnitName = (fulfillmentStoreId: string | undefined, orgUnitLocations: OrgUnitLocation[] | undefined) => {\r\n if (!orgUnitLocations || !fulfillmentStoreId || orgUnitLocations.length === 0) {\r\n return '';\r\n }\r\n\r\n const foundLocation = orgUnitLocations.find(orgUnitLocation => {\r\n return orgUnitLocation.OrgUnitNumber === fulfillmentStoreId;\r\n });\r\n\r\n if (foundLocation) {\r\n return foundLocation.OrgUnitName;\r\n }\r\n return fulfillmentStoreId;\r\n };\r\n\r\n const _renderShippingMethod = (\r\n cartLine: CartLine,\r\n shipItText: string,\r\n pickupInStoretext: string,\r\n changeStoreText: string,\r\n orgUnitLocations: OrgUnitLocation[] | undefined\r\n ): JSX.Element => {\r\n const orgUnitName = _getOrgUnitName(cartLine.FulfillmentStoreId, orgUnitLocations);\r\n const bopisSelected = !!cartLine.FulfillmentStoreId;\r\n\r\n const toggleBOPIS = (isBopisSelected: boolean) => {\r\n return () => {\r\n void _toggleBOPIS(isBopisSelected);\r\n };\r\n };\r\n\r\n return (\r\n <>\r\n \r\n \r\n {cartLine.FulfillmentStoreId ? (\r\n
\r\n {orgUnitName}\r\n \r\n
\r\n ) : null}\r\n \r\n );\r\n };\r\n\r\n const _getDeliveryOption = (pickupStore: IPickUpInStoreProps, deliveryOptions: ProductDeliveryOptions) => {\r\n const delivery = deliveryOptions?.DeliveryOptions?.find(option => option.Code === pickupStore.pickupDeliveryModeCode);\r\n return delivery?.Description;\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\n const 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\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 (!props.deliveryOptions || !props.deliveryOptions.DeliveryOptions) {\r\n return undefined;\r\n }\r\n\r\n if (props.retailMulitplePickupFeatureState && props.channelDeliveryOptionConfig) {\r\n if (!matchDeliveryOptions(props.deliveryOptions.DeliveryOptions, props.channelDeliveryOptionConfig?.PickupDeliveryModeCodes)) {\r\n return undefined;\r\n }\r\n } else if (\r\n !props.pickupDeliveryModeCode ||\r\n !props.deliveryOptions.DeliveryOptions.find(option => option.Code === props.pickupDeliveryModeCode)\r\n ) {\r\n return undefined;\r\n }\r\n\r\n return {\r\n callbacks: {\r\n toggleBopis: _toggleBOPIS\r\n },\r\n defaultComponent: _renderShippingMethod(\r\n props.cartline,\r\n props.shipitText,\r\n props.pickUpInStoreText,\r\n props.changeStoreText,\r\n props.orgUnitLocations\r\n ),\r\n orgUnitName: _getOrgUnitName(props.cartline.FulfillmentStoreId, props.orgUnitLocations),\r\n isBopisSelected: !!props.cartline.FulfillmentStoreId,\r\n deliveryOption: _getDeliveryOption(props, props.deliveryOptions),\r\n ContainerProps: {\r\n className: 'msc-cart-line__bopis-container'\r\n }\r\n };\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { ICoreContext, IComponentProps, IGridSettings, IImageSettings, Image } from '@msdyn365-commerce/core';\r\nimport { ProductPrice, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { getFallbackImageUrl } from '@msdyn365-commerce-modules/retail-actions';\r\nimport * as React from 'react';\r\n\r\nimport {\r\n Button,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n ITelemetryContent,\r\n TelemetryConstant,\r\n Modal,\r\n ModalBody,\r\n ModalFooter,\r\n ModalHeader\r\n} from '@msdyn365-commerce-modules/utilities';\r\n\r\nexport interface IPopupProps\r\n extends IComponentProps<{\r\n product: SimpleProduct | undefined;\r\n price: ProductPrice | undefined;\r\n bonusProducts: SimpleProduct[] | undefined;\r\n }> {\r\n dialogStrings?: {\r\n goToCartText: string;\r\n continueShoppingText: string;\r\n headerItemOneText: string;\r\n headerItemFormatText: string;\r\n headerMessageText: string;\r\n freePriceText: string;\r\n originalPriceText: string;\r\n currentPriceText: string;\r\n };\r\n\r\n className: string;\r\n imageSettings?: IImageSettings;\r\n gridSettings: IGridSettings | undefined;\r\n productQuantity: number;\r\n priceComponent: React.ReactNode;\r\n navigationUrl?: string;\r\n modalOpen: boolean | undefined;\r\n telemetryContent?: ITelemetryContent;\r\n setModalOpen(newValue: boolean): void;\r\n}\r\n\r\nconst getDimensionsText = (product: SimpleProduct) => {\r\n return product.Dimensions\r\n ? product.Dimensions.reduce((str, productDimension) => {\r\n if (productDimension.DimensionValue && productDimension.DimensionValue.Value) {\r\n if (str) {\r\n return `${str}, ${productDimension.DimensionValue.Value}`;\r\n }\r\n\r\n return `${productDimension.DimensionValue.Value}`;\r\n }\r\n\r\n return str;\r\n }, '')\r\n : '';\r\n};\r\n\r\nexport const renderBonusItemLines = (\r\n bonusProducts: (SimpleProduct & { shipped?: boolean })[],\r\n context: ICoreContext,\r\n className: string,\r\n shippedLabel?: string\r\n) => {\r\n return (\r\n bonusProducts &&\r\n bonusProducts.map((bonusProduct, idx) => {\r\n const reducedDimensions = getDimensionsText(bonusProduct);\r\n const originalPriceText = context.cultureFormatter.formatCurrency(bonusProduct.AdjustedPrice);\r\n\r\n return (\r\n
\r\n
\r\n \r\n \r\n {bonusProduct.Name}\r\n {reducedDimensions ? `, ${reducedDimensions}` : ''}\r\n \r\n
\r\n
\r\n Bonus!\r\n {originalPriceText}\r\n $0.00\r\n {bonusProduct.shipped && (\r\n {shippedLabel ?? 'will be shipped'}\r\n )}\r\n
\r\n
\r\n );\r\n })\r\n );\r\n};\r\n\r\nexport const Popup = (popupProps: IPopupProps) => {\r\n const {\r\n dialogStrings,\r\n className,\r\n imageSettings,\r\n gridSettings,\r\n data: { product, price, bonusProducts },\r\n productQuantity,\r\n priceComponent,\r\n navigationUrl,\r\n modalOpen,\r\n telemetryContent,\r\n setModalOpen,\r\n context\r\n } = popupProps;\r\n const closeModal = React.useCallback(() => {\r\n setModalOpen(false);\r\n }, [setModalOpen]);\r\n if (!dialogStrings || !product) {\r\n return null;\r\n }\r\n const payLoad = getPayloadObject('click', telemetryContent!, TelemetryConstant.ContinueShopping);\r\n const continueShoppingAttribute = getTelemetryAttributes(telemetryContent!, payLoad);\r\n payLoad.contentAction.etext = TelemetryConstant.ViewBagAndCheckout;\r\n const viewBagAttribute = getTelemetryAttributes(telemetryContent!, payLoad);\r\n\r\n const fallbackImageUrl = getFallbackImageUrl(product.ItemId, context.actionContext.requestContext.apiSettings);\r\n if (imageSettings) {\r\n imageSettings.cropFocalRegion = true;\r\n }\r\n const quantity = (productQuantity !== undefined ? productQuantity : 1) + (bonusProducts?.length ?? 0);\r\n const itemsString =\r\n quantity === 1 ? dialogStrings.headerItemOneText : dialogStrings.headerItemFormatText.replace('{0}', quantity.toString());\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- app configs are of generic type\r\n const shouldDisplayUnitOfMeasure =\r\n context.app.config?.unitOfMeasureDisplayType && context.app.config.unitOfMeasureDisplayType !== 'none';\r\n\r\n const reducedDimensions: string = getDimensionsText(product);\r\n\r\n return (\r\n \r\n \r\n {itemsString}\r\n {dialogStrings.headerMessageText}\r\n \r\n \r\n \r\n {product.Name}\r\n {reducedDimensions !== '' ?
{reducedDimensions}
: ''}\r\n {price ?
{priceComponent}
: ''}\r\n {product.DefaultUnitOfMeasure && shouldDisplayUnitOfMeasure ? (\r\n
\r\n {product.DefaultUnitOfMeasure}\r\n
\r\n ) : (\r\n ''\r\n )}\r\n {bonusProducts && renderBonusItemLines(bonusProducts, context, className)}\r\n
\r\n \r\n \r\n {dialogStrings.goToCartText}\r\n \r\n \r\n {dialogStrings.continueShoppingText}\r\n \r\n \r\n
\r\n );\r\n};\r\n\r\nexport default Popup;\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 MsDyn365, {\r\n getCatalogId,\r\n IActionContext,\r\n IComponent,\r\n IComponentProps,\r\n IGridSettings,\r\n IImageSettings,\r\n msdyn365Commerce,\r\n TelemetryEvent\r\n} from '@msdyn365-commerce/core';\r\nimport { getCartState, ICartActionResult, ICartState } from '@msdyn365-commerce/global-state';\r\nimport {\r\n CartLine,\r\n CartLineValidationResults,\r\n CartsDataActions,\r\n format,\r\n OrgUnitLocation,\r\n ProductAvailableQuantity,\r\n ProductDimension,\r\n ProductPrice,\r\n ProductsDataActions,\r\n ProductSearchCriteria,\r\n ProductType,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { ErrorNotification, NotificationsManager } from '@msdyn365-commerce-modules/notifications-core';\r\nimport { ArrayExtensions, generateProductImageUrl, ObjectExtensions, validateCatalogId } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport React, { useState } from 'react';\r\n\r\nimport {\r\n PriceComponent,\r\n IItemsAddedToCartResources,\r\n ItemsAddedToCartDialogComponent,\r\n ItemSuccessfullyAddedToCartNotification,\r\n MultiItemsSuccessfullyAddedToCartNotification,\r\n OrderDetailsProduct\r\n} from '@msdyn365-commerce/components';\r\n\r\nimport Popup, { IPopupProps } from './Popup';\r\nimport { sendGoogleAnalyticsEvent } from '../../../common/sendGoogleAnalyticsEvent';\r\nimport { getLineIdFromExtProps } from '../../cart/components/cart-pick-up-in-store';\r\n/**\r\n * Interface for add to cart resources.\r\n */\r\nexport interface IAddToCartResources {\r\n goToCartText: string;\r\n continueShoppingText: string;\r\n closeNotificationLabel: string;\r\n headerItemOneText: string;\r\n headerItemFormatText: string;\r\n headerLinesFormatText?: string;\r\n headerMessageText: string;\r\n freePriceText: string;\r\n originalPriceText: string;\r\n currentPriceText: string;\r\n addedQuantityText: string;\r\n buyAgainNotificationTitle?: string;\r\n buyAgainNotificationCloseAriaLabel?: string;\r\n validationErrorMessage?: string;\r\n oneErrorText?: string;\r\n multiErrorsText?: string;\r\n}\r\n\r\n/**\r\n * Interface for add to cart components props.\r\n */\r\nexport interface IAddToCartComponentProps extends IComponentProps<{ product: SimpleProduct; price?: ProductPrice } | undefined> {\r\n className?: string;\r\n addToCartText: string;\r\n outOfStockText?: string;\r\n disabled?: boolean;\r\n quantity?: number;\r\n navigationUrl?: string;\r\n productAvailability?: ProductAvailableQuantity;\r\n getSelectedProduct?: Promise;\r\n isNavigationToCartPageDisabled?: boolean;\r\n shouldSkipSiteSettings?: boolean;\r\n addToCartArialLabel?: string;\r\n products?: {\r\n productId: number;\r\n quantity: number;\r\n catalogId?: number;\r\n }[];\r\n orderDetailsProducts?: OrderDetailsProduct[];\r\n hasAvailableProducts?: boolean;\r\n imageSettings?: IImageSettings;\r\n gridSettings?: IGridSettings;\r\n\r\n isLoading?: boolean;\r\n isUpdatingDimension?: boolean;\r\n isLoadingDeliveryOptions?: boolean;\r\n isUpdatingDeliveryOptions?: boolean;\r\n isAddServiceItemToCart?: boolean;\r\n isAddEmailDeliveryItemToCart?: boolean;\r\n isPriceKeyedIn?: boolean;\r\n customPriceAmount?: number;\r\n isOrderQuantityLimitsFeatureEnabled?: boolean;\r\n\r\n dialogStrings?: IAddToCartResources;\r\n\r\n telemetryContent?: ITelemetryContent;\r\n\r\n catalogId?: number;\r\n\r\n isCustomPriceSelected?: boolean;\r\n maximumKeyInPrice?: number;\r\n minimumKeyInPrice?: number;\r\n defaultMaximumKeyInPrice?: number;\r\n defaultMinimumKeyInPrice?: number;\r\n isProductQuantityLoading?: boolean;\r\n\r\n onAdd?(result: ICartActionResult): void;\r\n onError?(result: IAddToCartFailureResult): void;\r\n changeUpdatingDimension?(isUpdatingDimension: boolean): void;\r\n changeUpdatingDeliveryOptions?(isUpdatingDeliveryOptions: boolean): void;\r\n\r\n selectedWarranty: SimpleProduct | null;\r\n bonusItemIds?: number[];\r\n}\r\n\r\n/**\r\n * Cart action Failure reason type.\r\n */\r\nexport declare type ICartActionFailureReason =\r\n | 'EMPTYINPUT'\r\n | 'MISSINGDIMENSION'\r\n | 'OUTOFSTOCK'\r\n | 'CARTACTIONFAILED'\r\n | 'INVALIDCUSTOMAMOUNT';\r\n\r\n/**\r\n * Interface for add to cart failure result.\r\n */\r\nexport interface IAddToCartFailureResult {\r\n failureReason: ICartActionFailureReason;\r\n\r\n stockLeft?: number;\r\n cartActionResult?: ICartActionResult;\r\n missingDimensions?: ProductDimension[];\r\n}\r\n\r\n/**\r\n * This setting defines the experience when a product is added to cart. Corresponds to the configuration in Fabrikam.\r\n */\r\nexport enum AddToCartBehavior {\r\n /**\r\n * Navigate to cart page.\r\n */\r\n goToCart = 'goToCart',\r\n\r\n /**\r\n * Show item added to cart popup.\r\n */\r\n showModal = 'showModal',\r\n\r\n /**\r\n * Show mini cart popup.\r\n */\r\n showMiniCart = 'showMiniCart',\r\n\r\n /**\r\n * Show item added to cart notification.\r\n */\r\n showNotification = 'showNotification',\r\n\r\n /**\r\n * Do nothing and stay on the page.\r\n */\r\n nothing = 'nothing'\r\n}\r\n\r\ninterface IAddCartLine {\r\n product: SimpleProduct;\r\n count?: number;\r\n location?: OrgUnitLocation;\r\n additionalProperties?: object;\r\n availableQuantity?: number;\r\n enableStockCheck?: boolean;\r\n isAddEmailDeliveryItemToCart?: boolean;\r\n isPriceKeyedIn?: boolean;\r\n customPrice?: number;\r\n deliveryMode?: string;\r\n catalogId?: number;\r\n shouldSkipSiteSettings?: boolean;\r\n}\r\n\r\nconst zero = 0;\r\nconst defaultQuantity = 1;\r\n\r\n/**\r\n * The propagate result.\r\n * @param props -- The add to cart component props.\r\n * @param result -- The cart action result.\r\n */\r\nconst propagateResult = (props: IAddToCartComponentProps, result: ICartActionResult): void => {\r\n if (props.onAdd) {\r\n props.onAdd(result);\r\n }\r\n};\r\n\r\n/**\r\n * The propagate error.\r\n * @param props -- The add to cart component props.\r\n * @param result -- The add to cart failure result.\r\n */\r\nconst propagateError = (props: IAddToCartComponentProps, result: IAddToCartFailureResult): void => {\r\n if (props.onError) {\r\n props.onError(result);\r\n }\r\n};\r\n\r\nexport const getBonusItemsForAddToCart = async (props: {\r\n context: { actionContext: IActionContext };\r\n bonusItemIds?: number[];\r\n quantity?: number;\r\n catalogId?: number;\r\n}) => {\r\n const productsToAdd: {\r\n product: SimpleProduct;\r\n count: number;\r\n catalogId: number | undefined;\r\n }[] = [];\r\n\r\n // add bonus items\r\n if (props.bonusItemIds && props.bonusItemIds.length > 0) {\r\n const actionContext = props.context.actionContext;\r\n const apiSettings = actionContext.requestContext.apiSettings;\r\n const bonusProducts = await ProductsDataActions.getByIdsAsync(\r\n { callerContext: actionContext },\r\n apiSettings.channelId,\r\n props.bonusItemIds\r\n );\r\n\r\n const productAvailabilities = await ProductsDataActions.getEstimatedAvailabilityAsync(\r\n { callerContext: actionContext },\r\n {\r\n ProductIds: props.bonusItemIds,\r\n DefaultWarehouseOnly: true\r\n }\r\n );\r\n\r\n process.env.NODE_ENV === 'development' && console.log('BuyboxView', 'addProductsToCart', productAvailabilities);\r\n\r\n for (const p of bonusProducts) {\r\n const avail = productAvailabilities.AggregatedProductInventoryAvailabilities?.find(a => a.ProductId === p.RecordId);\r\n if (avail?.PhysicalAvailableInventoryLevelCode && avail.PhysicalAvailableInventoryLevelCode !== 'OOS') {\r\n productsToAdd.push({\r\n product: p,\r\n count: props.quantity ?? defaultQuantity,\r\n catalogId: props.catalogId\r\n });\r\n }\r\n }\r\n }\r\n\r\n return productsToAdd;\r\n};\r\n\r\n/**\r\n * Retrieves add to cart input from the component props.\r\n * @param props - Add to cart component props.\r\n * @returns Add to cart input.\r\n */\r\nconst getAddToCartInputFromProps = async (props: IAddToCartComponentProps) => {\r\n const products = props.orderDetailsProducts?.filter(product => !ObjectExtensions.isNullOrUndefined(product.simpleProduct));\r\n const emailDeliveryModeCode = props.context.actionContext.requestContext.channel?.EmailDeliveryModeCode;\r\n const input = products?.map(product => {\r\n const deliveryOption = product.salesLine.DeliveryMode;\r\n return {\r\n product: product.simpleProduct!,\r\n count: ObjectExtensions.isNullOrUndefined(product.salesLine.Quantity) ? defaultQuantity : product.salesLine.Quantity,\r\n catalogId: product.salesLine.CatalogId,\r\n isAddEmailDeliveryItemToCart: deliveryOption && deliveryOption === emailDeliveryModeCode\r\n };\r\n });\r\n\r\n if (ArrayExtensions.hasElements(input)) {\r\n return input;\r\n }\r\n\r\n if (ArrayExtensions.hasElements(props.products)) {\r\n const actionContext = props.context.actionContext;\r\n const apiSettings = actionContext.requestContext.apiSettings;\r\n\r\n const catalogId = props.catalogId ?? getCatalogId(props.context.actionContext.requestContext);\r\n validateCatalogId(catalogId);\r\n\r\n const searchCriteriaInput: ProductSearchCriteria = {\r\n Context: {\r\n ChannelId: apiSettings.channelId,\r\n CatalogId: catalogId\r\n },\r\n IncludeAttributes: false,\r\n Ids: props.products.map(product => product.productId)\r\n };\r\n\r\n const searchResult = await ProductsDataActions.searchByCriteriaAsync({ callerContext: actionContext }, searchCriteriaInput);\r\n const productSearchResultsWithImages = searchResult.map(productSearchResult => {\r\n const newProductSearchResult = { ...productSearchResult };\r\n const newImageUrl = generateProductImageUrl(newProductSearchResult, apiSettings);\r\n\r\n if (newImageUrl) {\r\n newProductSearchResult.PrimaryImageUrl = newImageUrl;\r\n }\r\n\r\n return newProductSearchResult;\r\n });\r\n\r\n return props.products.map(item => {\r\n const productData = productSearchResultsWithImages.find(product => product.RecordId === item.productId);\r\n let simpleProduct: SimpleProduct;\r\n if (productData) {\r\n simpleProduct = {\r\n ...productData,\r\n ProductTypeValue: ProductType.Variant,\r\n AdjustedPrice: productData.Price,\r\n BasePrice: productData.BasePrice ?? productData.Price\r\n };\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- Cast to simple product since only record id is available.\r\n simpleProduct = {\r\n RecordId: item.productId\r\n } as SimpleProduct;\r\n }\r\n\r\n return {\r\n product: simpleProduct,\r\n count: item.quantity,\r\n catalogId: item.catalogId\r\n };\r\n });\r\n }\r\n\r\n // add from PDP\r\n if (props.data?.product) {\r\n const productsToAdd = [\r\n {\r\n product: props.data.product,\r\n count: props.quantity ?? defaultQuantity,\r\n catalogId: props.catalogId\r\n }\r\n ];\r\n\r\n // add selected warranty\r\n if (props.selectedWarranty) {\r\n const warrantyProduct = props.selectedWarranty;\r\n\r\n productsToAdd.push({\r\n product: warrantyProduct,\r\n count: props.quantity ?? defaultQuantity,\r\n catalogId: props.catalogId\r\n });\r\n }\r\n\r\n // add bonus items\r\n if (props.bonusItemIds && props.bonusItemIds.length > 0) {\r\n const bonusItems = await getBonusItemsForAddToCart(props);\r\n for (const p of bonusItems) {\r\n productsToAdd.push(p);\r\n }\r\n }\r\n\r\n return productsToAdd;\r\n }\r\n\r\n return [];\r\n};\r\n\r\n/**\r\n * Add one item to cart when it is not buy again.\r\n * @param props -- The props.\r\n * @param setDisabled -- The set disable call back.\r\n * @param openModal -- The open modal call back.\r\n */\r\nconst addOneItemToCart = async (\r\n props: IAddToCartComponentProps,\r\n setDisabled: (disabled: boolean) => void,\r\n openModal: (opened: boolean) => void\r\n): Promise => {\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- read config file.\r\n const addToCartBehavior = props.context.app.config.addToCartBehavior;\r\n const data = props.data;\r\n\r\n const addToCartInput = await getAddToCartInputFromProps(props);\r\n const product = addToCartInput[0].product;\r\n const quantity = addToCartInput[0].count;\r\n\r\n const cartState = await getCartState(props.context.actionContext);\r\n\r\n const productsToAdd: IAddCartLine[] = [\r\n {\r\n product,\r\n count: quantity,\r\n availableQuantity: props.productAvailability?.AvailableQuantity,\r\n additionalProperties: { orderQuantityLimitsFeatureIsEnabled: props.isOrderQuantityLimitsFeatureEnabled },\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- read config file.\r\n enableStockCheck: props.context.app.config.enableStockCheck,\r\n isPriceKeyedIn: props.isPriceKeyedIn,\r\n customPrice: props.isPriceKeyedIn ? props.customPriceAmount : undefined,\r\n isAddEmailDeliveryItemToCart: props.isAddEmailDeliveryItemToCart,\r\n shouldSkipSiteSettings: props.shouldSkipSiteSettings,\r\n catalogId: addToCartInput[0].catalogId\r\n }\r\n ];\r\n\r\n if (addToCartInput.length > 1) {\r\n for (let i = 1; i < addToCartInput.length; ++i) {\r\n const addToCartItem = addToCartInput[i];\r\n productsToAdd.push({\r\n ...addToCartItem,\r\n count: addToCartItem.count\r\n });\r\n }\r\n }\r\n\r\n const currentCartLinesCount = cartState.cart.CartLines?.length ?? 0;\r\n const addToCartResult = await cartState.addProductsToCart(productsToAdd);\r\n\r\n if (addToCartResult.status === 'SUCCESS') {\r\n const cartLines = cartState.cart.CartLines ?? [];\r\n const itemsAdded = cartLines.length - currentCartLinesCount;\r\n\r\n process.env.NODE_ENV === 'development' && console.log('BuyboxView', 'addProductsToCart', addToCartResult, itemsAdded);\r\n\r\n if (itemsAdded > 1) {\r\n const productLine = cartLines[currentCartLinesCount];\r\n const updatedCartLinesObject: CartLine[] = [];\r\n\r\n // Link warranty if selected\r\n const warrantyLine = cartLines[currentCartLinesCount + 1];\r\n if (productLine && warrantyLine?.ProductId === props.selectedWarranty?.RecordId) {\r\n warrantyLine.WarrantableLineNumber = productLine.LineNumber;\r\n warrantyLine.IsWarrantyLine = true;\r\n\r\n const [productLineId, productLineUpdated] = getLineIdFromExtProps(productLine);\r\n\r\n if (!warrantyLine.ExtensionProperties) {\r\n warrantyLine.ExtensionProperties = [];\r\n }\r\n\r\n warrantyLine.ExtensionProperties.push({\r\n Key: 'warrantable-line-id',\r\n Value: {\r\n StringValue: productLineId\r\n }\r\n });\r\n\r\n updatedCartLinesObject.push(warrantyLine);\r\n\r\n if (productLineUpdated) {\r\n updatedCartLinesObject.push(productLine);\r\n }\r\n }\r\n\r\n // check if there's bonus item\r\n for (let idx = currentCartLinesCount + 1; idx < cartLines.length; idx++) {\r\n const bonusCartLine = cartLines[idx];\r\n if (!bonusCartLine.IsWarrantyLine) {\r\n if (!bonusCartLine.ExtensionProperties) {\r\n bonusCartLine.ExtensionProperties = [];\r\n }\r\n\r\n const [productLineId, productLineUpdated] = getLineIdFromExtProps(productLine);\r\n\r\n bonusCartLine.ExtensionProperties.push({\r\n Key: 'bonus-for-line-id',\r\n Value: {\r\n StringValue: productLineId\r\n }\r\n });\r\n\r\n updatedCartLinesObject.push(bonusCartLine);\r\n\r\n if (productLineUpdated) {\r\n updatedCartLinesObject.push(productLine);\r\n }\r\n }\r\n }\r\n\r\n if (updatedCartLinesObject.length > 0) {\r\n await cartState.updateCartLines({ updatedCartLinesObject });\r\n }\r\n }\r\n\r\n await sendGoogleAnalyticsEvent(productsToAdd, props.context.actionContext);\r\n\r\n if (props.dialogStrings && addToCartBehavior === AddToCartBehavior.showModal) {\r\n setDisabled(false);\r\n openModal(true);\r\n } else if (props.dialogStrings && addToCartBehavior === AddToCartBehavior.showNotification) {\r\n setDisabled(false);\r\n const notification = new ItemSuccessfullyAddedToCartNotification(\r\n props.context,\r\n props.dialogStrings,\r\n props.imageSettings,\r\n props.gridSettings,\r\n product,\r\n data?.price,\r\n quantity,\r\n props.navigationUrl,\r\n props.telemetryContent!,\r\n props.id,\r\n props.typeName\r\n );\r\n NotificationsManager.instance().addNotification(notification);\r\n } else if (\r\n MsDyn365.isBrowser &&\r\n props.navigationUrl &&\r\n !props.isNavigationToCartPageDisabled &&\r\n (addToCartBehavior === undefined || addToCartBehavior === AddToCartBehavior.goToCart)\r\n ) {\r\n window.location.assign(props.navigationUrl);\r\n } else {\r\n setDisabled(false);\r\n }\r\n propagateResult(props, addToCartResult);\r\n } else {\r\n NotificationsManager.instance().addNotification(\r\n new ErrorNotification(\r\n addToCartResult.errorDetails?.LocalizedMessage ?? 'Add to cart failed',\r\n props.dialogStrings?.closeNotificationLabel ?? ''\r\n )\r\n );\r\n\r\n propagateError(props, { failureReason: 'CARTACTIONFAILED', cartActionResult: addToCartResult });\r\n setDisabled(false);\r\n }\r\n};\r\n\r\n/**\r\n * Callback to handle success of adding to cart.\r\n * @param props - Add to cart component props.\r\n * @param setDisabled - Callback to update disabled state of the component.\r\n * @param setItemsAddedToCartDialogOpen - Callback to update disabled state of the component.\r\n * @param setErrorMessage - Callback to update error message state of the component.\r\n * @param cartState - Current cart state.\r\n * @param addToCartInput - Input used for adding to cart.\r\n * @param addToCartResult - Result of adding to cart.\r\n */\r\nconst handleAddItemsToCartSuccess = async (\r\n props: IAddToCartComponentProps,\r\n setDisabled: (disabled: boolean) => void,\r\n setItemsAddedToCartDialogOpen: (opened: boolean) => void,\r\n setErrorMessage: (message: string) => void,\r\n cartState: ICartState,\r\n addToCartInput: {\r\n product: SimpleProduct;\r\n count: number;\r\n }[],\r\n addToCartResult: ICartActionResult\r\n) => {\r\n // Validate cart for line errors.\r\n const validationResult: CartLineValidationResults = await CartsDataActions.validateForCheckoutAsync(\r\n { callerContext: props.context.actionContext, bypassCache: 'none' },\r\n cartState.cart.Id,\r\n cartState.cart.Version\r\n );\r\n const errorCount = (validationResult.ValidationFailuresByCartLines ?? []).length;\r\n const singleErrorCount = 1;\r\n const errorText = errorCount === singleErrorCount ? props.dialogStrings?.oneErrorText : props.dialogStrings?.multiErrorsText;\r\n const errorMessage =\r\n errorCount > zero ? format(props.dialogStrings?.validationErrorMessage ?? '', errorCount.toString(), errorText) : '';\r\n\r\n setErrorMessage(errorMessage);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- read config file.\r\n const addToCartBehavior = props.context.app.config.addToCartBehavior;\r\n\r\n if (props.dialogStrings && addToCartBehavior === AddToCartBehavior.showModal) {\r\n setDisabled(false);\r\n setItemsAddedToCartDialogOpen(true);\r\n } else if (props.dialogStrings && addToCartBehavior === AddToCartBehavior.showNotification) {\r\n setDisabled(false);\r\n const itemsAddedResource: IItemsAddedToCartResources = {\r\n viewCartButtonText: props.dialogStrings.goToCartText,\r\n closeButtonLabel: props.dialogStrings.closeNotificationLabel,\r\n itemsAddedToCartHeaderText: props.dialogStrings.headerMessageText,\r\n itemsAddedToCartFormatText: props.dialogStrings.headerItemFormatText,\r\n linesAddedToCartFormatText: props.dialogStrings.headerLinesFormatText ?? '{0}',\r\n itemsAddedValidationErrorMessage: errorMessage\r\n };\r\n\r\n const notification = new MultiItemsSuccessfullyAddedToCartNotification(\r\n props.context,\r\n itemsAddedResource,\r\n props.imageSettings,\r\n props.gridSettings,\r\n addToCartInput,\r\n props.navigationUrl,\r\n props.telemetryContent!,\r\n props.id,\r\n props.typeName\r\n );\r\n NotificationsManager.instance().addNotification(notification);\r\n } else if (\r\n MsDyn365.isBrowser &&\r\n props.navigationUrl &&\r\n !props.isNavigationToCartPageDisabled &&\r\n (addToCartBehavior === undefined || addToCartBehavior === AddToCartBehavior.goToCart)\r\n ) {\r\n window.location.assign(props.navigationUrl);\r\n } else {\r\n setDisabled(false);\r\n }\r\n propagateResult(props, addToCartResult);\r\n};\r\n\r\n/**\r\n * Add one or multi item to cart from buy again.\r\n * @param props -- The props.\r\n * @param setDisabled -- The set disable call back.\r\n * @param setItemsAddedToCartDialogOpen -- The open modal call back.\r\n * @param setErrorMessage -- The set error message call back.\r\n */\r\nconst addItemsToCart = async (\r\n props: IAddToCartComponentProps,\r\n setDisabled: (disabled: boolean) => void,\r\n setItemsAddedToCartDialogOpen: (opened: boolean) => void,\r\n setErrorMessage: (message: string) => void\r\n): Promise => {\r\n const addToCartInput = await getAddToCartInputFromProps(props);\r\n\r\n if (!ArrayExtensions.hasElements(addToCartInput)) {\r\n return;\r\n }\r\n\r\n const cartState = await getCartState(props.context.actionContext);\r\n const addToCartResult = await cartState.addProductsToCart(addToCartInput);\r\n\r\n if (addToCartResult.status === 'SUCCESS') {\r\n await handleAddItemsToCartSuccess(\r\n props,\r\n setDisabled,\r\n setItemsAddedToCartDialogOpen,\r\n setErrorMessage,\r\n cartState,\r\n addToCartInput,\r\n addToCartResult\r\n );\r\n } else {\r\n if (props.dialogStrings?.buyAgainNotificationTitle) {\r\n // For buy again show simple error notification.\r\n NotificationsManager.instance().addNotification(\r\n new ErrorNotification(\r\n props.dialogStrings.buyAgainNotificationTitle,\r\n props.dialogStrings.buyAgainNotificationCloseAriaLabel ?? ''\r\n )\r\n );\r\n } else {\r\n NotificationsManager.instance().addNotification(\r\n new ErrorNotification(\r\n addToCartResult.errorDetails?.LocalizedMessage ?? 'Add to cart failed',\r\n props.dialogStrings?.closeNotificationLabel ?? ''\r\n )\r\n );\r\n }\r\n\r\n propagateError(props, { failureReason: 'CARTACTIONFAILED', cartActionResult: addToCartResult });\r\n setDisabled(false);\r\n }\r\n};\r\n\r\n/**\r\n * Interface for add to cart component.\r\n */\r\nexport interface IAddtoCartComponent extends IComponent {\r\n onClick(): (event: React.MouseEvent, props: IAddToCartComponentProps) => void;\r\n}\r\n\r\n/**\r\n * On click function.\r\n * @param _event - The mouse event.\r\n * @param props - The props.\r\n * @param setDisabled - Flag to define whether the element is disabled.\r\n * @param openModal - Flag to specify if it should open in a modal window.\r\n * @param setItemsAddedToCartDialogOpen - Sets items added to cart while dialog is open.\r\n * @param setErrorMessage - Error message.\r\n */\r\nconst onClick = async (\r\n _event: React.MouseEvent,\r\n props: IAddToCartComponentProps,\r\n setDisabled: (disabled: boolean) => void,\r\n openModal: (opened: boolean) => void,\r\n setItemsAddedToCartDialogOpen: (opened: boolean) => void,\r\n setErrorMessage: (message: string) => void\r\n): Promise => {\r\n if (!ArrayExtensions.hasElements(props.products)) {\r\n const cartError = addToCartError(props);\r\n\r\n if (cartError) {\r\n propagateError(props, cartError);\r\n return;\r\n }\r\n\r\n setDisabled(true);\r\n }\r\n\r\n const hasOrderDetailsProducts =\r\n ArrayExtensions.hasElements(props.orderDetailsProducts) && props.orderDetailsProducts.length > defaultQuantity;\r\n const hasProducts = ArrayExtensions.hasElements(props.products) && props.products.length > defaultQuantity;\r\n\r\n const hasMultipleProducts = hasOrderDetailsProducts || hasProducts;\r\n\r\n if (props.shouldSkipSiteSettings && hasMultipleProducts) {\r\n await addItemsToCart(props, setDisabled, setItemsAddedToCartDialogOpen, setErrorMessage);\r\n } else {\r\n await addOneItemToCart(props, setDisabled, openModal);\r\n }\r\n};\r\n\r\n/**\r\n * Add to cart component action constant.\r\n */\r\nconst AddToCartComponentActions = {\r\n onClick\r\n};\r\n\r\n/**\r\n * Add to cart component.\r\n * @param props - The props.\r\n * @returns - The add to cart component.\r\n */\r\nexport const AddToCartFunctionalComponent: React.FC = (props: IAddToCartComponentProps) => {\r\n const [disabled, setDisabled] = useState(false);\r\n const [modalOpen, setModalOpen] = useState(false);\r\n const [isItemsAddedToCartDialogOpen, setItemsAddedToCartDialogOpen] = useState(false);\r\n const [errorMessage, setErrorMessage] = useState('');\r\n const [addToCartInput, setAddToCartInput] = useState<\r\n {\r\n product: SimpleProduct;\r\n count: number;\r\n }[]\r\n >([]);\r\n\r\n const onClickHandler = async (event: React.MouseEvent) => {\r\n await AddToCartComponentActions.onClick(event, props, setDisabled, setModalOpen, setItemsAddedToCartDialogOpen, setErrorMessage);\r\n };\r\n\r\n /**\r\n * Close dialog.\r\n */\r\n const closeItemsAddedToCartDialog = React.useCallback(() => {\r\n setItemsAddedToCartDialogOpen(false);\r\n }, []);\r\n\r\n const priceComponent = props.data?.price ? (\r\n \r\n ) : (\r\n ''\r\n );\r\n\r\n const popupProps: IPopupProps = {\r\n context: props.context,\r\n className: 'msc-add-to-cart',\r\n id: props.id,\r\n typeName: props.typeName,\r\n data: {\r\n product: addToCartInput[0]?.product,\r\n price: props.data?.price,\r\n bonusProducts: addToCartInput\r\n ?.filter((p, i) => i > 0 && p.product.RecordId && !!props.bonusItemIds?.find(id => id === p.product.RecordId))\r\n .map(p => p.product)\r\n },\r\n dialogStrings: props.dialogStrings,\r\n imageSettings: props.imageSettings,\r\n gridSettings: props.context.request.gridSettings,\r\n productQuantity: addToCartInput[0]?.count !== undefined ? addToCartInput[0]?.count : defaultQuantity,\r\n priceComponent,\r\n navigationUrl: props.navigationUrl,\r\n modalOpen,\r\n setModalOpen,\r\n telemetryContent: props.telemetryContent\r\n };\r\n\r\n const itemsAddedResource: IItemsAddedToCartResources = {\r\n viewCartButtonText: props.dialogStrings?.goToCartText ?? '',\r\n closeButtonLabel: props.dialogStrings?.closeNotificationLabel ?? 'Close',\r\n itemsAddedToCartHeaderText: props.dialogStrings?.headerMessageText ?? '',\r\n itemsAddedToCartFormatText: props.dialogStrings?.headerItemFormatText ?? '',\r\n linesAddedToCartFormatText: props.dialogStrings?.headerLinesFormatText ?? '{0}',\r\n itemsAddedValidationErrorMessage: errorMessage\r\n };\r\n\r\n const renderModalPopup = ;\r\n const label = getLinkText(props);\r\n const payload = getPayloadObject(TelemetryEvent.AddToCart, props.telemetryContent!, label, '');\r\n const attributes = getTelemetryAttributes(props.telemetryContent!, payload);\r\n const buttonClassName = props.shouldSkipSiteSettings ? '' : 'msc-add-to-cart ';\r\n\r\n React.useEffect(() => {\r\n /**\r\n * Retrieves add to cart input and updates the state.\r\n */\r\n const retrieveAddToCartInput = async () => {\r\n const retrievedInput = await getAddToCartInputFromProps(props);\r\n setAddToCartInput(retrievedInput);\r\n };\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises -- Call async method as per the documentation of react useEffect.\r\n retrieveAddToCartInput();\r\n }, [props, setAddToCartInput]);\r\n\r\n return (\r\n <>\r\n {renderModalPopup}\r\n \r\n {label}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\n// Set default props\r\nAddToCartFunctionalComponent.defaultProps = {\r\n quantity: defaultQuantity\r\n};\r\n\r\n/**\r\n * Resolves whether product is in stock.\r\n * @param props - The add to cart component props.\r\n * @returns Gets the link text.\r\n */\r\nconst getLinkText = (props: IAddToCartComponentProps): string => {\r\n return shouldShowOutOfStock(props, false) && props.outOfStockText ? props.outOfStockText : props.addToCartText;\r\n};\r\n\r\n/**\r\n * Resolves whether product is in stock.\r\n * @param props - The add to cart component props.\r\n * @returns The add to cart failure result.\r\n */\r\nconst addToCartError = (props: IAddToCartComponentProps): IAddToCartFailureResult | undefined => {\r\n const {\r\n data,\r\n productAvailability,\r\n isCustomPriceSelected,\r\n customPriceAmount,\r\n maximumKeyInPrice,\r\n minimumKeyInPrice,\r\n defaultMaximumKeyInPrice = 100,\r\n defaultMinimumKeyInPrice = 10\r\n } = props;\r\n\r\n if (!data || !data.product.RecordId) {\r\n // No product exists, won't be able to add to cart\r\n return { failureReason: 'EMPTYINPUT' };\r\n }\r\n\r\n if (data.product.Dimensions) {\r\n const missingDimensions = data.product.Dimensions.filter(\r\n dimension => !(dimension.DimensionValue && dimension.DimensionValue.Value)\r\n );\r\n\r\n if (ArrayExtensions.hasElements(missingDimensions)) {\r\n // At least one dimension with no value exists on the product, won't be able to add to cart\r\n return { failureReason: 'MISSINGDIMENSION', missingDimensions };\r\n }\r\n }\r\n\r\n if (shouldShowOutOfStock(props, true)) {\r\n const defaultAvailableQuantity = 0; // Showing as out of stock if no available products found.\r\n const availableQuantity = productAvailability?.AvailableQuantity ?? defaultAvailableQuantity;\r\n const stockLeft = Math.max(availableQuantity, defaultAvailableQuantity);\r\n\r\n return { failureReason: 'OUTOFSTOCK', stockLeft };\r\n }\r\n\r\n // When Custom price is selected, if there is no keyed-in price or keyed-in price is out of limit, should return error.\r\n if (\r\n isCustomPriceSelected &&\r\n (!customPriceAmount ||\r\n customPriceAmount > (maximumKeyInPrice || defaultMaximumKeyInPrice) ||\r\n customPriceAmount < (minimumKeyInPrice || defaultMinimumKeyInPrice))\r\n ) {\r\n return { failureReason: 'INVALIDCUSTOMAMOUNT' };\r\n }\r\n\r\n // Only allow adding to cart if not showing out of stock\r\n return undefined;\r\n};\r\n\r\n/**\r\n * Resolves whether product is in stock.\r\n * @param props - The add to cart component props.\r\n * @param includeCurrentQuantity - Flag to specify whether current quantity should be included.\r\n * @returns The dialog element.\r\n */\r\nconst shouldShowOutOfStock = (props: IAddToCartComponentProps, includeCurrentQuantity: boolean): boolean => {\r\n if (props.context.app.config.enableStockCheck === undefined || props.context.app.config.enableStockCheck === false) {\r\n return false;\r\n }\r\n\r\n // When skip site settings do not need show out of stock on adding to cart\r\n if (props.shouldSkipSiteSettings) {\r\n return false;\r\n }\r\n\r\n if (\r\n props.isLoading ||\r\n props.isProductQuantityLoading ||\r\n props.isUpdatingDimension ||\r\n props.isLoadingDeliveryOptions ||\r\n props.isUpdatingDeliveryOptions ||\r\n props.isAddServiceItemToCart\r\n ) {\r\n // Out of stock turn off, don't bother showing out of stock\r\n return false;\r\n }\r\n\r\n if (!props.data || !props.data.product.RecordId) {\r\n // No product exists, don't bother showing out of stock\r\n return false;\r\n }\r\n\r\n const hasAvailableProducts = props.hasAvailableProducts ?? true;\r\n if (!hasAvailableProducts) {\r\n return true;\r\n }\r\n\r\n if (props.data.product.Dimensions) {\r\n if (props.data.product.Dimensions.find(dimension => !(dimension.DimensionValue && dimension.DimensionValue.Value))) {\r\n // At least one dimension with no value exists on the product, so also don't show out of stock\r\n return false;\r\n }\r\n }\r\n\r\n const includedQuantityNumber = includeCurrentQuantity && props.quantity ? props.quantity : defaultQuantity;\r\n\r\n return !(\r\n props.productAvailability &&\r\n props.productAvailability.AvailableQuantity !== undefined &&\r\n props.productAvailability.AvailableQuantity >= includedQuantityNumber\r\n );\r\n};\r\n\r\nconst isIntermediateState = (props: IAddToCartComponentProps): boolean => {\r\n if (props.data?.product.Dimensions) {\r\n if (props.data.product.Dimensions.find(dimension => !(dimension.DimensionValue && dimension.DimensionValue.Value))) {\r\n // At least one dimension with no value exists on the product, so also not in intermediate state\r\n return false;\r\n }\r\n }\r\n\r\n if (!props.isLoading && !props.isUpdatingDimension && !props.isLoadingDeliveryOptions && !props.isUpdatingDeliveryOptions) {\r\n return false;\r\n }\r\n\r\n return true;\r\n};\r\n\r\n// @ts-expect-error\r\nexport const AddToCartComponent: React.FunctionComponent = msdyn365Commerce.createComponent(\r\n 'AddToCart',\r\n { component: AddToCartFunctionalComponent, ...AddToCartComponentActions }\r\n);\r\n"],"names":["async","getProductDetails","productId","channelId","ctx","productDetails","tenantId","getRnrPartnerId","serviceEndPoint","getRnrEndpointId","productResult","ProductsDataActions","callerContext","product","getProductAvailabilitiesForSelectedVariant","ProductAvailabilitiesForSelectedVariantInput","then","productAvailabilities","productAvailableQuantity","catch","error","telemetry","exception","getPriceForSelectedVariant","PriceForSelectedVariantInput","undefined","productPrice","getDimensionsForSelectedVariant","GetDimensionsForSelectedVariantInput","productDimensions","getCartStateData","GetCartStateDataInput","requestContext","apiSettings","cartState","cart","getRatingsSummary","GetRatingsSummaryInput","toString","ratingsSummaryData","ratingsSummary","GetCategoryPathsInput","constructor","context","categoryPathLooksups","getCacheKey","buildCacheKey","base","this","constructedCacheKey","locale","catalogId","getCacheObjectType","dataCacheType","getLocale","ChannelId","CatalogId","getCatalogId","forEach","categoryPath","ProductId","createGoogleAnalyticsEvent","eventName","actionContext","_actionContext$reques","channel","RecordId","items","CartLines","i","cartLine","_product$Dimensions","_cartLine$DiscountLin","_product$ExtensionPro","_product$Name","_ref","_product$Price","_cartLine$Quantity","variant","Dimensions","map","d","_d$DimensionValue","DimensionValue","Value","join","discount","DiscountLines","reduce","a","b","_b$Amount","Amount","brand","ExtensionProperties","find","ep","Key","StringValue","item","recId","item_id","ProductNumber","ItemId","item_name","Name","index","item_variant","price","Price","pid","item_brand","quantity","Quantity","push","event","ecommerce","currency","value","_b$price","pushGoogleAnalyticsEvent","payload","dataLayer","window","gaItem","_payload$ecommerce$it","_payload$ecommerce","categoryPaths","getCategoryPaths","_categoryPaths$0$Name","_categoryPaths$1$Name","_categoryPaths$2$Name","_categoryPaths$3$Name","_categoryPaths$4$Name","length","item_category","item_category2","item_category3","item_category4","item_category5","sendGoogleAnalyticsEvent","products","gaItems","prices","p","Date","_productPrice$Discoun","_p$count","brandFromExt","EffectiveAmount","count","totalValue","err","console","ProductStockStatusEnum","findAttribute","attributes","attributeName","attr","_attr$Name","toLowerCase","findAllAttributes","filter","_attr$Name2","findAttributeValue","attribute","DataTypeValue","CurrencyCode","DateTimeOffsetValue","FloatValue","IntegerValue","TextValue","BooleanValue","buildProductBadgeUrl","badgeName","baseUrl","suffix","replace","getProductBadgeUrl","badgeAttributeArray","AttributeValues","badgeStatus","badgeValue","url","BasePrice","getProductStockStatus","extensionProperties","availableProperty","xt","OUT_OF_STOCK","widgetType","props","itemId","className","disableSeo","divRef","React","initialized","setInitialized","isBrowser","MsDyn365","div","current","innerHTML","classnames","ref","getLineIdFromExtProps","_cartLine$ExtensionPr","_cartLine$LineId","lineId","LineId","getWarrantyLine","productLineNumber","_cartState$cart$CartL","linkedCartLine","cl","WarrantableLineNumber","getRelatedCartLines","productCartLine","_cartState$cart$CartL2","cartLinesToRemove","LineNumber","productLineId","cartLines","_cartLine$ExtensionPr2","TotalAmount","ex","_ex$Value","PickUpInStore","_toggleBOPIS","storeSelectorStateManager","cartline","storeSelectorModuleId","isBopisSelected","openDialog","id","alreadySelectedLocation","OrgUnitNumber","FulfillmentStoreId","deliveryOptions","onLocationSelected","orgUnitLocation","deliveryMode","result","updateCartLinePickupLocation","cartLineId","location","status","relatedLines","bonusLines","l","IsWarrantyLine","inStockAtStore","warehouseAvailability","_props$context$reques","_props$context$reques2","InventLocationId","InventoryLocationId","DataAreaId","InventLocationDataAreaId","availablity","_warehouseAvailabilit","AggregatedProductInventoryAvailabilities","PhysicalAvailableInventoryLevelCode","relatedLine","clearCartLinePickupLocation","locationChangedHandler","_onLocationChangedCallback","DeliveryMode","ShippingAddress","_getOrgUnitName","fulfillmentStoreId","orgUnitLocations","foundLocation","OrgUnitName","DeliveryOptions","_props$channelDeliver","retailMulitplePickupFeatureState","channelDeliveryOptionConfig","matchDeliveryOptions","productdeliveryOptions","storePickUpOptionList","deliveryOption","delivery","pickup","deliveryCode","Code","ArrayExtensions","hasElements","PickupDeliveryModeCodes","pickupDeliveryModeCode","option","callbacks","toggleBopis","defaultComponent","_renderShippingMethod","shipItText","pickupInStoretext","changeStoreText","orgUnitName","bopisSelected","toggleBOPIS","type","name","onChange","checked","key","onClick","shipitText","pickUpInStoreText","_getDeliveryOption","pickupStore","_deliveryOptions$Deli","Description","ContainerProps","getDimensionsText","str","productDimension","renderBonusItemLines","bonusProducts","shippedLabel","bonusProduct","idx","reducedDimensions","originalPriceText","cultureFormatter","formatCurrency","AdjustedPrice","shipped","popupProps","_bonusProducts$length","_context$app$config","dialogStrings","imageSettings","gridSettings","data","productQuantity","priceComponent","navigationUrl","modalOpen","telemetryContent","setModalOpen","closeModal","payLoad","getPayloadObject","TelemetryConstant","ContinueShopping","continueShoppingAttribute","getTelemetryAttributes","contentAction","etext","ViewBagAndCheckout","viewBagAttribute","fallbackImageUrl","getFallbackImageUrl","cropFocalRegion","itemsString","headerItemOneText","headerItemFormatText","shouldDisplayUnitOfMeasure","app","config","unitOfMeasureDisplayType","Modal","isOpen","onClosed","toggle","ModalHeader","headerMessageText","ModalBody","Image","src","PrimaryImageUrl","fallBackSrc","altText","loadFailureBehavior","DefaultUnitOfMeasure","ModalFooter","Button","Object","assign","href","goToCartText","continueShoppingText","AddToCartBehavior","propagateResult","onAdd","propagateError","onError","getBonusItemsForAddToCart","productsToAdd","bonusItemIds","ProductIds","DefaultWarehouseOnly","_productAvailabilitie","avail","_props$quantity","getAddToCartInputFromProps","_props$orderDetailsPr","_props$context$action","_props$data","orderDetailsProducts","ObjectExtensions","isNullOrUndefined","simpleProduct","emailDeliveryModeCode","EmailDeliveryModeCode","input","salesLine","isAddEmailDeliveryItemToCart","_props$catalogId","validateCatalogId","searchCriteriaInput","Context","IncludeAttributes","Ids","productSearchResultsWithImages","productSearchResult","newProductSearchResult","_objectSpread","newImageUrl","generateProductImageUrl","productData","_productData$BasePric","ProductTypeValue","ProductType","Variant","_props$quantity2","selectedWarranty","_props$quantity3","warrantyProduct","bonusItems","addItemsToCart","setDisabled","setItemsAddedToCartDialogOpen","setErrorMessage","addToCartInput","getCartState","addToCartResult","addProductsToCart","_validationResult$Val","_props$dialogStrings2","_props$dialogStrings3","_props$dialogStrings$2","_props$dialogStrings4","errorCount","CartsDataActions","bypassCache","Id","Version","ValidationFailuresByCartLines","errorText","oneErrorText","multiErrorsText","errorMessage","format","validationErrorMessage","addToCartBehavior","showModal","showNotification","_props$dialogStrings$3","itemsAddedResource","viewCartButtonText","closeButtonLabel","closeNotificationLabel","itemsAddedToCartHeaderText","itemsAddedToCartFormatText","linesAddedToCartFormatText","headerLinesFormatText","itemsAddedValidationErrorMessage","notification","MultiItemsSuccessfullyAddedToCartNotification","typeName","NotificationsManager","instance","addNotification","isNavigationToCartPageDisabled","goToCart","handleAddItemsToCartSuccess","_props$dialogStrings5","_props$dialogStrings$4","_addToCartResult$erro3","_addToCartResult$erro4","_props$dialogStrings$5","_props$dialogStrings6","buyAgainNotificationTitle","ErrorNotification","buyAgainNotificationCloseAriaLabel","errorDetails","LocalizedMessage","failureReason","cartActionResult","AddToCartComponentActions","_event","openModal","cartError","addToCartError","hasOrderDetailsProducts","hasProducts","hasMultipleProducts","shouldSkipSiteSettings","_props$productAvailab","availableQuantity","productAvailability","AvailableQuantity","additionalProperties","orderQuantityLimitsFeatureIsEnabled","isOrderQuantityLimitsFeatureEnabled","enableStockCheck","isPriceKeyedIn","customPrice","customPriceAmount","addToCartItem","currentCartLinesCount","_cartState$cart$CartL3","_props$selectedWarran","productLine","updatedCartLinesObject","warrantyLine","productLineUpdated","bonusCartLine","updateCartLines","ItemSuccessfullyAddedToCartNotification","_addToCartResult$erro","_addToCartResult$erro2","_props$dialogStrings$","_props$dialogStrings","addOneItemToCart","AddToCartFunctionalComponent","_props$data2","_props$dialogStrings7","_props$dialogStrings8","_props$dialogStrings9","_addToCartInput$","_props$data3","_addToCartInput$2","_addToCartInput$3","_props$dialogStrings$6","_props$dialogStrings10","_props$dialogStrings$7","_props$dialogStrings11","_props$dialogStrings$8","_props$dialogStrings12","_props$dialogStrings$9","_props$dialogStrings13","_props$dialogStrings$10","_props$dialogStrings14","_props$addToCartArial","_props$addToCartArial2","disabled","useState","isItemsAddedToCartDialogOpen","setAddToCartInput","closeItemsAddedToCartDialog","PriceComponent","freePriceText","currentPriceText","_props$bonusItemIds","request","renderModalPopup","Popup","label","getLinkText","TelemetryEvent","AddToCart","buttonClassName","retrievedInput","retrieveAddToCartInput","addToCartArialLabel","title","isIntermediateState","shouldShowOutOfStock","ItemsAddedToCartDialogComponent","isModalOpen","onClose","defaultProps","outOfStockText","addToCartText","isCustomPriceSelected","maximumKeyInPrice","minimumKeyInPrice","defaultMaximumKeyInPrice","defaultMinimumKeyInPrice","missingDimensions","dimension","_productAvailability$","defaultAvailableQuantity","stockLeft","Math","max","includeCurrentQuantity","_props$hasAvailablePr","isLoading","isProductQuantityLoading","isUpdatingDimension","isLoadingDeliveryOptions","isUpdatingDeliveryOptions","isAddServiceItemToCart","hasAvailableProducts","includedQuantityNumber","_props$data4","AddToCartComponent","msdyn365Commerce","createComponent","component"],"sourceRoot":""}