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AAuBF,EAAMG,eAC7Cye,GAlJ0Bze,EAkJ6BH,EAAMG,gBAjJ9CA,EAAcye,uBAA0B,EAkJvDpa,GAA4BpD,GAAe,GAAKyC,EAAiBzD,EAAgBwe,EAEnFxe,EAAgB,IAChB6C,EAAWwB,QAAU1E,EAA0BC,GAAQI,EAAe,UAAWJ,EAAM0E,cAAgB,mBAGvGb,EAAiB,IACjBZ,EAAWiB,SAAWnE,EAA0BC,GAAQ6D,EAAgB,YAAa7D,EAAM2E,eAAiB,qBAG5Gia,EAAwB,IACxB3b,EAAW4b,gBAAkB9e,EACzBC,GACC4e,EACD,yBACA5e,EAAM8e,sBAAwB,2BAItC7b,EAAWM,WAAaxD,EAA0B,EAAD,KACxCC,GADwC,IACjCT,cAAUiD,IACtBgC,EACA,QACAxE,EAAMwD,iBA1KsBrD,IAAAA,EAkLpC,OAJI+K,EAAiB,IACjBjI,EAAW2B,eAAiB7E,EAA0BC,GAAQkL,EAAgB,kBAAmBlL,EAAM6E,sBAGpG5B","sources":["webpack://Msdyn365.Commerce.Online/./src/modules/dyn-cart/utilities/dyn-order-summary-lineitem.tsx?013f","webpack://Msdyn365.Commerce.Online/./src/themes/dyn-tebutheme/views/components/cartlineitem.component.tsx?bce6","webpack://Msdyn365.Commerce.Online/./src/validate-cart.ts?cd50","webpack://Msdyn365.Commerce.Online/./src/Common/get-product.ts?0a21","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","webpack://Msdyn365.Commerce.Online/./src/invoice-summary-lineitem.tsx?5f61","webpack://Msdyn365.Commerce.Online/./src/order-summary-lineitem.tsx?8a98"],"sourcesContent":["/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { PriceComponent } from '@msdyn365-commerce/components';\r\nimport { ICoreContext, ITelemetry } from '@msdyn365-commerce/core';\r\nimport { ICheckoutState, IGiftCardExtend } from '@msdyn365-commerce/global-state';\r\nimport { Cart, ChannelConfiguration, ChannelDeliveryOptionConfiguration } from '@msdyn365-commerce/retail-proxy';\r\nimport * as React from 'react';\r\n\r\nexport interface IOrderSummaryProps {\r\n subTotalLabel: string;\r\n shippingLabel: string;\r\n taxLabel: string;\r\n orderTotalLabel: string;\r\n loyaltyLabel?: string;\r\n giftcardLabel?: string;\r\n totalDiscountsLabel: string;\r\n context: ICoreContext;\r\n telemetry: ITelemetry;\r\n cart: Cart;\r\n channelConfiguration: ChannelConfiguration;\r\n id: string;\r\n typeName: string;\r\n otherChargeLabel?: string;\r\n freeText?: string;\r\n toBeCalculatedText?: string;\r\n checkoutState?: ICheckoutState;\r\n retailMultiplePickUpOptionEnabled?: boolean;\r\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n isTaxIncludedInPrice?: boolean;\r\n isShowTaxBreakup?: boolean;\r\n}\r\n\r\nexport interface IDynOrderSummaryLines {\r\n netTotal: React.ReactNode;\r\n subtotal: React.ReactNode;\r\n shipping?: React.ReactNode;\r\n otherCharge?: React.ReactNode;\r\n tax: React.ReactNode;\r\n orderTotal: React.ReactNode;\r\n totalDiscounts?: React.ReactNode;\r\n giftCard?: React.ReactNode;\r\n loyalty?: React.ReactNode;\r\n}\r\n\r\ninterface IOrderSummaryLineProps {\r\n label: string;\r\n context: ICoreContext;\r\n telemetry: ITelemetry;\r\n price?: number;\r\n freeText?: string;\r\n toBeCalculatedText?: string;\r\n id: string;\r\n typeName: string;\r\n cssLabel: string;\r\n}\r\n\r\ninterface IShippingOrderLine {\r\n cart: Cart;\r\n channelConfiguration: ChannelConfiguration;\r\n canShip?: boolean;\r\n hasDeliveryMethod?: boolean;\r\n hasShippingMethod?: boolean;\r\n freightFee?: number;\r\n}\r\n\r\nconst OrderSummaryLine: React.FC = ({\r\n price,\r\n label,\r\n context,\r\n id,\r\n typeName,\r\n toBeCalculatedText,\r\n freeText,\r\n cssLabel\r\n}) => {\r\n return (\r\n

\r\n {label}\r\n {price || price === 0 ? (\r\n \r\n ) : (\r\n {toBeCalculatedText}\r\n )}\r\n

