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,iDAOAjB,EAF4B,0EACXO,EAAQ,MAQzBP,EAF4B,oFACXO,EAAQ,MAQzBP,EAF4B,uEACXO,EAAQ,KAQzBP,EAF4B,0EACXO,EAAQ,KAQzBP,EAF4B,oFACXO,EAAQ,MAQzBP,EAF4B,oFACXO,EAAQ,MAQzBP,EAF4B,gFACXO,EAAQ,MAQzBP,EAF4B,4DACXO,EAAQ,OAMjCj1B,OAAO41B,aAAe51B,OAAO41B,cAAgB,GAC7C51B,OAAO41B,aAAapB,QAAOthC,EAAAA,EAAA,GACpB8M,OAAO41B,aAAapB,SAAW,IAC/BD,EAAQC,SAGXx0B,OAAO41B,aAAanB,YAAWvhC,EAAAA,EAAA,GAC5B8M,OAAO41B,aAAanB,aAAe,IACnCF,EAAQE,aAEY,MAAMoB,EAAiB,GAC9BA,EAAe,mGAAqG,CAC5Hb,EAAGA,IAAMC,EAAQ,MACjBa,GAAI,yDAEpB91B,OAAO41B,aAAe51B,OAAO41B,cAAgB,GAC7C51B,OAAO41B,aAAaC,eAAc3iC,EAAAA,EAAA,GACP8M,OAAO41B,aAAaC,gBAAkB,IACtCA,I,mBCpI3BE,EAAOC,QAAU3yB,O,oBCAjB0yB,EAAOC,QAAUC,W","sources":["webpack://sgi-bookstore/./src/modules/sgi-new-arrival/get-all-refiners-for-collection.ts?e0d9","webpack://sgi-bookstore/./src/modules/sgi-search-new-arrivals-container/actions/base-collection-action.ts?5e86","webpack://sgi-bookstore/./src/modules/sgi-search-new-arrivals-container/actions/get-inventory-refiners.ts?caa2","webpack://sgi-bookstore/./src/modules/sgi-search-new-arrivals-container/actions/get-full-products-by-collection.ts?dd5d","webpack://sgi-bookstore/./src/modules/sgi-search-new-arrivals-container/actions/get-mapped-search-configuration.ts?2d96","webpack://sgi-bookstore/./src/modules/sgi-search-new-arrivals-container/actions/get-product-refiner-hierarchy.ts?757e","webpack://sgi-bookstore/./src/modules/sgi-search-new-arrivals-container/actions/get-refiners-for-collection.ts?29eb","webpack://sgi-bookstore/./src/modules/sgi-search-new-arrivals-container/actions/url-utils.ts?bba0","webpack://sgi-bookstore/./src/modules/sgi-search-new-arrivals-container/list-page-state.ts?6589","webpack://sgi-bookstore/./src/modules/sgi-search-new-arrivals-container/components/utilities.ts?96e4","webpack://sgi-bookstore/./src/modules/sgi-search-new-arrivals-container/components/choice-summary.tsx?94d3","webpack://sgi-bookstore/./src/modules/sgi-search-new-arrivals-container/components/error-message.tsx?df83","webpack://sgi-bookstore/./src/modules/sgi-search-new-arrivals-container/components/feature-search-result-item.tsx?ab67","webpack://sgi-bookstore/./src/modules/sgi-search-new-arrivals-container/components/link.tsx?f78d","webpack://sgi-bookstore/./src/modules/sgi-search-new-arrivals-container/components/modal.tsx?2245","webpack://sgi-bookstore/./src/modules/sgi-search-new-arrivals-container/components/product-search-result-items.tsx?107a","webpack://sgi-bookstore/./src/modules/sgi-search-new-arrivals-container/components/range-refine-item.tsx?ea3b","webpack://sgi-bookstore/./src/modules/sgi-search-new-arrivals-container/components/refine-item.tsx?c8da","webpack://sgi-bookstore/./src/modules/sgi-search-new-arrivals-container/components/refine-submenu.tsx?3aa6","webpack://sgi-bookstore/./src/modules/sgi-search-new-arrivals-container/components/separator.tsx?83b1","webpack://sgi-bookstore/./src/modules/sgi-search-new-arrivals-container/components/title.tsx?dc16","webpack://sgi-bookstore/./src/modules/sgi-search-new-arrivals-container/sgi-search-new-arrivals-container.props.autogenerated.ts?d8fa","webpack://sgi-bookstore/./src/modules/sgi-search-new-arrivals-container/sgi-search-new-arrivals-container.tsx?00c2","webpack://sgi-bookstore/./src/modules/sgi-search-new-arrivals-container/sgi-search-new-arrivals-container.view.tsx?3edf","webpack://sgi-bookstore/./src/themes/sgi-theme/views/Utilities/utility.ts?1838","webpack://sgi-bookstore/./src/themes/sgi-theme/views/components/product.component.tsx?f1a3","webpack://sgi-bookstore/./lib/sgi-search-new-arrivals-container/module-registration.js?774f","webpack://sgi-bookstore/external var \"React\"?0d3b","webpack://sgi-bookstore/external var \"ReactDOM\"?853b"],"sourcesContent":["import { IQueryResultSettings, ProductRefiner } from '@msdyn365-commerce/retail-proxy';\r\n/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport { createObservableDataAction, IAction, IActionContext, IActionInput, ICreateActionContext } from '@msdyn365-commerce/core';\r\n\r\nimport { getProductSearchRefinersAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n\r\n/**\r\n * Refiners-by-Collection Input action.\r\n */\r\nexport class AllRefinersInput implements IActionInput {\r\n public getCacheKey = () => `ProductRefiner`;\r\n\r\n public getCacheObjectType = () => 'ProductRefiner';\r\n\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n/**\r\n * Create input method which creates an ActionInput for fetching list page refiners.\r\n * @param args\r\n */\r\nconst createInput = (args: ICreateActionContext): IActionInput => {\r\n return new AllRefinersInput();\r\n};\r\n\r\n/**\r\n * Action method which fetches refiners for the given list page.\r\n * @param input\r\n * @param ctx\r\n */\r\nasync function getAllRefinersAction(input: AllRefinersInput, ctx: IActionContext): Promise {\r\n const queryResultSettings: IQueryResultSettings = {\r\n count: true,\r\n Sorting: {\r\n Columns: [\r\n {\r\n ColumnName: 'name',\r\n IsDescending: true\r\n }\r\n ]\r\n }\r\n };\r\n const searchCriteria = {\r\n SearchCondition: '*',\r\n Context: {\r\n ChannelId: ctx.requestContext.apiSettings.channelId,\r\n CatalogId: ctx.requestContext.apiSettings.catalogId\r\n }\r\n };\r\n return getProductSearchRefinersAsync({ callerContext: ctx, queryResultSettings }, searchCriteria).then(\r\n (productRefiners: ProductRefiner[]) => {\r\n if (!productRefiners) {\r\n ctx.trace('[getRefinersByCriteriaAction] returned no refiners');\r\n return [];\r\n }\r\n\r\n const result = (productRefiners || []).map((productRefiner: ProductRefiner) => productRefiner);\r\n\r\n if (result.length === 0) {\r\n ctx.trace('[getRefinersByCriteriaAction] returned no IProductRefinerHierarchy objects');\r\n return [];\r\n }\r\n\r\n return result;\r\n }\r\n );\r\n}\r\n\r\nexport const actionDataAction = createObservableDataAction({\r\n id: 'get-all-refiners-for-collection',\r\n action: >getAllRefinersAction,\r\n input: createInput\r\n});\r\n\r\nexport default actionDataAction;\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { CacheType, getCatalogId, IActionInput, IAny, ICommerceApiSettings, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\r\nimport { convertToString, IQueryResultSettings, ProductRefinerValue, SortColumn } from '@msdyn365-commerce/retail-proxy';\r\nimport { buildCacheKey, QueryResultSettingsProxy } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { toJS } from 'mobx';\r\n\r\nimport { hydrateRefinersFromUrl } from './url-utils';\r\n\r\n/**\r\n * Export listPageType.\r\n */\r\nexport type listPageType = 'Category' | 'Search' | 'Unknown';\r\n\r\n/**\r\n * Get include attributes from config.\r\n * @param inputData - ICreateActionContext.\r\n * @returns Boolean.\r\n */\r\nfunction getIncludeAttributes(inputData: ICreateActionContext, IGeneric>): boolean {\r\n if (inputData && inputData.config && inputData.config.includeAttributes !== undefined && inputData.config.includeAttributes === true) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * Get updateRefinerPanel from config.\r\n * @param inputData - ICreateActionContext.\r\n * @returns Boolean.\r\n */\r\nfunction getUpdateRefinerPanel(inputData: ICreateActionContext, IGeneric>): boolean {\r\n return !!inputData.config?.updateRefinerPanel;\r\n}\r\n\r\n/**\r\n * BaseCollection Action Input.\r\n */\r\nexport class BaseCollectionInput implements IActionInput {\r\n public searchText: string | undefined;\r\n\r\n public refiners: ProductRefinerValue[];\r\n\r\n public queryResultSettings: IQueryResultSettings;\r\n\r\n public apiSettings: ICommerceApiSettings;\r\n\r\n public includeAttributes: boolean | undefined;\r\n\r\n public locale?: string;\r\n\r\n public isUpdateRefinerPanel?: boolean;\r\n\r\n public catalogId?: number;\r\n\r\n public configs?: any;\r\n public constructor(\r\n apiSettings: ICommerceApiSettings,\r\n queryResultSettings: IQueryResultSettings,\r\n refiners: ProductRefinerValue[],\r\n searchText: string | undefined,\r\n includeAttributes: boolean | undefined,\r\n isUpdateRefinerPanel?: boolean | undefined,\r\n locale?: string,\r\n catalogId?: number,\r\n configs?: any\r\n ) {\r\n this.apiSettings = apiSettings;\r\n this.searchText = searchText;\r\n this.queryResultSettings = queryResultSettings;\r\n this.refiners = refiners;\r\n this.includeAttributes = includeAttributes;\r\n this.isUpdateRefinerPanel = isUpdateRefinerPanel;\r\n this.locale = locale;\r\n this.catalogId = catalogId ?? 0;\r\n this.configs = configs;\r\n }\r\n\r\n public getCacheKey = () => {\r\n const queryResultSettings = {\r\n ...this.queryResultSettings.Paging,\r\n ...toJS(this.queryResultSettings.Sorting)\r\n };\r\n\r\n const cacheKey = buildCacheKey(\r\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions -- disabling this as inputs can be undefined depending on page type\r\n `${this.locale}-${this.searchText}-${this.catalogId}-${this.refiners.map(\r\n refiner => `${refiner.RefinerRecordId} ${refiner.LeftValueBoundString || ''} ${refiner.RightValueBoundString || ''}}-`\r\n )}-${convertToString(queryResultSettings)}`,\r\n this.apiSettings,\r\n this.locale\r\n );\r\n return cacheKey;\r\n };\r\n\r\n public getCacheObjectType = () => 'CollectionActionResult';\r\n\r\n public dataCacheType = (): CacheType => 'request';\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 IGetFullProductsByCollectionData {\r\n text: string;\r\n}\r\n\r\nexport type CollectionClassConstructor = new (\r\n apiSettings: ICommerceApiSettings,\r\n queryResultSettings: IQueryResultSettings,\r\n refiners: ProductRefinerValue[],\r\n searchText: string | undefined,\r\n includeAttributes: boolean | undefined,\r\n isUpdateRefinerPanel?: boolean | undefined,\r\n locale?: string,\r\n catalogId?: number,\r\n configs?: any\r\n) => BaseCollectionInput;\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call.\r\n * @param args\r\n * @param inputClassConstuctor\r\n */\r\nexport const createBaseCollectionInput = (\r\n args: ICreateActionContext,\r\n inputClassConstuctor: CollectionClassConstructor\r\n): BaseCollectionInput => {\r\n const queryResultSettings = QueryResultSettingsProxy.fromInputData(args).QueryResultSettings;\r\n const queryRefiners = hydrateRefinersFromUrl(args.requestContext);\r\n const includeAttributes = getIncludeAttributes(args);\r\n const isUpdateRefinerPanel = getUpdateRefinerPanel(args);\r\n const catalogId = getCatalogId(args.requestContext);\r\n\r\n if (args.requestContext.query && args.requestContext.query.sorting) {\r\n queryResultSettings.Sorting = { Columns: JSON.parse(decodeURIComponent(args.requestContext.query.sorting)) };\r\n }\r\n try {\r\n return new inputClassConstuctor(\r\n args.requestContext.apiSettings,\r\n queryResultSettings,\r\n queryRefiners,\r\n undefined,\r\n includeAttributes,\r\n isUpdateRefinerPanel,\r\n args.requestContext.locale,\r\n catalogId,\r\n args.config\r\n );\r\n } catch (error) {\r\n throw new Error('[getFullProductsForCollection]Unable to create input');\r\n }\r\n};\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput } from '@msdyn365-commerce/core';\r\nimport { buildCacheKey } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\nimport { BaseCollectionInput } from './base-collection-action';\r\nimport { getProductRefinerHierarchy } from './get-product-refiner-hierarchy';\r\n\r\n/**\r\n * InventoryInStockRefinerValue Input action.\r\n */\r\nexport class InventoryInStockRefinerValueInput extends BaseCollectionInput implements IActionInput {\r\n public inventoryProductAttributeRecordId: number;\r\n\r\n public constructor(input: BaseCollectionInput, inventoryProductAttributeRecordId: number = 0) {\r\n super(\r\n input.apiSettings,\r\n input.queryResultSettings,\r\n\r\n // Parameter - refiners\r\n [],\r\n\r\n // Parameter - searchText\r\n '',\r\n\r\n // Parameter - includeAttributes\r\n false,\r\n\r\n // Parameter - isUpdateRefinerPanel\r\n false,\r\n\r\n // Parameter - locale\r\n undefined,\r\n input.catalogId\r\n );\r\n\r\n this.inventoryProductAttributeRecordId = inventoryProductAttributeRecordId;\r\n }\r\n\r\n /**\r\n * GetCacheKey.\r\n * @returns - Returns string.\r\n */\r\n public getCacheKey = (): string => buildCacheKey('RefinerList', this.apiSettings);\r\n\r\n /**\r\n * GetCacheObjectType.\r\n * @returns - Returns string.\r\n */\r\n public getCacheObjectType = (): string => 'RefinerList';\r\n\r\n /**\r\n * DataCacheType.\r\n * @returns - CacheType string.\r\n */\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\n/**\r\n * Action method returns inventory in stock refiners.\r\n * @param input - InventoryInStockRefinerValueInput.\r\n * @param context - IActionContext.\r\n * @returns - Promise.\r\n */\r\nasync function action(input: InventoryInStockRefinerValueInput, context: IActionContext): Promise {\r\n const refiners = await getProductRefinerHierarchy(\r\n {\r\n Context: {\r\n ChannelId: input.apiSettings.channelId,\r\n CatalogId: input.catalogId\r\n }\r\n },\r\n input.queryResultSettings,\r\n context\r\n );\r\n\r\n return refiners.find(refiner => refiner.RecordId === input.inventoryProductAttributeRecordId) ?? null;\r\n}\r\n\r\n/**\r\n * Action.\r\n * @param id - Id.\r\n * @param action - Action.\r\n * @returns - Results.\r\n */\r\nexport const actionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/sgi-search-new-arrivals-container/get-inventory-refiners',\r\n action: action as IAction\r\n});\r\n\r\nexport default actionDataAction;\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\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 {\r\n AsyncResult,\r\n ChannelInventoryConfiguration,\r\n ProductRefinerValue,\r\n ProductSearchCriteria,\r\n ProductSearchResult\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { searchByCriteriaAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { getInventoryConfigurationAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\r\nimport { ArrayExtensions, generateProductImageUrl, InventoryLevels, ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\nimport { ListPageStateInput } from '../list-page-state';\r\nimport { BaseCollectionInput, createBaseCollectionInput } from './base-collection-action';\r\nimport getInventoryRefinersAction, { InventoryInStockRefinerValueInput } from './get-inventory-refiners';\r\nimport getAllRefinersAction, { AllRefinersInput } from '../../sgi-new-arrival/get-all-refiners-for-collection';\r\nimport { ISgiSearchNewArrivalsContainerConfig } from '../sgi-search-new-arrivals-container.props.autogenerated';\r\nimport { getAttributeByKeyName } from '../../../themes/sgi-theme/views/Utilities/utility';\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 => 'FullProductSearchResultNewArrivals';\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.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 'request';\r\n }\r\n return 'application';\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}\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): IActionInput => {\r\n const input = createBaseCollectionInput(args, GetFullProductsByCollectionInput);\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 return input;\r\n};\r\n\r\n/**\r\n * Finds whether a product is out of stock based on the attribute.\r\n * @param product - The product.\r\n * @param channelInventoryConfiguration - The channel configuration.\r\n * @returns True if is OOS, false otherwise.\r\n */\r\nfunction isOutOfStock(product: ProductSearchResult, channelInventoryConfiguration: ChannelInventoryConfiguration): boolean {\r\n if (!ArrayExtensions.hasElements(product.AttributeValues)) {\r\n // If no attributes then assume is in stock\r\n return false;\r\n }\r\n for (const attribute of product.AttributeValues) {\r\n if (\r\n attribute.RecordId === channelInventoryConfiguration.InventoryProductAttributeRecordId &&\r\n attribute.TextValue === channelInventoryConfiguration.InventoryOutOfStockAttributeValueText\r\n ) {\r\n // The matching recordId indicates that is the inventory attribute\r\n // if the text value are the same then is out of stock.\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * Returns sorted products based on availability.\r\n * @param products - The product.\r\n * @param channelInventoryConfiguration - The channel configuration.\r\n * @returns Sorted product search result.\r\n */\r\nfunction sortsProductsBasedOnAvailability(\r\n products: ProductSearchResult[],\r\n channelInventoryConfiguration: ChannelInventoryConfiguration\r\n): ProductSearchResult[] {\r\n if (!ArrayExtensions.hasElements(products)) {\r\n return [];\r\n }\r\n const inStockProducts: ProductSearchResult[] = [];\r\n const outOfStockProducts: ProductSearchResult[] = [];\r\n\r\n for (const product of products) {\r\n if (isOutOfStock(product, channelInventoryConfiguration)) {\r\n outOfStockProducts.push(product);\r\n } else {\r\n inStockProducts.push(product);\r\n }\r\n }\r\n return inStockProducts.concat(outOfStockProducts);\r\n}\r\n\r\n/**\r\n * Get inventory in stock refiner value.\r\n * @param input - The GetFullProductsByCollectionInput input.\r\n * @param context - The context.\r\n * @param channelInventoryConfiguration - The channelInventoryConfiguration.\r\n * @returns Refiners.\r\n */\r\nasync function getInventoryInStockRefinerValueAsync(\r\n input: GetFullProductsByCollectionInput,\r\n context: IActionContext,\r\n channelInventoryConfiguration: ChannelInventoryConfiguration\r\n): Promise {\r\n const refinerInput = new InventoryInStockRefinerValueInput(input, channelInventoryConfiguration.InventoryProductAttributeRecordId);\r\n\r\n const inventoryRefiner = await getInventoryRefinersAction(refinerInput, context);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- inventoryRefiner may be null\r\n return (\r\n inventoryRefiner?.Values.find(\r\n value =>\r\n value.LeftValueBoundString !== channelInventoryConfiguration.InventoryOutOfStockAttributeValueText &&\r\n value.RightValueBoundString !== channelInventoryConfiguration.InventoryOutOfStockAttributeValueText\r\n ) ?? null\r\n );\r\n}\r\n\r\n/**\r\n * Returns list of products based on inventory information.\r\n * @param products - The products.\r\n * @param channelInventoryConfiguration - The channel configuration.\r\n * @param context - The context.\r\n * @returns List of product based on the inventory information.\r\n */\r\nexport function returnProductsBasedOnInventoryInformation(\r\n products: ProductSearchResult[],\r\n channelInventoryConfiguration: ChannelInventoryConfiguration,\r\n context: IActionContext\r\n): ProductSearchResult[] {\r\n if (!ArrayExtensions.hasElements(products) || ObjectExtensions.isNullOrUndefined(channelInventoryConfiguration)) {\r\n return [];\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 (context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.SortOOS) {\r\n return sortsProductsBasedOnAvailability(products, channelInventoryConfiguration);\r\n }\r\n return products;\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 context: IActionContext,\r\n metadataCount: number | undefined,\r\n channelInventoryConfiguration?: ChannelInventoryConfiguration\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 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 inventoryConfiguration = channelInventoryConfiguration ?? (await getInventoryConfigurationAsync({ callerContext: context }));\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 const productsBasedOnInventory = returnProductsBasedOnInventoryInformation(mappedProducts, inventoryConfiguration, context);\r\n return {\r\n products: productsBasedOnInventory,\r\n count: metadataCount ?? defaultProductCount,\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- check config.\r\n channelInventoryConfigurationId: inventoryConfiguration ? inventoryConfiguration.InventoryProductAttributeRecordId : undefined\r\n };\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\nasync function action(input: GetFullProductsByCollectionInput, context: IActionContext): Promise {\r\n let promise: AsyncResult;\r\n let searchProductId;\r\n const searchCriteriaInput: ProductSearchCriteria = {};\r\n searchCriteriaInput.Context = { ChannelId: context.requestContext.apiSettings.channelId, CatalogId: input.catalogId };\r\n searchCriteriaInput.Refinement = input.refiners;\r\n searchCriteriaInput.IncludeAttributes = input.includeAttributes;\r\n searchCriteriaInput.SkipVariantExpansion = true;\r\n const defaultNumber: number = 0;\r\n const channelInventoryConfiguration = await getInventoryConfigurationAsync({ callerContext: context });\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- app configs are of generic type\r\n if (context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS) {\r\n const refinerValue = await getInventoryInStockRefinerValueAsync(input, context, channelInventoryConfiguration);\r\n const isInventoryAvailableRefinerValueExist = searchCriteriaInput.Refinement.some(\r\n value => value.RefinerRecordId === refinerValue?.RefinerRecordId\r\n );\r\n if (!isInventoryAvailableRefinerValueExist && refinerValue) {\r\n searchCriteriaInput.Refinement.push(refinerValue);\r\n }\r\n }\r\n const allRefiners = await getAllRefinersAction(new AllRefinersInput(), context);\r\n const filteredRefiner = allRefiners\r\n ?.find(refiner => refiner.KeyName?.toLowerCase() === input.configs?.newArrivalRefinerName.toLowerCase())\r\n ?.Values.find(value => value.LeftValueBoundString?.toLowerCase() === input.configs?.newArrivalRefinerLVSValue.toLowerCase());\r\n if (input.searchText && context.requestContext.query && context.requestContext.query.q && filteredRefiner) {\r\n searchCriteriaInput.SearchCondition = input.searchText;\r\n searchCriteriaInput.Refinement = [...searchCriteriaInput?.Refinement, filteredRefiner];\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 (\r\n input.searchText &&\r\n context.requestContext.query?.productId &&\r\n context.requestContext.query.recommendation &&\r\n filteredRefiner\r\n ) {\r\n const searchObject = JSON.parse(input.searchText);\r\n searchProductId = Number(searchObject.ProductId);\r\n if (Number.isNaN(searchProductId)) {\r\n throw new Error('Failed to cast search product id into a number.');\r\n } else if (!searchObject.Recommendation) {\r\n throw new Error('Failed to retrieve the Recommendation.');\r\n } else {\r\n searchCriteriaInput.RecommendationListId = searchObject.Recommendation;\r\n searchCriteriaInput.Ids = [searchProductId || defaultNumber];\r\n searchCriteriaInput.Refinement = [...searchCriteriaInput?.Refinement, filteredRefiner];\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 (filteredRefiner) {\r\n // searchCriteriaInput.CategoryIds = [input.category || defaultNumber];\r\n searchCriteriaInput.Refinement = [...searchCriteriaInput?.Refinement, filteredRefiner];\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 let productSearchResults = await promise;\r\n // let filteredproducts: ProductSearchResult[] = productSearchResults;\r\n if (productSearchResults) {\r\n productSearchResults = productSearchResults.filter(product => {\r\n const isNewArrival = getAttributeByKeyName(product.AttributeValues, input.configs?.newArrivalAttrKeyName)?.BooleanValue;\r\n const isNewArrivalDateValid = getAttributeByKeyName(product?.AttributeValues, input.configs?.newArrivalDateAttrKeyName)\r\n ?.DateTimeOffsetValue;\r\n return isNewArrival && isNewArrivalDateValid && isNewArrivalDateValid >= new Date() && product;\r\n });\r\n }\r\n\r\n if (!productSearchResults?.length) {\r\n promise.metadata.count = 0;\r\n } else {\r\n promise.metadata.count = productSearchResults?.length;\r\n }\r\n\r\n // Update ListPageState For SSR\r\n if (!MsDyn365.isBrowser) {\r\n context.update(new ListPageStateInput(), {\r\n totalProductCount: promise.metadata.count ?? defaultNumber,\r\n activeFilters: input.refiners\r\n });\r\n }\r\n\r\n return returnProducts(\r\n productSearchResults,\r\n context,\r\n promise.metadata.count ?? productSearchResults?.length,\r\n channelInventoryConfiguration\r\n );\r\n}\r\n\r\nexport const actionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/sgi-search-new-arrivals-container/get-full-products-by-collection',\r\n action: >action,\r\n input: createInput\r\n});\r\n\r\nexport default actionDataAction;\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICommerceApiSettings,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport { SortColumn } from '@msdyn365-commerce/retail-proxy';\r\nimport { getSearchConfigurationAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\r\nimport { buildCacheKey } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\n// TODO: import from commerce entities when available\r\ninterface SearchConfiguration {\r\n ProductSortColumns?: SortColumn[];\r\n}\r\n\r\nexport interface MappedSearchConfiguration {\r\n key: string;\r\n sortColumn: SortColumn;\r\n}\r\n\r\nexport const sortOptions = {\r\n sortByOptionRelevanceDesc: 'Ranking-Desc',\r\n sortByOptionRatingAsc: 'AverageRating-Asc',\r\n sortByOptionRatingDesc: 'AverageRating-Desc',\r\n sortByOptionNameAsc: 'Name-Asc',\r\n sortByOptionNameDesc: 'Name-Desc',\r\n sortByOptionPriceAsc: 'Price-Asc',\r\n sortByOptionPriceDesc: 'Price-Desc',\r\n sortByOptionBestSelling: 'BestSelling',\r\n sortByOptionNewScore: 'NewScore',\r\n sortByOptionTrendingScore: 'TrendingScore'\r\n};\r\n\r\n/**\r\n * ActionInput class for the get-mapped-search-configuration Data Action.\r\n */\r\nexport class MappedSearchInput implements IActionInput {\r\n private readonly apiSettings: ICommerceApiSettings;\r\n\r\n constructor(apiSettings: ICommerceApiSettings) {\r\n this.apiSettings = apiSettings;\r\n }\r\n\r\n public getCacheKey = () => buildCacheKey('MappedSearchInput', this.apiSettings);\r\n\r\n public getCacheObjectType = () => 'MappedSearchInput';\r\n\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n/**\r\n * Get a mapped search configuration that is easy to use for sorting.\r\n * @param input\r\n * @param ctx\r\n */\r\nexport async function getMappedSearchConfiguration(input: MappedSearchInput, ctx: IActionContext): Promise {\r\n return getSearchConfigurationAsync({ callerContext: ctx }).then((searchConfiguration: SearchConfiguration) => {\r\n return (searchConfiguration.ProductSortColumns || [])\r\n .map((sortColumn: SortColumn) => {\r\n let key = '';\r\n if (sortColumn.ColumnName) {\r\n switch (sortColumn.ColumnName.toUpperCase()) {\r\n case 'NAME':\r\n key = sortColumn.IsDescending ? sortOptions.sortByOptionNameDesc : sortOptions.sortByOptionNameAsc;\r\n break;\r\n case 'PRICE':\r\n key = sortColumn.IsDescending ? sortOptions.sortByOptionPriceDesc : sortOptions.sortByOptionPriceAsc;\r\n break;\r\n case 'AVERAGERATING':\r\n key = sortColumn.IsDescending ? sortOptions.sortByOptionRatingDesc : sortOptions.sortByOptionRatingAsc;\r\n break;\r\n case 'RANKING':\r\n key = sortOptions.sortByOptionRelevanceDesc;\r\n break;\r\n case 'BESTSELLINGSCORE':\r\n key = sortOptions.sortByOptionBestSelling;\r\n break;\r\n case 'NEWSCORE':\r\n key = sortOptions.sortByOptionNewScore;\r\n break;\r\n case 'TRENDINGSCORE':\r\n key = sortOptions.sortByOptionTrendingScore;\r\n break;\r\n default:\r\n }\r\n } else {\r\n ctx.telemetry.warning('[get-mapped-search-configuration] unknown search option');\r\n }\r\n if (key) {\r\n return {\r\n key,\r\n sortColumn\r\n };\r\n }\r\n return undefined;\r\n })\r\n .filter(Boolean);\r\n });\r\n}\r\n\r\nexport const createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new MappedSearchInput(inputData.requestContext.apiSettings);\r\n};\r\n\r\nexport const getMappedSearchConfigurationDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/sgi-search-new-arrivals-container/get-mapped-search-configuration',\r\n action: >getMappedSearchConfiguration,\r\n input: createInput\r\n});\r\n\r\nexport default getMappedSearchConfigurationDataAction;\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { IQueryResultSettings, ProductRefiner, ProductSearchCriteria } from '@msdyn365-commerce/retail-proxy';\r\nimport { getProductSearchRefinersAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n\r\n/**\r\n * Uses Bulk refiner API to get refiners and child refiner values.\r\n * @param searchCriteria Product search criteria.\r\n * @param maxItems Max items.\r\n * @param queryResultSettings\r\n * @param ctx Action context.\r\n */\r\nexport async function getProductRefinerHierarchy(\r\n searchCriteria: ProductSearchCriteria,\r\n queryResultSettings: IQueryResultSettings,\r\n ctx: IActionContext\r\n): Promise {\r\n return getProductSearchRefinersAsync({ callerContext: ctx, queryResultSettings }, searchCriteria).then(\r\n (productRefiners: ProductRefiner[]) => {\r\n if (!productRefiners) {\r\n ctx.trace('[getRefinersByCriteriaAction] returned no refiners');\r\n return [];\r\n }\r\n\r\n const result = (productRefiners || []).map((productRefiner: ProductRefiner) => productRefiner);\r\n\r\n if (result.length === 0) {\r\n ctx.trace('[getRefinersByCriteriaAction] returned no IProductRefinerHierarchy objects');\r\n return [];\r\n }\r\n\r\n return result;\r\n }\r\n );\r\n}\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport { createObservableDataAction, IAction, IActionContext, IActionInput, ICreateActionContext } from '@msdyn365-commerce/core';\r\nimport { CacheType } from '@msdyn365-commerce/retail-proxy';\r\nimport getAllRefinersAction, { AllRefinersInput } from '../../sgi-new-arrival/get-all-refiners-for-collection';\r\n\r\nimport { BaseCollectionInput, createBaseCollectionInput } from './base-collection-action';\r\nimport { getProductRefinerHierarchy } from './get-product-refiner-hierarchy';\r\n\r\n/**\r\n * Default Category/Product Id Values.\r\n */\r\nenum DefaultValues {\r\n defaultCategoryIdValue = 0,\r\n defaultProductIdValue = 0\r\n}\r\n\r\n/**\r\n * Refiners-by-Collection Input action.\r\n */\r\nexport class RefinersByCollectionInput extends BaseCollectionInput implements IActionInput {\r\n public getCacheObjectType = () => 'ProductRefiner';\r\n\r\n public dataCacheType = (): CacheType => {\r\n if (\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 'request';\r\n }\r\n return 'application';\r\n };\r\n}\r\n\r\n/**\r\n * Create input method which creates an ActionInput for fetching list page refiners.\r\n * @param args\r\n */\r\nconst createInput = (args: ICreateActionContext): IActionInput => {\r\n return createBaseCollectionInput(args, RefinersByCollectionInput);\r\n};\r\n\r\n/**\r\n * Action method which fetches refiners for the given list page.\r\n * @param input\r\n * @param ctx\r\n */\r\nasync function action(input: RefinersByCollectionInput, ctx: IActionContext): Promise {\r\n let searchProductId;\r\n const allRefiners = await getAllRefinersAction(new AllRefinersInput(), ctx);\r\n const filteredRefiner = allRefiners\r\n ?.find(refiner => refiner.KeyName?.toLowerCase() === input.configs?.newArrivalRefinerName.toLowerCase())\r\n ?.Values.find(value => value.LeftValueBoundString?.toLowerCase() === input.configs?.newArrivalRefinerLVSValue.toLowerCase());\r\n if (filteredRefiner) {\r\n // if (input.category) {\r\n return getProductRefinerHierarchy(\r\n {\r\n // CategoryIds: [input.category || DefaultValues.defaultCategoryIdValue],\r\n Context: {\r\n ChannelId: input.apiSettings.channelId,\r\n CatalogId: input.catalogId\r\n },\r\n Refinement: input.isUpdateRefinerPanel ? [...input.refiners, filteredRefiner] : [filteredRefiner]\r\n },\r\n input.queryResultSettings,\r\n ctx\r\n );\r\n // }\r\n // throw new Error('[GetRefinersForCollection]Category Page Detected, but no global categoryId found');\r\n } else {\r\n if (input.searchText && ctx.requestContext.query && ctx.requestContext.query.q && filteredRefiner) {\r\n return getProductRefinerHierarchy(\r\n {\r\n SearchCondition: input.searchText,\r\n Context: {\r\n ChannelId: input.apiSettings.channelId,\r\n CatalogId: input.catalogId\r\n },\r\n Refinement: input.isUpdateRefinerPanel ? [...input.refiners, filteredRefiner] : [filteredRefiner]\r\n },\r\n input.queryResultSettings,\r\n ctx\r\n );\r\n }\r\n if (input.searchText && ctx.requestContext.query && ctx.requestContext.query.productId) {\r\n const searchObject = JSON.parse(input.searchText);\r\n searchProductId = Number(searchObject.ProductId);\r\n if (Number.isNaN(searchProductId)) {\r\n throw new Error('Failed to cast search product id into a number.');\r\n } else if (!searchObject.Recommendation) {\r\n throw new Error('Failed to retrieve the Recommendation.');\r\n } else {\r\n return getProductRefinerHierarchy(\r\n {\r\n Context: {\r\n ChannelId: input.apiSettings.channelId,\r\n CatalogId: input.catalogId\r\n },\r\n Refinement:\r\n input.isUpdateRefinerPanel && filteredRefiner\r\n ? [...input.refiners, filteredRefiner]\r\n : filteredRefiner && [filteredRefiner],\r\n RecommendationListId: searchObject.Recommendation,\r\n Ids: [searchProductId || DefaultValues.defaultProductIdValue]\r\n },\r\n input.queryResultSettings,\r\n ctx\r\n );\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}\r\n\r\nexport const actionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/sgi-search-new-arrivals-container/get-refiners-for-collection',\r\n action: >action,\r\n input: createInput\r\n});\r\n\r\nexport default actionDataAction;\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport MsDyn365, { IRequestContext } from '@msdyn365-commerce/core';\r\nimport { ProductRefinerValue, SortColumn } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * Refiner Compression:\r\n * Refiners contains a non-trivial amount of data that is required to successfully make\r\n * a refiner-based API call. To allow for deep-linking of refiners in the URL, refiner data\r\n * must be compressed so that URL max length is not exceeded. Refiners will be compressed into\r\n * the following array style index-based format:\r\n * [DataTypeValue, LeftValueBoundString, RefinerRecordId, RefinerSourceValue, RightValueBoundString, UnitText].\r\n */\r\nconst compressedRefinerKeys = [\r\n 'DataTypeValue',\r\n 'LeftValueBoundString',\r\n 'RefinerRecordId',\r\n 'RefinerSourceValue',\r\n 'RightValueBoundString',\r\n 'UnitText'\r\n];\r\n\r\n/**\r\n * Hydrates compressed refiner data from URL.\r\n * @param fullUrl The full URL of the page.\r\n * @param requestContext\r\n */\r\nexport const hydrateRefinersFromUrl = (requestContext: IRequestContext): ProductRefinerValue[] => {\r\n const compressedRefinerArray = parseQueryParam<(string | number)[][]>('refiners', requestContext);\r\n if (!compressedRefinerArray || compressedRefinerArray.length === 0) {\r\n return [];\r\n }\r\n\r\n return compressedRefinerArray\r\n .map(compressedRefiner => {\r\n try {\r\n const parsedRefiner: ProductRefinerValue = {};\r\n compressedRefinerKeys.forEach((refinerKey, index) => {\r\n parsedRefiner[refinerKey] = compressedRefiner[index];\r\n });\r\n return parsedRefiner;\r\n } catch {\r\n return undefined;\r\n }\r\n })\r\n .filter(Boolean);\r\n};\r\n\r\n/**\r\n * Compressed a list of refiners for use in URLs.\r\n * @param refiners The uncompressed refiners.\r\n */\r\nexport const compressRefiners = (refiners: ProductRefinerValue[]) => {\r\n const compressedRefiners: (string | number)[][] = [];\r\n\r\n refiners.forEach(refiner => {\r\n const compressedRefiner: (string | number)[] = [];\r\n compressedRefinerKeys.forEach(refinerKey => {\r\n compressedRefiner.push(refiner[refinerKey]);\r\n });\r\n compressedRefiners.push(compressedRefiner);\r\n });\r\n\r\n return compressedRefiners;\r\n};\r\n\r\n/**\r\n * Method which creates a URL contiaining serialized active refiners.\r\n * @param fullUrl The Current URL of the page.\r\n * @param refiners The refiners which should be added to the URL.\r\n * @param sortingColumns\r\n * @param skipCount\r\n */\r\nexport const buildListPageUrl = (fullUrl: URL, refiners?: ProductRefinerValue[], sortingColumns?: SortColumn[], skipCount?: number) => {\r\n // Refiner Change flow\r\n if (refiners !== undefined) {\r\n if (refiners.length === 0) {\r\n fullUrl.searchParams.delete('refiners');\r\n } else {\r\n const sortedRefiners = refiners.sort((first, second) =>\r\n first.RefinerRecordId && second.RefinerRecordId && first.RefinerRecordId > second.RefinerRecordId ? 1 : -1\r\n );\r\n fullUrl.searchParams.set('refiners', JSON.stringify(compressRefiners(sortedRefiners)));\r\n }\r\n\r\n // Adding or removing a refiner means we want to always load page 1\r\n fullUrl.searchParams.delete('skip');\r\n return fullUrl.href;\r\n }\r\n\r\n if (sortingColumns !== undefined) {\r\n if (sortingColumns.length === 0) {\r\n fullUrl.searchParams.delete('sorting');\r\n } else {\r\n fullUrl.searchParams.set('sorting', JSON.stringify(sortingColumns));\r\n }\r\n\r\n // Changing the sort means always load page 1\r\n fullUrl.searchParams.delete('skip');\r\n return fullUrl.href;\r\n }\r\n\r\n if (skipCount) {\r\n fullUrl.searchParams.set('skip', skipCount.toString());\r\n }\r\n\r\n return fullUrl.href;\r\n};\r\n\r\n/**\r\n * Parses a query param from the query object of the request context.\r\n * @param key The query parameter key.\r\n * @param requestContext The request context.\r\n */\r\nexport const parseQueryParam = (key: string, requestContext: IRequestContext): T | null => {\r\n if (requestContext.query && requestContext.query[key]) {\r\n return JSON.parse(decodeURIComponent(requestContext.query[key]));\r\n }\r\n return null;\r\n};\r\n\r\n/**\r\n * Gets the current URL of the page from the request context.\r\n * @param requestContext The request context.\r\n */\r\nexport const getCurrentUrl = (requestContext: IRequestContext): URL => {\r\n if (MsDyn365.isBrowser) {\r\n return new URL(window.location.href);\r\n }\r\n\r\n // NOTE: Typing on requestURL is incorrect\r\n if (requestContext.url.requestUrl.href) {\r\n return new URL(requestContext.url.requestUrl.href);\r\n }\r\n return new URL((requestContext.url.requestUrl));\r\n};\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport { ProductPrice, ProductRefinerValue, ProductSearchResult, SimpleProduct, SortingInfo } from '@msdyn365-commerce/retail-proxy';\r\nimport { observable } from 'mobx';\r\n\r\n/**\r\n * ListPageState class.\r\n */\r\nexport class ListPageState {\r\n @observable public activeFilters: ProductRefinerValue[] | null = null;\r\n\r\n @observable public activeProducts: ProductSearchResult[] = [];\r\n\r\n @observable public sortingCritera: SortingInfo | null = null;\r\n\r\n @observable public currentPageNumber: number | null = null;\r\n\r\n @observable public refiners: IProductRefinerHierarchy[] | null = null;\r\n\r\n @observable public totalProductCount: number | undefined;\r\n\r\n @observable public pageSize: number = 10;\r\n\r\n @observable public featureProduct: SimpleProduct | null = null;\r\n\r\n @observable public productPrices: ProductPrice[] | undefined = [];\r\n}\r\n\r\n/**\r\n * ListPageStateInput - action input.\r\n */\r\nexport class ListPageStateInput implements IActionInput {\r\n public getCacheKey = () => 'ListPageStateNewArrivals';\r\n\r\n public getCacheObjectType = () => 'ListPageStateNewArrivals';\r\n\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\nexport async function listPageStateAction(input: ListPageStateInput, ctx: IActionContext): Promise {\r\n return new ListPageState();\r\n}\r\n\r\n/**\r\n * Create new input for create action.\r\n * @param inputData\r\n */\r\nexport const createListPageInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new ListPageStateInput();\r\n};\r\n\r\n/**\r\n * ListPageState - create action.\r\n */\r\nexport default createObservableDataAction({\r\n action: >listPageStateAction,\r\n input: createListPageInput\r\n});\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { ITelemetry } from '@msdyn365-commerce/core';\r\nimport { AttributeDataType, ProductRefinerValue, RefinerType } from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport { IRefineItemToggleNotification } from './refine-item-toggle-notification';\r\n\r\n/**\r\n * Types of product refiner values.\r\n * @deprecated This will be removed soon. Please, use `AttributeDataType` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { AttributeDataType } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\nexport enum ProductRefinerValueDataTypeValue {\r\n /**\r\n * Range slider is used for selections like price.\r\n * @deprecated This will be removed soon. Please, use `AttributeDataType` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { AttributeDataType } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n Range = 1,\r\n\r\n /**\r\n * Range input is a different way to specify ranges and can be expressed with input boxes\r\n * as well as a set of discrete single-select type values.\r\n * @deprecated This will be removed soon. Please, use `AttributeDataType` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { AttributeDataType } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n RangeInput = 4,\r\n\r\n /**\r\n * This is a discrete list item, either multi-select or single-select.\r\n * @deprecated This will be removed soon. Please, use `AttributeDataType` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { AttributeDataType } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n List = 5,\r\n\r\n /**\r\n * Boolean types allows only single-select.\r\n * @deprecated This will be removed soon. Please, use `AttributeDataType` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { AttributeDataType } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n Boolean = 6\r\n}\r\n\r\n/**\r\n * Types of product refiners.\r\n * @deprecated This will be removed soon. Please, use `RefinerType` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { RefinerType } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\nexport enum ProductRefinerTypeValue {\r\n /**\r\n * Refiner values are single-select.\r\n * @deprecated This will be removed soon. Please, use `RefinerType` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { RefinerType } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n Single = 0,\r\n\r\n /**\r\n * Refiner values are multi-select.\r\n * @deprecated This will be removed soon. Please, use `RefinerType` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { RefinerType } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n Multi = 1\r\n}\r\n\r\n/**\r\n * ProductRefinerSource enum type.\r\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\nexport enum ProductRefinerSource {\r\n /**\r\n * The None member.\r\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n None = 0,\r\n\r\n /**\r\n * The Attribute member.\r\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n Attribute = 1,\r\n\r\n /**\r\n * The Category member.\r\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n Category = 2,\r\n\r\n /**\r\n * The Price member.\r\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n Price = 3,\r\n\r\n /**\r\n * The Rating member.\r\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n Rating = 4\r\n}\r\n\r\n/**\r\n * Checks if the data type value corresponds to a slider.\r\n * @param dataTypeValue\r\n */\r\nexport function isRangeType(dataTypeValue: number | undefined): boolean {\r\n return (\r\n dataTypeValue === AttributeDataType.Currency ||\r\n dataTypeValue === AttributeDataType.Decimal ||\r\n dataTypeValue === AttributeDataType.Integer\r\n );\r\n}\r\n\r\n/**\r\n * Find the refinement criterion associated with this product refiner value.\r\n * @param productRefinerValue Product refiner value to match.\r\n * @param refinementCriteria Selected refinement criteria.\r\n */\r\nexport function findMatchingRefinementCriterion(\r\n productRefinerValue: ProductRefinerValue,\r\n refinementCriteria: ProductRefinerValue[]\r\n): ProductRefinerValue | undefined {\r\n // If the value is a range, then match only on data type value; otherwise match on item string\r\n return refinementCriteria.find((refinementCriterion: ProductRefinerValue) =>\r\n isMatchingRefinementCriterion(productRefinerValue, refinementCriterion)\r\n );\r\n}\r\n\r\n/**\r\n * Find the refinement criterion associated with this product refiner value.\r\n * @param productRefinerValue Product refiner value to match.\r\n * @param refinementCriteria Selected refinement criteria.\r\n * @param refinementCriterion\r\n */\r\nexport function isMatchingRefinementCriterion(productRefinerValue: ProductRefinerValue, refinementCriterion: ProductRefinerValue): boolean {\r\n // If the value is a range, then match only on data type value; otherwise match on item string\r\n return (\r\n refinementCriterion.RefinerRecordId === productRefinerValue.RefinerRecordId &&\r\n refinementCriterion.RefinerSourceValue === productRefinerValue.RefinerSourceValue &&\r\n refinementCriterion.DataTypeValue === productRefinerValue.DataTypeValue &&\r\n (isRangeType(refinementCriterion.DataTypeValue) ||\r\n refinementCriterion.LeftValueBoundString === productRefinerValue.LeftValueBoundString)\r\n );\r\n}\r\n\r\nexport function getUpdatedRefinementCriteria(\r\n itemToggleNotification: IRefineItemToggleNotification,\r\n currentRefinementCriteria: ProductRefinerValue[]\r\n): ProductRefinerValue[] {\r\n const updatedRefinementCriteria: ProductRefinerValue[] = [];\r\n let toggledItemFound = false;\r\n currentRefinementCriteria.forEach((selectedCriterion: ProductRefinerValue) => {\r\n if (isMatchingRefinementCriterion(itemToggleNotification.productRefinerValue, selectedCriterion)) {\r\n toggledItemFound = true;\r\n if (itemToggleNotification.isSelecting) {\r\n const next = {\r\n ...selectedCriterion,\r\n LeftValueBoundString:\r\n (itemToggleNotification.rangeStart !== undefined && `${itemToggleNotification.rangeStart}`) ||\r\n selectedCriterion.LeftValueBoundString,\r\n RightValueBoundString:\r\n (itemToggleNotification.rangeEnd !== undefined && `${itemToggleNotification.rangeEnd}`) ||\r\n selectedCriterion.RightValueBoundString\r\n };\r\n updatedRefinementCriteria.push(next);\r\n } // Else the item is being de-selected, so omit it from the refinement criteria\r\n } else {\r\n // Keep existing criterion because it is not in the item toggle notification\r\n updatedRefinementCriteria.push(selectedCriterion);\r\n }\r\n });\r\n\r\n if (!toggledItemFound) {\r\n const next = {\r\n ...itemToggleNotification.productRefinerValue,\r\n LeftValueBoundString:\r\n (itemToggleNotification.rangeStart !== undefined && `${itemToggleNotification.rangeStart}`) ||\r\n itemToggleNotification.productRefinerValue.LeftValueBoundString,\r\n RightValueBoundString:\r\n (itemToggleNotification.rangeEnd !== undefined && `${itemToggleNotification.rangeEnd}`) ||\r\n itemToggleNotification.productRefinerValue.RightValueBoundString\r\n };\r\n updatedRefinementCriteria.push(next);\r\n\r\n // If single select, then deselect any others in the parent refiner group\r\n if (\r\n (itemToggleNotification.productRefinerValue.DataTypeValue === AttributeDataType.Text ||\r\n itemToggleNotification.productRefinerValue.DataTypeValue === AttributeDataType.TrueFalse) &&\r\n itemToggleNotification.parentProductRefinerHierarchy.RefinerTypeValue === RefinerType.SingleSelect\r\n ) {\r\n itemToggleNotification.parentProductRefinerHierarchy.Values.forEach((child: ProductRefinerValue) => {\r\n if (child.RefinerRecordId === next.RefinerRecordId && child.LeftValueBoundString === next.LeftValueBoundString) {\r\n // Do nothing\r\n } else {\r\n const matchingIndex = updatedRefinementCriteria.findIndex((criterion: ProductRefinerValue) =>\r\n isMatchingRefinementCriterion(child, criterion)\r\n );\r\n if (matchingIndex > -1) {\r\n updatedRefinementCriteria.splice(matchingIndex, 1);\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n return updatedRefinementCriteria;\r\n}\r\n\r\nexport function formatPrice(\r\n amount: string | undefined,\r\n currency: string | undefined,\r\n locale: string | undefined,\r\n telemetry: ITelemetry\r\n): string {\r\n if (!amount || !currency) {\r\n telemetry.trace(`[refine-menu.utilities.formatPrice] could not format price for ${amount} ${currency}`);\r\n return amount || '';\r\n }\r\n const priceAmount = (amount && Number(amount)) || 0;\r\n let result: string;\r\n\r\n try {\r\n result = new Intl.NumberFormat(locale, {\r\n style: 'currency',\r\n currencyDisplay: 'symbol',\r\n currency,\r\n minimumFractionDigits: 0\r\n }).format(priceAmount);\r\n } catch (error) {\r\n result = `${priceAmount} ${currency}`;\r\n telemetry.warning(`[refine-menu.utilities.formatPrice] Failed to format price for ${result}: ${error}`);\r\n }\r\n\r\n return result;\r\n}\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport { ProductRefinerValue } from '@msdyn365-commerce/retail-proxy';\r\nimport { getPayloadObject, getTelemetryAttributes, IPayLoad } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport { computed } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\n\r\nimport { ProductListInventoryFilteringOptions } from '../actions';\r\nimport { IChoiceSummaryProps } from './choice-summary.props';\r\nimport { isMatchingRefinementCriterion, isRangeType } from './utilities';\r\n\r\ninterface IRefinerMap {\r\n key: string;\r\n value: ProductRefinerValue;\r\n}\r\n\r\n/**\r\n * ChoiceSummary component.\r\n */\r\n@observer\r\nexport default class ChoiceSummary extends React.PureComponent {\r\n private readonly closeButtonGlyph: string = 'msi-close-btn';\r\n\r\n private readonly payLoad: IPayLoad;\r\n\r\n @computed get selectedRefinersMap(): IRefinerMap[] {\r\n let { selectedChoices } = this.props;\r\n const { channelInventoryConfigurationId, refinerHierarchy } = this.props;\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- app configs are of generic type\r\n if (this.props.context?.app.config.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS) {\r\n selectedChoices = selectedChoices.filter(choice => {\r\n const parent = refinerHierarchy.find(\r\n (hierarchy: IProductRefinerHierarchy) =>\r\n !!hierarchy.Values.find((value: ProductRefinerValue) => isMatchingRefinementCriterion(value, choice))\r\n );\r\n return parent && parent.RecordId !== channelInventoryConfigurationId;\r\n });\r\n }\r\n return selectedChoices.map((selectedRefiner: ProductRefinerValue) => {\r\n return {\r\n key: this._getKeyForRefinerValue(selectedRefiner),\r\n value: selectedRefiner\r\n } as IRefinerMap;\r\n });\r\n }\r\n\r\n constructor(props: Readonly) {\r\n super(props);\r\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, '');\r\n }\r\n\r\n public render(): JSX.Element {\r\n const { clearAllText, label, classNames, choiceAriaLabel, closeAriaLabel } = this.props;\r\n const items = this.selectedRefinersMap;\r\n this.payLoad.contentAction.etext = clearAllText;\r\n const clearAllAttributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\r\n return (\r\n
\r\n {items.length > 0 && label && {label}}\r\n
    \r\n {items.map((item: IRefinerMap) => {\r\n this.payLoad.contentAction.etext = item.key;\r\n const attribute = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\r\n\r\n return (\r\n
  • \r\n \r\n {item.key}\r\n \r\n \r\n
  • \r\n );\r\n })}\r\n
