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7C3G,OAAO2G,aAAarB,QAAO1D,EAAAA,EAAA,GACpB5B,OAAO2G,aAAarB,SAAW,IAC/BD,EAAQC,SAGXtF,OAAO2G,aAAapB,YAAW3D,EAAAA,EAAA,GAC5B5B,OAAO2G,aAAapB,aAAe,IACnCF,EAAQE,aAEY,MAAMqB,EAAiB,GAC9BA,EAAe,yEAA2E,CAClGpB,EAAGA,IAAMC,EAAQ,MACjBoB,GAAI,4CAEpB7G,OAAO2G,aAAe3G,OAAO2G,cAAgB,GAC7C3G,OAAO2G,aAAaC,eAAchF,EAAAA,EAAA,GACP5B,OAAO2G,aAAaC,gBAAkB,IACtCA,UCnF3BE,EAAOC,QAAUnO,cCAjBkO,EAAOC,QAAUC","sources":["webpack://morland-ecommerce/./src/modules/c-product-collection/c-product-collection.props.autogenerated.ts?0732","webpack://morland-ecommerce/./src/modules/c-product-collection/c-product-collection.tsx?1d9f","webpack://morland-ecommerce/./src/modules/c-product-collection/c-product-collection.view.tsx?9f10","webpack://morland-ecommerce/./lib/c-product-collection/module-registration.js?af14","webpack://morland-ecommerce/external var \"React\"?0d3b","webpack://morland-ecommerce/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 * ICProductCollection 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 ICProductCollectionConfig extends Msdyn365.IModuleConfig {\r\n productCollection: Msdyn365.IProductList;\r\n excludeVatLabel?: string;\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 ICProductCollectionResources {\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 ICProductCollectionProps extends Msdyn365.IModule {\r\n resources: ICProductCollectionResources;\r\n config: ICProductCollectionConfig;\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, ProductComponent } from '@msdyn365-commerce/components';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { getCatalogId, getUrlSync, ICoreContext } from '@msdyn365-commerce/core';\r\nimport { ProductPrice, ProductSearchResult } 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 { ICProductCollectionData } from './c-product-collection.data';\r\nimport { ICProductCollectionProps, layout } from './c-product-collection.props.autogenerated';\r\n\r\nexport interface IProductCollectionViewProps extends ICProductCollectionProps {\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}\r\n\r\n/**\r\n * ProductCollection component.\r\n */\r\nclass ProductCollection extends React.PureComponent, IProductComponentState> {\r\n private readonly telemetryContent: ITelemetryContent;\r\n\r\n private readonly productPrices: ProductPrice[];\r\n\r\n constructor(props: ICProductCollectionProps) {\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 if (this.props.config.enableAffiliationBasedPricing && this.props.context.actionContext.requestContext.user.isAuthenticated) {\r\n await this._getActivePrice();\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 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 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 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 * as React from 'react';\r\n\r\nimport { IProductCollectionViewProps } from './c-product-collection';\r\nimport { getProductPageUrlSync } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { getByIdsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { Heading } from '@msdyn365-commerce-modules/utilities';\r\n\r\nconst ProductCollectionView: React.FC = props => {\r\n const { config } = props;\r\n const intlFormatter = props.context.cultureFormatter;\r\n\r\n const getPrice = (price: number | undefined) => {\r\n if (typeof price !== 'undefined') {\r\n return intlFormatter.formatCurrency(price);\r\n } else {\r\n return '';\r\n }\r\n };\r\n\r\n // const getImageUrl = (imageUrl: string | undefined) => {\r\n // return generateImageUrl(imageUrl, props.context.request.apiSettings) as string;\r\n // };\r\n\r\n const getProductPageUrl = (name: string | undefined, recordId: string | number | undefined) => {\r\n return getProductPageUrlSync(name as string, recordId as number, props.context.actionContext);\r\n };\r\n\r\n const [productss, setProducts] = React.useState([]);\r\n const [productIds, setProductIds] = React.useState([]);\r\n\r\n const iContext = {\r\n callerContext: props.context.actionContext\r\n };\r\n\r\n const apiSettings = props.context.request.apiSettings;\r\n\r\n React.useEffect(() => {\r\n if (config.productCollection.products && config.productCollection.products.length > 0) {\r\n const recordIds = config.productCollection.products.map((product: any) => product.RecordId);\r\n setProductIds(recordIds);\r\n }\r\n }, []);\r\n React.useEffect(() => {\r\n if (productIds.length > 0) {\r\n void getByIdsAsync(iContext, apiSettings.channelId, productIds).then(res => {\r\n setProducts(res);\r\n });\r\n }\r\n }, [productIds, config.productCollection.products]);\r\n\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
    \r\n {config &&\r\n config.productCollection &&\r\n config.productCollection.products &&\r\n config.productCollection.products.length > 0 &&\r\n config.productCollection.products.map(product => {\r\n return (\r\n
  • \r\n \r\n
    \r\n \r\n \r\n \r\n
    \r\n

    {product.Name}

    \r\n \r\n
    \r\n
    \r\n \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n

    \r\n {getPrice(product.Price)}\r\n

    \r\n

    \r\n {config.excludeVatLabel\r\n ? config.excludeVatLabel.length > 0\r\n ? `(${config.excludeVatLabel})`\r\n : ''\r\n : ''}\r\n

    \r\n
    \r\n
    \r\n
    \r\n
    \r\n {productss.find(val => val.RecordId === product.RecordId)?.ExtensionProperties &&\r\n productss\r\n .find(val => val.RecordId === product.RecordId)\r\n ?.ExtensionProperties?.find(prop => prop.Key === 'INSSAMPLEITEMID')?.Value?.StringValue ? (\r\n val.RecordId === product.RecordId)\r\n ?.ExtensionProperties?.find(prop => prop.Key === 'INSSAMPLEITEMID')?.Value\r\n ?.StringValue\r\n }\r\n className='ml-product__sample-button'\r\n >\r\n Order Sample\r\n \r\n ) : (\r\n <>\r\n )}\r\n
    \r\n
  • \r\n );\r\n })}\r\n