\r\n );\r\n};\r\n\r\nconst _buildOrderSummarySection = (\r\n props: IOrderSummaryProps,\r\n price: number | undefined,\r\n cssLabel: string,\r\n label: string = ''\r\n): React.ReactNode => {\r\n return (\r\n \r\n );\r\n};\r\n\r\nconst _computedLoyaltyAmount = (checkoutState: ICheckoutState): number => {\r\n return (checkoutState && checkoutState.loyaltyAmount) || 0;\r\n};\r\n\r\nconst _computeGiftCardAmount = (checkoutState: ICheckoutState, cart: Cart): number => {\r\n const giftCardCounter = (count: number, giftCard: IGiftCardExtend) => {\r\n return count + (giftCard.Balance || 0);\r\n };\r\n const giftCardTotalValue = (checkoutState.giftCardExtends || []).reduce(giftCardCounter, 0);\r\n const amount = (cart.TotalAmount || 0) - _computedLoyaltyAmount(checkoutState);\r\n return Math.min(giftCardTotalValue, amount);\r\n};\r\n\r\nconst getDeliveryConfiguration = (\r\n cart: Cart,\r\n channelConfiguration: ChannelConfiguration,\r\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration,\r\n retailMultiplePickUpOptionEnabled?: boolean,\r\n isTaxIncludedInPrice?: boolean,\r\n isShowTaxBreakup?: boolean\r\n): IShippingOrderLine => {\r\n const pickupDeliveryModeCode = channelConfiguration && channelConfiguration.PickupDeliveryModeCode;\r\n const emailDeliveryModeCode = channelConfiguration && channelConfiguration.EmailDeliveryModeCode;\r\n const cartLines = cart.CartLines || [];\r\n const deliveryModes = cartLines.map(cartLine => cartLine.DeliveryMode);\r\n //const taxOnShippingCharge = cart.TaxOnShippingCharge !== undefined ? cart.TaxOnShippingCharge : 0;\r\n const shippingChargeAmount = cart.ShippingChargeAmount !== undefined ? cart.ShippingChargeAmount : 0;\r\n\r\n const freightFee = shippingChargeAmount; //isTaxIncludedInPrice && isShowTaxBreakup ? cart.ShippingChargeAmount : shippingChargeAmount + taxOnShippingCharge;\r\n\r\n const canShip = deliveryModes.some(\r\n deliveryMode =>\r\n !(\r\n deliveryMode !== '' &&\r\n (deliveryMode ===\r\n getDeliveryMode(deliveryMode, retailMultiplePickUpOptionEnabled, channelDeliveryOptionConfig, pickupDeliveryModeCode) ||\r\n deliveryMode === emailDeliveryModeCode)\r\n )\r\n );\r\n const hasDeliveryMethod = deliveryModes.some(deliveryMode => !!deliveryMode && deliveryMode !== emailDeliveryModeCode);\r\n const hasShippingMethod = deliveryModes.some(\r\n deliveryMode =>\r\n !!deliveryMode &&\r\n deliveryMode !==\r\n getDeliveryMode(deliveryMode, retailMultiplePickUpOptionEnabled, channelDeliveryOptionConfig, pickupDeliveryModeCode) &&\r\n deliveryMode !== emailDeliveryModeCode\r\n );\r\n return {\r\n canShip,\r\n hasDeliveryMethod,\r\n hasShippingMethod,\r\n freightFee\r\n } as IShippingOrderLine;\r\n};\r\n\r\nconst getDeliveryMode = (\r\n deliveryMode?: string,\r\n featureSate: boolean = false,\r\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration,\r\n pickupDeliveryMode?: string\r\n) => {\r\n if (!featureSate) {\r\n return pickupDeliveryMode;\r\n }\r\n return channelDeliveryOptionConfig?.PickupDeliveryModeCodes?.find(dM => dM === deliveryMode);\r\n};\r\n\r\nexport const DynOrderSummary = (props: IOrderSummaryProps) => {\r\n const {\r\n NetPrice, // Total w/o discounts and w/o VAT\r\n SubtotalAmount, // Subtotal Amount with discounts and w/o VAT\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Existing Property.\r\n SubtotalAmountWithoutTax,\r\n TaxAmount,\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Existing Property.\r\n TaxOnNonShippingCharges,\r\n DiscountAmountWithoutTax = 0,\r\n TotalAmount,\r\n OtherChargeAmount\r\n } = props.cart;\r\n\r\n const { canShip, hasDeliveryMethod, hasShippingMethod, freightFee } = getDeliveryConfiguration(\r\n props.cart,\r\n props.channelConfiguration,\r\n props.channelDeliveryOptionConfig,\r\n props.retailMultiplePickUpOptionEnabled,\r\n props.isTaxIncludedInPrice,\r\n props.isShowTaxBreakup\r\n );\r\n\r\n const otherChargeAmount = OtherChargeAmount !== undefined ? OtherChargeAmount : 0;\r\n const otherShippingChargeAmount = TaxOnNonShippingCharges !== undefined ? TaxOnNonShippingCharges : 0;\r\n const isTaxGreaterThanZero = TaxAmount !== undefined && TaxAmount > 0;\r\n\r\n const otherChargeAmountTotal =\r\n props.isTaxIncludedInPrice && props.isShowTaxBreakup ? otherChargeAmount : otherChargeAmount + otherShippingChargeAmount;\r\n\r\n const subtotalAmountActual = props.isTaxIncludedInPrice && props.isShowTaxBreakup ? SubtotalAmountWithoutTax : SubtotalAmount;\r\n\r\n const reactNodes: IDynOrderSummaryLines = {\r\n netTotal: _buildOrderSummarySection(props, NetPrice, 'net-total', 'Initial Amount'), //// Total w/o discounts and w/o discounts\r\n subtotal: _buildOrderSummarySection(props, subtotalAmountActual, 'sub-total', props.subTotalLabel),\r\n // tax: props.isShowTaxBreakup\r\n // ? _buildOrderSummarySection(\r\n // props,\r\n // hasDeliveryMethod || isTaxGreaterThanZero ? TaxAmount : undefined,\r\n // 'tax-amount',\r\n // props.taxLabel\r\n // )\r\n // : '',\r\n tax: _buildOrderSummarySection(\r\n props,\r\n hasDeliveryMethod || isTaxGreaterThanZero ? TaxAmount : undefined,\r\n 'tax-amount',\r\n props.taxLabel\r\n ),\r\n orderTotal: _buildOrderSummarySection(props, TotalAmount, 'total', props.orderTotalLabel),\r\n otherCharge:\r\n (OtherChargeAmount && _buildOrderSummarySection(props, otherChargeAmountTotal, 'other-charges', props.otherChargeLabel)) ||\r\n undefined\r\n };\r\n\r\n if (canShip) {\r\n reactNodes.shipping = _buildOrderSummarySection(props, hasShippingMethod ? freightFee : undefined, 'shipping', props.shippingLabel);\r\n }\r\n if (props.checkoutState) {\r\n const giftCardAmount = _computeGiftCardAmount(props.checkoutState, props.cart);\r\n const loyaltyAmount = _computedLoyaltyAmount(props.checkoutState);\r\n const totalAmountAfterGiftCard = (TotalAmount || 0) - giftCardAmount - loyaltyAmount;\r\n\r\n if (loyaltyAmount > 0) {\r\n reactNodes.loyalty = _buildOrderSummarySection(props, -loyaltyAmount, 'loyalty', props.loyaltyLabel || 'Loyalty amount');\r\n }\r\n\r\n if (giftCardAmount > 0) {\r\n reactNodes.giftCard = _buildOrderSummarySection(props, -giftCardAmount, 'gift-card', props.giftcardLabel || 'Gift card amount');\r\n }\r\n\r\n reactNodes.orderTotal = _buildOrderSummarySection(\r\n { ...props, freeText: undefined },\r\n totalAmountAfterGiftCard,\r\n 'total',\r\n props.orderTotalLabel\r\n );\r\n }\r\n\r\n if (DiscountAmountWithoutTax > 0) {\r\n reactNodes.totalDiscounts = _buildOrderSummarySection(\r\n props,\r\n -DiscountAmountWithoutTax,\r\n 'total-discounts',\r\n props.totalDiscountsLabel\r\n );\r\n }\r\n\r\n return reactNodes;\r\n};\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { PriceComponent } from '@msdyn365-commerce/components';\r\nimport { IComponentProps, IGridSettings, IImageSettings, msdyn365Commerce } from '@msdyn365-commerce/core'; //Image\r\nimport { ChannelDeliveryOptionConfiguration, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { CartLine, DiscountLine, DiscountLineType, SalesLine } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n//import { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions'; //getFallbackImageUrl\r\nimport { getPayloadObject, getTelemetryAttributes, IncrementalQuantity, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport classNames from 'classnames';\r\nimport * as React from 'react';\r\nimport { ICartLinePriceEditorResources } from '@msdyn365-commerce/components';\r\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy';\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 screen reader.\r\n */\r\n originalPriceText: string;\r\n\r\n /**\r\n * Current text screen reader.\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 priceEditorResources?: ICartLinePriceEditorResources;\r\n}\r\n\r\ninterface ICartLineData {\r\n cartLine: CartLine | SalesLine;\r\n product?: SimpleProduct;\r\n productSpecificationData?: AttributeValue[] | null;\r\n}\r\n\r\n/**\r\n * ICartLineProps: The props required to render cartLineitem.\r\n */\r\nexport interface ICartLineProps extends IComponentProps {\r\n /** The flag to change the quantity component from interactible to static */\r\n disableQuantityInteractivity?: boolean;\r\n\r\n /** The primary image url */\r\n primaryImageUrl?: string;\r\n\r\n /** The product url */\r\n productUrl?: string;\r\n\r\n /** GridSettings for the product image in cartLine */\r\n gridSettings: IGridSettings;\r\n\r\n /** ImageSettings for the product image in cartLine */\r\n imageSettings: IImageSettings;\r\n\r\n /** Boolean flag to indicate if the item is out of stock */\r\n isOutOfStock?: boolean;\r\n\r\n /** Flag to make quantity section editable */\r\n isQuantityEditable?: boolean;\r\n\r\n /** Max quantity for line item */\r\n maxQuantity?: number;\r\n\r\n /** Current quantity for line item */\r\n currentQuantity?: number;\r\n\r\n /** Resource string for the component */\r\n resources: ICartlineResourceString;\r\n\r\n /** SalesLine flag */\r\n isSalesLine?: boolean;\r\n\r\n /** Error message to show in place of quantity */\r\n errorMessage?: string;\r\n\r\n /** Inventory information label */\r\n inventoryInformationLabel?: string;\r\n\r\n /** Inventory information class name */\r\n inventoryLabelClassName?: string;\r\n\r\n /** Flag to show/hide shipping charges for line items */\r\n showShippingChargesForLineItems?: boolean;\r\n\r\n /** Boolean flag to indicate if cart state status is ready */\r\n isCartStateReady?: boolean;\r\n\r\n /** Chanel Delivery Option configuration is from api. */\r\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n\r\n /** The telemetry content */\r\n telemetryContent?: ITelemetryContent;\r\n\r\n /**\r\n * The cart line index.\r\n */\r\n lineIndex?: number;\r\n\r\n /** Quantity onChange callback */\r\n quantityOnChange?(cartLine: CartLine, newQuantity: number): boolean;\r\n}\r\n\r\ninterface IDimensionStrings {\r\n /** String for size key */\r\n sizeString: string;\r\n\r\n /** String for color key */\r\n colorString: string;\r\n\r\n /** String associated with the configuration product dimension */\r\n configString: string;\r\n\r\n /** String for style key */\r\n styleString: string;\r\n\r\n /** String for amount key */\r\n amountString?: string;\r\n}\r\n\r\nconst CartLineItemFunctions = {\r\n renderProductDimensions: (Product: SimpleProduct, DimensionStrings: IDimensionStrings) => {\r\n if (!Product || !Product.Dimensions) {\r\n return [];\r\n }\r\n\r\n return Product.Dimensions.map(productDimension => {\r\n if (productDimension.DimensionTypeValue === 1) {\r\n return (\r\n
\r\n \r\n {DimensionStrings.colorString}:\r\n {productDimension.DimensionValue && productDimension.DimensionValue.Value}\r\n \r\n
\r\n );\r\n }\r\n\r\n if (productDimension.DimensionTypeValue === 2) {\r\n return (\r\n
\r\n \r\n {DimensionStrings.configString}:\r\n {productDimension.DimensionValue && productDimension.DimensionValue.Value}\r\n \r\n
\r\n );\r\n }\r\n\r\n if (productDimension.DimensionTypeValue === 3) {\r\n return (\r\n
\r\n \r\n {DimensionStrings.sizeString}:\r\n {productDimension.DimensionValue && productDimension.DimensionValue.Value}\r\n \r\n
\r\n );\r\n }\r\n\r\n if (productDimension.DimensionTypeValue === 4) {\r\n return (\r\n
\r\n \r\n {Product.IsGiftCard ? DimensionStrings.amountString : DimensionStrings.styleString}:\r\n {productDimension.DimensionValue && productDimension.DimensionValue.Value}\r\n \r\n
\r\n );\r\n }\r\n return null;\r\n });\r\n },\r\n\r\n renderDiscountLines: (props: ICartLineProps) => {\r\n if (!props.data.cartLine.DiscountLines || props.data.cartLine.DiscountLines.length === 0) {\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 \r\n {` ${\r\n discountLine.Percentage !== undefined ? discountPercent(discountLine, props.data.cartLine) : ''\r\n }% discount : savings `}\r\n \r\n {/* \r\n { {discountLine.OfferName ? discountLine.OfferName : ''} }\r\n :\r\n { {` ${props.resources.discountStringText || 'Discount'} `} }\r\n */}\r\n \r\n \r\n \r\n
\r\n );\r\n });\r\n },\r\n renderInventoryLabel: (props: ICartLineProps) => {\r\n if (!props.inventoryInformationLabel) {\r\n return null;\r\n }\r\n const inventoryCssName = props.inventoryLabelClassName\r\n ? `msc-cart-line__product-inventory-label ${props.inventoryLabelClassName}`\r\n : 'msc-cart-line__product-inventory-label';\r\n return {props.inventoryInformationLabel};\r\n },\r\n\r\n /**\r\n * Gets the react node for product unit of measure display.\r\n * @param props - Icartline props.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n renderUnitOfMeasure: (props: ICartLineProps) => {\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 const product = props.data.product;\r\n if (!product || !product.DefaultUnitOfMeasure) {\r\n return undefined;\r\n }\r\n\r\n return (\r\n
\r\n {product.DefaultUnitOfMeasure}\r\n
\r\n );\r\n },\r\n 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 (shippingChargeLines.length === 0) {\r\n return undefined;\r\n }\r\n\r\n const freightFee = shippingChargeLines.reduce((chargeTotal, chargeLine) => {\r\n return chargeTotal + (chargeLine.CalculatedAmount || 0);\r\n }, 0);\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 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 &&\r\n otherCharges.map((otherCharge, key) => {\r\n return otherCharge && otherCharge.CalculatedAmount ? (\r\n
\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\nconst CartLine: React.FC = (props: ICartLineProps) => {\r\n const { isSalesLine, productUrl, resources } = props;\r\n const { product, productSpecificationData, cartLine } = props.data;\r\n\r\n const destructDimensionStrings = {\r\n sizeString: resources.sizeString,\r\n colorString: resources.colorString,\r\n styleString: resources.styleString,\r\n configString: resources.configString,\r\n amountString: resources.amountString\r\n };\r\n\r\n //const fallbackImageUrl = product && getFallbackImageUrl(product.ItemId, props.context.actionContext.requestContext.apiSettings);\r\n //const productDimensions = product && CartLineItemFunctions.renderProductDimensions(product, destructDimensionStrings);\r\n const imageSettings = props.imageSettings;\r\n if (imageSettings) {\r\n imageSettings.cropFocalRegion = true;\r\n }\r\n const renderDisountLines = CartLineItemFunctions.renderDiscountLines(props);\r\n const renderInventoryLabel = CartLineItemFunctions.renderInventoryLabel(props);\r\n const renderUnitOfMeasure = CartLineItemFunctions.renderUnitOfMeasure(props);\r\n const renderShippingLabel = CartLineItemFunctions.renderShippingLabel(props);\r\n const renderOtherCharges = CartLineItemFunctions.renderOtherCharges(props);\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, '', product?.RecordId.toString());\r\n const prodAttribute = 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\r\n let externalItemID = '';\r\n if (productSpecificationData) {\r\n externalItemID =\r\n productSpecificationData\r\n .find(attribute => attribute.Name === 'External Item Id' || attribute.Name === 'ERP_ExternalItemID')\r\n ?.TextValue?.toString() ??\r\n productSpecificationData.find(attribute => attribute.Name === 'Catalog Number')?.TextValue?.toString() ??\r\n '';\r\n }\r\n\r\n // let sizeDescription = '';\r\n // if (productSpecificationData) {\r\n // sizeDescription = productSpecificationData.find(attribute => attribute.Name === 'Description')?.TextValue?.toString() ?? '';\r\n // }\r\n const sizeDescription = product?.Description;\r\n\r\n const onChange = (newValue: number): boolean => {\r\n if (props.quantityOnChange) {\r\n return props.quantityOnChange(props.data.cartLine, newValue);\r\n }\r\n return true;\r\n };\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 const _generateQuantityandPrice = (): JSX.Element[] | null => {\r\n const nodes = [];\r\n if (props.isOutOfStock) {\r\n const errorMessage = _generateErrorMessage();\r\n\r\n if (errorMessage) {\r\n return [errorMessage];\r\n }\r\n\r\n return null;\r\n }\r\n\r\n nodes.push(\r\n
\r\n \r\n {(props.data.cartLine.DiscountAmount && props.data.cartLine.DiscountAmount > 0 && (\r\n <>\r\n \r\n {` ${props.resources.discountStringText || 'Discount'} `}\r\n \r\n \r\n \r\n )) ||\r\n null}\r\n
\r\n );\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 nodes.push(\r\n
\r\n
{resources.quantityDisplayString}
\r\n\r\n {_generateErrorMessage()}\r\n\r\n \r\n
\r\n );\r\n } else {\r\n nodes.push(\r\n
\r\n \r\n\r\n {_generateErrorMessage()}\r\n\r\n {props.data.cartLine.Quantity}\r\n
\r\n );\r\n }\r\n }\r\n\r\n return nodes;\r\n };\r\n\r\n return (\r\n
\r\n
\r\n \r\n {/* */}\r\n
\r\n
\r\n
\r\n \r\n {productName}\r\n \r\n
\r\n {externalItemID ? Ref : : ''}\r\n {externalItemID}\r\n
\r\n {/* {ArrayExtensions.hasElements(productDimensions) ? (\r\n
{productDimensions}
\r\n ) : (\r\n ''\r\n )} */}\r\n
\r\n \r\n {sizeDescription ? (\r\n <>\r\n {destructDimensionStrings.sizeString}:{sizeDescription}\r\n \r\n ) : (\r\n ''\r\n )}\r\n \r\n
\r\n {renderUnitOfMeasure}\r\n
\r\n \r\n
\r\n {renderDisountLines}\r\n {renderInventoryLabel}\r\n {props.showShippingChargesForLineItems &&
{renderShippingLabel}
}\r\n {renderOtherCharges}\r\n
\r\n
{_generateQuantityandPrice()}
\r\n
\r\n
\r\n );\r\n};\r\n\r\n// @ts-expect-error\r\nexport const TebuCartLineItemComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride(\r\n 'CartLineItem',\r\n { component: CartLine, ...CartLineItemFunctions }\r\n);\r\n\r\nexport default CartLine;\r\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICoreContext } from '@msdyn365-commerce/core';\nimport { ICartActionResult, ICartState } from '@msdyn365-commerce/global-state';\nimport {\n AsyncResult,\n CartLine,\n CartLineValidationResults,\n CartLineValidationResultsByLineId,\n CartsDataActions,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy';\n\nimport { ITelemetry } from '@msdyn365-commerce/telemetry-internal';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Validate the cart.\n * @param isQuantityLimitsFeatureEnabled -- Is the quantity limits feature enabled.\n * @param cart -- The cart state to validate.\n * @param telemetry -- The telemetry.\n * @param propsContext -- The props context.\n * @param shouldRetry -- Should retry.\n * @returns A list of line data validation failures.\n */\nexport async function validateCartAsync(\n cart: AsyncResult,\n telemetry: ITelemetry,\n propsContext: ICoreContext,\n shouldRetry: boolean = true\n): Promise {\n let cartResult: ICartState;\n let cartVersion: number | undefined;\n try {\n cartResult = await cart;\n cartVersion = cartResult.cart.Version;\n } catch (error) {\n telemetry.warning(error);\n telemetry.debug('Unable to get cart or cart version.');\n return AsyncResult.resolve();\n }\n\n if (cartVersion) {\n try {\n const validationResult: CartLineValidationResults = await CartsDataActions.validateForCheckoutAsync(\n { callerContext: propsContext.actionContext, bypassCache: 'none' },\n cartResult.cart.Id,\n cartVersion\n );\n\n return await AsyncResult.resolve(validationResult.ValidationResultsByLineId ?? undefined);\n } catch (error) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- error type is not defined.\n if (shouldRetry && error.name === 'Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion') {\n try {\n await cartResult.refreshCart({});\n } catch (refreshError) {\n telemetry.warning(refreshError);\n telemetry.debug('Unable to refresh Cart');\n return AsyncResult.resolve();\n }\n try {\n await validateCartAsync(cart, telemetry, propsContext, false);\n return AsyncResult.resolve();\n } catch (validateError) {\n telemetry.warning(validateError);\n telemetry.debug('Unable to validate Cart');\n return AsyncResult.resolve();\n }\n }\n\n telemetry.warning(error);\n telemetry.debug('Unable to validate Cart');\n return AsyncResult.resolve();\n }\n } else {\n telemetry.warning('Cart version not found for Cart validation request.');\n return AsyncResult.resolve();\n }\n}\n\n/**\n * Check if cart line quantity update is success.\n * @param isQuantityLimitsFeatureEnabled -- Is quantity limits feature enabled.\n * @param cartResult -- The cart result.\n * @param telemetry -- The telemetry.\n * @param products -- The products.\n * @param cartLineToUpdate -- The cart line to update.\n * @param quantity -- The quantity.\n * @returns Boolean to indicate if the cart line quantity is updated.\n */\nexport async function isCartLineQuantityUpdatedAsync(\n isQuantityLimitsFeatureEnabled: boolean | undefined,\n cartResult: ICartState | undefined,\n telemetry: ITelemetry,\n products: SimpleProduct[] | undefined,\n cartLineToUpdate: CartLine,\n quantity: number\n): Promise {\n if (cartResult) {\n let isUsingDefaultOrderSettingsMax: boolean = false;\n if (ArrayExtensions.hasElements(products) && isQuantityLimitsFeatureEnabled) {\n const modifiedProduct: SimpleProduct | undefined = products.find(\n (product: SimpleProduct) => product.RecordId === cartLineToUpdate.ProductId\n );\n isUsingDefaultOrderSettingsMax = !!modifiedProduct && !!modifiedProduct.Behavior?.MaximumQuantity;\n } else {\n isUsingDefaultOrderSettingsMax = false;\n }\n\n const input = {\n cartLineId: cartLineToUpdate.LineId!.toString(),\n newQuantity: quantity,\n additionalProperties: { isUsingDefaultOrderSettingsMax }\n };\n\n try {\n const updateLineResult: ICartActionResult = await cartResult.updateCartLineQuantity(input);\n return await AsyncResult.resolve(updateLineResult.status === 'SUCCESS');\n } catch (error) {\n telemetry.warning((error as Error).message);\n telemetry.debug('Unable to update Cart Line quantity');\n }\n }\n\n return AsyncResult.resolve(false);\n}\n\n/**\n * Update cart line with cart action result.\n * @param isQuantityLimitsFeatureEnabled -- Is quantity limits feature enabled.\n * @param cartResult -- The cart result.\n * @param telemetry -- The telemetry.\n * @param products -- The products.\n * @param cartLineToUpdate -- The cart line to update.\n * @param quantity -- The quantity.\n * @returns Boolean to indicate if the cart line quantity is updated.\n */\nexport async function cartLineQuantityUpdatedAsync(\n isQuantityLimitsFeatureEnabled: boolean | undefined,\n cartResult: ICartState | undefined,\n telemetry: ITelemetry,\n products: SimpleProduct[] | undefined,\n cartLineToUpdate: CartLine,\n quantity: number\n): Promise {\n if (cartResult) {\n let isUsingDefaultOrderSettingsMax: boolean = false;\n if (ArrayExtensions.hasElements(products) && isQuantityLimitsFeatureEnabled) {\n const modifiedProduct: SimpleProduct | undefined = products.find(\n (product: SimpleProduct) => product.RecordId === cartLineToUpdate.ProductId\n );\n isUsingDefaultOrderSettingsMax = !!modifiedProduct && !!modifiedProduct.Behavior?.MaximumQuantity;\n } else {\n isUsingDefaultOrderSettingsMax = false;\n }\n\n const input = {\n cartLineId: cartLineToUpdate.LineId!.toString(),\n newQuantity: quantity,\n additionalProperties: { isUsingDefaultOrderSettingsMax }\n };\n\n try {\n const updateLineResult: ICartActionResult = await cartResult.updateCartLineQuantity(input);\n return await AsyncResult.resolve(updateLineResult);\n } catch (error) {\n telemetry.warning((error as Error).message);\n telemetry.debug('Unable to update Cart Line quantity');\n }\n }\n\n return AsyncResult.resolve();\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Find the product in array of products considering product id.\n * @param productId - The searched product id.\n * @param products - The array of products in which search is executed.\n * @returns - The found product.\n */\nexport function getProductByProductId(productId: number | undefined, products?: SimpleProduct[]): SimpleProduct | undefined {\n if (productId !== undefined && ArrayExtensions.hasElements(products)) {\n return products.find(product => {\n return productId === product.RecordId;\n });\n }\n\n return undefined;\n}\n\n/**\n * Find the product in array of products considering product id and product behavior's warehouse.\n * @param productId - The searched product id.\n * @param products - The array of products in which search is executed.\n * @param warehouseId - Warehouse id of cartLine.\n * @param cartState - The cart start in case cart line has no warehouse.\n * @returns - The found product.\n */\nexport function getProductByProductIdAndWarehouse(\n productId: number | undefined,\n products?: SimpleProduct[],\n warehouseId?: string,\n cartState?: ICartState\n): SimpleProduct | undefined {\n const targetWarehouseValue = warehouseId ?? cartState?.cart.WarehouseId;\n\n if (productId !== undefined && ArrayExtensions.hasElements(products)) {\n return products.find(product => {\n return productId === product.RecordId && product.Behavior?.InventoryLocationId === targetWarehouseValue;\n });\n }\n\n return undefined;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { 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 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 }\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","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { PriceComponent } from '@msdyn365-commerce/components';\nimport { ICoreContext, ITelemetry } from '@msdyn365-commerce/core';\nimport { ICheckoutState, IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport { Cart, CartLine } from '@msdyn365-commerce/retail-proxy';\nimport { format } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IInvoiceSummaryProps {\n orderTotalLabel: string;\n invoiceLabel: string;\n loyaltyLabel?: string;\n giftcardLabel?: string;\n context: ICoreContext;\n telemetry: ITelemetry;\n cart: Cart;\n id: string;\n typeName: string;\n freeText?: string;\n toBeCalculatedText?: string;\n checkoutState?: ICheckoutState;\n}\n\nexport interface IInvoiceSummaryLines {\n orderTotal: React.ReactNode;\n invoices: React.ReactNode;\n giftCard?: React.ReactNode;\n loyalty?: React.ReactNode;\n}\n\ninterface IInvoiceSummaryLineProps {\n label: string;\n context: ICoreContext;\n telemetry: ITelemetry;\n price?: number;\n freeText?: string;\n toBeCalculatedText?: string;\n id: string;\n typeName: string;\n cssLabel: string;\n}\n\nconst InvoiceSummaryLine: React.FC = ({\n price,\n label,\n context,\n id,\n typeName,\n toBeCalculatedText,\n freeText,\n cssLabel\n}) => {\n return (\n

