File: D:/HostingSpaces/SBogers10/base.komma.pro/node_modules/@sentry/utils/dist/supports.js.map
{"version":3,"file":"supports.js","sourceRoot":"","sources":["../src/supports.ts"],"names":[],"mappings":";AAAA,mCAAkC;AAClC,+BAAyC;AAEzC;;;;;GAKG;AACH,SAAgB,kBAAkB;IAChC,IAAI;QACF,sCAAsC;QACtC,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;QACnB,OAAO,IAAI,CAAC;KACb;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AARD,gDAQC;AAED;;;;;GAKG;AACH,SAAgB,gBAAgB;IAC9B,IAAI;QACF,qCAAqC;QACrC,qEAAqE;QACrE,2CAA2C;QAC3C,aAAa;QACb,sCAAsC;QACtC,IAAI,QAAQ,CAAC,EAAE,CAAC,CAAC;QACjB,OAAO,IAAI,CAAC;KACb;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AAZD,4CAYC;AAED;;;;;GAKG;AACH,SAAgB,oBAAoB;IAClC,IAAI;QACF,sCAAsC;QACtC,IAAI,YAAY,CAAC,EAAE,CAAC,CAAC;QACrB,OAAO,IAAI,CAAC;KACb;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AARD,oDAQC;AAED;;;;;GAKG;AACH,SAAgB,aAAa;IAC3B,IAAI,CAAC,CAAC,OAAO,IAAI,sBAAe,EAAU,CAAC,EAAE;QAC3C,OAAO,KAAK,CAAC;KACd;IAED,IAAI;QACF,gDAAgD;QAChD,IAAI,OAAO,EAAE,CAAC;QACd,gDAAgD;QAChD,IAAI,OAAO,CAAC,EAAE,CAAC,CAAC;QAChB,gDAAgD;QAChD,IAAI,QAAQ,EAAE,CAAC;QACf,OAAO,IAAI,CAAC;KACb;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AAhBD,sCAgBC;AACD;;GAEG;AAC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BAAe,EAAE,CAAC;AAClD,CAAC;AAHD,8DAGC;AAED;;;;;GAKG;AACH,SAAgB,sBAAsB;IACpC,wHAAwH;IACxH,4CAA4C;IAC5C,2EAA2E;IAC3E,yDAAyD;IAEzD,IAAI,CAAC,aAAa,EAAE,EAAE;QACpB,OAAO,KAAK,CAAC;KACd;IAED,IAAI;QACF,sCAAsC;QACtC,IAAI,OAAO,CAAC,GAAG,EAAE;YACf,cAAc,EAAE,QAA0B;SAC3C,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;KACb;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AAnBD,wDAmBC;AAED;;;;;GAKG;AACH,SAAgB,eAAe;IAC7B,4EAA4E;IAC5E,kFAAkF;IAClF,wEAAwE;IACxE,IAAM,MAAM,GAAG,sBAAe,EAAU,CAAC;IACzC,IAAM,MAAM,GAAI,MAAc,CAAC,MAAM,CAAC;IACtC,yCAAyC;IACzC,IAAM,mBAAmB,GAAG,MAAM,IAAI,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;IACvE,IAAM,aAAa,GAAG,SAAS,IAAI,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC;IAEzG,OAAO,CAAC,mBAAmB,IAAI,aAAa,CAAC;AAC/C,CAAC;AAXD,0CAWC","sourcesContent":["import { logger } from './logger';\nimport { getGlobalObject } from './misc';\n\n/**\n * Tells whether current environment supports ErrorEvent objects\n * {@link supportsErrorEvent}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsErrorEvent(): boolean {\n try {\n // tslint:disable:no-unused-expression\n new ErrorEvent('');\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Tells whether current environment supports DOMError objects\n * {@link supportsDOMError}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsDOMError(): boolean {\n try {\n // It really needs 1 argument, not 0.\n // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError':\n // 1 argument required, but only 0 present.\n // @ts-ignore\n // tslint:disable:no-unused-expression\n new DOMError('');\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Tells whether current environment supports DOMException objects\n * {@link supportsDOMException}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsDOMException(): boolean {\n try {\n // tslint:disable:no-unused-expression\n new DOMException('');\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Tells whether current environment supports Fetch API\n * {@link supportsFetch}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsFetch(): boolean {\n if (!('fetch' in getGlobalObject<Window>())) {\n return false;\n }\n\n try {\n // tslint:disable-next-line:no-unused-expression\n new Headers();\n // tslint:disable-next-line:no-unused-expression\n new Request('');\n // tslint:disable-next-line:no-unused-expression\n new Response();\n return true;\n } catch (e) {\n return false;\n }\n}\n/**\n * isNativeFetch checks if the given function is a native implementation of fetch()\n */\nfunction isNativeFetch(func: Function): boolean {\n return func && /^function fetch\\(\\)\\s+\\{\\s+\\[native code\\]\\s+\\}$/.test(func.toString());\n}\n\n/**\n * Tells whether current environment supports Fetch API natively\n * {@link supportsNativeFetch}.\n *\n * @returns true if `window.fetch` is natively implemented, false otherwise\n */\nexport function supportsNativeFetch(): boolean {\n if (!supportsFetch()) {\n return false;\n }\n\n const global = getGlobalObject<Window>();\n\n // Fast path to avoid DOM I/O\n // tslint:disable-next-line:no-unbound-method\n if (isNativeFetch(global.fetch)) {\n return true;\n }\n\n // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension)\n // so create a \"pure\" iframe to see if that has native fetch\n let result = false;\n const doc = global.document;\n // tslint:disable-next-line:no-unbound-method deprecation\n if (doc && typeof (doc.createElement as unknown) === `function`) {\n try {\n const sandbox = doc.createElement('iframe');\n sandbox.hidden = true;\n doc.head.appendChild(sandbox);\n if (sandbox.contentWindow && sandbox.contentWindow.fetch) {\n // tslint:disable-next-line:no-unbound-method\n result = isNativeFetch(sandbox.contentWindow.fetch);\n }\n doc.head.removeChild(sandbox);\n } catch (err) {\n logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err);\n }\n }\n\n return result;\n}\n\n/**\n * Tells whether current environment supports ReportingObserver API\n * {@link supportsReportingObserver}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsReportingObserver(): boolean {\n // tslint:disable-next-line: no-unsafe-any\n return 'ReportingObserver' in getGlobalObject();\n}\n\n/**\n * Tells whether current environment supports Referrer Policy API\n * {@link supportsReferrerPolicy}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsReferrerPolicy(): boolean {\n // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default\n // https://caniuse.com/#feat=referrer-policy\n // It doesn't. And it throw exception instead of ignoring this parameter...\n // REF: https://github.com/getsentry/raven-js/issues/1233\n\n if (!supportsFetch()) {\n return false;\n }\n\n try {\n // tslint:disable:no-unused-expression\n new Request('_', {\n referrerPolicy: 'origin' as ReferrerPolicy,\n });\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Tells whether current environment supports History API\n * {@link supportsHistory}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsHistory(): boolean {\n // NOTE: in Chrome App environment, touching history.pushState, *even inside\n // a try/catch block*, will cause Chrome to output an error to console.error\n // borrowed from: https://github.com/angular/angular.js/pull/13945/files\n const global = getGlobalObject<Window>();\n const chrome = (global as any).chrome;\n // tslint:disable-next-line:no-unsafe-any\n const isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n const hasHistoryApi = 'history' in global && !!global.history.pushState && !!global.history.replaceState;\n\n return !isChromePackagedApp && hasHistoryApi;\n}\n"]}