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/BrB,EAAG7L,EAAMkN,8BAAsB,IAAArB,EAAAA,EAAI,QAE/D,OACI/C,EAAAA,cAAA,QAAM/J,UAAWsL,GAAAA,CAAW,YAAarK,EAAMjB,UAAW,uBAAuBmO,MA/QvDlN,CAAAA,IAC9B,MAAMuF,EAAQvF,EAAMuI,KAAKhD,MACnB4H,EAA6B5H,EAAM6B,2BAEzC,IAAK+F,GAA+E,IAAjD/G,EAAiBb,EAAMQ,eAAejH,OACrE,OAAO,EAGX,GAAIqO,EACA,OAAOA,EAA6B,EAGxC,MAAM3H,EAAgBF,EAAiBC,GAEvC,GAAIC,GAAiBD,EAAM8B,wBAGvB,OAF2B+F,WAAW5H,EAAc6H,QAAQ,IACvBD,WAAW7H,EAAM8B,wBAAwBgG,QAAQ,IAI1F,OAAO,GA4PEC,CAAyBtN,GAhNOA,CAAAA,IACzC,MAAMwF,EAAwBF,EAAiBtF,EAAMuI,KAAKhD,OACpDgI,EAAuB/F,EAAexH,EAAOwF,GAAe,GAC5DgI,EAAqBrG,EAAsBnH,EAAMuI,KAAKhD,OAE5D,OACIuD,EAAAA,cAAAA,EAAAA,SAAA,KACIA,EAAAA,cAAA,QAAM/J,UAAU,WACX,IACAiB,EAAMyN,kBACN,IACAF,EACA,IACAvN,EAAM0N,iBACN,IACAhF,EAAmB1I,IAExB8I,EAAAA,cAAA,sBAAkB,QACbJ,EAAmB1I,IAClBA,EAAM2N,iBACJ7E,EAAAA,cAAA,QAAM/J,UAAU,2BAA0B,cAAa,QAClDwO,IAIZC,EAAqB,GAAK1E,EAAAA,cAAA,QAAM/J,UAAU,kCAAgC,IAAGyO,EAAkB,KAC/FxN,EAAM4N,aAAe9E,EAAAA,cAAA,QAAM/J,UAAU,sBAAsBiB,EAAM4N,eAsL/BC,CAAoC7N,GAAS0I,EAAmB1I,MApYjF,KAmZ9B","sources":["webpack://Msdyn365.Commerce.Online/./src/actions/entities/validate-alcohol-license.ts?763b","webpack://Msdyn365.Commerce.Online/./src/actions/validate-alcohol-license.action.ts?c46b","webpack://Msdyn365.Commerce.Online/./src/components/toast/toast.ts?c1fc","webpack://Msdyn365.Commerce.Online/./src/shared-utils/common-utils.ts?8190","webpack://Msdyn365.Commerce.Online/./src/themes/vinhuset-adventureworks/views/components/price.component.tsx?7056"],"sourcesContent":["import * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\n\r\n/**\r\n * AlcoholLicenseValidationDetails entity interface.\r\n */\r\nexport interface IAlcoholLicenseValidationDetails {\r\n Message?: string;\r\n LicenseNeeded?: number;\r\n ProductId?: number;\r\n}\r\n\r\n/**\r\n * AlcoholValidationCriteria entity interface.\r\n */\r\nexport interface IAlcoholValidationCriteria {\r\n ProductIds: number[];\r\n CatalogId: number;\r\n}\r\n\r\n/**\r\n * ValidateAlcoholLicenseResult entity interface.\r\n */\r\nexport interface IValidateAlcoholLicenseResult {\r\n ValidationResult?: boolean;\r\n CustomerLicense?: number;\r\n Details?: IAlcoholLicenseValidationDetails[];\r\n}\r\n\r\n/**\r\n * AlcoholValidationCriteria entity class.\r\n */\r\nexport class AlcoholValidationCriteriaExtensionClass implements IAlcoholValidationCriteria {\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ProductIds: number[];\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public CatalogId: number;\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.CatalogId = odataObject.CatalogId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ProductIds = undefined;\r\n if (odataObject.ProductIds) {\r\n this.ProductIds = [];\r\n for (var i = 0; i < odataObject.ProductIds.length; i++) {\r\n if (odataObject.ProductIds[i]) {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ProductIds[i] =\r\n parseInt(odataObject.ProductIds[i], 10);\r\n\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ProductIds[i] = undefined;\r\n }\r\n }\r\n }\r\n\r\n }\r\n}\r\n\r\n/**\r\n * AlcoholLicenseValidationDetails entity class.\r\n */\r\nexport class AlcoholLicenseValidationDetailsExtensionClass implements IAlcoholLicenseValidationDetails {\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Message: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public LicenseNeeded: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ProductId: number;\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Message = odataObject.Message;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.LicenseNeeded = odataObject.LicenseNeeded;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ProductId = (odataObject.ProductId) ? parseInt(odataObject.ProductId, 10) : 0;\r\n }\r\n}\r\n\r\n/**\r\n * ValidateAlcoholLicenseResult entity class.\r\n */\r\nexport class ValidateAlcoholLicenseResultExtensionClass implements IValidateAlcoholLicenseResult {\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ValidationResult: boolean;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public CustomerLicense: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Details: IAlcoholLicenseValidationDetails[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ValidationResult = odataObject.ValidationResult;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.CustomerLicense = odataObject.CustomerLicense;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Details = undefined;\r\n if (odataObject.Details) {\r\n this.Details = [];\r\n for (var i = 0; i < odataObject.Details.length; i++) {\r\n if (odataObject.Details[i]) {\r\n if (odataObject.Details[i]['@odata.type']) {\r\n var className: string = odataObject.Details[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat(\"Class\");\r\n if (EntityClasses[className]) {\r\n this.Details[i] = new EntityClasses[className](odataObject.Details[i]);\r\n }\r\n } else {\r\n this.Details[i] = new AlcoholLicenseValidationDetailsExtensionClass(odataObject.Details[i]);\r\n }\r\n\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Details[i] = undefined;\r\n }\r\n }\r\n }\r\n\r\n }\r\n}","import { IActionContext } from '@msdyn365-commerce/core';\r\nimport { DataServiceQuery, IDataServiceRequest, callActionOrExecute } from \"@msdyn365-commerce/retail-proxy\";\r\nimport { ValidateAlcoholLicenseResultExtensionClass, IValidateAlcoholLicenseResult, IAlcoholValidationCriteria } from './entities/validate-alcohol-license';\r\n\r\nfunction validateAlcoholLicenseQuery(): DataServiceQuery {\r\n return new DataServiceQuery();\r\n}\r\n\r\nexport function validateAlcoholLicenseInput(validationCriteria: IAlcoholValidationCriteria): IDataServiceRequest {\r\n const query = validateAlcoholLicenseQuery();\r\n return query.createDataServiceRequestForOperation(\r\n 'ValidateAlcoholLicense',\r\n true,\r\n ValidateAlcoholLicenseResultExtensionClass,\r\n 'false',\r\n { bypassCache: 'get', returnEntity: 'IValidateAlcoholLicenseResult' },\r\n {\r\n validationCriteria: validationCriteria\r\n }\r\n );\r\n}\r\n\r\nexport async function validateAlcoholLicenseAsync(ctx: IActionContext, validationCriteria: IAlcoholValidationCriteria): Promise {\r\n const request = validateAlcoholLicenseInput(validationCriteria);\r\n const result = await callActionOrExecute(request, ctx);\r\n return result;\r\n}\r\n","export interface IToastViewProps {\r\n header?: string;\r\n text: string;\r\n footer?: string;\r\n autoClose: number;\r\n position: string;\r\n onClose?(): void;\r\n canClose: boolean;\r\n showProgress: boolean;\r\n type?: 'success' | 'error' | 'warning' | 'info';\r\n link?: string;\r\n linkLabel?: string;\r\n}\r\n\r\nexport const toast = (props: IToastViewProps) => {\r\n new Toast(props);\r\n};\r\n\r\nexport const toasts = {\r\n success: (header: string | undefined, text: string, props: Partial = {}) => {\r\n toast({\r\n ...{\r\n autoClose: 3000,\r\n canClose: true,\r\n position: 'bottom-right',\r\n type: 'success',\r\n showProgress: true\r\n },\r\n ...props as IToastViewProps,\r\n header,\r\n text,\r\n type: 'success'\r\n });\r\n },\r\n error: (header: string | undefined, text: string, props: Partial = {}) => {\r\n toast({\r\n ...{\r\n autoClose: 30000,\r\n canClose: true,\r\n position: 'bottom-right',\r\n showProgress: true\r\n },\r\n ...props as IToastViewProps,\r\n header,\r\n text,\r\n type: 'error'\r\n });\r\n }\r\n};\r\n\r\nclass Toast {\r\n\r\n private readonly _props: IToastViewProps;\r\n private _toastElem: HTMLElement;\r\n private _headElem: HTMLElement | undefined;\r\n private _textElem: HTMLElement;\r\n private _footElem: HTMLElement | undefined;\r\n // @ts-ignore\r\n private _removeBinded(): void;\r\n // @ts-ignore\r\n private _unpause(): void;\r\n // @ts-ignore\r\n private _pause(): void;\r\n // @ts-ignore\r\n private _visibilityChange(): void;\r\n private _isPaused: boolean = false;\r\n private _shouldUnPause: boolean = true;\r\n private _timeVisible: number = 0;\r\n private _autoCloseInterval: number = 0;\r\n private _progressInterval: number = 0;\r\n\r\n constructor(input: IToastViewProps) {\r\n this._props = input;\r\n\r\n this._toastElem = document.createElement(\"div\");\r\n this._textElem = document.createElement(\"span\");\r\n\r\n if (this._props.header) {\r\n this._headElem = document.createElement(\"h4\");\r\n this._headElem.textContent = this._props.header;\r\n this._toastElem.appendChild(this._headElem);\r\n } else {\r\n this._textElem.classList.add(\"no-header\");\r\n }\r\n\r\n this._toastElem.appendChild(this._textElem);\r\n\r\n if (this._props.link) {\r\n // Cart button\r\n const cartButton = document.createElement(\"a\");\r\n cartButton.classList.add(\"toast-button\");\r\n cartButton.setAttribute('aria-label', this._props.linkLabel || this._props.link);\r\n cartButton.textContent = this._props.linkLabel || this._props.link;\r\n cartButton.href = this._props.link;\r\n this._toastElem.appendChild(cartButton);\r\n }\r\n\r\n if (this._props.footer) {\r\n this._footElem = document.createElement(\"div\");\r\n this._footElem.classList.add(\"footer\");\r\n this._footElem.textContent = this._props.footer;\r\n this._toastElem.appendChild(this._footElem);\r\n }\r\n\r\n this._toastElem.classList.add(\"toast\");\r\n this._toastElem.classList.add(this._props.type || 'info');\r\n requestAnimationFrame(() => {\r\n this._toastElem.classList.add(\"show\");\r\n });\r\n this._removeBinded = this._remove.bind(this);\r\n this._unpause = () => (this._isPaused = false);\r\n this._pause = () => (this._isPaused = true);\r\n this._visibilityChange = () => {\r\n this._shouldUnPause = document.visibilityState === \"visible\";\r\n };\r\n this._setup();\r\n }\r\n\r\n private readonly _autoClose = () => {\r\n if (this._props.autoClose === 0) {\r\n return;\r\n }\r\n this._timeVisible = 0;\r\n let lastTime: number | null = null;\r\n const func = (time: number) => {\r\n if (this._shouldUnPause) {\r\n lastTime = null;\r\n this._shouldUnPause = false;\r\n }\r\n if (lastTime === null) {\r\n lastTime = time;\r\n this._autoCloseInterval = requestAnimationFrame(func);\r\n return;\r\n }\r\n if (!this._isPaused) {\r\n this._timeVisible += time - lastTime;\r\n if (this._timeVisible >= this._props.autoClose) {\r\n this._remove();\r\n return;\r\n }\r\n }\r\n lastTime = time;\r\n this._autoCloseInterval = requestAnimationFrame(func);\r\n };\r\n this._autoCloseInterval = requestAnimationFrame(func);\r\n };\r\n\r\n private readonly _position = () => {\r\n const currentContainer = this._toastElem.parentElement;\r\n const selector = `.toast-container[data-position=\"${this._props.position}\"]`;\r\n const container = document.querySelector(selector) || this._createContainer(this._props.position);\r\n container.append(this._toastElem);\r\n if (currentContainer === null || currentContainer.hasChildNodes()) {\r\n return;\r\n }\r\n currentContainer.remove();\r\n };\r\n\r\n private readonly _text = () => {\r\n this._textElem.textContent = this._props.text;\r\n };\r\n\r\n private readonly _canClose = () => {\r\n this._toastElem.classList.toggle(\"can-close\", this._props.canClose);\r\n /* if (this._props.canClose) {\r\n this._toastElem.addEventListener(\"click\", this._removeBinded);\r\n } else {\r\n this._toastElem.removeEventListener(\"click\", this._removeBinded);\r\n } */\r\n\r\n if (this._props.canClose) {\r\n const closeButton = document.createElement(\"button\");\r\n closeButton.classList.add(\"close-button\");\r\n closeButton.addEventListener(\"click\", this._removeBinded);\r\n\r\n const closeIcon = document.createElement(\"i\");\r\n closeIcon.classList.add(\"fa-solid\", \"fa-xmark\");\r\n closeButton.appendChild(closeIcon);\r\n\r\n this._toastElem.appendChild(closeButton);\r\n }\r\n };\r\n\r\n private readonly _showProgress = () => {\r\n this._toastElem.classList.toggle(\"progress\", this._props.showProgress);\r\n // @ts-ignore\r\n this._toastElem.style.setProperty(\"--progress\", 1);\r\n\r\n if (this._props.showProgress) {\r\n const func = () => {\r\n if (!this._isPaused) {\r\n this._toastElem.style.setProperty(\r\n \"--progress\",\r\n // @ts-ignore\r\n 1 - this._timeVisible / this._props.autoClose\r\n );\r\n }\r\n this._progressInterval = requestAnimationFrame(func);\r\n };\r\n this._progressInterval = requestAnimationFrame(func);\r\n }\r\n };\r\n\r\n private readonly _pauseOnHover = () => {\r\n this._toastElem.addEventListener(\"mouseenter\", this._pause);\r\n this._toastElem.addEventListener(\"mouseleave\", this._unpause);\r\n };\r\n\r\n private readonly _setup = () => {\r\n this._autoClose();\r\n this._position();\r\n this._text();\r\n this._canClose();\r\n this._showProgress();\r\n this._pauseOnHover();\r\n };\r\n\r\n private readonly _remove = () => {\r\n cancelAnimationFrame(this._autoCloseInterval);\r\n cancelAnimationFrame(this._progressInterval);\r\n const container = this._toastElem.parentElement;\r\n this._toastElem.classList.remove(\"show\");\r\n this._toastElem.addEventListener(\"transitionend\", () => {\r\n this._toastElem.remove();\r\n if (container?.hasChildNodes()) {\r\n return;\r\n }\r\n container?.remove();\r\n });\r\n this._props.onClose?.();\r\n };\r\n\r\n private readonly _createContainer = (position: string): Element => {\r\n const container = document.createElement(\"div\");\r\n container.classList.add(\"toast-container\");\r\n container.dataset.position = position;\r\n document.body.append(container);\r\n return container;\r\n };\r\n}","import { SimpleProduct } from \"@msdyn365-commerce/retail-proxy\";\r\n\r\n/**\r\n * Gets the default quantity to use when buying a product.\r\n * @param product The product to get the default quantity for.\r\n * @param breakoff Whether breakoff is enabled.\r\n * @param defaultQuantity The default quantity to use if no other quantity is found. Defaults to 1.\r\n * @returns The default quantity to use for the product.\r\n */\r\nexport function getDefaultBuyQuantity(product: SimpleProduct, breakoff: boolean, defaultQuantity: number = 1): number {\r\n if (breakoff) {\r\n return product.Behavior?.MultipleOfQuantity || defaultQuantity;\r\n }\r\n\r\n return product.Behavior?.DefaultQuantity || defaultQuantity;\r\n}","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport { DiscountLine, PriceLine, ProductPrice, ProductType, SalesAgreementPriceLine, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { Button, Collapse, format, ICollapseProps } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\nimport { ProductPriceExt } from '../../../../shared-utils/types';\r\n\r\nconst defaultPrice: number = 0;\r\nconst freePrice: number = 0;\r\n\r\n/**\r\n * Interface for price component resources.\r\n * @param {string} priceRangeSeparator - The price range separator.\r\n */\r\nexport interface IPriceComponentResources {\r\n priceRangeSeparator?: string;\r\n salesAgreementPricePrompt?: string;\r\n salesAgreementExpirationDatePrompt?: string;\r\n salesAgreementCommittedQuantityPrompt?: string;\r\n salesAgreementRemainingQuantityPrompt?: string;\r\n}\r\n\r\n/**\r\n * Interface for price component props.\r\n * @param {boolean} isPriceMinMaxEnabled - Whether the price range feature is enabled or not.\r\n * @param {IPriceComponentResources} priceResources - The price range resources.\r\n */\r\nexport interface IPriceComponentProps extends IComponentProps<{ price: ProductPrice }> {\r\n className?: string;\r\n product?: SimpleProduct;\r\n savingsText?: string;\r\n freePriceText?: string;\r\n originalPriceText?: string;\r\n currentPriceText?: string;\r\n isPriceMinMaxEnabled?: boolean;\r\n isSalesAgreementPriceFeatureEnabled?: boolean;\r\n useLegacySalesAgreementHTMLFeature?: boolean;\r\n salesAgreementLineId?: number;\r\n priceResources?: IPriceComponentResources;\r\n salesAgreementDetailCollapseProps?: ICollapseProps;\r\n currencyCode?: string;\r\n salesAgreementDetailOnClick?(event: React.MouseEvent | React.KeyboardEvent): void;\r\n discountPercentageSide?: 'left' | 'right';\r\n hideBeforePrice?: boolean;\r\n}\r\n\r\n/**\r\n * The interface of price component.\r\n */\r\nexport interface IPriceComponent extends IComponent {}\r\n\r\nconst priceComponentActions = {};\r\n\r\n/**\r\n * Get the original price from price component props.\r\n * @param props - The IPriceComponentProps.\r\n * @returns The original price.\r\n */\r\nexport const getOriginalPrice = (price: ProductPrice): number => {\r\n let originalPrice = Math.max(\r\n price.TradeAgreementPrice || defaultPrice,\r\n price.AdjustedPrice || defaultPrice\r\n ) || price.BasePrice || defaultPrice;\r\n\r\n // Go through each discount line and apply discounts without \"Show\" in it\r\n getBaseDiscountLines(price.DiscountLines).forEach(discount => {\r\n originalPrice -= discount.EffectiveAmount ?? 0;\r\n });\r\n\r\n return originalPrice;\r\n};\r\n\r\nexport const getDiscountLines = (discountLines: DiscountLine[] | undefined) => {\r\n if (!discountLines || discountLines.length === 0) {\r\n return [];\r\n }\r\n\r\n // Go through each discount line and find lines with Show in it\r\n const discounts = discountLines.filter(x => {\r\n const matches = x.OfferName?.toLowerCase().match(/\\{(.*?)\\}/i) || '';\r\n const parts = matches.length > 1 ? matches[1].split(';').map(x => x.trim()) : undefined;\r\n return parts && parts.includes('show');\r\n });\r\n\r\n return discounts;\r\n};\r\n\r\nexport const getBaseDiscountLines = (discountLines: DiscountLine[] | undefined) => {\r\n if (!discountLines || discountLines.length === 0) {\r\n return [];\r\n }\r\n\r\n // Go through each discount line and apply discounts without \"Show\" in it\r\n const baseDiscounts = discountLines.filter(x => {\r\n const matches = x.OfferName?.toLowerCase().match(/\\{(.*?)\\}/i) || '';\r\n const parts = matches.length > 1 ? matches[1].split(';').map(x => x.trim()) : undefined;\r\n return !parts || parts.length === 0 || !parts.includes('show');\r\n });\r\n\r\n return baseDiscounts;\r\n};\r\n\r\nexport const getDiscountPercentage = (price: ProductPriceExt): number => {\r\n if (price.OverrideDiscountPercentage) {\r\n return price.OverrideDiscountPercentage;\r\n }\r\n\r\n if (!price.CustomerContextualPrice) {\r\n return 0;\r\n }\r\n\r\n const originalPrice = getOriginalPrice(price);\r\n const percentage = 1 - (price.CustomerContextualPrice / originalPrice);\r\n\r\n return Math.floor(percentage * 100);\r\n};\r\n\r\nconst getActivePrice = (props: IPriceComponentProps): number => {\r\n if (showPriceRangeForMasterProduct(props) && props.data.price.MinVariantPrice !== undefined) {\r\n return props.data.price.MinVariantPrice;\r\n }\r\n\r\n if (props.data.price.CustomerContextualPrice !== undefined) {\r\n return props.data.price.CustomerContextualPrice;\r\n }\r\n\r\n return getOriginalPrice(props.data.price);\r\n};\r\n\r\n/**\r\n * Get the formatted currency.\r\n * @param props - The props.\r\n * @param price - The price.\r\n * @param shouldUseFreePriceText - The shouldUseFreePriceText.\r\n * @returns The formatted currency.\r\n */\r\nconst formatCurrency = (\r\n props: IPriceComponentProps,\r\n price: number | undefined,\r\n shouldUseFreePriceText: boolean | undefined,\r\n currencyCode?: string | undefined\r\n): string => {\r\n if (price === undefined) {\r\n return '';\r\n }\r\n\r\n if (shouldUseFreePriceText && price === freePrice && props.freePriceText) {\r\n return props.freePriceText;\r\n }\r\n\r\n return props.context.cultureFormatter.formatCurrency(price, currencyCode);\r\n};\r\n\r\nconst showPriceRangeForMasterProduct = (props: IPriceComponentProps): boolean => {\r\n return (\r\n (props.isPriceMinMaxEnabled ?? false) &&\r\n (props.product?.ProductTypeValue === ProductType.Master || props.product?.ProductTypeValue === ProductType.KitMaster) &&\r\n props.data.price.MinVariantPrice !== undefined &&\r\n props.data.price.MaxVariantPrice !== undefined\r\n );\r\n};\r\n\r\n/**\r\n * ShowStrikethroughPricing.\r\n * @param props - The props.\r\n * @returns True if showStrikethroughPricing, false otherwise.\r\n */\r\nconst showStrikethroughPricing = (props: IPriceComponentProps): boolean => {\r\n const price = props.data.price as ProductPriceExt;\r\n const overrideDiscountPercentage = price.OverrideDiscountPercentage;\r\n\r\n if (!overrideDiscountPercentage && getDiscountLines(price.DiscountLines).length === 0) {\r\n return false;\r\n }\r\n\r\n if (overrideDiscountPercentage) {\r\n return overrideDiscountPercentage > 0;\r\n }\r\n\r\n const originalPrice = getOriginalPrice(price);\r\n\r\n if (originalPrice && price.CustomerContextualPrice) {\r\n const originalPriceFixed = parseFloat(originalPrice.toFixed(2));\r\n const customerContextualPriceFixed = parseFloat(price.CustomerContextualPrice.toFixed(2));\r\n return originalPriceFixed > customerContextualPriceFixed;\r\n }\r\n\r\n return false;\r\n};\r\n\r\n/**\r\n * Render current price.\r\n * @param props - The props.\r\n * @returns The JSX.Element.\r\n */\r\nconst renderCurrentPrice = (props: IPriceComponentProps): JSX.Element => {\r\n const maxVariantPrice: string = formatCurrency(props, props.data.price.MaxVariantPrice, false, props.currencyCode);\r\n const minVariantPrice: string = formatCurrency(props, props.data.price.MinVariantPrice, false, props.currencyCode);\r\n if (\r\n props.isPriceMinMaxEnabled &&\r\n props.data.price.MaxVariantPrice &&\r\n props.data.price.MinVariantPrice &&\r\n props.data.price.MaxVariantPrice > props.data.price.MinVariantPrice\r\n ) {\r\n return (\r\n \r\n \r\n {minVariantPrice}\r\n \r\n \r\n {props.priceResources?.priceRangeSeparator}\r\n \r\n \r\n {maxVariantPrice}\r\n \r\n \r\n );\r\n }\r\n\r\n return (\r\n \r\n {formatCurrency(props, getActivePrice(props), true, props.currencyCode)}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Render current price with original price.\r\n * @param props - The props.\r\n * @returns The JSX.Element.\r\n */\r\nconst renderCurrentPriceWithOriginalPrice = (props: IPriceComponentProps): JSX.Element => {\r\n const originalPrice: number = getOriginalPrice(props.data.price);\r\n const initialPrice: string = formatCurrency(props, originalPrice, true);\r\n const discountPercentage = getDiscountPercentage(props.data.price);\r\n\r\n return (\r\n <>\r\n \r\n {` `}\r\n {props.originalPriceText}\r\n {` `}\r\n {initialPrice}\r\n {` `}\r\n {props.currentPriceText}\r\n {` `}\r\n {renderCurrentPrice(props)}\r\n \r\n \r\n {discountPercentage > 0 && -{discountPercentage}%}\r\n {props.savingsText && {props.savingsText}}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * The state of sales agreement details.\r\n * @deprecated This will be removed with SalesAgreementPrice class soon.\r\n */\r\nexport interface ISalesAgreementDetailState {\r\n isOpen: boolean;\r\n}\r\n\r\n/**\r\n * The SalesAgreementPrice class.\r\n * @deprecated This implementation is deprecated. It will be removed soon. Please use the implementation in the Price function component.\r\n */\r\n// eslint-disable-next-line react/require-optimization -- Not needed.\r\nclass SalesAgreementPrice extends React.Component {\r\n public constructor(props: IPriceComponentProps) {\r\n super(props);\r\n this._toggle = this._toggle.bind(this);\r\n this.state = {\r\n isOpen: true\r\n } as ISalesAgreementDetailState;\r\n }\r\n\r\n public render(): React.ReactElement {\r\n const priceLines: PriceLine[] = this.props.data.price.AttainablePriceLines ?? [];\r\n const firstPriceLine: SalesAgreementPriceLine = priceLines[0] as SalesAgreementPriceLine;\r\n if (this.props.salesAgreementDetailCollapseProps) {\r\n this.props.salesAgreementDetailCollapseProps.isOpen = this.state.isOpen;\r\n }\r\n return (\r\n \r\n

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

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