\n {label}\n {price || price === 0 ? (\n \n ) : (\n {toBeCalculatedText}\n )}\n

\n );\n};\n\nconst _buildPaymentSummarySection = (\n props: IInvoiceSummaryProps,\n price: number | undefined,\n label: string,\n cssLabel: string\n): React.ReactNode => {\n return (\n \n );\n};\n\nconst _computedLoyaltyAmount = (checkoutState: ICheckoutState): number => {\n return (checkoutState && checkoutState.loyaltyAmount) || 0;\n};\n\nconst _computeGiftCardAmount = (checkoutState: ICheckoutState, cart: Cart): number => {\n const giftCardCounter = (count: number, giftCard: IGiftCardExtend) => {\n return count + (giftCard.Balance || 0);\n };\n const giftCardTotalValue = (checkoutState.giftCardExtends || []).reduce(giftCardCounter, 0);\n const amount = (cart.TotalAmount || 0) - _computedLoyaltyAmount(checkoutState);\n return Math.min(giftCardTotalValue, amount);\n};\n\nexport const InvoiceSummary = (props: IInvoiceSummaryProps) => {\n const { TotalAmount, CartLines } = props.cart;\n const invoiceLines = CartLines?.filter(cartLine => cartLine.IsInvoiceLine);\n const reactNodes: IInvoiceSummaryLines = {\n invoices: invoiceLines?.map((invoiceLine: CartLine) => {\n return _buildPaymentSummarySection(\n props,\n invoiceLine.InvoiceAmount,\n format(props.invoiceLabel, invoiceLine.InvoiceId),\n 'invoice'\n );\n }),\n orderTotal: _buildPaymentSummarySection(props, TotalAmount, props.orderTotalLabel, 'total')\n };\n\n if (props.checkoutState) {\n const giftCardAmount = _computeGiftCardAmount(props.checkoutState, props.cart);\n const loyaltyAmount = _computedLoyaltyAmount(props.checkoutState);\n const totalAmountAfterGiftCard = (TotalAmount || 0) - giftCardAmount - loyaltyAmount;\n\n if (loyaltyAmount > 0) {\n reactNodes.loyalty = _buildPaymentSummarySection(props, -loyaltyAmount, props.loyaltyLabel || 'Loyalty amount', 'loyalty');\n }\n\n if (giftCardAmount > 0) {\n reactNodes.giftCard = _buildPaymentSummarySection(\n props,\n -giftCardAmount,\n props.giftcardLabel || 'Gift card amount',\n 'gift-card'\n );\n }\n\n reactNodes.orderTotal = _buildPaymentSummarySection(\n { ...props, freeText: undefined },\n totalAmountAfterGiftCard,\n props.orderTotalLabel,\n 'total'\n );\n }\n\n return reactNodes;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { PriceComponent } from '@msdyn365-commerce/components';\nimport { ICoreContext, ITelemetry } from '@msdyn365-commerce/core';\nimport { ICheckoutState, IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport { Cart, ChannelConfiguration, ChannelDeliveryOptionConfiguration } from '@msdyn365-commerce/retail-proxy';\nimport * as React from 'react';\n\nexport interface IOrderSummaryProps {\n subTotalLabel: string;\n shippingLabel: string;\n taxLabel: string;\n orderTotalLabel: string;\n loyaltyLabel?: string;\n giftcardLabel?: string;\n totalDiscountsLabel: string;\n context: ICoreContext;\n telemetry: ITelemetry;\n cart: Cart;\n channelConfiguration: ChannelConfiguration;\n id: string;\n typeName: string;\n otherChargeLabel?: string;\n freeText?: string;\n toBeCalculatedText?: string;\n checkoutState?: ICheckoutState;\n retailMultiplePickUpOptionEnabled?: boolean;\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n isTaxIncludedInPrice?: boolean;\n isShowTaxBreakup?: boolean;\n customerAccountLabel?: string;\n}\n\nexport interface IOrderSummaryLines {\n subtotal: React.ReactNode;\n shipping?: React.ReactNode;\n otherCharge?: React.ReactNode;\n tax: React.ReactNode;\n orderTotal: React.ReactNode;\n totalDiscounts?: React.ReactNode;\n giftCard?: React.ReactNode;\n loyalty?: React.ReactNode;\n customerAccount?: React.ReactNode;\n}\n\ninterface IOrderSummaryLineProps {\n label: string;\n context: ICoreContext;\n telemetry: ITelemetry;\n price?: number;\n freeText?: string;\n toBeCalculatedText?: string;\n id: string;\n typeName: string;\n cssLabel: string;\n priceCurrency?: string;\n}\n\ninterface IShippingOrderLine {\n cart: Cart;\n channelConfiguration: ChannelConfiguration;\n canShip?: boolean;\n hasDeliveryMethod?: boolean;\n hasShippingMethod?: boolean;\n freightFee?: number;\n}\n\nconst OrderSummaryLine: React.FC = ({\n price,\n label,\n context,\n id,\n typeName,\n toBeCalculatedText,\n freeText,\n cssLabel,\n priceCurrency\n}) => {\n return (\n

\n {label}\n {price || price === 0 ? (\n \n ) : (\n {toBeCalculatedText}\n )}\n

\n );\n};\n\nconst _buildOrderSummarySection = (\n props: IOrderSummaryProps,\n price: number | undefined,\n cssLabel: string,\n label: string = ''\n): React.ReactNode => {\n return (\n \n );\n};\n\nconst _computedLoyaltyAmount = (checkoutState: ICheckoutState): number => {\n return (checkoutState && checkoutState.loyaltyAmount) || 0;\n};\n\nconst _computedCustomerAccountAmount = (checkoutState: ICheckoutState): number => {\n return (checkoutState && checkoutState.customerAccountAmount) || 0;\n};\n\nconst _computeGiftCardAmount = (checkoutState: ICheckoutState, cart: Cart): number => {\n const giftCardCounter = (count: number, giftCard: IGiftCardExtend) => {\n return count + (giftCard.Balance || 0);\n };\n const giftCardTotalValue = (checkoutState.giftCardExtends || []).reduce(giftCardCounter, 0);\n const amount = (cart.TotalAmount || 0) - _computedLoyaltyAmount(checkoutState);\n return Math.min(giftCardTotalValue, amount);\n};\n\nconst getDeliveryConfiguration = (\n cart: Cart,\n channelConfiguration: ChannelConfiguration,\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration,\n retailMultiplePickUpOptionEnabled?: boolean,\n isTaxIncludedInPrice?: boolean,\n isShowTaxBreakup?: boolean\n): IShippingOrderLine => {\n const pickupDeliveryModeCode = channelConfiguration && channelConfiguration.PickupDeliveryModeCode;\n const emailDeliveryModeCode = channelConfiguration && channelConfiguration.EmailDeliveryModeCode;\n const cartLines = cart.CartLines || [];\n const deliveryModes = cartLines.map(cartLine => cartLine.DeliveryMode);\n const taxOnShippingCharge = cart.TaxOnShippingCharge !== undefined ? cart.TaxOnShippingCharge : 0;\n const shippingChargeAmount = cart.ShippingChargeAmount !== undefined ? cart.ShippingChargeAmount : 0;\n\n // isTaxIncludedInPrice isShowTaxBreakup useProperties\n // False False/True shippingChargeAmount\n // True True shippingChargeAmount\n // True false shippingChargeAmount + taxOnShippingCharge\n // if either of isTaxIncludedInPrice or isShowTaxBreakup is undefined then we will execute old logic\n let freightFee: number | undefined = 0;\n if (isTaxIncludedInPrice === undefined || isShowTaxBreakup === undefined) {\n freightFee = cart.ShippingChargeAmount;\n } else {\n freightFee = isTaxIncludedInPrice && !isShowTaxBreakup ? shippingChargeAmount + taxOnShippingCharge : cart.ShippingChargeAmount;\n }\n const canShip = deliveryModes.some(\n deliveryMode =>\n !(\n deliveryMode !== '' &&\n (deliveryMode ===\n getDeliveryMode(deliveryMode, retailMultiplePickUpOptionEnabled, channelDeliveryOptionConfig, pickupDeliveryModeCode) ||\n deliveryMode === emailDeliveryModeCode)\n )\n );\n const hasDeliveryMethod = deliveryModes.some(deliveryMode => !!deliveryMode && deliveryMode !== emailDeliveryModeCode);\n const hasShippingMethod = deliveryModes.some(\n deliveryMode =>\n !!deliveryMode &&\n deliveryMode !==\n getDeliveryMode(deliveryMode, retailMultiplePickUpOptionEnabled, channelDeliveryOptionConfig, pickupDeliveryModeCode) &&\n deliveryMode !== emailDeliveryModeCode\n );\n return {\n canShip,\n hasDeliveryMethod,\n hasShippingMethod,\n freightFee\n } as IShippingOrderLine;\n};\n\nconst getDeliveryMode = (\n deliveryMode?: string,\n featureSate: boolean = false,\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration,\n pickupDeliveryMode?: string\n) => {\n if (!featureSate) {\n return pickupDeliveryMode;\n }\n return channelDeliveryOptionConfig?.PickupDeliveryModeCodes?.find(dM => dM === deliveryMode);\n};\n\n// eslint-disable-next-line complexity\nexport const OrderSummary = (props: IOrderSummaryProps) => {\n const {\n SubtotalAmount,\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Existing Property.\n SubtotalAmountWithoutTax,\n TaxAmount,\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Existing Property.\n TaxOnNonShippingCharges,\n DiscountAmount = 0,\n TotalAmount,\n OtherChargeAmount\n } = props.cart;\n\n const { canShip, hasDeliveryMethod, hasShippingMethod, freightFee } = getDeliveryConfiguration(\n props.cart,\n props.channelConfiguration,\n props.channelDeliveryOptionConfig,\n props.retailMultiplePickUpOptionEnabled,\n props.isTaxIncludedInPrice,\n props.isShowTaxBreakup\n );\n\n let reactNodes: IOrderSummaryLines;\n // if either of isTaxIncludedInPrice or isShowTaxBreakup is undefined then we will execute old logic\n if (props.isTaxIncludedInPrice === undefined || props.isShowTaxBreakup === undefined) {\n reactNodes = {\n subtotal: _buildOrderSummarySection(props, SubtotalAmount, 'sub-total', props.subTotalLabel),\n tax: _buildOrderSummarySection(props, hasDeliveryMethod ? TaxAmount : undefined, 'tax-amount', props.taxLabel),\n orderTotal: _buildOrderSummarySection(props, TotalAmount, 'total', props.orderTotalLabel),\n otherCharge:\n (OtherChargeAmount && _buildOrderSummarySection(props, OtherChargeAmount, 'other-charges', props.otherChargeLabel)) ||\n undefined\n };\n } else {\n const otherChargeAmount = OtherChargeAmount !== undefined ? OtherChargeAmount : 0;\n const taxOnNonShippingCharges = TaxOnNonShippingCharges !== undefined ? TaxOnNonShippingCharges : 0;\n const isTaxGreaterThanZero = TaxAmount !== undefined && TaxAmount > 0;\n // isTaxIncludedInPrice isShowTaxBreakup useProperties\n // False False/True otherChargeAmount\n // True True otherChargeAmount\n // True false otherChargeAmount+TaxOnNonShippingCharges\n\n const otherChargeAmountTotal =\n props.isTaxIncludedInPrice && !props.isShowTaxBreakup ? otherChargeAmount + taxOnNonShippingCharges : otherChargeAmount;\n\n const subtotalAmountActual = props.isTaxIncludedInPrice && props.isShowTaxBreakup ? SubtotalAmountWithoutTax : SubtotalAmount;\n\n reactNodes = {\n subtotal: _buildOrderSummarySection(props, subtotalAmountActual, 'sub-total', props.subTotalLabel),\n tax: props.isShowTaxBreakup\n ? _buildOrderSummarySection(\n props,\n hasDeliveryMethod || isTaxGreaterThanZero ? TaxAmount : undefined,\n 'tax-amount',\n props.taxLabel\n )\n : '',\n orderTotal: _buildOrderSummarySection(props, TotalAmount, 'total', props.orderTotalLabel),\n otherCharge:\n (OtherChargeAmount && _buildOrderSummarySection(props, otherChargeAmountTotal, 'other-charges', props.otherChargeLabel)) ||\n undefined\n };\n }\n if (canShip) {\n reactNodes.shipping = _buildOrderSummarySection(props, hasShippingMethod ? freightFee : undefined, 'shipping', props.shippingLabel);\n }\n if (props.checkoutState) {\n const giftCardAmount = _computeGiftCardAmount(props.checkoutState, props.cart);\n const loyaltyAmount = _computedLoyaltyAmount(props.checkoutState);\n const customerAccountAmount = _computedCustomerAccountAmount(props.checkoutState);\n const totalAmountAfterGiftCard = (TotalAmount || 0) - giftCardAmount - loyaltyAmount - customerAccountAmount;\n\n if (loyaltyAmount > 0) {\n reactNodes.loyalty = _buildOrderSummarySection(props, -loyaltyAmount, 'loyalty', props.loyaltyLabel || 'Loyalty amount');\n }\n\n if (giftCardAmount > 0) {\n reactNodes.giftCard = _buildOrderSummarySection(props, -giftCardAmount, 'gift-card', props.giftcardLabel || 'Gift card amount');\n }\n\n if (customerAccountAmount > 0) {\n reactNodes.customerAccount = _buildOrderSummarySection(\n props,\n -customerAccountAmount,\n 'customer-credit-amount',\n props.customerAccountLabel || 'Customer Credit amount'\n );\n }\n\n reactNodes.orderTotal = _buildOrderSummarySection(\n { ...props, freeText: undefined },\n totalAmountAfterGiftCard,\n 'total',\n props.orderTotalLabel\n );\n }\n\n if (DiscountAmount > 0) {\n reactNodes.totalDiscounts = _buildOrderSummarySection(props, -DiscountAmount, 'total-discounts', props.totalDiscountsLabel);\n }\n\n return reactNodes;\n};\n"],"names":["OrderSummaryLine","price","label","context","id","typeName","toBeCalculatedText","freeText","cssLabel","React","className","PriceComponent","data","CustomerContextualPrice","freePriceText","_buildOrderSummarySection","props","telemetry","_computedLoyaltyAmount","checkoutState","loyaltyAmount","getDeliveryMode","deliveryMode","featureSate","channelDeliveryOptionConfig","pickupDeliveryMode","PickupDeliveryModeCodes","find","dM","DynOrderSummary","NetPrice","SubtotalAmount","SubtotalAmountWithoutTax","TaxAmount","TaxOnNonShippingCharges","DiscountAmountWithoutTax","TotalAmount","OtherChargeAmount","cart","canShip","hasDeliveryMethod","hasShippingMethod","freightFee","channelConfiguration","retailMultiplePickUpOptionEnabled","isTaxIncludedInPrice","isShowTaxBreakup","pickupDeliveryModeCode","PickupDeliveryModeCode","emailDeliveryModeCode","EmailDeliveryModeCode","deliveryModes","CartLines","map","cartLine","DeliveryMode","undefined","ShippingChargeAmount","some","getDeliveryConfiguration","otherChargeAmount","otherShippingChargeAmount","isTaxGreaterThanZero","otherChargeAmountTotal","subtotalAmountActual","reactNodes","netTotal","subtotal","subTotalLabel","tax","taxLabel","orderTotal","orderTotalLabel","otherCharge","otherChargeLabel","shipping","shippingLabel","giftCardAmount","giftCardTotalValue","giftCardExtends","reduce","count","giftCard","Balance","amount","Math","min","_computeGiftCardAmount","totalAmountAfterGiftCard","loyalty","loyaltyLabel","giftcardLabel","totalDiscounts","totalDiscountsLabel","CartLineItemFunctions","renderProductDimensions","Product","DimensionStrings","Dimensions","productDimension","DimensionTypeValue","key","RecordId","colorString","DimensionValue","Value","configString","sizeString","IsGiftCard","amountString","styleString","renderDiscountLines","DiscountLines","length","discountLine","index","OfferId","Percentage","updatedPercent","DiscountLineTypeValue","DiscountLineType","Price","Quantity","effectiveAmount","EffectiveAmount","Number","toFixed","discountPercent","isSalesLine","PeriodicDiscount","BasePrice","renderInventoryLabel","inventoryInformationLabel","inventoryCssName","inventoryLabelClassName","renderUnitOfMeasure","IsInvoiceLine","app","config","unitOfMeasureDisplayType","product","DefaultUnitOfMeasure","renderShippingLabel","request","channel","cartline","shippingChargeLines","ChargeLines","filter","chargeLine","IsShipping","chargeTotal","CalculatedAmount","priceComponent","resources","shippingChargesText","renderOtherCharges","otherCharges","chargeline","Description","CartLine","productUrl","productSpecificationData","destructDimensionStrings","imageSettings","cropFocalRegion","renderDisountLines","payLoad","getPayloadObject","telemetryContent","toString","prodAttribute","getTelemetryAttributes","productName","Name","imgeClassName","externalItemID","attribute","TextValue","sizeDescription","onChange","newValue","quantityOnChange","_generateErrorMessage","errorMessage","href","NetAmount","NetAmountWithoutTax","showShippingChargesForLineItems","nodes","isOutOfStock","push","originalPriceText","currentPriceText","DiscountAmount","discountStringText","isQuantityEditable","quantityDisplayString","IncrementalQuantity","LineId","max","maxQuantity","currentCount","currentQuantity","inputQuantityAriaLabel","decrementButtonAriaLabel","incrementButtonAriaLabel","disabled","isCartStateReady","isGiftCard","classNames","_generateQuantityandPrice","TebuCartLineItemComponent","msdyn365Commerce","component","async","validateCartAsync","propsContext","cartResult","cartVersion","shouldRetry","Version","error","warning","debug","AsyncResult","validationResult","CartsDataActions","callerContext","actionContext","bypassCache","Id","ValidationResultsByLineId","name","refreshCart","refreshError","validateError","cartLineQuantityUpdatedAsync","isQuantityLimitsFeatureEnabled","products","cartLineToUpdate","quantity","isUsingDefaultOrderSettingsMax","ArrayExtensions","modifiedProduct","ProductId","Behavior","MaximumQuantity","input","cartLineId","newQuantity","additionalProperties","updateLineResult","updateCartLineQuantity","message","getProductByProductId","productId","getProductByProductIdAndWarehouse","warehouseId","cartState","targetWarehouseValue","WarehouseId","InventoryLocationId","getMiniCartData","ctx","miniCartData","hasInvoiceLine","getActiveCartProductsAction","ActiveCartProductsInput","then","catch","exception","Error","getAvailabilitiesForCartLineItems","ProductAvailabilitiesForCartLineItems","requestContext","apiSettings","availableQuantity","productAvailabilites","getDeliveryOptionsForCartLineItems","ProductDeliveryOptionsForCartLineItems","deliveryOptions","CartIcon","constructor","super","getSortedCartLines","cartlines","sortOrder","lines","sort","item1","item2","LineNumber","_getImageSettings","viewports","xs","q","w","h","sm","lg","lazyload","_removeItemFromCartHandler","cartlineToRemove","this","result","cartLineIds","removeCartLines","state","isCartValid","getTelemetryObject","telemetryPageName","friendlyName","payload","TelemetryEvent","TelemetryConstant","checkoutBySignInAttributes","contentAction","etext","checkoutByGuestAttributes","viewShoppingBagAttributes","reaction","setState","_setQuantityLimitsFeatureFlag","orgUnitLocations","_validateCart","componentDidUpdate","prevProps","shouldComponentUpdate","nextProps","nextState","render","enableHoverCart","isAnonymousCheckout","user","isAuthenticated","signInUrl","guestCheckoutUrl","getUrlSync","cartUrl","checkoutURL","_getCheckoutURL","isCartEmpty","shouldShowMiniCart","isProductAddedToCart","addToCartBehavior","AddToCartBehavior","cartLines","_getCartLines","validInventoryAcrossCartLines","validateCartLinesInventory","hasError","isValid","includeFlyout","status","totalItemsInCart","goToCartButtonText","goToCartButtonTitle","replace","flyoutTitle","flyoutTooltip","tag","UncontrolledTooltip","placement","hideArrow","trigger","displayMode","target","shouldShowCloseButton","cartPageUrl","hideAriaHidden","priceString","totalPriceFormatString","cultureFormatter","formatCurrency","featureState","feature","IsEnabled","viewProps","cartIcon","CartIconComponent","cartLabel","cartQtyLabel","FlyoutContainer","CartlinesWrapper","miniCartWrapper","classnames","miniCartItemWrapper","checkoutAsSignInUserButton","Button","Object","title","checkoutButtonTitle","checkoutAsGuestButton","guestCheckoutButtonTitle","goToCartButton","checkoutBlockedDueToUnavailableFunds","totalPrice","renderView","lastValidatedCartVersion","ValidationResultsPairs","isAbsoluteUrl","urlCheck","returnURL","window","location","origin","includes","FlyoutCartLineItems","cartLinesSortOrder","productDeliveryOptions","outOfStockThreshold","isStockCheckEnabled","enableStockCheck","maxCartlineQuantity","updateMaxQuantityForCartLineItem","maxQuantityForCartLineItem","gridSettings","productDimensionTypeSize","productDimensionTypeColor","productDimensionTypeConfiguration","productDimensionTypeStyle","quantityDisplayText","salesAgreementPricePrompt","shippingText","removeButtonText","removeCartButtonText","outOfStockText","outOfRangeOneText","outOfRangeFormatText","removeItemClickHandler","catalogs","featureStatuses","defaultOrderQuantityLimitsFeatureConfig","platform","enableDefaultOrderQuantityLimits","customerInformation","customerInfo","IsB2b","observer","_renderDeliveryLocation","deliverylocation","FulfillmentStoreId","orgUnitName","_getOrgUnitName","foundProductDeliveryOption","deliveryOption","delivery","DeliveryOptions","option","Code","_renderStoreLocation","fulfillmentStoreId","foundLocation","orgUnitLocation","OrgUnitNumber","OrgUnitName","_assembleCartlines","foundProductAvailability","productAvailability","ProductAvailableQuantity","foundProductDeliveryOptions","availableQuantityInStock","AvailableQuantity","maxQuantityByConfig","maxByQuantityLimitsFeature","maxByQuantityLimitsFeatureResult","_getCartItemMaxQuantity","isServiceItem","ItemTypeValue","ReleasedProductType","onRemoveClickHandler","onRemoveClickFunction","removeCartItemAttribute","getProductUrlSync","MsDyn365","isChannelTypeB2B","fullUrl","URL","searchParams","set","CatalogId","CartLineItemComponent","primaryImageUrl","PrimaryImageUrl","deliveryLocation","remove","onClick","storeLocation","_assembleNode","InvoiceSummaryLine","_buildPaymentSummarySection","InvoiceSummary","invoiceLines","invoices","invoiceLine","InvoiceAmount","format","invoiceLabel","InvoiceId","priceCurrency","currencyCode","Currency","OrderSummary","taxOnShippingCharge","TaxOnShippingCharge","shippingChargeAmount","taxOnNonShippingCharges","customerAccountAmount","customerAccount","customerAccountLabel"],"sourceRoot":""}