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AASuZ,GAAKvZ,EAASwZ,GAAK,GAAK,CAC1C,CACF,CAoBwBC,CAAeP,IAEnCE,EAAc1B,EAAkB2B,GAChCxP,EAAQ,EAEDA,EAAQuP,GAAaD,EAAMtP,GAASwP,EAAMxP,KACjD,KAAOA,EAAQyP,GAAa3B,EAAsBwB,EAAOtP,KAEzD,OAAOsP,CACT,gCCvGF,IAAI7B,EAAI,EAAQ,KACZoC,EAAU,EAAQ,IAClBC,EAA2B,EAAQ,KACnC/B,EAAQ,EAAQ,IAChBgC,EAAa,EAAQ,IACrBC,EAAa,EAAQ,IACrBC,EAAqB,EAAQ,KAC7BC,EAAiB,EAAQ,KACzBC,EAAgB,EAAQ,KAExBC,EAAyBN,GAA4BA,EAAyB9jB,UA0BlF,GAhBAyhB,EAAE,CAAEyB,OAAQ,UAAWC,OAAO,EAAMkB,MAAM,EAAMjB,SAP5BU,GAA4B/B,GAAM,WAEpDqC,EAAgC,QAAEha,KAAK,CAAEtF,KAAM,WAA0B,IAAK,WAA0B,GAC1G,KAIuE,CACrE,QAAW,SAAUwf,GACnB,IAAIC,EAAIN,EAAmB5e,KAAM0e,EAAW,YACxCS,EAAaR,EAAWM,GAC5B,OAAOjf,KAAKP,KACV0f,EAAa,SAAUd,GACrB,OAAOQ,EAAeK,EAAGD,KAAaxf,MAAK,WAAc,OAAO4e,CAAG,GACrE,EAAIY,EACJE,EAAa,SAAUjS,GACrB,OAAO2R,EAAeK,EAAGD,KAAaxf,MAAK,WAAc,MAAMyN,CAAG,GACpE,EAAI+R,EAER,KAIGT,GAAWG,EAAWF,GAA2B,CACpD,IAAIW,EAASV,EAAW,WAAW/jB,UAAmB,QAClDokB,EAAgC,UAAMK,GACxCN,EAAcC,EAAwB,UAAWK,EAAQ,CAAEC,QAAQ,GAEvE","sources":["webpack://Msdyn365.Commerce.Online/../../src/action-registrar.ts?ed12","webpack://Msdyn365.Commerce.Online/../../src/create-data-action.vnext.ts?cb4f","webpack://Msdyn365.Commerce.Online/../../src/wrap-data-action.ts?c6a2","webpack://Msdyn365.Commerce.Online/../../src/action-error.ts?76a5","webpack://Msdyn365.Commerce.Online/../../src/action-runtime-utils.ts?df0b","webpack://Msdyn365.Commerce.Online/../../../src/cache/retail-cache-helper.ts?35f4","webpack://Msdyn365.Commerce.Online/../../src/event-emitter.ts?da67","webpack://Msdyn365.Commerce.Online/../../src/action-executor.ts?e3c4","webpack://Msdyn365.Commerce.Online/../../../src/actions/get-catalogs.ts?b35c","webpack://Msdyn365.Commerce.Online/../../src/helpers.ts?e5d2","webpack://Msdyn365.Commerce.Online/../../src/action-context.ts?0ab9","webpack://Msdyn365.Commerce.Online/../../../src/actions/get-media-locations.ts?b49d","webpack://Msdyn365.Commerce.Online/../../../src/actions/get-additional-media-locations.ts?d6e0","webpack://Msdyn365.Commerce.Online/../../../src/actions/get-customer.ts?6b9b","webpack://Msdyn365.Commerce.Online/../../src/ICache.ts?b706","webpack://Msdyn365.Commerce.Online/../../src/cache-utils.ts?471a","webpack://Msdyn365.Commerce.Online/../../src/request-cache.ts?b274","webpack://Msdyn365.Commerce.Online/../../src/index.ts?0e3e","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/action-internal/node_modules/uuid/lib/bytesToUuid.js?8945","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/action-internal/node_modules/uuid/lib/rng-browser.js?6f88","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/action-internal/node_modules/uuid/v1.js?088e","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/internals/delete-property-or-throw.js?8052","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/internals/engine-ff-version.js?960c","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/internals/engine-is-ie-or-edge.js?874f","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/internals/engine-webkit-version.js?9560","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.array.sort.js?67f8","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.promise.finally.js?2389"],"sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n ActionPostHook,\n ActionPostReaderHook,\n ActionPreHook,\n ActionPreReaderHook,\n IAnyAction,\n msdyn365Commerce\n} from '@msdyn365-commerce/core-internal';\nimport { LogLevel, StaticTelemetry } from '@msdyn365-commerce/telemetry-internal';\n\nconst DEPRECATED_HOOK_TYPES = ['pre', 'post', 'preRead', 'postRead'];\n\nexport namespace ActionRegistrar {\n type ActionHook = ActionPreHook | ActionPostHook;\n\n export type ActionRegistration = {\n action?: IAnyAction;\n pre?: Set;\n post?: Set>;\n preRead?: Set;\n postRead?: Set>;\n preReader?: Set;\n postReader?: Set>;\n };\n\n interface IActionDictionary {\n [actionKey: string]: ActionRegistration;\n }\n\n const dataActionRegister: IActionDictionary = {};\n\n export const getRegistration = (id?: string): ActionRegistration | undefined => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((msdyn365Commerce).getPartnerOverrideAction && id) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const partnerDataAction = (msdyn365Commerce).getPartnerOverrideAction(id);\n if (partnerDataAction && partnerDataAction.default) {\n dataActionRegister[id].action = partnerDataAction.default;\n } else if (partnerDataAction && partnerDataAction.prototype && partnerDataAction.prototype.Action) {\n dataActionRegister[id].action = partnerDataAction;\n }\n }\n\n if (id) {\n return dataActionRegister[id];\n }\n\n return undefined;\n };\n\n export const unwrapAction = (action: IAnyAction): IAnyAction => {\n if (action && action.prototype && !action.prototype.isAction) {\n // registered action is an action wrapper. Unwrap it.\n return >action.prototype.Action;\n }\n return action;\n };\n /**\n * Gets the action registered with id\n * @param id - ID to look up action\n */\n export const getAction = (id?: string): IAnyAction | undefined => {\n if (!id) {\n return;\n }\n const registeredAction = getRegistration(id);\n if (registeredAction) {\n return >registeredAction.action;\n }\n return;\n };\n\n /**\n * registers action. Does nothing if action is already registered\n * @param id - ID to register action with\n * @param action - action to register\n */\n export const registerAction = (id: string, dataAction: IAnyAction): IAnyAction | undefined => {\n if (!id || !dataAction) {\n // unable to register no id or action\n return;\n }\n\n const actionRegister = dataActionRegister;\n\n if (actionRegister[id]) {\n const registration = actionRegister[id];\n registration.action = dataAction;\n return >actionRegister[id].action;\n } else {\n const registration = { action: dataAction };\n actionRegister[id] = registration;\n return dataAction;\n }\n };\n\n const registerHook = (\n hookType: 'pre' | 'post' | 'preRead' | 'postRead' | 'preReader' | 'postReader'\n ) => (id: string, hook: HookType) => {\n // deprecate read only hook\n if (!msdyn365Commerce.isBrowser && DEPRECATED_HOOK_TYPES.indexOf(hookType) > -1) {\n StaticTelemetry.log(\n LogLevel.Warning,\n `Data action hooks are deprecated and will be removed in later versions. Please use data action overrides to extend data actions. The related action of this ${hookType} hook is - ${id}`\n );\n }\n\n const registration = getRegistration(id);\n // coerce hook into an iterable\n const hooks = Array.isArray(hook) ? hook : [hook];\n if (!registration) {\n // If the registration does not exist init one with just the hooks\n const newRegistration: { [id: string]: unknown } = {};\n newRegistration[hookType] = new Set(hooks);\n dataActionRegister[id] = newRegistration;\n } else {\n // If the registration does exist merge new hooks with existing hooks\n const hookRegistration = registration[hookType] || new Set();\n hooks.forEach(h => {\n hookRegistration.add(h);\n });\n // @ts-ignore\n registration[hookType] = hookRegistration;\n }\n return hook;\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n export const registerPostHook = registerHook | ActionPostHook[]>('post');\n export const registerPreHook = registerHook('pre');\n export const registerPreReadOnlyHook = registerHook('preRead');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n export const registerPostReadOnlyHook = registerHook | ActionPostHook[]>('postRead');\n export const registerPreReaderHook = registerHook('preReader');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n export const registerPostReaderHook = registerHook | ActionPostReaderHook[]>('postReader');\n\n export const getPreHooks = (id: string) => {\n const actionRegistration = getRegistration(id);\n return actionRegistration && actionRegistration.pre;\n };\n\n export const getPostHooks = (id: string) => {\n const actionRegistration = getRegistration(id);\n return actionRegistration && actionRegistration.post;\n };\n\n export const getPreReadHooks = (id: string) => {\n const actionRegistration = getRegistration(id);\n return actionRegistration && actionRegistration.preRead;\n };\n\n export const getPostReadHooks = (id: string) => {\n const actionRegistration = getRegistration(id);\n return actionRegistration && actionRegistration.postRead;\n };\n\n export const getPreReaderHooks = (id: string) => {\n const actionRegistration = getRegistration(id);\n return actionRegistration && actionRegistration.preReader;\n };\n export const getPostReaderHooks = (id: string) => {\n const actionRegistration = getRegistration(id);\n return actionRegistration && actionRegistration.postReader;\n };\n\n /**\n * Resolves the action and returns first action in action chain. Registers action if not yet registered\n * @param id - Action id to look up or register under\n * @param action - Action function\n */\n export const resolveAction = (id: string, action: IAnyAction): IAnyAction | undefined => {\n return getAction(id) || >registerAction(id, action) || action;\n };\n\n export const resolveRegistration = (\n id: string,\n action: IAnyAction,\n preHooks?: ActionPreHook[],\n postHooks?: ActionPostHook[],\n preReadHooks?: ActionPreHook[],\n postReadHooks?: ActionPostHook[],\n preReaderHooks?: ActionPreReaderHook[],\n postReaderHooks?: ActionPostReaderHook[]\n ) => {\n const resolvedAction = resolveAction(id, action);\n if (!resolvedAction) {\n return;\n }\n preHooks && registerPreHook(id, preHooks);\n postHooks && registerPostHook(id, postHooks);\n preReadHooks && registerPreReadOnlyHook(id, preReadHooks);\n postReadHooks && registerPostReadOnlyHook(id, postReadHooks);\n preReaderHooks && registerPreReaderHook(id, preReaderHooks);\n postReaderHooks && registerPostReaderHook(id, postReaderHooks);\n return getRegistration(id);\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, IActionInput, IActionWrapperPrototype, IObservableAction } from '@msdyn365-commerce/core-internal';\nimport { AsyncResult } from '@msdyn365-commerce/retail-proxy';\nimport { dataActionOptions, wrapDataAction } from './wrap-data-action';\n\n/**\n * Higher order function which exposes the current method as an action\n * @param action The action method\n * @param isBatched If the service call can handle batched requests efficiently\n * @param input Optional parameter of a single instance or an array of IActionInputs that will be passed to the action method.\n */\nexport const createObservableDataAction = (options: dataActionOptions): IObservableAction => {\n const wrappedAction = wrapDataAction(\n options,\n (arg1: IActionInput | IActionInput[], arg2: IActionContext): AsyncResult => {\n return new AsyncResult((resolve, reject) => {\n arg2.chainAction(options.action, arg1)\n .then(result => {\n resolve(result);\n })\n .catch(error => {\n reject(error);\n });\n });\n }\n );\n (wrappedAction.prototype).setProperty('isObservable', true);\n return >wrappedAction;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IAction, IActionInput, IObservableAction } from '@msdyn365-commerce/core-internal';\nimport { ActionRegistrar } from './action-registrar';\n\nexport type dataActionOptions = {\n action: IAction;\n isBatched?: boolean;\n id?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n input?: (...args: any[]) => IActionInput | IActionInput[];\n};\n\ntype IActionWrap = IAction | IObservableAction;\n\n/**\n * Wraps a data action with the associated action wrap.\n * @param options\n * @param actionWrap\n */\nexport const wrapDataAction = (options: dataActionOptions, actionWrap: IActionWrap): IActionWrap => {\n if (!options) {\n throw new Error('wrapDataAction called with invalid options. Options should have atleast action defined');\n }\n\n if (!options.action) {\n throw new Error(\n `Received invalid actions when attempting to parse options. Input name: ${options.input ? options.input.name : 'undefined'}`\n );\n }\n\n let inputFunc = options.input!;\n let id = options.id;\n let isBatched = options.isBatched!;\n options.action.prototype = {\n id,\n isBatched,\n isAction: true\n };\n\n actionWrap.prototype = {\n id,\n isAction: false,\n _action: options.action,\n set RegistrationId(registrationId: string) {\n options.action.prototype.RegistrationId = registrationId;\n },\n get RegistrationId(): string {\n return options.action.prototype.RegistrationId || '';\n },\n set inputFunc(func: Function) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (inputFunc) = func;\n },\n get inputFunc(): Function {\n return inputFunc;\n },\n get isBatched(): boolean {\n return isBatched;\n },\n set isBatched(_isBatched: boolean) {\n isBatched = _isBatched;\n },\n get Action(): IAction {\n return options.action;\n },\n set Action(newAction: IAction) {\n // There are no getter/setters on the action function prototype so this behaves as expected.\n inputFunc = newAction.prototype.input || inputFunc;\n id = newAction.prototype.id || id;\n isBatched = newAction.prototype.isBatched || isBatched;\n newAction.prototype = { ...newAction.prototype, ...options.action.prototype };\n options.action = newAction;\n },\n setProperty: (propertyName: string, value: unknown) => {\n options.action.prototype[propertyName] = value;\n actionWrap.prototype[propertyName] = options.action.prototype[propertyName];\n }\n };\n if (actionWrap.prototype.id) {\n ActionRegistrar.registerAction(actionWrap.prototype.id, actionWrap);\n }\n\n return actionWrap;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * Known action error failure states\n */\nexport const enum ActionErrorStatus {\n Timeout = 'Timeout',\n HookTimeout = 'Hook Timeout',\n ServiceUnavailable = 'Service Unavailable'\n}\n\n/**\n * Action Error Wrapper\n */\nexport class ActionError extends Error {\n public static readonly Name: string = 'ActionError';\n\n public error?: unknown;\n public status?: ActionErrorStatus;\n\n /**\n * Checks if an object is an action error\n */\n public static isActionError(error: unknown): boolean {\n return error instanceof Error && (error).name === ActionError.Name;\n }\n\n public static isTimeoutError(error: unknown): boolean {\n return error && (error).status === ActionErrorStatus.Timeout;\n }\n\n public static isServiceUnavailable(error: unknown): boolean {\n return error && (error).status === ActionErrorStatus.ServiceUnavailable;\n }\n\n /**\n * Action Errors\n * @param error Original Error\n */\n constructor(error: ActionErrorStatus | Error);\n constructor(error: Error) {\n super();\n this.name = ActionError.Name;\n if (error instanceof Error) {\n this.message = error.message;\n this.error = error;\n } else {\n if (error === ActionErrorStatus.Timeout) {\n this.status = error;\n this.message = 'Action Timeout';\n } else if (error === ActionErrorStatus.HookTimeout) {\n this.status = error;\n this.message = 'Action hook Timeout';\n } else if (error === ActionErrorStatus.ServiceUnavailable) {\n this.status = error;\n this.message = 'Action failed due to service unavailable';\n } else if (typeof error === 'string') {\n this.message = error;\n } else {\n this.error = error;\n }\n }\n\n // As of Typescript 2.1 if we extend the Error object the prototype must be set explicitly\n // See: https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\n Object.setPrototypeOf(this, ActionError.prototype);\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { AppCache, ICache } from '@msdyn365-commerce/cache-internal';\nimport { IActionInput } from '@msdyn365-commerce/core-internal';\n\n/**\n * Method to indicate if the action should look in app cache for data\n * @param input ActionInput\n */\nexport const shouldReadFromAppCache = (input: IActionInput, appCache: ICache | null): boolean => {\n return !!appCache && input && input.dataCacheType !== undefined && input.dataCacheType() !== 'none';\n};\n\n/**\n * Method to indicate if the action should write in app cache\n * @param input ActionInput\n */\nexport const shouldWriteToAppCache = (input: IActionInput, appCache: ICache | null): boolean => {\n return isAppCacheData(input, appCache);\n};\n\n/**\n * Method to indicate if the action's cache type is application\n * @param input ActionInput\n */\nexport const isAppCacheData = (input: IActionInput, appCache: ICache | null): boolean => {\n if (!appCache) {\n return false;\n }\n\n if (input) {\n if (input.dataCacheType !== undefined && input.dataCacheType() === 'application') {\n return true;\n }\n\n // if an entity has a cache setting defined, we cache that entity - caching retail proxy actions\n return (appCache).hasCacheSetting(input.getCacheObjectType());\n }\n\n return false;\n};\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 { ICache, ICacheItem, ICacheSource } from '@msdyn365-commerce/cache-internal';\nimport { IActionInput, IRequestContext, msdyn365Commerce, verboseLogger } from '@msdyn365-commerce/core-internal';\nimport { AsyncResult, DataServiceRequest, isAsyncResult } from '@msdyn365-commerce/retail-proxy';\nimport { IInternalTelemetry, ITelemetry } from '@msdyn365-commerce/telemetry-internal';\n\nconst GET_FROM_RETURNIDENTIFIER: string = '___GET__FROM__RETURNIDENTIIER___';\n\nexport const addLocaleInformation = (inputs: IActionInput | IActionInput[], locale: string): void => {\n const isArray = Array.isArray(inputs);\n if (isArray) {\n const actionInputs = (inputs || []) as IActionInput[];\n actionInputs.forEach(input => {\n if (input instanceof DataServiceRequest && !input.getCacheKey().endsWith(`-${locale}`)) {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const tmp = input._cacheKeyFromInput;\n // @ts-ignore -- accessing a private class variable which is a valid JS\n input._cacheKeyFromInput = `${tmp}-${locale}`;\n }\n });\n } else {\n if (inputs instanceof DataServiceRequest && !inputs.getCacheKey().endsWith(`-${locale}`)) {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const tmp = inputs._cacheKeyFromInput;\n // @ts-ignore -- accessing a private class variable which is a valid JS\n inputs._cacheKeyFromInput = `${tmp}-${locale}`;\n }\n }\n};\n\nconst _resolveCacheEntryReference = (\n dataServiceRequest: DataServiceRequest,\n item: any,\n requestCache: ICache,\n appCache: ICache,\n shouldReadFromAppCache?: boolean,\n isWrappingPromise?: boolean,\n isObservable: boolean = true\n) => {\n const cacheValueAsArray = (item.key as string[])\n .map(key => {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheObjectType = dataServiceRequest._cacheObjectType;\n\n const value = requestCache.get({ typeName: cacheObjectType, key });\n if (!value && shouldReadFromAppCache && appCache) {\n appCache.copyTo({ typeName: cacheObjectType, key }, requestCache, isObservable);\n }\n\n if (!value || !value.item) {\n return undefined;\n }\n\n const valueItem: any = value.item;\n\n if (isAsyncResult(valueItem)) {\n return valueItem.result;\n }\n\n return valueItem;\n })\n .filter(data => data !== undefined && data !== null);\n\n if ((item.key as string[]).length > cacheValueAsArray.length) {\n return;\n }\n\n // If we are returning a Promise that represents a future collection, we need to unwrap it\n // @ts-ignore -- accessing a private class variable (_query) which is a valid JS\n const isReturnTypeACollection = dataServiceRequest._query.isReturnTypeACollection;\n\n return cacheValueAsArray && cacheValueAsArray.length > 0\n ? isReturnTypeACollection && !isWrappingPromise\n ? cacheValueAsArray\n : cacheValueAsArray[0]\n : undefined;\n};\n\nconst logTelemetrySource = (\n cacheValue: ICacheItem,\n dataServiceRequest: DataServiceRequest,\n cacheKey: string,\n context: IRequestContext,\n telemetry?: ITelemetry | IInternalTelemetry\n) => {\n if (!telemetry) {\n return;\n }\n if (!msdyn365Commerce.isBrowser) {\n switch (cacheValue.s!) {\n case ICacheSource.AppCache: {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheObjectType = dataServiceRequest._cacheObjectType || 'none';\n\n verboseLogger(context, telemetry, 'dataAction with {actiontype}, {cacheKey}. source {cacheSource}', {\n values: [cacheObjectType, cacheKey, 'AppCache']\n });\n break;\n }\n case ICacheSource.RequestCache: {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheObjectType = dataServiceRequest._cacheObjectType || 'none';\n\n verboseLogger(context, telemetry, 'dataAction with {actiontype}, {cacheKey}. source {cacheSource}', {\n values: [cacheObjectType, cacheKey, 'RequestCache']\n });\n break;\n }\n default: {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheObjectType = dataServiceRequest._cacheObjectType || 'none';\n\n verboseLogger(context, telemetry, 'dataAction with {actiontype}, {cacheKey}. source {cacheSource}', {\n values: [cacheObjectType, cacheKey, 'Default']\n });\n break;\n }\n }\n }\n};\n\nconst readCacheEntriesBasedOnCacheKeyFromReturnType = (\n dataServiceRequest: DataServiceRequest,\n requestCache: ICache,\n appCache: ICache,\n shouldReadFromAppCache: boolean,\n context: IRequestContext,\n telemetry?: ITelemetry | IInternalTelemetry,\n isObservable: boolean = true\n): any => {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheKeyFromReturnType = dataServiceRequest._cacheKeyFromReturnType;\n\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheKeyIdentifierFromReturnType = dataServiceRequest._cacheKeyIdentifierFromReturnType;\n\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheObjectType = dataServiceRequest._cacheObjectType;\n\n if (cacheKeyFromReturnType.length === 0) {\n return { entry: null, shouldRefresh: false };\n }\n let shouldRefreshAll = true;\n const cacheEntries = cacheKeyFromReturnType\n .map((entry: any) => {\n const key = `${cacheKeyIdentifierFromReturnType}-${entry}`;\n\n let cacheValue = requestCache.get({ typeName: cacheObjectType, key });\n\n if (!cacheValue && shouldReadFromAppCache && appCache) {\n cacheValue = appCache.copyTo({ typeName: cacheObjectType, key }, requestCache, isObservable);\n }\n\n if (!cacheValue || !cacheValue.item) {\n return null;\n }\n // according to the logic, will treat the entries to shouldRefresh when all entries have shouldRefresh.\n if (!cacheValue.shouldRefresh) {\n shouldRefreshAll = false;\n }\n logTelemetrySource(cacheValue, dataServiceRequest, key, context, telemetry);\n\n return cacheValue.item;\n })\n .filter(Boolean);\n\n // @ts-ignore -- accessing a private class variable (_query) which is a valid JS\n const isReturnTypeACollection = dataServiceRequest._query.isReturnTypeACollection;\n const cacheEntriesReturn = cacheEntries && cacheEntries.length > 0 ? (isReturnTypeACollection ? cacheEntries : cacheEntries[0]) : null;\n return { entry: cacheEntriesReturn, shouldRefresh: shouldRefreshAll };\n};\n\nexport const readCacheEntries = (\n dataServiceRequest: DataServiceRequest,\n requestCache: ICache,\n appCache: ICache,\n shouldReadFromAppCache: boolean = false,\n context: IRequestContext,\n telemetry?: ITelemetry | IInternalTelemetry,\n isObservable: boolean = true\n): any => {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheKeyFromReturnType = dataServiceRequest._cacheKeyFromReturnType;\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheObjectType = dataServiceRequest._cacheObjectType;\n\n if (!requestCache || (!dataServiceRequest.getCacheKey() && cacheKeyFromReturnType.length === 0) || !cacheObjectType) {\n return { entry: null, shouldRefresh: false };\n }\n\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheKeyFromInput = dataServiceRequest._cacheKeyFromInput;\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheKeyIdentifierFromReturnType = dataServiceRequest._cacheKeyIdentifierFromReturnType;\n\n if (cacheKeyFromInput === GET_FROM_RETURNIDENTIFIER || (cacheKeyIdentifierFromReturnType && cacheKeyFromReturnType.length !== 0)) {\n const entries = readCacheEntriesBasedOnCacheKeyFromReturnType(\n dataServiceRequest,\n requestCache,\n appCache,\n shouldReadFromAppCache,\n context,\n telemetry,\n isObservable\n );\n if (entries && entries.entry) {\n return entries;\n }\n }\n const cacheKey = { typeName: cacheObjectType, key: cacheKeyFromInput };\n\n let cachedValueBasedOnInput = requestCache.get(cacheKey);\n if (cachedValueBasedOnInput) {\n cachedValueBasedOnInput = { ...cachedValueBasedOnInput };\n } else if (shouldReadFromAppCache && appCache) {\n cachedValueBasedOnInput = appCache.copyTo(cacheKey, requestCache, isObservable);\n }\n\n if (!cachedValueBasedOnInput) {\n return readCacheEntriesBasedOnCacheKeyFromReturnType(\n dataServiceRequest,\n requestCache,\n appCache,\n shouldReadFromAppCache,\n context,\n telemetry,\n isObservable\n );\n }\n logTelemetrySource(cachedValueBasedOnInput, dataServiceRequest, cacheKeyFromInput, context, telemetry);\n\n if (cachedValueBasedOnInput.item instanceof AsyncResult) {\n if (cachedValueBasedOnInput.item.status !== 'LOADING') {\n cachedValueBasedOnInput.item = cachedValueBasedOnInput.item.result || cachedValueBasedOnInput.item.error;\n } else {\n const asyncResult = cachedValueBasedOnInput.item.then(result => {\n if (typeof result !== 'object' || result.$ref !== true) {\n return result;\n }\n\n return _resolveCacheEntryReference(\n dataServiceRequest,\n result,\n requestCache,\n appCache,\n shouldReadFromAppCache,\n isObservable\n );\n });\n return { entry: asyncResult, shouldRefresh: cachedValueBasedOnInput.shouldRefresh };\n }\n }\n\n if (\n typeof cachedValueBasedOnInput.item !== 'object' ||\n (cachedValueBasedOnInput.item &&\n // @ts-ignore -- $ref property does not exists in type object\n cachedValueBasedOnInput.item.$ref !== true)\n ) {\n return { entry: cachedValueBasedOnInput.item, shouldRefresh: cachedValueBasedOnInput.shouldRefresh };\n }\n\n const cachedValueBasedOnInputItem: any = cachedValueBasedOnInput.item;\n\n const resolvedRef = _resolveCacheEntryReference(\n dataServiceRequest,\n cachedValueBasedOnInput.item,\n requestCache,\n appCache,\n shouldReadFromAppCache,\n isAsyncResult(cachedValueBasedOnInputItem),\n isObservable\n );\n return { entry: resolvedRef, shouldRefresh: cachedValueBasedOnInput.shouldRefresh };\n};\n\nconst _saveEntityToCache = (\n dataServiceRequest: DataServiceRequest,\n data: any,\n requestCache: ICache,\n appCache: ICache,\n isCacheTypeApplication: boolean,\n isInstance: boolean = false\n): { [cacheKey: string]: any } | undefined => {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheKeyFromInput = dataServiceRequest._cacheKeyFromInput;\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheKeyIdentifierFromReturnType = dataServiceRequest._cacheKeyIdentifierFromReturnType;\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const dataServiceRequestQuery = dataServiceRequest._query;\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheObjectType = dataServiceRequest._cacheObjectType;\n\n if (!data || (!cacheKeyFromInput && !cacheKeyIdentifierFromReturnType)) {\n return;\n }\n\n const cacheEntries: any = {};\n const results = data;\n\n // using Object.prototype instead of Array.isArray because results can be Observable Array which can't be detected with Array.isArray\n if (!dataServiceRequestQuery.isReturnTypeACollection || Object.prototype.toString.call(results) !== '[object Array]') {\n if (cacheKeyIdentifierFromReturnType) {\n const key = `${cacheKeyIdentifierFromReturnType}-${results[cacheKeyIdentifierFromReturnType]}`;\n cacheEntries[key] = results;\n if (cacheKeyFromInput) {\n let existingCacheItem = requestCache.get({\n typeName: cacheObjectType,\n key: cacheKeyFromInput\n });\n if (existingCacheItem) {\n existingCacheItem = { ...existingCacheItem };\n }\n\n if (\n existingCacheItem &&\n existingCacheItem.item &&\n (!(existingCacheItem.item instanceof AsyncResult) || existingCacheItem.item.status === 'SUCCESS') &&\n (typeof existingCacheItem.item !== 'object' ||\n (existingCacheItem &&\n existingCacheItem.item &&\n // @ts-ignore -- $ref property does not exists in type object\n existingCacheItem?.item?.$ref !== true))\n ) {\n cacheEntries[cacheKeyFromInput] = results;\n } else {\n cacheEntries[cacheKeyFromInput] = {\n $ref: true,\n type: cacheObjectType,\n identifier: cacheKeyIdentifierFromReturnType,\n key: [key],\n // @ts-ignore -- accessing a private class variable which is a valid JS\n count: dataServiceRequest._totalCount\n };\n }\n }\n } else {\n cacheEntries[cacheKeyFromInput] = results;\n }\n } else if (!cacheKeyIdentifierFromReturnType) {\n cacheEntries[cacheKeyFromInput] = results;\n } else {\n const cacheValue = results\n .map((result: { [x: string]: any }) => {\n const identifierValue = result[cacheKeyIdentifierFromReturnType];\n if (identifierValue) {\n const key = `${cacheKeyIdentifierFromReturnType}-${identifierValue}`;\n cacheEntries[key] = result;\n return key;\n }\n })\n .filter(Boolean);\n let existingCacheItem = requestCache.get({\n typeName: cacheObjectType,\n key: cacheKeyFromInput\n });\n if (existingCacheItem) {\n existingCacheItem = { ...existingCacheItem };\n }\n if (\n existingCacheItem &&\n existingCacheItem.item &&\n (!(existingCacheItem.item instanceof AsyncResult) || existingCacheItem.item.status === 'SUCCESS') &&\n (typeof existingCacheItem.item !== 'object' ||\n (existingCacheItem &&\n existingCacheItem.item &&\n // @ts-ignore -- $ref property does not exists in type object\n existingCacheItem.item.$ref !== true))\n ) {\n cacheEntries[cacheKeyFromInput] = results;\n } else {\n if (existingCacheItem) {\n // @ts-ignore - _cacheObjectType does not exist in type ICacheItem\n const existingCacheObjectType = existingCacheItem._cacheObjectType;\n // @ts-ignore - _cacheKeyIdentifierFromReturnType does not exist in type ICacheItem\n const existingCacheKeyIdentifierFromReturnType = existingCacheItem._cacheKeyIdentifierFromReturnType;\n // @ts-ignore - _query does not exist in type ICacheItem\n const existingCacheIsReturnTypeACollection = existingCacheItem._query.isReturnTypeACollection;\n // @ts-ignore - _totalCount does not exist in type ICacheItem\n const existingCacheTotalCount = existingCacheItem._totalCount;\n\n cacheEntries[cacheKeyFromInput] = {\n $ref: true,\n type: existingCacheObjectType,\n identifier: existingCacheKeyIdentifierFromReturnType,\n isCollection: existingCacheIsReturnTypeACollection,\n key: cacheValue,\n count: existingCacheTotalCount\n };\n }\n }\n }\n\n if (cacheEntries) {\n Object.keys(cacheEntries).map(entryKey => {\n requestCache.put(\n { typeName: cacheObjectType, key: entryKey },\n { item: cacheEntries[entryKey], ...(isInstance && { instance: 'instance' }) }\n );\n\n if (appCache && isCacheTypeApplication) {\n appCache.put(\n { typeName: cacheObjectType, key: entryKey },\n { item: cacheEntries[entryKey], ...(isInstance && { instance: 'instance' }) }\n );\n }\n });\n }\n\n return cacheEntries;\n};\n\nexport const saveCacheEntries = (\n dataServiceRequest: DataServiceRequest,\n data: AsyncResult | any,\n requestCache: ICache,\n appCache: ICache,\n isCacheTypeApplication: boolean,\n isInstance: boolean = false\n): { [cacheKey: string]: any } | undefined => {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheKeyFromInput = dataServiceRequest._cacheKeyFromInput;\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheKeyIdentifierFromReturnType = dataServiceRequest._cacheKeyIdentifierFromReturnType;\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheObjectType = dataServiceRequest._cacheObjectType;\n\n // if return Entity is collection\n // if entity type has identifier/primary key\n // 1. cache array of primay key value of returned entity collection on input cache key\n // 2. cache individual entity on primary key\n // else\n // 1. cache output on input cache key\n //\n // else if entity type has identifier/primary key\n // 2. cache output entity on primary key\n if (!data || (!cacheKeyFromInput && !cacheKeyIdentifierFromReturnType) || !cacheObjectType) {\n return;\n }\n\n if (data instanceof AsyncResult) {\n // For a loading Promise, cache based on input cachekey, and then cache output again once complete\n if (data.status === 'LOADING') {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n data.then((result: any) => {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n if (dataServiceRequest._totalCount !== undefined) {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n data.metadata.count = dataServiceRequest._totalCount;\n }\n // @ts-ignore -- accessing a private class variable which is a valid JS\n if (dataServiceRequest && dataServiceRequest._otherOdata) {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n data.metadata.others = dataServiceRequest._otherOdata;\n }\n\n _saveEntityToCache(dataServiceRequest, result, requestCache, appCache, isCacheTypeApplication, isInstance);\n return result;\n });\n requestCache.put(\n { typeName: cacheObjectType, key: cacheKeyFromInput },\n { item: data, ...(isInstance && { instance: 'instance' }) }\n );\n\n if (appCache && isCacheTypeApplication) {\n appCache.put(\n { typeName: cacheObjectType, key: cacheKeyFromInput },\n { item: data, ...(isInstance && { instance: 'instance' }) }\n );\n }\n // For a completed promise, save the action results to the cache\n } else {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n if (dataServiceRequest._totalCount !== undefined) {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n data.metadata.count = dataServiceRequest._totalCount;\n }\n // @ts-ignore -- accessing a private class variable which is a valid JS\n if (dataServiceRequest && dataServiceRequest._otherOdata) {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n data.metadata.others = dataServiceRequest._otherOdata;\n }\n _saveEntityToCache(dataServiceRequest, data.result, requestCache, appCache, isCacheTypeApplication, isInstance);\n return data.result;\n }\n } else {\n return _saveEntityToCache(dataServiceRequest, data, requestCache, appCache, isCacheTypeApplication, isInstance);\n }\n};\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 { EventEmitter } from 'events';\n\n/** EventEmitter is available in node, but not on the browser,\n * this class attempts to polyfill that so the action context can remain Isomorphic\n */\n/* @internal*/\n\n/**\n * Type for event emitter listener callback\n */\nexport type ListenerCallback = (...args0: T) => void;\n\n/**\n * Generic cast type\n */\nexport type GenericCallback = (...args: any) => void;\n\n/**\n * Custom isomorphic event emitter implementation\n *\n * @export\n * @class CustomEventEmitter\n */\nclass CustomEventEmitter {\n private listeners: Map = new Map();\n private eventEmitter: EventEmitter | null = typeof window !== undefined ? null : new EventEmitter();\n\n public on(event: string, callback: ListenerCallback): void {\n if (!!this.eventEmitter) {\n this.eventEmitter.on(event, callback);\n } else {\n let listeners = this.listeners.get(event);\n if (!!!listeners) {\n listeners = [];\n this.listeners.set(event, listeners);\n }\n\n listeners.push(callback);\n }\n }\n\n public emit(event: string, ...args: T): boolean {\n if (!!this.eventEmitter) {\n return this.eventEmitter.emit(event, args);\n }\n\n const listeners = this.listeners.get(event);\n\n if (listeners && listeners.length) {\n listeners.forEach(listener => {\n listener(...args);\n });\n return true;\n }\n\n return false;\n }\n\n public removeAllListeners(event: string): void {\n if (!!this.eventEmitter) {\n this.eventEmitter.removeAllListeners(event);\n } else {\n this.listeners.delete(event);\n }\n }\n}\n\nexport default new CustomEventEmitter();\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ICache, ICacheItem, ICacheKey } from '@msdyn365-commerce/cache-internal';\nimport {\n CacheType,\n IActionContext,\n IActionInput,\n IAnyAction,\n IDataActionOptions,\n msdyn365Commerce,\n verboseLogger,\n checkVersionForFeature,\n getPerformanceUtils\n} from '@msdyn365-commerce/core-internal';\nimport { AsyncResult, DataServiceRequest, ErrorTypeEnum, isAsyncResult, ProxyError } from '@msdyn365-commerce/retail-proxy';\nimport { asSystemMetadata, ITelemetry, LogLevel, StaticTelemetry } from '@msdyn365-commerce/telemetry-internal';\nimport { get as _get, uniqWith } from 'lodash';\nimport { toJS } from 'mobx';\nimport uuidv1 from 'uuid/v1';\n\nimport { ActionError, ActionErrorStatus } from './action-error';\nimport { ActionRegistrar } from './action-registrar';\nimport { isAppCacheData, shouldReadFromAppCache, shouldWriteToAppCache } from './action-runtime-utils';\nimport { readCacheEntries, saveCacheEntries } from './cache/retail-cache-helper';\nimport EventHelper from './event-emitter';\n\nconst defaultTimeoutInMS: number = 4000;\nconst defaultHookTimeoutInMS: number = 1000;\nexport const CLIENT_HYDRATE_KEY = 'clientHydrateKey';\nexport const CLIENT_HYDRATE_TYPE = 'clientHydrate';\n\nconst Timer = (timeoutInMS: number, message: unknown) => new Promise(resolve => setTimeout(resolve.bind(resolve, message), timeoutInMS));\n\nconst ActionTimer = (timeoutInMS: number) =>\n new Promise((_resolve, reject) => setTimeout(reject.bind(reject, ActionErrorStatus.Timeout), timeoutInMS));\n\nconst ObservableActionTimer = (timeoutInMS: number) =>\n new AsyncResult((_resolve, reject) => setTimeout(reject.bind(reject, ActionErrorStatus.Timeout), timeoutInMS));\n\n/* @internal */\n/**\n * This class contains the logic to batch and de-dupe the actions that can be executed.\n * This class is also responsible for checking and saving the action response to cache.\n */\nexport default class ActionExecutor {\n public readonly action: Function;\n public readonly cacheType: CacheType;\n private readonly isBatched: boolean;\n private readonly eventId: string;\n private readonly isObservable: boolean;\n\n private inputs: IActionInput[];\n /**\n * @param action the action to execute\n * @param inputs the action input\n */\n constructor(action: Function, inputs: IActionInput[], telemetry: ITelemetry, dataActionOption?: IDataActionOptions) {\n this.action = action;\n this.eventId = uuidv1();\n this.inputs = [...inputs]; // Cloning it DO NOT use the reference\n this.isBatched = action.prototype.isBatched;\n\n this.isObservable = action.prototype.isObservable;\n\n // Cache all the calls on browser\n const masterInput = inputs[0];\n\n if (masterInput && masterInput.dataCacheType) {\n this.cacheType = masterInput.dataCacheType();\n } else if (masterInput && masterInput.shouldCacheOutput) {\n this.cacheType = masterInput.shouldCacheOutput() ? 'request' : 'none';\n telemetry.trace('shouldCacheOutput property has been deprecated. Please update the IActionInput to use dataCacheType');\n } else {\n this.cacheType = (dataActionOption && dataActionOption.cacheType) || 'none';\n // for data actions who do not have dataCacheType function, we add customer defined cachtype to the action.\n // this is used for later check if the data acton should be read from app cache.\n inputs.forEach(input => {\n input.dataCacheType = () => this.cacheType;\n });\n telemetry.trace('Neither dataCacheType nor shouldCacheOutput are set. Caching strategy will fall back to \"none\"');\n }\n }\n\n /**\n *\n * @param inputs add more inputs\n */\n public addInputs(inputs: IActionInput[]): void {\n this.inputs.push(...inputs);\n }\n\n /** Execute the action */\n public async execute(\n context: IActionContext,\n requestCache: ICache,\n appCache: ICache | null,\n bypassAppCache?: boolean,\n refreshingInputs: IActionInput[] = []\n ): Promise {\n const unique: IActionInput[] =\n refreshingInputs && refreshingInputs.length > 0\n ? this._removeDuplicates(refreshingInputs)\n : this._removeDuplicates(this.inputs);\n if (!unique.length) {\n return [];\n }\n\n const actionId = this._getActionIdFromInputs(unique);\n\n const performanceUtils = getPerformanceUtils(msdyn365Commerce, context);\n const executionId = performanceUtils?.performanceUtilsPackage.Random.Guid.generateGuid();\n\n performanceUtils?.performanceUtilsPackage.runPreReadonlyDataActionPerformanceHook({\n actionId,\n executionId,\n internalCache: performanceUtils.cache\n });\n\n const result = await this._executeDataAction(context, requestCache, appCache, bypassAppCache, refreshingInputs, unique, actionId);\n\n performanceUtils?.performanceUtilsPackage.runPostReadonlyDataActionPerformanceHook({\n actionId,\n executionId,\n internalCache: performanceUtils.cache\n });\n\n return result;\n }\n\n private async _executeDataAction(\n context: IActionContext,\n requestCache: ICache,\n appCache: ICache | null,\n bypassAppCache: boolean | undefined,\n refreshingInputs: IActionInput[],\n unique: IActionInput[],\n actionId: string\n ): Promise {\n const isRefreshingAction = refreshingInputs && refreshingInputs.length > 0;\n\n this._runPreReadHooks(actionId, unique, context)\n .then(() => null)\n .catch(err => null);\n\n // execte preReaderHook\n this._runPreReaderHooks(actionId, unique, context)\n .then(() => null)\n .catch(err => null);\n const [uncached, needsRefresh]: IActionInput[][] = this._checkForCachedData(\n unique,\n context,\n requestCache,\n appCache,\n bypassAppCache,\n isRefreshingAction\n );\n\n if (!uncached.length) {\n // excute readOnly post hook with all cached actions ouptput\n await this._fetchOutputsAndRunPostReadHook(actionId, unique, requestCache, context);\n return needsRefresh;\n } else {\n const cachedActions = unique.filter(value => !uncached.includes(value));\n if (cachedActions.length) {\n // fetch the output for all cached data action, and run readOnly hooks. The uncached actions will be excuted later.\n await this._fetchOutputsAndRunPostReadHook(actionId, cachedActions, requestCache, context);\n }\n }\n\n let outputs: any[] = [];\n\n // VNext observable promise based flow\n // Create the AsyncResult and immediately return it\n if (this.isObservable) {\n if (this.isBatched) {\n this._executeBatchedObservableActions(uncached, requestCache, appCache, context, isRefreshingAction);\n } else {\n this._executeObservableAction(uncached[0], requestCache, appCache, context, isRefreshingAction);\n }\n return needsRefresh;\n }\n\n if (this.isBatched) {\n // TODO: Have a max batch count on the action\n outputs = await this._actionWrapper(uncached, context, isRefreshingAction);\n\n if (outputs && outputs.length !== uncached.length) {\n // TODO Throw\n context.telemetry.log(\n LogLevel.Trace,\n 'Length of input array {uncached_length} does not meet the output array {outputs_length}',\n { values: [uncached.length, outputs.length] }\n );\n }\n } else {\n outputs[0] = await this._actionWrapper(uncached[0], context, isRefreshingAction);\n }\n\n if (!outputs || outputs.length === 0) {\n return needsRefresh;\n }\n\n this._saveResponseToCache(uncached, outputs, context, requestCache, appCache);\n return needsRefresh;\n }\n\n // the retail proxy data actions who do not have return type should not interact with cache.\n private _checkShouldInteractWithCache(input: IActionInput, typeName: string | undefined): boolean {\n return !(input instanceof DataServiceRequest) || !!typeName;\n }\n\n private async _fetchOutputsAndRunPostReadHook(\n actionId: string,\n inputs: IActionInput[],\n requestCache: ICache,\n context: IActionContext\n ): Promise {\n const outputs = inputs.map(i => {\n const cacheKey = { typeName: i.getCacheObjectType(), key: i.getCacheKey() };\n // if the retail data action does not have return type, we do not read the output from cache.\n let cacheItem;\n if (this._checkShouldInteractWithCache(i, cacheKey.typeName)) {\n cacheItem = requestCache.get>(cacheKey);\n }\n return !!cacheItem ? requestCache.getValue(cacheKey) : null;\n });\n this._runPostReadHooks(actionId, inputs, outputs, context)\n .then(() => null)\n .catch(err => null);\n this._runPostReaderHooks(actionId, inputs, outputs, context)\n .then(() => null)\n .catch(err => null);\n }\n private _removeDuplicates(inputs: IActionInput[]): IActionInput[] {\n if (!this.isBatched) {\n return inputs;\n }\n\n return uniqWith(\n inputs,\n (inputA: IActionInput, inputB: IActionInput) =>\n inputA.getCacheKey() === inputB.getCacheKey() && inputA.getCacheObjectType() === inputB.getCacheObjectType()\n );\n }\n\n private _getActionIdFromInputs(inputs: IActionInput | IActionInput[]): string {\n let inputsActionId;\n for (const input of Array.isArray(inputs) ? inputs : [inputs]) {\n if (typeof input.getActionId === 'function') {\n inputsActionId = input.getActionId();\n }\n }\n return inputsActionId || (>this.action).prototype.id;\n }\n\n private _getActionFromId(actionId?: string): Function {\n let { action } = this;\n if (actionId) {\n const registration = ActionRegistrar.resolveRegistration(actionId, >action);\n if (registration) {\n action = >registration.action;\n return ActionRegistrar.unwrapAction(>action);\n }\n }\n return action;\n }\n\n private async _runPreReadHooks(id: string, inputs: IActionInput | IActionInput[], context: IActionContext): Promise {\n const preReadHooks = ActionRegistrar.getPreReadHooks(id);\n if (!preReadHooks) {\n return;\n }\n\n const hookTimeout = Number(_get(context, 'requestContext.query.actionHookTimeout')) || defaultHookTimeoutInMS;\n const timer = Timer(hookTimeout, ActionErrorStatus.HookTimeout);\n\n const preReadHooksArray = Array.from(preReadHooks);\n return preReadHooksArray.reduce(async (previousTask, currentTask) => {\n await previousTask;\n try {\n await Promise.race([timer, currentTask(inputs, context)]);\n } catch (error) {\n const actionId = id || 'unnamed';\n verboseLogger(\n context && context.requestContext,\n context.telemetry,\n \"Error execution hook of action_id '{id}', returning null\",\n {\n values: [asSystemMetadata(actionId)],\n exception: error\n },\n LogLevel.Trace\n );\n }\n return Promise.resolve();\n }, Promise.resolve());\n }\n\n private async _runPostReaderHooks(\n id: string,\n inputs: IActionInput | IActionInput[],\n actionResult: unknown,\n context: IActionContext\n ): Promise {\n const postReaderHooks = ActionRegistrar.getPostReaderHooks(id);\n if (!postReaderHooks) {\n return;\n }\n\n const hookTimeout = Number(_get(context, 'requestContext.query.actionHookTimeout')) || defaultHookTimeoutInMS;\n const timer = Timer(hookTimeout, ActionErrorStatus.HookTimeout);\n const postReaderHooksArray = Array.from(postReaderHooks);\n return postReaderHooksArray.reduce(async (previousTask, currentTask) => {\n await previousTask;\n try {\n await Promise.race([timer, currentTask(inputs, actionResult, context)]);\n } catch (error) {\n const actionId = id || 'unnamed';\n verboseLogger(\n context && context.requestContext,\n context.telemetry,\n \"Error execution hook of action_id '{id}', returning null\",\n {\n values: [asSystemMetadata(actionId)],\n exception: error\n },\n LogLevel.Trace\n );\n }\n return Promise.resolve();\n }, Promise.resolve());\n }\n\n private async _runPreReaderHooks(id: string, inputs: IActionInput | IActionInput[], context: IActionContext): Promise {\n const preReaderHooks = ActionRegistrar.getPreReaderHooks(id);\n if (!preReaderHooks) {\n return;\n }\n\n const hookTimeout = Number(_get(context, 'requestContext.query.actionHookTimeout')) || defaultHookTimeoutInMS;\n const timer = Timer(hookTimeout, ActionErrorStatus.HookTimeout);\n\n const preReaderHooksArray = Array.from(preReaderHooks);\n return preReaderHooksArray.reduce(async (previousTask, currentTask) => {\n await previousTask;\n try {\n await Promise.race([timer, currentTask(inputs, context)]);\n } catch (error) {\n const actionId = id || 'unnamed';\n verboseLogger(\n context && context.requestContext,\n context.telemetry,\n \"Error execution hook of action_id '{id}', returning null\",\n {\n values: [asSystemMetadata(actionId)],\n exception: error\n },\n LogLevel.Trace\n );\n }\n return Promise.resolve();\n }, Promise.resolve());\n }\n\n private async _runPreHooks(\n id: string,\n inputs: IActionInput | IActionInput[],\n context: IActionContext\n ): Promise {\n const preHooks = ActionRegistrar.getPreHooks(id);\n if (!preHooks) {\n return;\n }\n const hookTimeout = Number(_get(context, 'requestContext.query.actionHookTimeout')) || defaultHookTimeoutInMS;\n const timer = Timer(hookTimeout, ActionErrorStatus.HookTimeout);\n\n const preHooksArray = Array.from(preHooks);\n return preHooksArray.reduce(async (previousTask, currentTask) => {\n const prevInput = await previousTask;\n let tmpNextInput: unknown;\n try {\n tmpNextInput = await Promise.race([timer, currentTask(prevInput, context)]);\n } catch (error) {\n throw error;\n }\n const finalNextInput: IActionInput | IActionInput[] =\n tmpNextInput === ActionErrorStatus.HookTimeout || !tmpNextInput ? prevInput : tmpNextInput;\n return Promise.resolve(finalNextInput);\n }, Promise.resolve(inputs));\n }\n\n private async _runPostReadHooks(\n id: string,\n inputs: IActionInput | IActionInput[],\n actionResult: unknown,\n context: IActionContext\n ): Promise {\n const postHooks = ActionRegistrar.getPostReadHooks(id);\n\n if (!postHooks) {\n return;\n }\n\n const hookTimeout = Number(_get(context, 'requestContext.query.actionHookTimeout')) || defaultHookTimeoutInMS;\n const timer = Timer(hookTimeout, ActionErrorStatus.HookTimeout);\n const postReadHooksArray = Array.from(postHooks);\n return postReadHooksArray.reduce(async (previousTask, currentTask) => {\n await previousTask;\n try {\n await Promise.race([timer, currentTask(inputs, actionResult, context)]);\n } catch (error) {\n const actionId = id || 'unnamed';\n verboseLogger(\n context && context.requestContext,\n context.telemetry,\n \"Error execution hook of action_id '{id}', returning null\",\n {\n values: [asSystemMetadata(actionId)],\n exception: error\n },\n LogLevel.Trace\n );\n }\n return Promise.resolve();\n }, Promise.resolve());\n }\n\n private async _runPostHooks(\n id: string,\n inputs: IActionInput | IActionInput[],\n actionResult: unknown,\n context: IActionContext\n ): Promise {\n const postHooks = ActionRegistrar.getPostHooks(id);\n if (!postHooks) {\n return;\n }\n const hookTimeout = Number(_get(context, 'requestContext.query.actionHookTimeout')) || defaultHookTimeoutInMS;\n const timer = Timer(hookTimeout, ActionErrorStatus.HookTimeout);\n const postHooksArray = Array.from(postHooks);\n return postHooksArray.reduce(async (previousTask, currentTask) => {\n const prevOutput = await previousTask;\n let tmpNextOutput: unknown;\n try {\n tmpNextOutput = await Promise.race([timer, currentTask(inputs, prevOutput, context)]);\n } catch (error) {\n throw error;\n }\n const finalNextOutput = tmpNextOutput === ActionErrorStatus.HookTimeout || !tmpNextOutput ? prevOutput : tmpNextOutput;\n return Promise.resolve(finalNextOutput);\n }, Promise.resolve(actionResult));\n }\n\n /**\n * Add performance logging before and after calling the action?\n */\n // eslint-disable-next-line complexity\n private async _actionWrapper(inputs: IActionInput | IActionInput[], context: IActionContext, isRefreshing?: boolean): Promise {\n const actionId = this._getActionIdFromInputs(inputs);\n const action = this._getActionFromId(actionId);\n\n try {\n // Run pre data action hooks\n const _inputs = await this._runPreHooks(actionId, inputs, context);\n if (_inputs) {\n inputs = _inputs;\n }\n } catch (e) {\n const convertedError = this._convertToJSError(e);\n StaticTelemetry.log(\n LogLevel.Error,\n `Error executing pre-hooks for ${\n isRefreshing ? 'Refreshing' : ''\n } action '{actionName}', returning null. Error '{errorName}'. CorrelationId: '{CorrelationId}'`,\n {\n values: [\n actionId || (action && action.name) || 'unnamed',\n convertedError.name || convertedError.message,\n (convertedError).data ? (convertedError).data.CorrelationId : ''\n ],\n exception: e\n }\n );\n return new ActionError(e);\n }\n let actionResult;\n try {\n const timeOut = Number(_get(context, 'requestContext.query.actionTimeout'));\n const features = _get(context, 'requestContext.features', {});\n const serverSideCustomerTimeout =\n msdyn365Commerce.platformSettings && msdyn365Commerce.platformSettings.serverSideDataActionTimeoutInMs;\n const clientSideCustomerTimeout =\n msdyn365Commerce.platformSettings && msdyn365Commerce.platformSettings.clientSideDataActionTimeoutInMs;\n let promises;\n if (process.env.CURRENT_ENVIRONMENT === 'node' && (features.action_timeout || serverSideCustomerTimeout)) {\n const timeOutValue = (features.action_timeout && timeOut ? timeOut : serverSideCustomerTimeout) || defaultTimeoutInMS;\n promises = [this.isObservable ? ObservableActionTimer(timeOutValue) : ActionTimer(timeOutValue), action(inputs, context)];\n } else if (typeof window !== 'undefined' && msdyn365Commerce.isBrowser && clientSideCustomerTimeout) {\n promises = [\n this.isObservable ? ObservableActionTimer(clientSideCustomerTimeout) : ActionTimer(clientSideCustomerTimeout),\n action(inputs, context)\n ];\n } else {\n promises = [action(inputs, context)];\n }\n // run the data action\n actionResult = await Promise.race(promises);\n } catch (e) {\n if (e.message && e.message.length > 0 && !e.message.includes('Action id')) {\n e.message = `Action id: ${actionId}, Error message: ${e.message}`;\n }\n const convertedError = this._convertToJSError(e);\n StaticTelemetry.log(\n LogLevel.Error,\n `Error executing ${\n isRefreshing ? 'Refreshing' : ''\n } action '{actionName}', returning null. Error '{errorName}'. CorrelationId: '{CorrelationId}'`,\n {\n values: [\n actionId || (action && action.name) || 'unnamed',\n convertedError.name || convertedError.message,\n (convertedError).data ? (convertedError).data.CorrelationId : ''\n ],\n exception: e\n }\n );\n let error = new ActionError(e);\n // For AsyncResult, we need to signal that this was a rejection by throwing\n if (this.isObservable) {\n // Proxy Errors come wrapped as an array\n if (Array.isArray(e)) {\n error =\n e[0]._errorCode === ErrorTypeEnum.SERVICE_UNAVAILABLE\n ? new ActionError(ActionErrorStatus.ServiceUnavailable)\n : ProxyError.toError(e[0]);\n } else {\n error =\n e._errorCode === ErrorTypeEnum.SERVICE_UNAVAILABLE\n ? new ActionError(ActionErrorStatus.ServiceUnavailable)\n : new ActionError(e);\n }\n }\n\n throw error;\n }\n\n try {\n // Run post data action hooks\n const result = await this._runPostHooks(actionId, inputs, actionResult, context);\n if (result) {\n actionResult = result;\n }\n this._runPostReadHooks(actionId, inputs, actionResult, context)\n .then(() => null)\n .catch(err => null);\n this._runPostReaderHooks(actionId, inputs, actionResult, context)\n .then(() => null)\n .catch(err => null);\n } catch (e) {\n const convertedError = this._convertToJSError(e);\n StaticTelemetry.log(\n LogLevel.Error,\n `Error executing post-hooks for ${\n isRefreshing ? 'Refreshing' : ''\n } action '{actionName}', returning null. Error '{errorName}'. CorrelationId: '{CorrelationId}'`,\n {\n values: [\n actionId || (action && action.name) || 'unnamed',\n convertedError.name || convertedError.message,\n (convertedError).data ? (convertedError).data.CorrelationId : ''\n ],\n exception: e\n }\n );\n }\n return actionResult;\n }\n\n private _shouldUseInstanceCache = () => {\n return checkVersionForFeature('instance_cache') || msdyn365Commerce.platformSettings?.shouldUseInstanceCache;\n };\n\n private _saveResponseToCache(\n uncached: IActionInput[],\n outputs: any[],\n context: IActionContext,\n requestCache: ICache,\n appCache: ICache | null\n ): void {\n uncached.forEach((i, idx) => {\n const actionId = this._getActionIdFromInputs(i);\n if (i instanceof DataServiceRequest && !!i.getCacheObjectType()) {\n try {\n const appCacheData = appCache;\n const disableUsingInstanceCache =\n context.requestContext.features && context.requestContext.features.disable_instance_cache;\n const usingInstanceCache = !disableUsingInstanceCache && this._shouldUseInstanceCache();\n saveCacheEntries(i, outputs[idx], requestCache, appCacheData, shouldWriteToAppCache(i, appCache), usingInstanceCache);\n } catch (e) {\n const { action } = this;\n const actionName = actionId || (action && action.name) || 'unnamed';\n verboseLogger(\n context && context.requestContext,\n context.telemetry,\n \"Error execution action '{actionName}', returning null\",\n {\n values: [asSystemMetadata(actionName)],\n exception: e\n },\n LogLevel.Trace\n );\n\n return null;\n }\n } else {\n const entityId = i.getCacheKey();\n const entityType = i.getCacheObjectType();\n\n if (!!entityId && !!entityType) {\n const entry = outputs[idx];\n const cacheKey = { typeName: entityType, key: entityId };\n if (ActionError.isActionError(entry)) {\n if (!ActionError.isTimeoutError(entry)) {\n requestCache.put(cacheKey, { item: ((entry)).error, error: true });\n }\n // else do nothing\n } else {\n if (appCache && shouldWriteToAppCache(i, appCache)) {\n appCache.put(cacheKey, { item: entry });\n }\n const cacheEntry = { item: entry };\n if (i.dataCacheType && i.dataCacheType() === 'instance') {\n Object.assign(cacheEntry, { instance: 'instance' });\n }\n requestCache.put(cacheKey, cacheEntry);\n }\n }\n }\n });\n }\n\n /**\n * Method that executes a set of batchable observable data actions\n * @param uncached The uncached action inputs\n * @param requestCache The request cache\n * @param appCache The application cache, if available\n * @param context The action context\n */\n private _executeBatchedObservableActions(\n uncached: IActionInput[],\n requestCache: ICache,\n appCache: ICache | null,\n context: IActionContext,\n isRefreshing: boolean = false\n ): void {\n const unresolvedSet = new Set();\n const uncachedInputs: IActionInput[] = [];\n // Create an OP for each input in the batch that does not yet exist in cache\n const asyncOutputs = uncached\n .map((input, index) => {\n unresolvedSet.add(index);\n const executor = (resolve: any, reject: any) => {\n // When the side promise completes, update each individual OP to have it's piece of the entire batched result\n new Promise((innerResolve, innerReject) => {\n const onEventIdCompletion = (value: any) => {\n innerResolve(<{}>value);\n };\n\n const onEventIdFinalCompletion = () => {\n innerResolve();\n };\n\n const onEventIdFailure = (error: any) => {\n innerReject(error);\n };\n\n // Standard success event\n EventHelper.on(`${this.eventId}-complete-${index}-${input.getCacheKey()}`, onEventIdCompletion);\n\n // No response closing event\n EventHelper.on(`${this.eventId}-final-complete-${index}-${input.getCacheKey()}`, onEventIdFinalCompletion);\n\n // Failure event\n EventHelper.on(`${this.eventId}-failure`, onEventIdFailure);\n })\n .then(result => {\n EventHelper.removeAllListeners(`${this.eventId}-complete-${index}-${input.getCacheKey()}`);\n EventHelper.removeAllListeners(`${this.eventId}-final-complete-${index}-${input.getCacheKey()}`);\n resolve(result);\n })\n .catch(error => {\n EventHelper.removeAllListeners(`${this.eventId}-failure`);\n reject(error);\n });\n };\n\n // Already cached OP logic (rerun)\n // we only try to fetch the saved promise from cache when the retail proxy data action has cached type\n let cachedPromise;\n if (this._checkShouldInteractWithCache(input, input.getCacheObjectType())) {\n cachedPromise = requestCache.getValue({ key: input.getCacheKey(), typeName: input.getCacheObjectType() });\n }\n if (cachedPromise && isAsyncResult(cachedPromise) && !isRefreshing) {\n (>cachedPromise).run(executor);\n return;\n }\n\n // Not yet cached OP logic (initialize, run)\n uncachedInputs.push(input);\n return new AsyncResult(executor);\n })\n .filter(Boolean);\n\n // Save never before cached OPs to cache\n this._saveResponseToCache(uncachedInputs, asyncOutputs, context, requestCache, appCache);\n\n // Run the actual action\n this._actionWrapper(uncached, context, isRefreshing)\n .then((actionResults: unknown[]) => {\n // Emit events with the associated result so that each individual OP in the cache\n // can be updated appropriately\n actionResults.forEach((actionResult, index) => {\n unresolvedSet.delete(index);\n EventHelper.emit(`${this.eventId}-complete-${index}-${uncached[index].getCacheKey()}`, actionResult);\n });\n })\n .catch(error => {\n EventHelper.emit(`${this.eventId}-failure`, error);\n })\n .finally(() => {\n // In the event some inputs do not have results, we need to resolve the promises anyhow\n unresolvedSet.forEach(unresolvedIndex => {\n const index = unresolvedIndex;\n EventHelper.emit(`${this.eventId}-final-complete-${index}-${uncached[index].getCacheKey()}`);\n });\n });\n }\n\n /**\n * Executes a standard (non-batched) observable data action\n * @param input The action input\n * @param requestCache The request cache\n * @param appCache The application cache, if available\n * @param context The action context\n */\n private _executeObservableAction(\n input: IActionInput,\n requestCache: ICache,\n appCache: ICache | null,\n context: IActionContext,\n isRefreshing: boolean = false\n ): void {\n const cacheKey = { key: input.getCacheKey(), typeName: input.getCacheObjectType() };\n const executor = (resolve: any, reject: any) => {\n this._actionWrapper(input, context, isRefreshing)\n .then(result => {\n resolve(result);\n })\n .catch(error => {\n // If error is timeout error, lookup app-cache if there\n // is a valid entity for the given cacheKey in app-cache\n if (ActionError.isServiceUnavailable(error) && isAppCacheData(input, appCache)) {\n const cachedItem = appCache?.getValue(cacheKey);\n if (cachedItem) {\n return resolve(cachedItem);\n }\n }\n return reject(error);\n });\n };\n // we only try to fetch the saved promise from cache when the retail proxy data action has cached type\n let cachedPromise;\n if (this._checkShouldInteractWithCache(input, input.getCacheObjectType())) {\n cachedPromise = requestCache.getValue({ key: input.getCacheKey(), typeName: input.getCacheObjectType() });\n }\n // If OP is already in cache, just rerun it\n if (cachedPromise && isAsyncResult(cachedPromise) && !isRefreshing) {\n (>cachedPromise).run(executor);\n return;\n }\n\n // Uncached promises need to be saved to cache\n const asyncOutput = new AsyncResult(executor);\n this._saveResponseToCache([input], [asyncOutput], context, requestCache, appCache);\n }\n\n private _checkForCachedData(\n inputs: IActionInput[],\n context: IActionContext,\n requestCache: ICache,\n appCache: ICache | null,\n bypassCache?: boolean,\n refreshing?: boolean\n ): IActionInput[][] {\n const mock = _get(context, 'requestContext.query.actionMock');\n\n if (mock) {\n inputs = this._interceptCacheForMocks(inputs, context, requestCache);\n }\n\n const clientHydrateCacheKey: ICacheKey = {\n key: CLIENT_HYDRATE_KEY,\n typeName: CLIENT_HYDRATE_TYPE\n };\n const isClientHydrate = requestCache.getValue(clientHydrateCacheKey);\n const disableUsingInstanceCache = context.requestContext.features && context.requestContext.features.disable_instance_cache;\n const usingInstanceCache = !disableUsingInstanceCache && this._shouldUseInstanceCache();\n // if the cache type is set a none don't check cache for data and return inputs for execution\n // lazyresponse == true means it has been called from load-data on browser. In this case, data is already present in request-cache due to run on server side\n if (this.cacheType === 'none' || refreshing) {\n // we should keep read from cache when a dataAction\n // 1. run on server\n // 2. none cache type\n // 3. action running as part of initial page load (client hydration).\n // This is important to stay consistent with what we render on server.\n // 4. when instance cache feature is on.\n if (!(this.cacheType === 'none' && inputs[0].runOn === 'server' && isClientHydrate && usingInstanceCache) || refreshing) {\n return [inputs, []];\n }\n }\n\n const uncached: IActionInput[] = [];\n const refresh: IActionInput[] = [];\n // eslint-disable-next-line complexity\n inputs.forEach((i, idx) => {\n const actionId = this._getActionIdFromInputs(i);\n const cacheKey = { typeName: i.getCacheObjectType(), key: i.getCacheKey() };\n // if the retail proxy action does not have return type, we do not check if its in the cache\n if (i instanceof DataServiceRequest && !cacheKey.typeName) {\n uncached.push(i);\n return;\n }\n let cacheItem: ICacheItem | undefined = requestCache.get(cacheKey);\n if (cacheItem && isAsyncResult(cacheItem.item) && (>cacheItem.item).status === 'FAILED') {\n if (!i.runOn || i.runOn !== 'serverOnly') {\n uncached.push(i);\n }\n } else if (cacheItem && cacheItem.item && cacheItem.item.status === 'LOADING' && cacheItem.item.runOn === 'client') {\n // Ideally, an action configured to runOn client should never interfere with actions running on server.\n // However, it is possible that parent action with runon 'server' could be dependent on an action that is configured\n // by partner to be runOn 'client'. In this case, the child action implicitly becomes a server action. Therefore, lets\n // include such actions in the uncached list so that it gets picked and executed later.\n uncached.push(i);\n } else if (i instanceof DataServiceRequest) {\n try {\n if (bypassCache && context.requestContext.features && !!!context.requestContext.features.disable_bypass_request_cache) {\n uncached.push(i);\n } else {\n const appCacheData = appCache;\n const cacheEntries = readCacheEntries(\n i,\n requestCache,\n appCacheData,\n !!!bypassCache && shouldReadFromAppCache(i, appCache),\n context.requestContext,\n undefined,\n !!this.isObservable\n );\n if (!cacheEntries.entry) {\n uncached.push(i);\n }\n if (cacheEntries && cacheEntries.shouldRefresh) {\n refresh.push(i);\n }\n }\n } catch (e) {\n const { action } = this;\n const actionName = actionId || (action && action.name) || 'unnamed';\n verboseLogger(\n context && context.requestContext,\n context.telemetry,\n \"Error execution action '{actionName}', returning null\",\n {\n values: [asSystemMetadata(actionName)],\n exception: e\n },\n LogLevel.Trace\n );\n uncached.push(i);\n }\n } else {\n if (bypassCache && context.requestContext.features && !context.requestContext.features.disable_bypass_request_cache) {\n uncached.push(i);\n } else {\n if (!cacheItem && !!!bypassCache && appCache && shouldReadFromAppCache(i, appCache)) {\n cacheItem = appCache.copyTo(cacheKey, requestCache, !!this.isObservable);\n if (cacheItem && cacheItem.shouldRefresh) {\n refresh.push(i);\n }\n }\n\n if (!cacheItem || !cacheItem.item) {\n uncached.push(i);\n return;\n }\n }\n }\n });\n return [uncached, refresh];\n }\n\n /**\n * Searches cache for mocks matching the inputs\n * @param inputs Current action inputs\n * @param context Current action context\n * @param requestCache Current request cache\n */\n private _interceptCacheForMocks(inputs: IActionInput[], context: IActionContext, requestCache: ICache): IActionInput[] {\n const uncached: IActionInput[] = [];\n const actionId: string = this.action.prototype.id;\n inputs.forEach(i => {\n let mockItem = this._getMockItem(i.getCacheObjectType(), i.getCacheKey(), requestCache);\n if (!mockItem && actionId) {\n mockItem = this._getMockItem(actionId, i.getCacheKey(), requestCache);\n }\n let existingItem;\n if (this._checkShouldInteractWithCache(i, i.getCacheObjectType())) {\n existingItem = requestCache.get({ typeName: i.getCacheObjectType(), key: i.getCacheKey() });\n }\n\n if (!!mockItem && !!mockItem.item && !existingItem) {\n const mockItemJSObject = toJS(mockItem.item);\n if (this.isObservable) {\n requestCache.put(\n { typeName: i.getCacheObjectType(), key: i.getCacheKey() },\n { item: AsyncResult.resolve(mockItemJSObject) }\n );\n } else {\n requestCache.put({ typeName: i.getCacheObjectType(), key: i.getCacheKey() }, { item: toJS(mockItemJSObject) });\n }\n } else {\n uncached.push(i);\n }\n });\n return uncached;\n }\n\n private _getMockItem(cacheNamespace: string, cacheKey: string, requestCache: ICache): ICacheItem | undefined {\n return (\n requestCache.get({ typeName: '__MOCK', key: `${cacheNamespace}:${cacheKey}` }) ||\n requestCache.get({ typeName: '__MOCK', key: `${cacheNamespace}:*` })\n );\n }\n\n private _convertToJSError(e: any): Error {\n // Proxy Error usually comes wrapped in an array\n // If it is, unbox it and conver to regular Error\n if (Array.isArray(e)) {\n const proxyError: ProxyError = e[0];\n if (proxyError.ErrorCode) {\n return ProxyError.toError(proxyError);\n }\n } else if (e.ErrorCode) {\n return ProxyError.toError(e);\n }\n // Return regular Error if not ProxyError\n return new Error(e.message || '');\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ProductCatalog } from '@msdyn365-commerce/retail-proxy';\nimport {\n CacheType,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICommerceApiSettings,\n ICreateActionContext,\n IGeneric,\n IRequestContext\n} from '@msdyn365-commerce/core-internal';\nimport { getCatalogsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CatalogsDataActions.g';\nimport { createObservableDataAction } from '../create-data-action.vnext';\n\nconst buildCacheKey = (base: string, apiSettings: ICommerceApiSettings, locale?: string): string => {\n return `${base}-chanId:${apiSettings.channelId}-catId:${apiSettings.catalogId}${locale ? `-${locale}` : ''}`;\n};\n\n/**\n * Input for get-catalogs data action.\n */\nexport class CatalogsInput implements IActionInput {\n public readonly channelId: number;\n\n public readonly customerAccountNumber?: string;\n\n private readonly apiSettings: ICommerceApiSettings;\n\n private readonly locale?: string;\n\n public constructor(context: IRequestContext, customerAccountNumber?: string) {\n this.channelId = context.apiSettings.channelId ? Number(context.apiSettings.channelId) : 0;\n this.customerAccountNumber = customerAccountNumber ? customerAccountNumber : context.user.customerAccountNumber;\n this.apiSettings = context.apiSettings;\n this.locale = context.locale || '';\n }\n\n /**\n * Get Cache Key.\n * @returns - Cache key string.\n */\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions -- customer account number can be undefined.\n // Removing customer account number dependency as API does not need customer account number and cache is of request type.\n // Keeping the contract same not to break backward compatibility.\n public getCacheKey = (): string => buildCacheKey(`${this.channelId}`, this.apiSettings, this.locale);\n\n /**\n * Get Cache object type.\n * @returns - Cache object type.\n */\n public getCacheObjectType = (): string => 'productCatalogs';\n\n /**\n * Get data cache type.\n * @returns - Cache type enum.\n */\n public dataCacheType = (): CacheType => 'request';\n}\n\n/**\n * Creates the input required to make the retail api call.\n * @param inputData - The input data passed to the createInput method.\n * @param customerAccountNumber - Customer account number.\n * @returns - Catalogs input.\n */\nexport const createCatalogsInput = (inputData: ICreateActionContext>, customerAccountNumber?: string): IActionInput => {\n if (!inputData.requestContext.user.isAuthenticated) {\n throw new Error('Unable to get product catalog. User is not authenticated.');\n }\n return new CatalogsInput(inputData.requestContext, customerAccountNumber);\n};\n\n/**\n * Calls the Retail API and returns the product catalog for an user.\n * @param input - Catalogs Input.\n * @param context - Current context.\n * @returns - Product catalog for the user.\n */\nexport async function getCatalogAction(input: CatalogsInput, context: IActionContext): Promise {\n const productCatalogs = await getCatalogsAsync({ callerContext: context }, input.channelId, true);\n return productCatalogs;\n}\n\n/**\n * The GetProductCatalogs Data Action\n * Returns product catalogs.\n */\nexport const getCatalogActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce/get-catalogs',\n action: getCatalogAction as IAction,\n input: createCatalogsInput\n});\n\nexport default getCatalogActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext, IRequestContext, IRequestContextParams } from '@msdyn365-commerce/core-internal';\nimport { ProductCatalog } from '@msdyn365-commerce/retail-proxy';\nimport { CatalogsInput, getCatalogActionDataAction } from './actions/get-catalogs';\n\n/**\n * Returns catalog name for a given catalog id\n * @param context Action Context\n * @param context Catalog Id\n */\nexport const getCatalogName = async (context: IActionContext, catalogId: number): Promise => {\n if (!context || !context.requestContext || !context.requestContext.apiSettings) {\n return '';\n }\n\n const customerAccountNumber = context.requestContext.user.customerAccountNumber;\n const productCatalogs = await getCatalogActionDataAction(new CatalogsInput(context.requestContext, customerAccountNumber), context);\n\n return findCatalogName(productCatalogs, catalogId);\n};\n\n/**\n * Returns true if data action cache needs to be bypassed\n * @param requestContext rendering context\n * @returns cachebypass status\n */\nexport const shouldByPassCache = (requestContext: IRequestContext) => {\n return (requestContext.query && !!requestContext.query.cachebypass) || isPageInsightsEnabled(requestContext.params);\n};\n\nconst isPageInsightsEnabled = (params: IRequestContextParams): boolean => {\n return params?.pageInsights === 'all' || params?.pageInsights === 'info' || params?.pageInsights === 'error';\n};\n\n/**\n * Matches the catalog if with the productCatalogs response and returns catalog name\n * @param productCatalogs Product catalogs response\n * @param catalogId Catalog id to search in Product catalogs response\n * @returns Catalog name\n */\nexport const findCatalogName = (productCatalogs: ProductCatalog[], catalogId: number): string => {\n let catalogName = '';\n productCatalogs &&\n productCatalogs.forEach((catalog: ProductCatalog) => {\n if (catalog.RecordId === catalogId && catalog.Name) {\n catalogName = catalog.Name;\n }\n });\n return catalogName;\n};\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 { ICache, ICacheItem, ICacheKey, ICacheSource, RequestCache } from '@msdyn365-commerce/cache-internal';\nimport {\n IAction,\n IActionContext,\n IActionInput,\n IDataActionOptions,\n msdyn365Commerce,\n verboseLogger\n} from '@msdyn365-commerce/core-internal';\nimport { AsyncResult, DataServiceRequest, isAsyncResult } from '@msdyn365-commerce/retail-proxy';\nimport {\n asSystemMetadata,\n GenericConsoleLogger,\n ITelemetry,\n LogLevel,\n StaticTelemetry,\n Telemetry\n} from '@msdyn365-commerce/telemetry-internal';\nimport uuidv1 from 'uuid/v1';\nimport ActionExecutor from './action-executor';\nimport { ActionRegistrar } from './action-registrar';\nimport { shouldWriteToAppCache } from './action-runtime-utils';\nimport { addLocaleInformation, readCacheEntries, saveCacheEntries } from './cache/retail-cache-helper';\nimport EventHelper from './event-emitter';\nimport { shouldByPassCache } from './helpers';\n\n/**\n * Cache key for actions which needs to be refreshed after page render\n */\nexport const REFRESH_ACTIONS_CACHE_KEY: ICacheKey = {\n typeName: '__REFRESH_CONFIGS_TYPE__',\n key: '__refresh_cache_key'\n};\n\n/**\n * This interface is used in ActionContext only, for saving information needed to refresh data actions.\n *\n */\nexport interface IRefreshConfigs {\n actionInputs: IActionInput[];\n paramExecutor: ActionExecutor;\n}\n/**\n * This class contains the primary logic which controls the execution flow of the action runtime\n *\n */\n/* @internal*/\n/**\n *\n */\nexport class ActionContext implements IActionContext {\n public static maxDepth: number = 200;\n\n public readonly executionParams: ActionExecutor[] = [];\n public readonly requestContext: any;\n\n /**\n * Telemetry object to log information\n */\n public telemetry: ITelemetry;\n\n private readonly requestCache: ICache;\n private readonly appCache: ICache | null = null;\n private readonly cacheKeyMap: string[] = [];\n private readonly refreshConfigs: IRefreshConfigs[] = [];\n\n /**\n * Action context creates a new instance for every tier of execution,\n * This number specifies the depth/current tier in the execution flow\n */\n private readonly currentExecutionTier: number;\n\n /**\n * Thread ID\n */\n private readonly threadId: string;\n\n /**\n * Event ID\n * Unique ID for each action context, automatically generated\n */\n private readonly eventId: string;\n\n /**\n * Whether the current context as executed\n */\n private hasRun: boolean = false;\n\n /**\n * When this number is > 0, the current context will wait for all the actions to\n * be queued before kicking off execution.\n * This number is decremented for every action that is successful in current tier.\n */\n private expectedActionsInCurrentTier: number;\n\n /**\n * variable tracking the current number of actions that are in queue, context will wait for this to match the expected count\n */\n private currentActionsInQueue: number = 0;\n\n /**\n * Object to track the next tier number.\n */\n private nextTierCounter: { next: number } = { next: 0 };\n\n /**\n * When true will span a new independent action context when an action is executed resetting depth limits\n * Otherwise will invoke the action in the current context.\n */\n private spawnChildOnExecute: boolean = false;\n\n /**\n * @param currentExecutionTier: Current execution tier in the data fetch pipeline, max is currently 7\n * @param expectedActionCount: This value specifies the expected number of actions to be queued before\n * we kick off execution in the current tier\n */\n constructor(args: {\n id: string;\n requestContext: any;\n requestCache: ICache;\n appCache: ICache | null;\n currentExecutionTier?: number;\n expectedActionCount?: number;\n spawnChildOnExecute?: boolean;\n telemetry?: ITelemetry;\n }) {\n const {\n id,\n requestContext,\n requestCache,\n appCache,\n currentExecutionTier,\n expectedActionCount,\n spawnChildOnExecute,\n telemetry\n } = args;\n this.threadId = id;\n this.eventId = uuidv1();\n\n this.currentExecutionTier = currentExecutionTier || 0;\n if (this.currentExecutionTier === 0) {\n this.nextTierCounter = { next: 0 };\n }\n\n this.expectedActionsInCurrentTier = expectedActionCount || 0;\n this.requestCache = requestCache;\n this.requestContext = requestContext || {};\n this.spawnChildOnExecute = Boolean(spawnChildOnExecute);\n\n // If a telemetry object has been passed in use that telemetry object, otherwise create a new Telemetry object\n if (telemetry) {\n this.telemetry = telemetry;\n } else {\n // register default console logger\n const moduleTelemetry = new Telemetry();\n const isDebug = requestContext.params && requestContext.params.isDebug;\n\n // register tracelogger only in development environment or debug is true.\n (process.env.NODE_ENV === 'development' || isDebug) &&\n moduleTelemetry.registerTraceLogger({ traceLogger: GenericConsoleLogger, options: { isDebug: isDebug } });\n\n this.telemetry = moduleTelemetry;\n }\n\n /**\n * @deprecated\n * Trace is an alias for telemetry.log(LogLevel.Trace, message)\n * Use the telemetry object directly.\n */\n this.trace = (message: string) => {\n this.telemetry.log(LogLevel.Debug, message);\n };\n\n // enable app cache only if the disable_app_cache feature switch is false\n if (requestContext.features && !!!requestContext.features.disable_app_cache) {\n this.appCache = appCache;\n }\n }\n\n public getRefreshActions(): IRefreshConfigs[] {\n return this.refreshConfigs;\n }\n\n /**\n * Chains an action method to the current context for execution\n * @param action - action method\n * @param inputs - action input\n */\n public chainAction(\n _action: IAction,\n inputs: IActionInput | IActionInput[],\n actionOption?: IDataActionOptions\n ): Promise {\n const action = ActionRegistrar.unwrapAction(_action);\n addLocaleInformation(inputs, this.requestContext.locale);\n if (!action || !inputs) {\n // Decrement the expected actions on this tier since this action was incorrectly configured\n this.expectedActionsInCurrentTier--;\n if (this.currentActionsInQueue < this.expectedActionsInCurrentTier) {\n return Promise.resolve(null);\n }\n\n if (!this.hasRun) {\n return this.runAllActionsInQueue().then(() => null);\n }\n\n return Promise.resolve(null);\n }\n\n if (this.isMaxDepthExceeded()) {\n this.debug('Max depth exceeded - not running further.');\n return Promise.resolve(null);\n }\n\n if (this.hasRun) {\n // If the parent action decides to queue another action after the current tier completes execution\n // then set the hasRun to false, so the action can fire right away\n this.hasRun = false;\n this.executionParams.length = 0;\n this.currentActionsInQueue = 0;\n }\n\n this.currentActionsInQueue++;\n const isBatched = action.prototype.isBatched;\n const inputsArray = (isBatched ? inputs : [inputs]);\n\n let current = this.executionParams.find(a => a.action === action);\n if (current && isBatched) {\n current.addInputs(inputsArray);\n } else {\n const inputIdentifier = `${inputsArray[0].getCacheObjectType()}||${inputsArray[0].getCacheKey()}`;\n if (!this.cacheKeyMap.find(key => key === inputIdentifier)) {\n current = new ActionExecutor(action, inputsArray, this.telemetry, actionOption);\n this.executionParams.push(current);\n this.cacheKeyMap.push(inputIdentifier);\n }\n }\n\n const asyncResult = new AsyncResult(async (resolve, reject) => {\n if (this.currentActionsInQueue < this.expectedActionsInCurrentTier) {\n // Hold the thread until the entire tier is populated\n await new Promise((innerResolve: Function) => {\n const onEventIdCompletion = (tierNum: number) => {\n if (tierNum === this.currentExecutionTier) {\n innerResolve();\n }\n };\n EventHelper.on<[number]>(`${this.eventId}:completed`, onEventIdCompletion);\n });\n EventHelper.removeAllListeners(`${this.eventId}:completed`);\n }\n\n if (!this.hasRun) {\n await this.runAllActionsInQueue();\n }\n\n const outputs = inputsArray.map(i => {\n if (i instanceof DataServiceRequest) {\n try {\n const appCacheData = this.appCache;\n const entry = readCacheEntries(i, this.requestCache, appCacheData, false, this.requestContext, StaticTelemetry);\n return entry.entry;\n } catch (e) {\n this.debug(\n `Error execution action type '[${i && i.getCacheObjectType()}' and cache key '[{${i &&\n i.getCacheKey()}}]', returning null`\n );\n return null;\n }\n } else {\n const cacheKey = { typeName: i.getCacheObjectType(), key: i.getCacheKey() };\n const cacheItem = this.requestCache.get>(cacheKey);\n const cacheValue = !!cacheItem ? this.requestCache.getValue(cacheKey) : null;\n\n if (cacheItem && !!cacheItem.error) {\n throw cacheValue;\n } else {\n if (cacheItem && !msdyn365Commerce.isBrowser) {\n if (cacheItem.refreshStartTimeInMS) {\n verboseLogger(\n this.requestContext,\n StaticTelemetry,\n 'dataAction with {actiontype}, {cacheKey}. last refresh time {lastRefresh}',\n {\n values: [\n asSystemMetadata(i.getCacheObjectType() || 'none'),\n asSystemMetadata(i.getCacheKey()),\n asSystemMetadata(cacheItem.refreshStartTimeInMS)\n ]\n }\n );\n }\n switch (cacheItem.s!) {\n case ICacheSource.AppCache: {\n verboseLogger(\n this.requestContext,\n StaticTelemetry,\n 'dataAction with {actiontype}, {cacheKey}. source {cacheSource}',\n {\n values: [\n asSystemMetadata(i.getCacheObjectType() || 'none'),\n asSystemMetadata(i.getCacheKey()),\n asSystemMetadata('AppCache')\n ]\n }\n );\n break;\n }\n case ICacheSource.RequestCache: {\n verboseLogger(\n this.requestContext,\n StaticTelemetry,\n 'dataAction with {actiontype}, {cacheKey}. source {cacheSource}',\n {\n values: [\n asSystemMetadata(i.getCacheObjectType() || 'none'),\n asSystemMetadata(i.getCacheKey()),\n asSystemMetadata('RequestCache')\n ]\n }\n );\n break;\n }\n default: {\n verboseLogger(\n this.requestContext,\n StaticTelemetry,\n 'dataAction with {actiontype}, {cacheKey}. source {cacheSource}',\n {\n values: [\n asSystemMetadata(i.getCacheObjectType() || 'none'),\n asSystemMetadata(i.getCacheKey()),\n asSystemMetadata('Undefined')\n ]\n }\n );\n }\n }\n }\n return cacheValue;\n }\n }\n });\n\n this.cacheKeyMap.splice(0, this.cacheKeyMap.length);\n\n // Batched observable actions need to be merged into a single AsyncResult\n if (isBatched && action.prototype.isObservable) {\n resolve(\n Promise.all(outputs).then(results => {\n // Because AsyncResult sometimes get mangled by MobX, we need to ensure mangled ones are still unwrapped\n return results.map(result => {\n return result && result._type === 'AsyncResult' ? result.result : result;\n });\n })\n );\n } else {\n // We need to pass along the metadata explicitly to the outer AsyncResult\n if (isAsyncResult(outputs[0]) && !isBatched) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n outputs[0].then(() => {\n asyncResult.metadata = outputs[0].metadata;\n });\n }\n\n resolve(isBatched ? outputs : (outputs.length && outputs[0]) || null);\n }\n });\n\n return asyncResult;\n }\n\n /**\n * Helper method to update cache\n * @param input The input\n * @param data The data\n */\n public update(inputs: IActionInput | IActionInput[], data: T): T {\n if (inputs && data) {\n // If an array of actionInputs has been passed, an equal amount of data items must be present\n const dataArray = (Array.isArray(inputs) ? data : [data]);\n const inputArray = Array.isArray(inputs) ? inputs : [inputs];\n if (inputArray.length !== dataArray.length) {\n throw new Error('Array of action inputs was passed to actionContext Update, and did not match length of input data array.');\n }\n addLocaleInformation(inputArray, this.requestContext.locale);\n inputArray.map((i, idx) => {\n if (i instanceof DataServiceRequest) {\n try {\n const appCacheData = this.appCache;\n saveCacheEntries(i, dataArray[idx], this.requestCache, appCacheData, shouldWriteToAppCache(i, this.appCache));\n } catch (e) {\n this.debug(\n `Error in updating cache with input '[${i.getCacheObjectType()}]' - '[${i.getCacheKey()}]', returning null`\n );\n this.error(e);\n }\n } else {\n // When updating OPs, only result can be updated, passed OPs will also be unwrapped.\n if (isAsyncResult(dataArray[idx])) {\n dataArray[idx] = (>dataArray[idx]).result;\n }\n\n const cacheKey = { typeName: i.getCacheObjectType(), key: i.getCacheKey() };\n this.requestCache.put(cacheKey, { item: dataArray[idx] });\n if (this.appCache && shouldWriteToAppCache(i, this.appCache)) {\n this.appCache.put(cacheKey, { item: dataArray[idx] });\n }\n }\n });\n\n if (Array.isArray(inputs)) {\n return (inputs.map(input => {\n return this.requestCache.getValue({ typeName: input.getCacheObjectType(), key: input.getCacheKey() });\n }));\n } else {\n return this.requestCache.getValue({ typeName: inputs.getCacheObjectType(), key: inputs.getCacheKey() });\n }\n }\n\n // For scenarios where data/input was bad, we just return original data\n return data;\n }\n\n /**\n * Helper method to log trace using telemetry\n * @param message message to log to console\n */\n public trace = (message: string): void => {\n this.telemetry.log(LogLevel.Debug, 'Depth: {currentExecutionTier}\\tID: {threadId}\\tMessage: {message}', {\n values: [this.currentExecutionTier, this.threadId, message]\n });\n };\n\n /**\n * Helper method to log error using telemetry\n * @param message message to log to console\n */\n public error = (message: string): void => {\n this.telemetry.log(LogLevel.Error, 'Depth: {currentExecutionTier}\\tID: {threadId}\\tMessage: {message}', {\n values: [this.currentExecutionTier, this.threadId, message]\n });\n };\n\n /**\n * Helper method to log debug using telemetry\n * @param message message to log to console\n */\n public debug = (message: string): void => {\n this.telemetry.log(LogLevel.Debug, 'Depth: {currentExecutionTier}\\tID: {threadId}\\tMessage: {message}', {\n values: [this.currentExecutionTier, this.threadId, message]\n });\n };\n\n /**\n * Helper method to data cache from cache\n * if cachekey is null or empty, it returns all entries of cacheObjectType\n * @param cacheObjectType entity type that was cached\n * @param cacheKey cache key against which the object is cached\n * @throws if cacheObjecttype is null or empty\n */\n public get(cacheObjectType: string, cacheKey: string): T | T[] | null {\n if (!cacheObjectType) {\n throw new Error('Cannot have null or empty cacheObjectType');\n }\n\n if (!cacheKey) {\n throw new Error('Cannot have null or empty cacheKey');\n }\n\n const preparedCacheKey = { typeName: cacheObjectType, key: cacheKey };\n let cachedItem = this.requestCache.get(preparedCacheKey);\n\n if (process.env.CURRENT_ENVIRONMENT === 'node' && !cachedItem && this.appCache) {\n cachedItem = this.appCache.get(preparedCacheKey);\n }\n\n if (!cachedItem) {\n return null;\n }\n\n if (typeof cachedItem.item !== 'object' || cachedItem.item.$ref !== true) {\n return cachedItem.item;\n }\n\n return Array.isArray(cachedItem.item.key) ? (cachedItem.item.key)\n .map(key => this.getItemFromCache({ typeName: cacheObjectType, key }))\n .filter(Boolean) : null;\n }\n\n /**\n * Helper method to data cache from cache\n * if cachekey is null or empty, it returns all entries of cacheObjectType\n * @param input The input\n * @param data The data\n * @throws if cacheObjecttype is null or empty\n */\n public getAll(cacheObjectType: string): T[] | null {\n if (!cacheObjectType) {\n throw new Error('Cannot have null or empty cacheObjectType');\n }\n\n let cachedEntries = this.requestCache.getAllItems(cacheObjectType);\n if (!cachedEntries) {\n if (process.env.CURRENT_ENVIRONMENT === 'node' && this.appCache) {\n cachedEntries = this.appCache && this.appCache.getAllItems(cacheObjectType);\n }\n\n if (!cachedEntries) {\n return null;\n }\n }\n\n return Object.keys(cachedEntries)\n .filter(key => typeof cachedEntries![key].item !== 'object' || cachedEntries![key].item.$ref !== true)\n .map(key => cachedEntries![key].item);\n }\n\n /**\n * Executes all the actions in the current context in parallel\n */\n public async runAllActionsInQueue(): Promise {\n const { threadId, requestContext, requestCache, appCache, nextTierCounter, executionParams } = this;\n if (!executionParams.length) {\n this.trace('No actions to execute - not running further.');\n return;\n }\n // Increment the tier each pass through run all actions\n if (this.isMaxDepthExceeded()) {\n this.trace('Max depth exceeded - not running further.');\n return;\n }\n\n // When kicking off the next tier,\n // set the max number of chain actions the can be expected from child actions\n // equal to the number of actions that are executing in current tier\n const expectedNumberOfChildThreads = executionParams.length;\n\n let nextTierStartingDepth;\n if (this.spawnChildOnExecute) {\n nextTierStartingDepth = nextTierCounter.next + 1;\n } else {\n nextTierStartingDepth = ++nextTierCounter.next;\n }\n\n const nextTier = new ActionContext({\n id: threadId,\n requestContext: requestContext,\n requestCache: requestCache,\n appCache: appCache,\n currentExecutionTier: nextTierStartingDepth,\n expectedActionCount: expectedNumberOfChildThreads,\n telemetry: this.telemetry\n });\n\n const refreshconfigslocal: Set = new Set();\n\n nextTier.nextTierCounter = { next: nextTierStartingDepth };\n // DO NOT Trace using current action context, use only secondaryContext to remain consistent with actions\n const promises: Promise[] = executionParams.map(param => {\n // TODO: should we read from input about the cacheability?\n return param.execute(nextTier, requestCache, appCache, shouldByPassCache(this.requestContext), []).then(refreshActions => {\n // refresh the data actions which need to be refreshed.\n if (refreshActions.length) {\n refreshconfigslocal.add({\n paramExecutor: param,\n actionInputs: refreshActions\n });\n\n this.refreshConfigs.push({\n paramExecutor: param,\n actionInputs: refreshActions\n });\n\n const cacheValue = requestCache.get(REFRESH_ACTIONS_CACHE_KEY);\n const refreshConfigs = cacheValue ? cacheValue.item : [];\n refreshConfigs.push({\n paramExecutor: param,\n actionInputs: refreshActions\n });\n requestCache.put(REFRESH_ACTIONS_CACHE_KEY, {\n item: refreshConfigs\n });\n }\n\n // If the current chain action completes execution\n // decrement the max number of threads that we expect\n // from the next tier\n nextTier.expectedActionsInCurrentTier--;\n\n if (!nextTier.hasRun) {\n // First check if the next tier has any actions\n // then check if the number of thread match expected\n if (nextTier.currentActionsInQueue > 0 && nextTier.currentActionsInQueue === nextTier.expectedActionsInCurrentTier) {\n return nextTier.runAllActionsInQueue();\n }\n }\n });\n });\n\n // Wait until all the actions in current tier are run to completion\n return Promise.all(promises)\n .then(() => {\n if (refreshconfigslocal.size > 0 && requestContext.features && !!requestContext.features.disable_appcache_refresh_await) {\n refreshconfigslocal.forEach(rf => {\n const refreshRequestCache = new RequestCache();\n const refreshContext = new ActionContext({\n id: 'Refresh Context',\n requestContext: requestContext,\n requestCache: new RequestCache(),\n telemetry: this.telemetry,\n appCache: appCache,\n spawnChildOnExecute: true\n });\n\n rf.paramExecutor\n .execute(\n refreshContext,\n refreshRequestCache,\n this.appCache,\n shouldByPassCache(this.requestContext),\n rf.actionInputs\n )\n .then(() =>\n verboseLogger(\n this.requestContext,\n StaticTelemetry,\n `BackgroundRefresh - Executed refresh with action input ${rf.actionInputs[0].getCacheObjectType()}-${rf.actionInputs[0].getCacheKey()}`\n )\n )\n .catch(error => {\n StaticTelemetry.log(\n LogLevel.Warning,\n `BackgroundRefresh - Error execution refresh with action input ${rf.actionInputs[0].getCacheObjectType()}-${rf.actionInputs[0].getCacheKey()}`\n );\n });\n });\n }\n this._endCurrentTier();\n })\n .catch(error => {\n this._endCurrentTier();\n throw error;\n });\n }\n\n /**\n * Returns true if current tier has exceeded max depth\n */\n private isMaxDepthExceeded = (): boolean => {\n const maxDepth =\n (this.requestContext &&\n this.requestContext.app &&\n this.requestContext.app.platform &&\n this.requestContext.app.platform.maxDepth) ||\n ActionContext.maxDepth;\n return this.nextTierCounter.next > maxDepth;\n };\n\n /**\n * Retrieves item from request cache and fallsback to app cache if not found\n */\n private getItemFromCache = (cacheKey: ICacheKey): T | undefined => {\n let cachedItem = this.requestCache.get(cacheKey);\n\n if (cachedItem) {\n return cachedItem.item;\n }\n\n if (process.env.CURRENT_ENVIRONMENT === 'node' && this.appCache) {\n cachedItem = this.appCache.get(cacheKey);\n }\n\n return cachedItem ? cachedItem.item : undefined;\n };\n\n /**\n * Signals the end of current tier so actions can return the response\n */\n private _endCurrentTier = (): void => {\n this.hasRun = true;\n EventHelper.emit(`${this.eventId}:completed`, this.currentExecutionTier);\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 generateImageUrlForOmniChanel,\n IAction,\n IActionContext,\n IActionInput,\n IRequestContext,\n versionGte\n} from '@msdyn365-commerce/core-internal';\nimport { getMediaLocationsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\n// @ts-ignore\nimport { MediaLocation, MediaType } from '@msdyn365-commerce/retail-proxy';\nimport { createObservableDataAction } from '../create-data-action.vnext';\n\n/**\n * The action input class for the getMediaLocationsForSelectedVariant data action.\n */\nexport class MediaLocationsInput implements IActionInput {\n public productId: number;\n\n public channelId: number;\n\n public catalogId: number;\n\n private readonly locale?: string;\n\n constructor(context: IRequestContext, productId: number, channelId: number, catalogId?: number) {\n this.productId = productId;\n this.channelId = channelId;\n this.catalogId = catalogId || 0;\n this.locale = context.locale;\n }\n\n public getCacheKey = () => `${this.productId}-${this.channelId}-${this.catalogId}-${this.locale}}`;\n\n public getCacheObjectType = () => 'ProductMediaLocations';\n\n public dataCacheType = (): CacheType => 'application';\n}\n\n/**\n * The action method for the getMediaLocationsForSelectedVariant data action.\n * @param input\n * @param ctx\n */\nexport async function getMediaLocationsForProductAction(input: MediaLocationsInput, ctx: IActionContext): Promise {\n const rsVersion =\n !process.env.MSDyn365Commerce_RSVERSION || process.env.MSDyn365Commerce_RSVERSION === '--'\n ? '0.0'\n : process.env.MSDyn365Commerce_RSVERSION;\n const OmniChannelMediaFeatureVersion = versionGte(rsVersion, '9.43');\n if (!OmniChannelMediaFeatureVersion) {\n return [];\n }\n // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -- Need for Omni feature.,\n const types = require('@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g');\n\n // TODO: once the dynamicProvider api for fetching the media locations from the azureCms is implemented\n // we should uncomment these code so we can preview the product in edit mode without publish the product.\n // if (ctx.requestContext.params && ctx.requestContext.params.isEditor) {\n // return getOmniChannelMediaInfoAsync(ctx.requestContext, input.productId);\n // }\n\n let productMediaLocations = [];\n try {\n productMediaLocations = await getMediaLocationsAsync(\n {\n callerContext: ctx,\n queryResultSettings: {\n Paging: { Top: Number.parseInt(ctx.requestContext?.app?.platform?.defaultPageSizeForAPI ?? 100, 10) }\n }\n },\n input.productId,\n input.channelId,\n input.catalogId\n );\n } catch (error) {\n ctx.telemetry.error(`Error running getMediaLocationsAsync action: ${error}`);\n return [];\n }\n\n // Filtering product images and videos only\n let productImagesAndVideos = productMediaLocations.filter(\n // @ts-ignore\n media => media.MediaTypeValue === types.MediaType.Image || media.MediaTypeValue === types.MediaType.Video\n );\n if (productImagesAndVideos.length === 0) {\n return [];\n }\n\n // sorting the images by display order settings.\n productImagesAndVideos = productImagesAndVideos.sort((a, b) => {\n // @ts-ignore\n if (typeof a.DisplayOrder === 'undefined' && typeof b.DisplayOrder === 'undefined') {\n return 0;\n // @ts-ignore\n } else if (typeof a.DisplayOrder === 'undefined') {\n return 1;\n // @ts-ignore\n } else if (typeof b.DisplayOrder === 'undefined') {\n return -1;\n } else {\n // @ts-ignore\n return a.DisplayOrder - b.DisplayOrder;\n }\n });\n const productMedia = productImagesAndVideos.map((mediaLocation: MediaLocation) => {\n const mediaLoc = { ...mediaLocation };\n // @ts-ignore\n if (mediaLoc.MediaTypeValue === types.MediaType.Image) {\n mediaLoc.Uri = generateImageUrlForOmniChanel(ctx.requestContext.apiSettings, mediaLocation.Uri);\n }\n return mediaLoc;\n });\n\n return productMedia;\n}\n\n/**\n * The getMediaLocationsForSelectedVariant data action\n * Gets the currently selected variant for the page via the getSelectedVariant data action,\n * and then gets the media location information for the variant via the MediaLocations RetailServer API.\n */\nexport const getMediaLocationsForSelectedVariantActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce/get-mediaLocations',\n action: >getMediaLocationsForProductAction\n});\n\nexport default getMediaLocationsForProductAction;\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 generateImageUrlForOmniChanel,\n IAction,\n IActionContext,\n IActionInput,\n IRequestContext,\n versionGte\n} from '@msdyn365-commerce/core-internal';\n// @ts-ignore\nimport { MediaLocation, MediaType } from '@msdyn365-commerce/retail-proxy';\nimport { createObservableDataAction } from '../create-data-action.vnext';\n\nexport enum MediaLocationType {\n All,\n Image,\n Video,\n File\n}\n\n/**\n * The action input class for the getAdditionalMediaLocationsForSelectedVariant data action.\n */\nexport class AdditionalMediaLocationsInput implements IActionInput {\n public productId: number;\n\n public channelId: number;\n\n public catalogId: number;\n\n // defaulting to image for backwards compatibility, old version filters Image by default.\n public typeFilter: MediaLocationType;\n\n private readonly locale?: string;\n\n constructor(context: IRequestContext, productId: number, channelId: number, catalogId?: number, typeFilter = MediaLocationType.All) {\n this.productId = productId;\n this.channelId = channelId;\n this.catalogId = catalogId || 0;\n this.typeFilter = typeFilter;\n this.locale = context.locale;\n }\n\n public getCacheKey = () => `${this.productId}-${this.channelId}-${this.catalogId}-${this.locale}}-${this.typeFilter}`;\n\n public getCacheObjectType = () => 'ProductAdditionalMediaLocations';\n\n public dataCacheType = (): CacheType => 'application';\n}\n\n/**\n * The action method for the getAdditionalMediaLocationsForSelectedVariant data action.\n * @param input\n * @param ctx\n */\nexport async function getAdditionalMediaLocationsForProductAction(\n input: AdditionalMediaLocationsInput,\n ctx: IActionContext\n): Promise {\n const rsVersion =\n !process.env.MSDyn365Commerce_RSVERSION || process.env.MSDyn365Commerce_RSVERSION === '--'\n ? '0.0'\n : process.env.MSDyn365Commerce_RSVERSION;\n const OmniChannelAdditionalMediaFeatureVersion = versionGte(rsVersion, '9.46');\n if (!OmniChannelAdditionalMediaFeatureVersion) {\n return [];\n }\n // the types and productActions are not available in all versions of retail-proxy, so they are imported by direct reference after comparing the version to the minimum required(9.46)\n // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -- Need for Omni feature.,\n const types = require('@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g');\n // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -- Need for Omni feature.,\n const productActions = require('@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g');\n\n // TODO: once the dynamicProvider api for fetching the media locations from the azureCms is implemented\n // we should uncomment these code so we can preview the product in edit mode without publish the product.\n // if (ctx.requestContext.params && ctx.requestContext.params.isEditor) {\n // return getOmniChannelMediaInfoAsync(ctx.requestContext, input.productId);\n // }\n\n let productMediaLocations = [];\n try {\n productMediaLocations = await productActions.searchMediaLocationsAsync(\n {\n callerContext: ctx,\n queryResultSettings: {\n Paging: { Top: Number.parseInt(ctx.requestContext?.app?.platform?.defaultPageSizeForAPI ?? 100, 10) }\n }\n },\n {\n ProductId: input.productId,\n ChannelId: input.channelId,\n CatalogId: input.catalogId,\n MediaUsageTypeValue: 1\n }\n );\n } catch (error) {\n ctx.telemetry.error(`Error running searchMediaLocationsAsync action: ${error}`);\n return [];\n }\n\n // Need to add a second enum for MediaTypeValue because the RetailServer API returns a different enum for the MediaTypeValue property,\n // where default is \"None\" instead of \"All\"\n let filteredMedia: MediaLocation[] = [];\n switch (input.typeFilter) {\n case MediaLocationType.Image:\n // @ts-ignore\n filteredMedia = productMediaLocations.filter(media => media.MediaTypeValue === types.MediaType.Image);\n break;\n case MediaLocationType.Video:\n // @ts-ignore\n filteredMedia = productMediaLocations.filter(media => media.MediaTypeValue === types.MediaType.Video);\n break;\n case MediaLocationType.File:\n // @ts-ignore\n filteredMedia = productMediaLocations.filter(media => media.MediaTypeValue === types.MediaType.File);\n break;\n default:\n filteredMedia = productMediaLocations;\n }\n if (filteredMedia.length === 0) {\n return [];\n }\n\n // sorting the images by display order settings.\n filteredMedia = filteredMedia.sort((a, b) => {\n // @ts-ignore\n if (typeof a.DisplayOrder === 'undefined' && typeof b.DisplayOrder === 'undefined') {\n return 0;\n // @ts-ignore\n } else if (typeof a.DisplayOrder === 'undefined') {\n return 1;\n // @ts-ignore\n } else if (typeof b.DisplayOrder === 'undefined') {\n return -1;\n } else {\n // @ts-ignore\n return a.DisplayOrder - b.DisplayOrder;\n }\n });\n const productMedia = filteredMedia.map((mediaLocation: MediaLocation) => {\n mediaLocation.Uri = generateImageUrlForOmniChanel(ctx.requestContext.apiSettings, mediaLocation.Uri);\n mediaLocation.AltText = mediaLocation.AltText;\n return mediaLocation;\n });\n return productMedia;\n}\n\n/**\n * The getAdditionalMediaLocationsForSelectedVariantActionDataAction data action\n * Gets the currently selected variant for the page via the getSelectedVariant data action,\n * and then gets the media location information for the variant via the MediaLocations RetailServer API.\n */\nexport const getAdditionalMediaLocationsForSelectedVariantActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce/get-additional-mediaLocations',\n action: >getAdditionalMediaLocationsForProductAction\n});\n\nexport default getAdditionalMediaLocationsForProductAction;\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 IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICommerceApiSettings,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core-internal';\nimport { Customer } from '@msdyn365-commerce/retail-proxy';\nimport { readAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CustomersDataActions.g';\nimport { createObservableDataAction } from '../create-data-action.vnext';\n\n/**\n * Input class for get customer data action.\n */\nexport class GetCustomerInput implements IActionInput {\n public customerAccountNumber?: string;\n\n private readonly apiSettings: ICommerceApiSettings;\n\n private readonly cacheType?: CacheType;\n\n public constructor(apiSettings: ICommerceApiSettings, accountNumber?: string, cacheType?: CacheType) {\n this.customerAccountNumber = accountNumber;\n this.apiSettings = apiSettings;\n this.cacheType = cacheType;\n }\n\n /**\n * GetCacheKey.\n * @returns - Returns string.\n */\n public getCacheKey = (): string => `Customer-${this.customerAccountNumber}-chanId:${this.apiSettings.channelId}`;\n\n /**\n * GetCacheObjectType.\n * @returns - Cache Object Type string.\n */\n public getCacheObjectType = (): string => 'Customer';\n\n /**\n * DataCacheType.\n * @returns - CacheType string.\n */\n public dataCacheType = (): CacheType => {\n return this.cacheType ? this.cacheType : 'request';\n };\n}\n\n/**\n * Creates the input required to make the retail api call.\n * @param inputData -- The input data passed to the createInput method.\n * @returns - GetCustomer input.\n */\nexport const createGetCustomerInput = (inputData: ICreateActionContext>): GetCustomerInput => {\n const { user, apiSettings } = inputData.requestContext;\n if (!user.token || !user.isAuthenticated) {\n throw new Error('[getCustomer][createInput]: User is not Authenticated.');\n }\n\n return new GetCustomerInput(apiSettings);\n};\n\n/**\n * GetCustomerAction.\n * @param input - GetCustomerInput.\n * @param ctx - Action Context.\n * @returns - Customer information.\n */\nconst getCustomerAction = async (input: GetCustomerInput, ctx: IActionContext): Promise => {\n if (input && ctx.requestContext.user.isAuthenticated) {\n try {\n return readAsync({ callerContext: ctx, bypassCache: 'get' }, '').then(response => {\n return Array.isArray(response) ? response[0] : response;\n });\n } catch (error) {\n ctx.telemetry.error(`Error running getCustomer action: ${error}`);\n return {};\n }\n }\n\n ctx.telemetry.warning('[getCustomer]Invalid input passed to action');\n return {};\n};\n\n/**\n * The customer data action.\n */\nexport const getCustomerActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce/get-customer',\n action: >getCustomerAction,\n input: createGetCustomerInput\n});\n\nexport default getCustomerActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IDictionary } from '@msdyn365-commerce/core-internal';\n\nexport enum ICacheSource {\n RequestCache,\n AppCache\n}\n\nexport interface ICacheKey {\n key: string;\n typeName: string;\n}\n\nexport interface ICacheItem {\n item: T;\n shouldRefresh?: boolean;\n error?: boolean;\n instance?: string;\n // property to indicate the source whether it is app/request\n s?: ICacheSource;\n /**\n * Flag to track the when the item start refreshing.\n */\n refreshStartTimeInMS?: number;\n lastRefreshTime?: Date;\n}\n\nexport interface ICompressCache {\n data: T;\n isCompressed: boolean;\n}\n\nexport interface ICacheItemOptions {\n ttr?: number;\n ttl?: number;\n cacheKeySuffix?: string;\n}\nexport interface ICacheStats {\n keys?: number;\n hits?: number;\n misses?: number;\n totalKeySize?: number;\n totalValueSize?: number;\n valueSizePerKey?: object;\n}\n\n/**\n * Interface exposing methods for caching\n */\nexport interface ICache {\n /**\n * @function {put} - Method to insert an item in the cache\n * @param cacheKey {ICacheKey} - object to build the cache key\n * @param cacheItem {ICacheItem} - item that needs to be inserted in the cache\n * @param options {ICacheItemOptions} - Optional cache item options\n */\n put(cacheKey: ICacheKey, item: ICacheItem, options?: ICacheItemOptions): boolean;\n\n /**\n * @function {get} - Method to get the cached item\n * @param cacheKey {ICacheKey} - object to build the cache key\n * @return {ICacheItem} - cached value against the given cache key\n */\n get(cacheKey: ICacheKey): ICacheItem | undefined;\n\n /**\n * @function {getValue} - Method to get the cached item\n * @param cacheKey {ICacheKey} - object to build the cache key\n * @return {T} - cached value against the given cache key\n */\n getValue(cacheKey: ICacheKey): T | undefined;\n\n /**\n * @function {getAllItems} - Method to get all cached items for a given type\n * @param typeName {typeName} - typeName for which all items need to be fetched\n * @return {ICacheItem} - dictionary of cache items of the given typeName\n */\n getAllItems(typeName: string): IDictionary> | undefined;\n\n /**\n * @param cacheKey {ICacheKey} - object to build the cache key\n * @param toCache {ICache} - cache object to which the item needs to be copied\n * @return {ICacheItem} - cache item that was copied\n */\n copyTo(cacheKey: ICacheKey, toCache: ICache, isObservable?: boolean): ICacheItem | undefined;\n\n /**\n * @function {del} - Method to delete an item from the cache\n * @param key {ICacheKey[]} - Array of ICacheGetData items whose values need to be deleted from cache\n * @return {number} - returns true if the cache key is deleted successfully. Does not throw errors.\n */\n del(cacheKey: ICacheKey): boolean;\n\n /**\n * @function {flushAll} - Method to flush all data from the cache\n */\n flushAll(): void;\n\n /**\n * @function {getStats} - Returns statstics about the cache (number of keys, value size in bytes, etc)\n */\n getStats?(): ICacheStats;\n\n /**\n * @function {flushStats} - Flush the stats\n */\n flushStats?(): void;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICacheKey } from './ICache';\n\nexport const MODULE_CSS_CACHE_KEY = 'MODULE-CSS-CHUNKS';\nexport const MODULE_CSS_CACHE_TYPENAME = '__MODULECSSCHUNKS__';\n\nexport const normalizeCacheKey = (cacheKey: ICacheKey): ICacheKey => {\n return {\n typeName: cacheKey.typeName.toUpperCase(),\n key: cacheKey.key.toUpperCase()\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IDictionary } from '@msdyn365-commerce/core-internal';\nimport { isAsyncResult } from '@msdyn365-commerce/retail-proxy';\nimport { observable, set, transaction } from 'mobx';\nimport { normalizeCacheKey } from './cache-utils';\nimport { ICache, ICacheItem, ICacheKey, ICacheSource } from './ICache';\n\n/**\n * Client cache implementation\n */\nexport class RequestCache implements ICache {\n private internalCache: { [typeName: string]: IDictionary> } = {};\n\n /**\n * @function {put} - Method to insert an item in the cache\n * @param cacheKey {ICacheKey} - object to build the cache key\n * @param cacheItem {ICacheItem} - item that needs to be inserted in the cache\n */\n public put(cacheKey: ICacheKey, item: ICacheItem): boolean {\n if (!cacheKey.typeName) {\n throw new Error(`Invalid type (${cacheKey.typeName} specified)`);\n }\n\n if (!cacheKey.key) {\n throw new Error(`Invalid key (${cacheKey.key} specified) for typeName: ${cacheKey.typeName}`);\n }\n\n item.s = item.s !== undefined ? item.s : ICacheSource.RequestCache;\n const { typeName, key } = normalizeCacheKey(cacheKey);\n if (this.internalCache[typeName] === undefined) {\n this.internalCache[typeName] = {};\n }\n return transaction(() => {\n let cacheItem: ICacheItem = >this.internalCache[typeName][key];\n\n // For updating AsyncResults, only update result\n if (cacheItem && isAsyncResult(cacheItem.item)) {\n if (cacheItem.item.status !== 'LOADING') {\n set(cacheItem.item, 'status', 'LOADING');\n }\n set(cacheItem.item, 'result', item.item);\n // Auto resolve promises whos result is being set, as they are essentially being force-completed\n set(cacheItem.item, 'status', 'SUCCESS');\n } else if (cacheItem) {\n set(cacheItem, 'item', item.item);\n } else {\n if (!isAsyncResult(item.item)) {\n cacheItem = observable>({ ...item }, undefined, {\n deep: true,\n name: `T:${typeName}_K:${key}`\n });\n } else {\n cacheItem = item;\n }\n this.internalCache[typeName][key] = cacheItem;\n }\n\n return true;\n });\n }\n\n /**\n * @function {get} - Method to get the cached item\n * @param cacheKey {ICacheKey} - object to build the cache key\n * @return {IAny} - cached value against the given cache key\n */\n public get(cacheKey: ICacheKey): ICacheItem | undefined {\n if (!cacheKey) {\n throw new Error(`Invalid cacheKey: ${cacheKey}`);\n }\n\n if (!cacheKey.typeName) {\n throw new Error(`Invalid cacheKey type: ${cacheKey.typeName}`);\n }\n\n cacheKey = normalizeCacheKey(cacheKey);\n return this.internalCache[cacheKey.typeName] ? >this.internalCache[cacheKey.typeName][cacheKey.key] : undefined;\n }\n\n /**\n * @function {get} - Method to get the cached item\n * @param cacheKey {ICacheKey} - object to build the cache key\n * @return {IAny} - cached value against the given cache key\n */\n public getAllItems(typeName: string): IDictionary> | undefined {\n if (!typeName) {\n throw new Error(`typeName cannot be empty`);\n }\n\n return >>this.internalCache[typeName.toUpperCase()];\n }\n\n /**\n * @function {getValue} - Method to get the cached item\n * @param cacheKey {ICacheKey} - object to build the cache key\n * @return {IAny} - cached value against the given cache key\n */\n public getValue(cacheKey: ICacheKey): T | undefined {\n const cachedItem: ICacheItem | undefined = this.get(cacheKey);\n return cachedItem ? this._value(cachedItem) : undefined;\n }\n\n /**\n * @param cacheKey {ICacheKey} - object to build the cache key\n * @param toCache {ICache} - cache object to which the item needs to be copied\n * @return {ICacheItem} - cache item that was copied\n */\n public copyTo(cacheKey: ICacheKey, toCache: ICache): ICacheItem | undefined {\n throw new Error('Not Implemented');\n }\n\n /**\n * @function {del} - Method to delete an item from the cache\n * @param key {ICacheKey} - Array of ICacheGetData items whose values need to be deleted from cache\n * @return {number} - returns true if the cache key is deleted successfully. Does not throw errors.\n */\n public del(cacheKey: ICacheKey): boolean {\n cacheKey = normalizeCacheKey(cacheKey);\n const cacheType = this.internalCache[cacheKey.typeName];\n if (cacheType && cacheType[cacheKey.key]) {\n delete cacheType[cacheKey.key];\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @function {flushAll} - Method to flush all data from the cache\n */\n public flushAll(): void {\n this.internalCache = {};\n }\n\n /**\n * @function {keys} - Method to fetch all the keys in the cache\n * @return {string[]} - returns a list of all the keys in the cache\n */\n public keys(): string[] {\n return Object.keys(this.internalCache);\n }\n\n /**\n * Get the value out of a cache item\n * This returns the raw value of the item, it will *not* be a MobX observable value\n * @param item The observable cache item to retireve the value from\n */\n private _value(item: ICacheItem): T {\n return item.item;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nexport * from './create-data-action';\nexport * from './create-data-action.vnext';\nexport * from './create-data-action-hook';\nexport * from './action-context';\nexport * from './action-executor';\nexport * from './cache/client-cache';\nexport * from './cache/simple-cache';\nexport * from './event-emitter';\nexport * from './mock-helper';\nexport * from './cache/retail-cache-helper';\nexport * from './action-registrar';\nexport * from './helpers';\nexport * from './actions/get-media-locations';\nexport * from './actions/get-additional-media-locations';\nexport * from './actions/get-customer';\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/uuidjs/uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","'use strict';\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (O, P) {\n if (!delete O[P]) throw $TypeError('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));\n};\n","var userAgent = require('../internals/engine-user-agent');\n\nvar firefox = userAgent.match(/firefox\\/(\\d+)/i);\n\nmodule.exports = !!firefox && +firefox[1];\n","var UA = require('../internals/engine-user-agent');\n\nmodule.exports = /MSIE|Trident/.test(UA);\n","var userAgent = require('../internals/engine-user-agent');\n\nvar webkit = userAgent.match(/AppleWebKit\\/(\\d+)\\./);\n\nmodule.exports = !!webkit && +webkit[1];\n","'use strict';\nvar $ = require('../internals/export');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar aCallable = require('../internals/a-callable');\nvar toObject = require('../internals/to-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar deletePropertyOrThrow = require('../internals/delete-property-or-throw');\nvar toString = require('../internals/to-string');\nvar fails = require('../internals/fails');\nvar internalSort = require('../internals/array-sort');\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\nvar FF = require('../internals/engine-ff-version');\nvar IE_OR_EDGE = require('../internals/engine-is-ie-or-edge');\nvar V8 = require('../internals/engine-v8-version');\nvar WEBKIT = require('../internals/engine-webkit-version');\n\nvar test = [];\nvar nativeSort = uncurryThis(test.sort);\nvar push = uncurryThis(test.push);\n\n// IE8-\nvar FAILS_ON_UNDEFINED = fails(function () {\n test.sort(undefined);\n});\n// V8 bug\nvar FAILS_ON_NULL = fails(function () {\n test.sort(null);\n});\n// Old WebKit\nvar STRICT_METHOD = arrayMethodIsStrict('sort');\n\nvar STABLE_SORT = !fails(function () {\n // feature detection can be too slow, so check engines versions\n if (V8) return V8 < 70;\n if (FF && FF > 3) return;\n if (IE_OR_EDGE) return true;\n if (WEBKIT) return WEBKIT < 603;\n\n var result = '';\n var code, chr, value, index;\n\n // generate an array with more 512 elements (Chakra and old V8 fails only in this case)\n for (code = 65; code < 76; code++) {\n chr = String.fromCharCode(code);\n\n switch (code) {\n case 66: case 69: case 70: case 72: value = 3; break;\n case 68: case 71: value = 4; break;\n default: value = 2;\n }\n\n for (index = 0; index < 47; index++) {\n test.push({ k: chr + index, v: value });\n }\n }\n\n test.sort(function (a, b) { return b.v - a.v; });\n\n for (index = 0; index < test.length; index++) {\n chr = test[index].k.charAt(0);\n if (result.charAt(result.length - 1) !== chr) result += chr;\n }\n\n return result !== 'DGBEFHACIJK';\n});\n\nvar FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;\n\nvar getSortCompare = function (comparefn) {\n return function (x, y) {\n if (y === undefined) return -1;\n if (x === undefined) return 1;\n if (comparefn !== undefined) return +comparefn(x, y) || 0;\n return toString(x) > toString(y) ? 1 : -1;\n };\n};\n\n// `Array.prototype.sort` method\n// https://tc39.es/ecma262/#sec-array.prototype.sort\n$({ target: 'Array', proto: true, forced: FORCED }, {\n sort: function sort(comparefn) {\n if (comparefn !== undefined) aCallable(comparefn);\n\n var array = toObject(this);\n\n if (STABLE_SORT) return comparefn === undefined ? nativeSort(array) : nativeSort(array, comparefn);\n\n var items = [];\n var arrayLength = lengthOfArrayLike(array);\n var itemsLength, index;\n\n for (index = 0; index < arrayLength; index++) {\n if (index in array) push(items, array[index]);\n }\n\n internalSort(items, getSortCompare(comparefn));\n\n itemsLength = lengthOfArrayLike(items);\n index = 0;\n\n while (index < itemsLength) array[index] = items[index++];\n while (index < arrayLength) deletePropertyOrThrow(array, index++);\n\n return array;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar fails = require('../internals/fails');\nvar getBuiltIn = require('../internals/get-built-in');\nvar isCallable = require('../internals/is-callable');\nvar speciesConstructor = require('../internals/species-constructor');\nvar promiseResolve = require('../internals/promise-resolve');\nvar defineBuiltIn = require('../internals/define-built-in');\n\nvar NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;\n\n// Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829\nvar NON_GENERIC = !!NativePromiseConstructor && fails(function () {\n // eslint-disable-next-line unicorn/no-thenable -- required for testing\n NativePromisePrototype['finally'].call({ then: function () { /* empty */ } }, function () { /* empty */ });\n});\n\n// `Promise.prototype.finally` method\n// https://tc39.es/ecma262/#sec-promise.prototype.finally\n$({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {\n 'finally': function (onFinally) {\n var C = speciesConstructor(this, getBuiltIn('Promise'));\n var isFunction = isCallable(onFinally);\n return this.then(\n isFunction ? function (x) {\n return promiseResolve(C, onFinally()).then(function () { return x; });\n } : onFinally,\n isFunction ? function (e) {\n return promiseResolve(C, onFinally()).then(function () { throw e; });\n } : onFinally\n );\n }\n});\n\n// makes sure that native promise-based APIs `Promise#finally` properly works with patched `Promise#then`\nif (!IS_PURE && isCallable(NativePromiseConstructor)) {\n var method = getBuiltIn('Promise').prototype['finally'];\n if (NativePromisePrototype['finally'] !== method) {\n defineBuiltIn(NativePromisePrototype, 'finally', method, { unsafe: true });\n }\n}\n"],"names":["DEPRECATED_HOOK_TYPES","ActionRegistrar","dataActionRegister","getRegistration","id","msdyn365Commerce","partnerDataAction","default","action","prototype","Action","unwrapAction","isAction","getAction","registeredAction","registerAction","dataAction","actionRegister","registration","registerHook","hookType","hook","indexOf","StaticTelemetry","LogLevel","hooks","Array","isArray","hookRegistration","Set","forEach","h","add","newRegistration","registerPostHook","registerPreHook","registerPreReadOnlyHook","registerPostReadOnlyHook","registerPreReaderHook","registerPostReaderHook","getPreHooks","actionRegistration","pre","getPostHooks","post","getPreReadHooks","preRead","getPostReadHooks","postRead","getPreReaderHooks","preReader","getPostReaderHooks","postReader","resolveAction","resolveRegistration","preHooks","postHooks","preReadHooks","postReadHooks","preReaderHooks","postReaderHooks","createObservableDataAction","options","wrappedAction","wrapDataAction","actionWrap","Error","input","name","inputFunc","isBatched","_action","RegistrationId","registrationId","func","_isBatched","newAction","_objectSpread","setProperty","propertyName","value","arg1","arg2","AsyncResult","resolve","reject","chainAction","then","result","catch","error","ActionError","constructor","super","this","Name","message","status","Object","setPrototypeOf","static","shouldReadFromAppCache","appCache","undefined","dataCacheType","shouldWriteToAppCache","isAppCacheData","hasCacheSetting","getCacheObjectType","GET_FROM_RETURNIDENTIFIER","addLocaleInformation","inputs","locale","DataServiceRequest","getCacheKey","endsWith","tmp","_cacheKeyFromInput","_resolveCacheEntryReference","dataServiceRequest","item","requestCache","isWrappingPromise","isObservable","arguments","length","cacheValueAsArray","key","map","cacheObjectType","_cacheObjectType","get","typeName","copyTo","valueItem","isAsyncResult","filter","data","isReturnTypeACollection","_query","logTelemetrySource","cacheValue","cacheKey","context","telemetry","s","ICacheSource","verboseLogger","values","readCacheEntriesBasedOnCacheKeyFromReturnType","cacheKeyFromReturnType","_cacheKeyFromReturnType","cacheKeyIdentifierFromReturnType","_cacheKeyIdentifierFromReturnType","entry","shouldRefresh","shouldRefreshAll","cacheEntries","Boolean","cacheEntriesReturn","readCacheEntries","cacheKeyFromInput","entries","cachedValueBasedOnInput","$ref","cachedValueBasedOnInputItem","resolvedRef","_saveEntityToCache","isCacheTypeApplication","isInstance","dataServiceRequestQuery","results","toString","call","identifierValue","existingCacheItem","existingCacheObjectType","existingCacheKeyIdentifierFromReturnType","existingCacheIsReturnTypeACollection","existingCacheTotalCount","_totalCount","type","identifier","isCollection","count","_existingCacheItem","_existingCacheItem$it","keys","entryKey","put","instance","saveCacheEntries","metadata","_otherOdata","others","listeners","Map","eventEmitter","window","EventEmitter","on","event","callback","set","push","emit","_len","args","_key","listener","removeAllListeners","delete","defaultHookTimeoutInMS","CLIENT_HYDRATE_KEY","CLIENT_HYDRATE_TYPE","Timer","timeoutInMS","Promise","setTimeout","bind","ActionTimer","_resolve","ActionExecutor","dataActionOption","_shouldUseInstanceCache","_msdyn365Commerce$pla","checkVersionForFeature","shouldUseInstanceCache","eventId","uuidv1","masterInput","cacheType","shouldCacheOutput","trace","addInputs","async","bypassAppCache","refreshingInputs","unique","_removeDuplicates","actionId","_getActionIdFromInputs","performanceUtils","getPerformanceUtils","executionId","performanceUtilsPackage","Random","Guid","generateGuid","runPreReadonlyDataActionPerformanceHook","internalCache","cache","_executeDataAction","runPostReadonlyDataActionPerformanceHook","isRefreshingAction","_runPreReadHooks","err","_runPreReaderHooks","uncached","needsRefresh","_checkForCachedData","_fetchOutputsAndRunPostReadHook","cachedActions","includes","outputs","_executeBatchedObservableActions","_executeObservableAction","_actionWrapper","log","_saveResponseToCache","_checkShouldInteractWithCache","i","cacheItem","getValue","_runPostReadHooks","_runPostReaderHooks","_uniqWith","inputA","inputB","inputsActionId","getActionId","_getActionFromId","hookTimeout","Number","_get2","timer","from","reduce","previousTask","currentTask","race","requestContext","asSystemMetadata","exception","actionResult","prevInput","tmpNextInput","finalNextInput","prevOutput","tmpNextOutput","finalNextOutput","isRefreshing","_inputs","_runPreHooks","e","convertedError","_convertToJSError","CorrelationId","clientSideCustomerTimeout","promises","_errorCode","ErrorTypeEnum","ProxyError","_runPostHooks","idx","appCacheData","usingInstanceCache","features","disable_instance_cache","actionName","entityId","entityType","isActionError","isTimeoutError","cacheEntry","assign","unresolvedSet","uncachedInputs","asyncOutputs","index","executor","innerResolve","innerReject","EventHelper","onEventIdFinalCompletion","cachedPromise","run","actionResults","finally","unresolvedIndex","isServiceUnavailable","cachedItem","asyncOutput","bypassCache","refreshing","_interceptCacheForMocks","clientHydrateCacheKey","isClientHydrate","runOn","refresh","disable_bypass_request_cache","existingItem","mockItem","_getMockItem","mockItemJSObject","toJS","cacheNamespace","proxyError","ErrorCode","CatalogsInput","customerAccountNumber","buildCacheKey","base","channelId","apiSettings","catalogId","user","getCatalogsAsync","callerContext","createCatalogsInput","inputData","isAuthenticated","shouldByPassCache","query","cachebypass","isPageInsightsEnabled","params","pageInsights","REFRESH_ACTIONS_CACHE_KEY","ActionContext","executionParams","cacheKeyMap","refreshConfigs","hasRun","currentActionsInQueue","nextTierCounter","next","spawnChildOnExecute","currentExecutionTier","threadId","debug","isMaxDepthExceeded","maxDepth","app","platform","getItemFromCache","_endCurrentTier","expectedActionCount","expectedActionsInCurrentTier","moduleTelemetry","Telemetry","isDebug","registerTraceLogger","traceLogger","GenericConsoleLogger","disable_app_cache","getRefreshActions","actionOption","runAllActionsInQueue","inputsArray","current","find","a","inputIdentifier","asyncResult","tierNum","refreshStartTimeInMS","splice","all","_type","update","dataArray","inputArray","preparedCacheKey","getAll","cachedEntries","getAllItems","expectedNumberOfChildThreads","nextTierStartingDepth","nextTier","refreshconfigslocal","param","execute","refreshActions","paramExecutor","actionInputs","size","disable_appcache_refresh_await","rf","refreshRequestCache","RequestCache","refreshContext","getMediaLocationsForProductAction","ctx","versionGte","process","types","require","productMediaLocations","_ctx$requestContext$a","_ctx$requestContext","_ctx$requestContext$a2","_ctx$requestContext$a3","getMediaLocationsAsync","queryResultSettings","Paging","Top","parseInt","defaultPageSizeForAPI","productId","productImagesAndVideos","media","MediaTypeValue","MediaType","Image","Video","sort","b","DisplayOrder","productMedia","mediaLocation","mediaLoc","Uri","generateImageUrlForOmniChanel","MediaLocationType","getAdditionalMediaLocationsForProductAction","productActions","searchMediaLocationsAsync","ProductId","ChannelId","CatalogId","MediaUsageTypeValue","filteredMedia","typeFilter","File","AltText","GetCustomerInput","accountNumber","getCustomerActionDataAction","readAsync","response","warning","token","normalizeCacheKey","toUpperCase","transaction","observable","deep","_value","toCache","del","flushAll","byteToHex","substr","module","exports","buf","offset","bth","join","getRandomValues","crypto","msCrypto","rnds8","Uint8Array","rnds","r","Math","random","_nodeId","_clockseq","rng","bytesToUuid","_lastMSecs","_lastNSecs","node","clockseq","seedBytes","msecs","Date","getTime","nsecs","dt","tl","tmh","n","tryToString","$TypeError","TypeError","O","P","firefox","match","UA","test","webkit","$","uncurryThis","aCallable","toObject","lengthOfArrayLike","deletePropertyOrThrow","fails","internalSort","arrayMethodIsStrict","FF","IE_OR_EDGE","V8","WEBKIT","nativeSort","FAILS_ON_UNDEFINED","FAILS_ON_NULL","STRICT_METHOD","STABLE_SORT","code","chr","String","fromCharCode","k","v","charAt","target","proto","forced","comparefn","array","itemsLength","items","arrayLength","x","y","getSortCompare","IS_PURE","NativePromiseConstructor","getBuiltIn","isCallable","speciesConstructor","promiseResolve","defineBuiltIn","NativePromisePrototype","real","onFinally","C","isFunction","method","unsafe"],"sourceRoot":""}