diff --git a/.gitignore b/.gitignore
index 06118bb..ecd9a56 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,8 @@
npm-debug.log*
.DS_Store
.idea
+node_modules
+
+
+# Added by Homey CLI
+/.homeybuild/
\ No newline at end of file
diff --git a/app.js b/app.js
index ea8be42..86b17e3 100644
--- a/app.js
+++ b/app.js
@@ -1,21 +1,19 @@
// eslint-disable-next-line import/no-unresolved
const Homey = require('homey');
const Mill = require('./lib/mill');
-const { debug } = require('./lib/util');
-
+const {debug} = require('./../../lib/util');
class MillApp extends Homey.App {
onInit() {
this.millApi = new Mill();
this.user = null;
this.isAuthenticated = false;
this.isAuthenticating = false;
-
- debug(`${Homey.manifest.id} is running..`);
+ debug(this.homey,`${Homey.manifest.id} is running..`);
}
async connectToMill() {
- const username = Homey.ManagerSettings.get('username');
- const password = Homey.ManagerSettings.get('password');
+ const username = this.homey.settings.get('username');
+ const password = this.homey.settings.get('password');
return this.authenticate(username, password);
}
@@ -26,7 +24,7 @@ class MillApp extends Homey.App {
this.isAuthenticating = true;
this.user = await this.millApi.login(username, password) || null;
this.isAuthenticated = true;
- debug('Mill authenticated');
+ debug(this.homey,'Mill authenticated');
return true;
} finally {
this.isAuthenticating = false;
diff --git a/app.json b/app.json
index ccd59d9..f31a817 100644
--- a/app.json
+++ b/app.json
@@ -1,11 +1,12 @@
{
"id": "com.mill",
"version": "1.0.8",
- "compatibility": ">=1.5.0",
- "sdk": 2,
+ "compatibility": ">=5.0.0",
+ "sdk": 3,
"name": {
"en": "Mill WiFi"
},
+ "brandColor": "#20DFCB",
"tags": {
"en": [
"mill",
diff --git a/drivers/mill/device.js b/drivers/mill/device.js
index ec2635f..1c0415f 100644
--- a/drivers/mill/device.js
+++ b/drivers/mill/device.js
@@ -1,14 +1,14 @@
// eslint-disable-next-line import/no-unresolved
const Homey = require('homey');
-const { Log } = require('./../../lib/log');
-const { debug, error } = require('./../../lib/util');
const Room = require('./../../lib/models');
+const { Log } = require('./../../lib/log');
+const {debug,error} = require('./../../lib/util');
class MillDevice extends Homey.Device {
onInit() {
this.deviceId = this.getData().id;
- debug(`[${this.getName()}] ${this.getClass()} (${this.deviceId}) initialized`);
+ debug(this.homey,`[${this.getName()}] ${this.getClass()} (${this.deviceId}) initialized`);
// Add new capailities for devices that don't have them yet
if (!this.getCapabilities().includes('onoff')) {
@@ -24,31 +24,26 @@ class MillDevice extends Homey.Device {
this.registerCapabilityListener('onoff', this.onCapabilityOnOff.bind(this));
// triggers
- this.modeChangedTrigger = new Homey.FlowCardTriggerDevice('mill_mode_changed');
- this.modeChangedTrigger.register();
-
- this.modeChangedToTrigger = new Homey.FlowCardTriggerDevice('mill_mode_changed_to');
+ this.modeChangedTrigger = this.homey.flow.getDeviceTriggerCard('mill_mode_changed');
+
+ this.modeChangedToTrigger = this.homey.flow.getDeviceTriggerCard('mill_mode_changed_to');
this.modeChangedToTrigger
- .register()
.registerRunListener((args, state) => args.mill_mode === state.mill_mode);
// conditions
- this.isHeatingCondition = new Homey.FlowCardCondition('mill_is_heating');
+ this.isHeatingCondition =this.homey.flow.getConditionCard('mill_is_heating');
this.isHeatingCondition
- .register()
.registerRunListener(() => (this.room && this.room.heatStatus === 1));
- this.isMatchingModeCondition = new Homey.FlowCardCondition('mill_mode_matching');
+ this.isMatchingModeCondition = this.homey.flow.getConditionCard('mill_mode_matching');
this.isMatchingModeCondition
- .register()
.registerRunListener(args => (args.mill_mode === this.room.modeName));
// actions
- this.setProgramAction = new Homey.FlowCardAction('mill_set_mode');
+ this.setProgramAction = this.homey.flow.getActionCard('mill_set_mode');
this.setProgramAction
- .register()
.registerRunListener((args) => {
- debug(`[${args.device.getName()}] Flow changed mode to ${args.mill_mode}`);
+ debug(this.homey,`[${args.device.getName()}] Flow changed mode to ${args.mill_mode}`);
return args.device.setThermostatMode(args.mill_mode);
});
@@ -58,7 +53,7 @@ class MillDevice extends Homey.Device {
}
async refreshState() {
- debug(`[${this.getName()}] Refreshing state`);
+ debug(this.homey,`[${this.getName()}] Refreshing state`);
if (this.refreshTimeout) {
clearTimeout(this.refreshTimeout);
@@ -66,20 +61,20 @@ class MillDevice extends Homey.Device {
}
try {
- if (Homey.app.isConnected()) {
+ if (this.homey.app.isConnected()) {
await this.refreshMillService();
this.setAvailable();
} else {
- debug(`[${this.getName()}] Mill not connected`);
+ debug(this.homey,`[${this.getName()}] Mill not connected`);
this.setUnavailable();
- await Homey.app.connectToMill().then(() => {
+ await this.homey.app.connectToMill().then(() => {
this.scheduleRefresh(10);
}).catch((err) => {
- error('Error caught while refreshing state', err);
+ error(this.homey,'Error caught while refreshing state', err);
});
}
} catch (e) {
- error('Exception caught', e);
+ error(this.homey,'Exception caught', e);
Log.captureException(e);
} finally {
if (this.refreshTimeout === null) {
@@ -89,17 +84,17 @@ class MillDevice extends Homey.Device {
}
scheduleRefresh(interval) {
- const refreshInterval = interval || Homey.ManagerSettings.get('interval');
+ const refreshInterval = interval || this.homey.settings.get('interval');
this.refreshTimeout = setTimeout(this.refreshState.bind(this), refreshInterval * 1000);
- debug(`[${this.getName()}] Next refresh in ${refreshInterval} seconds`);
+ debug(this.homey,`[${this.getName()}] Next refresh in ${refreshInterval} seconds`);
}
async refreshMillService() {
- const millApi = Homey.app.getMillApi();
+ const millApi = this.homey.app.getMillApi();
return millApi.listDevices(this.getData().id)
.then((room) => {
- debug(`[${this.getName()}] Mill state refreshed`, {
+ debug(this.homey,`[${this.getName()}] Mill state refreshed`, {
comfortTemp: room.comfortTemp,
awayTemp: room.awayTemp,
holidayTemp: room.holidayTemp,
@@ -112,7 +107,7 @@ class MillDevice extends Homey.Device {
if (room.programMode !== undefined) {
if (this.room && !this.room.modesMatch(room) && this.room.modeName !== room.modeName) {
- debug(`[${this.getName()}] Triggering mode change from ${this.room.modeName} to ${room.modeName}`);
+ debug(this.homey,`[${this.getName()}] Triggering mode change from ${this.room.modeName} to ${room.modeName}`);
// not needed, setCapabilityValue will trigger
// this.modeChangedTrigger.trigger(this, { mill_mode: room.modeName })
// .catch(this.error);
@@ -142,43 +137,43 @@ class MillDevice extends Homey.Device {
});
}
}).catch((err) => {
- error(`[${this.getName()}] Error caught while refreshing state`, err);
+ error(this.homey,`[${this.getName()}] Error caught while refreshing state`, err);
});
}
onAdded() {
- debug('device added', this.getState());
+ debug(this.homey,'device added', this.getState());
}
onDeleted() {
clearTimeout(this.refreshTimeout);
- debug('device deleted', this.getState());
+ debug(this.homey,'device deleted', this.getState());
}
onCapabilityTargetTemperature(value, opts, callback) {
- debug(`onCapabilityTargetTemperature(${value})`);
+ debug(this.homey,`onCapabilityTargetTemperature(${value})`);
const temp = Math.ceil(value);
if (temp !== value && this.room.modeName !== 'Off') { // half degrees isn't supported by Mill, need to round it up
this.setCapabilityValue('target_temperature', temp);
- debug(`onCapabilityTargetTemperature(${value}=>${temp})`);
+ debug(this.homey,`onCapabilityTargetTemperature(${value}=>${temp})`);
}
- const millApi = Homey.app.getMillApi();
+ const millApi = this.homey.app.getMillApi();
this.room.targetTemp = temp;
millApi.changeRoomTemperature(this.deviceId, this.room)
.then(() => {
- debug(`onCapabilityTargetTemperature(${temp}) done`);
- debug(`[${this.getName()}] Changed temp to ${temp}: currentMode: ${this.room.currentMode}/${this.room.programMode}, comfortTemp: ${this.room.comfortTemp}, awayTemp: ${this.room.awayTemp}, avgTemp: ${this.room.avgTemp}, sleepTemp: ${this.room.sleepTemp}`);
+ debug(this.homey,`onCapabilityTargetTemperature(${temp}) done`);
+ debug(this.homey,`[${this.getName()}] Changed temp to ${temp}: currentMode: ${this.room.currentMode}/${this.room.programMode}, comfortTemp: ${this.room.comfortTemp}, awayTemp: ${this.room.awayTemp}, avgTemp: ${this.room.avgTemp}, sleepTemp: ${this.room.sleepTemp}`);
callback(null, temp);
}).catch((err) => {
- debug(`onCapabilityTargetTemperature(${temp}) error`);
- debug(`[${this.getName()}] Change temp to ${temp} resultet in error`, err);
+ debug(this.homey,`onCapabilityTargetTemperature(${temp}) error`);
+ debug(this.homey,`[${this.getName()}] Change temp to ${temp} resultet in error`, err);
callback(err);
});
}
setThermostatMode(value) {
return new Promise((resolve, reject) => {
- const millApi = Homey.app.getMillApi();
+ const millApi = this.homey.app.getMillApi();
this.room.modeName = value;
const jobs = [];
if (this.room.modeName !== 'Off') {
@@ -187,10 +182,10 @@ class MillDevice extends Homey.Device {
jobs.push(millApi.changeRoomMode(this.deviceId, this.room.currentMode));
Promise.all(jobs).then(() => {
- debug(`[${this.getName()}] Changed mode to ${value}: currentMode: ${this.room.currentMode}/${this.room.programMode}, comfortTemp: ${this.room.comfortTemp}, awayTemp: ${this.room.awayTemp}, avgTemp: ${this.room.avgTemp}, sleepTemp: ${this.room.sleepTemp}`);
+ debug(this.homey,`[${this.getName()}] Changed mode to ${value}: currentMode: ${this.room.currentMode}/${this.room.programMode}, comfortTemp: ${this.room.comfortTemp}, awayTemp: ${this.room.awayTemp}, avgTemp: ${this.room.avgTemp}, sleepTemp: ${this.room.sleepTemp}`);
resolve(value);
}).catch((err) => {
- error(`[${this.getName()}] Change mode to ${value} resulted in error`, err);
+ error(this.homey,`[${this.getName()}] Change mode to ${value} resulted in error`, err);
reject(err);
});
});
diff --git a/drivers/mill/driver.js b/drivers/mill/driver.js
index 0c792ca..4121330 100644
--- a/drivers/mill/driver.js
+++ b/drivers/mill/driver.js
@@ -1,7 +1,6 @@
// eslint-disable-next-line import/no-unresolved
const Homey = require('homey');
-const { debug } = require('./../../lib/util');
-
+const {debug,error} = require('./../../lib/util');
class MillDriver extends Homey.Driver {
async onInit() {
}
@@ -9,17 +8,17 @@ class MillDriver extends Homey.Driver {
async onPairListDevices(data, callback) {
if (!Homey.app.isConnected()) {
// eslint-disable-next-line no-underscore-dangle
- debug('Unable to pair, not authenticated');
+ debug(this.homey,'Unable to pair, not authenticated');
callback(new Error(Homey.__('pair.messages.notAuthorized')));
} else {
- debug('Pairing');
+ debug(this.homey,'Pairing');
const millApi = Homey.app.getMillApi();
const homes = await millApi.listHomes();
- debug(`Found following homes: ${homes.homeList.map(home => `${home.homeName} (${home.homeId})`).join(', ')}`);
+ debug(this.homey,`Found following homes: ${homes.homeList.map(home => `${home.homeName} (${home.homeId})`).join(', ')}`);
const rooms = await Promise.all(homes.homeList.map(async (home) => {
const rooms = await millApi.listRooms(home.homeId);
- debug(`Found following rooms in ${home.homeName}: ${rooms.roomInfo.map(room => `${room.roomName} (${room.roomId})`).join(', ')}`);
+ debug(this.homey,`Found following rooms in ${home.homeName}: ${rooms.roomInfo.map(room => `${room.roomName} (${room.roomId})`).join(', ')}`);
return rooms.roomInfo.map(room => (
{
diff --git a/lib/mill.js b/lib/mill.js
index 96c42e4..d7bb06b 100644
--- a/lib/mill.js
+++ b/lib/mill.js
@@ -1,6 +1,6 @@
const crypto = require('crypto');
const Room = require('./models');
-const { fetchJSON } = require('./util');
+const {fetchJSON} = require('./util');
const TOKEN_SAFE_ZONE = 5 * 60 * 1000;
diff --git a/lib/util.js b/lib/util.js
index 5cc69f6..937b084 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -1,17 +1,16 @@
// eslint-disable-next-line import/no-unresolved
const fetch = require('node-fetch');
-const log = (severity, message, data) => {
+const log = (app,severity, message, data) => {
// Homey will not be available in tests
- let Homey;
try { Homey = require('homey'); } catch (e) {}
if (!Homey) {
console.log(`${severity}: ${message}`, data || '');
return;
}
-
- if (Homey.ManagerSettings.get('debug')) {
- const debugLog = Homey.ManagerSettings.get('debugLog') || [];
+ const debug = app.settings.get('debug');
+ if ( debug ) {
+ const debugLog = app.settings.get('debugLog') || [];
const entry = { registered: new Date().toLocaleString(), severity, message };
if (data) {
if (typeof data === 'string') {
@@ -27,22 +26,22 @@ const log = (severity, message, data) => {
if (debugLog.length > 100) {
debugLog.splice(0, 1);
}
- Homey.app.log(`${severity}: ${message}`, data || '');
- Homey.ManagerSettings.set('debugLog', debugLog);
- Homey.ManagerApi.realtime('debugLog', entry);
+ app.log(`${severity}: ${message}`, data || '');
+ app.settings.set('debugLog', debugLog);
+ app.api.realtime('debugLog', entry);
}
};
-const debug = (message, data) => {
- log('DEBUG', message, data);
+const debug = (app, message, data) => {
+ log(app,'DEBUG', message, data);
};
-const warn = (message, data) => {
- log('WARN', message, data);
+const warn = (app,message, data) => {
+ log(app,'WARN', message, data);
};
-const error = (message, data) => {
- log('ERROR', message, data);
+const error = (app,message, data) => {
+ log(app,'ERROR', message, data);
};
const fetchJSON = async (endpoint, options) => {
diff --git a/node_modules/@sentry/apm/README.md b/node_modules/@sentry/apm/README.md
deleted file mode 100644
index 1d03e21..0000000
--- a/node_modules/@sentry/apm/README.md
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-# Sentry APM Extensions
-
-[](https://www.npmjs.com/package/@sentry/apm)
-[](https://www.npmjs.com/package/@sentry/apm)
-[](https://www.npmjs.com/package/@sentry/apm)
-[](http://getsentry.github.io/sentry-javascript/)
-
-## Links
-
-- [Official SDK Docs](https://docs.sentry.io/quickstart/)
-- [TypeDoc](http://getsentry.github.io/sentry-javascript/)
-
-## General
-
-This package contains extensions to the `@sentry/hub` to enable APM related functionality. It also provides integrations for Browser and Node that provide a good experience out of the box.
diff --git a/node_modules/@sentry/apm/dist/hubextensions.d.ts b/node_modules/@sentry/apm/dist/hubextensions.d.ts
deleted file mode 100644
index 8b05a49..0000000
--- a/node_modules/@sentry/apm/dist/hubextensions.d.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-/**
- * This patches the global object and injects the APM extensions methods
- */
-export declare function addExtensionMethods(): void;
-//# sourceMappingURL=hubextensions.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/hubextensions.d.ts.map b/node_modules/@sentry/apm/dist/hubextensions.d.ts.map
deleted file mode 100644
index 69c4e45..0000000
--- a/node_modules/@sentry/apm/dist/hubextensions.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"hubextensions.d.ts","sourceRoot":"","sources":["../src/hubextensions.ts"],"names":[],"mappings":"AAsEA;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAW1C"}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/hubextensions.js b/node_modules/@sentry/apm/dist/hubextensions.js
deleted file mode 100644
index d737c7a..0000000
--- a/node_modules/@sentry/apm/dist/hubextensions.js
+++ /dev/null
@@ -1,78 +0,0 @@
-Object.defineProperty(exports, "__esModule", { value: true });
-var hub_1 = require("@sentry/hub");
-var utils_1 = require("@sentry/utils");
-var span_1 = require("./span");
-/**
- * Checks whether given value is instance of Span
- * @param span value to check
- */
-function isSpanInstance(span) {
- return utils_1.isInstanceOf(span, span_1.Span);
-}
-/** Returns all trace headers that are currently on the top scope. */
-function traceHeaders() {
- // @ts-ignore
- var that = this;
- var scope = that.getScope();
- if (scope) {
- var span = scope.getSpan();
- if (span) {
- return {
- 'sentry-trace': span.toTraceparent(),
- };
- }
- }
- return {};
-}
-/**
- * This functions starts a span. If argument passed is of type `Span`, it'll run sampling on it if configured
- * and attach a `SpanRecorder`. If it's of type `SpanContext` and there is already a `Span` on the Scope,
- * the created Span will have a reference to it and become it's child. Otherwise it'll crete a new `Span`.
- *
- * @param span Already constructed span which should be started or properties with which the span should be created
- */
-function startSpan(spanOrSpanContext, forceNoChild) {
- if (forceNoChild === void 0) { forceNoChild = false; }
- // @ts-ignore
- var that = this;
- var scope = that.getScope();
- var client = that.getClient();
- var span;
- if (!isSpanInstance(spanOrSpanContext) && !forceNoChild) {
- if (scope) {
- var parentSpan = scope.getSpan();
- if (parentSpan) {
- span = parentSpan.child(spanOrSpanContext);
- }
- }
- }
- if (!isSpanInstance(span)) {
- span = new span_1.Span(spanOrSpanContext, that);
- }
- if (span.sampled === undefined && span.transaction !== undefined) {
- var sampleRate = (client && client.getOptions().tracesSampleRate) || 0;
- span.sampled = Math.random() < sampleRate;
- }
- if (span.sampled) {
- var experimentsOptions = (client && client.getOptions()._experiments) || {};
- span.initFinishedSpans(experimentsOptions.maxSpans);
- }
- return span;
-}
-/**
- * This patches the global object and injects the APM extensions methods
- */
-function addExtensionMethods() {
- var carrier = hub_1.getMainCarrier();
- if (carrier.__SENTRY__) {
- carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};
- if (!carrier.__SENTRY__.extensions.startSpan) {
- carrier.__SENTRY__.extensions.startSpan = startSpan;
- }
- if (!carrier.__SENTRY__.extensions.traceHeaders) {
- carrier.__SENTRY__.extensions.traceHeaders = traceHeaders;
- }
- }
-}
-exports.addExtensionMethods = addExtensionMethods;
-//# sourceMappingURL=hubextensions.js.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/hubextensions.js.map b/node_modules/@sentry/apm/dist/hubextensions.js.map
deleted file mode 100644
index 4bd6e1b..0000000
--- a/node_modules/@sentry/apm/dist/hubextensions.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"hubextensions.js","sourceRoot":"","sources":["../src/hubextensions.ts"],"names":[],"mappings":";AAAA,mCAAkD;AAElD,uCAA6C;AAE7C,+BAA8B;AAE9B;;;GAGG;AACH,SAAS,cAAc,CAAC,IAAa;IACnC,OAAO,oBAAY,CAAC,IAAI,EAAE,WAAI,CAAC,CAAC;AAClC,CAAC;AAED,qEAAqE;AACrE,SAAS,YAAY;IACnB,aAAa;IACb,IAAM,IAAI,GAAG,IAAW,CAAC;IACzB,IAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC9B,IAAI,KAAK,EAAE;QACT,IAAM,IAAI,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC;QAC7B,IAAI,IAAI,EAAE;YACR,OAAO;gBACL,cAAc,EAAE,IAAI,CAAC,aAAa,EAAE;aACrC,CAAC;SACH;KACF;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED;;;;;;GAMG;AACH,SAAS,SAAS,CAAC,iBAAsC,EAAE,YAA6B;IAA7B,6BAAA,EAAA,oBAA6B;IACtF,aAAa;IACb,IAAM,IAAI,GAAG,IAAW,CAAC;IACzB,IAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,C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,EAAE;YAC5C,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,SAAS,GAAG,SAAS,CAAC;SACrD;QACD,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,YAAY,EAAE;YAC/C,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,YAAY,GAAG,YAAY,CAAC;SAC3D;KACF;AACH,CAAC;AAXD,kDAWC","sourcesContent":["import { getMainCarrier, Hub } from '@sentry/hub';\nimport { SpanContext } from '@sentry/types';\nimport { isInstanceOf } from '@sentry/utils';\n\nimport { Span } from './span';\n\n/**\n * Checks whether given value is instance of Span\n * @param span value to check\n */\nfunction isSpanInstance(span: unknown): span is Span {\n return isInstanceOf(span, Span);\n}\n\n/** Returns all trace headers that are currently on the top scope. */\nfunction traceHeaders(): { [key: string]: string } {\n // @ts-ignore\n const that = this as Hub;\n const scope = that.getScope();\n if (scope) {\n const span = scope.getSpan();\n if (span) {\n return {\n 'sentry-trace': span.toTraceparent(),\n };\n }\n }\n return {};\n}\n\n/**\n * This functions starts a span. If argument passed is of type `Span`, it'll run sampling on it if configured\n * and attach a `SpanRecorder`. If it's of type `SpanContext` and there is already a `Span` on the Scope,\n * the created Span will have a reference to it and become it's child. Otherwise it'll crete a new `Span`.\n *\n * @param span Already constructed span which should be started or properties with which the span should be created\n */\nfunction startSpan(spanOrSpanContext?: Span | SpanContext, forceNoChild: boolean = false): Span {\n // @ts-ignore\n const that = this as Hub;\n const scope = that.getScope();\n const client = that.getClient();\n let span;\n\n if (!isSpanInstance(spanOrSpanContext) && !forceNoChild) {\n if (scope) {\n const parentSpan = scope.getSpan() as Span;\n if (parentSpan) {\n span = parentSpan.child(spanOrSpanContext);\n }\n }\n }\n\n if (!isSpanInstance(span)) {\n span = new Span(spanOrSpanContext, that);\n }\n\n if (span.sampled === undefined && span.transaction !== undefined) {\n const sampleRate = (client && client.getOptions().tracesSampleRate) || 0;\n span.sampled = Math.random() < sampleRate;\n }\n\n if (span.sampled) {\n const experimentsOptions = (client && client.getOptions()._experiments) || {};\n span.initFinishedSpans(experimentsOptions.maxSpans as number);\n }\n\n return span;\n}\n\n/**\n * This patches the global object and injects the APM extensions methods\n */\nexport function addExtensionMethods(): void {\n const carrier = getMainCarrier();\n if (carrier.__SENTRY__) {\n carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};\n if (!carrier.__SENTRY__.extensions.startSpan) {\n carrier.__SENTRY__.extensions.startSpan = startSpan;\n }\n if (!carrier.__SENTRY__.extensions.traceHeaders) {\n carrier.__SENTRY__.extensions.traceHeaders = traceHeaders;\n }\n }\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/index.bundle.d.ts b/node_modules/@sentry/apm/dist/index.bundle.d.ts
deleted file mode 100644
index 01ba2bd..0000000
--- a/node_modules/@sentry/apm/dist/index.bundle.d.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-export { Breadcrumb, Request, SdkInfo, Event, Exception, Response, Severity, StackFrame, Stacktrace, Status, Thread, User, } from '@sentry/types';
-export { addGlobalEventProcessor, addBreadcrumb, captureException, captureEvent, captureMessage, configureScope, getHubFromCarrier, getCurrentHub, Hub, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, Transports, withScope, } from '@sentry/browser';
-export { BrowserOptions } from '@sentry/browser';
-export { BrowserClient, ReportDialogOptions } from '@sentry/browser';
-export { defaultIntegrations, forceLoad, init, lastEventId, onLoad, showReportDialog, flush, close, wrap, } from '@sentry/browser';
-export { SDK_NAME, SDK_VERSION } from '@sentry/browser';
-import * as ApmIntegrations from './integrations';
-export { Span, TRACEPARENT_REGEXP } from './span';
-declare const INTEGRATIONS: {
- Tracing: typeof ApmIntegrations.Tracing;
- GlobalHandlers: typeof import("../../browser/dist/integrations").GlobalHandlers;
- TryCatch: typeof import("../../browser/dist/integrations").TryCatch;
- Breadcrumbs: typeof import("../../browser/dist/integrations").Breadcrumbs;
- LinkedErrors: typeof import("../../browser/dist/integrations").LinkedErrors;
- UserAgent: typeof import("../../browser/dist/integrations").UserAgent;
- FunctionToString: typeof import("@sentry/core/dist/integrations").FunctionToString;
- InboundFilters: typeof import("@sentry/core/dist/integrations").InboundFilters;
-};
-export { INTEGRATIONS as Integrations };
-//# sourceMappingURL=index.bundle.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/index.bundle.d.ts.map b/node_modules/@sentry/apm/dist/index.bundle.d.ts.map
deleted file mode 100644
index 1ebca5a..0000000
--- a/node_modules/@sentry/apm/dist/index.bundle.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.bundle.d.ts","sourceRoot":"","sources":["../src/index.bundle.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,UAAU,EACV,MAAM,EACN,MAAM,EACN,IAAI,GACL,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,GAAG,EACH,KAAK,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,UAAU,EACV,SAAS,GACV,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EACL,mBAAmB,EACnB,SAAS,EACT,IAAI,EACJ,WAAW,EACX,MAAM,EACN,gBAAgB,EAChB,KAAK,EACL,KAAK,EACL,IAAI,GACL,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAMxD,OAAO,KAAK,eAAe,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAYlD,QAAA,MAAM,YAAY;;;;;;;;;CAIjB,CAAC;AAEF,OAAO,EAAE,YAAY,IAAI,YAAY,EAAE,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/index.bundle.js b/node_modules/@sentry/apm/dist/index.bundle.js
deleted file mode 100644
index c08a3e4..0000000
--- a/node_modules/@sentry/apm/dist/index.bundle.js
+++ /dev/null
@@ -1,59 +0,0 @@
-Object.defineProperty(exports, "__esModule", { value: true });
-var tslib_1 = require("tslib");
-var types_1 = require("@sentry/types");
-exports.Severity = types_1.Severity;
-exports.Status = types_1.Status;
-var browser_1 = require("@sentry/browser");
-exports.addGlobalEventProcessor = browser_1.addGlobalEventProcessor;
-exports.addBreadcrumb = browser_1.addBreadcrumb;
-exports.captureException = browser_1.captureException;
-exports.captureEvent = browser_1.captureEvent;
-exports.captureMessage = browser_1.captureMessage;
-exports.configureScope = browser_1.configureScope;
-exports.getHubFromCarrier = browser_1.getHubFromCarrier;
-exports.getCurrentHub = browser_1.getCurrentHub;
-exports.Hub = browser_1.Hub;
-exports.Scope = browser_1.Scope;
-exports.setContext = browser_1.setContext;
-exports.setExtra = browser_1.setExtra;
-exports.setExtras = browser_1.setExtras;
-exports.setTag = browser_1.setTag;
-exports.setTags = browser_1.setTags;
-exports.setUser = browser_1.setUser;
-exports.Transports = browser_1.Transports;
-exports.withScope = browser_1.withScope;
-var browser_2 = require("@sentry/browser");
-exports.BrowserClient = browser_2.BrowserClient;
-var browser_3 = require("@sentry/browser");
-exports.defaultIntegrations = browser_3.defaultIntegrations;
-exports.forceLoad = browser_3.forceLoad;
-exports.init = browser_3.init;
-exports.lastEventId = browser_3.lastEventId;
-exports.onLoad = browser_3.onLoad;
-exports.showReportDialog = browser_3.showReportDialog;
-exports.flush = browser_3.flush;
-exports.close = browser_3.close;
-exports.wrap = browser_3.wrap;
-var browser_4 = require("@sentry/browser");
-exports.SDK_NAME = browser_4.SDK_NAME;
-exports.SDK_VERSION = browser_4.SDK_VERSION;
-var browser_5 = require("@sentry/browser");
-var utils_1 = require("@sentry/utils");
-var hubextensions_1 = require("./hubextensions");
-var ApmIntegrations = require("./integrations");
-var span_1 = require("./span");
-exports.Span = span_1.Span;
-exports.TRACEPARENT_REGEXP = span_1.TRACEPARENT_REGEXP;
-var windowIntegrations = {};
-// This block is needed to add compatibility with the integrations packages when used with a CDN
-// tslint:disable: no-unsafe-any
-var _window = utils_1.getGlobalObject();
-if (_window.Sentry && _window.Sentry.Integrations) {
- windowIntegrations = _window.Sentry.Integrations;
-}
-// tslint:enable: no-unsafe-any
-var INTEGRATIONS = tslib_1.__assign({}, windowIntegrations, browser_5.Integrations, { Tracing: ApmIntegrations.Tracing });
-exports.Integrations = INTEGRATIONS;
-// We are patching the global object with our hub extension methods
-hubextensions_1.addExtensionMethods();
-//# sourceMappingURL=index.bundle.js.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/index.bundle.js.map b/node_modules/@sentry/apm/dist/index.bundle.js.map
deleted file mode 100644
index f36cff7..0000000
--- a/node_modules/@sentry/apm/dist/index.bundle.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.bundle.js","sourceRoot":"","sources":["../src/index.bundle.ts"],"names":[],"mappings":";;AAAA,uCAauB;AANrB,2BAAA,QAAQ,CAAA;AAGR,yBAAA,MAAM,CAAA;AAKR,2CAmByB;AAlBvB,4CAAA,uBAAuB,CAAA;AACvB,kCAAA,aAAa,CAAA;AACb,qCAAA,gBAAgB,CAAA;AAChB,iCAAA,YAAY,CAAA;AACZ,mCAAA,cAAc,CAAA;AACd,mCAAA,cAAc,CAAA;AACd,sCAAA,iBAAiB,CAAA;AACjB,kCAAA,aAAa,CAAA;AACb,wBAAA,GAAG,CAAA;AACH,0BAAA,KAAK,CAAA;AACL,+BAAA,UAAU,CAAA;AACV,6BAAA,QAAQ,CAAA;AACR,8BAAA,SAAS,CAAA;AACT,2BAAA,MAAM,CAAA;AACN,4BAAA,OAAO,CAAA;AACP,4BAAA,OAAO,CAAA;AACP,+BAAA,UAAU,CAAA;AACV,8BAAA,SAAS,CAAA;AAIX,2CAAqE;AAA5D,kCAAA,aAAa,CAAA;AACtB,2CAUyB;AATvB,wCAAA,mBAAmB,CAAA;AACnB,8BAAA,SAAS,CAAA;AACT,yBAAA,IAAI,CAAA;AACJ,gCAAA,WAAW,CAAA;AACX,2BAAA,MAAM,CAAA;AACN,qCAAA,gBAAgB,CAAA;AAChB,0BAAA,KAAK,CAAA;AACL,0BAAA,KAAK,CAAA;AACL,yBAAA,IAAI,CAAA;AAEN,2CAAwD;AAA/C,6BAAA,QAAQ,CAAA;AAAE,gCAAA,WAAW,CAAA;AAE9B,2CAAsE;AACtE,uCAAgD;AAEhD,iDAAsD;AACtD,gDAAkD;AAElD,+BAAkD;AAAzC,sBAAA,IAAI,CAAA;AAAE,oCAAA,kBAAkB,CAAA;AAEjC,IAAI,kBAAkB,GAAG,EAAE,CAAC;AAE5B,gGAAgG;AAChG,gCAAgC;AAChC,IAAM,OAAO,GAAG,uBAAe,EAAU,CAAC;AAC1C,IAAI,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE;IACjD,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC;CAClD;AACD,+BAA+B;AAE/B,IAAM,YAAY,wBACb,kBAAkB,EAClB,sBAAmB,IACtB,OAAO,EAAE,eAAe,CAAC,OAAO,GACjC,CAAC;AAEuB,oCAAY;AAErC,mEAAmE;AACnE,mCAAmB,EAAE,CAAC","sourcesContent":["export {\n Breadcrumb,\n Request,\n SdkInfo,\n Event,\n Exception,\n Response,\n Severity,\n StackFrame,\n Stacktrace,\n Status,\n Thread,\n User,\n} from '@sentry/types';\n\nexport {\n addGlobalEventProcessor,\n addBreadcrumb,\n captureException,\n captureEvent,\n captureMessage,\n configureScope,\n getHubFromCarrier,\n getCurrentHub,\n Hub,\n Scope,\n setContext,\n setExtra,\n setExtras,\n setTag,\n setTags,\n setUser,\n Transports,\n withScope,\n} from '@sentry/browser';\n\nexport { BrowserOptions } from '@sentry/browser';\nexport { BrowserClient, ReportDialogOptions } from '@sentry/browser';\nexport {\n defaultIntegrations,\n forceLoad,\n init,\n lastEventId,\n onLoad,\n showReportDialog,\n flush,\n close,\n wrap,\n} from '@sentry/browser';\nexport { SDK_NAME, SDK_VERSION } from '@sentry/browser';\n\nimport { Integrations as BrowserIntegrations } from '@sentry/browser';\nimport { getGlobalObject } from '@sentry/utils';\n\nimport { addExtensionMethods } from './hubextensions';\nimport * as ApmIntegrations from './integrations';\n\nexport { Span, TRACEPARENT_REGEXP } from './span';\n\nlet windowIntegrations = {};\n\n// This block is needed to add compatibility with the integrations packages when used with a CDN\n// tslint:disable: no-unsafe-any\nconst _window = getGlobalObject();\nif (_window.Sentry && _window.Sentry.Integrations) {\n windowIntegrations = _window.Sentry.Integrations;\n}\n// tslint:enable: no-unsafe-any\n\nconst INTEGRATIONS = {\n ...windowIntegrations,\n ...BrowserIntegrations,\n Tracing: ApmIntegrations.Tracing,\n};\n\nexport { INTEGRATIONS as Integrations };\n\n// We are patching the global object with our hub extension methods\naddExtensionMethods();\n"]}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/index.d.ts b/node_modules/@sentry/apm/dist/index.d.ts
deleted file mode 100644
index 1f65162..0000000
--- a/node_modules/@sentry/apm/dist/index.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-import * as ApmIntegrations from './integrations';
-export { ApmIntegrations as Integrations };
-export { Span, TRACEPARENT_REGEXP } from './span';
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/index.d.ts.map b/node_modules/@sentry/apm/dist/index.d.ts.map
deleted file mode 100644
index 79d1e2f..0000000
--- a/node_modules/@sentry/apm/dist/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,eAAe,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,eAAe,IAAI,YAAY,EAAE,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/index.js b/node_modules/@sentry/apm/dist/index.js
deleted file mode 100644
index f465c70..0000000
--- a/node_modules/@sentry/apm/dist/index.js
+++ /dev/null
@@ -1,10 +0,0 @@
-Object.defineProperty(exports, "__esModule", { value: true });
-var hubextensions_1 = require("./hubextensions");
-var ApmIntegrations = require("./integrations");
-exports.Integrations = ApmIntegrations;
-var span_1 = require("./span");
-exports.Span = span_1.Span;
-exports.TRACEPARENT_REGEXP = span_1.TRACEPARENT_REGEXP;
-// We are patching the global object with our hub extension methods
-hubextensions_1.addExtensionMethods();
-//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/index.js.map b/node_modules/@sentry/apm/dist/index.js.map
deleted file mode 100644
index 93f1e6f..0000000
--- a/node_modules/@sentry/apm/dist/index.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,iDAAsD;AACtD,gDAAkD;AAEtB,uCAAY;AACxC,+BAAkD;AAAzC,sBAAA,IAAI,CAAA;AAAE,oCAAA,kBAAkB,CAAA;AAEjC,mEAAmE;AACnE,mCAAmB,EAAE,CAAC","sourcesContent":["import { addExtensionMethods } from './hubextensions';\nimport * as ApmIntegrations from './integrations';\n\nexport { ApmIntegrations as Integrations };\nexport { Span, TRACEPARENT_REGEXP } from './span';\n\n// We are patching the global object with our hub extension methods\naddExtensionMethods();\n"]}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/integrations/express.d.ts b/node_modules/@sentry/apm/dist/integrations/express.d.ts
deleted file mode 100644
index c6d7635..0000000
--- a/node_modules/@sentry/apm/dist/integrations/express.d.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import { EventProcessor, Hub, Integration } from '@sentry/types';
-import { Application } from 'express';
-/**
- * Express integration
- *
- * Provides an request and error handler for Express framework
- * as well as tracing capabilities
- */
-export declare class Express implements Integration {
- /**
- * @inheritDoc
- */
- name: string;
- /**
- * @inheritDoc
- */
- static id: string;
- /**
- * Express App instance
- */
- private readonly _app?;
- /**
- * @inheritDoc
- */
- constructor(options?: {
- app?: Application;
- });
- /**
- * @inheritDoc
- */
- setupOnce(_addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
-}
-//# sourceMappingURL=express.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/integrations/express.d.ts.map b/node_modules/@sentry/apm/dist/integrations/express.d.ts.map
deleted file mode 100644
index 9b29898..0000000
--- a/node_modules/@sentry/apm/dist/integrations/express.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"express.d.ts","sourceRoot":"","sources":["../../src/integrations/express.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjE,OAAO,EAAE,WAAW,EAAwE,MAAM,SAAS,CAAC;AAE5G;;;;;GAKG;AACH,qBAAa,OAAQ,YAAW,WAAW;IACzC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAc;IAEjC;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAa;IAErC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAc;IAEpC;;OAEG;gBACgB,OAAO,GAAE;QAAE,GAAG,CAAC,EAAE,WAAW,CAAA;KAAO;IAItD;;OAEG;IACI,SAAS,CAAC,wBAAwB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,GAAG,IAAI;CAO/G"}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/integrations/express.js b/node_modules/@sentry/apm/dist/integrations/express.js
deleted file mode 100644
index 82d10f6..0000000
--- a/node_modules/@sentry/apm/dist/integrations/express.js
+++ /dev/null
@@ -1,128 +0,0 @@
-Object.defineProperty(exports, "__esModule", { value: true });
-var utils_1 = require("@sentry/utils");
-/**
- * Express integration
- *
- * Provides an request and error handler for Express framework
- * as well as tracing capabilities
- */
-var Express = /** @class */ (function () {
- /**
- * @inheritDoc
- */
- function Express(options) {
- if (options === void 0) { options = {}; }
- /**
- * @inheritDoc
- */
- this.name = Express.id;
- this._app = options.app;
- }
- /**
- * @inheritDoc
- */
- Express.prototype.setupOnce = function (_addGlobalEventProcessor, getCurrentHub) {
- if (!this._app) {
- utils_1.logger.error('ExpressIntegration is missing an Express instance');
- return;
- }
- instrumentMiddlewares(this._app, getCurrentHub);
- };
- /**
- * @inheritDoc
- */
- Express.id = 'Express';
- return Express;
-}());
-exports.Express = Express;
-/**
- * Wraps original middleware function in a tracing call, which stores the info about the call as a span,
- * and finishes it once the middleware is done invoking.
- *
- * Express middlewares have 3 various forms, thus we have to take care of all of them:
- * // sync
- * app.use(function (req, res) { ... })
- * // async
- * app.use(function (req, res, next) { ... })
- * // error handler
- * app.use(function (err, req, res, next) { ... })
- */
-function wrap(fn, getCurrentHub) {
- var arrity = fn.length;
- switch (arrity) {
- case 2: {
- return function (_req, res) {
- var span = getCurrentHub().startSpan({
- description: fn.name,
- op: 'middleware',
- });
- res.once('finish', function () { return span.finish(); });
- return fn.apply(this, arguments);
- };
- }
- case 3: {
- return function (req, res, next) {
- var span = getCurrentHub().startSpan({
- description: fn.name,
- op: 'middleware',
- });
- fn.call(this, req, res, function () {
- span.finish();
- return next.apply(this, arguments);
- });
- };
- }
- case 4: {
- return function (err, req, res, next) {
- var span = getCurrentHub().startSpan({
- description: fn.name,
- op: 'middleware',
- });
- fn.call(this, err, req, res, function () {
- span.finish();
- return next.apply(this, arguments);
- });
- };
- }
- default: {
- throw new Error("Express middleware takes 2-4 arguments. Got: " + arrity);
- }
- }
-}
-/**
- * Takes all the function arguments passed to the original `app.use` call
- * and wraps every function, as well as array of functions with a call to our `wrap` method.
- * We have to take care of the arrays as well as iterate over all of the arguments,
- * as `app.use` can accept middlewares in few various forms.
- *
- * app.use([], )
- * app.use([], , ...)
- * app.use([], ...[])
- */
-function wrapUseArgs(args, getCurrentHub) {
- return Array.from(args).map(function (arg) {
- if (typeof arg === 'function') {
- return wrap(arg, getCurrentHub);
- }
- if (Array.isArray(arg)) {
- return arg.map(function (a) {
- if (typeof a === 'function') {
- return wrap(a, getCurrentHub);
- }
- return a;
- });
- }
- return arg;
- });
-}
-/**
- * Patches original app.use to utilize our tracing functionality
- */
-function instrumentMiddlewares(app, getCurrentHub) {
- var originalAppUse = app.use;
- app.use = function () {
- return originalAppUse.apply(this, wrapUseArgs(arguments, getCurrentHub));
- };
- return app;
-}
-//# sourceMappingURL=express.js.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/integrations/express.js.map b/node_modules/@sentry/apm/dist/integrations/express.js.map
deleted file mode 100644
index c3cce13..0000000
--- a/node_modules/@sentry/apm/dist/integrations/express.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"express.js","sourceRoot":"","sources":["../../src/integrations/express.ts"],"names":[],"mappings":";AACA,uCAAuC;AAIvC;;;;;GAKG;AACH;IAgBE;;OAEG;IACH,iBAAmB,OAAmC;QAAnC,wBAAA,EAAA,YAAmC;QAlBtD;;WAEG;QACI,SAAI,GAAW,OAAO,CAAC,EAAE,CAAC;QAgB/B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC;IAC1B,CAAC;IAED;;OAEG;IACI,2BAAS,GAAhB,UAAiB,wBAA4D,EAAE,aAAwB;QACrG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YACd,cAAM,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAC;YAClE,OAAO;SACR;QACD,qBAAqB,CAAC,I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CAAC,CAAC;IAC3E,CAAC,CAAC;IACF,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import { EventProcessor, Hub, Integration } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n// tslint:disable-next-line:no-implicit-dependencies\nimport { Application, ErrorRequestHandler, NextFunction, Request, RequestHandler, Response } from 'express';\n\n/**\n * Express integration\n *\n * Provides an request and error handler for Express framework\n * as well as tracing capabilities\n */\nexport class Express implements Integration {\n /**\n * @inheritDoc\n */\n public name: string = Express.id;\n\n /**\n * @inheritDoc\n */\n public static id: string = 'Express';\n\n /**\n * Express App instance\n */\n private readonly _app?: Application;\n\n /**\n * @inheritDoc\n */\n public constructor(options: { app?: Application } = {}) {\n this._app = options.app;\n }\n\n /**\n * @inheritDoc\n */\n public setupOnce(_addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n if (!this._app) {\n logger.error('ExpressIntegration is missing an Express instance');\n return;\n }\n instrumentMiddlewares(this._app, getCurrentHub);\n }\n}\n\n/**\n * Wraps original middleware function in a tracing call, which stores the info about the call as a span,\n * and finishes it once the middleware is done invoking.\n *\n * Express middlewares have 3 various forms, thus we have to take care of all of them:\n * // sync\n * app.use(function (req, res) { ... })\n * // async\n * app.use(function (req, res, next) { ... })\n * // error handler\n * app.use(function (err, req, res, next) { ... })\n */\nfunction wrap(fn: Function, getCurrentHub: () => Hub): RequestHandler | ErrorRequestHandler {\n const arrity = fn.length;\n\n switch (arrity) {\n case 2: {\n return function(this: NodeJS.Global, _req: Request, res: Response): any {\n const span = getCurrentHub().startSpan({\n description: fn.name,\n op: 'middleware',\n });\n res.once('finish', () => span.finish());\n return fn.apply(this, arguments);\n };\n }\n case 3: {\n return function(this: NodeJS.Global, req: Request, res: Response, next: NextFunction): any {\n const span = getCurrentHub().startSpan({\n description: fn.name,\n op: 'middleware',\n });\n fn.call(this, req, res, function(this: NodeJS.Global): any {\n span.finish();\n return next.apply(this, arguments);\n });\n };\n }\n case 4: {\n return function(this: NodeJS.Global, err: any, req: Request, res: Response, next: NextFunction): any {\n const span = getCurrentHub().startSpan({\n description: fn.name,\n op: 'middleware',\n });\n fn.call(this, err, req, res, function(this: NodeJS.Global): any {\n span.finish();\n return next.apply(this, arguments);\n });\n };\n }\n default: {\n throw new Error(`Express middleware takes 2-4 arguments. Got: ${arrity}`);\n }\n }\n}\n\n/**\n * Takes all the function arguments passed to the original `app.use` call\n * and wraps every function, as well as array of functions with a call to our `wrap` method.\n * We have to take care of the arrays as well as iterate over all of the arguments,\n * as `app.use` can accept middlewares in few various forms.\n *\n * app.use([], )\n * app.use([], , ...)\n * app.use([], ...[])\n */\nfunction wrapUseArgs(args: IArguments, getCurrentHub: () => Hub): unknown[] {\n return Array.from(args).map((arg: unknown) => {\n if (typeof arg === 'function') {\n return wrap(arg, getCurrentHub);\n }\n\n if (Array.isArray(arg)) {\n return arg.map((a: unknown) => {\n if (typeof a === 'function') {\n return wrap(a, getCurrentHub);\n }\n return a;\n });\n }\n\n return arg;\n });\n}\n\n/**\n * Patches original app.use to utilize our tracing functionality\n */\nfunction instrumentMiddlewares(app: Application, getCurrentHub: () => Hub): Application {\n const originalAppUse = app.use;\n app.use = function(): any {\n return originalAppUse.apply(this, wrapUseArgs(arguments, getCurrentHub));\n };\n return app;\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/integrations/index.d.ts b/node_modules/@sentry/apm/dist/integrations/index.d.ts
deleted file mode 100644
index 6c891c4..0000000
--- a/node_modules/@sentry/apm/dist/integrations/index.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export { Express } from './express';
-export { Tracing } from './tracing';
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/integrations/index.d.ts.map b/node_modules/@sentry/apm/dist/integrations/index.d.ts.map
deleted file mode 100644
index 412841d..0000000
--- a/node_modules/@sentry/apm/dist/integrations/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/integrations/index.js b/node_modules/@sentry/apm/dist/integrations/index.js
deleted file mode 100644
index 4522782..0000000
--- a/node_modules/@sentry/apm/dist/integrations/index.js
+++ /dev/null
@@ -1,6 +0,0 @@
-Object.defineProperty(exports, "__esModule", { value: true });
-var express_1 = require("./express");
-exports.Express = express_1.Express;
-var tracing_1 = require("./tracing");
-exports.Tracing = tracing_1.Tracing;
-//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/integrations/index.js.map b/node_modules/@sentry/apm/dist/integrations/index.js.map
deleted file mode 100644
index c67f5d8..0000000
--- a/node_modules/@sentry/apm/dist/integrations/index.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/integrations/index.ts"],"names":[],"mappings":";AAAA,qCAAoC;AAA3B,4BAAA,OAAO,CAAA;AAChB,qCAAoC;AAA3B,4BAAA,OAAO,CAAA","sourcesContent":["export { Express } from './express';\nexport { Tracing } from './tracing';\n"]}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/integrations/tracing.d.ts b/node_modules/@sentry/apm/dist/integrations/tracing.d.ts
deleted file mode 100644
index 7d6b099..0000000
--- a/node_modules/@sentry/apm/dist/integrations/tracing.d.ts
+++ /dev/null
@@ -1,209 +0,0 @@
-import { EventProcessor, Hub, Integration, Span, SpanContext, SpanStatus } from '@sentry/types';
-/**
- * Options for Tracing integration
- */
-interface TracingOptions {
- /**
- * List of strings / regex where the integration should create Spans out of. Additionally this will be used
- * to define which outgoing requests the `sentry-trace` header will be attached to.
- *
- * Default: ['localhost', /^\//]
- */
- tracingOrigins: Array;
- /**
- * Flag to disable patching all together for fetch requests.
- *
- * Default: true
- */
- traceFetch: boolean;
- /**
- * Flag to disable patching all together for xhr requests.
- *
- * Default: true
- */
- traceXHR: boolean;
- /**
- * This function will be called before creating a span for a request with the given url.
- * Return false if you don't want a span for the given url.
- *
- * By default it uses the `tracingOrigins` options as a url match.
- */
- shouldCreateSpanForRequest(url: string): boolean;
- /**
- * The time to wait in ms until the transaction will be finished. The transaction will use the end timestamp of
- * the last finished span as the endtime for the transaction.
- * Time is in ms.
- *
- * Default: 500
- */
- idleTimeout: number;
- /**
- * Flag to enable/disable creation of `navigation` transaction on history changes. Useful for react applications with
- * a router.
- *
- * Default: true
- */
- startTransactionOnLocationChange: boolean;
- /**
- * Sample to determine if the Integration should instrument anything. The decision will be taken once per load
- * on initalization.
- * 0 = 0% chance of instrumenting
- * 1 = 100% change of instrumenting
- *
- * Default: 1
- */
- tracesSampleRate: number;
- /**
- * The maximum duration of a transaction before it will be discarded. This is for some edge cases where a browser
- * completely freezes the JS state and picks it up later (background tabs).
- * So after this duration, the SDK will not send the event.
- * If you want to have an unlimited duration set it to 0.
- * Time is in seconds.
- *
- * Default: 600
- */
- maxTransactionDuration: number;
- /**
- * Flag to discard all spans that occur in background. This includes transactions. Browser background tab timing is
- * not suited towards doing precise measurements of operations. That's why this option discards any active transaction
- * and also doesn't add any spans that happen in the background. Background spans/transaction can mess up your
- * statistics in non deterministic ways that's why we by default recommend leaving this opition enabled.
- *
- * Default: true
- */
- discardBackgroundSpans: boolean;
-}
-/** JSDoc */
-interface Activity {
- name: string;
- span?: Span;
-}
-/**
- * Tracing Integration
- */
-export declare class Tracing implements Integration {
- /**
- * @inheritDoc
- */
- name: string;
- /**
- * @inheritDoc
- */
- static id: string;
- /**
- * Is Tracing enabled, this will be determined once per pageload.
- */
- private static _enabled?;
- /** JSDoc */
- static options: TracingOptions;
- /**
- * Returns current hub.
- */
- private static _getCurrentHub?;
- private static _activeTransaction?;
- private static _currentIndex;
- static _activities: {
- [key: number]: Activity;
- };
- private static _debounce;
- private readonly _emitOptionsWarning;
- private static _performanceCursor;
- private static _heartbeatTimer;
- private static _prevHeartbeatString;
- private static _heartbeatCounter;
- /**
- * Constructor for Tracing
- *
- * @param _options TracingOptions
- */
- constructor(_options?: Partial);
- /**
- * @inheritDoc
- */
- setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
- /**
- * Pings the heartbeat
- */
- private static _pingHeartbeat;
- /**
- * Checks when entries of Tracing._activities are not changing for 3 beats. If this occurs we finish the transaction
- *
- */
- private static _beat;
- /**
- * Discards active transactions if tab moves to background
- */
- private _setupBackgroundTabDetection;
- /**
- * Unsets the current active transaction + activities
- */
- private static _resetActiveTransaction;
- /**
- * Registers to History API to detect navigation changes
- */
- private _setupHistory;
- /**
- * Attaches to fetch to add sentry-trace header + creating spans
- */
- private _setupFetchTracing;
- /**
- * Attaches to XHR to add sentry-trace header + creating spans
- */
- private _setupXHRTracing;
- /**
- * Configures global error listeners
- */
- private _setupErrorHandling;
- /**
- * Is tracing enabled
- */
- private static _isEnabled;
- /**
- * Starts a Transaction waiting for activity idle to finish
- */
- static startIdleTransaction(name: string, spanContext?: SpanContext): Span | undefined;
- /**
- * Update transaction
- * @deprecated
- */
- static updateTransactionName(name: string): void;
- /**
- * Finshes the current active transaction
- */
- static finishIdleTransaction(): void;
- /**
- * This uses `performance.getEntries()` to add additional spans to the active transaction.
- * Also, we update our timings since we consider the timings in this API to be more correct than our manual
- * measurements.
- *
- * @param transactionSpan The transaction span
- */
- private static _addPerformanceEntries;
- /**
- * Sets the status of the current active transaction (if there is one)
- */
- static setTransactionStatus(status: SpanStatus): void;
- /**
- * Converts from milliseconds to seconds
- * @param time time in ms
- */
- private static _msToSec;
- /**
- * Starts tracking for a specifc activity
- *
- * @param name Name of the activity, can be any string (Only used internally to identify the activity)
- * @param spanContext If provided a Span with the SpanContext will be created.
- * @param options _autoPopAfter_ | Time in ms, if provided the activity will be popped automatically after this timeout. This can be helpful in cases where you cannot gurantee your application knows the state and calls `popActivity` for sure.
- */
- static pushActivity(name: string, spanContext?: SpanContext, options?: {
- autoPopAfter?: number;
- }): number;
- /**
- * Removes activity and finishes the span in case there is one
- */
- static popActivity(id: number, spanData?: {
- [key: string]: any;
- }): void;
-}
-export {};
-//# sourceMappingURL=tracing.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/integrations/tracing.d.ts.map b/node_modules/@sentry/apm/dist/integrations/tracing.d.ts.map
deleted file mode 100644
index 137fc67..0000000
--- a/node_modules/@sentry/apm/dist/integrations/tracing.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../src/integrations/tracing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,cAAc,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAWvG;;GAEG;AACH,UAAU,cAAc;IACtB;;;;;OAKG;IACH,cAAc,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACvC;;;;OAIG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,0BAA0B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACjD;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,gCAAgC,EAAE,OAAO,CAAC;IAC1C;;;;;;;OAOG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;;;;;;;OAQG;IACH,sBAAsB,EAAE,MAAM,CAAC;IAE/B;;;;;;;OAOG;IACH,sBAAsB,EAAE,OAAO,CAAC;CACjC;AAED,YAAY;AACZ,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,IAAI,CAAC;CACb;AAKD;;GAEG;AACH,qBAAa,OAAQ,YAAW,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AEG;IACH,OAAO,CAAC,mBAAmB;IAqB3B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,UAAU;IAazB;;OAEG;WACW,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS;IAiD7F;;;OAGG;WACW,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAavD;;OAEG;WACW,qBAAqB,IAAI,IAAI;IAU3C;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAiJrC;;OAEG;WACW,oBAAoB,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAQ5D;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ;IAIvB;;;;;;OAMG;WACW,YAAY,CACxB,IAAI,EAAE,MAAM,EACZ,WAAW,CAAC,EAAE,WAAW,EACzB,OAAO,CAAC,EAAE;QACR,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,GACA,MAAM;IA4CT;;OAEG;WACW,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,IAAI;CA6C/E"}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/integrations/tracing.js b/node_modules/@sentry/apm/dist/integrations/tracing.js
deleted file mode 100644
index a5b6181..0000000
--- a/node_modules/@sentry/apm/dist/integrations/tracing.js
+++ /dev/null
@@ -1,631 +0,0 @@
-Object.defineProperty(exports, "__esModule", { value: true });
-var tslib_1 = require("tslib");
-var types_1 = require("@sentry/types");
-var utils_1 = require("@sentry/utils");
-var global = utils_1.getGlobalObject();
-var defaultTracingOrigins = ['localhost', /^\//];
-/**
- * Tracing Integration
- */
-var Tracing = /** @class */ (function () {
- /**
- * Constructor for Tracing
- *
- * @param _options TracingOptions
- */
- function Tracing(_options) {
- /**
- * @inheritDoc
- */
- this.name = Tracing.id;
- this._emitOptionsWarning = false;
- if (global.performance) {
- global.performance.mark('sentry-tracing-init');
- }
- var defaults = {
- discardBackgroundSpans: true,
- idleTimeout: 500,
- maxTransactionDuration: 600,
- shouldCreateSpanForRequest: function (url) {
- var origins = (_options && _options.tracingOrigins) || defaultTracingOrigins;
- return (origins.some(function (origin) { return utils_1.isMatchingPattern(url, origin); }) &&
- !utils_1.isMatchingPattern(url, 'sentry_key'));
- },
- startTransactionOnLocationChange: true,
- traceFetch: true,
- traceXHR: true,
- tracesSampleRate: 1,
- tracingOrigins: defaultTracingOrigins,
- };
- // NOTE: Logger doesn't work in contructors, as it's initialized after integrations instances
- if (!_options || !Array.isArray(_options.tracingOrigins) || _options.tracingOrigins.length === 0) {
- this._emitOptionsWarning = true;
- }
- Tracing.options = tslib_1.__assign({}, defaults, _options);
- }
- /**
- * @inheritDoc
- */
- Tracing.prototype.setupOnce = function (addGlobalEventProcessor, getCurrentHub) {
- Tracing._getCurrentHub = getCurrentHub;
- if (this._emitOptionsWarning) {
- utils_1.logger.warn('[Tracing] You need to define `tracingOrigins` in the options. Set an array of urls or patterns to trace.');
- utils_1.logger.warn("[Tracing] We added a reasonable default for you: " + defaultTracingOrigins);
- }
- if (!Tracing._isEnabled()) {
- return;
- }
- // Starting our inital pageload transaction
- if (global.location && global.location.href) {
- // `${global.location.href}` will be used a temp transaction name
- Tracing.startIdleTransaction(global.location.href, {
- op: 'pageload',
- sampled: true,
- });
- }
- this._setupXHRTracing();
- this._setupFetchTracing();
- this._setupHistory();
- this._setupErrorHandling();
- this._setupBackgroundTabDetection();
- Tracing._pingHeartbeat();
- // This EventProcessor makes sure that the transaction is not longer than maxTransactionDuration
- addGlobalEventProcessor(function (event) {
- var self = getCurrentHub().getIntegration(Tracing);
- if (!self) {
- return event;
- }
- if (Tracing._isEnabled()) {
- var isOutdatedTransaction = event.timestamp &&
- event.start_timestamp &&
- (event.timestamp - event.start_timestamp > Tracing.options.maxTransactionDuration ||
- event.timestamp - event.start_timestamp < 0);
- if (Tracing.options.maxTransactionDuration !== 0 && event.type === 'transaction' && isOutdatedTransaction) {
- utils_1.logger.log('[Tracing] Discarded transaction since it maxed out maxTransactionDuration');
- return null;
- }
- }
- return event;
- });
- };
- /**
- * Pings the heartbeat
- */
- Tracing._pingHeartbeat = function () {
- Tracing._heartbeatTimer = setTimeout(function () {
- Tracing._beat();
- }, 5000);
- };
- /**
- * Checks when entries of Tracing._activities are not changing for 3 beats. If this occurs we finish the transaction
- *
- */
- Tracing._beat = function () {
- clearTimeout(Tracing._heartbeatTimer);
- var keys = Object.keys(Tracing._activities);
- if (keys.length) {
- var heartbeatString = keys.reduce(function (prev, current) { return prev + current; });
- if (heartbeatString === Tracing._prevHeartbeatString) {
- Tracing._heartbeatCounter++;
- }
- else {
- Tracing._heartbeatCounter = 0;
- }
- if (Tracing._heartbeatCounter >= 3) {
- if (Tracing._activeTransaction) {
- utils_1.logger.log("[Tracing] Heartbeat safeguard kicked in, finishing transaction since activities content hasn't changed for 3 beats");
- Tracing._activeTransaction.setStatus(types_1.SpanStatus.DeadlineExceeded);
- Tracing._activeTransaction.setTag('heartbeat', 'failed');
- Tracing.finishIdleTransaction();
- }
- }
- Tracing._prevHeartbeatString = heartbeatString;
- }
- Tracing._pingHeartbeat();
- };
- /**
- * Discards active transactions if tab moves to background
- */
- Tracing.prototype._setupBackgroundTabDetection = function () {
- if (Tracing.options.discardBackgroundSpans && global.document) {
- document.addEventListener('visibilitychange', function () {
- if (document.hidden && Tracing._activeTransaction) {
- utils_1.logger.log('[Tracing] Discarded active transaction incl. activities since tab moved to the background');
- Tracing._resetActiveTransaction();
- }
- });
- }
- };
- /**
- * Unsets the current active transaction + activities
- */
- Tracing._resetActiveTransaction = function () {
- Tracing._activeTransaction = undefined;
- Tracing._activities = {};
- };
- /**
- * Registers to History API to detect navigation changes
- */
- Tracing.prototype._setupHistory = function () {
- if (Tracing.options.startTransactionOnLocationChange) {
- utils_1.addInstrumentationHandler({
- callback: historyCallback,
- type: 'history',
- });
- }
- };
- /**
- * Attaches to fetch to add sentry-trace header + creating spans
- */
- Tracing.prototype._setupFetchTracing = function () {
- if (Tracing.options.traceFetch && utils_1.supportsNativeFetch()) {
- utils_1.addInstrumentationHandler({
- callback: fetchCallback,
- type: 'fetch',
- });
- }
- };
- /**
- * Attaches to XHR to add sentry-trace header + creating spans
- */
- Tracing.prototype._setupXHRTracing = function () {
- if (Tracing.options.traceXHR) {
- utils_1.addInstrumentationHandler({
- callback: xhrCallback,
- type: 'xhr',
- });
- }
- };
- /**
- * Configures global error listeners
- */
- Tracing.prototype._setupErrorHandling = function () {
- // tslint:disable-next-line: completed-docs
- function errorCallback() {
- if (Tracing._activeTransaction) {
- /**
- * If an error or unhandled promise occurs, we mark the active transaction as failed
- */
- utils_1.logger.log("[Tracing] Global error occured, setting status in transaction: " + types_1.SpanStatus.InternalError);
- Tracing._activeTransaction.setStatus(types_1.SpanStatus.InternalError);
- }
- }
- utils_1.addInstrumentationHandler({
- callback: errorCallback,
- type: 'error',
- });
- utils_1.addInstrumentationHandler({
- callback: errorCallback,
- type: 'unhandledrejection',
- });
- };
- /**
- * Is tracing enabled
- */
- Tracing._isEnabled = function () {
- if (Tracing._enabled !== undefined) {
- return Tracing._enabled;
- }
- // This happens only in test cases where the integration isn't initalized properly
- // tslint:disable-next-line: strict-type-predicates
- if (!Tracing.options || typeof Tracing.options.tracesSampleRate !== 'number') {
- return false;
- }
- Tracing._enabled = Math.random() > Tracing.options.tracesSampleRate ? false : true;
- return Tracing._enabled;
- };
- /**
- * Starts a Transaction waiting for activity idle to finish
- */
- Tracing.startIdleTransaction = function (name, spanContext) {
- if (!Tracing._isEnabled()) {
- // Tracing is not enabled
- return undefined;
- }
- // If we already have an active transaction it means one of two things
- // a) The user did rapid navigation changes and didn't wait until the transaction was finished
- // b) A activity wasn't popped correctly and therefore the transaction is stalling
- Tracing.finishIdleTransaction();
- utils_1.logger.log('[Tracing] startIdleTransaction, name:', name);
- var _getCurrentHub = Tracing._getCurrentHub;
- if (!_getCurrentHub) {
- return undefined;
- }
- var hub = _getCurrentHub();
- if (!hub) {
- return undefined;
- }
- var span = hub.startSpan(tslib_1.__assign({}, spanContext, { transaction: name }), true);
- Tracing._activeTransaction = span;
- // We need to do this workaround here and not use configureScope
- // Reason being at the time we start the inital transaction we do not have a client bound on the hub yet
- // therefore configureScope wouldn't be executed and we would miss setting the transaction
- // tslint:disable-next-line: no-unsafe-any
- hub.getScope().setSpan(span);
- // The reason we do this here is because of cached responses
- // If we start and transaction without an activity it would never finish since there is no activity
- var id = Tracing.pushActivity('idleTransactionStarted');
- setTimeout(function () {
- Tracing.popActivity(id);
- }, (Tracing.options && Tracing.options.idleTimeout) || 100);
- return span;
- };
- /**
- * Update transaction
- * @deprecated
- */
- Tracing.updateTransactionName = function (name) {
- utils_1.logger.log('[Tracing] DEPRECATED, use Sentry.configureScope => scope.setTransaction instead', name);
- var _getCurrentHub = Tracing._getCurrentHub;
- if (_getCurrentHub) {
- var hub = _getCurrentHub();
- if (hub) {
- hub.configureScope(function (scope) {
- scope.setTransaction(name);
- });
- }
- }
- };
- /**
- * Finshes the current active transaction
- */
- Tracing.finishIdleTransaction = function () {
- var active = Tracing._activeTransaction;
- if (active) {
- Tracing._addPerformanceEntries(active);
- utils_1.logger.log('[Tracing] finishIdleTransaction', active.transaction);
- active.finish(/*trimEnd*/ true);
- Tracing._resetActiveTransaction();
- }
- };
- /**
- * This uses `performance.getEntries()` to add additional spans to the active transaction.
- * Also, we update our timings since we consider the timings in this API to be more correct than our manual
- * measurements.
- *
- * @param transactionSpan The transaction span
- */
- Tracing._addPerformanceEntries = function (transactionSpan) {
- if (!global.performance) {
- // Gatekeeper if performance API not available
- return;
- }
- utils_1.logger.log('[Tracing] Adding & adjusting spans using Performance API');
- var timeOrigin = Tracing._msToSec(performance.timeOrigin);
- // tslint:disable-next-line: completed-docs
- function addSpan(span) {
- if (transactionSpan.spanRecorder) {
- transactionSpan.spanRecorder.finishSpan(span);
- }
- }
- // tslint:disable-next-line: completed-docs
- function addPerformanceNavigationTiming(parent, entry, event) {
- var span = parent.child({
- description: event,
- op: 'browser',
- });
- span.startTimestamp = timeOrigin + Tracing._msToSec(entry[event + "Start"]);
- span.timestamp = timeOrigin + Tracing._msToSec(entry[event + "End"]);
- addSpan(span);
- }
- // tslint:disable-next-line: completed-docs
- function addRequest(parent, entry) {
- var request = parent.child({
- description: 'request',
- op: 'browser',
- });
- request.startTimestamp = timeOrigin + Tracing._msToSec(entry.requestStart);
- request.timestamp = timeOrigin + Tracing._msToSec(entry.responseEnd);
- addSpan(request);
- var response = parent.child({
- description: 'response',
- op: 'browser',
- });
- response.startTimestamp = timeOrigin + Tracing._msToSec(entry.responseStart);
- response.timestamp = timeOrigin + Tracing._msToSec(entry.responseEnd);
- addSpan(response);
- }
- var entryScriptSrc;
- if (global.document) {
- // tslint:disable-next-line: prefer-for-of
- for (var i = 0; i < document.scripts.length; i++) {
- // We go through all scripts on the page and look for 'data-entry'
- // We remember the name and measure the time between this script finished loading and
- // our mark 'sentry-tracing-init'
- if (document.scripts[i].dataset.entry === 'true') {
- entryScriptSrc = document.scripts[i].src;
- break;
- }
- }
- }
- var entryScriptStartEndTime;
- var tracingInitMarkStartTime;
- // tslint:disable: no-unsafe-any
- performance
- .getEntries()
- .slice(Tracing._performanceCursor)
- .forEach(function (entry) {
- var startTime = Tracing._msToSec(entry.startTime);
- var duration = Tracing._msToSec(entry.duration);
- if (transactionSpan.op === 'navigation' && timeOrigin + startTime < transactionSpan.startTimestamp) {
- return;
- }
- switch (entry.entryType) {
- case 'navigation':
- addPerformanceNavigationTiming(transactionSpan, entry, 'unloadEvent');
- addPerformanceNavigationTiming(transactionSpan, entry, 'domContentLoadedEvent');
- addPerformanceNavigationTiming(transactionSpan, entry, 'loadEvent');
- addPerformanceNavigationTiming(transactionSpan, entry, 'connect');
- addPerformanceNavigationTiming(transactionSpan, entry, 'domainLookup');
- addRequest(transactionSpan, entry);
- break;
- case 'mark':
- case 'paint':
- case 'measure':
- var mark = transactionSpan.child({
- description: entry.entryType + " " + entry.name,
- op: 'mark',
- });
- mark.startTimestamp = timeOrigin + startTime;
- mark.timestamp = mark.startTimestamp + duration;
- if (tracingInitMarkStartTime === undefined && entry.name === 'sentry-tracing-init') {
- tracingInitMarkStartTime = mark.startTimestamp;
- }
- addSpan(mark);
- break;
- case 'resource':
- var resourceName_1 = entry.name.replace(window.location.origin, '');
- if (entry.initiatorType === 'xmlhttprequest' || entry.initiatorType === 'fetch') {
- // We need to update existing spans with new timing info
- if (transactionSpan.spanRecorder) {
- transactionSpan.spanRecorder.finishedSpans.map(function (finishedSpan) {
- if (finishedSpan.description && finishedSpan.description.indexOf(resourceName_1) !== -1) {
- finishedSpan.startTimestamp = timeOrigin + startTime;
- finishedSpan.timestamp = finishedSpan.startTimestamp + duration;
- }
- });
- }
- }
- else {
- var resource = transactionSpan.child({
- description: entry.initiatorType + " " + resourceName_1,
- op: "resource",
- });
- resource.startTimestamp = timeOrigin + startTime;
- resource.timestamp = resource.startTimestamp + duration;
- // We remember the entry script end time to calculate the difference to the first init mark
- if (entryScriptStartEndTime === undefined && (entryScriptSrc || '').includes(resourceName_1)) {
- entryScriptStartEndTime = resource.timestamp;
- }
- addSpan(resource);
- }
- break;
- default:
- // Ignore other entry types.
- }
- });
- if (entryScriptStartEndTime !== undefined && tracingInitMarkStartTime !== undefined) {
- var evaluation = transactionSpan.child({
- description: 'evaluation',
- op: "script",
- });
- evaluation.startTimestamp = entryScriptStartEndTime;
- evaluation.timestamp = tracingInitMarkStartTime;
- addSpan(evaluation);
- }
- Tracing._performanceCursor = Math.max(performance.getEntries().length - 1, 0);
- // tslint:enable: no-unsafe-any
- };
- /**
- * Sets the status of the current active transaction (if there is one)
- */
- Tracing.setTransactionStatus = function (status) {
- var active = Tracing._activeTransaction;
- if (active) {
- utils_1.logger.log('[Tracing] setTransactionStatus', status);
- active.setStatus(status);
- }
- };
- /**
- * Converts from milliseconds to seconds
- * @param time time in ms
- */
- Tracing._msToSec = function (time) {
- return time / 1000;
- };
- /**
- * Starts tracking for a specifc activity
- *
- * @param name Name of the activity, can be any string (Only used internally to identify the activity)
- * @param spanContext If provided a Span with the SpanContext will be created.
- * @param options _autoPopAfter_ | Time in ms, if provided the activity will be popped automatically after this timeout. This can be helpful in cases where you cannot gurantee your application knows the state and calls `popActivity` for sure.
- */
- Tracing.pushActivity = function (name, spanContext, options) {
- if (!Tracing._isEnabled()) {
- // Tracing is not enabled
- return 0;
- }
- if (!Tracing._activeTransaction) {
- utils_1.logger.log("[Tracing] Not pushing activity " + name + " since there is no active transaction");
- return 0;
- }
- // We want to clear the timeout also here since we push a new activity
- clearTimeout(Tracing._debounce);
- var _getCurrentHub = Tracing._getCurrentHub;
- if (spanContext && _getCurrentHub) {
- var hub = _getCurrentHub();
- if (hub) {
- var span = hub.startSpan(spanContext);
- Tracing._activities[Tracing._currentIndex] = {
- name: name,
- span: span,
- };
- }
- }
- else {
- Tracing._activities[Tracing._currentIndex] = {
- name: name,
- };
- }
- utils_1.logger.log("[Tracing] pushActivity: " + name + "#" + Tracing._currentIndex);
- utils_1.logger.log('[Tracing] activies count', Object.keys(Tracing._activities).length);
- if (options && typeof options.autoPopAfter === 'number') {
- utils_1.logger.log("[Tracing] auto pop of: " + name + "#" + Tracing._currentIndex + " in " + options.autoPopAfter + "ms");
- var index_1 = Tracing._currentIndex;
- setTimeout(function () {
- Tracing.popActivity(index_1, {
- autoPop: true,
- status: types_1.SpanStatus.DeadlineExceeded,
- });
- }, options.autoPopAfter);
- }
- return Tracing._currentIndex++;
- };
- /**
- * Removes activity and finishes the span in case there is one
- */
- Tracing.popActivity = function (id, spanData) {
- // The !id is on purpose to also fail with 0
- // Since 0 is returned by push activity in case tracing is not enabled
- // or there is no active transaction
- if (!Tracing._isEnabled() || !id) {
- // Tracing is not enabled
- return;
- }
- var activity = Tracing._activities[id];
- if (activity) {
- utils_1.logger.log("[Tracing] popActivity " + activity.name + "#" + id);
- var span_1 = activity.span;
- if (span_1) {
- if (spanData) {
- Object.keys(spanData).forEach(function (key) {
- span_1.setData(key, spanData[key]);
- if (key === 'status_code') {
- span_1.setHttpStatus(spanData[key]);
- }
- if (key === 'status') {
- span_1.setStatus(spanData[key]);
- }
- });
- }
- span_1.finish();
- }
- // tslint:disable-next-line: no-dynamic-delete
- delete Tracing._activities[id];
- }
- var count = Object.keys(Tracing._activities).length;
- clearTimeout(Tracing._debounce);
- utils_1.logger.log('[Tracing] activies count', count);
- if (count === 0 && Tracing._activeTransaction) {
- var timeout = Tracing.options && Tracing.options.idleTimeout;
- utils_1.logger.log("[Tracing] Flushing Transaction in " + timeout + "ms");
- Tracing._debounce = setTimeout(function () {
- Tracing.finishIdleTransaction();
- }, timeout);
- }
- };
- /**
- * @inheritDoc
- */
- Tracing.id = 'Tracing';
- Tracing._currentIndex = 1;
- Tracing._activities = {};
- Tracing._debounce = 0;
- Tracing._performanceCursor = 0;
- Tracing._heartbeatTimer = 0;
- Tracing._heartbeatCounter = 0;
- return Tracing;
-}());
-exports.Tracing = Tracing;
-/**
- * Creates breadcrumbs from XHR API calls
- */
-function xhrCallback(handlerData) {
- if (!Tracing.options.traceXHR) {
- return;
- }
- // tslint:disable-next-line: no-unsafe-any
- if (!handlerData || !handlerData.xhr || !handlerData.xhr.__sentry_xhr__) {
- return;
- }
- // tslint:disable: no-unsafe-any
- var xhr = handlerData.xhr.__sentry_xhr__;
- if (!Tracing.options.shouldCreateSpanForRequest(xhr.url)) {
- return;
- }
- // We only capture complete, non-sentry requests
- if (handlerData.xhr.__sentry_own_request__) {
- return;
- }
- if (handlerData.endTimestamp && handlerData.xhr.__sentry_xhr_activity_id__) {
- Tracing.popActivity(handlerData.xhr.__sentry_xhr_activity_id__, handlerData.xhr.__sentry_xhr__);
- return;
- }
- handlerData.xhr.__sentry_xhr_activity_id__ = Tracing.pushActivity('xhr', {
- data: tslib_1.__assign({}, xhr.data, { type: 'xhr' }),
- description: xhr.method + " " + xhr.url,
- op: 'http',
- });
- // Adding the trace header to the span
- var activity = Tracing._activities[handlerData.xhr.__sentry_xhr_activity_id__];
- if (activity) {
- var span = activity.span;
- if (span && handlerData.xhr.setRequestHeader) {
- handlerData.xhr.setRequestHeader('sentry-trace', span.toTraceparent());
- }
- }
- // tslint:enable: no-unsafe-any
-}
-/**
- * Creates breadcrumbs from fetch API calls
- */
-function fetchCallback(handlerData) {
- // tslint:disable: no-unsafe-any
- if (!Tracing.options.traceFetch) {
- return;
- }
- if (!Tracing.options.shouldCreateSpanForRequest(handlerData.fetchData.url)) {
- return;
- }
- if (handlerData.endTimestamp && handlerData.fetchData.__activity) {
- Tracing.popActivity(handlerData.fetchData.__activity, handlerData.fetchData);
- }
- else {
- handlerData.fetchData.__activity = Tracing.pushActivity('fetch', {
- data: tslib_1.__assign({}, handlerData.fetchData, { type: 'fetch' }),
- description: handlerData.fetchData.method + " " + handlerData.fetchData.url,
- op: 'http',
- });
- var activity = Tracing._activities[handlerData.fetchData.__activity];
- if (activity) {
- var span = activity.span;
- if (span) {
- var options = (handlerData.args[1] = handlerData.args[1] || {});
- if (options.headers) {
- if (Array.isArray(options.headers)) {
- options.headers = tslib_1.__spread(options.headers, [{ 'sentry-trace': span.toTraceparent() }]);
- }
- else {
- options.headers = tslib_1.__assign({}, options.headers, { 'sentry-trace': span.toTraceparent() });
- }
- }
- else {
- options.headers = { 'sentry-trace': span.toTraceparent() };
- }
- }
- }
- }
- // tslint:enable: no-unsafe-any
-}
-/**
- * Creates transaction from navigation changes
- */
-function historyCallback(_) {
- if (Tracing.options.startTransactionOnLocationChange && global && global.location) {
- Tracing.startIdleTransaction(global.location.href, {
- op: 'navigation',
- sampled: true,
- });
- }
-}
-//# sourceMappingURL=tracing.js.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/integrations/tracing.js.map b/node_modules/@sentry/apm/dist/integrations/tracing.js.map
deleted file mode 100644
index aac5441..0000000
--- a/node_modules/@sentry/apm/dist/integrations/tracing.js.map
+++ /dev/null
@@ -1 +0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ACH,CAAC","sourcesContent":["import { Event, EventProcessor, Hub, Integration, Span, SpanContext, SpanStatus } from '@sentry/types';\nimport {\n addInstrumentationHandler,\n getGlobalObject,\n isMatchingPattern,\n logger,\n supportsNativeFetch,\n} from '@sentry/utils';\n\nimport { Span as SpanClass } from '../span';\n\n/**\n * Options for Tracing integration\n */\ninterface TracingOptions {\n /**\n * List of strings / regex where the integration should create Spans out of. Additionally this will be used\n * to define which outgoing requests the `sentry-trace` header will be attached to.\n *\n * Default: ['localhost', /^\\//]\n */\n tracingOrigins: Array;\n /**\n * Flag to disable patching all together for fetch requests.\n *\n * Default: true\n */\n traceFetch: boolean;\n /**\n * Flag to disable patching all together for xhr requests.\n *\n * Default: true\n */\n traceXHR: boolean;\n /**\n * This function will be called before creating a span for a request with the given url.\n * Return false if you don't want a span for the given url.\n *\n * By default it uses the `tracingOrigins` options as a url match.\n */\n shouldCreateSpanForRequest(url: string): boolean;\n /**\n * The time to wait in ms until the transaction will be finished. The transaction will use the end timestamp of\n * the last finished span as the endtime for the transaction.\n * Time is in ms.\n *\n * Default: 500\n */\n idleTimeout: number;\n /**\n * Flag to enable/disable creation of `navigation` transaction on history changes. Useful for react applications with\n * a router.\n *\n * Default: true\n */\n startTransactionOnLocationChange: boolean;\n /**\n * Sample to determine if the Integration should instrument anything. The decision will be taken once per load\n * on initalization.\n * 0 = 0% chance of instrumenting\n * 1 = 100% change of instrumenting\n *\n * Default: 1\n */\n tracesSampleRate: number;\n\n /**\n * The maximum duration of a transaction before it will be discarded. This is for some edge cases where a browser\n * completely freezes the JS state and picks it up later (background tabs).\n * So after this duration, the SDK will not send the event.\n * If you want to have an unlimited duration set it to 0.\n * Time is in seconds.\n *\n * Default: 600\n */\n maxTransactionDuration: number;\n\n /**\n * Flag to discard all spans that occur in background. This includes transactions. Browser background tab timing is\n * not suited towards doing precise measurements of operations. That's why this option discards any active transaction\n * and also doesn't add any spans that happen in the background. Background spans/transaction can mess up your\n * statistics in non deterministic ways that's why we by default recommend leaving this opition enabled.\n *\n * Default: true\n */\n discardBackgroundSpans: boolean;\n}\n\n/** JSDoc */\ninterface Activity {\n name: string;\n span?: Span;\n}\n\nconst global = getGlobalObject();\nconst defaultTracingOrigins = ['localhost', /^\\//];\n\n/**\n * Tracing Integration\n */\nexport class Tracing implements Integration {\n /**\n * @inheritDoc\n */\n public name: string = Tracing.id;\n\n /**\n * @inheritDoc\n */\n public static id: string = 'Tracing';\n\n /**\n * Is Tracing enabled, this will be determined once per pageload.\n */\n private static _enabled?: boolean;\n\n /** JSDoc */\n public static options: TracingOptions;\n\n /**\n * Returns current hub.\n */\n private static _getCurrentHub?: () => Hub;\n\n private static _activeTransaction?: Span;\n\n private static _currentIndex: number = 1;\n\n public static _activities: { [key: number]: Activity } = {};\n\n private static _debounce: number = 0;\n\n private readonly _emitOptionsWarning: boolean = false;\n\n private static _performanceCursor: number = 0;\n\n private static _heartbeatTimer: number = 0;\n\n private static _prevHeartbeatString: string | undefined;\n\n private static _heartbeatCounter: number = 0;\n\n /**\n * Constructor for Tracing\n *\n * @param _options TracingOptions\n */\n public constructor(_options?: Partial) {\n if (global.performance) {\n global.performance.mark('sentry-tracing-init');\n }\n const defaults = {\n discardBackgroundSpans: true,\n idleTimeout: 500,\n maxTransactionDuration: 600,\n shouldCreateSpanForRequest(url: string): boolean {\n const origins = (_options && _options.tracingOrigins) || defaultTracingOrigins;\n return (\n origins.some((origin: string | RegExp) => isMatchingPattern(url, origin)) &&\n !isMatchingPattern(url, 'sentry_key')\n );\n },\n startTransactionOnLocationChange: true,\n traceFetch: true,\n traceXHR: true,\n tracesSampleRate: 1,\n tracingOrigins: defaultTracingOrigins,\n };\n // NOTE: Logger doesn't work in contructors, as it's initialized after integrations instances\n if (!_options || !Array.isArray(_options.tracingOrigins) || _options.tracingOrigins.length === 0) {\n this._emitOptionsWarning = true;\n }\n Tracing.options = {\n ...defaults,\n ..._options,\n };\n }\n\n /**\n * @inheritDoc\n */\n public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n Tracing._getCurrentHub = getCurrentHub;\n\n if (this._emitOptionsWarning) {\n logger.warn(\n '[Tracing] You need to define `tracingOrigins` in the options. Set an array of urls or patterns to trace.',\n );\n logger.warn(`[Tracing] We added a reasonable default for you: ${defaultTracingOrigins}`);\n }\n\n if (!Tracing._isEnabled()) {\n return;\n }\n\n // Starting our inital pageload transaction\n if (global.location && global.location.href) {\n // `${global.location.href}` will be used a temp transaction name\n Tracing.startIdleTransaction(global.location.href, {\n op: 'pageload',\n sampled: true,\n });\n }\n\n this._setupXHRTracing();\n\n this._setupFetchTracing();\n\n this._setupHistory();\n\n this._setupErrorHandling();\n\n this._setupBackgroundTabDetection();\n\n Tracing._pingHeartbeat();\n\n // This EventProcessor makes sure that the transaction is not longer than maxTransactionDuration\n addGlobalEventProcessor((event: Event) => {\n const self = getCurrentHub().getIntegration(Tracing);\n if (!self) {\n return event;\n }\n\n if (Tracing._isEnabled()) {\n const isOutdatedTransaction =\n event.timestamp &&\n event.start_timestamp &&\n (event.timestamp - event.start_timestamp > Tracing.options.maxTransactionDuration ||\n event.timestamp - event.start_timestamp < 0);\n\n if (Tracing.options.maxTransactionDuration !== 0 && event.type === 'transaction' && isOutdatedTransaction) {\n logger.log('[Tracing] Discarded transaction since it maxed out maxTransactionDuration');\n return null;\n }\n }\n\n return event;\n });\n }\n\n /**\n * Pings the heartbeat\n */\n private static _pingHeartbeat(): void {\n Tracing._heartbeatTimer = (setTimeout(() => {\n Tracing._beat();\n }, 5000) as any) as number;\n }\n\n /**\n * Checks when entries of Tracing._activities are not changing for 3 beats. If this occurs we finish the transaction\n *\n */\n private static _beat(): void {\n clearTimeout(Tracing._heartbeatTimer);\n const keys = Object.keys(Tracing._activities);\n if (keys.length) {\n const heartbeatString = keys.reduce((prev: string, current: string) => prev + current);\n if (heartbeatString === Tracing._prevHeartbeatString) {\n Tracing._heartbeatCounter++;\n } else {\n Tracing._heartbeatCounter = 0;\n }\n if (Tracing._heartbeatCounter >= 3) {\n if (Tracing._activeTransaction) {\n logger.log(\n \"[Tracing] Heartbeat safeguard kicked in, finishing transaction since activities content hasn't changed for 3 beats\",\n );\n Tracing._activeTransaction.setStatus(SpanStatus.DeadlineExceeded);\n Tracing._activeTransaction.setTag('heartbeat', 'failed');\n Tracing.finishIdleTransaction();\n }\n }\n Tracing._prevHeartbeatString = heartbeatString;\n }\n Tracing._pingHeartbeat();\n }\n\n /**\n * Discards active transactions if tab moves to background\n */\n private _setupBackgroundTabDetection(): void {\n if (Tracing.options.discardBackgroundSpans && global.document) {\n document.addEventListener('visibilitychange', () => {\n if (document.hidden && Tracing._activeTransaction) {\n logger.log('[Tracing] Discarded active transaction incl. activities since tab moved to the background');\n Tracing._resetActiveTransaction();\n }\n });\n }\n }\n\n /**\n * Unsets the current active transaction + activities\n */\n private static _resetActiveTransaction(): void {\n Tracing._activeTransaction = undefined;\n Tracing._activities = {};\n }\n\n /**\n * Registers to History API to detect navigation changes\n */\n private _setupHistory(): void {\n if (Tracing.options.startTransactionOnLocationChange) {\n addInstrumentationHandler({\n callback: historyCallback,\n type: 'history',\n });\n }\n }\n\n /**\n * Attaches to fetch to add sentry-trace header + creating spans\n */\n private _setupFetchTracing(): void {\n if (Tracing.options.traceFetch && supportsNativeFetch()) {\n addInstrumentationHandler({\n callback: fetchCallback,\n type: 'fetch',\n });\n }\n }\n\n /**\n * Attaches to XHR to add sentry-trace header + creating spans\n */\n private _setupXHRTracing(): void {\n if (Tracing.options.traceXHR) {\n addInstrumentationHandler({\n callback: xhrCallback,\n type: 'xhr',\n });\n }\n }\n\n /**\n * Configures global error listeners\n */\n private _setupErrorHandling(): void {\n // tslint:disable-next-line: completed-docs\n function errorCallback(): void {\n if (Tracing._activeTransaction) {\n /**\n * If an error or unhandled promise occurs, we mark the active transaction as failed\n */\n logger.log(`[Tracing] Global error occured, setting status in transaction: ${SpanStatus.InternalError}`);\n (Tracing._activeTransaction as SpanClass).setStatus(SpanStatus.InternalError);\n }\n }\n addInstrumentationHandler({\n callback: errorCallback,\n type: 'error',\n });\n addInstrumentationHandler({\n callback: errorCallback,\n type: 'unhandledrejection',\n });\n }\n\n /**\n * Is tracing enabled\n */\n private static _isEnabled(): boolean {\n if (Tracing._enabled !== undefined) {\n return Tracing._enabled;\n }\n // This happens only in test cases where the integration isn't initalized properly\n // tslint:disable-next-line: strict-type-predicates\n if (!Tracing.options || typeof Tracing.options.tracesSampleRate !== 'number') {\n return false;\n }\n Tracing._enabled = Math.random() > Tracing.options.tracesSampleRate ? false : true;\n return Tracing._enabled;\n }\n\n /**\n * Starts a Transaction waiting for activity idle to finish\n */\n public static startIdleTransaction(name: string, spanContext?: SpanContext): Span | undefined {\n if (!Tracing._isEnabled()) {\n // Tracing is not enabled\n return undefined;\n }\n\n // If we already have an active transaction it means one of two things\n // a) The user did rapid navigation changes and didn't wait until the transaction was finished\n // b) A activity wasn't popped correctly and therefore the transaction is stalling\n Tracing.finishIdleTransaction();\n\n logger.log('[Tracing] startIdleTransaction, name:', name);\n\n const _getCurrentHub = Tracing._getCurrentHub;\n if (!_getCurrentHub) {\n return undefined;\n }\n\n const hub = _getCurrentHub();\n if (!hub) {\n return undefined;\n }\n\n const span = hub.startSpan(\n {\n ...spanContext,\n transaction: name,\n },\n true,\n );\n\n Tracing._activeTransaction = span;\n\n // We need to do this workaround here and not use configureScope\n // Reason being at the time we start the inital transaction we do not have a client bound on the hub yet\n // therefore configureScope wouldn't be executed and we would miss setting the transaction\n // tslint:disable-next-line: no-unsafe-any\n (hub as any).getScope().setSpan(span);\n\n // The reason we do this here is because of cached responses\n // If we start and transaction without an activity it would never finish since there is no activity\n const id = Tracing.pushActivity('idleTransactionStarted');\n setTimeout(() => {\n Tracing.popActivity(id);\n }, (Tracing.options && Tracing.options.idleTimeout) || 100);\n\n return span;\n }\n\n /**\n * Update transaction\n * @deprecated\n */\n public static updateTransactionName(name: string): void {\n logger.log('[Tracing] DEPRECATED, use Sentry.configureScope => scope.setTransaction instead', name);\n const _getCurrentHub = Tracing._getCurrentHub;\n if (_getCurrentHub) {\n const hub = _getCurrentHub();\n if (hub) {\n hub.configureScope(scope => {\n scope.setTransaction(name);\n });\n }\n }\n }\n\n /**\n * Finshes the current active transaction\n */\n public static finishIdleTransaction(): void {\n const active = Tracing._activeTransaction as SpanClass;\n if (active) {\n Tracing._addPerformanceEntries(active);\n logger.log('[Tracing] finishIdleTransaction', active.transaction);\n active.finish(/*trimEnd*/ true);\n Tracing._resetActiveTransaction();\n }\n }\n\n /**\n * This uses `performance.getEntries()` to add additional spans to the active transaction.\n * Also, we update our timings since we consider the timings in this API to be more correct than our manual\n * measurements.\n *\n * @param transactionSpan The transaction span\n */\n private static _addPerformanceEntries(transactionSpan: SpanClass): void {\n if (!global.performance) {\n // Gatekeeper if performance API not available\n return;\n }\n\n logger.log('[Tracing] Adding & adjusting spans using Performance API');\n\n const timeOrigin = Tracing._msToSec(performance.timeOrigin);\n\n // tslint:disable-next-line: completed-docs\n function addSpan(span: SpanClass): void {\n if (transactionSpan.spanRecorder) {\n transactionSpan.spanRecorder.finishSpan(span);\n }\n }\n\n // tslint:disable-next-line: completed-docs\n function addPerformanceNavigationTiming(parent: SpanClass, entry: { [key: string]: number }, event: string): void {\n const span = parent.child({\n description: event,\n op: 'browser',\n });\n span.startTimestamp = timeOrigin + Tracing._msToSec(entry[`${event}Start`]);\n span.timestamp = timeOrigin + Tracing._msToSec(entry[`${event}End`]);\n addSpan(span);\n }\n\n // tslint:disable-next-line: completed-docs\n function addRequest(parent: SpanClass, entry: { [key: string]: number }): void {\n const request = parent.child({\n description: 'request',\n op: 'browser',\n });\n request.startTimestamp = timeOrigin + Tracing._msToSec(entry.requestStart);\n request.timestamp = timeOrigin + Tracing._msToSec(entry.responseEnd);\n addSpan(request);\n const response = parent.child({\n description: 'response',\n op: 'browser',\n });\n response.startTimestamp = timeOrigin + Tracing._msToSec(entry.responseStart);\n response.timestamp = timeOrigin + Tracing._msToSec(entry.responseEnd);\n addSpan(response);\n }\n\n let entryScriptSrc: string | undefined;\n\n if (global.document) {\n // tslint:disable-next-line: prefer-for-of\n for (let i = 0; i < document.scripts.length; i++) {\n // We go through all scripts on the page and look for 'data-entry'\n // We remember the name and measure the time between this script finished loading and\n // our mark 'sentry-tracing-init'\n if (document.scripts[i].dataset.entry === 'true') {\n entryScriptSrc = document.scripts[i].src;\n break;\n }\n }\n }\n\n let entryScriptStartEndTime: number | undefined;\n let tracingInitMarkStartTime: number | undefined;\n\n // tslint:disable: no-unsafe-any\n performance\n .getEntries()\n .slice(Tracing._performanceCursor)\n .forEach((entry: any) => {\n const startTime = Tracing._msToSec(entry.startTime as number);\n const duration = Tracing._msToSec(entry.duration as number);\n\n if (transactionSpan.op === 'navigation' && timeOrigin + startTime < transactionSpan.startTimestamp) {\n return;\n }\n\n switch (entry.entryType) {\n case 'navigation':\n addPerformanceNavigationTiming(transactionSpan, entry, 'unloadEvent');\n addPerformanceNavigationTiming(transactionSpan, entry, 'domContentLoadedEvent');\n addPerformanceNavigationTiming(transactionSpan, entry, 'loadEvent');\n addPerformanceNavigationTiming(transactionSpan, entry, 'connect');\n addPerformanceNavigationTiming(transactionSpan, entry, 'domainLookup');\n addRequest(transactionSpan, entry);\n break;\n case 'mark':\n case 'paint':\n case 'measure':\n const mark = transactionSpan.child({\n description: `${entry.entryType} ${entry.name}`,\n op: 'mark',\n });\n mark.startTimestamp = timeOrigin + startTime;\n mark.timestamp = mark.startTimestamp + duration;\n if (tracingInitMarkStartTime === undefined && entry.name === 'sentry-tracing-init') {\n tracingInitMarkStartTime = mark.startTimestamp;\n }\n addSpan(mark);\n break;\n case 'resource':\n const resourceName = entry.name.replace(window.location.origin, '');\n if (entry.initiatorType === 'xmlhttprequest' || entry.initiatorType === 'fetch') {\n // We need to update existing spans with new timing info\n if (transactionSpan.spanRecorder) {\n transactionSpan.spanRecorder.finishedSpans.map((finishedSpan: SpanClass) => {\n if (finishedSpan.description && finishedSpan.description.indexOf(resourceName) !== -1) {\n finishedSpan.startTimestamp = timeOrigin + startTime;\n finishedSpan.timestamp = finishedSpan.startTimestamp + duration;\n }\n });\n }\n } else {\n const resource = transactionSpan.child({\n description: `${entry.initiatorType} ${resourceName}`,\n op: `resource`,\n });\n resource.startTimestamp = timeOrigin + startTime;\n resource.timestamp = resource.startTimestamp + duration;\n // We remember the entry script end time to calculate the difference to the first init mark\n if (entryScriptStartEndTime === undefined && (entryScriptSrc || '').includes(resourceName)) {\n entryScriptStartEndTime = resource.timestamp;\n }\n addSpan(resource);\n }\n break;\n default:\n // Ignore other entry types.\n }\n });\n\n if (entryScriptStartEndTime !== undefined && tracingInitMarkStartTime !== undefined) {\n const evaluation = transactionSpan.child({\n description: 'evaluation',\n op: `script`,\n });\n evaluation.startTimestamp = entryScriptStartEndTime;\n evaluation.timestamp = tracingInitMarkStartTime;\n addSpan(evaluation);\n }\n\n Tracing._performanceCursor = Math.max(performance.getEntries().length - 1, 0);\n\n // tslint:enable: no-unsafe-any\n }\n\n /**\n * Sets the status of the current active transaction (if there is one)\n */\n public static setTransactionStatus(status: SpanStatus): void {\n const active = Tracing._activeTransaction;\n if (active) {\n logger.log('[Tracing] setTransactionStatus', status);\n active.setStatus(status);\n }\n }\n\n /**\n * Converts from milliseconds to seconds\n * @param time time in ms\n */\n private static _msToSec(time: number): number {\n return time / 1000;\n }\n\n /**\n * Starts tracking for a specifc activity\n *\n * @param name Name of the activity, can be any string (Only used internally to identify the activity)\n * @param spanContext If provided a Span with the SpanContext will be created.\n * @param options _autoPopAfter_ | Time in ms, if provided the activity will be popped automatically after this timeout. This can be helpful in cases where you cannot gurantee your application knows the state and calls `popActivity` for sure.\n */\n public static pushActivity(\n name: string,\n spanContext?: SpanContext,\n options?: {\n autoPopAfter?: number;\n },\n ): number {\n if (!Tracing._isEnabled()) {\n // Tracing is not enabled\n return 0;\n }\n if (!Tracing._activeTransaction) {\n logger.log(`[Tracing] Not pushing activity ${name} since there is no active transaction`);\n return 0;\n }\n\n // We want to clear the timeout also here since we push a new activity\n clearTimeout(Tracing._debounce);\n\n const _getCurrentHub = Tracing._getCurrentHub;\n if (spanContext && _getCurrentHub) {\n const hub = _getCurrentHub();\n if (hub) {\n const span = hub.startSpan(spanContext);\n Tracing._activities[Tracing._currentIndex] = {\n name,\n span,\n };\n }\n } else {\n Tracing._activities[Tracing._currentIndex] = {\n name,\n };\n }\n\n logger.log(`[Tracing] pushActivity: ${name}#${Tracing._currentIndex}`);\n logger.log('[Tracing] activies count', Object.keys(Tracing._activities).length);\n if (options && typeof options.autoPopAfter === 'number') {\n logger.log(`[Tracing] auto pop of: ${name}#${Tracing._currentIndex} in ${options.autoPopAfter}ms`);\n const index = Tracing._currentIndex;\n setTimeout(() => {\n Tracing.popActivity(index, {\n autoPop: true,\n status: SpanStatus.DeadlineExceeded,\n });\n }, options.autoPopAfter);\n }\n return Tracing._currentIndex++;\n }\n\n /**\n * Removes activity and finishes the span in case there is one\n */\n public static popActivity(id: number, spanData?: { [key: string]: any }): void {\n // The !id is on purpose to also fail with 0\n // Since 0 is returned by push activity in case tracing is not enabled\n // or there is no active transaction\n if (!Tracing._isEnabled() || !id) {\n // Tracing is not enabled\n return;\n }\n\n const activity = Tracing._activities[id];\n\n if (activity) {\n logger.log(`[Tracing] popActivity ${activity.name}#${id}`);\n const span = activity.span as SpanClass;\n if (span) {\n if (spanData) {\n Object.keys(spanData).forEach((key: string) => {\n span.setData(key, spanData[key]);\n if (key === 'status_code') {\n span.setHttpStatus(spanData[key] as number);\n }\n if (key === 'status') {\n span.setStatus(spanData[key] as SpanStatus);\n }\n });\n }\n span.finish();\n }\n // tslint:disable-next-line: no-dynamic-delete\n delete Tracing._activities[id];\n }\n\n const count = Object.keys(Tracing._activities).length;\n clearTimeout(Tracing._debounce);\n\n logger.log('[Tracing] activies count', count);\n\n if (count === 0 && Tracing._activeTransaction) {\n const timeout = Tracing.options && Tracing.options.idleTimeout;\n logger.log(`[Tracing] Flushing Transaction in ${timeout}ms`);\n Tracing._debounce = (setTimeout(() => {\n Tracing.finishIdleTransaction();\n }, timeout) as any) as number;\n }\n }\n}\n\n/**\n * Creates breadcrumbs from XHR API calls\n */\nfunction xhrCallback(handlerData: { [key: string]: any }): void {\n if (!Tracing.options.traceXHR) {\n return;\n }\n\n // tslint:disable-next-line: no-unsafe-any\n if (!handlerData || !handlerData.xhr || !handlerData.xhr.__sentry_xhr__) {\n return;\n }\n\n // tslint:disable: no-unsafe-any\n const xhr = handlerData.xhr.__sentry_xhr__;\n\n if (!Tracing.options.shouldCreateSpanForRequest(xhr.url)) {\n return;\n }\n\n // We only capture complete, non-sentry requests\n if (handlerData.xhr.__sentry_own_request__) {\n return;\n }\n\n if (handlerData.endTimestamp && handlerData.xhr.__sentry_xhr_activity_id__) {\n Tracing.popActivity(handlerData.xhr.__sentry_xhr_activity_id__, handlerData.xhr.__sentry_xhr__);\n return;\n }\n\n handlerData.xhr.__sentry_xhr_activity_id__ = Tracing.pushActivity('xhr', {\n data: {\n ...xhr.data,\n type: 'xhr',\n },\n description: `${xhr.method} ${xhr.url}`,\n op: 'http',\n });\n\n // Adding the trace header to the span\n const activity = Tracing._activities[handlerData.xhr.__sentry_xhr_activity_id__];\n if (activity) {\n const span = activity.span;\n if (span && handlerData.xhr.setRequestHeader) {\n handlerData.xhr.setRequestHeader('sentry-trace', span.toTraceparent());\n }\n }\n // tslint:enable: no-unsafe-any\n}\n\n/**\n * Creates breadcrumbs from fetch API calls\n */\nfunction fetchCallback(handlerData: { [key: string]: any }): void {\n // tslint:disable: no-unsafe-any\n if (!Tracing.options.traceFetch) {\n return;\n }\n\n if (!Tracing.options.shouldCreateSpanForRequest(handlerData.fetchData.url)) {\n return;\n }\n\n if (handlerData.endTimestamp && handlerData.fetchData.__activity) {\n Tracing.popActivity(handlerData.fetchData.__activity, handlerData.fetchData);\n } else {\n handlerData.fetchData.__activity = Tracing.pushActivity('fetch', {\n data: {\n ...handlerData.fetchData,\n type: 'fetch',\n },\n description: `${handlerData.fetchData.method} ${handlerData.fetchData.url}`,\n op: 'http',\n });\n\n const activity = Tracing._activities[handlerData.fetchData.__activity];\n if (activity) {\n const span = activity.span;\n if (span) {\n const options = (handlerData.args[1] = (handlerData.args[1] as { [key: string]: any }) || {});\n if (options.headers) {\n if (Array.isArray(options.headers)) {\n options.headers = [...options.headers, { 'sentry-trace': span.toTraceparent() }];\n } else {\n options.headers = {\n ...options.headers,\n 'sentry-trace': span.toTraceparent(),\n };\n }\n } else {\n options.headers = { 'sentry-trace': span.toTraceparent() };\n }\n }\n }\n }\n // tslint:enable: no-unsafe-any\n}\n\n/**\n * Creates transaction from navigation changes\n */\nfunction historyCallback(_: { [key: string]: any }): void {\n if (Tracing.options.startTransactionOnLocationChange && global && global.location) {\n Tracing.startIdleTransaction(global.location.href, {\n op: 'navigation',\n sampled: true,\n });\n }\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/span.d.ts b/node_modules/@sentry/apm/dist/span.d.ts
deleted file mode 100644
index 63b488a..0000000
--- a/node_modules/@sentry/apm/dist/span.d.ts
+++ /dev/null
@@ -1,143 +0,0 @@
-import { Hub } from '@sentry/hub';
-import { Span as SpanInterface, SpanContext, SpanStatus } from '@sentry/types';
-export declare const TRACEPARENT_REGEXP: RegExp;
-/**
- * Keeps track of finished spans for a given transaction
- */
-declare class SpanRecorder {
- private readonly _maxlen;
- private _openSpanCount;
- finishedSpans: Span[];
- constructor(maxlen: number);
- /**
- * This is just so that we don't run out of memory while recording a lot
- * of spans. At some point we just stop and flush out the start of the
- * trace tree (i.e.the first n spans with the smallest
- * start_timestamp).
- */
- startSpan(span: Span): void;
- /**
- * Appends a span to finished spans table
- * @param span Span to be added
- */
- finishSpan(span: Span): void;
-}
-/**
- * Span contains all data about a span
- */
-export declare class Span implements SpanInterface, SpanContext {
- /**
- * The reference to the current hub.
- */
- private readonly _hub;
- /**
- * @inheritDoc
- */
- private readonly _traceId;
- /**
- * @inheritDoc
- */
- private readonly _spanId;
- /**
- * @inheritDoc
- */
- private readonly _parentSpanId?;
- /**
- * @inheritDoc
- */
- sampled?: boolean;
- /**
- * Timestamp in seconds when the span was created.
- */
- startTimestamp: number;
- /**
- * Timestamp in seconds when the span ended.
- */
- timestamp?: number;
- /**
- * @inheritDoc
- */
- transaction?: string;
- /**
- * @inheritDoc
- */
- op?: string;
- /**
- * @inheritDoc
- */
- description?: string;
- /**
- * @inheritDoc
- */
- tags: {
- [key: string]: string;
- };
- /**
- * @inheritDoc
- */
- data: {
- [key: string]: any;
- };
- /**
- * List of spans that were finalized
- */
- spanRecorder?: SpanRecorder;
- constructor(spanContext?: SpanContext, hub?: Hub);
- /**
- * Attaches SpanRecorder to the span itself
- * @param maxlen maximum number of spans that can be recorded
- */
- initFinishedSpans(maxlen?: number): void;
- /**
- * Creates a new `Span` while setting the current `Span.id` as `parentSpanId`.
- * Also the `sampled` decision will be inherited.
- */
- child(spanContext?: Pick>): Span;
- /**
- * Continues a trace from a string (usually the header).
- * @param traceparent Traceparent string
- */
- static fromTraceparent(traceparent: string, spanContext?: Pick>): Span | undefined;
- /**
- * @inheritDoc
- */
- setTag(key: string, value: string): this;
- /**
- * @inheritDoc
- */
- setData(key: string, value: any): this;
- /**
- * @inheritDoc
- */
- setStatus(value: SpanStatus): this;
- /**
- * @inheritDoc
- */
- setHttpStatus(httpStatus: number): this;
- /**
- * @inheritDoc
- */
- isSuccess(): boolean;
- /**
- * Sets the finish timestamp on the current span.
- * @param trimEnd If true, sets the end timestamp of the transaction to the highest timestamp of child spans, trimming
- * the duration of the transaction span. This is useful to discard extra time in the transaction span that is not
- * accounted for in child spans, like what happens in the idle transaction Tracing integration, where we finish the
- * transaction after a given "idle time" and we don't want this "idle time" to be part of the transaction.
- */
- finish(trimEnd?: boolean): string | undefined;
- /**
- * @inheritDoc
- */
- toTraceparent(): string;
- /**
- * @inheritDoc
- */
- getTraceContext(): object;
- /**
- * @inheritDoc
- */
- toJSON(): object;
-}
-export {};
-//# sourceMappingURL=span.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/span.d.ts.map b/node_modules/@sentry/apm/dist/span.d.ts.map
deleted file mode 100644
index 10c75c2..0000000
--- a/node_modules/@sentry/apm/dist/span.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"span.d.ts","sourceRoot":"","sources":["../src/span.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB,GAAG,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI/E,eAAO,MAAM,kBAAkB,QAM9B,CAAC;AAEF;;GAEG;AACH,cAAM,YAAY;IAChB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,cAAc,CAAa;IAC5B,aAAa,EAAE,IAAI,EAAE,CAAM;gBAEf,MAAM,EAAE,MAAM;IAIjC;;;;;OAKG;IACI,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAOlC;;;OAGG;IACI,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;CAGpC;AAED;;GAEG;AACH,qBAAa,IAAK,YAAW,aAAa,EAAE,WAAW;IACrD;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA4C;IAEjE;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmB;IAE5C;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiC;IAEzD;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAS;IAExC;;OAEG;IACI,OAAO,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACI,cAAc,EAAE,MAAM,CAAqB;IAElD;;OAEG;IACI,SAAS,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACI,WAAW,CAAC,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACI,EAAE,CAAC,EAAE,MAAM,CAAC;IAEnB;;O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G;IACI,MAAM,IAAI,MAAM;CAexB"}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/span.js b/node_modules/@sentry/apm/dist/span.js
deleted file mode 100644
index a8b64ab..0000000
--- a/node_modules/@sentry/apm/dist/span.js
+++ /dev/null
@@ -1,284 +0,0 @@
-// tslint:disable:max-classes-per-file
-Object.defineProperty(exports, "__esModule", { value: true });
-var tslib_1 = require("tslib");
-var hub_1 = require("@sentry/hub");
-var types_1 = require("@sentry/types");
-var utils_1 = require("@sentry/utils");
-// TODO: Should this be exported?
-exports.TRACEPARENT_REGEXP = new RegExp('^[ \\t]*' + // whitespace
- '([0-9a-f]{32})?' + // trace_id
- '-?([0-9a-f]{16})?' + // span_id
- '-?([01])?' + // sampled
- '[ \\t]*$');
-/**
- * Keeps track of finished spans for a given transaction
- */
-var SpanRecorder = /** @class */ (function () {
- function SpanRecorder(maxlen) {
- this._openSpanCount = 0;
- this.finishedSpans = [];
- this._maxlen = maxlen;
- }
- /**
- * This is just so that we don't run out of memory while recording a lot
- * of spans. At some point we just stop and flush out the start of the
- * trace tree (i.e.the first n spans with the smallest
- * start_timestamp).
- */
- SpanRecorder.prototype.startSpan = function (span) {
- this._openSpanCount += 1;
- if (this._openSpanCount > this._maxlen) {
- span.spanRecorder = undefined;
- }
- };
- /**
- * Appends a span to finished spans table
- * @param span Span to be added
- */
- SpanRecorder.prototype.finishSpan = function (span) {
- this.finishedSpans.push(span);
- };
- return SpanRecorder;
-}());
-/**
- * Span contains all data about a span
- */
-var Span = /** @class */ (function () {
- function Span(spanContext, hub) {
- /**
- * The reference to the current hub.
- */
- this._hub = hub_1.getCurrentHub();
- /**
- * @inheritDoc
- */
- this._traceId = utils_1.uuid4();
- /**
- * @inheritDoc
- */
- this._spanId = utils_1.uuid4().substring(16);
- /**
- * Timestamp in seconds when the span was created.
- */
- this.startTimestamp = utils_1.timestampWithMs();
- /**
- * @inheritDoc
- */
- this.tags = {};
- /**
- * @inheritDoc
- */
- this.data = {};
- if (utils_1.isInstanceOf(hub, hub_1.Hub)) {
- this._hub = hub;
- }
- if (!spanContext) {
- return this;
- }
- if (spanContext.traceId) {
- this._traceId = spanContext.traceId;
- }
- if (spanContext.spanId) {
- this._spanId = spanContext.spanId;
- }
- if (spanContext.parentSpanId) {
- this._parentSpanId = spanContext.parentSpanId;
- }
- // We want to include booleans as well here
- if ('sampled' in spanContext) {
- this.sampled = spanContext.sampled;
- }
- if (spanContext.transaction) {
- this.transaction = spanContext.transaction;
- }
- if (spanContext.op) {
- this.op = spanContext.op;
- }
- if (spanContext.description) {
- this.description = spanContext.description;
- }
- if (spanContext.data) {
- this.data = spanContext.data;
- }
- if (spanContext.tags) {
- this.tags = spanContext.tags;
- }
- }
- /**
- * Attaches SpanRecorder to the span itself
- * @param maxlen maximum number of spans that can be recorded
- */
- Span.prototype.initFinishedSpans = function (maxlen) {
- if (maxlen === void 0) { maxlen = 1000; }
- if (!this.spanRecorder) {
- this.spanRecorder = new SpanRecorder(maxlen);
- }
- this.spanRecorder.startSpan(this);
- };
- /**
- * Creates a new `Span` while setting the current `Span.id` as `parentSpanId`.
- * Also the `sampled` decision will be inherited.
- */
- Span.prototype.child = function (spanContext) {
- var span = new Span(tslib_1.__assign({}, spanContext, { parentSpanId: this._spanId, sampled: this.sampled, traceId: this._traceId }));
- span.spanRecorder = this.spanRecorder;
- return span;
- };
- /**
- * Continues a trace from a string (usually the header).
- * @param traceparent Traceparent string
- */
- Span.fromTraceparent = function (traceparent, spanContext) {
- var matches = traceparent.match(exports.TRACEPARENT_REGEXP);
- if (matches) {
- var sampled = void 0;
- if (matches[3] === '1') {
- sampled = true;
- }
- else if (matches[3] === '0') {
- sampled = false;
- }
- return new Span(tslib_1.__assign({}, spanContext, { parentSpanId: matches[2], sampled: sampled, traceId: matches[1] }));
- }
- return undefined;
- };
- /**
- * @inheritDoc
- */
- Span.prototype.setTag = function (key, value) {
- var _a;
- this.tags = tslib_1.__assign({}, this.tags, (_a = {}, _a[key] = value, _a));
- return this;
- };
- /**
- * @inheritDoc
- */
- Span.prototype.setData = function (key, value) {
- var _a;
- this.data = tslib_1.__assign({}, this.data, (_a = {}, _a[key] = value, _a));
- return this;
- };
- /**
- * @inheritDoc
- */
- Span.prototype.setStatus = function (value) {
- this.setTag('status', value);
- return this;
- };
- /**
- * @inheritDoc
- */
- Span.prototype.setHttpStatus = function (httpStatus) {
- this.setTag('http.status_code', String(httpStatus));
- var spanStatus = types_1.SpanStatus.fromHttpCode(httpStatus);
- if (spanStatus !== types_1.SpanStatus.UnknownError) {
- this.setStatus(spanStatus);
- }
- return this;
- };
- /**
- * @inheritDoc
- */
- Span.prototype.isSuccess = function () {
- return this.tags.status === types_1.SpanStatus.Ok;
- };
- /**
- * Sets the finish timestamp on the current span.
- * @param trimEnd If true, sets the end timestamp of the transaction to the highest timestamp of child spans, trimming
- * the duration of the transaction span. This is useful to discard extra time in the transaction span that is not
- * accounted for in child spans, like what happens in the idle transaction Tracing integration, where we finish the
- * transaction after a given "idle time" and we don't want this "idle time" to be part of the transaction.
- */
- Span.prototype.finish = function (trimEnd) {
- var _this = this;
- if (trimEnd === void 0) { trimEnd = false; }
- // This transaction is already finished, so we should not flush it again.
- if (this.timestamp !== undefined) {
- return undefined;
- }
- this.timestamp = utils_1.timestampWithMs();
- if (this.spanRecorder === undefined) {
- return undefined;
- }
- this.spanRecorder.finishSpan(this);
- if (this.transaction === undefined) {
- // If this has no transaction set we assume there's a parent
- // transaction for this span that would be flushed out eventually.
- return undefined;
- }
- if (this.sampled === undefined) {
- // At this point a `sampled === undefined` should have already been
- // resolved to a concrete decision. If `sampled` is `undefined`, it's
- // likely that somebody used `Sentry.startSpan(...)` on a
- // non-transaction span and later decided to make it a transaction.
- utils_1.logger.warn('Discarding transaction Span without sampling decision');
- return undefined;
- }
- var finishedSpans = this.spanRecorder ? this.spanRecorder.finishedSpans.filter(function (s) { return s !== _this; }) : [];
- if (trimEnd && finishedSpans.length > 0) {
- this.timestamp = finishedSpans.reduce(function (prev, current) {
- if (prev.timestamp && current.timestamp) {
- return prev.timestamp > current.timestamp ? prev : current;
- }
- return prev;
- }).timestamp;
- }
- return this._hub.captureEvent({
- contexts: {
- trace: this.getTraceContext(),
- },
- spans: finishedSpans,
- start_timestamp: this.startTimestamp,
- tags: this.tags,
- timestamp: this.timestamp,
- transaction: this.transaction,
- type: 'transaction',
- });
- };
- /**
- * @inheritDoc
- */
- Span.prototype.toTraceparent = function () {
- var sampledString = '';
- if (this.sampled !== undefined) {
- sampledString = this.sampled ? '-1' : '-0';
- }
- return this._traceId + "-" + this._spanId + sampledString;
- };
- /**
- * @inheritDoc
- */
- Span.prototype.getTraceContext = function () {
- return utils_1.dropUndefinedKeys({
- data: Object.keys(this.data).length > 0 ? this.data : undefined,
- description: this.description,
- op: this.op,
- parent_span_id: this._parentSpanId,
- span_id: this._spanId,
- status: this.tags.status,
- tags: Object.keys(this.tags).length > 0 ? this.tags : undefined,
- trace_id: this._traceId,
- });
- };
- /**
- * @inheritDoc
- */
- Span.prototype.toJSON = function () {
- return utils_1.dropUndefinedKeys({
- data: Object.keys(this.data).length > 0 ? this.data : undefined,
- description: this.description,
- op: this.op,
- parent_span_id: this._parentSpanId,
- sampled: this.sampled,
- span_id: this._spanId,
- start_timestamp: this.startTimestamp,
- tags: Object.keys(this.tags).length > 0 ? this.tags : undefined,
- timestamp: this.timestamp,
- trace_id: this._traceId,
- transaction: this.transaction,
- });
- };
- return Span;
-}());
-exports.Span = Span;
-//# sourceMappingURL=span.js.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/dist/span.js.map b/node_modules/@sentry/apm/dist/span.js.map
deleted file mode 100644
index 438cd1c..0000000
--- a/node_modules/@sentry/apm/dist/span.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"span.js","sourceRoot":"","sources":["../src/span.ts"],"names":[],"mappings":"AAAA,sCAAsC;;;AAEtC,mCAAiD;AACjD,uCAA+E;AAC/E,uCAAgG;AAEhG,iCAAiC;AACpB,QA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AAC;IACL,CAAC;IACH,WAAC;AAAD,CAAC,AAnTD,IAmTC;AAnTY,oBAAI","sourcesContent":["// tslint:disable:max-classes-per-file\n\nimport { getCurrentHub, Hub } from '@sentry/hub';\nimport { Span as SpanInterface, SpanContext, SpanStatus } from '@sentry/types';\nimport { dropUndefinedKeys, isInstanceOf, logger, timestampWithMs, uuid4 } from '@sentry/utils';\n\n// TODO: Should this be exported?\nexport const TRACEPARENT_REGEXP = new RegExp(\n '^[ \\\\t]*' + // whitespace\n '([0-9a-f]{32})?' + // trace_id\n '-?([0-9a-f]{16})?' + // span_id\n '-?([01])?' + // sampled\n '[ \\\\t]*$', // whitespace\n);\n\n/**\n * Keeps track of finished spans for a given transaction\n */\nclass SpanRecorder {\n private readonly _maxlen: number;\n private _openSpanCount: number = 0;\n public finishedSpans: Span[] = [];\n\n public constructor(maxlen: number) {\n this._maxlen = maxlen;\n }\n\n /**\n * This is just so that we don't run out of memory while recording a lot\n * of spans. At some point we just stop and flush out the start of the\n * trace tree (i.e.the first n spans with the smallest\n * start_timestamp).\n */\n public startSpan(span: Span): void {\n this._openSpanCount += 1;\n if (this._openSpanCount > this._maxlen) {\n span.spanRecorder = undefined;\n }\n }\n\n /**\n * Appends a span to finished spans table\n * @param span Span to be added\n */\n public finishSpan(span: Span): void {\n this.finishedSpans.push(span);\n }\n}\n\n/**\n * Span contains all data about a span\n */\nexport class Span implements SpanInterface, SpanContext {\n /**\n * The reference to the current hub.\n */\n private readonly _hub: Hub = (getCurrentHub() as unknown) as Hub;\n\n /**\n * @inheritDoc\n */\n private readonly _traceId: string = uuid4();\n\n /**\n * @inheritDoc\n */\n private readonly _spanId: string = uuid4().substring(16);\n\n /**\n * @inheritDoc\n */\n private readonly _parentSpanId?: string;\n\n /**\n * @inheritDoc\n */\n public sampled?: boolean;\n\n /**\n * Timestamp in seconds when the span was created.\n */\n public startTimestamp: number = timestampWithMs();\n\n /**\n * Timestamp in seconds when the span ended.\n */\n public timestamp?: number;\n\n /**\n * @inheritDoc\n */\n public transaction?: string;\n\n /**\n * @inheritDoc\n */\n public op?: string;\n\n /**\n * @inheritDoc\n */\n public description?: string;\n\n /**\n * @inheritDoc\n */\n public tags: { [key: string]: string } = {};\n\n /**\n * @inheritDoc\n */\n public data: { [key: string]: any } = {};\n\n /**\n * List of spans that were finalized\n */\n public spanRecorder?: SpanRecorder;\n\n public constructor(spanContext?: SpanContext, hub?: Hub) {\n if (isInstanceOf(hub, Hub)) {\n this._hub = hub as Hub;\n }\n\n if (!spanContext) {\n return this;\n }\n\n if (spanContext.traceId) {\n this._traceId = spanContext.traceId;\n }\n if (spanContext.spanId) {\n this._spanId = spanContext.spanId;\n }\n if (spanContext.parentSpanId) {\n this._parentSpanId = spanContext.parentSpanId;\n }\n // We want to include booleans as well here\n if ('sampled' in spanContext) {\n this.sampled = spanContext.sampled;\n }\n if (spanContext.transaction) {\n this.transaction = spanContext.transaction;\n }\n if (spanContext.op) {\n this.op = spanContext.op;\n }\n if (spanContext.description) {\n this.description = spanContext.description;\n }\n if (spanContext.data) {\n this.data = spanContext.data;\n }\n if (spanContext.tags) {\n this.tags = spanContext.tags;\n }\n }\n\n /**\n * Attaches SpanRecorder to the span itself\n * @param maxlen maximum number of spans that can be recorded\n */\n public initFinishedSpans(maxlen: number = 1000): void {\n if (!this.spanRecorder) {\n this.spanRecorder = new SpanRecorder(maxlen);\n }\n this.spanRecorder.startSpan(this);\n }\n\n /**\n * Creates a new `Span` while setting the current `Span.id` as `parentSpanId`.\n * Also the `sampled` decision will be inherited.\n */\n public child(spanContext?: Pick>): Span {\n const span = new Span({\n ...spanContext,\n parentSpanId: this._spanId,\n sampled: this.sampled,\n traceId: this._traceId,\n });\n\n span.spanRecorder = this.spanRecorder;\n\n return span;\n }\n\n /**\n * Continues a trace from a string (usually the header).\n * @param traceparent Traceparent string\n */\n public static fromTraceparent(\n traceparent: string,\n spanContext?: Pick>,\n ): Span | undefined {\n const matches = traceparent.match(TRACEPARENT_REGEXP);\n if (matches) {\n let sampled: boolean | undefined;\n if (matches[3] === '1') {\n sampled = true;\n } else if (matches[3] === '0') {\n sampled = false;\n }\n return new Span({\n ...spanContext,\n parentSpanId: matches[2],\n sampled,\n traceId: matches[1],\n });\n }\n return undefined;\n }\n\n /**\n * @inheritDoc\n */\n public setTag(key: string, value: string): this {\n this.tags = { ...this.tags, [key]: value };\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setData(key: string, value: any): this {\n this.data = { ...this.data, [key]: value };\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setStatus(value: SpanStatus): this {\n this.setTag('status', value);\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setHttpStatus(httpStatus: number): this {\n this.setTag('http.status_code', String(httpStatus));\n const spanStatus = SpanStatus.fromHttpCode(httpStatus);\n if (spanStatus !== SpanStatus.UnknownError) {\n this.setStatus(spanStatus);\n }\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public isSuccess(): boolean {\n return this.tags.status === SpanStatus.Ok;\n }\n\n /**\n * Sets the finish timestamp on the current span.\n * @param trimEnd If true, sets the end timestamp of the transaction to the highest timestamp of child spans, trimming\n * the duration of the transaction span. This is useful to discard extra time in the transaction span that is not\n * accounted for in child spans, like what happens in the idle transaction Tracing integration, where we finish the\n * transaction after a given \"idle time\" and we don't want this \"idle time\" to be part of the transaction.\n */\n public finish(trimEnd: boolean = false): string | undefined {\n // This transaction is already finished, so we should not flush it again.\n if (this.timestamp !== undefined) {\n return undefined;\n }\n\n this.timestamp = timestampWithMs();\n\n if (this.spanRecorder === undefined) {\n return undefined;\n }\n\n this.spanRecorder.finishSpan(this);\n\n if (this.transaction === undefined) {\n // If this has no transaction set we assume there's a parent\n // transaction for this span that would be flushed out eventually.\n return undefined;\n }\n\n if (this.sampled === undefined) {\n // At this point a `sampled === undefined` should have already been\n // resolved to a concrete decision. If `sampled` is `undefined`, it's\n // likely that somebody used `Sentry.startSpan(...)` on a\n // non-transaction span and later decided to make it a transaction.\n logger.warn('Discarding transaction Span without sampling decision');\n return undefined;\n }\n\n const finishedSpans = this.spanRecorder ? this.spanRecorder.finishedSpans.filter(s => s !== this) : [];\n\n if (trimEnd && finishedSpans.length > 0) {\n this.timestamp = finishedSpans.reduce((prev: Span, current: Span) => {\n if (prev.timestamp && current.timestamp) {\n return prev.timestamp > current.timestamp ? prev : current;\n }\n return prev;\n }).timestamp;\n }\n\n return this._hub.captureEvent({\n contexts: {\n trace: this.getTraceContext(),\n },\n spans: finishedSpans,\n start_timestamp: this.startTimestamp,\n tags: this.tags,\n timestamp: this.timestamp,\n transaction: this.transaction,\n type: 'transaction',\n });\n }\n\n /**\n * @inheritDoc\n */\n public toTraceparent(): string {\n let sampledString = '';\n if (this.sampled !== undefined) {\n sampledString = this.sampled ? '-1' : '-0';\n }\n return `${this._traceId}-${this._spanId}${sampledString}`;\n }\n\n /**\n * @inheritDoc\n */\n public getTraceContext(): object {\n return dropUndefinedKeys({\n data: Object.keys(this.data).length > 0 ? this.data : undefined,\n description: this.description,\n op: this.op,\n parent_span_id: this._parentSpanId,\n span_id: this._spanId,\n status: this.tags.status,\n tags: Object.keys(this.tags).length > 0 ? this.tags : undefined,\n trace_id: this._traceId,\n });\n }\n\n /**\n * @inheritDoc\n */\n public toJSON(): object {\n return dropUndefinedKeys({\n data: Object.keys(this.data).length > 0 ? this.data : undefined,\n description: this.description,\n op: this.op,\n parent_span_id: this._parentSpanId,\n sampled: this.sampled,\n span_id: this._spanId,\n start_timestamp: this.startTimestamp,\n tags: Object.keys(this.tags).length > 0 ? this.tags : undefined,\n timestamp: this.timestamp,\n trace_id: this._traceId,\n transaction: this.transaction,\n });\n }\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/hubextensions.d.ts b/node_modules/@sentry/apm/esm/hubextensions.d.ts
deleted file mode 100644
index 8b05a49..0000000
--- a/node_modules/@sentry/apm/esm/hubextensions.d.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-/**
- * This patches the global object and injects the APM extensions methods
- */
-export declare function addExtensionMethods(): void;
-//# sourceMappingURL=hubextensions.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/hubextensions.d.ts.map b/node_modules/@sentry/apm/esm/hubextensions.d.ts.map
deleted file mode 100644
index 69c4e45..0000000
--- a/node_modules/@sentry/apm/esm/hubextensions.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"hubextensions.d.ts","sourceRoot":"","sources":["../src/hubextensions.ts"],"names":[],"mappings":"AAsEA;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAW1C"}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/hubextensions.js b/node_modules/@sentry/apm/esm/hubextensions.js
deleted file mode 100644
index 0c52340..0000000
--- a/node_modules/@sentry/apm/esm/hubextensions.js
+++ /dev/null
@@ -1,76 +0,0 @@
-import { getMainCarrier } from '@sentry/hub';
-import { isInstanceOf } from '@sentry/utils';
-import { Span } from './span';
-/**
- * Checks whether given value is instance of Span
- * @param span value to check
- */
-function isSpanInstance(span) {
- return isInstanceOf(span, Span);
-}
-/** Returns all trace headers that are currently on the top scope. */
-function traceHeaders() {
- // @ts-ignore
- var that = this;
- var scope = that.getScope();
- if (scope) {
- var span = scope.getSpan();
- if (span) {
- return {
- 'sentry-trace': span.toTraceparent(),
- };
- }
- }
- return {};
-}
-/**
- * This functions starts a span. If argument passed is of type `Span`, it'll run sampling on it if configured
- * and attach a `SpanRecorder`. If it's of type `SpanContext` and there is already a `Span` on the Scope,
- * the created Span will have a reference to it and become it's child. Otherwise it'll crete a new `Span`.
- *
- * @param span Already constructed span which should be started or properties with which the span should be created
- */
-function startSpan(spanOrSpanContext, forceNoChild) {
- if (forceNoChild === void 0) { forceNoChild = false; }
- // @ts-ignore
- var that = this;
- var scope = that.getScope();
- var client = that.getClient();
- var span;
- if (!isSpanInstance(spanOrSpanContext) && !forceNoChild) {
- if (scope) {
- var parentSpan = scope.getSpan();
- if (parentSpan) {
- span = parentSpan.child(spanOrSpanContext);
- }
- }
- }
- if (!isSpanInstance(span)) {
- span = new Span(spanOrSpanContext, that);
- }
- if (span.sampled === undefined && span.transaction !== undefined) {
- var sampleRate = (client && client.getOptions().tracesSampleRate) || 0;
- span.sampled = Math.random() < sampleRate;
- }
- if (span.sampled) {
- var experimentsOptions = (client && client.getOptions()._experiments) || {};
- span.initFinishedSpans(experimentsOptions.maxSpans);
- }
- return span;
-}
-/**
- * This patches the global object and injects the APM extensions methods
- */
-export function addExtensionMethods() {
- var carrier = getMainCarrier();
- if (carrier.__SENTRY__) {
- carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};
- if (!carrier.__SENTRY__.extensions.startSpan) {
- carrier.__SENTRY__.extensions.startSpan = startSpan;
- }
- if (!carrier.__SENTRY__.extensions.traceHeaders) {
- carrier.__SENTRY__.extensions.traceHeaders = traceHeaders;
- }
- }
-}
-//# sourceMappingURL=hubextensions.js.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/hubextensions.js.map b/node_modules/@sentry/apm/esm/hubextensions.js.map
deleted file mode 100644
index ca10278..0000000
--- a/node_modules/@sentry/apm/esm/hubextensions.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"hubextensions.js","sourceRoot":"","sources":["../src/hubextensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAO,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B;;;GAGG;AACH,SAAS,cAAc,CAAC,IAAa;IACnC,OAAO,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAClC,CAAC;AAED,qEAAqE;AACrE,SAAS,YAAY;IACnB,aAAa;IACb,IAAM,IAAI,GAAG,IAAW,CAAC;IACzB,IAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC9B,IAAI,KAAK,EAAE;QACT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C;QAC9E,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,QAAkB,CAAC,CAAC;KAC/D;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB;IACjC,IAAM,OAAO,GAAG,cAAc,EAAE,CAAC;IACjC,IAAI,OAAO,CAAC,UAAU,EAAE;QACtB,OAAO,CAAC,UAAU,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,UAAU,IAAI,EAAE,CAAC;QACpE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,SAAS,EAAE;YAC5C,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,SAAS,GAAG,SAAS,CAAC;SACrD;QACD,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,YAAY,EAAE;YAC/C,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,YAAY,GAAG,YAAY,CAAC;SAC3D;KACF;AACH,CAAC","sourcesContent":["import { getMainCarrier, Hub } from '@sentry/hub';\nimport { SpanContext } from '@sentry/types';\nimport { isInstanceOf } from '@sentry/utils';\n\nimport { Span } from './span';\n\n/**\n * Checks whether given value is instance of Span\n * @param span value to check\n */\nfunction isSpanInstance(span: unknown): span is Span {\n return isInstanceOf(span, Span);\n}\n\n/** Returns all trace headers that are currently on the top scope. */\nfunction traceHeaders(): { [key: string]: string } {\n // @ts-ignore\n const that = this as Hub;\n const scope = that.getScope();\n if (scope) {\n const span = scope.getSpan();\n if (span) {\n return {\n 'sentry-trace': span.toTraceparent(),\n };\n }\n }\n return {};\n}\n\n/**\n * This functions starts a span. If argument passed is of type `Span`, it'll run sampling on it if configured\n * and attach a `SpanRecorder`. If it's of type `SpanContext` and there is already a `Span` on the Scope,\n * the created Span will have a reference to it and become it's child. Otherwise it'll crete a new `Span`.\n *\n * @param span Already constructed span which should be started or properties with which the span should be created\n */\nfunction startSpan(spanOrSpanContext?: Span | SpanContext, forceNoChild: boolean = false): Span {\n // @ts-ignore\n const that = this as Hub;\n const scope = that.getScope();\n const client = that.getClient();\n let span;\n\n if (!isSpanInstance(spanOrSpanContext) && !forceNoChild) {\n if (scope) {\n const parentSpan = scope.getSpan() as Span;\n if (parentSpan) {\n span = parentSpan.child(spanOrSpanContext);\n }\n }\n }\n\n if (!isSpanInstance(span)) {\n span = new Span(spanOrSpanContext, that);\n }\n\n if (span.sampled === undefined && span.transaction !== undefined) {\n const sampleRate = (client && client.getOptions().tracesSampleRate) || 0;\n span.sampled = Math.random() < sampleRate;\n }\n\n if (span.sampled) {\n const experimentsOptions = (client && client.getOptions()._experiments) || {};\n span.initFinishedSpans(experimentsOptions.maxSpans as number);\n }\n\n return span;\n}\n\n/**\n * This patches the global object and injects the APM extensions methods\n */\nexport function addExtensionMethods(): void {\n const carrier = getMainCarrier();\n if (carrier.__SENTRY__) {\n carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};\n if (!carrier.__SENTRY__.extensions.startSpan) {\n carrier.__SENTRY__.extensions.startSpan = startSpan;\n }\n if (!carrier.__SENTRY__.extensions.traceHeaders) {\n carrier.__SENTRY__.extensions.traceHeaders = traceHeaders;\n }\n }\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/index.bundle.d.ts b/node_modules/@sentry/apm/esm/index.bundle.d.ts
deleted file mode 100644
index 01ba2bd..0000000
--- a/node_modules/@sentry/apm/esm/index.bundle.d.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-export { Breadcrumb, Request, SdkInfo, Event, Exception, Response, Severity, StackFrame, Stacktrace, Status, Thread, User, } from '@sentry/types';
-export { addGlobalEventProcessor, addBreadcrumb, captureException, captureEvent, captureMessage, configureScope, getHubFromCarrier, getCurrentHub, Hub, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, Transports, withScope, } from '@sentry/browser';
-export { BrowserOptions } from '@sentry/browser';
-export { BrowserClient, ReportDialogOptions } from '@sentry/browser';
-export { defaultIntegrations, forceLoad, init, lastEventId, onLoad, showReportDialog, flush, close, wrap, } from '@sentry/browser';
-export { SDK_NAME, SDK_VERSION } from '@sentry/browser';
-import * as ApmIntegrations from './integrations';
-export { Span, TRACEPARENT_REGEXP } from './span';
-declare const INTEGRATIONS: {
- Tracing: typeof ApmIntegrations.Tracing;
- GlobalHandlers: typeof import("../../browser/dist/integrations").GlobalHandlers;
- TryCatch: typeof import("../../browser/dist/integrations").TryCatch;
- Breadcrumbs: typeof import("../../browser/dist/integrations").Breadcrumbs;
- LinkedErrors: typeof import("../../browser/dist/integrations").LinkedErrors;
- UserAgent: typeof import("../../browser/dist/integrations").UserAgent;
- FunctionToString: typeof import("@sentry/core/dist/integrations").FunctionToString;
- InboundFilters: typeof import("@sentry/core/dist/integrations").InboundFilters;
-};
-export { INTEGRATIONS as Integrations };
-//# sourceMappingURL=index.bundle.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/index.bundle.d.ts.map b/node_modules/@sentry/apm/esm/index.bundle.d.ts.map
deleted file mode 100644
index 1ebca5a..0000000
--- a/node_modules/@sentry/apm/esm/index.bundle.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.bundle.d.ts","sourceRoot":"","sources":["../src/index.bundle.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,UAAU,EACV,MAAM,EACN,MAAM,EACN,IAAI,GACL,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,GAAG,EACH,KAAK,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,UAAU,EACV,SAAS,GACV,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EACL,mBAAmB,EACnB,SAAS,EACT,IAAI,EACJ,WAAW,EACX,MAAM,EACN,gBAAgB,EAChB,KAAK,EACL,KAAK,EACL,IAAI,GACL,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAMxD,OAAO,KAAK,eAAe,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAYlD,QAAA,MAAM,YAAY;;;;;;;;;CAIjB,CAAC;AAEF,OAAO,EAAE,YAAY,IAAI,YAAY,EAAE,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/index.bundle.js b/node_modules/@sentry/apm/esm/index.bundle.js
deleted file mode 100644
index 6fff1d7..0000000
--- a/node_modules/@sentry/apm/esm/index.bundle.js
+++ /dev/null
@@ -1,24 +0,0 @@
-import * as tslib_1 from "tslib";
-export { Severity, Status, } from '@sentry/types';
-export { addGlobalEventProcessor, addBreadcrumb, captureException, captureEvent, captureMessage, configureScope, getHubFromCarrier, getCurrentHub, Hub, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, Transports, withScope, } from '@sentry/browser';
-export { BrowserClient } from '@sentry/browser';
-export { defaultIntegrations, forceLoad, init, lastEventId, onLoad, showReportDialog, flush, close, wrap, } from '@sentry/browser';
-export { SDK_NAME, SDK_VERSION } from '@sentry/browser';
-import { Integrations as BrowserIntegrations } from '@sentry/browser';
-import { getGlobalObject } from '@sentry/utils';
-import { addExtensionMethods } from './hubextensions';
-import * as ApmIntegrations from './integrations';
-export { Span, TRACEPARENT_REGEXP } from './span';
-var windowIntegrations = {};
-// This block is needed to add compatibility with the integrations packages when used with a CDN
-// tslint:disable: no-unsafe-any
-var _window = getGlobalObject();
-if (_window.Sentry && _window.Sentry.Integrations) {
- windowIntegrations = _window.Sentry.Integrations;
-}
-// tslint:enable: no-unsafe-any
-var INTEGRATIONS = tslib_1.__assign({}, windowIntegrations, BrowserIntegrations, { Tracing: ApmIntegrations.Tracing });
-export { INTEGRATIONS as Integrations };
-// We are patching the global object with our hub extension methods
-addExtensionMethods();
-//# sourceMappingURL=index.bundle.js.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/index.bundle.js.map b/node_modules/@sentry/apm/esm/index.bundle.js.map
deleted file mode 100644
index d9d0d9e..0000000
--- a/node_modules/@sentry/apm/esm/index.bundle.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.bundle.js","sourceRoot":"","sources":["../src/index.bundle.ts"],"names":[],"mappings":";AAAA,OAAO,EAOL,QAAQ,EAGR,MAAM,GAGP,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,GAAG,EACH,KAAK,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,UAAU,EACV,SAAS,GACV,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,aAAa,EAAuB,MAAM,iBAAiB,CAAC;AACrE,OAAO,EACL,mBAAmB,EACnB,SAAS,EACT,IAAI,EACJ,WAAW,EACX,MAAM,EACN,gBAAgB,EAChB,KAAK,EACL,KAAK,EACL,IAAI,GACL,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,eAAe,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAElD,IAAI,kBAAkB,GAAG,EAAE,CAAC;AAE5B,gGAAgG;AAChG,gCAAgC;AAChC,IAAM,OAAO,GAAG,eAAe,EAAU,CAAC;AAC1C,IAAI,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE;IACjD,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC;CAClD;AACD,+BAA+B;AAE/B,IAAM,YAAY,wBACb,kBAAkB,EAClB,mBAAmB,IACtB,OAAO,EAAE,eAAe,CAAC,OAAO,GACjC,CAAC;AAEF,OAAO,EAAE,YAAY,IAAI,YAAY,EAAE,CAAC;AAExC,mEAAmE;AACnE,mBAAmB,EAAE,CAAC","sourcesContent":["export {\n Breadcrumb,\n Request,\n SdkInfo,\n Event,\n Exception,\n Response,\n Severity,\n StackFrame,\n Stacktrace,\n Status,\n Thread,\n User,\n} from '@sentry/types';\n\nexport {\n addGlobalEventProcessor,\n addBreadcrumb,\n captureException,\n captureEvent,\n captureMessage,\n configureScope,\n getHubFromCarrier,\n getCurrentHub,\n Hub,\n Scope,\n setContext,\n setExtra,\n setExtras,\n setTag,\n setTags,\n setUser,\n Transports,\n withScope,\n} from '@sentry/browser';\n\nexport { BrowserOptions } from '@sentry/browser';\nexport { BrowserClient, ReportDialogOptions } from '@sentry/browser';\nexport {\n defaultIntegrations,\n forceLoad,\n init,\n lastEventId,\n onLoad,\n showReportDialog,\n flush,\n close,\n wrap,\n} from '@sentry/browser';\nexport { SDK_NAME, SDK_VERSION } from '@sentry/browser';\n\nimport { Integrations as BrowserIntegrations } from '@sentry/browser';\nimport { getGlobalObject } from '@sentry/utils';\n\nimport { addExtensionMethods } from './hubextensions';\nimport * as ApmIntegrations from './integrations';\n\nexport { Span, TRACEPARENT_REGEXP } from './span';\n\nlet windowIntegrations = {};\n\n// This block is needed to add compatibility with the integrations packages when used with a CDN\n// tslint:disable: no-unsafe-any\nconst _window = getGlobalObject();\nif (_window.Sentry && _window.Sentry.Integrations) {\n windowIntegrations = _window.Sentry.Integrations;\n}\n// tslint:enable: no-unsafe-any\n\nconst INTEGRATIONS = {\n ...windowIntegrations,\n ...BrowserIntegrations,\n Tracing: ApmIntegrations.Tracing,\n};\n\nexport { INTEGRATIONS as Integrations };\n\n// We are patching the global object with our hub extension methods\naddExtensionMethods();\n"]}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/index.d.ts b/node_modules/@sentry/apm/esm/index.d.ts
deleted file mode 100644
index 1f65162..0000000
--- a/node_modules/@sentry/apm/esm/index.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-import * as ApmIntegrations from './integrations';
-export { ApmIntegrations as Integrations };
-export { Span, TRACEPARENT_REGEXP } from './span';
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/index.d.ts.map b/node_modules/@sentry/apm/esm/index.d.ts.map
deleted file mode 100644
index 79d1e2f..0000000
--- a/node_modules/@sentry/apm/esm/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,eAAe,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,eAAe,IAAI,YAAY,EAAE,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/index.js b/node_modules/@sentry/apm/esm/index.js
deleted file mode 100644
index aebbc16..0000000
--- a/node_modules/@sentry/apm/esm/index.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import { addExtensionMethods } from './hubextensions';
-import * as ApmIntegrations from './integrations';
-export { ApmIntegrations as Integrations };
-export { Span, TRACEPARENT_REGEXP } from './span';
-// We are patching the global object with our hub extension methods
-addExtensionMethods();
-//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/index.js.map b/node_modules/@sentry/apm/esm/index.js.map
deleted file mode 100644
index 6c683c9..0000000
--- a/node_modules/@sentry/apm/esm/index.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,eAAe,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,eAAe,IAAI,YAAY,EAAE,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAElD,mEAAmE;AACnE,mBAAmB,EAAE,CAAC","sourcesContent":["import { addExtensionMethods } from './hubextensions';\nimport * as ApmIntegrations from './integrations';\n\nexport { ApmIntegrations as Integrations };\nexport { Span, TRACEPARENT_REGEXP } from './span';\n\n// We are patching the global object with our hub extension methods\naddExtensionMethods();\n"]}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/integrations/express.d.ts b/node_modules/@sentry/apm/esm/integrations/express.d.ts
deleted file mode 100644
index c6d7635..0000000
--- a/node_modules/@sentry/apm/esm/integrations/express.d.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import { EventProcessor, Hub, Integration } from '@sentry/types';
-import { Application } from 'express';
-/**
- * Express integration
- *
- * Provides an request and error handler for Express framework
- * as well as tracing capabilities
- */
-export declare class Express implements Integration {
- /**
- * @inheritDoc
- */
- name: string;
- /**
- * @inheritDoc
- */
- static id: string;
- /**
- * Express App instance
- */
- private readonly _app?;
- /**
- * @inheritDoc
- */
- constructor(options?: {
- app?: Application;
- });
- /**
- * @inheritDoc
- */
- setupOnce(_addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
-}
-//# sourceMappingURL=express.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/integrations/express.d.ts.map b/node_modules/@sentry/apm/esm/integrations/express.d.ts.map
deleted file mode 100644
index 9b29898..0000000
--- a/node_modules/@sentry/apm/esm/integrations/express.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"express.d.ts","sourceRoot":"","sources":["../../src/integrations/express.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjE,OAAO,EAAE,WAAW,EAAwE,MAAM,SAAS,CAAC;AAE5G;;;;;GAKG;AACH,qBAAa,OAAQ,YAAW,WAAW;IACzC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAc;IAEjC;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAa;IAErC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAc;IAEpC;;OAEG;gBACgB,OAAO,GAAE;QAAE,GAAG,CAAC,EAAE,WAAW,CAAA;KAAO;IAItD;;OAEG;IACI,SAAS,CAAC,wBAAwB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,GAAG,IAAI;CAO/G"}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/integrations/express.js b/node_modules/@sentry/apm/esm/integrations/express.js
deleted file mode 100644
index c37eac3..0000000
--- a/node_modules/@sentry/apm/esm/integrations/express.js
+++ /dev/null
@@ -1,127 +0,0 @@
-import { logger } from '@sentry/utils';
-/**
- * Express integration
- *
- * Provides an request and error handler for Express framework
- * as well as tracing capabilities
- */
-var Express = /** @class */ (function () {
- /**
- * @inheritDoc
- */
- function Express(options) {
- if (options === void 0) { options = {}; }
- /**
- * @inheritDoc
- */
- this.name = Express.id;
- this._app = options.app;
- }
- /**
- * @inheritDoc
- */
- Express.prototype.setupOnce = function (_addGlobalEventProcessor, getCurrentHub) {
- if (!this._app) {
- logger.error('ExpressIntegration is missing an Express instance');
- return;
- }
- instrumentMiddlewares(this._app, getCurrentHub);
- };
- /**
- * @inheritDoc
- */
- Express.id = 'Express';
- return Express;
-}());
-export { Express };
-/**
- * Wraps original middleware function in a tracing call, which stores the info about the call as a span,
- * and finishes it once the middleware is done invoking.
- *
- * Express middlewares have 3 various forms, thus we have to take care of all of them:
- * // sync
- * app.use(function (req, res) { ... })
- * // async
- * app.use(function (req, res, next) { ... })
- * // error handler
- * app.use(function (err, req, res, next) { ... })
- */
-function wrap(fn, getCurrentHub) {
- var arrity = fn.length;
- switch (arrity) {
- case 2: {
- return function (_req, res) {
- var span = getCurrentHub().startSpan({
- description: fn.name,
- op: 'middleware',
- });
- res.once('finish', function () { return span.finish(); });
- return fn.apply(this, arguments);
- };
- }
- case 3: {
- return function (req, res, next) {
- var span = getCurrentHub().startSpan({
- description: fn.name,
- op: 'middleware',
- });
- fn.call(this, req, res, function () {
- span.finish();
- return next.apply(this, arguments);
- });
- };
- }
- case 4: {
- return function (err, req, res, next) {
- var span = getCurrentHub().startSpan({
- description: fn.name,
- op: 'middleware',
- });
- fn.call(this, err, req, res, function () {
- span.finish();
- return next.apply(this, arguments);
- });
- };
- }
- default: {
- throw new Error("Express middleware takes 2-4 arguments. Got: " + arrity);
- }
- }
-}
-/**
- * Takes all the function arguments passed to the original `app.use` call
- * and wraps every function, as well as array of functions with a call to our `wrap` method.
- * We have to take care of the arrays as well as iterate over all of the arguments,
- * as `app.use` can accept middlewares in few various forms.
- *
- * app.use([], )
- * app.use([], , ...)
- * app.use([], ...[])
- */
-function wrapUseArgs(args, getCurrentHub) {
- return Array.from(args).map(function (arg) {
- if (typeof arg === 'function') {
- return wrap(arg, getCurrentHub);
- }
- if (Array.isArray(arg)) {
- return arg.map(function (a) {
- if (typeof a === 'function') {
- return wrap(a, getCurrentHub);
- }
- return a;
- });
- }
- return arg;
- });
-}
-/**
- * Patches original app.use to utilize our tracing functionality
- */
-function instrumentMiddlewares(app, getCurrentHub) {
- var originalAppUse = app.use;
- app.use = function () {
- return originalAppUse.apply(this, wrapUseArgs(arguments, getCurrentHub));
- };
- return app;
-}
-//# sourceMappingURL=express.js.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/integrations/express.js.map b/node_modules/@sentry/apm/esm/integrations/express.js.map
deleted file mode 100644
index 4ba52a5..0000000
--- a/node_modules/@sentry/apm/esm/integrations/express.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"express.js","sourceRoot":"","sources":["../../src/integrations/express.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAIvC;;;;;GAKG;AACH;IAgBE;;OAEG;IACH,iBAAmB,OAAmC;QAAnC,wBAAA,EAAA,YAAmC;QAlBtD;;WAEG;QACI,SAAI,GAAW,OAAO,CAAC,EAAE,CAAC;QAgB/B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC;IAC1B,CAAC;IAED;;OAEG;IACI,2BAAS,GAAhB,UAAiB,wBAA4D,EAAE,aAAwB;QACrG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YACd,MAAM,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAC;YAClE,OAAO;SACR;QACD,qBAAqB,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IAClD,CAAC;IA1BD;;OAEG;IACW,UAAE,GAAW,SAAS,CAAC;IAwBvC,cAAC;CAAA,AAjCD,IAiCC;SAjCY,OAAO;AAmCpB;;;;;;;;;;;GAWG;AACH,SAAS,IAAI,CAAC,EAAY,EAAE,aAAwB;IAClD,IAAM,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC;IAEzB,QAAQ,MAAM,EAAE;QACd,KAAK,CAAC,CAAC,CAAC;YACN,OAAO,UAA8B,IAAa,EAAE,GAAa;gBAC/D,IAAM,IAAI,GAAG,aAAa,EAAE,CAAC,SAAS,CAAC;oBACrC,WAAW,EAAE,EAAE,CAAC,IAAI;oBACpB,EAAE,EAAE,YAA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,SAAS,WAAW,CAAC,IAAgB,EAAE,aAAwB;IAC7D,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,UAAC,GAAY;QACvC,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE;YAC7B,OAAO,IAAI,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;SACjC;QAED,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACtB,OAAO,GAAG,CAAC,GAAG,CAAC,UAAC,CAAU;gBACxB,IAAI,OAAO,CAAC,KAAK,UAAU,EAAE;oBAC3B,OAAO,IAAI,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;iBAC/B;gBACD,OAAO,CAAC,CAAC;YACX,CAAC,CAAC,CAAC;SACJ;QAED,OAAO,GAAG,CAAC;IACb,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,SAAS,qBAAqB,CAAC,GAAgB,EAAE,aAAwB;IACvE,IAAM,cAAc,GAAG,GAAG,CAAC,GAAG,CAAC;IAC/B,GAAG,CAAC,GAAG,GAAG;QACR,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,WAAW,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC;IAC3E,CAAC,CAAC;IACF,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import { EventProcessor, Hub, Integration } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n// tslint:disable-next-line:no-implicit-dependencies\nimport { Application, ErrorRequestHandler, NextFunction, Request, RequestHandler, Response } from 'express';\n\n/**\n * Express integration\n *\n * Provides an request and error handler for Express framework\n * as well as tracing capabilities\n */\nexport class Express implements Integration {\n /**\n * @inheritDoc\n */\n public name: string = Express.id;\n\n /**\n * @inheritDoc\n */\n public static id: string = 'Express';\n\n /**\n * Express App instance\n */\n private readonly _app?: Application;\n\n /**\n * @inheritDoc\n */\n public constructor(options: { app?: Application } = {}) {\n this._app = options.app;\n }\n\n /**\n * @inheritDoc\n */\n public setupOnce(_addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n if (!this._app) {\n logger.error('ExpressIntegration is missing an Express instance');\n return;\n }\n instrumentMiddlewares(this._app, getCurrentHub);\n }\n}\n\n/**\n * Wraps original middleware function in a tracing call, which stores the info about the call as a span,\n * and finishes it once the middleware is done invoking.\n *\n * Express middlewares have 3 various forms, thus we have to take care of all of them:\n * // sync\n * app.use(function (req, res) { ... })\n * // async\n * app.use(function (req, res, next) { ... })\n * // error handler\n * app.use(function (err, req, res, next) { ... })\n */\nfunction wrap(fn: Function, getCurrentHub: () => Hub): RequestHandler | ErrorRequestHandler {\n const arrity = fn.length;\n\n switch (arrity) {\n case 2: {\n return function(this: NodeJS.Global, _req: Request, res: Response): any {\n const span = getCurrentHub().startSpan({\n description: fn.name,\n op: 'middleware',\n });\n res.once('finish', () => span.finish());\n return fn.apply(this, arguments);\n };\n }\n case 3: {\n return function(this: NodeJS.Global, req: Request, res: Response, next: NextFunction): any {\n const span = getCurrentHub().startSpan({\n description: fn.name,\n op: 'middleware',\n });\n fn.call(this, req, res, function(this: NodeJS.Global): any {\n span.finish();\n return next.apply(this, arguments);\n });\n };\n }\n case 4: {\n return function(this: NodeJS.Global, err: any, req: Request, res: Response, next: NextFunction): any {\n const span = getCurrentHub().startSpan({\n description: fn.name,\n op: 'middleware',\n });\n fn.call(this, err, req, res, function(this: NodeJS.Global): any {\n span.finish();\n return next.apply(this, arguments);\n });\n };\n }\n default: {\n throw new Error(`Express middleware takes 2-4 arguments. Got: ${arrity}`);\n }\n }\n}\n\n/**\n * Takes all the function arguments passed to the original `app.use` call\n * and wraps every function, as well as array of functions with a call to our `wrap` method.\n * We have to take care of the arrays as well as iterate over all of the arguments,\n * as `app.use` can accept middlewares in few various forms.\n *\n * app.use([], )\n * app.use([], , ...)\n * app.use([], ...[])\n */\nfunction wrapUseArgs(args: IArguments, getCurrentHub: () => Hub): unknown[] {\n return Array.from(args).map((arg: unknown) => {\n if (typeof arg === 'function') {\n return wrap(arg, getCurrentHub);\n }\n\n if (Array.isArray(arg)) {\n return arg.map((a: unknown) => {\n if (typeof a === 'function') {\n return wrap(a, getCurrentHub);\n }\n return a;\n });\n }\n\n return arg;\n });\n}\n\n/**\n * Patches original app.use to utilize our tracing functionality\n */\nfunction instrumentMiddlewares(app: Application, getCurrentHub: () => Hub): Application {\n const originalAppUse = app.use;\n app.use = function(): any {\n return originalAppUse.apply(this, wrapUseArgs(arguments, getCurrentHub));\n };\n return app;\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/integrations/index.d.ts b/node_modules/@sentry/apm/esm/integrations/index.d.ts
deleted file mode 100644
index 6c891c4..0000000
--- a/node_modules/@sentry/apm/esm/integrations/index.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export { Express } from './express';
-export { Tracing } from './tracing';
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/integrations/index.d.ts.map b/node_modules/@sentry/apm/esm/integrations/index.d.ts.map
deleted file mode 100644
index 412841d..0000000
--- a/node_modules/@sentry/apm/esm/integrations/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/integrations/index.js b/node_modules/@sentry/apm/esm/integrations/index.js
deleted file mode 100644
index a374b2a..0000000
--- a/node_modules/@sentry/apm/esm/integrations/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-export { Express } from './express';
-export { Tracing } from './tracing';
-//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/integrations/index.js.map b/node_modules/@sentry/apm/esm/integrations/index.js.map
deleted file mode 100644
index b43f9ae..0000000
--- a/node_modules/@sentry/apm/esm/integrations/index.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC","sourcesContent":["export { Express } from './express';\nexport { Tracing } from './tracing';\n"]}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/integrations/tracing.d.ts b/node_modules/@sentry/apm/esm/integrations/tracing.d.ts
deleted file mode 100644
index 7d6b099..0000000
--- a/node_modules/@sentry/apm/esm/integrations/tracing.d.ts
+++ /dev/null
@@ -1,209 +0,0 @@
-import { EventProcessor, Hub, Integration, Span, SpanContext, SpanStatus } from '@sentry/types';
-/**
- * Options for Tracing integration
- */
-interface TracingOptions {
- /**
- * List of strings / regex where the integration should create Spans out of. Additionally this will be used
- * to define which outgoing requests the `sentry-trace` header will be attached to.
- *
- * Default: ['localhost', /^\//]
- */
- tracingOrigins: Array;
- /**
- * Flag to disable patching all together for fetch requests.
- *
- * Default: true
- */
- traceFetch: boolean;
- /**
- * Flag to disable patching all together for xhr requests.
- *
- * Default: true
- */
- traceXHR: boolean;
- /**
- * This function will be called before creating a span for a request with the given url.
- * Return false if you don't want a span for the given url.
- *
- * By default it uses the `tracingOrigins` options as a url match.
- */
- shouldCreateSpanForRequest(url: string): boolean;
- /**
- * The time to wait in ms until the transaction will be finished. The transaction will use the end timestamp of
- * the last finished span as the endtime for the transaction.
- * Time is in ms.
- *
- * Default: 500
- */
- idleTimeout: number;
- /**
- * Flag to enable/disable creation of `navigation` transaction on history changes. Useful for react applications with
- * a router.
- *
- * Default: true
- */
- startTransactionOnLocationChange: boolean;
- /**
- * Sample to determine if the Integration should instrument anything. The decision will be taken once per load
- * on initalization.
- * 0 = 0% chance of instrumenting
- * 1 = 100% change of instrumenting
- *
- * Default: 1
- */
- tracesSampleRate: number;
- /**
- * The maximum duration of a transaction before it will be discarded. This is for some edge cases where a browser
- * completely freezes the JS state and picks it up later (background tabs).
- * So after this duration, the SDK will not send the event.
- * If you want to have an unlimited duration set it to 0.
- * Time is in seconds.
- *
- * Default: 600
- */
- maxTransactionDuration: number;
- /**
- * Flag to discard all spans that occur in background. This includes transactions. Browser background tab timing is
- * not suited towards doing precise measurements of operations. That's why this option discards any active transaction
- * and also doesn't add any spans that happen in the background. Background spans/transaction can mess up your
- * statistics in non deterministic ways that's why we by default recommend leaving this opition enabled.
- *
- * Default: true
- */
- discardBackgroundSpans: boolean;
-}
-/** JSDoc */
-interface Activity {
- name: string;
- span?: Span;
-}
-/**
- * Tracing Integration
- */
-export declare class Tracing implements Integration {
- /**
- * @inheritDoc
- */
- name: string;
- /**
- * @inheritDoc
- */
- static id: string;
- /**
- * Is Tracing enabled, this will be determined once per pageload.
- */
- private static _enabled?;
- /** JSDoc */
- static options: TracingOptions;
- /**
- * Returns current hub.
- */
- private static _getCurrentHub?;
- private static _activeTransaction?;
- private static _currentIndex;
- static _activities: {
- [key: number]: Activity;
- };
- private static _debounce;
- private readonly _emitOptionsWarning;
- private static _performanceCursor;
- private static _heartbeatTimer;
- private static _prevHeartbeatString;
- private static _heartbeatCounter;
- /**
- * Constructor for Tracing
- *
- * @param _options TracingOptions
- */
- constructor(_options?: Partial);
- /**
- * @inheritDoc
- */
- setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
- /**
- * Pings the heartbeat
- */
- private static _pingHeartbeat;
- /**
- * Checks when entries of Tracing._activities are not changing for 3 beats. If this occurs we finish the transaction
- *
- */
- private static _beat;
- /**
- * Discards active transactions if tab moves to background
- */
- private _setupBackgroundTabDetection;
- /**
- * Unsets the current active transaction + activities
- */
- private static _resetActiveTransaction;
- /**
- * Registers to History API to detect navigation changes
- */
- private _setupHistory;
- /**
- * Attaches to fetch to add sentry-trace header + creating spans
- */
- private _setupFetchTracing;
- /**
- * Attaches to XHR to add sentry-trace header + creating spans
- */
- private _setupXHRTracing;
- /**
- * Configures global error listeners
- */
- private _setupErrorHandling;
- /**
- * Is tracing enabled
- */
- private static _isEnabled;
- /**
- * Starts a Transaction waiting for activity idle to finish
- */
- static startIdleTransaction(name: string, spanContext?: SpanContext): Span | undefined;
- /**
- * Update transaction
- * @deprecated
- */
- static updateTransactionName(name: string): void;
- /**
- * Finshes the current active transaction
- */
- static finishIdleTransaction(): void;
- /**
- * This uses `performance.getEntries()` to add additional spans to the active transaction.
- * Also, we update our timings since we consider the timings in this API to be more correct than our manual
- * measurements.
- *
- * @param transactionSpan The transaction span
- */
- private static _addPerformanceEntries;
- /**
- * Sets the status of the current active transaction (if there is one)
- */
- static setTransactionStatus(status: SpanStatus): void;
- /**
- * Converts from milliseconds to seconds
- * @param time time in ms
- */
- private static _msToSec;
- /**
- * Starts tracking for a specifc activity
- *
- * @param name Name of the activity, can be any string (Only used internally to identify the activity)
- * @param spanContext If provided a Span with the SpanContext will be created.
- * @param options _autoPopAfter_ | Time in ms, if provided the activity will be popped automatically after this timeout. This can be helpful in cases where you cannot gurantee your application knows the state and calls `popActivity` for sure.
- */
- static pushActivity(name: string, spanContext?: SpanContext, options?: {
- autoPopAfter?: number;
- }): number;
- /**
- * Removes activity and finishes the span in case there is one
- */
- static popActivity(id: number, spanData?: {
- [key: string]: any;
- }): void;
-}
-export {};
-//# sourceMappingURL=tracing.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/integrations/tracing.d.ts.map b/node_modules/@sentry/apm/esm/integrations/tracing.d.ts.map
deleted file mode 100644
index 137fc67..0000000
--- a/node_modules/@sentry/apm/esm/integrations/tracing.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../src/integrations/tracing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,cAAc,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EA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AC,EAAE,WAAW,EACzB,OAAO,CAAC,EAAE;QACR,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,GACA,MAAM;IA4CT;;OAEG;WACW,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,IAAI;CA6C/E"}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/integrations/tracing.js b/node_modules/@sentry/apm/esm/integrations/tracing.js
deleted file mode 100644
index 2182ca3..0000000
--- a/node_modules/@sentry/apm/esm/integrations/tracing.js
+++ /dev/null
@@ -1,630 +0,0 @@
-import * as tslib_1 from "tslib";
-import { SpanStatus } from '@sentry/types';
-import { addInstrumentationHandler, getGlobalObject, isMatchingPattern, logger, supportsNativeFetch, } from '@sentry/utils';
-var global = getGlobalObject();
-var defaultTracingOrigins = ['localhost', /^\//];
-/**
- * Tracing Integration
- */
-var Tracing = /** @class */ (function () {
- /**
- * Constructor for Tracing
- *
- * @param _options TracingOptions
- */
- function Tracing(_options) {
- /**
- * @inheritDoc
- */
- this.name = Tracing.id;
- this._emitOptionsWarning = false;
- if (global.performance) {
- global.performance.mark('sentry-tracing-init');
- }
- var defaults = {
- discardBackgroundSpans: true,
- idleTimeout: 500,
- maxTransactionDuration: 600,
- shouldCreateSpanForRequest: function (url) {
- var origins = (_options && _options.tracingOrigins) || defaultTracingOrigins;
- return (origins.some(function (origin) { return isMatchingPattern(url, origin); }) &&
- !isMatchingPattern(url, 'sentry_key'));
- },
- startTransactionOnLocationChange: true,
- traceFetch: true,
- traceXHR: true,
- tracesSampleRate: 1,
- tracingOrigins: defaultTracingOrigins,
- };
- // NOTE: Logger doesn't work in contructors, as it's initialized after integrations instances
- if (!_options || !Array.isArray(_options.tracingOrigins) || _options.tracingOrigins.length === 0) {
- this._emitOptionsWarning = true;
- }
- Tracing.options = tslib_1.__assign({}, defaults, _options);
- }
- /**
- * @inheritDoc
- */
- Tracing.prototype.setupOnce = function (addGlobalEventProcessor, getCurrentHub) {
- Tracing._getCurrentHub = getCurrentHub;
- if (this._emitOptionsWarning) {
- logger.warn('[Tracing] You need to define `tracingOrigins` in the options. Set an array of urls or patterns to trace.');
- logger.warn("[Tracing] We added a reasonable default for you: " + defaultTracingOrigins);
- }
- if (!Tracing._isEnabled()) {
- return;
- }
- // Starting our inital pageload transaction
- if (global.location && global.location.href) {
- // `${global.location.href}` will be used a temp transaction name
- Tracing.startIdleTransaction(global.location.href, {
- op: 'pageload',
- sampled: true,
- });
- }
- this._setupXHRTracing();
- this._setupFetchTracing();
- this._setupHistory();
- this._setupErrorHandling();
- this._setupBackgroundTabDetection();
- Tracing._pingHeartbeat();
- // This EventProcessor makes sure that the transaction is not longer than maxTransactionDuration
- addGlobalEventProcessor(function (event) {
- var self = getCurrentHub().getIntegration(Tracing);
- if (!self) {
- return event;
- }
- if (Tracing._isEnabled()) {
- var isOutdatedTransaction = event.timestamp &&
- event.start_timestamp &&
- (event.timestamp - event.start_timestamp > Tracing.options.maxTransactionDuration ||
- event.timestamp - event.start_timestamp < 0);
- if (Tracing.options.maxTransactionDuration !== 0 && event.type === 'transaction' && isOutdatedTransaction) {
- logger.log('[Tracing] Discarded transaction since it maxed out maxTransactionDuration');
- return null;
- }
- }
- return event;
- });
- };
- /**
- * Pings the heartbeat
- */
- Tracing._pingHeartbeat = function () {
- Tracing._heartbeatTimer = setTimeout(function () {
- Tracing._beat();
- }, 5000);
- };
- /**
- * Checks when entries of Tracing._activities are not changing for 3 beats. If this occurs we finish the transaction
- *
- */
- Tracing._beat = function () {
- clearTimeout(Tracing._heartbeatTimer);
- var keys = Object.keys(Tracing._activities);
- if (keys.length) {
- var heartbeatString = keys.reduce(function (prev, current) { return prev + current; });
- if (heartbeatString === Tracing._prevHeartbeatString) {
- Tracing._heartbeatCounter++;
- }
- else {
- Tracing._heartbeatCounter = 0;
- }
- if (Tracing._heartbeatCounter >= 3) {
- if (Tracing._activeTransaction) {
- logger.log("[Tracing] Heartbeat safeguard kicked in, finishing transaction since activities content hasn't changed for 3 beats");
- Tracing._activeTransaction.setStatus(SpanStatus.DeadlineExceeded);
- Tracing._activeTransaction.setTag('heartbeat', 'failed');
- Tracing.finishIdleTransaction();
- }
- }
- Tracing._prevHeartbeatString = heartbeatString;
- }
- Tracing._pingHeartbeat();
- };
- /**
- * Discards active transactions if tab moves to background
- */
- Tracing.prototype._setupBackgroundTabDetection = function () {
- if (Tracing.options.discardBackgroundSpans && global.document) {
- document.addEventListener('visibilitychange', function () {
- if (document.hidden && Tracing._activeTransaction) {
- logger.log('[Tracing] Discarded active transaction incl. activities since tab moved to the background');
- Tracing._resetActiveTransaction();
- }
- });
- }
- };
- /**
- * Unsets the current active transaction + activities
- */
- Tracing._resetActiveTransaction = function () {
- Tracing._activeTransaction = undefined;
- Tracing._activities = {};
- };
- /**
- * Registers to History API to detect navigation changes
- */
- Tracing.prototype._setupHistory = function () {
- if (Tracing.options.startTransactionOnLocationChange) {
- addInstrumentationHandler({
- callback: historyCallback,
- type: 'history',
- });
- }
- };
- /**
- * Attaches to fetch to add sentry-trace header + creating spans
- */
- Tracing.prototype._setupFetchTracing = function () {
- if (Tracing.options.traceFetch && supportsNativeFetch()) {
- addInstrumentationHandler({
- callback: fetchCallback,
- type: 'fetch',
- });
- }
- };
- /**
- * Attaches to XHR to add sentry-trace header + creating spans
- */
- Tracing.prototype._setupXHRTracing = function () {
- if (Tracing.options.traceXHR) {
- addInstrumentationHandler({
- callback: xhrCallback,
- type: 'xhr',
- });
- }
- };
- /**
- * Configures global error listeners
- */
- Tracing.prototype._setupErrorHandling = function () {
- // tslint:disable-next-line: completed-docs
- function errorCallback() {
- if (Tracing._activeTransaction) {
- /**
- * If an error or unhandled promise occurs, we mark the active transaction as failed
- */
- logger.log("[Tracing] Global error occured, setting status in transaction: " + SpanStatus.InternalError);
- Tracing._activeTransaction.setStatus(SpanStatus.InternalError);
- }
- }
- addInstrumentationHandler({
- callback: errorCallback,
- type: 'error',
- });
- addInstrumentationHandler({
- callback: errorCallback,
- type: 'unhandledrejection',
- });
- };
- /**
- * Is tracing enabled
- */
- Tracing._isEnabled = function () {
- if (Tracing._enabled !== undefined) {
- return Tracing._enabled;
- }
- // This happens only in test cases where the integration isn't initalized properly
- // tslint:disable-next-line: strict-type-predicates
- if (!Tracing.options || typeof Tracing.options.tracesSampleRate !== 'number') {
- return false;
- }
- Tracing._enabled = Math.random() > Tracing.options.tracesSampleRate ? false : true;
- return Tracing._enabled;
- };
- /**
- * Starts a Transaction waiting for activity idle to finish
- */
- Tracing.startIdleTransaction = function (name, spanContext) {
- if (!Tracing._isEnabled()) {
- // Tracing is not enabled
- return undefined;
- }
- // If we already have an active transaction it means one of two things
- // a) The user did rapid navigation changes and didn't wait until the transaction was finished
- // b) A activity wasn't popped correctly and therefore the transaction is stalling
- Tracing.finishIdleTransaction();
- logger.log('[Tracing] startIdleTransaction, name:', name);
- var _getCurrentHub = Tracing._getCurrentHub;
- if (!_getCurrentHub) {
- return undefined;
- }
- var hub = _getCurrentHub();
- if (!hub) {
- return undefined;
- }
- var span = hub.startSpan(tslib_1.__assign({}, spanContext, { transaction: name }), true);
- Tracing._activeTransaction = span;
- // We need to do this workaround here and not use configureScope
- // Reason being at the time we start the inital transaction we do not have a client bound on the hub yet
- // therefore configureScope wouldn't be executed and we would miss setting the transaction
- // tslint:disable-next-line: no-unsafe-any
- hub.getScope().setSpan(span);
- // The reason we do this here is because of cached responses
- // If we start and transaction without an activity it would never finish since there is no activity
- var id = Tracing.pushActivity('idleTransactionStarted');
- setTimeout(function () {
- Tracing.popActivity(id);
- }, (Tracing.options && Tracing.options.idleTimeout) || 100);
- return span;
- };
- /**
- * Update transaction
- * @deprecated
- */
- Tracing.updateTransactionName = function (name) {
- logger.log('[Tracing] DEPRECATED, use Sentry.configureScope => scope.setTransaction instead', name);
- var _getCurrentHub = Tracing._getCurrentHub;
- if (_getCurrentHub) {
- var hub = _getCurrentHub();
- if (hub) {
- hub.configureScope(function (scope) {
- scope.setTransaction(name);
- });
- }
- }
- };
- /**
- * Finshes the current active transaction
- */
- Tracing.finishIdleTransaction = function () {
- var active = Tracing._activeTransaction;
- if (active) {
- Tracing._addPerformanceEntries(active);
- logger.log('[Tracing] finishIdleTransaction', active.transaction);
- active.finish(/*trimEnd*/ true);
- Tracing._resetActiveTransaction();
- }
- };
- /**
- * This uses `performance.getEntries()` to add additional spans to the active transaction.
- * Also, we update our timings since we consider the timings in this API to be more correct than our manual
- * measurements.
- *
- * @param transactionSpan The transaction span
- */
- Tracing._addPerformanceEntries = function (transactionSpan) {
- if (!global.performance) {
- // Gatekeeper if performance API not available
- return;
- }
- logger.log('[Tracing] Adding & adjusting spans using Performance API');
- var timeOrigin = Tracing._msToSec(performance.timeOrigin);
- // tslint:disable-next-line: completed-docs
- function addSpan(span) {
- if (transactionSpan.spanRecorder) {
- transactionSpan.spanRecorder.finishSpan(span);
- }
- }
- // tslint:disable-next-line: completed-docs
- function addPerformanceNavigationTiming(parent, entry, event) {
- var span = parent.child({
- description: event,
- op: 'browser',
- });
- span.startTimestamp = timeOrigin + Tracing._msToSec(entry[event + "Start"]);
- span.timestamp = timeOrigin + Tracing._msToSec(entry[event + "End"]);
- addSpan(span);
- }
- // tslint:disable-next-line: completed-docs
- function addRequest(parent, entry) {
- var request = parent.child({
- description: 'request',
- op: 'browser',
- });
- request.startTimestamp = timeOrigin + Tracing._msToSec(entry.requestStart);
- request.timestamp = timeOrigin + Tracing._msToSec(entry.responseEnd);
- addSpan(request);
- var response = parent.child({
- description: 'response',
- op: 'browser',
- });
- response.startTimestamp = timeOrigin + Tracing._msToSec(entry.responseStart);
- response.timestamp = timeOrigin + Tracing._msToSec(entry.responseEnd);
- addSpan(response);
- }
- var entryScriptSrc;
- if (global.document) {
- // tslint:disable-next-line: prefer-for-of
- for (var i = 0; i < document.scripts.length; i++) {
- // We go through all scripts on the page and look for 'data-entry'
- // We remember the name and measure the time between this script finished loading and
- // our mark 'sentry-tracing-init'
- if (document.scripts[i].dataset.entry === 'true') {
- entryScriptSrc = document.scripts[i].src;
- break;
- }
- }
- }
- var entryScriptStartEndTime;
- var tracingInitMarkStartTime;
- // tslint:disable: no-unsafe-any
- performance
- .getEntries()
- .slice(Tracing._performanceCursor)
- .forEach(function (entry) {
- var startTime = Tracing._msToSec(entry.startTime);
- var duration = Tracing._msToSec(entry.duration);
- if (transactionSpan.op === 'navigation' && timeOrigin + startTime < transactionSpan.startTimestamp) {
- return;
- }
- switch (entry.entryType) {
- case 'navigation':
- addPerformanceNavigationTiming(transactionSpan, entry, 'unloadEvent');
- addPerformanceNavigationTiming(transactionSpan, entry, 'domContentLoadedEvent');
- addPerformanceNavigationTiming(transactionSpan, entry, 'loadEvent');
- addPerformanceNavigationTiming(transactionSpan, entry, 'connect');
- addPerformanceNavigationTiming(transactionSpan, entry, 'domainLookup');
- addRequest(transactionSpan, entry);
- break;
- case 'mark':
- case 'paint':
- case 'measure':
- var mark = transactionSpan.child({
- description: entry.entryType + " " + entry.name,
- op: 'mark',
- });
- mark.startTimestamp = timeOrigin + startTime;
- mark.timestamp = mark.startTimestamp + duration;
- if (tracingInitMarkStartTime === undefined && entry.name === 'sentry-tracing-init') {
- tracingInitMarkStartTime = mark.startTimestamp;
- }
- addSpan(mark);
- break;
- case 'resource':
- var resourceName_1 = entry.name.replace(window.location.origin, '');
- if (entry.initiatorType === 'xmlhttprequest' || entry.initiatorType === 'fetch') {
- // We need to update existing spans with new timing info
- if (transactionSpan.spanRecorder) {
- transactionSpan.spanRecorder.finishedSpans.map(function (finishedSpan) {
- if (finishedSpan.description && finishedSpan.description.indexOf(resourceName_1) !== -1) {
- finishedSpan.startTimestamp = timeOrigin + startTime;
- finishedSpan.timestamp = finishedSpan.startTimestamp + duration;
- }
- });
- }
- }
- else {
- var resource = transactionSpan.child({
- description: entry.initiatorType + " " + resourceName_1,
- op: "resource",
- });
- resource.startTimestamp = timeOrigin + startTime;
- resource.timestamp = resource.startTimestamp + duration;
- // We remember the entry script end time to calculate the difference to the first init mark
- if (entryScriptStartEndTime === undefined && (entryScriptSrc || '').includes(resourceName_1)) {
- entryScriptStartEndTime = resource.timestamp;
- }
- addSpan(resource);
- }
- break;
- default:
- // Ignore other entry types.
- }
- });
- if (entryScriptStartEndTime !== undefined && tracingInitMarkStartTime !== undefined) {
- var evaluation = transactionSpan.child({
- description: 'evaluation',
- op: "script",
- });
- evaluation.startTimestamp = entryScriptStartEndTime;
- evaluation.timestamp = tracingInitMarkStartTime;
- addSpan(evaluation);
- }
- Tracing._performanceCursor = Math.max(performance.getEntries().length - 1, 0);
- // tslint:enable: no-unsafe-any
- };
- /**
- * Sets the status of the current active transaction (if there is one)
- */
- Tracing.setTransactionStatus = function (status) {
- var active = Tracing._activeTransaction;
- if (active) {
- logger.log('[Tracing] setTransactionStatus', status);
- active.setStatus(status);
- }
- };
- /**
- * Converts from milliseconds to seconds
- * @param time time in ms
- */
- Tracing._msToSec = function (time) {
- return time / 1000;
- };
- /**
- * Starts tracking for a specifc activity
- *
- * @param name Name of the activity, can be any string (Only used internally to identify the activity)
- * @param spanContext If provided a Span with the SpanContext will be created.
- * @param options _autoPopAfter_ | Time in ms, if provided the activity will be popped automatically after this timeout. This can be helpful in cases where you cannot gurantee your application knows the state and calls `popActivity` for sure.
- */
- Tracing.pushActivity = function (name, spanContext, options) {
- if (!Tracing._isEnabled()) {
- // Tracing is not enabled
- return 0;
- }
- if (!Tracing._activeTransaction) {
- logger.log("[Tracing] Not pushing activity " + name + " since there is no active transaction");
- return 0;
- }
- // We want to clear the timeout also here since we push a new activity
- clearTimeout(Tracing._debounce);
- var _getCurrentHub = Tracing._getCurrentHub;
- if (spanContext && _getCurrentHub) {
- var hub = _getCurrentHub();
- if (hub) {
- var span = hub.startSpan(spanContext);
- Tracing._activities[Tracing._currentIndex] = {
- name: name,
- span: span,
- };
- }
- }
- else {
- Tracing._activities[Tracing._currentIndex] = {
- name: name,
- };
- }
- logger.log("[Tracing] pushActivity: " + name + "#" + Tracing._currentIndex);
- logger.log('[Tracing] activies count', Object.keys(Tracing._activities).length);
- if (options && typeof options.autoPopAfter === 'number') {
- logger.log("[Tracing] auto pop of: " + name + "#" + Tracing._currentIndex + " in " + options.autoPopAfter + "ms");
- var index_1 = Tracing._currentIndex;
- setTimeout(function () {
- Tracing.popActivity(index_1, {
- autoPop: true,
- status: SpanStatus.DeadlineExceeded,
- });
- }, options.autoPopAfter);
- }
- return Tracing._currentIndex++;
- };
- /**
- * Removes activity and finishes the span in case there is one
- */
- Tracing.popActivity = function (id, spanData) {
- // The !id is on purpose to also fail with 0
- // Since 0 is returned by push activity in case tracing is not enabled
- // or there is no active transaction
- if (!Tracing._isEnabled() || !id) {
- // Tracing is not enabled
- return;
- }
- var activity = Tracing._activities[id];
- if (activity) {
- logger.log("[Tracing] popActivity " + activity.name + "#" + id);
- var span_1 = activity.span;
- if (span_1) {
- if (spanData) {
- Object.keys(spanData).forEach(function (key) {
- span_1.setData(key, spanData[key]);
- if (key === 'status_code') {
- span_1.setHttpStatus(spanData[key]);
- }
- if (key === 'status') {
- span_1.setStatus(spanData[key]);
- }
- });
- }
- span_1.finish();
- }
- // tslint:disable-next-line: no-dynamic-delete
- delete Tracing._activities[id];
- }
- var count = Object.keys(Tracing._activities).length;
- clearTimeout(Tracing._debounce);
- logger.log('[Tracing] activies count', count);
- if (count === 0 && Tracing._activeTransaction) {
- var timeout = Tracing.options && Tracing.options.idleTimeout;
- logger.log("[Tracing] Flushing Transaction in " + timeout + "ms");
- Tracing._debounce = setTimeout(function () {
- Tracing.finishIdleTransaction();
- }, timeout);
- }
- };
- /**
- * @inheritDoc
- */
- Tracing.id = 'Tracing';
- Tracing._currentIndex = 1;
- Tracing._activities = {};
- Tracing._debounce = 0;
- Tracing._performanceCursor = 0;
- Tracing._heartbeatTimer = 0;
- Tracing._heartbeatCounter = 0;
- return Tracing;
-}());
-export { Tracing };
-/**
- * Creates breadcrumbs from XHR API calls
- */
-function xhrCallback(handlerData) {
- if (!Tracing.options.traceXHR) {
- return;
- }
- // tslint:disable-next-line: no-unsafe-any
- if (!handlerData || !handlerData.xhr || !handlerData.xhr.__sentry_xhr__) {
- return;
- }
- // tslint:disable: no-unsafe-any
- var xhr = handlerData.xhr.__sentry_xhr__;
- if (!Tracing.options.shouldCreateSpanForRequest(xhr.url)) {
- return;
- }
- // We only capture complete, non-sentry requests
- if (handlerData.xhr.__sentry_own_request__) {
- return;
- }
- if (handlerData.endTimestamp && handlerData.xhr.__sentry_xhr_activity_id__) {
- Tracing.popActivity(handlerData.xhr.__sentry_xhr_activity_id__, handlerData.xhr.__sentry_xhr__);
- return;
- }
- handlerData.xhr.__sentry_xhr_activity_id__ = Tracing.pushActivity('xhr', {
- data: tslib_1.__assign({}, xhr.data, { type: 'xhr' }),
- description: xhr.method + " " + xhr.url,
- op: 'http',
- });
- // Adding the trace header to the span
- var activity = Tracing._activities[handlerData.xhr.__sentry_xhr_activity_id__];
- if (activity) {
- var span = activity.span;
- if (span && handlerData.xhr.setRequestHeader) {
- handlerData.xhr.setRequestHeader('sentry-trace', span.toTraceparent());
- }
- }
- // tslint:enable: no-unsafe-any
-}
-/**
- * Creates breadcrumbs from fetch API calls
- */
-function fetchCallback(handlerData) {
- // tslint:disable: no-unsafe-any
- if (!Tracing.options.traceFetch) {
- return;
- }
- if (!Tracing.options.shouldCreateSpanForRequest(handlerData.fetchData.url)) {
- return;
- }
- if (handlerData.endTimestamp && handlerData.fetchData.__activity) {
- Tracing.popActivity(handlerData.fetchData.__activity, handlerData.fetchData);
- }
- else {
- handlerData.fetchData.__activity = Tracing.pushActivity('fetch', {
- data: tslib_1.__assign({}, handlerData.fetchData, { type: 'fetch' }),
- description: handlerData.fetchData.method + " " + handlerData.fetchData.url,
- op: 'http',
- });
- var activity = Tracing._activities[handlerData.fetchData.__activity];
- if (activity) {
- var span = activity.span;
- if (span) {
- var options = (handlerData.args[1] = handlerData.args[1] || {});
- if (options.headers) {
- if (Array.isArray(options.headers)) {
- options.headers = tslib_1.__spread(options.headers, [{ 'sentry-trace': span.toTraceparent() }]);
- }
- else {
- options.headers = tslib_1.__assign({}, options.headers, { 'sentry-trace': span.toTraceparent() });
- }
- }
- else {
- options.headers = { 'sentry-trace': span.toTraceparent() };
- }
- }
- }
- }
- // tslint:enable: no-unsafe-any
-}
-/**
- * Creates transaction from navigation changes
- */
-function historyCallback(_) {
- if (Tracing.options.startTransactionOnLocationChange && global && global.location) {
- Tracing.startIdleTransaction(global.location.href, {
- op: 'navigation',
- sampled: true,
- });
- }
-}
-//# sourceMappingURL=tracing.js.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/integrations/tracing.js.map b/node_modules/@sentry/apm/esm/integrations/tracing.js.map
deleted file mode 100644
index a90fe24..0000000
--- a/node_modules/@sentry/apm/esm/integrations/tracing.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"tracing.js","sourceRoot":"","sources":["../../src/integrations/tracing.ts"],"names":[],"mappings":";AAAA,OAAO,EAA8D,UAAU,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EACL,yBAAyB,EACzB,eAAe,EACf,iBAAiB,EACjB,MAAM,EACN,mBAAmB,GACpB,MAAM,eAAe,CAAC;AAuFvB,IAAM,MAAM,GAAG,eAAe,EAAU,CAAC;AACzC,IAAM,qBAAqB,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;AAEnD;;GAEG;AACH;IA0CE;;;;OAIG;IACH,iBAAmB,QAAkC;QA9CrD;;WAEG;QACI,SAAI,GAAW,OAAO,CAAC,EAAE,CAAC;QA4BhB,wBAAmB,GAAY,KAAK,CAAC;QAgBpD,IAAI,MAAM,CAAC,WAAW,EAAE;YACtB,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;SAChD;QACD,IAAM,QAAQ,GAAG;YACf,sBAAsB,EAAE,IAAI;YAC5B,WAAW,EAAE,GAAG;YAChB,sBAAsB,EAAE,GAAG;YAC3B,0BAA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CAAC,OAAO,oBAAO,OAAO,CAAC,OAAO,GAAE,EAAE,cAAc,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE,EAAC,CAAC;qBAClF;yBAAM;wBACL,OAAO,CAAC,OAAO,wBACV,OAAO,CAAC,OAAO,IAClB,cAAc,EAAE,IAAI,CAAC,aAAa,EAAE,GACrC,CAAC;qBACH;iBACF;qBAAM;oBACL,OAAO,CAAC,OAAO,GAAG,EAAE,cAAc,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE,CAAC;iBAC5D;aACF;SACF;KACF;IACD,+BAA+B;AACjC,CAAC;AAED;;GAEG;AACH,SAAS,eAAe,CAAC,CAAyB;IAChD,IAAI,OAAO,CAAC,OAAO,CAAC,gCAAgC,IAAI,MAAM,IAAI,MAAM,CAAC,QAAQ,EAAE;QACjF,OAAO,CAAC,oBAAoB,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;YACjD,EAAE,EAAE,YAAY;YAChB,OAAO,EAAE,IAAI;SACd,CAAC,CAAC;KACJ;AACH,CAAC","sourcesContent":["import { Event, EventProcessor, Hub, Integration, Span, SpanContext, SpanStatus } from '@sentry/types';\nimport {\n addInstrumentationHandler,\n getGlobalObject,\n isMatchingPattern,\n logger,\n supportsNativeFetch,\n} from '@sentry/utils';\n\nimport { Span as SpanClass } from '../span';\n\n/**\n * Options for Tracing integration\n */\ninterface TracingOptions {\n /**\n * List of strings / regex where the integration should create Spans out of. Additionally this will be used\n * to define which outgoing requests the `sentry-trace` header will be attached to.\n *\n * Default: ['localhost', /^\\//]\n */\n tracingOrigins: Array;\n /**\n * Flag to disable patching all together for fetch requests.\n *\n * Default: true\n */\n traceFetch: boolean;\n /**\n * Flag to disable patching all together for xhr requests.\n *\n * Default: true\n */\n traceXHR: boolean;\n /**\n * This function will be called before creating a span for a request with the given url.\n * Return false if you don't want a span for the given url.\n *\n * By default it uses the `tracingOrigins` options as a url match.\n */\n shouldCreateSpanForRequest(url: string): boolean;\n /**\n * The time to wait in ms until the transaction will be finished. The transaction will use the end timestamp of\n * the last finished span as the endtime for the transaction.\n * Time is in ms.\n *\n * Default: 500\n */\n idleTimeout: number;\n /**\n * Flag to enable/disable creation of `navigation` transaction on history changes. Useful for react applications with\n * a router.\n *\n * Default: true\n */\n startTransactionOnLocationChange: boolean;\n /**\n * Sample to determine if the Integration should instrument anything. The decision will be taken once per load\n * on initalization.\n * 0 = 0% chance of instrumenting\n * 1 = 100% change of instrumenting\n *\n * Default: 1\n */\n tracesSampleRate: number;\n\n /**\n * The maximum duration of a transaction before it will be discarded. This is for some edge cases where a browser\n * completely freezes the JS state and picks it up later (background tabs).\n * So after this duration, the SDK will not send the event.\n * If you want to have an unlimited duration set it to 0.\n * Time is in seconds.\n *\n * Default: 600\n */\n maxTransactionDuration: number;\n\n /**\n * Flag to discard all spans that occur in background. This includes transactions. Browser background tab timing is\n * not suited towards doing precise measurements of operations. That's why this option discards any active transaction\n * and also doesn't add any spans that happen in the background. Background spans/transaction can mess up your\n * statistics in non deterministic ways that's why we by default recommend leaving this opition enabled.\n *\n * Default: true\n */\n discardBackgroundSpans: boolean;\n}\n\n/** JSDoc */\ninterface Activity {\n name: string;\n span?: Span;\n}\n\nconst global = getGlobalObject();\nconst defaultTracingOrigins = ['localhost', /^\\//];\n\n/**\n * Tracing Integration\n */\nexport class Tracing implements Integration {\n /**\n * @inheritDoc\n */\n public name: string = Tracing.id;\n\n /**\n * @inheritDoc\n */\n public static id: string = 'Tracing';\n\n /**\n * Is Tracing enabled, this will be determined once per pageload.\n */\n private static _enabled?: boolean;\n\n /** JSDoc */\n public static options: TracingOptions;\n\n /**\n * Returns current hub.\n */\n private static _getCurrentHub?: () => Hub;\n\n private static _activeTransaction?: Span;\n\n private static _currentIndex: number = 1;\n\n public static _activities: { [key: number]: Activity } = {};\n\n private static _debounce: number = 0;\n\n private readonly _emitOptionsWarning: boolean = false;\n\n private static _performanceCursor: number = 0;\n\n private static _heartbeatTimer: number = 0;\n\n private static _prevHeartbeatString: string | undefined;\n\n private static _heartbeatCounter: number = 0;\n\n /**\n * Constructor for Tracing\n *\n * @param _options TracingOptions\n */\n public constructor(_options?: Partial) {\n if (global.performance) {\n global.performance.mark('sentry-tracing-init');\n }\n const defaults = {\n discardBackgroundSpans: true,\n idleTimeout: 500,\n maxTransactionDuration: 600,\n shouldCreateSpanForRequest(url: string): boolean {\n const origins = (_options && _options.tracingOrigins) || defaultTracingOrigins;\n return (\n origins.some((origin: string | RegExp) => isMatchingPattern(url, origin)) &&\n !isMatchingPattern(url, 'sentry_key')\n );\n },\n startTransactionOnLocationChange: true,\n traceFetch: true,\n traceXHR: true,\n tracesSampleRate: 1,\n tracingOrigins: defaultTracingOrigins,\n };\n // NOTE: Logger doesn't work in contructors, as it's initialized after integrations instances\n if (!_options || !Array.isArray(_options.tracingOrigins) || _options.tracingOrigins.length === 0) {\n this._emitOptionsWarning = true;\n }\n Tracing.options = {\n ...defaults,\n ..._options,\n };\n }\n\n /**\n * @inheritDoc\n */\n public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n Tracing._getCurrentHub = getCurrentHub;\n\n if (this._emitOptionsWarning) {\n logger.warn(\n '[Tracing] You need to define `tracingOrigins` in the options. Set an array of urls or patterns to trace.',\n );\n logger.warn(`[Tracing] We added a reasonable default for you: ${defaultTracingOrigins}`);\n }\n\n if (!Tracing._isEnabled()) {\n return;\n }\n\n // Starting our inital pageload transaction\n if (global.location && global.location.href) {\n // `${global.location.href}` will be used a temp transaction name\n Tracing.startIdleTransaction(global.location.href, {\n op: 'pageload',\n sampled: true,\n });\n }\n\n this._setupXHRTracing();\n\n this._setupFetchTracing();\n\n this._setupHistory();\n\n this._setupErrorHandling();\n\n this._setupBackgroundTabDetection();\n\n Tracing._pingHeartbeat();\n\n // This EventProcessor makes sure that the transaction is not longer than maxTransactionDuration\n addGlobalEventProcessor((event: Event) => {\n const self = getCurrentHub().getIntegration(Tracing);\n if (!self) {\n return event;\n }\n\n if (Tracing._isEnabled()) {\n const isOutdatedTransaction =\n event.timestamp &&\n event.start_timestamp &&\n (event.timestamp - event.start_timestamp > Tracing.options.maxTransactionDuration ||\n event.timestamp - event.start_timestamp < 0);\n\n if (Tracing.options.maxTransactionDuration !== 0 && event.type === 'transaction' && isOutdatedTransaction) {\n logger.log('[Tracing] Discarded transaction since it maxed out maxTransactionDuration');\n return null;\n }\n }\n\n return event;\n });\n }\n\n /**\n * Pings the heartbeat\n */\n private static _pingHeartbeat(): void {\n Tracing._heartbeatTimer = (setTimeout(() => {\n Tracing._beat();\n }, 5000) as any) as number;\n }\n\n /**\n * Checks when entries of Tracing._activities are not changing for 3 beats. If this occurs we finish the transaction\n *\n */\n private static _beat(): void {\n clearTimeout(Tracing._heartbeatTimer);\n const keys = Object.keys(Tracing._activities);\n if (keys.length) {\n const heartbeatString = keys.reduce((prev: string, current: string) => prev + current);\n if (heartbeatString === Tracing._prevHeartbeatString) {\n Tracing._heartbeatCounter++;\n } else {\n Tracing._heartbeatCounter = 0;\n }\n if (Tracing._heartbeatCounter >= 3) {\n if (Tracing._activeTransaction) {\n logger.log(\n \"[Tracing] Heartbeat safeguard kicked in, finishing transaction since activities content hasn't changed for 3 beats\",\n );\n Tracing._activeTransaction.setStatus(SpanStatus.DeadlineExceeded);\n Tracing._activeTransaction.setTag('heartbeat', 'failed');\n Tracing.finishIdleTransaction();\n }\n }\n Tracing._prevHeartbeatString = heartbeatString;\n }\n Tracing._pingHeartbeat();\n }\n\n /**\n * Discards active transactions if tab moves to background\n */\n private _setupBackgroundTabDetection(): void {\n if (Tracing.options.discardBackgroundSpans && global.document) {\n document.addEventListener('visibilitychange', () => {\n if (document.hidden && Tracing._activeTransaction) {\n logger.log('[Tracing] Discarded active transaction incl. activities since tab moved to the background');\n Tracing._resetActiveTransaction();\n }\n });\n }\n }\n\n /**\n * Unsets the current active transaction + activities\n */\n private static _resetActiveTransaction(): void {\n Tracing._activeTransaction = undefined;\n Tracing._activities = {};\n }\n\n /**\n * Registers to History API to detect navigation changes\n */\n private _setupHistory(): void {\n if (Tracing.options.startTransactionOnLocationChange) {\n addInstrumentationHandler({\n callback: historyCallback,\n type: 'history',\n });\n }\n }\n\n /**\n * Attaches to fetch to add sentry-trace header + creating spans\n */\n private _setupFetchTracing(): void {\n if (Tracing.options.traceFetch && supportsNativeFetch()) {\n addInstrumentationHandler({\n callback: fetchCallback,\n type: 'fetch',\n });\n }\n }\n\n /**\n * Attaches to XHR to add sentry-trace header + creating spans\n */\n private _setupXHRTracing(): void {\n if (Tracing.options.traceXHR) {\n addInstrumentationHandler({\n callback: xhrCallback,\n type: 'xhr',\n });\n }\n }\n\n /**\n * Configures global error listeners\n */\n private _setupErrorHandling(): void {\n // tslint:disable-next-line: completed-docs\n function errorCallback(): void {\n if (Tracing._activeTransaction) {\n /**\n * If an error or unhandled promise occurs, we mark the active transaction as failed\n */\n logger.log(`[Tracing] Global error occured, setting status in transaction: ${SpanStatus.InternalError}`);\n (Tracing._activeTransaction as SpanClass).setStatus(SpanStatus.InternalError);\n }\n }\n addInstrumentationHandler({\n callback: errorCallback,\n type: 'error',\n });\n addInstrumentationHandler({\n callback: errorCallback,\n type: 'unhandledrejection',\n });\n }\n\n /**\n * Is tracing enabled\n */\n private static _isEnabled(): boolean {\n if (Tracing._enabled !== undefined) {\n return Tracing._enabled;\n }\n // This happens only in test cases where the integration isn't initalized properly\n // tslint:disable-next-line: strict-type-predicates\n if (!Tracing.options || typeof Tracing.options.tracesSampleRate !== 'number') {\n return false;\n }\n Tracing._enabled = Math.random() > Tracing.options.tracesSampleRate ? false : true;\n return Tracing._enabled;\n }\n\n /**\n * Starts a Transaction waiting for activity idle to finish\n */\n public static startIdleTransaction(name: string, spanContext?: SpanContext): Span | undefined {\n if (!Tracing._isEnabled()) {\n // Tracing is not enabled\n return undefined;\n }\n\n // If we already have an active transaction it means one of two things\n // a) The user did rapid navigation changes and didn't wait until the transaction was finished\n // b) A activity wasn't popped correctly and therefore the transaction is stalling\n Tracing.finishIdleTransaction();\n\n logger.log('[Tracing] startIdleTransaction, name:', name);\n\n const _getCurrentHub = Tracing._getCurrentHub;\n if (!_getCurrentHub) {\n return undefined;\n }\n\n const hub = _getCurrentHub();\n if (!hub) {\n return undefined;\n }\n\n const span = hub.startSpan(\n {\n ...spanContext,\n transaction: name,\n },\n true,\n );\n\n Tracing._activeTransaction = span;\n\n // We need to do this workaround here and not use configureScope\n // Reason being at the time we start the inital transaction we do not have a client bound on the hub yet\n // therefore configureScope wouldn't be executed and we would miss setting the transaction\n // tslint:disable-next-line: no-unsafe-any\n (hub as any).getScope().setSpan(span);\n\n // The reason we do this here is because of cached responses\n // If we start and transaction without an activity it would never finish since there is no activity\n const id = Tracing.pushActivity('idleTransactionStarted');\n setTimeout(() => {\n Tracing.popActivity(id);\n }, (Tracing.options && Tracing.options.idleTimeout) || 100);\n\n return span;\n }\n\n /**\n * Update transaction\n * @deprecated\n */\n public static updateTransactionName(name: string): void {\n logger.log('[Tracing] DEPRECATED, use Sentry.configureScope => scope.setTransaction instead', name);\n const _getCurrentHub = Tracing._getCurrentHub;\n if (_getCurrentHub) {\n const hub = _getCurrentHub();\n if (hub) {\n hub.configureScope(scope => {\n scope.setTransaction(name);\n });\n }\n }\n }\n\n /**\n * Finshes the current active transaction\n */\n public static finishIdleTransaction(): void {\n const active = Tracing._activeTransaction as SpanClass;\n if (active) {\n Tracing._addPerformanceEntries(active);\n logger.log('[Tracing] finishIdleTransaction', active.transaction);\n active.finish(/*trimEnd*/ true);\n Tracing._resetActiveTransaction();\n }\n }\n\n /**\n * This uses `performance.getEntries()` to add additional spans to the active transaction.\n * Also, we update our timings since we consider the timings in this API to be more correct than our manual\n * measurements.\n *\n * @param transactionSpan The transaction span\n */\n private static _addPerformanceEntries(transactionSpan: SpanClass): void {\n if (!global.performance) {\n // Gatekeeper if performance API not available\n return;\n }\n\n logger.log('[Tracing] Adding & adjusting spans using Performance API');\n\n const timeOrigin = Tracing._msToSec(performance.timeOrigin);\n\n // tslint:disable-next-line: completed-docs\n function addSpan(span: SpanClass): void {\n if (transactionSpan.spanRecorder) {\n transactionSpan.spanRecorder.finishSpan(span);\n }\n }\n\n // tslint:disable-next-line: completed-docs\n function addPerformanceNavigationTiming(parent: SpanClass, entry: { [key: string]: number }, event: string): void {\n const span = parent.child({\n description: event,\n op: 'browser',\n });\n span.startTimestamp = timeOrigin + Tracing._msToSec(entry[`${event}Start`]);\n span.timestamp = timeOrigin + Tracing._msToSec(entry[`${event}End`]);\n addSpan(span);\n }\n\n // tslint:disable-next-line: completed-docs\n function addRequest(parent: SpanClass, entry: { [key: string]: number }): void {\n const request = parent.child({\n description: 'request',\n op: 'browser',\n });\n request.startTimestamp = timeOrigin + Tracing._msToSec(entry.requestStart);\n request.timestamp = timeOrigin + Tracing._msToSec(entry.responseEnd);\n addSpan(request);\n const response = parent.child({\n description: 'response',\n op: 'browser',\n });\n response.startTimestamp = timeOrigin + Tracing._msToSec(entry.responseStart);\n response.timestamp = timeOrigin + Tracing._msToSec(entry.responseEnd);\n addSpan(response);\n }\n\n let entryScriptSrc: string | undefined;\n\n if (global.document) {\n // tslint:disable-next-line: prefer-for-of\n for (let i = 0; i < document.scripts.length; i++) {\n // We go through all scripts on the page and look for 'data-entry'\n // We remember the name and measure the time between this script finished loading and\n // our mark 'sentry-tracing-init'\n if (document.scripts[i].dataset.entry === 'true') {\n entryScriptSrc = document.scripts[i].src;\n break;\n }\n }\n }\n\n let entryScriptStartEndTime: number | undefined;\n let tracingInitMarkStartTime: number | undefined;\n\n // tslint:disable: no-unsafe-any\n performance\n .getEntries()\n .slice(Tracing._performanceCursor)\n .forEach((entry: any) => {\n const startTime = Tracing._msToSec(entry.startTime as number);\n const duration = Tracing._msToSec(entry.duration as number);\n\n if (transactionSpan.op === 'navigation' && timeOrigin + startTime < transactionSpan.startTimestamp) {\n return;\n }\n\n switch (entry.entryType) {\n case 'navigation':\n addPerformanceNavigationTiming(transactionSpan, entry, 'unloadEvent');\n addPerformanceNavigationTiming(transactionSpan, entry, 'domContentLoadedEvent');\n addPerformanceNavigationTiming(transactionSpan, entry, 'loadEvent');\n addPerformanceNavigationTiming(transactionSpan, entry, 'connect');\n addPerformanceNavigationTiming(transactionSpan, entry, 'domainLookup');\n addRequest(transactionSpan, entry);\n break;\n case 'mark':\n case 'paint':\n case 'measure':\n const mark = transactionSpan.child({\n description: `${entry.entryType} ${entry.name}`,\n op: 'mark',\n });\n mark.startTimestamp = timeOrigin + startTime;\n mark.timestamp = mark.startTimestamp + duration;\n if (tracingInitMarkStartTime === undefined && entry.name === 'sentry-tracing-init') {\n tracingInitMarkStartTime = mark.startTimestamp;\n }\n addSpan(mark);\n break;\n case 'resource':\n const resourceName = entry.name.replace(window.location.origin, '');\n if (entry.initiatorType === 'xmlhttprequest' || entry.initiatorType === 'fetch') {\n // We need to update existing spans with new timing info\n if (transactionSpan.spanRecorder) {\n transactionSpan.spanRecorder.finishedSpans.map((finishedSpan: SpanClass) => {\n if (finishedSpan.description && finishedSpan.description.indexOf(resourceName) !== -1) {\n finishedSpan.startTimestamp = timeOrigin + startTime;\n finishedSpan.timestamp = finishedSpan.startTimestamp + duration;\n }\n });\n }\n } else {\n const resource = transactionSpan.child({\n description: `${entry.initiatorType} ${resourceName}`,\n op: `resource`,\n });\n resource.startTimestamp = timeOrigin + startTime;\n resource.timestamp = resource.startTimestamp + duration;\n // We remember the entry script end time to calculate the difference to the first init mark\n if (entryScriptStartEndTime === undefined && (entryScriptSrc || '').includes(resourceName)) {\n entryScriptStartEndTime = resource.timestamp;\n }\n addSpan(resource);\n }\n break;\n default:\n // Ignore other entry types.\n }\n });\n\n if (entryScriptStartEndTime !== undefined && tracingInitMarkStartTime !== undefined) {\n const evaluation = transactionSpan.child({\n description: 'evaluation',\n op: `script`,\n });\n evaluation.startTimestamp = entryScriptStartEndTime;\n evaluation.timestamp = tracingInitMarkStartTime;\n addSpan(evaluation);\n }\n\n Tracing._performanceCursor = Math.max(performance.getEntries().length - 1, 0);\n\n // tslint:enable: no-unsafe-any\n }\n\n /**\n * Sets the status of the current active transaction (if there is one)\n */\n public static setTransactionStatus(status: SpanStatus): void {\n const active = Tracing._activeTransaction;\n if (active) {\n logger.log('[Tracing] setTransactionStatus', status);\n active.setStatus(status);\n }\n }\n\n /**\n * Converts from milliseconds to seconds\n * @param time time in ms\n */\n private static _msToSec(time: number): number {\n return time / 1000;\n }\n\n /**\n * Starts tracking for a specifc activity\n *\n * @param name Name of the activity, can be any string (Only used internally to identify the activity)\n * @param spanContext If provided a Span with the SpanContext will be created.\n * @param options _autoPopAfter_ | Time in ms, if provided the activity will be popped automatically after this timeout. This can be helpful in cases where you cannot gurantee your application knows the state and calls `popActivity` for sure.\n */\n public static pushActivity(\n name: string,\n spanContext?: SpanContext,\n options?: {\n autoPopAfter?: number;\n },\n ): number {\n if (!Tracing._isEnabled()) {\n // Tracing is not enabled\n return 0;\n }\n if (!Tracing._activeTransaction) {\n logger.log(`[Tracing] Not pushing activity ${name} since there is no active transaction`);\n return 0;\n }\n\n // We want to clear the timeout also here since we push a new activity\n clearTimeout(Tracing._debounce);\n\n const _getCurrentHub = Tracing._getCurrentHub;\n if (spanContext && _getCurrentHub) {\n const hub = _getCurrentHub();\n if (hub) {\n const span = hub.startSpan(spanContext);\n Tracing._activities[Tracing._currentIndex] = {\n name,\n span,\n };\n }\n } else {\n Tracing._activities[Tracing._currentIndex] = {\n name,\n };\n }\n\n logger.log(`[Tracing] pushActivity: ${name}#${Tracing._currentIndex}`);\n logger.log('[Tracing] activies count', Object.keys(Tracing._activities).length);\n if (options && typeof options.autoPopAfter === 'number') {\n logger.log(`[Tracing] auto pop of: ${name}#${Tracing._currentIndex} in ${options.autoPopAfter}ms`);\n const index = Tracing._currentIndex;\n setTimeout(() => {\n Tracing.popActivity(index, {\n autoPop: true,\n status: SpanStatus.DeadlineExceeded,\n });\n }, options.autoPopAfter);\n }\n return Tracing._currentIndex++;\n }\n\n /**\n * Removes activity and finishes the span in case there is one\n */\n public static popActivity(id: number, spanData?: { [key: string]: any }): void {\n // The !id is on purpose to also fail with 0\n // Since 0 is returned by push activity in case tracing is not enabled\n // or there is no active transaction\n if (!Tracing._isEnabled() || !id) {\n // Tracing is not enabled\n return;\n }\n\n const activity = Tracing._activities[id];\n\n if (activity) {\n logger.log(`[Tracing] popActivity ${activity.name}#${id}`);\n const span = activity.span as SpanClass;\n if (span) {\n if (spanData) {\n Object.keys(spanData).forEach((key: string) => {\n span.setData(key, spanData[key]);\n if (key === 'status_code') {\n span.setHttpStatus(spanData[key] as number);\n }\n if (key === 'status') {\n span.setStatus(spanData[key] as SpanStatus);\n }\n });\n }\n span.finish();\n }\n // tslint:disable-next-line: no-dynamic-delete\n delete Tracing._activities[id];\n }\n\n const count = Object.keys(Tracing._activities).length;\n clearTimeout(Tracing._debounce);\n\n logger.log('[Tracing] activies count', count);\n\n if (count === 0 && Tracing._activeTransaction) {\n const timeout = Tracing.options && Tracing.options.idleTimeout;\n logger.log(`[Tracing] Flushing Transaction in ${timeout}ms`);\n Tracing._debounce = (setTimeout(() => {\n Tracing.finishIdleTransaction();\n }, timeout) as any) as number;\n }\n }\n}\n\n/**\n * Creates breadcrumbs from XHR API calls\n */\nfunction xhrCallback(handlerData: { [key: string]: any }): void {\n if (!Tracing.options.traceXHR) {\n return;\n }\n\n // tslint:disable-next-line: no-unsafe-any\n if (!handlerData || !handlerData.xhr || !handlerData.xhr.__sentry_xhr__) {\n return;\n }\n\n // tslint:disable: no-unsafe-any\n const xhr = handlerData.xhr.__sentry_xhr__;\n\n if (!Tracing.options.shouldCreateSpanForRequest(xhr.url)) {\n return;\n }\n\n // We only capture complete, non-sentry requests\n if (handlerData.xhr.__sentry_own_request__) {\n return;\n }\n\n if (handlerData.endTimestamp && handlerData.xhr.__sentry_xhr_activity_id__) {\n Tracing.popActivity(handlerData.xhr.__sentry_xhr_activity_id__, handlerData.xhr.__sentry_xhr__);\n return;\n }\n\n handlerData.xhr.__sentry_xhr_activity_id__ = Tracing.pushActivity('xhr', {\n data: {\n ...xhr.data,\n type: 'xhr',\n },\n description: `${xhr.method} ${xhr.url}`,\n op: 'http',\n });\n\n // Adding the trace header to the span\n const activity = Tracing._activities[handlerData.xhr.__sentry_xhr_activity_id__];\n if (activity) {\n const span = activity.span;\n if (span && handlerData.xhr.setRequestHeader) {\n handlerData.xhr.setRequestHeader('sentry-trace', span.toTraceparent());\n }\n }\n // tslint:enable: no-unsafe-any\n}\n\n/**\n * Creates breadcrumbs from fetch API calls\n */\nfunction fetchCallback(handlerData: { [key: string]: any }): void {\n // tslint:disable: no-unsafe-any\n if (!Tracing.options.traceFetch) {\n return;\n }\n\n if (!Tracing.options.shouldCreateSpanForRequest(handlerData.fetchData.url)) {\n return;\n }\n\n if (handlerData.endTimestamp && handlerData.fetchData.__activity) {\n Tracing.popActivity(handlerData.fetchData.__activity, handlerData.fetchData);\n } else {\n handlerData.fetchData.__activity = Tracing.pushActivity('fetch', {\n data: {\n ...handlerData.fetchData,\n type: 'fetch',\n },\n description: `${handlerData.fetchData.method} ${handlerData.fetchData.url}`,\n op: 'http',\n });\n\n const activity = Tracing._activities[handlerData.fetchData.__activity];\n if (activity) {\n const span = activity.span;\n if (span) {\n const options = (handlerData.args[1] = (handlerData.args[1] as { [key: string]: any }) || {});\n if (options.headers) {\n if (Array.isArray(options.headers)) {\n options.headers = [...options.headers, { 'sentry-trace': span.toTraceparent() }];\n } else {\n options.headers = {\n ...options.headers,\n 'sentry-trace': span.toTraceparent(),\n };\n }\n } else {\n options.headers = { 'sentry-trace': span.toTraceparent() };\n }\n }\n }\n }\n // tslint:enable: no-unsafe-any\n}\n\n/**\n * Creates transaction from navigation changes\n */\nfunction historyCallback(_: { [key: string]: any }): void {\n if (Tracing.options.startTransactionOnLocationChange && global && global.location) {\n Tracing.startIdleTransaction(global.location.href, {\n op: 'navigation',\n sampled: true,\n });\n }\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/span.d.ts b/node_modules/@sentry/apm/esm/span.d.ts
deleted file mode 100644
index 63b488a..0000000
--- a/node_modules/@sentry/apm/esm/span.d.ts
+++ /dev/null
@@ -1,143 +0,0 @@
-import { Hub } from '@sentry/hub';
-import { Span as SpanInterface, SpanContext, SpanStatus } from '@sentry/types';
-export declare const TRACEPARENT_REGEXP: RegExp;
-/**
- * Keeps track of finished spans for a given transaction
- */
-declare class SpanRecorder {
- private readonly _maxlen;
- private _openSpanCount;
- finishedSpans: Span[];
- constructor(maxlen: number);
- /**
- * This is just so that we don't run out of memory while recording a lot
- * of spans. At some point we just stop and flush out the start of the
- * trace tree (i.e.the first n spans with the smallest
- * start_timestamp).
- */
- startSpan(span: Span): void;
- /**
- * Appends a span to finished spans table
- * @param span Span to be added
- */
- finishSpan(span: Span): void;
-}
-/**
- * Span contains all data about a span
- */
-export declare class Span implements SpanInterface, SpanContext {
- /**
- * The reference to the current hub.
- */
- private readonly _hub;
- /**
- * @inheritDoc
- */
- private readonly _traceId;
- /**
- * @inheritDoc
- */
- private readonly _spanId;
- /**
- * @inheritDoc
- */
- private readonly _parentSpanId?;
- /**
- * @inheritDoc
- */
- sampled?: boolean;
- /**
- * Timestamp in seconds when the span was created.
- */
- startTimestamp: number;
- /**
- * Timestamp in seconds when the span ended.
- */
- timestamp?: number;
- /**
- * @inheritDoc
- */
- transaction?: string;
- /**
- * @inheritDoc
- */
- op?: string;
- /**
- * @inheritDoc
- */
- description?: string;
- /**
- * @inheritDoc
- */
- tags: {
- [key: string]: string;
- };
- /**
- * @inheritDoc
- */
- data: {
- [key: string]: any;
- };
- /**
- * List of spans that were finalized
- */
- spanRecorder?: SpanRecorder;
- constructor(spanContext?: SpanContext, hub?: Hub);
- /**
- * Attaches SpanRecorder to the span itself
- * @param maxlen maximum number of spans that can be recorded
- */
- initFinishedSpans(maxlen?: number): void;
- /**
- * Creates a new `Span` while setting the current `Span.id` as `parentSpanId`.
- * Also the `sampled` decision will be inherited.
- */
- child(spanContext?: Pick>): Span;
- /**
- * Continues a trace from a string (usually the header).
- * @param traceparent Traceparent string
- */
- static fromTraceparent(traceparent: string, spanContext?: Pick>): Span | undefined;
- /**
- * @inheritDoc
- */
- setTag(key: string, value: string): this;
- /**
- * @inheritDoc
- */
- setData(key: string, value: any): this;
- /**
- * @inheritDoc
- */
- setStatus(value: SpanStatus): this;
- /**
- * @inheritDoc
- */
- setHttpStatus(httpStatus: number): this;
- /**
- * @inheritDoc
- */
- isSuccess(): boolean;
- /**
- * Sets the finish timestamp on the current span.
- * @param trimEnd If true, sets the end timestamp of the transaction to the highest timestamp of child spans, trimming
- * the duration of the transaction span. This is useful to discard extra time in the transaction span that is not
- * accounted for in child spans, like what happens in the idle transaction Tracing integration, where we finish the
- * transaction after a given "idle time" and we don't want this "idle time" to be part of the transaction.
- */
- finish(trimEnd?: boolean): string | undefined;
- /**
- * @inheritDoc
- */
- toTraceparent(): string;
- /**
- * @inheritDoc
- */
- getTraceContext(): object;
- /**
- * @inheritDoc
- */
- toJSON(): object;
-}
-export {};
-//# sourceMappingURL=span.d.ts.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/span.d.ts.map b/node_modules/@sentry/apm/esm/span.d.ts.map
deleted file mode 100644
index 10c75c2..0000000
--- a/node_modules/@sentry/apm/esm/span.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"span.d.ts","sourceRoot":"","sources":["../src/span.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB,GAAG,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI/E,eAAO,MAAM,kBAAkB,QAM9B,CAAC;AAEF;;GAEG;AACH,cAAM,YAAY;IAChB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,cAAc,CAAa;IAC5B,aAAa,EAAE,IAAI,EAAE,CAAM;gBAEf,MAAM,EAAE,MAAM;IAIjC;;;;;OAKG;IACI,SAAS,C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ACnB,WAAW,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,MAAM,WAAW,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC,CAAC,GAC5F,IAAI,GAAG,SAAS;IAmBnB;;OAEG;IACI,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAK/C;;OAEG;IACI,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAK7C;;OAEG;IACI,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAKzC;;OAEG;IACI,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAS9C;;OAEG;IACI,SAAS,IAAI,OAAO;IAI3B;;;;;;OAMG;IACI,MAAM,CAAC,OAAO,GAAE,OAAe,GAAG,MAAM,GAAG,SAAS;IAqD3D;;OAEG;IACI,aAAa,IAAI,MAAM;IAQ9B;;OAEG;IACI,eAAe,IAAI,MAAM;IAahC;;OAEG;IACI,MAAM,IAAI,MAAM;CAexB"}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/span.js b/node_modules/@sentry/apm/esm/span.js
deleted file mode 100644
index 0b7f94d..0000000
--- a/node_modules/@sentry/apm/esm/span.js
+++ /dev/null
@@ -1,283 +0,0 @@
-// tslint:disable:max-classes-per-file
-import * as tslib_1 from "tslib";
-import { getCurrentHub, Hub } from '@sentry/hub';
-import { SpanStatus } from '@sentry/types';
-import { dropUndefinedKeys, isInstanceOf, logger, timestampWithMs, uuid4 } from '@sentry/utils';
-// TODO: Should this be exported?
-export var TRACEPARENT_REGEXP = new RegExp('^[ \\t]*' + // whitespace
- '([0-9a-f]{32})?' + // trace_id
- '-?([0-9a-f]{16})?' + // span_id
- '-?([01])?' + // sampled
- '[ \\t]*$');
-/**
- * Keeps track of finished spans for a given transaction
- */
-var SpanRecorder = /** @class */ (function () {
- function SpanRecorder(maxlen) {
- this._openSpanCount = 0;
- this.finishedSpans = [];
- this._maxlen = maxlen;
- }
- /**
- * This is just so that we don't run out of memory while recording a lot
- * of spans. At some point we just stop and flush out the start of the
- * trace tree (i.e.the first n spans with the smallest
- * start_timestamp).
- */
- SpanRecorder.prototype.startSpan = function (span) {
- this._openSpanCount += 1;
- if (this._openSpanCount > this._maxlen) {
- span.spanRecorder = undefined;
- }
- };
- /**
- * Appends a span to finished spans table
- * @param span Span to be added
- */
- SpanRecorder.prototype.finishSpan = function (span) {
- this.finishedSpans.push(span);
- };
- return SpanRecorder;
-}());
-/**
- * Span contains all data about a span
- */
-var Span = /** @class */ (function () {
- function Span(spanContext, hub) {
- /**
- * The reference to the current hub.
- */
- this._hub = getCurrentHub();
- /**
- * @inheritDoc
- */
- this._traceId = uuid4();
- /**
- * @inheritDoc
- */
- this._spanId = uuid4().substring(16);
- /**
- * Timestamp in seconds when the span was created.
- */
- this.startTimestamp = timestampWithMs();
- /**
- * @inheritDoc
- */
- this.tags = {};
- /**
- * @inheritDoc
- */
- this.data = {};
- if (isInstanceOf(hub, Hub)) {
- this._hub = hub;
- }
- if (!spanContext) {
- return this;
- }
- if (spanContext.traceId) {
- this._traceId = spanContext.traceId;
- }
- if (spanContext.spanId) {
- this._spanId = spanContext.spanId;
- }
- if (spanContext.parentSpanId) {
- this._parentSpanId = spanContext.parentSpanId;
- }
- // We want to include booleans as well here
- if ('sampled' in spanContext) {
- this.sampled = spanContext.sampled;
- }
- if (spanContext.transaction) {
- this.transaction = spanContext.transaction;
- }
- if (spanContext.op) {
- this.op = spanContext.op;
- }
- if (spanContext.description) {
- this.description = spanContext.description;
- }
- if (spanContext.data) {
- this.data = spanContext.data;
- }
- if (spanContext.tags) {
- this.tags = spanContext.tags;
- }
- }
- /**
- * Attaches SpanRecorder to the span itself
- * @param maxlen maximum number of spans that can be recorded
- */
- Span.prototype.initFinishedSpans = function (maxlen) {
- if (maxlen === void 0) { maxlen = 1000; }
- if (!this.spanRecorder) {
- this.spanRecorder = new SpanRecorder(maxlen);
- }
- this.spanRecorder.startSpan(this);
- };
- /**
- * Creates a new `Span` while setting the current `Span.id` as `parentSpanId`.
- * Also the `sampled` decision will be inherited.
- */
- Span.prototype.child = function (spanContext) {
- var span = new Span(tslib_1.__assign({}, spanContext, { parentSpanId: this._spanId, sampled: this.sampled, traceId: this._traceId }));
- span.spanRecorder = this.spanRecorder;
- return span;
- };
- /**
- * Continues a trace from a string (usually the header).
- * @param traceparent Traceparent string
- */
- Span.fromTraceparent = function (traceparent, spanContext) {
- var matches = traceparent.match(TRACEPARENT_REGEXP);
- if (matches) {
- var sampled = void 0;
- if (matches[3] === '1') {
- sampled = true;
- }
- else if (matches[3] === '0') {
- sampled = false;
- }
- return new Span(tslib_1.__assign({}, spanContext, { parentSpanId: matches[2], sampled: sampled, traceId: matches[1] }));
- }
- return undefined;
- };
- /**
- * @inheritDoc
- */
- Span.prototype.setTag = function (key, value) {
- var _a;
- this.tags = tslib_1.__assign({}, this.tags, (_a = {}, _a[key] = value, _a));
- return this;
- };
- /**
- * @inheritDoc
- */
- Span.prototype.setData = function (key, value) {
- var _a;
- this.data = tslib_1.__assign({}, this.data, (_a = {}, _a[key] = value, _a));
- return this;
- };
- /**
- * @inheritDoc
- */
- Span.prototype.setStatus = function (value) {
- this.setTag('status', value);
- return this;
- };
- /**
- * @inheritDoc
- */
- Span.prototype.setHttpStatus = function (httpStatus) {
- this.setTag('http.status_code', String(httpStatus));
- var spanStatus = SpanStatus.fromHttpCode(httpStatus);
- if (spanStatus !== SpanStatus.UnknownError) {
- this.setStatus(spanStatus);
- }
- return this;
- };
- /**
- * @inheritDoc
- */
- Span.prototype.isSuccess = function () {
- return this.tags.status === SpanStatus.Ok;
- };
- /**
- * Sets the finish timestamp on the current span.
- * @param trimEnd If true, sets the end timestamp of the transaction to the highest timestamp of child spans, trimming
- * the duration of the transaction span. This is useful to discard extra time in the transaction span that is not
- * accounted for in child spans, like what happens in the idle transaction Tracing integration, where we finish the
- * transaction after a given "idle time" and we don't want this "idle time" to be part of the transaction.
- */
- Span.prototype.finish = function (trimEnd) {
- var _this = this;
- if (trimEnd === void 0) { trimEnd = false; }
- // This transaction is already finished, so we should not flush it again.
- if (this.timestamp !== undefined) {
- return undefined;
- }
- this.timestamp = timestampWithMs();
- if (this.spanRecorder === undefined) {
- return undefined;
- }
- this.spanRecorder.finishSpan(this);
- if (this.transaction === undefined) {
- // If this has no transaction set we assume there's a parent
- // transaction for this span that would be flushed out eventually.
- return undefined;
- }
- if (this.sampled === undefined) {
- // At this point a `sampled === undefined` should have already been
- // resolved to a concrete decision. If `sampled` is `undefined`, it's
- // likely that somebody used `Sentry.startSpan(...)` on a
- // non-transaction span and later decided to make it a transaction.
- logger.warn('Discarding transaction Span without sampling decision');
- return undefined;
- }
- var finishedSpans = this.spanRecorder ? this.spanRecorder.finishedSpans.filter(function (s) { return s !== _this; }) : [];
- if (trimEnd && finishedSpans.length > 0) {
- this.timestamp = finishedSpans.reduce(function (prev, current) {
- if (prev.timestamp && current.timestamp) {
- return prev.timestamp > current.timestamp ? prev : current;
- }
- return prev;
- }).timestamp;
- }
- return this._hub.captureEvent({
- contexts: {
- trace: this.getTraceContext(),
- },
- spans: finishedSpans,
- start_timestamp: this.startTimestamp,
- tags: this.tags,
- timestamp: this.timestamp,
- transaction: this.transaction,
- type: 'transaction',
- });
- };
- /**
- * @inheritDoc
- */
- Span.prototype.toTraceparent = function () {
- var sampledString = '';
- if (this.sampled !== undefined) {
- sampledString = this.sampled ? '-1' : '-0';
- }
- return this._traceId + "-" + this._spanId + sampledString;
- };
- /**
- * @inheritDoc
- */
- Span.prototype.getTraceContext = function () {
- return dropUndefinedKeys({
- data: Object.keys(this.data).length > 0 ? this.data : undefined,
- description: this.description,
- op: this.op,
- parent_span_id: this._parentSpanId,
- span_id: this._spanId,
- status: this.tags.status,
- tags: Object.keys(this.tags).length > 0 ? this.tags : undefined,
- trace_id: this._traceId,
- });
- };
- /**
- * @inheritDoc
- */
- Span.prototype.toJSON = function () {
- return dropUndefinedKeys({
- data: Object.keys(this.data).length > 0 ? this.data : undefined,
- description: this.description,
- op: this.op,
- parent_span_id: this._parentSpanId,
- sampled: this.sampled,
- span_id: this._spanId,
- start_timestamp: this.startTimestamp,
- tags: Object.keys(this.tags).length > 0 ? this.tags : undefined,
- timestamp: this.timestamp,
- trace_id: this._traceId,
- transaction: this.transaction,
- });
- };
- return Span;
-}());
-export { Span };
-//# sourceMappingURL=span.js.map
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/esm/span.js.map b/node_modules/@sentry/apm/esm/span.js.map
deleted file mode 100644
index 4c67384..0000000
--- a/node_modules/@sentry/apm/esm/span.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"span.js","sourceRoot":"","sources":["../src/span.ts"],"names":[],"mappings":"AAAA,sCAAsC;;AAEtC,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAsC,UAAU,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEhG,iCAAiC;AACjC,MAAM,CAAC,IAAM,kBAAkB,GAAG,IAAI,MAAM,CAC1C,UAAU,GAAG,aAAa;IAC1B,iBAAiB,GAAG,WAAW;IAC/B,mBAAmB,GAAG,UAAU;IAChC,WAAW,GAAG,UAAU;IACtB,UAAU,CACb,CAAC;AAEF;;GAEG;AACH;IAKE,sBAAmB,MAAc;QAHzB,mBAAc,GAAW,CAAC,CAAC;QAC5B,kBAAa,GAAW,EAAE,CAAC;QAGhC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED;;;;;OAKG;IACI,gCAAS,GAAhB,UAAiB,IAAU;QACzB,IAAI,CAAC,cAAc,IAAI,CAAC,CAAC;QACzB,IAAI,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,OAAO,EAAE;YACtC,IAA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AAI,CAAC,QAAQ;SACxB,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACI,qBAAM,GAAb;QACE,OAAO,iBAAiB,CAAC;YACvB,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;YAC/D,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,cAAc,EAAE,IAAI,CAAC,aAAa;YAClC,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,eAAe,EAAE,IAAI,CAAC,cAAc;YACpC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;YAC/D,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAC,CAAC;IACL,CAAC;IACH,WAAC;AAAD,CAAC,AAnTD,IAmTC","sourcesContent":["// tslint:disable:max-classes-per-file\n\nimport { getCurrentHub, Hub } from '@sentry/hub';\nimport { Span as SpanInterface, SpanContext, SpanStatus } from '@sentry/types';\nimport { dropUndefinedKeys, isInstanceOf, logger, timestampWithMs, uuid4 } from '@sentry/utils';\n\n// TODO: Should this be exported?\nexport const TRACEPARENT_REGEXP = new RegExp(\n '^[ \\\\t]*' + // whitespace\n '([0-9a-f]{32})?' + // trace_id\n '-?([0-9a-f]{16})?' + // span_id\n '-?([01])?' + // sampled\n '[ \\\\t]*$', // whitespace\n);\n\n/**\n * Keeps track of finished spans for a given transaction\n */\nclass SpanRecorder {\n private readonly _maxlen: number;\n private _openSpanCount: number = 0;\n public finishedSpans: Span[] = [];\n\n public constructor(maxlen: number) {\n this._maxlen = maxlen;\n }\n\n /**\n * This is just so that we don't run out of memory while recording a lot\n * of spans. At some point we just stop and flush out the start of the\n * trace tree (i.e.the first n spans with the smallest\n * start_timestamp).\n */\n public startSpan(span: Span): void {\n this._openSpanCount += 1;\n if (this._openSpanCount > this._maxlen) {\n span.spanRecorder = undefined;\n }\n }\n\n /**\n * Appends a span to finished spans table\n * @param span Span to be added\n */\n public finishSpan(span: Span): void {\n this.finishedSpans.push(span);\n }\n}\n\n/**\n * Span contains all data about a span\n */\nexport class Span implements SpanInterface, SpanContext {\n /**\n * The reference to the current hub.\n */\n private readonly _hub: Hub = (getCurrentHub() as unknown) as Hub;\n\n /**\n * @inheritDoc\n */\n private readonly _traceId: string = uuid4();\n\n /**\n * @inheritDoc\n */\n private readonly _spanId: string = uuid4().substring(16);\n\n /**\n * @inheritDoc\n */\n private readonly _parentSpanId?: string;\n\n /**\n * @inheritDoc\n */\n public sampled?: boolean;\n\n /**\n * Timestamp in seconds when the span was created.\n */\n public startTimestamp: number = timestampWithMs();\n\n /**\n * Timestamp in seconds when the span ended.\n */\n public timestamp?: number;\n\n /**\n * @inheritDoc\n */\n public transaction?: string;\n\n /**\n * @inheritDoc\n */\n public op?: string;\n\n /**\n * @inheritDoc\n */\n public description?: string;\n\n /**\n * @inheritDoc\n */\n public tags: { [key: string]: string } = {};\n\n /**\n * @inheritDoc\n */\n public data: { [key: string]: any } = {};\n\n /**\n * List of spans that were finalized\n */\n public spanRecorder?: SpanRecorder;\n\n public constructor(spanContext?: SpanContext, hub?: Hub) {\n if (isInstanceOf(hub, Hub)) {\n this._hub = hub as Hub;\n }\n\n if (!spanContext) {\n return this;\n }\n\n if (spanContext.traceId) {\n this._traceId = spanContext.traceId;\n }\n if (spanContext.spanId) {\n this._spanId = spanContext.spanId;\n }\n if (spanContext.parentSpanId) {\n this._parentSpanId = spanContext.parentSpanId;\n }\n // We want to include booleans as well here\n if ('sampled' in spanContext) {\n this.sampled = spanContext.sampled;\n }\n if (spanContext.transaction) {\n this.transaction = spanContext.transaction;\n }\n if (spanContext.op) {\n this.op = spanContext.op;\n }\n if (spanContext.description) {\n this.description = spanContext.description;\n }\n if (spanContext.data) {\n this.data = spanContext.data;\n }\n if (spanContext.tags) {\n this.tags = spanContext.tags;\n }\n }\n\n /**\n * Attaches SpanRecorder to the span itself\n * @param maxlen maximum number of spans that can be recorded\n */\n public initFinishedSpans(maxlen: number = 1000): void {\n if (!this.spanRecorder) {\n this.spanRecorder = new SpanRecorder(maxlen);\n }\n this.spanRecorder.startSpan(this);\n }\n\n /**\n * Creates a new `Span` while setting the current `Span.id` as `parentSpanId`.\n * Also the `sampled` decision will be inherited.\n */\n public child(spanContext?: Pick>): Span {\n const span = new Span({\n ...spanContext,\n parentSpanId: this._spanId,\n sampled: this.sampled,\n traceId: this._traceId,\n });\n\n span.spanRecorder = this.spanRecorder;\n\n return span;\n }\n\n /**\n * Continues a trace from a string (usually the header).\n * @param traceparent Traceparent string\n */\n public static fromTraceparent(\n traceparent: string,\n spanContext?: Pick>,\n ): Span | undefined {\n const matches = traceparent.match(TRACEPARENT_REGEXP);\n if (matches) {\n let sampled: boolean | undefined;\n if (matches[3] === '1') {\n sampled = true;\n } else if (matches[3] === '0') {\n sampled = false;\n }\n return new Span({\n ...spanContext,\n parentSpanId: matches[2],\n sampled,\n traceId: matches[1],\n });\n }\n return undefined;\n }\n\n /**\n * @inheritDoc\n */\n public setTag(key: string, value: string): this {\n this.tags = { ...this.tags, [key]: value };\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setData(key: string, value: any): this {\n this.data = { ...this.data, [key]: value };\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setStatus(value: SpanStatus): this {\n this.setTag('status', value);\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setHttpStatus(httpStatus: number): this {\n this.setTag('http.status_code', String(httpStatus));\n const spanStatus = SpanStatus.fromHttpCode(httpStatus);\n if (spanStatus !== SpanStatus.UnknownError) {\n this.setStatus(spanStatus);\n }\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public isSuccess(): boolean {\n return this.tags.status === SpanStatus.Ok;\n }\n\n /**\n * Sets the finish timestamp on the current span.\n * @param trimEnd If true, sets the end timestamp of the transaction to the highest timestamp of child spans, trimming\n * the duration of the transaction span. This is useful to discard extra time in the transaction span that is not\n * accounted for in child spans, like what happens in the idle transaction Tracing integration, where we finish the\n * transaction after a given \"idle time\" and we don't want this \"idle time\" to be part of the transaction.\n */\n public finish(trimEnd: boolean = false): string | undefined {\n // This transaction is already finished, so we should not flush it again.\n if (this.timestamp !== undefined) {\n return undefined;\n }\n\n this.timestamp = timestampWithMs();\n\n if (this.spanRecorder === undefined) {\n return undefined;\n }\n\n this.spanRecorder.finishSpan(this);\n\n if (this.transaction === undefined) {\n // If this has no transaction set we assume there's a parent\n // transaction for this span that would be flushed out eventually.\n return undefined;\n }\n\n if (this.sampled === undefined) {\n // At this point a `sampled === undefined` should have already been\n // resolved to a concrete decision. If `sampled` is `undefined`, it's\n // likely that somebody used `Sentry.startSpan(...)` on a\n // non-transaction span and later decided to make it a transaction.\n logger.warn('Discarding transaction Span without sampling decision');\n return undefined;\n }\n\n const finishedSpans = this.spanRecorder ? this.spanRecorder.finishedSpans.filter(s => s !== this) : [];\n\n if (trimEnd && finishedSpans.length > 0) {\n this.timestamp = finishedSpans.reduce((prev: Span, current: Span) => {\n if (prev.timestamp && current.timestamp) {\n return prev.timestamp > current.timestamp ? prev : current;\n }\n return prev;\n }).timestamp;\n }\n\n return this._hub.captureEvent({\n contexts: {\n trace: this.getTraceContext(),\n },\n spans: finishedSpans,\n start_timestamp: this.startTimestamp,\n tags: this.tags,\n timestamp: this.timestamp,\n transaction: this.transaction,\n type: 'transaction',\n });\n }\n\n /**\n * @inheritDoc\n */\n public toTraceparent(): string {\n let sampledString = '';\n if (this.sampled !== undefined) {\n sampledString = this.sampled ? '-1' : '-0';\n }\n return `${this._traceId}-${this._spanId}${sampledString}`;\n }\n\n /**\n * @inheritDoc\n */\n public getTraceContext(): object {\n return dropUndefinedKeys({\n data: Object.keys(this.data).length > 0 ? this.data : undefined,\n description: this.description,\n op: this.op,\n parent_span_id: this._parentSpanId,\n span_id: this._spanId,\n status: this.tags.status,\n tags: Object.keys(this.tags).length > 0 ? this.tags : undefined,\n trace_id: this._traceId,\n });\n }\n\n /**\n * @inheritDoc\n */\n public toJSON(): object {\n return dropUndefinedKeys({\n data: Object.keys(this.data).length > 0 ? this.data : undefined,\n description: this.description,\n op: this.op,\n parent_span_id: this._parentSpanId,\n sampled: this.sampled,\n span_id: this._spanId,\n start_timestamp: this.startTimestamp,\n tags: Object.keys(this.tags).length > 0 ? this.tags : undefined,\n timestamp: this.timestamp,\n trace_id: this._traceId,\n transaction: this.transaction,\n });\n }\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/@sentry/apm/package.json b/node_modules/@sentry/apm/package.json
deleted file mode 100644
index c8e3054..0000000
--- a/node_modules/@sentry/apm/package.json
+++ /dev/null
@@ -1,121 +0,0 @@
-{
- "_args": [
- [
- "@sentry/apm@5.14.1",
- "/Users/glennskarepedersen/code/mystuff/homey/com.mill"
- ]
- ],
- "_from": "@sentry/apm@5.14.1",
- "_id": "@sentry/apm@5.14.1",
- "_inBundle": false,
- "_integrity": "sha1-mWBcTPkzlirtpKGwPpklYhPlHX0=",
- "_location": "/@sentry/apm",
- "_phantomChildren": {},
- "_requested": {
- "type": "version",
- "registry": true,
- "raw": "@sentry/apm@5.14.1",
- "name": "@sentry/apm",
- "escapedName": "@sentry%2fapm",
- "scope": "@sentry",
- "rawSpec": "5.14.1",
- "saveSpec": null,
- "fetchSpec": "5.14.1"
- },
- "_requiredBy": [
- "/@sentry/node"
- ],
- "_resolved": "https://vimond.jfrog.io/vimond/api/npm/npm-virtual/@sentry/apm/-/apm-5.14.1.tgz",
- "_spec": "5.14.1",
- "_where": "/Users/glennskarepedersen/code/mystuff/homey/com.mill",
- "author": {
- "name": "Sentry"
- },
- "bugs": {
- "url": "https://github.com/getsentry/sentry-javascript/issues"
- },
- "dependencies": {
- "@sentry/browser": "5.14.1",
- "@sentry/hub": "5.14.1",
- "@sentry/minimal": "5.14.1",
- "@sentry/types": "5.14.1",
- "@sentry/utils": "5.14.1",
- "tslib": "^1.9.3"
- },
- "description": "Extensions for APM",
- "devDependencies": {
- "@types/express": "^4.17.1",
- "jest": "^24.7.1",
- "npm-run-all": "^4.1.2",
- "prettier": "^1.17.0",
- "prettier-check": "^2.0.0",
- "rimraf": "^2.6.3",
- "rollup": "^1.10.1",
- "rollup-plugin-commonjs": "^9.3.4",
- "rollup-plugin-license": "^0.8.1",
- "rollup-plugin-node-resolve": "^4.2.3",
- "rollup-plugin-terser": "^4.0.4",
- "rollup-plugin-typescript2": "^0.21.0",
- "tslint": "^5.16.0",
- "typescript": "^3.4.5"
- },
- "engines": {
- "node": ">=6"
- },
- "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/core",
- "jest": {
- "collectCoverage": true,
- "transform": {
- "^.+\\.ts$": "ts-jest"
- },
- "moduleFileExtensions": [
- "js",
- "ts"
- ],
- "testEnvironment": "node",
- "testMatch": [
- "**/*.test.ts"
- ],
- "globals": {
- "ts-jest": {
- "tsConfig": "./tsconfig.json",
- "diagnostics": false
- }
- }
- },
- "license": "BSD-3-Clause",
- "main": "dist/index.js",
- "module": "esm/index.js",
- "name": "@sentry/apm",
- "publishConfig": {
- "access": "public"
- },
- "repository": {
- "type": "git",
- "url": "git://github.com/getsentry/sentry-javascript.git"
- },
- "scripts": {
- "build": "run-p build:es5 build:esm build:bundle",
- "build:bundle": "rollup --config",
- "build:bundle:watch": "rollup --config --watch",
- "build:es5": "tsc -p tsconfig.build.json",
- "build:esm": "tsc -p tsconfig.esm.json",
- "build:watch": "run-p build:watch:es5 build:watch:esm",
- "build:watch:es5": "tsc -p tsconfig.build.json -w --preserveWatchOutput",
- "build:watch:esm": "tsc -p tsconfig.esm.json -w --preserveWatchOutput",
- "clean": "rimraf dist coverage build esm",
- "fix": "run-s fix:tslint fix:prettier",
- "fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
- "fix:tslint": "tslint --fix -t stylish -p .",
- "link:yarn": "yarn link",
- "lint": "run-s lint:prettier lint:tslint",
- "lint:prettier": "prettier-check \"{src,test}/**/*.ts\"",
- "lint:tslint": "tslint -t stylish -p .",
- "lint:tslint:json": "tslint --format json -p . | tee lint-results.json",
- "test": "jest",
- "test:watch": "jest --watch"
- },
- "sideEffects": false,
- "types": "dist/index.d.ts",
- "version": "5.14.1"
-}
diff --git a/node_modules/@sentry/browser/LICENSE b/node_modules/@sentry/browser/LICENSE
deleted file mode 100644
index 8b42db8..0000000
--- a/node_modules/@sentry/browser/LICENSE
+++ /dev/null
@@ -1,29 +0,0 @@
-BSD 3-Clause License
-
-Copyright (c) 2019, Sentry
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
-* Neither the name of the copyright holder nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/node_modules/@sentry/browser/README.md b/node_modules/@sentry/browser/README.md
deleted file mode 100644
index 486505c..0000000
--- a/node_modules/@sentry/browser/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-# Official Sentry SDK for Browsers
-
-[](https://saucelabs.com/u/sentryio)
-[](https://www.npmjs.com/package/@sentry/browser)
-[](https://www.npmjs.com/package/@sentry/browser)
-[](https://www.npmjs.com/package/@sentry/browser)
-[](http://getsentry.github.io/sentry-javascript/)
-
-## Links
-
-- [Official SDK Docs](https://docs.sentry.io/quickstart/)
-- [TypeDoc](http://getsentry.github.io/sentry-javascript/)
-
-## Usage
-
-To use this SDK, call `Sentry.init(options)` as early as possible after loading the page. This will initialize the SDK
-and hook into the environment. Note that you can turn off almost all side effects using the respective options.
-
-```javascript
-import * as Sentry from '@sentry/browser';
-
-Sentry.init({
- dsn: '__DSN__',
- // ...
-});
-```
-
-To set context information or send manual events, use the exported functions of `@sentry/browser`. Note that these
-functions will not perform any action before you have called `Sentry.init()`:
-
-```javascript
-import * as Sentry from '@sentry/browser';
-
-// Set user information, as well as tags and further extras
-Sentry.configureScope(scope => {
- scope.setExtra('battery', 0.7);
- scope.setTag('user_mode', 'admin');
- scope.setUser({ id: '4711' });
- // scope.clear();
-});
-
-// Add a breadcrumb for future events
-Sentry.addBreadcrumb({
- message: 'My Breadcrumb',
- // ...
-});
-
-// Capture exceptions, messages or manual events
-Sentry.captureMessage('Hello, world!');
-Sentry.captureException(new Error('Good bye'));
-Sentry.captureEvent({
- message: 'Manual',
- stacktrace: [
- // ...
- ],
-});
-```
diff --git a/node_modules/@sentry/browser/build/bundle.es6.js b/node_modules/@sentry/browser/build/bundle.es6.js
deleted file mode 100644
index dae079d..0000000
--- a/node_modules/@sentry/browser/build/bundle.es6.js
+++ /dev/null
@@ -1,5298 +0,0 @@
-var Sentry = (function (exports) {
- /** Console logging verbosity for the SDK. */
- var LogLevel;
- (function (LogLevel) {
- /** No logs will be generated. */
- LogLevel[LogLevel["None"] = 0] = "None";
- /** Only SDK internal errors will be logged. */
- LogLevel[LogLevel["Error"] = 1] = "Error";
- /** Information useful for debugging the SDK will be logged. */
- LogLevel[LogLevel["Debug"] = 2] = "Debug";
- /** All SDK actions will be logged. */
- LogLevel[LogLevel["Verbose"] = 3] = "Verbose";
- })(LogLevel || (LogLevel = {}));
-
- /** JSDoc */
- (function (Severity) {
- /** JSDoc */
- Severity["Fatal"] = "fatal";
- /** JSDoc */
- Severity["Error"] = "error";
- /** JSDoc */
- Severity["Warning"] = "warning";
- /** JSDoc */
- Severity["Log"] = "log";
- /** JSDoc */
- Severity["Info"] = "info";
- /** JSDoc */
- Severity["Debug"] = "debug";
- /** JSDoc */
- Severity["Critical"] = "critical";
- })(exports.Severity || (exports.Severity = {}));
- // tslint:disable:completed-docs
- // tslint:disable:no-unnecessary-qualifier no-namespace
- (function (Severity) {
- /**
- * Converts a string-based level into a {@link Severity}.
- *
- * @param level string representation of Severity
- * @returns Severity
- */
- function fromString(level) {
- switch (level) {
- case 'debug':
- return Severity.Debug;
- case 'info':
- return Severity.Info;
- case 'warn':
- case 'warning':
- return Severity.Warning;
- case 'error':
- return Severity.Error;
- case 'fatal':
- return Severity.Fatal;
- case 'critical':
- return Severity.Critical;
- case 'log':
- default:
- return Severity.Log;
- }
- }
- Severity.fromString = fromString;
- })(exports.Severity || (exports.Severity = {}));
-
- /** The status of an Span. */
- var SpanStatus;
- (function (SpanStatus) {
- /** The operation completed successfully. */
- SpanStatus["Ok"] = "ok";
- /** Deadline expired before operation could complete. */
- SpanStatus["DeadlineExceeded"] = "deadline_exceeded";
- /** 401 Unauthorized (actually does mean unauthenticated according to RFC 7235) */
- SpanStatus["Unauthenticated"] = "unauthenticated";
- /** 403 Forbidden */
- SpanStatus["PermissionDenied"] = "permission_denied";
- /** 404 Not Found. Some requested entity (file or directory) was not found. */
- SpanStatus["NotFound"] = "not_found";
- /** 429 Too Many Requests */
- SpanStatus["ResourceExhausted"] = "resource_exhausted";
- /** Client specified an invalid argument. 4xx. */
- SpanStatus["InvalidArgument"] = "invalid_argument";
- /** 501 Not Implemented */
- SpanStatus["Unimplemented"] = "unimplemented";
- /** 503 Service Unavailable */
- SpanStatus["Unavailable"] = "unavailable";
- /** Other/generic 5xx. */
- SpanStatus["InternalError"] = "internal_error";
- /** Unknown. Any non-standard HTTP status code. */
- SpanStatus["UnknownError"] = "unknown_error";
- /** The operation was cancelled (typically by the user). */
- SpanStatus["Cancelled"] = "cancelled";
- /** Already exists (409) */
- SpanStatus["AlreadyExists"] = "already_exists";
- /** Operation was rejected because the system is not in a state required for the operation's */
- SpanStatus["FailedPrecondition"] = "failed_precondition";
- /** The operation was aborted, typically due to a concurrency issue. */
- SpanStatus["Aborted"] = "aborted";
- /** Operation was attempted past the valid range. */
- SpanStatus["OutOfRange"] = "out_of_range";
- /** Unrecoverable data loss or corruption */
- SpanStatus["DataLoss"] = "data_loss";
- })(SpanStatus || (SpanStatus = {}));
- // tslint:disable:no-unnecessary-qualifier no-namespace
- (function (SpanStatus) {
- /**
- * Converts a HTTP status code into a {@link SpanStatus}.
- *
- * @param httpStatus The HTTP response status code.
- * @returns The span status or {@link SpanStatus.UnknownError}.
- */
- // tslint:disable-next-line:completed-docs
- function fromHttpCode(httpStatus) {
- if (httpStatus < 400) {
- return SpanStatus.Ok;
- }
- if (httpStatus >= 400 && httpStatus < 500) {
- switch (httpStatus) {
- case 401:
- return SpanStatus.Unauthenticated;
- case 403:
- return SpanStatus.PermissionDenied;
- case 404:
- return SpanStatus.NotFound;
- case 409:
- return SpanStatus.AlreadyExists;
- case 413:
- return SpanStatus.FailedPrecondition;
- case 429:
- return SpanStatus.ResourceExhausted;
- default:
- return SpanStatus.InvalidArgument;
- }
- }
- if (httpStatus >= 500 && httpStatus < 600) {
- switch (httpStatus) {
- case 501:
- return SpanStatus.Unimplemented;
- case 503:
- return SpanStatus.Unavailable;
- case 504:
- return SpanStatus.DeadlineExceeded;
- default:
- return SpanStatus.InternalError;
- }
- }
- return SpanStatus.UnknownError;
- }
- SpanStatus.fromHttpCode = fromHttpCode;
- })(SpanStatus || (SpanStatus = {}));
-
- /** The status of an event. */
- (function (Status) {
- /** The status could not be determined. */
- Status["Unknown"] = "unknown";
- /** The event was skipped due to configuration or callbacks. */
- Status["Skipped"] = "skipped";
- /** The event was sent to Sentry successfully. */
- Status["Success"] = "success";
- /** The client is currently rate limited and will try again later. */
- Status["RateLimit"] = "rate_limit";
- /** The event could not be processed. */
- Status["Invalid"] = "invalid";
- /** A server-side error ocurred during submission. */
- Status["Failed"] = "failed";
- })(exports.Status || (exports.Status = {}));
- // tslint:disable:completed-docs
- // tslint:disable:no-unnecessary-qualifier no-namespace
- (function (Status) {
- /**
- * Converts a HTTP status code into a {@link Status}.
- *
- * @param code The HTTP response status code.
- * @returns The send status or {@link Status.Unknown}.
- */
- function fromHttpCode(code) {
- if (code >= 200 && code < 300) {
- return Status.Success;
- }
- if (code === 429) {
- return Status.RateLimit;
- }
- if (code >= 400 && code < 500) {
- return Status.Invalid;
- }
- if (code >= 500) {
- return Status.Failed;
- }
- return Status.Unknown;
- }
- Status.fromHttpCode = fromHttpCode;
- })(exports.Status || (exports.Status = {}));
-
- /**
- * Consumes the promise and logs the error when it rejects.
- * @param promise A promise to forget.
- */
-
- const setPrototypeOf = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties); // tslint:disable-line:no-unbound-method
- /**
- * setPrototypeOf polyfill using __proto__
- */
- function setProtoOf(obj, proto) {
- // @ts-ignore
- obj.__proto__ = proto;
- return obj;
- }
- /**
- * setPrototypeOf polyfill using mixin
- */
- function mixinProperties(obj, proto) {
- for (const prop in proto) {
- if (!obj.hasOwnProperty(prop)) {
- // @ts-ignore
- obj[prop] = proto[prop];
- }
- }
- return obj;
- }
-
- /** An error emitted by Sentry SDKs and related utilities. */
- class SentryError extends Error {
- constructor(message) {
- super(message);
- this.message = message;
- // tslint:disable:no-unsafe-any
- this.name = new.target.prototype.constructor.name;
- setPrototypeOf(this, new.target.prototype);
- }
- }
-
- /**
- * Checks whether given value's type is one of a few Error or Error-like
- * {@link isError}.
- *
- * @param wat A value to be checked.
- * @returns A boolean representing the result.
- */
- function isError(wat) {
- switch (Object.prototype.toString.call(wat)) {
- case '[object Error]':
- return true;
- case '[object Exception]':
- return true;
- case '[object DOMException]':
- return true;
- default:
- return isInstanceOf(wat, Error);
- }
- }
- /**
- * Checks whether given value's type is ErrorEvent
- * {@link isErrorEvent}.
- *
- * @param wat A value to be checked.
- * @returns A boolean representing the result.
- */
- function isErrorEvent(wat) {
- return Object.prototype.toString.call(wat) === '[object ErrorEvent]';
- }
- /**
- * Checks whether given value's type is DOMError
- * {@link isDOMError}.
- *
- * @param wat A value to be checked.
- * @returns A boolean representing the result.
- */
- function isDOMError(wat) {
- return Object.prototype.toString.call(wat) === '[object DOMError]';
- }
- /**
- * Checks whether given value's type is DOMException
- * {@link isDOMException}.
- *
- * @param wat A value to be checked.
- * @returns A boolean representing the result.
- */
- function isDOMException(wat) {
- return Object.prototype.toString.call(wat) === '[object DOMException]';
- }
- /**
- * Checks whether given value's type is a string
- * {@link isString}.
- *
- * @param wat A value to be checked.
- * @returns A boolean representing the result.
- */
- function isString(wat) {
- return Object.prototype.toString.call(wat) === '[object String]';
- }
- /**
- * Checks whether given value's is a primitive (undefined, null, number, boolean, string)
- * {@link isPrimitive}.
- *
- * @param wat A value to be checked.
- * @returns A boolean representing the result.
- */
- function isPrimitive(wat) {
- return wat === null || (typeof wat !== 'object' && typeof wat !== 'function');
- }
- /**
- * Checks whether given value's type is an object literal
- * {@link isPlainObject}.
- *
- * @param wat A value to be checked.
- * @returns A boolean representing the result.
- */
- function isPlainObject(wat) {
- return Object.prototype.toString.call(wat) === '[object Object]';
- }
- /**
- * Checks whether given value's type is an Event instance
- * {@link isEvent}.
- *
- * @param wat A value to be checked.
- * @returns A boolean representing the result.
- */
- function isEvent(wat) {
- // tslint:disable-next-line:strict-type-predicates
- return typeof Event !== 'undefined' && isInstanceOf(wat, Event);
- }
- /**
- * Checks whether given value's type is an Element instance
- * {@link isElement}.
- *
- * @param wat A value to be checked.
- * @returns A boolean representing the result.
- */
- function isElement(wat) {
- // tslint:disable-next-line:strict-type-predicates
- return typeof Element !== 'undefined' && isInstanceOf(wat, Element);
- }
- /**
- * Checks whether given value's type is an regexp
- * {@link isRegExp}.
- *
- * @param wat A value to be checked.
- * @returns A boolean representing the result.
- */
- function isRegExp(wat) {
- return Object.prototype.toString.call(wat) === '[object RegExp]';
- }
- /**
- * Checks whether given value has a then function.
- * @param wat A value to be checked.
- */
- function isThenable(wat) {
- // tslint:disable:no-unsafe-any
- return Boolean(wat && wat.then && typeof wat.then === 'function');
- // tslint:enable:no-unsafe-any
- }
- /**
- * Checks whether given value's type is a SyntheticEvent
- * {@link isSyntheticEvent}.
- *
- * @param wat A value to be checked.
- * @returns A boolean representing the result.
- */
- function isSyntheticEvent(wat) {
- // tslint:disable-next-line:no-unsafe-any
- return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;
- }
- /**
- * Checks whether given value's type is an instance of provided constructor.
- * {@link isInstanceOf}.
- *
- * @param wat A value to be checked.
- * @param base A constructor to be used in a check.
- * @returns A boolean representing the result.
- */
- function isInstanceOf(wat, base) {
- try {
- // tslint:disable-next-line:no-unsafe-any
- return wat instanceof base;
- }
- catch (_e) {
- return false;
- }
- }
-
- /**
- * Truncates given string to the maximum characters count
- *
- * @param str An object that contains serializable values
- * @param max Maximum number of characters in truncated string
- * @returns string Encoded
- */
- function truncate(str, max = 0) {
- // tslint:disable-next-line:strict-type-predicates
- if (typeof str !== 'string' || max === 0) {
- return str;
- }
- return str.length <= max ? str : `${str.substr(0, max)}...`;
- }
- /**
- * Join values in array
- * @param input array of values to be joined together
- * @param delimiter string to be placed in-between values
- * @returns Joined values
- */
- function safeJoin(input, delimiter) {
- if (!Array.isArray(input)) {
- return '';
- }
- const output = [];
- // tslint:disable-next-line:prefer-for-of
- for (let i = 0; i < input.length; i++) {
- const value = input[i];
- try {
- output.push(String(value));
- }
- catch (e) {
- output.push('[value cannot be serialized]');
- }
- }
- return output.join(delimiter);
- }
- /**
- * Checks if the value matches a regex or includes the string
- * @param value The string value to be checked against
- * @param pattern Either a regex or a string that must be contained in value
- */
- function isMatchingPattern(value, pattern) {
- if (isRegExp(pattern)) {
- return pattern.test(value);
- }
- if (typeof pattern === 'string') {
- return value.indexOf(pattern) !== -1;
- }
- return false;
- }
-
- /**
- * Requires a module which is protected _against bundler minification.
- *
- * @param request The module path to resolve
- */
- function dynamicRequire(mod, request) {
- // tslint:disable-next-line: no-unsafe-any
- return mod.require(request);
- }
- /**
- * Checks whether we're in the Node.js or Browser environment
- *
- * @returns Answer to given question
- */
- function isNodeEnv() {
- // tslint:disable:strict-type-predicates
- return Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]';
- }
- const fallbackGlobalObject = {};
- /**
- * Safely get global scope object
- *
- * @returns Global scope object
- */
- function getGlobalObject() {
- return (isNodeEnv()
- ? global
- : typeof window !== 'undefined'
- ? window
- : typeof self !== 'undefined'
- ? self
- : fallbackGlobalObject);
- }
- /**
- * UUID4 generator
- *
- * @returns string Generated UUID4.
- */
- function uuid4() {
- const global = getGlobalObject();
- const crypto = global.crypto || global.msCrypto;
- if (!(crypto === void 0) && crypto.getRandomValues) {
- // Use window.crypto API if available
- const arr = new Uint16Array(8);
- crypto.getRandomValues(arr);
- // set 4 in byte 7
- // tslint:disable-next-line:no-bitwise
- arr[3] = (arr[3] & 0xfff) | 0x4000;
- // set 2 most significant bits of byte 9 to '10'
- // tslint:disable-next-line:no-bitwise
- arr[4] = (arr[4] & 0x3fff) | 0x8000;
- const pad = (num) => {
- let v = num.toString(16);
- while (v.length < 4) {
- v = `0${v}`;
- }
- return v;
- };
- return (pad(arr[0]) + pad(arr[1]) + pad(arr[2]) + pad(arr[3]) + pad(arr[4]) + pad(arr[5]) + pad(arr[6]) + pad(arr[7]));
- }
- // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523
- return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, c => {
- // tslint:disable-next-line:no-bitwise
- const r = (Math.random() * 16) | 0;
- // tslint:disable-next-line:no-bitwise
- const v = c === 'x' ? r : (r & 0x3) | 0x8;
- return v.toString(16);
- });
- }
- /**
- * Parses string form of URL into an object
- * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B
- * // intentionally using regex and not href parsing trick because React Native and other
- * // environments where DOM might not be available
- * @returns parsed URL object
- */
- function parseUrl(url) {
- if (!url) {
- return {};
- }
- const match = url.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);
- if (!match) {
- return {};
- }
- // coerce to undefined values to empty string so we don't get 'undefined'
- const query = match[6] || '';
- const fragment = match[8] || '';
- return {
- host: match[4],
- path: match[5],
- protocol: match[2],
- relative: match[5] + query + fragment,
- };
- }
- /**
- * Extracts either message or type+value from an event that can be used for user-facing logs
- * @returns event's description
- */
- function getEventDescription(event) {
- if (event.message) {
- return event.message;
- }
- if (event.exception && event.exception.values && event.exception.values[0]) {
- const exception = event.exception.values[0];
- if (exception.type && exception.value) {
- return `${exception.type}: ${exception.value}`;
- }
- return exception.type || exception.value || event.event_id || '';
- }
- return event.event_id || '';
- }
- /** JSDoc */
- function consoleSandbox(callback) {
- const global = getGlobalObject();
- const levels = ['debug', 'info', 'warn', 'error', 'log', 'assert'];
- if (!('console' in global)) {
- return callback();
- }
- const originalConsole = global.console;
- const wrappedLevels = {};
- // Restore all wrapped console methods
- levels.forEach(level => {
- if (level in global.console && originalConsole[level].__sentry_original__) {
- wrappedLevels[level] = originalConsole[level];
- originalConsole[level] = originalConsole[level].__sentry_original__;
- }
- });
- // Perform callback manipulations
- const result = callback();
- // Revert restoration to wrapped state
- Object.keys(wrappedLevels).forEach(level => {
- originalConsole[level] = wrappedLevels[level];
- });
- return result;
- }
- /**
- * Adds exception values, type and value to an synthetic Exception.
- * @param event The event to modify.
- * @param value Value of the exception.
- * @param type Type of the exception.
- * @hidden
- */
- function addExceptionTypeValue(event, value, type) {
- event.exception = event.exception || {};
- event.exception.values = event.exception.values || [];
- event.exception.values[0] = event.exception.values[0] || {};
- event.exception.values[0].value = event.exception.values[0].value || value || '';
- event.exception.values[0].type = event.exception.values[0].type || type || 'Error';
- }
- /**
- * Adds exception mechanism to a given event.
- * @param event The event to modify.
- * @param mechanism Mechanism of the mechanism.
- * @hidden
- */
- function addExceptionMechanism(event, mechanism = {}) {
- // TODO: Use real type with `keyof Mechanism` thingy and maybe make it better?
- try {
- // @ts-ignore
- // tslint:disable:no-non-null-assertion
- event.exception.values[0].mechanism = event.exception.values[0].mechanism || {};
- Object.keys(mechanism).forEach(key => {
- // @ts-ignore
- event.exception.values[0].mechanism[key] = mechanism[key];
- });
- }
- catch (_oO) {
- // no-empty
- }
- }
- /**
- * A safe form of location.href
- */
- function getLocationHref() {
- try {
- return document.location.href;
- }
- catch (oO) {
- return '';
- }
- }
- /**
- * Given a child DOM element, returns a query-selector statement describing that
- * and its ancestors
- * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]
- * @returns generated DOM path
- */
- function htmlTreeAsString(elem) {
- // try/catch both:
- // - accessing event.target (see getsentry/raven-js#838, #768)
- // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly
- // - can throw an exception in some circumstances.
- try {
- let currentElem = elem;
- const MAX_TRAVERSE_HEIGHT = 5;
- const MAX_OUTPUT_LEN = 80;
- const out = [];
- let height = 0;
- let len = 0;
- const separator = ' > ';
- const sepLength = separator.length;
- let nextStr;
- while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {
- nextStr = _htmlElementAsString(currentElem);
- // bail out if
- // - nextStr is the 'html' element
- // - the length of the string that would be created exceeds MAX_OUTPUT_LEN
- // (ignore this limit if we are on the first iteration)
- if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)) {
- break;
- }
- out.push(nextStr);
- len += nextStr.length;
- currentElem = currentElem.parentNode;
- }
- return out.reverse().join(separator);
- }
- catch (_oO) {
- return '';
- }
- }
- /**
- * Returns a simple, query-selector representation of a DOM element
- * e.g. [HTMLElement] => input#foo.btn[name=baz]
- * @returns generated DOM path
- */
- function _htmlElementAsString(el) {
- const elem = el;
- const out = [];
- let className;
- let classes;
- let key;
- let attr;
- let i;
- if (!elem || !elem.tagName) {
- return '';
- }
- out.push(elem.tagName.toLowerCase());
- if (elem.id) {
- out.push(`#${elem.id}`);
- }
- className = elem.className;
- if (className && isString(className)) {
- classes = className.split(/\s+/);
- for (i = 0; i < classes.length; i++) {
- out.push(`.${classes[i]}`);
- }
- }
- const attrWhitelist = ['type', 'name', 'title', 'alt'];
- for (i = 0; i < attrWhitelist.length; i++) {
- key = attrWhitelist[i];
- attr = elem.getAttribute(key);
- if (attr) {
- out.push(`[${key}="${attr}"]`);
- }
- }
- return out.join('');
- }
- const INITIAL_TIME = Date.now();
- let prevNow = 0;
- const performanceFallback = {
- now() {
- let now = Date.now() - INITIAL_TIME;
- if (now < prevNow) {
- now = prevNow;
- }
- prevNow = now;
- return now;
- },
- timeOrigin: INITIAL_TIME,
- };
- const crossPlatformPerformance = (() => {
- if (isNodeEnv()) {
- try {
- const perfHooks = dynamicRequire(module, 'perf_hooks');
- return perfHooks.performance;
- }
- catch (_) {
- return performanceFallback;
- }
- }
- if (getGlobalObject().performance) {
- // Polyfill for performance.timeOrigin.
- //
- // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin
- // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing.
- // tslint:disable-next-line:strict-type-predicates
- if (performance.timeOrigin === undefined) {
- // For webworkers it could mean we don't have performance.timing then we fallback
- // tslint:disable-next-line:deprecation
- if (!performance.timing) {
- return performanceFallback;
- }
- // tslint:disable-next-line:deprecation
- if (!performance.timing.navigationStart) {
- return performanceFallback;
- }
- // @ts-ignore
- // tslint:disable-next-line:deprecation
- performance.timeOrigin = performance.timing.navigationStart;
- }
- }
- return getGlobalObject().performance || performanceFallback;
- })();
- /**
- * Returns a timestamp in seconds with milliseconds precision since the UNIX epoch calculated with the monotonic clock.
- */
- function timestampWithMs() {
- return (crossPlatformPerformance.timeOrigin + crossPlatformPerformance.now()) / 1000;
- }
- const defaultRetryAfter = 60 * 1000; // 60 seconds
- /**
- * Extracts Retry-After value from the request header or returns default value
- * @param now current unix timestamp
- * @param header string representation of 'Retry-After' header
- */
- function parseRetryAfterHeader(now, header) {
- if (!header) {
- return defaultRetryAfter;
- }
- const headerDelay = parseInt(`${header}`, 10);
- if (!isNaN(headerDelay)) {
- return headerDelay * 1000;
- }
- const headerDate = Date.parse(`${header}`);
- if (!isNaN(headerDate)) {
- return headerDate - now;
- }
- return defaultRetryAfter;
- }
- const defaultFunctionName = '';
- /**
- * Safely extract function name from itself
- */
- function getFunctionName(fn) {
- try {
- if (!fn || typeof fn !== 'function') {
- return defaultFunctionName;
- }
- return fn.name || defaultFunctionName;
- }
- catch (e) {
- // Just accessing custom props in some Selenium environments
- // can cause a "Permission denied" exception (see raven-js#495).
- return defaultFunctionName;
- }
- }
-
- // TODO: Implement different loggers for different environments
- const global$1 = getGlobalObject();
- /** Prefix for logging strings */
- const PREFIX = 'Sentry Logger ';
- /** JSDoc */
- class Logger {
- /** JSDoc */
- constructor() {
- this._enabled = false;
- }
- /** JSDoc */
- disable() {
- this._enabled = false;
- }
- /** JSDoc */
- enable() {
- this._enabled = true;
- }
- /** JSDoc */
- log(...args) {
- if (!this._enabled) {
- return;
- }
- consoleSandbox(() => {
- global$1.console.log(`${PREFIX}[Log]: ${args.join(' ')}`); // tslint:disable-line:no-console
- });
- }
- /** JSDoc */
- warn(...args) {
- if (!this._enabled) {
- return;
- }
- consoleSandbox(() => {
- global$1.console.warn(`${PREFIX}[Warn]: ${args.join(' ')}`); // tslint:disable-line:no-console
- });
- }
- /** JSDoc */
- error(...args) {
- if (!this._enabled) {
- return;
- }
- consoleSandbox(() => {
- global$1.console.error(`${PREFIX}[Error]: ${args.join(' ')}`); // tslint:disable-line:no-console
- });
- }
- }
- // Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used
- global$1.__SENTRY__ = global$1.__SENTRY__ || {};
- const logger = global$1.__SENTRY__.logger || (global$1.__SENTRY__.logger = new Logger());
-
- // tslint:disable:no-unsafe-any
- /**
- * Memo class used for decycle json objects. Uses WeakSet if available otherwise array.
- */
- class Memo {
- constructor() {
- // tslint:disable-next-line
- this._hasWeakSet = typeof WeakSet === 'function';
- this._inner = this._hasWeakSet ? new WeakSet() : [];
- }
- /**
- * Sets obj to remember.
- * @param obj Object to remember
- */
- memoize(obj) {
- if (this._hasWeakSet) {
- if (this._inner.has(obj)) {
- return true;
- }
- this._inner.add(obj);
- return false;
- }
- // tslint:disable-next-line:prefer-for-of
- for (let i = 0; i < this._inner.length; i++) {
- const value = this._inner[i];
- if (value === obj) {
- return true;
- }
- }
- this._inner.push(obj);
- return false;
- }
- /**
- * Removes object from internal storage.
- * @param obj Object to forget
- */
- unmemoize(obj) {
- if (this._hasWeakSet) {
- this._inner.delete(obj);
- }
- else {
- for (let i = 0; i < this._inner.length; i++) {
- if (this._inner[i] === obj) {
- this._inner.splice(i, 1);
- break;
- }
- }
- }
- }
- }
-
- /**
- * Wrap a given object method with a higher-order function
- *
- * @param source An object that contains a method to be wrapped.
- * @param name A name of method to be wrapped.
- * @param replacement A function that should be used to wrap a given method.
- * @returns void
- */
- function fill(source, name, replacement) {
- if (!(name in source)) {
- return;
- }
- const original = source[name];
- const wrapped = replacement(original);
- // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work
- // otherwise it'll throw "TypeError: Object.defineProperties called on non-object"
- // tslint:disable-next-line:strict-type-predicates
- if (typeof wrapped === 'function') {
- try {
- wrapped.prototype = wrapped.prototype || {};
- Object.defineProperties(wrapped, {
- __sentry_original__: {
- enumerable: false,
- value: original,
- },
- });
- }
- catch (_Oo) {
- // This can throw if multiple fill happens on a global object like XMLHttpRequest
- // Fixes https://github.com/getsentry/sentry-javascript/issues/2043
- }
- }
- source[name] = wrapped;
- }
- /**
- * Encodes given object into url-friendly format
- *
- * @param object An object that contains serializable values
- * @returns string Encoded
- */
- function urlEncode(object) {
- return Object.keys(object)
- .map(
- // tslint:disable-next-line:no-unsafe-any
- key => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`)
- .join('&');
- }
- /**
- * Transforms any object into an object literal with all it's attributes
- * attached to it.
- *
- * @param value Initial source that we have to transform in order to be usable by the serializer
- */
- function getWalkSource(value) {
- if (isError(value)) {
- const error = value;
- const err = {
- message: error.message,
- name: error.name,
- stack: error.stack,
- };
- for (const i in error) {
- if (Object.prototype.hasOwnProperty.call(error, i)) {
- err[i] = error[i];
- }
- }
- return err;
- }
- if (isEvent(value)) {
- const event = value;
- const source = {};
- source.type = event.type;
- // Accessing event.target can throw (see getsentry/raven-js#838, #768)
- try {
- source.target = isElement(event.target)
- ? htmlTreeAsString(event.target)
- : Object.prototype.toString.call(event.target);
- }
- catch (_oO) {
- source.target = '';
- }
- try {
- source.currentTarget = isElement(event.currentTarget)
- ? htmlTreeAsString(event.currentTarget)
- : Object.prototype.toString.call(event.currentTarget);
- }
- catch (_oO) {
- source.currentTarget = '';
- }
- // tslint:disable-next-line:strict-type-predicates
- if (typeof CustomEvent !== 'undefined' && isInstanceOf(value, CustomEvent)) {
- source.detail = event.detail;
- }
- for (const i in event) {
- if (Object.prototype.hasOwnProperty.call(event, i)) {
- source[i] = event;
- }
- }
- return source;
- }
- return value;
- }
- /** Calculates bytes size of input string */
- function utf8Length(value) {
- // tslint:disable-next-line:no-bitwise
- return ~-encodeURI(value).split(/%..|./).length;
- }
- /** Calculates bytes size of input object */
- function jsonSize(value) {
- return utf8Length(JSON.stringify(value));
- }
- /** JSDoc */
- function normalizeToSize(object,
- // Default Node.js REPL depth
- depth = 3,
- // 100kB, as 200kB is max payload size, so half sounds reasonable
- maxSize = 100 * 1024) {
- const serialized = normalize(object, depth);
- if (jsonSize(serialized) > maxSize) {
- return normalizeToSize(object, depth - 1, maxSize);
- }
- return serialized;
- }
- /** Transforms any input value into a string form, either primitive value or a type of the input */
- function serializeValue(value) {
- const type = Object.prototype.toString.call(value);
- // Node.js REPL notation
- if (typeof value === 'string') {
- return value;
- }
- if (type === '[object Object]') {
- return '[Object]';
- }
- if (type === '[object Array]') {
- return '[Array]';
- }
- const normalized = normalizeValue(value);
- return isPrimitive(normalized) ? normalized : type;
- }
- /**
- * normalizeValue()
- *
- * Takes unserializable input and make it serializable friendly
- *
- * - translates undefined/NaN values to "[undefined]"/"[NaN]" respectively,
- * - serializes Error objects
- * - filter global objects
- */
- // tslint:disable-next-line:cyclomatic-complexity
- function normalizeValue(value, key) {
- if (key === 'domain' && value && typeof value === 'object' && value._events) {
- return '[Domain]';
- }
- if (key === 'domainEmitter') {
- return '[DomainEmitter]';
- }
- if (typeof global !== 'undefined' && value === global) {
- return '[Global]';
- }
- if (typeof window !== 'undefined' && value === window) {
- return '[Window]';
- }
- if (typeof document !== 'undefined' && value === document) {
- return '[Document]';
- }
- // React's SyntheticEvent thingy
- if (isSyntheticEvent(value)) {
- return '[SyntheticEvent]';
- }
- // tslint:disable-next-line:no-tautology-expression
- if (typeof value === 'number' && value !== value) {
- return '[NaN]';
- }
- if (value === void 0) {
- return '[undefined]';
- }
- if (typeof value === 'function') {
- return `[Function: ${getFunctionName(value)}]`;
- }
- return value;
- }
- /**
- * Walks an object to perform a normalization on it
- *
- * @param key of object that's walked in current iteration
- * @param value object to be walked
- * @param depth Optional number indicating how deep should walking be performed
- * @param memo Optional Memo class handling decycling
- */
- function walk(key, value, depth = +Infinity, memo = new Memo()) {
- // If we reach the maximum depth, serialize whatever has left
- if (depth === 0) {
- return serializeValue(value);
- }
- // If value implements `toJSON` method, call it and return early
- // tslint:disable:no-unsafe-any
- if (value !== null && value !== undefined && typeof value.toJSON === 'function') {
- return value.toJSON();
- }
- // tslint:enable:no-unsafe-any
- // If normalized value is a primitive, there are no branches left to walk, so we can just bail out, as theres no point in going down that branch any further
- const normalized = normalizeValue(value, key);
- if (isPrimitive(normalized)) {
- return normalized;
- }
- // Create source that we will use for next itterations, either objectified error object (Error type with extracted keys:value pairs) or the input itself
- const source = getWalkSource(value);
- // Create an accumulator that will act as a parent for all future itterations of that branch
- const acc = Array.isArray(value) ? [] : {};
- // If we already walked that branch, bail out, as it's circular reference
- if (memo.memoize(value)) {
- return '[Circular ~]';
- }
- // Walk all keys of the source
- for (const innerKey in source) {
- // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration.
- if (!Object.prototype.hasOwnProperty.call(source, innerKey)) {
- continue;
- }
- // Recursively walk through all the child nodes
- acc[innerKey] = walk(innerKey, source[innerKey], depth - 1, memo);
- }
- // Once walked through all the branches, remove the parent from memo storage
- memo.unmemoize(value);
- // Return accumulated values
- return acc;
- }
- /**
- * normalize()
- *
- * - Creates a copy to prevent original input mutation
- * - Skip non-enumerablers
- * - Calls `toJSON` if implemented
- * - Removes circular references
- * - Translates non-serializeable values (undefined/NaN/Functions) to serializable format
- * - Translates known global objects/Classes to a string representations
- * - Takes care of Error objects serialization
- * - Optionally limit depth of final output
- */
- function normalize(input, depth) {
- try {
- // tslint:disable-next-line:no-unsafe-any
- return JSON.parse(JSON.stringify(input, (key, value) => walk(key, value, depth)));
- }
- catch (_oO) {
- return '**non-serializable**';
- }
- }
- /**
- * Given any captured exception, extract its keys and create a sorted
- * and truncated list that will be used inside the event message.
- * eg. `Non-error exception captured with keys: foo, bar, baz`
- */
- function extractExceptionKeysForMessage(exception, maxLength = 40) {
- // tslint:disable:strict-type-predicates
- const keys = Object.keys(getWalkSource(exception));
- keys.sort();
- if (!keys.length) {
- return '[object has no keys]';
- }
- if (keys[0].length >= maxLength) {
- return truncate(keys[0], maxLength);
- }
- for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) {
- const serialized = keys.slice(0, includedKeys).join(', ');
- if (serialized.length > maxLength) {
- continue;
- }
- if (includedKeys === keys.length) {
- return serialized;
- }
- return truncate(serialized, maxLength);
- }
- return '';
- }
-
- // Slightly modified (no IE8 support, ES6) and transcribed to TypeScript
-
- /** SyncPromise internal states */
- var States;
- (function (States) {
- /** Pending */
- States["PENDING"] = "PENDING";
- /** Resolved / OK */
- States["RESOLVED"] = "RESOLVED";
- /** Rejected / Error */
- States["REJECTED"] = "REJECTED";
- })(States || (States = {}));
- /**
- * Thenable class that behaves like a Promise and follows it's interface
- * but is not async internally
- */
- class SyncPromise {
- constructor(executor) {
- this._state = States.PENDING;
- this._handlers = [];
- /** JSDoc */
- this._resolve = (value) => {
- this._setResult(States.RESOLVED, value);
- };
- /** JSDoc */
- this._reject = (reason) => {
- this._setResult(States.REJECTED, reason);
- };
- /** JSDoc */
- this._setResult = (state, value) => {
- if (this._state !== States.PENDING) {
- return;
- }
- if (isThenable(value)) {
- value.then(this._resolve, this._reject);
- return;
- }
- this._state = state;
- this._value = value;
- this._executeHandlers();
- };
- // TODO: FIXME
- /** JSDoc */
- this._attachHandler = (handler) => {
- this._handlers = this._handlers.concat(handler);
- this._executeHandlers();
- };
- /** JSDoc */
- this._executeHandlers = () => {
- if (this._state === States.PENDING) {
- return;
- }
- if (this._state === States.REJECTED) {
- this._handlers.forEach(handler => {
- if (handler.onrejected) {
- handler.onrejected(this._value);
- }
- });
- }
- else {
- this._handlers.forEach(handler => {
- if (handler.onfulfilled) {
- // tslint:disable-next-line:no-unsafe-any
- handler.onfulfilled(this._value);
- }
- });
- }
- this._handlers = [];
- };
- try {
- executor(this._resolve, this._reject);
- }
- catch (e) {
- this._reject(e);
- }
- }
- /** JSDoc */
- toString() {
- return '[object SyncPromise]';
- }
- /** JSDoc */
- static resolve(value) {
- return new SyncPromise(resolve => {
- resolve(value);
- });
- }
- /** JSDoc */
- static reject(reason) {
- return new SyncPromise((_, reject) => {
- reject(reason);
- });
- }
- /** JSDoc */
- static all(collection) {
- return new SyncPromise((resolve, reject) => {
- if (!Array.isArray(collection)) {
- reject(new TypeError(`Promise.all requires an array as input.`));
- return;
- }
- if (collection.length === 0) {
- resolve([]);
- return;
- }
- let counter = collection.length;
- const resolvedCollection = [];
- collection.forEach((item, index) => {
- SyncPromise.resolve(item)
- .then(value => {
- resolvedCollection[index] = value;
- counter -= 1;
- if (counter !== 0) {
- return;
- }
- resolve(resolvedCollection);
- })
- .then(null, reject);
- });
- });
- }
- /** JSDoc */
- then(onfulfilled, onrejected) {
- return new SyncPromise((resolve, reject) => {
- this._attachHandler({
- onfulfilled: result => {
- if (!onfulfilled) {
- // TODO: ¯\_(ツ)_/¯
- // TODO: FIXME
- resolve(result);
- return;
- }
- try {
- resolve(onfulfilled(result));
- return;
- }
- catch (e) {
- reject(e);
- return;
- }
- },
- onrejected: reason => {
- if (!onrejected) {
- reject(reason);
- return;
- }
- try {
- resolve(onrejected(reason));
- return;
- }
- catch (e) {
- reject(e);
- return;
- }
- },
- });
- });
- }
- /** JSDoc */
- catch(onrejected) {
- return this.then(val => val, onrejected);
- }
- /** JSDoc */
- finally(onfinally) {
- return new SyncPromise((resolve, reject) => {
- let val;
- let isRejected;
- return this.then(value => {
- isRejected = false;
- val = value;
- if (onfinally) {
- onfinally();
- }
- }, reason => {
- isRejected = true;
- val = reason;
- if (onfinally) {
- onfinally();
- }
- }).then(() => {
- if (isRejected) {
- reject(val);
- return;
- }
- // tslint:disable-next-line:no-unsafe-any
- resolve(val);
- });
- });
- }
- }
-
- /** A simple queue that holds promises. */
- class PromiseBuffer {
- constructor(_limit) {
- this._limit = _limit;
- /** Internal set of queued Promises */
- this._buffer = [];
- }
- /**
- * Says if the buffer is ready to take more requests
- */
- isReady() {
- return this._limit === undefined || this.length() < this._limit;
- }
- /**
- * Add a promise to the queue.
- *
- * @param task Can be any PromiseLike
- * @returns The original promise.
- */
- add(task) {
- if (!this.isReady()) {
- return SyncPromise.reject(new SentryError('Not adding Promise due to buffer limit reached.'));
- }
- if (this._buffer.indexOf(task) === -1) {
- this._buffer.push(task);
- }
- task
- .then(() => this.remove(task))
- .then(null, () => this.remove(task).then(null, () => {
- // We have to add this catch here otherwise we have an unhandledPromiseRejection
- // because it's a new Promise chain.
- }));
- return task;
- }
- /**
- * Remove a promise to the queue.
- *
- * @param task Can be any PromiseLike
- * @returns Removed promise.
- */
- remove(task) {
- const removedTask = this._buffer.splice(this._buffer.indexOf(task), 1)[0];
- return removedTask;
- }
- /**
- * This function returns the number of unresolved promises in the queue.
- */
- length() {
- return this._buffer.length;
- }
- /**
- * This will drain the whole queue, returns true if queue is empty or drained.
- * If timeout is provided and the queue takes longer to drain, the promise still resolves but with false.
- *
- * @param timeout Number in ms to wait until it resolves with false.
- */
- drain(timeout) {
- return new SyncPromise(resolve => {
- const capturedSetTimeout = setTimeout(() => {
- if (timeout && timeout > 0) {
- resolve(false);
- }
- }, timeout);
- SyncPromise.all(this._buffer)
- .then(() => {
- clearTimeout(capturedSetTimeout);
- resolve(true);
- })
- .then(null, () => {
- resolve(true);
- });
- });
- }
- }
-
- /**
- * Tells whether current environment supports Fetch API
- * {@link supportsFetch}.
- *
- * @returns Answer to the given question.
- */
- function supportsFetch() {
- if (!('fetch' in getGlobalObject())) {
- return false;
- }
- try {
- // tslint:disable-next-line:no-unused-expression
- new Headers();
- // tslint:disable-next-line:no-unused-expression
- new Request('');
- // tslint:disable-next-line:no-unused-expression
- new Response();
- return true;
- }
- catch (e) {
- return false;
- }
- }
- /**
- * isNativeFetch checks if the given function is a native implementation of fetch()
- */
- function isNativeFetch(func) {
- return func && /^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(func.toString());
- }
- /**
- * Tells whether current environment supports Fetch API natively
- * {@link supportsNativeFetch}.
- *
- * @returns true if `window.fetch` is natively implemented, false otherwise
- */
- function supportsNativeFetch() {
- if (!supportsFetch()) {
- return false;
- }
- const global = getGlobalObject();
- // Fast path to avoid DOM I/O
- // tslint:disable-next-line:no-unbound-method
- if (isNativeFetch(global.fetch)) {
- return true;
- }
- // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension)
- // so create a "pure" iframe to see if that has native fetch
- let result = false;
- const doc = global.document;
- if (doc) {
- try {
- const sandbox = doc.createElement('iframe');
- sandbox.hidden = true;
- doc.head.appendChild(sandbox);
- if (sandbox.contentWindow && sandbox.contentWindow.fetch) {
- // tslint:disable-next-line:no-unbound-method
- result = isNativeFetch(sandbox.contentWindow.fetch);
- }
- doc.head.removeChild(sandbox);
- }
- catch (err) {
- logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err);
- }
- }
- return result;
- }
- /**
- * Tells whether current environment supports Referrer Policy API
- * {@link supportsReferrerPolicy}.
- *
- * @returns Answer to the given question.
- */
- function supportsReferrerPolicy() {
- // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default
- // https://caniuse.com/#feat=referrer-policy
- // It doesn't. And it throw exception instead of ignoring this parameter...
- // REF: https://github.com/getsentry/raven-js/issues/1233
- if (!supportsFetch()) {
- return false;
- }
- try {
- // tslint:disable:no-unused-expression
- new Request('_', {
- referrerPolicy: 'origin',
- });
- return true;
- }
- catch (e) {
- return false;
- }
- }
- /**
- * Tells whether current environment supports History API
- * {@link supportsHistory}.
- *
- * @returns Answer to the given question.
- */
- function supportsHistory() {
- // NOTE: in Chrome App environment, touching history.pushState, *even inside
- // a try/catch block*, will cause Chrome to output an error to console.error
- // borrowed from: https://github.com/angular/angular.js/pull/13945/files
- const global = getGlobalObject();
- const chrome = global.chrome;
- // tslint:disable-next-line:no-unsafe-any
- const isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;
- const hasHistoryApi = 'history' in global && !!global.history.pushState && !!global.history.replaceState;
- return !isChromePackagedApp && hasHistoryApi;
- }
-
- /* tslint:disable:only-arrow-functions no-unsafe-any */
- const global$2 = getGlobalObject();
- /**
- * Instrument native APIs to call handlers that can be used to create breadcrumbs, APM spans etc.
- * - Console API
- * - Fetch API
- * - XHR API
- * - History API
- * - DOM API (click/typing)
- * - Error API
- * - UnhandledRejection API
- */
- const handlers = {};
- const instrumented = {};
- /** Instruments given API */
- function instrument(type) {
- if (instrumented[type]) {
- return;
- }
- instrumented[type] = true;
- switch (type) {
- case 'console':
- instrumentConsole();
- break;
- case 'dom':
- instrumentDOM();
- break;
- case 'xhr':
- instrumentXHR();
- break;
- case 'fetch':
- instrumentFetch();
- break;
- case 'history':
- instrumentHistory();
- break;
- case 'error':
- instrumentError();
- break;
- case 'unhandledrejection':
- instrumentUnhandledRejection();
- break;
- default:
- logger.warn('unknown instrumentation type:', type);
- }
- }
- /**
- * Add handler that will be called when given type of instrumentation triggers.
- * Use at your own risk, this might break without changelog notice, only used internally.
- * @hidden
- */
- function addInstrumentationHandler(handler) {
- // tslint:disable-next-line:strict-type-predicates
- if (!handler || typeof handler.type !== 'string' || typeof handler.callback !== 'function') {
- return;
- }
- handlers[handler.type] = handlers[handler.type] || [];
- handlers[handler.type].push(handler.callback);
- instrument(handler.type);
- }
- /** JSDoc */
- function triggerHandlers(type, data) {
- if (!type || !handlers[type]) {
- return;
- }
- for (const handler of handlers[type] || []) {
- try {
- handler(data);
- }
- catch (e) {
- logger.error(`Error while triggering instrumentation handler.\nType: ${type}\nName: ${getFunctionName(handler)}\nError: ${e}`);
- }
- }
- }
- /** JSDoc */
- function instrumentConsole() {
- if (!('console' in global$2)) {
- return;
- }
- ['debug', 'info', 'warn', 'error', 'log', 'assert'].forEach(function (level) {
- if (!(level in global$2.console)) {
- return;
- }
- fill(global$2.console, level, function (originalConsoleLevel) {
- return function (...args) {
- triggerHandlers('console', { args, level });
- // this fails for some browsers. :(
- if (originalConsoleLevel) {
- Function.prototype.apply.call(originalConsoleLevel, global$2.console, args);
- }
- };
- });
- });
- }
- /** JSDoc */
- function instrumentFetch() {
- if (!supportsNativeFetch()) {
- return;
- }
- fill(global$2, 'fetch', function (originalFetch) {
- return function (...args) {
- const commonHandlerData = {
- args,
- fetchData: {
- method: getFetchMethod(args),
- url: getFetchUrl(args),
- },
- startTimestamp: Date.now(),
- };
- triggerHandlers('fetch', Object.assign({}, commonHandlerData));
- return originalFetch.apply(global$2, args).then((response) => {
- triggerHandlers('fetch', Object.assign({}, commonHandlerData, { endTimestamp: Date.now(), response }));
- return response;
- }, (error) => {
- triggerHandlers('fetch', Object.assign({}, commonHandlerData, { endTimestamp: Date.now(), error }));
- throw error;
- });
- };
- });
- }
- /** Extract `method` from fetch call arguments */
- function getFetchMethod(fetchArgs = []) {
- if ('Request' in global$2 && isInstanceOf(fetchArgs[0], Request) && fetchArgs[0].method) {
- return String(fetchArgs[0].method).toUpperCase();
- }
- if (fetchArgs[1] && fetchArgs[1].method) {
- return String(fetchArgs[1].method).toUpperCase();
- }
- return 'GET';
- }
- /** Extract `url` from fetch call arguments */
- function getFetchUrl(fetchArgs = []) {
- if (typeof fetchArgs[0] === 'string') {
- return fetchArgs[0];
- }
- if ('Request' in global$2 && isInstanceOf(fetchArgs[0], Request)) {
- return fetchArgs[0].url;
- }
- return String(fetchArgs[0]);
- }
- /** JSDoc */
- function instrumentXHR() {
- if (!('XMLHttpRequest' in global$2)) {
- return;
- }
- const xhrproto = XMLHttpRequest.prototype;
- fill(xhrproto, 'open', function (originalOpen) {
- return function (...args) {
- const url = args[1];
- this.__sentry_xhr__ = {
- method: isString(args[0]) ? args[0].toUpperCase() : args[0],
- url: args[1],
- };
- // if Sentry key appears in URL, don't capture it as a request
- if (isString(url) && this.__sentry_xhr__.method === 'POST' && url.match(/sentry_key/)) {
- this.__sentry_own_request__ = true;
- }
- return originalOpen.apply(this, args);
- };
- });
- fill(xhrproto, 'send', function (originalSend) {
- return function (...args) {
- const xhr = this; // tslint:disable-line:no-this-assignment
- const commonHandlerData = {
- args,
- startTimestamp: Date.now(),
- xhr,
- };
- triggerHandlers('xhr', Object.assign({}, commonHandlerData));
- xhr.addEventListener('readystatechange', function () {
- if (xhr.readyState === 4) {
- try {
- // touching statusCode in some platforms throws
- // an exception
- if (xhr.__sentry_xhr__) {
- xhr.__sentry_xhr__.status_code = xhr.status;
- }
- }
- catch (e) {
- /* do nothing */
- }
- triggerHandlers('xhr', Object.assign({}, commonHandlerData, { endTimestamp: Date.now() }));
- }
- });
- return originalSend.apply(this, args);
- };
- });
- }
- let lastHref;
- /** JSDoc */
- function instrumentHistory() {
- if (!supportsHistory()) {
- return;
- }
- const oldOnPopState = global$2.onpopstate;
- global$2.onpopstate = function (...args) {
- const to = global$2.location.href;
- // keep track of the current URL state, as we always receive only the updated state
- const from = lastHref;
- lastHref = to;
- triggerHandlers('history', {
- from,
- to,
- });
- if (oldOnPopState) {
- return oldOnPopState.apply(this, args);
- }
- };
- /** @hidden */
- function historyReplacementFunction(originalHistoryFunction) {
- return function (...args) {
- const url = args.length > 2 ? args[2] : undefined;
- if (url) {
- // coerce to string (this is what pushState does)
- const from = lastHref;
- const to = String(url);
- // keep track of the current URL state, as we always receive only the updated state
- lastHref = to;
- triggerHandlers('history', {
- from,
- to,
- });
- }
- return originalHistoryFunction.apply(this, args);
- };
- }
- fill(global$2.history, 'pushState', historyReplacementFunction);
- fill(global$2.history, 'replaceState', historyReplacementFunction);
- }
- /** JSDoc */
- function instrumentDOM() {
- if (!('document' in global$2)) {
- return;
- }
- // Capture breadcrumbs from any click that is unhandled / bubbled up all the way
- // to the document. Do this before we instrument addEventListener.
- global$2.document.addEventListener('click', domEventHandler('click', triggerHandlers.bind(null, 'dom')), false);
- global$2.document.addEventListener('keypress', keypressEventHandler(triggerHandlers.bind(null, 'dom')), false);
- // After hooking into document bubbled up click and keypresses events, we also hook into user handled click & keypresses.
- ['EventTarget', 'Node'].forEach((target) => {
- const proto = global$2[target] && global$2[target].prototype;
- if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {
- return;
- }
- fill(proto, 'addEventListener', function (original) {
- return function (eventName, fn, options) {
- if (fn && fn.handleEvent) {
- if (eventName === 'click') {
- fill(fn, 'handleEvent', function (innerOriginal) {
- return function (event) {
- domEventHandler('click', triggerHandlers.bind(null, 'dom'))(event);
- return innerOriginal.call(this, event);
- };
- });
- }
- if (eventName === 'keypress') {
- fill(fn, 'handleEvent', function (innerOriginal) {
- return function (event) {
- keypressEventHandler(triggerHandlers.bind(null, 'dom'))(event);
- return innerOriginal.call(this, event);
- };
- });
- }
- }
- else {
- if (eventName === 'click') {
- domEventHandler('click', triggerHandlers.bind(null, 'dom'), true)(this);
- }
- if (eventName === 'keypress') {
- keypressEventHandler(triggerHandlers.bind(null, 'dom'))(this);
- }
- }
- return original.call(this, eventName, fn, options);
- };
- });
- fill(proto, 'removeEventListener', function (original) {
- return function (eventName, fn, options) {
- let callback = fn;
- try {
- callback = callback && (callback.__sentry_wrapped__ || callback);
- }
- catch (e) {
- // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments
- }
- return original.call(this, eventName, callback, options);
- };
- });
- });
- }
- const debounceDuration = 1000;
- let debounceTimer = 0;
- let keypressTimeout;
- let lastCapturedEvent;
- /**
- * Wraps addEventListener to capture UI breadcrumbs
- * @param name the event name (e.g. "click")
- * @param handler function that will be triggered
- * @param debounce decides whether it should wait till another event loop
- * @returns wrapped breadcrumb events handler
- * @hidden
- */
- function domEventHandler(name, handler, debounce = false) {
- return (event) => {
- // reset keypress timeout; e.g. triggering a 'click' after
- // a 'keypress' will reset the keypress debounce so that a new
- // set of keypresses can be recorded
- keypressTimeout = undefined;
- // It's possible this handler might trigger multiple times for the same
- // event (e.g. event propagation through node ancestors). Ignore if we've
- // already captured the event.
- if (!event || lastCapturedEvent === event) {
- return;
- }
- lastCapturedEvent = event;
- if (debounceTimer) {
- clearTimeout(debounceTimer);
- }
- if (debounce) {
- debounceTimer = setTimeout(() => {
- handler({ event, name });
- });
- }
- else {
- handler({ event, name });
- }
- };
- }
- /**
- * Wraps addEventListener to capture keypress UI events
- * @param handler function that will be triggered
- * @returns wrapped keypress events handler
- * @hidden
- */
- function keypressEventHandler(handler) {
- // TODO: if somehow user switches keypress target before
- // debounce timeout is triggered, we will only capture
- // a single breadcrumb from the FIRST target (acceptable?)
- return (event) => {
- let target;
- try {
- target = event.target;
- }
- catch (e) {
- // just accessing event properties can throw an exception in some rare circumstances
- // see: https://github.com/getsentry/raven-js/issues/838
- return;
- }
- const tagName = target && target.tagName;
- // only consider keypress events on actual input elements
- // this will disregard keypresses targeting body (e.g. tabbing
- // through elements, hotkeys, etc)
- if (!tagName || (tagName !== 'INPUT' && tagName !== 'TEXTAREA' && !target.isContentEditable)) {
- return;
- }
- // record first keypress in a series, but ignore subsequent
- // keypresses until debounce clears
- if (!keypressTimeout) {
- domEventHandler('input', handler)(event);
- }
- clearTimeout(keypressTimeout);
- keypressTimeout = setTimeout(() => {
- keypressTimeout = undefined;
- }, debounceDuration);
- };
- }
- let _oldOnErrorHandler = null;
- /** JSDoc */
- function instrumentError() {
- _oldOnErrorHandler = global$2.onerror;
- global$2.onerror = function (msg, url, line, column, error) {
- triggerHandlers('error', {
- column,
- error,
- line,
- msg,
- url,
- });
- if (_oldOnErrorHandler) {
- return _oldOnErrorHandler.apply(this, arguments);
- }
- return false;
- };
- }
- let _oldOnUnhandledRejectionHandler = null;
- /** JSDoc */
- function instrumentUnhandledRejection() {
- _oldOnUnhandledRejectionHandler = global$2.onunhandledrejection;
- global$2.onunhandledrejection = function (e) {
- triggerHandlers('unhandledrejection', e);
- if (_oldOnUnhandledRejectionHandler) {
- return _oldOnUnhandledRejectionHandler.apply(this, arguments);
- }
- return true;
- };
- }
-
- /** Regular expression used to parse a Dsn. */
- const DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w\.-]+)(?::(\d+))?\/(.+)/;
- /** Error message */
- const ERROR_MESSAGE = 'Invalid Dsn';
- /** The Sentry Dsn, identifying a Sentry instance and project. */
- class Dsn {
- /** Creates a new Dsn component */
- constructor(from) {
- if (typeof from === 'string') {
- this._fromString(from);
- }
- else {
- this._fromComponents(from);
- }
- this._validate();
- }
- /**
- * Renders the string representation of this Dsn.
- *
- * By default, this will render the public representation without the password
- * component. To get the deprecated private _representation, set `withPassword`
- * to true.
- *
- * @param withPassword When set to true, the password will be included.
- */
- toString(withPassword = false) {
- // tslint:disable-next-line:no-this-assignment
- const { host, path, pass, port, projectId, protocol, user } = this;
- return (`${protocol}://${user}${withPassword && pass ? `:${pass}` : ''}` +
- `@${host}${port ? `:${port}` : ''}/${path ? `${path}/` : path}${projectId}`);
- }
- /** Parses a string into this Dsn. */
- _fromString(str) {
- const match = DSN_REGEX.exec(str);
- if (!match) {
- throw new SentryError(ERROR_MESSAGE);
- }
- const [protocol, user, pass = '', host, port = '', lastPath] = match.slice(1);
- let path = '';
- let projectId = lastPath;
- const split = projectId.split('/');
- if (split.length > 1) {
- path = split.slice(0, -1).join('/');
- projectId = split.pop();
- }
- this._fromComponents({ host, pass, path, projectId, port, protocol: protocol, user });
- }
- /** Maps Dsn components into this instance. */
- _fromComponents(components) {
- this.protocol = components.protocol;
- this.user = components.user;
- this.pass = components.pass || '';
- this.host = components.host;
- this.port = components.port || '';
- this.path = components.path || '';
- this.projectId = components.projectId;
- }
- /** Validates this Dsn and throws on error. */
- _validate() {
- ['protocol', 'user', 'host', 'projectId'].forEach(component => {
- if (!this[component]) {
- throw new SentryError(ERROR_MESSAGE);
- }
- });
- if (this.protocol !== 'http' && this.protocol !== 'https') {
- throw new SentryError(ERROR_MESSAGE);
- }
- if (this.port && isNaN(parseInt(this.port, 10))) {
- throw new SentryError(ERROR_MESSAGE);
- }
- }
- }
-
- /**
- * Holds additional event information. {@link Scope.applyToEvent} will be
- * called by the client before an event will be sent.
- */
- class Scope {
- constructor() {
- /** Flag if notifiying is happening. */
- this._notifyingListeners = false;
- /** Callback for client to receive scope changes. */
- this._scopeListeners = [];
- /** Callback list that will be called after {@link applyToEvent}. */
- this._eventProcessors = [];
- /** Array of breadcrumbs. */
- this._breadcrumbs = [];
- /** User */
- this._user = {};
- /** Tags */
- this._tags = {};
- /** Extra */
- this._extra = {};
- /** Contexts */
- this._context = {};
- }
- /**
- * Add internal on change listener. Used for sub SDKs that need to store the scope.
- * @hidden
- */
- addScopeListener(callback) {
- this._scopeListeners.push(callback);
- }
- /**
- * @inheritDoc
- */
- addEventProcessor(callback) {
- this._eventProcessors.push(callback);
- return this;
- }
- /**
- * This will be called on every set call.
- */
- _notifyScopeListeners() {
- if (!this._notifyingListeners) {
- this._notifyingListeners = true;
- setTimeout(() => {
- this._scopeListeners.forEach(callback => {
- callback(this);
- });
- this._notifyingListeners = false;
- });
- }
- }
- /**
- * This will be called after {@link applyToEvent} is finished.
- */
- _notifyEventProcessors(processors, event, hint, index = 0) {
- return new SyncPromise((resolve, reject) => {
- const processor = processors[index];
- // tslint:disable-next-line:strict-type-predicates
- if (event === null || typeof processor !== 'function') {
- resolve(event);
- }
- else {
- const result = processor(Object.assign({}, event), hint);
- if (isThenable(result)) {
- result
- .then(final => this._notifyEventProcessors(processors, final, hint, index + 1).then(resolve))
- .then(null, reject);
- }
- else {
- this._notifyEventProcessors(processors, result, hint, index + 1)
- .then(resolve)
- .then(null, reject);
- }
- }
- });
- }
- /**
- * @inheritDoc
- */
- setUser(user) {
- this._user = user || {};
- this._notifyScopeListeners();
- return this;
- }
- /**
- * @inheritDoc
- */
- setTags(tags) {
- this._tags = Object.assign({}, this._tags, tags);
- this._notifyScopeListeners();
- return this;
- }
- /**
- * @inheritDoc
- */
- setTag(key, value) {
- this._tags = Object.assign({}, this._tags, { [key]: value });
- this._notifyScopeListeners();
- return this;
- }
- /**
- * @inheritDoc
- */
- setExtras(extras) {
- this._extra = Object.assign({}, this._extra, extras);
- this._notifyScopeListeners();
- return this;
- }
- /**
- * @inheritDoc
- */
- setExtra(key, extra) {
- this._extra = Object.assign({}, this._extra, { [key]: extra });
- this._notifyScopeListeners();
- return this;
- }
- /**
- * @inheritDoc
- */
- setFingerprint(fingerprint) {
- this._fingerprint = fingerprint;
- this._notifyScopeListeners();
- return this;
- }
- /**
- * @inheritDoc
- */
- setLevel(level) {
- this._level = level;
- this._notifyScopeListeners();
- return this;
- }
- /**
- * @inheritDoc
- */
- setTransaction(transaction) {
- this._transaction = transaction;
- if (this._span) {
- this._span.transaction = transaction;
- }
- this._notifyScopeListeners();
- return this;
- }
- /**
- * @inheritDoc
- */
- setContext(key, context) {
- this._context = Object.assign({}, this._context, { [key]: context });
- this._notifyScopeListeners();
- return this;
- }
- /**
- * @inheritDoc
- */
- setSpan(span) {
- this._span = span;
- this._notifyScopeListeners();
- return this;
- }
- /**
- * Internal getter for Span, used in Hub.
- * @hidden
- */
- getSpan() {
- return this._span;
- }
- /**
- * Inherit values from the parent scope.
- * @param scope to clone.
- */
- static clone(scope) {
- const newScope = new Scope();
- if (scope) {
- newScope._breadcrumbs = [...scope._breadcrumbs];
- newScope._tags = Object.assign({}, scope._tags);
- newScope._extra = Object.assign({}, scope._extra);
- newScope._context = Object.assign({}, scope._context);
- newScope._user = scope._user;
- newScope._level = scope._level;
- newScope._span = scope._span;
- newScope._transaction = scope._transaction;
- newScope._fingerprint = scope._fingerprint;
- newScope._eventProcessors = [...scope._eventProcessors];
- }
- return newScope;
- }
- /**
- * @inheritDoc
- */
- clear() {
- this._breadcrumbs = [];
- this._tags = {};
- this._extra = {};
- this._user = {};
- this._context = {};
- this._level = undefined;
- this._transaction = undefined;
- this._fingerprint = undefined;
- this._span = undefined;
- this._notifyScopeListeners();
- return this;
- }
- /**
- * @inheritDoc
- */
- addBreadcrumb(breadcrumb, maxBreadcrumbs) {
- const mergedBreadcrumb = Object.assign({ timestamp: timestampWithMs() }, breadcrumb);
- this._breadcrumbs =
- maxBreadcrumbs !== undefined && maxBreadcrumbs >= 0
- ? [...this._breadcrumbs, mergedBreadcrumb].slice(-maxBreadcrumbs)
- : [...this._breadcrumbs, mergedBreadcrumb];
- this._notifyScopeListeners();
- return this;
- }
- /**
- * @inheritDoc
- */
- clearBreadcrumbs() {
- this._breadcrumbs = [];
- this._notifyScopeListeners();
- return this;
- }
- /**
- * Applies fingerprint from the scope to the event if there's one,
- * uses message if there's one instead or get rid of empty fingerprint
- */
- _applyFingerprint(event) {
- // Make sure it's an array first and we actually have something in place
- event.fingerprint = event.fingerprint
- ? Array.isArray(event.fingerprint)
- ? event.fingerprint
- : [event.fingerprint]
- : [];
- // If we have something on the scope, then merge it with event
- if (this._fingerprint) {
- event.fingerprint = event.fingerprint.concat(this._fingerprint);
- }
- // If we have no data at all, remove empty array default
- if (event.fingerprint && !event.fingerprint.length) {
- delete event.fingerprint;
- }
- }
- /**
- * Applies the current context and fingerprint to the event.
- * Note that breadcrumbs will be added by the client.
- * Also if the event has already breadcrumbs on it, we do not merge them.
- * @param event Event
- * @param hint May contain additional informartion about the original exception.
- * @hidden
- */
- applyToEvent(event, hint) {
- if (this._extra && Object.keys(this._extra).length) {
- event.extra = Object.assign({}, this._extra, event.extra);
- }
- if (this._tags && Object.keys(this._tags).length) {
- event.tags = Object.assign({}, this._tags, event.tags);
- }
- if (this._user && Object.keys(this._user).length) {
- event.user = Object.assign({}, this._user, event.user);
- }
- if (this._context && Object.keys(this._context).length) {
- event.contexts = Object.assign({}, this._context, event.contexts);
- }
- if (this._level) {
- event.level = this._level;
- }
- if (this._transaction) {
- event.transaction = this._transaction;
- }
- if (this._span) {
- event.contexts = Object.assign({ trace: this._span.getTraceContext() }, event.contexts);
- }
- this._applyFingerprint(event);
- event.breadcrumbs = [...(event.breadcrumbs || []), ...this._breadcrumbs];
- event.breadcrumbs = event.breadcrumbs.length > 0 ? event.breadcrumbs : undefined;
- return this._notifyEventProcessors([...getGlobalEventProcessors(), ...this._eventProcessors], event, hint);
- }
- }
- /**
- * Retruns the global event processors.
- */
- function getGlobalEventProcessors() {
- const global = getGlobalObject();
- global.__SENTRY__ = global.__SENTRY__ || {};
- global.__SENTRY__.globalEventProcessors = global.__SENTRY__.globalEventProcessors || [];
- return global.__SENTRY__.globalEventProcessors;
- }
- /**
- * Add a EventProcessor to be kept globally.
- * @param callback EventProcessor to add
- */
- function addGlobalEventProcessor(callback) {
- getGlobalEventProcessors().push(callback);
- }
-
- /**
- * API compatibility version of this hub.
- *
- * WARNING: This number should only be incresed when the global interface
- * changes a and new methods are introduced.
- *
- * @hidden
- */
- const API_VERSION = 3;
- /**
- * Default maximum number of breadcrumbs added to an event. Can be overwritten
- * with {@link Options.maxBreadcrumbs}.
- */
- const DEFAULT_BREADCRUMBS = 100;
- /**
- * Absolute maximum number of breadcrumbs added to an event. The
- * `maxBreadcrumbs` option cannot be higher than this value.
- */
- const MAX_BREADCRUMBS = 100;
- /**
- * @inheritDoc
- */
- class Hub {
- /**
- * Creates a new instance of the hub, will push one {@link Layer} into the
- * internal stack on creation.
- *
- * @param client bound to the hub.
- * @param scope bound to the hub.
- * @param version number, higher number means higher priority.
- */
- constructor(client, scope = new Scope(), _version = API_VERSION) {
- this._version = _version;
- /** Is a {@link Layer}[] containing the client and scope */
- this._stack = [];
- this._stack.push({ client, scope });
- }
- /**
- * Internal helper function to call a method on the top client if it exists.
- *
- * @param method The method to call on the client.
- * @param args Arguments to pass to the client function.
- */
- _invokeClient(method, ...args) {
- const top = this.getStackTop();
- if (top && top.client && top.client[method]) {
- top.client[method](...args, top.scope);
- }
- }
- /**
- * @inheritDoc
- */
- isOlderThan(version) {
- return this._version < version;
- }
- /**
- * @inheritDoc
- */
- bindClient(client) {
- const top = this.getStackTop();
- top.client = client;
- }
- /**
- * @inheritDoc
- */
- pushScope() {
- // We want to clone the content of prev scope
- const stack = this.getStack();
- const parentScope = stack.length > 0 ? stack[stack.length - 1].scope : undefined;
- const scope = Scope.clone(parentScope);
- this.getStack().push({
- client: this.getClient(),
- scope,
- });
- return scope;
- }
- /**
- * @inheritDoc
- */
- popScope() {
- return this.getStack().pop() !== undefined;
- }
- /**
- * @inheritDoc
- */
- withScope(callback) {
- const scope = this.pushScope();
- try {
- callback(scope);
- }
- finally {
- this.popScope();
- }
- }
- /**
- * @inheritDoc
- */
- getClient() {
- return this.getStackTop().client;
- }
- /** Returns the scope of the top stack. */
- getScope() {
- return this.getStackTop().scope;
- }
- /** Returns the scope stack for domains or the process. */
- getStack() {
- return this._stack;
- }
- /** Returns the topmost scope layer in the order domain > local > process. */
- getStackTop() {
- return this._stack[this._stack.length - 1];
- }
- /**
- * @inheritDoc
- */
- captureException(exception, hint) {
- const eventId = (this._lastEventId = uuid4());
- let finalHint = hint;
- // If there's no explicit hint provided, mimick the same thing that would happen
- // in the minimal itself to create a consistent behavior.
- // We don't do this in the client, as it's the lowest level API, and doing this,
- // would prevent user from having full control over direct calls.
- if (!hint) {
- let syntheticException;
- try {
- throw new Error('Sentry syntheticException');
- }
- catch (exception) {
- syntheticException = exception;
- }
- finalHint = {
- originalException: exception,
- syntheticException,
- };
- }
- this._invokeClient('captureException', exception, Object.assign({}, finalHint, { event_id: eventId }));
- return eventId;
- }
- /**
- * @inheritDoc
- */
- captureMessage(message, level, hint) {
- const eventId = (this._lastEventId = uuid4());
- let finalHint = hint;
- // If there's no explicit hint provided, mimick the same thing that would happen
- // in the minimal itself to create a consistent behavior.
- // We don't do this in the client, as it's the lowest level API, and doing this,
- // would prevent user from having full control over direct calls.
- if (!hint) {
- let syntheticException;
- try {
- throw new Error(message);
- }
- catch (exception) {
- syntheticException = exception;
- }
- finalHint = {
- originalException: message,
- syntheticException,
- };
- }
- this._invokeClient('captureMessage', message, level, Object.assign({}, finalHint, { event_id: eventId }));
- return eventId;
- }
- /**
- * @inheritDoc
- */
- captureEvent(event, hint) {
- const eventId = (this._lastEventId = uuid4());
- this._invokeClient('captureEvent', event, Object.assign({}, hint, { event_id: eventId }));
- return eventId;
- }
- /**
- * @inheritDoc
- */
- lastEventId() {
- return this._lastEventId;
- }
- /**
- * @inheritDoc
- */
- addBreadcrumb(breadcrumb, hint) {
- const top = this.getStackTop();
- if (!top.scope || !top.client) {
- return;
- }
- const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } = (top.client.getOptions && top.client.getOptions()) || {};
- if (maxBreadcrumbs <= 0) {
- return;
- }
- const timestamp = timestampWithMs();
- const mergedBreadcrumb = Object.assign({ timestamp }, breadcrumb);
- const finalBreadcrumb = beforeBreadcrumb
- ? consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint))
- : mergedBreadcrumb;
- if (finalBreadcrumb === null) {
- return;
- }
- top.scope.addBreadcrumb(finalBreadcrumb, Math.min(maxBreadcrumbs, MAX_BREADCRUMBS));
- }
- /**
- * @inheritDoc
- */
- setUser(user) {
- const top = this.getStackTop();
- if (!top.scope) {
- return;
- }
- top.scope.setUser(user);
- }
- /**
- * @inheritDoc
- */
- setTags(tags) {
- const top = this.getStackTop();
- if (!top.scope) {
- return;
- }
- top.scope.setTags(tags);
- }
- /**
- * @inheritDoc
- */
- setExtras(extras) {
- const top = this.getStackTop();
- if (!top.scope) {
- return;
- }
- top.scope.setExtras(extras);
- }
- /**
- * @inheritDoc
- */
- setTag(key, value) {
- const top = this.getStackTop();
- if (!top.scope) {
- return;
- }
- top.scope.setTag(key, value);
- }
- /**
- * @inheritDoc
- */
- setExtra(key, extra) {
- const top = this.getStackTop();
- if (!top.scope) {
- return;
- }
- top.scope.setExtra(key, extra);
- }
- /**
- * @inheritDoc
- */
- setContext(name, context) {
- const top = this.getStackTop();
- if (!top.scope) {
- return;
- }
- top.scope.setContext(name, context);
- }
- /**
- * @inheritDoc
- */
- configureScope(callback) {
- const top = this.getStackTop();
- if (top.scope && top.client) {
- callback(top.scope);
- }
- }
- /**
- * @inheritDoc
- */
- run(callback) {
- const oldHub = makeMain(this);
- try {
- callback(this);
- }
- finally {
- makeMain(oldHub);
- }
- }
- /**
- * @inheritDoc
- */
- getIntegration(integration) {
- const client = this.getClient();
- if (!client) {
- return null;
- }
- try {
- return client.getIntegration(integration);
- }
- catch (_oO) {
- logger.warn(`Cannot retrieve integration ${integration.id} from the current Hub`);
- return null;
- }
- }
- /**
- * @inheritDoc
- */
- startSpan(spanOrSpanContext, forceNoChild = false) {
- return this._callExtensionMethod('startSpan', spanOrSpanContext, forceNoChild);
- }
- /**
- * @inheritDoc
- */
- traceHeaders() {
- return this._callExtensionMethod('traceHeaders');
- }
- /**
- * Calls global extension method and binding current instance to the function call
- */
- // @ts-ignore
- _callExtensionMethod(method, ...args) {
- const carrier = getMainCarrier();
- const sentry = carrier.__SENTRY__;
- // tslint:disable-next-line: strict-type-predicates
- if (sentry && sentry.extensions && typeof sentry.extensions[method] === 'function') {
- return sentry.extensions[method].apply(this, args);
- }
- logger.warn(`Extension method ${method} couldn't be found, doing nothing.`);
- }
- }
- /** Returns the global shim registry. */
- function getMainCarrier() {
- const carrier = getGlobalObject();
- carrier.__SENTRY__ = carrier.__SENTRY__ || {
- extensions: {},
- hub: undefined,
- };
- return carrier;
- }
- /**
- * Replaces the current main hub with the passed one on the global object
- *
- * @returns The old replaced hub
- */
- function makeMain(hub) {
- const registry = getMainCarrier();
- const oldHub = getHubFromCarrier(registry);
- setHubOnCarrier(registry, hub);
- return oldHub;
- }
- /**
- * Returns the default hub instance.
- *
- * If a hub is already registered in the global carrier but this module
- * contains a more recent version, it replaces the registered version.
- * Otherwise, the currently registered hub will be returned.
- */
- function getCurrentHub() {
- // Get main carrier (global for every environment)
- const registry = getMainCarrier();
- // If there's no hub, or its an old API, assign a new one
- if (!hasHubOnCarrier(registry) || getHubFromCarrier(registry).isOlderThan(API_VERSION)) {
- setHubOnCarrier(registry, new Hub());
- }
- // Prefer domains over global if they are there (applicable only to Node environment)
- if (isNodeEnv()) {
- return getHubFromActiveDomain(registry);
- }
- // Return hub that lives on a global object
- return getHubFromCarrier(registry);
- }
- /**
- * Try to read the hub from an active domain, fallback to the registry if one doesnt exist
- * @returns discovered hub
- */
- function getHubFromActiveDomain(registry) {
- try {
- // We need to use `dynamicRequire` because `require` on it's own will be optimized by webpack.
- // We do not want this to happen, we need to try to `require` the domain node module and fail if we are in browser
- // for example so we do not have to shim it and use `getCurrentHub` universally.
- const domain = dynamicRequire(module, 'domain');
- const activeDomain = domain.active;
- // If there no active domain, just return global hub
- if (!activeDomain) {
- return getHubFromCarrier(registry);
- }
- // If there's no hub on current domain, or its an old API, assign a new one
- if (!hasHubOnCarrier(activeDomain) || getHubFromCarrier(activeDomain).isOlderThan(API_VERSION)) {
- const registryHubTopStack = getHubFromCarrier(registry).getStackTop();
- setHubOnCarrier(activeDomain, new Hub(registryHubTopStack.client, Scope.clone(registryHubTopStack.scope)));
- }
- // Return hub that lives on a domain
- return getHubFromCarrier(activeDomain);
- }
- catch (_Oo) {
- // Return hub that lives on a global object
- return getHubFromCarrier(registry);
- }
- }
- /**
- * This will tell whether a carrier has a hub on it or not
- * @param carrier object
- */
- function hasHubOnCarrier(carrier) {
- if (carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub) {
- return true;
- }
- return false;
- }
- /**
- * This will create a new {@link Hub} and add to the passed object on
- * __SENTRY__.hub.
- * @param carrier object
- * @hidden
- */
- function getHubFromCarrier(carrier) {
- if (carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub) {
- return carrier.__SENTRY__.hub;
- }
- carrier.__SENTRY__ = carrier.__SENTRY__ || {};
- carrier.__SENTRY__.hub = new Hub();
- return carrier.__SENTRY__.hub;
- }
- /**
- * This will set passed {@link Hub} on the passed object's __SENTRY__.hub attribute
- * @param carrier object
- * @param hub Hub
- */
- function setHubOnCarrier(carrier, hub) {
- if (!carrier) {
- return false;
- }
- carrier.__SENTRY__ = carrier.__SENTRY__ || {};
- carrier.__SENTRY__.hub = hub;
- return true;
- }
-
- /**
- * This calls a function on the current hub.
- * @param method function to call on hub.
- * @param args to pass to function.
- */
- function callOnHub(method, ...args) {
- const hub = getCurrentHub();
- if (hub && hub[method]) {
- // tslint:disable-next-line:no-unsafe-any
- return hub[method](...args);
- }
- throw new Error(`No hub defined or ${method} was not found on the hub, please open a bug report.`);
- }
- /**
- * Captures an exception event and sends it to Sentry.
- *
- * @param exception An exception-like object.
- * @returns The generated eventId.
- */
- function captureException(exception) {
- let syntheticException;
- try {
- throw new Error('Sentry syntheticException');
- }
- catch (exception) {
- syntheticException = exception;
- }
- return callOnHub('captureException', exception, {
- originalException: exception,
- syntheticException,
- });
- }
- /**
- * Captures a message event and sends it to Sentry.
- *
- * @param message The message to send to Sentry.
- * @param level Define the level of the message.
- * @returns The generated eventId.
- */
- function captureMessage(message, level) {
- let syntheticException;
- try {
- throw new Error(message);
- }
- catch (exception) {
- syntheticException = exception;
- }
- return callOnHub('captureMessage', message, level, {
- originalException: message,
- syntheticException,
- });
- }
- /**
- * Captures a manually created event and sends it to Sentry.
- *
- * @param event The event to send to Sentry.
- * @returns The generated eventId.
- */
- function captureEvent(event) {
- return callOnHub('captureEvent', event);
- }
- /**
- * Callback to set context information onto the scope.
- * @param callback Callback function that receives Scope.
- */
- function configureScope(callback) {
- callOnHub('configureScope', callback);
- }
- /**
- * Records a new breadcrumb which will be attached to future events.
- *
- * Breadcrumbs will be added to subsequent events to provide more context on
- * user's actions prior to an error or crash.
- *
- * @param breadcrumb The breadcrumb to record.
- */
- function addBreadcrumb(breadcrumb) {
- callOnHub('addBreadcrumb', breadcrumb);
- }
- /**
- * Sets context data with the given name.
- * @param name of the context
- * @param context Any kind of data. This data will be normailzed.
- */
- function setContext(name, context) {
- callOnHub('setContext', name, context);
- }
- /**
- * Set an object that will be merged sent as extra data with the event.
- * @param extras Extras object to merge into current context.
- */
- function setExtras(extras) {
- callOnHub('setExtras', extras);
- }
- /**
- * Set an object that will be merged sent as tags data with the event.
- * @param tags Tags context object to merge into current context.
- */
- function setTags(tags) {
- callOnHub('setTags', tags);
- }
- /**
- * Set key:value that will be sent as extra data with the event.
- * @param key String of extra
- * @param extra Any kind of data. This data will be normailzed.
- */
- function setExtra(key, extra) {
- callOnHub('setExtra', key, extra);
- }
- /**
- * Set key:value that will be sent as tags data with the event.
- * @param key String key of tag
- * @param value String value of tag
- */
- function setTag(key, value) {
- callOnHub('setTag', key, value);
- }
- /**
- * Updates user context information for future events.
- *
- * @param user User context object to be set in the current context. Pass `null` to unset the user.
- */
- function setUser(user) {
- callOnHub('setUser', user);
- }
- /**
- * Creates a new scope with and executes the given operation within.
- * The scope is automatically removed once the operation
- * finishes or throws.
- *
- * This is essentially a convenience function for:
- *
- * pushScope();
- * callback();
- * popScope();
- *
- * @param callback that will be enclosed into push/popScope.
- */
- function withScope(callback) {
- callOnHub('withScope', callback);
- }
-
- const SENTRY_API_VERSION = '7';
- /** Helper class to provide urls to different Sentry endpoints. */
- class API {
- /** Create a new instance of API */
- constructor(dsn) {
- this.dsn = dsn;
- this._dsnObject = new Dsn(dsn);
- }
- /** Returns the Dsn object. */
- getDsn() {
- return this._dsnObject;
- }
- /** Returns a string with auth headers in the url to the store endpoint. */
- getStoreEndpoint() {
- return `${this._getBaseUrl()}${this.getStoreEndpointPath()}`;
- }
- /** Returns the store endpoint with auth added in url encoded. */
- getStoreEndpointWithUrlEncodedAuth() {
- const dsn = this._dsnObject;
- const auth = {
- sentry_key: dsn.user,
- sentry_version: SENTRY_API_VERSION,
- };
- // Auth is intentionally sent as part of query string (NOT as custom HTTP header)
- // to avoid preflight CORS requests
- return `${this.getStoreEndpoint()}?${urlEncode(auth)}`;
- }
- /** Returns the base path of the url including the port. */
- _getBaseUrl() {
- const dsn = this._dsnObject;
- const protocol = dsn.protocol ? `${dsn.protocol}:` : '';
- const port = dsn.port ? `:${dsn.port}` : '';
- return `${protocol}//${dsn.host}${port}`;
- }
- /** Returns only the path component for the store endpoint. */
- getStoreEndpointPath() {
- const dsn = this._dsnObject;
- return `${dsn.path ? `/${dsn.path}` : ''}/api/${dsn.projectId}/store/`;
- }
- /** Returns an object that can be used in request headers. */
- getRequestHeaders(clientName, clientVersion) {
- const dsn = this._dsnObject;
- const header = [`Sentry sentry_version=${SENTRY_API_VERSION}`];
- header.push(`sentry_client=${clientName}/${clientVersion}`);
- header.push(`sentry_key=${dsn.user}`);
- if (dsn.pass) {
- header.push(`sentry_secret=${dsn.pass}`);
- }
- return {
- 'Content-Type': 'application/json',
- 'X-Sentry-Auth': header.join(', '),
- };
- }
- /** Returns the url to the report dialog endpoint. */
- getReportDialogEndpoint(dialogOptions = {}) {
- const dsn = this._dsnObject;
- const endpoint = `${this._getBaseUrl()}${dsn.path ? `/${dsn.path}` : ''}/api/embed/error-page/`;
- const encodedOptions = [];
- encodedOptions.push(`dsn=${dsn.toString()}`);
- for (const key in dialogOptions) {
- if (key === 'user') {
- if (!dialogOptions.user) {
- continue;
- }
- if (dialogOptions.user.name) {
- encodedOptions.push(`name=${encodeURIComponent(dialogOptions.user.name)}`);
- }
- if (dialogOptions.user.email) {
- encodedOptions.push(`email=${encodeURIComponent(dialogOptions.user.email)}`);
- }
- }
- else {
- encodedOptions.push(`${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key])}`);
- }
- }
- if (encodedOptions.length) {
- return `${endpoint}?${encodedOptions.join('&')}`;
- }
- return endpoint;
- }
- }
-
- const installedIntegrations = [];
- /** Gets integration to install */
- function getIntegrationsToSetup(options) {
- const defaultIntegrations = (options.defaultIntegrations && [...options.defaultIntegrations]) || [];
- const userIntegrations = options.integrations;
- let integrations = [];
- if (Array.isArray(userIntegrations)) {
- const userIntegrationsNames = userIntegrations.map(i => i.name);
- const pickedIntegrationsNames = [];
- // Leave only unique default integrations, that were not overridden with provided user integrations
- defaultIntegrations.forEach(defaultIntegration => {
- if (userIntegrationsNames.indexOf(defaultIntegration.name) === -1 &&
- pickedIntegrationsNames.indexOf(defaultIntegration.name) === -1) {
- integrations.push(defaultIntegration);
- pickedIntegrationsNames.push(defaultIntegration.name);
- }
- });
- // Don't add same user integration twice
- userIntegrations.forEach(userIntegration => {
- if (pickedIntegrationsNames.indexOf(userIntegration.name) === -1) {
- integrations.push(userIntegration);
- pickedIntegrationsNames.push(userIntegration.name);
- }
- });
- }
- else if (typeof userIntegrations === 'function') {
- integrations = userIntegrations(defaultIntegrations);
- integrations = Array.isArray(integrations) ? integrations : [integrations];
- }
- else {
- integrations = [...defaultIntegrations];
- }
- // Make sure that if present, `Debug` integration will always run last
- const integrationsNames = integrations.map(i => i.name);
- const alwaysLastToRun = 'Debug';
- if (integrationsNames.indexOf(alwaysLastToRun) !== -1) {
- integrations.push(...integrations.splice(integrationsNames.indexOf(alwaysLastToRun), 1));
- }
- return integrations;
- }
- /** Setup given integration */
- function setupIntegration(integration) {
- if (installedIntegrations.indexOf(integration.name) !== -1) {
- return;
- }
- integration.setupOnce(addGlobalEventProcessor, getCurrentHub);
- installedIntegrations.push(integration.name);
- logger.log(`Integration installed: ${integration.name}`);
- }
- /**
- * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default
- * integrations are added unless they were already provided before.
- * @param integrations array of integration instances
- * @param withDefault should enable default integrations
- */
- function setupIntegrations(options) {
- const integrations = {};
- getIntegrationsToSetup(options).forEach(integration => {
- integrations[integration.name] = integration;
- setupIntegration(integration);
- });
- return integrations;
- }
-
- /**
- * Base implementation for all JavaScript SDK clients.
- *
- * Call the constructor with the corresponding backend constructor and options
- * specific to the client subclass. To access these options later, use
- * {@link Client.getOptions}. Also, the Backend instance is available via
- * {@link Client.getBackend}.
- *
- * If a Dsn is specified in the options, it will be parsed and stored. Use
- * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is
- * invalid, the constructor will throw a {@link SentryException}. Note that
- * without a valid Dsn, the SDK will not send any events to Sentry.
- *
- * Before sending an event via the backend, it is passed through
- * {@link BaseClient.prepareEvent} to add SDK information and scope data
- * (breadcrumbs and context). To add more custom information, override this
- * method and extend the resulting prepared event.
- *
- * To issue automatically created events (e.g. via instrumentation), use
- * {@link Client.captureEvent}. It will prepare the event and pass it through
- * the callback lifecycle. To issue auto-breadcrumbs, use
- * {@link Client.addBreadcrumb}.
- *
- * @example
- * class NodeClient extends BaseClient {
- * public constructor(options: NodeOptions) {
- * super(NodeBackend, options);
- * }
- *
- * // ...
- * }
- */
- class BaseClient {
- /**
- * Initializes this client instance.
- *
- * @param backendClass A constructor function to create the backend.
- * @param options Options for the client.
- */
- constructor(backendClass, options) {
- /** Array of used integrations. */
- this._integrations = {};
- /** Is the client still processing a call? */
- this._processing = false;
- this._backend = new backendClass(options);
- this._options = options;
- if (options.dsn) {
- this._dsn = new Dsn(options.dsn);
- }
- if (this._isEnabled()) {
- this._integrations = setupIntegrations(this._options);
- }
- }
- /**
- * @inheritDoc
- */
- captureException(exception, hint, scope) {
- let eventId = hint && hint.event_id;
- this._processing = true;
- this._getBackend()
- .eventFromException(exception, hint)
- .then(event => this._processEvent(event, hint, scope))
- .then(finalEvent => {
- // We need to check for finalEvent in case beforeSend returned null
- eventId = finalEvent && finalEvent.event_id;
- this._processing = false;
- })
- .then(null, reason => {
- logger.error(reason);
- this._processing = false;
- });
- return eventId;
- }
- /**
- * @inheritDoc
- */
- captureMessage(message, level, hint, scope) {
- let eventId = hint && hint.event_id;
- this._processing = true;
- const promisedEvent = isPrimitive(message)
- ? this._getBackend().eventFromMessage(`${message}`, level, hint)
- : this._getBackend().eventFromException(message, hint);
- promisedEvent
- .then(event => this._processEvent(event, hint, scope))
- .then(finalEvent => {
- // We need to check for finalEvent in case beforeSend returned null
- eventId = finalEvent && finalEvent.event_id;
- this._processing = false;
- })
- .then(null, reason => {
- logger.error(reason);
- this._processing = false;
- });
- return eventId;
- }
- /**
- * @inheritDoc
- */
- captureEvent(event, hint, scope) {
- let eventId = hint && hint.event_id;
- this._processing = true;
- this._processEvent(event, hint, scope)
- .then(finalEvent => {
- // We need to check for finalEvent in case beforeSend returned null
- eventId = finalEvent && finalEvent.event_id;
- this._processing = false;
- })
- .then(null, reason => {
- logger.error(reason);
- this._processing = false;
- });
- return eventId;
- }
- /**
- * @inheritDoc
- */
- getDsn() {
- return this._dsn;
- }
- /**
- * @inheritDoc
- */
- getOptions() {
- return this._options;
- }
- /**
- * @inheritDoc
- */
- flush(timeout) {
- return this._isClientProcessing(timeout).then(status => {
- clearInterval(status.interval);
- return this._getBackend()
- .getTransport()
- .close(timeout)
- .then(transportFlushed => status.ready && transportFlushed);
- });
- }
- /**
- * @inheritDoc
- */
- close(timeout) {
- return this.flush(timeout).then(result => {
- this.getOptions().enabled = false;
- return result;
- });
- }
- /**
- * @inheritDoc
- */
- getIntegrations() {
- return this._integrations || {};
- }
- /**
- * @inheritDoc
- */
- getIntegration(integration) {
- try {
- return this._integrations[integration.id] || null;
- }
- catch (_oO) {
- logger.warn(`Cannot retrieve integration ${integration.id} from the current Client`);
- return null;
- }
- }
- /** Waits for the client to be done with processing. */
- _isClientProcessing(timeout) {
- return new SyncPromise(resolve => {
- let ticked = 0;
- const tick = 1;
- let interval = 0;
- clearInterval(interval);
- interval = setInterval(() => {
- if (!this._processing) {
- resolve({
- interval,
- ready: true,
- });
- }
- else {
- ticked += tick;
- if (timeout && ticked >= timeout) {
- resolve({
- interval,
- ready: false,
- });
- }
- }
- }, tick);
- });
- }
- /** Returns the current backend. */
- _getBackend() {
- return this._backend;
- }
- /** Determines whether this SDK is enabled and a valid Dsn is present. */
- _isEnabled() {
- return this.getOptions().enabled !== false && this._dsn !== undefined;
- }
- /**
- * Adds common information to events.
- *
- * The information includes release and environment from `options`,
- * breadcrumbs and context (extra, tags and user) from the scope.
- *
- * Information that is already present in the event is never overwritten. For
- * nested objects, such as the context, keys are merged.
- *
- * @param event The original event.
- * @param hint May contain additional informartion about the original exception.
- * @param scope A scope containing event metadata.
- * @returns A new event with more information.
- */
- _prepareEvent(event, scope, hint) {
- const { environment, release, dist, maxValueLength = 250, normalizeDepth = 3 } = this.getOptions();
- const prepared = Object.assign({}, event);
- if (prepared.environment === undefined && environment !== undefined) {
- prepared.environment = environment;
- }
- if (prepared.release === undefined && release !== undefined) {
- prepared.release = release;
- }
- if (prepared.dist === undefined && dist !== undefined) {
- prepared.dist = dist;
- }
- if (prepared.message) {
- prepared.message = truncate(prepared.message, maxValueLength);
- }
- const exception = prepared.exception && prepared.exception.values && prepared.exception.values[0];
- if (exception && exception.value) {
- exception.value = truncate(exception.value, maxValueLength);
- }
- const request = prepared.request;
- if (request && request.url) {
- request.url = truncate(request.url, maxValueLength);
- }
- if (prepared.event_id === undefined) {
- prepared.event_id = hint && hint.event_id ? hint.event_id : uuid4();
- }
- this._addIntegrations(prepared.sdk);
- // We prepare the result here with a resolved Event.
- let result = SyncPromise.resolve(prepared);
- // This should be the last thing called, since we want that
- // {@link Hub.addEventProcessor} gets the finished prepared event.
- if (scope) {
- // In case we have a hub we reassign it.
- result = scope.applyToEvent(prepared, hint);
- }
- return result.then(evt => {
- // tslint:disable-next-line:strict-type-predicates
- if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {
- return this._normalizeEvent(evt, normalizeDepth);
- }
- return evt;
- });
- }
- /**
- * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.
- * Normalized keys:
- * - `breadcrumbs.data`
- * - `user`
- * - `contexts`
- * - `extra`
- * @param event Event
- * @returns Normalized event
- */
- _normalizeEvent(event, depth) {
- if (!event) {
- return null;
- }
- // tslint:disable:no-unsafe-any
- return Object.assign({}, event, (event.breadcrumbs && {
- breadcrumbs: event.breadcrumbs.map(b => (Object.assign({}, b, (b.data && {
- data: normalize(b.data, depth),
- })))),
- }), (event.user && {
- user: normalize(event.user, depth),
- }), (event.contexts && {
- contexts: normalize(event.contexts, depth),
- }), (event.extra && {
- extra: normalize(event.extra, depth),
- }));
- }
- /**
- * This function adds all used integrations to the SDK info in the event.
- * @param sdkInfo The sdkInfo of the event that will be filled with all integrations.
- */
- _addIntegrations(sdkInfo) {
- const integrationsArray = Object.keys(this._integrations);
- if (sdkInfo && integrationsArray.length > 0) {
- sdkInfo.integrations = integrationsArray;
- }
- }
- /**
- * Processes an event (either error or message) and sends it to Sentry.
- *
- * This also adds breadcrumbs and context information to the event. However,
- * platform specific meta data (such as the User's IP address) must be added
- * by the SDK implementor.
- *
- *
- * @param event The event to send to Sentry.
- * @param hint May contain additional informartion about the original exception.
- * @param scope A scope containing event metadata.
- * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.
- */
- _processEvent(event, hint, scope) {
- const { beforeSend, sampleRate } = this.getOptions();
- if (!this._isEnabled()) {
- return SyncPromise.reject('SDK not enabled, will not send event.');
- }
- // 1.0 === 100% events are sent
- // 0.0 === 0% events are sent
- if (typeof sampleRate === 'number' && Math.random() > sampleRate) {
- return SyncPromise.reject('This event has been sampled, will not send event.');
- }
- return new SyncPromise((resolve, reject) => {
- this._prepareEvent(event, scope, hint)
- .then(prepared => {
- if (prepared === null) {
- reject('An event processor returned null, will not send event.');
- return;
- }
- let finalEvent = prepared;
- const isInternalException = hint && hint.data && hint.data.__sentry__ === true;
- if (isInternalException || !beforeSend) {
- this._getBackend().sendEvent(finalEvent);
- resolve(finalEvent);
- return;
- }
- const beforeSendResult = beforeSend(prepared, hint);
- // tslint:disable-next-line:strict-type-predicates
- if (typeof beforeSendResult === 'undefined') {
- logger.error('`beforeSend` method has to return `null` or a valid event.');
- }
- else if (isThenable(beforeSendResult)) {
- this._handleAsyncBeforeSend(beforeSendResult, resolve, reject);
- }
- else {
- finalEvent = beforeSendResult;
- if (finalEvent === null) {
- logger.log('`beforeSend` returned `null`, will not send event.');
- resolve(null);
- return;
- }
- // From here on we are really async
- this._getBackend().sendEvent(finalEvent);
- resolve(finalEvent);
- }
- })
- .then(null, reason => {
- this.captureException(reason, {
- data: {
- __sentry__: true,
- },
- originalException: reason,
- });
- reject(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${reason}`);
- });
- });
- }
- /**
- * Resolves before send Promise and calls resolve/reject on parent SyncPromise.
- */
- _handleAsyncBeforeSend(beforeSend, resolve, reject) {
- beforeSend
- .then(processedEvent => {
- if (processedEvent === null) {
- reject('`beforeSend` returned `null`, will not send event.');
- return;
- }
- // From here on we are really async
- this._getBackend().sendEvent(processedEvent);
- resolve(processedEvent);
- })
- .then(null, e => {
- reject(`beforeSend rejected with ${e}`);
- });
- }
- }
-
- /** Noop transport */
- class NoopTransport {
- /**
- * @inheritDoc
- */
- sendEvent(_) {
- return SyncPromise.resolve({
- reason: `NoopTransport: Event has been skipped because no Dsn is configured.`,
- status: exports.Status.Skipped,
- });
- }
- /**
- * @inheritDoc
- */
- close(_) {
- return SyncPromise.resolve(true);
- }
- }
-
- /**
- * This is the base implemention of a Backend.
- * @hidden
- */
- class BaseBackend {
- /** Creates a new backend instance. */
- constructor(options) {
- this._options = options;
- if (!this._options.dsn) {
- logger.warn('No DSN provided, backend will not do anything.');
- }
- this._transport = this._setupTransport();
- }
- /**
- * Sets up the transport so it can be used later to send requests.
- */
- _setupTransport() {
- return new NoopTransport();
- }
- /**
- * @inheritDoc
- */
- eventFromException(_exception, _hint) {
- throw new SentryError('Backend has to implement `eventFromException` method');
- }
- /**
- * @inheritDoc
- */
- eventFromMessage(_message, _level, _hint) {
- throw new SentryError('Backend has to implement `eventFromMessage` method');
- }
- /**
- * @inheritDoc
- */
- sendEvent(event) {
- this._transport.sendEvent(event).then(null, reason => {
- logger.error(`Error while sending event: ${reason}`);
- });
- }
- /**
- * @inheritDoc
- */
- getTransport() {
- return this._transport;
- }
- }
-
- /**
- * Internal function to create a new SDK client instance. The client is
- * installed and then bound to the current scope.
- *
- * @param clientClass The client class to instanciate.
- * @param options Options to pass to the client.
- */
- function initAndBind(clientClass, options) {
- if (options.debug === true) {
- logger.enable();
- }
- getCurrentHub().bindClient(new clientClass(options));
- }
-
- let originalFunctionToString;
- /** Patch toString calls to return proper name for wrapped functions */
- class FunctionToString {
- constructor() {
- /**
- * @inheritDoc
- */
- this.name = FunctionToString.id;
- }
- /**
- * @inheritDoc
- */
- setupOnce() {
- originalFunctionToString = Function.prototype.toString;
- Function.prototype.toString = function (...args) {
- const context = this.__sentry_original__ || this;
- // tslint:disable-next-line:no-unsafe-any
- return originalFunctionToString.apply(context, args);
- };
- }
- }
- /**
- * @inheritDoc
- */
- FunctionToString.id = 'FunctionToString';
-
- // "Script error." is hard coded into browsers for errors that it can't read.
- // this is the result of a script being pulled in from an external domain and CORS.
- const DEFAULT_IGNORE_ERRORS = [/^Script error\.?$/, /^Javascript error: Script error\.? on line 0$/];
- /** Inbound filters configurable by the user */
- class InboundFilters {
- constructor(_options = {}) {
- this._options = _options;
- /**
- * @inheritDoc
- */
- this.name = InboundFilters.id;
- }
- /**
- * @inheritDoc
- */
- setupOnce() {
- addGlobalEventProcessor((event) => {
- const hub = getCurrentHub();
- if (!hub) {
- return event;
- }
- const self = hub.getIntegration(InboundFilters);
- if (self) {
- const client = hub.getClient();
- const clientOptions = client ? client.getOptions() : {};
- const options = self._mergeOptions(clientOptions);
- if (self._shouldDropEvent(event, options)) {
- return null;
- }
- }
- return event;
- });
- }
- /** JSDoc */
- _shouldDropEvent(event, options) {
- if (this._isSentryError(event, options)) {
- logger.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${getEventDescription(event)}`);
- return true;
- }
- if (this._isIgnoredError(event, options)) {
- logger.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${getEventDescription(event)}`);
- return true;
- }
- if (this._isBlacklistedUrl(event, options)) {
- logger.warn(`Event dropped due to being matched by \`blacklistUrls\` option.\nEvent: ${getEventDescription(event)}.\nUrl: ${this._getEventFilterUrl(event)}`);
- return true;
- }
- if (!this._isWhitelistedUrl(event, options)) {
- logger.warn(`Event dropped due to not being matched by \`whitelistUrls\` option.\nEvent: ${getEventDescription(event)}.\nUrl: ${this._getEventFilterUrl(event)}`);
- return true;
- }
- return false;
- }
- /** JSDoc */
- _isSentryError(event, options = {}) {
- if (!options.ignoreInternal) {
- return false;
- }
- try {
- return ((event &&
- event.exception &&
- event.exception.values &&
- event.exception.values[0] &&
- event.exception.values[0].type === 'SentryError') ||
- false);
- }
- catch (_oO) {
- return false;
- }
- }
- /** JSDoc */
- _isIgnoredError(event, options = {}) {
- if (!options.ignoreErrors || !options.ignoreErrors.length) {
- return false;
- }
- return this._getPossibleEventMessages(event).some(message =>
- // Not sure why TypeScript complains here...
- options.ignoreErrors.some(pattern => isMatchingPattern(message, pattern)));
- }
- /** JSDoc */
- _isBlacklistedUrl(event, options = {}) {
- // TODO: Use Glob instead?
- if (!options.blacklistUrls || !options.blacklistUrls.length) {
- return false;
- }
- const url = this._getEventFilterUrl(event);
- return !url ? false : options.blacklistUrls.some(pattern => isMatchingPattern(url, pattern));
- }
- /** JSDoc */
- _isWhitelistedUrl(event, options = {}) {
- // TODO: Use Glob instead?
- if (!options.whitelistUrls || !options.whitelistUrls.length) {
- return true;
- }
- const url = this._getEventFilterUrl(event);
- return !url ? true : options.whitelistUrls.some(pattern => isMatchingPattern(url, pattern));
- }
- /** JSDoc */
- _mergeOptions(clientOptions = {}) {
- return {
- blacklistUrls: [...(this._options.blacklistUrls || []), ...(clientOptions.blacklistUrls || [])],
- ignoreErrors: [
- ...(this._options.ignoreErrors || []),
- ...(clientOptions.ignoreErrors || []),
- ...DEFAULT_IGNORE_ERRORS,
- ],
- ignoreInternal: typeof this._options.ignoreInternal !== 'undefined' ? this._options.ignoreInternal : true,
- whitelistUrls: [...(this._options.whitelistUrls || []), ...(clientOptions.whitelistUrls || [])],
- };
- }
- /** JSDoc */
- _getPossibleEventMessages(event) {
- if (event.message) {
- return [event.message];
- }
- if (event.exception) {
- try {
- const { type = '', value = '' } = (event.exception.values && event.exception.values[0]) || {};
- return [`${value}`, `${type}: ${value}`];
- }
- catch (oO) {
- logger.error(`Cannot extract message for event ${getEventDescription(event)}`);
- return [];
- }
- }
- return [];
- }
- /** JSDoc */
- _getEventFilterUrl(event) {
- try {
- if (event.stacktrace) {
- const frames = event.stacktrace.frames;
- return (frames && frames[frames.length - 1].filename) || null;
- }
- if (event.exception) {
- const frames = event.exception.values && event.exception.values[0].stacktrace && event.exception.values[0].stacktrace.frames;
- return (frames && frames[frames.length - 1].filename) || null;
- }
- return null;
- }
- catch (oO) {
- logger.error(`Cannot extract url for event ${getEventDescription(event)}`);
- return null;
- }
- }
- }
- /**
- * @inheritDoc
- */
- InboundFilters.id = 'InboundFilters';
-
-
-
- var CoreIntegrations = /*#__PURE__*/Object.freeze({
- FunctionToString: FunctionToString,
- InboundFilters: InboundFilters
- });
-
- // tslint:disable:object-literal-sort-keys
- // global reference to slice
- const UNKNOWN_FUNCTION = '?';
- // Chromium based browsers: Chrome, Brave, new Opera, new Edge
- const chrome = /^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack||[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i;
- // gecko regex: `(?:bundle|\d+\.js)`: `bundle` is for react native, `\d+\.js` also but specifically for ram bundles because it
- // generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js
- // We need this specific case for now because we want no other regex to match.
- const gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js))(?::(\d+))?(?::(\d+))?\s*$/i;
- const winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
- const geckoEval = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i;
- const chromeEval = /\((\S*)(?::(\d+))(?::(\d+))\)/;
- /** JSDoc */
- function computeStackTrace(ex) {
- // tslint:disable:no-unsafe-any
- let stack = null;
- const popSize = ex && ex.framesToPop;
- try {
- // This must be tried first because Opera 10 *destroys*
- // its stacktrace property if you try to access the stack
- // property first!!
- stack = computeStackTraceFromStacktraceProp(ex);
- if (stack) {
- return popFrames(stack, popSize);
- }
- }
- catch (e) {
- // no-empty
- }
- try {
- stack = computeStackTraceFromStackProp(ex);
- if (stack) {
- return popFrames(stack, popSize);
- }
- }
- catch (e) {
- // no-empty
- }
- return {
- message: extractMessage(ex),
- name: ex && ex.name,
- stack: [],
- failed: true,
- };
- }
- /** JSDoc */
- // tslint:disable-next-line:cyclomatic-complexity
- function computeStackTraceFromStackProp(ex) {
- // tslint:disable:no-conditional-assignment
- if (!ex || !ex.stack) {
- return null;
- }
- const stack = [];
- const lines = ex.stack.split('\n');
- let isEval;
- let submatch;
- let parts;
- let element;
- for (let i = 0; i < lines.length; ++i) {
- if ((parts = chrome.exec(lines[i]))) {
- const isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line
- isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line
- if (isEval && (submatch = chromeEval.exec(parts[2]))) {
- // throw out eval line/column and use top-most line/column number
- parts[2] = submatch[1]; // url
- parts[3] = submatch[2]; // line
- parts[4] = submatch[3]; // column
- }
- element = {
- // working with the regexp above is super painful. it is quite a hack, but just stripping the `address at `
- // prefix here seems like the quickest solution for now.
- url: parts[2] && parts[2].indexOf('address at ') === 0 ? parts[2].substr('address at '.length) : parts[2],
- func: parts[1] || UNKNOWN_FUNCTION,
- args: isNative ? [parts[2]] : [],
- line: parts[3] ? +parts[3] : null,
- column: parts[4] ? +parts[4] : null,
- };
- }
- else if ((parts = winjs.exec(lines[i]))) {
- element = {
- url: parts[2],
- func: parts[1] || UNKNOWN_FUNCTION,
- args: [],
- line: +parts[3],
- column: parts[4] ? +parts[4] : null,
- };
- }
- else if ((parts = gecko.exec(lines[i]))) {
- isEval = parts[3] && parts[3].indexOf(' > eval') > -1;
- if (isEval && (submatch = geckoEval.exec(parts[3]))) {
- // throw out eval line/column and use top-most line number
- parts[1] = parts[1] || `eval`;
- parts[3] = submatch[1];
- parts[4] = submatch[2];
- parts[5] = ''; // no column when eval
- }
- else if (i === 0 && !parts[5] && ex.columnNumber !== void 0) {
- // FireFox uses this awesome columnNumber property for its top frame
- // Also note, Firefox's column number is 0-based and everything else expects 1-based,
- // so adding 1
- // NOTE: this hack doesn't work if top-most frame is eval
- stack[0].column = ex.columnNumber + 1;
- }
- element = {
- url: parts[3],
- func: parts[1] || UNKNOWN_FUNCTION,
- args: parts[2] ? parts[2].split(',') : [],
- line: parts[4] ? +parts[4] : null,
- column: parts[5] ? +parts[5] : null,
- };
- }
- else {
- continue;
- }
- if (!element.func && element.line) {
- element.func = UNKNOWN_FUNCTION;
- }
- stack.push(element);
- }
- if (!stack.length) {
- return null;
- }
- return {
- message: extractMessage(ex),
- name: ex.name,
- stack,
- };
- }
- /** JSDoc */
- function computeStackTraceFromStacktraceProp(ex) {
- if (!ex || !ex.stacktrace) {
- return null;
- }
- // Access and store the stacktrace property before doing ANYTHING
- // else to it because Opera is not very good at providing it
- // reliably in other circumstances.
- const stacktrace = ex.stacktrace;
- const opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i;
- const opera11Regex = / line (\d+), column (\d+)\s*(?:in (?:]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i;
- const lines = stacktrace.split('\n');
- const stack = [];
- let parts;
- for (let line = 0; line < lines.length; line += 2) {
- // tslint:disable:no-conditional-assignment
- let element = null;
- if ((parts = opera10Regex.exec(lines[line]))) {
- element = {
- url: parts[2],
- func: parts[3],
- args: [],
- line: +parts[1],
- column: null,
- };
- }
- else if ((parts = opera11Regex.exec(lines[line]))) {
- element = {
- url: parts[6],
- func: parts[3] || parts[4],
- args: parts[5] ? parts[5].split(',') : [],
- line: +parts[1],
- column: +parts[2],
- };
- }
- if (element) {
- if (!element.func && element.line) {
- element.func = UNKNOWN_FUNCTION;
- }
- stack.push(element);
- }
- }
- if (!stack.length) {
- return null;
- }
- return {
- message: extractMessage(ex),
- name: ex.name,
- stack,
- };
- }
- /** Remove N number of frames from the stack */
- function popFrames(stacktrace, popSize) {
- try {
- return Object.assign({}, stacktrace, { stack: stacktrace.stack.slice(popSize) });
- }
- catch (e) {
- return stacktrace;
- }
- }
- /**
- * There are cases where stacktrace.message is an Event object
- * https://github.com/getsentry/sentry-javascript/issues/1949
- * In this specific case we try to extract stacktrace.message.error.message
- */
- function extractMessage(ex) {
- const message = ex && ex.message;
- if (!message) {
- return 'No error message';
- }
- if (message.error && typeof message.error.message === 'string') {
- return message.error.message;
- }
- return message;
- }
-
- const STACKTRACE_LIMIT = 50;
- /**
- * This function creates an exception from an TraceKitStackTrace
- * @param stacktrace TraceKitStackTrace that will be converted to an exception
- * @hidden
- */
- function exceptionFromStacktrace(stacktrace) {
- const frames = prepareFramesForEvent(stacktrace.stack);
- const exception = {
- type: stacktrace.name,
- value: stacktrace.message,
- };
- if (frames && frames.length) {
- exception.stacktrace = { frames };
- }
- // tslint:disable-next-line:strict-type-predicates
- if (exception.type === undefined && exception.value === '') {
- exception.value = 'Unrecoverable error caught';
- }
- return exception;
- }
- /**
- * @hidden
- */
- function eventFromPlainObject(exception, syntheticException, rejection) {
- const event = {
- exception: {
- values: [
- {
- type: isEvent(exception) ? exception.constructor.name : rejection ? 'UnhandledRejection' : 'Error',
- value: `Non-Error ${rejection ? 'promise rejection' : 'exception'} captured with keys: ${extractExceptionKeysForMessage(exception)}`,
- },
- ],
- },
- extra: {
- __serialized__: normalizeToSize(exception),
- },
- };
- if (syntheticException) {
- const stacktrace = computeStackTrace(syntheticException);
- const frames = prepareFramesForEvent(stacktrace.stack);
- event.stacktrace = {
- frames,
- };
- }
- return event;
- }
- /**
- * @hidden
- */
- function eventFromStacktrace(stacktrace) {
- const exception = exceptionFromStacktrace(stacktrace);
- return {
- exception: {
- values: [exception],
- },
- };
- }
- /**
- * @hidden
- */
- function prepareFramesForEvent(stack) {
- if (!stack || !stack.length) {
- return [];
- }
- let localStack = stack;
- const firstFrameFunction = localStack[0].func || '';
- const lastFrameFunction = localStack[localStack.length - 1].func || '';
- // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call)
- if (firstFrameFunction.indexOf('captureMessage') !== -1 || firstFrameFunction.indexOf('captureException') !== -1) {
- localStack = localStack.slice(1);
- }
- // If stack ends with one of our internal API calls, remove it (ends, meaning it's the bottom of the stack - aka top-most call)
- if (lastFrameFunction.indexOf('sentryWrapped') !== -1) {
- localStack = localStack.slice(0, -1);
- }
- // The frame where the crash happened, should be the last entry in the array
- return localStack
- .map((frame) => ({
- colno: frame.column === null ? undefined : frame.column,
- filename: frame.url || localStack[0].url,
- function: frame.func || '?',
- in_app: true,
- lineno: frame.line === null ? undefined : frame.line,
- }))
- .slice(0, STACKTRACE_LIMIT)
- .reverse();
- }
-
- /** JSDoc */
- function eventFromUnknownInput(exception, syntheticException, options = {}) {
- let event;
- if (isErrorEvent(exception) && exception.error) {
- // If it is an ErrorEvent with `error` property, extract it to get actual Error
- const errorEvent = exception;
- exception = errorEvent.error; // tslint:disable-line:no-parameter-reassignment
- event = eventFromStacktrace(computeStackTrace(exception));
- return event;
- }
- if (isDOMError(exception) || isDOMException(exception)) {
- // If it is a DOMError or DOMException (which are legacy APIs, but still supported in some browsers)
- // then we just extract the name and message, as they don't provide anything else
- // https://developer.mozilla.org/en-US/docs/Web/API/DOMError
- // https://developer.mozilla.org/en-US/docs/Web/API/DOMException
- const domException = exception;
- const name = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');
- const message = domException.message ? `${name}: ${domException.message}` : name;
- event = eventFromString(message, syntheticException, options);
- addExceptionTypeValue(event, message);
- return event;
- }
- if (isError(exception)) {
- // we have a real Error object, do nothing
- event = eventFromStacktrace(computeStackTrace(exception));
- return event;
- }
- if (isPlainObject(exception) || isEvent(exception)) {
- // If it is plain Object or Event, serialize it manually and extract options
- // This will allow us to group events based on top-level keys
- // which is much better than creating new group when any key/value change
- const objectException = exception;
- event = eventFromPlainObject(objectException, syntheticException, options.rejection);
- addExceptionMechanism(event, {
- synthetic: true,
- });
- return event;
- }
- // If none of previous checks were valid, then it means that it's not:
- // - an instance of DOMError
- // - an instance of DOMException
- // - an instance of Event
- // - an instance of Error
- // - a valid ErrorEvent (one with an error property)
- // - a plain Object
- //
- // So bail out and capture it as a simple message:
- event = eventFromString(exception, syntheticException, options);
- addExceptionTypeValue(event, `${exception}`, undefined);
- addExceptionMechanism(event, {
- synthetic: true,
- });
- return event;
- }
- // this._options.attachStacktrace
- /** JSDoc */
- function eventFromString(input, syntheticException, options = {}) {
- const event = {
- message: input,
- };
- if (options.attachStacktrace && syntheticException) {
- const stacktrace = computeStackTrace(syntheticException);
- const frames = prepareFramesForEvent(stacktrace.stack);
- event.stacktrace = {
- frames,
- };
- }
- return event;
- }
-
- /** Base Transport class implementation */
- class BaseTransport {
- constructor(options) {
- this.options = options;
- /** A simple buffer holding all requests. */
- this._buffer = new PromiseBuffer(30);
- this.url = new API(this.options.dsn).getStoreEndpointWithUrlEncodedAuth();
- }
- /**
- * @inheritDoc
- */
- sendEvent(_) {
- throw new SentryError('Transport Class has to implement `sendEvent` method');
- }
- /**
- * @inheritDoc
- */
- close(timeout) {
- return this._buffer.drain(timeout);
- }
- }
-
- const global$3 = getGlobalObject();
- /** `fetch` based transport */
- class FetchTransport extends BaseTransport {
- constructor() {
- super(...arguments);
- /** Locks transport after receiving 429 response */
- this._disabledUntil = new Date(Date.now());
- }
- /**
- * @inheritDoc
- */
- sendEvent(event) {
- if (new Date(Date.now()) < this._disabledUntil) {
- return Promise.reject({
- event,
- reason: `Transport locked till ${this._disabledUntil} due to too many requests.`,
- status: 429,
- });
- }
- const defaultOptions = {
- body: JSON.stringify(event),
- method: 'POST',
- // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default
- // https://caniuse.com/#feat=referrer-policy
- // It doesn't. And it throw exception instead of ignoring this parameter...
- // REF: https://github.com/getsentry/raven-js/issues/1233
- referrerPolicy: (supportsReferrerPolicy() ? 'origin' : ''),
- };
- if (this.options.headers !== undefined) {
- defaultOptions.headers = this.options.headers;
- }
- return this._buffer.add(new SyncPromise((resolve, reject) => {
- global$3
- .fetch(this.url, defaultOptions)
- .then(response => {
- const status = exports.Status.fromHttpCode(response.status);
- if (status === exports.Status.Success) {
- resolve({ status });
- return;
- }
- if (status === exports.Status.RateLimit) {
- const now = Date.now();
- this._disabledUntil = new Date(now + parseRetryAfterHeader(now, response.headers.get('Retry-After')));
- logger.warn(`Too many requests, backing off till: ${this._disabledUntil}`);
- }
- reject(response);
- })
- .catch(reject);
- }));
- }
- }
-
- /** `XHR` based transport */
- class XHRTransport extends BaseTransport {
- constructor() {
- super(...arguments);
- /** Locks transport after receiving 429 response */
- this._disabledUntil = new Date(Date.now());
- }
- /**
- * @inheritDoc
- */
- sendEvent(event) {
- if (new Date(Date.now()) < this._disabledUntil) {
- return Promise.reject({
- event,
- reason: `Transport locked till ${this._disabledUntil} due to too many requests.`,
- status: 429,
- });
- }
- return this._buffer.add(new SyncPromise((resolve, reject) => {
- const request = new XMLHttpRequest();
- request.onreadystatechange = () => {
- if (request.readyState !== 4) {
- return;
- }
- const status = exports.Status.fromHttpCode(request.status);
- if (status === exports.Status.Success) {
- resolve({ status });
- return;
- }
- if (status === exports.Status.RateLimit) {
- const now = Date.now();
- this._disabledUntil = new Date(now + parseRetryAfterHeader(now, request.getResponseHeader('Retry-After')));
- logger.warn(`Too many requests, backing off till: ${this._disabledUntil}`);
- }
- reject(request);
- };
- request.open('POST', this.url);
- for (const header in this.options.headers) {
- if (this.options.headers.hasOwnProperty(header)) {
- request.setRequestHeader(header, this.options.headers[header]);
- }
- }
- request.send(JSON.stringify(event));
- }));
- }
- }
-
-
-
- var index = /*#__PURE__*/Object.freeze({
- BaseTransport: BaseTransport,
- FetchTransport: FetchTransport,
- XHRTransport: XHRTransport
- });
-
- /**
- * The Sentry Browser SDK Backend.
- * @hidden
- */
- class BrowserBackend extends BaseBackend {
- /**
- * @inheritDoc
- */
- _setupTransport() {
- if (!this._options.dsn) {
- // We return the noop transport here in case there is no Dsn.
- return super._setupTransport();
- }
- const transportOptions = Object.assign({}, this._options.transportOptions, { dsn: this._options.dsn });
- if (this._options.transport) {
- return new this._options.transport(transportOptions);
- }
- if (supportsFetch()) {
- return new FetchTransport(transportOptions);
- }
- return new XHRTransport(transportOptions);
- }
- /**
- * @inheritDoc
- */
- eventFromException(exception, hint) {
- const syntheticException = (hint && hint.syntheticException) || undefined;
- const event = eventFromUnknownInput(exception, syntheticException, {
- attachStacktrace: this._options.attachStacktrace,
- });
- addExceptionMechanism(event, {
- handled: true,
- type: 'generic',
- });
- event.level = exports.Severity.Error;
- if (hint && hint.event_id) {
- event.event_id = hint.event_id;
- }
- return SyncPromise.resolve(event);
- }
- /**
- * @inheritDoc
- */
- eventFromMessage(message, level = exports.Severity.Info, hint) {
- const syntheticException = (hint && hint.syntheticException) || undefined;
- const event = eventFromString(message, syntheticException, {
- attachStacktrace: this._options.attachStacktrace,
- });
- event.level = level;
- if (hint && hint.event_id) {
- event.event_id = hint.event_id;
- }
- return SyncPromise.resolve(event);
- }
- }
-
- const SDK_NAME = 'sentry.javascript.browser';
- const SDK_VERSION = '5.14.1';
-
- /**
- * The Sentry Browser SDK Client.
- *
- * @see BrowserOptions for documentation on configuration options.
- * @see SentryClient for usage documentation.
- */
- class BrowserClient extends BaseClient {
- /**
- * Creates a new Browser SDK instance.
- *
- * @param options Configuration options for this SDK.
- */
- constructor(options = {}) {
- super(BrowserBackend, options);
- }
- /**
- * @inheritDoc
- */
- _prepareEvent(event, scope, hint) {
- event.platform = event.platform || 'javascript';
- event.sdk = Object.assign({}, event.sdk, { name: SDK_NAME, packages: [
- ...((event.sdk && event.sdk.packages) || []),
- {
- name: 'npm:@sentry/browser',
- version: SDK_VERSION,
- },
- ], version: SDK_VERSION });
- return super._prepareEvent(event, scope, hint);
- }
- /**
- * Show a report dialog to the user to send feedback to a specific event.
- *
- * @param options Set individual options for the dialog
- */
- showReportDialog(options = {}) {
- // doesn't work without a document (React Native)
- const document = getGlobalObject().document;
- if (!document) {
- return;
- }
- if (!this._isEnabled()) {
- logger.error('Trying to call showReportDialog with Sentry Client is disabled');
- return;
- }
- const dsn = options.dsn || this.getDsn();
- if (!options.eventId) {
- logger.error('Missing `eventId` option in showReportDialog call');
- return;
- }
- if (!dsn) {
- logger.error('Missing `Dsn` option in showReportDialog call');
- return;
- }
- const script = document.createElement('script');
- script.async = true;
- script.src = new API(dsn).getReportDialogEndpoint(options);
- if (options.onLoad) {
- script.onload = options.onLoad;
- }
- (document.head || document.body).appendChild(script);
- }
- }
-
- let ignoreOnError = 0;
- /**
- * @hidden
- */
- function shouldIgnoreOnError() {
- return ignoreOnError > 0;
- }
- /**
- * @hidden
- */
- function ignoreNextOnError() {
- // onerror should trigger before setTimeout
- ignoreOnError += 1;
- setTimeout(() => {
- ignoreOnError -= 1;
- });
- }
- /**
- * Instruments the given function and sends an event to Sentry every time the
- * function throws an exception.
- *
- * @param fn A function to wrap.
- * @returns The wrapped function.
- * @hidden
- */
- function wrap(fn, options = {}, before) {
- // tslint:disable-next-line:strict-type-predicates
- if (typeof fn !== 'function') {
- return fn;
- }
- try {
- // We don't wanna wrap it twice
- if (fn.__sentry__) {
- return fn;
- }
- // If this has already been wrapped in the past, return that wrapped function
- if (fn.__sentry_wrapped__) {
- return fn.__sentry_wrapped__;
- }
- }
- catch (e) {
- // Just accessing custom props in some Selenium environments
- // can cause a "Permission denied" exception (see raven-js#495).
- // Bail on wrapping and return the function as-is (defers to window.onerror).
- return fn;
- }
- const sentryWrapped = function () {
- const args = Array.prototype.slice.call(arguments);
- // tslint:disable:no-unsafe-any
- try {
- // tslint:disable-next-line:strict-type-predicates
- if (before && typeof before === 'function') {
- before.apply(this, arguments);
- }
- const wrappedArguments = args.map((arg) => wrap(arg, options));
- if (fn.handleEvent) {
- // Attempt to invoke user-land function
- // NOTE: If you are a Sentry user, and you are seeing this stack frame, it
- // means the sentry.javascript SDK caught an error invoking your application code. This
- // is expected behavior and NOT indicative of a bug with sentry.javascript.
- return fn.handleEvent.apply(this, wrappedArguments);
- }
- // Attempt to invoke user-land function
- // NOTE: If you are a Sentry user, and you are seeing this stack frame, it
- // means the sentry.javascript SDK caught an error invoking your application code. This
- // is expected behavior and NOT indicative of a bug with sentry.javascript.
- return fn.apply(this, wrappedArguments);
- // tslint:enable:no-unsafe-any
- }
- catch (ex) {
- ignoreNextOnError();
- withScope((scope) => {
- scope.addEventProcessor((event) => {
- const processedEvent = Object.assign({}, event);
- if (options.mechanism) {
- addExceptionTypeValue(processedEvent, undefined, undefined);
- addExceptionMechanism(processedEvent, options.mechanism);
- }
- processedEvent.extra = Object.assign({}, processedEvent.extra, { arguments: args });
- return processedEvent;
- });
- captureException(ex);
- });
- throw ex;
- }
- };
- // Accessing some objects may throw
- // ref: https://github.com/getsentry/sentry-javascript/issues/1168
- try {
- for (const property in fn) {
- if (Object.prototype.hasOwnProperty.call(fn, property)) {
- sentryWrapped[property] = fn[property];
- }
- }
- }
- catch (_oO) { } // tslint:disable-line:no-empty
- fn.prototype = fn.prototype || {};
- sentryWrapped.prototype = fn.prototype;
- Object.defineProperty(fn, '__sentry_wrapped__', {
- enumerable: false,
- value: sentryWrapped,
- });
- // Signal that this function has been wrapped/filled already
- // for both debugging and to prevent it to being wrapped/filled twice
- Object.defineProperties(sentryWrapped, {
- __sentry__: {
- enumerable: false,
- value: true,
- },
- __sentry_original__: {
- enumerable: false,
- value: fn,
- },
- });
- // Restore original function name (not all browsers allow that)
- try {
- const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name');
- if (descriptor.configurable) {
- Object.defineProperty(sentryWrapped, 'name', {
- get() {
- return fn.name;
- },
- });
- }
- }
- catch (_oO) {
- /*no-empty*/
- }
- return sentryWrapped;
- }
-
- /** Global handlers */
- class GlobalHandlers {
- /** JSDoc */
- constructor(options) {
- /**
- * @inheritDoc
- */
- this.name = GlobalHandlers.id;
- /** JSDoc */
- this._onErrorHandlerInstalled = false;
- /** JSDoc */
- this._onUnhandledRejectionHandlerInstalled = false;
- this._options = Object.assign({ onerror: true, onunhandledrejection: true }, options);
- }
- /**
- * @inheritDoc
- */
- setupOnce() {
- Error.stackTraceLimit = 50;
- if (this._options.onerror) {
- logger.log('Global Handler attached: onerror');
- this._installGlobalOnErrorHandler();
- }
- if (this._options.onunhandledrejection) {
- logger.log('Global Handler attached: onunhandledrejection');
- this._installGlobalOnUnhandledRejectionHandler();
- }
- }
- /** JSDoc */
- _installGlobalOnErrorHandler() {
- if (this._onErrorHandlerInstalled) {
- return;
- }
- addInstrumentationHandler({
- callback: (data) => {
- const error = data.error;
- const currentHub = getCurrentHub();
- const hasIntegration = currentHub.getIntegration(GlobalHandlers);
- const isFailedOwnDelivery = error && error.__sentry_own_request__ === true;
- if (!hasIntegration || shouldIgnoreOnError() || isFailedOwnDelivery) {
- return;
- }
- const client = currentHub.getClient();
- const event = isPrimitive(error)
- ? this._eventFromIncompleteOnError(data.msg, data.url, data.line, data.column)
- : this._enhanceEventWithInitialFrame(eventFromUnknownInput(error, undefined, {
- attachStacktrace: client && client.getOptions().attachStacktrace,
- rejection: false,
- }), data.url, data.line, data.column);
- addExceptionMechanism(event, {
- handled: false,
- type: 'onerror',
- });
- currentHub.captureEvent(event, {
- originalException: error,
- });
- },
- type: 'error',
- });
- this._onErrorHandlerInstalled = true;
- }
- /** JSDoc */
- _installGlobalOnUnhandledRejectionHandler() {
- if (this._onUnhandledRejectionHandlerInstalled) {
- return;
- }
- addInstrumentationHandler({
- callback: (e) => {
- let error = e;
- // dig the object of the rejection out of known event types
- try {
- // PromiseRejectionEvents store the object of the rejection under 'reason'
- // see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent
- if ('reason' in e) {
- error = e.reason;
- }
- // something, somewhere, (likely a browser extension) effectively casts PromiseRejectionEvents
- // to CustomEvents, moving the `promise` and `reason` attributes of the PRE into
- // the CustomEvent's `detail` attribute, since they're not part of CustomEvent's spec
- // see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent and
- // https://github.com/getsentry/sentry-javascript/issues/2380
- else if ('detail' in e && 'reason' in e.detail) {
- error = e.detail.reason;
- }
- }
- catch (_oO) {
- // no-empty
- }
- const currentHub = getCurrentHub();
- const hasIntegration = currentHub.getIntegration(GlobalHandlers);
- const isFailedOwnDelivery = error && error.__sentry_own_request__ === true;
- if (!hasIntegration || shouldIgnoreOnError() || isFailedOwnDelivery) {
- return true;
- }
- const client = currentHub.getClient();
- const event = isPrimitive(error)
- ? this._eventFromIncompleteRejection(error)
- : eventFromUnknownInput(error, undefined, {
- attachStacktrace: client && client.getOptions().attachStacktrace,
- rejection: true,
- });
- event.level = exports.Severity.Error;
- addExceptionMechanism(event, {
- handled: false,
- type: 'onunhandledrejection',
- });
- currentHub.captureEvent(event, {
- originalException: error,
- });
- return;
- },
- type: 'unhandledrejection',
- });
- this._onUnhandledRejectionHandlerInstalled = true;
- }
- /**
- * This function creates a stack from an old, error-less onerror handler.
- */
- _eventFromIncompleteOnError(msg, url, line, column) {
- const ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;
- // If 'message' is ErrorEvent, get real message from inside
- let message = isErrorEvent(msg) ? msg.message : msg;
- let name;
- if (isString(message)) {
- const groups = message.match(ERROR_TYPES_RE);
- if (groups) {
- name = groups[1];
- message = groups[2];
- }
- }
- const event = {
- exception: {
- values: [
- {
- type: name || 'Error',
- value: message,
- },
- ],
- },
- };
- return this._enhanceEventWithInitialFrame(event, url, line, column);
- }
- /**
- * This function creates an Event from an TraceKitStackTrace that has part of it missing.
- */
- _eventFromIncompleteRejection(error) {
- return {
- exception: {
- values: [
- {
- type: 'UnhandledRejection',
- value: `Non-Error promise rejection captured with value: ${error}`,
- },
- ],
- },
- };
- }
- /** JSDoc */
- _enhanceEventWithInitialFrame(event, url, line, column) {
- event.exception = event.exception || {};
- event.exception.values = event.exception.values || [];
- event.exception.values[0] = event.exception.values[0] || {};
- event.exception.values[0].stacktrace = event.exception.values[0].stacktrace || {};
- event.exception.values[0].stacktrace.frames = event.exception.values[0].stacktrace.frames || [];
- const colno = isNaN(parseInt(column, 10)) ? undefined : column;
- const lineno = isNaN(parseInt(line, 10)) ? undefined : line;
- const filename = isString(url) && url.length > 0 ? url : getLocationHref();
- if (event.exception.values[0].stacktrace.frames.length === 0) {
- event.exception.values[0].stacktrace.frames.push({
- colno,
- filename,
- function: '?',
- in_app: true,
- lineno,
- });
- }
- return event;
- }
- }
- /**
- * @inheritDoc
- */
- GlobalHandlers.id = 'GlobalHandlers';
-
- /** Wrap timer functions and event targets to catch errors and provide better meta data */
- class TryCatch {
- constructor() {
- /** JSDoc */
- this._ignoreOnError = 0;
- /**
- * @inheritDoc
- */
- this.name = TryCatch.id;
- }
- /** JSDoc */
- _wrapTimeFunction(original) {
- return function (...args) {
- const originalCallback = args[0];
- args[0] = wrap(originalCallback, {
- mechanism: {
- data: { function: getFunctionName(original) },
- handled: true,
- type: 'instrument',
- },
- });
- return original.apply(this, args);
- };
- }
- /** JSDoc */
- _wrapRAF(original) {
- return function (callback) {
- return original(wrap(callback, {
- mechanism: {
- data: {
- function: 'requestAnimationFrame',
- handler: getFunctionName(original),
- },
- handled: true,
- type: 'instrument',
- },
- }));
- };
- }
- /** JSDoc */
- _wrapEventTarget(target) {
- const global = getGlobalObject();
- const proto = global[target] && global[target].prototype;
- if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {
- return;
- }
- fill(proto, 'addEventListener', function (original) {
- return function (eventName, fn, options) {
- try {
- // tslint:disable-next-line:no-unbound-method strict-type-predicates
- if (typeof fn.handleEvent === 'function') {
- fn.handleEvent = wrap(fn.handleEvent.bind(fn), {
- mechanism: {
- data: {
- function: 'handleEvent',
- handler: getFunctionName(fn),
- target,
- },
- handled: true,
- type: 'instrument',
- },
- });
- }
- }
- catch (err) {
- // can sometimes get 'Permission denied to access property "handle Event'
- }
- return original.call(this, eventName, wrap(fn, {
- mechanism: {
- data: {
- function: 'addEventListener',
- handler: getFunctionName(fn),
- target,
- },
- handled: true,
- type: 'instrument',
- },
- }), options);
- };
- });
- fill(proto, 'removeEventListener', function (original) {
- return function (eventName, fn, options) {
- let callback = fn;
- try {
- callback = callback && (callback.__sentry_wrapped__ || callback);
- }
- catch (e) {
- // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments
- }
- return original.call(this, eventName, callback, options);
- };
- });
- }
- /** JSDoc */
- _wrapXHR(originalSend) {
- return function (...args) {
- const xhr = this; // tslint:disable-line:no-this-assignment
- const xmlHttpRequestProps = ['onload', 'onerror', 'onprogress', 'onreadystatechange'];
- xmlHttpRequestProps.forEach(prop => {
- if (prop in xhr && typeof xhr[prop] === 'function') {
- fill(xhr, prop, function (original) {
- const wrapOptions = {
- mechanism: {
- data: {
- function: prop,
- handler: getFunctionName(original),
- },
- handled: true,
- type: 'instrument',
- },
- };
- // If Instrument integration has been called before TryCatch, get the name of original function
- if (original.__sentry_original__) {
- wrapOptions.mechanism.data.handler = getFunctionName(original.__sentry_original__);
- }
- // Otherwise wrap directly
- return wrap(original, wrapOptions);
- });
- }
- });
- return originalSend.apply(this, args);
- };
- }
- /**
- * Wrap timer functions and event targets to catch errors
- * and provide better metadata.
- */
- setupOnce() {
- this._ignoreOnError = this._ignoreOnError;
- const global = getGlobalObject();
- fill(global, 'setTimeout', this._wrapTimeFunction.bind(this));
- fill(global, 'setInterval', this._wrapTimeFunction.bind(this));
- fill(global, 'requestAnimationFrame', this._wrapRAF.bind(this));
- if ('XMLHttpRequest' in global) {
- fill(XMLHttpRequest.prototype, 'send', this._wrapXHR.bind(this));
- }
- [
- 'EventTarget',
- 'Window',
- 'Node',
- 'ApplicationCache',
- 'AudioTrackList',
- 'ChannelMergerNode',
- 'CryptoOperation',
- 'EventSource',
- 'FileReader',
- 'HTMLUnknownElement',
- 'IDBDatabase',
- 'IDBRequest',
- 'IDBTransaction',
- 'KeyOperation',
- 'MediaController',
- 'MessagePort',
- 'ModalWindow',
- 'Notification',
- 'SVGElementInstance',
- 'Screen',
- 'TextTrack',
- 'TextTrackCue',
- 'TextTrackList',
- 'WebSocket',
- 'WebSocketWorker',
- 'Worker',
- 'XMLHttpRequest',
- 'XMLHttpRequestEventTarget',
- 'XMLHttpRequestUpload',
- ].forEach(this._wrapEventTarget.bind(this));
- }
- }
- /**
- * @inheritDoc
- */
- TryCatch.id = 'TryCatch';
-
- /**
- * Default Breadcrumbs instrumentations
- * TODO: Deprecated - with v6, this will be renamed to `Instrument`
- */
- class Breadcrumbs {
- /**
- * @inheritDoc
- */
- constructor(options) {
- /**
- * @inheritDoc
- */
- this.name = Breadcrumbs.id;
- this._options = Object.assign({ console: true, dom: true, fetch: true, history: true, sentry: true, xhr: true }, options);
- }
- /**
- * Creates breadcrumbs from console API calls
- */
- _consoleBreadcrumb(handlerData) {
- const breadcrumb = {
- category: 'console',
- data: {
- arguments: handlerData.args,
- logger: 'console',
- },
- level: exports.Severity.fromString(handlerData.level),
- message: safeJoin(handlerData.args, ' '),
- };
- if (handlerData.level === 'assert') {
- if (handlerData.args[0] === false) {
- breadcrumb.message = `Assertion failed: ${safeJoin(handlerData.args.slice(1), ' ') || 'console.assert'}`;
- breadcrumb.data.arguments = handlerData.args.slice(1);
- }
- else {
- // Don't capture a breadcrumb for passed assertions
- return;
- }
- }
- getCurrentHub().addBreadcrumb(breadcrumb, {
- input: handlerData.args,
- level: handlerData.level,
- });
- }
- /**
- * Creates breadcrumbs from DOM API calls
- */
- _domBreadcrumb(handlerData) {
- let target;
- // Accessing event.target can throw (see getsentry/raven-js#838, #768)
- try {
- target = handlerData.event.target
- ? htmlTreeAsString(handlerData.event.target)
- : htmlTreeAsString(handlerData.event);
- }
- catch (e) {
- target = '';
- }
- if (target.length === 0) {
- return;
- }
- getCurrentHub().addBreadcrumb({
- category: `ui.${handlerData.name}`,
- message: target,
- }, {
- event: handlerData.event,
- name: handlerData.name,
- });
- }
- /**
- * Creates breadcrumbs from XHR API calls
- */
- _xhrBreadcrumb(handlerData) {
- if (handlerData.endTimestamp) {
- // We only capture complete, non-sentry requests
- if (handlerData.xhr.__sentry_own_request__) {
- return;
- }
- getCurrentHub().addBreadcrumb({
- category: 'xhr',
- data: handlerData.xhr.__sentry_xhr__,
- type: 'http',
- }, {
- xhr: handlerData.xhr,
- });
- return;
- }
- // We only capture issued sentry requests
- if (handlerData.xhr.__sentry_own_request__) {
- addSentryBreadcrumb(handlerData.args[0]);
- }
- }
- /**
- * Creates breadcrumbs from fetch API calls
- */
- _fetchBreadcrumb(handlerData) {
- // We only capture complete fetch requests
- if (!handlerData.endTimestamp) {
- return;
- }
- const client = getCurrentHub().getClient();
- const dsn = client && client.getDsn();
- if (dsn) {
- const filterUrl = new API(dsn).getStoreEndpoint();
- // if Sentry key appears in URL, don't capture it as a request
- // but rather as our own 'sentry' type breadcrumb
- if (filterUrl &&
- handlerData.fetchData.url.indexOf(filterUrl) !== -1 &&
- handlerData.fetchData.method === 'POST' &&
- handlerData.args[1] &&
- handlerData.args[1].body) {
- addSentryBreadcrumb(handlerData.args[1].body);
- return;
- }
- }
- if (handlerData.error) {
- getCurrentHub().addBreadcrumb({
- category: 'fetch',
- data: Object.assign({}, handlerData.fetchData, { status_code: handlerData.response.status }),
- level: exports.Severity.Error,
- type: 'http',
- }, {
- data: handlerData.error,
- input: handlerData.args,
- });
- }
- else {
- getCurrentHub().addBreadcrumb({
- category: 'fetch',
- data: Object.assign({}, handlerData.fetchData, { status_code: handlerData.response.status }),
- type: 'http',
- }, {
- input: handlerData.args,
- response: handlerData.response,
- });
- }
- }
- /**
- * Creates breadcrumbs from history API calls
- */
- _historyBreadcrumb(handlerData) {
- const global = getGlobalObject();
- let from = handlerData.from;
- let to = handlerData.to;
- const parsedLoc = parseUrl(global.location.href);
- let parsedFrom = parseUrl(from);
- const parsedTo = parseUrl(to);
- // Initial pushState doesn't provide `from` information
- if (!parsedFrom.path) {
- parsedFrom = parsedLoc;
- }
- // Use only the path component of the URL if the URL matches the current
- // document (almost all the time when using pushState)
- if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {
- // tslint:disable-next-line:no-parameter-reassignment
- to = parsedTo.relative;
- }
- if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {
- // tslint:disable-next-line:no-parameter-reassignment
- from = parsedFrom.relative;
- }
- getCurrentHub().addBreadcrumb({
- category: 'navigation',
- data: {
- from,
- to,
- },
- });
- }
- /**
- * Instrument browser built-ins w/ breadcrumb capturing
- * - Console API
- * - DOM API (click/typing)
- * - XMLHttpRequest API
- * - Fetch API
- * - History API
- */
- setupOnce() {
- if (this._options.console) {
- addInstrumentationHandler({
- callback: (...args) => {
- this._consoleBreadcrumb(...args);
- },
- type: 'console',
- });
- }
- if (this._options.dom) {
- addInstrumentationHandler({
- callback: (...args) => {
- this._domBreadcrumb(...args);
- },
- type: 'dom',
- });
- }
- if (this._options.xhr) {
- addInstrumentationHandler({
- callback: (...args) => {
- this._xhrBreadcrumb(...args);
- },
- type: 'xhr',
- });
- }
- if (this._options.fetch) {
- addInstrumentationHandler({
- callback: (...args) => {
- this._fetchBreadcrumb(...args);
- },
- type: 'fetch',
- });
- }
- if (this._options.history) {
- addInstrumentationHandler({
- callback: (...args) => {
- this._historyBreadcrumb(...args);
- },
- type: 'history',
- });
- }
- }
- }
- /**
- * @inheritDoc
- */
- Breadcrumbs.id = 'Breadcrumbs';
- /**
- * Create a breadcrumb of `sentry` from the events themselves
- */
- function addSentryBreadcrumb(serializedData) {
- // There's always something that can go wrong with deserialization...
- try {
- const event = JSON.parse(serializedData);
- getCurrentHub().addBreadcrumb({
- category: `sentry.${event.type === 'transaction' ? 'transaction' : 'event'}`,
- event_id: event.event_id,
- level: event.level || exports.Severity.fromString('error'),
- message: getEventDescription(event),
- }, {
- event,
- });
- }
- catch (_oO) {
- logger.error('Error while adding sentry type breadcrumb');
- }
- }
-
- const DEFAULT_KEY = 'cause';
- const DEFAULT_LIMIT = 5;
- /** Adds SDK info to an event. */
- class LinkedErrors {
- /**
- * @inheritDoc
- */
- constructor(options = {}) {
- /**
- * @inheritDoc
- */
- this.name = LinkedErrors.id;
- this._key = options.key || DEFAULT_KEY;
- this._limit = options.limit || DEFAULT_LIMIT;
- }
- /**
- * @inheritDoc
- */
- setupOnce() {
- addGlobalEventProcessor((event, hint) => {
- const self = getCurrentHub().getIntegration(LinkedErrors);
- if (self) {
- return self._handler(event, hint);
- }
- return event;
- });
- }
- /**
- * @inheritDoc
- */
- _handler(event, hint) {
- if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) {
- return event;
- }
- const linkedErrors = this._walkErrorTree(hint.originalException, this._key);
- event.exception.values = [...linkedErrors, ...event.exception.values];
- return event;
- }
- /**
- * @inheritDoc
- */
- _walkErrorTree(error, key, stack = []) {
- if (!isInstanceOf(error[key], Error) || stack.length + 1 >= this._limit) {
- return stack;
- }
- const stacktrace = computeStackTrace(error[key]);
- const exception = exceptionFromStacktrace(stacktrace);
- return this._walkErrorTree(error[key], key, [exception, ...stack]);
- }
- }
- /**
- * @inheritDoc
- */
- LinkedErrors.id = 'LinkedErrors';
-
- const global$4 = getGlobalObject();
- /** UserAgent */
- class UserAgent {
- constructor() {
- /**
- * @inheritDoc
- */
- this.name = UserAgent.id;
- }
- /**
- * @inheritDoc
- */
- setupOnce() {
- addGlobalEventProcessor((event) => {
- if (getCurrentHub().getIntegration(UserAgent)) {
- if (!global$4.navigator || !global$4.location) {
- return event;
- }
- // Request Interface: https://docs.sentry.io/development/sdk-dev/event-payloads/request/
- const request = event.request || {};
- request.url = request.url || global$4.location.href;
- request.headers = request.headers || {};
- request.headers['User-Agent'] = global$4.navigator.userAgent;
- return Object.assign({}, event, { request });
- }
- return event;
- });
- }
- }
- /**
- * @inheritDoc
- */
- UserAgent.id = 'UserAgent';
-
-
-
- var BrowserIntegrations = /*#__PURE__*/Object.freeze({
- GlobalHandlers: GlobalHandlers,
- TryCatch: TryCatch,
- Breadcrumbs: Breadcrumbs,
- LinkedErrors: LinkedErrors,
- UserAgent: UserAgent
- });
-
- const defaultIntegrations = [
- new InboundFilters(),
- new FunctionToString(),
- new TryCatch(),
- new Breadcrumbs(),
- new GlobalHandlers(),
- new LinkedErrors(),
- new UserAgent(),
- ];
- /**
- * The Sentry Browser SDK Client.
- *
- * To use this SDK, call the {@link init} function as early as possible when
- * loading the web page. To set context information or send manual events, use
- * the provided methods.
- *
- * @example
- *
- * ```
- *
- * import { init } from '@sentry/browser';
- *
- * init({
- * dsn: '__DSN__',
- * // ...
- * });
- * ```
- *
- * @example
- * ```
- *
- * import { configureScope } from '@sentry/browser';
- * configureScope((scope: Scope) => {
- * scope.setExtra({ battery: 0.7 });
- * scope.setTag({ user_mode: 'admin' });
- * scope.setUser({ id: '4711' });
- * });
- * ```
- *
- * @example
- * ```
- *
- * import { addBreadcrumb } from '@sentry/browser';
- * addBreadcrumb({
- * message: 'My Breadcrumb',
- * // ...
- * });
- * ```
- *
- * @example
- *
- * ```
- *
- * import * as Sentry from '@sentry/browser';
- * Sentry.captureMessage('Hello, world!');
- * Sentry.captureException(new Error('Good bye'));
- * Sentry.captureEvent({
- * message: 'Manual',
- * stacktrace: [
- * // ...
- * ],
- * });
- * ```
- *
- * @see {@link BrowserOptions} for documentation on configuration options.
- */
- function init(options = {}) {
- if (options.defaultIntegrations === undefined) {
- options.defaultIntegrations = defaultIntegrations;
- }
- if (options.release === undefined) {
- const window = getGlobalObject();
- // This supports the variable that sentry-webpack-plugin injects
- if (window.SENTRY_RELEASE && window.SENTRY_RELEASE.id) {
- options.release = window.SENTRY_RELEASE.id;
- }
- }
- initAndBind(BrowserClient, options);
- }
- /**
- * Present the user with a report dialog.
- *
- * @param options Everything is optional, we try to fetch all info need from the global scope.
- */
- function showReportDialog(options = {}) {
- if (!options.eventId) {
- options.eventId = getCurrentHub().lastEventId();
- }
- const client = getCurrentHub().getClient();
- if (client) {
- client.showReportDialog(options);
- }
- }
- /**
- * This is the getter for lastEventId.
- *
- * @returns The last event id of a captured event.
- */
- function lastEventId() {
- return getCurrentHub().lastEventId();
- }
- /**
- * This function is here to be API compatible with the loader.
- * @hidden
- */
- function forceLoad() {
- // Noop
- }
- /**
- * This function is here to be API compatible with the loader.
- * @hidden
- */
- function onLoad(callback) {
- callback();
- }
- /**
- * A promise that resolves when all current events have been sent.
- * If you provide a timeout and the queue takes longer to drain the promise returns false.
- *
- * @param timeout Maximum time in ms the client should wait.
- */
- function flush(timeout) {
- const client = getCurrentHub().getClient();
- if (client) {
- return client.flush(timeout);
- }
- return SyncPromise.reject(false);
- }
- /**
- * A promise that resolves when all current events have been sent.
- * If you provide a timeout and the queue takes longer to drain the promise returns false.
- *
- * @param timeout Maximum time in ms the client should wait.
- */
- function close(timeout) {
- const client = getCurrentHub().getClient();
- if (client) {
- return client.close(timeout);
- }
- return SyncPromise.reject(false);
- }
- /**
- * Wrap code within a try/catch block so the SDK is able to capture errors.
- *
- * @param fn A function to wrap.
- *
- * @returns The result of wrapped function call.
- */
- function wrap$1(fn) {
- return wrap(fn)(); // tslint:disable-line:no-unsafe-any
- }
-
- let windowIntegrations = {};
- // This block is needed to add compatibility with the integrations packages when used with a CDN
- // tslint:disable: no-unsafe-any
- const _window = getGlobalObject();
- if (_window.Sentry && _window.Sentry.Integrations) {
- windowIntegrations = _window.Sentry.Integrations;
- }
- // tslint:enable: no-unsafe-any
- const INTEGRATIONS = Object.assign({}, windowIntegrations, CoreIntegrations, BrowserIntegrations);
-
- exports.BrowserClient = BrowserClient;
- exports.Hub = Hub;
- exports.Integrations = INTEGRATIONS;
- exports.SDK_NAME = SDK_NAME;
- exports.SDK_VERSION = SDK_VERSION;
- exports.Scope = Scope;
- exports.Transports = index;
- exports.addBreadcrumb = addBreadcrumb;
- exports.addGlobalEventProcessor = addGlobalEventProcessor;
- exports.captureEvent = captureEvent;
- exports.captureException = captureException;
- exports.captureMessage = captureMessage;
- exports.close = close;
- exports.configureScope = configureScope;
- exports.defaultIntegrations = defaultIntegrations;
- exports.flush = flush;
- exports.forceLoad = forceLoad;
- exports.getCurrentHub = getCurrentHub;
- exports.getHubFromCarrier = getHubFromCarrier;
- exports.init = init;
- exports.lastEventId = lastEventId;
- exports.onLoad = onLoad;
- exports.setContext = setContext;
- exports.setExtra = setExtra;
- exports.setExtras = setExtras;
- exports.setTag = setTag;
- exports.setTags = setTags;
- exports.setUser = setUser;
- exports.showReportDialog = showReportDialog;
- exports.withScope = withScope;
- exports.wrap = wrap$1;
-
- return exports;
-
-}({}));
-//# sourceMappingURL=bundle.es6.js.map
diff --git a/node_modules/@sentry/browser/build/bundle.es6.js.map b/node_modules/@sentry/browser/build/bundle.es6.js.map
deleted file mode 100644
index e8f2be8..0000000
--- a/node_modules/@sentry/browser/build/bundle.es6.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"bundle.es6.js","sources":["../../types/src/loglevel.ts","../../types/src/severity.ts","../../types/src/span.ts","../../types/src/status.ts","../../utils/src/async.ts","../../utils/src/polyfill.ts","../../utils/src/error.ts","../../utils/src/is.ts","../../utils/src/string.ts","../../utils/src/misc.ts","../../utils/src/logger.ts","../../utils/src/memo.ts","../../utils/src/object.ts","../../utils/src/path.ts","../../utils/src/syncpromise.ts","../../utils/src/promisebuffer.ts","../../utils/src/supports.ts","../../utils/src/instrument.ts","../../utils/src/dsn.ts","../../hub/src/scope.ts","../../hub/src/hub.ts","../../minimal/src/index.ts","../../core/src/api.ts","../../core/src/integration.ts","../../core/src/baseclient.ts","../../core/src/transports/noop.ts","../../core/src/basebackend.ts","../../core/src/sdk.ts","../../core/src/integrations/functiontostring.ts","../../core/src/integrations/inboundfilters.ts","../src/tracekit.ts","../src/parsers.ts","../src/eventbuilder.ts","../src/transports/base.ts","../src/transports/fetch.ts","../src/transports/xhr.ts","../src/backend.ts","../src/version.ts","../src/client.ts","../src/helpers.ts","../src/integrations/globalhandlers.ts","../src/integrations/trycatch.ts","../src/integrations/breadcrumbs.ts","../src/integrations/linkederrors.ts","../src/integrations/useragent.ts","../src/sdk.ts","../src/index.ts"],"sourcesContent":["/** Console logging verbosity for the SDK. */\nexport enum LogLevel {\n /** No logs will be generated. */\n None = 0,\n /** Only SDK internal errors will be logged. */\n Error = 1,\n /** Information useful for debugging the SDK will be logged. */\n Debug = 2,\n /** All SDK actions will be logged. */\n Verbose = 3,\n}\n","/** JSDoc */\nexport enum Severity {\n /** JSDoc */\n Fatal = 'fatal',\n /** JSDoc */\n Error = 'error',\n /** JSDoc */\n Warning = 'warning',\n /** JSDoc */\n Log = 'log',\n /** JSDoc */\n Info = 'info',\n /** JSDoc */\n Debug = 'debug',\n /** JSDoc */\n Critical = 'critical',\n}\n// tslint:disable:completed-docs\n// tslint:disable:no-unnecessary-qualifier no-namespace\nexport namespace Severity {\n /**\n * Converts a string-based level into a {@link Severity}.\n *\n * @param level string representation of Severity\n * @returns Severity\n */\n export function fromString(level: string): Severity {\n switch (level) {\n case 'debug':\n return Severity.Debug;\n case 'info':\n return Severity.Info;\n case 'warn':\n case 'warning':\n return Severity.Warning;\n case 'error':\n return Severity.Error;\n case 'fatal':\n return Severity.Fatal;\n case 'critical':\n return Severity.Critical;\n case 'log':\n default:\n return Severity.Log;\n }\n }\n}\n","/** Span holding trace_id, span_id */\nexport interface Span {\n /** Sets the finish timestamp on the current span and sends it if it was a transaction */\n finish(useLastSpanTimestamp?: boolean): string | undefined;\n /** Return a traceparent compatible header string */\n toTraceparent(): string;\n /** Convert the object to JSON for w. spans array info only */\n getTraceContext(): object;\n /** Convert the object to JSON */\n toJSON(): object;\n\n /**\n * Sets the tag attribute on the current span\n * @param key Tag key\n * @param value Tag value\n */\n setTag(key: string, value: string): this;\n\n /**\n * Sets the data attribute on the current span\n * @param key Data key\n * @param value Data value\n */\n setData(key: string, value: any): this;\n\n /**\n * Sets the status attribute on the current span\n * @param status http code used to set the status\n */\n setStatus(status: SpanStatus): this;\n\n /**\n * Sets the status attribute on the current span based on the http code\n * @param httpStatus http code used to set the status\n */\n setHttpStatus(httpStatus: number): this;\n\n /**\n * Determines whether span was successful (HTTP200)\n */\n isSuccess(): boolean;\n}\n\n/** Interface holder all properties that can be set on a Span on creation. */\nexport interface SpanContext {\n /**\n * Description of the Span.\n */\n description?: string;\n /**\n * Operation of the Span.\n */\n op?: string;\n /**\n * Completion status of the Span.\n */\n status?: SpanStatus;\n /**\n * Parent Span ID\n */\n parentSpanId?: string;\n /**\n * Has the sampling decision been made?\n */\n sampled?: boolean;\n /**\n * Span ID\n */\n spanId?: string;\n /**\n * Trace ID\n */\n traceId?: string;\n /**\n * Transaction of the Span.\n */\n transaction?: string;\n /**\n * Tags of the Span.\n */\n tags?: { [key: string]: string };\n\n /**\n * Data of the Span.\n */\n data?: { [key: string]: any };\n}\n\n/** The status of an Span. */\nexport enum SpanStatus {\n /** The operation completed successfully. */\n Ok = 'ok',\n /** Deadline expired before operation could complete. */\n DeadlineExceeded = 'deadline_exceeded',\n /** 401 Unauthorized (actually does mean unauthenticated according to RFC 7235) */\n Unauthenticated = 'unauthenticated',\n /** 403 Forbidden */\n PermissionDenied = 'permission_denied',\n /** 404 Not Found. Some requested entity (file or directory) was not found. */\n NotFound = 'not_found',\n /** 429 Too Many Requests */\n ResourceExhausted = 'resource_exhausted',\n /** Client specified an invalid argument. 4xx. */\n InvalidArgument = 'invalid_argument',\n /** 501 Not Implemented */\n Unimplemented = 'unimplemented',\n /** 503 Service Unavailable */\n Unavailable = 'unavailable',\n /** Other/generic 5xx. */\n InternalError = 'internal_error',\n /** Unknown. Any non-standard HTTP status code. */\n UnknownError = 'unknown_error',\n /** The operation was cancelled (typically by the user). */\n Cancelled = 'cancelled',\n /** Already exists (409) */\n AlreadyExists = 'already_exists',\n /** Operation was rejected because the system is not in a state required for the operation's */\n FailedPrecondition = 'failed_precondition',\n /** The operation was aborted, typically due to a concurrency issue. */\n Aborted = 'aborted',\n /** Operation was attempted past the valid range. */\n OutOfRange = 'out_of_range',\n /** Unrecoverable data loss or corruption */\n DataLoss = 'data_loss',\n}\n\n// tslint:disable:no-unnecessary-qualifier no-namespace\nexport namespace SpanStatus {\n /**\n * Converts a HTTP status code into a {@link SpanStatus}.\n *\n * @param httpStatus The HTTP response status code.\n * @returns The span status or {@link SpanStatus.UnknownError}.\n */\n // tslint:disable-next-line:completed-docs\n export function fromHttpCode(httpStatus: number): SpanStatus {\n if (httpStatus < 400) {\n return SpanStatus.Ok;\n }\n\n if (httpStatus >= 400 && httpStatus < 500) {\n switch (httpStatus) {\n case 401:\n return SpanStatus.Unauthenticated;\n case 403:\n return SpanStatus.PermissionDenied;\n case 404:\n return SpanStatus.NotFound;\n case 409:\n return SpanStatus.AlreadyExists;\n case 413:\n return SpanStatus.FailedPrecondition;\n case 429:\n return SpanStatus.ResourceExhausted;\n default:\n return SpanStatus.InvalidArgument;\n }\n }\n\n if (httpStatus >= 500 && httpStatus < 600) {\n switch (httpStatus) {\n case 501:\n return SpanStatus.Unimplemented;\n case 503:\n return SpanStatus.Unavailable;\n case 504:\n return SpanStatus.DeadlineExceeded;\n default:\n return SpanStatus.InternalError;\n }\n }\n\n return SpanStatus.UnknownError;\n }\n}\n","/** The status of an event. */\nexport enum Status {\n /** The status could not be determined. */\n Unknown = 'unknown',\n /** The event was skipped due to configuration or callbacks. */\n Skipped = 'skipped',\n /** The event was sent to Sentry successfully. */\n Success = 'success',\n /** The client is currently rate limited and will try again later. */\n RateLimit = 'rate_limit',\n /** The event could not be processed. */\n Invalid = 'invalid',\n /** A server-side error ocurred during submission. */\n Failed = 'failed',\n}\n// tslint:disable:completed-docs\n// tslint:disable:no-unnecessary-qualifier no-namespace\nexport namespace Status {\n /**\n * Converts a HTTP status code into a {@link Status}.\n *\n * @param code The HTTP response status code.\n * @returns The send status or {@link Status.Unknown}.\n */\n export function fromHttpCode(code: number): Status {\n if (code >= 200 && code < 300) {\n return Status.Success;\n }\n\n if (code === 429) {\n return Status.RateLimit;\n }\n\n if (code >= 400 && code < 500) {\n return Status.Invalid;\n }\n\n if (code >= 500) {\n return Status.Failed;\n }\n\n return Status.Unknown;\n }\n}\n","/**\n * Consumes the promise and logs the error when it rejects.\n * @param promise A promise to forget.\n */\nexport function forget(promise: PromiseLike): void {\n promise.then(null, e => {\n // TODO: Use a better logging mechanism\n console.error(e);\n });\n}\n","export const setPrototypeOf =\n Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties); // tslint:disable-line:no-unbound-method\n\n/**\n * setPrototypeOf polyfill using __proto__\n */\nfunction setProtoOf(obj: TTarget, proto: TProto): TTarget & TProto {\n // @ts-ignore\n obj.__proto__ = proto;\n return obj as TTarget & TProto;\n}\n\n/**\n * setPrototypeOf polyfill using mixin\n */\nfunction mixinProperties(obj: TTarget, proto: TProto): TTarget & TProto {\n for (const prop in proto) {\n if (!obj.hasOwnProperty(prop)) {\n // @ts-ignore\n obj[prop] = proto[prop];\n }\n }\n\n return obj as TTarget & TProto;\n}\n","import { setPrototypeOf } from './polyfill';\n\n/** An error emitted by Sentry SDKs and related utilities. */\nexport class SentryError extends Error {\n /** Display name of this error instance. */\n public name: string;\n\n public constructor(public message: string) {\n super(message);\n\n // tslint:disable:no-unsafe-any\n this.name = new.target.prototype.constructor.name;\n setPrototypeOf(this, new.target.prototype);\n }\n}\n","/**\n * Checks whether given value's type is one of a few Error or Error-like\n * {@link isError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isError(wat: any): boolean {\n switch (Object.prototype.toString.call(wat)) {\n case '[object Error]':\n return true;\n case '[object Exception]':\n return true;\n case '[object DOMException]':\n return true;\n default:\n return isInstanceOf(wat, Error);\n }\n}\n\n/**\n * Checks whether given value's type is ErrorEvent\n * {@link isErrorEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isErrorEvent(wat: any): boolean {\n return Object.prototype.toString.call(wat) === '[object ErrorEvent]';\n}\n\n/**\n * Checks whether given value's type is DOMError\n * {@link isDOMError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isDOMError(wat: any): boolean {\n return Object.prototype.toString.call(wat) === '[object DOMError]';\n}\n\n/**\n * Checks whether given value's type is DOMException\n * {@link isDOMException}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isDOMException(wat: any): boolean {\n return Object.prototype.toString.call(wat) === '[object DOMException]';\n}\n\n/**\n * Checks whether given value's type is a string\n * {@link isString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isString(wat: any): boolean {\n return Object.prototype.toString.call(wat) === '[object String]';\n}\n\n/**\n * Checks whether given value's is a primitive (undefined, null, number, boolean, string)\n * {@link isPrimitive}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isPrimitive(wat: any): boolean {\n return wat === null || (typeof wat !== 'object' && typeof wat !== 'function');\n}\n\n/**\n * Checks whether given value's type is an object literal\n * {@link isPlainObject}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isPlainObject(wat: any): boolean {\n return Object.prototype.toString.call(wat) === '[object Object]';\n}\n\n/**\n * Checks whether given value's type is an Event instance\n * {@link isEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isEvent(wat: any): boolean {\n // tslint:disable-next-line:strict-type-predicates\n return typeof Event !== 'undefined' && isInstanceOf(wat, Event);\n}\n\n/**\n * Checks whether given value's type is an Element instance\n * {@link isElement}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isElement(wat: any): boolean {\n // tslint:disable-next-line:strict-type-predicates\n return typeof Element !== 'undefined' && isInstanceOf(wat, Element);\n}\n\n/**\n * Checks whether given value's type is an regexp\n * {@link isRegExp}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isRegExp(wat: any): boolean {\n return Object.prototype.toString.call(wat) === '[object RegExp]';\n}\n\n/**\n * Checks whether given value has a then function.\n * @param wat A value to be checked.\n */\nexport function isThenable(wat: any): boolean {\n // tslint:disable:no-unsafe-any\n return Boolean(wat && wat.then && typeof wat.then === 'function');\n // tslint:enable:no-unsafe-any\n}\n\n/**\n * Checks whether given value's type is a SyntheticEvent\n * {@link isSyntheticEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isSyntheticEvent(wat: any): boolean {\n // tslint:disable-next-line:no-unsafe-any\n return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;\n}\n/**\n * Checks whether given value's type is an instance of provided constructor.\n * {@link isInstanceOf}.\n *\n * @param wat A value to be checked.\n * @param base A constructor to be used in a check.\n * @returns A boolean representing the result.\n */\nexport function isInstanceOf(wat: any, base: any): boolean {\n try {\n // tslint:disable-next-line:no-unsafe-any\n return wat instanceof base;\n } catch (_e) {\n return false;\n }\n}\n","import { isRegExp } from './is';\n\n/**\n * Truncates given string to the maximum characters count\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string\n * @returns string Encoded\n */\nexport function truncate(str: string, max: number = 0): string {\n // tslint:disable-next-line:strict-type-predicates\n if (typeof str !== 'string' || max === 0) {\n return str;\n }\n return str.length <= max ? str : `${str.substr(0, max)}...`;\n}\n\n/**\n * This is basically just `trim_line` from\n * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string\n * @returns string Encoded\n */\n\nexport function snipLine(line: string, colno: number): string {\n let newLine = line;\n const ll = newLine.length;\n if (ll <= 150) {\n return newLine;\n }\n if (colno > ll) {\n colno = ll; // tslint:disable-line:no-parameter-reassignment\n }\n\n let start = Math.max(colno - 60, 0);\n if (start < 5) {\n start = 0;\n }\n\n let end = Math.min(start + 140, ll);\n if (end > ll - 5) {\n end = ll;\n }\n if (end === ll) {\n start = Math.max(end - 140, 0);\n }\n\n newLine = newLine.slice(start, end);\n if (start > 0) {\n newLine = `'{snip} ${newLine}`;\n }\n if (end < ll) {\n newLine += ' {snip}';\n }\n\n return newLine;\n}\n\n/**\n * Join values in array\n * @param input array of values to be joined together\n * @param delimiter string to be placed in-between values\n * @returns Joined values\n */\nexport function safeJoin(input: any[], delimiter?: string): string {\n if (!Array.isArray(input)) {\n return '';\n }\n\n const output = [];\n // tslint:disable-next-line:prefer-for-of\n for (let i = 0; i < input.length; i++) {\n const value = input[i];\n try {\n output.push(String(value));\n } catch (e) {\n output.push('[value cannot be serialized]');\n }\n }\n\n return output.join(delimiter);\n}\n\n/**\n * Checks if the value matches a regex or includes the string\n * @param value The string value to be checked against\n * @param pattern Either a regex or a string that must be contained in value\n */\nexport function isMatchingPattern(value: string, pattern: RegExp | string): boolean {\n if (isRegExp(pattern)) {\n return (pattern as RegExp).test(value);\n }\n if (typeof pattern === 'string') {\n return value.indexOf(pattern) !== -1;\n }\n return false;\n}\n","import { Event, Integration, StackFrame, WrappedFunction } from '@sentry/types';\n\nimport { isString } from './is';\nimport { snipLine } from './string';\n\n/** Internal */\ninterface SentryGlobal {\n Sentry?: {\n Integrations?: Integration[];\n };\n SENTRY_ENVIRONMENT?: string;\n SENTRY_DSN?: string;\n SENTRY_RELEASE?: {\n id?: string;\n };\n __SENTRY__: {\n globalEventProcessors: any;\n hub: any;\n logger: any;\n };\n}\n\n/**\n * Requires a module which is protected _against bundler minification.\n *\n * @param request The module path to resolve\n */\nexport function dynamicRequire(mod: any, request: string): any {\n // tslint:disable-next-line: no-unsafe-any\n return mod.require(request);\n}\n\n/**\n * Checks whether we're in the Node.js or Browser environment\n *\n * @returns Answer to given question\n */\nexport function isNodeEnv(): boolean {\n // tslint:disable:strict-type-predicates\n return Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]';\n}\n\nconst fallbackGlobalObject = {};\n\n/**\n * Safely get global scope object\n *\n * @returns Global scope object\n */\nexport function getGlobalObject(): T & SentryGlobal {\n return (isNodeEnv()\n ? global\n : typeof window !== 'undefined'\n ? window\n : typeof self !== 'undefined'\n ? self\n : fallbackGlobalObject) as T & SentryGlobal;\n}\n// tslint:enable:strict-type-predicates\n\n/**\n * Extended Window interface that allows for Crypto API usage in IE browsers\n */\ninterface MsCryptoWindow extends Window {\n msCrypto?: Crypto;\n}\n\n/**\n * UUID4 generator\n *\n * @returns string Generated UUID4.\n */\nexport function uuid4(): string {\n const global = getGlobalObject() as MsCryptoWindow;\n const crypto = global.crypto || global.msCrypto;\n\n if (!(crypto === void 0) && crypto.getRandomValues) {\n // Use window.crypto API if available\n const arr = new Uint16Array(8);\n crypto.getRandomValues(arr);\n\n // set 4 in byte 7\n // tslint:disable-next-line:no-bitwise\n arr[3] = (arr[3] & 0xfff) | 0x4000;\n // set 2 most significant bits of byte 9 to '10'\n // tslint:disable-next-line:no-bitwise\n arr[4] = (arr[4] & 0x3fff) | 0x8000;\n\n const pad = (num: number): string => {\n let v = num.toString(16);\n while (v.length < 4) {\n v = `0${v}`;\n }\n return v;\n };\n\n return (\n pad(arr[0]) + pad(arr[1]) + pad(arr[2]) + pad(arr[3]) + pad(arr[4]) + pad(arr[5]) + pad(arr[6]) + pad(arr[7])\n );\n }\n // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523\n return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, c => {\n // tslint:disable-next-line:no-bitwise\n const r = (Math.random() * 16) | 0;\n // tslint:disable-next-line:no-bitwise\n const v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}\n\n/**\n * Parses string form of URL into an object\n * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B\n * // intentionally using regex and not href parsing trick because React Native and other\n * // environments where DOM might not be available\n * @returns parsed URL object\n */\nexport function parseUrl(\n url: string,\n): {\n host?: string;\n path?: string;\n protocol?: string;\n relative?: string;\n} {\n if (!url) {\n return {};\n }\n\n const match = url.match(/^(([^:\\/?#]+):)?(\\/\\/([^\\/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n\n if (!match) {\n return {};\n }\n\n // coerce to undefined values to empty string so we don't get 'undefined'\n const query = match[6] || '';\n const fragment = match[8] || '';\n return {\n host: match[4],\n path: match[5],\n protocol: match[2],\n relative: match[5] + query + fragment, // everything minus origin\n };\n}\n\n/**\n * Extracts either message or type+value from an event that can be used for user-facing logs\n * @returns event's description\n */\nexport function getEventDescription(event: Event): string {\n if (event.message) {\n return event.message;\n }\n if (event.exception && event.exception.values && event.exception.values[0]) {\n const exception = event.exception.values[0];\n\n if (exception.type && exception.value) {\n return `${exception.type}: ${exception.value}`;\n }\n return exception.type || exception.value || event.event_id || '';\n }\n return event.event_id || '';\n}\n\n/** JSDoc */\ninterface ExtensibleConsole extends Console {\n [key: string]: any;\n}\n\n/** JSDoc */\nexport function consoleSandbox(callback: () => any): any {\n const global = getGlobalObject();\n const levels = ['debug', 'info', 'warn', 'error', 'log', 'assert'];\n\n if (!('console' in global)) {\n return callback();\n }\n\n const originalConsole = global.console as ExtensibleConsole;\n const wrappedLevels: { [key: string]: any } = {};\n\n // Restore all wrapped console methods\n levels.forEach(level => {\n if (level in global.console && (originalConsole[level] as WrappedFunction).__sentry_original__) {\n wrappedLevels[level] = originalConsole[level] as WrappedFunction;\n originalConsole[level] = (originalConsole[level] as WrappedFunction).__sentry_original__;\n }\n });\n\n // Perform callback manipulations\n const result = callback();\n\n // Revert restoration to wrapped state\n Object.keys(wrappedLevels).forEach(level => {\n originalConsole[level] = wrappedLevels[level];\n });\n\n return result;\n}\n\n/**\n * Adds exception values, type and value to an synthetic Exception.\n * @param event The event to modify.\n * @param value Value of the exception.\n * @param type Type of the exception.\n * @hidden\n */\nexport function addExceptionTypeValue(event: Event, value?: string, type?: string): void {\n event.exception = event.exception || {};\n event.exception.values = event.exception.values || [];\n event.exception.values[0] = event.exception.values[0] || {};\n event.exception.values[0].value = event.exception.values[0].value || value || '';\n event.exception.values[0].type = event.exception.values[0].type || type || 'Error';\n}\n\n/**\n * Adds exception mechanism to a given event.\n * @param event The event to modify.\n * @param mechanism Mechanism of the mechanism.\n * @hidden\n */\nexport function addExceptionMechanism(\n event: Event,\n mechanism: {\n [key: string]: any;\n } = {},\n): void {\n // TODO: Use real type with `keyof Mechanism` thingy and maybe make it better?\n try {\n // @ts-ignore\n // tslint:disable:no-non-null-assertion\n event.exception!.values![0].mechanism = event.exception!.values![0].mechanism || {};\n Object.keys(mechanism).forEach(key => {\n // @ts-ignore\n event.exception!.values![0].mechanism[key] = mechanism[key];\n });\n } catch (_oO) {\n // no-empty\n }\n}\n\n/**\n * A safe form of location.href\n */\nexport function getLocationHref(): string {\n try {\n return document.location.href;\n } catch (oO) {\n return '';\n }\n}\n\n/**\n * Given a child DOM element, returns a query-selector statement describing that\n * and its ancestors\n * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nexport function htmlTreeAsString(elem: unknown): string {\n type SimpleNode = {\n parentNode: SimpleNode;\n } | null;\n\n // try/catch both:\n // - accessing event.target (see getsentry/raven-js#838, #768)\n // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly\n // - can throw an exception in some circumstances.\n try {\n let currentElem = elem as SimpleNode;\n const MAX_TRAVERSE_HEIGHT = 5;\n const MAX_OUTPUT_LEN = 80;\n const out = [];\n let height = 0;\n let len = 0;\n const separator = ' > ';\n const sepLength = separator.length;\n let nextStr;\n\n while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {\n nextStr = _htmlElementAsString(currentElem);\n // bail out if\n // - nextStr is the 'html' element\n // - the length of the string that would be created exceeds MAX_OUTPUT_LEN\n // (ignore this limit if we are on the first iteration)\n if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)) {\n break;\n }\n\n out.push(nextStr);\n\n len += nextStr.length;\n currentElem = currentElem.parentNode;\n }\n\n return out.reverse().join(separator);\n } catch (_oO) {\n return '';\n }\n}\n\n/**\n * Returns a simple, query-selector representation of a DOM element\n * e.g. [HTMLElement] => input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nfunction _htmlElementAsString(el: unknown): string {\n const elem = el as {\n getAttribute(key: string): string; // tslint:disable-line:completed-docs\n tagName?: string;\n id?: string;\n className?: string;\n };\n\n const out = [];\n let className;\n let classes;\n let key;\n let attr;\n let i;\n\n if (!elem || !elem.tagName) {\n return '';\n }\n\n out.push(elem.tagName.toLowerCase());\n if (elem.id) {\n out.push(`#${elem.id}`);\n }\n\n className = elem.className;\n if (className && isString(className)) {\n classes = className.split(/\\s+/);\n for (i = 0; i < classes.length; i++) {\n out.push(`.${classes[i]}`);\n }\n }\n const attrWhitelist = ['type', 'name', 'title', 'alt'];\n for (i = 0; i < attrWhitelist.length; i++) {\n key = attrWhitelist[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.push(`[${key}=\"${attr}\"]`);\n }\n }\n return out.join('');\n}\n\nconst INITIAL_TIME = Date.now();\nlet prevNow = 0;\n\nconst performanceFallback: Pick = {\n now(): number {\n let now = Date.now() - INITIAL_TIME;\n if (now < prevNow) {\n now = prevNow;\n }\n prevNow = now;\n return now;\n },\n timeOrigin: INITIAL_TIME,\n};\n\nexport const crossPlatformPerformance: Pick = (() => {\n if (isNodeEnv()) {\n try {\n const perfHooks = dynamicRequire(module, 'perf_hooks') as { performance: Performance };\n return perfHooks.performance;\n } catch (_) {\n return performanceFallback;\n }\n }\n\n if (getGlobalObject().performance) {\n // Polyfill for performance.timeOrigin.\n //\n // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin\n // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing.\n // tslint:disable-next-line:strict-type-predicates\n if (performance.timeOrigin === undefined) {\n // For webworkers it could mean we don't have performance.timing then we fallback\n // tslint:disable-next-line:deprecation\n if (!performance.timing) {\n return performanceFallback;\n }\n // tslint:disable-next-line:deprecation\n if (!performance.timing.navigationStart) {\n return performanceFallback;\n }\n\n // @ts-ignore\n // tslint:disable-next-line:deprecation\n performance.timeOrigin = performance.timing.navigationStart;\n }\n }\n\n return getGlobalObject().performance || performanceFallback;\n})();\n\n/**\n * Returns a timestamp in seconds with milliseconds precision since the UNIX epoch calculated with the monotonic clock.\n */\nexport function timestampWithMs(): number {\n return (crossPlatformPerformance.timeOrigin + crossPlatformPerformance.now()) / 1000;\n}\n\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nconst SEMVER_REGEXP = /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\n\n/**\n * Represents Semantic Versioning object\n */\ninterface SemVer {\n major?: number;\n minor?: number;\n patch?: number;\n prerelease?: string;\n buildmetadata?: string;\n}\n\n/**\n * Parses input into a SemVer interface\n * @param input string representation of a semver version\n */\nexport function parseSemver(input: string): SemVer {\n const match = input.match(SEMVER_REGEXP) || [];\n const major = parseInt(match[1], 10);\n const minor = parseInt(match[2], 10);\n const patch = parseInt(match[3], 10);\n return {\n buildmetadata: match[5],\n major: isNaN(major) ? undefined : major,\n minor: isNaN(minor) ? undefined : minor,\n patch: isNaN(patch) ? undefined : patch,\n prerelease: match[4],\n };\n}\n\nconst defaultRetryAfter = 60 * 1000; // 60 seconds\n\n/**\n * Extracts Retry-After value from the request header or returns default value\n * @param now current unix timestamp\n * @param header string representation of 'Retry-After' header\n */\nexport function parseRetryAfterHeader(now: number, header?: string | number | null): number {\n if (!header) {\n return defaultRetryAfter;\n }\n\n const headerDelay = parseInt(`${header}`, 10);\n if (!isNaN(headerDelay)) {\n return headerDelay * 1000;\n }\n\n const headerDate = Date.parse(`${header}`);\n if (!isNaN(headerDate)) {\n return headerDate - now;\n }\n\n return defaultRetryAfter;\n}\n\nconst defaultFunctionName = '';\n\n/**\n * Safely extract function name from itself\n */\nexport function getFunctionName(fn: unknown): string {\n try {\n if (!fn || typeof fn !== 'function') {\n return defaultFunctionName;\n }\n return fn.name || defaultFunctionName;\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n return defaultFunctionName;\n }\n}\n\n/**\n * This function adds context (pre/post/line) lines to the provided frame\n *\n * @param lines string[] containing all lines\n * @param frame StackFrame that will be mutated\n * @param linesOfContext number of context lines we want to add pre/post\n */\nexport function addContextToFrame(lines: string[], frame: StackFrame, linesOfContext: number = 5): void {\n const lineno = frame.lineno || 0;\n const maxLines = lines.length;\n const sourceLine = Math.max(Math.min(maxLines, lineno - 1), 0);\n\n frame.pre_context = lines\n .slice(Math.max(0, sourceLine - linesOfContext), sourceLine)\n .map((line: string) => snipLine(line, 0));\n\n frame.context_line = snipLine(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0);\n\n frame.post_context = lines\n .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext)\n .map((line: string) => snipLine(line, 0));\n}\n","import { consoleSandbox, getGlobalObject } from './misc';\n\n// TODO: Implement different loggers for different environments\nconst global = getGlobalObject();\n\n/** Prefix for logging strings */\nconst PREFIX = 'Sentry Logger ';\n\n/** JSDoc */\nclass Logger {\n /** JSDoc */\n private _enabled: boolean;\n\n /** JSDoc */\n public constructor() {\n this._enabled = false;\n }\n\n /** JSDoc */\n public disable(): void {\n this._enabled = false;\n }\n\n /** JSDoc */\n public enable(): void {\n this._enabled = true;\n }\n\n /** JSDoc */\n public log(...args: any[]): void {\n if (!this._enabled) {\n return;\n }\n consoleSandbox(() => {\n global.console.log(`${PREFIX}[Log]: ${args.join(' ')}`); // tslint:disable-line:no-console\n });\n }\n\n /** JSDoc */\n public warn(...args: any[]): void {\n if (!this._enabled) {\n return;\n }\n consoleSandbox(() => {\n global.console.warn(`${PREFIX}[Warn]: ${args.join(' ')}`); // tslint:disable-line:no-console\n });\n }\n\n /** JSDoc */\n public error(...args: any[]): void {\n if (!this._enabled) {\n return;\n }\n consoleSandbox(() => {\n global.console.error(`${PREFIX}[Error]: ${args.join(' ')}`); // tslint:disable-line:no-console\n });\n }\n}\n\n// Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used\nglobal.__SENTRY__ = global.__SENTRY__ || {};\nconst logger = (global.__SENTRY__.logger as Logger) || (global.__SENTRY__.logger = new Logger());\n\nexport { logger };\n","// tslint:disable:no-unsafe-any\n/**\n * Memo class used for decycle json objects. Uses WeakSet if available otherwise array.\n */\nexport class Memo {\n /** Determines if WeakSet is available */\n private readonly _hasWeakSet: boolean;\n /** Either WeakSet or Array */\n private readonly _inner: any;\n\n public constructor() {\n // tslint:disable-next-line\n this._hasWeakSet = typeof WeakSet === 'function';\n this._inner = this._hasWeakSet ? new WeakSet() : [];\n }\n\n /**\n * Sets obj to remember.\n * @param obj Object to remember\n */\n public memoize(obj: any): boolean {\n if (this._hasWeakSet) {\n if (this._inner.has(obj)) {\n return true;\n }\n this._inner.add(obj);\n return false;\n }\n // tslint:disable-next-line:prefer-for-of\n for (let i = 0; i < this._inner.length; i++) {\n const value = this._inner[i];\n if (value === obj) {\n return true;\n }\n }\n this._inner.push(obj);\n return false;\n }\n\n /**\n * Removes object from internal storage.\n * @param obj Object to forget\n */\n public unmemoize(obj: any): void {\n if (this._hasWeakSet) {\n this._inner.delete(obj);\n } else {\n for (let i = 0; i < this._inner.length; i++) {\n if (this._inner[i] === obj) {\n this._inner.splice(i, 1);\n break;\n }\n }\n }\n }\n}\n","import { ExtendedError, WrappedFunction } from '@sentry/types';\n\nimport { isElement, isError, isEvent, isInstanceOf, isPlainObject, isPrimitive, isSyntheticEvent } from './is';\nimport { Memo } from './memo';\nimport { getFunctionName, htmlTreeAsString } from './misc';\nimport { truncate } from './string';\n\n/**\n * Wrap a given object method with a higher-order function\n *\n * @param source An object that contains a method to be wrapped.\n * @param name A name of method to be wrapped.\n * @param replacement A function that should be used to wrap a given method.\n * @returns void\n */\nexport function fill(source: { [key: string]: any }, name: string, replacement: (...args: any[]) => any): void {\n if (!(name in source)) {\n return;\n }\n\n const original = source[name] as () => any;\n const wrapped = replacement(original) as WrappedFunction;\n\n // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work\n // otherwise it'll throw \"TypeError: Object.defineProperties called on non-object\"\n // tslint:disable-next-line:strict-type-predicates\n if (typeof wrapped === 'function') {\n try {\n wrapped.prototype = wrapped.prototype || {};\n Object.defineProperties(wrapped, {\n __sentry_original__: {\n enumerable: false,\n value: original,\n },\n });\n } catch (_Oo) {\n // This can throw if multiple fill happens on a global object like XMLHttpRequest\n // Fixes https://github.com/getsentry/sentry-javascript/issues/2043\n }\n }\n\n source[name] = wrapped;\n}\n\n/**\n * Encodes given object into url-friendly format\n *\n * @param object An object that contains serializable values\n * @returns string Encoded\n */\nexport function urlEncode(object: { [key: string]: any }): string {\n return Object.keys(object)\n .map(\n // tslint:disable-next-line:no-unsafe-any\n key => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`,\n )\n .join('&');\n}\n\n/**\n * Transforms any object into an object literal with all it's attributes\n * attached to it.\n *\n * @param value Initial source that we have to transform in order to be usable by the serializer\n */\nfunction getWalkSource(\n value: any,\n): {\n [key: string]: any;\n} {\n if (isError(value)) {\n const error = value as ExtendedError;\n const err: {\n stack: string | undefined;\n message: string;\n name: string;\n [key: string]: any;\n } = {\n message: error.message,\n name: error.name,\n stack: error.stack,\n };\n\n for (const i in error) {\n if (Object.prototype.hasOwnProperty.call(error, i)) {\n err[i] = error[i];\n }\n }\n\n return err;\n }\n\n if (isEvent(value)) {\n /**\n * Event-like interface that's usable in browser and node\n */\n interface SimpleEvent {\n [key: string]: unknown;\n type: string;\n target?: unknown;\n currentTarget?: unknown;\n }\n\n const event = value as SimpleEvent;\n\n const source: {\n [key: string]: any;\n } = {};\n\n source.type = event.type;\n\n // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n try {\n source.target = isElement(event.target)\n ? htmlTreeAsString(event.target)\n : Object.prototype.toString.call(event.target);\n } catch (_oO) {\n source.target = '';\n }\n\n try {\n source.currentTarget = isElement(event.currentTarget)\n ? htmlTreeAsString(event.currentTarget)\n : Object.prototype.toString.call(event.currentTarget);\n } catch (_oO) {\n source.currentTarget = '';\n }\n\n // tslint:disable-next-line:strict-type-predicates\n if (typeof CustomEvent !== 'undefined' && isInstanceOf(value, CustomEvent)) {\n source.detail = event.detail;\n }\n\n for (const i in event) {\n if (Object.prototype.hasOwnProperty.call(event, i)) {\n source[i] = event;\n }\n }\n\n return source;\n }\n\n return value as {\n [key: string]: any;\n };\n}\n\n/** Calculates bytes size of input string */\nfunction utf8Length(value: string): number {\n // tslint:disable-next-line:no-bitwise\n return ~-encodeURI(value).split(/%..|./).length;\n}\n\n/** Calculates bytes size of input object */\nfunction jsonSize(value: any): number {\n return utf8Length(JSON.stringify(value));\n}\n\n/** JSDoc */\nexport function normalizeToSize(\n object: { [key: string]: any },\n // Default Node.js REPL depth\n depth: number = 3,\n // 100kB, as 200kB is max payload size, so half sounds reasonable\n maxSize: number = 100 * 1024,\n): T {\n const serialized = normalize(object, depth);\n\n if (jsonSize(serialized) > maxSize) {\n return normalizeToSize(object, depth - 1, maxSize);\n }\n\n return serialized as T;\n}\n\n/** Transforms any input value into a string form, either primitive value or a type of the input */\nfunction serializeValue(value: any): any {\n const type = Object.prototype.toString.call(value);\n\n // Node.js REPL notation\n if (typeof value === 'string') {\n return value;\n }\n if (type === '[object Object]') {\n return '[Object]';\n }\n if (type === '[object Array]') {\n return '[Array]';\n }\n\n const normalized = normalizeValue(value);\n return isPrimitive(normalized) ? normalized : type;\n}\n\n/**\n * normalizeValue()\n *\n * Takes unserializable input and make it serializable friendly\n *\n * - translates undefined/NaN values to \"[undefined]\"/\"[NaN]\" respectively,\n * - serializes Error objects\n * - filter global objects\n */\n// tslint:disable-next-line:cyclomatic-complexity\nfunction normalizeValue(value: T, key?: any): T | string {\n if (key === 'domain' && value && typeof value === 'object' && ((value as unknown) as { _events: any })._events) {\n return '[Domain]';\n }\n\n if (key === 'domainEmitter') {\n return '[DomainEmitter]';\n }\n\n if (typeof (global as any) !== 'undefined' && (value as unknown) === global) {\n return '[Global]';\n }\n\n if (typeof (window as any) !== 'undefined' && (value as unknown) === window) {\n return '[Window]';\n }\n\n if (typeof (document as any) !== 'undefined' && (value as unknown) === document) {\n return '[Document]';\n }\n\n // React's SyntheticEvent thingy\n if (isSyntheticEvent(value)) {\n return '[SyntheticEvent]';\n }\n\n // tslint:disable-next-line:no-tautology-expression\n if (typeof value === 'number' && value !== value) {\n return '[NaN]';\n }\n\n if (value === void 0) {\n return '[undefined]';\n }\n\n if (typeof value === 'function') {\n return `[Function: ${getFunctionName(value)}]`;\n }\n\n return value;\n}\n\n/**\n * Walks an object to perform a normalization on it\n *\n * @param key of object that's walked in current iteration\n * @param value object to be walked\n * @param depth Optional number indicating how deep should walking be performed\n * @param memo Optional Memo class handling decycling\n */\nexport function walk(key: string, value: any, depth: number = +Infinity, memo: Memo = new Memo()): any {\n // If we reach the maximum depth, serialize whatever has left\n if (depth === 0) {\n return serializeValue(value);\n }\n\n // If value implements `toJSON` method, call it and return early\n // tslint:disable:no-unsafe-any\n if (value !== null && value !== undefined && typeof value.toJSON === 'function') {\n return value.toJSON();\n }\n // tslint:enable:no-unsafe-any\n\n // If normalized value is a primitive, there are no branches left to walk, so we can just bail out, as theres no point in going down that branch any further\n const normalized = normalizeValue(value, key);\n if (isPrimitive(normalized)) {\n return normalized;\n }\n\n // Create source that we will use for next itterations, either objectified error object (Error type with extracted keys:value pairs) or the input itself\n const source = getWalkSource(value);\n\n // Create an accumulator that will act as a parent for all future itterations of that branch\n const acc = Array.isArray(value) ? [] : {};\n\n // If we already walked that branch, bail out, as it's circular reference\n if (memo.memoize(value)) {\n return '[Circular ~]';\n }\n\n // Walk all keys of the source\n for (const innerKey in source) {\n // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration.\n if (!Object.prototype.hasOwnProperty.call(source, innerKey)) {\n continue;\n }\n // Recursively walk through all the child nodes\n (acc as { [key: string]: any })[innerKey] = walk(innerKey, source[innerKey], depth - 1, memo);\n }\n\n // Once walked through all the branches, remove the parent from memo storage\n memo.unmemoize(value);\n\n // Return accumulated values\n return acc;\n}\n\n/**\n * normalize()\n *\n * - Creates a copy to prevent original input mutation\n * - Skip non-enumerablers\n * - Calls `toJSON` if implemented\n * - Removes circular references\n * - Translates non-serializeable values (undefined/NaN/Functions) to serializable format\n * - Translates known global objects/Classes to a string representations\n * - Takes care of Error objects serialization\n * - Optionally limit depth of final output\n */\nexport function normalize(input: any, depth?: number): any {\n try {\n // tslint:disable-next-line:no-unsafe-any\n return JSON.parse(JSON.stringify(input, (key: string, value: any) => walk(key, value, depth)));\n } catch (_oO) {\n return '**non-serializable**';\n }\n}\n\n/**\n * Given any captured exception, extract its keys and create a sorted\n * and truncated list that will be used inside the event message.\n * eg. `Non-error exception captured with keys: foo, bar, baz`\n */\nexport function extractExceptionKeysForMessage(exception: any, maxLength: number = 40): string {\n // tslint:disable:strict-type-predicates\n const keys = Object.keys(getWalkSource(exception));\n keys.sort();\n\n if (!keys.length) {\n return '[object has no keys]';\n }\n\n if (keys[0].length >= maxLength) {\n return truncate(keys[0], maxLength);\n }\n\n for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) {\n const serialized = keys.slice(0, includedKeys).join(', ');\n if (serialized.length > maxLength) {\n continue;\n }\n if (includedKeys === keys.length) {\n return serialized;\n }\n return truncate(serialized, maxLength);\n }\n\n return '';\n}\n\n/**\n * Given any object, return the new object with removed keys that value was `undefined`.\n * Works recursively on objects and arrays.\n */\nexport function dropUndefinedKeys(val: T): T {\n if (isPlainObject(val)) {\n const obj = val as { [key: string]: any };\n const rv: { [key: string]: any } = {};\n for (const key of Object.keys(obj)) {\n if (typeof obj[key] !== 'undefined') {\n rv[key] = dropUndefinedKeys(obj[key]);\n }\n }\n return rv as T;\n }\n\n if (Array.isArray(val)) {\n return val.map(dropUndefinedKeys) as any;\n }\n\n return val;\n}\n","// Slightly modified (no IE8 support, ES6) and transcribed to TypeScript\n// https://raw.githubusercontent.com/calvinmetcalf/rollup-plugin-node-builtins/master/src/es6/path.js\n\n/** JSDoc */\nfunction normalizeArray(parts: string[], allowAboveRoot?: boolean): string[] {\n // if the path tries to go above the root, `up` ends up > 0\n let up = 0;\n for (let i = parts.length - 1; i >= 0; i--) {\n const last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// Split a filename into [root, dir, basename, ext], unix version\n// 'root' is just a slash, or nothing.\nconst splitPathRe = /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\n/** JSDoc */\nfunction splitPath(filename: string): string[] {\n const parts = splitPathRe.exec(filename);\n return parts ? parts.slice(1) : [];\n}\n\n// path.resolve([from ...], to)\n// posix version\n/** JSDoc */\nexport function resolve(...args: string[]): string {\n let resolvedPath = '';\n let resolvedAbsolute = false;\n\n for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n const path = i >= 0 ? args[i] : '/';\n\n // Skip empty entries\n if (!path) {\n continue;\n }\n\n resolvedPath = `${path}/${resolvedPath}`;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(resolvedPath.split('/').filter(p => !!p), !resolvedAbsolute).join('/');\n\n return (resolvedAbsolute ? '/' : '') + resolvedPath || '.';\n}\n\n/** JSDoc */\nfunction trim(arr: string[]): string[] {\n let start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') {\n break;\n }\n }\n\n let end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') {\n break;\n }\n }\n\n if (start > end) {\n return [];\n }\n return arr.slice(start, end - start + 1);\n}\n\n// path.relative(from, to)\n// posix version\n/** JSDoc */\nexport function relative(from: string, to: string): string {\n // tslint:disable:no-parameter-reassignment\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n\n const fromParts = trim(from.split('/'));\n const toParts = trim(to.split('/'));\n\n const length = Math.min(fromParts.length, toParts.length);\n let samePartsLength = length;\n for (let i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n let outputParts = [];\n for (let i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n}\n\n// path.normalize(path)\n// posix version\n/** JSDoc */\nexport function normalizePath(path: string): string {\n const isPathAbsolute = isAbsolute(path);\n const trailingSlash = path.substr(-1) === '/';\n\n // Normalize the path\n let normalizedPath = normalizeArray(path.split('/').filter(p => !!p), !isPathAbsolute).join('/');\n\n if (!normalizedPath && !isPathAbsolute) {\n normalizedPath = '.';\n }\n if (normalizedPath && trailingSlash) {\n normalizedPath += '/';\n }\n\n return (isPathAbsolute ? '/' : '') + normalizedPath;\n}\n\n// posix version\n/** JSDoc */\nexport function isAbsolute(path: string): boolean {\n return path.charAt(0) === '/';\n}\n\n// posix version\n/** JSDoc */\nexport function join(...args: string[]): string {\n return normalizePath(args.join('/'));\n}\n\n/** JSDoc */\nexport function dirname(path: string): string {\n const result = splitPath(path);\n const root = result[0];\n let dir = result[1];\n\n if (!root && !dir) {\n // No dirname whatsoever\n return '.';\n }\n\n if (dir) {\n // It has a dirname, strip trailing slash\n dir = dir.substr(0, dir.length - 1);\n }\n\n return root + dir;\n}\n\n/** JSDoc */\nexport function basename(path: string, ext?: string): string {\n let f = splitPath(path)[2];\n if (ext && f.substr(ext.length * -1) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n}\n","import { isThenable } from './is';\n\n/** SyncPromise internal states */\nenum States {\n /** Pending */\n PENDING = 'PENDING',\n /** Resolved / OK */\n RESOLVED = 'RESOLVED',\n /** Rejected / Error */\n REJECTED = 'REJECTED',\n}\n\n/**\n * Thenable class that behaves like a Promise and follows it's interface\n * but is not async internally\n */\nclass SyncPromise implements PromiseLike {\n private _state: States = States.PENDING;\n private _handlers: Array<{\n onfulfilled?: ((value: T) => T | PromiseLike) | null;\n onrejected?: ((reason: any) => any) | null;\n }> = [];\n private _value: any;\n\n public constructor(\n executor: (resolve: (value?: T | PromiseLike | null) => void, reject: (reason?: any) => void) => void,\n ) {\n try {\n executor(this._resolve, this._reject);\n } catch (e) {\n this._reject(e);\n }\n }\n\n /** JSDoc */\n public toString(): string {\n return '[object SyncPromise]';\n }\n\n /** JSDoc */\n public static resolve(value: T | PromiseLike): PromiseLike {\n return new SyncPromise(resolve => {\n resolve(value);\n });\n }\n\n /** JSDoc */\n public static reject(reason?: any): PromiseLike {\n return new SyncPromise((_, reject) => {\n reject(reason);\n });\n }\n\n /** JSDoc */\n public static all(collection: Array>): PromiseLike {\n return new SyncPromise((resolve, reject) => {\n if (!Array.isArray(collection)) {\n reject(new TypeError(`Promise.all requires an array as input.`));\n return;\n }\n\n if (collection.length === 0) {\n resolve([]);\n return;\n }\n\n let counter = collection.length;\n const resolvedCollection: U[] = [];\n\n collection.forEach((item, index) => {\n SyncPromise.resolve(item)\n .then(value => {\n resolvedCollection[index] = value;\n counter -= 1;\n\n if (counter !== 0) {\n return;\n }\n resolve(resolvedCollection);\n })\n .then(null, reject);\n });\n });\n }\n\n /** JSDoc */\n public then(\n onfulfilled?: ((value: T) => TResult1 | PromiseLike) | null,\n onrejected?: ((reason: any) => TResult2 | PromiseLike) | null,\n ): PromiseLike {\n return new SyncPromise((resolve, reject) => {\n this._attachHandler({\n onfulfilled: result => {\n if (!onfulfilled) {\n // TODO: ¯\\_(ツ)_/¯\n // TODO: FIXME\n resolve(result as any);\n return;\n }\n try {\n resolve(onfulfilled(result));\n return;\n } catch (e) {\n reject(e);\n return;\n }\n },\n onrejected: reason => {\n if (!onrejected) {\n reject(reason);\n return;\n }\n try {\n resolve(onrejected(reason));\n return;\n } catch (e) {\n reject(e);\n return;\n }\n },\n });\n });\n }\n\n /** JSDoc */\n public catch(\n onrejected?: ((reason: any) => TResult | PromiseLike) | null,\n ): PromiseLike {\n return this.then(val => val, onrejected);\n }\n\n /** JSDoc */\n public finally(onfinally?: (() => void) | null): PromiseLike {\n return new SyncPromise((resolve, reject) => {\n let val: TResult | any;\n let isRejected: boolean;\n\n return this.then(\n value => {\n isRejected = false;\n val = value;\n if (onfinally) {\n onfinally();\n }\n },\n reason => {\n isRejected = true;\n val = reason;\n if (onfinally) {\n onfinally();\n }\n },\n ).then(() => {\n if (isRejected) {\n reject(val);\n return;\n }\n\n // tslint:disable-next-line:no-unsafe-any\n resolve(val);\n });\n });\n }\n\n /** JSDoc */\n private readonly _resolve = (value?: T | PromiseLike | null) => {\n this._setResult(States.RESOLVED, value);\n };\n\n /** JSDoc */\n private readonly _reject = (reason?: any) => {\n this._setResult(States.REJECTED, reason);\n };\n\n /** JSDoc */\n private readonly _setResult = (state: States, value?: T | PromiseLike | any) => {\n if (this._state !== States.PENDING) {\n return;\n }\n\n if (isThenable(value)) {\n (value as PromiseLike).then(this._resolve, this._reject);\n return;\n }\n\n this._state = state;\n this._value = value;\n\n this._executeHandlers();\n };\n\n // TODO: FIXME\n /** JSDoc */\n private readonly _attachHandler = (handler: {\n /** JSDoc */\n onfulfilled?(value: T): any;\n /** JSDoc */\n onrejected?(reason: any): any;\n }) => {\n this._handlers = this._handlers.concat(handler);\n this._executeHandlers();\n };\n\n /** JSDoc */\n private readonly _executeHandlers = () => {\n if (this._state === States.PENDING) {\n return;\n }\n\n if (this._state === States.REJECTED) {\n this._handlers.forEach(handler => {\n if (handler.onrejected) {\n handler.onrejected(this._value);\n }\n });\n } else {\n this._handlers.forEach(handler => {\n if (handler.onfulfilled) {\n // tslint:disable-next-line:no-unsafe-any\n handler.onfulfilled(this._value);\n }\n });\n }\n\n this._handlers = [];\n };\n}\n\nexport { SyncPromise };\n","import { SentryError } from './error';\nimport { SyncPromise } from './syncpromise';\n\n/** A simple queue that holds promises. */\nexport class PromiseBuffer {\n public constructor(protected _limit?: number) {}\n\n /** Internal set of queued Promises */\n private readonly _buffer: Array> = [];\n\n /**\n * Says if the buffer is ready to take more requests\n */\n public isReady(): boolean {\n return this._limit === undefined || this.length() < this._limit;\n }\n\n /**\n * Add a promise to the queue.\n *\n * @param task Can be any PromiseLike\n * @returns The original promise.\n */\n public add(task: PromiseLike): PromiseLike {\n if (!this.isReady()) {\n return SyncPromise.reject(new SentryError('Not adding Promise due to buffer limit reached.'));\n }\n if (this._buffer.indexOf(task) === -1) {\n this._buffer.push(task);\n }\n task\n .then(() => this.remove(task))\n .then(null, () =>\n this.remove(task).then(null, () => {\n // We have to add this catch here otherwise we have an unhandledPromiseRejection\n // because it's a new Promise chain.\n }),\n );\n return task;\n }\n\n /**\n * Remove a promise to the queue.\n *\n * @param task Can be any PromiseLike\n * @returns Removed promise.\n */\n public remove(task: PromiseLike): PromiseLike {\n const removedTask = this._buffer.splice(this._buffer.indexOf(task), 1)[0];\n return removedTask;\n }\n\n /**\n * This function returns the number of unresolved promises in the queue.\n */\n public length(): number {\n return this._buffer.length;\n }\n\n /**\n * This will drain the whole queue, returns true if queue is empty or drained.\n * If timeout is provided and the queue takes longer to drain, the promise still resolves but with false.\n *\n * @param timeout Number in ms to wait until it resolves with false.\n */\n public drain(timeout?: number): PromiseLike {\n return new SyncPromise(resolve => {\n const capturedSetTimeout = setTimeout(() => {\n if (timeout && timeout > 0) {\n resolve(false);\n }\n }, timeout);\n SyncPromise.all(this._buffer)\n .then(() => {\n clearTimeout(capturedSetTimeout);\n resolve(true);\n })\n .then(null, () => {\n resolve(true);\n });\n });\n }\n}\n","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())) {\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();\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 if (doc) {\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();\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","/* tslint:disable:only-arrow-functions no-unsafe-any */\n\nimport { WrappedFunction } from '@sentry/types';\n\nimport { isInstanceOf, isString } from './is';\nimport { logger } from './logger';\nimport { getFunctionName, getGlobalObject } from './misc';\nimport { fill } from './object';\nimport { supportsHistory, supportsNativeFetch } from './supports';\n\nconst global = getGlobalObject();\n\n/** Object describing handler that will be triggered for a given `type` of instrumentation */\ninterface InstrumentHandler {\n type: InstrumentHandlerType;\n callback: InstrumentHandlerCallback;\n}\ntype InstrumentHandlerType =\n | 'console'\n | 'dom'\n | 'fetch'\n | 'history'\n | 'sentry'\n | 'xhr'\n | 'error'\n | 'unhandledrejection';\ntype InstrumentHandlerCallback = (data: any) => void;\n\n/**\n * Instrument native APIs to call handlers that can be used to create breadcrumbs, APM spans etc.\n * - Console API\n * - Fetch API\n * - XHR API\n * - History API\n * - DOM API (click/typing)\n * - Error API\n * - UnhandledRejection API\n */\n\nconst handlers: { [key in InstrumentHandlerType]?: InstrumentHandlerCallback[] } = {};\nconst instrumented: { [key in InstrumentHandlerType]?: boolean } = {};\n\n/** Instruments given API */\nfunction instrument(type: InstrumentHandlerType): void {\n if (instrumented[type]) {\n return;\n }\n\n instrumented[type] = true;\n\n switch (type) {\n case 'console':\n instrumentConsole();\n break;\n case 'dom':\n instrumentDOM();\n break;\n case 'xhr':\n instrumentXHR();\n break;\n case 'fetch':\n instrumentFetch();\n break;\n case 'history':\n instrumentHistory();\n break;\n case 'error':\n instrumentError();\n break;\n case 'unhandledrejection':\n instrumentUnhandledRejection();\n break;\n default:\n logger.warn('unknown instrumentation type:', type);\n }\n}\n\n/**\n * Add handler that will be called when given type of instrumentation triggers.\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addInstrumentationHandler(handler: InstrumentHandler): void {\n // tslint:disable-next-line:strict-type-predicates\n if (!handler || typeof handler.type !== 'string' || typeof handler.callback !== 'function') {\n return;\n }\n handlers[handler.type] = handlers[handler.type] || [];\n (handlers[handler.type] as InstrumentHandlerCallback[]).push(handler.callback);\n instrument(handler.type);\n}\n\n/** JSDoc */\nfunction triggerHandlers(type: InstrumentHandlerType, data: any): void {\n if (!type || !handlers[type]) {\n return;\n }\n\n for (const handler of handlers[type] || []) {\n try {\n handler(data);\n } catch (e) {\n logger.error(\n `Error while triggering instrumentation handler.\\nType: ${type}\\nName: ${getFunctionName(\n handler,\n )}\\nError: ${e}`,\n );\n }\n }\n}\n\n/** JSDoc */\nfunction instrumentConsole(): void {\n if (!('console' in global)) {\n return;\n }\n\n ['debug', 'info', 'warn', 'error', 'log', 'assert'].forEach(function(level: string): void {\n if (!(level in global.console)) {\n return;\n }\n\n fill(global.console, level, function(originalConsoleLevel: () => any): Function {\n return function(...args: any[]): void {\n triggerHandlers('console', { args, level });\n\n // this fails for some browsers. :(\n if (originalConsoleLevel) {\n Function.prototype.apply.call(originalConsoleLevel, global.console, args);\n }\n };\n });\n });\n}\n\n/** JSDoc */\nfunction instrumentFetch(): void {\n if (!supportsNativeFetch()) {\n return;\n }\n\n fill(global, 'fetch', function(originalFetch: () => void): () => void {\n return function(...args: any[]): void {\n const commonHandlerData = {\n args,\n fetchData: {\n method: getFetchMethod(args),\n url: getFetchUrl(args),\n },\n startTimestamp: Date.now(),\n };\n\n triggerHandlers('fetch', {\n ...commonHandlerData,\n });\n\n return originalFetch.apply(global, args).then(\n (response: Response) => {\n triggerHandlers('fetch', {\n ...commonHandlerData,\n endTimestamp: Date.now(),\n response,\n });\n return response;\n },\n (error: Error) => {\n triggerHandlers('fetch', {\n ...commonHandlerData,\n endTimestamp: Date.now(),\n error,\n });\n throw error;\n },\n );\n };\n });\n}\n\n/** JSDoc */\ninterface SentryWrappedXMLHttpRequest extends XMLHttpRequest {\n [key: string]: any;\n __sentry_xhr__?: {\n method?: string;\n url?: string;\n status_code?: number;\n };\n}\n\n/** Extract `method` from fetch call arguments */\nfunction getFetchMethod(fetchArgs: any[] = []): string {\n if ('Request' in global && isInstanceOf(fetchArgs[0], Request) && fetchArgs[0].method) {\n return String(fetchArgs[0].method).toUpperCase();\n }\n if (fetchArgs[1] && fetchArgs[1].method) {\n return String(fetchArgs[1].method).toUpperCase();\n }\n return 'GET';\n}\n\n/** Extract `url` from fetch call arguments */\nfunction getFetchUrl(fetchArgs: any[] = []): string {\n if (typeof fetchArgs[0] === 'string') {\n return fetchArgs[0];\n }\n if ('Request' in global && isInstanceOf(fetchArgs[0], Request)) {\n return fetchArgs[0].url;\n }\n return String(fetchArgs[0]);\n}\n\n/** JSDoc */\nfunction instrumentXHR(): void {\n if (!('XMLHttpRequest' in global)) {\n return;\n }\n\n const xhrproto = XMLHttpRequest.prototype;\n\n fill(xhrproto, 'open', function(originalOpen: () => void): () => void {\n return function(this: SentryWrappedXMLHttpRequest, ...args: any[]): void {\n const url = args[1];\n this.__sentry_xhr__ = {\n method: isString(args[0]) ? args[0].toUpperCase() : args[0],\n url: args[1],\n };\n\n // if Sentry key appears in URL, don't capture it as a request\n if (isString(url) && this.__sentry_xhr__.method === 'POST' && url.match(/sentry_key/)) {\n this.__sentry_own_request__ = true;\n }\n\n return originalOpen.apply(this, args);\n };\n });\n\n fill(xhrproto, 'send', function(originalSend: () => void): () => void {\n return function(this: SentryWrappedXMLHttpRequest, ...args: any[]): void {\n const xhr = this; // tslint:disable-line:no-this-assignment\n const commonHandlerData = {\n args,\n startTimestamp: Date.now(),\n xhr,\n };\n\n triggerHandlers('xhr', {\n ...commonHandlerData,\n });\n\n xhr.addEventListener('readystatechange', function(): void {\n if (xhr.readyState === 4) {\n try {\n // touching statusCode in some platforms throws\n // an exception\n if (xhr.__sentry_xhr__) {\n xhr.__sentry_xhr__.status_code = xhr.status;\n }\n } catch (e) {\n /* do nothing */\n }\n triggerHandlers('xhr', {\n ...commonHandlerData,\n endTimestamp: Date.now(),\n });\n }\n });\n\n return originalSend.apply(this, args);\n };\n });\n}\n\nlet lastHref: string;\n\n/** JSDoc */\nfunction instrumentHistory(): void {\n if (!supportsHistory()) {\n return;\n }\n\n const oldOnPopState = global.onpopstate;\n global.onpopstate = function(this: WindowEventHandlers, ...args: any[]): any {\n const to = global.location.href;\n // keep track of the current URL state, as we always receive only the updated state\n const from = lastHref;\n lastHref = to;\n triggerHandlers('history', {\n from,\n to,\n });\n if (oldOnPopState) {\n return oldOnPopState.apply(this, args);\n }\n };\n\n /** @hidden */\n function historyReplacementFunction(originalHistoryFunction: () => void): () => void {\n return function(this: History, ...args: any[]): void {\n const url = args.length > 2 ? args[2] : undefined;\n if (url) {\n // coerce to string (this is what pushState does)\n const from = lastHref;\n const to = String(url);\n // keep track of the current URL state, as we always receive only the updated state\n lastHref = to;\n triggerHandlers('history', {\n from,\n to,\n });\n }\n return originalHistoryFunction.apply(this, args);\n };\n }\n\n fill(global.history, 'pushState', historyReplacementFunction);\n fill(global.history, 'replaceState', historyReplacementFunction);\n}\n\n/** JSDoc */\nfunction instrumentDOM(): void {\n if (!('document' in global)) {\n return;\n }\n\n // Capture breadcrumbs from any click that is unhandled / bubbled up all the way\n // to the document. Do this before we instrument addEventListener.\n global.document.addEventListener('click', domEventHandler('click', triggerHandlers.bind(null, 'dom')), false);\n global.document.addEventListener('keypress', keypressEventHandler(triggerHandlers.bind(null, 'dom')), false);\n\n // After hooking into document bubbled up click and keypresses events, we also hook into user handled click & keypresses.\n ['EventTarget', 'Node'].forEach((target: string) => {\n const proto = (global as any)[target] && (global as any)[target].prototype;\n\n if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n return;\n }\n\n fill(proto, 'addEventListener', function(\n original: () => void,\n ): (\n eventName: string,\n fn: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions,\n ) => void {\n return function(\n this: any,\n eventName: string,\n fn: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions,\n ): (eventName: string, fn: EventListenerOrEventListenerObject, capture?: boolean, secure?: boolean) => void {\n if (fn && (fn as EventListenerObject).handleEvent) {\n if (eventName === 'click') {\n fill(fn, 'handleEvent', function(innerOriginal: () => void): (caughtEvent: Event) => void {\n return function(this: any, event: Event): (event: Event) => void {\n domEventHandler('click', triggerHandlers.bind(null, 'dom'))(event);\n return innerOriginal.call(this, event);\n };\n });\n }\n if (eventName === 'keypress') {\n fill(fn, 'handleEvent', function(innerOriginal: () => void): (caughtEvent: Event) => void {\n return function(this: any, event: Event): (event: Event) => void {\n keypressEventHandler(triggerHandlers.bind(null, 'dom'))(event);\n return innerOriginal.call(this, event);\n };\n });\n }\n } else {\n if (eventName === 'click') {\n domEventHandler('click', triggerHandlers.bind(null, 'dom'), true)(this);\n }\n if (eventName === 'keypress') {\n keypressEventHandler(triggerHandlers.bind(null, 'dom'))(this);\n }\n }\n\n return original.call(this, eventName, fn, options);\n };\n });\n\n fill(proto, 'removeEventListener', function(\n original: () => void,\n ): (\n this: any,\n eventName: string,\n fn: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions,\n ) => () => void {\n return function(\n this: any,\n eventName: string,\n fn: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions,\n ): () => void {\n let callback = fn as WrappedFunction;\n try {\n callback = callback && (callback.__sentry_wrapped__ || callback);\n } catch (e) {\n // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments\n }\n return original.call(this, eventName, callback, options);\n };\n });\n });\n}\n\nconst debounceDuration: number = 1000;\nlet debounceTimer: number = 0;\nlet keypressTimeout: number | undefined;\nlet lastCapturedEvent: Event | undefined;\n\n/**\n * Wraps addEventListener to capture UI breadcrumbs\n * @param name the event name (e.g. \"click\")\n * @param handler function that will be triggered\n * @param debounce decides whether it should wait till another event loop\n * @returns wrapped breadcrumb events handler\n * @hidden\n */\nfunction domEventHandler(name: string, handler: Function, debounce: boolean = false): (event: Event) => void {\n return (event: Event) => {\n // reset keypress timeout; e.g. triggering a 'click' after\n // a 'keypress' will reset the keypress debounce so that a new\n // set of keypresses can be recorded\n keypressTimeout = undefined;\n // It's possible this handler might trigger multiple times for the same\n // event (e.g. event propagation through node ancestors). Ignore if we've\n // already captured the event.\n if (!event || lastCapturedEvent === event) {\n return;\n }\n\n lastCapturedEvent = event;\n\n if (debounceTimer) {\n clearTimeout(debounceTimer);\n }\n\n if (debounce) {\n debounceTimer = setTimeout(() => {\n handler({ event, name });\n });\n } else {\n handler({ event, name });\n }\n };\n}\n\n/**\n * Wraps addEventListener to capture keypress UI events\n * @param handler function that will be triggered\n * @returns wrapped keypress events handler\n * @hidden\n */\nfunction keypressEventHandler(handler: Function): (event: Event) => void {\n // TODO: if somehow user switches keypress target before\n // debounce timeout is triggered, we will only capture\n // a single breadcrumb from the FIRST target (acceptable?)\n return (event: Event) => {\n let target;\n\n try {\n target = event.target;\n } catch (e) {\n // just accessing event properties can throw an exception in some rare circumstances\n // see: https://github.com/getsentry/raven-js/issues/838\n return;\n }\n\n const tagName = target && (target as HTMLElement).tagName;\n\n // only consider keypress events on actual input elements\n // this will disregard keypresses targeting body (e.g. tabbing\n // through elements, hotkeys, etc)\n if (!tagName || (tagName !== 'INPUT' && tagName !== 'TEXTAREA' && !(target as HTMLElement).isContentEditable)) {\n return;\n }\n\n // record first keypress in a series, but ignore subsequent\n // keypresses until debounce clears\n if (!keypressTimeout) {\n domEventHandler('input', handler)(event);\n }\n clearTimeout(keypressTimeout);\n\n keypressTimeout = (setTimeout(() => {\n keypressTimeout = undefined;\n }, debounceDuration) as any) as number;\n };\n}\n\nlet _oldOnErrorHandler: OnErrorEventHandler = null;\n/** JSDoc */\nfunction instrumentError(): void {\n _oldOnErrorHandler = global.onerror;\n\n global.onerror = function(msg: any, url: any, line: any, column: any, error: any): boolean {\n triggerHandlers('error', {\n column,\n error,\n line,\n msg,\n url,\n });\n\n if (_oldOnErrorHandler) {\n return _oldOnErrorHandler.apply(this, arguments);\n }\n\n return false;\n };\n}\n\nlet _oldOnUnhandledRejectionHandler: ((e: any) => void) | null = null;\n/** JSDoc */\nfunction instrumentUnhandledRejection(): void {\n _oldOnUnhandledRejectionHandler = global.onunhandledrejection;\n\n global.onunhandledrejection = function(e: any): boolean {\n triggerHandlers('unhandledrejection', e);\n\n if (_oldOnUnhandledRejectionHandler) {\n return _oldOnUnhandledRejectionHandler.apply(this, arguments);\n }\n\n return true;\n };\n}\n","import { DsnComponents, DsnLike, DsnProtocol } from '@sentry/types';\n\nimport { SentryError } from './error';\n\n/** Regular expression used to parse a Dsn. */\nconst DSN_REGEX = /^(?:(\\w+):)\\/\\/(?:(\\w+)(?::(\\w+))?@)([\\w\\.-]+)(?::(\\d+))?\\/(.+)/;\n\n/** Error message */\nconst ERROR_MESSAGE = 'Invalid Dsn';\n\n/** The Sentry Dsn, identifying a Sentry instance and project. */\nexport class Dsn implements DsnComponents {\n /** Protocol used to connect to Sentry. */\n public protocol!: DsnProtocol;\n /** Public authorization key. */\n public user!: string;\n /** private _authorization key (deprecated, optional). */\n public pass!: string;\n /** Hostname of the Sentry instance. */\n public host!: string;\n /** Port of the Sentry instance. */\n public port!: string;\n /** Path */\n public path!: string;\n /** Project ID */\n public projectId!: string;\n\n /** Creates a new Dsn component */\n public constructor(from: DsnLike) {\n if (typeof from === 'string') {\n this._fromString(from);\n } else {\n this._fromComponents(from);\n }\n\n this._validate();\n }\n\n /**\n * Renders the string representation of this Dsn.\n *\n * By default, this will render the public representation without the password\n * component. To get the deprecated private _representation, set `withPassword`\n * to true.\n *\n * @param withPassword When set to true, the password will be included.\n */\n public toString(withPassword: boolean = false): string {\n // tslint:disable-next-line:no-this-assignment\n const { host, path, pass, port, projectId, protocol, user } = this;\n return (\n `${protocol}://${user}${withPassword && pass ? `:${pass}` : ''}` +\n `@${host}${port ? `:${port}` : ''}/${path ? `${path}/` : path}${projectId}`\n );\n }\n\n /** Parses a string into this Dsn. */\n private _fromString(str: string): void {\n const match = DSN_REGEX.exec(str);\n\n if (!match) {\n throw new SentryError(ERROR_MESSAGE);\n }\n\n const [protocol, user, pass = '', host, port = '', lastPath] = match.slice(1);\n let path = '';\n let projectId = lastPath;\n\n const split = projectId.split('/');\n if (split.length > 1) {\n path = split.slice(0, -1).join('/');\n projectId = split.pop() as string;\n }\n\n this._fromComponents({ host, pass, path, projectId, port, protocol: protocol as DsnProtocol, user });\n }\n\n /** Maps Dsn components into this instance. */\n private _fromComponents(components: DsnComponents): void {\n this.protocol = components.protocol;\n this.user = components.user;\n this.pass = components.pass || '';\n this.host = components.host;\n this.port = components.port || '';\n this.path = components.path || '';\n this.projectId = components.projectId;\n }\n\n /** Validates this Dsn and throws on error. */\n private _validate(): void {\n ['protocol', 'user', 'host', 'projectId'].forEach(component => {\n if (!this[component as keyof DsnComponents]) {\n throw new SentryError(ERROR_MESSAGE);\n }\n });\n\n if (this.protocol !== 'http' && this.protocol !== 'https') {\n throw new SentryError(ERROR_MESSAGE);\n }\n\n if (this.port && isNaN(parseInt(this.port, 10))) {\n throw new SentryError(ERROR_MESSAGE);\n }\n }\n}\n","import {\n Breadcrumb,\n Event,\n EventHint,\n EventProcessor,\n Scope as ScopeInterface,\n Severity,\n Span,\n User,\n} from '@sentry/types';\nimport { getGlobalObject, isThenable, SyncPromise, timestampWithMs } from '@sentry/utils';\n\n/**\n * Holds additional event information. {@link Scope.applyToEvent} will be\n * called by the client before an event will be sent.\n */\nexport class Scope implements ScopeInterface {\n /** Flag if notifiying is happening. */\n protected _notifyingListeners: boolean = false;\n\n /** Callback for client to receive scope changes. */\n protected _scopeListeners: Array<(scope: Scope) => void> = [];\n\n /** Callback list that will be called after {@link applyToEvent}. */\n protected _eventProcessors: EventProcessor[] = [];\n\n /** Array of breadcrumbs. */\n protected _breadcrumbs: Breadcrumb[] = [];\n\n /** User */\n protected _user: User = {};\n\n /** Tags */\n protected _tags: { [key: string]: string } = {};\n\n /** Extra */\n protected _extra: { [key: string]: any } = {};\n\n /** Contexts */\n protected _context: { [key: string]: any } = {};\n\n /** Fingerprint */\n protected _fingerprint?: string[];\n\n /** Severity */\n protected _level?: Severity;\n\n /** Transaction */\n protected _transaction?: string;\n\n /** Span */\n protected _span?: Span;\n\n /**\n * Add internal on change listener. Used for sub SDKs that need to store the scope.\n * @hidden\n */\n public addScopeListener(callback: (scope: Scope) => void): void {\n this._scopeListeners.push(callback);\n }\n\n /**\n * @inheritDoc\n */\n public addEventProcessor(callback: EventProcessor): this {\n this._eventProcessors.push(callback);\n return this;\n }\n\n /**\n * This will be called on every set call.\n */\n protected _notifyScopeListeners(): void {\n if (!this._notifyingListeners) {\n this._notifyingListeners = true;\n setTimeout(() => {\n this._scopeListeners.forEach(callback => {\n callback(this);\n });\n this._notifyingListeners = false;\n });\n }\n }\n\n /**\n * This will be called after {@link applyToEvent} is finished.\n */\n protected _notifyEventProcessors(\n processors: EventProcessor[],\n event: Event | null,\n hint?: EventHint,\n index: number = 0,\n ): PromiseLike {\n return new SyncPromise((resolve, reject) => {\n const processor = processors[index];\n // tslint:disable-next-line:strict-type-predicates\n if (event === null || typeof processor !== 'function') {\n resolve(event);\n } else {\n const result = processor({ ...event }, hint) as Event | null;\n if (isThenable(result)) {\n (result as PromiseLike)\n .then(final => this._notifyEventProcessors(processors, final, hint, index + 1).then(resolve))\n .then(null, reject);\n } else {\n this._notifyEventProcessors(processors, result, hint, index + 1)\n .then(resolve)\n .then(null, reject);\n }\n }\n });\n }\n\n /**\n * @inheritDoc\n */\n public setUser(user: User | null): this {\n this._user = user || {};\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setTags(tags: { [key: string]: string }): this {\n this._tags = {\n ...this._tags,\n ...tags,\n };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setTag(key: string, value: string): this {\n this._tags = { ...this._tags, [key]: value };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setExtras(extras: { [key: string]: any }): this {\n this._extra = {\n ...this._extra,\n ...extras,\n };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setExtra(key: string, extra: any): this {\n this._extra = { ...this._extra, [key]: extra };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setFingerprint(fingerprint: string[]): this {\n this._fingerprint = fingerprint;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setLevel(level: Severity): this {\n this._level = level;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setTransaction(transaction?: string): this {\n this._transaction = transaction;\n if (this._span) {\n (this._span as any).transaction = transaction;\n }\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setContext(key: string, context: { [key: string]: any } | null): this {\n this._context = { ...this._context, [key]: context };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setSpan(span?: Span): this {\n this._span = span;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Internal getter for Span, used in Hub.\n * @hidden\n */\n public getSpan(): Span | undefined {\n return this._span;\n }\n\n /**\n * Inherit values from the parent scope.\n * @param scope to clone.\n */\n public static clone(scope?: Scope): Scope {\n const newScope = new Scope();\n if (scope) {\n newScope._breadcrumbs = [...scope._breadcrumbs];\n newScope._tags = { ...scope._tags };\n newScope._extra = { ...scope._extra };\n newScope._context = { ...scope._context };\n newScope._user = scope._user;\n newScope._level = scope._level;\n newScope._span = scope._span;\n newScope._transaction = scope._transaction;\n newScope._fingerprint = scope._fingerprint;\n newScope._eventProcessors = [...scope._eventProcessors];\n }\n return newScope;\n }\n\n /**\n * @inheritDoc\n */\n public clear(): this {\n this._breadcrumbs = [];\n this._tags = {};\n this._extra = {};\n this._user = {};\n this._context = {};\n this._level = undefined;\n this._transaction = undefined;\n this._fingerprint = undefined;\n this._span = undefined;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): this {\n const mergedBreadcrumb = {\n timestamp: timestampWithMs(),\n ...breadcrumb,\n };\n\n this._breadcrumbs =\n maxBreadcrumbs !== undefined && maxBreadcrumbs >= 0\n ? [...this._breadcrumbs, mergedBreadcrumb].slice(-maxBreadcrumbs)\n : [...this._breadcrumbs, mergedBreadcrumb];\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public clearBreadcrumbs(): this {\n this._breadcrumbs = [];\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Applies fingerprint from the scope to the event if there's one,\n * uses message if there's one instead or get rid of empty fingerprint\n */\n private _applyFingerprint(event: Event): void {\n // Make sure it's an array first and we actually have something in place\n event.fingerprint = event.fingerprint\n ? Array.isArray(event.fingerprint)\n ? event.fingerprint\n : [event.fingerprint]\n : [];\n\n // If we have something on the scope, then merge it with event\n if (this._fingerprint) {\n event.fingerprint = event.fingerprint.concat(this._fingerprint);\n }\n\n // If we have no data at all, remove empty array default\n if (event.fingerprint && !event.fingerprint.length) {\n delete event.fingerprint;\n }\n }\n\n /**\n * Applies the current context and fingerprint to the event.\n * Note that breadcrumbs will be added by the client.\n * Also if the event has already breadcrumbs on it, we do not merge them.\n * @param event Event\n * @param hint May contain additional informartion about the original exception.\n * @hidden\n */\n public applyToEvent(event: Event, hint?: EventHint): PromiseLike {\n if (this._extra && Object.keys(this._extra).length) {\n event.extra = { ...this._extra, ...event.extra };\n }\n if (this._tags && Object.keys(this._tags).length) {\n event.tags = { ...this._tags, ...event.tags };\n }\n if (this._user && Object.keys(this._user).length) {\n event.user = { ...this._user, ...event.user };\n }\n if (this._context && Object.keys(this._context).length) {\n event.contexts = { ...this._context, ...event.contexts };\n }\n if (this._level) {\n event.level = this._level;\n }\n if (this._transaction) {\n event.transaction = this._transaction;\n }\n if (this._span) {\n event.contexts = { trace: this._span.getTraceContext(), ...event.contexts };\n }\n\n this._applyFingerprint(event);\n\n event.breadcrumbs = [...(event.breadcrumbs || []), ...this._breadcrumbs];\n event.breadcrumbs = event.breadcrumbs.length > 0 ? event.breadcrumbs : undefined;\n\n return this._notifyEventProcessors([...getGlobalEventProcessors(), ...this._eventProcessors], event, hint);\n }\n}\n\n/**\n * Retruns the global event processors.\n */\nfunction getGlobalEventProcessors(): EventProcessor[] {\n const global = getGlobalObject();\n global.__SENTRY__ = global.__SENTRY__ || {};\n global.__SENTRY__.globalEventProcessors = global.__SENTRY__.globalEventProcessors || [];\n return global.__SENTRY__.globalEventProcessors;\n}\n\n/**\n * Add a EventProcessor to be kept globally.\n * @param callback EventProcessor to add\n */\nexport function addGlobalEventProcessor(callback: EventProcessor): void {\n getGlobalEventProcessors().push(callback);\n}\n","import {\n Breadcrumb,\n BreadcrumbHint,\n Client,\n Event,\n EventHint,\n Hub as HubInterface,\n Integration,\n IntegrationClass,\n Severity,\n Span,\n SpanContext,\n User,\n} from '@sentry/types';\nimport {\n consoleSandbox,\n dynamicRequire,\n getGlobalObject,\n isNodeEnv,\n logger,\n timestampWithMs,\n uuid4,\n} from '@sentry/utils';\n\nimport { Carrier, Layer } from './interfaces';\nimport { Scope } from './scope';\n\ndeclare module 'domain' {\n export let active: Domain;\n /**\n * Extension for domain interface\n */\n export interface Domain {\n __SENTRY__?: Carrier;\n }\n}\n\n/**\n * API compatibility version of this hub.\n *\n * WARNING: This number should only be incresed when the global interface\n * changes a and new methods are introduced.\n *\n * @hidden\n */\nexport const API_VERSION = 3;\n\n/**\n * Default maximum number of breadcrumbs added to an event. Can be overwritten\n * with {@link Options.maxBreadcrumbs}.\n */\nconst DEFAULT_BREADCRUMBS = 100;\n\n/**\n * Absolute maximum number of breadcrumbs added to an event. The\n * `maxBreadcrumbs` option cannot be higher than this value.\n */\nconst MAX_BREADCRUMBS = 100;\n\n/**\n * @inheritDoc\n */\nexport class Hub implements HubInterface {\n /** Is a {@link Layer}[] containing the client and scope */\n private readonly _stack: Layer[] = [];\n\n /** Contains the last event id of a captured event. */\n private _lastEventId?: string;\n\n /**\n * Creates a new instance of the hub, will push one {@link Layer} into the\n * internal stack on creation.\n *\n * @param client bound to the hub.\n * @param scope bound to the hub.\n * @param version number, higher number means higher priority.\n */\n public constructor(client?: Client, scope: Scope = new Scope(), private readonly _version: number = API_VERSION) {\n this._stack.push({ client, scope });\n }\n\n /**\n * Internal helper function to call a method on the top client if it exists.\n *\n * @param method The method to call on the client.\n * @param args Arguments to pass to the client function.\n */\n private _invokeClient(method: M, ...args: any[]): void {\n const top = this.getStackTop();\n if (top && top.client && top.client[method]) {\n (top.client as any)[method](...args, top.scope);\n }\n }\n\n /**\n * @inheritDoc\n */\n public isOlderThan(version: number): boolean {\n return this._version < version;\n }\n\n /**\n * @inheritDoc\n */\n public bindClient(client?: Client): void {\n const top = this.getStackTop();\n top.client = client;\n }\n\n /**\n * @inheritDoc\n */\n public pushScope(): Scope {\n // We want to clone the content of prev scope\n const stack = this.getStack();\n const parentScope = stack.length > 0 ? stack[stack.length - 1].scope : undefined;\n const scope = Scope.clone(parentScope);\n this.getStack().push({\n client: this.getClient(),\n scope,\n });\n return scope;\n }\n\n /**\n * @inheritDoc\n */\n public popScope(): boolean {\n return this.getStack().pop() !== undefined;\n }\n\n /**\n * @inheritDoc\n */\n public withScope(callback: (scope: Scope) => void): void {\n const scope = this.pushScope();\n try {\n callback(scope);\n } finally {\n this.popScope();\n }\n }\n\n /**\n * @inheritDoc\n */\n public getClient(): C | undefined {\n return this.getStackTop().client as C;\n }\n\n /** Returns the scope of the top stack. */\n public getScope(): Scope | undefined {\n return this.getStackTop().scope;\n }\n\n /** Returns the scope stack for domains or the process. */\n public getStack(): Layer[] {\n return this._stack;\n }\n\n /** Returns the topmost scope layer in the order domain > local > process. */\n public getStackTop(): Layer {\n return this._stack[this._stack.length - 1];\n }\n\n /**\n * @inheritDoc\n */\n public captureException(exception: any, hint?: EventHint): string {\n const eventId = (this._lastEventId = uuid4());\n let finalHint = hint;\n\n // If there's no explicit hint provided, mimick the same thing that would happen\n // in the minimal itself to create a consistent behavior.\n // We don't do this in the client, as it's the lowest level API, and doing this,\n // would prevent user from having full control over direct calls.\n if (!hint) {\n let syntheticException: Error;\n try {\n throw new Error('Sentry syntheticException');\n } catch (exception) {\n syntheticException = exception as Error;\n }\n finalHint = {\n originalException: exception,\n syntheticException,\n };\n }\n\n this._invokeClient('captureException', exception, {\n ...finalHint,\n event_id: eventId,\n });\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n public captureMessage(message: string, level?: Severity, hint?: EventHint): string {\n const eventId = (this._lastEventId = uuid4());\n let finalHint = hint;\n\n // If there's no explicit hint provided, mimick the same thing that would happen\n // in the minimal itself to create a consistent behavior.\n // We don't do this in the client, as it's the lowest level API, and doing this,\n // would prevent user from having full control over direct calls.\n if (!hint) {\n let syntheticException: Error;\n try {\n throw new Error(message);\n } catch (exception) {\n syntheticException = exception as Error;\n }\n finalHint = {\n originalException: message,\n syntheticException,\n };\n }\n\n this._invokeClient('captureMessage', message, level, {\n ...finalHint,\n event_id: eventId,\n });\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n public captureEvent(event: Event, hint?: EventHint): string {\n const eventId = (this._lastEventId = uuid4());\n this._invokeClient('captureEvent', event, {\n ...hint,\n event_id: eventId,\n });\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n public lastEventId(): string | undefined {\n return this._lastEventId;\n }\n\n /**\n * @inheritDoc\n */\n public addBreadcrumb(breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void {\n const top = this.getStackTop();\n\n if (!top.scope || !top.client) {\n return;\n }\n\n const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } =\n (top.client.getOptions && top.client.getOptions()) || {};\n\n if (maxBreadcrumbs <= 0) {\n return;\n }\n\n const timestamp = timestampWithMs();\n const mergedBreadcrumb = { timestamp, ...breadcrumb };\n const finalBreadcrumb = beforeBreadcrumb\n ? (consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint)) as Breadcrumb | null)\n : mergedBreadcrumb;\n\n if (finalBreadcrumb === null) {\n return;\n }\n\n top.scope.addBreadcrumb(finalBreadcrumb, Math.min(maxBreadcrumbs, MAX_BREADCRUMBS));\n }\n\n /**\n * @inheritDoc\n */\n public setUser(user: User | null): void {\n const top = this.getStackTop();\n if (!top.scope) {\n return;\n }\n top.scope.setUser(user);\n }\n\n /**\n * @inheritDoc\n */\n public setTags(tags: { [key: string]: string }): void {\n const top = this.getStackTop();\n if (!top.scope) {\n return;\n }\n top.scope.setTags(tags);\n }\n\n /**\n * @inheritDoc\n */\n public setExtras(extras: { [key: string]: any }): void {\n const top = this.getStackTop();\n if (!top.scope) {\n return;\n }\n top.scope.setExtras(extras);\n }\n\n /**\n * @inheritDoc\n */\n public setTag(key: string, value: string): void {\n const top = this.getStackTop();\n if (!top.scope) {\n return;\n }\n top.scope.setTag(key, value);\n }\n\n /**\n * @inheritDoc\n */\n public setExtra(key: string, extra: any): void {\n const top = this.getStackTop();\n if (!top.scope) {\n return;\n }\n top.scope.setExtra(key, extra);\n }\n\n /**\n * @inheritDoc\n */\n public setContext(name: string, context: { [key: string]: any } | null): void {\n const top = this.getStackTop();\n if (!top.scope) {\n return;\n }\n top.scope.setContext(name, context);\n }\n\n /**\n * @inheritDoc\n */\n public configureScope(callback: (scope: Scope) => void): void {\n const top = this.getStackTop();\n if (top.scope && top.client) {\n callback(top.scope);\n }\n }\n\n /**\n * @inheritDoc\n */\n public run(callback: (hub: Hub) => void): void {\n const oldHub = makeMain(this);\n try {\n callback(this);\n } finally {\n makeMain(oldHub);\n }\n }\n\n /**\n * @inheritDoc\n */\n public getIntegration(integration: IntegrationClass): T | null {\n const client = this.getClient();\n if (!client) {\n return null;\n }\n try {\n return client.getIntegration(integration);\n } catch (_oO) {\n logger.warn(`Cannot retrieve integration ${integration.id} from the current Hub`);\n return null;\n }\n }\n\n /**\n * @inheritDoc\n */\n public startSpan(spanOrSpanContext?: Span | SpanContext, forceNoChild: boolean = false): Span {\n return this._callExtensionMethod('startSpan', spanOrSpanContext, forceNoChild);\n }\n\n /**\n * @inheritDoc\n */\n public traceHeaders(): { [key: string]: string } {\n return this._callExtensionMethod<{ [key: string]: string }>('traceHeaders');\n }\n\n /**\n * Calls global extension method and binding current instance to the function call\n */\n // @ts-ignore\n private _callExtensionMethod(method: string, ...args: any[]): T {\n const carrier = getMainCarrier();\n const sentry = carrier.__SENTRY__;\n // tslint:disable-next-line: strict-type-predicates\n if (sentry && sentry.extensions && typeof sentry.extensions[method] === 'function') {\n return sentry.extensions[method].apply(this, args);\n }\n logger.warn(`Extension method ${method} couldn't be found, doing nothing.`);\n }\n}\n\n/** Returns the global shim registry. */\nexport function getMainCarrier(): Carrier {\n const carrier = getGlobalObject();\n carrier.__SENTRY__ = carrier.__SENTRY__ || {\n extensions: {},\n hub: undefined,\n };\n return carrier;\n}\n\n/**\n * Replaces the current main hub with the passed one on the global object\n *\n * @returns The old replaced hub\n */\nexport function makeMain(hub: Hub): Hub {\n const registry = getMainCarrier();\n const oldHub = getHubFromCarrier(registry);\n setHubOnCarrier(registry, hub);\n return oldHub;\n}\n\n/**\n * Returns the default hub instance.\n *\n * If a hub is already registered in the global carrier but this module\n * contains a more recent version, it replaces the registered version.\n * Otherwise, the currently registered hub will be returned.\n */\nexport function getCurrentHub(): Hub {\n // Get main carrier (global for every environment)\n const registry = getMainCarrier();\n\n // If there's no hub, or its an old API, assign a new one\n if (!hasHubOnCarrier(registry) || getHubFromCarrier(registry).isOlderThan(API_VERSION)) {\n setHubOnCarrier(registry, new Hub());\n }\n\n // Prefer domains over global if they are there (applicable only to Node environment)\n if (isNodeEnv()) {\n return getHubFromActiveDomain(registry);\n }\n // Return hub that lives on a global object\n return getHubFromCarrier(registry);\n}\n\n/**\n * Try to read the hub from an active domain, fallback to the registry if one doesnt exist\n * @returns discovered hub\n */\nfunction getHubFromActiveDomain(registry: Carrier): Hub {\n try {\n // We need to use `dynamicRequire` because `require` on it's own will be optimized by webpack.\n // We do not want this to happen, we need to try to `require` the domain node module and fail if we are in browser\n // for example so we do not have to shim it and use `getCurrentHub` universally.\n const domain = dynamicRequire(module, 'domain');\n const activeDomain = domain.active;\n\n // If there no active domain, just return global hub\n if (!activeDomain) {\n return getHubFromCarrier(registry);\n }\n\n // If there's no hub on current domain, or its an old API, assign a new one\n if (!hasHubOnCarrier(activeDomain) || getHubFromCarrier(activeDomain).isOlderThan(API_VERSION)) {\n const registryHubTopStack = getHubFromCarrier(registry).getStackTop();\n setHubOnCarrier(activeDomain, new Hub(registryHubTopStack.client, Scope.clone(registryHubTopStack.scope)));\n }\n\n // Return hub that lives on a domain\n return getHubFromCarrier(activeDomain);\n } catch (_Oo) {\n // Return hub that lives on a global object\n return getHubFromCarrier(registry);\n }\n}\n\n/**\n * This will tell whether a carrier has a hub on it or not\n * @param carrier object\n */\nfunction hasHubOnCarrier(carrier: Carrier): boolean {\n if (carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub) {\n return true;\n }\n return false;\n}\n\n/**\n * This will create a new {@link Hub} and add to the passed object on\n * __SENTRY__.hub.\n * @param carrier object\n * @hidden\n */\nexport function getHubFromCarrier(carrier: Carrier): Hub {\n if (carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub) {\n return carrier.__SENTRY__.hub;\n }\n carrier.__SENTRY__ = carrier.__SENTRY__ || {};\n carrier.__SENTRY__.hub = new Hub();\n return carrier.__SENTRY__.hub;\n}\n\n/**\n * This will set passed {@link Hub} on the passed object's __SENTRY__.hub attribute\n * @param carrier object\n * @param hub Hub\n */\nexport function setHubOnCarrier(carrier: Carrier, hub: Hub): boolean {\n if (!carrier) {\n return false;\n }\n carrier.__SENTRY__ = carrier.__SENTRY__ || {};\n carrier.__SENTRY__.hub = hub;\n return true;\n}\n","import { getCurrentHub, Hub, Scope } from '@sentry/hub';\nimport { Breadcrumb, Event, Severity, User } from '@sentry/types';\n\n/**\n * This calls a function on the current hub.\n * @param method function to call on hub.\n * @param args to pass to function.\n */\nfunction callOnHub(method: string, ...args: any[]): T {\n const hub = getCurrentHub();\n if (hub && hub[method as keyof Hub]) {\n // tslint:disable-next-line:no-unsafe-any\n return (hub[method as keyof Hub] as any)(...args);\n }\n throw new Error(`No hub defined or ${method} was not found on the hub, please open a bug report.`);\n}\n\n/**\n * Captures an exception event and sends it to Sentry.\n *\n * @param exception An exception-like object.\n * @returns The generated eventId.\n */\nexport function captureException(exception: any): string {\n let syntheticException: Error;\n try {\n throw new Error('Sentry syntheticException');\n } catch (exception) {\n syntheticException = exception as Error;\n }\n return callOnHub('captureException', exception, {\n originalException: exception,\n syntheticException,\n });\n}\n\n/**\n * Captures a message event and sends it to Sentry.\n *\n * @param message The message to send to Sentry.\n * @param level Define the level of the message.\n * @returns The generated eventId.\n */\nexport function captureMessage(message: string, level?: Severity): string {\n let syntheticException: Error;\n try {\n throw new Error(message);\n } catch (exception) {\n syntheticException = exception as Error;\n }\n return callOnHub('captureMessage', message, level, {\n originalException: message,\n syntheticException,\n });\n}\n\n/**\n * Captures a manually created event and sends it to Sentry.\n *\n * @param event The event to send to Sentry.\n * @returns The generated eventId.\n */\nexport function captureEvent(event: Event): string {\n return callOnHub('captureEvent', event);\n}\n\n/**\n * Callback to set context information onto the scope.\n * @param callback Callback function that receives Scope.\n */\nexport function configureScope(callback: (scope: Scope) => void): void {\n callOnHub('configureScope', callback);\n}\n\n/**\n * Records a new breadcrumb which will be attached to future events.\n *\n * Breadcrumbs will be added to subsequent events to provide more context on\n * user's actions prior to an error or crash.\n *\n * @param breadcrumb The breadcrumb to record.\n */\nexport function addBreadcrumb(breadcrumb: Breadcrumb): void {\n callOnHub('addBreadcrumb', breadcrumb);\n}\n\n/**\n * Sets context data with the given name.\n * @param name of the context\n * @param context Any kind of data. This data will be normailzed.\n */\nexport function setContext(name: string, context: { [key: string]: any } | null): void {\n callOnHub('setContext', name, context);\n}\n\n/**\n * Set an object that will be merged sent as extra data with the event.\n * @param extras Extras object to merge into current context.\n */\nexport function setExtras(extras: { [key: string]: any }): void {\n callOnHub('setExtras', extras);\n}\n\n/**\n * Set an object that will be merged sent as tags data with the event.\n * @param tags Tags context object to merge into current context.\n */\nexport function setTags(tags: { [key: string]: string }): void {\n callOnHub('setTags', tags);\n}\n\n/**\n * Set key:value that will be sent as extra data with the event.\n * @param key String of extra\n * @param extra Any kind of data. This data will be normailzed.\n */\n\nexport function setExtra(key: string, extra: any): void {\n callOnHub('setExtra', key, extra);\n}\n\n/**\n * Set key:value that will be sent as tags data with the event.\n * @param key String key of tag\n * @param value String value of tag\n */\nexport function setTag(key: string, value: string): void {\n callOnHub('setTag', key, value);\n}\n\n/**\n * Updates user context information for future events.\n *\n * @param user User context object to be set in the current context. Pass `null` to unset the user.\n */\nexport function setUser(user: User | null): void {\n callOnHub('setUser', user);\n}\n\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n *\n * This is essentially a convenience function for:\n *\n * pushScope();\n * callback();\n * popScope();\n *\n * @param callback that will be enclosed into push/popScope.\n */\nexport function withScope(callback: (scope: Scope) => void): void {\n callOnHub('withScope', callback);\n}\n\n/**\n * Calls a function on the latest client. Use this with caution, it's meant as\n * in \"internal\" helper so we don't need to expose every possible function in\n * the shim. It is not guaranteed that the client actually implements the\n * function.\n *\n * @param method The method to call on the client/client.\n * @param args Arguments to pass to the client/fontend.\n * @hidden\n */\nexport function _callOnClient(method: string, ...args: any[]): void {\n callOnHub('_invokeClient', method, ...args);\n}\n","import { DsnLike } from '@sentry/types';\nimport { Dsn, urlEncode } from '@sentry/utils';\n\nconst SENTRY_API_VERSION = '7';\n\n/** Helper class to provide urls to different Sentry endpoints. */\nexport class API {\n /** The internally used Dsn object. */\n private readonly _dsnObject: Dsn;\n /** Create a new instance of API */\n public constructor(public dsn: DsnLike) {\n this._dsnObject = new Dsn(dsn);\n }\n\n /** Returns the Dsn object. */\n public getDsn(): Dsn {\n return this._dsnObject;\n }\n\n /** Returns a string with auth headers in the url to the store endpoint. */\n public getStoreEndpoint(): string {\n return `${this._getBaseUrl()}${this.getStoreEndpointPath()}`;\n }\n\n /** Returns the store endpoint with auth added in url encoded. */\n public getStoreEndpointWithUrlEncodedAuth(): string {\n const dsn = this._dsnObject;\n const auth = {\n sentry_key: dsn.user, // sentry_key is currently used in tracing integration to identify internal sentry requests\n sentry_version: SENTRY_API_VERSION,\n };\n // Auth is intentionally sent as part of query string (NOT as custom HTTP header)\n // to avoid preflight CORS requests\n return `${this.getStoreEndpoint()}?${urlEncode(auth)}`;\n }\n\n /** Returns the base path of the url including the port. */\n private _getBaseUrl(): string {\n const dsn = this._dsnObject;\n const protocol = dsn.protocol ? `${dsn.protocol}:` : '';\n const port = dsn.port ? `:${dsn.port}` : '';\n return `${protocol}//${dsn.host}${port}`;\n }\n\n /** Returns only the path component for the store endpoint. */\n public getStoreEndpointPath(): string {\n const dsn = this._dsnObject;\n return `${dsn.path ? `/${dsn.path}` : ''}/api/${dsn.projectId}/store/`;\n }\n\n /** Returns an object that can be used in request headers. */\n public getRequestHeaders(clientName: string, clientVersion: string): { [key: string]: string } {\n const dsn = this._dsnObject;\n const header = [`Sentry sentry_version=${SENTRY_API_VERSION}`];\n header.push(`sentry_client=${clientName}/${clientVersion}`);\n header.push(`sentry_key=${dsn.user}`);\n if (dsn.pass) {\n header.push(`sentry_secret=${dsn.pass}`);\n }\n return {\n 'Content-Type': 'application/json',\n 'X-Sentry-Auth': header.join(', '),\n };\n }\n\n /** Returns the url to the report dialog endpoint. */\n public getReportDialogEndpoint(\n dialogOptions: {\n [key: string]: any;\n user?: { name?: string; email?: string };\n } = {},\n ): string {\n const dsn = this._dsnObject;\n const endpoint = `${this._getBaseUrl()}${dsn.path ? `/${dsn.path}` : ''}/api/embed/error-page/`;\n\n const encodedOptions = [];\n encodedOptions.push(`dsn=${dsn.toString()}`);\n for (const key in dialogOptions) {\n if (key === 'user') {\n if (!dialogOptions.user) {\n continue;\n }\n if (dialogOptions.user.name) {\n encodedOptions.push(`name=${encodeURIComponent(dialogOptions.user.name)}`);\n }\n if (dialogOptions.user.email) {\n encodedOptions.push(`email=${encodeURIComponent(dialogOptions.user.email)}`);\n }\n } else {\n encodedOptions.push(`${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key] as string)}`);\n }\n }\n if (encodedOptions.length) {\n return `${endpoint}?${encodedOptions.join('&')}`;\n }\n\n return endpoint;\n }\n}\n","import { addGlobalEventProcessor, getCurrentHub } from '@sentry/hub';\nimport { Integration, Options } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nexport const installedIntegrations: string[] = [];\n\n/** Map of integrations assigned to a client */\nexport interface IntegrationIndex {\n [key: string]: Integration;\n}\n\n/** Gets integration to install */\nexport function getIntegrationsToSetup(options: Options): Integration[] {\n const defaultIntegrations = (options.defaultIntegrations && [...options.defaultIntegrations]) || [];\n const userIntegrations = options.integrations;\n let integrations: Integration[] = [];\n if (Array.isArray(userIntegrations)) {\n const userIntegrationsNames = userIntegrations.map(i => i.name);\n const pickedIntegrationsNames: string[] = [];\n\n // Leave only unique default integrations, that were not overridden with provided user integrations\n defaultIntegrations.forEach(defaultIntegration => {\n if (\n userIntegrationsNames.indexOf(defaultIntegration.name) === -1 &&\n pickedIntegrationsNames.indexOf(defaultIntegration.name) === -1\n ) {\n integrations.push(defaultIntegration);\n pickedIntegrationsNames.push(defaultIntegration.name);\n }\n });\n\n // Don't add same user integration twice\n userIntegrations.forEach(userIntegration => {\n if (pickedIntegrationsNames.indexOf(userIntegration.name) === -1) {\n integrations.push(userIntegration);\n pickedIntegrationsNames.push(userIntegration.name);\n }\n });\n } else if (typeof userIntegrations === 'function') {\n integrations = userIntegrations(defaultIntegrations);\n integrations = Array.isArray(integrations) ? integrations : [integrations];\n } else {\n integrations = [...defaultIntegrations];\n }\n\n // Make sure that if present, `Debug` integration will always run last\n const integrationsNames = integrations.map(i => i.name);\n const alwaysLastToRun = 'Debug';\n if (integrationsNames.indexOf(alwaysLastToRun) !== -1) {\n integrations.push(...integrations.splice(integrationsNames.indexOf(alwaysLastToRun), 1));\n }\n\n return integrations;\n}\n\n/** Setup given integration */\nexport function setupIntegration(integration: Integration): void {\n if (installedIntegrations.indexOf(integration.name) !== -1) {\n return;\n }\n integration.setupOnce(addGlobalEventProcessor, getCurrentHub);\n installedIntegrations.push(integration.name);\n logger.log(`Integration installed: ${integration.name}`);\n}\n\n/**\n * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default\n * integrations are added unless they were already provided before.\n * @param integrations array of integration instances\n * @param withDefault should enable default integrations\n */\nexport function setupIntegrations(options: O): IntegrationIndex {\n const integrations: IntegrationIndex = {};\n getIntegrationsToSetup(options).forEach(integration => {\n integrations[integration.name] = integration;\n setupIntegration(integration);\n });\n return integrations;\n}\n","import { Scope } from '@sentry/hub';\nimport { Client, Event, EventHint, Integration, IntegrationClass, Options, SdkInfo, Severity } from '@sentry/types';\nimport { Dsn, isPrimitive, isThenable, logger, normalize, SyncPromise, truncate, uuid4 } from '@sentry/utils';\n\nimport { Backend, BackendClass } from './basebackend';\nimport { IntegrationIndex, setupIntegrations } from './integration';\n\n/**\n * Base implementation for all JavaScript SDK clients.\n *\n * Call the constructor with the corresponding backend constructor and options\n * specific to the client subclass. To access these options later, use\n * {@link Client.getOptions}. Also, the Backend instance is available via\n * {@link Client.getBackend}.\n *\n * If a Dsn is specified in the options, it will be parsed and stored. Use\n * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is\n * invalid, the constructor will throw a {@link SentryException}. Note that\n * without a valid Dsn, the SDK will not send any events to Sentry.\n *\n * Before sending an event via the backend, it is passed through\n * {@link BaseClient.prepareEvent} to add SDK information and scope data\n * (breadcrumbs and context). To add more custom information, override this\n * method and extend the resulting prepared event.\n *\n * To issue automatically created events (e.g. via instrumentation), use\n * {@link Client.captureEvent}. It will prepare the event and pass it through\n * the callback lifecycle. To issue auto-breadcrumbs, use\n * {@link Client.addBreadcrumb}.\n *\n * @example\n * class NodeClient extends BaseClient {\n * public constructor(options: NodeOptions) {\n * super(NodeBackend, options);\n * }\n *\n * // ...\n * }\n */\nexport abstract class BaseClient implements Client {\n /**\n * The backend used to physically interact in the enviornment. Usually, this\n * will correspond to the client. When composing SDKs, however, the Backend\n * from the root SDK will be used.\n */\n protected readonly _backend: B;\n\n /** Options passed to the SDK. */\n protected readonly _options: O;\n\n /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */\n protected readonly _dsn?: Dsn;\n\n /** Array of used integrations. */\n protected readonly _integrations: IntegrationIndex = {};\n\n /** Is the client still processing a call? */\n protected _processing: boolean = false;\n\n /**\n * Initializes this client instance.\n *\n * @param backendClass A constructor function to create the backend.\n * @param options Options for the client.\n */\n protected constructor(backendClass: BackendClass, options: O) {\n this._backend = new backendClass(options);\n this._options = options;\n\n if (options.dsn) {\n this._dsn = new Dsn(options.dsn);\n }\n\n if (this._isEnabled()) {\n this._integrations = setupIntegrations(this._options);\n }\n }\n\n /**\n * @inheritDoc\n */\n public captureException(exception: any, hint?: EventHint, scope?: Scope): string | undefined {\n let eventId: string | undefined = hint && hint.event_id;\n this._processing = true;\n\n this._getBackend()\n .eventFromException(exception, hint)\n .then(event => this._processEvent(event, hint, scope))\n .then(finalEvent => {\n // We need to check for finalEvent in case beforeSend returned null\n eventId = finalEvent && finalEvent.event_id;\n this._processing = false;\n })\n .then(null, reason => {\n logger.error(reason);\n this._processing = false;\n });\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n public captureMessage(message: string, level?: Severity, hint?: EventHint, scope?: Scope): string | undefined {\n let eventId: string | undefined = hint && hint.event_id;\n\n this._processing = true;\n\n const promisedEvent = isPrimitive(message)\n ? this._getBackend().eventFromMessage(`${message}`, level, hint)\n : this._getBackend().eventFromException(message, hint);\n\n promisedEvent\n .then(event => this._processEvent(event, hint, scope))\n .then(finalEvent => {\n // We need to check for finalEvent in case beforeSend returned null\n eventId = finalEvent && finalEvent.event_id;\n this._processing = false;\n })\n .then(null, reason => {\n logger.error(reason);\n this._processing = false;\n });\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n public captureEvent(event: Event, hint?: EventHint, scope?: Scope): string | undefined {\n let eventId: string | undefined = hint && hint.event_id;\n this._processing = true;\n\n this._processEvent(event, hint, scope)\n .then(finalEvent => {\n // We need to check for finalEvent in case beforeSend returned null\n eventId = finalEvent && finalEvent.event_id;\n this._processing = false;\n })\n .then(null, reason => {\n logger.error(reason);\n this._processing = false;\n });\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n public getDsn(): Dsn | undefined {\n return this._dsn;\n }\n\n /**\n * @inheritDoc\n */\n public getOptions(): O {\n return this._options;\n }\n\n /**\n * @inheritDoc\n */\n public flush(timeout?: number): PromiseLike {\n return this._isClientProcessing(timeout).then(status => {\n clearInterval(status.interval);\n return this._getBackend()\n .getTransport()\n .close(timeout)\n .then(transportFlushed => status.ready && transportFlushed);\n });\n }\n\n /**\n * @inheritDoc\n */\n public close(timeout?: number): PromiseLike {\n return this.flush(timeout).then(result => {\n this.getOptions().enabled = false;\n return result;\n });\n }\n\n /**\n * @inheritDoc\n */\n public getIntegrations(): IntegrationIndex {\n return this._integrations || {};\n }\n\n /**\n * @inheritDoc\n */\n public getIntegration(integration: IntegrationClass): T | null {\n try {\n return (this._integrations[integration.id] as T) || null;\n } catch (_oO) {\n logger.warn(`Cannot retrieve integration ${integration.id} from the current Client`);\n return null;\n }\n }\n\n /** Waits for the client to be done with processing. */\n protected _isClientProcessing(timeout?: number): PromiseLike<{ ready: boolean; interval: number }> {\n return new SyncPromise<{ ready: boolean; interval: number }>(resolve => {\n let ticked: number = 0;\n const tick: number = 1;\n\n let interval = 0;\n clearInterval(interval);\n\n interval = (setInterval(() => {\n if (!this._processing) {\n resolve({\n interval,\n ready: true,\n });\n } else {\n ticked += tick;\n if (timeout && ticked >= timeout) {\n resolve({\n interval,\n ready: false,\n });\n }\n }\n }, tick) as unknown) as number;\n });\n }\n\n /** Returns the current backend. */\n protected _getBackend(): B {\n return this._backend;\n }\n\n /** Determines whether this SDK is enabled and a valid Dsn is present. */\n protected _isEnabled(): boolean {\n return this.getOptions().enabled !== false && this._dsn !== undefined;\n }\n\n /**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * @param event The original event.\n * @param hint May contain additional informartion about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A new event with more information.\n */\n protected _prepareEvent(event: Event, scope?: Scope, hint?: EventHint): PromiseLike {\n const { environment, release, dist, maxValueLength = 250, normalizeDepth = 3 } = this.getOptions();\n\n const prepared: Event = { ...event };\n if (prepared.environment === undefined && environment !== undefined) {\n prepared.environment = environment;\n }\n if (prepared.release === undefined && release !== undefined) {\n prepared.release = release;\n }\n\n if (prepared.dist === undefined && dist !== undefined) {\n prepared.dist = dist;\n }\n\n if (prepared.message) {\n prepared.message = truncate(prepared.message, maxValueLength);\n }\n\n const exception = prepared.exception && prepared.exception.values && prepared.exception.values[0];\n if (exception && exception.value) {\n exception.value = truncate(exception.value, maxValueLength);\n }\n\n const request = prepared.request;\n if (request && request.url) {\n request.url = truncate(request.url, maxValueLength);\n }\n\n if (prepared.event_id === undefined) {\n prepared.event_id = hint && hint.event_id ? hint.event_id : uuid4();\n }\n\n this._addIntegrations(prepared.sdk);\n\n // We prepare the result here with a resolved Event.\n let result = SyncPromise.resolve(prepared);\n\n // This should be the last thing called, since we want that\n // {@link Hub.addEventProcessor} gets the finished prepared event.\n if (scope) {\n // In case we have a hub we reassign it.\n result = scope.applyToEvent(prepared, hint);\n }\n\n return result.then(evt => {\n // tslint:disable-next-line:strict-type-predicates\n if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {\n return this._normalizeEvent(evt, normalizeDepth);\n }\n return evt;\n });\n }\n\n /**\n * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.\n * Normalized keys:\n * - `breadcrumbs.data`\n * - `user`\n * - `contexts`\n * - `extra`\n * @param event Event\n * @returns Normalized event\n */\n protected _normalizeEvent(event: Event | null, depth: number): Event | null {\n if (!event) {\n return null;\n }\n\n // tslint:disable:no-unsafe-any\n return {\n ...event,\n ...(event.breadcrumbs && {\n breadcrumbs: event.breadcrumbs.map(b => ({\n ...b,\n ...(b.data && {\n data: normalize(b.data, depth),\n }),\n })),\n }),\n ...(event.user && {\n user: normalize(event.user, depth),\n }),\n ...(event.contexts && {\n contexts: normalize(event.contexts, depth),\n }),\n ...(event.extra && {\n extra: normalize(event.extra, depth),\n }),\n };\n }\n\n /**\n * This function adds all used integrations to the SDK info in the event.\n * @param sdkInfo The sdkInfo of the event that will be filled with all integrations.\n */\n protected _addIntegrations(sdkInfo?: SdkInfo): void {\n const integrationsArray = Object.keys(this._integrations);\n if (sdkInfo && integrationsArray.length > 0) {\n sdkInfo.integrations = integrationsArray;\n }\n }\n\n /**\n * Processes an event (either error or message) and sends it to Sentry.\n *\n * This also adds breadcrumbs and context information to the event. However,\n * platform specific meta data (such as the User's IP address) must be added\n * by the SDK implementor.\n *\n *\n * @param event The event to send to Sentry.\n * @param hint May contain additional informartion about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.\n */\n protected _processEvent(event: Event, hint?: EventHint, scope?: Scope): PromiseLike {\n const { beforeSend, sampleRate } = this.getOptions();\n\n if (!this._isEnabled()) {\n return SyncPromise.reject('SDK not enabled, will not send event.');\n }\n\n // 1.0 === 100% events are sent\n // 0.0 === 0% events are sent\n if (typeof sampleRate === 'number' && Math.random() > sampleRate) {\n return SyncPromise.reject('This event has been sampled, will not send event.');\n }\n\n return new SyncPromise((resolve, reject) => {\n this._prepareEvent(event, scope, hint)\n .then(prepared => {\n if (prepared === null) {\n reject('An event processor returned null, will not send event.');\n return;\n }\n\n let finalEvent: Event | null = prepared;\n\n const isInternalException = hint && hint.data && (hint.data as { [key: string]: any }).__sentry__ === true;\n if (isInternalException || !beforeSend) {\n this._getBackend().sendEvent(finalEvent);\n resolve(finalEvent);\n return;\n }\n\n const beforeSendResult = beforeSend(prepared, hint);\n // tslint:disable-next-line:strict-type-predicates\n if (typeof beforeSendResult === 'undefined') {\n logger.error('`beforeSend` method has to return `null` or a valid event.');\n } else if (isThenable(beforeSendResult)) {\n this._handleAsyncBeforeSend(beforeSendResult as PromiseLike, resolve, reject);\n } else {\n finalEvent = beforeSendResult as Event | null;\n\n if (finalEvent === null) {\n logger.log('`beforeSend` returned `null`, will not send event.');\n resolve(null);\n return;\n }\n\n // From here on we are really async\n this._getBackend().sendEvent(finalEvent);\n resolve(finalEvent);\n }\n })\n .then(null, reason => {\n this.captureException(reason, {\n data: {\n __sentry__: true,\n },\n originalException: reason as Error,\n });\n reject(\n `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\\nReason: ${reason}`,\n );\n });\n });\n }\n\n /**\n * Resolves before send Promise and calls resolve/reject on parent SyncPromise.\n */\n private _handleAsyncBeforeSend(\n beforeSend: PromiseLike,\n resolve: (event: Event) => void,\n reject: (reason: string) => void,\n ): void {\n beforeSend\n .then(processedEvent => {\n if (processedEvent === null) {\n reject('`beforeSend` returned `null`, will not send event.');\n return;\n }\n // From here on we are really async\n this._getBackend().sendEvent(processedEvent);\n resolve(processedEvent);\n })\n .then(null, e => {\n reject(`beforeSend rejected with ${e}`);\n });\n }\n}\n","import { Event, Response, Status, Transport } from '@sentry/types';\nimport { SyncPromise } from '@sentry/utils';\n\n/** Noop transport */\nexport class NoopTransport implements Transport {\n /**\n * @inheritDoc\n */\n public sendEvent(_: Event): PromiseLike {\n return SyncPromise.resolve({\n reason: `NoopTransport: Event has been skipped because no Dsn is configured.`,\n status: Status.Skipped,\n });\n }\n\n /**\n * @inheritDoc\n */\n public close(_?: number): PromiseLike {\n return SyncPromise.resolve(true);\n }\n}\n","import { Event, EventHint, Options, Severity, Transport } from '@sentry/types';\nimport { logger, SentryError } from '@sentry/utils';\n\nimport { NoopTransport } from './transports/noop';\n\n/**\n * Internal platform-dependent Sentry SDK Backend.\n *\n * While {@link Client} contains business logic specific to an SDK, the\n * Backend offers platform specific implementations for low-level operations.\n * These are persisting and loading information, sending events, and hooking\n * into the environment.\n *\n * Backends receive a handle to the Client in their constructor. When a\n * Backend automatically generates events, it must pass them to\n * the Client for validation and processing first.\n *\n * Usually, the Client will be of corresponding type, e.g. NodeBackend\n * receives NodeClient. However, higher-level SDKs can choose to instanciate\n * multiple Backends and delegate tasks between them. In this case, an event\n * generated by one backend might very well be sent by another one.\n *\n * The client also provides access to options via {@link Client.getOptions}.\n * @hidden\n */\nexport interface Backend {\n /** Creates a {@link Event} from an exception. */\n eventFromException(exception: any, hint?: EventHint): PromiseLike;\n\n /** Creates a {@link Event} from a plain message. */\n eventFromMessage(message: string, level?: Severity, hint?: EventHint): PromiseLike;\n\n /** Submits the event to Sentry */\n sendEvent(event: Event): void;\n\n /**\n * Returns the transport that is used by the backend.\n * Please note that the transport gets lazy initialized so it will only be there once the first event has been sent.\n *\n * @returns The transport.\n */\n getTransport(): Transport;\n}\n\n/**\n * A class object that can instanciate Backend objects.\n * @hidden\n */\nexport type BackendClass = new (options: O) => B;\n\n/**\n * This is the base implemention of a Backend.\n * @hidden\n */\nexport abstract class BaseBackend implements Backend {\n /** Options passed to the SDK. */\n protected readonly _options: O;\n\n /** Cached transport used internally. */\n protected _transport: Transport;\n\n /** Creates a new backend instance. */\n public constructor(options: O) {\n this._options = options;\n if (!this._options.dsn) {\n logger.warn('No DSN provided, backend will not do anything.');\n }\n this._transport = this._setupTransport();\n }\n\n /**\n * Sets up the transport so it can be used later to send requests.\n */\n protected _setupTransport(): Transport {\n return new NoopTransport();\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(_exception: any, _hint?: EventHint): PromiseLike {\n throw new SentryError('Backend has to implement `eventFromException` method');\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(_message: string, _level?: Severity, _hint?: EventHint): PromiseLike {\n throw new SentryError('Backend has to implement `eventFromMessage` method');\n }\n\n /**\n * @inheritDoc\n */\n public sendEvent(event: Event): void {\n this._transport.sendEvent(event).then(null, reason => {\n logger.error(`Error while sending event: ${reason}`);\n });\n }\n\n /**\n * @inheritDoc\n */\n public getTransport(): Transport {\n return this._transport;\n }\n}\n","import { getCurrentHub } from '@sentry/hub';\nimport { Client, Options } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\n/** A class object that can instanciate Client objects. */\nexport type ClientClass = new (options: O) => F;\n\n/**\n * Internal function to create a new SDK client instance. The client is\n * installed and then bound to the current scope.\n *\n * @param clientClass The client class to instanciate.\n * @param options Options to pass to the client.\n */\nexport function initAndBind(clientClass: ClientClass, options: O): void {\n if (options.debug === true) {\n logger.enable();\n }\n getCurrentHub().bindClient(new clientClass(options));\n}\n","import { Integration, WrappedFunction } from '@sentry/types';\n\nlet originalFunctionToString: () => void;\n\n/** Patch toString calls to return proper name for wrapped functions */\nexport class FunctionToString implements Integration {\n /**\n * @inheritDoc\n */\n public name: string = FunctionToString.id;\n\n /**\n * @inheritDoc\n */\n public static id: string = 'FunctionToString';\n\n /**\n * @inheritDoc\n */\n public setupOnce(): void {\n originalFunctionToString = Function.prototype.toString;\n\n Function.prototype.toString = function(this: WrappedFunction, ...args: any[]): string {\n const context = this.__sentry_original__ || this;\n // tslint:disable-next-line:no-unsafe-any\n return originalFunctionToString.apply(context, args);\n };\n }\n}\n","import { addGlobalEventProcessor, getCurrentHub } from '@sentry/hub';\nimport { Event, Integration } from '@sentry/types';\nimport { getEventDescription, isMatchingPattern, logger } from '@sentry/utils';\n\n// \"Script error.\" is hard coded into browsers for errors that it can't read.\n// this is the result of a script being pulled in from an external domain and CORS.\nconst DEFAULT_IGNORE_ERRORS = [/^Script error\\.?$/, /^Javascript error: Script error\\.? on line 0$/];\n\n/** JSDoc */\ninterface InboundFiltersOptions {\n blacklistUrls?: Array;\n ignoreErrors?: Array;\n ignoreInternal?: boolean;\n whitelistUrls?: Array;\n}\n\n/** Inbound filters configurable by the user */\nexport class InboundFilters implements Integration {\n /**\n * @inheritDoc\n */\n public name: string = InboundFilters.id;\n /**\n * @inheritDoc\n */\n public static id: string = 'InboundFilters';\n\n public constructor(private readonly _options: InboundFiltersOptions = {}) {}\n\n /**\n * @inheritDoc\n */\n public setupOnce(): void {\n addGlobalEventProcessor((event: Event) => {\n const hub = getCurrentHub();\n if (!hub) {\n return event;\n }\n const self = hub.getIntegration(InboundFilters);\n if (self) {\n const client = hub.getClient();\n const clientOptions = client ? client.getOptions() : {};\n const options = self._mergeOptions(clientOptions);\n if (self._shouldDropEvent(event, options)) {\n return null;\n }\n }\n return event;\n });\n }\n\n /** JSDoc */\n private _shouldDropEvent(event: Event, options: InboundFiltersOptions): boolean {\n if (this._isSentryError(event, options)) {\n logger.warn(`Event dropped due to being internal Sentry Error.\\nEvent: ${getEventDescription(event)}`);\n return true;\n }\n if (this._isIgnoredError(event, options)) {\n logger.warn(\n `Event dropped due to being matched by \\`ignoreErrors\\` option.\\nEvent: ${getEventDescription(event)}`,\n );\n return true;\n }\n if (this._isBlacklistedUrl(event, options)) {\n logger.warn(\n `Event dropped due to being matched by \\`blacklistUrls\\` option.\\nEvent: ${getEventDescription(\n event,\n )}.\\nUrl: ${this._getEventFilterUrl(event)}`,\n );\n return true;\n }\n if (!this._isWhitelistedUrl(event, options)) {\n logger.warn(\n `Event dropped due to not being matched by \\`whitelistUrls\\` option.\\nEvent: ${getEventDescription(\n event,\n )}.\\nUrl: ${this._getEventFilterUrl(event)}`,\n );\n return true;\n }\n return false;\n }\n\n /** JSDoc */\n private _isSentryError(event: Event, options: InboundFiltersOptions = {}): boolean {\n if (!options.ignoreInternal) {\n return false;\n }\n\n try {\n return (\n (event &&\n event.exception &&\n event.exception.values &&\n event.exception.values[0] &&\n event.exception.values[0].type === 'SentryError') ||\n false\n );\n } catch (_oO) {\n return false;\n }\n }\n\n /** JSDoc */\n private _isIgnoredError(event: Event, options: InboundFiltersOptions = {}): boolean {\n if (!options.ignoreErrors || !options.ignoreErrors.length) {\n return false;\n }\n\n return this._getPossibleEventMessages(event).some(message =>\n // Not sure why TypeScript complains here...\n (options.ignoreErrors as Array).some(pattern => isMatchingPattern(message, pattern)),\n );\n }\n\n /** JSDoc */\n private _isBlacklistedUrl(event: Event, options: InboundFiltersOptions = {}): boolean {\n // TODO: Use Glob instead?\n if (!options.blacklistUrls || !options.blacklistUrls.length) {\n return false;\n }\n const url = this._getEventFilterUrl(event);\n return !url ? false : options.blacklistUrls.some(pattern => isMatchingPattern(url, pattern));\n }\n\n /** JSDoc */\n private _isWhitelistedUrl(event: Event, options: InboundFiltersOptions = {}): boolean {\n // TODO: Use Glob instead?\n if (!options.whitelistUrls || !options.whitelistUrls.length) {\n return true;\n }\n const url = this._getEventFilterUrl(event);\n return !url ? true : options.whitelistUrls.some(pattern => isMatchingPattern(url, pattern));\n }\n\n /** JSDoc */\n private _mergeOptions(clientOptions: InboundFiltersOptions = {}): InboundFiltersOptions {\n return {\n blacklistUrls: [...(this._options.blacklistUrls || []), ...(clientOptions.blacklistUrls || [])],\n ignoreErrors: [\n ...(this._options.ignoreErrors || []),\n ...(clientOptions.ignoreErrors || []),\n ...DEFAULT_IGNORE_ERRORS,\n ],\n ignoreInternal: typeof this._options.ignoreInternal !== 'undefined' ? this._options.ignoreInternal : true,\n whitelistUrls: [...(this._options.whitelistUrls || []), ...(clientOptions.whitelistUrls || [])],\n };\n }\n\n /** JSDoc */\n private _getPossibleEventMessages(event: Event): string[] {\n if (event.message) {\n return [event.message];\n }\n if (event.exception) {\n try {\n const { type = '', value = '' } = (event.exception.values && event.exception.values[0]) || {};\n return [`${value}`, `${type}: ${value}`];\n } catch (oO) {\n logger.error(`Cannot extract message for event ${getEventDescription(event)}`);\n return [];\n }\n }\n return [];\n }\n\n /** JSDoc */\n private _getEventFilterUrl(event: Event): string | null {\n try {\n if (event.stacktrace) {\n const frames = event.stacktrace.frames;\n return (frames && frames[frames.length - 1].filename) || null;\n }\n if (event.exception) {\n const frames =\n event.exception.values && event.exception.values[0].stacktrace && event.exception.values[0].stacktrace.frames;\n return (frames && frames[frames.length - 1].filename) || null;\n }\n return null;\n } catch (oO) {\n logger.error(`Cannot extract url for event ${getEventDescription(event)}`);\n return null;\n }\n }\n}\n","// tslint:disable:object-literal-sort-keys\n\n/**\n * This was originally forked from https://github.com/occ/TraceKit, but has since been\n * largely modified and is now maintained as part of Sentry JS SDK.\n */\n\n/**\n * An object representing a single stack frame.\n * {Object} StackFrame\n * {string} url The JavaScript or HTML file URL.\n * {string} func The function name, or empty for anonymous functions (if guessing did not work).\n * {string[]?} args The arguments passed to the function, if known.\n * {number=} line The line number, if known.\n * {number=} column The column number, if known.\n * {string[]} context An array of source code lines; the middle element corresponds to the correct line#.\n */\nexport interface StackFrame {\n url: string;\n func: string;\n args: string[];\n line: number | null;\n column: number | null;\n}\n\n/**\n * An object representing a JavaScript stack trace.\n * {Object} StackTrace\n * {string} name The name of the thrown exception.\n * {string} message The exception error message.\n * {TraceKit.StackFrame[]} stack An array of stack frames.\n */\nexport interface StackTrace {\n name: string;\n message: string;\n mechanism?: string;\n stack: StackFrame[];\n failed?: boolean;\n}\n\n// global reference to slice\nconst UNKNOWN_FUNCTION = '?';\n\n// Chromium based browsers: Chrome, Brave, new Opera, new Edge\nconst chrome = /^\\s*at (?:(.*?) ?\\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack||[-a-z]+:|.*bundle|\\/).*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i;\n// gecko regex: `(?:bundle|\\d+\\.js)`: `bundle` is for react native, `\\d+\\.js` also but specifically for ram bundles because it\n// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js\n// We need this specific case for now because we want no other regex to match.\nconst gecko = /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension).*?:\\/.*?|\\[native code\\]|[^@]*(?:bundle|\\d+\\.js))(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nconst winjs = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\nconst geckoEval = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\nconst chromeEval = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/;\n\n/** JSDoc */\nexport function computeStackTrace(ex: any): StackTrace {\n // tslint:disable:no-unsafe-any\n\n let stack = null;\n const popSize: number = ex && ex.framesToPop;\n\n try {\n // This must be tried first because Opera 10 *destroys*\n // its stacktrace property if you try to access the stack\n // property first!!\n stack = computeStackTraceFromStacktraceProp(ex);\n if (stack) {\n return popFrames(stack, popSize);\n }\n } catch (e) {\n // no-empty\n }\n\n try {\n stack = computeStackTraceFromStackProp(ex);\n if (stack) {\n return popFrames(stack, popSize);\n }\n } catch (e) {\n // no-empty\n }\n\n return {\n message: extractMessage(ex),\n name: ex && ex.name,\n stack: [],\n failed: true,\n };\n}\n\n/** JSDoc */\n// tslint:disable-next-line:cyclomatic-complexity\nfunction computeStackTraceFromStackProp(ex: any): StackTrace | null {\n // tslint:disable:no-conditional-assignment\n if (!ex || !ex.stack) {\n return null;\n }\n\n const stack = [];\n const lines = ex.stack.split('\\n');\n let isEval;\n let submatch;\n let parts;\n let element;\n\n for (let i = 0; i < lines.length; ++i) {\n if ((parts = chrome.exec(lines[i]))) {\n const isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line\n isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n if (isEval && (submatch = chromeEval.exec(parts[2]))) {\n // throw out eval line/column and use top-most line/column number\n parts[2] = submatch[1]; // url\n parts[3] = submatch[2]; // line\n parts[4] = submatch[3]; // column\n }\n element = {\n // working with the regexp above is super painful. it is quite a hack, but just stripping the `address at `\n // prefix here seems like the quickest solution for now.\n url: parts[2] && parts[2].indexOf('address at ') === 0 ? parts[2].substr('address at '.length) : parts[2],\n func: parts[1] || UNKNOWN_FUNCTION,\n args: isNative ? [parts[2]] : [],\n line: parts[3] ? +parts[3] : null,\n column: parts[4] ? +parts[4] : null,\n };\n } else if ((parts = winjs.exec(lines[i]))) {\n element = {\n url: parts[2],\n func: parts[1] || UNKNOWN_FUNCTION,\n args: [],\n line: +parts[3],\n column: parts[4] ? +parts[4] : null,\n };\n } else if ((parts = gecko.exec(lines[i]))) {\n isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n if (isEval && (submatch = geckoEval.exec(parts[3]))) {\n // throw out eval line/column and use top-most line number\n parts[1] = parts[1] || `eval`;\n parts[3] = submatch[1];\n parts[4] = submatch[2];\n parts[5] = ''; // no column when eval\n } else if (i === 0 && !parts[5] && ex.columnNumber !== void 0) {\n // FireFox uses this awesome columnNumber property for its top frame\n // Also note, Firefox's column number is 0-based and everything else expects 1-based,\n // so adding 1\n // NOTE: this hack doesn't work if top-most frame is eval\n stack[0].column = (ex.columnNumber as number) + 1;\n }\n element = {\n url: parts[3],\n func: parts[1] || UNKNOWN_FUNCTION,\n args: parts[2] ? parts[2].split(',') : [],\n line: parts[4] ? +parts[4] : null,\n column: parts[5] ? +parts[5] : null,\n };\n } else {\n continue;\n }\n\n if (!element.func && element.line) {\n element.func = UNKNOWN_FUNCTION;\n }\n\n stack.push(element);\n }\n\n if (!stack.length) {\n return null;\n }\n\n return {\n message: extractMessage(ex),\n name: ex.name,\n stack,\n };\n}\n\n/** JSDoc */\nfunction computeStackTraceFromStacktraceProp(ex: any): StackTrace | null {\n if (!ex || !ex.stacktrace) {\n return null;\n }\n // Access and store the stacktrace property before doing ANYTHING\n // else to it because Opera is not very good at providing it\n // reliably in other circumstances.\n const stacktrace = ex.stacktrace;\n const opera10Regex = / line (\\d+).*script (?:in )?(\\S+)(?:: in function (\\S+))?$/i;\n const opera11Regex = / line (\\d+), column (\\d+)\\s*(?:in (?:]+)>|([^\\)]+))\\((.*)\\))? in (.*):\\s*$/i;\n const lines = stacktrace.split('\\n');\n const stack = [];\n let parts;\n\n for (let line = 0; line < lines.length; line += 2) {\n // tslint:disable:no-conditional-assignment\n let element = null;\n if ((parts = opera10Regex.exec(lines[line]))) {\n element = {\n url: parts[2],\n func: parts[3],\n args: [],\n line: +parts[1],\n column: null,\n };\n } else if ((parts = opera11Regex.exec(lines[line]))) {\n element = {\n url: parts[6],\n func: parts[3] || parts[4],\n args: parts[5] ? parts[5].split(',') : [],\n line: +parts[1],\n column: +parts[2],\n };\n }\n\n if (element) {\n if (!element.func && element.line) {\n element.func = UNKNOWN_FUNCTION;\n }\n stack.push(element);\n }\n }\n\n if (!stack.length) {\n return null;\n }\n\n return {\n message: extractMessage(ex),\n name: ex.name,\n stack,\n };\n}\n\n/** Remove N number of frames from the stack */\nfunction popFrames(stacktrace: StackTrace, popSize: number): StackTrace {\n try {\n return {\n ...stacktrace,\n stack: stacktrace.stack.slice(popSize),\n };\n } catch (e) {\n return stacktrace;\n }\n}\n\n/**\n * There are cases where stacktrace.message is an Event object\n * https://github.com/getsentry/sentry-javascript/issues/1949\n * In this specific case we try to extract stacktrace.message.error.message\n */\nfunction extractMessage(ex: any): string {\n const message = ex && ex.message;\n if (!message) {\n return 'No error message';\n }\n if (message.error && typeof message.error.message === 'string') {\n return message.error.message;\n }\n return message;\n}\n","import { Event, Exception, StackFrame } from '@sentry/types';\nimport { extractExceptionKeysForMessage, isEvent, normalizeToSize } from '@sentry/utils';\n\nimport { computeStackTrace, StackFrame as TraceKitStackFrame, StackTrace as TraceKitStackTrace } from './tracekit';\n\nconst STACKTRACE_LIMIT = 50;\n\n/**\n * This function creates an exception from an TraceKitStackTrace\n * @param stacktrace TraceKitStackTrace that will be converted to an exception\n * @hidden\n */\nexport function exceptionFromStacktrace(stacktrace: TraceKitStackTrace): Exception {\n const frames = prepareFramesForEvent(stacktrace.stack);\n\n const exception: Exception = {\n type: stacktrace.name,\n value: stacktrace.message,\n };\n\n if (frames && frames.length) {\n exception.stacktrace = { frames };\n }\n\n // tslint:disable-next-line:strict-type-predicates\n if (exception.type === undefined && exception.value === '') {\n exception.value = 'Unrecoverable error caught';\n }\n\n return exception;\n}\n\n/**\n * @hidden\n */\nexport function eventFromPlainObject(exception: {}, syntheticException?: Error, rejection?: boolean): Event {\n const event: Event = {\n exception: {\n values: [\n {\n type: isEvent(exception) ? exception.constructor.name : rejection ? 'UnhandledRejection' : 'Error',\n value: `Non-Error ${\n rejection ? 'promise rejection' : 'exception'\n } captured with keys: ${extractExceptionKeysForMessage(exception)}`,\n },\n ],\n },\n extra: {\n __serialized__: normalizeToSize(exception),\n },\n };\n\n if (syntheticException) {\n const stacktrace = computeStackTrace(syntheticException);\n const frames = prepareFramesForEvent(stacktrace.stack);\n event.stacktrace = {\n frames,\n };\n }\n\n return event;\n}\n\n/**\n * @hidden\n */\nexport function eventFromStacktrace(stacktrace: TraceKitStackTrace): Event {\n const exception = exceptionFromStacktrace(stacktrace);\n\n return {\n exception: {\n values: [exception],\n },\n };\n}\n\n/**\n * @hidden\n */\nexport function prepareFramesForEvent(stack: TraceKitStackFrame[]): StackFrame[] {\n if (!stack || !stack.length) {\n return [];\n }\n\n let localStack = stack;\n\n const firstFrameFunction = localStack[0].func || '';\n const lastFrameFunction = localStack[localStack.length - 1].func || '';\n\n // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call)\n if (firstFrameFunction.indexOf('captureMessage') !== -1 || firstFrameFunction.indexOf('captureException') !== -1) {\n localStack = localStack.slice(1);\n }\n\n // If stack ends with one of our internal API calls, remove it (ends, meaning it's the bottom of the stack - aka top-most call)\n if (lastFrameFunction.indexOf('sentryWrapped') !== -1) {\n localStack = localStack.slice(0, -1);\n }\n\n // The frame where the crash happened, should be the last entry in the array\n return localStack\n .map(\n (frame: TraceKitStackFrame): StackFrame => ({\n colno: frame.column === null ? undefined : frame.column,\n filename: frame.url || localStack[0].url,\n function: frame.func || '?',\n in_app: true,\n lineno: frame.line === null ? undefined : frame.line,\n }),\n )\n .slice(0, STACKTRACE_LIMIT)\n .reverse();\n}\n","import { Event } from '@sentry/types';\nimport {\n addExceptionMechanism,\n addExceptionTypeValue,\n isDOMError,\n isDOMException,\n isError,\n isErrorEvent,\n isEvent,\n isPlainObject,\n} from '@sentry/utils';\n\nimport { eventFromPlainObject, eventFromStacktrace, prepareFramesForEvent } from './parsers';\nimport { computeStackTrace } from './tracekit';\n\n/** JSDoc */\nexport function eventFromUnknownInput(\n exception: unknown,\n syntheticException?: Error,\n options: {\n rejection?: boolean;\n attachStacktrace?: boolean;\n } = {},\n): Event {\n let event: Event;\n\n if (isErrorEvent(exception as ErrorEvent) && (exception as ErrorEvent).error) {\n // If it is an ErrorEvent with `error` property, extract it to get actual Error\n const errorEvent = exception as ErrorEvent;\n exception = errorEvent.error; // tslint:disable-line:no-parameter-reassignment\n event = eventFromStacktrace(computeStackTrace(exception as Error));\n return event;\n }\n if (isDOMError(exception as DOMError) || isDOMException(exception as DOMException)) {\n // If it is a DOMError or DOMException (which are legacy APIs, but still supported in some browsers)\n // then we just extract the name and message, as they don't provide anything else\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMError\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMException\n const domException = exception as DOMException;\n const name = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');\n const message = domException.message ? `${name}: ${domException.message}` : name;\n\n event = eventFromString(message, syntheticException, options);\n addExceptionTypeValue(event, message);\n return event;\n }\n if (isError(exception as Error)) {\n // we have a real Error object, do nothing\n event = eventFromStacktrace(computeStackTrace(exception as Error));\n return event;\n }\n if (isPlainObject(exception) || isEvent(exception)) {\n // If it is plain Object or Event, serialize it manually and extract options\n // This will allow us to group events based on top-level keys\n // which is much better than creating new group when any key/value change\n const objectException = exception as {};\n event = eventFromPlainObject(objectException, syntheticException, options.rejection);\n addExceptionMechanism(event, {\n synthetic: true,\n });\n return event;\n }\n\n // If none of previous checks were valid, then it means that it's not:\n // - an instance of DOMError\n // - an instance of DOMException\n // - an instance of Event\n // - an instance of Error\n // - a valid ErrorEvent (one with an error property)\n // - a plain Object\n //\n // So bail out and capture it as a simple message:\n event = eventFromString(exception as string, syntheticException, options);\n addExceptionTypeValue(event, `${exception}`, undefined);\n addExceptionMechanism(event, {\n synthetic: true,\n });\n\n return event;\n}\n\n// this._options.attachStacktrace\n/** JSDoc */\nexport function eventFromString(\n input: string,\n syntheticException?: Error,\n options: {\n attachStacktrace?: boolean;\n } = {},\n): Event {\n const event: Event = {\n message: input,\n };\n\n if (options.attachStacktrace && syntheticException) {\n const stacktrace = computeStackTrace(syntheticException);\n const frames = prepareFramesForEvent(stacktrace.stack);\n event.stacktrace = {\n frames,\n };\n }\n\n return event;\n}\n","import { API } from '@sentry/core';\nimport { Event, Response, Transport, TransportOptions } from '@sentry/types';\nimport { PromiseBuffer, SentryError } from '@sentry/utils';\n\n/** Base Transport class implementation */\nexport abstract class BaseTransport implements Transport {\n /**\n * @inheritDoc\n */\n public url: string;\n\n /** A simple buffer holding all requests. */\n protected readonly _buffer: PromiseBuffer = new PromiseBuffer(30);\n\n public constructor(public options: TransportOptions) {\n this.url = new API(this.options.dsn).getStoreEndpointWithUrlEncodedAuth();\n }\n\n /**\n * @inheritDoc\n */\n public sendEvent(_: Event): PromiseLike {\n throw new SentryError('Transport Class has to implement `sendEvent` method');\n }\n\n /**\n * @inheritDoc\n */\n public close(timeout?: number): PromiseLike {\n return this._buffer.drain(timeout);\n }\n}\n","import { Event, Response, Status } from '@sentry/types';\nimport { getGlobalObject, logger, parseRetryAfterHeader, supportsReferrerPolicy, SyncPromise } from '@sentry/utils';\n\nimport { BaseTransport } from './base';\n\nconst global = getGlobalObject();\n\n/** `fetch` based transport */\nexport class FetchTransport extends BaseTransport {\n /** Locks transport after receiving 429 response */\n private _disabledUntil: Date = new Date(Date.now());\n\n /**\n * @inheritDoc\n */\n public sendEvent(event: Event): PromiseLike {\n if (new Date(Date.now()) < this._disabledUntil) {\n return Promise.reject({\n event,\n reason: `Transport locked till ${this._disabledUntil} due to too many requests.`,\n status: 429,\n });\n }\n\n const defaultOptions: RequestInit = {\n body: JSON.stringify(event),\n method: 'POST',\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 referrerPolicy: (supportsReferrerPolicy() ? 'origin' : '') as ReferrerPolicy,\n };\n\n if (this.options.headers !== undefined) {\n defaultOptions.headers = this.options.headers;\n }\n\n return this._buffer.add(\n new SyncPromise((resolve, reject) => {\n global\n .fetch(this.url, defaultOptions)\n .then(response => {\n const status = Status.fromHttpCode(response.status);\n\n if (status === Status.Success) {\n resolve({ status });\n return;\n }\n\n if (status === Status.RateLimit) {\n const now = Date.now();\n this._disabledUntil = new Date(now + parseRetryAfterHeader(now, response.headers.get('Retry-After')));\n logger.warn(`Too many requests, backing off till: ${this._disabledUntil}`);\n }\n\n reject(response);\n })\n .catch(reject);\n }),\n );\n }\n}\n","import { Event, Response, Status } from '@sentry/types';\nimport { logger, parseRetryAfterHeader, SyncPromise } from '@sentry/utils';\n\nimport { BaseTransport } from './base';\n\n/** `XHR` based transport */\nexport class XHRTransport extends BaseTransport {\n /** Locks transport after receiving 429 response */\n private _disabledUntil: Date = new Date(Date.now());\n\n /**\n * @inheritDoc\n */\n public sendEvent(event: Event): PromiseLike {\n if (new Date(Date.now()) < this._disabledUntil) {\n return Promise.reject({\n event,\n reason: `Transport locked till ${this._disabledUntil} due to too many requests.`,\n status: 429,\n });\n }\n\n return this._buffer.add(\n new SyncPromise((resolve, reject) => {\n const request = new XMLHttpRequest();\n\n request.onreadystatechange = () => {\n if (request.readyState !== 4) {\n return;\n }\n\n const status = Status.fromHttpCode(request.status);\n\n if (status === Status.Success) {\n resolve({ status });\n return;\n }\n\n if (status === Status.RateLimit) {\n const now = Date.now();\n this._disabledUntil = new Date(now + parseRetryAfterHeader(now, request.getResponseHeader('Retry-After')));\n logger.warn(`Too many requests, backing off till: ${this._disabledUntil}`);\n }\n\n reject(request);\n };\n\n request.open('POST', this.url);\n for (const header in this.options.headers) {\n if (this.options.headers.hasOwnProperty(header)) {\n request.setRequestHeader(header, this.options.headers[header]);\n }\n }\n request.send(JSON.stringify(event));\n }),\n );\n }\n}\n","import { BaseBackend } from '@sentry/core';\nimport { Event, EventHint, Options, Severity, Transport } from '@sentry/types';\nimport { addExceptionMechanism, supportsFetch, SyncPromise } from '@sentry/utils';\n\nimport { eventFromString, eventFromUnknownInput } from './eventbuilder';\nimport { FetchTransport, XHRTransport } from './transports';\n\n/**\n * Configuration options for the Sentry Browser SDK.\n * @see BrowserClient for more information.\n */\nexport interface BrowserOptions extends Options {\n /**\n * A pattern for error URLs which should not be sent to Sentry.\n * To whitelist certain errors instead, use {@link Options.whitelistUrls}.\n * By default, all errors will be sent.\n */\n blacklistUrls?: Array;\n\n /**\n * A pattern for error URLs which should exclusively be sent to Sentry.\n * This is the opposite of {@link Options.blacklistUrls}.\n * By default, all errors will be sent.\n */\n whitelistUrls?: Array;\n}\n\n/**\n * The Sentry Browser SDK Backend.\n * @hidden\n */\nexport class BrowserBackend extends BaseBackend {\n /**\n * @inheritDoc\n */\n protected _setupTransport(): Transport {\n if (!this._options.dsn) {\n // We return the noop transport here in case there is no Dsn.\n return super._setupTransport();\n }\n\n const transportOptions = {\n ...this._options.transportOptions,\n dsn: this._options.dsn,\n };\n\n if (this._options.transport) {\n return new this._options.transport(transportOptions);\n }\n if (supportsFetch()) {\n return new FetchTransport(transportOptions);\n }\n return new XHRTransport(transportOptions);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(exception: any, hint?: EventHint): PromiseLike {\n const syntheticException = (hint && hint.syntheticException) || undefined;\n const event = eventFromUnknownInput(exception, syntheticException, {\n attachStacktrace: this._options.attachStacktrace,\n });\n addExceptionMechanism(event, {\n handled: true,\n type: 'generic',\n });\n event.level = Severity.Error;\n if (hint && hint.event_id) {\n event.event_id = hint.event_id;\n }\n return SyncPromise.resolve(event);\n }\n /**\n * @inheritDoc\n */\n public eventFromMessage(message: string, level: Severity = Severity.Info, hint?: EventHint): PromiseLike {\n const syntheticException = (hint && hint.syntheticException) || undefined;\n const event = eventFromString(message, syntheticException, {\n attachStacktrace: this._options.attachStacktrace,\n });\n event.level = level;\n if (hint && hint.event_id) {\n event.event_id = hint.event_id;\n }\n return SyncPromise.resolve(event);\n }\n}\n","export const SDK_NAME = 'sentry.javascript.browser';\nexport const SDK_VERSION = '5.14.1';\n","import { API, BaseClient, Scope } from '@sentry/core';\nimport { DsnLike, Event, EventHint } from '@sentry/types';\nimport { getGlobalObject, logger } from '@sentry/utils';\n\nimport { BrowserBackend, BrowserOptions } from './backend';\nimport { SDK_NAME, SDK_VERSION } from './version';\n\n/**\n * All properties the report dialog supports\n */\nexport interface ReportDialogOptions {\n [key: string]: any;\n eventId?: string;\n dsn?: DsnLike;\n user?: {\n email?: string;\n name?: string;\n };\n lang?: string;\n title?: string;\n subtitle?: string;\n subtitle2?: string;\n labelName?: string;\n labelEmail?: string;\n labelComments?: string;\n labelClose?: string;\n labelSubmit?: string;\n errorGeneric?: string;\n errorFormEntry?: string;\n successMessage?: string;\n /** Callback after reportDialog showed up */\n onLoad?(): void;\n}\n\n/**\n * The Sentry Browser SDK Client.\n *\n * @see BrowserOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class BrowserClient extends BaseClient {\n /**\n * Creates a new Browser SDK instance.\n *\n * @param options Configuration options for this SDK.\n */\n public constructor(options: BrowserOptions = {}) {\n super(BrowserBackend, options);\n }\n\n /**\n * @inheritDoc\n */\n protected _prepareEvent(event: Event, scope?: Scope, hint?: EventHint): PromiseLike {\n event.platform = event.platform || 'javascript';\n event.sdk = {\n ...event.sdk,\n name: SDK_NAME,\n packages: [\n ...((event.sdk && event.sdk.packages) || []),\n {\n name: 'npm:@sentry/browser',\n version: SDK_VERSION,\n },\n ],\n version: SDK_VERSION,\n };\n\n return super._prepareEvent(event, scope, hint);\n }\n\n /**\n * Show a report dialog to the user to send feedback to a specific event.\n *\n * @param options Set individual options for the dialog\n */\n public showReportDialog(options: ReportDialogOptions = {}): void {\n // doesn't work without a document (React Native)\n const document = getGlobalObject().document;\n if (!document) {\n return;\n }\n\n if (!this._isEnabled()) {\n logger.error('Trying to call showReportDialog with Sentry Client is disabled');\n return;\n }\n\n const dsn = options.dsn || this.getDsn();\n\n if (!options.eventId) {\n logger.error('Missing `eventId` option in showReportDialog call');\n return;\n }\n\n if (!dsn) {\n logger.error('Missing `Dsn` option in showReportDialog call');\n return;\n }\n\n const script = document.createElement('script');\n script.async = true;\n script.src = new API(dsn).getReportDialogEndpoint(options);\n\n if (options.onLoad) {\n script.onload = options.onLoad;\n }\n\n (document.head || document.body).appendChild(script);\n }\n}\n","import { captureException, withScope } from '@sentry/core';\nimport { Event as SentryEvent, Mechanism, Scope, WrappedFunction } from '@sentry/types';\nimport { addExceptionMechanism, addExceptionTypeValue } from '@sentry/utils';\n\nlet ignoreOnError: number = 0;\n\n/**\n * @hidden\n */\nexport function shouldIgnoreOnError(): boolean {\n return ignoreOnError > 0;\n}\n\n/**\n * @hidden\n */\nexport function ignoreNextOnError(): void {\n // onerror should trigger before setTimeout\n ignoreOnError += 1;\n setTimeout(() => {\n ignoreOnError -= 1;\n });\n}\n\n/**\n * Instruments the given function and sends an event to Sentry every time the\n * function throws an exception.\n *\n * @param fn A function to wrap.\n * @returns The wrapped function.\n * @hidden\n */\nexport function wrap(\n fn: WrappedFunction,\n options: {\n mechanism?: Mechanism;\n } = {},\n before?: WrappedFunction,\n): any {\n // tslint:disable-next-line:strict-type-predicates\n if (typeof fn !== 'function') {\n return fn;\n }\n\n try {\n // We don't wanna wrap it twice\n if (fn.__sentry__) {\n return fn;\n }\n\n // If this has already been wrapped in the past, return that wrapped function\n if (fn.__sentry_wrapped__) {\n return fn.__sentry_wrapped__;\n }\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n // Bail on wrapping and return the function as-is (defers to window.onerror).\n return fn;\n }\n\n const sentryWrapped: WrappedFunction = function(this: any): void {\n const args = Array.prototype.slice.call(arguments);\n\n // tslint:disable:no-unsafe-any\n try {\n // tslint:disable-next-line:strict-type-predicates\n if (before && typeof before === 'function') {\n before.apply(this, arguments);\n }\n\n const wrappedArguments = args.map((arg: any) => wrap(arg, options));\n\n if (fn.handleEvent) {\n // Attempt to invoke user-land function\n // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n // means the sentry.javascript SDK caught an error invoking your application code. This\n // is expected behavior and NOT indicative of a bug with sentry.javascript.\n return fn.handleEvent.apply(this, wrappedArguments);\n }\n // Attempt to invoke user-land function\n // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n // means the sentry.javascript SDK caught an error invoking your application code. This\n // is expected behavior and NOT indicative of a bug with sentry.javascript.\n return fn.apply(this, wrappedArguments);\n // tslint:enable:no-unsafe-any\n } catch (ex) {\n ignoreNextOnError();\n\n withScope((scope: Scope) => {\n scope.addEventProcessor((event: SentryEvent) => {\n const processedEvent = { ...event };\n\n if (options.mechanism) {\n addExceptionTypeValue(processedEvent, undefined, undefined);\n addExceptionMechanism(processedEvent, options.mechanism);\n }\n\n processedEvent.extra = {\n ...processedEvent.extra,\n arguments: args,\n };\n\n return processedEvent;\n });\n\n captureException(ex);\n });\n\n throw ex;\n }\n };\n\n // Accessing some objects may throw\n // ref: https://github.com/getsentry/sentry-javascript/issues/1168\n try {\n for (const property in fn) {\n if (Object.prototype.hasOwnProperty.call(fn, property)) {\n sentryWrapped[property] = fn[property];\n }\n }\n } catch (_oO) {} // tslint:disable-line:no-empty\n\n fn.prototype = fn.prototype || {};\n sentryWrapped.prototype = fn.prototype;\n\n Object.defineProperty(fn, '__sentry_wrapped__', {\n enumerable: false,\n value: sentryWrapped,\n });\n\n // Signal that this function has been wrapped/filled already\n // for both debugging and to prevent it to being wrapped/filled twice\n Object.defineProperties(sentryWrapped, {\n __sentry__: {\n enumerable: false,\n value: true,\n },\n __sentry_original__: {\n enumerable: false,\n value: fn,\n },\n });\n\n // Restore original function name (not all browsers allow that)\n try {\n const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name') as PropertyDescriptor;\n if (descriptor.configurable) {\n Object.defineProperty(sentryWrapped, 'name', {\n get(): string {\n return fn.name;\n },\n });\n }\n } catch (_oO) {\n /*no-empty*/\n }\n\n return sentryWrapped;\n}\n","import { getCurrentHub } from '@sentry/core';\nimport { Event, Integration, Severity } from '@sentry/types';\nimport {\n addExceptionMechanism,\n addInstrumentationHandler,\n getLocationHref,\n isErrorEvent,\n isPrimitive,\n isString,\n logger,\n} from '@sentry/utils';\n\nimport { eventFromUnknownInput } from '../eventbuilder';\nimport { shouldIgnoreOnError } from '../helpers';\n\n/** JSDoc */\ninterface GlobalHandlersIntegrations {\n onerror: boolean;\n onunhandledrejection: boolean;\n}\n\n/** Global handlers */\nexport class GlobalHandlers implements Integration {\n /**\n * @inheritDoc\n */\n public name: string = GlobalHandlers.id;\n\n /**\n * @inheritDoc\n */\n public static id: string = 'GlobalHandlers';\n\n /** JSDoc */\n private readonly _options: GlobalHandlersIntegrations;\n\n /** JSDoc */\n private _onErrorHandlerInstalled: boolean = false;\n\n /** JSDoc */\n private _onUnhandledRejectionHandlerInstalled: boolean = false;\n\n /** JSDoc */\n public constructor(options?: GlobalHandlersIntegrations) {\n this._options = {\n onerror: true,\n onunhandledrejection: true,\n ...options,\n };\n }\n /**\n * @inheritDoc\n */\n public setupOnce(): void {\n Error.stackTraceLimit = 50;\n\n if (this._options.onerror) {\n logger.log('Global Handler attached: onerror');\n this._installGlobalOnErrorHandler();\n }\n\n if (this._options.onunhandledrejection) {\n logger.log('Global Handler attached: onunhandledrejection');\n this._installGlobalOnUnhandledRejectionHandler();\n }\n }\n\n /** JSDoc */\n private _installGlobalOnErrorHandler(): void {\n if (this._onErrorHandlerInstalled) {\n return;\n }\n\n addInstrumentationHandler({\n callback: (data: { msg: any; url: any; line: any; column: any; error: any }) => {\n const error = data.error;\n const currentHub = getCurrentHub();\n const hasIntegration = currentHub.getIntegration(GlobalHandlers);\n const isFailedOwnDelivery = error && error.__sentry_own_request__ === true;\n\n if (!hasIntegration || shouldIgnoreOnError() || isFailedOwnDelivery) {\n return;\n }\n\n const client = currentHub.getClient();\n const event = isPrimitive(error)\n ? this._eventFromIncompleteOnError(data.msg, data.url, data.line, data.column)\n : this._enhanceEventWithInitialFrame(\n eventFromUnknownInput(error, undefined, {\n attachStacktrace: client && client.getOptions().attachStacktrace,\n rejection: false,\n }),\n data.url,\n data.line,\n data.column,\n );\n\n addExceptionMechanism(event, {\n handled: false,\n type: 'onerror',\n });\n\n currentHub.captureEvent(event, {\n originalException: error,\n });\n },\n type: 'error',\n });\n\n this._onErrorHandlerInstalled = true;\n }\n\n /** JSDoc */\n private _installGlobalOnUnhandledRejectionHandler(): void {\n if (this._onUnhandledRejectionHandlerInstalled) {\n return;\n }\n\n addInstrumentationHandler({\n callback: (e: any) => {\n let error = e;\n\n // dig the object of the rejection out of known event types\n try {\n // PromiseRejectionEvents store the object of the rejection under 'reason'\n // see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent\n if ('reason' in e) {\n error = e.reason;\n }\n // something, somewhere, (likely a browser extension) effectively casts PromiseRejectionEvents\n // to CustomEvents, moving the `promise` and `reason` attributes of the PRE into\n // the CustomEvent's `detail` attribute, since they're not part of CustomEvent's spec\n // see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent and\n // https://github.com/getsentry/sentry-javascript/issues/2380\n else if ('detail' in e && 'reason' in e.detail) {\n error = e.detail.reason;\n }\n } catch (_oO) {\n // no-empty\n }\n\n const currentHub = getCurrentHub();\n const hasIntegration = currentHub.getIntegration(GlobalHandlers);\n const isFailedOwnDelivery = error && error.__sentry_own_request__ === true;\n\n if (!hasIntegration || shouldIgnoreOnError() || isFailedOwnDelivery) {\n return true;\n }\n\n const client = currentHub.getClient();\n const event = isPrimitive(error)\n ? this._eventFromIncompleteRejection(error)\n : eventFromUnknownInput(error, undefined, {\n attachStacktrace: client && client.getOptions().attachStacktrace,\n rejection: true,\n });\n\n event.level = Severity.Error;\n\n addExceptionMechanism(event, {\n handled: false,\n type: 'onunhandledrejection',\n });\n\n currentHub.captureEvent(event, {\n originalException: error,\n });\n\n return;\n },\n type: 'unhandledrejection',\n });\n\n this._onUnhandledRejectionHandlerInstalled = true;\n }\n\n /**\n * This function creates a stack from an old, error-less onerror handler.\n */\n private _eventFromIncompleteOnError(msg: any, url: any, line: any, column: any): Event {\n const ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;\n\n // If 'message' is ErrorEvent, get real message from inside\n let message = isErrorEvent(msg) ? msg.message : msg;\n let name;\n\n if (isString(message)) {\n const groups = message.match(ERROR_TYPES_RE);\n if (groups) {\n name = groups[1];\n message = groups[2];\n }\n }\n\n const event = {\n exception: {\n values: [\n {\n type: name || 'Error',\n value: message,\n },\n ],\n },\n };\n\n return this._enhanceEventWithInitialFrame(event, url, line, column);\n }\n\n /**\n * This function creates an Event from an TraceKitStackTrace that has part of it missing.\n */\n private _eventFromIncompleteRejection(error: any): Event {\n return {\n exception: {\n values: [\n {\n type: 'UnhandledRejection',\n value: `Non-Error promise rejection captured with value: ${error}`,\n },\n ],\n },\n };\n }\n\n /** JSDoc */\n private _enhanceEventWithInitialFrame(event: Event, url: any, line: any, column: any): Event {\n event.exception = event.exception || {};\n event.exception.values = event.exception.values || [];\n event.exception.values[0] = event.exception.values[0] || {};\n event.exception.values[0].stacktrace = event.exception.values[0].stacktrace || {};\n event.exception.values[0].stacktrace.frames = event.exception.values[0].stacktrace.frames || [];\n\n const colno = isNaN(parseInt(column, 10)) ? undefined : column;\n const lineno = isNaN(parseInt(line, 10)) ? undefined : line;\n const filename = isString(url) && url.length > 0 ? url : getLocationHref();\n\n if (event.exception.values[0].stacktrace.frames.length === 0) {\n event.exception.values[0].stacktrace.frames.push({\n colno,\n filename,\n function: '?',\n in_app: true,\n lineno,\n });\n }\n\n return event;\n }\n}\n","import { Integration, WrappedFunction } from '@sentry/types';\nimport { fill, getFunctionName, getGlobalObject } from '@sentry/utils';\n\nimport { wrap } from '../helpers';\n\ntype XMLHttpRequestProp = 'onload' | 'onerror' | 'onprogress' | 'onreadystatechange';\n\n/** Wrap timer functions and event targets to catch errors and provide better meta data */\nexport class TryCatch implements Integration {\n /** JSDoc */\n private _ignoreOnError: number = 0;\n\n /**\n * @inheritDoc\n */\n public name: string = TryCatch.id;\n\n /**\n * @inheritDoc\n */\n public static id: string = 'TryCatch';\n\n /** JSDoc */\n private _wrapTimeFunction(original: () => void): () => number {\n return function(this: any, ...args: any[]): number {\n const originalCallback = args[0];\n args[0] = wrap(originalCallback, {\n mechanism: {\n data: { function: getFunctionName(original) },\n handled: true,\n type: 'instrument',\n },\n });\n return original.apply(this, args);\n };\n }\n\n /** JSDoc */\n private _wrapRAF(original: any): (callback: () => void) => any {\n return function(this: any, callback: () => void): () => void {\n return original(\n wrap(callback, {\n mechanism: {\n data: {\n function: 'requestAnimationFrame',\n handler: getFunctionName(original),\n },\n handled: true,\n type: 'instrument',\n },\n }),\n );\n };\n }\n\n /** JSDoc */\n private _wrapEventTarget(target: string): void {\n const global = getGlobalObject() as { [key: string]: any };\n const proto = global[target] && global[target].prototype;\n\n if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n return;\n }\n\n fill(proto, 'addEventListener', function(\n original: () => void,\n ): (eventName: string, fn: EventListenerObject, options?: boolean | AddEventListenerOptions) => void {\n return function(\n this: any,\n eventName: string,\n fn: EventListenerObject,\n options?: boolean | AddEventListenerOptions,\n ): (eventName: string, fn: EventListenerObject, capture?: boolean, secure?: boolean) => void {\n try {\n // tslint:disable-next-line:no-unbound-method strict-type-predicates\n if (typeof fn.handleEvent === 'function') {\n fn.handleEvent = wrap(fn.handleEvent.bind(fn), {\n mechanism: {\n data: {\n function: 'handleEvent',\n handler: getFunctionName(fn),\n target,\n },\n handled: true,\n type: 'instrument',\n },\n });\n }\n } catch (err) {\n // can sometimes get 'Permission denied to access property \"handle Event'\n }\n\n return original.call(\n this,\n eventName,\n wrap((fn as any) as WrappedFunction, {\n mechanism: {\n data: {\n function: 'addEventListener',\n handler: getFunctionName(fn),\n target,\n },\n handled: true,\n type: 'instrument',\n },\n }),\n options,\n );\n };\n });\n\n fill(proto, 'removeEventListener', function(\n original: () => void,\n ): (this: any, eventName: string, fn: EventListenerObject, options?: boolean | EventListenerOptions) => () => void {\n return function(\n this: any,\n eventName: string,\n fn: EventListenerObject,\n options?: boolean | EventListenerOptions,\n ): () => void {\n let callback = (fn as any) as WrappedFunction;\n try {\n callback = callback && (callback.__sentry_wrapped__ || callback);\n } catch (e) {\n // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments\n }\n return original.call(this, eventName, callback, options);\n };\n });\n }\n\n /** JSDoc */\n private _wrapXHR(originalSend: () => void): () => void {\n return function(this: XMLHttpRequest, ...args: any[]): void {\n const xhr = this; // tslint:disable-line:no-this-assignment\n const xmlHttpRequestProps: XMLHttpRequestProp[] = ['onload', 'onerror', 'onprogress', 'onreadystatechange'];\n\n xmlHttpRequestProps.forEach(prop => {\n if (prop in xhr && typeof xhr[prop] === 'function') {\n fill(xhr, prop, function(original: WrappedFunction): Function {\n const wrapOptions = {\n mechanism: {\n data: {\n function: prop,\n handler: getFunctionName(original),\n },\n handled: true,\n type: 'instrument',\n },\n };\n\n // If Instrument integration has been called before TryCatch, get the name of original function\n if (original.__sentry_original__) {\n wrapOptions.mechanism.data.handler = getFunctionName(original.__sentry_original__);\n }\n\n // Otherwise wrap directly\n return wrap(original, wrapOptions);\n });\n }\n });\n\n return originalSend.apply(this, args);\n };\n }\n\n /**\n * Wrap timer functions and event targets to catch errors\n * and provide better metadata.\n */\n public setupOnce(): void {\n this._ignoreOnError = this._ignoreOnError;\n\n const global = getGlobalObject();\n\n fill(global, 'setTimeout', this._wrapTimeFunction.bind(this));\n fill(global, 'setInterval', this._wrapTimeFunction.bind(this));\n fill(global, 'requestAnimationFrame', this._wrapRAF.bind(this));\n\n if ('XMLHttpRequest' in global) {\n fill(XMLHttpRequest.prototype, 'send', this._wrapXHR.bind(this));\n }\n\n [\n 'EventTarget',\n 'Window',\n 'Node',\n 'ApplicationCache',\n 'AudioTrackList',\n 'ChannelMergerNode',\n 'CryptoOperation',\n 'EventSource',\n 'FileReader',\n 'HTMLUnknownElement',\n 'IDBDatabase',\n 'IDBRequest',\n 'IDBTransaction',\n 'KeyOperation',\n 'MediaController',\n 'MessagePort',\n 'ModalWindow',\n 'Notification',\n 'SVGElementInstance',\n 'Screen',\n 'TextTrack',\n 'TextTrackCue',\n 'TextTrackList',\n 'WebSocket',\n 'WebSocketWorker',\n 'Worker',\n 'XMLHttpRequest',\n 'XMLHttpRequestEventTarget',\n 'XMLHttpRequestUpload',\n ].forEach(this._wrapEventTarget.bind(this));\n }\n}\n","import { API, getCurrentHub } from '@sentry/core';\nimport { Integration, Severity } from '@sentry/types';\nimport {\n addInstrumentationHandler,\n getEventDescription,\n getGlobalObject,\n htmlTreeAsString,\n logger,\n parseUrl,\n safeJoin,\n} from '@sentry/utils';\n\nimport { BrowserClient } from '../client';\n\n/**\n * @hidden\n */\nexport interface SentryWrappedXMLHttpRequest extends XMLHttpRequest {\n [key: string]: any;\n __sentry_xhr__?: {\n method?: string;\n url?: string;\n status_code?: number;\n };\n}\n\n/** JSDoc */\ninterface BreadcrumbIntegrations {\n console?: boolean;\n dom?: boolean;\n fetch?: boolean;\n history?: boolean;\n sentry?: boolean;\n xhr?: boolean;\n}\n\n/**\n * Default Breadcrumbs instrumentations\n * TODO: Deprecated - with v6, this will be renamed to `Instrument`\n */\nexport class Breadcrumbs implements Integration {\n /**\n * @inheritDoc\n */\n public name: string = Breadcrumbs.id;\n\n /**\n * @inheritDoc\n */\n public static id: string = 'Breadcrumbs';\n\n /** JSDoc */\n private readonly _options: BreadcrumbIntegrations;\n\n /**\n * @inheritDoc\n */\n public constructor(options?: BreadcrumbIntegrations) {\n this._options = {\n console: true,\n dom: true,\n fetch: true,\n history: true,\n sentry: true,\n xhr: true,\n ...options,\n };\n }\n\n /**\n * Creates breadcrumbs from console API calls\n */\n private _consoleBreadcrumb(handlerData: { [key: string]: any }): void {\n const breadcrumb = {\n category: 'console',\n data: {\n arguments: handlerData.args,\n logger: 'console',\n },\n level: Severity.fromString(handlerData.level),\n message: safeJoin(handlerData.args, ' '),\n };\n\n if (handlerData.level === 'assert') {\n if (handlerData.args[0] === false) {\n breadcrumb.message = `Assertion failed: ${safeJoin(handlerData.args.slice(1), ' ') || 'console.assert'}`;\n breadcrumb.data.arguments = handlerData.args.slice(1);\n } else {\n // Don't capture a breadcrumb for passed assertions\n return;\n }\n }\n\n getCurrentHub().addBreadcrumb(breadcrumb, {\n input: handlerData.args,\n level: handlerData.level,\n });\n }\n\n /**\n * Creates breadcrumbs from DOM API calls\n */\n private _domBreadcrumb(handlerData: { [key: string]: any }): void {\n let target;\n\n // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n try {\n target = handlerData.event.target\n ? htmlTreeAsString(handlerData.event.target as Node)\n : htmlTreeAsString((handlerData.event as unknown) as Node);\n } catch (e) {\n target = '';\n }\n\n if (target.length === 0) {\n return;\n }\n\n getCurrentHub().addBreadcrumb(\n {\n category: `ui.${handlerData.name}`,\n message: target,\n },\n {\n event: handlerData.event,\n name: handlerData.name,\n },\n );\n }\n\n /**\n * Creates breadcrumbs from XHR API calls\n */\n private _xhrBreadcrumb(handlerData: { [key: string]: any }): void {\n if (handlerData.endTimestamp) {\n // We only capture complete, non-sentry requests\n if (handlerData.xhr.__sentry_own_request__) {\n return;\n }\n\n getCurrentHub().addBreadcrumb(\n {\n category: 'xhr',\n data: handlerData.xhr.__sentry_xhr__,\n type: 'http',\n },\n {\n xhr: handlerData.xhr,\n },\n );\n\n return;\n }\n\n // We only capture issued sentry requests\n if (handlerData.xhr.__sentry_own_request__) {\n addSentryBreadcrumb(handlerData.args[0]);\n }\n }\n\n /**\n * Creates breadcrumbs from fetch API calls\n */\n private _fetchBreadcrumb(handlerData: { [key: string]: any }): void {\n // We only capture complete fetch requests\n if (!handlerData.endTimestamp) {\n return;\n }\n\n const client = getCurrentHub().getClient();\n const dsn = client && client.getDsn();\n\n if (dsn) {\n const filterUrl = new API(dsn).getStoreEndpoint();\n // if Sentry key appears in URL, don't capture it as a request\n // but rather as our own 'sentry' type breadcrumb\n if (\n filterUrl &&\n handlerData.fetchData.url.indexOf(filterUrl) !== -1 &&\n handlerData.fetchData.method === 'POST' &&\n handlerData.args[1] &&\n handlerData.args[1].body\n ) {\n addSentryBreadcrumb(handlerData.args[1].body);\n return;\n }\n }\n\n if (handlerData.error) {\n getCurrentHub().addBreadcrumb(\n {\n category: 'fetch',\n data: {\n ...handlerData.fetchData,\n status_code: handlerData.response.status,\n },\n level: Severity.Error,\n type: 'http',\n },\n {\n data: handlerData.error,\n input: handlerData.args,\n },\n );\n } else {\n getCurrentHub().addBreadcrumb(\n {\n category: 'fetch',\n data: {\n ...handlerData.fetchData,\n status_code: handlerData.response.status,\n },\n type: 'http',\n },\n {\n input: handlerData.args,\n response: handlerData.response,\n },\n );\n }\n }\n\n /**\n * Creates breadcrumbs from history API calls\n */\n private _historyBreadcrumb(handlerData: { [key: string]: any }): void {\n const global = getGlobalObject();\n let from = handlerData.from;\n let to = handlerData.to;\n const parsedLoc = parseUrl(global.location.href);\n let parsedFrom = parseUrl(from);\n const parsedTo = parseUrl(to);\n\n // Initial pushState doesn't provide `from` information\n if (!parsedFrom.path) {\n parsedFrom = parsedLoc;\n }\n\n // Use only the path component of the URL if the URL matches the current\n // document (almost all the time when using pushState)\n if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {\n // tslint:disable-next-line:no-parameter-reassignment\n to = parsedTo.relative;\n }\n if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {\n // tslint:disable-next-line:no-parameter-reassignment\n from = parsedFrom.relative;\n }\n\n getCurrentHub().addBreadcrumb({\n category: 'navigation',\n data: {\n from,\n to,\n },\n });\n }\n\n /**\n * Instrument browser built-ins w/ breadcrumb capturing\n * - Console API\n * - DOM API (click/typing)\n * - XMLHttpRequest API\n * - Fetch API\n * - History API\n */\n public setupOnce(): void {\n if (this._options.console) {\n addInstrumentationHandler({\n callback: (...args) => {\n this._consoleBreadcrumb(...args);\n },\n type: 'console',\n });\n }\n if (this._options.dom) {\n addInstrumentationHandler({\n callback: (...args) => {\n this._domBreadcrumb(...args);\n },\n type: 'dom',\n });\n }\n if (this._options.xhr) {\n addInstrumentationHandler({\n callback: (...args) => {\n this._xhrBreadcrumb(...args);\n },\n type: 'xhr',\n });\n }\n if (this._options.fetch) {\n addInstrumentationHandler({\n callback: (...args) => {\n this._fetchBreadcrumb(...args);\n },\n type: 'fetch',\n });\n }\n if (this._options.history) {\n addInstrumentationHandler({\n callback: (...args) => {\n this._historyBreadcrumb(...args);\n },\n type: 'history',\n });\n }\n }\n}\n\n/**\n * Create a breadcrumb of `sentry` from the events themselves\n */\nfunction addSentryBreadcrumb(serializedData: string): void {\n // There's always something that can go wrong with deserialization...\n try {\n const event = JSON.parse(serializedData);\n getCurrentHub().addBreadcrumb(\n {\n category: `sentry.${event.type === 'transaction' ? 'transaction' : 'event'}`,\n event_id: event.event_id,\n level: event.level || Severity.fromString('error'),\n message: getEventDescription(event),\n },\n {\n event,\n },\n );\n } catch (_oO) {\n logger.error('Error while adding sentry type breadcrumb');\n }\n}\n","import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';\nimport { Event, EventHint, Exception, ExtendedError, Integration } from '@sentry/types';\nimport { isInstanceOf } from '@sentry/utils';\n\nimport { exceptionFromStacktrace } from '../parsers';\nimport { computeStackTrace } from '../tracekit';\n\nconst DEFAULT_KEY = 'cause';\nconst DEFAULT_LIMIT = 5;\n\n/** Adds SDK info to an event. */\nexport class LinkedErrors implements Integration {\n /**\n * @inheritDoc\n */\n public readonly name: string = LinkedErrors.id;\n\n /**\n * @inheritDoc\n */\n public static id: string = 'LinkedErrors';\n\n /**\n * @inheritDoc\n */\n private readonly _key: string;\n\n /**\n * @inheritDoc\n */\n private readonly _limit: number;\n\n /**\n * @inheritDoc\n */\n public constructor(options: { key?: string; limit?: number } = {}) {\n this._key = options.key || DEFAULT_KEY;\n this._limit = options.limit || DEFAULT_LIMIT;\n }\n\n /**\n * @inheritDoc\n */\n public setupOnce(): void {\n addGlobalEventProcessor((event: Event, hint?: EventHint) => {\n const self = getCurrentHub().getIntegration(LinkedErrors);\n if (self) {\n return self._handler(event, hint);\n }\n return event;\n });\n }\n\n /**\n * @inheritDoc\n */\n private _handler(event: Event, hint?: EventHint): Event | null {\n if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) {\n return event;\n }\n const linkedErrors = this._walkErrorTree(hint.originalException as ExtendedError, this._key);\n event.exception.values = [...linkedErrors, ...event.exception.values];\n return event;\n }\n\n /**\n * @inheritDoc\n */\n private _walkErrorTree(error: ExtendedError, key: string, stack: Exception[] = []): Exception[] {\n if (!isInstanceOf(error[key], Error) || stack.length + 1 >= this._limit) {\n return stack;\n }\n const stacktrace = computeStackTrace(error[key]);\n const exception = exceptionFromStacktrace(stacktrace);\n return this._walkErrorTree(error[key], key, [exception, ...stack]);\n }\n}\n","import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';\nimport { Event, Integration } from '@sentry/types';\nimport { getGlobalObject } from '@sentry/utils';\n\nconst global = getGlobalObject();\n\n/** UserAgent */\nexport class UserAgent implements Integration {\n /**\n * @inheritDoc\n */\n public name: string = UserAgent.id;\n\n /**\n * @inheritDoc\n */\n public static id: string = 'UserAgent';\n\n /**\n * @inheritDoc\n */\n public setupOnce(): void {\n addGlobalEventProcessor((event: Event) => {\n if (getCurrentHub().getIntegration(UserAgent)) {\n if (!global.navigator || !global.location) {\n return event;\n }\n\n // Request Interface: https://docs.sentry.io/development/sdk-dev/event-payloads/request/\n const request = event.request || {};\n request.url = request.url || global.location.href;\n request.headers = request.headers || {};\n request.headers['User-Agent'] = global.navigator.userAgent;\n\n return {\n ...event,\n request,\n };\n }\n return event;\n });\n }\n}\n","import { getCurrentHub, initAndBind, Integrations as CoreIntegrations } from '@sentry/core';\nimport { getGlobalObject, SyncPromise } from '@sentry/utils';\n\nimport { BrowserOptions } from './backend';\nimport { BrowserClient, ReportDialogOptions } from './client';\nimport { wrap as internalWrap } from './helpers';\nimport { Breadcrumbs, GlobalHandlers, LinkedErrors, TryCatch, UserAgent } from './integrations';\n\nexport const defaultIntegrations = [\n new CoreIntegrations.InboundFilters(),\n new CoreIntegrations.FunctionToString(),\n new TryCatch(),\n new Breadcrumbs(),\n new GlobalHandlers(),\n new LinkedErrors(),\n new UserAgent(),\n];\n\n/**\n * The Sentry Browser SDK Client.\n *\n * To use this SDK, call the {@link init} function as early as possible when\n * loading the web page. To set context information or send manual events, use\n * the provided methods.\n *\n * @example\n *\n * ```\n *\n * import { init } from '@sentry/browser';\n *\n * init({\n * dsn: '__DSN__',\n * // ...\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { configureScope } from '@sentry/browser';\n * configureScope((scope: Scope) => {\n * scope.setExtra({ battery: 0.7 });\n * scope.setTag({ user_mode: 'admin' });\n * scope.setUser({ id: '4711' });\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { addBreadcrumb } from '@sentry/browser';\n * addBreadcrumb({\n * message: 'My Breadcrumb',\n * // ...\n * });\n * ```\n *\n * @example\n *\n * ```\n *\n * import * as Sentry from '@sentry/browser';\n * Sentry.captureMessage('Hello, world!');\n * Sentry.captureException(new Error('Good bye'));\n * Sentry.captureEvent({\n * message: 'Manual',\n * stacktrace: [\n * // ...\n * ],\n * });\n * ```\n *\n * @see {@link BrowserOptions} for documentation on configuration options.\n */\nexport function init(options: BrowserOptions = {}): void {\n if (options.defaultIntegrations === undefined) {\n options.defaultIntegrations = defaultIntegrations;\n }\n if (options.release === undefined) {\n const window = getGlobalObject();\n // This supports the variable that sentry-webpack-plugin injects\n if (window.SENTRY_RELEASE && window.SENTRY_RELEASE.id) {\n options.release = window.SENTRY_RELEASE.id;\n }\n }\n initAndBind(BrowserClient, options);\n}\n\n/**\n * Present the user with a report dialog.\n *\n * @param options Everything is optional, we try to fetch all info need from the global scope.\n */\nexport function showReportDialog(options: ReportDialogOptions = {}): void {\n if (!options.eventId) {\n options.eventId = getCurrentHub().lastEventId();\n }\n const client = getCurrentHub().getClient();\n if (client) {\n client.showReportDialog(options);\n }\n}\n\n/**\n * This is the getter for lastEventId.\n *\n * @returns The last event id of a captured event.\n */\nexport function lastEventId(): string | undefined {\n return getCurrentHub().lastEventId();\n}\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nexport function forceLoad(): void {\n // Noop\n}\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nexport function onLoad(callback: () => void): void {\n callback();\n}\n\n/**\n * A promise that resolves when all current events have been sent.\n * If you provide a timeout and the queue takes longer to drain the promise returns false.\n *\n * @param timeout Maximum time in ms the client should wait.\n */\nexport function flush(timeout?: number): PromiseLike {\n const client = getCurrentHub().getClient();\n if (client) {\n return client.flush(timeout);\n }\n return SyncPromise.reject(false);\n}\n\n/**\n * A promise that resolves when all current events have been sent.\n * If you provide a timeout and the queue takes longer to drain the promise returns false.\n *\n * @param timeout Maximum time in ms the client should wait.\n */\nexport function close(timeout?: number): PromiseLike {\n const client = getCurrentHub().getClient();\n if (client) {\n return client.close(timeout);\n }\n return SyncPromise.reject(false);\n}\n\n/**\n * Wrap code within a try/catch block so the SDK is able to capture errors.\n *\n * @param fn A function to wrap.\n *\n * @returns The result of wrapped function call.\n */\nexport function wrap(fn: Function): any {\n return internalWrap(fn)(); // tslint:disable-line:no-unsafe-any\n}\n","export * from './exports';\n\nimport { Integrations as CoreIntegrations } from '@sentry/core';\nimport { getGlobalObject } from '@sentry/utils';\n\nimport * as BrowserIntegrations from './integrations';\nimport * as Transports from './transports';\n\nlet windowIntegrations = {};\n\n// This block is needed to add compatibility with the integrations packages when used with a CDN\n// tslint:disable: no-unsafe-any\nconst _window = getGlobalObject();\nif (_window.Sentry && _window.Sentry.Integrations) {\n windowIntegrations = _window.Sentry.Integrations;\n}\n// tslint:enable: no-unsafe-any\n\nconst INTEGRATIONS = {\n ...windowIntegrations,\n ...CoreIntegrations,\n ...BrowserIntegrations,\n};\n\nexport { INTEGRATIONS as Integrations, Transports };\n"],"names":["Severity","Status","global","CoreIntegrations.InboundFilters","CoreIntegrations.FunctionToString","wrap","internalWrap"],"mappings":";EAAA;AACA,EAAA,IAAY,QASX;EATD,WAAY,QAAQ;;MAElB,uCAAQ,CAAA;;MAER,yCAAS,CAAA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gB,SAAS;;EAEzB,CAAC;EAED;;;;AAIA,WAAgB,MAAM,CAAC,QAAoB;MACzC,QAAQ,EAAE,CAAC;EACb,CAAC;EAED;;;;;;AAMA,WAAgB,KAAK,CAAC,OAAgB;MACpC,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC,SAAS,EAAiB,CAAC;MAC1D,IAAI,MAAM,EAAE;UACV,OAAO,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;OAC9B;MACD,OAAO,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;EACnC,CAAC;EAED;;;;;;AAMA,WAAgB,KAAK,CAAC,OAAgB;MACpC,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC,SAAS,EAAiB,CAAC;MAC1D,IAAI,MAAM,EAAE;UACV,OAAO,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;OAC9B;MACD,OAAO,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;EACnC,CAAC;EAED;;;;;;;AAOA,WAAgBC,MAAI,CAAC,EAAY;MAC/B,OAAOC,IAAY,CAAC,EAAE,CAAC,EAAE,CAAC;EAC5B,CAAC;;EC9JD,IAAI,kBAAkB,GAAG,EAAE,CAAC;EAE5B;EACA;EACA,MAAM,OAAO,GAAG,eAAe,EAAU,CAAC;EAC1C,IAAI,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE;MACjD,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC;GAClD;EACD;AAEA,QAAM,YAAY,qBACb,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,CACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
\ No newline at end of file
diff --git a/node_modules/@sentry/browser/build/bundle.es6.min.js b/node_modules/@sentry/browser/build/bundle.es6.min.js
deleted file mode 100644
index 6024e00..0000000
--- a/node_modules/@sentry/browser/build/bundle.es6.min.js
+++ /dev/null
@@ -1,3 +0,0 @@
-/*! @sentry/browser 5.14.1 (de33eb09) | https://github.com/getsentry/sentry-javascript */
-var Sentry=function(t){var e,n,r,i;!function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Debug=2]="Debug",t[t.Verbose=3]="Verbose"}(e||(e={})),(n=t.Severity||(t.Severity={})).Fatal="fatal",n.Error="error",n.Warning="warning",n.Log="log",n.Info="info",n.Debug="debug",n.Critical="critical",function(t){t.fromString=function(e){switch(e){case"debug":return t.Debug;case"info":return t.Info;case"warn":case"warning":return t.Warning;case"error":return t.Error;case"fatal":return t.Fatal;case"critical":return t.Critical;case"log":default:return t.Log}}}(t.Severity||(t.Severity={})),function(t){t.Ok="ok",t.DeadlineExceeded="deadline_exceeded",t.Unauthenticated="unauthenticated",t.PermissionDenied="permission_denied",t.NotFound="not_found",t.ResourceExhausted="resource_exhausted",t.InvalidArgument="invalid_argument",t.Unimplemented="unimplemented",t.Unavailable="unavailable",t.InternalError="internal_error",t.UnknownError="unknown_error",t.Cancelled="cancelled",t.AlreadyExists="already_exists",t.FailedPrecondition="failed_precondition",t.Aborted="aborted",t.OutOfRange="out_of_range",t.DataLoss="data_loss"}(r||(r={})),function(t){t.fromHttpCode=function(e){if(e<400)return t.Ok;if(e>=400&&e<500)switch(e){case 401:return t.Unauthenticated;case 403:return t.PermissionDenied;case 404:return t.NotFound;case 409:return t.AlreadyExists;case 413:return t.FailedPrecondition;case 429:return t.ResourceExhausted;default:return t.InvalidArgument}if(e>=500&&e<600)switch(e){case 501:return t.Unimplemented;case 503:return t.Unavailable;case 504:return t.DeadlineExceeded;default:return t.InternalError}return t.UnknownError}}(r||(r={})),(i=t.Status||(t.Status={})).Unknown="unknown",i.Skipped="skipped",i.Success="success",i.RateLimit="rate_limit",i.Invalid="invalid",i.Failed="failed",function(t){t.fromHttpCode=function(e){return e>=200&&e<300?t.Success:429===e?t.RateLimit:e>=400&&e<500?t.Invalid:e>=500?t.Failed:t.Unknown}}(t.Status||(t.Status={}));const s=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){return t.__proto__=e,t}:function(t,e){for(const n in e)t.hasOwnProperty(n)||(t[n]=e[n]);return t});class o extends Error{constructor(t){super(t),this.message=t,this.name=new.target.prototype.constructor.name,s(this,new.target.prototype)}}function c(t){switch(Object.prototype.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return y(t,Error)}}function u(t){return"[object ErrorEvent]"===Object.prototype.toString.call(t)}function a(t){return"[object DOMError]"===Object.prototype.toString.call(t)}function h(t){return"[object String]"===Object.prototype.toString.call(t)}function l(t){return null===t||"object"!=typeof t&&"function"!=typeof t}function f(t){return"[object Object]"===Object.prototype.toString.call(t)}function d(t){return"undefined"!=typeof Event&&y(t,Event)}function p(t){return"undefined"!=typeof Element&&y(t,Element)}function m(t){return Boolean(t&&t.then&&"function"==typeof t.then)}function y(t,e){try{return t instanceof e}catch(t){return!1}}function v(t,e=0){return"string"!=typeof t||0===e?t:t.length<=e?t:`${t.substr(0,e)}...`}function b(t,e){if(!Array.isArray(t))return"";const n=[];for(let e=0;e{let e=t.toString(16);for(;e.length<4;)e=`0${e}`;return e};return n(t[0])+n(t[1])+n(t[2])+n(t[3])+n(t[4])+n(t[5])+n(t[6])+n(t[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}function _(t){if(!t)return{};const e=t.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],relative:e[5]+n+r}}function $(t){if(t.message)return t.message;if(t.exception&&t.exception.values&&t.exception.values[0]){const e=t.exception.values[0];return e.type&&e.value?`${e.type}: ${e.value}`:e.type||e.value||t.event_id||""}return t.event_id||""}function k(t){const e=x();if(!("console"in e))return t();const n=e.console,r={};["debug","info","warn","error","log","assert"].forEach(t=>{t in e.console&&n[t].__sentry_original__&&(r[t]=n[t],n[t]=n[t].__sentry_original__)});const i=t();return Object.keys(r).forEach(t=>{n[t]=r[t]}),i}function S(t,e,n){t.exception=t.exception||{},t.exception.values=t.exception.values||[],t.exception.values[0]=t.exception.values[0]||{},t.exception.values[0].value=t.exception.values[0].value||e||"",t.exception.values[0].type=t.exception.values[0].type||n||"Error"}function T(t,e={}){try{t.exception.values[0].mechanism=t.exception.values[0].mechanism||{},Object.keys(e).forEach(n=>{t.exception.values[0].mechanism[n]=e[n]})}catch(t){}}function D(t){try{let e=t;const n=5,r=80,i=[];let s=0,o=0;const c=" > ",u=c.length;let a;for(;e&&s++1&&o+i.length*u+a.length>=r);)i.push(a),o+=a.length,e=e.parentNode;return i.reverse().join(c)}catch(t){return""}}function R(t){const e=t,n=[];let r,i,s,o,c;if(!e||!e.tagName)return"";if(n.push(e.tagName.toLowerCase()),e.id&&n.push(`#${e.id}`),(r=e.className)&&h(r))for(i=r.split(/\s+/),c=0;c{if(E())try{return w(module,"perf_hooks").performance}catch(t){return C}if(x().performance&&void 0===performance.timeOrigin){if(!performance.timing)return C;if(!performance.timing.navigationStart)return C;performance.timeOrigin=performance.timing.navigationStart}return x().performance||C})();function U(){return(M.timeOrigin+M.now())/1e3}const A=6e4;function L(t,e){if(!e)return A;const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?A:r-t}const F="";function q(t){try{return t&&"function"==typeof t&&t.name||F}catch(t){return F}}const B=x(),H="Sentry Logger ";B.__SENTRY__=B.__SENTRY__||{};const P=B.__SENTRY__.logger||(B.__SENTRY__.logger=new class{constructor(){this.t=!1}disable(){this.t=!1}enable(){this.t=!0}log(...t){this.t&&k(()=>{B.console.log(`${H}[Log]: ${t.join(" ")}`)})}warn(...t){this.t&&k(()=>{B.console.warn(`${H}[Warn]: ${t.join(" ")}`)})}error(...t){this.t&&k(()=>{B.console.error(`${H}[Error]: ${t.join(" ")}`)})}});class W{constructor(){this.i="function"==typeof WeakSet,this.s=this.i?new WeakSet:[]}memoize(t){if(this.i)return!!this.s.has(t)||(this.s.add(t),!1);for(let e=0;e"}try{n.currentTarget=p(e.currentTarget)?D(e.currentTarget):Object.prototype.toString.call(e.currentTarget)}catch(t){n.currentTarget=""}"undefined"!=typeof CustomEvent&&y(t,CustomEvent)&&(n.detail=e.detail);for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e);return n}return t}function z(t){return function(t){return~-encodeURI(t).split(/%..|./).length}(JSON.stringify(t))}function J(t,e=3,n=102400){const r=Q(t,e);return z(r)>n?J(t,e-1,n):r}function V(t,e){return"domain"===e&&t&&"object"==typeof t&&t.o?"[Domain]":"domainEmitter"===e?"[DomainEmitter]":"undefined"!=typeof global&&t===global?"[Global]":"undefined"!=typeof window&&t===window?"[Window]":"undefined"!=typeof document&&t===document?"[Document]":f(n=t)&&"nativeEvent"in n&&"preventDefault"in n&&"stopPropagation"in n?"[SyntheticEvent]":"number"==typeof t&&t!=t?"[NaN]":void 0===t?"[undefined]":"function"==typeof t?`[Function: ${q(t)}]`:t;var n}function K(t,e,n=1/0,r=new W){if(0===n)return function(t){const e=Object.prototype.toString.call(t);if("string"==typeof t)return t;if("[object Object]"===e)return"[Object]";if("[object Array]"===e)return"[Array]";const n=V(t);return l(n)?n:e}(e);if(null!=e&&"function"==typeof e.toJSON)return e.toJSON();const i=V(e,t);if(l(i))return i;const s=G(e),o=Array.isArray(e)?[]:{};if(r.memoize(e))return"[Circular ~]";for(const t in s)Object.prototype.hasOwnProperty.call(s,t)&&(o[t]=K(t,s[t],n-1,r));return r.unmemoize(e),o}function Q(t,e){try{return JSON.parse(JSON.stringify(t,(t,n)=>K(t,n,e)))}catch(t){return"**non-serializable**"}}function Y(t,e=40){const n=Object.keys(G(t));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=e)return v(n[0],e);for(let t=n.length;t>0;t--){const r=n.slice(0,t).join(", ");if(!(r.length>e))return t===n.length?r:v(r,e)}return""}var Z;!function(t){t.PENDING="PENDING",t.RESOLVED="RESOLVED",t.REJECTED="REJECTED"}(Z||(Z={}));class tt{constructor(t){this.u=Z.PENDING,this.h=[],this.l=(t=>{this.p(Z.RESOLVED,t)}),this.m=(t=>{this.p(Z.REJECTED,t)}),this.p=((t,e)=>{this.u===Z.PENDING&&(m(e)?e.then(this.l,this.m):(this.u=t,this.v=e,this.g()))}),this.j=(t=>{this.h=this.h.concat(t),this.g()}),this.g=(()=>{this.u!==Z.PENDING&&(this.u===Z.REJECTED?this.h.forEach(t=>{t.onrejected&&t.onrejected(this.v)}):this.h.forEach(t=>{t.onfulfilled&&t.onfulfilled(this.v)}),this.h=[])});try{t(this.l,this.m)}catch(t){this.m(t)}}toString(){return"[object SyncPromise]"}static resolve(t){return new tt(e=>{e(t)})}static reject(t){return new tt((e,n)=>{n(t)})}static all(t){return new tt((e,n)=>{if(!Array.isArray(t))return void n(new TypeError("Promise.all requires an array as input."));if(0===t.length)return void e([]);let r=t.length;const i=[];t.forEach((t,s)=>{tt.resolve(t).then(t=>{i[s]=t,0===(r-=1)&&e(i)}).then(null,n)})})}then(t,e){return new tt((n,r)=>{this.j({onfulfilled:e=>{if(t)try{return void n(t(e))}catch(t){return void r(t)}else n(e)},onrejected:t=>{if(e)try{return void n(e(t))}catch(t){return void r(t)}else r(t)}})})}catch(t){return this.then(t=>t,t)}finally(t){return new tt((e,n)=>{let r,i;return this.then(e=>{i=!1,r=e,t&&t()},e=>{i=!0,r=e,t&&t()}).then(()=>{i?n(r):e(r)})})}}class et{constructor(t){this.O=t,this._=[]}isReady(){return void 0===this.O||this.length()this.remove(t)).then(null,()=>this.remove(t).then(null,()=>{})),t):tt.reject(new o("Not adding Promise due to buffer limit reached."))}remove(t){return this._.splice(this._.indexOf(t),1)[0]}length(){return this._.length}drain(t){return new tt(e=>{const n=setTimeout(()=>{t&&t>0&&e(!1)},t);tt.all(this._).then(()=>{clearTimeout(n),e(!0)}).then(null,()=>{e(!0)})})}}function nt(){if(!("fetch"in x()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(t){return!1}}function rt(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function it(){if(!nt())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch(t){return!1}}const st=x(),ot={},ct={};function ut(t){if(!ct[t])switch(ct[t]=!0,t){case"console":!function(){if(!("console"in st))return;["debug","info","warn","error","log","assert"].forEach(function(t){t in st.console&&X(st.console,t,function(e){return function(...n){ht("console",{args:n,level:t}),e&&Function.prototype.apply.call(e,st.console,n)}})})}();break;case"dom":!function(){if(!("document"in st))return;st.document.addEventListener("click",bt("click",ht.bind(null,"dom")),!1),st.document.addEventListener("keypress",gt(ht.bind(null,"dom")),!1),["EventTarget","Node"].forEach(t=>{const e=st[t]&&st[t].prototype;e&&e.hasOwnProperty&&e.hasOwnProperty("addEventListener")&&(X(e,"addEventListener",function(t){return function(e,n,r){return n&&n.handleEvent?("click"===e&&X(n,"handleEvent",function(t){return function(e){return bt("click",ht.bind(null,"dom"))(e),t.call(this,e)}}),"keypress"===e&&X(n,"handleEvent",function(t){return function(e){return gt(ht.bind(null,"dom"))(e),t.call(this,e)}})):("click"===e&&bt("click",ht.bind(null,"dom"),!0)(this),"keypress"===e&>(ht.bind(null,"dom"))(this)),t.call(this,e,n,r)}}),X(e,"removeEventListener",function(t){return function(e,n,r){let i=n;try{i=i&&(i.__sentry_wrapped__||i)}catch(t){}return t.call(this,e,i,r)}}))})}();break;case"xhr":!function(){if(!("XMLHttpRequest"in st))return;const t=XMLHttpRequest.prototype;X(t,"open",function(t){return function(...e){const n=e[1];return this.__sentry_xhr__={method:h(e[0])?e[0].toUpperCase():e[0],url:e[1]},h(n)&&"POST"===this.__sentry_xhr__.method&&n.match(/sentry_key/)&&(this.__sentry_own_request__=!0),t.apply(this,e)}}),X(t,"send",function(t){return function(...e){const n=this,r={args:e,startTimestamp:Date.now(),xhr:n};return ht("xhr",Object.assign({},r)),n.addEventListener("readystatechange",function(){if(4===n.readyState){try{n.__sentry_xhr__&&(n.__sentry_xhr__.status_code=n.status)}catch(t){}ht("xhr",Object.assign({},r,{endTimestamp:Date.now()}))}}),t.apply(this,e)}})}();break;case"fetch":!function(){if(!function(){if(!nt())return!1;const t=x();if(rt(t.fetch))return!0;let e=!1;const n=t.document;if(n)try{const t=n.createElement("iframe");t.hidden=!0,n.head.appendChild(t),t.contentWindow&&t.contentWindow.fetch&&(e=rt(t.contentWindow.fetch)),n.head.removeChild(t)}catch(t){P.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return e}())return;X(st,"fetch",function(t){return function(...e){const n={args:e,fetchData:{method:lt(e),url:ft(e)},startTimestamp:Date.now()};return ht("fetch",Object.assign({},n)),t.apply(st,e).then(t=>(ht("fetch",Object.assign({},n,{endTimestamp:Date.now(),response:t})),t),t=>{throw ht("fetch",Object.assign({},n,{endTimestamp:Date.now(),error:t})),t})}})}();break;case"history":!function(){if(!function(){const t=x(),e=t.chrome,n=e&&e.app&&e.app.runtime,r="history"in t&&!!t.history.pushState&&!!t.history.replaceState;return!n&&r}())return;const t=st.onpopstate;function e(t){return function(...e){const n=e.length>2?e[2]:void 0;if(n){const t=dt,e=String(n);dt=e,ht("history",{from:t,to:e})}return t.apply(this,e)}}st.onpopstate=function(...e){const n=st.location.href,r=dt;if(dt=n,ht("history",{from:r,to:n}),t)return t.apply(this,e)},X(st.history,"pushState",e),X(st.history,"replaceState",e)}();break;case"error":wt=st.onerror,st.onerror=function(t,e,n,r,i){return ht("error",{column:r,error:i,line:n,msg:t,url:e}),!!wt&&wt.apply(this,arguments)};break;case"unhandledrejection":Et=st.onunhandledrejection,st.onunhandledrejection=function(t){return ht("unhandledrejection",t),!Et||Et.apply(this,arguments)};break;default:P.warn("unknown instrumentation type:",t)}}function at(t){t&&"string"==typeof t.type&&"function"==typeof t.callback&&(ot[t.type]=ot[t.type]||[],ot[t.type].push(t.callback),ut(t.type))}function ht(t,e){if(t&&ot[t])for(const n of ot[t]||[])try{n(e)}catch(e){P.error(`Error while triggering instrumentation handler.\nType: ${t}\nName: ${q(n)}\nError: ${e}`)}}function lt(t=[]){return"Request"in st&&y(t[0],Request)&&t[0].method?String(t[0].method).toUpperCase():t[1]&&t[1].method?String(t[1].method).toUpperCase():"GET"}function ft(t=[]){return"string"==typeof t[0]?t[0]:"Request"in st&&y(t[0],Request)?t[0].url:String(t[0])}let dt;const pt=1e3;let mt,yt,vt=0;function bt(t,e,n=!1){return r=>{mt=void 0,r&&yt!==r&&(yt=r,vt&&clearTimeout(vt),n?vt=setTimeout(()=>{e({event:r,name:t})}):e({event:r,name:t}))}}function gt(t){return e=>{let n;try{n=e.target}catch(t){return}const r=n&&n.tagName;r&&("INPUT"===r||"TEXTAREA"===r||n.isContentEditable)&&(mt||bt("input",t)(e),clearTimeout(mt),mt=setTimeout(()=>{mt=void 0},pt))}}let wt=null;let Et=null;const jt=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w\.-]+)(?::(\d+))?\/(.+)/,xt="Invalid Dsn";class Ot{constructor(t){"string"==typeof t?this.$(t):this.k(t),this.S()}toString(t=!1){const{host:e,path:n,pass:r,port:i,projectId:s,protocol:o,user:c}=this;return`${o}://${c}${t&&r?`:${r}`:""}`+`@${e}${i?`:${i}`:""}/${n?`${n}/`:n}${s}`}$(t){const e=jt.exec(t);if(!e)throw new o(xt);const[n,r,i="",s,c="",u]=e.slice(1);let a="",h=u;const l=h.split("/");l.length>1&&(a=l.slice(0,-1).join("/"),h=l.pop()),this.k({host:s,pass:i,path:a,projectId:h,port:c,protocol:n,user:r})}k(t){this.protocol=t.protocol,this.user=t.user,this.pass=t.pass||"",this.host=t.host,this.port=t.port||"",this.path=t.path||"",this.projectId=t.projectId}S(){if(["protocol","user","host","projectId"].forEach(t=>{if(!this[t])throw new o(xt)}),"http"!==this.protocol&&"https"!==this.protocol)throw new o(xt);if(this.port&&isNaN(parseInt(this.port,10)))throw new o(xt)}}class _t{constructor(){this.T=!1,this.D=[],this.R=[],this.I=[],this.N={},this.C={},this.M={},this.U={}}addScopeListener(t){this.D.push(t)}addEventProcessor(t){return this.R.push(t),this}A(){this.T||(this.T=!0,setTimeout(()=>{this.D.forEach(t=>{t(this)}),this.T=!1}))}L(t,e,n,r=0){return new tt((i,s)=>{const o=t[r];if(null===e||"function"!=typeof o)i(e);else{const c=o(Object.assign({},e),n);m(c)?c.then(e=>this.L(t,e,n,r+1).then(i)).then(null,s):this.L(t,c,n,r+1).then(i).then(null,s)}})}setUser(t){return this.N=t||{},this.A(),this}setTags(t){return this.C=Object.assign({},this.C,t),this.A(),this}setTag(t,e){return this.C=Object.assign({},this.C,{[t]:e}),this.A(),this}setExtras(t){return this.M=Object.assign({},this.M,t),this.A(),this}setExtra(t,e){return this.M=Object.assign({},this.M,{[t]:e}),this.A(),this}setFingerprint(t){return this.F=t,this.A(),this}setLevel(t){return this.q=t,this.A(),this}setTransaction(t){return this.B=t,this.H&&(this.H.transaction=t),this.A(),this}setContext(t,e){return this.U=Object.assign({},this.U,{[t]:e}),this.A(),this}setSpan(t){return this.H=t,this.A(),this}getSpan(){return this.H}static clone(t){const e=new _t;return t&&(e.I=[...t.I],e.C=Object.assign({},t.C),e.M=Object.assign({},t.M),e.U=Object.assign({},t.U),e.N=t.N,e.q=t.q,e.H=t.H,e.B=t.B,e.F=t.F,e.R=[...t.R]),e}clear(){return this.I=[],this.C={},this.M={},this.N={},this.U={},this.q=void 0,this.B=void 0,this.F=void 0,this.H=void 0,this.A(),this}addBreadcrumb(t,e){const n=Object.assign({timestamp:U()},t);return this.I=void 0!==e&&e>=0?[...this.I,n].slice(-e):[...this.I,n],this.A(),this}clearBreadcrumbs(){return this.I=[],this.A(),this}P(t){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],this.F&&(t.fingerprint=t.fingerprint.concat(this.F)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}applyToEvent(t,e){return this.M&&Object.keys(this.M).length&&(t.extra=Object.assign({},this.M,t.extra)),this.C&&Object.keys(this.C).length&&(t.tags=Object.assign({},this.C,t.tags)),this.N&&Object.keys(this.N).length&&(t.user=Object.assign({},this.N,t.user)),this.U&&Object.keys(this.U).length&&(t.contexts=Object.assign({},this.U,t.contexts)),this.q&&(t.level=this.q),this.B&&(t.transaction=this.B),this.H&&(t.contexts=Object.assign({trace:this.H.getTraceContext()},t.contexts)),this.P(t),t.breadcrumbs=[...t.breadcrumbs||[],...this.I],t.breadcrumbs=t.breadcrumbs.length>0?t.breadcrumbs:void 0,this.L([...$t(),...this.R],t,e)}}function $t(){const t=x();return t.__SENTRY__=t.__SENTRY__||{},t.__SENTRY__.globalEventProcessors=t.__SENTRY__.globalEventProcessors||[],t.__SENTRY__.globalEventProcessors}function kt(t){$t().push(t)}const St=3,Tt=100,Dt=100;class Rt{constructor(t,e=new _t,n=St){this.W=n,this.X=[],this.X.push({client:t,scope:e})}G(t,...e){const n=this.getStackTop();n&&n.client&&n.client[t]&&n.client[t](...e,n.scope)}isOlderThan(t){return this.W0?t[t.length-1].scope:void 0,n=_t.clone(e);return this.getStack().push({client:this.getClient(),scope:n}),n}popScope(){return void 0!==this.getStack().pop()}withScope(t){const e=this.pushScope();try{t(e)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this.X}getStackTop(){return this.X[this.X.length-1]}captureException(t,e){const n=this.J=O();let r=e;if(!e){let e;try{throw new Error("Sentry syntheticException")}catch(t){e=t}r={originalException:t,syntheticException:e}}return this.G("captureException",t,Object.assign({},r,{event_id:n})),n}captureMessage(t,e,n){const r=this.J=O();let i=n;if(!n){let e;try{throw new Error(t)}catch(t){e=t}i={originalException:t,syntheticException:e}}return this.G("captureMessage",t,e,Object.assign({},i,{event_id:r})),r}captureEvent(t,e){const n=this.J=O();return this.G("captureEvent",t,Object.assign({},e,{event_id:n})),n}lastEventId(){return this.J}addBreadcrumb(t,e){const n=this.getStackTop();if(!n.scope||!n.client)return;const{beforeBreadcrumb:r=null,maxBreadcrumbs:i=Tt}=n.client.getOptions&&n.client.getOptions()||{};if(i<=0)return;const s=U(),o=Object.assign({timestamp:s},t),c=r?k(()=>r(o,e)):o;null!==c&&n.scope.addBreadcrumb(c,Math.min(i,Dt))}setUser(t){const e=this.getStackTop();e.scope&&e.scope.setUser(t)}setTags(t){const e=this.getStackTop();e.scope&&e.scope.setTags(t)}setExtras(t){const e=this.getStackTop();e.scope&&e.scope.setExtras(t)}setTag(t,e){const n=this.getStackTop();n.scope&&n.scope.setTag(t,e)}setExtra(t,e){const n=this.getStackTop();n.scope&&n.scope.setExtra(t,e)}setContext(t,e){const n=this.getStackTop();n.scope&&n.scope.setContext(t,e)}configureScope(t){const e=this.getStackTop();e.scope&&e.client&&t(e.scope)}run(t){const e=Nt(this);try{t(this)}finally{Nt(e)}}getIntegration(t){const e=this.getClient();if(!e)return null;try{return e.getIntegration(t)}catch(e){return P.warn(`Cannot retrieve integration ${t.id} from the current Hub`),null}}startSpan(t,e=!1){return this.V("startSpan",t,e)}traceHeaders(){return this.V("traceHeaders")}V(t,...e){const n=It().__SENTRY__;if(n&&n.extensions&&"function"==typeof n.extensions[t])return n.extensions[t].apply(this,e);P.warn(`Extension method ${t} couldn't be found, doing nothing.`)}}function It(){const t=x();return t.__SENTRY__=t.__SENTRY__||{extensions:{},hub:void 0},t}function Nt(t){const e=It(),n=Ut(e);return At(e,t),n}function Ct(){const t=It();return Mt(t)&&!Ut(t).isOlderThan(St)||At(t,new Rt),E()?function(t){try{const e=w(module,"domain"),n=e.active;if(!n)return Ut(t);if(!Mt(n)||Ut(n).isOlderThan(St)){const e=Ut(t).getStackTop();At(n,new Rt(e.client,_t.clone(e.scope)))}return Ut(n)}catch(e){return Ut(t)}}(t):Ut(t)}function Mt(t){return!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)}function Ut(t){return t&&t.__SENTRY__&&t.__SENTRY__.hub?t.__SENTRY__.hub:(t.__SENTRY__=t.__SENTRY__||{},t.__SENTRY__.hub=new Rt,t.__SENTRY__.hub)}function At(t,e){return!!t&&(t.__SENTRY__=t.__SENTRY__||{},t.__SENTRY__.hub=e,!0)}function Lt(t,...e){const n=Ct();if(n&&n[t])return n[t](...e);throw new Error(`No hub defined or ${t} was not found on the hub, please open a bug report.`)}function captureException(t){let e;try{throw new Error("Sentry syntheticException")}catch(t){e=t}return Lt("captureException",t,{originalException:t,syntheticException:e})}function Ft(t){Lt("withScope",t)}const qt="7";class Bt{constructor(t){this.dsn=t,this.K=new Ot(t)}getDsn(){return this.K}getStoreEndpoint(){return`${this.Y()}${this.getStoreEndpointPath()}`}getStoreEndpointWithUrlEncodedAuth(){const t={sentry_key:this.K.user,sentry_version:qt};return`${this.getStoreEndpoint()}?${e=t,Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}`;var e}Y(){const t=this.K,e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}`}getStoreEndpointPath(){const t=this.K;return`${t.path?`/${t.path}`:""}/api/${t.projectId}/store/`}getRequestHeaders(t,e){const n=this.K,r=[`Sentry sentry_version=${qt}`];return r.push(`sentry_client=${t}/${e}`),r.push(`sentry_key=${n.user}`),n.pass&&r.push(`sentry_secret=${n.pass}`),{"Content-Type":"application/json","X-Sentry-Auth":r.join(", ")}}getReportDialogEndpoint(t={}){const e=this.K,n=`${this.Y()}${e.path?`/${e.path}`:""}/api/embed/error-page/`,r=[];r.push(`dsn=${e.toString()}`);for(const e in t)if("user"===e){if(!t.user)continue;t.user.name&&r.push(`name=${encodeURIComponent(t.user.name)}`),t.user.email&&r.push(`email=${encodeURIComponent(t.user.email)}`)}else r.push(`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`);return r.length?`${n}?${r.join("&")}`:n}}const Ht=[];function Pt(t){const e={};return function(t){const e=t.defaultIntegrations&&[...t.defaultIntegrations]||[],n=t.integrations;let r=[];if(Array.isArray(n)){const t=n.map(t=>t.name),i=[];e.forEach(e=>{-1===t.indexOf(e.name)&&-1===i.indexOf(e.name)&&(r.push(e),i.push(e.name))}),n.forEach(t=>{-1===i.indexOf(t.name)&&(r.push(t),i.push(t.name))})}else"function"==typeof n?(r=n(e),r=Array.isArray(r)?r:[r]):r=[...e];const i=r.map(t=>t.name);return-1!==i.indexOf("Debug")&&r.push(...r.splice(i.indexOf("Debug"),1)),r}(t).forEach(t=>{e[t.name]=t,function(t){-1===Ht.indexOf(t.name)&&(t.setupOnce(kt,Ct),Ht.push(t.name),P.log(`Integration installed: ${t.name}`))}(t)}),e}class Wt{constructor(t,e){this.Z={},this.tt=!1,this.et=new t(e),this.nt=e,e.dsn&&(this.rt=new Ot(e.dsn)),this.it()&&(this.Z=Pt(this.nt))}captureException(t,e,n){let r=e&&e.event_id;return this.tt=!0,this.st().eventFromException(t,e).then(t=>this.ot(t,e,n)).then(t=>{r=t&&t.event_id,this.tt=!1}).then(null,t=>{P.error(t),this.tt=!1}),r}captureMessage(t,e,n,r){let i=n&&n.event_id;return this.tt=!0,(l(t)?this.st().eventFromMessage(`${t}`,e,n):this.st().eventFromException(t,n)).then(t=>this.ot(t,n,r)).then(t=>{i=t&&t.event_id,this.tt=!1}).then(null,t=>{P.error(t),this.tt=!1}),i}captureEvent(t,e,n){let r=e&&e.event_id;return this.tt=!0,this.ot(t,e,n).then(t=>{r=t&&t.event_id,this.tt=!1}).then(null,t=>{P.error(t),this.tt=!1}),r}getDsn(){return this.rt}getOptions(){return this.nt}flush(t){return this.ct(t).then(e=>(clearInterval(e.interval),this.st().getTransport().close(t).then(t=>e.ready&&t)))}close(t){return this.flush(t).then(t=>(this.getOptions().enabled=!1,t))}getIntegrations(){return this.Z||{}}getIntegration(t){try{return this.Z[t.id]||null}catch(e){return P.warn(`Cannot retrieve integration ${t.id} from the current Client`),null}}ct(t){return new tt(e=>{let n=0;let r=0;clearInterval(r),r=setInterval(()=>{this.tt?(n+=1,t&&n>=t&&e({interval:r,ready:!1})):e({interval:r,ready:!0})},1)})}st(){return this.et}it(){return!1!==this.getOptions().enabled&&void 0!==this.rt}ut(t,e,n){const{environment:r,release:i,dist:s,maxValueLength:o=250,normalizeDepth:c=3}=this.getOptions(),u=Object.assign({},t);void 0===u.environment&&void 0!==r&&(u.environment=r),void 0===u.release&&void 0!==i&&(u.release=i),void 0===u.dist&&void 0!==s&&(u.dist=s),u.message&&(u.message=v(u.message,o));const a=u.exception&&u.exception.values&&u.exception.values[0];a&&a.value&&(a.value=v(a.value,o));const h=u.request;h&&h.url&&(h.url=v(h.url,o)),void 0===u.event_id&&(u.event_id=n&&n.event_id?n.event_id:O()),this.at(u.sdk);let l=tt.resolve(u);return e&&(l=e.applyToEvent(u,n)),l.then(t=>"number"==typeof c&&c>0?this.ht(t,c):t)}ht(t,e){return t?Object.assign({},t,t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(t=>Object.assign({},t,t.data&&{data:Q(t.data,e)}))},t.user&&{user:Q(t.user,e)},t.contexts&&{contexts:Q(t.contexts,e)},t.extra&&{extra:Q(t.extra,e)}):null}at(t){const e=Object.keys(this.Z);t&&e.length>0&&(t.integrations=e)}ot(t,e,n){const{beforeSend:r,sampleRate:i}=this.getOptions();return this.it()?"number"==typeof i&&Math.random()>i?tt.reject("This event has been sampled, will not send event."):new tt((i,s)=>{this.ut(t,n,e).then(t=>{if(null===t)return void s("An event processor returned null, will not send event.");let n=t;if(e&&e.data&&!0===e.data.__sentry__||!r)return this.st().sendEvent(n),void i(n);const o=r(t,e);if(void 0===o)P.error("`beforeSend` method has to return `null` or a valid event.");else if(m(o))this.lt(o,i,s);else{if(null===(n=o))return P.log("`beforeSend` returned `null`, will not send event."),void i(null);this.st().sendEvent(n),i(n)}}).then(null,t=>{this.captureException(t,{data:{__sentry__:!0},originalException:t}),s(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${t}`)})}):tt.reject("SDK not enabled, will not send event.")}lt(t,e,n){t.then(t=>{null!==t?(this.st().sendEvent(t),e(t)):n("`beforeSend` returned `null`, will not send event.")}).then(null,t=>{n(`beforeSend rejected with ${t}`)})}}class Xt{sendEvent(e){return tt.resolve({reason:"NoopTransport: Event has been skipped because no Dsn is configured.",status:t.Status.Skipped})}close(t){return tt.resolve(!0)}}class Gt{constructor(t){this.nt=t,this.nt.dsn||P.warn("No DSN provided, backend will not do anything."),this.ft=this.dt()}dt(){return new Xt}eventFromException(t,e){throw new o("Backend has to implement `eventFromException` method")}eventFromMessage(t,e,n){throw new o("Backend has to implement `eventFromMessage` method")}sendEvent(t){this.ft.sendEvent(t).then(null,t=>{P.error(`Error while sending event: ${t}`)})}getTransport(){return this.ft}}let zt;class Jt{constructor(){this.name=Jt.id}setupOnce(){zt=Function.prototype.toString,Function.prototype.toString=function(...t){const e=this.__sentry_original__||this;return zt.apply(e,t)}}}Jt.id="FunctionToString";const Vt=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/];class Kt{constructor(t={}){this.nt=t,this.name=Kt.id}setupOnce(){kt(t=>{const e=Ct();if(!e)return t;const n=e.getIntegration(Kt);if(n){const r=e.getClient(),i=r?r.getOptions():{},s=n.pt(i);if(n.yt(t,s))return null}return t})}yt(t,e){return this.vt(t,e)?(P.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${$(t)}`),!0):this.bt(t,e)?(P.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${$(t)}`),!0):this.gt(t,e)?(P.warn(`Event dropped due to being matched by \`blacklistUrls\` option.\nEvent: ${$(t)}.\nUrl: ${this.wt(t)}`),!0):!this.Et(t,e)&&(P.warn(`Event dropped due to not being matched by \`whitelistUrls\` option.\nEvent: ${$(t)}.\nUrl: ${this.wt(t)}`),!0)}vt(t,e={}){if(!e.ignoreInternal)return!1;try{return t&&t.exception&&t.exception.values&&t.exception.values[0]&&"SentryError"===t.exception.values[0].type||!1}catch(t){return!1}}bt(t,e={}){return!(!e.ignoreErrors||!e.ignoreErrors.length)&&this.jt(t).some(t=>e.ignoreErrors.some(e=>g(t,e)))}gt(t,e={}){if(!e.blacklistUrls||!e.blacklistUrls.length)return!1;const n=this.wt(t);return!!n&&e.blacklistUrls.some(t=>g(n,t))}Et(t,e={}){if(!e.whitelistUrls||!e.whitelistUrls.length)return!0;const n=this.wt(t);return!n||e.whitelistUrls.some(t=>g(n,t))}pt(t={}){return{blacklistUrls:[...this.nt.blacklistUrls||[],...t.blacklistUrls||[]],ignoreErrors:[...this.nt.ignoreErrors||[],...t.ignoreErrors||[],...Vt],ignoreInternal:void 0===this.nt.ignoreInternal||this.nt.ignoreInternal,whitelistUrls:[...this.nt.whitelistUrls||[],...t.whitelistUrls||[]]}}jt(t){if(t.message)return[t.message];if(t.exception)try{const{type:e="",value:n=""}=t.exception.values&&t.exception.values[0]||{};return[`${n}`,`${e}: ${n}`]}catch(e){return P.error(`Cannot extract message for event ${$(t)}`),[]}return[]}wt(t){try{if(t.stacktrace){const e=t.stacktrace.frames;return e&&e[e.length-1].filename||null}if(t.exception){const e=t.exception.values&&t.exception.values[0].stacktrace&&t.exception.values[0].stacktrace.frames;return e&&e[e.length-1].filename||null}return null}catch(e){return P.error(`Cannot extract url for event ${$(t)}`),null}}}Kt.id="InboundFilters";var Qt=Object.freeze({FunctionToString:Jt,InboundFilters:Kt});const Yt="?",Zt=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack||[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,te=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js))(?::(\d+))?(?::(\d+))?\s*$/i,ee=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,ne=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,re=/\((\S*)(?::(\d+))(?::(\d+))\)/;function ie(t){let e=null;const n=t&&t.framesToPop;try{if(e=function(t){if(!t||!t.stacktrace)return null;const e=t.stacktrace,n=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,r=/ line (\d+), column (\d+)\s*(?:in (?:]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,i=e.split("\n"),s=[];let o;for(let t=0;t eval")>-1)&&(i=ne.exec(s[3]))?(s[1]=s[1]||"eval",s[3]=i[1],s[4]=i[2],s[5]=""):0!==c||s[5]||void 0===t.columnNumber||(e[0].column=t.columnNumber+1),o={url:s[3],func:s[1]||Yt,args:s[2]?s[2].split(","):[],line:s[4]?+s[4]:null,column:s[5]?+s[5]:null}}!o.func&&o.line&&(o.func=Yt),e.push(o)}if(!e.length)return null;return{message:oe(t),name:t.name,stack:e}}(t))return se(e,n)}catch(t){}return{message:oe(t),name:t&&t.name,stack:[],failed:!0}}function se(t,e){try{return Object.assign({},t,{stack:t.stack.slice(e)})}catch(e){return t}}function oe(t){const e=t&&t.message;return e?e.error&&"string"==typeof e.error.message?e.error.message:e:"No error message"}const ce=50;function ue(t){const e=he(t.stack),n={type:t.name,value:t.message};return e&&e.length&&(n.stacktrace={frames:e}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function ae(t){return{exception:{values:[ue(t)]}}}function he(t){if(!t||!t.length)return[];let e=t;const n=e[0].func||"",r=e[e.length-1].func||"";return-1===n.indexOf("captureMessage")&&-1===n.indexOf("captureException")||(e=e.slice(1)),-1!==r.indexOf("sentryWrapped")&&(e=e.slice(0,-1)),e.map(t=>({colno:null===t.column?void 0:t.column,filename:t.url||e[0].url,function:t.func||"?",in_app:!0,lineno:null===t.line?void 0:t.line})).slice(0,ce).reverse()}function le(t,e,n={}){let r;if(u(t)&&t.error){return r=ae(ie(t=t.error))}if(a(t)||(i=t,"[object DOMException]"===Object.prototype.toString.call(i))){const i=t,s=i.name||(a(i)?"DOMError":"DOMException"),o=i.message?`${s}: ${i.message}`:s;return S(r=fe(o,e,n),o),r}var i;if(c(t))return r=ae(ie(t));if(f(t)||d(t)){return T(r=function(t,e,n){const r={exception:{values:[{type:d(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:`Non-Error ${n?"promise rejection":"exception"} captured with keys: ${Y(t)}`}]},extra:{__serialized__:J(t)}};if(e){const t=he(ie(e).stack);r.stacktrace={frames:t}}return r}(t,e,n.rejection),{synthetic:!0}),r}return S(r=fe(t,e,n),`${t}`,void 0),T(r,{synthetic:!0}),r}function fe(t,e,n={}){const r={message:t};if(n.attachStacktrace&&e){const t=he(ie(e).stack);r.stacktrace={frames:t}}return r}class de{constructor(t){this.options=t,this._=new et(30),this.url=new Bt(this.options.dsn).getStoreEndpointWithUrlEncodedAuth()}sendEvent(t){throw new o("Transport Class has to implement `sendEvent` method")}close(t){return this._.drain(t)}}const pe=x();class me extends de{constructor(){super(...arguments),this.xt=new Date(Date.now())}sendEvent(e){if(new Date(Date.now()){pe.fetch(this.url,n).then(n=>{const i=t.Status.fromHttpCode(n.status);if(i!==t.Status.Success){if(i===t.Status.RateLimit){const t=Date.now();this.xt=new Date(t+L(t,n.headers.get("Retry-After"))),P.warn(`Too many requests, backing off till: ${this.xt}`)}r(n)}else e({status:i})}).catch(r)}))}}class ye extends de{constructor(){super(...arguments),this.xt=new Date(Date.now())}sendEvent(e){return new Date(Date.now()){const i=new XMLHttpRequest;i.onreadystatechange=(()=>{if(4!==i.readyState)return;const e=t.Status.fromHttpCode(i.status);if(e!==t.Status.Success){if(e===t.Status.RateLimit){const t=Date.now();this.xt=new Date(t+L(t,i.getResponseHeader("Retry-After"))),P.warn(`Too many requests, backing off till: ${this.xt}`)}r(i)}else n({status:e})}),i.open("POST",this.url);for(const t in this.options.headers)this.options.headers.hasOwnProperty(t)&&i.setRequestHeader(t,this.options.headers[t]);i.send(JSON.stringify(e))}))}}var ve=Object.freeze({BaseTransport:de,FetchTransport:me,XHRTransport:ye});class be extends Gt{dt(){if(!this.nt.dsn)return super.dt();const t=Object.assign({},this.nt.transportOptions,{dsn:this.nt.dsn});return this.nt.transport?new this.nt.transport(t):nt()?new me(t):new ye(t)}eventFromException(e,n){const r=le(e,n&&n.syntheticException||void 0,{attachStacktrace:this.nt.attachStacktrace});return T(r,{handled:!0,type:"generic"}),r.level=t.Severity.Error,n&&n.event_id&&(r.event_id=n.event_id),tt.resolve(r)}eventFromMessage(e,n=t.Severity.Info,r){const i=fe(e,r&&r.syntheticException||void 0,{attachStacktrace:this.nt.attachStacktrace});return i.level=n,r&&r.event_id&&(i.event_id=r.event_id),tt.resolve(i)}}const ge="sentry.javascript.browser",we="5.14.1";class Ee extends Wt{constructor(t={}){super(be,t)}ut(t,e,n){return t.platform=t.platform||"javascript",t.sdk=Object.assign({},t.sdk,{name:ge,packages:[...t.sdk&&t.sdk.packages||[],{name:"npm:@sentry/browser",version:we}],version:we}),super.ut(t,e,n)}showReportDialog(t={}){const e=x().document;if(!e)return;if(!this.it())return void P.error("Trying to call showReportDialog with Sentry Client is disabled");const n=t.dsn||this.getDsn();if(!t.eventId)return void P.error("Missing `eventId` option in showReportDialog call");if(!n)return void P.error("Missing `Dsn` option in showReportDialog call");const r=e.createElement("script");r.async=!0,r.src=new Bt(n).getReportDialogEndpoint(t),t.onLoad&&(r.onload=t.onLoad),(e.head||e.body).appendChild(r)}}let je=0;function xe(){return je>0}function Oe(t,e={},n){if("function"!=typeof t)return t;try{if(t.__sentry__)return t;if(t.__sentry_wrapped__)return t.__sentry_wrapped__}catch(e){return t}const sentryWrapped=function(){const r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);const i=r.map(t=>Oe(t,e));return t.handleEvent?t.handleEvent.apply(this,i):t.apply(this,i)}catch(t){throw je+=1,setTimeout(()=>{je-=1}),Ft(n=>{n.addEventProcessor(t=>{const n=Object.assign({},t);return e.mechanism&&(S(n,void 0,void 0),T(n,e.mechanism)),n.extra=Object.assign({},n.extra,{arguments:r}),n}),captureException(t)}),t}};try{for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(sentryWrapped[e]=t[e])}catch(t){}t.prototype=t.prototype||{},sentryWrapped.prototype=t.prototype,Object.defineProperty(t,"__sentry_wrapped__",{enumerable:!1,value:sentryWrapped}),Object.defineProperties(sentryWrapped,{__sentry__:{enumerable:!1,value:!0},__sentry_original__:{enumerable:!1,value:t}});try{Object.getOwnPropertyDescriptor(sentryWrapped,"name").configurable&&Object.defineProperty(sentryWrapped,"name",{get:()=>t.name})}catch(t){}return sentryWrapped}class _e{constructor(t){this.name=_e.id,this.Ot=!1,this._t=!1,this.nt=Object.assign({onerror:!0,onunhandledrejection:!0},t)}setupOnce(){Error.stackTraceLimit=50,this.nt.onerror&&(P.log("Global Handler attached: onerror"),this.$t()),this.nt.onunhandledrejection&&(P.log("Global Handler attached: onunhandledrejection"),this.kt())}$t(){this.Ot||(at({callback:t=>{const e=t.error,n=Ct(),r=n.getIntegration(_e),i=e&&!0===e.__sentry_own_request__;if(!r||xe()||i)return;const s=n.getClient(),o=l(e)?this.St(t.msg,t.url,t.line,t.column):this.Tt(le(e,void 0,{attachStacktrace:s&&s.getOptions().attachStacktrace,rejection:!1}),t.url,t.line,t.column);T(o,{handled:!1,type:"onerror"}),n.captureEvent(o,{originalException:e})},type:"error"}),this.Ot=!0)}kt(){this._t||(at({callback:e=>{let n=e;try{"reason"in e?n=e.reason:"detail"in e&&"reason"in e.detail&&(n=e.detail.reason)}catch(t){}const r=Ct(),i=r.getIntegration(_e),s=n&&!0===n.__sentry_own_request__;if(!i||xe()||s)return!0;const o=r.getClient(),c=l(n)?this.Dt(n):le(n,void 0,{attachStacktrace:o&&o.getOptions().attachStacktrace,rejection:!0});c.level=t.Severity.Error,T(c,{handled:!1,type:"onunhandledrejection"}),r.captureEvent(c,{originalException:n})},type:"unhandledrejection"}),this._t=!0)}St(t,e,n,r){const i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let s,o=u(t)?t.message:t;if(h(o)){const t=o.match(i);t&&(s=t[1],o=t[2])}const c={exception:{values:[{type:s||"Error",value:o}]}};return this.Tt(c,e,n,r)}Dt(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${t}`}]}}}Tt(t,e,n,r){t.exception=t.exception||{},t.exception.values=t.exception.values||[],t.exception.values[0]=t.exception.values[0]||{},t.exception.values[0].stacktrace=t.exception.values[0].stacktrace||{},t.exception.values[0].stacktrace.frames=t.exception.values[0].stacktrace.frames||[];const i=isNaN(parseInt(r,10))?void 0:r,s=isNaN(parseInt(n,10))?void 0:n,o=h(e)&&e.length>0?e:function(){try{return document.location.href}catch(t){return""}}();return 0===t.exception.values[0].stacktrace.frames.length&&t.exception.values[0].stacktrace.frames.push({colno:i,filename:o,function:"?",in_app:!0,lineno:s}),t}}_e.id="GlobalHandlers";class $e{constructor(){this.Rt=0,this.name=$e.id}It(t){return function(...e){const n=e[0];return e[0]=Oe(n,{mechanism:{data:{function:q(t)},handled:!0,type:"instrument"}}),t.apply(this,e)}}Nt(t){return function(e){return t(Oe(e,{mechanism:{data:{function:"requestAnimationFrame",handler:q(t)},handled:!0,type:"instrument"}}))}}Ct(t){const e=x(),n=e[t]&&e[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(X(n,"addEventListener",function(e){return function(n,r,i){try{"function"==typeof r.handleEvent&&(r.handleEvent=Oe(r.handleEvent.bind(r),{mechanism:{data:{function:"handleEvent",handler:q(r),target:t},handled:!0,type:"instrument"}}))}catch(t){}return e.call(this,n,Oe(r,{mechanism:{data:{function:"addEventListener",handler:q(r),target:t},handled:!0,type:"instrument"}}),i)}}),X(n,"removeEventListener",function(t){return function(e,n,r){let i=n;try{i=i&&(i.__sentry_wrapped__||i)}catch(t){}return t.call(this,e,i,r)}}))}Mt(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(t=>{t in n&&"function"==typeof n[t]&&X(n,t,function(e){const n={mechanism:{data:{function:t,handler:q(e)},handled:!0,type:"instrument"}};return e.__sentry_original__&&(n.mechanism.data.handler=q(e.__sentry_original__)),Oe(e,n)})}),t.apply(this,e)}}setupOnce(){this.Rt=this.Rt;const t=x();X(t,"setTimeout",this.It.bind(this)),X(t,"setInterval",this.It.bind(this)),X(t,"requestAnimationFrame",this.Nt.bind(this)),"XMLHttpRequest"in t&&X(XMLHttpRequest.prototype,"send",this.Mt.bind(this)),["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"].forEach(this.Ct.bind(this))}}$e.id="TryCatch";class ke{constructor(t){this.name=ke.id,this.nt=Object.assign({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t)}Ut(e){const n={category:"console",data:{arguments:e.args,logger:"console"},level:t.Severity.fromString(e.level),message:b(e.args," ")};if("assert"===e.level){if(!1!==e.args[0])return;n.message=`Assertion failed: ${b(e.args.slice(1)," ")||"console.assert"}`,n.data.arguments=e.args.slice(1)}Ct().addBreadcrumb(n,{input:e.args,level:e.level})}At(t){let e;try{e=t.event.target?D(t.event.target):D(t.event)}catch(t){e=""}0!==e.length&&Ct().addBreadcrumb({category:`ui.${t.name}`,message:e},{event:t.event,name:t.name})}Lt(t){if(t.endTimestamp){if(t.xhr.__sentry_own_request__)return;Ct().addBreadcrumb({category:"xhr",data:t.xhr.__sentry_xhr__,type:"http"},{xhr:t.xhr})}else t.xhr.__sentry_own_request__&&Se(t.args[0])}Ft(e){if(!e.endTimestamp)return;const n=Ct().getClient(),r=n&&n.getDsn();if(r){const t=new Bt(r).getStoreEndpoint();if(t&&-1!==e.fetchData.url.indexOf(t)&&"POST"===e.fetchData.method&&e.args[1]&&e.args[1].body)return void Se(e.args[1].body)}e.error?Ct().addBreadcrumb({category:"fetch",data:Object.assign({},e.fetchData,{status_code:e.response.status}),level:t.Severity.Error,type:"http"},{data:e.error,input:e.args}):Ct().addBreadcrumb({category:"fetch",data:Object.assign({},e.fetchData,{status_code:e.response.status}),type:"http"},{input:e.args,response:e.response})}qt(t){const e=x();let n=t.from,r=t.to;const i=_(e.location.href);let s=_(n);const o=_(r);s.path||(s=i),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),i.protocol===s.protocol&&i.host===s.host&&(n=s.relative),Ct().addBreadcrumb({category:"navigation",data:{from:n,to:r}})}setupOnce(){this.nt.console&&at({callback:(...t)=>{this.Ut(...t)},type:"console"}),this.nt.dom&&at({callback:(...t)=>{this.At(...t)},type:"dom"}),this.nt.xhr&&at({callback:(...t)=>{this.Lt(...t)},type:"xhr"}),this.nt.fetch&&at({callback:(...t)=>{this.Ft(...t)},type:"fetch"}),this.nt.history&&at({callback:(...t)=>{this.qt(...t)},type:"history"})}}function Se(e){try{const n=JSON.parse(e);Ct().addBreadcrumb({category:`sentry.${"transaction"===n.type?"transaction":"event"}`,event_id:n.event_id,level:n.level||t.Severity.fromString("error"),message:$(n)},{event:n})}catch(t){P.error("Error while adding sentry type breadcrumb")}}ke.id="Breadcrumbs";const Te="cause",De=5;class Re{constructor(t={}){this.name=Re.id,this.Bt=t.key||Te,this.O=t.limit||De}setupOnce(){kt((t,e)=>{const n=Ct().getIntegration(Re);return n?n.Ht(t,e):t})}Ht(t,e){if(!(t.exception&&t.exception.values&&e&&y(e.originalException,Error)))return t;const n=this.Pt(e.originalException,this.Bt);return t.exception.values=[...n,...t.exception.values],t}Pt(t,e,n=[]){if(!y(t[e],Error)||n.length+1>=this.O)return n;const r=ue(ie(t[e]));return this.Pt(t[e],e,[r,...n])}}Re.id="LinkedErrors";const Ie=x();class Ne{constructor(){this.name=Ne.id}setupOnce(){kt(t=>{if(Ct().getIntegration(Ne)){if(!Ie.navigator||!Ie.location)return t;const e=t.request||{};return e.url=e.url||Ie.location.href,e.headers=e.headers||{},e.headers["User-Agent"]=Ie.navigator.userAgent,Object.assign({},t,{request:e})}return t})}}Ne.id="UserAgent";var Ce=Object.freeze({GlobalHandlers:_e,TryCatch:$e,Breadcrumbs:ke,LinkedErrors:Re,UserAgent:Ne});const Me=[new Kt,new Jt,new $e,new ke,new _e,new Re,new Ne];let Ue={};const Ae=x();Ae.Sentry&&Ae.Sentry.Integrations&&(Ue=Ae.Sentry.Integrations);const Le=Object.assign({},Ue,Qt,Ce);return t.BrowserClient=Ee,t.Hub=Rt,t.Integrations=Le,t.SDK_NAME=ge,t.SDK_VERSION=we,t.Scope=_t,t.Transports=ve,t.addBreadcrumb=function(t){Lt("addBreadcrumb",t)},t.addGlobalEventProcessor=kt,t.captureEvent=function(t){return Lt("captureEvent",t)},t.captureException=captureException,t.captureMessage=function(t,e){let n;try{throw new Error(t)}catch(t){n=t}return Lt("captureMessage",t,e,{originalException:t,syntheticException:n})},t.close=function(t){const e=Ct().getClient();return e?e.close(t):tt.reject(!1)},t.configureScope=function(t){Lt("configureScope",t)},t.defaultIntegrations=Me,t.flush=function(t){const e=Ct().getClient();return e?e.flush(t):tt.reject(!1)},t.forceLoad=function(){},t.getCurrentHub=Ct,t.getHubFromCarrier=Ut,t.init=function(t={}){if(void 0===t.defaultIntegrations&&(t.defaultIntegrations=Me),void 0===t.release){const e=x();e.SENTRY_RELEASE&&e.SENTRY_RELEASE.id&&(t.release=e.SENTRY_RELEASE.id)}!function(t,e){!0===e.debug&&P.enable(),Ct().bindClient(new t(e))}(Ee,t)},t.lastEventId=function(){return Ct().lastEventId()},t.onLoad=function(t){t()},t.setContext=function(t,e){Lt("setContext",t,e)},t.setExtra=function(t,e){Lt("setExtra",t,e)},t.setExtras=function(t){Lt("setExtras",t)},t.setTag=function(t,e){Lt("setTag",t,e)},t.setTags=function(t){Lt("setTags",t)},t.setUser=function(t){Lt("setUser",t)},t.showReportDialog=function(t={}){t.eventId||(t.eventId=Ct().lastEventId());const e=Ct().getClient();e&&e.showReportDialog(t)},t.withScope=Ft,t.wrap=function(t){return Oe(t)()},t}({});
-//# sourceMappingURL=bundle.es6.min.js.map
diff --git a/node_modules/@sentry/browser/build/bundle.es6.min.js.map b/node_modules/@sentry/browser/build/bundle.es6.min.js.map
deleted file mode 100644
index 04634ad..0000000
--- a/node_modules/@sentry/browser/build/bundle.es6.min.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"bundle.es6.min.js","sources":["../../types/src/loglevel.ts","../../types/src/severity.ts","../../types/src/span.ts","../../types/src/status.ts","../../utils/src/polyfill.ts","../../utils/src/error.ts","../../utils/src/is.ts","../../utils/src/string.ts","../../utils/src/misc.ts","../../utils/src/logger.ts","../../utils/src/memo.ts","../../utils/src/object.ts","../../utils/src/syncpromise.ts","../../utils/src/promisebuffer.ts","../../utils/src/supports.ts","../../utils/src/instrument.ts","../../utils/src/dsn.ts","../../hub/src/scope.ts","../../hub/src/hub.ts","../../minimal/src/index.ts","../../core/src/api.ts","../../core/src/integration.ts","../../core/src/baseclient.ts","../../core/src/transports/noop.ts","../../core/src/basebackend.ts","../../core/src/integrations/functiontostring.ts","../../core/src/integrations/inboundfilters.ts","../src/tracekit.ts","../src/parsers.ts","../src/eventbuilder.ts","../src/transports/base.ts","../src/transports/fetch.ts","../src/transports/xhr.ts","../src/backend.ts","../src/version.ts","../src/client.ts","../src/helpers.ts","../src/integrations/globalhandlers.ts","../src/integrations/trycatch.ts","../src/integrations/breadcrumbs.ts","../src/integrations/linkederrors.ts","../src/integrations/useragent.ts","../src/sdk.ts","../src/index.ts","../../core/src/sdk.ts"],"sourcesContent":["/** Console logging verbosity for the SDK. */\nexport enum LogLevel {\n /** No logs will be generated. */\n None = 0,\n /** Only SDK internal errors will be logged. */\n Error = 1,\n /** Information useful for debugging the SDK will be logged. */\n Debug = 2,\n /** All SDK actions will be logged. */\n Verbose = 3,\n}\n","/** JSDoc */\nexport enum Severity {\n /** JSDoc */\n Fatal = 'fatal',\n /** JSDoc */\n Error = 'error',\n /** JSDoc */\n Warning = 'warning',\n /** JSDoc */\n Log = 'log',\n /** JSDoc */\n Info = 'info',\n /** JSDoc */\n Debug = 'debug',\n /** JSDoc */\n Critical = 'critical',\n}\n// tslint:disable:completed-docs\n// tslint:disable:no-unnecessary-qualifier no-namespace\nexport namespace Severity {\n /**\n * Converts a string-based level into a {@link Severity}.\n *\n * @param level string representation of Severity\n * @returns Severity\n */\n export function fromString(level: string): Severity {\n switch (level) {\n case 'debug':\n return Severity.Debug;\n case 'info':\n return Severity.Info;\n case 'warn':\n case 'warning':\n return Severity.Warning;\n case 'error':\n return Severity.Error;\n case 'fatal':\n return Severity.Fatal;\n case 'critical':\n return Severity.Critical;\n case 'log':\n default:\n return Severity.Log;\n }\n }\n}\n","/** Span holding trace_id, span_id */\nexport interface Span {\n /** Sets the finish timestamp on the current span and sends it if it was a transaction */\n finish(useLastSpanTimestamp?: boolean): string | undefined;\n /** Return a traceparent compatible header string */\n toTraceparent(): string;\n /** Convert the object to JSON for w. spans array info only */\n getTraceContext(): object;\n /** Convert the object to JSON */\n toJSON(): object;\n\n /**\n * Sets the tag attribute on the current span\n * @param key Tag key\n * @param value Tag value\n */\n setTag(key: string, value: string): this;\n\n /**\n * Sets the data attribute on the current span\n * @param key Data key\n * @param value Data value\n */\n setData(key: string, value: any): this;\n\n /**\n * Sets the status attribute on the current span\n * @param status http code used to set the status\n */\n setStatus(status: SpanStatus): this;\n\n /**\n * Sets the status attribute on the current span based on the http code\n * @param httpStatus http code used to set the status\n */\n setHttpStatus(httpStatus: number): this;\n\n /**\n * Determines whether span was successful (HTTP200)\n */\n isSuccess(): boolean;\n}\n\n/** Interface holder all properties that can be set on a Span on creation. */\nexport interface SpanContext {\n /**\n * Description of the Span.\n */\n description?: string;\n /**\n * Operation of the Span.\n */\n op?: string;\n /**\n * Completion status of the Span.\n */\n status?: SpanStatus;\n /**\n * Parent Span ID\n */\n parentSpanId?: string;\n /**\n * Has the sampling decision been made?\n */\n sampled?: boolean;\n /**\n * Span ID\n */\n spanId?: string;\n /**\n * Trace ID\n */\n traceId?: string;\n /**\n * Transaction of the Span.\n */\n transaction?: string;\n /**\n * Tags of the Span.\n */\n tags?: { [key: string]: string };\n\n /**\n * Data of the Span.\n */\n data?: { [key: string]: any };\n}\n\n/** The status of an Span. */\nexport enum SpanStatus {\n /** The operation completed successfully. */\n Ok = 'ok',\n /** Deadline expired before operation could complete. */\n DeadlineExceeded = 'deadline_exceeded',\n /** 401 Unauthorized (actually does mean unauthenticated according to RFC 7235) */\n Unauthenticated = 'unauthenticated',\n /** 403 Forbidden */\n PermissionDenied = 'permission_denied',\n /** 404 Not Found. Some requested entity (file or directory) was not found. */\n NotFound = 'not_found',\n /** 429 Too Many Requests */\n ResourceExhausted = 'resource_exhausted',\n /** Client specified an invalid argument. 4xx. */\n InvalidArgument = 'invalid_argument',\n /** 501 Not Implemented */\n Unimplemented = 'unimplemented',\n /** 503 Service Unavailable */\n Unavailable = 'unavailable',\n /** Other/generic 5xx. */\n InternalError = 'internal_error',\n /** Unknown. Any non-standard HTTP status code. */\n UnknownError = 'unknown_error',\n /** The operation was cancelled (typically by the user). */\n Cancelled = 'cancelled',\n /** Already exists (409) */\n AlreadyExists = 'already_exists',\n /** Operation was rejected because the system is not in a state required for the operation's */\n FailedPrecondition = 'failed_precondition',\n /** The operation was aborted, typically due to a concurrency issue. */\n Aborted = 'aborted',\n /** Operation was attempted past the valid range. */\n OutOfRange = 'out_of_range',\n /** Unrecoverable data loss or corruption */\n DataLoss = 'data_loss',\n}\n\n// tslint:disable:no-unnecessary-qualifier no-namespace\nexport namespace SpanStatus {\n /**\n * Converts a HTTP status code into a {@link SpanStatus}.\n *\n * @param httpStatus The HTTP response status code.\n * @returns The span status or {@link SpanStatus.UnknownError}.\n */\n // tslint:disable-next-line:completed-docs\n export function fromHttpCode(httpStatus: number): SpanStatus {\n if (httpStatus < 400) {\n return SpanStatus.Ok;\n }\n\n if (httpStatus >= 400 && httpStatus < 500) {\n switch (httpStatus) {\n case 401:\n return SpanStatus.Unauthenticated;\n case 403:\n return SpanStatus.PermissionDenied;\n case 404:\n return SpanStatus.NotFound;\n case 409:\n return SpanStatus.AlreadyExists;\n case 413:\n return SpanStatus.FailedPrecondition;\n case 429:\n return SpanStatus.ResourceExhausted;\n default:\n return SpanStatus.InvalidArgument;\n }\n }\n\n if (httpStatus >= 500 && httpStatus < 600) {\n switch (httpStatus) {\n case 501:\n return SpanStatus.Unimplemented;\n case 503:\n return SpanStatus.Unavailable;\n case 504:\n return SpanStatus.DeadlineExceeded;\n default:\n return SpanStatus.InternalError;\n }\n }\n\n return SpanStatus.UnknownError;\n }\n}\n","/** The status of an event. */\nexport enum Status {\n /** The status could not be determined. */\n Unknown = 'unknown',\n /** The event was skipped due to configuration or callbacks. */\n Skipped = 'skipped',\n /** The event was sent to Sentry successfully. */\n Success = 'success',\n /** The client is currently rate limited and will try again later. */\n RateLimit = 'rate_limit',\n /** The event could not be processed. */\n Invalid = 'invalid',\n /** A server-side error ocurred during submission. */\n Failed = 'failed',\n}\n// tslint:disable:completed-docs\n// tslint:disable:no-unnecessary-qualifier no-namespace\nexport namespace Status {\n /**\n * Converts a HTTP status code into a {@link Status}.\n *\n * @param code The HTTP response status code.\n * @returns The send status or {@link Status.Unknown}.\n */\n export function fromHttpCode(code: number): Status {\n if (code >= 200 && code < 300) {\n return Status.Success;\n }\n\n if (code === 429) {\n return Status.RateLimit;\n }\n\n if (code >= 400 && code < 500) {\n return Status.Invalid;\n }\n\n if (code >= 500) {\n return Status.Failed;\n }\n\n return Status.Unknown;\n }\n}\n","export const setPrototypeOf =\n Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties); // tslint:disable-line:no-unbound-method\n\n/**\n * setPrototypeOf polyfill using __proto__\n */\nfunction setProtoOf(obj: TTarget, proto: TProto): TTarget & TProto {\n // @ts-ignore\n obj.__proto__ = proto;\n return obj as TTarget & TProto;\n}\n\n/**\n * setPrototypeOf polyfill using mixin\n */\nfunction mixinProperties(obj: TTarget, proto: TProto): TTarget & TProto {\n for (const prop in proto) {\n if (!obj.hasOwnProperty(prop)) {\n // @ts-ignore\n obj[prop] = proto[prop];\n }\n }\n\n return obj as TTarget & TProto;\n}\n","import { setPrototypeOf } from './polyfill';\n\n/** An error emitted by Sentry SDKs and related utilities. */\nexport class SentryError extends Error {\n /** Display name of this error instance. */\n public name: string;\n\n public constructor(public message: string) {\n super(message);\n\n // tslint:disable:no-unsafe-any\n this.name = new.target.prototype.constructor.name;\n setPrototypeOf(this, new.target.prototype);\n }\n}\n","/**\n * Checks whether given value's type is one of a few Error or Error-like\n * {@link isError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isError(wat: any): boolean {\n switch (Object.prototype.toString.call(wat)) {\n case '[object Error]':\n return true;\n case '[object Exception]':\n return true;\n case '[object DOMException]':\n return true;\n default:\n return isInstanceOf(wat, Error);\n }\n}\n\n/**\n * Checks whether given value's type is ErrorEvent\n * {@link isErrorEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isErrorEvent(wat: any): boolean {\n return Object.prototype.toString.call(wat) === '[object ErrorEvent]';\n}\n\n/**\n * Checks whether given value's type is DOMError\n * {@link isDOMError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isDOMError(wat: any): boolean {\n return Object.prototype.toString.call(wat) === '[object DOMError]';\n}\n\n/**\n * Checks whether given value's type is DOMException\n * {@link isDOMException}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isDOMException(wat: any): boolean {\n return Object.prototype.toString.call(wat) === '[object DOMException]';\n}\n\n/**\n * Checks whether given value's type is a string\n * {@link isString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isString(wat: any): boolean {\n return Object.prototype.toString.call(wat) === '[object String]';\n}\n\n/**\n * Checks whether given value's is a primitive (undefined, null, number, boolean, string)\n * {@link isPrimitive}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isPrimitive(wat: any): boolean {\n return wat === null || (typeof wat !== 'object' && typeof wat !== 'function');\n}\n\n/**\n * Checks whether given value's type is an object literal\n * {@link isPlainObject}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isPlainObject(wat: any): boolean {\n return Object.prototype.toString.call(wat) === '[object Object]';\n}\n\n/**\n * Checks whether given value's type is an Event instance\n * {@link isEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isEvent(wat: any): boolean {\n // tslint:disable-next-line:strict-type-predicates\n return typeof Event !== 'undefined' && isInstanceOf(wat, Event);\n}\n\n/**\n * Checks whether given value's type is an Element instance\n * {@link isElement}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isElement(wat: any): boolean {\n // tslint:disable-next-line:strict-type-predicates\n return typeof Element !== 'undefined' && isInstanceOf(wat, Element);\n}\n\n/**\n * Checks whether given value's type is an regexp\n * {@link isRegExp}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isRegExp(wat: any): boolean {\n return Object.prototype.toString.call(wat) === '[object RegExp]';\n}\n\n/**\n * Checks whether given value has a then function.\n * @param wat A value to be checked.\n */\nexport function isThenable(wat: any): boolean {\n // tslint:disable:no-unsafe-any\n return Boolean(wat && wat.then && typeof wat.then === 'function');\n // tslint:enable:no-unsafe-any\n}\n\n/**\n * Checks whether given value's type is a SyntheticEvent\n * {@link isSyntheticEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isSyntheticEvent(wat: any): boolean {\n // tslint:disable-next-line:no-unsafe-any\n return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;\n}\n/**\n * Checks whether given value's type is an instance of provided constructor.\n * {@link isInstanceOf}.\n *\n * @param wat A value to be checked.\n * @param base A constructor to be used in a check.\n * @returns A boolean representing the result.\n */\nexport function isInstanceOf(wat: any, base: any): boolean {\n try {\n // tslint:disable-next-line:no-unsafe-any\n return wat instanceof base;\n } catch (_e) {\n return false;\n }\n}\n","import { isRegExp } from './is';\n\n/**\n * Truncates given string to the maximum characters count\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string\n * @returns string Encoded\n */\nexport function truncate(str: string, max: number = 0): string {\n // tslint:disable-next-line:strict-type-predicates\n if (typeof str !== 'string' || max === 0) {\n return str;\n }\n return str.length <= max ? str : `${str.substr(0, max)}...`;\n}\n\n/**\n * This is basically just `trim_line` from\n * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string\n * @returns string Encoded\n */\n\nexport function snipLine(line: string, colno: number): string {\n let newLine = line;\n const ll = newLine.length;\n if (ll <= 150) {\n return newLine;\n }\n if (colno > ll) {\n colno = ll; // tslint:disable-line:no-parameter-reassignment\n }\n\n let start = Math.max(colno - 60, 0);\n if (start < 5) {\n start = 0;\n }\n\n let end = Math.min(start + 140, ll);\n if (end > ll - 5) {\n end = ll;\n }\n if (end === ll) {\n start = Math.max(end - 140, 0);\n }\n\n newLine = newLine.slice(start, end);\n if (start > 0) {\n newLine = `'{snip} ${newLine}`;\n }\n if (end < ll) {\n newLine += ' {snip}';\n }\n\n return newLine;\n}\n\n/**\n * Join values in array\n * @param input array of values to be joined together\n * @param delimiter string to be placed in-between values\n * @returns Joined values\n */\nexport function safeJoin(input: any[], delimiter?: string): string {\n if (!Array.isArray(input)) {\n return '';\n }\n\n const output = [];\n // tslint:disable-next-line:prefer-for-of\n for (let i = 0; i < input.length; i++) {\n const value = input[i];\n try {\n output.push(String(value));\n } catch (e) {\n output.push('[value cannot be serialized]');\n }\n }\n\n return output.join(delimiter);\n}\n\n/**\n * Checks if the value matches a regex or includes the string\n * @param value The string value to be checked against\n * @param pattern Either a regex or a string that must be contained in value\n */\nexport function isMatchingPattern(value: string, pattern: RegExp | string): boolean {\n if (isRegExp(pattern)) {\n return (pattern as RegExp).test(value);\n }\n if (typeof pattern === 'string') {\n return value.indexOf(pattern) !== -1;\n }\n return false;\n}\n","import { Event, Integration, StackFrame, WrappedFunction } from '@sentry/types';\n\nimport { isString } from './is';\nimport { snipLine } from './string';\n\n/** Internal */\ninterface SentryGlobal {\n Sentry?: {\n Integrations?: Integration[];\n };\n SENTRY_ENVIRONMENT?: string;\n SENTRY_DSN?: string;\n SENTRY_RELEASE?: {\n id?: string;\n };\n __SENTRY__: {\n globalEventProcessors: any;\n hub: any;\n logger: any;\n };\n}\n\n/**\n * Requires a module which is protected _against bundler minification.\n *\n * @param request The module path to resolve\n */\nexport function dynamicRequire(mod: any, request: string): any {\n // tslint:disable-next-line: no-unsafe-any\n return mod.require(request);\n}\n\n/**\n * Checks whether we're in the Node.js or Browser environment\n *\n * @returns Answer to given question\n */\nexport function isNodeEnv(): boolean {\n // tslint:disable:strict-type-predicates\n return Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]';\n}\n\nconst fallbackGlobalObject = {};\n\n/**\n * Safely get global scope object\n *\n * @returns Global scope object\n */\nexport function getGlobalObject(): T & SentryGlobal {\n return (isNodeEnv()\n ? global\n : typeof window !== 'undefined'\n ? window\n : typeof self !== 'undefined'\n ? self\n : fallbackGlobalObject) as T & SentryGlobal;\n}\n// tslint:enable:strict-type-predicates\n\n/**\n * Extended Window interface that allows for Crypto API usage in IE browsers\n */\ninterface MsCryptoWindow extends Window {\n msCrypto?: Crypto;\n}\n\n/**\n * UUID4 generator\n *\n * @returns string Generated UUID4.\n */\nexport function uuid4(): string {\n const global = getGlobalObject() as MsCryptoWindow;\n const crypto = global.crypto || global.msCrypto;\n\n if (!(crypto === void 0) && crypto.getRandomValues) {\n // Use window.crypto API if available\n const arr = new Uint16Array(8);\n crypto.getRandomValues(arr);\n\n // set 4 in byte 7\n // tslint:disable-next-line:no-bitwise\n arr[3] = (arr[3] & 0xfff) | 0x4000;\n // set 2 most significant bits of byte 9 to '10'\n // tslint:disable-next-line:no-bitwise\n arr[4] = (arr[4] & 0x3fff) | 0x8000;\n\n const pad = (num: number): string => {\n let v = num.toString(16);\n while (v.length < 4) {\n v = `0${v}`;\n }\n return v;\n };\n\n return (\n pad(arr[0]) + pad(arr[1]) + pad(arr[2]) + pad(arr[3]) + pad(arr[4]) + pad(arr[5]) + pad(arr[6]) + pad(arr[7])\n );\n }\n // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523\n return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, c => {\n // tslint:disable-next-line:no-bitwise\n const r = (Math.random() * 16) | 0;\n // tslint:disable-next-line:no-bitwise\n const v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}\n\n/**\n * Parses string form of URL into an object\n * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B\n * // intentionally using regex and not href parsing trick because React Native and other\n * // environments where DOM might not be available\n * @returns parsed URL object\n */\nexport function parseUrl(\n url: string,\n): {\n host?: string;\n path?: string;\n protocol?: string;\n relative?: string;\n} {\n if (!url) {\n return {};\n }\n\n const match = url.match(/^(([^:\\/?#]+):)?(\\/\\/([^\\/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n\n if (!match) {\n return {};\n }\n\n // coerce to undefined values to empty string so we don't get 'undefined'\n const query = match[6] || '';\n const fragment = match[8] || '';\n return {\n host: match[4],\n path: match[5],\n protocol: match[2],\n relative: match[5] + query + fragment, // everything minus origin\n };\n}\n\n/**\n * Extracts either message or type+value from an event that can be used for user-facing logs\n * @returns event's description\n */\nexport function getEventDescription(event: Event): string {\n if (event.message) {\n return event.message;\n }\n if (event.exception && event.exception.values && event.exception.values[0]) {\n const exception = event.exception.values[0];\n\n if (exception.type && exception.value) {\n return `${exception.type}: ${exception.value}`;\n }\n return exception.type || exception.value || event.event_id || '';\n }\n return event.event_id || '';\n}\n\n/** JSDoc */\ninterface ExtensibleConsole extends Console {\n [key: string]: any;\n}\n\n/** JSDoc */\nexport function consoleSandbox(callback: () => any): any {\n const global = getGlobalObject();\n const levels = ['debug', 'info', 'warn', 'error', 'log', 'assert'];\n\n if (!('console' in global)) {\n return callback();\n }\n\n const originalConsole = global.console as ExtensibleConsole;\n const wrappedLevels: { [key: string]: any } = {};\n\n // Restore all wrapped console methods\n levels.forEach(level => {\n if (level in global.console && (originalConsole[level] as WrappedFunction).__sentry_original__) {\n wrappedLevels[level] = originalConsole[level] as WrappedFunction;\n originalConsole[level] = (originalConsole[level] as WrappedFunction).__sentry_original__;\n }\n });\n\n // Perform callback manipulations\n const result = callback();\n\n // Revert restoration to wrapped state\n Object.keys(wrappedLevels).forEach(level => {\n originalConsole[level] = wrappedLevels[level];\n });\n\n return result;\n}\n\n/**\n * Adds exception values, type and value to an synthetic Exception.\n * @param event The event to modify.\n * @param value Value of the exception.\n * @param type Type of the exception.\n * @hidden\n */\nexport function addExceptionTypeValue(event: Event, value?: string, type?: string): void {\n event.exception = event.exception || {};\n event.exception.values = event.exception.values || [];\n event.exception.values[0] = event.exception.values[0] || {};\n event.exception.values[0].value = event.exception.values[0].value || value || '';\n event.exception.values[0].type = event.exception.values[0].type || type || 'Error';\n}\n\n/**\n * Adds exception mechanism to a given event.\n * @param event The event to modify.\n * @param mechanism Mechanism of the mechanism.\n * @hidden\n */\nexport function addExceptionMechanism(\n event: Event,\n mechanism: {\n [key: string]: any;\n } = {},\n): void {\n // TODO: Use real type with `keyof Mechanism` thingy and maybe make it better?\n try {\n // @ts-ignore\n // tslint:disable:no-non-null-assertion\n event.exception!.values![0].mechanism = event.exception!.values![0].mechanism || {};\n Object.keys(mechanism).forEach(key => {\n // @ts-ignore\n event.exception!.values![0].mechanism[key] = mechanism[key];\n });\n } catch (_oO) {\n // no-empty\n }\n}\n\n/**\n * A safe form of location.href\n */\nexport function getLocationHref(): string {\n try {\n return document.location.href;\n } catch (oO) {\n return '';\n }\n}\n\n/**\n * Given a child DOM element, returns a query-selector statement describing that\n * and its ancestors\n * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nexport function htmlTreeAsString(elem: unknown): string {\n type SimpleNode = {\n parentNode: SimpleNode;\n } | null;\n\n // try/catch both:\n // - accessing event.target (see getsentry/raven-js#838, #768)\n // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly\n // - can throw an exception in some circumstances.\n try {\n let currentElem = elem as SimpleNode;\n const MAX_TRAVERSE_HEIGHT = 5;\n const MAX_OUTPUT_LEN = 80;\n const out = [];\n let height = 0;\n let len = 0;\n const separator = ' > ';\n const sepLength = separator.length;\n let nextStr;\n\n while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {\n nextStr = _htmlElementAsString(currentElem);\n // bail out if\n // - nextStr is the 'html' element\n // - the length of the string that would be created exceeds MAX_OUTPUT_LEN\n // (ignore this limit if we are on the first iteration)\n if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)) {\n break;\n }\n\n out.push(nextStr);\n\n len += nextStr.length;\n currentElem = currentElem.parentNode;\n }\n\n return out.reverse().join(separator);\n } catch (_oO) {\n return '';\n }\n}\n\n/**\n * Returns a simple, query-selector representation of a DOM element\n * e.g. [HTMLElement] => input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nfunction _htmlElementAsString(el: unknown): string {\n const elem = el as {\n getAttribute(key: string): string; // tslint:disable-line:completed-docs\n tagName?: string;\n id?: string;\n className?: string;\n };\n\n const out = [];\n let className;\n let classes;\n let key;\n let attr;\n let i;\n\n if (!elem || !elem.tagName) {\n return '';\n }\n\n out.push(elem.tagName.toLowerCase());\n if (elem.id) {\n out.push(`#${elem.id}`);\n }\n\n className = elem.className;\n if (className && isString(className)) {\n classes = className.split(/\\s+/);\n for (i = 0; i < classes.length; i++) {\n out.push(`.${classes[i]}`);\n }\n }\n const attrWhitelist = ['type', 'name', 'title', 'alt'];\n for (i = 0; i < attrWhitelist.length; i++) {\n key = attrWhitelist[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.push(`[${key}=\"${attr}\"]`);\n }\n }\n return out.join('');\n}\n\nconst INITIAL_TIME = Date.now();\nlet prevNow = 0;\n\nconst performanceFallback: Pick = {\n now(): number {\n let now = Date.now() - INITIAL_TIME;\n if (now < prevNow) {\n now = prevNow;\n }\n prevNow = now;\n return now;\n },\n timeOrigin: INITIAL_TIME,\n};\n\nexport const crossPlatformPerformance: Pick = (() => {\n if (isNodeEnv()) {\n try {\n const perfHooks = dynamicRequire(module, 'perf_hooks') as { performance: Performance };\n return perfHooks.performance;\n } catch (_) {\n return performanceFallback;\n }\n }\n\n if (getGlobalObject().performance) {\n // Polyfill for performance.timeOrigin.\n //\n // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin\n // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing.\n // tslint:disable-next-line:strict-type-predicates\n if (performance.timeOrigin === undefined) {\n // For webworkers it could mean we don't have performance.timing then we fallback\n // tslint:disable-next-line:deprecation\n if (!performance.timing) {\n return performanceFallback;\n }\n // tslint:disable-next-line:deprecation\n if (!performance.timing.navigationStart) {\n return performanceFallback;\n }\n\n // @ts-ignore\n // tslint:disable-next-line:deprecation\n performance.timeOrigin = performance.timing.navigationStart;\n }\n }\n\n return getGlobalObject().performance || performanceFallback;\n})();\n\n/**\n * Returns a timestamp in seconds with milliseconds precision since the UNIX epoch calculated with the monotonic clock.\n */\nexport function timestampWithMs(): number {\n return (crossPlatformPerformance.timeOrigin + crossPlatformPerformance.now()) / 1000;\n}\n\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nconst SEMVER_REGEXP = /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\n\n/**\n * Represents Semantic Versioning object\n */\ninterface SemVer {\n major?: number;\n minor?: number;\n patch?: number;\n prerelease?: string;\n buildmetadata?: string;\n}\n\n/**\n * Parses input into a SemVer interface\n * @param input string representation of a semver version\n */\nexport function parseSemver(input: string): SemVer {\n const match = input.match(SEMVER_REGEXP) || [];\n const major = parseInt(match[1], 10);\n const minor = parseInt(match[2], 10);\n const patch = parseInt(match[3], 10);\n return {\n buildmetadata: match[5],\n major: isNaN(major) ? undefined : major,\n minor: isNaN(minor) ? undefined : minor,\n patch: isNaN(patch) ? undefined : patch,\n prerelease: match[4],\n };\n}\n\nconst defaultRetryAfter = 60 * 1000; // 60 seconds\n\n/**\n * Extracts Retry-After value from the request header or returns default value\n * @param now current unix timestamp\n * @param header string representation of 'Retry-After' header\n */\nexport function parseRetryAfterHeader(now: number, header?: string | number | null): number {\n if (!header) {\n return defaultRetryAfter;\n }\n\n const headerDelay = parseInt(`${header}`, 10);\n if (!isNaN(headerDelay)) {\n return headerDelay * 1000;\n }\n\n const headerDate = Date.parse(`${header}`);\n if (!isNaN(headerDate)) {\n return headerDate - now;\n }\n\n return defaultRetryAfter;\n}\n\nconst defaultFunctionName = '';\n\n/**\n * Safely extract function name from itself\n */\nexport function getFunctionName(fn: unknown): string {\n try {\n if (!fn || typeof fn !== 'function') {\n return defaultFunctionName;\n }\n return fn.name || defaultFunctionName;\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n return defaultFunctionName;\n }\n}\n\n/**\n * This function adds context (pre/post/line) lines to the provided frame\n *\n * @param lines string[] containing all lines\n * @param frame StackFrame that will be mutated\n * @param linesOfContext number of context lines we want to add pre/post\n */\nexport function addContextToFrame(lines: string[], frame: StackFrame, linesOfContext: number = 5): void {\n const lineno = frame.lineno || 0;\n const maxLines = lines.length;\n const sourceLine = Math.max(Math.min(maxLines, lineno - 1), 0);\n\n frame.pre_context = lines\n .slice(Math.max(0, sourceLine - linesOfContext), sourceLine)\n .map((line: string) => snipLine(line, 0));\n\n frame.context_line = snipLine(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0);\n\n frame.post_context = lines\n .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext)\n .map((line: string) => snipLine(line, 0));\n}\n","import { consoleSandbox, getGlobalObject } from './misc';\n\n// TODO: Implement different loggers for different environments\nconst global = getGlobalObject();\n\n/** Prefix for logging strings */\nconst PREFIX = 'Sentry Logger ';\n\n/** JSDoc */\nclass Logger {\n /** JSDoc */\n private _enabled: boolean;\n\n /** JSDoc */\n public constructor() {\n this._enabled = false;\n }\n\n /** JSDoc */\n public disable(): void {\n this._enabled = false;\n }\n\n /** JSDoc */\n public enable(): void {\n this._enabled = true;\n }\n\n /** JSDoc */\n public log(...args: any[]): void {\n if (!this._enabled) {\n return;\n }\n consoleSandbox(() => {\n global.console.log(`${PREFIX}[Log]: ${args.join(' ')}`); // tslint:disable-line:no-console\n });\n }\n\n /** JSDoc */\n public warn(...args: any[]): void {\n if (!this._enabled) {\n return;\n }\n consoleSandbox(() => {\n global.console.warn(`${PREFIX}[Warn]: ${args.join(' ')}`); // tslint:disable-line:no-console\n });\n }\n\n /** JSDoc */\n public error(...args: any[]): void {\n if (!this._enabled) {\n return;\n }\n consoleSandbox(() => {\n global.console.error(`${PREFIX}[Error]: ${args.join(' ')}`); // tslint:disable-line:no-console\n });\n }\n}\n\n// Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used\nglobal.__SENTRY__ = global.__SENTRY__ || {};\nconst logger = (global.__SENTRY__.logger as Logger) || (global.__SENTRY__.logger = new Logger());\n\nexport { logger };\n","// tslint:disable:no-unsafe-any\n/**\n * Memo class used for decycle json objects. Uses WeakSet if available otherwise array.\n */\nexport class Memo {\n /** Determines if WeakSet is available */\n private readonly _hasWeakSet: boolean;\n /** Either WeakSet or Array */\n private readonly _inner: any;\n\n public constructor() {\n // tslint:disable-next-line\n this._hasWeakSet = typeof WeakSet === 'function';\n this._inner = this._hasWeakSet ? new WeakSet() : [];\n }\n\n /**\n * Sets obj to remember.\n * @param obj Object to remember\n */\n public memoize(obj: any): boolean {\n if (this._hasWeakSet) {\n if (this._inner.has(obj)) {\n return true;\n }\n this._inner.add(obj);\n return false;\n }\n // tslint:disable-next-line:prefer-for-of\n for (let i = 0; i < this._inner.length; i++) {\n const value = this._inner[i];\n if (value === obj) {\n return true;\n }\n }\n this._inner.push(obj);\n return false;\n }\n\n /**\n * Removes object from internal storage.\n * @param obj Object to forget\n */\n public unmemoize(obj: any): void {\n if (this._hasWeakSet) {\n this._inner.delete(obj);\n } else {\n for (let i = 0; i < this._inner.length; i++) {\n if (this._inner[i] === obj) {\n this._inner.splice(i, 1);\n break;\n }\n }\n }\n }\n}\n","import { ExtendedError, WrappedFunction } from '@sentry/types';\n\nimport { isElement, isError, isEvent, isInstanceOf, isPlainObject, isPrimitive, isSyntheticEvent } from './is';\nimport { Memo } from './memo';\nimport { getFunctionName, htmlTreeAsString } from './misc';\nimport { truncate } from './string';\n\n/**\n * Wrap a given object method with a higher-order function\n *\n * @param source An object that contains a method to be wrapped.\n * @param name A name of method to be wrapped.\n * @param replacement A function that should be used to wrap a given method.\n * @returns void\n */\nexport function fill(source: { [key: string]: any }, name: string, replacement: (...args: any[]) => any): void {\n if (!(name in source)) {\n return;\n }\n\n const original = source[name] as () => any;\n const wrapped = replacement(original) as WrappedFunction;\n\n // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work\n // otherwise it'll throw \"TypeError: Object.defineProperties called on non-object\"\n // tslint:disable-next-line:strict-type-predicates\n if (typeof wrapped === 'function') {\n try {\n wrapped.prototype = wrapped.prototype || {};\n Object.defineProperties(wrapped, {\n __sentry_original__: {\n enumerable: false,\n value: original,\n },\n });\n } catch (_Oo) {\n // This can throw if multiple fill happens on a global object like XMLHttpRequest\n // Fixes https://github.com/getsentry/sentry-javascript/issues/2043\n }\n }\n\n source[name] = wrapped;\n}\n\n/**\n * Encodes given object into url-friendly format\n *\n * @param object An object that contains serializable values\n * @returns string Encoded\n */\nexport function urlEncode(object: { [key: string]: any }): string {\n return Object.keys(object)\n .map(\n // tslint:disable-next-line:no-unsafe-any\n key => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`,\n )\n .join('&');\n}\n\n/**\n * Transforms any object into an object literal with all it's attributes\n * attached to it.\n *\n * @param value Initial source that we have to transform in order to be usable by the serializer\n */\nfunction getWalkSource(\n value: any,\n): {\n [key: string]: any;\n} {\n if (isError(value)) {\n const error = value as ExtendedError;\n const err: {\n stack: string | undefined;\n message: string;\n name: string;\n [key: string]: any;\n } = {\n message: error.message,\n name: error.name,\n stack: error.stack,\n };\n\n for (const i in error) {\n if (Object.prototype.hasOwnProperty.call(error, i)) {\n err[i] = error[i];\n }\n }\n\n return err;\n }\n\n if (isEvent(value)) {\n /**\n * Event-like interface that's usable in browser and node\n */\n interface SimpleEvent {\n [key: string]: unknown;\n type: string;\n target?: unknown;\n currentTarget?: unknown;\n }\n\n const event = value as SimpleEvent;\n\n const source: {\n [key: string]: any;\n } = {};\n\n source.type = event.type;\n\n // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n try {\n source.target = isElement(event.target)\n ? htmlTreeAsString(event.target)\n : Object.prototype.toString.call(event.target);\n } catch (_oO) {\n source.target = '';\n }\n\n try {\n source.currentTarget = isElement(event.currentTarget)\n ? htmlTreeAsString(event.currentTarget)\n : Object.prototype.toString.call(event.currentTarget);\n } catch (_oO) {\n source.currentTarget = '';\n }\n\n // tslint:disable-next-line:strict-type-predicates\n if (typeof CustomEvent !== 'undefined' && isInstanceOf(value, CustomEvent)) {\n source.detail = event.detail;\n }\n\n for (const i in event) {\n if (Object.prototype.hasOwnProperty.call(event, i)) {\n source[i] = event;\n }\n }\n\n return source;\n }\n\n return value as {\n [key: string]: any;\n };\n}\n\n/** Calculates bytes size of input string */\nfunction utf8Length(value: string): number {\n // tslint:disable-next-line:no-bitwise\n return ~-encodeURI(value).split(/%..|./).length;\n}\n\n/** Calculates bytes size of input object */\nfunction jsonSize(value: any): number {\n return utf8Length(JSON.stringify(value));\n}\n\n/** JSDoc */\nexport function normalizeToSize(\n object: { [key: string]: any },\n // Default Node.js REPL depth\n depth: number = 3,\n // 100kB, as 200kB is max payload size, so half sounds reasonable\n maxSize: number = 100 * 1024,\n): T {\n const serialized = normalize(object, depth);\n\n if (jsonSize(serialized) > maxSize) {\n return normalizeToSize(object, depth - 1, maxSize);\n }\n\n return serialized as T;\n}\n\n/** Transforms any input value into a string form, either primitive value or a type of the input */\nfunction serializeValue(value: any): any {\n const type = Object.prototype.toString.call(value);\n\n // Node.js REPL notation\n if (typeof value === 'string') {\n return value;\n }\n if (type === '[object Object]') {\n return '[Object]';\n }\n if (type === '[object Array]') {\n return '[Array]';\n }\n\n const normalized = normalizeValue(value);\n return isPrimitive(normalized) ? normalized : type;\n}\n\n/**\n * normalizeValue()\n *\n * Takes unserializable input and make it serializable friendly\n *\n * - translates undefined/NaN values to \"[undefined]\"/\"[NaN]\" respectively,\n * - serializes Error objects\n * - filter global objects\n */\n// tslint:disable-next-line:cyclomatic-complexity\nfunction normalizeValue(value: T, key?: any): T | string {\n if (key === 'domain' && value && typeof value === 'object' && ((value as unknown) as { _events: any })._events) {\n return '[Domain]';\n }\n\n if (key === 'domainEmitter') {\n return '[DomainEmitter]';\n }\n\n if (typeof (global as any) !== 'undefined' && (value as unknown) === global) {\n return '[Global]';\n }\n\n if (typeof (window as any) !== 'undefined' && (value as unknown) === window) {\n return '[Window]';\n }\n\n if (typeof (document as any) !== 'undefined' && (value as unknown) === document) {\n return '[Document]';\n }\n\n // React's SyntheticEvent thingy\n if (isSyntheticEvent(value)) {\n return '[SyntheticEvent]';\n }\n\n // tslint:disable-next-line:no-tautology-expression\n if (typeof value === 'number' && value !== value) {\n return '[NaN]';\n }\n\n if (value === void 0) {\n return '[undefined]';\n }\n\n if (typeof value === 'function') {\n return `[Function: ${getFunctionName(value)}]`;\n }\n\n return value;\n}\n\n/**\n * Walks an object to perform a normalization on it\n *\n * @param key of object that's walked in current iteration\n * @param value object to be walked\n * @param depth Optional number indicating how deep should walking be performed\n * @param memo Optional Memo class handling decycling\n */\nexport function walk(key: string, value: any, depth: number = +Infinity, memo: Memo = new Memo()): any {\n // If we reach the maximum depth, serialize whatever has left\n if (depth === 0) {\n return serializeValue(value);\n }\n\n // If value implements `toJSON` method, call it and return early\n // tslint:disable:no-unsafe-any\n if (value !== null && value !== undefined && typeof value.toJSON === 'function') {\n return value.toJSON();\n }\n // tslint:enable:no-unsafe-any\n\n // If normalized value is a primitive, there are no branches left to walk, so we can just bail out, as theres no point in going down that branch any further\n const normalized = normalizeValue(value, key);\n if (isPrimitive(normalized)) {\n return normalized;\n }\n\n // Create source that we will use for next itterations, either objectified error object (Error type with extracted keys:value pairs) or the input itself\n const source = getWalkSource(value);\n\n // Create an accumulator that will act as a parent for all future itterations of that branch\n const acc = Array.isArray(value) ? [] : {};\n\n // If we already walked that branch, bail out, as it's circular reference\n if (memo.memoize(value)) {\n return '[Circular ~]';\n }\n\n // Walk all keys of the source\n for (const innerKey in source) {\n // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration.\n if (!Object.prototype.hasOwnProperty.call(source, innerKey)) {\n continue;\n }\n // Recursively walk through all the child nodes\n (acc as { [key: string]: any })[innerKey] = walk(innerKey, source[innerKey], depth - 1, memo);\n }\n\n // Once walked through all the branches, remove the parent from memo storage\n memo.unmemoize(value);\n\n // Return accumulated values\n return acc;\n}\n\n/**\n * normalize()\n *\n * - Creates a copy to prevent original input mutation\n * - Skip non-enumerablers\n * - Calls `toJSON` if implemented\n * - Removes circular references\n * - Translates non-serializeable values (undefined/NaN/Functions) to serializable format\n * - Translates known global objects/Classes to a string representations\n * - Takes care of Error objects serialization\n * - Optionally limit depth of final output\n */\nexport function normalize(input: any, depth?: number): any {\n try {\n // tslint:disable-next-line:no-unsafe-any\n return JSON.parse(JSON.stringify(input, (key: string, value: any) => walk(key, value, depth)));\n } catch (_oO) {\n return '**non-serializable**';\n }\n}\n\n/**\n * Given any captured exception, extract its keys and create a sorted\n * and truncated list that will be used inside the event message.\n * eg. `Non-error exception captured with keys: foo, bar, baz`\n */\nexport function extractExceptionKeysForMessage(exception: any, maxLength: number = 40): string {\n // tslint:disable:strict-type-predicates\n const keys = Object.keys(getWalkSource(exception));\n keys.sort();\n\n if (!keys.length) {\n return '[object has no keys]';\n }\n\n if (keys[0].length >= maxLength) {\n return truncate(keys[0], maxLength);\n }\n\n for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) {\n const serialized = keys.slice(0, includedKeys).join(', ');\n if (serialized.length > maxLength) {\n continue;\n }\n if (includedKeys === keys.length) {\n return serialized;\n }\n return truncate(serialized, maxLength);\n }\n\n return '';\n}\n\n/**\n * Given any object, return the new object with removed keys that value was `undefined`.\n * Works recursively on objects and arrays.\n */\nexport function dropUndefinedKeys(val: T): T {\n if (isPlainObject(val)) {\n const obj = val as { [key: string]: any };\n const rv: { [key: string]: any } = {};\n for (const key of Object.keys(obj)) {\n if (typeof obj[key] !== 'undefined') {\n rv[key] = dropUndefinedKeys(obj[key]);\n }\n }\n return rv as T;\n }\n\n if (Array.isArray(val)) {\n return val.map(dropUndefinedKeys) as any;\n }\n\n return val;\n}\n","import { isThenable } from './is';\n\n/** SyncPromise internal states */\nenum States {\n /** Pending */\n PENDING = 'PENDING',\n /** Resolved / OK */\n RESOLVED = 'RESOLVED',\n /** Rejected / Error */\n REJECTED = 'REJECTED',\n}\n\n/**\n * Thenable class that behaves like a Promise and follows it's interface\n * but is not async internally\n */\nclass SyncPromise implements PromiseLike {\n private _state: States = States.PENDING;\n private _handlers: Array<{\n onfulfilled?: ((value: T) => T | PromiseLike) | null;\n onrejected?: ((reason: any) => any) | null;\n }> = [];\n private _value: any;\n\n public constructor(\n executor: (resolve: (value?: T | PromiseLike | null) => void, reject: (reason?: any) => void) => void,\n ) {\n try {\n executor(this._resolve, this._reject);\n } catch (e) {\n this._reject(e);\n }\n }\n\n /** JSDoc */\n public toString(): string {\n return '[object SyncPromise]';\n }\n\n /** JSDoc */\n public static resolve(value: T | PromiseLike): PromiseLike {\n return new SyncPromise(resolve => {\n resolve(value);\n });\n }\n\n /** JSDoc */\n public static reject(reason?: any): PromiseLike {\n return new SyncPromise((_, reject) => {\n reject(reason);\n });\n }\n\n /** JSDoc */\n public static all(collection: Array>): PromiseLike {\n return new SyncPromise((resolve, reject) => {\n if (!Array.isArray(collection)) {\n reject(new TypeError(`Promise.all requires an array as input.`));\n return;\n }\n\n if (collection.length === 0) {\n resolve([]);\n return;\n }\n\n let counter = collection.length;\n const resolvedCollection: U[] = [];\n\n collection.forEach((item, index) => {\n SyncPromise.resolve(item)\n .then(value => {\n resolvedCollection[index] = value;\n counter -= 1;\n\n if (counter !== 0) {\n return;\n }\n resolve(resolvedCollection);\n })\n .then(null, reject);\n });\n });\n }\n\n /** JSDoc */\n public then(\n onfulfilled?: ((value: T) => TResult1 | PromiseLike) | null,\n onrejected?: ((reason: any) => TResult2 | PromiseLike) | null,\n ): PromiseLike {\n return new SyncPromise((resolve, reject) => {\n this._attachHandler({\n onfulfilled: result => {\n if (!onfulfilled) {\n // TODO: ¯\\_(ツ)_/¯\n // TODO: FIXME\n resolve(result as any);\n return;\n }\n try {\n resolve(onfulfilled(result));\n return;\n } catch (e) {\n reject(e);\n return;\n }\n },\n onrejected: reason => {\n if (!onrejected) {\n reject(reason);\n return;\n }\n try {\n resolve(onrejected(reason));\n return;\n } catch (e) {\n reject(e);\n return;\n }\n },\n });\n });\n }\n\n /** JSDoc */\n public catch(\n onrejected?: ((reason: any) => TResult | PromiseLike) | null,\n ): PromiseLike