@cloudflare/vite-plugin 0.0.0-ce165ff11 → 0.0.0-e2f5756c2

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.
@@ -34,13 +34,13 @@ function L(t) {
34
34
  function Ht(t, e) {
35
35
  return Gt.call(t) === `[object ${e}]`;
36
36
  }
37
- function j(t) {
37
+ function q(t) {
38
38
  return Ht(t, "String");
39
39
  }
40
40
  function ge(t) {
41
41
  return t === null || typeof t != "object" && typeof t != "function";
42
42
  }
43
- function R(t) {
43
+ function x(t) {
44
44
  return Ht(t, "Object");
45
45
  }
46
46
  function et(t) {
@@ -53,7 +53,7 @@ function B(t) {
53
53
  return !!(t && t.then && typeof t.then == "function");
54
54
  }
55
55
  function nt(t) {
56
- return R(t) && "nativeEvent" in t && "preventDefault" in t && "stopPropagation" in t;
56
+ return x(t) && "nativeEvent" in t && "preventDefault" in t && "stopPropagation" in t;
57
57
  }
58
58
  function ee(t) {
59
59
  return typeof t == "number" && t !== t;
@@ -104,19 +104,19 @@ function ar(t, e) {
104
104
  if (u && u.length) u.forEach((d) => {
105
105
  r.push(`[${d[0]}="${d[1]}"]`);
106
106
  });
107
- else if (n.id && r.push(`#${n.id}`), s = n.className, s && j(s)) for (i = s.split(/\s+/), c = 0; c < i.length; c++) r.push(`.${i[c]}`);
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]}`);
108
108
  let l = ["aria-label", "type", "name", "title", "alt"];
109
109
  for (c = 0; c < l.length; c++) o = l[c], a = n.getAttribute(o), a && r.push(`[${o}="${a}"]`);
110
110
  return r.join("");
111
111
  }
112
112
  var cr = "Sentry Logger ";
113
113
  var ne = ["debug", "info", "warn", "error", "log", "assert", "trace"];
114
- var q = {};
114
+ var W = {};
115
115
  function ye(t) {
116
116
  if (!("console" in h)) return t();
117
- let e = h.console, n = {}, r = Object.keys(q);
117
+ let e = h.console, n = {}, r = Object.keys(W);
118
118
  r.forEach((s) => {
119
- let i = q[s];
119
+ let i = W[s];
120
120
  n[s] = e[s], e[s] = i;
121
121
  });
122
122
  try {
@@ -188,7 +188,7 @@ function I(t, e, n) {
188
188
  let r = t[e], s = n(r);
189
189
  typeof s == "function" && Vt(s, r), t[e] = s;
190
190
  }
191
- function W(t, e, n) {
191
+ function z(t, e, n) {
192
192
  try {
193
193
  Object.defineProperty(t, e, { value: n, writable: true, configurable: true });
194
194
  } catch {
@@ -198,7 +198,7 @@ function W(t, e, n) {
198
198
  function Vt(t, e) {
199
199
  try {
200
200
  let n = e.prototype || {};
201
- t.prototype = e.prototype = n, W(t, "__sentry_original__", e);
201
+ t.prototype = e.prototype = n, z(t, "__sentry_original__", e);
202
202
  } catch {
203
203
  }
204
204
  }
@@ -240,7 +240,7 @@ function E(t) {
240
240
  return st(t, /* @__PURE__ */ new Map());
241
241
  }
242
242
  function st(t, e) {
243
- if (R(t)) {
243
+ if (x(t)) {
244
244
  let n = e.get(t);
245
245
  if (n !== void 0) return n;
246
246
  let r = {};
@@ -353,9 +353,9 @@ function tn() {
353
353
  }
354
354
  return t;
355
355
  }
356
- var xe = N();
356
+ var Re = N();
357
357
  function nn() {
358
- let t = xe.chrome, e = t && t.app && t.app.runtime, n = "history" in xe && !!xe.history.pushState && !!xe.history.replaceState;
358
+ let t = Re.chrome, e = t && t.app && t.app.runtime, n = "history" in Re && !!Re.history.pushState && !!Re.history.replaceState;
359
359
  return !e && n;
360
360
  }
361
361
  var y = N();
@@ -383,7 +383,7 @@ function hr(t) {
383
383
  br();
384
384
  break;
385
385
  case "unhandledrejection":
386
- xr();
386
+ Rr();
387
387
  break;
388
388
  default:
389
389
  (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && f.warn("unknown instrumentation type:", t);
@@ -406,9 +406,9 @@ Error:`, r);
406
406
  function _r() {
407
407
  "console" in h && ne.forEach(function(t) {
408
408
  t in h.console && I(h.console, t, function(e) {
409
- return q[t] = e, function(...n) {
409
+ return W[t] = e, function(...n) {
410
410
  A("console", { args: n, level: t });
411
- let r = q[t];
411
+ let r = W[t];
412
412
  r && r.apply(h.console, n);
413
413
  };
414
414
  });
@@ -444,8 +444,8 @@ function un() {
444
444
  let t = XMLHttpRequest.prototype;
445
445
  I(t, "open", function(e) {
446
446
  return function(...n) {
447
- let r = Date.now(), s = n[1], i = this[ie] = { method: j(n[0]) ? n[0].toUpperCase() : n[0], url: n[1], request_headers: {} };
448
- j(s) && i.method === "POST" && s.match(/sentry_key/) && (this.__sentry_own_request__ = true);
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);
449
449
  let o = () => {
450
450
  let a = this[ie];
451
451
  if (a && this.readyState === 4) {
@@ -474,13 +474,13 @@ function un() {
474
474
  };
475
475
  });
476
476
  }
477
- var Re;
477
+ var xe;
478
478
  function Er() {
479
479
  if (!nn()) return;
480
480
  let t = y.onpopstate;
481
481
  y.onpopstate = function(...n) {
482
- let r = y.location.href, s = Re;
483
- if (Re = r, A("history", { from: s, to: r }), t) try {
482
+ let r = y.location.href, s = xe;
483
+ if (xe = r, A("history", { from: s, to: r }), t) try {
484
484
  return t.apply(this, n);
485
485
  } catch {
486
486
  }
@@ -489,8 +489,8 @@ function Er() {
489
489
  return function(...r) {
490
490
  let s = r.length > 2 ? r[2] : void 0;
491
491
  if (s) {
492
- let i = Re, o = String(s);
493
- Re = o, A("history", { from: i, to: o });
492
+ let i = xe, o = String(s);
493
+ xe = o, A("history", { from: i, to: o });
494
494
  }
495
495
  return n.apply(this, r);
496
496
  };
@@ -521,7 +521,7 @@ function Tr(t) {
521
521
  function an(t, e = false) {
522
522
  return (n) => {
523
523
  if (!n || n._sentryCaptured || Tr(n)) return;
524
- W(n, "_sentryCaptured", true);
524
+ z(n, "_sentryCaptured", true);
525
525
  let r = n.type === "keypress" ? "input" : n.type;
526
526
  (Ie === void 0 || !Sr(Ie, n)) && (t({ event: n, name: r, global: e }), Ie = n), clearTimeout(on), on = y.setTimeout(() => {
527
527
  Ie = void 0;
@@ -565,7 +565,7 @@ function br() {
565
565
  }, y.onerror.__SENTRY_INSTRUMENTED__ = true;
566
566
  }
567
567
  var Ae = null;
568
- function xr() {
568
+ function Rr() {
569
569
  Ae = y.onunhandledrejection, y.onunhandledrejection = function(t) {
570
570
  return A("unhandledrejection", t), Ae && !Ae.__SENTRY_LOADER__ ? Ae.apply(this, arguments) : true;
571
571
  }, y.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;
@@ -604,7 +604,7 @@ function g() {
604
604
  }
605
605
  return ("10000000100040008000" + 1e11).replace(/[018]/g, (r) => (r ^ (n() & 15) >> r / 4).toString(16));
606
606
  }
607
- function Rr(t) {
607
+ function xr(t) {
608
608
  return t.exception && t.exception.values ? t.exception.values[0] : void 0;
609
609
  }
610
610
  function ae(t, e, n) {
@@ -612,7 +612,7 @@ function ae(t, e, n) {
612
612
  i.value || (i.value = e || ""), i.type || (i.type = n || "Error");
613
613
  }
614
614
  function ce(t, e) {
615
- let n = Rr(t);
615
+ let n = xr(t);
616
616
  if (!n) return;
617
617
  let r = { type: "generic", handled: true }, s = n.mechanism;
618
618
  if (n.mechanism = { ...r, ...s, ...e }, e && "data" in e) {
@@ -623,7 +623,7 @@ function ce(t, e) {
623
623
  function we(t) {
624
624
  if (t && t.__sentry_captured__) return true;
625
625
  try {
626
- W(t, "__sentry_captured__", true);
626
+ z(t, "__sentry_captured__", true);
627
627
  } catch {
628
628
  }
629
629
  return false;
@@ -638,9 +638,9 @@ function D(t, e = 100, n = 1 / 0) {
638
638
  return { ERROR: `**non-serializable** (${r})` };
639
639
  }
640
640
  }
641
- function z(t, e = 3, n = 100 * 1024) {
641
+ function V(t, e = 3, n = 100 * 1024) {
642
642
  let r = D(t, e);
643
- return Dr(r) > n ? z(t, e - 1, n) : r;
643
+ return Dr(r) > n ? V(t, e - 1, n) : r;
644
644
  }
645
645
  function Oe(t, e, n = 1 / 0, r = 1 / 0, s = mn()) {
646
646
  let [i, o] = s;
@@ -951,11 +951,11 @@ function bt(t, { statusCode: e, headers: n }, r = Date.now()) {
951
951
  else o ? s.all = r + gn(o, r) : e === 429 && (s.all = r + 60 * 1e3);
952
952
  return s;
953
953
  }
954
- function xt(t, e) {
954
+ function Rt(t, e) {
955
955
  return t(e.stack || "", 1);
956
956
  }
957
957
  function yn(t, e) {
958
- let n = { type: e.name || e.constructor.name, value: e.message }, r = xt(t, e);
958
+ let n = { type: e.name || e.constructor.name, value: e.message }, r = Rt(t, e);
959
959
  return r.length && (n.stacktrace = { frames: r }), n;
960
960
  }
961
961
  function Lr(t) {
@@ -964,13 +964,13 @@ function Lr(t) {
964
964
  return "message" in t && typeof t.message == "string" && (e += ` with message '${t.message}'`), e;
965
965
  } else return "message" in t && typeof t.message == "string" ? t.message : `Object captured as exception with keys: ${re(t)}`;
966
966
  }
967
- function Rt(t, e, n, r) {
967
+ function xt(t, e, n, r) {
968
968
  let s = n, o = r && r.data && r.data.mechanism || { handled: true, type: "generic" };
969
969
  if (!L(n)) {
970
- if (R(n)) {
970
+ if (x(n)) {
971
971
  let c = t(), u = c.getClient(), l = u && u.getOptions().normalizeDepth;
972
972
  c.configureScope((p) => {
973
- p.setExtra("__serialized__", z(n, l));
973
+ p.setExtra("__serialized__", V(n, l));
974
974
  });
975
975
  let d = Lr(n);
976
976
  s = r && r.syntheticException || new Error(d), s.message = d;
@@ -983,25 +983,25 @@ function Rt(t, e, n, r) {
983
983
  function It(t, e, n = "info", r, s) {
984
984
  let i = { event_id: r && r.event_id, level: n, message: e };
985
985
  if (s && r && r.syntheticException) {
986
- let o = xt(t, r.syntheticException);
986
+ let o = Rt(t, r.syntheticException);
987
987
  o.length && (i.exception = { values: [{ value: e, stacktrace: { frames: o } }] });
988
988
  }
989
989
  return i;
990
990
  }
991
- var V = "production";
991
+ var J = "production";
992
992
  function le() {
993
993
  return te("globalEventProcessors", () => []);
994
994
  }
995
995
  function Sn(t) {
996
996
  le().push(t);
997
997
  }
998
- function J(t, e, n, r = 0) {
998
+ function K(t, e, n, r = 0) {
999
999
  return new S((s, i) => {
1000
1000
  let o = t[r];
1001
1001
  if (e === null || typeof o != "function") s(e);
1002
1002
  else {
1003
1003
  let a = o({ ...e }, n);
1004
- (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && o.id && a === null && f.log(`Event processor "${o.id}" dropped event`), B(a) ? a.then((c) => J(t, c, n, r + 1).then(s)).then(null, i) : J(t, a, n, r + 1).then(s).then(null, i);
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);
1005
1005
  }
1006
1006
  });
1007
1007
  }
@@ -1028,7 +1028,7 @@ function Br(t) {
1028
1028
  var Fr = 100;
1029
1029
  var w = class {
1030
1030
  constructor() {
1031
- this._notifyingListeners = false, this._scopeListeners = [], this._eventProcessors = [], this._breadcrumbs = [], this._attachments = [], this._user = {}, this._tags = {}, this._extra = {}, this._contexts = {}, this._sdkProcessingMetadata = {}, this._propagationContext = xn();
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();
1032
1032
  }
1033
1033
  static clone(e) {
1034
1034
  let n = new w();
@@ -1098,10 +1098,10 @@ var w = class {
1098
1098
  let n = e(this);
1099
1099
  return n instanceof w ? n : this;
1100
1100
  }
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)) : R(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;
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;
1102
1102
  }
1103
1103
  clear() {
1104
- return this._breadcrumbs = [], this._tags = {}, this._extra = {}, this._user = {}, this._contexts = {}, this._level = void 0, this._transactionName = void 0, this._fingerprint = void 0, this._requestSession = void 0, this._span = void 0, this._session = void 0, this._notifyScopeListeners(), this._attachments = [], this._propagationContext = xn(), this;
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;
1105
1105
  }
1106
1106
  addBreadcrumb(e, n) {
1107
1107
  let r = typeof n == "number" ? n : Fr;
@@ -1136,7 +1136,7 @@ var w = class {
1136
1136
  }
1137
1137
  this._applyFingerprint(e);
1138
1138
  let s = this._getBreadcrumbs(), i = [...e.breadcrumbs || [], ...s];
1139
- return e.breadcrumbs = i.length > 0 ? i : void 0, e.sdkProcessingMetadata = { ...e.sdkProcessingMetadata, ...this._sdkProcessingMetadata, propagationContext: this._propagationContext }, J([...r || [], ...le(), ...this._eventProcessors], e, n);
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);
1140
1140
  }
1141
1141
  setSDKProcessingMetadata(e) {
1142
1142
  return this._sdkProcessingMetadata = { ...this._sdkProcessingMetadata, ...e }, this;
@@ -1159,13 +1159,13 @@ var w = class {
1159
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;
1160
1160
  }
1161
1161
  };
1162
- function xn() {
1162
+ function Rn() {
1163
1163
  return { traceId: g(), spanId: g().substring(16) };
1164
1164
  }
1165
- var Rn = 4;
1165
+ var xn = 4;
1166
1166
  var $r = 100;
1167
1167
  var H = class {
1168
- constructor(e, n = new w(), r = Rn) {
1168
+ constructor(e, n = new w(), r = xn) {
1169
1169
  this._version = r, this._stack = [{ scope: n }], e && this.bindClient(e);
1170
1170
  }
1171
1171
  isOlderThan(e) {
@@ -1293,7 +1293,7 @@ Sentry.init({...});
1293
1293
  r && bn(r), this._sendSessionUpdate(), n.setSession();
1294
1294
  }
1295
1295
  startSession(e) {
1296
- let { scope: n, client: r } = this.getStackTop(), { release: s, environment: i = V } = 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();
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
1297
  return c && c.status === "ok" && C(c, { status: "exited" }), this.endSession(), n.setSession(a), a;
1298
1298
  }
1299
1299
  shouldSendDefaultPii() {
@@ -1321,7 +1321,7 @@ function Nt(t) {
1321
1321
  let e = Y(), n = Pe(e);
1322
1322
  return At(e, t), n;
1323
1323
  }
1324
- function x() {
1324
+ function R() {
1325
1325
  let t = Y();
1326
1326
  if (t.__SENTRY__ && t.__SENTRY__.acs) {
1327
1327
  let e = t.__SENTRY__.acs.getCurrentHub();
@@ -1330,7 +1330,7 @@ function x() {
1330
1330
  return Gr(t);
1331
1331
  }
1332
1332
  function Gr(t = Y()) {
1333
- return (!Hr(t) || Pe(t).isOlderThan(Rn)) && At(t, new H()), Pe(t);
1333
+ return (!Hr(t) || Pe(t).isOlderThan(xn)) && At(t, new H()), Pe(t);
1334
1334
  }
1335
1335
  function Hr(t) {
1336
1336
  return !!(t && t.__SENTRY__ && t.__SENTRY__.hub);
@@ -1344,7 +1344,7 @@ function At(t, e) {
1344
1344
  return n.hub = e, true;
1345
1345
  }
1346
1346
  function In(t) {
1347
- return (t || x()).getScope().getTransaction();
1347
+ return (t || R()).getScope().getTransaction();
1348
1348
  }
1349
1349
  var Nn = false;
1350
1350
  function An() {
@@ -1366,7 +1366,7 @@ var Me = class {
1366
1366
  this.spans.length > this._maxlen ? e.spanRecorder = void 0 : this.spans.push(e);
1367
1367
  }
1368
1368
  };
1369
- var K = class {
1369
+ var X = class {
1370
1370
  constructor(e = {}) {
1371
1371
  this.traceId = e.traceId || g(), this.spanId = e.spanId || g().substring(16), this.startTimestamp = e.startTimestamp || G(), this.tags = e.tags || {}, this.data = e.data || {}, this.instrumenter = e.instrumenter || "sentry", this.origin = e.origin || "manual", e.parentSpanId && (this.parentSpanId = e.parentSpanId), "sampled" in e && (this.sampled = e.sampled), e.op && (this.op = e.op), e.description && (this.description = e.description), e.name && (this.description = e.name), e.status && (this.status = e.status), e.endTimestamp && (this.endTimestamp = e.endTimestamp);
1372
1372
  }
@@ -1377,7 +1377,7 @@ var K = class {
1377
1377
  this.setName(e);
1378
1378
  }
1379
1379
  startChild(e) {
1380
- let n = new K({ ...e, parentSpanId: this.spanId, sampled: this.sampled, traceId: this.traceId });
1380
+ let n = new X({ ...e, parentSpanId: this.spanId, sampled: this.sampled, traceId: this.traceId });
1381
1381
  if (n.spanRecorder = this.spanRecorder, n.spanRecorder && n.spanRecorder.add(n), n.transaction = this.transaction, (typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__) && n.transaction) {
1382
1382
  let r = e && e.op || "< unknown op >", s = n.transaction.name || "< unknown name >", i = n.transaction.spanId, o = `[Tracing] Starting '${r}' span on transaction '${s}' (${i}).`;
1383
1383
  n.transaction.metadata.spanMetadata[n.spanId] = { logMessage: o }, f.log(o);
@@ -1457,13 +1457,13 @@ function Yr(t) {
1457
1457
  }
1458
1458
  return "unknown_error";
1459
1459
  }
1460
- function X(t, e, n) {
1461
- let r = e.getOptions(), { publicKey: s } = e.getDsn() || {}, { segment: i } = n && n.getUser() || {}, o = E({ environment: r.environment || V, release: r.release, user_segment: i, public_key: s, trace_id: t });
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 });
1462
1462
  return e.emit && e.emit("createDsc", o), o;
1463
1463
  }
1464
- var Ue = class extends K {
1464
+ var Ue = class extends X {
1465
1465
  constructor(e, n) {
1466
- super(e), delete this.description, this._measurements = {}, this._contexts = {}, this._hub = n || x(), this._name = e.name || "", this.metadata = { source: "custom", ...e.metadata, spanMetadata: {} }, this._trimEnd = e.trimEnd, this.transaction = this;
1466
+ super(e), delete this.description, this._measurements = {}, this._contexts = {}, this._hub = n || R(), this._name = e.name || "", this.metadata = { source: "custom", ...e.metadata, spanMetadata: {} }, this._trimEnd = e.trimEnd, this.transaction = this;
1467
1467
  let r = this.metadata.dynamicSamplingContext;
1468
1468
  r && (this._frozenDynamicSamplingContext = { ...r });
1469
1469
  }
@@ -1501,9 +1501,9 @@ var Ue = class extends K {
1501
1501
  }
1502
1502
  getDynamicSamplingContext() {
1503
1503
  if (this._frozenDynamicSamplingContext) return this._frozenDynamicSamplingContext;
1504
- let e = this._hub || x(), n = e.getClient();
1504
+ let e = this._hub || R(), n = e.getClient();
1505
1505
  if (!n) return {};
1506
- let r = e.getScope(), s = X(this.traceId, n, r), i = this.metadata.sampleRate;
1506
+ let r = e.getScope(), s = Z(this.traceId, n, r), i = this.metadata.sampleRate;
1507
1507
  i !== void 0 && (s.sample_rate = `${i}`);
1508
1508
  let o = this.metadata.source;
1509
1509
  return o && o !== "url" && (s.transaction = this.name), this.sampled !== void 0 && (s.sampled = String(this.sampled)), s;
@@ -1527,7 +1527,7 @@ var Ue = class extends K {
1527
1527
  };
1528
1528
  function Dn(t) {
1529
1529
  if (typeof __SENTRY_TRACING__ == "boolean" && !__SENTRY_TRACING__) return false;
1530
- let e = x().getClient(), n = t || e && e.getOptions();
1530
+ let e = R().getClient(), n = t || e && e.getOptions();
1531
1531
  return !!n && (n.enableTracing || "tracesSampleRate" in n || "tracesSampler" in n);
1532
1532
  }
1533
1533
  function wn(t, e, n) {
@@ -1571,7 +1571,7 @@ var Le = class {
1571
1571
  }
1572
1572
  incrementSessionStatusCount() {
1573
1573
  if (!this._isEnabled) return;
1574
- let e = x().getScope(), n = e.getRequestSession();
1574
+ let e = R().getScope(), n = e.getRequestSession();
1575
1575
  n && n.status && (this._incrementSessionStatusCount(n.status, /* @__PURE__ */ new Date()), e.setRequestSession(void 0));
1576
1576
  }
1577
1577
  _incrementSessionStatusCount(e, n) {
@@ -1645,7 +1645,7 @@ function Mn(t, e) {
1645
1645
  }), n;
1646
1646
  }
1647
1647
  function Ot(t, e, n) {
1648
- if (n[e.name] = e, Pn.indexOf(e.name) === -1 && (e.setupOnce(Sn, x), Pn.push(e.name)), t.on && typeof e.preprocessEvent == "function") {
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") {
1649
1649
  let r = e.preprocessEvent.bind(e);
1650
1650
  t.on("preprocessEvent", (s, i) => r(s, i, t));
1651
1651
  }
@@ -1671,12 +1671,12 @@ function Ln(t, e, n, r, s) {
1671
1671
  p.length && (n.attachments = p);
1672
1672
  }
1673
1673
  l = u.applyToEvent(a, n, d);
1674
- } else l = J([...d, ...le()], a, n);
1674
+ } else l = K([...d, ...le()], a, n);
1675
1675
  return l.then((p) => (p && ns(p), typeof i == "number" && i > 0 ? ss(p, i, o) : p));
1676
1676
  }
1677
1677
  function es(t, e) {
1678
1678
  let { environment: n, release: r, dist: s, maxValueLength: i = 250 } = e;
1679
- "environment" in t || (t.environment = "environment" in e ? n : V), 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));
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));
1680
1680
  let o = t.exception && t.exception.values && t.exception.values[0];
1681
1681
  o && o.value && (o.value = P(o.value, i));
1682
1682
  let a = t.request;
@@ -1868,7 +1868,7 @@ var Be = class {
1868
1868
  if (!(o.contexts && o.contexts.trace) && a) {
1869
1869
  let { traceId: u, spanId: l, parentSpanId: d, dsc: p } = a;
1870
1870
  o.contexts = { trace: { trace_id: u, span_id: l, parent_span_id: d }, ...o.contexts };
1871
- let m = p || X(u, this, r);
1871
+ let m = p || Z(u, this, r);
1872
1872
  o.sdkProcessingMetadata = { dynamicSamplingContext: m, ...o.sdkProcessingMetadata };
1873
1873
  }
1874
1874
  return o;
@@ -1926,12 +1926,12 @@ Reason: ${d}`));
1926
1926
  function is(t, e) {
1927
1927
  let n = `${e} must return \`null\` or a valid event.`;
1928
1928
  if (B(t)) return t.then((r) => {
1929
- if (!R(r) && r !== null) throw new T(n);
1929
+ if (!x(r) && r !== null) throw new T(n);
1930
1930
  return r;
1931
1931
  }, (r) => {
1932
1932
  throw new T(`${e} rejected with ${r}`);
1933
1933
  });
1934
- if (!R(t) && t !== null) throw new T(n);
1934
+ if (!x(t) && t !== null) throw new T(n);
1935
1935
  return t;
1936
1936
  }
1937
1937
  function os(t, e, n) {
@@ -1958,7 +1958,7 @@ var fe = class extends Be {
1958
1958
  On(), super(e);
1959
1959
  }
1960
1960
  eventFromException(e, n) {
1961
- return b(Rt(x, this._options.stackParser, e, n));
1961
+ return b(xt(R, this._options.stackParser, e, n));
1962
1962
  }
1963
1963
  eventFromMessage(e, n = "info", r) {
1964
1964
  return b(It(this._options.stackParser, e, n, r, this._options.attachStacktrace));
@@ -2005,7 +2005,7 @@ var fe = class extends Be {
2005
2005
  let n = e.getSpan();
2006
2006
  if (n) return [n.transaction ? n.transaction.getDynamicSamplingContext() : void 0, n.getTraceContext()];
2007
2007
  let { traceId: r, spanId: s, parentSpanId: i, dsc: o } = e.getPropagationContext(), a = { trace_id: r, span_id: s, parent_span_id: i };
2008
- return o ? [o, a] : [X(r, this, e), a];
2008
+ return o ? [o, a] : [Z(r, this, e), a];
2009
2009
  }
2010
2010
  };
2011
2011
  var cs = 30;
@@ -2068,10 +2068,10 @@ function ps(t, e, n, r) {
2068
2068
  let s, o = (r && r.data && ds(r.data) ? r.data.mechanism : void 0) ?? { handled: true, type: "generic" };
2069
2069
  if (L(n)) s = n;
2070
2070
  else {
2071
- if (R(n)) {
2071
+ if (x(n)) {
2072
2072
  let c = `Non-Error exception captured with keys: ${re(n)}`, u = t?.getClient(), l = u && u.getOptions().normalizeDepth;
2073
2073
  t?.configureScope((d) => {
2074
- d.setExtra("__serialized__", z(n, l));
2074
+ d.setExtra("__serialized__", V(n, l));
2075
2075
  }), s = r && r.syntheticException || new Error(c), s.message = c;
2076
2076
  } else s = r && r.syntheticException || new Error(n), s.message = n;
2077
2077
  o.synthetic = true;
@@ -2115,22 +2115,22 @@ function zn(t, e, n, r = []) {
2115
2115
  return zn(t, e, n.cause, [s, ...r]);
2116
2116
  }
2117
2117
  var gs = { allowedHeaders: ["CF-RAY", "CF-Worker"] };
2118
- var Z;
2118
+ var Q;
2119
2119
  var Ye = class {
2120
2120
  constructor(e = {}) {
2121
2121
  he(this, "name", Ye.id);
2122
- Ft(this, Z, void 0);
2123
- $t(this, Z, { ...gs, ...e });
2122
+ Ft(this, Q, void 0);
2123
+ $t(this, Q, { ...gs, ...e });
2124
2124
  }
2125
2125
  setupOnce(e, n) {
2126
2126
  n().getClient() && e((s) => {
2127
2127
  let { sdkProcessingMetadata: i } = s;
2128
- return !n().getIntegration(Ye) || !i || ("request" in i && i.request instanceof Request && (s.request = ys(i.request, Qe(this, Z)), s.user = Es(s.user ?? {}, i.request, Qe(this, Z))), "requestData" in i && (s.request ? s.request.data = i.requestData : s.request = { data: i.requestData })), 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;
2129
2129
  });
2130
2130
  }
2131
2131
  };
2132
2132
  var $e = Ye;
2133
- Z = /* @__PURE__ */ new WeakMap(), he($e, "id", "RequestData");
2133
+ Q = /* @__PURE__ */ new WeakMap(), he($e, "id", "RequestData");
2134
2134
  function Es(t, e, n) {
2135
2135
  let r = e.headers.get("CF-Connecting-IP"), { allowedIps: s } = n, i = { ...t };
2136
2136
  return !("ip_address" in t) && r && s !== void 0 && Ss(r, s) && (i.ip_address = r), Object.keys(i).length > 0 ? i : void 0;
@@ -2219,7 +2219,7 @@ var Ct = class extends fe {
2219
2219
  this.getOptions().enabled = e;
2220
2220
  }
2221
2221
  };
2222
- function xs(t) {
2222
+ function Rs(t) {
2223
2223
  let [e, n] = ct(t);
2224
2224
  return [e, (s) => {
2225
2225
  let i = n(s);
@@ -2230,10 +2230,10 @@ function xs(t) {
2230
2230
  return i;
2231
2231
  }];
2232
2232
  }
2233
- function Rs(t) {
2233
+ function xs(t) {
2234
2234
  if (t) return lt(t, ".js");
2235
2235
  }
2236
- var Is = be(xs(Rs));
2236
+ var Is = be(Rs(xs));
2237
2237
  function Ns(t) {
2238
2238
  function e({ body: n }) {
2239
2239
  try {
@@ -2338,7 +2338,7 @@ var Ve = class extends Response {
2338
2338
  super(e, { ...n, status: 405, statusText: "Method Not Allowed" });
2339
2339
  }
2340
2340
  };
2341
- var Q = class extends Response {
2341
+ var j = class extends Response {
2342
2342
  constructor(e, n) {
2343
2343
  super(null, { ...n, status: 500 });
2344
2344
  }
@@ -2370,7 +2370,7 @@ var Xn = async (t, e, n, r, s) => {
2370
2370
  if (!["GET", "HEAD"].includes(u)) return new Ve();
2371
2371
  let l = c.redirect ?? a, d = Ls(l);
2372
2372
  if (d !== i && c.asset || c.redirect) return new Ke(d + o);
2373
- if (!c.asset) return new Q(new Error("Unknown action"));
2373
+ if (!c.asset) return new j(new Error("Unknown action"));
2374
2374
  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), O = `"${c.asset.eTag}"`, tr = `W/${O}`, nr = t.headers.get("If-None-Match") || "";
2375
2375
  if ([tr, O].includes(nr)) return new Je(null, { headers: m });
2376
2376
  let Lt = u === "HEAD" ? null : p.readableStream;
@@ -2539,17 +2539,25 @@ var er = class extends Fs {
2539
2539
  e.setTag("colo", this.env.COLO_METADATA.coloId), e.setTag("metal", this.env.COLO_METADATA.metalId), e.setUser({ userAgent: o, colo: c });
2540
2540
  }
2541
2541
  let a = new URL(t.url);
2542
- return this.env.COLO_METADATA && this.env.VERSION_METADATA && n.setData({ coloId: this.env.COLO_METADATA.coloId, metalId: this.env.COLO_METADATA.metalId, coloTier: this.env.COLO_METADATA.coloTier, coloRegion: this.env.COLO_METADATA.coloRegion, version: this.env.VERSION_METADATA.id, hostname: a.hostname, htmlHandling: i.html_handling, notFoundHandling: i.not_found_handling, userAgent: o }), this.env.JAEGER.enterSpan("handleRequest", async (c) => (c.setTags({ hostname: a.hostname, eyeballPath: a.pathname, env: this.env.ENVIRONMENT }), Xn(t, this.env, i, this.unstable_exists.bind(this), this.unstable_getByETag.bind(this)))).catch((c) => this.handleError(e, n, r, s, c));
2542
+ return this.env.COLO_METADATA && this.env.VERSION_METADATA && n.setData({ coloId: this.env.COLO_METADATA.coloId, metalId: this.env.COLO_METADATA.metalId, coloTier: this.env.COLO_METADATA.coloTier, coloRegion: this.env.COLO_METADATA.coloRegion, version: this.env.VERSION_METADATA.id, hostname: a.hostname, htmlHandling: i.html_handling, notFoundHandling: i.not_found_handling, userAgent: o }), this.env.JAEGER.enterSpan("handleRequest", async (c) => (c.setTags({ hostname: a.hostname, eyeballPath: a.pathname, env: this.env.ENVIRONMENT, version: this.env.VERSION_METADATA?.id }), Xn(t, this.env, i, this.unstable_exists.bind(this), this.unstable_getByETag.bind(this)))).catch((c) => this.handleError(e, n, c)).finally(() => this.submitMetrics(n, r, s));
2543
2543
  } catch (i) {
2544
- return this.handleError(e, n, r, s, i);
2544
+ let o = this.handleError(e, n, i);
2545
+ return this.submitMetrics(n, r, s), o;
2545
2546
  }
2546
2547
  }
2547
- handleError(t, e, n, r, s) {
2548
+ handleError(t, e, n) {
2548
2549
  try {
2549
- let i = new Q(s);
2550
- return t && t.captureException(s), s instanceof Error && e.setData({ error: s.message }), i;
2551
- } finally {
2552
- e.setData({ requestTime: n.now() - r }), e.write();
2550
+ let r = new j(n);
2551
+ return t && t.captureException(n), n instanceof Error && e.setData({ error: n.message }), r;
2552
+ } catch (r) {
2553
+ return console.error("Error handling error", r), new j(r);
2554
+ }
2555
+ }
2556
+ submitMetrics(t, e, n) {
2557
+ try {
2558
+ t.setData({ requestTime: e.now() - n }), t.write();
2559
+ } catch (r) {
2560
+ console.error("Error submitting metrics", r);
2553
2561
  }
2554
2562
  }
2555
2563
  async unstable_canFetch(t) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudflare/vite-plugin",
3
- "version": "0.0.0-ce165ff11",
3
+ "version": "0.0.0-e2f5756c2",
4
4
  "description": "Cloudflare plugin for Vite",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -36,7 +36,7 @@
36
36
  "@hattip/adapter-node": "^0.0.49",
37
37
  "unenv": "npm:unenv-nightly@2.0.0-20241218-183400-5d6aec3",
38
38
  "ws": "^8.18.0",
39
- "miniflare": "0.0.0-ce165ff11"
39
+ "miniflare": "0.0.0-e2f5756c2"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@cloudflare/workers-types": "^4.20241230.0",
@@ -46,13 +46,13 @@
46
46
  "tsup": "^8.3.0",
47
47
  "typescript": "^5.7.2",
48
48
  "vite": "^6.0.7",
49
+ "wrangler": "0.0.0-e2f5756c2",
49
50
  "@cloudflare/workers-tsconfig": "0.0.0",
50
- "wrangler": "0.0.0-ce165ff11",
51
- "@cloudflare/workers-shared": "0.0.0-ce165ff11"
51
+ "@cloudflare/workers-shared": "0.0.0-e2f5756c2"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "vite": "^6.0.7",
55
- "wrangler": "^0.0.0-ce165ff11"
55
+ "wrangler": "^3.101.0"
56
56
  },
57
57
  "publishConfig": {
58
58
  "access": "public"