@cloudflare/vite-plugin 0.0.0-d7adb50fc → 0.0.0-ddaef2b9c
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/README.md +60 -34
- package/dist/asset-workers/asset-worker.js +825 -684
- package/dist/asset-workers/router-worker.js +697 -611
- package/dist/index.d.ts +8 -1
- package/dist/index.js +544 -349
- package/dist/runner-worker/index.js +15 -3
- package/package.json +14 -13
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
// ../workers-shared/dist/asset-worker.mjs
|
|
2
|
-
import { WorkerEntrypoint as
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
2
|
+
import { WorkerEntrypoint as zs } from "cloudflare:workers";
|
|
3
|
+
var mr = Object.defineProperty;
|
|
4
|
+
var hr = (t, e, n) => e in t ? mr(t, e, { enumerable: true, configurable: true, writable: true, value: n }) : t[e] = n;
|
|
5
|
+
var Se = (t, e, n) => (hr(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
6
|
+
var zt = (t, e, n) => {
|
|
7
7
|
if (!e.has(t)) throw TypeError("Cannot " + n);
|
|
8
8
|
};
|
|
9
|
-
var
|
|
10
|
-
var
|
|
9
|
+
var rt = (t, e, n) => (zt(t, e, "read from private field"), n ? n.call(t) : e.get(t));
|
|
10
|
+
var Vt = (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 Jt = (t, e, n, r) => (zt(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n);
|
|
15
|
+
var se = class {
|
|
16
16
|
constructor(e) {
|
|
17
17
|
this.performanceTimer = e;
|
|
18
18
|
}
|
|
@@ -20,83 +20,113 @@ var _e = class {
|
|
|
20
20
|
return this.performanceTimer ? this.performanceTimer.timeOrigin + this.performanceTimer.now() : Date.now();
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
var Te = class extends Response {
|
|
24
|
+
constructor(e, n) {
|
|
25
|
+
super(e, { ...n, status: 200 });
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
var ie = class extends Response {
|
|
29
|
+
constructor(...[e, n]) {
|
|
30
|
+
super(e, { ...n, status: 404, statusText: "Not Found" });
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var be = class extends Response {
|
|
34
|
+
constructor(...[e, n]) {
|
|
35
|
+
super(e, { ...n, status: 405, statusText: "Method Not Allowed" });
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var $ = class extends Response {
|
|
39
|
+
constructor(e, n) {
|
|
40
|
+
super(null, { ...n, status: 500 });
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
var xe = class extends Response {
|
|
44
|
+
constructor(...[e, n]) {
|
|
45
|
+
super(null, { ...n, status: 304, statusText: "Not Modified" });
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var Re = class extends Response {
|
|
49
|
+
constructor(e, n) {
|
|
50
|
+
super(null, { ...n, status: 307, statusText: "Temporary Redirect", headers: { ...n?.headers, Location: e } });
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var Kt = Object.prototype.toString;
|
|
54
|
+
function H(t) {
|
|
55
|
+
switch (Kt.call(t)) {
|
|
26
56
|
case "[object Error]":
|
|
27
57
|
case "[object Exception]":
|
|
28
58
|
case "[object DOMException]":
|
|
29
59
|
return true;
|
|
30
60
|
default:
|
|
31
|
-
return
|
|
61
|
+
return P(t, Error);
|
|
32
62
|
}
|
|
33
63
|
}
|
|
34
|
-
function
|
|
35
|
-
return
|
|
64
|
+
function Xt(t, e) {
|
|
65
|
+
return Kt.call(t) === `[object ${e}]`;
|
|
36
66
|
}
|
|
37
|
-
function
|
|
38
|
-
return
|
|
67
|
+
function J(t) {
|
|
68
|
+
return Xt(t, "String");
|
|
39
69
|
}
|
|
40
|
-
function
|
|
70
|
+
function Ie(t) {
|
|
41
71
|
return t === null || typeof t != "object" && typeof t != "function";
|
|
42
72
|
}
|
|
43
|
-
function
|
|
44
|
-
return
|
|
73
|
+
function N(t) {
|
|
74
|
+
return Xt(t, "Object");
|
|
45
75
|
}
|
|
46
|
-
function
|
|
47
|
-
return typeof Event < "u" &&
|
|
76
|
+
function st(t) {
|
|
77
|
+
return typeof Event < "u" && P(t, Event);
|
|
48
78
|
}
|
|
49
|
-
function
|
|
50
|
-
return typeof Element < "u" &&
|
|
79
|
+
function it(t) {
|
|
80
|
+
return typeof Element < "u" && P(t, Element);
|
|
51
81
|
}
|
|
52
|
-
function
|
|
82
|
+
function Y(t) {
|
|
53
83
|
return !!(t && t.then && typeof t.then == "function");
|
|
54
84
|
}
|
|
55
|
-
function
|
|
56
|
-
return
|
|
85
|
+
function ot(t) {
|
|
86
|
+
return N(t) && "nativeEvent" in t && "preventDefault" in t && "stopPropagation" in t;
|
|
57
87
|
}
|
|
58
|
-
function
|
|
88
|
+
function oe(t) {
|
|
59
89
|
return typeof t == "number" && t !== t;
|
|
60
90
|
}
|
|
61
|
-
function
|
|
91
|
+
function P(t, e) {
|
|
62
92
|
try {
|
|
63
93
|
return t instanceof e;
|
|
64
94
|
} catch {
|
|
65
95
|
return false;
|
|
66
96
|
}
|
|
67
97
|
}
|
|
68
|
-
function
|
|
98
|
+
function at(t) {
|
|
69
99
|
return !!(typeof t == "object" && t !== null && (t.__isVue || t._isVue));
|
|
70
100
|
}
|
|
71
|
-
function
|
|
101
|
+
function L(t, e = 0) {
|
|
72
102
|
return typeof t != "string" || e === 0 || t.length <= e ? t : `${t.slice(0, e)}...`;
|
|
73
103
|
}
|
|
74
|
-
function
|
|
104
|
+
function Ae(t) {
|
|
75
105
|
return t && t.Math == Math ? t : void 0;
|
|
76
106
|
}
|
|
77
|
-
var h = typeof globalThis == "object" &&
|
|
107
|
+
var h = typeof globalThis == "object" && Ae(globalThis) || typeof window == "object" && Ae(window) || typeof self == "object" && Ae(self) || typeof global == "object" && Ae(global) || /* @__PURE__ */ function() {
|
|
78
108
|
return this;
|
|
79
109
|
}() || {};
|
|
80
|
-
function
|
|
110
|
+
function D() {
|
|
81
111
|
return h;
|
|
82
112
|
}
|
|
83
|
-
function
|
|
113
|
+
function ae(t, e, n) {
|
|
84
114
|
let r = n || h, s = r.__SENTRY__ = r.__SENTRY__ || {};
|
|
85
115
|
return s[t] || (s[t] = e());
|
|
86
116
|
}
|
|
87
|
-
var
|
|
88
|
-
var
|
|
89
|
-
function
|
|
117
|
+
var ni = D();
|
|
118
|
+
var _r = 80;
|
|
119
|
+
function Zt(t, e = {}) {
|
|
90
120
|
if (!t) return "<unknown>";
|
|
91
121
|
try {
|
|
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 ||
|
|
93
|
-
for (; n && i++ < r && (u =
|
|
122
|
+
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 || _r;
|
|
123
|
+
for (; n && i++ < r && (u = gr(n, l), !(u === "html" || i > 1 && o + s.length * c + u.length >= d)); ) s.push(u), o += u.length, n = n.parentNode;
|
|
94
124
|
return s.reverse().join(a);
|
|
95
125
|
} catch {
|
|
96
126
|
return "<unknown>";
|
|
97
127
|
}
|
|
98
128
|
}
|
|
99
|
-
function
|
|
129
|
+
function gr(t, e) {
|
|
100
130
|
let n = t, r = [], s, i, o, a, c;
|
|
101
131
|
if (!n || !n.tagName) return "";
|
|
102
132
|
r.push(n.tagName.toLowerCase());
|
|
@@ -104,19 +134,19 @@ function ar(t, e) {
|
|
|
104
134
|
if (u && u.length) u.forEach((d) => {
|
|
105
135
|
r.push(`[${d[0]}="${d[1]}"]`);
|
|
106
136
|
});
|
|
107
|
-
else if (n.id && r.push(`#${n.id}`), s = n.className, s &&
|
|
137
|
+
else if (n.id && r.push(`#${n.id}`), s = n.className, s && J(s)) for (i = s.split(/\s+/), c = 0; c < i.length; c++) r.push(`.${i[c]}`);
|
|
108
138
|
let l = ["aria-label", "type", "name", "title", "alt"];
|
|
109
139
|
for (c = 0; c < l.length; c++) o = l[c], a = n.getAttribute(o), a && r.push(`[${o}="${a}"]`);
|
|
110
140
|
return r.join("");
|
|
111
141
|
}
|
|
112
|
-
var
|
|
113
|
-
var
|
|
114
|
-
var
|
|
115
|
-
function
|
|
142
|
+
var Er = "Sentry Logger ";
|
|
143
|
+
var ce = ["debug", "info", "warn", "error", "log", "assert", "trace"];
|
|
144
|
+
var K = {};
|
|
145
|
+
function Ne(t) {
|
|
116
146
|
if (!("console" in h)) return t();
|
|
117
|
-
let e = h.console, n = {}, r = Object.keys(
|
|
147
|
+
let e = h.console, n = {}, r = Object.keys(K);
|
|
118
148
|
r.forEach((s) => {
|
|
119
|
-
let i =
|
|
149
|
+
let i = K[s];
|
|
120
150
|
n[s] = e[s], e[s] = i;
|
|
121
151
|
});
|
|
122
152
|
try {
|
|
@@ -127,34 +157,34 @@ function ye(t) {
|
|
|
127
157
|
});
|
|
128
158
|
}
|
|
129
159
|
}
|
|
130
|
-
function
|
|
160
|
+
function yr() {
|
|
131
161
|
let t = false, e = { enable: () => {
|
|
132
162
|
t = true;
|
|
133
163
|
}, disable: () => {
|
|
134
164
|
t = false;
|
|
135
165
|
}, isEnabled: () => t };
|
|
136
|
-
return typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__ ?
|
|
166
|
+
return typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__ ? ce.forEach((n) => {
|
|
137
167
|
e[n] = (...r) => {
|
|
138
|
-
t &&
|
|
139
|
-
h.console[n](`${
|
|
168
|
+
t && Ne(() => {
|
|
169
|
+
h.console[n](`${Er}[${n}]:`, ...r);
|
|
140
170
|
});
|
|
141
171
|
};
|
|
142
|
-
}) :
|
|
172
|
+
}) : ce.forEach((n) => {
|
|
143
173
|
e[n] = () => {
|
|
144
174
|
};
|
|
145
175
|
}), e;
|
|
146
176
|
}
|
|
147
|
-
var f =
|
|
148
|
-
var
|
|
149
|
-
function
|
|
177
|
+
var f = yr();
|
|
178
|
+
var Sr = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;
|
|
179
|
+
function Tr(t) {
|
|
150
180
|
return t === "http" || t === "https";
|
|
151
181
|
}
|
|
152
|
-
function
|
|
182
|
+
function B(t, e = false) {
|
|
153
183
|
let { host: n, path: r, pass: s, port: i, projectId: o, protocol: a, publicKey: c } = t;
|
|
154
184
|
return `${a}://${c}${e && s ? `:${s}` : ""}@${n}${i ? `:${i}` : ""}/${r && `${r}/`}${o}`;
|
|
155
185
|
}
|
|
156
|
-
function
|
|
157
|
-
let e =
|
|
186
|
+
function Qt(t) {
|
|
187
|
+
let e = Sr.exec(t);
|
|
158
188
|
if (!e) {
|
|
159
189
|
console.error(`Invalid Sentry Dsn: ${t}`);
|
|
160
190
|
return;
|
|
@@ -164,88 +194,88 @@ function jt(t) {
|
|
|
164
194
|
let d = u.match(/^\d+/);
|
|
165
195
|
d && (u = d[0]);
|
|
166
196
|
}
|
|
167
|
-
return
|
|
197
|
+
return en({ host: i, pass: s, path: c, projectId: u, port: o, protocol: n, publicKey: r });
|
|
168
198
|
}
|
|
169
|
-
function
|
|
199
|
+
function en(t) {
|
|
170
200
|
return { protocol: t.protocol, publicKey: t.publicKey || "", pass: t.pass || "", host: t.host, port: t.port || "", path: t.path || "", projectId: t.projectId };
|
|
171
201
|
}
|
|
172
|
-
function
|
|
202
|
+
function br(t) {
|
|
173
203
|
if (!(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__)) return true;
|
|
174
204
|
let { port: e, projectId: n, protocol: r } = t;
|
|
175
|
-
return ["protocol", "publicKey", "host", "projectId"].find((o) => t[o] ? false : (f.error(`Invalid Sentry Dsn: ${o} missing`), true)) ? false : n.match(/^\d+$/) ?
|
|
205
|
+
return ["protocol", "publicKey", "host", "projectId"].find((o) => t[o] ? false : (f.error(`Invalid Sentry Dsn: ${o} missing`), true)) ? false : n.match(/^\d+$/) ? Tr(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
206
|
}
|
|
177
|
-
function
|
|
178
|
-
let e = typeof t == "string" ?
|
|
179
|
-
if (!(!e || !
|
|
207
|
+
function we(t) {
|
|
208
|
+
let e = typeof t == "string" ? Qt(t) : en(t);
|
|
209
|
+
if (!(!e || !br(e))) return e;
|
|
180
210
|
}
|
|
181
211
|
var T = class extends Error {
|
|
182
212
|
constructor(e, n = "warn") {
|
|
183
213
|
super(e), this.message = e, this.name = new.target.prototype.constructor.name, Object.setPrototypeOf(this, new.target.prototype), this.logLevel = n;
|
|
184
214
|
}
|
|
185
215
|
};
|
|
186
|
-
function
|
|
216
|
+
function w(t, e, n) {
|
|
187
217
|
if (!(e in t)) return;
|
|
188
218
|
let r = t[e], s = n(r);
|
|
189
|
-
typeof s == "function" &&
|
|
219
|
+
typeof s == "function" && rn(s, r), t[e] = s;
|
|
190
220
|
}
|
|
191
|
-
function
|
|
221
|
+
function X(t, e, n) {
|
|
192
222
|
try {
|
|
193
223
|
Object.defineProperty(t, e, { value: n, writable: true, configurable: true });
|
|
194
224
|
} catch {
|
|
195
225
|
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(`Failed to add non-enumerable property "${e}" to object`, t);
|
|
196
226
|
}
|
|
197
227
|
}
|
|
198
|
-
function
|
|
228
|
+
function rn(t, e) {
|
|
199
229
|
try {
|
|
200
230
|
let n = e.prototype || {};
|
|
201
|
-
t.prototype = e.prototype = n,
|
|
231
|
+
t.prototype = e.prototype = n, X(t, "__sentry_original__", e);
|
|
202
232
|
} catch {
|
|
203
233
|
}
|
|
204
234
|
}
|
|
205
|
-
function
|
|
235
|
+
function ut(t) {
|
|
206
236
|
return Object.keys(t).map((e) => `${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&");
|
|
207
237
|
}
|
|
208
|
-
function
|
|
209
|
-
if (
|
|
210
|
-
if (
|
|
211
|
-
let e = { type: t.type, target:
|
|
212
|
-
return typeof CustomEvent < "u" &&
|
|
238
|
+
function De(t) {
|
|
239
|
+
if (H(t)) return { message: t.message, name: t.name, stack: t.stack, ...nn(t) };
|
|
240
|
+
if (st(t)) {
|
|
241
|
+
let e = { type: t.type, target: tn(t.target), currentTarget: tn(t.currentTarget), ...nn(t) };
|
|
242
|
+
return typeof CustomEvent < "u" && P(t, CustomEvent) && (e.detail = t.detail), e;
|
|
213
243
|
} else return t;
|
|
214
244
|
}
|
|
215
|
-
function
|
|
245
|
+
function tn(t) {
|
|
216
246
|
try {
|
|
217
|
-
return
|
|
247
|
+
return it(t) ? Zt(t) : Object.prototype.toString.call(t);
|
|
218
248
|
} catch {
|
|
219
249
|
return "<unknown>";
|
|
220
250
|
}
|
|
221
251
|
}
|
|
222
|
-
function
|
|
252
|
+
function nn(t) {
|
|
223
253
|
if (typeof t == "object" && t !== null) {
|
|
224
254
|
let e = {};
|
|
225
255
|
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
|
|
226
256
|
return e;
|
|
227
257
|
} else return {};
|
|
228
258
|
}
|
|
229
|
-
function
|
|
230
|
-
let n = Object.keys(
|
|
259
|
+
function ue(t, e = 40) {
|
|
260
|
+
let n = Object.keys(De(t));
|
|
231
261
|
if (n.sort(), !n.length) return "[object has no keys]";
|
|
232
|
-
if (n[0].length >= e) return
|
|
262
|
+
if (n[0].length >= e) return L(n[0], e);
|
|
233
263
|
for (let r = n.length; r > 0; r--) {
|
|
234
264
|
let s = n.slice(0, r).join(", ");
|
|
235
|
-
if (!(s.length > e)) return r === n.length ? s :
|
|
265
|
+
if (!(s.length > e)) return r === n.length ? s : L(s, e);
|
|
236
266
|
}
|
|
237
267
|
return "";
|
|
238
268
|
}
|
|
239
269
|
function E(t) {
|
|
240
|
-
return
|
|
270
|
+
return ct(t, /* @__PURE__ */ new Map());
|
|
241
271
|
}
|
|
242
|
-
function
|
|
243
|
-
if (
|
|
272
|
+
function ct(t, e) {
|
|
273
|
+
if (N(t)) {
|
|
244
274
|
let n = e.get(t);
|
|
245
275
|
if (n !== void 0) return n;
|
|
246
276
|
let r = {};
|
|
247
277
|
e.set(t, r);
|
|
248
|
-
for (let s of Object.keys(t)) typeof t[s] < "u" && (r[s] =
|
|
278
|
+
for (let s of Object.keys(t)) typeof t[s] < "u" && (r[s] = ct(t[s], e));
|
|
249
279
|
return r;
|
|
250
280
|
}
|
|
251
281
|
if (Array.isArray(t)) {
|
|
@@ -253,15 +283,15 @@ function st(t, e) {
|
|
|
253
283
|
if (n !== void 0) return n;
|
|
254
284
|
let r = [];
|
|
255
285
|
return e.set(t, r), t.forEach((s) => {
|
|
256
|
-
r.push(
|
|
286
|
+
r.push(ct(s, e));
|
|
257
287
|
}), r;
|
|
258
288
|
}
|
|
259
289
|
return t;
|
|
260
290
|
}
|
|
261
|
-
function
|
|
291
|
+
function xr(t, e = false) {
|
|
262
292
|
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
293
|
}
|
|
264
|
-
function
|
|
294
|
+
function sn(t) {
|
|
265
295
|
let e = /^\s*[-]{4,}$/, n = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
|
|
266
296
|
return (r) => {
|
|
267
297
|
let s = r.match(n);
|
|
@@ -279,15 +309,15 @@ function Jt(t) {
|
|
|
279
309
|
}
|
|
280
310
|
o && (c = i, u = o), o === "<anonymous>" && (u = void 0, a = void 0), a === void 0 && (u = u || "<anonymous>", a = c ? `${c}.${u}` : u);
|
|
281
311
|
let l = s[2] && s[2].startsWith("file://") ? s[2].slice(7) : s[2], d = s[5] === "native";
|
|
282
|
-
return !l && s[5] && !d && (l = s[5]), { filename: l, module: t ? t(l) : void 0, function: a, lineno: parseInt(s[3], 10) || void 0, colno: parseInt(s[4], 10) || void 0, in_app:
|
|
312
|
+
return !l && s[5] && !d && (l = s[5]), { filename: l, module: t ? t(l) : void 0, function: a, lineno: parseInt(s[3], 10) || void 0, colno: parseInt(s[4], 10) || void 0, in_app: xr(l, d) };
|
|
283
313
|
}
|
|
284
314
|
if (r.match(e)) return { filename: r };
|
|
285
315
|
};
|
|
286
316
|
}
|
|
287
|
-
var
|
|
288
|
-
var
|
|
289
|
-
var
|
|
290
|
-
function
|
|
317
|
+
var cn = 50;
|
|
318
|
+
var on = /\(error: (.*)\)/;
|
|
319
|
+
var an = /captureMessage|captureException/;
|
|
320
|
+
function Oe(...t) {
|
|
291
321
|
let e = t.sort((n, r) => n[0] - r[0]).map((n) => n[1]);
|
|
292
322
|
return (n, r = 0) => {
|
|
293
323
|
let s = [], i = n.split(`
|
|
@@ -295,7 +325,7 @@ function be(...t) {
|
|
|
295
325
|
for (let o = r; o < i.length; o++) {
|
|
296
326
|
let a = i[o];
|
|
297
327
|
if (a.length > 1024) continue;
|
|
298
|
-
let c =
|
|
328
|
+
let c = on.test(a) ? a.replace(on, "$1") : a;
|
|
299
329
|
if (!c.match(/\S*Error: /)) {
|
|
300
330
|
for (let u of e) {
|
|
301
331
|
let l = u(c);
|
|
@@ -304,183 +334,183 @@ function be(...t) {
|
|
|
304
334
|
break;
|
|
305
335
|
}
|
|
306
336
|
}
|
|
307
|
-
if (s.length >=
|
|
337
|
+
if (s.length >= cn) break;
|
|
308
338
|
}
|
|
309
339
|
}
|
|
310
|
-
return
|
|
340
|
+
return un(s);
|
|
311
341
|
};
|
|
312
342
|
}
|
|
313
|
-
function
|
|
314
|
-
return Array.isArray(t) ?
|
|
343
|
+
function lt(t) {
|
|
344
|
+
return Array.isArray(t) ? Oe(...t) : t;
|
|
315
345
|
}
|
|
316
|
-
function
|
|
346
|
+
function un(t) {
|
|
317
347
|
if (!t.length) return [];
|
|
318
348
|
let e = Array.from(t);
|
|
319
|
-
return /sentryWrapped/.test(e[e.length - 1].function || "") && e.pop(), e.reverse(),
|
|
349
|
+
return /sentryWrapped/.test(e[e.length - 1].function || "") && e.pop(), e.reverse(), an.test(e[e.length - 1].function || "") && (e.pop(), an.test(e[e.length - 1].function || "") && e.pop()), e.slice(0, cn).map((n) => ({ ...n, filename: n.filename || e[e.length - 1].filename, function: n.function || "?" }));
|
|
320
350
|
}
|
|
321
|
-
var
|
|
322
|
-
function
|
|
351
|
+
var dt = "<anonymous>";
|
|
352
|
+
function de(t) {
|
|
323
353
|
try {
|
|
324
|
-
return !t || typeof t != "function" ?
|
|
354
|
+
return !t || typeof t != "function" ? dt : t.name || dt;
|
|
325
355
|
} catch {
|
|
326
|
-
return
|
|
356
|
+
return dt;
|
|
327
357
|
}
|
|
328
358
|
}
|
|
329
|
-
function
|
|
330
|
-
return [90,
|
|
359
|
+
function ft(t) {
|
|
360
|
+
return [90, sn(t)];
|
|
331
361
|
}
|
|
332
|
-
var
|
|
333
|
-
function
|
|
334
|
-
if (!("fetch" in
|
|
362
|
+
var pt = D();
|
|
363
|
+
function Rr() {
|
|
364
|
+
if (!("fetch" in pt)) return false;
|
|
335
365
|
try {
|
|
336
366
|
return new Headers(), new Request("http://www.example.com"), new Response(), true;
|
|
337
367
|
} catch {
|
|
338
368
|
return false;
|
|
339
369
|
}
|
|
340
370
|
}
|
|
341
|
-
function
|
|
371
|
+
function dn(t) {
|
|
342
372
|
return t && /^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString());
|
|
343
373
|
}
|
|
344
|
-
function
|
|
345
|
-
if (!
|
|
346
|
-
if (
|
|
347
|
-
let t = false, e =
|
|
374
|
+
function ln() {
|
|
375
|
+
if (!Rr()) return false;
|
|
376
|
+
if (dn(pt.fetch)) return true;
|
|
377
|
+
let t = false, e = pt.document;
|
|
348
378
|
if (e && typeof e.createElement == "function") try {
|
|
349
379
|
let n = e.createElement("iframe");
|
|
350
|
-
n.hidden = true, e.head.appendChild(n), n.contentWindow && n.contentWindow.fetch && (t =
|
|
380
|
+
n.hidden = true, e.head.appendChild(n), n.contentWindow && n.contentWindow.fetch && (t = dn(n.contentWindow.fetch)), e.head.removeChild(n);
|
|
351
381
|
} catch (n) {
|
|
352
382
|
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ", n);
|
|
353
383
|
}
|
|
354
384
|
return t;
|
|
355
385
|
}
|
|
356
|
-
var
|
|
357
|
-
function
|
|
358
|
-
let t =
|
|
386
|
+
var ve = D();
|
|
387
|
+
function fn() {
|
|
388
|
+
let t = ve.chrome, e = t && t.app && t.app.runtime, n = "history" in ve && !!ve.history.pushState && !!ve.history.replaceState;
|
|
359
389
|
return !e && n;
|
|
360
390
|
}
|
|
361
|
-
var y =
|
|
362
|
-
var
|
|
363
|
-
var
|
|
364
|
-
var
|
|
365
|
-
function
|
|
366
|
-
if (!
|
|
391
|
+
var y = D();
|
|
392
|
+
var le = "__sentry_xhr_v2__";
|
|
393
|
+
var fe = {};
|
|
394
|
+
var pn = {};
|
|
395
|
+
function Ir(t) {
|
|
396
|
+
if (!pn[t]) switch (pn[t] = true, t) {
|
|
367
397
|
case "console":
|
|
368
|
-
|
|
398
|
+
Ar();
|
|
369
399
|
break;
|
|
370
400
|
case "dom":
|
|
371
|
-
|
|
401
|
+
yn();
|
|
372
402
|
break;
|
|
373
403
|
case "xhr":
|
|
374
|
-
|
|
404
|
+
En();
|
|
375
405
|
break;
|
|
376
406
|
case "fetch":
|
|
377
|
-
|
|
407
|
+
Nr();
|
|
378
408
|
break;
|
|
379
409
|
case "history":
|
|
380
|
-
|
|
410
|
+
wr();
|
|
381
411
|
break;
|
|
382
412
|
case "error":
|
|
383
|
-
|
|
413
|
+
kr();
|
|
384
414
|
break;
|
|
385
415
|
case "unhandledrejection":
|
|
386
|
-
|
|
416
|
+
Cr();
|
|
387
417
|
break;
|
|
388
418
|
default:
|
|
389
419
|
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("unknown instrumentation type:", t);
|
|
390
420
|
return;
|
|
391
421
|
}
|
|
392
422
|
}
|
|
393
|
-
function
|
|
394
|
-
|
|
423
|
+
function Ue(t, e) {
|
|
424
|
+
fe[t] = fe[t] || [], fe[t].push(e), Ir(t);
|
|
395
425
|
}
|
|
396
|
-
function
|
|
397
|
-
if (!(!t || !
|
|
426
|
+
function O(t, e) {
|
|
427
|
+
if (!(!t || !fe[t])) for (let n of fe[t] || []) try {
|
|
398
428
|
n(e);
|
|
399
429
|
} catch (r) {
|
|
400
430
|
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.error(`Error while triggering instrumentation handler.
|
|
401
431
|
Type: ${t}
|
|
402
|
-
Name: ${
|
|
432
|
+
Name: ${de(n)}
|
|
403
433
|
Error:`, r);
|
|
404
434
|
}
|
|
405
435
|
}
|
|
406
|
-
function
|
|
407
|
-
"console" in h &&
|
|
408
|
-
t in h.console &&
|
|
409
|
-
return
|
|
410
|
-
|
|
411
|
-
let r =
|
|
436
|
+
function Ar() {
|
|
437
|
+
"console" in h && ce.forEach(function(t) {
|
|
438
|
+
t in h.console && w(h.console, t, function(e) {
|
|
439
|
+
return K[t] = e, function(...n) {
|
|
440
|
+
O("console", { args: n, level: t });
|
|
441
|
+
let r = K[t];
|
|
412
442
|
r && r.apply(h.console, n);
|
|
413
443
|
};
|
|
414
444
|
});
|
|
415
445
|
});
|
|
416
446
|
}
|
|
417
|
-
function
|
|
418
|
-
|
|
447
|
+
function Nr() {
|
|
448
|
+
ln() && w(h, "fetch", function(t) {
|
|
419
449
|
return function(...e) {
|
|
420
|
-
let { method: n, url: r } =
|
|
421
|
-
return
|
|
422
|
-
throw
|
|
450
|
+
let { method: n, url: r } = gn(e), s = { args: e, fetchData: { method: n, url: r }, startTimestamp: Date.now() };
|
|
451
|
+
return O("fetch", { ...s }), t.apply(h, e).then((i) => (O("fetch", { ...s, endTimestamp: Date.now(), response: i }), i), (i) => {
|
|
452
|
+
throw O("fetch", { ...s, endTimestamp: Date.now(), error: i }), i;
|
|
423
453
|
});
|
|
424
454
|
};
|
|
425
455
|
});
|
|
426
456
|
}
|
|
427
|
-
function
|
|
457
|
+
function mt(t, e) {
|
|
428
458
|
return !!t && typeof t == "object" && !!t[e];
|
|
429
459
|
}
|
|
430
|
-
function
|
|
431
|
-
return typeof t == "string" ? t : t ?
|
|
460
|
+
function mn(t) {
|
|
461
|
+
return typeof t == "string" ? t : t ? mt(t, "url") ? t.url : t.toString ? t.toString() : "" : "";
|
|
432
462
|
}
|
|
433
|
-
function
|
|
463
|
+
function gn(t) {
|
|
434
464
|
if (t.length === 0) return { method: "GET", url: "" };
|
|
435
465
|
if (t.length === 2) {
|
|
436
466
|
let [n, r] = t;
|
|
437
|
-
return { url:
|
|
467
|
+
return { url: mn(n), method: mt(r, "method") ? String(r.method).toUpperCase() : "GET" };
|
|
438
468
|
}
|
|
439
469
|
let e = t[0];
|
|
440
|
-
return { url:
|
|
470
|
+
return { url: mn(e), method: mt(e, "method") ? String(e.method).toUpperCase() : "GET" };
|
|
441
471
|
}
|
|
442
|
-
function
|
|
472
|
+
function En() {
|
|
443
473
|
if (!y.XMLHttpRequest) return;
|
|
444
474
|
let t = XMLHttpRequest.prototype;
|
|
445
|
-
|
|
475
|
+
w(t, "open", function(e) {
|
|
446
476
|
return function(...n) {
|
|
447
|
-
let r = Date.now(), s = n[1], i = this[
|
|
448
|
-
|
|
477
|
+
let r = Date.now(), s = n[1], i = this[le] = { method: J(n[0]) ? n[0].toUpperCase() : n[0], url: n[1], request_headers: {} };
|
|
478
|
+
J(s) && i.method === "POST" && s.match(/sentry_key/) && (this.__sentry_own_request__ = true);
|
|
449
479
|
let o = () => {
|
|
450
|
-
let a = this[
|
|
480
|
+
let a = this[le];
|
|
451
481
|
if (a && this.readyState === 4) {
|
|
452
482
|
try {
|
|
453
483
|
a.status_code = this.status;
|
|
454
484
|
} catch {
|
|
455
485
|
}
|
|
456
|
-
|
|
486
|
+
O("xhr", { args: n, endTimestamp: Date.now(), startTimestamp: r, xhr: this });
|
|
457
487
|
}
|
|
458
488
|
};
|
|
459
|
-
return "onreadystatechange" in this && typeof this.onreadystatechange == "function" ?
|
|
489
|
+
return "onreadystatechange" in this && typeof this.onreadystatechange == "function" ? w(this, "onreadystatechange", function(a) {
|
|
460
490
|
return function(...c) {
|
|
461
491
|
return o(), a.apply(this, c);
|
|
462
492
|
};
|
|
463
|
-
}) : this.addEventListener("readystatechange", o),
|
|
493
|
+
}) : this.addEventListener("readystatechange", o), w(this, "setRequestHeader", function(a) {
|
|
464
494
|
return function(...c) {
|
|
465
|
-
let [u, l] = c, d = this[
|
|
495
|
+
let [u, l] = c, d = this[le];
|
|
466
496
|
return d && (d.request_headers[u.toLowerCase()] = l), a.apply(this, c);
|
|
467
497
|
};
|
|
468
498
|
}), e.apply(this, n);
|
|
469
499
|
};
|
|
470
|
-
}),
|
|
500
|
+
}), w(t, "send", function(e) {
|
|
471
501
|
return function(...n) {
|
|
472
|
-
let r = this[
|
|
473
|
-
return r && n[0] !== void 0 && (r.body = n[0]),
|
|
502
|
+
let r = this[le];
|
|
503
|
+
return r && n[0] !== void 0 && (r.body = n[0]), O("xhr", { args: n, startTimestamp: Date.now(), xhr: this }), e.apply(this, n);
|
|
474
504
|
};
|
|
475
505
|
});
|
|
476
506
|
}
|
|
477
|
-
var
|
|
478
|
-
function
|
|
479
|
-
if (!
|
|
507
|
+
var ke;
|
|
508
|
+
function wr() {
|
|
509
|
+
if (!fn()) return;
|
|
480
510
|
let t = y.onpopstate;
|
|
481
511
|
y.onpopstate = function(...n) {
|
|
482
|
-
let r = y.location.href, s =
|
|
483
|
-
if (
|
|
512
|
+
let r = y.location.href, s = ke;
|
|
513
|
+
if (ke = r, O("history", { from: s, to: r }), t) try {
|
|
484
514
|
return t.apply(this, n);
|
|
485
515
|
} catch {
|
|
486
516
|
}
|
|
@@ -489,18 +519,18 @@ function Er() {
|
|
|
489
519
|
return function(...r) {
|
|
490
520
|
let s = r.length > 2 ? r[2] : void 0;
|
|
491
521
|
if (s) {
|
|
492
|
-
let i =
|
|
493
|
-
|
|
522
|
+
let i = ke, o = String(s);
|
|
523
|
+
ke = o, O("history", { from: i, to: o });
|
|
494
524
|
}
|
|
495
525
|
return n.apply(this, r);
|
|
496
526
|
};
|
|
497
527
|
}
|
|
498
|
-
|
|
528
|
+
w(y.history, "pushState", e), w(y.history, "replaceState", e);
|
|
499
529
|
}
|
|
500
|
-
var
|
|
501
|
-
var
|
|
502
|
-
var
|
|
503
|
-
function
|
|
530
|
+
var Dr = 1e3;
|
|
531
|
+
var hn;
|
|
532
|
+
var Ce;
|
|
533
|
+
function Or(t, e) {
|
|
504
534
|
if (t.type !== e.type) return false;
|
|
505
535
|
try {
|
|
506
536
|
if (t.target !== e.target) return false;
|
|
@@ -508,7 +538,7 @@ function Sr(t, e) {
|
|
|
508
538
|
}
|
|
509
539
|
return true;
|
|
510
540
|
}
|
|
511
|
-
function
|
|
541
|
+
function vr(t) {
|
|
512
542
|
if (t.type !== "keypress") return false;
|
|
513
543
|
try {
|
|
514
544
|
let e = t.target;
|
|
@@ -518,27 +548,27 @@ function Tr(t) {
|
|
|
518
548
|
}
|
|
519
549
|
return true;
|
|
520
550
|
}
|
|
521
|
-
function
|
|
551
|
+
function _n(t, e = false) {
|
|
522
552
|
return (n) => {
|
|
523
|
-
if (!n || n._sentryCaptured ||
|
|
524
|
-
|
|
553
|
+
if (!n || n._sentryCaptured || vr(n)) return;
|
|
554
|
+
X(n, "_sentryCaptured", true);
|
|
525
555
|
let r = n.type === "keypress" ? "input" : n.type;
|
|
526
|
-
(
|
|
527
|
-
|
|
528
|
-
},
|
|
556
|
+
(Ce === void 0 || !Or(Ce, n)) && (t({ event: n, name: r, global: e }), Ce = n), clearTimeout(hn), hn = y.setTimeout(() => {
|
|
557
|
+
Ce = void 0;
|
|
558
|
+
}, Dr);
|
|
529
559
|
};
|
|
530
560
|
}
|
|
531
|
-
function
|
|
561
|
+
function yn() {
|
|
532
562
|
if (!y.document) return;
|
|
533
|
-
let t =
|
|
563
|
+
let t = O.bind(null, "dom"), e = _n(t, true);
|
|
534
564
|
y.document.addEventListener("click", e, false), y.document.addEventListener("keypress", e, false), ["EventTarget", "Node"].forEach((n) => {
|
|
535
565
|
let r = y[n] && y[n].prototype;
|
|
536
|
-
!r || !r.hasOwnProperty || !r.hasOwnProperty("addEventListener") || (
|
|
566
|
+
!r || !r.hasOwnProperty || !r.hasOwnProperty("addEventListener") || (w(r, "addEventListener", function(s) {
|
|
537
567
|
return function(i, o, a) {
|
|
538
568
|
if (i === "click" || i == "keypress") try {
|
|
539
569
|
let c = this, u = c.__sentry_instrumentation_handlers__ = c.__sentry_instrumentation_handlers__ || {}, l = u[i] = u[i] || { refCount: 0 };
|
|
540
570
|
if (!l.handler) {
|
|
541
|
-
let d =
|
|
571
|
+
let d = _n(t);
|
|
542
572
|
l.handler = d, s.call(this, i, d, a);
|
|
543
573
|
}
|
|
544
574
|
l.refCount++;
|
|
@@ -546,7 +576,7 @@ function dn() {
|
|
|
546
576
|
}
|
|
547
577
|
return s.call(this, i, o, a);
|
|
548
578
|
};
|
|
549
|
-
}),
|
|
579
|
+
}), w(r, "removeEventListener", function(s) {
|
|
550
580
|
return function(i, o, a) {
|
|
551
581
|
if (i === "click" || i == "keypress") try {
|
|
552
582
|
let c = this, u = c.__sentry_instrumentation_handlers__ || {}, l = u[i];
|
|
@@ -558,28 +588,28 @@ function dn() {
|
|
|
558
588
|
}));
|
|
559
589
|
});
|
|
560
590
|
}
|
|
561
|
-
var
|
|
562
|
-
function
|
|
563
|
-
|
|
564
|
-
return
|
|
591
|
+
var Pe = null;
|
|
592
|
+
function kr() {
|
|
593
|
+
Pe = y.onerror, y.onerror = function(t, e, n, r, s) {
|
|
594
|
+
return O("error", { column: r, error: s, line: n, msg: t, url: e }), Pe && !Pe.__SENTRY_LOADER__ ? Pe.apply(this, arguments) : false;
|
|
565
595
|
}, y.onerror.__SENTRY_INSTRUMENTED__ = true;
|
|
566
596
|
}
|
|
567
|
-
var
|
|
568
|
-
function
|
|
569
|
-
|
|
570
|
-
return
|
|
597
|
+
var Me = null;
|
|
598
|
+
function Cr() {
|
|
599
|
+
Me = y.onunhandledrejection, y.onunhandledrejection = function(t) {
|
|
600
|
+
return O("unhandledrejection", t), Me && !Me.__SENTRY_LOADER__ ? Me.apply(this, arguments) : true;
|
|
571
601
|
}, y.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;
|
|
572
602
|
}
|
|
573
|
-
function
|
|
603
|
+
function Sn() {
|
|
574
604
|
return typeof __SENTRY_BROWSER_BUNDLE__ < "u" && !!__SENTRY_BROWSER_BUNDLE__;
|
|
575
605
|
}
|
|
576
|
-
function
|
|
577
|
-
return !
|
|
606
|
+
function Tn() {
|
|
607
|
+
return !Sn() && Object.prototype.toString.call(typeof process < "u" ? process : 0) === "[object process]";
|
|
578
608
|
}
|
|
579
|
-
function
|
|
609
|
+
function bn(t, e) {
|
|
580
610
|
return t.require(e);
|
|
581
611
|
}
|
|
582
|
-
function
|
|
612
|
+
function xn() {
|
|
583
613
|
let t = typeof WeakSet == "function", e = t ? /* @__PURE__ */ new WeakSet() : [];
|
|
584
614
|
function n(s) {
|
|
585
615
|
if (t) return e.has(s) ? true : (e.add(s), false);
|
|
@@ -604,15 +634,15 @@ function g() {
|
|
|
604
634
|
}
|
|
605
635
|
return ("10000000100040008000" + 1e11).replace(/[018]/g, (r) => (r ^ (n() & 15) >> r / 4).toString(16));
|
|
606
636
|
}
|
|
607
|
-
function
|
|
637
|
+
function Pr(t) {
|
|
608
638
|
return t.exception && t.exception.values ? t.exception.values[0] : void 0;
|
|
609
639
|
}
|
|
610
|
-
function
|
|
640
|
+
function pe(t, e, n) {
|
|
611
641
|
let r = t.exception = t.exception || {}, s = r.values = r.values || [], i = s[0] = s[0] || {};
|
|
612
642
|
i.value || (i.value = e || ""), i.type || (i.type = n || "Error");
|
|
613
643
|
}
|
|
614
|
-
function
|
|
615
|
-
let n =
|
|
644
|
+
function me(t, e) {
|
|
645
|
+
let n = Pr(t);
|
|
616
646
|
if (!n) return;
|
|
617
647
|
let r = { type: "generic", handled: true }, s = n.mechanism;
|
|
618
648
|
if (n.mechanism = { ...r, ...s, ...e }, e && "data" in e) {
|
|
@@ -620,32 +650,32 @@ function ce(t, e) {
|
|
|
620
650
|
n.mechanism.data = i;
|
|
621
651
|
}
|
|
622
652
|
}
|
|
623
|
-
function
|
|
653
|
+
function Le(t) {
|
|
624
654
|
if (t && t.__sentry_captured__) return true;
|
|
625
655
|
try {
|
|
626
|
-
|
|
656
|
+
X(t, "__sentry_captured__", true);
|
|
627
657
|
} catch {
|
|
628
658
|
}
|
|
629
659
|
return false;
|
|
630
660
|
}
|
|
631
|
-
function
|
|
661
|
+
function he(t) {
|
|
632
662
|
return Array.isArray(t) ? t : [t];
|
|
633
663
|
}
|
|
634
|
-
function
|
|
664
|
+
function v(t, e = 100, n = 1 / 0) {
|
|
635
665
|
try {
|
|
636
|
-
return
|
|
666
|
+
return Be("", t, e, n);
|
|
637
667
|
} catch (r) {
|
|
638
668
|
return { ERROR: `**non-serializable** (${r})` };
|
|
639
669
|
}
|
|
640
670
|
}
|
|
641
|
-
function
|
|
642
|
-
let r =
|
|
643
|
-
return
|
|
671
|
+
function Z(t, e = 3, n = 100 * 1024) {
|
|
672
|
+
let r = v(t, e);
|
|
673
|
+
return Br(r) > n ? Z(t, e - 1, n) : r;
|
|
644
674
|
}
|
|
645
|
-
function
|
|
675
|
+
function Be(t, e, n = 1 / 0, r = 1 / 0, s = xn()) {
|
|
646
676
|
let [i, o] = s;
|
|
647
|
-
if (e == null || ["number", "boolean", "string"].includes(typeof e) && !
|
|
648
|
-
let a =
|
|
677
|
+
if (e == null || ["number", "boolean", "string"].includes(typeof e) && !oe(e)) return e;
|
|
678
|
+
let a = Mr(t, e);
|
|
649
679
|
if (!a.startsWith("[object ")) return a;
|
|
650
680
|
if (e.__sentry_skip_normalization__) return e;
|
|
651
681
|
let c = typeof e.__sentry_override_normalization_depth__ == "number" ? e.__sentry_override_normalization_depth__ : n;
|
|
@@ -654,80 +684,115 @@ function Oe(t, e, n = 1 / 0, r = 1 / 0, s = mn()) {
|
|
|
654
684
|
let u = e;
|
|
655
685
|
if (u && typeof u.toJSON == "function") try {
|
|
656
686
|
let m = u.toJSON();
|
|
657
|
-
return
|
|
687
|
+
return Be("", m, c - 1, r, s);
|
|
658
688
|
} catch {
|
|
659
689
|
}
|
|
660
|
-
let l = Array.isArray(e) ? [] : {}, d = 0, p =
|
|
690
|
+
let l = Array.isArray(e) ? [] : {}, d = 0, p = De(e);
|
|
661
691
|
for (let m in p) {
|
|
662
692
|
if (!Object.prototype.hasOwnProperty.call(p, m)) continue;
|
|
663
693
|
if (d >= r) {
|
|
664
694
|
l[m] = "[MaxProperties ~]";
|
|
665
695
|
break;
|
|
666
696
|
}
|
|
667
|
-
let
|
|
668
|
-
l[m] =
|
|
697
|
+
let I = p[m];
|
|
698
|
+
l[m] = Be(m, I, c - 1, r, s), d++;
|
|
669
699
|
}
|
|
670
700
|
return o(e), l;
|
|
671
701
|
}
|
|
672
|
-
function
|
|
702
|
+
function Mr(t, e) {
|
|
673
703
|
try {
|
|
674
704
|
if (t === "domain" && e && typeof e == "object" && e._events) return "[Domain]";
|
|
675
705
|
if (t === "domainEmitter") return "[DomainEmitter]";
|
|
676
706
|
if (typeof global < "u" && e === global) return "[Global]";
|
|
677
707
|
if (typeof window < "u" && e === window) return "[Window]";
|
|
678
708
|
if (typeof document < "u" && e === document) return "[Document]";
|
|
679
|
-
if (
|
|
680
|
-
if (
|
|
709
|
+
if (at(e)) return "[VueViewModel]";
|
|
710
|
+
if (ot(e)) return "[SyntheticEvent]";
|
|
681
711
|
if (typeof e == "number" && e !== e) return "[NaN]";
|
|
682
|
-
if (typeof e == "function") return `[Function: ${
|
|
712
|
+
if (typeof e == "function") return `[Function: ${de(e)}]`;
|
|
683
713
|
if (typeof e == "symbol") return `[${String(e)}]`;
|
|
684
714
|
if (typeof e == "bigint") return `[BigInt: ${String(e)}]`;
|
|
685
|
-
let n =
|
|
715
|
+
let n = Ur(e);
|
|
686
716
|
return /^HTML(\w*)Element$/.test(n) ? `[HTMLElement: ${n}]` : `[object ${n}]`;
|
|
687
717
|
} catch (n) {
|
|
688
718
|
return `**non-serializable** (${n})`;
|
|
689
719
|
}
|
|
690
720
|
}
|
|
691
|
-
function
|
|
721
|
+
function Ur(t) {
|
|
692
722
|
let e = Object.getPrototypeOf(t);
|
|
693
723
|
return e ? e.constructor.name : "null prototype";
|
|
694
724
|
}
|
|
695
|
-
function
|
|
725
|
+
function Lr(t) {
|
|
696
726
|
return ~-encodeURI(t).split(/%..|./).length;
|
|
697
727
|
}
|
|
698
|
-
function
|
|
699
|
-
return
|
|
728
|
+
function Br(t) {
|
|
729
|
+
return Lr(JSON.stringify(t));
|
|
700
730
|
}
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
let
|
|
731
|
+
function Gr(t, e) {
|
|
732
|
+
let n = 0;
|
|
733
|
+
for (let r = t.length - 1; r >= 0; r--) {
|
|
734
|
+
let s = t[r];
|
|
735
|
+
s === "." ? t.splice(r, 1) : s === ".." ? (t.splice(r, 1), n++) : n && (t.splice(r, 1), n--);
|
|
736
|
+
}
|
|
737
|
+
if (e) for (; n--; n) t.unshift("..");
|
|
738
|
+
return t;
|
|
739
|
+
}
|
|
740
|
+
var Fr = /^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;
|
|
741
|
+
function $r(t) {
|
|
742
|
+
let e = t.length > 1024 ? `<truncated>${t.slice(-1024)}` : t, n = Fr.exec(e);
|
|
704
743
|
return n ? n.slice(1) : [];
|
|
705
744
|
}
|
|
706
|
-
function
|
|
707
|
-
let n =
|
|
745
|
+
function ht(...t) {
|
|
746
|
+
let e = "", n = false;
|
|
747
|
+
for (let r = t.length - 1; r >= -1 && !n; r--) {
|
|
748
|
+
let s = r >= 0 ? t[r] : "/";
|
|
749
|
+
s && (e = `${s}/${e}`, n = s.charAt(0) === "/");
|
|
750
|
+
}
|
|
751
|
+
return e = Gr(e.split("/").filter((r) => !!r), !n).join("/"), (n ? "/" : "") + e || ".";
|
|
752
|
+
}
|
|
753
|
+
function Rn(t) {
|
|
754
|
+
let e = 0;
|
|
755
|
+
for (; e < t.length && t[e] === ""; e++) ;
|
|
756
|
+
let n = t.length - 1;
|
|
757
|
+
for (; n >= 0 && t[n] === ""; n--) ;
|
|
758
|
+
return e > n ? [] : t.slice(e, n - e + 1);
|
|
759
|
+
}
|
|
760
|
+
function _t(t, e) {
|
|
761
|
+
t = ht(t).slice(1), e = ht(e).slice(1);
|
|
762
|
+
let n = Rn(t.split("/")), r = Rn(e.split("/")), s = Math.min(n.length, r.length), i = s;
|
|
763
|
+
for (let a = 0; a < s; a++) if (n[a] !== r[a]) {
|
|
764
|
+
i = a;
|
|
765
|
+
break;
|
|
766
|
+
}
|
|
767
|
+
let o = [];
|
|
768
|
+
for (let a = i; a < n.length; a++) o.push("..");
|
|
769
|
+
return o = o.concat(r.slice(i)), o.join("/");
|
|
770
|
+
}
|
|
771
|
+
function _e(t, e) {
|
|
772
|
+
let n = $r(t)[2];
|
|
708
773
|
return e && n.slice(e.length * -1) === e && (n = n.slice(0, n.length - e.length)), n;
|
|
709
774
|
}
|
|
710
|
-
var
|
|
775
|
+
var M;
|
|
711
776
|
(function(t) {
|
|
712
777
|
t[t.PENDING = 0] = "PENDING";
|
|
713
778
|
let n = 1;
|
|
714
779
|
t[t.RESOLVED = n] = "RESOLVED";
|
|
715
780
|
let r = 2;
|
|
716
781
|
t[t.REJECTED = r] = "REJECTED";
|
|
717
|
-
})(
|
|
782
|
+
})(M || (M = {}));
|
|
718
783
|
function b(t) {
|
|
719
784
|
return new S((e) => {
|
|
720
785
|
e(t);
|
|
721
786
|
});
|
|
722
787
|
}
|
|
723
|
-
function
|
|
788
|
+
function j(t) {
|
|
724
789
|
return new S((e, n) => {
|
|
725
790
|
n(t);
|
|
726
791
|
});
|
|
727
792
|
}
|
|
728
793
|
var S = class {
|
|
729
794
|
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 =
|
|
795
|
+
S.prototype.__init.call(this), S.prototype.__init2.call(this), S.prototype.__init3.call(this), S.prototype.__init4.call(this), this._state = M.PENDING, this._handlers = [];
|
|
731
796
|
try {
|
|
732
797
|
e(this._resolve, this._reject);
|
|
733
798
|
} catch (n) {
|
|
@@ -774,18 +839,18 @@ var S = class {
|
|
|
774
839
|
}
|
|
775
840
|
__init() {
|
|
776
841
|
this._resolve = (e) => {
|
|
777
|
-
this._setResult(
|
|
842
|
+
this._setResult(M.RESOLVED, e);
|
|
778
843
|
};
|
|
779
844
|
}
|
|
780
845
|
__init2() {
|
|
781
846
|
this._reject = (e) => {
|
|
782
|
-
this._setResult(
|
|
847
|
+
this._setResult(M.REJECTED, e);
|
|
783
848
|
};
|
|
784
849
|
}
|
|
785
850
|
__init3() {
|
|
786
851
|
this._setResult = (e, n) => {
|
|
787
|
-
if (this._state ===
|
|
788
|
-
if (
|
|
852
|
+
if (this._state === M.PENDING) {
|
|
853
|
+
if (Y(n)) {
|
|
789
854
|
n.then(this._resolve, this._reject);
|
|
790
855
|
return;
|
|
791
856
|
}
|
|
@@ -795,15 +860,15 @@ var S = class {
|
|
|
795
860
|
}
|
|
796
861
|
__init4() {
|
|
797
862
|
this._executeHandlers = () => {
|
|
798
|
-
if (this._state ===
|
|
863
|
+
if (this._state === M.PENDING) return;
|
|
799
864
|
let e = this._handlers.slice();
|
|
800
865
|
this._handlers = [], e.forEach((n) => {
|
|
801
|
-
n[0] || (this._state ===
|
|
866
|
+
n[0] || (this._state === M.RESOLVED && n[1](this._value), this._state === M.REJECTED && n[2](this._value), n[0] = true);
|
|
802
867
|
});
|
|
803
868
|
};
|
|
804
869
|
}
|
|
805
870
|
};
|
|
806
|
-
function
|
|
871
|
+
function gt(t) {
|
|
807
872
|
let e = [];
|
|
808
873
|
function n() {
|
|
809
874
|
return t === void 0 || e.length < t;
|
|
@@ -812,7 +877,7 @@ function ft(t) {
|
|
|
812
877
|
return e.splice(e.indexOf(o), 1)[0];
|
|
813
878
|
}
|
|
814
879
|
function s(o) {
|
|
815
|
-
if (!n()) return
|
|
880
|
+
if (!n()) return j(new T("Not adding Promise because buffer limit was reached."));
|
|
816
881
|
let a = o();
|
|
817
882
|
return e.indexOf(a) === -1 && e.push(a), a.then(() => r(a)).then(null, () => r(a).then(null, () => {
|
|
818
883
|
})), a;
|
|
@@ -833,48 +898,48 @@ function ft(t) {
|
|
|
833
898
|
}
|
|
834
899
|
return { $: e, add: s, drain: i };
|
|
835
900
|
}
|
|
836
|
-
var
|
|
837
|
-
var
|
|
838
|
-
function
|
|
839
|
-
let { performance: t } =
|
|
901
|
+
var An = D();
|
|
902
|
+
var yt = { nowSeconds: () => Date.now() / 1e3 };
|
|
903
|
+
function Hr() {
|
|
904
|
+
let { performance: t } = An;
|
|
840
905
|
if (!t || !t.now) return;
|
|
841
906
|
let e = Date.now() - t.now();
|
|
842
907
|
return { now: () => t.now(), timeOrigin: e };
|
|
843
908
|
}
|
|
844
|
-
function
|
|
909
|
+
function Yr() {
|
|
845
910
|
try {
|
|
846
|
-
return
|
|
911
|
+
return bn(module, "perf_hooks").performance;
|
|
847
912
|
} catch {
|
|
848
913
|
return;
|
|
849
914
|
}
|
|
850
915
|
}
|
|
851
|
-
var
|
|
852
|
-
var
|
|
853
|
-
var
|
|
854
|
-
var
|
|
855
|
-
var
|
|
856
|
-
var
|
|
857
|
-
let { performance: t } =
|
|
916
|
+
var Et = Tn() ? Yr() : Hr();
|
|
917
|
+
var In = Et === void 0 ? yt : { nowSeconds: () => (Et.timeOrigin + Et.now()) / 1e3 };
|
|
918
|
+
var q = yt.nowSeconds.bind(yt);
|
|
919
|
+
var W = In.nowSeconds.bind(In);
|
|
920
|
+
var ge;
|
|
921
|
+
var jr = (() => {
|
|
922
|
+
let { performance: t } = An;
|
|
858
923
|
if (!t || !t.now) {
|
|
859
|
-
|
|
924
|
+
ge = "none";
|
|
860
925
|
return;
|
|
861
926
|
}
|
|
862
927
|
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 ? (
|
|
928
|
+
return i || u ? s <= c ? (ge = "timeOrigin", t.timeOrigin) : (ge = "navigationStart", o) : (ge = "dateNow", r);
|
|
864
929
|
})();
|
|
865
|
-
var
|
|
866
|
-
function
|
|
930
|
+
var qr = new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");
|
|
931
|
+
function St(t = g(), e = g().substring(16), n) {
|
|
867
932
|
let r = "";
|
|
868
933
|
return n !== void 0 && (r = n ? "-1" : "-0"), `${t}-${e}${r}`;
|
|
869
934
|
}
|
|
870
|
-
function
|
|
935
|
+
function G(t, e = []) {
|
|
871
936
|
return [t, e];
|
|
872
937
|
}
|
|
873
|
-
function
|
|
938
|
+
function bt(t, e) {
|
|
874
939
|
let [n, r] = t;
|
|
875
940
|
return [n, [...r, e]];
|
|
876
941
|
}
|
|
877
|
-
function
|
|
942
|
+
function Ge(t, e) {
|
|
878
943
|
let n = t[1];
|
|
879
944
|
for (let r of n) {
|
|
880
945
|
let s = r[0].type;
|
|
@@ -882,13 +947,13 @@ function ve(t, e) {
|
|
|
882
947
|
}
|
|
883
948
|
return false;
|
|
884
949
|
}
|
|
885
|
-
function
|
|
950
|
+
function Tt(t, e) {
|
|
886
951
|
return (e || new TextEncoder()).encode(t);
|
|
887
952
|
}
|
|
888
|
-
function
|
|
953
|
+
function xt(t, e) {
|
|
889
954
|
let [n, r] = t, s = JSON.stringify(n);
|
|
890
955
|
function i(o) {
|
|
891
|
-
typeof s == "string" ? s = typeof o == "string" ? s + o : [
|
|
956
|
+
typeof s == "string" ? s = typeof o == "string" ? s + o : [Tt(s, e), o] : s.push(typeof o == "string" ? Tt(o, e) : o);
|
|
892
957
|
}
|
|
893
958
|
for (let o of r) {
|
|
894
959
|
let [a, c] = o;
|
|
@@ -900,117 +965,156 @@ ${JSON.stringify(a)}
|
|
|
900
965
|
try {
|
|
901
966
|
u = JSON.stringify(c);
|
|
902
967
|
} catch {
|
|
903
|
-
u = JSON.stringify(
|
|
968
|
+
u = JSON.stringify(v(c));
|
|
904
969
|
}
|
|
905
970
|
i(u);
|
|
906
971
|
}
|
|
907
972
|
}
|
|
908
|
-
return typeof s == "string" ? s :
|
|
973
|
+
return typeof s == "string" ? s : Wr(s);
|
|
909
974
|
}
|
|
910
|
-
function
|
|
975
|
+
function Wr(t) {
|
|
911
976
|
let e = t.reduce((s, i) => s + i.length, 0), n = new Uint8Array(e), r = 0;
|
|
912
977
|
for (let s of t) n.set(s, r), r += s.length;
|
|
913
978
|
return n;
|
|
914
979
|
}
|
|
915
|
-
function
|
|
916
|
-
let n = typeof t.data == "string" ?
|
|
980
|
+
function Rt(t, e) {
|
|
981
|
+
let n = typeof t.data == "string" ? Tt(t.data, e) : t.data;
|
|
917
982
|
return [E({ type: "attachment", length: n.length, filename: t.filename, content_type: t.contentType, attachment_type: t.attachmentType }), n];
|
|
918
983
|
}
|
|
919
|
-
var
|
|
920
|
-
function
|
|
921
|
-
return
|
|
984
|
+
var zr = { 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" };
|
|
985
|
+
function Fe(t) {
|
|
986
|
+
return zr[t];
|
|
922
987
|
}
|
|
923
|
-
function
|
|
988
|
+
function $e(t) {
|
|
924
989
|
if (!t || !t.sdk) return;
|
|
925
990
|
let { name: e, version: n } = t.sdk;
|
|
926
991
|
return { name: e, version: n };
|
|
927
992
|
}
|
|
928
|
-
function
|
|
993
|
+
function It(t, e, n, r) {
|
|
929
994
|
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:
|
|
995
|
+
return { event_id: t.event_id, sent_at: (/* @__PURE__ */ new Date()).toISOString(), ...e && { sdk: e }, ...!!n && r && { dsn: B(r) }, ...s && { trace: E({ ...s }) } };
|
|
931
996
|
}
|
|
932
|
-
function
|
|
997
|
+
function Nn(t, e = Date.now()) {
|
|
933
998
|
let n = parseInt(`${t}`, 10);
|
|
934
999
|
if (!isNaN(n)) return n * 1e3;
|
|
935
1000
|
let r = Date.parse(`${t}`);
|
|
936
1001
|
return isNaN(r) ? 6e4 : r - e;
|
|
937
1002
|
}
|
|
938
|
-
function
|
|
1003
|
+
function wn(t, e) {
|
|
939
1004
|
return t[e] || t.all || 0;
|
|
940
1005
|
}
|
|
941
|
-
function
|
|
942
|
-
return
|
|
1006
|
+
function At(t, e, n = Date.now()) {
|
|
1007
|
+
return wn(t, e) > n;
|
|
943
1008
|
}
|
|
944
|
-
function
|
|
1009
|
+
function Nt(t, { statusCode: e, headers: n }, r = Date.now()) {
|
|
945
1010
|
let s = { ...t }, i = n && n["x-sentry-rate-limits"], o = n && n["retry-after"];
|
|
946
1011
|
if (i) for (let a of i.trim().split(",")) {
|
|
947
1012
|
let [c, u] = a.split(":", 2), l = parseInt(c, 10), d = (isNaN(l) ? 60 : l) * 1e3;
|
|
948
1013
|
if (!u) s.all = r + d;
|
|
949
1014
|
else for (let p of u.split(";")) s[p] = r + d;
|
|
950
1015
|
}
|
|
951
|
-
else o ? s.all = r +
|
|
1016
|
+
else o ? s.all = r + Nn(o, r) : e === 429 && (s.all = r + 60 * 1e3);
|
|
952
1017
|
return s;
|
|
953
1018
|
}
|
|
954
|
-
function
|
|
1019
|
+
function wt(t, e) {
|
|
955
1020
|
return t(e.stack || "", 1);
|
|
956
1021
|
}
|
|
957
|
-
function
|
|
958
|
-
let n = { type: e.name || e.constructor.name, value: e.message }, r =
|
|
1022
|
+
function Dn(t, e) {
|
|
1023
|
+
let n = { type: e.name || e.constructor.name, value: e.message }, r = wt(t, e);
|
|
959
1024
|
return r.length && (n.stacktrace = { frames: r }), n;
|
|
960
1025
|
}
|
|
961
|
-
function
|
|
1026
|
+
function Vr(t) {
|
|
962
1027
|
if ("name" in t && typeof t.name == "string") {
|
|
963
1028
|
let e = `'${t.name}' captured as exception`;
|
|
964
1029
|
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: ${
|
|
1030
|
+
} else return "message" in t && typeof t.message == "string" ? t.message : `Object captured as exception with keys: ${ue(t)}`;
|
|
966
1031
|
}
|
|
967
|
-
function
|
|
1032
|
+
function Dt(t, e, n, r) {
|
|
968
1033
|
let s = n, o = r && r.data && r.data.mechanism || { handled: true, type: "generic" };
|
|
969
|
-
if (!
|
|
970
|
-
if (
|
|
1034
|
+
if (!H(n)) {
|
|
1035
|
+
if (N(n)) {
|
|
971
1036
|
let c = t(), u = c.getClient(), l = u && u.getOptions().normalizeDepth;
|
|
972
1037
|
c.configureScope((p) => {
|
|
973
|
-
p.setExtra("__serialized__",
|
|
1038
|
+
p.setExtra("__serialized__", Z(n, l));
|
|
974
1039
|
});
|
|
975
|
-
let d =
|
|
1040
|
+
let d = Vr(n);
|
|
976
1041
|
s = r && r.syntheticException || new Error(d), s.message = d;
|
|
977
1042
|
} else s = r && r.syntheticException || new Error(n), s.message = n;
|
|
978
1043
|
o.synthetic = true;
|
|
979
1044
|
}
|
|
980
|
-
let a = { exception: { values: [
|
|
981
|
-
return
|
|
1045
|
+
let a = { exception: { values: [Dn(e, s)] } };
|
|
1046
|
+
return pe(a, void 0, void 0), me(a, o), { ...a, event_id: r && r.event_id };
|
|
982
1047
|
}
|
|
983
|
-
function
|
|
1048
|
+
function Ot(t, e, n = "info", r, s) {
|
|
984
1049
|
let i = { event_id: r && r.event_id, level: n, message: e };
|
|
985
1050
|
if (s && r && r.syntheticException) {
|
|
986
|
-
let o =
|
|
1051
|
+
let o = wt(t, r.syntheticException);
|
|
987
1052
|
o.length && (i.exception = { values: [{ value: e, stacktrace: { frames: o } }] });
|
|
988
1053
|
}
|
|
989
1054
|
return i;
|
|
990
1055
|
}
|
|
991
|
-
var
|
|
992
|
-
|
|
993
|
-
|
|
1056
|
+
var C = class {
|
|
1057
|
+
static __initStatic() {
|
|
1058
|
+
this.id = "RewriteFrames";
|
|
1059
|
+
}
|
|
1060
|
+
constructor(e = {}) {
|
|
1061
|
+
C.prototype.__init.call(this), this.name = C.id, e.root && (this._root = e.root), this._prefix = e.prefix || "app:///", e.iteratee && (this._iteratee = e.iteratee);
|
|
1062
|
+
}
|
|
1063
|
+
setupOnce(e, n) {
|
|
1064
|
+
}
|
|
1065
|
+
processEvent(e) {
|
|
1066
|
+
return this.process(e);
|
|
1067
|
+
}
|
|
1068
|
+
process(e) {
|
|
1069
|
+
let n = e;
|
|
1070
|
+
return e.exception && Array.isArray(e.exception.values) && (n = this._processExceptionsEvent(n)), n;
|
|
1071
|
+
}
|
|
1072
|
+
__init() {
|
|
1073
|
+
this._iteratee = (e) => {
|
|
1074
|
+
if (!e.filename) return e;
|
|
1075
|
+
let n = /^[a-zA-Z]:\\/.test(e.filename) || e.filename.includes("\\") && !e.filename.includes("/"), r = /^\//.test(e.filename);
|
|
1076
|
+
if (n || r) {
|
|
1077
|
+
let s = n ? e.filename.replace(/^[a-zA-Z]:/, "").replace(/\\/g, "/") : e.filename, i = this._root ? _t(this._root, s) : _e(s);
|
|
1078
|
+
e.filename = `${this._prefix}${i}`;
|
|
1079
|
+
}
|
|
1080
|
+
return e;
|
|
1081
|
+
};
|
|
1082
|
+
}
|
|
1083
|
+
_processExceptionsEvent(e) {
|
|
1084
|
+
try {
|
|
1085
|
+
return { ...e, exception: { ...e.exception, values: e.exception.values.map((n) => ({ ...n, ...n.stacktrace && { stacktrace: this._processStacktrace(n.stacktrace) } })) } };
|
|
1086
|
+
} catch {
|
|
1087
|
+
return e;
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
_processStacktrace(e) {
|
|
1091
|
+
return { ...e, frames: e && e.frames && e.frames.map((n) => this._iteratee(n)) };
|
|
1092
|
+
}
|
|
1093
|
+
};
|
|
1094
|
+
C.__initStatic();
|
|
1095
|
+
var Q = "production";
|
|
1096
|
+
function Ee() {
|
|
1097
|
+
return ae("globalEventProcessors", () => []);
|
|
994
1098
|
}
|
|
995
|
-
function
|
|
996
|
-
|
|
1099
|
+
function On(t) {
|
|
1100
|
+
Ee().push(t);
|
|
997
1101
|
}
|
|
998
|
-
function
|
|
1102
|
+
function ee(t, e, n, r = 0) {
|
|
999
1103
|
return new S((s, i) => {
|
|
1000
1104
|
let o = t[r];
|
|
1001
1105
|
if (e === null || typeof o != "function") s(e);
|
|
1002
1106
|
else {
|
|
1003
1107
|
let a = o({ ...e }, n);
|
|
1004
|
-
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && o.id && a === null && f.log(`Event processor "${o.id}" dropped event`),
|
|
1108
|
+
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && o.id && a === null && f.log(`Event processor "${o.id}" dropped event`), Y(a) ? a.then((c) => ee(t, c, n, r + 1).then(s)).then(null, i) : ee(t, a, n, r + 1).then(s).then(null, i);
|
|
1005
1109
|
}
|
|
1006
1110
|
});
|
|
1007
1111
|
}
|
|
1008
|
-
function
|
|
1009
|
-
let e =
|
|
1010
|
-
return t &&
|
|
1112
|
+
function vn(t) {
|
|
1113
|
+
let e = W(), n = { sid: g(), init: true, timestamp: e, started: e, duration: 0, status: "ok", errors: 0, ignoreDuration: false, toJSON: () => Jr(n) };
|
|
1114
|
+
return t && U(n, t), n;
|
|
1011
1115
|
}
|
|
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 ||
|
|
1116
|
+
function U(t, e = {}) {
|
|
1117
|
+
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 || W(), 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
1118
|
else if (typeof e.duration == "number") t.duration = e.duration;
|
|
1015
1119
|
else {
|
|
1016
1120
|
let n = t.timestamp - t.started;
|
|
@@ -1018,20 +1122,20 @@ function C(t, e = {}) {
|
|
|
1018
1122
|
}
|
|
1019
1123
|
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
1124
|
}
|
|
1021
|
-
function
|
|
1125
|
+
function kn(t, e) {
|
|
1022
1126
|
let n = {};
|
|
1023
|
-
e ? n = { status: e } : t.status === "ok" && (n = { status: "exited" }),
|
|
1127
|
+
e ? n = { status: e } : t.status === "ok" && (n = { status: "exited" }), U(t, n);
|
|
1024
1128
|
}
|
|
1025
|
-
function
|
|
1129
|
+
function Jr(t) {
|
|
1026
1130
|
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
1131
|
}
|
|
1028
|
-
var
|
|
1029
|
-
var
|
|
1132
|
+
var Kr = 100;
|
|
1133
|
+
var k = class {
|
|
1030
1134
|
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 =
|
|
1135
|
+
this._notifyingListeners = false, this._scopeListeners = [], this._eventProcessors = [], this._breadcrumbs = [], this._attachments = [], this._user = {}, this._tags = {}, this._extra = {}, this._contexts = {}, this._sdkProcessingMetadata = {}, this._propagationContext = Cn();
|
|
1032
1136
|
}
|
|
1033
1137
|
static clone(e) {
|
|
1034
|
-
let n = new
|
|
1138
|
+
let n = new k();
|
|
1035
1139
|
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
1140
|
}
|
|
1037
1141
|
addScopeListener(e) {
|
|
@@ -1041,7 +1145,7 @@ var w = class {
|
|
|
1041
1145
|
return this._eventProcessors.push(e), this;
|
|
1042
1146
|
}
|
|
1043
1147
|
setUser(e) {
|
|
1044
|
-
return this._user = e || {}, this._session &&
|
|
1148
|
+
return this._user = e || {}, this._session && U(this._session, { user: e }), this._notifyScopeListeners(), this;
|
|
1045
1149
|
}
|
|
1046
1150
|
getUser() {
|
|
1047
1151
|
return this._user;
|
|
@@ -1096,17 +1200,17 @@ var w = class {
|
|
|
1096
1200
|
if (!e) return this;
|
|
1097
1201
|
if (typeof e == "function") {
|
|
1098
1202
|
let n = e(this);
|
|
1099
|
-
return n instanceof
|
|
1203
|
+
return n instanceof k ? n : this;
|
|
1100
1204
|
}
|
|
1101
|
-
return e instanceof
|
|
1205
|
+
return e instanceof k ? (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)) : N(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
1206
|
}
|
|
1103
1207
|
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 =
|
|
1208
|
+
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 = Cn(), this;
|
|
1105
1209
|
}
|
|
1106
1210
|
addBreadcrumb(e, n) {
|
|
1107
|
-
let r = typeof n == "number" ? n :
|
|
1211
|
+
let r = typeof n == "number" ? n : Kr;
|
|
1108
1212
|
if (r <= 0) return this;
|
|
1109
|
-
let s = { timestamp:
|
|
1213
|
+
let s = { timestamp: q(), ...e }, i = this._breadcrumbs;
|
|
1110
1214
|
return i.push(s), this._breadcrumbs = i.length > r ? i.slice(-r) : i, this._notifyScopeListeners(), this;
|
|
1111
1215
|
}
|
|
1112
1216
|
getLastBreadcrumb() {
|
|
@@ -1136,7 +1240,7 @@ var w = class {
|
|
|
1136
1240
|
}
|
|
1137
1241
|
this._applyFingerprint(e);
|
|
1138
1242
|
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 },
|
|
1243
|
+
return e.breadcrumbs = i.length > 0 ? i : void 0, e.sdkProcessingMetadata = { ...e.sdkProcessingMetadata, ...this._sdkProcessingMetadata, propagationContext: this._propagationContext }, ee([...r || [], ...Ee(), ...this._eventProcessors], e, n);
|
|
1140
1244
|
}
|
|
1141
1245
|
setSDKProcessingMetadata(e) {
|
|
1142
1246
|
return this._sdkProcessingMetadata = { ...this._sdkProcessingMetadata, ...e }, this;
|
|
@@ -1156,16 +1260,16 @@ var w = class {
|
|
|
1156
1260
|
}), this._notifyingListeners = false);
|
|
1157
1261
|
}
|
|
1158
1262
|
_applyFingerprint(e) {
|
|
1159
|
-
e.fingerprint = e.fingerprint ?
|
|
1263
|
+
e.fingerprint = e.fingerprint ? he(e.fingerprint) : [], this._fingerprint && (e.fingerprint = e.fingerprint.concat(this._fingerprint)), e.fingerprint && !e.fingerprint.length && delete e.fingerprint;
|
|
1160
1264
|
}
|
|
1161
1265
|
};
|
|
1162
|
-
function
|
|
1266
|
+
function Cn() {
|
|
1163
1267
|
return { traceId: g(), spanId: g().substring(16) };
|
|
1164
1268
|
}
|
|
1165
|
-
var
|
|
1166
|
-
var
|
|
1167
|
-
var
|
|
1168
|
-
constructor(e, n = new
|
|
1269
|
+
var Pn = 4;
|
|
1270
|
+
var Xr = 100;
|
|
1271
|
+
var z = class {
|
|
1272
|
+
constructor(e, n = new k(), r = Pn) {
|
|
1169
1273
|
this._version = r, this._stack = [{ scope: n }], e && this.bindClient(e);
|
|
1170
1274
|
}
|
|
1171
1275
|
isOlderThan(e) {
|
|
@@ -1176,7 +1280,7 @@ var H = class {
|
|
|
1176
1280
|
n.client = e, e && e.setupIntegrations && e.setupIntegrations();
|
|
1177
1281
|
}
|
|
1178
1282
|
pushScope() {
|
|
1179
|
-
let e =
|
|
1283
|
+
let e = k.clone(this.getScope());
|
|
1180
1284
|
return this.getStack().push({ client: this.getClient(), scope: e }), e;
|
|
1181
1285
|
}
|
|
1182
1286
|
popScope() {
|
|
@@ -1226,9 +1330,9 @@ var H = class {
|
|
|
1226
1330
|
addBreadcrumb(e, n) {
|
|
1227
1331
|
let { scope: r, client: s } = this.getStackTop();
|
|
1228
1332
|
if (!s) return;
|
|
1229
|
-
let { beforeBreadcrumb: i = null, maxBreadcrumbs: o =
|
|
1333
|
+
let { beforeBreadcrumb: i = null, maxBreadcrumbs: o = Xr } = s.getOptions && s.getOptions() || {};
|
|
1230
1334
|
if (o <= 0) return;
|
|
1231
|
-
let c = { timestamp:
|
|
1335
|
+
let c = { timestamp: q(), ...e }, u = i ? Ne(() => i(c, n)) : c;
|
|
1232
1336
|
u !== null && (s.emit && s.emit("beforeAddBreadcrumb", u, n), r.addBreadcrumb(u, o));
|
|
1233
1337
|
}
|
|
1234
1338
|
setUser(e) {
|
|
@@ -1254,11 +1358,11 @@ var H = class {
|
|
|
1254
1358
|
r && e(n);
|
|
1255
1359
|
}
|
|
1256
1360
|
run(e) {
|
|
1257
|
-
let n =
|
|
1361
|
+
let n = vt(this);
|
|
1258
1362
|
try {
|
|
1259
1363
|
e(this);
|
|
1260
1364
|
} finally {
|
|
1261
|
-
|
|
1365
|
+
vt(n);
|
|
1262
1366
|
}
|
|
1263
1367
|
}
|
|
1264
1368
|
getIntegration(e) {
|
|
@@ -1290,11 +1394,11 @@ Sentry.init({...});
|
|
|
1290
1394
|
}
|
|
1291
1395
|
endSession() {
|
|
1292
1396
|
let n = this.getStackTop().scope, r = n.getSession();
|
|
1293
|
-
r &&
|
|
1397
|
+
r && kn(r), this._sendSessionUpdate(), n.setSession();
|
|
1294
1398
|
}
|
|
1295
1399
|
startSession(e) {
|
|
1296
|
-
let { scope: n, client: r } = this.getStackTop(), { release: s, environment: i =
|
|
1297
|
-
return c && c.status === "ok" &&
|
|
1400
|
+
let { scope: n, client: r } = this.getStackTop(), { release: s, environment: i = Q } = r && r.getOptions() || {}, { userAgent: o } = h.navigator || {}, a = vn({ release: s, environment: i, user: n.getUser(), ...o && { userAgent: o }, ...e }), c = n.getSession && n.getSession();
|
|
1401
|
+
return c && c.status === "ok" && U(c, { status: "exited" }), this.endSession(), n.setSession(a), a;
|
|
1298
1402
|
}
|
|
1299
1403
|
shouldSendDefaultPii() {
|
|
1300
1404
|
let e = this.getClient(), n = e && e.getOptions();
|
|
@@ -1309,56 +1413,56 @@ Sentry.init({...});
|
|
|
1309
1413
|
r && e(r, n);
|
|
1310
1414
|
}
|
|
1311
1415
|
_callExtensionMethod(e, ...n) {
|
|
1312
|
-
let s =
|
|
1416
|
+
let s = V().__SENTRY__;
|
|
1313
1417
|
if (s && s.extensions && typeof s.extensions[e] == "function") return s.extensions[e].apply(this, n);
|
|
1314
1418
|
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn(`Extension method ${e} couldn't be found, doing nothing.`);
|
|
1315
1419
|
}
|
|
1316
1420
|
};
|
|
1317
|
-
function
|
|
1421
|
+
function V() {
|
|
1318
1422
|
return h.__SENTRY__ = h.__SENTRY__ || { extensions: {}, hub: void 0 }, h;
|
|
1319
1423
|
}
|
|
1320
|
-
function
|
|
1321
|
-
let e =
|
|
1322
|
-
return
|
|
1424
|
+
function vt(t) {
|
|
1425
|
+
let e = V(), n = He(e);
|
|
1426
|
+
return kt(e, t), n;
|
|
1323
1427
|
}
|
|
1324
|
-
function
|
|
1325
|
-
let t =
|
|
1428
|
+
function x() {
|
|
1429
|
+
let t = V();
|
|
1326
1430
|
if (t.__SENTRY__ && t.__SENTRY__.acs) {
|
|
1327
1431
|
let e = t.__SENTRY__.acs.getCurrentHub();
|
|
1328
1432
|
if (e) return e;
|
|
1329
1433
|
}
|
|
1330
|
-
return
|
|
1434
|
+
return Zr(t);
|
|
1331
1435
|
}
|
|
1332
|
-
function
|
|
1333
|
-
return (!
|
|
1436
|
+
function Zr(t = V()) {
|
|
1437
|
+
return (!Qr(t) || He(t).isOlderThan(Pn)) && kt(t, new z()), He(t);
|
|
1334
1438
|
}
|
|
1335
|
-
function
|
|
1439
|
+
function Qr(t) {
|
|
1336
1440
|
return !!(t && t.__SENTRY__ && t.__SENTRY__.hub);
|
|
1337
1441
|
}
|
|
1338
|
-
function
|
|
1339
|
-
return
|
|
1442
|
+
function He(t) {
|
|
1443
|
+
return ae("hub", () => new z(), t);
|
|
1340
1444
|
}
|
|
1341
|
-
function
|
|
1445
|
+
function kt(t, e) {
|
|
1342
1446
|
if (!t) return false;
|
|
1343
1447
|
let n = t.__SENTRY__ = t.__SENTRY__ || {};
|
|
1344
1448
|
return n.hub = e, true;
|
|
1345
1449
|
}
|
|
1346
|
-
function
|
|
1347
|
-
return (t ||
|
|
1450
|
+
function Mn(t) {
|
|
1451
|
+
return (t || x()).getScope().getTransaction();
|
|
1348
1452
|
}
|
|
1349
|
-
var
|
|
1350
|
-
function
|
|
1351
|
-
|
|
1453
|
+
var Un = false;
|
|
1454
|
+
function Ln() {
|
|
1455
|
+
Un || (Un = true, Ue("error", Ct), Ue("unhandledrejection", Ct));
|
|
1352
1456
|
}
|
|
1353
|
-
function
|
|
1354
|
-
let t =
|
|
1457
|
+
function Ct() {
|
|
1458
|
+
let t = Mn();
|
|
1355
1459
|
if (t) {
|
|
1356
1460
|
let e = "internal_error";
|
|
1357
1461
|
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(`[Tracing] Transaction: ${e} -> Global error occured`), t.setStatus(e);
|
|
1358
1462
|
}
|
|
1359
1463
|
}
|
|
1360
|
-
|
|
1361
|
-
var
|
|
1464
|
+
Ct.tag = "sentry_tracingErrorCallback";
|
|
1465
|
+
var Ye = class {
|
|
1362
1466
|
constructor(e = 1e3) {
|
|
1363
1467
|
this._maxlen = e, this.spans = [];
|
|
1364
1468
|
}
|
|
@@ -1366,9 +1470,9 @@ var Me = class {
|
|
|
1366
1470
|
this.spans.length > this._maxlen ? e.spanRecorder = void 0 : this.spans.push(e);
|
|
1367
1471
|
}
|
|
1368
1472
|
};
|
|
1369
|
-
var
|
|
1473
|
+
var te = class {
|
|
1370
1474
|
constructor(e = {}) {
|
|
1371
|
-
this.traceId = e.traceId || g(), this.spanId = e.spanId || g().substring(16), this.startTimestamp = e.startTimestamp ||
|
|
1475
|
+
this.traceId = e.traceId || g(), this.spanId = e.spanId || g().substring(16), this.startTimestamp = e.startTimestamp || W(), 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
1476
|
}
|
|
1373
1477
|
get name() {
|
|
1374
1478
|
return this.description || "";
|
|
@@ -1377,7 +1481,7 @@ var X = class {
|
|
|
1377
1481
|
this.setName(e);
|
|
1378
1482
|
}
|
|
1379
1483
|
startChild(e) {
|
|
1380
|
-
let n = new
|
|
1484
|
+
let n = new te({ ...e, parentSpanId: this.spanId, sampled: this.sampled, traceId: this.traceId });
|
|
1381
1485
|
if (n.spanRecorder = this.spanRecorder, n.spanRecorder && n.spanRecorder.add(n), n.transaction = this.transaction, (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && n.transaction) {
|
|
1382
1486
|
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
1487
|
n.transaction.metadata.spanMetadata[n.spanId] = { logMessage: o }, f.log(o);
|
|
@@ -1395,7 +1499,7 @@ var X = class {
|
|
|
1395
1499
|
}
|
|
1396
1500
|
setHttpStatus(e) {
|
|
1397
1501
|
this.setTag("http.status_code", String(e)), this.setData("http.response.status_code", e);
|
|
1398
|
-
let n =
|
|
1502
|
+
let n = es(e);
|
|
1399
1503
|
return n !== "unknown_error" && this.setStatus(n), this;
|
|
1400
1504
|
}
|
|
1401
1505
|
setName(e) {
|
|
@@ -1409,10 +1513,10 @@ var X = class {
|
|
|
1409
1513
|
let { logMessage: n } = this.transaction.metadata.spanMetadata[this.spanId];
|
|
1410
1514
|
n && f.log(n.replace("Starting", "Finishing"));
|
|
1411
1515
|
}
|
|
1412
|
-
this.endTimestamp = typeof e == "number" ? e :
|
|
1516
|
+
this.endTimestamp = typeof e == "number" ? e : W();
|
|
1413
1517
|
}
|
|
1414
1518
|
toTraceparent() {
|
|
1415
|
-
return
|
|
1519
|
+
return St(this.traceId, this.spanId, this.sampled);
|
|
1416
1520
|
}
|
|
1417
1521
|
toContext() {
|
|
1418
1522
|
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 });
|
|
@@ -1427,7 +1531,7 @@ var X = class {
|
|
|
1427
1531
|
return E({ data: Object.keys(this.data).length > 0 ? this.data : void 0, description: this.description, op: this.op, parent_span_id: this.parentSpanId, span_id: this.spanId, start_timestamp: this.startTimestamp, status: this.status, tags: Object.keys(this.tags).length > 0 ? this.tags : void 0, timestamp: this.endTimestamp, trace_id: this.traceId, origin: this.origin });
|
|
1428
1532
|
}
|
|
1429
1533
|
};
|
|
1430
|
-
function
|
|
1534
|
+
function es(t) {
|
|
1431
1535
|
if (t < 400 && t >= 100) return "ok";
|
|
1432
1536
|
if (t >= 400 && t < 500) switch (t) {
|
|
1433
1537
|
case 401:
|
|
@@ -1457,13 +1561,13 @@ function Yr(t) {
|
|
|
1457
1561
|
}
|
|
1458
1562
|
return "unknown_error";
|
|
1459
1563
|
}
|
|
1460
|
-
function
|
|
1461
|
-
let r = e.getOptions(), { publicKey: s } = e.getDsn() || {}, { segment: i } = n && n.getUser() || {}, o = E({ environment: r.environment ||
|
|
1564
|
+
function ne(t, e, n) {
|
|
1565
|
+
let r = e.getOptions(), { publicKey: s } = e.getDsn() || {}, { segment: i } = n && n.getUser() || {}, o = E({ environment: r.environment || Q, release: r.release, user_segment: i, public_key: s, trace_id: t });
|
|
1462
1566
|
return e.emit && e.emit("createDsc", o), o;
|
|
1463
1567
|
}
|
|
1464
|
-
var
|
|
1568
|
+
var je = class extends te {
|
|
1465
1569
|
constructor(e, n) {
|
|
1466
|
-
super(e), delete this.description, this._measurements = {}, this._contexts = {}, this._hub = n ||
|
|
1570
|
+
super(e), delete this.description, this._measurements = {}, this._contexts = {}, this._hub = n || x(), this._name = e.name || "", this.metadata = { source: "custom", ...e.metadata, spanMetadata: {} }, this._trimEnd = e.trimEnd, this.transaction = this;
|
|
1467
1571
|
let r = this.metadata.dynamicSamplingContext;
|
|
1468
1572
|
r && (this._frozenDynamicSamplingContext = { ...r });
|
|
1469
1573
|
}
|
|
@@ -1477,7 +1581,7 @@ var Ue = class extends X {
|
|
|
1477
1581
|
this._name = e, this.metadata.source = n;
|
|
1478
1582
|
}
|
|
1479
1583
|
initSpanRecorder(e = 1e3) {
|
|
1480
|
-
this.spanRecorder || (this.spanRecorder = new
|
|
1584
|
+
this.spanRecorder || (this.spanRecorder = new Ye(e)), this.spanRecorder.add(this);
|
|
1481
1585
|
}
|
|
1482
1586
|
setContext(e, n) {
|
|
1483
1587
|
n === null ? delete this._contexts[e] : this._contexts[e] = n;
|
|
@@ -1501,9 +1605,9 @@ var Ue = class extends X {
|
|
|
1501
1605
|
}
|
|
1502
1606
|
getDynamicSamplingContext() {
|
|
1503
1607
|
if (this._frozenDynamicSamplingContext) return this._frozenDynamicSamplingContext;
|
|
1504
|
-
let e = this._hub ||
|
|
1608
|
+
let e = this._hub || x(), n = e.getClient();
|
|
1505
1609
|
if (!n) return {};
|
|
1506
|
-
let r = e.getScope(), s =
|
|
1610
|
+
let r = e.getScope(), s = ne(this.traceId, n, r), i = this.metadata.sampleRate;
|
|
1507
1611
|
i !== void 0 && (s.sample_rate = `${i}`);
|
|
1508
1612
|
let o = this.metadata.source;
|
|
1509
1613
|
return o && o !== "url" && (s.transaction = this.name), this.sampled !== void 0 && (s.sampled = String(this.sampled)), s;
|
|
@@ -1525,36 +1629,36 @@ var Ue = class extends X {
|
|
|
1525
1629
|
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
1630
|
}
|
|
1527
1631
|
};
|
|
1528
|
-
function
|
|
1632
|
+
function Bn(t) {
|
|
1529
1633
|
if (typeof __SENTRY_TRACING__ == "boolean" && !__SENTRY_TRACING__) return false;
|
|
1530
|
-
let e =
|
|
1634
|
+
let e = x().getClient(), n = t || e && e.getOptions();
|
|
1531
1635
|
return !!n && (n.enableTracing || "tracesSampleRate" in n || "tracesSampler" in n);
|
|
1532
1636
|
}
|
|
1533
|
-
function
|
|
1534
|
-
if (!
|
|
1637
|
+
function Gn(t, e, n) {
|
|
1638
|
+
if (!Bn(e)) return t.sampled = false, t;
|
|
1535
1639
|
if (t.sampled !== void 0) return t.setMetadata({ sampleRate: Number(t.sampled) }), t;
|
|
1536
1640
|
let r;
|
|
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 })),
|
|
1641
|
+
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 })), ts(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
1642
|
}
|
|
1539
|
-
function
|
|
1540
|
-
return
|
|
1643
|
+
function ts(t) {
|
|
1644
|
+
return oe(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
1645
|
}
|
|
1542
|
-
function
|
|
1646
|
+
function ns() {
|
|
1543
1647
|
let e = this.getScope().getSpan();
|
|
1544
1648
|
return e ? { "sentry-trace": e.toTraceparent() } : {};
|
|
1545
1649
|
}
|
|
1546
|
-
function
|
|
1650
|
+
function rs(t, e) {
|
|
1547
1651
|
let n = this.getClient(), r = n && n.getOptions() || {}, s = r.instrumenter || "sentry", i = t.instrumenter || "sentry";
|
|
1548
1652
|
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
1653
|
The transaction will not be sampled. Please use the ${s} instrumentation to start transactions.`), t.sampled = false);
|
|
1550
|
-
let o = new
|
|
1551
|
-
return o =
|
|
1654
|
+
let o = new je(t, this);
|
|
1655
|
+
return o = Gn(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
1656
|
}
|
|
1553
|
-
function
|
|
1554
|
-
let t =
|
|
1555
|
-
t.__SENTRY__ && (t.__SENTRY__.extensions = t.__SENTRY__.extensions || {}, t.__SENTRY__.extensions.startTransaction || (t.__SENTRY__.extensions.startTransaction =
|
|
1657
|
+
function Fn() {
|
|
1658
|
+
let t = V();
|
|
1659
|
+
t.__SENTRY__ && (t.__SENTRY__.extensions = t.__SENTRY__.extensions || {}, t.__SENTRY__.extensions.startTransaction || (t.__SENTRY__.extensions.startTransaction = rs), t.__SENTRY__.extensions.traceHeaders || (t.__SENTRY__.extensions.traceHeaders = ns), Ln());
|
|
1556
1660
|
}
|
|
1557
|
-
var
|
|
1661
|
+
var qe = class {
|
|
1558
1662
|
constructor(e, n) {
|
|
1559
1663
|
this._client = e, this.flushTimeout = 60, this._pendingAggregates = {}, this._isEnabled = true, this._intervalId = setInterval(() => this.flush(), this.flushTimeout * 1e3), this._sessionAttrs = n;
|
|
1560
1664
|
}
|
|
@@ -1571,7 +1675,7 @@ var Le = class {
|
|
|
1571
1675
|
}
|
|
1572
1676
|
incrementSessionStatusCount() {
|
|
1573
1677
|
if (!this._isEnabled) return;
|
|
1574
|
-
let e =
|
|
1678
|
+
let e = x().getScope(), n = e.getRequestSession();
|
|
1575
1679
|
n && n.status && (this._incrementSessionStatusCount(n.status, /* @__PURE__ */ new Date()), e.setRequestSession(void 0));
|
|
1576
1680
|
}
|
|
1577
1681
|
_incrementSessionStatusCount(e, n) {
|
|
@@ -1588,64 +1692,64 @@ var Le = class {
|
|
|
1588
1692
|
}
|
|
1589
1693
|
}
|
|
1590
1694
|
};
|
|
1591
|
-
var
|
|
1592
|
-
function
|
|
1695
|
+
var ss = "7";
|
|
1696
|
+
function is(t) {
|
|
1593
1697
|
let e = t.protocol ? `${t.protocol}:` : "", n = t.port ? `:${t.port}` : "";
|
|
1594
1698
|
return `${e}//${t.host}${n}${t.path ? `/${t.path}` : ""}/api/`;
|
|
1595
1699
|
}
|
|
1596
|
-
function
|
|
1597
|
-
return `${
|
|
1700
|
+
function os(t) {
|
|
1701
|
+
return `${is(t)}${t.projectId}/envelope/`;
|
|
1598
1702
|
}
|
|
1599
|
-
function
|
|
1600
|
-
return
|
|
1703
|
+
function as(t, e) {
|
|
1704
|
+
return ut({ sentry_key: t.publicKey, sentry_version: ss, ...e && { sentry_client: `${e.name}/${e.version}` } });
|
|
1601
1705
|
}
|
|
1602
|
-
function
|
|
1706
|
+
function $n(t, e = {}) {
|
|
1603
1707
|
let n = typeof e == "string" ? e : e.tunnel, r = typeof e == "string" || !e._metadata ? void 0 : e._metadata.sdk;
|
|
1604
|
-
return n || `${
|
|
1708
|
+
return n || `${os(t)}?${as(t, r)}`;
|
|
1605
1709
|
}
|
|
1606
|
-
function
|
|
1710
|
+
function cs(t, e) {
|
|
1607
1711
|
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
1712
|
}
|
|
1609
|
-
function
|
|
1610
|
-
let s =
|
|
1611
|
-
return
|
|
1713
|
+
function Hn(t, e, n, r) {
|
|
1714
|
+
let s = $e(n), i = { sent_at: (/* @__PURE__ */ new Date()).toISOString(), ...s && { sdk: s }, ...!!r && e && { dsn: B(e) } }, o = "aggregates" in t ? [{ type: "sessions" }, t] : [{ type: "session" }, t.toJSON()];
|
|
1715
|
+
return G(i, [o]);
|
|
1612
1716
|
}
|
|
1613
|
-
function
|
|
1614
|
-
let s =
|
|
1615
|
-
|
|
1616
|
-
let o =
|
|
1617
|
-
return delete t.sdkProcessingMetadata,
|
|
1717
|
+
function Yn(t, e, n, r) {
|
|
1718
|
+
let s = $e(n), i = t.type && t.type !== "replay_event" ? t.type : "event";
|
|
1719
|
+
cs(t, n && n.sdk);
|
|
1720
|
+
let o = It(t, s, r, e);
|
|
1721
|
+
return delete t.sdkProcessingMetadata, G(o, [[{ type: i }, t]]);
|
|
1618
1722
|
}
|
|
1619
|
-
var
|
|
1620
|
-
function
|
|
1723
|
+
var jn = [];
|
|
1724
|
+
function us(t) {
|
|
1621
1725
|
let e = {};
|
|
1622
1726
|
return t.forEach((n) => {
|
|
1623
1727
|
let { name: r } = n, s = e[r];
|
|
1624
1728
|
s && !s.isDefaultInstance && n.isDefaultInstance || (e[r] = n);
|
|
1625
1729
|
}), Object.keys(e).map((n) => e[n]);
|
|
1626
1730
|
}
|
|
1627
|
-
function
|
|
1731
|
+
function Pt(t) {
|
|
1628
1732
|
let e = t.defaultIntegrations || [], n = t.integrations;
|
|
1629
1733
|
e.forEach((o) => {
|
|
1630
1734
|
o.isDefaultInstance = true;
|
|
1631
1735
|
});
|
|
1632
1736
|
let r;
|
|
1633
|
-
Array.isArray(n) ? r = [...e, ...n] : typeof n == "function" ? r =
|
|
1634
|
-
let s =
|
|
1737
|
+
Array.isArray(n) ? r = [...e, ...n] : typeof n == "function" ? r = he(n(e)) : r = e;
|
|
1738
|
+
let s = us(r), i = ds(s, (o) => o.name === "Debug");
|
|
1635
1739
|
if (i !== -1) {
|
|
1636
1740
|
let [o] = s.splice(i, 1);
|
|
1637
1741
|
s.push(o);
|
|
1638
1742
|
}
|
|
1639
1743
|
return s;
|
|
1640
1744
|
}
|
|
1641
|
-
function
|
|
1745
|
+
function qn(t, e) {
|
|
1642
1746
|
let n = {};
|
|
1643
1747
|
return e.forEach((r) => {
|
|
1644
|
-
r &&
|
|
1748
|
+
r && Mt(t, r, n);
|
|
1645
1749
|
}), n;
|
|
1646
1750
|
}
|
|
1647
|
-
function
|
|
1648
|
-
if (n[e.name] = e,
|
|
1751
|
+
function Mt(t, e, n) {
|
|
1752
|
+
if (n[e.name] = e, jn.indexOf(e.name) === -1 && (e.setupOnce(On, x), jn.push(e.name)), t.on && typeof e.preprocessEvent == "function") {
|
|
1649
1753
|
let r = e.preprocessEvent.bind(e);
|
|
1650
1754
|
t.on("preprocessEvent", (s, i) => r(s, i, t));
|
|
1651
1755
|
}
|
|
@@ -1655,15 +1759,15 @@ function Ot(t, e, n) {
|
|
|
1655
1759
|
}
|
|
1656
1760
|
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(`Integration installed: ${e.name}`);
|
|
1657
1761
|
}
|
|
1658
|
-
function
|
|
1762
|
+
function ds(t, e) {
|
|
1659
1763
|
for (let n = 0; n < t.length; n++) if (e(t[n]) === true) return n;
|
|
1660
1764
|
return -1;
|
|
1661
1765
|
}
|
|
1662
|
-
function
|
|
1663
|
-
let { normalizeDepth: i = 3, normalizeMaxBreadth: o = 1e3 } = t, a = { ...e, event_id: e.event_id || n.event_id || g(), timestamp: e.timestamp ||
|
|
1664
|
-
|
|
1766
|
+
function zn(t, e, n, r, s) {
|
|
1767
|
+
let { normalizeDepth: i = 3, normalizeMaxBreadth: o = 1e3 } = t, a = { ...e, event_id: e.event_id || n.event_id || g(), timestamp: e.timestamp || q() }, c = n.integrations || t.integrations.map((p) => p.name);
|
|
1768
|
+
ls(a, t), ms(a, c), e.type === void 0 && fs(a, t.stackParser);
|
|
1665
1769
|
let u = r;
|
|
1666
|
-
n.captureContext && (u =
|
|
1770
|
+
n.captureContext && (u = k.clone(u).update(n.captureContext));
|
|
1667
1771
|
let l = b(a), d = s && s.getEventProcessors ? s.getEventProcessors() : [];
|
|
1668
1772
|
if (u) {
|
|
1669
1773
|
if (u.getAttachments) {
|
|
@@ -1671,23 +1775,23 @@ function Ln(t, e, n, r, s) {
|
|
|
1671
1775
|
p.length && (n.attachments = p);
|
|
1672
1776
|
}
|
|
1673
1777
|
l = u.applyToEvent(a, n, d);
|
|
1674
|
-
} else l =
|
|
1675
|
-
return l.then((p) => (p &&
|
|
1778
|
+
} else l = ee([...d, ...Ee()], a, n);
|
|
1779
|
+
return l.then((p) => (p && ps(p), typeof i == "number" && i > 0 ? hs(p, i, o) : p));
|
|
1676
1780
|
}
|
|
1677
|
-
function
|
|
1781
|
+
function ls(t, e) {
|
|
1678
1782
|
let { environment: n, release: r, dist: s, maxValueLength: i = 250 } = e;
|
|
1679
|
-
"environment" in t || (t.environment = "environment" in e ? n :
|
|
1783
|
+
"environment" in t || (t.environment = "environment" in e ? n : Q), t.release === void 0 && r !== void 0 && (t.release = r), t.dist === void 0 && s !== void 0 && (t.dist = s), t.message && (t.message = L(t.message, i));
|
|
1680
1784
|
let o = t.exception && t.exception.values && t.exception.values[0];
|
|
1681
|
-
o && o.value && (o.value =
|
|
1785
|
+
o && o.value && (o.value = L(o.value, i));
|
|
1682
1786
|
let a = t.request;
|
|
1683
|
-
a && a.url && (a.url =
|
|
1787
|
+
a && a.url && (a.url = L(a.url, i));
|
|
1684
1788
|
}
|
|
1685
|
-
var
|
|
1686
|
-
function
|
|
1789
|
+
var Wn = /* @__PURE__ */ new WeakMap();
|
|
1790
|
+
function fs(t, e) {
|
|
1687
1791
|
let n = h._sentryDebugIds;
|
|
1688
1792
|
if (!n) return;
|
|
1689
|
-
let r, s =
|
|
1690
|
-
s ? r = s : (r = /* @__PURE__ */ new Map(),
|
|
1793
|
+
let r, s = Wn.get(e);
|
|
1794
|
+
s ? r = s : (r = /* @__PURE__ */ new Map(), Wn.set(e, r));
|
|
1691
1795
|
let i = Object.keys(n).reduce((o, a) => {
|
|
1692
1796
|
let c, u = r.get(a);
|
|
1693
1797
|
u ? c = u : (c = e(a), r.set(a, c));
|
|
@@ -1709,7 +1813,7 @@ function ts(t, e) {
|
|
|
1709
1813
|
} catch {
|
|
1710
1814
|
}
|
|
1711
1815
|
}
|
|
1712
|
-
function
|
|
1816
|
+
function ps(t) {
|
|
1713
1817
|
let e = {};
|
|
1714
1818
|
try {
|
|
1715
1819
|
t.exception.values.forEach((r) => {
|
|
@@ -1726,25 +1830,25 @@ function ns(t) {
|
|
|
1726
1830
|
n.push({ type: "sourcemap", code_file: r, debug_id: e[r] });
|
|
1727
1831
|
});
|
|
1728
1832
|
}
|
|
1729
|
-
function
|
|
1833
|
+
function ms(t, e) {
|
|
1730
1834
|
e.length > 0 && (t.sdk = t.sdk || {}, t.sdk.integrations = [...t.sdk.integrations || [], ...e]);
|
|
1731
1835
|
}
|
|
1732
|
-
function
|
|
1836
|
+
function hs(t, e, n) {
|
|
1733
1837
|
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 =
|
|
1838
|
+
let r = { ...t, ...t.breadcrumbs && { breadcrumbs: t.breadcrumbs.map((s) => ({ ...s, ...s.data && { data: v(s.data, e, n) } })) }, ...t.user && { user: v(t.user, e, n) }, ...t.contexts && { contexts: v(t.contexts, e, n) }, ...t.extra && { extra: v(t.extra, e, n) } };
|
|
1839
|
+
return t.contexts && t.contexts.trace && r.contexts && (r.contexts.trace = t.contexts.trace, t.contexts.trace.data && (r.contexts.trace.data = v(t.contexts.trace.data, e, n))), t.spans && (r.spans = t.spans.map((s) => (s.data && (s.data = v(s.data, e, n)), s))), r;
|
|
1736
1840
|
}
|
|
1737
|
-
var
|
|
1738
|
-
var
|
|
1841
|
+
var Vn = "Not capturing exception because it's already been captured.";
|
|
1842
|
+
var We = class {
|
|
1739
1843
|
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 =
|
|
1844
|
+
if (this._options = e, this._integrations = {}, this._integrationsInitialized = false, this._numProcessing = 0, this._outcomes = {}, this._hooks = {}, this._eventProcessors = [], e.dsn ? this._dsn = we(e.dsn) : (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("No DSN provided, client will not send events."), this._dsn) {
|
|
1845
|
+
let n = $n(this._dsn, e);
|
|
1742
1846
|
this._transport = e.transport({ recordDroppedEvent: this.recordDroppedEvent.bind(this), ...e.transportOptions, url: n });
|
|
1743
1847
|
}
|
|
1744
1848
|
}
|
|
1745
1849
|
captureException(e, n, r) {
|
|
1746
|
-
if (
|
|
1747
|
-
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(
|
|
1850
|
+
if (Le(e)) {
|
|
1851
|
+
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(Vn);
|
|
1748
1852
|
return;
|
|
1749
1853
|
}
|
|
1750
1854
|
let s = n && n.event_id;
|
|
@@ -1753,14 +1857,14 @@ var Be = class {
|
|
|
1753
1857
|
})), s;
|
|
1754
1858
|
}
|
|
1755
1859
|
captureMessage(e, n, r, s) {
|
|
1756
|
-
let i = r && r.event_id, o =
|
|
1860
|
+
let i = r && r.event_id, o = Ie(e) ? this.eventFromMessage(String(e), n, r) : this.eventFromException(e, r);
|
|
1757
1861
|
return this._process(o.then((a) => this._captureEvent(a, r, s)).then((a) => {
|
|
1758
1862
|
i = a;
|
|
1759
1863
|
})), i;
|
|
1760
1864
|
}
|
|
1761
1865
|
captureEvent(e, n, r) {
|
|
1762
|
-
if (n && n.originalException &&
|
|
1763
|
-
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(
|
|
1866
|
+
if (n && n.originalException && Le(n.originalException)) {
|
|
1867
|
+
(typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(Vn);
|
|
1764
1868
|
return;
|
|
1765
1869
|
}
|
|
1766
1870
|
let s = n && n.event_id;
|
|
@@ -1769,7 +1873,7 @@ var Be = class {
|
|
|
1769
1873
|
})), s;
|
|
1770
1874
|
}
|
|
1771
1875
|
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),
|
|
1876
|
+
typeof e.release != "string" ? (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("Discarded session because of missing or non-string release") : (this.sendSession(e), U(e, { init: false }));
|
|
1773
1877
|
}
|
|
1774
1878
|
getDsn() {
|
|
1775
1879
|
return this._dsn;
|
|
@@ -1797,7 +1901,7 @@ var Be = class {
|
|
|
1797
1901
|
this._eventProcessors.push(e);
|
|
1798
1902
|
}
|
|
1799
1903
|
setupIntegrations(e) {
|
|
1800
|
-
(e && !this._integrationsInitialized || this._isEnabled() && !this._integrationsInitialized) && (this._integrations =
|
|
1904
|
+
(e && !this._integrationsInitialized || this._isEnabled() && !this._integrationsInitialized) && (this._integrations = qn(this, this._options.integrations), this._integrationsInitialized = true);
|
|
1801
1905
|
}
|
|
1802
1906
|
getIntegrationById(e) {
|
|
1803
1907
|
return this._integrations[e];
|
|
@@ -1810,17 +1914,17 @@ var Be = class {
|
|
|
1810
1914
|
}
|
|
1811
1915
|
}
|
|
1812
1916
|
addIntegration(e) {
|
|
1813
|
-
|
|
1917
|
+
Mt(this, e, this._integrations);
|
|
1814
1918
|
}
|
|
1815
1919
|
sendEvent(e, n = {}) {
|
|
1816
1920
|
this.emit("beforeSendEvent", e, n);
|
|
1817
|
-
let r =
|
|
1818
|
-
for (let i of n.attachments || []) r =
|
|
1921
|
+
let r = Yn(e, this._dsn, this._options._metadata, this._options.tunnel);
|
|
1922
|
+
for (let i of n.attachments || []) r = bt(r, Rt(i, this._options.transportOptions && this._options.transportOptions.textEncoder));
|
|
1819
1923
|
let s = this._sendEnvelope(r);
|
|
1820
1924
|
s && s.then((i) => this.emit("afterSendEvent", e, i), null);
|
|
1821
1925
|
}
|
|
1822
1926
|
sendSession(e) {
|
|
1823
|
-
let n =
|
|
1927
|
+
let n = Hn(e, this._dsn, this._options._metadata, this._options.tunnel);
|
|
1824
1928
|
this._sendEnvelope(n);
|
|
1825
1929
|
}
|
|
1826
1930
|
recordDroppedEvent(e, n, r) {
|
|
@@ -1848,7 +1952,7 @@ var Be = class {
|
|
|
1848
1952
|
}
|
|
1849
1953
|
}
|
|
1850
1954
|
let o = e.status === "ok";
|
|
1851
|
-
(o && e.errors === 0 || o && r) && (
|
|
1955
|
+
(o && e.errors === 0 || o && r) && (U(e, { ...r && { status: "crashed" }, errors: e.errors || Number(s || r) }), this.captureSession(e));
|
|
1852
1956
|
}
|
|
1853
1957
|
_isClientDoneProcessing(e) {
|
|
1854
1958
|
return new S((n) => {
|
|
@@ -1862,13 +1966,13 @@ var Be = class {
|
|
|
1862
1966
|
}
|
|
1863
1967
|
_prepareEvent(e, n, r) {
|
|
1864
1968
|
let s = this.getOptions(), i = Object.keys(this._integrations);
|
|
1865
|
-
return !n.integrations && i.length > 0 && (n.integrations = i), this.emit("preprocessEvent", e, n),
|
|
1969
|
+
return !n.integrations && i.length > 0 && (n.integrations = i), this.emit("preprocessEvent", e, n), zn(s, e, n, r, this).then((o) => {
|
|
1866
1970
|
if (o === null) return o;
|
|
1867
1971
|
let { propagationContext: a } = o.sdkProcessingMetadata || {};
|
|
1868
1972
|
if (!(o.contexts && o.contexts.trace) && a) {
|
|
1869
1973
|
let { traceId: u, spanId: l, parentSpanId: d, dsc: p } = a;
|
|
1870
1974
|
o.contexts = { trace: { trace_id: u, span_id: l, parent_span_id: d }, ...o.contexts };
|
|
1871
|
-
let m = p ||
|
|
1975
|
+
let m = p || ne(u, this, r);
|
|
1872
1976
|
o.sdkProcessingMetadata = { dynamicSamplingContext: m, ...o.sdkProcessingMetadata };
|
|
1873
1977
|
}
|
|
1874
1978
|
return o;
|
|
@@ -1883,22 +1987,22 @@ var Be = class {
|
|
|
1883
1987
|
});
|
|
1884
1988
|
}
|
|
1885
1989
|
_processEvent(e, n, r) {
|
|
1886
|
-
let s = this.getOptions(), { sampleRate: i } = s, o =
|
|
1887
|
-
if (a && typeof i == "number" && Math.random() > i) return this.recordDroppedEvent("sample_rate", "error", e),
|
|
1990
|
+
let s = this.getOptions(), { sampleRate: i } = s, o = Kn(e), a = Jn(e), c = e.type || "error", u = `before send for type \`${c}\``;
|
|
1991
|
+
if (a && typeof i == "number" && Math.random() > i) return this.recordDroppedEvent("sample_rate", "error", e), j(new T(`Discarding event because it's not included in the random sample (sampling rate = ${i})`, "log"));
|
|
1888
1992
|
let l = c === "replay_event" ? "replay" : c;
|
|
1889
1993
|
return this._prepareEvent(e, n, r).then((d) => {
|
|
1890
1994
|
if (d === null) throw this.recordDroppedEvent("event_processor", l, e), new T("An event processor returned `null`, will not send event.", "log");
|
|
1891
1995
|
if (n.data && n.data.__sentry__ === true) return d;
|
|
1892
|
-
let m =
|
|
1893
|
-
return
|
|
1996
|
+
let m = gs(s, d, n);
|
|
1997
|
+
return _s(m, u);
|
|
1894
1998
|
}).then((d) => {
|
|
1895
1999
|
if (d === null) throw this.recordDroppedEvent("before_send", l, e), new T(`${u} returned \`null\`, will not send event.`, "log");
|
|
1896
2000
|
let p = r && r.getSession();
|
|
1897
2001
|
!o && p && this._updateSessionFromEvent(p, d);
|
|
1898
2002
|
let m = d.transaction_info;
|
|
1899
2003
|
if (o && m && d.transaction !== e.transaction) {
|
|
1900
|
-
let
|
|
1901
|
-
d.transaction_info = { ...m, source:
|
|
2004
|
+
let I = "custom";
|
|
2005
|
+
d.transaction_info = { ...m, source: I };
|
|
1902
2006
|
}
|
|
1903
2007
|
return this.sendEvent(d, n), d;
|
|
1904
2008
|
}).then(null, (d) => {
|
|
@@ -1923,45 +2027,45 @@ Reason: ${d}`));
|
|
|
1923
2027
|
});
|
|
1924
2028
|
}
|
|
1925
2029
|
};
|
|
1926
|
-
function
|
|
2030
|
+
function _s(t, e) {
|
|
1927
2031
|
let n = `${e} must return \`null\` or a valid event.`;
|
|
1928
|
-
if (
|
|
1929
|
-
if (!
|
|
2032
|
+
if (Y(t)) return t.then((r) => {
|
|
2033
|
+
if (!N(r) && r !== null) throw new T(n);
|
|
1930
2034
|
return r;
|
|
1931
2035
|
}, (r) => {
|
|
1932
2036
|
throw new T(`${e} rejected with ${r}`);
|
|
1933
2037
|
});
|
|
1934
|
-
if (!
|
|
2038
|
+
if (!N(t) && t !== null) throw new T(n);
|
|
1935
2039
|
return t;
|
|
1936
2040
|
}
|
|
1937
|
-
function
|
|
2041
|
+
function gs(t, e, n) {
|
|
1938
2042
|
let { beforeSend: r, beforeSendTransaction: s } = t;
|
|
1939
|
-
return
|
|
2043
|
+
return Jn(e) && r ? r(e, n) : Kn(e) && s ? s(e, n) : e;
|
|
1940
2044
|
}
|
|
1941
|
-
function
|
|
2045
|
+
function Jn(t) {
|
|
1942
2046
|
return t.type === void 0;
|
|
1943
2047
|
}
|
|
1944
|
-
function
|
|
2048
|
+
function Kn(t) {
|
|
1945
2049
|
return t.type === "transaction";
|
|
1946
2050
|
}
|
|
1947
|
-
function
|
|
2051
|
+
function Xn(t, e, n, r, s) {
|
|
1948
2052
|
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 =
|
|
1950
|
-
let o =
|
|
1951
|
-
return
|
|
2053
|
+
n && n.sdk && (i.sdk = { name: n.sdk.name, version: n.sdk.version }), r && s && (i.dsn = B(s)), e && (i.trace = E(e));
|
|
2054
|
+
let o = Es(t);
|
|
2055
|
+
return G(i, [o]);
|
|
1952
2056
|
}
|
|
1953
|
-
function
|
|
2057
|
+
function Es(t) {
|
|
1954
2058
|
return [{ type: "check_in" }, t];
|
|
1955
2059
|
}
|
|
1956
|
-
var
|
|
2060
|
+
var ye = class extends We {
|
|
1957
2061
|
constructor(e) {
|
|
1958
|
-
|
|
2062
|
+
Fn(), super(e);
|
|
1959
2063
|
}
|
|
1960
2064
|
eventFromException(e, n) {
|
|
1961
|
-
return b(
|
|
2065
|
+
return b(Dt(x, this._options.stackParser, e, n));
|
|
1962
2066
|
}
|
|
1963
2067
|
eventFromMessage(e, n = "info", r) {
|
|
1964
|
-
return b(
|
|
2068
|
+
return b(Ot(this._options.stackParser, e, n, r, this._options.attachStacktrace));
|
|
1965
2069
|
}
|
|
1966
2070
|
captureException(e, n, r) {
|
|
1967
2071
|
if (this._options.autoSessionTracking && this._sessionFlusher && r) {
|
|
@@ -1982,7 +2086,7 @@ var fe = class extends Be {
|
|
|
1982
2086
|
}
|
|
1983
2087
|
initSessionFlusher() {
|
|
1984
2088
|
let { release: e, environment: n } = this._options;
|
|
1985
|
-
e ? this._sessionFlusher = new
|
|
2089
|
+
e ? this._sessionFlusher = new qe(this, { release: e, environment: n }) : (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("Cannot initialise an instance of SessionFlusher if no release is provided!");
|
|
1986
2090
|
}
|
|
1987
2091
|
captureCheckIn(e, n, r) {
|
|
1988
2092
|
let s = e.status !== "in_progress" && e.checkInId ? e.checkInId : g();
|
|
@@ -1991,7 +2095,7 @@ var fe = class extends Be {
|
|
|
1991
2095
|
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
2096
|
let [l, d] = this._getTraceInfoFromScope(r);
|
|
1993
2097
|
d && (u.contexts = { trace: d });
|
|
1994
|
-
let p =
|
|
2098
|
+
let p = Xn(u, l, this.getSdkMetadata(), c, this.getDsn());
|
|
1995
2099
|
return (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.info("Sending checkin:", e.monitorSlug, e.status), this._sendEnvelope(p), s;
|
|
1996
2100
|
}
|
|
1997
2101
|
_captureRequestSession() {
|
|
@@ -2005,27 +2109,27 @@ var fe = class extends Be {
|
|
|
2005
2109
|
let n = e.getSpan();
|
|
2006
2110
|
if (n) return [n.transaction ? n.transaction.getDynamicSamplingContext() : void 0, n.getTraceContext()];
|
|
2007
2111
|
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] : [
|
|
2112
|
+
return o ? [o, a] : [ne(r, this, e), a];
|
|
2009
2113
|
}
|
|
2010
2114
|
};
|
|
2011
|
-
var
|
|
2012
|
-
function
|
|
2115
|
+
var ys = 30;
|
|
2116
|
+
function Ut(t, e, n = gt(t.bufferSize || ys)) {
|
|
2013
2117
|
let r = {}, s = (o) => n.drain(o);
|
|
2014
2118
|
function i(o) {
|
|
2015
2119
|
let a = [];
|
|
2016
|
-
if (
|
|
2017
|
-
let m =
|
|
2018
|
-
if (
|
|
2019
|
-
let
|
|
2020
|
-
t.recordDroppedEvent("ratelimit_backoff", m,
|
|
2120
|
+
if (Ge(o, (d, p) => {
|
|
2121
|
+
let m = Fe(p);
|
|
2122
|
+
if (At(r, m)) {
|
|
2123
|
+
let I = Zn(d, p);
|
|
2124
|
+
t.recordDroppedEvent("ratelimit_backoff", m, I);
|
|
2021
2125
|
} else a.push(d);
|
|
2022
2126
|
}), a.length === 0) return b();
|
|
2023
|
-
let c =
|
|
2024
|
-
|
|
2025
|
-
let
|
|
2026
|
-
t.recordDroppedEvent(d,
|
|
2127
|
+
let c = G(o[0], a), u = (d) => {
|
|
2128
|
+
Ge(c, (p, m) => {
|
|
2129
|
+
let I = Zn(p, m);
|
|
2130
|
+
t.recordDroppedEvent(d, Fe(m), I);
|
|
2027
2131
|
});
|
|
2028
|
-
}, l = () => e({ body:
|
|
2132
|
+
}, l = () => e({ body: xt(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 = Nt(r, d), d), (d) => {
|
|
2029
2133
|
throw u("network_error"), d;
|
|
2030
2134
|
});
|
|
2031
2135
|
return n.add(l).then((d) => d, (d) => {
|
|
@@ -2035,110 +2139,110 @@ function vt(t, e, n = ft(t.bufferSize || cs)) {
|
|
|
2035
2139
|
}
|
|
2036
2140
|
return i.__sentry__baseTransport__ = true, { send: i, flush: s };
|
|
2037
2141
|
}
|
|
2038
|
-
function
|
|
2142
|
+
function Zn(t, e) {
|
|
2039
2143
|
if (!(e !== "event" && e !== "transaction")) return Array.isArray(t) ? t[1] : void 0;
|
|
2040
2144
|
}
|
|
2041
|
-
function
|
|
2145
|
+
function er(t) {
|
|
2042
2146
|
return typeof t == "object" && t !== null;
|
|
2043
2147
|
}
|
|
2044
|
-
function
|
|
2045
|
-
return
|
|
2148
|
+
function Ss(t) {
|
|
2149
|
+
return er(t) && "handled" in t && typeof t.handled == "boolean" && "type" in t && typeof t.type == "string";
|
|
2046
2150
|
}
|
|
2047
|
-
function
|
|
2048
|
-
return
|
|
2151
|
+
function Ts(t) {
|
|
2152
|
+
return er(t) && "mechanism" in t && Ss(t.mechanism);
|
|
2049
2153
|
}
|
|
2050
|
-
function
|
|
2154
|
+
function bs() {
|
|
2051
2155
|
if (h.SENTRY_RELEASE && h.SENTRY_RELEASE.id) return h.SENTRY_RELEASE.id;
|
|
2052
2156
|
}
|
|
2053
|
-
function
|
|
2157
|
+
function Qn(t, e) {
|
|
2054
2158
|
return t !== void 0 ? (t[e[0]] = e[1], t) : { [e[0]]: e[1] };
|
|
2055
2159
|
}
|
|
2056
|
-
function
|
|
2160
|
+
function tr(t, e) {
|
|
2057
2161
|
return t(e.stack || "", 1);
|
|
2058
2162
|
}
|
|
2059
|
-
function
|
|
2163
|
+
function xs(t) {
|
|
2060
2164
|
let e = t && t.message;
|
|
2061
2165
|
return e ? e.error && typeof e.error.message == "string" ? e.error.message : e : "No error message";
|
|
2062
2166
|
}
|
|
2063
|
-
function
|
|
2064
|
-
let n = { type: e.name || e.constructor.name, value:
|
|
2167
|
+
function nr(t, e) {
|
|
2168
|
+
let n = { type: e.name || e.constructor.name, value: xs(e) }, r = tr(t, e);
|
|
2065
2169
|
return r.length && (n.stacktrace = { frames: r }), n.type === void 0 && n.value === "" && (n.value = "Unrecoverable error caught"), n;
|
|
2066
2170
|
}
|
|
2067
|
-
function
|
|
2068
|
-
let s, o = (r && r.data &&
|
|
2069
|
-
if (
|
|
2171
|
+
function Rs(t, e, n, r) {
|
|
2172
|
+
let s, o = (r && r.data && Ts(r.data) ? r.data.mechanism : void 0) ?? { handled: true, type: "generic" };
|
|
2173
|
+
if (H(n)) s = n;
|
|
2070
2174
|
else {
|
|
2071
|
-
if (
|
|
2072
|
-
let c = `Non-Error exception captured with keys: ${
|
|
2175
|
+
if (N(n)) {
|
|
2176
|
+
let c = `Non-Error exception captured with keys: ${ue(n)}`, u = t?.getClient(), l = u && u.getOptions().normalizeDepth;
|
|
2073
2177
|
t?.configureScope((d) => {
|
|
2074
|
-
d.setExtra("__serialized__",
|
|
2178
|
+
d.setExtra("__serialized__", Z(n, l));
|
|
2075
2179
|
}), s = r && r.syntheticException || new Error(c), s.message = c;
|
|
2076
2180
|
} else s = r && r.syntheticException || new Error(n), s.message = n;
|
|
2077
2181
|
o.synthetic = true;
|
|
2078
2182
|
}
|
|
2079
|
-
let a = { exception: { values: [
|
|
2080
|
-
return
|
|
2183
|
+
let a = { exception: { values: [nr(e, s)] } };
|
|
2184
|
+
return pe(a, void 0, void 0), me(a, o), { ...a, event_id: r && r.event_id };
|
|
2081
2185
|
}
|
|
2082
|
-
function
|
|
2186
|
+
function Is(t, e, n = "info", r, s) {
|
|
2083
2187
|
let i = { event_id: r && r.event_id, level: n, message: e };
|
|
2084
2188
|
if (s && r && r.syntheticException) {
|
|
2085
|
-
let o =
|
|
2189
|
+
let o = tr(t, r.syntheticException);
|
|
2086
2190
|
o.length && (i.exception = { values: [{ value: e, stacktrace: { frames: o } }] });
|
|
2087
2191
|
}
|
|
2088
2192
|
return i;
|
|
2089
2193
|
}
|
|
2090
|
-
var
|
|
2091
|
-
var
|
|
2092
|
-
name =
|
|
2194
|
+
var As = 5;
|
|
2195
|
+
var Ke = class {
|
|
2196
|
+
name = Ke.id;
|
|
2093
2197
|
limit;
|
|
2094
2198
|
constructor(e = {}) {
|
|
2095
|
-
this.limit = e.limit ||
|
|
2199
|
+
this.limit = e.limit || As;
|
|
2096
2200
|
}
|
|
2097
2201
|
setupOnce(e, n) {
|
|
2098
2202
|
let r = n().getClient();
|
|
2099
2203
|
r && e((s, i) => {
|
|
2100
|
-
let o = n().getIntegration(
|
|
2101
|
-
return o ?
|
|
2204
|
+
let o = n().getIntegration(Ke);
|
|
2205
|
+
return o ? Ns(r.getOptions().stackParser, o.limit, s, i) : s;
|
|
2102
2206
|
});
|
|
2103
2207
|
}
|
|
2104
2208
|
};
|
|
2105
|
-
var
|
|
2106
|
-
|
|
2107
|
-
function
|
|
2108
|
-
if (!n.exception || !n.exception.values || !r || !
|
|
2109
|
-
let s =
|
|
2209
|
+
var ze = Ke;
|
|
2210
|
+
Se(ze, "id", "LinkedErrors");
|
|
2211
|
+
function Ns(t, e, n, r) {
|
|
2212
|
+
if (!n.exception || !n.exception.values || !r || !P(r.originalException, Error)) return n;
|
|
2213
|
+
let s = rr(t, e, r.originalException);
|
|
2110
2214
|
return n.exception.values = [...s, ...n.exception.values], n;
|
|
2111
2215
|
}
|
|
2112
|
-
function
|
|
2113
|
-
if (!
|
|
2114
|
-
let s =
|
|
2115
|
-
return
|
|
2216
|
+
function rr(t, e, n, r = []) {
|
|
2217
|
+
if (!P(n.cause, Error) || r.length + 1 >= e) return r;
|
|
2218
|
+
let s = nr(t, n.cause);
|
|
2219
|
+
return rr(t, e, n.cause, [s, ...r]);
|
|
2116
2220
|
}
|
|
2117
|
-
var
|
|
2118
|
-
var
|
|
2119
|
-
var
|
|
2221
|
+
var ws = { allowedHeaders: ["CF-RAY", "CF-Worker"] };
|
|
2222
|
+
var re;
|
|
2223
|
+
var Xe = class {
|
|
2120
2224
|
constructor(e = {}) {
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2225
|
+
Se(this, "name", Xe.id);
|
|
2226
|
+
Vt(this, re, void 0);
|
|
2227
|
+
Jt(this, re, { ...ws, ...e });
|
|
2124
2228
|
}
|
|
2125
2229
|
setupOnce(e, n) {
|
|
2126
2230
|
n().getClient() && e((s) => {
|
|
2127
2231
|
let { sdkProcessingMetadata: i } = s;
|
|
2128
|
-
return !n().getIntegration(
|
|
2232
|
+
return !n().getIntegration(Xe) || !i || ("request" in i && i.request instanceof Request && (s.request = Os(i.request, rt(this, re)), s.user = Ds(s.user ?? {}, i.request, rt(this, re))), "requestData" in i && (s.request ? s.request.data = i.requestData : s.request = { data: i.requestData })), s;
|
|
2129
2233
|
});
|
|
2130
2234
|
}
|
|
2131
2235
|
};
|
|
2132
|
-
var
|
|
2133
|
-
|
|
2134
|
-
function
|
|
2236
|
+
var Ve = Xe;
|
|
2237
|
+
re = /* @__PURE__ */ new WeakMap(), Se(Ve, "id", "RequestData");
|
|
2238
|
+
function Ds(t, e, n) {
|
|
2135
2239
|
let r = e.headers.get("CF-Connecting-IP"), { allowedIps: s } = n, i = { ...t };
|
|
2136
|
-
return !("ip_address" in t) && r && s !== void 0 &&
|
|
2240
|
+
return !("ip_address" in t) && r && s !== void 0 && vs(r, s) && (i.ip_address = r), Object.keys(i).length > 0 ? i : void 0;
|
|
2137
2241
|
}
|
|
2138
|
-
function
|
|
2242
|
+
function Os(t, e) {
|
|
2139
2243
|
let n = t.headers.get("cookie"), r;
|
|
2140
2244
|
if (n) try {
|
|
2141
|
-
r =
|
|
2245
|
+
r = ks(n);
|
|
2142
2246
|
} catch {
|
|
2143
2247
|
}
|
|
2144
2248
|
let s = {};
|
|
@@ -2152,18 +2256,18 @@ function ys(t, e) {
|
|
|
2152
2256
|
l < 0 ? i.url = t.url : (i.url = t.url.substr(0, l), i.query_string = t.url.substr(l + 1));
|
|
2153
2257
|
}
|
|
2154
2258
|
let { allowedHeaders: o, allowedCookies: a, allowedSearchParams: c } = e;
|
|
2155
|
-
if (o !== void 0 && i.headers ? (i.headers =
|
|
2259
|
+
if (o !== void 0 && i.headers ? (i.headers = Lt(i.headers, o), Object.keys(i.headers).length === 0 && delete i.headers) : delete i.headers, a !== void 0 && i.cookies ? (i.cookies = Lt(i.cookies, a), Object.keys(i.cookies).length === 0 && delete i.cookies) : delete i.cookies, c !== void 0) {
|
|
2156
2260
|
let u = Object.fromEntries(new URLSearchParams(i.query_string)), l = new URLSearchParams();
|
|
2157
|
-
Object.keys(
|
|
2261
|
+
Object.keys(Lt(u, c)).forEach((d) => {
|
|
2158
2262
|
l.set(d, u[d]);
|
|
2159
2263
|
}), i.query_string = l.toString();
|
|
2160
2264
|
} else delete i.query_string;
|
|
2161
2265
|
return i;
|
|
2162
2266
|
}
|
|
2163
|
-
function
|
|
2267
|
+
function vs(t, e) {
|
|
2164
2268
|
return typeof e == "boolean" ? e : e instanceof RegExp ? e.test(t) : Array.isArray(e) ? e.map((r) => r.toLowerCase()).includes(t) : false;
|
|
2165
2269
|
}
|
|
2166
|
-
function
|
|
2270
|
+
function Lt(t, e) {
|
|
2167
2271
|
let n = () => false;
|
|
2168
2272
|
if (typeof e == "boolean") return e ? t : {};
|
|
2169
2273
|
if (e instanceof RegExp) n = (r) => e.test(r);
|
|
@@ -2173,7 +2277,7 @@ function kt(t, e) {
|
|
|
2173
2277
|
} else return {};
|
|
2174
2278
|
return Object.keys(t).filter(n).reduce((r, s) => (r[s] = t[s], r), {});
|
|
2175
2279
|
}
|
|
2176
|
-
function
|
|
2280
|
+
function ks(t) {
|
|
2177
2281
|
if (typeof t != "string") return {};
|
|
2178
2282
|
try {
|
|
2179
2283
|
return t.split(";").map((e) => e.split("=")).reduce((e, [n, r]) => (e[decodeURIComponent(n.trim())] = decodeURIComponent(r.trim()), e), {});
|
|
@@ -2181,7 +2285,7 @@ function Ts(t) {
|
|
|
2181
2285
|
return {};
|
|
2182
2286
|
}
|
|
2183
2287
|
}
|
|
2184
|
-
function
|
|
2288
|
+
function Cs(t, e) {
|
|
2185
2289
|
let n = {};
|
|
2186
2290
|
return t.forEach((r) => {
|
|
2187
2291
|
n[r.name] = r, r.setupOnce((s) => {
|
|
@@ -2189,22 +2293,22 @@ function bs(t, e) {
|
|
|
2189
2293
|
}, () => e);
|
|
2190
2294
|
}), n;
|
|
2191
2295
|
}
|
|
2192
|
-
var
|
|
2296
|
+
var Bt = class extends ye {
|
|
2193
2297
|
#e = null;
|
|
2194
2298
|
constructor(e) {
|
|
2195
2299
|
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);
|
|
2196
2300
|
}
|
|
2197
2301
|
setupIntegrations() {
|
|
2198
|
-
this._isEnabled() && !this._integrationsInitialized && this.#e && (this._integrations =
|
|
2302
|
+
this._isEnabled() && !this._integrationsInitialized && this.#e && (this._integrations = Cs(this._options.integrations, this.#e), this._integrationsInitialized = true);
|
|
2199
2303
|
}
|
|
2200
2304
|
eventFromException(e, n) {
|
|
2201
|
-
return b(
|
|
2305
|
+
return b(Rs(this.#e, this._options.stackParser, e, n));
|
|
2202
2306
|
}
|
|
2203
2307
|
eventFromMessage(e, n = "info", r) {
|
|
2204
|
-
return b(
|
|
2308
|
+
return b(Is(this._options.stackParser, e, n, r, this._options.attachStacktrace));
|
|
2205
2309
|
}
|
|
2206
2310
|
_prepareEvent(e, n, r) {
|
|
2207
|
-
return e.platform = e.platform || "javascript", this.getOptions().request && (e.sdkProcessingMetadata =
|
|
2311
|
+
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
2312
|
}
|
|
2209
2313
|
getSdk() {
|
|
2210
2314
|
return this.#e;
|
|
@@ -2219,8 +2323,8 @@ var Ct = class extends fe {
|
|
|
2219
2323
|
this.getOptions().enabled = e;
|
|
2220
2324
|
}
|
|
2221
2325
|
};
|
|
2222
|
-
function
|
|
2223
|
-
let [e, n] =
|
|
2326
|
+
function Ps(t) {
|
|
2327
|
+
let [e, n] = ft(t);
|
|
2224
2328
|
return [e, (s) => {
|
|
2225
2329
|
let i = n(s);
|
|
2226
2330
|
if (i) {
|
|
@@ -2230,28 +2334,28 @@ function Rs(t) {
|
|
|
2230
2334
|
return i;
|
|
2231
2335
|
}];
|
|
2232
2336
|
}
|
|
2233
|
-
function
|
|
2234
|
-
if (t) return
|
|
2337
|
+
function Ms(t) {
|
|
2338
|
+
if (t) return _e(t, ".js");
|
|
2235
2339
|
}
|
|
2236
|
-
var
|
|
2237
|
-
function
|
|
2340
|
+
var Us = Oe(Ps(Ms));
|
|
2341
|
+
function Ls(t) {
|
|
2238
2342
|
function e({ body: n }) {
|
|
2239
2343
|
try {
|
|
2240
2344
|
let s = (t.fetcher ?? fetch)(t.url, { method: "POST", headers: t.headers, body: n }).then((i) => ({ statusCode: i.status, headers: { "retry-after": i.headers.get("Retry-After"), "x-sentry-rate-limits": i.headers.get("X-Sentry-Rate-Limits") } }));
|
|
2241
2345
|
return t.context && t.context.waitUntil(s), s;
|
|
2242
2346
|
} catch (r) {
|
|
2243
|
-
return
|
|
2347
|
+
return j(r);
|
|
2244
2348
|
}
|
|
2245
2349
|
}
|
|
2246
|
-
return
|
|
2350
|
+
return Ut(t, e);
|
|
2247
2351
|
}
|
|
2248
|
-
var
|
|
2352
|
+
var Je = class extends z {
|
|
2249
2353
|
constructor(e) {
|
|
2250
|
-
if (e.defaultIntegrations = e.defaultIntegrations === false ? [] : [...Array.isArray(e.defaultIntegrations) ? e.defaultIntegrations : [new
|
|
2251
|
-
let r =
|
|
2354
|
+
if (e.defaultIntegrations = e.defaultIntegrations === false ? [] : [...Array.isArray(e.defaultIntegrations) ? e.defaultIntegrations : [new Ve(e.requestDataOptions), new ze()]], e.release === void 0) {
|
|
2355
|
+
let r = bs();
|
|
2252
2356
|
r !== void 0 && (e.release = r);
|
|
2253
2357
|
}
|
|
2254
|
-
let n = new
|
|
2358
|
+
let n = new Bt({ ...e, transport: Ls, integrations: Pt(e), stackParser: lt(e.stackParser || Us), transportOptions: { ...e.transportOptions, context: e.context } });
|
|
2255
2359
|
super(n), n.setSdk(this), n.setupIntegrations();
|
|
2256
2360
|
}
|
|
2257
2361
|
setRequestBody(e) {
|
|
@@ -2264,14 +2368,23 @@ var Ge = class extends H {
|
|
|
2264
2368
|
return e.status === "in_progress" && this.setContext("monitor", { slug: e.monitorSlug }), this.getClient().captureCheckIn(e, n, r);
|
|
2265
2369
|
}
|
|
2266
2370
|
};
|
|
2267
|
-
function
|
|
2371
|
+
function sr(t, e, n, r, s, i, o, a, c) {
|
|
2268
2372
|
if (!(n && r && s)) return;
|
|
2269
|
-
let
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
return i.
|
|
2373
|
+
let u = new Je({ dsn: n, request: t, context: e, sampleRate: 1, release: o?.tag, integrations: [new C({ iteratee(l) {
|
|
2374
|
+
return l.filename = "/index.js", l;
|
|
2375
|
+
} })], 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 } } });
|
|
2376
|
+
return i && (u.setTag("colo", i.coloId), u.setTag("metal", i.metalId)), a && c && (u.setTag("accountId", a), u.setTag("scriptId", c)), u.setUser({ id: a?.toString() }), u;
|
|
2377
|
+
}
|
|
2378
|
+
function Bs() {
|
|
2379
|
+
return { addLogs: () => {
|
|
2380
|
+
}, setTags: () => {
|
|
2381
|
+
}, end: () => {
|
|
2382
|
+
}, isRecording: true };
|
|
2383
|
+
}
|
|
2384
|
+
function ir() {
|
|
2385
|
+
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" };
|
|
2273
2386
|
}
|
|
2274
|
-
var
|
|
2387
|
+
var Ze = class {
|
|
2275
2388
|
constructor(e) {
|
|
2276
2389
|
this.data = {};
|
|
2277
2390
|
this.readyAnalytics = e;
|
|
@@ -2283,36 +2396,67 @@ var je = class {
|
|
|
2283
2396
|
return this.data[e];
|
|
2284
2397
|
}
|
|
2285
2398
|
write() {
|
|
2286
|
-
this.readyAnalytics && this.readyAnalytics.logEvent({ version: 1, accountId:
|
|
2399
|
+
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
2400
|
}
|
|
2288
2401
|
};
|
|
2289
|
-
var
|
|
2402
|
+
var Qe = class {
|
|
2290
2403
|
constructor(e) {
|
|
2291
2404
|
this.data = e;
|
|
2292
2405
|
}
|
|
2293
|
-
async
|
|
2294
|
-
let n = await
|
|
2295
|
-
return r ?
|
|
2406
|
+
async getWithBinarySearch(e) {
|
|
2407
|
+
let n = await ar(e), r = Ft(new Uint8Array(this.data, 20), n);
|
|
2408
|
+
return r ? cr(r) : null;
|
|
2409
|
+
}
|
|
2410
|
+
async getWithInterpolationSearch(e) {
|
|
2411
|
+
let n = await ar(e), r = Fs(new Uint8Array(this.data, 20), n);
|
|
2412
|
+
return r ? cr(r) : null;
|
|
2296
2413
|
}
|
|
2297
2414
|
};
|
|
2298
|
-
var
|
|
2415
|
+
var ar = async (t) => {
|
|
2299
2416
|
let n = new TextEncoder().encode(t), r = await crypto.subtle.digest("SHA-256", n.buffer);
|
|
2300
2417
|
return new Uint8Array(r, 0, 16);
|
|
2301
2418
|
};
|
|
2302
|
-
var
|
|
2419
|
+
var Ft = (t, e) => {
|
|
2303
2420
|
if (t.byteLength === 0) return false;
|
|
2304
2421
|
let n = t.byteOffset + (t.byteLength / 40 >> 1) * 40, r = new Uint8Array(t.buffer, n, 16);
|
|
2305
2422
|
if (r.byteLength !== e.byteLength) throw new TypeError("Search value and current value are of different lengths");
|
|
2306
|
-
let s =
|
|
2423
|
+
let s = $t(e, r);
|
|
2307
2424
|
if (s < 0) {
|
|
2308
2425
|
let i = t.byteOffset, o = n - t.byteOffset;
|
|
2309
|
-
return
|
|
2426
|
+
return Ft(new Uint8Array(t.buffer, i, o), e);
|
|
2310
2427
|
} else if (s > 0) {
|
|
2311
2428
|
let i = n + 40, o = t.buffer.byteLength - n - 40;
|
|
2312
|
-
return
|
|
2429
|
+
return Ft(new Uint8Array(t.buffer, i, o), e);
|
|
2313
2430
|
} else return new Uint8Array(t.buffer, n, 40);
|
|
2314
2431
|
};
|
|
2315
|
-
var
|
|
2432
|
+
var Gt = (t) => {
|
|
2433
|
+
let e = new DataView(t.buffer, t.byteOffset);
|
|
2434
|
+
return (e.getBigUint64(0) << 64n) + e.getBigUint64(8);
|
|
2435
|
+
};
|
|
2436
|
+
var Fs = (t, e) => {
|
|
2437
|
+
if (t.byteLength === 0) return false;
|
|
2438
|
+
let n = 0, r = t.byteLength / 40 - 1, s = Gt(e);
|
|
2439
|
+
for (; n <= r; ) {
|
|
2440
|
+
if (n === r) {
|
|
2441
|
+
let I = new Uint8Array(t.buffer, t.byteOffset + n * 40, 16);
|
|
2442
|
+
if (I.byteLength !== e.byteLength) throw new TypeError("Search value and current value are of different lengths");
|
|
2443
|
+
return $t(I, e) === 0 ? new Uint8Array(t.buffer, t.byteOffset + n * 40, 40) : false;
|
|
2444
|
+
}
|
|
2445
|
+
let i = new Uint8Array(t.buffer, t.byteOffset + n * 40, 16), o = new Uint8Array(t.buffer, t.byteOffset + r * 40, 16), a = Gt(i), u = Gt(o) - a;
|
|
2446
|
+
if (u <= 0n) throw new TypeError("Search space is unordered");
|
|
2447
|
+
let l = s - a;
|
|
2448
|
+
if (l < 0n) return false;
|
|
2449
|
+
let d = Math.floor(Number(BigInt(n) + BigInt(r - n) * l / u));
|
|
2450
|
+
if (d < n || d > r) return false;
|
|
2451
|
+
let p = new Uint8Array(t.buffer, t.byteOffset + d * 40, 16);
|
|
2452
|
+
if (p.byteLength !== e.byteLength) throw new TypeError("Search value and current value are of different lengths");
|
|
2453
|
+
let m = $t(p, e);
|
|
2454
|
+
if (m === 0) return new Uint8Array(t.buffer, t.byteOffset + d * 40, 40);
|
|
2455
|
+
m < 0 ? n = d + 1 : r = d - 1;
|
|
2456
|
+
}
|
|
2457
|
+
return false;
|
|
2458
|
+
};
|
|
2459
|
+
var $t = (t, e) => {
|
|
2316
2460
|
if (t.byteLength < e.byteLength) return -1;
|
|
2317
2461
|
if (t.byteLength > e.byteLength) return 1;
|
|
2318
2462
|
for (let [n, r] of t.entries()) {
|
|
@@ -2321,79 +2465,69 @@ var Os = (t, e) => {
|
|
|
2321
2465
|
}
|
|
2322
2466
|
return 0;
|
|
2323
2467
|
};
|
|
2324
|
-
var
|
|
2325
|
-
var
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
super(e, { ...n, status: 200 });
|
|
2329
|
-
}
|
|
2330
|
-
};
|
|
2331
|
-
var me = class extends Response {
|
|
2332
|
-
constructor(...[e, n]) {
|
|
2333
|
-
super(e, { ...n, status: 404, statusText: "Not Found" });
|
|
2334
|
-
}
|
|
2468
|
+
var cr = (t) => [...t.slice(16, 16 + 16)].map((n) => n.toString(16).padStart(2, "0")).join("");
|
|
2469
|
+
var Ht = (t) => {
|
|
2470
|
+
let e;
|
|
2471
|
+
return t?.run_worker_first !== void 0 ? e = t?.run_worker_first : t?.serve_directly !== void 0 ? e = !t.serve_directly : e = false, { html_handling: t?.html_handling ?? "auto-trailing-slash", not_found_handling: t?.not_found_handling ?? "none", run_worker_first: e, serve_directly: !e };
|
|
2335
2472
|
};
|
|
2336
|
-
var
|
|
2337
|
-
constructor(
|
|
2338
|
-
|
|
2473
|
+
var et = class {
|
|
2474
|
+
constructor(e) {
|
|
2475
|
+
this.data = {};
|
|
2476
|
+
this.readyAnalytics = e;
|
|
2339
2477
|
}
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
constructor(e, n) {
|
|
2343
|
-
super(null, { ...n, status: 500 });
|
|
2478
|
+
setData(e) {
|
|
2479
|
+
this.data = { ...this.data, ...e };
|
|
2344
2480
|
}
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
constructor(...[e, n]) {
|
|
2348
|
-
super(null, { ...n, status: 304, statusText: "Not Modified" });
|
|
2481
|
+
getData(e) {
|
|
2482
|
+
return this.data[e];
|
|
2349
2483
|
}
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
constructor(e, n) {
|
|
2353
|
-
super(null, { ...n, status: 307, statusText: "Temporary Redirect", headers: { ...n?.headers, Location: e } });
|
|
2484
|
+
write() {
|
|
2485
|
+
this.readyAnalytics && this.readyAnalytics.logEvent({ version: 1, accountId: this.data.accountId, indexId: this.data.experimentName, doubles: [this.data.manifestReadTime ?? -1], blobs: [this.data.manifestReadMethod] });
|
|
2354
2486
|
}
|
|
2355
2487
|
};
|
|
2356
|
-
var
|
|
2357
|
-
function
|
|
2488
|
+
var ur = "public, max-age=0, must-revalidate";
|
|
2489
|
+
function dr(t, e, n) {
|
|
2358
2490
|
let r = new Headers({ "Content-Type": e, ETag: `"${t}"` });
|
|
2359
|
-
return
|
|
2491
|
+
return $s(n) && r.append("Cache-Control", ur), r;
|
|
2360
2492
|
}
|
|
2361
|
-
function
|
|
2493
|
+
function $s(t) {
|
|
2362
2494
|
return !t.headers.has("Authorization") && !t.headers.has("Range");
|
|
2363
2495
|
}
|
|
2364
|
-
var
|
|
2365
|
-
let { pathname: i, search: o } = new URL(t.url), a =
|
|
2496
|
+
var lr = async (t, e, n, r, s) => {
|
|
2497
|
+
let { pathname: i, search: o } = new URL(t.url), a = Yt(i);
|
|
2366
2498
|
a = a.replace(/\/+/g, "/");
|
|
2367
|
-
let c = await
|
|
2368
|
-
if (!c) return new
|
|
2499
|
+
let c = await tt(a, n, r);
|
|
2500
|
+
if (!c) return e.JAEGER.enterSpan("no_intent", (A) => (A.setTags({ decodedPathname: a, configuration: JSON.stringify(n), status: 404 }), new ie()));
|
|
2369
2501
|
let u = t.method.toUpperCase();
|
|
2370
|
-
if (!["GET", "HEAD"].includes(u)) return new
|
|
2371
|
-
let l = c.redirect ?? a, d =
|
|
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
|
-
|
|
2502
|
+
if (!["GET", "HEAD"].includes(u)) return e.JAEGER.enterSpan("method_not_allowed", (A) => (A.setTags({ method: u, status: 405 }), new be()));
|
|
2503
|
+
let l = c.redirect ?? a, d = Ws(l);
|
|
2504
|
+
if (d !== i && c.asset || c.redirect) return e.JAEGER.enterSpan("redirect", (A) => (A.setTags({ originalPath: i, location: d !== i ? d : c.redirect ?? "<unknown>", status: 307 }), new Re(d + o)));
|
|
2505
|
+
if (!c.asset) return e.JAEGER.enterSpan("unknown_action", (A) => (A.setTags({ pathname: i, status: 500 }), new $(new Error("Unknown action"))));
|
|
2506
|
+
let p = await e.JAEGER.enterSpan("getByETag", async (A) => (A.setTags({ pathname: i, eTag: c.asset.eTag, status: c.asset.status }), await s(c.asset.eTag))), m = dr(c.asset.eTag, p.contentType, t), I = `"${c.asset.eTag}"`, jt = `W/${I}`, qt = t.headers.get("If-None-Match") || "";
|
|
2507
|
+
return [jt, I].includes(qt) ? e.JAEGER.enterSpan("matched_etag", (A) => (A.setTags({ matchedEtag: qt, status: 304 }), new xe(null, { headers: m }))) : e.JAEGER.enterSpan("response", (A) => {
|
|
2508
|
+
A.setTags({ etag: c.asset.eTag, status: c.asset.status, head: u === "HEAD" });
|
|
2509
|
+
let Wt = u === "HEAD" ? null : p.readableStream;
|
|
2510
|
+
switch (c.asset.status) {
|
|
2511
|
+
case 404:
|
|
2512
|
+
return new ie(Wt, { headers: m });
|
|
2513
|
+
case 200:
|
|
2514
|
+
return new Te(Wt, { headers: m });
|
|
2515
|
+
}
|
|
2516
|
+
});
|
|
2383
2517
|
};
|
|
2384
|
-
var
|
|
2518
|
+
var tt = async (t, e, n, r = false) => {
|
|
2385
2519
|
switch (e.html_handling) {
|
|
2386
2520
|
case "auto-trailing-slash":
|
|
2387
|
-
return
|
|
2521
|
+
return Hs(t, e, n, r);
|
|
2388
2522
|
case "force-trailing-slash":
|
|
2389
|
-
return
|
|
2523
|
+
return Ys(t, e, n, r);
|
|
2390
2524
|
case "drop-trailing-slash":
|
|
2391
|
-
return
|
|
2525
|
+
return js(t, e, n, r);
|
|
2392
2526
|
case "none":
|
|
2393
|
-
return
|
|
2527
|
+
return qs(t, e, n);
|
|
2394
2528
|
}
|
|
2395
2529
|
};
|
|
2396
|
-
var
|
|
2530
|
+
var Hs = async (t, e, n, r) => {
|
|
2397
2531
|
let s = null, i = null, o = await n(t);
|
|
2398
2532
|
if (t.endsWith("/index")) {
|
|
2399
2533
|
if (o) return { asset: { eTag: o, status: 200 }, redirect: null };
|
|
@@ -2409,9 +2543,9 @@ var Cs = async (t, e, n, r) => {
|
|
|
2409
2543
|
if (s = await _(t, t.slice(0, -5), e, n, r)) return s;
|
|
2410
2544
|
if (s = await _(`${t.slice(0, -5)}/index.html`, `${t.slice(0, -5)}/`, e, n, r)) return s;
|
|
2411
2545
|
}
|
|
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 :
|
|
2546
|
+
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 : nt(t, e, n);
|
|
2413
2547
|
};
|
|
2414
|
-
var
|
|
2548
|
+
var Ys = async (t, e, n, r) => {
|
|
2415
2549
|
let s = null, i = null, o = await n(t);
|
|
2416
2550
|
if (t.endsWith("/index")) {
|
|
2417
2551
|
if (o) return { asset: { eTag: o, status: 200 }, redirect: null };
|
|
@@ -2428,9 +2562,9 @@ var Ps = async (t, e, n, r) => {
|
|
|
2428
2562
|
if (o) return { asset: { eTag: o, status: 200 }, redirect: null };
|
|
2429
2563
|
if (s = await _(`${t.slice(0, -5)}/index.html`, `${t.slice(0, -5)}/`, e, n, r)) return s;
|
|
2430
2564
|
}
|
|
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 :
|
|
2565
|
+
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 : nt(t, e, n);
|
|
2432
2566
|
};
|
|
2433
|
-
var
|
|
2567
|
+
var js = async (t, e, n, r) => {
|
|
2434
2568
|
let s = null, i = null, o = await n(t);
|
|
2435
2569
|
if (t.endsWith("/index")) {
|
|
2436
2570
|
if (o) return { asset: { eTag: o, status: 200 }, redirect: null };
|
|
@@ -2457,13 +2591,13 @@ var Ms = async (t, e, n, r) => {
|
|
|
2457
2591
|
if (s = await _(t, t.slice(0, -5), e, n, r)) return s;
|
|
2458
2592
|
if (s = await _(`${t.slice(0, -5)}/index.html`, t.slice(0, -5), e, n, r)) return s;
|
|
2459
2593
|
}
|
|
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 } :
|
|
2594
|
+
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 } : nt(t, e, n);
|
|
2461
2595
|
};
|
|
2462
|
-
var
|
|
2596
|
+
var qs = async (t, e, n) => {
|
|
2463
2597
|
let r = await n(t);
|
|
2464
|
-
return r ? { asset: { eTag: r, status: 200 }, redirect: null } :
|
|
2598
|
+
return r ? { asset: { eTag: r, status: 200 }, redirect: null } : nt(t, e, n);
|
|
2465
2599
|
};
|
|
2466
|
-
var
|
|
2600
|
+
var nt = async (t, e, n) => {
|
|
2467
2601
|
switch (e.not_found_handling) {
|
|
2468
2602
|
case "single-page-application": {
|
|
2469
2603
|
let r = await n("/index.html");
|
|
@@ -2486,26 +2620,26 @@ var Ze = async (t, e, n) => {
|
|
|
2486
2620
|
var _ = async (t, e, n, r, s) => {
|
|
2487
2621
|
if (s) return null;
|
|
2488
2622
|
if (!await r(e)) {
|
|
2489
|
-
let i = await
|
|
2623
|
+
let i = await tt(e, n, r, true);
|
|
2490
2624
|
if (i?.asset && i.asset.eTag === await r(t)) return { asset: null, redirect: e };
|
|
2491
2625
|
}
|
|
2492
2626
|
return null;
|
|
2493
2627
|
};
|
|
2494
|
-
var
|
|
2628
|
+
var Yt = (t) => t.split("/").map((e) => {
|
|
2495
2629
|
try {
|
|
2496
2630
|
return decodeURIComponent(e);
|
|
2497
2631
|
} catch {
|
|
2498
2632
|
return e;
|
|
2499
2633
|
}
|
|
2500
2634
|
}).join("/");
|
|
2501
|
-
var
|
|
2635
|
+
var Ws = (t) => t.split("/").map((e) => {
|
|
2502
2636
|
try {
|
|
2503
2637
|
return encodeURIComponent(e);
|
|
2504
2638
|
} catch {
|
|
2505
2639
|
return e;
|
|
2506
2640
|
}
|
|
2507
2641
|
}).join("/");
|
|
2508
|
-
async function
|
|
2642
|
+
async function fr(t, e, n, r = 1) {
|
|
2509
2643
|
let s = 0;
|
|
2510
2644
|
for (; s <= r; ) try {
|
|
2511
2645
|
let i = await t.getWithMetadata(e, { type: "stream", cacheTtl: 31536e3 });
|
|
@@ -2514,43 +2648,33 @@ async function Zn(t, e, n, r = 1) {
|
|
|
2514
2648
|
return o.value !== null && n && n.captureException(new Error(`Initial request for asset ${e} failed, but subsequent request succeeded.`)), o;
|
|
2515
2649
|
}
|
|
2516
2650
|
return i;
|
|
2517
|
-
} catch {
|
|
2518
|
-
if (s >= r)
|
|
2651
|
+
} catch (i) {
|
|
2652
|
+
if (s >= r) {
|
|
2653
|
+
let o = `KV GET ${e} failed.`;
|
|
2654
|
+
throw i instanceof Error && (o = `KV GET ${e} failed: ${i.message}`), new Error(o);
|
|
2655
|
+
}
|
|
2519
2656
|
await new Promise((o) => setTimeout(o, Math.pow(2, s++) * 1e3));
|
|
2520
2657
|
}
|
|
2521
2658
|
}
|
|
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 {
|
|
2659
|
+
var pr = class extends zs {
|
|
2532
2660
|
async fetch(t) {
|
|
2533
|
-
let e, n = new
|
|
2661
|
+
let e, n = new Ze(this.env.ANALYTICS), r = new se(this.env.UNSAFE_PERFORMANCE), s = r.now();
|
|
2534
2662
|
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));
|
|
2663
|
+
this.env.JAEGER || (this.env.JAEGER = ir()), e = sr(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.VERSION_METADATA, this.env.CONFIG?.account_id, this.env.CONFIG?.script_id);
|
|
2664
|
+
let i = Ht(this.env.CONFIG), o = t.headers.get("user-agent") ?? "UA UNKNOWN", a = new URL(t.url);
|
|
2665
|
+
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.tag, hostname: a.hostname, htmlHandling: i.html_handling, notFoundHandling: i.not_found_handling, userAgent: o }), await 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 }), lr(t, this.env, i, this.unstable_exists.bind(this), this.unstable_getByETag.bind(this))));
|
|
2543
2666
|
} catch (i) {
|
|
2544
|
-
|
|
2545
|
-
|
|
2667
|
+
return this.handleError(e, n, i);
|
|
2668
|
+
} finally {
|
|
2669
|
+
this.submitMetrics(n, r, s);
|
|
2546
2670
|
}
|
|
2547
2671
|
}
|
|
2548
2672
|
handleError(t, e, n) {
|
|
2549
2673
|
try {
|
|
2550
|
-
let r = new
|
|
2674
|
+
let r = new $(n);
|
|
2551
2675
|
return t && t.captureException(n), n instanceof Error && e.setData({ error: n.message }), r;
|
|
2552
2676
|
} catch (r) {
|
|
2553
|
-
return console.error("Error handling error", r), new
|
|
2677
|
+
return console.error("Error handling error", r), new $(r);
|
|
2554
2678
|
}
|
|
2555
2679
|
}
|
|
2556
2680
|
submitMetrics(t, e, n) {
|
|
@@ -2561,11 +2685,11 @@ var er = class extends Fs {
|
|
|
2561
2685
|
}
|
|
2562
2686
|
}
|
|
2563
2687
|
async unstable_canFetch(t) {
|
|
2564
|
-
let e = new URL(t.url), n =
|
|
2565
|
-
return await
|
|
2688
|
+
let e = new URL(t.url), n = Yt(e.pathname);
|
|
2689
|
+
return await tt(n, { ...Ht(this.env.CONFIG), not_found_handling: "none" }, this.unstable_exists.bind(this)) !== null;
|
|
2566
2690
|
}
|
|
2567
2691
|
async unstable_getByETag(t) {
|
|
2568
|
-
let e = await
|
|
2692
|
+
let e = await fr(this.env.ASSETS_KV_NAMESPACE, t);
|
|
2569
2693
|
if (!e || !e.value) throw new Error(`Requested asset ${t} exists in the asset manifest but not in the KV namespace.`);
|
|
2570
2694
|
return { readableStream: e.value, contentType: e.metadata?.contentType ?? "application/octet-stream" };
|
|
2571
2695
|
}
|
|
@@ -2574,15 +2698,32 @@ var er = class extends Fs {
|
|
|
2574
2698
|
return e ? this.unstable_getByETag(e) : null;
|
|
2575
2699
|
}
|
|
2576
2700
|
async unstable_exists(t) {
|
|
2577
|
-
|
|
2701
|
+
let e = new et(this.env.EXPERIMENT_ANALYTICS), n = new se(this.env.UNSAFE_PERFORMANCE), r = 1 / 2e4, s = "binary";
|
|
2702
|
+
Math.random() < r && (s = "interpolation"), e.setData({ manifestReadMethod: s }), this.env.COLO_METADATA && this.env.VERSION_METADATA && this.env.CONFIG && e.setData({ accountId: this.env.CONFIG.account_id, experimentName: "manifest-read-timing" });
|
|
2703
|
+
let i = n.now();
|
|
2704
|
+
try {
|
|
2705
|
+
let o = new Qe(this.env.ASSETS_MANIFEST);
|
|
2706
|
+
if (s === "interpolation") try {
|
|
2707
|
+
return await o.getWithInterpolationSearch(t);
|
|
2708
|
+
} catch {
|
|
2709
|
+
return e.setData({ manifestReadMethod: "binary-fallback" }), await o.getWithBinarySearch(t);
|
|
2710
|
+
}
|
|
2711
|
+
else return await o.getWithBinarySearch(t);
|
|
2712
|
+
} finally {
|
|
2713
|
+
e.setData({ manifestReadTime: n.now() - i }), e.write();
|
|
2714
|
+
}
|
|
2578
2715
|
}
|
|
2579
2716
|
};
|
|
2580
2717
|
|
|
2718
|
+
// src/constants.ts
|
|
2719
|
+
var MODULE_TYPES = ["CompiledWasm"];
|
|
2720
|
+
|
|
2581
2721
|
// src/shared.ts
|
|
2582
2722
|
var UNKNOWN_HOST = "http://localhost";
|
|
2723
|
+
var MODULE_PATTERN = `__CLOUDFLARE_MODULE__(${MODULE_TYPES.join("|")})__(.*?)__`;
|
|
2583
2724
|
|
|
2584
2725
|
// src/asset-workers/asset-worker.ts
|
|
2585
|
-
var CustomAssetWorker = class extends
|
|
2726
|
+
var CustomAssetWorker = class extends pr {
|
|
2586
2727
|
async fetch(request) {
|
|
2587
2728
|
const response = await super.fetch(request);
|
|
2588
2729
|
const modifiedResponse = new Response(response.body, response);
|