@cloudflare/vite-plugin 0.0.3 → 0.0.5

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.
@@ -20,8 +20,38 @@ var ge = class {
20
20
  return this.performanceTimer ? this.performanceTimer.timeOrigin + this.performanceTimer.now() : Date.now();
21
21
  }
22
22
  };
23
+ var Ee = class extends Response {
24
+ constructor(e, n) {
25
+ super(e, { ...n, status: 200 });
26
+ }
27
+ };
28
+ var te = class extends Response {
29
+ constructor(...[e, n]) {
30
+ super(e, { ...n, status: 404, statusText: "Not Found" });
31
+ }
32
+ };
33
+ var ye = class extends Response {
34
+ constructor(...[e, n]) {
35
+ super(e, { ...n, status: 405, statusText: "Method Not Allowed" });
36
+ }
37
+ };
38
+ var L = class extends Response {
39
+ constructor(e, n) {
40
+ super(null, { ...n, status: 500 });
41
+ }
42
+ };
43
+ var Se = class extends Response {
44
+ constructor(...[e, n]) {
45
+ super(null, { ...n, status: 304, statusText: "Not Modified" });
46
+ }
47
+ };
48
+ var Te = class extends Response {
49
+ constructor(e, n) {
50
+ super(null, { ...n, status: 307, statusText: "Temporary Redirect", headers: { ...n?.headers, Location: e } });
51
+ }
52
+ };
23
53
  var Yt = Object.prototype.toString;
