{"version":3,"sources":["webpack:///src/modules/iframe/iframe.tsx?d14a","webpack:///src/modules/iframe/iframe.view.tsx?dd86","webpack:///external \"React\"?c481","webpack:///external \"ReactDOM\"?4b2d","webpack:///./lib/iframe/module-registration.js?bdea"],"names":["Iframe","React","constructor","props","super","this","iframeRef","render","config","resources","isConsentGiven","context","request","cookies","target","destinationUrl","srcURL","URL","error","telemetry","exception","protocol","toLocaleLowerCase","iframeClassName","classnames","className","viewProps","Heading","_createHeading","heading","IframeContainer","moduleProps","IFrame","_createIframe","cookieConsentAccepted","alert","_renderAlert","cookieConsentRequiredMessage","renderView","text","length","message","role","targetURL","src","height","iframeAriaLabel","ref","IFrameView","Module","module","exports","ReactDOM","binding","modules","dataActions","c","require","$type","da","iNM","ns","n","p","pdp","md","window","__bindings__","viewDictionary","cn"],"mappings":"+xBAwBA,MAAMA,UAAeC,gBAGjBC,YAAYC,GACRC,MAAMD,GACNE,KAAKC,UAAYL,cAGdM,SACH,MAAM,OAAEC,EAAM,UAAEC,GAAcJ,KAAKF,MAC7BO,EACFL,KAAKF,MAAMQ,QAAQC,SACnBP,KAAKF,MAAMQ,QAAQC,QAAQC,SAC3BR,KAAKF,MAAMQ,QAAQC,QAAQC,QAAQH,gBACnCL,KAAKF,MAAMQ,QAAQC,QAAQC,QAAQH,iBAEvC,KAAMF,GAAUA,EAAOM,QAAUN,EAAOM,OAAOC,gBAC3C,OAAO,KAGX,IAAIC,EACJ,IACIA,EAAS,IAAIC,IAAIT,EAAOM,OAAOC,gBACjC,MAAOG,GAEL,OADAb,KAAKF,MAAMgB,UAAUC,UAAUF,GACxB,KAGX,GAAIF,GAAUA,EAAOK,UAAoD,WAAxCL,EAAOK,SAASC,oBAC7C,OAAO,KAEX,MAAMC,EAAkBC,IAAW,YAAahB,EAAOiB,WAEvD,IAAIC,EAAS,OACLrB,KAAKF,OAAqC,IAC9CwB,QAAStB,KAAKuB,eAAepB,EAAOqB,SACpCC,gBAAiB,CACbC,YAAa1B,KAAKF,M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AOC,aAAaZ,aAAe,IACnCF,EAAQE,aAEY,MAAMa,EAAiB,GAC9BA,EAAe,2DAA6D,CACpFZ,EAAG,IAAMC,EAAQ,QACjBY,GAAI,4CAEpBH,OAAOC,aAAeD,OAAOC,cAAgB,GAC7CD,OAAOC,aAAaC,eAAc,OACPF,OAAOC,aAAaC,gBAAkB,IACtCA,K","file":"static/js/92.e7f5f0f792a1dbdc2b19.chunk.js","sourcesContent":["/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Heading, IModuleProps } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { IHeadingData, IIframeConfig, IIframeProps } from './iframe.props.autogenerated';\n\nexport interface IIframeViewProps extends IIframeProps {\n Heading: React.ReactNode;\n IframeContainer: IModuleProps;\n IFrame: React.ReactNode;\n alert?: React.ReactNode;\n cookieConsentAccepted?: boolean;\n}\n\n/**\n *\n * Iframe component.\n * @extends {React.PureComponent}\n */\nclass Iframe extends React.PureComponent> {\n private readonly iframeRef: React.RefObject;\n\n constructor(props: IIframeProps) {\n super(props);\n this.iframeRef = React.createRef();\n }\n\n public render(): JSX.Element | null {\n const { config, resources } = this.props;\n const isConsentGiven =\n this.props.context.request &&\n this.props.context.request.cookies &&\n this.props.context.request.cookies.isConsentGiven &&\n this.props.context.request.cookies.isConsentGiven();\n\n if (!(config && config.target && config.target.destinationUrl)) {\n return null;\n }\n\n let srcURL;\n try {\n srcURL = new URL(config.target.destinationUrl);\n } catch (error) {\n this.props.telemetry.exception(error);\n return null;\n }\n\n if (srcURL && srcURL.protocol && srcURL.protocol.toLocaleLowerCase() !== 'https:') {\n return null;\n }\n const iframeClassName = classnames('ms-iframe', config.className);\n\n let viewProps: IIframeViewProps = {\n ...(this.props as IIframeProps),\n Heading: this._createHeading(config.heading!),\n IframeContainer: {\n moduleProps: this.props,\n className: iframeClassName\n },\n IFrame: this._createIframe()\n };\n\n if (!isConsentGiven) {\n viewProps = {\n ...viewProps,\n alert: this._renderAlert(resources.cookieConsentRequiredMessage)\n };\n } else {\n viewProps = {\n ...viewProps,\n cookieConsentAccepted: true\n };\n }\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private _createHeading(heading: IHeadingData): React.ReactNode | null {\n if (!heading || !heading.text || heading.text.length === 0) {\n return null;\n }\n\n return (\n \n );\n }\n\n private _renderAlert(message: string): React.ReactNode | null {\n return (\n

\n {message}\n

);\n }\n\n private _createIframe(): React.ReactNode | null {\n const { config } = this.props;\n const targetURL = config.target.destinationUrl;\n\n return (\n\n \n );\n }\n\n}\n\nexport default Iframe;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Module } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IIframeViewProps } from './iframe';\n\n/**\n *\n * IFrameView component.\n * @extends {React.PureComponent}\n */\nexport class IFrameView extends React.PureComponent {\n\n public render(): JSX.Element | null {\n const { Heading, IframeContainer, IFrame, alert, cookieConsentAccepted } = this.props;\n\n return (\n \n {alert}\n {cookieConsentAccepted && cookieConsentAccepted ? (\n <>\n {Heading}\n {IFrame}\n ) : null}\n \n );\n }\n}\nexport default IFrameView;\n","module.exports = React;","module.exports = ReactDOM;","const binding = { modules: {}, dataActions: {} };\n\n (binding.modules['iframe'] = {\n c: () => require('@msdyn365-commerce-modules/iframe/dist/lib/modules/iframe/iframe'),\n $type: 'contentModule',\n da: [],\n \n iNM: true,\n ns: '@msdyn365-commerce-modules',\n n: 'iframe',\n p: 'iframe',\n \n pdp: '',\n \n \n md: 'node_modules/@msdyn365-commerce-modules/iframe/dist/lib/modules/iframe'\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['@msdyn365-commerce-modules|iframe|modules|iframe|iframe'] = {\n c: () => require('@msdyn365-commerce-modules/iframe/dist/lib/modules/iframe/iframe.view.js'),\n cn: '@msdyn365-commerce-modules-iframe-iframe'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };"],"sourceRoot":""}