@animaapp/anima-sdk-react 0.6.16 → 0.6.17

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 _a = Object.defineProperty, ba = Object.defineProperties, wa = Object.getOwn
41
41
  for (var n of qs(e))
42
42
  xa.call(e, n) && Hs(t, n, e[n]);
43
43
  return t;
44
- }, E = (t, e) => ba(t, wa(e)), ke = (t, e, n) => new Promise((s, r) => {
44
+ }, E = (t, e) => ba(t, wa(e)), xe = (t, e, n) => new Promise((s, r) => {
45
45
  var a = (c) => {
46
46
  try {
47
47
  o(n.next(c));
@@ -122,14 +122,14 @@ const ja = (t, e) => {
122
122
  };
123
123
  var Za = Object.defineProperty, Da = Object.defineProperties, Ma = Object.getOwnPropertyDescriptors, Js = Object.getOwnPropertySymbols, La = Object.prototype.hasOwnProperty, $a = Object.prototype.propertyIsEnumerable, Xs = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), Tr = (t) => {
124
124
  throw TypeError(t);
125
- }, Ys = (t, e, n) => e in t ? Za(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, ae = (t, e) => {
125
+ }, Ys = (t, e, n) => e in t ? Za(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, ie = (t, e) => {
126
126
  for (var n in e || (e = {}))
127
127
  La.call(e, n) && Ys(t, n, e[n]);
128
128
  if (Js)
129
129
  for (var n of Js(e))
130
130
  $a.call(e, n) && Ys(t, n, e[n]);
131
131
  return t;
132
- }, Ts = (t, e) => Da(t, Ma(e)), As = (t, e, n) => e.has(t) || Tr("Cannot " + n), Z = (t, e, n) => (As(t, e, "read from private field"), n ? n.call(t) : e.get(t)), de = (t, e, n) => e.has(t) ? Tr("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) => Da(t, Ma(e)), As = (t, e, n) => e.has(t) || Tr("Cannot " + n), j = (t, e, n) => (As(t, e, "read from private field"), n ? n.call(t) : e.get(t)), le = (t, e, n) => e.has(t) ? Tr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), X = (t, e, n, s) => (As(t, e, "write to private field"), e.set(t, n), n), be = (t, e, n) => (As(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));
@@ -154,11 +154,11 @@ function za() {
154
154
  (function(n, s) {
155
155
  t.exports = s();
156
156
  })(Va, function() {
157
- var n = typeof Promise == "function", s = typeof self == "object" ? self : Wa, 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", g = a && typeof Map.prototype.entries == "function", b = k && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), m = g && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), _ = h && typeof Array.prototype[Symbol.iterator] == "function", l = _ && Object.getPrototypeOf([][Symbol.iterator]()), C = h && typeof String.prototype[Symbol.iterator] == "function", I = C && Object.getPrototypeOf(""[Symbol.iterator]()), V = 8, M = -1;
158
- function z(D) {
159
- var P = typeof D;
160
- if (P !== "object")
161
- return P;
157
+ var n = typeof Promise == "function", s = typeof self == "object" ? self : Wa, 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", g = a && typeof Map.prototype.entries == "function", b = k && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), m = g && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), _ = h && typeof Array.prototype[Symbol.iterator] == "function", l = _ && Object.getPrototypeOf([][Symbol.iterator]()), C = h && typeof String.prototype[Symbol.iterator] == "function", P = C && Object.getPrototypeOf(""[Symbol.iterator]()), K = 8, Z = -1;
158
+ function V(D) {
159
+ var M = typeof D;
160
+ if (M !== "object")
161
+ return M;
162
162
  if (D === null)
163
163
  return "null";
164
164
  if (D === s)
@@ -185,13 +185,13 @@ function za() {
185
185
  return "HTMLTableHeaderCellElement";
186
186
  }
187
187
  }
188
- var Se = p && D[Symbol.toStringTag];
189
- if (typeof Se == "string")
190
- return Se;
191
- var F = Object.getPrototypeOf(D);
192
- return F === RegExp.prototype ? "RegExp" : F === Date.prototype ? "Date" : n && F === Promise.prototype ? "Promise" : i && F === Set.prototype ? "Set" : a && F === Map.prototype ? "Map" : c && F === WeakSet.prototype ? "WeakSet" : o && F === WeakMap.prototype ? "WeakMap" : u && F === DataView.prototype ? "DataView" : a && F === m ? "Map Iterator" : i && F === b ? "Set Iterator" : _ && F === l ? "Array Iterator" : C && F === I ? "String Iterator" : F === null ? "Object" : Object.prototype.toString.call(D).slice(V, M);
188
+ var G = p && D[Symbol.toStringTag];
189
+ if (typeof G == "string")
190
+ return G;
191
+ var $ = Object.getPrototypeOf(D);
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 && $ === m ? "Map Iterator" : i && $ === b ? "Set Iterator" : _ && $ === l ? "Array Iterator" : C && $ === P ? "String Iterator" : $ === null ? "Object" : Object.prototype.toString.call(D).slice(K, Z);
193
193
  }
194
- return z;
194
+ return V;
195
195
  });
196
196
  }(Bn)), Bn.exports;
197
197
  }
@@ -321,7 +321,7 @@ function ci(t) {
321
321
  function Ae(t, e) {
322
322
  return Rn[e].from ? Rn[e].from(t) : new Rn[e](t);
323
323
  }
324
- function Q(t) {
324
+ function ee(t) {
325
325
  return t;
326
326
  }
327
327
  function tr() {
@@ -358,23 +358,23 @@ const fi = /* @__PURE__ */ new Map([
358
358
  ["Uint8Array", Ae],
359
359
  ["Uint8ClampedArray", Ae],
360
360
  // shallow copy
361
- ["Array Iterator", Q],
362
- ["Map Iterator", Q],
363
- ["Promise", Q],
364
- ["Set Iterator", Q],
365
- ["String Iterator", Q],
366
- ["function", Q],
367
- ["global", Q],
361
+ ["Array Iterator", ee],
362
+ ["Map Iterator", ee],
363
+ ["Promise", ee],
364
+ ["Set Iterator", ee],
365
+ ["String Iterator", ee],
366
+ ["function", ee],
367
+ ["global", ee],
368
368
  // NOTE: WeakMap and WeakSet cannot get entries
369
- ["WeakMap", Q],
370
- ["WeakSet", Q],
369
+ ["WeakMap", ee],
370
+ ["WeakSet", ee],
371
371
  // primitives
372
- ["boolean", Q],
373
- ["null", Q],
374
- ["number", Q],
375
- ["string", Q],
376
- ["symbol", Q],
377
- ["undefined", Q],
372
+ ["boolean", ee],
373
+ ["null", ee],
374
+ ["number", ee],
375
+ ["string", ee],
376
+ ["symbol", ee],
377
+ ["undefined", ee],
378
378
  // collections
379
379
  // NOTE: return empty value, because recursively copy later.
380
380
  ["Arguments", tr],
@@ -463,23 +463,23 @@ const pi = (t) => new Promise((e) => setTimeout(e, t));
463
463
  var an, He, on, Jn, Ar;
464
464
  class mi {
465
465
  constructor({ maxAttempts: e = 3, func: n }) {
466
- de(this, Jn), de(this, an), de(this, He), de(this, on), J(this, an, e), J(this, on, n), J(this, He, 0);
466
+ le(this, Jn), le(this, an), le(this, He), le(this, on), X(this, an, e), X(this, on, n), X(this, He, 0);
467
467
  }
468
468
  run() {
469
469
  return B(this, null, function* () {
470
470
  try {
471
- return yield Z(this, on).call(this);
471
+ return yield j(this, on).call(this);
472
472
  } catch (e) {
473
- if (J(this, He, Z(this, He) + 1), Z(this, He) > Z(this, an))
473
+ if (X(this, He, j(this, He) + 1), j(this, He) > j(this, an))
474
474
  throw console.error("Max attempts reached"), e;
475
- const n = _e(this, Jn, Ar).call(this);
475
+ const n = be(this, Jn, Ar).call(this);
476
476
  return yield pi(n), yield this.run();
477
477
  }
478
478
  });
479
479
  }
480
480
  }
481
481
  an = /* @__PURE__ */ new WeakMap(), He = /* @__PURE__ */ new WeakMap(), on = /* @__PURE__ */ new WeakMap(), Jn = /* @__PURE__ */ new WeakSet(), Ar = function() {
482
- return Z(this, He) * 1e3 * 1.5;
482
+ return j(this, He) * 1e3 * 1.5;
483
483
  };
484
484
  function yi() {
485
485
  return typeof CompressionStream != "undefined";
@@ -570,10 +570,10 @@ function Xn() {
570
570
  return Math.floor(Date.now() / 1e3).toString();
571
571
  }
572
572
  const wi = 5 * 60 * 1e3, ki = 1 * 1e3;
573
- var Ge, ne, ge, Yn, Qn, Et;
573
+ var Ge, se, ve, Yn, Qn, Et;
574
574
  class xi {
575
575
  constructor({ fetch: e = globalThis.fetch.bind(globalThis), baseAddress: n }) {
576
- de(this, ge), de(this, Ge), de(this, ne), this.baseAddress = n, J(this, Ge, e), J(this, ne, {}), this.plugins = [];
576
+ le(this, ve), le(this, Ge), le(this, se), this.baseAddress = n, X(this, Ge, e), X(this, se, {}), this.plugins = [];
577
577
  }
578
578
  get headers() {
579
579
  throw new Error("Missing implementation");
@@ -585,47 +585,47 @@ class xi {
585
585
  this.plugins = this.plugins.filter((n) => n.name !== e);
586
586
  }
587
587
  withOptions(e = {}) {
588
- return J(this, ne, e), this;
588
+ return X(this, se, e), this;
589
589
  }
590
590
  get(e) {
591
591
  return B(this, arguments, function* (n, s = {}) {
592
592
  const { overrideBaseAddress: r, overrideDefaultHeaders: a } = s, i = r != null ? r : this.baseAddress;
593
593
  let o = a != null ? a : this.headers;
594
- const c = kt(Z(this, ne));
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 });
594
+ const c = kt(j(this, se));
595
+ return X(this, se, {}), c.extraHeaders && (o = ie(ie({}, o), c.extraHeaders)), c.requestValidation && (o = Ts(ie({}, o), { "X-Request-Nonce": Cr(), "X-Request-Timestamp": Xn() })), c.async ? yield be(this, ve, Qn).call(this, `${i}${n}`, c.async, { headers: o }) : yield be(this, ve, 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
- const i = kt(Z(this, ne));
601
- return J(this, ne, {}), _e(this, ge, Et).call(this, s, "POST", r, a, i);
600
+ const i = kt(j(this, se));
601
+ return X(this, se, {}), be(this, ve, 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
- const i = kt(Z(this, ne));
607
- return J(this, ne, {}), _e(this, ge, Et).call(this, s, "PUT", r, a, i);
606
+ const i = kt(j(this, se));
607
+ return X(this, se, {}), be(this, ve, 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
- const i = kt(Z(this, ne));
613
- return J(this, ne, {}), _e(this, ge, Et).call(this, s, "DELETE", r, a, i);
612
+ const i = kt(j(this, se));
613
+ return X(this, se, {}), be(this, ve, 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
- const i = kt(Z(this, ne));
619
- return J(this, ne, {}), _e(this, ge, Et).call(this, s, "PATCH", r, a, i);
618
+ const i = kt(j(this, se));
619
+ return X(this, se, {}), be(this, ve, Et).call(this, s, "PATCH", r, a, i);
620
620
  });
621
621
  }
622
622
  }
623
- Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /* @__PURE__ */ new WeakSet(), Yn = function(t, e, n) {
623
+ Ge = /* @__PURE__ */ new WeakMap(), se = /* @__PURE__ */ new WeakMap(), ve = /* @__PURE__ */ new WeakSet(), Yn = function(t, e, n) {
624
624
  return B(this, null, function* () {
625
625
  const s = () => B(this, null, function* () {
626
626
  var c, u;
627
627
  try {
628
- return yield Z(this, Ge).call(this, t, ae(ae({}, n), e.abortSignal && { signal: e.abortSignal }));
628
+ return yield j(this, Ge).call(this, t, ie(ie({}, n), e.abortSignal && { signal: e.abortSignal }));
629
629
  } catch (h) {
630
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
  }
@@ -685,7 +685,7 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
685
685
  } = e, u = `${t}/async`, h = `${t}/async/job`;
686
686
  let p;
687
687
  try {
688
- p = yield Z(this, Ge).call(this, u, ae(ae({}, n), i && { signal: i }));
688
+ p = yield j(this, Ge).call(this, u, ie(ie({}, n), i && { signal: i }));
689
689
  } catch (b) {
690
690
  throw b instanceof Error && b.name === "AbortError" ? new xt({ canceled: (s = i == null ? void 0 : i.aborted) != null ? s : !1 }) : b;
691
691
  }
@@ -708,28 +708,28 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
708
708
  m(new Error("Job timed out"));
709
709
  }, c), l = (C = 0) => B(this, null, function* () {
710
710
  if (i != null && i.aborted) {
711
- clearTimeout(_), Z(this, Ge).call(this, `${h}/${g}/cancel`, { method: "POST", headers: this.headers }).then(() => {
711
+ clearTimeout(_), j(this, Ge).call(this, `${h}/${g}/cancel`, { method: "POST", headers: this.headers }).then(() => {
712
712
  m(new xt({ canceled: !0 }));
713
- }).catch((I) => {
713
+ }).catch((P) => {
714
714
  m(new xt({ canceled: !1 }));
715
715
  });
716
716
  return;
717
717
  }
718
718
  try {
719
- const I = yield (yield Z(this, Ge).call(this, `${h}/${g}`, { headers: this.headers })).json();
720
- if (I.status === "success") {
719
+ const P = yield (yield j(this, Ge).call(this, `${h}/${g}`, { headers: this.headers })).json();
720
+ if (P.status === "success") {
721
721
  clearTimeout(_);
722
- const V = I.response_json;
723
- b(V);
724
- } else if (I.status === "failed")
725
- clearTimeout(_), m(new bi(I.response_json));
722
+ const K = P.response_json;
723
+ b(K);
724
+ } else if (P.status === "failed")
725
+ clearTimeout(_), m(new bi(P.response_json));
726
726
  else {
727
- a && a(I.response_json);
728
- const V = o(C);
729
- setTimeout(() => l(C + 1), V);
727
+ a && a(P.response_json);
728
+ const K = o(C);
729
+ setTimeout(() => l(C + 1), K);
730
730
  }
731
- } catch (I) {
732
- m(I);
731
+ } catch (P) {
732
+ m(P);
733
733
  }
734
734
  });
735
735
  l();
@@ -739,13 +739,13 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
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": Cr(), "X-Request-Timestamp": Xn() }));
742
+ r.extraHeaders && (c = ie(ie({}, c), r.extraHeaders)), r.requestValidation && (c = Ts(ie({}, c), { "X-Request-Nonce": Cr(), "X-Request-Timestamp": Xn() }));
743
743
  let u = n;
744
- return typeof FormData != "undefined" && n instanceof FormData ? delete c["Content-Type"] : (u = s.skipBodyJsonStringify ? n : JSON.stringify(n), r.compress && yi() && (c["Content-Encoding"] = "gzip", u = yield gi(u))), r.async ? yield _e(this, ge, Qn).call(this, `${o}${t}`, r.async, {
744
+ return typeof FormData != "undefined" && n instanceof FormData ? delete c["Content-Type"] : (u = s.skipBodyJsonStringify ? n : JSON.stringify(n), r.compress && yi() && (c["Content-Encoding"] = "gzip", u = yield gi(u))), r.async ? yield be(this, ve, Qn).call(this, `${o}${t}`, r.async, {
745
745
  method: e,
746
746
  headers: c,
747
747
  body: u
748
- }) : yield _e(this, ge, Yn).call(this, `${o}${t}`, r, { method: e, headers: c, body: u });
748
+ }) : yield be(this, ve, Yn).call(this, `${o}${t}`, r, { method: e, headers: c, body: u });
749
749
  });
750
750
  };
751
751
  const sr = (t, e, n, s) => t instanceof xt ? t : new _i({ resource: e, api: String(n), args: s, cause: t }), In = (t, e) => new Proxy(e, {
@@ -772,21 +772,21 @@ const sr = (t, e, n, s) => t instanceof xt ? t : new _i({ resource: e, api: Stri
772
772
  var St;
773
773
  class Ei {
774
774
  constructor(e) {
775
- de(this, St), this.resourceName = "Files", J(this, St, e);
775
+ le(this, St), this.resourceName = "Files", X(this, St, e);
776
776
  }
777
777
  get(e) {
778
778
  return B(this, arguments, function* ({ fileKey: n, params: s = {} }) {
779
- const r = new URLSearchParams(ae({
779
+ const r = new URLSearchParams(ie({
780
780
  plugin_data: "857346721138427857"
781
781
  }, s)).toString(), a = `v1/files/${n}?${r}`;
782
- return yield Z(this, St).get(a);
782
+ return yield j(this, St).get(a);
783
783
  });
784
784
  }
785
785
  getImageFills(e) {
786
786
  return B(this, arguments, function* ({ fileKey: n }) {
787
787
  var s, r;
788
788
  const a = `v1/files/${n}/images`;
789
- return (r = (s = (yield Z(this, St).get(a)).meta) == null ? void 0 : s.images) != null ? r : {};
789
+ return (r = (s = (yield j(this, St).get(a)).meta) == null ? void 0 : s.images) != null ? r : {};
790
790
  });
791
791
  }
792
792
  }
@@ -795,10 +795,10 @@ const Si = (t, e, n) => {
795
795
  const s = e.sort();
796
796
  return `${t}-${s.join("-")}-${n}`;
797
797
  }, Oi = (t) => t ? t.ts > Date.now() - 1e3 * 30 : !1;
798
- var ve, es, Nr;
798
+ var _e, es, Nr;
799
799
  class Ti {
800
800
  constructor(e) {
801
- de(this, es), de(this, ve), this.resourceName = "Images", J(this, ve, e);
801
+ le(this, es), le(this, _e), this.resourceName = "Images", X(this, _e, e);
802
802
  }
803
803
  /**
804
804
  * Return the URL for the _layer_ images for the given nodes.
@@ -806,29 +806,29 @@ class Ti {
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 = Si(n, s, r), o = Z(this, ve).cache.images.entries.get(i);
809
+ const i = Si(n, s, r), o = j(this, _e).cache.images.entries.get(i);
810
810
  if (Oi(o))
811
811
  return o.result;
812
- o && Z(this, ve).cache.images.entries.delete(i);
813
- const c = Z(this, ve).cache.images.pendingRequests.get(i);
812
+ o && j(this, _e).cache.images.entries.delete(i);
813
+ const c = j(this, _e).cache.images.pendingRequests.get(i);
814
814
  if (c)
815
815
  return c;
816
- const u = _e(this, es, Nr).call(this, i, n, s, r, a);
817
- Z(this, ve).cache.images.pendingRequests.set(i, u);
816
+ const u = be(this, es, Nr).call(this, i, n, s, r, a);
817
+ j(this, _e).cache.images.pendingRequests.set(i, u);
818
818
  try {
819
819
  return yield u;
820
820
  } finally {
821
- Z(this, ve).cache.images.pendingRequests.delete(i);
821
+ j(this, _e).cache.images.pendingRequests.delete(i);
822
822
  }
823
823
  });
824
824
  }
825
825
  }
826
- ve = /* @__PURE__ */ new WeakMap(), es = /* @__PURE__ */ new WeakSet(), Nr = function(t, e, n, s, r) {
826
+ _e = /* @__PURE__ */ new WeakMap(), es = /* @__PURE__ */ new WeakSet(), Nr = function(t, e, n, s, r) {
827
827
  return B(this, null, function* () {
828
- const a = yield Z(this, ve).get(
828
+ const a = yield j(this, _e).get(
829
829
  `v1/images/${e}?ids=${n}&format=${s}${r ? `&scale=${r}` : ""}`
830
830
  );
831
- return Z(this, ve).cache.images.entries.set(t, {
831
+ return j(this, _e).cache.images.entries.set(t, {
832
832
  result: a,
833
833
  ts: Date.now()
834
834
  }), a;
@@ -837,16 +837,16 @@ ve = /* @__PURE__ */ new WeakMap(), es = /* @__PURE__ */ new WeakSet(), Nr = fun
837
837
  var cn;
838
838
  class Ai {
839
839
  constructor(e) {
840
- de(this, cn), this.resourceName = "Nodes", J(this, cn, e);
840
+ le(this, cn), this.resourceName = "Nodes", X(this, cn, e);
841
841
  }
842
842
  get(e) {
843
843
  return B(this, arguments, function* ({ fileKey: n, nodeIds: s, params: r = {} }) {
844
- const a = Ts(ae({}, r), {
844
+ const a = Ts(ie({}, r), {
845
845
  ids: s.join(",")
846
- }), i = new URLSearchParams(ae({
846
+ }), i = new URLSearchParams(ie({
847
847
  plugin_data: "857346721138427857"
848
848
  }, a)).toString(), o = `v1/files/${n}/nodes?${i}`;
849
- return yield Z(this, cn).get(o);
849
+ return yield j(this, cn).get(o);
850
850
  });
851
851
  }
852
852
  }
@@ -857,7 +857,7 @@ class Ci extends xi {
857
857
  baseAddress: e = "https://api.figma.com/",
858
858
  fetch: n = globalThis.fetch.bind(globalThis)
859
859
  } = {}) {
860
- super({ fetch: n, baseAddress: e }), de(this, je, ""), this.cache = {
860
+ super({ fetch: n, baseAddress: e }), le(this, je, ""), this.cache = {
861
861
  images: {
862
862
  entries: /* @__PURE__ */ new Map(),
863
863
  pendingRequests: /* @__PURE__ */ new Map()
@@ -867,20 +867,20 @@ class Ci extends xi {
867
867
  set token(e) {
868
868
  if (!e.startsWith("figd_") && !e.startsWith("figu_"))
869
869
  throw new Error("Invalid Figma access token");
870
- J(this, je, e);
870
+ X(this, je, e);
871
871
  }
872
872
  get token() {
873
- return Z(this, je);
873
+ return j(this, je);
874
874
  }
875
875
  get headers() {
876
876
  const e = {
877
877
  "Content-Type": "application/json"
878
878
  };
879
- return Z(this, je).startsWith("figd_") ? e["X-FIGMA-TOKEN"] = Z(this, je) : Z(this, je).startsWith("figu_") && (e.Authorization = `Bearer ${Z(this, je)}`), e;
879
+ return j(this, je).startsWith("figd_") ? e["X-FIGMA-TOKEN"] = j(this, je) : j(this, je).startsWith("figu_") && (e.Authorization = `Bearer ${j(this, je)}`), e;
880
880
  }
881
881
  }
882
882
  je = /* @__PURE__ */ new WeakMap();
883
- const Ni = (t) => ke(void 0, [t], function* ({
883
+ const Ni = (t) => xe(void 0, [t], function* ({
884
884
  fileKey: e,
885
885
  authToken: n,
886
886
  figmaRestApi: s = new Ci(),
@@ -999,7 +999,7 @@ const v = N.arrayToEnum([
999
999
  "not_multiple_of",
1000
1000
  "not_finite"
1001
1001
  ]), Ri = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
1002
- class ie extends Error {
1002
+ class oe extends Error {
1003
1003
  get errors() {
1004
1004
  return this.issues;
1005
1005
  }
@@ -1036,7 +1036,7 @@ class ie extends Error {
1036
1036
  return r(this), s;
1037
1037
  }
1038
1038
  static assert(e) {
1039
- if (!(e instanceof ie))
1039
+ if (!(e instanceof oe))
1040
1040
  throw new Error(`Not a ZodError: ${e}`);
1041
1041
  }
1042
1042
  toString() {
@@ -1058,7 +1058,7 @@ class ie extends Error {
1058
1058
  return this.flatten();
1059
1059
  }
1060
1060
  }
1061
- ie.create = (t) => new ie(t);
1061
+ oe.create = (t) => new oe(t);
1062
1062
  const yt = (t, e) => {
1063
1063
  let n;
1064
1064
  switch (t.code) {
@@ -1158,7 +1158,7 @@ function y(t, e) {
1158
1158
  });
1159
1159
  t.common.issues.push(s);
1160
1160
  }
1161
- class X {
1161
+ class Y {
1162
1162
  constructor() {
1163
1163
  this.value = "valid";
1164
1164
  }
@@ -1178,7 +1178,7 @@ class X {
1178
1178
  return { status: e.value, value: s };
1179
1179
  }
1180
1180
  static mergeObjectAsync(e, n) {
1181
- return ke(this, null, function* () {
1181
+ return xe(this, null, function* () {
1182
1182
  const s = [];
1183
1183
  for (const r of n) {
1184
1184
  const a = yield r.key, i = yield r.value;
@@ -1187,7 +1187,7 @@ class X {
1187
1187
  value: i
1188
1188
  });
1189
1189
  }
1190
- return X.mergeObjectSync(e, s);
1190
+ return Y.mergeObjectSync(e, s);
1191
1191
  });
1192
1192
  }
1193
1193
  static mergeObjectSync(e, n) {
@@ -1203,7 +1203,7 @@ class X {
1203
1203
  }
1204
1204
  const S = Object.freeze({
1205
1205
  status: "aborted"
1206
- }), hn = (t) => ({ status: "dirty", value: t }), te = (t) => ({ status: "valid", value: t }), ns = (t) => t.status === "aborted", ss = (t) => t.status === "dirty", Ye = (t) => t.status === "valid", Pt = (t) => typeof Promise != "undefined" && t instanceof Promise;
1206
+ }), hn = (t) => ({ status: "dirty", value: t }), ne = (t) => ({ status: "valid", value: t }), ns = (t) => t.status === "aborted", ss = (t) => t.status === "dirty", Ye = (t) => t.status === "valid", Pt = (t) => typeof Promise != "undefined" && t instanceof Promise;
1207
1207
  function pn(t, e, n, s) {
1208
1208
  if (typeof e == "function" ? t !== e || !0 : !e.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
1209
1209
  return e.get(t);
@@ -1217,7 +1217,7 @@ var w;
1217
1217
  t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
1218
1218
  })(w || (w = {}));
1219
1219
  var Ot, Tt;
1220
- class xe {
1220
+ class Ee {
1221
1221
  constructor(e, n, s, r) {
1222
1222
  this._cachedPath = [], this.parent = e, this.data = n, this._path = s, this._key = r;
1223
1223
  }
@@ -1235,7 +1235,7 @@ const rr = (t, e) => {
1235
1235
  get error() {
1236
1236
  if (this._error)
1237
1237
  return this._error;
1238
- const n = new ie(t.common.issues);
1238
+ const n = new oe(t.common.issues);
1239
1239
  return this._error = n, this._error;
1240
1240
  }
1241
1241
  };
@@ -1271,7 +1271,7 @@ class T {
1271
1271
  }
1272
1272
  _processInputParams(e) {
1273
1273
  return {
1274
- status: new X(),
1274
+ status: new Y(),
1275
1275
  ctx: {
1276
1276
  common: e.parent.common,
1277
1277
  data: e.data,
@@ -1348,7 +1348,7 @@ class T {
1348
1348
  });
1349
1349
  }
1350
1350
  parseAsync(e, n) {
1351
- return ke(this, null, function* () {
1351
+ return xe(this, null, function* () {
1352
1352
  const s = yield this.safeParseAsync(e, n);
1353
1353
  if (s.success)
1354
1354
  return s.data;
@@ -1356,7 +1356,7 @@ class T {
1356
1356
  });
1357
1357
  }
1358
1358
  safeParseAsync(e, n) {
1359
- return ke(this, null, function* () {
1359
+ return xe(this, null, function* () {
1360
1360
  const s = {
1361
1361
  common: {
1362
1362
  issues: [],
@@ -1385,7 +1385,7 @@ class T {
1385
1385
  return this._refinement((s, r) => e(s) ? !0 : (r.addIssue(typeof n == "function" ? n(s, r) : n), !1));
1386
1386
  }
1387
1387
  _refinement(e) {
1388
- return new ye({
1388
+ return new ge({
1389
1389
  schema: this,
1390
1390
  typeName: x.ZodEffects,
1391
1391
  effect: { type: "refinement", refinement: e }
@@ -1402,7 +1402,7 @@ class T {
1402
1402
  };
1403
1403
  }
1404
1404
  optional() {
1405
- return we.create(this, this._def);
1405
+ return ke.create(this, this._def);
1406
1406
  }
1407
1407
  nullable() {
1408
1408
  return We.create(this, this._def);
@@ -1411,7 +1411,7 @@ class T {
1411
1411
  return this.nullable().optional();
1412
1412
  }
1413
1413
  array() {
1414
- return me.create(this);
1414
+ return ye.create(this);
1415
1415
  }
1416
1416
  promise() {
1417
1417
  return vt.create(this, this._def);
@@ -1423,7 +1423,7 @@ class T {
1423
1423
  return Mt.create(this, e, this._def);
1424
1424
  }
1425
1425
  transform(e) {
1426
- return new ye(E(d({}, O(this._def)), {
1426
+ return new ge(E(d({}, O(this._def)), {
1427
1427
  schema: this,
1428
1428
  typeName: x.ZodEffects,
1429
1429
  effect: { type: "transform", transform: e }
@@ -1501,7 +1501,7 @@ function Yi(t, e) {
1501
1501
  function Qi(t, e) {
1502
1502
  return !!((e === "v4" || !e) && zi.test(t) || (e === "v6" || !e) && Bi.test(t));
1503
1503
  }
1504
- class pe extends T {
1504
+ class me extends T {
1505
1505
  _parse(e) {
1506
1506
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== v.string) {
1507
1507
  const r = this._getOrReturnCtx(e);
@@ -1511,7 +1511,7 @@ class pe extends T {
1511
1511
  received: r.parsedType
1512
1512
  }), S;
1513
1513
  }
1514
- const n = new X();
1514
+ const n = new Y();
1515
1515
  let s;
1516
1516
  for (const r of this._def.checks)
1517
1517
  if (r.kind === "min")
@@ -1663,7 +1663,7 @@ class pe extends T {
1663
1663
  }, w.errToObj(s)));
1664
1664
  }
1665
1665
  _addCheck(e) {
1666
- return new pe(E(d({}, this._def), {
1666
+ return new me(E(d({}, this._def), {
1667
1667
  checks: [...this._def.checks, e]
1668
1668
  }));
1669
1669
  }
@@ -1789,17 +1789,17 @@ class pe extends T {
1789
1789
  return this.min(1, w.errToObj(e));
1790
1790
  }
1791
1791
  trim() {
1792
- return new pe(E(d({}, this._def), {
1792
+ return new me(E(d({}, this._def), {
1793
1793
  checks: [...this._def.checks, { kind: "trim" }]
1794
1794
  }));
1795
1795
  }
1796
1796
  toLowerCase() {
1797
- return new pe(E(d({}, this._def), {
1797
+ return new me(E(d({}, this._def), {
1798
1798
  checks: [...this._def.checks, { kind: "toLowerCase" }]
1799
1799
  }));
1800
1800
  }
1801
1801
  toUpperCase() {
1802
- return new pe(E(d({}, this._def), {
1802
+ return new me(E(d({}, this._def), {
1803
1803
  checks: [...this._def.checks, { kind: "toUpperCase" }]
1804
1804
  }));
1805
1805
  }
@@ -1864,9 +1864,9 @@ class pe extends T {
1864
1864
  return e;
1865
1865
  }
1866
1866
  }
1867
- pe.create = (t) => {
1867
+ me.create = (t) => {
1868
1868
  var e;
1869
- return new pe(d({
1869
+ return new me(d({
1870
1870
  checks: [],
1871
1871
  typeName: x.ZodString,
1872
1872
  coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1
@@ -1890,7 +1890,7 @@ class Le extends T {
1890
1890
  }), S;
1891
1891
  }
1892
1892
  let n;
1893
- const s = new X();
1893
+ const s = new Y();
1894
1894
  for (const r of this._def.checks)
1895
1895
  r.kind === "int" ? N.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), y(n, {
1896
1896
  code: f.invalid_type,
@@ -2059,7 +2059,7 @@ class $e extends T {
2059
2059
  if (this._getType(e) !== v.bigint)
2060
2060
  return this._getInvalidInput(e);
2061
2061
  let n;
2062
- const s = new X();
2062
+ const s = new Y();
2063
2063
  for (const r of this._def.checks)
2064
2064
  r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (n = this._getOrReturnCtx(e, n), y(n, {
2065
2065
  code: f.too_small,
@@ -2188,7 +2188,7 @@ class It extends T {
2188
2188
  received: n.parsedType
2189
2189
  }), S;
2190
2190
  }
2191
- return te(e.data);
2191
+ return ne(e.data);
2192
2192
  }
2193
2193
  }
2194
2194
  It.create = (t) => new It(d({
@@ -2211,7 +2211,7 @@ class Qe extends T {
2211
2211
  code: f.invalid_date
2212
2212
  }), S;
2213
2213
  }
2214
- const n = new X();
2214
+ const n = new Y();
2215
2215
  let s;
2216
2216
  for (const r of this._def.checks)
2217
2217
  r.kind === "min" ? e.data.getTime() < r.value && (s = this._getOrReturnCtx(e, s), y(s, {
@@ -2281,7 +2281,7 @@ class mn extends T {
2281
2281
  received: n.parsedType
2282
2282
  }), S;
2283
2283
  }
2284
- return te(e.data);
2284
+ return ne(e.data);
2285
2285
  }
2286
2286
  }
2287
2287
  mn.create = (t) => new mn(d({
@@ -2297,7 +2297,7 @@ class jt extends T {
2297
2297
  received: n.parsedType
2298
2298
  }), S;
2299
2299
  }
2300
- return te(e.data);
2300
+ return ne(e.data);
2301
2301
  }
2302
2302
  }
2303
2303
  jt.create = (t) => new jt(d({
@@ -2313,7 +2313,7 @@ class Zt extends T {
2313
2313
  received: n.parsedType
2314
2314
  }), S;
2315
2315
  }
2316
- return te(e.data);
2316
+ return ne(e.data);
2317
2317
  }
2318
2318
  }
2319
2319
  Zt.create = (t) => new Zt(d({
@@ -2324,7 +2324,7 @@ class gt extends T {
2324
2324
  super(...arguments), this._any = !0;
2325
2325
  }
2326
2326
  _parse(e) {
2327
- return te(e.data);
2327
+ return ne(e.data);
2328
2328
  }
2329
2329
  }
2330
2330
  gt.create = (t) => new gt(d({
@@ -2335,7 +2335,7 @@ class Xe extends T {
2335
2335
  super(...arguments), this._unknown = !0;
2336
2336
  }
2337
2337
  _parse(e) {
2338
- return te(e.data);
2338
+ return ne(e.data);
2339
2339
  }
2340
2340
  }
2341
2341
  Xe.create = (t) => new Xe(d({
@@ -2364,13 +2364,13 @@ class yn extends T {
2364
2364
  received: n.parsedType
2365
2365
  }), S;
2366
2366
  }
2367
- return te(e.data);
2367
+ return ne(e.data);
2368
2368
  }
2369
2369
  }
2370
2370
  yn.create = (t) => new yn(d({
2371
2371
  typeName: x.ZodVoid
2372
2372
  }, O(t)));
2373
- class me extends T {
2373
+ class ye extends T {
2374
2374
  _parse(e) {
2375
2375
  const { ctx: n, status: s } = this._processInputParams(e), r = this._def;
2376
2376
  if (n.parsedType !== v.array)
@@ -2406,25 +2406,25 @@ class me extends T {
2406
2406
  exact: !1,
2407
2407
  message: r.maxLength.message
2408
2408
  }), s.dirty()), n.common.async)
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)));
2411
- return X.mergeArray(s, a);
2409
+ return Promise.all([...n.data].map((i, o) => r.type._parseAsync(new Ee(n, i, n.path, o)))).then((i) => Y.mergeArray(s, i));
2410
+ const a = [...n.data].map((i, o) => r.type._parseSync(new Ee(n, i, n.path, o)));
2411
+ return Y.mergeArray(s, a);
2412
2412
  }
2413
2413
  get element() {
2414
2414
  return this._def.type;
2415
2415
  }
2416
2416
  min(e, n) {
2417
- return new me(E(d({}, this._def), {
2417
+ return new ye(E(d({}, this._def), {
2418
2418
  minLength: { value: e, message: w.toString(n) }
2419
2419
  }));
2420
2420
  }
2421
2421
  max(e, n) {
2422
- return new me(E(d({}, this._def), {
2422
+ return new ye(E(d({}, this._def), {
2423
2423
  maxLength: { value: e, message: w.toString(n) }
2424
2424
  }));
2425
2425
  }
2426
2426
  length(e, n) {
2427
- return new me(E(d({}, this._def), {
2427
+ return new ye(E(d({}, this._def), {
2428
2428
  exactLength: { value: e, message: w.toString(n) }
2429
2429
  }));
2430
2430
  }
@@ -2432,7 +2432,7 @@ class me extends T {
2432
2432
  return this.min(1, e);
2433
2433
  }
2434
2434
  }
2435
- me.create = (t, e) => new me(d({
2435
+ ye.create = (t, e) => new ye(d({
2436
2436
  type: t,
2437
2437
  minLength: null,
2438
2438
  maxLength: null,
@@ -2444,14 +2444,14 @@ function ct(t) {
2444
2444
  const e = {};
2445
2445
  for (const n in t.shape) {
2446
2446
  const s = t.shape[n];
2447
- e[n] = we.create(ct(s));
2447
+ e[n] = ke.create(ct(s));
2448
2448
  }
2449
2449
  return new U(E(d({}, t._def), {
2450
2450
  shape: () => e
2451
2451
  }));
2452
- } else return t instanceof me ? new me(E(d({}, t._def), {
2452
+ } else return t instanceof ye ? new ye(E(d({}, t._def), {
2453
2453
  type: ct(t.element)
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;
2454
+ })) : t instanceof ke ? ke.create(ct(t.unwrap())) : t instanceof We ? We.create(ct(t.unwrap())) : t instanceof Se ? Se.create(t.items.map((e) => ct(e))) : t;
2455
2455
  }
2456
2456
  class U extends T {
2457
2457
  constructor() {
@@ -2481,7 +2481,7 @@ class U extends T {
2481
2481
  const u = r[c], h = s.data[c];
2482
2482
  o.push({
2483
2483
  key: { status: "valid", value: c },
2484
- value: u._parse(new xe(s, h, s.path, c)),
2484
+ value: u._parse(new Ee(s, h, s.path, c)),
2485
2485
  alwaysSet: c in s.data
2486
2486
  });
2487
2487
  }
@@ -2506,14 +2506,14 @@ class U extends T {
2506
2506
  o.push({
2507
2507
  key: { status: "valid", value: u },
2508
2508
  value: c._parse(
2509
- new xe(s, h, s.path, u)
2509
+ new Ee(s, h, s.path, u)
2510
2510
  //, ctx.child(key), value, getParsedType(value)
2511
2511
  ),
2512
2512
  alwaysSet: u in s.data
2513
2513
  });
2514
2514
  }
2515
2515
  }
2516
- return s.common.async ? Promise.resolve().then(() => ke(this, null, function* () {
2516
+ return s.common.async ? Promise.resolve().then(() => xe(this, null, function* () {
2517
2517
  const c = [];
2518
2518
  for (const u of o) {
2519
2519
  const h = yield u.key, p = yield u.value;
@@ -2524,7 +2524,7 @@ class U extends T {
2524
2524
  });
2525
2525
  }
2526
2526
  return c;
2527
- })).then((c) => X.mergeObjectSync(n, c)) : X.mergeObjectSync(n, o);
2527
+ })).then((c) => Y.mergeObjectSync(n, c)) : Y.mergeObjectSync(n, o);
2528
2528
  }
2529
2529
  get shape() {
2530
2530
  return this._def.shape();
@@ -2691,7 +2691,7 @@ class U extends T {
2691
2691
  n[s] = this.shape[s];
2692
2692
  else {
2693
2693
  let r = this.shape[s];
2694
- for (; r instanceof we; )
2694
+ for (; r instanceof ke; )
2695
2695
  r = r._def.innerType;
2696
2696
  n[s] = r;
2697
2697
  }
@@ -2731,14 +2731,14 @@ class Dt extends T {
2731
2731
  for (const o of a)
2732
2732
  if (o.result.status === "dirty")
2733
2733
  return n.common.issues.push(...o.ctx.common.issues), o.result;
2734
- const i = a.map((o) => new ie(o.ctx.common.issues));
2734
+ const i = a.map((o) => new oe(o.ctx.common.issues));
2735
2735
  return y(n, {
2736
2736
  code: f.invalid_union,
2737
2737
  unionErrors: i
2738
2738
  }), S;
2739
2739
  }
2740
2740
  if (n.common.async)
2741
- return Promise.all(s.map((a) => ke(this, null, function* () {
2741
+ return Promise.all(s.map((a) => xe(this, null, function* () {
2742
2742
  const i = E(d({}, n), {
2743
2743
  common: E(d({}, n.common), {
2744
2744
  issues: []
@@ -2774,7 +2774,7 @@ class Dt extends T {
2774
2774
  }
2775
2775
  if (a)
2776
2776
  return n.common.issues.push(...a.ctx.common.issues), a.result;
2777
- const o = i.map((c) => new ie(c));
2777
+ const o = i.map((c) => new oe(c));
2778
2778
  return y(n, {
2779
2779
  code: f.invalid_union,
2780
2780
  unionErrors: o
@@ -2789,7 +2789,7 @@ Dt.create = (t, e) => new Dt(d({
2789
2789
  options: t,
2790
2790
  typeName: x.ZodUnion
2791
2791
  }, O(e)));
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 ? N.objectValues(t.enum) : t instanceof Ut ? 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 zt ? Ze(t.unwrap()) : t instanceof Vt ? Ze(t._def.innerType) : [];
2792
+ const Ze = (t) => t instanceof $t ? Ze(t.schema) : t instanceof ge ? Ze(t.innerType()) : t instanceof Ft ? [t.value] : t instanceof Fe ? t.options : t instanceof Wt ? N.objectValues(t.enum) : t instanceof Ut ? Ze(t._def.innerType) : t instanceof jt ? [void 0] : t instanceof Zt ? [null] : t instanceof ke ? [void 0, ...Ze(t.unwrap())] : t instanceof We ? [null, ...Ze(t.unwrap())] : t instanceof Ns || t instanceof zt ? Ze(t.unwrap()) : t instanceof Vt ? Ze(t._def.innerType) : [];
2793
2793
  class xn extends T {
2794
2794
  _parse(e) {
2795
2795
  const { ctx: n } = this._processInputParams(e);
@@ -2914,7 +2914,7 @@ Mt.create = (t, e, n) => new Mt(d({
2914
2914
  right: e,
2915
2915
  typeName: x.ZodIntersection
2916
2916
  }, O(n)));
2917
- class Ee extends T {
2917
+ class Se extends T {
2918
2918
  _parse(e) {
2919
2919
  const { status: n, ctx: s } = this._processInputParams(e);
2920
2920
  if (s.parsedType !== v.array)
@@ -2940,23 +2940,23 @@ class Ee extends T {
2940
2940
  }), n.dirty());
2941
2941
  const r = [...s.data].map((a, i) => {
2942
2942
  const o = this._def.items[i] || this._def.rest;
2943
- return o ? o._parse(new xe(s, a, s.path, i)) : null;
2943
+ return o ? o._parse(new Ee(s, a, s.path, i)) : null;
2944
2944
  }).filter((a) => !!a);
2945
- return s.common.async ? Promise.all(r).then((a) => X.mergeArray(n, a)) : X.mergeArray(n, r);
2945
+ return s.common.async ? Promise.all(r).then((a) => Y.mergeArray(n, a)) : Y.mergeArray(n, r);
2946
2946
  }
2947
2947
  get items() {
2948
2948
  return this._def.items;
2949
2949
  }
2950
2950
  rest(e) {
2951
- return new Ee(E(d({}, this._def), {
2951
+ return new Se(E(d({}, this._def), {
2952
2952
  rest: e
2953
2953
  }));
2954
2954
  }
2955
2955
  }
2956
- Ee.create = (t, e) => {
2956
+ Se.create = (t, e) => {
2957
2957
  if (!Array.isArray(t))
2958
2958
  throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2959
- return new Ee(d({
2959
+ return new Se(d({
2960
2960
  items: t,
2961
2961
  typeName: x.ZodTuple,
2962
2962
  rest: null
@@ -2980,11 +2980,11 @@ class Lt extends T {
2980
2980
  const r = [], a = this._def.keyType, i = this._def.valueType;
2981
2981
  for (const o in s.data)
2982
2982
  r.push({
2983
- key: a._parse(new xe(s, o, s.path, o)),
2984
- value: i._parse(new xe(s, s.data[o], s.path, o)),
2983
+ key: a._parse(new Ee(s, o, s.path, o)),
2984
+ value: i._parse(new Ee(s, s.data[o], s.path, o)),
2985
2985
  alwaysSet: o in s.data
2986
2986
  });
2987
- return s.common.async ? X.mergeObjectAsync(n, r) : X.mergeObjectSync(n, r);
2987
+ return s.common.async ? Y.mergeObjectAsync(n, r) : Y.mergeObjectSync(n, r);
2988
2988
  }
2989
2989
  get element() {
2990
2990
  return this._def.valueType;
@@ -2995,7 +2995,7 @@ class Lt extends T {
2995
2995
  valueType: n,
2996
2996
  typeName: x.ZodRecord
2997
2997
  }, O(s))) : new Lt(d({
2998
- keyType: pe.create(),
2998
+ keyType: me.create(),
2999
2999
  valueType: e,
3000
3000
  typeName: x.ZodRecord
3001
3001
  }, O(n)));
@@ -3017,12 +3017,12 @@ class gn extends T {
3017
3017
  received: s.parsedType
3018
3018
  }), S;
3019
3019
  const r = this._def.keyType, a = this._def.valueType, i = [...s.data.entries()].map(([o, c], u) => ({
3020
- key: r._parse(new xe(s, o, s.path, [u, "key"])),
3021
- value: a._parse(new xe(s, c, s.path, [u, "value"]))
3020
+ key: r._parse(new Ee(s, o, s.path, [u, "key"])),
3021
+ value: a._parse(new Ee(s, c, s.path, [u, "value"]))
3022
3022
  }));
3023
3023
  if (s.common.async) {
3024
3024
  const o = /* @__PURE__ */ new Map();
3025
- return Promise.resolve().then(() => ke(this, null, function* () {
3025
+ return Promise.resolve().then(() => xe(this, null, function* () {
3026
3026
  for (const c of i) {
3027
3027
  const u = yield c.key, h = yield c.value;
3028
3028
  if (u.status === "aborted" || h.status === "aborted")
@@ -3083,7 +3083,7 @@ class et extends T {
3083
3083
  }
3084
3084
  return { status: n.value, value: u };
3085
3085
  }
3086
- const o = [...s.data.values()].map((c, u) => a._parse(new xe(s, c, s.path, u)));
3086
+ const o = [...s.data.values()].map((c, u) => a._parse(new Ee(s, c, s.path, u)));
3087
3087
  return s.common.async ? Promise.all(o).then((c) => i(c)) : i(o);
3088
3088
  }
3089
3089
  min(e, n) {
@@ -3156,9 +3156,9 @@ class ht extends T {
3156
3156
  const a = { errorMap: n.common.contextualErrorMap }, i = n.data;
3157
3157
  if (this._def.returns instanceof vt) {
3158
3158
  const o = this;
3159
- return te(function(...c) {
3160
- return ke(this, null, function* () {
3161
- const u = new ie([]), h = yield o._def.args.parseAsync(c, a).catch((k) => {
3159
+ return ne(function(...c) {
3160
+ return xe(this, null, function* () {
3161
+ const u = new oe([]), h = yield o._def.args.parseAsync(c, a).catch((k) => {
3162
3162
  throw u.addIssue(s(c, k)), u;
3163
3163
  }), p = yield Reflect.apply(i, this, h);
3164
3164
  return yield o._def.returns._def.type.parseAsync(p, a).catch((k) => {
@@ -3168,13 +3168,13 @@ class ht extends T {
3168
3168
  });
3169
3169
  } else {
3170
3170
  const o = this;
3171
- return te(function(...c) {
3171
+ return ne(function(...c) {
3172
3172
  const u = o._def.args.safeParse(c, a);
3173
3173
  if (!u.success)
3174
- throw new ie([s(c, u.error)]);
3174
+ throw new oe([s(c, u.error)]);
3175
3175
  const h = Reflect.apply(i, this, u.data), p = o._def.returns.safeParse(h, a);
3176
3176
  if (!p.success)
3177
- throw new ie([r(h, p.error)]);
3177
+ throw new oe([r(h, p.error)]);
3178
3178
  return p.data;
3179
3179
  });
3180
3180
  }
@@ -3187,7 +3187,7 @@ class ht extends T {
3187
3187
  }
3188
3188
  args(...e) {
3189
3189
  return new ht(E(d({}, this._def), {
3190
- args: Ee.create(e).rest(Xe.create())
3190
+ args: Se.create(e).rest(Xe.create())
3191
3191
  }));
3192
3192
  }
3193
3193
  returns(e) {
@@ -3203,7 +3203,7 @@ class ht extends T {
3203
3203
  }
3204
3204
  static create(e, n, s) {
3205
3205
  return new ht(d({
3206
- args: e || Ee.create([]).rest(Xe.create()),
3206
+ args: e || Se.create([]).rest(Xe.create()),
3207
3207
  returns: n || Xe.create(),
3208
3208
  typeName: x.ZodFunction
3209
3209
  }, O(s)));
@@ -3269,7 +3269,7 @@ class Fe extends T {
3269
3269
  options: s
3270
3270
  }), S;
3271
3271
  }
3272
- return te(e.data);
3272
+ return ne(e.data);
3273
3273
  }
3274
3274
  get options() {
3275
3275
  return this._def.values;
@@ -3323,7 +3323,7 @@ class Wt extends T {
3323
3323
  options: r
3324
3324
  }), S;
3325
3325
  }
3326
- return te(e.data);
3326
+ return ne(e.data);
3327
3327
  }
3328
3328
  get enum() {
3329
3329
  return this._def.values;
@@ -3347,7 +3347,7 @@ class vt extends T {
3347
3347
  received: n.parsedType
3348
3348
  }), S;
3349
3349
  const s = n.parsedType === v.promise ? n.data : Promise.resolve(n.data);
3350
- return te(s.then((r) => this._def.type.parseAsync(r, {
3350
+ return ne(s.then((r) => this._def.type.parseAsync(r, {
3351
3351
  path: n.path,
3352
3352
  errorMap: n.common.contextualErrorMap
3353
3353
  })));
@@ -3357,7 +3357,7 @@ vt.create = (t, e) => new vt(d({
3357
3357
  type: t,
3358
3358
  typeName: x.ZodPromise
3359
3359
  }, O(e)));
3360
- class ye extends T {
3360
+ class ge extends T {
3361
3361
  innerType() {
3362
3362
  return this._def.schema;
3363
3363
  }
@@ -3376,7 +3376,7 @@ class ye extends T {
3376
3376
  if (a.addIssue = a.addIssue.bind(a), r.type === "preprocess") {
3377
3377
  const i = r.transform(s.data, a);
3378
3378
  if (s.common.async)
3379
- return Promise.resolve(i).then((o) => ke(this, null, function* () {
3379
+ return Promise.resolve(i).then((o) => xe(this, null, function* () {
3380
3380
  if (n.value === "aborted")
3381
3381
  return S;
3382
3382
  const c = yield this._def.schema._parseAsync({
@@ -3434,31 +3434,31 @@ class ye extends T {
3434
3434
  N.assertNever(r);
3435
3435
  }
3436
3436
  }
3437
- ye.create = (t, e, n) => new ye(d({
3437
+ ge.create = (t, e, n) => new ge(d({
3438
3438
  schema: t,
3439
3439
  typeName: x.ZodEffects,
3440
3440
  effect: e
3441
3441
  }, O(n)));
3442
- ye.createWithPreprocess = (t, e, n) => new ye(d({
3442
+ ge.createWithPreprocess = (t, e, n) => new ge(d({
3443
3443
  schema: e,
3444
3444
  effect: { type: "preprocess", transform: t },
3445
3445
  typeName: x.ZodEffects
3446
3446
  }, O(n)));
3447
- class we extends T {
3447
+ class ke extends T {
3448
3448
  _parse(e) {
3449
- return this._getType(e) === v.undefined ? te(void 0) : this._def.innerType._parse(e);
3449
+ return this._getType(e) === v.undefined ? ne(void 0) : this._def.innerType._parse(e);
3450
3450
  }
3451
3451
  unwrap() {
3452
3452
  return this._def.innerType;
3453
3453
  }
3454
3454
  }
3455
- we.create = (t, e) => new we(d({
3455
+ ke.create = (t, e) => new ke(d({
3456
3456
  innerType: t,
3457
3457
  typeName: x.ZodOptional
3458
3458
  }, O(e)));
3459
3459
  class We extends T {
3460
3460
  _parse(e) {
3461
- return this._getType(e) === v.null ? te(null) : this._def.innerType._parse(e);
3461
+ return this._getType(e) === v.null ? ne(null) : this._def.innerType._parse(e);
3462
3462
  }
3463
3463
  unwrap() {
3464
3464
  return this._def.innerType;
@@ -3502,7 +3502,7 @@ class Vt extends T {
3502
3502
  status: "valid",
3503
3503
  value: a.status === "valid" ? a.value : this._def.catchValue({
3504
3504
  get error() {
3505
- return new ie(s.common.issues);
3505
+ return new oe(s.common.issues);
3506
3506
  },
3507
3507
  input: s.data
3508
3508
  })
@@ -3510,7 +3510,7 @@ class Vt extends T {
3510
3510
  status: "valid",
3511
3511
  value: r.status === "valid" ? r.value : this._def.catchValue({
3512
3512
  get error() {
3513
- return new ie(s.common.issues);
3513
+ return new oe(s.common.issues);
3514
3514
  },
3515
3515
  input: s.data
3516
3516
  })
@@ -3559,7 +3559,7 @@ class Jt extends T {
3559
3559
  _parse(e) {
3560
3560
  const { status: n, ctx: s } = this._processInputParams(e);
3561
3561
  if (s.common.async)
3562
- return ke(this, null, function* () {
3562
+ return xe(this, null, function* () {
3563
3563
  const r = yield this._def.in._parseAsync({
3564
3564
  data: s.data,
3565
3565
  path: s.path,
@@ -3639,8 +3639,8 @@ var x;
3639
3639
  })(x || (x = {}));
3640
3640
  const so = (t, e = {
3641
3641
  message: `Input not instance of ${t.name}`
3642
- }) => Mr((n) => n instanceof t, e), Lr = pe.create, $r = Le.create, ro = vn.create, ao = $e.create, Fr = It.create, io = Qe.create, oo = mn.create, co = jt.create, uo = Zt.create, lo = gt.create, fo = Xe.create, ho = Pe.create, po = yn.create, mo = me.create, yo = U.create, go = U.strictCreate, vo = Dt.create, _o = xn.create, bo = Mt.create, wo = Ee.create, ko = Lt.create, xo = gn.create, Eo = et.create, So = ht.create, Oo = $t.create, To = Ft.create, Ao = Fe.create, Co = Wt.create, No = vt.create, ir = ye.create, Ro = we.create, Po = We.create, Io = ye.createWithPreprocess, jo = Jt.create, Zo = () => Lr().optional(), Do = () => $r().optional(), Mo = () => Fr().optional(), Lo = {
3643
- string: (t) => pe.create(E(d({}, t), { coerce: !0 })),
3642
+ }) => Mr((n) => n instanceof t, e), Lr = me.create, $r = Le.create, ro = vn.create, ao = $e.create, Fr = It.create, io = Qe.create, oo = mn.create, co = jt.create, uo = Zt.create, lo = gt.create, fo = Xe.create, ho = Pe.create, po = yn.create, mo = ye.create, yo = U.create, go = U.strictCreate, vo = Dt.create, _o = xn.create, bo = Mt.create, wo = Se.create, ko = Lt.create, xo = gn.create, Eo = et.create, So = ht.create, Oo = $t.create, To = Ft.create, Ao = Fe.create, Co = Wt.create, No = vt.create, ir = ge.create, Ro = ke.create, Po = We.create, Io = ge.createWithPreprocess, jo = Jt.create, Zo = () => Lr().optional(), Do = () => $r().optional(), Mo = () => Fr().optional(), Lo = {
3643
+ string: (t) => me.create(E(d({}, t), { coerce: !0 })),
3644
3644
  number: (t) => Le.create(E(d({}, t), { coerce: !0 })),
3645
3645
  boolean: (t) => It.create(E(d({}, t), {
3646
3646
  coerce: !0
@@ -3648,7 +3648,7 @@ const so = (t, e = {
3648
3648
  bigint: (t) => $e.create(E(d({}, t), { coerce: !0 })),
3649
3649
  date: (t) => Qe.create(E(d({}, t), { coerce: !0 }))
3650
3650
  }, $o = S;
3651
- var j = /* @__PURE__ */ Object.freeze({
3651
+ var I = /* @__PURE__ */ Object.freeze({
3652
3652
  __proto__: null,
3653
3653
  defaultErrorMap: yt,
3654
3654
  setErrorMap: Pi,
@@ -3656,10 +3656,10 @@ var j = /* @__PURE__ */ Object.freeze({
3656
3656
  makeIssue: fn,
3657
3657
  EMPTY_PATH: Ii,
3658
3658
  addIssueToContext: y,
3659
- ParseStatus: X,
3659
+ ParseStatus: Y,
3660
3660
  INVALID: S,
3661
3661
  DIRTY: hn,
3662
- OK: te,
3662
+ OK: ne,
3663
3663
  isAborted: ns,
3664
3664
  isDirty: ss,
3665
3665
  isValid: Ye,
@@ -3674,7 +3674,7 @@ var j = /* @__PURE__ */ Object.freeze({
3674
3674
  getParsedType: Ne,
3675
3675
  ZodType: T,
3676
3676
  datetimeRegex: Zr,
3677
- ZodString: pe,
3677
+ ZodString: me,
3678
3678
  ZodNumber: Le,
3679
3679
  ZodBigInt: $e,
3680
3680
  ZodBoolean: It,
@@ -3686,12 +3686,12 @@ var j = /* @__PURE__ */ Object.freeze({
3686
3686
  ZodUnknown: Xe,
3687
3687
  ZodNever: Pe,
3688
3688
  ZodVoid: yn,
3689
- ZodArray: me,
3689
+ ZodArray: ye,
3690
3690
  ZodObject: U,
3691
3691
  ZodUnion: Dt,
3692
3692
  ZodDiscriminatedUnion: xn,
3693
3693
  ZodIntersection: Mt,
3694
- ZodTuple: Ee,
3694
+ ZodTuple: Se,
3695
3695
  ZodRecord: Lt,
3696
3696
  ZodMap: gn,
3697
3697
  ZodSet: et,
@@ -3701,9 +3701,9 @@ var j = /* @__PURE__ */ Object.freeze({
3701
3701
  ZodEnum: Fe,
3702
3702
  ZodNativeEnum: Wt,
3703
3703
  ZodPromise: vt,
3704
- ZodEffects: ye,
3705
- ZodTransformer: ye,
3706
- ZodOptional: we,
3704
+ ZodEffects: ge,
3705
+ ZodTransformer: ge,
3706
+ ZodOptional: ke,
3707
3707
  ZodNullable: We,
3708
3708
  ZodDefault: Ut,
3709
3709
  ZodCatch: Vt,
@@ -3762,18 +3762,18 @@ var j = /* @__PURE__ */ Object.freeze({
3762
3762
  NEVER: $o,
3763
3763
  ZodIssueCode: f,
3764
3764
  quotelessJson: Ri,
3765
- ZodError: ie
3765
+ ZodError: oe
3766
3766
  });
3767
- j.object({
3768
- language: j.enum(["typescript", "javascript"]).optional(),
3769
- disableMarkedForExport: j.boolean().optional(),
3770
- allowAutoSelectFirstNode: j.boolean().optional().default(!0)
3767
+ I.object({
3768
+ language: I.enum(["typescript", "javascript"]).optional(),
3769
+ disableMarkedForExport: I.boolean().optional(),
3770
+ allowAutoSelectFirstNode: I.boolean().optional().default(!0)
3771
3771
  }).and(
3772
- j.union([
3773
- j.object({
3774
- framework: j.literal("react"),
3775
- model: j.string().optional(),
3776
- styling: j.enum([
3772
+ I.union([
3773
+ I.object({
3774
+ framework: I.literal("react"),
3775
+ model: I.string().optional(),
3776
+ styling: I.enum([
3777
3777
  "plain_css",
3778
3778
  "css_modules",
3779
3779
  "styled_components",
@@ -3782,27 +3782,27 @@ j.object({
3782
3782
  "scss",
3783
3783
  "inline_styles"
3784
3784
  ]),
3785
- uiLibrary: j.enum(["mui", "antd", "radix", "shadcn", "clean_react"]).optional(),
3786
- responsivePages: j.array(
3787
- j.object({
3788
- name: j.string(),
3789
- framesId: j.array(j.string())
3785
+ uiLibrary: I.enum(["mui", "antd", "radix", "shadcn", "clean_react"]).optional(),
3786
+ responsivePages: I.array(
3787
+ I.object({
3788
+ name: I.string(),
3789
+ framesId: I.array(I.string())
3790
3790
  })
3791
3791
  ).optional(),
3792
- enableUILibraryTheming: j.boolean().optional(),
3793
- enableCompactStructure: j.boolean().optional(),
3794
- enableDisplayScreenModelId: j.boolean().optional(),
3795
- enableGeneratePackageLock: j.boolean().optional(),
3796
- enableAnimationsPreset: j.boolean().optional(),
3797
- enableAutoSplit: j.boolean().optional(),
3798
- autoSplitThreshold: j.number().optional(),
3799
- url: j.string().url().optional(),
3800
- codegenSettings: j.record(j.unknown()).optional()
3792
+ enableUILibraryTheming: I.boolean().optional(),
3793
+ enableCompactStructure: I.boolean().optional(),
3794
+ enableDisplayScreenModelId: I.boolean().optional(),
3795
+ enableGeneratePackageLock: I.boolean().optional(),
3796
+ enableAnimationsPreset: I.boolean().optional(),
3797
+ enableAutoSplit: I.boolean().optional(),
3798
+ autoSplitThreshold: I.number().optional(),
3799
+ url: I.string().url().optional(),
3800
+ codegenSettings: I.record(I.unknown()).optional()
3801
3801
  }),
3802
- j.object({
3803
- framework: j.literal("html"),
3804
- styling: j.enum(["plain_css", "inline_styles", "tailwind"]),
3805
- enableTranslation: j.boolean().optional()
3802
+ I.object({
3803
+ framework: I.literal("html"),
3804
+ styling: I.enum(["plain_css", "inline_styles", "tailwind"]),
3805
+ enableTranslation: I.boolean().optional()
3806
3806
  })
3807
3807
  ])
3808
3808
  );
@@ -3822,8 +3822,8 @@ function Fo(t) {
3822
3822
  let a = "", i = !0, o, c = "", u = "";
3823
3823
  function h(m) {
3824
3824
  const _ = i ? m.replace(/^\xEF\xBB\xBF/, "") : m, [l, C] = Wo(`${a}${_}`);
3825
- for (const I of l)
3826
- p(I);
3825
+ for (const P of l)
3826
+ p(P);
3827
3827
  a = C, i = !1;
3828
3828
  }
3829
3829
  function p(m) {
@@ -3837,8 +3837,8 @@ function Fo(t) {
3837
3837
  }
3838
3838
  const _ = m.indexOf(":");
3839
3839
  if (_ !== -1) {
3840
- const l = m.slice(0, _), C = m[_ + 1] === " " ? 2 : 1, I = m.slice(_ + C);
3841
- k(l, I, m);
3840
+ const l = m.slice(0, _), C = m[_ + 1] === " " ? 2 : 1, P = m.slice(_ + C);
3841
+ k(l, P, m);
3842
3842
  return;
3843
3843
  }
3844
3844
  k(m, "", m);
@@ -3968,42 +3968,42 @@ function ur(t) {
3968
3968
  }
3969
3969
  var Wr = (t) => {
3970
3970
  throw TypeError(t);
3971
- }, Rs = (t, e, n) => e.has(t) || Wr("Cannot " + n), A = (t, e, n) => (Rs(t, e, "read from private field"), n ? n.call(t) : e.get(t)), q = (t, e, n) => e.has(t) ? Wr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), W = (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;
3971
+ }, Rs = (t, e, n) => e.has(t) || Wr("Cannot " + n), A = (t, e, n) => (Rs(t, e, "read from private field"), n ? n.call(t) : e.get(t)), q = (t, e, n) => e.has(t) ? Wr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), W = (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), re, Je, ut, un, _n, Nt, ft, Rt, De, dt, pt, lt, At, pe, is, os, cs, dr, us, ds, Ct, ls, fs;
3972
3972
  class dn extends EventTarget {
3973
3973
  constructor(e, n) {
3974
3974
  var s, r;
3975
- super(), q(this, he), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, q(this, se), q(this, Je), q(this, ut), q(this, un), q(this, _n), q(this, Nt), q(this, ft), q(this, Rt, null), q(this, De), q(this, dt), q(this, pt, null), q(this, lt, null), q(this, At, null), q(this, os, (a) => Ie(this, null, function* () {
3975
+ super(), q(this, pe), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, q(this, re), q(this, Je), q(this, ut), q(this, un), q(this, _n), q(this, Nt), q(this, ft), q(this, Rt, null), q(this, De), q(this, dt), q(this, pt, null), q(this, lt, null), q(this, At, null), q(this, os, (a) => Ie(this, null, function* () {
3976
3976
  var i;
3977
3977
  A(this, dt).reset();
3978
3978
  const { body: o, redirected: c, status: u, headers: h } = a;
3979
3979
  if (u === 204) {
3980
- Ce(this, he, Ct).call(this, "Server sent HTTP 204, not reconnecting", 204), this.close();
3980
+ Ce(this, pe, Ct).call(this, "Server sent HTTP 204, not reconnecting", 204), this.close();
3981
3981
  return;
3982
3982
  }
3983
3983
  if (c ? W(this, ut, new URL(a.url)) : W(this, ut, void 0), u !== 200) {
3984
- Ce(this, he, Ct).call(this, `Non-200 status code (${u})`, u);
3984
+ Ce(this, pe, Ct).call(this, `Non-200 status code (${u})`, u);
3985
3985
  return;
3986
3986
  }
3987
3987
  if (!(h.get("content-type") || "").startsWith("text/event-stream")) {
3988
- Ce(this, he, Ct).call(this, 'Invalid content type, expected "text/event-stream"', u);
3988
+ Ce(this, pe, Ct).call(this, 'Invalid content type, expected "text/event-stream"', u);
3989
3989
  return;
3990
3990
  }
3991
- if (A(this, se) === this.CLOSED)
3991
+ if (A(this, re) === this.CLOSED)
3992
3992
  return;
3993
- W(this, se, this.OPEN);
3993
+ W(this, re, this.OPEN);
3994
3994
  const p = new Event("open");
3995
3995
  if ((i = A(this, At)) == null || i.call(this, p), this.dispatchEvent(p), typeof o != "object" || !o || !("getReader" in o)) {
3996
- Ce(this, he, Ct).call(this, "Invalid response body, expected a web ReadableStream", u), this.close();
3996
+ Ce(this, pe, Ct).call(this, "Invalid response body, expected a web ReadableStream", u), this.close();
3997
3997
  return;
3998
3998
  }
3999
3999
  const k = new TextDecoder(), g = o.getReader();
4000
4000
  let b = !0;
4001
4001
  do {
4002
4002
  const { done: m, value: _ } = yield g.read();
4003
- _ && A(this, dt).feed(k.decode(_, { stream: !m })), m && (b = !1, A(this, dt).reset(), Ce(this, he, ls).call(this));
4003
+ _ && A(this, dt).feed(k.decode(_, { stream: !m })), m && (b = !1, A(this, dt).reset(), Ce(this, pe, ls).call(this));
4004
4004
  } while (b);
4005
4005
  })), q(this, cs, (a) => {
4006
- W(this, De, void 0), !(a.name === "AbortError" || a.type === "aborted") && Ce(this, he, ls).call(this, as(a));
4006
+ W(this, De, void 0), !(a.name === "AbortError" || a.type === "aborted") && Ce(this, pe, ls).call(this, as(a));
4007
4007
  }), q(this, us, (a) => {
4008
4008
  typeof a.id == "string" && W(this, Rt, a.id);
4009
4009
  const i = new MessageEvent(a.event || "message", {
@@ -4015,7 +4015,7 @@ class dn extends EventTarget {
4015
4015
  }), q(this, ds, (a) => {
4016
4016
  W(this, Nt, a);
4017
4017
  }), q(this, fs, () => {
4018
- W(this, ft, void 0), A(this, se) === this.CONNECTING && Ce(this, he, is).call(this);
4018
+ W(this, ft, void 0), A(this, re) === this.CONNECTING && Ce(this, pe, is).call(this);
4019
4019
  });
4020
4020
  try {
4021
4021
  if (e instanceof URL)
@@ -4030,7 +4030,7 @@ class dn extends EventTarget {
4030
4030
  W(this, dt, Fo({
4031
4031
  onEvent: A(this, us),
4032
4032
  onRetry: A(this, ds)
4033
- })), W(this, se, this.CONNECTING), W(this, Nt, 3e3), W(this, _n, (s = n == null ? void 0 : n.fetch) != null ? s : globalThis.fetch), W(this, un, (r = n == null ? void 0 : n.withCredentials) != null ? r : !1), Ce(this, he, is).call(this);
4033
+ })), W(this, re, this.CONNECTING), W(this, Nt, 3e3), W(this, _n, (s = n == null ? void 0 : n.fetch) != null ? s : globalThis.fetch), W(this, un, (r = n == null ? void 0 : n.withCredentials) != null ? r : !1), Ce(this, pe, is).call(this);
4034
4034
  }
4035
4035
  /**
4036
4036
  * Returns the state of this EventSource object's connection. It can have the values described below.
@@ -4043,7 +4043,7 @@ class dn extends EventTarget {
4043
4043
  * @public
4044
4044
  */
4045
4045
  get readyState() {
4046
- return A(this, se);
4046
+ return A(this, re);
4047
4047
  }
4048
4048
  /**
4049
4049
  * Returns the URL providing the event stream.
@@ -4100,16 +4100,16 @@ class dn extends EventTarget {
4100
4100
  * @public
4101
4101
  */
4102
4102
  close() {
4103
- A(this, ft) && clearTimeout(A(this, ft)), A(this, se) !== this.CLOSED && (A(this, De) && A(this, De).abort(), W(this, se, this.CLOSED), W(this, De, void 0));
4103
+ A(this, ft) && clearTimeout(A(this, ft)), A(this, re) !== this.CLOSED && (A(this, De) && A(this, De).abort(), W(this, re, this.CLOSED), W(this, De, void 0));
4104
4104
  }
4105
4105
  }
4106
- 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(), /**
4106
+ re = /* @__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(), pe = /* @__PURE__ */ new WeakSet(), /**
4107
4107
  * Connect to the given URL and start receiving events
4108
4108
  *
4109
4109
  * @internal
4110
4110
  */
4111
4111
  is = function() {
4112
- W(this, se, this.CONNECTING), W(this, De, new AbortController()), A(this, _n)(A(this, Je), Ce(this, he, dr).call(this)).then(A(this, os)).catch(A(this, cs));
4112
+ W(this, re, this.CONNECTING), W(this, De, new AbortController()), A(this, _n)(A(this, Je), Ce(this, pe, dr).call(this)).then(A(this, os)).catch(A(this, cs));
4113
4113
  }, os = /* @__PURE__ */ new WeakMap(), cs = /* @__PURE__ */ new WeakMap(), /**
4114
4114
  * Get request options for the `fetch()` request
4115
4115
  *
@@ -4137,7 +4137,7 @@ dr = function() {
4137
4137
  */
4138
4138
  Ct = function(t, e) {
4139
4139
  var n;
4140
- A(this, se) !== this.CLOSED && W(this, se, this.CLOSED);
4140
+ A(this, re) !== this.CLOSED && W(this, re, this.CLOSED);
4141
4141
  const s = new cr("error", { code: e, message: t });
4142
4142
  (n = A(this, pt)) == null || n.call(this, s), this.dispatchEvent(s);
4143
4143
  }, /**
@@ -4149,9 +4149,9 @@ Ct = function(t, e) {
4149
4149
  */
4150
4150
  ls = function(t, e) {
4151
4151
  var n;
4152
- if (A(this, se) === this.CLOSED)
4152
+ if (A(this, re) === this.CLOSED)
4153
4153
  return;
4154
- W(this, se, this.CONNECTING);
4154
+ W(this, re, this.CONNECTING);
4155
4155
  const s = new cr("error", { code: e, message: t });
4156
4156
  (n = A(this, pt)) == null || n.call(this, s), this.dispatchEvent(s), W(this, ft, setTimeout(A(this, fs), A(this, Nt)));
4157
4157
  }, fs = /* @__PURE__ */ new WeakMap(), /**
@@ -4174,7 +4174,7 @@ function Vo() {
4174
4174
  const t = "document" in globalThis ? globalThis.document : void 0;
4175
4175
  return t && typeof t == "object" && "baseURI" in t && typeof t.baseURI == "string" ? t.baseURI : void 0;
4176
4176
  }
4177
- var Ur = Symbol.for("immer-nothing"), lr = Symbol.for("immer-draftable"), oe = Symbol.for("immer-state"), zo = process.env.NODE_ENV !== "production" ? [
4177
+ var Ur = Symbol.for("immer-nothing"), lr = Symbol.for("immer-draftable"), ce = Symbol.for("immer-state"), zo = process.env.NODE_ENV !== "production" ? [
4178
4178
  // All error codes, starting by 0:
4179
4179
  function(t) {
4180
4180
  return `The plugin for '${t}' has not been loaded into Immer. To enable the plugin, import and call \`enable${t}()\` when initializing your application.`;
@@ -4205,7 +4205,7 @@ var Ur = Symbol.for("immer-nothing"), lr = Symbol.for("immer-draftable"), oe = S
4205
4205
  // Note: if more errors are added, the errorOffset in Patches.ts should be increased
4206
4206
  // See Patches.ts for additional errors
4207
4207
  ] : [];
4208
- function re(t, ...e) {
4208
+ function ae(t, ...e) {
4209
4209
  if (process.env.NODE_ENV !== "production") {
4210
4210
  const n = zo[t], s = typeof n == "function" ? n.apply(null, e) : n;
4211
4211
  throw new Error(`[Immer] ${s}`);
@@ -4216,7 +4216,7 @@ function re(t, ...e) {
4216
4216
  }
4217
4217
  var _t = Object.getPrototypeOf;
4218
4218
  function bt(t) {
4219
- return !!t && !!t[oe];
4219
+ return !!t && !!t[ce];
4220
4220
  }
4221
4221
  function tt(t) {
4222
4222
  var e;
@@ -4238,7 +4238,7 @@ function bn(t, e) {
4238
4238
  }) : t.forEach((n, s) => e(s, n, t));
4239
4239
  }
4240
4240
  function En(t) {
4241
- const e = t[oe];
4241
+ const e = t[ce];
4242
4242
  return e ? e.type_ : Array.isArray(t) ? 1 : Sn(t) ? 2 : On(t) ? 3 : 0;
4243
4243
  }
4244
4244
  function hs(t, e) {
@@ -4270,7 +4270,7 @@ function ps(t, e) {
4270
4270
  const n = Vr(t);
4271
4271
  if (e === !0 || e === "class_only" && !n) {
4272
4272
  const s = Object.getOwnPropertyDescriptors(t);
4273
- delete s[oe];
4273
+ delete s[ce];
4274
4274
  let r = Reflect.ownKeys(s);
4275
4275
  for (let a = 0; a < r.length; a++) {
4276
4276
  const i = r[a], o = s[i];
@@ -4295,7 +4295,7 @@ function Kt(t, e = !1) {
4295
4295
  return Tn(t) || bt(t) || !tt(t) || (En(t) > 1 && (t.set = t.add = t.clear = t.delete = qo), Object.freeze(t), e && Object.entries(t).forEach(([n, s]) => Kt(s, !0))), t;
4296
4296
  }
4297
4297
  function qo() {
4298
- re(2);
4298
+ ae(2);
4299
4299
  }
4300
4300
  function Tn(t) {
4301
4301
  return Object.isFrozen(t);
@@ -4303,7 +4303,7 @@ function Tn(t) {
4303
4303
  var Ho = {};
4304
4304
  function nt(t) {
4305
4305
  const e = Ho[t];
4306
- return e || re(0, t), e;
4306
+ return e || ae(0, t), e;
4307
4307
  }
4308
4308
  var Bt;
4309
4309
  function Kr() {
@@ -4333,14 +4333,14 @@ function hr(t) {
4333
4333
  return Bt = Go(Bt, t);
4334
4334
  }
4335
4335
  function Jo(t) {
4336
- const e = t[oe];
4336
+ const e = t[ce];
4337
4337
  e.type_ === 0 || e.type_ === 1 ? e.revoke_() : e.revoked_ = !0;
4338
4338
  }
4339
4339
  function pr(t, e) {
4340
4340
  e.unfinalizedDrafts_ = e.drafts_.length;
4341
4341
  const n = e.drafts_[0];
4342
- return t !== void 0 && t !== n ? (n[oe].modified_ && (ms(e), re(4)), tt(t) && (t = wn(e, t), e.parent_ || kn(e, t)), e.patches_ && nt("Patches").generateReplacementPatches_(
4343
- n[oe].base_,
4342
+ return t !== void 0 && t !== n ? (n[ce].modified_ && (ms(e), ae(4)), tt(t) && (t = wn(e, t), e.parent_ || kn(e, t)), e.patches_ && nt("Patches").generateReplacementPatches_(
4343
+ n[ce].base_,
4344
4344
  t,
4345
4345
  e.patches_,
4346
4346
  e.inversePatches_
@@ -4349,7 +4349,7 @@ function pr(t, e) {
4349
4349
  function wn(t, e, n) {
4350
4350
  if (Tn(e))
4351
4351
  return e;
4352
- const s = e[oe];
4352
+ const s = e[ce];
4353
4353
  if (!s)
4354
4354
  return bn(
4355
4355
  e,
@@ -4376,7 +4376,7 @@ function wn(t, e, n) {
4376
4376
  return s.copy_;
4377
4377
  }
4378
4378
  function mr(t, e, n, s, r, a, i) {
4379
- if (process.env.NODE_ENV !== "production" && r === n && re(5), bt(r)) {
4379
+ if (process.env.NODE_ENV !== "production" && r === n && ae(5), bt(r)) {
4380
4380
  const o = a && e && e.type_ !== 3 && // Set objects are atomic since they have no keys.
4381
4381
  !hs(e.assigned_, s) ? a.concat(s) : void 0, c = wn(t, r, o);
4382
4382
  if (zr(n, s, c), bt(c))
@@ -4424,7 +4424,7 @@ function Xo(t, e) {
4424
4424
  }
4425
4425
  var Ps = {
4426
4426
  get(t, e) {
4427
- if (e === oe)
4427
+ if (e === ce)
4428
4428
  return t;
4429
4429
  const n = qe(t);
4430
4430
  if (!hs(n, e))
@@ -4443,7 +4443,7 @@ var Ps = {
4443
4443
  if (s != null && s.set)
4444
4444
  return s.set.call(t.draft_, n), !0;
4445
4445
  if (!t.modified_) {
4446
- const r = Dn(qe(t), e), a = r == null ? void 0 : r[oe];
4446
+ const r = Dn(qe(t), e), a = r == null ? void 0 : r[ce];
4447
4447
  if (a && a.base_ === n)
4448
4448
  return t.copy_[e] = n, t.assigned_[e] = !1, !0;
4449
4449
  if (Bo(n, r) && (n !== void 0 || hs(t.base_, e)))
@@ -4469,13 +4469,13 @@ var Ps = {
4469
4469
  };
4470
4470
  },
4471
4471
  defineProperty() {
4472
- re(11);
4472
+ ae(11);
4473
4473
  },
4474
4474
  getPrototypeOf(t) {
4475
4475
  return _t(t.base_);
4476
4476
  },
4477
4477
  setPrototypeOf() {
4478
- re(12);
4478
+ ae(12);
4479
4479
  }
4480
4480
  }, qt = {};
4481
4481
  bn(Ps, (t, e) => {
@@ -4484,13 +4484,13 @@ bn(Ps, (t, e) => {
4484
4484
  };
4485
4485
  });
4486
4486
  qt.deleteProperty = function(t, e) {
4487
- return process.env.NODE_ENV !== "production" && isNaN(parseInt(e)) && re(13), qt.set.call(this, t, e, void 0);
4487
+ return process.env.NODE_ENV !== "production" && isNaN(parseInt(e)) && ae(13), qt.set.call(this, t, e, void 0);
4488
4488
  };
4489
4489
  qt.set = function(t, e, n) {
4490
- return process.env.NODE_ENV !== "production" && e !== "length" && isNaN(parseInt(e)) && re(14), Ps.set.call(this, t[0], e, n, t[0]);
4490
+ return process.env.NODE_ENV !== "production" && e !== "length" && isNaN(parseInt(e)) && ae(14), Ps.set.call(this, t[0], e, n, t[0]);
4491
4491
  };
4492
4492
  function Dn(t, e) {
4493
- const n = t[oe];
4493
+ const n = t[ce];
4494
4494
  return (n ? qe(n) : t)[e];
4495
4495
  }
4496
4496
  function Yo(t, e, n) {
@@ -4533,7 +4533,7 @@ var Qo = class {
4533
4533
  return i.produce(c, (h) => n.call(this, h, ...u));
4534
4534
  };
4535
4535
  }
4536
- typeof n != "function" && re(6), s !== void 0 && typeof s != "function" && re(7);
4536
+ typeof n != "function" && ae(6), s !== void 0 && typeof s != "function" && ae(7);
4537
4537
  let r;
4538
4538
  if (tt(e)) {
4539
4539
  const a = hr(this), i = vs(e, void 0);
@@ -4551,7 +4551,7 @@ var Qo = class {
4551
4551
  }
4552
4552
  return r;
4553
4553
  } else
4554
- re(1, e);
4554
+ ae(1, e);
4555
4555
  }, this.produceWithPatches = (e, n) => {
4556
4556
  if (typeof e == "function")
4557
4557
  return (i, ...o) => this.produceWithPatches(i, (c) => e(c, ...o));
@@ -4562,13 +4562,13 @@ var Qo = class {
4562
4562
  }, typeof (t == null ? void 0 : t.autoFreeze) == "boolean" && this.setAutoFreeze(t.autoFreeze), typeof (t == null ? void 0 : t.useStrictShallowCopy) == "boolean" && this.setUseStrictShallowCopy(t.useStrictShallowCopy);
4563
4563
  }
4564
4564
  createDraft(t) {
4565
- tt(t) || re(8), bt(t) && (t = ec(t));
4565
+ tt(t) || ae(8), bt(t) && (t = ec(t));
4566
4566
  const e = hr(this), n = vs(t, void 0);
4567
- return n[oe].isManual_ = !0, ys(e), n;
4567
+ return n[ce].isManual_ = !0, ys(e), n;
4568
4568
  }
4569
4569
  finishDraft(t, e) {
4570
- const n = t && t[oe];
4571
- (!n || !n.isManual_) && re(9);
4570
+ const n = t && t[ce];
4571
+ (!n || !n.isManual_) && ae(9);
4572
4572
  const { scope_: s } = n;
4573
4573
  return fr(s, e), pr(void 0, s);
4574
4574
  }
@@ -4610,12 +4610,12 @@ function vs(t, e) {
4610
4610
  return (e ? e.scope_ : Kr()).drafts_.push(n), n;
4611
4611
  }
4612
4612
  function ec(t) {
4613
- return bt(t) || re(10, t), qr(t);
4613
+ return bt(t) || ae(10, t), qr(t);
4614
4614
  }
4615
4615
  function qr(t) {
4616
4616
  if (!tt(t) || Tn(t))
4617
4617
  return t;
4618
- const e = t[oe];
4618
+ const e = t[ce];
4619
4619
  let n;
4620
4620
  if (e) {
4621
4621
  if (!e.modified_)
@@ -4627,15 +4627,15 @@ function qr(t) {
4627
4627
  zr(n, s, qr(r));
4628
4628
  }), e && (e.finalized_ = !1), n;
4629
4629
  }
4630
- var ce = new Qo(), tc = ce.produce;
4631
- ce.produceWithPatches.bind(
4632
- ce
4630
+ var ue = new Qo(), tc = ue.produce;
4631
+ ue.produceWithPatches.bind(
4632
+ ue
4633
4633
  );
4634
- ce.setAutoFreeze.bind(ce);
4635
- ce.setUseStrictShallowCopy.bind(ce);
4636
- ce.applyPatches.bind(ce);
4637
- ce.createDraft.bind(ce);
4638
- ce.finishDraft.bind(ce);
4634
+ ue.setAutoFreeze.bind(ue);
4635
+ ue.setUseStrictShallowCopy.bind(ue);
4636
+ ue.applyPatches.bind(ue);
4637
+ ue.createDraft.bind(ue);
4638
+ ue.finishDraft.bind(ue);
4639
4639
  function nc(t) {
4640
4640
  var e = la(function() {
4641
4641
  return Kt(typeof t == "function" ? t() : t, !0);
@@ -4740,29 +4740,39 @@ const yr = 10, gr = {
4740
4740
  });
4741
4741
  let m = 0;
4742
4742
  c.addEventListener("error", (_) => Ie(void 0, null, function* () {
4743
- var M, z, D;
4743
+ var V, D, M;
4744
4744
  console.warn(
4745
4745
  `Experienced error during code generation (attempt ${m + 1} / ${yr})`,
4746
4746
  _
4747
4747
  );
4748
- let l, C = !1;
4748
+ let l, C, P = !1;
4749
4749
  try {
4750
- _ instanceof MessageEvent ? l = JSON.parse(_.data) : l = yield (yield o).json(), ((M = l == null ? void 0 : l.payload) == null ? void 0 : M.name) === "Task Crashed" && (C = !0);
4751
- } catch (P) {
4750
+ if (_ instanceof MessageEvent)
4751
+ l = JSON.parse(_.data);
4752
+ else {
4753
+ const G = yield o;
4754
+ C = G.status;
4755
+ try {
4756
+ l = yield G.json();
4757
+ } catch ($) {
4758
+ }
4759
+ }
4760
+ (((V = l == null ? void 0 : l.payload) == null ? void 0 : V.name) === "Task Crashed" || C === 429) && (P = !0);
4761
+ } catch (G) {
4752
4762
  }
4753
- const I = new Gs({
4754
- name: (z = l == null ? void 0 : l.payload.name) != null ? z : "Unknown error",
4755
- reason: (D = l == null ? void 0 : l.payload.message) != null ? D : "Unknown",
4763
+ const K = new Gs({
4764
+ name: (D = l == null ? void 0 : l.payload.name) != null ? D : "Unknown error",
4765
+ reason: (M = l == null ? void 0 : l.payload.message) != null ? M : "Unknown",
4756
4766
  status: l == null ? void 0 : l.payload.status,
4757
4767
  detail: l == null ? void 0 : l.payload.detail
4758
4768
  });
4759
4769
  m++;
4760
- let V = !1;
4761
- m > yr ? (console.error("Experienced too many errors, terminating request"), V = !0) : C && (console.error("Experienced unrecoverable error, terminating request"), V = !0), V && (s((P) => {
4762
- P.status = "error", P.error = I;
4770
+ let Z = !1;
4771
+ m > yr ? (console.error("Experienced too many errors, terminating request"), Z = !0) : P && (console.error("Experienced unrecoverable error, terminating request"), Z = !0), Z && (s((G) => {
4772
+ G.status = "error", G.error = K;
4763
4773
  }), g({
4764
4774
  result: null,
4765
- error: I
4775
+ error: K
4766
4776
  }));
4767
4777
  })), c.addEventListener("done", (_) => {
4768
4778
  const l = JSON.parse(_.data);
@@ -4776,21 +4786,21 @@ const yr = 10, gr = {
4776
4786
  if (((p = i.assetsStorage) == null ? void 0 : p.strategy) === "local" && ((k = m == null ? void 0 : m.assets) != null && k.length)) {
4777
4787
  const { filePath: _ } = vr(
4778
4788
  i.assetsStorage
4779
- ), l = m.assets.map((I) => Ie(void 0, null, function* () {
4780
- const M = yield (yield fetch(I.url)).arrayBuffer();
4789
+ ), l = m.assets.map((P) => Ie(void 0, null, function* () {
4790
+ const Z = yield (yield fetch(P.url)).arrayBuffer();
4781
4791
  return {
4782
- assetName: I.name,
4783
- base64: va(M)
4792
+ assetName: P.name,
4793
+ base64: va(Z)
4784
4794
  };
4785
4795
  })), C = yield Promise.allSettled(l);
4786
- for (const I of C) {
4787
- const V = {};
4788
- if (I.status === "fulfilled") {
4789
- const { assetName: M, base64: z } = I.value;
4790
- V[M] = z;
4791
- const D = _ ? `${_}/${M}` : M;
4796
+ for (const P of C) {
4797
+ const K = {};
4798
+ if (P.status === "fulfilled") {
4799
+ const { assetName: Z, base64: V } = P.value;
4800
+ K[Z] = V;
4801
+ const D = _ ? `${_}/${Z}` : Z;
4792
4802
  m.files[D] = {
4793
- content: z,
4803
+ content: V,
4794
4804
  isBinary: !0
4795
4805
  };
4796
4806
  }
@@ -4949,10 +4959,10 @@ function _s(t, e) {
4949
4959
  return t !== t && e !== e;
4950
4960
  }
4951
4961
  const Re = /* @__PURE__ */ new WeakMap(), Me = () => {
4952
- }, ee = (
4962
+ }, te = (
4953
4963
  /*#__NOINLINE__*/
4954
4964
  Me()
4955
- ), bs = Object, R = (t) => t === ee, be = (t) => typeof t == "function", Ue = (t, e) => Ke(Ke({}, t), e), Xr = (t) => be(t.then), Fn = {}, nn = {}, Is = "undefined", Xt = typeof window != Is, ws = typeof document != Is, oc = Xt && "Deno" in window, cc = () => Xt && typeof window.requestAnimationFrame != Is, Yr = (t, e) => {
4965
+ ), bs = Object, R = (t) => t === te, we = (t) => typeof t == "function", Ue = (t, e) => Ke(Ke({}, t), e), Xr = (t) => we(t.then), Fn = {}, nn = {}, Is = "undefined", Xt = typeof window != Is, ws = typeof document != Is, oc = Xt && "Deno" in window, cc = () => Xt && typeof window.requestAnimationFrame != Is, Yr = (t, e) => {
4956
4966
  const n = Re.get(t);
4957
4967
  return [
4958
4968
  // Getter
@@ -5023,7 +5033,7 @@ const Ss = (t) => {
5023
5033
  a = n ? t.toJSON() : e == "symbol" ? t.toString() : e == "string" ? JSON.stringify(t) : "" + t;
5024
5034
  return a;
5025
5035
  }, js = (t) => {
5026
- if (be(t))
5036
+ if (we(t))
5027
5037
  try {
5028
5038
  t = t();
5029
5039
  } catch (n) {
@@ -5049,7 +5059,7 @@ function Qr(...t) {
5049
5059
  const o = a.rollbackOnError;
5050
5060
  let c = a.optimisticData;
5051
5061
  const u = (k) => typeof o == "function" ? o(k) : o !== !1, h = a.throwOnError;
5052
- if (be(n)) {
5062
+ if (we(n)) {
5053
5063
  const k = n, g = [], b = e.keys();
5054
5064
  for (const m of b)
5055
5065
  // Skip the special useSWRInfinite and useSWRSubscription keys.
@@ -5061,61 +5071,61 @@ function Qr(...t) {
5061
5071
  return Ie(this, null, function* () {
5062
5072
  const [g] = js(k);
5063
5073
  if (!g) return;
5064
- const [b, m] = Yr(e, g), [_, l, C, I] = Re.get(e), V = () => {
5065
- const le = _[g];
5066
- return (be(a.revalidate) ? a.revalidate(b().data, k) : a.revalidate !== !1) && (delete C[g], delete I[g], le && le[0]) ? le[0](Jr).then(() => b().data) : b().data;
5074
+ const [b, m] = Yr(e, g), [_, l, C, P] = Re.get(e), K = () => {
5075
+ const fe = _[g];
5076
+ return (we(a.revalidate) ? a.revalidate(b().data, k) : a.revalidate !== !1) && (delete C[g], delete P[g], fe && fe[0]) ? fe[0](Jr).then(() => b().data) : b().data;
5067
5077
  };
5068
5078
  if (t.length < 3)
5069
- return V();
5070
- let M = s, z;
5079
+ return K();
5080
+ let Z = s, V;
5071
5081
  const D = Os();
5072
5082
  l[g] = [
5073
5083
  D,
5074
5084
  0
5075
5085
  ];
5076
- const P = !R(c), Se = b(), F = Se.data, st = Se._c, Ve = R(st) ? F : st;
5077
- if (P && (c = be(c) ? c(Ve, F) : c, m({
5086
+ const M = !R(c), G = b(), $ = G.data, st = G._c, Ve = R(st) ? $ : st;
5087
+ if (M && (c = we(c) ? c(Ve, $) : c, m({
5078
5088
  data: c,
5079
5089
  _c: Ve
5080
- })), be(M))
5090
+ })), we(Z))
5081
5091
  try {
5082
- M = M(Ve);
5083
- } catch (le) {
5084
- z = le;
5092
+ Z = Z(Ve);
5093
+ } catch (fe) {
5094
+ V = fe;
5085
5095
  }
5086
- if (M && Xr(M))
5087
- if (M = yield M.catch((le) => {
5088
- z = le;
5096
+ if (Z && Xr(Z))
5097
+ if (Z = yield Z.catch((fe) => {
5098
+ V = fe;
5089
5099
  }), D !== l[g][0]) {
5090
- if (z) throw z;
5091
- return M;
5092
- } else z && P && u(z) && (i = !0, m({
5100
+ if (V) throw V;
5101
+ return Z;
5102
+ } else V && M && u(V) && (i = !0, m({
5093
5103
  data: Ve,
5094
- _c: ee
5104
+ _c: te
5095
5105
  }));
5096
- if (i && !z)
5097
- if (be(i)) {
5098
- const le = i(M, Ve);
5106
+ if (i && !V)
5107
+ if (we(i)) {
5108
+ const fe = i(Z, Ve);
5099
5109
  m({
5100
- data: le,
5101
- error: ee,
5102
- _c: ee
5110
+ data: fe,
5111
+ error: te,
5112
+ _c: te
5103
5113
  });
5104
5114
  } else
5105
5115
  m({
5106
- data: M,
5107
- error: ee,
5108
- _c: ee
5116
+ data: Z,
5117
+ error: te,
5118
+ _c: te
5109
5119
  });
5110
- if (l[g][1] = Os(), Promise.resolve(V()).then(() => {
5120
+ if (l[g][1] = Os(), Promise.resolve(K()).then(() => {
5111
5121
  m({
5112
- _c: ee
5122
+ _c: te
5113
5123
  });
5114
- }), z) {
5115
- if (h) throw z;
5124
+ }), V) {
5125
+ if (h) throw V;
5116
5126
  return;
5117
5127
  }
5118
- return M;
5128
+ return Z;
5119
5129
  });
5120
5130
  }
5121
5131
  });
@@ -5125,7 +5135,7 @@ const Or = (t, e) => {
5125
5135
  t[n][0] && t[n][0](e);
5126
5136
  }, vc = (t, e) => {
5127
5137
  if (!Re.has(t)) {
5128
- const n = Ue(pc, e), s = /* @__PURE__ */ Object.create(null), r = Qr.bind(ee, t);
5138
+ const n = Ue(pc, e), s = /* @__PURE__ */ Object.create(null), r = Qr.bind(te, t);
5129
5139
  let a = Me;
5130
5140
  const i = /* @__PURE__ */ Object.create(null), o = (h, p) => {
5131
5141
  const k = i[h] || [];
@@ -5146,7 +5156,7 @@ const Or = (t, e) => {
5146
5156
  c,
5147
5157
  o
5148
5158
  ]), !Ht)) {
5149
- const h = n.initFocus(setTimeout.bind(ee, Or.bind(ee, s, Hr))), p = n.initReconnect(setTimeout.bind(ee, Or.bind(ee, s, Gr)));
5159
+ const h = n.initFocus(setTimeout.bind(te, Or.bind(te, s, Hr))), p = n.initReconnect(setTimeout.bind(te, Or.bind(te, s, Gr)));
5150
5160
  a = () => {
5151
5161
  h && h(), p && p(), Re.delete(t);
5152
5162
  };
@@ -5202,7 +5212,7 @@ const Or = (t, e) => {
5202
5212
  return n;
5203
5213
  }, Ec = fa({}), Sc = "$inf$", ta = Xt && window.__SWR_DEVTOOLS_USE__, Oc = ta ? window.__SWR_DEVTOOLS_USE__ : [], Tc = () => {
5204
5214
  ta && (window.__SWR_DEVTOOLS_REACT__ = Gt);
5205
- }, Ac = (t) => be(t[1]) ? [
5215
+ }, Ac = (t) => we(t[1]) ? [
5206
5216
  t[0],
5207
5217
  t[1],
5208
5218
  t[2] || {}
@@ -5253,29 +5263,29 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
5253
5263
  }), Kn = {
5254
5264
  dedupe: !0
5255
5265
  }, jc = (t, e, n) => {
5256
- const { cache: s, compare: r, suspense: a, fallbackData: i, revalidateOnMount: o, revalidateIfStale: c, refreshInterval: u, refreshWhenHidden: h, refreshWhenOffline: p, keepPreviousData: k } = n, [g, b, m, _] = Re.get(s), [l, C] = js(t), I = Be(!1), V = Be(!1), M = Be(l), z = Be(e), D = Be(n), P = () => D.current, Se = () => P().isVisible() && P().isOnline(), [F, st, Ve, le] = Yr(s, l), rt = Be({}).current, Yt = R(i) ? R(n.fallback) ? ee : n.fallback[l] : i, Zs = ($, L) => {
5257
- for (const G in rt) {
5258
- const K = G;
5259
- if (K === "data") {
5260
- if (!r($[K], L[K]) && (!R($[K]) || !r(en, L[K])))
5266
+ const { cache: s, compare: r, suspense: a, fallbackData: i, revalidateOnMount: o, revalidateIfStale: c, refreshInterval: u, refreshWhenHidden: h, refreshWhenOffline: p, keepPreviousData: k } = n, [g, b, m, _] = Re.get(s), [l, C] = js(t), P = Be(!1), K = Be(!1), Z = Be(l), V = Be(e), D = Be(n), M = () => D.current, G = () => M().isVisible() && M().isOnline(), [$, st, Ve, fe] = Yr(s, l), rt = Be({}).current, Yt = R(i) ? R(n.fallback) ? te : n.fallback[l] : i, Zs = (F, L) => {
5267
+ for (const J in rt) {
5268
+ const z = J;
5269
+ if (z === "data") {
5270
+ if (!r(F[z], L[z]) && (!R(F[z]) || !r(en, L[z])))
5261
5271
  return !1;
5262
- } else if (L[K] !== $[K])
5272
+ } else if (L[z] !== F[z])
5263
5273
  return !1;
5264
5274
  }
5265
5275
  return !0;
5266
5276
  }, Ds = ya(() => {
5267
- const $ = !l || !e ? !1 : R(o) ? P().isPaused() || a ? !1 : c !== !1 : o, L = (Y) => {
5268
- const Oe = Ue(Y);
5269
- return delete Oe._k, $ ? Ke({
5277
+ const F = !l || !e ? !1 : R(o) ? M().isPaused() || a ? !1 : c !== !1 : o, L = (Q) => {
5278
+ const Oe = Ue(Q);
5279
+ return delete Oe._k, F ? Ke({
5270
5280
  isValidating: !0,
5271
5281
  isLoading: !0
5272
5282
  }, Oe) : Oe;
5273
- }, G = F(), K = le(), fe = L(G), ot = G === K ? fe : L(K);
5274
- let H = fe;
5283
+ }, J = $(), z = fe(), he = L(J), ot = J === z ? he : L(z);
5284
+ let H = he;
5275
5285
  return [
5276
5286
  () => {
5277
- const Y = L(F());
5278
- return Zs(Y, H) ? (H.data = Y.data, H.isLoading = Y.isLoading, H.isValidating = Y.isValidating, H.error = Y.error, H) : (H = Y, Y);
5287
+ const Q = L($());
5288
+ return Zs(Q, H) ? (H.data = Q.data, H.isLoading = Q.isLoading, H.isValidating = Q.isValidating, H.error = Q.error, H) : (H = Q, Q);
5279
5289
  },
5280
5290
  () => ot
5281
5291
  ];
@@ -5283,53 +5293,53 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
5283
5293
  s,
5284
5294
  l
5285
5295
  ]), at = ic.useSyncExternalStore(rn(
5286
- ($) => Ve(l, (L, G) => {
5287
- Zs(G, L) || $();
5296
+ (F) => Ve(l, (L, J) => {
5297
+ Zs(J, L) || F();
5288
5298
  }),
5289
5299
  // eslint-disable-next-line react-hooks/exhaustive-deps
5290
5300
  [
5291
5301
  s,
5292
5302
  l
5293
5303
  ]
5294
- ), Ds[0], Ds[1]), Ms = !I.current, na = g[l] && g[l].length > 0, it = at.data, ze = R(it) ? Yt && Xr(Yt) ? zn(Yt) : Yt : it, Qt = at.error, An = Be(ze), en = k ? R(it) ? R(An.current) ? ze : An.current : it : ze, Ls = na && !R(Qt) ? !1 : Ms && !R(o) ? o : P().isPaused() ? !1 : a ? R(ze) ? !1 : c : R(ze) || c, $s = !!(l && e && Ms && Ls), sa = R(at.isValidating) ? $s : at.isValidating, ra = R(at.isLoading) ? $s : at.isLoading, wt = rn(
5295
- ($) => Ie(void 0, null, function* () {
5296
- const L = z.current;
5297
- if (!l || !L || V.current || P().isPaused())
5304
+ ), Ds[0], Ds[1]), Ms = !P.current, na = g[l] && g[l].length > 0, it = at.data, ze = R(it) ? Yt && Xr(Yt) ? zn(Yt) : Yt : it, Qt = at.error, An = Be(ze), en = k ? R(it) ? R(An.current) ? ze : An.current : it : ze, Ls = na && !R(Qt) ? !1 : Ms && !R(o) ? o : M().isPaused() ? !1 : a ? R(ze) ? !1 : c : R(ze) || c, $s = !!(l && e && Ms && Ls), sa = R(at.isValidating) ? $s : at.isValidating, ra = R(at.isLoading) ? $s : at.isLoading, wt = rn(
5305
+ (F) => Ie(void 0, null, function* () {
5306
+ const L = V.current;
5307
+ if (!l || !L || K.current || M().isPaused())
5298
5308
  return !1;
5299
- let G, K, fe = !0;
5300
- const ot = $ || {}, H = !m[l] || !ot.dedupe, Y = () => Er ? !V.current && l === M.current && I.current : l === M.current, Oe = {
5309
+ let J, z, he = !0;
5310
+ const ot = F || {}, H = !m[l] || !ot.dedupe, Q = () => Er ? !K.current && l === Z.current && P.current : l === Z.current, Oe = {
5301
5311
  isValidating: !1,
5302
5312
  isLoading: !1
5303
5313
  }, Ws = () => {
5304
5314
  st(Oe);
5305
5315
  }, Us = () => {
5306
- const ue = m[l];
5307
- ue && ue[1] === K && delete m[l];
5316
+ const de = m[l];
5317
+ de && de[1] === z && delete m[l];
5308
5318
  }, Vs = {
5309
5319
  isValidating: !0
5310
5320
  };
5311
- R(F().data) && (Vs.isLoading = !0);
5321
+ R($().data) && (Vs.isLoading = !0);
5312
5322
  try {
5313
- if (H && (st(Vs), n.loadingTimeout && R(F().data) && setTimeout(() => {
5314
- fe && Y() && P().onLoadingSlow(l, n);
5323
+ if (H && (st(Vs), n.loadingTimeout && R($().data) && setTimeout(() => {
5324
+ he && Q() && M().onLoadingSlow(l, n);
5315
5325
  }, n.loadingTimeout), m[l] = [
5316
5326
  L(C),
5317
5327
  Os()
5318
- ]), [G, K] = m[l], G = yield G, H && setTimeout(Us, n.dedupingInterval), !m[l] || m[l][1] !== K)
5319
- return H && Y() && P().onDiscarded(l), !1;
5320
- Oe.error = ee;
5321
- const ue = b[l];
5322
- if (!R(ue) && // case 1
5323
- (K <= ue[0] || // case 2
5324
- K <= ue[1] || // case 3
5325
- ue[1] === 0))
5326
- return Ws(), H && Y() && P().onDiscarded(l), !1;
5327
- const Te = F().data;
5328
- Oe.data = r(Te, G) ? Te : G, H && Y() && P().onSuccess(G, l, n);
5329
- } catch (ue) {
5328
+ ]), [J, z] = m[l], J = yield J, H && setTimeout(Us, n.dedupingInterval), !m[l] || m[l][1] !== z)
5329
+ return H && Q() && M().onDiscarded(l), !1;
5330
+ Oe.error = te;
5331
+ const de = b[l];
5332
+ if (!R(de) && // case 1
5333
+ (z <= de[0] || // case 2
5334
+ z <= de[1] || // case 3
5335
+ de[1] === 0))
5336
+ return Ws(), H && Q() && M().onDiscarded(l), !1;
5337
+ const Te = $().data;
5338
+ Oe.data = r(Te, J) ? Te : J, H && Q() && M().onSuccess(J, l, n);
5339
+ } catch (de) {
5330
5340
  Us();
5331
- const Te = P(), { shouldRetryOnError: Cn } = Te;
5332
- Te.isPaused() || (Oe.error = ue, H && Y() && (Te.onError(ue, l, Te), (Cn === !0 || be(Cn) && Cn(ue)) && (!P().revalidateOnFocus || !P().revalidateOnReconnect || Se()) && Te.onErrorRetry(ue, l, Te, (aa) => {
5341
+ const Te = M(), { shouldRetryOnError: Cn } = Te;
5342
+ Te.isPaused() || (Oe.error = de, H && Q() && (Te.onError(de, l, Te), (Cn === !0 || we(Cn) && Cn(de)) && (!M().revalidateOnFocus || !M().revalidateOnReconnect || G()) && Te.onErrorRetry(de, l, Te, (aa) => {
5333
5343
  const Nn = g[l];
5334
5344
  Nn && Nn[0] && Nn[0](kr, aa);
5335
5345
  }, {
@@ -5337,7 +5347,7 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
5337
5347
  dedupe: !0
5338
5348
  })));
5339
5349
  }
5340
- return fe = !1, Ws(), !0;
5350
+ return he = !1, Ws(), !0;
5341
5351
  }),
5342
5352
  // `setState` is immutable, and `eventsCallback`, `fnArg`, and
5343
5353
  // `keyValidating` are depending on `key`, so we can exclude them from
@@ -5356,48 +5366,48 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
5356
5366
  ]
5357
5367
  ), Fs = rn(
5358
5368
  // Use callback to make sure `keyRef.current` returns latest result every time
5359
- (...$) => Qr(s, M.current, ...$),
5369
+ (...F) => Qr(s, Z.current, ...F),
5360
5370
  // eslint-disable-next-line react-hooks/exhaustive-deps
5361
5371
  []
5362
5372
  );
5363
5373
  if (Wn(() => {
5364
- z.current = e, D.current = n, R(it) || (An.current = it);
5374
+ V.current = e, D.current = n, R(it) || (An.current = it);
5365
5375
  }), Wn(() => {
5366
5376
  if (!l) return;
5367
- const $ = wt.bind(ee, Kn);
5377
+ const F = wt.bind(te, Kn);
5368
5378
  let L = 0;
5369
- P().revalidateOnFocus && (L = Date.now() + P().focusThrottleInterval);
5370
- const K = Ic(l, g, (fe, ot = {}) => {
5371
- if (fe == Hr) {
5379
+ M().revalidateOnFocus && (L = Date.now() + M().focusThrottleInterval);
5380
+ const z = Ic(l, g, (he, ot = {}) => {
5381
+ if (he == Hr) {
5372
5382
  const H = Date.now();
5373
- P().revalidateOnFocus && H > L && Se() && (L = H + P().focusThrottleInterval, $());
5374
- } else if (fe == Gr)
5375
- P().revalidateOnReconnect && Se() && $();
5383
+ M().revalidateOnFocus && H > L && G() && (L = H + M().focusThrottleInterval, F());
5384
+ } else if (he == Gr)
5385
+ M().revalidateOnReconnect && G() && F();
5376
5386
  else {
5377
- if (fe == Jr)
5387
+ if (he == Jr)
5378
5388
  return wt();
5379
- if (fe == kr)
5389
+ if (he == kr)
5380
5390
  return wt(ot);
5381
5391
  }
5382
5392
  });
5383
- return V.current = !1, M.current = l, I.current = !0, st({
5393
+ return K.current = !1, Z.current = l, P.current = !0, st({
5384
5394
  _k: C
5385
- }), Ls && (R(ze) || Ht ? $() : mc($)), () => {
5386
- V.current = !0, K();
5395
+ }), Ls && (R(ze) || Ht ? F() : mc(F)), () => {
5396
+ K.current = !0, z();
5387
5397
  };
5388
5398
  }, [
5389
5399
  l
5390
5400
  ]), Wn(() => {
5391
- let $;
5401
+ let F;
5392
5402
  function L() {
5393
- const K = be(u) ? u(F().data) : u;
5394
- K && $ !== -1 && ($ = setTimeout(G, K));
5403
+ const z = we(u) ? u($().data) : u;
5404
+ z && F !== -1 && (F = setTimeout(J, z));
5395
5405
  }
5396
- function G() {
5397
- !F().error && (h || P().isVisible()) && (p || P().isOnline()) ? wt(Kn).then(L) : L();
5406
+ function J() {
5407
+ !$().error && (h || M().isVisible()) && (p || M().isOnline()) ? wt(Kn).then(L) : L();
5398
5408
  }
5399
5409
  return L(), () => {
5400
- $ && (clearTimeout($), $ = -1);
5410
+ F && (clearTimeout(F), F = -1);
5401
5411
  };
5402
5412
  }, [
5403
5413
  u,
@@ -5407,10 +5417,10 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
5407
5417
  ]), ga(en), a && R(ze) && l) {
5408
5418
  if (!Er && Ht)
5409
5419
  throw new Error("Fallback data is required when using Suspense in SSR.");
5410
- z.current = e, D.current = n, V.current = !1;
5411
- const $ = _[l];
5412
- if (!R($)) {
5413
- const L = Fs($);
5420
+ V.current = e, D.current = n, K.current = !1;
5421
+ const F = _[l];
5422
+ if (!R(F)) {
5423
+ const L = Fs(F);
5414
5424
  zn(L);
5415
5425
  }
5416
5426
  if (R(Qt)) {