24
- function L(t) {
54
+ function B(t) {
25
55
  switch (Yt.call(t)) {
26
56
  case "[object Error]":
27
57
  case "[object Exception]":
@@ -37,7 +67,7 @@ function jt(t, e) {
37
67
  function W(t) {
38
68
  return jt(t, "String");
39
69
  }
40
- function Ee(t) {
70
+ function be(t) {
41
71
  return t === null || typeof t != "object" && typeof t != "function";
42
72
  }
43
73
  function I(t) {
@@ -49,13 +79,13 @@ function tt(t) {
49
79
  function nt(t) {
50
80
  return typeof Element < "u" && k(t, Element);
51
81
  }
52
- function B(t) {
82
+ function F(t) {
53
83
  return !!(t && t.then && typeof t.then == "function");
54
84
  }
55
85
  function rt(t) {
56
86
  return I(t) && "nativeEvent" in t && "preventDefault" in t && "stopPropagation" in t;
57
87
  }
58
- function te(t) {
88
+ function ne(t) {
59
89
  return typeof t == "number" && t !== t;
60
90
  }
61
91
  function k(t, e) {
@@ -71,20 +101,20 @@ function st(t) {
71
101
  function M(t, e = 0) {
72
102
  return typeof t != "string" || e === 0 || t.length <= e ? t : `${t.slice(0, e)}...`;
73
103
  }
74
- function ye(t) {
104
+ function Re(t) {
75
105
  return t && t.Math == Math ? t : void 0;
76
106
  }
77
- var h = typeof globalThis == "object" && ye(globalThis) || typeof window == "object" && ye(window) || typeof self == "object" && ye(self) || typeof global == "object" && ye(global) || /* @__PURE__ */ function() {
107
+ var h = typeof globalThis == "object" && Re(globalThis) || typeof window == "object" && Re(window) || typeof self == "object" && Re(self) || typeof global == "object" && Re(global) || /* @__PURE__ */ function() {
78
108
  return this;
79
109
  }() || {};
80
110
  function A() {
81
111
  return h;
82
112
  }
83
- function ne(t, e, n) {
113
+ function re(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 = A();
117
+ var Vs = A();
88
118
  var or = 80;
89
119
  function qt(t, e = {}) {
90
120
  if (!t) return "<unknown>";
@@ -110,9 +140,9 @@ function ar(t, e) {
110
140
  return r.join("");
111
141
  }
112
142
  var cr = "Sentry Logger ";
113
- var re = ["debug", "info", "warn", "error", "log", "assert", "trace"];
143
+ var se = ["debug", "info", "warn", "error", "log", "assert", "trace"];
114
144
  var z = {};
115
- function Se(t) {
145
+ function xe(t) {
116
146
  if (!("console" in h)) return t();
117
147
  let e = h.console, n = {}, r = Object.keys(z);
118
148
  r.forEach((s) => {
@@ -133,13 +163,13 @@ function ur() {
133
163
  }, disable: () => {
134
164
  t = false;
135
165
  }, isEnabled: () => t };
136
- return typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__ ? re.forEach((n) => {
166
+ return typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__ ? se.forEach((n) => {
137
167
  e[n] = (...r) => {
138
- t && Se(() => {
168
+ t && xe(() => {
139
169
  h.console[n](`${cr}[${n}]:`, ...r);
140
170
  });
141
171
  };
142
- }) : re.forEach((n) => {
172
+ }) : se.forEach((n) => {
143
173
  e[n] = () => {
144
174
  };
145
175
  }), e;
@@ -174,7 +204,7 @@ function fr(t) {
174
204
  let { port: e, projectId: n, protocol: r } = t;
175
205
  return ["protocol", "publicKey", "host", "projectId"].find((o) => t[o] ? false : (f.error(`Invalid Sentry Dsn: ${o} missing`), true)) ? false : n.match(/^\d+$/) ? lr(r) ? e && isNaN(parseInt(e, 10)) ? (f.error(`Invalid Sentry Dsn: Invalid port ${e}`), false) : true : (f.error(`Invalid Sentry Dsn: Invalid protocol ${r}`), false) : (f.error(`Invalid Sentry Dsn: Invalid projectId ${n}`), false);
176
206
  }
177
- function Te(t) {
207
+ function Ie(t) {
178
208
  let e = typeof t == "string" ? Wt(t) : zt(t);
179
209
  if (!(!e || !fr(e))) return e;
180
210
  }
@@ -205,8 +235,8 @@ function Kt(t, e) {
205
235
  function ot(t) {
206
236
  return Object.keys(t).map((e) => `${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&");
207
237
  }
208
- function be(t) {
209
- if (L(t)) return { message: t.message, name: t.name, stack: t.stack, ...Jt(t) };
238
+ function Ne(t) {
239
+ if (B(t)) return { message: t.message, name: t.name, stack: t.stack, ...Jt(t) };
210
240
  if (tt(t)) {
211
241
  let e = { type: t.type, target: Vt(t.target), currentTarget: Vt(t.currentTarget), ...Jt(t) };
212
242
  return typeof CustomEvent < "u" && k(t, CustomEvent) && (e.detail = t.detail), e;
@@ -226,8 +256,8 @@ function Jt(t) {
226
256
  return e;
227
257
  } else return {};
228
258
  }
229
- function se(t, e = 40) {
230
- let n = Object.keys(be(t));
259
+ function ie(t, e = 40) {
260
+ let n = Object.keys(Ne(t));
231
261
  if (n.sort(), !n.length) return "[object has no keys]";
232
262
  if (n[0].length >= e) return M(n[0], e);
233
263
  for (let r = n.length; r > 0; r--) {
@@ -287,7 +317,7 @@ function Xt(t) {
287
317
  var en = 50;
288
318
  var Zt = /\(error: (.*)\)/;
289
319
  var Qt = /captureMessage|captureException/;
290
- function Re(...t) {
320
+ function Ae(...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(`
@@ -311,7 +341,7 @@ function Re(...t) {
311
341
  };
312
342
  }
313
343
  function ct(t) {
314
- return Array.isArray(t) ? Re(...t) : t;
344
+ return Array.isArray(t) ? Ae(...t) : t;
315
345
  }
316
346
  function tn(t) {
317
347
  if (!t.length) return [];
@@ -319,7 +349,7 @@ function tn(t) {
319
349
  return /sentryWrapped/.test(e[e.length - 1].function || "") && e.pop(), e.reverse(), Qt.test(e[e.length - 1].function || "") && (e.pop(), Qt.test(e[e.length - 1].function || "") && e.pop()), e.slice(0, en).map((n) => ({ ...n, filename: n.filename || e[e.length - 1].filename, function: n.function || "?" }));
320
350
  }
321
351
  var at = "<anonymous>";
322
- function ie(t) {
352
+ function oe(t) {
323
353
  try {
324
354
  return !t || typeof t != "function" ? at : t.name || at;
325
355
  } catch {
@@ -353,14 +383,14 @@ function rn() {
353
383
  }
354
384
  return t;
355
385
  }
356
- var xe = A();
386
+ var De = A();
357
387
  function sn() {
358
- let t = xe.chrome, e = t && t.app && t.app.runtime, n = "history" in xe && !!xe.history.pushState && !!xe.history.replaceState;
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
391
  var y = A();
362
- var oe = "__sentry_xhr_v2__";
363
- var ae = {};
392
+ var ae = "__sentry_xhr_v2__";
393
+ var ce = {};
364
394
  var on = {};
365
395
  function hr(t) {
366
396
  if (!on[t]) switch (on[t] = true, t) {
@@ -390,21 +420,21 @@ function hr(t) {
390
420
  return;
391
421
  }
392
422
  }
393
- function we(t, e) {
394
- ae[t] = ae[t] || [], ae[t].push(e), hr(t);
423
+ function Ce(t, e) {
424
+ ce[t] = ce[t] || [], ce[t].push(e), hr(t);
395
425
  }
396
426
  function D(t, e) {
397
- if (!(!t || !ae[t])) for (let n of ae[t] || []) try {
427
+ if (!(!t || !ce[t])) for (let n of ce[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: ${ie(n)}
432
+ Name: ${oe(n)}
403
433
  Error:`, r);
404
434
  }
405
435
  }
406
436
  function _r() {
407
- "console" in h && re.forEach(function(t) {
437
+ "console" in h && se.forEach(function(t) {
408
438
  t in h.console && N(h.console, t, function(e) {
409
439
  return z[t] = e, function(...n) {
410
440
  D("console", { args: n, level: t });
@@ -444,10 +474,10 @@ function ln() {
444
474
  let t = XMLHttpRequest.prototype;
445
475
  N(t, "open", function(e) {
446
476
  return function(...n) {
447
- let r = Date.now(), s = n[1], i = this[oe] = { method: W(n[0]) ? n[0].toUpperCase() : n[0], url: n[1], request_headers: {} };
477
+ let r = Date.now(), s = n[1], i = this[ae] = { method: W(n[0]) ? n[0].toUpperCase() : n[0], url: n[1], request_headers: {} };
448
478
  W(s) && i.method === "POST" && s.match(/sentry_key/) && (this.__sentry_own_request__ = true);
449
479
  let o = () => {
450
- let a = this[oe];
480
+ let a = this[ae];
451
481
  if (a && this.readyState === 4) {
452
482
  try {
453
483
  a.status_code = this.status;
@@ -462,25 +492,25 @@ function ln() {
462
492
  };
463
493
  }) : this.addEventListener("readystatechange", o), N(this, "setRequestHeader", function(a) {
464
494
  return function(...c) {
465
- let [u, l] = c, d = this[oe];
495
+ let [u, l] = c, d = this[ae];
466
496
  return d && (d.request_headers[u.toLowerCase()] = l), a.apply(this, c);
467
497
  };
468
498
  }), e.apply(this, n);
469
499
  };
470
500
  }), N(t, "send", function(e) {
471
501
  return function(...n) {
472
- let r = this[oe];
502
+ let r = this[ae];
473
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 Ie;
507
+ var we;
478
508
  function Er() {
479
509
  if (!sn()) return;
480
510
  let t = y.onpopstate;
481
511
  y.onpopstate = function(...n) {
482
- let r = y.location.href, s = Ie;
483
- if (Ie = r, D("history", { from: s, to: r }), t) try {
512
+ let r = y.location.href, s = we;
513
+ if (we = r, D("history", { from: s, to: r }), t) try {
484
514
  return t.apply(this, n);
485
515
  } catch {
486
516
  }
@@ -489,8 +519,8 @@ 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 = Ie, o = String(s);
493
- Ie = o, D("history", { from: i, to: o });
522
+ let i = we, o = String(s);
523
+ we = o, D("history", { from: i, to: o });
494
524
  }
495
525
  return n.apply(this, r);
496
526
  };
@@ -499,7 +529,7 @@ function Er() {
499
529
  }
500
530
  var yr = 1e3;
501
531
  var cn;
502
- var Ne;
532
+ var Oe;
503
533
  function Sr(t, e) {
504
534
  if (t.type !== e.type) return false;
505
535
  try {
@@ -523,8 +553,8 @@ function un(t, e = false) {
523
553
  if (!n || n._sentryCaptured || Tr(n)) return;
524
554
  V(n, "_sentryCaptured", true);
525
555
  let r = n.type === "keypress" ? "input" : n.type;
526
- (Ne === void 0 || !Sr(Ne, n)) && (t({ event: n, name: r, global: e }), Ne = n), clearTimeout(cn), cn = y.setTimeout(() => {
527
- Ne = void 0;
556
+ (Oe === void 0 || !Sr(Oe, n)) && (t({ event: n, name: r, global: e }), Oe = n), clearTimeout(cn), cn = y.setTimeout(() => {
557
+ Oe = void 0;
528
558
  }, yr);
529
559
  };
530
560
  }
@@ -558,16 +588,16 @@ function fn() {
558
588
  }));
559
589
  });
560
590
  }
561
- var Ae = null;
591
+ var ve = null;
562
592
  function br() {
563
- Ae = y.onerror, y.onerror = function(t, e, n, r, s) {
564
- return D("error", { column: r, error: s, line: n, msg: t, url: e }), Ae && !Ae.__SENTRY_LOADER__ ? Ae.apply(this, arguments) : false;
593
+ ve = y.onerror, y.onerror = function(t, e, n, r, s) {
594
+ return D("error", { column: r, error: s, line: n, msg: t, url: e }), ve && !ve.__SENTRY_LOADER__ ? ve.apply(this, arguments) : false;
565
595
  }, y.onerror.__SENTRY_INSTRUMENTED__ = true;
566
596
  }
567
- var De = null;
597
+ var ke = null;
568
598
  function Rr() {
569
- De = y.onunhandledrejection, y.onunhandledrejection = function(t) {
570
- return D("unhandledrejection", t), De && !De.__SENTRY_LOADER__ ? De.apply(this, arguments) : true;
599
+ ke = y.onunhandledrejection, y.onunhandledrejection = function(t) {
600
+ return D("unhandledrejection", t), ke && !ke.__SENTRY_LOADER__ ? ke.apply(this, arguments) : true;
571
601
  }, y.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;
572
602
  }
573
603
  function pn() {
@@ -607,11 +637,11 @@ function g() {
607
637
  function xr(t) {
608
638
  return t.exception && t.exception.values ? t.exception.values[0] : void 0;
609
639
  }
610
- function ce(t, e, n) {
640
+ function ue(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 ue(t, e) {
644
+ function de(t, e) {
615
645
  let n = xr(t);
616
646
  if (!n) return;
617
647
  let r = { type: "generic", handled: true }, s = n.mechanism;
@@ -620,7 +650,7 @@ function ue(t, e) {
620
650
  n.mechanism.data = i;
621
651
  }
622
652
  }
623
- function Oe(t) {
653
+ function Pe(t) {
624
654
  if (t && t.__sentry_captured__) return true;
625
655
  try {
626
656
  V(t, "__sentry_captured__", true);
@@ -628,12 +658,12 @@ function Oe(t) {
628
658
  }
629
659
  return false;
630
660
  }
631
- function de(t) {
661
+ function le(t) {
632
662
  return Array.isArray(t) ? t : [t];
633
663
  }
634
664
  function w(t, e = 100, n = 1 / 0) {
635
665
  try {
636
- return ve("", t, e, n);
666
+ return Me("", t, e, n);
637
667
  } catch (r) {
638
668
  return { ERROR: `**non-serializable** (${r})` };
639
669
  }
@@ -642,9 +672,9 @@ function J(t, e = 3, n = 100 * 1024) {
642
672
  let r = w(t, e);
643
673
  return Dr(r) > n ? J(t, e - 1, n) : r;
644
674
  }
645
- function ve(t, e, n = 1 / 0, r = 1 / 0, s = _n()) {
675
+ function Me(t, e, n = 1 / 0, r = 1 / 0, s = _n()) {
646
676
  let [i, o] = s;
647
- if (e == null || ["number", "boolean", "string"].includes(typeof e) && !te(e)) return e;
677
+ if (e == null || ["number", "boolean", "string"].includes(typeof e) && !ne(e)) return e;
648
678
  let a = Ir(t, e);
649
679
  if (!a.startsWith("[object ")) return a;
650
680
  if (e.__sentry_skip_normalization__) return e;
@@ -654,10 +684,10 @@ function ve(t, e, n = 1 / 0, r = 1 / 0, s = _n()) {
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 Me("", m, c - 1, r, s);
658
688
  } catch {
659
689
  }
660
- let l = Array.isArray(e) ? [] : {}, d = 0, p = be(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) {
@@ -665,7 +695,7 @@ function ve(t, e, n = 1 / 0, r = 1 / 0, s = _n()) {
665
695
  break;
666
696
  }
667
697
  let v = p[m];
668
- l[m] = ve(m, v, c - 1, r, s), d++;
698
+ l[m] = Me(m, v, c - 1, r, s), d++;
669
699
  }
670
700
  return o(e), l;
671
701
  }
@@ -679,7 +709,7 @@ function Ir(t, e) {
679
709
  if (st(e)) return "[VueViewModel]";
680
710
  if (rt(e)) return "[SyntheticEvent]";
681
711
  if (typeof e == "number" && e !== e) return "[NaN]";
682
- if (typeof e == "function") return `[Function: ${ie(e)}]`;
712
+ if (typeof e == "function") return `[Function: ${oe(e)}]`;
683
713
  if (typeof e == "symbol") return `[${String(e)}]`;
684
714
  if (typeof e == "bigint") return `[BigInt: ${String(e)}]`;
685
715
  let n = Nr(e);
@@ -720,7 +750,7 @@ function b(t) {
720
750
  e(t);
721
751
  });
722
752
  }
723
- function F(t) {
753
+ function $(t) {
724
754
  return new S((e, n) => {
725
755
  n(t);
726
756
  });
@@ -785,7 +815,7 @@ var S = class {
785
815
  __init3() {
786
816
  this._setResult = (e, n) => {
787
817
  if (this._state === C.PENDING) {
788
- if (B(n)) {
818
+ if (F(n)) {
789
819
  n.then(this._resolve, this._reject);
790
820
  return;
791
821
  }
@@ -812,7 +842,7 @@ function pt(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 $(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;
@@ -850,17 +880,17 @@ function kr() {
850
880
  }
851
881
  var mt = mn() ? kr() : vr();
852
882
  var gn = mt === void 0 ? ht : { nowSeconds: () => (mt.timeOrigin + mt.now()) / 1e3 };
853
- var $ = ht.nowSeconds.bind(ht);
854
- var H = gn.nowSeconds.bind(gn);
855
- var le;
883
+ var H = ht.nowSeconds.bind(ht);
884
+ var Y = gn.nowSeconds.bind(gn);
885
+ var fe;
856
886
  var Cr = (() => {
857
887
  let { performance: t } = En;
858
888
  if (!t || !t.now) {
859
- le = "none";
889
+ fe = "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 ? (le = "timeOrigin", t.timeOrigin) : (le = "navigationStart", o) : (le = "dateNow", r);
893
+ return i || u ? s <= c ? (fe = "timeOrigin", t.timeOrigin) : (fe = "navigationStart", o) : (fe = "dateNow", r);
864
894
  })();
865
895
  var Pr = new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");
866
896
  function _t(t = g(), e = g().substring(16), n) {
@@ -874,7 +904,7 @@ function Et(t, e) {
874
904
  let [n, r] = t;
875
905
  return [n, [...r, e]];
876
906
  }
877
- function ke(t, e) {
907
+ function Ue(t, e) {
878
908
  let n = t[1];
879
909
  for (let r of n) {
880
910
  let s = r[0].type;
@@ -917,10 +947,10 @@ function St(t, e) {
917
947
  return [E({ type: "attachment", length: n.length, filename: t.filename, content_type: t.contentType, attachment_type: t.attachmentType }), n];
918
948
  }
919
949
  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 Ce(t) {
950
+ function Ge(t) {
921
951
  return Ur[t];
922
952
  }
923
- function Pe(t) {
953
+ function Le(t) {
924
954
  if (!t || !t.sdk) return;
925
955
  let { name: e, version: n } = t.sdk;
926
956
  return { name: e, version: n };
@@ -962,11 +992,11 @@ function Gr(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: ${se(t)}`;
995
+ } else return "message" in t && typeof t.message == "string" ? t.message : `Object captured as exception with keys: ${ie(t)}`;
966
996
  }
967
997
  function It(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 (!B(n)) {
970
1000
  if (I(n)) {
971
1001
  let c = t(), u = c.getClient(), l = u && u.getOptions().normalizeDepth;
972
1002
  c.configureScope((p) => {
@@ -978,7 +1008,7 @@ function It(t, e, n, r) {
978
1008
  o.synthetic = true;
979
1009
  }
980
1010
  let a = { exception: { values: [Tn(e, s)] } };
981
- return ce(a, void 0, void 0), ue(a, o), { ...a, event_id: r && r.event_id };
1011
+ return ue(a, void 0, void 0), de(a, o), { ...a, event_id: r && r.event_id };
982
1012
  }
983
1013
  function Nt(t, e, n = "info", r, s) {
984
1014
  let i = { event_id: r && r.event_id, level: n, message: e };
@@ -989,11 +1019,11 @@ function Nt(t, e, n = "info", r, s) {
989
1019
  return i;
990
1020
  }
991
1021
  var K = "production";
992
- function fe() {
993
- return ne("globalEventProcessors", () => []);
1022
+ function pe() {
1023
+ return re("globalEventProcessors", () => []);
994
1024
  }
995
1025
  function bn(t) {
996
- fe().push(t);
1026
+ pe().push(t);
997
1027
  }
998
1028
  function X(t, e, n, r = 0) {
999
1029
  return new S((s, i) => {
@@ -1001,16 +1031,16 @@ function X(t, e, n, r = 0) {
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) => X(t, c, n, r + 1).then(s)).then(null, i) : X(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`), F(a) ? a.then((c) => X(t, c, n, r + 1).then(s)).then(null, i) : X(t, a, n, r + 1).then(s).then(null, i);
1005
1035
  }
1006
1036
  });
1007
1037
  }
1008
1038
  function Rn(t) {
1009
- let e = H(), n = { sid: g(), init: true, timestamp: e, started: e, duration: 0, status: "ok", errors: 0, ignoreDuration: false, toJSON: () => Lr(n) };
1039
+ let e = Y(), n = { sid: g(), init: true, timestamp: e, started: e, duration: 0, status: "ok", errors: 0, ignoreDuration: false, toJSON: () => Lr(n) };
1010
1040
  return t && P(n, t), n;
1011
1041
  }
1012
1042
  function P(t, e = {}) {
1013
- if (e.user && (!t.ipAddress && e.user.ip_address && (t.ipAddress = e.user.ip_address), !t.did && !e.did && (t.did = e.user.id || e.user.email || e.user.username)), t.timestamp = e.timestamp || H(), e.abnormal_mechanism && (t.abnormal_mechanism = e.abnormal_mechanism), e.ignoreDuration && (t.ignoreDuration = e.ignoreDuration), e.sid && (t.sid = e.sid.length === 32 ? e.sid : g()), e.init !== void 0 && (t.init = e.init), !t.did && e.did && (t.did = `${e.did}`), typeof e.started == "number" && (t.started = e.started), t.ignoreDuration) t.duration = void 0;
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 || Y(), 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;
@@ -1106,7 +1136,7 @@ var O = class {
1106
1136
  addBreadcrumb(e, n) {
1107
1137
  let r = typeof n == "number" ? n : Br;
1108
1138
  if (r <= 0) return this;
1109
- let s = { timestamp: $(), ...e }, i = this._breadcrumbs;
1139
+ let s = { timestamp: H(), ...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 O = 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 }, X([...r || [], ...fe(), ...this._eventProcessors], e, n);
1169
+ return e.breadcrumbs = i.length > 0 ? i : void 0, e.sdkProcessingMetadata = { ...e.sdkProcessingMetadata, ...this._sdkProcessingMetadata, propagationContext: this._propagationContext }, X([...r || [], ...pe(), ...this._eventProcessors], e, n);
1140
1170
  }
1141
1171
  setSDKProcessingMetadata(e) {
1142
1172
  return this._sdkProcessingMetadata = { ...this._sdkProcessingMetadata, ...e }, this;
@@ -1156,7 +1186,7 @@ var O = class {
1156
1186
  }), this._notifyingListeners = false);
1157
1187
  }
1158
1188
  _applyFingerprint(e) {
1159
- e.fingerprint = e.fingerprint ? de(e.fingerprint) : [], this._fingerprint && (e.fingerprint = e.fingerprint.concat(this._fingerprint)), e.fingerprint && !e.fingerprint.length && delete e.fingerprint;
1189
+ e.fingerprint = e.fingerprint ? le(e.fingerprint) : [], this._fingerprint && (e.fingerprint = e.fingerprint.concat(this._fingerprint)), e.fingerprint && !e.fingerprint.length && delete e.fingerprint;
1160
1190
  }
1161
1191
  };
1162
1192
  function In() {
@@ -1164,7 +1194,7 @@ function In() {
1164
1194
  }
1165
1195
  var Nn = 4;
1166
1196
  var Fr = 100;
1167
- var Y = class {
1197
+ var j = class {
1168
1198
  constructor(e, n = new O(), r = Nn) {
1169
1199
  this._version = r, this._stack = [{ scope: n }], e && this.bindClient(e);
1170
1200
  }
@@ -1228,7 +1258,7 @@ var Y = class {
1228
1258
  if (!s) return;
1229
1259
  let { beforeBreadcrumb: i = null, maxBreadcrumbs: o = Fr } = s.getOptions && s.getOptions() || {};
1230
1260
  if (o <= 0) return;
1231
- let c = { timestamp: $(), ...e }, u = i ? Se(() => i(c, n)) : c;
1261
+ let c = { timestamp: H(), ...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) {
@@ -1309,34 +1339,34 @@ Sentry.init({...});
1309
1339
  r && e(r, n);
1310
1340
  }
1311
1341
  _callExtensionMethod(e, ...n) {
1312
- let s = j().__SENTRY__;
1342
+ let s = q().__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 j() {
1347
+ function q() {
1318
1348
  return h.__SENTRY__ = h.__SENTRY__ || { extensions: {}, hub: void 0 }, h;
1319
1349
  }
1320
1350
  function At(t) {
1321
- let e = j(), n = Me(e);
1351
+ let e = q(), n = Be(e);
1322
1352
  return Dt(e, t), n;
1323
1353
  }
1324
1354
  function R() {
1325
- let t = j();
1355
+ let t = q();
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
1360
  return $r(t);
1331
1361
  }
1332
- function $r(t = j()) {
1333
- return (!Hr(t) || Me(t).isOlderThan(Nn)) && Dt(t, new Y()), Me(t);
1362
+ function $r(t = q()) {
1363
+ return (!Hr(t) || Be(t).isOlderThan(Nn)) && Dt(t, new j()), Be(t);
1334
1364
  }
1335
1365
  function Hr(t) {
1336
1366
  return !!(t && t.__SENTRY__ && t.__SENTRY__.hub);
1337
1367
  }
1338
- function Me(t) {
1339
- return ne("hub", () => new Y(), t);
1368
+ function Be(t) {
1369
+ return re("hub", () => new j(), t);
1340
1370
  }
1341
1371
  function Dt(t, e) {
1342
1372
  if (!t) return false;
@@ -1348,7 +1378,7 @@ function An(t) {
1348
1378
  }
1349
1379
  var Dn = false;
1350
1380
  function wn() {
1351
- Dn || (Dn = true, we("error", wt), we("unhandledrejection", wt));
1381
+ Dn || (Dn = true, Ce("error", wt), Ce("unhandledrejection", wt));
1352
1382
  }
1353
1383
  function wt() {
1354
1384
  let t = An();
@@ -1358,7 +1388,7 @@ function wt() {
1358
1388
  }
1359
1389
  }
1360
1390
  wt.tag = "sentry_tracingErrorCallback";
1361
- var Ue = class {
1391
+ var Fe = class {
1362
1392
  constructor(e = 1e3) {
1363
1393
  this._maxlen = e, this.spans = [];
1364
1394
  }
@@ -1368,7 +1398,7 @@ var Ue = class {
1368
1398
  };
1369
1399
  var Z = class {
1370
1400
  constructor(e = {}) {
1371
- this.traceId = e.traceId || g(), this.spanId = e.spanId || g().substring(16), this.startTimestamp = e.startTimestamp || H(), this.tags = e.tags || {}, this.data = e.data || {}, this.instrumenter = e.instrumenter || "sentry", this.origin = e.origin || "manual", e.parentSpanId && (this.parentSpanId = e.parentSpanId), "sampled" in e && (this.sampled = e.sampled), e.op && (this.op = e.op), e.description && (this.description = e.description), e.name && (this.description = e.name), e.status && (this.status = e.status), e.endTimestamp && (this.endTimestamp = e.endTimestamp);
1401
+ this.traceId = e.traceId || g(), this.spanId = e.spanId || g().substring(16), this.startTimestamp = e.startTimestamp || Y(), 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 || "";
@@ -1409,7 +1439,7 @@ var Z = 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 : H();
1442
+ this.endTimestamp = typeof e == "number" ? e : Y();
1413
1443
  }
1414
1444
  toTraceparent() {
1415
1445
  return _t(this.traceId, this.spanId, this.sampled);
@@ -1461,7 +1491,7 @@ function Q(t, e, n) {
1461
1491
  let r = e.getOptions(), { publicKey: s } = e.getDsn() || {}, { segment: i } = n && n.getUser() || {}, o = E({ environment: r.environment || K, release: r.release, user_segment: i, public_key: s, trace_id: t });
1462
1492
  return e.emit && e.emit("createDsc", o), o;
1463
1493
  }
1464
- var Ge = class extends Z {
1494
+ var $e = class extends Z {
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 Ge = class extends Z {
1477
1507
  this._name = e, this.metadata.source = n;
1478
1508
  }
1479
1509
  initSpanRecorder(e = 1e3) {
1480
- this.spanRecorder || (this.spanRecorder = new Ue(e)), this.spanRecorder.add(this);
1510
+ this.spanRecorder || (this.spanRecorder = new Fe(e)), this.spanRecorder.add(this);
1481
1511
  }
1482
1512
  setContext(e, n) {
1483
1513
  n === null ? delete this._contexts[e] : this._contexts[e] = n;
@@ -1537,7 +1567,7 @@ function vn(t, e, n) {
1537
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 })), jr(r) ? r ? (t.sampled = Math.random() < r, t.sampled ? ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(`[Tracing] starting ${t.op} transaction - ${t.name}`), t) : ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(r)})`), t)) : ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler == "function" ? "tracesSampler returned 0 or false" : "a negative sampling decision was inherited or tracesSampleRate is set to 0"}`), t.sampled = false, t) : ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("[Tracing] Discarding transaction because of invalid sample rate."), t.sampled = false, t);
1538
1568
  }
1539
1569
  function jr(t) {
1540
- return te(t) || !(typeof t == "number" || typeof t == "boolean") ? ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`), false) : t < 0 || t > 1 ? ((typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${t}.`), false) : true;
1570
+ return ne(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
1572
  function qr() {
1543
1573
  let e = this.getScope().getSpan();
@@ -1547,14 +1577,14 @@ function Wr(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 Ge(t, this);
1580
+ let o = new $e(t, this);
1551
1581
  return o = vn(o, r, { parentSampled: t.parentSampled, transactionContext: t, ...e }), o.sampled && o.initSpanRecorder(r._experiments && r._experiments.maxSpans), n && n.emit && n.emit("startTransaction", o), o;
1552
1582
  }
1553
1583
  function kn() {
1554
- let t = j();
1584
+ let t = q();
1555
1585
  t.__SENTRY__ && (t.__SENTRY__.extensions = t.__SENTRY__.extensions || {}, t.__SENTRY__.extensions.startTransaction || (t.__SENTRY__.extensions.startTransaction = Wr), t.__SENTRY__.extensions.traceHeaders || (t.__SENTRY__.extensions.traceHeaders = qr), wn());
1556
1586
  }
1557
- var Le = class {
1587
+ var He = 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
  }
@@ -1607,11 +1637,11 @@ function Xr(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
1639
  function Pn(t, e, n, r) {
1610
- let s = Pe(n), i = { sent_at: (/* @__PURE__ */ new Date()).toISOString(), ...s && { sdk: s }, ...!!r && e && { dsn: U(e) } }, o = "aggregates" in t ? [{ type: "sessions" }, t] : [{ type: "session" }, t.toJSON()];
1640
+ let s = Le(n), i = { sent_at: (/* @__PURE__ */ new Date()).toISOString(), ...s && { sdk: s }, ...!!r && e && { dsn: U(e) } }, o = "aggregates" in t ? [{ type: "sessions" }, t] : [{ type: "session" }, t.toJSON()];
1611
1641
  return G(i, [o]);
1612
1642
  }
1613
1643
  function Mn(t, e, n, r) {
1614
- let s = Pe(n), i = t.type && t.type !== "replay_event" ? t.type : "event";
1644
+ let s = Le(n), i = t.type && t.type !== "replay_event" ? t.type : "event";
1615
1645
  Xr(t, n && n.sdk);
1616
1646
  let o = Tt(t, s, r, e);
1617
1647
  return delete t.sdkProcessingMetadata, G(o, [[{ type: i }, t]]);
@@ -1630,7 +1660,7 @@ function Ot(t) {
1630
1660
  o.isDefaultInstance = true;
1631
1661
  });
1632
1662
  let r;
1633
- Array.isArray(n) ? r = [...e, ...n] : typeof n == "function" ? r = de(n(e)) : r = e;
1663
+ Array.isArray(n) ? r = [...e, ...n] : typeof n == "function" ? r = le(n(e)) : r = e;
1634
1664
  let s = Zr(r), i = Qr(s, (o) => o.name === "Debug");
1635
1665
  if (i !== -1) {
1636
1666
  let [o] = s.splice(i, 1);
@@ -1660,7 +1690,7 @@ function Qr(t, e) {
1660
1690
  return -1;
1661
1691
  }
1662
1692
  function Bn(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 || $() }, c = n.integrations || t.integrations.map((p) => p.name);
1693
+ let { normalizeDepth: i = 3, normalizeMaxBreadth: o = 1e3 } = t, a = { ...e, event_id: e.event_id || n.event_id || g(), timestamp: e.timestamp || H() }, c = n.integrations || t.integrations.map((p) => p.name);
1664
1694
  es(a, t), rs(a, c), e.type === void 0 && ts(a, t.stackParser);
1665
1695
  let u = r;
1666
1696
  n.captureContext && (u = O.clone(u).update(n.captureContext));
@@ -1671,7 +1701,7 @@ function Bn(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 = X([...d, ...fe()], a, n);
1704
+ } else l = X([...d, ...pe()], a, n);
1675
1705
  return l.then((p) => (p && ns(p), typeof i == "number" && i > 0 ? ss(p, i, o) : p));
1676
1706
  }
1677
1707
  function es(t, e) {
@@ -1735,15 +1765,15 @@ function ss(t, e, n) {
1735
1765
  return t.contexts && t.contexts.trace && r.contexts && (r.contexts.trace = t.contexts.trace, t.contexts.trace.data && (r.contexts.trace.data = w(t.contexts.trace.data, e, n))), t.spans && (r.spans = t.spans.map((s) => (s.data && (s.data = w(s.data, e, n)), s))), r;
1736
1766
  }
1737
1767
  var Fn = "Not capturing exception because it's already been captured.";
1738
- var Be = class {
1768
+ var Ye = 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 = Te(e.dsn) : (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("No DSN provided, client will not send events."), this._dsn) {
1770
+ if (this._options = e, this._integrations = {}, this._integrationsInitialized = false, this._numProcessing = 0, this._outcomes = {}, this._hooks = {}, this._eventProcessors = [], e.dsn ? this._dsn = Ie(e.dsn) : (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("No DSN provided, client will not send events."), this._dsn) {
1741
1771
  let n = Cn(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 (Oe(e)) {
1776
+ if (Pe(e)) {
1747
1777
  (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(Fn);
1748
1778
  return;
1749
1779
  }
@@ -1753,13 +1783,13 @@ var Be = class {
1753
1783
  })), s;
1754
1784
  }
1755
1785
  captureMessage(e, n, r, s) {
1756
- let i = r && r.event_id, o = Ee(e) ? this.eventFromMessage(String(e), n, r) : this.eventFromException(e, r);
1786
+ let i = r && r.event_id, o = be(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 && Oe(n.originalException)) {
1792
+ if (n && n.originalException && Pe(n.originalException)) {
1763
1793
  (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.log(Fn);
1764
1794
  return;
1765
1795
  }
@@ -1884,7 +1914,7 @@ var Be = class {
1884
1914
  }
1885
1915
  _processEvent(e, n, r) {
1886
1916
  let s = this.getOptions(), { sampleRate: i } = s, o = Hn(e), a = $n(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"));
1917
+ if (a && typeof i == "number" && Math.random() > i) return this.recordDroppedEvent("sample_rate", "error", e), $(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");
@@ -1925,7 +1955,7 @@ Reason: ${d}`));
1925
1955
  };
1926
1956
  function is(t, e) {
1927
1957
  let n = `${e} must return \`null\` or a valid event.`;
1928
- if (B(t)) return t.then((r) => {
1958
+ if (F(t)) return t.then((r) => {
1929
1959
  if (!I(r) && r !== null) throw new T(n);
1930
1960
  return r;
1931
1961
  }, (r) => {
@@ -1953,7 +1983,7 @@ function Yn(t, e, n, r, s) {
1953
1983
  function as(t) {
1954
1984
  return [{ type: "check_in" }, t];
1955
1985
  }
1956
- var pe = class extends Be {
1986
+ var me = class extends Ye {
1957
1987
  constructor(e) {
1958
1988
  kn(), super(e);
1959
1989
  }
@@ -1982,7 +2012,7 @@ var pe = 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 He(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();
@@ -2013,17 +2043,17 @@ function kt(t, e, n = pt(t.bufferSize || cs)) {
2013
2043
  let r = {}, s = (o) => n.drain(o);
2014
2044
  function i(o) {
2015
2045
  let a = [];
2016
- if (ke(o, (d, p) => {
2017
- let m = Ce(p);
2046
+ if (Ue(o, (d, p) => {
2047
+ let m = Ge(p);
2018
2048
  if (bt(r, m)) {
2019
2049
  let v = jn(d, p);
2020
2050
  t.recordDroppedEvent("ratelimit_backoff", m, v);
2021
2051
  } else a.push(d);
2022
2052
  }), a.length === 0) return b();
2023
2053
  let c = G(o[0], a), u = (d) => {
2024
- ke(c, (p, m) => {
2054
+ Ue(c, (p, m) => {
2025
2055
  let v = jn(p, m);
2026
- t.recordDroppedEvent(d, Ce(m), v);
2056
+ t.recordDroppedEvent(d, Ge(m), v);
2027
2057
  });
2028
2058
  }, l = () => e({ body: yt(c, t.textEncoder) }).then((d) => (d.statusCode !== void 0 && (d.statusCode < 200 || d.statusCode >= 300) && (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn(`Sentry responded with status code ${d.statusCode} to sent event.`), r = Rt(r, d), d), (d) => {
2029
2059
  throw u("network_error"), d;
@@ -2066,10 +2096,10 @@ function Vn(t, e) {
2066
2096
  }
2067
2097
  function ps(t, e, n, r) {
2068
2098
  let s, o = (r && r.data && ds(r.data) ? r.data.mechanism : void 0) ?? { handled: true, type: "generic" };
2069
- if (L(n)) s = n;
2099
+ if (B(n)) s = n;
2070
2100
  else {
2071
2101
  if (I(n)) {
2072
- let c = `Non-Error exception captured with keys: ${se(n)}`, u = t?.getClient(), l = u && u.getOptions().normalizeDepth;
2102
+ let c = `Non-Error exception captured with keys: ${ie(n)}`, u = t?.getClient(), l = u && u.getOptions().normalizeDepth;
2073
2103
  t?.configureScope((d) => {
2074
2104
  d.setExtra("__serialized__", J(n, l));
2075
2105
  }), s = r && r.syntheticException || new Error(c), s.message = c;
@@ -2077,7 +2107,7 @@ function ps(t, e, n, r) {
2077
2107
  o.synthetic = true;
2078
2108
  }
2079
2109
  let a = { exception: { values: [Vn(e, s)] } };
2080
- return ce(a, void 0, void 0), ue(a, o), { ...a, event_id: r && r.event_id };
2110
+ return ue(a, void 0, void 0), de(a, o), { ...a, event_id: r && r.event_id };
2081
2111
  }
2082
2112
  function ms(t, e, n = "info", r, s) {
2083
2113
  let i = { event_id: r && r.event_id, level: n, message: e };
@@ -2088,8 +2118,8 @@ function ms(t, e, n = "info", r, s) {
2088
2118
  return i;
2089
2119
  }
2090
2120
  var hs = 5;
2091
- var Ye = class {
2092
- name = Ye.id;
2121
+ var ze = class {
2122
+ name = ze.id;
2093
2123
  limit;
2094
2124
  constructor(e = {}) {
2095
2125
  this.limit = e.limit || hs;
@@ -2097,13 +2127,13 @@ var Ye = class {
2097
2127
  setupOnce(e, n) {
2098
2128
  let r = n().getClient();
2099
2129
  r && e((s, i) => {
2100
- let o = n().getIntegration(Ye);
2130
+ let o = n().getIntegration(ze);
2101
2131
  return o ? _s(r.getOptions().stackParser, o.limit, s, i) : s;
2102
2132
  });
2103
2133
  }
2104
2134
  };
2105
- var Fe = Ye;
2106
- _e(Fe, "id", "LinkedErrors");
2135
+ var je = ze;
2136
+ _e(je, "id", "LinkedErrors");
2107
2137
  function _s(t, e, n, r) {
2108
2138
  if (!n.exception || !n.exception.values || !r || !k(r.originalException, Error)) return n;
2109
2139
  let s = Jn(t, e, r.originalException);
@@ -2116,21 +2146,21 @@ function Jn(t, e, n, r = []) {
2116
2146
  }
2117
2147
  var gs = { allowedHeaders: ["CF-RAY", "CF-Worker"] };
2118
2148
  var ee;
2119
- var je = class {
2149
+ var Ve = class {
2120
2150
  constructor(e = {}) {
2121
- _e(this, "name", je.id);
2151
+ _e(this, "name", Ve.id);
2122
2152
  $t(this, ee, void 0);
2123
2153
  Ht(this, ee, { ...gs, ...e });
2124
2154
  }
2125
2155
  setupOnce(e, n) {
2126
2156
  n().getClient() && e((s) => {
2127
2157
  let { sdkProcessingMetadata: i } = s;
2128
- return !n().getIntegration(je) || !i || ("request" in i && i.request instanceof Request && (s.request = ys(i.request, et(this, ee)), s.user = Es(s.user ?? {}, i.request, et(this, ee))), "requestData" in i && (s.request ? s.request.data = i.requestData : s.request = { data: i.requestData })), s;
2158
+ return !n().getIntegration(Ve) || !i || ("request" in i && i.request instanceof Request && (s.request = ys(i.request, et(this, ee)), s.user = Es(s.user ?? {}, i.request, et(this, ee))), "requestData" in i && (s.request ? s.request.data = i.requestData : s.request = { data: i.requestData })), s;
2129
2159
  });
2130
2160
  }
2131
2161
  };
2132
- var $e = je;
2133
- ee = /* @__PURE__ */ new WeakMap(), _e($e, "id", "RequestData");
2162
+ var qe = Ve;
2163
+ ee = /* @__PURE__ */ new WeakMap(), _e(qe, "id", "RequestData");
2134
2164
  function Es(t, e, n) {
2135
2165
  let r = e.headers.get("CF-Connecting-IP"), { allowedIps: s } = n, i = { ...t };
2136
2166
  return !("ip_address" in t) && r && s !== void 0 && Ss(r, s) && (i.ip_address = r), Object.keys(i).length > 0 ? i : void 0;
@@ -2189,7 +2219,7 @@ function bs(t, e) {
2189
2219
  }, () => e);
2190
2220
  }), n;
2191
2221
  }
2192
- var Pt = class extends pe {
2222
+ var Pt = class extends me {
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);
@@ -2233,21 +2263,21 @@ function Rs(t) {
2233
2263
  function xs(t) {
2234
2264
  if (t) return ft(t, ".js");
2235
2265
  }
2236
- var Is = Re(Rs(xs));
2266
+ var Is = Ae(Rs(xs));
2237
2267
  function Ns(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 $(r);
2244
2274
  }
2245
2275
  }
2246
2276
  return kt(t, e);
2247
2277
  }
2248
- var He = class extends Y {
2278
+ var We = class extends j {
2249
2279
  constructor(e) {
2250
- if (e.defaultIntegrations = e.defaultIntegrations === false ? [] : [...Array.isArray(e.defaultIntegrations) ? e.defaultIntegrations : [new $e(e.requestDataOptions), new Fe()]], e.release === void 0) {
2280
+ if (e.defaultIntegrations = e.defaultIntegrations === false ? [] : [...Array.isArray(e.defaultIntegrations) ? e.defaultIntegrations : [new qe(e.requestDataOptions), new je()]], e.release === void 0) {
2251
2281
  let r = ls();
2252
2282
  r !== void 0 && (e.release = r);
2253
2283
  }
@@ -2266,7 +2296,7 @@ var He = class extends Y {
2266
2296
  };
2267
2297
  function Kn(t, e, n, r, s, i, o, a) {
2268
2298
  if (!(n && r && s)) return;
2269
- let c = new He({ dsn: n, request: t, context: e, sampleRate: 1, requestDataOptions: { allowedHeaders: ["user-agent", "cf-challenge", "accept-encoding", "accept-language", "cf-ray", "content-length", "content-type", "host"], allowedSearchParams: /(.*)/ }, transportOptions: { headers: { "CF-Access-Client-ID": r, "CF-Access-Client-Secret": s } } });
2299
+ let c = new We({ 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
2302
  function As() {
@@ -2278,7 +2308,7 @@ function As() {
2278
2308
  function Xn() {
2279
2309
  return { enterSpan: (t, e, ...n) => e(As(), ...n), getSpanContext: () => ({ traceId: "test-trace", spanId: "test-span", parentSpanId: "test-parent-span", traceFlags: 0 }), runWithSpanContext: (t, e, ...n) => e(...n), traceId: "test-trace", spanId: "test-span", parentSpanId: "test-parent-span", cfTraceIdHeader: "test-trace:test-span:0" };
2280
2310
  }
2281
- var qe = class {
2311
+ var Je = class {
2282
2312
  constructor(e) {
2283
2313
  this.data = {};
2284
2314
  this.readyAnalytics = e;
@@ -2293,7 +2323,7 @@ var qe = class {
2293
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] });
2294
2324
  }
2295
2325
  };
2296
- var ze = class {
2326
+ var Xe = class {
2297
2327
  constructor(e) {
2298
2328
  this.data = e;
2299
2329
  }
@@ -2329,36 +2359,9 @@ var vs = (t, e) => {
2329
2359
  return 0;
2330
2360
  };
2331
2361
  var ks = (t) => [...t.slice(16, 16 + 16)].map((n) => n.toString(16).padStart(2, "0")).join("");
2332
- var Ut = (t) => ({ html_handling: t?.html_handling ?? "auto-trailing-slash", not_found_handling: t?.not_found_handling ?? "none", serve_directly: t?.serve_directly ?? true });
2333
- var Ve = class extends Response {
2334
- constructor(e, n) {
2335
- super(e, { ...n, status: 200 });
2336
- }
2337
- };
2338
- var he = class extends Response {
2339
- constructor(...[e, n]) {
2340
- super(e, { ...n, status: 404, statusText: "Not Found" });
2341
- }
2342
- };
2343
- var Je = class extends Response {
2344
- constructor(...[e, n]) {
2345
- super(e, { ...n, status: 405, statusText: "Method Not Allowed" });
2346
- }
2347
- };
2348
- var q = class extends Response {
2349
- constructor(e, n) {
2350
- super(null, { ...n, status: 500 });
2351
- }
2352
- };
2353
- var Ke = class extends Response {
2354
- constructor(...[e, n]) {
2355
- super(null, { ...n, status: 304, statusText: "Not Modified" });
2356
- }
2357
- };
2358
- var Xe = class extends Response {
2359
- constructor(e, n) {
2360
- super(null, { ...n, status: 307, statusText: "Temporary Redirect", headers: { ...n?.headers, Location: e } });
2361
- }
2362
+ var Ut = (t) => {
2363
+ let e;
2364
+ 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 };
2362
2365
  };
2363
2366
  var Zn = "public, max-age=0, must-revalidate";
2364
2367
  function Qn(t, e, n) {
@@ -2372,21 +2375,21 @@ var er = async (t, e, n, r, s) => {
2372
2375
  let { pathname: i, search: o } = new URL(t.url), a = Gt(i);
2373
2376
  a = a.replace(/\/+/g, "/");
2374
2377
  let c = await Ze(a, n, r);
2375
- if (!c) return e.JAEGER.enterSpan("no_intent", (x) => (x.setTags({ decodedPathname: a, configuration: JSON.stringify(n), status: 404 }), new he()));
2378
+ if (!c) return e.JAEGER.enterSpan("no_intent", (x) => (x.setTags({ decodedPathname: a, configuration: JSON.stringify(n), status: 404 }), new te()));
2376
2379
  let u = t.method.toUpperCase();
2377
- if (!["GET", "HEAD"].includes(u)) return e.JAEGER.enterSpan("method_not_allowed", (x) => (x.setTags({ method: u, status: 405 }), new Je()));
2380
+ if (!["GET", "HEAD"].includes(u)) return e.JAEGER.enterSpan("method_not_allowed", (x) => (x.setTags({ method: u, status: 405 }), new ye()));
2378
2381
  let l = c.redirect ?? a, d = Ls(l);
2379
- if (d !== i && c.asset || c.redirect) return e.JAEGER.enterSpan("redirect", (x) => (x.setTags({ originalPath: i, location: d !== i ? d : c.redirect ?? "<unknown>", status: 307 }), new Xe(d + o)));
2380
- if (!c.asset) return e.JAEGER.enterSpan("unknown_action", (x) => (x.setTags({ pathname: i, status: 500 }), new q(new Error("Unknown action"))));
2382
+ if (d !== i && c.asset || c.redirect) return e.JAEGER.enterSpan("redirect", (x) => (x.setTags({ originalPath: i, location: d !== i ? d : c.redirect ?? "<unknown>", status: 307 }), new Te(d + o)));
2383
+ if (!c.asset) return e.JAEGER.enterSpan("unknown_action", (x) => (x.setTags({ pathname: i, status: 500 }), new L(new Error("Unknown action"))));
2381
2384
  let p = await e.JAEGER.enterSpan("getByETag", async (x) => (x.setTags({ pathname: i, eTag: c.asset.eTag, status: c.asset.status }), await s(c.asset.eTag))), m = Qn(c.asset.eTag, p.contentType, t), v = `"${c.asset.eTag}"`, rr = `W/${v}`, Lt = t.headers.get("If-None-Match") || "";
2382
- return [rr, v].includes(Lt) ? e.JAEGER.enterSpan("matched_etag", (x) => (x.setTags({ matchedEtag: Lt, status: 304 }), new Ke(null, { headers: m }))) : e.JAEGER.enterSpan("response", (x) => {
2385
+ return [rr, v].includes(Lt) ? e.JAEGER.enterSpan("matched_etag", (x) => (x.setTags({ matchedEtag: Lt, status: 304 }), new Se(null, { headers: m }))) : e.JAEGER.enterSpan("response", (x) => {
2383
2386
  x.setTags({ etag: c.asset.eTag, status: c.asset.status, head: u === "HEAD" });
2384
2387
  let Bt = u === "HEAD" ? null : p.readableStream;
2385
2388
  switch (c.asset.status) {
2386
2389
  case 404:
2387
- return new he(Bt, { headers: m });
2390
+ return new te(Bt, { headers: m });
2388
2391
  case 200:
2389
- return new Ve(Bt, { headers: m });
2392
+ return new Ee(Bt, { headers: m });
2390
2393
  }
2391
2394
  });
2392
2395
  };
@@ -2530,11 +2533,11 @@ async function tr(t, e, n, r = 1) {
2530
2533
  }
2531
2534
  var nr = class extends Bs {
2532
2535
  async fetch(t) {
2533
- let e, n = new qe(this.env.ANALYTICS), r = new ge(this.env.UNSAFE_PERFORMANCE), s = r.now();
2536
+ let e, n = new Je(this.env.ANALYTICS), r = new ge(this.env.UNSAFE_PERFORMANCE), s = r.now();
2534
2537
  try {
2535
2538
  this.env.JAEGER || (this.env.JAEGER = Xn()), e = Kn(t, this.ctx, this.env.SENTRY_DSN, this.env.SENTRY_ACCESS_CLIENT_ID, this.env.SENTRY_ACCESS_CLIENT_SECRET, this.env.COLO_METADATA, this.env.CONFIG?.account_id, this.env.CONFIG?.script_id);
2536
2539
  let i = Ut(this.env.CONFIG), o = t.headers.get("user-agent") ?? "UA UNKNOWN", a = new URL(t.url);
2537
- return this.env.COLO_METADATA && this.env.VERSION_METADATA && this.env.CONFIG && n.setData({ accountId: this.env.CONFIG.account_id, scriptId: this.env.CONFIG.script_id, coloId: this.env.COLO_METADATA.coloId, metalId: this.env.COLO_METADATA.metalId, coloTier: this.env.COLO_METADATA.coloTier, coloRegion: this.env.COLO_METADATA.coloRegion, version: this.env.VERSION_METADATA.id, hostname: a.hostname, htmlHandling: i.html_handling, notFoundHandling: i.not_found_handling, userAgent: o }), this.env.JAEGER.enterSpan("handleRequest", async (c) => (c.setTags({ hostname: a.hostname, eyeballPath: a.pathname, env: this.env.ENVIRONMENT, version: this.env.VERSION_METADATA?.id }), er(t, this.env, i, this.unstable_exists.bind(this), this.unstable_getByETag.bind(this)))).catch((c) => this.handleError(e, n, c)).finally(() => this.submitMetrics(n, r, s));
2540
+ 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 }), er(t, this.env, i, this.unstable_exists.bind(this), this.unstable_getByETag.bind(this))));
2538
2541
  } catch (i) {
2539
2542
  let o = this.handleError(e, n, i);
2540
2543
  return this.submitMetrics(n, r, s), o;
@@ -2542,10 +2545,10 @@ var nr = class extends Bs {
2542
2545
  }
2543
2546
  handleError(t, e, n) {
2544
2547
  try {
2545
- let r = new q(n);
2548
+ let r = new L(n);
2546
2549
  return t && t.captureException(n), n instanceof Error && e.setData({ error: n.message }), r;
2547
2550
  } catch (r) {
2548
- return console.error("Error handling error", r), new q(r);
2551
+ return console.error("Error handling error", r), new L(r);
2549
2552
  }
2550
2553
  }
2551
2554
  submitMetrics(t, e, n) {
@@ -2569,7 +2572,7 @@ var nr = class extends Bs {
2569
2572
  return e ? this.unstable_getByETag(e) : null;
2570
2573
  }
2571
2574
  async unstable_exists(t) {
2572
- return await new ze(this.env.ASSETS_MANIFEST).get(t);
2575
+ return await new Xe(this.env.ASSETS_MANIFEST).get(t);
2573
2576
  }
2574
2577
  };
2575
2578