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Y,sBAAsBoE,GAA4B,EACxF9S,aAAcA,EACd5B,cAAeA,EACflH,GAAIA,EACJC,SAAUA,EACVgG,WAAYA,EACZlG,QAASA,EACToE,UAAWA,EACX3F,IAAK,GAAGiC,KAASwF,IACjBwE,oBAAoB,EACpB9B,gBAAiBhL,EAAQ6f,gBACzBtX,YAAY,UACZoB,iBAAkB/H,EAAM+H,iBACxBvE,4BAA6BxD,EAAMwD,4BACnC0a,iBAAkB9D,EAAwB3W,EAAUzD,KAG5Dme,OACInf,EAAAA,cAACqX,EAAAA,OAAMvM,OAAAC,OAAA,CACH5K,UAAU,6BACVif,QAASjB,EACTtT,MAAOgP,GACHyE,GAEHzE,GAGTwF,cAAepD,EAAqBxX,EAAUzD,KAgGtCkc,CACIzY,EACArF,EACA4B,EACAkB,EACwB,QADnBwa,EACLD,SAAwB,IAAAC,OAAA,EAAxBA,EAA0BM,8BAOnCR,IAvCHxb,EAAMQ,QAAQgN,UAAUD,MAAM,kDACvB,OA6CFsK,EAAuB7X,IAChC,MAAM,SAAEqN,EAAQ,UAAEiB,GAActO,EAChC,OAAOub,EAAmBjN,EAAWjB,EAAUrN","sources":["webpack://Msdyn365.Commerce.Online/./src/themes/dlvry-adventureworks/views/components/cartlineitem.component.tsx?1d54","webpack://Msdyn365.Commerce.Online/./src/modules/cart-icon/utils/get-products-in-mini-cart.ts?3c15","webpack://Msdyn365.Commerce.Online/./src/modules/cart-icon/cart-icon.tsx?4ae8","webpack://Msdyn365.Commerce.Online/./src/modules/cart-icon/components/flyout-cart-line-items.tsx?f2c4"],"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 { ICartLinePriceEditorResources } from '@msdyn365-commerce/components';\r\nimport { IComponentProps, IGridSettings, IImageSettings, Image, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport {\r\n CartLine,\r\n ChannelDeliveryOptionConfiguration,\r\n DiscountLine,\r\n DiscountLineType,\r\n ProductCatalog,\r\n ProductDimensionType,\r\n SalesLine,\r\n SimpleProduct,\r\n UnitOfMeasureConversion\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { ArrayExtensions, StringExtensions, getFallbackImageUrl, IProductInventoryInformation } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport classNames from 'classnames';\r\nimport * as React from 'react';\r\nimport { UnitOfMeasure } from '../../../../components/unit-of-measure';\r\nimport ProductListOrderQuantity from '../../../../components/common/product-list-order-quantity';\r\nimport { ProductError, ProductPriceExt, SimpleProductExt } from '../../../../shared-utils/types';\r\nimport DiscountBadge from '../../../../components/discount-badge/discount-badge';\r\nimport PriceComponent, { getDiscountLines, getDiscountPercentage, getOriginalPrice } from './price.component';\r\nimport { getTemperatureZoneIcon } from '../../../../shared-utils/attributes/get-temperature-zone';\r\n\r\n/**\r\n * ICartlineResourceString: Interface for specifying the\r\n * resource strings that the component needs.\r\n */\r\nexport interface ICartlineResourceString {\r\n /**\r\n * Display string for discount label.\r\n */\r\n discountStringText: string;\r\n\r\n /**\r\n * String for size key.\r\n */\r\n sizeString: string;\r\n\r\n /**\r\n * String for color key.\r\n */\r\n colorString: string;\r\n\r\n /**\r\n * String associated with the configuration product dimension.\r\n */\r\n configString: string;\r\n\r\n /**\r\n * String for style key.\r\n */\r\n styleString: string;\r\n\r\n /**\r\n * String for amount key.\r\n */\r\n amountString?: string;\r\n\r\n /**\r\n * Display string for quantity label.\r\n */\r\n quantityDisplayString: string;\r\n\r\n /**\r\n * Display string for quantity label.\r\n */\r\n inputQuantityAriaLabel: string;\r\n\r\n /**\r\n * Aria label for the decrement button in quantity component.\r\n */\r\n decrementButtonAriaLabel: string;\r\n\r\n /**\r\n * Aria label for the increment button in quantity component.\r\n */\r\n incrementButtonAriaLabel: string;\r\n\r\n /**\r\n * Original text screenreader.\r\n */\r\n originalPriceText: string;\r\n\r\n /**\r\n * Current text screenreader.\r\n */\r\n currentPriceText: string;\r\n\r\n /**\r\n * Shipping Charges Text.\r\n */\r\n shippingChargesText: string;\r\n\r\n /**\r\n * Price Editor Charges Text.\r\n */\r\n priceEditorResources?: ICartLinePriceEditorResources;\r\n\r\n /**\r\n * Sales agreement price prompt text.\r\n */\r\n salesAgreementPricePrompt?: string;\r\n\r\n /**\r\n * Shipping text.\r\n */\r\n shippingText?: string;\r\n\r\n /**\r\n * Confirmed Ship Date Label.\r\n */\r\n confirmedShipDateLabel?: string;\r\n}\r\n\r\n/**\r\n * Represents cart line data interface.\r\n */\r\ninterface ICartLineData {\r\n cartLine: CartLine | SalesLine;\r\n cartState?: ICartState;\r\n product?: SimpleProduct;\r\n catalogs?: ProductCatalog[];\r\n availability?: IProductInventoryInformation;\r\n unitConversions?: UnitOfMeasureConversion[];\r\n}\r\n\r\nexport type CartLineDisplayMode = 'DEFAULT' | 'COMPACT';\r\n\r\n/**\r\n * ICartLineProps: The props required to render cartLineitem.\r\n */\r\nexport interface ICartLineProps extends IComponentProps {\r\n /**\r\n * The flag to change the quantity component from interactible to static.\r\n */\r\n disableQuantityInteractivity?: boolean;\r\n\r\n /**\r\n * The primary image url.\r\n */\r\n primaryImageUrl?: string;\r\n\r\n /**\r\n * The product error.\r\n */\r\n productError?: ProductError;\r\n\r\n /**\r\n * The product url.\r\n */\r\n productUrl?: string;\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\r\n /**\r\n * Boolean flag to indicate if the item is out of stock.\r\n */\r\n isOutOfStock?: boolean;\r\n\r\n /**\r\n * Flag to make quantity section editable.\r\n */\r\n isQuantityEditable?: boolean;\r\n\r\n /**\r\n * Max quantity for line item.\r\n */\r\n maxQuantity?: number;\r\n\r\n /**\r\n * Current quantity for line item.\r\n */\r\n currentQuantity?: number;\r\n\r\n /**\r\n * Resource string for the component.\r\n */\r\n resources: ICartlineResourceString;\r\n\r\n /**\r\n * SalesLine flag.\r\n */\r\n isSalesLine?: boolean;\r\n\r\n /**\r\n * Error message to show in place of quantity.\r\n */\r\n errorMessage?: string;\r\n\r\n /**\r\n * Display mode to use.\r\n */\r\n displayMode?: CartLineDisplayMode;\r\n\r\n /**\r\n * Inventory information label.\r\n */\r\n inventoryInformationLabel?: string;\r\n\r\n /**\r\n * Inventory information class name.\r\n */\r\n inventoryLabelClassName?: string;\r\n\r\n /**\r\n * Flag to show/hide shipping charges for line items.\r\n */\r\n showShippingChargesForLineItems?: boolean;\r\n\r\n /**\r\n * Boolean flag to indicate if cart state status is ready.\r\n */\r\n isCartStateReady?: boolean;\r\n\r\n /**\r\n * Chanel Delivery Option configuration is from api.\r\n */\r\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n\r\n /**\r\n * The telemetry content.\r\n */\r\n telemetryContent?: ITelemetryContent;\r\n\r\n /**\r\n * The cart line index.\r\n */\r\n lineIndex?: number;\r\n\r\n /**\r\n * The cart line delivery location.\r\n */\r\n deliveryLocation?: string;\r\n\r\n /**\r\n * Quantity onChange callback.\r\n */\r\n quantityOnChange?(cartLine: CartLine, newQuantity: number, lineIndex?: number): void;\r\n priceCurrency?: string;\r\n\r\n /**\r\n * Sales line confirmed ship date.\r\n */\r\n confirmedShipDate?: string;\r\n}\r\n\r\n/**\r\n * Represents dimensions strings.\r\n */\r\ninterface IDimensionStrings {\r\n /**\r\n * String for size key.\r\n */\r\n sizeString: string;\r\n\r\n /**\r\n * String for color key.\r\n */\r\n colorString: string;\r\n\r\n /**\r\n * String associated with the configuration product dimension.\r\n */\r\n configString: string;\r\n\r\n /**\r\n * String for style key.\r\n */\r\n styleString: string;\r\n\r\n /**\r\n * String for amount key.\r\n */\r\n amountString?: string;\r\n}\r\n\r\nconst cartLineItemFunctions = {\r\n /**\r\n * Render product dimensions.\r\n * @param product - Product data.\r\n * @param dimensionStrings - Dimension strings interface.\r\n * @returns JSX Element.\r\n */\r\n renderProductDimensions: (product: SimpleProduct, dimensionStrings: IDimensionStrings) => {\r\n if (!product.Dimensions) {\r\n return [];\r\n }\r\n\r\n return product.Dimensions.map(productDimension => {\r\n if (productDimension.DimensionTypeValue === ProductDimensionType.Color) {\r\n return (\r\n
\r\n \r\n {dimensionStrings.colorString}\r\n {': '}\r\n {productDimension.DimensionValue?.Value}\r\n \r\n
\r\n );\r\n }\r\n\r\n if (productDimension.DimensionTypeValue === ProductDimensionType.Configuration) {\r\n return (\r\n
\r\n \r\n {dimensionStrings.configString}\r\n {': '}\r\n {productDimension.DimensionValue?.Value}\r\n \r\n
\r\n );\r\n }\r\n\r\n if (productDimension.DimensionTypeValue === ProductDimensionType.Size) {\r\n return (\r\n
\r\n \r\n {dimensionStrings.sizeString}\r\n {': '}\r\n {productDimension.DimensionValue?.Value}\r\n \r\n
\r\n );\r\n }\r\n\r\n if (productDimension.DimensionTypeValue === ProductDimensionType.Style) {\r\n return (\r\n
\r\n \r\n {product.IsGiftCard ? dimensionStrings.amountString : dimensionStrings.styleString}\r\n {': '}\r\n {productDimension.DimensionValue?.Value}\r\n \r\n
\r\n );\r\n }\r\n return null;\r\n });\r\n },\r\n\r\n /**\r\n * Gets the react node for product unit of price display.\r\n * @param props - The cart line props.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n renderProductUnitPrice: (props: ICartLineProps) => {\r\n if (!props.data.cartLine.Price) {\r\n return null;\r\n }\r\n const zeroQuantity: number = 0;\r\n return (\r\n
\r\n \r\n zeroQuantity\r\n ? {\r\n price: {\r\n CustomerContextualPrice: props.data.cartLine.Price\r\n }\r\n }\r\n : {\r\n price: {\r\n CustomerContextualPrice: props.data.cartLine.Price\r\n }\r\n }\r\n }\r\n context={props.context}\r\n id={props.id}\r\n typeName={props.typeName}\r\n currencyCode={props.priceCurrency}\r\n />\r\n \r\n
\r\n );\r\n },\r\n\r\n /**\r\n * Render discount lines.\r\n * @param props - The cart line props.\r\n * @returns JSX element.\r\n */\r\n renderDiscountLines: (props: ICartLineProps) => {\r\n if (!props.data.cartLine.DiscountLines || !ArrayExtensions.hasElements(props.data.cartLine.DiscountLines)) {\r\n return null;\r\n }\r\n\r\n /**\r\n * Get the updated discount percentage.\r\n * @param discountLine - The discount line.\r\n * @param cartLine - The cart line.\r\n * @returns The updated discount percentage.\r\n */\r\n const discountPercent = (discountLine: DiscountLine, cartLine: CartLine): number => {\r\n const numberZero = 0;\r\n const decimalPrecision = 2;\r\n const fullPercentage = 100;\r\n let updatedPercent: number = discountLine.Percentage ?? numberZero;\r\n\r\n if (\r\n (discountLine.Percentage === numberZero ||\r\n (discountLine.DiscountLineTypeValue && discountLine.DiscountLineTypeValue === DiscountLineType.TenderTypeDiscount)) &&\r\n cartLine.Price &&\r\n cartLine.Price > numberZero &&\r\n cartLine.Quantity &&\r\n cartLine.Quantity !== numberZero\r\n ) {\r\n const effectiveAmount = discountLine.EffectiveAmount ?? numberZero;\r\n updatedPercent = Number(\r\n ((effectiveAmount / (cartLine.Price * cartLine.Quantity)) * fullPercentage).toFixed(decimalPrecision)\r\n );\r\n }\r\n\r\n return updatedPercent;\r\n };\r\n\r\n return props.data.cartLine.DiscountLines.map((discountLine, index) => {\r\n return (\r\n
\r\n {discountLine.OfferName ? discountLine.OfferName : ''}\r\n \r\n \r\n \r\n \r\n {` (${discountLine.Percentage !== undefined ? discountPercent(discountLine, props.data.cartLine) : ''}%)`}\r\n \r\n
\r\n );\r\n });\r\n },\r\n\r\n /**\r\n * Render inventory label.\r\n * @param props - The cart line props.\r\n * @returns JSX element.\r\n */\r\n renderInventoryLabel: (props: ICartLineProps) => {\r\n const availabilityClass = props.data.availability\r\n ? (props.data.availability?.IsProductAvailable || props.data.availability?.StockLevelLabel?.startsWith('!')\r\n ? 'available' : 'not-available')\r\n : '';\r\n const inventoryCssName = props.inventoryLabelClassName\r\n ? `msc-cart-line__product-inventory-label ${props.inventoryLabelClassName} ${availabilityClass}`\r\n : `msc-cart-line__product-inventory-label ${availabilityClass}`;\r\n\r\n return

{props.inventoryInformationLabel}

;\r\n },\r\n\r\n /**\r\n * Render shipping label.\r\n * @param props - The cart line props.\r\n * @returns JSX element.\r\n */\r\n renderShippingLabel: (props: ICartLineProps) => {\r\n const pickupDeliveryModeCode = props.context.request.channel?.PickupDeliveryModeCode;\r\n const channelDeliveryOptionConfig = props.channelDeliveryOptionConfig;\r\n const cartline = props.data.cartLine;\r\n let hasShippingMethod = false;\r\n if (channelDeliveryOptionConfig !== undefined) {\r\n hasShippingMethod = !!(\r\n cartline.DeliveryMode &&\r\n channelDeliveryOptionConfig.PickupDeliveryModeCodes?.some(deliveryMode => deliveryMode !== cartline.DeliveryMode)\r\n );\r\n } else {\r\n hasShippingMethod = !!(cartline.DeliveryMode && cartline.DeliveryMode !== pickupDeliveryModeCode);\r\n }\r\n if (!hasShippingMethod) {\r\n return undefined;\r\n }\r\n\r\n const shippingChargeLines = (cartline.ChargeLines ?? []).filter(chargeLine => chargeLine.IsShipping);\r\n\r\n if (!ArrayExtensions.hasElements(shippingChargeLines)) {\r\n return undefined;\r\n }\r\n\r\n const defaultCharge: number = 0;\r\n const freightFee = shippingChargeLines.reduce((chargeTotal, chargeLine) => {\r\n return chargeTotal + (chargeLine.CalculatedAmount ?? defaultCharge);\r\n }, defaultCharge);\r\n\r\n const priceComponent = (\r\n \r\n );\r\n return (\r\n <>\r\n \r\n {priceComponent}\r\n \r\n );\r\n },\r\n\r\n /**\r\n * Render other charges.\r\n * @param props - The cart line props.\r\n * @returns JSX element.\r\n */\r\n renderOtherCharges: (props: ICartLineProps) => {\r\n const cartline = props.data.cartLine;\r\n const otherCharges = cartline.ChargeLines?.filter(chargeline => !chargeline.IsShipping);\r\n\r\n return (\r\n otherCharges?.map((otherCharge, index) => {\r\n const itemIndex = index;\r\n return otherCharge.CalculatedAmount ? (\r\n
\r\n \r\n \r\n \r\n \r\n
\r\n ) : (\r\n ''\r\n );\r\n }) ?? undefined\r\n );\r\n },\r\n\r\n /**\r\n * Render the sales agreement prompt.\r\n * @param props - The ICartLineProps.\r\n * @returns The JSX.Element.\r\n */\r\n renderSalesAgreementPrompt: (props: ICartLineProps): JSX.Element | null => {\r\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers -- We use 0 to indicate no sales agreement applied on the cart line.\r\n if (props.data.cartLine.SalesAgreementLineRecordId === 0) {\r\n return null;\r\n }\r\n return
{props.resources.salesAgreementPricePrompt}
;\r\n },\r\n\r\n renderConfirmedShipDate: (props: ICartLineProps) => {\r\n if (!props.isSalesLine || props.confirmedShipDate === undefined || StringExtensions.isNullOrEmpty(props.confirmedShipDate)) {\r\n return null;\r\n }\r\n return (\r\n
\r\n {props.resources.confirmedShipDateLabel}\r\n {props.confirmedShipDate}\r\n
\r\n );\r\n }\r\n};\r\n\r\n/**\r\n * Render cartline component.\r\n * @param props - The cart line props.\r\n * @returns JSX element.\r\n */\r\n// eslint-disable-next-line no-redeclare\r\nconst CartLine: React.FC = (props: ICartLineProps) => {\r\n const { isSalesLine, productUrl, resources, displayMode } = props;\r\n const { cartLine } = props.data;\r\n const product = props.data.product as SimpleProductExt | undefined;\r\n const quantity = cartLine.Quantity || 1;\r\n const [stateQuantity, setStateQuantity] = React.useState(quantity);\r\n const temperatureZoneIcon = React.useMemo(() => product?.TemperatureZone ? getTemperatureZoneIcon(props.context, product.TemperatureZone) : undefined, [product?.TemperatureZone])\r\n const fallbackImageUrl =\r\n product &&\r\n getFallbackImageUrl(\r\n product.ItemId,\r\n props.context.actionContext.requestContext.apiSettings,\r\n props.context.request.app?.config?.OmniChannelMedia\r\n );\r\n const imageSettings = props.imageSettings;\r\n if (imageSettings) {\r\n imageSettings.cropFocalRegion = true;\r\n }\r\n const renderInventoryLabel = cartLineItemFunctions.renderInventoryLabel(props);\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, '', product?.RecordId.toString());\r\n const productAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\r\n const productName = product?.Name ?? cartLine.Description;\r\n const imgeClassName = props.data.cartLine.IsInvoiceLine ? 'msc-cart-line__invoice-image' : 'msc-cart-line__product-image';\r\n const cartLineContentClassName = props.data.cartLine.IsInvoiceLine ? 'msc-cart-line__invoice-content' : 'msc-cart-line__content';\r\n\r\n React.useEffect(() => setStateQuantity(quantity), [props.data.cartLine.Quantity]);\r\n\r\n /**\r\n * Render other charges.\r\n * @param newValue - The cart line props.\r\n * @returns Boolean.\r\n */\r\n const onChange = (newValue: number) => {\r\n setStateQuantity(newValue);\r\n\r\n if (props.quantityOnChange) {\r\n props.quantityOnChange(props.data.cartLine, newValue);\r\n }\r\n };\r\n\r\n /**\r\n * Generate error message.\r\n * @returns JSX element.\r\n */\r\n const generateErrorMessage = (): JSX.Element | null => {\r\n if (props.errorMessage) {\r\n return (\r\n
\r\n \r\n {props.errorMessage}\r\n
\r\n );\r\n }\r\n\r\n return null;\r\n };\r\n\r\n /**\r\n * Render Saving component.\r\n * @returns JSX element.\r\n */\r\n // @ts-ignore\r\n const renderSaving = (): JSX.Element | null => {\r\n if (!props.data.cartLine.DiscountAmount) {\r\n return null;\r\n }\r\n const discountAmountZero: number = 0;\r\n\r\n if (props.data.cartLine.DiscountAmount > discountAmountZero) {\r\n return (\r\n <>\r\n {`${props.resources.discountStringText || 'Discount'}`}\r\n \r\n \r\n );\r\n }\r\n return null;\r\n };\r\n\r\n /**\r\n * Gets the react node for product unit of measure display.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n const renderUnitOfMeasure = (asSpan: boolean = false) => {\r\n if (props.data.cartLine.IsInvoiceLine) {\r\n return null;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Do not need type check for appsettings\r\n if (!props.context.app.config.unitOfMeasureDisplayType || props.context.app.config.unitOfMeasureDisplayType === 'none') {\r\n return undefined;\r\n }\r\n\r\n if (!product || !product.DefaultUnitOfMeasure) {\r\n return undefined;\r\n }\r\n\r\n if (asSpan) {\r\n return (\r\n \r\n \r\n \r\n );\r\n } else {\r\n return (\r\n
\r\n \r\n
\r\n );\r\n }\r\n };\r\n\r\n /**\r\n * Generate quantity and price component.\r\n * @returns JSX element.\r\n */\r\n const generatePrice = (): JSX.Element | null => {\r\n let price = isSalesLine\r\n ? {\r\n CustomerContextualPrice: (props.data.cartLine as SalesLine).NetAmountWithAllInclusiveTax,\r\n BasePrice: (props.data.cartLine as SalesLine).GrossAmount\r\n } : {\r\n /* CustomerContextualPrice: (props.data.cartLine.Price || 0) * quantity, // This is shown in mini cart */\r\n CustomerContextualPrice: props.data.cartLine.NetAmountWithoutTax || (props.data.cartLine.Price || 0) * quantity, // This is shown in mini cart\r\n BasePrice: 0 // props.data.cartLine.NetPrice\r\n } as ProductPriceExt;\r\n const productPrice = (props.data.product as SimpleProductExt | undefined)?.ProductPrice;\r\n\r\n if (productPrice) {\r\n // price.CustomerContextualPrice = (productPrice.CustomerContextualPrice || 0) * quantity;\r\n\r\n // Only set the base price if there is an explicit discount\r\n if (getDiscountLines(productPrice.DiscountLines).length > 0) {\r\n price.BasePrice = getOriginalPrice(productPrice) * quantity;\r\n price.OverrideDiscountPercentage = getDiscountPercentage(price);\r\n }\r\n }\r\n\r\n const priceElement = (\r\n
\r\n \r\n {/* {renderSaving()} */}\r\n {props.isOutOfStock ? renderInventoryLabel : null}\r\n
\r\n );\r\n\r\n return priceElement;\r\n };\r\n\r\n const generateQuantity = (): JSX.Element | null => {\r\n const singleQuantity: number = 1;\r\n\r\n let quantityElement: JSX.Element | null = null;\r\n\r\n // No quantity selector for invoice line\r\n if (!props.data.cartLine.IsInvoiceLine) {\r\n if (props.data.product && props.isQuantityEditable) {\r\n quantityElement = (\r\n
\r\n {/*
{resources.quantityDisplayString}
*/}\r\n\r\n {generateErrorMessage()}\r\n\r\n \r\n\r\n {/* {renderUnitOfMeasure()} */}\r\n
\r\n );\r\n } else {\r\n quantityElement = (\r\n \r\n \r\n\r\n {generateErrorMessage()}\r\n\r\n {props.data.cartLine.Quantity}\r\n {' '}\r\n {renderUnitOfMeasure(true)}\r\n \r\n );\r\n }\r\n }\r\n\r\n return quantityElement;\r\n };\r\n\r\n // @ts-expect-error\r\n const _renderStoreLocation = (): JSX.Element | null => {\r\n if (cartLine && cartLine.FulfillmentStoreId) {\r\n return (\r\n
\r\n {props.deliveryLocation}\r\n
\r\n );\r\n } else {\r\n return (\r\n
\r\n {props.deliveryLocation}\r\n
\r\n );\r\n }\r\n };\r\n\r\n const badge = (props.data.product as SimpleProductExt | undefined)?.Badge;\r\n\r\n return (\r\n
\r\n {(displayMode === undefined || displayMode === 'DEFAULT') && (\r\n \r\n \r\n )}\r\n
\r\n
\r\n {props.productError?.Error && (\r\n \r\n \r\n \r\n )}\r\n {displayMode !== 'COMPACT' && temperatureZoneIcon && (\r\n \r\n )}\r\n \r\n {productName}\r\n \r\n {generatePrice()}\r\n
\r\n {renderInventoryLabel}\r\n {generateQuantity()}\r\n
\r\n {(displayMode !== 'COMPACT' && badge) && (\r\n \r\n )}\r\n
\r\n );\r\n};\r\n\r\n// @ts-expect-error\r\nexport const CartLineItemComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride(\r\n 'CartLineItem',\r\n {\r\n component: CartLine,\r\n ...cartLineItemFunctions\r\n }\r\n);\r\n\r\nexport default CartLineItemComponent;\r\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { ProductDeliveryOptions, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport {\n ActiveCartProductsInput,\n getActiveCartProductsAction,\n getAvailabilitiesForCartLineItems,\n getDeliveryOptionsForCartLineItems,\n IProductInventoryInformation,\n ProductAvailabilitiesForCartLineItems,\n ProductDeliveryOptionsForCartLineItems\n} from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * IMiniCartData entity interface.\n */\nexport interface IMiniCartData {\n products?: SimpleProduct[];\n productAvailabilites?: IProductInventoryInformation[];\n deliveryOptions?: ProductDeliveryOptions[];\n}\n\nexport const createInput = () => {\n return new ActiveCartProductsInput();\n};\n\n/**\n * Calls the Retail API and returns a mini cart data.\n * @param ctx\n * @param cartState\n */\nexport async function getMiniCartData(ctx: IActionContext, cartState: ICartState): Promise {\n const miniCartData: IMiniCartData = {};\n\n const cart = cartState.cart;\n\n // If there are cart lines, make call to get products\n // If there are invocie linese, then there is no products, so don't make call to get products\n if (cart && cart.CartLines && cart.CartLines.length > 0 && !cartState.hasInvoiceLine) {\n await getActiveCartProductsAction(new ActiveCartProductsInput(), ctx)\n .then(products => {\n if (products) {\n miniCartData.products = products;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n throw new Error('[getActiveCartWithProdcuts]Unable to hydrate cart with product information');\n });\n\n await getAvailabilitiesForCartLineItems(new ProductAvailabilitiesForCartLineItems(ctx.requestContext.apiSettings), ctx)\n .then(availableQuantity => {\n if (availableQuantity) {\n miniCartData.productAvailabilites = availableQuantity;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n throw new Error('[getActiveCartWithProdcuts]Unable to hydrate cart with product information');\n });\n\n await getDeliveryOptionsForCartLineItems(new ProductDeliveryOptionsForCartLineItems(ctx.requestContext.apiSettings), ctx)\n .then(deliveryOptions => {\n if (deliveryOptions) {\n miniCartData.deliveryOptions = deliveryOptions;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n throw new Error('[getActiveCartWithProdcuts]Unable to hydrate cart with product information');\n });\n }\n\n return miniCartData;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { AddToCartBehavior, CartIconComponent } from '@msdyn365-commerce/components';\nimport { getUrlSync, IDictionary, IImageSettings, msdyn365Commerce, TelemetryEvent } from '@msdyn365-commerce/core';\nimport {\n CartLine,\n ChannelDeliveryOptionConfiguration,\n CartLineValidationResultsByLineId,\n OrgUnitLocation\n} from '@msdyn365-commerce/retail-proxy';\nimport { validateCartAsync } from '@msdyn365-commerce-modules/cart-utilities';\nimport { ArrayExtensions, validateCartLinesInventory } from '@msdyn365-commerce-modules/retail-actions';\nimport {\n Button,\n getPayloadObject,\n getTelemetryAttributes,\n getTelemetryObject,\n INodeProps,\n ITelemetryContent,\n TelemetryConstant,\n UncontrolledTooltip,\n updateMaxQuantityForCartLineItem,\n urlCheck\n} from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { reaction } from 'mobx';\nimport { observer } from 'mobx-react';\nimport React from 'react';\n\nimport { ICartIconData } from './cart-icon.data';\nimport { cartLinesSortOrder, ICartIconProps } from './cart-icon.props.autogenerated';\nimport { FlyoutCartLineItems, IFlyoutCartLineItemViewProps } from './components/flyout-cart-line-items';\nimport { getMiniCartData, IMiniCartData } from './utils/get-products-in-mini-cart';\n\nexport interface IMiniCartState {\n miniCartData: IMiniCartData;\n orgUnitLocations?: OrgUnitLocation[];\n isQuantityLimitsFeatureEnabled: boolean;\n isCartValid: boolean;\n}\n\nexport interface ICartIconViewProps extends ICartIconProps {\n className: string;\n cartIcon: React.ReactNode;\n FlyoutContainer?: INodeProps;\n CartlinesWrapper: INodeProps;\n miniCartWrapper: INodeProps;\n miniCartItemWrapper: INodeProps;\n cartlines?: IFlyoutCartLineItemViewProps[];\n flyoutTitle: React.ReactNode;\n totalPrice: React.ReactNode;\n checkoutAsGuestButton?: React.ReactNode;\n checkoutAsSignInUserButton?: React.ReactNode;\n goToCartButton?: React.ReactNode;\n waitingComponent?: React.ReactNode;\n isCartLoading: boolean;\n checkoutBlockedDueToUnavailableFunds?: React.ReactNode;\n\n removeItemClickHandler(cartlineToRemove: CartLine): void;\n}\n\n/**\n *\n * Cart component.\n * @extends {React.PureComponent>}\n */\n@observer\nclass CartIcon extends React.Component, IMiniCartState> {\n private readonly telemetryContent: ITelemetryContent;\n\n private readonly checkoutBySignInAttributes: IDictionary | undefined;\n\n private readonly checkoutByGuestAttributes: IDictionary | undefined;\n\n private readonly viewShoppingBagAttributes: IDictionary | undefined;\n\n private retailMultiplePickUpOptionEnabled?: boolean = false;\n\n private channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n\n private lastValidatedCartVersion: number | undefined;\n\n constructor(props: ICartIconProps) {\n super(props);\n this.state = {\n miniCartData: {},\n isCartValid: true,\n isQuantityLimitsFeatureEnabled: false\n };\n this.telemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\n const payload = getPayloadObject(TelemetryEvent.CheckOut, this.telemetryContent, TelemetryConstant.Checkout);\n this.checkoutBySignInAttributes = getTelemetryAttributes(this.telemetryContent, payload);\n\n payload.contentAction.etext = TelemetryConstant.GuestCheckout;\n this.checkoutByGuestAttributes = getTelemetryAttributes(this.telemetryContent, payload);\n\n payload.contentAction.etext = TelemetryConstant.ViewShoppingBag;\n this.viewShoppingBagAttributes = getTelemetryAttributes(this.telemetryContent, payload);\n }\n\n public async componentDidMount(): Promise {\n const context = this.props.context.actionContext;\n\n reaction(\n () => this.props.data.cart.result?.cart.CartLines,\n async () => {\n this.setState({\n miniCartData: await getMiniCartData(context, this.props.data.cart.result!)\n });\n }\n );\n await this._setQuantityLimitsFeatureFlag();\n\n this.setState({\n orgUnitLocations: this.props.data.orgUnitLocations?.result\n });\n\n this._validateCart();\n }\n\n public componentDidUpdate(prevProps: ICartIconProps): void {\n this._validateCart();\n }\n\n public shouldComponentUpdate(nextProps: ICartIconProps, nextState: IMiniCartState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n // eslint-disable-next-line complexity -- disabling the complexity for this method for now as its causing lot of other warnings\n public render(): JSX.Element | null {\n const {\n id,\n typeName,\n config: { enableHoverCart, isAnonymousCheckout },\n context: {\n request: {\n user: { isAuthenticated, signInUrl }\n }\n },\n context,\n resources\n } = this.props;\n\n const cart = (this.props.data.cart && this.props.data.cart.result) || undefined;\n const guestCheckoutUrl = getUrlSync('checkout', this.props.context.actionContext) || '';\n const cartUrl = getUrlSync('cart', this.props.context.actionContext) || '';\n const checkoutURL = this._getCheckoutURL(isAuthenticated, guestCheckoutUrl, signInUrl || '');\n const isCartEmpty = cart && cart.cart.CartLines && cart.cart.CartLines.length === 0;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- check config.\n const shouldShowMiniCart =\n cart?.isProductAddedToCart && this.props.context.app.config.addToCartBehavior === AddToCartBehavior.showMiniCart;\n const hasInvoiceLine = cart?.hasInvoiceLine;\n const emailDeliveryModeCode = this.props.context.request.channel?.EmailDeliveryModeCode;\n const cartLines = this._getCartLines();\n const validInventoryAcrossCartLines = validateCartLinesInventory(\n cart?.cart.CartLines ?? [],\n this.state.miniCartData.productAvailabilites ?? [],\n this.props.context.actionContext,\n this.state.miniCartData.products ?? [],\n emailDeliveryModeCode\n );\n const hasError =\n !validInventoryAcrossCartLines?.isValid ||\n (!validInventoryAcrossCartLines && !this.state.isCartValid) ||\n (cartLines ? cartLines.some(cartline => cartline.hasError) : false);\n const includeFlyout = this.props.data.cart && this.props.data.cart.status === 'SUCCESS' && enableHoverCart;\n const totalItemsInCart = cart?.totalItemsInCart ? cart.totalItemsInCart : 0;\n const goToCartButtonText = resources.goToCartButtonTitle.replace('{count}', totalItemsInCart.toString());\n const flyoutTitle = resources.flyoutTitle;\n const flyoutTooltip = {\n tag: UncontrolledTooltip,\n shouldShowMiniCart,\n placement: 'bottom-end',\n hideArrow: true,\n className: 'ms-cart-icon__flyout-container',\n trigger: 'hover',\n displayMode: 'FLYOUT',\n target: id,\n shouldShowCloseButton: true,\n cartPageUrl: cartUrl,\n hideAriaHidden: true\n };\n\n // If there are invoice lines, don't update mini cart price\n const price = (cart && !cart.hasInvoiceLine && cart.cart.TotalAmount) || undefined;\n const priceString = price\n ? resources.totalPriceFormatString.replace('{price}', context.cultureFormatter.formatCurrency(price))\n : '';\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n this.channelDeliveryOptionConfig = this.props.data.channelDeliveryOptionConfig?.result;\n this.retailMultiplePickUpOptionEnabled = this.props.data.featureState?.result?.find(\n feature => feature.Name === multiplePickupStoreSwitchName\n )?.IsEnabled;\n\n const viewProps = {\n ...this.props,\n cartIcon: (\n \n ),\n cartlines: cartLines,\n FlyoutContainer: includeFlyout ? flyoutTooltip : undefined,\n CartlinesWrapper: {\n className: 'ms-cart-icon__cart-lines'\n },\n miniCartWrapper: {\n className: classnames('ms-cart-icon'),\n id: this.props.id\n },\n miniCartItemWrapper: {\n className: classnames('msc-cart-lines-item')\n },\n\n // If there are invoice lines, don't update mini cart checkout button\n // Checkout button will display by default to maintain backward compatibility. When Anonymous user checkout is enabled &&\n // user is authenticated then we will show the checkout button otherwise we will show the guest checkout button.\n checkoutAsSignInUserButton:\n !isCartEmpty && !hasInvoiceLine && (!isAnonymousCheckout || isAuthenticated) ? (\n \n {resources.checkoutButtonTitle}\n \n ) : null,\n checkoutAsGuestButton:\n isAnonymousCheckout && !isCartEmpty && !isAuthenticated ? (\n \n {resources.guestCheckoutButtonTitle}\n \n ) : null,\n goToCartButton: (\n \n {goToCartButtonText}\n \n ),\n checkoutBlockedDueToUnavailableFunds: null,\n flyoutTitle: {flyoutTitle},\n totalPrice:
{priceString}
\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private _validateCart(): void {\n const {\n data: { cart }\n } = this.props;\n const cartVersion = cart.result?.cart?.Version ?? undefined;\n if (this.lastValidatedCartVersion === cartVersion) {\n return;\n }\n\n this.lastValidatedCartVersion = cartVersion; // This field is populated to block concurrent requests\n\n if (this.state.isQuantityLimitsFeatureEnabled) {\n validateCartAsync(cart, this.props.telemetry, this.props.context)\n .then((result: CartLineValidationResultsByLineId | undefined) => {\n this.setState({ isCartValid: !ArrayExtensions.hasElements(result?.ValidationResultsPairs) });\n })\n .catch(() => {\n this.setState({ isCartValid: false });\n });\n } else {\n this.setState({ isCartValid: true });\n }\n }\n\n private _getCheckoutURL(isAuthenticated: boolean, guestCheckoutUrl: string, signInUrl: string): string {\n if (isAuthenticated) {\n return guestCheckoutUrl;\n }\n\n const isAbsoluteUrl = urlCheck(guestCheckoutUrl);\n let returnURL = guestCheckoutUrl;\n if (msdyn365Commerce.isBrowser && !isAbsoluteUrl) {\n returnURL = `${window.location.origin}${guestCheckoutUrl}`;\n }\n\n return `${signInUrl}${!signInUrl.includes('?') ? '?' : '&'}ru=${returnURL}`;\n }\n\n /**\n * Sort cartline items.\n * @param cartlines - Cartlines to be sorted.\n * @param sortOrder - Ascending or descending.\n * @returns - Sorted cartlines.\n */\n private readonly getSortedCartLines = (cartlines: CartLine[], sortOrder?: cartLinesSortOrder): CartLine[] => {\n const lines: CartLine[] = [...cartlines];\n const zero: number = 0;\n\n if (sortOrder === cartLinesSortOrder.descending) {\n return lines.sort((item1, item2) => (item2.LineNumber ?? zero) - (item1.LineNumber ?? zero));\n }\n return lines.sort((item1, item2) => (item1.LineNumber ?? zero) - (item2.LineNumber ?? zero));\n };\n\n private _getCartLines(): IFlyoutCartLineItemViewProps[] | null {\n const {\n context: {\n request: { channel: { PickupDeliveryModeCode } = { PickupDeliveryModeCode: undefined } }\n },\n config,\n telemetry,\n resources\n } = this.props;\n\n const imageSettings = this._getImageSettings(config.imageSettings);\n const cart = this.props.data.cart && this.props.data.cart.result;\n\n // Cart-icon could be placed in each page\n // so we check cart content to reduce number of RS calls\n return this.state.miniCartData.products && cart && cart.cart.CartLines && cart.cart.CartLines.length > 0\n ? FlyoutCartLineItems({\n cartlines: this.getSortedCartLines(cart.cart.CartLines, config.cartLinesSortOrder),\n products: this.state.miniCartData.products,\n productAvailabilites: this.state.miniCartData.productAvailabilites,\n productDeliveryOptions: this.state.miniCartData.deliveryOptions,\n imageSettings,\n outOfStockThreshold: this.props.context.app.config.outOfStockThreshold || 0,\n isStockCheckEnabled: this.props.context.app.config.enableStockCheck || false,\n maxCartlineQuantity: updateMaxQuantityForCartLineItem(this.props.context.app.config.maxQuantityForCartLineItem),\n gridSettings: this.props.context.request.gridSettings!,\n context: this.props.context,\n typeName: this.props.typeName,\n id: this.props.id,\n resources: {\n sizeString: resources.productDimensionTypeSize,\n colorString: resources.productDimensionTypeColor,\n configString: resources.productDimensionTypeConfiguration,\n styleString: resources.productDimensionTypeStyle,\n quantityDisplayString: resources.quantityDisplayText,\n salesAgreementPricePrompt: resources.salesAgreementPricePrompt,\n inputQuantityAriaLabel: '', // Not used\n discountStringText: '', // Not used\n originalPriceText: '',\n currentPriceText: '',\n shippingChargesText: '',\n shippingText: resources.shippingText\n },\n telemetry,\n removeButtonText: resources.removeCartButtonText,\n outOfStockText: '', // Not used\n outOfRangeOneText: '', // Not used\n outOfRangeFormatText: '', // Not used\n cartState: cart,\n orgUnitLocations: this.state.orgUnitLocations,\n removeItemClickHandler: this._removeItemFromCartHandler,\n pickupDeliveryModeCode: PickupDeliveryModeCode,\n telemetryContent: this.telemetryContent,\n channelDeliveryOptionConfig: this.retailMultiplePickUpOptionEnabled ? this.channelDeliveryOptionConfig : undefined,\n isQuantityLimitsFeatureEnabled: this.state.isQuantityLimitsFeatureEnabled,\n catalogs: this.props.data.catalogs?.result\n })\n : null;\n }\n\n private readonly _getImageSettings = (imageSettings: IImageSettings | undefined): IImageSettings => {\n return (\n imageSettings || {\n viewports: {\n xs: { q: 'w=80&h=94&m=6', w: 0, h: 0 },\n sm: { q: 'w=148&h=174&m=6', w: 0, h: 0 },\n lg: { q: 'w=148&h=174&m=6', w: 0, h: 0 }\n },\n lazyload: true\n }\n );\n };\n\n private readonly _removeItemFromCartHandler = (cartlineToRemove: CartLine) => {\n if (this.props.data.cart.result) {\n const input = {\n cartLineIds: [cartlineToRemove.LineId!.toString()]\n };\n this.props.data.cart.result.removeCartLines(input).catch(error => {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to Remove Cart Line');\n });\n }\n };\n\n private async _setQuantityLimitsFeatureFlag(): Promise {\n const featureStatuses = await this.props.data.featureState;\n\n const isChannelQuantityLimitsFeatureEnabledInHq =\n featureStatuses?.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.EcommerceQuantityLimitConfigurationsFeature'\n )?.IsEnabled || false;\n if (isChannelQuantityLimitsFeatureEnabledInHq) {\n this.setState({ isQuantityLimitsFeatureEnabled: true });\n return;\n }\n\n const useSiteBuilderSettings = featureStatuses?.find(\n featureState => featureState.Name === 'RevertToSiteBuilderOrderQuantityLimitsSettings'\n )?.IsEnabled;\n\n if (useSiteBuilderSettings) {\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\n if (!defaultOrderQuantityLimitsFeatureConfig || defaultOrderQuantityLimitsFeatureConfig === 'none') {\n this.setState({ isQuantityLimitsFeatureEnabled: false });\n return;\n }\n\n try {\n const featureStatuses = await this.props.data.featureState;\n const isQuantityLimitsFeatureEnabledInHq =\n featureStatuses?.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature'\n )?.IsEnabled || false;\n if (!isQuantityLimitsFeatureEnabledInHq) {\n this.setState({ isQuantityLimitsFeatureEnabled: false });\n return;\n }\n } catch (error) {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to get feature states');\n this.setState({ isQuantityLimitsFeatureEnabled: false });\n return;\n }\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\n this.setState({ isQuantityLimitsFeatureEnabled: true });\n } else {\n this.props.data.customerInformation\n .then(customerInfo => {\n const result =\n !!customerInfo &&\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b));\n this.setState({ isQuantityLimitsFeatureEnabled: result });\n })\n .catch(error => {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to get customer info');\n });\n }\n } else {\n const cartConfiguration = await this.props.data.cartConfiguration;\n this.setState({ isQuantityLimitsFeatureEnabled: !(cartConfiguration?.IgnoreOrderSettings ?? false) });\n return;\n }\n }\n}\n\nexport default CartIcon;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CartLineItemComponent, ICartlineResourceString } from '@msdyn365-commerce/components';\nimport MsDyn365, { ICoreContext, IGridSettings, IImageSettings, ITelemetry, isChannelTypeB2B } from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport {\n CartLine,\n ChannelDeliveryOptionConfiguration,\n OrgUnitLocation,\n ProductAvailableQuantity,\n ProductDeliveryOptions,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy';\nimport { ProductCatalog, ReleasedProductType } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { getProductUrlSync, IProductInventoryInformation } from '@msdyn365-commerce-modules/retail-actions';\nimport {\n Button,\n getPayloadObject,\n getTelemetryAttributes,\n ITelemetryContent,\n TelemetryConstant\n} from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { getProductByProductId, getProductByProductIdAndWarehouse } from '../../../Common/get-product';\n\nexport interface IFlyoutCartLineItemsProps {\n cartlines: CartLine[];\n cartState: ICartState | undefined;\n orgUnitLocations: OrgUnitLocation[] | undefined;\n resources: ICartlineResourceString;\n productAvailabilites: IProductInventoryInformation[] | undefined;\n products: SimpleProduct[] | undefined;\n productDeliveryOptions: ProductDeliveryOptions[] | undefined;\n pickupDeliveryModeCode?: string;\n catalogs?: ProductCatalog[];\n\n /**\n * GridSettings for the product image in cartline\n */\n gridSettings: IGridSettings;\n\n /**\n * ImageSettings for the product image in cartline\n */\n imageSettings: IImageSettings;\n id: string;\n typeName: string;\n context: ICoreContext;\n telemetry: ITelemetry;\n removeButtonText: string;\n outOfStockText: string;\n outOfRangeOneText: string;\n outOfRangeFormatText: string;\n maxCartlineQuantity: number;\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n isQuantityLimitsFeatureEnabled: boolean;\n\n outOfStockThreshold: number;\n isStockCheckEnabled: boolean;\n telemetryContent?: ITelemetryContent;\n removeItemClickHandler(cartlineToRemove: CartLine): void;\n}\n\nexport interface IFlyoutCartLineItemViewProps {\n cartline: React.ReactNode;\n remove: React.ReactNode;\n storeLocation: React.ReactNode;\n hasError: boolean;\n\n data: {\n product: SimpleProduct;\n cartline: CartLine;\n };\n}\n\nconst _getCartItemAvailableQuantity = (\n isStockCheckEnabled: boolean,\n outOfStockThreshold: number,\n productAvailability?: ProductAvailableQuantity\n): number => {\n if (isStockCheckEnabled) {\n if (\n !productAvailability ||\n !productAvailability.AvailableQuantity ||\n productAvailability.AvailableQuantity <= 0 ||\n productAvailability.AvailableQuantity <= outOfStockThreshold\n ) {\n return 0;\n }\n return productAvailability.AvailableQuantity - outOfStockThreshold;\n }\n\n return 0;\n};\n\nconst _getCartItemMaxQuantity = (\n maxQuantityByConfig: number,\n isStockCheckEnabled: boolean,\n availableQuantityInStock: number,\n isQuantityLimitsFeatureEnabled: boolean,\n maxByQuantityLimitsFeature: number\n) => {\n if (isQuantityLimitsFeatureEnabled) {\n let maxByQuantityLimitsFeatureResult = maxByQuantityLimitsFeature;\n\n // If max by feature in not defined when feature is on then we suggest that there is no max by feature\n // and consider available qty if stock check enabled and max from config in site settings.\n if (!maxByQuantityLimitsFeature) {\n maxByQuantityLimitsFeatureResult = maxQuantityByConfig || 10;\n }\n\n return isStockCheckEnabled\n ? maxByQuantityLimitsFeatureResult < availableQuantityInStock\n ? maxByQuantityLimitsFeatureResult\n : availableQuantityInStock\n : maxByQuantityLimitsFeatureResult;\n }\n if (isStockCheckEnabled) {\n return availableQuantityInStock < maxQuantityByConfig ? availableQuantityInStock : maxQuantityByConfig;\n }\n return maxQuantityByConfig;\n};\n\n/**\n * On Remove Click functionality.\n * @param removeItemClickHandler -Remove item click function.\n * @param cartline -CartLine.\n * @returns Remove change value.\n */\nconst onRemoveClickFunction = (removeItemClickHandler: (cartlineToRemove: CartLine) => void, cartline: CartLine) => () => {\n removeItemClickHandler(cartline);\n};\nconst _assembleNode = (\n cartline: CartLine,\n product: SimpleProduct,\n props: IFlyoutCartLineItemsProps,\n index: number,\n foundProductAvailability?: ProductAvailableQuantity,\n foundProductDeliveryOptions?: ProductDeliveryOptions\n): IFlyoutCartLineItemViewProps => {\n const { imageSettings, gridSettings, id, typeName, context, resources, removeButtonText, removeItemClickHandler } = props;\n\n const availableQuantityInStock = _getCartItemAvailableQuantity(\n props.isStockCheckEnabled,\n props.outOfStockThreshold,\n foundProductAvailability\n );\n const maxQuantity =\n product &&\n _getCartItemMaxQuantity(\n props.maxCartlineQuantity,\n props.isStockCheckEnabled,\n availableQuantityInStock,\n props.isQuantityLimitsFeatureEnabled,\n product?.Behavior?.MaximumQuantity || 0\n );\n\n // Check if the product is service or not by product type\n const isServiceItem = product.ItemTypeValue === ReleasedProductType.Service;\n\n const onRemoveClickHandler = onRemoveClickFunction(removeItemClickHandler, cartline);\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.RemoveCartItem);\n const removeCartItemAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n\n let productUrl = getProductUrlSync(product, props.context.actionContext, undefined);\n if (MsDyn365.isBrowser && isChannelTypeB2B(props.context.actionContext.requestContext)) {\n const fullUrl = new URL(productUrl, window.location.href);\n fullUrl.searchParams.set('catalogid', `${cartline.CatalogId ?? 0}`);\n productUrl = fullUrl.href;\n }\n\n return {\n data: {\n product,\n cartline\n },\n hasError: !isServiceItem && props.isStockCheckEnabled ? cartline.Quantity! > maxQuantity : false,\n cartline: (\n \n ),\n remove: (\n \n {removeButtonText}\n \n ),\n storeLocation: _renderStoreLocation(cartline, props)\n };\n};\n\nconst _renderDeliveryLocation = (cartLine: CartLine | null | undefined, props: IFlyoutCartLineItemsProps): string | undefined => {\n let deliverylocation;\n if (cartLine && cartLine.FulfillmentStoreId) {\n const orgUnitName = _getOrgUnitName(cartLine.FulfillmentStoreId, props.orgUnitLocations);\n\n let foundProductDeliveryOption;\n if (props.productDeliveryOptions && props.productDeliveryOptions.length > 0) {\n foundProductDeliveryOption = props.productDeliveryOptions.find(deliveryOption => {\n return deliveryOption && deliveryOption.ProductId === cartLine.ProductId;\n });\n }\n const delivery = foundProductDeliveryOption?.DeliveryOptions?.find(option => option.Code === cartLine.DeliveryMode);\n const location = delivery?.Description;\n\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n if (location) {\n deliverylocation = `${location}, ${orgUnitName}`;\n } else {\n deliverylocation = `${orgUnitName}`;\n }\n } else {\n deliverylocation = props.resources.shippingText;\n }\n return deliverylocation;\n};\n\nconst _renderStoreLocation = (cartLine: CartLine | null | undefined, props: IFlyoutCartLineItemsProps): JSX.Element | null => {\n if (cartLine && cartLine.FulfillmentStoreId) {\n const orgUnitName = _getOrgUnitName(cartLine.FulfillmentStoreId, props.orgUnitLocations);\n\n if (orgUnitName) {\n return (\n
\n {orgUnitName}\n
\n );\n }\n }\n\n return null;\n};\n\nconst _getOrgUnitName = (fulfillmentStoreId: string | undefined, orgUnitLocations: OrgUnitLocation[] | undefined) => {\n if (!orgUnitLocations || !fulfillmentStoreId || orgUnitLocations.length === 0) {\n return '';\n }\n\n const foundLocation = orgUnitLocations.find(orgUnitLocation => {\n return orgUnitLocation.OrgUnitNumber === fulfillmentStoreId;\n });\n\n if (foundLocation) {\n return foundLocation.OrgUnitName;\n }\n return fulfillmentStoreId;\n};\n\nconst _assembleCartlines = (\n cartlines: CartLine[],\n products: SimpleProduct[] | undefined,\n props: IFlyoutCartLineItemsProps\n): IFlyoutCartLineItemViewProps[] | null => {\n const reactNodes: IFlyoutCartLineItemViewProps[] = [];\n\n if (!products || products.length === 0) {\n props.context.telemetry.error('Cartlines content is empty, module wont render');\n return null;\n }\n\n cartlines.map((cartline, index) => {\n let product;\n if (props.isQuantityLimitsFeatureEnabled) {\n // When feature is enabled the same products could have different quantity limits in Behavior so we need\n // to check productId and WarehouseId for identification.\n product = getProductByProductIdAndWarehouse(cartline.ProductId, products, cartline.WarehouseId, props.cartState);\n } else {\n product = getProductByProductId(cartline.ProductId, products);\n }\n let foundProductAvailability;\n if (props.productAvailabilites && props.productAvailabilites.length > 0) {\n foundProductAvailability = props.productAvailabilites.find(productAvailability => {\n return productAvailability.ProductAvailableQuantity?.ProductId! === cartline.ProductId;\n });\n }\n let foundProductDeliveryOption;\n if (props.productDeliveryOptions && props.productDeliveryOptions.length > 0) {\n foundProductDeliveryOption = props.productDeliveryOptions.find(deliveryOption => {\n return deliveryOption && deliveryOption.ProductId === cartline.ProductId;\n });\n }\n if (product) {\n reactNodes.push(\n _assembleNode(\n cartline,\n product,\n props,\n index,\n foundProductAvailability?.ProductAvailableQuantity,\n foundProductDeliveryOption\n )\n );\n }\n });\n\n return reactNodes;\n};\n\n/**\n * CartLineItems component.\n */\n\nexport const FlyoutCartLineItems = (props: IFlyoutCartLineItemsProps) => {\n const { products, cartlines } = props;\n return _assembleCartlines(cartlines, products, props);\n};\n"],"names":["cartLineItemFunctions","renderProductDimensions","product","dimensionStrings","Dimensions","map","productDimension","_productDimension$Dim","_productDimension$Dim2","_productDimension$Dim3","_productDimension$Dim4","DimensionTypeValue","ProductDimensionType","Color","React","key","RecordId","className","colorString","DimensionValue","Value","Configuration","configString","Size","sizeString","Style","IsGiftCard","amountString","styleString","renderProductUnitPrice","props","data","cartLine","Price","PriceComponent","Quantity","price","CustomerContextualPrice","context","id","typeName","currencyCode","priceCurrency","renderDiscountLines","DiscountLines","ArrayExtensions","hasElements","discountLine","index","_discountLine$OfferId","OfferId","OfferName","isSalesLine","PeriodicDiscount","EffectiveAmount","BasePrice","undefined","Percentage","discountPercent","_discountLine$Percent","updatedPercent","DiscountLineTypeValue","DiscountLineType","TenderTypeDiscount","_discountLine$Effecti","effectiveAmount","Number","toFixed","renderInventoryLabel","_props$data$availabil","_props$data$availabil2","availabilityClass","availability","IsProductAvailable","StockLevelLabel","startsWith","inventoryCssName","inventoryLabelClassName","inventoryInformationLabel","renderShippingLabel","_props$context$reques","_cartline$ChargeLines","pickupDeliveryModeCode","request","channel","PickupDeliveryModeCode","channelDeliveryOptionConfig","cartline","hasShippingMethod","_channelDeliveryOptio","DeliveryMode","PickupDeliveryModeCodes","some","deliveryMode","shippingChargeLines","ChargeLines","filter","chargeLine","IsShipping","freightFee","reduce","chargeTotal","_chargeLine$Calculate","CalculatedAmount","priceComponent","freePriceText","resources","shippingChargesText","renderOtherCharges","_cartline$ChargeLines2","_otherCharges$map","otherCharges","chargeline","otherCharge","itemIndex","String","Description","renderSalesAgreementPrompt","SalesAgreementLineRecordId","salesAgreementPricePrompt","renderConfirmedShipDate","confirmedShipDate","StringExtensions","isNullOrEmpty","confirmedShipDateLabel","CartLineItemComponent","msdyn365Commerce","createComponentOverride","_objectSpread","component","_props$context$reques2","_product$Name","_props$data$product2","_props$primaryImageUr","_props$productError","_props$productError2","productUrl","displayMode","quantity","stateQuantity","setStateQuantity","temperatureZoneIcon","TemperatureZone","getTemperatureZoneIcon","fallbackImageUrl","getFallbackImageUrl","ItemId","actionContext","requestContext","apiSettings","app","config","OmniChannelMedia","imageSettings","cropFocalRegion","payLoad","getPayloadObject","telemetryContent","toString","productAttribute","getTelemetryAttributes","productName","Name","imgeClassName","IsInvoiceLine","cartLineContentClassName","onChange","newValue","quantityOnChange","generateErrorMessage","errorMessage","badge","Badge","toLocaleLowerCase","href","role","Image","src","primaryImageUrl","fallBackSrc","altText","gridSettings","loadFailureBehavior","productError","Error","style","display","title","Object","assign","generatePrice","_props$data$product","NetAmountWithAllInclusiveTax","GrossAmount","NetAmountWithoutTax","productPrice","ProductPrice","getDiscountLines","length","getOriginalPrice","OverrideDiscountPercentage","getDiscountPercentage","originalPriceText","currentPriceText","discountPercentageSide","isOutOfStock","generateQuantity","quantityElement","isQuantityEditable","ProductListOrderQuantity","LineId","currentCount","unitConversions","allowZero","inputQuantityAriaLabel","decrementButtonAriaLabel","incrementButtonAriaLabel","disabled","isCartStateReady","min","classNames","htmlFor","quantityDisplayString","asSpan","arguments","unitOfMeasureDisplayType","DefaultUnitOfMeasure","UnitOfMeasure","simpleProduct","renderUnitOfMeasure","DiscountBadge","size","async","getMiniCartData","ctx","cartState","miniCartData","cart","CartLines","hasInvoiceLine","getActiveCartProductsAction","ActiveCartProductsInput","then","products","catch","error","telemetry","exception","getAvailabilitiesForCartLineItems","ProductAvailabilitiesForCartLineItems","availableQuantity","productAvailabilites","getDeliveryOptionsForCartLineItems","ProductDeliveryOptionsForCartLineItems","deliveryOptions","CartIcon","constructor","super","retailMultiplePickUpOptionEnabled","getSortedCartLines","cartlines","sortOrder","lines","sort","item1","item2","_item2$LineNumber","_item1$LineNumber","LineNumber","_item1$LineNumber2","_item2$LineNumber2","_getImageSettings","viewports","xs","q","w","h","sm","lg","lazyload","_removeItemFromCartHandler","cartlineToRemove","this","result","input","cartLineIds","removeCartLines","warning","debug","state","isCartValid","isQuantityLimitsFeatureEnabled","getTelemetryObject","telemetryPageName","friendlyName","payload","TelemetryEvent","CheckOut","TelemetryConstant","Checkout","checkoutBySignInAttributes","contentAction","etext","GuestCheckout","checkoutByGuestAttributes","ViewShoppingBag","viewShoppingBagAttributes","_this$props$data$orgU","reaction","_this$props$data$cart","setState","_setQuantityLimitsFeatureFlag","orgUnitLocations","_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","EmailDeliveryModeCode","cartLines","_getCartLines","validInventoryAcrossCartLines","validateCartLinesInventory","hasError","isValid","includeFlyout","status","totalItemsInCart","goToCartButtonText","goToCartButtonTitle","replace","flyoutTitle","flyoutTooltip","tag","UncontrolledTooltip","placement","hideArrow","trigger","target","shouldShowCloseButton","cartPageUrl","hideAriaHidden","TotalAmount","priceString","totalPriceFormatString","cultureFormatter","formatCurrency","featureState","find","feature","IsEnabled","viewProps","cartIcon","CartIconComponent","cartLabel","cartQtyLabel","FlyoutContainer","CartlinesWrapper","miniCartWrapper","classnames","miniCartItemWrapper","checkoutAsSignInUserButton","Button","checkoutButtonTitle","checkoutAsGuestButton","guestCheckoutButtonTitle","goToCartButton","checkoutBlockedDueToUnavailableFunds","totalPrice","renderView","_cart$result$cart$Ver","_cart$result","cartVersion","Version","lastValidatedCartVersion","validateCartAsync","ValidationResultsPairs","isAbsoluteUrl","urlCheck","returnURL","isBrowser","window","location","origin","includes","_this$props$data$cata","FlyoutCartLineItems","cartLinesSortOrder","productDeliveryOptions","outOfStockThreshold","isStockCheckEnabled","enableStockCheck","maxCartlineQuantity","updateMaxQuantityForCartLineItem","maxQuantityForCartLineItem","productDimensionTypeSize","productDimensionTypeColor","productDimensionTypeConfiguration","productDimensionTypeStyle","quantityDisplayText","discountStringText","shippingText","removeButtonText","removeCartButtonText","outOfStockText","outOfRangeOneText","outOfRangeFormatText","removeItemClickHandler","catalogs","_featureStatuses$find","_featureStatuses$find2","featureStatuses","_this$props$context","defaultOrderQuantityLimitsFeatureConfig","platform","enableDefaultOrderQuantityLimits","_featureStatuses$find3","customerInformation","customerInfo","IsB2b","_cartConfiguration$Ig","cartConfiguration","IgnoreOrderSettings","__decorate","observer","_renderDeliveryLocation","deliverylocation","FulfillmentStoreId","_foundProductDelivery","orgUnitName","_getOrgUnitName","foundProductDeliveryOption","deliveryOption","ProductId","delivery","DeliveryOptions","option","Code","_renderStoreLocation","fulfillmentStoreId","foundLocation","orgUnitLocation","OrgUnitNumber","OrgUnitName","_assembleCartlines","reactNodes","foundProductAvailability","_foundProductAvailabi","getProductByProductIdAndWarehouse","WarehouseId","getProductByProductId","productAvailability","_productAvailability$","ProductAvailableQuantity","push","_assembleNode","foundProductDeliveryOptions","_product$Behavior","availableQuantityInStock","AvailableQuantity","_getCartItemAvailableQuantity","maxQuantity","_getCartItemMaxQuantity","maxQuantityByConfig","maxByQuantityLimitsFeature","maxByQuantityLimitsFeatureResult","Behavior","MaximumQuantity","isServiceItem","ItemTypeValue","ReleasedProductType","Service","onRemoveClickHandler","onRemoveClickFunction","RemoveCartItem","removeCartItemAttribute","getProductUrlSync","MsDyn365","isChannelTypeB2B","_cartline$CatalogId","fullUrl","URL","searchParams","set","CatalogId","currentQuantity","PrimaryImageUrl","deliveryLocation","remove","onClick","storeLocation"],"sourceRoot":""}