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vN,KACxF,GAAIgN,QAAUA,OAAOQ,WAAaR,OAAOQ,UAAUC,UAAW,CAC1D,MAAMC,EAAaC,MAAMC,QAAQL,GAAQA,EAAK,GAAKA,EAC7CuD,EAA+B9Q,EAAcE,eAAe4N,cAAcgD,iBAChF,IAAIC,EAAkC,GAGtC,GAAID,EACA,IACIC,QAAwBlR,EAAAA,EAAAA,GAAiCiR,EAAkB9Q,GAC7E,MAAOiJ,GACLjJ,EAAcyN,UAAUxE,MAAM,sEAAuEA,GAK7G+D,OAAOQ,UAAUC,UAAUO,SAASC,EAAAA,GAAe+C,aAAc,CAC7D7C,OAAQT,EAAWU,GACnBC,YAAaX,EAAWY,QAAUZ,EAAWY,QAAQlN,WAAa,GAClEmN,SAAUwC,EACVvC,QAASd,EAAWe,YAAcf,EAAWe,YAAYrN,WAAa,OAQ9EsN,cArDqB5O,MAAO6O,EAAuC3O,KACnE,IACI,MAAM4O,EAAcjB,MAAMC,QAAQe,GAA+BA,EAAO,GAA0BA,EAGlG,GAAIC,EAAYC,aAAkD,mBAA5BD,EAAYC,YAA4B,CAC1E,MAAMoC,EAAwBrC,EAAYC,cAC1C,GAAIoC,GAAyBA,EAAsBlR,UAG/C,YADAC,EAAcE,eAAe4N,cAAcgD,iBAAmBG,EAAsBlR,WAI5FC,EAAcyN,UAAUsB,MAAM,wEAChC,MAAOC,GACLhP,EAAcyN,UAAUsB,MAAM,0CAA2CC","sources":["webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online/external var \"ReactDOM\"?853b","webpack://Msdyn365.Commerce.Online/./src/actions/telemetry.action.helper.ts?7f4a","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-pva-chat-connector/actions/getBotFrameworkToken.action.ts?0785","webpack://Msdyn365.Commerce.Online/./src/modules/category-page-summary/category-page-summary.action.ts?c40c","webpack://Msdyn365.Commerce.Online/./src/modules/default-page-summary/default-page-summary.action.ts?5b44","webpack://Msdyn365.Commerce.Online/./src/modules/list-page-summary/list-page-summary.action.ts?a1a8","webpack://Msdyn365.Commerce.Online/./src/modules/product-page-summary/product-page-summary.action.ts?9992","webpack://Msdyn365.Commerce.Online/./lib/__local__/module-registration.js?8a42","webpack://Msdyn365.Commerce.Online/./src/actions/addToCart-telemetry.action.ts?4575","webpack://Msdyn365.Commerce.Online/./src/actions/copyCart-checkOut-telemetry.action.ts?403f","webpack://Msdyn365.Commerce.Online/./src/actions/getById-product-telemetry.action.ts?9e39","webpack://Msdyn365.Commerce.Online/./src/actions/getByIds-product-telemetry.action.ts?1a7f","webpack://Msdyn365.Commerce.Online/./src/actions/getVariantsByDimensionValues-telemetry.action.ts?b148","webpack://Msdyn365.Commerce.Online/./src/actions/purchase-telemetry.action.ts?d6c7","webpack://Msdyn365.Commerce.Online/./src/actions/readCart-telemetry.action.ts?ac14","webpack://Msdyn365.Commerce.Online/./src/actions/removeFromCart-telemetry.action.ts?b268","webpack://Msdyn365.Commerce.Online/./src/actions/updateCart-telemetry.action.ts?f56d"],"sourcesContent":["module.exports = React;","module.exports = ReactDOM;","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core-internal';\nimport { CartLine, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { getByIdAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport { IProductInfo } from '@msdyn365-commerce/telemetry-internal';\n\n/**\n * Converts cart line products into promise of array of product info\n * @param cartLines Cart Lines with product info to collect\n * @param actionContext Action context\n * @returns Array of product info\n */\nexport const getProductInfoFromCartLinesAsync = async (cartLines: CartLine[], actionContext: IActionContext): Promise => {\n if (actionContext.requestContext.channel === undefined) {\n throw new Error('Unable to make product call, channel ID not provided');\n }\n\n const productPromises: Promise[] = [];\n\n // Call GetById API for all products in cartLines\n for (let i = 0; i < cartLines.length; i++) {\n // eslint-disable-next-line security/detect-object-injection -- bracket object notation with user input present leads to eslint security issue.\n const cartLine: CartLine = cartLines[i];\n\n if (cartLine.ProductId) {\n // The product id in cartLine actually contains recordId and not master product id so we can use it up here to lookup product.\n productPromises.push(\n getByIdAsync({ callerContext: actionContext }, cartLine.ProductId, actionContext.requestContext.channel.RecordId).then(\n result => {\n // Construct basic IProductInfo object for product\n const productInfo = getProductInfoFromSimpleProduct(result);\n\n // Attach fields from the CartLine\n productInfo.productPrice = cartLine.Price ? cartLine.Price.toString() : '';\n productInfo.productQuantity = cartLine.Quantity ? cartLine.Quantity.toString() : '';\n\n return productInfo;\n },\n reason => {\n throw new Error(`Failed to get product details for product ${cartLine.ProductId}.\\n${reason}`);\n }\n )\n );\n }\n }\n\n // Return promise for array of product results\n return Promise.all(productPromises);\n};\n\n/**\n * Converts a SimpleProduct object into an IProductInfo object\n * @param simpleProduct Simple Product object\n * @returns Populated IProductInfo\n */\nexport const getProductInfoFromSimpleProduct = (simpleProduct: SimpleProduct): IProductInfo => {\n const recordId = simpleProduct.RecordId || '';\n\n return {\n // If master product id is not available then product record id is master product id\n productId: simpleProduct.MasterProductId ? simpleProduct.MasterProductId.toString() : recordId.toString(),\n productSku: recordId ? recordId.toString() : '',\n productName: simpleProduct.Name || simpleProduct.Description || '',\n productPrice: simpleProduct.Price ? simpleProduct.Price.toString() : '',\n productChannelId: '', // Not needed for each product, sent as part of all events\n productChannelName: '',\n productCategoryId: '',\n productCategoryName: '',\n productQuantity: '', // Cannot be deteremined from SimpleProduct, will be added from CartLine later\n productCurrency: '' // Not needed for each product, sent as part of all events with product data\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport msdyn365Commerce, * as Msdyn365 from '@msdyn365-commerce/core';\n\n/**\n * Bot Framework input. Used to retrieve existing active bot framework session token.\n */\nexport class GetBotFrameworkInput implements Msdyn365.IActionInput {\n public getCacheKey = () => `CURRENT-BOTFRAMEWORKTOKEN`;\n public getCacheObjectType = () => 'CURRENT-BOTFRAMEWORK-KEY1';\n public dataCacheType = (): Msdyn365.CacheType => 'application';\n}\n\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\n return new GetBotFrameworkInput();\n};\n\nasync function action(input: GetBotFrameworkInput, ctx: Msdyn365.IActionContext): Promise {\n const ISecretValue = await msdyn365Commerce.secretManager?.getSecretValue(\n 'PVA-WEBCHANNELSECURITY-KEY',\n ctx.requestContext.apiSettings.baseUrl\n );\n const apiToken = ISecretValue?.value;\n return apiToken ?? '';\n}\n\nexport default Msdyn365.createObservableDataAction({\n action: >action,\n id: 'getBotFrameworkToken',\n input: createInput\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n getFriendlyName,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICreateActionContext,\n IGeneric,\n IRequestContext\n} from '@msdyn365-commerce/core';\nimport {\n buildCacheKeyWithUrlTokens,\n CurrentCategoryInput,\n getCategoryUrl,\n getCurrentCategory,\n removeDomainQspFromUrl\n} from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IPageSummaryData } from '../IPageSummaryData';\n\nimport { ICategoryPageSummaryConfig } from './category-page-summary.props.autogenerated';\nimport { IDefaultPageSummaryConfig } from '../default-page-summary';\n\n/**\n * Category Page Summary Input\n */\nexport class CategoryPageSummaryInput implements IActionInput {\n public requestContext: IRequestContext;\n\n public config: ICategoryPageSummaryConfig | IDefaultPageSummaryConfig;\n\n constructor(config: ICategoryPageSummaryConfig | IDefaultPageSummaryConfig, requestContext: IRequestContext) {\n this.config = config || {};\n this.requestContext = requestContext;\n }\n\n public getCacheObjectType = (): string => 'CategoryPageSummary';\n\n public getCacheKey = (): string => buildCacheKeyWithUrlTokens('CategoryPageSummary', this.requestContext);\n\n public dataCacheType = (): CacheType => 'request';\n}\n\nconst createGetCurrentCategoryInput = (\n inputData: IActionContext,\n config?: ICategoryPageSummaryConfig | IDefaultPageSummaryConfig\n): CurrentCategoryInput => {\n if (inputData && inputData.requestContext) {\n let includeRootCategory: boolean | undefined;\n if (config) {\n includeRootCategory = (config as ICategoryPageSummaryConfig).includeRootCategory;\n }\n return new CurrentCategoryInput(inputData.requestContext, includeRootCategory);\n }\n\n throw new Error('Please specify categoryId query string in request.');\n};\n/**\n * Get skip count.\n * @param inputData\n */\nfunction getSkipCount(inputData: ICreateActionContext, IGeneric>): string | undefined {\n return inputData && inputData.requestContext && inputData.requestContext.query && inputData.requestContext.query.skip;\n}\n\nconst action = async (input: CategoryPageSummaryInput, context: IActionContext): Promise => {\n const { config } = input;\n let currentCategoryResult;\n try {\n currentCategoryResult = await getCurrentCategory(createGetCurrentCategoryInput(context, input.config), context);\n } catch {\n // Do nothing, if the action fails fallback to values defined in data\n }\n if (currentCategoryResult) {\n const currentCategory = { ...currentCategoryResult };\n let categoryUrl: string | undefined;\n try {\n // Reset category's name neutralizedName\n const localName = getFriendlyName(context.requestContext.locale, currentCategory.NameTranslations);\n const neutralizedName = currentCategory.NeutralizedName || currentCategory.Name;\n currentCategory.Name = localName;\n currentCategory.NeutralizedName = neutralizedName;\n categoryUrl = getCategoryUrl(currentCategory);\n\n const canonicalDomain = context.requestContext.canonicalDomain;\n if (categoryUrl && canonicalDomain) {\n categoryUrl = `https://${canonicalDomain}${categoryUrl}`.toLocaleLowerCase();\n const skipCount = getSkipCount(context);\n const Url = new URL(categoryUrl);\n const urlParams: URLSearchParams = new URLSearchParams(Url.search);\n if (skipCount) {\n urlParams.set('skip', skipCount);\n }\n Url.search = urlParams.toString();\n categoryUrl = Url.toString();\n categoryUrl = removeDomainQspFromUrl(categoryUrl, context.requestContext);\n } else {\n categoryUrl = undefined;\n }\n } catch {\n categoryUrl = undefined;\n }\n return {\n title: currentCategory.Name,\n sharingImageUrl: currentCategory.OfflineImage,\n canonicalUrl: categoryUrl,\n faviconUrl: config && config.faviconUrl\n };\n\n // If the action fails fallback to values defined from data\n } else if (config) {\n return {\n title: config.title,\n sharingImageUrl: config.sharingImage && config.sharingImage.src,\n faviconUrl: config && config.faviconUrl\n };\n }\n return {};\n};\n\nexport default createObservableDataAction({\n id: '@msdyn365-commerce-modules/page-summary/category-page-summary',\n action: >action,\n input: (args: ICreateActionContext) => {\n return new CategoryPageSummaryInput(args.config, args.requestContext);\n }\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n ICreateActionContext,\n IRequestContext\n} from '@msdyn365-commerce/core';\nimport { buildCacheKeyWithUrlTokens, removeDomainQspFromUrl } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IDefaultPageSummaryConfig } from './default-page-summary.props.autogenerated';\n\nexport interface IPageSummaryData {\n title?: string;\n description?: string;\n keywords?: string;\n sharingImageUrl?: string;\n canonicalUrl?: string;\n faviconUrl?: string;\n}\n\n/**\n * Page Summary Input\n */\nexport class PageSummaryInput implements IActionInput {\n public requestContext: IRequestContext;\n\n public config: IDefaultPageSummaryConfig;\n\n constructor(config: IDefaultPageSummaryConfig, requestContext: IRequestContext) {\n this.config = config || {};\n this.requestContext = requestContext;\n }\n\n public getCacheObjectType = (): string => 'PageSummary';\n\n public getCacheKey = (): string => `${buildCacheKeyWithUrlTokens('PageSummary', this.requestContext)}-${this.config.title}`;\n\n public dataCacheType = (): CacheType => 'request';\n}\n\nconst action = async (input: PageSummaryInput, context: IActionContext): Promise => {\n const { config } = input;\n return {\n title: config && config.title,\n description: config && config.description,\n keywords: config && config.keywords,\n sharingImageUrl: config && config.sharingImage && config.sharingImage.src,\n canonicalUrl:\n context.requestContext && context.requestContext.canonicalUrl\n ? removeDomainQspFromUrl(context.requestContext.canonicalUrl, context.requestContext)\n : undefined,\n faviconUrl: config && config.faviconUrl\n };\n};\n\nexport default createObservableDataAction({\n id: '@msdyn365-commerce-modules/page-summary/default-page-summary',\n action: >action,\n input: (args: ICreateActionContext) => {\n return new PageSummaryInput(args.config, args.requestContext);\n }\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICreateActionContext,\n IGeneric,\n IRequestContext\n} from '@msdyn365-commerce/core';\nimport { Image, ISubList } from '@msdyn365-commerce-modules/data-types';\nimport { buildCacheKeyWithUrlTokens, getList, ListInput } from '@msdyn365-commerce-modules/retail-actions';\nimport { IProductItem } from '@msdyn365-commerce-modules/retail-actions/dist/types/get-list';\n\nimport { IDefaultPageSummaryConfig } from '../default-page-summary/default-page-summary.props.autogenerated';\nimport { IPageSummaryData } from '../IPageSummaryData';\n\n/**\n * List Page Summary Input\n */\nexport class ListPageSummaryInput implements IActionInput {\n public requestContext: IRequestContext;\n\n public config: IDefaultPageSummaryConfig;\n\n constructor(config: IDefaultPageSummaryConfig, requestContext: IRequestContext) {\n this.config = config || {};\n this.requestContext = requestContext;\n }\n\n public getCacheObjectType = (): string => 'ListPageSummary';\n\n public getCacheKey = (): string => buildCacheKeyWithUrlTokens('ListPageSummary', this.requestContext);\n\n public dataCacheType = (): CacheType => 'request';\n}\n\n/**\n * List item type enum.\n */\nenum ListItemType {\n list = 'list',\n product = 'product'\n}\n\n/**\n * Get the url of sub list.\n * @param listName\n * @param sitePath\n */\nfunction getSubListUrl(listName: string, sitePath: string): string {\n if (!listName) {\n return '';\n }\n\n if (!sitePath) {\n return `/${listName}.l`;\n }\n\n // SitePath has a leading '/'\n return `${sitePath}/${listName}.l`;\n}\n\n/**\n * Get sub list item.\n * @param item\n * @param sitePathOfRequest\n */\nfunction getSubListItem(item: IGeneric, sitePathOfRequest: string): ISubList {\n const imageList: Image[] = getImages(item.fields.content.images);\n\n const sublistHref = getSubListUrl(item.fields._name, sitePathOfRequest);\n return {\n Title: item.fields.content.title,\n Description: item.fields.content.description,\n ShortDescription: item.fields.content.shortDescription,\n BackgroundColor: item.fields.content.backgroundColor,\n ForegroundColor: item.fields.content.foregroundColor,\n Href: sublistHref,\n Images: imageList\n };\n}\n\n/**\n * Get site path.\n * @param inputData\n */\nfunction getSitePath(inputData: ICreateActionContext, IGeneric>): string {\n return inputData && inputData.requestContext && inputData.requestContext.sitePath ? inputData.requestContext.sitePath : '';\n}\n\n/**\n * Get items per page.\n * @param inputData\n */\nfunction getItemsPerPage(inputData: ICreateActionContext, IGeneric>): number {\n if (!inputData || !inputData.config || !inputData.config.itemsPerPage) {\n return 50;\n }\n\n const result = Number(inputData.config.itemsPerPage);\n if (isNaN(result)) {\n return 50;\n }\n\n return result;\n}\n\n/**\n * Get skip count.\n * @param inputData\n */\nfunction getSkipCount(inputData: ICreateActionContext, IGeneric>): number {\n return inputData && inputData.requestContext && inputData.requestContext.query && inputData.requestContext.query.skipCount\n ? Number(inputData.requestContext.query.skipCount)\n : 0;\n}\n\n/**\n * Get images.\n * @param images\n */\nfunction getImages(images: IGeneric[]): Image[] {\n const resultImageList: Image[] = [];\n\n if (!images) {\n return resultImageList;\n }\n\n images.forEach(item => {\n if (item && item.image && item.image.href) {\n // Add image item\n const imageItem: Image = {\n href: item.image.href,\n altText: item.image.altText,\n title: item.image.title,\n width: item.image.width,\n height: item.image.height\n };\n\n resultImageList.push(imageItem);\n }\n });\n\n return resultImageList;\n}\n\n/**\n * Get input list data.\n * @param inputData\n */\nfunction getInputListData(inputData: ICreateActionContext, IGeneric>): IGeneric {\n let listData =\n !inputData || !inputData.requestContext || !inputData.requestContext.pageData ? null : inputData.requestContext.pageData.list;\n if (\n !inputData ||\n !inputData.requestContext ||\n !inputData.requestContext.pageData ||\n !inputData.requestContext.pageData.list ||\n !inputData.requestContext.pageData.list.content ||\n !inputData.requestContext.pageData.list.content.items ||\n !inputData.requestContext.pageData.list.content.title ||\n !inputData.requestContext.pageData.list._id\n ) {\n if (\n !inputData ||\n !inputData.data ||\n !inputData.data.list ||\n !inputData.data.list.content ||\n !inputData.data.list.content.items ||\n !inputData.data.list.content.title ||\n !inputData.data.list._id\n ) {\n console.error('data is not well defined for list action input');\n throw new Error('data is not well defined for list action input');\n }\n\n listData = inputData.data.list;\n }\n return listData;\n}\n\nconst createGetListInput = (inputData: IActionContext): ListInput => {\n const listData: IGeneric = getInputListData(inputData);\n const listItems: (IProductItem[] | ISubList)[] = [];\n let productList: IProductItem[] = [];\n\n const parentImageList: Image[] = getImages(listData.content.images);\n\n const itemsPerPage = getItemsPerPage(inputData);\n const skipCount = getSkipCount(inputData);\n\n // This is the list contains all product and will be used to call getSimpleProducts data action.\n const productItems: IProductItem[] = [];\n const sum = skipCount + itemsPerPage;\n for (let index = skipCount; index < listData.content.items.length && index < sum; index++) {\n const item = listData.content.items[index];\n if (item.type === ListItemType.list) {\n if (!item.fields || !item.fields.content || !item.fields.content.title) {\n console.error(`sublist item fields, content or title missing in list ${listData._id}`);\n continue;\n }\n\n // If any elements in product list, then copy it and add to list items\n if (productList.length > 0) {\n const clonedList = [...productList];\n listItems.push(clonedList);\n productList = [];\n }\n\n // Build and add sublist item\n listItems.push(getSubListItem(item, getSitePath(inputData)));\n }\n\n if (item.type === ListItemType.product) {\n if (!item.fields || !item.fields.recordId) {\n console.error(`product item missing recordId in list ${listData._id}`);\n continue;\n }\n\n // Add product item\n const productItem: IProductItem = {\n RecordId: item.fields.recordId,\n CatalogId: item.fields.catalogId || '0'\n };\n\n productList.push(productItem);\n productItems.push(productItem);\n }\n }\n\n // Save the last portion of product items.\n if (productList.length > 0) {\n listItems.push(productList);\n }\n\n return new ListInput(\n listData._id,\n listData.content.title,\n listData.content.description,\n listData.content.shortDescription,\n listData.content.backgroundColor,\n listData.content.foregroundColor,\n parentImageList,\n listItems,\n productItems,\n listData.content.items.length,\n itemsPerPage,\n skipCount\n );\n};\n\nconst action = async (input: ListPageSummaryInput, context: IActionContext): Promise => {\n const { config } = input;\n let listData;\n try {\n listData = await getList(createGetListInput(context), context);\n } catch {\n // Do nothing, if there's an error running the action fall back to values defined from data\n }\n if (listData && listData.Title) {\n return {\n title: listData.Title,\n description: listData.Description\n };\n\n // If the action fails fallback to values defined from data\n } else if (config) {\n return {\n title: config.title,\n description: config.description\n };\n }\n return {};\n};\n\nexport default createObservableDataAction({\n id: '@msdyn365-commerce-modules/page-summary/list-page-summary',\n action: >action,\n input: (args: ICreateActionContext) => {\n return new ListPageSummaryInput(args.config, args.requestContext);\n }\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n getCatalogId,\n IAction,\n IActionContext,\n IActionInput,\n ICommerceApiSettings,\n ICreateActionContext,\n IRequestContext\n} from '@msdyn365-commerce/core';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { getAttributeValuesAsync, getByIdsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport {\n ArrayExtensions,\n generateCacheKey,\n generateImageUrl,\n getProductUrlSync,\n getSelectedProductIdFromActionInput,\n QueryResultSettingsProxy,\n removeDomainQspFromUrl\n} from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IPageSummaryData } from '../IPageSummaryData';\nimport { IProductPageSummaryConfig } from './product-page-summary.props.autogenerated';\n\n/**\n * Product Page Summary Input.\n */\nexport class ProductPageSummaryInput implements IActionInput {\n public apiSettings: ICommerceApiSettings;\n\n public config: IProductPageSummaryConfig;\n\n public productId: number;\n\n public catalogId?: number;\n\n public constructor(\n config: IProductPageSummaryConfig,\n apiSettings: ICommerceApiSettings,\n productId: number,\n requestContext?: IRequestContext\n ) {\n this.config = config || {};\n this.apiSettings = apiSettings;\n this.productId = productId;\n\n if (requestContext) {\n this.catalogId = getCatalogId(requestContext);\n }\n }\n\n public getCacheObjectType = (): string => 'ProductPageSummary';\n\n public getCacheKey = (): string =>\n generateCacheKey(\n this.apiSettings,\n { key: 'Key', value: 'ProductPageSummary' },\n { key: 'Title', value: this.config.title },\n { key: 'ProductId', value: this.productId },\n { key: 'CatalogId', value: this.catalogId }\n );\n\n public dataCacheType = (): CacheType => 'application';\n}\n\nexport interface IProductPageSummary extends IPageSummaryData {\n price?: number;\n productId?: number;\n productBrand?: string;\n}\n\nconst createInput = (args: ICreateActionContext) => {\n const productId = getSelectedProductIdFromActionInput(args);\n\n if (productId) {\n return new ProductPageSummaryInput(\n args.config,\n args.requestContext.apiSettings,\n +productId,\n args.requestContext\n );\n }\n throw new Error('Unable to create ProductPageSummaryAction input, no productId found on module config or query');\n};\n\n// Checks product attributes for the presence of brand attribute to extract the brand name for product metadata\nconst getProductBrand = async (\n context: IActionContext,\n recordId: number,\n channelId: number,\n catalogId: number\n): Promise => {\n const productAttributes = await getAttributeValuesAsync(\n {\n callerContext: context,\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context)\n },\n recordId,\n channelId,\n catalogId\n );\n for (const productAttribute of productAttributes) {\n if (productAttribute.Name === 'Brand') {\n return productAttribute.TextValue;\n }\n }\n return;\n};\n\nconst action = async (input: ProductPageSummaryInput, context: IActionContext): Promise => {\n const { config, productId, apiSettings } = input;\n let simpleProductsData: SimpleProduct[] | undefined;\n try {\n simpleProductsData = ArrayExtensions.validValues(\n await getByIdsAsync(\n {\n callerContext: context,\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context)\n },\n apiSettings.channelId,\n [productId],\n null,\n input.catalogId ?? 0\n )\n );\n } catch {\n // Do nothing, if there's an error we fall back to values defined from config\n }\n if (ArrayExtensions.hasElements(simpleProductsData)) {\n const simpleProductData = simpleProductsData[0];\n let productUrl: string | undefined;\n try {\n productUrl = getProductUrlSync(simpleProductData, context);\n const canonicalDomain = context.requestContext.canonicalDomain;\n if (productUrl && canonicalDomain) {\n productUrl = `https://${canonicalDomain}${productUrl}`.toLocaleLowerCase();\n productUrl = removeDomainQspFromUrl(productUrl, context.requestContext);\n } else {\n productUrl = undefined;\n }\n } catch {\n productUrl = undefined;\n }\n let productBrand: string | undefined;\n try {\n productBrand = await getProductBrand(context, productId, apiSettings.channelId, input.catalogId ?? 0);\n } catch {\n productBrand = undefined;\n }\n return {\n title: simpleProductData.Name,\n description: simpleProductData.Description,\n sharingImageUrl: generateImageUrl(simpleProductData.PrimaryImageUrl, apiSettings),\n canonicalUrl: productUrl,\n faviconUrl: config && config.faviconUrl,\n productId: simpleProductData.RecordId,\n price: simpleProductData.AdjustedPrice,\n productBrand\n };\n\n // If the action fails fallback to values defined from config\n } else if (config) {\n return {\n title: config.title,\n description: config.description,\n sharingImageUrl: config.sharingImage && config.sharingImage.src,\n faviconUrl: config && config.faviconUrl\n };\n }\n return {};\n};\n\nexport default createObservableDataAction({\n id: '@msdyn365-commerce-modules/page-summary/product-page-summary',\n action: >action,\n input: createInput\n});\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n { \n const actionPath = '@msdyn365-commerce-modules/chat/dist/lib/modules/msdyn365-pva-chat-connector/actions/getBotFrameworkToken.action';\n binding.dataActions[actionPath] = require('@msdyn365-commerce-modules/chat/dist/lib/modules/msdyn365-pva-chat-connector/actions/getBotFrameworkToken.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = '@msdyn365-commerce-modules/core-components/dist/lib/actions/addToCart-telemetry.action';\n binding.dataActions[actionPath] = require('@msdyn365-commerce-modules/core-components/dist/lib/actions/addToCart-telemetry.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = '@msdyn365-commerce-modules/core-components/dist/lib/actions/copyCart-checkOut-telemetry.action';\n binding.dataActions[actionPath] = require('@msdyn365-commerce-modules/core-components/dist/lib/actions/copyCart-checkOut-telemetry.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = '@msdyn365-commerce-modules/core-components/dist/lib/actions/getById-product-telemetry.action';\n binding.dataActions[actionPath] = require('@msdyn365-commerce-modules/core-components/dist/lib/actions/getById-product-telemetry.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = '@msdyn365-commerce-modules/core-components/dist/lib/actions/getByIds-product-telemetry.action';\n binding.dataActions[actionPath] = require('@msdyn365-commerce-modules/core-components/dist/lib/actions/getByIds-product-telemetry.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = '@msdyn365-commerce-modules/core-components/dist/lib/actions/getVariantsByDimensionValues-telemetry.action';\n binding.dataActions[actionPath] = require('@msdyn365-commerce-modules/core-components/dist/lib/actions/getVariantsByDimensionValues-telemetry.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = '@msdyn365-commerce-modules/core-components/dist/lib/actions/purchase-telemetry.action';\n binding.dataActions[actionPath] = require('@msdyn365-commerce-modules/core-components/dist/lib/actions/purchase-telemetry.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = '@msdyn365-commerce-modules/core-components/dist/lib/actions/readCart-telemetry.action';\n binding.dataActions[actionPath] = require('@msdyn365-commerce-modules/core-components/dist/lib/actions/readCart-telemetry.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = '@msdyn365-commerce-modules/core-components/dist/lib/actions/removeFromCart-telemetry.action';\n binding.dataActions[actionPath] = require('@msdyn365-commerce-modules/core-components/dist/lib/actions/removeFromCart-telemetry.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = '@msdyn365-commerce-modules/core-components/dist/lib/actions/updateCart-telemetry.action';\n binding.dataActions[actionPath] = require('@msdyn365-commerce-modules/core-components/dist/lib/actions/updateCart-telemetry.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = '@msdyn365-commerce-modules/page-summary/dist/lib/modules/category-page-summary/category-page-summary.action';\n binding.dataActions[actionPath] = require('@msdyn365-commerce-modules/page-summary/dist/lib/modules/category-page-summary/category-page-summary.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = '@msdyn365-commerce-modules/page-summary/dist/lib/modules/default-page-summary/default-page-summary.action';\n binding.dataActions[actionPath] = require('@msdyn365-commerce-modules/page-summary/dist/lib/modules/default-page-summary/default-page-summary.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = '@msdyn365-commerce-modules/page-summary/dist/lib/modules/list-page-summary/list-page-summary.action';\n binding.dataActions[actionPath] = require('@msdyn365-commerce-modules/page-summary/dist/lib/modules/list-page-summary/list-page-summary.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = '@msdyn365-commerce-modules/page-summary/dist/lib/modules/product-page-summary/product-page-summary.action';\n binding.dataActions[actionPath] = require('@msdyn365-commerce-modules/page-summary/dist/lib/modules/product-page-summary/product-page-summary.action');\n registerActionId(actionPath);\n }\n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.packageDataActions = {};\n window.__bindings__.packageDataActions['__local__'] = {\n ...binding.dataActions\n };","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createDataActionHook, IActionContext, IActionInput } from '@msdyn365-commerce/core';\nimport { IMSDyn365Window } from '@msdyn365-commerce/core-internal';\nimport { Cart, CartLine, IAddCartLinesParam, IDataServiceRequest } from '@msdyn365-commerce/retail-proxy';\nimport { IProductInfo, TelemetryEvent } from '@msdyn365-commerce/telemetry-internal';\nimport { getProductInfoFromCartLinesAsync } from './telemetry.action.helper';\n\ndeclare let window: IMSDyn365Window;\n\n/**\n * Saves info on cart lines added before calling data action\n * @param inputs Data action inputs\n * @param actionContext Action context\n */\nconst beforeAddToCart = async (inputs: IActionInput | IActionInput[], actionContext: IActionContext) => {\n try {\n const actionInput = Array.isArray(inputs) ? inputs[0] : inputs;\n\n // If cart lines were added\n if (actionInput.queryParams && typeof actionInput.queryParams === 'function') {\n const addCartLinesParams = actionInput.queryParams();\n if (addCartLinesParams && addCartLinesParams.cartLines) {\n // Save info on added cart lines for post data action hook to pick up\n actionContext.requestContext.telemetryData.addedCartLines = addCartLinesParams.cartLines;\n return;\n }\n }\n actionContext.telemetry.debug('AddToCart pre-data action hook failed - No added cart lines found');\n } catch (e) {\n actionContext.telemetry.debug('AddToCart pre-data action hook failed.', e);\n }\n};\n\n/**\n * Fires an AddToCart event after AddCartLines data action completed\n * @param _inputs Data action inputs\n * @param cart New cart object after cart lines have been added\n * @param actionContext Action context\n */\nconst afterAddToCart = async (_inputs: IActionInput | IActionInput[], cart: Cart | Cart[], actionContext: IActionContext) => {\n if (window && window._msdyn365 && window._msdyn365.telemetry) {\n const cartObject = Array.isArray(cart) ? cart[0] : cart;\n const addedCartLines = actionContext.requestContext.telemetryData.addedCartLines;\n let addedProducts: IProductInfo[] = [];\n\n // Collect info on products added to cart\n if (addedCartLines) {\n try {\n addedProducts = await getProductInfoFromCartLinesAsync(addedCartLines, actionContext);\n } catch (error) {\n actionContext.telemetry.error('AddCartLines post-data action hook failed to process cart lines.', error);\n }\n }\n\n // Fire AddToCart event\n window._msdyn365.telemetry.logEvent(TelemetryEvent.AddToCart, {\n cartId: cartObject.Id,\n cartVersion: cartObject.Version ? cartObject.Version.toString() : '',\n products: addedProducts,\n orderId: cartObject.OrderNumber ? cartObject.OrderNumber.toString() : ''\n });\n }\n};\n\ncreateDataActionHook({\n actionId: '@msdyn365-commerce/retail-proxy/Carts/AddCartLines',\n postReaderHook: afterAddToCart,\n preReaderHook: beforeAddToCart\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createDataActionHook, IActionContext, IActionInput, IMSDyn365Window } from '@msdyn365-commerce/core';\nimport { Cart } from '@msdyn365-commerce/retail-proxy';\nimport { IProductInfo, TelemetryEvent } from '@msdyn365-commerce/telemetry-internal';\nimport { getProductInfoFromCartLinesAsync } from './telemetry.action.helper';\n\ndeclare let window: IMSDyn365Window;\n\n/**\n * CopyCart data action pre-hook\n * @param inputs Data action inputs\n */\nconst beforeCopyCart = async (inputs: IActionInput | IActionInput[]) => {\n // placeholder\n};\n\n/**\n * Fires an CheckOut event after CopyCart data action completed\n * @param _inputs Data action inputs\n * @param cart New checkout cart\n * @param actionContext Action context\n */\nconst afterCopyCart = async (_inputs: IActionInput | IActionInput[], cart: Cart | Cart[], actionContext: IActionContext) => {\n if (window && window._msdyn365 && window._msdyn365.telemetry) {\n const cartObject = Array.isArray(cart) ? cart[0] : cart;\n let cartLineProductUnits: IProductInfo[] = [];\n\n // Collect info on products in the cart\n if (cartObject && cartObject.CartLines && Array.isArray(cartObject.CartLines) && cartObject.CartLines.length > 0) {\n try {\n cartLineProductUnits = await getProductInfoFromCartLinesAsync(cartObject.CartLines, actionContext);\n } catch (error) {\n actionContext.telemetry.error('CopyCart post-data action hook failed to process cart lines.', error);\n }\n }\n\n // Fire Checkout event\n window._msdyn365.telemetry.logEvent(TelemetryEvent.CheckOut, {\n cartId: cartObject.Id,\n cartVersion: cartObject.Version ? cartObject.Version.toString() : '',\n products: cartLineProductUnits,\n orderId: cartObject.OrderNumber ? cartObject.OrderNumber.toString() : ''\n });\n }\n};\n\ncreateDataActionHook({\n actionId: '@msdyn365-commerce/retail-proxy/Carts/Copy',\n postReaderHook: afterCopyCart,\n preReaderHook: beforeCopyCart\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createDataActionHook, IActionContext, IActionInput } from '@msdyn365-commerce/core';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { TelemetryEvent } from '@msdyn365-commerce/telemetry-internal';\nimport { getProductInfoFromSimpleProduct } from './telemetry.action.helper';\n\nconst beforeGetById = async (inputs: IActionInput | IActionInput[]) => {\n // placeholder\n};\n\nconst afterGetById = async (\n _inputs: IActionInput | IActionInput[],\n simpleProduct: SimpleProduct | SimpleProduct[],\n actionContext: IActionContext\n) => {\n simpleProduct = await Promise.resolve(Array.isArray(simpleProduct) ? simpleProduct[0] : simpleProduct);\n\n // If simple product result is defined run the post hook\n if (simpleProduct) {\n const productInfo = getProductInfoFromSimpleProduct(simpleProduct);\n actionContext.requestContext.telemetryData[productInfo.productSku] = productInfo;\n actionContext.requestContext.telemetryData[TelemetryEvent.ProductPageView] = productInfo ? [productInfo] : [];\n }\n};\n\ncreateDataActionHook({\n actionId: '@msdyn365-commerce/retail-proxy/Products/GetById',\n postReaderHook: afterGetById,\n preReaderHook: beforeGetById\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createDataActionHook, IActionContext, IActionInput } from '@msdyn365-commerce/core';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { getProductInfoFromSimpleProduct } from './telemetry.action.helper';\n\nconst beforeGetByIds = async (inputs: IActionInput | IActionInput[]) => {\n // placeholder\n};\n\nconst afterGetByIds = async (\n _inputs: IActionInput | IActionInput[],\n simpleProducts: SimpleProduct | SimpleProduct[],\n actionContext: IActionContext\n) => {\n if (!Array.isArray(simpleProducts)) {\n simpleProducts = [simpleProducts];\n }\n\n simpleProducts.forEach(async product => {\n if (product) {\n product = await Promise.resolve(product);\n const productInfo = getProductInfoFromSimpleProduct(product);\n actionContext.requestContext.telemetryData[productInfo.productSku] = productInfo;\n }\n });\n};\n\ncreateDataActionHook({\n actionId: '@msdyn365-commerce/retail-proxy/Products/GetByIds',\n postReaderHook: afterGetByIds,\n preReaderHook: beforeGetByIds\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createDataActionHook, IActionContext, IActionInput } from '@msdyn365-commerce/core';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { getProductInfoFromSimpleProduct } from './telemetry.action.helper';\n\nconst beforeGetVariantsByDimensionValues = async (inputs: IActionInput | IActionInput[]) => {\n // placeholder\n};\n\nconst afterGetVariantsByDimensionValues = async (\n _inputs: IActionInput | IActionInput[],\n simpleProducts: SimpleProduct | SimpleProduct[],\n actionContext: IActionContext\n) => {\n if (!Array.isArray(simpleProducts)) {\n simpleProducts = [simpleProducts];\n }\n\n simpleProducts.forEach(async product => {\n if (product) {\n product = await Promise.resolve(product);\n const productInfo = getProductInfoFromSimpleProduct(product);\n actionContext.requestContext.telemetryData[productInfo.productSku] = productInfo;\n }\n });\n};\n\ncreateDataActionHook({\n actionId: '@msdyn365-commerce/retail-proxy/Products/GetVariantsByDimensionValues',\n postReaderHook: afterGetVariantsByDimensionValues,\n preReaderHook: beforeGetVariantsByDimensionValues\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createDataActionHook, IActionContext, IActionInput, IMSDyn365Window } from '@msdyn365-commerce/core';\nimport { SalesOrder } from '@msdyn365-commerce/retail-proxy';\nimport { IProductInfo, IProductTransaction, TelemetryEvent } from '@msdyn365-commerce/telemetry-internal';\nimport { getProductInfoFromCartLinesAsync } from './telemetry.action.helper';\n\ndeclare let window: IMSDyn365Window;\n\n/**\n * Checkout data action pre-hook\n * @param inputs Data action inputs\n */\nconst beforePurchase = async (inputs: IActionInput | IActionInput[]) => {\n // placeholder\n};\n\n/**\n * Fires a Purchase event after Checkout data action completed\n * @param _inputs Data action inputs\n * @param salesOrder Sales order for transaction\n * @param actionContext Action context\n */\nconst afterPurchase = async (\n _inputs: IActionInput | IActionInput[],\n salesOrder: SalesOrder | SalesOrder[],\n actionContext: IActionContext\n) => {\n if (window && window._msdyn365 && window._msdyn365.telemetry) {\n const salesObject = Array.isArray(salesOrder) ? salesOrder[0] : salesOrder;\n let saleLineProductUnits: IProductInfo[] = [];\n\n // Collect info on products in the sales order\n if (salesObject && salesObject.SalesLines && Array.isArray(salesObject.SalesLines) && salesObject.SalesLines.length > 0) {\n try {\n saleLineProductUnits = await getProductInfoFromCartLinesAsync(salesObject.SalesLines, actionContext);\n } catch (error) {\n actionContext.telemetry.error('Checkout post-data action hook failed to process cart lines.', error);\n }\n }\n\n // Store the purchased product information so that we can avoid \"code triggered\" remove from cart telemetry event.\n actionContext.requestContext.telemetryData[TelemetryEvent.Purchase] = {\n id: salesObject.Id,\n affiliation: salesObject.ChannelId ? salesObject.ChannelId.toString() : '',\n revenue: salesObject.NetAmountWithoutTax,\n tax: salesObject.TaxAmount,\n // shippingCost?: // Confirm if it is delivery mode charge amount;\n products: saleLineProductUnits\n };\n\n // Fire Purchase event\n window._msdyn365.telemetry.logEvent(\n TelemetryEvent.Purchase,\n actionContext.requestContext.telemetryData[TelemetryEvent.Purchase]\n );\n }\n};\n\ncreateDataActionHook({\n actionId: '@msdyn365-commerce/retail-proxy/Carts/Checkout',\n postReaderHook: afterPurchase,\n preReaderHook: beforePurchase\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createDataActionHook, IActionContext, IActionInput } from '@msdyn365-commerce/core';\nimport { Cart } from '@msdyn365-commerce/retail-proxy';\n\nconst beforeRead = async (inputs: IActionInput | IActionInput[]) => {\n // placeholder\n};\n\nconst afterRead = async (_inputs: IActionInput | IActionInput[], cart: Cart | Cart[], actionContext: IActionContext) => {\n try {\n const activeCart = await Promise.resolve(Array.isArray(cart) ? cart[0] : cart);\n actionContext.requestContext.telemetryData.activeCart = activeCart;\n } catch (e) {\n actionContext.telemetry.debug('ReadCart post-data action hook failed.', e);\n }\n};\n\ncreateDataActionHook({\n actionId: '@msdyn365-commerce/retail-proxy/Carts/Read',\n postReaderHook: afterRead,\n preReaderHook: beforeRead\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createDataActionHook, IActionContext, IActionInput, IMSDyn365Window, TelemetryEvent } from '@msdyn365-commerce/core';\nimport { Cart, CartLine, IDataServiceRequest, IRemoveCartLinesParam } from '@msdyn365-commerce/retail-proxy';\nimport { IProductInfo, IProductTransaction } from '@msdyn365-commerce/telemetry-internal';\nimport { getProductInfoFromCartLinesAsync } from './telemetry.action.helper';\n\ndeclare let window: IMSDyn365Window;\n\n/**\n * Saves info on cart lines removed before calling data action\n * @param inputs Data action inputs\n * @param actionContext Action context\n */\nconst beforeRemoveFromCart = async (inputs: IActionInput | IActionInput[], actionContext: IActionContext) => {\n try {\n const actionInput = Array.isArray(inputs) ? inputs[0] : inputs;\n\n // If cart lines were removed\n if (actionInput.queryParams && typeof actionInput.queryParams === 'function') {\n const removeCartLinesParams = actionInput.queryParams();\n if (removeCartLinesParams && removeCartLinesParams.cartLineIds) {\n // Save info on removed cart lines for post data action hook to pick up\n actionContext.requestContext.telemetryData.removedCartLineIds = removeCartLinesParams.cartLineIds;\n return;\n }\n }\n actionContext.telemetry.debug('RemoveFromCart pre-data action hook failed - No removed cart lines found');\n } catch (e) {\n actionContext.telemetry.debug('RemoveFromCart pre-data action hook failed.', e);\n }\n};\n\n/**\n * Fires a RemoveFromCart event after RemoveCartLines data action completed\n * @param _inputs Data action inputs\n * @param cart New cart object after cart lines have been removed\n * @param actionContext Action context\n */\nconst afterRemoveFromCart = async (_inputs: IActionInput | IActionInput[], cart: Cart | Cart[], actionContext: IActionContext) => {\n if (window && window._msdyn365 && window._msdyn365.telemetry) {\n const cartObject = Array.isArray(cart) ? cart[0] : cart;\n const removeCartLineIds = actionContext.requestContext.telemetryData.removedCartLineIds;\n const activeCart = actionContext.requestContext.telemetryData.activeCart;\n const productTransaction = actionContext.requestContext.telemetryData[TelemetryEvent.Purchase];\n const removedCartLines: CartLine[] = [];\n let removedProducts: IProductInfo[] = [];\n\n // Collect info on products removed from cart\n if (removeCartLineIds && activeCart && activeCart.CartLines) {\n activeCart.CartLines.forEach((cartLine: CartLine) => {\n if (\n cartLine.ProductId &&\n removeCartLineIds.indexOf(cartLine.LineId ? cartLine.LineId : '') !== -1 &&\n !(\n productTransaction &&\n productTransaction.products &&\n productTransaction.products.some(product => +product.productSku === cartLine.ProductId)\n )\n ) {\n removedCartLines.push(cartLine);\n }\n });\n\n if (removedCartLines.length > 0) {\n try {\n removedProducts = await getProductInfoFromCartLinesAsync(removedCartLines, actionContext);\n } catch (error) {\n actionContext.telemetry.error('RemoveCartLines post-data action hook failed to process cart lines.', error);\n }\n }\n }\n\n // Fire RemoveFromCart event if cart lines were removed\n if (removedCartLines && removedCartLines.length > 0) {\n window._msdyn365.telemetry.logEvent(TelemetryEvent.RemoveFromCart, {\n cartId: cartObject.Id,\n cartVersion: cartObject.Version ? cartObject.Version.toString() : '',\n products: removedProducts,\n orderId: cartObject.OrderNumber ? cartObject.OrderNumber.toString() : ''\n });\n } else {\n actionContext.telemetry.debug('No RemoveFromCart event fired, no removed cart lines found');\n }\n }\n};\n\ncreateDataActionHook({\n actionId: '@msdyn365-commerce/retail-proxy/Carts/RemoveCartLines',\n postReaderHook: afterRemoveFromCart,\n preReaderHook: beforeRemoveFromCart\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createDataActionHook, IActionContext, IActionInput, TelemetryEvent } from '@msdyn365-commerce/core';\nimport { IMSDyn365Window } from '@msdyn365-commerce/core-internal';\nimport { Cart, CartLine, IDataServiceRequest, IUpdateCartLinesParam } from '@msdyn365-commerce/retail-proxy';\nimport { IProductInfo } from '@msdyn365-commerce/telemetry-internal';\nimport { getProductInfoFromCartLinesAsync } from './telemetry.action.helper';\n\ndeclare let window: IMSDyn365Window;\n\n/**\n * Saves info on cart lines updated before calling data action\n * @param inputs Data action inputs\n * @param actionContext Action context\n */\nconst beforeUpdateCart = async (inputs: IActionInput | IActionInput[], actionContext: IActionContext) => {\n try {\n const actionInput = Array.isArray(inputs) ? inputs[0] : inputs;\n\n // If cart lines were updated\n if (actionInput.queryParams && typeof actionInput.queryParams === 'function') {\n const updateCartLinesParams = actionInput.queryParams();\n if (updateCartLinesParams && updateCartLinesParams.cartLines) {\n // Save info on updated cart lines for post data action hook to pick up\n actionContext.requestContext.telemetryData.updatedCartLines = updateCartLinesParams.cartLines;\n return;\n }\n }\n actionContext.telemetry.debug('UpdateCart pre-data action hook failed - No updated cart lines found');\n } catch (e) {\n actionContext.telemetry.debug('UpdateCart pre-data action hook failed.', e);\n }\n};\n\n/**\n * Fires an UpdateInCart event after UpdateCartLines data action completed\n * @param _inputs Data action inputs\n * @param cart New cart object after cart lines have been added\n * @param actionContext Action context\n */\nconst afterUpdateCart = async (_inputs: IActionInput | IActionInput[], cart: Cart | Cart[], actionContext: IActionContext) => {\n if (window && window._msdyn365 && window._msdyn365.telemetry) {\n const cartObject = Array.isArray(cart) ? cart[0] : cart;\n const updatedCartLines = actionContext.requestContext.telemetryData.updatedCartLines;\n let updatedProducts: IProductInfo[] = [];\n\n // Collect info on products updated in cart\n if (updatedCartLines) {\n try {\n updatedProducts = await getProductInfoFromCartLinesAsync(updatedCartLines, actionContext);\n } catch (error) {\n actionContext.telemetry.error('UpdateCartLines post-data action hook failed to process cart lines.', error);\n }\n }\n\n // Fire UpdateInCart event\n window._msdyn365.telemetry.logEvent(TelemetryEvent.UpdateInCart, {\n cartId: cartObject.Id,\n cartVersion: cartObject.Version ? cartObject.Version.toString() : '',\n products: updatedProducts,\n orderId: cartObject.OrderNumber ? cartObject.OrderNumber.toString() : ''\n });\n }\n};\n\ncreateDataActionHook({\n actionId: '@msdyn365-commerce/retail-proxy/Carts/UpdateCartLines',\n postReaderHook: afterUpdateCart,\n preReaderHook: beforeUpdateCart\n});\n"],"names":["module","exports","React","ReactDOM","getProductInfoFromCartLinesAsync","async","cartLines","actionContext","undefined","requestContext","channel","Error","productPromises","i","length","cartLine","ProductId","push","getByIdAsync","callerContext","RecordId","then","result","productInfo","getProductInfoFromSimpleProduct","productPrice","Price","toString","productQuantity","Quantity","reason","Promise","all","simpleProduct","recordId","productId","MasterProductId","productSku","productName","Name","Description","productChannelId","productChannelName","productCategoryId","productCategoryName","productCurrency","GetBotFrameworkInput","constructor","getCacheKey","getCacheObjectType","dataCacheType","Msdyn365","action","input","ctx","_msdyn365Commerce$sec","ISecretValue","msdyn365Commerce","secretManager","getSecretValue","apiSettings","baseUrl","apiToken","value","id","args","CategoryPageSummaryInput","config","buildCacheKeyWithUrlTokens","this","createObservableDataAction","context","currentCategoryResult","getCurrentCategory","createGetCurrentCategoryInput","inputData","includeRootCategory","CurrentCategoryInput","_unused","currentCategory","_objectSpread","categoryUrl","localName","getFriendlyName","locale","NameTranslations","neutralizedName","NeutralizedName","getCategoryUrl","canonicalDomain","toLocaleLowerCase","skipCount","query","skip","Url","URL","urlParams","URLSearchParams","search","set","removeDomainQspFromUrl","_unused2","title","sharingImageUrl","OfflineImage","canonicalUrl","faviconUrl","sharingImage","src","PageSummaryInput","description","keywords","ListItemType","ListPageSummaryInput","getSubListItem","item","sitePathOfRequest","imageList","getImages","fields","content","images","sublistHref","listName","_name","sitePath","Title","ShortDescription","shortDescription","BackgroundColor","backgroundColor","ForegroundColor","foregroundColor","Href","Images","getSitePath","resultImageList","forEach","image","href","imageItem","altText","width","height","createGetListInput","listData","pageData","list","items","_id","data","console","error","getInputListData","listItems","productList","parentImageList","itemsPerPage","Number","isNaN","getItemsPerPage","getSkipCount","productItems","sum","index","type","clonedList","product","productItem","CatalogId","catalogId","ListInput","getList","ProductPageSummaryInput","generateCacheKey","key","getCatalogId","simpleProductsData","_input$catalogId","ArrayExtensions","validValues","getByIdsAsync","queryResultSettings","QueryResultSettingsProxy","getPagingFromInputDataOrDefaultValue","channelId","hasElements","simpleProductData","productUrl","productBrand","getProductUrlSync","_input$catalogId2","productAttributes","getAttributeValuesAsync","productAttribute","TextValue","getProductBrand","_unused3","generateImageUrl","PrimaryImageUrl","price","AdjustedPrice","getSelectedProductIdFromActionInput","binding","modules","dataActions","registerActionId","actionPath","default","prototype","Object","keys","exportName","Action","require","window","__bindings__","packageDataActions","createDataActionHook","actionId","postReaderHook","_inputs","cart","_msdyn365","telemetry","cartObject","Array","isArray","addedCartLines","telemetryData","addedProducts","logEvent","TelemetryEvent","AddToCart","cartId","Id","cartVersion","Version","products","orderId","OrderNumber","preReaderHook","inputs","actionInput","queryParams","addCartLinesParams","debug","e","cartLineProductUnits","CartLines","CheckOut","resolve","ProductPageView","simpleProducts","salesOrder","salesObject","saleLineProductUnits","SalesLines","Purchase","affiliation","ChannelId","revenue","NetAmountWithoutTax","tax","TaxAmount","activeCart","removeCartLineIds","removedCartLineIds","productTransaction","removedCartLines","removedProducts","indexOf","LineId","some","RemoveFromCart","removeCartLinesParams","cartLineIds","updatedCartLines","updatedProducts","UpdateInCart","updateCartLinesParams"],"sourceRoot":""}