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QC,QAAQ,4BAA8B,CAC3CE,EAAGA,IAAMC,EAAQ,MACjBC,MAAO,kBACPC,GAAI,CAAC,CAACvE,KAAK,eAAiBwE,KAAK,uEAAwEC,MAAO,IAEhHC,KAAK,EACLC,GAAI,YACJC,EAAG,2BACH1U,EAAG,YAEH2U,IAAK,GAGLC,GAAI,wCAlC4BC,EAACC,EAAqBC,KAUlD,GADAhB,EAAQE,YAAYa,GAAuBC,GACtChB,EAAQE,YAAYa,GAAqBE,QAC1C,MAAM,IAAIC,MAAM,oBAAsBH,EAAsB,mCAEhEf,EAAQE,YAAYa,GAAqBE,QAAQE,UAAUC,eAAiBL,EACxEf,EAAQE,YAAYa,GAAqBE,QAAQE,UAAUxU,KAC3DqT,EAAQE,YAAYF,EAAQE,YAAYa,GAAqBE,QAAQE,UAAUxU,IAAMoU,EAE7F,EAwBID,CAF4B,uEACXV,EAAQ,KAMjCiB,OAAOC,aAAeD,OAAOC,cAAgB,CAAC,EAC9CD,OAAOC,aAAarB,QAAOhM,EAAAA,EAAA,GACpBoN,OAAOC,aAAarB,SAAW,CAAC,GAChCD,EAAQC,SAGXoB,OAAOC,aAAapB,YAAWjM,EAAAA,EAAA,GAC5BoN,OAAOC,aAAapB,aAAe,CAAC,GACpCF,EAAQE,aAEY,MAAMqB,EAAiB,CAAC,EAC/BA,EAAe,iFAAmF,CAC1GpB,EAAGA,IAAMC,EAAQ,MACjBoB,GAAI,gDAEpBH,OAAOC,aAAeD,OAAOC,cAAgB,CAAC,EAC9CD,OAAOC,aAAaC,eAActN,EAAAA,EAAA,GACPoN,OAAOC,aAAaC,gBAAkB,CAAC,GACvCA,UCnF3BE,EAAOC,QAAU7X,cCAjB4X,EAAOC,QAAUC","sources":["webpack://Msdyn365.Commerce.Online/./src/modules/eshop-product-collection/eshop-product-collection.props.autogenerated.ts?5002","webpack://Msdyn365.Commerce.Online/./src/modules/eshop-product-collection/eshop-product-collection.tsx?2bd5","webpack://Msdyn365.Commerce.Online/./src/modules/eshop-product-collection/eshop-product-collection.view.tsx?430a","webpack://Msdyn365.Commerce.Online/./src/modules/eshop-search-result-container/components/eshop-product-component.tsx?07f0","webpack://Msdyn365.Commerce.Online/./lib/eshop-product-collection/module-registration.js?55dd","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 * IEshopProductCollection 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 IEshopProductCollectionConfig 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 IEshopProductCollectionResources {\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 IEshopProductCollectionProps extends Msdyn365.IModule {\r\n resources: IEshopProductCollectionResources;\r\n config: IEshopProductCollectionConfig;\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 { ProductComponent } from '../eshop-search-result-container/components/eshop-product-component';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { getCatalogId, ICoreContext } from '@msdyn365-commerce/core';\r\nimport { ProductPrice, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport { getByIdsAsync, getEstimatedAvailabilityAsync, getDimensionValuesWithEstimatedAvailabilitiesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\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 DeliveryMode,\r\n createInventoryAvailabilitySearchCriteria,\r\n mapAggregatedProductInventoryInformation\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 { IEshopProductCollectionData } from './eshop-product-collection.data';\r\nimport { IEshopProductCollectionProps, layout } from './eshop-product-collection.props.autogenerated';\r\n\r\nexport interface IProductCollectionViewProps extends IEshopProductCollectionProps {\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\n\r\nexport interface IProductAvailabilityLabel {\r\n id: number;\r\n label: string;\r\n}\r\n\r\nexport interface IProductComponentState {\r\n products: ProductSearchResult[];\r\n productsDimensionAvailabilities?: IProductsDimensionsAvailabilities[][];\r\n productsLabel?: IProductAvailabilityLabel[];\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: IEshopProductCollectionProps) {\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 private readonly _getProductsInventory = async (products: ProductSearchResult[]): Promise => {\r\n let productsLabel: IProductAvailabilityLabel[] = [];\r\n const context = this.props.context.actionContext;\r\n const shippingSearchCriteria = createInventoryAvailabilitySearchCriteria(context, products.map(p => p.RecordId), true, undefined, undefined, DeliveryMode.shipping);\r\n\r\n const shippingAvailability = await getEstimatedAvailabilityAsync({ callerContext: context }, shippingSearchCriteria);\r\n if (shippingAvailability.ProductWarehouseInventoryAvailabilities) {\r\n const productsInventory = mapAggregatedProductInventoryInformation(context, shippingAvailability);\r\n productsLabel = productsInventory.map(i => ({id: i.ProductAvailableQuantity.ProductId, label: i.StockLevelLabel === 'Available' ? '' : 'Out of stock'} as IProductAvailabilityLabel));\r\n }\r\n\r\n const simpleProducts = await getByIdsAsync({ callerContext: context }, context.requestContext.apiSettings.channelId, products.map(p => p.RecordId));\r\n for (const simpleProduct of simpleProducts) {\r\n const dimensionCount = simpleProduct.Dimensions?.length ?? 0;\r\n if (dimensionCount > 0) {\r\n const dimensionInventory = await getDimensionValuesWithEstimatedAvailabilitiesAsync({ callerContext: context }, simpleProduct.RecordId, {\r\n RequestedDimensionTypeValues: simpleProduct.Dimensions?.map(d => d.DimensionTypeValue), \r\n DefaultWarehouseOnly: shippingSearchCriteria.DefaultWarehouseOnly,\r\n FilterByChannelFulfillmentGroup: shippingSearchCriteria.FilterByChannelFulfillmentGroup,\r\n DeliveryModeTypeFilterValue: shippingSearchCriteria.DeliveryModeTypeFilterValue,\r\n });\r\n const isAvailable = dimensionInventory.filter(i => i.PhysicalAvailableInventoryLevelLabel === 'Available').length > 0;\r\n const product = productsLabel.find(p => p.id === simpleProduct.RecordId);\r\n if (product) {\r\n product.label = isAvailable ? '' : 'Out of stock';\r\n }\r\n }\r\n }\r\n this.setState({ productsLabel });\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 await this._getProductsInventory(products);\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\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\r\n let inventoryLabel = '';\r\n if (this.state.productsLabel) {\r\n inventoryLabel = this.state.productsLabel.find(p => p.id === product.RecordId)?.label ?? '';\r\n }\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 const catalogId = getCatalogId(this.props.context.request);\r\n const seeAllLink = `/search?recommendation=${recommendation}&title=${headingLabel}&catalogid=${catalogId}`;\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 './eshop-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","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { IProductsDimensionsAvailabilities } from '@msdyn365-commerce/commerce-entities';\r\nimport {\r\n IComponent, IComponentProps, ICoreContext, IGridSettings,\r\n IImageData, IImageProps, IImageSettings, Image, IRequestContext, msdyn365Commerce\r\n} from '@msdyn365-commerce/core';\r\nimport { AttributeSwatch, ProductDimension, ProductPrice, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ArrayExtensions, checkIfShouldDisplayAsSwatch, convertDimensionTypeToProductDimensionType,\r\n Dictionary,\r\n DimensionSwatchDisplayTypes, DimensionTypes, generateImageUrl,\r\n getProductPageUrlSync,IDimensionsApp, StringExtensions\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { format, getPayloadObject, getTelemetryAttributes, ITelemetryContent, onTelemetryClick } from '@msdyn365-commerce-modules/utilities';\r\nimport React, { useState } from 'react';\r\n\r\nimport { IPriceComponentResources, PriceComponent, ISwatchItem, RatingComponent, ProductComponentSwatchComponent } from '@msdyn365-commerce/components';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n\r\n\r\nexport interface IProductComponentProps extends IComponentProps<{ product?: ProductSearchResult }> {\r\n className?: string;\r\n imageSettings?: IImageSettings;\r\n savingsText?: string;\r\n freePriceText?: string;\r\n originalPriceText?: string;\r\n currentPriceText?: string;\r\n ratingAriaLabel?: string;\r\n ratingCountAriaLabel?: string;\r\n allowBack?: boolean;\r\n telemetryContent?: ITelemetryContent;\r\n quickViewButton?: React.ReactNode;\r\n inventoryLabel?: string;\r\n isPriceMinMaxEnabled?: boolean;\r\n priceResources?: IPriceComponentResources;\r\n dimensionAvailabilities?: IProductsDimensionsAvailabilities[];\r\n swatchItemAriaLabel?: string;\r\n eShopPdpUrl?:Msdyn365.ILinkData;\r\n}\r\n\r\nexport interface IProductComponent extends IComponent { }\r\n\r\nconst PriceComponentActions = {};\r\n\r\nconst ProductCard: React.FC = ({\r\n data,\r\n context,\r\n imageSettings,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText,\r\n ratingAriaLabel,\r\n ratingCountAriaLabel,\r\n allowBack,\r\n typeName,\r\n id,\r\n telemetryContent,\r\n quickViewButton,\r\n inventoryLabel,\r\n isPriceMinMaxEnabled,\r\n priceResources,\r\n dimensionAvailabilities,\r\n swatchItemAriaLabel,\r\n eShopPdpUrl\r\n}) => {\r\n const product = data.product;\r\n\r\n /**\r\n * Updates the product url link to product details page.\r\n * @param productDetailsPageUrl - Product page url.\r\n * @param coreContext - Context of the module using the component.\r\n * @param queryString - Querystring to be added to the URL.\r\n * @returns The update product page url.\r\n */\r\n function updateProductUrl(productDetailsPageUrl: string, coreContext: ICoreContext, queryString: string): string {\r\n const sourceUrl = new URL(productDetailsPageUrl, coreContext.request.apiSettings.baseUrl);\r\n if (sourceUrl.search) {\r\n sourceUrl.search += `&${queryString}`;\r\n } else {\r\n sourceUrl.search += queryString;\r\n }\r\n\r\n const updatedUrl = new URL(sourceUrl.href);\r\n return updatedUrl.pathname + sourceUrl.search;\r\n }\r\n\r\n /**\r\n * Gets the product page url from the default swatch selected.\r\n * @param productData - Product card to be rendered.\r\n * @returns The default color swatch selected if any.\r\n */\r\n function getDefaultColorSwatchSelected(productData?: ProductSearchResult): AttributeSwatch | null {\r\n if (!productData || !productData.AttributeValues) {\r\n return null;\r\n }\r\n\r\n const colorAttribute = productData.AttributeValues.find(attributeValue => attributeValue.KeyName?.toLocaleLowerCase() === DimensionTypes.color);\r\n if (!ArrayExtensions.hasElements(colorAttribute?.Swatches)) {\r\n return null;\r\n }\r\n\r\n const defaultSwatch = colorAttribute!.Swatches.find(item => item.IsDefault === true) ?? colorAttribute!.Swatches[0];\r\n return defaultSwatch;\r\n }\r\n\r\n /**\r\n * Gets the product image from the default swatch selected.\r\n * @param coreContext - Context of the module using the component.\r\n * @param productData - Product card to be rendered.\r\n * @returns The product card image url.\r\n */\r\n function getProductImageUrlFromDefaultColorSwatch(coreContext: ICoreContext, productData?: ProductSearchResult): string | undefined {\r\n const siteContext = coreContext as ICoreContext;\r\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\r\n if (dimensionToPreSelectInProductCard === DimensionTypes.none) {\r\n return productData?.PrimaryImageUrl;\r\n }\r\n const defaultSwatch = getDefaultColorSwatchSelected(productData);\r\n return defaultSwatch && ArrayExtensions.hasElements(defaultSwatch.ProductImageUrls) ? generateImageUrl(\r\n defaultSwatch.ProductImageUrls[0], coreContext.request.apiSettings) : productData?.PrimaryImageUrl;\r\n }\r\n\r\n /**\r\n * Gets the product page url from the default swatch selected.\r\n * @param coreContext - Context of the module using the component.\r\n * @param productUrl - Product page url for the product card.\r\n * @param productData - Product card to be rendered.\r\n * @returns The product card image url.\r\n */\r\n function getProductPageUrlFromDefaultSwatch(coreContext: ICoreContext, productUrl: string, productData?: ProductSearchResult): string | undefined {\r\n const siteContext = coreContext as ICoreContext;\r\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\r\n if (dimensionToPreSelectInProductCard === DimensionTypes.none) {\r\n return productUrl;\r\n }\r\n const defaultSwatch = getDefaultColorSwatchSelected(productData);\r\n if (!defaultSwatch || !defaultSwatch.SwatchValue) {\r\n return productUrl;\r\n }\r\n\r\n const queryString = `color=${defaultSwatch.SwatchValue}`;\r\n return updateProductUrl(productUrl, coreContext, queryString);\r\n }\r\n\r\n let productUrl = product ? getProductPageUrlSync(product.Name ?? '', product.RecordId, context.actionContext, undefined) : '';\r\n // let productUrl = product ? eShopPdpUrl? eShopPdpUrl.destinationUrl+`${'?productId=' + product.RecordId }`:\"/ecomm/eshop?productId=\"+ product.RecordId : '';\r\n if (allowBack && productUrl) {\r\n productUrl = updateProductUrl(productUrl, context, 'back=true');\r\n }\r\n const productImageUrlFromSwatch = getProductImageUrlFromDefaultColorSwatch(context, product) ?? product?.PrimaryImageUrl;\r\n const productPageUrlFromSwatch = getProductPageUrlFromDefaultSwatch(context, productUrl, product) ?? productUrl;\r\n const [productPageUrl, setProductPageUrl] = useState(productPageUrlFromSwatch);\r\n const [productImageUrl, setProductImageUrl] = useState(productImageUrlFromSwatch);\r\n const [selectedSwatchItems] = useState(new Dictionary());\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access -- app context is generic\r\n const enableStockCheck = context.app.config.enableStockCheck;\r\n\r\n /**\r\n * Updates the product page and Image url based on swatch selected.\r\n * @param coreContext - Context of the caller.\r\n * @param swatchItem - Dimension swatch selected.\r\n */\r\n const updatePageAndImageUrl = React.useCallback((coreContext: ICoreContext, swatchItem: ISwatchItem) => {\r\n const dimensionType = swatchItem.dimensionType;\r\n selectedSwatchItems.setValue(dimensionType, swatchItem);\r\n if (StringExtensions.isNullOrWhitespace(swatchItem.value)) {\r\n return;\r\n }\r\n const queryString = `${dimensionType}=${swatchItem.value}`;\r\n let productPageUrlWithSwatch = '';\r\n if (productPageUrl.includes(dimensionType)) {\r\n const newUrl = new URL(productPageUrl, coreContext.request.apiSettings.baseUrl);\r\n newUrl.searchParams.delete(dimensionType);\r\n productPageUrlWithSwatch = updateProductUrl(newUrl.toString(), context, queryString);\r\n } else {\r\n productPageUrlWithSwatch = updateProductUrl(productPageUrl, context, queryString);\r\n }\r\n setProductPageUrl(productPageUrlWithSwatch);\r\n if (dimensionType === DimensionTypes.color) {\r\n const swatchProductImageUrl = ArrayExtensions.hasElements(swatchItem.productImageUrls) ? swatchItem.productImageUrls[0] : undefined;\r\n const newImageUrl = generateImageUrl(swatchProductImageUrl, coreContext.request.apiSettings);\r\n setProductImageUrl(newImageUrl);\r\n }\r\n }, [selectedSwatchItems, context, productPageUrl]);\r\n\r\n if (!product) {\r\n return null;\r\n }\r\n \r\n const swatchItems = ArrayExtensions.validValues(product.AttributeValues?.map(item => {\r\n const dimensionTypeValue = \"size\";//item.KeyName?.toLocaleLowerCase() ?? '';\r\n const shouldDisplayAsSwatch = checkIfShouldDisplayAsSwatch(\r\n dimensionTypeValue as DimensionTypes,\r\n context as ICoreContext,\r\n DimensionSwatchDisplayTypes.productCard);\r\n \r\n if (!shouldDisplayAsSwatch) {\r\n return null;\r\n }\r\n\r\n const siteContext = context as ICoreContext;\r\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\r\n const dimensionType = dimensionTypeValue as DimensionTypes;\r\n const swatches = item.Swatches?.map(swatchItem => {\r\n return {\r\n itemId: `${item.RecordId ?? ''}-${dimensionTypeValue}-${swatchItem.SwatchValue ?? ''}`,\r\n value: swatchItem.SwatchValue ?? '',\r\n dimensionType,\r\n colorHexCode: swatchItem.SwatchColorHexCode,\r\n imageUrl: swatchItem.SwatchImageUrl,\r\n productImageUrls: swatchItem.ProductImageUrls,\r\n isDefault: swatchItem.IsDefault,\r\n swatchItemAriaLabel: swatchItemAriaLabel ? format(swatchItemAriaLabel, dimensionType) : '',\r\n isDisabled: enableStockCheck && dimensionAvailabilities?.find(\r\n dimensionAvailability => dimensionAvailability.value === (swatchItem.SwatchValue ?? ''))?.isDisabled\r\n };\r\n }) ?? [];\r\n if (dimensionToPreSelectInProductCard !== DimensionTypes.none && ArrayExtensions.hasElements(swatches) &&\r\n !swatches.some(swatch => swatch.isDefault) && dimensionType === DimensionTypes.color) {\r\n swatches[0].isDefault = true;\r\n }\r\n return { recordId: item.RecordId, swatches };\r\n }));\r\n\r\n // Construct telemetry attribute to render\r\n const payLoad = getPayloadObject('click', telemetryContent!, '', product.RecordId.toString());\r\n\r\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- -- Do not need type check for appsettings\r\n const isUnitOfMeasureEnabled = context.app.config && context.app.config.unitOfMeasureDisplayType === 'buyboxAndBrowse';\r\n\r\n /**\r\n * Gets the react node for product unit of measure display.\r\n * @param unitOfMeasure - DefaultUnitOfMeasure property from product.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n function renderProductUnitOfMeasure(unitOfMeasure?: string): JSX.Element | null {\r\n\r\n if (!unitOfMeasure) {\r\n return null;\r\n }\r\n return (\r\n
\r\n \r\n {unitOfMeasure}\r\n \r\n
\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react node for product availability.\r\n * @param inventoryAvailabilityLabel - The product information.\r\n * @returns The node representing markup for product availability.\r\n */\r\n function renderProductAvailability(inventoryAvailabilityLabel: string | undefined): JSX.Element | null {\r\n if (!inventoryAvailabilityLabel || inventoryAvailabilityLabel === '') {\r\n return null;\r\n }\r\n\r\n return (\r\n
\r\n \r\n {inventoryAvailabilityLabel}\r\n \r\n
\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react node for product dimension as swatch.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n function renderProductDimensions(): JSX.Element | null {\r\n if (!ArrayExtensions.hasElements(swatchItems)) {\r\n return null;\r\n }\r\n\r\n return (\r\n
\r\n {\r\n swatchItems.map(item => {\r\n return (\r\n \r\n );\r\n })\r\n }\r\n
\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react node for product description.\r\n * @param quickview - Quick view node.\r\n * @param item - Product id to de displayed in quickview.\r\n * @returns The product quickview component.\r\n */\r\n function renderQuickView(quickview: React.ReactNode, item?: number): JSX.Element | undefined {\r\n if (quickview === null) {\r\n return undefined;\r\n }\r\n const selectedDimensions: ProductDimension[] = selectedSwatchItems.getValues().map(swatches => {\r\n return {\r\n DimensionTypeValue: convertDimensionTypeToProductDimensionType(swatches.dimensionType),\r\n DimensionValue: {\r\n RecordId: 0,\r\n Value: swatches.value\r\n }\r\n };\r\n });\r\n return React.cloneElement(quickview as React.ReactElement, { selectedProductId: item, selectedDimensions });\r\n }\r\n\r\n /**\r\n * Gets the aria label for rating.\r\n * @param rating - Product rating.\r\n * @param ratingAriaLabelText - Aria label format for rating.\r\n * @returns The product rating aria label string.\r\n */\r\n function getRatingAriaLabel(rating?: number, ratingAriaLabelText?: string): string {\r\n if (rating && ratingAriaLabelText) {\r\n const roundedRating = rating.toFixed(2);\r\n return format(ratingAriaLabelText || '', roundedRating, '5');\r\n }\r\n return '';\r\n }\r\n\r\n /**\r\n * Gets the aria label for review count.\r\n * @param reviewCount - Product review count.\r\n * @param ratingCountAriaLabelText - Aria label format for review.\r\n * @returns The product review count aria label string.\r\n */\r\n function getReviewAriaLabel(reviewCount?: number, ratingCountAriaLabelText?: string): string {\r\n if (reviewCount && ratingCountAriaLabelText) {\r\n return format(ratingCountAriaLabelText || '', reviewCount);\r\n }\r\n return '';\r\n }\r\n\r\n /**\r\n * Gets the aria label string for product that includes product name with its price and rating.\r\n * @param name - Product name.\r\n * @param price - Product price.\r\n * @param rating - Product rating.\r\n * @param ratingAriaLabelText - Rating aria label text.\r\n * @param reviewCount - Product review count.\r\n * @param ratingCountAriaLabelText - Number of ratings.\r\n * @returns The aria label string for the product card.\r\n */\r\n function renderLabel(\r\n name?: string,\r\n price?: string,\r\n rating?: number,\r\n ratingAriaLabelText?: string,\r\n reviewCount?: number,\r\n ratingCountAriaLabelText?: string): string {\r\n const reviewCountArialableText = getReviewAriaLabel(reviewCount, ratingCountAriaLabelText ?? '');\r\n return (\r\n `${name ?? ''} ${price ?? ''} ${getRatingAriaLabel(rating, ratingAriaLabelText)}${reviewCountArialableText ? ` ${reviewCountArialableText}` : ''}`\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react component for product rating.\r\n * @param productCardimageSettings - Module image settings for product card.\r\n * @param gridSettings - Grid settings defined in theme.\r\n * @param imageUrl - Image url.\r\n * @param fallbackImageUrl - Fallback url for imge.\r\n * @param altText - Image Alt text.\r\n * @param requestContext - Request context using the component.\r\n * @returns React component for product image.\r\n */\r\n function renderProductPlacementImage(\r\n productCardimageSettings?: IImageSettings, gridSettings?: IGridSettings,\r\n imageUrl?: string, fallbackImageUrl?: string, altText?: string, requestContext?: IRequestContext): JSX.Element | null {\r\n\r\n if (!imageUrl || !gridSettings || !productCardimageSettings) {\r\n return null;\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Site level config can be of any type.\r\n const emptyPlaceHolderImage = context.app.config.placeholderImageName as string;\r\n let fallbackImageSource = fallbackImageUrl;\r\n if (emptyPlaceHolderImage && fallbackImageUrl) {\r\n fallbackImageSource = `${fallbackImageUrl},${emptyPlaceHolderImage}`;\r\n }\r\n const image: IImageData = {\r\n src: imageUrl,\r\n altText: altText ? altText : '',\r\n fallBackSrc: fallbackImageSource\r\n };\r\n const imageProps: IImageProps = { gridSettings };\r\n\r\n imageProps.gridSettings = gridSettings;\r\n imageProps.imageSettings = productCardimageSettings;\r\n imageProps.imageSettings.cropFocalRegion = true;\r\n return (\r\n \r\n );\r\n }\r\n\r\n /**\r\n * Gets the react component for product rating.\r\n * @param coreContext - Context of the module using the component.\r\n * @param moduleTypeName - Module type name.\r\n * @param moduleId - Module id using the component.\r\n * @param basePrice - Product base price.\r\n * @param adjustedPrice - Product adjusted price.\r\n * @param maxVariantPrice - Product variant max price.\r\n * @param minVariantPrice - Product variant min price.\r\n * @param savingsPriceResourceText - Product price saving text.\r\n * @param freePriceResourceText - Product price free text.\r\n * @param originalPriceResourceText - Product price original text.\r\n * @param currentPriceResourceText - Product price current text.\r\n * @returns React component for Product price.\r\n */\r\n function renderPrice(coreContext: ICoreContext, moduleTypeName: string, moduleId: string, basePrice?: number, adjustedPrice?: number,\r\n maxVariantPrice?: number, minVariantPrice?: number, savingsPriceResourceText?: string, freePriceResourceText?: string,\r\n originalPriceResourceText?: string, currentPriceResourceText?: string): JSX.Element | null {\r\n const price: ProductPrice = {\r\n BasePrice: basePrice,\r\n AdjustedPrice: adjustedPrice,\r\n CustomerContextualPrice: adjustedPrice,\r\n MaxVariantPrice: maxVariantPrice ? maxVariantPrice : adjustedPrice,\r\n MinVariantPrice: minVariantPrice ? minVariantPrice : adjustedPrice\r\n };\r\n\r\n return (\r\n \r\n );\r\n }\r\n\r\n /**\r\n * Gets the react node for product description.\r\n * @param description - Product description.\r\n * @returns The product description component.\r\n */\r\n function renderDescription(description?: string): JSX.Element | null {\r\n return (

\r\n {description}\r\n

);\r\n }\r\n\r\n /**\r\n * Gets the react component for product rating.\r\n * @param coreContext - Context of the module using the component.\r\n * @param moduleTypeName - Module type name.\r\n * @param moduleId - Module id using the component.\r\n * @param avgRating - Average rating.\r\n * @param totalRatings - Total rating.\r\n * @param ariaLabel - Aria label for rating.\r\n * @returns React component for Product rating.\r\n */\r\n function renderRating(coreContext: ICoreContext, moduleTypeName: string, moduleId: string, avgRating?: number,\r\n totalRatings?: number, ariaLabel?: string): JSX.Element | null {\r\n if (!avgRating) {\r\n return null;\r\n }\r\n\r\n const numberRatings = totalRatings?.toString() || undefined;\r\n const ratingAriaLabelText = getRatingAriaLabel(avgRating, ariaLabel);\r\n const ratingCountAriaLabelText = getReviewAriaLabel(Number(numberRatings), ratingCountAriaLabel);\r\n\r\n return (\r\n \r\n );\r\n }\r\n\r\n return (\r\n <>\r\n \r\n
\r\n
\r\n {renderProductPlacementImage(\r\n imageSettings, context.request.gridSettings, productImageUrl,\r\n product.PrimaryImageUrl, product.Name, context.actionContext.requestContext)}\r\n
\r\n {renderProductAvailability(inventoryLabel)}\r\n
\r\n

\r\n {product.Name}\r\n

\r\n \r\n {renderProductDimensions()}\r\n
\r\n {renderPrice(context, typeName, id, product.BasePrice, product.Price,\r\n product.MaxVariantPrice, product.MinVariantPrice, savingsText, freePriceText, originalPriceText, currentPriceText)}\r\n {isUnitOfMeasureEnabled && renderProductUnitOfMeasure(product.DefaultUnitOfMeasure)}\r\n {renderDescription(product.Description)}\r\n {!context.app.config.hideRating && renderRating(context, typeName, id, product.AverageRating, product.TotalRatings, ratingAriaLabel)}\r\n
\r\n {quickViewButton && renderQuickView(quickViewButton, product.RecordId)}\r\n \r\n );\r\n};\r\n\r\nexport const ProductComponent: React.FunctionComponent = msdyn365Commerce.createComponent(\r\n 'Product',\r\n { component: ProductCard, ...PriceComponentActions }\r\n);\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['eshop-product-collection'] = {\n c: () => require('partner/modules/eshop-product-collection/eshop-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: 'eshop-product-collection',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/eshop-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|eshop-product-collection|eshop-product-collection'] = {\n c: () => require('partner/modules/eshop-product-collection/eshop-product-collection.view.tsx'),\n cn: '__local__-__local__-eshop-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","products","includes","DimensionTypes","productsDimensionAvailabilities","getDimensionAvailabilitiesForProductSearchResultAction","DimensionAvailabilitiesForProductSearchResultInput","DimensionSwatchDisplayTypes","actionContext","setState","_getProductsInventory","productsLabel","shippingSearchCriteria","createInventoryAvailabilitySearchCriteria","map","p","RecordId","undefined","DeliveryMode","shippingAvailability","getEstimatedAvailabilityAsync","callerContext","ProductWarehouseInventoryAvailabilities","mapAggregatedProductInventoryInformation","i","id","ProductAvailableQuantity","ProductId","label","StockLevelLabel","simpleProducts","getByIdsAsync","requestContext","apiSettings","channelId","simpleProduct","_simpleProduct$Dimens","_simpleProduct$Dimens2","Dimensions","length","_simpleProduct$Dimens3","isAvailable","getDimensionValuesWithEstimatedAvailabilitiesAsync","RequestedDimensionTypeValues","d","DimensionTypeValue","DefaultWarehouseOnly","FilterByChannelFulfillmentGroup","DeliveryModeTypeFilterValue","filter","PhysicalAvailableInventoryLevelLabel","product","find","initProductState","state","productCollectionProducts","productCollection","Msdyn365","_getProduct","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","reviewCountAriaLabelValue","Number","TotalRatings","ratingCountAriaLabel","ratingCountAriaLabelSingleUser","isPriceMinMaxEnabled","data","featureState","result","priceResources","priceRangeSeparator","inventoryLabel","_this$state$productsL","_this$state$productsL2","ProductContainer","tag","className","role","key","productComponent","ProductComponent","freePriceText","priceFree","originalPriceText","currentPriceText","ratingAriaLabel","typeName","quickViewButton","IsEnabled","dimensionAvailabilities","dimensionAvailability","_product$MasterProduc","masterProductId","MasterProductId","_getActivePrice","productsList","getPriceForProductSearchResult","PriceForProductSearchResultInput","_getSeeAllButton","recommendation","headingLabel","seeAllLink","getCatalogId","Button","title","seeAllButtonText","href","productPrices","enableAffiliationBasedPricing","user","isAuthenticated","render","shouldDisplaySeeAllButton","recommendationListId","isCarousel","carousel","headingComponent","editProps","onEdit","updatedProducts","item","getProductData","ObjectExtensions","productCollectionViewProps","_objectSpread","SingleSlideCarouselComponentProps","SingleSlideCarousel","flipperPrevLabel","flipperPrevious","flipperNextLabel","flipperNext","parentId","ProductCollectionContainer","moduleProps","classnames","GridComponentProps","seeAllButton","renderView","_renderCarousel","carouselContainer","items","Node","Object","assign","_renderProduct","_renderGrid","gridContainer","Module","error","msdyn365Commerce","component","_ref","_product$Name","_getProductImageUrlFr","_getProductPageUrlFro","_product$AttributeVal","savingsText","swatchItemAriaLabel","eShopPdpUrl","updateProductUrl","productDetailsPageUrl","coreContext","queryString","sourceUrl","URL","baseUrl","search","pathname","getDefaultColorSwatchSelected","productData","_colorAttribute$Swatc","AttributeValues","colorAttribute","attributeValue","_attributeValue$KeyNa","KeyName","toLocaleLowerCase","Swatches","IsDefault","productUrl","getProductPageUrlSync","productImageUrlFromSwatch","dimensionToPreSelectInProductCard","PrimaryImageUrl","defaultSwatch","ProductImageUrls","generateImageUrl","getProductImageUrlFromDefaultColorSwatch","productPageUrlFromSwatch","SwatchValue","getProductPageUrlFromDefaultSwatch","productPageUrl","setProductPageUrl","useState","productImageUrl","setProductImageUrl","selectedSwatchItems","Dictionary","enableStockCheck","updatePageAndImageUrl","swatchItem","dimensionType","setValue","StringExtensions","productPageUrlWithSwatch","newUrl","searchParams","delete","toString","swatchProductImageUrl","productImageUrls","newImageUrl","swatchItems","_item$Swatches$map","_item$Swatches","dimensionTypeValue","checkIfShouldDisplayAsSwatch","swatches","_item$RecordId","_swatchItem$SwatchVal","_swatchItem$SwatchVal2","_dimensionAvailabilit","itemId","colorHexCode","SwatchColorHexCode","imageUrl","SwatchImageUrl","isDefault","format","isDisabled","_swatchItem$SwatchVal3","some","swatch","recordId","payLoad","getPayloadObject","attribute","getTelemetryAttributes","isUnitOfMeasureEnabled","unitOfMeasureDisplayType","getRatingAriaLabel","rating","ratingAriaLabelText","roundedRating","toFixed","getReviewAriaLabel","reviewCount","ratingCountAriaLabelText","onClick","onTelemetryClick","name","price","reviewCountArialableText","renderLabel","cultureFormatter","formatCurrency","Price","AverageRating","style","productCardimageSettings","gridSettings","fallbackImageUrl","altText","emptyPlaceHolderImage","placeholderImageName","fallbackImageSource","image","src","fallBackSrc","imageProps","cropFocalRegion","Image","loadFailureBehavior","bypassHideOnFailure","renderProductPlacementImage","inventoryAvailabilityLabel","ProductComponentSwatchComponent","onSelectDimension","moduleTypeName","moduleId","basePrice","adjustedPrice","maxVariantPrice","minVariantPrice","savingsPriceResourceText","freePriceResourceText","originalPriceResourceText","currentPriceResourceText","BasePrice","AdjustedPrice","CustomerContextualPrice","MaxVariantPrice","MinVariantPrice","PriceComponent","renderPrice","unitOfMeasure","DefaultUnitOfMeasure","description","Description","hideRating","avgRating","totalRatings","ariaLabel","numberRatings","RatingComponent","ratingCount","readOnly","renderRating","selectedDimensions","getValues","convertDimensionTypeToProductDimensionType","DimensionValue","Value","selectedProductId","renderQuickView","binding","modules","dataActions","c","require","$type","da","path","runOn","iNM","ns","n","pdp","md","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","window","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}