\r\n
\r\n
\r\n
\r\n );\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['c-product-collection'] = {\n c: () => require('partner/modules/c-product-collection/c-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: 'c-product-collection',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/c-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|c-product-collection|c-product-collection'] = {\n c: () => require('partner/modules/c-product-collection/c-product-collection.view.tsx'),\n cn: '__local__-__local__-c-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","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$productsD","Name","telemetry","trace","telemetryContent","getTelemetryObject","request","telemetryPageName","friendlyName","imageSettings","allowBackNavigation","resources","breaCrumbType","breadcrumbType","allowBack","quickviewSlot","slots","quickview","length","productComparisonButtonSlot","productComparisonButton","reviewCountAriaLabelValue","Number","TotalRatings","ratingCountAriaLabel","ratingCountAriaLabelSingleUser","isPriceMinMaxEnabled","data","featureState","result","find","priceResources","priceRangeSeparator","ProductContainer","tag","className","role","key","productComponent","ProductComponent","freePriceText","priceFree","originalPriceText","currentPriceText","ratingAriaLabel","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","render","shouldDisplaySeeAllButton","recommendationListId","isCarousel","carousel","headingComponent","editProps","onEdit","updatedProducts","map","item","getProductData","ObjectExtensions","isNullOrUndefined","productCollectionViewProps","_objectSpread","SingleSlideCarouselComponentProps","SingleSlideCarousel","flipperPrevLabel","flipperPrevious","flipperNextLabel","flipperNext","parentId","ProductCollectionContainer","moduleProps","classnames","GridComponentProps","filter","seeAllButton","renderView","intlFormatter","cultureFormatter","productss","setProducts","productIds","setProductIds","iContext","callerContext","apiSettings","recordIds","getByIdsAsync","channelId","then","res","Heading","Object","assign","_productss$find","_productss$find2","_productss$find3","price","name","recordId","ItemId","getProductPageUrlSync","alt","src","PrimaryImageUrl","AverageRating","itemProp","Price","formatCurrency","style","fontSize","textAlign","excludeVatLabel","val","ExtensionProperties","prop","Key","Value","StringValue","binding","modules","dataActions","c","require","$type","da","path","runOn","iNM","ns","n","p","pdp","md","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}