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GAC7CD,OAAOC,aAAab,QAAOc,EAAAA,EAAA,GACpBF,OAAOC,aAAab,SAAW,IAC/BD,EAAQC,SAGXY,OAAOC,aAAaZ,YAAWa,EAAAA,EAAA,GAC5BF,OAAOC,aAAaZ,aAAe,IACnCF,EAAQE,iCC5BnBc,EAAOC,QAAUxD,2BCAjBuD,EAAOC,QAAUC","sources":["webpack://bestseller.commerce.online/./src/modules/ext-external-script/ext-external-script.tsx?5b7c","webpack://bestseller.commerce.online/./lib/ext-external-script/module-registration.js?bebc","webpack://bestseller.commerce.online/external var \"React\"?0d3b","webpack://bestseller.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\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 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 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 if (isRelativeUrl(source)) {\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 let scriptAttr = '';\r\n config.scriptAttributes?.forEach(attr => {\r\n scriptAttr += `${attr.attributeKey}='${attr.attributeValue}' `;\r\n });\r\n const scriptHtml = ``;\r\n return React.createElement(SDK_FRAGMENT_NAME, { key: this.props.id, dangerouslySetInnerHTML: { __html: scriptHtml } });\r\n }\r\n}\r\nexport default DefaultExternalScript;\r\n\r\nconst isRelativeUrl = (source: string): boolean => {\r\n return /^(?!www\\.|(?:http|ftp)s?:\\/\\/|[A-Za-z]:\\\\|\\/\\/).*(\\.js){1}$/.test(source);\r\n};\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","isRelativeUrl","path","isAbsoluteUrl","error","scriptAttr","scriptAttributes","forEach","attr","attributeKey","attributeValue","scriptHtml","async","defer","SDK_FRAGMENT_NAME","key","dangerouslySetInnerHTML","__html","test","binding","modules","dataActions","c","require","$type","da","iNM","ns","n","p","pdp","md","window","__bindings__","_objectSpread","module","exports","ReactDOM"],"sourceRoot":""}