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,MAAO,IAEvzBC,KAAK,EACLC,GAAI,YACJC,EAAG,qBACHC,EAAG,YAEHC,IAAK,GAGLC,GAAI,kCAOAlB,EAF4B,kEACXO,EAAQ,KAQzBP,EAF4B,+FACXO,EAAQ,KAQzBP,EAF4B,kEACXO,EAAQ,KAQzBP,EAF4B,0EACXO,EAAQ,KAQzBP,EAF4B,uEACXO,EAAQ,KAQzBP,EAF4B,+EACXO,EAAQ,MAQzBP,EAF4B,+EACXO,EAAQ,KAMjCzf,OAAOqgB,aAAergB,OAAOqgB,cAAgB,GAC7CrgB,OAAOqgB,aAAarB,QAAOxT,EAAAA,EAAA,GACpBxL,OAAOqgB,aAAarB,SAAW,IAC/BD,EAAQC,SAGXhf,OAAOqgB,aAAapB,YAAWzT,EAAAA,EAAA,GAC5BxL,OAAOqgB,aAAapB,aAAe,IACnCF,EAAQE,aAEY,MAAMqB,EAAiB,GAC9BA,EAAe,qEAAuE,CAC9Fd,EAAGA,IAAMC,EAAQ,MACjBc,GAAI,0CAEpBvgB,OAAOqgB,aAAergB,OAAOqgB,cAAgB,GAC7CrgB,OAAOqgB,aAAaC,eAAc9U,EAAAA,EAAA,GACPxL,OAAOqgB,aAAaC,gBAAkB,IACtCA,yKC7H3BE,EAAOC,QAAUvmB,cCAjBsmB,EAAOC,QAAUC","sources":["webpack://Msdyn365.Commerce.Online/./src/actions/custom-get-simple-products.ts?5fc7","webpack://Msdyn365.Commerce.Online/./src/components/discount-badge/discount-badge.tsx?6e5c","webpack://Msdyn365.Commerce.Online/./src/modules/vinhuset-cart-icon/vinhuset-cart-icon.props.autogenerated.ts?0afa","webpack://Msdyn365.Commerce.Online/./src/modules/vinhuset-cart-icon/components/flyout-cart-line-items.tsx?e363","webpack://Msdyn365.Commerce.Online/./src/modules/vinhuset-cart-icon/utils/get-products-in-active-cart.ts?9f84","webpack://Msdyn365.Commerce.Online/./src/modules/vinhuset-cart-icon/utils/get-products-in-mini-cart.ts?5618","webpack://Msdyn365.Commerce.Online/./src/modules/vinhuset-cart-icon/vinhuset-cart-icon.tsx?a374","webpack://Msdyn365.Commerce.Online/./src/modules/vinhuset-cart-icon/vinhuset-cart-icon.view.tsx?21da","webpack://Msdyn365.Commerce.Online/./src/shared-utils/string-utils.ts?de49","webpack://Msdyn365.Commerce.Online/./src/shared-utils/unit-conversion-utils.ts?1560","webpack://Msdyn365.Commerce.Online/./src/themes/vinhuset-adventureworks/views/components/carticon.component.tsx?bbc4","webpack://Msdyn365.Commerce.Online/./src/themes/vinhuset-adventureworks/views/components/price.component.tsx?7056","webpack://Msdyn365.Commerce.Online/./lib/vinhuset-cart-icon/module-registration.js?0b1d","webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online/external var \"ReactDOM\"?853b"],"sourcesContent":["/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n getCatalogId,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICommerceApiSettings,\r\n ICreateActionContext,\r\n IDictionary,\r\n IGeneric,\r\n IRequestContext\r\n} from '@msdyn365-commerce/core';\r\nimport { getByIdsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\nimport {\r\n ArrayExtensions,\r\n generateCacheKey,\r\n QueryResultSettingsProxy,generateProductImageUrl\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\n\r\n/**\r\n * Product Input.\r\n */\r\nexport class ProductInput implements IActionInput {\r\n public productId: number;\r\n\r\n public channelId: number;\r\n\r\n public warehouseId?: string;\r\n\r\n public catalogId?: number;\r\n\r\n private readonly apiSettings: ICommerceApiSettings;\r\n\r\n public constructor(\r\n productId: number | string,\r\n apiSettings: ICommerceApiSettings,\r\n channelId?: number,\r\n warehouseId?: string,\r\n requestContext?: IRequestContext,\r\n catalogId?: number\r\n ) {\r\n this.apiSettings = apiSettings;\r\n this.productId = +productId;\r\n this.channelId = channelId || apiSettings.channelId;\r\n this.warehouseId = warehouseId;\r\n this.catalogId = catalogId;\r\n\r\n if (requestContext && catalogId === undefined) {\r\n this.catalogId = getCatalogId(requestContext);\r\n }\r\n }\r\n\r\n public getCacheKey = () =>\r\n generateCacheKey(\r\n this.apiSettings,\r\n { key: 'ProductRecordId', value: this.productId },\r\n { key: 'ChannelId', value: this.channelId },\r\n { key: 'WarehouseId', value: this.warehouseId },\r\n { key: 'CatalogId', value: this.catalogId }\r\n );\r\n\r\n public getCacheObjectType = () => 'SimpleProduct';\r\n\r\n public dataCacheType = (): CacheType => 'none'; //'application';\r\n}\r\n\r\n/**\r\n * Creates the input required to make the retail api call.\r\n * @param inputData\r\n */\r\nexport const createSimpleProductsInput = (inputData: ICreateActionContext>): IActionInput[] => {\r\n let productIds = inputData.config && inputData.config.productIds;\r\n if (!productIds) {\r\n return [];\r\n }\r\n\r\n productIds = typeof productIds === 'string' ? productIds.split(',') : productIds;\r\n return !Array.isArray(productIds)\r\n ? []\r\n : productIds.map((productId: string) => {\r\n return new ProductInput(productId, inputData.requestContext.apiSettings, undefined, undefined, inputData.requestContext);\r\n });\r\n};\r\n\r\n/**\r\n * Calls the Retail API and returns the product based on the passed ProductInput.\r\n * @param inputs\r\n * @param ctx\r\n */\r\nexport async function getSimpleProductsAction(inputs: ProductInput[], ctx: IActionContext): Promise {\r\n if (!ArrayExtensions.hasElements(inputs)) {\r\n ctx.trace('[getSimpleProductsAction] Invalid or empty inputs passed.');\r\n return [];\r\n }\r\n\r\n const productIdMapping: IDictionary = {};\r\n\r\n for (let index = 0; index < inputs.length; ++index) {\r\n productIdMapping[inputs[index].productId] = index;\r\n }\r\n\r\n const queryResultSettings = QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(ctx);\r\n queryResultSettings.Paging!.Top = 1000;\r\n\r\n const getProductPromises: Promise[] = [];\r\n const catalogIds = ArrayExtensions.unique(inputs.map(input => input.catalogId));\r\n for (const catalogId of catalogIds) {\r\n const productInputs = inputs.filter(input => input.catalogId === catalogId);\r\n getProductPromises.push(\r\n getByIdsAsync(\r\n { callerContext: ctx, queryResultSettings },\r\n inputs[0].channelId,\r\n productInputs.map(input => input.productId),\r\n inputs[0].warehouseId ?? null,\r\n catalogId ?? 0\r\n )\r\n .then(response => {\r\n return response;\r\n })\r\n .catch(error => {\r\n ctx.telemetry.debug(`[getSimpleProductsAction] Error in getting response from server. ${error}`);\r\n return {};\r\n })\r\n );\r\n }\r\n\r\n const products = ArrayExtensions.flatten(await Promise.all(getProductPromises));\r\n const mappedProducts = products\r\n .map(product => {\r\n try {\r\n const newImageUrl = generateProductImageUrl(product, ctx.requestContext.apiSettings);\r\n\r\n if (newImageUrl) {\r\n product.PrimaryImageUrl = newImageUrl;\r\n }\r\n\r\n return product;\r\n } catch {\r\n ctx.trace('[getSimpleProductsAction] Unable to update ImageURL for Product');\r\n return undefined;\r\n }\r\n })\r\n .reduce((memo: SimpleProduct[], product: SimpleProduct | undefined) => {\r\n if (!product) {\r\n return memo;\r\n }\r\n const index = productIdMapping[product.RecordId];\r\n memo[index] = product;\r\n return memo;\r\n }, []);\r\n\r\n // NOTE: This is not an ideal fix, but will resolve all current issues\r\n return inputs.map(input => {\r\n const foundProduct = mappedProducts.find(product => product && product.RecordId === input.productId);\r\n return foundProduct || {};\r\n });\r\n}\r\n\r\nexport default createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/get-simple-products',\r\n action: >getSimpleProductsAction,\r\n input: createSimpleProductsInput,\r\n isBatched: true\r\n});\r\n","import * as React from 'react';\r\nimport classnames from 'classnames';\r\nimport { ICoreContext, Image, IImageSettings } from '@msdyn365-commerce/core';\r\n\r\ninterface IDiscountBadgeProps {\r\n context: ICoreContext;\r\n className?: string;\r\n badge: string | undefined;\r\n size: 'small' | 'medium' | 'large' | 'x-large';\r\n}\r\n\r\nfunction getDiscountBadgeSize(size: 'small' | 'medium' | 'large' | 'x-large'): { w: number, h: number } {\r\n switch (size) {\r\n case 'small':\r\n return { w: 48, h: 48 };\r\n case 'medium':\r\n return { w: 56, h: 56 };\r\n case 'large':\r\n return { w: 72, h: 72 };\r\n case 'x-large':\r\n default:\r\n return { w: 72, h: 72 };\r\n }\r\n}\r\n\r\nfunction getImageSettings(size: 'small' | 'medium' | 'large' | 'x-large'): IImageSettings {\r\n const { w, h } = getDiscountBadgeSize(size);\r\n\r\n return {\r\n viewports: {\r\n xs: { w, h, q: `w=${w}&h=${h}&q=80&m=0&f=png` },\r\n lg: { w, h, q: `w=${w}&h=${h}&q=80&m=0&f=png` },\r\n xl: { w, h, q: `w=${w}&h=${h}&q=80&m=0&f=png` }\r\n },\r\n quality: 80\r\n };\r\n}\r\n\r\nconst DiscountBadge = (props: IDiscountBadgeProps) => {\r\n const baseClassName = 'vinhuset-discount-badge';\r\n\r\n if (!props.badge) {\r\n return null;\r\n }\r\n\r\n let baseImageUrl = props.context.request.apiSettings.baseImageUrl;\r\n\r\n if (baseImageUrl.endsWith('/')) {\r\n baseImageUrl = baseImageUrl.slice(0, -1);\r\n }\r\n\r\n return (\r\n
\r\n \r\n
\r\n );\r\n};\r\n\r\nexport default DiscountBadge;\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 * IVinhusetCartIcon containerModule 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\nimport * as React from 'react';\r\n\r\nexport const enum cartLinesSortOrder {\r\n ascending = 'ascending',\r\n descending = 'descending'\r\n}\r\n\r\nexport interface IVinhusetCartIconConfig extends Msdyn365.IModuleConfig {\r\n imageSettings?: Msdyn365.IImageSettings;\r\n enableHoverCart?: boolean;\r\n cartLinesSortOrder?: cartLinesSortOrder;\r\n isAnonymousCheckout?: boolean;\r\n clientRender?: boolean;\r\n}\r\n\r\nexport interface IVinhusetCartIconResources {\r\n goToCartButtonTitle: string;\r\n totalPriceFormatString: string;\r\n guestCheckoutButtonTitle: string;\r\n checkoutButtonTitle: string;\r\n productDimensionTypeColor: string;\r\n productDimensionTypeSize: string;\r\n productDimensionTypeStyle: string;\r\n productDimensionTypeConfiguration: string;\r\n quantityDisplayText: string;\r\n removeCartButtonText: string;\r\n cartLabel: string;\r\n cartTooltipLabel: string;\r\n cartQtyLabel: string;\r\n flyoutTitle: string;\r\n salesAgreementPricePrompt: string;\r\n shippingText: string;\r\n checkoutBlockedDueToUnavailableFundsTitle: string;\r\n checkoutBlockedDueToUnavailableFundsMessage: string;\r\n continueShoppingButtonTitle: string;\r\n subTotalMessage: string;\r\n item: string;\r\n items: string;\r\n emptyPrice: string;\r\n emptyCartButtonText: string;\r\n searchPlaceholderText: string;\r\n emptyCartDescriptionText: string;\r\n emptyCartConfirmButtonText: string;\r\n emptyCartCancelButtonText: string;\r\n}\r\n\r\nexport interface IVinhusetCartIconProps extends Msdyn365.IModule {\r\n resources: IVinhusetCartIconResources;\r\n config: IVinhusetCartIconConfig;\r\n slots: {\r\n emptyCart: React.ReactNode[];\r\n promoContentItem: React.ReactNode[];\r\n };\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { CartLineItemComponent, ICartlineResourceString } from '@msdyn365-commerce/components';\r\nimport MsDyn365, { ICoreContext, IGridSettings, IImageSettings, ITelemetry, isChannelTypeB2B } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport {\r\n CartLine,\r\n ChannelDeliveryOptionConfiguration,\r\n OrgUnitLocation,\r\n ProductAvailableQuantity,\r\n ProductDeliveryOptions,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { ProductCatalog, ReleasedProductType } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { getProductUrlSync, IProductInventoryInformation } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n Button,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n ITelemetryContent,\r\n TelemetryConstant\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { getProductByProductId, getProductByProductIdAndWarehouse } from '@msdyn365-commerce-modules/cart';\r\nimport { _mergeDuplicateCartlines } from '../../../shared-utils/cart-utils';\r\n\r\nexport interface IFlyoutCartLineItemsProps {\r\n cartlines: CartLine[];\r\n cartState: ICartState | undefined;\r\n orgUnitLocations: OrgUnitLocation[] | undefined;\r\n resources: ICartlineResourceString;\r\n productAvailabilites: IProductInventoryInformation[] | undefined;\r\n products: SimpleProduct[] | undefined;\r\n productDeliveryOptions: ProductDeliveryOptions[] | undefined;\r\n pickupDeliveryModeCode?: string;\r\n catalogs?: ProductCatalog[];\r\n\r\n /**\r\n * GridSettings for the product image in cartline\r\n */\r\n gridSettings: IGridSettings;\r\n\r\n /**\r\n * ImageSettings for the product image in cartline\r\n */\r\n imageSettings: IImageSettings;\r\n id: string;\r\n typeName: string;\r\n context: ICoreContext;\r\n telemetry: ITelemetry;\r\n removeButtonText: string;\r\n outOfStockText: string;\r\n outOfRangeOneText: string;\r\n outOfRangeFormatText: string;\r\n maxCartlineQuantity: number;\r\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n isQuantityLimitsFeatureEnabled: boolean;\r\n\r\n outOfStockThreshold: number;\r\n isStockCheckEnabled: boolean;\r\n telemetryContent?: ITelemetryContent;\r\n removeItemClickHandler(cartlineToRemove: CartLine): void;\r\n}\r\n\r\nexport interface IFlyoutCartLineItemViewProps {\r\n cartline: React.ReactNode;\r\n remove: React.ReactNode;\r\n storeLocation: React.ReactNode;\r\n hasError: boolean;\r\n\r\n data: {\r\n product: SimpleProduct;\r\n cartline: CartLine;\r\n };\r\n}\r\n\r\nconst _getCartItemAvailableQuantity = (\r\n isStockCheckEnabled: boolean,\r\n outOfStockThreshold: number,\r\n productAvailability?: ProductAvailableQuantity\r\n): number => {\r\n if (isStockCheckEnabled) {\r\n if (\r\n !productAvailability ||\r\n !productAvailability.AvailableQuantity ||\r\n productAvailability.AvailableQuantity <= 0 ||\r\n productAvailability.AvailableQuantity <= outOfStockThreshold\r\n ) {\r\n return 0;\r\n }\r\n return productAvailability.AvailableQuantity - outOfStockThreshold;\r\n }\r\n\r\n return 0;\r\n};\r\n\r\nconst _getCartItemMaxQuantity = (\r\n maxQuantityByConfig: number,\r\n isStockCheckEnabled: boolean,\r\n availableQuantityInStock: number,\r\n isQuantityLimitsFeatureEnabled: boolean,\r\n maxByQuantityLimitsFeature: number\r\n) => {\r\n if (isQuantityLimitsFeatureEnabled) {\r\n let maxByQuantityLimitsFeatureResult = maxByQuantityLimitsFeature;\r\n\r\n // If max by feature in not defined when feature is on then we suggest that there is no max by feature\r\n // and consider available qty if stock check enabled and max from config in site settings.\r\n if (!maxByQuantityLimitsFeature) {\r\n maxByQuantityLimitsFeatureResult = maxQuantityByConfig || 10;\r\n }\r\n\r\n return isStockCheckEnabled\r\n ? maxByQuantityLimitsFeatureResult < availableQuantityInStock\r\n ? maxByQuantityLimitsFeatureResult\r\n : availableQuantityInStock\r\n : maxByQuantityLimitsFeatureResult;\r\n }\r\n if (isStockCheckEnabled) {\r\n return availableQuantityInStock < maxQuantityByConfig ? availableQuantityInStock : maxQuantityByConfig;\r\n }\r\n return maxQuantityByConfig;\r\n};\r\n\r\n/**\r\n * On Remove Click functionality.\r\n * @param removeItemClickHandler -Remove item click function.\r\n * @param cartline -CartLine.\r\n * @returns Remove change value.\r\n */\r\nconst onRemoveClickFunction = (removeItemClickHandler: (cartlineToRemove: CartLine) => void, cartline: CartLine) => () => {\r\n removeItemClickHandler(cartline);\r\n};\r\nconst _assembleNode = (\r\n cartline: CartLine,\r\n product: SimpleProduct,\r\n props: IFlyoutCartLineItemsProps,\r\n index: number,\r\n foundProductAvailability?: ProductAvailableQuantity,\r\n foundProductDeliveryOptions?: ProductDeliveryOptions\r\n): IFlyoutCartLineItemViewProps => {\r\n const { imageSettings, gridSettings, id, typeName, context, resources, removeButtonText, removeItemClickHandler } = props;\r\n\r\n const availableQuantityInStock = _getCartItemAvailableQuantity(\r\n props.isStockCheckEnabled,\r\n props.outOfStockThreshold,\r\n foundProductAvailability\r\n );\r\n const maxQuantity =\r\n product &&\r\n _getCartItemMaxQuantity(\r\n props.maxCartlineQuantity,\r\n props.isStockCheckEnabled,\r\n availableQuantityInStock,\r\n props.isQuantityLimitsFeatureEnabled,\r\n product?.Behavior?.MaximumQuantity || 0\r\n );\r\n\r\n // Check if the product is service or not by product type\r\n const isServiceItem = product.ItemTypeValue === ReleasedProductType.Service;\r\n\r\n const onRemoveClickHandler = onRemoveClickFunction(removeItemClickHandler, cartline);\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.RemoveCartItem);\r\n const removeCartItemAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\r\n\r\n let productUrl = getProductUrlSync(product, props.context.actionContext, undefined);\r\n if (MsDyn365.isBrowser && isChannelTypeB2B(props.context.actionContext.requestContext)) {\r\n const fullUrl = new URL(productUrl, window.location.href);\r\n fullUrl.searchParams.set('catalogid', `${cartline.CatalogId ?? 0}`);\r\n productUrl = fullUrl.href;\r\n }\r\n\r\n return {\r\n data: {\r\n product,\r\n cartline\r\n },\r\n hasError: !isServiceItem && props.isStockCheckEnabled ? cartline.Quantity! > maxQuantity : false,\r\n cartline: (\r\n \r\n ),\r\n remove: (\r\n \r\n {removeButtonText}\r\n \r\n ),\r\n storeLocation: _renderStoreLocation(cartline, props)\r\n };\r\n};\r\n\r\nconst _renderDeliveryLocation = (cartLine: CartLine | null | undefined, props: IFlyoutCartLineItemsProps): string | undefined => {\r\n let deliverylocation;\r\n if (cartLine && cartLine.FulfillmentStoreId) {\r\n const orgUnitName = _getOrgUnitName(cartLine.FulfillmentStoreId, props.orgUnitLocations);\r\n\r\n let foundProductDeliveryOption;\r\n if (props.productDeliveryOptions && props.productDeliveryOptions.length > 0) {\r\n foundProductDeliveryOption = props.productDeliveryOptions.find(deliveryOption => {\r\n return deliveryOption && deliveryOption.ProductId === cartLine.ProductId;\r\n });\r\n }\r\n const delivery = foundProductDeliveryOption?.DeliveryOptions?.find(option => option.Code === cartLine.DeliveryMode);\r\n const location = delivery?.Description;\r\n\r\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\r\n if (location) {\r\n deliverylocation = `${location}, ${orgUnitName}`;\r\n } else {\r\n deliverylocation = `${orgUnitName}`;\r\n }\r\n } else {\r\n deliverylocation = props.resources.shippingText;\r\n }\r\n return deliverylocation;\r\n};\r\n\r\nconst _renderStoreLocation = (cartLine: CartLine | null | undefined, props: IFlyoutCartLineItemsProps): JSX.Element | null => {\r\n if (cartLine && cartLine.FulfillmentStoreId) {\r\n const orgUnitName = _getOrgUnitName(cartLine.FulfillmentStoreId, props.orgUnitLocations);\r\n\r\n if (orgUnitName) {\r\n return (\r\n
\r\n {orgUnitName}\r\n
\r\n );\r\n }\r\n }\r\n\r\n return null;\r\n};\r\n\r\nconst _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\nconst _assembleCartlines = (\r\n cartlines: CartLine[],\r\n products: SimpleProduct[] | undefined,\r\n props: IFlyoutCartLineItemsProps\r\n): IFlyoutCartLineItemViewProps[] | null => {\r\n const reactNodes: IFlyoutCartLineItemViewProps[] = [];\r\n\r\n if (!products || products.length === 0) {\r\n props.context.telemetry.error('Cartlines content is empty, module wont render');\r\n return null;\r\n }\r\n\r\n const mergedCartlines = _mergeDuplicateCartlines(cartlines);\r\n\r\n mergedCartlines.map((cartline, index) => {\r\n let product;\r\n if (props.isQuantityLimitsFeatureEnabled) {\r\n // When feature is enabled the same products could have different quantity limits in Behavior so we need\r\n // to check productId and WarehouseId for identification.\r\n product = getProductByProductIdAndWarehouse(cartline.ProductId, products, cartline.WarehouseId, props.cartState);\r\n } else {\r\n product = getProductByProductId(cartline.ProductId, products);\r\n }\r\n let foundProductAvailability;\r\n if (props.productAvailabilites && props.productAvailabilites.length > 0) {\r\n foundProductAvailability = props.productAvailabilites.find(productAvailability => {\r\n return productAvailability.ProductAvailableQuantity?.ProductId! === cartline.ProductId;\r\n });\r\n }\r\n let foundProductDeliveryOption;\r\n if (props.productDeliveryOptions && props.productDeliveryOptions.length > 0) {\r\n foundProductDeliveryOption = props.productDeliveryOptions.find(deliveryOption => {\r\n return deliveryOption && deliveryOption.ProductId === cartline.ProductId;\r\n });\r\n }\r\n if (product) {\r\n reactNodes.push(\r\n _assembleNode(\r\n cartline,\r\n product,\r\n props,\r\n index,\r\n foundProductAvailability?.ProductAvailableQuantity,\r\n foundProductDeliveryOption\r\n )\r\n );\r\n }\r\n });\r\n\r\n return reactNodes;\r\n};\r\n\r\n/**\r\n * CartLineItems component.\r\n */\r\n\r\nexport const FlyoutCartLineItems = (props: IFlyoutCartLineItemsProps) => {\r\n const { products, cartlines } = props;\r\n return _assembleCartlines(cartlines, products, props);\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n ICreateActionContext\r\n} from '@msdyn365-commerce/core';\r\nimport { getCartState } from '@msdyn365-commerce/global-state';\r\nimport { FeatureState } from '@msdyn365-commerce/retail-proxy';\r\nimport { Cart, CartLine, SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { ArrayExtensions, createGetFeatureStateInput, getCustomer, GetCustomerInput, getFeatureState } from '@msdyn365-commerce-modules/retail-actions';\r\nimport getSimpleProducts, { ProductInput } from '../../../actions/custom-get-simple-products';\r\n\r\n/**\r\n * Input class for activeCartWithProducts data action.\r\n */\r\nexport class ActiveCartProductsInput implements IActionInput {\r\n public getCacheKey = () => 'ActiveCartProducts';\r\n\r\n public getCacheObjectType = () => 'ActiveCartProducts';\r\n\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\nconst createInput = (inputData: ICreateActionContext) => {\r\n return new ActiveCartProductsInput();\r\n};\r\n\r\n/**\r\n * Calls the Retail API and returns a cart object based on the passed GetCartInput.\r\n * @param input\r\n * @param ctx\r\n */\r\nexport async function getActiveCartProductsAction(input: ActiveCartProductsInput, ctx: IActionContext): Promise {\r\n // If no cart ID is provided in input, we need to create a cart object\r\n if (!input) {\r\n throw new Error('[getActiveCartWithProducts]No valid Input was provided, failing');\r\n }\r\n\r\n const cartState = await getCartState(ctx);\r\n const cart = cartState.cart;\r\n\r\n const isQuantityLimitsFeatureIsOn: boolean = await isOrderQuantityLimitsFeatureEnabled(ctx);\r\n\r\n if (isQuantityLimitsFeatureIsOn) {\r\n return getActiveCartProductsActionWhenQuantityLimitsFeatureIsOn(cart, ctx);\r\n }\r\n\r\n // If there are cart lines, make call to get products\r\n if (!cartState.hasInvoiceLine && cart && cart.CartLines && cart.CartLines.length > 0) {\r\n ctx.trace('Getting cart product information...');\r\n return getSimpleProducts(\r\n cart.CartLines.map(cartLine => {\r\n if (cartLine.ProductId) {\r\n return new ProductInput(\r\n cartLine.ProductId,\r\n ctx.requestContext.apiSettings,\r\n undefined,\r\n undefined,\r\n ctx.requestContext,\r\n cartLine.CatalogId\r\n );\r\n }\r\n return undefined;\r\n }).filter(Boolean),\r\n ctx\r\n )\r\n .then((products: SimpleProduct[]) => {\r\n if (products) {\r\n return products;\r\n }\r\n return [];\r\n })\r\n .catch((error: Error) => {\r\n ctx.trace(error.toString());\r\n ctx.telemetry.error(error.message);\r\n ctx.telemetry.debug('[getActiveCartWithProducts]Unable to hydrate cart with product information');\r\n throw new Error('[getActiveCartWithProducts]Unable to hydrate cart with product information');\r\n });\r\n }\r\n\r\n ctx.trace('[getActiveCartWithProducts]No Products Found in cart');\r\n return [];\r\n}\r\n\r\nexport const getActiveCartProductsActionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/get-products-in-active-cart',\r\n action: >getActiveCartProductsAction,\r\n input: createInput\r\n});\r\nexport default getActiveCartProductsActionDataAction;\r\n\r\nasync function getActiveCartProductsActionWhenQuantityLimitsFeatureIsOn(cart: Cart, ctx: IActionContext): Promise {\r\n const productIdsByWarehouseId: Map = new Map();\r\n let resultProducts: SimpleProduct[] = [];\r\n cart.CartLines?.forEach(cartLine =>\r\n productIdsByWarehouseId.has(cartLine.WarehouseId!)\r\n ? productIdsByWarehouseId.get(cartLine.WarehouseId!)?.push(cartLine)\r\n : productIdsByWarehouseId.set(cartLine.WarehouseId!, [cartLine])\r\n );\r\n return Promise.all(\r\n [...productIdsByWarehouseId].map(([entryWarehouseId, entryProductIds]) => {\r\n return getSimpleProducts(\r\n entryProductIds\r\n .map(cartLine => {\r\n if (cartLine.ProductId) {\r\n return new ProductInput(\r\n cartLine.ProductId,\r\n ctx.requestContext.apiSettings,\r\n undefined,\r\n entryWarehouseId,\r\n ctx.requestContext,\r\n cartLine.CatalogId\r\n );\r\n }\r\n return undefined;\r\n })\r\n .filter(Boolean),\r\n ctx\r\n ).then((products: SimpleProduct[]) => {\r\n if (products) {\r\n resultProducts = products.reduce((accum, product) => {\r\n if (product) {\r\n accum.push(product);\r\n }\r\n return accum;\r\n }, resultProducts);\r\n }\r\n });\r\n })\r\n ).then(() => resultProducts);\r\n}\r\n\r\nasync function isOrderQuantityLimitsFeatureEnabled(ctx: IActionContext): Promise {\r\n const defaultOrderQuantityLimitsFeatureConfig = ctx.requestContext.app?.platform?.enableDefaultOrderQuantityLimits;\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'none') {\r\n return Promise.resolve(false);\r\n }\r\n\r\n const featureStates = await getFeatureState(createGetFeatureStateInput(ctx), ctx);\r\n let isQuantityLimitsFeatureEnabledInHq = false;\r\n if (ArrayExtensions.hasElements(featureStates)) {\r\n isQuantityLimitsFeatureEnabledInHq =\r\n featureStates.find(\r\n (featureState: FeatureState) => featureState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature'\r\n )?.IsEnabled || false;\r\n }\r\n\r\n if (!isQuantityLimitsFeatureEnabledInHq) {\r\n return false;\r\n }\r\n\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\r\n return Promise.resolve(true);\r\n }\r\n\r\n return getCustomer(new GetCustomerInput(ctx.requestContext.apiSettings), ctx)\r\n .then(customerInfo => {\r\n return (\r\n !!customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b))\r\n );\r\n })\r\n .catch((error: Error) => {\r\n ctx.telemetry.warning(error.message);\r\n ctx.telemetry.debug('Unable to get customer info');\r\n return false;\r\n });\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport { ProductDeliveryOptions, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ActiveCartProductsInput,\r\n // @ts-expect-error\r\n getAvailabilitiesForCartLineItems,\r\n // @ts-expect-error\r\n getDeliveryOptionsForCartLineItems,\r\n IProductInventoryInformation,\r\n // @ts-expect-error\r\n ProductAvailabilitiesForCartLineItems,\r\n // @ts-expect-error\r\n ProductDeliveryOptionsForCartLineItems\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getActiveCartProductsAction } from './get-products-in-active-cart';\r\n\r\n/**\r\n * IMiniCartData entity interface.\r\n */\r\nexport interface IMiniCartData {\r\n products?: SimpleProduct[];\r\n productAvailabilites?: IProductInventoryInformation[];\r\n deliveryOptions?: ProductDeliveryOptions[];\r\n}\r\n\r\nexport const createInput = () => {\r\n return new ActiveCartProductsInput();\r\n};\r\n\r\n/**\r\n * Calls the Retail API and returns a mini cart data.\r\n * @param ctx\r\n * @param cartState\r\n */\r\nexport async function getMiniCartData(ctx: IActionContext, cartState: ICartState): Promise {\r\n const miniCartData: IMiniCartData = {};\r\n\r\n const cart = cartState.cart;\r\n\r\n // If there are cart lines, make call to get products\r\n // If there are invocie linese, then there is no products, so don't make call to get products\r\n if (cart && cart.CartLines && cart.CartLines.length > 0 && !cartState.hasInvoiceLine) {\r\n const productsPromise = getActiveCartProductsAction(new ActiveCartProductsInput(), ctx);\r\n const availabilityPromise = Promise.resolve(undefined); // getAvailabilitiesForCartLineItems(new ProductAvailabilitiesForCartLineItems(ctx.requestContext.apiSettings), ctx);\r\n const deliveryOptionsPromise = Promise.resolve(undefined); // getDeliveryOptionsForCartLineItems(new ProductDeliveryOptionsForCartLineItems(ctx.requestContext.apiSettings), ctx);\r\n\r\n await Promise.all([productsPromise, availabilityPromise, deliveryOptionsPromise])\r\n .then(([products, availability, deliveryOptions]) => {\r\n if (products) {\r\n miniCartData.products = products;\r\n }\r\n if (availability) {\r\n miniCartData.productAvailabilites = availability;\r\n }\r\n if (deliveryOptions) {\r\n miniCartData.deliveryOptions = deliveryOptions;\r\n }\r\n return miniCartData;\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n throw new Error('[getActiveCartWithProdcuts]Unable to hydrate cart with product information');\r\n });\r\n }\r\n\r\n return miniCartData;\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { AddToCartBehavior } from '@msdyn365-commerce/components';\r\nimport { getUrlSync, IDictionary, IImageSettings, msdyn365Commerce, TelemetryEvent } from '@msdyn365-commerce/core';\r\nimport {\r\n CartLine,\r\n ChannelDeliveryOptionConfiguration,\r\n CartLineValidationResultsByLineId,\r\n OrgUnitLocation\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { validateCartAsync } from '@msdyn365-commerce-modules/cart-utilities';\r\nimport { ArrayExtensions, validateCartLinesInventory } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n Button,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n getTelemetryObject,\r\n INodeProps,\r\n ITelemetryContent,\r\n TelemetryConstant,\r\n UncontrolledTooltip,\r\n updateMaxQuantityForCartLineItem,\r\n urlCheck\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport { reaction } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport React from 'react';\r\n\r\nimport { IVinhusetCartIconData } from './vinhuset-cart-icon.data';\r\nimport { cartLinesSortOrder, IVinhusetCartIconProps } from './vinhuset-cart-icon.props.autogenerated';\r\nimport { FlyoutCartLineItems, IFlyoutCartLineItemViewProps } from './components/flyout-cart-line-items';\r\nimport { getMiniCartData, IMiniCartData } from './utils/get-products-in-mini-cart';\r\nimport CartIconComponent from '../../themes/vinhuset-adventureworks/views/components/carticon.component';\r\n\r\nexport interface IMiniCartState {\r\n miniCartData: IMiniCartData;\r\n orgUnitLocations?: OrgUnitLocation[];\r\n isQuantityLimitsFeatureEnabled: boolean;\r\n isCartValid: boolean;\r\n}\r\n\r\nexport interface ICartIconViewProps extends IVinhusetCartIconProps {\r\n className: string;\r\n telemetryContent?: ITelemetryContent;\r\n cartIcon: React.ReactNode;\r\n FlyoutContainer?: INodeProps;\r\n CartlinesWrapper: INodeProps;\r\n miniCartWrapper: INodeProps;\r\n miniCartItemWrapper: INodeProps;\r\n cartlines?: IFlyoutCartLineItemViewProps[];\r\n flyoutTitle: React.ReactNode;\r\n totalPrice: React.ReactNode;\r\n checkoutAsGuestButton?: React.ReactNode;\r\n checkoutAsSignInUserButton?: React.ReactNode;\r\n goToCartButton?: React.ReactNode;\r\n waitingComponent?: React.ReactNode;\r\n isCartLoading: boolean;\r\n checkoutBlockedDueToUnavailableFunds?: React.ReactNode;\r\n\r\n removeItemClickHandler(cartlineToRemove: CartLine): void;\r\n}\r\n\r\n/**\r\n *\r\n * Cart component.\r\n * @extends {React.PureComponent>}\r\n */\r\n@observer\r\nclass CartIcon extends React.Component, IMiniCartState> {\r\n private readonly telemetryContent: ITelemetryContent;\r\n\r\n private readonly checkoutBySignInAttributes: IDictionary | undefined;\r\n\r\n private readonly checkoutByGuestAttributes: IDictionary | undefined;\r\n\r\n private readonly viewShoppingBagAttributes: IDictionary | undefined;\r\n\r\n private retailMultiplePickUpOptionEnabled?: boolean = false;\r\n\r\n private channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n\r\n private lastValidatedCartVersion: number | undefined;\r\n\r\n constructor(props: IVinhusetCartIconProps) {\r\n super(props);\r\n this.state = {\r\n miniCartData: {},\r\n isCartValid: true,\r\n isQuantityLimitsFeatureEnabled: false\r\n };\r\n this.telemetryContent = getTelemetryObject(\r\n this.props.context.request.telemetryPageName!,\r\n this.props.friendlyName,\r\n this.props.telemetry\r\n );\r\n const payload = getPayloadObject(TelemetryEvent.CheckOut, this.telemetryContent, TelemetryConstant.Checkout);\r\n this.checkoutBySignInAttributes = getTelemetryAttributes(this.telemetryContent, payload);\r\n\r\n payload.contentAction.etext = TelemetryConstant.GuestCheckout;\r\n this.checkoutByGuestAttributes = getTelemetryAttributes(this.telemetryContent, payload);\r\n\r\n payload.contentAction.etext = TelemetryConstant.ViewShoppingBag;\r\n this.viewShoppingBagAttributes = getTelemetryAttributes(this.telemetryContent, payload);\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n const context = this.props.context.actionContext;\r\n\r\n reaction(\r\n () => this.props.data.cart.result?.cart.CartLines,\r\n async () => {\r\n this.setState({\r\n miniCartData: await getMiniCartData(context, this.props.data.cart.result!)\r\n });\r\n }\r\n );\r\n await this._setQuantityLimitsFeatureFlag();\r\n\r\n this.setState({\r\n orgUnitLocations: this.props.data.orgUnitLocations?.result\r\n });\r\n\r\n this._validateCart();\r\n }\r\n\r\n public componentDidUpdate(prevProps: IVinhusetCartIconProps): void {\r\n this._validateCart();\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: IVinhusetCartIconProps, nextState: IMiniCartState): boolean {\r\n if (this.state === nextState && this.props.data === nextProps.data) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n // eslint-disable-next-line complexity -- disabling the complexity for this method for now as its causing lot of other warnings\r\n public render(): JSX.Element | null {\r\n const {\r\n id,\r\n typeName,\r\n config: { enableHoverCart, isAnonymousCheckout },\r\n context: {\r\n request: {\r\n user: { isAuthenticated, signInUrl }\r\n }\r\n },\r\n context,\r\n resources\r\n } = this.props;\r\n\r\n const cart = (this.props.data.cart && this.props.data.cart.result) || undefined;\r\n const guestCheckoutUrl = getUrlSync('checkout', this.props.context.actionContext) || '';\r\n const cartUrl = getUrlSync('cart', this.props.context.actionContext) || '';\r\n const checkoutURL = this._getCheckoutURL(isAuthenticated, guestCheckoutUrl, signInUrl || '');\r\n const isCartEmpty = cart && cart.cart.CartLines && cart.cart.CartLines.length === 0;\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- check config.\r\n const shouldShowMiniCart =\r\n cart?.isProductAddedToCart && this.props.context.app.config.addToCartBehavior === AddToCartBehavior.showMiniCart;\r\n const hasInvoiceLine = cart?.hasInvoiceLine;\r\n const emailDeliveryModeCode = this.props.context.request.channel?.EmailDeliveryModeCode;\r\n const cartLines = this._getCartLines();\r\n const validInventoryAcrossCartLines = validateCartLinesInventory(\r\n cart?.cart.CartLines ?? [],\r\n this.state.miniCartData.productAvailabilites ?? [],\r\n this.props.context.actionContext,\r\n this.state.miniCartData.products ?? [],\r\n emailDeliveryModeCode\r\n );\r\n const hasError =\r\n !validInventoryAcrossCartLines?.isValid ||\r\n (!validInventoryAcrossCartLines && !this.state.isCartValid) ||\r\n (cartLines ? cartLines.some(cartline => cartline.hasError) : false);\r\n const includeFlyout = this.props.data.cart && this.props.data.cart.status === 'SUCCESS' && enableHoverCart;\r\n const totalItemsInCart = cart?.totalItemsInCart ? cart.totalItemsInCart : 0;\r\n const goToCartButtonText = resources.goToCartButtonTitle.replace('{count}', totalItemsInCart.toString());\r\n const flyoutTitle = resources.flyoutTitle;\r\n const flyoutTooltip = {\r\n tag: UncontrolledTooltip,\r\n shouldShowMiniCart,\r\n placement: 'bottom-end',\r\n hideArrow: true,\r\n className: 'ms-cart-icon__flyout-container',\r\n trigger: 'hover',\r\n displayMode: 'FLYOUT',\r\n target: id,\r\n shouldShowCloseButton: true,\r\n cartPageUrl: cartUrl,\r\n hideAriaHidden: true\r\n };\r\n\r\n // If there are invoice lines, don't update mini cart price\r\n const price = (cart && !cart.hasInvoiceLine && cart.cart.TotalAmount) || undefined;\r\n const priceString = price\r\n ? resources.totalPriceFormatString.replace('{price}', context.cultureFormatter.formatCurrency(price))\r\n : '';\r\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n this.channelDeliveryOptionConfig = this.props.data.channelDeliveryOptionConfig?.result;\r\n this.retailMultiplePickUpOptionEnabled = this.props.data.featureState?.result?.find(\r\n feature => feature.Name === multiplePickupStoreSwitchName\r\n )?.IsEnabled;\r\n\r\n const viewProps = {\r\n ...this.props,\r\n cartIcon: (\r\n \r\n ),\r\n cartlines: cartLines,\r\n FlyoutContainer: includeFlyout ? flyoutTooltip : undefined,\r\n CartlinesWrapper: {\r\n className: 'ms-cart-icon__cart-lines'\r\n },\r\n miniCartWrapper: {\r\n className: classnames('ms-cart-icon'),\r\n id: this.props.id\r\n },\r\n miniCartItemWrapper: {\r\n className: classnames('msc-cart-lines-item')\r\n },\r\n\r\n // If there are invoice lines, don't update mini cart checkout button\r\n // Checkout button will display by default to maintain backward compatibility. When Anonymous user checkout is enabled &&\r\n // user is authenticated then we will show the checkout button otherwise we will show the guest checkout button.\r\n checkoutAsSignInUserButton:\r\n !isCartEmpty && !hasInvoiceLine && (!isAnonymousCheckout || isAuthenticated) ? (\r\n \r\n {resources.checkoutButtonTitle}\r\n \r\n ) : null,\r\n checkoutAsGuestButton:\r\n isAnonymousCheckout && !isCartEmpty && !isAuthenticated ? (\r\n \r\n {resources.guestCheckoutButtonTitle}\r\n \r\n ) : null,\r\n goToCartButton: (\r\n \r\n {goToCartButtonText}\r\n \r\n ),\r\n checkoutBlockedDueToUnavailableFunds: null,\r\n flyoutTitle: {flyoutTitle},\r\n totalPrice:
{priceString}
\r\n };\r\n\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n private _validateCart(): void {\r\n const {\r\n data: { cart }\r\n } = this.props;\r\n const cartVersion = cart.result?.cart?.Version ?? undefined;\r\n if (this.lastValidatedCartVersion === cartVersion) {\r\n return;\r\n }\r\n\r\n this.lastValidatedCartVersion = cartVersion; // This field is populated to block concurrent requests\r\n\r\n if (this.state.isQuantityLimitsFeatureEnabled) {\r\n validateCartAsync(cart, this.props.telemetry, this.props.context)\r\n .then((result: CartLineValidationResultsByLineId | undefined) => {\r\n this.setState({ isCartValid: !ArrayExtensions.hasElements(result?.ValidationResultsPairs) });\r\n })\r\n .catch(() => {\r\n this.setState({ isCartValid: false });\r\n });\r\n } else {\r\n this.setState({ isCartValid: true });\r\n }\r\n }\r\n\r\n private _getCheckoutURL(isAuthenticated: boolean, guestCheckoutUrl: string, signInUrl: string): string {\r\n if (isAuthenticated) {\r\n return guestCheckoutUrl;\r\n }\r\n\r\n const isAbsoluteUrl = urlCheck(guestCheckoutUrl);\r\n let returnURL = guestCheckoutUrl;\r\n if (msdyn365Commerce.isBrowser && !isAbsoluteUrl) {\r\n returnURL = `${window.location.origin}${guestCheckoutUrl}`;\r\n }\r\n\r\n return `${signInUrl}${!signInUrl.includes('?') ? '?' : '&'}ru=${returnURL}`;\r\n }\r\n\r\n /**\r\n * Sort cartline items.\r\n * @param cartlines - Cartlines to be sorted.\r\n * @param sortOrder - Ascending or descending.\r\n * @returns - Sorted cartlines.\r\n */\r\n private readonly getSortedCartLines = (cartlines: CartLine[], sortOrder?: cartLinesSortOrder): CartLine[] => {\r\n const lines: CartLine[] = [...cartlines];\r\n const zero: number = 0;\r\n\r\n if (sortOrder === cartLinesSortOrder.descending) {\r\n return lines.sort((item1, item2) => (item2.LineNumber ?? zero) - (item1.LineNumber ?? zero));\r\n }\r\n return lines.sort((item1, item2) => (item1.LineNumber ?? zero) - (item2.LineNumber ?? zero));\r\n };\r\n\r\n private _getCartLines(): IFlyoutCartLineItemViewProps[] | null {\r\n const {\r\n context: {\r\n request: { channel: { PickupDeliveryModeCode } = { PickupDeliveryModeCode: undefined } }\r\n },\r\n config,\r\n telemetry,\r\n resources\r\n } = this.props;\r\n\r\n const imageSettings = this._getImageSettings(config.imageSettings);\r\n const cart = this.props.data.cart && this.props.data.cart.result;\r\n\r\n // Cart-icon could be placed in each page\r\n // so we check cart content to reduce number of RS calls\r\n return this.state.miniCartData.products && cart && cart.cart.CartLines && cart.cart.CartLines.length > 0\r\n ? FlyoutCartLineItems({\r\n cartlines: this.getSortedCartLines(cart.cart.CartLines, config.cartLinesSortOrder),\r\n products: this.state.miniCartData.products,\r\n productAvailabilites: this.state.miniCartData.productAvailabilites,\r\n productDeliveryOptions: this.state.miniCartData.deliveryOptions,\r\n imageSettings,\r\n outOfStockThreshold: this.props.context.app.config.outOfStockThreshold || 0,\r\n isStockCheckEnabled: this.props.context.app.config.enableStockCheck || false,\r\n maxCartlineQuantity: updateMaxQuantityForCartLineItem(this.props.context.app.config.maxQuantityForCartLineItem),\r\n gridSettings: this.props.context.request.gridSettings!,\r\n context: this.props.context,\r\n typeName: this.props.typeName,\r\n id: this.props.id,\r\n resources: {\r\n sizeString: resources.productDimensionTypeSize,\r\n colorString: resources.productDimensionTypeColor,\r\n configString: resources.productDimensionTypeConfiguration,\r\n styleString: resources.productDimensionTypeStyle,\r\n quantityDisplayString: resources.quantityDisplayText,\r\n salesAgreementPricePrompt: resources.salesAgreementPricePrompt,\r\n inputQuantityAriaLabel: '', // Not used\r\n discountStringText: '', // Not used\r\n originalPriceText: '',\r\n currentPriceText: '',\r\n shippingChargesText: '',\r\n shippingText: resources.shippingText\r\n },\r\n telemetry,\r\n removeButtonText: resources.removeCartButtonText,\r\n outOfStockText: '', // Not used\r\n outOfRangeOneText: '', // Not used\r\n outOfRangeFormatText: '', // Not used\r\n cartState: cart,\r\n orgUnitLocations: this.state.orgUnitLocations,\r\n removeItemClickHandler: this._removeItemFromCartHandler,\r\n pickupDeliveryModeCode: PickupDeliveryModeCode,\r\n telemetryContent: this.telemetryContent,\r\n channelDeliveryOptionConfig: this.retailMultiplePickUpOptionEnabled ? this.channelDeliveryOptionConfig : undefined,\r\n isQuantityLimitsFeatureEnabled: this.state.isQuantityLimitsFeatureEnabled,\r\n catalogs: this.props.data.catalogs?.result\r\n })\r\n : null;\r\n }\r\n\r\n private readonly _getImageSettings = (imageSettings: IImageSettings | undefined): IImageSettings => {\r\n return (\r\n imageSettings || {\r\n viewports: {\r\n xs: { q: 'w=80&h=94&m=6', w: 0, h: 0 },\r\n sm: { q: 'w=148&h=174&m=6', w: 0, h: 0 },\r\n lg: { q: 'w=148&h=174&m=6', w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n }\r\n );\r\n };\r\n\r\n private readonly _removeItemFromCartHandler = (cartlineToRemove: CartLine) => {\r\n if (this.props.data.cart.result) {\r\n const input = {\r\n cartLineIds: [cartlineToRemove.LineId!.toString()]\r\n };\r\n this.props.data.cart.result.removeCartLines(input).catch(error => {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to Remove Cart Line');\r\n });\r\n }\r\n };\r\n\r\n private async _setQuantityLimitsFeatureFlag(): Promise {\r\n const featureStatuses = await this.props.data.featureState;\r\n\r\n const isChannelQuantityLimitsFeatureEnabledInHq =\r\n featureStatuses?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.EcommerceQuantityLimitConfigurationsFeature'\r\n )?.IsEnabled || false;\r\n if (isChannelQuantityLimitsFeatureEnabledInHq) {\r\n this.setState({ isQuantityLimitsFeatureEnabled: true });\r\n return;\r\n }\r\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\r\n if (!defaultOrderQuantityLimitsFeatureConfig || defaultOrderQuantityLimitsFeatureConfig === 'none') {\r\n this.setState({ isQuantityLimitsFeatureEnabled: false });\r\n return;\r\n }\r\n\r\n try {\r\n const featureStatuses = await this.props.data.featureState;\r\n const isQuantityLimitsFeatureEnabledInHq =\r\n featureStatuses?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature'\r\n )?.IsEnabled || false;\r\n if (!isQuantityLimitsFeatureEnabledInHq) {\r\n this.setState({ isQuantityLimitsFeatureEnabled: false });\r\n return;\r\n }\r\n } catch (error) {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to get feature states');\r\n this.setState({ isQuantityLimitsFeatureEnabled: false });\r\n return;\r\n }\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\r\n this.setState({ isQuantityLimitsFeatureEnabled: true });\r\n } else {\r\n this.props.data.customerInformation\r\n .then(customerInfo => {\r\n const result =\r\n !!customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b));\r\n this.setState({ isQuantityLimitsFeatureEnabled: result });\r\n })\r\n .catch(error => {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to get customer info');\r\n });\r\n }\r\n }\r\n}\r\n\r\nexport default CartIcon;\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 { Button, Node, KeyCodes, onTelemetryClick, getPayloadObject, INodeProps, Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\r\nimport { AddToCartBehavior } from '@msdyn365-commerce/components';\r\nimport * as React from 'react';\r\nimport classnames from 'classnames';\r\n\r\nimport { ICartIconViewProps } from './vinhuset-cart-icon';\r\nimport { IFlyoutCartLineItemViewProps } from './components/flyout-cart-line-items';\r\nimport CartLineItemComponent from '../../themes/vinhuset-adventureworks/views/components/cartlineitem.component';\r\nimport CartIconComponent from '../../themes/vinhuset-adventureworks/views/components/carticon.component';\r\nimport { _mergeDuplicateCartlines } from '../../shared-utils/cart-utils';\r\n\r\nconst renderCartlines = (cartLines: IFlyoutCartLineItemViewProps[] | undefined, props: ICartIconViewProps): JSX.Element[] | null => {\r\n if (!cartLines) {\r\n props.context.telemetry.error('Cartlines content is empty, module wont render');\r\n return null;\r\n }\r\n\r\n return cartLines.map((cartLine, index) => {\r\n const cartLineIndex = index;\r\n\r\n // Component override stopped working in mini-cart after 9.48, force it here\r\n const cartLineProps = (cartLine.cartline as React.ReactElement).props;\r\n const cartLineComp = ;\r\n\r\n return (\r\n \r\n \r\n {cartLineComp}\r\n {/* {cartLine.cartline} */}\r\n \r\n {cartLine.storeLocation}\r\n {cartLine.remove}\r\n \r\n );\r\n });\r\n};\r\n\r\nconst renderTotalPrice = (props: ICartIconViewProps): JSX.Element | null => {\r\n const cart = props.data.cart.result ?? undefined;\r\n // Calculate total price from cart lines instead of cart object\r\n const sumPrice = props.data.cart.result?.cart.CartLines\r\n ?.map(x => (x.NetAmountWithoutTax || (x.Price! * (x.Quantity || 1))))\r\n .reduce((sum, price) => sum + price, 0);\r\n const sumPriceFormatString = sumPrice\r\n ? props.context.cultureFormatter.formatCurrency(sumPrice)\r\n : props.context.cultureFormatter.formatCurrency(props.resources.emptyPrice);\r\n\r\n return cart && !cart.hasInvoiceLine ? (\r\n
\r\n \r\n {props.resources.totalPriceFormatString}\r\n {sumPriceFormatString}\r\n \r\n
\r\n ) : (\r\n <>\r\n );\r\n};\r\n\r\nconst getModalContainerProps = (isModalOpen: boolean, closeModal: () => void): INodeProps => {\r\n return {\r\n tag: Modal,\r\n placement: 'bottom-end',\r\n hideArrow: true,\r\n className: 'ms-cart-icon__minicartmodal-container',\r\n wrapClassName: 'ms-cart-icon__minicartmodal',\r\n isOpen: isModalOpen,\r\n toggle: closeModal\r\n };\r\n};\r\n\r\nconst CartIconView: React.FC = (props: ICartIconViewProps) => {\r\n const cartIconRef = React.useRef(null);\r\n const isAutoDisplayTriggered = React.useRef(false);\r\n const [isModalOpen, setIsModalOpen] = React.useState(false);\r\n const [filter, setFilter] = React.useState('');\r\n const [showEmptyCartConfirmation, setShowEmptyCartConfirmation] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n const escHandler = (event: KeyboardEvent) => {\r\n if (event.keyCode === KeyCodes.Escape) {\r\n if (showEmptyCartConfirmation) {\r\n setShowEmptyCartConfirmation(false);\r\n } else if (isModalOpen) {\r\n cartIconRef.current?.focus();\r\n setIsModalOpen(false);\r\n }\r\n }\r\n };\r\n\r\n window.addEventListener('keydown', escHandler, false);\r\n\r\n return () => {\r\n window.removeEventListener('keydown', escHandler, false);\r\n };\r\n }, [isModalOpen, setIsModalOpen, cartIconRef, showEmptyCartConfirmation, setShowEmptyCartConfirmation]);\r\n\r\n const cart = props.data.cart.result ?? undefined;\r\n const shouldShowMiniCart =\r\n cart?.isProductAddedToCart && props.context.app.config.addToCartBehavior === AddToCartBehavior.showMiniCart;\r\n\r\n if (shouldShowMiniCart) {\r\n if (!isAutoDisplayTriggered.current) {\r\n // First time trigger auto mini cart.\r\n setIsModalOpen(true);\r\n isAutoDisplayTriggered.current = true;\r\n } else if (!isModalOpen) {\r\n // If modal is closed, reset the flag.\r\n isAutoDisplayTriggered.current = false;\r\n }\r\n }\r\n\r\n const totalItemsInCart = React.useMemo(() => {\r\n return cart?.cart.CartLines ? _mergeDuplicateCartlines(cart.cart.CartLines).length : 0;\r\n }, [cart?.cart.CartLines]);\r\n const goToCartButtonText = props.resources.goToCartButtonTitle.replace('{count}', totalItemsInCart.toString());\r\n\r\n // @ts-expect-error\r\n const _openModal = React.useCallback(() => {\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, 'cart-icon', '');\r\n onTelemetryClick(props.telemetryContent!, payLoad, 'cart-icon');\r\n setIsModalOpen(true);\r\n }, [props.telemetryContent, setIsModalOpen]);\r\n\r\n const _closeModal = React.useCallback(() => {\r\n cartIconRef.current?.focus();\r\n setIsModalOpen(false);\r\n }, [cartIconRef, setIsModalOpen]);\r\n\r\n const doFilter = React.useCallback((cartLine: IFlyoutCartLineItemViewProps) => {\r\n if (!filter) {\r\n return true;\r\n }\r\n\r\n const product = cartLine.data.product;\r\n return product.Name?.toLocaleLowerCase().includes(filter.toLocaleLowerCase()) ||\r\n product.ItemId?.toLocaleLowerCase().includes(filter.toLocaleLowerCase());\r\n }, [filter]);\r\n\r\n return (\r\n \r\n {/* */}\r\n\r\n \r\n\r\n \r\n \r\n {props.flyoutTitle}\r\n {totalItemsInCart} {props.resources.items}\r\n \r\n \r\n \r\n )}\r\n \r\n {renderCartlines(props.cartlines?.filter(doFilter), props)}\r\n \r\n \r\n \r\n {props.slots.promoContentItem}\r\n {renderTotalPrice(props)}\r\n

{props.resources.subTotalMessage}

\r\n {/* Removed per Task 4253\r\n {props.checkoutAsSignInUserButton &&\r\n React.cloneElement(props.checkoutAsSignInUserButton as React.ReactElement,{disabled:hasError})} */}\r\n {props.checkoutAsGuestButton}\r\n {props.goToCartButton && React.cloneElement(props.goToCartButton as React.ReactElement, {\r\n 'children': goToCartButtonText\r\n })}\r\n {/* Removed per Task 5216 */}\r\n {/* \r\n {props.data.cart.result?.isEmpty ? (\r\n \r\n {props.resources.continueShoppingButtonTitle}\r\n \r\n ) : null}\r\n */}\r\n
\r\n
\r\n\r\n {showEmptyCartConfirmation && (\r\n setShowEmptyCartConfirmation(!showEmptyCartConfirmation)}\r\n fade={false}\r\n >\r\n \r\n
{props.resources.emptyCartButtonText}
\r\n
\r\n \r\n
{props.resources.emptyCartDescriptionText}
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n
\r\n );\r\n};\r\n\r\nexport default CartIconView;\r\n","import { format } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n IProductInventoryInformation\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\n\r\nfunction getWeekNumber(date: Date): number {\r\n // Copy the given date so that we don't modify the original\r\n const currentDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));\r\n\r\n // Set to the nearest Thursday: current date + 4 - current day number\r\n // Make Sunday's day number 7 (ISO 8601 standard)\r\n const dayNumber = (currentDate.getUTCDay() + 6) % 7;\r\n\r\n // Thursday of the current week\r\n currentDate.setUTCDate(currentDate.getUTCDate() - dayNumber + 3);\r\n\r\n // First Thursday of the year\r\n const firstThursday = new Date(Date.UTC(currentDate.getUTCFullYear(), 0, 4));\r\n\r\n // Adjust if the first week starts in the previous year\r\n if (firstThursday.getUTCDay() !== 4) {\r\n firstThursday.setUTCDate(firstThursday.getUTCDate() - ((firstThursday.getUTCDay() + 6) % 7));\r\n }\r\n\r\n // Calculate full weeks to nearest Thursday\r\n const weekNumber = Math.ceil(((currentDate.getTime() - firstThursday.getTime()) / 86400000 + 1) / 7);\r\n\r\n return weekNumber > 0 ? weekNumber : 1;\r\n}\r\n\r\nexport function formatString(template: string, ...values: any[]): string {\r\n if (!template) {\r\n return '';\r\n }\r\n return template.replace(/{(\\d+)}/g, (match, index) => {\r\n const valueIndex = parseInt(index, 10);\r\n return values[valueIndex] !== undefined ? values[valueIndex] : match;\r\n });\r\n}\r\n\r\nexport function addInventoryVisibilityInfo(\r\n labelToExpand: string,\r\n inventoryInformation: IProductInventoryInformation | undefined,\r\n expectedInventoryDateWithQuantityText: string | undefined,\r\n expectedInventoryDateText: string | undefined\r\n): string {\r\n const expectedInventoryDate = inventoryInformation?.ProductAvailableQuantity.ExtensionProperties\r\n ?.find(x => x.Key === 'ATPDATE')?.Value?.DateTimeOffsetValue;\r\n\r\n // Not using this value for now while we're investgating incorrect values\r\n // const expectedInventoryQuantity = inventoryInformation?.ProductAvailableQuantity.ExtensionProperties\r\n // ?.find(x => x.Key === 'ATPQTY')?.Value?.DecimalValue;\r\n\r\n const expectedInventoryQuantity = inventoryInformation?.ProductAvailableQuantity.AvailableQuantity;\r\n\r\n if (expectedInventoryDate) {\r\n /* const formattedDate = new Date(expectedInventoryDate).toLocaleDateString('nb-NO', {\r\n day: '2-digit',\r\n month: '2-digit'\r\n }); */\r\n const weekNumber = getWeekNumber(new Date(expectedInventoryDate));\r\n\r\n if (expectedInventoryQuantity) {\r\n const text = expectedInventoryDateWithQuantityText || '{0} forventet på lager i uke {1}';\r\n labelToExpand += `${labelToExpand ? '. ' : ''}${format(text, expectedInventoryQuantity, weekNumber)}`;\r\n } else {\r\n const text = expectedInventoryDateText || 'Forventet på lager i uke {0}';\r\n labelToExpand += `${labelToExpand ? '. ' : ''}${format(text, weekNumber)}`;\r\n }\r\n\r\n if (labelToExpand.endsWith('.')) {\r\n labelToExpand = labelToExpand.slice(0, -1);\r\n }\r\n }\r\n\r\n return labelToExpand;\r\n}\r\n","import { UnitOfMeasureConversion } from \"@msdyn365-commerce/retail-proxy\";\r\n\r\nexport function getMostRelevantConversion(conversions: UnitOfMeasureConversion[]): UnitOfMeasureConversion | undefined {\r\n // Accepted units, sorted by priority\r\n const acceptedToUnits = [\r\n 'stk',\r\n 'Stykk',\r\n 'Stk-BS',\r\n 'Kilogram',\r\n 'kg',\r\n 'Liter',\r\n '100_meter'\r\n ];\r\n\r\n for (const unit of acceptedToUnits) {\r\n const find = conversions?.find(conversion => conversion.ToUnitOfMeasureSymbol === unit);\r\n if (find) {\r\n return find;\r\n }\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\nexport function getKilogramConversion(defaultUnitOfMeasure: string | undefined, conversions: UnitOfMeasureConversion[]): UnitOfMeasureConversion | undefined {\r\n if (!defaultUnitOfMeasure) {\r\n return undefined;\r\n }\r\n\r\n const acceptedToUnits = [\r\n 'Kilogram',\r\n 'kg'\r\n ];\r\n return conversions?.find(conversion =>\r\n conversion.FromUnitOfMeasureSymbol === defaultUnitOfMeasure &&\r\n conversion.ToUnitOfMeasureSymbol && acceptedToUnits.includes(conversion.ToUnitOfMeasureSymbol));\r\n}\r\n\r\nexport function getPcsConversion(conversions: UnitOfMeasureConversion[]): UnitOfMeasureConversion | undefined {\r\n const acceptedFromUnits = [\r\n 'Krt-M1',\r\n 'Krt-BS'\r\n ];\r\n const acceptedToUnits = [\r\n 'stk',\r\n 'Stykk',\r\n 'Stk-BS',\r\n 'Pose-BS'\r\n ];\r\n\r\n return conversions?.find(conversion =>\r\n (conversion.FromUnitOfMeasureSymbol && acceptedFromUnits.includes(conversion.FromUnitOfMeasureSymbol)) &&\r\n (conversion.ToUnitOfMeasureSymbol && acceptedToUnits.includes(conversion.ToUnitOfMeasureSymbol)));\r\n}\r\n\r\nexport function getRoundedFactor(conversion: UnitOfMeasureConversion): number {\r\n // Only round if the conversion is kg/Kilogram\r\n if (conversion.Factor && (conversion.ToUnitOfMeasureSymbol === 'kg' || conversion.ToUnitOfMeasureSymbol === 'Kilogram')) {\r\n return Math.round((conversion.Factor + Number.EPSILON) * 100) / 100;\r\n } else {\r\n return conversion.Factor || 0;\r\n }\r\n}\r\n\r\nexport function getMinimumDecimals(unitOfMeasure: string | undefined): number {\r\n const units = [\r\n 'kg',\r\n 'Kilogram'\r\n ];\r\n return units.includes(unitOfMeasure || '') ? 2 : 0;\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 { IComponent, IComponentProps, msdyn365Commerce, getAsset, getUrlSync } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport { format, getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport classnames from 'classnames';\r\nimport { _mergeDuplicateCartlines } from '../../../../shared-utils/cart-utils';\r\n\r\n/**\r\n * ICartIconData: Interface for Cart Icon Data.\r\n */\r\nexport interface ICartIconData {\r\n cart?: ICartState;\r\n}\r\n\r\n/**\r\n * ICartIconComponentProps: Interface for Cart Icon component props.\r\n */\r\nexport interface ICartIconComponentProps extends IComponentProps {\r\n className?: string;\r\n cartLabel: string;\r\n cartTooltipLabel: string;\r\n cartQtyLabel: string;\r\n telemetryContent?: ITelemetryContent;\r\n salesAgreementPricePrompt?: string;\r\n}\r\n\r\n/**\r\n * ICartIconComponent: Interface for Cart Icon component.\r\n */\r\nexport interface ICartIconComponent extends IComponent {}\r\n\r\nconst CartIconComponentActions = {};\r\n\r\n/**\r\n *\r\n * CartIcon component.\r\n * @extends {React.FC}\r\n */\r\nconst CartIcon: React.FC = (props: ICartIconComponentProps) => {\r\n const {\r\n cartLabel,\r\n cartTooltipLabel,\r\n cartQtyLabel,\r\n data: { cart }\r\n } = props;\r\n\r\n const cartItemsCount = React.useMemo(() => {\r\n return cart?.cart.CartLines ? _mergeDuplicateCartlines(cart.cart.CartLines).length : 0;\r\n }, [cart?.cart.CartLines]);\r\n const qtyLabel = format(cartQtyLabel, cartItemsCount);\r\n const label = format(cartLabel, cartItemsCount);\r\n const tooltip = format(cartTooltipLabel, cartItemsCount);\r\n\r\n // Construct telemetry attribute to render\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, 'cart-icon', '');\r\n const attributes = getTelemetryAttributes(props.telemetryContent!, payLoad);\r\n const style: React.CSSProperties = {\r\n visibility: cart ? 'visible' : 'hidden'\r\n };\r\n return (\r\n \r\n \r\n {label}\r\n
\r\n {qtyLabel}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport const CartIconComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride<\r\n // @ts-expect-error -- Compatible issue with the component override.\r\n ICartIconComponent\r\n>('CartIcon', { component: CartIcon, ...CartIconComponentActions });\r\n\r\nexport default CartIconComponent;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport { DiscountLine, PriceLine, ProductPrice, ProductType, SalesAgreementPriceLine, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { Button, Collapse, format, ICollapseProps } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\nimport { ProductPriceExt } from '../../../../shared-utils/types';\r\n\r\nconst defaultPrice: number = 0;\r\nconst freePrice: number = 0;\r\n\r\n/**\r\n * Interface for price component resources.\r\n * @param {string} priceRangeSeparator - The price range separator.\r\n */\r\nexport interface IPriceComponentResources {\r\n priceRangeSeparator?: string;\r\n salesAgreementPricePrompt?: string;\r\n salesAgreementExpirationDatePrompt?: string;\r\n salesAgreementCommittedQuantityPrompt?: string;\r\n salesAgreementRemainingQuantityPrompt?: string;\r\n}\r\n\r\n/**\r\n * Interface for price component props.\r\n * @param {boolean} isPriceMinMaxEnabled - Whether the price range feature is enabled or not.\r\n * @param {IPriceComponentResources} priceResources - The price range resources.\r\n */\r\nexport interface IPriceComponentProps extends IComponentProps<{ price: ProductPrice }> {\r\n className?: string;\r\n product?: SimpleProduct;\r\n savingsText?: string;\r\n freePriceText?: string;\r\n originalPriceText?: string;\r\n currentPriceText?: string;\r\n isPriceMinMaxEnabled?: boolean;\r\n isSalesAgreementPriceFeatureEnabled?: boolean;\r\n useLegacySalesAgreementHTMLFeature?: boolean;\r\n salesAgreementLineId?: number;\r\n priceResources?: IPriceComponentResources;\r\n salesAgreementDetailCollapseProps?: ICollapseProps;\r\n currencyCode?: string;\r\n salesAgreementDetailOnClick?(event: React.MouseEvent | React.KeyboardEvent): void;\r\n discountPercentageSide?: 'left' | 'right';\r\n hideBeforePrice?: boolean;\r\n}\r\n\r\n/**\r\n * The interface of price component.\r\n */\r\nexport interface IPriceComponent extends IComponent {}\r\n\r\nconst priceComponentActions = {};\r\n\r\n/**\r\n * Get the original price from price component props.\r\n * @param props - The IPriceComponentProps.\r\n * @returns The original price.\r\n */\r\nexport const getOriginalPrice = (price: ProductPrice): number => {\r\n let originalPrice = Math.max(\r\n price.TradeAgreementPrice || defaultPrice,\r\n price.AdjustedPrice || defaultPrice\r\n ) || price.BasePrice || defaultPrice;\r\n\r\n // Go through each discount line and apply discounts without \"Show\" in it\r\n getBaseDiscountLines(price.DiscountLines).forEach(discount => {\r\n originalPrice -= discount.EffectiveAmount ?? 0;\r\n });\r\n\r\n return originalPrice;\r\n};\r\n\r\nexport const getDiscountLines = (discountLines: DiscountLine[] | undefined) => {\r\n if (!discountLines || discountLines.length === 0) {\r\n return [];\r\n }\r\n\r\n // Go through each discount line and find lines with Show in it\r\n const discounts = discountLines.filter(x => {\r\n const matches = x.OfferName?.toLowerCase().match(/\\{(.*?)\\}/i) || '';\r\n const parts = matches.length > 1 ? matches[1].split(';').map(x => x.trim()) : undefined;\r\n return parts && parts.includes('show');\r\n });\r\n\r\n return discounts;\r\n};\r\n\r\nexport const getBaseDiscountLines = (discountLines: DiscountLine[] | undefined) => {\r\n if (!discountLines || discountLines.length === 0) {\r\n return [];\r\n }\r\n\r\n // Go through each discount line and apply discounts without \"Show\" in it\r\n const baseDiscounts = discountLines.filter(x => {\r\n const matches = x.OfferName?.toLowerCase().match(/\\{(.*?)\\}/i) || '';\r\n const parts = matches.length > 1 ? matches[1].split(';').map(x => x.trim()) : undefined;\r\n return !parts || parts.length === 0 || !parts.includes('show');\r\n });\r\n\r\n return baseDiscounts;\r\n};\r\n\r\nexport const getDiscountPercentage = (price: ProductPriceExt): number => {\r\n if (price.OverrideDiscountPercentage) {\r\n return price.OverrideDiscountPercentage;\r\n }\r\n\r\n if (!price.CustomerContextualPrice) {\r\n return 0;\r\n }\r\n\r\n const originalPrice = getOriginalPrice(price);\r\n const percentage = 1 - (price.CustomerContextualPrice / originalPrice);\r\n\r\n return Math.floor(percentage * 100);\r\n};\r\n\r\nconst getActivePrice = (props: IPriceComponentProps): number => {\r\n if (showPriceRangeForMasterProduct(props) && props.data.price.MinVariantPrice !== undefined) {\r\n return props.data.price.MinVariantPrice;\r\n }\r\n\r\n if (props.data.price.CustomerContextualPrice !== undefined) {\r\n return props.data.price.CustomerContextualPrice;\r\n }\r\n\r\n return getOriginalPrice(props.data.price);\r\n};\r\n\r\n/**\r\n * Get the formatted currency.\r\n * @param props - The props.\r\n * @param price - The price.\r\n * @param shouldUseFreePriceText - The shouldUseFreePriceText.\r\n * @returns The formatted currency.\r\n */\r\nconst formatCurrency = (\r\n props: IPriceComponentProps,\r\n price: number | undefined,\r\n shouldUseFreePriceText: boolean | undefined,\r\n currencyCode?: string | undefined\r\n): string => {\r\n if (price === undefined) {\r\n return '';\r\n }\r\n\r\n if (shouldUseFreePriceText && price === freePrice && props.freePriceText) {\r\n return props.freePriceText;\r\n }\r\n\r\n return props.context.cultureFormatter.formatCurrency(price, currencyCode);\r\n};\r\n\r\nconst showPriceRangeForMasterProduct = (props: IPriceComponentProps): boolean => {\r\n return (\r\n (props.isPriceMinMaxEnabled ?? false) &&\r\n (props.product?.ProductTypeValue === ProductType.Master || props.product?.ProductTypeValue === ProductType.KitMaster) &&\r\n props.data.price.MinVariantPrice !== undefined &&\r\n props.data.price.MaxVariantPrice !== undefined\r\n );\r\n};\r\n\r\n/**\r\n * ShowStrikethroughPricing.\r\n * @param props - The props.\r\n * @returns True if showStrikethroughPricing, false otherwise.\r\n */\r\nconst showStrikethroughPricing = (props: IPriceComponentProps): boolean => {\r\n const price = props.data.price as ProductPriceExt;\r\n const overrideDiscountPercentage = price.OverrideDiscountPercentage;\r\n\r\n if (!overrideDiscountPercentage && getDiscountLines(price.DiscountLines).length === 0) {\r\n return false;\r\n }\r\n\r\n if (overrideDiscountPercentage) {\r\n return overrideDiscountPercentage > 0;\r\n }\r\n\r\n const originalPrice = getOriginalPrice(price);\r\n\r\n if (originalPrice && price.CustomerContextualPrice) {\r\n const originalPriceFixed = parseFloat(originalPrice.toFixed(2));\r\n const customerContextualPriceFixed = parseFloat(price.CustomerContextualPrice.toFixed(2));\r\n return originalPriceFixed > customerContextualPriceFixed;\r\n }\r\n\r\n return false;\r\n};\r\n\r\n/**\r\n * Render current price.\r\n * @param props - The props.\r\n * @returns The JSX.Element.\r\n */\r\nconst renderCurrentPrice = (props: IPriceComponentProps): JSX.Element => {\r\n const maxVariantPrice: string = formatCurrency(props, props.data.price.MaxVariantPrice, false, props.currencyCode);\r\n const minVariantPrice: string = formatCurrency(props, props.data.price.MinVariantPrice, false, props.currencyCode);\r\n if (\r\n props.isPriceMinMaxEnabled &&\r\n props.data.price.MaxVariantPrice &&\r\n props.data.price.MinVariantPrice &&\r\n props.data.price.MaxVariantPrice > props.data.price.MinVariantPrice\r\n ) {\r\n return (\r\n \r\n \r\n {minVariantPrice}\r\n \r\n \r\n {props.priceResources?.priceRangeSeparator}\r\n \r\n \r\n {maxVariantPrice}\r\n \r\n \r\n );\r\n }\r\n\r\n return (\r\n \r\n {formatCurrency(props, getActivePrice(props), true, props.currencyCode)}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Render current price with original price.\r\n * @param props - The props.\r\n * @returns The JSX.Element.\r\n */\r\nconst renderCurrentPriceWithOriginalPrice = (props: IPriceComponentProps): JSX.Element => {\r\n const originalPrice: number = getOriginalPrice(props.data.price);\r\n const initialPrice: string = formatCurrency(props, originalPrice, true);\r\n const discountPercentage = getDiscountPercentage(props.data.price);\r\n\r\n return (\r\n <>\r\n \r\n {` `}\r\n {props.originalPriceText}\r\n {` `}\r\n {initialPrice}\r\n {` `}\r\n {props.currentPriceText}\r\n {` `}\r\n {renderCurrentPrice(props)}\r\n \r\n \r\n {discountPercentage > 0 && -{discountPercentage}%}\r\n {props.savingsText && {props.savingsText}}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * The state of sales agreement details.\r\n * @deprecated This will be removed with SalesAgreementPrice class soon.\r\n */\r\nexport interface ISalesAgreementDetailState {\r\n isOpen: boolean;\r\n}\r\n\r\n/**\r\n * The SalesAgreementPrice class.\r\n * @deprecated This implementation is deprecated. It will be removed soon. Please use the implementation in the Price function component.\r\n */\r\n// eslint-disable-next-line react/require-optimization -- Not needed.\r\nclass SalesAgreementPrice extends React.Component {\r\n public constructor(props: IPriceComponentProps) {\r\n super(props);\r\n this._toggle = this._toggle.bind(this);\r\n this.state = {\r\n isOpen: true\r\n } as ISalesAgreementDetailState;\r\n }\r\n\r\n public render(): React.ReactElement {\r\n const priceLines: PriceLine[] = this.props.data.price.AttainablePriceLines ?? [];\r\n const firstPriceLine: SalesAgreementPriceLine = priceLines[0] as SalesAgreementPriceLine;\r\n if (this.props.salesAgreementDetailCollapseProps) {\r\n this.props.salesAgreementDetailCollapseProps.isOpen = this.state.isOpen;\r\n }\r\n return (\r\n \r\n

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

\r\n \r\n {this.props.priceResources?.salesAgreementPricePrompt}\r\n

\r\n \r\n

\r\n \r\n {/* Available date */}\r\n {// eslint-disable-next-line prefer-template -- Copied from other class.\r\n ' · ' +\r\n format(\r\n this.props.priceResources?.salesAgreementExpirationDatePrompt ?? '',\r\n this.props.context.cultureFormatter.formatDate(firstPriceLine.EffectiveDate as Date),\r\n this.props.context.cultureFormatter.formatDate(firstPriceLine.ExpirationDate as Date)\r\n )}\r\n \r\n \r\n {/* Quantity commitment */}\r\n {// eslint-disable-next-line prefer-template -- Copied from other class.\r\n ' · ' +\r\n format(\r\n this.props.priceResources?.salesAgreementCommittedQuantityPrompt ?? '',\r\n firstPriceLine.CommittedQuantity\r\n )}\r\n \r\n \r\n {/* Remaining quantity to qualify */}\r\n {// eslint-disable-next-line prefer-template -- Copied from other class.\r\n ' · ' +\r\n format(\r\n this.props.priceResources?.salesAgreementRemainingQuantityPrompt ?? '',\r\n firstPriceLine.RemainingQuantity\r\n )}\r\n \r\n

\r\n
\r\n
\r\n );\r\n }\r\n\r\n /**\r\n * Callback which toggles collapse mode.\r\n * @param event - The mouse or keyboard event.\r\n */\r\n private _toggle(event: React.MouseEvent | React.KeyboardEvent): void {\r\n event.preventDefault();\r\n console.log(this.state.isOpen);\r\n // eslint-disable-next-line react/no-access-state-in-setstate -- Copied from other class.\r\n this.setState({ isOpen: !this.state.isOpen });\r\n console.log(this.state.isOpen);\r\n }\r\n}\r\n\r\nconst renderSalesAgreementDetail = (props: IPriceComponentProps): JSX.Element => {\r\n // In most cases there should be only one sales agreement line.\r\n // If there are more than one, only the first one will be shown.\r\n const firstPriceLine: SalesAgreementPriceLine = (props.data.price.AttainablePriceLines ?? [])[0] as SalesAgreementPriceLine;\r\n return (\r\n

\r\n

\r\n {/* Available date */}\r\n {// eslint-disable-next-line prefer-template -- Copied from other class.\r\n ' · ' +\r\n format(\r\n props.priceResources?.salesAgreementExpirationDatePrompt ?? '',\r\n props.context.cultureFormatter.formatDate(firstPriceLine.EffectiveDate as Date),\r\n props.context.cultureFormatter.formatDate(firstPriceLine.ExpirationDate as Date)\r\n )}\r\n

\r\n

\r\n {/* Quantity commitment */}\r\n {// eslint-disable-next-line prefer-template -- Copied from other class.\r\n ' · ' + format(props.priceResources?.salesAgreementCommittedQuantityPrompt ?? '', firstPriceLine.CommittedQuantity)}\r\n

\r\n

\r\n {/* Remaining quantity to qualify */}\r\n {// eslint-disable-next-line prefer-template -- Copied from other class.\r\n ' · ' + format(props.priceResources?.salesAgreementRemainingQuantityPrompt ?? '', firstPriceLine.RemainingQuantity)}\r\n

\r\n

\r\n );\r\n};\r\n\r\n/**\r\n * Price.\r\n * @param props - The props.\r\n * @returns The JSX.Element.\r\n */\r\nconst Price: React.FC = (props: IPriceComponentProps): JSX.Element | null => {\r\n // CustomerContextualPrice could be zero\r\n if (props.data.price.CustomerContextualPrice === undefined) {\r\n return null;\r\n }\r\n\r\n if (!props.context.request.user.isAuthenticated) {\r\n return null;\r\n }\r\n\r\n // Determine if contract price is avaiable/applied by:\r\n // isFeatureEnabled and SA price != 0, for PDP.\r\n // SA line id != 0, for cart line.\r\n if (props.isSalesAgreementPriceFeatureEnabled && props.data.price.SalesAgreementPrice !== 0) {\r\n if (props.useLegacySalesAgreementHTMLFeature) {\r\n const salesAgreementPrice = new SalesAgreementPrice(props);\r\n return {salesAgreementPrice.render()};\r\n } else {\r\n const [isExpanded, setIsExpanded] = React.useState(false);\r\n const toggle = () => {\r\n setIsExpanded(!isExpanded);\r\n };\r\n return (\r\n \r\n \r\n

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

\r\n \r\n {props.priceResources?.salesAgreementPricePrompt}\r\n \r\n {isExpanded && renderSalesAgreementDetail(props)}\r\n
\r\n
\r\n );\r\n }\r\n }\r\n\r\n const discountPercentageSide = props.discountPercentageSide ?? 'right';\r\n\r\n return (\r\n \r\n {showStrikethroughPricing(props) ? renderCurrentPriceWithOriginalPrice(props) : renderCurrentPrice(props)}\r\n {/* {renderCurrentPrice(props)} */}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * The PriceComponent.\r\n */\r\nexport const PriceComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride('Price', {\r\n component: Price,\r\n ...priceComponentActions\r\n});\r\n\r\n\r\nexport default PriceComponent;","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['vinhuset-cart-icon'] = {\n c: () => require('partner/modules/vinhuset-cart-icon/vinhuset-cart-icon.tsx'),\n $type: 'containerModule',\n da: [{name:'cart', path:'@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action', runOn: 0},{name:'catalogs', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs', runOn: 0},{name:'channelDeliveryOptionConfig', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration', runOn: 0},{name:'customerBalances', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer-balance', runOn: 0},{name:'customerInformation', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer', runOn: 0},{name:'featureState', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state', runOn: 0},{name:'orgUnitLocations', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/search-org-unit-locations', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'vinhuset-cart-icon',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/vinhuset-cart-icon'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer-balance';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer-balance');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/search-org-unit-locations';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/search-org-unit-locations');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action';\n let dataAction = require('@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|vinhuset-cart-icon|vinhuset-cart-icon'] = {\n c: () => require('partner/modules/vinhuset-cart-icon/vinhuset-cart-icon.view.tsx'),\n cn: '__local__-__local__-vinhuset-cart-icon'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["ProductInput","constructor","productId","apiSettings","channelId","warehouseId","requestContext","catalogId","getCacheKey","generateCacheKey","this","key","value","getCacheObjectType","dataCacheType","undefined","getCatalogId","createObservableDataAction","id","action","async","inputs","ctx","ArrayExtensions","hasElements","trace","productIdMapping","index","length","queryResultSettings","QueryResultSettingsProxy","getPagingFromInputDataOrDefaultValue","Paging","Top","getProductPromises","catalogIds","unique","map","input","_inputs$0$warehouseId","productInputs","filter","push","getByIdsAsync","callerContext","then","response","catch","error","telemetry","debug","mappedProducts","flatten","Promise","all","product","newImageUrl","generateProductImageUrl","PrimaryImageUrl","_unused","reduce","memo","RecordId","find","inputData","productIds","config","split","Array","isArray","isBatched","getImageSettings","size","w","h","getDiscountBadgeSize","viewports","xs","q","lg","xl","quality","props","badge","baseImageUrl","context","request","endsWith","slice","React","className","classnames","Image","src","gridSettings","imageSettings","loadFailureBehavior","cartLinesSortOrder","_renderDeliveryLocation","cartLine","deliverylocation","FulfillmentStoreId","_foundProductDelivery","orgUnitName","_getOrgUnitName","orgUnitLocations","foundProductDeliveryOption","productDeliveryOptions","deliveryOption","ProductId","delivery","DeliveryOptions","option","Code","DeliveryMode","location","Description","resources","shippingText","_renderStoreLocation","fulfillmentStoreId","foundLocation","orgUnitLocation","OrgUnitNumber","OrgUnitName","_assembleCartlines","cartlines","products","reactNodes","_mergeDuplicateCartlines","cartline","foundProductAvailability","_foundProductAvailabi","isQuantityLimitsFeatureEnabled","getProductByProductIdAndWarehouse","WarehouseId","cartState","getProductByProductId","productAvailabilites","productAvailability","_productAvailability$","ProductAvailableQuantity","_assembleNode","foundProductDeliveryOptions","_product$Behavior","typeName","removeButtonText","removeItemClickHandler","availableQuantityInStock","isStockCheckEnabled","outOfStockThreshold","AvailableQuantity","_getCartItemAvailableQuantity","maxQuantity","_getCartItemMaxQuantity","maxQuantityByConfig","maxByQuantityLimitsFeature","maxByQuantityLimitsFeatureResult","maxCartlineQuantity","Behavior","MaximumQuantity","isServiceItem","ItemTypeValue","ReleasedProductType","Service","onRemoveClickHandler","onRemoveClickFunction","payLoad","getPayloadObject","telemetryContent","TelemetryConstant","RemoveCartItem","removeCartItemAttribute","getTelemetryAttributes","productUrl","getProductUrlSync","actionContext","MsDyn365","isBrowser","isChannelTypeB2B","_cartline$CatalogId","fullUrl","URL","window","href","searchParams","set","CatalogId","data","hasError","Quantity","CartLineItemComponent","catalogs","currentQuantity","isOutOfStock","isQuantityEditable","primaryImageUrl","displayMode","channelDeliveryOptionConfig","deliveryLocation","remove","Button","Object","assign","onClick","title","storeLocation","ActiveCartProductsInput","getActiveCartProductsAction","Error","getCartState","cart","_ctx$requestContext$a","defaultOrderQuantityLimitsFeatureConfig","app","platform","enableDefaultOrderQuantityLimits","resolve","featureStates","getFeatureState","createGetFeatureStateInput","isQuantityLimitsFeatureEnabledInHq","_featureStates$find","featureState","Name","IsEnabled","getCustomer","GetCustomerInput","customerInfo","IsB2b","warning","message","isOrderQuantityLimitsFeatureEnabled","_cart$CartLines","productIdsByWarehouseId","Map","resultProducts","CartLines","forEach","_productIdsByWarehous","has","get","_ref","entryWarehouseId","entryProductIds","getSimpleProducts","Boolean","accum","getActiveCartProductsActionWhenQuantityLimitsFeatureIsOn","hasInvoiceLine","toString","getMiniCartData","miniCartData","productsPromise","availabilityPromise","deliveryOptionsPromise","availability","deliveryOptions","exception","CartIcon","super","retailMultiplePickUpOptionEnabled","getSortedCartLines","sortOrder","lines","descending","sort","item1","item2","_item2$LineNumber","_item1$LineNumber","LineNumber","_item1$LineNumber2","_item2$LineNumber2","_getImageSettings","sm","lazyload","_removeItemFromCartHandler","cartlineToRemove","result","cartLineIds","LineId","removeCartLines","state","isCartValid","getTelemetryObject","telemetryPageName","friendlyName","payload","TelemetryEvent","CheckOut","Checkout","checkoutBySignInAttributes","contentAction","etext","GuestCheckout","checkoutByGuestAttributes","ViewShoppingBag","viewShoppingBagAttributes","_this$props$data$orgU","reaction","_this$props$data$cart","setState","_setQuantityLimitsFeatureFlag","_validateCart","componentDidUpdate","prevProps","shouldComponentUpdate","nextProps","nextState","render","_this$props$context$r","_cart$cart$CartLines","_this$state$miniCartD","_this$state$miniCartD2","_this$props$data$chan","_this$props$data$feat","enableHoverCart","isAnonymousCheckout","user","isAuthenticated","signInUrl","guestCheckoutUrl","getUrlSync","cartUrl","checkoutURL","_getCheckoutURL","isCartEmpty","shouldShowMiniCart","isProductAddedToCart","addToCartBehavior","AddToCartBehavior","showMiniCart","emailDeliveryModeCode","channel","EmailDeliveryModeCode","cartLines","_getCartLines","validInventoryAcrossCartLines","validateCartLinesInventory","isValid","some","includeFlyout","status","totalItemsInCart","goToCartButtonText","goToCartButtonTitle","replace","flyoutTitle","flyoutTooltip","tag","UncontrolledTooltip","placement","hideArrow","trigger","target","shouldShowCloseButton","cartPageUrl","hideAriaHidden","price","TotalAmount","priceString","totalPriceFormatString","cultureFormatter","formatCurrency","feature","viewProps","_objectSpread","cartIcon","CartIconComponent","cartLabel","cartTooltipLabel","cartQtyLabel","FlyoutContainer","CartlinesWrapper","miniCartWrapper","miniCartItemWrapper","checkoutAsSignInUserButton","disabled","checkoutButtonTitle","checkoutAsGuestButton","guestCheckoutButtonTitle","goToCartButton","checkoutBlockedDueToUnavailableFunds","totalPrice","renderView","_cart$result$cart$Ver","_cart$result","cartVersion","Version","lastValidatedCartVersion","validateCartAsync","ValidationResultsPairs","isAbsoluteUrl","urlCheck","returnURL","msdyn365Commerce","origin","includes","_this$props$data$cata","PickupDeliveryModeCode","FlyoutCartLineItems","enableStockCheck","updateMaxQuantityForCartLineItem","maxQuantityForCartLineItem","sizeString","productDimensionTypeSize","colorString","productDimensionTypeColor","configString","productDimensionTypeConfiguration","styleString","productDimensionTypeStyle","quantityDisplayString","quantityDisplayText","salesAgreementPricePrompt","inputQuantityAriaLabel","discountStringText","originalPriceText","currentPriceText","shippingChargesText","removeCartButtonText","outOfStockText","outOfRangeOneText","outOfRangeFormatText","pickupDeliveryModeCode","_featureStatuses$find","_this$props$context","featureStatuses","_featureStatuses$find2","customerInformation","__decorate","observer","_props$data$cart$resu3","_props$cartlines","cartIconRef","isAutoDisplayTriggered","isModalOpen","setIsModalOpen","setFilter","showEmptyCartConfirmation","setShowEmptyCartConfirmation","escHandler","event","keyCode","KeyCodes","Escape","_cartIconRef$current","current","focus","addEventListener","removeEventListener","_closeModal","onTelemetryClick","_cartIconRef$current2","doFilter","_product$Name","_product$ItemId","toLocaleLowerCase","ItemId","Node","renderModuleAttributes","getModalContainerProps","closeModal","Modal","wrapClassName","isOpen","toggle","items","isEmpty","slots","emptyCart","type","placeholder","searchPlaceholderText","onChange","e","style","marginTop","textAlign","emptyCartButtonText","renderCartlines","cartLineIndex","cartLineProps","cartLineComp","promoContentItem","_props$data$cart$resu","_props$data$cart$resu2","sumPrice","x","NetAmountWithoutTax","Price","sum","sumPriceFormatString","emptyPrice","renderTotalPrice","subTotalMessage","modalClassName","backdropClassName","fade","ModalHeader","ModalBody","emptyCartDescriptionText","ModalFooter","emptyCartConfirmButtonText","emptyCartCancelButtonText","formatString","template","_len","arguments","values","_key","match","valueIndex","parseInt","addInventoryVisibilityInfo","labelToExpand","inventoryInformation","expectedInventoryDateWithQuantityText","expectedInventoryDateText","_inventoryInformation","expectedInventoryDate","ExtensionProperties","Key","Value","DateTimeOffsetValue","expectedInventoryQuantity","weekNumber","date","currentDate","Date","UTC","getFullYear","getMonth","getDate","dayNumber","getUTCDay","setUTCDate","getUTCDate","firstThursday","getUTCFullYear","Math","ceil","getTime","getWeekNumber","text","format","getMostRelevantConversion","conversions","acceptedToUnits","unit","conversion","ToUnitOfMeasureSymbol","getKilogramConversion","defaultUnitOfMeasure","FromUnitOfMeasureSymbol","getPcsConversion","acceptedFromUnits","getRoundedFactor","Factor","round","Number","EPSILON","getMinimumDecimals","unitOfMeasure","createComponentOverride","component","cartItemsCount","qtyLabel","label","tooltip","attributes","visibility","role","getAsset","getOriginalPrice","originalPrice","max","TradeAgreementPrice","AdjustedPrice","BasePrice","getBaseDiscountLines","DiscountLines","discount","_discount$EffectiveAm","EffectiveAmount","getDiscountLines","discountLines","_x$OfferName","matches","OfferName","toLowerCase","parts","trim","_x$OfferName2","getDiscountPercentage","OverrideDiscountPercentage","CustomerContextualPrice","percentage","floor","shouldUseFreePriceText","currencyCode","freePriceText","showPriceRangeForMasterProduct","_props$isPriceMinMaxE","_props$product","_props$product2","isPriceMinMaxEnabled","ProductTypeValue","ProductType","Master","KitMaster","MinVariantPrice","MaxVariantPrice","renderCurrentPrice","maxVariantPrice","minVariantPrice","_props$priceResources","itemProp","priceResources","priceRangeSeparator","getActivePrice","SalesAgreementPrice","_toggle","bind","_this$props$data$pric","_this$props$data$pric2","_this$props$priceReso","_this$props$priceReso2","_this$props$priceReso3","_this$props$priceReso4","_this$props$priceReso5","_this$props$priceReso6","_this$props$priceReso7","firstPriceLine","AttainablePriceLines","salesAgreementDetailCollapseProps","Collapse","salesAgreementExpirationDatePrompt","formatDate","EffectiveDate","ExpirationDate","salesAgreementCommittedQuantityPrompt","CommittedQuantity","salesAgreementRemainingQuantityPrompt","RemainingQuantity","preventDefault","console","log","PriceComponent","_props$discountPercen","isSalesAgreementPriceFeatureEnabled","useLegacySalesAgreementHTMLFeature","salesAgreementPrice","_props$data$price$Sal","_props$priceResources8","_props$priceResources9","isExpanded","setIsExpanded","tabIndex","_props$data$price$Att","_props$priceResources2","_props$priceResources3","_props$priceResources4","_props$priceResources5","_props$priceResources6","_props$priceResources7","renderSalesAgreementDetail","discountPercentageSide","overrideDiscountPercentage","parseFloat","toFixed","showStrikethroughPricing","initialPrice","discountPercentage","hideBeforePrice","savingsText","renderCurrentPriceWithOriginalPrice","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}