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utilities/error-utilities.ts?d9a9","webpack://Msdyn365.Commerce.Online/./src/modules/eshop-buybox/components/Popup.tsx?2ae3","webpack://Msdyn365.Commerce.Online/./src/modules/eshop-buybox/components/add-to-cart-component.tsx?c6b4","webpack://Msdyn365.Commerce.Online/./src/modules/eshop-buybox/components/eshop-buybox-samll-components.tsx?1c40","webpack://Msdyn365.Commerce.Online/./src/modules/eshop-buybox/components/dropdown/dropdown.props.ts?c3a0","webpack://Msdyn365.Commerce.Online/./src/modules/eshop-buybox/components/dropdown/dropdown.tsx?c3e9","webpack://Msdyn365.Commerce.Online/./src/modules/eshop-buybox/components/eshop-buybox-product-configure.tsx?e0f8","webpack://Msdyn365.Commerce.Online/./src/modules/eshop-buybox/components/eshop-buybox-find-in-store.tsx?d885","webpack://Msdyn365.Commerce.Online/./src/modules/eshop-buybox/eshop-buybox.tsx?7b8f","webpack://Msdyn365.Commerce.Online/./src/modules/eshop-buybox/eshop-buybox.view.tsx?8c83","webpack://Msdyn365.Commerce.Online/./lib/eshop-buybox/module-registration.js?7f60","webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online/external var \"ReactDOM\"?853b"],"sourcesContent":["import { getPayloadObject, getTelemetryAttributes, IPayLoad, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\r\nimport { debounce } from 'lodash';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport { IQuantityProps } from './Quantity.props';\r\nimport { GetSelectedQuantityValuesInput } from '../../actions/BuyBoxSelectedQuantity/eshop-buybox-selected-quantity';\r\n\r\n\r\ninterface IQuantityState {\r\n currentInput: number;\r\n isUpdateing: boolean;\r\n}\r\n/**\r\n * Quantity Component - This component is used to add or remove quantity\r\n */\r\n@observer\r\nexport default class Quantity extends React.PureComponent {\r\n public static defaultProps: Partial = {\r\n min: 1,\r\n decrementGlyphClass: 'fas fa-minus-circle',\r\n incrementGlyphClass: 'fas fa-plus-circle'\r\n };\r\n\r\n private inputRef: React.RefObject = React.createRef();\r\n private payLoad: IPayLoad;\r\n\r\n constructor(props: IQuantityProps) {\r\n super(props);\r\n this.state = { currentInput: props.currentCount || 1, isUpdateing: false };\r\n this._onIncrement = this._onIncrement.bind(this);\r\n this._onDecrement = this._onDecrement.bind(this);\r\n this._handleChange = this._handleChange.bind(this);\r\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, '');\r\n }\r\n\r\n public componentDidUpdate(prevProps: IQuantityProps): void {\r\n if (!this.props.disabled && this.state.currentInput !== this.props.currentCount && prevProps.currentCount !== this.props.currentCount) {\r\n this.setState({ currentInput: this.props.currentCount || 1});\r\n }\r\n\r\n if (this.props.disabled && !this.state.isUpdateing) {\r\n this.setState({ isUpdateing: true });\r\n }\r\n\r\n if (!this.props.disabled && this.state.isUpdateing) {\r\n this.setState({ currentInput: this.props.currentCount || 1, isUpdateing: false });\r\n }\r\n }\r\n\r\n public render(): JSX.Element {\r\n const {\r\n min,\r\n max,\r\n } = this.props;\r\n\r\n // const glyphMinusClassName: string = `${this.props.decrementGlyphClass!} quantity__controls-glyph`;\r\n // const glyphPlusClassName: string = `${this.props.incrementGlyphClass!} quantity__controls-glyph`;\r\n const decrementDisabled = this.state.currentInput <= (min || 1) || this.props.isGiftCard;\r\n const incrementDisabled = this.state.currentInput >= max || this.props.isGiftCard;\r\n const currentValue = this.state.currentInput;\r\n this.payLoad.contentAction.etext = TelemetryConstant.DecrementQuantity;\r\n const decrementAttributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\r\n this.payLoad.contentAction.etext = TelemetryConstant.IncrementQuantity;\r\n const incrementAttributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\r\n\r\n let extraClassDecrement = '';\r\n if (decrementDisabled) {\r\n // The quantity has reached its boundaries (max or min)\r\n extraClassDecrement ='disabled';\r\n\r\n } else if (this.props.disabled) {\r\n // this.props.disabled shows if the state is not succeded yet\r\n extraClassDecrement = 'transition';\r\n }\r\n let extraClassIncrement = '';\r\n if (incrementDisabled) {\r\n // The quantity has reached its boundaries (max or min)\r\n extraClassIncrement ='disabled';\r\n } else if (this.props.disabled) {\r\n // this.props.disabled shows if the state is not succeded yet\r\n extraClassIncrement = 'transition';\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 \r\n
\r\n \r\n );\r\n }\r\n\r\n private _onIncrement(): void {\r\n let invokeCallback = false;\r\n const currQuantity = this.state.currentInput;\r\n let updatedQuantity: number;\r\n\r\n if (currQuantity < this.props.max) {\r\n invokeCallback = true;\r\n updatedQuantity = currQuantity + 1 ;\r\n } else {\r\n invokeCallback = false;\r\n updatedQuantity = this.props.max;\r\n }\r\n\r\n if (invokeCallback && this.props.onChange) {\r\n if (this.props.onChange(updatedQuantity)) {\r\n this.setState({ currentInput: updatedQuantity });\r\n this.props.context?.update(new GetSelectedQuantityValuesInput(), { selectedQuantity: updatedQuantity });\r\n }\r\n }\r\n }\r\n\r\n private _onDecrement(): void {\r\n let invokeCallback = false;\r\n const currQuantity = this.state.currentInput;\r\n let updatedQuantity: number;\r\n\r\n if (currQuantity > 1) {\r\n invokeCallback = true;\r\n updatedQuantity = currQuantity - 1;\r\n } else {\r\n invokeCallback = false;\r\n updatedQuantity = 1;\r\n }\r\n\r\n if (invokeCallback && this.props.onChange) {\r\n if (this.props.onChange(updatedQuantity)) {\r\n this.setState({ currentInput: updatedQuantity });\r\n this.props.context?.update(new GetSelectedQuantityValuesInput(), { selectedQuantity: updatedQuantity });\r\n }\r\n }\r\n }\r\n\r\n private _handleChange(e: React.ChangeEvent): void {\r\n const currentValue = parseInt((e.target.value), 10);\r\n this.props.context?.update(new GetSelectedQuantityValuesInput(), { selectedQuantity: currentValue });\r\n const minValue = this.props.min === undefined ? 1 : this.props.min;\r\n const inputElement = this.inputRef && this.inputRef.current && this.inputRef.current instanceof HTMLInputElement && this.inputRef.current;\r\n\r\n if (currentValue > this.props.max) {\r\n this.setState(\r\n { currentInput: this.props.max },\r\n () => {\r\n debounce(\r\n () => {\r\n // due of usage debouncer, we may ignore onChange return value\r\n this.props.onChange && this.props.onChange(this.state.currentInput);\r\n },\r\n 200)();\r\n }\r\n );\r\n } else {\r\n this.setState(\r\n { currentInput: currentValue },\r\n () => {\r\n debounce(\r\n () => {\r\n if (!isNaN(this.state.currentInput) && !(this.state.currentInput < minValue)) {\r\n // due of usage debouncer, we may ignore onChange return value\r\n this.props.onChange && this.props.onChange(this.state.currentInput);\r\n\r\n if (inputElement) {\r\n inputElement.setAttribute('aria-valuenow', currentValue.toString());\r\n inputElement.setAttribute('value', currentValue.toString());\r\n }\r\n }\r\n },\r\n 200)();\r\n }\r\n );\r\n }\r\n }\r\n\r\n private _validateMin = (): void => {\r\n const minValue = this.props.min === undefined ? 1 : this.props.min;\r\n if (isNaN(this.state.currentInput) || (this.state.currentInput < minValue)) {\r\n this.setState({ currentInput: minValue }, () => { this.props.onChange && this.props.onChange(this.state.currentInput); });\r\n } else {\r\n this.props.onChange && this.props.onChange(this.state.currentInput);\r\n }\r\n }\r\n}","/* tslint:disable: no-duplicate-imports */\r\nimport { IAddToCartFailureResult } from '@msdyn365-commerce/components';\r\nimport { IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport { OrgUnitLocation, ProductAvailableQuantity , ProductDimension, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { IEshopBuyboxResources } from '../eshop-buybox.props.autogenerated';\r\nimport resource from '../resources/resource.json';\r\n\r\nexport function getQuantityError(stockLeft: number | undefined, resources: IEshopBuyboxResources): string | undefined {\r\n if (!stockLeft || stockLeft <= 0) {\r\n return resources.errorMessageOutOfStock;\r\n } else if (stockLeft === 1) {\r\n return resources.errorMessageOutOfRangeOneLeft;\r\n } else {\r\n return resources.errorMessageOutOfRangeFormat.replace('{numLeft}', stockLeft.toString());\r\n }\r\n}\r\n\r\n// tslint:disable-next-line:cyclomatic-complexity\r\nexport function getGenericError(\r\n result: IAddToCartFailureResult,\r\n cart: ICartState | undefined,\r\n resources: IEshopBuyboxResources,\r\n context: ICoreContext>,\r\n product: SimpleProduct | undefined,\r\n productAvailability: ProductAvailableQuantity | undefined,\r\n location: OrgUnitLocation | undefined)\r\n : string | undefined {\r\n const localeCode = context.request.locale.split('-')[0];\r\n if (result.failureReason === 'EMPTYINPUT') {\r\n return resources.addedToCartFailureMessage;\r\n } else if (result.failureReason === 'CARTACTIONFAILED') {\r\n if (result.cartActionResult && result.cartActionResult.substatus === 'MAXQUANTITY') {\r\n // get the quantity of the product in cart\r\n let elementFoundAt:number = -1;\r\n const productIdToFind = product?.RecordId;\r\n\r\n for (let i = 0; i < cart!.cart.CartLines!.length; i++) {\r\n if (cart!.cart.CartLines![`${i}`].ProductId === productIdToFind &&\r\n (cart!.cart.CartLines![`${i}`].DeliveryMode || '') === (location && context.actionContext.requestContext.channel?.PickupDeliveryModeCode || '') &&\r\n (cart!.cart.CartLines![`${i}`].FulfillmentStoreId || '') === (location?.OrgUnitNumber || '')) {\r\n elementFoundAt = i;\r\n\r\n break;\r\n }\r\n }\r\n\r\n let curQuantity: number = 0;\r\n\r\n if (elementFoundAt !== -1) {\r\n const cartLineToUpdate = {...cart!.cart.CartLines![`${elementFoundAt}`]};\r\n curQuantity = cartLineToUpdate.Quantity || 0;\r\n }\r\n\r\n // get the quantity limit for the product\r\n const maxQuantityForCartLineItem = context.app.config.maxQuantityForCartLineItem;\r\n const availableQty = productAvailability?.AvailableQuantity;\r\n\r\n let quantityLimit: number;\r\n\r\n if (maxQuantityForCartLineItem === undefined && availableQty === undefined) {\r\n quantityLimit = 10;\r\n } else if (availableQty === undefined) {\r\n quantityLimit = maxQuantityForCartLineItem;\r\n } else if (maxQuantityForCartLineItem === undefined) {\r\n quantityLimit = availableQty;\r\n } else {\r\n quantityLimit = Math.min(maxQuantityForCartLineItem, availableQty);\r\n }\r\n\r\n return resource.maxQuantityLimitText[`${localeCode}`].replace('{curQuantity}', curQuantity.toString()).replace('{maxQuantity}', quantityLimit.toString());\r\n } else if (result.cartActionResult && result.cartActionResult.substatus === 'QUANTITYLIMITS') {\r\n return result.cartActionResult?.errorDetails?.LocalizedMessage;\r\n }\r\n\r\n return resources.addedToCartFailureMessage;\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\nexport function getConfigureErrors(result: ProductDimension[] | undefined, resources: IEshopBuyboxResources, isGiftCard?: Boolean): { [configureId: string]: string | undefined } {\r\n if (!result) {\r\n return {};\r\n }\r\n\r\n const dimensions: { [configureId: string]: string | undefined } = {};\r\n\r\n result.forEach(dimension => {\r\n dimensions[dimension.DimensionTypeValue] = getDimensionErrorString(dimension.DimensionTypeValue, resources, isGiftCard);\r\n });\r\n\r\n return dimensions;\r\n}\r\n\r\nexport function getDimensionErrorString(dimensionTypeValue: number, resources: IEshopBuyboxResources, isGiftCard?: Boolean): string {\r\n switch (dimensionTypeValue) {\r\n case 1: // ProductDimensionType.Color\r\n return resources.productDimensionTypeColorErrorMessage;\r\n case 2: // ProductDimensionType.Configuration\r\n return resources.productDimensionTypeConfigurationErrorMessage;\r\n case 3: // ProductDimensionType.Size\r\n return resources.productDimensionTypeSizeErrorMessage;\r\n case 4: // ProductDimensionType.Style\r\n return isGiftCard ? resources.productDimensionTypeAmountErrorMessage : resources.productDimensionTypeStyleErrorMessage;\r\n default:\r\n return '';\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\nimport { IComponentProps, IGridSettings, IImageSettings, Image } from '@msdyn365-commerce/core';\r\nimport { ProductPrice, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { getFallbackImageUrl } from '@msdyn365-commerce-modules/retail-actions';\r\nimport * as React from 'react';\r\n\r\nimport { Button, getPayloadObject, getTelemetryAttributes, ITelemetryContent, TelemetryConstant,Modal, ModalBody, ModalHeader } from '@msdyn365-commerce-modules/utilities';\r\n\r\nexport interface IPopupProps extends IComponentProps<{ product: SimpleProduct | undefined; price: ProductPrice | undefined }> {\r\n dialogStrings?: {\r\n goToCartText: string;\r\n continueShoppingText: string;\r\n headerItemOneText: string;\r\n headerItemFormatText: string;\r\n headerMessageText: string;\r\n freePriceText: string;\r\n originalPriceText: string;\r\n currentPriceText: string;\r\n };\r\n\r\n className: string;\r\n imageSettings?: IImageSettings;\r\n gridSettings: IGridSettings | undefined;\r\n productQuantity: number;\r\n priceComponent: React.ReactNode;\r\n navigationUrl?: string;\r\n modalOpen: boolean | undefined;\r\n telemetryContent?: ITelemetryContent;\r\n setModalOpen(newValue: boolean): void;\r\n}\r\n\r\nexport const Popup = (popupProps: IPopupProps) => {\r\n const { dialogStrings, className, imageSettings, gridSettings, data: { product, price }, productQuantity, priceComponent, navigationUrl, modalOpen, telemetryContent, setModalOpen, context } = popupProps;\r\n const closeModal = React.useCallback(() => {\r\n setModalOpen(false);\r\n }, [setModalOpen]);\r\n if (!dialogStrings || !product) {\r\n return null;\r\n }\r\n const payLoad = getPayloadObject('click', telemetryContent!, TelemetryConstant.ContinueShopping);\r\n const continueShoppingAttribute = getTelemetryAttributes(telemetryContent!, payLoad);\r\n payLoad.contentAction.etext = TelemetryConstant.ViewBagAndCheckout;\r\n const viewBagAttribute = getTelemetryAttributes(telemetryContent!, payLoad);\r\n\r\n const fallbackImageUrl = getFallbackImageUrl(product.ItemId, context.actionContext.requestContext.apiSettings);\r\n if (imageSettings) {\r\n imageSettings.cropFocalRegion = true;\r\n }\r\n const quantity = productQuantity !== undefined ? productQuantity : 1;\r\n const itemsString = quantity === 1 ? dialogStrings.headerItemOneText : dialogStrings.headerItemFormatText.replace('{0}', quantity.toString());\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- app configs are of generic type\r\n const shouldDisplayUnitOfMeasure = context.app.config?.unitOfMeasureDisplayType && context.app.config.unitOfMeasureDisplayType !== 'none';\r\n\r\n const reducedDimensions: string = product.Dimensions ? product.Dimensions.reduce(\r\n (str, productDimension) => {\r\n if (productDimension.DimensionValue && productDimension.DimensionValue.Value) {\r\n if (str) {\r\n return `${str}, ${productDimension.DimensionValue.Value}`;\r\n }\r\n\r\n return `${productDimension.DimensionValue.Value}`;\r\n }\r\n\r\n return str;\r\n },\r\n '') : '';\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n {itemsString}\r\n \r\n \r\n {dialogStrings.headerMessageText}\r\n \r\n \r\n \r\n \r\n \r\n {product.Name}\r\n \r\n {reducedDimensions !== '' ?
\r\n {reducedDimensions}\r\n
: ''}\r\n {price ? (\r\n
\r\n {priceComponent}\r\n
\r\n ) : ''}\r\n {product.DefaultUnitOfMeasure && shouldDisplayUnitOfMeasure ? (\r\n
\r\n \r\n {product.DefaultUnitOfMeasure}\r\n \r\n
\r\n ) : ''}\r\n \r\n {dialogStrings.goToCartText}\r\n \r\n \r\n {dialogStrings.continueShoppingText}\r\n \r\n
\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default Popup;\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\nimport { getCatalogId, IComponent, IComponentProps, IGridSettings, IImageSettings, msdyn365Commerce, TelemetryEvent } from '@msdyn365-commerce/core';\r\nimport { getCartState, ICartActionResult, ICartState } from '@msdyn365-commerce/global-state';\r\nimport {\r\n CartLineValidationResults, CartsDataActions, format,\r\n ProductAvailableQuantity, ProductDimension, ProductPrice,\r\n ProductsDataActions, ProductSearchCriteria, ProductType, SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { ErrorNotification, NotificationsManager } from '@msdyn365-commerce-modules/notifications-core';\r\nimport { ArrayExtensions, generateProductImageUrl, ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport React, { useState } from 'react';\r\nimport {Popup, IPopupProps} from './Popup';\r\nimport { PriceComponent,\r\n IItemsAddedToCartResources,\r\n ItemsAddedToCartDialogComponent,\r\n //ItemSuccessfullyAddedToCartNotification,\r\n //MultiItemsSuccessfullyAddedToCartNotification,\r\n OrderDetailsProduct\r\n } from '@msdyn365-commerce/components';\r\n import { toast } from 'react-toastify';\r\n import { generateErrorLog } from '../../../actions/helper-functions';\r\n import { FormDetails } from '../../../actions/ecomm-interfaces';\r\n\r\n\r\n/**\r\n * Interface for add to cart resources.\r\n */\r\nexport interface IAddToCartResources {\r\n goToCartText: string;\r\n continueShoppingText: string;\r\n closeNotificationLabel: string;\r\n headerItemOneText: string;\r\n headerItemFormatText: string;\r\n headerLinesFormatText?: string;\r\n headerMessageText: string;\r\n freePriceText: string;\r\n originalPriceText: string;\r\n currentPriceText: string;\r\n addedQuantityText: string;\r\n buyAgainNotificationTitle?: string;\r\n buyAgainNotificationCloseAriaLabel?: string;\r\n validationErrorMessage?: string;\r\n oneErrorText?: string;\r\n multiErrorsText?: string;\r\n}\r\n\r\n/**\r\n * Interface for add to cart components props.\r\n */\r\nexport interface IAddToCartComponentProps extends IComponentProps<{ product: SimpleProduct; price?: ProductPrice } | undefined> {\r\n className?: string;\r\n addToCartText: string;\r\n outOfStockText?: string;\r\n disabled?: boolean;\r\n quantity?: number;\r\n navigationUrl?: string;\r\n productAvailability?: ProductAvailableQuantity;\r\n getSelectedProduct?: Promise;\r\n isNavigationToCartPageDisabled?: boolean;\r\n shouldSkipSiteSettings?: boolean;\r\n addToCartArialLabel?: string;\r\n products?: {\r\n productId: number;\r\n quantity: number;\r\n catalogId?: number;\r\n }[];\r\n orderDetailsProducts?: OrderDetailsProduct[];\r\n hasAvailableProducts?: boolean;\r\n imageSettings?: IImageSettings;\r\n gridSettings?: IGridSettings;\r\n\r\n isLoading?: boolean;\r\n isUpdatingDimension?: boolean;\r\n isLoadingDeliveryOptions?: boolean;\r\n isUpdatingDeliveryOptions?: boolean;\r\n isAddServiceItemToCart?: boolean;\r\n isAddEmailDeliveryItemToCart?: boolean;\r\n isPriceKeyedIn?: boolean;\r\n customPriceAmount?: number;\r\n isOrderQuantityLimitsFeatureEnabled?: boolean;\r\n\r\n dialogStrings?: IAddToCartResources;\r\n\r\n telemetryContent?: ITelemetryContent;\r\n\r\n catalogId?: number;\r\n\r\n isCustomPriceSelected?: boolean;\r\n maximumKeyInPrice?: number;\r\n minimumKeyInPrice?: number;\r\n defaultMaximumKeyInPrice?: number;\r\n defaultMinimumKeyInPrice?: number;\r\n isProductQuantityLoading?: boolean;\r\n cartLineId?: string;\r\n updateCartTitle?: string;\r\n\r\n onAdd?(result: ICartActionResult): void;\r\n onError?(result: IAddToCartFailureResult): void;\r\n changeUpdatingDimension?(isUpdatingDimension: boolean): void;\r\n changeUpdatingDeliveryOptions?(isUpdatingDeliveryOptions: boolean): void;\r\n}\r\n\r\n/**\r\n * Cart action Failure reason type.\r\n */\r\nexport declare type ICartActionFailureReason = 'EMPTYINPUT' | 'MISSINGDIMENSION' | 'OUTOFSTOCK' | 'CARTACTIONFAILED' | 'INVALIDCUSTOMAMOUNT';\r\n\r\n/**\r\n * Interface for add to cart failure result.\r\n */\r\nexport interface IAddToCartFailureResult {\r\n failureReason: ICartActionFailureReason;\r\n\r\n stockLeft?: number;\r\n cartActionResult?: ICartActionResult;\r\n missingDimensions?: ProductDimension[];\r\n}\r\n\r\n/**\r\n * This setting defines the experience when a product is added to cart. Corresponds to the configuration in Fabrikam.\r\n */\r\nexport enum AddToCartBehavior {\r\n\r\n /**\r\n * Navigate to cart page.\r\n */\r\n goToCart = 'goToCart',\r\n\r\n /**\r\n * Show item added to cart popup.\r\n */\r\n showModal = 'showModal',\r\n\r\n /**\r\n * Show mini cart popup.\r\n */\r\n showMiniCart = 'showMiniCart',\r\n\r\n /**\r\n * Show item added to cart notification.\r\n */\r\n showNotification = 'showNotification',\r\n\r\n /**\r\n * Do nothing and stay on the page.\r\n */\r\n nothing = 'nothing'\r\n}\r\n\r\nconst zero = 0;\r\nconst defaultQuantity = 1;\r\n\r\n/**\r\n * The propagate result.\r\n * @param props -- The add to cart component props.\r\n * @param result -- The cart action result.\r\n */\r\nconst propagateResult = (props: IAddToCartComponentProps, result: ICartActionResult): void => {\r\n if (props.onAdd) {\r\n props.onAdd(result);\r\n }\r\n};\r\n\r\n/**\r\n * The propagate error.\r\n * @param props -- The add to cart component props.\r\n * @param result -- The add to cart failure result.\r\n */\r\nconst propagateError = (props: IAddToCartComponentProps, result: IAddToCartFailureResult): void => {\r\n if (props.onError) {\r\n props.onError(result);\r\n }\r\n};\r\n\r\n/**\r\n * Retrieves add to cart input from the component props.\r\n * @param props - Add to cart component props.\r\n * @returns Add to cart input.\r\n */\r\nconst getAddToCartInputFromProps = async (props: IAddToCartComponentProps) => {\r\n const products = props.orderDetailsProducts?.filter(product => !ObjectExtensions.isNullOrUndefined(product.simpleProduct));\r\n const input = products?.map(product => {\r\n return {\r\n product: product.simpleProduct!,\r\n count: ObjectExtensions.isNullOrUndefined(product.salesLine.Quantity) ? defaultQuantity : product.salesLine.Quantity,\r\n catalogId: product.salesLine.CatalogId\r\n };\r\n });\r\n\r\n if (ArrayExtensions.hasElements(input)) {\r\n return input;\r\n }\r\n\r\n if (ArrayExtensions.hasElements(props.products)) {\r\n const actionContext = props.context.actionContext;\r\n const apiSettings = actionContext.requestContext.apiSettings;\r\n\r\n const searchCriteriaInput: ProductSearchCriteria = {\r\n Context: {\r\n ChannelId: apiSettings.channelId,\r\n CatalogId: props.catalogId ?? getCatalogId(props.context.actionContext.requestContext)\r\n },\r\n IncludeAttributes: false,\r\n Ids: props.products.map(product => product.productId)\r\n };\r\n\r\n const searchResult = await ProductsDataActions.searchByCriteriaAsync(\r\n { callerContext: actionContext }, searchCriteriaInput);\r\n const productSearchResultsWithImages = searchResult.map(productSearchResult => {\r\n const newProductSearchResult = { ...productSearchResult };\r\n const newImageUrl = generateProductImageUrl(newProductSearchResult, apiSettings);\r\n\r\n if (newImageUrl) {\r\n newProductSearchResult.PrimaryImageUrl = newImageUrl;\r\n }\r\n\r\n return newProductSearchResult;\r\n });\r\n\r\n return props.products.map(item => {\r\n const productData = productSearchResultsWithImages.find(product => product.RecordId === item.productId);\r\n let simpleProduct: SimpleProduct;\r\n if (productData) {\r\n simpleProduct = {\r\n ...productData,\r\n ProductTypeValue: ProductType.Variant,\r\n AdjustedPrice: productData.Price,\r\n BasePrice: productData.BasePrice ?? productData.Price\r\n };\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- Cast to simple product since only record id is available.\r\n simpleProduct = {\r\n RecordId: item.productId\r\n } as SimpleProduct;\r\n }\r\n\r\n return {\r\n product: simpleProduct,\r\n count: item.quantity,\r\n catalogId: item.catalogId\r\n };\r\n });\r\n }\r\n\r\n if (props.data?.product) {\r\n return [\r\n {\r\n product: props.data.product,\r\n count: props.quantity ?? defaultQuantity,\r\n catalogId: props.catalogId\r\n }\r\n ];\r\n }\r\n\r\n return [];\r\n};\r\n\r\n/**\r\n * Add one item to cart when it is not buy again.\r\n * @param props -- The props.\r\n * @param setDisabled -- The set disable call back.\r\n * @param openModal -- The open modal call back.\r\n */\r\nconst addOneItemToCart = async (props: IAddToCartComponentProps,\r\n setDisabled: (disabled: boolean) => void,\r\n openModal: (opened: boolean) => void): Promise => {\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- read config file.\r\n //const addToCartBehavior = props.context.app.config.addToCartBehavior;\r\n //const data = props.data;\r\n\r\n const addToCartInput = await getAddToCartInputFromProps(props);\r\n const product = addToCartInput[0].product;\r\n const quantity = addToCartInput[0].count;\r\n const dimensions = addToCartInput[0].product.Dimensions ||[];\r\n\r\n const cartState = await getCartState(props.context.actionContext);\r\n\r\n const cart = cartState.cart;\r\n\r\n const isItemExistsInCart = cart.CartLines?.filter(el=>el.LineId == props.cartLineId);\r\n\r\n //logic to update only quantity if no dimensions involved in product\r\n if(isItemExistsInCart && isItemExistsInCart?.length>0 && props.cartLineId && dimensions?.length<=0)\r\n { \r\n const newQuantity = quantity!;\r\n const cartLineId = props.cartLineId;\r\n const updateQuantityResult = await cartState.updateCartLineQuantity({cartLineId, newQuantity})\r\n\r\n if (updateQuantityResult.status === 'SUCCESS') {\r\n \r\n if (updateQuantityResult.status === 'SUCCESS') {\r\n setDisabled(false);\r\n openModal(false);\r\n } else {\r\n setDisabled(false);\r\n \r\n }\r\n propagateResult(props, updateQuantityResult);\r\n } else {\r\n NotificationsManager.instance().addNotification(new ErrorNotification(\r\n updateQuantityResult.errorDetails?.LocalizedMessage ?? ' update cart failed',\r\n props.dialogStrings?.closeNotificationLabel ?? ''));\r\n \r\n propagateError(props, { failureReason: 'CARTACTIONFAILED', cartActionResult: updateQuantityResult });\r\n setDisabled(false);\r\n }\r\n } else{\r\n //logic to remove existing cartLine if dimensions are involved in product and add it as new product to cart. Because there is no out of box method to update product in cart.\r\n if(isItemExistsInCart && isItemExistsInCart?.length>0 && dimensions?.length>0)\r\n {\r\n let cartLinesToRemove = [props.cartLineId!];\r\n \r\n const input = { cartLineIds: cartLinesToRemove };\r\n \r\n const removeCartLineResult = await cartState.removeCartLines(input);\r\n\r\n cartState.refreshCart({});\r\n\r\n if (removeCartLineResult.status === 'SUCCESS') {\r\n \r\n if (removeCartLineResult.status === 'SUCCESS') {\r\n setDisabled(false);\r\n \r\n openModal(false); \r\n } else {\r\n setDisabled(false);\r\n \r\n }\r\n } else {\r\n NotificationsManager.instance().addNotification(new ErrorNotification(\r\n removeCartLineResult.errorDetails?.LocalizedMessage ?? ' update cart failed',\r\n props.dialogStrings?.closeNotificationLabel ?? ''));\r\n \r\n propagateError(props, { failureReason: 'CARTACTIONFAILED', cartActionResult: removeCartLineResult });\r\n toast.error('update cart failed, please try again!');\r\n setDisabled(false);\r\n }\r\n \r\n }\r\n\r\n const addToCartResult = await cartState.addProductToCart({\r\n product,\r\n count: quantity,\r\n availableQuantity: props.productAvailability?.AvailableQuantity,\r\n additionalProperties: { orderQuantityLimitsFeatureIsEnabled: props.isOrderQuantityLimitsFeatureEnabled },\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- read config file.\r\n enableStockCheck: props.context.app.config.enableStockCheck,\r\n isPriceKeyedIn: props.isPriceKeyedIn,\r\n customPrice: props.customPriceAmount,\r\n isAddEmailDeliveryItemToCart: props.isAddEmailDeliveryItemToCart,\r\n shouldSkipSiteSettings: props.shouldSkipSiteSettings,\r\n catalogId: addToCartInput[0].catalogId,\r\n });\r\n\r\n \r\n cartState.refreshCart({});\r\n \r\n if (addToCartResult.status === 'SUCCESS') {\r\n //props.dialogStrings && addToCartBehavior === AddToCartBehavior.showModal\r\n \r\n if (addToCartResult.status === 'SUCCESS') {\r\n setDisabled(false);\r\n openModal(false);\r\n \r\n } else {\r\n setDisabled(false);\r\n \r\n }\r\n propagateResult(props, addToCartResult);\r\n } else {\r\n NotificationsManager.instance().addNotification(new ErrorNotification(\r\n addToCartResult.errorDetails?.LocalizedMessage ?? 'Add to cart failed',\r\n props.dialogStrings?.closeNotificationLabel ?? ''));\r\n \r\n propagateError(props, { failureReason: 'CARTACTIONFAILED', cartActionResult: addToCartResult });\r\n setDisabled(false);\r\n }\r\n\r\n }\r\n\r\n const logDetail = 'Capturing user actions eShop, File: add-to-cart-component.tsx, funtion: addOneItemToCart';\r\n const productId = product.ProductNumber?.toString() ||'';\r\n const item: FormDetails = {\r\n CartLineID: cartState.cart.CartLines![cartState.cart.CartLines!.length - 1].LineId!, CartID: cart.Id, CartLineComment: '', ParentCartLineID: '',\r\n ProductID: productId, EventID: '', EventName: '',\r\n SerialID: '', SerialNumber: quantity.toString(), SerialName: '',\r\n Name_1: '', Name_2: '', Name_3: '', Name_4: '', Name_5: '', Name_6: '', Name_7: '', Name_8: '', Name_9: '', Name_10: '', \r\n Name_11: '', Name_12: '', Name_13: '', Name_14: '', Name_15: '', Name_16: '', Name_17: '', Name_18: '', Name_19: '', Name_20: '',\r\n Remarks: '', Message: '',\r\n Category: '', DedicatedBy: '',\r\n HasTaxDeduction: false, Nric: '',\r\n BuildingName: '', UnitNumber: '', PostalCode: '', PhoneNumber: '', Country: '',\r\n ChineseName:'',\r\n SchoolName: '', CompanyName: '',\r\n DonationOption: '', BlessingOption: '', LightOption: '',\r\n ValidFrom: '', ValidTo: '',\r\n DedicationPeriod: '',\r\n StartDate: '',\r\n Gender: '',\r\n SurgeryDate: '',\r\n BirthDate: '', BirthTime: '',\r\n BirthDate_2: '', BirthTime_2: '',\r\n DeathDate: '', DeathTime: '',\r\n DeceasedRelationship: '',\r\n NameChange: '', OldName_1: '', OldName_2: '',\r\n NameNextKin:'',\r\n ContactNumber:'',\r\n ContactNumberNextKin:'',\r\n PassportNumber:'',\r\n PassportExpiryDate:'',\r\n PassportIssuedDate:'',\r\n Consent:0,\r\n IsInsuranceIncluded: 0\r\n };\r\n\r\n await generateErrorLog(props.context, \"User clicked Add to Cart button in default PDP page eShop\", logDetail, item);\r\n \r\n};\r\n\r\n/**\r\n * Callback to handle success of adding to cart.\r\n * @param props - Add to cart component props.\r\n * @param setDisabled - Callback to update disabled state of the component.\r\n * @param setItemsAddedToCartDialogOpen - Callback to update disabled state of the component.\r\n * @param setErrorMessage - Callback to update error message state of the component.\r\n * @param cartState - Current cart state.\r\n * @param addToCartInput - Input used for adding to cart.\r\n * @param addToCartResult - Result of adding to cart.\r\n */\r\nconst handleAddItemsToCartSuccess = async (props: IAddToCartComponentProps,\r\n setDisabled: (disabled: boolean) => void,\r\n setItemsAddedToCartDialogOpen: (opened: boolean) => void,\r\n setErrorMessage: (message: string) => void,\r\n cartState: ICartState,\r\n addToCartInput: {\r\n product: SimpleProduct;\r\n count: number;\r\n }[],\r\n addToCartResult: ICartActionResult) => {\r\n\r\n // Validate cart for line errors.\r\n const validationResult: CartLineValidationResults = await CartsDataActions.validateForCheckoutAsync(\r\n { callerContext: props.context.actionContext, bypassCache: 'none' },\r\n cartState.cart.Id, cartState.cart.Version\r\n );\r\n const errorCount = (validationResult.ValidationFailuresByCartLines ?? []).length;\r\n const singleErrorCount = 1;\r\n const errorText = errorCount === singleErrorCount ? props.dialogStrings?.oneErrorText : props.dialogStrings?.multiErrorsText;\r\n const errorMessage = errorCount > zero ? format(props.dialogStrings?.validationErrorMessage ?? '', errorCount.toString(), errorText) : '';\r\n\r\n setErrorMessage(errorMessage);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- read config file.\r\n //const addToCartBehavior = props.context.app.config.addToCartBehavior;\r\n const addToCartBehavior = true;\r\n //props.dialogStrings && addToCartBehavior === AddToCartBehavior.showModal\r\n if (addToCartBehavior) {\r\n setDisabled(false);\r\n setItemsAddedToCartDialogOpen(true);\r\n } \r\n //else if (props.dialogStrings && addToCartBehavior === AddToCartBehavior.showNotification) {\r\n // setDisabled(false);\r\n // const itemsAddedResource: IItemsAddedToCartResources = {\r\n // viewCartButtonText: props.dialogStrings.goToCartText,\r\n // closeButtonLabel: props.dialogStrings.closeNotificationLabel,\r\n // itemsAddedToCartHeaderText: props.dialogStrings.headerMessageText,\r\n // itemsAddedToCartFormatText: props.dialogStrings.headerItemFormatText,\r\n // linesAddedToCartFormatText: props.dialogStrings.headerLinesFormatText ?? '{0}',\r\n // itemsAddedValidationErrorMessage: errorMessage\r\n // };\r\n\r\n // const notification = new MultiItemsSuccessfullyAddedToCartNotification(\r\n // props.context,\r\n // itemsAddedResource,\r\n // props.imageSettings,\r\n // props.gridSettings,\r\n // addToCartInput,\r\n // props.navigationUrl,\r\n // props.telemetryContent!,\r\n // props.id,\r\n // props.typeName);\r\n // NotificationsManager.instance().addNotification(notification);\r\n // } else if (MsDyn365.isBrowser && props.navigationUrl && !props.isNavigationToCartPageDisabled &&\r\n // (addToCartBehavior === undefined || addToCartBehavior === AddToCartBehavior.goToCart)) {\r\n // window.location.assign(props.navigationUrl);\r\n // } \r\n else {\r\n setDisabled(false);\r\n }\r\n propagateResult(props, addToCartResult);\r\n};\r\n\r\n/**\r\n * Add one or multi item to cart from buy again.\r\n * @param props -- The props.\r\n * @param setDisabled -- The set disable call back.\r\n * @param setItemsAddedToCartDialogOpen -- The open modal call back.\r\n * @param setErrorMessage -- The set error message call back.\r\n */\r\nconst addItemsToCart = async (props: IAddToCartComponentProps,\r\n setDisabled: (disabled: boolean) => void,\r\n setItemsAddedToCartDialogOpen: (opened: boolean) => void,\r\n setErrorMessage: (message: string) => void): Promise => {\r\n\r\n const addToCartInput = await getAddToCartInputFromProps(props);\r\n\r\n if (!ArrayExtensions.hasElements(addToCartInput)) {\r\n return;\r\n }\r\n\r\n const cartState = await getCartState(props.context.actionContext);\r\n const addToCartResult = await cartState.addProductsToCart(addToCartInput);\r\n\r\n if (addToCartResult.status === 'SUCCESS') {\r\n await handleAddItemsToCartSuccess(\r\n props, setDisabled, setItemsAddedToCartDialogOpen, setErrorMessage,\r\n cartState, addToCartInput, addToCartResult);\r\n } else {\r\n if (props.dialogStrings?.buyAgainNotificationTitle) {\r\n // For buy again show simple error notification.\r\n NotificationsManager.instance().addNotification(new ErrorNotification(\r\n props.dialogStrings.buyAgainNotificationTitle,\r\n props.dialogStrings.buyAgainNotificationCloseAriaLabel ?? ''));\r\n } else {\r\n NotificationsManager.instance().addNotification(new ErrorNotification(\r\n addToCartResult.errorDetails?.LocalizedMessage ?? 'Add to cart failed',\r\n props.dialogStrings?.closeNotificationLabel ?? ''));\r\n }\r\n\r\n propagateError(props, { failureReason: 'CARTACTIONFAILED', cartActionResult: addToCartResult });\r\n setDisabled(false);\r\n }\r\n};\r\n\r\n/**\r\n * Interface for add to cart component.\r\n */\r\nexport interface IAddtoCartComponent extends IComponent {\r\n onClick(): (event: React.MouseEvent, props: IAddToCartComponentProps) => void;\r\n}\r\n\r\n/**\r\n * On click function.\r\n * @param _event - The mouse event.\r\n * @param props - The props.\r\n * @param setDisabled - Flag to define whether the element is disabled.\r\n * @param openModal - Flag to specify if it should open in a modal window.\r\n * @param setItemsAddedToCartDialogOpen - Sets items added to cart while dialog is open.\r\n * @param setErrorMessage - Error message.\r\n */\r\nconst onClick = async (_event: React.MouseEvent,\r\n props: IAddToCartComponentProps,\r\n setDisabled: (disabled: boolean) => void,\r\n openModal: (opened: boolean) => void,\r\n setItemsAddedToCartDialogOpen: (opened: boolean) => void,\r\n setErrorMessage: (message: string) => void): Promise => {\r\n\r\n if (!ArrayExtensions.hasElements(props.products)) {\r\n const cartError = addToCartError(props);\r\n\r\n if (cartError) {\r\n propagateError(props, cartError);\r\n return;\r\n }\r\n\r\n setDisabled(true);\r\n }\r\n\r\n const hasOrderDetailsProducts = ArrayExtensions.hasElements(props.orderDetailsProducts) && props.orderDetailsProducts.length > defaultQuantity;\r\n const hasProducts = ArrayExtensions.hasElements(props.products) && props.products.length > defaultQuantity;\r\n\r\n const hasMultipleProducts = hasOrderDetailsProducts || hasProducts;\r\n if (props.shouldSkipSiteSettings && hasMultipleProducts) {\r\n await addItemsToCart(props, setDisabled, setItemsAddedToCartDialogOpen, setErrorMessage);\r\n } else {\r\n await addOneItemToCart(props, setDisabled, openModal);\r\n }\r\n};\r\n\r\n/**\r\n * Add to cart component action constant.\r\n */\r\nconst AddToCartComponentActions = {\r\n onClick\r\n};\r\n\r\n/**\r\n * Add to cart component.\r\n * @param props - The props.\r\n * @returns - The add to cart component.\r\n */\r\nexport const AddToCartFunctionalComponent: React.FC = (props: IAddToCartComponentProps) => {\r\n const [disabled, setDisabled] = useState(false);\r\n const [modalOpen, setModalOpen] = useState(false);\r\n const [isItemsAddedToCartDialogOpen, setItemsAddedToCartDialogOpen] = useState(false);\r\n const [errorMessage, setErrorMessage] = useState('');\r\n const [addToCartInput, setAddToCartInput] = useState<{\r\n product: SimpleProduct;\r\n count: number;\r\n }[]>([]);\r\n\r\n const onClickHandler = async (event: React.MouseEvent) => {\r\n await AddToCartComponentActions.onClick(event, props, setDisabled, setModalOpen, setItemsAddedToCartDialogOpen, setErrorMessage);\r\n };\r\n\r\n /**\r\n * Close dialog.\r\n */\r\n const closeItemsAddedToCartDialog = React.useCallback(() => {\r\n setItemsAddedToCartDialogOpen(false);\r\n }, []);\r\n\r\n const priceComponent = props.data?.price ? (\r\n ) : '';\r\n\r\n const popupProps: IPopupProps = {\r\n context: props.context,\r\n className: 'msc-add-to-cart col-md-5',\r\n id: props.id,\r\n typeName: props.typeName,\r\n data: { product: props.data?.product, price: props.data?.price },\r\n dialogStrings: props.dialogStrings,\r\n imageSettings: props.imageSettings,\r\n gridSettings: props.context.request.gridSettings,\r\n productQuantity: props.quantity !== undefined ? props.quantity : defaultQuantity,\r\n priceComponent,\r\n navigationUrl: props.navigationUrl,\r\n modalOpen,\r\n setModalOpen,\r\n telemetryContent: props.telemetryContent\r\n };\r\n\r\n const itemsAddedResource: IItemsAddedToCartResources = {\r\n viewCartButtonText: props.dialogStrings?.goToCartText ?? '',\r\n closeButtonLabel: props.dialogStrings?.closeNotificationLabel ?? 'Close',\r\n itemsAddedToCartHeaderText: props.dialogStrings?.headerMessageText ?? '',\r\n itemsAddedToCartFormatText: props.dialogStrings?.headerItemFormatText ?? '',\r\n linesAddedToCartFormatText: props.dialogStrings?.headerLinesFormatText ?? '{0}',\r\n itemsAddedValidationErrorMessage: errorMessage\r\n };\r\n\r\n const renderModalPopup = ;\r\n const label = props.cartLineId? props.updateCartTitle!: getLinkText(props);\r\n const payload = getPayloadObject(TelemetryEvent.AddToCart, props.telemetryContent!, label, '');\r\n const attributes = getTelemetryAttributes(props.telemetryContent!, payload);\r\n const buttonClassName = props.shouldSkipSiteSettings ? '' : 'msc-add-to-cart col-sm-5';\r\n\r\n React.useEffect(() => {\r\n /**\r\n * Retrieves add to cart input and updates the state.\r\n */\r\n const retrieveAddToCartInput = async () => {\r\n const retrievedInput = await getAddToCartInputFromProps(props);\r\n setAddToCartInput(retrievedInput);\r\n };\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises -- Call async method as per the documentation of react useEffect.\r\n retrieveAddToCartInput();\r\n }, [props, setAddToCartInput]);\r\n\r\n return ( \r\n <> \r\n {renderModalPopup}\r\n \r\n {label}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\n// Set default props\r\nAddToCartFunctionalComponent.defaultProps = {\r\n quantity: defaultQuantity\r\n};\r\n\r\n/**\r\n * Resolves whether product is in stock.\r\n * @param props - The add to cart component props.\r\n * @returns Gets the link text.\r\n */\r\nconst getLinkText = (props: IAddToCartComponentProps): string => {\r\n return shouldShowOutOfStock(props, false) && props.outOfStockText ? props.addToCartText : props.addToCartText;\r\n};\r\n\r\n/**\r\n * Resolves whether product is in stock.\r\n * @param props - The add to cart component props.\r\n * @returns The add to cart failure result.\r\n */\r\nconst addToCartError = (props: IAddToCartComponentProps): IAddToCartFailureResult | undefined => {\r\n const { data, productAvailability, isCustomPriceSelected, customPriceAmount, maximumKeyInPrice, minimumKeyInPrice, defaultMaximumKeyInPrice = 100, defaultMinimumKeyInPrice = 10 } = props;\r\n\r\n if (!data || !data.product.RecordId) {\r\n // No product exists, won't be able to add to cart\r\n return { failureReason: 'EMPTYINPUT' };\r\n }\r\n\r\n if (data.product.Dimensions) {\r\n const missingDimensions = data.product.Dimensions.filter(dimension => !(dimension.DimensionValue && dimension.DimensionValue.Value));\r\n\r\n if (ArrayExtensions.hasElements(missingDimensions)) {\r\n // At least one dimension with no value exists on the product, won't be able to add to cart\r\n return { failureReason: 'MISSINGDIMENSION', missingDimensions };\r\n }\r\n }\r\n\r\n if (shouldShowOutOfStock(props, true)) {\r\n const defaultAvailableQuantity = 0; // Showing as out of stock if no available products found.\r\n const availableQuantity = productAvailability?.AvailableQuantity ?? defaultAvailableQuantity;\r\n const stockLeft = Math.max(availableQuantity, defaultAvailableQuantity);\r\n\r\n return { failureReason: 'OUTOFSTOCK', stockLeft };\r\n }\r\n\r\n // When Custom price is selected, if there is no keyed-in price or keyed-in price is out of limit, should return error.\r\n if (isCustomPriceSelected &&\r\n (!customPriceAmount || customPriceAmount > (maximumKeyInPrice || defaultMaximumKeyInPrice) ||\r\n customPriceAmount < (minimumKeyInPrice || defaultMinimumKeyInPrice))) {\r\n return { failureReason: 'INVALIDCUSTOMAMOUNT' };\r\n }\r\n\r\n // Only allow adding to cart if not showing out of stock\r\n return undefined;\r\n};\r\n\r\n/**\r\n * Resolves whether product is in stock.\r\n * @param props - The add to cart component props.\r\n * @param includeCurrentQuantity - Flag to specify whether current quantity should be included.\r\n * @returns The dialog element.\r\n */\r\nconst shouldShowOutOfStock = (props: IAddToCartComponentProps, includeCurrentQuantity: boolean): boolean => {\r\n if (props.context.app.config.enableStockCheck === undefined || props.context.app.config.enableStockCheck === false) {\r\n return false;\r\n }\r\n\r\n // When skip site settings do not need show out of stock on adding to cart\r\n if (props.shouldSkipSiteSettings) {\r\n return false;\r\n }\r\n\r\n if (props.isLoading || props.isProductQuantityLoading || props.isUpdatingDimension ||\r\n props.isLoadingDeliveryOptions || props.isUpdatingDeliveryOptions || props.isAddServiceItemToCart) {\r\n // Out of stock turn off, don't bother showing out of stock\r\n return false;\r\n }\r\n\r\n if (!props.data || !props.data.product.RecordId) {\r\n // No product exists, don't bother showing out of stock\r\n return false;\r\n }\r\n\r\n const hasAvailableProducts = props.hasAvailableProducts ?? true;\r\n if (!hasAvailableProducts) {\r\n return true;\r\n }\r\n\r\n if (props.data.product.Dimensions) {\r\n if (props.data.product.Dimensions.find(dimension => !(dimension.DimensionValue && dimension.DimensionValue.Value))) {\r\n // At least one dimension with no value exists on the product, so also don't show out of stock\r\n return false;\r\n }\r\n }\r\n\r\n const includedQuantityNumber = includeCurrentQuantity && props.quantity ? props.quantity : defaultQuantity;\r\n\r\n return !((props.productAvailability &&\r\n props.productAvailability.AvailableQuantity !== undefined &&\r\n props.productAvailability.AvailableQuantity >= includedQuantityNumber));\r\n};\r\n\r\nconst isIntermediateState = (props: IAddToCartComponentProps): boolean => {\r\n if (props.data?.product.Dimensions) {\r\n if (props.data.product.Dimensions.find(dimension => !(dimension.DimensionValue && dimension.DimensionValue.Value))) {\r\n // At least one dimension with no value exists on the product, so also not in intermediate state\r\n return false;\r\n }\r\n }\r\n\r\n if (!props.isLoading && !props.isUpdatingDimension && !props.isLoadingDeliveryOptions && !props.isUpdatingDeliveryOptions) {\r\n return false;\r\n }\r\n\r\n return true;\r\n};\r\n\r\n// @ts-expect-error\r\nexport const AddToCartComponent: React.FunctionComponent = msdyn365Commerce.createComponent(\r\n 'AddToCart',\r\n { component: AddToCartFunctionalComponent, ...AddToCartComponentActions }\r\n);\r\n","/* tslint:disable: no-duplicate-imports */\r\nimport * as React from 'react';\r\n\r\n// import { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { Alert, Button, format, getPayloadObject, getTelemetryAttributes, getTelemetryObject, Heading, INodeProps, ITelemetryContent, Node, /*Quantity,*/ TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\r\nimport Quantity from '../Quantity';\r\nimport {\r\n IAddToCartResources,\r\n } from '@msdyn365-commerce/components';\r\nimport {\r\n AddToOrderTemplateComponent,\r\n AddToWishlistComponent,\r\n IAddToOrderTemplateDialogResources,\r\n IDuplicateItemsWhenAddingToOrderTemplateDialogResources,\r\n IItemAddedToOrderTemplateDialogResources,\r\n IOrderTemplateActionErrorResult,\r\n IOrderTemplateNameDialogResources,\r\n IWishlistActionErrorResult,\r\n PriceComponent,\r\n RatingComponent,\r\n IAddToCartFailureResult,\r\n} from '@msdyn365-commerce/components';\r\n\r\nimport { getUrlSync, IImageSettings} from '@msdyn365-commerce/core';\r\nimport { IProductDetails } from '@msdyn365-commerce-modules/buybox';\r\nimport { IBuyboxCallbacks } from '..';\r\nimport { getConfigureErrors, getGenericError, getQuantityError } from '../Utilities/error-utilities';\r\nimport { IEshopBuyboxData } from '../eshop-buybox.data';\r\nimport { IEshopBuyboxProps, IEshopBuyboxResources } from '../eshop-buybox.props.autogenerated';\r\nimport { ArrayExtensions, getInventoryLevelCodeFromDimensionValue, InventoryLevelValues, } from '@msdyn365-commerce-modules/retail-actions';\r\n//import EshopBuyBoxOrderSummary from './eshop-buybox-ordersummary';\r\nimport { ICartActionResult, ICartState } from '@msdyn365-commerce/global-state';\r\nimport { ProductAvailableQuantity, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport{AddToCartComponent} from './add-to-cart-component';\r\nimport { IBuyboxState } from './buyboxInterface';\r\n\r\n// const _getClassNamePrefix = (typeName: string): string => {\r\n// return typeName.toLocaleLowerCase() === 'quickview' ? 'ms-quickView' : 'ms-buybox';\r\n// };\r\n\r\nexport function getBuyBoxInventoryLabel(props: IEshopBuyboxProps): React.ReactElement | undefined {\r\n const {\r\n data: { productAvailableQuantity: { result: productAvailableQuantity } },\r\n } = props;\r\n if (!productAvailableQuantity || !productAvailableQuantity.length) {\r\n return undefined;\r\n }\r\n if (productAvailableQuantity &&\r\n productAvailableQuantity.length &&\r\n productAvailableQuantity[0].StockLevelLabel) {\r\n const inventoryClassName = productAvailableQuantity[0].StockLevelCode ?\r\n `ms-buybox__inventory-label ms-buybox__inventory-code-${productAvailableQuantity[0].StockLevelCode.toLowerCase()}` :\r\n 'ms-buybox__inventory-label';\r\n return (
{productAvailableQuantity[0].StockLevelLabel}
);\r\n }\r\n\r\n return undefined;\r\n\r\n}\r\nexport function getBuyboxProductTitle(props: IEshopBuyboxProps): React.ReactElement | undefined {\r\n const {\r\n data: { product: { result: product } },\r\n config: { titleHeadingTag = 'h1' }\r\n } = props;\r\n\r\n return product && (\r\n \r\n );\r\n}\r\n\r\nexport function getBuyboxProductDescription(props: IEshopBuyboxProps): React.ReactElement | undefined {\r\n const {\r\n data: { product: { result: product } }\r\n } = props;\r\n\r\n return product && (\r\n

{product.Description}

\r\n );\r\n}\r\n\r\nexport interface IBuyboxAddToCartViewProps {\r\n ContainerProps: INodeProps;\r\n errorBlock?: React.ReactNode;\r\n button?: React.ReactNode;\r\n button2?: React.ReactNode;\r\n}\r\n\r\nlet telemetryContent: ITelemetryContent;\r\n\r\n\r\n// tslint:disable-next-line:max-func-body-length\r\nexport function getBuyboxAddToCart(\r\n props: IEshopBuyboxProps, state: IBuyboxState, callbacks: IBuyboxCallbacks,\r\n defaultMinimumKeyInPrice: number, defaultMaximumKeyInPrice: number,\r\n productDetails?: IProductDetails, hasAvailableProducts?: boolean): IBuyboxAddToCartViewProps {\r\n const {\r\n id,\r\n typeName,\r\n context,\r\n config,\r\n resources\r\n } = props;\r\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\r\n const product = props.data.product?.result ?? productDetails?.product;\r\n\r\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\r\n const cart = props.data.cart?.result ?? productDetails?.cart;\r\n\r\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\r\n const productAvailableQuantity = props.data.productAvailableQuantity?.result ?? productDetails?.productAvailableQuantity;\r\n\r\n const {\r\n quantity,\r\n errorState: {\r\n configureErrors,\r\n quantityError,\r\n customAmountError,\r\n otherError,\r\n errorHost\r\n },\r\n selectedProduct,\r\n isUpdatingDimension,\r\n isUpdatingDeliveryOptions,\r\n isServiceItem,\r\n cartLineId\r\n } = state;\r\n\r\n const productAvailability = state.productAvailableQuantity ? state.productAvailableQuantity.ProductAvailableQuantity : (productAvailableQuantity && productAvailableQuantity.length > 0 ? productAvailableQuantity[0].ProductAvailableQuantity : undefined);\r\n\r\n const dialogStrings: IAddToCartResources = {\r\n goToCartText: resources.buyBoxGoToCartText,\r\n continueShoppingText: resources.buyBoxContinueShoppingText,\r\n closeNotificationLabel: resources.closeNotificationLabel,\r\n headerItemOneText: resources.buyBoxSingleItemText,\r\n headerItemFormatText: resources.buyBoxMultiLineItemFormatText,\r\n headerMessageText: resources.buyBoxHeaderMessageText,\r\n freePriceText: resources.priceFree,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText,\r\n addedQuantityText: resources.addedQuantityText\r\n };\r\n\r\n const defaultImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: 'w=240&h=240&m=6', w: 0, h: 0 },\r\n lg: { q: 'w=240&h=240&m=6', w: 0, h: 0 },\r\n xl: { q: 'w=240&h=240&m=6', w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n };\r\n\r\n const isProductQuantityLoading = typeName !== 'quickview' && props.data.productAvailableQuantity.status === 'LOADING';\r\n if (isProductQuantityLoading) {\r\n callbacks.changeUpdatingDimension(false);\r\n }\r\n\r\n const isLoadingDeliveryOptions = typeName !== 'quickview' && props.data.deliveryOptions?.status === 'LOADING';\r\n if (isLoadingDeliveryOptions && callbacks.changeUpdatingDeliveryOptions) {\r\n callbacks.changeUpdatingDeliveryOptions(false);\r\n }\r\n\r\n telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.typeName, props.telemetry);\r\n\r\n // Check if the product delivery mode is electronic\r\n const emailDeliveryModeCode = props.context.actionContext.requestContext.channel?.EmailDeliveryModeCode;\r\n const deliveryOptions = props.data.deliveryOptions?.result;\r\n const isEmailDelivery = ArrayExtensions.hasElements(deliveryOptions?.DeliveryOptions) && deliveryOptions!.DeliveryOptions[0].Code === emailDeliveryModeCode;\r\n const isDisabled = isUpdatingDimension && typeName === 'quickview';\r\n\r\n return {\r\n ContainerProps: {\r\n className: \"eshop-buybox-action-wrapper\"\r\n },\r\n button: product && (\r\n \r\n ),\r\n errorBlock: (\r\n \r\n )\r\n };\r\n}\r\n/**\r\n * On add to cart failed function.\r\n * @param props -The buybox module props.\r\n * @param state -The buybox module state.\r\n * @param callbacks -The buybox module callbacks.\r\n * @param defaultMinimumKeyInPrice -The default minimum key in price.\r\n * @param defaultMaximumKeyInPrice -The default maximum key in price.\r\n * @param cart -The cart state.\r\n * @param product -The simple product.\r\n * @param productAvailability -The product available quantity.\r\n * @returns Update error state.\r\n */\r\n const onAddToCartFailed = (\r\n props: IEshopBuyboxProps, state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks, defaultMinimumKeyInPrice: number,\r\n defaultMaximumKeyInPrice: number,\r\n cart: ICartState,\r\n product: SimpleProduct,\r\n productAvailability: ProductAvailableQuantity | undefined) => (result: IAddToCartFailureResult) => {\r\n\r\n let quantityErrorForState: string | undefined;\r\n let customAmountErrorForState: string | undefined;\r\n let otherErrorForState: string | undefined = getGenericError(result, cart, props.resources, props.context, product, productAvailability, undefined);\r\n\r\n if (result.failureReason === 'OUTOFSTOCK') {\r\n quantityErrorForState = result.failureReason === 'OUTOFSTOCK' ? getQuantityError(result.stockLeft, props.resources) : undefined;\r\n } else if (result.failureReason === 'CARTACTIONFAILED' &&\r\n result.cartActionResult &&\r\n (result.cartActionResult.substatus === 'MAXQUANTITY' || result.cartActionResult.substatus === 'QUANTITYLIMITS')) {\r\n quantityErrorForState = getGenericError(result, cart, props.resources, props.context, product, productAvailability, undefined);\r\n otherErrorForState = undefined; // Prevent error duplication in otherError and quantityError\r\n }\r\n\r\n if (result.failureReason === 'INVALIDCUSTOMAMOUNT') {\r\n if (state.keyInPriceAmount === undefined || state.keyInPriceAmount < (props.config.minimumKeyInPrice || defaultMinimumKeyInPrice)) {\r\n const formatedAmountLimit = props.context.cultureFormatter.formatCurrency(props.config.minimumKeyInPrice || defaultMinimumKeyInPrice);\r\n customAmountErrorForState = props.resources.invalidSmallCustomAmountText.replace('{minAmount}', formatedAmountLimit);\r\n } else if (state.keyInPriceAmount > (props.config.maximumKeyInPrice || defaultMaximumKeyInPrice)) {\r\n const formatedAmountLimit = props.context.cultureFormatter.formatCurrency(props.config.maximumKeyInPrice || defaultMaximumKeyInPrice);\r\n customAmountErrorForState = props.resources.invalidLargeCustomAmountText.replace('{maxAmount}', formatedAmountLimit);\r\n }\r\n }\r\n\r\n callbacks.updateErrorState({\r\n errorHost: 'ADDTOCART',\r\n quantityError: quantityErrorForState,\r\n configureErrors: result.failureReason === 'MISSINGDIMENSION' ? getConfigureErrors(result.missingDimensions, props.resources, product?.IsGiftCard) : {},\r\n customAmountError: customAmountErrorForState,\r\n otherError: otherErrorForState\r\n });\r\n};\r\n/**\r\n * On Item Add To Cart function.\r\n * @param typeName -Type name.\r\n * @param callbacks -Buybox Callbacks.\r\n * @returns Change modal open.\r\n */\r\n const onItemAddedToCart = (typeName: string, callbacks: IBuyboxCallbacks, props: IEshopBuyboxProps) => (result: ICartActionResult) => {\r\n if (typeName === 'quickview') {\r\n callbacks.changeModalOpen(false);\r\n }\r\n if(typeName == 'eshop-buybox')\r\n {\r\n callbacks.changeModalOpen(true);\r\n //callbacks.updateDeliverySpecs(props);\r\n }\r\n};\r\n\r\nexport function getBuyboxProductPrice(props: IEshopBuyboxProps, state: IBuyboxState): React.ReactElement | undefined {\r\n const { id, typeName, context, resources } = props;\r\n\r\n const priceComponent = state.productPrice && state.productPrice.BasePrice != 0 && (\r\n
\r\n \r\n {/*

{props.config.pricePerUnitTitle ? props.config.pricePerUnitTitle : 'Price Per Unit'}

*/}\r\n
\r\n ) || undefined;\r\n\r\n return state.productPrice && priceComponent && (\r\n priceComponent\r\n );\r\n}\r\n\r\nexport function getBuyboxProductRating(props: IEshopBuyboxProps): React.ReactElement | undefined {\r\n const {\r\n id,\r\n typeName,\r\n context,\r\n data: { ratingsSummary: { result: ratingsSummary } },\r\n resources\r\n } = props;\r\n\r\n const ratingComponent = ratingsSummary && ratingsSummary.averageRating && (\r\n \r\n ) || undefined;\r\n\r\n return ratingsSummary && ratingComponent && (\r\n ratingComponent\r\n );\r\n}\r\n\r\nexport interface IBuyboxAddToOrderTemplateViewProps {\r\n ContainerProps: INodeProps;\r\n errorBlock?: React.ReactNode;\r\n button?: React.ReactNode;\r\n}\r\n\r\nfunction generateAddToOrderTemplateDialogResources(resources: IEshopBuyboxResources): IAddToOrderTemplateDialogResources {\r\n return {\r\n addToOrderTemplateHeader: resources.addToOrderTemplateHeader,\r\n\r\n noOrderTemplatesMessage: resources.noOrderTemplatesMessage,\r\n noOrderTemplatesDescription: resources.noOrderTemplatesDescription,\r\n\r\n createAnOrderTemplateButtonText: resources.createAnOrderTemplateButtonText,\r\n createNewOrderTemplateButtonText: resources.createNewOrderTemplateButtonText,\r\n cancelOrderTemplateCreationButtonText: resources.cancelOrderTemplateCreationButtonText,\r\n\r\n selectTemplatesText: resources.selectTemplatesText,\r\n addToTemplateButtonText: resources.addToTemplateButtonText,\r\n lineItemsText: resources.lineItemsText\r\n };\r\n}\r\n\r\nfunction generateOrderTemplateNameDialogResources(resources: IEshopBuyboxResources): IOrderTemplateNameDialogResources {\r\n return {\r\n orderTemplateHeaderLabel: resources.createOrderTemplateHeader,\r\n orderTemplateTitleLabel: resources.orderTemplateTitle,\r\n orderTemplateNameAriaLabel: resources.orderTemplateNameAriaLabel,\r\n orderTemplateDescription: resources.createOrderTemplateDescription,\r\n\r\n defaultOrderTemplateName: resources.defaultOrderTemplateName,\r\n\r\n orderTemplateButtonLabel: resources.createOrderTemplateButtonText,\r\n orderTemplateCancelButtonLabel: resources.cancelNewOrderTemplateCreationButtonText\r\n };\r\n}\r\n\r\nfunction generateItemAddedToOrderTemplateDialogResources(resources: IEshopBuyboxResources): IItemAddedToOrderTemplateDialogResources {\r\n return {\r\n viewOrderTemplateButtonText: resources.viewOrderTemplateButtonText,\r\n continueShoppingButtonText: resources.continueShoppingButtonText,\r\n itemAddedToOrderTemplateHeaderItemOneText: resources.itemAddedToOrderTemplateHeaderItemOneText,\r\n itemAddedToOrderTemplateHeaderItemFormatText: resources.itemAddedToOrderTemplateHeaderItemFormatText,\r\n itemAddedToOrderTemplateHeaderMessageText: resources.itemAddedToOrderTemplateHeaderMessageText,\r\n freePriceText: resources.priceFree,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText\r\n };\r\n}\r\n\r\nfunction generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(resources: IEshopBuyboxResources): IDuplicateItemsWhenAddingToOrderTemplateDialogResources {\r\n return {\r\n duplicatedProductsHeader: resources.duplicatedProductsHeader,\r\n duplicatedProductsDescription: resources.duplicatedProductsDescription,\r\n updateQuantityButtonText: resources.updateQuantityButtonText,\r\n cancelDuplicateItemsButtonText: resources.cancelDuplicateItemsButtonText\r\n };\r\n}\r\n\r\nexport function getBuyboxProductAddToOrderTemplate(props: IEshopBuyboxProps, state: IBuyboxState, callbacks: IBuyboxCallbacks): IBuyboxAddToOrderTemplateViewProps | undefined {\r\n const {\r\n id,\r\n typeName,\r\n context,\r\n data: {\r\n product: { result: product },\r\n orderTemplates: { result: orderTemplates },\r\n customerInformation: { result: customerInformation }\r\n },\r\n resources\r\n } = props;\r\n\r\n const\r\n {\r\n errorState: {\r\n configureErrors,\r\n quantityError,\r\n customAmountError,\r\n otherError,\r\n errorHost\r\n },\r\n quantity\r\n } = state;\r\n\r\n // If custom amount is selected, add-to-orderTemplate is disabled\r\n if (state.isCustomPriceSelected) {\r\n return undefined;\r\n }\r\n\r\n const onAddToOrderTemplateFailed = (result: IOrderTemplateActionErrorResult) => {\r\n callbacks.updateErrorState({\r\n errorHost: 'ORDER_TEMPLATE',\r\n configureErrors: result.status === 'MISSING_DIMENSION' ? getConfigureErrors(result.missingDimensions, resources, product?.IsGiftCard) : {},\r\n });\r\n };\r\n \r\n return {\r\n ContainerProps: {\r\n className: 'ms-buybox__add-to-order-template-container'\r\n },\r\n button: product && orderTemplates && (\r\n \r\n ),\r\n errorBlock: (\r\n \r\n )\r\n };\r\n}\r\n\r\nexport interface IBuyboxAddToWishlistViewProps {\r\n ContainerProps: INodeProps;\r\n errorBlock?: React.ReactNode;\r\n button?: React.ReactNode;\r\n}\r\nexport function getBuyboxProductAddToWishlist(props: IEshopBuyboxProps, state: IBuyboxState, callbacks: IBuyboxCallbacks): IBuyboxAddToWishlistViewProps | undefined {\r\n const {\r\n id,\r\n typeName,\r\n context,\r\n data: {\r\n product: { result: product },\r\n wishlists: { result: wishlists }\r\n },\r\n resources\r\n } = props;\r\n\r\n const\r\n {\r\n errorState: {\r\n configureErrors,\r\n quantityError,\r\n customAmountError,\r\n otherError,\r\n errorHost\r\n },\r\n selectedProduct\r\n } = state;\r\n\r\n // If custom amount is selected, add-to-wishlist is disabled\r\n if (state.isCustomPriceSelected) {\r\n return undefined;\r\n }\r\n\r\n const onAddToWishlistFailed = (result: IWishlistActionErrorResult) => {\r\n callbacks.updateErrorState({\r\n errorHost: 'WISHLIST',\r\n configureErrors: result.status === 'MISSINGDIMENSION' ? getConfigureErrors(result.missingDimensions, resources, product?.IsGiftCard) : {},\r\n });\r\n };\r\n\r\n return {\r\n ContainerProps: {\r\n className: 'ms-buybox__add-to-wishlist-container'\r\n },\r\n button: product && (\r\n \r\n ),\r\n errorBlock: (\r\n \r\n )\r\n };\r\n}\r\n\r\nexport interface IBuyboxProductQuantityViewProps {\r\n ContainerProps: INodeProps;\r\n LabelContainerProps: INodeProps;\r\n ErrorContainerProps: INodeProps;\r\n\r\n heading: React.ReactNode;\r\n errors?: React.ReactNode;\r\n\r\n input: React.ReactNode;\r\n}\r\nexport function getBuyboxProductQuantity(props: IEshopBuyboxProps, state: IBuyboxState, callbacks: IBuyboxCallbacks): IBuyboxProductQuantityViewProps {\r\n const {\r\n resources,\r\n context\r\n } = props;\r\n\r\n const\r\n {\r\n quantity,\r\n max,\r\n errorState: {\r\n quantityError,\r\n }\r\n } = state;\r\n\r\n const {\r\n data: { productAvailableQuantity: { result: productAvailableQuantity } },\r\n } = props;\r\n \r\n const inventoryLevel = context.app.config.inventoryLevel;\r\n\r\n const productDimensionsData = props.data.productDimensions?.result;\r\n\r\n let isProductVariantUnAvailable = true;\r\n //logic to check if product variants are available to show out of stock label\r\n if(productDimensionsData && productDimensionsData?.length>0)\r\n {\r\n productDimensionsData?.map(dimension=>{\r\n const dimensionValuesWithInventory = dimension.dimensionValuesWithInventory!;\r\n \r\n dimensionValuesWithInventory.map(dimensionValuesWithInventoryElement=>{\r\n const inventoryLevelCode = getInventoryLevelCodeFromDimensionValue(dimensionValuesWithInventoryElement, inventoryLevel);\r\n if(inventoryLevelCode === InventoryLevelValues.available){\r\n isProductVariantUnAvailable = false;\r\n }\r\n }) \r\n })\r\n\r\n }\r\n else{\r\n isProductVariantUnAvailable = false;\r\n }\r\n \r\n \r\n const productAvailability = state.productAvailableQuantity ? state.productAvailableQuantity.ProductAvailableQuantity : (productAvailableQuantity && productAvailableQuantity.length > 0 ? productAvailableQuantity[0].ProductAvailableQuantity : undefined);\r\n\r\n const classname = productAvailability?.AvailableQuantity!==0 && !isProductVariantUnAvailable ? 'eshop-buybox__product-quantity-label-heading': 'eshop-buybox__product-quantity-out-of-stock-label';\r\n const labelClassName = productAvailability?.AvailableQuantity!==0 && !isProductVariantUnAvailable ? 'eshop-buybox__product-quantity-label col-md-2 col-2 col-sm-2': 'eshop-buybox__product-quantity-label';\r\n\r\n const onChange = (newValue: number): boolean => {\r\n if (callbacks.updateQuantity) {\r\n return callbacks.updateQuantity(newValue);\r\n }\r\n return true;\r\n };\r\n\r\n return {\r\n ContainerProps: {\r\n className: 'eshop-buybox ms-buybox__quantity row'\r\n },\r\n LabelContainerProps: {\r\n tag: 'label',\r\n className:labelClassName ,\r\n htmlFor: 'eshop-buybox__product-quantity-input'\r\n },\r\n ErrorContainerProps:{\r\n tag: 'label',\r\n className:'eshop-buybox__product-quantity-label' ,\r\n htmlFor: 'eshop-buybox__product-quantity-input'\r\n },\r\n heading: (\r\n
{productAvailability?.AvailableQuantity!==0 && !isProductVariantUnAvailable ? (props.config.quantityTitle? props.config.quantityTitle:resources.productQuantityHeading): (props.config.outOfStockTitle?props.config.outOfStockTitle: resources.outOfStockText)}
\r\n ),\r\n errors: quantityError && (\r\n \r\n \r\n ),\r\n input: (\r\n productAvailability?.AvailableQuantity!==0 && !isProductVariantUnAvailable && \r\n )\r\n };\r\n}\r\n\r\nexport interface IBuyboxShopSimilarLookViewProps {\r\n ContainerProps: INodeProps;\r\n errors?: React.ReactNode;\r\n input: React.ReactNode;\r\n}\r\n\r\nexport function getBuyboxShopSimilarLook(props: IEshopBuyboxProps, state: IBuyboxState, callbacks: IBuyboxCallbacks): IBuyboxShopSimilarLookViewProps {\r\n const {\r\n resources,\r\n context,\r\n data: {\r\n product: { result: product }\r\n },\r\n } = props;\r\n\r\n const\r\n {\r\n errorState: { }\r\n } = state;\r\n\r\n const navigationUrl = () => {\r\n const searchURL = getUrlSync('search', context && context.actionContext);\r\n const separator = searchURL!.includes('?') ? '&' : '?';\r\n document.location.href = `${searchURL}${separator}productId=${product && product.RecordId}`;\r\n };\r\n const payLoad = getPayloadObject('click', telemetryContent, TelemetryConstant.ShopSimliarLooks);\r\n const attribute = getTelemetryAttributes(telemetryContent, payLoad);\r\n\r\n return {\r\n ContainerProps: {\r\n className: 'ms-buybox__shopsimilarlooks'\r\n },\r\n input: (\r\n \r\n {resources.shopSimilarLooksText}\r\n \r\n )\r\n };\r\n}\r\n\r\nexport interface IBuyboxKeyInPriceViewProps {\r\n ContainerProps: INodeProps;\r\n LabelContainerProps: INodeProps;\r\n heading: React.ReactNode;\r\n input: React.ReactNode;\r\n}\r\n\r\nexport function getBuyboxKeyInPrice(props: IEshopBuyboxProps, state: IBuyboxState, callbacks: IBuyboxCallbacks): IBuyboxKeyInPriceViewProps {\r\n const {\r\n config,\r\n resources\r\n } = props;\r\n\r\n const\r\n {\r\n errorState: { }\r\n } = state;\r\n\r\n const onChange = (e: React.ChangeEvent) => {\r\n const value = e.currentTarget.value;\r\n callbacks.updateKeyInPrice(value.length ? Number(value) : parseFloat(value));\r\n };\r\n\r\n return {\r\n ContainerProps: {\r\n className: 'ms-buybox__key_in_price'\r\n },\r\n LabelContainerProps: {\r\n tag: 'label',\r\n className: 'ms-buybox__key_in_price-label',\r\n htmlFor: 'ms-buybox__key_in_price'\r\n },\r\n heading: (\r\n
{resources.buyboxKeyInPriceLabelHeading}
\r\n ),\r\n input: (\r\n \r\n )\r\n };\r\n\r\n}\r\n\r\nexport interface IBuyboxErrorBlockProps {\r\n configureErrors: { [configureId: string]: string | undefined };\r\n quantityError?: string;\r\n customAmountError?: string;\r\n otherError?: string;\r\n resources: IEshopBuyboxResources;\r\n showError: boolean;\r\n}\r\nexport const BuyboxErrorBlock: React.FC = ({ showError, configureErrors, quantityError, customAmountError, otherError, resources }) => {\r\n let errorMessages: (string | undefined)[] = [];\r\n\r\n errorMessages = Object.values(configureErrors).filter(message => message !== undefined);\r\n\r\n if (quantityError) {\r\n errorMessages.push(quantityError);\r\n }\r\n\r\n if (customAmountError) {\r\n errorMessages.push(customAmountError);\r\n }\r\n\r\n if (otherError) {\r\n errorMessages.push(otherError);\r\n }\r\n\r\n return (\r\n 0} color='danger' assertive={true} aria-label={resources.buyboxErrorMessageHeader} >\r\n \r\n {errorMessages.map((message, index) => {\r\n return (\r\n
{message}
\r\n );\r\n })}\r\n
\r\n );\r\n};\r\n\r\nexport function getQuantityLimitsMessages(props: IEshopBuyboxProps, state: IBuyboxState): React.ReactElement | undefined {\r\n const {\r\n resources\r\n } = props;\r\n\r\n const\r\n {\r\n min,\r\n max,\r\n } = state;\r\n\r\n if (!_isOrderQuantityLimitsFeatureEnabled(props)) {\r\n return undefined;\r\n }\r\n\r\n return (\r\n \r\n {_renderMaxLabel(max, resources.maxQuantityText)}\r\n {_renderMinLabel(min, resources.minQuantityText)}\r\n \r\n );\r\n}\r\n\r\nexport const RetailDefaultOrderQuantityLimitsFeatureName: string = 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature';\r\n\r\nconst _renderMaxLabel = (max: number | undefined, maxQuantityText: string): React.ReactElement | undefined => {\r\n if (max && max !== 0 && max !== Number.MAX_VALUE) {\r\n return(\r\n

