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C6d,EAAAA,KAAI,CAACpd,UAAU,6BACgB,QAA3Bmf,EAAA7R,KAAKnL,MAAM6F,KAAKgE,KAAKgE,cAAM,IAAAmP,GAA3BA,EAA6BE,QAC1B9f,IAAAA,cAAC6J,EAAAA,OAAM,CACHpJ,UAAU,mCACV4H,MAAMqM,EAAAA,EAAAA,IAAW,OAAQ3G,KAAKnL,MAAMS,QAAQuE,gBAE3CmG,KAAKnL,MAAMU,UAAU+c,6BAE1B,MAERrgB,IAAAA,cAAC6d,EAAAA,KAAI,CAACpd,UAAU,2CAA2CsN,KAAKnL,MAAMmW,uBAnItEuH,IAAC9K,EAAuD5S,GAgNhF","sources":["webpack://bestseller.commerce.online/external var \"React\"?0d3b","webpack://bestseller.commerce.online/external var \"ReactDOM\"?853b","webpack://bestseller.commerce.online/./src/shared/components/modal-panel.component.tsx?2c38","webpack://bestseller.commerce.online/./lib/ext-cart-icon/module-registration.js?487e","webpack://bestseller.commerce.online/./src/modules/ext-cart-icon/ext-cart-icon.props.autogenerated.ts?8e74","webpack://bestseller.commerce.online/./src/modules/ext-cart-icon/components/flyout-cart-line-items.tsx?712c","webpack://bestseller.commerce.online/./src/modules/ext-cart-icon/utils/get-products-in-mini-cart.ts?0db3","webpack://bestseller.commerce.online/./src/modules/ext-cart-icon/ext-cart-icon.tsx?435e","webpack://bestseller.commerce.online/./src/modules/ext-cart-icon/ext-cart-icon.view.tsx?650f","webpack://bestseller.commerce.online/./src/themes/only/views/ext-cart-icon.view.tsx?7b23"],"sourcesContent":["module.exports = React;","module.exports = ReactDOM;","import React from 'react';\r\nexport enum Position {\r\n RIGHT = 'right',\r\n BOTTOM = 'bottom',\r\n POPUP_RELATIVE = 'popup-relative',\r\n POPUP_CENTERED = 'popup-centered'\r\n}\r\nexport interface ModalPanelConfiguration {\r\n isOpen?: boolean;\r\n position?: Position;\r\n toggle?: any;\r\n children?: React.ReactNode;\r\n}\r\n\r\nconst ModalPanel = ({ isOpen, position, toggle, children }: ModalPanelConfiguration) => {\r\n const innerClassname = `panel ${position} ${isOpen ? 'open' : 'closed'}`;\r\n return (\r\n
\r\n {isOpen &&
}\r\n
{children}
\r\n
\r\n );\r\n};\r\nexport default ModalPanel;\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['ext-cart-icon'] = {\n c: () => require('partner/modules/ext-cart-icon/ext-cart-icon.tsx'),\n $type: 'containerModule',\n da: [{name:'cart', path:'@msdyn365-commerce/global-state/dist/lib/data-actions/get-cart-state-data-action', runOn: 1},{name:'cartConfiguration', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-cart-configuration', runOn: 0},{name:'catalogs', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs', runOn: 0},{name:'channelDeliveryOptionConfig', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration', runOn: 0},{name:'customerBalances', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer-balance', runOn: 0},{name:'customerInformation', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer', runOn: 0},{name:'featureState', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state', runOn: 0},{name:'orgUnitLocations', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/search-org-unit-locations', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'ext-cart-icon',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/ext-cart-icon'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-cart-configuration';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-cart-configuration');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer-balance';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer-balance');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/search-org-unit-locations';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/search-org-unit-locations');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce/global-state/dist/lib/data-actions/get-cart-state-data-action';\n let dataAction = require('@msdyn365-commerce/global-state/dist/lib/data-actions/get-cart-state-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|ext-cart-icon|ext-cart-icon'] = {\n c: () => require('partner/modules/ext-cart-icon/ext-cart-icon.view.tsx'),\n cn: '__local__-__local__-ext-cart-icon'\n };\nviewDictionary['__local__|__local__|themes|only|views|ext-cart-icon'] = {\n c: () => require('partner/themes/only/views/ext-cart-icon.view.tsx'),\n cn: '__local__-__local__-ext-cart-icon'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. See License.txt in the project root for license information.\r\n * IExtCartIcon containerModule Interface Properties\r\n * THIS FILE IS AUTO-GENERATED - MANUAL MODIFICATIONS WILL BE LOST\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport * as React from 'react';\r\n\r\nexport const enum cartLinesSortOrder {\r\n ascending = 'ascending',\r\n descending = 'descending'\r\n}\r\n\r\nexport interface IExtCartIconConfig extends Msdyn365.IModuleConfig {\r\n imageSettings?: Msdyn365.IImageSettings;\r\n enableHoverCart?: boolean;\r\n showCheckoutButton?: boolean;\r\n checkoutButtonTitle?: string;\r\n cartLinesSortOrder?: cartLinesSortOrder;\r\n showFreeDeliveryText?: boolean;\r\n untilFreeDeliveryText?: string;\r\n freeDeliveryReachedText?: string;\r\n freeDeliveryAmountGuest?: number;\r\n freeDeliveryAmountMember?: number;\r\n totalPriceFormatString?: string;\r\n showSubtotalMessage?: boolean;\r\n subtotalMessageUntilFreeShipping?: string;\r\n subtotalMessageOnFreeShipping?: string;\r\n isAnonymousCheckout?: boolean;\r\n clientRender?: boolean;\r\n popupContentText?: string;\r\n showPaymentImages?: boolean;\r\n paymentImages?: Msdyn365.IImageData[];\r\n}\r\n\r\nexport interface IExtCartIconResources {\r\n goToCartButtonTitle: string;\r\n totalPriceFormatString: string;\r\n guestCheckoutButtonTitle: string;\r\n checkoutButtonTitle: string;\r\n productDimensionTypeColor: string;\r\n productDimensionTypeSize: string;\r\n productDimensionTypeStyle: string;\r\n productDimensionTypeConfiguration: string;\r\n quantityDisplayText: string;\r\n removeCartButtonText: string;\r\n cartLabel: string;\r\n cartQtyLabel: string;\r\n flyoutTitle: string;\r\n salesAgreementPricePrompt: string;\r\n shippingText: string;\r\n checkoutBlockedDueToUnavailableFundsTitle: string;\r\n checkoutBlockedDueToUnavailableFundsMessage: string;\r\n memberPriceMessage: string;\r\n saleMessage: string;\r\n outOfStockText: string;\r\n outOfRangeOneText: string;\r\n}\r\n\r\nexport interface IExtCartIconProps extends Msdyn365.IModule {\r\n resources: IExtCartIconResources;\r\n config: IExtCartIconConfig;\r\n slots: {\r\n popupContent: React.ReactNode[];\r\n };\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport MsDyn365, { ICoreContext, IGridSettings, IImageSettings, ITelemetry, isChannelTypeB2B } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport {\r\n AsyncResult,\r\n CartLine,\r\n ChannelDeliveryOptionConfiguration,\r\n OrgUnitLocation,\r\n ProductAvailableQuantity,\r\n ProductDeliveryOptions,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n CartLineValidationResultsByLineId,\r\n ProductCatalog,\r\n ReleasedProductType\r\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport {\r\n ArrayExtensions,\r\n getProductUrlSync,\r\n IProductInventoryInformation,\r\n ObjectExtensions,\r\n StringExtensions\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n Button,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n ITelemetryContent,\r\n TelemetryConstant\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { getProductByProductId, getProductByProductIdAndWarehouse } from '@msdyn365-commerce-modules/cart';\r\nimport CartLineItemComponent, { ICartlineResourceString } from '../../../shared/components/cartlineitem.component';\r\n\r\nexport interface IFlyoutCartLineItemsProps {\r\n cartlines: CartLine[];\r\n cartState: ICartState | undefined;\r\n orgUnitLocations: OrgUnitLocation[] | undefined;\r\n resources: ICartlineResourceString;\r\n productAvailabilites: IProductInventoryInformation[] | undefined;\r\n products: SimpleProduct[] | undefined;\r\n productDeliveryOptions: ProductDeliveryOptions[] | undefined;\r\n pickupDeliveryModeCode?: string;\r\n catalogs?: ProductCatalog[];\r\n productAvailability?: AsyncResult;\r\n includeErrors?: boolean;\r\n cartlinesErrors: CartLineValidationResultsByLineId;\r\n\r\n /**\r\n * GridSettings for the product image in cartline\r\n */\r\n gridSettings: IGridSettings;\r\n\r\n /**\r\n * ImageSettings for the product image in cartline\r\n */\r\n imageSettings: IImageSettings;\r\n id: string;\r\n typeName: string;\r\n context: ICoreContext;\r\n telemetry: ITelemetry;\r\n removeButtonText: string;\r\n outOfStockText: string;\r\n outOfRangeOneText: string;\r\n outOfRangeFormatText: string;\r\n maxCartlineQuantity: number;\r\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n isQuantityLimitsFeatureEnabled: boolean;\r\n outOfStockThreshold: number;\r\n isStockCheckEnabled: boolean;\r\n telemetryContent?: ITelemetryContent;\r\n removeItemClickHandler(cartlineToRemove: CartLine): void;\r\n updateCartLinesQuantitySuccessHandler(cartline: CartLine, quantity: number, lineIndex?: number): boolean;\r\n}\r\n\r\nexport interface IFlyoutCartLineItemViewProps {\r\n cartline: React.ReactNode;\r\n remove: React.ReactNode;\r\n storeLocation: React.ReactNode;\r\n hasError: boolean;\r\n error?: string;\r\n\r\n data: {\r\n product: SimpleProduct;\r\n cartline: CartLine;\r\n };\r\n}\r\n\r\nconst _getCartItemAvailableQuantity = (\r\n isStockCheckEnabled: boolean,\r\n outOfStockThreshold: number,\r\n productAvailability?: ProductAvailableQuantity\r\n): number => {\r\n if (isStockCheckEnabled) {\r\n if (\r\n !productAvailability ||\r\n !productAvailability.AvailableQuantity ||\r\n productAvailability.AvailableQuantity <= 0 ||\r\n productAvailability.AvailableQuantity <= outOfStockThreshold\r\n ) {\r\n return 0;\r\n }\r\n return productAvailability.AvailableQuantity - outOfStockThreshold;\r\n }\r\n\r\n return 0;\r\n};\r\n\r\nconst _getCartItemMaxQuantity = (\r\n maxQuantityByConfig: number,\r\n isStockCheckEnabled: boolean,\r\n availableQuantityInStock: number,\r\n isQuantityLimitsFeatureEnabled: boolean,\r\n maxByQuantityLimitsFeature: number\r\n) => {\r\n if (isQuantityLimitsFeatureEnabled) {\r\n let maxByQuantityLimitsFeatureResult = maxByQuantityLimitsFeature;\r\n\r\n // If max by feature in not defined when feature is on then we suggest that there is no max by feature\r\n // and consider available qty if stock check enabled and max from config in site settings.\r\n if (!maxByQuantityLimitsFeature) {\r\n maxByQuantityLimitsFeatureResult = maxQuantityByConfig || 10;\r\n }\r\n\r\n return isStockCheckEnabled\r\n ? maxByQuantityLimitsFeatureResult < availableQuantityInStock\r\n ? maxByQuantityLimitsFeatureResult\r\n : availableQuantityInStock\r\n : maxByQuantityLimitsFeatureResult;\r\n }\r\n if (isStockCheckEnabled) {\r\n return availableQuantityInStock < maxQuantityByConfig ? availableQuantityInStock : maxQuantityByConfig;\r\n }\r\n return maxQuantityByConfig;\r\n};\r\n\r\nconst _getErrorMessage = (\r\n availableQuantityInStock: number,\r\n currentQuantity: number,\r\n props: IFlyoutCartLineItemsProps,\r\n shouldSkipStockCheck: boolean,\r\n cartLine: CartLine,\r\n lineId: string | undefined,\r\n foundProductAvailability?: IProductInventoryInformation\r\n): string | undefined => {\r\n const finalErrorMessages: string[] = [];\r\n\r\n const isLoadingDeliveryOptions = props.productAvailability?.status === 'LOADING';\r\n if (isLoadingDeliveryOptions) {\r\n return undefined;\r\n }\r\n // check availability passed as prop for each cartline\r\n if (props.productAvailabilites && ArrayExtensions.hasElements(props.productAvailabilites)) {\r\n if (foundProductAvailability === undefined) {\r\n finalErrorMessages.push(props.outOfStockText);\r\n return finalErrorMessages.toString();\r\n }\r\n }\r\n if (props.includeErrors && props.isStockCheckEnabled && !shouldSkipStockCheck) {\r\n if (availableQuantityInStock <= 0) {\r\n finalErrorMessages.push(props.outOfStockText);\r\n } else if (availableQuantityInStock < currentQuantity) {\r\n if (availableQuantityInStock === 1) {\r\n finalErrorMessages.push(props.outOfRangeOneText);\r\n } else {\r\n finalErrorMessages.push(props.outOfRangeFormatText.replace('{numLeft}', availableQuantityInStock.toString()));\r\n }\r\n }\r\n }\r\n\r\n // Server-side validation\r\n const checkForErrors = props.cartlinesErrors.ValidationResultsPairs;\r\n const errorsFoundByLineId = checkForErrors?.filter(index => index.LineId === lineId);\r\n if (errorsFoundByLineId !== undefined) {\r\n for (const i of errorsFoundByLineId) {\r\n if (ArrayExtensions.hasElements(i.ValidationFailures)) {\r\n i.ValidationFailures.forEach(validation => {\r\n if (validation.ErrorContext !== undefined) {\r\n finalErrorMessages.push(validation.ErrorContext);\r\n }\r\n });\r\n }\r\n }\r\n }\r\n\r\n if (ArrayExtensions.hasElements(finalErrorMessages)) {\r\n return finalErrorMessages.join(' ');\r\n }\r\n\r\n return undefined;\r\n};\r\n\r\n/**\r\n * On Remove Click functionality.\r\n * @param removeItemClickHandler -Remove item click function.\r\n * @param cartline -CartLine.\r\n * @returns Remove change value.\r\n */\r\nconst onRemoveClickFunction = (removeItemClickHandler: (cartlineToRemove: CartLine) => void, cartline: CartLine) => () => {\r\n removeItemClickHandler(cartline);\r\n};\r\nconst _assembleNode = (\r\n cartline: CartLine,\r\n product: SimpleProduct,\r\n props: IFlyoutCartLineItemsProps,\r\n index: number,\r\n foundProductAvailability?: IProductInventoryInformation,\r\n foundProductDeliveryOptions?: ProductDeliveryOptions\r\n): IFlyoutCartLineItemViewProps => {\r\n const { imageSettings, gridSettings, id, typeName, context, resources, removeButtonText, removeItemClickHandler } = props;\r\n\r\n const availableQuantityInStock = _getCartItemAvailableQuantity(\r\n props.isStockCheckEnabled,\r\n props.outOfStockThreshold,\r\n foundProductAvailability?.ProductAvailableQuantity\r\n );\r\n const maxQuantity =\r\n product &&\r\n _getCartItemMaxQuantity(\r\n props.maxCartlineQuantity,\r\n props.isStockCheckEnabled,\r\n availableQuantityInStock,\r\n props.isQuantityLimitsFeatureEnabled,\r\n product?.Behavior?.MaximumQuantity || 0\r\n );\r\n\r\n // Check if the product is service or not by product type\r\n const isServiceItem = product.ItemTypeValue === ReleasedProductType.Service;\r\n\r\n const shouldSkipStockCheck = product?.ItemTypeValue === ReleasedProductType.Service || !!cartline.IsInvoiceLine;\r\n\r\n const errorMessage = ObjectExtensions.isNullOrUndefined(maxQuantity)\r\n ? undefined\r\n : _getErrorMessage(\r\n availableQuantityInStock,\r\n cartline.Quantity!,\r\n props,\r\n shouldSkipStockCheck,\r\n cartline,\r\n cartline.LineId,\r\n foundProductAvailability\r\n );\r\n\r\n const onRemoveClickHandler = onRemoveClickFunction(removeItemClickHandler, cartline);\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.RemoveCartItem);\r\n const removeCartItemAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\r\n\r\n let productUrl = getProductUrlSync(product, props.context.actionContext, undefined);\r\n if (MsDyn365.isBrowser && isChannelTypeB2B(props.context.actionContext.requestContext)) {\r\n const fullUrl = new URL(productUrl, window.location.href);\r\n fullUrl.searchParams.set('catalogid', `${cartline.CatalogId ?? 0}`);\r\n productUrl = fullUrl.href;\r\n }\r\n\r\n return {\r\n data: {\r\n product,\r\n cartline\r\n },\r\n error: errorMessage,\r\n hasError:\r\n !isServiceItem && props.isStockCheckEnabled\r\n ? cartline.Quantity! > maxQuantity\r\n : false || (!ObjectExtensions.isNullOrUndefined(errorMessage) && !StringExtensions.isNullOrEmpty(errorMessage)),\r\n cartline: (\r\n \r\n ),\r\n remove: (\r\n \r\n {removeButtonText}\r\n \r\n ),\r\n storeLocation: _renderStoreLocation(cartline, props)\r\n };\r\n};\r\n\r\nconst _renderDeliveryLocation = (cartLine: CartLine | null | undefined, props: IFlyoutCartLineItemsProps): string | undefined => {\r\n let deliverylocation;\r\n if (cartLine && cartLine.FulfillmentStoreId) {\r\n const orgUnitName = _getOrgUnitName(cartLine.FulfillmentStoreId, props.orgUnitLocations);\r\n\r\n let foundProductDeliveryOption;\r\n if (props.productDeliveryOptions && props.productDeliveryOptions.length > 0) {\r\n foundProductDeliveryOption = props.productDeliveryOptions.find(deliveryOption => {\r\n return deliveryOption && deliveryOption.ProductId === cartLine.ProductId;\r\n });\r\n }\r\n const delivery = foundProductDeliveryOption?.DeliveryOptions?.find(option => option.Code === cartLine.DeliveryMode);\r\n const location = delivery?.Description;\r\n\r\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\r\n if (location) {\r\n deliverylocation = `${location}, ${orgUnitName}`;\r\n } else {\r\n deliverylocation = `${orgUnitName}`;\r\n }\r\n } else {\r\n deliverylocation = props.resources.shippingText;\r\n }\r\n return deliverylocation;\r\n};\r\n\r\nconst _renderStoreLocation = (cartLine: CartLine | null | undefined, props: IFlyoutCartLineItemsProps): JSX.Element | null => {\r\n if (cartLine && cartLine.FulfillmentStoreId) {\r\n const orgUnitName = _getOrgUnitName(cartLine.FulfillmentStoreId, props.orgUnitLocations);\r\n\r\n if (orgUnitName) {\r\n return (\r\n
\r\n {orgUnitName}\r\n
\r\n );\r\n }\r\n }\r\n\r\n return null;\r\n};\r\n\r\nconst _getOrgUnitName = (fulfillmentStoreId: string | undefined, orgUnitLocations: OrgUnitLocation[] | undefined) => {\r\n if (!orgUnitLocations || !fulfillmentStoreId || orgUnitLocations.length === 0) {\r\n return '';\r\n }\r\n\r\n const foundLocation = orgUnitLocations.find(orgUnitLocation => {\r\n return orgUnitLocation.OrgUnitNumber === fulfillmentStoreId;\r\n });\r\n\r\n if (foundLocation) {\r\n return foundLocation.OrgUnitName;\r\n }\r\n return fulfillmentStoreId;\r\n};\r\n\r\nconst _assembleCartlines = (\r\n cartlines: CartLine[],\r\n products: SimpleProduct[] | undefined,\r\n props: IFlyoutCartLineItemsProps\r\n): IFlyoutCartLineItemViewProps[] | null => {\r\n const reactNodes: IFlyoutCartLineItemViewProps[] = [];\r\n\r\n if (!products || products.length === 0) {\r\n //props.context.telemetry.error('Cartlines content is empty, module wont render');\r\n return null;\r\n }\r\n\r\n cartlines.map((cartline, index) => {\r\n let product;\r\n if (props.isQuantityLimitsFeatureEnabled) {\r\n // When feature is enabled the same products could have different quantity limits in Behavior so we need\r\n // to check productId and WarehouseId for identification.\r\n product = getProductByProductIdAndWarehouse(cartline.ProductId, products, cartline.WarehouseId, props.cartState);\r\n } else {\r\n product = getProductByProductId(cartline.ProductId, products);\r\n }\r\n let foundProductAvailability;\r\n if (props.productAvailabilites && props.productAvailabilites.length > 0) {\r\n foundProductAvailability = props.productAvailabilites.find(productAvailability => {\r\n return productAvailability.ProductAvailableQuantity?.ProductId! === cartline.ProductId;\r\n });\r\n }\r\n\r\n let foundProductDeliveryOption;\r\n if (props.productDeliveryOptions && props.productDeliveryOptions.length > 0) {\r\n foundProductDeliveryOption = props.productDeliveryOptions.find(deliveryOption => {\r\n return deliveryOption && deliveryOption.ProductId === cartline.ProductId;\r\n });\r\n }\r\n\r\n if (product) {\r\n reactNodes.push(_assembleNode(cartline, product, props, index, foundProductAvailability, foundProductDeliveryOption));\r\n }\r\n });\r\n\r\n return reactNodes;\r\n};\r\n\r\n/**\r\n * CartLineItems component.\r\n */\r\n\r\nexport const FlyoutCartLineItems = (props: IFlyoutCartLineItemsProps) => {\r\n const { products, cartlines } = props;\r\n return _assembleCartlines(cartlines, products, props);\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport { ProductDeliveryOptions, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ActiveCartProductsInput,\r\n getAvailabilitiesForCartLineItems,\r\n getDeliveryOptionsForCartLineItems,\r\n IProductInventoryInformation,\r\n ProductAvailabilitiesForCartLineItems,\r\n ProductDeliveryOptionsForCartLineItems\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getActiveCartProductsAction } from '../../../actions/get-products-in-active-cart';\r\n\r\n/**\r\n * IMiniCartData entity interface.\r\n */\r\nexport interface IMiniCartData {\r\n products?: SimpleProduct[];\r\n productAvailabilites?: IProductInventoryInformation[];\r\n deliveryOptions?: ProductDeliveryOptions[];\r\n}\r\n\r\nexport const createInput = () => {\r\n return new ActiveCartProductsInput();\r\n};\r\n\r\n/**\r\n * Calls the Retail API and returns a mini cart data.\r\n * @param ctx\r\n * @param cartState\r\n */\r\nexport async function getMiniCartData(ctx: IActionContext, cartState: ICartState): Promise {\r\n const miniCartData: IMiniCartData = {};\r\n\r\n const cart = cartState.cart;\r\n\r\n // If there are cart lines, make call to get products\r\n // If there are invocie linese, then there is no products, so don't make call to get products\r\n if (cart && cart.CartLines && cart.CartLines.length > 0 && !cartState.hasInvoiceLine) {\r\n await getActiveCartProductsAction(new ActiveCartProductsInput(), ctx)\r\n .then(products => {\r\n if (products) {\r\n miniCartData.products = products;\r\n }\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n throw new Error('[getActiveCartWithProdcuts]Unable to hydrate cart with product information');\r\n });\r\n\r\n await getAvailabilitiesForCartLineItems(new ProductAvailabilitiesForCartLineItems(ctx.requestContext.apiSettings), ctx)\r\n .then(availableQuantity => {\r\n if (availableQuantity) {\r\n miniCartData.productAvailabilites = availableQuantity;\r\n }\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n throw new Error('[getActiveCartWithProdcuts]Unable to hydrate cart with product information');\r\n });\r\n\r\n await getDeliveryOptionsForCartLineItems(new ProductDeliveryOptionsForCartLineItems(ctx.requestContext.apiSettings), ctx)\r\n .then(deliveryOptions => {\r\n if (deliveryOptions) {\r\n miniCartData.deliveryOptions = deliveryOptions;\r\n }\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n throw new Error('[getActiveCartWithProdcuts]Unable to hydrate cart with product information');\r\n });\r\n }\r\n\r\n return miniCartData;\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { AddToCartBehavior, CartIconComponent } from '@msdyn365-commerce/components';\r\nimport { getUrlSync, IDictionary, IImageSettings, msdyn365Commerce, TelemetryEvent } from '@msdyn365-commerce/core';\r\nimport {\r\n CartLine,\r\n ChannelDeliveryOptionConfiguration,\r\n CartLineValidationResultsByLineId,\r\n OrgUnitLocation,\r\n LineValidationResult,\r\n AsyncResult\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { validateCartAsync } from '@msdyn365-commerce-modules/cart-utilities';\r\nimport { ArrayExtensions, ObjectExtensions, validateCartLinesInventory } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n Button,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n getTelemetryObject,\r\n INodeProps,\r\n ITelemetryContent,\r\n TelemetryConstant,\r\n UncontrolledTooltip,\r\n updateMaxQuantityForCartLineItem,\r\n urlCheck\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport { reaction } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport React from 'react';\r\nimport { Image } from '@msdyn365-commerce/core';\r\n\r\nimport { IExtCartIconData } from './ext-cart-icon.data';\r\nimport { cartLinesSortOrder, IExtCartIconProps } from './ext-cart-icon.props.autogenerated';\r\nimport { FlyoutCartLineItems, IFlyoutCartLineItemViewProps } from './components/flyout-cart-line-items';\r\nimport { cartLineQuantityUpdatedAsync } from '@msdyn365-commerce-modules/cart-utilities';\r\nimport { getMiniCartData, IMiniCartData } from './utils/get-products-in-mini-cart';\r\nimport ModalPanel, { Position } from '../../shared/components/modal-panel.component';\r\nimport { ICartActionResult } from '@msdyn365-commerce/global-state';\r\n\r\nexport interface IMiniCartState {\r\n miniCartData: IMiniCartData;\r\n orgUnitLocations?: OrgUnitLocation[];\r\n isQuantityLimitsFeatureEnabled: boolean;\r\n isCartValid: boolean;\r\n cartlinesErrors: CartLineValidationResultsByLineId;\r\n freeDeliveryReached: boolean;\r\n isPopupOpen: boolean;\r\n}\r\n\r\nexport interface ICartIconViewProps extends IExtCartIconProps {\r\n className: string;\r\n cartIcon: React.ReactNode;\r\n FlyoutContainer?: INodeProps;\r\n CartlinesWrapper: INodeProps;\r\n miniCartWrapper: INodeProps;\r\n miniCartItemWrapper: INodeProps;\r\n cartlines?: IFlyoutCartLineItemViewProps[];\r\n flyoutTitle: React.ReactNode;\r\n totalPrice: React.ReactNode;\r\n checkoutAsGuestButton?: React.ReactNode;\r\n checkoutAsSignInUserButton?: React.ReactNode;\r\n goToCartButton?: React.ReactNode;\r\n waitingComponent?: React.ReactNode;\r\n isCartLoading: boolean;\r\n checkoutBlockedDueToUnavailableFunds?: React.ReactNode;\r\n freeDeliveryCountdown: React.ReactNode;\r\n subTotalMessage: React.ReactNode;\r\n popupContent?: React.ReactNode;\r\n paymentOptionsImgs?: React.ReactNode;\r\n\r\n removeItemClickHandler(cartlineToRemove: CartLine): void;\r\n}\r\n\r\n/**\r\n *\r\n * Cart component.\r\n * @extends {React.PureComponent>}\r\n */\r\n@observer\r\nclass CartIcon extends React.Component {\r\n private readonly telemetryContent: ITelemetryContent;\r\n\r\n private readonly checkoutBySignInAttributes: IDictionary | undefined;\r\n\r\n private readonly checkoutByGuestAttributes: IDictionary | undefined;\r\n\r\n private readonly viewShoppingBagAttributes: IDictionary | undefined;\r\n\r\n private retailMultiplePickUpOptionEnabled?: boolean = false;\r\n\r\n private channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n\r\n private lastValidatedCartVersion: number | undefined;\r\n\r\n constructor(props: ICartIconViewProps) {\r\n super(props);\r\n this.state = {\r\n miniCartData: {},\r\n isCartValid: true,\r\n isQuantityLimitsFeatureEnabled: false,\r\n cartlinesErrors: {},\r\n freeDeliveryReached: false,\r\n isPopupOpen: false\r\n };\r\n this.telemetryContent = getTelemetryObject(\r\n this.props.context.request.telemetryPageName!,\r\n this.props.friendlyName,\r\n this.props.telemetry\r\n );\r\n const payload = getPayloadObject(TelemetryEvent.CheckOut, this.telemetryContent, TelemetryConstant.Checkout);\r\n this.checkoutBySignInAttributes = getTelemetryAttributes(this.telemetryContent, payload);\r\n\r\n payload.contentAction.etext = TelemetryConstant.GuestCheckout;\r\n this.checkoutByGuestAttributes = getTelemetryAttributes(this.telemetryContent, payload);\r\n\r\n payload.contentAction.etext = TelemetryConstant.ViewShoppingBag;\r\n this.viewShoppingBagAttributes = getTelemetryAttributes(this.telemetryContent, payload);\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n const context = this.props.context.actionContext;\r\n\r\n reaction(\r\n () => this.props.data.cart.result?.cart.CartLines,\r\n async () => {\r\n this.setState({\r\n miniCartData: await getMiniCartData(context, this.props.data.cart.result!)\r\n });\r\n }\r\n );\r\n await this._setQuantityLimitsFeatureFlag();\r\n\r\n this.setState({\r\n orgUnitLocations: this.props.data.orgUnitLocations?.result\r\n });\r\n\r\n this._validateCart();\r\n }\r\n\r\n public componentDidUpdate(prevProps: ICartIconViewProps): void {\r\n this._validateCart();\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: ICartIconViewProps, nextState: IMiniCartState): boolean {\r\n if (this.state === nextState && this.props.data === nextProps.data) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n // eslint-disable-next-line complexity -- disabling the complexity for this method for now as its causing lot of other warnings\r\n public render(): JSX.Element | null {\r\n const {\r\n id,\r\n typeName,\r\n config: {\r\n enableHoverCart,\r\n isAnonymousCheckout,\r\n showCheckoutButton,\r\n showSubtotalMessage,\r\n showFreeDeliveryText,\r\n paymentImages,\r\n showPaymentImages\r\n },\r\n context: {\r\n request: {\r\n user: { isAuthenticated, signInUrl }\r\n }\r\n },\r\n context,\r\n resources\r\n } = this.props;\r\n\r\n const cart = (this.props.data.cart && this.props.data.cart.result) || undefined;\r\n const guestCheckoutUrl = getUrlSync('checkout', this.props.context.actionContext) || '';\r\n const cartUrl = getUrlSync('cart', this.props.context.actionContext) || '';\r\n const checkoutURL = this._getCheckoutURL(isAuthenticated, guestCheckoutUrl, signInUrl || '');\r\n const isCartEmpty = cart && cart.cart.CartLines && cart.cart.CartLines.length === 0;\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- check config.\r\n const shouldShowMiniCart =\r\n cart?.isProductAddedToCart && this.props.context.app.config.addToCartBehavior === AddToCartBehavior.showMiniCart;\r\n const hasInvoiceLine = cart?.hasInvoiceLine;\r\n const emailDeliveryModeCode = this.props.context.request.channel?.EmailDeliveryModeCode;\r\n const cartLines = this._getCartLines();\r\n const validInventoryAcrossCartLines = validateCartLinesInventory(\r\n cart?.cart.CartLines ?? [],\r\n this.state.miniCartData.productAvailabilites ?? [],\r\n this.props.context.actionContext,\r\n this.state.miniCartData.products ?? [],\r\n emailDeliveryModeCode\r\n );\r\n const hasError =\r\n !validInventoryAcrossCartLines?.isValid ||\r\n (!validInventoryAcrossCartLines && !this.state.isCartValid) ||\r\n (cartLines ? cartLines.some(cartline => cartline.hasError) : false);\r\n const includeFlyout = this.props.data.cart && this.props.data.cart.status === 'SUCCESS' && enableHoverCart;\r\n const totalItemsInCart = cart?.totalItemsInCart ? cart.totalItemsInCart : 0;\r\n const goToCartButtonText = resources.goToCartButtonTitle.replace('{count}', totalItemsInCart.toString());\r\n const flyoutTitle = resources.flyoutTitle;\r\n const flyoutTooltip = {\r\n tag: UncontrolledTooltip,\r\n shouldShowMiniCart,\r\n placement: 'bottom-end',\r\n hideArrow: true,\r\n className: 'ms-cart-icon__flyout-container',\r\n trigger: 'hover',\r\n displayMode: 'FLYOUT',\r\n target: id,\r\n shouldShowCloseButton: true,\r\n cartPageUrl: cartUrl,\r\n hideAriaHidden: true\r\n };\r\n\r\n // If there are invoice lines, don't update mini cart price\r\n const price = (cart && !cart.hasInvoiceLine && cart.cart.TotalAmount) || undefined;\r\n const priceString = price\r\n ? resources.totalPriceFormatString.replace('{price}', context.cultureFormatter.formatCurrency(price))\r\n : '';\r\n const cartTotalAmount = (cart && cart.cart.TotalAmount) || 0;\r\n\r\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n this.channelDeliveryOptionConfig = this.props.data.channelDeliveryOptionConfig?.result;\r\n this.retailMultiplePickUpOptionEnabled = this.props.data.featureState?.result?.find(\r\n feature => feature.Name === multiplePickupStoreSwitchName\r\n )?.IsEnabled;\r\n\r\n const viewProps = {\r\n ...this.props,\r\n cartIcon: (\r\n \r\n ),\r\n cartlines: cartLines,\r\n FlyoutContainer: includeFlyout ? flyoutTooltip : undefined,\r\n CartlinesWrapper: {\r\n className: 'ms-cart-icon__cart-lines'\r\n },\r\n miniCartWrapper: {\r\n className: classnames('ms-cart-icon'),\r\n id: this.props.id\r\n },\r\n miniCartItemWrapper: {\r\n className: classnames('msc-cart-lines-item')\r\n },\r\n // If there are invoice lines, don't update mini cart checkout button\r\n // Checkout button will display by default to maintain backward compatibility. When Anonymous user checkout is enabled &&\r\n // user is authenticated then we will show the checkout button otherwise we will show the guest checkout button.\r\n //BS CUSTOM\r\n freeDeliveryCountdown: showFreeDeliveryText ? (\r\n
\r\n
{this._getFreeDeliveryCount(cartTotalAmount)}
\r\n \r\n
\r\n ) : null,\r\n //NOTE: end of custom BS CUSTOM\r\n checkoutAsSignInUserButton:\r\n !isCartEmpty && !hasInvoiceLine && showCheckoutButton && (!isAnonymousCheckout || isAuthenticated) ? (\r\n \r\n {this.props.config.checkoutButtonTitle ?? 'checkout'}\r\n \r\n ) : null,\r\n checkoutAsGuestButton:\r\n isAnonymousCheckout && !isCartEmpty && showCheckoutButton && !isAuthenticated ? (\r\n \r\n {this.props.config.checkoutButtonTitle ?? 'checkout'}\r\n \r\n ) : null,\r\n goToCartButton: (\r\n \r\n {goToCartButtonText}\r\n \r\n ),\r\n checkoutBlockedDueToUnavailableFunds: null,\r\n flyoutTitle: {flyoutTitle},\r\n paymentOptionsImgs: showPaymentImages && paymentImages && (\r\n
\r\n {paymentImages?.map((img, index) => {\r\n return (\r\n \r\n );\r\n })}\r\n
\r\n ),\r\n totalPrice:
{priceString}
,\r\n popupContent: this._getPopupContent(),\r\n subTotalMessage: showSubtotalMessage ?

