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H,UAAW,OACXC,aAAc,UAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,YAId,KAAAG,YAA2B,CAC/B,CACIJ,UAAW,OACXC,aAAc,UAElB,CACID,UAAW,OACXC,aAAc,UAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,YAIfI,6BACH,OAAO7N,QAAQC,QAAQ,IAEpBgN,qBAAqBrV,GAExB,OADAsV,QAAQC,IAAI,yEAAyEvV,MAC9E,EAGJkW,iBACH,OAAO9N,QAAQC,QAAQ,CACnB8N,KAAM,sBACNC,YAAa,CACT,CACI/T,GAAI,SACJgU,aAAc,eACdC,YAAa,yCACbvM,KAAM,WACNwM,OAAQC,EAAAA,GAAMC,QACdC,KAAM,yCACNC,WAAY,CACR,CACItU,GAAI,OACJgU,aAAc,YACdE,OAAQC,EAAAA,GAAMI,OACdC,OAAQ,OAEZ,CACIxU,GAAI,OACJgU,aAA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,KAAArxB,mBAAqB,IAAM,gBAE3B,KAAAG,cAAgB,IAAiB,UApBpCD,KAAKqT,UAAYA,EACjBrT,KAAK6wB,SAAWA,EAChB7wB,KAAK8wB,iBAAmBA,EAIxB9wB,KAAK+wB,SAAWA,EAAW,GAAK,GAAKA,EACrC/wB,KAAKkxB,QAAUA,EACflxB,KAAKoxB,YAAcA,EACnBpxB,KAAKmxB,UAAYA,EACjBnxB,KAAKqxB,UAAYA,EACjBrxB,KAAKqyB,YAAcA,EACnBryB,KAAKixB,gBAAkBA,qCC1FxB,MAAMiB,EAqBTvyB,YAAY0T,EAAmBwd,EAAkBe,EAAuBX,GAOjE,KAAAlxB,YAAc,IAAM,gBAEpB,KAAAD,mBAAqB,IAAM,gBAE3B,KAAAG,cAAgB,IAAiB,OAVpCD,KAAKqT,UAAYA,EACjBrT,KAAK6wB,SAAWA,EAChB7wB,KAAK4xB,cAAgBA,EACrB5xB,KAAKixB,gBAAkBA,yICvBxB,SAASqB,EAA+BpzB,GAC3C,OAAO,IAAIC,EAAAA,aAAmC,sBAAuBD,EAAQ,4BAGjF,MAIaE,GAA6BC,EAAAA,EAAAA,IAA2B,CACjEC,OAAuCC,EAAAA,iBACvCC,MAN2C+yB,IACpCD,EAA+B,CAAEE,UAAW,gBAQvD","sources":["webpack://Msdyn365.Commerce.Online/./src/data-actions/accordion-state-data-action.ts?eaf1","webpack://Msdyn365.Commerce.Online/./src/modules/actions/get-active-image-products.ts?0501","webpack://Msdyn365.Commerce.Online/./src/actions/get-address-purposes.ts?6b90","webpack://Msdyn365.Commerce.Online/./src/actions/get-country-regions.ts?9431","webpack://Msdyn365.Commerce.Online/./src/actions/get-country-state.ts?3ecd","webpack://Msdyn365.Commerce.Online/./src/actions/get-state-provinces.ts?554d","webpack://Msdyn365.Commerce.Online/./src/store-selector-state-manager/base-store-selector-state-manager.ts?281e","webpack://Msdyn365.Commerce.Online/./src/store-selector-state-manager/map-store-selector-state-manager.ts?2ae0","webpack://Msdyn365.Commerce.Online/./src/store-selector-state-manager/store-selector-state-manager-data-action.ts?bd3e","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-pva-chat-connector/actions/getBotFrameworkToken.action.ts?0785","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-apple-pay/actions/get-card-payment-accept-point.ts?819f","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-delivery-options/actions/get-products-details-in-active-checkout-cart.ts?f6c5","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-express/actions/get-card-payment-accept-point.ts?e7e0","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-payment-instrument/actions/get-card-payment-accept-point.ts?c747","webpack://Msdyn365.Commerce.Online/./src/modules/checkout/actions/get-products-in-active-checkout-cart.ts?1981","webpack://Msdyn365.Commerce.Online/./src/actions/addToCart-telemetry.action.ts?4575","webpack://Msdyn365.Commerce.Online/./src/actions/copyCart-checkOut-telemetry.action.ts?403f","webpack://Msdyn365.Commerce.Online/./src/actions/getById-product-telemetry.action.ts?9e39","webpack://Msdyn365.Commerce.Online/./src/actions/getByIds-product-telemetry.action.ts?1a7f","webpack://Msdyn365.Commerce.Online/./src/actions/getVariantsByDimensionValues-telemetry.action.ts?b148","webpack://Msdyn365.Commerce.Online/./src/actions/purchase-telemetry.action.ts?d6c7","webpack://Msdyn365.Commerce.Online/./src/actions/readCart-telemetry.action.ts?ac14","webpack://Msdyn365.Commerce.Online/./src/actions/removeFromCart-telemetry.action.ts?b268","webpack://Msdyn365.Commerce.Online/./src/actions/telemetry.action.helper.ts?7f4a","webpack://Msdyn365.Commerce.Online/./src/actions/updateCart-telemetry.action.ts?f56d","webpack://Msdyn365.Commerce.Online/./src/distributor-selector-state-manager/map-distributor-selector-state-manager.ts?573e","webpack://Msdyn365.Commerce.Online/./src/distributor-selector-state-manager/distributor-selector-state-manager-data-action.ts?b68c","webpack://Msdyn365.Commerce.Online/./src/connectors/msdyn365-exp-test/msdyn365-exp-test.listener.ts?1431","webpack://Msdyn365.Commerce.Online/./src/connectors/msdyn365-exp-test/msdyn365-exp-test.provider.ts?04ad","webpack://Msdyn365.Commerce.Online/./src/actions/get-channels.ts?fd22","webpack://Msdyn365.Commerce.Online/./src/actions/get-org-unit-locations.ts?0b40","webpack://Msdyn365.Commerce.Online/./src/actions/get-sales-order-confirmation-with-hydrations.ts?6854","webpack://Msdyn365.Commerce.Online/./src/actions/get-sales-order-originators.ts?f89a","webpack://Msdyn365.Commerce.Online/./src/actions/get-sales-order-details-by-confirmation-id.ts?ce6e","webpack://Msdyn365.Commerce.Online/./src/actions/get-sales-order-with-hydrations.ts?a5de","webpack://Msdyn365.Commerce.Online/./src/actions/get-tender-types.ts?d667","webpack://Msdyn365.Commerce.Online/./src/modules/order-history-with-search-and-filters/actions/get-date-refiner-options.ts?ceee","webpack://Msdyn365.Commerce.Online/./src/modules/order-history-with-search-and-filters/actions/get-order-status-refiner-options.ts?f617","webpack://Msdyn365.Commerce.Online/./src/modules/order-history-with-search-and-filters/actions/get-search-options.ts?f248","webpack://Msdyn365.Commerce.Online/./src/modules/order-history-with-search-and-filters/actions/get-sort-options.ts?7dea","webpack://Msdyn365.Commerce.Online/./src/modules/order-history-with-search-and-filters/common/refiner-option.ts?b3fd","webpack://Msdyn365.Commerce.Online/./src/modules/order-history-with-search-and-filters/common/search-option.ts?20d1","webpack://Msdyn365.Commerce.Online/./src/modules/order-history-with-search-and-filters/common/sort-option.ts?5e94","webpack://Msdyn365.Commerce.Online/./src/modules/order-template/actions/get-order-template.ts?077e","webpack://Msdyn365.Commerce.Online/./src/modules/category-page-summary/category-page-summary.action.ts?c40c","webpack://Msdyn365.Commerce.Online/./src/modules/default-page-summary/default-page-summary.action.ts?5b44","webpack://Msdyn365.Commerce.Online/./src/modules/list-page-summary/list-page-summary.action.ts?a1a8","webpack://Msdyn365.Commerce.Online/./src/modules/product-page-summary/product-page-summary.action.ts?9992","webpack://Msdyn365.Commerce.Online/./src/modules/product-comparison-preview/actions/get-products-in-preview-product-comparison.ts?1623","webpack://Msdyn365.Commerce.Online/./src/modules/product-comparison-state/base/product-comparison-item.ts?940e","webpack://Msdyn365.Commerce.Online/./src/modules/product-comparison-state/base/comparison-item.ts?d1df","webpack://Msdyn365.Commerce.Online/./src/modules/product-comparison-state/product-comparison-state.ts?6916","webpack://Msdyn365.Commerce.Online/./src/modules/product-comparison-state/comparison-manager.ts?49d5","webpack://Msdyn365.Commerce.Online/./src/modules/product-comparison/actions/get-products-in-product-comparison.ts?b12d","webpack://Msdyn365.Commerce.Online/./src/dataActions/get-attributes-for-selected-variant.ts?e4b6","webpack://Msdyn365.Commerce.Online/./src/modules/quick-order-grid/actions/get-product-list.ts?d537","webpack://Msdyn365.Commerce.Online/./src/actions/get-product-reviews.ts?6edb","webpack://Msdyn365.Commerce.Online/./src/actions/get-user-review.ts?bad7","webpack://Msdyn365.Commerce.Online/./src/actions/inputs/get-product-reviews-input.ts?c654","webpack://Msdyn365.Commerce.Online/./src/actions/inputs/get-user-review-input.ts?ab81","webpack://Msdyn365.Commerce.Online/./src/actions/ratings-reviews-state-data-action.ts?26cd"],"sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction, IAction, IActionInput } from '@msdyn365-commerce/core';\nimport { GenericInput, getGenericAction } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IAccordionExpandedState } from './accordion-state';\n\nexport function createAccordionStateInput(result: IAccordionExpandedState): GenericInput {\n return new GenericInput('accordionExpandedState', result, 'IAccordionExpandedState');\n}\n\nconst createAccordionStateInputInternal = (): IActionInput => {\n return createAccordionStateInput({});\n};\n\nexport const getGenericActionDataAction = createObservableDataAction({\n action: >getGenericAction,\n input: createAccordionStateInputInternal\n});\n\nexport default getGenericActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n getCatalogId,\n IAction,\n IActionContext,\n IActionInput,\n ICreateActionContext\n} from '@msdyn365-commerce/core';\nimport { ProductLookupClause, ProductsDataActions, ProductSearchCriteria, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions, validateCatalogId } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IActiveImageConfig, IActivePointsData } from '../active-image';\n\n/**\n * ActiveImageInput.\n */\nexport class ActiveImageInput implements IActionInput {\n public config: IActiveImageConfig;\n\n private readonly _cacheKey: string = 'ActiveImage';\n\n public constructor(config: IActiveImageConfig) {\n this.config = config;\n\n if (this.config.activePoints && ArrayExtensions.hasElements(this.config.activePoints)) {\n for (const activePointData of this.config.activePoints) {\n if (activePointData.itemId) {\n this._cacheKey = `${this._cacheKey}-${activePointData.itemId.toString()}`;\n }\n }\n }\n }\n\n /**\n * GetCacheObjectType.\n * @returns - Returns string.\n */\n public getCacheObjectType = (): string => 'ActiveImageFullProductSearchResult';\n\n /**\n * GetCacheKey.\n * @returns - Returns string.\n */\n public getCacheKey = (): string => this._cacheKey;\n\n /**\n * DataCacheType.\n * @returns - CacheType string.\n */\n public dataCacheType = (): CacheType => 'application';\n}\n\n/**\n * CreateInput.\n * @param inputData - IActionContext.\n * @returns - IActionInput.\n */\nexport const createInput = (inputData: ICreateActionContext): IActionInput => {\n return new ActiveImageInput(inputData.config as IActiveImageConfig);\n};\n\n/**\n * Action.\n * @param input - ActiveImageInput.\n * @param context - IActionContext.\n * @returns - ProductSearchResult[].\n */\nexport const getActiveImageproductAction = async (input: ActiveImageInput, context: IActionContext): Promise => {\n const { config } = input;\n const itemIds: ProductLookupClause[] = [];\n if (config.activePoints) {\n config.activePoints.map((activePointData: IActivePointsData) => itemIds.push({ ItemId: activePointData.itemId }));\n }\n const searchCriteriaInput: ProductSearchCriteria = {};\n const catalogId = getCatalogId(context.requestContext);\n validateCatalogId(catalogId);\n\n searchCriteriaInput.Context = {\n ChannelId: context.requestContext.apiSettings.channelId,\n CatalogId: catalogId\n };\n if (process.env.NODE_ENV === 'development' && process.env.ENABLE_CLOUD_SEARCH?.toLowerCase() !== 'true') {\n searchCriteriaInput.IncludeAttributes = false;\n } else {\n searchCriteriaInput.IncludeAttributes = true;\n }\n searchCriteriaInput.ItemIds = itemIds;\n if (!config.activePoints || !ArrayExtensions.hasElements(config.activePoints)) {\n throw new Error('Fail to call ActiveImage API no active points configured.');\n }\n // eslint-disable-next-line no-return-await -- Disable because we want to return the promise.\n return await ProductsDataActions.searchByCriteriaAsync({ callerContext: context }, searchCriteriaInput);\n};\n\n/**\n * Action.\n * @param id - Id.\n * @param action - Action.\n * @returns - Results.\n */\nexport const actionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/active-image/get-active-image-products',\n action: getActiveImageproductAction as IAction,\n input: createInput\n});\n\nexport default actionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICommerceApiSettings,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { getAddressPurposesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\nimport { AddressPurpose } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { buildCacheKey, QueryResultSettingsProxy } from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Input class for get Address Purposes data action.\n */\nexport class GetAddressPurposesInput implements IActionInput {\n private readonly apiSettings: ICommerceApiSettings;\n\n constructor(apiSettings: ICommerceApiSettings) {\n this.apiSettings = apiSettings;\n }\n\n public getCacheKey = () => buildCacheKey('AddressPurpose', this.apiSettings);\n\n public getCacheObjectType = () => 'AddressPurpose';\n\n public dataCacheType = (): CacheType => 'application';\n}\n\n/**\n * Creates the input required to make the retail api call.\n * @param inputData\n */\nconst createInput = (inputData: ICreateActionContext>): GetAddressPurposesInput => {\n return new GetAddressPurposesInput(inputData.requestContext.apiSettings);\n};\n\nexport async function getAddressPurposesAction(input: GetAddressPurposesInput, ctx: IActionContext): Promise {\n return getAddressPurposesAsync({\n callerContext: ctx,\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(ctx)\n });\n}\n\nexport const getAddressPurposesActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/address/get-address-purposes',\n action: >getAddressPurposesAction,\n input: createInput\n});\n\nexport default getAddressPurposesActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICommerceApiSettings,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { getCountryRegionsByLanguageIdAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\nimport { CountryRegionInfo } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { buildCacheKey } from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Input class for get country regions data action.\n */\nexport class GetCountryRegionsInput implements IActionInput {\n public locale: string;\n\n private readonly apiSettings: ICommerceApiSettings;\n\n constructor(locale: string, apiSettings: ICommerceApiSettings) {\n this.locale = locale;\n this.apiSettings = apiSettings;\n }\n\n public getCacheKey = () => buildCacheKey(`CountryRegionInfo-${this.locale}`, this.apiSettings);\n\n public getCacheObjectType = () => 'CountryRegionInfo';\n\n public dataCacheType = (): CacheType => 'application';\n}\n\n/**\n * Creates the input required to make the retail api call.\n * @param inputData\n */\nconst createInput = (inputData: ICreateActionContext>): GetCountryRegionsInput => {\n if (!(inputData.requestContext && inputData.requestContext.locale)) {\n throw new Error('Unable to create country regions input. Locale is not provided.');\n }\n\n return new GetCountryRegionsInput(inputData.requestContext.locale, inputData.requestContext.apiSettings);\n};\n\nexport async function getCountryRegionsAction(input: GetCountryRegionsInput, ctx: IActionContext): Promise {\n // This API is returning more that 100 records. So, can't use the default page size for this.\n // Removing the query result setting.\n return getCountryRegionsByLanguageIdAsync({ callerContext: ctx, queryResultSettings: {} }, input.locale);\n}\n\nexport const getCountryRegionsActionDataAction = createObservableDataAction({\n action: >getCountryRegionsAction,\n input: createInput\n});\n\nexport default getCountryRegionsActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICommerceApiSettings,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { CountryRegionInfo, StateProvinceInfo } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { buildCacheKey } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { getCountryRegionsAction, GetCountryRegionsInput } from './get-country-regions';\nimport { getStateProvinceAction, GetStateProvincesInput } from './get-state-provinces';\n\n/**\n * Input class for get country regions data action.\n */\nexport class GetCountryStateInput implements IActionInput {\n public locale: string;\n\n public apiSettings: ICommerceApiSettings;\n\n constructor(locale: string, apiSettings: ICommerceApiSettings) {\n this.locale = locale;\n this.apiSettings = apiSettings;\n }\n\n public getCacheKey = () => buildCacheKey(`CountryStateInfo-${this.locale}`, this.apiSettings);\n\n public getCacheObjectType = () => 'StateProvinceInfo';\n\n public dataCacheType = (): CacheType => 'application';\n}\n\n/**\n * Creates the input required to make the retail api call.\n * @param inputData\n */\nconst createInput = (inputData: ICreateActionContext>): GetCountryStateInput => {\n const { locale, apiSettings } = inputData.requestContext;\n if (!(inputData.requestContext && locale)) {\n throw new Error('Unable to create country regions input. Locale is not provided.');\n }\n return new GetCountryStateInput(locale, apiSettings);\n};\n\nexport async function getCountryStateAction(input: GetCountryStateInput, ctx: IActionContext): Promise {\n const countryInput = new GetCountryRegionsInput(input.locale, input.apiSettings);\n const countryRegionsInfo = await getCountryRegionsAction(countryInput, ctx);\n\n const channelConfiguration = ctx.requestContext.channel;\n\n const marketISOCode = (channelConfiguration && channelConfiguration.ChannelCountryRegionISOCode) || 'US';\n const currentCountryRegion = countryRegionsInfo.find(countryRegion => (countryRegion.ISOCode || '') === marketISOCode);\n const countryRegionId = (currentCountryRegion && currentCountryRegion.CountryRegionId) || 'USA';\n\n const stateInput = new GetStateProvincesInput(countryRegionId, input.apiSettings);\n return getStateProvinceAction(stateInput, ctx);\n}\n\nexport const getCountryStateActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/address/get-country-state',\n action: >getCountryStateAction,\n input: createInput\n});\n\nexport default getCountryStateActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n ICommerceApiSettings\n} from '@msdyn365-commerce/core';\nimport { getStateProvincesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\nimport { StateProvinceInfo } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { buildCacheKey, QueryResultSettingsProxy } from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Input class for get state provinces data action.\n */\nexport class GetStateProvincesInput implements IActionInput {\n public countryRegionId: string;\n\n private readonly apiSettings: ICommerceApiSettings;\n\n constructor(countryRegionId: string, apiSettings: ICommerceApiSettings) {\n this.countryRegionId = countryRegionId;\n this.apiSettings = apiSettings;\n }\n\n public getCacheKey = () => buildCacheKey(`StateProvinceInfo-${this.countryRegionId}`, this.apiSettings);\n\n public getCacheObjectType = () => 'StateProvinceInfo';\n\n public dataCacheType = (): CacheType => 'request';\n}\n\nexport async function getStateProvinceAction(input: GetStateProvincesInput, ctx: IActionContext): Promise {\n return getStateProvincesAsync(\n {\n callerContext: ctx,\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(ctx)\n },\n input.countryRegionId\n );\n}\n\nexport const getStateProvinceActionDataAction = createObservableDataAction({\n action: >getStateProvinceAction\n});\n\nexport default getStateProvinceActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport MsDyn365, { IActionContext } from '@msdyn365-commerce/core';\nimport { action, computed, observable } from 'mobx';\n\nimport {\n IListMapViewState,\n ILoadMapApiInput,\n IStoreInfo,\n IStoreSelectionStateContext,\n IStoreSelectorLocation,\n IStoreSelectorStateManager\n} from './i-store-selection-state-manager';\n\n/**\n * Abstract instance of IStoreSelectorStateManager with base implementation\n * of everything except the geoLocate function.\n */\nexport abstract class BaseStoreSelectorStateManager implements IStoreSelectorStateManager {\n @computed public get isDialogOpen(): Readonly {\n return this._context !== undefined;\n }\n\n @computed public get context(): Readonly {\n return this._context;\n }\n\n @observable public isMapApiLoaded?: boolean;\n\n @observable public selectedStoreLocationId?: string;\n\n @observable public preferredStore?: IStoreInfo;\n\n @observable public listMapViewState: IListMapViewState = { displayList: true, displayMap: false };\n\n @observable public isMapModuleLoaded?: boolean;\n\n @observable public lastInlineShownStoreInfo?: IStoreInfo;\n\n @observable protected _context?: IStoreSelectionStateContext;\n\n private readonly preferredStoreLocalStorageKey: string = '_msdyn365__preferredStore_';\n\n constructor() {\n this.isMapModuleLoaded = false;\n const value = this._readFromToCookie(this.preferredStoreLocalStorageKey);\n try {\n const storeInfo: IStoreInfo | undefined = value ? JSON.parse(value) : undefined;\n if (storeInfo) {\n this.preferredStore = storeInfo;\n }\n } catch {\n this.preferredStore = undefined;\n }\n }\n\n public abstract geoLocate(searchTerm: string, actionContext: IActionContext): Promise;\n\n public abstract loadMapApi(input: ILoadMapApiInput): Promise;\n\n @action\n public async toggleListMapViewState(): Promise {\n this.listMapViewState = {\n displayList: !this.listMapViewState.displayList,\n displayMap: !this.listMapViewState.displayMap\n };\n }\n\n @action\n public async setMapModuleLoaded(input: boolean): Promise {\n this.isMapModuleLoaded = input;\n }\n\n @action\n public async setOrgUnitStoreInformation(input: IStoreSelectionStateContext): Promise {\n this._context = input;\n }\n\n @action\n public async setSelectedStoreLocationId(storeId: string | undefined): Promise {\n this.selectedStoreLocationId = storeId;\n }\n\n @action\n public async setPreferredStoreLocation(\n storeId?: string,\n storeName?: string | undefined,\n writeToCookie: boolean = false,\n latitude?: number,\n longitude?: number\n ): Promise {\n const storeInfo: IStoreInfo = { StoreId: storeId, StoreName: storeName, Latitude: latitude, Longitude: longitude };\n this.preferredStore = storeInfo;\n if (writeToCookie) {\n this._writeToCookie(this.preferredStoreLocalStorageKey, JSON.stringify(storeInfo));\n }\n }\n\n @action\n public async setLastInlineStoreInfo(latitude?: number, longitude?: number): Promise {\n const storeInfo: IStoreInfo = { StoreId: '', StoreName: '', Latitude: latitude, Longitude: longitude };\n this.lastInlineShownStoreInfo = storeInfo;\n }\n\n @action\n public async clearPreferredStore(writeToCookie: boolean): Promise {\n this.preferredStore = undefined;\n if (writeToCookie) {\n this._removeCookie(this.preferredStoreLocalStorageKey);\n }\n }\n\n @action\n public async openDialog(input: IStoreSelectionStateContext): Promise {\n if (this._context && this._context.id === input.id) {\n throw new Error('Dialog is already opened');\n }\n\n this._context = input;\n }\n\n @action\n public async closeDialog(): Promise {\n this._context = undefined;\n }\n\n private _removeCookie(key: string): void {\n if (!key) {\n return;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n storage.removeItem(key);\n }\n }\n\n private _writeToCookie(key: string, value: string | undefined): void {\n if (!key || !value) {\n return;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n storage.setItem(key, value);\n }\n }\n\n private _readFromToCookie(key: string): string | undefined {\n if (!key) {\n return undefined;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n const cookieValue = storage.getItem(key);\n if (cookieValue) {\n return cookieValue;\n }\n }\n\n return undefined;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { action } from 'mobx';\n\nimport { BaseStoreSelectorStateManager } from './base-store-selector-state-manager';\nimport { ILoadMapApiInput, IStoreSelectorLocation } from './i-store-selection-state-manager';\nimport { IMapWindow, MapLocationsResult } from './models/map-data';\n\ndeclare const window: IMapWindow;\n\n/**\n * Instance of IStoreSelectorStateManager manager that uses Map service\n * for geo location.\n */\nexport class MapStoreSelectorStateManager extends BaseStoreSelectorStateManager {\n private readonly SERVICE_ENDPOINT: string = 'https://dev.virtualearth.net/REST/v1/';\n\n private readonly MAP_API_ENDPOINT: string = 'https://www.bing.com/api/maps/mapcontrol?callback=mapAPIReady';\n\n @action\n public async geoLocate(searchTerm: string, actionContext: IActionContext): Promise {\n if (\n !searchTerm ||\n !actionContext.requestContext.channel ||\n !actionContext.requestContext.channel.BingMapsApiKey ||\n !actionContext.requestContext.channel.BingMapsEnabled\n ) {\n return undefined;\n }\n\n let searchContent: string = searchTerm;\n\n const jsonp = `mapSearchCallback_${crypto.getRandomValues(new Uint32Array(1))[0]}`;\n\n if (actionContext.requestContext.channel.ChannelCountryRegionISOCode) {\n searchContent = `${searchTerm.trim()} ${actionContext.requestContext.channel.ChannelCountryRegionISOCode}`;\n }\n\n const query = encodeURI(searchContent);\n const key = encodeURI(actionContext.requestContext.channel.BingMapsApiKey);\n\n const geolocationApiUrl =\n actionContext.requestContext.app &&\n actionContext.requestContext.app.config &&\n actionContext.requestContext.app.config.geolocationApiUrl;\n const requestUrl = `${\n geolocationApiUrl ? geolocationApiUrl : this.SERVICE_ENDPOINT\n }/Locations?query=${query}&key=${key}&jsonp=${jsonp}`;\n\n return new Promise(resolve => {\n const script = document.createElement('script');\n script.setAttribute('type', 'text/javascript');\n script.setAttribute('src', requestUrl);\n\n window[jsonp] = (data: MapLocationsResult) => {\n delete window[jsonp];\n script.remove();\n\n if (data && data.resourceSets && data.resourceSets.length > 0 && data.resourceSets[0].resources.length > 0) {\n resolve({\n latitude: data.resourceSets[0].resources[0].point.coordinates[0],\n longitude: data.resourceSets[0].resources[0].point.coordinates[1]\n });\n }\n\n resolve(undefined);\n };\n\n document.body.appendChild(script);\n });\n }\n\n @action\n public async loadMapApi(input: ILoadMapApiInput): Promise {\n if (StringExtensions.isNullOrEmpty(input.key)) {\n return Promise.resolve();\n }\n\n const isScriptAlreadyLoaded = !!document?.getElementById('msdyn_map-api-script');\n\n if (isScriptAlreadyLoaded) {\n if (window) {\n const currentWindowAPI = window.mapAPIReady;\n window.mapAPIReady = () => {\n if (currentWindowAPI) {\n currentWindowAPI();\n }\n this.isMapApiLoaded = true;\n };\n }\n // Prevents from loading multiple script into the body\n return Promise.resolve();\n }\n\n const url = `${this.MAP_API_ENDPOINT}${input.key ? `&key=${input.key}` : ''}${input.lang ? `&setLang=${input.lang}` : ''}${\n input.market ? `&setMkt=${input.market}` : ''\n }`;\n\n return new Promise((resolve, reject) => {\n const script = document?.createElement('script');\n script.type = 'text/javascript';\n script.async = true;\n script.defer = true;\n script.src = url;\n script.id = 'msdyn_map-api-script';\n if (window) {\n window.mapAPIReady = () => {\n this.isMapApiLoaded = true;\n resolve();\n };\n }\n script.addEventListener('error', (error: string | Event) => {\n reject(error);\n });\n document?.body?.appendChild(script);\n });\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction, IAction, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\nimport { GenericInput, getGenericAction } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IStoreSelectorStateManager } from './i-store-selection-state-manager';\nimport { MapStoreSelectorStateManager } from './map-store-selector-state-manager';\n\nexport function createStoreSelectorStateInput(result: IStoreSelectorStateManager): GenericInput {\n return new GenericInput('mapSSSM', result, 'IStoreSelectorStateManager');\n}\n\nconst createStoreSelectorStateInputInternal = (inputData: ICreateActionContext>): IActionInput => {\n return createStoreSelectorStateInput(new MapStoreSelectorStateManager());\n};\n\nexport const getGenericActionDataAction = createObservableDataAction({\n action: >getGenericAction,\n input: createStoreSelectorStateInputInternal\n});\n\nexport default getGenericActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport msdyn365Commerce, * as Msdyn365 from '@msdyn365-commerce/core';\n\n/**\n * Bot Framework input. Used to retrieve existing active bot framework session token.\n */\nexport class GetBotFrameworkInput implements Msdyn365.IActionInput {\n public getCacheKey = () => `CURRENT-BOTFRAMEWORKTOKEN`;\n public getCacheObjectType = () => 'CURRENT-BOTFRAMEWORK-KEY1';\n public dataCacheType = (): Msdyn365.CacheType => 'application';\n}\n\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\n return new GetBotFrameworkInput();\n};\n\nasync function action(input: GetBotFrameworkInput, ctx: Msdyn365.IActionContext): Promise {\n const ISecretValue = await msdyn365Commerce.secretManager?.getSecretValue(\n 'PVA-WEBCHANNELSECURITY-KEY',\n ctx.requestContext.apiSettings.baseUrl\n );\n const apiToken = ISecretValue?.value;\n return apiToken ?? '';\n}\n\nexport default Msdyn365.createObservableDataAction({\n action: >action,\n id: 'getBotFrameworkToken',\n input: createInput\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n ICommerceApiSettings,\n ICreateActionContext,\n isEmptyOrNullObject\n} from '@msdyn365-commerce/core';\nimport { getCheckoutState, ICheckoutState } from '@msdyn365-commerce/global-state';\nimport { CardPaymentAcceptPoint, CartsDataActions } from '@msdyn365-commerce/retail-proxy';\nimport { buildCacheKey } from '@msdyn365-commerce-modules/retail-actions';\nimport { get } from 'lodash';\n\n/**\n * Get card payment accept point input.\n */\nexport interface IGetCardPaymentAcceptPointInput {\n shouldShowBillingAddress?: boolean;\n paymentTenderType?: string;\n apiSettings: ICommerceApiSettings;\n amountDue?: number;\n}\n\n/**\n * GetCardPaymentAcceptPointInput - Input for create GetCardPaymentAcceptPoint.\n */\nexport class GetCardPaymentAcceptPointInput implements IActionInput {\n public shouldShowBillingAddress?: boolean;\n\n public paymentTenderType?: string;\n\n public amountDue?: number;\n\n private readonly apiSettings: ICommerceApiSettings;\n\n // eslint-disable-next-line @typescript-eslint/explicit-member-accessibility -- Existing code.\n constructor(input: IGetCardPaymentAcceptPointInput) {\n this.shouldShowBillingAddress = input.shouldShowBillingAddress;\n this.paymentTenderType = input.paymentTenderType;\n this.apiSettings = input.apiSettings;\n this.amountDue = input.amountDue;\n }\n\n /**\n * Get the cache key.\n * @returns Cache key.\n */\n public getCacheKey = (): string => buildCacheKey(`CardPaymentAcceptPoint-apple-pay`, this.apiSettings);\n\n /**\n * Get cache object type.\n * @returns Card payment accept point.\n */\n public getCacheObjectType = (): string => 'CardPaymentAcceptPoint';\n\n /**\n * Get data cache type.\n * @returns The cache type.\n */\n public dataCacheType = (): CacheType => 'none';\n}\n\n/**\n * Create checkout apple pay input.\n * @param inputData - Get card payment accept point.\n * @returns CardPaymentAcceptInput.\n */\nexport const createCheckoutPaymentInstrumentInput = (\n inputData: ICreateActionContext\n): GetCardPaymentAcceptPointInput => {\n const { shouldShowBillingAddress, paymentTenderType, amountDue } = inputData.config ?? {};\n const getCardPaymentAcceptPointInput = {\n shouldShowBillingAddress,\n paymentTenderType,\n apiSettings: inputData.requestContext.apiSettings,\n amountDue\n };\n\n return new GetCardPaymentAcceptPointInput(getCardPaymentAcceptPointInput);\n};\n\n/**\n * Calls the Retail API and returns a cart object based on the passed GetCartInput.\n * @param input - The get card payment accept point.\n * @param ctx - The action context.\n * @returns CardPaymentAcceptPoint.\n */\nexport async function getCardPaymentAcceptPointAction(\n input: GetCardPaymentAcceptPointInput,\n ctx: IActionContext\n): Promise {\n // If no cart ID is provided in input, we need to create a cart object\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Double check.\n if (!input) {\n ctx.telemetry.exception(new Error('[getCardPaymentAcceptPointAction] No valid Input was provided, failing'));\n throw new Error('[getCardPaymentAcceptPointAction] No valid Input was provided, failing');\n }\n\n const { paymentTenderType = 'applepay', amountDue = 0 } = input;\n const checkoutState: ICheckoutState = await getCheckoutState(ctx).catch((error: Error) => {\n ctx.telemetry.exception(error);\n throw error;\n });\n\n if (\n isEmptyOrNullObject(checkoutState) ||\n isEmptyOrNullObject(checkoutState.checkoutCart) ||\n isEmptyOrNullObject(checkoutState.checkoutCart.cart)\n ) {\n ctx.telemetry.exception(new Error('[getCardPaymentAcceptPointAction] Unable to get cart'));\n throw new Error('[getCardPaymentAcceptPointAction] Unable to get cart');\n }\n\n // if (!checkoutState.checkoutCart.cart.CartLines || !ArrayExtensions.hasElements(checkoutState.checkoutCart.cart.CartLines)) {\n // ctx.telemetry.exception(new Error('[getCardPaymentAcceptPointAction] Cart is empty'));\n // throw new Error('[getCardPaymentAcceptPointAction] Cart is empty');\n // }\n\n const requestUrl =\n typeof ctx.requestContext.url.requestUrl === 'string'\n ? new URL(ctx.requestContext.url.requestUrl)\n : ctx.requestContext.url.requestUrl;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- Existing code.\n const origin = get(window, 'location.origin') || requestUrl.origin;\n\n const cardPaymentAcceptSettings = {\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CardPaymentAcceptSettings',\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- Any type.\n HostPageOrigin: origin,\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-unsafe-assignment -- Any type.\n AdaptorPath: `${origin}/Connectors/` || origin,\n CardPaymentEnabled: false,\n CardTokenizationEnabled: true,\n HideBillingAddress: true,\n ...(paymentTenderType && { TenderTypeId: paymentTenderType }),\n PaymentAmount: amountDue !== 0 ? amountDue : checkoutState.checkoutCart.cart.AmountDue ?? 0,\n RequireShippingAddress: true\n };\n\n return CartsDataActions.getCardPaymentAcceptPointAsync(\n { callerContext: ctx, bypassCache: 'get' },\n checkoutState.checkoutCart.cart.Id,\n cardPaymentAcceptSettings,\n []\n )\n .then(cardPaymentAcceptPoint => {\n if (!cardPaymentAcceptPoint.AcceptPageUrl && !cardPaymentAcceptPoint.AcceptPageContent) {\n throw new Error(\n '[getCardPaymentAcceptPointAction]Payment Accept Page has neither return AcceptPageUrl nor AcceptPageContent in updatePaymentAcceptPageData'\n );\n }\n return cardPaymentAcceptPoint;\n })\n .catch(error => {\n ctx.telemetry.exception(error as Error);\n ctx.telemetry.debug('Unable to get Card Payment Accept Point');\n throw error;\n });\n}\n\n/**\n * Get card payment accept point.\n */\nexport const getCardPaymentAcceptPointActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce/checkout-apple-pay/get-card-payment-accept-point',\n action: getCardPaymentAcceptPointAction as IAction,\n input: createCheckoutPaymentInstrumentInput\n});\n\nexport default getCardPaymentAcceptPointActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput } from '@msdyn365-commerce/core';\nimport { getCheckoutState } from '@msdyn365-commerce/global-state';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { getSimpleProducts, ProductInput } from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Input class for ActiveCheckoutCartWithProductsDetails data action.\n */\nexport class ActiveCheckoutCartProductsDetailsInput implements IActionInput {\n public getCacheKey = () => 'ActiveCheckoutCartProducts';\n\n public getCacheObjectType = () => 'ActiveCheckoutCartProducts';\n\n public dataCacheType = (): CacheType => 'none';\n}\n\nexport const createCartInput = () => {\n return new ActiveCheckoutCartProductsDetailsInput();\n};\n\n/**\n * Calls the Retail API and returns a cart object based on the passed GetCartInput.\n * @param input\n * @param ctx\n */\nexport async function getActiveCheckoutCartProductsDetailsAction(\n input: ActiveCheckoutCartProductsDetailsInput,\n ctx: IActionContext\n): Promise {\n // Check if the input is valid\n if (!input) {\n ctx.telemetry.exception(new Error('[getActiveCheckoutCartWithProductsDetails]No valid Input was provided, failing'));\n throw new Error('[getActiveCheckoutCartWithProductsDetails]No valid Input was provided, failing');\n }\n\n const checkoutState = await getCheckoutState(ctx);\n const cart = checkoutState.checkoutCart.cart;\n\n // If there are cart lines, make call to get products\n if (!checkoutState.checkoutCart.hasInvoiceLine && cart && cart.CartLines && cart.CartLines.length > 0) {\n return getSimpleProducts(\n cart.CartLines.map(cartLine => {\n if (cartLine.ProductId) {\n return new ProductInput(\n cartLine.ProductId,\n ctx.requestContext.apiSettings,\n undefined,\n undefined,\n ctx.requestContext,\n cartLine.CatalogId\n );\n }\n return undefined;\n }).filter(Boolean),\n ctx\n )\n .then(products => {\n if (products) {\n return products;\n }\n return [];\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n throw new Error('[getActiveCheckoutCartWithProductsDetails]Unable to hydrate cart with product information');\n });\n }\n\n return [];\n}\n\nexport const getActiveCheckoutCartProductsDetailsActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/checkout/get-products-details-in-active-checkout-cart',\n action: >getActiveCheckoutCartProductsDetailsAction,\n input: createCartInput\n});\n\nexport default getActiveCheckoutCartProductsDetailsActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n ICommerceApiSettings,\n ICreateActionContext,\n isEmptyOrNullObject\n} from '@msdyn365-commerce/core';\nimport { getCartState, getCheckoutState, ICartState, ICheckoutState } from '@msdyn365-commerce/global-state';\nimport { CardPaymentAcceptPoint, CartsDataActions } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions, buildCacheKey } from '@msdyn365-commerce-modules/retail-actions';\nimport { get } from 'lodash';\n\n/**\n * Get card payment accept point input.\n */\nexport interface IGetCardPaymentAcceptPointInput {\n shouldShowBillingAddress?: boolean;\n paymentTenderType?: string;\n apiSettings: ICommerceApiSettings;\n shouldEnableSinglePaymentAuthorizationCheckout?: boolean;\n amountDue?: number;\n isInCartPage?: boolean;\n}\n\n/**\n * GetCardPaymentAcceptPointInput - Input for create GetCardPaymentAcceptPoint.\n */\nexport class GetCardPaymentAcceptPointInput implements IActionInput {\n public shouldShowBillingAddress?: boolean;\n\n public paymentTenderType?: string;\n\n public shouldEnableSinglePaymentAuthorizationCheckout?: boolean;\n\n public amountDue?: number;\n\n public isInCartPage?: boolean;\n\n private readonly apiSettings: ICommerceApiSettings;\n\n // eslint-disable-next-line @typescript-eslint/explicit-member-accessibility -- Existing code.\n constructor(input: IGetCardPaymentAcceptPointInput) {\n this.shouldShowBillingAddress = input.shouldShowBillingAddress;\n this.paymentTenderType = input.paymentTenderType;\n this.apiSettings = input.apiSettings;\n this.shouldEnableSinglePaymentAuthorizationCheckout = input.shouldEnableSinglePaymentAuthorizationCheckout;\n this.amountDue = input.amountDue;\n this.isInCartPage = input.isInCartPage;\n }\n\n /**\n * Get the cache key.\n * @returns Cache key.\n */\n public getCacheKey = (): string =>\n buildCacheKey(`CardPaymentAcceptPoint${this.paymentTenderType ? `-${this.paymentTenderType}-express` : ''}`, this.apiSettings);\n\n /**\n * Get cache object type.\n * @returns Card payment accept point.\n */\n public getCacheObjectType = (): string => 'CardPaymentAcceptPoint';\n\n /**\n * Get data cache type.\n * @returns The cache type.\n */\n public dataCacheType = (): CacheType => 'none';\n}\n\n/**\n * Create checkout express input.\n * @param inputData - Get card payment accept point.\n * @returns CardPaymentAcceptInput.\n */\nexport const createCheckoutPaymentInstrumentInput = (\n inputData: ICreateActionContext\n): GetCardPaymentAcceptPointInput => {\n const { shouldShowBillingAddress, paymentTenderType, shouldEnableSinglePaymentAuthorizationCheckout, amountDue, isInCartPage } =\n inputData.config ?? {};\n const getCardPaymentAcceptPointInput = {\n shouldShowBillingAddress,\n paymentTenderType,\n apiSettings: inputData.requestContext.apiSettings,\n shouldEnableSinglePaymentAuthorizationCheckout,\n amountDue,\n isInCartPage\n };\n\n return new GetCardPaymentAcceptPointInput(getCardPaymentAcceptPointInput);\n};\n\n/**\n * Calls the Retail API and returns a cart object based on the passed GetCartInput.\n * @param input - The get card payment accept point.\n * @param ctx - The action context.\n * @returns CardPaymentAcceptPoint.\n */\nexport async function getCardPaymentAcceptPointAction(\n input: GetCardPaymentAcceptPointInput,\n ctx: IActionContext\n): Promise {\n // If no cart ID is provided in input, we need to create a cart object\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Double check.\n if (!input) {\n ctx.telemetry.exception(new Error('[getCardPaymentAcceptPointAction] No valid Input was provided, failing'));\n throw new Error('[getCardPaymentAcceptPointAction] No valid Input was provided, failing');\n }\n\n const { paymentTenderType, amountDue = 0 } = input;\n const checkoutState: ICheckoutState = await getCheckoutState(ctx).catch((error: Error) => {\n ctx.telemetry.exception(error);\n throw error;\n });\n\n const cartState: ICartState = await getCartState(ctx).catch((error: Error) => {\n ctx.telemetry.exception(error);\n throw error;\n });\n\n if (\n isEmptyOrNullObject(checkoutState) ||\n isEmptyOrNullObject(checkoutState.checkoutCart) ||\n isEmptyOrNullObject(checkoutState.checkoutCart.cart)\n ) {\n ctx.telemetry.exception(new Error('[getCardPaymentAcceptPointAction] Unable to get checkoutState cart'));\n throw new Error('[getCardPaymentAcceptPointAction] Unable to get checkoutState cart');\n }\n\n if (isEmptyOrNullObject(cartState) || isEmptyOrNullObject(cartState.cart)) {\n ctx.telemetry.exception(new Error('[getCardPaymentAcceptPointAction] Unable to get cartState cart'));\n throw new Error('[getCardPaymentAcceptPointAction] Unable to get cartState cart');\n }\n\n // Cart lines could be updated after copying the cart to checkout state. So need to check cart instead of checkoutcart.\n if (!cartState.cart.CartLines || !ArrayExtensions.hasElements(cartState.cart.CartLines)) {\n ctx.telemetry.exception(new Error('[getCardPaymentAcceptPointAction] Cart is empty'));\n throw new Error('[getCardPaymentAcceptPointAction] Cart is empty');\n }\n\n const requestUrl =\n typeof ctx.requestContext.url.requestUrl === 'string'\n ? new URL(ctx.requestContext.url.requestUrl)\n : ctx.requestContext.url.requestUrl;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- Existing code.\n const origin = get(window, 'location.origin') || requestUrl.origin;\n\n const getCartAmountDue = () => {\n return input.isInCartPage ? cartState.cart.AmountDue : checkoutState.checkoutCart.cart.AmountDue ?? 0;\n };\n\n const cardPaymentAcceptSettings = {\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CardPaymentAcceptSettings',\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- Any type.\n HostPageOrigin: origin,\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-unsafe-assignment -- Any type.\n AdaptorPath: `${origin}/Connectors/` || origin,\n CardPaymentEnabled: false,\n CardTokenizationEnabled: true,\n HideBillingAddress: true,\n ...(paymentTenderType && { TenderTypeId: paymentTenderType }),\n PaymentAmount: amountDue !== 0 ? amountDue : getCartAmountDue(),\n RequireShippingAddress: true\n };\n\n return CartsDataActions.getCardPaymentAcceptPointAsync(\n { callerContext: ctx, bypassCache: 'get' },\n checkoutState.checkoutCart.cart.Id,\n cardPaymentAcceptSettings,\n []\n )\n .then(cardPaymentAcceptPoint => {\n if (!cardPaymentAcceptPoint.AcceptPageUrl && !cardPaymentAcceptPoint.AcceptPageContent) {\n throw new Error(\n '[getCardPaymentAcceptPointAction]Payment Accept Page has neither return AcceptPageUrl nor AcceptPageContent in updatePaymentAcceptPageData'\n );\n }\n return cardPaymentAcceptPoint;\n })\n .catch(error => {\n ctx.telemetry.exception(error as Error);\n ctx.telemetry.debug('Unable to get Card Payment Accept Point');\n throw error;\n });\n}\n\n/**\n * Get card payment accept point.\n */\nexport const getCardPaymentAcceptPointActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce/checkout-express/get-card-payment-accept-point',\n action: getCardPaymentAcceptPointAction as IAction,\n input: createCheckoutPaymentInstrumentInput\n});\n\nexport default getCardPaymentAcceptPointActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n ICommerceApiSettings,\n ICreateActionContext,\n isEmptyOrNullObject\n} from '@msdyn365-commerce/core';\nimport { getCheckoutState, ICheckoutState } from '@msdyn365-commerce/global-state';\nimport { getCardPaymentAcceptPointAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { CardPaymentAcceptPoint } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { buildCacheKey } from '@msdyn365-commerce-modules/retail-actions';\nimport get from 'lodash/get';\n\nexport interface IGetCardPaymentAcceptPointInput {\n showBillingAddress?: boolean;\n paymenTenderType?: string;\n apiSettings: ICommerceApiSettings;\n shouldEnableSinglePaymentAuthorizationCheckout?: boolean;\n amountDue?: number;\n shouldPassLocaleToiFrame?: boolean;\n}\n\n/**\n * GetCardPaymentAcceptPointInput - Input for create GetCardPaymentAcceptPoint.\n */\nexport class GetCardPaymentAcceptPointInput implements IActionInput {\n public showBillingAddress?: boolean;\n\n public paymenTenderType?: string;\n\n public shouldEnableSinglePaymentAuthorizationCheckout?: boolean;\n\n public amountDue?: number;\n\n public shouldPassLocaleToiFrame?: boolean;\n\n private readonly apiSettings: ICommerceApiSettings;\n\n constructor(input: IGetCardPaymentAcceptPointInput) {\n this.showBillingAddress = input.showBillingAddress;\n this.paymenTenderType = input.paymenTenderType;\n this.apiSettings = input.apiSettings;\n this.shouldEnableSinglePaymentAuthorizationCheckout = input.shouldEnableSinglePaymentAuthorizationCheckout;\n this.amountDue = input.amountDue;\n this.shouldPassLocaleToiFrame = input.shouldPassLocaleToiFrame;\n }\n\n public getCacheKey = () =>\n buildCacheKey(`CardPaymentAcceptPoint${this.paymenTenderType ? `-${this.paymenTenderType}` : ''}`, this.apiSettings);\n\n public getCacheObjectType = () => 'CardPaymentAcceptPoint';\n\n public dataCacheType = (): CacheType => 'none';\n}\n\nexport const createCheckoutPaymentInstrumentInput = (inputData: ICreateActionContext) => {\n // eslint-disable-next-line @typescript-eslint/naming-convention -- keep existing name.\n const { showBillingAddress, paymenTenderType, shouldEnableSinglePaymentAuthorizationCheckout, amountDue, shouldPassLocaleToiFrame } =\n inputData.config ?? {};\n const getCardPaymentAcceptPointInput = {\n showBillingAddres: showBillingAddress,\n paymenTenderType,\n apiSettings: inputData.requestContext.apiSettings,\n shouldEnableSinglePaymentAuthorizationCheckout,\n amountDue,\n shouldPassLocaleToiFrame\n };\n\n return new GetCardPaymentAcceptPointInput(getCardPaymentAcceptPointInput);\n};\n\n/**\n * Calls the Retail API and returns a cart object based on the passed GetCartInput.\n * @param input\n * @param ctx\n */\nexport async function getCardPaymentAcceptPointAction(\n input: GetCardPaymentAcceptPointInput,\n ctx: IActionContext\n): Promise {\n // If no cart ID is provided in input, we need to create a cart object\n if (!input) {\n ctx.telemetry.exception(new Error('[getCardPaymentAcceptPointAction] No valid Input was provided, failing'));\n throw new Error('[getCardPaymentAcceptPointAction] No valid Input was provided, failing');\n }\n\n const { showBillingAddress, paymenTenderType, amountDue = 0, shouldPassLocaleToiFrame } = input;\n const checkoutState: ICheckoutState = await getCheckoutState(ctx).catch((error: Error) => {\n ctx.telemetry.exception(error);\n throw error;\n });\n\n if (\n isEmptyOrNullObject(checkoutState) ||\n isEmptyOrNullObject(checkoutState.checkoutCart) ||\n isEmptyOrNullObject(checkoutState.checkoutCart.cart)\n ) {\n ctx.telemetry.exception(new Error('[getCardPaymentAcceptPointAction] Unable to get cart'));\n throw new Error('[getCardPaymentAcceptPointAction] Unable to get cart');\n }\n\n if (!checkoutState.checkoutCart.cart.CartLines || checkoutState.checkoutCart.cart.CartLines.length === 0) {\n ctx.telemetry.exception(new Error('[getCardPaymentAcceptPointAction] Cart is empty'));\n throw new Error('[getCardPaymentAcceptPointAction] Cart is empty');\n }\n\n const requestUrl =\n typeof ctx.requestContext.url.requestUrl === 'string'\n ? new URL(ctx.requestContext.url.requestUrl)\n : ctx.requestContext.url.requestUrl;\n const origin = get(window, 'location.origin') || requestUrl.origin;\n\n const cardPaymentAcceptSettings = {\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CardPaymentAcceptSettings',\n HostPageOrigin: origin,\n AdaptorPath: `${origin}/Connectors/` || origin,\n CardPaymentEnabled: false,\n CardTokenizationEnabled: true,\n ...(!showBillingAddress && { HideBillingAddress: true }),\n ...(paymenTenderType && { TenderTypeId: paymenTenderType }),\n PaymentAmount: amountDue !== 0 ? amountDue : checkoutState.checkoutCart.cart.AmountDue ?? 0,\n Locale: shouldPassLocaleToiFrame ? ctx.requestContext.locale || 'en-us' : undefined\n };\n\n return getCardPaymentAcceptPointAsync(\n { callerContext: ctx, bypassCache: 'get' },\n checkoutState.checkoutCart.cart.Id,\n cardPaymentAcceptSettings,\n []\n )\n .then(cardPaymentAcceptPoint => {\n if (!cardPaymentAcceptPoint.AcceptPageUrl && !cardPaymentAcceptPoint.AcceptPageContent) {\n throw new Error(\n '[getCardPaymentAcceptPointAction] Payment Accept Page has neither return AcceptPageUrl nor AcceptPageContent in updatePaymentAcceptPageData'\n );\n }\n return cardPaymentAcceptPoint;\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n ctx.telemetry.debug('Unable to get Card Payment Accept Point');\n throw error;\n });\n}\n\nexport const getCardPaymentAcceptPointActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce/checkout-payment-instrument/get-card-payment-accept-point',\n action: >getCardPaymentAcceptPointAction,\n input: createCheckoutPaymentInstrumentInput\n});\n\nexport default getCardPaymentAcceptPointActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput } from '@msdyn365-commerce/core';\nimport { getCheckoutState } from '@msdyn365-commerce/global-state';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { getSimpleProducts, ProductInput } from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Input class for ActiveCheckoutCartWithProducts data action.\n */\nexport class ActiveCheckoutCartProductsInput implements IActionInput {\n public getCacheKey = () => 'ActiveCheckoutCartProducts';\n\n public getCacheObjectType = () => 'ActiveCheckoutCartProducts';\n\n public dataCacheType = (): CacheType => 'none';\n}\n\nexport const createInput = () => {\n return new ActiveCheckoutCartProductsInput();\n};\n\n/**\n * Calls the Retail API and returns a cart object based on the passed GetCartInput.\n * @param input\n * @param ctx\n */\nexport async function getActiveCheckoutCartProductsAction(\n input: ActiveCheckoutCartProductsInput,\n ctx: IActionContext\n): Promise {\n // If no cart ID is provided in input, we need to create a cart object\n if (!input) {\n ctx.telemetry.exception(new Error('[getActiveCheckoutCartWithProducts]No valid Input was provided, failing'));\n throw new Error('[getActiveCheckoutCartWithProducts]No valid Input was provided, failing');\n }\n\n const checkoutState = await getCheckoutState(ctx);\n const cart = checkoutState.checkoutCart.cart;\n\n // If there are cart lines, make call to get products\n if (!checkoutState.checkoutCart.hasInvoiceLine && cart && cart.CartLines && cart.CartLines.length > 0) {\n return getSimpleProducts(\n cart.CartLines.map(cartLine => {\n if (cartLine.ProductId) {\n return new ProductInput(\n cartLine.ProductId,\n ctx.requestContext.apiSettings,\n undefined,\n undefined,\n ctx.requestContext,\n cartLine.CatalogId\n );\n }\n return undefined;\n }).filter(Boolean),\n ctx\n )\n .then(products => {\n if (products) {\n return products;\n }\n return [];\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n throw new Error('[getActiveCheckoutCartWithProdcuts]Unable to hydrate cart with product information');\n });\n }\n\n return [];\n}\n\nexport const getActiveCheckoutCartProductsActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/checkout/get-products-in-active-checkout-cart',\n action: >getActiveCheckoutCartProductsAction,\n input: createInput\n});\n\nexport default getActiveCheckoutCartProductsActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createDataActionHook, IActionContext, IActionInput } from '@msdyn365-commerce/core';\nimport { IMSDyn365Window } from '@msdyn365-commerce/core-internal';\nimport { Cart, CartLine, IAddCartLinesParam, IDataServiceRequest } from '@msdyn365-commerce/retail-proxy';\nimport { IProductInfo, TelemetryEvent } from '@msdyn365-commerce/telemetry-internal';\nimport { getProductInfoFromCartLinesAsync } from './telemetry.action.helper';\n\ndeclare let window: IMSDyn365Window;\n\n/**\n * Saves info on cart lines added before calling data action\n * @param inputs Data action inputs\n * @param actionContext Action context\n */\nconst beforeAddToCart = async (inputs: IActionInput | IActionInput[], actionContext: IActionContext) => {\n try {\n const actionInput = Array.isArray(inputs) ? inputs[0] : inputs;\n\n // If cart lines were added\n if (actionInput.queryParams && typeof actionInput.queryParams === 'function') {\n const addCartLinesParams = actionInput.queryParams();\n if (addCartLinesParams && addCartLinesParams.cartLines) {\n // Save info on added cart lines for post data action hook to pick up\n actionContext.requestContext.telemetryData.addedCartLines = addCartLinesParams.cartLines;\n return;\n }\n }\n actionContext.telemetry.debug('AddToCart pre-data action hook failed - No added cart lines found');\n } catch (e) {\n actionContext.telemetry.debug('AddToCart pre-data action hook failed.', e);\n }\n};\n\n/**\n * Fires an AddToCart event after AddCartLines data action completed\n * @param _inputs Data action inputs\n * @param cart New cart object after cart lines have been added\n * @param actionContext Action context\n */\nconst afterAddToCart = async (_inputs: IActionInput | IActionInput[], cart: Cart | Cart[], actionContext: IActionContext) => {\n if (window && window._msdyn365 && window._msdyn365.telemetry) {\n const cartObject = Array.isArray(cart) ? cart[0] : cart;\n const addedCartLines = actionContext.requestContext.telemetryData.addedCartLines;\n let addedProducts: IProductInfo[] = [];\n\n // Collect info on products added to cart\n if (addedCartLines) {\n try {\n addedProducts = await getProductInfoFromCartLinesAsync(addedCartLines, actionContext);\n } catch (error) {\n actionContext.telemetry.error('AddCartLines post-data action hook failed to process cart lines.', error);\n }\n }\n\n // Fire AddToCart event\n window._msdyn365.telemetry.logEvent(TelemetryEvent.AddToCart, {\n cartId: cartObject.Id,\n cartVersion: cartObject.Version ? cartObject.Version.toString() : '',\n products: addedProducts,\n orderId: cartObject.OrderNumber ? cartObject.OrderNumber.toString() : ''\n });\n }\n};\n\ncreateDataActionHook({\n actionId: '@msdyn365-commerce/retail-proxy/Carts/AddCartLines',\n postReaderHook: afterAddToCart,\n preReaderHook: beforeAddToCart\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createDataActionHook, IActionContext, IActionInput, IMSDyn365Window } from '@msdyn365-commerce/core';\nimport { Cart } from '@msdyn365-commerce/retail-proxy';\nimport { IProductInfo, TelemetryEvent } from '@msdyn365-commerce/telemetry-internal';\nimport { getProductInfoFromCartLinesAsync } from './telemetry.action.helper';\n\ndeclare let window: IMSDyn365Window;\n\n/**\n * CopyCart data action pre-hook\n * @param inputs Data action inputs\n */\nconst beforeCopyCart = async (inputs: IActionInput | IActionInput[]) => {\n // placeholder\n};\n\n/**\n * Fires an CheckOut event after CopyCart data action completed\n * @param _inputs Data action inputs\n * @param cart New checkout cart\n * @param actionContext Action context\n */\nconst afterCopyCart = async (_inputs: IActionInput | IActionInput[], cart: Cart | Cart[], actionContext: IActionContext) => {\n if (window && window._msdyn365 && window._msdyn365.telemetry) {\n const cartObject = Array.isArray(cart) ? cart[0] : cart;\n let cartLineProductUnits: IProductInfo[] = [];\n\n // Collect info on products in the cart\n if (cartObject && cartObject.CartLines && Array.isArray(cartObject.CartLines) && cartObject.CartLines.length > 0) {\n try {\n cartLineProductUnits = await getProductInfoFromCartLinesAsync(cartObject.CartLines, actionContext);\n } catch (error) {\n actionContext.telemetry.error('CopyCart post-data action hook failed to process cart lines.', error);\n }\n }\n\n // Fire Checkout event\n window._msdyn365.telemetry.logEvent(TelemetryEvent.CheckOut, {\n cartId: cartObject.Id,\n cartVersion: cartObject.Version ? cartObject.Version.toString() : '',\n products: cartLineProductUnits,\n orderId: cartObject.OrderNumber ? cartObject.OrderNumber.toString() : ''\n });\n }\n};\n\ncreateDataActionHook({\n actionId: '@msdyn365-commerce/retail-proxy/Carts/Copy',\n postReaderHook: afterCopyCart,\n preReaderHook: beforeCopyCart\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createDataActionHook, IActionContext, IActionInput } from '@msdyn365-commerce/core';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { TelemetryEvent } from '@msdyn365-commerce/telemetry-internal';\nimport { getProductInfoFromSimpleProduct } from './telemetry.action.helper';\n\nconst beforeGetById = async (inputs: IActionInput | IActionInput[]) => {\n // placeholder\n};\n\nconst afterGetById = async (\n _inputs: IActionInput | IActionInput[],\n simpleProduct: SimpleProduct | SimpleProduct[],\n actionContext: IActionContext\n) => {\n simpleProduct = await Promise.resolve(Array.isArray(simpleProduct) ? simpleProduct[0] : simpleProduct);\n\n // If simple product result is defined run the post hook\n if (simpleProduct) {\n const productInfo = getProductInfoFromSimpleProduct(simpleProduct);\n actionContext.requestContext.telemetryData[productInfo.productSku] = productInfo;\n actionContext.requestContext.telemetryData[TelemetryEvent.ProductPageView] = productInfo ? [productInfo] : [];\n }\n};\n\ncreateDataActionHook({\n actionId: '@msdyn365-commerce/retail-proxy/Products/GetById',\n postReaderHook: afterGetById,\n preReaderHook: beforeGetById\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createDataActionHook, IActionContext, IActionInput } from '@msdyn365-commerce/core';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { getProductInfoFromSimpleProduct } from './telemetry.action.helper';\n\nconst beforeGetByIds = async (inputs: IActionInput | IActionInput[]) => {\n // placeholder\n};\n\nconst afterGetByIds = async (\n _inputs: IActionInput | IActionInput[],\n simpleProducts: SimpleProduct | SimpleProduct[],\n actionContext: IActionContext\n) => {\n if (!Array.isArray(simpleProducts)) {\n simpleProducts = [simpleProducts];\n }\n\n simpleProducts.forEach(async product => {\n if (product) {\n product = await Promise.resolve(product);\n const productInfo = getProductInfoFromSimpleProduct(product);\n actionContext.requestContext.telemetryData[productInfo.productSku] = productInfo;\n }\n });\n};\n\ncreateDataActionHook({\n actionId: '@msdyn365-commerce/retail-proxy/Products/GetByIds',\n postReaderHook: afterGetByIds,\n preReaderHook: beforeGetByIds\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createDataActionHook, IActionContext, IActionInput } from '@msdyn365-commerce/core';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { getProductInfoFromSimpleProduct } from './telemetry.action.helper';\n\nconst beforeGetVariantsByDimensionValues = async (inputs: IActionInput | IActionInput[]) => {\n // placeholder\n};\n\nconst afterGetVariantsByDimensionValues = async (\n _inputs: IActionInput | IActionInput[],\n simpleProducts: SimpleProduct | SimpleProduct[],\n actionContext: IActionContext\n) => {\n if (!Array.isArray(simpleProducts)) {\n simpleProducts = [simpleProducts];\n }\n\n simpleProducts.forEach(async product => {\n if (product) {\n product = await Promise.resolve(product);\n const productInfo = getProductInfoFromSimpleProduct(product);\n actionContext.requestContext.telemetryData[productInfo.productSku] = productInfo;\n }\n });\n};\n\ncreateDataActionHook({\n actionId: '@msdyn365-commerce/retail-proxy/Products/GetVariantsByDimensionValues',\n postReaderHook: afterGetVariantsByDimensionValues,\n preReaderHook: beforeGetVariantsByDimensionValues\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createDataActionHook, IActionContext, IActionInput, IMSDyn365Window } from '@msdyn365-commerce/core';\nimport { SalesOrder } from '@msdyn365-commerce/retail-proxy';\nimport { IProductInfo, IProductTransaction, TelemetryEvent } from '@msdyn365-commerce/telemetry-internal';\nimport { getProductInfoFromCartLinesAsync } from './telemetry.action.helper';\n\ndeclare let window: IMSDyn365Window;\n\n/**\n * Checkout data action pre-hook\n * @param inputs Data action inputs\n */\nconst beforePurchase = async (inputs: IActionInput | IActionInput[]) => {\n // placeholder\n};\n\n/**\n * Fires a Purchase event after Checkout data action completed\n * @param _inputs Data action inputs\n * @param salesOrder Sales order for transaction\n * @param actionContext Action context\n */\nconst afterPurchase = async (\n _inputs: IActionInput | IActionInput[],\n salesOrder: SalesOrder | SalesOrder[],\n actionContext: IActionContext\n) => {\n if (window && window._msdyn365 && window._msdyn365.telemetry) {\n const salesObject = Array.isArray(salesOrder) ? salesOrder[0] : salesOrder;\n let saleLineProductUnits: IProductInfo[] = [];\n\n // Collect info on products in the sales order\n if (salesObject && salesObject.SalesLines && Array.isArray(salesObject.SalesLines) && salesObject.SalesLines.length > 0) {\n try {\n saleLineProductUnits = await getProductInfoFromCartLinesAsync(salesObject.SalesLines, actionContext);\n } catch (error) {\n actionContext.telemetry.error('Checkout post-data action hook failed to process cart lines.', error);\n }\n }\n\n // Store the purchased product information so that we can avoid \"code triggered\" remove from cart telemetry event.\n actionContext.requestContext.telemetryData[TelemetryEvent.Purchase] = {\n id: salesObject.Id,\n affiliation: salesObject.ChannelId ? salesObject.ChannelId.toString() : '',\n revenue: salesObject.NetAmountWithoutTax,\n tax: salesObject.TaxAmount,\n // shippingCost?: // Confirm if it is delivery mode charge amount;\n products: saleLineProductUnits\n };\n\n // Fire Purchase event\n window._msdyn365.telemetry.logEvent(\n TelemetryEvent.Purchase,\n actionContext.requestContext.telemetryData[TelemetryEvent.Purchase]\n );\n }\n};\n\ncreateDataActionHook({\n actionId: '@msdyn365-commerce/retail-proxy/Carts/Checkout',\n postReaderHook: afterPurchase,\n preReaderHook: beforePurchase\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createDataActionHook, IActionContext, IActionInput } from '@msdyn365-commerce/core';\nimport { Cart } from '@msdyn365-commerce/retail-proxy';\n\nconst beforeRead = async (inputs: IActionInput | IActionInput[]) => {\n // placeholder\n};\n\nconst afterRead = async (_inputs: IActionInput | IActionInput[], cart: Cart | Cart[], actionContext: IActionContext) => {\n try {\n const activeCart = await Promise.resolve(Array.isArray(cart) ? cart[0] : cart);\n actionContext.requestContext.telemetryData.activeCart = activeCart;\n } catch (e) {\n actionContext.telemetry.debug('ReadCart post-data action hook failed.', e);\n }\n};\n\ncreateDataActionHook({\n actionId: '@msdyn365-commerce/retail-proxy/Carts/Read',\n postReaderHook: afterRead,\n preReaderHook: beforeRead\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createDataActionHook, IActionContext, IActionInput, IMSDyn365Window, TelemetryEvent } from '@msdyn365-commerce/core';\nimport { Cart, CartLine, IDataServiceRequest, IRemoveCartLinesParam } from '@msdyn365-commerce/retail-proxy';\nimport { IProductInfo, IProductTransaction } from '@msdyn365-commerce/telemetry-internal';\nimport { getProductInfoFromCartLinesAsync } from './telemetry.action.helper';\n\ndeclare let window: IMSDyn365Window;\n\n/**\n * Saves info on cart lines removed before calling data action\n * @param inputs Data action inputs\n * @param actionContext Action context\n */\nconst beforeRemoveFromCart = async (inputs: IActionInput | IActionInput[], actionContext: IActionContext) => {\n try {\n const actionInput = Array.isArray(inputs) ? inputs[0] : inputs;\n\n // If cart lines were removed\n if (actionInput.queryParams && typeof actionInput.queryParams === 'function') {\n const removeCartLinesParams = actionInput.queryParams();\n if (removeCartLinesParams && removeCartLinesParams.cartLineIds) {\n // Save info on removed cart lines for post data action hook to pick up\n actionContext.requestContext.telemetryData.removedCartLineIds = removeCartLinesParams.cartLineIds;\n return;\n }\n }\n actionContext.telemetry.debug('RemoveFromCart pre-data action hook failed - No removed cart lines found');\n } catch (e) {\n actionContext.telemetry.debug('RemoveFromCart pre-data action hook failed.', e);\n }\n};\n\n/**\n * Fires a RemoveFromCart event after RemoveCartLines data action completed\n * @param _inputs Data action inputs\n * @param cart New cart object after cart lines have been removed\n * @param actionContext Action context\n */\nconst afterRemoveFromCart = async (_inputs: IActionInput | IActionInput[], cart: Cart | Cart[], actionContext: IActionContext) => {\n if (window && window._msdyn365 && window._msdyn365.telemetry) {\n const cartObject = Array.isArray(cart) ? cart[0] : cart;\n const removeCartLineIds = actionContext.requestContext.telemetryData.removedCartLineIds;\n const activeCart = actionContext.requestContext.telemetryData.activeCart;\n const productTransaction = actionContext.requestContext.telemetryData[TelemetryEvent.Purchase];\n const removedCartLines: CartLine[] = [];\n let removedProducts: IProductInfo[] = [];\n\n // Collect info on products removed from cart\n if (removeCartLineIds && activeCart && activeCart.CartLines) {\n activeCart.CartLines.forEach((cartLine: CartLine) => {\n if (\n cartLine.ProductId &&\n removeCartLineIds.indexOf(cartLine.LineId ? cartLine.LineId : '') !== -1 &&\n !(\n productTransaction &&\n productTransaction.products &&\n productTransaction.products.some(product => +product.productSku === cartLine.ProductId)\n )\n ) {\n removedCartLines.push(cartLine);\n }\n });\n\n if (removedCartLines.length > 0) {\n try {\n removedProducts = await getProductInfoFromCartLinesAsync(removedCartLines, actionContext);\n } catch (error) {\n actionContext.telemetry.error('RemoveCartLines post-data action hook failed to process cart lines.', error);\n }\n }\n }\n\n // Fire RemoveFromCart event if cart lines were removed\n if (removedCartLines && removedCartLines.length > 0) {\n window._msdyn365.telemetry.logEvent(TelemetryEvent.RemoveFromCart, {\n cartId: cartObject.Id,\n cartVersion: cartObject.Version ? cartObject.Version.toString() : '',\n products: removedProducts,\n orderId: cartObject.OrderNumber ? cartObject.OrderNumber.toString() : ''\n });\n } else {\n actionContext.telemetry.debug('No RemoveFromCart event fired, no removed cart lines found');\n }\n }\n};\n\ncreateDataActionHook({\n actionId: '@msdyn365-commerce/retail-proxy/Carts/RemoveCartLines',\n postReaderHook: afterRemoveFromCart,\n preReaderHook: beforeRemoveFromCart\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core-internal';\nimport { CartLine, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { getByIdAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport { IProductInfo } from '@msdyn365-commerce/telemetry-internal';\n\n/**\n * Converts cart line products into promise of array of product info\n * @param cartLines Cart Lines with product info to collect\n * @param actionContext Action context\n * @returns Array of product info\n */\nexport const getProductInfoFromCartLinesAsync = async (cartLines: CartLine[], actionContext: IActionContext): Promise => {\n if (actionContext.requestContext.channel === undefined) {\n throw new Error('Unable to make product call, channel ID not provided');\n }\n\n const productPromises: Promise[] = [];\n\n // Call GetById API for all products in cartLines\n for (let i = 0; i < cartLines.length; i++) {\n // eslint-disable-next-line security/detect-object-injection -- bracket object notation with user input present leads to eslint security issue.\n const cartLine: CartLine = cartLines[i];\n\n if (cartLine.ProductId) {\n // The product id in cartLine actually contains recordId and not master product id so we can use it up here to lookup product.\n productPromises.push(\n getByIdAsync({ callerContext: actionContext }, cartLine.ProductId, actionContext.requestContext.channel.RecordId).then(\n result => {\n // Construct basic IProductInfo object for product\n const productInfo = getProductInfoFromSimpleProduct(result);\n\n // Attach fields from the CartLine\n productInfo.productPrice = cartLine.Price ? cartLine.Price.toString() : '';\n productInfo.productQuantity = cartLine.Quantity ? cartLine.Quantity.toString() : '';\n\n return productInfo;\n },\n reason => {\n throw new Error(`Failed to get product details for product ${cartLine.ProductId}.\\n${reason}`);\n }\n )\n );\n }\n }\n\n // Return promise for array of product results\n return Promise.all(productPromises);\n};\n\n/**\n * Converts a SimpleProduct object into an IProductInfo object\n * @param simpleProduct Simple Product object\n * @returns Populated IProductInfo\n */\nexport const getProductInfoFromSimpleProduct = (simpleProduct: SimpleProduct): IProductInfo => {\n const recordId = simpleProduct.RecordId || '';\n\n return {\n // If master product id is not available then product record id is master product id\n productId: simpleProduct.MasterProductId ? simpleProduct.MasterProductId.toString() : recordId.toString(),\n productSku: recordId ? recordId.toString() : '',\n productName: simpleProduct.Name || simpleProduct.Description || '',\n productPrice: simpleProduct.Price ? simpleProduct.Price.toString() : '',\n productChannelId: '', // Not needed for each product, sent as part of all events\n productChannelName: '',\n productCategoryId: '',\n productCategoryName: '',\n productQuantity: '', // Cannot be deteremined from SimpleProduct, will be added from CartLine later\n productCurrency: '' // Not needed for each product, sent as part of all events with product data\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createDataActionHook, IActionContext, IActionInput, TelemetryEvent } from '@msdyn365-commerce/core';\nimport { IMSDyn365Window } from '@msdyn365-commerce/core-internal';\nimport { Cart, CartLine, IDataServiceRequest, IUpdateCartLinesParam } from '@msdyn365-commerce/retail-proxy';\nimport { IProductInfo } from '@msdyn365-commerce/telemetry-internal';\nimport { getProductInfoFromCartLinesAsync } from './telemetry.action.helper';\n\ndeclare let window: IMSDyn365Window;\n\n/**\n * Saves info on cart lines updated before calling data action\n * @param inputs Data action inputs\n * @param actionContext Action context\n */\nconst beforeUpdateCart = async (inputs: IActionInput | IActionInput[], actionContext: IActionContext) => {\n try {\n const actionInput = Array.isArray(inputs) ? inputs[0] : inputs;\n\n // If cart lines were updated\n if (actionInput.queryParams && typeof actionInput.queryParams === 'function') {\n const updateCartLinesParams = actionInput.queryParams();\n if (updateCartLinesParams && updateCartLinesParams.cartLines) {\n // Save info on updated cart lines for post data action hook to pick up\n actionContext.requestContext.telemetryData.updatedCartLines = updateCartLinesParams.cartLines;\n return;\n }\n }\n actionContext.telemetry.debug('UpdateCart pre-data action hook failed - No updated cart lines found');\n } catch (e) {\n actionContext.telemetry.debug('UpdateCart pre-data action hook failed.', e);\n }\n};\n\n/**\n * Fires an UpdateInCart event after UpdateCartLines data action completed\n * @param _inputs Data action inputs\n * @param cart New cart object after cart lines have been added\n * @param actionContext Action context\n */\nconst afterUpdateCart = async (_inputs: IActionInput | IActionInput[], cart: Cart | Cart[], actionContext: IActionContext) => {\n if (window && window._msdyn365 && window._msdyn365.telemetry) {\n const cartObject = Array.isArray(cart) ? cart[0] : cart;\n const updatedCartLines = actionContext.requestContext.telemetryData.updatedCartLines;\n let updatedProducts: IProductInfo[] = [];\n\n // Collect info on products updated in cart\n if (updatedCartLines) {\n try {\n updatedProducts = await getProductInfoFromCartLinesAsync(updatedCartLines, actionContext);\n } catch (error) {\n actionContext.telemetry.error('UpdateCartLines post-data action hook failed to process cart lines.', error);\n }\n }\n\n // Fire UpdateInCart event\n window._msdyn365.telemetry.logEvent(TelemetryEvent.UpdateInCart, {\n cartId: cartObject.Id,\n cartVersion: cartObject.Version ? cartObject.Version.toString() : '',\n products: updatedProducts,\n orderId: cartObject.OrderNumber ? cartObject.OrderNumber.toString() : ''\n });\n }\n};\n\ncreateDataActionHook({\n actionId: '@msdyn365-commerce/retail-proxy/Carts/UpdateCartLines',\n postReaderHook: afterUpdateCart,\n preReaderHook: beforeUpdateCart\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport MsDyn365, { IActionContext } from '@msdyn365-commerce/core';\nimport { action, computed, observable } from 'mobx';\n\nimport { IDistributorInfo, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport {\n IListMapViewState,\n ILoadMapApiInput,\n IDistributorSelectionStateContext,\n IDistributorLocation,\n IDistributorSelectorStateManager\n} from './i-distributor-selection-state-manager';\n\nimport { IMapWindow, MapLocationsResult } from './models/map-data';\n\ndeclare const window: IMapWindow;\n\n/**\n * Instance of IDistributorSelectorStateManager manager that uses Map service\n * for geo location.\n */\nexport class MapDistributorSelectorStateManager implements IDistributorSelectorStateManager {\n @observable public isMapApiLoaded?: boolean;\n @observable public selectedDistributorId?: number;\n @observable public hideDistributorWarning?: boolean;\n @observable public listMapViewState: IListMapViewState = { displayList: true, displayMap: false };\n @observable public isMapModuleLoaded?: boolean;\n @observable public showDistributorDetailsOnMap?: boolean;\n @observable public distributorList?: IDistributorInfo[];\n @observable protected _distributorDetailContext?: IDistributorSelectionStateContext;\n @observable protected _distributorSelectorContext?: IDistributorSelectionStateContext;\n\n private readonly SERVICE_ENDPOINT: string = 'https://dev.virtualearth.net/REST/v1/';\n private readonly MAP_API_ENDPOINT: string = 'https://www.bing.com/api/maps/mapcontrol?callback=mapAPIReady';\n\n @computed public get isDistributorSelectorDialogOpen(): Readonly {\n return this._distributorSelectorContext !== undefined;\n }\n\n @computed public get isDistributorDetailPopupOpen(): Readonly {\n return this._distributorDetailContext !== undefined;\n }\n\n @computed public get distributorSelectorContext(): Readonly {\n return this._distributorSelectorContext;\n }\n\n private readonly hideDistributorWarningLocalStorageKey: string = '_msdyn365__hideDistributorWarning_';\n\n constructor() {\n this.isMapModuleLoaded = false;\n this.showDistributorDetailsOnMap = true;\n\n const hideDistributorWarning = this._readFromToCookie(this.hideDistributorWarningLocalStorageKey);\n try {\n const distributorWarning = hideDistributorWarning ? JSON.parse(hideDistributorWarning) : false;\n\n if (distributorWarning) {\n this.hideDistributorWarning = distributorWarning;\n }\n } catch {\n this.hideDistributorWarning = false;\n }\n }\n\n @action\n public async toggleListMapViewState(): Promise {\n this.listMapViewState = {\n displayList: !this.listMapViewState.displayList,\n displayMap: !this.listMapViewState.displayMap\n };\n }\n\n @action\n public async setMapModuleLoaded(input: boolean): Promise {\n this.isMapModuleLoaded = input;\n }\n\n @action\n public async setDistributorsList(input: IDistributorInfo[]): Promise {\n this.distributorList = input;\n }\n\n @action\n public async setSelectedDistributorId(distributorId: number | undefined): Promise {\n this.selectedDistributorId = distributorId;\n }\n\n @action\n public async hideWarningMessage(writeToCookie: boolean = false) {\n this.hideDistributorWarning = true;\n if (writeToCookie) {\n this._writeToCookie(this.hideDistributorWarningLocalStorageKey, JSON.stringify(true));\n }\n }\n\n @action\n public async updateDistributorMapVisibility(input: boolean) {\n this.showDistributorDetailsOnMap = input;\n }\n\n @action\n public async openDistributorSelectorDialog(input: IDistributorSelectionStateContext): Promise {\n if (this._distributorSelectorContext) {\n throw new Error('Distributor selector dialog is already opened');\n }\n\n this._distributorSelectorContext = input;\n }\n\n @action\n public async openDistributorDetailPopup(input: IDistributorSelectionStateContext): Promise {\n if (this._distributorDetailContext) {\n throw new Error('Distributor detail popup is already opened');\n }\n\n this._distributorDetailContext = input;\n }\n\n @action\n public async closeDistributorSelectorDialog(): Promise {\n this._distributorSelectorContext = undefined;\n }\n\n @action\n public async closeDistributorDetailPopup(): Promise {\n this._distributorDetailContext = undefined;\n }\n\n @action\n public async geoLocate(searchTerm: string, actionContext: IActionContext): Promise {\n if (\n !searchTerm ||\n !actionContext?.requestContext?.channel?.BingMapsApiKey ||\n !actionContext?.requestContext?.channel?.BingMapsEnabled\n ) {\n return undefined;\n }\n\n let searchContent: string = searchTerm;\n\n const jsonp = `mapSearchCallback_${crypto.getRandomValues(new Uint32Array(1))[0]}`;\n\n if (actionContext.requestContext.channel.ChannelCountryRegionISOCode) {\n searchContent = `${searchTerm.trim()} ${actionContext.requestContext.channel.ChannelCountryRegionISOCode}`;\n }\n\n const query = encodeURI(searchContent);\n const key = encodeURI(actionContext.requestContext.channel.BingMapsApiKey);\n\n const geolocationApiUrl =\n actionContext.requestContext.app &&\n actionContext.requestContext.app.config &&\n actionContext.requestContext.app.config.geolocationApiUrl;\n const requestUrl = `${\n geolocationApiUrl ? geolocationApiUrl : this.SERVICE_ENDPOINT\n }/Locations?query=${query}&key=${key}&jsonp=${jsonp}`;\n\n return new Promise(resolve => {\n const script = document.createElement('script');\n script.setAttribute('type', 'text/javascript');\n script.setAttribute('src', requestUrl);\n\n window[jsonp] = (data: MapLocationsResult) => {\n delete window[jsonp];\n script.remove();\n\n if (data && data.resourceSets && data.resourceSets.length > 0 && data.resourceSets[0].resources.length > 0) {\n resolve({\n latitude: data.resourceSets[0].resources[0].point.coordinates[0],\n longitude: data.resourceSets[0].resources[0].point.coordinates[1]\n });\n }\n\n resolve(undefined);\n };\n\n document.body.appendChild(script);\n });\n }\n\n @action\n public async loadMapApi(input: ILoadMapApiInput): Promise {\n if (StringExtensions.isNullOrEmpty(input.key)) {\n return Promise.resolve();\n }\n\n const isScriptAlreadyLoaded = !!document?.getElementById('msdyn_map-api-script');\n\n if (isScriptAlreadyLoaded) {\n if (window) {\n const currentWindowAPI = window.mapAPIReady;\n window.mapAPIReady = () => {\n if (currentWindowAPI) {\n currentWindowAPI();\n }\n this.isMapApiLoaded = true;\n };\n }\n // Prevents from loading multiple script into the body\n return Promise.resolve();\n }\n\n const url = `${this.MAP_API_ENDPOINT}${input.key ? `&key=${input.key}` : ''}${input.lang ? `&setLang=${input.lang}` : ''}${\n input.market ? `&setMkt=${input.market}` : ''\n }`;\n\n return new Promise((resolve, reject) => {\n const script = document?.createElement('script');\n script.type = 'text/javascript';\n script.async = true;\n script.defer = true;\n script.src = url;\n script.id = 'msdyn_map-api-script';\n if (window) {\n window.mapAPIReady = () => {\n this.isMapApiLoaded = true;\n resolve();\n };\n }\n script.addEventListener('error', (error: string | Event) => {\n reject(error);\n });\n document?.body?.appendChild(script);\n });\n }\n\n private _writeToCookie(key: string, value: string | undefined): void {\n if (!key || !value) {\n return;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n storage.setItem(key, value);\n }\n }\n\n private _readFromToCookie(key: string): string | undefined {\n if (!key) {\n return undefined;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n const cookieValue = storage.getItem(key);\n if (cookieValue) {\n return cookieValue;\n }\n }\n\n return undefined;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction, IAction, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\nimport { GenericInput, getGenericAction } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IDistributorSelectorStateManager } from './i-distributor-selection-state-manager';\nimport { MapDistributorSelectorStateManager } from './map-distributor-selector-state-manager';\n\nexport function createDistributorSelectorStateInput(\n result: IDistributorSelectorStateManager\n): GenericInput {\n return new GenericInput('mapDSSM', result, 'IDistributorSelectorStateManager');\n}\n\nconst createDistributorSelectorStateInputInternal = (inputData: ICreateActionContext>): IActionInput => {\n return createDistributorSelectorStateInput(new MapDistributorSelectorStateManager());\n};\n\nexport const getGenericActionDataAction = createObservableDataAction({\n action: >getGenericAction,\n input: createDistributorSelectorStateInputInternal\n});\n\nexport default getGenericActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { IExpLogger } from '@msdyn365-commerce/telemetry-internal';\n\n/**\n * A basic implementation of the ExperimentationProvider interface used for testing\n */\nclass MsDyn365ExpTestConnectorListener implements IExpLogger {\n private userId: string = '';\n public initializeClientSide(config: any, userId: string): boolean {\n this.userId = userId;\n console.log(`Listener initialize called with config ${JSON.stringify(config)} and userId ${userId}`);\n return true;\n }\n public logEvent(eventName: string, payload: any, attributes?: any): void {\n console.log(`tracking events with event type - ${eventName}, payload - ${payload}, user id - ${this.userId}`);\n }\n}\n\nconst connectorListener = new MsDyn365ExpTestConnectorListener();\nexport default connectorListener;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any, max-lines */\nimport { IExperimentationProvider, IExperimentsResult, ISecretManager, IVariants, State } from '@msdyn365-commerce/core';\n/**\n * A basic implementation of the ExperimentationProvider interface used for testing\n */\nclass MsDyn365ExpTestConnector implements IExperimentationProvider {\n private variantSet1: IVariants[] = [\n {\n variantId: 'var1',\n experimentId: 'expid1'\n },\n {\n variantId: 'var1',\n experimentId: 'expid4'\n },\n {\n variantId: 'var1',\n experimentId: 'expid6'\n },\n {\n variantId: 'var1',\n experimentId: 'expid7'\n },\n {\n variantId: 'var1',\n experimentId: 'expid8'\n },\n {\n variantId: 'var1',\n experimentId: 'expid9'\n },\n {\n variantId: 'var1',\n experimentId: 'expid10'\n },\n {\n variantId: 'var1',\n experimentId: 'expid11'\n },\n {\n variantId: 'var1',\n experimentId: 'expid12'\n }\n ];\n\n private variantSet2: IVariants[] = [\n {\n variantId: 'var2',\n experimentId: 'expid1'\n },\n {\n variantId: 'var2',\n experimentId: 'expid5'\n },\n {\n variantId: 'var2',\n experimentId: 'expid7'\n },\n {\n variantId: 'var2',\n experimentId: 'expid8'\n },\n {\n variantId: 'var2',\n experimentId: 'expid9'\n },\n {\n variantId: 'var2',\n experimentId: 'expid10'\n },\n {\n variantId: 'var2',\n experimentId: 'expid11'\n },\n {\n variantId: 'var2',\n experimentId: 'expid12'\n }\n ];\n\n private variantSet3: IVariants[] = [\n {\n variantId: 'var1',\n experimentId: 'expid5'\n },\n {\n variantId: 'var2',\n experimentId: 'expid13'\n },\n {\n variantId: 'var2',\n experimentId: 'expid14'\n },\n {\n variantId: 'var2',\n experimentId: 'expid15'\n },\n {\n variantId: 'var2',\n experimentId: 'expid16'\n },\n {\n variantId: 'var2',\n experimentId: 'expid17'\n },\n {\n variantId: 'var2',\n experimentId: 'expid18'\n },\n {\n variantId: 'var2',\n experimentId: 'expid19'\n },\n {\n variantId: 'var2',\n experimentId: 'expid20'\n },\n {\n variantId: 'var2',\n experimentId: 'expid21'\n },\n {\n variantId: 'var2',\n experimentId: 'expid22'\n },\n {\n variantId: 'var2',\n experimentId: 'expid23'\n },\n {\n variantId: 'var2',\n experimentId: 'expid24'\n },\n {\n variantId: 'var2',\n experimentId: 'expid25'\n }\n ];\n\n private variantSet4: IVariants[] = [\n {\n variantId: 'var1',\n experimentId: 'expid5'\n },\n {\n variantId: 'var1',\n experimentId: 'expid1'\n },\n {\n variantId: 'var1',\n experimentId: 'expid13'\n },\n {\n variantId: 'var1',\n experimentId: 'expid14'\n },\n {\n variantId: 'var1',\n experimentId: 'expid15'\n },\n {\n variantId: 'var1',\n experimentId: 'expid16'\n },\n {\n variantId: 'var1',\n experimentId: 'expid17'\n },\n {\n variantId: 'var1',\n experimentId: 'expid18'\n },\n {\n variantId: 'var1',\n experimentId: 'expid19'\n },\n {\n variantId: 'var1',\n experimentId: 'expid20'\n },\n {\n variantId: 'var1',\n experimentId: 'expid21'\n },\n {\n variantId: 'var1',\n experimentId: 'expid22'\n },\n {\n variantId: 'var1',\n experimentId: 'expid23'\n },\n {\n variantId: 'var1',\n experimentId: 'expid24'\n },\n {\n variantId: 'var1',\n experimentId: 'expid25'\n }\n ];\n\n public getConfigForClientSideInit(): Promise {\n return Promise.resolve({});\n }\n public initializeClientSide(config: any): boolean {\n console.log(`Initialize client side called on MsDyn365ExpTestConnector with config ${config}`);\n return true;\n }\n\n public getExperiments(): Promise {\n return Promise.resolve({\n name: 'msdyn365-exp-test-2',\n experiments: [\n {\n id: 'expid1',\n friendlyName: 'experiment-1',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n link: 'www.msdyn365-exp-test-connector/expid1',\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var3',\n friendlyName: 'variant-3',\n status: State.Draft,\n weight: '0.2'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid2',\n friendlyName: 'experiment-2',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Paused,\n link: 'www.msdyn365-exp-test-connector/expid2',\n variations: [\n {\n id: 'var3',\n friendlyName: 'variant-3',\n status: State.Paused,\n weight: '1.0'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid3',\n friendlyName: 'experiment-3',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Archived,\n variations: [\n {\n id: 'var4',\n friendlyName: 'variant-4',\n status: State.Archived,\n weight: '1.0'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid4',\n friendlyName: 'experiment-4',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid5',\n friendlyName: 'experiment-5',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid6',\n friendlyName: 'experiment-6',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid7',\n friendlyName: 'experiment-7',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid8',\n friendlyName: 'experiment-8',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid9',\n friendlyName: 'experiment-9',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid10',\n friendlyName: 'experiment-10',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid11',\n friendlyName: 'experiment-11',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid12',\n friendlyName: 'experiment-12',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid13',\n friendlyName: 'experiment-13',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid14',\n friendlyName: 'experiment-14',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid15',\n friendlyName: 'experiment-15',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid16',\n friendlyName: 'experiment-16',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid17',\n friendlyName: 'experiment-17',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid18',\n friendlyName: 'experiment-18',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid19',\n friendlyName: 'experiment-19',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid20',\n friendlyName: 'experiment-20',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid21',\n friendlyName: 'experiment-21',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid22',\n friendlyName: 'experiment-22',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid23',\n friendlyName: 'experiment-23',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid24',\n friendlyName: 'experiment-24',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid25',\n friendlyName: 'experiment-25',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n }\n ]\n });\n }\n public getVariantsForUser(userId: string, attributes?: { [index: string]: string } | undefined): IVariants[] {\n if (userId.match(/^[0-3].*$/)) {\n return this.variantSet1;\n } else if (userId.match(/^[4-7].*$/)) {\n return this.variantSet2;\n } else if (userId.match(/^[8-9|a-b].*$/)) {\n return this.variantSet3;\n } else {\n return this.variantSet4;\n }\n }\n public activateExperiment(userId: string, experiments: IVariants[], attributes?: { [index: string]: string } | undefined): boolean {\n console.log(\n `Active experiment called on MsDyn365ExpTestConnector with userId: ${userId}, experiments: ${JSON.stringify(\n experiments\n )}, attributes: ${JSON.stringify(attributes)}`\n );\n return true;\n }\n public initialize(config: any, secretManager?: ISecretManager): Promise {\n console.log(`MsDyn365 Exp Test Connector called with config: ${JSON.stringify(config)}`);\n return Promise.resolve(true);\n }\n}\n\nconst connector = new MsDyn365ExpTestConnector();\nexport default connector;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICommerceApiSettings,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { ChannelIdentity } from '@msdyn365-commerce/retail-proxy';\nimport { getChannelsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\nimport { buildCacheKey, QueryResultSettingsProxy } from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Interface of Channel Identity..\n */\ninterface IChannelIdentity {\n channelIdentities: ChannelIdentity[];\n}\n\n/**\n * Calls the Retail API and returns the channels.\n * @returns - List of channel identity.\n */\nconst getChannels = () => async (ctx: IActionContext): Promise => {\n return getChannelsAsync({\n callerContext: ctx,\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(ctx)\n });\n};\n\n/**\n * Action input.\n */\nexport class GetChannelIdentitiesInput implements IActionInput {\n private readonly apiSettings: ICommerceApiSettings;\n\n constructor(apiSettings: ICommerceApiSettings) {\n this.apiSettings = apiSettings;\n }\n\n public getCacheKey = () => buildCacheKey('ChannelIdentities', this.apiSettings);\n\n public getCacheObjectType = () => 'ChannelIdentities';\n\n public dataCacheType = (): CacheType => 'request';\n}\n\n/**\n * Creates the input required to make the retail api call.\n * @param inputData - Action Data Input.\n * @returns - Input object.\n */\nconst createChannelIdentitiesInput = (inputData: ICreateActionContext>) => {\n return new GetChannelIdentitiesInput(inputData.requestContext.apiSettings);\n};\n\n/**\n * Get channels action.\n * @param input - Input data.\n * @param context - Action context.\n * @returns - Channel Identity.\n */\nexport async function getChannelsAction(input: GetChannelIdentitiesInput, context: IActionContext): Promise {\n if (!context) {\n throw new Error('getChannelsAction - Action context cannot be null/undefined');\n }\n\n let channels: ChannelIdentity[] = [];\n\n try {\n channels = await getChannels()(context);\n } catch (error) {\n throw error;\n }\n\n return { channelIdentities: channels };\n}\n\n/**\n * Get sales order with hydrations action.\n * @param id - Unique Id for data action.\n * @param context - Action context.\n * @param input - Input for data action.\n * @returns Channel api response.\n */\nexport const getChannelsActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/order-management/get-channels',\n action: >getChannelsAction,\n input: createChannelIdentitiesInput\n});\n\nexport default getChannelsActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICommerceApiSettings,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { OrgUnitLocation, SearchArea } from '@msdyn365-commerce/retail-proxy';\nimport { getOrgUnitLocationsByAreaAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/OrgUnitsDataActions.g';\nimport { buildCacheKey, QueryResultSettingsProxy } from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Interface of Org Unit Locations.\n */\ninterface IOrgUnitLocations {\n orgUnitLocations: OrgUnitLocation[];\n}\n\nconst searchArea: SearchArea = {\n Radius: Math.max(),\n DistanceUnitValue: 0 // 0 is miles\n};\n\n/**\n * Calls the Retail API and returns the orgUnitLocations.\n * @returns - List Org Unit Locations.\n */\nconst getOrgUnitLocations = () => async (ctx: IActionContext): Promise => {\n return getOrgUnitLocationsByAreaAsync(\n {\n callerContext: ctx,\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(ctx)\n },\n searchArea\n );\n};\n\n/**\n * Action input.\n */\nexport class GetOrgUnitLocationsInput implements IActionInput {\n private readonly apiSettings: ICommerceApiSettings;\n\n constructor(apiSettings: ICommerceApiSettings) {\n this.apiSettings = apiSettings;\n }\n\n public getCacheKey = () => buildCacheKey('OrgUnitLocations', this.apiSettings);\n\n public getCacheObjectType = () => 'OrgUnitLocations';\n\n public dataCacheType = (): CacheType => 'request';\n}\n\n/**\n * Creates the input required to make the retail api call.\n * @param inputData - Action Context.\n * @returns - Org Unit Location input.\n */\nconst createOrgUnitLocationsInput = (inputData: ICreateActionContext>) => {\n return new GetOrgUnitLocationsInput(inputData.requestContext.apiSettings);\n};\n\n/**\n * Get orgUnitLocations action.\n * @param input - Org UNit Locations Input.\n * @param context - Action Context.\n */\nexport async function getOrgUnitLocationsAction(input: GetOrgUnitLocationsInput, context: IActionContext): Promise {\n if (!context) {\n throw new Error('getOrgUnitLocationsAction - Action context cannot be null/undefined');\n }\n\n let orgUnitLocations: OrgUnitLocation[] = [];\n\n try {\n orgUnitLocations = await getOrgUnitLocations()(context);\n } catch (error) {\n throw error;\n }\n\n return { orgUnitLocations };\n}\n\nexport const getOrgUnitLocationsActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/order-management/get-org-unit-locations',\n action: >getOrgUnitLocationsAction,\n input: createOrgUnitLocationsInput\n});\n\nexport default getOrgUnitLocationsActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n ICommerceApiSettings,\n ICreateActionContext\n} from '@msdyn365-commerce/core';\nimport { ProductDeliveryOptions, SalesOrder, SimpleProduct, TransactionType } from '@msdyn365-commerce/retail-proxy';\nimport { getDeliveryOptionsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport {\n getSalesOrderDetailsBySalesIdAsync,\n getSalesOrderDetailsByTransactionIdAsync\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/SalesOrdersDataActions.g';\nimport {\n ArrayExtensions,\n buildCacheKey,\n getSimpleProducts,\n ObjectExtensions,\n ProductInput,\n QueryResultSettingsProxy\n} from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Sales order response interface.\n */\ninterface ISalesOrderWithHydrations {\n salesOrder: SalesOrder;\n products: SimpleProduct[];\n productDeliveryOptions?: ProductDeliveryOptions[];\n}\n\n/**\n * OrderTypes Types of orders.\n */\nexport enum orderTypes {\n salesOrder = 'salesOrder',\n transaction = 'transaction'\n}\n\n/**\n * Calls the Retail API and returns the sales order.\n * @param orderType - OrderType.\n * @param orderId - Unique OrderId for each order.\n * @returns Sales Order.\n */\nconst getSalesOrder = (orderType: string = '', orderId: string = '') => async (\n context: IActionContext\n): Promise => {\n // Local (1) searches the retail server database, and remote (2) searches\n // on the headquarters side. All (3) and none (0) are not supported.\n const localSearch = 1;\n return orderType === orderTypes.salesOrder\n ? getSalesOrderDetailsBySalesIdAsync({ callerContext: context }, orderId)\n : getSalesOrderDetailsByTransactionIdAsync({ callerContext: context }, orderId, localSearch);\n};\n\n/**\n * Calls the Retail API and returns the products.\n * @param productIds - The product ids of the product to retrieve.\n * @param channelId - The channel id for the products.\n * @returns Simple product data.\n */\nconst getProducts = (productIds: (string | number)[] = [], channelId?: number) => async (\n context: IActionContext\n): Promise => {\n const productInputs = productIds.map(\n productId => new ProductInput(productId, context.requestContext.apiSettings, channelId, undefined, context.requestContext)\n );\n return getSimpleProducts(productInputs, context);\n};\n\n/**\n * Action input.\n */\nexport class GetSalesOrderConfirmationWithHydrationsInput implements IActionInput {\n public orderType: string;\n\n public orderId: string;\n\n private readonly apiSettings: ICommerceApiSettings;\n\n constructor(orderType: string, orderId: string, apiSettings: ICommerceApiSettings) {\n this.orderType = orderType;\n this.orderId = orderId;\n this.apiSettings = apiSettings;\n }\n\n /**\n * Get cache key.\n * @returns String.\n */\n public getCacheKey = () => buildCacheKey('SalesOrderConfirmationWithHydrations', this.apiSettings);\n\n /**\n * Get cache object.\n * @returns String.\n */\n public getCacheObjectType = () => `SalesOrderConfirmationWithHydrations-${this.orderType}-${this.orderId}`;\n\n /**\n * Get cache data type.\n * @returns String.\n */\n public dataCacheType = (): CacheType => 'request';\n}\n\n/**\n * Creates the input required to make the retail api call.\n * @param inputData - Actioncontext data.\n * @returns Sales Order Input.\n */\nconst createSalesOrderConfrimationWithHydrationsInput = (inputData: ICreateActionContext) => {\n const { salesId = '', transactionId = '' } = inputData.requestContext.query || {};\n if (salesId) {\n return new GetSalesOrderConfirmationWithHydrationsInput(orderTypes.salesOrder, salesId, inputData.requestContext.apiSettings);\n } else if (transactionId) {\n return new GetSalesOrderConfirmationWithHydrationsInput(\n orderTypes.transaction,\n transactionId,\n inputData.requestContext.apiSettings\n );\n }\n throw new Error('createSalesOrderConfrimationWithHydrationsInput - No salesId or transactionId provided.');\n};\n\n/**\n * Get sales order with hydrations action.\n * @param input - Input for data action.\n * @param context - Action context.\n * @returns Sales order response.\n */\nexport async function getSalesOrderConfirmationWithHydrationsAction(\n input: GetSalesOrderConfirmationWithHydrationsInput,\n context: IActionContext\n): Promise {\n if (!context) {\n throw new Error('getSalesOrderConfirmationWithHydrationsAction - Action context cannot be null/undefined');\n }\n\n const { orderType, orderId } = input;\n\n if (!orderType || !orderId) {\n context.trace('[getSalesOrderConfirmationWithHydrationsAction] No orderType or orderId provided.');\n return {};\n }\n\n const salesOrder = await getSalesOrder(orderType, orderId)(context);\n\n if (!salesOrder) {\n context.trace('[getSalesOrderWithHydrationsAction] No salesOrder found.');\n return {};\n }\n\n // If it is salesInvoice, return salesOrder and empty products\n if (salesOrder.TransactionTypeValue === TransactionType.SalesInvoice) {\n return {\n salesOrder,\n products: []\n };\n }\n\n if (!ArrayExtensions.hasElements(salesOrder.SalesLines)) {\n context.trace('[getSalesOrderWithHydrationsAction] No salesLine found.');\n return {};\n }\n\n const productIds = salesOrder.SalesLines.map(salesLine => salesLine.ProductId ?? '');\n\n if (!ArrayExtensions.hasElements(productIds)) {\n context.trace('[getSalesOrderWithHydrationsAction] No products in saleLines found.');\n return {};\n }\n\n const products = await getProducts(productIds, salesOrder.ChannelId)(context);\n\n if (!ArrayExtensions.hasElements(products)) {\n context.trace('[getSalesOrderWithHydrationsAction] No simple products found.');\n return {};\n }\n\n const validProducts = products.filter(product => !ObjectExtensions.isNullOrUndefined(product.RecordId));\n const filterPickup = 4;\n const deliveryOptions = await getDeliveryOptionsAsync(\n { callerContext: context, queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context) },\n validProducts.map(product => product.RecordId),\n {},\n filterPickup\n )\n .then(result => {\n return result;\n })\n .catch((error: Error) => {\n context.trace(error.message);\n context.telemetry.exception(error);\n context.telemetry.debug('[getDeliveryOptionsForCartLineItems]Error executing action');\n throw new Error('[getDeliveryOptionsForCartLineItems]Error executing action');\n });\n\n return {\n salesOrder,\n products,\n deliveryOptions\n };\n}\n\n/**\n * Get sales order with hydrations action.\n * @param id - Unique Id for data action.\n * @param context - Action context.\n * @param input - Input for data action.\n * @returns Sales order response.\n */\nexport const getSalesOrderConfirmationWithHydrationsActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/order-management/get-sales-order-confirmation-with-hydrations',\n action: >getSalesOrderConfirmationWithHydrationsAction,\n input: createSalesOrderConfrimationWithHydrationsInput\n});\n\nexport default getSalesOrderConfirmationWithHydrationsActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n ICommerceApiSettings,\n ICreateActionContext\n} from '@msdyn365-commerce/core';\nimport { OrderOriginator, SalesOrdersDataActions, OrderOriginatorSearchCriteria } from '@msdyn365-commerce/retail-proxy';\nimport { buildCacheKey } from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Action input.\n */\nexport class GetOrderOriginatorsInput implements IActionInput {\n public searchCriteria: OrderOriginatorSearchCriteria = {};\n\n private readonly apiSettings: ICommerceApiSettings;\n\n public constructor(transactionIds: string[] | undefined, salesIds: string[] | undefined, apiSettings: ICommerceApiSettings) {\n this.searchCriteria = {\n TransactionIds: transactionIds,\n SalesIds: salesIds\n };\n this.apiSettings = apiSettings;\n }\n\n /**\n * GetCacheKey.\n * @returns - String.\n */\n public getCacheKey = (): string =>\n buildCacheKey(`OrderOriginators-${this.searchCriteria.TransactionIds}-${this.searchCriteria.SalesIds}`, this.apiSettings);\n\n /**\n * GetCacheObjectType.\n * @returns - String.\n */\n public getCacheObjectType = (): string => 'OrderOriginators';\n\n /**\n * DataCacheType.\n * @returns - String.\n */\n public dataCacheType = (): CacheType => 'request';\n}\n\n/**\n * Get order originators by transaction ids or sales ids action.\n * @param input - GetOrderOriginators input.\n * @param context - Channel context.\n * @returns - Originators array.\n */\nexport async function getOriginatorsAction(input: GetOrderOriginatorsInput, context: IActionContext): Promise {\n return SalesOrdersDataActions.getOrderOriginatorsAsync({ callerContext: context }, input.searchCriteria);\n}\n\n/**\n * Creates the input required to make the retail api call.\n * @param inputData -- InputData as ICreateActionContext.\n * @returns Action Input.\n */\nexport const createSalesOrderOriginatorsInput = (inputData: ICreateActionContext) => {\n const { salesId, transactionId } = inputData.requestContext.query ?? {};\n\n if (salesId) {\n return new GetOrderOriginatorsInput(undefined, [salesId], inputData.requestContext.apiSettings);\n } else if (transactionId) {\n return new GetOrderOriginatorsInput([transactionId], undefined, inputData.requestContext.apiSettings);\n }\n\n throw new Error('createSalesOrderOriginatorsInput - No salesId or transactionId provided.');\n};\n\n/**\n * GetSalesOrderOriginatorsActionDataAction.\n * @returns -- IObservableAction.\n */\nexport const getSalesOrderOriginatorsActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/order-management/get-sales-order-originators',\n action: getOriginatorsAction as IAction,\n input: createSalesOrderOriginatorsInput\n});\n\nexport default getSalesOrderOriginatorsActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n ICommerceApiSettings\n} from '@msdyn365-commerce/core';\nimport {\n ChannelReferenceLookupCriteria,\n OrderShipments,\n SalesOrder,\n SalesOrdersDataActions,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy';\nimport { buildCacheKey } from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * IOrderHistory.\n */\nexport interface IOrderHistory {\n salesOrders: OrderShipments[];\n products: SimpleProduct[];\n}\n\n/**\n * Action input.\n */\nexport class GetSalesOrderDetailsByConfirmationInput implements IActionInput {\n public channelReferenceLookupCriteria: ChannelReferenceLookupCriteria | null;\n\n public confirmationId: string | undefined;\n\n private readonly apiSettings: ICommerceApiSettings;\n\n public constructor(channelReferenceLookupCriteria: ChannelReferenceLookupCriteria | null, apiSettings: ICommerceApiSettings) {\n this.channelReferenceLookupCriteria = channelReferenceLookupCriteria;\n this.apiSettings = apiSettings;\n this.confirmationId = channelReferenceLookupCriteria?.ChannelReferenceId;\n }\n\n /**\n * GetCacheKey.\n * @returns - String.\n */\n public getCacheKey = (): string => buildCacheKey(`OrderDetails-${this.confirmationId ? this.confirmationId : ''}`, this.apiSettings);\n\n /**\n * GetCacheObjectType.\n * @returns - String.\n */\n public getCacheObjectType = (): string => 'OrderDetails';\n\n /**\n * DataCacheType.\n * @returns - String.\n */\n public dataCacheType = (): CacheType => 'request';\n}\n\n/**\n * Get sales order details by confirmation id action.\n * @param input - GetOrderHistory hydration input.\n * @param context - Channel context.\n * @returns - Sales Order Details.\n */\nexport async function getSalesOrderDetailsByChannelReferenceIdAction(\n input: GetSalesOrderDetailsByConfirmationInput,\n context: IActionContext\n): Promise {\n return SalesOrdersDataActions.getOrderByChannelReferenceLookupCriteriaAsync(\n { callerContext: context },\n input.channelReferenceLookupCriteria\n );\n}\n\n/**\n * GetSalesOrderDetailsByConfirmationIdDataAction.\n * @returns -- IObservableAction.\n */\nexport const getSalesOrderDetailsByChannelReferenceIdDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/order-management/order-lookup/get-sales-order-details-by-confirmation-id',\n action: getSalesOrderDetailsByChannelReferenceIdAction as IAction\n});\n\nexport default getSalesOrderDetailsByChannelReferenceIdDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n ICommerceApiSettings,\n ICreateActionContext,\n isChannelTypeB2B\n} from '@msdyn365-commerce/core';\nimport {\n CatalogsDataActions,\n ChannelReferenceAdditionalLookupCriteria,\n ChannelReferenceLookupCriteria,\n ExtensibleEnumeration,\n FeatureState,\n IDictionary,\n ProductDeliveryOptions,\n ProductsDataActions,\n SalesOrder,\n SalesOrdersDataActions,\n SearchLocation,\n SimpleProduct,\n StoreOperationsDataActions,\n TransactionType,\n SalesLine\n} from '@msdyn365-commerce/retail-proxy';\nimport {\n ArrayExtensions,\n buildCacheKey,\n getSimpleProducts,\n ObjectExtensions,\n ProductInput,\n QueryResultSettingsProxy\n} from '@msdyn365-commerce-modules/retail-actions';\n\nimport {\n getFeatureStatesAsync,\n getOnlineChannelAsync\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\nimport {\n getSalesOrderDetailsByChannelReferenceIdAction,\n GetSalesOrderDetailsByConfirmationInput\n} from './get-sales-order-details-by-confirmation-id';\n/**\n * ISalesOrderWithHydrations.\n */\ninterface ISalesOrderWithHydrations {\n salesOrder: SalesOrder;\n products: SimpleProduct[];\n productDeliveryOptions?: ProductDeliveryOptions[];\n isSameSiteType?: boolean;\n}\n\n/**\n * Product and Catalog Interface.\n */\ninterface IProductCatalog {\n productId: number;\n catalogId: number | undefined;\n}\n\n/**\n * AdditionalLookupCriteria entity interface.\n */\nexport interface IAdditionalLookupCriteria {\n orderStatusLookUpParameterTypeName: string;\n orderStatusLookUpParameterValue: string;\n}\n\n/**\n * OrderTypes Types of orders.\n */\nexport enum orderTypes {\n salesOrder = 'salesOrder',\n transaction = 'transaction'\n}\n\n/**\n * GetQueryStringParameters.\n * @param context -- URL.\n * @returns Additional lookup criteria -- IAdditionalLookupCriteria[].\n */\nconst getQueryStringParameters = (context: IActionContext): IAdditionalLookupCriteria[] => {\n const addtionalLookupParameter: IAdditionalLookupCriteria[] = [];\n let query: IDictionary;\n if (context.requestContext.query) {\n query = context.requestContext.query;\n const queryArray = Object.entries(query);\n\n for (let index = 1; index <= queryArray.length; index++) {\n const additionalFieldName: string = `field${index}Name`;\n const additionalFieldValue = `field${index}Value`;\n if (additionalFieldName in query && additionalFieldValue in query) {\n addtionalLookupParameter.push({\n orderStatusLookUpParameterTypeName: query[additionalFieldName],\n orderStatusLookUpParameterValue: query[additionalFieldValue]\n });\n }\n }\n }\n return addtionalLookupParameter;\n};\n\n/**\n * Calls the Retail API and returns the sales order for anonymous user.\n * @param confirmationId -- Confirmation Id.\n * @returns SalesOrder -- Promise.\n */\nconst getSalesOrderDetailsByLookupCriteria = (confirmationId: string) => async (context: IActionContext): Promise => {\n const { propertyName = '', propertyValue = '' } = context.requestContext.query ?? {};\n\n const addtionalLookupParameter: IAdditionalLookupCriteria[] = getQueryStringParameters(context);\n\n const getExtensibleEnumerations = await StoreOperationsDataActions.getExtensibleEnumerationsAsync({ callerContext: context });\n\n const orderLookupExtensibleEnum: ExtensibleEnumeration[] =\n getExtensibleEnumerations.find(item => item.TypeName === 'OrderLookupAdditionalCriteriaType')?.ExtensibleEnumerations ?? [];\n\n const channelReferenceAdditionalLookupCriteria: ChannelReferenceAdditionalLookupCriteria[] = [];\n\n for (const item of orderLookupExtensibleEnum) {\n const retailProxyValue: string = item.Name.toLocaleLowerCase();\n const retailProxyTypeValue: number = item.Value;\n const orderLookupSearchPropertyName: string = propertyName.toLocaleLowerCase();\n if (retailProxyValue === orderLookupSearchPropertyName) {\n channelReferenceAdditionalLookupCriteria.push({\n OrderLookupAdditionalCriteriaTypeValue: item.Value,\n OrderLookupAdditionalCriteriaTypeParameterValue: propertyValue\n });\n }\n if (ArrayExtensions.hasElements(addtionalLookupParameter)) {\n for (const additionalItem of addtionalLookupParameter) {\n if (retailProxyValue === additionalItem.orderStatusLookUpParameterTypeName.toLocaleLowerCase()) {\n channelReferenceAdditionalLookupCriteria.push({\n OrderLookupAdditionalCriteriaTypeValue: retailProxyTypeValue,\n OrderLookupAdditionalCriteriaTypeParameterValue: additionalItem.orderStatusLookUpParameterValue\n });\n }\n }\n }\n }\n\n const channelReferenceLookupCriteria: ChannelReferenceLookupCriteria = {\n ChannelReferenceId: confirmationId,\n ChannelReferenceAdditionalLookupCriteria: channelReferenceAdditionalLookupCriteria\n };\n\n const input = new GetSalesOrderDetailsByConfirmationInput(channelReferenceLookupCriteria, context.requestContext.apiSettings);\n\n return getSalesOrderDetailsByChannelReferenceIdAction(input, context);\n};\n\n/**\n * Calls the Retail API and returns the sales order.\n * @param orderType -- Order Type.\n * @param orderId -- Order id.\n * @returns SalesOrder -- Promise.\n */\nconst getSalesOrder = (orderType: string = '', orderId: string = '') => async (context: IActionContext): Promise => {\n const { confirmationId = '' } = context.requestContext.query ?? {};\n\n if (confirmationId) {\n return getSalesOrderDetailsByLookupCriteria(confirmationId)(context);\n } else if (orderType === orderTypes.salesOrder) {\n return SalesOrdersDataActions.getSalesOrderDetailsBySalesIdAsync({ callerContext: context }, orderId);\n }\n\n return SalesOrdersDataActions.getSalesOrderDetailsByTransactionIdAsync({ callerContext: context }, orderId, SearchLocation.All);\n};\n\n/**\n * Calls the Retail API and returns the products.\n * @param productCatalog - The product and catalog ids of the product to retrieve.\n * @param channelId - The channel id for the products.\n * @returns Simple product data.\n */\nconst getProductsWithCatalog = (productCatalog: IProductCatalog[], channelId?: number) => async (\n context: IActionContext\n): Promise => {\n const productInputs = productCatalog.map(\n index =>\n new ProductInput(\n index.productId,\n context.requestContext.apiSettings,\n channelId,\n undefined,\n context.requestContext,\n index.catalogId\n )\n );\n return getSimpleProducts(productInputs, context);\n};\n\n/**\n * Action input.\n */\nexport class GetSalesOrderWithHydrationsInput implements IActionInput {\n public orderType: string | undefined;\n\n public orderId: string | undefined;\n\n public confirmationId: string | undefined;\n\n private readonly apiSettings: ICommerceApiSettings;\n\n public constructor(\n orderType: string | undefined,\n orderId: string | undefined,\n apiSettings: ICommerceApiSettings,\n confirmationId?: string\n ) {\n this.orderType = orderType;\n this.orderId = orderId;\n this.apiSettings = apiSettings;\n this.confirmationId = confirmationId;\n }\n\n /**\n * GetCacheKey.\n * @returns String.\n */\n public getCacheKey = (): string => buildCacheKey('SalesOrderWithHydrations', this.apiSettings);\n\n /**\n * GetCacheObjectType.\n * @returns String.\n */\n public getCacheObjectType = (): string =>\n `SalesOrderWithHydrations-${this.orderType ?? ''}-${this.orderId ?? ''}-${this.confirmationId ?? ''}`;\n\n /**\n * DataCacheType.\n * @returns CacheType.\n */\n public dataCacheType = (): CacheType => 'request';\n}\n\n/**\n * Creates the input required to make the retail api call.\n * @param inputData -- InputData as ICreateActionContext.\n * @returns Action Input.\n */\nconst createSalesOrderWithHydrationsInput = (inputData: ICreateActionContext) => {\n const { salesId = '', transactionId = '', confirmationId = '' } = inputData.requestContext.query ?? {};\n\n if (confirmationId) {\n const orderType = undefined;\n const orderId = undefined;\n return new GetSalesOrderWithHydrationsInput(orderType, orderId, inputData.requestContext.apiSettings, confirmationId);\n } else if (salesId) {\n return new GetSalesOrderWithHydrationsInput(orderTypes.salesOrder, salesId, inputData.requestContext.apiSettings);\n } else if (transactionId) {\n return new GetSalesOrderWithHydrationsInput(orderTypes.transaction, transactionId, inputData.requestContext.apiSettings);\n }\n\n throw new Error('createSalesOrderWithHydrationsInput - No salesId, confirmationId or transactionId provided.');\n};\n\n/**\n * Get sales order with hydrations action.\n * @param input -- Input.\n * @param context -- Context.\n * @returns ISalesOrderWithHydrations.\n */\nexport async function getSalesOrderWithHydrationsAction(\n input: GetSalesOrderWithHydrationsInput,\n context: IActionContext\n): Promise {\n const { orderType, orderId } = input;\n\n const { confirmationId = '' } = context.requestContext.query ?? {};\n\n if (context.requestContext.user.isAuthenticated && (!orderType || !orderId) && !confirmationId) {\n context.trace('[getSalesOrderWithHydrationsAction] No orderType or orderId or confirmationId provided.');\n return {};\n }\n\n const salesOrder = await getSalesOrder(orderType, orderId)(context);\n if (salesOrder && salesOrder.SalesLines) {\n salesOrder.SalesLines = salesOrder.SalesLines.filter((saleline: SalesLine) => !saleline.IsVoided);\n }\n\n if (!salesOrder) {\n context.trace('[getSalesOrderWithHydrationsAction] No salesOrder found.');\n return {};\n }\n\n // If it is salesInvoice, return salesOrder and empty products\n if (salesOrder.TransactionTypeValue === TransactionType.SalesInvoice) {\n return {\n salesOrder,\n products: []\n };\n }\n let isEnabled: boolean = true;\n\n if (salesOrder.ChannelId !== context.requestContext.apiSettings.channelId && salesOrder.ChannelId !== undefined) {\n context.trace('[getSalesOrderWithHydrationsAction] SalesOrder is not from current channel.');\n try {\n const channelInfo = await getOnlineChannelAsync({ callerContext: context }, salesOrder.ChannelId);\n const salesOrderChannelType = channelInfo?.OnlineStoreCustomerTypeValue;\n isEnabled = salesOrderChannelType === 1 && isChannelTypeB2B(context.requestContext);\n } catch (error) {\n console.log('Please check the channel type if it is not online, 400 expected.', error);\n }\n }\n\n if (!ArrayExtensions.hasElements(salesOrder.SalesLines)) {\n context.trace('[getSalesOrderWithHydrationsAction] No salesLine found.');\n return {};\n }\n\n const productCatalogIds: IProductCatalog[] = salesOrder.SalesLines.map(salesLine => {\n return {\n productId: salesLine.ProductId !== undefined ? salesLine.ProductId : 0,\n catalogId: salesLine.CatalogId\n };\n });\n\n if (!ArrayExtensions.hasElements(productCatalogIds)) {\n context.trace('[getSalesOrderWithHydrationsAction] No products in saleLines found.');\n return {};\n }\n\n const featureStates = await getFeatureStatesAsync({ callerContext: context }, [\n 'Dynamics.AX.Application.ChannelMultipleCatalogsFeature'\n ]);\n const isCatalogsFeatureEnabled =\n featureStates?.find((featureState: FeatureState) => featureState.Name === 'Dynamics.AX.Application.ChannelMultipleCatalogsFeature')\n ?.IsEnabled || false;\n\n let products: SimpleProduct[] = [];\n\n if (!isCatalogsFeatureEnabled) {\n products = await getProductsWithCatalog(productCatalogIds, salesOrder.ChannelId)(context);\n } else {\n // Get product catalogs for current user. Catalog ids will be stored in RecordId property of userCatalogIds.\n const userCatalogIds = await CatalogsDataActions.getCatalogsAsync(\n { callerContext: context },\n context.requestContext.apiSettings.channelId,\n true\n );\n\n // Filter productCatalogIds to get only those that are in userCatalogIds.\n const matchingProductCatalogIds = productCatalogIds.filter(productCatalogId => {\n return userCatalogIds.some(userCatalogId => userCatalogId.RecordId === productCatalogId.catalogId);\n });\n\n // Filter productCatalogIds to get only those that are NOT in userCatalogIds.\n const nonMatchingProductCatalogIds = productCatalogIds.filter(productCatalogId => {\n return userCatalogIds.some(userCatalogId => userCatalogId.RecordId !== productCatalogId.catalogId);\n });\n\n let matchingProducts: SimpleProduct[] = [];\n if (matchingProductCatalogIds.length !== 0) {\n matchingProducts = await getProductsWithCatalog(\n matchingProductCatalogIds,\n context.requestContext.apiSettings.channelId\n )(context);\n }\n\n let nonMatchingProducts: SimpleProduct[] = [];\n if (nonMatchingProductCatalogIds.length !== 0) {\n nonMatchingProducts = await getProductsWithCatalog(nonMatchingProductCatalogIds, salesOrder.ChannelId)(context);\n }\n\n products = [...matchingProducts, ...nonMatchingProducts];\n }\n\n if (!ArrayExtensions.hasElements(products)) {\n context.trace('[getSalesOrderWithHydrationsAction] No simple products found.');\n return {};\n }\n const validProducts = products.filter(product => !ObjectExtensions.isNullOrUndefined(product.RecordId));\n\n const deliveryOptions = await ProductsDataActions.getDeliveryOptionsAsync(\n {\n callerContext: context,\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context)\n },\n validProducts.map(product => product.RecordId),\n {},\n 4\n )\n .then(result => {\n return result;\n })\n .catch((error: Error) => {\n context.trace(error.message);\n context.telemetry.exception(error);\n context.telemetry.debug('[getDeliveryOptionsForCartLineItems]Error executing action');\n throw new Error('[getDeliveryOptionsForCartLineItems]Error executing action');\n });\n\n return {\n salesOrder,\n products,\n deliveryOptions,\n isSameSiteType: isEnabled\n };\n}\n\n/**\n * GetSalesOrderWithHydrationsAction Data Action.\n * @param options -- Options.\n */\nexport const getSalesOrderWithHydrationsActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/order-management/get-sales-order-with-hydrations',\n action: getSalesOrderWithHydrationsAction as IAction,\n input: createSalesOrderWithHydrationsInput\n});\n\nexport default getSalesOrderWithHydrationsActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { getTenderTypesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\nimport { TenderType } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { QueryResultSettingsProxy } from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Action input.\n */\nexport class GetTenderTypesInput implements IActionInput {\n public getCacheKey = () => 'TenderTypes';\n\n public getCacheObjectType = () => 'TenderTypes';\n\n public dataCacheType = (): CacheType => 'request';\n}\n\n/**\n * CreateInput method for the getTenderTypes method.\n * @param inputData -- The input data passed to the createInput method.\n * @returns - Input for data action.\n */\nexport const createTenderTyperInput = (inputData: ICreateActionContext>): IActionInput => {\n return new GetTenderTypesInput();\n};\n\n/**\n * Get tender type action.\n * @param input - Input data.\n * @param context - Action context.\n * @returns - TenderType\n */\nexport async function getTenderTypeAction(input: GetTenderTypesInput, context: IActionContext): Promise {\n const tenderType = await getTenderTypesAsync({\n callerContext: context,\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context)\n });\n\n return tenderType;\n}\n\n/**\n * Get Tender Types Data Action.\n */\nexport const getTenderTypeActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/order-management/get-tender-types',\n action: getTenderTypeAction as IAction,\n input: createTenderTyperInput\n});\n\nexport default getTenderTypeActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { DateRefinerOptionItem } from '../common/refiner-option';\n\n/**\n * Gets the date refiner options.\n * @returns - List of refiner options.\n */\nconst getDateRefinerOptions = () => async (ctx: IActionContext): Promise => {\n return Promise.resolve([\n DateRefinerOptionItem.LastSevenDays,\n DateRefinerOptionItem.LastThirtyDays,\n DateRefinerOptionItem.LastThreeMonths,\n DateRefinerOptionItem.LastSixMonths,\n DateRefinerOptionItem.Customized\n ]);\n};\n\n/**\n * Action input.\n */\nexport class GetDateRefinerOptionsInput implements IActionInput {\n public getCacheKey = () => 'OrderHistoryWithSearchAndFiltersDateRefinerOptions';\n\n public getCacheObjectType = () => 'OrderHistoryWithSearchAndFiltersDateRefinerOptions';\n\n public dataCacheType = (): CacheType => 'instance';\n}\n\n/**\n * Creates the input required to make the retail api call.\n * @param inputData - Action Data Input.\n * @returns - Input object.\n */\nconst createGetDateRefinerOptionsInput = (inputData: ICreateActionContext>): IActionInput => {\n return new GetDateRefinerOptionsInput();\n};\n\n/**\n * Get action.\n * @param input - Input data.\n * @param context - Action context.\n * @returns - List of refiner options.\n */\nexport async function getDateRefinerOptionsAction(\n input: GetDateRefinerOptionsInput,\n context: IActionContext\n): Promise {\n if (!context) {\n throw new Error('getDateRefinerOptionsAction - Action context cannot be null/undefined');\n }\n\n let refinerOptions: DateRefinerOptionItem[] = [];\n\n try {\n refinerOptions = await getDateRefinerOptions()(context);\n } catch (error) {\n throw error;\n }\n\n return refinerOptions;\n}\n\n/**\n * Get date refiner options action.\n * @param id - Unique Id for data action.\n * @param context - Action context.\n * @param input - Input for data action.\n * @returns Api response.\n */\nexport const getDateRefinerOptionsActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/order-history-with-search-and-filters/get-date-refiner-options',\n action: getDateRefinerOptionsAction as IAction,\n input: createGetDateRefinerOptionsInput\n});\n\nexport default getDateRefinerOptionsActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { OrderStatusRefinerOptionItem } from '../common/refiner-option';\n\n/**\n * Gets the order status refiner options.\n * @returns - List of refiner options.\n */\nconst getOrderStatusRefinerOptions = () => async (ctx: IActionContext): Promise => {\n return Promise.resolve([\n OrderStatusRefinerOptionItem.Created,\n OrderStatusRefinerOptionItem.Invoiced,\n OrderStatusRefinerOptionItem.Canceled\n ]);\n};\n\n/**\n * Action input.\n */\nexport class GetOrderStatusRefinerOptionsInput implements IActionInput {\n public getCacheKey = () => 'OrderHistoryWithSearchAndFiltersOrderStatusRefinerOptions';\n\n public getCacheObjectType = () => 'OrderHistoryWithSearchAndFiltersOrderStatusRefinerOptions';\n\n public dataCacheType = (): CacheType => 'instance';\n}\n\n/**\n * Creates the input required to make the retail api call.\n * @param inputData - Action Data Input.\n * @returns - Input object.\n */\nconst createGetOrderStatusRefinerOptionsInput = (inputData: ICreateActionContext>): IActionInput => {\n return new GetOrderStatusRefinerOptionsInput();\n};\n\n/**\n * Get action.\n * @param input - Input data.\n * @param context - Action context.\n * @returns - List of refiner options.\n */\nexport async function getOrderStatusRefinerOptionsAction(\n input: GetOrderStatusRefinerOptionsInput,\n context: IActionContext\n): Promise {\n if (!context) {\n throw new Error('getOrderStatusRefinerOptionsAction - Action context cannot be null/undefined');\n }\n\n let refinerOptions: OrderStatusRefinerOptionItem[] = [];\n\n try {\n refinerOptions = await getOrderStatusRefinerOptions()(context);\n } catch (error) {\n throw error;\n }\n\n return refinerOptions;\n}\n\n/**\n * Get order status refiner options action.\n * @param id - Unique Id for data action.\n * @param context - Action context.\n * @param input - Input for data action.\n * @returns Api response.\n */\nexport const getOrderStatusRefinerOptionsActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/order-history-with-search-and-filters/get-order-status-refiner-options',\n action: getOrderStatusRefinerOptionsAction as IAction,\n input: createGetOrderStatusRefinerOptionsInput\n});\n\nexport default getOrderStatusRefinerOptionsActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { SearchOption } from '../common/search-option';\n\n/**\n * Gets the search options.\n * @returns - List of search options.\n */\nconst getSearchOptions = () => async (ctx: IActionContext): Promise => {\n return Promise.resolve([\n SearchOption.OrderNumber,\n SearchOption.ConfirmationId,\n SearchOption.ChannelName,\n SearchOption.CustomerRequisition\n ]);\n};\n\n/**\n * Action input.\n */\nexport class GetSearchOptionsInput implements IActionInput {\n public getCacheKey = () => 'OrderHistoryWithSearchAndFiltersSearchOptions';\n\n public getCacheObjectType = () => 'OrderHistoryWithSearchAndFiltersSearchOptions';\n\n public dataCacheType = (): CacheType => 'instance';\n}\n\n/**\n * Creates the input required to make the retail api call.\n * @param inputData - Action Data Input.\n * @returns - Input object.\n */\nconst createGetSearchOptionsInput = (inputData: ICreateActionContext>): IActionInput => {\n return new GetSearchOptionsInput();\n};\n\n/**\n * Get action.\n * @param input - Input data.\n * @param context - Action context.\n * @returns - List of search options.\n */\nexport async function getSearchOptionsAction(input: GetSearchOptionsInput, context: IActionContext): Promise {\n if (!context) {\n throw new Error('getSearchOptionsAction - Action context cannot be null/undefined');\n }\n\n let searchOptions: SearchOption[] = [];\n\n try {\n searchOptions = await getSearchOptions()(context);\n } catch (error) {\n throw error;\n }\n\n return searchOptions;\n}\n\n/**\n * Get search options action.\n * @param id - Unique Id for data action.\n * @param context - Action context.\n * @param input - Input for data action.\n * @returns Api response.\n */\nexport const getSearchOptionsActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/order-history-with-search-and-filters/get-search-options',\n action: getSearchOptionsAction as IAction,\n input: createGetSearchOptionsInput\n});\n\nexport default getSearchOptionsActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { SortOption } from '../common/sort-option';\n\n/**\n * Gets the sort options.\n * @returns - List of sort options.\n */\nconst getAllSortOptions = () => async (ctx: IActionContext): Promise => {\n return Promise.resolve([\n SortOption.CreatedDateTimeDescending,\n SortOption.CreatedDateTimeAscending,\n SortOption.ConfirmedShipDateDescending,\n SortOption.ConfirmedShipDateAscending\n ]);\n};\n\n/**\n * Gets the sort options without confirmed ship date options.\n * @returns - List of sort options.\n */\nconst getSortOptionsWithoutConfirmedShipDate = () => async (ctx: IActionContext): Promise => {\n return Promise.resolve([SortOption.CreatedDateTimeDescending, SortOption.CreatedDateTimeAscending]);\n};\n\n/**\n * Action input.\n */\nexport class GetSortOptionsInput implements IActionInput {\n public allowSortingByConfirmedShipDate: boolean;\n\n constructor(allowSortingByConfirmedShipDate: boolean) {\n this.allowSortingByConfirmedShipDate = allowSortingByConfirmedShipDate;\n }\n\n public getCacheKey = () => 'OrderHistoryWithSearchAndFiltersSortOptions';\n\n public getCacheObjectType = () => 'OrderHistoryWithSearchAndFiltersSortOptions';\n\n public dataCacheType = (): CacheType => 'instance';\n}\n\n/**\n * Creates the input required to make the retail api call.\n * @param inputData - Action Data Input.\n * @returns - Input object.\n */\nconst createGetSortOptionsInput = (inputData: ICreateActionContext>): IActionInput => {\n return new GetSortOptionsInput(inputData.config?.showConfirmedShipDateSortingOptions || false);\n};\n\n/**\n * Get action.\n * @param input - Input data.\n * @param context - Action context.\n * @returns - List of sort options.\n */\nexport async function getSortOptionsAction(input: GetSortOptionsInput, context: IActionContext): Promise {\n if (!context) {\n throw new Error('getSortOptionsAction - Action context cannot be null/undefined');\n }\n\n let sortOptions: SortOption[] = [];\n\n try {\n sortOptions = input.allowSortingByConfirmedShipDate\n ? await getAllSortOptions()(context)\n : await getSortOptionsWithoutConfirmedShipDate()(context);\n } catch (error) {\n throw error;\n }\n\n return sortOptions;\n}\n\n/**\n * Get sort options action.\n * @param id - Unique Id for data action.\n * @param context - Action context.\n * @param input - Input for data action.\n * @returns Api response.\n */\nexport const getSortOptionsActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/order-history-with-search-and-filters/get-sort-options',\n action: getSortOptionsAction as IAction,\n input: createGetSortOptionsInput\n});\n\nexport default getSortOptionsActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { SalesStatus } from '@msdyn365-commerce/retail-proxy';\n\nexport enum RefinerSourceType {\n Origin = 1,\n CreatedDate = 2,\n OrderStatus = 3\n}\n\nexport enum DateRefinerOptionItem {\n LastSevenDays = 0,\n LastThirtyDays = 1,\n LastThreeMonths = 2,\n LastSixMonths = 3,\n Customized = 999\n}\n\nexport enum OrderStatusRefinerOptionItem {\n Created = SalesStatus.Created,\n Delivered = SalesStatus.Delivered,\n Invoiced = SalesStatus.Invoiced,\n Canceled = SalesStatus.Canceled\n}\n\nexport interface IDateRange {\n startDate?: Date;\n endDate?: Date;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nexport enum SearchOption {\n OrderNumber = 0,\n ConfirmationId = 1,\n ChannelName = 2,\n CustomerRequisition = 3\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nexport enum SortOption {\n CreatedDateTimeAscending = 'CreatedDateTimeAscending',\n CreatedDateTimeDescending = 'CreatedDateTimeDescending',\n ConfirmedShipDateAscending = 'ConfirmedShipDateAscending',\n ConfirmedShipDateDescending = 'ConfirmedShipDateDescending'\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n ICreateActionContext,\n IRequestContext\n} from '@msdyn365-commerce/core';\nimport { IQueryResultSettings } from '@msdyn365-commerce/retail-proxy';\nimport {\n buildCacheKeyWithUrlTokens,\n getFullOrderTemplate,\n GetFullOrderTemplateInput,\n IQueryResultSettingsModuleConfig,\n OrderTemplate,\n QueryResultSettingsProxy\n} from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Input class for getActiveOrderTemplateLines data action.\n */\nexport class ActiveOrderTemplateLinesInput implements IActionInput {\n public requestContext: IRequestContext;\n\n public orderTemplateId: string;\n\n public queryResultSettings: IQueryResultSettings;\n\n constructor(requestContext: IRequestContext, config: IQueryResultSettingsModuleConfig) {\n if (!requestContext.query?.id) {\n throw new Error('Failed to get order template id from the query.');\n }\n if (!config) {\n throw new Error('Failed to get order template module configuration');\n }\n this.orderTemplateId = requestContext.query.id;\n this.queryResultSettings = QueryResultSettingsProxy.fromModuleData(requestContext, config).QueryResultSettings;\n\n this.queryResultSettings.count = true;\n this.requestContext = requestContext;\n }\n\n public getCacheKey = (): string => buildCacheKeyWithUrlTokens('ActiveOrderTemplateLines', this.requestContext);\n\n public getCacheObjectType = (): string => 'ActiveOrderTemplateLines';\n\n public dataCacheType = (): CacheType => 'instance';\n\n public shouldCacheOutput = () => false;\n}\n\n/**\n * Calls the Retail API and returns a ProductList object based on the passed GetCartInput.\n * @param input\n * @param context\n */\nexport async function getActiveOrderTemplateLines(input: ActiveOrderTemplateLinesInput, context: IActionContext): Promise {\n return getFullOrderTemplate(new GetFullOrderTemplateInput(input.orderTemplateId, input.queryResultSettings), context);\n}\n\nexport const getActiveOrderTemplateLinesDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/order-template/order-template/get-order-template-lines',\n action: >getActiveOrderTemplateLines,\n input: (context: ICreateActionContext) => {\n if (!context.config) {\n throw new Error('Failed to get order template module configuration');\n }\n return new ActiveOrderTemplateLinesInput(context.requestContext, context.config);\n }\n});\n\nexport default getActiveOrderTemplateLinesDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n getFriendlyName,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICreateActionContext,\n IGeneric,\n IRequestContext\n} from '@msdyn365-commerce/core';\nimport {\n buildCacheKeyWithUrlTokens,\n CurrentCategoryInput,\n getCategoryUrl,\n getCurrentCategory,\n removeDomainQspFromUrl\n} from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IPageSummaryData } from '../IPageSummaryData';\n\nimport { ICategoryPageSummaryConfig } from './category-page-summary.props.autogenerated';\nimport { IDefaultPageSummaryConfig } from '../default-page-summary';\n\n/**\n * Category Page Summary Input\n */\nexport class CategoryPageSummaryInput implements IActionInput {\n public requestContext: IRequestContext;\n\n public config: ICategoryPageSummaryConfig | IDefaultPageSummaryConfig;\n\n constructor(config: ICategoryPageSummaryConfig | IDefaultPageSummaryConfig, requestContext: IRequestContext) {\n this.config = config || {};\n this.requestContext = requestContext;\n }\n\n public getCacheObjectType = (): string => 'CategoryPageSummary';\n\n public getCacheKey = (): string => buildCacheKeyWithUrlTokens('CategoryPageSummary', this.requestContext);\n\n public dataCacheType = (): CacheType => 'request';\n}\n\nconst createGetCurrentCategoryInput = (\n inputData: IActionContext,\n config?: ICategoryPageSummaryConfig | IDefaultPageSummaryConfig\n): CurrentCategoryInput => {\n if (inputData && inputData.requestContext) {\n let includeRootCategory: boolean | undefined;\n if (config) {\n includeRootCategory = (config as ICategoryPageSummaryConfig).includeRootCategory;\n }\n return new CurrentCategoryInput(inputData.requestContext, includeRootCategory);\n }\n\n throw new Error('Please specify categoryId query string in request.');\n};\n/**\n * Get skip count.\n * @param inputData\n */\nfunction getSkipCount(inputData: ICreateActionContext, IGeneric>): string | undefined {\n return inputData && inputData.requestContext && inputData.requestContext.query && inputData.requestContext.query.skip;\n}\n\nconst action = async (input: CategoryPageSummaryInput, context: IActionContext): Promise => {\n const { config } = input;\n let currentCategoryResult;\n try {\n currentCategoryResult = await getCurrentCategory(createGetCurrentCategoryInput(context, input.config), context);\n } catch {\n // Do nothing, if the action fails fallback to values defined in data\n }\n if (currentCategoryResult) {\n const currentCategory = { ...currentCategoryResult };\n let categoryUrl: string | undefined;\n try {\n // Reset category's name neutralizedName\n const localName = getFriendlyName(context.requestContext.locale, currentCategory.NameTranslations);\n const neutralizedName = currentCategory.NeutralizedName || currentCategory.Name;\n currentCategory.Name = localName;\n currentCategory.NeutralizedName = neutralizedName;\n categoryUrl = getCategoryUrl(currentCategory);\n\n const canonicalDomain = context.requestContext.canonicalDomain;\n if (categoryUrl && canonicalDomain) {\n categoryUrl = `https://${canonicalDomain}${categoryUrl}`.toLocaleLowerCase();\n const skipCount = getSkipCount(context);\n const Url = new URL(categoryUrl);\n const urlParams: URLSearchParams = new URLSearchParams(Url.search);\n if (skipCount) {\n urlParams.set('skip', skipCount);\n }\n Url.search = urlParams.toString();\n categoryUrl = Url.toString();\n categoryUrl = removeDomainQspFromUrl(categoryUrl, context.requestContext);\n } else {\n categoryUrl = undefined;\n }\n } catch {\n categoryUrl = undefined;\n }\n return {\n title: currentCategory.Name,\n sharingImageUrl: currentCategory.OfflineImage,\n canonicalUrl: categoryUrl,\n faviconUrl: config && config.faviconUrl\n };\n\n // If the action fails fallback to values defined from data\n } else if (config) {\n return {\n title: config.title,\n sharingImageUrl: config.sharingImage && config.sharingImage.src,\n faviconUrl: config && config.faviconUrl\n };\n }\n return {};\n};\n\nexport default createObservableDataAction({\n id: '@msdyn365-commerce-modules/page-summary/category-page-summary',\n action: >action,\n input: (args: ICreateActionContext) => {\n return new CategoryPageSummaryInput(args.config, args.requestContext);\n }\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n ICreateActionContext,\n IRequestContext\n} from '@msdyn365-commerce/core';\nimport { buildCacheKeyWithUrlTokens, removeDomainQspFromUrl } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IDefaultPageSummaryConfig } from './default-page-summary.props.autogenerated';\n\nexport interface IPageSummaryData {\n title?: string;\n description?: string;\n keywords?: string;\n sharingImageUrl?: string;\n canonicalUrl?: string;\n faviconUrl?: string;\n}\n\n/**\n * Page Summary Input\n */\nexport class PageSummaryInput implements IActionInput {\n public requestContext: IRequestContext;\n\n public config: IDefaultPageSummaryConfig;\n\n constructor(config: IDefaultPageSummaryConfig, requestContext: IRequestContext) {\n this.config = config || {};\n this.requestContext = requestContext;\n }\n\n public getCacheObjectType = (): string => 'PageSummary';\n\n public getCacheKey = (): string => `${buildCacheKeyWithUrlTokens('PageSummary', this.requestContext)}-${this.config.title}`;\n\n public dataCacheType = (): CacheType => 'request';\n}\n\nconst action = async (input: PageSummaryInput, context: IActionContext): Promise => {\n const { config } = input;\n return {\n title: config && config.title,\n description: config && config.description,\n keywords: config && config.keywords,\n sharingImageUrl: config && config.sharingImage && config.sharingImage.src,\n canonicalUrl:\n context.requestContext && context.requestContext.canonicalUrl\n ? removeDomainQspFromUrl(context.requestContext.canonicalUrl, context.requestContext)\n : undefined,\n faviconUrl: config && config.faviconUrl\n };\n};\n\nexport default createObservableDataAction({\n id: '@msdyn365-commerce-modules/page-summary/default-page-summary',\n action: >action,\n input: (args: ICreateActionContext) => {\n return new PageSummaryInput(args.config, args.requestContext);\n }\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICreateActionContext,\n IGeneric,\n IRequestContext\n} from '@msdyn365-commerce/core';\nimport { Image, ISubList } from '@msdyn365-commerce-modules/data-types';\nimport { buildCacheKeyWithUrlTokens, getList, ListInput } from '@msdyn365-commerce-modules/retail-actions';\nimport { IProductItem } from '@msdyn365-commerce-modules/retail-actions/dist/types/get-list';\n\nimport { IDefaultPageSummaryConfig } from '../default-page-summary/default-page-summary.props.autogenerated';\nimport { IPageSummaryData } from '../IPageSummaryData';\n\n/**\n * List Page Summary Input\n */\nexport class ListPageSummaryInput implements IActionInput {\n public requestContext: IRequestContext;\n\n public config: IDefaultPageSummaryConfig;\n\n constructor(config: IDefaultPageSummaryConfig, requestContext: IRequestContext) {\n this.config = config || {};\n this.requestContext = requestContext;\n }\n\n public getCacheObjectType = (): string => 'ListPageSummary';\n\n public getCacheKey = (): string => buildCacheKeyWithUrlTokens('ListPageSummary', this.requestContext);\n\n public dataCacheType = (): CacheType => 'request';\n}\n\n/**\n * List item type enum.\n */\nenum ListItemType {\n list = 'list',\n product = 'product'\n}\n\n/**\n * Get the url of sub list.\n * @param listName\n * @param sitePath\n */\nfunction getSubListUrl(listName: string, sitePath: string): string {\n if (!listName) {\n return '';\n }\n\n if (!sitePath) {\n return `/${listName}.l`;\n }\n\n // SitePath has a leading '/'\n return `${sitePath}/${listName}.l`;\n}\n\n/**\n * Get sub list item.\n * @param item\n * @param sitePathOfRequest\n */\nfunction getSubListItem(item: IGeneric, sitePathOfRequest: string): ISubList {\n const imageList: Image[] = getImages(item.fields.content.images);\n\n const sublistHref = getSubListUrl(item.fields._name, sitePathOfRequest);\n return {\n Title: item.fields.content.title,\n Description: item.fields.content.description,\n ShortDescription: item.fields.content.shortDescription,\n BackgroundColor: item.fields.content.backgroundColor,\n ForegroundColor: item.fields.content.foregroundColor,\n Href: sublistHref,\n Images: imageList\n };\n}\n\n/**\n * Get site path.\n * @param inputData\n */\nfunction getSitePath(inputData: ICreateActionContext, IGeneric>): string {\n return inputData && inputData.requestContext && inputData.requestContext.sitePath ? inputData.requestContext.sitePath : '';\n}\n\n/**\n * Get items per page.\n * @param inputData\n */\nfunction getItemsPerPage(inputData: ICreateActionContext, IGeneric>): number {\n if (!inputData || !inputData.config || !inputData.config.itemsPerPage) {\n return 50;\n }\n\n const result = Number(inputData.config.itemsPerPage);\n if (isNaN(result)) {\n return 50;\n }\n\n return result;\n}\n\n/**\n * Get skip count.\n * @param inputData\n */\nfunction getSkipCount(inputData: ICreateActionContext, IGeneric>): number {\n return inputData && inputData.requestContext && inputData.requestContext.query && inputData.requestContext.query.skipCount\n ? Number(inputData.requestContext.query.skipCount)\n : 0;\n}\n\n/**\n * Get images.\n * @param images\n */\nfunction getImages(images: IGeneric[]): Image[] {\n const resultImageList: Image[] = [];\n\n if (!images) {\n return resultImageList;\n }\n\n images.forEach(item => {\n if (item && item.image && item.image.href) {\n // Add image item\n const imageItem: Image = {\n href: item.image.href,\n altText: item.image.altText,\n title: item.image.title,\n width: item.image.width,\n height: item.image.height\n };\n\n resultImageList.push(imageItem);\n }\n });\n\n return resultImageList;\n}\n\n/**\n * Get input list data.\n * @param inputData\n */\nfunction getInputListData(inputData: ICreateActionContext, IGeneric>): IGeneric {\n let listData =\n !inputData || !inputData.requestContext || !inputData.requestContext.pageData ? null : inputData.requestContext.pageData.list;\n if (\n !inputData ||\n !inputData.requestContext ||\n !inputData.requestContext.pageData ||\n !inputData.requestContext.pageData.list ||\n !inputData.requestContext.pageData.list.content ||\n !inputData.requestContext.pageData.list.content.items ||\n !inputData.requestContext.pageData.list.content.title ||\n !inputData.requestContext.pageData.list._id\n ) {\n if (\n !inputData ||\n !inputData.data ||\n !inputData.data.list ||\n !inputData.data.list.content ||\n !inputData.data.list.content.items ||\n !inputData.data.list.content.title ||\n !inputData.data.list._id\n ) {\n console.error('data is not well defined for list action input');\n throw new Error('data is not well defined for list action input');\n }\n\n listData = inputData.data.list;\n }\n return listData;\n}\n\nconst createGetListInput = (inputData: IActionContext): ListInput => {\n const listData: IGeneric = getInputListData(inputData);\n const listItems: (IProductItem[] | ISubList)[] = [];\n let productList: IProductItem[] = [];\n\n const parentImageList: Image[] = getImages(listData.content.images);\n\n const itemsPerPage = getItemsPerPage(inputData);\n const skipCount = getSkipCount(inputData);\n\n // This is the list contains all product and will be used to call getSimpleProducts data action.\n const productItems: IProductItem[] = [];\n const sum = skipCount + itemsPerPage;\n for (let index = skipCount; index < listData.content.items.length && index < sum; index++) {\n const item = listData.content.items[index];\n if (item.type === ListItemType.list) {\n if (!item.fields || !item.fields.content || !item.fields.content.title) {\n console.error(`sublist item fields, content or title missing in list ${listData._id}`);\n continue;\n }\n\n // If any elements in product list, then copy it and add to list items\n if (productList.length > 0) {\n const clonedList = [...productList];\n listItems.push(clonedList);\n productList = [];\n }\n\n // Build and add sublist item\n listItems.push(getSubListItem(item, getSitePath(inputData)));\n }\n\n if (item.type === ListItemType.product) {\n if (!item.fields || !item.fields.recordId) {\n console.error(`product item missing recordId in list ${listData._id}`);\n continue;\n }\n\n // Add product item\n const productItem: IProductItem = {\n RecordId: item.fields.recordId,\n CatalogId: item.fields.catalogId || '0'\n };\n\n productList.push(productItem);\n productItems.push(productItem);\n }\n }\n\n // Save the last portion of product items.\n if (productList.length > 0) {\n listItems.push(productList);\n }\n\n return new ListInput(\n listData._id,\n listData.content.title,\n listData.content.description,\n listData.content.shortDescription,\n listData.content.backgroundColor,\n listData.content.foregroundColor,\n parentImageList,\n listItems,\n productItems,\n listData.content.items.length,\n itemsPerPage,\n skipCount\n );\n};\n\nconst action = async (input: ListPageSummaryInput, context: IActionContext): Promise => {\n const { config } = input;\n let listData;\n try {\n listData = await getList(createGetListInput(context), context);\n } catch {\n // Do nothing, if there's an error running the action fall back to values defined from data\n }\n if (listData && listData.Title) {\n return {\n title: listData.Title,\n description: listData.Description\n };\n\n // If the action fails fallback to values defined from data\n } else if (config) {\n return {\n title: config.title,\n description: config.description\n };\n }\n return {};\n};\n\nexport default createObservableDataAction({\n id: '@msdyn365-commerce-modules/page-summary/list-page-summary',\n action: >action,\n input: (args: ICreateActionContext) => {\n return new ListPageSummaryInput(args.config, args.requestContext);\n }\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n getCatalogId,\n IAction,\n IActionContext,\n IActionInput,\n ICommerceApiSettings,\n ICreateActionContext,\n IRequestContext\n} from '@msdyn365-commerce/core';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { getAttributeValuesAsync, getByIdsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport {\n ArrayExtensions,\n generateCacheKey,\n generateImageUrl,\n getProductUrlSync,\n getSelectedProductIdFromActionInput,\n QueryResultSettingsProxy,\n removeDomainQspFromUrl\n} from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IPageSummaryData } from '../IPageSummaryData';\nimport { IProductPageSummaryConfig } from './product-page-summary.props.autogenerated';\n\n/**\n * Product Page Summary Input.\n */\nexport class ProductPageSummaryInput implements IActionInput {\n public apiSettings: ICommerceApiSettings;\n\n public config: IProductPageSummaryConfig;\n\n public productId: number;\n\n public catalogId?: number;\n\n public constructor(\n config: IProductPageSummaryConfig,\n apiSettings: ICommerceApiSettings,\n productId: number,\n requestContext?: IRequestContext\n ) {\n this.config = config || {};\n this.apiSettings = apiSettings;\n this.productId = productId;\n\n if (requestContext) {\n this.catalogId = getCatalogId(requestContext);\n }\n }\n\n public getCacheObjectType = (): string => 'ProductPageSummary';\n\n public getCacheKey = (): string =>\n generateCacheKey(\n this.apiSettings,\n { key: 'Key', value: 'ProductPageSummary' },\n { key: 'Title', value: this.config.title },\n { key: 'ProductId', value: this.productId },\n { key: 'CatalogId', value: this.catalogId }\n );\n\n public dataCacheType = (): CacheType => 'application';\n}\n\nexport interface IProductPageSummary extends IPageSummaryData {\n price?: number;\n productId?: number;\n productBrand?: string;\n}\n\nconst createInput = (args: ICreateActionContext) => {\n const productId = getSelectedProductIdFromActionInput(args);\n\n if (productId) {\n return new ProductPageSummaryInput(\n args.config,\n args.requestContext.apiSettings,\n +productId,\n args.requestContext\n );\n }\n throw new Error('Unable to create ProductPageSummaryAction input, no productId found on module config or query');\n};\n\n// Checks product attributes for the presence of brand attribute to extract the brand name for product metadata\nconst getProductBrand = async (\n context: IActionContext,\n recordId: number,\n channelId: number,\n catalogId: number\n): Promise => {\n const productAttributes = await getAttributeValuesAsync(\n {\n callerContext: context,\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context)\n },\n recordId,\n channelId,\n catalogId\n );\n for (const productAttribute of productAttributes) {\n if (productAttribute.Name === 'Brand') {\n return productAttribute.TextValue;\n }\n }\n return;\n};\n\nconst action = async (input: ProductPageSummaryInput, context: IActionContext): Promise => {\n const { config, productId, apiSettings } = input;\n let simpleProductsData: SimpleProduct[] | undefined;\n try {\n simpleProductsData = ArrayExtensions.validValues(\n await getByIdsAsync(\n {\n callerContext: context,\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context)\n },\n apiSettings.channelId,\n [productId],\n null,\n input.catalogId ?? 0\n )\n );\n } catch {\n // Do nothing, if there's an error we fall back to values defined from config\n }\n if (ArrayExtensions.hasElements(simpleProductsData)) {\n const simpleProductData = simpleProductsData[0];\n let productUrl: string | undefined;\n try {\n productUrl = getProductUrlSync(simpleProductData, context);\n const canonicalDomain = context.requestContext.canonicalDomain;\n if (productUrl && canonicalDomain) {\n productUrl = `https://${canonicalDomain}${productUrl}`.toLocaleLowerCase();\n productUrl = removeDomainQspFromUrl(productUrl, context.requestContext);\n } else {\n productUrl = undefined;\n }\n } catch {\n productUrl = undefined;\n }\n let productBrand: string | undefined;\n try {\n productBrand = await getProductBrand(context, productId, apiSettings.channelId, input.catalogId ?? 0);\n } catch {\n productBrand = undefined;\n }\n return {\n title: simpleProductData.Name,\n description: simpleProductData.Description,\n sharingImageUrl: generateImageUrl(simpleProductData.PrimaryImageUrl, apiSettings),\n canonicalUrl: productUrl,\n faviconUrl: config && config.faviconUrl,\n productId: simpleProductData.RecordId,\n price: simpleProductData.AdjustedPrice,\n productBrand\n };\n\n // If the action fails fallback to values defined from config\n } else if (config) {\n return {\n title: config.title,\n description: config.description,\n sharingImageUrl: config.sharingImage && config.sharingImage.src,\n faviconUrl: config && config.faviconUrl\n };\n }\n return {};\n};\n\nexport default createObservableDataAction({\n id: '@msdyn365-commerce-modules/page-summary/product-page-summary',\n action: >action,\n input: createInput\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n getCatalogId,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions, getCustomer, GetCustomerInput, getSimpleProducts, ProductInput } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { ProductComparisonItem, ProductComparisonState } from '../../product-comparison-state';\n\n/**\n * Represents the data for a single product in the comparison.\n */\nexport interface IProductComparisonProductData {\n itemId: string;\n product: SimpleProduct;\n catalogId: number;\n}\n\n/**\n * Input class for GetProductsInProductComparisonInput data action.\n */\nexport class GetProductsInPreviewProductComparisonInput implements IActionInput {\n public readonly items?: ProductComparisonItem[];\n\n public constructor(items?: ProductComparisonItem[]) {\n this.items = items;\n }\n\n /**\n * Cache key.\n * @returns Cache key.\n */\n public getCacheKey = (): string => 'GetProductsInPreviewProductComparisonInput';\n\n /**\n * Cache object type.\n * @returns Cache object type.\n */\n public getCacheObjectType = (): string => 'GetProductsInPreviewProductComparisonInput';\n\n /**\n * Data cache type.\n * @returns Data cache type.\n */\n public dataCacheType = (): CacheType => 'none';\n}\n\n/**\n * Creates input for the data action.\n * @param inputData - Action context info.\n * @returns Action input.\n */\nexport const createGetProductsInPreviewProductComparisonInput = (\n inputData: ICreateActionContext>\n): GetProductsInPreviewProductComparisonInput => {\n return new GetProductsInPreviewProductComparisonInput();\n};\n\n/**\n * Retrieves product data for the items in the comparison.\n * @param input - Action input.\n * @param actionContext - Action context.\n * @returns Products data.\n */\nexport const getProductsInPreviewProductComparisonAction = async (\n input: GetProductsInPreviewProductComparisonInput,\n actionContext: IActionContext\n): Promise => {\n const catalogId = getCatalogId(actionContext.requestContext);\n\n let currentItems = input.items;\n if (!ArrayExtensions.hasElements(currentItems)) {\n const accountInformation = await getCustomer(new GetCustomerInput(actionContext.requestContext.apiSettings), actionContext);\n currentItems = ProductComparisonState.instance(actionContext.requestContext, accountInformation).items;\n }\n\n currentItems = currentItems.filter(item => item.catalogId === catalogId);\n if (!ArrayExtensions.hasElements(currentItems)) {\n return [];\n }\n\n const productInputs = currentItems.map(\n item => new ProductInput(item.productId, actionContext.requestContext.apiSettings, undefined, undefined, undefined, item.catalogId)\n );\n\n const simpleProducts = await getSimpleProducts(productInputs, actionContext);\n if (currentItems.length !== simpleProducts.length) {\n throw new Error('Product comparison preview: Failed to retrieve products info.');\n }\n\n return currentItems.map((item, index) => {\n return {\n itemId: ProductComparisonItem.getItemId(item.productId, item.catalogId),\n product: simpleProducts[index],\n catalogId: item.catalogId\n };\n });\n};\n\n/**\n * Data action to retrieve products info for the items in the comparison.\n */\nexport const getProductsInPreviewProductComparisonDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/product-comparison/product-comparison-preview/get-products-in-preview-product-comparison',\n action: getProductsInPreviewProductComparisonAction as IAction,\n input: createGetProductsInPreviewProductComparisonInput\n});\n\nexport default getProductsInPreviewProductComparisonDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ComparisonItem } from './comparison-item';\n\n/**\n * Represents a product for comparison.\n */\nexport class ProductComparisonItem extends ComparisonItem {\n public readonly productId: number;\n\n public readonly catalogId: number;\n\n public static getItemId(productId: number, catalogId: number): string {\n return `${productId}-${catalogId}`;\n }\n\n public constructor(productId: number, catalogId: number) {\n const itemId = ProductComparisonItem.getItemId(productId, catalogId);\n super(itemId);\n\n this.productId = productId;\n this.catalogId = catalogId;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * Represents an item for comparison.\n */\nexport abstract class ComparisonItem {\n public readonly addedDate: Date;\n\n public readonly itemId: ItemId;\n\n public constructor(itemId: ItemId) {\n this.itemId = itemId;\n this.addedDate = new Date();\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICookieContext, IRequestContext } from '@msdyn365-commerce/core';\nimport { Customer } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { ProductComparisonItem } from './base';\nimport { ComparisonManager } from './comparison-manager';\n\n/**\n * Represents a product comparison manager which operates a list of products and cookies to store the list.\n */\nexport class ProductComparisonState extends ComparisonManager {\n private static readonly _productComparisonItemsLocalStorageKey: string = '_msdyn365__productComparisonItems_';\n\n private static _instance?: ProductComparisonState;\n\n private readonly _requestContext: IRequestContext;\n\n public static instance(requestContext: IRequestContext, user?: Customer): ProductComparisonState {\n const items = ProductComparisonState._retrieveItemsFromCookies(requestContext, user);\n\n if (!ProductComparisonState._instance) {\n ProductComparisonState._instance = new ProductComparisonState(requestContext, items, user);\n } else if (!ArrayExtensions.equals(ProductComparisonState._instance.items, items)) {\n ProductComparisonState._instance.setItems(items);\n }\n\n return ProductComparisonState._instance;\n }\n\n private static _getCookieStorageKey(requestContext: IRequestContext, user?: Customer) {\n const userId = user?.RecordId ?? requestContext.user.customerAccountNumber ?? '';\n return `${ProductComparisonState._productComparisonItemsLocalStorageKey}__${requestContext.sitePath ?? ''}__${userId}`;\n }\n\n private static _retrieveItemsFromCookies(requestContext: IRequestContext, user?: Customer): ProductComparisonItem[] {\n const items = ProductComparisonState._readFromCookie(\n requestContext.cookies,\n ProductComparisonState._getCookieStorageKey(requestContext, user)\n );\n if (!ArrayExtensions.hasElements(items)) {\n return [];\n }\n return items;\n }\n\n private static _readFromCookie(cookieContext: ICookieContext, cookieKey: string): ProductComparisonItem[] | undefined | null {\n if (!cookieKey) {\n return undefined;\n }\n\n if (!cookieContext.isConsentGiven()) {\n return undefined;\n }\n\n const cookieValue = cookieContext.get(cookieKey);\n\n return cookieValue.value;\n }\n\n private static _writeToCookie(cookieContext: ICookieContext, cookieKey: string, value: ProductComparisonItem[]): void {\n if (!cookieKey) {\n return;\n }\n\n cookieContext.set(cookieKey, value, { secure: true, maxAge: 5_184_000 });\n }\n\n private constructor(requestContext: IRequestContext, items: ProductComparisonItem[], user?: Customer) {\n super(...items);\n\n this._requestContext = requestContext;\n\n this.listModifiedEvent.subscribe({\n /**\n * Unique identifier of the subscriber. Used to identify the subscriber among the other subscribers for the same event.\n */\n instanceId: 'ProductComparisonState instance',\n\n /**\n * Method which should be called once the event is triggered.\n */\n handler: () => {\n ProductComparisonState._writeToCookie(\n this._requestContext.cookies,\n ProductComparisonState._getCookieStorageKey(requestContext, user),\n this.items\n );\n }\n });\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Event } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { ComparisonItem } from './base';\n\n/**\n * Represents base functionality of a comparison manager which operates a list of items for comparison.\n */\nexport class ComparisonManager = ComparisonItem> {\n public readonly listModifiedEvent: Event;\n\n public get lastUpdateDate(): Date {\n return this._lastUpdateDate;\n }\n\n private _lastUpdateDate: Date;\n\n private _comparisonItems: Item[];\n\n public get items(): Item[] {\n return this._comparisonItems;\n }\n\n public constructor(...items: Item[]) {\n this._comparisonItems = items;\n this.listModifiedEvent = new Event();\n this._lastUpdateDate = new Date(Date.now());\n }\n\n public setItems(items: Item[]): void {\n this._comparisonItems = items;\n this._update();\n }\n\n public addItem(item: Item): void {\n this._comparisonItems.push(item);\n this._update();\n }\n\n public clearAll(): void {\n this.setItems([]);\n }\n\n public removeItem(item: Item): void {\n this._comparisonItems = this._comparisonItems.filter(currentItem => currentItem !== item);\n this._update();\n }\n\n public removeItemById(itemId: ItemId): void {\n this._comparisonItems = this._comparisonItems.filter(currentItem => currentItem.itemId !== itemId);\n this._update();\n }\n\n public hasItem(item: Item): boolean {\n return this.items.includes(item);\n }\n\n public hasItemById(itemId: ItemId): boolean {\n return this.items.some(item => item.itemId === itemId);\n }\n\n private _update(): void {\n this._lastUpdateDate = new Date(Date.now());\n this.listModifiedEvent.trigger();\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { FullProduct, RatingsSummary } from '@msdyn365-commerce/commerce-entities';\nimport {\n CacheType,\n createObservableDataAction,\n getCatalogId,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { AttributeValue, ProductDimensionValueInventoryAvailability, ProductPrice, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport {\n ArrayExtensions,\n AttributesForSelectedVariantInput,\n FullProductInput,\n getAttributesForSelectedVariantAction,\n getFullProductsAction,\n getRatingsSummary,\n GetRatingsSummaryInput,\n ProductDetailsCriteria,\n getDimensionAvailabilitiesForProductsAction,\n ProductsDimensionAvailabilitiesInput,\n GetCustomerInput,\n getCustomer\n} from '@msdyn365-commerce-modules/retail-actions';\n\nimport { ProductComparisonItem, ProductComparisonState } from '../../product-comparison-state';\n\n/**\n * Represents the specifications of the product.\n */\nexport interface IProductSpecification {\n productId: number;\n catalogId: number;\n specificationsList: AttributeValue[];\n}\n\n/**\n * Represents the dimension of single product.\n */\nexport interface IDimensionResult {\n result: ProductDimensionValueInventoryAvailability[][];\n}\n\n/**\n * Represents the dimension of the product.\n */\nexport interface IProductDimensionAvailibility {\n dimensions: IDimensionResult[];\n recordId: number;\n masterId: number;\n}\n/**\n * Represents the data for a single product comparison item.\n */\nexport interface IProductComparisonItemData {\n itemId: string;\n productInfo: SimpleProduct;\n catalogId: number;\n price?: ProductPrice;\n rating?: RatingsSummary;\n specifications?: IProductSpecification;\n dimensions?: IProductDimensionAvailibility;\n}\n\n/**\n * Input class for GetProductsInProductComparisonInput data action.\n */\nexport class GetProductsInProductComparisonInput implements IActionInput {\n public readonly items?: ProductComparisonItem[];\n\n public constructor(items?: ProductComparisonItem[]) {\n this.items = items;\n }\n\n /**\n * Cache key.\n * @returns Cache key.\n */\n public getCacheKey = (): string => 'GetProductsInProductComparisonInput';\n\n /**\n * Cache object type.\n * @returns Cache object type.\n */\n public getCacheObjectType = (): string => 'GetProductsInProductComparison';\n\n /**\n * Data cache type.\n * @returns Data cache type.\n */\n public dataCacheType = (): CacheType => 'none';\n}\n\n/**\n * Creates input for the data action.\n * @param inputData - Action context info.\n * @returns Action input.\n */\nexport const createGetProductsInProductComparisonInput = (\n inputData: ICreateActionContext>\n): GetProductsInProductComparisonInput => {\n return new GetProductsInProductComparisonInput();\n};\n\n/**\n * Loads full product info for each comparison item.\n * @param input - Data action input.\n * @param actionContext - Action context.\n * @returns Full product info.\n */\nconst loadFullProducts = async (input: GetProductsInProductComparisonInput, actionContext: IActionContext) => {\n const fullProductInput = input.items!.map(\n item =>\n new FullProductInput(\n item.productId,\n actionContext.requestContext.apiSettings,\n new ProductDetailsCriteria(true, true),\n actionContext.requestContext,\n item.catalogId\n )\n );\n\n let productsInfo = await getFullProductsAction(fullProductInput, actionContext);\n productsInfo = ArrayExtensions.validValues(productsInfo);\n\n return productsInfo;\n};\n\n/**\n * Loads ratings for each comparison item.\n * @param input - Data action input.\n * @param actionContext - Action context.\n * @returns Ratings info.\n */\nconst loadRatings = async (input: GetProductsInProductComparisonInput, actionContext: IActionContext) => {\n const apiSettings = actionContext.requestContext.apiSettings;\n const ratingInputs = input.items!.map(\n item => new GetRatingsSummaryInput(item.productId.toString(), apiSettings.rnr.id || '', apiSettings.rnr.url || '')\n );\n\n const ratingsPromises = ratingInputs.map(ratingInput => getRatingsSummary(ratingInput, actionContext));\n let ratings = await Promise.all(ratingsPromises);\n ratings = ArrayExtensions.validValues(ratings);\n\n return ratings;\n};\n\n/**\n * Loads product specification for the given product.\n * @param item - Input item.\n * @param product - Product for specification.\n * @param actionContext - Action context.\n * @returns Product specifications.\n */\nconst loadProductSpecifications = async (item: ProductComparisonItem, product: FullProduct, actionContext: IActionContext) => {\n const apiSettings = actionContext.requestContext.apiSettings;\n const input = new AttributesForSelectedVariantInput(\n product.ProductDetails.RecordId,\n apiSettings.channelId,\n product.ProductDetails,\n item.catalogId\n );\n const specificationsList = await getAttributesForSelectedVariantAction(input, actionContext);\n\n const productSpecification: IProductSpecification = {\n productId: product.ProductDetails.RecordId,\n specificationsList,\n catalogId: item.catalogId\n };\n return productSpecification;\n};\n\n/**\n * Loads product specification for each comparison item.\n * @param input - Action input.\n * @param products - Products for specification.\n * @param actionContext - Action context.\n * @returns Products specifications info.\n */\nconst loadProductsSpecifications = async (\n input: GetProductsInProductComparisonInput,\n products: FullProduct[],\n actionContext: IActionContext\n) => {\n const productsSpecificationsPromises = products.map(async (product, index) => {\n const item = input.items![index];\n return loadProductSpecifications(item, product, actionContext);\n });\n\n let productsSpecifications = await Promise.all(productsSpecificationsPromises);\n productsSpecifications = ArrayExtensions.validValues(productsSpecifications);\n\n return productsSpecifications;\n};\n\n/**\n * Loads product dimension for each comparison item.\n * @param products - Products for specification.\n * @param actionContext - Action context.\n * @returns Products specifications info.\n */\nconst loadProductsDimensions = async (products: FullProduct[], actionContext: IActionContext) => {\n const productsDimensionPromises = products.map(async product => {\n const dimensionResult: IDimensionResult[] = [];\n\n for (const item of product.ProductDetails.Dimensions!) {\n const input = new ProductsDimensionAvailabilitiesInput(\n product.ProductDetails.MasterProductId ?? product.ProductDetails.RecordId,\n item.DimensionTypeValue,\n actionContext.requestContext\n );\n await getDimensionAvailabilitiesForProductsAction([input], actionContext).then(result => {\n dimensionResult.push({ result });\n });\n }\n\n product.ProductDetails.Dimensions?.map(async item => {\n return dimensionResult;\n });\n\n const getUpdatedDimension: IProductDimensionAvailibility | undefined =\n dimensionResult.length > 0\n ? {\n dimensions: dimensionResult,\n recordId: product.ProductDetails.RecordId,\n masterId: product.ProductDetails.MasterProductId!\n }\n : undefined;\n return getUpdatedDimension;\n });\n\n let productsDimensions = await Promise.all(productsDimensionPromises);\n productsDimensions = ArrayExtensions.validValues(productsDimensions);\n return productsDimensions;\n};\n\n/**\n * Retrieves product data for the items in the comparison.\n * @param input - Action input.\n * @param actionContext - Action context.\n * @returns Products data.\n */\nexport const getProductsInProductComparisonAction = async (\n input: GetProductsInProductComparisonInput,\n actionContext: IActionContext\n): Promise => {\n const catalogId = getCatalogId(actionContext.requestContext);\n\n let items = input.items;\n if (!ArrayExtensions.hasElements(items)) {\n const accountInformation = await getCustomer(new GetCustomerInput(actionContext.requestContext.apiSettings), actionContext);\n items = ProductComparisonState.instance(actionContext.requestContext, accountInformation).items;\n }\n\n const newInput: GetProductsInProductComparisonInput = {\n items: items.filter(item => item.catalogId === catalogId),\n getCacheKey: input.getCacheKey,\n getCacheObjectType: input.getCacheObjectType,\n dataCacheType: input.dataCacheType\n };\n\n if (!ArrayExtensions.hasElements(newInput.items)) {\n return [];\n }\n\n const productsPromises = loadFullProducts(newInput, actionContext);\n const ratingsPromises = loadRatings(newInput, actionContext);\n const [products, ratings] = await Promise.all([productsPromises, ratingsPromises]);\n const productDimensions = await loadProductsDimensions(products, actionContext);\n const productsSpecifications = await loadProductsSpecifications(newInput, products, actionContext);\n\n const productsData = newInput.items.map((item, index) => {\n const product = products[index];\n const productData: IProductComparisonItemData = {\n itemId: item.itemId,\n productInfo: product.ProductDetails,\n price: product.ProductPrice,\n catalogId: item.catalogId\n };\n productData.rating = ratings.find(rating => rating.productId === productData.productInfo.RecordId.toString());\n productData.specifications = productsSpecifications.find(\n productSpecifications =>\n productSpecifications.productId === productData.productInfo.RecordId &&\n productSpecifications.catalogId === productData.catalogId\n );\n productData.dimensions = productDimensions.find(dimension => dimension?.recordId === productData.productInfo.RecordId);\n return productData;\n });\n return productsData;\n};\n\n/**\n * Data action to retrieve products info for the items in the comparison.\n */\nexport const getActiveCheckoutCartProductsActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/product-comparison/product-comparison/get-products-in-product-comparison',\n action: getProductsInProductComparisonAction as IAction,\n input: createGetProductsInProductComparisonInput\n});\n\nexport default getActiveCheckoutCartProductsActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n getCatalogId,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { AttributeValue, ProductsDataActions, SimpleProduct, StoreOperationsDataActions } from '@msdyn365-commerce/retail-proxy';\nimport {\n getAttributeValuesByConfiguration,\n getSelectedProductIdFromActionInput,\n getSelectedVariant,\n SelectedVariantInput\n} from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Chains getting the SelectedVariant with GetActivePrice.\n */\nexport class AttributesForSelectedVariantInput implements IActionInput {\n public productId: number;\n\n public channelId: number;\n\n public catalogId: number;\n\n public selectedProduct: SimpleProduct | undefined;\n\n constructor(productId: number, channelId: number, selectedProduct?: SimpleProduct, catalogId?: number) {\n this.productId = productId;\n this.channelId = channelId;\n this.selectedProduct = selectedProduct;\n this.catalogId = catalogId || 0;\n }\n\n public getCacheKey = () => 'AttributesForSelectedVariant';\n\n public getCacheObjectType = () => 'ProductAttributeValue';\n\n public dataCacheType = (): CacheType => 'none';\n}\n\nexport const createAttributesForSelectedVariantInput = (\n inputData: ICreateActionContext>\n): AttributesForSelectedVariantInput => {\n const productId = getSelectedProductIdFromActionInput(inputData);\n const catalogId = getCatalogId(inputData.requestContext);\n\n if (productId) {\n return new AttributesForSelectedVariantInput(+productId, +inputData.requestContext.apiSettings.channelId, undefined, catalogId);\n }\n throw new Error('Unable to create PriceForSelectedVariantInput, no productId found on module config or query');\n};\n\n/**\n * Calls the Retail API a get a list of dimension values for a given product.\n * @param input - The input.\n * @param context - The context.\n * @returns The attribute values.\n */\nexport async function getAttributesForSelectedVariantAction(\n input: AttributesForSelectedVariantInput,\n context: IActionContext\n): Promise {\n return Promise.resolve()\n .then(() => {\n const activeProduct: SimpleProduct | undefined = input.selectedProduct;\n\n if (!activeProduct) {\n const selectedVariantInput = new SelectedVariantInput(\n input.productId,\n input.channelId,\n undefined,\n undefined,\n context.requestContext\n );\n\n return getSelectedVariant(selectedVariantInput, context);\n }\n\n return activeProduct;\n })\n .then((productResult: SimpleProduct | null) => {\n const activeProduct: SimpleProduct | undefined = productResult;\n\n if (activeProduct) {\n return ProductsDataActions.getAttributeValuesAsync(\n {\n callerContext: context\n },\n activeProduct.RecordId,\n input.channelId,\n input.catalogId\n );\n }\n\n return null;\n })\n .then(async (attributeValues: AttributeValue[] | null) => {\n const channelInventoryConfiguration = await StoreOperationsDataActions.getInventoryConfigurationAsync({\n callerContext: context\n });\n\n return { attributeValues, channelInventoryConfiguration };\n })\n .then(result => {\n return getAttributeValuesByConfiguration(result.attributeValues, result.channelInventoryConfiguration);\n })\n .catch((error: Error) => {\n context.trace(error.message);\n throw new Error('[getPriceForSelectedVariantAction]Error executing action');\n });\n}\n\nexport default createObservableDataAction({\n id: '@msdyn365-commerce-modules/product-info/get-attributes-for-selected-variant',\n action: >getAttributesForSelectedVariantAction,\n input: createAttributesForSelectedVariantInput\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n ICreateActionContext,\n IRequestContext\n} from '@msdyn365-commerce/core';\nimport {\n buildCacheKeyWithUrlTokens,\n getFullProductList,\n GetFullProductListInput,\n QuickOrderTemplate\n} from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Input class for getActiveOrderTemplateLines data action.\n */\nexport class ActiveProductListInput implements IActionInput {\n public requestContext: IRequestContext;\n\n public productListId: string | undefined;\n\n public constructor(requestContext: IRequestContext, productListId?: string) {\n this.requestContext = requestContext;\n this.productListId = productListId;\n }\n\n /**\n * GetCacheObjectType.\n * @returns - Returns string.\n */\n public getCacheKey = (): string => buildCacheKeyWithUrlTokens('ActiveProductList', this.requestContext);\n\n /**\n * GetCacheKey.\n * @returns - Returns string.\n */\n public getCacheObjectType = (): string => 'ActiveProductList';\n\n /**\n * DataCacheType.\n * @returns - CacheType string.\n */\n public dataCacheType = (): CacheType => 'request';\n\n /**\n * Set Cache output.\n * @returns - Flag for cache output.\n */\n public shouldCacheOutput = (): boolean => false;\n}\n\n/**\n * Calls the Retail API and returns a ProductList object for user.\n * @param input - ProductList Input.\n * @param context - ActionContext.\n * @returns - OrderTemplate.\n */\nexport async function getActiveProductList(input: ActiveProductListInput, context: IActionContext): Promise {\n const fullProductListInput = new GetFullProductListInput(input.productListId);\n const productList = await getFullProductList(fullProductListInput, context);\n return productList;\n}\n\n/**\n * Calls the Retail API and returns a ProductList object for user.\n * @param input - ProductList Input.\n * @param context - ActionContext.\n * @returns - ProductList.\n */\nexport const getActiveProductListDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/quick-order-grid/get-product-list',\n action: getActiveProductList as IAction,\n\n /**\n * Method to call for input.\n * @param context - ActionContext.\n * @returns - Input for action..\n */\n input: (context: ICreateActionContext) => {\n return new ActiveProductListInput(context.requestContext);\n }\n});\n\nexport default getActiveProductListDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Reviews } from '@msdyn365-commerce/commerce-entities';\nimport {\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICreateActionContext,\n IGeneric,\n sendRequest\n} from '@msdyn365-commerce/core';\nimport { getRnrEndpointId, getRnrPartnerId, getSelectedProductIdFromActionInput } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { GetProductReviewsInput } from './inputs/get-product-reviews-input';\n\n/**\n * TODO: Use this function to create the input required to make the API call.\n * @param input\n */\nexport const createInputForProductReviews = (input: ICreateActionContext>): IActionInput => {\n const productId = getSelectedProductIdFromActionInput(input);\n if (productId) {\n // Task #211227597 Remove these hardcoded values.\n return new GetProductReviewsInput(productId, getRnrPartnerId(input), input.requestContext.locale, getRnrEndpointId(input));\n }\n throw new Error('[GetProductReviews] Not all necessary parameters found while creating Input for GetProductReviewsApi');\n};\n\nexport async function getReviewsForGivenProduct(input: GetProductReviewsInput, ctx: IActionContext): Promise {\n if (!inputIsValid(input)) {\n throw new Error(\n `[GetProductReviews] Invalid input. ProductId = ${input.productId}, TenantId = ${input.tenantId}, localeListFilter = ${input.localeListFilter}`\n );\n }\n let requestUrl =\n `${input.serviceEndpoint}/v2.0/reviews/product/${input.productId}` +\n `?tenantId=${input.tenantId}` +\n `&localeListFilter=${input.localeListFilter}` +\n `&pageSize=${input.pageSize}` +\n `&orderBy=${input.orderBy}` +\n `&skipItems=${input.skipItems}`;\n\n if (input.starFilters !== undefined && input.starFilters.length > 0) {\n requestUrl = `${requestUrl}&starFilters=${input.starFilters}`;\n }\n\n if (input.pageToken !== null) {\n requestUrl = `${requestUrl}&pageToken=${input.pageToken}`;\n }\n return sendRequest(requestUrl, 'get')\n .then(response => {\n if (response.data && response.data.items && response.data.items.length > 0) {\n return {\n items: response.data.items.filter(i => !i.isTakenDown),\n pagingInfo: response.data.pagingInfo\n };\n }\n ctx.trace('[GetProductReviews] No reviews found for this product.');\n return response.data;\n })\n .catch(error => {\n ctx.trace('[GetProductReviews] Failed to get reviews for product');\n ctx.telemetry.exception(error);\n ctx.telemetry.debug('[GetProductReviews] Failed to get reviews for product');\n throw error;\n });\n}\n\nfunction inputIsValid(input: GetProductReviewsInput): boolean {\n return input && input.productId.length > 0 && input.tenantId.length > 0 && input.localeListFilter.length > 0 && input.pageSize > 0;\n}\n\nexport const getReviewsForGivenProductDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/ratings-reviews/get-product-reviews',\n action: >getReviewsForGivenProduct,\n input: createInputForProductReviews\n});\n\nexport default getReviewsForGivenProductDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Review } from '@msdyn365-commerce/commerce-entities';\nimport {\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n ICreateActionContext,\n sendRequest\n} from '@msdyn365-commerce/core';\nimport { getRnrAuthEndpointId, getRnrPartnerId, getSelectedProductIdFromActionInput } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { GetUserReviewInput } from './inputs/get-user-review-input';\n\n/**\n * This method builds the input for the getUserReviewApi call.\n * @param input\n */\nconst createInput = (input: ICreateActionContext): IActionInput => {\n const productId = getSelectedProductIdFromActionInput(input);\n const userInfo = input.requestContext.user;\n if (productId && userInfo && userInfo.isAuthenticated) {\n // Task #211227597 Remove these hardcoded values.\n return new GetUserReviewInput(productId, getRnrPartnerId(input), userInfo.token, getRnrAuthEndpointId(input));\n }\n throw new Error('[GetUserReview] Not all necessary parameters found while creating Input for GetUserReviewAPI');\n};\n\n/**\n * This method gets the user's review from the RnR service endpoint.\n * @param input\n * @param ctx\n */\nasync function getUserReview(input: GetUserReviewInput, ctx: IActionContext): Promise {\n if (!inputIsValid(input)) {\n const errorMessage = `[GettUserReview] Failed to get user's review due to bad input ${input}`;\n ctx.trace(errorMessage);\n throw new Error(errorMessage);\n }\n\n const requestUrl = `${input.serviceEndpoint}/v2.0/reviews/product/${input.productId}/user?tenantId=${input.tenantId}`;\n\n return sendRequest(requestUrl, 'get', null, { headers: { Authorization: `id_token ${input.authorization}` } })\n .then(response => {\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers -- These are valid status code for requests.\n if (response.status !== 200 && response.status !== 201) {\n throw new Error(`An error occurred in getting user review. Response message - ${response.statusText}`);\n }\n return response.data;\n })\n .catch(error => {\n ctx.trace(\"[GettUserReview] Failed to get user's review for product\");\n ctx.telemetry.exception(error);\n ctx.telemetry.debug(\"[GettUserReview] Failed to get user's review for product\");\n ctx.trace(error);\n throw error;\n });\n}\n\nfunction inputIsValid(input: GetUserReviewInput): boolean {\n return input.productId.length > 0 && input.authorization.length > 0 && input.tenantId.length > 0;\n}\n\nexport const getUserReviewDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/ratings-reviews/get-user-review',\n action: >getUserReview,\n input: createInput\n});\n\nexport default getUserReviewDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CacheType, IActionInput } from '@msdyn365-commerce/core';\n\nexport type OrderBy =\n | 'None'\n | 'MostRecent'\n | 'Oldest'\n | 'HighestRating'\n | 'LowestRating'\n | 'MostHelpful'\n | 'LeastHelpful'\n | 'MostAsked'\n | 'MostAnswered'\n | 'LeastConcerns'\n | 'MostConcerns'\n | 'ReviewerNameAsc'\n | 'ReviewerNameDesc';\n\n/**\n * ReviewsGetRatingsSummary Input Action.\n */\nexport class GetProductReviewsInput implements IActionInput {\n /**\n * The Id representing the product to get the reviews for.\n */\n public productId: string;\n\n /**\n * The ID representing the tenant.\n */\n public tenantId: string;\n\n /**\n * The market for which to get the reviews from.\n */\n public localeListFilter: string;\n\n /**\n * Number of reviews to be shown on each page.\n */\n public pageSize: number;\n\n /**\n * Order in which reviews to be shown.\n */\n public orderBy: string;\n\n /**\n * Need to set this value if reviews need to be filtered with specific star rating .\n */\n public starFilters?: string;\n\n /**\n * Need to set this value if we need to skip few reviews.\n */\n public skipItems: number;\n\n /**\n * The continuation token.\n */\n public pageToken: string | null;\n\n /**\n * Selects which data sources to use to retrieve data.\n */\n public dataSources: string | null;\n\n /**\n * The ratings and reviews service endpoint.\n */\n public serviceEndpoint: string;\n\n constructor(\n productId: string,\n tenantId: string,\n localeListFilter: string,\n serviceEndpoint: string,\n orderBy: string = 'MostHelpful',\n starFilters: string = '',\n skipItems: number = 0,\n pageSize: number = 10,\n pageToken: string | null = null,\n dataSources: string | null = null\n ) {\n this.productId = productId;\n this.tenantId = tenantId;\n this.localeListFilter = localeListFilter;\n\n // Max page size which Rnr API supports is 25.\n // Hence if config has page size more than 25, we'll default it to 25.\n this.pageSize = pageSize > 25 ? 25 : pageSize;\n this.orderBy = orderBy;\n this.starFilters = starFilters;\n this.skipItems = skipItems;\n this.pageToken = pageToken;\n this.dataSources = dataSources;\n this.serviceEndpoint = serviceEndpoint;\n }\n\n public getCacheKey = () =>\n `${this.productId}-${this.tenantId}-${this.localeListFilter}-${this.pageSize}-${this.orderBy}-${this.starFilters}-${this.skipItems}`;\n\n public getCacheObjectType = () => 'ProductReview';\n\n public dataCacheType = (): CacheType => 'request';\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CacheType, IActionInput } from '@msdyn365-commerce/core';\n\n/**\n * These are the get user review API inputs.\n */\nexport class GetUserReviewInput implements IActionInput {\n /**\n * The Id representing the product to get the ratings for.\n */\n public productId: string;\n\n /**\n * The ID representing the tenant.\n */\n public tenantId: string;\n\n /**\n * The user's authorization token.\n */\n public authorization: string;\n\n /**\n * The ratings and reviews service endpoint.\n */\n public serviceEndpoint: string;\n\n constructor(productId: string, tenantId: string, authorization: string, serviceEndpoint: string) {\n this.productId = productId;\n this.tenantId = tenantId;\n this.authorization = authorization;\n this.serviceEndpoint = serviceEndpoint;\n }\n\n public getCacheKey = () => 'GetUserReview';\n\n public getCacheObjectType = () => 'GetUserReview';\n\n public dataCacheType = (): CacheType => 'none';\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction, IAction, IActionInput } from '@msdyn365-commerce/core';\nimport { GenericInput, getGenericAction } from '@msdyn365-commerce-modules/retail-actions';\n\nexport interface IRatingsReviewsState {\n filterKey: string;\n}\n\nexport function createRatingsReviewsStateInput(result: IRatingsReviewsState): GenericInput {\n return new GenericInput('ratingsReviewsState', result, 'ratingsReviewsStateInput');\n}\n\nconst createInternalRatingsReviewsStateInput = (): IActionInput => {\n return createRatingsReviewsStateInput({ filterKey: '1;2;3;4;5' });\n};\n\nexport const getGenericActionDataAction = createObservableDataAction({\n action: >getGenericAction,\n input: createInternalRatingsReviewsStateInput\n});\n\nexport default getGenericActionDataAction;\n"],"names":["createAccordionStateInput","result","GenericInput","getGenericActionDataAction","createObservableDataAction","action","getGenericAction","input","createAccordionStateInputInternal","ActiveImageInput","constructor","config","_cacheKey","getCacheObjectType","getCacheKey","this","dataCacheType","activePoints","ArrayExtensions","hasElements","activePointData","itemId","toString","createInput","inputData","getActiveImageproductAction","async","context","itemIds","map","push","ItemId","searchCriteriaInput","catalogId","getCatalogId","requestContext","validateCatalogId","Context","ChannelId","apiSettings","channelId","CatalogId","IncludeAttributes","ItemIds","Error","ProductsDataActions","callerContext","actionDataAction","id","GetAddressPurposesInput","buildCacheKey","getAddressPurposesAction","ctx","getAddressPurposesAsync","queryResultSettings","QueryResultSettingsProxy","getPagingFromInputDataOrDefaultValue","getAddressPurposesActionDataAction","GetCountryRegionsInput","locale","getCountryRegionsAction","getCountryRegionsByLanguageIdAsync","getCountryRegionsActionDataAction","GetCountryStateInput","getCountryStateAction","countryInput","countryRegionsInfo","channelConfiguration","channel","marketISOCode","ChannelCountryRegionISOCode","currentCountryRegion","find","countryRegion","ISOCode","countryRegionId","CountryRegionId","stateInput","GetStateProvincesInput","getStateProvinceAction","getCountryStateActionDataAction","getStateProvincesAsync","BaseStoreSelectorStateManager","listMapViewState","displayList","displayMap","preferredStoreLocalStorageKey","isMapModuleLoaded","value","_readFromToCookie","storeInfo","JSON","parse","undefined","preferredStore","_unused","_context","storeId","selectedStoreLocationId","storeName","writeToCookie","arguments","length","StoreId","StoreName","Latitude","Longitude","_writeToCookie","stringify","latitude","longitude","lastInlineShownStoreInfo","_removeCookie","key","MsDyn365","isBrowser","window","localStorage","removeItem","setItem","cookieValue","getItem","__decorate","computed","observable","MapStoreSelectorStateManager","SERVICE_ENDPOINT","MAP_API_ENDPOINT","searchTerm","actionContext","BingMapsApiKey","BingMapsEnabled","searchContent","jsonp","crypto","getRandomValues","Uint32Array","trim","query","encodeURI","geolocationApiUrl","app","requestUrl","Promise","resolve","script","document","createElement","setAttribute","data","remove","resourceSets","resources","point","coordinates","body","appendChild","_document","StringExtensions","isNullOrEmpty","getElementById","currentWindowAPI","mapAPIReady","isMapApiLoaded","url","lang","market","reject","_document2","_document3","type","defer","src","addEventListener","error","createStoreSelectorStateInput","GetBotFrameworkInput","Msdyn365","_msdyn365Commerce$sec","ISecretValue","msdyn365Commerce","secretManager","getSecretValue","baseUrl","apiToken","args","GetCardPaymentAcceptPointInput","shouldShowBillingAddress","paymentTenderType","amountDue","createCheckoutPaymentInstrumentInput","_inputData$config","getCardPaymentAcceptPointInput","getCardPaymentAcceptPointAction","_checkoutState$checko","telemetry","exception","checkoutState","getCheckoutState","catch","isEmptyOrNullObject","checkoutCart","cart","URL","origin","_get","cardPaymentAcceptSettings","_objectSpread","HostPageOrigin","AdaptorPath","CardPaymentEnabled","CardTokenizationEnabled","HideBillingAddress","TenderTypeId","PaymentAmount","AmountDue","RequireShippingAddress","CartsDataActions","bypassCache","Id","then","cardPaymentAcceptPoint","AcceptPageUrl","AcceptPageContent","debug","getCardPaymentAcceptPointActionDataAction","ActiveCheckoutCartProductsDetailsInput","createCartInput","getActiveCheckoutCartProductsDetailsAction","hasInvoiceLine","CartLines","getSimpleProducts","cartLine","ProductId","ProductInput","filter","Boolean","products","getActiveCheckoutCartProductsDetailsActionDataAction","shouldEnableSinglePaymentAuthorizationCheckout","isInCartPage","cartState","getCartState","getCartAmountDue","paymenTenderType","showBillingAddress","shouldPassLocaleToiFrame","showBillingAddres","get","Locale","getCardPaymentAcceptPointAsync","ActiveCheckoutCartProductsInput","getActiveCheckoutCartProductsAction","getActiveCheckoutCartProductsActionDataAction","createDataActionHook","actionId","postReaderHook","_inputs","_msdyn365","cartObject","Array","isArray","addedCartLines","telemetryData","addedProducts","getProductInfoFromCartLinesAsync","logEvent","TelemetryEvent","AddToCart","cartId","cartVersion","Version","orderId","OrderNumber","preReaderHook","inputs","actionInput","queryParams","addCartLinesParams","cartLines","e","cartLineProductUnits","CheckOut","simpleProduct","productInfo","getProductInfoFromSimpleProduct","productSku","ProductPageView","simpleProducts","forEach","product","salesOrder","salesObject","saleLineProductUnits","SalesLines","Purchase","affiliation","revenue","NetAmountWithoutTax","tax","TaxAmount","activeCart","removeCartLineIds","removedCartLineIds","productTransaction","removedCartLines","removedProducts","indexOf","LineId","some","RemoveFromCart","removeCartLinesParams","cartLineIds","productPromises","i","getByIdAsync","RecordId","productPrice","Price","productQuantity","Quantity","reason","all","recordId","productId","MasterProductId","productName","Name","Description","productChannelId","productChannelName","productCategoryId","productCategoryName","productCurrency","updatedCartLines","updatedProducts","UpdateInCart","updateCartLinesParams","MapDistributorSelectorStateManager","hideDistributorWarningLocalStorageKey","showDistributorDetailsOnMap","hideDistributorWarning","distributorWarning","_distributorSelectorContext","_distributorDetailContext","distributorList","distributorId","selectedDistributorId","_actionContext$reques","_actionContext$reques2","createDistributorSelectorStateInput","userId","initializeClientSide","console","log","eventName","payload","attributes","variantSet1","variantId","experimentId","variantSet2","variantSet3","variantSet4","getConfigForClientSideInit","getExperiments","name","experiments","friendlyName","description","status","State","Running","link","variations","Active","weight","Draft","createdDate","lastModifiedDate","lastModifiedBy","Paused","Archived","getVariantsForUser","match","activateExperiment","initialize","GetChannelIdentitiesInput","getChannelsAction","channels","getChannelsAsync","getChannels","channelIdentities","getChannelsActionDataAction","searchArea","Radius","Math","max","DistanceUnitValue","GetOrgUnitLocationsInput","getOrgUnitLocationsAction","orgUnitLocations","getOrgUnitLocationsByAreaAsync","getOrgUnitLocations","getOrgUnitLocationsActionDataAction","orderTypes","GetSalesOrderConfirmationWithHydrationsInput","orderType","getSalesOrderConfirmationWithHydrationsAction","trace","getSalesOrderDetailsBySalesIdAsync","getSalesOrderDetailsByTransactionIdAsync","getSalesOrder","TransactionTypeValue","TransactionType","SalesInvoice","productIds","salesLine","_salesLine$ProductId","productInputs","getProducts","validProducts","ObjectExtensions","isNullOrUndefined","deliveryOptions","getDeliveryOptionsAsync","message","getSalesOrderConfirmationWithHydrationsActionDataAction","salesId","transactionId","transaction","GetOrderOriginatorsInput","transactionIds","salesIds","searchCriteria","TransactionIds","SalesIds","getOriginatorsAction","SalesOrdersDataActions","createSalesOrderOriginatorsInput","_inputData$requestCon","getSalesOrderOriginatorsActionDataAction","GetSalesOrderDetailsByConfirmationInput","channelReferenceLookupCriteria","confirmationId","ChannelReferenceId","getSalesOrderDetailsByChannelReferenceIdAction","getSalesOrderDetailsByLookupCriteria","_context$requestConte","_getExtensibleEnumera","_getExtensibleEnumera2","propertyName","propertyValue","addtionalLookupParameter","queryArray","Object","entries","index","additionalFieldName","additionalFieldValue","orderStatusLookUpParameterTypeName","orderStatusLookUpParameterValue","getQueryStringParameters","orderLookupExtensibleEnum","StoreOperationsDataActions","item","TypeName","ExtensibleEnumerations","channelReferenceAdditionalLookupCriteria","retailProxyValue","toLocaleLowerCase","retailProxyTypeValue","Value","OrderLookupAdditionalCriteriaTypeValue","OrderLookupAdditionalCriteriaTypeParameterValue","additionalItem","ChannelReferenceAdditionalLookupCriteria","getProductsWithCatalog","productCatalog","GetSalesOrderWithHydrationsInput","_this$orderType","_this$orderId","_this$confirmationId","getSalesOrderWithHydrationsAction","_context$requestConte3","_featureStates$find","user","isAuthenticated","_context$requestConte2","SearchLocation","All","saleline","IsVoided","isEnabled","channelInfo","getOnlineChannelAsync","OnlineStoreCustomerTypeValue","isChannelTypeB2B","productCatalogIds","featureStates","getFeatureStatesAsync","featureState","IsEnabled","userCatalogIds","CatalogsDataActions","matchingProductCatalogIds","productCatalogId","userCatalogId","nonMatchingProductCatalogIds","matchingProducts","nonMatchingProducts","isSameSiteType","getSalesOrderWithHydrationsActionDataAction","GetTenderTypesInput","createTenderTyperInput","getTenderTypeAction","getTenderTypesAsync","getTenderTypeActionDataAction","GetDateRefinerOptionsInput","getDateRefinerOptionsAction","refinerOptions","DateRefinerOptionItem","LastSevenDays","LastThirtyDays","LastThreeMonths","LastSixMonths","Customized","getDateRefinerOptions","getDateRefinerOptionsActionDataAction","GetOrderStatusRefinerOptionsInput","getOrderStatusRefinerOptionsAction","OrderStatusRefinerOptionItem","Created","Invoiced","Canceled","getOrderStatusRefinerOptions","getOrderStatusRefinerOptionsActionDataAction","GetSearchOptionsInput","getSearchOptionsAction","searchOptions","SearchOption","ConfirmationId","ChannelName","CustomerRequisition","getSearchOptions","getSearchOptionsActionDataAction","GetSortOptionsInput","allowSortingByConfirmedShipDate","getSortOptionsAction","sortOptions","SortOption","CreatedDateTimeDescending","CreatedDateTimeAscending","ConfirmedShipDateDescending","ConfirmedShipDateAscending","getAllSortOptions","getSortOptionsWithoutConfirmedShipDate","getSortOptionsActionDataAction","showConfirmedShipDateSortingOptions","RefinerSourceType","ActiveOrderTemplateLinesInput","_requestContext$query","buildCacheKeyWithUrlTokens","shouldCacheOutput","orderTemplateId","fromModuleData","QueryResultSettings","count","getActiveOrderTemplateLines","getFullOrderTemplate","GetFullOrderTemplateInput","getActiveOrderTemplateLinesDataAction","CategoryPageSummaryInput","currentCategoryResult","getCurrentCategory","createGetCurrentCategoryInput","includeRootCategory","CurrentCategoryInput","currentCategory","categoryUrl","localName","getFriendlyName","NameTranslations","neutralizedName","NeutralizedName","getCategoryUrl","canonicalDomain","skipCount","skip","Url","urlParams","URLSearchParams","search","set","removeDomainQspFromUrl","_unused2","title","sharingImageUrl","OfflineImage","canonicalUrl","faviconUrl","sharingImage","PageSummaryInput","keywords","ListItemType","ListPageSummaryInput","getSubListItem","sitePathOfRequest","imageList","getImages","fields","content","images","sublistHref","listName","_name","sitePath","Title","ShortDescription","shortDescription","BackgroundColor","backgroundColor","ForegroundColor","foregroundColor","Href","Images","getSitePath","resultImageList","image","href","imageItem","altText","width","height","createGetListInput","listData","pageData","list","items","_id","getInputListData","listItems","productList","parentImageList","itemsPerPage","Number","isNaN","getItemsPerPage","getSkipCount","productItems","sum","clonedList","productItem","ListInput","getList","ProductPageSummaryInput","generateCacheKey","simpleProductsData","_input$catalogId","validValues","getByIdsAsync","simpleProductData","productUrl","productBrand","getProductUrlSync","_input$catalogId2","productAttributes","getAttributeValuesAsync","productAttribute","TextValue","getProductBrand","_unused3","generateImageUrl","PrimaryImageUrl","price","AdjustedPrice","getSelectedProductIdFromActionInput","GetProductsInPreviewProductComparisonInput","createGetProductsInPreviewProductComparisonInput","getProductsInPreviewProductComparisonAction","currentItems","accountInformation","getCustomer","GetCustomerInput","ProductComparisonState","instance","ProductComparisonItem","getItemId","getProductsInPreviewProductComparisonDataAction","addedDate","Date","super","_len","_key","_comparisonItems","listModifiedEvent","Event","_lastUpdateDate","now","setItems","_update","addItem","clearAll","currentItem","removeItemById","hasItem","includes","hasItemById","trigger","_requestContext","subscribe","instanceId","handler","cookies","_getCookieStorageKey","_retrieveItemsFromCookies","_instance","equals","_ref","_user$RecordId","_requestContext$siteP","customerAccountNumber","_productComparisonItemsLocalStorageKey","_readFromCookie","cookieContext","cookieKey","isConsentGiven","secure","maxAge","GetProductsInProductComparisonInput","createGetProductsInProductComparisonInput","loadProductsSpecifications","productsSpecificationsPromises","AttributesForSelectedVariantInput","ProductDetails","specificationsList","getAttributesForSelectedVariantAction","loadProductSpecifications","productsSpecifications","getProductsInProductComparisonAction","newInput","productsPromises","fullProductInput","FullProductInput","ProductDetailsCriteria","productsInfo","getFullProductsAction","loadFullProducts","ratingsPromises","GetRatingsSummaryInput","rnr","ratingInput","getRatingsSummary","ratings","loadRatings","productDimensions","productsDimensionPromises","_product$ProductDetai2","dimensionResult","Dimensions","_product$ProductDetai","ProductsDimensionAvailabilitiesInput","DimensionTypeValue","getDimensionAvailabilitiesForProductsAction","dimensions","masterId","productsDimensions","loadProductsDimensions","productData","ProductPrice","rating","specifications","productSpecifications","dimension","selectedProduct","createAttributesForSelectedVariantInput","activeProduct","selectedVariantInput","SelectedVariantInput","getSelectedVariant","productResult","attributeValues","channelInventoryConfiguration","getAttributeValuesByConfiguration","ActiveProductListInput","productListId","getActiveProductList","fullProductListInput","GetFullProductListInput","getFullProductList","getActiveProductListDataAction","createInputForProductReviews","GetProductReviewsInput","getRnrPartnerId","getRnrEndpointId","getReviewsForGivenProduct","tenantId","localeListFilter","pageSize","inputIsValid","serviceEndpoint","orderBy","skipItems","starFilters","pageToken","sendRequest","response","isTakenDown","pagingInfo","getReviewsForGivenProductDataAction","getUserReviewDataAction","authorization","errorMessage","headers","Authorization","statusText","userInfo","GetUserReviewInput","token","getRnrAuthEndpointId","dataSources","createRatingsReviewsStateInput","createInternalRatingsReviewsStateInput","filterKey"],"sourceRoot":""}