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GC1CO,MAAMhB,EAAW,CAACuB,EAAsBpB,KAC3CA,GAAaA,EAAUqB,IAAIC,EAAAA,GAAAA,MAAgBF,IAGlCR,EAAW,CAACW,EAAsBvB,KAC3CA,GAAaA,EAAUqB,IAAIC,EAAAA,GAAAA,MAAgBC,IAQlCZ,EAAiBV,GACnB,kFAAkFuB,KAAKvB,GAGrFQ,EAAiBR,GACnB,8DAA8DuB,KAAKvB,uBCzB9EwB,EAAOC,QAAUpC,2BCAjBmC,EAAOC,QAAUC","sources":["webpack://mattressfirm/./lib/default-external-script/module-registration.js?996f","webpack://mattressfirm/./src/modules/default-external-script/default-external-script.tsx?2a33","webpack://mattressfirm/./src/utils/script-utils.ts?cb52","webpack://mattressfirm/external var \"React\"?0d3b","webpack://mattressfirm/external var \"ReactDOM\"?853b"],"sourcesContent":["const binding = { modules: {}, dataActions: {} };\n\n (binding.modules['default-external-script'] = {\n c: () => require('@msdyn365-commerce-modules/core-components/dist/lib/modules/default-external-script/default-external-script'),\n $type: 'scriptModule',\n da: [],\n \n iNM: true,\n ns: '@msdyn365-commerce-modules',\n n: 'default-external-script',\n p: 'core-components',\n \n pdp: '',\n \n \n md: 'node_modules/@msdyn365-commerce-modules/core-components/dist/lib/modules/default-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 };","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { SDK_FRAGMENT_NAME, msdyn365Commerce } from '@msdyn365-commerce/core-internal';\nimport * as path from 'path';\nimport * as React from 'react';\nimport { isAbsoluteUrl, isRelativeUrl, logDebug, logError } from '../../utils/script-utils';\nimport { IDefaultExternalScriptProps } from './default-external-script.props.autogenerated';\n\n/**\n *\n * DefaultExternalScript component\n * @extends {React.PureComponent>}\n */\nclass DefaultExternalScript extends React.PureComponent> {\n constructor(props: IDefaultExternalScriptProps<{}>) {\n super(props);\n }\n\n public render(): JSX.Element | null {\n const { config } = this.props;\n logDebug(`Adding script tags for '${this.props.id}/${this.props.typeName}'`, this.props.telemetry);\n let source = config.scriptSource;\n\n let relativeBaseUrl: string = '';\n // Construct the relative base url, i.e. the base url from which statics will be served\n if (this.props.context) {\n relativeBaseUrl += this.props.context.request.url.staticCdnUrl;\n relativeBaseUrl += msdyn365Commerce.getEnvironmentVariable('SUBMISSIONID') || '';\n }\n\n if (isRelativeUrl(source)) {\n // If the source is a relative URL prepend the relative base url to the resolved source url for the actual source\n source = `${relativeBaseUrl}/${path.join(source)}`;\n } else if (source === '' || !isAbsoluteUrl(source)) {\n logError(\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',\n this.props.telemetry\n );\n return null;\n }\n const scriptHtml = ``;\n\n return React.createElement(SDK_FRAGMENT_NAME, { key: this.props.id, dangerouslySetInnerHTML: { __html: scriptHtml } });\n }\n}\n\nexport default DefaultExternalScript;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IInternalTelemetry, LogLevel } from '@msdyn365-commerce/telemetry-internal';\n\nexport const logDebug = (debugMessage: string, telemetry: IInternalTelemetry | undefined): void => {\n telemetry && telemetry.log(LogLevel.Debug, debugMessage);\n};\n\nexport const logError = (errorMessage: string, telemetry: IInternalTelemetry | undefined): void => {\n telemetry && telemetry.log(LogLevel.Error, errorMessage);\n};\n\n/**\n * Returns true if the given string matches an URL pattern\n *\n * @param source The string to check against\n */\nexport const isAbsoluteUrl = (source: string): boolean => {\n return /^(http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?$/.test(source);\n};\n\nexport const isRelativeUrl = (source: string): boolean => {\n return /^(?!www\\.|(?:http|ftp)s?:\\/\\/|[A-Za-z]:\\\\|\\/\\/).*(\\.js){1}$/.test(source);\n};\n","module.exports = React;","module.exports = ReactDOM;"],"names":["binding","modules","dataActions","c","require","$type","da","iNM","ns","n","p","pdp","md","window","__bindings__","DefaultExternalScript","React","constructor","props","super","render","config","this","logDebug","id","typeName","telemetry","source","scriptSource","relativeBaseUrl","context","request","url","staticCdnUrl","msdyn365Commerce","isRelativeUrl","path","isAbsoluteUrl","logError","scriptHtml","async","defer","SDK_FRAGMENT_NAME","key","dangerouslySetInnerHTML","__html","debugMessage","log","LogLevel","errorMessage","test","module","exports","ReactDOM"],"sourceRoot":""}