@animaapp/anima-sdk-react 0.6.11 → 0.6.16

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
@@ -34,14 +34,14 @@ const va = (t) => {
34
34
  e += String.fromCharCode(n[r]);
35
35
  return btoa(e);
36
36
  };
37
- var _a = Object.defineProperty, ba = Object.defineProperties, wa = Object.getOwnPropertyDescriptors, qs = Object.getOwnPropertySymbols, ka = Object.prototype.hasOwnProperty, Ea = Object.prototype.propertyIsEnumerable, Hs = (t, e, n) => e in t ? _a(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, d = (t, e) => {
37
+ var _a = Object.defineProperty, ba = Object.defineProperties, wa = Object.getOwnPropertyDescriptors, qs = Object.getOwnPropertySymbols, ka = Object.prototype.hasOwnProperty, xa = Object.prototype.propertyIsEnumerable, Hs = (t, e, n) => e in t ? _a(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, d = (t, e) => {
38
38
  for (var n in e || (e = {}))
39
39
  ka.call(e, n) && Hs(t, n, e[n]);
40
40
  if (qs)
41
41
  for (var n of qs(e))
42
- Ea.call(e, n) && Hs(t, n, e[n]);
42
+ xa.call(e, n) && Hs(t, n, e[n]);
43
43
  return t;
44
- }, x = (t, e) => ba(t, wa(e)), ke = (t, e, n) => new Promise((s, r) => {
44
+ }, E = (t, e) => ba(t, wa(e)), ke = (t, e, n) => new Promise((s, r) => {
45
45
  var a = (c) => {
46
46
  try {
47
47
  o(n.next(c));
@@ -67,14 +67,14 @@ class Gs extends Error {
67
67
  super(), this.name = e, this.message = n, this.detail = r, this.status = s;
68
68
  }
69
69
  }
70
- const xa = "Figma Token Issue";
70
+ const Ea = "Figma Token Issue";
71
71
  class Sa extends Error {
72
72
  constructor({
73
73
  fileKey: e,
74
74
  reason: n,
75
75
  cause: s
76
76
  }) {
77
- super(xa), this.fileKey = e, this.reason = n, this.cause = s;
77
+ super(Ea), this.fileKey = e, this.reason = n, this.cause = s;
78
78
  }
79
79
  }
80
80
  const Oa = "Rate Limit Exceeded";
@@ -83,10 +83,10 @@ class Ta extends Error {
83
83
  super(Oa), this.fileKey = e, this.cause = n;
84
84
  }
85
85
  }
86
- const Ca = "Request Too Large";
87
- class Aa extends Error {
86
+ const Aa = "Request Too Large";
87
+ class Ca extends Error {
88
88
  constructor({ fileKey: e, cause: n }) {
89
- super(Ca), this.fileKey = e, this.cause = n;
89
+ super(Aa), this.fileKey = e, this.cause = n;
90
90
  }
91
91
  }
92
92
  const Na = "Not Found";
@@ -116,7 +116,7 @@ const ja = (t, e) => {
116
116
  if (r === 404)
117
117
  return new Ra({ fileKey: e, cause: t });
118
118
  if (r === 400 && s.includes("Request too large"))
119
- return new Aa({ fileKey: e, cause: t });
119
+ return new Ca({ fileKey: e, cause: t });
120
120
  }
121
121
  return new Ia({ fileKey: e, cause: t });
122
122
  };
@@ -129,7 +129,7 @@ var Za = Object.defineProperty, Da = Object.defineProperties, Ma = Object.getOwn
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)), Cs = (t, e, n) => e.has(t) || Tr("Cannot " + n), j = (t, e, n) => (Cs(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) => (Cs(t, e, "write to private field"), e.set(t, n), n), _e = (t, e, n) => (Cs(t, e, "access private method"), n), B = (t, e, n) => new Promise((s, r) => {
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) => {
133
133
  var a = (c) => {
134
134
  try {
135
135
  o(n.next(c));
@@ -154,49 +154,49 @@ 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]()), A = h && typeof String.prototype[Symbol.iterator] == "function", I = A && Object.getPrototypeOf(""[Symbol.iterator]()), V = 8, M = -1;
158
- function z(Z) {
159
- var P = typeof Z;
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
160
  if (P !== "object")
161
161
  return P;
162
- if (Z === null)
162
+ if (D === null)
163
163
  return "null";
164
- if (Z === s)
164
+ if (D === s)
165
165
  return "global";
166
- if (Array.isArray(Z) && (p === !1 || !(Symbol.toStringTag in Z)))
166
+ if (Array.isArray(D) && (p === !1 || !(Symbol.toStringTag in D)))
167
167
  return "Array";
168
168
  if (typeof window == "object" && window !== null) {
169
- if (typeof window.location == "object" && Z === window.location)
169
+ if (typeof window.location == "object" && D === window.location)
170
170
  return "Location";
171
- if (typeof window.document == "object" && Z === window.document)
171
+ if (typeof window.document == "object" && D === window.document)
172
172
  return "Document";
173
173
  if (typeof window.navigator == "object") {
174
- if (typeof window.navigator.mimeTypes == "object" && Z === window.navigator.mimeTypes)
174
+ if (typeof window.navigator.mimeTypes == "object" && D === window.navigator.mimeTypes)
175
175
  return "MimeTypeArray";
176
- if (typeof window.navigator.plugins == "object" && Z === window.navigator.plugins)
176
+ if (typeof window.navigator.plugins == "object" && D === window.navigator.plugins)
177
177
  return "PluginArray";
178
178
  }
179
- if ((typeof window.HTMLElement == "function" || typeof window.HTMLElement == "object") && Z instanceof window.HTMLElement) {
180
- if (Z.tagName === "BLOCKQUOTE")
179
+ if ((typeof window.HTMLElement == "function" || typeof window.HTMLElement == "object") && D instanceof window.HTMLElement) {
180
+ if (D.tagName === "BLOCKQUOTE")
181
181
  return "HTMLQuoteElement";
182
- if (Z.tagName === "TD")
182
+ if (D.tagName === "TD")
183
183
  return "HTMLTableDataCellElement";
184
- if (Z.tagName === "TH")
184
+ if (D.tagName === "TH")
185
185
  return "HTMLTableHeaderCellElement";
186
186
  }
187
187
  }
188
- var Se = p && Z[Symbol.toStringTag];
188
+ var Se = p && D[Symbol.toStringTag];
189
189
  if (typeof Se == "string")
190
190
  return Se;
191
- var F = Object.getPrototypeOf(Z);
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" : A && F === I ? "String Iterator" : F === null ? "Object" : Object.prototype.toString.call(Z).slice(V, M);
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);
193
193
  }
194
194
  return z;
195
195
  });
196
196
  }(Bn)), Bn.exports;
197
197
  }
198
198
  var Ka = za();
199
- const Ba = /* @__PURE__ */ Ua(Ka), As = typeof Buffer != "undefined", qa = As && typeof Buffer.from != "undefined", Ha = As ? (
199
+ const Ba = /* @__PURE__ */ Ua(Ka), Cs = typeof Buffer != "undefined", qa = Cs && typeof Buffer.from != "undefined", Ha = Cs ? (
200
200
  /**
201
201
  * is value is Buffer?
202
202
  *
@@ -227,7 +227,7 @@ const Ba = /* @__PURE__ */ Ua(Ka), As = typeof Buffer != "undefined", qa = As &&
227
227
  function(t) {
228
228
  return Buffer.from(t);
229
229
  }
230
- ) : As ? (
230
+ ) : Cs ? (
231
231
  /**
232
232
  * copy Buffer
233
233
  *
@@ -318,7 +318,7 @@ function oi(t) {
318
318
  function ci(t) {
319
319
  return new String(t);
320
320
  }
321
- function Ce(t, e) {
321
+ function Ae(t, e) {
322
322
  return Rn[e].from ? Rn[e].from(t) : new Rn[e](t);
323
323
  }
324
324
  function Q(t) {
@@ -348,15 +348,15 @@ const fi = /* @__PURE__ */ new Map([
348
348
  ["String", ci],
349
349
  // typed arrays
350
350
  // TODO: pass bound function
351
- ["Float32Array", Ce],
352
- ["Float64Array", Ce],
353
- ["Int16Array", Ce],
354
- ["Int32Array", Ce],
355
- ["Int8Array", Ce],
356
- ["Uint16Array", Ce],
357
- ["Uint32Array", Ce],
358
- ["Uint8Array", Ce],
359
- ["Uint8ClampedArray", Ce],
351
+ ["Float32Array", Ae],
352
+ ["Float64Array", Ae],
353
+ ["Int16Array", Ae],
354
+ ["Int32Array", Ae],
355
+ ["Int8Array", Ae],
356
+ ["Uint16Array", Ae],
357
+ ["Uint32Array", Ae],
358
+ ["Uint8Array", Ae],
359
+ ["Uint8ClampedArray", Ae],
360
360
  // shallow copy
361
361
  ["Array Iterator", Q],
362
362
  ["Map Iterator", Q],
@@ -460,7 +460,7 @@ function Gn(t, e, n, s, r) {
460
460
  return e;
461
461
  }
462
462
  const pi = (t) => new Promise((e) => setTimeout(e, t));
463
- var an, He, on, Jn, Cr;
463
+ var an, He, on, Jn, Ar;
464
464
  class mi {
465
465
  constructor({ maxAttempts: e = 3, func: n }) {
466
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);
@@ -468,18 +468,18 @@ class mi {
468
468
  run() {
469
469
  return B(this, null, function* () {
470
470
  try {
471
- return yield j(this, on).call(this);
471
+ return yield Z(this, on).call(this);
472
472
  } catch (e) {
473
- if (J(this, He, j(this, He) + 1), j(this, He) > j(this, an))
473
+ if (J(this, He, Z(this, He) + 1), Z(this, He) > Z(this, an))
474
474
  throw console.error("Max attempts reached"), e;
475
- const n = _e(this, Jn, Cr).call(this);
475
+ const n = _e(this, Jn, Ar).call(this);
476
476
  return yield pi(n), yield this.run();
477
477
  }
478
478
  });
479
479
  }
480
480
  }
481
- an = /* @__PURE__ */ new WeakMap(), He = /* @__PURE__ */ new WeakMap(), on = /* @__PURE__ */ new WeakMap(), Jn = /* @__PURE__ */ new WeakSet(), Cr = function() {
482
- return j(this, He) * 1e3 * 1.5;
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;
483
483
  };
484
484
  function yi() {
485
485
  return typeof CompressionStream != "undefined";
@@ -544,7 +544,7 @@ class nr extends Error {
544
544
  }
545
545
  }
546
546
  }
547
- class Et extends Error {
547
+ class xt extends Error {
548
548
  constructor(e = {}) {
549
549
  const { canceled: n = !1 } = e;
550
550
  super("Abort Error"), this.name = "Abort Error", this.canceled = n;
@@ -560,7 +560,7 @@ class Pn extends Error {
560
560
  super(e), this.name = "Request Validation Error";
561
561
  }
562
562
  }
563
- function Ar() {
563
+ function Cr() {
564
564
  return Array.from(
565
565
  { length: 32 },
566
566
  () => Math.floor(Math.random() * 256).toString(16).padStart(2, "0")
@@ -570,8 +570,8 @@ 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, xt;
574
- class Ei {
573
+ var Ge, ne, ge, Yn, Qn, Et;
574
+ class xi {
575
575
  constructor({ fetch: e = globalThis.fetch.bind(globalThis), baseAddress: n }) {
576
576
  de(this, ge), de(this, Ge), de(this, ne), this.baseAddress = n, J(this, Ge, e), J(this, ne, {}), this.plugins = [];
577
577
  }
@@ -591,32 +591,32 @@ class Ei {
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(j(this, ne));
595
- return J(this, ne, {}), c.extraHeaders && (o = ae(ae({}, o), c.extraHeaders)), c.requestValidation && (o = Ts(ae({}, o), { "X-Request-Nonce": Ar(), "X-Request-Timestamp": Xn() })), c.async ? yield _e(this, ge, Qn).call(this, `${i}${n}`, c.async, { headers: o }) : yield _e(this, ge, Yn).call(this, `${i}${n}`, c, { headers: o });
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 });
596
596
  });
597
597
  }
598
598
  post(e, n) {
599
599
  return B(this, arguments, function* (s, r, a = {}) {
600
- const i = kt(j(this, ne));
601
- return J(this, ne, {}), _e(this, ge, xt).call(this, s, "POST", r, a, i);
600
+ const i = kt(Z(this, ne));
601
+ return J(this, ne, {}), _e(this, ge, Et).call(this, s, "POST", r, a, i);
602
602
  });
603
603
  }
604
604
  put(e, n) {
605
605
  return B(this, arguments, function* (s, r, a = {}) {
606
- const i = kt(j(this, ne));
607
- return J(this, ne, {}), _e(this, ge, xt).call(this, s, "PUT", r, a, i);
606
+ const i = kt(Z(this, ne));
607
+ return J(this, ne, {}), _e(this, ge, Et).call(this, s, "PUT", r, a, i);
608
608
  });
609
609
  }
610
610
  delete(e, n) {
611
611
  return B(this, arguments, function* (s, r, a = {}) {
612
- const i = kt(j(this, ne));
613
- return J(this, ne, {}), _e(this, ge, xt).call(this, s, "DELETE", r, a, i);
612
+ const i = kt(Z(this, ne));
613
+ return J(this, ne, {}), _e(this, ge, Et).call(this, s, "DELETE", r, a, i);
614
614
  });
615
615
  }
616
616
  patch(e, n) {
617
617
  return B(this, arguments, function* (s, r, a = {}) {
618
- const i = kt(j(this, ne));
619
- return J(this, ne, {}), _e(this, ge, xt).call(this, s, "PATCH", r, a, i);
618
+ const i = kt(Z(this, ne));
619
+ return J(this, ne, {}), _e(this, ge, Et).call(this, s, "PATCH", r, a, i);
620
620
  });
621
621
  }
622
622
  }
@@ -625,9 +625,9 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
625
625
  const s = () => B(this, null, function* () {
626
626
  var c, u;
627
627
  try {
628
- return yield j(this, Ge).call(this, t, ae(ae({}, n), e.abortSignal && { signal: e.abortSignal }));
628
+ return yield Z(this, Ge).call(this, t, ae(ae({}, n), e.abortSignal && { signal: e.abortSignal }));
629
629
  } catch (h) {
630
- throw h instanceof Error && h.name === "AbortError" ? new Et({ canceled: (u = (c = e.abortSignal) == null ? void 0 : c.aborted) != null ? u : !1 }) : h;
630
+ throw h instanceof Error && h.name === "AbortError" ? new xt({ canceled: (u = (c = e.abortSignal) == null ? void 0 : c.aborted) != null ? u : !1 }) : h;
631
631
  }
632
632
  }), { headers: r } = n != null ? n : {}, a = (c, u) => {
633
633
  var h, p;
@@ -685,9 +685,9 @@ 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 j(this, Ge).call(this, u, ae(ae({}, n), i && { signal: i }));
688
+ p = yield Z(this, Ge).call(this, u, ae(ae({}, n), i && { signal: i }));
689
689
  } catch (b) {
690
- throw b instanceof Error && b.name === "AbortError" ? new Et({ canceled: (s = i == null ? void 0 : i.aborted) != null ? s : !1 }) : b;
690
+ throw b instanceof Error && b.name === "AbortError" ? new xt({ canceled: (s = i == null ? void 0 : i.aborted) != null ? s : !1 }) : b;
691
691
  }
692
692
  if (!p.ok) {
693
693
  const b = yield p.text().catch();
@@ -706,17 +706,17 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
706
706
  return new Promise((b, m) => B(this, null, function* () {
707
707
  const _ = setTimeout(() => {
708
708
  m(new Error("Job timed out"));
709
- }, c), l = (A = 0) => B(this, null, function* () {
709
+ }, c), l = (C = 0) => B(this, null, function* () {
710
710
  if (i != null && i.aborted) {
711
- clearTimeout(_), j(this, Ge).call(this, `${h}/${g}/cancel`, { method: "POST", headers: this.headers }).then(() => {
712
- m(new Et({ canceled: !0 }));
711
+ clearTimeout(_), Z(this, Ge).call(this, `${h}/${g}/cancel`, { method: "POST", headers: this.headers }).then(() => {
712
+ m(new xt({ canceled: !0 }));
713
713
  }).catch((I) => {
714
- m(new Et({ canceled: !1 }));
714
+ m(new xt({ canceled: !1 }));
715
715
  });
716
716
  return;
717
717
  }
718
718
  try {
719
- const I = yield (yield j(this, Ge).call(this, `${h}/${g}`, { headers: this.headers })).json();
719
+ const I = yield (yield Z(this, Ge).call(this, `${h}/${g}`, { headers: this.headers })).json();
720
720
  if (I.status === "success") {
721
721
  clearTimeout(_);
722
722
  const V = I.response_json;
@@ -725,8 +725,8 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
725
725
  clearTimeout(_), m(new bi(I.response_json));
726
726
  else {
727
727
  a && a(I.response_json);
728
- const V = o(A);
729
- setTimeout(() => l(A + 1), V);
728
+ const V = o(C);
729
+ setTimeout(() => l(C + 1), V);
730
730
  }
731
731
  } catch (I) {
732
732
  m(I);
@@ -735,11 +735,11 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
735
735
  l();
736
736
  }));
737
737
  });
738
- }, xt = function(t, e, n, s, r) {
738
+ }, Et = function(t, e, n, s, r) {
739
739
  return B(this, null, function* () {
740
740
  const { overrideBaseAddress: a, overrideDefaultHeaders: i } = s, o = a != null ? a : this.baseAddress;
741
741
  let c = i != null ? i : this.headers;
742
- r.extraHeaders && (c = ae(ae({}, c), r.extraHeaders)), r.requestValidation && (c = Ts(ae({}, c), { "X-Request-Nonce": Ar(), "X-Request-Timestamp": Xn() }));
742
+ r.extraHeaders && (c = ae(ae({}, c), r.extraHeaders)), r.requestValidation && (c = Ts(ae({}, c), { "X-Request-Nonce": Cr(), "X-Request-Timestamp": Xn() }));
743
743
  let u = n;
744
744
  return typeof FormData != "undefined" && n instanceof FormData ? delete c["Content-Type"] : (u = s.skipBodyJsonStringify ? n : JSON.stringify(n), r.compress && yi() && (c["Content-Encoding"] = "gzip", u = yield gi(u))), r.async ? yield _e(this, ge, Qn).call(this, `${o}${t}`, r.async, {
745
745
  method: e,
@@ -748,7 +748,7 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
748
748
  }) : yield _e(this, ge, Yn).call(this, `${o}${t}`, r, { method: e, headers: c, body: u });
749
749
  });
750
750
  };
751
- const sr = (t, e, n, s) => t instanceof Et ? t : new _i({ resource: e, api: String(n), args: s, cause: t }), In = (t, e) => new Proxy(e, {
751
+ const sr = (t, e, n, s) => t instanceof xt ? t : new _i({ resource: e, api: String(n), args: s, cause: t }), In = (t, e) => new Proxy(e, {
752
752
  get(n, s) {
753
753
  return (...r) => {
754
754
  var a;
@@ -770,7 +770,7 @@ const sr = (t, e, n, s) => t instanceof Et ? t : new _i({ resource: e, api: Stri
770
770
  }
771
771
  });
772
772
  var St;
773
- class xi {
773
+ class Ei {
774
774
  constructor(e) {
775
775
  de(this, St), this.resourceName = "Files", J(this, St, e);
776
776
  }
@@ -779,14 +779,14 @@ class xi {
779
779
  const r = new URLSearchParams(ae({
780
780
  plugin_data: "857346721138427857"
781
781
  }, s)).toString(), a = `v1/files/${n}?${r}`;
782
- return yield j(this, St).get(a);
782
+ return yield Z(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 j(this, St).get(a)).meta) == null ? void 0 : s.images) != null ? r : {};
789
+ return (r = (s = (yield Z(this, St).get(a)).meta) == null ? void 0 : s.images) != null ? r : {};
790
790
  });
791
791
  }
792
792
  }
@@ -806,36 +806,36 @@ 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 = j(this, ve).cache.images.entries.get(i);
809
+ const i = Si(n, s, r), o = Z(this, ve).cache.images.entries.get(i);
810
810
  if (Oi(o))
811
811
  return o.result;
812
- o && j(this, ve).cache.images.entries.delete(i);
813
- const c = j(this, ve).cache.images.pendingRequests.get(i);
812
+ o && Z(this, ve).cache.images.entries.delete(i);
813
+ const c = Z(this, ve).cache.images.pendingRequests.get(i);
814
814
  if (c)
815
815
  return c;
816
816
  const u = _e(this, es, Nr).call(this, i, n, s, r, a);
817
- j(this, ve).cache.images.pendingRequests.set(i, u);
817
+ Z(this, ve).cache.images.pendingRequests.set(i, u);
818
818
  try {
819
819
  return yield u;
820
820
  } finally {
821
- j(this, ve).cache.images.pendingRequests.delete(i);
821
+ Z(this, ve).cache.images.pendingRequests.delete(i);
822
822
  }
823
823
  });
824
824
  }
825
825
  }
826
826
  ve = /* @__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 j(this, ve).get(
828
+ const a = yield Z(this, ve).get(
829
829
  `v1/images/${e}?ids=${n}&format=${s}${r ? `&scale=${r}` : ""}`
830
830
  );
831
- return j(this, ve).cache.images.entries.set(t, {
831
+ return Z(this, ve).cache.images.entries.set(t, {
832
832
  result: a,
833
833
  ts: Date.now()
834
834
  }), a;
835
835
  });
836
836
  };
837
837
  var cn;
838
- class Ci {
838
+ class Ai {
839
839
  constructor(e) {
840
840
  de(this, cn), this.resourceName = "Nodes", J(this, cn, e);
841
841
  }
@@ -846,13 +846,13 @@ class Ci {
846
846
  }), i = new URLSearchParams(ae({
847
847
  plugin_data: "857346721138427857"
848
848
  }, a)).toString(), o = `v1/files/${n}/nodes?${i}`;
849
- return yield j(this, cn).get(o);
849
+ return yield Z(this, cn).get(o);
850
850
  });
851
851
  }
852
852
  }
853
853
  cn = /* @__PURE__ */ new WeakMap();
854
854
  var je;
855
- class Ai extends Ei {
855
+ class Ci extends xi {
856
856
  constructor({
857
857
  baseAddress: e = "https://api.figma.com/",
858
858
  fetch: n = globalThis.fetch.bind(globalThis)
@@ -862,7 +862,7 @@ class Ai extends Ei {
862
862
  entries: /* @__PURE__ */ new Map(),
863
863
  pendingRequests: /* @__PURE__ */ new Map()
864
864
  }
865
- }, this.files = In(this, new xi(this)), this.nodes = In(this, new Ci(this)), this.images = In(this, new Ti(this));
865
+ }, this.files = In(this, new Ei(this)), this.nodes = In(this, new Ai(this)), this.images = In(this, new Ti(this));
866
866
  }
867
867
  set token(e) {
868
868
  if (!e.startsWith("figd_") && !e.startsWith("figu_"))
@@ -870,20 +870,20 @@ class Ai extends Ei {
870
870
  J(this, je, e);
871
871
  }
872
872
  get token() {
873
- return j(this, je);
873
+ return Z(this, je);
874
874
  }
875
875
  get headers() {
876
876
  const e = {
877
877
  "Content-Type": "application/json"
878
878
  };
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;
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;
880
880
  }
881
881
  }
882
882
  je = /* @__PURE__ */ new WeakMap();
883
883
  const Ni = (t) => ke(void 0, [t], function* ({
884
884
  fileKey: e,
885
885
  authToken: n,
886
- figmaRestApi: s = new Ai(),
886
+ figmaRestApi: s = new Ci(),
887
887
  params: r = {},
888
888
  signal: a
889
889
  }) {
@@ -1123,11 +1123,11 @@ function ln() {
1123
1123
  return Rr;
1124
1124
  }
1125
1125
  const fn = (t) => {
1126
- const { data: e, path: n, errorMaps: s, issueData: r } = t, a = [...n, ...r.path || []], i = x(d({}, r), {
1126
+ const { data: e, path: n, errorMaps: s, issueData: r } = t, a = [...n, ...r.path || []], i = E(d({}, r), {
1127
1127
  path: a
1128
1128
  });
1129
1129
  if (r.message !== void 0)
1130
- return x(d({}, r), {
1130
+ return E(d({}, r), {
1131
1131
  path: a,
1132
1132
  message: r.message
1133
1133
  });
@@ -1135,7 +1135,7 @@ const fn = (t) => {
1135
1135
  const c = s.filter((u) => !!u).slice().reverse();
1136
1136
  for (const u of c)
1137
1137
  o = u(i, { data: e, defaultError: o }).message;
1138
- return x(d({}, r), {
1138
+ return E(d({}, r), {
1139
1139
  path: a,
1140
1140
  message: o
1141
1141
  });
@@ -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 Ee {
1220
+ class xe {
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
  }
@@ -1387,7 +1387,7 @@ class T {
1387
1387
  _refinement(e) {
1388
1388
  return new ye({
1389
1389
  schema: this,
1390
- typeName: E.ZodEffects,
1390
+ typeName: x.ZodEffects,
1391
1391
  effect: { type: "refinement", refinement: e }
1392
1392
  });
1393
1393
  }
@@ -1423,37 +1423,37 @@ class T {
1423
1423
  return Mt.create(this, e, this._def);
1424
1424
  }
1425
1425
  transform(e) {
1426
- return new ye(x(d({}, O(this._def)), {
1426
+ return new ye(E(d({}, O(this._def)), {
1427
1427
  schema: this,
1428
- typeName: E.ZodEffects,
1428
+ typeName: x.ZodEffects,
1429
1429
  effect: { type: "transform", transform: e }
1430
1430
  }));
1431
1431
  }
1432
1432
  default(e) {
1433
1433
  const n = typeof e == "function" ? e : () => e;
1434
- return new Ut(x(d({}, O(this._def)), {
1434
+ return new Ut(E(d({}, O(this._def)), {
1435
1435
  innerType: this,
1436
1436
  defaultValue: n,
1437
- typeName: E.ZodDefault
1437
+ typeName: x.ZodDefault
1438
1438
  }));
1439
1439
  }
1440
1440
  brand() {
1441
1441
  return new Ns(d({
1442
- typeName: E.ZodBranded,
1442
+ typeName: x.ZodBranded,
1443
1443
  type: this
1444
1444
  }, O(this._def)));
1445
1445
  }
1446
1446
  catch(e) {
1447
1447
  const n = typeof e == "function" ? e : () => e;
1448
- return new Vt(x(d({}, O(this._def)), {
1448
+ return new Vt(E(d({}, O(this._def)), {
1449
1449
  innerType: this,
1450
1450
  catchValue: n,
1451
- typeName: E.ZodCatch
1451
+ typeName: x.ZodCatch
1452
1452
  }));
1453
1453
  }
1454
1454
  describe(e) {
1455
1455
  const n = this.constructor;
1456
- return new n(x(d({}, this._def), {
1456
+ return new n(E(d({}, this._def), {
1457
1457
  description: e
1458
1458
  }));
1459
1459
  }
@@ -1663,7 +1663,7 @@ class pe extends T {
1663
1663
  }, w.errToObj(s)));
1664
1664
  }
1665
1665
  _addCheck(e) {
1666
- return new pe(x(d({}, this._def), {
1666
+ return new pe(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(x(d({}, this._def), {
1792
+ return new pe(E(d({}, this._def), {
1793
1793
  checks: [...this._def.checks, { kind: "trim" }]
1794
1794
  }));
1795
1795
  }
1796
1796
  toLowerCase() {
1797
- return new pe(x(d({}, this._def), {
1797
+ return new pe(E(d({}, this._def), {
1798
1798
  checks: [...this._def.checks, { kind: "toLowerCase" }]
1799
1799
  }));
1800
1800
  }
1801
1801
  toUpperCase() {
1802
- return new pe(x(d({}, this._def), {
1802
+ return new pe(E(d({}, this._def), {
1803
1803
  checks: [...this._def.checks, { kind: "toUpperCase" }]
1804
1804
  }));
1805
1805
  }
@@ -1868,7 +1868,7 @@ pe.create = (t) => {
1868
1868
  var e;
1869
1869
  return new pe(d({
1870
1870
  checks: [],
1871
- typeName: E.ZodString,
1871
+ typeName: x.ZodString,
1872
1872
  coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1
1873
1873
  }, O(t)));
1874
1874
  };
@@ -1934,7 +1934,7 @@ class Le extends T {
1934
1934
  return this.setLimit("max", e, !1, w.toString(n));
1935
1935
  }
1936
1936
  setLimit(e, n, s, r) {
1937
- return new Le(x(d({}, this._def), {
1937
+ return new Le(E(d({}, this._def), {
1938
1938
  checks: [
1939
1939
  ...this._def.checks,
1940
1940
  {
@@ -1947,7 +1947,7 @@ class Le extends T {
1947
1947
  }));
1948
1948
  }
1949
1949
  _addCheck(e) {
1950
- return new Le(x(d({}, this._def), {
1950
+ return new Le(E(d({}, this._def), {
1951
1951
  checks: [...this._def.checks, e]
1952
1952
  }));
1953
1953
  }
@@ -2042,7 +2042,7 @@ class Le extends T {
2042
2042
  }
2043
2043
  Le.create = (t) => new Le(d({
2044
2044
  checks: [],
2045
- typeName: E.ZodNumber,
2045
+ typeName: x.ZodNumber,
2046
2046
  coerce: (t == null ? void 0 : t.coerce) || !1
2047
2047
  }, O(t)));
2048
2048
  class $e extends T {
@@ -2101,7 +2101,7 @@ class $e extends T {
2101
2101
  return this.setLimit("max", e, !1, w.toString(n));
2102
2102
  }
2103
2103
  setLimit(e, n, s, r) {
2104
- return new $e(x(d({}, this._def), {
2104
+ return new $e(E(d({}, this._def), {
2105
2105
  checks: [
2106
2106
  ...this._def.checks,
2107
2107
  {
@@ -2114,7 +2114,7 @@ class $e extends T {
2114
2114
  }));
2115
2115
  }
2116
2116
  _addCheck(e) {
2117
- return new $e(x(d({}, this._def), {
2117
+ return new $e(E(d({}, this._def), {
2118
2118
  checks: [...this._def.checks, e]
2119
2119
  }));
2120
2120
  }
@@ -2174,7 +2174,7 @@ $e.create = (t) => {
2174
2174
  var e;
2175
2175
  return new $e(d({
2176
2176
  checks: [],
2177
- typeName: E.ZodBigInt,
2177
+ typeName: x.ZodBigInt,
2178
2178
  coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1
2179
2179
  }, O(t)));
2180
2180
  };
@@ -2192,7 +2192,7 @@ class It extends T {
2192
2192
  }
2193
2193
  }
2194
2194
  It.create = (t) => new It(d({
2195
- typeName: E.ZodBoolean,
2195
+ typeName: x.ZodBoolean,
2196
2196
  coerce: (t == null ? void 0 : t.coerce) || !1
2197
2197
  }, O(t)));
2198
2198
  class Qe extends T {
@@ -2235,7 +2235,7 @@ class Qe extends T {
2235
2235
  };
2236
2236
  }
2237
2237
  _addCheck(e) {
2238
- return new Qe(x(d({}, this._def), {
2238
+ return new Qe(E(d({}, this._def), {
2239
2239
  checks: [...this._def.checks, e]
2240
2240
  }));
2241
2241
  }
@@ -2269,7 +2269,7 @@ class Qe extends T {
2269
2269
  Qe.create = (t) => new Qe(d({
2270
2270
  checks: [],
2271
2271
  coerce: (t == null ? void 0 : t.coerce) || !1,
2272
- typeName: E.ZodDate
2272
+ typeName: x.ZodDate
2273
2273
  }, O(t)));
2274
2274
  class mn extends T {
2275
2275
  _parse(e) {
@@ -2285,7 +2285,7 @@ class mn extends T {
2285
2285
  }
2286
2286
  }
2287
2287
  mn.create = (t) => new mn(d({
2288
- typeName: E.ZodSymbol
2288
+ typeName: x.ZodSymbol
2289
2289
  }, O(t)));
2290
2290
  class jt extends T {
2291
2291
  _parse(e) {
@@ -2301,7 +2301,7 @@ class jt extends T {
2301
2301
  }
2302
2302
  }
2303
2303
  jt.create = (t) => new jt(d({
2304
- typeName: E.ZodUndefined
2304
+ typeName: x.ZodUndefined
2305
2305
  }, O(t)));
2306
2306
  class Zt extends T {
2307
2307
  _parse(e) {
@@ -2317,7 +2317,7 @@ class Zt extends T {
2317
2317
  }
2318
2318
  }
2319
2319
  Zt.create = (t) => new Zt(d({
2320
- typeName: E.ZodNull
2320
+ typeName: x.ZodNull
2321
2321
  }, O(t)));
2322
2322
  class gt extends T {
2323
2323
  constructor() {
@@ -2328,7 +2328,7 @@ class gt extends T {
2328
2328
  }
2329
2329
  }
2330
2330
  gt.create = (t) => new gt(d({
2331
- typeName: E.ZodAny
2331
+ typeName: x.ZodAny
2332
2332
  }, O(t)));
2333
2333
  class Xe extends T {
2334
2334
  constructor() {
@@ -2339,7 +2339,7 @@ class Xe extends T {
2339
2339
  }
2340
2340
  }
2341
2341
  Xe.create = (t) => new Xe(d({
2342
- typeName: E.ZodUnknown
2342
+ typeName: x.ZodUnknown
2343
2343
  }, O(t)));
2344
2344
  class Pe extends T {
2345
2345
  _parse(e) {
@@ -2352,7 +2352,7 @@ class Pe extends T {
2352
2352
  }
2353
2353
  }
2354
2354
  Pe.create = (t) => new Pe(d({
2355
- typeName: E.ZodNever
2355
+ typeName: x.ZodNever
2356
2356
  }, O(t)));
2357
2357
  class yn extends T {
2358
2358
  _parse(e) {
@@ -2368,7 +2368,7 @@ class yn extends T {
2368
2368
  }
2369
2369
  }
2370
2370
  yn.create = (t) => new yn(d({
2371
- typeName: E.ZodVoid
2371
+ typeName: x.ZodVoid
2372
2372
  }, O(t)));
2373
2373
  class me extends T {
2374
2374
  _parse(e) {
@@ -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 Ee(n, i, n.path, o)))).then((i) => X.mergeArray(s, i));
2410
- const a = [...n.data].map((i, o) => r.type._parseSync(new Ee(n, i, n.path, o)));
2409
+ return Promise.all([...n.data].map((i, o) => r.type._parseAsync(new xe(n, i, n.path, o)))).then((i) => X.mergeArray(s, i));
2410
+ const a = [...n.data].map((i, o) => r.type._parseSync(new xe(n, i, n.path, o)));
2411
2411
  return X.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(x(d({}, this._def), {
2417
+ return new me(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(x(d({}, this._def), {
2422
+ return new me(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(x(d({}, this._def), {
2427
+ return new me(E(d({}, this._def), {
2428
2428
  exactLength: { value: e, message: w.toString(n) }
2429
2429
  }));
2430
2430
  }
@@ -2437,7 +2437,7 @@ me.create = (t, e) => new me(d({
2437
2437
  minLength: null,
2438
2438
  maxLength: null,
2439
2439
  exactLength: null,
2440
- typeName: E.ZodArray
2440
+ typeName: x.ZodArray
2441
2441
  }, O(e)));
2442
2442
  function ct(t) {
2443
2443
  if (t instanceof U) {
@@ -2446,12 +2446,12 @@ function ct(t) {
2446
2446
  const s = t.shape[n];
2447
2447
  e[n] = we.create(ct(s));
2448
2448
  }
2449
- return new U(x(d({}, t._def), {
2449
+ return new U(E(d({}, t._def), {
2450
2450
  shape: () => e
2451
2451
  }));
2452
- } else return t instanceof me ? new me(x(d({}, t._def), {
2452
+ } else return t instanceof me ? new me(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 xe ? xe.create(t.items.map((e) => ct(e))) : t;
2454
+ })) : t instanceof we ? we.create(ct(t.unwrap())) : t instanceof We ? We.create(ct(t.unwrap())) : t instanceof Ee ? Ee.create(t.items.map((e) => ct(e))) : t;
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 Ee(s, h, s.path, c)),
2484
+ value: u._parse(new xe(s, h, s.path, c)),
2485
2485
  alwaysSet: c in s.data
2486
2486
  });
2487
2487
  }
@@ -2506,7 +2506,7 @@ class U extends T {
2506
2506
  o.push({
2507
2507
  key: { status: "valid", value: u },
2508
2508
  value: c._parse(
2509
- new Ee(s, h, s.path, u)
2509
+ new xe(s, h, s.path, u)
2510
2510
  //, ctx.child(key), value, getParsedType(value)
2511
2511
  ),
2512
2512
  alwaysSet: u in s.data
@@ -2530,7 +2530,7 @@ class U extends T {
2530
2530
  return this._def.shape();
2531
2531
  }
2532
2532
  strict(e) {
2533
- return w.errToObj, new U(d(x(d({}, this._def), {
2533
+ return w.errToObj, new U(d(E(d({}, this._def), {
2534
2534
  unknownKeys: "strict"
2535
2535
  }), e !== void 0 ? {
2536
2536
  errorMap: (n, s) => {
@@ -2545,12 +2545,12 @@ class U extends T {
2545
2545
  } : {}));
2546
2546
  }
2547
2547
  strip() {
2548
- return new U(x(d({}, this._def), {
2548
+ return new U(E(d({}, this._def), {
2549
2549
  unknownKeys: "strip"
2550
2550
  }));
2551
2551
  }
2552
2552
  passthrough() {
2553
- return new U(x(d({}, this._def), {
2553
+ return new U(E(d({}, this._def), {
2554
2554
  unknownKeys: "passthrough"
2555
2555
  }));
2556
2556
  }
@@ -2572,7 +2572,7 @@ class U extends T {
2572
2572
  // }) as any;
2573
2573
  // };
2574
2574
  extend(e) {
2575
- return new U(x(d({}, this._def), {
2575
+ return new U(E(d({}, this._def), {
2576
2576
  shape: () => d(d({}, this._def.shape()), e)
2577
2577
  }));
2578
2578
  }
@@ -2586,7 +2586,7 @@ class U extends T {
2586
2586
  unknownKeys: e._def.unknownKeys,
2587
2587
  catchall: e._def.catchall,
2588
2588
  shape: () => d(d({}, this._def.shape()), e._def.shape()),
2589
- typeName: E.ZodObject
2589
+ typeName: x.ZodObject
2590
2590
  });
2591
2591
  }
2592
2592
  // merge<
@@ -2649,7 +2649,7 @@ class U extends T {
2649
2649
  // return merged;
2650
2650
  // }
2651
2651
  catchall(e) {
2652
- return new U(x(d({}, this._def), {
2652
+ return new U(E(d({}, this._def), {
2653
2653
  catchall: e
2654
2654
  }));
2655
2655
  }
@@ -2657,7 +2657,7 @@ class U extends T {
2657
2657
  const n = {};
2658
2658
  return N.objectKeys(e).forEach((s) => {
2659
2659
  e[s] && this.shape[s] && (n[s] = this.shape[s]);
2660
- }), new U(x(d({}, this._def), {
2660
+ }), new U(E(d({}, this._def), {
2661
2661
  shape: () => n
2662
2662
  }));
2663
2663
  }
@@ -2665,7 +2665,7 @@ class U extends T {
2665
2665
  const n = {};
2666
2666
  return N.objectKeys(this.shape).forEach((s) => {
2667
2667
  e[s] || (n[s] = this.shape[s]);
2668
- }), new U(x(d({}, this._def), {
2668
+ }), new U(E(d({}, this._def), {
2669
2669
  shape: () => n
2670
2670
  }));
2671
2671
  }
@@ -2680,7 +2680,7 @@ class U extends T {
2680
2680
  return N.objectKeys(this.shape).forEach((s) => {
2681
2681
  const r = this.shape[s];
2682
2682
  e && !e[s] ? n[s] = r : n[s] = r.optional();
2683
- }), new U(x(d({}, this._def), {
2683
+ }), new U(E(d({}, this._def), {
2684
2684
  shape: () => n
2685
2685
  }));
2686
2686
  }
@@ -2695,7 +2695,7 @@ class U extends T {
2695
2695
  r = r._def.innerType;
2696
2696
  n[s] = r;
2697
2697
  }
2698
- }), new U(x(d({}, this._def), {
2698
+ }), new U(E(d({}, this._def), {
2699
2699
  shape: () => n
2700
2700
  }));
2701
2701
  }
@@ -2707,19 +2707,19 @@ U.create = (t, e) => new U(d({
2707
2707
  shape: () => t,
2708
2708
  unknownKeys: "strip",
2709
2709
  catchall: Pe.create(),
2710
- typeName: E.ZodObject
2710
+ typeName: x.ZodObject
2711
2711
  }, O(e)));
2712
2712
  U.strictCreate = (t, e) => new U(d({
2713
2713
  shape: () => t,
2714
2714
  unknownKeys: "strict",
2715
2715
  catchall: Pe.create(),
2716
- typeName: E.ZodObject
2716
+ typeName: x.ZodObject
2717
2717
  }, O(e)));
2718
2718
  U.lazycreate = (t, e) => new U(d({
2719
2719
  shape: t,
2720
2720
  unknownKeys: "strip",
2721
2721
  catchall: Pe.create(),
2722
- typeName: E.ZodObject
2722
+ typeName: x.ZodObject
2723
2723
  }, O(e)));
2724
2724
  class Dt extends T {
2725
2725
  _parse(e) {
@@ -2739,8 +2739,8 @@ class Dt extends T {
2739
2739
  }
2740
2740
  if (n.common.async)
2741
2741
  return Promise.all(s.map((a) => ke(this, null, function* () {
2742
- const i = x(d({}, n), {
2743
- common: x(d({}, n.common), {
2742
+ const i = E(d({}, n), {
2743
+ common: E(d({}, n.common), {
2744
2744
  issues: []
2745
2745
  }),
2746
2746
  parent: null
@@ -2758,8 +2758,8 @@ class Dt extends T {
2758
2758
  let a;
2759
2759
  const i = [];
2760
2760
  for (const c of s) {
2761
- const u = x(d({}, n), {
2762
- common: x(d({}, n.common), {
2761
+ const u = E(d({}, n), {
2762
+ common: E(d({}, n.common), {
2763
2763
  issues: []
2764
2764
  }),
2765
2765
  parent: null
@@ -2787,10 +2787,10 @@ class Dt extends T {
2787
2787
  }
2788
2788
  Dt.create = (t, e) => new Dt(d({
2789
2789
  options: t,
2790
- typeName: E.ZodUnion
2790
+ typeName: x.ZodUnion
2791
2791
  }, O(e)));
2792
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) : [];
2793
- class En extends T {
2793
+ class xn extends T {
2794
2794
  _parse(e) {
2795
2795
  const { ctx: n } = this._processInputParams(e);
2796
2796
  if (n.parsedType !== v.object)
@@ -2843,8 +2843,8 @@ class En extends T {
2843
2843
  r.set(o, a);
2844
2844
  }
2845
2845
  }
2846
- return new En(d({
2847
- typeName: E.ZodDiscriminatedUnion,
2846
+ return new xn(d({
2847
+ typeName: x.ZodDiscriminatedUnion,
2848
2848
  discriminator: e,
2849
2849
  options: n,
2850
2850
  optionsMap: r
@@ -2912,9 +2912,9 @@ class Mt extends T {
2912
2912
  Mt.create = (t, e, n) => new Mt(d({
2913
2913
  left: t,
2914
2914
  right: e,
2915
- typeName: E.ZodIntersection
2915
+ typeName: x.ZodIntersection
2916
2916
  }, O(n)));
2917
- class xe extends T {
2917
+ class Ee extends T {
2918
2918
  _parse(e) {
2919
2919
  const { status: n, ctx: s } = this._processInputParams(e);
2920
2920
  if (s.parsedType !== v.array)
@@ -2940,7 +2940,7 @@ class xe 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 Ee(s, a, s.path, i)) : null;
2943
+ return o ? o._parse(new xe(s, a, s.path, i)) : null;
2944
2944
  }).filter((a) => !!a);
2945
2945
  return s.common.async ? Promise.all(r).then((a) => X.mergeArray(n, a)) : X.mergeArray(n, r);
2946
2946
  }
@@ -2948,17 +2948,17 @@ class xe extends T {
2948
2948
  return this._def.items;
2949
2949
  }
2950
2950
  rest(e) {
2951
- return new xe(x(d({}, this._def), {
2951
+ return new Ee(E(d({}, this._def), {
2952
2952
  rest: e
2953
2953
  }));
2954
2954
  }
2955
2955
  }
2956
- xe.create = (t, e) => {
2956
+ Ee.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 xe(d({
2959
+ return new Ee(d({
2960
2960
  items: t,
2961
- typeName: E.ZodTuple,
2961
+ typeName: x.ZodTuple,
2962
2962
  rest: null
2963
2963
  }, O(e)));
2964
2964
  };
@@ -2980,8 +2980,8 @@ 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 Ee(s, o, s.path, o)),
2984
- value: i._parse(new Ee(s, s.data[o], s.path, o)),
2983
+ key: a._parse(new xe(s, o, s.path, o)),
2984
+ value: i._parse(new xe(s, s.data[o], s.path, o)),
2985
2985
  alwaysSet: o in s.data
2986
2986
  });
2987
2987
  return s.common.async ? X.mergeObjectAsync(n, r) : X.mergeObjectSync(n, r);
@@ -2993,11 +2993,11 @@ class Lt extends T {
2993
2993
  return n instanceof T ? new Lt(d({
2994
2994
  keyType: e,
2995
2995
  valueType: n,
2996
- typeName: E.ZodRecord
2996
+ typeName: x.ZodRecord
2997
2997
  }, O(s))) : new Lt(d({
2998
2998
  keyType: pe.create(),
2999
2999
  valueType: e,
3000
- typeName: E.ZodRecord
3000
+ typeName: x.ZodRecord
3001
3001
  }, O(n)));
3002
3002
  }
3003
3003
  }
@@ -3017,8 +3017,8 @@ 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 Ee(s, o, s.path, [u, "key"])),
3021
- value: a._parse(new Ee(s, c, s.path, [u, "value"]))
3020
+ key: r._parse(new xe(s, o, s.path, [u, "key"])),
3021
+ value: a._parse(new xe(s, c, s.path, [u, "value"]))
3022
3022
  }));
3023
3023
  if (s.common.async) {
3024
3024
  const o = /* @__PURE__ */ new Map();
@@ -3046,7 +3046,7 @@ class gn extends T {
3046
3046
  gn.create = (t, e, n) => new gn(d({
3047
3047
  valueType: e,
3048
3048
  keyType: t,
3049
- typeName: E.ZodMap
3049
+ typeName: x.ZodMap
3050
3050
  }, O(n)));
3051
3051
  class et extends T {
3052
3052
  _parse(e) {
@@ -3083,16 +3083,16 @@ 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 Ee(s, c, s.path, u)));
3086
+ const o = [...s.data.values()].map((c, u) => a._parse(new xe(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) {
3090
- return new et(x(d({}, this._def), {
3090
+ return new et(E(d({}, this._def), {
3091
3091
  minSize: { value: e, message: w.toString(n) }
3092
3092
  }));
3093
3093
  }
3094
3094
  max(e, n) {
3095
- return new et(x(d({}, this._def), {
3095
+ return new et(E(d({}, this._def), {
3096
3096
  maxSize: { value: e, message: w.toString(n) }
3097
3097
  }));
3098
3098
  }
@@ -3107,7 +3107,7 @@ et.create = (t, e) => new et(d({
3107
3107
  valueType: t,
3108
3108
  minSize: null,
3109
3109
  maxSize: null,
3110
- typeName: E.ZodSet
3110
+ typeName: x.ZodSet
3111
3111
  }, O(e)));
3112
3112
  class ht extends T {
3113
3113
  constructor() {
@@ -3186,12 +3186,12 @@ class ht extends T {
3186
3186
  return this._def.returns;
3187
3187
  }
3188
3188
  args(...e) {
3189
- return new ht(x(d({}, this._def), {
3190
- args: xe.create(e).rest(Xe.create())
3189
+ return new ht(E(d({}, this._def), {
3190
+ args: Ee.create(e).rest(Xe.create())
3191
3191
  }));
3192
3192
  }
3193
3193
  returns(e) {
3194
- return new ht(x(d({}, this._def), {
3194
+ return new ht(E(d({}, this._def), {
3195
3195
  returns: e
3196
3196
  }));
3197
3197
  }
@@ -3203,9 +3203,9 @@ class ht extends T {
3203
3203
  }
3204
3204
  static create(e, n, s) {
3205
3205
  return new ht(d({
3206
- args: e || xe.create([]).rest(Xe.create()),
3206
+ args: e || Ee.create([]).rest(Xe.create()),
3207
3207
  returns: n || Xe.create(),
3208
- typeName: E.ZodFunction
3208
+ typeName: x.ZodFunction
3209
3209
  }, O(s)));
3210
3210
  }
3211
3211
  }
@@ -3220,7 +3220,7 @@ class $t extends T {
3220
3220
  }
3221
3221
  $t.create = (t, e) => new $t(d({
3222
3222
  getter: t,
3223
- typeName: E.ZodLazy
3223
+ typeName: x.ZodLazy
3224
3224
  }, O(e)));
3225
3225
  class Ft extends T {
3226
3226
  _parse(e) {
@@ -3240,12 +3240,12 @@ class Ft extends T {
3240
3240
  }
3241
3241
  Ft.create = (t, e) => new Ft(d({
3242
3242
  value: t,
3243
- typeName: E.ZodLiteral
3243
+ typeName: x.ZodLiteral
3244
3244
  }, O(e)));
3245
3245
  function Dr(t, e) {
3246
3246
  return new Fe(d({
3247
3247
  values: t,
3248
- typeName: E.ZodEnum
3248
+ typeName: x.ZodEnum
3249
3249
  }, O(e)));
3250
3250
  }
3251
3251
  class Fe extends T {
@@ -3332,7 +3332,7 @@ class Wt extends T {
3332
3332
  Tt = /* @__PURE__ */ new WeakMap();
3333
3333
  Wt.create = (t, e) => new Wt(d({
3334
3334
  values: t,
3335
- typeName: E.ZodNativeEnum
3335
+ typeName: x.ZodNativeEnum
3336
3336
  }, O(e)));
3337
3337
  class vt extends T {
3338
3338
  unwrap() {
@@ -3355,14 +3355,14 @@ class vt extends T {
3355
3355
  }
3356
3356
  vt.create = (t, e) => new vt(d({
3357
3357
  type: t,
3358
- typeName: E.ZodPromise
3358
+ typeName: x.ZodPromise
3359
3359
  }, O(e)));
3360
3360
  class ye extends T {
3361
3361
  innerType() {
3362
3362
  return this._def.schema;
3363
3363
  }
3364
3364
  sourceType() {
3365
- return this._def.schema._def.typeName === E.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
3365
+ return this._def.schema._def.typeName === x.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
3366
3366
  }
3367
3367
  _parse(e) {
3368
3368
  const { status: n, ctx: s } = this._processInputParams(e), r = this._def.effect || null, a = {
@@ -3436,13 +3436,13 @@ class ye extends T {
3436
3436
  }
3437
3437
  ye.create = (t, e, n) => new ye(d({
3438
3438
  schema: t,
3439
- typeName: E.ZodEffects,
3439
+ typeName: x.ZodEffects,
3440
3440
  effect: e
3441
3441
  }, O(n)));
3442
3442
  ye.createWithPreprocess = (t, e, n) => new ye(d({
3443
3443
  schema: e,
3444
3444
  effect: { type: "preprocess", transform: t },
3445
- typeName: E.ZodEffects
3445
+ typeName: x.ZodEffects
3446
3446
  }, O(n)));
3447
3447
  class we extends T {
3448
3448
  _parse(e) {
@@ -3454,7 +3454,7 @@ class we extends T {
3454
3454
  }
3455
3455
  we.create = (t, e) => new we(d({
3456
3456
  innerType: t,
3457
- typeName: E.ZodOptional
3457
+ typeName: x.ZodOptional
3458
3458
  }, O(e)));
3459
3459
  class We extends T {
3460
3460
  _parse(e) {
@@ -3466,7 +3466,7 @@ class We extends T {
3466
3466
  }
3467
3467
  We.create = (t, e) => new We(d({
3468
3468
  innerType: t,
3469
- typeName: E.ZodNullable
3469
+ typeName: x.ZodNullable
3470
3470
  }, O(e)));
3471
3471
  class Ut extends T {
3472
3472
  _parse(e) {
@@ -3484,13 +3484,13 @@ class Ut extends T {
3484
3484
  }
3485
3485
  Ut.create = (t, e) => new Ut(d({
3486
3486
  innerType: t,
3487
- typeName: E.ZodDefault,
3487
+ typeName: x.ZodDefault,
3488
3488
  defaultValue: typeof e.default == "function" ? e.default : () => e.default
3489
3489
  }, O(e)));
3490
3490
  class Vt extends T {
3491
3491
  _parse(e) {
3492
- const { ctx: n } = this._processInputParams(e), s = x(d({}, n), {
3493
- common: x(d({}, n.common), {
3492
+ const { ctx: n } = this._processInputParams(e), s = E(d({}, n), {
3493
+ common: E(d({}, n.common), {
3494
3494
  issues: []
3495
3495
  })
3496
3496
  }), r = this._def.innerType._parse({
@@ -3522,7 +3522,7 @@ class Vt extends T {
3522
3522
  }
3523
3523
  Vt.create = (t, e) => new Vt(d({
3524
3524
  innerType: t,
3525
- typeName: E.ZodCatch,
3525
+ typeName: x.ZodCatch,
3526
3526
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch
3527
3527
  }, O(e)));
3528
3528
  class vn extends T {
@@ -3539,7 +3539,7 @@ class vn extends T {
3539
3539
  }
3540
3540
  }
3541
3541
  vn.create = (t) => new vn(d({
3542
- typeName: E.ZodNaN
3542
+ typeName: x.ZodNaN
3543
3543
  }, O(t)));
3544
3544
  const to = Symbol("zod_brand");
3545
3545
  class Ns extends T {
@@ -3591,7 +3591,7 @@ class Jt extends T {
3591
3591
  return new Jt({
3592
3592
  in: e,
3593
3593
  out: n,
3594
- typeName: E.ZodPipeline
3594
+ typeName: x.ZodPipeline
3595
3595
  });
3596
3596
  }
3597
3597
  }
@@ -3606,7 +3606,7 @@ class zt extends T {
3606
3606
  }
3607
3607
  zt.create = (t, e) => new zt(d({
3608
3608
  innerType: t,
3609
- typeName: E.ZodReadonly
3609
+ typeName: x.ZodReadonly
3610
3610
  }, O(e)));
3611
3611
  function ar(t, e) {
3612
3612
  const n = typeof t == "function" ? t(e) : typeof t == "string" ? { message: t } : t;
@@ -3621,34 +3621,34 @@ function Mr(t, e = {}, n) {
3621
3621
  var u, h;
3622
3622
  if (!c) {
3623
3623
  const p = ar(e, s), k = (h = (u = p.fatal) !== null && u !== void 0 ? u : n) !== null && h !== void 0 ? h : !0;
3624
- r.addIssue(x(d({ code: "custom" }, p), { fatal: k }));
3624
+ r.addIssue(E(d({ code: "custom" }, p), { fatal: k }));
3625
3625
  }
3626
3626
  });
3627
3627
  if (!o) {
3628
3628
  const c = ar(e, s), u = (i = (a = c.fatal) !== null && a !== void 0 ? a : n) !== null && i !== void 0 ? i : !0;
3629
- r.addIssue(x(d({ code: "custom" }, c), { fatal: u }));
3629
+ r.addIssue(E(d({ code: "custom" }, c), { fatal: u }));
3630
3630
  }
3631
3631
  }) : gt.create();
3632
3632
  }
3633
3633
  const no = {
3634
3634
  object: U.lazycreate
3635
3635
  };
3636
- var E;
3636
+ var x;
3637
3637
  (function(t) {
3638
3638
  t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
3639
- })(E || (E = {}));
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 = En.create, bo = Mt.create, wo = xe.create, ko = Lt.create, Eo = gn.create, xo = et.create, So = ht.create, Oo = $t.create, To = Ft.create, Co = Fe.create, Ao = 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(x(d({}, t), { coerce: !0 })),
3644
- number: (t) => Le.create(x(d({}, t), { coerce: !0 })),
3645
- boolean: (t) => It.create(x(d({}, t), {
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 })),
3644
+ number: (t) => Le.create(E(d({}, t), { coerce: !0 })),
3645
+ boolean: (t) => It.create(E(d({}, t), {
3646
3646
  coerce: !0
3647
3647
  })),
3648
- bigint: (t) => $e.create(x(d({}, t), { coerce: !0 })),
3649
- date: (t) => Qe.create(x(d({}, t), { coerce: !0 }))
3648
+ bigint: (t) => $e.create(E(d({}, t), { coerce: !0 })),
3649
+ date: (t) => Qe.create(E(d({}, t), { coerce: !0 }))
3650
3650
  }, $o = S;
3651
- var D = /* @__PURE__ */ Object.freeze({
3651
+ var j = /* @__PURE__ */ Object.freeze({
3652
3652
  __proto__: null,
3653
3653
  defaultErrorMap: yt,
3654
3654
  setErrorMap: Pi,
@@ -3689,9 +3689,9 @@ var D = /* @__PURE__ */ Object.freeze({
3689
3689
  ZodArray: me,
3690
3690
  ZodObject: U,
3691
3691
  ZodUnion: Dt,
3692
- ZodDiscriminatedUnion: En,
3692
+ ZodDiscriminatedUnion: xn,
3693
3693
  ZodIntersection: Mt,
3694
- ZodTuple: xe,
3694
+ ZodTuple: Ee,
3695
3695
  ZodRecord: Lt,
3696
3696
  ZodMap: gn,
3697
3697
  ZodSet: et,
@@ -3717,7 +3717,7 @@ var D = /* @__PURE__ */ Object.freeze({
3717
3717
  ZodSchema: T,
3718
3718
  late: no,
3719
3719
  get ZodFirstPartyTypeKind() {
3720
- return E;
3720
+ return x;
3721
3721
  },
3722
3722
  coerce: Lo,
3723
3723
  any: lo,
@@ -3727,15 +3727,15 @@ var D = /* @__PURE__ */ Object.freeze({
3727
3727
  date: io,
3728
3728
  discriminatedUnion: _o,
3729
3729
  effect: ir,
3730
- enum: Co,
3730
+ enum: Ao,
3731
3731
  function: So,
3732
3732
  instanceof: so,
3733
3733
  intersection: bo,
3734
3734
  lazy: Oo,
3735
3735
  literal: To,
3736
- map: Eo,
3736
+ map: xo,
3737
3737
  nan: ro,
3738
- nativeEnum: Ao,
3738
+ nativeEnum: Co,
3739
3739
  never: ho,
3740
3740
  null: uo,
3741
3741
  nullable: Po,
@@ -3749,7 +3749,7 @@ var D = /* @__PURE__ */ Object.freeze({
3749
3749
  preprocess: Io,
3750
3750
  promise: No,
3751
3751
  record: ko,
3752
- set: xo,
3752
+ set: Eo,
3753
3753
  strictObject: go,
3754
3754
  string: Lr,
3755
3755
  symbol: oo,
@@ -3764,16 +3764,16 @@ var D = /* @__PURE__ */ Object.freeze({
3764
3764
  quotelessJson: Ri,
3765
3765
  ZodError: ie
3766
3766
  });
3767
- D.object({
3768
- language: D.enum(["typescript", "javascript"]).optional(),
3769
- disableMarkedForExport: D.boolean().optional(),
3770
- allowAutoSelectFirstNode: D.boolean().optional().default(!0)
3767
+ j.object({
3768
+ language: j.enum(["typescript", "javascript"]).optional(),
3769
+ disableMarkedForExport: j.boolean().optional(),
3770
+ allowAutoSelectFirstNode: j.boolean().optional().default(!0)
3771
3771
  }).and(
3772
- D.union([
3773
- D.object({
3774
- framework: D.literal("react"),
3775
- model: D.string().optional(),
3776
- styling: D.enum([
3772
+ j.union([
3773
+ j.object({
3774
+ framework: j.literal("react"),
3775
+ model: j.string().optional(),
3776
+ styling: j.enum([
3777
3777
  "plain_css",
3778
3778
  "css_modules",
3779
3779
  "styled_components",
@@ -3782,26 +3782,27 @@ D.object({
3782
3782
  "scss",
3783
3783
  "inline_styles"
3784
3784
  ]),
3785
- uiLibrary: D.enum(["mui", "antd", "radix", "shadcn", "clean_react"]).optional(),
3786
- responsivePages: D.array(
3787
- D.object({
3788
- name: D.string(),
3789
- framesId: D.array(D.string())
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())
3790
3790
  })
3791
3791
  ).optional(),
3792
- enableUILibraryTheming: D.boolean().optional(),
3793
- enableCompactStructure: D.boolean().optional(),
3794
- enableDisplayScreenModelId: D.boolean().optional(),
3795
- enableGeneratePackageLock: D.boolean().optional(),
3796
- enableAutoSplit: D.boolean().optional(),
3797
- autoSplitThreshold: D.number().optional(),
3798
- url: D.string().url().optional(),
3799
- codegenSettings: D.record(D.unknown()).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()
3800
3801
  }),
3801
- D.object({
3802
- framework: D.literal("html"),
3803
- styling: D.enum(["plain_css", "inline_styles", "tailwind"]),
3804
- enableTranslation: D.boolean().optional()
3802
+ j.object({
3803
+ framework: j.literal("html"),
3804
+ styling: j.enum(["plain_css", "inline_styles", "tailwind"]),
3805
+ enableTranslation: j.boolean().optional()
3805
3806
  })
3806
3807
  ])
3807
3808
  );
@@ -3820,10 +3821,10 @@ function Fo(t) {
3820
3821
  const { onEvent: e = Zn, onError: n = Zn, onRetry: s = Zn, onComment: r } = t;
3821
3822
  let a = "", i = !0, o, c = "", u = "";
3822
3823
  function h(m) {
3823
- const _ = i ? m.replace(/^\xEF\xBB\xBF/, "") : m, [l, A] = Wo(`${a}${_}`);
3824
+ const _ = i ? m.replace(/^\xEF\xBB\xBF/, "") : m, [l, C] = Wo(`${a}${_}`);
3824
3825
  for (const I of l)
3825
3826
  p(I);
3826
- a = A, i = !1;
3827
+ a = C, i = !1;
3827
3828
  }
3828
3829
  function p(m) {
3829
3830
  if (m === "") {
@@ -3836,7 +3837,7 @@ function Fo(t) {
3836
3837
  }
3837
3838
  const _ = m.indexOf(":");
3838
3839
  if (_ !== -1) {
3839
- const l = m.slice(0, _), A = m[_ + 1] === " " ? 2 : 1, I = m.slice(_ + A);
3840
+ const l = m.slice(0, _), C = m[_ + 1] === " " ? 2 : 1, I = m.slice(_ + C);
3840
3841
  k(l, I, m);
3841
3842
  return;
3842
3843
  }
@@ -3967,54 +3968,54 @@ function ur(t) {
3967
3968
  }
3968
3969
  var Wr = (t) => {
3969
3970
  throw TypeError(t);
3970
- }, Rs = (t, e, n) => e.has(t) || Wr("Cannot " + n), C = (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), Ae = (t, e, n) => (Rs(t, e, "access private method"), n), se, Je, ut, un, _n, Nt, ft, Rt, De, dt, pt, lt, Ct, he, is, os, cs, dr, us, ds, At, ls, fs;
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
3972
  class dn extends EventTarget {
3972
3973
  constructor(e, n) {
3973
3974
  var s, r;
3974
- 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, Ct, null), q(this, os, (a) => Ie(this, null, function* () {
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
3976
  var i;
3976
- C(this, dt).reset();
3977
+ A(this, dt).reset();
3977
3978
  const { body: o, redirected: c, status: u, headers: h } = a;
3978
3979
  if (u === 204) {
3979
- Ae(this, he, At).call(this, "Server sent HTTP 204, not reconnecting", 204), this.close();
3980
+ Ce(this, he, Ct).call(this, "Server sent HTTP 204, not reconnecting", 204), this.close();
3980
3981
  return;
3981
3982
  }
3982
3983
  if (c ? W(this, ut, new URL(a.url)) : W(this, ut, void 0), u !== 200) {
3983
- Ae(this, he, At).call(this, `Non-200 status code (${u})`, u);
3984
+ Ce(this, he, Ct).call(this, `Non-200 status code (${u})`, u);
3984
3985
  return;
3985
3986
  }
3986
3987
  if (!(h.get("content-type") || "").startsWith("text/event-stream")) {
3987
- Ae(this, he, At).call(this, 'Invalid content type, expected "text/event-stream"', u);
3988
+ Ce(this, he, Ct).call(this, 'Invalid content type, expected "text/event-stream"', u);
3988
3989
  return;
3989
3990
  }
3990
- if (C(this, se) === this.CLOSED)
3991
+ if (A(this, se) === this.CLOSED)
3991
3992
  return;
3992
3993
  W(this, se, this.OPEN);
3993
3994
  const p = new Event("open");
3994
- if ((i = C(this, Ct)) == null || i.call(this, p), this.dispatchEvent(p), typeof o != "object" || !o || !("getReader" in o)) {
3995
- Ae(this, he, At).call(this, "Invalid response body, expected a web ReadableStream", u), this.close();
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
3997
  return;
3997
3998
  }
3998
3999
  const k = new TextDecoder(), g = o.getReader();
3999
4000
  let b = !0;
4000
4001
  do {
4001
4002
  const { done: m, value: _ } = yield g.read();
4002
- _ && C(this, dt).feed(k.decode(_, { stream: !m })), m && (b = !1, C(this, dt).reset(), Ae(this, he, ls).call(this));
4003
+ _ && A(this, dt).feed(k.decode(_, { stream: !m })), m && (b = !1, A(this, dt).reset(), Ce(this, he, ls).call(this));
4003
4004
  } while (b);
4004
4005
  })), q(this, cs, (a) => {
4005
- W(this, De, void 0), !(a.name === "AbortError" || a.type === "aborted") && Ae(this, he, ls).call(this, as(a));
4006
+ W(this, De, void 0), !(a.name === "AbortError" || a.type === "aborted") && Ce(this, he, ls).call(this, as(a));
4006
4007
  }), q(this, us, (a) => {
4007
4008
  typeof a.id == "string" && W(this, Rt, a.id);
4008
4009
  const i = new MessageEvent(a.event || "message", {
4009
4010
  data: a.data,
4010
- origin: C(this, ut) ? C(this, ut).origin : C(this, Je).origin,
4011
+ origin: A(this, ut) ? A(this, ut).origin : A(this, Je).origin,
4011
4012
  lastEventId: a.id || ""
4012
4013
  });
4013
- C(this, lt) && (!a.event || a.event === "message") && C(this, lt).call(this, i), this.dispatchEvent(i);
4014
+ A(this, lt) && (!a.event || a.event === "message") && A(this, lt).call(this, i), this.dispatchEvent(i);
4014
4015
  }), q(this, ds, (a) => {
4015
4016
  W(this, Nt, a);
4016
4017
  }), q(this, fs, () => {
4017
- W(this, ft, void 0), C(this, se) === this.CONNECTING && Ae(this, he, is).call(this);
4018
+ W(this, ft, void 0), A(this, se) === this.CONNECTING && Ce(this, he, is).call(this);
4018
4019
  });
4019
4020
  try {
4020
4021
  if (e instanceof URL)
@@ -4027,9 +4028,9 @@ class dn extends EventTarget {
4027
4028
  throw Uo("An invalid or illegal string was specified");
4028
4029
  }
4029
4030
  W(this, dt, Fo({
4030
- onEvent: C(this, us),
4031
- onRetry: C(this, ds)
4032
- })), 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), Ae(this, he, is).call(this);
4031
+ onEvent: A(this, us),
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
4034
  }
4034
4035
  /**
4035
4036
  * Returns the state of this EventSource object's connection. It can have the values described below.
@@ -4042,7 +4043,7 @@ class dn extends EventTarget {
4042
4043
  * @public
4043
4044
  */
4044
4045
  get readyState() {
4045
- return C(this, se);
4046
+ return A(this, se);
4046
4047
  }
4047
4048
  /**
4048
4049
  * Returns the URL providing the event stream.
@@ -4052,7 +4053,7 @@ class dn extends EventTarget {
4052
4053
  * @public
4053
4054
  */
4054
4055
  get url() {
4055
- return C(this, Je).href;
4056
+ return A(this, Je).href;
4056
4057
  }
4057
4058
  /**
4058
4059
  * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
@@ -4060,28 +4061,28 @@ class dn extends EventTarget {
4060
4061
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
4061
4062
  */
4062
4063
  get withCredentials() {
4063
- return C(this, un);
4064
+ return A(this, un);
4064
4065
  }
4065
4066
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
4066
4067
  get onerror() {
4067
- return C(this, pt);
4068
+ return A(this, pt);
4068
4069
  }
4069
4070
  set onerror(e) {
4070
4071
  W(this, pt, e);
4071
4072
  }
4072
4073
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
4073
4074
  get onmessage() {
4074
- return C(this, lt);
4075
+ return A(this, lt);
4075
4076
  }
4076
4077
  set onmessage(e) {
4077
4078
  W(this, lt, e);
4078
4079
  }
4079
4080
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
4080
4081
  get onopen() {
4081
- return C(this, Ct);
4082
+ return A(this, At);
4082
4083
  }
4083
4084
  set onopen(e) {
4084
- W(this, Ct, e);
4085
+ W(this, At, e);
4085
4086
  }
4086
4087
  addEventListener(e, n, s) {
4087
4088
  const r = n;
@@ -4099,16 +4100,16 @@ class dn extends EventTarget {
4099
4100
  * @public
4100
4101
  */
4101
4102
  close() {
4102
- C(this, ft) && clearTimeout(C(this, ft)), C(this, se) !== this.CLOSED && (C(this, De) && C(this, De).abort(), W(this, se, this.CLOSED), W(this, De, void 0));
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
4104
  }
4104
4105
  }
4105
- se = /* @__PURE__ */ new WeakMap(), Je = /* @__PURE__ */ new WeakMap(), ut = /* @__PURE__ */ new WeakMap(), un = /* @__PURE__ */ new WeakMap(), _n = /* @__PURE__ */ new WeakMap(), Nt = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap(), Rt = /* @__PURE__ */ new WeakMap(), De = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), pt = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap(), Ct = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakSet(), /**
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
4107
  * Connect to the given URL and start receiving events
4107
4108
  *
4108
4109
  * @internal
4109
4110
  */
4110
4111
  is = function() {
4111
- W(this, se, this.CONNECTING), W(this, De, new AbortController()), C(this, _n)(C(this, Je), Ae(this, he, dr).call(this)).then(C(this, os)).catch(C(this, cs));
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
4113
  }, os = /* @__PURE__ */ new WeakMap(), cs = /* @__PURE__ */ new WeakMap(), /**
4113
4114
  * Get request options for the `fetch()` request
4114
4115
  *
@@ -4122,9 +4123,9 @@ dr = function() {
4122
4123
  // [spec] …will have their mode set to "cors"…
4123
4124
  mode: "cors",
4124
4125
  redirect: "follow",
4125
- headers: Ke({ Accept: "text/event-stream" }, C(this, Rt) ? { "Last-Event-ID": C(this, Rt) } : void 0),
4126
+ headers: Ke({ Accept: "text/event-stream" }, A(this, Rt) ? { "Last-Event-ID": A(this, Rt) } : void 0),
4126
4127
  cache: "no-store",
4127
- signal: (t = C(this, De)) == null ? void 0 : t.signal
4128
+ signal: (t = A(this, De)) == null ? void 0 : t.signal
4128
4129
  };
4129
4130
  return "window" in globalThis && (e.credentials = this.withCredentials ? "include" : "same-origin"), e;
4130
4131
  }, us = /* @__PURE__ */ new WeakMap(), ds = /* @__PURE__ */ new WeakMap(), /**
@@ -4134,11 +4135,11 @@ dr = function() {
4134
4135
  * @param code - The HTTP status code, if available
4135
4136
  * @internal
4136
4137
  */
4137
- At = function(t, e) {
4138
+ Ct = function(t, e) {
4138
4139
  var n;
4139
- C(this, se) !== this.CLOSED && W(this, se, this.CLOSED);
4140
+ A(this, se) !== this.CLOSED && W(this, se, this.CLOSED);
4140
4141
  const s = new cr("error", { code: e, message: t });
4141
- (n = C(this, pt)) == null || n.call(this, s), this.dispatchEvent(s);
4142
+ (n = A(this, pt)) == null || n.call(this, s), this.dispatchEvent(s);
4142
4143
  }, /**
4143
4144
  * Schedules a reconnection attempt against the EventSource endpoint.
4144
4145
  *
@@ -4148,11 +4149,11 @@ At = function(t, e) {
4148
4149
  */
4149
4150
  ls = function(t, e) {
4150
4151
  var n;
4151
- if (C(this, se) === this.CLOSED)
4152
+ if (A(this, se) === this.CLOSED)
4152
4153
  return;
4153
4154
  W(this, se, this.CONNECTING);
4154
4155
  const s = new cr("error", { code: e, message: t });
4155
- (n = C(this, pt)) == null || n.call(this, s), this.dispatchEvent(s), W(this, ft, setTimeout(C(this, fs), C(this, Nt)));
4156
+ (n = A(this, pt)) == null || n.call(this, s), this.dispatchEvent(s), W(this, ft, setTimeout(A(this, fs), A(this, Nt)));
4156
4157
  }, fs = /* @__PURE__ */ new WeakMap(), /**
4157
4158
  * ReadyState representing an EventSource currently trying to connect
4158
4159
  *
@@ -4232,19 +4233,19 @@ function Vr(t) {
4232
4233
  return n === Object ? !0 : typeof n == "function" && Function.toString.call(n) === Ko;
4233
4234
  }
4234
4235
  function bn(t, e) {
4235
- xn(t) === 0 ? Reflect.ownKeys(t).forEach((n) => {
4236
+ En(t) === 0 ? Reflect.ownKeys(t).forEach((n) => {
4236
4237
  e(n, t[n], t);
4237
4238
  }) : t.forEach((n, s) => e(s, n, t));
4238
4239
  }
4239
- function xn(t) {
4240
+ function En(t) {
4240
4241
  const e = t[oe];
4241
4242
  return e ? e.type_ : Array.isArray(t) ? 1 : Sn(t) ? 2 : On(t) ? 3 : 0;
4242
4243
  }
4243
4244
  function hs(t, e) {
4244
- return xn(t) === 2 ? t.has(e) : Object.prototype.hasOwnProperty.call(t, e);
4245
+ return En(t) === 2 ? t.has(e) : Object.prototype.hasOwnProperty.call(t, e);
4245
4246
  }
4246
4247
  function zr(t, e, n) {
4247
- const s = xn(t);
4248
+ const s = En(t);
4248
4249
  s === 2 ? t.set(e, n) : s === 3 ? t.add(n) : t[e] = n;
4249
4250
  }
4250
4251
  function Bo(t, e) {
@@ -4291,7 +4292,7 @@ function ps(t, e) {
4291
4292
  }
4292
4293
  }
4293
4294
  function Kt(t, e = !1) {
4294
- return Tn(t) || bt(t) || !tt(t) || (xn(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;
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;
4295
4296
  }
4296
4297
  function qo() {
4297
4298
  re(2);
@@ -4690,14 +4691,14 @@ const yr = 10, gr = {
4690
4691
  const b = {};
4691
4692
  c.addEventListener("start", (_) => {
4692
4693
  const l = JSON.parse(_.data);
4693
- b.sessionId = l.sessionId, s((A) => {
4694
- A.tasks.fetchDesign.status = "running";
4694
+ b.sessionId = l.sessionId, s((C) => {
4695
+ C.tasks.fetchDesign.status = "running";
4695
4696
  });
4696
4697
  }), c.addEventListener("pre_codegen", (_) => {
4697
4698
  JSON.parse(
4698
4699
  _.data
4699
- ).message === "Anima model built" && s((A) => {
4700
- A.tasks.fetchDesign.status = "finished", A.tasks.codeGeneration.status = "running", A.tasks.uploadAssets.status = "running";
4700
+ ).message === "Anima model built" && s((C) => {
4701
+ C.tasks.fetchDesign.status = "finished", C.tasks.codeGeneration.status = "running", C.tasks.uploadAssets.status = "running";
4701
4702
  });
4702
4703
  }), c.addEventListener("figma_metadata", (_) => {
4703
4704
  const l = JSON.parse(
@@ -4716,8 +4717,8 @@ const yr = 10, gr = {
4716
4717
  const l = JSON.parse(
4717
4718
  _.data
4718
4719
  );
4719
- l.payload.status === "success" && (b.files = l.payload.files), s((A) => {
4720
- A.tasks.codeGeneration.progress = l.payload.progress, A.tasks.codeGeneration.status = "running";
4720
+ l.payload.status === "success" && (b.files = l.payload.files), s((C) => {
4721
+ C.tasks.codeGeneration.progress = l.payload.progress, C.tasks.codeGeneration.status = "running";
4721
4722
  });
4722
4723
  }), c.addEventListener("codegen_completed", () => {
4723
4724
  s((_) => {
@@ -4739,25 +4740,25 @@ const yr = 10, gr = {
4739
4740
  });
4740
4741
  let m = 0;
4741
4742
  c.addEventListener("error", (_) => Ie(void 0, null, function* () {
4742
- var M, z, Z;
4743
+ var M, z, D;
4743
4744
  console.warn(
4744
4745
  `Experienced error during code generation (attempt ${m + 1} / ${yr})`,
4745
4746
  _
4746
4747
  );
4747
- let l, A = !1;
4748
+ let l, C = !1;
4748
4749
  try {
4749
- _ 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" && (A = !0);
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);
4750
4751
  } catch (P) {
4751
4752
  }
4752
4753
  const I = new Gs({
4753
4754
  name: (z = l == null ? void 0 : l.payload.name) != null ? z : "Unknown error",
4754
- reason: (Z = l == null ? void 0 : l.payload.message) != null ? Z : "Unknown",
4755
+ reason: (D = l == null ? void 0 : l.payload.message) != null ? D : "Unknown",
4755
4756
  status: l == null ? void 0 : l.payload.status,
4756
4757
  detail: l == null ? void 0 : l.payload.detail
4757
4758
  });
4758
4759
  m++;
4759
4760
  let V = !1;
4760
- m > yr ? (console.error("Experienced too many errors, terminating request"), V = !0) : A && (console.error("Experienced unrecoverable error, terminating request"), V = !0), V && (s((P) => {
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) => {
4761
4762
  P.status = "error", P.error = I;
4762
4763
  }), g({
4763
4764
  result: null,
@@ -4765,8 +4766,8 @@ const yr = 10, gr = {
4765
4766
  }));
4766
4767
  })), c.addEventListener("done", (_) => {
4767
4768
  const l = JSON.parse(_.data);
4768
- b.tokenUsage = l.payload.tokenUsage, b.sessionId = l.payload.sessionId, s((A) => {
4769
- A.status = "success", A.result = b;
4769
+ b.tokenUsage = l.payload.tokenUsage, b.sessionId = l.payload.sessionId, s((C) => {
4770
+ C.status = "success", C.result = b;
4770
4771
  }), g({ result: b, error: null });
4771
4772
  });
4772
4773
  });
@@ -4781,14 +4782,14 @@ const yr = 10, gr = {
4781
4782
  assetName: I.name,
4782
4783
  base64: va(M)
4783
4784
  };
4784
- })), A = yield Promise.allSettled(l);
4785
- for (const I of A) {
4785
+ })), C = yield Promise.allSettled(l);
4786
+ for (const I of C) {
4786
4787
  const V = {};
4787
4788
  if (I.status === "fulfilled") {
4788
4789
  const { assetName: M, base64: z } = I.value;
4789
4790
  V[M] = z;
4790
- const Z = _ ? `${_}/${M}` : M;
4791
- m.files[Z] = {
4791
+ const D = _ ? `${_}/${M}` : M;
4792
+ m.files[D] = {
4792
4793
  content: z,
4793
4794
  isBinary: !0
4794
4795
  };
@@ -4887,16 +4888,16 @@ function rc() {
4887
4888
  _ = i({
4888
4889
  inst: { value: m, getSnapshot: b }
4889
4890
  });
4890
- var l = _[0].inst, A = _[1];
4891
+ var l = _[0].inst, C = _[1];
4891
4892
  return c(
4892
4893
  function() {
4893
- l.value = m, l.getSnapshot = b, n(l) && A({ inst: l });
4894
+ l.value = m, l.getSnapshot = b, n(l) && C({ inst: l });
4894
4895
  },
4895
4896
  [g, m, b]
4896
4897
  ), o(
4897
4898
  function() {
4898
- return n(l) && A({ inst: l }), g(function() {
4899
- n(l) && A({ inst: l });
4899
+ return n(l) && C({ inst: l }), g(function() {
4900
+ n(l) && C({ inst: l });
4900
4901
  });
4901
4902
  },
4902
4903
  [g]
@@ -4926,7 +4927,7 @@ function ac() {
4926
4927
  }
4927
4928
  var ic = ac();
4928
4929
  const Hr = 0, Gr = 1, Jr = 2, kr = 3;
4929
- var Er = Object.prototype.hasOwnProperty;
4930
+ var xr = Object.prototype.hasOwnProperty;
4930
4931
  function _s(t, e) {
4931
4932
  var n, s;
4932
4933
  if (t === e) return !0;
@@ -4941,7 +4942,7 @@ function _s(t, e) {
4941
4942
  if (!n || typeof t == "object") {
4942
4943
  s = 0;
4943
4944
  for (n in t)
4944
- if (Er.call(t, n) && ++s && !Er.call(e, n) || !(n in e) || !_s(t[n], e[n])) return !1;
4945
+ if (xr.call(t, n) && ++s && !xr.call(e, n) || !(n in e) || !_s(t[n], e[n])) return !1;
4945
4946
  return Object.keys(e).length === s;
4946
4947
  }
4947
4948
  }
@@ -4970,7 +4971,7 @@ const Re = /* @__PURE__ */ new WeakMap(), Me = () => {
4970
4971
  ];
4971
4972
  };
4972
4973
  let ks = !0;
4973
- const uc = () => ks, [Es, xs] = Xt && window.addEventListener ? [
4974
+ const uc = () => ks, [xs, Es] = Xt && window.addEventListener ? [
4974
4975
  window.addEventListener.bind(window),
4975
4976
  window.removeEventListener.bind(window)
4976
4977
  ] : [
@@ -4979,16 +4980,16 @@ const uc = () => ks, [Es, xs] = Xt && window.addEventListener ? [
4979
4980
  ], dc = () => {
4980
4981
  const t = ws && document.visibilityState;
4981
4982
  return R(t) || t !== "hidden";
4982
- }, lc = (t) => (ws && document.addEventListener("visibilitychange", t), Es("focus", t), () => {
4983
- ws && document.removeEventListener("visibilitychange", t), xs("focus", t);
4983
+ }, lc = (t) => (ws && document.addEventListener("visibilitychange", t), xs("focus", t), () => {
4984
+ ws && document.removeEventListener("visibilitychange", t), Es("focus", t);
4984
4985
  }), fc = (t) => {
4985
4986
  const e = () => {
4986
4987
  ks = !0, t();
4987
4988
  }, n = () => {
4988
4989
  ks = !1;
4989
4990
  };
4990
- return Es("online", e), Es("offline", n), () => {
4991
- xs("online", e), xs("offline", n);
4991
+ return xs("online", e), xs("offline", n), () => {
4992
+ Es("online", e), Es("offline", n);
4992
4993
  };
4993
4994
  }, hc = {
4994
4995
  isOnline: uc,
@@ -4996,7 +4997,7 @@ const uc = () => ks, [Es, xs] = Xt && window.addEventListener ? [
4996
4997
  }, pc = {
4997
4998
  initFocus: lc,
4998
4999
  initReconnect: fc
4999
- }, xr = !Gt.useId, Ht = !Xt || oc, mc = (t) => cc() ? window.requestAnimationFrame(t) : setTimeout(t, 1), Wn = Ht ? ha : pa, Un = typeof navigator != "undefined" && navigator.connection, Sr = !Ht && Un && ([
5000
+ }, Er = !Gt.useId, Ht = !Xt || oc, mc = (t) => cc() ? window.requestAnimationFrame(t) : setTimeout(t, 1), Wn = Ht ? ha : pa, Un = typeof navigator != "undefined" && navigator.connection, Sr = !Ht && Un && ([
5000
5001
  "slow-2g",
5001
5002
  "2g"
5002
5003
  ].includes(Un.effectiveType) || Un.saveData), sn = /* @__PURE__ */ new WeakMap(), Vn = (t, e) => bs.prototype.toString.call(t) === `[object ${e}]`;
@@ -5060,16 +5061,16 @@ function Qr(...t) {
5060
5061
  return Ie(this, null, function* () {
5061
5062
  const [g] = js(k);
5062
5063
  if (!g) return;
5063
- const [b, m] = Yr(e, g), [_, l, A, I] = Re.get(e), V = () => {
5064
+ const [b, m] = Yr(e, g), [_, l, C, I] = Re.get(e), V = () => {
5064
5065
  const le = _[g];
5065
- return (be(a.revalidate) ? a.revalidate(b().data, k) : a.revalidate !== !1) && (delete A[g], delete I[g], le && le[0]) ? le[0](Jr).then(() => b().data) : b().data;
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;
5066
5067
  };
5067
5068
  if (t.length < 3)
5068
5069
  return V();
5069
5070
  let M = s, z;
5070
- const Z = Os();
5071
+ const D = Os();
5071
5072
  l[g] = [
5072
- Z,
5073
+ D,
5073
5074
  0
5074
5075
  ];
5075
5076
  const P = !R(c), Se = b(), F = Se.data, st = Se._c, Ve = R(st) ? F : st;
@@ -5085,7 +5086,7 @@ function Qr(...t) {
5085
5086
  if (M && Xr(M))
5086
5087
  if (M = yield M.catch((le) => {
5087
5088
  z = le;
5088
- }), Z !== l[g][0]) {
5089
+ }), D !== l[g][0]) {
5089
5090
  if (z) throw z;
5090
5091
  return M;
5091
5092
  } else z && P && u(z) && (i = !0, m({
@@ -5192,16 +5193,16 @@ const Or = (t, e) => {
5192
5193
  },
5193
5194
  // use web preset by default
5194
5195
  hc
5195
- ), Ec = (t, e) => {
5196
+ ), xc = (t, e) => {
5196
5197
  const n = Ue(t, e);
5197
5198
  if (e) {
5198
5199
  const { use: s, fallback: r } = t, { use: a, fallback: i } = e;
5199
5200
  s && a && (n.use = s.concat(a)), r && i && (n.fallback = Ue(r, i));
5200
5201
  }
5201
5202
  return n;
5202
- }, xc = fa({}), Sc = "$inf$", ta = Xt && window.__SWR_DEVTOOLS_USE__, Oc = ta ? window.__SWR_DEVTOOLS_USE__ : [], Tc = () => {
5203
+ }, Ec = fa({}), Sc = "$inf$", ta = Xt && window.__SWR_DEVTOOLS_USE__, Oc = ta ? window.__SWR_DEVTOOLS_USE__ : [], Tc = () => {
5203
5204
  ta && (window.__SWR_DEVTOOLS_REACT__ = Gt);
5204
- }, Cc = (t) => be(t[1]) ? [
5205
+ }, Ac = (t) => be(t[1]) ? [
5205
5206
  t[0],
5206
5207
  t[1],
5207
5208
  t[2] || {}
@@ -5209,14 +5210,14 @@ const Or = (t, e) => {
5209
5210
  t[0],
5210
5211
  null,
5211
5212
  (t[1] === null ? t[2] : t[1]) || {}
5212
- ], Ac = () => Ue(kc, ma(xc)), Nc = (t) => (e, n, s) => t(e, n && ((...a) => {
5213
+ ], Cc = () => Ue(kc, ma(Ec)), Nc = (t) => (e, n, s) => t(e, n && ((...a) => {
5213
5214
  const [i] = js(e), [, , , o] = Re.get(ea);
5214
5215
  if (i.startsWith(Sc))
5215
5216
  return n(...a);
5216
5217
  const c = o[i];
5217
5218
  return R(c) ? n(...a) : (delete o[i], c);
5218
5219
  }), s), Rc = Oc.concat(Nc), Pc = (t) => function(...n) {
5219
- const s = Ac(), [r, a, i] = Cc(n), o = Ec(s, i);
5220
+ const s = Cc(), [r, a, i] = Ac(n), o = xc(s, i);
5220
5221
  let c = t;
5221
5222
  const { use: u } = o, h = (u || []).concat(Rc);
5222
5223
  for (let p = h.length; p--; )
@@ -5252,7 +5253,7 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
5252
5253
  }), Kn = {
5253
5254
  dedupe: !0
5254
5255
  }, jc = (t, e, n) => {
5255
- 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, A] = js(t), I = Be(!1), V = Be(!1), M = Be(l), z = Be(e), Z = Be(n), P = () => Z.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) => {
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) => {
5256
5257
  for (const G in rt) {
5257
5258
  const K = G;
5258
5259
  if (K === "data") {
@@ -5290,13 +5291,13 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
5290
5291
  s,
5291
5292
  l
5292
5293
  ]
5293
- ), 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, Cn = Be(ze), en = k ? R(it) ? R(Cn.current) ? ze : Cn.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(
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(
5294
5295
  ($) => Ie(void 0, null, function* () {
5295
5296
  const L = z.current;
5296
5297
  if (!l || !L || V.current || P().isPaused())
5297
5298
  return !1;
5298
5299
  let G, K, fe = !0;
5299
- const ot = $ || {}, H = !m[l] || !ot.dedupe, Y = () => xr ? !V.current && l === M.current && I.current : l === M.current, Oe = {
5300
+ const ot = $ || {}, H = !m[l] || !ot.dedupe, Y = () => Er ? !V.current && l === M.current && I.current : l === M.current, Oe = {
5300
5301
  isValidating: !1,
5301
5302
  isLoading: !1
5302
5303
  }, Ws = () => {
@@ -5312,7 +5313,7 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
5312
5313
  if (H && (st(Vs), n.loadingTimeout && R(F().data) && setTimeout(() => {
5313
5314
  fe && Y() && P().onLoadingSlow(l, n);
5314
5315
  }, n.loadingTimeout), m[l] = [
5315
- L(A),
5316
+ L(C),
5316
5317
  Os()
5317
5318
  ]), [G, K] = m[l], G = yield G, H && setTimeout(Us, n.dedupingInterval), !m[l] || m[l][1] !== K)
5318
5319
  return H && Y() && P().onDiscarded(l), !1;
@@ -5327,8 +5328,8 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
5327
5328
  Oe.data = r(Te, G) ? Te : G, H && Y() && P().onSuccess(G, l, n);
5328
5329
  } catch (ue) {
5329
5330
  Us();
5330
- const Te = P(), { shouldRetryOnError: An } = Te;
5331
- Te.isPaused() || (Oe.error = ue, H && Y() && (Te.onError(ue, l, Te), (An === !0 || be(An) && An(ue)) && (!P().revalidateOnFocus || !P().revalidateOnReconnect || Se()) && Te.onErrorRetry(ue, l, Te, (aa) => {
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) => {
5332
5333
  const Nn = g[l];
5333
5334
  Nn && Nn[0] && Nn[0](kr, aa);
5334
5335
  }, {
@@ -5360,7 +5361,7 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
5360
5361
  []
5361
5362
  );
5362
5363
  if (Wn(() => {
5363
- z.current = e, Z.current = n, R(it) || (Cn.current = it);
5364
+ z.current = e, D.current = n, R(it) || (An.current = it);
5364
5365
  }), Wn(() => {
5365
5366
  if (!l) return;
5366
5367
  const $ = wt.bind(ee, Kn);
@@ -5380,7 +5381,7 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
5380
5381
  }
5381
5382
  });
5382
5383
  return V.current = !1, M.current = l, I.current = !0, st({
5383
- _k: A
5384
+ _k: C
5384
5385
  }), Ls && (R(ze) || Ht ? $() : mc($)), () => {
5385
5386
  V.current = !0, K();
5386
5387
  };
@@ -5404,9 +5405,9 @@ const zn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
5404
5405
  p,
5405
5406
  l
5406
5407
  ]), ga(en), a && R(ze) && l) {
5407
- if (!xr && Ht)
5408
+ if (!Er && Ht)
5408
5409
  throw new Error("Fallback data is required when using Suspense in SSR.");
5409
- z.current = e, Z.current = n, V.current = !1;
5410
+ z.current = e, D.current = n, V.current = !1;
5410
5411
  const $ = _[l];
5411
5412
  if (!R($)) {
5412
5413
  const L = Fs($);