\r\n {items.length > 0 && clearAllText && (\r\n \r\n {clearAllText}\r\n \r\n )}\r\n
\r\n );\r\n }\r\n\r\n private _getKeyForRefinerValue(productRefinerValue: ProductRefinerValue): string {\r\n const { choiceFormat, choiceRangeValueFormat, refinerHierarchy, telemetry } = this.props;\r\n const overallFormat = choiceFormat || '{1}';\r\n const rangeFormat = choiceRangeValueFormat;\r\n let refinerName = '';\r\n if (refinerHierarchy && refinerHierarchy.find) {\r\n const parent = refinerHierarchy.find(\r\n (hierarchy: IProductRefinerHierarchy) =>\r\n !!hierarchy.Values.find((value: ProductRefinerValue) => isMatchingRefinementCriterion(value, productRefinerValue))\r\n );\r\n\r\n if (!parent) {\r\n telemetry.warning('[choice-summary] could not find parent of selected refiner value');\r\n } else {\r\n refinerName = parent.KeyName || '';\r\n }\r\n }\r\n\r\n let refinerValueName: string;\r\n if (isRangeType(productRefinerValue.DataTypeValue)) {\r\n refinerValueName = rangeFormat\r\n .replace('{0}', this._formatPrice(productRefinerValue.LeftValueBoundString, productRefinerValue.UnitText))\r\n .replace('{1}', this._formatPrice(productRefinerValue.RightValueBoundString, productRefinerValue.UnitText));\r\n } else {\r\n refinerValueName = productRefinerValue.LeftValueBoundLocalizedString || productRefinerValue.LeftValueBoundString || '';\r\n }\r\n\r\n return overallFormat.replace('{0}', refinerName).replace('{1}', refinerValueName);\r\n }\r\n\r\n private _formatPrice(amount: string | undefined, currency: string | undefined): string {\r\n if (!amount || !currency) {\r\n this.props.telemetry.trace('[choice-summary] could not format price');\r\n return amount || '';\r\n }\r\n let result = amount;\r\n\r\n try {\r\n result = this.props.context!.cultureFormatter.formatCurrency(Number(amount), currency);\r\n } catch (error) {\r\n this.props.telemetry.warning(`Failed to format price for ${result}: ${error}`);\r\n }\r\n\r\n return result;\r\n }\r\n\r\n private readonly _onClick = (e: React.MouseEvent): void => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n\r\n const target = e.currentTarget as HTMLElement;\r\n const clearAll = target.getAttribute('class')!.includes('choice-summary__clear-all');\r\n const selectedRefiner = clearAll ? undefined : this._getSelectedRefinerChoice(target);\r\n\r\n if (this.props.onChoiceClicked) {\r\n this.props.onChoiceClicked({\r\n clearAll,\r\n itemClicked: target,\r\n choiceClicked: selectedRefiner,\r\n nextItemToFocus: target.nextSibling as HTMLElement\r\n });\r\n }\r\n };\r\n\r\n private _getSelectedRefinerChoice(itemClicked: HTMLElement): ProductRefinerValue | undefined {\r\n const result = this.selectedRefinersMap.find(\r\n selected => (itemClicked.textContent && itemClicked.textContent.trim()) === selected.key\r\n );\r\n return (result && result.value) || undefined;\r\n }\r\n}\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport * as React from 'react';\r\n\r\ninterface IErrorMessage {\r\n text?: string;\r\n}\r\n\r\nexport const ErrorMessage: React.FC = ({ text }) => {\r\n return (\r\n \r\n
{text}
\r\n
\r\n );\r\n};\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { ICoreContext, IGridSettings, IImageData, IImageSettings, Image, IRequestContext } from '@msdyn365-commerce/core';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { getFallbackImageUrl, getProductPageUrlSync } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent, onTelemetryClick } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { ISgiSearchNewArrivalsContainerResources } from '../sgi-search-new-arrivals-container.props.autogenerated';\r\n\r\n// Import { IComponent, IComponentProps, ICoreContext, IGridSettings, IImageData, IImageSettings, Image, msdyn365Commerce } from '@msdyn365-commerce/core';\r\n\r\ninterface IFeatureSearchResultItem {\r\n product: SimpleProduct | null;\r\n context: ICoreContext;\r\n resources: ISgiSearchNewArrivalsContainerResources;\r\n imageSettings?: IImageSettings;\r\n moduleType: string;\r\n moduleId: string;\r\n telemetryContent?: ITelemetryContent;\r\n recommendation?: string;\r\n}\r\n\r\nexport const FeatureSearchResultItem: React.FC = ({\r\n product,\r\n context,\r\n imageSettings,\r\n resources,\r\n telemetryContent,\r\n recommendation\r\n}) => {\r\n if (product === null) {\r\n return null;\r\n }\r\n\r\n const productName = product.Name;\r\n const productRecordId = product && product.RecordId ? product.RecordId : 0;\r\n const productUrl = getProductPageUrlSync(product.Name || '', productRecordId, context && context.actionContext, undefined);\r\n const fallbackImage = getFallbackImageUrl(product.ItemId, context.actionContext.requestContext.apiSettings);\r\n const heading =\r\n recommendation && recommendation === 'descriptions' ? resources.featureSimilarDescriptionTitle : resources.featureSimilarLooksTitle;\r\n\r\n // Construct telemetry attribute to render\r\n const payLoad = getPayloadObject('click', telemetryContent!, productName!, productRecordId.toString());\r\n\r\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\r\n return (\r\n
\r\n \r\n
\r\n {renderProductPlacementImage(\r\n imageSettings,\r\n context.request.gridSettings,\r\n product.PrimaryImageUrl,\r\n product.Name,\r\n fallbackImage,\r\n context.actionContext.requestContext\r\n )}\r\n
\r\n \r\n
\r\n

