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eC,EAClBC,EACAxJ,GAEA,OAAOyJ,QAAQC,UACVC,MAAK,KACF,MAAMC,EAA2CJ,EAAMb,gBAEvD,IAAKiB,EAAe,CAChB,MAAMC,EAAuB,IAAIC,EAAAA,qBAC7BN,EAAMf,UACNe,EAAMd,eACN3C,OACAA,EACA/F,EAAQoJ,gBAGZ,OAAOW,EAAAA,EAAAA,oBAAmBF,EAAsB7J,GAGpD,OAAO4J,KAEVD,MAA+BK,IAC5B,MAAMJ,EAAsEI,EAE5E,OAAIJ,EACOK,EAAAA,oBAAAA,wBACH,CACIC,cAAelK,EACfmK,oBAAqBC,EAAAA,yBAAAA,qCAA8DpK,IAEvF4J,EAAcS,SACdb,EAAMd,UACNc,EAAMZ,WAIP,QAEVe,MAAKL,MAAAA,IAKK,CAAEgB,gBAAAA,EAAiBC,oCAJkBC,EAAAA,2BAAAA,+BAA0D,CAClGN,cAAelK,QAKtB2J,MAAKhE,IACK8E,EAAAA,EAAAA,mCAAkC9E,EAAO2E,gBAAiB3E,EAAO4E,iCAE3EG,OAAOC,IAEJ,MADA3K,EAAQ4K,MAAMD,EAAME,SACd,IAAIvD,MAAM,+DAI5B,SAAewD,EAAAA,EAAAA,IAA2B,CACtCpH,GAAI,8EACJqH,OAAmCxB,EACnCC,MAAOR,WC/HXgC,EAAOC,QAAU5J,cCAjB2J,EAAOC,QAAUC","sources":["webpack://mattressfirm/./src/Utilities/get-view-port.tsx?4210","webpack://mattressfirm/./src/modules/mfrm-product-details/mfrm-product-details-specification/mfrm-product-details-specification.tsx?6597","webpack://mattressfirm/./src/modules/mfrm-product-details/mfrm-product-details.tsx?b5aa","webpack://mattressfirm/./src/modules/mfrm-product-details/mfrm-product-details.view.tsx?c431","webpack://mattressfirm/./lib/mfrm-product-details/module-registration.js?f322","webpack://mattressfirm/./src/dataActions/get-attributes-for-selected-variant.ts?e4b6","webpack://mattressfirm/external var \"React\"?0d3b","webpack://mattressfirm/external var \"ReactDOM\"?853b"],"sourcesContent":["import MsDyn365, { ICoreContext } from '@msdyn365-commerce/core';\r\nexport type GridSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\r\n\r\nconst _getViewPort = (context: ICoreContext): GridSize => {\r\n if (MsDyn365.isBrowser && window.innerWidth) {\r\n const gridSettings = context.request.gridSettings;\r\n if (gridSettings) {\r\n if (gridSettings.xs && window.innerWidth <= gridSettings.xs.w) {\r\n return 'xs';\r\n } else if (gridSettings.sm && window.innerWidth <= gridSettings.sm.w) {\r\n return 'sm';\r\n } else if (gridSettings.md && window.innerWidth <= gridSettings.md.w) {\r\n return 'md';\r\n } else if (gridSettings.lg && window.innerWidth <= gridSettings.lg.w) {\r\n return 'lg';\r\n } else {\r\n return 'xl';\r\n }\r\n }\r\n }\r\n return 'xs';\r\n};\r\n\r\nexport default _getViewPort;\r\n","import * as React from 'react';\r\n\r\nexport interface IconFeature {\r\n url: string;\r\n text: string;\r\n}\r\n\r\nexport interface MfrmProductDetailsSpecificationProps {\r\n iconFeatures: IconFeature[];\r\n listedFeatures: string[];\r\n heading2: string[];\r\n heading1: string[];\r\n mattressBreakdown: Record;\r\n}\r\n\r\nexport const MfrmProductDetailsSpecification = (props: MfrmProductDetailsSpecificationProps) => {\r\n const { listedFeatures, heading1, heading2, mattressBreakdown, iconFeatures } = props;\r\n const mattressBreakdownArr = mattressBreakdown && Object.entries(mattressBreakdown);\r\n return (\r\n
\r\n {(listedFeatures?.length || iconFeatures?.length) &&
\r\n

{heading1 ? heading1 : 'Features'}

\r\n
    \r\n {iconFeatures?.map((icon, i) => {\r\n return (\r\n
  • \r\n \r\n {icon?.text ?? ''}\r\n
  • \r\n );\r\n })}\r\n
\r\n {listedFeatures?.map((listedFeature, i) => {\r\n return

{listedFeature ?? ''}

;\r\n })}\r\n
\r\n }\r\n {mattressBreakdownArr?.length &&
\r\n

{heading2 ? heading2 : 'Breakdown'}

\r\n
\r\n {mattressBreakdownArr?.map(([key, values]) => {\r\n return (\r\n
\r\n
{key}
\r\n
\r\n {Array.isArray(values) ? (\r\n values.map(value => {\r\n return
;\r\n })\r\n ) : (\r\n
\r\n )}\r\n
\r\n
\r\n );\r\n })}\r\n
\r\n
\r\n }\r\n
\r\n );\r\n};\r\n","/*---------------------------------------------------------------------------------------------\r\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 { addThrottledEvent, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport MsDyn365, { RichTextComponent } from '@msdyn365-commerce/core';\r\nimport AccordionItem from 'mfcl/AccordionItem';\r\nimport * as React from 'react';\r\nimport _getViewPort from '../../Utilities/get-view-port';\r\n\r\nimport { IMfrmProductDetailsData } from './mfrm-product-details.data';\r\nimport { IMfrmProductDetailsProps } from './mfrm-product-details.props.autogenerated';\r\nimport { MfrmProductDetailsSpecification } from './mfrm-product-details-specification/mfrm-product-details-specification';\r\nexport interface IPanelContent {\r\n header: string;\r\n content: React.ReactElement;\r\n id: string;\r\n}\r\nexport interface IResponsiveState {\r\n isMobile: boolean;\r\n isTablet: boolean;\r\n activeTab: number;\r\n}\r\n\r\nexport interface IResultData {\r\n AttributeValueId?: number;\r\n DataTypeValue?: number;\r\n ExtensionProperties?: [];\r\n Name?: string;\r\n RecordId?: number;\r\n TextValue?: string;\r\n}\r\n\r\nexport interface IMfrmProductDetailsViewProps extends IMfrmProductDetailsProps {\r\n accordionData: React.ReactNode;\r\n panelContent: [];\r\n}\r\n\r\n/**\r\n *\r\n * MfrmProductDetails component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass MfrmProductDetails extends React.PureComponent, IResponsiveState> {\r\n private panelContent: IPanelContent[];\r\n\r\n private resizeThrottledEventHandler?: (event: Event) => void;\r\n constructor(props: IMfrmProductDetailsProps) {\r\n super(props);\r\n this.panelContent = [];\r\n this.state = {\r\n isMobile: false,\r\n isTablet: false,\r\n activeTab: 0\r\n };\r\n }\r\n public componentDidMount(): void {\r\n if (MsDyn365.isBrowser) {\r\n this.resizeThrottledEventHandler = addThrottledEvent(window, 'resize', () => this._updateViewport());\r\n }\r\n this._updateViewport();\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n MsDyn365.isBrowser && window.removeEventListener('resize', this.resizeThrottledEventHandler!, false);\r\n }\r\n public render(): JSX.Element | null {\r\n const { descriptionHeading, specificationsHeading, aboutHeading, deliveryShippingHeading, warrantyHeading } = this.props.resources;\r\n this.panelContent = [\r\n {\r\n header: descriptionHeading,\r\n content: this._getDescriptionContent(this.props.slots?.descriptionContent),\r\n id: descriptionHeading\r\n },\r\n {\r\n header: specificationsHeading,\r\n content: this._getSpecificationContent(),\r\n id: specificationsHeading\r\n },\r\n {\r\n header: `${aboutHeading} ${this._getBrandName()}`,\r\n content: this._getAboutContent(),\r\n id: aboutHeading\r\n },\r\n {\r\n header: deliveryShippingHeading,\r\n content: this._getDeliveryShippingContent(this.props.slots?.deliveryShippingContent),\r\n id: deliveryShippingHeading\r\n },\r\n {\r\n header: warrantyHeading,\r\n content: this._getWarrentyContent(this.props.slots?.warrantyContent),\r\n id: warrantyHeading\r\n }\r\n ];\r\n const viewProps = {\r\n ...this.props,\r\n accordionData: this._showAccordion(),\r\n panelContent: this.panelContent\r\n };\r\n return this.props.renderView(viewProps);\r\n }\r\n private _updateViewport = () => {\r\n const { context } = this.props;\r\n const viewPort = _getViewPort(context);\r\n viewPort === 'xs' || viewPort === 'sm' ? this.setState({ isMobile: true }) : this.setState({ isMobile: false });\r\n viewPort === 'md' || viewPort === 'lg' ? this.setState({ isTablet: true }) : this.setState({ isTablet: false });\r\n };\r\n private _getDescriptionContent(description: React.ReactNode[]): JSX.Element {\r\n if (this.props.slots && this.props.slots.descriptionContent && this.props.slots.descriptionContent.length) {\r\n return (\r\n <>\r\n {description && description.length\r\n ? description.map((children: React.ReactNode, index: number) => {\r\n return
{children}
;\r\n })\r\n : null}\r\n \r\n );\r\n }\r\n return this._defaultContent();\r\n }\r\n\r\n private _validateResult(key: string): IResultData | undefined {\r\n const {\r\n data: {\r\n productSpecificationData: { result }\r\n }\r\n } = this.props;\r\n const content: object | undefined = result ? result.find(obj => obj?.Name === key) : undefined;\r\n return content ? content : undefined;\r\n }\r\n\r\n private _getSpecificationContent(): JSX.Element {\r\n const result: IResultData | undefined = this._validateResult('Specification');\r\n if (result?.TextValue) {\r\n try {\r\n const props = JSON.parse(result.TextValue);\r\n return ;\r\n } catch (e) {\r\n return ;\r\n }\r\n }\r\n return this._defaultContent();\r\n }\r\n\r\n private _getBrandName(): string {\r\n const brandKey = this.props.context.app.config?.brandBackofficeAttributePdp;\r\n const result: IResultData | undefined = this._validateResult(brandKey);\r\n return result && result.TextValue ? result.TextValue.toLowerCase() : '';\r\n }\r\n\r\n private _getAboutContent(): JSX.Element {\r\n const result: IResultData | undefined = this._validateResult('About Brand');\r\n if (result) {\r\n return ;\r\n }\r\n return this._defaultContent();\r\n }\r\n\r\n private _getDeliveryShippingContent(deliveryShippingContent: React.ReactNode[]): JSX.Element {\r\n if (this.props.slots && this.props.slots.deliveryShippingContent && this.props.slots.deliveryShippingContent.length) {\r\n return (\r\n
\r\n {deliveryShippingContent && deliveryShippingContent.length\r\n ? deliveryShippingContent.map((children: React.ReactNode, index: number) => {\r\n return {children};\r\n })\r\n : null}\r\n
\r\n );\r\n }\r\n return this._defaultContent();\r\n }\r\n\r\n private _getWarrentyContent(warrantyContent: React.ReactNode[]): JSX.Element {\r\n if (this.props.slots && this.props.slots.warrantyContent && this.props.slots.warrantyContent.length) {\r\n return (\r\n <>\r\n {warrantyContent && warrantyContent.length\r\n ? warrantyContent.map((children: React.ReactNode, index: number) => {\r\n return {children};\r\n })\r\n : null}\r\n \r\n );\r\n }\r\n return this._defaultContent();\r\n }\r\n\r\n private _showAccordion = () => {\r\n const { isMobile, isTablet } = this.state;\r\n const accordionContent = isMobile || isTablet ? this.panelContent.slice(2) : '';\r\n return (\r\n
\r\n {accordionContent &&\r\n accordionContent.length &&\r\n accordionContent.map((children: IPanelContent, index: number) => {\r\n return (\r\n \r\n );\r\n })}\r\n
\r\n );\r\n };\r\n\r\n private _defaultContent(): JSX.Element {\r\n const { defaultContent } = this.props.resources;\r\n return {defaultContent};\r\n }\r\n}\r\n\r\nexport default MfrmProductDetails;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { IMfrmProductDetailsViewProps } from './mfrm-product-details';\r\nimport AccordionItem from 'mfcl/AccordionItem';\r\n\r\n//todo import this\r\nexport interface IPanelContent {\r\n header: string;\r\n content: React.ReactElement;\r\n id: string;\r\n}\r\n\r\nexport default (props: IMfrmProductDetailsViewProps) => {\r\n const { panelContent } = props;\r\n return (\r\n
\r\n
\r\n {panelContent &&\r\n panelContent.length &&\r\n panelContent\r\n .filter((panel: IPanelContent) => panel.header !== 'Description')\r\n .map((panel: IPanelContent, index: number) => {\r\n return (\r\n \r\n );\r\n })}\r\n
\r\n
\r\n );\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['mfrm-product-details'] = {\n c: () => require('partner/modules/mfrm-product-details/mfrm-product-details.tsx'),\n $type: 'containerModule',\n da: [{name:'product', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant', runOn: 0},{name:'productSpecificationData', path:'@msdyn365-commerce-modules/product-specification/dist/lib/dataActions/get-attributes-for-selected-variant', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'mfrm-product-details',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/mfrm-product-details'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/product-specification/dist/lib/dataActions/get-attributes-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/product-specification/dist/lib/dataActions/get-attributes-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\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 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|mfrm-product-details|mfrm-product-details'] = {\n c: () => require('partner/modules/mfrm-product-details/mfrm-product-details.view.tsx'),\n cn: '__local__-__local__-mfrm-product-details'\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","module.exports = React;","module.exports = ReactDOM;"],"names":["context","MsDyn365","window","innerWidth","gridSettings","request","xs","w","sm","md","lg","MfrmProductDetailsSpecification","props","listedFeatures","heading1","heading2","mattressBreakdown","iconFeatures","mattressBreakdownArr","Object","entries","React","className","length","map","icon","i","key","src","url","text","listedFeature","values","Array","isArray","value","dangerouslySetInnerHTML","__html","MfrmProductDetails","constructor","super","_updateViewport","this","viewPort","_getViewPort","setState","isMobile","isTablet","_showAccordion","state","accordionContent","panelContent","slice","children","index","AccordionItem","title","header","id","content","activeTab","componentDidMount","resizeThrottledEventHandler","addThrottledEvent","componentWillUnmount","removeEventListener","render","descriptionHeading","specificationsHeading","aboutHeading","deliveryShippingHeading","warrantyHeading","resources","_getDescriptionContent","slots","descriptionContent","_getSpecificationContent","_getBrandName","_getAboutContent","_getDeliveryShippingContent","deliveryShippingContent","_getWarrentyContent","warrantyContent","viewProps","accordionData","renderView","description","_defaultContent","_validateResult","data","productSpecificationData","result","find","obj","Name","undefined","TextValue","JSON","parse","e","RichTextComponent","brandKey","app","config","brandBackofficeAttributePdp","toLowerCase","defaultContent","Node","filter","panel","initialOpen","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","__bindings__","viewDictionary","cn","AttributesForSelectedVariantInput","productId","channelId","selectedProduct","catalogId","getCacheKey","getCacheObjectType","dataCacheType","createAttributesForSelectedVariantInput","inputData","getSelectedProductIdFromActionInput","getCatalogId","requestContext","apiSettings","async","getAttributesForSelectedVariantAction","input","Promise","resolve","then","activeProduct","selectedVariantInput","SelectedVariantInput","getSelectedVariant","productResult","ProductsDataActions","callerContext","queryResultSettings","QueryResultSettingsProxy","RecordId","attributeValues","channelInventoryConfiguration","StoreOperationsDataActions","getAttributeValuesByConfiguration","catch","error","trace","message","createObservableDataAction","action","module","exports","ReactDOM"],"sourceRoot":""}