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A,EAAA,GACpBF,OAAOC,aAAab,SAAW,IAC/BD,EAAQC,SAGXY,OAAOC,aAAaZ,YAAWa,EAAAA,EAAA,GAC5BF,OAAOC,aAAaZ,aAAe,IACnCF,EAAQE,iCC5BnBc,EAAOC,QAAUvD,2BCAjBsD,EAAOC,QAAUC","sources":["webpack://Msdyn365.Commerce.Online/./src/modules/ext-external-script/ext-external-script.tsx?5b7c","webpack://Msdyn365.Commerce.Online/./lib/ext-external-script/module-registration.js?bebc","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 in the project root for license information.\r\n */\r\n\r\n// import { isAbsoluteUrl } from '@msdyn365-commerce/core';\r\n// import { isNonceEnabled, SDK_FRAGMENT_NAME } from '@msdyn365-commerce/core-internal';\r\n// import { SDK_FRAGMENT_NAME } from '@msdyn365-commerce/core-internal';\r\n// import * as React from 'react';\r\n// import { IExtScriptBlockProps } from './ext-script-block.props.autogenerated';\r\n\r\nimport { SDK_FRAGMENT_NAME, msdyn365Commerce } from '@msdyn365-commerce/core-internal';\r\nimport * as path from 'path';\r\nimport * as React from 'react';\r\nimport { isAbsoluteUrl } from '@msdyn365-commerce/core';\r\nimport { IExtExternalScriptProps } from './ext-external-script.props.autogenerated';\r\n\r\n/**\r\n *\r\n * DefaultExternalScript component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass DefaultExternalScript extends React.PureComponent> {\r\n constructor(props: IExtExternalScriptProps<{}>) {\r\n super(props);\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const { config } = this.props;\r\n this.props.telemetry.debug(`Adding script tags for '${this.props.id}/${this.props.typeName}'`, this.props.telemetry);\r\n let source = config.scriptSource;\r\n\r\n let relativeBaseUrl: string = '';\r\n // Construct the relative base url, i.e. the base url from which statics will be served\r\n if (this.props.context) {\r\n relativeBaseUrl += this.props.context.request.url.staticCdnUrl;\r\n relativeBaseUrl += msdyn365Commerce.getEnvironmentVariable('SUBMISSIONID') || '';\r\n }\r\n\r\n if (!source.includes('https')) {\r\n // If the source is a relative URL prepend the relative base url to the resolved source url for the actual source\r\n source = `${relativeBaseUrl}/${path.join(source)}`;\r\n } else if (source === '' || !isAbsoluteUrl(source)) {\r\n this.props.telemetry.error(\r\n 'Invalid external script - not a url. The external source is not an external or relative url, please use default-inline-script if you wish to load inline scripts',\r\n this.props.telemetry\r\n );\r\n return null;\r\n }\r\n\r\n let scriptAttr = '';\r\n config.scriptAttributes?.forEach(attr => {\r\n scriptAttr += `${attr.attributeKey}='${attr.attributeValue}' `;\r\n });\r\n\r\n const scriptHtml = ``;\r\n\r\n return React.createElement(SDK_FRAGMENT_NAME, { key: this.props.id, dangerouslySetInnerHTML: { __html: scriptHtml } });\r\n }\r\n}\r\n\r\nexport default DefaultExternalScript;\r\n","const binding = { modules: {}, dataActions: {} };\n\n (binding.modules['ext-external-script'] = {\n c: () => require('partner/modules/ext-external-script/ext-external-script.tsx'),\n $type: 'scriptModule',\n da: [],\n \n iNM: false,\n ns: '__local__',\n n: 'ext-external-script',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/ext-external-script'\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 };","module.exports = React;","module.exports = ReactDOM;"],"names":["DefaultExternalScript","React","constructor","props","super","render","_config$scriptAttribu","config","this","telemetry","debug","id","typeName","source","scriptSource","relativeBaseUrl","context","request","url","staticCdnUrl","msdyn365Commerce","getEnvironmentVariable","includes","isAbsoluteUrl","error","path","scriptAttr","scriptAttributes","forEach","attr","attributeKey","attributeValue","scriptHtml","async","defer","SDK_FRAGMENT_NAME","key","dangerouslySetInnerHTML","__html","binding","modules","dataActions","c","require","$type","da","iNM","ns","n","p","pdp","md","window","__bindings__","_objectSpread","module","exports","ReactDOM"],"sourceRoot":""}