\r\n {maxQuantityText.replace('{max}', max.toString())}\r\n

\r\n );\r\n } else {\r\n return undefined;\r\n }\r\n};\r\n\r\nconst _renderMinLabel = (min: number | undefined, minQuantityText: string): JSX.Element | undefined => {\r\n if (min && min > 1) {\r\n return(\r\n

\r\n {minQuantityText.replace('{min}', min.toString())}\r\n

\r\n );\r\n } else {\r\n return undefined;\r\n }\r\n};\r\n\r\nconst _isOrderQuantityLimitsFeatureEnabled = (props: IEshopBuyboxProps): boolean | undefined => {\r\n const isFeatureEnabledInHq = props.data.featureState.result\r\n ?.find(featureState => featureState.Name === RetailDefaultOrderQuantityLimitsFeatureName)?.IsEnabled;\r\n if (!isFeatureEnabledInHq) {\r\n return false;\r\n }\r\n const defaultOrderQuantityLimitsFeatureConfig = props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'none') {\r\n return false;\r\n }\r\n\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\r\n return true;\r\n }\r\n\r\n const customerInfo = props.data.customerInformation.result;\r\n return customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b));\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { ICommerceApiSettings } from '@msdyn365-commerce/core-internal';\r\nimport { ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\n\r\n/**\r\n * Specifies the type of selection.\r\n */\r\nexport enum SelectionType {\r\n dropdown = 0,\r\n swatch = 1\r\n}\r\n\r\n/**\r\n * Copyright (c) 2018 Microsoft Corporation.\r\n */\r\nexport interface IDropdownProps {\r\n /**\r\n * Specifies the type of selection. Dropdown by default.\r\n */\r\n selectionType?: SelectionType;\r\n\r\n /**\r\n * @friendlyName dropdownId\r\n * @description Id for dropdown component.\r\n */\r\n dropdownId: string;\r\n\r\n /**\r\n * @friendlyName dropdownName\r\n * @description Name of the dropdown component.\r\n */\r\n dropdownName: string;\r\n\r\n /**\r\n * @friendlyName dropdownList\r\n * @description List of items in dropdown.\r\n */\r\n dropdownList: IDropdownItemProps[];\r\n\r\n /**\r\n * @friendlyName dropdownToggleName\r\n * @description Name to use for the toggle when nothing is selected.\r\n */\r\n dropdownToggleName: string;\r\n\r\n /**\r\n * @telemetryContent telemetryContent\r\n * @description Telemetry content.\r\n */\r\n telemetryContent?: ITelemetryContent;\r\n\r\n apiSettings?: ICommerceApiSettings;\r\n\r\n /**\r\n * @friendlyName onChange\r\n * @description Callback that gets fired when when a selected dimension changes.\r\n */\r\n onChange?(notification: IDropdownOnSelectionChangeNotification): Promise;\r\n}\r\n\r\nexport interface IDropdownItemProps {\r\n value: string;\r\n id: string;\r\n colorHexCode?: string;\r\n imageUrl?: string;\r\n isDisabled?: boolean;\r\n isDefault?: boolean;\r\n}\r\n\r\nexport interface IDropdownOnSelectionChangeNotification {\r\n dropdownId: string;\r\n selectId: string;\r\n selectedValue: string;\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { ISwatchItem, SwatchComponent } from '@msdyn365-commerce/components';\r\nimport { DimensionTypes } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getPayloadObject, getTelemetryAttributes, IPayLoad } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IDropdownItemProps, IDropdownProps, SelectionType } from './dropdown.props';\r\n\r\n/**\r\n * State for a dropdown component.\r\n */\r\ninterface IDropdownState {\r\n /**\r\n * @friendlyName selectedIndex\r\n * @description Selected index.\r\n */\r\n selectedIndex: string;\r\n}\r\n\r\n/**\r\n *\r\n * DropDown component.\r\n * @extends {React.PureComponent}\r\n */\r\nexport class Dropdown extends React.PureComponent {\r\n private readonly selectMenu: React.RefObject = React.createRef();\r\n\r\n private readonly payLoad: IPayLoad;\r\n\r\n public constructor(props: IDropdownProps, state: IDropdownState) {\r\n super(props);\r\n\r\n const selectedItem = this.props.dropdownList.find(item => item.isDefault);\r\n if (selectedItem) {\r\n this.state = {\r\n selectedIndex: selectedItem.id.toString()\r\n };\r\n if (this.props.onChange) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises -- Update for default.\r\n this.props.onChange({\r\n dropdownId: this.props.dropdownId,\r\n selectId: selectedItem.id,\r\n selectedValue: selectedItem.value\r\n });\r\n }\r\n } else {\r\n this.state = {\r\n selectedIndex: ''\r\n };\r\n }\r\n this.payLoad = getPayloadObject('click', props.telemetryContent!, this.props.dropdownName);\r\n }\r\n\r\n public render(): JSX.Element {\r\n if (this.props.apiSettings && this.props.selectionType === SelectionType.swatch) {\r\n return this._renderSwatch();\r\n }\r\n\r\n return this._renderDropdown();\r\n }\r\n\r\n private _renderDropdown(): JSX.Element {\r\n const { dropdownId, dropdownList, dropdownName, dropdownToggleName } = this.props;\r\n const attribute = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\r\n return (\r\n \r\n \r\n {dropdownList.map(\r\n (item: IDropdownItemProps) =>\r\n item && (\r\n \r\n {item.value}\r\n \r\n )\r\n )}\r\n \r\n );\r\n }\r\n\r\n private _renderSwatch(): JSX.Element {\r\n const swatchItems = this.props.dropdownList.map(item => {\r\n return {\r\n ...item,\r\n itemId: item.id,\r\n dimensionType: this.props.dropdownName as DimensionTypes,\r\n isDisabled: item.isDisabled\r\n };\r\n });\r\n return ;\r\n }\r\n\r\n /**\r\n * Updates state on swatch selection.\r\n * @param item - Selected swatch item.\r\n */\r\n private readonly _selectSwatch = async (item: ISwatchItem) => {\r\n this.setState({ selectedIndex: item.itemId });\r\n\r\n if (this.props.onChange) {\r\n await this.props.onChange({\r\n dropdownId: this.props.dropdownId,\r\n selectId: item.itemId,\r\n selectedValue: item.value\r\n });\r\n }\r\n };\r\n\r\n private readonly _onChanged = async (event: React.ChangeEvent) => {\r\n this.setState({ selectedIndex: event.target.value });\r\n\r\n if (this.props.onChange) {\r\n await this.props.onChange({\r\n dropdownId: this.props.dropdownId,\r\n selectId: event.target.value,\r\n selectedValue: event.target.innerText\r\n });\r\n }\r\n };\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { ICoreContext } from '@msdyn365-commerce/core-internal';\r\nimport { ProductDimension, ProductDimensionType } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ArrayExtensions,\r\n convertProductDimensionTypeToDimensionTypes,\r\n DimensionTypes,\r\n getDimensionValuesFromQuery,\r\n getInventoryLevelCodeFromDimensionValue,\r\n IDimensionForSelectedVariant,\r\n IDimensionsApp,\r\n IDimensionValueForSelectedVariant,\r\n InventoryLevelValues,\r\n ObjectExtensions\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { format, getTelemetryObject, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport {\r\n IBuyboxCallbacks,\r\n IBuyboxCommonData,\r\n IBuyboxCommonResources,\r\n IBuyboxExtentedProps,\r\n IBuyboxProductConfigureDropdownViewProps,\r\n IBuyboxProductConfigureViewProps,\r\n IBuyboxState,\r\n IProductDetails\r\n} from './buyboxInterface';\r\nimport { Dropdown, IDropdownItemProps, IDropdownOnSelectionChangeNotification, SelectionType } from './dropdown';\r\n\r\nlet telemetryContent: ITelemetryContent;\r\n\r\n/**\r\n * Dimension pre-processing info.\r\n */\r\ninterface IProductDimensionInfo {\r\n dropdownName: string;\r\n dropdownId: string;\r\n dropdownList: IDropdownItemProps[];\r\n}\r\n\r\n/**\r\n * Props for rendering a dropdown.\r\n */\r\ninterface IProductDimensionDropdownProps extends IProductDimensionInfo {\r\n resources: IBuyboxCommonResources;\r\n className: string;\r\n context: ICoreContext;\r\n\r\n configureErrors: { [configureId: string]: string | undefined };\r\n\r\n getDropdownName(dimensionType: number, resources: IBuyboxCommonResources): string;\r\n dropdownCallback(notification: IDropdownOnSelectionChangeNotification): Promise;\r\n}\r\n\r\nconst mapProductDimensionFullToDropdownViewProps = (props: IProductDimensionDropdownProps): IBuyboxProductConfigureDropdownViewProps => {\r\n const dimensionId = Number.parseInt(props.dropdownId, 10) as ProductDimensionType;\r\n const dropdownToggleName = format(props.resources.selectDimensionFormatString, props.dropdownName);\r\n\r\n const errorMessage = props.configureErrors[props.dropdownId];\r\n\r\n let dimensionSelectionType = SelectionType.dropdown;\r\n\r\n const dimensionType = convertProductDimensionTypeToDimensionTypes(dimensionId);\r\n\r\n const dimensionsAsSwatchConfiguration = props.context.app.config.dimensionsAsSwatchType;\r\n if (\r\n ArrayExtensions.hasElements(dimensionsAsSwatchConfiguration) &&\r\n !dimensionsAsSwatchConfiguration.includes(DimensionTypes.none) &&\r\n dimensionsAsSwatchConfiguration.includes(dimensionType)\r\n ) {\r\n dimensionSelectionType = SelectionType.swatch;\r\n }\r\n\r\n return {\r\n ContainerProps: {\r\n className: `${props.className}__dropdown row`\r\n },\r\n LabelContainerProps: {\r\n tag: 'label',\r\n className: `${props.className}__dropdown-quantity-label col-2 col-sm-2 col-md-2`,\r\n htmlFor: `${props.className}__dropown-quantity-input-${props.dropdownId}`\r\n },\r\n errorContainerProps:{\r\n tag: 'label',\r\n className: `${props.className}__dropdown-quantity-label`,\r\n htmlFor: `${props.className}__dropown-quantity-input-${props.dropdownId}`\r\n },\r\n errors: errorMessage && (\r\n \r\n \r\n ),\r\n heading:
{props.dropdownName}
,\r\n select: (\r\n \r\n )\r\n };\r\n};\r\n\r\nexport function getBuyboxProductConfigure(\r\n props: IBuyboxExtentedProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks,\r\n productDetails?: IProductDetails,\r\n selectedDimensions?: ProductDimension[]\r\n): IBuyboxProductConfigureViewProps | undefined {\r\n const { resources, typeName } = props;\r\n\r\n const {\r\n errorState: { configureErrors }\r\n } = state;\r\n\r\n const { getDropdownName } = callbacks;\r\n\r\n const context = props.context as ICoreContext;\r\n\r\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\r\n const product = props.data.product?.result ? props.data.product.result : productDetails?.product;\r\n\r\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\r\n const productDimensionsData = props.data.productDimensions?.result ?? productDetails?.productDimensions;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access -- app context is generic\r\n const enableStockCheck = props.context.app.config.enableStockCheck;\r\n\r\n const hasProductDimensions = ArrayExtensions.hasElements(productDimensionsData);\r\n\r\n if (!product || !hasProductDimensions) {\r\n return undefined;\r\n }\r\n\r\n const className = _getClassNamePrefix(typeName);\r\n\r\n const onChanged = async (notification: IDropdownOnSelectionChangeNotification) =>\r\n _onChanged(notification, callbacks.dimensionSelectedAsync);\r\n\r\n telemetryContent = getTelemetryObject(context.request.telemetryPageName!, props.typeName, props.telemetry);\r\n\r\n const inventoryLevel = context.app.config.inventoryLevel;\r\n\r\n let dimensionsInfo: IProductDimensionInfo[] = [];\r\n\r\n const productDimensions = productDimensionsData as IDimensionForSelectedVariant[];\r\n\r\n dimensionsInfo = productDimensions.map(productDimensionFull => {\r\n const dropdownName = getDropdownName(productDimensionFull.DimensionTypeValue, resources);\r\n const dropdownId = productDimensionFull.DimensionTypeValue.toString();\r\n\r\n const dimensions = (productDimensionFull.dimensionValuesWithInventory ??\r\n productDimensionFull.DimensionValues ??\r\n []) as IDimensionValueForSelectedVariant[];\r\n const validProductDimensionsFull = dimensions.filter(\r\n value => !ObjectExtensions.isNullOrUndefined(value.DimensionValue?.RecordId ?? value.RecordId)\r\n );\r\n\r\n const dropdownList: IDropdownItemProps[] = validProductDimensionsFull.map(dimensionValuesWithInventory => {\r\n const dimensionValue = dimensionValuesWithInventory.DimensionValue ?? dimensionValuesWithInventory;\r\n const inventoryLevelCode = getInventoryLevelCodeFromDimensionValue(dimensionValuesWithInventory, inventoryLevel);\r\n return {\r\n value: dimensionValue.Value ?? '',\r\n id: dimensionValue.RecordId.toString(),\r\n colorHexCode: dimensionValue.ColorHexCode,\r\n imageUrl: dimensionValue.ImageUrl,\r\n isDisabled: enableStockCheck && inventoryLevelCode === InventoryLevelValues.outOfStock,\r\n swatchItemAriaLabel: resources.swatchItemAriaLabel ? resources.swatchItemAriaLabel : ''\r\n };\r\n });\r\n return {\r\n dropdownName,\r\n dropdownId,\r\n dropdownList\r\n };\r\n });\r\n\r\n const matchedDimensions = selectedDimensions ?? getDimensionValuesFromQuery(context.request.url.requestUrl);\r\n for (const dimensionInfo of dimensionsInfo) {\r\n const currentDimensionsFromQuery = matchedDimensions.filter(\r\n dimensionFromQuery => dimensionFromQuery.DimensionTypeValue.toString() === dimensionInfo.dropdownId\r\n );\r\n if (!ArrayExtensions.hasElements(currentDimensionsFromQuery)) {\r\n continue;\r\n }\r\n const currentDimensionFromQuery = currentDimensionsFromQuery[0];\r\n const selectedDimensionItem = dimensionInfo.dropdownList.filter(\r\n dimensionItem =>\r\n dimensionItem.value.toLocaleLowerCase() === currentDimensionFromQuery.DimensionValue?.Value?.toLocaleLowerCase()\r\n );\r\n if (!ArrayExtensions.hasElements(selectedDimensionItem)) {\r\n continue;\r\n }\r\n selectedDimensionItem[0].isDefault = true;\r\n }\r\n\r\n const dropdowns: IBuyboxProductConfigureDropdownViewProps[] = dimensionsInfo.map(dimensionInfo => {\r\n return mapProductDimensionFullToDropdownViewProps({\r\n ...dimensionInfo,\r\n resources,\r\n configureErrors,\r\n getDropdownName,\r\n dropdownCallback: onChanged,\r\n className,\r\n context\r\n });\r\n });\r\n\r\n return {\r\n ContainerProps: {\r\n className: `${className}__configure`\r\n },\r\n dropdowns\r\n };\r\n}\r\n\r\nconst _onChanged = async (\r\n notification: IDropdownOnSelectionChangeNotification,\r\n dimensionChanged: (newValue: number, selectedDimensionValue: string) => Promise\r\n): Promise => {\r\n await dimensionChanged(+notification.dropdownId, notification.selectId);\r\n};\r\n\r\nconst _getClassNamePrefix = (typeName: string): string => {\r\n return typeName.toLocaleLowerCase() === 'quickview' ? 'ms-quickView' : 'ms-buybox';\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 {\r\n AddToCartBehavior,\r\n IAddToCartFailureResult,\r\n IAddToCartResources,\r\n ItemSuccessfullyAddedToCartNotification,\r\n PriceComponent } from '@msdyn365-commerce/components';\r\nimport { getUrlSync, ICoreContext, IImageSettings } from '@msdyn365-commerce/core';\r\nimport { ICartActionResult } from '@msdyn365-commerce/global-state';\r\nimport { DeliveryOption, FeatureState, OrgUnitLocation, ProductAvailableQuantity, ProductDimension } from '@msdyn365-commerce/retail-proxy';\r\nimport { NotificationsManager } from '@msdyn365-commerce-modules/notifications-core';\r\nimport { ArrayExtensions, DeliveryMode, IProductInventoryInformation, isAggregatedInventory } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getTelemetryObject, Heading, INodeProps, IPopupProps, Popup } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { BuyboxErrorBlock } from '@msdyn365-commerce-modules/buybox';\r\nimport { IBuyboxCallbacks, IBuyboxState } from '@msdyn365-commerce-modules/buybox';\r\nimport { getConfigureErrors, getGenericError } from '@msdyn365-commerce-modules/buybox';\r\nimport { IEshopBuyboxData } from '../eshop-buybox.data';\r\nimport { IEshopBuyboxProps, IEshopBuyboxResources } from '../eshop-buybox.props.autogenerated';\r\n\r\nconst modalCloseButtonReference: React.RefObject = React.createRef();\r\n\r\n/**\r\n * FindinStore failure Interface.\r\n */\r\nexport interface IFindInStoreFailureResult {\r\n missingDimensions?: ProductDimension[];\r\n}\r\n\r\n/**\r\n * BuyBoxFindinStore View Props Interface.\r\n */\r\nexport interface IBuyboxFindInStoreViewProps {\r\n storeSelector?: React.ReactNode;\r\n heading?: React.ReactNode;\r\n description?: React.ReactNode;\r\n errors?: React.ReactNode;\r\n button?: React.ReactNode;\r\n productPickupOptionList?: React.ReactNode;\r\n\r\n modal?: React.ReactNode;\r\n\r\n ContainerProps: INodeProps;\r\n\r\n openFindInStoreDialog(): Promise;\r\n}\r\n\r\n/**\r\n * On click find store handler.\r\n * @param props -Buybox data.\r\n * @param state -Buybox state.\r\n * @param callbacks -Buybox callbacks.\r\n * @returns Find in store.\r\n */\r\nconst onClickFindInStoreHandler = (props: IEshopBuyboxProps, state: IBuyboxState, callbacks: IBuyboxCallbacks) => async () => {\r\n await findInStoreOnClick(props, state, callbacks);\r\n};\r\n\r\n/**\r\n * Inventory settings based on the inventory policy for aggregated availability.\r\n */\r\ninterface IInventorySettingsProps {\r\n isSectionDisabled: boolean;\r\n description: string;\r\n buttonText: string;\r\n}\r\n\r\n/**\r\n * The function defines the settings values for a given inventory configuration.\r\n * @param context - The context.\r\n * @param isStockCheck - Flag to enable inventory validation.\r\n * @param productAvailability - The product inventory information.\r\n * @param buyboxResources - The buybox string resources.\r\n * @param isLoading - Is loading.\r\n * @returns Boolean.\r\n */\r\nfunction getFindInStoreInventorySettings(\r\n context: ICoreContext,\r\n isStockCheck: boolean,\r\n productAvailability: IProductInventoryInformation[] | undefined,\r\n buyboxResources: IEshopBuyboxResources,\r\n isLoading?: boolean): IInventorySettingsProps {\r\n\r\n // If shouldValidateAggregation is true then is required to check for the product inventory, based on this the messaging will change\r\n // and the find in store button will be ensbled or disabled\r\n\r\n let isSectionDisabled: boolean;\r\n let buttonText; let description: string;\r\n\r\n let pickupInventory: IProductInventoryInformation | undefined;\r\n\r\n if (!isStockCheck || isLoading) {\r\n return {\r\n isSectionDisabled: false,\r\n buttonText: buyboxResources.findInStoreLinkText,\r\n description: buyboxResources.findInStoreDescriptionText\r\n };\r\n }\r\n\r\n if (productAvailability) {\r\n pickupInventory = productAvailability.find(pickup => pickup.deliveryType === DeliveryMode.pickup);\r\n }\r\n\r\n // If aggregated is enabled, then we need to validate the inventor check for find in store.\r\n // If an individual is selected, then we will always show a find in store button.\r\n if (isAggregatedInventory(context.actionContext)) {\r\n if (productAvailability && (pickupInventory?.IsProductAvailable)) {\r\n isSectionDisabled = false;\r\n buttonText = buyboxResources.findInStoreLinkText;\r\n description = buyboxResources.findInStoreDescriptionText;\r\n } else {\r\n isSectionDisabled = true;\r\n buttonText = buyboxResources.findInStoreNotAvailableTextButton;\r\n description = buyboxResources.findInStoreNotAvailableDescription;\r\n }\r\n\r\n } else {\r\n isSectionDisabled = false;\r\n buttonText = buyboxResources.findInStoreLinkText;\r\n description = buyboxResources.findInStoreDescriptionText;\r\n }\r\n\r\n return {\r\n isSectionDisabled,\r\n description,\r\n buttonText\r\n };\r\n}\r\n\r\n/**\r\n * Method to check if we have atleast one common delivery code between product and channel.\r\n * @param productdeliveryOptions - Product DeliveryOption List.\r\n * @param storePickUpOptionList - Channel DeliveryOption List.\r\n * @returns Boolean flag.\r\n */\r\nconst matchDeliveryOptions = (productdeliveryOptions: DeliveryOption[] | undefined, storePickUpOptionList: string[] | undefined): boolean => {\r\n const deliveryOption: string[] = [];\r\n productdeliveryOptions?.map(delivery => {\r\n const pickup = (storePickUpOptionList?.find(deliveryCode => deliveryCode === delivery.Code));\r\n if (pickup) {\r\n deliveryOption.push(pickup);\r\n }\r\n return deliveryOption;\r\n });\r\n\r\n return ArrayExtensions.hasElements(deliveryOption);\r\n};\r\n\r\nexport function getBuyboxFindInStore(\r\n props: IEshopBuyboxProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks): IBuyboxFindInStoreViewProps | undefined {\r\n const {\r\n data,\r\n slots: {\r\n storeSelector\r\n },\r\n resources: {\r\n priceFree,\r\n originalPriceText,\r\n currentPriceText,\r\n findInStoreHeaderText,\r\n buyBoxGoToCartText,\r\n buyBoxContinueShoppingText,\r\n closeNotificationLabel,\r\n buyBoxSingleItemText,\r\n buyBoxMultiLineItemFormatText,\r\n buyBoxHeaderMessageText,\r\n descriptionTextToShowAllPickupOptions },\r\n context: {\r\n request: {\r\n channel: {\r\n PickupDeliveryModeCode\r\n } = { PickupDeliveryModeCode: undefined }\r\n }\r\n }\r\n } = props;\r\n\r\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n const product = data?.product?.result;\r\n const price = data?.productPrice?.result;\r\n const cart = data?.cart?.result;\r\n const deliveryOptions = data?.deliveryOptions?.result;\r\n const productAvailability = data.productAvailableQuantity?.result;\r\n const retailMulitplePickupMFeatureState = data?.featureState?.result\r\n ?.find((featureState: FeatureState) => featureState.Name === multiplePickupStoreSwitchName)?.IsEnabled;\r\n const channelDeliveryOptionConfig = data?.channelDeliveryOptionConfig?.result;\r\n\r\n const missingDimensions = product?.Dimensions?.filter(dimension => !(dimension.DimensionValue?.Value));\r\n\r\n const\r\n {\r\n errorState: {\r\n configureErrors,\r\n quantityError,\r\n otherError,\r\n errorHost\r\n },\r\n modalOpen,\r\n quantity\r\n } = state;\r\n\r\n const { isSectionDisabled, buttonText, description } = getFindInStoreInventorySettings(\r\n props.context,\r\n props.context.app.config.enableStockCheck,\r\n productAvailability,\r\n props.resources,\r\n props.data.productAvailableQuantity.status === 'LOADING' || ArrayExtensions.hasElements(missingDimensions));\r\n\r\n if (!product ||\r\n !ArrayExtensions.hasElements(storeSelector)) {\r\n return undefined;\r\n }\r\n\r\n if (!deliveryOptions ||\r\n !deliveryOptions.DeliveryOptions) {\r\n return undefined;\r\n }\r\n\r\n // If no delivery options present on the product, or none of the delivery options\r\n // match the PickupDeliveryModeCode, that means the item cannot be used for BOPIS\r\n if (retailMulitplePickupMFeatureState && channelDeliveryOptionConfig) {\r\n if (!matchDeliveryOptions(deliveryOptions.DeliveryOptions, channelDeliveryOptionConfig?.PickupDeliveryModeCodes)) {\r\n return undefined;\r\n }\r\n } else if (!PickupDeliveryModeCode || !deliveryOptions.DeliveryOptions.find((option: DeliveryOption) => option.Code === PickupDeliveryModeCode)) {\r\n return undefined;\r\n }\r\n\r\n const dialogStrings = {\r\n goToCartText: buyBoxGoToCartText,\r\n continueShoppingText: buyBoxContinueShoppingText,\r\n closeNotificationLabel,\r\n headerItemOneText: buyBoxSingleItemText,\r\n headerItemFormatText: buyBoxMultiLineItemFormatText,\r\n headerMessageText: buyBoxHeaderMessageText,\r\n freePriceText: priceFree,\r\n originalPriceText,\r\n currentPriceText\r\n };\r\n\r\n const priceComponent = price ? (\r\n ) : '';\r\n\r\n const defaultImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: 'w=240&h=240&m=6', w: 0, h: 0 },\r\n lg: { q: 'w=240&h=240&m=6', w: 0, h: 0 },\r\n xl: { q: 'w=240&h=240&m=6', w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n };\r\n\r\n const popupProps: IPopupProps = {\r\n context: props.context,\r\n className: 'ms-buybox',\r\n id: props.id,\r\n typeName: props.typeName,\r\n data: { product: props.data.product?.result, price: props.data.productPrice?.result },\r\n dialogStrings,\r\n imageSettings: defaultImageSettings,\r\n gridSettings: props.context.request.gridSettings,\r\n productQuantity: quantity,\r\n priceComponent,\r\n navigationUrl: getUrlSync('cart', props.context.actionContext),\r\n modalOpen,\r\n setModalOpen: callbacks.changeModalOpen\r\n };\r\n const renderModalPopup = ;\r\n\r\n return {\r\n ContainerProps: {\r\n className: 'ms-buybox__find-in-store'\r\n },\r\n\r\n storeSelector: storeSelector[0],\r\n\r\n openFindInStoreDialog: onClickFindInStoreHandler(props, state, callbacks),\r\n\r\n heading: (\r\n \r\n ),\r\n\r\n description: (\r\n

\r\n {description}\r\n

\r\n ),\r\n productPickupOptionList: retailMulitplePickupMFeatureState && !isSectionDisabled ? (\r\n <>\r\n

\r\n {descriptionTextToShowAllPickupOptions}\r\n

\r\n
    \r\n {deliveryOptions.DeliveryOptions.map((item: DeliveryOption) => {\r\n return (
  • \r\n {item.Description}\r\n
  • );\r\n })}\r\n
\r\n \r\n ) : null,\r\n errors: (\r\n \r\n ),\r\n\r\n button: (\r\n \r\n {buttonText}\r\n \r\n ),\r\n\r\n modal: renderModalPopup\r\n };\r\n}\r\n\r\n/**\r\n * Handler for find in store button.\r\n * @param props - BuyBox data.\r\n * @param state - BuyBox state.\r\n * @param callbacks - BuyBox callbacks.\r\n * @returns - Promise.\r\n */\r\nasync function findInStoreOnClick(props: IEshopBuyboxProps, state: IBuyboxState, callbacks: IBuyboxCallbacks): Promise {\r\n const {\r\n data: {\r\n storeSelectorStateManager: { result: storeSelectorStateManager },\r\n cart: { result: cart },\r\n productAvailableQuantity: { result: productAvailableQuantity }\r\n },\r\n resources,\r\n context,\r\n modules\r\n } = props;\r\n\r\n const {\r\n selectedProduct,\r\n quantity\r\n } = state;\r\n\r\n let dataProduct = props.data.product.result;\r\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n const retailMulitplePickupMFeatureState = props.data?.featureState?.result\r\n ?.find((featureState: FeatureState) => featureState.Name === multiplePickupStoreSwitchName)?.IsEnabled;\r\n\r\n if (selectedProduct) {\r\n dataProduct = (await selectedProduct) || dataProduct;\r\n }\r\n\r\n if (!dataProduct || !storeSelectorStateManager) {\r\n return;\r\n }\r\n\r\n const product = dataProduct;\r\n\r\n const missingDimensions = product.Dimensions && product.Dimensions.filter((dimension: ProductDimension) => !(dimension.DimensionValue && dimension.DimensionValue.Value));\r\n\r\n let storeSelectorId: string = '';\r\n if (modules && Object.keys(modules).length > 0 && modules.storeSelector && modules.storeSelector.length > 0) {\r\n storeSelectorId = modules.storeSelector[0].id;\r\n }\r\n\r\n if (missingDimensions && missingDimensions.length > 0) {\r\n if (callbacks.updateErrorState) {\r\n callbacks.updateErrorState(\r\n {\r\n errorHost: 'FINDINSTORE',\r\n configureErrors: getConfigureErrors(missingDimensions, resources)\r\n }\r\n );\r\n }\r\n } else {\r\n storeSelectorStateManager.openDialog({\r\n product,\r\n id: storeSelectorId,\r\n parentElementRef: modalCloseButtonReference,\r\n deliveryOptions: retailMulitplePickupMFeatureState ? props.data.deliveryOptions.result : undefined,\r\n onLocationSelected: async (orgUnitLocation: OrgUnitLocation, deliveryMode: string) => {\r\n if (!cart) {\r\n return Promise.resolve();\r\n }\r\n\r\n const behavior = props.context?.app?.config?.addToCartBehavior;\r\n\r\n return cart.addProductToCart({ product, count: quantity, location: orgUnitLocation, deliveryMode })\r\n .then((result: ICartActionResult) => {\r\n if (result.status === 'FAILED' && result.substatus === 'MAXQUANTITY') {\r\n callbacks.changeModalOpen(false);\r\n let productAvailability: ProductAvailableQuantity | undefined;\r\n if (state.productAvailableQuantity) {\r\n productAvailability = state.productAvailableQuantity.ProductAvailableQuantity;\r\n } else if (productAvailableQuantity && ArrayExtensions.hasElements(productAvailableQuantity)) {\r\n const shippingInventory = productAvailableQuantity.find(shipping => shipping.deliveryType === DeliveryMode.pickup);\r\n productAvailability = shippingInventory?.ProductAvailableQuantity;\r\n } else {\r\n productAvailability = undefined;\r\n }\r\n const failureResult: IAddToCartFailureResult =\r\n { failureReason: 'CARTACTIONFAILED', cartActionResult: { status: result.status, substatus: result.substatus } };\r\n callbacks.updateErrorState({\r\n errorHost: 'ADDTOCART',\r\n configureErrors: {},\r\n otherError: getGenericError(failureResult, cart, resources, context, product, productAvailability, orgUnitLocation)\r\n });\r\n } else {\r\n callbacks.updateErrorState({\r\n configureErrors: {}\r\n });\r\n const navigationUrl = getUrlSync('cart', context.actionContext);\r\n if ((behavior === undefined || behavior === AddToCartBehavior.goToCart)) {\r\n if (result.status === 'SUCCESS' && navigationUrl) {\r\n window.location.assign(navigationUrl);\r\n }\r\n } else if (behavior === AddToCartBehavior.showModal) {\r\n callbacks.changeModalOpen(true);\r\n } else if (behavior === AddToCartBehavior.showNotification) {\r\n const defaultImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: 'w=240&h=240&m=6', w: 0, h: 0 },\r\n lg: { q: 'w=240&h=240&m=6', w: 0, h: 0 },\r\n xl: { q: 'w=240&h=240&m=6', w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n };\r\n const telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.friendlyName, props.telemetry);\r\n const dialogStrings: IAddToCartResources = {\r\n goToCartText: resources.buyBoxGoToCartText,\r\n continueShoppingText: resources.buyBoxContinueShoppingText,\r\n closeNotificationLabel: resources.closeNotificationLabel,\r\n headerItemOneText: resources.buyBoxSingleItemText,\r\n headerItemFormatText: resources.buyBoxMultiLineItemFormatText,\r\n headerMessageText: resources.buyBoxHeaderMessageText,\r\n freePriceText: resources.priceFree,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText,\r\n addedQuantityText: resources.addedQuantityText\r\n };\r\n const notification = new ItemSuccessfullyAddedToCartNotification(\r\n props.context,\r\n dialogStrings,\r\n defaultImageSettings,\r\n props.context.request.gridSettings,\r\n product,\r\n props.data.productPrice?.result,\r\n quantity,\r\n navigationUrl,\r\n telemetryContent,\r\n props.id,\r\n props.typeName\r\n );\r\n NotificationsManager.instance().addNotification(notification);\r\n }\r\n }\r\n }).catch((error: Error) => {\r\n if (props.telemetry) {\r\n props.telemetry.exception(error);\r\n props.telemetry.debug('Unable to add product to cart');\r\n }\r\n\r\n });\r\n }\r\n }).catch((error: Error) => {\r\n if (props.telemetry) {\r\n props.telemetry.error(error.message);\r\n props.telemetry.debug('Unable to find in store');\r\n }\r\n\r\n });\r\n }\r\n\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 { ICoreContext, msdyn365Commerce } from '@msdyn365-commerce/core-internal';\r\nimport {\r\n CommerceProperty, ProductDeliveryOptions, ProductDimensionValue,\r\n ProductPrice, ReleasedProductType, SimpleProduct, /*AsyncResult*/\r\n CartLine,\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { BulkPurchase } from '@msdyn365-commerce-modules/bulk-purchase';\r\nimport {\r\n ArrayExtensions, DeliveryMode, FinitePromiseQueue, FinitePromiseQueueError,\r\n getDeliveryOptionsForSelectedVariant, GetDeliveryOptionsForSelectedVariantInput,\r\n getDimensionsForSelectedVariant, GetDimensionsForSelectedVariantInput, getInventoryLevelCodeFromDimensionValue,\r\n getPriceForSelectedVariant, getProductAvailabilitiesForSelectedVariant, getSelectedVariant, IDimensionsApp, IDimensionValueForSelectedVariant,\r\n InventoryLevelValues, IProductInventoryInformation, IPromiseQueue, PriceForSelectedVariantInput,\r\n ProductAvailabilitiesForSelectedVariantInput, SelectedVariantInput, setDimensionValuesToQuery\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { Button, getTelemetryObject, IModuleProps, INodeProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\nimport { Overlay } from 'react-portal-overlay';\r\nimport { GetOrderSummaryStateValuesInput } from '../../actions/eShopOrderSummary/eshopOrderSummary';\r\nimport {\r\n getBuyboxAddToCart,\r\n getBuyBoxInventoryLabel,\r\n getBuyboxKeyInPrice,\r\n getBuyboxProductAddToOrderTemplate,\r\n getBuyboxProductAddToWishlist,\r\n getBuyboxProductDescription,\r\n getBuyboxProductPrice,\r\n getBuyboxProductQuantity,\r\n getBuyboxProductRating,\r\n getBuyboxProductTitle,\r\n getBuyboxShopSimilarLook,\r\n getQuantityLimitsMessages,\r\n IBuyboxAddToCartViewProps,\r\n IBuyboxAddToOrderTemplateViewProps,\r\n IBuyboxAddToWishlistViewProps,\r\n IBuyboxKeyInPriceViewProps,\r\n IBuyboxProductQuantityViewProps,\r\n IBuyboxShopSimilarLookViewProps,\r\n RetailDefaultOrderQuantityLimitsFeatureName\r\n} from './components/eshop-buybox-samll-components';\r\n\r\nimport { getBuyboxProductConfigure} from './components/eshop-buybox-product-configure';\r\nimport { IBuyboxProductConfigureViewProps } from './components/buyboxInterface';\r\n\r\nimport {\r\n IBuyboxCommonData, IBuyboxExtentedProps, IErrorState } from '@msdyn365-commerce-modules/buybox';\r\nimport { IEshopBuyboxData } from './eshop-buybox.data';\r\nimport { IEshopBuyboxProps, IEshopBuyboxResources } from './eshop-buybox.props.autogenerated';\r\nimport { getBuyboxFindInStore, IBuyboxFindInStoreViewProps } from './components/eshop-buybox-find-in-store';\r\n\r\nimport { getCartState } from '@msdyn365-commerce/global-state';\r\nimport { Address, DeliverySpecification } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { updateDeliverySpecificationAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\r\n\r\nexport interface IBuyboxCallbacks {\r\n updateQuantity(newQuantity: number): boolean;\r\n updateKeyInPrice(keyInPrice: number): void;\r\n updateErrorState(newErrorState: IErrorState): void;\r\n updateSelectedProduct(\r\n selectedProduct: Promise,\r\n newInventory: IProductInventoryInformation | undefined,\r\n newPrice: ProductPrice | undefined,\r\n newDeliveryOptions: ProductDeliveryOptions | undefined): void;\r\n getDropdownName(dimensionType: number, resources: IEshopBuyboxResources): string;\r\n dimensionSelectedAsync(selectedDimensionId: number, selectedDimensionValueId: string): Promise;\r\n changeModalOpen(isModalOpen: boolean): void;\r\n changeUpdatingDimension(isUpdatingDimension: boolean): void;\r\n changeUpdatingDeliveryOptions?(isUpdatingDeliveryOptions: boolean): void;\r\n changeCollapseOpen(isCollapseOpen: boolean): void;\r\n updateDeliverySpecs(props: IEshopBuyboxProps): void;\r\n }\r\n\r\nexport interface IBuyboxViewProps extends IEshopBuyboxProps {\r\n state: IBuyboxState;\r\n ModuleProps: IModuleProps;\r\n ProductInfoContainerProps: INodeProps;\r\n MediaGalleryContainerProps: INodeProps;\r\n callbacks: IBuyboxCallbacks;\r\n mediaGallery?: React.ReactNode;\r\n title?: React.ReactNode;\r\n description?: React.ReactNode;\r\n rating?: React.ReactNode;\r\n price?: React.ReactNode;\r\n bulkPurchaseLink?: React.ReactNode;\r\n addToOrderTemplate?: IBuyboxAddToOrderTemplateViewProps;\r\n addToWishlist?: IBuyboxAddToWishlistViewProps;\r\n max: number | undefined;\r\n addToCart: IBuyboxAddToCartViewProps;\r\n findInStore?: IBuyboxFindInStoreViewProps;\r\n quantity?: IBuyboxProductQuantityViewProps;\r\n configure?: IBuyboxProductConfigureViewProps;\r\n inventoryLabel?: React.ReactNode;\r\n shopSimilarLook?: IBuyboxShopSimilarLookViewProps;\r\n shopSimilarDescription?: IBuyboxShopSimilarLookViewProps;\r\n quantityLimitsMessages: React.ReactNode;\r\n telemetryContent?: ITelemetryContent;\r\n keyInPrice?: IBuyboxKeyInPriceViewProps;\r\n unitOfMeasure?: React.ReactNode;\r\n eshopOrderSummary?:React.ReactNode;\r\n orderSummaryContainerProps: INodeProps;\r\n moreProductDetailsContainerProps: INodeProps;\r\n moreProductDetails?: React.ReactNode;\r\n}\r\n\r\n\r\nexport interface IBuyboxState {\r\n quantity: number;\r\n min: number | undefined;\r\n max: number | undefined;\r\n errorState: IErrorState;\r\n selectedProduct?: Promise;\r\n productAvailableQuantity?: IProductInventoryInformation;\r\n productPrice?: ProductPrice;\r\n productDeliveryOptions?: ProductDeliveryOptions;\r\n modalOpen?: boolean;\r\n isUpdatingDimension?: boolean;\r\n isUpdatingDeliveryOptions?: boolean;\r\n isServiceItem?: boolean;\r\n isPriceKeyedIn?: boolean;\r\n keyInPriceAmount?: number;\r\n isCustomPriceSelected?: boolean;\r\n openOverlay:boolean;\r\n isCollapseOpen?: boolean;\r\n cartLineId?: string;\r\n }\r\n\r\n/**\r\n * Buybox Module.\r\n */\r\nclass Buybox extends React.PureComponent, IBuyboxState> {\r\n /**\r\n * A queue of tasks of processing the changes in the dimensions.\r\n * Limit to two processes:\r\n * 1 - for the current process, which is under execution at the moment.\r\n * 2 - next process, which will process the latest version of data.\r\n * @remark Enqueueing new promises will discard the previous ones (except the one which is under processing).\r\n */\r\n private readonly dimensionUpdateQueue: IPromiseQueue = new FinitePromiseQueue(2);\r\n\r\n private dimensions: { [id: number]: string } = {};\r\n\r\n private readonly buyboxCallbacks: IBuyboxCallbacks = {\r\n updateQuantity: (newQuantity: number): boolean => {\r\n const errorState = { ...this.state.errorState };\r\n errorState.quantityError = undefined;\r\n errorState.otherError = undefined;\r\n\r\n this.setState({ quantity: newQuantity, errorState });\r\n return true;\r\n },\r\n updateErrorState: (newErrorState: IErrorState): void => {\r\n this.setState({ errorState: newErrorState });\r\n },\r\n updateSelectedProduct: (\r\n newSelectedProduct: Promise,\r\n newInventory: IProductInventoryInformation | undefined,\r\n newPrice: ProductPrice | undefined,\r\n newDeliveryOptions: ProductDeliveryOptions | undefined\r\n ): void => {\r\n this.setState({\r\n selectedProduct: newSelectedProduct,\r\n productAvailableQuantity: newInventory,\r\n productDeliveryOptions: newDeliveryOptions\r\n });\r\n this._updatePrice(newPrice);\r\n },\r\n dimensionSelectedAsync: async (selectedDimensionId: number, selectedDimensionValueId: string): Promise => {\r\n this.dimensions[`${selectedDimensionId}`] = selectedDimensionValueId;\r\n return this.dimensionUpdateQueue.enqueue(async () => {\r\n return this._updateDimensions();\r\n }).catch((error: any) => { // Ignore discarded processes.\r\n if (error !== FinitePromiseQueueError.ProcessWasDiscardedFromTheQueue) {\r\n throw error;\r\n }\r\n });\r\n },\r\n getDropdownName: (dimensionType: number, resources: IEshopBuyboxResources): string => {\r\n return this._getDropdownName(dimensionType, resources);\r\n },\r\n changeModalOpen: (isModalOpen: boolean): void => {\r\n this.setState({ modalOpen: isModalOpen });\r\n this.forceUpdate();\r\n },\r\n changeUpdatingDimension: (isUpdatingDimension: boolean): void => {\r\n this.setState({ isUpdatingDimension });\r\n },\r\n\r\n /**\r\n * Update isUpdatingDeliveryOptions state.\r\n *\r\n * @param isUpdatingDeliveryOptions - The status of updating delivery options.\r\n */\r\n changeUpdatingDeliveryOptions: (isUpdatingDeliveryOptions: boolean): void => {\r\n this.setState({ isUpdatingDeliveryOptions });\r\n },\r\n\r\n updateKeyInPrice: (customPrice: number): void => {\r\n // Remove custom amount error when updating the custom price\r\n const errorState = { ...this.state.errorState };\r\n errorState.customAmountError = undefined;\r\n\r\n this.setState({ isPriceKeyedIn: true, keyInPriceAmount: customPrice, errorState });\r\n this._updatePrice(this.state.productPrice, customPrice);\r\n },\r\n changeCollapseOpen: (isCollapseOpen: boolean): void => {\r\n this.setState({ isCollapseOpen: isCollapseOpen });\r\n },\r\n updateDeliverySpecs:(props:IEshopBuyboxProps): void=>{\r\n this.updateDeliverySpecsInCart(props);\r\n }\r\n };\r\n\r\n private readonly telemetryContent: ITelemetryContent;\r\n\r\n public constructor(props: IEshopBuyboxProps, state: IBuyboxState) {\r\n super(props);\r\n this.state = {\r\n errorState: {\r\n configureErrors: {}\r\n },\r\n quantity: 1,\r\n min: undefined,\r\n max: undefined,\r\n selectedProduct: undefined,\r\n productPrice: undefined,\r\n productDeliveryOptions: undefined,\r\n\r\n modalOpen: false,\r\n isUpdatingDimension: false,\r\n isUpdatingDeliveryOptions: false,\r\n openOverlay:props.context.request.user.isAuthenticated?false:true,\r\n isCollapseOpen: true\r\n \r\n };\r\n this.telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.friendlyName, props.telemetry);\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n const {\r\n data: {\r\n product: { result: product },\r\n productPrice\r\n }\r\n } = this.props;\r\n\r\n productPrice.then(async (result) => {\r\n this._updatePrice(result);\r\n });\r\n\r\n if (product) {\r\n // Check if the product is service or not by product type\r\n if (product.ItemTypeValue === ReleasedProductType.Service) {\r\n this.setState({ isServiceItem: true });\r\n }\r\n await this._updateQuantitiesInState(product);\r\n }\r\n\r\n const parameters = window.location.search;\r\n const cartlineId = new URLSearchParams(parameters).get('cartlineId');\r\n this.setState({cartLineId: cartlineId!});\r\n\r\n if(cartlineId)\r\n {\r\n const cartState = await getCartState(this.props.context.actionContext);\r\n const cart = cartState.cart;\r\n const cartLines: CartLine[] = cart.CartLines!;\r\n const cartLineItem = cartLines.find(\r\n (cartline) => cartline.LineId === cartlineId\r\n );\r\n if(cartLineItem)\r\n {\r\n this.buyboxCallbacks.updateQuantity(cartLineItem.Quantity!)\r\n }\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const {\r\n slots: {\r\n mediaGallery,\r\n orderSummary,\r\n moreAboutProduct\r\n },\r\n data: {\r\n product: { result: product }\r\n },\r\n config: { className = '' },\r\n context: { request: { user } }\r\n } = this.props;\r\n\r\n const\r\n {\r\n max\r\n } = this.state;\r\n\r\n if (!product) {\r\n this.props.context.telemetry.error('Product content is empty, module wont render');\r\n return null;\r\n }\r\n const props = this.props as IBuyboxExtentedProps;\r\n const defaultMinimumKeyInPrice = 10;\r\n const defaultMaximumKeyInPrice = 100;\r\n\r\n const context = this.props.context as ICoreContext;\r\n const inventoryLevel = context.app.config.inventoryLevel;\r\n const dimensionValuesWithInventory = ArrayExtensions.flatten(\r\n ArrayExtensions.validValues(this.props.data.productDimensions.result?.map(value => value.dimensionValuesWithInventory)));\r\n const hasAvailableProducts = !ArrayExtensions.hasElements(dimensionValuesWithInventory) || dimensionValuesWithInventory.some(\r\n value => {\r\n const inventoryLevelCode = getInventoryLevelCodeFromDimensionValue(value, inventoryLevel);\r\n return inventoryLevelCode !== InventoryLevelValues.outOfStock;\r\n }\r\n );\r\n const orderSummaryClassName = this.state.modalOpen?'ms-buybox__order-summary-display col-sm-6':'ms-buybox__order-summary-notdisplay col-sm-6';\r\n this.props.context.actionContext.update(new GetOrderSummaryStateValuesInput(), { modelOpenValue: this.state.modalOpen });\r\n const viewProps: IBuyboxViewProps = {\r\n ...(this.props as IEshopBuyboxProps),\r\n state: this.state,\r\n mediaGallery: mediaGallery && mediaGallery.length > 0 ? mediaGallery[0] : undefined,\r\n ModuleProps: {\r\n moduleProps: this.props,\r\n className: classnames('eshop-buybox ms-buybox row', className)\r\n },\r\n ProductInfoContainerProps: {\r\n className: 'ms-buybox__content col-sm-6 px-4 pl-md-8'\r\n },\r\n MediaGalleryContainerProps: {\r\n className: 'ms-buybox__media-gallery col-sm-6'\r\n },\r\n orderSummaryContainerProps:{\r\n className: orderSummaryClassName\r\n },\r\n moreProductDetailsContainerProps:{\r\n className: 'ms-buybox__more-product-details-display'\r\n },\r\n \r\n telemetryContent: this.telemetryContent,\r\n callbacks: this.buyboxCallbacks,\r\n title: getBuyboxProductTitle(this.props),\r\n description: getBuyboxProductDescription(this.props),\r\n bulkPurchaseLink: this._renderBuyboxBulkPurchaseLink(),\r\n //unitOfMeasure: getBuyboxProductUnitOfMeasure(props),\r\n configure: getBuyboxProductConfigure(props, this.state, this.buyboxCallbacks),\r\n findInStore: getBuyboxFindInStore(this.props, this.state, this.buyboxCallbacks),\r\n price: getBuyboxProductPrice(this.props, this.state),\r\n addToCart: getBuyboxAddToCart(this.props, this.state, this.buyboxCallbacks, defaultMinimumKeyInPrice, defaultMaximumKeyInPrice,undefined,hasAvailableProducts),\r\n addToOrderTemplate: getBuyboxProductAddToOrderTemplate(this.props, this.state, this.buyboxCallbacks),\r\n addToWishlist: getBuyboxProductAddToWishlist(this.props, this.state, this.buyboxCallbacks),\r\n rating: !props.context.app.config.hideRating && getBuyboxProductRating(this.props),\r\n quantity: product.IsGiftCard ? undefined : getBuyboxProductQuantity(this.props, this.state, this.buyboxCallbacks),\r\n inventoryLabel: getBuyBoxInventoryLabel(this.props),\r\n shopSimilarLook: this.props.config.enableShopSimilarLooks && !product.IsGiftCard ? getBuyboxShopSimilarLook(this.props, this.state, this.buyboxCallbacks) : undefined,\r\n //shopSimilarDescription: this.props.config.enableShopSimilarDescription && !product.IsGiftCard ? getBuyboxShopSimilarButton(props, ShopSimiliarButtonType.Description) : undefined,\r\n keyInPrice: this.props.config.enableKeyInPrice && this.state.isCustomPriceSelected ? getBuyboxKeyInPrice(this.props, this.state, this.buyboxCallbacks) : undefined,\r\n quantityLimitsMessages: getQuantityLimitsMessages(this.props, this.state),\r\n max,\r\n eshopOrderSummary: orderSummary && orderSummary.length > 0? orderSummary[0] : undefined,\r\n moreProductDetails: moreAboutProduct && moreAboutProduct.length>0? moreAboutProduct[0]:undefined\r\n \r\n };\r\n const isZH = this.props.context.request.locale.split('-')[0] == 'zh';\r\n return <>\r\n {this.props.renderView(viewProps) as React.ReactElement}\r\n \r\n
this.setState({openOverlay:false})}>\r\n
{\r\n if (event.target !== event.currentTarget) {\r\n event.stopPropagation();\r\n } \r\n }}>\r\n
{isZH?'事先请登入':'Please Sign in First'}
\r\n
{isZH?'请先登入户口以避免失去在此页注入的数据':'If you have an account with us, please sign in first to avoid losing any information entered on this page'}
\r\n
\r\n {isZH?'登入户口':'Go to Sign In Page'}\r\n
this.setState({openOverlay:false})} className='dismiss-popup'>{isZH?'也许稍后':'Maybe Later'}
\r\n
\r\n
\r\n
\r\n
\r\n \r\n }\r\n\r\n /**\r\n * Handles anchor click event and scrolls to the given bulk purchase module.\r\n * @param bulkPurchaseModule - Bulk purchase module.\r\n * @returns Handler.\r\n */\r\n private readonly _onBulkPurchaseLinkClick = (bulkPurchaseModule: Element) => () => {\r\n const boundingRect = bulkPurchaseModule.getBoundingClientRect();\r\n window.scrollTo(boundingRect.left, boundingRect.top);\r\n };\r\n\r\n private _renderBuyboxBulkPurchaseLink(): React.ReactNode {\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Temporary switch for the feature which is under development.\r\n if (!this.props.context.app.config.isBulkPurchaseEnabled) {\r\n return null;\r\n }\r\n\r\n if (!msdyn365Commerce.isBrowser) {\r\n return null;\r\n }\r\n\r\n const bulkPurchaseModules = Array.from(document.getElementsByClassName(BulkPurchase.className));\r\n\r\n if (!ArrayExtensions.hasElements(bulkPurchaseModules)) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n {this.props.resources.bulkPurchaseLinkText}\r\n \r\n );\r\n }\r\n\r\n private _updatePrice(\r\n newPrice: ProductPrice | undefined,\r\n customPrice: number | undefined = this.state.keyInPriceAmount): void {\r\n\r\n if (this.state.isCustomPriceSelected && newPrice) {\r\n newPrice.CustomerContextualPrice = customPrice;\r\n }\r\n this.setState({ productPrice: newPrice });\r\n }\r\n\r\n private _getProductVariant(dimensionsToUpdate: { [id: number]: string }) {\r\n const {\r\n data: {\r\n product: { result: product }\r\n },\r\n context: {\r\n actionContext,\r\n request: {\r\n apiSettings: {\r\n channelId\r\n }\r\n }\r\n }\r\n } = this.props;\r\n\r\n const productDimensions = this.props.data.productDimensions.result!;\r\n\r\n // Step 3, Build the actually selected dimensions, prioritizing the information in state\r\n // over the information in data\r\n const mappedDimensions = productDimensions.map(dimension => {\r\n\r\n const dimensions = (dimension.dimensionValuesWithInventory ?? dimension.DimensionValues ?? []) as IDimensionValueForSelectedVariant[];\r\n return {\r\n DimensionTypeValue: dimension.DimensionTypeValue,\r\n DimensionValue: dimensions.find(\r\n value => value.DimensionValue?.RecordId.toString() === dimensionsToUpdate[dimension.DimensionTypeValue]\r\n )?.DimensionValue ?? dimension.DimensionValue,\r\n ExtensionProperties: dimension.ExtensionProperties\r\n };\r\n }).filter(dimension => dimension.DimensionValue);\r\n setDimensionValuesToQuery(this.props.context.actionContext.requestContext.url.requestUrl, mappedDimensions);\r\n\r\n // Step 4. Use these dimensions hydrate the product. Wrap this in a promise\r\n // so that places like add to cart can await it\r\n const selectedProductPromise = getSelectedVariant(\r\n new SelectedVariantInput(\r\n product!.MasterProductId ? product!.MasterProductId : product!.RecordId,\r\n channelId, undefined, undefined,\r\n this.props.context.request\r\n ),\r\n actionContext\r\n );\r\n this.setState({ selectedProduct: selectedProductPromise });\r\n\r\n return { productVariantPromise: selectedProductPromise, mappedDimensions };\r\n }\r\n\r\n private readonly _updateDimensions = async (): Promise => {\r\n const product = this.props.data.product.result;\r\n\r\n const productDimensions = this.props.data.productDimensions.result;\r\n\r\n const hasProductDimensions = ArrayExtensions.hasElements(productDimensions);\r\n\r\n if (!product || !hasProductDimensions) {\r\n return;\r\n }\r\n\r\n const dimensionsToUpdate: { [id: number]: string } = { ...this.dimensions };\r\n this.setState({ isUpdatingDimension: true, isUpdatingDeliveryOptions: true });\r\n\r\n // Step 1: Clear error state to display relevant errors\r\n if (this.state.errorState.otherError || this.state.errorState.quantityError) {\r\n const clearErrorState = { ...this.state.errorState };\r\n clearErrorState.otherError = undefined;\r\n if (this.state.errorState.errorHost === 'ADDTOCART') {\r\n clearErrorState.quantityError = undefined;\r\n clearErrorState.errorHost = undefined;\r\n }\r\n this.setState({ errorState: clearErrorState });\r\n }\r\n\r\n // Step 2: Clear any errors indicating the dimension wasn't selected\r\n for (const key of Object.keys(dimensionsToUpdate)) {\r\n if (this.state.errorState.configureErrors[`${key}`]) {\r\n this.setState(previousState => {\r\n const errorState = previousState.errorState;\r\n errorState.configureErrors[`${key}`] = undefined;\r\n return { errorState };\r\n });\r\n }\r\n }\r\n\r\n const data = this._getProductVariant(dimensionsToUpdate);\r\n const productVariant: SimpleProduct | null = await data.productVariantPromise;\r\n\r\n if (!productVariant) {\r\n return;\r\n }\r\n\r\n const promises: Promise[] = [\r\n this._getDimensionsForSelectedVariant(productVariant, data.mappedDimensions),\r\n this._hydrateInventoryInfo(productVariant),\r\n this._hydratePrice(productVariant),\r\n this._hydrateDeliveryOptions(productVariant),\r\n this._updateQuantitiesInState(productVariant)\r\n ];\r\n\r\n await Promise.all(promises);\r\n };\r\n\r\n private async _getDimensionsForSelectedVariant(productVariant: SimpleProduct, mappedDimensions: {\r\n /* eslint-disable @typescript-eslint/naming-convention -- Retail proxy values */\r\n DimensionTypeValue: number;\r\n DimensionValue: ProductDimensionValue | undefined;\r\n ExtensionProperties: CommerceProperty[] | undefined;\r\n /* eslint-enable @typescript-eslint/naming-convention -- Retail proxy values */\r\n }[]): Promise {\r\n await getDimensionsForSelectedVariant(\r\n new GetDimensionsForSelectedVariantInput(\r\n productVariant.MasterProductId ? productVariant.MasterProductId : productVariant.RecordId,\r\n this.props.context.request.apiSettings.channelId,\r\n mappedDimensions,\r\n this.props.context.request\r\n ),\r\n this.props.context.actionContext\r\n );\r\n }\r\n\r\n private async _hydrateInventoryInfo(productVariant: SimpleProduct): Promise {\r\n // Step 5. Use these dimensions hydrate the inventory. Wrap this in a promise\r\n // so that places like add to cart can await it\r\n const newAvailableQuantity = await getProductAvailabilitiesForSelectedVariant(\r\n new ProductAvailabilitiesForSelectedVariantInput(\r\n productVariant.RecordId,\r\n this.props.context.request.apiSettings.channelId\r\n ),\r\n this.props.context.actionContext\r\n );\r\n\r\n const newShippingQuantity = newAvailableQuantity?.find(shipping => shipping.deliveryType === DeliveryMode.shipping);\r\n const isCustomPriceSelected = productVariant.Dimensions?.find(\r\n dimension => dimension.DimensionTypeValue === 4 && dimension.DimensionValue && dimension.DimensionValue.Value?.toLowerCase() === 'custom');\r\n if (isCustomPriceSelected) {\r\n this.setState({ isCustomPriceSelected: true });\r\n } else {\r\n this.setState(previousState => {\r\n const errorState = previousState.errorState;\r\n errorState.customAmountError = undefined;\r\n return { isCustomPriceSelected: false, isPriceKeyedIn: false, errorState };\r\n });\r\n }\r\n\r\n if (newShippingQuantity) {\r\n this.setState({ productAvailableQuantity: newShippingQuantity });\r\n } else {\r\n this.setState({ productAvailableQuantity: undefined });\r\n }\r\n }\r\n\r\n private async _hydratePrice(productVariant: SimpleProduct): Promise {\r\n // Step 6. Use these dimensions hydrate the product price.\r\n const newPrice = await getPriceForSelectedVariant(\r\n new PriceForSelectedVariantInput(\r\n productVariant.RecordId,\r\n this.props.context.request.apiSettings.channelId\r\n ),\r\n this.props.context.actionContext\r\n );\r\n\r\n if (newPrice) {\r\n this._updatePrice(newPrice);\r\n }\r\n }\r\n\r\n private async _hydrateDeliveryOptions(productVariant: SimpleProduct): Promise {\r\n const retailMultiplePickupFeatureState = this.props.data.featureState.result?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature');\r\n\r\n // Step 7. Use these dimensions hydrate the product delivery options.\r\n const newDeliveryOptions = await getDeliveryOptionsForSelectedVariant(\r\n new GetDeliveryOptionsForSelectedVariantInput(\r\n productVariant.RecordId,\r\n this.props.context.request.apiSettings.channelId,\r\n undefined,\r\n undefined,\r\n retailMultiplePickupFeatureState?.IsEnabled\r\n ),\r\n this.props.context.actionContext\r\n );\r\n\r\n if (newDeliveryOptions) {\r\n this.setState({ productDeliveryOptions: newDeliveryOptions });\r\n }\r\n }\r\n\r\n private async _updateQuantitiesInState(product: SimpleProduct): Promise {\r\n const isOrderQuantityLimitsFeatureEnabled = await this._isOrderQuantityLimitsFeatureEnabled();\r\n if (isOrderQuantityLimitsFeatureEnabled && product) {\r\n this.setState({\r\n min: product.Behavior?.MinimumQuantity || 1,\r\n\r\n // If max by feature in default order settings is not defined then use max from site settings or default max 10.\r\n max: (product.Behavior?.MaximumQuantity && product.Behavior?.MaximumQuantity > 0) ? product.Behavior?.MaximumQuantity : this.props.context.app.config.maxQuantityForCartLineItem || 10\r\n });\r\n } else {\r\n this.setState({\r\n min: 1,\r\n max: this.props.context.app.config.maxQuantityForCartLineItem || 10\r\n });\r\n }\r\n }\r\n\r\n private readonly _getDropdownName = (dimensionType: number, resources: IEshopBuyboxResources): string => {\r\n const isGiftCard = this.props.data.product.result?.IsGiftCard;\r\n\r\n switch (dimensionType) {\r\n case 1: // ProductDimensionType.Color\r\n return resources.productDimensionTypeColor;\r\n case 2: // ProductDimensionType.Configuration\r\n return resources.productDimensionTypeConfiguration;\r\n case 3: // ProductDimensionType.Size\r\n return resources.productDimensionTypeSize;\r\n case 4: // ProductDimensionType.Style\r\n return isGiftCard ? resources.productDimensionTypeAmount : resources.productDimensionTypeStyle;\r\n default:\r\n return '';\r\n }\r\n };\r\n\r\n private async _isOrderQuantityLimitsFeatureEnabled(): Promise {\r\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'none') {\r\n return false;\r\n }\r\n\r\n const featureStatuses = await this.props.data.featureState;\r\n const isFeatureEnabledInHq = featureStatuses?.find(featureState => featureState.Name === RetailDefaultOrderQuantityLimitsFeatureName)?.IsEnabled;\r\n if (!isFeatureEnabledInHq) {\r\n return false;\r\n }\r\n\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\r\n return true;\r\n }\r\n let customerInfo;\r\n try {\r\n customerInfo = await this.props.data.customerInformation;\r\n } catch (error) {\r\n this.props.telemetry.information(\"error\");\r\n this.props.telemetry.debug('Unable to receive Customer Information. May be user is not authorized');\r\n return false;\r\n }\r\n\r\n return customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b));\r\n }\r\n\r\n private async updateDeliverySpecsInCart(props: IEshopBuyboxProps):Promise {\r\n // const { data: { cart: cart } } = props;\r\n \r\n const cartState = await getCartState(props.context.actionContext);\r\n const cart = cartState.cart; \r\n \r\n const cartVersion = cart.Version;\r\n let updatedCartVersion;\r\n \r\n if (cartVersion) {\r\n try {\r\n const enum DeliveryPreferenceType {\r\n None = 0,\r\n ShipToAddress = 1,\r\n PickupFromStore = 2,\r\n ElectronicDelivery = 3,\r\n DeliverItemsIndividually = 4\r\n }\r\n \r\n let devliveryAddress: Address = {\r\n Name: 'Dummy Address',\r\n FullAddress: 'Dummy Address Full Address',\r\n RecordId: 1,\r\n Street: 'Dummy Street',\r\n StreetNumber: '10A',\r\n City: 'Singapore',\r\n State: '',\r\n ZipCode: '000000',\r\n ThreeLetterISORegionName: 'SGP',\r\n TwoLetterISORegionName: 'SG',\r\n Deactivate: false,\r\n IsPrimary: true\r\n };\r\n \r\n let today = new Date();\r\n let deliveryEmailAddress = 'donorrelations@btrts.org.sg';\r\n \r\n const deliverySpecifications: DeliverySpecification = {\r\n DeliveryModeId: 'Standard', // pickupFromStoreModeCode,\r\n DeliveryPreferenceTypeValue: DeliveryPreferenceType.ShipToAddress,\r\n ElectronicDeliveryEmailAddress: deliveryEmailAddress,\r\n PickUpStoreId: '00000182',\r\n DeliveryAddress: devliveryAddress,\r\n RequestedDeliveryDate: today\r\n };\r\n \r\n await updateDeliverySpecificationAsync({ callerContext: props.context.actionContext }, cart.Id, deliverySpecifications).then(updatedCart => {\r\n updatedCartVersion = updatedCart.Version;\r\n }).catch(error => {\r\n props.context.actionContext.telemetry.exception(error);\r\n throw new Error('[updateDeliverySpecificationAsync] Unable to update delivery mode in cart:');\r\n });\r\n \r\n console.log('--updateCart--', updatedCartVersion);\r\n // if (!updateCart) {\r\n // throw new Error('Unable to update delivery mode in cart by updateDeliverySpecificationAsync.');\r\n // }\r\n await cartState.refreshCart({});\r\n \r\n } catch (error) {\r\n // const e = error as Error;\r\n \r\n // console.log('---error--', e.message);\r\n // // this.props.telemetry.warning(e.message);\r\n // //this.props.telemetry.debug('Unable to update delivery specs in cart.');\r\n \r\n // return AsyncResult.resolve();\r\n }\r\n } else {\r\n // // this.props.telemetry.warning('Cart version not found for delivery specs update request.');\r\n // console.log('--cart version does not found---');\r\n // return AsyncResult.resolve();\r\n }\r\n }\r\n}\r\n\r\nexport default Buybox;\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 { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IBuyboxAddToCartViewProps, IBuyboxAddToOrderTemplateViewProps, IBuyboxAddToWishlistViewProps, IBuyboxKeyInPriceViewProps, IBuyboxProductQuantityViewProps, IBuyboxShopSimilarLookViewProps } from './common/eshop-buybox-interface';\r\nimport { IBuyboxViewProps } from './eshop-buybox';\r\nimport { IBuyboxFindInStoreViewProps } from './components/eshop-buybox-find-in-store';\r\nimport { Overlay } from 'react-portal-overlay';\r\nimport {IBuyboxProductConfigureDropdownViewProps, IBuyboxProductConfigureViewProps} from './components/buyboxInterface';\r\n\r\n\r\nconst BuyboxView: React.FC = props => {\r\n const { ModuleProps, MediaGalleryContainerProps, ProductInfoContainerProps, addToCart, addToOrderTemplate, addToWishlist, configure, description, findInStore, quantity, price, title, rating, inventoryLabel, shopSimilarLook, keyInPrice,\r\n shopSimilarDescription, unitOfMeasure, orderSummaryContainerProps, /*moreProductDetails*/ } = props;\r\n\r\n return (\r\n \r\n \r\n {props.mediaGallery}\r\n \r\n \r\n {title}\r\n {price}\r\n {unitOfMeasure}\r\n {props.bulkPurchaseLink}\r\n {description}\r\n {rating}\r\n {configure && _renderConfigure(configure)}\r\n {keyInPrice && _renderKeyInPrice(keyInPrice)}\r\n {quantity && _renderQuantity(quantity)}\r\n {inventoryLabel}\r\n {addToCart && _renderAddToCart(addToCart)}\r\n { /*{moreProductDetails && _renderMoreProductDetails(props)}*/}\r\n {findInStore && _renderFindInStore(findInStore)}\r\n {addToOrderTemplate && _renderAddToOrderTemplate(addToOrderTemplate)}\r\n {addToWishlist && _renderAddToWishlist(addToWishlist)}\r\n {_renderSocialShare(props.slots && props.slots.socialShare)}\r\n {shopSimilarLook && _renderShopSimilarItem(shopSimilarLook)}\r\n {shopSimilarDescription && _renderShopSimilarItem(shopSimilarDescription)}\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n \r\n { props.eshopOrderSummary}\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n );\r\n};\r\nconst _handleCloseButtonClick = (props:IBuyboxViewProps)=>{\r\n props.callbacks.changeModalOpen(false);\r\n}\r\n// const _handleCollapseButtonClick = (props:IBuyboxViewProps, value: boolean)=>{\r\n// props.callbacks.changeCollapseOpen(value);\r\n// }\r\n\r\nconst _renderAddToCart = (addToCart: IBuyboxAddToCartViewProps): JSX.Element => {\r\n const { ContainerProps, errorBlock, button } = addToCart;\r\n\r\n return (\r\n \r\n {errorBlock}\r\n {button}\r\n \r\n );\r\n};\r\n\r\n// const _renderMoreProductDetails = (props: IBuyboxViewProps): JSX.Element => {\r\n// const { moreProductDetailsContainerProps, moreProductDetails } = props;\r\n// const showMoreProductDetails = props.state.isCollapseOpen;\r\n// const buttonClassName = showMoreProductDetails? 'more-product-details-close':'more-product-details-open';\r\n\r\n// return (\r\n// \r\n//
\r\n//
\r\n//
\r\n// {props.config.moreProductDetailsTitle}\r\n// {props.config.showCollapseButton && }\r\n//
\r\n// { showMoreProductDetails &&
\r\n// {moreProductDetails}\r\n//
\r\n// }\r\n//
\r\n//
\r\n// );\r\n// };\r\n\r\nconst _renderAddToOrderTemplate = (addToOrderTemplate: IBuyboxAddToOrderTemplateViewProps): JSX.Element => {\r\n const { ContainerProps, errorBlock, button } = addToOrderTemplate;\r\n\r\n return (\r\n \r\n {errorBlock}\r\n {button}\r\n \r\n );\r\n};\r\n\r\nconst _renderAddToWishlist = (addToWishlist: IBuyboxAddToWishlistViewProps): JSX.Element => {\r\n const { ContainerProps, errorBlock, button } = addToWishlist;\r\n\r\n return (\r\n \r\n {errorBlock}\r\n {button}\r\n \r\n );\r\n};\r\n\r\nconst _renderConfigure = (configure: IBuyboxProductConfigureViewProps): JSX.Element => {\r\n const { ContainerProps, dropdowns } = configure;\r\n\r\n return (\r\n \r\n {dropdowns.map(_renderConfigureDropdown)}\r\n \r\n );\r\n};\r\n\r\nconst _renderSocialShare = (socialShare: React.ReactNode[]): JSX.Element | undefined => {\r\n if (!socialShare || socialShare.length === 0) {\r\n return undefined;\r\n }\r\n\r\n return (\r\n <>\r\n {socialShare[0]}\r\n \r\n );\r\n};\r\n\r\nconst _renderConfigureDropdown = (dropdown: IBuyboxProductConfigureDropdownViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, errors, select, errorContainerProps } = dropdown;\r\n\r\n return (\r\n \r\n \r\n {heading}\r\n \r\n {select}\r\n \r\n {errors}\r\n \r\n \r\n );\r\n};\r\n\r\nconst _renderFindInStore = (findInStore: IBuyboxFindInStoreViewProps): JSX.Element => {\r\n const { ContainerProps, storeSelector, heading, description, errors, button, modal, productPickupOptionList } = findInStore;\r\n\r\n return (\r\n \r\n {storeSelector}\r\n {heading}\r\n {productPickupOptionList}\r\n {description}\r\n {errors}\r\n {button}\r\n {modal}\r\n \r\n );\r\n};\r\n\r\nconst _renderQuantity = (quantity: IBuyboxProductQuantityViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, input, errors, ErrorContainerProps } = quantity;\r\n\r\n return (\r\n \r\n \r\n {heading} \r\n \r\n {input} \r\n \r\n {errors} \r\n \r\n \r\n );\r\n};\r\n\r\nconst _renderKeyInPrice = (keyInPrice: IBuyboxKeyInPriceViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, input } = keyInPrice;\r\n\r\n return (\r\n \r\n \r\n {heading}\r\n \r\n {input}\r\n \r\n );\r\n};\r\n\r\nconst _renderShopSimilarItem = (shopSimilarItem: IBuyboxShopSimilarLookViewProps): JSX.Element => {\r\n const { ContainerProps, errors, input } = shopSimilarItem;\r\n\r\n return (\r\n \r\n {errors}\r\n {input}\r\n \r\n );\r\n};\r\nexport default BuyboxView;\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['eshop-buybox'] = {\n c: () => require('partner/modules/eshop-buybox/eshop-buybox.tsx'),\n $type: 'containerModule',\n da: [{name:'cart', path:'@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action', runOn: 0},{name:'channelDeliveryOptionConfig', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration', runOn: 0},{name:'customerInformation', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer', runOn: 0},{name:'deliveryOptions', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-selected-variant', runOn: 0},{name:'featureState', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state', runOn: 0},{name:'orderTemplates', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/order-templates/get-order-templates-preview', runOn: 1},{name:'product', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant', runOn: 0},{name:'productAvailableQuantity', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-product-availabilities-for-selected-variant', runOn: 0},{name:'productDimensions', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-dimensions-for-selected-variant', runOn: 0},{name:'productPrice', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant', runOn: 0},{name:'ratingsSummary', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-ratings-summary', runOn: 1},{name:'storeSelectorStateManager', path:'@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action', runOn: 1},{name:'wishlists', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'eshop-buybox',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/eshop-buybox'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action';\n let dataAction = require('@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action');\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-delivery-options-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-dimensions-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-dimensions-for-selected-variant');\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/get-price-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-product-availabilities-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-product-availabilities-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-ratings-summary';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-ratings-summary');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/order-templates/get-order-templates-preview';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/order-templates/get-order-templates-preview');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action';\n let dataAction = require('@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|eshop-buybox|eshop-buybox'] = {\n c: () => require('partner/modules/eshop-buybox/eshop-buybox.view.tsx'),\n cn: '__local__-__local__-eshop-buybox'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["Quantity","React","constructor","props","super","inputRef","_validateMin","minValue","undefined","this","min","isNaN","state","currentInput","setState","onChange","currentCount","isUpdateing","_onIncrement","bind","_onDecrement","_handleChange","payLoad","getPayloadObject","telemetryContent","componentDidUpdate","prevProps","disabled","render","max","decrementDisabled","isGiftCard","incrementDisabled","currentValue","contentAction","etext","TelemetryConstant","DecrementQuantity","decrementAttributes","getTelemetryAttributes","IncrementQuantity","incrementAttributes","extraClassDecrement","extraClassIncrement","className","id","Object","assign","title","decrementButtonAriaLabel","onClick","tabIndex","color","type","pattern","value","onBlur","inputQuantityAriaLabel","role","ref","incrementButtonAriaLabel","invokeCallback","currQuantity","updatedQuantity","_this$props$context","context","update","GetSelectedQuantityValuesInput","selectedQuantity","_this$props$context2","e","_this$props$context3","parseInt","target","inputElement","current","HTMLInputElement","_debounce","setAttribute","toString","defaultProps","decrementGlyphClass","incrementGlyphClass","__decorate","observer","getGenericError","result","cart","resources","product","productAvailability","location","localeCode","request","locale","split","failureReason","addedToCartFailureMessage","cartActionResult","substatus","elementFoundAt","productIdToFind","RecordId","i","CartLines","length","_context$actionContex","ProductId","DeliveryMode","actionContext","requestContext","channel","PickupDeliveryModeCode","FulfillmentStoreId","OrgUnitNumber","curQuantity","cartLineToUpdate","_objectSpread","maxQuantityForCartLineItem","app","config","availableQty","AvailableQuantity","quantityLimit","Math","resource","replace","_result$cartActionRes","errorDetails","LocalizedMessage","getConfigureErrors","dimensions","forEach","dimension","DimensionTypeValue","dimensionTypeValue","productDimensionTypeColorErrorMessage","productDimensionTypeConfigurationErrorMessage","productDimensionTypeSizeErrorMessage","productDimensionTypeAmountErrorMessage","productDimensionTypeStyleErrorMessage","getDimensionErrorString","Popup","popupProps","_context$app$config","dialogStrings","imageSettings","gridSettings","data","price","productQuantity","priceComponent","navigationUrl","modalOpen","setModalOpen","closeModal","ContinueShopping","continueShoppingAttribute","ViewBagAndCheckout","viewBagAttribute","fallbackImageUrl","getFallbackImageUrl","ItemId","apiSettings","cropFocalRegion","quantity","itemsString","headerItemOneText","headerItemFormatText","shouldDisplayUnitOfMeasure","unitOfMeasureDisplayType","reducedDimensions","Dimensions","reduce","str","productDimension","DimensionValue","Value","Modal","isOpen","onClosed","toggle","ModalHeader","headerMessageText","ModalBody","Image","src","PrimaryImageUrl","fallBackSrc","altText","Name","loadFailureBehavior","DefaultUnitOfMeasure","Button","href","goToCartText","continueShoppingText","AddToCartBehavior","propagateResult","onAdd","propagateError","onError","getAddToCartInputFromProps","async","_props$orderDetailsPr","_props$data","products","orderDetailsProducts","filter","ObjectExtensions","isNullOrUndefined","simpleProduct","input","map","count","salesLine","catalogId","CatalogId","ArrayExtensions","hasElements","_props$catalogId","searchCriteriaInput","Context","ChannelId","channelId","getCatalogId","IncludeAttributes","Ids","productId","productSearchResultsWithImages","ProductsDataActions","callerContext","productSearchResult","newProductSearchResult","newImageUrl","generateProductImageUrl","item","productData","find","_productData$BasePric","ProductTypeValue","ProductType","Variant","AdjustedPrice","Price","BasePrice","_props$quantity","addItemsToCart","setDisabled","setItemsAddedToCartDialogOpen","setErrorMessage","addToCartInput","cartState","getCartState","addToCartResult","addProductsToCart","status","_validationResult$Val","_props$dialogStrings4","_props$dialogStrings5","_props$dialogStrings$4","_props$dialogStrings6","errorCount","CartsDataActions","bypassCache","Id","Version","ValidationFailuresByCartLines","errorText","oneErrorText","multiErrorsText","format","validationErrorMessage","handleAddItemsToCartSuccess","_props$dialogStrings7","_props$dialogStrings$5","_addToCartResult$erro3","_addToCartResult$erro4","_props$dialogStrings$6","_props$dialogStrings8","buyAgainNotificationTitle","NotificationsManager","instance","addNotification","ErrorNotification","buyAgainNotificationCloseAriaLabel","closeNotificationLabel","AddToCartComponentActions","_event","openModal","cartError","addToCartError","hasOrderDetailsProducts","hasProducts","hasMultipleProducts","shouldSkipSiteSettings","_cart$CartLines","_product$ProductNumbe","isItemExistsInCart","el","LineId","cartLineId","newQuantity","updateQuantityResult","updateCartLineQuantity","_updateQuantityResult","_updateQuantityResult2","_props$dialogStrings$","_props$dialogStrings","_props$productAvailab","cartLineIds","removeCartLineResult","removeCartLines","_removeCartLineResult","_removeCartLineResult2","_props$dialogStrings$2","_props$dialogStrings2","refreshCart","toast","error","addProductToCart","availableQuantity","additionalProperties","orderQuantityLimitsFeatureIsEnabled","isOrderQuantityLimitsFeatureEnabled","enableStockCheck","isPriceKeyedIn","customPrice","customPriceAmount","isAddEmailDeliveryItemToCart","_addToCartResult$erro","_addToCartResult$erro2","_props$dialogStrings$3","_props$dialogStrings3","ProductNumber","CartLineID","CartID","CartLineComment","ParentCartLineID","ProductID","EventID","EventName","SerialID","SerialNumber","SerialName","Name_1","Name_2","Name_3","Name_4","Name_5","Name_6","Name_7","Name_8","Name_9","Name_10","Name_11","Name_12","Name_13","Name_14","Name_15","Name_16","Name_17","Name_18","Name_19","Name_20","Remarks","Message","Category","DedicatedBy","HasTaxDeduction","Nric","BuildingName","UnitNumber","PostalCode","PhoneNumber","Country","ChineseName","SchoolName","CompanyName","DonationOption","BlessingOption","LightOption","ValidFrom","ValidTo","DedicationPeriod","StartDate","Gender","SurgeryDate","BirthDate","BirthTime","BirthDate_2","BirthTime_2","DeathDate","DeathTime","DeceasedRelationship","NameChange","OldName_1","OldName_2","NameNextKin","ContactNumber","ContactNumberNextKin","PassportNumber","PassportExpiryDate","PassportIssuedDate","Consent","IsInsuranceIncluded","generateErrorLog","addOneItemToCart","AddToCartFunctionalComponent","_props$data2","_props$dialogStrings9","_props$dialogStrings10","_props$dialogStrings11","_props$data3","_props$data4","_props$dialogStrings$7","_props$dialogStrings12","_props$dialogStrings$8","_props$dialogStrings13","_props$dialogStrings$9","_props$dialogStrings14","_props$dialogStrings$10","_props$dialogStrings15","_props$dialogStrings$11","_props$dialogStrings16","_props$addToCartArial","_props$addToCartArial2","useState","isItemsAddedToCartDialogOpen","errorMessage","setAddToCartInput","closeItemsAddedToCartDialog","PriceComponent","typeName","freePriceText","originalPriceText","currentPriceText","itemsAddedResource","viewCartButtonText","closeButtonLabel","itemsAddedToCartHeaderText","itemsAddedToCartFormatText","linesAddedToCartFormatText","headerLinesFormatText","itemsAddedValidationErrorMessage","renderModalPopup","label","updateCartTitle","getLinkText","payload","TelemetryEvent","AddToCart","attributes","buttonClassName","retrievedInput","retrieveAddToCartInput","classnames","addToCartArialLabel","event","isIntermediateState","shouldShowOutOfStock","ItemsAddedToCartDialogComponent","isModalOpen","onClose","outOfStockText","addToCartText","isCustomPriceSelected","maximumKeyInPrice","minimumKeyInPrice","defaultMaximumKeyInPrice","defaultMinimumKeyInPrice","missingDimensions","_productAvailability$","defaultAvailableQuantity","stockLeft","includeCurrentQuantity","_props$hasAvailablePr","isLoading","isProductQuantityLoading","isUpdatingDimension","isLoadingDeliveryOptions","isUpdatingDeliveryOptions","isAddServiceItemToCart","hasAvailableProducts","includedQuantityNumber","_props$data5","AddToCartComponent","msdyn365Commerce","createComponent","component","getBuyBoxInventoryLabel","productAvailableQuantity","StockLevelLabel","inventoryClassName","StockLevelCode","toLowerCase","getBuyboxProductTitle","titleHeadingTag","Heading","headingTag","text","getBuyboxProductDescription","Description","getBuyboxAddToCart","callbacks","productDetails","_props$data$product$r","_props$data$product","_props$data$cart$resu","_props$data$cart","_props$data$productAv","_props$data$productAv2","_props$data$deliveryO","_props$context$action","_props$data$deliveryO2","errorState","configureErrors","quantityError","customAmountError","otherError","errorHost","selectedProduct","isServiceItem","ProductAvailableQuantity","buyBoxGoToCartText","buyBoxContinueShoppingText","buyBoxSingleItemText","buyBoxMultiLineItemFormatText","buyBoxHeaderMessageText","priceFree","addedQuantityText","changeUpdatingDimension","deliveryOptions","changeUpdatingDeliveryOptions","getTelemetryObject","telemetryPageName","telemetry","emailDeliveryModeCode","EmailDeliveryModeCode","isEmailDelivery","DeliveryOptions","Code","isDisabled","ContainerProps","button","addToCartTitle","outOfStockTitle","getUrlSync","productPrice","onAddToCartFailed","getSelectedProduct","viewports","xs","q","w","h","lg","xl","lazyload","keyInPriceAmount","_isOrderQuantityLimitsFeatureEnabled","onItemAddedToCart","isNavigationToCartPageDisabled","errorBlock","BuyboxErrorBlock","showError","quantityErrorForState","customAmountErrorForState","otherErrorForState","errorMessageOutOfStock","errorMessageOutOfRangeOneLeft","errorMessageOutOfRangeFormat","formatedAmountLimit","cultureFormatter","formatCurrency","invalidSmallCustomAmountText","invalidLargeCustomAmountText","updateErrorState","IsGiftCard","changeModalOpen","getBuyboxProductPrice","getBuyboxProductRating","ratingsSummary","ratingComponent","averageRating","RatingComponent","avgRating","readOnly","ariaLabel","averageRatingAriaLabel","ratingCount","reviewsCount","generateAddToOrderTemplateDialogResources","addToOrderTemplateHeader","noOrderTemplatesMessage","noOrderTemplatesDescription","createAnOrderTemplateButtonText","createNewOrderTemplateButtonText","cancelOrderTemplateCreationButtonText","selectTemplatesText","addToTemplateButtonText","lineItemsText","generateOrderTemplateNameDialogResources","orderTemplateHeaderLabel","createOrderTemplateHeader","orderTemplateTitleLabel","orderTemplateTitle","orderTemplateNameAriaLabel","orderTemplateDescription","createOrderTemplateDescription","defaultOrderTemplateName","orderTemplateButtonLabel","createOrderTemplateButtonText","orderTemplateCancelButtonLabel","cancelNewOrderTemplateCreationButtonText","generateItemAddedToOrderTemplateDialogResources","viewOrderTemplateButtonText","continueShoppingButtonText","itemAddedToOrderTemplateHeaderItemOneText","itemAddedToOrderTemplateHeaderItemFormatText","itemAddedToOrderTemplateHeaderMessageText","generateDuplicateItemsWhenAddingToOrderTemplateDialogResources","duplicatedProductsHeader","duplicatedProductsDescription","updateQuantityButtonText","cancelDuplicateItemsButtonText","getBuyboxProductAddToOrderTemplate","orderTemplates","customerInformation","AddToOrderTemplateComponent","addToOrderTemplateButtonText","addToOrderTemplateDialogResources","createOrderTemplateDialogResources","itemAddedToOrderTemplateDialogResources","addToOrderTemplateButtonTooltip","duplicateItemsWhenAddingToOrderTemplateDialogResources","getBuyboxProductAddToWishlist","wishlists","AddToWishlistComponent","addToWishlistButtonText","removeFromWishlistButtonText","addToWishlistMessage","removedFromWishlistMessage","addItemToWishlistError","removeItemFromWishlistError","nameOfWishlist","getBuyboxProductQuantity","_props$data$productDi","inventoryLevel","productDimensionsData","productDimensions","isProductVariantUnAvailable","dimensionValuesWithInventory","dimensionValuesWithInventoryElement","getInventoryLevelCodeFromDimensionValue","InventoryLevelValues","available","classname","LabelContainerProps","tag","htmlFor","ErrorContainerProps","heading","quantityTitle","productQuantityHeading","errors","newValue","updateQuantity","minQuantityText","maxQuantityText","getBuyboxShopSimilarLook","ShopSimliarLooks","attribute","shopSimilarLooksText","searchURL","separator","includes","document","getBuyboxKeyInPrice","buyboxKeyInPriceLabelHeading","currentTarget","updateKeyInPrice","Number","parseFloat","_ref","errorMessages","values","message","push","Alert","assertive","buyboxErrorMessageHeader","index","key","getQuantityLimitsMessages","Node","_renderMaxLabel","_renderMinLabel","RetailDefaultOrderQuantityLimitsFeatureName","MAX_VALUE","_props$data$featureSt","_props$context","featureState","IsEnabled","defaultOrderQuantityLimitsFeatureConfig","platform","enableDefaultOrderQuantityLimits","customerInfo","IsB2b","SelectionType","Dropdown","selectMenu","_selectSwatch","selectedIndex","itemId","dropdownId","selectId","selectedValue","_onChanged","innerText","selectedItem","dropdownList","isDefault","dropdownName","selectionType","swatch","_renderSwatch","_renderDropdown","dropdownToggleName","selected","hidden","swatchItems","dimensionType","SwatchComponent","list","onSelectItem","getBuyboxProductConfigure","selectedDimensions","_props$data$productDi2","getDropdownName","hasProductDimensions","_getClassNamePrefix","onChanged","notification","dimensionSelectedAsync","dimensionsInfo","productDimensionFull","_productDimensionFull","DimensionValues","_value$DimensionValue","_value$DimensionValue2","_dimensionValuesWithI","_dimensionValue$Value","dimensionValue","inventoryLevelCode","colorHexCode","ColorHexCode","imageUrl","ImageUrl","outOfStock","swatchItemAriaLabel","matchedDimensions","getDimensionValuesFromQuery","url","requestUrl","dimensionInfo","currentDimensionsFromQuery","dimensionFromQuery","currentDimensionFromQuery","selectedDimensionItem","dimensionItem","_currentDimensionFrom","toLocaleLowerCase","dropdowns","dimensionId","selectDimensionFormatString","dimensionSelectionType","dropdown","convertProductDimensionTypeToDimensionTypes","dimensionsAsSwatchConfiguration","dimensionsAsSwatchType","DimensionTypes","none","errorContainerProps","select","dropdownCallback","mapProductDimensionFullToDropdownViewProps","dimensionChanged","modalCloseButtonReference","onClickFindInStoreHandler","storeSelectorStateManager","modules","dataProduct","multiplePickupStoreSwitchName","retailMulitplePickupMFeatureState","storeSelectorId","keys","storeSelector","openDialog","parentElementRef","onLocationSelected","orgUnitLocation","deliveryMode","Promise","resolve","behavior","addToCartBehavior","then","shippingInventory","shipping","deliveryType","pickup","failureResult","goToCart","window","showModal","showNotification","_props$data$productPr2","defaultImageSettings","friendlyName","ItemSuccessfullyAddedToCartNotification","catch","exception","debug","findInStoreOnClick","getBuyboxFindInStore","_data$product","_data$productPrice","_data$cart","_data$deliveryOptions","_data$productAvailabl","_data$featureState","_data$channelDelivery","_product$Dimensions","_props$data$productPr","slots","findInStoreHeaderText","descriptionTextToShowAllPickupOptions","channelDeliveryOptionConfig","_dimension$DimensionV","isSectionDisabled","buttonText","description","isStockCheck","buyboxResources","pickupInventory","findInStoreLinkText","findInStoreDescriptionText","isAggregatedInventory","_pickupInventory","IsProductAvailable","findInStoreNotAvailableTextButton","findInStoreNotAvailableDescription","getFindInStoreInventorySettings","matchDeliveryOptions","productdeliveryOptions","storePickUpOptionList","deliveryOption","delivery","deliveryCode","PickupDeliveryModeCodes","option","openFindInStoreDialog","productPickupOptionList","modal","Buybox","dimensionUpdateQueue","FinitePromiseQueue","buyboxCallbacks","newErrorState","updateSelectedProduct","newSelectedProduct","newInventory","newPrice","newDeliveryOptions","productDeliveryOptions","_updatePrice","selectedDimensionId","selectedDimensionValueId","enqueue","_updateDimensions","FinitePromiseQueueError","ProcessWasDiscardedFromTheQueue","_getDropdownName","forceUpdate","changeCollapseOpen","isCollapseOpen","updateDeliverySpecs","updateDeliverySpecsInCart","_onBulkPurchaseLinkClick","bulkPurchaseModule","boundingRect","getBoundingClientRect","scrollTo","left","top","dimensionsToUpdate","clearErrorState","previousState","_getProductVariant","productVariant","productVariantPromise","promises","_getDimensionsForSelectedVariant","mappedDimensions","_hydrateInventoryInfo","_hydratePrice","_hydrateDeliveryOptions","_updateQuantitiesInState","all","_this$props$data$prod","productDimensionTypeColor","productDimensionTypeConfiguration","productDimensionTypeSize","productDimensionTypeAmount","productDimensionTypeStyle","openOverlay","user","isAuthenticated","ItemTypeValue","ReleasedProductType","Service","parameters","search","cartlineId","URLSearchParams","get","cartLineItem","cartline","_this$props$data$prod2","mediaGallery","orderSummary","moreAboutProduct","flatten","validValues","some","orderSummaryClassName","GetOrderSummaryStateValuesInput","modelOpenValue","viewProps","ModuleProps","moduleProps","ProductInfoContainerProps","MediaGalleryContainerProps","orderSummaryContainerProps","moreProductDetailsContainerProps","bulkPurchaseLink","_renderBuyboxBulkPurchaseLink","configure","findInStore","addToCart","addToOrderTemplate","addToWishlist","rating","hideRating","inventoryLabel","shopSimilarLook","enableShopSimilarLooks","keyInPrice","enableKeyInPrice","quantityLimitsMessages","eshopOrderSummary","moreProductDetails","isZH","renderView","Overlay","open","closeOnClick","stopPropagation","style","display","flexDirection","justifyContent","alignItems","width","signInUrl","isBulkPurchaseEnabled","isBrowser","bulkPurchaseModules","Array","from","getElementsByClassName","BulkPurchase","bulkPurchaseLinkText","arguments","CustomerContextualPrice","_dimension$dimensionV","_dimensions$find$Dime","_dimensions$find","ExtensionProperties","setDimensionValuesToQuery","selectedProductPromise","getSelectedVariant","SelectedVariantInput","MasterProductId","getDimensionsForSelectedVariant","GetDimensionsForSelectedVariantInput","_productVariant$Dimen","newAvailableQuantity","getProductAvailabilitiesForSelectedVariant","ProductAvailabilitiesForSelectedVariantInput","newShippingQuantity","getPriceForSelectedVariant","PriceForSelectedVariantInput","_this$props$data$feat","retailMultiplePickupFeatureState","getDeliveryOptionsForSelectedVariant","GetDeliveryOptionsForSelectedVariantInput","_product$Behavior","_product$Behavior2","_product$Behavior3","_product$Behavior4","Behavior","MinimumQuantity","MaximumQuantity","_featureStatuses$find","featureStatuses","information","updatedCartVersion","DeliveryPreferenceType","devliveryAddress","FullAddress","Street","StreetNumber","City","State","ZipCode","ThreeLetterISORegionName","TwoLetterISORegionName","Deactivate","IsPrimary","today","Date","deliveryEmailAddress","deliverySpecifications","DeliveryModeId","DeliveryPreferenceTypeValue","ShipToAddress","ElectronicDeliveryEmailAddress","PickUpStoreId","DeliveryAddress","RequestedDeliveryDate","updateDeliverySpecificationAsync","updatedCart","Error","console","log","_handleCloseButtonClick","_renderAddToCart","_renderAddToOrderTemplate","_renderAddToWishlist","_renderConfigure","_renderConfigureDropdown","_renderSocialShare","socialShare","_renderFindInStore","_renderQuantity","_renderKeyInPrice","_renderShopSimilarItem","shopSimilarItem","shopSimilarDescription","unitOfMeasure","Module","binding","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}