@cloudflare/vite-plugin 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/asset-workers/asset-worker.js +517 -522
- package/dist/asset-workers/router-worker.js +226 -220
- package/dist/index.js +4 -1
- package/dist/runner-worker/index.js +8 -1
- package/package.json +8 -8
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
// ../workers-shared/dist/asset-worker.mjs
|
|
2
|
-
import { WorkerEntrypoint as
|
|
2
|
+
import { WorkerEntrypoint as Bs } from "cloudflare:workers";
|
|
3
3
|
var sr = Object.defineProperty;
|
|
4
4
|
var ir = (t, e, n) => e in t ? sr(t, e, { enumerable: true, configurable: true, writable: true, value: n }) : t[e] = n;
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var _e = (t, e, n) => (ir(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
6
|
+
var Ft = (t, e, n) => {
|
|
7
7
|
if (!e.has(t)) throw TypeError("Cannot " + n);
|
|
8
8
|
};
|
|
9
|
-
var
|
|
10
|
-
var
|
|
9
|
+
var et = (t, e, n) => (Ft(t, e, "read from private field"), n ? n.call(t) : e.get(t));
|
|
10
|
+
var $t = (t, e, n) => {
|
|
11
11
|
if (e.has(t)) throw TypeError("Cannot add the same private member more than once");
|
|
12
12
|
e instanceof WeakSet ? e.add(t) : e.set(t, n);
|
|
13
13
|
};
|
|
14
|
-
var
|
|
15
|
-
var
|
|
14
|
+
var Ht = (t, e, n, r) => (Ft(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n);
|
|
15
|
+
var ge = class {
|
|
16
16
|
constructor(e) {
|
|
17
17
|
this.performanceTimer = e;
|
|
18
18
|
}
|
|
@@ -20,73 +20,73 @@ var _e = class {
|
|
|
20
20
|
return this.performanceTimer ? this.performanceTimer.timeOrigin + this.performanceTimer.now() : Date.now();
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
var
|
|
23
|
+
var Yt = Object.prototype.toString;
|
|
24
24
|
function L(t) {
|
|
25
|
-
switch (
|
|
25
|
+
switch (Yt.call(t)) {
|
|
26
26
|
case "[object Error]":
|
|
27
27
|
case "[object Exception]":
|
|
28
28
|
case "[object DOMException]":
|
|
29
29
|
return true;
|
|
30
30
|
default:
|
|
31
|
-
return
|
|
31
|
+
return k(t, Error);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
return
|
|
34
|
+
function jt(t, e) {
|
|
35
|
+
return Yt.call(t) === `[object ${e}]`;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
return
|
|
37
|
+
function W(t) {
|
|
38
|
+
return jt(t, "String");
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function Ee(t) {
|
|
41
41
|
return t === null || typeof t != "object" && typeof t != "function";
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
return
|
|
45
|
-
}
|
|
46
|
-
function et(t) {
|
|
47
|
-
return typeof Event < "u" && v(t, Event);
|
|
43
|
+
function I(t) {
|
|
44
|
+
return jt(t, "Object");
|
|
48
45
|
}
|
|
49
46
|
function tt(t) {
|
|
50
|
-
return typeof
|
|
47
|
+
return typeof Event < "u" && k(t, Event);
|
|
48
|
+
}
|
|
49
|
+
function nt(t) {
|
|
50
|
+
return typeof Element < "u" && k(t, Element);
|
|
51
51
|
}
|
|
52
52
|
function B(t) {
|
|
53
53
|
return !!(t && t.then && typeof t.then == "function");
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
return
|
|
55
|
+
function rt(t) {
|
|
56
|
+
return I(t) && "nativeEvent" in t && "preventDefault" in t && "stopPropagation" in t;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function te(t) {
|
|
59
59
|
return typeof t == "number" && t !== t;
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function k(t, e) {
|
|
62
62
|
try {
|
|
63
63
|
return t instanceof e;
|
|
64
64
|
} catch {
|
|
65
65
|
return false;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function st(t) {
|
|
69
69
|
return !!(typeof t == "object" && t !== null && (t.__isVue || t._isVue));
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function M(t, e = 0) {
|
|
72
72
|
return typeof t != "string" || e === 0 || t.length <= e ? t : `${t.slice(0, e)}...`;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function ye(t) {
|
|
75
75
|
return t && t.Math == Math ? t : void 0;
|
|
76
76
|
}
|
|
77
|
-
var h = typeof globalThis == "object" &&
|
|
77
|
+
var h = typeof globalThis == "object" && ye(globalThis) || typeof window == "object" && ye(window) || typeof self == "object" && ye(self) || typeof global == "object" && ye(global) || /* @__PURE__ */ function() {
|
|
78
78
|
return this;
|
|
79
79
|
}() || {};
|
|
80
|
-
function
|
|
80
|
+
function A() {
|
|
81
81
|
return h;
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function ne(t, e, n) {
|
|
84
84
|
let r = n || h, s = r.__SENTRY__ = r.__SENTRY__ || {};
|
|
85
85
|
return s[t] || (s[t] = e());
|
|
86
86
|
}
|
|
87
|
-
var zs =
|
|
87
|
+
var zs = A();
|
|
88
88
|
var or = 80;
|
|
89
|
-
function
|
|
89
|
+
function qt(t, e = {}) {
|
|
90
90
|
if (!t) return "<unknown>";
|
|
91
91
|
try {
|
|
92
92
|
let n = t, r = 5, s = [], i = 0, o = 0, a = " > ", c = a.length, u, l = Array.isArray(e) ? e : e.keyAttrs, d = !Array.isArray(e) && e.maxStringLength || or;
|
|
@@ -104,19 +104,19 @@ function ar(t, e) {
|
|
|
104
104
|
if (u && u.length) u.forEach((d) => {
|
|
105
105
|
r.push(`[${d[0]}="${d[1]}"]`);
|
|
106
106
|
});
|
|
107
|
-
else if (n.id && r.push(`#${n.id}`), s = n.className, s &&
|
|
107
|
+
else if (n.id && r.push(`#${n.id}`), s = n.className, s && W(s)) for (i = s.split(/\s+/), c = 0; c < i.length; c++) r.push(`.${i[c]}`);
|
|
108
108
|
let l = ["aria-label", "type", "name", "title", "alt"];
|
|
109
109
|
for (c = 0; c < l.length; c++) o = l[c], a = n.getAttribute(o), a && r.push(`[${o}="${a}"]`);
|
|
110
110
|
return r.join("");
|
|
111
111
|
}
|
|
112
112
|
var cr = "Sentry Logger ";
|
|
113
|
-
var
|
|
114
|
-
var
|
|
115
|
-
function
|
|
113
|
+
var re = ["debug", "info", "warn", "error", "log", "assert", "trace"];
|
|
114
|
+
var z = {};
|
|
115
|
+
function Se(t) {
|
|
116
116
|
if (!("console" in h)) return t();
|
|
117
|
-
let e = h.console, n = {}, r = Object.keys(
|
|
117
|
+
let e = h.console, n = {}, r = Object.keys(z);
|
|
118
118
|
r.forEach((s) => {
|
|
119
|
-
let i =
|
|
119
|
+
let i = z[s];
|
|
120
120
|
n[s] = e[s], e[s] = i;
|
|
121
121
|
});
|
|
122
122
|
try {
|
|
@@ -133,13 +133,13 @@ function ur() {
|
|
|
133
133
|
}, disable: () => {
|
|
134
134
|
t = false;
|
|
135
135
|
}, isEnabled: () => t };
|
|
136
|
-
return typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__ ?
|
|
136
|
+
return typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__ ? re.forEach((n) => {
|
|
137
137
|
e[n] = (...r) => {
|
|
138
|
-
t &&
|
|
138
|
+
t && Se(() => {
|
|
139
139
|
h.console[n](`${cr}[${n}]:`, ...r);
|
|
140
140
|
});
|
|
141
141
|
};
|
|
142
|
-
}) :
|
|
142
|
+
}) : re.forEach((n) => {
|
|
143
143
|
e[n] = () => {
|
|
144
144
|
};
|
|
145
145
|
}), e;
|
|
@@ -149,11 +149,11 @@ var dr = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;
|
|
|
149
149
|
function lr(t) {
|
|
150
150
|
return t === "http" || t === "https";
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function U(t, e = false) {
|
|
153
153
|
let { host: n, path: r, pass: s, port: i, projectId: o, protocol: a, publicKey: c } = t;
|
|
154
154
|
return `${a}://${c}${e && s ? `:${s}` : ""}@${n}${i ? `:${i}` : ""}/${r && `${r}/`}${o}`;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function Wt(t) {
|
|
157
157
|
let e = dr.exec(t);
|
|
158
158
|
if (!e) {
|
|
159
159
|
console.error(`Invalid Sentry Dsn: ${t}`);
|
|
@@ -164,9 +164,9 @@ function jt(t) {
|
|
|
164
164
|
let d = u.match(/^\d+/);
|
|
165
165
|
d && (u = d[0]);
|
|
166
166
|
}
|
|
167
|
-
return
|
|
167
|
+
return zt({ host: i, pass: s, path: c, projectId: u, port: o, protocol: n, publicKey: r });
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function zt(t) {
|
|
170
170
|
return { protocol: t.protocol, publicKey: t.publicKey || "", pass: t.pass || "", host: t.host, port: t.port || "", path: t.path || "", projectId: t.projectId };
|
|
171
171
|
}
|
|
172
172
|
function fr(t) {
|
|
@@ -174,8 +174,8 @@ function fr(t) {
|
|
|
174
174
|
let { port: e, projectId: n, protocol: r } = t;
|
|
175
175
|
return ["protocol", "publicKey", "host", "projectId"].find((o) => t[o] ? false : (f.error(`Invalid Sentry Dsn: ${o} missing`), true)) ? false : n.match(/^\d+$/) ? lr(r) ? e && isNaN(parseInt(e, 10)) ? (f.error(`Invalid Sentry Dsn: Invalid port ${e}`), false) : true : (f.error(`Invalid Sentry Dsn: Invalid protocol ${r}`), false) : (f.error(`Invalid Sentry Dsn: Invalid projectId ${n}`), false);
|
|
176
176
|
}
|
|
177
|
-
function
|
|
178
|
-
let e = typeof t == "string" ?
|
|
177
|
+
function Te(t) {
|
|
178
|
+
let e = typeof t == "string" ? Wt(t) : zt(t);
|
|
179
179
|
if (!(!e || !fr(e))) return e;
|
|
180
180
|
}
|
|
181
181
|
var T = class extends Error {
|
|
@@ -183,69 +183,69 @@ var T = class extends Error {
|
|
|
183
183
|
super(e), this.message = e, this.name = new.target.prototype.constructor.name, Object.setPrototypeOf(this, new.target.prototype), this.logLevel = n;
|
|
184
184
|
}
|
|
185
185
|
};
|
|
186
|
-
function
|
|
186
|
+
function N(t, e, n) {
|
|
187
187
|
if (!(e in t)) return;
|
|
188
188
|
let r = t[e], s = n(r);
|
|
189
|
-
typeof s == "function" &&
|
|
189
|
+
typeof s == "function" && Kt(s, r), t[e] = s;
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function V(t, e, n) {
|
|
192
192
|
try {
|
|
193
193
|
Object.defineProperty(t, e, { value: n, writable: true, configurable: true });
|
|
194
194
|
} catch {
|
|
195
195
|
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(`Failed to add non-enumerable property "${e}" to object`, t);
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function Kt(t, e) {
|
|
199
199
|
try {
|
|
200
200
|
let n = e.prototype || {};
|
|
201
|
-
t.prototype = e.prototype = n,
|
|
201
|
+
t.prototype = e.prototype = n, V(t, "__sentry_original__", e);
|
|
202
202
|
} catch {
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function ot(t) {
|
|
206
206
|
return Object.keys(t).map((e) => `${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&");
|
|
207
207
|
}
|
|
208
|
-
function
|
|
209
|
-
if (L(t)) return { message: t.message, name: t.name, stack: t.stack, ...
|
|
210
|
-
if (
|
|
211
|
-
let e = { type: t.type, target:
|
|
212
|
-
return typeof CustomEvent < "u" &&
|
|
208
|
+
function be(t) {
|
|
209
|
+
if (L(t)) return { message: t.message, name: t.name, stack: t.stack, ...Jt(t) };
|
|
210
|
+
if (tt(t)) {
|
|
211
|
+
let e = { type: t.type, target: Vt(t.target), currentTarget: Vt(t.currentTarget), ...Jt(t) };
|
|
212
|
+
return typeof CustomEvent < "u" && k(t, CustomEvent) && (e.detail = t.detail), e;
|
|
213
213
|
} else return t;
|
|
214
214
|
}
|
|
215
|
-
function
|
|
215
|
+
function Vt(t) {
|
|
216
216
|
try {
|
|
217
|
-
return
|
|
217
|
+
return nt(t) ? qt(t) : Object.prototype.toString.call(t);
|
|
218
218
|
} catch {
|
|
219
219
|
return "<unknown>";
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function Jt(t) {
|
|
223
223
|
if (typeof t == "object" && t !== null) {
|
|
224
224
|
let e = {};
|
|
225
225
|
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
|
|
226
226
|
return e;
|
|
227
227
|
} else return {};
|
|
228
228
|
}
|
|
229
|
-
function
|
|
230
|
-
let n = Object.keys(
|
|
229
|
+
function se(t, e = 40) {
|
|
230
|
+
let n = Object.keys(be(t));
|
|
231
231
|
if (n.sort(), !n.length) return "[object has no keys]";
|
|
232
|
-
if (n[0].length >= e) return
|
|
232
|
+
if (n[0].length >= e) return M(n[0], e);
|
|
233
233
|
for (let r = n.length; r > 0; r--) {
|
|
234
234
|
let s = n.slice(0, r).join(", ");
|
|
235
|
-
if (!(s.length > e)) return r === n.length ? s :
|
|
235
|
+
if (!(s.length > e)) return r === n.length ? s : M(s, e);
|
|
236
236
|
}
|
|
237
237
|
return "";
|
|
238
238
|
}
|
|
239
239
|
function E(t) {
|
|
240
|
-
return
|
|
240
|
+
return it(t, /* @__PURE__ */ new Map());
|
|
241
241
|
}
|
|
242
|
-
function
|
|
243
|
-
if (
|
|
242
|
+
function it(t, e) {
|
|
243
|
+
if (I(t)) {
|
|
244
244
|
let n = e.get(t);
|
|
245
245
|
if (n !== void 0) return n;
|
|
246
246
|
let r = {};
|
|
247
247
|
e.set(t, r);
|
|
248
|
-
for (let s of Object.keys(t)) typeof t[s] < "u" && (r[s] =
|
|
248
|
+
for (let s of Object.keys(t)) typeof t[s] < "u" && (r[s] = it(t[s], e));
|
|
249
249
|
return r;
|
|
250
250
|
}
|
|
251
251
|
if (Array.isArray(t)) {
|
|
@@ -253,7 +253,7 @@ function st(t, e) {
|
|
|
253
253
|
if (n !== void 0) return n;
|
|
254
254
|
let r = [];
|
|
255
255
|
return e.set(t, r), t.forEach((s) => {
|
|
256
|
-
r.push(
|
|
256
|
+
r.push(it(s, e));
|
|
257
257
|
}), r;
|
|
258
258
|
}
|
|
259
259
|
return t;
|
|
@@ -261,7 +261,7 @@ function st(t, e) {
|
|
|
261
261
|
function pr(t, e = false) {
|
|
262
262
|
return !(e || t && !t.startsWith("/") && !t.includes(":\\") && !t.startsWith(".") && !t.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//)) && t !== void 0 && !t.includes("node_modules/");
|
|
263
263
|
}
|
|
264
|
-
function
|
|
264
|
+
function Xt(t) {
|
|
265
265
|
let e = /^\s*[-]{4,}$/, n = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
|
|
266
266
|
return (r) => {
|
|
267
267
|
let s = r.match(n);
|
|
@@ -284,10 +284,10 @@ function Jt(t) {
|
|
|
284
284
|
if (r.match(e)) return { filename: r };
|
|
285
285
|
};
|
|
286
286
|
}
|
|
287
|
-
var
|
|
288
|
-
var
|
|
289
|
-
var
|
|
290
|
-
function
|
|
287
|
+
var en = 50;
|
|
288
|
+
var Zt = /\(error: (.*)\)/;
|
|
289
|
+
var Qt = /captureMessage|captureException/;
|
|
290
|
+
function Re(...t) {
|
|
291
291
|
let e = t.sort((n, r) => n[0] - r[0]).map((n) => n[1]);
|
|
292
292
|
return (n, r = 0) => {
|
|
293
293
|
let s = [], i = n.split(`
|
|
@@ -295,7 +295,7 @@ function be(...t) {
|
|
|
295
295
|
for (let o = r; o < i.length; o++) {
|
|
296
296
|
let a = i[o];
|
|
297
297
|
if (a.length > 1024) continue;
|
|
298
|
-
let c =
|
|
298
|
+
let c = Zt.test(a) ? a.replace(Zt, "$1") : a;
|
|
299
299
|
if (!c.match(/\S*Error: /)) {
|
|
300
300
|
for (let u of e) {
|
|
301
301
|
let l = u(c);
|
|
@@ -304,74 +304,74 @@ function be(...t) {
|
|
|
304
304
|
break;
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
|
-
if (s.length >=
|
|
307
|
+
if (s.length >= en) break;
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
|
-
return
|
|
310
|
+
return tn(s);
|
|
311
311
|
};
|
|
312
312
|
}
|
|
313
|
-
function
|
|
314
|
-
return Array.isArray(t) ?
|
|
313
|
+
function ct(t) {
|
|
314
|
+
return Array.isArray(t) ? Re(...t) : t;
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function tn(t) {
|
|
317
317
|
if (!t.length) return [];
|
|
318
318
|
let e = Array.from(t);
|
|
319
|
-
return /sentryWrapped/.test(e[e.length - 1].function || "") && e.pop(), e.reverse(),
|
|
319
|
+
return /sentryWrapped/.test(e[e.length - 1].function || "") && e.pop(), e.reverse(), Qt.test(e[e.length - 1].function || "") && (e.pop(), Qt.test(e[e.length - 1].function || "") && e.pop()), e.slice(0, en).map((n) => ({ ...n, filename: n.filename || e[e.length - 1].filename, function: n.function || "?" }));
|
|
320
320
|
}
|
|
321
|
-
var
|
|
322
|
-
function
|
|
321
|
+
var at = "<anonymous>";
|
|
322
|
+
function ie(t) {
|
|
323
323
|
try {
|
|
324
|
-
return !t || typeof t != "function" ?
|
|
324
|
+
return !t || typeof t != "function" ? at : t.name || at;
|
|
325
325
|
} catch {
|
|
326
|
-
return
|
|
326
|
+
return at;
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
|
-
function
|
|
330
|
-
return [90,
|
|
329
|
+
function ut(t) {
|
|
330
|
+
return [90, Xt(t)];
|
|
331
331
|
}
|
|
332
|
-
var
|
|
332
|
+
var dt = A();
|
|
333
333
|
function mr() {
|
|
334
|
-
if (!("fetch" in
|
|
334
|
+
if (!("fetch" in dt)) return false;
|
|
335
335
|
try {
|
|
336
336
|
return new Headers(), new Request("http://www.example.com"), new Response(), true;
|
|
337
337
|
} catch {
|
|
338
338
|
return false;
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
|
-
function
|
|
341
|
+
function nn(t) {
|
|
342
342
|
return t && /^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString());
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function rn() {
|
|
345
345
|
if (!mr()) return false;
|
|
346
|
-
if (
|
|
347
|
-
let t = false, e =
|
|
346
|
+
if (nn(dt.fetch)) return true;
|
|
347
|
+
let t = false, e = dt.document;
|
|
348
348
|
if (e && typeof e.createElement == "function") try {
|
|
349
349
|
let n = e.createElement("iframe");
|
|
350
|
-
n.hidden = true, e.head.appendChild(n), n.contentWindow && n.contentWindow.fetch && (t =
|
|
350
|
+
n.hidden = true, e.head.appendChild(n), n.contentWindow && n.contentWindow.fetch && (t = nn(n.contentWindow.fetch)), e.head.removeChild(n);
|
|
351
351
|
} catch (n) {
|
|
352
352
|
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ", n);
|
|
353
353
|
}
|
|
354
354
|
return t;
|
|
355
355
|
}
|
|
356
|
-
var
|
|
357
|
-
function
|
|
358
|
-
let t =
|
|
356
|
+
var xe = A();
|
|
357
|
+
function sn() {
|
|
358
|
+
let t = xe.chrome, e = t && t.app && t.app.runtime, n = "history" in xe && !!xe.history.pushState && !!xe.history.replaceState;
|
|
359
359
|
return !e && n;
|
|
360
360
|
}
|
|
361
|
-
var y =
|
|
362
|
-
var
|
|
363
|
-
var
|
|
364
|
-
var
|
|
361
|
+
var y = A();
|
|
362
|
+
var oe = "__sentry_xhr_v2__";
|
|
363
|
+
var ae = {};
|
|
364
|
+
var on = {};
|
|
365
365
|
function hr(t) {
|
|
366
|
-
if (!
|
|
366
|
+
if (!on[t]) switch (on[t] = true, t) {
|
|
367
367
|
case "console":
|
|
368
368
|
_r();
|
|
369
369
|
break;
|
|
370
370
|
case "dom":
|
|
371
|
-
|
|
371
|
+
fn();
|
|
372
372
|
break;
|
|
373
373
|
case "xhr":
|
|
374
|
-
|
|
374
|
+
ln();
|
|
375
375
|
break;
|
|
376
376
|
case "fetch":
|
|
377
377
|
gr();
|
|
@@ -390,97 +390,97 @@ function hr(t) {
|
|
|
390
390
|
return;
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
|
-
function
|
|
394
|
-
|
|
393
|
+
function we(t, e) {
|
|
394
|
+
ae[t] = ae[t] || [], ae[t].push(e), hr(t);
|
|
395
395
|
}
|
|
396
|
-
function
|
|
397
|
-
if (!(!t || !
|
|
396
|
+
function D(t, e) {
|
|
397
|
+
if (!(!t || !ae[t])) for (let n of ae[t] || []) try {
|
|
398
398
|
n(e);
|
|
399
399
|
} catch (r) {
|
|
400
400
|
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.error(`Error while triggering instrumentation handler.
|
|
401
401
|
Type: ${t}
|
|
402
|
-
Name: ${
|
|
402
|
+
Name: ${ie(n)}
|
|
403
403
|
Error:`, r);
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
406
|
function _r() {
|
|
407
|
-
"console" in h &&
|
|
408
|
-
t in h.console &&
|
|
409
|
-
return
|
|
410
|
-
|
|
411
|
-
let r =
|
|
407
|
+
"console" in h && re.forEach(function(t) {
|
|
408
|
+
t in h.console && N(h.console, t, function(e) {
|
|
409
|
+
return z[t] = e, function(...n) {
|
|
410
|
+
D("console", { args: n, level: t });
|
|
411
|
+
let r = z[t];
|
|
412
412
|
r && r.apply(h.console, n);
|
|
413
413
|
};
|
|
414
414
|
});
|
|
415
415
|
});
|
|
416
416
|
}
|
|
417
417
|
function gr() {
|
|
418
|
-
|
|
418
|
+
rn() && N(h, "fetch", function(t) {
|
|
419
419
|
return function(...e) {
|
|
420
|
-
let { method: n, url: r } =
|
|
421
|
-
return
|
|
422
|
-
throw
|
|
420
|
+
let { method: n, url: r } = dn(e), s = { args: e, fetchData: { method: n, url: r }, startTimestamp: Date.now() };
|
|
421
|
+
return D("fetch", { ...s }), t.apply(h, e).then((i) => (D("fetch", { ...s, endTimestamp: Date.now(), response: i }), i), (i) => {
|
|
422
|
+
throw D("fetch", { ...s, endTimestamp: Date.now(), error: i }), i;
|
|
423
423
|
});
|
|
424
424
|
};
|
|
425
425
|
});
|
|
426
426
|
}
|
|
427
|
-
function
|
|
427
|
+
function lt(t, e) {
|
|
428
428
|
return !!t && typeof t == "object" && !!t[e];
|
|
429
429
|
}
|
|
430
|
-
function
|
|
431
|
-
return typeof t == "string" ? t : t ?
|
|
430
|
+
function an(t) {
|
|
431
|
+
return typeof t == "string" ? t : t ? lt(t, "url") ? t.url : t.toString ? t.toString() : "" : "";
|
|
432
432
|
}
|
|
433
|
-
function
|
|
433
|
+
function dn(t) {
|
|
434
434
|
if (t.length === 0) return { method: "GET", url: "" };
|
|
435
435
|
if (t.length === 2) {
|
|
436
436
|
let [n, r] = t;
|
|
437
|
-
return { url:
|
|
437
|
+
return { url: an(n), method: lt(r, "method") ? String(r.method).toUpperCase() : "GET" };
|
|
438
438
|
}
|
|
439
439
|
let e = t[0];
|
|
440
|
-
return { url:
|
|
440
|
+
return { url: an(e), method: lt(e, "method") ? String(e.method).toUpperCase() : "GET" };
|
|
441
441
|
}
|
|
442
|
-
function
|
|
442
|
+
function ln() {
|
|
443
443
|
if (!y.XMLHttpRequest) return;
|
|
444
444
|
let t = XMLHttpRequest.prototype;
|
|
445
|
-
|
|
445
|
+
N(t, "open", function(e) {
|
|
446
446
|
return function(...n) {
|
|
447
|
-
let r = Date.now(), s = n[1], i = this[
|
|
448
|
-
|
|
447
|
+
let r = Date.now(), s = n[1], i = this[oe] = { method: W(n[0]) ? n[0].toUpperCase() : n[0], url: n[1], request_headers: {} };
|
|
448
|
+
W(s) && i.method === "POST" && s.match(/sentry_key/) && (this.__sentry_own_request__ = true);
|
|
449
449
|
let o = () => {
|
|
450
|
-
let a = this[
|
|
450
|
+
let a = this[oe];
|
|
451
451
|
if (a && this.readyState === 4) {
|
|
452
452
|
try {
|
|
453
453
|
a.status_code = this.status;
|
|
454
454
|
} catch {
|
|
455
455
|
}
|
|
456
|
-
|
|
456
|
+
D("xhr", { args: n, endTimestamp: Date.now(), startTimestamp: r, xhr: this });
|
|
457
457
|
}
|
|
458
458
|
};
|
|
459
|
-
return "onreadystatechange" in this && typeof this.onreadystatechange == "function" ?
|
|
459
|
+
return "onreadystatechange" in this && typeof this.onreadystatechange == "function" ? N(this, "onreadystatechange", function(a) {
|
|
460
460
|
return function(...c) {
|
|
461
461
|
return o(), a.apply(this, c);
|
|
462
462
|
};
|
|
463
|
-
}) : this.addEventListener("readystatechange", o),
|
|
463
|
+
}) : this.addEventListener("readystatechange", o), N(this, "setRequestHeader", function(a) {
|
|
464
464
|
return function(...c) {
|
|
465
|
-
let [u, l] = c, d = this[
|
|
465
|
+
let [u, l] = c, d = this[oe];
|
|
466
466
|
return d && (d.request_headers[u.toLowerCase()] = l), a.apply(this, c);
|
|
467
467
|
};
|
|
468
468
|
}), e.apply(this, n);
|
|
469
469
|
};
|
|
470
|
-
}),
|
|
470
|
+
}), N(t, "send", function(e) {
|
|
471
471
|
return function(...n) {
|
|
472
|
-
let r = this[
|
|
473
|
-
return r && n[0] !== void 0 && (r.body = n[0]),
|
|
472
|
+
let r = this[oe];
|
|
473
|
+
return r && n[0] !== void 0 && (r.body = n[0]), D("xhr", { args: n, startTimestamp: Date.now(), xhr: this }), e.apply(this, n);
|
|
474
474
|
};
|
|
475
475
|
});
|
|
476
476
|
}
|
|
477
|
-
var
|
|
477
|
+
var Ie;
|
|
478
478
|
function Er() {
|
|
479
|
-
if (!
|
|
479
|
+
if (!sn()) return;
|
|
480
480
|
let t = y.onpopstate;
|
|
481
481
|
y.onpopstate = function(...n) {
|
|
482
|
-
let r = y.location.href, s =
|
|
483
|
-
if (
|
|
482
|
+
let r = y.location.href, s = Ie;
|
|
483
|
+
if (Ie = r, D("history", { from: s, to: r }), t) try {
|
|
484
484
|
return t.apply(this, n);
|
|
485
485
|
} catch {
|
|
486
486
|
}
|
|
@@ -489,17 +489,17 @@ function Er() {
|
|
|
489
489
|
return function(...r) {
|
|
490
490
|
let s = r.length > 2 ? r[2] : void 0;
|
|
491
491
|
if (s) {
|
|
492
|
-
let i =
|
|
493
|
-
|
|
492
|
+
let i = Ie, o = String(s);
|
|
493
|
+
Ie = o, D("history", { from: i, to: o });
|
|
494
494
|
}
|
|
495
495
|
return n.apply(this, r);
|
|
496
496
|
};
|
|
497
497
|
}
|
|
498
|
-
|
|
498
|
+
N(y.history, "pushState", e), N(y.history, "replaceState", e);
|
|
499
499
|
}
|
|
500
500
|
var yr = 1e3;
|
|
501
|
-
var
|
|
502
|
-
var
|
|
501
|
+
var cn;
|
|
502
|
+
var Ne;
|
|
503
503
|
function Sr(t, e) {
|
|
504
504
|
if (t.type !== e.type) return false;
|
|
505
505
|
try {
|
|
@@ -518,27 +518,27 @@ function Tr(t) {
|
|
|
518
518
|
}
|
|
519
519
|
return true;
|
|
520
520
|
}
|
|
521
|
-
function
|
|
521
|
+
function un(t, e = false) {
|
|
522
522
|
return (n) => {
|
|
523
523
|
if (!n || n._sentryCaptured || Tr(n)) return;
|
|
524
|
-
|
|
524
|
+
V(n, "_sentryCaptured", true);
|
|
525
525
|
let r = n.type === "keypress" ? "input" : n.type;
|
|
526
|
-
(
|
|
527
|
-
|
|
526
|
+
(Ne === void 0 || !Sr(Ne, n)) && (t({ event: n, name: r, global: e }), Ne = n), clearTimeout(cn), cn = y.setTimeout(() => {
|
|
527
|
+
Ne = void 0;
|
|
528
528
|
}, yr);
|
|
529
529
|
};
|
|
530
530
|
}
|
|
531
|
-
function
|
|
531
|
+
function fn() {
|
|
532
532
|
if (!y.document) return;
|
|
533
|
-
let t =
|
|
533
|
+
let t = D.bind(null, "dom"), e = un(t, true);
|
|
534
534
|
y.document.addEventListener("click", e, false), y.document.addEventListener("keypress", e, false), ["EventTarget", "Node"].forEach((n) => {
|
|
535
535
|
let r = y[n] && y[n].prototype;
|
|
536
|
-
!r || !r.hasOwnProperty || !r.hasOwnProperty("addEventListener") || (
|
|
536
|
+
!r || !r.hasOwnProperty || !r.hasOwnProperty("addEventListener") || (N(r, "addEventListener", function(s) {
|
|
537
537
|
return function(i, o, a) {
|
|
538
538
|
if (i === "click" || i == "keypress") try {
|
|
539
539
|
let c = this, u = c.__sentry_instrumentation_handlers__ = c.__sentry_instrumentation_handlers__ || {}, l = u[i] = u[i] || { refCount: 0 };
|
|
540
540
|
if (!l.handler) {
|
|
541
|
-
let d =
|
|
541
|
+
let d = un(t);
|
|
542
542
|
l.handler = d, s.call(this, i, d, a);
|
|
543
543
|
}
|
|
544
544
|
l.refCount++;
|
|
@@ -546,7 +546,7 @@ function dn() {
|
|
|
546
546
|
}
|
|
547
547
|
return s.call(this, i, o, a);
|
|
548
548
|
};
|
|
549
|
-
}),
|
|
549
|
+
}), N(r, "removeEventListener", function(s) {
|
|
550
550
|
return function(i, o, a) {
|
|
551
551
|
if (i === "click" || i == "keypress") try {
|
|
552
552
|
let c = this, u = c.__sentry_instrumentation_handlers__ || {}, l = u[i];
|
|
@@ -558,28 +558,28 @@ function dn() {
|
|
|
558
558
|
}));
|
|
559
559
|
});
|
|
560
560
|
}
|
|
561
|
-
var
|
|
561
|
+
var Ae = null;
|
|
562
562
|
function br() {
|
|
563
|
-
|
|
564
|
-
return
|
|
563
|
+
Ae = y.onerror, y.onerror = function(t, e, n, r, s) {
|
|
564
|
+
return D("error", { column: r, error: s, line: n, msg: t, url: e }), Ae && !Ae.__SENTRY_LOADER__ ? Ae.apply(this, arguments) : false;
|
|
565
565
|
}, y.onerror.__SENTRY_INSTRUMENTED__ = true;
|
|
566
566
|
}
|
|
567
|
-
var
|
|
567
|
+
var De = null;
|
|
568
568
|
function Rr() {
|
|
569
|
-
|
|
570
|
-
return
|
|
569
|
+
De = y.onunhandledrejection, y.onunhandledrejection = function(t) {
|
|
570
|
+
return D("unhandledrejection", t), De && !De.__SENTRY_LOADER__ ? De.apply(this, arguments) : true;
|
|
571
571
|
}, y.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;
|
|
572
572
|
}
|
|
573
|
-
function
|
|
573
|
+
function pn() {
|
|
574
574
|
return typeof __SENTRY_BROWSER_BUNDLE__ < "u" && !!__SENTRY_BROWSER_BUNDLE__;
|
|
575
575
|
}
|
|
576
|
-
function
|
|
577
|
-
return !
|
|
576
|
+
function mn() {
|
|
577
|
+
return !pn() && Object.prototype.toString.call(typeof process < "u" ? process : 0) === "[object process]";
|
|
578
578
|
}
|
|
579
|
-
function
|
|
579
|
+
function hn(t, e) {
|
|
580
580
|
return t.require(e);
|
|
581
581
|
}
|
|
582
|
-
function
|
|
582
|
+
function _n() {
|
|
583
583
|
let t = typeof WeakSet == "function", e = t ? /* @__PURE__ */ new WeakSet() : [];
|
|
584
584
|
function n(s) {
|
|
585
585
|
if (t) return e.has(s) ? true : (e.add(s), false);
|
|
@@ -607,11 +607,11 @@ function g() {
|
|
|
607
607
|
function xr(t) {
|
|
608
608
|
return t.exception && t.exception.values ? t.exception.values[0] : void 0;
|
|
609
609
|
}
|
|
610
|
-
function
|
|
610
|
+
function ce(t, e, n) {
|
|
611
611
|
let r = t.exception = t.exception || {}, s = r.values = r.values || [], i = s[0] = s[0] || {};
|
|
612
612
|
i.value || (i.value = e || ""), i.type || (i.type = n || "Error");
|
|
613
613
|
}
|
|
614
|
-
function
|
|
614
|
+
function ue(t, e) {
|
|
615
615
|
let n = xr(t);
|
|
616
616
|
if (!n) return;
|
|
617
617
|
let r = { type: "generic", handled: true }, s = n.mechanism;
|
|
@@ -620,31 +620,31 @@ function ce(t, e) {
|
|
|
620
620
|
n.mechanism.data = i;
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
|
-
function
|
|
623
|
+
function Oe(t) {
|
|
624
624
|
if (t && t.__sentry_captured__) return true;
|
|
625
625
|
try {
|
|
626
|
-
|
|
626
|
+
V(t, "__sentry_captured__", true);
|
|
627
627
|
} catch {
|
|
628
628
|
}
|
|
629
629
|
return false;
|
|
630
630
|
}
|
|
631
|
-
function
|
|
631
|
+
function de(t) {
|
|
632
632
|
return Array.isArray(t) ? t : [t];
|
|
633
633
|
}
|
|
634
|
-
function
|
|
634
|
+
function w(t, e = 100, n = 1 / 0) {
|
|
635
635
|
try {
|
|
636
|
-
return
|
|
636
|
+
return ve("", t, e, n);
|
|
637
637
|
} catch (r) {
|
|
638
638
|
return { ERROR: `**non-serializable** (${r})` };
|
|
639
639
|
}
|
|
640
640
|
}
|
|
641
|
-
function
|
|
642
|
-
let r =
|
|
643
|
-
return Dr(r) > n ?
|
|
641
|
+
function J(t, e = 3, n = 100 * 1024) {
|
|
642
|
+
let r = w(t, e);
|
|
643
|
+
return Dr(r) > n ? J(t, e - 1, n) : r;
|
|
644
644
|
}
|
|
645
|
-
function
|
|
645
|
+
function ve(t, e, n = 1 / 0, r = 1 / 0, s = _n()) {
|
|
646
646
|
let [i, o] = s;
|
|
647
|
-
if (e == null || ["number", "boolean", "string"].includes(typeof e) && !
|
|
647
|
+
if (e == null || ["number", "boolean", "string"].includes(typeof e) && !te(e)) return e;
|
|
648
648
|
let a = Ir(t, e);
|
|
649
649
|
if (!a.startsWith("[object ")) return a;
|
|
650
650
|
if (e.__sentry_skip_normalization__) return e;
|
|
@@ -654,18 +654,18 @@ function Oe(t, e, n = 1 / 0, r = 1 / 0, s = mn()) {
|
|
|
654
654
|
let u = e;
|
|
655
655
|
if (u && typeof u.toJSON == "function") try {
|
|
656
656
|
let m = u.toJSON();
|
|
657
|
-
return
|
|
657
|
+
return ve("", m, c - 1, r, s);
|
|
658
658
|
} catch {
|
|
659
659
|
}
|
|
660
|
-
let l = Array.isArray(e) ? [] : {}, d = 0, p =
|
|
660
|
+
let l = Array.isArray(e) ? [] : {}, d = 0, p = be(e);
|
|
661
661
|
for (let m in p) {
|
|
662
662
|
if (!Object.prototype.hasOwnProperty.call(p, m)) continue;
|
|
663
663
|
if (d >= r) {
|
|
664
664
|
l[m] = "[MaxProperties ~]";
|
|
665
665
|
break;
|
|
666
666
|
}
|
|
667
|
-
let
|
|
668
|
-
l[m] =
|
|
667
|
+
let v = p[m];
|
|
668
|
+
l[m] = ve(m, v, c - 1, r, s), d++;
|
|
669
669
|
}
|
|
670
670
|
return o(e), l;
|
|
671
671
|
}
|
|
@@ -676,10 +676,10 @@ function Ir(t, e) {
|
|
|
676
676
|
if (typeof global < "u" && e === global) return "[Global]";
|
|
677
677
|
if (typeof window < "u" && e === window) return "[Window]";
|
|
678
678
|
if (typeof document < "u" && e === document) return "[Document]";
|
|
679
|
-
if (
|
|
680
|
-
if (
|
|
679
|
+
if (st(e)) return "[VueViewModel]";
|
|
680
|
+
if (rt(e)) return "[SyntheticEvent]";
|
|
681
681
|
if (typeof e == "number" && e !== e) return "[NaN]";
|
|
682
|
-
if (typeof e == "function") return `[Function: ${
|
|
682
|
+
if (typeof e == "function") return `[Function: ${ie(e)}]`;
|
|
683
683
|
if (typeof e == "symbol") return `[${String(e)}]`;
|
|
684
684
|
if (typeof e == "bigint") return `[BigInt: ${String(e)}]`;
|
|
685
685
|
let n = Nr(e);
|
|
@@ -703,18 +703,18 @@ function Or(t) {
|
|
|
703
703
|
let e = t.length > 1024 ? `<truncated>${t.slice(-1024)}` : t, n = wr.exec(e);
|
|
704
704
|
return n ? n.slice(1) : [];
|
|
705
705
|
}
|
|
706
|
-
function
|
|
706
|
+
function ft(t, e) {
|
|
707
707
|
let n = Or(t)[2];
|
|
708
708
|
return e && n.slice(e.length * -1) === e && (n = n.slice(0, n.length - e.length)), n;
|
|
709
709
|
}
|
|
710
|
-
var
|
|
710
|
+
var C;
|
|
711
711
|
(function(t) {
|
|
712
712
|
t[t.PENDING = 0] = "PENDING";
|
|
713
713
|
let n = 1;
|
|
714
714
|
t[t.RESOLVED = n] = "RESOLVED";
|
|
715
715
|
let r = 2;
|
|
716
716
|
t[t.REJECTED = r] = "REJECTED";
|
|
717
|
-
})(
|
|
717
|
+
})(C || (C = {}));
|
|
718
718
|
function b(t) {
|
|
719
719
|
return new S((e) => {
|
|
720
720
|
e(t);
|
|
@@ -727,7 +727,7 @@ function F(t) {
|
|
|
727
727
|
}
|
|
728
728
|
var S = class {
|
|
729
729
|
constructor(e) {
|
|
730
|
-
S.prototype.__init.call(this), S.prototype.__init2.call(this), S.prototype.__init3.call(this), S.prototype.__init4.call(this), this._state =
|
|
730
|
+
S.prototype.__init.call(this), S.prototype.__init2.call(this), S.prototype.__init3.call(this), S.prototype.__init4.call(this), this._state = C.PENDING, this._handlers = [];
|
|
731
731
|
try {
|
|
732
732
|
e(this._resolve, this._reject);
|
|
733
733
|
} catch (n) {
|
|
@@ -774,17 +774,17 @@ var S = class {
|
|
|
774
774
|
}
|
|
775
775
|
__init() {
|
|
776
776
|
this._resolve = (e) => {
|
|
777
|
-
this._setResult(
|
|
777
|
+
this._setResult(C.RESOLVED, e);
|
|
778
778
|
};
|
|
779
779
|
}
|
|
780
780
|
__init2() {
|
|
781
781
|
this._reject = (e) => {
|
|
782
|
-
this._setResult(
|
|
782
|
+
this._setResult(C.REJECTED, e);
|
|
783
783
|
};
|
|
784
784
|
}
|
|
785
785
|
__init3() {
|
|
786
786
|
this._setResult = (e, n) => {
|
|
787
|
-
if (this._state ===
|
|
787
|
+
if (this._state === C.PENDING) {
|
|
788
788
|
if (B(n)) {
|
|
789
789
|
n.then(this._resolve, this._reject);
|
|
790
790
|
return;
|
|
@@ -795,15 +795,15 @@ var S = class {
|
|
|
795
795
|
}
|
|
796
796
|
__init4() {
|
|
797
797
|
this._executeHandlers = () => {
|
|
798
|
-
if (this._state ===
|
|
798
|
+
if (this._state === C.PENDING) return;
|
|
799
799
|
let e = this._handlers.slice();
|
|
800
800
|
this._handlers = [], e.forEach((n) => {
|
|
801
|
-
n[0] || (this._state ===
|
|
801
|
+
n[0] || (this._state === C.RESOLVED && n[1](this._value), this._state === C.REJECTED && n[2](this._value), n[0] = true);
|
|
802
802
|
});
|
|
803
803
|
};
|
|
804
804
|
}
|
|
805
805
|
};
|
|
806
|
-
function
|
|
806
|
+
function pt(t) {
|
|
807
807
|
let e = [];
|
|
808
808
|
function n() {
|
|
809
809
|
return t === void 0 || e.length < t;
|
|
@@ -833,48 +833,48 @@ function ft(t) {
|
|
|
833
833
|
}
|
|
834
834
|
return { $: e, add: s, drain: i };
|
|
835
835
|
}
|
|
836
|
-
var
|
|
837
|
-
var
|
|
836
|
+
var En = A();
|
|
837
|
+
var ht = { nowSeconds: () => Date.now() / 1e3 };
|
|
838
838
|
function vr() {
|
|
839
|
-
let { performance: t } =
|
|
839
|
+
let { performance: t } = En;
|
|
840
840
|
if (!t || !t.now) return;
|
|
841
841
|
let e = Date.now() - t.now();
|
|
842
842
|
return { now: () => t.now(), timeOrigin: e };
|
|
843
843
|
}
|
|
844
844
|
function kr() {
|
|
845
845
|
try {
|
|
846
|
-
return
|
|
846
|
+
return hn(module, "perf_hooks").performance;
|
|
847
847
|
} catch {
|
|
848
848
|
return;
|
|
849
849
|
}
|
|
850
850
|
}
|
|
851
|
-
var
|
|
852
|
-
var
|
|
853
|
-
var $ =
|
|
854
|
-
var
|
|
855
|
-
var
|
|
851
|
+
var mt = mn() ? kr() : vr();
|
|
852
|
+
var gn = mt === void 0 ? ht : { nowSeconds: () => (mt.timeOrigin + mt.now()) / 1e3 };
|
|
853
|
+
var $ = ht.nowSeconds.bind(ht);
|
|
854
|
+
var H = gn.nowSeconds.bind(gn);
|
|
855
|
+
var le;
|
|
856
856
|
var Cr = (() => {
|
|
857
|
-
let { performance: t } =
|
|
857
|
+
let { performance: t } = En;
|
|
858
858
|
if (!t || !t.now) {
|
|
859
|
-
|
|
859
|
+
le = "none";
|
|
860
860
|
return;
|
|
861
861
|
}
|
|
862
862
|
let e = 3600 * 1e3, n = t.now(), r = Date.now(), s = t.timeOrigin ? Math.abs(t.timeOrigin + n - r) : e, i = s < e, o = t.timing && t.timing.navigationStart, c = typeof o == "number" ? Math.abs(o + n - r) : e, u = c < e;
|
|
863
|
-
return i || u ? s <= c ? (
|
|
863
|
+
return i || u ? s <= c ? (le = "timeOrigin", t.timeOrigin) : (le = "navigationStart", o) : (le = "dateNow", r);
|
|
864
864
|
})();
|
|
865
865
|
var Pr = new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");
|
|
866
|
-
function
|
|
866
|
+
function _t(t = g(), e = g().substring(16), n) {
|
|
867
867
|
let r = "";
|
|
868
868
|
return n !== void 0 && (r = n ? "-1" : "-0"), `${t}-${e}${r}`;
|
|
869
869
|
}
|
|
870
|
-
function
|
|
870
|
+
function G(t, e = []) {
|
|
871
871
|
return [t, e];
|
|
872
872
|
}
|
|
873
|
-
function
|
|
873
|
+
function Et(t, e) {
|
|
874
874
|
let [n, r] = t;
|
|
875
875
|
return [n, [...r, e]];
|
|
876
876
|
}
|
|
877
|
-
function
|
|
877
|
+
function ke(t, e) {
|
|
878
878
|
let n = t[1];
|
|
879
879
|
for (let r of n) {
|
|
880
880
|
let s = r[0].type;
|
|
@@ -882,13 +882,13 @@ function ve(t, e) {
|
|
|
882
882
|
}
|
|
883
883
|
return false;
|
|
884
884
|
}
|
|
885
|
-
function
|
|
885
|
+
function gt(t, e) {
|
|
886
886
|
return (e || new TextEncoder()).encode(t);
|
|
887
887
|
}
|
|
888
|
-
function
|
|
888
|
+
function yt(t, e) {
|
|
889
889
|
let [n, r] = t, s = JSON.stringify(n);
|
|
890
890
|
function i(o) {
|
|
891
|
-
typeof s == "string" ? s = typeof o == "string" ? s + o : [
|
|
891
|
+
typeof s == "string" ? s = typeof o == "string" ? s + o : [gt(s, e), o] : s.push(typeof o == "string" ? gt(o, e) : o);
|
|
892
892
|
}
|
|
893
893
|
for (let o of r) {
|
|
894
894
|
let [a, c] = o;
|
|
@@ -900,7 +900,7 @@ ${JSON.stringify(a)}
|
|
|
900
900
|
try {
|
|
901
901
|
u = JSON.stringify(c);
|
|
902
902
|
} catch {
|
|
903
|
-
u = JSON.stringify(
|
|
903
|
+
u = JSON.stringify(w(c));
|
|
904
904
|
}
|
|
905
905
|
i(u);
|
|
906
906
|
}
|
|
@@ -912,105 +912,105 @@ function Mr(t) {
|
|
|
912
912
|
for (let s of t) n.set(s, r), r += s.length;
|
|
913
913
|
return n;
|
|
914
914
|
}
|
|
915
|
-
function
|
|
916
|
-
let n = typeof t.data == "string" ?
|
|
915
|
+
function St(t, e) {
|
|
916
|
+
let n = typeof t.data == "string" ? gt(t.data, e) : t.data;
|
|
917
917
|
return [E({ type: "attachment", length: n.length, filename: t.filename, content_type: t.contentType, attachment_type: t.attachmentType }), n];
|
|
918
918
|
}
|
|
919
919
|
var Ur = { session: "session", sessions: "session", attachment: "attachment", transaction: "transaction", event: "error", client_report: "internal", user_report: "default", profile: "profile", replay_event: "replay", replay_recording: "replay", check_in: "monitor", statsd: "unknown" };
|
|
920
|
-
function
|
|
920
|
+
function Ce(t) {
|
|
921
921
|
return Ur[t];
|
|
922
922
|
}
|
|
923
|
-
function
|
|
923
|
+
function Pe(t) {
|
|
924
924
|
if (!t || !t.sdk) return;
|
|
925
925
|
let { name: e, version: n } = t.sdk;
|
|
926
926
|
return { name: e, version: n };
|
|
927
927
|
}
|
|
928
|
-
function
|
|
928
|
+
function Tt(t, e, n, r) {
|
|
929
929
|
let s = t.sdkProcessingMetadata && t.sdkProcessingMetadata.dynamicSamplingContext;
|
|
930
|
-
return { event_id: t.event_id, sent_at: (/* @__PURE__ */ new Date()).toISOString(), ...e && { sdk: e }, ...!!n && r && { dsn:
|
|
930
|
+
return { event_id: t.event_id, sent_at: (/* @__PURE__ */ new Date()).toISOString(), ...e && { sdk: e }, ...!!n && r && { dsn: U(r) }, ...s && { trace: E({ ...s }) } };
|
|
931
931
|
}
|
|
932
|
-
function
|
|
932
|
+
function yn(t, e = Date.now()) {
|
|
933
933
|
let n = parseInt(`${t}`, 10);
|
|
934
934
|
if (!isNaN(n)) return n * 1e3;
|
|
935
935
|
let r = Date.parse(`${t}`);
|
|
936
936
|
return isNaN(r) ? 6e4 : r - e;
|
|
937
937
|
}
|
|
938
|
-
function
|
|
938
|
+
function Sn(t, e) {
|
|
939
939
|
return t[e] || t.all || 0;
|
|
940
940
|
}
|
|
941
|
-
function
|
|
942
|
-
return
|
|
941
|
+
function bt(t, e, n = Date.now()) {
|
|
942
|
+
return Sn(t, e) > n;
|
|
943
943
|
}
|
|
944
|
-
function
|
|
944
|
+
function Rt(t, { statusCode: e, headers: n }, r = Date.now()) {
|
|
945
945
|
let s = { ...t }, i = n && n["x-sentry-rate-limits"], o = n && n["retry-after"];
|
|
946
946
|
if (i) for (let a of i.trim().split(",")) {
|
|
947
947
|
let [c, u] = a.split(":", 2), l = parseInt(c, 10), d = (isNaN(l) ? 60 : l) * 1e3;
|
|
948
948
|
if (!u) s.all = r + d;
|
|
949
949
|
else for (let p of u.split(";")) s[p] = r + d;
|
|
950
950
|
}
|
|
951
|
-
else o ? s.all = r +
|
|
951
|
+
else o ? s.all = r + yn(o, r) : e === 429 && (s.all = r + 60 * 1e3);
|
|
952
952
|
return s;
|
|
953
953
|
}
|
|
954
|
-
function
|
|
954
|
+
function xt(t, e) {
|
|
955
955
|
return t(e.stack || "", 1);
|
|
956
956
|
}
|
|
957
|
-
function
|
|
958
|
-
let n = { type: e.name || e.constructor.name, value: e.message }, r =
|
|
957
|
+
function Tn(t, e) {
|
|
958
|
+
let n = { type: e.name || e.constructor.name, value: e.message }, r = xt(t, e);
|
|
959
959
|
return r.length && (n.stacktrace = { frames: r }), n;
|
|
960
960
|
}
|
|
961
|
-
function
|
|
961
|
+
function Gr(t) {
|
|
962
962
|
if ("name" in t && typeof t.name == "string") {
|
|
963
963
|
let e = `'${t.name}' captured as exception`;
|
|
964
964
|
return "message" in t && typeof t.message == "string" && (e += ` with message '${t.message}'`), e;
|
|
965
|
-
} else return "message" in t && typeof t.message == "string" ? t.message : `Object captured as exception with keys: ${
|
|
965
|
+
} else return "message" in t && typeof t.message == "string" ? t.message : `Object captured as exception with keys: ${se(t)}`;
|
|
966
966
|
}
|
|
967
|
-
function
|
|
967
|
+
function It(t, e, n, r) {
|
|
968
968
|
let s = n, o = r && r.data && r.data.mechanism || { handled: true, type: "generic" };
|
|
969
969
|
if (!L(n)) {
|
|
970
|
-
if (
|
|
970
|
+
if (I(n)) {
|
|
971
971
|
let c = t(), u = c.getClient(), l = u && u.getOptions().normalizeDepth;
|
|
972
972
|
c.configureScope((p) => {
|
|
973
|
-
p.setExtra("__serialized__",
|
|
973
|
+
p.setExtra("__serialized__", J(n, l));
|
|
974
974
|
});
|
|
975
|
-
let d =
|
|
975
|
+
let d = Gr(n);
|
|
976
976
|
s = r && r.syntheticException || new Error(d), s.message = d;
|
|
977
977
|
} else s = r && r.syntheticException || new Error(n), s.message = n;
|
|
978
978
|
o.synthetic = true;
|
|
979
979
|
}
|
|
980
|
-
let a = { exception: { values: [
|
|
981
|
-
return
|
|
980
|
+
let a = { exception: { values: [Tn(e, s)] } };
|
|
981
|
+
return ce(a, void 0, void 0), ue(a, o), { ...a, event_id: r && r.event_id };
|
|
982
982
|
}
|
|
983
|
-
function
|
|
983
|
+
function Nt(t, e, n = "info", r, s) {
|
|
984
984
|
let i = { event_id: r && r.event_id, level: n, message: e };
|
|
985
985
|
if (s && r && r.syntheticException) {
|
|
986
|
-
let o =
|
|
986
|
+
let o = xt(t, r.syntheticException);
|
|
987
987
|
o.length && (i.exception = { values: [{ value: e, stacktrace: { frames: o } }] });
|
|
988
988
|
}
|
|
989
989
|
return i;
|
|
990
990
|
}
|
|
991
|
-
var
|
|
992
|
-
function
|
|
993
|
-
return
|
|
991
|
+
var K = "production";
|
|
992
|
+
function fe() {
|
|
993
|
+
return ne("globalEventProcessors", () => []);
|
|
994
994
|
}
|
|
995
|
-
function
|
|
996
|
-
|
|
995
|
+
function bn(t) {
|
|
996
|
+
fe().push(t);
|
|
997
997
|
}
|
|
998
|
-
function
|
|
998
|
+
function X(t, e, n, r = 0) {
|
|
999
999
|
return new S((s, i) => {
|
|
1000
1000
|
let o = t[r];
|
|
1001
1001
|
if (e === null || typeof o != "function") s(e);
|
|
1002
1002
|
else {
|
|
1003
1003
|
let a = o({ ...e }, n);
|
|
1004
|
-
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && o.id && a === null && f.log(`Event processor "${o.id}" dropped event`), B(a) ? a.then((c) =>
|
|
1004
|
+
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && o.id && a === null && f.log(`Event processor "${o.id}" dropped event`), B(a) ? a.then((c) => X(t, c, n, r + 1).then(s)).then(null, i) : X(t, a, n, r + 1).then(s).then(null, i);
|
|
1005
1005
|
}
|
|
1006
1006
|
});
|
|
1007
1007
|
}
|
|
1008
|
-
function
|
|
1009
|
-
let e =
|
|
1010
|
-
return t &&
|
|
1008
|
+
function Rn(t) {
|
|
1009
|
+
let e = H(), n = { sid: g(), init: true, timestamp: e, started: e, duration: 0, status: "ok", errors: 0, ignoreDuration: false, toJSON: () => Lr(n) };
|
|
1010
|
+
return t && P(n, t), n;
|
|
1011
1011
|
}
|
|
1012
|
-
function
|
|
1013
|
-
if (e.user && (!t.ipAddress && e.user.ip_address && (t.ipAddress = e.user.ip_address), !t.did && !e.did && (t.did = e.user.id || e.user.email || e.user.username)), t.timestamp = e.timestamp ||
|
|
1012
|
+
function P(t, e = {}) {
|
|
1013
|
+
if (e.user && (!t.ipAddress && e.user.ip_address && (t.ipAddress = e.user.ip_address), !t.did && !e.did && (t.did = e.user.id || e.user.email || e.user.username)), t.timestamp = e.timestamp || H(), e.abnormal_mechanism && (t.abnormal_mechanism = e.abnormal_mechanism), e.ignoreDuration && (t.ignoreDuration = e.ignoreDuration), e.sid && (t.sid = e.sid.length === 32 ? e.sid : g()), e.init !== void 0 && (t.init = e.init), !t.did && e.did && (t.did = `${e.did}`), typeof e.started == "number" && (t.started = e.started), t.ignoreDuration) t.duration = void 0;
|
|
1014
1014
|
else if (typeof e.duration == "number") t.duration = e.duration;
|
|
1015
1015
|
else {
|
|
1016
1016
|
let n = t.timestamp - t.started;
|
|
@@ -1018,20 +1018,20 @@ function C(t, e = {}) {
|
|
|
1018
1018
|
}
|
|
1019
1019
|
e.release && (t.release = e.release), e.environment && (t.environment = e.environment), !t.ipAddress && e.ipAddress && (t.ipAddress = e.ipAddress), !t.userAgent && e.userAgent && (t.userAgent = e.userAgent), typeof e.errors == "number" && (t.errors = e.errors), e.status && (t.status = e.status);
|
|
1020
1020
|
}
|
|
1021
|
-
function
|
|
1021
|
+
function xn(t, e) {
|
|
1022
1022
|
let n = {};
|
|
1023
|
-
e ? n = { status: e } : t.status === "ok" && (n = { status: "exited" }),
|
|
1023
|
+
e ? n = { status: e } : t.status === "ok" && (n = { status: "exited" }), P(t, n);
|
|
1024
1024
|
}
|
|
1025
|
-
function
|
|
1025
|
+
function Lr(t) {
|
|
1026
1026
|
return E({ sid: `${t.sid}`, init: t.init, started: new Date(t.started * 1e3).toISOString(), timestamp: new Date(t.timestamp * 1e3).toISOString(), status: t.status, errors: t.errors, did: typeof t.did == "number" || typeof t.did == "string" ? `${t.did}` : void 0, duration: t.duration, abnormal_mechanism: t.abnormal_mechanism, attrs: { release: t.release, environment: t.environment, ip_address: t.ipAddress, user_agent: t.userAgent } });
|
|
1027
1027
|
}
|
|
1028
|
-
var
|
|
1029
|
-
var
|
|
1028
|
+
var Br = 100;
|
|
1029
|
+
var O = class {
|
|
1030
1030
|
constructor() {
|
|
1031
|
-
this._notifyingListeners = false, this._scopeListeners = [], this._eventProcessors = [], this._breadcrumbs = [], this._attachments = [], this._user = {}, this._tags = {}, this._extra = {}, this._contexts = {}, this._sdkProcessingMetadata = {}, this._propagationContext =
|
|
1031
|
+
this._notifyingListeners = false, this._scopeListeners = [], this._eventProcessors = [], this._breadcrumbs = [], this._attachments = [], this._user = {}, this._tags = {}, this._extra = {}, this._contexts = {}, this._sdkProcessingMetadata = {}, this._propagationContext = In();
|
|
1032
1032
|
}
|
|
1033
1033
|
static clone(e) {
|
|
1034
|
-
let n = new
|
|
1034
|
+
let n = new O();
|
|
1035
1035
|
return e && (n._breadcrumbs = [...e._breadcrumbs], n._tags = { ...e._tags }, n._extra = { ...e._extra }, n._contexts = { ...e._contexts }, n._user = e._user, n._level = e._level, n._span = e._span, n._session = e._session, n._transactionName = e._transactionName, n._fingerprint = e._fingerprint, n._eventProcessors = [...e._eventProcessors], n._requestSession = e._requestSession, n._attachments = [...e._attachments], n._sdkProcessingMetadata = { ...e._sdkProcessingMetadata }, n._propagationContext = { ...e._propagationContext }), n;
|
|
1036
1036
|
}
|
|
1037
1037
|
addScopeListener(e) {
|
|
@@ -1041,7 +1041,7 @@ var w = class {
|
|
|
1041
1041
|
return this._eventProcessors.push(e), this;
|
|
1042
1042
|
}
|
|
1043
1043
|
setUser(e) {
|
|
1044
|
-
return this._user = e || {}, this._session &&
|
|
1044
|
+
return this._user = e || {}, this._session && P(this._session, { user: e }), this._notifyScopeListeners(), this;
|
|
1045
1045
|
}
|
|
1046
1046
|
getUser() {
|
|
1047
1047
|
return this._user;
|
|
@@ -1096,15 +1096,15 @@ var w = class {
|
|
|
1096
1096
|
if (!e) return this;
|
|
1097
1097
|
if (typeof e == "function") {
|
|
1098
1098
|
let n = e(this);
|
|
1099
|
-
return n instanceof
|
|
1099
|
+
return n instanceof O ? n : this;
|
|
1100
1100
|
}
|
|
1101
|
-
return e instanceof
|
|
1101
|
+
return e instanceof O ? (this._tags = { ...this._tags, ...e._tags }, this._extra = { ...this._extra, ...e._extra }, this._contexts = { ...this._contexts, ...e._contexts }, e._user && Object.keys(e._user).length && (this._user = e._user), e._level && (this._level = e._level), e._fingerprint && (this._fingerprint = e._fingerprint), e._requestSession && (this._requestSession = e._requestSession), e._propagationContext && (this._propagationContext = e._propagationContext)) : I(e) && (e = e, this._tags = { ...this._tags, ...e.tags }, this._extra = { ...this._extra, ...e.extra }, this._contexts = { ...this._contexts, ...e.contexts }, e.user && (this._user = e.user), e.level && (this._level = e.level), e.fingerprint && (this._fingerprint = e.fingerprint), e.requestSession && (this._requestSession = e.requestSession), e.propagationContext && (this._propagationContext = e.propagationContext)), this;
|
|
1102
1102
|
}
|
|
1103
1103
|
clear() {
|
|
1104
|
-
return this._breadcrumbs = [], this._tags = {}, this._extra = {}, this._user = {}, this._contexts = {}, this._level = void 0, this._transactionName = void 0, this._fingerprint = void 0, this._requestSession = void 0, this._span = void 0, this._session = void 0, this._notifyScopeListeners(), this._attachments = [], this._propagationContext =
|
|
1104
|
+
return this._breadcrumbs = [], this._tags = {}, this._extra = {}, this._user = {}, this._contexts = {}, this._level = void 0, this._transactionName = void 0, this._fingerprint = void 0, this._requestSession = void 0, this._span = void 0, this._session = void 0, this._notifyScopeListeners(), this._attachments = [], this._propagationContext = In(), this;
|
|
1105
1105
|
}
|
|
1106
1106
|
addBreadcrumb(e, n) {
|
|
1107
|
-
let r = typeof n == "number" ? n :
|
|
1107
|
+
let r = typeof n == "number" ? n : Br;
|
|
1108
1108
|
if (r <= 0) return this;
|
|
1109
1109
|
let s = { timestamp: $(), ...e }, i = this._breadcrumbs;
|
|
1110
1110
|
return i.push(s), this._breadcrumbs = i.length > r ? i.slice(-r) : i, this._notifyScopeListeners(), this;
|
|
@@ -1136,7 +1136,7 @@ var w = class {
|
|
|
1136
1136
|
}
|
|
1137
1137
|
this._applyFingerprint(e);
|
|
1138
1138
|
let s = this._getBreadcrumbs(), i = [...e.breadcrumbs || [], ...s];
|
|
1139
|
-
return e.breadcrumbs = i.length > 0 ? i : void 0, e.sdkProcessingMetadata = { ...e.sdkProcessingMetadata, ...this._sdkProcessingMetadata, propagationContext: this._propagationContext },
|
|
1139
|
+
return e.breadcrumbs = i.length > 0 ? i : void 0, e.sdkProcessingMetadata = { ...e.sdkProcessingMetadata, ...this._sdkProcessingMetadata, propagationContext: this._propagationContext }, X([...r || [], ...fe(), ...this._eventProcessors], e, n);
|
|
1140
1140
|
}
|
|
1141
1141
|
setSDKProcessingMetadata(e) {
|
|
1142
1142
|
return this._sdkProcessingMetadata = { ...this._sdkProcessingMetadata, ...e }, this;
|
|
@@ -1156,16 +1156,16 @@ var w = class {
|
|
|
1156
1156
|
}), this._notifyingListeners = false);
|
|
1157
1157
|
}
|
|
1158
1158
|
_applyFingerprint(e) {
|
|
1159
|
-
e.fingerprint = e.fingerprint ?
|
|
1159
|
+
e.fingerprint = e.fingerprint ? de(e.fingerprint) : [], this._fingerprint && (e.fingerprint = e.fingerprint.concat(this._fingerprint)), e.fingerprint && !e.fingerprint.length && delete e.fingerprint;
|
|
1160
1160
|
}
|
|
1161
1161
|
};
|
|
1162
|
-
function
|
|
1162
|
+
function In() {
|
|
1163
1163
|
return { traceId: g(), spanId: g().substring(16) };
|
|
1164
1164
|
}
|
|
1165
|
-
var
|
|
1166
|
-
var
|
|
1167
|
-
var
|
|
1168
|
-
constructor(e, n = new
|
|
1165
|
+
var Nn = 4;
|
|
1166
|
+
var Fr = 100;
|
|
1167
|
+
var Y = class {
|
|
1168
|
+
constructor(e, n = new O(), r = Nn) {
|
|
1169
1169
|
this._version = r, this._stack = [{ scope: n }], e && this.bindClient(e);
|
|
1170
1170
|
}
|
|
1171
1171
|
isOlderThan(e) {
|
|
@@ -1176,7 +1176,7 @@ var H = class {
|
|
|
1176
1176
|
n.client = e, e && e.setupIntegrations && e.setupIntegrations();
|
|
1177
1177
|
}
|
|
1178
1178
|
pushScope() {
|
|
1179
|
-
let e =
|
|
1179
|
+
let e = O.clone(this.getScope());
|
|
1180
1180
|
return this.getStack().push({ client: this.getClient(), scope: e }), e;
|
|
1181
1181
|
}
|
|
1182
1182
|
popScope() {
|
|
@@ -1226,9 +1226,9 @@ var H = class {
|
|
|
1226
1226
|
addBreadcrumb(e, n) {
|
|
1227
1227
|
let { scope: r, client: s } = this.getStackTop();
|
|
1228
1228
|
if (!s) return;
|
|
1229
|
-
let { beforeBreadcrumb: i = null, maxBreadcrumbs: o =
|
|
1229
|
+
let { beforeBreadcrumb: i = null, maxBreadcrumbs: o = Fr } = s.getOptions && s.getOptions() || {};
|
|
1230
1230
|
if (o <= 0) return;
|
|
1231
|
-
let c = { timestamp: $(), ...e }, u = i ?
|
|
1231
|
+
let c = { timestamp: $(), ...e }, u = i ? Se(() => i(c, n)) : c;
|
|
1232
1232
|
u !== null && (s.emit && s.emit("beforeAddBreadcrumb", u, n), r.addBreadcrumb(u, o));
|
|
1233
1233
|
}
|
|
1234
1234
|
setUser(e) {
|
|
@@ -1254,11 +1254,11 @@ var H = class {
|
|
|
1254
1254
|
r && e(n);
|
|
1255
1255
|
}
|
|
1256
1256
|
run(e) {
|
|
1257
|
-
let n =
|
|
1257
|
+
let n = At(this);
|
|
1258
1258
|
try {
|
|
1259
1259
|
e(this);
|
|
1260
1260
|
} finally {
|
|
1261
|
-
|
|
1261
|
+
At(n);
|
|
1262
1262
|
}
|
|
1263
1263
|
}
|
|
1264
1264
|
getIntegration(e) {
|
|
@@ -1290,11 +1290,11 @@ Sentry.init({...});
|
|
|
1290
1290
|
}
|
|
1291
1291
|
endSession() {
|
|
1292
1292
|
let n = this.getStackTop().scope, r = n.getSession();
|
|
1293
|
-
r &&
|
|
1293
|
+
r && xn(r), this._sendSessionUpdate(), n.setSession();
|
|
1294
1294
|
}
|
|
1295
1295
|
startSession(e) {
|
|
1296
|
-
let { scope: n, client: r } = this.getStackTop(), { release: s, environment: i =
|
|
1297
|
-
return c && c.status === "ok" &&
|
|
1296
|
+
let { scope: n, client: r } = this.getStackTop(), { release: s, environment: i = K } = r && r.getOptions() || {}, { userAgent: o } = h.navigator || {}, a = Rn({ release: s, environment: i, user: n.getUser(), ...o && { userAgent: o }, ...e }), c = n.getSession && n.getSession();
|
|
1297
|
+
return c && c.status === "ok" && P(c, { status: "exited" }), this.endSession(), n.setSession(a), a;
|
|
1298
1298
|
}
|
|
1299
1299
|
shouldSendDefaultPii() {
|
|
1300
1300
|
let e = this.getClient(), n = e && e.getOptions();
|
|
@@ -1309,56 +1309,56 @@ Sentry.init({...});
|
|
|
1309
1309
|
r && e(r, n);
|
|
1310
1310
|
}
|
|
1311
1311
|
_callExtensionMethod(e, ...n) {
|
|
1312
|
-
let s =
|
|
1312
|
+
let s = j().__SENTRY__;
|
|
1313
1313
|
if (s && s.extensions && typeof s.extensions[e] == "function") return s.extensions[e].apply(this, n);
|
|
1314
1314
|
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn(`Extension method ${e} couldn't be found, doing nothing.`);
|
|
1315
1315
|
}
|
|
1316
1316
|
};
|
|
1317
|
-
function
|
|
1317
|
+
function j() {
|
|
1318
1318
|
return h.__SENTRY__ = h.__SENTRY__ || { extensions: {}, hub: void 0 }, h;
|
|
1319
1319
|
}
|
|
1320
|
-
function
|
|
1321
|
-
let e =
|
|
1322
|
-
return
|
|
1320
|
+
function At(t) {
|
|
1321
|
+
let e = j(), n = Me(e);
|
|
1322
|
+
return Dt(e, t), n;
|
|
1323
1323
|
}
|
|
1324
1324
|
function R() {
|
|
1325
|
-
let t =
|
|
1325
|
+
let t = j();
|
|
1326
1326
|
if (t.__SENTRY__ && t.__SENTRY__.acs) {
|
|
1327
1327
|
let e = t.__SENTRY__.acs.getCurrentHub();
|
|
1328
1328
|
if (e) return e;
|
|
1329
1329
|
}
|
|
1330
|
-
return
|
|
1330
|
+
return $r(t);
|
|
1331
1331
|
}
|
|
1332
|
-
function
|
|
1333
|
-
return (!Hr(t) ||
|
|
1332
|
+
function $r(t = j()) {
|
|
1333
|
+
return (!Hr(t) || Me(t).isOlderThan(Nn)) && Dt(t, new Y()), Me(t);
|
|
1334
1334
|
}
|
|
1335
1335
|
function Hr(t) {
|
|
1336
1336
|
return !!(t && t.__SENTRY__ && t.__SENTRY__.hub);
|
|
1337
1337
|
}
|
|
1338
|
-
function
|
|
1339
|
-
return
|
|
1338
|
+
function Me(t) {
|
|
1339
|
+
return ne("hub", () => new Y(), t);
|
|
1340
1340
|
}
|
|
1341
|
-
function
|
|
1341
|
+
function Dt(t, e) {
|
|
1342
1342
|
if (!t) return false;
|
|
1343
1343
|
let n = t.__SENTRY__ = t.__SENTRY__ || {};
|
|
1344
1344
|
return n.hub = e, true;
|
|
1345
1345
|
}
|
|
1346
|
-
function
|
|
1346
|
+
function An(t) {
|
|
1347
1347
|
return (t || R()).getScope().getTransaction();
|
|
1348
1348
|
}
|
|
1349
|
-
var
|
|
1350
|
-
function
|
|
1351
|
-
|
|
1349
|
+
var Dn = false;
|
|
1350
|
+
function wn() {
|
|
1351
|
+
Dn || (Dn = true, we("error", wt), we("unhandledrejection", wt));
|
|
1352
1352
|
}
|
|
1353
|
-
function
|
|
1354
|
-
let t =
|
|
1353
|
+
function wt() {
|
|
1354
|
+
let t = An();
|
|
1355
1355
|
if (t) {
|
|
1356
1356
|
let e = "internal_error";
|
|
1357
1357
|
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(`[Tracing] Transaction: ${e} -> Global error occured`), t.setStatus(e);
|
|
1358
1358
|
}
|
|
1359
1359
|
}
|
|
1360
|
-
|
|
1361
|
-
var
|
|
1360
|
+
wt.tag = "sentry_tracingErrorCallback";
|
|
1361
|
+
var Ue = class {
|
|
1362
1362
|
constructor(e = 1e3) {
|
|
1363
1363
|
this._maxlen = e, this.spans = [];
|
|
1364
1364
|
}
|
|
@@ -1366,9 +1366,9 @@ var Me = class {
|
|
|
1366
1366
|
this.spans.length > this._maxlen ? e.spanRecorder = void 0 : this.spans.push(e);
|
|
1367
1367
|
}
|
|
1368
1368
|
};
|
|
1369
|
-
var
|
|
1369
|
+
var Z = class {
|
|
1370
1370
|
constructor(e = {}) {
|
|
1371
|
-
this.traceId = e.traceId || g(), this.spanId = e.spanId || g().substring(16), this.startTimestamp = e.startTimestamp ||
|
|
1371
|
+
this.traceId = e.traceId || g(), this.spanId = e.spanId || g().substring(16), this.startTimestamp = e.startTimestamp || H(), this.tags = e.tags || {}, this.data = e.data || {}, this.instrumenter = e.instrumenter || "sentry", this.origin = e.origin || "manual", e.parentSpanId && (this.parentSpanId = e.parentSpanId), "sampled" in e && (this.sampled = e.sampled), e.op && (this.op = e.op), e.description && (this.description = e.description), e.name && (this.description = e.name), e.status && (this.status = e.status), e.endTimestamp && (this.endTimestamp = e.endTimestamp);
|
|
1372
1372
|
}
|
|
1373
1373
|
get name() {
|
|
1374
1374
|
return this.description || "";
|
|
@@ -1377,7 +1377,7 @@ var X = class {
|
|
|
1377
1377
|
this.setName(e);
|
|
1378
1378
|
}
|
|
1379
1379
|
startChild(e) {
|
|
1380
|
-
let n = new
|
|
1380
|
+
let n = new Z({ ...e, parentSpanId: this.spanId, sampled: this.sampled, traceId: this.traceId });
|
|
1381
1381
|
if (n.spanRecorder = this.spanRecorder, n.spanRecorder && n.spanRecorder.add(n), n.transaction = this.transaction, (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && n.transaction) {
|
|
1382
1382
|
let r = e && e.op || "< unknown op >", s = n.transaction.name || "< unknown name >", i = n.transaction.spanId, o = `[Tracing] Starting '${r}' span on transaction '${s}' (${i}).`;
|
|
1383
1383
|
n.transaction.metadata.spanMetadata[n.spanId] = { logMessage: o }, f.log(o);
|
|
@@ -1409,10 +1409,10 @@ var X = class {
|
|
|
1409
1409
|
let { logMessage: n } = this.transaction.metadata.spanMetadata[this.spanId];
|
|
1410
1410
|
n && f.log(n.replace("Starting", "Finishing"));
|
|
1411
1411
|
}
|
|
1412
|
-
this.endTimestamp = typeof e == "number" ? e :
|
|
1412
|
+
this.endTimestamp = typeof e == "number" ? e : H();
|
|
1413
1413
|
}
|
|
1414
1414
|
toTraceparent() {
|
|
1415
|
-
return
|
|
1415
|
+
return _t(this.traceId, this.spanId, this.sampled);
|
|
1416
1416
|
}
|
|
1417
1417
|
toContext() {
|
|
1418
1418
|
return E({ data: this.data, description: this.description, endTimestamp: this.endTimestamp, op: this.op, parentSpanId: this.parentSpanId, sampled: this.sampled, spanId: this.spanId, startTimestamp: this.startTimestamp, status: this.status, tags: this.tags, traceId: this.traceId });
|
|
@@ -1457,11 +1457,11 @@ function Yr(t) {
|
|
|
1457
1457
|
}
|
|
1458
1458
|
return "unknown_error";
|
|
1459
1459
|
}
|
|
1460
|
-
function
|
|
1461
|
-
let r = e.getOptions(), { publicKey: s } = e.getDsn() || {}, { segment: i } = n && n.getUser() || {}, o = E({ environment: r.environment ||
|
|
1460
|
+
function Q(t, e, n) {
|
|
1461
|
+
let r = e.getOptions(), { publicKey: s } = e.getDsn() || {}, { segment: i } = n && n.getUser() || {}, o = E({ environment: r.environment || K, release: r.release, user_segment: i, public_key: s, trace_id: t });
|
|
1462
1462
|
return e.emit && e.emit("createDsc", o), o;
|
|
1463
1463
|
}
|
|
1464
|
-
var
|
|
1464
|
+
var Ge = class extends Z {
|
|
1465
1465
|
constructor(e, n) {
|
|
1466
1466
|
super(e), delete this.description, this._measurements = {}, this._contexts = {}, this._hub = n || R(), this._name = e.name || "", this.metadata = { source: "custom", ...e.metadata, spanMetadata: {} }, this._trimEnd = e.trimEnd, this.transaction = this;
|
|
1467
1467
|
let r = this.metadata.dynamicSamplingContext;
|
|
@@ -1477,7 +1477,7 @@ var Ue = class extends X {
|
|
|
1477
1477
|
this._name = e, this.metadata.source = n;
|
|
1478
1478
|
}
|
|
1479
1479
|
initSpanRecorder(e = 1e3) {
|
|
1480
|
-
this.spanRecorder || (this.spanRecorder = new
|
|
1480
|
+
this.spanRecorder || (this.spanRecorder = new Ue(e)), this.spanRecorder.add(this);
|
|
1481
1481
|
}
|
|
1482
1482
|
setContext(e, n) {
|
|
1483
1483
|
n === null ? delete this._contexts[e] : this._contexts[e] = n;
|
|
@@ -1503,7 +1503,7 @@ var Ue = class extends X {
|
|
|
1503
1503
|
if (this._frozenDynamicSamplingContext) return this._frozenDynamicSamplingContext;
|
|
1504
1504
|
let e = this._hub || R(), n = e.getClient();
|
|
1505
1505
|
if (!n) return {};
|
|
1506
|
-
let r = e.getScope(), s =
|
|
1506
|
+
let r = e.getScope(), s = Q(this.traceId, n, r), i = this.metadata.sampleRate;
|
|
1507
1507
|
i !== void 0 && (s.sample_rate = `${i}`);
|
|
1508
1508
|
let o = this.metadata.source;
|
|
1509
1509
|
return o && o !== "url" && (s.transaction = this.name), this.sampled !== void 0 && (s.sampled = String(this.sampled)), s;
|
|
@@ -1525,19 +1525,19 @@ var Ue = class extends X {
|
|
|
1525
1525
|
return Object.keys(this._measurements).length > 0 && ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log("[Measurements] Adding measurements to transaction", JSON.stringify(this._measurements, void 0, 2)), i.measurements = this._measurements), (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`), i;
|
|
1526
1526
|
}
|
|
1527
1527
|
};
|
|
1528
|
-
function
|
|
1528
|
+
function On(t) {
|
|
1529
1529
|
if (typeof __SENTRY_TRACING__ == "boolean" && !__SENTRY_TRACING__) return false;
|
|
1530
1530
|
let e = R().getClient(), n = t || e && e.getOptions();
|
|
1531
1531
|
return !!n && (n.enableTracing || "tracesSampleRate" in n || "tracesSampler" in n);
|
|
1532
1532
|
}
|
|
1533
|
-
function
|
|
1534
|
-
if (!
|
|
1533
|
+
function vn(t, e, n) {
|
|
1534
|
+
if (!On(e)) return t.sampled = false, t;
|
|
1535
1535
|
if (t.sampled !== void 0) return t.setMetadata({ sampleRate: Number(t.sampled) }), t;
|
|
1536
1536
|
let r;
|
|
1537
1537
|
return typeof e.tracesSampler == "function" ? (r = e.tracesSampler(n), t.setMetadata({ sampleRate: Number(r) })) : n.parentSampled !== void 0 ? r = n.parentSampled : typeof e.tracesSampleRate < "u" ? (r = e.tracesSampleRate, t.setMetadata({ sampleRate: Number(r) })) : (r = 1, t.setMetadata({ sampleRate: r })), jr(r) ? r ? (t.sampled = Math.random() < r, t.sampled ? ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(`[Tracing] starting ${t.op} transaction - ${t.name}`), t) : ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(r)})`), t)) : ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler == "function" ? "tracesSampler returned 0 or false" : "a negative sampling decision was inherited or tracesSampleRate is set to 0"}`), t.sampled = false, t) : ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("[Tracing] Discarding transaction because of invalid sample rate."), t.sampled = false, t);
|
|
1538
1538
|
}
|
|
1539
1539
|
function jr(t) {
|
|
1540
|
-
return
|
|
1540
|
+
return te(t) || !(typeof t == "number" || typeof t == "boolean") ? ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`), false) : t < 0 || t > 1 ? ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${t}.`), false) : true;
|
|
1541
1541
|
}
|
|
1542
1542
|
function qr() {
|
|
1543
1543
|
let e = this.getScope().getSpan();
|
|
@@ -1547,12 +1547,12 @@ function Wr(t, e) {
|
|
|
1547
1547
|
let n = this.getClient(), r = n && n.getOptions() || {}, s = r.instrumenter || "sentry", i = t.instrumenter || "sentry";
|
|
1548
1548
|
s !== i && ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.error(`A transaction was started with instrumenter=\`${i}\`, but the SDK is configured with the \`${s}\` instrumenter.
|
|
1549
1549
|
The transaction will not be sampled. Please use the ${s} instrumentation to start transactions.`), t.sampled = false);
|
|
1550
|
-
let o = new
|
|
1551
|
-
return o =
|
|
1550
|
+
let o = new Ge(t, this);
|
|
1551
|
+
return o = vn(o, r, { parentSampled: t.parentSampled, transactionContext: t, ...e }), o.sampled && o.initSpanRecorder(r._experiments && r._experiments.maxSpans), n && n.emit && n.emit("startTransaction", o), o;
|
|
1552
1552
|
}
|
|
1553
|
-
function
|
|
1554
|
-
let t =
|
|
1555
|
-
t.__SENTRY__ && (t.__SENTRY__.extensions = t.__SENTRY__.extensions || {}, t.__SENTRY__.extensions.startTransaction || (t.__SENTRY__.extensions.startTransaction = Wr), t.__SENTRY__.extensions.traceHeaders || (t.__SENTRY__.extensions.traceHeaders = qr),
|
|
1553
|
+
function kn() {
|
|
1554
|
+
let t = j();
|
|
1555
|
+
t.__SENTRY__ && (t.__SENTRY__.extensions = t.__SENTRY__.extensions || {}, t.__SENTRY__.extensions.startTransaction || (t.__SENTRY__.extensions.startTransaction = Wr), t.__SENTRY__.extensions.traceHeaders || (t.__SENTRY__.extensions.traceHeaders = qr), wn());
|
|
1556
1556
|
}
|
|
1557
1557
|
var Le = class {
|
|
1558
1558
|
constructor(e, n) {
|
|
@@ -1597,26 +1597,26 @@ function Jr(t) {
|
|
|
1597
1597
|
return `${Vr(t)}${t.projectId}/envelope/`;
|
|
1598
1598
|
}
|
|
1599
1599
|
function Kr(t, e) {
|
|
1600
|
-
return
|
|
1600
|
+
return ot({ sentry_key: t.publicKey, sentry_version: zr, ...e && { sentry_client: `${e.name}/${e.version}` } });
|
|
1601
1601
|
}
|
|
1602
|
-
function
|
|
1602
|
+
function Cn(t, e = {}) {
|
|
1603
1603
|
let n = typeof e == "string" ? e : e.tunnel, r = typeof e == "string" || !e._metadata ? void 0 : e._metadata.sdk;
|
|
1604
1604
|
return n || `${Jr(t)}?${Kr(t, r)}`;
|
|
1605
1605
|
}
|
|
1606
1606
|
function Xr(t, e) {
|
|
1607
1607
|
return e && (t.sdk = t.sdk || {}, t.sdk.name = t.sdk.name || e.name, t.sdk.version = t.sdk.version || e.version, t.sdk.integrations = [...t.sdk.integrations || [], ...e.integrations || []], t.sdk.packages = [...t.sdk.packages || [], ...e.packages || []]), t;
|
|
1608
1608
|
}
|
|
1609
|
-
function
|
|
1610
|
-
let s =
|
|
1611
|
-
return
|
|
1609
|
+
function Pn(t, e, n, r) {
|
|
1610
|
+
let s = Pe(n), i = { sent_at: (/* @__PURE__ */ new Date()).toISOString(), ...s && { sdk: s }, ...!!r && e && { dsn: U(e) } }, o = "aggregates" in t ? [{ type: "sessions" }, t] : [{ type: "session" }, t.toJSON()];
|
|
1611
|
+
return G(i, [o]);
|
|
1612
1612
|
}
|
|
1613
|
-
function
|
|
1614
|
-
let s =
|
|
1613
|
+
function Mn(t, e, n, r) {
|
|
1614
|
+
let s = Pe(n), i = t.type && t.type !== "replay_event" ? t.type : "event";
|
|
1615
1615
|
Xr(t, n && n.sdk);
|
|
1616
|
-
let o =
|
|
1617
|
-
return delete t.sdkProcessingMetadata,
|
|
1616
|
+
let o = Tt(t, s, r, e);
|
|
1617
|
+
return delete t.sdkProcessingMetadata, G(o, [[{ type: i }, t]]);
|
|
1618
1618
|
}
|
|
1619
|
-
var
|
|
1619
|
+
var Un = [];
|
|
1620
1620
|
function Zr(t) {
|
|
1621
1621
|
let e = {};
|
|
1622
1622
|
return t.forEach((n) => {
|
|
@@ -1624,13 +1624,13 @@ function Zr(t) {
|
|
|
1624
1624
|
s && !s.isDefaultInstance && n.isDefaultInstance || (e[r] = n);
|
|
1625
1625
|
}), Object.keys(e).map((n) => e[n]);
|
|
1626
1626
|
}
|
|
1627
|
-
function
|
|
1627
|
+
function Ot(t) {
|
|
1628
1628
|
let e = t.defaultIntegrations || [], n = t.integrations;
|
|
1629
1629
|
e.forEach((o) => {
|
|
1630
1630
|
o.isDefaultInstance = true;
|
|
1631
1631
|
});
|
|
1632
1632
|
let r;
|
|
1633
|
-
Array.isArray(n) ? r = [...e, ...n] : typeof n == "function" ? r =
|
|
1633
|
+
Array.isArray(n) ? r = [...e, ...n] : typeof n == "function" ? r = de(n(e)) : r = e;
|
|
1634
1634
|
let s = Zr(r), i = Qr(s, (o) => o.name === "Debug");
|
|
1635
1635
|
if (i !== -1) {
|
|
1636
1636
|
let [o] = s.splice(i, 1);
|
|
@@ -1638,14 +1638,14 @@ function wt(t) {
|
|
|
1638
1638
|
}
|
|
1639
1639
|
return s;
|
|
1640
1640
|
}
|
|
1641
|
-
function
|
|
1641
|
+
function Gn(t, e) {
|
|
1642
1642
|
let n = {};
|
|
1643
1643
|
return e.forEach((r) => {
|
|
1644
|
-
r &&
|
|
1644
|
+
r && vt(t, r, n);
|
|
1645
1645
|
}), n;
|
|
1646
1646
|
}
|
|
1647
|
-
function
|
|
1648
|
-
if (n[e.name] = e,
|
|
1647
|
+
function vt(t, e, n) {
|
|
1648
|
+
if (n[e.name] = e, Un.indexOf(e.name) === -1 && (e.setupOnce(bn, R), Un.push(e.name)), t.on && typeof e.preprocessEvent == "function") {
|
|
1649
1649
|
let r = e.preprocessEvent.bind(e);
|
|
1650
1650
|
t.on("preprocessEvent", (s, i) => r(s, i, t));
|
|
1651
1651
|
}
|
|
@@ -1659,11 +1659,11 @@ function Qr(t, e) {
|
|
|
1659
1659
|
for (let n = 0; n < t.length; n++) if (e(t[n]) === true) return n;
|
|
1660
1660
|
return -1;
|
|
1661
1661
|
}
|
|
1662
|
-
function
|
|
1662
|
+
function Bn(t, e, n, r, s) {
|
|
1663
1663
|
let { normalizeDepth: i = 3, normalizeMaxBreadth: o = 1e3 } = t, a = { ...e, event_id: e.event_id || n.event_id || g(), timestamp: e.timestamp || $() }, c = n.integrations || t.integrations.map((p) => p.name);
|
|
1664
1664
|
es(a, t), rs(a, c), e.type === void 0 && ts(a, t.stackParser);
|
|
1665
1665
|
let u = r;
|
|
1666
|
-
n.captureContext && (u =
|
|
1666
|
+
n.captureContext && (u = O.clone(u).update(n.captureContext));
|
|
1667
1667
|
let l = b(a), d = s && s.getEventProcessors ? s.getEventProcessors() : [];
|
|
1668
1668
|
if (u) {
|
|
1669
1669
|
if (u.getAttachments) {
|
|
@@ -1671,23 +1671,23 @@ function Ln(t, e, n, r, s) {
|
|
|
1671
1671
|
p.length && (n.attachments = p);
|
|
1672
1672
|
}
|
|
1673
1673
|
l = u.applyToEvent(a, n, d);
|
|
1674
|
-
} else l =
|
|
1674
|
+
} else l = X([...d, ...fe()], a, n);
|
|
1675
1675
|
return l.then((p) => (p && ns(p), typeof i == "number" && i > 0 ? ss(p, i, o) : p));
|
|
1676
1676
|
}
|
|
1677
1677
|
function es(t, e) {
|
|
1678
1678
|
let { environment: n, release: r, dist: s, maxValueLength: i = 250 } = e;
|
|
1679
|
-
"environment" in t || (t.environment = "environment" in e ? n :
|
|
1679
|
+
"environment" in t || (t.environment = "environment" in e ? n : K), t.release === void 0 && r !== void 0 && (t.release = r), t.dist === void 0 && s !== void 0 && (t.dist = s), t.message && (t.message = M(t.message, i));
|
|
1680
1680
|
let o = t.exception && t.exception.values && t.exception.values[0];
|
|
1681
|
-
o && o.value && (o.value =
|
|
1681
|
+
o && o.value && (o.value = M(o.value, i));
|
|
1682
1682
|
let a = t.request;
|
|
1683
|
-
a && a.url && (a.url =
|
|
1683
|
+
a && a.url && (a.url = M(a.url, i));
|
|
1684
1684
|
}
|
|
1685
|
-
var
|
|
1685
|
+
var Ln = /* @__PURE__ */ new WeakMap();
|
|
1686
1686
|
function ts(t, e) {
|
|
1687
1687
|
let n = h._sentryDebugIds;
|
|
1688
1688
|
if (!n) return;
|
|
1689
|
-
let r, s =
|
|
1690
|
-
s ? r = s : (r = /* @__PURE__ */ new Map(),
|
|
1689
|
+
let r, s = Ln.get(e);
|
|
1690
|
+
s ? r = s : (r = /* @__PURE__ */ new Map(), Ln.set(e, r));
|
|
1691
1691
|
let i = Object.keys(n).reduce((o, a) => {
|
|
1692
1692
|
let c, u = r.get(a);
|
|
1693
1693
|
u ? c = u : (c = e(a), r.set(a, c));
|
|
@@ -1731,20 +1731,20 @@ function rs(t, e) {
|
|
|
1731
1731
|
}
|
|
1732
1732
|
function ss(t, e, n) {
|
|
1733
1733
|
if (!t) return null;
|
|
1734
|
-
let r = { ...t, ...t.breadcrumbs && { breadcrumbs: t.breadcrumbs.map((s) => ({ ...s, ...s.data && { data:
|
|
1735
|
-
return t.contexts && t.contexts.trace && r.contexts && (r.contexts.trace = t.contexts.trace, t.contexts.trace.data && (r.contexts.trace.data =
|
|
1734
|
+
let r = { ...t, ...t.breadcrumbs && { breadcrumbs: t.breadcrumbs.map((s) => ({ ...s, ...s.data && { data: w(s.data, e, n) } })) }, ...t.user && { user: w(t.user, e, n) }, ...t.contexts && { contexts: w(t.contexts, e, n) }, ...t.extra && { extra: w(t.extra, e, n) } };
|
|
1735
|
+
return t.contexts && t.contexts.trace && r.contexts && (r.contexts.trace = t.contexts.trace, t.contexts.trace.data && (r.contexts.trace.data = w(t.contexts.trace.data, e, n))), t.spans && (r.spans = t.spans.map((s) => (s.data && (s.data = w(s.data, e, n)), s))), r;
|
|
1736
1736
|
}
|
|
1737
|
-
var
|
|
1737
|
+
var Fn = "Not capturing exception because it's already been captured.";
|
|
1738
1738
|
var Be = class {
|
|
1739
1739
|
constructor(e) {
|
|
1740
|
-
if (this._options = e, this._integrations = {}, this._integrationsInitialized = false, this._numProcessing = 0, this._outcomes = {}, this._hooks = {}, this._eventProcessors = [], e.dsn ? this._dsn =
|
|
1741
|
-
let n =
|
|
1740
|
+
if (this._options = e, this._integrations = {}, this._integrationsInitialized = false, this._numProcessing = 0, this._outcomes = {}, this._hooks = {}, this._eventProcessors = [], e.dsn ? this._dsn = Te(e.dsn) : (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("No DSN provided, client will not send events."), this._dsn) {
|
|
1741
|
+
let n = Cn(this._dsn, e);
|
|
1742
1742
|
this._transport = e.transport({ recordDroppedEvent: this.recordDroppedEvent.bind(this), ...e.transportOptions, url: n });
|
|
1743
1743
|
}
|
|
1744
1744
|
}
|
|
1745
1745
|
captureException(e, n, r) {
|
|
1746
|
-
if (
|
|
1747
|
-
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(
|
|
1746
|
+
if (Oe(e)) {
|
|
1747
|
+
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(Fn);
|
|
1748
1748
|
return;
|
|
1749
1749
|
}
|
|
1750
1750
|
let s = n && n.event_id;
|
|
@@ -1753,14 +1753,14 @@ var Be = class {
|
|
|
1753
1753
|
})), s;
|
|
1754
1754
|
}
|
|
1755
1755
|
captureMessage(e, n, r, s) {
|
|
1756
|
-
let i = r && r.event_id, o =
|
|
1756
|
+
let i = r && r.event_id, o = Ee(e) ? this.eventFromMessage(String(e), n, r) : this.eventFromException(e, r);
|
|
1757
1757
|
return this._process(o.then((a) => this._captureEvent(a, r, s)).then((a) => {
|
|
1758
1758
|
i = a;
|
|
1759
1759
|
})), i;
|
|
1760
1760
|
}
|
|
1761
1761
|
captureEvent(e, n, r) {
|
|
1762
|
-
if (n && n.originalException &&
|
|
1763
|
-
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(
|
|
1762
|
+
if (n && n.originalException && Oe(n.originalException)) {
|
|
1763
|
+
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(Fn);
|
|
1764
1764
|
return;
|
|
1765
1765
|
}
|
|
1766
1766
|
let s = n && n.event_id;
|
|
@@ -1769,7 +1769,7 @@ var Be = class {
|
|
|
1769
1769
|
})), s;
|
|
1770
1770
|
}
|
|
1771
1771
|
captureSession(e) {
|
|
1772
|
-
typeof e.release != "string" ? (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("Discarded session because of missing or non-string release") : (this.sendSession(e),
|
|
1772
|
+
typeof e.release != "string" ? (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("Discarded session because of missing or non-string release") : (this.sendSession(e), P(e, { init: false }));
|
|
1773
1773
|
}
|
|
1774
1774
|
getDsn() {
|
|
1775
1775
|
return this._dsn;
|
|
@@ -1797,7 +1797,7 @@ var Be = class {
|
|
|
1797
1797
|
this._eventProcessors.push(e);
|
|
1798
1798
|
}
|
|
1799
1799
|
setupIntegrations(e) {
|
|
1800
|
-
(e && !this._integrationsInitialized || this._isEnabled() && !this._integrationsInitialized) && (this._integrations =
|
|
1800
|
+
(e && !this._integrationsInitialized || this._isEnabled() && !this._integrationsInitialized) && (this._integrations = Gn(this, this._options.integrations), this._integrationsInitialized = true);
|
|
1801
1801
|
}
|
|
1802
1802
|
getIntegrationById(e) {
|
|
1803
1803
|
return this._integrations[e];
|
|
@@ -1810,17 +1810,17 @@ var Be = class {
|
|
|
1810
1810
|
}
|
|
1811
1811
|
}
|
|
1812
1812
|
addIntegration(e) {
|
|
1813
|
-
|
|
1813
|
+
vt(this, e, this._integrations);
|
|
1814
1814
|
}
|
|
1815
1815
|
sendEvent(e, n = {}) {
|
|
1816
1816
|
this.emit("beforeSendEvent", e, n);
|
|
1817
|
-
let r =
|
|
1818
|
-
for (let i of n.attachments || []) r =
|
|
1817
|
+
let r = Mn(e, this._dsn, this._options._metadata, this._options.tunnel);
|
|
1818
|
+
for (let i of n.attachments || []) r = Et(r, St(i, this._options.transportOptions && this._options.transportOptions.textEncoder));
|
|
1819
1819
|
let s = this._sendEnvelope(r);
|
|
1820
1820
|
s && s.then((i) => this.emit("afterSendEvent", e, i), null);
|
|
1821
1821
|
}
|
|
1822
1822
|
sendSession(e) {
|
|
1823
|
-
let n =
|
|
1823
|
+
let n = Pn(e, this._dsn, this._options._metadata, this._options.tunnel);
|
|
1824
1824
|
this._sendEnvelope(n);
|
|
1825
1825
|
}
|
|
1826
1826
|
recordDroppedEvent(e, n, r) {
|
|
@@ -1848,7 +1848,7 @@ var Be = class {
|
|
|
1848
1848
|
}
|
|
1849
1849
|
}
|
|
1850
1850
|
let o = e.status === "ok";
|
|
1851
|
-
(o && e.errors === 0 || o && r) && (
|
|
1851
|
+
(o && e.errors === 0 || o && r) && (P(e, { ...r && { status: "crashed" }, errors: e.errors || Number(s || r) }), this.captureSession(e));
|
|
1852
1852
|
}
|
|
1853
1853
|
_isClientDoneProcessing(e) {
|
|
1854
1854
|
return new S((n) => {
|
|
@@ -1862,13 +1862,13 @@ var Be = class {
|
|
|
1862
1862
|
}
|
|
1863
1863
|
_prepareEvent(e, n, r) {
|
|
1864
1864
|
let s = this.getOptions(), i = Object.keys(this._integrations);
|
|
1865
|
-
return !n.integrations && i.length > 0 && (n.integrations = i), this.emit("preprocessEvent", e, n),
|
|
1865
|
+
return !n.integrations && i.length > 0 && (n.integrations = i), this.emit("preprocessEvent", e, n), Bn(s, e, n, r, this).then((o) => {
|
|
1866
1866
|
if (o === null) return o;
|
|
1867
1867
|
let { propagationContext: a } = o.sdkProcessingMetadata || {};
|
|
1868
1868
|
if (!(o.contexts && o.contexts.trace) && a) {
|
|
1869
1869
|
let { traceId: u, spanId: l, parentSpanId: d, dsc: p } = a;
|
|
1870
1870
|
o.contexts = { trace: { trace_id: u, span_id: l, parent_span_id: d }, ...o.contexts };
|
|
1871
|
-
let m = p ||
|
|
1871
|
+
let m = p || Q(u, this, r);
|
|
1872
1872
|
o.sdkProcessingMetadata = { dynamicSamplingContext: m, ...o.sdkProcessingMetadata };
|
|
1873
1873
|
}
|
|
1874
1874
|
return o;
|
|
@@ -1883,7 +1883,7 @@ var Be = class {
|
|
|
1883
1883
|
});
|
|
1884
1884
|
}
|
|
1885
1885
|
_processEvent(e, n, r) {
|
|
1886
|
-
let s = this.getOptions(), { sampleRate: i } = s, o =
|
|
1886
|
+
let s = this.getOptions(), { sampleRate: i } = s, o = Hn(e), a = $n(e), c = e.type || "error", u = `before send for type \`${c}\``;
|
|
1887
1887
|
if (a && typeof i == "number" && Math.random() > i) return this.recordDroppedEvent("sample_rate", "error", e), F(new T(`Discarding event because it's not included in the random sample (sampling rate = ${i})`, "log"));
|
|
1888
1888
|
let l = c === "replay_event" ? "replay" : c;
|
|
1889
1889
|
return this._prepareEvent(e, n, r).then((d) => {
|
|
@@ -1897,8 +1897,8 @@ var Be = class {
|
|
|
1897
1897
|
!o && p && this._updateSessionFromEvent(p, d);
|
|
1898
1898
|
let m = d.transaction_info;
|
|
1899
1899
|
if (o && m && d.transaction !== e.transaction) {
|
|
1900
|
-
let
|
|
1901
|
-
d.transaction_info = { ...m, source:
|
|
1900
|
+
let v = "custom";
|
|
1901
|
+
d.transaction_info = { ...m, source: v };
|
|
1902
1902
|
}
|
|
1903
1903
|
return this.sendEvent(d, n), d;
|
|
1904
1904
|
}).then(null, (d) => {
|
|
@@ -1926,42 +1926,42 @@ Reason: ${d}`));
|
|
|
1926
1926
|
function is(t, e) {
|
|
1927
1927
|
let n = `${e} must return \`null\` or a valid event.`;
|
|
1928
1928
|
if (B(t)) return t.then((r) => {
|
|
1929
|
-
if (!
|
|
1929
|
+
if (!I(r) && r !== null) throw new T(n);
|
|
1930
1930
|
return r;
|
|
1931
1931
|
}, (r) => {
|
|
1932
1932
|
throw new T(`${e} rejected with ${r}`);
|
|
1933
1933
|
});
|
|
1934
|
-
if (!
|
|
1934
|
+
if (!I(t) && t !== null) throw new T(n);
|
|
1935
1935
|
return t;
|
|
1936
1936
|
}
|
|
1937
1937
|
function os(t, e, n) {
|
|
1938
1938
|
let { beforeSend: r, beforeSendTransaction: s } = t;
|
|
1939
|
-
return
|
|
1939
|
+
return $n(e) && r ? r(e, n) : Hn(e) && s ? s(e, n) : e;
|
|
1940
1940
|
}
|
|
1941
|
-
function
|
|
1941
|
+
function $n(t) {
|
|
1942
1942
|
return t.type === void 0;
|
|
1943
1943
|
}
|
|
1944
|
-
function
|
|
1944
|
+
function Hn(t) {
|
|
1945
1945
|
return t.type === "transaction";
|
|
1946
1946
|
}
|
|
1947
|
-
function
|
|
1947
|
+
function Yn(t, e, n, r, s) {
|
|
1948
1948
|
let i = { sent_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
1949
|
-
n && n.sdk && (i.sdk = { name: n.sdk.name, version: n.sdk.version }), r && s && (i.dsn =
|
|
1949
|
+
n && n.sdk && (i.sdk = { name: n.sdk.name, version: n.sdk.version }), r && s && (i.dsn = U(s)), e && (i.trace = E(e));
|
|
1950
1950
|
let o = as(t);
|
|
1951
|
-
return
|
|
1951
|
+
return G(i, [o]);
|
|
1952
1952
|
}
|
|
1953
1953
|
function as(t) {
|
|
1954
1954
|
return [{ type: "check_in" }, t];
|
|
1955
1955
|
}
|
|
1956
|
-
var
|
|
1956
|
+
var pe = class extends Be {
|
|
1957
1957
|
constructor(e) {
|
|
1958
|
-
|
|
1958
|
+
kn(), super(e);
|
|
1959
1959
|
}
|
|
1960
1960
|
eventFromException(e, n) {
|
|
1961
|
-
return b(
|
|
1961
|
+
return b(It(R, this._options.stackParser, e, n));
|
|
1962
1962
|
}
|
|
1963
1963
|
eventFromMessage(e, n = "info", r) {
|
|
1964
|
-
return b(
|
|
1964
|
+
return b(Nt(this._options.stackParser, e, n, r, this._options.attachStacktrace));
|
|
1965
1965
|
}
|
|
1966
1966
|
captureException(e, n, r) {
|
|
1967
1967
|
if (this._options.autoSessionTracking && this._sessionFlusher && r) {
|
|
@@ -1991,7 +1991,7 @@ var fe = class extends Be {
|
|
|
1991
1991
|
e.status !== "in_progress" && (u.duration = e.duration), n && (u.monitor_config = { schedule: n.schedule, checkin_margin: n.checkinMargin, max_runtime: n.maxRuntime, timezone: n.timezone });
|
|
1992
1992
|
let [l, d] = this._getTraceInfoFromScope(r);
|
|
1993
1993
|
d && (u.contexts = { trace: d });
|
|
1994
|
-
let p =
|
|
1994
|
+
let p = Yn(u, l, this.getSdkMetadata(), c, this.getDsn());
|
|
1995
1995
|
return (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.info("Sending checkin:", e.monitorSlug, e.status), this._sendEnvelope(p), s;
|
|
1996
1996
|
}
|
|
1997
1997
|
_captureRequestSession() {
|
|
@@ -2005,27 +2005,27 @@ var fe = class extends Be {
|
|
|
2005
2005
|
let n = e.getSpan();
|
|
2006
2006
|
if (n) return [n.transaction ? n.transaction.getDynamicSamplingContext() : void 0, n.getTraceContext()];
|
|
2007
2007
|
let { traceId: r, spanId: s, parentSpanId: i, dsc: o } = e.getPropagationContext(), a = { trace_id: r, span_id: s, parent_span_id: i };
|
|
2008
|
-
return o ? [o, a] : [
|
|
2008
|
+
return o ? [o, a] : [Q(r, this, e), a];
|
|
2009
2009
|
}
|
|
2010
2010
|
};
|
|
2011
2011
|
var cs = 30;
|
|
2012
|
-
function
|
|
2012
|
+
function kt(t, e, n = pt(t.bufferSize || cs)) {
|
|
2013
2013
|
let r = {}, s = (o) => n.drain(o);
|
|
2014
2014
|
function i(o) {
|
|
2015
2015
|
let a = [];
|
|
2016
|
-
if (
|
|
2017
|
-
let m =
|
|
2018
|
-
if (
|
|
2019
|
-
let
|
|
2020
|
-
t.recordDroppedEvent("ratelimit_backoff", m,
|
|
2016
|
+
if (ke(o, (d, p) => {
|
|
2017
|
+
let m = Ce(p);
|
|
2018
|
+
if (bt(r, m)) {
|
|
2019
|
+
let v = jn(d, p);
|
|
2020
|
+
t.recordDroppedEvent("ratelimit_backoff", m, v);
|
|
2021
2021
|
} else a.push(d);
|
|
2022
2022
|
}), a.length === 0) return b();
|
|
2023
|
-
let c =
|
|
2024
|
-
|
|
2025
|
-
let
|
|
2026
|
-
t.recordDroppedEvent(d,
|
|
2023
|
+
let c = G(o[0], a), u = (d) => {
|
|
2024
|
+
ke(c, (p, m) => {
|
|
2025
|
+
let v = jn(p, m);
|
|
2026
|
+
t.recordDroppedEvent(d, Ce(m), v);
|
|
2027
2027
|
});
|
|
2028
|
-
}, l = () => e({ body:
|
|
2028
|
+
}, l = () => e({ body: yt(c, t.textEncoder) }).then((d) => (d.statusCode !== void 0 && (d.statusCode < 200 || d.statusCode >= 300) && (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn(`Sentry responded with status code ${d.statusCode} to sent event.`), r = Rt(r, d), d), (d) => {
|
|
2029
2029
|
throw u("network_error"), d;
|
|
2030
2030
|
});
|
|
2031
2031
|
return n.add(l).then((d) => d, (d) => {
|
|
@@ -2035,61 +2035,61 @@ function vt(t, e, n = ft(t.bufferSize || cs)) {
|
|
|
2035
2035
|
}
|
|
2036
2036
|
return i.__sentry__baseTransport__ = true, { send: i, flush: s };
|
|
2037
2037
|
}
|
|
2038
|
-
function
|
|
2038
|
+
function jn(t, e) {
|
|
2039
2039
|
if (!(e !== "event" && e !== "transaction")) return Array.isArray(t) ? t[1] : void 0;
|
|
2040
2040
|
}
|
|
2041
|
-
function
|
|
2041
|
+
function Wn(t) {
|
|
2042
2042
|
return typeof t == "object" && t !== null;
|
|
2043
2043
|
}
|
|
2044
2044
|
function us(t) {
|
|
2045
|
-
return
|
|
2045
|
+
return Wn(t) && "handled" in t && typeof t.handled == "boolean" && "type" in t && typeof t.type == "string";
|
|
2046
2046
|
}
|
|
2047
2047
|
function ds(t) {
|
|
2048
|
-
return
|
|
2048
|
+
return Wn(t) && "mechanism" in t && us(t.mechanism);
|
|
2049
2049
|
}
|
|
2050
2050
|
function ls() {
|
|
2051
2051
|
if (h.SENTRY_RELEASE && h.SENTRY_RELEASE.id) return h.SENTRY_RELEASE.id;
|
|
2052
2052
|
}
|
|
2053
|
-
function
|
|
2053
|
+
function qn(t, e) {
|
|
2054
2054
|
return t !== void 0 ? (t[e[0]] = e[1], t) : { [e[0]]: e[1] };
|
|
2055
2055
|
}
|
|
2056
|
-
function
|
|
2056
|
+
function zn(t, e) {
|
|
2057
2057
|
return t(e.stack || "", 1);
|
|
2058
2058
|
}
|
|
2059
2059
|
function fs(t) {
|
|
2060
2060
|
let e = t && t.message;
|
|
2061
2061
|
return e ? e.error && typeof e.error.message == "string" ? e.error.message : e : "No error message";
|
|
2062
2062
|
}
|
|
2063
|
-
function
|
|
2064
|
-
let n = { type: e.name || e.constructor.name, value: fs(e) }, r =
|
|
2063
|
+
function Vn(t, e) {
|
|
2064
|
+
let n = { type: e.name || e.constructor.name, value: fs(e) }, r = zn(t, e);
|
|
2065
2065
|
return r.length && (n.stacktrace = { frames: r }), n.type === void 0 && n.value === "" && (n.value = "Unrecoverable error caught"), n;
|
|
2066
2066
|
}
|
|
2067
2067
|
function ps(t, e, n, r) {
|
|
2068
2068
|
let s, o = (r && r.data && ds(r.data) ? r.data.mechanism : void 0) ?? { handled: true, type: "generic" };
|
|
2069
2069
|
if (L(n)) s = n;
|
|
2070
2070
|
else {
|
|
2071
|
-
if (
|
|
2072
|
-
let c = `Non-Error exception captured with keys: ${
|
|
2071
|
+
if (I(n)) {
|
|
2072
|
+
let c = `Non-Error exception captured with keys: ${se(n)}`, u = t?.getClient(), l = u && u.getOptions().normalizeDepth;
|
|
2073
2073
|
t?.configureScope((d) => {
|
|
2074
|
-
d.setExtra("__serialized__",
|
|
2074
|
+
d.setExtra("__serialized__", J(n, l));
|
|
2075
2075
|
}), s = r && r.syntheticException || new Error(c), s.message = c;
|
|
2076
2076
|
} else s = r && r.syntheticException || new Error(n), s.message = n;
|
|
2077
2077
|
o.synthetic = true;
|
|
2078
2078
|
}
|
|
2079
|
-
let a = { exception: { values: [
|
|
2080
|
-
return
|
|
2079
|
+
let a = { exception: { values: [Vn(e, s)] } };
|
|
2080
|
+
return ce(a, void 0, void 0), ue(a, o), { ...a, event_id: r && r.event_id };
|
|
2081
2081
|
}
|
|
2082
2082
|
function ms(t, e, n = "info", r, s) {
|
|
2083
2083
|
let i = { event_id: r && r.event_id, level: n, message: e };
|
|
2084
2084
|
if (s && r && r.syntheticException) {
|
|
2085
|
-
let o =
|
|
2085
|
+
let o = zn(t, r.syntheticException);
|
|
2086
2086
|
o.length && (i.exception = { values: [{ value: e, stacktrace: { frames: o } }] });
|
|
2087
2087
|
}
|
|
2088
2088
|
return i;
|
|
2089
2089
|
}
|
|
2090
2090
|
var hs = 5;
|
|
2091
|
-
var
|
|
2092
|
-
name =
|
|
2091
|
+
var Ye = class {
|
|
2092
|
+
name = Ye.id;
|
|
2093
2093
|
limit;
|
|
2094
2094
|
constructor(e = {}) {
|
|
2095
2095
|
this.limit = e.limit || hs;
|
|
@@ -2097,40 +2097,40 @@ var He = class {
|
|
|
2097
2097
|
setupOnce(e, n) {
|
|
2098
2098
|
let r = n().getClient();
|
|
2099
2099
|
r && e((s, i) => {
|
|
2100
|
-
let o = n().getIntegration(
|
|
2100
|
+
let o = n().getIntegration(Ye);
|
|
2101
2101
|
return o ? _s(r.getOptions().stackParser, o.limit, s, i) : s;
|
|
2102
2102
|
});
|
|
2103
2103
|
}
|
|
2104
2104
|
};
|
|
2105
|
-
var Fe =
|
|
2106
|
-
|
|
2105
|
+
var Fe = Ye;
|
|
2106
|
+
_e(Fe, "id", "LinkedErrors");
|
|
2107
2107
|
function _s(t, e, n, r) {
|
|
2108
|
-
if (!n.exception || !n.exception.values || !r || !
|
|
2109
|
-
let s =
|
|
2108
|
+
if (!n.exception || !n.exception.values || !r || !k(r.originalException, Error)) return n;
|
|
2109
|
+
let s = Jn(t, e, r.originalException);
|
|
2110
2110
|
return n.exception.values = [...s, ...n.exception.values], n;
|
|
2111
2111
|
}
|
|
2112
|
-
function
|
|
2113
|
-
if (!
|
|
2114
|
-
let s =
|
|
2115
|
-
return
|
|
2112
|
+
function Jn(t, e, n, r = []) {
|
|
2113
|
+
if (!k(n.cause, Error) || r.length + 1 >= e) return r;
|
|
2114
|
+
let s = Vn(t, n.cause);
|
|
2115
|
+
return Jn(t, e, n.cause, [s, ...r]);
|
|
2116
2116
|
}
|
|
2117
2117
|
var gs = { allowedHeaders: ["CF-RAY", "CF-Worker"] };
|
|
2118
|
-
var
|
|
2119
|
-
var
|
|
2118
|
+
var ee;
|
|
2119
|
+
var je = class {
|
|
2120
2120
|
constructor(e = {}) {
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2121
|
+
_e(this, "name", je.id);
|
|
2122
|
+
$t(this, ee, void 0);
|
|
2123
|
+
Ht(this, ee, { ...gs, ...e });
|
|
2124
2124
|
}
|
|
2125
2125
|
setupOnce(e, n) {
|
|
2126
2126
|
n().getClient() && e((s) => {
|
|
2127
2127
|
let { sdkProcessingMetadata: i } = s;
|
|
2128
|
-
return !n().getIntegration(
|
|
2128
|
+
return !n().getIntegration(je) || !i || ("request" in i && i.request instanceof Request && (s.request = ys(i.request, et(this, ee)), s.user = Es(s.user ?? {}, i.request, et(this, ee))), "requestData" in i && (s.request ? s.request.data = i.requestData : s.request = { data: i.requestData })), s;
|
|
2129
2129
|
});
|
|
2130
2130
|
}
|
|
2131
2131
|
};
|
|
2132
|
-
var $e =
|
|
2133
|
-
|
|
2132
|
+
var $e = je;
|
|
2133
|
+
ee = /* @__PURE__ */ new WeakMap(), _e($e, "id", "RequestData");
|
|
2134
2134
|
function Es(t, e, n) {
|
|
2135
2135
|
let r = e.headers.get("CF-Connecting-IP"), { allowedIps: s } = n, i = { ...t };
|
|
2136
2136
|
return !("ip_address" in t) && r && s !== void 0 && Ss(r, s) && (i.ip_address = r), Object.keys(i).length > 0 ? i : void 0;
|
|
@@ -2152,9 +2152,9 @@ function ys(t, e) {
|
|
|
2152
2152
|
l < 0 ? i.url = t.url : (i.url = t.url.substr(0, l), i.query_string = t.url.substr(l + 1));
|
|
2153
2153
|
}
|
|
2154
2154
|
let { allowedHeaders: o, allowedCookies: a, allowedSearchParams: c } = e;
|
|
2155
|
-
if (o !== void 0 && i.headers ? (i.headers =
|
|
2155
|
+
if (o !== void 0 && i.headers ? (i.headers = Ct(i.headers, o), Object.keys(i.headers).length === 0 && delete i.headers) : delete i.headers, a !== void 0 && i.cookies ? (i.cookies = Ct(i.cookies, a), Object.keys(i.cookies).length === 0 && delete i.cookies) : delete i.cookies, c !== void 0) {
|
|
2156
2156
|
let u = Object.fromEntries(new URLSearchParams(i.query_string)), l = new URLSearchParams();
|
|
2157
|
-
Object.keys(
|
|
2157
|
+
Object.keys(Ct(u, c)).forEach((d) => {
|
|
2158
2158
|
l.set(d, u[d]);
|
|
2159
2159
|
}), i.query_string = l.toString();
|
|
2160
2160
|
} else delete i.query_string;
|
|
@@ -2163,7 +2163,7 @@ function ys(t, e) {
|
|
|
2163
2163
|
function Ss(t, e) {
|
|
2164
2164
|
return typeof e == "boolean" ? e : e instanceof RegExp ? e.test(t) : Array.isArray(e) ? e.map((r) => r.toLowerCase()).includes(t) : false;
|
|
2165
2165
|
}
|
|
2166
|
-
function
|
|
2166
|
+
function Ct(t, e) {
|
|
2167
2167
|
let n = () => false;
|
|
2168
2168
|
if (typeof e == "boolean") return e ? t : {};
|
|
2169
2169
|
if (e instanceof RegExp) n = (r) => e.test(r);
|
|
@@ -2189,7 +2189,7 @@ function bs(t, e) {
|
|
|
2189
2189
|
}, () => e);
|
|
2190
2190
|
}), n;
|
|
2191
2191
|
}
|
|
2192
|
-
var
|
|
2192
|
+
var Pt = class extends pe {
|
|
2193
2193
|
#e = null;
|
|
2194
2194
|
constructor(e) {
|
|
2195
2195
|
e._metadata = e._metadata || {}, e._metadata.sdk = e._metadata.sdk || { name: "toucan-js", packages: [{ name: "npm:toucan-js", version: "3.3.1" }], version: "3.3.1" }, super(e);
|
|
@@ -2204,7 +2204,7 @@ var Ct = class extends fe {
|
|
|
2204
2204
|
return b(ms(this._options.stackParser, e, n, r, this._options.attachStacktrace));
|
|
2205
2205
|
}
|
|
2206
2206
|
_prepareEvent(e, n, r) {
|
|
2207
|
-
return e.platform = e.platform || "javascript", this.getOptions().request && (e.sdkProcessingMetadata =
|
|
2207
|
+
return e.platform = e.platform || "javascript", this.getOptions().request && (e.sdkProcessingMetadata = qn(e.sdkProcessingMetadata, ["request", this.getOptions().request])), this.getOptions().requestData && (e.sdkProcessingMetadata = qn(e.sdkProcessingMetadata, ["requestData", this.getOptions().requestData])), super._prepareEvent(e, n, r);
|
|
2208
2208
|
}
|
|
2209
2209
|
getSdk() {
|
|
2210
2210
|
return this.#e;
|
|
@@ -2220,7 +2220,7 @@ var Ct = class extends fe {
|
|
|
2220
2220
|
}
|
|
2221
2221
|
};
|
|
2222
2222
|
function Rs(t) {
|
|
2223
|
-
let [e, n] =
|
|
2223
|
+
let [e, n] = ut(t);
|
|
2224
2224
|
return [e, (s) => {
|
|
2225
2225
|
let i = n(s);
|
|
2226
2226
|
if (i) {
|
|
@@ -2231,9 +2231,9 @@ function Rs(t) {
|
|
|
2231
2231
|
}];
|
|
2232
2232
|
}
|
|
2233
2233
|
function xs(t) {
|
|
2234
|
-
if (t) return
|
|
2234
|
+
if (t) return ft(t, ".js");
|
|
2235
2235
|
}
|
|
2236
|
-
var Is =
|
|
2236
|
+
var Is = Re(Rs(xs));
|
|
2237
2237
|
function Ns(t) {
|
|
2238
2238
|
function e({ body: n }) {
|
|
2239
2239
|
try {
|
|
@@ -2243,15 +2243,15 @@ function Ns(t) {
|
|
|
2243
2243
|
return F(r);
|
|
2244
2244
|
}
|
|
2245
2245
|
}
|
|
2246
|
-
return
|
|
2246
|
+
return kt(t, e);
|
|
2247
2247
|
}
|
|
2248
|
-
var
|
|
2248
|
+
var He = class extends Y {
|
|
2249
2249
|
constructor(e) {
|
|
2250
2250
|
if (e.defaultIntegrations = e.defaultIntegrations === false ? [] : [...Array.isArray(e.defaultIntegrations) ? e.defaultIntegrations : [new $e(e.requestDataOptions), new Fe()]], e.release === void 0) {
|
|
2251
2251
|
let r = ls();
|
|
2252
2252
|
r !== void 0 && (e.release = r);
|
|
2253
2253
|
}
|
|
2254
|
-
let n = new
|
|
2254
|
+
let n = new Pt({ ...e, transport: Ns, integrations: Ot(e), stackParser: ct(e.stackParser || Is), transportOptions: { ...e.transportOptions, context: e.context } });
|
|
2255
2255
|
super(n), n.setSdk(this), n.setupIntegrations();
|
|
2256
2256
|
}
|
|
2257
2257
|
setRequestBody(e) {
|
|
@@ -2264,14 +2264,21 @@ var Ge = class extends H {
|
|
|
2264
2264
|
return e.status === "in_progress" && this.setContext("monitor", { slug: e.monitorSlug }), this.getClient().captureCheckIn(e, n, r);
|
|
2265
2265
|
}
|
|
2266
2266
|
};
|
|
2267
|
-
function
|
|
2267
|
+
function Kn(t, e, n, r, s, i, o, a) {
|
|
2268
2268
|
if (!(n && r && s)) return;
|
|
2269
|
-
let
|
|
2270
|
-
i.setTag("colo", o);
|
|
2271
|
-
let a = t.headers.get("user-agent") ?? "UA UNKNOWN";
|
|
2272
|
-
return i.setUser({ userAgent: a, colo: o }), i;
|
|
2269
|
+
let c = new He({ dsn: n, request: t, context: e, sampleRate: 1, requestDataOptions: { allowedHeaders: ["user-agent", "cf-challenge", "accept-encoding", "accept-language", "cf-ray", "content-length", "content-type", "host"], allowedSearchParams: /(.*)/ }, transportOptions: { headers: { "CF-Access-Client-ID": r, "CF-Access-Client-Secret": s } } });
|
|
2270
|
+
return i && (c.setTag("colo", i.coloId), c.setTag("metal", i.metalId)), o && a && (c.setTag("accountId", o), c.setTag("scriptId", a)), c.setUser({ id: o?.toString() }), c;
|
|
2273
2271
|
}
|
|
2274
|
-
|
|
2272
|
+
function As() {
|
|
2273
|
+
return { addLogs: () => {
|
|
2274
|
+
}, setTags: () => {
|
|
2275
|
+
}, end: () => {
|
|
2276
|
+
}, isRecording: true };
|
|
2277
|
+
}
|
|
2278
|
+
function Xn() {
|
|
2279
|
+
return { enterSpan: (t, e, ...n) => e(As(), ...n), getSpanContext: () => ({ traceId: "test-trace", spanId: "test-span", parentSpanId: "test-parent-span", traceFlags: 0 }), runWithSpanContext: (t, e, ...n) => e(...n), traceId: "test-trace", spanId: "test-span", parentSpanId: "test-parent-span", cfTraceIdHeader: "test-trace:test-span:0" };
|
|
2280
|
+
}
|
|
2281
|
+
var qe = class {
|
|
2275
2282
|
constructor(e) {
|
|
2276
2283
|
this.data = {};
|
|
2277
2284
|
this.readyAnalytics = e;
|
|
@@ -2283,36 +2290,36 @@ var je = class {
|
|
|
2283
2290
|
return this.data[e];
|
|
2284
2291
|
}
|
|
2285
2292
|
write() {
|
|
2286
|
-
this.readyAnalytics && this.readyAnalytics.logEvent({ version: 1, accountId:
|
|
2293
|
+
this.readyAnalytics && this.readyAnalytics.logEvent({ version: 1, accountId: this.data.accountId, indexId: this.data.scriptId?.toString(), doubles: [this.data.requestTime ?? -1, this.data.coloId ?? -1, this.data.metalId ?? -1, this.data.coloTier ?? -1], blobs: [this.data.hostname?.substring(0, 256), this.data.userAgent?.substring(0, 256), this.data.htmlHandling, this.data.notFoundHandling, this.data.error?.substring(0, 256), this.data.version, this.data.coloRegion] });
|
|
2287
2294
|
}
|
|
2288
2295
|
};
|
|
2289
|
-
var
|
|
2296
|
+
var ze = class {
|
|
2290
2297
|
constructor(e) {
|
|
2291
2298
|
this.data = e;
|
|
2292
2299
|
}
|
|
2293
2300
|
async get(e) {
|
|
2294
|
-
let n = await
|
|
2295
|
-
return r ?
|
|
2301
|
+
let n = await Os(e), r = Mt(new Uint8Array(this.data, 20), n);
|
|
2302
|
+
return r ? ks(r) : null;
|
|
2296
2303
|
}
|
|
2297
2304
|
};
|
|
2298
|
-
var
|
|
2305
|
+
var Os = async (t) => {
|
|
2299
2306
|
let n = new TextEncoder().encode(t), r = await crypto.subtle.digest("SHA-256", n.buffer);
|
|
2300
2307
|
return new Uint8Array(r, 0, 16);
|
|
2301
2308
|
};
|
|
2302
|
-
var
|
|
2309
|
+
var Mt = (t, e) => {
|
|
2303
2310
|
if (t.byteLength === 0) return false;
|
|
2304
2311
|
let n = t.byteOffset + (t.byteLength / 40 >> 1) * 40, r = new Uint8Array(t.buffer, n, 16);
|
|
2305
2312
|
if (r.byteLength !== e.byteLength) throw new TypeError("Search value and current value are of different lengths");
|
|
2306
|
-
let s =
|
|
2313
|
+
let s = vs(e, r);
|
|
2307
2314
|
if (s < 0) {
|
|
2308
2315
|
let i = t.byteOffset, o = n - t.byteOffset;
|
|
2309
|
-
return
|
|
2316
|
+
return Mt(new Uint8Array(t.buffer, i, o), e);
|
|
2310
2317
|
} else if (s > 0) {
|
|
2311
2318
|
let i = n + 40, o = t.buffer.byteLength - n - 40;
|
|
2312
|
-
return
|
|
2319
|
+
return Mt(new Uint8Array(t.buffer, i, o), e);
|
|
2313
2320
|
} else return new Uint8Array(t.buffer, n, 40);
|
|
2314
2321
|
};
|
|
2315
|
-
var
|
|
2322
|
+
var vs = (t, e) => {
|
|
2316
2323
|
if (t.byteLength < e.byteLength) return -1;
|
|
2317
2324
|
if (t.byteLength > e.byteLength) return 1;
|
|
2318
2325
|
for (let [n, r] of t.entries()) {
|
|
@@ -2321,79 +2328,81 @@ var Os = (t, e) => {
|
|
|
2321
2328
|
}
|
|
2322
2329
|
return 0;
|
|
2323
2330
|
};
|
|
2324
|
-
var
|
|
2325
|
-
var
|
|
2326
|
-
var
|
|
2331
|
+
var ks = (t) => [...t.slice(16, 16 + 16)].map((n) => n.toString(16).padStart(2, "0")).join("");
|
|
2332
|
+
var Ut = (t) => ({ html_handling: t?.html_handling ?? "auto-trailing-slash", not_found_handling: t?.not_found_handling ?? "none", serve_directly: t?.serve_directly ?? true });
|
|
2333
|
+
var Ve = class extends Response {
|
|
2327
2334
|
constructor(e, n) {
|
|
2328
2335
|
super(e, { ...n, status: 200 });
|
|
2329
2336
|
}
|
|
2330
2337
|
};
|
|
2331
|
-
var
|
|
2338
|
+
var he = class extends Response {
|
|
2332
2339
|
constructor(...[e, n]) {
|
|
2333
2340
|
super(e, { ...n, status: 404, statusText: "Not Found" });
|
|
2334
2341
|
}
|
|
2335
2342
|
};
|
|
2336
|
-
var
|
|
2343
|
+
var Je = class extends Response {
|
|
2337
2344
|
constructor(...[e, n]) {
|
|
2338
2345
|
super(e, { ...n, status: 405, statusText: "Method Not Allowed" });
|
|
2339
2346
|
}
|
|
2340
2347
|
};
|
|
2341
|
-
var
|
|
2348
|
+
var q = class extends Response {
|
|
2342
2349
|
constructor(e, n) {
|
|
2343
2350
|
super(null, { ...n, status: 500 });
|
|
2344
2351
|
}
|
|
2345
2352
|
};
|
|
2346
|
-
var
|
|
2353
|
+
var Ke = class extends Response {
|
|
2347
2354
|
constructor(...[e, n]) {
|
|
2348
2355
|
super(null, { ...n, status: 304, statusText: "Not Modified" });
|
|
2349
2356
|
}
|
|
2350
2357
|
};
|
|
2351
|
-
var
|
|
2358
|
+
var Xe = class extends Response {
|
|
2352
2359
|
constructor(e, n) {
|
|
2353
2360
|
super(null, { ...n, status: 307, statusText: "Temporary Redirect", headers: { ...n?.headers, Location: e } });
|
|
2354
2361
|
}
|
|
2355
2362
|
};
|
|
2356
|
-
var
|
|
2357
|
-
function
|
|
2363
|
+
var Zn = "public, max-age=0, must-revalidate";
|
|
2364
|
+
function Qn(t, e, n) {
|
|
2358
2365
|
let r = new Headers({ "Content-Type": e, ETag: `"${t}"` });
|
|
2359
|
-
return
|
|
2366
|
+
return Cs(n) && r.append("Cache-Control", Zn), r;
|
|
2360
2367
|
}
|
|
2361
|
-
function
|
|
2368
|
+
function Cs(t) {
|
|
2362
2369
|
return !t.headers.has("Authorization") && !t.headers.has("Range");
|
|
2363
2370
|
}
|
|
2364
|
-
var
|
|
2365
|
-
let { pathname: i, search: o } = new URL(t.url), a =
|
|
2371
|
+
var er = async (t, e, n, r, s) => {
|
|
2372
|
+
let { pathname: i, search: o } = new URL(t.url), a = Gt(i);
|
|
2366
2373
|
a = a.replace(/\/+/g, "/");
|
|
2367
|
-
let c = await
|
|
2368
|
-
if (!c) return new
|
|
2374
|
+
let c = await Ze(a, n, r);
|
|
2375
|
+
if (!c) return e.JAEGER.enterSpan("no_intent", (x) => (x.setTags({ decodedPathname: a, configuration: JSON.stringify(n), status: 404 }), new he()));
|
|
2369
2376
|
let u = t.method.toUpperCase();
|
|
2370
|
-
if (!["GET", "HEAD"].includes(u)) return new
|
|
2377
|
+
if (!["GET", "HEAD"].includes(u)) return e.JAEGER.enterSpan("method_not_allowed", (x) => (x.setTags({ method: u, status: 405 }), new Je()));
|
|
2371
2378
|
let l = c.redirect ?? a, d = Ls(l);
|
|
2372
|
-
if (d !== i && c.asset || c.redirect) return new
|
|
2373
|
-
if (!c.asset) return new
|
|
2374
|
-
let p = await e.JAEGER.enterSpan("getByETag", async (
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2379
|
+
if (d !== i && c.asset || c.redirect) return e.JAEGER.enterSpan("redirect", (x) => (x.setTags({ originalPath: i, location: d !== i ? d : c.redirect ?? "<unknown>", status: 307 }), new Xe(d + o)));
|
|
2380
|
+
if (!c.asset) return e.JAEGER.enterSpan("unknown_action", (x) => (x.setTags({ pathname: i, status: 500 }), new q(new Error("Unknown action"))));
|
|
2381
|
+
let p = await e.JAEGER.enterSpan("getByETag", async (x) => (x.setTags({ pathname: i, eTag: c.asset.eTag, status: c.asset.status }), await s(c.asset.eTag))), m = Qn(c.asset.eTag, p.contentType, t), v = `"${c.asset.eTag}"`, rr = `W/${v}`, Lt = t.headers.get("If-None-Match") || "";
|
|
2382
|
+
return [rr, v].includes(Lt) ? e.JAEGER.enterSpan("matched_etag", (x) => (x.setTags({ matchedEtag: Lt, status: 304 }), new Ke(null, { headers: m }))) : e.JAEGER.enterSpan("response", (x) => {
|
|
2383
|
+
x.setTags({ etag: c.asset.eTag, status: c.asset.status, head: u === "HEAD" });
|
|
2384
|
+
let Bt = u === "HEAD" ? null : p.readableStream;
|
|
2385
|
+
switch (c.asset.status) {
|
|
2386
|
+
case 404:
|
|
2387
|
+
return new he(Bt, { headers: m });
|
|
2388
|
+
case 200:
|
|
2389
|
+
return new Ve(Bt, { headers: m });
|
|
2390
|
+
}
|
|
2391
|
+
});
|
|
2383
2392
|
};
|
|
2384
|
-
var
|
|
2393
|
+
var Ze = async (t, e, n, r = false) => {
|
|
2385
2394
|
switch (e.html_handling) {
|
|
2386
2395
|
case "auto-trailing-slash":
|
|
2387
|
-
return Cs(t, e, n, r);
|
|
2388
|
-
case "force-trailing-slash":
|
|
2389
2396
|
return Ps(t, e, n, r);
|
|
2390
|
-
case "
|
|
2397
|
+
case "force-trailing-slash":
|
|
2391
2398
|
return Ms(t, e, n, r);
|
|
2399
|
+
case "drop-trailing-slash":
|
|
2400
|
+
return Us(t, e, n, r);
|
|
2392
2401
|
case "none":
|
|
2393
|
-
return
|
|
2402
|
+
return Gs(t, e, n);
|
|
2394
2403
|
}
|
|
2395
2404
|
};
|
|
2396
|
-
var
|
|
2405
|
+
var Ps = async (t, e, n, r) => {
|
|
2397
2406
|
let s = null, i = null, o = await n(t);
|
|
2398
2407
|
if (t.endsWith("/index")) {
|
|
2399
2408
|
if (o) return { asset: { eTag: o, status: 200 }, redirect: null };
|
|
@@ -2409,9 +2418,9 @@ var Cs = async (t, e, n, r) => {
|
|
|
2409
2418
|
if (s = await _(t, t.slice(0, -5), e, n, r)) return s;
|
|
2410
2419
|
if (s = await _(`${t.slice(0, -5)}/index.html`, `${t.slice(0, -5)}/`, e, n, r)) return s;
|
|
2411
2420
|
}
|
|
2412
|
-
return o ? { asset: { eTag: o, status: 200 }, redirect: null } : (i = await n(`${t}.html`)) ? { asset: { eTag: i, status: 200 }, redirect: null } : (s = await _(`${t}/index.html`, `${t}/`, e, n, r)) ? s :
|
|
2421
|
+
return o ? { asset: { eTag: o, status: 200 }, redirect: null } : (i = await n(`${t}.html`)) ? { asset: { eTag: i, status: 200 }, redirect: null } : (s = await _(`${t}/index.html`, `${t}/`, e, n, r)) ? s : Qe(t, e, n);
|
|
2413
2422
|
};
|
|
2414
|
-
var
|
|
2423
|
+
var Ms = async (t, e, n, r) => {
|
|
2415
2424
|
let s = null, i = null, o = await n(t);
|
|
2416
2425
|
if (t.endsWith("/index")) {
|
|
2417
2426
|
if (o) return { asset: { eTag: o, status: 200 }, redirect: null };
|
|
@@ -2428,9 +2437,9 @@ var Ps = async (t, e, n, r) => {
|
|
|
2428
2437
|
if (o) return { asset: { eTag: o, status: 200 }, redirect: null };
|
|
2429
2438
|
if (s = await _(`${t.slice(0, -5)}/index.html`, `${t.slice(0, -5)}/`, e, n, r)) return s;
|
|
2430
2439
|
}
|
|
2431
|
-
return o ? { asset: { eTag: o, status: 200 }, redirect: null } : (s = await _(`${t}.html`, `${t}/`, e, n, r)) || (s = await _(`${t}/index.html`, `${t}/`, e, n, r)) ? s :
|
|
2440
|
+
return o ? { asset: { eTag: o, status: 200 }, redirect: null } : (s = await _(`${t}.html`, `${t}/`, e, n, r)) || (s = await _(`${t}/index.html`, `${t}/`, e, n, r)) ? s : Qe(t, e, n);
|
|
2432
2441
|
};
|
|
2433
|
-
var
|
|
2442
|
+
var Us = async (t, e, n, r) => {
|
|
2434
2443
|
let s = null, i = null, o = await n(t);
|
|
2435
2444
|
if (t.endsWith("/index")) {
|
|
2436
2445
|
if (o) return { asset: { eTag: o, status: 200 }, redirect: null };
|
|
@@ -2457,13 +2466,13 @@ var Ms = async (t, e, n, r) => {
|
|
|
2457
2466
|
if (s = await _(t, t.slice(0, -5), e, n, r)) return s;
|
|
2458
2467
|
if (s = await _(`${t.slice(0, -5)}/index.html`, t.slice(0, -5), e, n, r)) return s;
|
|
2459
2468
|
}
|
|
2460
|
-
return o ? { asset: { eTag: o, status: 200 }, redirect: null } : (i = await n(`${t}.html`)) ? { asset: { eTag: i, status: 200 }, redirect: null } : (i = await n(`${t}/index.html`)) ? { asset: { eTag: i, status: 200 }, redirect: null } :
|
|
2469
|
+
return o ? { asset: { eTag: o, status: 200 }, redirect: null } : (i = await n(`${t}.html`)) ? { asset: { eTag: i, status: 200 }, redirect: null } : (i = await n(`${t}/index.html`)) ? { asset: { eTag: i, status: 200 }, redirect: null } : Qe(t, e, n);
|
|
2461
2470
|
};
|
|
2462
|
-
var
|
|
2471
|
+
var Gs = async (t, e, n) => {
|
|
2463
2472
|
let r = await n(t);
|
|
2464
|
-
return r ? { asset: { eTag: r, status: 200 }, redirect: null } :
|
|
2473
|
+
return r ? { asset: { eTag: r, status: 200 }, redirect: null } : Qe(t, e, n);
|
|
2465
2474
|
};
|
|
2466
|
-
var
|
|
2475
|
+
var Qe = async (t, e, n) => {
|
|
2467
2476
|
switch (e.not_found_handling) {
|
|
2468
2477
|
case "single-page-application": {
|
|
2469
2478
|
let r = await n("/index.html");
|
|
@@ -2486,12 +2495,12 @@ var Ze = async (t, e, n) => {
|
|
|
2486
2495
|
var _ = async (t, e, n, r, s) => {
|
|
2487
2496
|
if (s) return null;
|
|
2488
2497
|
if (!await r(e)) {
|
|
2489
|
-
let i = await
|
|
2498
|
+
let i = await Ze(e, n, r, true);
|
|
2490
2499
|
if (i?.asset && i.asset.eTag === await r(t)) return { asset: null, redirect: e };
|
|
2491
2500
|
}
|
|
2492
2501
|
return null;
|
|
2493
2502
|
};
|
|
2494
|
-
var
|
|
2503
|
+
var Gt = (t) => t.split("/").map((e) => {
|
|
2495
2504
|
try {
|
|
2496
2505
|
return decodeURIComponent(e);
|
|
2497
2506
|
} catch {
|
|
@@ -2505,7 +2514,7 @@ var Ls = (t) => t.split("/").map((e) => {
|
|
|
2505
2514
|
return e;
|
|
2506
2515
|
}
|
|
2507
2516
|
}).join("/");
|
|
2508
|
-
async function
|
|
2517
|
+
async function tr(t, e, n, r = 1) {
|
|
2509
2518
|
let s = 0;
|
|
2510
2519
|
for (; s <= r; ) try {
|
|
2511
2520
|
let i = await t.getWithMetadata(e, { type: "stream", cacheTtl: 31536e3 });
|
|
@@ -2519,27 +2528,13 @@ async function Zn(t, e, n, r = 1) {
|
|
|
2519
2528
|
await new Promise((o) => setTimeout(o, Math.pow(2, s++) * 1e3));
|
|
2520
2529
|
}
|
|
2521
2530
|
}
|
|
2522
|
-
|
|
2523
|
-
return { addLogs: () => {
|
|
2524
|
-
}, setTags: () => {
|
|
2525
|
-
}, end: () => {
|
|
2526
|
-
}, isRecording: true };
|
|
2527
|
-
}
|
|
2528
|
-
function Qn() {
|
|
2529
|
-
return { enterSpan: (t, e, ...n) => e(Bs(), ...n), getSpanContext: () => ({ traceId: "test-trace", spanId: "test-span", parentSpanId: "test-parent-span", traceFlags: 0 }), runWithSpanContext: (t, e, ...n) => e(...n), traceId: "test-trace", spanId: "test-span", parentSpanId: "test-parent-span", cfTraceIdHeader: "test-trace:test-span:0" };
|
|
2530
|
-
}
|
|
2531
|
-
var er = class extends Fs {
|
|
2531
|
+
var nr = class extends Bs {
|
|
2532
2532
|
async fetch(t) {
|
|
2533
|
-
let e, n = new
|
|
2533
|
+
let e, n = new qe(this.env.ANALYTICS), r = new ge(this.env.UNSAFE_PERFORMANCE), s = r.now();
|
|
2534
2534
|
try {
|
|
2535
|
-
this.env.JAEGER || (this.env.JAEGER =
|
|
2536
|
-
let i =
|
|
2537
|
-
|
|
2538
|
-
let c = this.env.COLO_METADATA.coloId;
|
|
2539
|
-
e.setTag("colo", this.env.COLO_METADATA.coloId), e.setTag("metal", this.env.COLO_METADATA.metalId), e.setUser({ userAgent: o, colo: c });
|
|
2540
|
-
}
|
|
2541
|
-
let a = new URL(t.url);
|
|
2542
|
-
return this.env.COLO_METADATA && this.env.VERSION_METADATA && n.setData({ coloId: this.env.COLO_METADATA.coloId, metalId: this.env.COLO_METADATA.metalId, coloTier: this.env.COLO_METADATA.coloTier, coloRegion: this.env.COLO_METADATA.coloRegion, version: this.env.VERSION_METADATA.id, hostname: a.hostname, htmlHandling: i.html_handling, notFoundHandling: i.not_found_handling, userAgent: o }), this.env.JAEGER.enterSpan("handleRequest", async (c) => (c.setTags({ hostname: a.hostname, eyeballPath: a.pathname, env: this.env.ENVIRONMENT, version: this.env.VERSION_METADATA?.id }), Xn(t, this.env, i, this.unstable_exists.bind(this), this.unstable_getByETag.bind(this)))).catch((c) => this.handleError(e, n, c)).finally(() => this.submitMetrics(n, r, s));
|
|
2535
|
+
this.env.JAEGER || (this.env.JAEGER = Xn()), e = Kn(t, this.ctx, this.env.SENTRY_DSN, this.env.SENTRY_ACCESS_CLIENT_ID, this.env.SENTRY_ACCESS_CLIENT_SECRET, this.env.COLO_METADATA, this.env.CONFIG?.account_id, this.env.CONFIG?.script_id);
|
|
2536
|
+
let i = Ut(this.env.CONFIG), o = t.headers.get("user-agent") ?? "UA UNKNOWN", a = new URL(t.url);
|
|
2537
|
+
return this.env.COLO_METADATA && this.env.VERSION_METADATA && this.env.CONFIG && n.setData({ accountId: this.env.CONFIG.account_id, scriptId: this.env.CONFIG.script_id, coloId: this.env.COLO_METADATA.coloId, metalId: this.env.COLO_METADATA.metalId, coloTier: this.env.COLO_METADATA.coloTier, coloRegion: this.env.COLO_METADATA.coloRegion, version: this.env.VERSION_METADATA.id, hostname: a.hostname, htmlHandling: i.html_handling, notFoundHandling: i.not_found_handling, userAgent: o }), this.env.JAEGER.enterSpan("handleRequest", async (c) => (c.setTags({ hostname: a.hostname, eyeballPath: a.pathname, env: this.env.ENVIRONMENT, version: this.env.VERSION_METADATA?.id }), er(t, this.env, i, this.unstable_exists.bind(this), this.unstable_getByETag.bind(this)))).catch((c) => this.handleError(e, n, c)).finally(() => this.submitMetrics(n, r, s));
|
|
2543
2538
|
} catch (i) {
|
|
2544
2539
|
let o = this.handleError(e, n, i);
|
|
2545
2540
|
return this.submitMetrics(n, r, s), o;
|
|
@@ -2547,10 +2542,10 @@ var er = class extends Fs {
|
|
|
2547
2542
|
}
|
|
2548
2543
|
handleError(t, e, n) {
|
|
2549
2544
|
try {
|
|
2550
|
-
let r = new
|
|
2545
|
+
let r = new q(n);
|
|
2551
2546
|
return t && t.captureException(n), n instanceof Error && e.setData({ error: n.message }), r;
|
|
2552
2547
|
} catch (r) {
|
|
2553
|
-
return console.error("Error handling error", r), new
|
|
2548
|
+
return console.error("Error handling error", r), new q(r);
|
|
2554
2549
|
}
|
|
2555
2550
|
}
|
|
2556
2551
|
submitMetrics(t, e, n) {
|
|
@@ -2561,11 +2556,11 @@ var er = class extends Fs {
|
|
|
2561
2556
|
}
|
|
2562
2557
|
}
|
|
2563
2558
|
async unstable_canFetch(t) {
|
|
2564
|
-
let e = new URL(t.url), n =
|
|
2565
|
-
return await
|
|
2559
|
+
let e = new URL(t.url), n = Gt(e.pathname);
|
|
2560
|
+
return await Ze(n, { ...Ut(this.env.CONFIG), not_found_handling: "none" }, this.unstable_exists.bind(this)) !== null;
|
|
2566
2561
|
}
|
|
2567
2562
|
async unstable_getByETag(t) {
|
|
2568
|
-
let e = await
|
|
2563
|
+
let e = await tr(this.env.ASSETS_KV_NAMESPACE, t);
|
|
2569
2564
|
if (!e || !e.value) throw new Error(`Requested asset ${t} exists in the asset manifest but not in the KV namespace.`);
|
|
2570
2565
|
return { readableStream: e.value, contentType: e.metadata?.contentType ?? "application/octet-stream" };
|
|
2571
2566
|
}
|
|
@@ -2574,7 +2569,7 @@ var er = class extends Fs {
|
|
|
2574
2569
|
return e ? this.unstable_getByETag(e) : null;
|
|
2575
2570
|
}
|
|
2576
2571
|
async unstable_exists(t) {
|
|
2577
|
-
return await new
|
|
2572
|
+
return await new ze(this.env.ASSETS_MANIFEST).get(t);
|
|
2578
2573
|
}
|
|
2579
2574
|
};
|
|
2580
2575
|
|
|
@@ -2582,7 +2577,7 @@ var er = class extends Fs {
|
|
|
2582
2577
|
var UNKNOWN_HOST = "http://localhost";
|
|
2583
2578
|
|
|
2584
2579
|
// src/asset-workers/asset-worker.ts
|
|
2585
|
-
var CustomAssetWorker = class extends
|
|
2580
|
+
var CustomAssetWorker = class extends nr {
|
|
2586
2581
|
async fetch(request) {
|
|
2587
2582
|
const response = await super.fetch(request);
|
|
2588
2583
|
const modifiedResponse = new Response(response.body, response);
|