{this._setSubtotalMessage()}

: null\r\n };\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n //BS CUSTOM\r\n private _getFreeDeliveryCount(cartTotalAmount: number): string {\r\n const {\r\n config: { freeDeliveryAmountGuest, freeDeliveryAmountMember, freeDeliveryReachedText, untilFreeDeliveryText },\r\n context: {\r\n request: {\r\n user: { isAuthenticated }\r\n }\r\n }\r\n } = this.props;\r\n\r\n let amountTillFreeDel = 0;\r\n const freelDeliveryAmount = isAuthenticated ? freeDeliveryAmountMember : freeDeliveryAmountGuest;\r\n let finalString = '';\r\n\r\n if (freelDeliveryAmount !== undefined && untilFreeDeliveryText && cartTotalAmount !== undefined) {\r\n if (cartTotalAmount < freelDeliveryAmount) {\r\n amountTillFreeDel = parseFloat(freelDeliveryAmount.toFixed(2)) - parseFloat(cartTotalAmount.toFixed(2));\r\n finalString = untilFreeDeliveryText?.replace(\r\n '{amount}',\r\n this.props.context.cultureFormatter.formatCurrency(amountTillFreeDel)\r\n );\r\n\r\n if (this.state.freeDeliveryReached !== false) {\r\n this.setState({ freeDeliveryReached: false });\r\n }\r\n } else {\r\n finalString = freeDeliveryReachedText ?? '';\r\n if (this.state.freeDeliveryReached !== true) {\r\n this.setState({ freeDeliveryReached: true });\r\n }\r\n }\r\n }\r\n\r\n return finalString;\r\n }\r\n\r\n private _setSubtotalMessage(): JSX.Element[] | JSX.Element {\r\n let text = '';\r\n let res = <>;\r\n if (this.state.freeDeliveryReached) {\r\n text = this.props.config.subtotalMessageOnFreeShipping ?? '';\r\n } else {\r\n text = this.props.config.subtotalMessageUntilFreeShipping ?? '';\r\n }\r\n\r\n if (text.includes('|')) {\r\n res = (\r\n <>\r\n {text.split('|').map((part, index) => (\r\n {part}\r\n ))}\r\n \r\n );\r\n } else {\r\n res = {text};\r\n }\r\n return res;\r\n }\r\n\r\n //BS CUSTOM\r\n private _getPopupContent = (): JSX.Element => {\r\n const popupContentSlot = this.props.slots.popupContent;\r\n if (popupContentSlot) {\r\n const toggleModal = () => {\r\n this.setState({ isPopupOpen: !this.state.isPopupOpen });\r\n };\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n {popupContentSlot}\r\n \r\n \r\n );\r\n }\r\n return <>;\r\n };\r\n\r\n private _validateCart(): Promise {\r\n const {\r\n data: { cart }\r\n } = this.props;\r\n const cartVersion = cart.result?.cart?.Version ?? undefined;\r\n if (this.lastValidatedCartVersion === cartVersion) {\r\n return AsyncResult.resolve();\r\n }\r\n\r\n this.lastValidatedCartVersion = cartVersion; // This field is populated to block concurrent requests\r\n\r\n if (this.state.isQuantityLimitsFeatureEnabled) {\r\n validateCartAsync(cart, this.props.telemetry, this.props.context)\r\n .then((result: CartLineValidationResultsByLineId | undefined) => {\r\n this.setState({\r\n cartlinesErrors: result ?? {},\r\n isCartValid: !ArrayExtensions.hasElements(result?.ValidationResultsPairs)\r\n });\r\n })\r\n .catch(() => {\r\n this.setState({ isCartValid: false });\r\n });\r\n } else {\r\n this.setState({ isCartValid: true });\r\n }\r\n\r\n return AsyncResult.resolve();\r\n }\r\n\r\n private _getCheckoutURL(isAuthenticated: boolean, guestCheckoutUrl: string, signInUrl: string): string {\r\n if (isAuthenticated) {\r\n return guestCheckoutUrl;\r\n }\r\n\r\n const isAbsoluteUrl = urlCheck(guestCheckoutUrl);\r\n let returnURL = guestCheckoutUrl;\r\n if (msdyn365Commerce.isBrowser && !isAbsoluteUrl) {\r\n returnURL = `${window.location.origin}${guestCheckoutUrl}`;\r\n }\r\n\r\n return `${signInUrl}${!signInUrl.includes('?') ? '?' : '&'}ru=${returnURL}`;\r\n }\r\n\r\n /**\r\n * Sort cartline items.\r\n * @param cartlines - Cartlines to be sorted.\r\n * @param sortOrder - Ascending or descending.\r\n * @returns - Sorted cartlines.\r\n */\r\n private readonly getSortedCartLines = (cartlines: CartLine[], sortOrder?: cartLinesSortOrder): CartLine[] => {\r\n const lines: CartLine[] = [...cartlines];\r\n const zero: number = 0;\r\n\r\n if (sortOrder === cartLinesSortOrder.descending) {\r\n return lines.sort((item1, item2) => (item2.LineNumber ?? zero) - (item1.LineNumber ?? zero));\r\n }\r\n return lines.sort((item1, item2) => (item1.LineNumber ?? zero) - (item2.LineNumber ?? zero));\r\n };\r\n\r\n private _getCartLines(): IFlyoutCartLineItemViewProps[] | null {\r\n const {\r\n context: {\r\n request: { channel: { PickupDeliveryModeCode } = { PickupDeliveryModeCode: undefined } }\r\n },\r\n config,\r\n telemetry,\r\n resources\r\n } = this.props;\r\n\r\n const imageSettings = this._getImageSettings(config.imageSettings);\r\n const cart = this.props.data.cart && this.props.data.cart.result;\r\n const cartlinesErrors: CartLineValidationResultsByLineId = this.state.cartlinesErrors;\r\n\r\n // Cart-icon could be placed in each page\r\n // so we check cart content to reduce number of RS calls\r\n return this.state.miniCartData.products && cart && cart.cart.CartLines && cart.cart.CartLines.length > 0\r\n ? FlyoutCartLineItems({\r\n cartlines: this.getSortedCartLines(cart.cart.CartLines, config.cartLinesSortOrder),\r\n products: this.state.miniCartData.products,\r\n productAvailabilites: this.state.miniCartData.productAvailabilites,\r\n productDeliveryOptions: this.state.miniCartData.deliveryOptions,\r\n imageSettings,\r\n outOfStockThreshold: this.props.context.app.config.outOfStockThreshold || 0,\r\n isStockCheckEnabled: this.props.context.app.config.enableStockCheck || false,\r\n maxCartlineQuantity: updateMaxQuantityForCartLineItem(this.props.context.app.config.maxQuantityForCartLineItem),\r\n gridSettings: this.props.context.request.gridSettings!,\r\n context: this.props.context,\r\n typeName: this.props.typeName,\r\n id: this.props.id,\r\n resources: {\r\n sizeString: resources.productDimensionTypeSize,\r\n colorString: resources.productDimensionTypeColor,\r\n configString: resources.productDimensionTypeConfiguration,\r\n styleString: resources.productDimensionTypeStyle,\r\n quantityDisplayString: resources.quantityDisplayText,\r\n salesAgreementPricePrompt: resources.salesAgreementPricePrompt,\r\n inputQuantityAriaLabel: '', // Not used\r\n discountStringText: '', // Not used\r\n originalPriceText: '',\r\n currentPriceText: '',\r\n shippingChargesText: '',\r\n shippingText: resources.shippingText,\r\n memberPriceMessage: resources.memberPriceMessage,\r\n saleMessage: resources.saleMessage,\r\n decrementButtonAriaLabel: '',\r\n incrementButtonAriaLabel: ''\r\n },\r\n telemetry,\r\n removeButtonText: resources.removeCartButtonText,\r\n outOfStockText: '', // Not used\r\n outOfRangeOneText: '', // Not used\r\n outOfRangeFormatText: '', // Not used\r\n cartState: cart,\r\n orgUnitLocations: this.state.orgUnitLocations,\r\n updateCartLinesQuantitySuccessHandler: this.updateCartlineQuantity,\r\n removeItemClickHandler: this._removeItemFromCartHandler,\r\n pickupDeliveryModeCode: PickupDeliveryModeCode,\r\n telemetryContent: this.telemetryContent,\r\n channelDeliveryOptionConfig: this.retailMultiplePickUpOptionEnabled ? this.channelDeliveryOptionConfig : undefined,\r\n isQuantityLimitsFeatureEnabled: this.state.isQuantityLimitsFeatureEnabled,\r\n catalogs: this.props.data.catalogs?.result,\r\n cartlinesErrors: cartlinesErrors\r\n })\r\n : null;\r\n }\r\n\r\n private readonly _getImageSettings = (imageSettings: IImageSettings | undefined): IImageSettings => {\r\n return (\r\n imageSettings || {\r\n viewports: {\r\n xs: { q: 'w=80&h=94&m=6', w: 0, h: 0 },\r\n sm: { q: 'w=148&h=174&m=6', w: 0, h: 0 },\r\n lg: { q: 'w=148&h=174&m=6', w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n }\r\n );\r\n };\r\n\r\n //BS CUSTOM\r\n private readonly _getPaymentImageSettings = (paymentImageSettings: IImageSettings | undefined): IImageSettings => {\r\n return (\r\n //\"xs\": 767, \"sm\": 991, \"md\": 1199, \"lg\": 1599, \"xl\": 1600\r\n paymentImageSettings || {\r\n viewports: {\r\n xs: { q: 'w=auto&h=40&m=6', w: 0, h: 0 },\r\n lg: { q: 'w=auto&h=40&m=6', w: 0, h: 0 }\r\n },\r\n lazyload: true,\r\n mode: 6\r\n }\r\n );\r\n };\r\n\r\n private readonly _removeItemFromCartHandler = (cartlineToRemove: CartLine) => {\r\n if (this.props.data.cart.result) {\r\n const input = {\r\n cartLineIds: [cartlineToRemove.LineId!.toString()]\r\n };\r\n this.props.data.cart.result.removeCartLines(input).catch(error => {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to Remove Cart Line');\r\n });\r\n }\r\n };\r\n\r\n /**\r\n * Updates the cart line quantity.\r\n * @param cartlineToUpdate - The cart line.\r\n * @param quantity - The quantity.\r\n * @param lineIndex - The line index.\r\n * @returns True if the cart line was updated, false otherwise.\r\n */\r\n private readonly updateCartlineQuantity = (cartlineToUpdate: CartLine, quantity: number, lineIndex?: number): boolean => {\r\n cartLineQuantityUpdatedAsync(\r\n this.state.isQuantityLimitsFeatureEnabled,\r\n this.props.data.cart.result,\r\n this.props.telemetry,\r\n this.state.miniCartData.products,\r\n cartlineToUpdate,\r\n quantity\r\n )\r\n .then((cartActionResult: ICartActionResult | undefined): boolean => {\r\n if (cartActionResult?.status === 'SUCCESS') {\r\n this._validateCart().catch(error => {\r\n this.props.telemetry.warning((error as Error).message);\r\n this.props.telemetry.debug('Unable to validate Cart');\r\n });\r\n\r\n return true;\r\n }\r\n\r\n if (!ObjectExtensions.isNullOrUndefined(cartActionResult)) {\r\n // Show update line error message.\r\n const lineUpdateFailure: LineValidationResult = {\r\n LineId: ObjectExtensions.isNullOrUndefined(cartlineToUpdate.LineId) ? '0' : cartlineToUpdate.LineId,\r\n ValidationFailures: [\r\n {\r\n ErrorContext: ArrayExtensions.hasElements(cartActionResult.validationResults)\r\n ? cartActionResult.validationResults[0].ErrorContext\r\n : '',\r\n LocalizedMessage: cartActionResult.errorDetails?.LocalizedMessage\r\n }\r\n ]\r\n };\r\n\r\n this.setState({\r\n cartlinesErrors: { ValidationResultsPairs: [lineUpdateFailure] }\r\n });\r\n }\r\n\r\n return false;\r\n })\r\n .catch(() => {\r\n return false;\r\n });\r\n\r\n return false;\r\n };\r\n\r\n private async _setQuantityLimitsFeatureFlag(): Promise {\r\n const featureStatuses = await this.props.data.featureState;\r\n\r\n const isChannelQuantityLimitsFeatureEnabledInHq =\r\n featureStatuses?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.EcommerceQuantityLimitConfigurationsFeature'\r\n )?.IsEnabled || false;\r\n if (isChannelQuantityLimitsFeatureEnabledInHq) {\r\n this.setState({ isQuantityLimitsFeatureEnabled: true });\r\n return;\r\n }\r\n\r\n const useSiteBuilderSettings = featureStatuses?.find(\r\n featureState => featureState.Name === 'RevertToSiteBuilderOrderQuantityLimitsSettings'\r\n )?.IsEnabled;\r\n\r\n if (useSiteBuilderSettings) {\r\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\r\n if (!defaultOrderQuantityLimitsFeatureConfig || defaultOrderQuantityLimitsFeatureConfig === 'none') {\r\n this.setState({ isQuantityLimitsFeatureEnabled: false });\r\n return;\r\n }\r\n\r\n try {\r\n const featureStatuses = await this.props.data.featureState;\r\n const isQuantityLimitsFeatureEnabledInHq =\r\n featureStatuses?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature'\r\n )?.IsEnabled || false;\r\n if (!isQuantityLimitsFeatureEnabledInHq) {\r\n this.setState({ isQuantityLimitsFeatureEnabled: false });\r\n return;\r\n }\r\n } catch (error) {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to get feature states');\r\n this.setState({ isQuantityLimitsFeatureEnabled: false });\r\n return;\r\n }\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\r\n this.setState({ isQuantityLimitsFeatureEnabled: true });\r\n } else {\r\n this.props.data.customerInformation\r\n .then(customerInfo => {\r\n const result =\r\n !!customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b));\r\n this.setState({ isQuantityLimitsFeatureEnabled: result });\r\n })\r\n .catch(error => {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to get customer info');\r\n });\r\n }\r\n } else {\r\n const cartConfiguration = await this.props.data.cartConfiguration;\r\n this.setState({ isQuantityLimitsFeatureEnabled: !(cartConfiguration?.IgnoreOrderSettings ?? false) });\r\n return;\r\n }\r\n }\r\n}\r\n\r\nexport default CartIcon;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { ICartIconViewProps } from './ext-cart-icon';\r\nimport { IFlyoutCartLineItemViewProps } from './components/flyout-cart-line-items';\r\n\r\nconst _renderCartlines = (cartLines: IFlyoutCartLineItemViewProps[] | undefined, props: ICartIconViewProps): JSX.Element[] | null => {\r\n if (!cartLines) {\r\n //props.context.telemetry.error('Cartlines content is empty, module wont render');\r\n return null;\r\n }\r\n return cartLines.map((cartLine, index) => {\r\n return (\r\n \r\n {cartLine.cartline}\r\n {cartLine.storeLocation}\r\n {cartLine.remove}\r\n \r\n );\r\n });\r\n};\r\n\r\nconst CartIconView: React.FC = (props: ICartIconViewProps) => (\r\n \r\n {props.cartIcon}\r\n {props.FlyoutContainer ? (\r\n \r\n {props.flyoutTitle}\r\n {props.checkoutBlockedDueToUnavailableFunds}\r\n {_renderCartlines(props.cartlines, props)}\r\n {props.totalPrice}\r\n {props.checkoutAsSignInUserButton}\r\n {props.checkoutAsGuestButton}\r\n {props.goToCartButton}\r\n \r\n ) : (\r\n false\r\n )}\r\n \r\n);\r\n\r\nexport default CartIconView;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { AddToCartBehavior } from '@msdyn365-commerce/components';\r\nimport MsDyn365, { getUrlSync } from '@msdyn365-commerce/core';\r\nimport { ICartViewProps, IFlyoutCartLineItemViewProps } from '@msdyn365-commerce-modules/cart';\r\nimport { ICartIconViewProps } from '../../../modules/ext-cart-icon/ext-cart-icon';\r\nimport { Button, getPayloadObject, INodeProps, KeyCodes, Modal, Node, onTelemetryClick } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport React from 'react';\r\n\r\nimport { IExtCartIconProps } from '../definition-extensions/ext-cart-icon.ext.props.autogenerated';\r\n\r\n/**\r\n * ICartIconViewState: Interface for Cart Icon View State.\r\n */\r\ninterface ICartIconViewState {\r\n isModalOpen: boolean;\r\n}\r\n\r\n/**\r\n * Render Cart lines.\r\n * @param cartLines - Flyout cart line view props.\r\n * @param props - Cart icon view props.-\r\n * @returns JSX Element.\r\n */\r\nconst renderCartlines = (cartLines: IFlyoutCartLineItemViewProps[] | undefined, props: ICartIconViewProps): JSX.Element[] | null => {\r\n if (!cartLines) {\r\n //props.context.telemetry.error('Cartlines content is empty, module wont render');\r\n return null;\r\n }\r\n\r\n return cartLines.map((cartLine, index) => {\r\n const cartLineIndex = index;\r\n \r\n return (\r\n \r\n {cartLine.cartline}\r\n {cartLine.storeLocation}\r\n {cartLine.remove}\r\n \r\n );\r\n });\r\n};\r\n\r\n/**\r\n * Initiate total price.\r\n * @param props - Cart icon view props.\r\n * @returns JSX Element.\r\n */\r\nconst renderTotalPrice = (props: ICartIconViewProps & IExtCartIconProps<{}>): JSX.Element | null => {\r\n const cart = props.data.cart.result ?? undefined;\r\n const price = cart && !cart.hasInvoiceLine && (cart.cart.TotalAmount || undefined);\r\n const totalPrice = price\r\n ? props.context.cultureFormatter.formatCurrency(price)\r\n : props.context.cultureFormatter.formatCurrency(props.resources.emptyPrice);\r\n return cart && !cart.hasInvoiceLine ? (\r\n
\r\n \r\n {props.config.totalPriceFormatString}\r\n {totalPrice}\r\n \r\n
\r\n ) : (\r\n <>\r\n );\r\n};\r\n\r\n/**\r\n *\r\n * CartIconView component.\r\n * @extends {React.PureComponent}\r\n */\r\nexport class CartIconView extends React.PureComponent<\r\n ICartViewProps & ICartIconViewProps & IExtCartIconProps<{}>,\r\n ICartIconViewState\r\n> {\r\n private isAutoDisplayTriggered: boolean;\r\n\r\n private readonly cartIconRef: React.RefObject = React.createRef();\r\n\r\n public constructor(props: ICartViewProps & ICartIconViewState & ICartIconViewProps & IExtCartIconProps<{}>) {\r\n super(props);\r\n this.isAutoDisplayTriggered = false;\r\n this.state = {\r\n isModalOpen: false\r\n };\r\n }\r\n\r\n public componentDidMount(): void {\r\n if (MsDyn365.isBrowser) {\r\n window.addEventListener('keydown', this._escFunction, false);\r\n }\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n if (MsDyn365.isBrowser) {\r\n window.removeEventListener('keydown', this._escFunction, false);\r\n }\r\n }\r\n\r\n /**\r\n * Render Cart Item count.\r\n * @returns JSX Element.\r\n */\r\n public render(): JSX.Element | null {\r\n const cart = this.props.data.cart.result ?? undefined;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- check config.\r\n const shouldShowMiniCart =\r\n cart?.isProductAddedToCart && this.props.context.app.config.addToCartBehavior === AddToCartBehavior.showMiniCart;\r\n if (shouldShowMiniCart) {\r\n if (!this.isAutoDisplayTriggered) {\r\n // First time trigger auto mini cart.\r\n this.setState({ isModalOpen: true });\r\n this.isAutoDisplayTriggered = true;\r\n } else if (!this.state.isModalOpen) {\r\n // If modal is closed, reset the flag.\r\n this.isAutoDisplayTriggered = false;\r\n }\r\n }\r\n return (\r\n \r\n \r\n \r\n \r\n {this.props.flyoutTitle}\r\n {this._renderCartItemCount(this.props)}\r\n {this._renderCartCloseIcon()}\r\n \r\n \r\n {this.props.freeDeliveryCountdown}\r\n {this.props.data.cart.result?.isEmpty ? this.props.slots.emptyCart : null}\r\n {this.props.checkoutBlockedDueToUnavailableFunds}\r\n {renderCartlines(this.props.cartlines, this.props)}\r\n \r\n \r\n {this.props.slots.promoContentItem}\r\n {/** BS CUSTOM - popupContent */}\r\n {this.props.popupContent}\r\n {renderTotalPrice(this.props)}\r\n {this.props.subTotalMessage}\r\n {this.props.checkoutAsSignInUserButton}\r\n {this.props.checkoutAsGuestButton}\r\n {this.props.data.cart.result?.isEmpty ? null : this.props.goToCartButton}\r\n \r\n {this.props.data.cart.result?.isEmpty ? (\r\n \r\n {this.props.resources.continueShoppingButtonTitle}\r\n \r\n ) : null}\r\n \r\n {this.props.paymentOptionsImgs}\r\n \r\n \r\n \r\n );\r\n }\r\n\r\n /**\r\n * Initiate modal container.\r\n * @returns Inode props.\r\n */\r\n private readonly _modalContainer = (): INodeProps => {\r\n return {\r\n tag: Modal,\r\n placement: 'bottom-end',\r\n hideArrow: true,\r\n className: 'ms-cart-icon__minicartmodal-container',\r\n wrapClassName: 'ms-cart-icon__minicartmodal',\r\n isOpen: this.state.isModalOpen,\r\n toggle: this.closeModal\r\n };\r\n };\r\n\r\n /**\r\n * Initiate open modal.\r\n */\r\n private readonly _openModal = (): void => {\r\n const payLoad = getPayloadObject('click', this.props.telemetryContent!, 'cart-icon', '');\r\n onTelemetryClick(this.props.telemetryContent!, payLoad, 'cart-icon');\r\n this.setState({\r\n isModalOpen: true\r\n });\r\n };\r\n\r\n /**\r\n * Initiate close modal.\r\n */\r\n private readonly closeModal = (): void => {\r\n this.cartIconRef.current?.focus();\r\n this.setState({\r\n isModalOpen: false\r\n });\r\n };\r\n\r\n /**\r\n * Initiate cart close Icon.\r\n * @returns JSX Element.\r\n */\r\n private readonly _renderCartCloseIcon = (): JSX.Element | null => {\r\n return