\r\n \r\n

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

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

\r\n

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

\r\n

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

\r\n

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

\r\n

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

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

\r\n \r\n {props.priceResources?.salesAgreementPricePrompt}\r\n \r\n {isExpanded && renderSalesAgreementDetail(props)}\r\n
\r\n
\r\n );\r\n }\r\n }\r\n\r\n const discountPercentageSide = props.discountPercentageSide ?? 'right';\r\n\r\n return (\r\n \r\n {showStrikethroughPricing(props) ? renderCurrentPriceWithOriginalPrice(props) : renderCurrentPrice(props)}\r\n {/* {renderCurrentPrice(props)} */}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * The PriceComponent.\r\n */\r\nexport const PriceComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride('Price', {\r\n component: Price,\r\n ...priceComponentActions\r\n});\r\n\r\n\r\nexport default PriceComponent;"],"names":["AlcoholLicenseValidationDetailsExtensionClass","constructor","odataObject","this","Message","LicenseNeeded","ProductId","parseInt","ValidateAlcoholLicenseResultExtensionClass","ValidationResult","CustomerLicense","Details","undefined","i","length","className","substr","lastIndexOf","concat","EntityClasses","validateAlcoholLicenseInput","validationCriteria","DataServiceQuery","createDataServiceRequestForOperation","bypassCache","returnEntity","async","validateAlcoholLicenseAsync","ctx","request","callActionOrExecute","toast","props","Toast","toasts","success","header","text","arguments","_objectSpread","autoClose","canClose","position","type","showProgress","error","input","_isPaused","_shouldUnPause","_timeVisible","_autoCloseInterval","_progressInterval","_autoClose","_props","lastTime","func","time","requestAnimationFrame","_remove","_position","currentContainer","_toastElem","parentElement","selector","document","querySelector","_createContainer","append","hasChildNodes","remove","_text","_textElem","textContent","_canClose","classList","toggle","closeButton","createElement","add","addEventListener","_removeBinded","closeIcon","appendChild","_showProgress","style","setProperty","_pauseOnHover","_pause","_unpause","_setup","_this$_props$onClose","_this$_props","cancelAnimationFrame","container","onClose","call","dataset","body","_headElem","link","cartButton","setAttribute","linkLabel","href","footer","_footElem","bind","_visibilityChange","visibilityState","getDefaultBuyQuantity","product","breakoff","_product$Behavior2","defaultQuantity","_product$Behavior","Behavior","MultipleOfQuantity","DefaultQuantity","getOriginalPrice","price","originalPrice","Math","max","TradeAgreementPrice","AdjustedPrice","BasePrice","getBaseDiscountLines","DiscountLines","forEach","discount","_discount$EffectiveAm","EffectiveAmount","getDiscountLines","discountLines","filter","x","_x$OfferName","matches","OfferName","toLowerCase","match","parts","split","map","trim","includes","_x$OfferName2","getDiscountPercentage","OverrideDiscountPercentage","CustomerContextualPrice","percentage","floor","formatCurrency","shouldUseFreePriceText","currencyCode","freePriceText","context","cultureFormatter","showPriceRangeForMasterProduct","_props$isPriceMinMaxE","_props$product","_props$product2","isPriceMinMaxEnabled","ProductTypeValue","ProductType","Master","KitMaster","data","MinVariantPrice","MaxVariantPrice","renderCurrentPrice","maxVariantPrice","minVariantPrice","_props$priceResources","React","itemProp","priceResources","priceRangeSeparator","getActivePrice","SalesAgreementPrice","super","_toggle","state","isOpen","render","_this$props$data$pric","_this$props$data$pric2","_this$props$priceReso","_this$props$priceReso2","_this$props$priceReso3","_this$props$priceReso4","_this$props$priceReso5","_this$props$priceReso6","_this$props$priceReso7","firstPriceLine","AttainablePriceLines","salesAgreementDetailCollapseProps","classnames","onClick","salesAgreementPricePrompt","Collapse","Object","assign","format","salesAgreementExpirationDatePrompt","formatDate","EffectiveDate","ExpirationDate","salesAgreementCommittedQuantityPrompt","CommittedQuantity","salesAgreementRemainingQuantityPrompt","RemainingQuantity","event","preventDefault","console","log","setState","PriceComponent","msdyn365Commerce","createComponentOverride","component","_props$discountPercen","user","isAuthenticated","isSalesAgreementPriceFeatureEnabled","useLegacySalesAgreementHTMLFeature","salesAgreementPrice","_props$data$price$Sal","_props$priceResources8","_props$priceResources9","isExpanded","setIsExpanded","Button","tabIndex","_props$data$price$Att","_props$priceResources2","_props$priceResources3","_props$priceResources4","_props$priceResources5","_props$priceResources6","_props$priceResources7","renderSalesAgreementDetail","discountPercentageSide","overrideDiscountPercentage","parseFloat","toFixed","showStrikethroughPricing","initialPrice","discountPercentage","originalPriceText","currentPriceText","hideBeforePrice","savingsText","renderCurrentPriceWithOriginalPrice"],"sourceRoot":""}