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AOC,QAAUC,2BCAjBF,EAAOC,QAAUE","sources":["webpack://Msdyn365.Commerce.Online/./src/actions/add-order-template-to-cart.override.action.ts?ca14","webpack://Msdyn365.Commerce.Online/./src/actions/get-full-products-by-collection.override.action.ts?2b4a","webpack://Msdyn365.Commerce.Online/./src/actions/getactiveprices.action.ts?5586","webpack://Msdyn365.Commerce.Online/./src/actions/getproductunitsofmeasure.action.ts?b2cf","webpack://Msdyn365.Commerce.Online/./src/actions/payment-state-share.action.ts?5a06","webpack://Msdyn365.Commerce.Online/./lib/__local__/module-registration.js?8a42","webpack://Msdyn365.Commerce.Online/./src/modules/search-result-container/actions/base-collection-action.ts?ec13","webpack://Msdyn365.Commerce.Online/./src/modules/search-result-container/actions/get-inventory-refiners.ts?eaa4","webpack://Msdyn365.Commerce.Online/./src/modules/search-result-container/actions/get-product-refiner-hierarchy.ts?3937","webpack://Msdyn365.Commerce.Online/./src/modules/search-result-container/actions/url-utils.ts?1541","webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online/external var \"ReactDOM\"?853b"],"sourcesContent":["/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport MsDyn365, {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n ICreateActionContext\r\n} from '@msdyn365-commerce/core';\r\nimport { getCartState } from '@msdyn365-commerce/global-state';\r\nimport { CartLine, QueryResultSettings } from '@msdyn365-commerce/retail-proxy';\r\nimport { addCartLinesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\r\n\r\n// import { getPaginatedOrderTemplateLinesAction, GetPaginatedOrderTemplateLinesInput } from './get-paginated-order-template-lines';\r\nimport { getPaginatedOrderTemplateLinesAction, GetPaginatedOrderTemplateLinesInput } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\n/**\r\n * Input class for the AddOrderTemplateToCart data action.\r\n */\r\nexport class AddOrderTemplateToCartInput implements IActionInput {\r\n public readonly orderTemplateId: string;\r\n public readonly isMultipleCatalogFeatureEnabledInHq?: boolean;\r\n constructor(orderTemplateId: string, isMultipleCatalogFeatureEnabledInHq?: boolean) {\r\n this.orderTemplateId = orderTemplateId;\r\n this.isMultipleCatalogFeatureEnabledInHq = isMultipleCatalogFeatureEnabledInHq;\r\n }\r\n\r\n public getCacheKey = () => 'AddOrderTemplateToCartInput';\r\n\r\n public getCacheObjectType = () => 'AddOrderTemplateToCartInput';\r\n\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\n/**\r\n * CreateInput method for the AddOrderTemplateToCart method.\r\n * @param {ICreateActionContext} inputData The input data passed to the createInput method.\r\n * @param {string} orderTemplateId The id of template.\r\n */\r\nexport const addOrderTemplateToCartInput = (inputData: ICreateActionContext, orderTemplateId: string): AddOrderTemplateToCartInput => {\r\n const { requestContext } = inputData;\r\n if (!requestContext.user.isAuthenticated) {\r\n throw new Error('Unable to create order template. User is not authenticated.');\r\n }\r\n return new AddOrderTemplateToCartInput(orderTemplateId);\r\n};\r\n\r\n/**\r\n * The action method for the AddOrderTemplateToCart data action.\r\n * @param {AddOrderTemplateToCartInput} input The action input.\r\n * @param {IActionContext} ctx The action context.\r\n * @param context\r\n */\r\nexport async function addOrderTemplateToCartAction(input: AddOrderTemplateToCartInput, context: IActionContext): Promise {\r\n const cartState = await getCartState(context);\r\n const chunkCount = 1000;\r\n const queryResultSettings: QueryResultSettings = {\r\n Paging: {\r\n Top: chunkCount,\r\n Skip: 0\r\n }\r\n };\r\n const getPaginatedOrderTemplateLinesInput = new GetPaginatedOrderTemplateLinesInput(input.orderTemplateId, queryResultSettings);\r\n let orderTemplateLines = await getPaginatedOrderTemplateLinesAction(getPaginatedOrderTemplateLinesInput, context);\r\n let addedCartLines: CartLine[] = [];\r\n if (MsDyn365.isBrowser && typeof localStorage !== 'undefined') {\r\n const preferredStore = JSON.parse(localStorage.getItem('logged_in_user_with_store') || '');\r\n for (let skip = chunkCount; orderTemplateLines.lines.length > 0; skip += chunkCount) {\r\n const cartLines: CartLine[] = orderTemplateLines.lines.map(productLine => {\r\n const cartLine: CartLine = {\r\n ItemId: productLine.fullProduct?.ProductDetails.ItemId,\r\n ProductId: productLine.productListLine.ProductId,\r\n Quantity: productLine.productListLine.Quantity,\r\n TrackingId: '',\r\n UnitOfMeasureSymbol:\r\n productLine.fullProduct?.ProductDetails.DefaultUnitOfMeasure === 'lb'\r\n ? 'lb'\r\n : productLine.productListLine.UnitOfMeasure,\r\n ...(input.isMultipleCatalogFeatureEnabledInHq && { catalogId: productLine.productListLine.CatalogId }),\r\n FulfillmentStoreId: preferredStore?.store?.StoreId,\r\n DeliveryMode: 'BOPIS',\r\n WarehouseId: preferredStore?.store?.StoreId\r\n };\r\n return cartLine;\r\n });\r\n\r\n await addCartLinesAsync({ callerContext: context }, cartState.cart.Id, cartLines, cartState.cart.Version).catch(error => {\r\n context.telemetry.trace(error.data?.ValidationResults);\r\n context.telemetry.trace('Unable to add order template to cart.');\r\n throw error.data?.ValidationResults;\r\n });\r\n addedCartLines = addedCartLines.concat(cartLines);\r\n getPaginatedOrderTemplateLinesInput.queryResultSettings.Paging!.Skip = skip;\r\n orderTemplateLines = await getPaginatedOrderTemplateLinesAction(getPaginatedOrderTemplateLinesInput, context);\r\n }\r\n await cartState.refreshCart({});\r\n return addedCartLines;\r\n }\r\n return [];\r\n}\r\n\r\n/**\r\n * The AddOrderTemplateToCart Data Action.\r\n * Returns created order template.\r\n */\r\nexport const addOrderTemplateToCartActionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/order-templates/add-order-template-to-cart',\r\n action: >addOrderTemplateToCartAction,\r\n input: addOrderTemplateToCartInput\r\n});\r\nexport default addOrderTemplateToCartActionDataAction;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n GetCustomerInput,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n ICreateActionContext\r\n} from '@msdyn365-commerce/core';\r\nimport {\r\n AsyncResult,\r\n ChannelInventoryConfiguration,\r\n ProductSearchCriteria,\r\n ProductSearchResult,\r\n ProductWarehouseInventoryInformation,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n getByIdsAsync,\r\n getEstimatedAvailabilityAsync,\r\n getProductPromotionsAsync,\r\n searchByCriteriaAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { getInventoryConfigurationAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\r\nimport {\r\n ArrayExtensions,\r\n createInventoryAvailabilitySearchCriteria,\r\n generateProductImageUrl,\r\n getCustomer,\r\n InventoryLevels\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\n\r\nimport {\r\n BaseCollectionInput,\r\n createBaseCollectionInput\r\n} from '@msdyn365-commerce-modules/search-result-container/dist/lib/modules/search-result-container/actions/base-collection-action';\r\nimport { getInventorySortableRefinerValue } from '@msdyn365-commerce-modules/search-result-container/dist/lib/modules/search-result-container/actions/get-inventory-refiners';\r\n\r\n/**\r\n * GetFullProductsByCollection Action Input.\r\n */\r\nexport class GetFullProductsByCollectionInput extends BaseCollectionInput implements IActionInput {\r\n /**\r\n * The cache object type.\r\n * @returns The cache object type.\r\n */\r\n public getCacheObjectType = (): string => 'FullProductSearchResultOverride';\r\n\r\n public getCacheKey = () => 'FullProductSearchResultOverride';\r\n\r\n /**\r\n * The data cache type.\r\n * @returns The data cache type.\r\n */\r\n public dataCacheType = (): CacheType => {\r\n if (\r\n this.pageType !== 'Category' ||\r\n (this.refiners && this.refiners.length > 0) ||\r\n (this.queryResultSettings &&\r\n this.queryResultSettings.Sorting &&\r\n this.queryResultSettings.Sorting.Columns &&\r\n this.queryResultSettings.Sorting.Columns.length > 0)\r\n ) {\r\n return 'none';\r\n }\r\n return 'none';\r\n };\r\n}\r\n\r\n/**\r\n * This setting defines inventory filtering options.\r\n */\r\nexport enum ProductListInventoryFilteringOptions {\r\n /**\r\n * Filter out all products out of stock.\r\n */\r\n HideOOS = 'hideOOS',\r\n\r\n /**\r\n * Sort products by availability, OOS goes last.\r\n */\r\n SortOOS = 'sortOOS',\r\n\r\n /**\r\n * No filtering selected.\r\n */\r\n Default = 'default'\r\n}\r\n\r\n/**\r\n * The full product search result with count interface.\r\n */\r\nexport interface IFullProductsSearchResultsWithCount {\r\n products: ProductSearchResult[];\r\n count: number;\r\n channelInventoryConfigurationId?: number;\r\n inventoryAwareSortableAttributeId?: number;\r\n}\r\n\r\n/**\r\n * CreateInput function which creates and actionInput used to fetch products for a list page.\r\n * @param args - The API arguments.\r\n * @returns IActionInput - The action input.\r\n */\r\nconst createInput = (args: ICreateActionContext<{ itemsPerPage: number; includedAttributes: boolean | undefined }>): IActionInput => {\r\n const input = createBaseCollectionInput(args, GetFullProductsByCollectionInput);\r\n\r\n // Set Top\r\n if (input.queryResultSettings.Paging && args.config) {\r\n input.queryResultSettings.Paging.Top = args.config.itemsPerPage || 1;\r\n }\r\n\r\n // Set Skip\r\n if (input.queryResultSettings.Paging && args.requestContext.query && args.requestContext.query.skip) {\r\n input.queryResultSettings.Paging.Skip = +args.requestContext.query.skip;\r\n }\r\n\r\n input.queryResultSettings.count = true;\r\n\r\n return input;\r\n};\r\n\r\n/**\r\n * Returns list of products based on inventory information.\r\n * @param productSearchResults - The products.\r\n * @param context - The context.\r\n * @param metadataCount - The metadata count.\r\n * @param channelInventoryConfiguration - The channel inventory configuration.\r\n * @returns List of product based on the inventory information.\r\n */\r\nexport async function returnProducts(\r\n productSearchResults: ProductSearchResult[],\r\n productExtensionProperties: SimpleProduct[],\r\n context: IActionContext,\r\n metadataCount: number | undefined,\r\n channelInventoryConfiguration?: ChannelInventoryConfiguration,\r\n productInventoryResultResponse?: ProductWarehouseInventoryInformation\r\n): Promise {\r\n const defaultProductCount: number = 0;\r\n\r\n const productSearchResultsWithImages = productSearchResults.map(productSearchResult => {\r\n const newImageUrl = generateProductImageUrl(productSearchResult, context.requestContext.apiSettings);\r\n\r\n if (newImageUrl) {\r\n productSearchResult.PrimaryImageUrl = newImageUrl;\r\n }\r\n\r\n const product = productExtensionProperties.find((item: SimpleProduct) => productSearchResult.RecordId === item.RecordId);\r\n\r\n productSearchResult.ExtensionProperties = product?.ExtensionProperties ?? [];\r\n const stockText = productInventoryResultResponse?.ProductWarehouseInventoryAvailabilities?.find(\r\n product => product.ProductId === productSearchResult.RecordId\r\n );\r\n const extensionStockText = {\r\n Key: 'stockCheckText',\r\n Value: { StringValue: stockText ? stockText.PhysicalAvailableInventoryLevelLabel : '' }\r\n };\r\n productSearchResult.ExtensionProperties?.push(extensionStockText);\r\n const extensionStockCode = {\r\n Key: 'stockCheckCode',\r\n Value: { StringValue: stockText ? stockText.PhysicalAvailableInventoryLevelCode : '' }\r\n };\r\n productSearchResult.ExtensionProperties?.push(extensionStockCode);\r\n return productSearchResult;\r\n });\r\n\r\n // If inventory level is threshold or inventory check is disabled then return the list of products without the inventory configuration\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- read config file.\r\n if (\r\n context.requestContext.app.config.inventoryLevel === InventoryLevels.threshold ||\r\n context.requestContext.app.config.enableStockCheck === false\r\n ) {\r\n return {\r\n products: productSearchResultsWithImages,\r\n count: metadataCount ?? defaultProductCount\r\n };\r\n }\r\n\r\n const mappedProducts = productSearchResultsWithImages.map(productSearchResult => {\r\n if (ArrayExtensions.hasElements(productSearchResult.AttributeValues)) {\r\n for (const element of productSearchResult.AttributeValues) {\r\n if (\r\n channelInventoryConfiguration &&\r\n element.RecordId !== undefined &&\r\n element.RecordId === channelInventoryConfiguration.InventoryProductAttributeRecordId &&\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- read config file.\r\n context.requestContext.app.config.inventoryRanges !== 'all' &&\r\n element.TextValue !== channelInventoryConfiguration.InventoryOutOfStockAttributeValueText\r\n ) {\r\n // If same RecordId then it means that is the Inventory attribute\r\n // Based on the inventory range (and filtering options), the inventory label will be displayed\r\n // If Inventory range is 'All' then in stock and out of stock labels are shown, else only OOS\r\n // if the text value is different that the channelInventoryConfiguration.InventoryOutOfStockAttributeValueText then is in stock\r\n element.TextValue = '';\r\n }\r\n }\r\n }\r\n\r\n return productSearchResult;\r\n });\r\n\r\n return {\r\n products: mappedProducts,\r\n count: metadataCount ?? defaultProductCount,\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- check config.\r\n channelInventoryConfigurationId: channelInventoryConfiguration\r\n ? channelInventoryConfiguration.InventoryProductAttributeRecordId\r\n : undefined,\r\n inventoryAwareSortableAttributeId: channelInventoryConfiguration\r\n ? channelInventoryConfiguration.ProductAvailabilitySortableAttributeRecordId\r\n : undefined\r\n };\r\n}\r\n\r\nexport async function getProductAvailbility(\r\n input: GetFullProductsByCollectionInput,\r\n context: IActionContext,\r\n productIdData: number[]\r\n): Promise {\r\n const searchCriteria = createInventoryAvailabilitySearchCriteria(context, ArrayExtensions.unique(productIdData), true);\r\n try {\r\n const promise: ProductWarehouseInventoryInformation = await getEstimatedAvailabilityAsync(\r\n { callerContext: context, bypassCache: 'get' },\r\n searchCriteria\r\n );\r\n return promise;\r\n } catch (error) {\r\n console.error('Error', error);\r\n }\r\n return {};\r\n}\r\n\r\n/**\r\n * Action function to fetch products for a list page.\r\n * @param input - The input.\r\n * @param context - The context.\r\n * @returns IFullProductsSearchResultsWithCount - The full product search result with count.\r\n */\r\n// eslint-disable-next-line complexity -- ignore the complexity.\r\nasync function action(input: GetFullProductsByCollectionInput, context: IActionContext): Promise {\r\n let promise: AsyncResult;\r\n let channelInventoryConfigurationPromise: AsyncResult;\r\n let searchProductId;\r\n const searchCriteriaInput: ProductSearchCriteria = {};\r\n let productInventoryResult: ProductWarehouseInventoryInformation = {};\r\n searchCriteriaInput.Context = { ChannelId: context.requestContext.apiSettings.channelId, CatalogId: input.catalogId };\r\n // Decouple searchCriteriaInput.Refinement from input.refiners to avoid input.refiners being modified below\r\n searchCriteriaInput.Refinement = [...input.refiners];\r\n if (process.env.NODE_ENV === 'development' && process.env.ENABLE_CLOUD_SEARCH?.toLowerCase() !== 'true') {\r\n searchCriteriaInput.IncludeAttributes = false;\r\n } else {\r\n searchCriteriaInput.IncludeAttributes = input.includeAttributes;\r\n }\r\n searchCriteriaInput.SkipVariantExpansion = true;\r\n const defaultNumber: number = 0;\r\n\r\n if (input.channelInventoryConfiguration) {\r\n channelInventoryConfigurationPromise = AsyncResult.resolve(input.channelInventoryConfiguration);\r\n } else {\r\n channelInventoryConfigurationPromise = getInventoryConfigurationAsync({ callerContext: context });\r\n }\r\n const channelInventoryConfiguration = await channelInventoryConfigurationPromise;\r\n\r\n // Replace InventoryProductAttribute with boolean refiner.\r\n // Because the value of InventoryProductAttribute is different from language to language since it's string type.\r\n // The cached old inventory refiner value may be hit when customer switch language which will lead to \"no products found\" issue.\r\n const inventoryRefiner = searchCriteriaInput.Refinement.find(\r\n refiner => refiner.RefinerRecordId === channelInventoryConfiguration?.InventoryProductAttributeRecordId\r\n );\r\n if (inventoryRefiner) {\r\n searchCriteriaInput.Refinement = searchCriteriaInput.Refinement.filter(\r\n refiner => refiner.RefinerRecordId !== channelInventoryConfiguration?.InventoryProductAttributeRecordId\r\n );\r\n\r\n const isInStockRefiner =\r\n inventoryRefiner.LeftValueBoundString !== channelInventoryConfiguration?.InventoryOutOfStockAttributeValueText &&\r\n inventoryRefiner.RightValueBoundString !== channelInventoryConfiguration?.InventoryOutOfStockAttributeValueText;\r\n const inventoryRefinerValue = getInventorySortableRefinerValue(channelInventoryConfiguration, isInStockRefiner);\r\n\r\n const isInventoryRefinerValueExist = searchCriteriaInput.Refinement.some(\r\n refiner => refiner.RefinerRecordId === inventoryRefinerValue?.RefinerRecordId\r\n );\r\n if (!isInventoryRefinerValueExist && inventoryRefinerValue) {\r\n searchCriteriaInput.Refinement.push(inventoryRefinerValue);\r\n }\r\n }\r\n\r\n if (context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS) {\r\n const isInStock = true;\r\n const inventoryInStockRefinerValue = getInventorySortableRefinerValue(channelInventoryConfiguration, isInStock);\r\n\r\n const isInventoryInStockRefinerValueExist = searchCriteriaInput.Refinement.some(\r\n refiner => refiner.RefinerRecordId === inventoryInStockRefinerValue?.RefinerRecordId\r\n );\r\n if (!isInventoryInStockRefinerValueExist && inventoryInStockRefinerValue) {\r\n searchCriteriaInput.Refinement.push(inventoryInStockRefinerValue);\r\n }\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- app configs are of generic type\r\n if (\r\n context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.SortOOS &&\r\n channelInventoryConfiguration.ProductAvailabilitySortableAttributeRecordId\r\n ) {\r\n input.queryResultSettings.Sorting = input.queryResultSettings.Sorting ?? {};\r\n input.queryResultSettings.Sorting.Columns = input.queryResultSettings.Sorting.Columns ?? [];\r\n const sortColumnName = `Attr_${channelInventoryConfiguration.ProductAvailabilitySortableAttributeRecordId}`;\r\n // @ts-ignore\r\n const isSortAttributeExist = input.queryResultSettings.Sorting.Columns.some(column => column.ColumnName === sortColumnName);\r\n if (!isSortAttributeExist) {\r\n input.queryResultSettings.Sorting.Columns.push({\r\n ColumnName: sortColumnName,\r\n IsDescending: true\r\n });\r\n }\r\n }\r\n\r\n if (input.pageType === 'Category' || context.requestContext.query?.categoryId) {\r\n if (input.category) {\r\n searchCriteriaInput.CategoryIds = [input.category || defaultNumber];\r\n promise = searchByCriteriaAsync(\r\n {\r\n callerContext: context,\r\n queryResultSettings: input.queryResultSettings\r\n },\r\n searchCriteriaInput\r\n );\r\n } else {\r\n throw new Error('[GetFullProductsForCollection]Category Page Detected, but no global categoryId found');\r\n }\r\n } else if (input.searchText && context.requestContext.query?.q) {\r\n searchCriteriaInput.SearchCondition = input.searchText;\r\n promise = searchByCriteriaAsync(\r\n {\r\n callerContext: context,\r\n queryResultSettings: input.queryResultSettings\r\n },\r\n searchCriteriaInput\r\n );\r\n } else if (input.searchText && context.requestContext.query && context.requestContext.query.recommendation) {\r\n const searchObject = JSON.parse(input.searchText);\r\n if (context.requestContext.query.productId) {\r\n searchProductId = Number(searchObject.ProductId);\r\n }\r\n if (Number.isNaN(searchProductId)) {\r\n throw new Error('Failed to cast search product id into a number.');\r\n } else if (\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Existing code\r\n !searchObject.Recommendation\r\n ) {\r\n throw new Error('Failed to retrieve the Recommendation.');\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- Existing code\r\n searchCriteriaInput.RecommendationListId = searchObject.Recommendation;\r\n if (searchProductId) {\r\n searchCriteriaInput.Ids = [searchProductId || defaultNumber];\r\n }\r\n promise = searchByCriteriaAsync(\r\n {\r\n callerContext: context,\r\n queryResultSettings: input.queryResultSettings\r\n },\r\n searchCriteriaInput\r\n );\r\n }\r\n } else if (input.searchText && context.requestContext.query?.discountIds) {\r\n const accountInformation = await getCustomer(new GetCustomerInput(context.requestContext.apiSettings), context);\r\n const discountIds = context.requestContext.query?.discountIds.split(',');\r\n\r\n const productPromotions = await getProductPromotionsAsync(\r\n {\r\n callerContext: context,\r\n queryResultSettings: input.queryResultSettings\r\n },\r\n discountIds ?? [],\r\n {\r\n HeaderContext: {\r\n ChannelId: context.requestContext.apiSettings.channelId,\r\n CustomerAccountNumber: accountInformation?.AccountNumber\r\n },\r\n LineContexts: [\r\n {\r\n CatalogId: input.catalogId\r\n }\r\n ]\r\n },\r\n new Date()\r\n );\r\n\r\n const productIds = productPromotions.map(p => p.ProductId ?? 0);\r\n searchCriteriaInput.Ids = productIds;\r\n searchCriteriaInput.CustomerAccountNumber = accountInformation.AccountNumber;\r\n\r\n promise = searchByCriteriaAsync(\r\n {\r\n callerContext: context,\r\n queryResultSettings: input.queryResultSettings\r\n },\r\n searchCriteriaInput\r\n );\r\n } else {\r\n throw new Error('[GetFullProductsForCollection]Search Page Detected, but no q= or productId= query parameter found');\r\n }\r\n\r\n const productSearchResults = await promise;\r\n const productIds = productSearchResults.map(item => item.RecordId);\r\n\r\n const productExtensionProperties = await getByIdsAsync(\r\n { callerContext: context },\r\n context.requestContext.apiSettings.channelId,\r\n ArrayExtensions.unique(productIds)\r\n );\r\n productInventoryResult = await getProductAvailbility(input, context, productIds);\r\n\r\n return returnProducts(\r\n productSearchResults,\r\n productExtensionProperties,\r\n context,\r\n promise.metadata.count,\r\n channelInventoryConfiguration,\r\n productInventoryResult\r\n );\r\n}\r\n\r\nexport const actionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/search-result-container/get-full-products-by-collection',\r\n action: action as IAction,\r\n input: createInput\r\n});\r\n\r\nexport default actionDataAction;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { AffiliationLoyaltyTier, PriceLookupContext, ProductPrice, ProjectionDomain } from '@msdyn365-commerce/retail-proxy';\r\nimport { getActivePricesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n\r\n/**\r\n * Getaddresses Input Action\r\n */\r\n\r\nexport interface IITSGetActivePricesInput extends Msdyn365.IActionInput {\r\n projectDomain: ProjectionDomain | null;\r\n productIds?: number[];\r\n activeDate?: Date;\r\n customerId?: string | null;\r\n affiliationLoyaltyTiers?: AffiliationLoyaltyTier[] | null;\r\n includeSimpleDiscountsInContextualPrice?: boolean | null;\r\n includeVariantPriceRange?: boolean | null;\r\n includeAttainablePricesAndDiscounts?: boolean | null;\r\n priceLookupContext?: PriceLookupContext | null;\r\n}\r\nexport class GetActivePricesInput implements Msdyn365.IActionInput {\r\n public projectDomain: ProjectionDomain | null;\r\n public productIds?: number[];\r\n public activeDate?: Date;\r\n public customerId?: string | null;\r\n public affiliationLoyaltyTiers?: AffiliationLoyaltyTier[] | null;\r\n public includeSimpleDiscountsInContextualPrice?: boolean | null;\r\n public includeVariantPriceRange?: boolean | null;\r\n public includeAttainablePricesAndDiscounts?: boolean | null;\r\n public priceLookupContext?: PriceLookupContext | null;\r\n // TODO: Construct the input needed to run the action\r\n constructor(\r\n projectDomain: ProjectionDomain | null,\r\n productIds?: number[],\r\n activeDate?: Date,\r\n customerId?: string | null,\r\n affiliationLoyaltyTiers?: AffiliationLoyaltyTier[] | null,\r\n includeSimpleDiscountsInContextualPrice?: boolean | null,\r\n includeVariantPriceRange?: boolean | null,\r\n includeAttainablePricesAndDiscounts?: boolean | null,\r\n priceLookupContext?: PriceLookupContext | null\r\n ) {\r\n this.projectDomain = projectDomain;\r\n this.productIds = productIds;\r\n this.activeDate = activeDate;\r\n this.customerId = customerId;\r\n this.affiliationLoyaltyTiers = affiliationLoyaltyTiers;\r\n this.includeSimpleDiscountsInContextualPrice = includeSimpleDiscountsInContextualPrice;\r\n this.includeVariantPriceRange = includeVariantPriceRange;\r\n this.includeAttainablePricesAndDiscounts = includeAttainablePricesAndDiscounts;\r\n this.priceLookupContext = priceLookupContext;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `getActivePrices`;\r\n public getCacheObjectType = () => 'getActivePrices';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nexport async function getActivePricesAction(\r\n request: IITSGetActivePricesInput,\r\n ctx: Msdyn365.IActionContext\r\n): Promise {\r\n if (request) {\r\n try {\r\n const result = await getActivePricesAsync(\r\n { callerContext: ctx },\r\n request.projectDomain,\r\n request.productIds,\r\n request.activeDate,\r\n request.customerId,\r\n request.affiliationLoyaltyTiers,\r\n request.includeSimpleDiscountsInContextualPrice,\r\n request.includeVariantPriceRange,\r\n request.includeAttainablePricesAndDiscounts,\r\n request.priceLookupContext\r\n ); //calling getActivePricesAsync API\r\n if (result) {\r\n return result;\r\n }\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n }\r\n return null;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getActivePricesAction,\r\n // TODO: Give your data action a unique id\r\n id: `getActivePrices`\r\n // input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { ProductUnitOfMeasure, UnitOfMeasureSearchCriteria } from '@msdyn365-commerce/retail-proxy';\r\nimport { getProductUnitsOfMeasureAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n\r\n/**\r\n * Getaddresses Input Action\r\n */\r\n\r\nexport interface IITSProductUnitOfMeasureInput extends Msdyn365.IActionInput {\r\n productId: number | undefined;\r\n unitOfMeasureSearchCriteria?: UnitOfMeasureSearchCriteria | null;\r\n}\r\nexport class GetProductUnitOfMeasureInput implements Msdyn365.IActionInput {\r\n public productId: number | undefined;\r\n public unitOfMeasureSearchCriteria: UnitOfMeasureSearchCriteria | null;\r\n // TODO: Construct the input needed to run the action\r\n constructor(productId: number | undefined, unitOfMeasureSearchCriteria: UnitOfMeasureSearchCriteria | null) {\r\n this.productId = productId;\r\n this.unitOfMeasureSearchCriteria = unitOfMeasureSearchCriteria;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `getProductUnitOfMeasure`;\r\n public getCacheObjectType = () => 'getProductUnitOfMeasure';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nexport async function getProductUnitsOfMeasureAction(\r\n request: IITSProductUnitOfMeasureInput,\r\n ctx: Msdyn365.IActionContext\r\n): Promise {\r\n if (request.productId) {\r\n try {\r\n const result = await getProductUnitsOfMeasureAsync(\r\n { callerContext: ctx },\r\n request.productId,\r\n request.unitOfMeasureSearchCriteria\r\n ); //calling getProductUnitOfMeasureAsync API\r\n if (result) {\r\n return result;\r\n }\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n }\r\n return null;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getProductUnitsOfMeasureAction,\r\n // TODO: Give your data action a unique id\r\n id: `getProductUnitOfMeasure`\r\n // input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * PaymentStateShare Input Action\r\n */\r\nexport class PaymentStateShareInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `payment-state-share`;\r\n public getCacheObjectType = () => 'payment-state-share';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IPaymentStateShareData {\r\n isCODSelected: boolean;\r\n isCreditCardSelected: boolean;\r\n shouldApplyOnAccountPayment: boolean;\r\n isStoreSelected: boolean;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new PaymentStateShareInput();\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: PaymentStateShareInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { isCODSelected: true, isCreditCardSelected: false, shouldApplyOnAccountPayment: true, isStoreSelected: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'PaymentStateShare',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n { \n const actionPath = 'actions/add-order-template-to-cart.override.action';\n binding.dataActions[actionPath] = require('partner/actions/add-order-template-to-cart.override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-full-products-by-collection.override.action';\n binding.dataActions[actionPath] = require('partner/actions/get-full-products-by-collection.override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/getactiveprices.action';\n binding.dataActions[actionPath] = require('partner/actions/getactiveprices.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/getproductunitsofmeasure.action';\n binding.dataActions[actionPath] = require('partner/actions/getproductunitsofmeasure.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/payment-state-share.action';\n binding.dataActions[actionPath] = require('partner/actions/payment-state-share.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 { CacheType, getCatalogId, IActionInput, IAny, ICommerceApiSettings, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\nimport {\n convertToString,\n ChannelInventoryConfiguration,\n IQueryResultSettings,\n ProductRefinerValue,\n SortColumn\n} from '@msdyn365-commerce/retail-proxy';\nimport { generateCacheKey, QueryResultSettingsProxy } from '@msdyn365-commerce-modules/retail-actions';\nimport { toJS } from 'mobx';\n\nimport { hydrateRefinersFromUrl } from './url-utils';\n\n/**\n * Export listPageType.\n */\nexport type listPageType = 'Category' | 'Search' | 'Unknown';\n\n/**\n * Get include attributes from config.\n * @param inputData - ICreateActionContext.\n * @returns Boolean.\n */\nfunction getIncludeAttributes(inputData: ICreateActionContext, IGeneric>): boolean {\n if (process.env.NODE_ENV === 'development' && process.env.ENABLE_CLOUD_SEARCH?.toLowerCase() !== 'true') {\n return false;\n }\n\n if (inputData && inputData.config && inputData.config.includeAttributes !== undefined && inputData.config.includeAttributes === true) {\n return true;\n }\n return false;\n}\n\n/**\n * Get updateRefinerPanel from config.\n * @param inputData - ICreateActionContext.\n * @returns Boolean.\n */\nfunction getUpdateRefinerPanel(inputData: ICreateActionContext, IGeneric>): boolean {\n return !!inputData.config?.updateRefinerPanel;\n}\n\n/**\n * BaseCollection Action Input.\n */\nexport class BaseCollectionInput implements IActionInput {\n public pageType: listPageType;\n\n public category: number | undefined;\n\n public searchText: string | undefined;\n\n public refiners: ProductRefinerValue[];\n\n public queryResultSettings: IQueryResultSettings;\n\n public apiSettings: ICommerceApiSettings;\n\n public includeAttributes: boolean | undefined;\n\n public locale?: string;\n\n public isUpdateRefinerPanel?: boolean;\n\n public catalogId?: number;\n\n public channelInventoryConfiguration?: ChannelInventoryConfiguration;\n\n public inventoryRefiner?: IProductRefinerHierarchy;\n\n public constructor(\n pageType: listPageType,\n apiSettings: ICommerceApiSettings,\n queryResultSettings: IQueryResultSettings,\n refiners: ProductRefinerValue[],\n category: number | undefined,\n searchText: string | undefined,\n includeAttributes: boolean | undefined,\n isUpdateRefinerPanel?: boolean | undefined,\n locale?: string,\n catalogId?: number,\n channelInventoryConfiguration?: ChannelInventoryConfiguration,\n inventoryRefiner?: IProductRefinerHierarchy\n ) {\n this.pageType = pageType;\n this.apiSettings = apiSettings;\n this.category = category;\n this.searchText = searchText;\n this.queryResultSettings = queryResultSettings;\n this.refiners = refiners;\n this.includeAttributes = includeAttributes;\n this.isUpdateRefinerPanel = isUpdateRefinerPanel;\n this.locale = locale;\n this.catalogId = catalogId ?? 0;\n this.channelInventoryConfiguration = channelInventoryConfiguration;\n this.inventoryRefiner = inventoryRefiner;\n }\n\n public getCacheKey = () => {\n const queryResultSettings = {\n ...this.queryResultSettings.Paging,\n ...toJS(this.queryResultSettings.Sorting)\n };\n\n const cacheKey = generateCacheKey(\n this.apiSettings,\n { key: 'PageType', value: this.pageType },\n { key: 'Category', value: this.category },\n { key: 'SearchText', value: this.searchText },\n { key: 'CatalogId', value: this.catalogId },\n {\n key: 'Refiners',\n value: this.refiners.map(\n refiner =>\n `RefinerRecordId:${refiner.RefinerRecordId}-LeftValueBoundString:${refiner.LeftValueBoundString ||\n ''}-RightValueBoundString:${refiner.RightValueBoundString || ''}`\n )\n },\n { key: 'QueryResultSettings', value: convertToString(queryResultSettings) },\n { key: 'Locale', value: this.locale }\n );\n return cacheKey;\n };\n\n public getCacheObjectType = () => 'CollectionActionResult';\n\n public dataCacheType = (): CacheType => 'request';\n}\n\n// TODO: Create a data model here or import one to capture the response of the action\nexport interface IGetFullProductsByCollectionData {\n text: string;\n}\n\nexport type CollectionClassConstructor = new (\n pageType: listPageType,\n apiSettings: ICommerceApiSettings,\n queryResultSettings: IQueryResultSettings,\n refiners: ProductRefinerValue[],\n category: number | undefined,\n searchText: string | undefined,\n includeAttributes: boolean | undefined,\n isUpdateRefinerPanel?: boolean | undefined,\n locale?: string,\n catalogId?: number,\n channelInventoryConfiguration?: ChannelInventoryConfiguration,\n inventoryRefiner?: IProductRefinerHierarchy\n) => BaseCollectionInput;\n\n/**\n * TODO: Use this function to create the input required to make the action call.\n * @param args\n * @param inputClassConstuctor\n */\nexport const createBaseCollectionInput = (\n args: ICreateActionContext,\n inputClassConstuctor: CollectionClassConstructor\n): BaseCollectionInput => {\n const pageType =\n args.requestContext.urlTokens.pageType === 'Category' || (args.requestContext.query && args.requestContext.query.categoryId)\n ? 'Category'\n : 'Search';\n\n const queryResultSettings = QueryResultSettingsProxy.fromInputData(args).QueryResultSettings;\n const queryRefiners = hydrateRefinersFromUrl(args.requestContext);\n const includeAttributes = getIncludeAttributes(args);\n const isUpdateRefinerPanel = getUpdateRefinerPanel(args);\n const catalogId = getCatalogId(args.requestContext);\n\n if (args.requestContext.query && args.requestContext.query.sorting) {\n queryResultSettings.Sorting = { Columns: JSON.parse(decodeURIComponent(args.requestContext.query.sorting)) };\n }\n\n if (pageType === 'Category') {\n return new inputClassConstuctor(\n pageType,\n args.requestContext.apiSettings,\n queryResultSettings,\n queryRefiners,\n +(args.requestContext.urlTokens.itemId || (args.requestContext.query && args.requestContext.query.categoryId) || 0),\n undefined,\n includeAttributes,\n isUpdateRefinerPanel,\n args.requestContext.locale,\n catalogId\n );\n } else if (pageType === 'Search' && args.requestContext.query && args.requestContext.query.q) {\n return new inputClassConstuctor(\n pageType,\n args.requestContext.apiSettings,\n queryResultSettings,\n queryRefiners,\n undefined,\n args.requestContext.query.q,\n includeAttributes,\n isUpdateRefinerPanel,\n args.requestContext.locale,\n catalogId\n );\n } else if (pageType === 'Search' && args.requestContext.query && args.requestContext.query.recommendation) {\n let searchText = '';\n if (args.requestContext.query.productId) {\n searchText = JSON.stringify({\n ProductId: args.requestContext.query.productId,\n Recommendation: args.requestContext.query.recommendation\n });\n } else {\n searchText = JSON.stringify({ Recommendation: args.requestContext.query.recommendation });\n }\n return new inputClassConstuctor(\n pageType,\n args.requestContext.apiSettings,\n queryResultSettings,\n queryRefiners,\n undefined,\n searchText,\n includeAttributes,\n isUpdateRefinerPanel,\n args.requestContext.locale,\n catalogId\n );\n } else if (pageType === 'Search' && args.requestContext.query && args.requestContext.query.discountIds) {\n const searchText = JSON.stringify({ DiscountIds: args.requestContext.query.discountIds });\n return new inputClassConstuctor(\n pageType,\n args.requestContext.apiSettings,\n queryResultSettings,\n queryRefiners,\n undefined,\n searchText,\n includeAttributes,\n isUpdateRefinerPanel,\n args.requestContext.locale,\n catalogId\n );\n }\n\n throw new Error('[getFullProductsForCollection]Unable to create input');\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\nimport { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput } from '@msdyn365-commerce/core';\nimport { buildCacheKey } from '@msdyn365-commerce-modules/retail-actions';\n\nimport {\n AttributeDataType,\n ChannelInventoryConfiguration,\n ProductRefinerSource,\n ProductRefinerValue\n} from '@msdyn365-commerce/retail-proxy';\nimport { BaseCollectionInput } from './base-collection-action';\nimport { getProductRefinerHierarchy } from './get-product-refiner-hierarchy';\n\n/**\n * Returns inventory in stock sortable refiner value.\n * @param channelInventoryConfiguration - The channelInventoryConfiguration.\n * @param isInStock - The flag indicating whether is getting in-stock refiner or out-of-stock refiner.\n * @returns Refiners.\n */\nexport const getInventorySortableRefinerValue = (\n channelInventoryConfiguration: ChannelInventoryConfiguration,\n isInStock: boolean\n): ProductRefinerValue | undefined => {\n if (channelInventoryConfiguration && channelInventoryConfiguration.ProductAvailabilitySortableAttributeRecordId) {\n return {\n RefinerRecordId: channelInventoryConfiguration.ProductAvailabilitySortableAttributeRecordId,\n DataTypeValue: AttributeDataType.TrueFalse,\n LeftValueBoundString: isInStock ? 'true' : 'false',\n RightValueBoundString: isInStock ? 'true' : 'false',\n UnitText: '',\n RowNumber: 0,\n Count: 0,\n ExtensionProperties: [],\n RefinerSourceValue: ProductRefinerSource.Attribute\n };\n }\n return undefined;\n};\n\n/**\n * InventoryInStockRefinerValue Input action.\n * @remark The get-inventory-refiners data action is obsoleted. Please use getInventorySortableRefinerValue instead.\n */\nexport class InventoryInStockRefinerValueInput extends BaseCollectionInput implements IActionInput {\n public inventoryProductAttributeRecordId: number;\n\n public constructor(input: BaseCollectionInput, inventoryProductAttributeRecordId: number = 0) {\n super(\n input.pageType,\n input.apiSettings,\n {\n count: true\n },\n\n // Parameter - refiners\n [],\n\n // Parameter - category\n undefined,\n\n // Parameter - searchText\n '',\n\n // Parameter - includeAttributes\n false,\n\n // Parameter - isUpdateRefinerPanel\n false,\n\n // Parameter - locale\n undefined,\n input.catalogId,\n input.channelInventoryConfiguration,\n input.inventoryRefiner\n );\n\n this.inventoryProductAttributeRecordId =\n inventoryProductAttributeRecordId || input.channelInventoryConfiguration?.InventoryProductAttributeRecordId || 0;\n }\n\n /**\n * GetCacheKey.\n * @returns - Returns string.\n */\n public getCacheKey = (): string => buildCacheKey('RefinerList', this.apiSettings);\n\n /**\n * GetCacheObjectType.\n * @returns - Returns string.\n */\n public getCacheObjectType = (): string => 'RefinerList';\n\n /**\n * DataCacheType.\n * @returns - CacheType string.\n */\n public dataCacheType = (): CacheType => 'application';\n}\n\n/**\n * Action method returns inventory in stock refiners.\n * @param input - InventoryInStockRefinerValueInput.\n * @param context - IActionContext.\n * @returns - Promise.\n * @remark The get-inventory-refiners data action is obsoleted. Please use getInventorySortableRefinerValue instead.\n */\nasync function action(input: InventoryInStockRefinerValueInput, context: IActionContext): Promise {\n const refiners = await getProductRefinerHierarchy(\n {\n Context: {\n ChannelId: input.apiSettings.channelId,\n CatalogId: input.catalogId\n }\n },\n input.queryResultSettings,\n context\n );\n\n // InventoryProductAttributeRecordId may be 0, and recId of default refiner Category/Price/Rating is always 0 by design. In this case, we should not return refiner\n // Why recId of default refiner Category/Price/Rating is 0: see GetChannelProductRefiners.sql\n return (\n (input.channelInventoryConfiguration?.InventoryProductAttributeRecordId !== 0 &&\n refiners.find(refiner => refiner.RecordId === input.channelInventoryConfiguration?.InventoryProductAttributeRecordId)) ||\n // keep legacy logic to avoid break existing customers usage from this file\n (input.inventoryProductAttributeRecordId !== 0 &&\n refiners.find(refiner => refiner.RecordId === input.inventoryProductAttributeRecordId)) ||\n null\n );\n}\n\n/**\n * Action.\n * @param id - Id.\n * @param action - Action.\n * @returns - Results.\n * @remark The get-inventory-refiners data action is obsoleted. Please use getInventorySortableRefinerValue instead.\n */\nexport const actionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/search-result-container/get-inventory-refiners',\n action: action as IAction\n});\n\nexport default actionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { IQueryResultSettings, ProductRefiner, ProductSearchCriteria } from '@msdyn365-commerce/retail-proxy';\nimport { getProductSearchRefinersAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\n\n/**\n * Uses Bulk refiner API to get refiners and child refiner values.\n * @param searchCriteria Product search criteria.\n * @param maxItems Max items.\n * @param queryResultSettings\n * @param ctx Action context.\n */\nexport async function getProductRefinerHierarchy(\n searchCriteria: ProductSearchCriteria,\n queryResultSettings: IQueryResultSettings,\n ctx: IActionContext\n): Promise {\n return getProductSearchRefinersAsync({ callerContext: ctx, queryResultSettings }, searchCriteria).then(\n (productRefiners: ProductRefiner[]) => {\n if (!productRefiners) {\n ctx.trace('[getRefinersByCriteriaAction] returned no refiners');\n return [];\n }\n\n const result = (productRefiners || []).map((productRefiner: ProductRefiner) => productRefiner);\n\n if (result.length === 0) {\n ctx.trace('[getRefinersByCriteriaAction] returned no IProductRefinerHierarchy objects');\n return [];\n }\n\n return result;\n }\n );\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport MsDyn365, { IRequestContext } from '@msdyn365-commerce/core';\nimport { ProductRefinerValue, SortColumn } from '@msdyn365-commerce/retail-proxy';\n\n/**\n * Refiner Compression:\n * Refiners contains a non-trivial amount of data that is required to successfully make\n * a refiner-based API call. To allow for deep-linking of refiners in the URL, refiner data\n * must be compressed so that URL max length is not exceeded. Refiners will be compressed into\n * the following array style index-based format:\n * [DataTypeValue, LeftValueBoundString, RefinerRecordId, RefinerSourceValue, RightValueBoundString, UnitText].\n */\nconst compressedRefinerKeys = [\n 'DataTypeValue',\n 'LeftValueBoundString',\n 'RefinerRecordId',\n 'RefinerSourceValue',\n 'RightValueBoundString',\n 'UnitText',\n // Added RowNumber to identify if custom range integer or API values option is selected\n 'RowNumber'\n];\n\n/**\n * Hydrates compressed refiner data from URL.\n * @param fullUrl The full URL of the page.\n * @param requestContext\n */\nexport const hydrateRefinersFromUrl = (requestContext: IRequestContext): ProductRefinerValue[] => {\n const compressedRefinerArray = parseQueryParam<(string | number)[][]>('refiners', requestContext);\n if (!compressedRefinerArray || compressedRefinerArray.length === 0) {\n return [];\n }\n\n return compressedRefinerArray\n .map(compressedRefiner => {\n try {\n const parsedRefiner: ProductRefinerValue = {};\n compressedRefinerKeys.forEach((refinerKey, index) => {\n parsedRefiner[refinerKey] = compressedRefiner[index];\n });\n return parsedRefiner;\n } catch {\n return undefined;\n }\n })\n .filter(Boolean);\n};\n\n/**\n * Compressed a list of refiners for use in URLs.\n * @param refiners The uncompressed refiners.\n */\nexport const compressRefiners = (refiners: ProductRefinerValue[]) => {\n const compressedRefiners: (string | number)[][] = [];\n\n refiners.forEach(refiner => {\n const compressedRefiner: (string | number)[] = [];\n compressedRefinerKeys.forEach(refinerKey => {\n compressedRefiner.push(refiner[refinerKey]);\n });\n compressedRefiners.push(compressedRefiner);\n });\n\n return compressedRefiners;\n};\n\n/**\n * Method which creates a URL contiaining serialized active refiners.\n * @param fullUrl The Current URL of the page.\n * @param refiners The refiners which should be added to the URL.\n * @param sortingColumns\n * @param skipCount\n */\nexport const buildListPageUrl = (fullUrl: URL, refiners?: ProductRefinerValue[], sortingColumns?: SortColumn[], skipCount?: number) => {\n // Refiner Change flow\n if (refiners !== undefined) {\n if (refiners.length === 0) {\n fullUrl.searchParams.delete('refiners');\n } else {\n const sortedRefiners = refiners.sort((first, second) =>\n first.RefinerRecordId && second.RefinerRecordId && first.RefinerRecordId > second.RefinerRecordId ? 1 : -1\n );\n fullUrl.searchParams.set('refiners', JSON.stringify(compressRefiners(sortedRefiners)));\n }\n\n // Adding or removing a refiner means we want to always load page 1\n fullUrl.searchParams.delete('skip');\n return fullUrl.href;\n }\n\n if (sortingColumns !== undefined) {\n if (sortingColumns.length === 0) {\n fullUrl.searchParams.delete('sorting');\n } else {\n fullUrl.searchParams.set('sorting', JSON.stringify(sortingColumns));\n }\n\n // Changing the sort means always load page 1\n fullUrl.searchParams.delete('skip');\n return fullUrl.href;\n }\n\n if (skipCount) {\n fullUrl.searchParams.set('skip', skipCount.toString());\n }\n\n return fullUrl.href;\n};\n\n/**\n * Parses a query param from the query object of the request context.\n * @param key The query parameter key.\n * @param requestContext The request context.\n */\nexport const parseQueryParam = (key: string, requestContext: IRequestContext): T | null => {\n if (requestContext.query && requestContext.query[key]) {\n return JSON.parse(decodeURIComponent(requestContext.query[key]));\n }\n return null;\n};\n\n/**\n * Gets the current URL of the page from the request context.\n * @param requestContext The request context.\n */\nexport const getCurrentUrl = (requestContext: IRequestContext): URL => {\n if (MsDyn365.isBrowser) {\n return new URL(window.location.href);\n }\n\n // NOTE: Typing on requestURL is incorrect\n if (requestContext.url.requestUrl.href) {\n return new URL(requestContext.url.requestUrl.href);\n }\n return new URL((requestContext.url.requestUrl));\n};\n","module.exports = React;","module.exports = ReactDOM;"],"names":["AddOrderTemplateToCartInput","constructor","orderTemplateId","isMultipleCatalogFeatureEnabledInHq","getCacheKey","getCacheObjectType","dataCacheType","this","addOrderTemplateToCartInput","inputData","requestContext","user","isAuthenticated","Error","async","addOrderTemplateToCartAction","input","context","cartState","getCartState","chunkCount","queryResultSettings","Paging","Top","Skip","getPaginatedOrderTemplateLinesInput","GetPaginatedOrderTemplateLinesInput","orderTemplateLines","getPaginatedOrderTemplateLinesAction","addedCartLines","MsDyn365","isBrowser","localStorage","preferredStore","JSON","parse","getItem","skip","lines","length","cartLines","map","productLine","_productLine$fullProd","_productLine$fullProd2","_preferredStore$store","_preferredStore$store2","_objectSpread","ItemId","fullProduct","ProductDetails","ProductId","productListLine","Quantity","TrackingId","UnitOfMeasureSymbol","DefaultUnitOfMeasure","UnitOfMeasure","catalogId","CatalogId","FulfillmentStoreId","store","StoreId","DeliveryMode","WarehouseId","addCartLinesAsync","callerContext","cart","Id","Version","catch","error","_error$data","_error$data2","telemetry","trace","data","ValidationResults","concat","refreshCart","addOrderTemplateToCartActionDataAction","createObservableDataAction","id","action","ProductListInventoryFilteringOptions","GetFullProductsByCollectionInput","BaseCollectionInput","pageType","refiners","Sorting","Columns","returnProducts","productSearchResults","productExtensionProperties","metadataCount","channelInventoryConfiguration","productInventoryResultResponse","productSearchResultsWithImages","productSearchResult","_product$ExtensionPro","_productInventoryResu","_productSearchResult$","_productSearchResult$2","newImageUrl","generateProductImageUrl","apiSettings","PrimaryImageUrl","product","find","item","RecordId","ExtensionProperties","stockText","ProductWarehouseInventoryAvailabilities","extensionStockText","Key","Value","StringValue","PhysicalAvailableInventoryLevelLabel","push","extensionStockCode","PhysicalAvailableInventoryLevelCode","app","config","inventoryLevel","InventoryLevels","threshold","enableStockCheck","products","count","ArrayExtensions","hasElements","AttributeValues","element","undefined","InventoryProductAttributeRecordId","inventoryRanges","TextValue","InventoryOutOfStockAttributeValueText","channelInventoryConfigurationId","inventoryAwareSortableAttributeId","ProductAvailabilitySortableAttributeRecordId","getProductAvailbility","productIdData","searchCriteria","createInventoryAvailabilitySearchCriteria","unique","getEstimatedAvailabilityAsync","bypassCache","console","actionDataAction","_context$requestConte","_context$requestConte2","_context$requestConte3","_context$requestConte4","_context$requestConte5","promise","channelInventoryConfigurationPromise","searchProductId","searchCriteriaInput","productInventoryResult","Context","ChannelId","channelId","Refinement","IncludeAttributes","includeAttributes","SkipVariantExpansion","AsyncResult","resolve","getInventoryConfigurationAsync","inventoryRefiner","refiner","RefinerRecordId","filter","isInStockRefiner","LeftValueBoundString","RightValueBoundString","inventoryRefinerValue","getInventorySortableRefinerValue","some","productListInventoryDisplay","HideOOS","isInStock","inventoryInStockRefinerValue","SortOOS","_input$queryResultSet","_input$queryResultSet2","sortColumnName","column","ColumnName","IsDescending","query","categoryId","category","CategoryIds","searchByCriteriaAsync","searchText","q","SearchCondition","recommendation","searchObject","productId","Number","isNaN","Recommendation","RecommendationListId","Ids","discountIds","_context$requestConte6","accountInformation","getCustomer","GetCustomerInput","split","productIds","getProductPromotionsAsync","HeaderContext","CustomerAccountNumber","AccountNumber","LineContexts","Date","p","_p$ProductId","getByIdsAsync","metadata","args","createBaseCollectionInput","itemsPerPage","GetActivePricesInput","projectDomain","activeDate","customerId","affiliationLoyaltyTiers","includeSimpleDiscountsInContextualPrice","includeVariantPriceRange","includeAttainablePricesAndDiscounts","priceLookupContext","getActivePricesAction","request","ctx","result","getActivePricesAsync","log","Msdyn365","GetProductUnitOfMeasureInput","unitOfMeasureSearchCriteria","getProductUnitsOfMeasureAction","getProductUnitsOfMeasureAsync","PaymentStateShareInput","isCODSelected","isCreditCardSelected","shouldApplyOnAccountPayment","isStoreSelected","binding","modules","dataActions","registerActionId","actionPath","default","prototype","Object","keys","forEach","exportName","Action","require","window","__bindings__","packageDataActions","isUpdateRefinerPanel","locale","toJS","generateCacheKey","key","value","convertToString","inputClassConstuctor","urlTokens","QueryResultSettingsProxy","fromInputData","QueryResultSettings","queryRefiners","hydrateRefinersFromUrl","_inputData$config","updateRefinerPanel","getUpdateRefinerPanel","getCatalogId","sorting","decodeURIComponent","itemId","stringify","DiscountIds","DataTypeValue","AttributeDataType","TrueFalse","UnitText","RowNumber","Count","RefinerSourceValue","ProductRefinerSource","Attribute","_input$channelInvento2","getProductRefinerHierarchy","_input$channelInvento3","inventoryProductAttributeRecordId","getProductSearchRefinersAsync","then","productRefiners","productRefiner","compressedRefinerKeys","compressedRefinerArray","parseQueryParam","compressedRefiner","parsedRefiner","refinerKey","index","_unused","Boolean","buildListPageUrl","fullUrl","sortingColumns","skipCount","searchParams","delete","sortedRefiners","sort","first","second","set","compressedRefiners","compressRefiners","href","toString","getCurrentUrl","URL","location","url","requestUrl","module","exports","React","ReactDOM"],"sourceRoot":""}