{heading}

\r\n {renderProductTitle(product?.Name)}\r\n
\r\n
\r\n );\r\n};\r\n\r\nfunction renderProductPlacementImage(\r\n imageSettings?: IImageSettings,\r\n gridSettings?: IGridSettings,\r\n imageUrl?: string,\r\n altText?: string,\r\n fallbackImage?: string,\r\n context?: IRequestContext\r\n): JSX.Element | null {\r\n if (!imageUrl || !gridSettings || !imageSettings) {\r\n return null;\r\n }\r\n const img: IImageData = {\r\n src: imageUrl,\r\n altText: altText ? altText : ''\r\n };\r\n const imageProps = {\r\n gridSettings,\r\n imageSettings,\r\n fallBackSrc: fallbackImage\r\n };\r\n return ;\r\n}\r\n\r\nfunction renderProductTitle(title?: string): JSX.Element | null {\r\n return

{title}

;\r\n}\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport * as React from 'react';\r\n\r\ninterface ILink {\r\n className?: string;\r\n text?: string;\r\n href?: string;\r\n ariaLabel?: string;\r\n}\r\n\r\nexport const Link: React.FC = ({ text, className, href, ariaLabel }) => (\r\n \r\n {' '}\r\n {text}{' '}\r\n \r\n);\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { Button, Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\r\nimport React from 'react';\r\n\r\nexport interface ISearchResultModalViewProps {\r\n modal: React.ReactElement;\r\n modalHeader: React.ReactElement;\r\n modalFooter: React.ReactElement;\r\n modalBody: React.ReactElement;\r\n}\r\n\r\ninterface IModalToggleProps {\r\n innerRef: React.RefObject | undefined;\r\n id: string;\r\n text: string;\r\n ariaLabel: string;\r\n onClick(): void;\r\n}\r\n\r\nexport interface ISearchResultModalResources {\r\n modalTitle: string;\r\n modalCloseButtonText: string;\r\n}\r\n\r\nexport interface ISearchResultModalProps {\r\n resources: ISearchResultModalResources;\r\n isOpen: boolean;\r\n returnRef: React.RefObject | undefined;\r\n onModalToggle(): void;\r\n}\r\n\r\nexport const ModalToggle: React.FC = (props: IModalToggleProps) => {\r\n const { text, onClick, ariaLabel, innerRef, id } = props;\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport const SearchResultModal = (props: ISearchResultModalProps): ISearchResultModalViewProps => {\r\n return {\r\n modal: modalNode(props),\r\n modalHeader: modalHeaderNode(props),\r\n modalFooter: modalFooterNode(props),\r\n modalBody: \r\n };\r\n};\r\n\r\nconst modalNode = (props: ISearchResultModalProps) => {\r\n return (\r\n \r\n );\r\n};\r\n\r\nconst modalHeaderNode = (props: ISearchResultModalProps) => {\r\n return {props.resources.modalTitle};\r\n};\r\n\r\nconst modalFooterNode = (props: ISearchResultModalProps) => {\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IProductsDimensionsAvailabilities } from '@msdyn365-commerce/commerce-entities';\r\nimport { IPriceComponentResources, ProductComponent } from '@msdyn365-commerce/components';\r\nimport { ICoreContext, IImageSettings } from '@msdyn365-commerce/core';\r\nimport { ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { ISgiSearchNewArrivalsContainerResources } from '../sgi-search-new-arrivals-container.props.autogenerated';\r\n\r\ninterface IProductSearchResultItems {\r\n products: ProductSearchResult[];\r\n context: ICoreContext;\r\n resources: ISgiSearchNewArrivalsContainerResources;\r\n imageSettings?: IImageSettings;\r\n moduleType: string;\r\n moduleId: string;\r\n allowBackNavigation?: boolean;\r\n telemetryContent: ITelemetryContent;\r\n quickviewSlot?: {} | null | undefined;\r\n channelInventoryConfigurationId?: number;\r\n isPriceMinMaxEnabled?: boolean;\r\n productsDimensionAvailabilities?: IProductsDimensionsAvailabilities[][];\r\n}\r\n\r\n/**\r\n * Returns the product inventory label.\r\n * @param channelInventoryConfigurationId - The channel configuration Id.\r\n * @param product - The product.\r\n * @returns The inventory label.\r\n */\r\nexport function getInventoryLabel(channelInventoryConfigurationId: number | undefined, product: ProductSearchResult): string | undefined {\r\n if (!channelInventoryConfigurationId || !ArrayExtensions.hasElements(product.AttributeValues)) {\r\n return undefined;\r\n }\r\n const inventoryAttribute = product.AttributeValues.find(attribute => attribute.RecordId === channelInventoryConfigurationId);\r\n if (inventoryAttribute) {\r\n return inventoryAttribute.TextValue;\r\n }\r\n return undefined;\r\n}\r\n\r\nexport const ProductSearchResultItems: React.FC = ({\r\n products,\r\n context,\r\n imageSettings,\r\n resources,\r\n moduleType,\r\n moduleId,\r\n allowBackNavigation,\r\n telemetryContent,\r\n quickviewSlot,\r\n channelInventoryConfigurationId,\r\n isPriceMinMaxEnabled,\r\n productsDimensionAvailabilities\r\n}) => {\r\n const priceResources: IPriceComponentResources = {\r\n priceRangeSeparator: resources.priceRangeSeparator\r\n };\r\n return (\r\n
    \r\n {products.map((product: ProductSearchResult, index: number) => (\r\n
  • \r\n \r\n ArrayExtensions.hasElements(dimensionAvailability) &&\r\n dimensionAvailability[0].masterProductId === product.MasterProductId\r\n )}\r\n />\r\n
  • \r\n ))}\r\n
\r\n );\r\n};\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { ISliderLabel, ISliderThumbProps, Slider } from '@msdyn365-commerce-modules/utilities';\r\nimport debounce from 'lodash/debounce';\r\nimport { computed } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\n\r\nimport { IRefineItemProps, IRefineItemState } from './refine-item';\r\n\r\ntype InputType = 'Min' | 'Max';\r\n\r\nexport type RangeRefineItemType = 'slider' | 'input';\r\n\r\n/**\r\n * Range refine item properties.\r\n */\r\nexport interface IRangeRefineItemProps extends IRefineItemProps {\r\n rangeType: RangeRefineItemType;\r\n minValueSliderThumbAriaLabel?: string;\r\n maxValueSliderThumbAriaLabel?: string;\r\n sliderKey?: string;\r\n}\r\n\r\n/**\r\n * Range refine item state.\r\n */\r\nexport interface IRangeRefineItemState extends IRefineItemState {\r\n validationErrorMin: string | undefined;\r\n validationErrorMax: string | undefined;\r\n selectedMin: string | undefined;\r\n selectedMax: string | undefined;\r\n touchedMin: boolean;\r\n touchedMax: boolean;\r\n sliderId: string;\r\n minValue: string | undefined;\r\n maxValue: string | undefined;\r\n labels: ISliderLabel[];\r\n sliderThumbs: ISliderThumbProps[];\r\n}\r\n\r\n/**\r\n * RangeRefineItem component (controlled by RefineSubmenu).\r\n */\r\n@observer\r\nexport default class RangeRefineItem extends React.Component {\r\n private readonly _formattedPriceReverseLookup: Map = new Map();\r\n\r\n private readonly minInput: React.RefObject;\r\n\r\n private readonly maxInput: React.RefObject;\r\n\r\n @computed get currencyCode(): string {\r\n return this.props.productRefinerValue.UnitText || '';\r\n }\r\n\r\n public constructor(props: IRangeRefineItemProps) {\r\n super(props);\r\n this._onRangeUpdate = this._onRangeUpdate.bind(this);\r\n this._onRangeUpdateEnd = this._onRangeUpdateEnd.bind(this);\r\n this._handleRangeTooltipText = this._handleRangeTooltipText.bind(this);\r\n this._changeMin = this._changeMin.bind(this);\r\n this._changeMax = this._changeMax.bind(this);\r\n this._finishChangeMin = this._finishChangeMin.bind(this);\r\n this._finishChangeMax = this._finishChangeMax.bind(this);\r\n\r\n this.minInput = React.createRef();\r\n this.maxInput = React.createRef();\r\n\r\n const { selectedRefinementCriterion } = this.props;\r\n const initialMin = selectedRefinementCriterion?.LeftValueBoundString ?? '0';\r\n const initialMax = selectedRefinementCriterion?.RightValueBoundString;\r\n const sliderId = `slider_${String(this.props.parentProductRefinerHierarchy.RecordId)}_${String(\r\n this.props.productRefinerValue.RefinerRecordId\r\n )}`;\r\n const minValue = this.props.productRefinerValue.LeftValueBoundString;\r\n const maxValue = this.props.productRefinerValue.RightValueBoundString;\r\n const minPrice = this._formatPrice(minValue);\r\n const maxPrice = this._formatPrice(maxValue);\r\n const labels: ISliderLabel[] = this.getLabels(sliderId, minPrice, maxPrice);\r\n const selectedMin =\r\n this.props.selectedRefinementCriterion?.LeftValueBoundString ?? this.props.productRefinerValue.LeftValueBoundString ?? '0';\r\n const selectedMax =\r\n this.props.selectedRefinementCriterion?.RightValueBoundString ??\r\n this.props.productRefinerValue.RightValueBoundString ??\r\n maxValue;\r\n const selectedMinPrice = this._formatPrice(selectedMin);\r\n const selectedMaxPrice = this._formatPrice(selectedMax);\r\n const sliderKeyString = this.props.sliderKey ? `_${String(this.props.sliderKey)}` : '';\r\n const sliderThumbs: ISliderThumbProps[] = this.getSliderThumbs(\r\n sliderId,\r\n sliderKeyString,\r\n selectedMin,\r\n selectedMinPrice,\r\n selectedMax,\r\n selectedMaxPrice,\r\n maxPrice\r\n );\r\n this.state = {\r\n isChecked: false,\r\n validationErrorMin: undefined,\r\n validationErrorMax: undefined,\r\n selectedMin: initialMin,\r\n selectedMax: initialMax,\r\n touchedMin: false,\r\n touchedMax: false,\r\n sliderId,\r\n minValue,\r\n maxValue,\r\n labels,\r\n sliderThumbs\r\n };\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: IRangeRefineItemProps, nextState: IRangeRefineItemState): boolean {\r\n if (this.state === nextState && this.props === nextProps) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n public componentDidUpdate(previousProps: IRangeRefineItemProps): void {\r\n if (previousProps !== this.props) {\r\n this.updateSliderProps();\r\n }\r\n }\r\n\r\n public render(): JSX.Element | undefined {\r\n const { productRefinerValue, parentProductRefinerHierarchy, refineItemCommonProps } = this.props;\r\n\r\n if (!productRefinerValue || !parentProductRefinerHierarchy) {\r\n refineItemCommonProps.telemetry.error(\r\n 'Cannot render refine value range without productRefinerValue and parentProductRefinerHierarchy'\r\n );\r\n return undefined;\r\n }\r\n\r\n if (this.props.rangeType === 'input') {\r\n return this._renderInputFields();\r\n }\r\n\r\n return this._renderSlider();\r\n }\r\n\r\n /**\r\n * Function to update slider props.\r\n */\r\n private updateSliderProps(): void {\r\n const sliderId = `slider_${String(this.props.parentProductRefinerHierarchy.RecordId)}_${String(\r\n this.props.productRefinerValue.RefinerRecordId\r\n )}`;\r\n const minValue = this.props.productRefinerValue.LeftValueBoundString;\r\n const maxValue = this.props.productRefinerValue.RightValueBoundString;\r\n const minPrice = this._formatPrice(minValue);\r\n const maxPrice = this._formatPrice(maxValue);\r\n const labels: ISliderLabel[] = this.getLabels(sliderId, minPrice, maxPrice);\r\n const selectedMin =\r\n this.props.selectedRefinementCriterion?.LeftValueBoundString ?? this.props.productRefinerValue.LeftValueBoundString ?? '0';\r\n const selectedMax =\r\n this.props.selectedRefinementCriterion?.RightValueBoundString ??\r\n this.props.productRefinerValue.RightValueBoundString ??\r\n maxValue;\r\n const selectedMinPrice = this._formatPrice(selectedMin);\r\n const selectedMaxPrice = this._formatPrice(selectedMax);\r\n const sliderKeyString = this.props.sliderKey ? `_${String(this.props.sliderKey)}` : '';\r\n const sliderThumbs: ISliderThumbProps[] = this.getSliderThumbs(\r\n sliderId,\r\n sliderKeyString,\r\n selectedMin,\r\n selectedMinPrice,\r\n selectedMax,\r\n selectedMaxPrice,\r\n maxPrice\r\n );\r\n this.setState({ sliderId, minValue, maxValue, labels, sliderThumbs });\r\n }\r\n\r\n /**\r\n * Function to create the labels for slider.\r\n * @param sliderId - Slider element id for the DOM.\r\n * @param minPrice - Slider min value.\r\n * @param maxPrice - Slider max value.\r\n * @returns Array labels.\r\n */\r\n private readonly getLabels = (sliderId: string, minPrice: string, maxPrice: string): ISliderLabel[] => {\r\n return [\r\n {\r\n labelId: `${sliderId}_start`,\r\n labelString: `${minPrice}`,\r\n labelPositioning: 'start'\r\n },\r\n {\r\n labelId: `${sliderId}_end`,\r\n labelString: `${maxPrice}`,\r\n labelPositioning: 'end'\r\n }\r\n ];\r\n };\r\n\r\n /**\r\n * Function to create the slider thumbs for slider.\r\n * @param sliderId - Slider element id for the DOM.\r\n * @param sliderKey - Unique key for slider.\r\n * @param selectedMin - Slider selected min value.\r\n * @param selectedMinPrice - Slider selected min price.\r\n * @param selectedMax - Slider selected max value.\r\n * @param selectedMaxPrice - Slider selected max price..\r\n * @param maxPrice - Slider max price..\r\n * @returns Slider Thumb Props.\r\n */\r\n private readonly getSliderThumbs = (\r\n sliderId: string,\r\n sliderKey: string,\r\n selectedMin: string,\r\n selectedMinPrice: string,\r\n selectedMax: string | undefined,\r\n selectedMaxPrice: string,\r\n maxPrice: string\r\n ): ISliderThumbProps[] => {\r\n const sliderThumbDefaultValue = 0;\r\n return [\r\n {\r\n id: `${sliderId}${sliderKey}_slider_thumb_start`,\r\n value: (selectedMin && Number(selectedMin)) || sliderThumbDefaultValue,\r\n ariaLabel: `${this.props.minValueSliderThumbAriaLabel ?? ''} ${this.currencyCode}`,\r\n ariaValueText: `${selectedMinPrice}`\r\n },\r\n {\r\n id: `${sliderId}${sliderKey}_slider_thumb_end`,\r\n value: Number(selectedMax) || Number(maxPrice),\r\n ariaLabel: `${this.props.maxValueSliderThumbAriaLabel ?? ''} ${this.currencyCode}`,\r\n ariaValueText: `${selectedMaxPrice}`\r\n }\r\n ];\r\n };\r\n\r\n private _renderInputFields(): JSX.Element | undefined {\r\n const { isDisabled, parentProductRefinerHierarchy, refineItemCommonProps } = this.props;\r\n const { selectedMin, selectedMax, touchedMin, touchedMax, validationErrorMin, validationErrorMax } = this.state;\r\n\r\n const rangeAriaLabel = (refineItemCommonProps.rangeNameFormat || '{0}').replace('{0}', parentProductRefinerHierarchy.KeyName || '');\r\n const formAttrs = {\r\n 'aria-label': rangeAriaLabel,\r\n 'aria-disabled': isDisabled\r\n };\r\n\r\n // To enable price formatting of selected fields, this is the approach:\r\n // initial value: min=0 formatted as price, max=undefined\r\n // onFocus/onChange: convert to number (unformat) and mark as touched to indicate value is being edited\r\n // onBlur: validate and format entered value as price\r\n const minInputClassName = `ms-refine-submenu__input-range refine-submenu__input-range-min ${\r\n validationErrorMin ? 'refine-submenu__input-range--error' : ''\r\n }`;\r\n const maxInputClassName = `ms-refine-submenu__input-range refine-submenu__input-range-max ${\r\n validationErrorMax ? 'refine-submenu__input-range--error' : ''\r\n }`;\r\n const minLabelClassName = 'ms-refine-submenu__input-range-label refine-submenu__input-range-label-min';\r\n const maxLabelClassName = 'ms-refine-submenu__input-range-label refine-submenu__input-range-label-max';\r\n const formattedSelectedMin = this._getFormattedSelectedValue(selectedMin, touchedMin, validationErrorMin);\r\n const formattedSelectedMax = this._getFormattedSelectedValue(selectedMax, touchedMax, validationErrorMax);\r\n return (\r\n
\r\n \r\n \r\n {validationErrorMin && (\r\n \r\n {validationErrorMin}\r\n \r\n )}\r\n {validationErrorMax && validationErrorMin !== validationErrorMax && (\r\n \r\n {validationErrorMax}\r\n \r\n )}\r\n
\r\n );\r\n }\r\n\r\n private _renderSlider(): JSX.Element | undefined {\r\n const { isDisabled, sliderKey } = this.props;\r\n const ariaAttributes = {\r\n 'aria-disabled': isDisabled\r\n };\r\n\r\n return (\r\n \r\n );\r\n }\r\n\r\n private _changeMin(event: React.FocusEvent): void {\r\n this._changeValue(event, 'Min');\r\n }\r\n\r\n private _changeMax(event: React.FocusEvent): void {\r\n this._changeValue(event, 'Max');\r\n }\r\n\r\n private _changeValue(event: React.FocusEvent, inputType: InputType): void {\r\n const selectedKey = `selected${inputType}`;\r\n const touchedKey = `touched${inputType}`;\r\n this.setState({\r\n [selectedKey]: this._getInputWithoutFormatting(event.currentTarget.value),\r\n [touchedKey]: true\r\n });\r\n }\r\n\r\n private _finishChangeMin(event: React.FocusEvent): boolean {\r\n const selectedMinValue = this._getInputWithoutFormatting(event.currentTarget.value);\r\n this.setState({\r\n selectedMin: selectedMinValue,\r\n minTouched: false\r\n });\r\n const minInput = Number(selectedMinValue);\r\n const {\r\n onToggle,\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n refineItemCommonProps,\r\n selectedRefinementCriterion\r\n } = this.props;\r\n const max = (selectedRefinementCriterion && selectedRefinementCriterion.RightValueBoundString) || undefined;\r\n\r\n const maxNum = max ? Number(max) : undefined;\r\n\r\n if (isNaN(minInput)) {\r\n this.setState({ validationErrorMin: refineItemCommonProps.validationErrorNaN });\r\n this._focus('Min');\r\n return false;\r\n }\r\n\r\n if (this._validateRange(minInput, maxNum)) {\r\n onToggle({\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n isSelecting: true,\r\n rangeStart: minInput,\r\n rangeEnd: maxNum\r\n });\r\n return true;\r\n }\r\n this._focus('Min');\r\n\r\n return false;\r\n }\r\n\r\n private _finishChangeMax(event: React.FocusEvent): boolean {\r\n const selectedMaxValue = this._getInputWithoutFormatting(event.currentTarget.value);\r\n this.setState({\r\n selectedMax: selectedMaxValue,\r\n maxTouched: false\r\n });\r\n const maxInput = Number(selectedMaxValue);\r\n const {\r\n onToggle,\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n refineItemCommonProps,\r\n selectedRefinementCriterion\r\n } = this.props;\r\n const min = (selectedRefinementCriterion && selectedRefinementCriterion.LeftValueBoundString) || '0';\r\n\r\n const minNum = Number(min);\r\n\r\n if (isNaN(maxInput)) {\r\n this.setState({ validationErrorMax: refineItemCommonProps.validationErrorNaN });\r\n this._focus('Max');\r\n return false;\r\n }\r\n\r\n if (this._validateRange(minNum, maxInput)) {\r\n if (productRefinerValue) {\r\n onToggle({\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n isSelecting: true,\r\n rangeStart: minNum,\r\n rangeEnd: maxInput\r\n });\r\n } else {\r\n this._focus('Max');\r\n }\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private _focus(inputType: InputType): void {\r\n const ref = inputType === 'Max' ? this.maxInput : this.minInput;\r\n\r\n setTimeout(() => {\r\n if (ref && ref.current) {\r\n ref.current.focus();\r\n }\r\n }, 50);\r\n }\r\n\r\n private _getFormattedSelectedValue(\r\n selected: string | undefined,\r\n touched: boolean,\r\n validationError: string | undefined\r\n ): string | undefined {\r\n if (touched || validationError || selected === undefined) {\r\n return selected;\r\n }\r\n return this._formatPrice(selected);\r\n }\r\n\r\n private _validateRange(min: number, max: number | undefined): boolean {\r\n const { refineItemCommonProps } = this.props;\r\n if (max === undefined) {\r\n return true;\r\n }\r\n\r\n if (min > max) {\r\n this.setState({\r\n validationErrorMin: refineItemCommonProps.validationErrorRange,\r\n validationErrorMax: refineItemCommonProps.validationErrorRange\r\n });\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n private _formatPrice(amount: string | undefined): string {\r\n const result = this.props.context.cultureFormatter.formatCurrency(Number(amount), this.currencyCode);\r\n return result;\r\n }\r\n\r\n private _getInputWithoutFormatting(input: string): string {\r\n // First try to cast raw input to a number\r\n const inputAsNum = Number(input);\r\n if (!isNaN(inputAsNum)) {\r\n return input;\r\n }\r\n\r\n // Otherwise try a reverse lookup and fall back to the raw input if all else fails\r\n const reverseLookupResult = this._formattedPriceReverseLookup.get(input);\r\n return reverseLookupResult || input;\r\n }\r\n\r\n // NOTE: Fix types once Shared Components build pipeline bug fixed\r\n private _onRangeUpdate(sliderChangeNotification: any): void {\r\n // Need to filter out mousemove events as these cause errors after the menu updates and slider re-renders\r\n if (sliderChangeNotification.eventType !== 'mousemove') {\r\n const { onToggle, parentProductRefinerHierarchy, productRefinerValue } = this.props;\r\n if (productRefinerValue && sliderChangeNotification) {\r\n onToggle({\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n isSelecting: true,\r\n rangeStart: sliderChangeNotification.firstThumbValue,\r\n rangeEnd: sliderChangeNotification.secondThumbValue\r\n });\r\n\r\n this._focusOnSliderThumb(sliderChangeNotification);\r\n }\r\n }\r\n }\r\n\r\n private _onRangeUpdateEnd(sliderChangeNotification: any): void {\r\n const { onToggle, parentProductRefinerHierarchy, productRefinerValue } = this.props;\r\n if (productRefinerValue && sliderChangeNotification) {\r\n onToggle({\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n isSelecting: true,\r\n rangeStart: sliderChangeNotification.firstThumbValue,\r\n rangeEnd: sliderChangeNotification.secondThumbValue\r\n });\r\n\r\n this._focusOnSliderThumb(sliderChangeNotification);\r\n }\r\n }\r\n\r\n private _focusOnSliderThumb(sliderChangeNotification: any): void {\r\n if (sliderChangeNotification.id) {\r\n const element = document.getElementById(`${sliderChangeNotification.id}range`);\r\n if (element) {\r\n setTimeout(() => {\r\n element.focus();\r\n }, 0);\r\n }\r\n }\r\n }\r\n\r\n private _handleRangeTooltipText(tooltip: number): string {\r\n return this._formatPrice(`${tooltip}`);\r\n }\r\n}\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport { RatingComponent, SwatchComponent } from '@msdyn365-commerce/components';\r\nimport { IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\r\nimport { ProductRefinerSource, ProductRefinerValue, RefinerType } from '@msdyn365-commerce/retail-proxy';\r\nimport { checkIfShouldDisplayAsSwatch, DimensionTypes, IDimensionsApp, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { format, getPayloadObject, getTelemetryAttributes, IPayLoad, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IRefineItemCommonProps } from './refine-item.props.common';\r\nimport { IRefineItemToggleNotification } from './refine-item-toggle-notification';\r\n\r\n/**\r\n * RefineItem properties.\r\n */\r\nexport interface IRefineItemProps {\r\n parentProductRefinerHierarchy: IProductRefinerHierarchy;\r\n productRefinerValue: ProductRefinerValue;\r\n selectedRefinementCriterion: ProductRefinerValue | undefined;\r\n selectedRefinerValues?: ProductRefinerValue[];\r\n refineItemCommonProps: IRefineItemCommonProps;\r\n isDisabled: boolean;\r\n context: ICoreContext>;\r\n moduleId: string;\r\n moduleTypeName: string;\r\n index?: number;\r\n productCountAriaLabel?: string;\r\n singleProductCountAriaLabel?: string;\r\n refineItemAriaLabel?: string;\r\n refineItemsAriaLabel?: string;\r\n isMobileView?: boolean;\r\n\r\n /**\r\n * The telemetry content\r\n */\r\n telemetryContent?: ITelemetryContent;\r\n onToggle(notfication: Readonly): void;\r\n urlBuilder(refiner: IRefineItemToggleNotification): string;\r\n}\r\n\r\n/**\r\n * Refine item state.\r\n */\r\nexport interface IRefineItemState extends React.ComponentState {\r\n isChecked: boolean;\r\n renderingError?: object;\r\n}\r\n\r\n/**\r\n * Single-select and multi-select refine item component (controlled by RefineSubmenu).\r\n */\r\nexport default class RefineItem extends React.Component {\r\n private readonly anchorType: React.RefObject;\r\n\r\n private readonly payLoad: IPayLoad;\r\n\r\n public constructor(props: IRefineItemProps) {\r\n super(props);\r\n this._onClick = this._onClick.bind(this);\r\n this.state = {\r\n isChecked: !!this.props.selectedRefinementCriterion\r\n };\r\n this.anchorType = React.createRef();\r\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, '');\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: IRefineItemProps, nextState: IRefineItemState): boolean {\r\n if (this.state === nextState && this.props === nextProps) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n public render(): JSX.Element | undefined {\r\n const {\r\n isDisabled,\r\n refineItemCommonProps,\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n selectedRefinementCriterion,\r\n productCountAriaLabel,\r\n singleProductCountAriaLabel,\r\n index,\r\n children,\r\n onToggle,\r\n context,\r\n telemetryContent,\r\n refineItemAriaLabel,\r\n refineItemsAriaLabel,\r\n ...attrs\r\n } = this.props;\r\n if (!productRefinerValue) {\r\n refineItemCommonProps.telemetry.error('[refine-item] Cannot render refineItem without productRefinerValue');\r\n return undefined;\r\n }\r\n if (!productRefinerValue.LeftValueBoundString) {\r\n refineItemCommonProps.telemetry.warning(\r\n `[refine-item] RefineItem without LeftValueBoundString: ${JSON.stringify(productRefinerValue)}`\r\n );\r\n }\r\n const isSingleSelect = parentProductRefinerHierarchy.RefinerTypeValue === RefinerType.SingleSelect;\r\n let itemTypeClassName = isSingleSelect ? 'single-select' : 'multi-select';\r\n itemTypeClassName = `ms-refine-submenu-item ${itemTypeClassName}`;\r\n const inputType = isSingleSelect ? 'radio' : 'checkbox';\r\n const isChecked = !!selectedRefinementCriterion;\r\n itemTypeClassName = isChecked ? `${itemTypeClassName}-checked` : itemTypeClassName;\r\n if (parentProductRefinerHierarchy.SourceValue === ProductRefinerSource.Rating) {\r\n return this._renderRating(\r\n productRefinerValue,\r\n parentProductRefinerHierarchy,\r\n isChecked,\r\n context,\r\n index,\r\n telemetryContent,\r\n productCountAriaLabel,\r\n singleProductCountAriaLabel\r\n );\r\n }\r\n this.payLoad.contentAction.etext = productRefinerValue.LeftValueBoundLocalizedString ?? productRefinerValue.LeftValueBoundString;\r\n const attribute = getTelemetryAttributes(telemetryContent!, this.payLoad);\r\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Replace with actual value for empty string.\r\n const productText = productRefinerValue.LeftValueBoundLocalizedString || productRefinerValue.LeftValueBoundString || '';\r\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Replace with actual value for empty string.\r\n const productCount = productRefinerValue.Count || 0;\r\n let refineMenuItemAriaLabel;\r\n if (productCount === 1) {\r\n refineMenuItemAriaLabel = refineItemAriaLabel\r\n ? format(refineItemAriaLabel, parentProductRefinerHierarchy.KeyName, productText)\r\n : '';\r\n } else {\r\n refineMenuItemAriaLabel = refineItemsAriaLabel\r\n ? format(refineItemsAriaLabel, parentProductRefinerHierarchy.KeyName, productText, productCount)\r\n : '';\r\n }\r\n return (\r\n
  • \r\n \r\n {this._renderSwatch()}\r\n \r\n \r\n
  • \r\n );\r\n }\r\n\r\n private _renderSwatch(): JSX.Element | null {\r\n const productRefinerValue = this.props.productRefinerValue;\r\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Replace with actual value for empty string.\r\n const text = productRefinerValue.LeftValueBoundLocalizedString || productRefinerValue.LeftValueBoundString || '';\r\n\r\n const dimensionType = (this.props.parentProductRefinerHierarchy.KeyName?.toLocaleLowerCase() ?? '') as DimensionTypes;\r\n const hasColor = !StringExtensions.isNullOrWhitespace(productRefinerValue.SwatchColorHexCode);\r\n const hasImage = !StringExtensions.isNullOrWhitespace(productRefinerValue.SwatchImageUrl);\r\n const hasValidSwatch = hasColor || hasImage;\r\n const shouldDisplayAsSwatch =\r\n hasValidSwatch && checkIfShouldDisplayAsSwatch(dimensionType, this.props.context as ICoreContext);\r\n const swatchItems = shouldDisplayAsSwatch\r\n ? [\r\n {\r\n itemId: `${productRefinerValue.RefinerRecordId ?? ''}-${dimensionType}-${text}`,\r\n value: text,\r\n dimensionType,\r\n colorHexCode: productRefinerValue.SwatchColorHexCode,\r\n imageUrl: productRefinerValue.SwatchImageUrl\r\n }\r\n ]\r\n : undefined;\r\n\r\n if (!swatchItems) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n );\r\n }\r\n\r\n private _getRefinerUrl(): string {\r\n const { urlBuilder, parentProductRefinerHierarchy, productRefinerValue, selectedRefinementCriterion } = this.props;\r\n\r\n if (productRefinerValue) {\r\n return urlBuilder({\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n isSelecting: !selectedRefinementCriterion\r\n });\r\n }\r\n\r\n return '';\r\n }\r\n\r\n private readonly _onClick = (e: React.MouseEvent): void => {\r\n e.preventDefault();\r\n\r\n const { parentProductRefinerHierarchy, productRefinerValue, selectedRefinementCriterion } = this.props;\r\n if (productRefinerValue) {\r\n this.props.onToggle({\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n isSelecting: !selectedRefinementCriterion\r\n });\r\n\r\n setTimeout(() => {\r\n this.anchorType.current && this.anchorType.current.focus();\r\n }, 0);\r\n }\r\n };\r\n\r\n private _renderRating(\r\n productRefinerValue: ProductRefinerValue,\r\n parentProductRefinerHierarchy: IProductRefinerHierarchy,\r\n isChecked: boolean,\r\n context: ICoreContext,\r\n index?: number,\r\n telemetryContent?: ITelemetryContent,\r\n ratingUserCountAriaLabel?: string,\r\n ratingSingleUserCountAriaLabel?: string\r\n ): JSX.Element | undefined {\r\n if (productRefinerValue.LeftValueBoundString) {\r\n this.payLoad.contentAction.etext = productRefinerValue.LeftValueBoundLocalizedString;\r\n const attribute = getTelemetryAttributes(telemetryContent!, this.payLoad);\r\n const refinerRating = Number.parseInt(productRefinerValue.LeftValueBoundString, 10);\r\n const ratingRefiner = this.props.selectedRefinerValues?.find(\r\n value => value.DataTypeValue === productRefinerValue.DataTypeValue\r\n );\r\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Replace with actual value for empty string.\r\n const selectedRating = Number.parseInt(ratingRefiner?.LeftValueBoundString || '0', 10);\r\n const defaultChkProductCount = 1;\r\n let ratingComponentClass: string = 'ms-rating-component';\r\n if (refinerRating > selectedRating) {\r\n ratingComponentClass = `${ratingComponentClass}__up`;\r\n } else if (refinerRating < selectedRating) {\r\n ratingComponentClass = `${ratingComponentClass}__down`;\r\n } else {\r\n ratingComponentClass = `${ratingComponentClass}__current`;\r\n }\r\n const productCountAriaLabelValue =\r\n productRefinerValue.Count !== undefined && productRefinerValue.Count === defaultChkProductCount\r\n ? ratingSingleUserCountAriaLabel && format(ratingSingleUserCountAriaLabel, productRefinerValue.Count)\r\n : ratingUserCountAriaLabel && format(ratingUserCountAriaLabel, productRefinerValue.Count);\r\n return (\r\n \r\n \r\n \r\n \r\n {productRefinerValue.Count !== undefined && `(${productRefinerValue.Count})`}\r\n \r\n \r\n \r\n );\r\n }\r\n return undefined;\r\n }\r\n}\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport { IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\r\nimport { DisplayTemplate, ProductRefinerSource, ProductRefinerValue, RefinerType } from '@msdyn365-commerce/retail-proxy';\r\nimport { Button, Collapse, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport RangeRefineItem, { RangeRefineItemType } from './range-refine-item';\r\nimport RefineItem from './refine-item';\r\nimport { IRefineItemCommonProps } from './refine-item.props.common';\r\nimport { IRefineItemToggleNotification } from './refine-item-toggle-notification';\r\nimport { findMatchingRefinementCriterion, isRangeType } from './utilities';\r\n\r\n/**\r\n * Properties associated with the RefineSubmenu component.\r\n */\r\nexport interface IRefineSubmenuProps {\r\n tempRangeTypeTODO: RangeRefineItemType;\r\n minValueSliderThumbAriaLabel?: string;\r\n maxValueSliderThumbAriaLabel?: string;\r\n productRefinerHierarchy: IProductRefinerHierarchy;\r\n selectedRefinerValues: ProductRefinerValue[];\r\n refineItemCommonProps: IRefineItemCommonProps;\r\n isDisabled: boolean;\r\n isExpandedOnInitialLoad: boolean;\r\n context: ICoreContext>;\r\n moduleId: string;\r\n moduleTypeName: string;\r\n productCountAriaLabel?: string;\r\n singleProductCountAriaLabel?: string;\r\n refineItemAriaLabel?: string;\r\n refineItemsAriaLabel?: string;\r\n isMobile?: boolean;\r\n\r\n /**\r\n * The telemetry content\r\n */\r\n telemetryContent?: ITelemetryContent;\r\n onUpdateRefiners(notfication: Readonly): void;\r\n urlBuilder(refiner: IRefineItemToggleNotification): string;\r\n}\r\n\r\n/**\r\n * Refine submenu state.\r\n */\r\nexport interface IRefineSubmenuState extends React.ComponentState {\r\n expanded: boolean;\r\n}\r\n\r\n/**\r\n *\r\n * The RefineSubmenu component renders the submenu category and child items.\r\n * This computed observes the stateful category hierarchy object.\r\n * @extends {React.PureComponent}\r\n */\r\nclass RefineSubmenu extends React.Component {\r\n constructor(props: IRefineSubmenuProps) {\r\n super(props);\r\n\r\n this._onToggleItem = this._onToggleItem.bind(this);\r\n this._onToggleSubmenu = this._onToggleSubmenu.bind(this);\r\n\r\n const isExpanded = this.props.isExpandedOnInitialLoad;\r\n\r\n // If (this.props.productRefinerHierarchy.DataTypeValue === ProductRefinerValueDataTypeValue.Range) {\r\n // isExpanded = true;\r\n // }\r\n\r\n this.state = {\r\n expanded: isExpanded\r\n };\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: IRefineSubmenuProps, nextState: IRefineSubmenuState): boolean {\r\n if (this.state === nextState && this.props === nextProps) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const { productRefinerHierarchy, refineItemCommonProps } = this.props;\r\n\r\n if (!productRefinerHierarchy) {\r\n refineItemCommonProps.telemetry.error('Cannot render submenu without refiner hierarchy data');\r\n }\r\n\r\n if (productRefinerHierarchy.SourceValue === ProductRefinerSource.Rating && this.props.context.app.config.hideRating) {\r\n return null;\r\n }\r\n return (\r\n
    \r\n \r\n {productRefinerHierarchy.KeyName}\r\n \r\n \r\n {this._renderChildItems(productRefinerHierarchy)}\r\n \r\n
    \r\n );\r\n }\r\n\r\n private _renderChildItems(productRefinerHierarchy: IProductRefinerHierarchy): JSX.Element | null {\r\n if (isRangeType(productRefinerHierarchy.DataTypeValue)) {\r\n return this._renderRange(productRefinerHierarchy);\r\n }\r\n return this._renderSingleMultiSelect(productRefinerHierarchy);\r\n }\r\n\r\n private _renderSingleMultiSelect(productRefinerHierarchy: IProductRefinerHierarchy): JSX.Element | null {\r\n const {\r\n isDisabled,\r\n refineItemCommonProps,\r\n selectedRefinerValues,\r\n context,\r\n productCountAriaLabel,\r\n singleProductCountAriaLabel,\r\n refineItemAriaLabel,\r\n refineItemsAriaLabel,\r\n isMobile\r\n } = this.props;\r\n const isSingleSelect =\r\n productRefinerHierarchy.RefinerTypeValue === RefinerType.SingleSelect &&\r\n productRefinerHierarchy.SourceValue === ProductRefinerSource.Rating;\r\n const role = isSingleSelect ? { role: 'listbox' } : undefined;\r\n const refinerValuesList = productRefinerHierarchy.Values || [];\r\n const listItems = refinerValuesList.map((child: ProductRefinerValue, index: number) => {\r\n if (!child) {\r\n refineItemCommonProps.telemetry.error(\r\n `[refine-submenu] Could not render refine item for refiner ${productRefinerHierarchy.RecordId} (${productRefinerHierarchy.KeyName})`\r\n );\r\n return null;\r\n }\r\n\r\n const selectedRefinementCriterion = findMatchingRefinementCriterion(child, selectedRefinerValues);\r\n\r\n return (\r\n \r\n refinerValuesList.find(value => value.RefinerRecordId === selectedValue.RefinerRecordId)\r\n )}\r\n refineItemCommonProps={refineItemCommonProps}\r\n onToggle={this._onToggleItem}\r\n urlBuilder={this.props.urlBuilder}\r\n isDisabled={isDisabled}\r\n key={index}\r\n index={index}\r\n context={context}\r\n moduleId={this.props.moduleId}\r\n moduleTypeName={this.props.moduleTypeName}\r\n telemetryContent={this.props.telemetryContent}\r\n productCountAriaLabel={productCountAriaLabel}\r\n refineItemAriaLabel={refineItemAriaLabel}\r\n refineItemsAriaLabel={refineItemsAriaLabel}\r\n singleProductCountAriaLabel={singleProductCountAriaLabel}\r\n isMobileView={isMobile}\r\n />\r\n );\r\n });\r\n return (\r\n \r\n {listItems}\r\n \r\n );\r\n }\r\n\r\n private _getRangeType(productRefinerHierarchy: IProductRefinerHierarchy): 'input' | 'slider' {\r\n if (\r\n productRefinerHierarchy.DisplayTemplateValue === DisplayTemplate.Range ||\r\n productRefinerHierarchy.DisplayTemplateValue === DisplayTemplate.Slider ||\r\n productRefinerHierarchy.DisplayTemplateValue === DisplayTemplate.SliderWithBars\r\n ) {\r\n return 'slider';\r\n }\r\n return 'input';\r\n }\r\n\r\n private _renderRange(productRefinerHierarchy: IProductRefinerHierarchy): JSX.Element | null {\r\n const {\r\n isDisabled,\r\n refineItemCommonProps,\r\n selectedRefinerValues,\r\n context,\r\n minValueSliderThumbAriaLabel,\r\n maxValueSliderThumbAriaLabel\r\n } = this.props;\r\n const submenuClassNamePrefix = 'ms-refine-submenu__item list-group-item refine-submenu__item';\r\n const refinerValuesList = productRefinerHierarchy.Values || [];\r\n const listItems = refinerValuesList.map((child: ProductRefinerValue, index: number) => {\r\n if (!child) {\r\n refineItemCommonProps.telemetry.error(\r\n `Could not render refine item for refiner ${productRefinerHierarchy.RecordId} (${productRefinerHierarchy.KeyName})`\r\n );\r\n return null;\r\n }\r\n\r\n const selectedRefinementCriterion = findMatchingRefinementCriterion(child, selectedRefinerValues);\r\n\r\n const rangeType = this._getRangeType(productRefinerHierarchy);\r\n const key = selectedRefinementCriterion\r\n ? `${selectedRefinementCriterion.LeftValueBoundString}-${selectedRefinementCriterion.RightValueBoundString}`\r\n : `not-selected-${index}`;\r\n return (\r\n
  • \r\n \r\n
  • \r\n );\r\n });\r\n return
      {listItems}
    ;\r\n }\r\n\r\n private _onToggleItem(itemToggleNotification: IRefineItemToggleNotification): void {\r\n this.props.onUpdateRefiners(itemToggleNotification);\r\n }\r\n\r\n private _onToggleSubmenu(): void {\r\n this.setState(prevState => ({\r\n expanded: !prevState.expanded\r\n }));\r\n }\r\n}\r\n\r\nexport default RefineSubmenu;\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport * as React from 'react';\r\n\r\ninterface ISeparator {\r\n separator: string;\r\n}\r\n\r\nexport const Separator: React.FC = ({ separator }) => {separator} ;\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport * as React from 'react';\r\n\r\ninterface ITitle {\r\n className: string;\r\n text: string;\r\n}\r\n\r\nexport const Title: React.FC = ({ text, className }) => {text} ;\r\n","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. See License.txt in the project root for license information.\r\n * ISgiSearchNewArrivalsContainer containerModule Interface Properties\r\n * THIS FILE IS AUTO-GENERATED - MANUAL MODIFICATIONS WILL BE LOST\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport * as React from 'react';\r\n\r\nexport const enum expandRefinersCount {\r\n all = 'all',\r\n one = 'one',\r\n two = 'two',\r\n three = 'three',\r\n four = 'four'\r\n}\r\n\r\nexport interface ISgiSearchNewArrivalsContainerConfig extends Msdyn365.IModuleConfig {\r\n itemsPerPage?: number;\r\n allowBackNavigation?: boolean;\r\n imageSettings?: Msdyn365.IImageSettings;\r\n expandRefinersCount?: expandRefinersCount;\r\n disableHierarchy?: boolean;\r\n includeAttributes?: boolean;\r\n enableAffiliationBasedPricing?: boolean;\r\n updateRefinerPanel?: boolean;\r\n className?: string;\r\n clientRender?: boolean;\r\n enableProdutDescription?: boolean;\r\n useStickyFilter?: boolean;\r\n hideRefinersList?: IHideRefinersListData[];\r\n newArrivalAttrKeyName?: string;\r\n newArrivalDateAttrKeyName?: string;\r\n newArrivalRefinerName?: string;\r\n newArrivalRefinerLVSValue?: string;\r\n title?: string;\r\n categoryId?: string;\r\n}\r\n\r\nexport interface ISgiSearchNewArrivalsContainerResources {\r\n noResultsForRefinersText: string;\r\n resultCategoryNotFoundText: string;\r\n resultSearchNotFoundText: string;\r\n paginationAriaLabel: string;\r\n priceFree: string;\r\n priceRangeSeparator: string;\r\n originalPriceText: string;\r\n currentPriceText: string;\r\n ratingAriaLabel: string;\r\n flipperNext: string;\r\n flipperPrevious: string;\r\n searchTextPrefix: string;\r\n numberOfProducts: string;\r\n oneProduct: string;\r\n categoryLinkAriaLabel: string;\r\n sortByDropdownLabel: string;\r\n sortByOptionNameAsc: string;\r\n sortByOptionNameDesc: string;\r\n sortByOptionPriceAsc: string;\r\n sortByOptionPriceDesc: string;\r\n sortByOptionRatingDesc: string;\r\n sortByOptionBestSelling: string;\r\n sortByOptionNewScore: string;\r\n sortByOptionTrendingScore: string;\r\n sortByOptionRelevanceDesc: string;\r\n placeholderTextMax: string;\r\n minLabel: string;\r\n maxLabel: string;\r\n rangeNameFormat: string;\r\n validationErrorNotNumber: string;\r\n validationErrorNotRange: string;\r\n clearAllText: string;\r\n choiceSummaryLabel: string;\r\n choiceFormat: string;\r\n choiceRangeValueFormat: string;\r\n choiceAriaLabel: string;\r\n closeAriaLabel: string;\r\n modalTitle: string;\r\n modalCloseButtonText: string;\r\n minValueSliderThumbAriaLabel: string;\r\n maxValueSliderThumbAriaLabel: string;\r\n featureSimilarLooksTitle: string;\r\n featureSimilarDescriptionTitle: string;\r\n productCountAriaLabel: string;\r\n singleProductCountAriaLabel: string;\r\n swatchItemAriaLabel: string;\r\n refineItemsAriaLabel: string;\r\n refineItemAriaLabel: string;\r\n filterText: string;\r\n doneText: string;\r\n doneAriaLabel: string;\r\n}\r\n\r\nexport interface IHideRefinersListData {\r\n refinerKeyName?: string;\r\n}\r\n\r\nexport interface ISgiSearchNewArrivalsContainerProps extends Msdyn365.IModule {\r\n resources: ISgiSearchNewArrivalsContainerResources;\r\n config: ISgiSearchNewArrivalsContainerConfig;\r\n slots: {\r\n quickview: React.ReactNode[];\r\n };\r\n}\r\n","/* eslint-disable prettier/prettier */\r\n/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport {\r\n CategoryHierarchy as CategoryHierarchyData,\r\n IProductRefinerHierarchy,\r\n IProductsDimensionsAvailabilities\r\n} from '@msdyn365-commerce/commerce-entities';\r\nimport MsDyn365, { getCatalogId, ICoreContext } from '@msdyn365-commerce/core';\r\nimport { format, ProductPrice, ProductRefinerValue, SortColumn, TextValueTranslation } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ArrayExtensions,\r\n DimensionAvailabilitiesForProductSearchResultInput,\r\n DimensionTypes,\r\n getDimensionAvailabilitiesForProductSearchResultAction,\r\n getPriceForProductSearchResult,\r\n IDimensionsApp,\r\n PriceForProductSearchResultInput\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n getTelemetryObject,\r\n ILabeledDropdownOnChangeNotification,\r\n ILabeledDropdownOption,\r\n IModuleProps,\r\n INodeProps,\r\n isMobile,\r\n ITelemetryContent,\r\n LabeledDropdown,\r\n UncontrolledPagination,\r\n VariantType\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport { computed, observable, reaction, transaction } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\n\r\nimport {\r\n buildListPageUrl,\r\n getCollectionProducts,\r\n getCollectionRefinersAction,\r\n getCurrentUrl,\r\n GetFullProductsByCollectionInput,\r\n parseQueryParam,\r\n ProductListInventoryFilteringOptions,\r\n RefinersByCollectionInput,\r\n sortOptions\r\n} from './actions';\r\nimport { hydrateRefinersFromUrl } from './actions/url-utils';\r\nimport {\r\n ErrorMessage,\r\n FeatureSearchResultItem,\r\n getUpdatedRefinementCriteria,\r\n IChoiceSummaryClickNotification,\r\n IRefineItemCommonProps,\r\n IRefineItemToggleNotification,\r\n ISearchResultModalViewProps,\r\n isMatchingRefinementCriterion,\r\n Link,\r\n ModalToggle,\r\n ProductSearchResultItems,\r\n SearchResultModal,\r\n Separator,\r\n Title\r\n} from './components';\r\nimport ChoiceSummary from './components/choice-summary';\r\nimport RefineSubmenu from './components/refine-submenu';\r\nimport { ISgiSearchResultContainerData } from './sgi-search-new-arrivals-container.data';\r\nimport { expandRefinersCount, ISgiSearchNewArrivalsContainerProps } from './sgi-search-new-arrivals-container.props.autogenerated';\r\nimport { ListPageState } from './list-page-state';\r\nimport { IFullProductsSearchResultsWithCount } from './actions/IFullProductsSearchResultsWithCount';\r\n\r\nexport interface ISearchResultContainerViewProps extends ISgiSearchNewArrivalsContainerProps {\r\n products?: React.ReactNode;\r\n className?: string;\r\n SearchResultContainer: IModuleProps;\r\n TitleViewProps: ITitleViewProps;\r\n categoryHierarchy: ICategoryHierarchyViewProps;\r\n pagination?: React.ReactNode;\r\n ProductsContainer: INodeProps;\r\n ProductSectionContainer: INodeProps;\r\n refineMenu: IRefineMenuViewProps;\r\n sortByOptions: ISortByViewProps;\r\n choiceSummary?: React.ReactNode;\r\n modalToggle: React.ReactNode;\r\n searchResultModal: ISearchResultModalViewProps;\r\n isMobile: boolean;\r\n CategoryNavContainer: INodeProps;\r\n RefineAndProductSectionContainer: INodeProps;\r\n errorMessage: React.ReactNode;\r\n FeatureSearchContainer: INodeProps;\r\n similarLookProduct?: React.ReactNode;\r\n productPrices?: ProductPrice[];\r\n}\r\n\r\nexport interface ITitleViewProps {\r\n TitleContainer: INodeProps;\r\n title: ISearchResultTitle;\r\n}\r\n\r\nexport interface IRefineMenuViewProps {\r\n RefineMenuContainer: INodeProps;\r\n RefinerSectionContainer: INodeProps;\r\n refiners?: React.ReactNode[];\r\n}\r\n\r\nexport interface ICategoryHierarchyViewProps {\r\n categoryHierarchyList?: React.ReactNode[];\r\n categoryHierarchySeparator?: React.ReactNode;\r\n CategoryHierarchyContainer: INodeProps;\r\n}\r\n\r\nexport interface ISortByViewProps {\r\n SortingContainer: INodeProps;\r\n sortByDropDown?: React.ReactNode;\r\n}\r\n\r\nexport type GridSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\r\n\r\n/**\r\n * Title component for search result container.\r\n */\r\nexport interface ISearchResultTitle {\r\n titlePrefix?: React.ReactNode;\r\n titleText?: React.ReactNode;\r\n titleCount?: React.ReactNode;\r\n}\r\n\r\nexport interface ISearchResultContainerState {\r\n sortingState: ISortByCollectionState;\r\n modalIsOpen: boolean;\r\n refiners: IProductRefinerHierarchy[];\r\n productsDimensionAvailabilities?: IProductsDimensionsAvailabilities[][];\r\n}\r\n\r\ninterface ISortByCollectionState {\r\n selectedSortByOption: ILabeledDropdownOption;\r\n pending: boolean;\r\n}\r\n\r\n/**\r\n *\r\n * SearchResultContainer component.\r\n * @extends {React.PureComponent>}\r\n */\r\n@observer\r\nexport default class SearchResultContainer extends React.PureComponent, ISearchResultContainerState\r\n> {\r\n @computed get isMobile(): boolean {\r\n return this._viewport === 'xs' || this._viewport === 'sm';\r\n }\r\n\r\n private readonly sortByDropdownOptions: ILabeledDropdownOption[] = [\r\n { key: sortOptions.sortByOptionRelevanceDesc, value: this.props.resources.sortByOptionRelevanceDesc },\r\n { key: sortOptions.sortByOptionNameAsc, value: this.props.resources.sortByOptionNameAsc },\r\n { key: sortOptions.sortByOptionNameDesc, value: this.props.resources.sortByOptionNameDesc },\r\n { key: sortOptions.sortByOptionPriceAsc, value: this.props.resources.sortByOptionPriceAsc },\r\n { key: sortOptions.sortByOptionPriceDesc, value: this.props.resources.sortByOptionPriceDesc },\r\n { key: sortOptions.sortByOptionRatingDesc, value: this.props.resources.sortByOptionRatingDesc },\r\n { key: sortOptions.sortByOptionBestSelling, value: this.props.resources.sortByOptionBestSelling },\r\n { key: sortOptions.sortByOptionNewScore, value: this.props.resources.sortByOptionNewScore },\r\n { key: sortOptions.sortByOptionTrendingScore, value: this.props.resources.sortByOptionTrendingScore }\r\n ];\r\n\r\n private readonly _refineItemCommonProps: IRefineItemCommonProps;\r\n\r\n @observable\r\n private _viewport: GridSize = 'lg';\r\n\r\n private readonly _modalToggleRef: React.RefObject;\r\n\r\n private readonly _sortAndFilterContainerRef: React.RefObject;\r\n\r\n private expandrefinerCount: number | undefined = 0;\r\n\r\n private readonly telemetryContent: ITelemetryContent;\r\n\r\n private readonly productPrices: ProductPrice[];\r\n\r\n private readonly defaultPageNumber = 0;\r\n\r\n private readonly catalogId = getCatalogId(this.props.context.request);\r\n\r\n public constructor(props: ISgiSearchNewArrivalsContainerProps, state: ISearchResultContainerState) {\r\n super(props);\r\n this._viewport =\r\n props.context.request && props.context.request.device && props.context.request.device.Type === 'Mobile' ? 'xs' : 'lg';\r\n this._modalToggleRef = React.createRef();\r\n this._sortAndFilterContainerRef = React.createRef();\r\n this._toggleModal = this._toggleModal.bind(this);\r\n this._updateViewport = this._updateViewport.bind(this);\r\n this.productPrices = [];\r\n this.state = {\r\n sortingState: {\r\n pending: false,\r\n selectedSortByOption: this.sortByDropdownOptions[0]\r\n },\r\n modalIsOpen: false,\r\n refiners: []\r\n };\r\n const { placeholderTextMax, minLabel, maxLabel, rangeNameFormat } = this.props.resources;\r\n\r\n const locale = this.props.context.request.locale;\r\n const telemetry = this.props.telemetry;\r\n const validationErrorNaN = this.props.resources.validationErrorNotNumber;\r\n const validationErrorRange = this.props.resources.validationErrorNotRange;\r\n this._refineItemCommonProps = {\r\n telemetry,\r\n locale,\r\n placeholderTextMax,\r\n minLabel,\r\n maxLabel,\r\n rangeNameFormat,\r\n validationErrorNaN,\r\n validationErrorRange\r\n };\r\n this.telemetryContent = getTelemetryObject(\r\n this.props.context.request.telemetryPageName!,\r\n this.props.friendlyName,\r\n this.props.telemetry\r\n );\r\n\r\n this._updateViewport();\r\n }\r\n\r\n public static getFriendlyName(locale: string, nameTranslations?: TextValueTranslation[]): string | undefined {\r\n let nameTranslation: TextValueTranslation | undefined;\r\n if (locale && nameTranslations && ArrayExtensions.hasElements(nameTranslations)) {\r\n nameTranslation = nameTranslations.find(item => item.Language!.toLowerCase() === locale.toLowerCase());\r\n }\r\n\r\n return nameTranslation?.Text;\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n if (MsDyn365.isBrowser && window.addEventListener) {\r\n window.addEventListener('resize', this._updateViewport);\r\n this._updateViewport();\r\n }\r\n\r\n const listPageState = await this.props.data.listPageState;\r\n const products = await this.props.data.products;\r\n this._updateListPageState(listPageState, products);\r\n\r\n // Initialize reaction based on listPageState properties\r\n reaction(\r\n () => {\r\n return [\r\n listPageState.activeFilters?.length,\r\n listPageState.currentPageNumber,\r\n ArrayExtensions.hasElements(listPageState.sortingCritera?.Columns)\r\n ];\r\n },\r\n async () => {\r\n const newListPageState = await this.props.data.listPageState;\r\n const input = new GetFullProductsByCollectionInput(\r\n this.props.context.request.apiSettings,\r\n {\r\n Paging: {\r\n Top: this.props.config.itemsPerPage,\r\n Skip: Math.max(newListPageState.pageSize * (newListPageState.currentPageNumber ?? 0), 0)\r\n },\r\n count: true,\r\n Sorting: newListPageState.sortingCritera ?? {}\r\n },\r\n newListPageState.activeFilters ?? [],\r\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- RecordId is string. Check required.\r\n // +(this.props.context.request.urlTokens.recordId || 0),\r\n\r\n // eslint-disable-next-line max-len -- existing code\r\n // this.props.context.request.query?.q\r\n // ? this.props.context.request.query.q\r\n // : JSON.stringify({\r\n // ProductId: this.props.context.request.query?.productId,\r\n // Recommendation: this.props.context.request.query?.recommendation\r\n // }),\r\n undefined,\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Required check.\r\n !!this.props?.config?.includeAttributes,\r\n this.props.config.updateRefinerPanel,\r\n this.props.context.request.locale,\r\n this.catalogId,\r\n this.props.config\r\n );\r\n\r\n const productResults = await getCollectionProducts(input, this.props.context.actionContext);\r\n newListPageState.totalProductCount = productResults.count;\r\n newListPageState.activeProducts = productResults.products;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- check is required.\r\n if (\r\n this.props.config.enableAffiliationBasedPricing &&\r\n this.props.context.actionContext.requestContext?.user?.isAuthenticated\r\n ) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises -- Call api to retrieve the availabilities data without blocking the UI.\r\n this._getActivePrice();\r\n }\r\n\r\n if (this.props.config.updateRefinerPanel) {\r\n const refinerInput = new RefinersByCollectionInput(\r\n this.props.context.request.apiSettings,\r\n {\r\n Paging: {\r\n Top: this.props.config.itemsPerPage,\r\n Skip: Math.max(\r\n newListPageState.pageSize * (newListPageState.currentPageNumber ?? this.defaultPageNumber),\r\n this.defaultPageNumber\r\n )\r\n },\r\n count: true,\r\n Sorting: newListPageState.sortingCritera ?? {}\r\n },\r\n newListPageState.activeFilters ?? [],\r\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- RecordId is string. Check required.\r\n // +(this.props.context.request.urlTokens.recordId || 0),\r\n this.props.context.request.query?.q\r\n ? this.props.context.request.query.q\r\n : this.props.context.request.query?.productId,\r\n false,\r\n this.props.config.updateRefinerPanel,\r\n undefined,\r\n this.catalogId\r\n );\r\n\r\n const refiners = await getCollectionRefinersAction(refinerInput, this.props.context.actionContext);\r\n this.setState({ refiners });\r\n }\r\n }\r\n );\r\n\r\n if (\r\n this.props.config.enableAffiliationBasedPricing &&\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Condition required.\r\n this.props.context.actionContext.requestContext?.user?.isAuthenticated\r\n ) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises -- Call api to retrieve the availabilities data without blocking the UI.\r\n this._getActivePrice();\r\n }\r\n\r\n if (this.props.config.enableAffiliationBasedPricing && this.props.context.actionContext.requestContext?.user?.isAuthenticated) {\r\n void this._getActivePrice();\r\n }\r\n\r\n const context = this.props.context as ICoreContext;\r\n const dimensionsToDisplayOnProductCard = context.app.config.dimensionsInProductCard;\r\n const dimensionsToDisplayAsSwatch = context.app.config.dimensionsAsSwatchType;\r\n if (\r\n ArrayExtensions.hasElements(dimensionsToDisplayOnProductCard) &&\r\n !dimensionsToDisplayOnProductCard.includes(DimensionTypes.none) &&\r\n ArrayExtensions.hasElements(dimensionsToDisplayAsSwatch) &&\r\n !dimensionsToDisplayAsSwatch.includes(DimensionTypes.none) &&\r\n this.props.config.includeAttributes\r\n ) {\r\n await this._getProductsDimensionsAvailabilities();\r\n }\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n if (MsDyn365.isBrowser && window.removeEventListener) {\r\n window.removeEventListener('resize', this._updateViewport);\r\n }\r\n }\r\n\r\n public render(): JSX.Element {\r\n const { imageSettings, className } = this.props.config;\r\n const { resources } = this.props;\r\n const products = (this.props.data.listPageState.result && this.props.data.listPageState.result.activeProducts) || [];\r\n const searchProduct = (this.props.data.listPageState.result && this.props.data.listPageState.result.featureProduct) || null;\r\n let errorText = '';\r\n if (!products || products.length === 0) {\r\n errorText = resources.resultSearchNotFoundText;\r\n }\r\n const productsComponent = this._getProducts();\r\n const featureComponent = (\r\n \r\n );\r\n\r\n const searchResultContainerViewProps = {\r\n ...this.props,\r\n products: productsComponent,\r\n TitleViewProps: this._getCollectionTitle(),\r\n categoryHierarchy: !this.props.config.disableHierarchy && this._getCategoryHierarchy(),\r\n refineMenu: this._getRefineMenu(),\r\n className: classnames('ms-search-result-container', className),\r\n SearchResultContainer: {\r\n moduleProps: this.props,\r\n className: classnames('ms-search-result-container', className)\r\n },\r\n // eslint-disable-next-line max-len -- existing code\r\n sortByOptions:\r\n this.props.data.listPageState.result && this.props.data.listPageState.result.totalProductCount !== 0\r\n ? this._getSortingDropDown()\r\n : null,\r\n pagination: this._getPagination(),\r\n ProductsContainer: { className: 'ms-search-result-container__Products' },\r\n ProductSectionContainer: { className: 'ms-search-result-container__product-section' },\r\n CategoryNavContainer: { className: 'ms-search-result-container__category-nav-section' },\r\n RefineAndProductSectionContainer: { className: 'ms-search-result-container__refine-product-section' },\r\n choiceSummary: this._getChoiceSummary(),\r\n modalToggle:\r\n this.props.data.listPageState.result && this.props.data.listPageState.result.totalProductCount !== 0 ? (\r\n \r\n ) : null,\r\n searchResultModal: this._getSearchResultModal(),\r\n isMobile: this.isMobile,\r\n errorMessage: errorText && ,\r\n FeatureSearchContainer: { className: 'ms-feature-search-result' },\r\n // eslint-disable-next-line max-len -- existing code\r\n similarLookProduct:\r\n this.props.data.listPageState.result &&\r\n this.props.data.listPageState.result.featureProduct !== null &&\r\n this.props.data.listPageState.result.featureProduct !== undefined\r\n ? featureComponent\r\n : null,\r\n productPrices: this.productPrices\r\n };\r\n return this.props.renderView(searchResultContainerViewProps) as React.ReactElement;\r\n }\r\n\r\n /**\r\n * Update the list page state with initial data.\r\n * @param listPageState -- List page State.\r\n * @param products -- Products.\r\n */\r\n private readonly _updateListPageState = (listPageState: ListPageState, products: IFullProductsSearchResultsWithCount): void => {\r\n let querySorting: SortColumn[] = [];\r\n const defaultPageNumber: number = 10;\r\n\r\n if (this.props.context.request.query?.sorting) {\r\n querySorting = JSON.parse(decodeURIComponent(this.props.context.request.query.sorting)) as SortColumn[];\r\n }\r\n\r\n listPageState.currentPageNumber =\r\n (this.props.context.request.query &&\r\n +this.props.context.request.query.skip / (this.props.config.itemsPerPage ?? defaultPageNumber)) ||\r\n 0;\r\n listPageState.sortingCritera = { Columns: querySorting };\r\n listPageState.pageSize = this.props.config.itemsPerPage ?? defaultPageNumber;\r\n listPageState.activeProducts = products.products;\r\n listPageState.totalProductCount = products.count;\r\n listPageState.activeFilters = hydrateRefinersFromUrl(this.props.context.request);\r\n if (this.props.context.request.query?.productId) {\r\n const featureProduct = this.props.data.featureProduct.result;\r\n if (featureProduct) {\r\n listPageState.featureProduct = featureProduct;\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Get products dimension availabilities.\r\n * @returns Void.\r\n */\r\n private readonly _getProductsDimensionsAvailabilities = async (): Promise => {\r\n try {\r\n const productsList = this.props.data.listPageState.result?.activeProducts ?? [];\r\n\r\n const productsDimensionAvailabilities = await getDimensionAvailabilitiesForProductSearchResultAction(\r\n new DimensionAvailabilitiesForProductSearchResultInput(productsList, this.props.context as ICoreContext),\r\n this.props.context.actionContext\r\n );\r\n\r\n if (ArrayExtensions.hasElements(productsDimensionAvailabilities)) {\r\n this.setState({ productsDimensionAvailabilities });\r\n }\r\n } catch (error) {\r\n console.log('[_getProductsDimensionsAvailabilities] error', error);\r\n }\r\n };\r\n\r\n /**\r\n * Get the active price for the products.\r\n */\r\n private readonly _getActivePrice = async (): Promise => {\r\n const productsList = this.props.data.listPageState.result?.activeProducts ?? [];\r\n const products = await getPriceForProductSearchResult(\r\n new PriceForProductSearchResultInput(productsList),\r\n this.props.context.actionContext\r\n );\r\n\r\n const listPageState = await this.props.data.listPageState;\r\n listPageState.activeProducts = products;\r\n };\r\n\r\n private readonly _getSearchResultModal = (): ISearchResultModalViewProps => {\r\n const { resources } = this.props;\r\n return SearchResultModal({\r\n resources: {\r\n modalCloseButtonText: resources.modalCloseButtonText,\r\n modalTitle: resources.modalTitle\r\n },\r\n isOpen: this.state.modalIsOpen,\r\n returnRef: this._modalToggleRef,\r\n onModalToggle: this._toggleModal\r\n });\r\n };\r\n\r\n private readonly _getCollectionTitle = (): ITitleViewProps => {\r\n const { data, context, resources } = this.props;\r\n\r\n let collectionTitle: string | undefined = '';\r\n if (context && context.request && context.request.query && context.request.query.q) {\r\n collectionTitle = `\"${context.request.query.q}\"`;\r\n } else {\r\n collectionTitle = this.props.config.title ?? 'New Arrivals';\r\n // (data.category.result &&\r\n // SearchResultContainer.getFriendlyName(context.request.locale, data.category.result.NameTranslations)) ||\r\n // (data.category.result && data.category.result.Name);\r\n }\r\n let productCountText = '';\r\n let productCountNumber: number | undefined;\r\n if (data.listPageState && data.listPageState.result && data.listPageState.result.totalProductCount !== undefined) {\r\n productCountNumber = data.listPageState.result.totalProductCount;\r\n } else if (data.products && data.products.result) {\r\n productCountNumber = data.products.result.count;\r\n }\r\n\r\n if (productCountNumber && productCountNumber !== 0) {\r\n productCountText =\r\n productCountNumber !== 1\r\n ? format(this.props.resources.numberOfProducts, productCountNumber)\r\n : this.props.resources.oneProduct;\r\n } else {\r\n productCountText = format(this.props.resources.numberOfProducts, 0);\r\n }\r\n const pageName = context.request.telemetryPageName ? `result-count-${context.request.telemetryPageName.toLowerCase()}` : '';\r\n const titlePrefix = ;\r\n const titleText = collectionTitle && <Title className='ms-search-result__collection-title-text' text={collectionTitle} />;\r\n const titleCount = <Title className='ms-search-result__collection-title-count' text={productCountText} />;\r\n\r\n return {\r\n TitleContainer: { className: `ms-search-result-container__title ${pageName}` },\r\n title: {\r\n titlePrefix,\r\n titleText,\r\n titleCount\r\n }\r\n };\r\n };\r\n\r\n private readonly _getCategoryHierarchy = (): ICategoryHierarchyViewProps => {\r\n const { data } = this.props;\r\n const categoryHierarchy = data.categoryHierarchy.result;\r\n const categoryLinks =\r\n categoryHierarchy &&\r\n categoryHierarchy.map((value: CategoryHierarchyData, index: number) => {\r\n return (\r\n <Link\r\n key={index}\r\n text={value.Name}\r\n ariaLabel={`${this.props.resources.categoryLinkAriaLabel} ${value.Name}`}\r\n href={value.Url}\r\n />\r\n );\r\n });\r\n const categoryLinkSeparator = <Separator separator='/' />;\r\n\r\n return {\r\n CategoryHierarchyContainer: { tag: 'nav', className: 'ms-search-result-container__category-hierarchy' },\r\n categoryHierarchyList: categoryLinks,\r\n categoryHierarchySeparator: categoryLinkSeparator\r\n };\r\n };\r\n\r\n private readonly _getSortingDropDown = (): ISortByViewProps => {\r\n const { resources } = this.props;\r\n const activeDropdown = this._getCurrentlySelectedOption() || this.state.sortingState.selectedSortByOption;\r\n let dropdownOptions = this._getAllSortByOptions();\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- App config settings are of \"any\" value.\r\n if (this.props.context.app.config.hideRating) {\r\n dropdownOptions = dropdownOptions.filter(dropdownOption => dropdownOption.key !== sortOptions.sortByOptionRatingDesc);\r\n }\r\n\r\n const dropdown = (\r\n <LabeledDropdown\r\n labelClassname='reviews-list-sort-by'\r\n labelText={resources.sortByDropdownLabel}\r\n dropdownId='categorySortByDropdown'\r\n dropdownClassname='reviews-list-dropdown'\r\n toggleColor='link'\r\n dropdownOptions={dropdownOptions}\r\n selectedOption={activeDropdown}\r\n onSelectOption={this._updateSortByDropdown}\r\n ref={this._sortAndFilterContainerRef}\r\n />\r\n );\r\n return {\r\n SortingContainer: { className: 'ms-search-result-container__Sort-by-category' },\r\n sortByDropDown: dropdown\r\n };\r\n };\r\n\r\n private readonly _getPagination = (): React.ReactNode => {\r\n const { config, context, data, resources } = this.props;\r\n const listPageState = data && data.listPageState && data.listPageState.result;\r\n const fullUrl = getCurrentUrl(context.request);\r\n const itemsPerPage = config.itemsPerPage || 10;\r\n // eslint-disable-next-line max-len -- existing code\r\n const skipCount =\r\n listPageState && listPageState.currentPageNumber !== null\r\n ? listPageState.currentPageNumber * (this.props.config.itemsPerPage || 10)\r\n : (this.props.context.request.query && +this.props.context.request.query.skip) || 0;\r\n const totalItems = (listPageState && listPageState.totalProductCount) || 0;\r\n const previousText = resources.flipperPrevious;\r\n const nextText = resources.flipperNext;\r\n\r\n if (totalItems <= itemsPerPage) {\r\n return null;\r\n }\r\n return (\r\n <UncontrolledPagination\r\n className='ms-search-result-container__pagination'\r\n role='navigation'\r\n aria-label={resources.paginationAriaLabel}\r\n url={fullUrl.href}\r\n qsp='skip'\r\n items={totalItems}\r\n itemsPerPage={itemsPerPage}\r\n startingItem={skipCount}\r\n previousText={this._renderPrev(previousText)}\r\n nextText={this._renderNext(nextText)}\r\n previousAriaLabel={previousText}\r\n nextAriaLabel={nextText}\r\n telemetryContent={this.telemetryContent}\r\n />\r\n );\r\n };\r\n\r\n private readonly _getRefineMenu = (): IRefineMenuViewProps => {\r\n const { data, context, config } = this.props;\r\n const tempRangeTypeTODO = context.request.query && context.request.query.inputRange ? 'input' : 'slider';\r\n let validRefiners =\r\n this.props.config.updateRefinerPanel && ArrayExtensions.hasElements(this.state.refiners)\r\n ? this.state.refiners.filter(refiner => {\r\n return ArrayExtensions.hasElements(refiner.Values) && !this._shouldHideFromRefiners(refiner);\r\n })\r\n : data.refiners.result &&\r\n data.refiners.result.filter(refiner => {\r\n return ArrayExtensions.hasElements(refiner.Values) && !this._shouldHideFromRefiners(refiner);\r\n });\r\n\r\n const activeRefiners = (data.listPageState.result && data.listPageState.result.activeFilters) || [];\r\n validRefiners = config?.hideRefinersList\r\n ? validRefiners?.filter(\r\n refiner =>\r\n refiner.KeyName &&\r\n config.hideRefinersList?.filter(\r\n hideFilter => hideFilter.refinerKeyName?.toLowerCase() === refiner.KeyName?.toLowerCase()\r\n ).length === 0\r\n )\r\n : validRefiners;\r\n this._getexpandRefinerCount(validRefiners && validRefiners.length, config.expandRefinersCount);\r\n const expandedRefiners = this.expandrefinerCount;\r\n const subMenus =\r\n validRefiners &&\r\n validRefiners.map((productRefinerHierarchy: IProductRefinerHierarchy, index: number) => {\r\n return (\r\n <RefineSubmenu\r\n productRefinerHierarchy={productRefinerHierarchy}\r\n selectedRefinerValues={activeRefiners}\r\n refineItemCommonProps={this._refineItemCommonProps}\r\n minValueSliderThumbAriaLabel={this.props.resources.minValueSliderThumbAriaLabel}\r\n maxValueSliderThumbAriaLabel={this.props.resources.maxValueSliderThumbAriaLabel}\r\n key={index}\r\n onUpdateRefiners={this._onUpdateRefiners}\r\n urlBuilder={this._buildRefinerUrl}\r\n isDisabled={false}\r\n isExpandedOnInitialLoad={!!(expandedRefiners && expandedRefiners > index)}\r\n tempRangeTypeTODO={tempRangeTypeTODO}\r\n context={context}\r\n moduleId={this.props.id}\r\n moduleTypeName={this.props.typeName}\r\n telemetryContent={this.telemetryContent}\r\n productCountAriaLabel={this.props.resources.productCountAriaLabel}\r\n refineItemAriaLabel={this.props.resources.refineItemAriaLabel}\r\n refineItemsAriaLabel={this.props.resources.refineItemsAriaLabel}\r\n singleProductCountAriaLabel={this.props.resources.singleProductCountAriaLabel}\r\n isMobile={this.isMobile}\r\n />\r\n );\r\n });\r\n\r\n return {\r\n RefineMenuContainer: { className: 'ms-search-result-container__refine-menu' },\r\n RefinerSectionContainer: { className: 'ms-search-result-container__refiner-section' },\r\n refiners: subMenus\r\n };\r\n };\r\n\r\n /**\r\n * Should hide from refiners.\r\n * @param refiner - The refiner.\r\n * @returns ShouldHideFromRefiners.\r\n */\r\n private readonly _shouldHideFromRefiners = (refiner: IProductRefinerHierarchy): boolean => {\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- app configs are of generic type\r\n return (\r\n this.props.context.app.config.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS &&\r\n refiner.RecordId === this.props.data.products.result?.channelInventoryConfigurationId\r\n );\r\n };\r\n\r\n private readonly _getChoiceSummary = (): React.ReactNode => {\r\n const { resources, data, telemetry } = this.props;\r\n const selectedRefiners = (data.listPageState.result && data.listPageState.result.activeFilters) || [];\r\n return (\r\n <ChoiceSummary\r\n classNames='ms-choice-summary-by-category'\r\n clearAllText={resources.clearAllText}\r\n label={resources.choiceSummaryLabel}\r\n closeAriaLabel={resources.closeAriaLabel}\r\n selectedChoices={selectedRefiners}\r\n // @ts-expect-error: NOTE Type-unsafe line below, null refinersByCategoryHierarchy case not handled\r\n refinerHierarchy={data.refiners.result}\r\n choiceFormat={resources.choiceFormat}\r\n choiceRangeValueFormat={resources.choiceRangeValueFormat}\r\n telemetry={telemetry}\r\n onChoiceClicked={this._onChoiceClicked}\r\n urlBuilder={this._buildRefinerUrlForChoiceSummary}\r\n choiceAriaLabel={resources.choiceAriaLabel}\r\n telemetryContent={this.telemetryContent}\r\n context={this.props.context}\r\n channelInventoryConfigurationId={this.props.data.products.result?.channelInventoryConfigurationId}\r\n />\r\n );\r\n };\r\n\r\n private readonly _getProducts = (): JSX.Element => {\r\n const { imageSettings, allowBackNavigation } = this.props.config;\r\n const { resources } = this.props;\r\n const breaCrumbType = this.props.context.app.config.breadcrumbType;\r\n const allowBack = allowBackNavigation && (breaCrumbType === 'back' || breaCrumbType === 'categoryAndBack');\r\n const products = (this.props.data.listPageState.result && this.props.data.listPageState.result.activeProducts) || [];\r\n const quickviewslot = this.props.slots && this.props.slots.quickview && this.props.slots.quickview[0];\r\n const isPriceMinMaxFeatureState = this.props.data.featureState.result?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailSearchPriceRangeFeature'\r\n );\r\n return (\r\n <ProductSearchResultItems\r\n products={products}\r\n context={this.props.context}\r\n imageSettings={imageSettings}\r\n resources={resources}\r\n moduleType={this.props.typeName}\r\n moduleId={this.props.id}\r\n allowBackNavigation={allowBack}\r\n telemetryContent={this.telemetryContent}\r\n quickviewSlot={quickviewslot}\r\n channelInventoryConfigurationId={this.props.data.products.result?.channelInventoryConfigurationId}\r\n isPriceMinMaxEnabled={isPriceMinMaxFeatureState?.IsEnabled}\r\n productsDimensionAvailabilities={this.state.productsDimensionAvailabilities}\r\n />\r\n );\r\n };\r\n\r\n private readonly _updateSortByDropdown = (notification: ILabeledDropdownOnChangeNotification): void => {\r\n const { context } = this.props;\r\n const requestContext = context && context.request;\r\n const actionContext = context && context.actionContext;\r\n\r\n if (!requestContext || !actionContext || !this.props.data.listPageState.result) {\r\n // eslint-disable-next-line max-len -- existing code\r\n const error = `[sort-by-category] cannot sort without context: ${!requestContext ? 'requestContext ' : ''} ${!actionContext ? 'actionContext ' : ''\r\n } could not be found`;\r\n this.props.telemetry.warning(error);\r\n }\r\n\r\n window.history.pushState(\r\n {},\r\n '',\r\n buildListPageUrl(\r\n getCurrentUrl(this.props.context.request),\r\n undefined,\r\n [this._getSortColumnFromSelectedOption(notification.selectedOption)],\r\n undefined\r\n )\r\n );\r\n transaction(() => {\r\n this.props.data.listPageState.result!.currentPageNumber = 0;\r\n this.props.data.listPageState.result!.sortingCritera = {\r\n Columns: [this._getSortColumnFromSelectedOption(notification.selectedOption)]\r\n };\r\n });\r\n };\r\n\r\n private readonly _getSortColumnFromSelectedOption = (option: ILabeledDropdownOption): SortColumn => {\r\n const { data } = this.props;\r\n\r\n if (!data.searchConfiguration.result) {\r\n return {};\r\n }\r\n\r\n const mappedConfiguration = data.searchConfiguration.result.find(searchConfiguration => {\r\n return searchConfiguration.key === option.key;\r\n });\r\n\r\n if (mappedConfiguration) {\r\n return mappedConfiguration.sortColumn;\r\n }\r\n\r\n return {};\r\n };\r\n\r\n /**\r\n * Retrieves current sort criteria.\r\n * @returns Sort criteria column which is currently active or undefined if it's not specified.\r\n */\r\n private readonly _getSortCriteriaColumn = (): SortColumn | undefined => {\r\n const sortCriteria = this.props.data.listPageState.result?.sortingCritera;\r\n if (ArrayExtensions.hasElements(sortCriteria?.Columns)) {\r\n return sortCriteria!.Columns[0];\r\n }\r\n\r\n const queryColumns = parseQueryParam<SortColumn[]>('sorting', this.props.context.request);\r\n if (ArrayExtensions.hasElements(queryColumns)) {\r\n return queryColumns[0];\r\n }\r\n\r\n return undefined;\r\n };\r\n\r\n /**\r\n * Retrieves dropdown options.\r\n * @returns All dropdown options.\r\n */\r\n private readonly _getAllSortByOptions = (): ILabeledDropdownOption[] => {\r\n const searchConfiguration = this.props.data.searchConfiguration.result;\r\n\r\n if (!searchConfiguration) {\r\n return [];\r\n }\r\n\r\n const mappedSearchConfiguration = this.sortByDropdownOptions.filter(mappedSearchConfig =>\r\n searchConfiguration.find(item => mappedSearchConfig.key === item.key)\r\n );\r\n\r\n return ArrayExtensions.validValues(mappedSearchConfiguration);\r\n };\r\n\r\n /**\r\n * Retrieves current selected dropdown option based on the sort criteria.\r\n * @returns Current dropdown option.\r\n */\r\n private readonly _getCurrentlySelectedOption = (): ILabeledDropdownOption | undefined => {\r\n const activeSortColumn = this._getSortCriteriaColumn();\r\n\r\n const searchConfiguration = this.props.data.searchConfiguration.result;\r\n\r\n if (!activeSortColumn || !searchConfiguration) {\r\n return undefined;\r\n }\r\n\r\n const activeMappedConfig = searchConfiguration.find(\r\n mappedSearchConfig =>\r\n mappedSearchConfig.sortColumn.ColumnName === activeSortColumn.ColumnName &&\r\n mappedSearchConfig.sortColumn.IsDescending === activeSortColumn.IsDescending\r\n );\r\n if (!activeMappedConfig) {\r\n return undefined;\r\n }\r\n\r\n return this.sortByDropdownOptions.find(dropdownOption => dropdownOption.key === activeMappedConfig.key);\r\n };\r\n\r\n private readonly _onUpdateRefiners = (itemToggleNotification: IRefineItemToggleNotification): void => {\r\n const { context } = this.props;\r\n const requestContext = context && context.request;\r\n const actionContext = context && context.actionContext;\r\n\r\n if (!requestContext || !actionContext || !this.props.data.listPageState.result) {\r\n const error = `Refine menu cannot refine search criteria: ${!requestContext ? 'requestContext ' : ''} ${!actionContext ? 'actionContext ' : ''\r\n } could not be found`;\r\n this.props.telemetry.warning(error);\r\n }\r\n\r\n const updatedRefinementCriteria = getUpdatedRefinementCriteria(\r\n itemToggleNotification,\r\n (this.props.data.listPageState.result && this.props.data.listPageState.result.activeFilters) || []\r\n );\r\n\r\n window.history.pushState({}, '', buildListPageUrl(getCurrentUrl(this.props.context.request), updatedRefinementCriteria));\r\n transaction(() => {\r\n this.props.data.listPageState.result!.currentPageNumber = 0;\r\n this.props.data.listPageState.result!.activeFilters = updatedRefinementCriteria;\r\n });\r\n };\r\n\r\n private readonly _buildRefinerUrl = (itemToggleNotification: IRefineItemToggleNotification): string => {\r\n if (this.props.data.listPageState.result) {\r\n const newRefinementCriteria = getUpdatedRefinementCriteria(\r\n itemToggleNotification,\r\n this.props.data.listPageState.result.activeFilters || []\r\n );\r\n\r\n return buildListPageUrl(getCurrentUrl(this.props.context.request), newRefinementCriteria);\r\n }\r\n this.props.telemetry.warning('[buildRefinerQueryString]List Page State Not available, unable to build refiner URL');\r\n return '';\r\n };\r\n\r\n private readonly _onChoiceClicked = (notification: IChoiceSummaryClickNotification): void => {\r\n const { data, telemetry } = this.props;\r\n\r\n if (!data.listPageState.result) {\r\n telemetry.warning('[choice-summary-by-category._onChoiceClicked]ListPageState unavailable, unable to update refiners.');\r\n return;\r\n }\r\n\r\n let currentRefinementCriteria = (data.listPageState.result && data.listPageState.result.activeFilters) || [];\r\n\r\n if (!notification.clearAll) {\r\n const selectedChoice = notification.choiceClicked;\r\n if (!selectedChoice) {\r\n telemetry.warning('[choice-summary-by-category._onChoiceClicked] Choice could not be determined');\r\n return;\r\n }\r\n currentRefinementCriteria = currentRefinementCriteria.filter(\r\n (selectedCriterion: ProductRefinerValue) => !isMatchingRefinementCriterion(selectedChoice, selectedCriterion)\r\n );\r\n } else {\r\n currentRefinementCriteria = [];\r\n\r\n // Set focus to sort and filter\r\n const dropdownElementId = this._sortAndFilterContainerRef.current && this._sortAndFilterContainerRef.current.props.dropdownId;\r\n const dropdownElement = dropdownElementId && document.getElementById(dropdownElementId);\r\n setTimeout(() => {\r\n dropdownElement && dropdownElement.focus();\r\n }, 50);\r\n }\r\n\r\n const fullUrl = getCurrentUrl(this.props.context.request);\r\n window.history.pushState({}, '', buildListPageUrl(fullUrl, currentRefinementCriteria));\r\n data.listPageState.result.currentPageNumber = 0;\r\n data.listPageState.result.activeFilters = currentRefinementCriteria;\r\n };\r\n\r\n private readonly _buildRefinerUrlForChoiceSummary = (selectedRefiner: ProductRefinerValue, isClearAll: boolean): string => {\r\n const { data, telemetry } = this.props;\r\n const fullUrl = getCurrentUrl(this.props.context.request);\r\n\r\n if (!data.listPageState.result) {\r\n telemetry.warning('[choice-summary-by-category._buildRefinerUrl]ListPageState unavailable, unable to create refiner URL.');\r\n return fullUrl.href;\r\n }\r\n\r\n let currentRefinementCriteria = (data.listPageState.result && data.listPageState.result.activeFilters) || [];\r\n\r\n if (!isClearAll) {\r\n if (!selectedRefiner) {\r\n telemetry.warning('[choice-summary-by-category._buildRefinerUrl] URL for Choice could not be determined');\r\n return fullUrl.href;\r\n }\r\n currentRefinementCriteria = currentRefinementCriteria.filter(\r\n (selectedCriterion: ProductRefinerValue) => !isMatchingRefinementCriterion(selectedRefiner, selectedCriterion)\r\n );\r\n } else {\r\n currentRefinementCriteria = [];\r\n }\r\n\r\n return buildListPageUrl(fullUrl, currentRefinementCriteria);\r\n };\r\n\r\n private _getViewport(): GridSize {\r\n if (MsDyn365.isBrowser) {\r\n return isMobile({ variant: VariantType.Browser, context: this.props.context.request });\r\n }\r\n return isMobile({ variant: VariantType.Viewport, context: this.props.context.request });\r\n }\r\n\r\n private _toggleModal(): void {\r\n this.setState({\r\n modalIsOpen: !this.state.modalIsOpen\r\n });\r\n }\r\n\r\n private _updateViewport(): void {\r\n this._viewport = this._getViewport();\r\n\r\n if (this.state.modalIsOpen && !this.isMobile) {\r\n this._toggleModal();\r\n }\r\n }\r\n\r\n private readonly _getexpandRefinerCount = (validRefiners?: number, refinerCount?: expandRefinersCount): void => {\r\n switch (refinerCount) {\r\n case expandRefinersCount.all:\r\n this.expandrefinerCount = validRefiners;\r\n break;\r\n case expandRefinersCount.one:\r\n this.expandrefinerCount = 1;\r\n break;\r\n case expandRefinersCount.two:\r\n this.expandrefinerCount = 2;\r\n break;\r\n case expandRefinersCount.three:\r\n this.expandrefinerCount = 3;\r\n break;\r\n case expandRefinersCount.four:\r\n this.expandrefinerCount = 4;\r\n break;\r\n default:\r\n this.expandrefinerCount = 0;\r\n }\r\n };\r\n\r\n /**\r\n * Renders a Pagination previous text.\r\n * @param paginationPreviousText - Pagination previous text from resources.\r\n * @returns Previous text and flipper icon.\r\n */\r\n private readonly _renderPrev = (paginationPreviousText: string) => {\r\n return (\r\n <div className='msc-pagination__prev'>\r\n <span className='ms-search-result__pagination-left' aria-hidden='true' />\r\n <span className='prev-text'>{paginationPreviousText}</span>\r\n </div>\r\n );\r\n };\r\n\r\n /**\r\n * Renders a Pagination next text.\r\n * @param paginationNextText - Pagination next text from resources.\r\n * @returns Next text and flipper icon.\r\n */\r\n private readonly _renderNext = (paginationNextText: string) => {\r\n return (\r\n <div className='msc-pagination__next'>\r\n <span className='next-text'>{paginationNextText}</span>\r\n <span className='ms-search-result__pagination-right' aria-hidden='true' />\r\n </div>\r\n );\r\n };\r\n}\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { ISearchResultModalViewProps } from './components';\r\nimport {\r\n ICategoryHierarchyViewProps,\r\n IRefineMenuViewProps,\r\n ISearchResultContainerViewProps,\r\n ISortByViewProps,\r\n ITitleViewProps\r\n} from './sgi-search-new-arrivals-container';\r\n\r\nimport { IPriceComponentResources } from '@msdyn365-commerce/components';\r\nimport MsDyn365 from '@msdyn365-commerce/core';\r\nimport { ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\nimport { Button, getTelemetryObject, Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport React, { MouseEventHandler, useEffect, useState } from 'react';\r\n\r\nimport {\r\n ISgiSearchNewArrivalsContainerProps,\r\n ISgiSearchNewArrivalsContainerResources\r\n} from './sgi-search-new-arrivals-container.props.autogenerated';\r\nimport { ProductComponent } from '../../themes/sgi-theme/views/components/product.component';\r\n\r\n/**\r\n * DescriptionInterval.\r\n */\r\nenum DescriptionInterval {\r\n productDescriptionInterval = 14,\r\n productDescriptionIntervalRemainder0 = 0,\r\n productDescriptionIntervalRemainder9 = 9\r\n}\r\n\r\n/**\r\n * Render Clear button for mobile viewport.\r\n * @param props - The view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderProductCards = (props: ISearchResultContainerViewProps & ISgiSearchNewArrivalsContainerProps<{}>): JSX.Element | null => {\r\n return (\r\n <Node {...props.ProductsContainer}>\r\n {/* {props.errorMessage} */}\r\n {props.products}\r\n </Node>\r\n );\r\n};\r\n\r\n/**\r\n * Returns the product inventory label.\r\n * @param channelInventoryConfigurationId - The channel configuration Id.\r\n * @param product - The product.\r\n * @returns The inventory label.\r\n */\r\nfunction getInventoryLabel(channelInventoryConfigurationId: number | undefined, product: ProductSearchResult): string | undefined {\r\n if (!channelInventoryConfigurationId || !ArrayExtensions.hasElements(product.AttributeValues)) {\r\n return undefined;\r\n }\r\n const inventoryAttribute = product.AttributeValues.find(attribute => attribute.RecordId === channelInventoryConfigurationId);\r\n if (inventoryAttribute) {\r\n return inventoryAttribute.TextValue;\r\n }\r\n return undefined;\r\n}\r\n\r\n/**\r\n * Render Clear button for mobile viewport.\r\n * @param props - The view props.\r\n * @param product - The product item data.\r\n * @param index - The index of each product item.\r\n * @param isEnabledProductDescription - The flag for showing Product desription tile.\r\n * @returns The JSX Element.\r\n */\r\nconst renderProductCardsDescription = (\r\n props: ISearchResultContainerViewProps & ISgiSearchNewArrivalsContainerProps<{}>,\r\n product: ProductSearchResult,\r\n index: number,\r\n isEnabledProductDescription?: boolean\r\n): JSX.Element | null => {\r\n const { config, context, resources } = props;\r\n const telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.friendlyName, props.telemetry);\r\n const breadCrumbType = props.context.app.config.breadcrumbType;\r\n const isAllowBack = props.config.allowBackNavigation && (breadCrumbType === 'back' || breadCrumbType === 'categoryAndBack');\r\n const classname = isEnabledProductDescription\r\n ? 'ms-product-search-result__item product__description'\r\n : 'ms-product-search-result__item';\r\n const quickviewslot = ArrayExtensions.hasElements(props.slots.quickview) ? props.slots.quickview[0] : undefined;\r\n const channelInventoryConfigurationId = props.data.products.result?.channelInventoryConfigurationId;\r\n const isPriceMinMaxFeatureState = props.data.featureState.result?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailSearchPriceRangeFeature'\r\n );\r\n const priceResources: IPriceComponentResources = {\r\n priceRangeSeparator: resources.priceRangeSeparator\r\n };\r\n return (\r\n <li className={classname} key={index}>\r\n <ProductComponent\r\n context={context}\r\n telemetryContent={telemetryContent}\r\n imageSettings={config.imageSettings}\r\n freePriceText={resources.priceFree}\r\n originalPriceText={resources.originalPriceText}\r\n currentPriceText={resources.currentPriceText}\r\n ratingAriaLabel={resources.ratingAriaLabel}\r\n allowBack={isAllowBack}\r\n id={props.id}\r\n key={product.RecordId}\r\n typeName={props.typeName}\r\n data={{ product }}\r\n quickViewButton={quickviewslot}\r\n isEnabledProductDescription={isEnabledProductDescription}\r\n inventoryLabel={getInventoryLabel(channelInventoryConfigurationId, product)}\r\n isPriceMinMaxEnabled={isPriceMinMaxFeatureState?.IsEnabled}\r\n priceResources={priceResources}\r\n swatchItemAriaLabel={resources.swatchItemAriaLabel}\r\n />\r\n </li>\r\n );\r\n};\r\n\r\n/**\r\n * Render Clear button for mobile viewport.\r\n * @param props - The view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderProducts = (props: ISearchResultContainerViewProps & ISgiSearchNewArrivalsContainerProps<{}>): JSX.Element | null => {\r\n const products = props.data.listPageState.result?.activeProducts;\r\n if (!products || !ArrayExtensions.hasElements(products)) {\r\n return null;\r\n }\r\n const productDescriptionInterval: number = DescriptionInterval.productDescriptionInterval;\r\n const productDescriptionIntervalRemainder0: number = DescriptionInterval.productDescriptionIntervalRemainder0;\r\n const productDescriptionIntervalRemainder9: number = DescriptionInterval.productDescriptionIntervalRemainder9;\r\n return (\r\n <Node {...props.ProductsContainer}>\r\n {props.errorMessage}\r\n <ul className='list-unstyled'>\r\n {products.map((product: ProductSearchResult, index: number) =>\r\n index % productDescriptionInterval === productDescriptionIntervalRemainder0 ||\r\n index % productDescriptionInterval === productDescriptionIntervalRemainder9\r\n ? renderProductCardsDescription(props, product, index, true)\r\n : renderProductCardsDescription(props, product, index, false)\r\n )}\r\n </ul>\r\n </Node>\r\n );\r\n};\r\n\r\n/**\r\n * Render Title Count.\r\n * @param props - The title view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderTitleCount = (props: ITitleViewProps): JSX.Element | null => {\r\n const { title, TitleContainer } = props;\r\n if (title) {\r\n return <Node {...TitleContainer}>{title.titleCount}</Node>;\r\n }\r\n return null;\r\n};\r\n\r\n/**\r\n * Render Category Hierarchy.\r\n * @param props - The category hierarchy view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderCategoryHierarchy = (props: ICategoryHierarchyViewProps): JSX.Element | null => {\r\n const { CategoryHierarchyContainer, categoryHierarchyList, categoryHierarchySeparator } = props;\r\n if (categoryHierarchyList) {\r\n return (\r\n <Node {...CategoryHierarchyContainer}>\r\n {categoryHierarchyList.map((category, index) => (\r\n <React.Fragment key={index}>\r\n {category}\r\n {categoryHierarchyList[index + 1] && categoryHierarchySeparator}\r\n </React.Fragment>\r\n ))}\r\n </Node>\r\n );\r\n }\r\n\r\n return null;\r\n};\r\n\r\n/**\r\n * Function to make filter sticky.\r\n * @param isMobile - The boolean prop.\r\n * @param isStickyHeader - The boolean prop.\r\n */\r\nexport const configureStickyFilter = (isMobile: boolean, isStickyHeader: boolean): void => {\r\n // Get heights of cookie and promotion banners\r\n const defaultValue = 0;\r\n const defaultOffset = 28;\r\n const headerContainer: HTMLElement | null = document.querySelector('.ms-header');\r\n\r\n const headerHeight: number | undefined = headerContainer?.offsetHeight;\r\n const containerHeight: number = headerHeight ?? defaultOffset;\r\n const bannerHeights = isStickyHeader ? defaultValue : containerHeight;\r\n const headerElement = document.querySelector('header .lock-opaque');\r\n const defaultContainer = document.querySelector('header .default-container');\r\n const refinerElement = isMobile ? document.querySelector('.msc-sort-filter-wrapper') : document.querySelector('.ms-refiner-heading');\r\n if (refinerElement && headerElement && defaultContainer) {\r\n if (MsDyn365.isBrowser && document.documentElement.scrollTop > bannerHeights) {\r\n refinerElement.classList.add('lock-Filter');\r\n refinerElement.setAttribute('style', `top: ${defaultContainer.clientHeight}px`);\r\n } else {\r\n refinerElement.classList.remove('lock-Filter');\r\n }\r\n } else if (refinerElement) {\r\n if (MsDyn365.isBrowser && document.documentElement.scrollTop > bannerHeights) {\r\n refinerElement.classList.add('lock-top');\r\n } else {\r\n refinerElement.classList.remove('lock-top');\r\n refinerElement.classList.remove('lock-Filter');\r\n refinerElement.removeAttribute('style');\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * Function to setup filter sticky.\r\n * @param isMobile - The boolean prop.\r\n * @param isStickyHeader - The boolean prop.\r\n */\r\nfunction stickyFilterSetup(isMobile: boolean, isStickyHeader: boolean): void {\r\n window.addEventListener('scroll', () => {\r\n configureStickyFilter(isMobile, isStickyHeader);\r\n });\r\n configureStickyFilter(isMobile, isStickyHeader);\r\n}\r\n\r\n/**\r\n * Function to make filter sticky.\r\n * @param refinerRefernce - Ref prop for filter.\r\n * @param toggle - Toggle function for filter menu.\r\n */\r\nfunction useOutsideClick(refinerRefernce: React.RefObject<HTMLElement>, toggle: (event: Event) => void) {\r\n React.useEffect(() => {\r\n /**\r\n * Function to make filter sticky.\r\n * @param event - Event prop for filter.\r\n */\r\n function handleClickOutside(event: Event) {\r\n const element = document.querySelector('.ms-refine-filter__toggle_collapsed');\r\n if (refinerRefernce.current && !refinerRefernce.current.contains(event.target as Node) && !element) {\r\n toggle(event);\r\n }\r\n }\r\n if (MsDyn365.isBrowser) {\r\n document.addEventListener('click', handleClickOutside);\r\n }\r\n return () => {\r\n if (MsDyn365.isBrowser) {\r\n document.removeEventListener('click', handleClickOutside);\r\n }\r\n };\r\n }, [refinerRefernce, toggle]);\r\n}\r\n\r\n/**\r\n * Render the category page items.\r\n * @param props - The view props.\r\n * @returns The search Result container module view.\r\n */\r\nconst SearchResultContainerView: React.FC<ISearchResultContainerViewProps & ISgiSearchNewArrivalsContainerProps<{}>> = props => {\r\n const {\r\n SearchResultContainer,\r\n pagination,\r\n ProductSectionContainer,\r\n choiceSummary,\r\n isMobile,\r\n modalToggle,\r\n searchResultModal,\r\n TitleViewProps,\r\n refineMenu,\r\n categoryHierarchy,\r\n sortByOptions,\r\n CategoryNavContainer,\r\n RefineAndProductSectionContainer,\r\n FeatureSearchContainer,\r\n similarLookProduct,\r\n errorMessage,\r\n resources\r\n } = props;\r\n useEffect(() => {\r\n if (props.config.useStickyFilter && MsDyn365.isBrowser) {\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- app context is generic\r\n stickyFilterSetup(props.isMobile, props.context.app.config.enableStickyHeader as boolean);\r\n }\r\n }, [props]);\r\n const [isExpanded, setIsExpanded] = useState<boolean>(false);\r\n const toggle = () => {\r\n setIsExpanded(!isExpanded);\r\n };\r\n const wrapperRefiner = React.useRef(null);\r\n useOutsideClick(wrapperRefiner, toggle);\r\n const isRecoSearchPage = props.context.actionContext.requestContext.query?.recommendation;\r\n if (isMobile) {\r\n return (\r\n <Module {...SearchResultContainer}>\r\n {similarLookProduct ? null : (\r\n <Node {...CategoryNavContainer}>\r\n {renderCategoryHierarchy(categoryHierarchy)}\r\n {renderTitle(TitleViewProps)}\r\n {renderTitleCount(TitleViewProps)}\r\n </Node>\r\n )}\r\n {choiceSummary}\r\n <Node className='msc-sort-filter-wrapper'>{modalToggle}</Node>\r\n {createSearchResultModal(searchResultModal, refineMenu, sortByOptions, isRecoSearchPage)}\r\n <Node {...FeatureSearchContainer}>{similarLookProduct}</Node>\r\n {errorMessage}\r\n {props.config.enableProdutDescription ? renderProducts(props) : renderProductCards(props)}\r\n {pagination}\r\n </Module>\r\n );\r\n }\r\n return (\r\n <Module {...SearchResultContainer}>\r\n {similarLookProduct ? null : (\r\n <Node {...CategoryNavContainer}>\r\n {categoryHierarchy && renderCategoryHierarchy(categoryHierarchy)}\r\n {TitleViewProps && renderTitle(TitleViewProps)}\r\n {TitleViewProps && renderTitleCount(TitleViewProps)}\r\n </Node>\r\n )}\r\n <Node {...FeatureSearchContainer}>{similarLookProduct}</Node>\r\n <Node {...RefineAndProductSectionContainer}>\r\n <Node ref={wrapperRefiner} className='ms-refiner-heading'>\r\n <Node className='ms-refiner-heading_title'>\r\n <Button\r\n className={isExpanded ? 'ms-refine-filter__toggle_expanded' : 'ms-refine-filter__toggle_collapsed'}\r\n aria-label='Filter'\r\n onClick={toggle}\r\n aria-expanded={isExpanded}\r\n tabIndex={0}\r\n >\r\n {resources.filterText}\r\n </Button>\r\n <div className='ms-search-result-wrapper-title-choice-summary'>{choiceSummary}</div>\r\n <div className='ms-search-result-wrapper-sort-by-category'>\r\n {sortByOptions && !isRecoSearchPage && renderSort(sortByOptions)}\r\n </div>\r\n </Node>\r\n {refineMenu && isExpanded && renderRefiner(refineMenu)}\r\n <Node className='ms-refine__footer'>\r\n {refineMenu && isExpanded && renderRefinerFooter(refineMenu, toggle, resources)}\r\n </Node>\r\n </Node>\r\n\r\n <Node {...ProductSectionContainer}>\r\n {errorMessage}\r\n {props.config.enableProdutDescription ? renderProducts(props) : renderProductCards(props)}\r\n {pagination}\r\n </Node>\r\n </Node>\r\n </Module>\r\n );\r\n};\r\n\r\n/**\r\n * Render Search result Modal.\r\n * @param modalProps - The Search Result Modal view props.\r\n * @param refineMenu - The Refine Menu view props.\r\n * @param sortByDropDown - The Sort by view props.\r\n * @param isRecoSearchPage - The recomandation search page flag.\r\n * @returns The JSX Element.\r\n */\r\nconst createSearchResultModal = (\r\n modalProps: ISearchResultModalViewProps,\r\n refineMenu: IRefineMenuViewProps,\r\n sortByDropDown: ISortByViewProps,\r\n isRecoSearchPage?: string\r\n): JSX.Element => {\r\n return React.cloneElement(\r\n modalProps.modal,\r\n {},\r\n modalProps.modalHeader,\r\n createModalBody(modalProps, refineMenu, sortByDropDown, isRecoSearchPage),\r\n modalProps.modalFooter\r\n );\r\n};\r\n\r\n/**\r\n * Render Refiner Mobile.\r\n * @param props - The Refine Menu view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderRefinerMobile = (props: IRefineMenuViewProps): JSX.Element | null => {\r\n const { refiners, RefineMenuContainer, RefinerSectionContainer } = props;\r\n if (refiners) {\r\n return (\r\n <Node {...RefinerSectionContainer}>\r\n <Node {...RefineMenuContainer}>\r\n {refiners.map((submenu, index) => (\r\n <React.Fragment key={index}>{submenu}</React.Fragment>\r\n ))}\r\n </Node>\r\n </Node>\r\n );\r\n }\r\n return null;\r\n};\r\n\r\n/**\r\n * Render Search result Body.\r\n * @param props - The Search Result Modal view props.\r\n * @param refineMenu - The Refine Menu view props.\r\n * @param sortByDropDown - The Sort by view props.\r\n * @param isRecoSearchPage - The recomandation search page flag.\r\n * @returns The JSX Element.\r\n */\r\nconst createModalBody = (\r\n props: ISearchResultModalViewProps,\r\n refineMenu: IRefineMenuViewProps,\r\n sortByDropDown: ISortByViewProps,\r\n isRecoSearchPage?: string\r\n): JSX.Element | null => {\r\n if (sortByDropDown) {\r\n return React.cloneElement(props.modalBody, {}, renderSort(sortByDropDown, isRecoSearchPage), renderRefinerMobile(refineMenu));\r\n }\r\n return null;\r\n};\r\n\r\n/**\r\n * Render Refiner.\r\n * @param props - The Refine Menu view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderRefiner = (props: IRefineMenuViewProps): JSX.Element | null => {\r\n const { refiners, RefineMenuContainer, RefinerSectionContainer } = props;\r\n if (refiners) {\r\n return (\r\n <Node {...RefinerSectionContainer}>\r\n <Node {...RefineMenuContainer}>\r\n {refiners.map((submenu, index) => (\r\n <React.Fragment key={index}>{submenu}</React.Fragment>\r\n ))}\r\n </Node>\r\n </Node>\r\n );\r\n }\r\n return null;\r\n};\r\n\r\n/**\r\n * Render Refiner Footer.\r\n * @param props - The Refine Menu view props.\r\n * @param handler - The Refine menu toggle function.\r\n * @param resources - Resources to get the done text and aria label.\r\n * @returns The JSX Element.\r\n */\r\nconst renderRefinerFooter = (\r\n props: IRefineMenuViewProps,\r\n handler: MouseEventHandler,\r\n resources: ISgiSearchNewArrivalsContainerResources\r\n): JSX.Element | null => {\r\n const { refiners } = props;\r\n if (refiners) {\r\n return (\r\n <Node className='ms-refine__footer__done'>\r\n <Node tag='button' className='ms-refine-filter-done' aria-label={resources.doneAriaLabel} tabIndex={0} onClick={handler}>\r\n {resources.doneText}\r\n </Node>\r\n </Node>\r\n );\r\n }\r\n return null;\r\n};\r\n\r\n/**\r\n * Render sort by drop down.\r\n * @param props - The sort by view props.\r\n * @param isRecoSearchPage - The recomandation search page flag.\r\n * @returns The JSX Element.\r\n */\r\nconst renderSort = (props: ISortByViewProps, isRecoSearchPage?: string): JSX.Element | null => {\r\n const { SortingContainer, sortByDropDown } = props;\r\n if (sortByDropDown && !isRecoSearchPage) {\r\n return <Node {...SortingContainer}>{sortByDropDown}</Node>;\r\n }\r\n return null;\r\n};\r\n\r\n/**\r\n * Render Title.\r\n * @param props - The title view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderTitle = (props: ITitleViewProps): JSX.Element | null => {\r\n const { title, TitleContainer } = props;\r\n if (title) {\r\n return (\r\n <Node {...TitleContainer}>\r\n <Node tag='h1' className=''>\r\n {title.titlePrefix}\r\n {title.titleText}\r\n </Node>\r\n </Node>\r\n );\r\n }\r\n return null;\r\n};\r\n\r\nexport default SearchResultContainerView;\r\n","import { AttributeValue } from '@msdyn365-commerce/retail-proxy';\r\n\r\nexport const getAttributeByName = (attributes: AttributeValue[] | undefined, keyName: string | undefined): AttributeValue | undefined => {\r\n return attributes?.find((attr: AttributeValue) => attr.Name?.toLowerCase() === keyName?.toLowerCase());\r\n};\r\nexport const getAttributeByKeyName = (\r\n attributes: AttributeValue[] | undefined,\r\n keyName: string | undefined\r\n): AttributeValue | undefined => {\r\n return attributes?.find((attr: AttributeValue) => attr.KeyName?.toLowerCase() === keyName?.toLowerCase());\r\n};\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { IProductsDimensionsAvailabilities } from '@msdyn365-commerce/commerce-entities';\r\nimport {\r\n IPriceComponentResources,\r\n ISwatchItem,\r\n PriceComponent,\r\n ProductComponentSwatchComponent,\r\n RatingComponent\r\n} from '@msdyn365-commerce/components';\r\nimport {\r\n IAny,\r\n IComponent,\r\n IComponentProps,\r\n ICoreContext,\r\n IGeneric,\r\n IGridSettings,\r\n IImageData,\r\n IImageSettings,\r\n Image,\r\n msdyn365Commerce\r\n} from '@msdyn365-commerce/core';\r\nimport { AttributeSwatch, AttributeValue, ProductDimension, ProductPrice, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ArrayExtensions,\r\n convertDimensionTypeToProductDimensionType,\r\n Dictionary,\r\n DimensionTypes,\r\n generateImageUrl,\r\n getProductPageUrlSync,\r\n IDimensionsApp,\r\n StringExtensions\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n format,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n ITelemetryContent,\r\n onTelemetryClick\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport React, { useState } from 'react';\r\nimport { getAttributeByName } from '../Utilities/utility';\r\n\r\nexport interface IProductComponentProps extends IComponentProps<{ product?: ProductSearchResult }> {\r\n className?: string;\r\n imageSettings?: IImageSettings;\r\n savingsText?: string;\r\n freePriceText?: string;\r\n originalPriceText?: string;\r\n currentPriceText?: string;\r\n ratingAriaLabel?: string;\r\n ratingCountAriaLabel?: string;\r\n allowBack?: boolean;\r\n telemetryContent?: ITelemetryContent;\r\n quickViewButton?: React.ReactNode;\r\n isEnabledProductDescription?: boolean;\r\n isPriceMinMaxEnabled?: boolean;\r\n priceResources?: IPriceComponentResources;\r\n inventoryLabel?: string;\r\n dimensionAvailabilities?: IProductsDimensionsAvailabilities[];\r\n swatchItemAriaLabel?: string;\r\n}\r\n\r\nexport interface IProductComponent extends IComponent<IProductComponentProps> {}\r\n\r\nconst PriceComponentActions = {};\r\n\r\n/**\r\n * Gets the product page url from the default swatch selected.\r\n * @param productData - Product card to be rendered.\r\n * @returns The default color swatch selected if any.\r\n */\r\nfunction getDefaultColorSwatchSelected(productData?: ProductSearchResult): AttributeSwatch | null {\r\n if (!productData || !productData.AttributeValues) {\r\n return null;\r\n }\r\n\r\n const colorAttribute = productData.AttributeValues.find(\r\n attributeValue => attributeValue.KeyName?.toLocaleLowerCase() === DimensionTypes.color\r\n );\r\n if (!colorAttribute) {\r\n return null;\r\n }\r\n\r\n const defaultSwatch = colorAttribute.Swatches?.find(item => item.IsDefault === true) ?? colorAttribute.Swatches?.[0];\r\n return defaultSwatch ?? null;\r\n}\r\n\r\n/**\r\n * Gets the product image from the default swatch selected.\r\n * @param coreContext - Context of the module using the component.\r\n * @param productData - Product card to be rendered.\r\n * @returns The product card image url.\r\n */\r\nfunction getProductImageUrlFromDefaultColorSwatch(coreContext: ICoreContext, productData?: ProductSearchResult): string | undefined {\r\n const siteContext = coreContext as ICoreContext<IDimensionsApp>;\r\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\r\n if (dimensionToPreSelectInProductCard === DimensionTypes.none) {\r\n return productData?.PrimaryImageUrl;\r\n }\r\n const defaultSwatch = getDefaultColorSwatchSelected(productData);\r\n return defaultSwatch && ArrayExtensions.hasElements(defaultSwatch.ProductImageUrls)\r\n ? generateImageUrl(defaultSwatch.ProductImageUrls[0], coreContext.request.apiSettings)\r\n : productData?.PrimaryImageUrl;\r\n}\r\n\r\n/**\r\n * Updates the product url link to product details page.\r\n * @param productDetailsPageUrl - Product page url.\r\n * @param coreContext - Context of the module using the component.\r\n * @param queryString - Querystring to be added to the URL.\r\n * @returns The update product page url.\r\n */\r\nfunction updateProductUrl(productDetailsPageUrl: string, coreContext: ICoreContext, queryString: string): string {\r\n const sourceUrl = new URL(productDetailsPageUrl, coreContext.request.apiSettings.baseUrl);\r\n if (sourceUrl.search) {\r\n sourceUrl.search += `&${queryString}`;\r\n } else {\r\n sourceUrl.search += queryString;\r\n }\r\n\r\n const updatedUrl = new URL(sourceUrl.href);\r\n return updatedUrl.pathname + sourceUrl.search;\r\n}\r\n\r\n/**\r\n * Gets the react node for product unit of measure display.\r\n * @param unitOfMeasure - DefaultUnitOfMeasure property from product.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\nfunction renderProductUnitOfMeasure(unitOfMeasure?: string): JSX.Element | null {\r\n if (!unitOfMeasure) {\r\n return null;\r\n }\r\n return (\r\n <div className='msc-product__unit-of-measure'>\r\n <span>{unitOfMeasure}</span>\r\n </div>\r\n );\r\n}\r\n\r\n/**\r\n * Gets the react node for product availability.\r\n * @param inventoryAvailabilityLabel - The product information.\r\n * @returns The node representing markup for product availability.\r\n */\r\nfunction renderProductAvailability(inventoryAvailabilityLabel: string | undefined): JSX.Element | null {\r\n if (!inventoryAvailabilityLabel || inventoryAvailabilityLabel === '') {\r\n return null;\r\n }\r\n\r\n return (\r\n <div className='msc-product__availability'>\r\n <span>{inventoryAvailabilityLabel}</span>\r\n </div>\r\n );\r\n}\r\n\r\n/**\r\n * Gets the product page url from the default swatch selected.\r\n * @param coreContext - Context of the module using the component.\r\n * @param productUrl - Product page url for the product card.\r\n * @param productData - Product card to be rendered.\r\n * @returns The product card image url.\r\n */\r\nfunction getProductPageUrlFromDefaultSwatch(\r\n coreContext: ICoreContext,\r\n productUrl: string,\r\n productData?: ProductSearchResult\r\n): string | undefined {\r\n const siteContext = coreContext as ICoreContext<IDimensionsApp>;\r\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\r\n if (dimensionToPreSelectInProductCard === DimensionTypes.none) {\r\n return productUrl;\r\n }\r\n\r\n const defaultSwatch = getDefaultColorSwatchSelected(productData);\r\n if (!defaultSwatch || !defaultSwatch.SwatchValue) {\r\n return productUrl;\r\n }\r\n\r\n const queryString = `color=${defaultSwatch.SwatchValue}`;\r\n return updateProductUrl(productUrl, coreContext, queryString);\r\n}\r\n\r\nconst ProductCard: React.FC<IProductComponentProps> = ({\r\n data,\r\n context,\r\n imageSettings,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText,\r\n ratingAriaLabel,\r\n ratingCountAriaLabel,\r\n allowBack,\r\n typeName,\r\n id,\r\n telemetryContent,\r\n quickViewButton,\r\n isEnabledProductDescription,\r\n isPriceMinMaxEnabled,\r\n priceResources,\r\n inventoryLabel,\r\n dimensionAvailabilities,\r\n swatchItemAriaLabel\r\n}) => {\r\n const product = data.product;\r\n let productUrl = getProductPageUrlSync(product?.Name ?? '', product?.RecordId ?? Number.MIN_VALUE, context.actionContext, undefined);\r\n if (allowBack) {\r\n productUrl = updateProductUrl(productUrl, context, 'back=true');\r\n }\r\n let productImageUrlFromSwatch = getProductImageUrlFromDefaultColorSwatch(context, product) ?? product?.PrimaryImageUrl;\r\n const productPageUrlFromSwatch = getProductPageUrlFromDefaultSwatch(context, productUrl, product) ?? productUrl;\r\n const [productPageUrl, setProductPageUrl] = useState<string>(productPageUrlFromSwatch);\r\n const [productImageUrl, setProductImageUrl] = useState<string | undefined>(productImageUrlFromSwatch);\r\n React.useEffect(() => {\r\n setProductPageUrl(productPageUrlFromSwatch);\r\n setProductImageUrl(productImageUrlFromSwatch);\r\n }, [productUrl, productPageUrlFromSwatch, productImageUrlFromSwatch]);\r\n const [selectedSwatchItems] = useState(new Dictionary<DimensionTypes, ISwatchItem>());\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access -- app context is generic\r\n const enableStockCheck = context.app.config.enableStockCheck;\r\n\r\n /**\r\n * Updates the product page and Image url based on swatch selected.\r\n * @param coreContext - Context of the caller.\r\n * @param swatchItem - Dimension swatch selected.\r\n */\r\n const updatePageAndImageUrl = React.useCallback(\r\n (coreContext: ICoreContext, swatchItem: ISwatchItem) => {\r\n const dimensionType = swatchItem.dimensionType;\r\n selectedSwatchItems.setValue(dimensionType, swatchItem);\r\n if (StringExtensions.isNullOrWhitespace(swatchItem.value)) {\r\n return;\r\n }\r\n const queryString = `${dimensionType}=${swatchItem.value}`;\r\n let productPageUrlWithSwatch = '';\r\n if (productPageUrl.includes(dimensionType)) {\r\n const newUrl = new URL(productPageUrl, coreContext.request.apiSettings.baseUrl);\r\n newUrl.searchParams.delete(dimensionType);\r\n productPageUrlWithSwatch = updateProductUrl(newUrl.toString(), context, queryString);\r\n } else {\r\n productPageUrlWithSwatch = updateProductUrl(productPageUrl, context, queryString);\r\n }\r\n setProductPageUrl(productPageUrlWithSwatch);\r\n if (dimensionType === DimensionTypes.color) {\r\n const swatchProductImageUrl = ArrayExtensions.hasElements(swatchItem.productImageUrls)\r\n ? swatchItem.productImageUrls[0]\r\n : undefined;\r\n const newImageUrl = generateImageUrl(swatchProductImageUrl, coreContext.request.apiSettings);\r\n setProductImageUrl(newImageUrl);\r\n }\r\n },\r\n [selectedSwatchItems, context, productPageUrl]\r\n );\r\n\r\n if (!product) {\r\n return null;\r\n }\r\n\r\n /**\r\n * Checks if rendering the particular dimensions is allowed for product card.\r\n * @param dimensionType - Dimension to be displayed.\r\n * @returns Updates the state with new product page url.\r\n */\r\n function shouldDisplayDimension(dimensionType: string): boolean {\r\n const dimensionsContext = context as ICoreContext<IDimensionsApp>;\r\n const dimensionsToDisplayOnProductCard = dimensionsContext.app.config.dimensionsInProductCard;\r\n return (\r\n ArrayExtensions.hasElements(dimensionsToDisplayOnProductCard) &&\r\n !dimensionsToDisplayOnProductCard.includes(DimensionTypes.none) &&\r\n dimensionsToDisplayOnProductCard.includes(dimensionType.toLocaleLowerCase() as DimensionTypes)\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react node for product dimension as swatch.\r\n * @param attributeValues - Attribute value property from product.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n function renderProductDimensions(attributeValues?: AttributeValue[]): JSX.Element | null {\r\n if (!attributeValues) {\r\n return null;\r\n }\r\n\r\n return (\r\n <div className='msc-product__dimensions'>\r\n {attributeValues.map((item: AttributeValue) => {\r\n const dimensionTypeValue = item.KeyName?.toLocaleLowerCase() ?? '';\r\n if (!shouldDisplayDimension(dimensionTypeValue)) {\r\n return null;\r\n }\r\n\r\n const siteContext = context as ICoreContext<IDimensionsApp>;\r\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\r\n const dimensionType = dimensionTypeValue as DimensionTypes;\r\n const swatches =\r\n item.Swatches?.map<ISwatchItem>(swatchItem => {\r\n return {\r\n itemId: `${item.RecordId ?? ''}-${dimensionTypeValue}-${swatchItem.SwatchValue ?? ''}`,\r\n value: swatchItem.SwatchValue ?? '',\r\n dimensionType,\r\n colorHexCode: swatchItem.SwatchColorHexCode,\r\n imageUrl: swatchItem.SwatchImageUrl,\r\n productImageUrls: swatchItem.ProductImageUrls,\r\n isDefault: swatchItem.IsDefault,\r\n swatchItemAriaLabel: swatchItemAriaLabel ? format(swatchItemAriaLabel, dimensionType) : '',\r\n isDisabled:\r\n enableStockCheck &&\r\n dimensionAvailabilities?.find(\r\n dimensionAvailability => dimensionAvailability.value === (swatchItem.SwatchValue ?? '')\r\n )?.isDisabled\r\n };\r\n }) ?? [];\r\n if (\r\n dimensionToPreSelectInProductCard !== DimensionTypes.none &&\r\n ArrayExtensions.hasElements(swatches) &&\r\n !swatches.some(swatch => swatch.isDefault) &&\r\n dimensionType === DimensionTypes.color\r\n ) {\r\n swatches[0].isDefault = true;\r\n }\r\n return (\r\n <ProductComponentSwatchComponent\r\n context={context}\r\n swatches={swatches}\r\n onSelectDimension={updatePageAndImageUrl}\r\n key={item.RecordId}\r\n />\r\n );\r\n })}\r\n </div>\r\n );\r\n }\r\n\r\n function renderQuickView(quickview: React.ReactNode, item?: number): JSX.Element | undefined {\r\n if (quickview === null) {\r\n return undefined;\r\n }\r\n const selectedDimensions: ProductDimension[] = selectedSwatchItems.getValues().map<ProductDimension>(swatches => {\r\n return {\r\n DimensionTypeValue: convertDimensionTypeToProductDimensionType(swatches.dimensionType),\r\n DimensionValue: {\r\n RecordId: 0,\r\n Value: swatches.value\r\n }\r\n };\r\n });\r\n return React.cloneElement(quickview as React.ReactElement, { selectedProductId: item, selectedDimensions });\r\n }\r\n\r\n // Construct telemetry attribute to render\r\n const payLoad = getPayloadObject('click', telemetryContent!, '', product.RecordId.toString());\r\n\r\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- -- Do not need type check for appsettings\r\n const isUnitOfMeasureEnabled = context.app.config && context.app.config.unitOfMeasureDisplayType === 'buyboxAndBrowse';\r\n const bookAuthorAttributeKey: string = (context.app.config && context.app.config.bookAuthorAttribute) || 'bookAuthor';\r\n return (\r\n <>\r\n {isEnabledProductDescription ? (\r\n <a\r\n href={productPageUrl}\r\n onClick={onTelemetryClick(telemetryContent!, payLoad, product.Name!)}\r\n aria-label={renderLabel(\r\n product.Name,\r\n context.cultureFormatter.formatCurrency(product.Price),\r\n product.AverageRating,\r\n ratingAriaLabel,\r\n product.TotalRatings,\r\n ratingCountAriaLabel\r\n )}\r\n className='msc-product'\r\n {...attribute}\r\n >\r\n <div className='msc-product__image__description'>\r\n <div className='msc-product__image'>\r\n {renderProductPlacementImage(\r\n imageSettings,\r\n context.request.gridSettings,\r\n productImageUrl,\r\n product.PrimaryImageUrl,\r\n product.Name,\r\n context\r\n )}\r\n </div>\r\n <div className='msc-product__title_description'>\r\n <h5 className='msc-product__title__text'>{product.Name}</h5>\r\n {renderBookAuthor(product.AttributeValues!, bookAuthorAttributeKey)}\r\n {renderPrice(\r\n context,\r\n typeName,\r\n id,\r\n product.BasePrice,\r\n product.Price,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText,\r\n isPriceMinMaxEnabled,\r\n priceResources\r\n )}\r\n {isUnitOfMeasureEnabled && renderProductUnitOfMeasure(product.DefaultUnitOfMeasure)}\r\n {renderDescription(product.Description)}\r\n </div>\r\n </div>\r\n </a>\r\n ) : (\r\n <a\r\n href={productPageUrl}\r\n onClick={onTelemetryClick(telemetryContent!, payLoad, product.Name!)}\r\n aria-label={renderLabel(\r\n product.Name,\r\n context.cultureFormatter.formatCurrency(product.Price),\r\n product.AverageRating,\r\n ratingAriaLabel\r\n )}\r\n className='msc-product'\r\n {...attribute}\r\n >\r\n <div className='msc-product__image'>\r\n {renderProductPlacementImage(\r\n imageSettings,\r\n context.request.gridSettings,\r\n productImageUrl,\r\n product.PrimaryImageUrl,\r\n product.Name,\r\n context\r\n )}\r\n </div>\r\n <div className='msc-product__details'>\r\n <h5 className='msc-product__title'>{product.Name}</h5>\r\n {renderBookAuthor(product.AttributeValues!, bookAuthorAttributeKey)}\r\n {renderPrice(\r\n context,\r\n typeName,\r\n id,\r\n product.BasePrice,\r\n product.Price,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText\r\n )}\r\n {isUnitOfMeasureEnabled && renderProductUnitOfMeasure(product.DefaultUnitOfMeasure)}\r\n </div>\r\n </a>\r\n )}\r\n {renderProductDimensions(product.AttributeValues)}\r\n {!context.app.config.hideRating &&\r\n renderRating(context, typeName, id, product.AverageRating, product.TotalRatings, ratingAriaLabel, ratingCountAriaLabel)}\r\n {renderProductAvailability(inventoryLabel)}\r\n {quickViewButton && renderQuickView(quickViewButton, product.RecordId)}\r\n </>\r\n );\r\n};\r\n\r\nfunction renderLabel(\r\n name?: string,\r\n price?: string,\r\n rating?: number,\r\n ratingAriaLabelText?: string,\r\n reviewCount?: number,\r\n ratingCountAriaLabelText?: string\r\n): string {\r\n const reviewCountArialableText = getReviewAriaLabel(reviewCount, ratingCountAriaLabelText ?? '');\r\n return `${name ?? ''} ${price ?? ''} ${getRatingAriaLabel(rating, ratingAriaLabelText)}${\r\n reviewCountArialableText ? ` ${reviewCountArialableText}` : ''\r\n }`;\r\n}\r\n\r\nfunction renderDescription(description?: string): JSX.Element | null {\r\n return <p className='msc-product__text'>{description}</p>;\r\n}\r\n\r\nfunction getRatingAriaLabel(rating?: number, ratingAriaLabel?: string): string {\r\n if (rating && ratingAriaLabel) {\r\n const roundedRating = rating.toFixed(2);\r\n return format(ratingAriaLabel || '', roundedRating, '5');\r\n }\r\n return '';\r\n}\r\n\r\nfunction getReviewAriaLabel(reviewCount?: number, ratingCountAriaLabelText?: string): string {\r\n if (reviewCount && ratingCountAriaLabelText) {\r\n return format(ratingCountAriaLabelText || '', reviewCount);\r\n }\r\n return '';\r\n}\r\n\r\nfunction renderRating(\r\n coreContext: ICoreContext,\r\n moduleTypeName: string,\r\n moduleId: string,\r\n avgRating?: number,\r\n totalRatings?: number,\r\n ariaLabel?: string,\r\n ratingCountAriaLabel?: string\r\n): JSX.Element | null {\r\n if (!avgRating) {\r\n return null;\r\n }\r\n\r\n const numberRatings = totalRatings?.toString() || undefined;\r\n const ratingAriaLabelText = getRatingAriaLabel(avgRating, ariaLabel);\r\n const ratingCountAriaLabelText = getReviewAriaLabel(Number(numberRatings), ratingCountAriaLabel);\r\n\r\n return (\r\n <RatingComponent\r\n context={coreContext}\r\n id={moduleId}\r\n typeName={moduleTypeName}\r\n avgRating={avgRating}\r\n ratingCount={numberRatings}\r\n readOnly\r\n ariaLabel={ratingAriaLabelText}\r\n ratingCountAriaLabel={ratingCountAriaLabelText}\r\n data={{}}\r\n />\r\n );\r\n}\r\n\r\nfunction renderPrice(\r\n context: ICoreContext,\r\n typeName: string,\r\n id: string,\r\n basePrice?: number,\r\n adjustedPrice?: number,\r\n savingsText?: string,\r\n freePriceText?: string,\r\n originalPriceText?: string,\r\n currentPriceText?: string,\r\n isPriceMinMaxEnabled?: boolean,\r\n priceResources?: IPriceComponentResources\r\n): JSX.Element | null {\r\n const price: ProductPrice = {\r\n BasePrice: basePrice,\r\n AdjustedPrice: adjustedPrice,\r\n CustomerContextualPrice: adjustedPrice\r\n };\r\n\r\n return (\r\n <PriceComponent\r\n context={context}\r\n id={id}\r\n typeName={typeName}\r\n data={{ price }}\r\n savingsText={savingsText}\r\n freePriceText={freePriceText}\r\n originalPriceText={originalPriceText}\r\n isPriceMinMaxEnabled={isPriceMinMaxEnabled}\r\n priceResources={priceResources}\r\n />\r\n );\r\n}\r\n\r\nfunction renderProductPlacementImage(\r\n imageSettings?: IImageSettings,\r\n gridSettings?: IGridSettings,\r\n imageUrl?: string,\r\n fallbackImageUrl?: string,\r\n altText?: string,\r\n context?: ICoreContext<IGeneric<IAny>>\r\n): JSX.Element | null {\r\n if (!imageUrl || !gridSettings || !imageSettings) {\r\n return null;\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment -- Site level config can be of any type.\r\n const contextConfig = context?.app.config?.placeholderImageName;\r\n const emptyPlaceHolderImage = contextConfig as string;\r\n let fallbackImageSource = fallbackImageUrl;\r\n if (emptyPlaceHolderImage && fallbackImageUrl) {\r\n fallbackImageSource = `${fallbackImageUrl},${emptyPlaceHolderImage}`;\r\n }\r\n const img: IImageData = {\r\n src: imageUrl,\r\n altText: altText ? altText : '',\r\n fallBackSrc: fallbackImageSource\r\n };\r\n const imageProps = {\r\n gridSettings,\r\n imageSettings\r\n };\r\n imageProps.imageSettings.cropFocalRegion = true;\r\n return (\r\n <Image\r\n requestContext={context?.actionContext.requestContext}\r\n {...img}\r\n {...imageProps}\r\n loadFailureBehavior='empty'\r\n bypassHideOnFailure\r\n />\r\n );\r\n}\r\n\r\nfunction renderBookAuthor(attributeValues: AttributeValue[], attributeKey: string): JSX.Element | null {\r\n const bookAuthorAttribute = getAttributeByName(attributeValues, attributeKey);\r\n if (bookAuthorAttribute) {\r\n return <p className='msc-product__book-author'>{bookAuthorAttribute?.TextValue}</p>;\r\n }\r\n return null;\r\n}\r\n\r\nexport const ProductComponent: React.FunctionComponent<IProductComponentProps> = msdyn365Commerce.createComponentOverride<\r\n IProductComponent\r\n>('Product', { component: ProductCard, ...PriceComponentActions });\r\n\r\nexport default ProductComponent;\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 (binding.modules['sgi-search-new-arrivals-container'] = {\n c: () => require('partner/modules/sgi-search-new-arrivals-container/sgi-search-new-arrivals-container.tsx'),\n $type: 'containerModule',\n da: [{name:'category', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-current-category', runOn: 0},{name:'categoryHierarchy', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-current-category-hierarchy', runOn: 0},{name:'featureProduct', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant', runOn: 0},{name:'featureState', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state', runOn: 0},{name:'listPageState', path:'modules/sgi-search-new-arrivals-container/list-page-state', runOn: 0},{name:'products', path:'modules/sgi-search-new-arrivals-container/actions/get-full-products-by-collection', runOn: 0},{name:'refiners', path:'modules/sgi-search-new-arrivals-container/actions/get-refiners-for-collection', runOn: 0},{name:'searchConfiguration', path:'modules/sgi-search-new-arrivals-container/actions/get-mapped-search-configuration', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'sgi-search-new-arrivals-container',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/sgi-search-new-arrivals-container'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-current-category';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-current-category');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-current-category-hierarchy';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-current-category-hierarchy');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'modules/sgi-search-new-arrivals-container/actions/get-full-products-by-collection';\n let dataAction = require('partner/modules/sgi-search-new-arrivals-container/actions/get-full-products-by-collection');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'modules/sgi-search-new-arrivals-container/actions/get-mapped-search-configuration';\n let dataAction = require('partner/modules/sgi-search-new-arrivals-container/actions/get-mapped-search-configuration');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'modules/sgi-search-new-arrivals-container/actions/get-refiners-for-collection';\n let dataAction = require('partner/modules/sgi-search-new-arrivals-container/actions/get-refiners-for-collection');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'modules/sgi-search-new-arrivals-container/list-page-state';\n let dataAction = require('partner/modules/sgi-search-new-arrivals-container/list-page-state');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|sgi-search-new-arrivals-container|sgi-search-new-arrivals-container'] = {\n c: () => require('partner/modules/sgi-search-new-arrivals-container/sgi-search-new-arrivals-container.view.tsx'),\n cn: '__local__-__local__-sgi-search-new-arrivals-container'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["AllRefinersInput","constructor","getCacheKey","getCacheObjectType","dataCacheType","actionDataAction","createObservableDataAction","id","action","async","input","ctx","searchCriteria","SearchCondition","Context","ChannelId","requestContext","apiSettings","channelId","CatalogId","catalogId","getProductSearchRefinersAsync","callerContext","queryResultSettings","count","Sorting","Columns","ColumnName","IsDescending","then","productRefiners","trace","result","map","productRefiner","length","args","BaseCollectionInput","refiners","searchText","includeAttributes","isUpdateRefinerPanel","locale","configs","_objectSpread","this","Paging","toJS","buildCacheKey","refiner","RefinerRecordId","LeftValueBoundString","RightValueBoundString","convertToString","createBaseCollectionInput","inputClassConstuctor","QueryResultSettingsProxy","fromInputData","QueryResultSettings","queryRefiners","hydrateRefinersFromUrl","inputData","config","undefined","_inputData$config","updateRefinerPanel","getUpdateRefinerPanel","getCatalogId","query","sorting","JSON","parse","decodeURIComponent","error","Error","InventoryInStockRefinerValueInput","inventoryProductAttributeRecordId","arguments","super","context","_refiners$find","getProductRefinerHierarchy","find","RecordId","ProductListInventoryFilteringOptions","GetFullProductsByCollectionInput","isOutOfStock","product","channelInventoryConfiguration","ArrayExtensions","hasElements","AttributeValues","attribute","InventoryProductAttributeRecordId","TextValue","InventoryOutOfStockAttributeValueText","returnProductsBasedOnInventoryInformation","products","_context$requestConte","ObjectExtensions","isNullOrUndefined","app","productListInventoryDisplay","SortOOS","inStockProducts","outOfStockProducts","push","concat","sortsProductsBasedOnAvailability","returnProducts","productSearchResults","metadataCount","productSearchResultsWithImages","productSearchResult","newImageUrl","generateProductImageUrl","PrimaryImageUrl","inventoryLevel","InventoryLevels","threshold","enableStockCheck","inventoryConfiguration","getInventoryConfigurationAsync","element","inventoryRanges","channelInventoryConfigurationId","_context$requestConte2","_allRefiners$find","_context$requestConte3","_productSearchResults","_promise$metadata$cou2","_productSearchResults3","promise","searchProductId","searchCriteriaInput","Refinement","IncludeAttributes","SkipVariantExpansion","HideOOS","refinerValue","_inventoryRefiner$Val","refinerInput","inventoryRefiner","getInventoryRefinersAction","Values","value","getInventoryInStockRefinerValueAsync","some","allRefiners","getAllRefinersAction","filteredRefiner","_refiner$KeyName","_input$configs","KeyName","toLowerCase","newArrivalRefinerName","_value$LeftValueBound","_input$configs2","newArrivalRefinerLVSValue","q","searchByCriteriaAsync","productId","recommendation","searchObject","Number","ProductId","isNaN","Recommendation","RecommendationListId","Ids","_productSearchResults2","_promise$metadata$cou","filter","_getAttributeByKeyNam","_input$configs3","_getAttributeByKeyNam2","_input$configs4","isNewArrival","getAttributeByKeyName","newArrivalAttrKeyName","BooleanValue","isNewArrivalDateValid","newArrivalDateAttrKeyName","DateTimeOffsetValue","Date","metadata","MsDyn365","isBrowser","update","ListPageStateInput","totalProductCount","activeFilters","Top","itemsPerPage","skip","Skip","sortOptions","sortByOptionRelevanceDesc","sortByOptionRatingAsc","sortByOptionRatingDesc","sortByOptionNameAsc","sortByOptionNameDesc","sortByOptionPriceAsc","sortByOptionPriceDesc","sortByOptionBestSelling","sortByOptionNewScore","sortByOptionTrendingScore","MappedSearchInput","getMappedSearchConfiguration","getSearchConfigurationAsync","searchConfiguration","ProductSortColumns","sortColumn","key","toUpperCase","telemetry","warning","Boolean","createInput","getMappedSearchConfigurationDataAction","DefaultValues","RefinersByCollectionInput","defaultProductIdValue","compressedRefinerKeys","compressedRefinerArray","parseQueryParam","compressedRefiner","parsedRefiner","forEach","refinerKey","index","_unused","buildListPageUrl","fullUrl","sortingColumns","skipCount","searchParams","delete","sortedRefiners","sort","first","second","set","stringify","compressedRefiners","compressRefiners","href","toString","getCurrentUrl","URL","window","location","url","requestUrl","ListPageState","activeProducts","sortingCritera","currentPageNumber","pageSize","featureProduct","productPrices","__decorate","observable","listPageStateAction","createListPageInput","ProductRefinerValueDataTypeValue","ProductRefinerTypeValue","ProductRefinerSource","isRangeType","dataTypeValue","AttributeDataType","Currency","Decimal","Integer","findMatchingRefinementCriterion","productRefinerValue","refinementCriteria","refinementCriterion","isMatchingRefinementCriterion","RefinerSourceValue","DataTypeValue","getUpdatedRefinementCriteria","itemToggleNotification","currentRefinementCriteria","updatedRefinementCriteria","toggledItemFound","selectedCriterion","isSelecting","next","rangeStart","rangeEnd","Text","TrueFalse","parentProductRefinerHierarchy","RefinerTypeValue","RefinerType","SingleSelect","child","matchingIndex","findIndex","criterion","splice","ChoiceSummary","React","props","closeButtonGlyph","_onClick","e","preventDefault","stopPropagation","target","currentTarget","clearAll","getAttribute","includes","selectedRefiner","_getSelectedRefinerChoice","onChoiceClicked","itemClicked","choiceClicked","nextItemToFocus","nextSibling","payLoad","getPayloadObject","telemetryContent","_this$props$context","selectedChoices","refinerHierarchy","choice","parent","hierarchy","_getKeyForRefinerValue","render","clearAllText","label","classNames","choiceAriaLabel","closeAriaLabel","items","selectedRefinersMap","contentAction","etext","clearAllAttributes","getTelemetryAttributes","className","classnames","item","Object","assign","urlBuilder","onClick","role","choiceFormat","choiceRangeValueFormat","overallFormat","rangeFormat","refinerValueName","refinerName","replace","_formatPrice","UnitText","LeftValueBoundLocalizedString","amount","currency","cultureFormatter","formatCurrency","selected","textContent","trim","computed","observer","ErrorMessage","_ref","text","FeatureSearchResultItem","imageSettings","resources","productName","Name","productRecordId","productUrl","getProductPageUrlSync","actionContext","fallbackImage","getFallbackImageUrl","ItemId","heading","featureSimilarDescriptionTitle","featureSimilarLooksTitle","onTelemetryClick","gridSettings","imageUrl","altText","img","src","imageProps","fallBackSrc","Image","loadFailureBehavior","renderProductPlacementImage","request","title","Link","ariaLabel","ModalToggle","innerRef","ref","modalNode","Modal","autoFocus","applicationNode","returnFocusRef","returnRef","isOpen","toggle","onModalToggle","zIndex","modalHeaderNode","ModalHeader","modalTitle","modalFooterNode","ModalFooter","Button","modalCloseButtonText","getInventoryLabel","inventoryAttribute","ProductSearchResultItems","moduleType","moduleId","allowBackNavigation","quickviewSlot","isPriceMinMaxEnabled","productsDimensionAvailabilities","priceResources","priceRangeSeparator","ProductComponent","freePriceText","priceFree","originalPriceText","currentPriceText","ratingAriaLabel","allowBack","typeName","data","quickViewButton","inventoryLabel","swatchItemAriaLabel","dimensionAvailabilities","dimensionAvailability","masterProductId","MasterProductId","RangeRefineItem","_selectedRefinementCr","_this$props$selectedR","_this$props$selectedR2","_ref2","_this$props$selectedR3","_this$props$selectedR4","_formattedPriceReverseLookup","Map","getLabels","sliderId","minPrice","maxPrice","labelId","labelString","labelPositioning","getSliderThumbs","sliderKey","selectedMin","selectedMinPrice","selectedMax","selectedMaxPrice","_this$props$minValueS","_this$props$maxValueS","minValueSliderThumbAriaLabel","currencyCode","ariaValueText","maxValueSliderThumbAriaLabel","_onRangeUpdate","bind","_onRangeUpdateEnd","_handleRangeTooltipText","_changeMin","_changeMax","_finishChangeMin","_finishChangeMax","minInput","maxInput","selectedRefinementCriterion","initialMin","initialMax","String","minValue","maxValue","labels","sliderKeyString","sliderThumbs","state","isChecked","validationErrorMin","validationErrorMax","touchedMin","touchedMax","shouldComponentUpdate","nextProps","nextState","componentDidUpdate","previousProps","updateSliderProps","refineItemCommonProps","rangeType","_renderInputFields","_renderSlider","_ref3","_this$props$selectedR5","_this$props$selectedR6","_ref4","_this$props$selectedR7","_this$props$selectedR8","setState","isDisabled","formAttrs","rangeNameFormat","minInputClassName","maxInputClassName","formattedSelectedMin","_getFormattedSelectedValue","formattedSelectedMax","minLabel","onChange","onFocus","onBlur","maxLabel","placeholder","placeholderTextMax","ariaAttributes","Slider","inForm","min","max","step","orientation","showLabels","showTooltip","onChangeEnd","debounce","handleTooltipText","event","_changeValue","inputType","selectedKey","touchedKey","_getInputWithoutFormatting","selectedMinValue","minTouched","onToggle","maxNum","validationErrorNaN","_focus","_validateRange","selectedMaxValue","maxTouched","minNum","setTimeout","current","focus","touched","validationError","validationErrorRange","inputAsNum","get","sliderChangeNotification","eventType","firstThumbValue","secondThumbValue","_focusOnSliderThumb","document","getElementById","tooltip","RefineItem","anchorType","_productRefinerValue$","_this$props","productCountAriaLabel","singleProductCountAriaLabel","children","refineItemAriaLabel","refineItemsAriaLabel","attrs","_objectWithoutProperties","_excluded","isSingleSelect","itemTypeClassName","SourceValue","Rating","_renderRating","productText","productCount","Count","refineMenuItemAriaLabel","format","_getRefinerUrl","tabIndex","_renderSwatch","_this$props$parentPro","_this$props$parentPro2","_productRefinerValue$2","dimensionType","toLocaleLowerCase","hasColor","StringExtensions","isNullOrWhitespace","SwatchColorHexCode","hasImage","SwatchImageUrl","swatchItems","checkIfShouldDisplayAsSwatch","itemId","colorHexCode","SwatchComponent","list","isSelectionEnabled","isRefineItem","ratingUserCountAriaLabel","ratingSingleUserCountAriaLabel","_productRefinerValue$3","refinerRating","parseInt","ratingRefiner","selectedRefinerValues","selectedRating","defaultChkProductCount","ratingComponentClass","productCountAriaLabelValue","isMobileView","RatingComponent","avgRating","ratingCount","hideCount","readOnly","moduleTypeName","RefineSubmenu","_onToggleItem","_onToggleSubmenu","isExpanded","isExpandedOnInitialLoad","expanded","productRefinerHierarchy","hideRating","Collapse","timeout","_renderChildItems","_renderRange","_renderSingleMultiSelect","isMobile","refinerValuesList","listItems","selectedValue","_getRangeType","DisplayTemplateValue","DisplayTemplate","Range","SliderWithBars","onUpdateRefiners","prevState","Separator","separator","Title","expandRefinersCount","SearchResultContainer","sortByDropdownOptions","_viewport","expandrefinerCount","defaultPageNumber","_updateListPageState","listPageState","_this$props$context$r","_this$props$config$it","_this$props$config$it2","_this$props$context$r2","querySorting","_getProductsDimensionsAvailabilities","_this$props$data$list","_this$props$data$list2","productsList","getDimensionAvailabilitiesForProductSearchResultAction","DimensionAvailabilitiesForProductSearchResultInput","console","log","_getActivePrice","_this$props$data$list3","_this$props$data$list4","getPriceForProductSearchResult","PriceForProductSearchResultInput","_getSearchResultModal","modal","modalHeader","modalFooter","modalBody","ModalBody","SearchResultModal","modalIsOpen","_modalToggleRef","_toggleModal","_getCollectionTitle","collectionTitle","_this$props$config$ti","productCountNumber","productCountText","numberOfProducts","oneProduct","TitleContainer","telemetryPageName","titlePrefix","searchTextPrefix","titleText","titleCount","_getCategoryHierarchy","categoryHierarchy","CategoryHierarchyContainer","tag","categoryHierarchyList","categoryLinkAriaLabel","Url","categoryHierarchySeparator","_getSortingDropDown","activeDropdown","_getCurrentlySelectedOption","sortingState","selectedSortByOption","dropdownOptions","_getAllSortByOptions","dropdownOption","SortingContainer","sortByDropDown","LabeledDropdown","labelClassname","labelText","sortByDropdownLabel","dropdownId","dropdownClassname","toggleColor","selectedOption","onSelectOption","_updateSortByDropdown","_sortAndFilterContainerRef","_getPagination","totalItems","previousText","flipperPrevious","nextText","flipperNext","UncontrolledPagination","paginationAriaLabel","qsp","startingItem","_renderPrev","_renderNext","previousAriaLabel","nextAriaLabel","_getRefineMenu","_validRefiners","tempRangeTypeTODO","inputRange","validRefiners","_shouldHideFromRefiners","activeRefiners","hideRefinersList","_config$hideRefinersL","hideFilter","_hideFilter$refinerKe","refinerKeyName","_getexpandRefinerCount","expandedRefiners","RefineMenuContainer","RefinerSectionContainer","_refineItemCommonProps","_onUpdateRefiners","_buildRefinerUrl","_this$props$data$prod","_getChoiceSummary","_this$props$data$prod2","selectedRefiners","choiceSummaryLabel","_onChoiceClicked","_buildRefinerUrlForChoiceSummary","_getProducts","_this$props$data$feat","_this$props$data$prod3","breaCrumbType","breadcrumbType","quickviewslot","slots","quickview","isPriceMinMaxFeatureState","featureState","IsEnabled","notification","history","pushState","_getSortColumnFromSelectedOption","transaction","option","mappedConfiguration","_getSortCriteriaColumn","_this$props$data$list5","sortCriteria","queryColumns","mappedSearchConfiguration","mappedSearchConfig","validValues","activeSortColumn","activeMappedConfig","newRefinementCriteria","dropdownElementId","dropdownElement","selectedChoice","isClearAll","refinerCount","all","one","two","three","four","paginationPreviousText","paginationNextText","device","Type","_updateViewport","pending","validationErrorNotNumber","validationErrorNotRange","getTelemetryObject","friendlyName","nameTranslations","_nameTranslation","nameTranslation","Language","_this$props$context$a2","_this$props$context$a3","addEventListener","reaction","_listPageState$active","_listPageState$sortin","_newListPageState$cur","_newListPageState$sor","_newListPageState$act","_this$props$context$a","newListPageState","Math","productResults","getCollectionProducts","enableAffiliationBasedPricing","user","isAuthenticated","_newListPageState$cur2","_newListPageState$sor2","_newListPageState$act2","_this$props$context$r3","_this$props$context$r4","getCollectionRefinersAction","dimensionsToDisplayOnProductCard","dimensionsInProductCard","dimensionsToDisplayAsSwatch","dimensionsAsSwatchType","DimensionTypes","none","componentWillUnmount","removeEventListener","_this$props$context$r5","searchProduct","errorText","resultSearchNotFoundText","productsComponent","featureComponent","searchResultContainerViewProps","TitleViewProps","disableHierarchy","refineMenu","moduleProps","sortByOptions","pagination","ProductsContainer","ProductSectionContainer","CategoryNavContainer","RefineAndProductSectionContainer","choiceSummary","modalToggle","searchResultModal","errorMessage","FeatureSearchContainer","similarLookProduct","renderView","_getViewport","variant","VariantType","Browser","Viewport","DescriptionInterval","renderProductCards","Node","renderProductCardsDescription","isEnabledProductDescription","_props$data$products$","_props$data$featureSt","breadCrumbType","isAllowBack","classname","renderProducts","_props$data$listPageS","productDescriptionInterval","productDescriptionIntervalRemainder0","productDescriptionIntervalRemainder9","renderTitleCount","renderCategoryHierarchy","category","configureStickyFilter","isStickyHeader","headerContainer","querySelector","headerHeight","offsetHeight","bannerHeights","headerElement","defaultContainer","refinerElement","documentElement","scrollTop","classList","add","setAttribute","clientHeight","remove","removeAttribute","createSearchResultModal","modalProps","isRecoSearchPage","createModalBody","renderSort","submenu","renderRefinerMobile","renderRefiner","renderRefinerFooter","handler","doneAriaLabel","doneText","renderTitle","_props$context$action","useEffect","useStickyFilter","stickyFilterSetup","enableStickyHeader","setIsExpanded","useState","wrapperRefiner","refinerRefernce","handleClickOutside","contains","useOutsideClick","Module","enableProdutDescription","filterText","getAttributeByName","attributes","keyName","attr","_attr$Name","_attr$KeyName","getDefaultColorSwatchSelected","productData","_colorAttribute$Swatc","_colorAttribute$Swatc2","_colorAttribute$Swatc3","colorAttribute","attributeValue","_attributeValue$KeyNa","color","defaultSwatch","Swatches","IsDefault","updateProductUrl","productDetailsPageUrl","coreContext","queryString","sourceUrl","baseUrl","search","pathname","renderProductUnitOfMeasure","unitOfMeasure","renderLabel","name","price","rating","ratingAriaLabelText","reviewCount","ratingCountAriaLabelText","reviewCountArialableText","getReviewAriaLabel","getRatingAriaLabel","roundedRating","toFixed","renderPrice","basePrice","adjustedPrice","savingsText","BasePrice","AdjustedPrice","CustomerContextualPrice","PriceComponent","fallbackImageUrl","_context$app$config","contextConfig","placeholderImageName","fallbackImageSource","cropFocalRegion","bypassHideOnFailure","renderBookAuthor","attributeValues","attributeKey","bookAuthorAttribute","msdyn365Commerce","createComponentOverride","component","_product$Name","_product$RecordId","_getProductImageUrlFr","_getProductPageUrlFro","ratingCountAriaLabel","MIN_VALUE","productImageUrlFromSwatch","dimensionToPreSelectInProductCard","ProductImageUrls","generateImageUrl","getProductImageUrlFromDefaultColorSwatch","productPageUrlFromSwatch","SwatchValue","getProductPageUrlFromDefaultSwatch","productPageUrl","setProductPageUrl","productImageUrl","setProductImageUrl","selectedSwatchItems","Dictionary","updatePageAndImageUrl","swatchItem","setValue","productPageUrlWithSwatch","newUrl","swatchProductImageUrl","productImageUrls","isUnitOfMeasureEnabled","unitOfMeasureDisplayType","bookAuthorAttributeKey","Price","AverageRating","TotalRatings","DefaultUnitOfMeasure","description","Description","_item$KeyName$toLocal","_item$KeyName","_item$Swatches$map","_item$Swatches","dimensionTypeValue","shouldDisplayDimension","swatches","_item$RecordId","_swatchItem$SwatchVal","_swatchItem$SwatchVal2","_dimensionAvailabilit","isDefault","_swatchItem$SwatchVal3","swatch","ProductComponentSwatchComponent","onSelectDimension","totalRatings","numberRatings","renderRating","inventoryAvailabilityLabel","selectedDimensions","getValues","DimensionTypeValue","convertDimensionTypeToProductDimensionType","DimensionValue","Value","selectedProductId","renderQuickView","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","c","require","$type","da","path","runOn","iNM","ns","n","p","pdp","md","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}