@cloudflare/vite-plugin 0.0.0-a7163b3a2 → 0.0.0-aa3675bf7

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