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IAAMC,EAAQ,MACjBmB,GAAI,kCAEpBD,EAAe,oDAAsD,CACrDnB,EAAGA,IAAMC,EAAQ,MACjBmB,GAAI,kCAEpB7W,OAAO2W,aAAe3W,OAAO2W,cAAgB,GAC7C3W,OAAO2W,aAAaC,eAAcvb,EAAAA,EAAA,GACP2E,OAAO2W,aAAaC,gBAAkB,IACtCA,wFC7EpB,MAAME,IACGC,EAAAA,EAAAA,IAAA,CAAXC,EAAAA,IAAU,kCAECD,EAAAA,EAAAA,IAAA,CAAXC,EAAAA,IAAU,6CAECD,EAAAA,EAAAA,IAAA,CAAXC,EAAAA,IAAU,8KCLR,SAAS7N,EAAuBqB,GACnC,OAAO,IAAIyM,EAAAA,aAA0B,cAAezM,EAAQ,eAGhE,MAIa0M,GAA6B3a,EAAAA,EAAAA,IAA2B,CACjEE,OAA8B0a,EAAAA,iBAC9Bre,MANoCiE,GAC7BoM,EAAuB,CAAElR,WAAY,OAQhD,WCvBAmf,EAAOC,QAAUpZ,cCAjBmZ,EAAOC,QAAUC","sources":["webpack://bestseller.commerce.online/./src/modules/ext-search/actions/get-auto-suggest-suggestions.ts?5b12","webpack://bestseller.commerce.online/./src/modules/ext-search/components/ext-search.categorysuggest.tsx?5a0b","webpack://bestseller.commerce.online/./src/modules/ext-search/components/ext-search.form.tsx?8113","webpack://bestseller.commerce.online/./src/modules/ext-search/components/ext-search.keywordsuggest.tsx?003c","webpack://bestseller.commerce.online/./src/modules/ext-search/components/ext-search.label.tsx?44e8","webpack://bestseller.commerce.online/./src/modules/ext-search/components/ext-search.productsuggest.tsx?ef64","webpack://bestseller.commerce.online/./src/modules/ext-search/ext-search.props.autogenerated.ts?be6f","webpack://bestseller.commerce.online/./src/modules/ext-search/ext-search.tsx?8892","webpack://bestseller.commerce.online/./src/modules/ext-search/ext-search.view.tsx?810d","webpack://bestseller.commerce.online/./src/shared/functions/get-commercial-name.ts?6aba","webpack://bestseller.commerce.online/./src/themes/only/views/components/search.categorysuggest.tsx?c73a","webpack://bestseller.commerce.online/./src/themes/only/views/components/search.mobile.empty.tsx?4216","webpack://bestseller.commerce.online/./src/themes/only/views/components/search.form.tsx?e656","webpack://bestseller.commerce.online/./src/themes/only/views/components/search.keywordsuggest.tsx?3d15","webpack://bestseller.commerce.online/./src/themes/only/views/components/search.productsuggest.tsx?f667","webpack://bestseller.commerce.online/./src/themes/only/views/ext-search.view.tsx?d98f","webpack://bestseller.commerce.online/./lib/ext-search/module-registration.js?3799","webpack://bestseller.commerce.online/./src/search-state.ts?dd10","webpack://bestseller.commerce.online/./src/search-state-data-action.ts?8223","webpack://bestseller.commerce.online/external var \"React\"?0d3b","webpack://bestseller.commerce.online/external var \"ReactDOM\"?853b"],"sourcesContent":["/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { Autosuggestions } from '@msdyn365-commerce/commerce-entities';\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n getCatalogId,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n ICreateActionContext\r\n} from '@msdyn365-commerce/core';\r\nimport {\r\n AttributeDataType,\r\n ChannelInventoryConfiguration,\r\n ProductRefinerSource,\r\n ProductRefinerValue,\r\n ProductSearchCriteria,\r\n SearchSuggestion,\r\n SearchSuggestionCriteria\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n getInventoryConfigurationAsync,\r\n getSearchSuggestionsAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\r\nimport { generateImageUrl } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\nexport enum SuggestionType {\r\n Category = 'ScopedCategory',\r\n Keyword = 'Keyword',\r\n Product = 'Product',\r\n None = 'None'\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 * Input class for auto suggest search input.\r\n */\r\nexport class AutoSuggestInput implements IActionInput {\r\n public searchQuery?: string;\r\n\r\n public topResultsCount?: number;\r\n\r\n public suggestionType?: string;\r\n\r\n public hitPrefix?: string;\r\n\r\n public hitSuffix?: string;\r\n\r\n public constructor(searchText?: string, top?: number, suggestionType?: string, hitPrefix?: string, hitSuffix?: string) {\r\n this.searchQuery = searchText;\r\n this.topResultsCount = top;\r\n this.suggestionType = suggestionType;\r\n this.hitPrefix = hitPrefix;\r\n this.hitSuffix = hitSuffix;\r\n }\r\n\r\n public getCacheKey = () => 'AutoSuggestSearchSuggestions';\r\n\r\n public getCacheObjectType = () => 'AutoSuggestSearchSuggestions';\r\n\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\nconst createInput = (inputData: ICreateActionContext) => {\r\n return new AutoSuggestInput();\r\n};\r\n\r\n/**\r\n * Calls the Retail API and returns a auto-suggest suggestions.\r\n * @param input\r\n * @param ctx\r\n */\r\nexport async function getSearchSuggestionsAction(input: AutoSuggestInput, ctx: IActionContext): Promise {\r\n // If no input is provided fail out\r\n if (!input || !input.searchQuery) {\r\n throw new Error('[getSearchSuggestionsAction]No valid Input was provided, failing');\r\n }\r\n\r\n const autosuggest: Autosuggestions = {};\r\n\r\n const autoSuggestPromises = [_getAutoSuggest(input, autosuggest, ctx)];\r\n return Promise.all(autoSuggestPromises).then(() => {\r\n return autosuggest;\r\n });\r\n}\r\n\r\n/**\r\n * Returns inventory in stock sortable refiner value.\r\n * @param channelInventoryConfiguration - The channelInventoryConfiguration.\r\n * @param isInStock - The flag indicating whether is getting in-stock refiner or out-of-stock refiner.\r\n * @returns Refiners.\r\n */\r\nconst getInventorySortableRefinerValue = (\r\n channelInventoryConfiguration: ChannelInventoryConfiguration,\r\n isInStock: boolean\r\n): ProductRefinerValue | undefined => {\r\n if (channelInventoryConfiguration && channelInventoryConfiguration.ProductAvailabilitySortableAttributeRecordId) {\r\n return {\r\n RefinerRecordId: channelInventoryConfiguration.ProductAvailabilitySortableAttributeRecordId,\r\n DataTypeValue: AttributeDataType.TrueFalse,\r\n LeftValueBoundString: isInStock ? 'true' : 'false',\r\n RightValueBoundString: isInStock ? 'true' : 'false',\r\n UnitText: '',\r\n RowNumber: 0,\r\n Count: 0,\r\n ExtensionProperties: [],\r\n RefinerSourceValue: ProductRefinerSource.Attribute\r\n };\r\n }\r\n return undefined;\r\n};\r\n\r\nasync function _getAutoSuggest(input: AutoSuggestInput, autosuggest: Autosuggestions, ctx: IActionContext): Promise {\r\n const catalogId = getCatalogId(ctx.requestContext);\r\n let productSearchCriteria: ProductSearchCriteria = {\r\n SearchCondition: input.searchQuery && input.searchQuery.length > 0 ? input.searchQuery : '',\r\n Context: {\r\n ChannelId: +ctx.requestContext.apiSettings.channelId,\r\n CatalogId: catalogId\r\n }\r\n };\r\n\r\n if (ctx.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS) {\r\n const channelInventoryConfiguration = await getInventoryConfigurationAsync({ callerContext: ctx });\r\n const isInStockRefiner = true;\r\n const inventoryRefinerValue = getInventorySortableRefinerValue(channelInventoryConfiguration, isInStockRefiner);\r\n\r\n if (inventoryRefinerValue) {\r\n productSearchCriteria = {\r\n ...productSearchCriteria,\r\n Refinement: [inventoryRefinerValue]\r\n };\r\n }\r\n }\r\n\r\n const searchCriteria: SearchSuggestionCriteria = {\r\n ProductSearchCriteria: productSearchCriteria,\r\n HitPrefix: input.hitPrefix,\r\n HitSuffix: input.hitSuffix,\r\n SuggestionType: input.suggestionType\r\n };\r\n\r\n const searchSuggestions = await getSearchSuggestionsAsync(\r\n { callerContext: ctx, queryResultSettings: { Paging: { Top: input.topResultsCount } } },\r\n searchCriteria\r\n );\r\n\r\n if (searchSuggestions && searchSuggestions.length > 0) {\r\n // Generate image url\r\n searchSuggestions.map(\r\n (item: SearchSuggestion) =>\r\n (item.ImageUrl = item.ImageUrl ? generateImageUrl(item.ImageUrl, ctx.requestContext.apiSettings) : '')\r\n );\r\n\r\n autosuggest.AllSearchResults = searchSuggestions;\r\n } else {\r\n ctx.telemetry.error(\r\n `[getSearchSuggestionsAction] unable to get availabilites for search with suggestion type ${searchCriteria.SuggestionType}`\r\n );\r\n }\r\n}\r\n\r\nexport const getSearchSuggestionsActionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/search/get-auto-suggest-suggestions',\r\n action: >getSearchSuggestionsAction,\r\n input: createInput\r\n});\r\n\r\nexport default getSearchSuggestionsActionDataAction;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\n/* eslint-disable security/detect-non-literal-regexp */\r\n/* eslint-disable security/detect-object-injection */\r\nimport MsDyn365, { getRichTextHtml } from '@msdyn365-commerce/core';\r\nimport { ProductRefiner, ProductRefinerSource, ProductRefinerValue, SearchSuggestion } from '@msdyn365-commerce/retail-proxy';\r\nimport { format, getPayloadObject, getTelemetryAttributes, IPayLoad, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IExtSearchData } from '../ext-search.data';\r\nimport { IExtSearchProps } from '../ext-search.props.autogenerated';\r\n\r\nexport interface ISearchCategorySuggestProps {\r\n searchCategorySuggestClass: string;\r\n searchPageURL: string;\r\n searchQsp: string | undefined;\r\n hitPrefix: string;\r\n hitSuffix: string;\r\n autoSuggestProps: IExtSearchProps;\r\n searchText: string;\r\n searchRefiners: ProductRefiner[] | undefined;\r\n suggestions: SearchSuggestion[] | undefined;\r\n telemetryContent?: ITelemetryContent;\r\n shouldShowFullPath?: boolean;\r\n}\r\n\r\nexport interface ISearchCategoryViewProps {\r\n title: React.ReactNode;\r\n text: React.ReactNode[];\r\n}\r\n\r\nlet payLoad: IPayLoad;\r\n\r\n/**\r\n * CategorySuggestionsComponent.\r\n * @param props\r\n */\r\nexport const CategorySuggestionsComponent = (props: ISearchCategorySuggestProps): ISearchCategoryViewProps | undefined => {\r\n const {\r\n suggestions,\r\n searchText,\r\n autoSuggestProps: {\r\n resources: { categorySuggestionHeading }\r\n }\r\n } = props;\r\n\r\n const reactNodes: React.ReactNode[] = [];\r\n payLoad = getPayloadObject('click', props.telemetryContent!, '');\r\n\r\n suggestions?.map(item => {\r\n reactNodes.push(_assembleNode(item, props));\r\n });\r\n\r\n const titleNode = _renderTitle(categorySuggestionHeading, searchText);\r\n\r\n return { title: titleNode, text: reactNodes };\r\n};\r\n\r\nconst _renderTitle = (categorySuggestionHeading: string, searchText: string) => {\r\n const categoryAutoSuggestionHeading = categorySuggestionHeading\r\n ? format(categorySuggestionHeading, searchText)\r\n : `Search \"${searchText}\" in categories`;\r\n\r\n return
  • {categoryAutoSuggestionHeading}
  • ;\r\n};\r\n\r\nconst _assembleNode = (item: SearchSuggestion, props: ISearchCategorySuggestProps) => {\r\n const { searchText, hitPrefix, hitSuffix, shouldShowFullPath } = props;\r\n\r\n const splitValue = shouldShowFullPath ? item.Value : item.Value && item.Value.split('|').pop();\r\n const ariaLabel = splitValue\r\n ? splitValue.replace(new RegExp(`[${hitPrefix}]`, 'gi'), '').replace(new RegExp(`[${hitSuffix}]`, 'gi'), '')\r\n : item.Value && item.Value.replace(new RegExp(`[${hitPrefix}]`, 'gi'), '').replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\r\n payLoad.contentAction.etext = item.Value;\r\n const attribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\r\n return (\r\n
  • \r\n \r\n {_generateLink(item, searchText, props) && _getHighlightedText(splitValue ? splitValue : '', hitPrefix, hitSuffix)}\r\n \r\n
  • \r\n );\r\n};\r\n\r\nconst _generateLink = (suggestion: SearchSuggestion, searchText: string, props: ISearchCategorySuggestProps): string => {\r\n return suggestion && suggestion.Id ? _getCategoryLink(suggestion.Id, searchText, props) : '';\r\n};\r\n\r\nconst _getCategoryLink = (id: string, searchText: string, props: ISearchCategorySuggestProps): string => {\r\n const { searchPageURL, searchQsp, searchRefiners } = props;\r\n\r\n if (!MsDyn365.isBrowser) {\r\n return '';\r\n }\r\n\r\n const queryUrl = new URL(searchPageURL, window.location.href);\r\n\r\n if (searchQsp && searchText) {\r\n queryUrl.searchParams.set(searchQsp, searchText);\r\n }\r\n\r\n const categoryRefiners = searchRefiners?.find(refiners => {\r\n return refiners.SourceValue === ProductRefinerSource.Category;\r\n });\r\n const refiner = categoryRefiners?.Values?.find(item => {\r\n return item.RefinerRecordId === Number.parseInt(id, 10);\r\n });\r\n\r\n const encodedRefiner = refiner && JSON.stringify(compressRefiners([refiner]));\r\n if (encodedRefiner) {\r\n queryUrl.searchParams.set('refiners', encodedRefiner);\r\n }\r\n\r\n return queryUrl.href;\r\n};\r\n\r\nconst _getHighlightedText = (suggestion: string, hitPrefix: string, hitSuffix: string): JSX.Element => {\r\n const formattedText = suggestion\r\n .replace(new RegExp(`[${hitPrefix}]`, 'gi'), '')\r\n .replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\r\n\r\n // eslint-disable-next-line react/no-danger\r\n return ;\r\n};\r\n\r\n// TODO: This code is currently duplicated in categoryautosuggest need to either remove one of these files\r\n// or move this code to a common place\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 * Compressed a list of refiners for use in URLs.\r\n * @param refiners The uncompressed refiners.\r\n */\r\nconst 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 * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { Button } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nexport interface ISearchFormProps {\r\n hideSearchLabel: boolean | undefined;\r\n isSearchFormExpanded?: boolean | undefined;\r\n disableSubmitSearch: boolean | undefined;\r\n searchTextInput: React.RefObject;\r\n maxChars: number;\r\n searchQsp: string;\r\n searchPlaceholder: string;\r\n query: string;\r\n ariaLabelCancel: string;\r\n ariaLabelSearch: string;\r\n ariaLabelSubmit: string;\r\n handleCancelSearchChange(): void;\r\n handleInputChange(query: string): void;\r\n}\r\n\r\nexport interface ISearchFormViewProps {\r\n input: React.ReactNode;\r\n submitBtn: React.ReactNode;\r\n cancelBtn: React.ReactNode;\r\n}\r\n\r\n/**\r\n * On Input Change functionality.\r\n * @param handleInputChange -Input change function.\r\n * @returns Set updated input value.\r\n */\r\nconst onInputChangeFunction = (handleInputChange: (query: string) => void) => (event: React.ChangeEvent) => {\r\n handleInputChange(event.target.value || '');\r\n};\r\nexport const FormComponent = (props: ISearchFormProps): ISearchFormViewProps => {\r\n const {\r\n searchQsp,\r\n searchPlaceholder,\r\n hideSearchLabel,\r\n searchTextInput,\r\n handleInputChange,\r\n maxChars,\r\n disableSubmitSearch,\r\n handleCancelSearchChange,\r\n query,\r\n ariaLabelCancel,\r\n ariaLabelSearch,\r\n ariaLabelSubmit\r\n } = props;\r\n\r\n const onInputChange = onInputChangeFunction(handleInputChange);\r\n\r\n const inputNode = !hideSearchLabel ? (\r\n \r\n ) : (\r\n \r\n );\r\n\r\n const submitBtnNode = !disableSubmitSearch && \r\n \r\n );\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\n/* eslint-disable security/detect-non-literal-regexp */\r\n/* eslint-disable security/detect-object-injection */\r\nimport { PriceComponent } from '@msdyn365-commerce/components';\r\nimport { getRichTextHtml, IActionContext, IImageSettings, Image, ITelemetry } from '@msdyn365-commerce/core';\r\nimport { SearchSuggestion } from '@msdyn365-commerce/retail-proxy';\r\nimport { getProductPageUrlSync, ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n INodeProps,\r\n IPayLoad,\r\n ITelemetryContent,\r\n NodeTag\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IExtSearchData } from '../ext-search.data';\r\nimport { IExtSearchProps } from '../ext-search.props.autogenerated';\r\n\r\n/**\r\n * Search product suggest resources.\r\n */\r\nexport interface ISearchProductSuggestResources {\r\n freePriceText: string;\r\n}\r\n\r\nexport interface ISearchProductSuggestProps {\r\n searchProductSuggestClass: string;\r\n searchPageURL: string;\r\n searchQsp: string | undefined;\r\n hitPrefix: string;\r\n hitSuffix: string;\r\n autoSuggestProps: IExtSearchProps;\r\n searchText: string;\r\n suggestions: SearchSuggestion[] | undefined;\r\n telemetry: ITelemetry;\r\n moduleType: string;\r\n moduleId: string;\r\n telemetryContent?: ITelemetryContent;\r\n resources?: ISearchProductSuggestResources;\r\n}\r\n\r\nexport interface ISearchProductViewProps {\r\n title: React.ReactNode;\r\n items: ISearchProductItemViewProps[];\r\n}\r\n\r\nexport interface ISearchProductItemViewProps {\r\n text: React.ReactNode;\r\n thumbnail: React.ReactNode;\r\n price: React.ReactNode;\r\n LiProduct: INodeProps;\r\n AProduct: INodeProps;\r\n id: string | undefined;\r\n}\r\n\r\nlet payLoad: IPayLoad;\r\nlet telemetryContent: ITelemetryContent | undefined;\r\n\r\n/**\r\n * ProductSuggestionsComponent.\r\n * @param props\r\n */\r\nexport const ProductSuggestionsComponent = (props: ISearchProductSuggestProps): ISearchProductViewProps | undefined => {\r\n const {\r\n suggestions,\r\n hitSuffix,\r\n hitPrefix,\r\n autoSuggestProps: {\r\n context: { actionContext },\r\n resources: { productSuggestionHeading }\r\n },\r\n moduleType,\r\n moduleId\r\n } = props;\r\n const reactNodes: ISearchProductItemViewProps[] = [];\r\n telemetryContent = props.telemetryContent;\r\n payLoad = getPayloadObject('click', props.telemetryContent!, '');\r\n\r\n suggestions?.map(item => {\r\n reactNodes.push(_assembleNode(item, hitPrefix, hitSuffix, actionContext, props, moduleType, moduleId));\r\n });\r\n\r\n const titleNode = _renderTitle(productSuggestionHeading);\r\n\r\n return { title: titleNode, items: reactNodes };\r\n};\r\n\r\nconst _renderTitle = (productSuggestionHeading: string) => {\r\n const productAutoSuggestionHeading = productSuggestionHeading ? productSuggestionHeading : 'Go to products';\r\n\r\n return
  • {productAutoSuggestionHeading}
  • ;\r\n};\r\n\r\nconst _assembleNode = (\r\n item: SearchSuggestion,\r\n hitPrefix: string,\r\n hitSuffix: string,\r\n actionContext: IActionContext,\r\n props: ISearchProductSuggestProps,\r\n moduleType: string,\r\n moduleId: string\r\n): ISearchProductItemViewProps => {\r\n const altText =\r\n item.Value && item.Value.replace(new RegExp(`[${hitPrefix}]`, 'gi'), '').replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\r\n\r\n const price = item.Value3?.Value?.DecimalValue;\r\n return {\r\n text: _getHighlightedText(item.Value ? item.Value : '', hitPrefix, hitSuffix),\r\n thumbnail: _renderThumbnail(item, altText ? altText : '', props),\r\n price: !ObjectExtensions.isNullOrUndefined(price) && _renderPrice(price, price, moduleId, moduleType, props),\r\n LiProduct: _getLiWrapper(),\r\n AProduct: _getAWrapper(item, hitPrefix, hitSuffix, actionContext, props),\r\n id: item.Id\r\n };\r\n};\r\n\r\nconst _getLiWrapper = () => {\r\n return {\r\n className: 'msc-autoSuggest__productResults-item',\r\n tag: 'li' as NodeTag\r\n };\r\n};\r\n\r\nconst _getAWrapper = (\r\n item: SearchSuggestion,\r\n hitPrefix: string,\r\n hitSuffix: string,\r\n actionContext: IActionContext,\r\n props: ISearchProductSuggestProps\r\n) => {\r\n const {\r\n autoSuggestProps: { context }\r\n } = props;\r\n const ariaLabel =\r\n item.Value && item.Value.replace(new RegExp(`[${hitPrefix}]`, 'gi'), '').replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\r\n\r\n payLoad.contentAction.recid = item.Id;\r\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\r\n const productPrice = context.cultureFormatter.formatCurrency(item.Value3!.Value!.DecimalValue!);\r\n\r\n return {\r\n className: 'msc-autoSuggest__productResults-item',\r\n tag: 'a' as NodeTag,\r\n 'aria-label': `${ariaLabel!} ${productPrice}`,\r\n href: _generateLink(item, hitPrefix, hitSuffix, actionContext),\r\n ...attribute\r\n };\r\n};\r\n\r\nconst _generateLink = (suggestion: SearchSuggestion, hitPrefix: string, hitSuffix: string, actionContext: IActionContext) => {\r\n const formattedLink = (suggestion.Value as string)\r\n .replace(new RegExp(`[${hitPrefix}]`, 'gi'), '')\r\n .replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\r\n return suggestion.Value && suggestion.Id\r\n ? getProductPageUrlSync(formattedLink, (suggestion.Id as unknown) as number, actionContext, undefined)\r\n : '';\r\n};\r\n\r\nconst _getHighlightedText = (suggestion: string, hitPrefix: string, hitSuffix: string): JSX.Element => {\r\n const formattedText = suggestion\r\n .replace(new RegExp(`[${hitPrefix}]`, 'gi'), '')\r\n .replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\r\n\r\n return (\r\n // eslint-disable-next-line react/no-danger\r\n \r\n );\r\n};\r\n\r\nconst _renderPrice = (\r\n adjustedPrice: number,\r\n basePrice: number,\r\n moduleId: string,\r\n moduleType: string,\r\n props: ISearchProductSuggestProps\r\n): JSX.Element | null => {\r\n const {\r\n autoSuggestProps: { context }\r\n } = props;\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nconst _renderThumbnail = (suggestion: SearchSuggestion, altText: string, props: ISearchProductSuggestProps): JSX.Element | null => {\r\n const {\r\n autoSuggestProps: {\r\n context: {\r\n request: { gridSettings }\r\n },\r\n config: { imageSettings }\r\n }\r\n } = props;\r\n if (imageSettings) {\r\n imageSettings.cropFocalRegion = true;\r\n }\r\n\r\n if (!suggestion || !suggestion.ImageUrl) {\r\n props.telemetry.error('Search suggestion content is empty, module wont render.');\r\n return null;\r\n }\r\n\r\n const defaultImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: 'w=40&h=40&m=6', w: 0, h: 0 },\r\n lg: { q: 'w=40&h=40&m=6', w: 0, h: 0 },\r\n xl: { q: 'w=40&h=40&m=6', w: 0, h: 0 }\r\n },\r\n lazyload: true,\r\n cropFocalRegion: true\r\n };\r\n\r\n return (\r\n \r\n );\r\n};\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 * IExtSearch contentModule 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\n\r\nexport interface IExtSearchConfig extends Msdyn365.IModuleConfig {\r\n suggestionTypeCriterion?: ISuggestionTypeCriterionData[];\r\n topResultsCount?: number;\r\n imageSettings?: Msdyn365.IImageSettings;\r\n hideSearchLabel?: boolean;\r\n disableSubmitSearch?: boolean;\r\n searchplaceholderText?: string;\r\n shouldShowFullCategoryPath?: boolean;\r\n className?: string;\r\n clientRender?: boolean;\r\n}\r\n\r\nexport interface IExtSearchResources {\r\n searchtext: string;\r\n searchLabelArialLabel: string;\r\n cancelBtnAriaLabel: string;\r\n searchBtnAriaLabel: string;\r\n submitBtnAriaLabel: string;\r\n autoSuggestFoundMessage: string;\r\n noAutoSuggestionMessage: string;\r\n productSuggestionHeading: string;\r\n categorySuggestionHeading: string;\r\n autoSuggestResultLoadingMessage: string;\r\n freePriceText: string;\r\n}\r\n\r\nexport const enum SuggestionTypeCriterionSuggestionType {\r\n product = 'product',\r\n keyword = 'keyword',\r\n scopedCategory = 'scopedCategory'\r\n}\r\n\r\nexport interface ISuggestionTypeCriterionData {\r\n SuggestionType?: SuggestionTypeCriterionSuggestionType;\r\n}\r\n\r\nexport interface IExtSearchProps extends Msdyn365.IModule {\r\n resources: IExtSearchResources;\r\n config: IExtSearchConfig;\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { Autosuggestions } from '@msdyn365-commerce/commerce-entities';\r\nimport MsDyn365, { getCatalogId, getUrlSync } from '@msdyn365-commerce/core';\r\nimport { ProductRefiner, ProductRefinerSource, ProductsDataActions } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ArrayExtensions,\r\n ObjectExtensions,\r\n Random,\r\n validateCatalogId,\r\n QueryResultSettingsProxy\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { createSearchStateInput } from '@msdyn365-commerce-modules/search-utilities';\r\nimport { getTelemetryObject, IModuleProps, INodeProps, ITelemetryContent, KeyCodes } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport { debounce } from 'lodash';\r\nimport { Spinner, SpinnerSize } from 'office-ui-fabric-react';\r\nimport * as React from 'react';\r\n\r\nimport getSearchSuggestionsAction, { AutoSuggestInput, SuggestionType } from './actions/get-auto-suggest-suggestions';\r\nimport {\r\n CategorySuggestionsComponent,\r\n FormComponent,\r\n ISearchCategoryViewProps,\r\n ISearchKeywordViewProps,\r\n ISearchProductViewProps,\r\n KeywordSuggestionsComponent,\r\n LabelComponent,\r\n ProductSuggestionsComponent\r\n} from './components';\r\nimport { IExtSearchData } from './ext-search.data';\r\nimport { IExtSearchProps, ISuggestionTypeCriterionData, SuggestionTypeCriterionSuggestionType } from './ext-search.props.autogenerated';\r\nimport { getCommercialName } from '../../shared/functions/get-commercial-name';\r\n\r\nexport interface ISearchState {\r\n isSearchFormExpanded: boolean;\r\n searchText: string;\r\n searchKeywordSuggestClass: string;\r\n searchProductSuggestClass: string;\r\n searchCategorySuggestClass: string;\r\n suggestions: Autosuggestions | undefined;\r\n searchRefiners?: ProductRefiner[] | undefined;\r\n autoSuggestAriaLabel: string;\r\n isInitialState: boolean;\r\n isLoadingAutoSuggest?: boolean;\r\n}\r\n\r\nexport interface ISearchViewProps extends IExtSearchProps {\r\n Search: IModuleProps;\r\n AutoSuggestAriaLabel: INodeProps;\r\n AutoSuggestAriaLabelText: string;\r\n searchText: string;\r\n AutoSuggest: INodeProps;\r\n KeywordSuggest: INodeProps;\r\n ProductSuggest: INodeProps;\r\n CategorySuggest: INodeProps;\r\n SearchForm: INodeProps;\r\n FormWrapper: INodeProps;\r\n UlKeyword: INodeProps;\r\n UlProduct: INodeProps;\r\n UlCategory: INodeProps;\r\n label: React.ReactNode;\r\n form: React.ReactNode;\r\n autosuggestKeyword?: ISearchKeywordViewProps;\r\n autosuggestProduct?: ISearchProductViewProps;\r\n autosuggestCategory?: ISearchCategoryViewProps;\r\n callbacks: {\r\n handleCancelSearchChange(): void;\r\n handleCancelSearchFocused?(): void;\r\n };\r\n isSearchFormExpanded: boolean;\r\n isLoadingAutoSuggest?: boolean;\r\n isLoadingNode?: React.ReactNode;\r\n}\r\n\r\n/**\r\n *\r\n * Search module.\r\n * @extends {React.Component, ISearchState>}\r\n */\r\nclass Search extends React.Component, ISearchState> {\r\n private readonly searchTextInput: React.RefObject;\r\n\r\n private readonly searchCollapsedLabel: React.RefObject;\r\n\r\n private readonly formReference: React.RefObject;\r\n\r\n private readonly maxChars: number;\r\n\r\n private readonly topResultsCount?: number;\r\n\r\n private readonly hitPrefix: string = '{';\r\n\r\n private readonly hitSuffix: string = '}';\r\n\r\n private readonly waitTime: number = 500;\r\n\r\n private readonly autoSuggestResultScreenReaderDiv: React.RefObject;\r\n\r\n private readonly autoSuggestResultDiv: React.RefObject;\r\n\r\n private readonly searchFormClass: string;\r\n\r\n private readonly searchLabelClass: string;\r\n\r\n private readonly telemetryContent: ITelemetryContent;\r\n\r\n private loadSuggestionsRequestId?: string;\r\n\r\n private inputSuggestionType: ISuggestionTypeCriterionData[];\r\n\r\n // @ts-expect-error\r\n private cancellabelDebounce: debounce;\r\n\r\n public constructor(props: IExtSearchProps) {\r\n super(props);\r\n this.searchTextInput = React.createRef();\r\n this.searchCollapsedLabel = React.createRef();\r\n this.autoSuggestResultScreenReaderDiv = React.createRef();\r\n this.autoSuggestResultDiv = React.createRef();\r\n this.formReference = React.createRef();\r\n this.state = {\r\n isSearchFormExpanded: false,\r\n searchText: '',\r\n searchKeywordSuggestClass: 'ms-search__autoSuggest__keyword',\r\n searchProductSuggestClass: 'ms-search__autoSuggest__product',\r\n searchCategorySuggestClass: 'ms-search__autoSuggest__category',\r\n suggestions: undefined,\r\n searchRefiners: undefined,\r\n autoSuggestAriaLabel: '',\r\n isInitialState: true,\r\n isLoadingAutoSuggest: false\r\n };\r\n this.maxChars =\r\n (this.props.context &&\r\n this.props.context.app &&\r\n this.props.context.app.config &&\r\n this.props.context.app.config.searchInputMaxLength) ||\r\n 50;\r\n\r\n this.inputSuggestionType = [];\r\n this.topResultsCount = this.props.config && this.props.config.topResultsCount ? this.props.config.topResultsCount : 5;\r\n this.searchFormClass = 'ms-search__form';\r\n this.searchLabelClass = 'ms-search__label';\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._initSuggestionTypes();\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n document.body && document.body.addEventListener('mousedown', this._focusOutTarget);\r\n window && window.addEventListener('keyup', this._keyup);\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n document.body && document.body.removeEventListener('mousedown', this._focusOutTarget, false);\r\n window && window.removeEventListener('keyup', this._keyup, false);\r\n }\r\n\r\n public componentDidUpdate(): void {\r\n const {\r\n config: { hideSearchLabel }\r\n } = this.props;\r\n const { isSearchFormExpanded, isInitialState } = this.state;\r\n\r\n if (!this.props.context.request.params.isEditor) {\r\n if (!hideSearchLabel && isSearchFormExpanded) {\r\n this.searchTextInput && this.searchTextInput.current && this.searchTextInput.current.focus();\r\n } else if (!isInitialState && !isSearchFormExpanded) {\r\n this.searchCollapsedLabel && this.searchCollapsedLabel.current && this.searchCollapsedLabel.current.focus();\r\n }\r\n }\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: IExtSearchProps, nextState: ISearchState): 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 // eslint-disable-next-line complexity -- ignore complexity.\r\n public render(): JSX.Element {\r\n const {\r\n context,\r\n resources: { searchtext, searchLabelArialLabel, cancelBtnAriaLabel, searchBtnAriaLabel, submitBtnAriaLabel },\r\n config: { hideSearchLabel, disableSubmitSearch, searchplaceholderText, shouldShowFullCategoryPath, className = '' }\r\n } = this.props;\r\n\r\n const {\r\n isSearchFormExpanded,\r\n searchText,\r\n searchKeywordSuggestClass,\r\n searchProductSuggestClass,\r\n searchCategorySuggestClass,\r\n suggestions,\r\n searchRefiners,\r\n isLoadingAutoSuggest\r\n } = this.state;\r\n\r\n const searchQsp = (context && context.app && context.app.config && context.app.config.searchQueryStringParameter) || 'q';\r\n const searchPageURL = getUrlSync('search', context && context.actionContext) || '';\r\n const searchURL = this._appendQueryParams(searchPageURL, searchText, searchQsp);\r\n const searchPlaceholder = searchplaceholderText && searchplaceholderText.length > 0 ? searchplaceholderText : 'Search in Fabrikam';\r\n\r\n const keywordSuggestions = suggestions?.AllSearchResults?.filter(\r\n suggestion => suggestion.SuggestionType === SuggestionType.Keyword || suggestion.SuggestionType === SuggestionType.None\r\n );\r\n const productSuggestions = suggestions?.AllSearchResults?.filter(\r\n suggestion => suggestion.SuggestionType === SuggestionType.Product\r\n );\r\n const categoryRefiners = searchRefiners?.find(refiner => {\r\n return refiner.SourceValue === ProductRefinerSource.Category;\r\n });\r\n const categorySuggestions = suggestions?.AllSearchResults?.filter(suggestion => {\r\n if (suggestion.SuggestionType !== SuggestionType.Category) {\r\n return false;\r\n }\r\n const refiner = categoryRefiners?.Values?.find(item => {\r\n return `${item.RefinerRecordId ?? 0}` === suggestion.Id;\r\n });\r\n\r\n return !ObjectExtensions.isNullOrUndefined(refiner);\r\n });\r\n\r\n const viewProps: ISearchViewProps = {\r\n ...(this.props as IExtSearchProps),\r\n\r\n Search: {\r\n moduleProps: this.props,\r\n className: `${classnames('ms-search', className)} ${disableSubmitSearch ? 'no-submit' : 'with-submit'}`\r\n },\r\n AutoSuggestAriaLabel: {\r\n tag: 'div',\r\n className: 'msc-autoSuggest__screen-reader',\r\n 'aria-live': 'assertive',\r\n ref: this.autoSuggestResultScreenReaderDiv\r\n },\r\n AutoSuggestAriaLabelText: this.state.autoSuggestAriaLabel,\r\n searchText: this.state.searchText,\r\n AutoSuggest: {\r\n ref: this.autoSuggestResultDiv,\r\n className: 'ms-search__autoSuggest'\r\n },\r\n KeywordSuggest: {\r\n className: searchKeywordSuggestClass\r\n },\r\n ProductSuggest: {\r\n className: searchProductSuggestClass\r\n },\r\n CategorySuggest: {\r\n className: searchCategorySuggestClass\r\n },\r\n SearchForm: {\r\n className: `${this.searchFormClass} ${isSearchFormExpanded ? 'bx-show' : 'bx-hide'}`\r\n },\r\n FormWrapper: {\r\n tag: 'form',\r\n ref: this.formReference,\r\n className: 'ms-search__searchForm',\r\n 'aria-label': 'Search',\r\n name: 'searchForm',\r\n role: 'search',\r\n action: searchURL,\r\n autoComplete: 'off',\r\n onSubmit: this._handleSubmit\r\n },\r\n UlKeyword: {\r\n tag: 'ul',\r\n className: classnames('msc-autoSuggest__keywordResults-items', className)\r\n },\r\n UlProduct: {\r\n tag: 'ul',\r\n className: classnames('msc-autoSuggest__productResults-items', className)\r\n },\r\n UlCategory: {\r\n tag: 'ul',\r\n className: classnames('msc-autoSuggest__categoryResults-items', className)\r\n },\r\n label: LabelComponent({\r\n isSearchFormExpanded,\r\n searchLabelClass: `${this.searchLabelClass} ${isSearchFormExpanded ? 'bx-hide' : 'bx-show'}`,\r\n searchtext,\r\n searchLabelArialLabel,\r\n searchCollapsedLabel: this.searchCollapsedLabel,\r\n hideSearchLabel,\r\n handleCancelSearchChange: this._handleCancelSearchChange,\r\n telemetryContent: this.telemetryContent\r\n }),\r\n form: FormComponent({\r\n ariaLabelCancel: cancelBtnAriaLabel,\r\n ariaLabelSearch: searchBtnAriaLabel,\r\n ariaLabelSubmit: submitBtnAriaLabel,\r\n hideSearchLabel,\r\n searchTextInput: this.searchTextInput,\r\n disableSubmitSearch,\r\n handleInputChange: this._handleInputChange,\r\n handleCancelSearchChange: this._handleCancelSearchChange,\r\n maxChars: this.maxChars,\r\n searchQsp,\r\n searchPlaceholder,\r\n query: searchText\r\n }),\r\n autosuggestKeyword:\r\n searchText &&\r\n searchText.length > 0 &&\r\n (isLoadingAutoSuggest || (keywordSuggestions && ArrayExtensions.hasElements(keywordSuggestions)))\r\n ? KeywordSuggestionsComponent({\r\n searchKeywordSuggestClass,\r\n searchPageURL,\r\n searchQsp,\r\n hitPrefix: this.hitPrefix,\r\n hitSuffix: this.hitSuffix,\r\n autoSuggestProps: this.props,\r\n searchText,\r\n suggestions: keywordSuggestions,\r\n telemetryContent: this.telemetryContent\r\n })\r\n : undefined,\r\n autosuggestProduct:\r\n searchText &&\r\n searchText.length > 0 &&\r\n (isLoadingAutoSuggest || (productSuggestions && ArrayExtensions.hasElements(productSuggestions)))\r\n ? ProductSuggestionsComponent({\r\n searchProductSuggestClass,\r\n searchPageURL,\r\n searchQsp,\r\n hitPrefix: this.hitPrefix,\r\n hitSuffix: this.hitSuffix,\r\n autoSuggestProps: this.props,\r\n searchText,\r\n suggestions: productSuggestions,\r\n telemetry: this.props.telemetry,\r\n moduleType: this.props.typeName,\r\n moduleId: this.props.id,\r\n telemetryContent: this.telemetryContent,\r\n resources: this.props.resources\r\n })\r\n : undefined,\r\n autosuggestCategory:\r\n searchText &&\r\n searchText.length > 0 &&\r\n (isLoadingAutoSuggest || (categorySuggestions && ArrayExtensions.hasElements(categorySuggestions)))\r\n ? CategorySuggestionsComponent({\r\n searchCategorySuggestClass,\r\n searchPageURL,\r\n searchQsp,\r\n hitPrefix: this.hitPrefix,\r\n hitSuffix: this.hitSuffix,\r\n autoSuggestProps: this.props,\r\n searchText,\r\n suggestions: categorySuggestions,\r\n searchRefiners,\r\n telemetryContent: this.telemetryContent,\r\n shouldShowFullPath: shouldShowFullCategoryPath\r\n })\r\n : undefined,\r\n callbacks: {\r\n handleCancelSearchChange: this._handleCancelSearchChange,\r\n handleCancelSearchFocused: this._handleCancelSearchFocused\r\n },\r\n isSearchFormExpanded: this.state.isSearchFormExpanded,\r\n isLoadingAutoSuggest,\r\n isLoadingNode: this._isLoadingNode()\r\n };\r\n\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n private _initSuggestionTypes() {\r\n const suggestionTypes = this.props.config.suggestionTypeCriterion;\r\n\r\n const suggestions = ArrayExtensions.unique(ArrayExtensions.validValues(suggestionTypes));\r\n if (!ArrayExtensions.hasElements(suggestions)) {\r\n this.inputSuggestionType = [\r\n { SuggestionType: SuggestionTypeCriterionSuggestionType.keyword },\r\n { SuggestionType: SuggestionTypeCriterionSuggestionType.product },\r\n { SuggestionType: SuggestionTypeCriterionSuggestionType.scopedCategory }\r\n ];\r\n return;\r\n }\r\n\r\n const validSuggestions = suggestions.filter(suggestion => suggestion.SuggestionType);\r\n if (ArrayExtensions.hasElements(validSuggestions)) {\r\n this.inputSuggestionType = validSuggestions;\r\n return;\r\n }\r\n\r\n this.inputSuggestionType = [];\r\n }\r\n\r\n /**\r\n * Function to create the ReactNode for loading Autosuggest result.\r\n * @returns ReachNode for loading Autosuggest result.\r\n */\r\n private readonly _isLoadingNode = (): React.ReactNode => {\r\n const loadingText = this.props.resources.autoSuggestResultLoadingMessage;\r\n return ;\r\n };\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n private readonly _focusOutTarget = (e: any): void => {\r\n const { suggestions } = this.state;\r\n\r\n if (suggestions && suggestions.AllSearchResults && e.target.closest('.ms-search') === null) {\r\n this._clearAutoSuggestState();\r\n }\r\n };\r\n\r\n private readonly _keyup = (e: KeyboardEvent): void => {\r\n const { suggestions } = this.state;\r\n\r\n if (suggestions && suggestions.AllSearchResults && e.keyCode === KeyCodes.Escape) {\r\n this._clearAutoSuggestState();\r\n } else if (this.state.isSearchFormExpanded && e.keyCode === KeyCodes.Escape) {\r\n if (this.state.isSearchFormExpanded) {\r\n this.setState({ isSearchFormExpanded: false });\r\n }\r\n }\r\n\r\n if (\r\n !(\r\n (this.formReference.current && this.formReference.current.contains((e.target as unknown) as Node)) ||\r\n (this.autoSuggestResultDiv.current && this.autoSuggestResultDiv.current.contains((e.target as unknown) as Node))\r\n )\r\n ) {\r\n if (suggestions && suggestions.AllSearchResults) {\r\n this._clearAutoSuggestState();\r\n }\r\n\r\n if (this.state.isSearchFormExpanded) {\r\n this.setState({ isSearchFormExpanded: false });\r\n }\r\n }\r\n };\r\n\r\n private readonly _clearAutoSuggestState = (): void => {\r\n const {\r\n context: { actionContext },\r\n data: { searchState }\r\n } = this.props;\r\n\r\n if (this.searchTextInput.current && this.searchTextInput.current.value.length > 0) {\r\n searchState.searchText = '';\r\n searchState.defaultBasicSearchUrl = '';\r\n searchState.searchQueryStringParameter = '';\r\n actionContext ? actionContext.update(createSearchStateInput(searchState), searchState) : null;\r\n this.searchTextInput.current.value = '';\r\n }\r\n\r\n this.setState({ searchText: '', suggestions: undefined, searchRefiners: undefined });\r\n };\r\n\r\n private async _getSearchSuggestions(loadSuggestionsRequestId: string, query: string) {\r\n try {\r\n const searchSuggestions = await getSearchSuggestionsAction(\r\n new AutoSuggestInput(query, this.topResultsCount, this._getSuggestionType(), this.hitPrefix, this.hitSuffix),\r\n this.props.context.actionContext\r\n );\r\n if (searchSuggestions.AllSearchResults && this.props.app.config?.useCommercialStyleName) {\r\n for (var searchSuggestion of searchSuggestions.AllSearchResults) {\r\n if (searchSuggestion.SuggestionType === 'Product') {\r\n var attributes = await ProductsDataActions.getAttributeValuesAsync(\r\n {\r\n callerContext: this.props.context.actionContext,\r\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(\r\n this.props.context.actionContext\r\n )\r\n },\r\n Number(searchSuggestion.Id),\r\n this.props.context.actionContext.requestContext.apiSettings.channelId,\r\n this.props.context.actionContext.requestContext.apiSettings.catalogId ?? 0\r\n );\r\n searchSuggestion.Value = getCommercialName(\r\n attributes,\r\n searchSuggestion.Value,\r\n this.props.app.config?.commercialStyleNameAttribute\r\n );\r\n }\r\n }\r\n }\r\n if (loadSuggestionsRequestId !== this.loadSuggestionsRequestId) {\r\n return undefined;\r\n }\r\n return searchSuggestions;\r\n } catch (error) {\r\n if (loadSuggestionsRequestId !== this.loadSuggestionsRequestId) {\r\n return undefined;\r\n }\r\n this.setState({ suggestions: undefined, searchRefiners: undefined, autoSuggestAriaLabel: this._setAutoSuggestResultCount() });\r\n this.props.telemetry.exception(error);\r\n this.props.telemetry.debug('Unable to get auto suggest results');\r\n return undefined;\r\n }\r\n }\r\n\r\n private async _updateSearchRefiners(loadSuggestionsRequestId: string, query: string, suggestions: Autosuggestions | undefined) {\r\n try {\r\n const refiners = await this._getSearchRefiners(query);\r\n if (loadSuggestionsRequestId !== this.loadSuggestionsRequestId) {\r\n return;\r\n }\r\n this.setState({\r\n suggestions,\r\n searchRefiners: refiners,\r\n autoSuggestAriaLabel: this._setAutoSuggestResultCount(suggestions),\r\n isLoadingAutoSuggest: false\r\n });\r\n } catch (error) {\r\n if (loadSuggestionsRequestId !== this.loadSuggestionsRequestId) {\r\n return;\r\n }\r\n this.setState({ suggestions, searchRefiners: undefined, autoSuggestAriaLabel: this._setAutoSuggestResultCount(suggestions) });\r\n this.props.telemetry.exception(error);\r\n this.props.telemetry.debug('Unable to get refiners results');\r\n }\r\n }\r\n\r\n private _loadSuggestions(query: string) {\r\n this.cancellabelDebounce = debounce(async () => {\r\n this.setState({ isLoadingAutoSuggest: true });\r\n const loadSuggestionsRequestId = Random.Guid.generateGuid();\r\n this.loadSuggestionsRequestId = loadSuggestionsRequestId;\r\n const searchSuggestions = await this._getSearchSuggestions(loadSuggestionsRequestId, query);\r\n await this._updateSearchRefiners(loadSuggestionsRequestId, query, searchSuggestions);\r\n }, this.waitTime);\r\n\r\n setTimeout(() => {\r\n this.cancellabelDebounce();\r\n }, 0);\r\n }\r\n\r\n private readonly _handleInputChange = (query: string): void => {\r\n if (!query || query.length <= this.maxChars) {\r\n this.setState({ searchText: query });\r\n }\r\n\r\n if (this.cancellabelDebounce) {\r\n this.cancellabelDebounce.cancel();\r\n }\r\n\r\n const {\r\n context,\r\n data: { searchState }\r\n } = this.props;\r\n\r\n if (context) {\r\n if (query && query.length > 0) {\r\n if (query.length > this.maxChars) {\r\n return;\r\n }\r\n\r\n if (ArrayExtensions.hasElements(this.inputSuggestionType)) {\r\n this._loadSuggestions(query);\r\n }\r\n\r\n searchState.searchText = query;\r\n } else {\r\n this.setState({ suggestions: undefined, searchRefiners: undefined });\r\n searchState.searchText = '';\r\n }\r\n context.actionContext.update(createSearchStateInput(searchState), searchState);\r\n }\r\n };\r\n\r\n private _getSuggestionType(): string {\r\n const distinctSuggestionTypes: string[] = this.inputSuggestionType.map(\r\n suggestionTypeItem => suggestionTypeItem.SuggestionType!.charAt(0).toUpperCase() + suggestionTypeItem.SuggestionType!.slice(1)\r\n );\r\n return distinctSuggestionTypes.join(',');\r\n }\r\n\r\n private async _getSearchRefiners(searchText: string): Promise {\r\n const { actionContext: ctx } = this.props.context;\r\n const catalogId = getCatalogId(ctx.requestContext);\r\n validateCatalogId(catalogId);\r\n return ProductsDataActions.getProductSearchRefinersAsync(\r\n { callerContext: ctx },\r\n {\r\n SearchCondition: searchText,\r\n Context: {\r\n ChannelId: +ctx.requestContext.apiSettings.channelId,\r\n CatalogId: catalogId\r\n }\r\n }\r\n );\r\n }\r\n\r\n private readonly _handleSubmit = (\r\n e: React.MouseEvent | React.KeyboardEvent | React.FormEvent\r\n ): void => {\r\n const {\r\n config: { disableSubmitSearch },\r\n context: {\r\n actionContext,\r\n app: {\r\n config: { searchQueryStringParameter }\r\n }\r\n }\r\n } = this.props;\r\n\r\n const query = this.searchTextInput.current && this.searchTextInput.current.value;\r\n e.preventDefault();\r\n\r\n if (!query || (query && query.length === 0) || disableSubmitSearch) {\r\n this.searchTextInput && this.searchTextInput.current && this.searchTextInput.current.focus();\r\n } else {\r\n const searchQsp = searchQueryStringParameter || 'q';\r\n const searchURL = this._appendQueryParams(getUrlSync('search', actionContext) || '', query, searchQsp);\r\n document.location.href = searchURL;\r\n }\r\n };\r\n\r\n private readonly _handleCancelSearchChange = (): void => {\r\n const { isSearchFormExpanded, suggestions } = this.state;\r\n\r\n if (!isSearchFormExpanded) {\r\n this.setState({\r\n isSearchFormExpanded: true,\r\n searchText: '',\r\n isInitialState: false\r\n });\r\n } else {\r\n if (suggestions && suggestions.AllSearchResults) {\r\n this._clearAutoSuggestState();\r\n }\r\n this.setState({ isSearchFormExpanded: false });\r\n }\r\n };\r\n\r\n private readonly _handleCancelSearchFocused = (): void => {\r\n const { suggestions } = this.state;\r\n if (!(suggestions && suggestions.AllSearchResults)) {\r\n this._clearAutoSuggestState();\r\n this.setState({ isSearchFormExpanded: false });\r\n }\r\n };\r\n\r\n private readonly _appendQueryParams = (route: string, query: string, qsp: string): string => {\r\n if (!MsDyn365.isBrowser) {\r\n return '';\r\n }\r\n\r\n const queryUrl = new URL(route, window.location.href);\r\n if (qsp && query) {\r\n queryUrl.searchParams.set(qsp, query);\r\n }\r\n\r\n return queryUrl.href;\r\n };\r\n\r\n private readonly _setAutoSuggestResultCount = (result?: Autosuggestions) => {\r\n if (this.autoSuggestResultScreenReaderDiv.current !== null) {\r\n const ariaLiveRegion = this.autoSuggestResultScreenReaderDiv.current;\r\n const suggestResultString = this.props.resources.autoSuggestFoundMessage;\r\n const emptyResultString = this.props.resources.noAutoSuggestionMessage;\r\n ariaLiveRegion.innerText =\r\n result && result.AllSearchResults && result.AllSearchResults.length > 0 ? suggestResultString : emptyResultString;\r\n ariaLiveRegion.setAttribute('aria-live', 'assertive');\r\n return ariaLiveRegion.innerText;\r\n }\r\n return '';\r\n };\r\n}\r\n\r\nexport default Search;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { INodeProps, Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { ISearchCategoryViewProps, ISearchFormViewProps, ISearchKeywordViewProps, ISearchProductViewProps } from './components';\r\nimport { ISearchViewProps } from './ext-search';\r\n\r\nconst SearchView: React.FC = props => {\r\n const {\r\n Search,\r\n AutoSuggestAriaLabel,\r\n AutoSuggestAriaLabelText,\r\n searchText,\r\n AutoSuggest,\r\n KeywordSuggest,\r\n ProductSuggest,\r\n CategorySuggest,\r\n UlKeyword,\r\n UlProduct,\r\n UlCategory,\r\n form,\r\n autosuggestCategory,\r\n autosuggestKeyword,\r\n autosuggestProduct,\r\n SearchForm,\r\n FormWrapper,\r\n label,\r\n isLoadingAutoSuggest,\r\n isLoadingNode\r\n } = props;\r\n\r\n return (\r\n \r\n {label}\r\n {_renderForm(form as ISearchFormViewProps, SearchForm, FormWrapper)}\r\n \r\n {searchText && searchText.length > 0 ? {AutoSuggestAriaLabelText} : ''}\r\n {_renderKeywordSuggestions(KeywordSuggest, UlKeyword, autosuggestKeyword, isLoadingAutoSuggest, isLoadingNode)}\r\n {_renderProductSuggestions(ProductSuggest, UlProduct, autosuggestProduct, isLoadingAutoSuggest, isLoadingNode)}\r\n {_renderCategorySuggestions(CategorySuggest, UlCategory, autosuggestCategory, isLoadingAutoSuggest, isLoadingNode)}\r\n \r\n \r\n );\r\n};\r\n\r\nconst _renderForm = (form: ISearchFormViewProps, SearchForm: INodeProps, FormWrapper: INodeProps) => {\r\n return (\r\n \r\n \r\n {form.input}\r\n {form.cancelBtn}\r\n {form.submitBtn}\r\n \r\n \r\n );\r\n};\r\n\r\nconst _renderKeywordSuggestions = (\r\n KeywordSuggest: INodeProps,\r\n UlKeyword: INodeProps,\r\n keywordSuggestions?: ISearchKeywordViewProps,\r\n isLoadingAutoSuggest?: boolean,\r\n isLoadingNode?: React.ReactNode\r\n) => {\r\n return (\r\n keywordSuggestions && (\r\n \r\n \r\n {isLoadingAutoSuggest && isLoadingNode}\r\n {!isLoadingAutoSuggest &&\r\n keywordSuggestions.text.map(text => {\r\n return text;\r\n })}\r\n \r\n \r\n )\r\n );\r\n};\r\n\r\nconst _renderProductSuggestions = (\r\n ProductSuggest: INodeProps,\r\n UlProduct: INodeProps,\r\n productSuggestions?: ISearchProductViewProps,\r\n isLoadingAutoSuggest?: boolean,\r\n isLoadingNode?: React.ReactNode\r\n) => {\r\n return (\r\n productSuggestions && (\r\n \r\n \r\n {productSuggestions.title}\r\n {isLoadingAutoSuggest && isLoadingNode}\r\n {!isLoadingAutoSuggest &&\r\n productSuggestions.items.map((item, index) => {\r\n return (\r\n \r\n \r\n {item.thumbnail}\r\n {item.text}\r\n {item.price}\r\n \r\n \r\n );\r\n })}\r\n \r\n \r\n )\r\n );\r\n};\r\n\r\nconst _renderCategorySuggestions = (\r\n CategorySuggest: INodeProps,\r\n UlCategory: INodeProps,\r\n categorySuggestions?: ISearchCategoryViewProps,\r\n isLoadingAutoSuggest?: boolean,\r\n isLoadingNode?: React.ReactNode\r\n) => {\r\n return (\r\n categorySuggestions && (\r\n \r\n \r\n {categorySuggestions.title}\r\n {isLoadingAutoSuggest && isLoadingNode}\r\n {!isLoadingAutoSuggest &&\r\n categorySuggestions.text.map(text => {\r\n return text;\r\n })}\r\n \r\n \r\n )\r\n );\r\n};\r\n\r\nexport default SearchView;\r\n","/**\r\n * Centralised location for checkout generic data updates\r\n */\r\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * Gets the CommercialName from a list of attributes - returns the product name if no commercial name attribute is present\r\n * @param attributes\r\n * @param productName\r\n * @param commercialStyleNameAttribute\r\n * @returns\r\n */\r\nexport const getCommercialName = (\r\n attributes: AttributeValue[] = [],\r\n productName: string = '',\r\n commercialStyleNameAttribute: string = 'CommercialStyleName'\r\n): string => {\r\n var styleName = attributes.find(x => x.Name === commercialStyleNameAttribute);\r\n var productBrand = productName?.split(' ')[0] ?? '';\r\n if (styleName?.TextValue) {\r\n return `${productBrand} ${styleName?.TextValue}`;\r\n }\r\n\r\n return productName;\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { ISearchData, ISearchViewProps } from '@msdyn365-commerce-modules/search';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport React from 'react';\r\n\r\nimport { ISearchProps } from '../../definition-extensions/search.ext.props.autogenerated';\r\n\r\n/**\r\n * Render Categories heading.\r\n * @param inCategoriesHeading - The Keywords result heading.\r\n * @returns The JSX Element.\r\n */\r\nconst renderCategorySuggestionsTitle = (inCategoriesHeading: string): JSX.Element => {\r\n const categoryAutoSuggestionHeading = inCategoriesHeading ? inCategoriesHeading : 'In categories';\r\n\r\n return
    {categoryAutoSuggestionHeading}
    ;\r\n};\r\n\r\n/**\r\n * Render Categories suggestion result.\r\n * @param inCategoriesHeading - The Categories result heading.\r\n * @param noResultText - The \"No Result\" text.\r\n * @param props - The Categories suggestion result.\r\n * @param isLoadingAutoSuggest - The autosuggestion loading flag.\r\n * @param isLoadingNode - The autosuggestion loading node.\r\n * @returns The JSX Element.\r\n */\r\nexport const CategorySuggestionsComponent = (\r\n inCategoriesHeading: string,\r\n noResultText: string,\r\n props: ISearchViewProps & ISearchProps,\r\n isLoadingAutoSuggest?: boolean,\r\n isLoadingNode?: React.ReactNode\r\n): JSX.Element => {\r\n return props.autosuggestCategory ? (\r\n \r\n {renderCategorySuggestionsTitle(inCategoriesHeading)}\r\n \r\n {isLoadingAutoSuggest && isLoadingNode}\r\n {!isLoadingAutoSuggest &&\r\n props.autosuggestCategory.text.map(text => {\r\n return text;\r\n })}\r\n \r\n \r\n ) : (\r\n \r\n {renderCategorySuggestionsTitle(inCategoriesHeading)}\r\n \r\n
  • {noResultText}
  • \r\n
    \r\n
    \r\n );\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { IImageData, Image } from '@msdyn365-commerce/core';\r\nimport { ISearchData } from '@msdyn365-commerce-modules/search';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport React from 'react';\r\n\r\nimport { ISearchProps } from '../../definition-extensions/search.ext.props.autogenerated';\r\n\r\n/**\r\n * Render Products Suggestion result heading.\r\n * @param props -The props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderProductNotFoundResultsImage = (props: ISearchProps): JSX.Element | null => {\r\n const noSearchResultImage: IImageData | undefined = props.config.noSearchResultImage;\r\n if (!noSearchResultImage || !noSearchResultImage.src) {\r\n return null;\r\n }\r\n const imageSettings = {\r\n lazyload: true,\r\n viewports: {\r\n xs: { w: 100, h: 100, q: 'w=100&h=100&q=60&m=6' }\r\n }\r\n };\r\n return (\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Render Product suggestion result.\r\n * @param props -The props.\r\n * @returns The JSX Element.\r\n */\r\nexport const MobileAutoSuggestEmptyComponent = (props: ISearchProps): JSX.Element => {\r\n return (\r\n \r\n
    {renderProductNotFoundResultsImage(props)}
    \r\n
    \r\n
    {props.resources.emptyMobileSearchTextHeading}
    \r\n
    {props.resources.emptyMobileSearchText}
    \r\n
    \r\n
    \r\n );\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { ISearchData, ISearchFormViewProps } from '@msdyn365-commerce-modules/search';\r\nimport { Button, INodeProps, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport React from 'react';\r\n\r\nimport { ISearchProps } from '../../definition-extensions/search.ext.props.autogenerated';\r\nimport { MobileAutoSuggestEmptyComponent } from './search.mobile.empty';\r\n\r\n/**\r\n * Render Clear button for mobile viewport.\r\n * @param clearSearchButtonText -The Clear button text.\r\n * @param clearSearch -Clear Search callback.\r\n * @returns -The JSX Element.\r\n */\r\nconst renderClearButton = (clearSearchButtonText: string, clearSearch: () => void): JSX.Element => {\r\n return (\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Render Search form.\r\n * @param form -Form view props.\r\n * @param searchForm -Search Form props.\r\n * @param formWrapper -Form Wrapper props.\r\n * @param isMobile -Is mobile viewport flag.\r\n * @param clearSearchButtonText -The Clear button text.\r\n * @param props -The props for resource.\r\n * @param isSearchText -Is SearchText flag for input text.\r\n * @param clearSearch -Clear Search callback.\r\n * @returns -The JSX Element.\r\n */\r\nexport const FormComponent = (\r\n form: ISearchFormViewProps,\r\n searchForm: INodeProps,\r\n formWrapper: INodeProps,\r\n isMobile: boolean,\r\n clearSearchButtonText: string,\r\n props: ISearchProps,\r\n isSearchText: boolean,\r\n clearSearch: () => void\r\n): JSX.Element => {\r\n const cancelButtonNode = (\r\n \r\n );\r\n\r\n return isMobile ? (\r\n \r\n {form.cancelBtn}\r\n \r\n {form.input}\r\n {isSearchText && renderClearButton(clearSearchButtonText, clearSearch)}\r\n {!isSearchText ? MobileAutoSuggestEmptyComponent(props) : null}\r\n \r\n \r\n ) : (\r\n \r\n \r\n {form.submitBtn}\r\n {form.input}\r\n {isSearchText && cancelButtonNode}\r\n \r\n \r\n );\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { ISearchKeywordViewProps } from '@msdyn365-commerce-modules/search';\r\nimport { INodeProps, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport React from 'react';\r\n\r\n/**\r\n * Render keywords heading.\r\n * @param keywordsHeading -The Keywords result heading.\r\n * @returns The JSX Element.\r\n */\r\nconst renderKeywordSuggestionsTitle = (keywordsHeading: string): JSX.Element => {\r\n const categoryAutoSuggestionHeading = keywordsHeading ? keywordsHeading : 'Keywords';\r\n\r\n return
    {categoryAutoSuggestionHeading}
    ;\r\n};\r\n\r\n/**\r\n * Render keywords reults.\r\n * @param keywordSuggest -The Keywords suggest Node props.\r\n * @param ulKeyword -The List Node props.\r\n * @param keywordsHeading -The Keywords result heading.\r\n * @param noResultText -The \"No Result\" text.\r\n * @param keywordSuggestions -The Keywords suggestion result.\r\n * @param isLoadingAutoSuggest - The autosuggestion loading flag.\r\n * @param isLoadingNode - The autosuggestion loading node.\r\n * @returns -The JSX Element.\r\n */\r\nexport const KeywordSuggestionsComponent = (\r\n keywordSuggest: INodeProps,\r\n ulKeyword: INodeProps,\r\n keywordsHeading: string,\r\n noResultText: string,\r\n keywordSuggestions?: ISearchKeywordViewProps,\r\n isLoadingAutoSuggest?: boolean,\r\n isLoadingNode?: React.ReactNode\r\n): JSX.Element => {\r\n return keywordSuggestions ? (\r\n \r\n {renderKeywordSuggestionsTitle(keywordsHeading)}\r\n \r\n {isLoadingAutoSuggest && isLoadingNode}\r\n {!isLoadingAutoSuggest &&\r\n keywordSuggestions.text.map(text => {\r\n return text;\r\n })}\r\n \r\n \r\n ) : (\r\n \r\n {renderKeywordSuggestionsTitle(keywordsHeading)}\r\n \r\n
  • {noResultText}
  • \r\n
    \r\n
    \r\n );\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { IImageData, Image } from '@msdyn365-commerce/core';\r\nimport { ISearchData, ISearchProductViewProps } from '@msdyn365-commerce-modules/search';\r\nimport { INodeProps, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport React from 'react';\r\n\r\nimport { ISearchProps } from '../../definition-extensions/search.ext.props.autogenerated';\r\n\r\n/**\r\n * Render Products Suggestion result heading.\r\n * @param productSuggestionsHeading -The products suggestion result heading.\r\n * @returns The JSX Element.\r\n */\r\nconst renderProductSuggestionsTitle = (productSuggestionsHeading: string): JSX.Element => {\r\n const productAutoSuggestionHeading = productSuggestionsHeading ? productSuggestionsHeading : 'Products';\r\n\r\n return
    {productAutoSuggestionHeading}
    ;\r\n};\r\n\r\n/**\r\n * Render Products Suggestion result heading.\r\n * @param props -The props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderProductNotFoundResultsImage = (props: ISearchProps): JSX.Element | null => {\r\n const noSearchResultImage: IImageData | undefined = props.config.noSearchResultImage;\r\n if (!noSearchResultImage || !noSearchResultImage.src) {\r\n return null;\r\n }\r\n return (\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Render Products No result section.\r\n * @param props -The props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderProductNotFoundResults = (props: ISearchProps): JSX.Element => {\r\n return (\r\n \r\n
    {renderProductNotFoundResultsImage(props)}
    \r\n
    {props.resources.noResultContentHeadingText}
    \r\n
    \r\n {props.resources.noResultContentParagraphText}\r\n
    \r\n
    \r\n );\r\n};\r\n\r\n/**\r\n * Render Product suggestion result.\r\n * @param productSuggest -The product suggest Node props.\r\n * @param ulProduct -The List Node props.\r\n * @param props -The props.\r\n * @param productSuggestions -The Product suggestion result.\r\n * @param isLoadingAutoSuggest - The autosuggestion loading flag.\r\n * @param isLoadingNode - The autosuggestion loading node.\r\n * @returns The JSX Element.\r\n */\r\nexport const ProductSuggestionsComponent = (\r\n productSuggest: INodeProps,\r\n ulProduct: INodeProps,\r\n props: ISearchProps,\r\n productSuggestions?: ISearchProductViewProps,\r\n isLoadingAutoSuggest?: boolean,\r\n isLoadingNode?: React.ReactNode\r\n): JSX.Element => {\r\n const liProduct: INodeProps = {\r\n tag: 'li',\r\n className: 'msc-no-result-content'\r\n };\r\n return productSuggestions ? (\r\n \r\n {renderProductSuggestionsTitle(props.resources.productSuggestionHeading)}\r\n \r\n {isLoadingAutoSuggest && isLoadingNode}\r\n {!isLoadingAutoSuggest &&\r\n productSuggestions.items.map((item, index) => {\r\n return (\r\n \r\n \r\n {item.thumbnail}\r\n {item.text}\r\n {item.price}\r\n \r\n \r\n );\r\n })}\r\n \r\n \r\n ) : (\r\n \r\n {renderProductSuggestionsTitle(props.resources.productSuggestionHeading)}\r\n \r\n {renderProductNotFoundResults(props)}\r\n \r\n \r\n );\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { ISearchData, ISearchFormViewProps, ISearchViewProps } from '@msdyn365-commerce-modules/search';\r\nimport { Button, format, isMobile, Module, Node, VariantType } from '@msdyn365-commerce-modules/utilities';\r\nimport React, { useCallback, useEffect, useState } from 'react';\r\n\r\nimport { ISearchProps } from '../definition-extensions/search.ext.props.autogenerated';\r\nimport { CategorySuggestionsComponent } from './components/search.categorysuggest';\r\nimport { FormComponent } from './components/search.form';\r\nimport { KeywordSuggestionsComponent } from './components/search.keywordsuggest';\r\nimport { ProductSuggestionsComponent } from './components/search.productsuggest';\r\n\r\n/**\r\n * Render Title for AutoSuggest.\r\n * @param searchSuggestionHeading -The heading resource string.\r\n * @param searchText -The search string.\r\n * @returns -The JSX Element.\r\n */\r\nconst renderTitle = (searchSuggestionHeading: string, searchText: string): JSX.Element => {\r\n const searchTextString = '\"'.concat(searchText.concat('\"'));\r\n const searchAutoSuggestionHeading = format(searchSuggestionHeading, searchTextString);\r\n \r\n return {searchAutoSuggestionHeading};\r\n};\r\n\r\n/**\r\n * Search View.\r\n * @param props - The view props.\r\n * @returns The JSX Element.\r\n */\r\nconst SearchView: React.FC> = (\r\n props: ISearchViewProps & ISearchProps\r\n): JSX.Element => {\r\n const {\r\n Search,\r\n AutoSuggestAriaLabel,\r\n AutoSuggestAriaLabelText,\r\n searchText,\r\n AutoSuggest,\r\n KeywordSuggest,\r\n ProductSuggest,\r\n UlKeyword,\r\n UlProduct,\r\n form,\r\n autosuggestKeyword,\r\n autosuggestProduct,\r\n SearchForm,\r\n FormWrapper,\r\n label,\r\n context,\r\n isLoadingAutoSuggest,\r\n isLoadingNode,\r\n callbacks: { handleCancelSearchFocused }\r\n } = props;\r\n\r\n const { searchSuggestionHeading, categorySuggestionHeading, keywordsHeading, noResultText, clearSearchButtonText } = props.resources;\r\n\r\n const [searchTextString, setSearchTextString] = useState();\r\n const [isMobilePort, setIsMobile] = useState(false);\r\n\r\n useEffect(() => {\r\n setSearchTextString(searchText);\r\n }, [searchText]);\r\n\r\n /**\r\n * ClearSearch callback method to clear search string.\r\n */\r\n const clearSearch = (): void => {\r\n setSearchTextString('');\r\n\r\n const propsForm = props.form as ISearchFormViewProps;\r\n const propsFormInput = propsForm.input as React.DetailedHTMLProps, HTMLInputElement>;\r\n const propsFormInputCurrent = (propsFormInput.ref as React.RefObject).current;\r\n\r\n if (propsFormInputCurrent) {\r\n propsFormInputCurrent.value = '';\r\n }\r\n\r\n propsFormInput.value = '';\r\n props.searchText = '';\r\n props.FormWrapper.action = '';\r\n };\r\n\r\n const isMobileViewport = useCallback(() => {\r\n const isMobileView = isMobile({ variant: VariantType.Browser, context: context.request }) === 'xs';\r\n setIsMobile(isMobileView);\r\n }, [context]);\r\n\r\n useEffect(() => {\r\n window.addEventListener('resize', isMobileViewport);\r\n isMobileViewport();\r\n }, [isMobileViewport]);\r\n\r\n const viewport = isMobile({ variant: VariantType.Browser, context: context.request });\r\n\r\n const isMobileView = viewport === 'sm' || viewport === 'xs';\r\n\r\n AutoSuggest.className = !StringExtensions.isNullOrEmpty(searchTextString)\r\n ? `${AutoSuggest.className} show`\r\n : `${AutoSuggest.className} hide`;\r\n const isSearchText: boolean = !StringExtensions.isNullOrEmpty(searchTextString);\r\n\r\n return (\r\n \r\n {label}\r\n {FormComponent(\r\n form as ISearchFormViewProps,\r\n SearchForm,\r\n FormWrapper,\r\n isMobilePort,\r\n clearSearchButtonText,\r\n props,\r\n isSearchText,\r\n clearSearch\r\n )}\r\n {!isMobileView && (\r\n \r\n {!StringExtensions.isNullOrEmpty(searchTextString) ? (\r\n {AutoSuggestAriaLabelText}\r\n ) : (\r\n ''\r\n )}\r\n {!StringExtensions.isNullOrEmpty(searchTextString) ? (\r\n <>\r\n \r\n \r\n {renderTitle(searchSuggestionHeading, searchText)}\r\n \r\n \r\n \r\n {CategorySuggestionsComponent(\r\n categorySuggestionHeading,\r\n noResultText,\r\n props,\r\n isLoadingAutoSuggest,\r\n isLoadingNode\r\n )}\r\n {KeywordSuggestionsComponent(\r\n KeywordSuggest,\r\n UlKeyword,\r\n keywordsHeading,\r\n noResultText,\r\n autosuggestKeyword,\r\n isLoadingAutoSuggest,\r\n isLoadingNode\r\n )}\r\n \r\n {ProductSuggestionsComponent(\r\n ProductSuggest,\r\n UlProduct,\r\n props,\r\n autosuggestProduct,\r\n isLoadingAutoSuggest,\r\n isLoadingNode\r\n )}\r\n \r\n \r\n ) : null}\r\n \r\n )}\r\n {isMobileView && props.isSearchFormExpanded && (\r\n \r\n {!StringExtensions.isNullOrEmpty(searchTextString) ? (\r\n {AutoSuggestAriaLabelText}\r\n ) : (\r\n ''\r\n )}\r\n {!StringExtensions.isNullOrEmpty(searchTextString) ? (\r\n <>\r\n \r\n {(form as ISearchFormViewProps).cancelBtn}\r\n {renderTitle(searchSuggestionHeading, searchText)}\r\n \r\n \r\n \r\n {CategorySuggestionsComponent(\r\n categorySuggestionHeading,\r\n noResultText,\r\n props,\r\n isLoadingAutoSuggest,\r\n isLoadingNode\r\n )}\r\n {KeywordSuggestionsComponent(\r\n KeywordSuggest,\r\n UlKeyword,\r\n keywordsHeading,\r\n noResultText,\r\n autosuggestKeyword,\r\n isLoadingAutoSuggest,\r\n isLoadingNode\r\n )}\r\n \r\n {ProductSuggestionsComponent(\r\n ProductSuggest,\r\n UlProduct,\r\n props,\r\n autosuggestProduct,\r\n isLoadingAutoSuggest,\r\n isLoadingNode\r\n )}\r\n \r\n \r\n ) : null}\r\n \r\n )}\r\n \r\n );\r\n};\r\nexport default SearchView;\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['ext-search'] = {\n c: () => require('partner/modules/ext-search/ext-search.tsx'),\n $type: 'contentModule',\n da: [{name:'searchState', path:'@msdyn365-commerce-modules/search-utilities/dist/lib/search-state-data-action', runOn: 1}],\n \n iNM: false,\n ns: '__local__',\n n: 'ext-search',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/ext-search'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/search-utilities/dist/lib/search-state-data-action';\n let dataAction = require('@msdyn365-commerce-modules/search-utilities/dist/lib/search-state-data-action');\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|ext-search|ext-search'] = {\n c: () => require('partner/modules/ext-search/ext-search.view.tsx'),\n cn: '__local__-__local__-ext-search'\n };\nviewDictionary['__local__|__local__|themes|only|views|ext-search'] = {\n c: () => require('partner/themes/only/views/ext-search.view.tsx'),\n cn: '__local__-__local__-ext-search'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { observable } from 'mobx';\n\n/**\n * State information related to what is needed to succesfully perform a autosuggest.\n */\nexport class SearchState {\n @observable public searchText?: string;\n\n @observable public defaultBasicSearchUrl?: string;\n\n @observable public searchQueryStringParameter?: string;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction, IAction, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\nimport { GenericInput, getGenericAction } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { SearchState } from './search-state';\n\nexport function createSearchStateInput(result: SearchState): GenericInput {\n return new GenericInput('searchState', result, 'SearchState');\n}\n\nconst createsearchStateInputInternal = (inputData: ICreateActionContext>): IActionInput => {\n return createSearchStateInput({ searchText: '' });\n};\n\nexport const getGenericActionDataAction = createObservableDataAction({\n action: >getGenericAction,\n input: createsearchStateInputInternal\n});\n\nexport default getGenericActionDataAction;\n","module.exports = React;","module.exports = ReactDOM;"],"names":["SuggestionType","ProductListInventoryFilteringOptions","AutoSuggestInput","constructor","searchText","top","suggestionType","hitPrefix","hitSuffix","getCacheKey","getCacheObjectType","dataCacheType","this","searchQuery","topResultsCount","async","_getAutoSuggest","input","autosuggest","ctx","_ctx$requestContext$a","catalogId","getCatalogId","requestContext","productSearchCriteria","SearchCondition","length","Context","ChannelId","apiSettings","channelId","CatalogId","app","config","productListInventoryDisplay","HideOOS","inventoryRefinerValue","getInventorySortableRefinerValue","channelInventoryConfiguration","isInStock","ProductAvailabilitySortableAttributeRecordId","RefinerRecordId","DataTypeValue","AttributeDataType","TrueFalse","LeftValueBoundString","RightValueBoundString","UnitText","RowNumber","Count","ExtensionProperties","RefinerSourceValue","ProductRefinerSource","Attribute","getInventoryConfigurationAsync","callerContext","_objectSpread","Refinement","searchCriteria","ProductSearchCriteria","HitPrefix","HitSuffix","searchSuggestions","getSearchSuggestionsAsync","queryResultSettings","Paging","Top","map","item","ImageUrl","generateImageUrl","AllSearchResults","telemetry","error","createObservableDataAction","id","action","Error","autoSuggestPromises","Promise","all","then","inputData","payLoad","CategorySuggestionsComponent","props","suggestions","autoSuggestProps","resources","categorySuggestionHeading","reactNodes","getPayloadObject","telemetryContent","push","_assembleNode","title","_renderTitle","text","categoryAutoSuggestionHeading","format","React","className","shouldShowFullPath","splitValue","Value","split","pop","ariaLabel","replace","RegExp","contentAction","etext","attribute","getTelemetryAttributes","key","Id","Object","assign","href","_generateLink","_getHighlightedText","suggestion","_getCategoryLink","_categoryRefiners$Val","searchPageURL","searchQsp","searchRefiners","MsDyn365","isBrowser","queryUrl","URL","window","location","searchParams","set","categoryRefiners","find","refiners","SourceValue","Category","refiner","Values","Number","parseInt","encodedRefiner","JSON","stringify","compressRefiners","formattedText","dangerouslySetInnerHTML","getRichTextHtml","compressedRefinerKeys","compressedRefiners","forEach","compressedRefiner","refinerKey","FormComponent","searchPlaceholder","hideSearchLabel","searchTextInput","handleInputChange","maxChars","disableSubmitSearch","handleCancelSearchChange","query","ariaLabelCancel","ariaLabelSearch","ariaLabelSubmit","onInputChange","event","target","value","onInputChangeFunction","inputNode","type","name","placeholder","ref","onChange","maxLength","submitBtnNode","Button","cancelBtn","onClick","submitBtn","KeywordSuggestionsComponent","formattedLink","LabelComponent","searchLabelClass","searchLabelArialLabel","isSearchFormExpanded","searchtext","searchCollapsedLabel","attributes","innerRef","ProductSuggestionsComponent","context","actionContext","productSuggestionHeading","moduleType","moduleId","items","productAutoSuggestionHeading","_item$Value","altText","price","Value3","DecimalValue","thumbnail","_renderThumbnail","ObjectExtensions","isNullOrUndefined","_renderPrice","LiProduct","_getLiWrapper","AProduct","_getAWrapper","tag","recid","cultureFormatter","formatCurrency","getProductPageUrlSync","undefined","adjustedPrice","basePrice","_props$resources","PriceComponent","typeName","data","CustomerContextualPrice","BasePrice","freePriceText","request","gridSettings","imageSettings","cropFocalRegion","Image","src","viewports","xs","q","w","h","lg","xl","lazyload","loadFailureBehavior","SuggestionTypeCriterionSuggestionType","Search","super","waitTime","_isLoadingNode","loadingText","autoSuggestResultLoadingMessage","Spinner","label","size","SpinnerSize","medium","labelPosition","_focusOutTarget","e","state","closest","_clearAutoSuggestState","_keyup","keyCode","KeyCodes","Escape","setState","formReference","current","contains","autoSuggestResultDiv","searchState","defaultBasicSearchUrl","searchQueryStringParameter","update","createSearchStateInput","_handleInputChange","cancellabelDebounce","cancel","ArrayExtensions","hasElements","inputSuggestionType","_loadSuggestions","_handleSubmit","preventDefault","focus","searchURL","_appendQueryParams","getUrlSync","document","_handleCancelSearchChange","isInitialState","_handleCancelSearchFocused","route","qsp","_setAutoSuggestResultCount","result","autoSuggestResultScreenReaderDiv","ariaLiveRegion","suggestResultString","autoSuggestFoundMessage","emptyResultString","noAutoSuggestionMessage","innerText","setAttribute","searchKeywordSuggestClass","searchProductSuggestClass","searchCategorySuggestClass","autoSuggestAriaLabel","isLoadingAutoSuggest","searchInputMaxLength","searchFormClass","getTelemetryObject","telemetryPageName","friendlyName","_initSuggestionTypes","body","addEventListener","componentWillUnmount","removeEventListener","componentDidUpdate","params","isEditor","shouldComponentUpdate","nextProps","nextState","render","_suggestions$AllSearc","_suggestions$AllSearc2","_suggestions$AllSearc3","cancelBtnAriaLabel","searchBtnAriaLabel","submitBtnAriaLabel","searchplaceholderText","shouldShowFullCategoryPath","keywordSuggestions","filter","Keyword","None","productSuggestions","Product","categorySuggestions","_item$RefinerRecordId","viewProps","moduleProps","classnames","AutoSuggestAriaLabel","AutoSuggestAriaLabelText","AutoSuggest","KeywordSuggest","ProductSuggest","CategorySuggest","SearchForm","FormWrapper","role","autoComplete","onSubmit","UlKeyword","UlProduct","UlCategory","form","autosuggestKeyword","autosuggestProduct","autosuggestCategory","callbacks","handleCancelSearchFocused","isLoadingNode","renderView","suggestionTypes","suggestionTypeCriterion","unique","validValues","keyword","product","scopedCategory","validSuggestions","loadSuggestionsRequestId","_this$props$app$confi","getSearchSuggestionsAction","_getSuggestionType","useCommercialStyleName","searchSuggestion","_this$props$context$a","_this$props$app$confi2","ProductsDataActions","QueryResultSettingsProxy","getPagingFromInputDataOrDefaultValue","getCommercialName","commercialStyleNameAttribute","exception","debug","_getSearchRefiners","_debounce","Random","Guid","generateGuid","_getSearchSuggestions","_updateSearchRefiners","setTimeout","suggestionTypeItem","charAt","toUpperCase","slice","join","validateCatalogId","_renderForm","Node","_renderKeywordSuggestions","_renderProductSuggestions","index","_renderCategorySuggestions","Module","_productName$split$","arguments","productName","styleName","x","Name","productBrand","TextValue","renderCategorySuggestionsTitle","inCategoriesHeading","noResultText","MobileAutoSuggestEmptyComponent","noSearchResultImage","renderProductNotFoundResultsImage","emptyMobileSearchTextHeading","emptyMobileSearchText","searchForm","formWrapper","isMobile","clearSearchButtonText","isSearchText","clearSearch","cancelButtonNode","renderClearButton","renderKeywordSuggestionsTitle","keywordsHeading","keywordSuggest","ulKeyword","renderProductSuggestionsTitle","productSuggestionsHeading","renderProductNotFoundResults","noResultContentHeadingText","noResultContentParagraphText","productSuggest","ulProduct","_item$id","renderTitle","searchSuggestionHeading","searchTextString","concat","searchAutoSuggestionHeading","setSearchTextString","useState","isMobilePort","setIsMobile","useEffect","propsFormInput","propsFormInputCurrent","isMobileViewport","useCallback","isMobileView","variant","VariantType","Browser","viewport","StringExtensions","isNullOrEmpty","onBlur","binding","modules","dataActions","c","require","$type","da","path","runOn","iNM","ns","n","p","pdp","md","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","__bindings__","viewDictionary","cn","SearchState","__decorate","observable","GenericInput","getGenericActionDataAction","getGenericAction","module","exports","ReactDOM"],"sourceRoot":""}