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AAMV,EAAOS,GAAcA,EAAaV,GAAYC,EAAOS,GAEzEN,EAAQ,GAAKT,EAAQY,IACvBC,EAAaZ,EAAkBW,GAC/BE,EAAcV,EAAiBlK,EAAQmK,EAAUO,EAASC,EAAYC,EAAaL,EAAQ,GAAK,IAEhGP,EAAyBY,EAAc,GACvC5K,EAAO4K,GAAeF,GAGxBE,KAEFC,IAEF,OAAOD,GAGTpB,EAAOC,QAAUS,iBChCjB,IAAIa,EAAI,EAAQ,IACZb,EAAmB,EAAQ,KAC3Bc,EAAW,EAAQ,IACnBjB,EAAoB,EAAQ,IAC5BkB,EAAsB,EAAQ,IAC9BC,EAAqB,EAAQ,KAIjCH,EAAE,CAAE/K,OAAQ,QAASmL,OAAO,GAAQ,CAClCxF,KAAM,WACJ,IAAIyF,EAAWC,UAAU1Q,OAAS0Q,UAAU,QAAK9K,EAC7C+K,EAAIN,EAAStO,MACb2N,EAAYN,EAAkBuB,GAC9BC,EAAIL,EAAmBI,EAAG,GAE9B,OADAC,EAAE5Q,OAASuP,EAAiBqB,EAAGD,EAAGA,EAAGjB,EAAW,OAAgB9J,IAAb6K,EAAyB,EAAIH,EAAoBG,IAC7FG,oBCdY,EAAQ,IAG/BC,CAAiB","sources":["webpack://henrys-ecommerce/./src/common/utilities/productListExtensionHelpers.ts?5897","webpack://henrys-ecommerce/./src/modules/hei-product-specification/dataActions/get-attribute-groups-for-selected-variant.ts?d19d","webpack://henrys-ecommerce/./src/modules/hei-product-specification/components/hei-product-specification-table-stucture.tsx?6ece","webpack://henrys-ecommerce/./src/modules/hei-product-specification/hei-product-specification.props.autogenerated.ts?0270","webpack://henrys-ecommerce/./src/modules/hei-product-specification/hei-product-specification.tsx?2710","webpack://henrys-ecommerce/./src/common/utilities/helpers.ts?68ab","webpack://henrys-ecommerce/./src/modules/hei-product-specification/hei-product-specification.view.tsx?6fd1","webpack://henrys-ecommerce/./lib/hei-product-specification/module-registration.js?f097","webpack://henrys-ecommerce/./src/dataActions/get-attributes-for-selected-variant.ts?e4b6","webpack://henrys-ecommerce/./src/modules/product-specification/components/product-specification-table-stucture.tsx?c1c4","webpack://henrys-ecommerce/./src/modules/product-specification/product-specification.tsx?6583","webpack://henrys-ecommerce/./src/modules/product-specification/product-specification.view.tsx?7490","webpack://henrys-ecommerce/external var \"React\"?0d3b","webpack://henrys-ecommerce/external var \"ReactDOM\"?853b","webpack://henrys-ecommerce/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/internals/does-not-exceed-safe-integer.js?0ce0","webpack://henrys-ecommerce/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/internals/flatten-into-array.js?2945","webpack://henrys-ecommerce/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.array.flat.js?2b89","webpack://henrys-ecommerce/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.array.unscopables.flat.js?840a"],"sourcesContent":["import { AttributeValue, CommerceProperty, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport enum ProductStockStatusEnum {\r\n OUT_OF_STOCK,\r\n IN_STORE,\r\n ONLINE\r\n}\r\n\r\nexport interface IProductBadgeStatus {\r\n url: string;\r\n badgeName: string;\r\n}\r\n\r\n/**\r\n * Retrieves attribute from attribute list given the name of the attribute\r\n * @param attributes attribute list\r\n * @param attributeName name of the attribute to find\r\n */\r\nexport const findAttribute = (attributes: AttributeValue[] | undefined, attributeName: string): AttributeValue | undefined => {\r\n if (!attributes) {\r\n return undefined;\r\n }\r\n return attributes.find(attr => attr.Name?.toLowerCase() === attributeName.toLowerCase());\r\n};\r\n\r\nexport const findAllAttributes = (attributes: AttributeValue[] | undefined, attributeName: string): AttributeValue[] => {\r\n if (!attributes) {\r\n return [];\r\n }\r\n return attributes.filter(attr => attr.Name?.toLowerCase() === attributeName.toLowerCase());\r\n};\r\n\r\n/**\r\n * Gets value of given attribute based on its DataTypeValue enum.\r\n * @param attribute attribute to retrieve value from\r\n */\r\nexport const findAttributeValue = (attribute: AttributeValue): string | Date | number | boolean | undefined => {\r\n switch (attribute.DataTypeValue) {\r\n case 1:\r\n return attribute.CurrencyCode;\r\n case 2:\r\n return attribute.DateTimeOffsetValue;\r\n case 3:\r\n return attribute.FloatValue;\r\n case 4:\r\n return attribute.IntegerValue;\r\n case 5:\r\n return attribute.TextValue;\r\n case 6:\r\n return attribute.BooleanValue;\r\n default:\r\n return undefined;\r\n }\r\n};\r\n\r\n/**\r\n * Builds URL to the product badge\r\n * @param locale current locale\r\n * @param badgeName name of the badge\r\n * @param baseUrl base url for images\r\n */\r\nexport const buildProductBadgeUrl = (locale: string, badgeName: string, baseUrl: string, suffix?: string): string => {\r\n return `${baseUrl}Catalogs/${locale}/${badgeName.toLowerCase().replace(/ /g, '_')}_${locale}${suffix || ''}.png`;\r\n};\r\n\r\n/**\r\n * Gets the correct product badge status from the product\r\n * @param product Product to get the badge for\r\n * @param locale current locale\r\n * @param baseUrl image base url\r\n * @returns product badge url\r\n */\r\nexport const getProductBadgeUrl = (\r\n product: ProductSearchResult,\r\n locale: string,\r\n baseUrl: string,\r\n suffix?: string\r\n): IProductBadgeStatus | null => {\r\n const badgeAttributeArray = findAllAttributes(product.AttributeValues, 'Product Badge Status');\r\n let badgeStatus: IProductBadgeStatus | null = null;\r\n if (badgeAttributeArray) {\r\n badgeAttributeArray.forEach(attr => {\r\n const badgeValue = findAttributeValue(attr);\r\n if (badgeValue && typeof badgeValue === 'string' && badgeValue.toLowerCase() !== 'none') {\r\n badgeStatus = { url: buildProductBadgeUrl(locale, badgeValue, baseUrl, suffix), badgeName: badgeValue.replace(/_/, ' ') };\r\n }\r\n });\r\n }\r\n if (badgeStatus) {\r\n return badgeStatus;\r\n } else if (product.BasePrice && product.Price !== product.BasePrice) {\r\n return { url: buildProductBadgeUrl(locale, 'on_sale', baseUrl, suffix), badgeName: 'On Sale' };\r\n }\r\n return null;\r\n};\r\n\r\n/**\r\n * gets product stock status value from extension properties\r\n * @param extensionProperties extension properties from product\r\n */\r\nexport const getProductStockStatus = (extensionProperties: CommerceProperty[]): ProductStockStatusEnum => {\r\n if (extensionProperties?.length) {\r\n const availableProperty = extensionProperties.find(xt => xt.Key === 'AvailabilityStatus');\r\n if (availableProperty && availableProperty.Value && availableProperty.Value.IntegerValue) {\r\n return availableProperty.Value.IntegerValue;\r\n }\r\n }\r\n return ProductStockStatusEnum.OUT_OF_STOCK;\r\n};\r\n\r\nexport const renderProductBadge = (request: Msdyn365.IRequestContext, badgeStatus: string, suffix: string) => {\r\n try {\r\n process.env.NODE_ENV === 'development' && console.log('renderProductBadge', badgeStatus, suffix);\r\n const mainImage = document?.querySelectorAll('.ms-buybox__media-gallery .msc-carousel__inner')[0];\r\n if (mainImage) {\r\n const currentBadge = mainImage.querySelector('.hei-badge');\r\n if (!currentBadge) {\r\n const badgeUrl = buildProductBadgeUrl(request.locale, badgeStatus, request.apiSettings.baseImageUrl, suffix);\r\n\r\n const badgeImage = document.createElement('img');\r\n badgeImage.src = badgeUrl;\r\n badgeImage.classList.add('msc-product__badge');\r\n badgeImage.classList.add('msc-product__badge--detail');\r\n badgeImage.classList.add('hei-badge');\r\n badgeImage.alt = badgeStatus;\r\n mainImage.appendChild(badgeImage);\r\n }\r\n\r\n return true;\r\n }\r\n } catch {\r\n return false;\r\n }\r\n\r\n return false;\r\n};\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport { ProductsDataActions, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { getSelectedProductIdFromActionInput } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { IProductAttributeGroup } from '../../../actions/DataServiceEntities.g';\r\nimport { getGroupedAttributesAsync } from '../../../actions/DataActionExtension.g';\r\n\r\n/**\r\n * Chains getting the SelectedVariant with GetActivePrice.\r\n */\r\nexport class AttributeGroupsForSelectedVariantInput implements IActionInput {\r\n public productId: number;\r\n\r\n public channelId: number;\r\n\r\n public catalogId: number;\r\n\r\n public selectedProduct: SimpleProduct | undefined;\r\n\r\n constructor(productId: number, channelId: number, selectedProduct?: SimpleProduct, catalogId?: number) {\r\n this.productId = productId;\r\n this.channelId = channelId;\r\n this.selectedProduct = selectedProduct;\r\n this.catalogId = catalogId || 0;\r\n }\r\n\r\n public getCacheKey = () => `AttributeGroupsForSelectedVariant-${this.productId}`;\r\n\r\n public getCacheObjectType = () => 'ProductAttributeGroup';\r\n\r\n public dataCacheType = (): CacheType => 'instance';\r\n}\r\n\r\nexport const createAttributeGroupsForSelectedVariantInput = (\r\n inputData: ICreateActionContext>\r\n): AttributeGroupsForSelectedVariantInput => {\r\n const productId = getSelectedProductIdFromActionInput(inputData);\r\n\r\n if (productId) {\r\n return new AttributeGroupsForSelectedVariantInput(+productId, +inputData.requestContext.apiSettings.channelId);\r\n }\r\n throw new Error('Unable to create AttributeGroupsForSelectedVariantInput, no productId found on module config or query');\r\n};\r\n\r\n/**\r\n * Calls the Retail API a get a list of dimension values for a given product.\r\n * @param input\r\n * @param ctx\r\n */\r\nexport async function getAttributeGroupsForSelectedVariantAction(\r\n input: AttributeGroupsForSelectedVariantInput,\r\n ctx: IActionContext\r\n): Promise {\r\n return Promise.resolve()\r\n .then(() => {\r\n const activeProduct: SimpleProduct | undefined = input.selectedProduct;\r\n\r\n if (!activeProduct) {\r\n return ProductsDataActions.getByIdAsync({ callerContext: ctx }, input.productId, input.channelId);\r\n }\r\n\r\n return activeProduct;\r\n })\r\n .then((productResult: SimpleProduct | null) => {\r\n const activeProduct: SimpleProduct | undefined = productResult;\r\n\r\n if (activeProduct) {\r\n return getGroupedAttributesAsync(\r\n { callerContext: ctx, queryResultSettings: {} },\r\n input.channelId,\r\n input.catalogId,\r\n activeProduct.RecordId\r\n );\r\n }\r\n\r\n return null;\r\n })\r\n .then((attributeValues: IProductAttributeGroup[] | null) => {\r\n const resultArray = attributeValues;\r\n if (resultArray) {\r\n return resultArray;\r\n }\r\n\r\n return [];\r\n })\r\n .catch((error: Error) => {\r\n ctx.trace(error.message);\r\n throw new Error('[getPriceForSelectedVariantAction]Error executing action');\r\n });\r\n}\r\n\r\nexport default createObservableDataAction({\r\n id: 'hei-product-info/get-attribute-groups-for-selected-variant',\r\n action: >getAttributeGroupsForSelectedVariantAction,\r\n input: createAttributeGroupsForSelectedVariantInput\r\n});\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { getRichTextHtml } from '@msdyn365-commerce/core';\r\nimport * as React from 'react';\r\n\r\n/**\r\n * Product specification table row.\r\n */\r\nexport interface IProductSpecificationTableRow {\r\n productName?: string;\r\n cellData?: React.ReactNode;\r\n className?: string;\r\n}\r\n\r\n/**\r\n * Product specification table row component.\r\n * @param props - For product specification table row.\r\n * @param props.productName - Product name.\r\n * @param props.cellData - Cell data.\r\n * @param props.className - Class name.\r\n * @returns - Returns JSX element.\r\n */\r\nexport const ProductSpecificationTableRow: React.FC = ({ productName, cellData, className }) => (\r\n \r\n \r\n \r\n \r\n {cellData}\r\n \r\n);\r\n","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. See License.txt in the project root for license information.\r\n * IHeiProductSpecification contentModule Interface Properties\r\n * THIS FILE IS AUTO-GENERATED - MANUAL MODIFICATIONS WILL BE LOST\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport const enum displayStyle {\r\n accordion = 'accordion',\r\n table = 'table'\r\n}\r\n\r\nexport interface IHeiProductSpecificationConfig extends Msdyn365.IModuleConfig {\r\n heading?: IHeadingData;\r\n displayStyle?: displayStyle;\r\n className?: string;\r\n}\r\n\r\nexport interface IHeiProductSpecificationResources {\r\n trueValueText: string;\r\n falseValueText: 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 IHeiProductSpecificationProps extends Msdyn365.IModule {\r\n resources: IHeiProductSpecificationResources;\r\n config: IHeiProductSpecificationConfig;\r\n}\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { Drawer, IModuleProps, INodeProps, Module } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport { reaction } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\n\r\nimport { AttributesForSelectedVariantInput, getAttributesForSelectedVariant } from '@msdyn365-commerce-modules/product-specification';\r\nimport { ProductSpecificationTableRow } from './components/hei-product-specification-table-stucture';\r\nimport { IHeiProductSpecificationData } from './hei-product-specification.data';\r\nimport { displayStyle, IHeiProductSpecificationProps } from './hei-product-specification.props.autogenerated';\r\nimport { IProductAttributeGroup } from '../../actions/DataServiceEntities.g';\r\n\r\n/**\r\n * Maintain Drawer State.\r\n */\r\nexport interface IProductSpecificationState {\r\n isDrawerOpen: boolean;\r\n drawerListId: number | undefined;\r\n}\r\n\r\n/**\r\n * Product specification view props.\r\n */\r\nexport interface IProductSpecificationViewProps extends IHeiProductSpecificationProps<{}> {\r\n ProductSpecification: IModuleProps;\r\n ProductSpecificationTableProps: INodeProps;\r\n ProductSpecificationTableBodyProps: INodeProps;\r\n productSpecificationResult?: (JSX.Element | null)[];\r\n title?: React.ReactNode;\r\n isAccrodion?: boolean;\r\n handleText?(event: Msdyn365.ContentEditableEvent): void;\r\n}\r\n\r\n/**\r\n * Check for display style either accordion or table.\r\n */\r\nexport interface IProductSpecificationExtentedProps extends IHeiProductSpecificationProps {\r\n displayStyle?: displayStyle;\r\n}\r\n\r\nconst showSepcGroup = (group: IProductAttributeGroup) => {\r\n if (\r\n group.Group === 'WhatsInTheBox' ||\r\n group.Group === 'SharePointProvisionedProductAttributeGroup' ||\r\n group.Group?.substring(0, 'Default '.length) === 'Default '\r\n ) {\r\n return false;\r\n }\r\n\r\n return true;\r\n};\r\n\r\n/**\r\n *\r\n * ProductSpecification component.\r\n * @extends {React.Component>}\r\n */\r\n@observer\r\nclass ProductSpecification extends React.Component {\r\n public constructor(props: IProductSpecificationExtentedProps) {\r\n super(props);\r\n this.state = {\r\n isDrawerOpen: false,\r\n drawerListId: undefined\r\n };\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n const { context, data, telemetry } = this.props;\r\n reaction(\r\n () => (data.product.result ? data.product.result.RecordId : null),\r\n () => {\r\n if (context && data.product.result) {\r\n const actionInput = new AttributesForSelectedVariantInput(\r\n data.product.result.RecordId,\r\n\r\n +context.actionContext.requestContext.apiSettings.channelId,\r\n data.product.result\r\n );\r\n\r\n getAttributesForSelectedVariant(actionInput, this.props.context.actionContext).catch((error: Error) => {\r\n telemetry.error(error.message);\r\n telemetry.debug('Unable to update attributes for Product');\r\n telemetry.error(error.message);\r\n });\r\n }\r\n }\r\n );\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: IProductSpecificationExtentedProps, nextState: IProductSpecificationState): boolean {\r\n if (this.state === nextState && this.props.data === nextProps.data) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n let data: IHeiProductSpecificationData;\r\n try {\r\n data = this.props.data;\r\n } catch (error) {\r\n this.props.telemetry.error(`Something went wrong ------${error}`);\r\n return
{`${error}`}
;\r\n }\r\n\r\n if (!data.productSpecificationData.result || data.productSpecificationData.result.length <= 0) {\r\n this.props.telemetry.error('Product specification content is empty, module wont render.');\r\n return null;\r\n }\r\n\r\n const { heading, className } = this.props.config;\r\n const isAccrodion = this.props.config.displayStyle === displayStyle.accordion;\r\n const viewProps = {\r\n ...this.props,\r\n handleText: this.handleHeadingChange,\r\n ProductSpecification: {\r\n moduleProps: this.props,\r\n className: classnames('ms-product-specification', className)\r\n },\r\n ProductSpecificationTableProps: isAccrodion\r\n ? {\r\n moduleProps: this.props,\r\n className: classnames('ms-product-specification__accordion hei-product-specification__accordion', className)\r\n }\r\n : {\r\n className: classnames('ms-product-specification__table hei-product-specification_table'),\r\n tag: 'table'\r\n },\r\n isAccrodion,\r\n ProductSpecificationTableBodyProps: isAccrodion\r\n ? {}\r\n : {\r\n className: '',\r\n tag: 'tbody'\r\n },\r\n title: heading?.text && (\r\n \r\n ),\r\n\r\n productSpecificationResult: isAccrodion ? this._createDrawerBody(data) : this._createTableBody(data)\r\n } as IProductSpecificationViewProps;\r\n\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n /**\r\n * Handle Heading Text Change.\r\n * @param event - Current event.\r\n */\r\n public handleHeadingChange = (event: Msdyn365.ContentEditableEvent): void => {\r\n this.props.config.heading!.text = event.target.value;\r\n };\r\n\r\n private _createTableBody(content: IHeiProductSpecificationData): (JSX.Element | null)[] {\r\n var groups = content.productSpecificationData.result!;\r\n\r\n return groups.map((group, idx) => {\r\n const attrs = group.Attributes;\r\n if (!showSepcGroup(group) || !attrs?.length) {\r\n return null;\r\n }\r\n\r\n var attributes = attrs\r\n .map((product, index) => {\r\n const cellData: JSX.Element | null = this._renderProductCell(product);\r\n if (!cellData) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n );\r\n })\r\n .filter(r => r !== null);\r\n\r\n if (!attributes.length) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n \r\n

{group.Name}

\r\n \r\n {attributes}\r\n
\r\n \r\n \r\n );\r\n });\r\n }\r\n\r\n private _createDrawerBody(content: IHeiProductSpecificationData): (JSX.Element | null)[] {\r\n const accordionItemContainer: IModuleProps = {\r\n moduleProps: this.props,\r\n className: 'ms-product-specification-title'\r\n };\r\n\r\n var groups = content.productSpecificationData.result!;\r\n\r\n return groups.map((group, idx) => {\r\n const attrs = group.Attributes;\r\n if (showSepcGroup(group) || !attrs?.length) {\r\n return null;\r\n }\r\n\r\n var attributes = attrs.map(product => {\r\n const cellData: JSX.Element | null = this._renderProductCell(product);\r\n if (!cellData) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n \r\n
{cellData}
\r\n \r\n
\r\n );\r\n });\r\n\r\n return (\r\n
\r\n

{group.Name}

\r\n {attributes}\r\n
\r\n );\r\n });\r\n }\r\n\r\n private readonly _toggle = (drawerListId: number | undefined) => (): void => {\r\n if (this.state.drawerListId !== drawerListId) {\r\n this.setState({ drawerListId, isDrawerOpen: true });\r\n } else {\r\n this.setState({ drawerListId: undefined, isDrawerOpen: false });\r\n }\r\n };\r\n\r\n private _renderProductCell(product: AttributeValue): JSX.Element | null {\r\n switch (product.DataTypeValue) {\r\n case 0: // None\r\n // Return span here instead of null so the row still shows\r\n return null;\r\n case 1: // Currency\r\n return product.CurrencyValue ? this._renderCurrencyCell(product) : null;\r\n case 2: // DateTime\r\n return product.DateTimeOffsetValue ? this._renderDateTimeCell(product) : null;\r\n case 3: // Decimal\r\n return product.FloatValue ? this._renderDecimalCell(product) : null;\r\n case 4: // Integer\r\n return product.IntegerValue ? this._renderIntegerCell(product) : null;\r\n case 5: // Text\r\n return product.TextValue ? this._renderTextCell(product) : null;\r\n case 6: // TrueFalse\r\n return product.BooleanValue ? this._renderTrueFalseCell(product) : null;\r\n case 40: // Video\r\n this.props.telemetry.warning('Got video specification type, not supported yet so skipping line');\r\n return null;\r\n case 41: // Image\r\n this.props.telemetry.warning('Got image specification type, not supported yet so skipping line');\r\n return null;\r\n default:\r\n this.props.telemetry.warning(`Got unknown specification type ${product.DataTypeValue} so skipping line`);\r\n return null;\r\n }\r\n }\r\n\r\n private _renderCurrencyCell(product: AttributeValue): JSX.Element | null {\r\n if (product.CurrencyValue !== null && product.CurrencyValue !== undefined) {\r\n return (\r\n \r\n {product.CurrencyCode}\r\n {product.CurrencyValue}\r\n \r\n );\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private _renderDateTimeCell(product: AttributeValue): JSX.Element | null {\r\n if (product.DateTimeOffsetValue?.toUTCString) {\r\n return {product.DateTimeOffsetValue.toUTCString()};\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private _renderIntegerCell(product: AttributeValue): JSX.Element | null {\r\n if (product.IntegerValue !== null && product.IntegerValue !== undefined) {\r\n return {product.IntegerValue};\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private _renderDecimalCell(product: AttributeValue): JSX.Element | null {\r\n if (product.FloatValue !== null && product.FloatValue !== undefined) {\r\n return {product.FloatValue};\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private _renderTextCell(product: AttributeValue): JSX.Element | null {\r\n if (product.TextValue !== null && product.TextValue !== undefined) {\r\n return ;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private _renderTrueFalseCell(product: AttributeValue): JSX.Element | null {\r\n // TODO 20369885 setting to default value is needed to work around a platform bug where\r\n // config string value does not get its default value.\r\n if (product.BooleanValue) {\r\n return {this.props.resources.trueValueText ? this.props.resources.trueValueText : 'Yes'};\r\n }\r\n return {this.props.resources.falseValueText ? this.props.resources.falseValueText : 'No'};\r\n }\r\n}\r\n\r\nexport default ProductSpecification;\r\n","export const canUseDOM = (): boolean =>\r\n !!(\r\n // tslint:disable-next-line:no-typeof-undefined\r\n (typeof window !== 'undefined' && window.document && window.document.createElement)\r\n );\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport { ArrayExtensions, ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport { IProductSpecificationViewProps } from '@msdyn365-commerce-modules/product-specification/src/modules/product-specification/./product-specification';\r\nimport { renderProductBadge } from '../../common/utilities/productListExtensionHelpers';\r\nimport { canUseDOM } from '../../common/utilities/helpers';\r\nimport { IHeiProductSpecificationProps } from './hei-product-specification.props.autogenerated';\r\nimport { IHeiProductSpecificationData } from './hei-product-specification.data';\r\n\r\ntype IHeiProductSpecificationViewProps = IHeiProductSpecificationProps & IProductSpecificationViewProps;\r\n\r\nconst ProductSpecificationView: React.FC = props => {\r\n const {\r\n ProductSpecification,\r\n ProductSpecificationTableProps,\r\n ProductSpecificationTableBodyProps,\r\n productSpecificationResult,\r\n data: { productSpecificationData }\r\n } = props;\r\n const rowdata =\r\n productSpecificationResult &&\r\n ArrayExtensions.hasElements(productSpecificationResult) &&\r\n productSpecificationResult.filter(row => !ObjectExtensions.isNullOrUndefined(row));\r\n\r\n const [badgeImageAdded, setBadgeImageAdded] = React.useState(false);\r\n const injectBadge = React.useCallback(() => {\r\n if (badgeImageAdded) {\r\n return;\r\n }\r\n\r\n const allAttributes = productSpecificationData.result\r\n ?.map(attrGroup => {\r\n return attrGroup.Attributes;\r\n })\r\n .flat();\r\n\r\n if (allAttributes) {\r\n // process.env.NODE_ENV === 'development' && console.log('iterateAttributes', allAttributes);\r\n allAttributes.forEach(psr => {\r\n if (psr && psr.Name === 'Product Badge Status') {\r\n const badgeStatus = psr.TextValue || '';\r\n // process.env.NODE_ENV === 'development' && console.log('iterateAttributes', badgeStatus);\r\n if (canUseDOM() && badgeStatus.toLowerCase() !== 'none') {\r\n if (renderProductBadge(props.context.request, badgeStatus, '_PDP')) {\r\n // process.env.NODE_ENV === 'development' && console.log('iterateAttributes', badgeStatus, 'added');\r\n setBadgeImageAdded(true);\r\n }\r\n }\r\n }\r\n });\r\n }\r\n }, [productSpecificationData.result, badgeImageAdded]);\r\n\r\n injectBadge();\r\n\r\n return rowdata && ArrayExtensions.hasElements(rowdata) ? (\r\n \r\n {props.title}\r\n \r\n {rowdata}\r\n \r\n \r\n ) : null;\r\n};\r\n\r\nexport default ProductSpecificationView;\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['hei-product-specification'] = {\n c: () => require('partner/modules/hei-product-specification/hei-product-specification.tsx'),\n $type: 'contentModule',\n da: [{name:'product', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant', runOn: 0},{name:'productSpecificationData', path:'modules/hei-product-specification/dataActions/get-attribute-groups-for-selected-variant', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'hei-product-specification',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/hei-product-specification'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'modules/hei-product-specification/dataActions/get-attribute-groups-for-selected-variant';\n let dataAction = require('partner/modules/hei-product-specification/dataActions/get-attribute-groups-for-selected-variant');\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|hei-product-specification|hei-product-specification'] = {\n c: () => require('partner/modules/hei-product-specification/hei-product-specification.view.tsx'),\n cn: '__local__-__local__-hei-product-specification'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n getCatalogId,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { AttributeValue, ProductsDataActions, SimpleProduct, StoreOperationsDataActions } from '@msdyn365-commerce/retail-proxy';\nimport {\n getAttributeValuesByConfiguration,\n getSelectedProductIdFromActionInput,\n getSelectedVariant,\n QueryResultSettingsProxy,\n SelectedVariantInput\n} from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Chains getting the SelectedVariant with GetActivePrice.\n */\nexport class AttributesForSelectedVariantInput implements IActionInput {\n public productId: number;\n\n public channelId: number;\n\n public catalogId: number;\n\n public selectedProduct: SimpleProduct | undefined;\n\n constructor(productId: number, channelId: number, selectedProduct?: SimpleProduct, catalogId?: number) {\n this.productId = productId;\n this.channelId = channelId;\n this.selectedProduct = selectedProduct;\n this.catalogId = catalogId || 0;\n }\n\n public getCacheKey = () => 'AttributesForSelectedVariant';\n\n public getCacheObjectType = () => 'ProductAttributeValue';\n\n public dataCacheType = (): CacheType => 'none';\n}\n\nexport const createAttributesForSelectedVariantInput = (\n inputData: ICreateActionContext>\n): AttributesForSelectedVariantInput => {\n const productId = getSelectedProductIdFromActionInput(inputData);\n const catalogId = getCatalogId(inputData.requestContext);\n\n if (productId) {\n return new AttributesForSelectedVariantInput(+productId, +inputData.requestContext.apiSettings.channelId, undefined, catalogId);\n }\n throw new Error('Unable to create PriceForSelectedVariantInput, no productId found on module config or query');\n};\n\n/**\n * Calls the Retail API a get a list of dimension values for a given product.\n * @param input - The input.\n * @param context - The context.\n * @returns The attribute values.\n */\nexport async function getAttributesForSelectedVariantAction(\n input: AttributesForSelectedVariantInput,\n context: IActionContext\n): Promise {\n return Promise.resolve()\n .then(() => {\n const activeProduct: SimpleProduct | undefined = input.selectedProduct;\n\n if (!activeProduct) {\n const selectedVariantInput = new SelectedVariantInput(\n input.productId,\n input.channelId,\n undefined,\n undefined,\n context.requestContext\n );\n\n return getSelectedVariant(selectedVariantInput, context);\n }\n\n return activeProduct;\n })\n .then((productResult: SimpleProduct | null) => {\n const activeProduct: SimpleProduct | undefined = productResult;\n\n if (activeProduct) {\n return ProductsDataActions.getAttributeValuesAsync(\n {\n callerContext: context,\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context)\n },\n activeProduct.RecordId,\n input.channelId,\n input.catalogId\n );\n }\n\n return null;\n })\n .then(async (attributeValues: AttributeValue[] | null) => {\n const channelInventoryConfiguration = await StoreOperationsDataActions.getInventoryConfigurationAsync({\n callerContext: context\n });\n\n return { attributeValues, channelInventoryConfiguration };\n })\n .then(result => {\n return getAttributeValuesByConfiguration(result.attributeValues, result.channelInventoryConfiguration);\n })\n .catch((error: Error) => {\n context.trace(error.message);\n throw new Error('[getPriceForSelectedVariantAction]Error executing action');\n });\n}\n\nexport default createObservableDataAction({\n id: '@msdyn365-commerce-modules/product-info/get-attributes-for-selected-variant',\n action: >getAttributesForSelectedVariantAction,\n input: createAttributesForSelectedVariantInput\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getRichTextHtml } from '@msdyn365-commerce/core';\nimport * as React from 'react';\n\n/**\n * Product specification table row.\n */\nexport interface IProductSpecificationTableRow {\n productName?: string;\n cellData?: React.ReactNode;\n className?: string;\n}\n\n/**\n * Product specification table row component.\n * @param props - For product specification table row.\n * @param props.productName - Product name.\n * @param props.cellData - Cell data.\n * @param props.className - Class name.\n * @returns - Returns JSX element.\n */\nexport const ProductSpecificationTableRow: React.FC = ({ productName, cellData, className }) => (\n \n \n {/* eslint-disable-next-line react/no-danger */}\n \n \n {cellData}\n \n);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { Drawer, IModuleProps, INodeProps, Module } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { reaction } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { validateCatalogId } from '@msdyn365-commerce-modules/retail-actions';\nimport { AttributesForSelectedVariantInput, getAttributesForSelectedVariant } from '../..';\nimport { ProductSpecificationTableRow } from './components/product-specification-table-stucture';\nimport { IProductSpecificationData } from './product-specification.data';\nimport { displayStyle, IProductSpecificationProps } from './product-specification.props.autogenerated';\n\n/**\n * Maintain Drawer State.\n */\nexport interface IProductSpecificationState {\n isDrawerOpen: boolean;\n isAdditionalMediaDrawerOpen: boolean;\n drawerListId: number | undefined;\n}\n\n/**\n * Product specification view props.\n */\nexport interface IProductSpecificationViewProps extends IProductSpecificationProps<{}> {\n ProductSpecification: IModuleProps;\n ProductSpecificationTableProps: INodeProps;\n ProductSpecificationTableBodyProps: INodeProps;\n productSpecificationResult?: (JSX.Element | null)[];\n\n title?: React.ReactNode;\n isAccrodion?: boolean;\n handleText?(event: Msdyn365.ContentEditableEvent): void;\n}\n\n/**\n * Check for display style either accordion or table.\n */\nexport interface IProductSpecificationExtentedProps extends IProductSpecificationProps {\n displayStyle?: displayStyle;\n}\n\n/**\n *\n * ProductSpecification component.\n * @extends {React.Component>}\n */\n@observer\nclass ProductSpecification extends React.Component {\n public constructor(props: IProductSpecificationExtentedProps) {\n super(props);\n this.state = {\n isDrawerOpen: false,\n isAdditionalMediaDrawerOpen: false,\n drawerListId: undefined\n };\n }\n\n public async componentDidMount(): Promise {\n const { context, data, telemetry } = this.props;\n const catalogId = Msdyn365.getCatalogId(this.props.context.request);\n validateCatalogId(catalogId);\n reaction(\n () => (data.product.result ? data.product.result.RecordId : null),\n () => {\n if (context && data.product.result) {\n const actionInput = new AttributesForSelectedVariantInput(\n data.product.result.RecordId,\n\n +context.actionContext.requestContext.apiSettings.channelId,\n data.product.result,\n catalogId\n );\n\n getAttributesForSelectedVariant(actionInput, this.props.context.actionContext).catch((error: Error) => {\n telemetry.error(error.message);\n telemetry.debug('Unable to update attributes for Product');\n telemetry.error(error.message);\n });\n }\n }\n );\n }\n\n public shouldComponentUpdate(nextProps: IProductSpecificationExtentedProps, nextState: IProductSpecificationState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n let data: IProductSpecificationData;\n try {\n data = this.props.data;\n } catch (error) {\n this.props.telemetry.error(`Something went wrong ------${error}`);\n return
{error}
;\n }\n\n if (!data.productSpecificationData.result || data.productSpecificationData.result.length <= 0) {\n this.props.telemetry.error('Product specification content is empty, module wont render.');\n return null;\n }\n\n const { heading, className } = this.props.config;\n const { productSpecificationData } = this.props.data;\n const isAccrodion = this.props.config.displayStyle === displayStyle.accordion;\n const viewProps = {\n ...this.props,\n handleText: this.handleHeadingChange,\n ProductSpecification: {\n moduleProps: this.props,\n className: classnames('ms-product-specification', className)\n },\n ProductSpecificationTableProps: isAccrodion\n ? {\n moduleProps: this.props,\n className: classnames('ms-product-specification__accordion', className)\n }\n : {\n className: classnames('ms-product-specification__table table-striped table-bordered'),\n tag: 'table'\n },\n isAccrodion,\n ProductSpecificationTableBodyProps: isAccrodion\n ? {}\n : {\n className: '',\n tag: 'tbody'\n },\n title: heading?.text && (\n \n ),\n productSpecificationResult:\n productSpecificationData.result && (isAccrodion ? this._createDrawerBody(data) : this._createTableBody(data))\n } as IProductSpecificationViewProps;\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n /**\n * Handle Heading Text Change.\n * @param event - Current event.\n */\n public handleHeadingChange = (event: Msdyn365.ContentEditableEvent): void => {\n this.props.config.heading!.text = event.target.value;\n };\n\n private _createTableBody(content: IProductSpecificationData): (JSX.Element | null)[] {\n const tableRows = content.productSpecificationData.result!.map((product, index) => {\n const cellData: JSX.Element | null = this._renderProductCell(product);\n\n if (!cellData) {\n return null;\n }\n\n return (\n <>\n \n \n );\n });\n\n if (this.props.context.request.app?.config?.OmniChannelMedia && this.props.data.additionalMediaLocations.result?.length) {\n tableRows.push(this._createAdditionalMediaDrawer());\n }\n\n return tableRows;\n }\n\n private _createDrawerBody(content: IProductSpecificationData): (JSX.Element | null)[] {\n const accordionItemContainer: IModuleProps = {\n moduleProps: this.props,\n className: 'ms-product-specification-title'\n };\n\n const drawers = content.productSpecificationData.result!.map(product => {\n const cellData: JSX.Element | null = this._renderProductCell(product);\n if (!cellData) {\n return null;\n }\n return (\n \n \n
{cellData}
\n \n
\n );\n });\n\n if (this.props.context.request.app?.config?.OmniChannelMedia && this.props.data.additionalMediaLocations.result?.length) {\n drawers.push(this._createAdditionalMediaDrawer());\n }\n\n return drawers;\n }\n private _createAdditionalMediaDrawer(): JSX.Element {\n const accordionItemContainer: IModuleProps = {\n moduleProps: this.props,\n className: 'ms-product-specification-title'\n };\n\n return (\n \n {\n this.setState(prevState => ({\n ...prevState,\n isAdditionalMediaDrawerOpen: !prevState.isAdditionalMediaDrawerOpen\n }));\n }}\n >\n
\n \n
\n \n
\n );\n }\n\n private readonly _toggle = (drawerListId: number | undefined) => (): void => {\n if (this.state.drawerListId !== drawerListId) {\n this.setState({ drawerListId, isDrawerOpen: true });\n } else {\n this.setState({ drawerListId: undefined, isDrawerOpen: false });\n }\n };\n\n private _renderProductCell(product: AttributeValue): JSX.Element | null {\n switch (product.DataTypeValue) {\n case 0: // None\n // Return span here instead of null so the row still shows\n return ;\n case 1: // Currency\n return this._renderCurrencyCell(product);\n case 2: // DateTime\n return this._renderDateTimeCell(product);\n case 3: // Decimal\n return this._renderDecimalCell(product);\n case 4: // Integer\n return this._renderIntegerCell(product);\n case 5: // Text\n return this._renderTextCell(product);\n case 6: // TrueFalse\n return this._renderTrueFalseCell(product);\n case 40: // Video\n this.props.telemetry.warning('Got video specification type, not supported yet so skipping line');\n return null;\n case 41: // Image\n this.props.telemetry.warning('Got image specification type, not supported yet so skipping line');\n return null;\n default:\n this.props.telemetry.warning(`Got unknown specification type ${product.DataTypeValue} so skipping line`);\n return null;\n }\n }\n\n private _renderCurrencyCell(product: AttributeValue): JSX.Element | null {\n if (product.CurrencyValue !== null && product.CurrencyValue !== undefined) {\n return (\n \n {product.CurrencyCode}\n {product.CurrencyValue}\n \n );\n }\n\n return null;\n }\n\n private _renderDateTimeCell(product: AttributeValue): JSX.Element | null {\n if (product.DateTimeOffsetValue?.toUTCString) {\n return {product.DateTimeOffsetValue.toUTCString()};\n }\n\n return null;\n }\n\n private _renderIntegerCell(product: AttributeValue): JSX.Element | null {\n if (product.IntegerValue !== null && product.IntegerValue !== undefined) {\n return {product.IntegerValue};\n }\n\n return null;\n }\n\n private _renderDecimalCell(product: AttributeValue): JSX.Element | null {\n if (product.FloatValue !== null && product.FloatValue !== undefined) {\n return {product.FloatValue};\n }\n\n return null;\n }\n\n private _renderTextCell(product: AttributeValue): JSX.Element | null {\n if (product.TextValue !== null && product.TextValue !== undefined) {\n // eslint-disable-next-line react/no-danger\n return ;\n }\n\n return null;\n }\n\n private _renderTrueFalseCell(product: AttributeValue): JSX.Element | null {\n // TODO 20369885 setting to default value is needed to work around a platform bug where\n // config string value does not get its default value.\n if (product.BooleanValue) {\n return {this.props.resources.trueValueText ? this.props.resources.trueValueText : 'Yes'};\n }\n return {this.props.resources.falseValueText ? this.props.resources.falseValueText : 'No'};\n }\n}\n\nexport default ProductSpecification;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ArrayExtensions, ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IProductSpecificationViewProps } from './product-specification';\n\nconst ProductSpecificationView: React.FC = props => {\n const { ProductSpecification, ProductSpecificationTableProps, ProductSpecificationTableBodyProps, productSpecificationResult } = props;\n const rowdata =\n productSpecificationResult &&\n ArrayExtensions.hasElements(productSpecificationResult) &&\n productSpecificationResult.filter(row => !ObjectExtensions.isNullOrUndefined(row));\n\n return rowdata && ArrayExtensions.hasElements(rowdata) ? (\n \n {props.title}\n \n {rowdata}\n \n \n ) : null;\n};\n\nexport default ProductSpecificationView;\n","module.exports = React;","module.exports = ReactDOM;","'use strict';\nvar $TypeError = TypeError;\nvar MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991\n\nmodule.exports = function (it) {\n if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');\n return it;\n};\n","'use strict';\nvar isArray = require('../internals/is-array');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar doesNotExceedSafeInteger = require('../internals/does-not-exceed-safe-integer');\nvar bind = require('../internals/function-bind-context');\n\n// `FlattenIntoArray` abstract operation\n// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray\nvar flattenIntoArray = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {\n var targetIndex = start;\n var sourceIndex = 0;\n var mapFn = mapper ? bind(mapper, thisArg) : false;\n var element, elementLen;\n\n while (sourceIndex < sourceLen) {\n if (sourceIndex in source) {\n element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];\n\n if (depth > 0 && isArray(element)) {\n elementLen = lengthOfArrayLike(element);\n targetIndex = flattenIntoArray(target, original, element, elementLen, targetIndex, depth - 1) - 1;\n } else {\n doesNotExceedSafeInteger(targetIndex + 1);\n target[targetIndex] = element;\n }\n\n targetIndex++;\n }\n sourceIndex++;\n }\n return targetIndex;\n};\n\nmodule.exports = flattenIntoArray;\n","'use strict';\nvar $ = require('../internals/export');\nvar flattenIntoArray = require('../internals/flatten-into-array');\nvar toObject = require('../internals/to-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar arraySpeciesCreate = require('../internals/array-species-create');\n\n// `Array.prototype.flat` method\n// https://tc39.es/ecma262/#sec-array.prototype.flat\n$({ target: 'Array', proto: true }, {\n flat: function flat(/* depthArg = 1 */) {\n var depthArg = arguments.length ? arguments[0] : undefined;\n var O = toObject(this);\n var sourceLen = lengthOfArrayLike(O);\n var A = arraySpeciesCreate(O, 0);\n A.length = flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toIntegerOrInfinity(depthArg));\n return A;\n }\n});\n","'use strict';\n// this method was added to unscopables after implementation\n// in popular engines, so it's moved to a separate module\nvar addToUnscopables = require('../internals/add-to-unscopables');\n\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('flat');\n"],"names":["ProductStockStatusEnum","findAttribute","attributes","attributeName","find","attr","_attr$Name","Name","toLowerCase","findAllAttributes","filter","_attr$Name2","findAttributeValue","attribute","DataTypeValue","CurrencyCode","DateTimeOffsetValue","FloatValue","IntegerValue","TextValue","BooleanValue","buildProductBadgeUrl","locale","badgeName","baseUrl","suffix","replace","getProductBadgeUrl","product","badgeAttributeArray","AttributeValues","badgeStatus","forEach","badgeValue","url","BasePrice","Price","getProductStockStatus","extensionProperties","length","availableProperty","xt","Key","Value","OUT_OF_STOCK","renderProductBadge","request","_document","mainImage","document","querySelectorAll","querySelector","badgeUrl","apiSettings","baseImageUrl","badgeImage","createElement","src","classList","add","alt","appendChild","_unused","AttributeGroupsForSelectedVariantInput","constructor","productId","channelId","selectedProduct","catalogId","getCacheKey","this","getCacheObjectType","dataCacheType","createAttributeGroupsForSelectedVariantInput","inputData","getSelectedProductIdFromActionInput","requestContext","Error","async","getAttributeGroupsForSelectedVariantAction","input","ctx","Promise","resolve","then","activeProduct","ProductsDataActions","callerContext","productResult","getGroupedAttributesAsync","queryResultSettings","RecordId","attributeValues","catch","error","trace","message","createObservableDataAction","id","action","ProductSpecificationTableRow","_ref","productName","cellData","className","React","scope","dangerouslySetInnerHTML","getRichTextHtml","displayStyle","HeadingTag","showSepcGroup","group","_group$Group","Group","substring","ProductSpecification","props","super","handleHeadingChange","event","config","heading","text","target","value","_toggle","drawerListId","state","setState","isDrawerOpen","undefined","context","data","telemetry","reaction","result","actionInput","AttributesForSelectedVariantInput","actionContext","getAttributesForSelectedVariant","debug","shouldComponentUpdate","nextProps","nextState","render","_heading$tag","productSpecificationData","isAccrodion","accordion","viewProps","_objectSpread","handleText","moduleProps","classnames","ProductSpecificationTableProps","tag","ProductSpecificationTableBodyProps","title","Msdyn365","editProps","onEdit","productSpecificationResult","_createDrawerBody","_createTableBody","renderView","content","map","idx","attrs","Attributes","index","_renderProductCell","key","r","accordionItemContainer","_product$Name","Module","Object","assign","Drawer","collapseProps","timeout","isOpen","openGlyph","closeGlyph","glyphPlacement","toggleButtonText","onToggle","CurrencyValue","_renderCurrencyCell","_renderDateTimeCell","_renderDecimalCell","_renderIntegerCell","_renderTextCell","_renderTrueFalseCell","warning","_product$DateTimeOffs","toUTCString","resources","trueValueText","falseValueText","__decorate","observer","rowdata","ArrayExtensions","hasElements","row","ObjectExtensions","isNullOrUndefined","badgeImageAdded","setBadgeImageAdded","_productSpecification","allAttributes","attrGroup","flat","psr","window","injectBadge","Node","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","__bindings__","viewDictionary","cn","createAttributesForSelectedVariantInput","getCatalogId","getAttributesForSelectedVariantAction","selectedVariantInput","SelectedVariantInput","getSelectedVariant","QueryResultSettingsProxy","getPagingFromInputDataOrDefaultValue","channelInventoryConfiguration","StoreOperationsDataActions","getAttributeValuesByConfiguration","isAdditionalMediaDrawerOpen","validateCatalogId","_this$props$context$r","_this$props$data$addi","tableRows","app","OmniChannelMedia","additionalMediaLocations","push","_createAdditionalMediaDrawer","_this$props$context$r2","_this$props$data$addi2","drawers","additionalDownloadsText","prevState","mediaLocation","Uri","href","download","AltText","module","exports","ReactDOM","$TypeError","TypeError","it","isArray","lengthOfArrayLike","doesNotExceedSafeInteger","bind","flattenIntoArray","original","source","sourceLen","start","depth","mapper","thisArg","element","elementLen","targetIndex","sourceIndex","mapFn","$","toObject","toIntegerOrInfinity","arraySpeciesCreate","proto","depthArg","arguments","O","A","addToUnscopables"],"sourceRoot":""}