@animaapp/anima-sdk-react 0.4.4 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -41,7 +41,7 @@ var va = Object.defineProperty, _a = Object.defineProperties, ba = Object.getOwn
41
41
  for (var n of qs(e))
42
42
  ka.call(e, n) && Hs(t, n, e[n]);
43
43
  return t;
44
- }, x = (t, e) => _a(t, ba(e)), ke = (t, e, n) => new Promise((s, r) => {
44
+ }, E = (t, e) => _a(t, ba(e)), ke = (t, e, n) => new Promise((s, r) => {
45
45
  var a = (c) => {
46
46
  try {
47
47
  o(n.next(c));
@@ -67,14 +67,14 @@ class Gs extends Error {
67
67
  super(), this.name = e, this.message = n, this.detail = r, this.status = s;
68
68
  }
69
69
  }
70
- const Ea = "Figma Token Issue";
71
- class xa extends Error {
70
+ const xa = "Figma Token Issue";
71
+ class Ea extends Error {
72
72
  constructor({
73
73
  fileKey: e,
74
74
  reason: n,
75
75
  cause: s
76
76
  }) {
77
- super(Ea), this.fileKey = e, this.reason = n, this.cause = s;
77
+ super(xa), this.fileKey = e, this.reason = n, this.cause = s;
78
78
  }
79
79
  }
80
80
  const Sa = "Rate Limit Exceeded";
@@ -84,15 +84,15 @@ class Oa extends Error {
84
84
  }
85
85
  }
86
86
  const Ta = "Request Too Large";
87
- class Aa extends Error {
87
+ class Ca extends Error {
88
88
  constructor({ fileKey: e, cause: n }) {
89
89
  super(Ta), this.fileKey = e, this.cause = n;
90
90
  }
91
91
  }
92
- const Ca = "Not Found";
92
+ const Aa = "Not Found";
93
93
  class Na extends Error {
94
94
  constructor({ fileKey: e, cause: n }) {
95
- super(Ca), this.fileKey = e, this.cause = n;
95
+ super(Aa), this.fileKey = e, this.cause = n;
96
96
  }
97
97
  }
98
98
  const Ra = "Unknown Figma API Exception";
@@ -106,7 +106,7 @@ const Ia = (t, e) => {
106
106
  if (((n = t == null ? void 0 : t.cause) == null ? void 0 : n.message) === "Fetch Error") {
107
107
  const { err: s, status: r } = t.cause.body;
108
108
  if (r === 403)
109
- return new xa({
109
+ return new Ea({
110
110
  fileKey: e,
111
111
  reason: s,
112
112
  cause: t
@@ -116,7 +116,7 @@ const Ia = (t, e) => {
116
116
  if (r === 404)
117
117
  return new Na({ fileKey: e, cause: t });
118
118
  if (r === 400 && s.includes("Request too large"))
119
- return new Aa({ fileKey: e, cause: t });
119
+ return new Ca({ fileKey: e, cause: t });
120
120
  }
121
121
  return new Pa({ fileKey: e, cause: t });
122
122
  };
@@ -129,7 +129,7 @@ var ja = Object.defineProperty, Za = Object.defineProperties, Da = Object.getOwn
129
129
  for (var n of Js(e))
130
130
  La.call(e, n) && Ys(t, n, e[n]);
131
131
  return t;
132
- }, Ts = (t, e) => Za(t, Da(e)), As = (t, e, n) => e.has(t) || Or("Cannot " + n), P = (t, e, n) => (As(t, e, "read from private field"), n ? n.call(t) : e.get(t)), de = (t, e, n) => e.has(t) ? Or("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), J = (t, e, n, s) => (As(t, e, "write to private field"), e.set(t, n), n), _e = (t, e, n) => (As(t, e, "access private method"), n), B = (t, e, n) => new Promise((s, r) => {
132
+ }, Ts = (t, e) => Za(t, Da(e)), Cs = (t, e, n) => e.has(t) || Or("Cannot " + n), P = (t, e, n) => (Cs(t, e, "read from private field"), n ? n.call(t) : e.get(t)), de = (t, e, n) => e.has(t) ? Or("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), J = (t, e, n, s) => (Cs(t, e, "write to private field"), e.set(t, n), n), _e = (t, e, n) => (Cs(t, e, "access private method"), n), B = (t, e, n) => new Promise((s, r) => {
133
133
  var a = (c) => {
134
134
  try {
135
135
  o(n.next(c));
@@ -148,13 +148,13 @@ var ja = Object.defineProperty, Za = Object.defineProperties, Da = Object.getOwn
148
148
  function Wa(t) {
149
149
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
150
150
  }
151
- var Kn = { exports: {} }, za = Kn.exports, Qs;
152
- function Va() {
151
+ var Kn = { exports: {} }, Va = Kn.exports, Qs;
152
+ function za() {
153
153
  return Qs || (Qs = 1, function(t, e) {
154
154
  (function(n, s) {
155
155
  t.exports = s();
156
- })(za, function() {
157
- var n = typeof Promise == "function", s = typeof self == "object" ? self : Fa, r = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", c = typeof WeakSet != "undefined", u = typeof DataView != "undefined", h = r && typeof Symbol.iterator != "undefined", p = r && typeof Symbol.toStringTag != "undefined", k = i && typeof Set.prototype.entries == "function", v = a && typeof Map.prototype.entries == "function", b = k && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), l = v && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), y = h && typeof Array.prototype[Symbol.iterator] == "function", m = y && Object.getPrototypeOf([][Symbol.iterator]()), W = h && typeof String.prototype[Symbol.iterator] == "function", R = W && Object.getPrototypeOf(""[Symbol.iterator]()), V = 8, L = -1;
156
+ })(Va, function() {
157
+ var n = typeof Promise == "function", s = typeof self == "object" ? self : Fa, r = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", c = typeof WeakSet != "undefined", u = typeof DataView != "undefined", h = r && typeof Symbol.iterator != "undefined", p = r && typeof Symbol.toStringTag != "undefined", k = i && typeof Set.prototype.entries == "function", v = a && typeof Map.prototype.entries == "function", b = k && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), l = v && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), y = h && typeof Array.prototype[Symbol.iterator] == "function", m = y && Object.getPrototypeOf([][Symbol.iterator]()), W = h && typeof String.prototype[Symbol.iterator] == "function", R = W && Object.getPrototypeOf(""[Symbol.iterator]()), z = 8, L = -1;
158
158
  function q(j) {
159
159
  var Z = typeof j;
160
160
  if (Z !== "object")
@@ -189,14 +189,14 @@ function Va() {
189
189
  if (typeof Se == "string")
190
190
  return Se;
191
191
  var $ = Object.getPrototypeOf(j);
192
- return $ === RegExp.prototype ? "RegExp" : $ === Date.prototype ? "Date" : n && $ === Promise.prototype ? "Promise" : i && $ === Set.prototype ? "Set" : a && $ === Map.prototype ? "Map" : c && $ === WeakSet.prototype ? "WeakSet" : o && $ === WeakMap.prototype ? "WeakMap" : u && $ === DataView.prototype ? "DataView" : a && $ === l ? "Map Iterator" : i && $ === b ? "Set Iterator" : y && $ === m ? "Array Iterator" : W && $ === R ? "String Iterator" : $ === null ? "Object" : Object.prototype.toString.call(j).slice(V, L);
192
+ return $ === RegExp.prototype ? "RegExp" : $ === Date.prototype ? "Date" : n && $ === Promise.prototype ? "Promise" : i && $ === Set.prototype ? "Set" : a && $ === Map.prototype ? "Map" : c && $ === WeakSet.prototype ? "WeakSet" : o && $ === WeakMap.prototype ? "WeakMap" : u && $ === DataView.prototype ? "DataView" : a && $ === l ? "Map Iterator" : i && $ === b ? "Set Iterator" : y && $ === m ? "Array Iterator" : W && $ === R ? "String Iterator" : $ === null ? "Object" : Object.prototype.toString.call(j).slice(z, L);
193
193
  }
194
194
  return q;
195
195
  });
196
196
  }(Kn)), Kn.exports;
197
197
  }
198
- var Ua = Va();
199
- const Ba = /* @__PURE__ */ Wa(Ua), Cs = typeof Buffer != "undefined", Ka = Cs && typeof Buffer.from != "undefined", qa = Cs ? (
198
+ var Ua = za();
199
+ const Ba = /* @__PURE__ */ Wa(Ua), As = typeof Buffer != "undefined", Ka = As && typeof Buffer.from != "undefined", qa = As ? (
200
200
  /**
201
201
  * is value is Buffer?
202
202
  *
@@ -227,7 +227,7 @@ const Ba = /* @__PURE__ */ Wa(Ua), Cs = typeof Buffer != "undefined", Ka = Cs &&
227
227
  function(t) {
228
228
  return Buffer.from(t);
229
229
  }
230
- ) : Cs ? (
230
+ ) : As ? (
231
231
  /**
232
232
  * copy Buffer
233
233
  *
@@ -318,7 +318,7 @@ function ii(t) {
318
318
  function oi(t) {
319
319
  return new String(t);
320
320
  }
321
- function Ae(t, e) {
321
+ function Ce(t, e) {
322
322
  return Rn[e].from ? Rn[e].from(t) : new Rn[e](t);
323
323
  }
324
324
  function Q(t) {
@@ -348,15 +348,15 @@ const li = /* @__PURE__ */ new Map([
348
348
  ["String", oi],
349
349
  // typed arrays
350
350
  // TODO: pass bound function
351
- ["Float32Array", Ae],
352
- ["Float64Array", Ae],
353
- ["Int16Array", Ae],
354
- ["Int32Array", Ae],
355
- ["Int8Array", Ae],
356
- ["Uint16Array", Ae],
357
- ["Uint32Array", Ae],
358
- ["Uint8Array", Ae],
359
- ["Uint8ClampedArray", Ae],
351
+ ["Float32Array", Ce],
352
+ ["Float64Array", Ce],
353
+ ["Int16Array", Ce],
354
+ ["Int32Array", Ce],
355
+ ["Int8Array", Ce],
356
+ ["Uint16Array", Ce],
357
+ ["Uint32Array", Ce],
358
+ ["Uint8Array", Ce],
359
+ ["Uint8ClampedArray", Ce],
360
360
  // shallow copy
361
361
  ["Array Iterator", Q],
362
362
  ["Map Iterator", Q],
@@ -544,7 +544,7 @@ class nr extends Error {
544
544
  }
545
545
  }
546
546
  }
547
- class Et extends Error {
547
+ class xt extends Error {
548
548
  constructor(e = {}) {
549
549
  const { canceled: n = !1 } = e;
550
550
  super("Abort Error"), this.name = "Abort Error", this.canceled = n;
@@ -560,7 +560,7 @@ class Pn extends Error {
560
560
  super(e), this.name = "Request Validation Error";
561
561
  }
562
562
  }
563
- function Ar() {
563
+ function Cr() {
564
564
  return Array.from(
565
565
  { length: 32 },
566
566
  () => Math.floor(Math.random() * 256).toString(16).padStart(2, "0")
@@ -570,7 +570,7 @@ function Xn() {
570
570
  return Math.floor(Date.now() / 1e3).toString();
571
571
  }
572
572
  const bi = 5 * 60 * 1e3, wi = 1 * 1e3;
573
- var Ge, ne, ge, Yn, Qn, xt;
573
+ var Ge, ne, ge, Yn, Qn, Et;
574
574
  class ki {
575
575
  constructor({ fetch: e = globalThis.fetch.bind(globalThis), baseAddress: n }) {
576
576
  de(this, ge), de(this, Ge), de(this, ne), this.baseAddress = n, J(this, Ge, e), J(this, ne, {}), this.plugins = [];
@@ -592,31 +592,31 @@ class ki {
592
592
  const { overrideBaseAddress: r, overrideDefaultHeaders: a } = s, i = r != null ? r : this.baseAddress;
593
593
  let o = a != null ? a : this.headers;
594
594
  const c = kt(P(this, ne));
595
- return J(this, ne, {}), c.extraHeaders && (o = ae(ae({}, o), c.extraHeaders)), c.requestValidation && (o = Ts(ae({}, o), { "X-Request-Nonce": Ar(), "X-Request-Timestamp": Xn() })), c.async ? yield _e(this, ge, Qn).call(this, `${i}${n}`, c.async, { headers: o }) : yield _e(this, ge, Yn).call(this, `${i}${n}`, c, { headers: o });
595
+ return J(this, ne, {}), c.extraHeaders && (o = ae(ae({}, o), c.extraHeaders)), c.requestValidation && (o = Ts(ae({}, o), { "X-Request-Nonce": Cr(), "X-Request-Timestamp": Xn() })), c.async ? yield _e(this, ge, Qn).call(this, `${i}${n}`, c.async, { headers: o }) : yield _e(this, ge, Yn).call(this, `${i}${n}`, c, { headers: o });
596
596
  });
597
597
  }
598
598
  post(e, n) {
599
599
  return B(this, arguments, function* (s, r, a = {}) {
600
600
  const i = kt(P(this, ne));
601
- return J(this, ne, {}), _e(this, ge, xt).call(this, s, "POST", r, a, i);
601
+ return J(this, ne, {}), _e(this, ge, Et).call(this, s, "POST", r, a, i);
602
602
  });
603
603
  }
604
604
  put(e, n) {
605
605
  return B(this, arguments, function* (s, r, a = {}) {
606
606
  const i = kt(P(this, ne));
607
- return J(this, ne, {}), _e(this, ge, xt).call(this, s, "PUT", r, a, i);
607
+ return J(this, ne, {}), _e(this, ge, Et).call(this, s, "PUT", r, a, i);
608
608
  });
609
609
  }
610
610
  delete(e, n) {
611
611
  return B(this, arguments, function* (s, r, a = {}) {
612
612
  const i = kt(P(this, ne));
613
- return J(this, ne, {}), _e(this, ge, xt).call(this, s, "DELETE", r, a, i);
613
+ return J(this, ne, {}), _e(this, ge, Et).call(this, s, "DELETE", r, a, i);
614
614
  });
615
615
  }
616
616
  patch(e, n) {
617
617
  return B(this, arguments, function* (s, r, a = {}) {
618
618
  const i = kt(P(this, ne));
619
- return J(this, ne, {}), _e(this, ge, xt).call(this, s, "PATCH", r, a, i);
619
+ return J(this, ne, {}), _e(this, ge, Et).call(this, s, "PATCH", r, a, i);
620
620
  });
621
621
  }
622
622
  }
@@ -627,7 +627,7 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
627
627
  try {
628
628
  return yield P(this, Ge).call(this, t, ae(ae({}, n), e.abortSignal && { signal: e.abortSignal }));
629
629
  } catch (h) {
630
- throw h instanceof Error && h.name === "AbortError" ? new Et({ canceled: (u = (c = e.abortSignal) == null ? void 0 : c.aborted) != null ? u : !1 }) : h;
630
+ throw h instanceof Error && h.name === "AbortError" ? new xt({ canceled: (u = (c = e.abortSignal) == null ? void 0 : c.aborted) != null ? u : !1 }) : h;
631
631
  }
632
632
  }), { headers: r } = n != null ? n : {}, a = (c, u) => {
633
633
  var h, p;
@@ -687,7 +687,7 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
687
687
  try {
688
688
  p = yield P(this, Ge).call(this, u, ae(ae({}, n), i && { signal: i }));
689
689
  } catch (b) {
690
- throw b instanceof Error && b.name === "AbortError" ? new Et({ canceled: (s = i == null ? void 0 : i.aborted) != null ? s : !1 }) : b;
690
+ throw b instanceof Error && b.name === "AbortError" ? new xt({ canceled: (s = i == null ? void 0 : i.aborted) != null ? s : !1 }) : b;
691
691
  }
692
692
  if (!p.ok) {
693
693
  const b = yield p.text().catch();
@@ -709,9 +709,9 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
709
709
  }, c), m = (W = 0) => B(this, null, function* () {
710
710
  if (i != null && i.aborted) {
711
711
  clearTimeout(y), P(this, Ge).call(this, `${h}/${v}/cancel`, { method: "POST", headers: this.headers }).then(() => {
712
- l(new Et({ canceled: !0 }));
712
+ l(new xt({ canceled: !0 }));
713
713
  }).catch((R) => {
714
- l(new Et({ canceled: !1 }));
714
+ l(new xt({ canceled: !1 }));
715
715
  });
716
716
  return;
717
717
  }
@@ -719,14 +719,14 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
719
719
  const R = yield (yield P(this, Ge).call(this, `${h}/${v}`, { headers: this.headers })).json();
720
720
  if (R.status === "success") {
721
721
  clearTimeout(y);
722
- const V = R.response_json;
723
- b(V);
722
+ const z = R.response_json;
723
+ b(z);
724
724
  } else if (R.status === "failed")
725
725
  clearTimeout(y), l(new _i(R.response_json));
726
726
  else {
727
727
  a && a(R.response_json);
728
- const V = o(W);
729
- setTimeout(() => m(W + 1), V);
728
+ const z = o(W);
729
+ setTimeout(() => m(W + 1), z);
730
730
  }
731
731
  } catch (R) {
732
732
  l(R);
@@ -735,11 +735,11 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
735
735
  m();
736
736
  }));
737
737
  });
738
- }, xt = function(t, e, n, s, r) {
738
+ }, Et = function(t, e, n, s, r) {
739
739
  return B(this, null, function* () {
740
740
  const { overrideBaseAddress: a, overrideDefaultHeaders: i } = s, o = a != null ? a : this.baseAddress;
741
741
  let c = i != null ? i : this.headers;
742
- r.extraHeaders && (c = ae(ae({}, c), r.extraHeaders)), r.requestValidation && (c = Ts(ae({}, c), { "X-Request-Nonce": Ar(), "X-Request-Timestamp": Xn() }));
742
+ r.extraHeaders && (c = ae(ae({}, c), r.extraHeaders)), r.requestValidation && (c = Ts(ae({}, c), { "X-Request-Nonce": Cr(), "X-Request-Timestamp": Xn() }));
743
743
  let u = n;
744
744
  return typeof FormData != "undefined" && n instanceof FormData ? delete c["Content-Type"] : (u = s.skipBodyJsonStringify ? n : JSON.stringify(n), r.compress && mi() && (c["Content-Encoding"] = "gzip", u = yield yi(u))), r.async ? yield _e(this, ge, Qn).call(this, `${o}${t}`, r.async, {
745
745
  method: e,
@@ -748,7 +748,7 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
748
748
  }) : yield _e(this, ge, Yn).call(this, `${o}${t}`, r, { method: e, headers: c, body: u });
749
749
  });
750
750
  };
751
- const sr = (t, e, n, s) => t instanceof Et ? t : new vi({ resource: e, api: String(n), args: s, cause: t }), In = (t, e) => new Proxy(e, {
751
+ const sr = (t, e, n, s) => t instanceof xt ? t : new vi({ resource: e, api: String(n), args: s, cause: t }), In = (t, e) => new Proxy(e, {
752
752
  get(n, s) {
753
753
  return (...r) => {
754
754
  var a;
@@ -770,7 +770,7 @@ const sr = (t, e, n, s) => t instanceof Et ? t : new vi({ resource: e, api: Stri
770
770
  }
771
771
  });
772
772
  var St;
773
- class Ei {
773
+ class xi {
774
774
  constructor(e) {
775
775
  de(this, St), this.resourceName = "Files", J(this, St, e);
776
776
  }
@@ -791,11 +791,11 @@ class Ei {
791
791
  }
792
792
  }
793
793
  St = /* @__PURE__ */ new WeakMap();
794
- const xi = (t, e, n) => {
794
+ const Ei = (t, e, n) => {
795
795
  const s = e.sort();
796
796
  return `${t}-${s.join("-")}-${n}`;
797
797
  }, Si = (t) => t ? t.ts > Date.now() - 1e3 * 30 : !1;
798
- var ve, es, Cr;
798
+ var ve, es, Ar;
799
799
  class Oi {
800
800
  constructor(e) {
801
801
  de(this, es), de(this, ve), this.resourceName = "Images", J(this, ve, e);
@@ -806,14 +806,14 @@ class Oi {
806
806
  */
807
807
  get(e) {
808
808
  return B(this, arguments, function* ({ fileKey: n, nodeIds: s, format: r = "jpg", scale: a }) {
809
- const i = xi(n, s, r), o = P(this, ve).cache.images.entries.get(i);
809
+ const i = Ei(n, s, r), o = P(this, ve).cache.images.entries.get(i);
810
810
  if (Si(o))
811
811
  return o.result;
812
812
  o && P(this, ve).cache.images.entries.delete(i);
813
813
  const c = P(this, ve).cache.images.pendingRequests.get(i);
814
814
  if (c)
815
815
  return c;
816
- const u = _e(this, es, Cr).call(this, i, n, s, r, a);
816
+ const u = _e(this, es, Ar).call(this, i, n, s, r, a);
817
817
  P(this, ve).cache.images.pendingRequests.set(i, u);
818
818
  try {
819
819
  return yield u;
@@ -823,7 +823,7 @@ class Oi {
823
823
  });
824
824
  }
825
825
  }
826
- ve = /* @__PURE__ */ new WeakMap(), es = /* @__PURE__ */ new WeakSet(), Cr = function(t, e, n, s, r) {
826
+ ve = /* @__PURE__ */ new WeakMap(), es = /* @__PURE__ */ new WeakSet(), Ar = function(t, e, n, s, r) {
827
827
  return B(this, null, function* () {
828
828
  const a = yield P(this, ve).get(
829
829
  `v1/images/${e}?ids=${n}&format=${s}${r ? `&scale=${r}` : ""}`
@@ -852,7 +852,7 @@ class Ti {
852
852
  }
853
853
  cn = /* @__PURE__ */ new WeakMap();
854
854
  var je;
855
- class Ai extends ki {
855
+ class Ci extends ki {
856
856
  constructor({
857
857
  baseAddress: e = "https://api.figma.com/",
858
858
  fetch: n = globalThis.fetch.bind(globalThis)
@@ -862,7 +862,7 @@ class Ai extends ki {
862
862
  entries: /* @__PURE__ */ new Map(),
863
863
  pendingRequests: /* @__PURE__ */ new Map()
864
864
  }
865
- }, this.files = In(this, new Ei(this)), this.nodes = In(this, new Ti(this)), this.images = In(this, new Oi(this));
865
+ }, this.files = In(this, new xi(this)), this.nodes = In(this, new Ti(this)), this.images = In(this, new Oi(this));
866
866
  }
867
867
  set token(e) {
868
868
  if (!e.startsWith("figd_") && !e.startsWith("figu_"))
@@ -880,23 +880,26 @@ class Ai extends ki {
880
880
  }
881
881
  }
882
882
  je = /* @__PURE__ */ new WeakMap();
883
- const Ci = (t) => ke(void 0, [t], function* ({
883
+ const Ai = (t) => ke(void 0, [t], function* ({
884
884
  fileKey: e,
885
885
  authToken: n,
886
- figmaRestApi: s = new Ai(),
887
- params: r = {}
886
+ figmaRestApi: s = new Ci(),
887
+ params: r = {},
888
+ signal: a
888
889
  }) {
889
890
  n && (s.token = n);
890
891
  try {
891
- return yield s.files.get({
892
+ return yield s.withOptions({
893
+ abortSignal: a
894
+ }).files.get({
892
895
  fileKey: e,
893
896
  params: r
894
897
  });
895
- } catch (a) {
896
- throw console.error(a), Ia(a, e);
898
+ } catch (i) {
899
+ throw i instanceof Error && i.name === "AbortError" ? i : (console.error(i), Ia(i, e));
897
900
  }
898
901
  });
899
- var C;
902
+ var A;
900
903
  (function(t) {
901
904
  t.assertEqual = (r) => r;
902
905
  function e(r) {
@@ -931,12 +934,12 @@ var C;
931
934
  return r.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
932
935
  }
933
936
  t.joinValues = s, t.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
934
- })(C || (C = {}));
937
+ })(A || (A = {}));
935
938
  var ts;
936
939
  (function(t) {
937
940
  t.mergeShapes = (e, n) => d(d({}, e), n);
938
941
  })(ts || (ts = {}));
939
- const _ = C.arrayToEnum([
942
+ const _ = A.arrayToEnum([
940
943
  "string",
941
944
  "nan",
942
945
  "number",
@@ -978,7 +981,7 @@ const _ = C.arrayToEnum([
978
981
  default:
979
982
  return _.unknown;
980
983
  }
981
- }, f = C.arrayToEnum([
984
+ }, f = A.arrayToEnum([
982
985
  "invalid_type",
983
986
  "invalid_literal",
984
987
  "custom",
@@ -1040,7 +1043,7 @@ class ie extends Error {
1040
1043
  return this.message;
1041
1044
  }
1042
1045
  get message() {
1043
- return JSON.stringify(this.issues, C.jsonStringifyReplacer, 2);
1046
+ return JSON.stringify(this.issues, A.jsonStringifyReplacer, 2);
1044
1047
  }
1045
1048
  get isEmpty() {
1046
1049
  return this.issues.length === 0;
@@ -1063,19 +1066,19 @@ const yt = (t, e) => {
1063
1066
  t.received === _.undefined ? n = "Required" : n = `Expected ${t.expected}, received ${t.received}`;
1064
1067
  break;
1065
1068
  case f.invalid_literal:
1066
- n = `Invalid literal value, expected ${JSON.stringify(t.expected, C.jsonStringifyReplacer)}`;
1069
+ n = `Invalid literal value, expected ${JSON.stringify(t.expected, A.jsonStringifyReplacer)}`;
1067
1070
  break;
1068
1071
  case f.unrecognized_keys:
1069
- n = `Unrecognized key(s) in object: ${C.joinValues(t.keys, ", ")}`;
1072
+ n = `Unrecognized key(s) in object: ${A.joinValues(t.keys, ", ")}`;
1070
1073
  break;
1071
1074
  case f.invalid_union:
1072
1075
  n = "Invalid input";
1073
1076
  break;
1074
1077
  case f.invalid_union_discriminator:
1075
- n = `Invalid discriminator value. Expected ${C.joinValues(t.options)}`;
1078
+ n = `Invalid discriminator value. Expected ${A.joinValues(t.options)}`;
1076
1079
  break;
1077
1080
  case f.invalid_enum_value:
1078
- n = `Invalid enum value. Expected ${C.joinValues(t.options)}, received '${t.received}'`;
1081
+ n = `Invalid enum value. Expected ${A.joinValues(t.options)}, received '${t.received}'`;
1079
1082
  break;
1080
1083
  case f.invalid_arguments:
1081
1084
  n = "Invalid function arguments";
@@ -1087,7 +1090,7 @@ const yt = (t, e) => {
1087
1090
  n = "Invalid date";
1088
1091
  break;
1089
1092
  case f.invalid_string:
1090
- typeof t.validation == "object" ? "includes" in t.validation ? (n = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (n = `${n} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? n = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? n = `Invalid input: must end with "${t.validation.endsWith}"` : C.assertNever(t.validation) : t.validation !== "regex" ? n = `Invalid ${t.validation}` : n = "Invalid";
1093
+ typeof t.validation == "object" ? "includes" in t.validation ? (n = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (n = `${n} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? n = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? n = `Invalid input: must end with "${t.validation.endsWith}"` : A.assertNever(t.validation) : t.validation !== "regex" ? n = `Invalid ${t.validation}` : n = "Invalid";
1091
1094
  break;
1092
1095
  case f.too_small:
1093
1096
  t.type === "array" ? n = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "more than"} ${t.minimum} element(s)` : t.type === "string" ? n = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "over"} ${t.minimum} character(s)` : t.type === "number" ? n = `Number must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${t.minimum}` : t.type === "date" ? n = `Date must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(t.minimum))}` : n = "Invalid input";
@@ -1108,7 +1111,7 @@ const yt = (t, e) => {
1108
1111
  n = "Number must be finite";
1109
1112
  break;
1110
1113
  default:
1111
- n = e.defaultError, C.assertNever(t);
1114
+ n = e.defaultError, A.assertNever(t);
1112
1115
  }
1113
1116
  return { message: n };
1114
1117
  };
@@ -1120,11 +1123,11 @@ function ln() {
1120
1123
  return Nr;
1121
1124
  }
1122
1125
  const fn = (t) => {
1123
- const { data: e, path: n, errorMaps: s, issueData: r } = t, a = [...n, ...r.path || []], i = x(d({}, r), {
1126
+ const { data: e, path: n, errorMaps: s, issueData: r } = t, a = [...n, ...r.path || []], i = E(d({}, r), {
1124
1127
  path: a
1125
1128
  });
1126
1129
  if (r.message !== void 0)
1127
- return x(d({}, r), {
1130
+ return E(d({}, r), {
1128
1131
  path: a,
1129
1132
  message: r.message
1130
1133
  });
@@ -1132,7 +1135,7 @@ const fn = (t) => {
1132
1135
  const c = s.filter((u) => !!u).slice().reverse();
1133
1136
  for (const u of c)
1134
1137
  o = u(i, { data: e, defaultError: o }).message;
1135
- return x(d({}, r), {
1138
+ return E(d({}, r), {
1136
1139
  path: a,
1137
1140
  message: o
1138
1141
  });
@@ -1214,7 +1217,7 @@ var w;
1214
1217
  t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
1215
1218
  })(w || (w = {}));
1216
1219
  var Ot, Tt;
1217
- class Ee {
1220
+ class xe {
1218
1221
  constructor(e, n, s, r) {
1219
1222
  this._cachedPath = [], this.parent = e, this.data = n, this._path = s, this._key = r;
1220
1223
  }
@@ -1384,7 +1387,7 @@ class T {
1384
1387
  _refinement(e) {
1385
1388
  return new ye({
1386
1389
  schema: this,
1387
- typeName: E.ZodEffects,
1390
+ typeName: x.ZodEffects,
1388
1391
  effect: { type: "refinement", refinement: e }
1389
1392
  });
1390
1393
  }
@@ -1420,37 +1423,37 @@ class T {
1420
1423
  return Mt.create(this, e, this._def);
1421
1424
  }
1422
1425
  transform(e) {
1423
- return new ye(x(d({}, O(this._def)), {
1426
+ return new ye(E(d({}, O(this._def)), {
1424
1427
  schema: this,
1425
- typeName: E.ZodEffects,
1428
+ typeName: x.ZodEffects,
1426
1429
  effect: { type: "transform", transform: e }
1427
1430
  }));
1428
1431
  }
1429
1432
  default(e) {
1430
1433
  const n = typeof e == "function" ? e : () => e;
1431
- return new zt(x(d({}, O(this._def)), {
1434
+ return new Vt(E(d({}, O(this._def)), {
1432
1435
  innerType: this,
1433
1436
  defaultValue: n,
1434
- typeName: E.ZodDefault
1437
+ typeName: x.ZodDefault
1435
1438
  }));
1436
1439
  }
1437
1440
  brand() {
1438
1441
  return new Ns(d({
1439
- typeName: E.ZodBranded,
1442
+ typeName: x.ZodBranded,
1440
1443
  type: this
1441
1444
  }, O(this._def)));
1442
1445
  }
1443
1446
  catch(e) {
1444
1447
  const n = typeof e == "function" ? e : () => e;
1445
- return new Vt(x(d({}, O(this._def)), {
1448
+ return new zt(E(d({}, O(this._def)), {
1446
1449
  innerType: this,
1447
1450
  catchValue: n,
1448
- typeName: E.ZodCatch
1451
+ typeName: x.ZodCatch
1449
1452
  }));
1450
1453
  }
1451
1454
  describe(e) {
1452
1455
  const n = this.constructor;
1453
- return new n(x(d({}, this._def), {
1456
+ return new n(E(d({}, this._def), {
1454
1457
  description: e
1455
1458
  }));
1456
1459
  }
@@ -1469,7 +1472,7 @@ class T {
1469
1472
  }
1470
1473
  const Ii = /^c[^\s-]{8,}$/i, ji = /^[0-9a-z]+$/, Zi = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Di = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Mi = /^[a-z0-9_-]{21}$/i, Li = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, $i = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Fi = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Wi = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
1471
1474
  let jn;
1472
- const zi = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Vi = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Ui = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Bi = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Ki = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, qi = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Pr = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Hi = new RegExp(`^${Pr}$`);
1475
+ const Vi = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, zi = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Ui = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Bi = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Ki = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, qi = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Pr = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Hi = new RegExp(`^${Pr}$`);
1473
1476
  function Ir(t) {
1474
1477
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
1475
1478
  return t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`), e;
@@ -1483,7 +1486,7 @@ function jr(t) {
1483
1486
  return n.push(t.local ? "Z?" : "Z"), t.offset && n.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${n.join("|")})`, new RegExp(`^${e}$`);
1484
1487
  }
1485
1488
  function Ji(t, e) {
1486
- return !!((e === "v4" || !e) && zi.test(t) || (e === "v6" || !e) && Ui.test(t));
1489
+ return !!((e === "v4" || !e) && Vi.test(t) || (e === "v6" || !e) && Ui.test(t));
1487
1490
  }
1488
1491
  function Xi(t, e) {
1489
1492
  if (!Li.test(t))
@@ -1496,7 +1499,7 @@ function Xi(t, e) {
1496
1499
  }
1497
1500
  }
1498
1501
  function Yi(t, e) {
1499
- return !!((e === "v4" || !e) && Vi.test(t) || (e === "v6" || !e) && Bi.test(t));
1502
+ return !!((e === "v4" || !e) && zi.test(t) || (e === "v6" || !e) && Bi.test(t));
1500
1503
  }
1501
1504
  class pe extends T {
1502
1505
  _parse(e) {
@@ -1650,7 +1653,7 @@ class pe extends T {
1650
1653
  validation: "base64url",
1651
1654
  code: f.invalid_string,
1652
1655
  message: r.message
1653
- }), n.dirty()) : C.assertNever(r);
1656
+ }), n.dirty()) : A.assertNever(r);
1654
1657
  return { status: n.value, value: e.data };
1655
1658
  }
1656
1659
  _regex(e, n, s) {
@@ -1660,7 +1663,7 @@ class pe extends T {
1660
1663
  }, w.errToObj(s)));
1661
1664
  }
1662
1665
  _addCheck(e) {
1663
- return new pe(x(d({}, this._def), {
1666
+ return new pe(E(d({}, this._def), {
1664
1667
  checks: [...this._def.checks, e]
1665
1668
  }));
1666
1669
  }
@@ -1786,17 +1789,17 @@ class pe extends T {
1786
1789
  return this.min(1, w.errToObj(e));
1787
1790
  }
1788
1791
  trim() {
1789
- return new pe(x(d({}, this._def), {
1792
+ return new pe(E(d({}, this._def), {
1790
1793
  checks: [...this._def.checks, { kind: "trim" }]
1791
1794
  }));
1792
1795
  }
1793
1796
  toLowerCase() {
1794
- return new pe(x(d({}, this._def), {
1797
+ return new pe(E(d({}, this._def), {
1795
1798
  checks: [...this._def.checks, { kind: "toLowerCase" }]
1796
1799
  }));
1797
1800
  }
1798
1801
  toUpperCase() {
1799
- return new pe(x(d({}, this._def), {
1802
+ return new pe(E(d({}, this._def), {
1800
1803
  checks: [...this._def.checks, { kind: "toUpperCase" }]
1801
1804
  }));
1802
1805
  }
@@ -1865,7 +1868,7 @@ pe.create = (t) => {
1865
1868
  var e;
1866
1869
  return new pe(d({
1867
1870
  checks: [],
1868
- typeName: E.ZodString,
1871
+ typeName: x.ZodString,
1869
1872
  coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1
1870
1873
  }, O(t)));
1871
1874
  };
@@ -1889,7 +1892,7 @@ class Le extends T {
1889
1892
  let n;
1890
1893
  const s = new X();
1891
1894
  for (const r of this._def.checks)
1892
- r.kind === "int" ? C.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), g(n, {
1895
+ r.kind === "int" ? A.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), g(n, {
1893
1896
  code: f.invalid_type,
1894
1897
  expected: "integer",
1895
1898
  received: "float",
@@ -1915,7 +1918,7 @@ class Le extends T {
1915
1918
  }), s.dirty()) : r.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), g(n, {
1916
1919
  code: f.not_finite,
1917
1920
  message: r.message
1918
- }), s.dirty()) : C.assertNever(r);
1921
+ }), s.dirty()) : A.assertNever(r);
1919
1922
  return { status: s.value, value: e.data };
1920
1923
  }
1921
1924
  gte(e, n) {
@@ -1931,7 +1934,7 @@ class Le extends T {
1931
1934
  return this.setLimit("max", e, !1, w.toString(n));
1932
1935
  }
1933
1936
  setLimit(e, n, s, r) {
1934
- return new Le(x(d({}, this._def), {
1937
+ return new Le(E(d({}, this._def), {
1935
1938
  checks: [
1936
1939
  ...this._def.checks,
1937
1940
  {
@@ -1944,7 +1947,7 @@ class Le extends T {
1944
1947
  }));
1945
1948
  }
1946
1949
  _addCheck(e) {
1947
- return new Le(x(d({}, this._def), {
1950
+ return new Le(E(d({}, this._def), {
1948
1951
  checks: [...this._def.checks, e]
1949
1952
  }));
1950
1953
  }
@@ -2025,7 +2028,7 @@ class Le extends T {
2025
2028
  return e;
2026
2029
  }
2027
2030
  get isInt() {
2028
- return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && C.isInteger(e.value));
2031
+ return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && A.isInteger(e.value));
2029
2032
  }
2030
2033
  get isFinite() {
2031
2034
  let e = null, n = null;
@@ -2039,7 +2042,7 @@ class Le extends T {
2039
2042
  }
2040
2043
  Le.create = (t) => new Le(d({
2041
2044
  checks: [],
2042
- typeName: E.ZodNumber,
2045
+ typeName: x.ZodNumber,
2043
2046
  coerce: (t == null ? void 0 : t.coerce) || !1
2044
2047
  }, O(t)));
2045
2048
  class $e extends T {
@@ -2074,7 +2077,7 @@ class $e extends T {
2074
2077
  code: f.not_multiple_of,
2075
2078
  multipleOf: r.value,
2076
2079
  message: r.message
2077
- }), s.dirty()) : C.assertNever(r);
2080
+ }), s.dirty()) : A.assertNever(r);
2078
2081
  return { status: s.value, value: e.data };
2079
2082
  }
2080
2083
  _getInvalidInput(e) {
@@ -2098,7 +2101,7 @@ class $e extends T {
2098
2101
  return this.setLimit("max", e, !1, w.toString(n));
2099
2102
  }
2100
2103
  setLimit(e, n, s, r) {
2101
- return new $e(x(d({}, this._def), {
2104
+ return new $e(E(d({}, this._def), {
2102
2105
  checks: [
2103
2106
  ...this._def.checks,
2104
2107
  {
@@ -2111,7 +2114,7 @@ class $e extends T {
2111
2114
  }));
2112
2115
  }
2113
2116
  _addCheck(e) {
2114
- return new $e(x(d({}, this._def), {
2117
+ return new $e(E(d({}, this._def), {
2115
2118
  checks: [...this._def.checks, e]
2116
2119
  }));
2117
2120
  }
@@ -2171,7 +2174,7 @@ $e.create = (t) => {
2171
2174
  var e;
2172
2175
  return new $e(d({
2173
2176
  checks: [],
2174
- typeName: E.ZodBigInt,
2177
+ typeName: x.ZodBigInt,
2175
2178
  coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1
2176
2179
  }, O(t)));
2177
2180
  };
@@ -2189,7 +2192,7 @@ class It extends T {
2189
2192
  }
2190
2193
  }
2191
2194
  It.create = (t) => new It(d({
2192
- typeName: E.ZodBoolean,
2195
+ typeName: x.ZodBoolean,
2193
2196
  coerce: (t == null ? void 0 : t.coerce) || !1
2194
2197
  }, O(t)));
2195
2198
  class Qe extends T {
@@ -2225,14 +2228,14 @@ class Qe extends T {
2225
2228
  exact: !1,
2226
2229
  maximum: r.value,
2227
2230
  type: "date"
2228
- }), n.dirty()) : C.assertNever(r);
2231
+ }), n.dirty()) : A.assertNever(r);
2229
2232
  return {
2230
2233
  status: n.value,
2231
2234
  value: new Date(e.data.getTime())
2232
2235
  };
2233
2236
  }
2234
2237
  _addCheck(e) {
2235
- return new Qe(x(d({}, this._def), {
2238
+ return new Qe(E(d({}, this._def), {
2236
2239
  checks: [...this._def.checks, e]
2237
2240
  }));
2238
2241
  }
@@ -2266,7 +2269,7 @@ class Qe extends T {
2266
2269
  Qe.create = (t) => new Qe(d({
2267
2270
  checks: [],
2268
2271
  coerce: (t == null ? void 0 : t.coerce) || !1,
2269
- typeName: E.ZodDate
2272
+ typeName: x.ZodDate
2270
2273
  }, O(t)));
2271
2274
  class mn extends T {
2272
2275
  _parse(e) {
@@ -2282,7 +2285,7 @@ class mn extends T {
2282
2285
  }
2283
2286
  }
2284
2287
  mn.create = (t) => new mn(d({
2285
- typeName: E.ZodSymbol
2288
+ typeName: x.ZodSymbol
2286
2289
  }, O(t)));
2287
2290
  class jt extends T {
2288
2291
  _parse(e) {
@@ -2298,7 +2301,7 @@ class jt extends T {
2298
2301
  }
2299
2302
  }
2300
2303
  jt.create = (t) => new jt(d({
2301
- typeName: E.ZodUndefined
2304
+ typeName: x.ZodUndefined
2302
2305
  }, O(t)));
2303
2306
  class Zt extends T {
2304
2307
  _parse(e) {
@@ -2314,7 +2317,7 @@ class Zt extends T {
2314
2317
  }
2315
2318
  }
2316
2319
  Zt.create = (t) => new Zt(d({
2317
- typeName: E.ZodNull
2320
+ typeName: x.ZodNull
2318
2321
  }, O(t)));
2319
2322
  class gt extends T {
2320
2323
  constructor() {
@@ -2325,7 +2328,7 @@ class gt extends T {
2325
2328
  }
2326
2329
  }
2327
2330
  gt.create = (t) => new gt(d({
2328
- typeName: E.ZodAny
2331
+ typeName: x.ZodAny
2329
2332
  }, O(t)));
2330
2333
  class Xe extends T {
2331
2334
  constructor() {
@@ -2336,7 +2339,7 @@ class Xe extends T {
2336
2339
  }
2337
2340
  }
2338
2341
  Xe.create = (t) => new Xe(d({
2339
- typeName: E.ZodUnknown
2342
+ typeName: x.ZodUnknown
2340
2343
  }, O(t)));
2341
2344
  class Pe extends T {
2342
2345
  _parse(e) {
@@ -2349,7 +2352,7 @@ class Pe extends T {
2349
2352
  }
2350
2353
  }
2351
2354
  Pe.create = (t) => new Pe(d({
2352
- typeName: E.ZodNever
2355
+ typeName: x.ZodNever
2353
2356
  }, O(t)));
2354
2357
  class yn extends T {
2355
2358
  _parse(e) {
@@ -2365,7 +2368,7 @@ class yn extends T {
2365
2368
  }
2366
2369
  }
2367
2370
  yn.create = (t) => new yn(d({
2368
- typeName: E.ZodVoid
2371
+ typeName: x.ZodVoid
2369
2372
  }, O(t)));
2370
2373
  class me extends T {
2371
2374
  _parse(e) {
@@ -2403,25 +2406,25 @@ class me extends T {
2403
2406
  exact: !1,
2404
2407
  message: r.maxLength.message
2405
2408
  }), s.dirty()), n.common.async)
2406
- return Promise.all([...n.data].map((i, o) => r.type._parseAsync(new Ee(n, i, n.path, o)))).then((i) => X.mergeArray(s, i));
2407
- const a = [...n.data].map((i, o) => r.type._parseSync(new Ee(n, i, n.path, o)));
2409
+ return Promise.all([...n.data].map((i, o) => r.type._parseAsync(new xe(n, i, n.path, o)))).then((i) => X.mergeArray(s, i));
2410
+ const a = [...n.data].map((i, o) => r.type._parseSync(new xe(n, i, n.path, o)));
2408
2411
  return X.mergeArray(s, a);
2409
2412
  }
2410
2413
  get element() {
2411
2414
  return this._def.type;
2412
2415
  }
2413
2416
  min(e, n) {
2414
- return new me(x(d({}, this._def), {
2417
+ return new me(E(d({}, this._def), {
2415
2418
  minLength: { value: e, message: w.toString(n) }
2416
2419
  }));
2417
2420
  }
2418
2421
  max(e, n) {
2419
- return new me(x(d({}, this._def), {
2422
+ return new me(E(d({}, this._def), {
2420
2423
  maxLength: { value: e, message: w.toString(n) }
2421
2424
  }));
2422
2425
  }
2423
2426
  length(e, n) {
2424
- return new me(x(d({}, this._def), {
2427
+ return new me(E(d({}, this._def), {
2425
2428
  exactLength: { value: e, message: w.toString(n) }
2426
2429
  }));
2427
2430
  }
@@ -2434,30 +2437,30 @@ me.create = (t, e) => new me(d({
2434
2437
  minLength: null,
2435
2438
  maxLength: null,
2436
2439
  exactLength: null,
2437
- typeName: E.ZodArray
2440
+ typeName: x.ZodArray
2438
2441
  }, O(e)));
2439
2442
  function ct(t) {
2440
- if (t instanceof z) {
2443
+ if (t instanceof V) {
2441
2444
  const e = {};
2442
2445
  for (const n in t.shape) {
2443
2446
  const s = t.shape[n];
2444
2447
  e[n] = we.create(ct(s));
2445
2448
  }
2446
- return new z(x(d({}, t._def), {
2449
+ return new V(E(d({}, t._def), {
2447
2450
  shape: () => e
2448
2451
  }));
2449
- } else return t instanceof me ? new me(x(d({}, t._def), {
2452
+ } else return t instanceof me ? new me(E(d({}, t._def), {
2450
2453
  type: ct(t.element)
2451
- })) : t instanceof we ? we.create(ct(t.unwrap())) : t instanceof We ? We.create(ct(t.unwrap())) : t instanceof xe ? xe.create(t.items.map((e) => ct(e))) : t;
2454
+ })) : t instanceof we ? we.create(ct(t.unwrap())) : t instanceof We ? We.create(ct(t.unwrap())) : t instanceof Ee ? Ee.create(t.items.map((e) => ct(e))) : t;
2452
2455
  }
2453
- class z extends T {
2456
+ class V extends T {
2454
2457
  constructor() {
2455
2458
  super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
2456
2459
  }
2457
2460
  _getCached() {
2458
2461
  if (this._cached !== null)
2459
2462
  return this._cached;
2460
- const e = this._def.shape(), n = C.objectKeys(e);
2463
+ const e = this._def.shape(), n = A.objectKeys(e);
2461
2464
  return this._cached = { shape: e, keys: n };
2462
2465
  }
2463
2466
  _parse(e) {
@@ -2478,7 +2481,7 @@ class z extends T {
2478
2481
  const u = r[c], h = s.data[c];
2479
2482
  o.push({
2480
2483
  key: { status: "valid", value: c },
2481
- value: u._parse(new Ee(s, h, s.path, c)),
2484
+ value: u._parse(new xe(s, h, s.path, c)),
2482
2485
  alwaysSet: c in s.data
2483
2486
  });
2484
2487
  }
@@ -2503,7 +2506,7 @@ class z extends T {
2503
2506
  o.push({
2504
2507
  key: { status: "valid", value: u },
2505
2508
  value: c._parse(
2506
- new Ee(s, h, s.path, u)
2509
+ new xe(s, h, s.path, u)
2507
2510
  //, ctx.child(key), value, getParsedType(value)
2508
2511
  ),
2509
2512
  alwaysSet: u in s.data
@@ -2527,7 +2530,7 @@ class z extends T {
2527
2530
  return this._def.shape();
2528
2531
  }
2529
2532
  strict(e) {
2530
- return w.errToObj, new z(d(x(d({}, this._def), {
2533
+ return w.errToObj, new V(d(E(d({}, this._def), {
2531
2534
  unknownKeys: "strict"
2532
2535
  }), e !== void 0 ? {
2533
2536
  errorMap: (n, s) => {
@@ -2542,12 +2545,12 @@ class z extends T {
2542
2545
  } : {}));
2543
2546
  }
2544
2547
  strip() {
2545
- return new z(x(d({}, this._def), {
2548
+ return new V(E(d({}, this._def), {
2546
2549
  unknownKeys: "strip"
2547
2550
  }));
2548
2551
  }
2549
2552
  passthrough() {
2550
- return new z(x(d({}, this._def), {
2553
+ return new V(E(d({}, this._def), {
2551
2554
  unknownKeys: "passthrough"
2552
2555
  }));
2553
2556
  }
@@ -2569,7 +2572,7 @@ class z extends T {
2569
2572
  // }) as any;
2570
2573
  // };
2571
2574
  extend(e) {
2572
- return new z(x(d({}, this._def), {
2575
+ return new V(E(d({}, this._def), {
2573
2576
  shape: () => d(d({}, this._def.shape()), e)
2574
2577
  }));
2575
2578
  }
@@ -2579,11 +2582,11 @@ class z extends T {
2579
2582
  * upgrade if you are experiencing issues.
2580
2583
  */
2581
2584
  merge(e) {
2582
- return new z({
2585
+ return new V({
2583
2586
  unknownKeys: e._def.unknownKeys,
2584
2587
  catchall: e._def.catchall,
2585
2588
  shape: () => d(d({}, this._def.shape()), e._def.shape()),
2586
- typeName: E.ZodObject
2589
+ typeName: x.ZodObject
2587
2590
  });
2588
2591
  }
2589
2592
  // merge<
@@ -2646,23 +2649,23 @@ class z extends T {
2646
2649
  // return merged;
2647
2650
  // }
2648
2651
  catchall(e) {
2649
- return new z(x(d({}, this._def), {
2652
+ return new V(E(d({}, this._def), {
2650
2653
  catchall: e
2651
2654
  }));
2652
2655
  }
2653
2656
  pick(e) {
2654
2657
  const n = {};
2655
- return C.objectKeys(e).forEach((s) => {
2658
+ return A.objectKeys(e).forEach((s) => {
2656
2659
  e[s] && this.shape[s] && (n[s] = this.shape[s]);
2657
- }), new z(x(d({}, this._def), {
2660
+ }), new V(E(d({}, this._def), {
2658
2661
  shape: () => n
2659
2662
  }));
2660
2663
  }
2661
2664
  omit(e) {
2662
2665
  const n = {};
2663
- return C.objectKeys(this.shape).forEach((s) => {
2666
+ return A.objectKeys(this.shape).forEach((s) => {
2664
2667
  e[s] || (n[s] = this.shape[s]);
2665
- }), new z(x(d({}, this._def), {
2668
+ }), new V(E(d({}, this._def), {
2666
2669
  shape: () => n
2667
2670
  }));
2668
2671
  }
@@ -2674,16 +2677,16 @@ class z extends T {
2674
2677
  }
2675
2678
  partial(e) {
2676
2679
  const n = {};
2677
- return C.objectKeys(this.shape).forEach((s) => {
2680
+ return A.objectKeys(this.shape).forEach((s) => {
2678
2681
  const r = this.shape[s];
2679
2682
  e && !e[s] ? n[s] = r : n[s] = r.optional();
2680
- }), new z(x(d({}, this._def), {
2683
+ }), new V(E(d({}, this._def), {
2681
2684
  shape: () => n
2682
2685
  }));
2683
2686
  }
2684
2687
  required(e) {
2685
2688
  const n = {};
2686
- return C.objectKeys(this.shape).forEach((s) => {
2689
+ return A.objectKeys(this.shape).forEach((s) => {
2687
2690
  if (e && !e[s])
2688
2691
  n[s] = this.shape[s];
2689
2692
  else {
@@ -2692,31 +2695,31 @@ class z extends T {
2692
2695
  r = r._def.innerType;
2693
2696
  n[s] = r;
2694
2697
  }
2695
- }), new z(x(d({}, this._def), {
2698
+ }), new V(E(d({}, this._def), {
2696
2699
  shape: () => n
2697
2700
  }));
2698
2701
  }
2699
2702
  keyof() {
2700
- return Zr(C.objectKeys(this.shape));
2703
+ return Zr(A.objectKeys(this.shape));
2701
2704
  }
2702
2705
  }
2703
- z.create = (t, e) => new z(d({
2706
+ V.create = (t, e) => new V(d({
2704
2707
  shape: () => t,
2705
2708
  unknownKeys: "strip",
2706
2709
  catchall: Pe.create(),
2707
- typeName: E.ZodObject
2710
+ typeName: x.ZodObject
2708
2711
  }, O(e)));
2709
- z.strictCreate = (t, e) => new z(d({
2712
+ V.strictCreate = (t, e) => new V(d({
2710
2713
  shape: () => t,
2711
2714
  unknownKeys: "strict",
2712
2715
  catchall: Pe.create(),
2713
- typeName: E.ZodObject
2716
+ typeName: x.ZodObject
2714
2717
  }, O(e)));
2715
- z.lazycreate = (t, e) => new z(d({
2718
+ V.lazycreate = (t, e) => new V(d({
2716
2719
  shape: t,
2717
2720
  unknownKeys: "strip",
2718
2721
  catchall: Pe.create(),
2719
- typeName: E.ZodObject
2722
+ typeName: x.ZodObject
2720
2723
  }, O(e)));
2721
2724
  class Dt extends T {
2722
2725
  _parse(e) {
@@ -2736,8 +2739,8 @@ class Dt extends T {
2736
2739
  }
2737
2740
  if (n.common.async)
2738
2741
  return Promise.all(s.map((a) => ke(this, null, function* () {
2739
- const i = x(d({}, n), {
2740
- common: x(d({}, n.common), {
2742
+ const i = E(d({}, n), {
2743
+ common: E(d({}, n.common), {
2741
2744
  issues: []
2742
2745
  }),
2743
2746
  parent: null
@@ -2755,8 +2758,8 @@ class Dt extends T {
2755
2758
  let a;
2756
2759
  const i = [];
2757
2760
  for (const c of s) {
2758
- const u = x(d({}, n), {
2759
- common: x(d({}, n.common), {
2761
+ const u = E(d({}, n), {
2762
+ common: E(d({}, n.common), {
2760
2763
  issues: []
2761
2764
  }),
2762
2765
  parent: null
@@ -2784,10 +2787,10 @@ class Dt extends T {
2784
2787
  }
2785
2788
  Dt.create = (t, e) => new Dt(d({
2786
2789
  options: t,
2787
- typeName: E.ZodUnion
2790
+ typeName: x.ZodUnion
2788
2791
  }, O(e)));
2789
- const Ze = (t) => t instanceof $t ? Ze(t.schema) : t instanceof ye ? Ze(t.innerType()) : t instanceof Ft ? [t.value] : t instanceof Fe ? t.options : t instanceof Wt ? C.objectValues(t.enum) : t instanceof zt ? Ze(t._def.innerType) : t instanceof jt ? [void 0] : t instanceof Zt ? [null] : t instanceof we ? [void 0, ...Ze(t.unwrap())] : t instanceof We ? [null, ...Ze(t.unwrap())] : t instanceof Ns || t instanceof Ut ? Ze(t.unwrap()) : t instanceof Vt ? Ze(t._def.innerType) : [];
2790
- class En extends T {
2792
+ const Ze = (t) => t instanceof $t ? Ze(t.schema) : t instanceof ye ? Ze(t.innerType()) : t instanceof Ft ? [t.value] : t instanceof Fe ? t.options : t instanceof Wt ? A.objectValues(t.enum) : t instanceof Vt ? Ze(t._def.innerType) : t instanceof jt ? [void 0] : t instanceof Zt ? [null] : t instanceof we ? [void 0, ...Ze(t.unwrap())] : t instanceof We ? [null, ...Ze(t.unwrap())] : t instanceof Ns || t instanceof Ut ? Ze(t.unwrap()) : t instanceof zt ? Ze(t._def.innerType) : [];
2793
+ class xn extends T {
2791
2794
  _parse(e) {
2792
2795
  const { ctx: n } = this._processInputParams(e);
2793
2796
  if (n.parsedType !== _.object)
@@ -2840,8 +2843,8 @@ class En extends T {
2840
2843
  r.set(o, a);
2841
2844
  }
2842
2845
  }
2843
- return new En(d({
2844
- typeName: E.ZodDiscriminatedUnion,
2846
+ return new xn(d({
2847
+ typeName: x.ZodDiscriminatedUnion,
2845
2848
  discriminator: e,
2846
2849
  options: n,
2847
2850
  optionsMap: r
@@ -2853,7 +2856,7 @@ function rs(t, e) {
2853
2856
  if (t === e)
2854
2857
  return { valid: !0, data: t };
2855
2858
  if (n === _.object && s === _.object) {
2856
- const r = C.objectKeys(e), a = C.objectKeys(t).filter((o) => r.indexOf(o) !== -1), i = d(d({}, t), e);
2859
+ const r = A.objectKeys(e), a = A.objectKeys(t).filter((o) => r.indexOf(o) !== -1), i = d(d({}, t), e);
2857
2860
  for (const o of a) {
2858
2861
  const c = rs(t[o], e[o]);
2859
2862
  if (!c.valid)
@@ -2909,9 +2912,9 @@ class Mt extends T {
2909
2912
  Mt.create = (t, e, n) => new Mt(d({
2910
2913
  left: t,
2911
2914
  right: e,
2912
- typeName: E.ZodIntersection
2915
+ typeName: x.ZodIntersection
2913
2916
  }, O(n)));
2914
- class xe extends T {
2917
+ class Ee extends T {
2915
2918
  _parse(e) {
2916
2919
  const { status: n, ctx: s } = this._processInputParams(e);
2917
2920
  if (s.parsedType !== _.array)
@@ -2937,7 +2940,7 @@ class xe extends T {
2937
2940
  }), n.dirty());
2938
2941
  const r = [...s.data].map((a, i) => {
2939
2942
  const o = this._def.items[i] || this._def.rest;
2940
- return o ? o._parse(new Ee(s, a, s.path, i)) : null;
2943
+ return o ? o._parse(new xe(s, a, s.path, i)) : null;
2941
2944
  }).filter((a) => !!a);
2942
2945
  return s.common.async ? Promise.all(r).then((a) => X.mergeArray(n, a)) : X.mergeArray(n, r);
2943
2946
  }
@@ -2945,17 +2948,17 @@ class xe extends T {
2945
2948
  return this._def.items;
2946
2949
  }
2947
2950
  rest(e) {
2948
- return new xe(x(d({}, this._def), {
2951
+ return new Ee(E(d({}, this._def), {
2949
2952
  rest: e
2950
2953
  }));
2951
2954
  }
2952
2955
  }
2953
- xe.create = (t, e) => {
2956
+ Ee.create = (t, e) => {
2954
2957
  if (!Array.isArray(t))
2955
2958
  throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2956
- return new xe(d({
2959
+ return new Ee(d({
2957
2960
  items: t,
2958
- typeName: E.ZodTuple,
2961
+ typeName: x.ZodTuple,
2959
2962
  rest: null
2960
2963
  }, O(e)));
2961
2964
  };
@@ -2977,8 +2980,8 @@ class Lt extends T {
2977
2980
  const r = [], a = this._def.keyType, i = this._def.valueType;
2978
2981
  for (const o in s.data)
2979
2982
  r.push({
2980
- key: a._parse(new Ee(s, o, s.path, o)),
2981
- value: i._parse(new Ee(s, s.data[o], s.path, o)),
2983
+ key: a._parse(new xe(s, o, s.path, o)),
2984
+ value: i._parse(new xe(s, s.data[o], s.path, o)),
2982
2985
  alwaysSet: o in s.data
2983
2986
  });
2984
2987
  return s.common.async ? X.mergeObjectAsync(n, r) : X.mergeObjectSync(n, r);
@@ -2990,11 +2993,11 @@ class Lt extends T {
2990
2993
  return n instanceof T ? new Lt(d({
2991
2994
  keyType: e,
2992
2995
  valueType: n,
2993
- typeName: E.ZodRecord
2996
+ typeName: x.ZodRecord
2994
2997
  }, O(s))) : new Lt(d({
2995
2998
  keyType: pe.create(),
2996
2999
  valueType: e,
2997
- typeName: E.ZodRecord
3000
+ typeName: x.ZodRecord
2998
3001
  }, O(n)));
2999
3002
  }
3000
3003
  }
@@ -3014,8 +3017,8 @@ class gn extends T {
3014
3017
  received: s.parsedType
3015
3018
  }), S;
3016
3019
  const r = this._def.keyType, a = this._def.valueType, i = [...s.data.entries()].map(([o, c], u) => ({
3017
- key: r._parse(new Ee(s, o, s.path, [u, "key"])),
3018
- value: a._parse(new Ee(s, c, s.path, [u, "value"]))
3020
+ key: r._parse(new xe(s, o, s.path, [u, "key"])),
3021
+ value: a._parse(new xe(s, c, s.path, [u, "value"]))
3019
3022
  }));
3020
3023
  if (s.common.async) {
3021
3024
  const o = /* @__PURE__ */ new Map();
@@ -3043,7 +3046,7 @@ class gn extends T {
3043
3046
  gn.create = (t, e, n) => new gn(d({
3044
3047
  valueType: e,
3045
3048
  keyType: t,
3046
- typeName: E.ZodMap
3049
+ typeName: x.ZodMap
3047
3050
  }, O(n)));
3048
3051
  class et extends T {
3049
3052
  _parse(e) {
@@ -3080,16 +3083,16 @@ class et extends T {
3080
3083
  }
3081
3084
  return { status: n.value, value: u };
3082
3085
  }
3083
- const o = [...s.data.values()].map((c, u) => a._parse(new Ee(s, c, s.path, u)));
3086
+ const o = [...s.data.values()].map((c, u) => a._parse(new xe(s, c, s.path, u)));
3084
3087
  return s.common.async ? Promise.all(o).then((c) => i(c)) : i(o);
3085
3088
  }
3086
3089
  min(e, n) {
3087
- return new et(x(d({}, this._def), {
3090
+ return new et(E(d({}, this._def), {
3088
3091
  minSize: { value: e, message: w.toString(n) }
3089
3092
  }));
3090
3093
  }
3091
3094
  max(e, n) {
3092
- return new et(x(d({}, this._def), {
3095
+ return new et(E(d({}, this._def), {
3093
3096
  maxSize: { value: e, message: w.toString(n) }
3094
3097
  }));
3095
3098
  }
@@ -3104,7 +3107,7 @@ et.create = (t, e) => new et(d({
3104
3107
  valueType: t,
3105
3108
  minSize: null,
3106
3109
  maxSize: null,
3107
- typeName: E.ZodSet
3110
+ typeName: x.ZodSet
3108
3111
  }, O(e)));
3109
3112
  class ht extends T {
3110
3113
  constructor() {
@@ -3183,12 +3186,12 @@ class ht extends T {
3183
3186
  return this._def.returns;
3184
3187
  }
3185
3188
  args(...e) {
3186
- return new ht(x(d({}, this._def), {
3187
- args: xe.create(e).rest(Xe.create())
3189
+ return new ht(E(d({}, this._def), {
3190
+ args: Ee.create(e).rest(Xe.create())
3188
3191
  }));
3189
3192
  }
3190
3193
  returns(e) {
3191
- return new ht(x(d({}, this._def), {
3194
+ return new ht(E(d({}, this._def), {
3192
3195
  returns: e
3193
3196
  }));
3194
3197
  }
@@ -3200,9 +3203,9 @@ class ht extends T {
3200
3203
  }
3201
3204
  static create(e, n, s) {
3202
3205
  return new ht(d({
3203
- args: e || xe.create([]).rest(Xe.create()),
3206
+ args: e || Ee.create([]).rest(Xe.create()),
3204
3207
  returns: n || Xe.create(),
3205
- typeName: E.ZodFunction
3208
+ typeName: x.ZodFunction
3206
3209
  }, O(s)));
3207
3210
  }
3208
3211
  }
@@ -3217,7 +3220,7 @@ class $t extends T {
3217
3220
  }
3218
3221
  $t.create = (t, e) => new $t(d({
3219
3222
  getter: t,
3220
- typeName: E.ZodLazy
3223
+ typeName: x.ZodLazy
3221
3224
  }, O(e)));
3222
3225
  class Ft extends T {
3223
3226
  _parse(e) {
@@ -3237,12 +3240,12 @@ class Ft extends T {
3237
3240
  }
3238
3241
  Ft.create = (t, e) => new Ft(d({
3239
3242
  value: t,
3240
- typeName: E.ZodLiteral
3243
+ typeName: x.ZodLiteral
3241
3244
  }, O(e)));
3242
3245
  function Zr(t, e) {
3243
3246
  return new Fe(d({
3244
3247
  values: t,
3245
- typeName: E.ZodEnum
3248
+ typeName: x.ZodEnum
3246
3249
  }, O(e)));
3247
3250
  }
3248
3251
  class Fe extends T {
@@ -3253,7 +3256,7 @@ class Fe extends T {
3253
3256
  if (typeof e.data != "string") {
3254
3257
  const n = this._getOrReturnCtx(e), s = this._def.values;
3255
3258
  return g(n, {
3256
- expected: C.joinValues(s),
3259
+ expected: A.joinValues(s),
3257
3260
  received: n.parsedType,
3258
3261
  code: f.invalid_type
3259
3262
  }), S;
@@ -3303,17 +3306,17 @@ class Wt extends T {
3303
3306
  super(...arguments), Tt.set(this, void 0);
3304
3307
  }
3305
3308
  _parse(e) {
3306
- const n = C.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
3309
+ const n = A.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
3307
3310
  if (s.parsedType !== _.string && s.parsedType !== _.number) {
3308
- const r = C.objectValues(n);
3311
+ const r = A.objectValues(n);
3309
3312
  return g(s, {
3310
- expected: C.joinValues(r),
3313
+ expected: A.joinValues(r),
3311
3314
  received: s.parsedType,
3312
3315
  code: f.invalid_type
3313
3316
  }), S;
3314
3317
  }
3315
- if (pn(this, Tt) || Rr(this, Tt, new Set(C.getValidEnumValues(this._def.values))), !pn(this, Tt).has(e.data)) {
3316
- const r = C.objectValues(n);
3318
+ if (pn(this, Tt) || Rr(this, Tt, new Set(A.getValidEnumValues(this._def.values))), !pn(this, Tt).has(e.data)) {
3319
+ const r = A.objectValues(n);
3317
3320
  return g(s, {
3318
3321
  received: s.data,
3319
3322
  code: f.invalid_enum_value,
@@ -3329,7 +3332,7 @@ class Wt extends T {
3329
3332
  Tt = /* @__PURE__ */ new WeakMap();
3330
3333
  Wt.create = (t, e) => new Wt(d({
3331
3334
  values: t,
3332
- typeName: E.ZodNativeEnum
3335
+ typeName: x.ZodNativeEnum
3333
3336
  }, O(e)));
3334
3337
  class vt extends T {
3335
3338
  unwrap() {
@@ -3352,14 +3355,14 @@ class vt extends T {
3352
3355
  }
3353
3356
  vt.create = (t, e) => new vt(d({
3354
3357
  type: t,
3355
- typeName: E.ZodPromise
3358
+ typeName: x.ZodPromise
3356
3359
  }, O(e)));
3357
3360
  class ye extends T {
3358
3361
  innerType() {
3359
3362
  return this._def.schema;
3360
3363
  }
3361
3364
  sourceType() {
3362
- return this._def.schema._def.typeName === E.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
3365
+ return this._def.schema._def.typeName === x.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
3363
3366
  }
3364
3367
  _parse(e) {
3365
3368
  const { status: n, ctx: s } = this._processInputParams(e), r = this._def.effect || null, a = {
@@ -3428,18 +3431,18 @@ class ye extends T {
3428
3431
  return { status: n.value, value: o };
3429
3432
  } else
3430
3433
  return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => Ye(i) ? Promise.resolve(r.transform(i.value, a)).then((o) => ({ status: n.value, value: o })) : i);
3431
- C.assertNever(r);
3434
+ A.assertNever(r);
3432
3435
  }
3433
3436
  }
3434
3437
  ye.create = (t, e, n) => new ye(d({
3435
3438
  schema: t,
3436
- typeName: E.ZodEffects,
3439
+ typeName: x.ZodEffects,
3437
3440
  effect: e
3438
3441
  }, O(n)));
3439
3442
  ye.createWithPreprocess = (t, e, n) => new ye(d({
3440
3443
  schema: e,
3441
3444
  effect: { type: "preprocess", transform: t },
3442
- typeName: E.ZodEffects
3445
+ typeName: x.ZodEffects
3443
3446
  }, O(n)));
3444
3447
  class we extends T {
3445
3448
  _parse(e) {
@@ -3451,7 +3454,7 @@ class we extends T {
3451
3454
  }
3452
3455
  we.create = (t, e) => new we(d({
3453
3456
  innerType: t,
3454
- typeName: E.ZodOptional
3457
+ typeName: x.ZodOptional
3455
3458
  }, O(e)));
3456
3459
  class We extends T {
3457
3460
  _parse(e) {
@@ -3463,9 +3466,9 @@ class We extends T {
3463
3466
  }
3464
3467
  We.create = (t, e) => new We(d({
3465
3468
  innerType: t,
3466
- typeName: E.ZodNullable
3469
+ typeName: x.ZodNullable
3467
3470
  }, O(e)));
3468
- class zt extends T {
3471
+ class Vt extends T {
3469
3472
  _parse(e) {
3470
3473
  const { ctx: n } = this._processInputParams(e);
3471
3474
  let s = n.data;
@@ -3479,15 +3482,15 @@ class zt extends T {
3479
3482
  return this._def.innerType;
3480
3483
  }
3481
3484
  }
3482
- zt.create = (t, e) => new zt(d({
3485
+ Vt.create = (t, e) => new Vt(d({
3483
3486
  innerType: t,
3484
- typeName: E.ZodDefault,
3487
+ typeName: x.ZodDefault,
3485
3488
  defaultValue: typeof e.default == "function" ? e.default : () => e.default
3486
3489
  }, O(e)));
3487
- class Vt extends T {
3490
+ class zt extends T {
3488
3491
  _parse(e) {
3489
- const { ctx: n } = this._processInputParams(e), s = x(d({}, n), {
3490
- common: x(d({}, n.common), {
3492
+ const { ctx: n } = this._processInputParams(e), s = E(d({}, n), {
3493
+ common: E(d({}, n.common), {
3491
3494
  issues: []
3492
3495
  })
3493
3496
  }), r = this._def.innerType._parse({
@@ -3517,9 +3520,9 @@ class Vt extends T {
3517
3520
  return this._def.innerType;
3518
3521
  }
3519
3522
  }
3520
- Vt.create = (t, e) => new Vt(d({
3523
+ zt.create = (t, e) => new zt(d({
3521
3524
  innerType: t,
3522
- typeName: E.ZodCatch,
3525
+ typeName: x.ZodCatch,
3523
3526
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch
3524
3527
  }, O(e)));
3525
3528
  class vn extends T {
@@ -3536,7 +3539,7 @@ class vn extends T {
3536
3539
  }
3537
3540
  }
3538
3541
  vn.create = (t) => new vn(d({
3539
- typeName: E.ZodNaN
3542
+ typeName: x.ZodNaN
3540
3543
  }, O(t)));
3541
3544
  const eo = Symbol("zod_brand");
3542
3545
  class Ns extends T {
@@ -3588,7 +3591,7 @@ class Jt extends T {
3588
3591
  return new Jt({
3589
3592
  in: e,
3590
3593
  out: n,
3591
- typeName: E.ZodPipeline
3594
+ typeName: x.ZodPipeline
3592
3595
  });
3593
3596
  }
3594
3597
  }
@@ -3603,7 +3606,7 @@ class Ut extends T {
3603
3606
  }
3604
3607
  Ut.create = (t, e) => new Ut(d({
3605
3608
  innerType: t,
3606
- typeName: E.ZodReadonly
3609
+ typeName: x.ZodReadonly
3607
3610
  }, O(e)));
3608
3611
  function ar(t, e) {
3609
3612
  const n = typeof t == "function" ? t(e) : typeof t == "string" ? { message: t } : t;
@@ -3618,32 +3621,32 @@ function Dr(t, e = {}, n) {
3618
3621
  var u, h;
3619
3622
  if (!c) {
3620
3623
  const p = ar(e, s), k = (h = (u = p.fatal) !== null && u !== void 0 ? u : n) !== null && h !== void 0 ? h : !0;
3621
- r.addIssue(x(d({ code: "custom" }, p), { fatal: k }));
3624
+ r.addIssue(E(d({ code: "custom" }, p), { fatal: k }));
3622
3625
  }
3623
3626
  });
3624
3627
  if (!o) {
3625
3628
  const c = ar(e, s), u = (i = (a = c.fatal) !== null && a !== void 0 ? a : n) !== null && i !== void 0 ? i : !0;
3626
- r.addIssue(x(d({ code: "custom" }, c), { fatal: u }));
3629
+ r.addIssue(E(d({ code: "custom" }, c), { fatal: u }));
3627
3630
  }
3628
3631
  }) : gt.create();
3629
3632
  }
3630
3633
  const to = {
3631
- object: z.lazycreate
3634
+ object: V.lazycreate
3632
3635
  };
3633
- var E;
3636
+ var x;
3634
3637
  (function(t) {
3635
3638
  t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
3636
- })(E || (E = {}));
3639
+ })(x || (x = {}));
3637
3640
  const no = (t, e = {
3638
3641
  message: `Input not instance of ${t.name}`
3639
- }) => Dr((n) => n instanceof t, e), Mr = pe.create, Lr = Le.create, so = vn.create, ro = $e.create, $r = It.create, ao = Qe.create, io = mn.create, oo = jt.create, co = Zt.create, uo = gt.create, lo = Xe.create, fo = Pe.create, ho = yn.create, po = me.create, mo = z.create, yo = z.strictCreate, go = Dt.create, vo = En.create, _o = Mt.create, bo = xe.create, wo = Lt.create, ko = gn.create, Eo = et.create, xo = ht.create, So = $t.create, Oo = Ft.create, To = Fe.create, Ao = Wt.create, Co = vt.create, ir = ye.create, No = we.create, Ro = We.create, Po = ye.createWithPreprocess, Io = Jt.create, jo = () => Mr().optional(), Zo = () => Lr().optional(), Do = () => $r().optional(), Mo = {
3640
- string: (t) => pe.create(x(d({}, t), { coerce: !0 })),
3641
- number: (t) => Le.create(x(d({}, t), { coerce: !0 })),
3642
- boolean: (t) => It.create(x(d({}, t), {
3642
+ }) => Dr((n) => n instanceof t, e), Mr = pe.create, Lr = Le.create, so = vn.create, ro = $e.create, $r = It.create, ao = Qe.create, io = mn.create, oo = jt.create, co = Zt.create, uo = gt.create, lo = Xe.create, fo = Pe.create, ho = yn.create, po = me.create, mo = V.create, yo = V.strictCreate, go = Dt.create, vo = xn.create, _o = Mt.create, bo = Ee.create, wo = Lt.create, ko = gn.create, xo = et.create, Eo = ht.create, So = $t.create, Oo = Ft.create, To = Fe.create, Co = Wt.create, Ao = vt.create, ir = ye.create, No = we.create, Ro = We.create, Po = ye.createWithPreprocess, Io = Jt.create, jo = () => Mr().optional(), Zo = () => Lr().optional(), Do = () => $r().optional(), Mo = {
3643
+ string: (t) => pe.create(E(d({}, t), { coerce: !0 })),
3644
+ number: (t) => Le.create(E(d({}, t), { coerce: !0 })),
3645
+ boolean: (t) => It.create(E(d({}, t), {
3643
3646
  coerce: !0
3644
3647
  })),
3645
- bigint: (t) => $e.create(x(d({}, t), { coerce: !0 })),
3646
- date: (t) => Qe.create(x(d({}, t), { coerce: !0 }))
3648
+ bigint: (t) => $e.create(E(d({}, t), { coerce: !0 })),
3649
+ date: (t) => Qe.create(E(d({}, t), { coerce: !0 }))
3647
3650
  }, Lo = S;
3648
3651
  var M = /* @__PURE__ */ Object.freeze({
3649
3652
  __proto__: null,
@@ -3662,7 +3665,7 @@ var M = /* @__PURE__ */ Object.freeze({
3662
3665
  isValid: Ye,
3663
3666
  isAsync: Pt,
3664
3667
  get util() {
3665
- return C;
3668
+ return A;
3666
3669
  },
3667
3670
  get objectUtil() {
3668
3671
  return ts;
@@ -3684,11 +3687,11 @@ var M = /* @__PURE__ */ Object.freeze({
3684
3687
  ZodNever: Pe,
3685
3688
  ZodVoid: yn,
3686
3689
  ZodArray: me,
3687
- ZodObject: z,
3690
+ ZodObject: V,
3688
3691
  ZodUnion: Dt,
3689
- ZodDiscriminatedUnion: En,
3692
+ ZodDiscriminatedUnion: xn,
3690
3693
  ZodIntersection: Mt,
3691
- ZodTuple: xe,
3694
+ ZodTuple: Ee,
3692
3695
  ZodRecord: Lt,
3693
3696
  ZodMap: gn,
3694
3697
  ZodSet: et,
@@ -3702,8 +3705,8 @@ var M = /* @__PURE__ */ Object.freeze({
3702
3705
  ZodTransformer: ye,
3703
3706
  ZodOptional: we,
3704
3707
  ZodNullable: We,
3705
- ZodDefault: zt,
3706
- ZodCatch: Vt,
3708
+ ZodDefault: Vt,
3709
+ ZodCatch: zt,
3707
3710
  ZodNaN: vn,
3708
3711
  BRAND: eo,
3709
3712
  ZodBranded: Ns,
@@ -3714,7 +3717,7 @@ var M = /* @__PURE__ */ Object.freeze({
3714
3717
  ZodSchema: T,
3715
3718
  late: to,
3716
3719
  get ZodFirstPartyTypeKind() {
3717
- return E;
3720
+ return x;
3718
3721
  },
3719
3722
  coerce: Mo,
3720
3723
  any: uo,
@@ -3725,14 +3728,14 @@ var M = /* @__PURE__ */ Object.freeze({
3725
3728
  discriminatedUnion: vo,
3726
3729
  effect: ir,
3727
3730
  enum: To,
3728
- function: xo,
3731
+ function: Eo,
3729
3732
  instanceof: no,
3730
3733
  intersection: _o,
3731
3734
  lazy: So,
3732
3735
  literal: Oo,
3733
3736
  map: ko,
3734
3737
  nan: so,
3735
- nativeEnum: Ao,
3738
+ nativeEnum: Co,
3736
3739
  never: fo,
3737
3740
  null: co,
3738
3741
  nullable: Ro,
@@ -3744,9 +3747,9 @@ var M = /* @__PURE__ */ Object.freeze({
3744
3747
  ostring: jo,
3745
3748
  pipeline: Io,
3746
3749
  preprocess: Po,
3747
- promise: Co,
3750
+ promise: Ao,
3748
3751
  record: wo,
3749
- set: Eo,
3752
+ set: xo,
3750
3753
  strictObject: yo,
3751
3754
  string: Mr,
3752
3755
  symbol: io,
@@ -3962,69 +3965,69 @@ function ur(t) {
3962
3965
  }
3963
3966
  var Fr = (t) => {
3964
3967
  throw TypeError(t);
3965
- }, Rs = (t, e, n) => e.has(t) || Fr("Cannot " + n), A = (t, e, n) => (Rs(t, e, "read from private field"), n ? n.call(t) : e.get(t)), K = (t, e, n) => e.has(t) ? Fr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), F = (t, e, n, s) => (Rs(t, e, "write to private field"), e.set(t, n), n), Ce = (t, e, n) => (Rs(t, e, "access private method"), n), se, Je, ut, un, _n, Nt, ft, Rt, De, dt, pt, lt, At, he, is, os, cs, dr, us, ds, Ct, ls, fs;
3968
+ }, Rs = (t, e, n) => e.has(t) || Fr("Cannot " + n), C = (t, e, n) => (Rs(t, e, "read from private field"), n ? n.call(t) : e.get(t)), K = (t, e, n) => e.has(t) ? Fr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), F = (t, e, n, s) => (Rs(t, e, "write to private field"), e.set(t, n), n), Ae = (t, e, n) => (Rs(t, e, "access private method"), n), se, Je, ut, un, _n, Nt, ft, Rt, De, dt, pt, lt, Ct, he, is, os, cs, dr, us, ds, At, ls, fs;
3966
3969
  class dn extends EventTarget {
3967
3970
  constructor(e, n) {
3968
3971
  var s, r;
3969
- super(), K(this, he), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, K(this, se), K(this, Je), K(this, ut), K(this, un), K(this, _n), K(this, Nt), K(this, ft), K(this, Rt, null), K(this, De), K(this, dt), K(this, pt, null), K(this, lt, null), K(this, At, null), K(this, os, (a) => Ie(this, null, function* () {
3972
+ super(), K(this, he), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, K(this, se), K(this, Je), K(this, ut), K(this, un), K(this, _n), K(this, Nt), K(this, ft), K(this, Rt, null), K(this, De), K(this, dt), K(this, pt, null), K(this, lt, null), K(this, Ct, null), K(this, os, (a) => Ie(this, null, function* () {
3970
3973
  var i;
3971
- A(this, dt).reset();
3974
+ C(this, dt).reset();
3972
3975
  const { body: o, redirected: c, status: u, headers: h } = a;
3973
3976
  if (u === 204) {
3974
- Ce(this, he, Ct).call(this, "Server sent HTTP 204, not reconnecting", 204), this.close();
3977
+ Ae(this, he, At).call(this, "Server sent HTTP 204, not reconnecting", 204), this.close();
3975
3978
  return;
3976
3979
  }
3977
3980
  if (c ? F(this, ut, new URL(a.url)) : F(this, ut, void 0), u !== 200) {
3978
- Ce(this, he, Ct).call(this, `Non-200 status code (${u})`, u);
3981
+ Ae(this, he, At).call(this, `Non-200 status code (${u})`, u);
3979
3982
  return;
3980
3983
  }
3981
3984
  if (!(h.get("content-type") || "").startsWith("text/event-stream")) {
3982
- Ce(this, he, Ct).call(this, 'Invalid content type, expected "text/event-stream"', u);
3985
+ Ae(this, he, At).call(this, 'Invalid content type, expected "text/event-stream"', u);
3983
3986
  return;
3984
3987
  }
3985
- if (A(this, se) === this.CLOSED)
3988
+ if (C(this, se) === this.CLOSED)
3986
3989
  return;
3987
3990
  F(this, se, this.OPEN);
3988
3991
  const p = new Event("open");
3989
- if ((i = A(this, At)) == null || i.call(this, p), this.dispatchEvent(p), typeof o != "object" || !o || !("getReader" in o)) {
3990
- Ce(this, he, Ct).call(this, "Invalid response body, expected a web ReadableStream", u), this.close();
3992
+ if ((i = C(this, Ct)) == null || i.call(this, p), this.dispatchEvent(p), typeof o != "object" || !o || !("getReader" in o)) {
3993
+ Ae(this, he, At).call(this, "Invalid response body, expected a web ReadableStream", u), this.close();
3991
3994
  return;
3992
3995
  }
3993
3996
  const k = new TextDecoder(), v = o.getReader();
3994
3997
  let b = !0;
3995
3998
  do {
3996
3999
  const { done: l, value: y } = yield v.read();
3997
- y && A(this, dt).feed(k.decode(y, { stream: !l })), l && (b = !1, A(this, dt).reset(), Ce(this, he, ls).call(this));
4000
+ y && C(this, dt).feed(k.decode(y, { stream: !l })), l && (b = !1, C(this, dt).reset(), Ae(this, he, ls).call(this));
3998
4001
  } while (b);
3999
4002
  })), K(this, cs, (a) => {
4000
- F(this, De, void 0), !(a.name === "AbortError" || a.type === "aborted") && Ce(this, he, ls).call(this, as(a));
4003
+ F(this, De, void 0), !(a.name === "AbortError" || a.type === "aborted") && Ae(this, he, ls).call(this, as(a));
4001
4004
  }), K(this, us, (a) => {
4002
4005
  typeof a.id == "string" && F(this, Rt, a.id);
4003
4006
  const i = new MessageEvent(a.event || "message", {
4004
4007
  data: a.data,
4005
- origin: A(this, ut) ? A(this, ut).origin : A(this, Je).origin,
4008
+ origin: C(this, ut) ? C(this, ut).origin : C(this, Je).origin,
4006
4009
  lastEventId: a.id || ""
4007
4010
  });
4008
- A(this, lt) && (!a.event || a.event === "message") && A(this, lt).call(this, i), this.dispatchEvent(i);
4011
+ C(this, lt) && (!a.event || a.event === "message") && C(this, lt).call(this, i), this.dispatchEvent(i);
4009
4012
  }), K(this, ds, (a) => {
4010
4013
  F(this, Nt, a);
4011
4014
  }), K(this, fs, () => {
4012
- F(this, ft, void 0), A(this, se) === this.CONNECTING && Ce(this, he, is).call(this);
4015
+ F(this, ft, void 0), C(this, se) === this.CONNECTING && Ae(this, he, is).call(this);
4013
4016
  });
4014
4017
  try {
4015
4018
  if (e instanceof URL)
4016
4019
  F(this, Je, e);
4017
4020
  else if (typeof e == "string")
4018
- F(this, Je, new URL(e, zo()));
4021
+ F(this, Je, new URL(e, Vo()));
4019
4022
  else
4020
4023
  throw new Error("Invalid URL");
4021
4024
  } catch (a) {
4022
4025
  throw Wo("An invalid or illegal string was specified");
4023
4026
  }
4024
4027
  F(this, dt, $o({
4025
- onEvent: A(this, us),
4026
- onRetry: A(this, ds)
4027
- })), F(this, se, this.CONNECTING), F(this, Nt, 3e3), F(this, _n, (s = n == null ? void 0 : n.fetch) != null ? s : globalThis.fetch), F(this, un, (r = n == null ? void 0 : n.withCredentials) != null ? r : !1), Ce(this, he, is).call(this);
4028
+ onEvent: C(this, us),
4029
+ onRetry: C(this, ds)
4030
+ })), F(this, se, this.CONNECTING), F(this, Nt, 3e3), F(this, _n, (s = n == null ? void 0 : n.fetch) != null ? s : globalThis.fetch), F(this, un, (r = n == null ? void 0 : n.withCredentials) != null ? r : !1), Ae(this, he, is).call(this);
4028
4031
  }
4029
4032
  /**
4030
4033
  * Returns the state of this EventSource object's connection. It can have the values described below.
@@ -4037,7 +4040,7 @@ class dn extends EventTarget {
4037
4040
  * @public
4038
4041
  */
4039
4042
  get readyState() {
4040
- return A(this, se);
4043
+ return C(this, se);
4041
4044
  }
4042
4045
  /**
4043
4046
  * Returns the URL providing the event stream.
@@ -4047,7 +4050,7 @@ class dn extends EventTarget {
4047
4050
  * @public
4048
4051
  */
4049
4052
  get url() {
4050
- return A(this, Je).href;
4053
+ return C(this, Je).href;
4051
4054
  }
4052
4055
  /**
4053
4056
  * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
@@ -4055,28 +4058,28 @@ class dn extends EventTarget {
4055
4058
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
4056
4059
  */
4057
4060
  get withCredentials() {
4058
- return A(this, un);
4061
+ return C(this, un);
4059
4062
  }
4060
4063
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
4061
4064
  get onerror() {
4062
- return A(this, pt);
4065
+ return C(this, pt);
4063
4066
  }
4064
4067
  set onerror(e) {
4065
4068
  F(this, pt, e);
4066
4069
  }
4067
4070
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
4068
4071
  get onmessage() {
4069
- return A(this, lt);
4072
+ return C(this, lt);
4070
4073
  }
4071
4074
  set onmessage(e) {
4072
4075
  F(this, lt, e);
4073
4076
  }
4074
4077
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
4075
4078
  get onopen() {
4076
- return A(this, At);
4079
+ return C(this, Ct);
4077
4080
  }
4078
4081
  set onopen(e) {
4079
- F(this, At, e);
4082
+ F(this, Ct, e);
4080
4083
  }
4081
4084
  addEventListener(e, n, s) {
4082
4085
  const r = n;
@@ -4094,16 +4097,16 @@ class dn extends EventTarget {
4094
4097
  * @public
4095
4098
  */
4096
4099
  close() {
4097
- A(this, ft) && clearTimeout(A(this, ft)), A(this, se) !== this.CLOSED && (A(this, De) && A(this, De).abort(), F(this, se, this.CLOSED), F(this, De, void 0));
4100
+ C(this, ft) && clearTimeout(C(this, ft)), C(this, se) !== this.CLOSED && (C(this, De) && C(this, De).abort(), F(this, se, this.CLOSED), F(this, De, void 0));
4098
4101
  }
4099
4102
  }
4100
- se = /* @__PURE__ */ new WeakMap(), Je = /* @__PURE__ */ new WeakMap(), ut = /* @__PURE__ */ new WeakMap(), un = /* @__PURE__ */ new WeakMap(), _n = /* @__PURE__ */ new WeakMap(), Nt = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap(), Rt = /* @__PURE__ */ new WeakMap(), De = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), pt = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap(), At = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakSet(), /**
4103
+ se = /* @__PURE__ */ new WeakMap(), Je = /* @__PURE__ */ new WeakMap(), ut = /* @__PURE__ */ new WeakMap(), un = /* @__PURE__ */ new WeakMap(), _n = /* @__PURE__ */ new WeakMap(), Nt = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap(), Rt = /* @__PURE__ */ new WeakMap(), De = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), pt = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap(), Ct = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakSet(), /**
4101
4104
  * Connect to the given URL and start receiving events
4102
4105
  *
4103
4106
  * @internal
4104
4107
  */
4105
4108
  is = function() {
4106
- F(this, se, this.CONNECTING), F(this, De, new AbortController()), A(this, _n)(A(this, Je), Ce(this, he, dr).call(this)).then(A(this, os)).catch(A(this, cs));
4109
+ F(this, se, this.CONNECTING), F(this, De, new AbortController()), C(this, _n)(C(this, Je), Ae(this, he, dr).call(this)).then(C(this, os)).catch(C(this, cs));
4107
4110
  }, os = /* @__PURE__ */ new WeakMap(), cs = /* @__PURE__ */ new WeakMap(), /**
4108
4111
  * Get request options for the `fetch()` request
4109
4112
  *
@@ -4117,9 +4120,9 @@ dr = function() {
4117
4120
  // [spec] …will have their mode set to "cors"…
4118
4121
  mode: "cors",
4119
4122
  redirect: "follow",
4120
- headers: Be({ Accept: "text/event-stream" }, A(this, Rt) ? { "Last-Event-ID": A(this, Rt) } : void 0),
4123
+ headers: Be({ Accept: "text/event-stream" }, C(this, Rt) ? { "Last-Event-ID": C(this, Rt) } : void 0),
4121
4124
  cache: "no-store",
4122
- signal: (t = A(this, De)) == null ? void 0 : t.signal
4125
+ signal: (t = C(this, De)) == null ? void 0 : t.signal
4123
4126
  };
4124
4127
  return "window" in globalThis && (e.credentials = this.withCredentials ? "include" : "same-origin"), e;
4125
4128
  }, us = /* @__PURE__ */ new WeakMap(), ds = /* @__PURE__ */ new WeakMap(), /**
@@ -4129,11 +4132,11 @@ dr = function() {
4129
4132
  * @param code - The HTTP status code, if available
4130
4133
  * @internal
4131
4134
  */
4132
- Ct = function(t, e) {
4135
+ At = function(t, e) {
4133
4136
  var n;
4134
- A(this, se) !== this.CLOSED && F(this, se, this.CLOSED);
4137
+ C(this, se) !== this.CLOSED && F(this, se, this.CLOSED);
4135
4138
  const s = new cr("error", { code: e, message: t });
4136
- (n = A(this, pt)) == null || n.call(this, s), this.dispatchEvent(s);
4139
+ (n = C(this, pt)) == null || n.call(this, s), this.dispatchEvent(s);
4137
4140
  }, /**
4138
4141
  * Schedules a reconnection attempt against the EventSource endpoint.
4139
4142
  *
@@ -4143,11 +4146,11 @@ Ct = function(t, e) {
4143
4146
  */
4144
4147
  ls = function(t, e) {
4145
4148
  var n;
4146
- if (A(this, se) === this.CLOSED)
4149
+ if (C(this, se) === this.CLOSED)
4147
4150
  return;
4148
4151
  F(this, se, this.CONNECTING);
4149
4152
  const s = new cr("error", { code: e, message: t });
4150
- (n = A(this, pt)) == null || n.call(this, s), this.dispatchEvent(s), F(this, ft, setTimeout(A(this, fs), A(this, Nt)));
4153
+ (n = C(this, pt)) == null || n.call(this, s), this.dispatchEvent(s), F(this, ft, setTimeout(C(this, fs), C(this, Nt)));
4151
4154
  }, fs = /* @__PURE__ */ new WeakMap(), /**
4152
4155
  * ReadyState representing an EventSource currently trying to connect
4153
4156
  *
@@ -4164,11 +4167,11 @@ dn.OPEN = 1, /**
4164
4167
  * @public
4165
4168
  */
4166
4169
  dn.CLOSED = 2;
4167
- function zo() {
4170
+ function Vo() {
4168
4171
  const t = "document" in globalThis ? globalThis.document : void 0;
4169
4172
  return t && typeof t == "object" && "baseURI" in t && typeof t.baseURI == "string" ? t.baseURI : void 0;
4170
4173
  }
4171
- var Wr = Symbol.for("immer-nothing"), lr = Symbol.for("immer-draftable"), oe = Symbol.for("immer-state"), Vo = process.env.NODE_ENV !== "production" ? [
4174
+ var Wr = Symbol.for("immer-nothing"), lr = Symbol.for("immer-draftable"), oe = Symbol.for("immer-state"), zo = process.env.NODE_ENV !== "production" ? [
4172
4175
  // All error codes, starting by 0:
4173
4176
  function(t) {
4174
4177
  return `The plugin for '${t}' has not been loaded into Immer. To enable the plugin, import and call \`enable${t}()\` when initializing your application.`;
@@ -4201,7 +4204,7 @@ var Wr = Symbol.for("immer-nothing"), lr = Symbol.for("immer-draftable"), oe = S
4201
4204
  ] : [];
4202
4205
  function re(t, ...e) {
4203
4206
  if (process.env.NODE_ENV !== "production") {
4204
- const n = Vo[t], s = typeof n == "function" ? n.apply(null, e) : n;
4207
+ const n = zo[t], s = typeof n == "function" ? n.apply(null, e) : n;
4205
4208
  throw new Error(`[Immer] ${s}`);
4206
4209
  }
4207
4210
  throw new Error(
@@ -4214,10 +4217,10 @@ function bt(t) {
4214
4217
  }
4215
4218
  function tt(t) {
4216
4219
  var e;
4217
- return t ? zr(t) || Array.isArray(t) || !!t[lr] || !!((e = t.constructor) != null && e[lr]) || Sn(t) || On(t) : !1;
4220
+ return t ? Vr(t) || Array.isArray(t) || !!t[lr] || !!((e = t.constructor) != null && e[lr]) || Sn(t) || On(t) : !1;
4218
4221
  }
4219
4222
  var Uo = Object.prototype.constructor.toString();
4220
- function zr(t) {
4223
+ function Vr(t) {
4221
4224
  if (!t || typeof t != "object")
4222
4225
  return !1;
4223
4226
  const e = _t(t);
@@ -4227,19 +4230,19 @@ function zr(t) {
4227
4230
  return n === Object ? !0 : typeof n == "function" && Function.toString.call(n) === Uo;
4228
4231
  }
4229
4232
  function bn(t, e) {
4230
- xn(t) === 0 ? Reflect.ownKeys(t).forEach((n) => {
4233
+ En(t) === 0 ? Reflect.ownKeys(t).forEach((n) => {
4231
4234
  e(n, t[n], t);
4232
4235
  }) : t.forEach((n, s) => e(s, n, t));
4233
4236
  }
4234
- function xn(t) {
4237
+ function En(t) {
4235
4238
  const e = t[oe];
4236
4239
  return e ? e.type_ : Array.isArray(t) ? 1 : Sn(t) ? 2 : On(t) ? 3 : 0;
4237
4240
  }
4238
4241
  function hs(t, e) {
4239
- return xn(t) === 2 ? t.has(e) : Object.prototype.hasOwnProperty.call(t, e);
4242
+ return En(t) === 2 ? t.has(e) : Object.prototype.hasOwnProperty.call(t, e);
4240
4243
  }
4241
- function Vr(t, e, n) {
4242
- const s = xn(t);
4244
+ function zr(t, e, n) {
4245
+ const s = En(t);
4243
4246
  s === 2 ? t.set(e, n) : s === 3 ? t.add(n) : t[e] = n;
4244
4247
  }
4245
4248
  function Bo(t, e) {
@@ -4261,7 +4264,7 @@ function ps(t, e) {
4261
4264
  return new Set(t);
4262
4265
  if (Array.isArray(t))
4263
4266
  return Array.prototype.slice.call(t);
4264
- const n = zr(t);
4267
+ const n = Vr(t);
4265
4268
  if (e === !0 || e === "class_only" && !n) {
4266
4269
  const s = Object.getOwnPropertyDescriptors(t);
4267
4270
  delete s[oe];
@@ -4286,7 +4289,7 @@ function ps(t, e) {
4286
4289
  }
4287
4290
  }
4288
4291
  function Bt(t, e = !1) {
4289
- return Tn(t) || bt(t) || !tt(t) || (xn(t) > 1 && (t.set = t.add = t.clear = t.delete = Ko), Object.freeze(t), e && Object.entries(t).forEach(([n, s]) => Bt(s, !0))), t;
4292
+ return Tn(t) || bt(t) || !tt(t) || (En(t) > 1 && (t.set = t.add = t.clear = t.delete = Ko), Object.freeze(t), e && Object.entries(t).forEach(([n, s]) => Bt(s, !0))), t;
4290
4293
  }
4291
4294
  function Ko() {
4292
4295
  re(2);
@@ -4373,7 +4376,7 @@ function mr(t, e, n, s, r, a, i) {
4373
4376
  if (process.env.NODE_ENV !== "production" && r === n && re(5), bt(r)) {
4374
4377
  const o = a && e && e.type_ !== 3 && // Set objects are atomic since they have no keys.
4375
4378
  !hs(e.assigned_, s) ? a.concat(s) : void 0, c = wn(t, r, o);
4376
- if (Vr(n, s, c), bt(c))
4379
+ if (zr(n, s, c), bt(c))
4377
4380
  t.canAutoFreeze_ = !1;
4378
4381
  else
4379
4382
  return;
@@ -4618,7 +4621,7 @@ function Kr(t) {
4618
4621
  } else
4619
4622
  n = ps(t, !0);
4620
4623
  return bn(n, (s, r) => {
4621
- Vr(n, s, Kr(r));
4624
+ zr(n, s, Kr(r));
4622
4625
  }), e && (e.finalized_ = !1), n;
4623
4626
  }
4624
4627
  var ce = new Yo(), ec = ce.produce;
@@ -4736,7 +4739,7 @@ const yr = {
4736
4739
  let y;
4737
4740
  try {
4738
4741
  l instanceof MessageEvent ? y = JSON.parse(l.data) : y = yield (yield o).json();
4739
- } catch (V) {
4742
+ } catch (z) {
4740
4743
  }
4741
4744
  const m = new Gs({
4742
4745
  name: (W = y == null ? void 0 : y.payload.name) != null ? W : "Unknown error",
@@ -4744,8 +4747,8 @@ const yr = {
4744
4747
  status: y == null ? void 0 : y.payload.status,
4745
4748
  detail: y == null ? void 0 : y.payload.detail
4746
4749
  });
4747
- s((V) => {
4748
- V.status = "error", V.error = m;
4750
+ s((z) => {
4751
+ z.status = "error", z.error = m;
4749
4752
  }), v({
4750
4753
  result: null,
4751
4754
  error: m
@@ -4770,10 +4773,10 @@ const yr = {
4770
4773
  };
4771
4774
  })), W = yield Promise.allSettled(m);
4772
4775
  for (const R of W) {
4773
- const V = {};
4776
+ const z = {};
4774
4777
  if (R.status === "fulfilled") {
4775
4778
  const { assetName: L, base64: q } = R.value;
4776
- V[L] = q;
4779
+ z[L] = q;
4777
4780
  const j = y ? `${y}/${L}` : L;
4778
4781
  l.files[j] = {
4779
4782
  content: q,
@@ -4938,7 +4941,7 @@ const Re = /* @__PURE__ */ new WeakMap(), Me = () => {
4938
4941
  }, ee = (
4939
4942
  /*#__NOINLINE__*/
4940
4943
  Me()
4941
- ), bs = Object, N = (t) => t === ee, be = (t) => typeof t == "function", ze = (t, e) => Be(Be({}, t), e), Jr = (t) => be(t.then), Fn = {}, nn = {}, Is = "undefined", Xt = typeof window != Is, ws = typeof document != Is, ic = Xt && "Deno" in window, oc = () => Xt && typeof window.requestAnimationFrame != Is, Xr = (t, e) => {
4944
+ ), bs = Object, N = (t) => t === ee, be = (t) => typeof t == "function", Ve = (t, e) => Be(Be({}, t), e), Jr = (t) => be(t.then), Fn = {}, nn = {}, Is = "undefined", Xt = typeof window != Is, ws = typeof document != Is, ic = Xt && "Deno" in window, oc = () => Xt && typeof window.requestAnimationFrame != Is, Xr = (t, e) => {
4942
4945
  const n = Re.get(t);
4943
4946
  return [
4944
4947
  // Getter
@@ -4947,7 +4950,7 @@ const Re = /* @__PURE__ */ new WeakMap(), Me = () => {
4947
4950
  (s) => {
4948
4951
  if (!N(e)) {
4949
4952
  const r = t.get(e);
4950
- e in nn || (nn[e] = r), n[5](e, ze(r, s), r || Fn);
4953
+ e in nn || (nn[e] = r), n[5](e, Ve(r, s), r || Fn);
4951
4954
  }
4952
4955
  },
4953
4956
  // Subscriber
@@ -4957,7 +4960,7 @@ const Re = /* @__PURE__ */ new WeakMap(), Me = () => {
4957
4960
  ];
4958
4961
  };
4959
4962
  let ks = !0;
4960
- const cc = () => ks, [Es, xs] = Xt && window.addEventListener ? [
4963
+ const cc = () => ks, [xs, Es] = Xt && window.addEventListener ? [
4961
4964
  window.addEventListener.bind(window),
4962
4965
  window.removeEventListener.bind(window)
4963
4966
  ] : [
@@ -4966,16 +4969,16 @@ const cc = () => ks, [Es, xs] = Xt && window.addEventListener ? [
4966
4969
  ], uc = () => {
4967
4970
  const t = ws && document.visibilityState;
4968
4971
  return N(t) || t !== "hidden";
4969
- }, dc = (t) => (ws && document.addEventListener("visibilitychange", t), Es("focus", t), () => {
4970
- ws && document.removeEventListener("visibilitychange", t), xs("focus", t);
4972
+ }, dc = (t) => (ws && document.addEventListener("visibilitychange", t), xs("focus", t), () => {
4973
+ ws && document.removeEventListener("visibilitychange", t), Es("focus", t);
4971
4974
  }), lc = (t) => {
4972
4975
  const e = () => {
4973
4976
  ks = !0, t();
4974
4977
  }, n = () => {
4975
4978
  ks = !1;
4976
4979
  };
4977
- return Es("online", e), Es("offline", n), () => {
4978
- xs("online", e), xs("offline", n);
4980
+ return xs("online", e), xs("offline", n), () => {
4981
+ Es("online", e), Es("offline", n);
4979
4982
  };
4980
4983
  }, fc = {
4981
4984
  isOnline: cc,
@@ -4983,13 +4986,13 @@ const cc = () => ks, [Es, xs] = Xt && window.addEventListener ? [
4983
4986
  }, hc = {
4984
4987
  initFocus: dc,
4985
4988
  initReconnect: lc
4986
- }, Er = !Gt.useId, Ht = !Xt || ic, pc = (t) => oc() ? window.requestAnimationFrame(t) : setTimeout(t, 1), Wn = Ht ? fa : ha, zn = typeof navigator != "undefined" && navigator.connection, xr = !Ht && zn && ([
4989
+ }, xr = !Gt.useId, Ht = !Xt || ic, pc = (t) => oc() ? window.requestAnimationFrame(t) : setTimeout(t, 1), Wn = Ht ? fa : ha, Vn = typeof navigator != "undefined" && navigator.connection, Er = !Ht && Vn && ([
4987
4990
  "slow-2g",
4988
4991
  "2g"
4989
- ].includes(zn.effectiveType) || zn.saveData), sn = /* @__PURE__ */ new WeakMap(), Vn = (t, e) => bs.prototype.toString.call(t) === `[object ${e}]`;
4992
+ ].includes(Vn.effectiveType) || Vn.saveData), sn = /* @__PURE__ */ new WeakMap(), zn = (t, e) => bs.prototype.toString.call(t) === `[object ${e}]`;
4990
4993
  let mc = 0;
4991
4994
  const Ss = (t) => {
4992
- const e = typeof t, n = Vn(t, "Date"), s = Vn(t, "RegExp"), r = Vn(t, "Object");
4995
+ const e = typeof t, n = zn(t, "Date"), s = zn(t, "RegExp"), r = zn(t, "Object");
4993
4996
  let a, i;
4994
4997
  if (bs(t) === t && !n && !s) {
4995
4998
  if (a = sn.get(t), a) return a;
@@ -5025,7 +5028,7 @@ let yc = 0;
5025
5028
  const Os = () => ++yc;
5026
5029
  function Yr(...t) {
5027
5030
  return Ie(this, null, function* () {
5028
- const [e, n, s, r] = t, a = ze({
5031
+ const [e, n, s, r] = t, a = Ve({
5029
5032
  populateCache: !0,
5030
5033
  throwOnError: !0
5031
5034
  }, typeof r == "boolean" ? {
@@ -5047,25 +5050,25 @@ function Yr(...t) {
5047
5050
  return Ie(this, null, function* () {
5048
5051
  const [v] = js(k);
5049
5052
  if (!v) return;
5050
- const [b, l] = Xr(e, v), [y, m, W, R] = Re.get(e), V = () => {
5053
+ const [b, l] = Xr(e, v), [y, m, W, R] = Re.get(e), z = () => {
5051
5054
  const le = y[v];
5052
5055
  return (be(a.revalidate) ? a.revalidate(b().data, k) : a.revalidate !== !1) && (delete W[v], delete R[v], le && le[0]) ? le[0](Gr).then(() => b().data) : b().data;
5053
5056
  };
5054
5057
  if (t.length < 3)
5055
- return V();
5058
+ return z();
5056
5059
  let L = s, q;
5057
5060
  const j = Os();
5058
5061
  m[v] = [
5059
5062
  j,
5060
5063
  0
5061
5064
  ];
5062
- const Z = !N(c), Se = b(), $ = Se.data, st = Se._c, Ve = N(st) ? $ : st;
5063
- if (Z && (c = be(c) ? c(Ve, $) : c, l({
5065
+ const Z = !N(c), Se = b(), $ = Se.data, st = Se._c, ze = N(st) ? $ : st;
5066
+ if (Z && (c = be(c) ? c(ze, $) : c, l({
5064
5067
  data: c,
5065
- _c: Ve
5068
+ _c: ze
5066
5069
  })), be(L))
5067
5070
  try {
5068
- L = L(Ve);
5071
+ L = L(ze);
5069
5072
  } catch (le) {
5070
5073
  q = le;
5071
5074
  }
@@ -5076,12 +5079,12 @@ function Yr(...t) {
5076
5079
  if (q) throw q;
5077
5080
  return L;
5078
5081
  } else q && Z && u(q) && (i = !0, l({
5079
- data: Ve,
5082
+ data: ze,
5080
5083
  _c: ee
5081
5084
  }));
5082
5085
  if (i && !q)
5083
5086
  if (be(i)) {
5084
- const le = i(L, Ve);
5087
+ const le = i(L, ze);
5085
5088
  l({
5086
5089
  data: le,
5087
5090
  error: ee,
@@ -5093,7 +5096,7 @@ function Yr(...t) {
5093
5096
  error: ee,
5094
5097
  _c: ee
5095
5098
  });
5096
- if (m[v][1] = Os(), Promise.resolve(V()).then(() => {
5099
+ if (m[v][1] = Os(), Promise.resolve(z()).then(() => {
5097
5100
  l({
5098
5101
  _c: ee
5099
5102
  });
@@ -5111,7 +5114,7 @@ const Sr = (t, e) => {
5111
5114
  t[n][0] && t[n][0](e);
5112
5115
  }, gc = (t, e) => {
5113
5116
  if (!Re.has(t)) {
5114
- const n = ze(hc, e), s = /* @__PURE__ */ Object.create(null), r = Yr.bind(ee, t);
5117
+ const n = Ve(hc, e), s = /* @__PURE__ */ Object.create(null), r = Yr.bind(ee, t);
5115
5118
  let a = Me;
5116
5119
  const i = /* @__PURE__ */ Object.create(null), o = (h, p) => {
5117
5120
  const k = i[h] || [];
@@ -5152,7 +5155,7 @@ const Sr = (t, e) => {
5152
5155
  }, vc = (t, e, n, s, r) => {
5153
5156
  const a = n.errorRetryCount, i = r.retryCount, o = ~~((Math.random() + 0.5) * (1 << (i < 8 ? i : 8))) * n.errorRetryInterval;
5154
5157
  !N(a) && i > a || setTimeout(s, o, r);
5155
- }, _c = _s, [Qr, bc] = gc(/* @__PURE__ */ new Map()), wc = ze(
5158
+ }, _c = _s, [Qr, bc] = gc(/* @__PURE__ */ new Map()), wc = Ve(
5156
5159
  {
5157
5160
  // events
5158
5161
  onLoadingSlow: Me,
@@ -5166,10 +5169,10 @@ const Sr = (t, e) => {
5166
5169
  revalidateIfStale: !0,
5167
5170
  shouldRetryOnError: !0,
5168
5171
  // timeouts
5169
- errorRetryInterval: xr ? 1e4 : 5e3,
5172
+ errorRetryInterval: Er ? 1e4 : 5e3,
5170
5173
  focusThrottleInterval: 5 * 1e3,
5171
5174
  dedupingInterval: 2 * 1e3,
5172
- loadingTimeout: xr ? 5e3 : 3e3,
5175
+ loadingTimeout: Er ? 5e3 : 3e3,
5173
5176
  // providers
5174
5177
  compare: _c,
5175
5178
  isPaused: () => !1,
@@ -5180,13 +5183,13 @@ const Sr = (t, e) => {
5180
5183
  // use web preset by default
5181
5184
  fc
5182
5185
  ), kc = (t, e) => {
5183
- const n = ze(t, e);
5186
+ const n = Ve(t, e);
5184
5187
  if (e) {
5185
5188
  const { use: s, fallback: r } = t, { use: a, fallback: i } = e;
5186
- s && a && (n.use = s.concat(a)), r && i && (n.fallback = ze(r, i));
5189
+ s && a && (n.use = s.concat(a)), r && i && (n.fallback = Ve(r, i));
5187
5190
  }
5188
5191
  return n;
5189
- }, Ec = la({}), xc = "$inf$", ea = Xt && window.__SWR_DEVTOOLS_USE__, Sc = ea ? window.__SWR_DEVTOOLS_USE__ : [], Oc = () => {
5192
+ }, xc = la({}), Ec = "$inf$", ea = Xt && window.__SWR_DEVTOOLS_USE__, Sc = ea ? window.__SWR_DEVTOOLS_USE__ : [], Oc = () => {
5190
5193
  ea && (window.__SWR_DEVTOOLS_REACT__ = Gt);
5191
5194
  }, Tc = (t) => be(t[1]) ? [
5192
5195
  t[0],
@@ -5196,14 +5199,14 @@ const Sr = (t, e) => {
5196
5199
  t[0],
5197
5200
  null,
5198
5201
  (t[1] === null ? t[2] : t[1]) || {}
5199
- ], Ac = () => ze(wc, pa(Ec)), Cc = (t) => (e, n, s) => t(e, n && ((...a) => {
5202
+ ], Cc = () => Ve(wc, pa(xc)), Ac = (t) => (e, n, s) => t(e, n && ((...a) => {
5200
5203
  const [i] = js(e), [, , , o] = Re.get(Qr);
5201
- if (i.startsWith(xc))
5204
+ if (i.startsWith(Ec))
5202
5205
  return n(...a);
5203
5206
  const c = o[i];
5204
5207
  return N(c) ? n(...a) : (delete o[i], c);
5205
- }), s), Nc = Sc.concat(Cc), Rc = (t) => function(...n) {
5206
- const s = Ac(), [r, a, i] = Tc(n), o = kc(s, i);
5208
+ }), s), Nc = Sc.concat(Ac), Rc = (t) => function(...n) {
5209
+ const s = Cc(), [r, a, i] = Tc(n), o = kc(s, i);
5207
5210
  let c = t;
5208
5211
  const { use: u } = o, h = (u || []).concat(Nc);
5209
5212
  for (let p = h.length; p--; )
@@ -5239,7 +5242,7 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
5239
5242
  }), Bn = {
5240
5243
  dedupe: !0
5241
5244
  }, Ic = (t, e, n) => {
5242
- const { cache: s, compare: r, suspense: a, fallbackData: i, revalidateOnMount: o, revalidateIfStale: c, refreshInterval: u, refreshWhenHidden: h, refreshWhenOffline: p, keepPreviousData: k } = n, [v, b, l, y] = Re.get(s), [m, W] = js(t), R = Ke(!1), V = Ke(!1), L = Ke(m), q = Ke(e), j = Ke(n), Z = () => j.current, Se = () => Z().isVisible() && Z().isOnline(), [$, st, Ve, le] = Xr(s, m), rt = Ke({}).current, Yt = N(i) ? N(n.fallback) ? ee : n.fallback[m] : i, Zs = (D, I) => {
5245
+ const { cache: s, compare: r, suspense: a, fallbackData: i, revalidateOnMount: o, revalidateIfStale: c, refreshInterval: u, refreshWhenHidden: h, refreshWhenOffline: p, keepPreviousData: k } = n, [v, b, l, y] = Re.get(s), [m, W] = js(t), R = Ke(!1), z = Ke(!1), L = Ke(m), q = Ke(e), j = Ke(n), Z = () => j.current, Se = () => Z().isVisible() && Z().isOnline(), [$, st, ze, le] = Xr(s, m), rt = Ke({}).current, Yt = N(i) ? N(n.fallback) ? ee : n.fallback[m] : i, Zs = (D, I) => {
5243
5246
  for (const G in rt) {
5244
5247
  const U = G;
5245
5248
  if (U === "data") {
@@ -5251,7 +5254,7 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
5251
5254
  return !0;
5252
5255
  }, Ds = ma(() => {
5253
5256
  const D = !m || !e ? !1 : N(o) ? Z().isPaused() || a ? !1 : c !== !1 : o, I = (Y) => {
5254
- const Oe = ze(Y);
5257
+ const Oe = Ve(Y);
5255
5258
  return delete Oe._k, D ? Be({
5256
5259
  isValidating: !0,
5257
5260
  isLoading: !0
@@ -5269,7 +5272,7 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
5269
5272
  s,
5270
5273
  m
5271
5274
  ]), at = ac.useSyncExternalStore(rn(
5272
- (D) => Ve(m, (I, G) => {
5275
+ (D) => ze(m, (I, G) => {
5273
5276
  Zs(G, I) || D();
5274
5277
  }),
5275
5278
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -5277,31 +5280,31 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
5277
5280
  s,
5278
5281
  m
5279
5282
  ]
5280
- ), Ds[0], Ds[1]), Ms = !R.current, ta = v[m] && v[m].length > 0, it = at.data, Ue = N(it) ? Yt && Jr(Yt) ? Un(Yt) : Yt : it, Qt = at.error, An = Ke(Ue), en = k ? N(it) ? N(An.current) ? Ue : An.current : it : Ue, Ls = ta && !N(Qt) ? !1 : Ms && !N(o) ? o : Z().isPaused() ? !1 : a ? N(Ue) ? !1 : c : N(Ue) || c, $s = !!(m && e && Ms && Ls), na = N(at.isValidating) ? $s : at.isValidating, sa = N(at.isLoading) ? $s : at.isLoading, wt = rn(
5283
+ ), Ds[0], Ds[1]), Ms = !R.current, ta = v[m] && v[m].length > 0, it = at.data, Ue = N(it) ? Yt && Jr(Yt) ? Un(Yt) : Yt : it, Qt = at.error, Cn = Ke(Ue), en = k ? N(it) ? N(Cn.current) ? Ue : Cn.current : it : Ue, Ls = ta && !N(Qt) ? !1 : Ms && !N(o) ? o : Z().isPaused() ? !1 : a ? N(Ue) ? !1 : c : N(Ue) || c, $s = !!(m && e && Ms && Ls), na = N(at.isValidating) ? $s : at.isValidating, sa = N(at.isLoading) ? $s : at.isLoading, wt = rn(
5281
5284
  (D) => Ie(void 0, null, function* () {
5282
5285
  const I = q.current;
5283
- if (!m || !I || V.current || Z().isPaused())
5286
+ if (!m || !I || z.current || Z().isPaused())
5284
5287
  return !1;
5285
5288
  let G, U, fe = !0;
5286
- const ot = D || {}, H = !l[m] || !ot.dedupe, Y = () => Er ? !V.current && m === L.current && R.current : m === L.current, Oe = {
5289
+ const ot = D || {}, H = !l[m] || !ot.dedupe, Y = () => xr ? !z.current && m === L.current && R.current : m === L.current, Oe = {
5287
5290
  isValidating: !1,
5288
5291
  isLoading: !1
5289
5292
  }, Ws = () => {
5290
5293
  st(Oe);
5291
- }, zs = () => {
5294
+ }, Vs = () => {
5292
5295
  const ue = l[m];
5293
5296
  ue && ue[1] === U && delete l[m];
5294
- }, Vs = {
5297
+ }, zs = {
5295
5298
  isValidating: !0
5296
5299
  };
5297
- N($().data) && (Vs.isLoading = !0);
5300
+ N($().data) && (zs.isLoading = !0);
5298
5301
  try {
5299
- if (H && (st(Vs), n.loadingTimeout && N($().data) && setTimeout(() => {
5302
+ if (H && (st(zs), n.loadingTimeout && N($().data) && setTimeout(() => {
5300
5303
  fe && Y() && Z().onLoadingSlow(m, n);
5301
5304
  }, n.loadingTimeout), l[m] = [
5302
5305
  I(W),
5303
5306
  Os()
5304
- ]), [G, U] = l[m], G = yield G, H && setTimeout(zs, n.dedupingInterval), !l[m] || l[m][1] !== U)
5307
+ ]), [G, U] = l[m], G = yield G, H && setTimeout(Vs, n.dedupingInterval), !l[m] || l[m][1] !== U)
5305
5308
  return H && Y() && Z().onDiscarded(m), !1;
5306
5309
  Oe.error = ee;
5307
5310
  const ue = b[m];
@@ -5313,9 +5316,9 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
5313
5316
  const Te = $().data;
5314
5317
  Oe.data = r(Te, G) ? Te : G, H && Y() && Z().onSuccess(G, m, n);
5315
5318
  } catch (ue) {
5316
- zs();
5317
- const Te = Z(), { shouldRetryOnError: Cn } = Te;
5318
- Te.isPaused() || (Oe.error = ue, H && Y() && (Te.onError(ue, m, Te), (Cn === !0 || be(Cn) && Cn(ue)) && (!Z().revalidateOnFocus || !Z().revalidateOnReconnect || Se()) && Te.onErrorRetry(ue, m, Te, (ra) => {
5319
+ Vs();
5320
+ const Te = Z(), { shouldRetryOnError: An } = Te;
5321
+ Te.isPaused() || (Oe.error = ue, H && Y() && (Te.onError(ue, m, Te), (An === !0 || be(An) && An(ue)) && (!Z().revalidateOnFocus || !Z().revalidateOnReconnect || Se()) && Te.onErrorRetry(ue, m, Te, (ra) => {
5319
5322
  const Nn = v[m];
5320
5323
  Nn && Nn[0] && Nn[0](wr, ra);
5321
5324
  }, {
@@ -5347,7 +5350,7 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
5347
5350
  []
5348
5351
  );
5349
5352
  if (Wn(() => {
5350
- q.current = e, j.current = n, N(it) || (An.current = it);
5353
+ q.current = e, j.current = n, N(it) || (Cn.current = it);
5351
5354
  }), Wn(() => {
5352
5355
  if (!m) return;
5353
5356
  const D = wt.bind(ee, Bn);
@@ -5366,10 +5369,10 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
5366
5369
  return wt(ot);
5367
5370
  }
5368
5371
  });
5369
- return V.current = !1, L.current = m, R.current = !0, st({
5372
+ return z.current = !1, L.current = m, R.current = !0, st({
5370
5373
  _k: W
5371
5374
  }), Ls && (N(Ue) || Ht ? D() : pc(D)), () => {
5372
- V.current = !0, U();
5375
+ z.current = !0, U();
5373
5376
  };
5374
5377
  }, [
5375
5378
  m
@@ -5391,9 +5394,9 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
5391
5394
  p,
5392
5395
  m
5393
5396
  ]), ya(en), a && N(Ue) && m) {
5394
- if (!Er && Ht)
5397
+ if (!xr && Ht)
5395
5398
  throw new Error("Fallback data is required when using Suspense in SSR.");
5396
- q.current = e, j.current = n, V.current = !1;
5399
+ q.current = e, j.current = n, z.current = !1;
5397
5400
  const D = y[m];
5398
5401
  if (!N(D)) {
5399
5402
  const I = Fs(D);
@@ -5428,7 +5431,7 @@ const Un = Gt.use || // This extra generic is to avoid TypeScript mixing up the
5428
5431
  }) => {
5429
5432
  const r = !!(n && t && e), { data: a, isLoading: i, error: o } = jc(
5430
5433
  ["figma", t, e, s],
5431
- () => r ? Ci({
5434
+ () => r ? Ai({
5432
5435
  fileKey: t,
5433
5436
  authToken: e,
5434
5437
  params: s