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AAa,IAwCvCF,EAAQC,QAAQ,qCAAuC,CACpDE,EAAGA,IAAMC,EAAQ,MACjBC,MAAO,kBACPC,GAAI,CAAC,CAACC,KAAK,eAAiBC,KAAK,uEAAwEC,MAAO,IAEhHC,KAAK,EACLC,GAAI,YACJC,EAAG,oCACHC,EAAG,YAEHC,IAAK,GAGLC,GAAI,iDAlC4BC,EAACC,EAAqBC,KAUlD,GADAlB,EAAQE,YAAYe,GAAuBC,GACtClB,EAAQE,YAAYe,GAAqBE,QAC1C,MAAM,IAAIC,MAAM,oBAAsBH,EAAsB,mCAEhEjB,EAAQE,YAAYe,GAAqBE,QAAQE,UAAUC,eAAiBL,EACxEjB,EAAQE,YAAYe,GAAqBE,QAAQE,UAAUxG,KAC3DmF,EAAQE,YAAYF,EAAQE,YAAYe,GAAqBE,QAAQE,UAAUxG,IAAMoG,IA0BzFD,CAF4B,uEACXZ,EAAQ,KAMjC/D,OAAOkF,aAAelF,OAAOkF,cAAgB,GAC7ClF,OAAOkF,aAAatB,QAAO5F,EAAAA,EAAA,GACpBgC,OAAOkF,aAAatB,SAAW,IAC/BD,EAAQC,SAGX5D,OAAOkF,aAAarB,YAAW7F,EAAAA,EAAA,GAC5BgC,OAAOkF,aAAarB,aAAe,IACnCF,EAAQE,aAEY,MAAMsB,EAAiB,GAC9BA,EAAe,mGAAqG,CAC5HrB,EAAGA,IAAMC,EAAQ,MACjBqB,GAAI,yDAEpBpF,OAAOkF,aAAelF,OAAOkF,cAAgB,GAC7ClF,OAAOkF,aAAaC,eAAcnH,EAAAA,EAAA,GACPgC,OAAOkF,aAAaC,gBAAkB,IACtCA,UCnF3BE,EAAOC,QAAU1N,cCAjByN,EAAOC,QAAUC","sources":["webpack://Msdyn365.Commerce.Online/./src/modules/britax-related-product-collection/britax-related-product-collection.props.autogenerated.ts?706e","webpack://Msdyn365.Commerce.Online/./src/modules/britax-related-product-collection/britax-related-product-collection.tsx?98fa","webpack://Msdyn365.Commerce.Online/./src/modules/britax-related-product-collection/britax-related-product-collection.view.tsx?f0b9","webpack://Msdyn365.Commerce.Online/./lib/britax-related-product-collection/module-registration.js?c3ff","webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online/external var \"ReactDOM\"?853b"],"sourcesContent":["/**\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. See License.txt in the project root for license information.\r\n * IBritaxRelatedProductCollection 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 layout {\r\n carousel = 'carousel',\r\n grid = 'grid'\r\n}\r\n\r\nexport interface IBritaxRelatedProductCollectionConfig extends Msdyn365.IModuleConfig {\r\n productCollection: Msdyn365.IProductList;\r\n heading?: IHeadingData;\r\n layout?: layout;\r\n allowBackNavigation?: boolean;\r\n imageSettings?: Msdyn365.IImageSettings;\r\n clientRender?: boolean;\r\n enableAffiliationBasedPricing?: boolean;\r\n shouldDisplaySeeAllButton?: boolean;\r\n className?: string;\r\n}\r\n\r\nexport interface IBritaxRelatedProductCollectionResources {\r\n priceFree: string;\r\n priceRangeSeparator: string;\r\n ratingAriaLabel: string;\r\n flipperNext: string;\r\n flipperPrevious: string;\r\n originalPriceText: string;\r\n currentPriceText: string;\r\n ratingCountAriaLabel: string;\r\n ratingCountAriaLabelSingleUser: string;\r\n seeAllButtonText: string;\r\n}\r\n\r\nexport const enum HeadingTag {\r\n h1 = 'h1',\r\n h2 = 'h2',\r\n h3 = 'h3',\r\n h4 = 'h4',\r\n h5 = 'h5',\r\n h6 = 'h6'\r\n}\r\n\r\nexport interface IHeadingData {\r\n text: string;\r\n tag?: HeadingTag;\r\n}\r\n\r\nexport interface IBritaxRelatedProductCollectionProps extends Msdyn365.IModule {\r\n resources: IBritaxRelatedProductCollectionResources;\r\n config: IBritaxRelatedProductCollectionConfig;\r\n slots: {\r\n quickview: React.ReactNode[];\r\n productComparisonButton: React.ReactNode[];\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\nimport { IProductsDimensionsAvailabilities } from '@msdyn365-commerce/commerce-entities';\r\nimport { IPriceComponentResources } from '@msdyn365-commerce/components';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { getCatalogId, getUrlSync, ICoreContext } from '@msdyn365-commerce/core';\r\nimport {\r\n ChannelInventoryConfiguration,\r\n ProductPrice,\r\n ProductSearchResult,\r\n StoreOperationsDataActions\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ArrayExtensions,\r\n DimensionAvailabilitiesForProductSearchResultInput,\r\n DimensionTypes,\r\n DimensionSwatchDisplayTypes,\r\n getDimensionAvailabilitiesForProductSearchResultAction,\r\n getPriceForProductSearchResult,\r\n IDimensionsApp,\r\n ObjectExtensions,\r\n PriceForProductSearchResultInput,\r\n validateCatalogId\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n Button,\r\n getTelemetryObject,\r\n IComponentNodeProps,\r\n IModuleProps,\r\n INodeProps,\r\n ISingleSlideCarouselProps,\r\n ITelemetryContent,\r\n NodeTag,\r\n SingleSlideCarousel\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\n\r\nimport { IBritaxRelatedProductCollectionData } from './britax-related-product-collection.data';\r\nimport { IBritaxRelatedProductCollectionProps, layout } from './britax-related-product-collection.props.autogenerated';\r\nimport ProductComponent from '../../themes/britax-adventureworks/views/components/product.component';\r\nimport { IViewPort } from '@msdyn365-commerce/core-internal/dist/types/interfaces/data-types/IImageSettings';\r\n\r\nexport interface IProductCollectionViewProps extends IBritaxRelatedProductCollectionProps {\r\n heading?: React.ReactNode;\r\n ProductCollectionContainer: IModuleProps;\r\n SingleSlideCarouselComponentProps: INodeProps;\r\n GridComponentProps: INodeProps;\r\n products: IProductComponentViewProps[];\r\n isCarousel: boolean;\r\n productPrices?: ProductPrice[];\r\n seeAllButton?: React.ReactNode;\r\n}\r\n\r\nexport interface IProductComponentViewProps {\r\n ProductContainer: INodeProps;\r\n productComponent: React.ReactNode;\r\n}\r\nexport interface IProductComponentState {\r\n products: ProductSearchResult[];\r\n productsDimensionAvailabilities?: IProductsDimensionsAvailabilities[][];\r\n channelInventoryConfiguration?: ChannelInventoryConfiguration;\r\n}\r\n\r\n/**\r\n * ProductCollection component.\r\n */\r\nclass ProductCollection extends React.PureComponent<\r\n IBritaxRelatedProductCollectionProps,\r\n IProductComponentState\r\n> {\r\n private readonly telemetryContent: ITelemetryContent;\r\n\r\n private readonly productPrices: ProductPrice[];\r\n private _isMounted: boolean = false;\r\n constructor(props: IBritaxRelatedProductCollectionProps) {\r\n super(props);\r\n this.productPrices = [];\r\n this.state = {\r\n products: this.props.config.productCollection.products || []\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\r\n public async componentDidMount(): Promise {\r\n this._isMounted = true;\r\n if (this.props.config.enableAffiliationBasedPricing && this.props.context.actionContext.requestContext.user.isAuthenticated) {\r\n await this._getActivePrice();\r\n }\r\n const channelInventoryConfiguration = await StoreOperationsDataActions.getInventoryConfigurationAsync({\r\n callerContext: this.props.context.actionContext\r\n });\r\n if (this._isMounted) {\r\n this.setState({ channelInventoryConfiguration });\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const { heading, className, shouldDisplaySeeAllButton } = this.props.config;\r\n const { resources } = this.props;\r\n const recommendation = this.props.config.productCollection.recommendationListId;\r\n\r\n // Initialize state in case if the products were not found during initial module render\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises -- Initialize data if not there.\r\n this.initProductState(this.props.config.productCollection);\r\n\r\n const products = this.state.products;\r\n const isCarousel = this.props.config.layout === layout.carousel;\r\n const headingLabel = heading ? heading.text : '';\r\n const headingComponent = heading && (\r\n \r\n );\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- product check for safety.\r\n const updatedProducts = products?.map((item: ProductSearchResult, index: number) => {\r\n const getProductData = this._getProduct(item, index);\r\n return !ObjectExtensions.isNullOrUndefined(getProductData) ? getProductData : undefined;\r\n });\r\n\r\n const productCollectionViewProps = {\r\n ...this.props,\r\n heading: headingComponent,\r\n SingleSlideCarouselComponentProps: {\r\n tag: SingleSlideCarousel,\r\n className: '',\r\n flipperPrevLabel: `${headingLabel} ${resources.flipperPrevious}`,\r\n flipperNextLabel: `${headingLabel} ${resources.flipperNext}`,\r\n parentId: this.props.id,\r\n telemetryContent: this.telemetryContent\r\n } as IComponentNodeProps,\r\n ProductCollectionContainer: {\r\n moduleProps: this.props,\r\n className: classnames('ms-product-collection', className)\r\n },\r\n GridComponentProps: {\r\n tag: 'ul' as NodeTag,\r\n className: 'ms-product-collection__items'\r\n },\r\n isCarousel,\r\n\r\n products:\r\n ArrayExtensions.hasElements(updatedProducts) &&\r\n updatedProducts.filter(item => {\r\n return item !== undefined;\r\n }),\r\n productPrices: this.productPrices,\r\n seeAllButton:\r\n recommendation && shouldDisplaySeeAllButton && ArrayExtensions.hasElements(updatedProducts)\r\n ? this._getSeeAllButton(recommendation, headingLabel)\r\n : undefined\r\n };\r\n return this.props.renderView(productCollectionViewProps) as React.ReactElement;\r\n }\r\n\r\n public handleHeadingChange = (event: Msdyn365.ContentEditableEvent) => (this.props.config.heading!.text = event.target.value);\r\n\r\n /**\r\n * Get products dimension availabilities.\r\n * @param products - Products.\r\n * @returns Promise.\r\n */\r\n private readonly _getProductsDimensionsAvailabilities = async (products: ProductSearchResult[]): Promise => {\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 const validProducts = ArrayExtensions.validValues(products);\r\n if (\r\n ArrayExtensions.hasElements(validProducts) &&\r\n ArrayExtensions.hasElements(dimensionsToDisplayOnProductCard) &&\r\n !dimensionsToDisplayOnProductCard.includes(DimensionTypes.none) &&\r\n ArrayExtensions.hasElements(dimensionsToDisplayAsSwatch) &&\r\n !dimensionsToDisplayAsSwatch.includes(DimensionTypes.none)\r\n ) {\r\n const productsDimensionAvailabilities = await getDimensionAvailabilitiesForProductSearchResultAction(\r\n new DimensionAvailabilitiesForProductSearchResultInput(\r\n validProducts,\r\n this.props.context as ICoreContext,\r\n DimensionSwatchDisplayTypes.productCard\r\n ),\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 }\r\n };\r\n\r\n /**\r\n * Helper method to initialize products state.\r\n * @param productCollection - List of products.\r\n */\r\n private readonly initProductState = async (productCollection: Msdyn365.IProductList) => {\r\n let products = this.state.products;\r\n const productCollectionProducts = productCollection.products;\r\n if (!ArrayExtensions.hasElements(products) && ArrayExtensions.hasElements(productCollectionProducts)) {\r\n products = productCollectionProducts;\r\n this.setState({ products });\r\n } else if (\r\n ArrayExtensions.hasElements(products) &&\r\n ArrayExtensions.hasElements(productCollectionProducts) &&\r\n !ArrayExtensions.equals(products, productCollectionProducts)\r\n ) {\r\n products = productCollectionProducts;\r\n this.setState({ products });\r\n } else if (productCollectionProducts === undefined && ArrayExtensions.hasElements(this.state.products)) {\r\n products = [];\r\n this.setState({ products: products });\r\n }\r\n\r\n if (Msdyn365.msdyn365Commerce.isBrowser && !ArrayExtensions.hasElements(this.state.productsDimensionAvailabilities)) {\r\n await this._getProductsDimensionsAvailabilities(products);\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\n private 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 private readonly _getProduct = (product: ProductSearchResult, index: number): IProductComponentViewProps | null => {\r\n if (!product || !product.Name) {\r\n this.props.telemetry.trace('[product-collection] Product or product name is null');\r\n return null;\r\n }\r\n const telemetryContent = getTelemetryObject(\r\n this.props.context.request.telemetryPageName!,\r\n this.props.friendlyName,\r\n this.props.telemetry\r\n );\r\n const { imageSettings, allowBackNavigation } = this.props.config;\r\n const defaultImageSettingsQ = 'w=295&h=295&m=6&q=6';\r\n const viewports: IViewPort = {\r\n xs: { q: defaultImageSettingsQ, w: 0, h: 0 },\r\n lg: { q: defaultImageSettingsQ, w: 0, h: 0 },\r\n xl: { q: defaultImageSettingsQ, w: 0, h: 0 }\r\n };\r\n const resources = this.props.resources;\r\n const breaCrumbType = this.props.context.app.config.breadcrumbType;\r\n const allowBack = allowBackNavigation && (breaCrumbType === 'back' || breaCrumbType === 'categoryAndBack');\r\n const quickviewSlot =\r\n this.props.slots && this.props.slots.quickview && this.props.slots.quickview.length > 0 ? this.props.slots.quickview[0] : null;\r\n const productComparisonButtonSlot = ArrayExtensions.hasElements(this.props.slots.productComparisonButton)\r\n ? this.props.slots.productComparisonButton[0]\r\n : null;\r\n\r\n const reviewCount = 1;\r\n const reviewTotalRatings = Number(product.TotalRatings);\r\n const reviewCountAriaLabelValue =\r\n reviewTotalRatings > reviewCount ? resources.ratingCountAriaLabel : resources.ratingCountAriaLabelSingleUser;\r\n const isPriceMinMaxEnabled = this.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 const channelInventoryConfigurationId = this.state.channelInventoryConfiguration?.InventoryProductAttributeRecordId;\r\n return {\r\n ProductContainer: {\r\n tag: 'li' as NodeTag,\r\n className: 'ms-product-collection__item',\r\n role: 'listitem',\r\n key: index\r\n },\r\n productComponent: (\r\n \r\n ArrayExtensions.hasElements(dimensionAvailability) &&\r\n dimensionAvailability[0].masterProductId === (product.MasterProductId ?? product.RecordId)\r\n )}\r\n />\r\n )\r\n };\r\n };\r\n\r\n /**\r\n * Get the active price for products.\r\n */\r\n private readonly _getActivePrice = async (): Promise => {\r\n const productsList = this.state.products;\r\n const products = await getPriceForProductSearchResult(\r\n new PriceForProductSearchResultInput(productsList),\r\n this.props.context.actionContext\r\n );\r\n if (Msdyn365.msdyn365Commerce.isBrowser) {\r\n await this._getProductsDimensionsAvailabilities(products);\r\n }\r\n\r\n this.setState({ products });\r\n };\r\n\r\n /**\r\n * Get the see all button.\r\n * @param recommendation - Recommendation.\r\n * @param headingLabel - Heading label.\r\n * @returns IProductComponentSeeAllViewProps - Product component see all view props.\r\n */\r\n private readonly _getSeeAllButton = (recommendation: string, headingLabel: string): React.ReactNode => {\r\n if (!Msdyn365.msdyn365Commerce.isBrowser) {\r\n return null;\r\n }\r\n\r\n const catalogId = getCatalogId(this.props.context.request);\r\n validateCatalogId(catalogId);\r\n const searchPageLink = getUrlSync('search', this.props.context.actionContext);\r\n if (!searchPageLink) {\r\n return null;\r\n }\r\n\r\n const url = new URL(searchPageLink, window.location.href);\r\n url.searchParams.set('recommendation', recommendation);\r\n url.searchParams.set('title', headingLabel);\r\n url.searchParams.set('catalogid', `${catalogId}`);\r\n\r\n return (\r\n \r\n {this.props.resources.seeAllButtonText}\r\n \r\n );\r\n };\r\n}\r\n\r\nexport default ProductCollection;\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 { IProductCollectionViewProps, IProductComponentViewProps } from './britax-related-product-collection';\r\n\r\nconst ProductCollectionView: React.FC = props => {\r\n const {\r\n heading,\r\n ProductCollectionContainer,\r\n products,\r\n SingleSlideCarouselComponentProps,\r\n GridComponentProps,\r\n isCarousel,\r\n seeAllButton\r\n } = props;\r\n\r\n if (products) {\r\n return (\r\n \r\n {heading}\r\n {seeAllButton}\r\n {isCarousel ? _renderCarousel(SingleSlideCarouselComponentProps, products) : _renderGrid(GridComponentProps, products)}\r\n \r\n );\r\n }\r\n props.context.telemetry.error('Product collection content is empty, module wont render.');\r\n return null;\r\n};\r\n\r\nconst _renderCarousel = (carouselContainer: INodeProps, items: IProductComponentViewProps[]): JSX.Element => {\r\n return {items && items.map(_renderProduct)};\r\n};\r\n\r\nconst _renderGrid = (gridContainer: INodeProps, items: IProductComponentViewProps[]): JSX.Element => {\r\n return {items && items.map(_renderProduct)};\r\n};\r\n\r\nconst _renderProduct = (product: IProductComponentViewProps): JSX.Element => {\r\n const { ProductContainer, productComponent } = product;\r\n\r\n return {productComponent};\r\n};\r\n\r\nexport default ProductCollectionView;\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['britax-related-product-collection'] = {\n c: () => require('partner/modules/britax-related-product-collection/britax-related-product-collection.tsx'),\n $type: 'containerModule',\n da: [{name:'featureState', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'britax-related-product-collection',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/britax-related-product-collection'\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 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|britax-related-product-collection|britax-related-product-collection'] = {\n c: () => require('partner/modules/britax-related-product-collection/britax-related-product-collection.view.tsx'),\n cn: '__local__-__local__-britax-related-product-collection'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["layout","HeadingTag","ProductCollection","React","constructor","props","super","_isMounted","handleHeadingChange","event","this","config","heading","text","target","value","_getProductsDimensionsAvailabilities","async","context","dimensionsToDisplayOnProductCard","app","dimensionsInProductCard","dimensionsToDisplayAsSwatch","dimensionsAsSwatchType","validProducts","ArrayExtensions","validValues","products","hasElements","includes","DimensionTypes","none","productsDimensionAvailabilities","getDimensionAvailabilitiesForProductSearchResultAction","DimensionAvailabilitiesForProductSearchResultInput","DimensionSwatchDisplayTypes","productCard","actionContext","setState","initProductState","state","productCollectionProducts","productCollection","equals","undefined","Msdyn365","isBrowser","_getProduct","product","index","_this$props$data$feat","_this$state$channelIn","_this$state$productsD","Name","telemetry","trace","telemetryContent","getTelemetryObject","request","telemetryPageName","friendlyName","imageSettings","allowBackNavigation","defaultImageSettingsQ","viewports","xs","q","w","h","lg","xl","resources","breaCrumbType","breadcrumbType","allowBack","quickviewSlot","slots","quickview","length","productComparisonButtonSlot","productComparisonButton","reviewCountAriaLabelValue","Number","TotalRatings","ratingCountAriaLabel","ratingCountAriaLabelSingleUser","isPriceMinMaxEnabled","data","featureState","result","find","priceResources","priceRangeSeparator","channelInventoryConfigurationId","channelInventoryConfiguration","InventoryProductAttributeRecordId","ProductContainer","tag","className","role","key","productComponent","ProductComponent","_objectSpread","freePriceText","priceFree","originalPriceText","currentPriceText","ratingAriaLabel","inventoryLabel","getInventoryLabel","id","typeName","quickViewButton","IsEnabled","dimensionAvailabilities","dimensionAvailability","_product$MasterProduc","masterProductId","MasterProductId","RecordId","_getActivePrice","productsList","getPriceForProductSearchResult","PriceForProductSearchResultInput","_getSeeAllButton","recommendation","headingLabel","catalogId","getCatalogId","validateCatalogId","searchPageLink","getUrlSync","url","URL","window","location","href","searchParams","set","Button","title","seeAllButtonText","productPrices","enableAffiliationBasedPricing","requestContext","user","isAuthenticated","StoreOperationsDataActions","callerContext","render","shouldDisplaySeeAllButton","recommendationListId","isCarousel","carousel","headingComponent","editProps","onEdit","updatedProducts","map","item","getProductData","ObjectExtensions","isNullOrUndefined","productCollectionViewProps","SingleSlideCarouselComponentProps","SingleSlideCarousel","flipperPrevLabel","flipperPrevious","flipperNextLabel","flipperNext","parentId","ProductCollectionContainer","moduleProps","classnames","GridComponentProps","filter","seeAllButton","renderView","AttributeValues","inventoryAttribute","attribute","TextValue","_renderCarousel","carouselContainer","items","Node","Object","assign","_renderProduct","_renderGrid","gridContainer","Module","error","binding","modules","dataActions","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}