@animaapp/anima-sdk 0.3.5 → 0.3.7

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
@@ -1,131 +1,131 @@
1
- var vn = Object.defineProperty, _n = Object.defineProperties;
2
- var bn = Object.getOwnPropertyDescriptors;
1
+ var vr = Object.defineProperty, _r = Object.defineProperties;
2
+ var br = Object.getOwnPropertyDescriptors;
3
3
  var Rt = Object.getOwnPropertySymbols;
4
- var wn = Object.prototype.hasOwnProperty, xn = Object.prototype.propertyIsEnumerable;
5
- var Pt = (n) => {
6
- throw TypeError(n);
4
+ var wr = Object.prototype.hasOwnProperty, xr = Object.prototype.propertyIsEnumerable;
5
+ var Pt = (r) => {
6
+ throw TypeError(r);
7
7
  };
8
- var Mt = (n, e, t) => e in n ? vn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, d = (n, e) => {
8
+ var Mt = (r, e, t) => e in r ? vr(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, d = (r, e) => {
9
9
  for (var t in e || (e = {}))
10
- wn.call(e, t) && Mt(n, t, e[t]);
10
+ wr.call(e, t) && Mt(r, t, e[t]);
11
11
  if (Rt)
12
12
  for (var t of Rt(e))
13
- xn.call(e, t) && Mt(n, t, e[t]);
14
- return n;
15
- }, y = (n, e) => _n(n, bn(e));
16
- var lt = (n, e, t) => e.has(n) || Pt("Cannot " + t);
17
- var H = (n, e, t) => (lt(n, e, "read from private field"), t ? t.call(n) : e.get(n)), Xe = (n, e, t) => e.has(n) ? Pt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), ft = (n, e, t, s) => (lt(n, e, "write to private field"), s ? s.call(n, t) : e.set(n, t), t), $t = (n, e, t) => (lt(n, e, "access private method"), t);
18
- var M = (n, e, t) => new Promise((s, r) => {
13
+ xr.call(e, t) && Mt(r, t, e[t]);
14
+ return r;
15
+ }, y = (r, e) => _r(r, br(e));
16
+ var lt = (r, e, t) => e.has(r) || Pt("Cannot " + t);
17
+ var H = (r, e, t) => (lt(r, e, "read from private field"), t ? t.call(r) : e.get(r)), Xe = (r, e, t) => e.has(r) ? Pt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), ft = (r, e, t, s) => (lt(r, e, "write to private field"), s ? s.call(r, t) : e.set(r, t), t), $t = (r, e, t) => (lt(r, e, "access private method"), t);
18
+ var M = (r, e, t) => new Promise((s, n) => {
19
19
  var a = (c) => {
20
20
  try {
21
21
  o(t.next(c));
22
22
  } catch (u) {
23
- r(u);
23
+ n(u);
24
24
  }
25
25
  }, i = (c) => {
26
26
  try {
27
27
  o(t.throw(c));
28
28
  } catch (u) {
29
- r(u);
29
+ n(u);
30
30
  }
31
31
  }, o = (c) => c.done ? s(c.value) : Promise.resolve(c.value).then(a, i);
32
- o((t = t.apply(n, e)).next());
32
+ o((t = t.apply(r, e)).next());
33
33
  });
34
34
  class ue extends Error {
35
35
  constructor({
36
36
  name: e,
37
37
  reason: t,
38
38
  status: s,
39
- detail: r
39
+ detail: n
40
40
  }) {
41
- super(), this.name = e, this.message = t, this.detail = r, this.status = s;
41
+ super(), this.name = e, this.message = t, this.detail = n, this.status = s;
42
42
  }
43
43
  }
44
- const Gt = "Figma Token Issue";
45
- class kn extends Error {
44
+ const Kt = "Figma Token Issue";
45
+ class kr extends Error {
46
46
  constructor({
47
47
  fileKey: e,
48
48
  reason: t,
49
49
  cause: s
50
50
  }) {
51
- super(Gt), this.fileKey = e, this.reason = t, this.cause = s;
51
+ super(Kt), this.fileKey = e, this.reason = t, this.cause = s;
52
52
  }
53
53
  }
54
- const Kt = "Rate Limit Exceeded";
55
- class Tn extends Error {
54
+ const Xt = "Rate Limit Exceeded";
55
+ class Tr extends Error {
56
56
  constructor({ fileKey: e, cause: t }) {
57
- super(Kt), this.fileKey = e, this.cause = t;
57
+ super(Xt), this.fileKey = e, this.cause = t;
58
58
  }
59
59
  }
60
- const Xt = "Not Found";
61
- class Sn extends Error {
60
+ const Yt = "Not Found";
61
+ class Sr extends Error {
62
62
  constructor({ fileKey: e, cause: t }) {
63
- super(Xt), this.fileKey = e, this.cause = t;
63
+ super(Yt), this.fileKey = e, this.cause = t;
64
64
  }
65
65
  }
66
- const En = (n) => n.message === Xt, Yt = "Unknown Figma API Exception";
67
- class An extends Error {
66
+ const Er = (r) => r.message === Yt, Qt = "Unknown Figma API Exception";
67
+ class Ar extends Error {
68
68
  constructor({ fileKey: e, cause: t }) {
69
- super(Yt), this.name = "UnknownFigmaApiException", this.fileKey = e, this.cause = t;
69
+ super(Qt), this.name = "UnknownFigmaApiException", this.fileKey = e, this.cause = t;
70
70
  }
71
71
  }
72
- const Lr = (n) => n.message === Yt, On = (n) => n.message === Kt, Cn = (n) => [Gt, ...[
72
+ const Un = (r) => r.message === Qt, Or = (r) => r.message === Xt, Cr = (r) => [Kt, ...[
73
73
  "Invalid Figma token",
74
74
  "Figma token expired"
75
75
  ]].includes(
76
- n.message
77
- ), Qt = (n, e) => {
76
+ r.message
77
+ ), er = (r, e) => {
78
78
  var s;
79
- if (((s = n == null ? void 0 : n.cause) == null ? void 0 : s.message) === "Fetch Error") {
80
- const { err: r, status: a } = n.cause.body;
79
+ if (((s = r == null ? void 0 : r.cause) == null ? void 0 : s.message) === "Fetch Error") {
80
+ const { err: n, status: a } = r.cause.body;
81
81
  if (a === 403)
82
- return new kn({
82
+ return new kr({
83
83
  fileKey: e,
84
- reason: r,
85
- cause: n
84
+ reason: n,
85
+ cause: r
86
86
  });
87
87
  if (a === 429)
88
- return new Tn({ fileKey: e, cause: n });
88
+ return new Tr({ fileKey: e, cause: r });
89
89
  if (a === 404)
90
- return new Sn({ fileKey: e, cause: n });
90
+ return new Sr({ fileKey: e, cause: r });
91
91
  }
92
- return new An({ fileKey: e, cause: n });
93
- }, Ur = (n) => En(n) ? "NotFound" : On(n) ? "RateLimitExceeded" : Cn(n) ? "FigmaTokenIssue" : "UnknownFigmaApiException";
94
- var Nn = Object.defineProperty, In = Object.defineProperties, jn = Object.getOwnPropertyDescriptors, Ft = Object.getOwnPropertySymbols, Zn = Object.prototype.hasOwnProperty, Rn = Object.prototype.propertyIsEnumerable, Vt = (n, e) => (e = Symbol[n]) ? e : Symbol.for("Symbol." + n), en = (n) => {
95
- throw TypeError(n);
96
- }, Dt = (n, e, t) => e in n ? Nn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, U = (n, e) => {
92
+ return new Ar({ fileKey: e, cause: r });
93
+ }, zn = (r) => Er(r) ? "NotFound" : Or(r) ? "RateLimitExceeded" : Cr(r) ? "FigmaTokenIssue" : "UnknownFigmaApiException";
94
+ var Nr = Object.defineProperty, Ir = Object.defineProperties, jr = Object.getOwnPropertyDescriptors, Ft = Object.getOwnPropertySymbols, Zr = Object.prototype.hasOwnProperty, Rr = Object.prototype.propertyIsEnumerable, Vt = (r, e) => (e = Symbol[r]) ? e : Symbol.for("Symbol." + r), tr = (r) => {
95
+ throw TypeError(r);
96
+ }, Dt = (r, e, t) => e in r ? Nr(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, U = (r, e) => {
97
97
  for (var t in e || (e = {}))
98
- Zn.call(e, t) && Dt(n, t, e[t]);
98
+ Zr.call(e, t) && Dt(r, t, e[t]);
99
99
  if (Ft)
100
100
  for (var t of Ft(e))
101
- Rn.call(e, t) && Dt(n, t, e[t]);
102
- return n;
103
- }, Nt = (n, e) => In(n, jn(e)), It = (n, e, t) => e.has(n) || en("Cannot " + t), T = (n, e, t) => (It(n, e, "read from private field"), t ? t.call(n) : e.get(n)), W = (n, e, t) => e.has(n) ? en("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), j = (n, e, t, s) => (It(n, e, "write to private field"), e.set(n, t), t), ee = (n, e, t) => (It(n, e, "access private method"), t), A = (n, e, t) => new Promise((s, r) => {
101
+ Rr.call(e, t) && Dt(r, t, e[t]);
102
+ return r;
103
+ }, Nt = (r, e) => Ir(r, jr(e)), It = (r, e, t) => e.has(r) || tr("Cannot " + t), T = (r, e, t) => (It(r, e, "read from private field"), t ? t.call(r) : e.get(r)), W = (r, e, t) => e.has(r) ? tr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), j = (r, e, t, s) => (It(r, e, "write to private field"), e.set(r, t), t), ee = (r, e, t) => (It(r, e, "access private method"), t), A = (r, e, t) => new Promise((s, n) => {
104
104
  var a = (c) => {
105
105
  try {
106
106
  o(t.next(c));
107
107
  } catch (u) {
108
- r(u);
108
+ n(u);
109
109
  }
110
110
  }, i = (c) => {
111
111
  try {
112
112
  o(t.throw(c));
113
113
  } catch (u) {
114
- r(u);
114
+ n(u);
115
115
  }
116
116
  }, o = (c) => c.done ? s(c.value) : Promise.resolve(c.value).then(a, i);
117
- o((t = t.apply(n, e)).next());
118
- }), Mn = (n, e, t) => (e = n[Vt("asyncIterator")]) ? e.call(n) : (n = n[Vt("iterator")](), e = {}, t = (s, r) => (r = n[s]) && (e[s] = (a) => new Promise((i, o, c) => (a = r.call(n, a), c = a.done, Promise.resolve(a.value).then((u) => i({ value: u, done: c }), o)))), t("next"), t("return"), e), Pn = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};
119
- function $n(n) {
120
- return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
117
+ o((t = t.apply(r, e)).next());
118
+ }), Mr = (r, e, t) => (e = r[Vt("asyncIterator")]) ? e.call(r) : (r = r[Vt("iterator")](), e = {}, t = (s, n) => (n = r[s]) && (e[s] = (a) => new Promise((i, o, c) => (a = n.call(r, a), c = a.done, Promise.resolve(a.value).then((u) => i({ value: u, done: c }), o)))), t("next"), t("return"), e), Pr = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};
119
+ function $r(r) {
120
+ return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
121
121
  }
122
- var gt = { exports: {} }, Fn = gt.exports, Lt;
123
- function Vn() {
124
- return Lt || (Lt = 1, function(n, e) {
122
+ var gt = { exports: {} }, Fr = gt.exports, Lt;
123
+ function Vr() {
124
+ return Lt || (Lt = 1, function(r, e) {
125
125
  (function(t, s) {
126
- n.exports = s();
127
- })(Fn, function() {
128
- var t = typeof Promise == "function", s = typeof self == "object" ? self : Pn, r = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", c = typeof WeakSet != "undefined", u = typeof DataView != "undefined", f = r && typeof Symbol.iterator != "undefined", _ = r && typeof Symbol.toStringTag != "undefined", I = i && typeof Set.prototype.entries == "function", O = a && typeof Map.prototype.entries == "function", C = I && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), R = O && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), B = f && typeof Array.prototype[Symbol.iterator] == "function", re = B && Object.getPrototypeOf([][Symbol.iterator]()), de = f && typeof String.prototype[Symbol.iterator] == "function", V = de && Object.getPrototypeOf(""[Symbol.iterator]()), X = 8, q = -1;
126
+ r.exports = s();
127
+ })(Fr, function() {
128
+ var t = typeof Promise == "function", s = typeof self == "object" ? self : Pr, n = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", c = typeof WeakSet != "undefined", u = typeof DataView != "undefined", f = n && typeof Symbol.iterator != "undefined", g = n && typeof Symbol.toStringTag != "undefined", O = i && typeof Set.prototype.entries == "function", C = a && typeof Map.prototype.entries == "function", N = O && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), R = C && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), B = f && typeof Array.prototype[Symbol.iterator] == "function", ne = B && Object.getPrototypeOf([][Symbol.iterator]()), de = f && typeof String.prototype[Symbol.iterator] == "function", V = de && Object.getPrototypeOf(""[Symbol.iterator]()), X = 8, q = -1;
129
129
  function Ce(E) {
130
130
  var k = typeof E;
131
131
  if (k !== "object")
@@ -134,7 +134,7 @@ function Vn() {
134
134
  return "null";
135
135
  if (E === s)
136
136
  return "global";
137
- if (Array.isArray(E) && (_ === !1 || !(Symbol.toStringTag in E)))
137
+ if (Array.isArray(E) && (g === !1 || !(Symbol.toStringTag in E)))
138
138
  return "Array";
139
139
  if (typeof window == "object" && window !== null) {
140
140
  if (typeof window.location == "object" && E === window.location)
@@ -156,26 +156,26 @@ function Vn() {
156
156
  return "HTMLTableHeaderCellElement";
157
157
  }
158
158
  }
159
- var ut = _ && E[Symbol.toStringTag];
159
+ var ut = g && E[Symbol.toStringTag];
160
160
  if (typeof ut == "string")
161
161
  return ut;
162
162
  var D = Object.getPrototypeOf(E);
163
- return D === RegExp.prototype ? "RegExp" : D === Date.prototype ? "Date" : t && D === Promise.prototype ? "Promise" : i && D === Set.prototype ? "Set" : a && D === Map.prototype ? "Map" : c && D === WeakSet.prototype ? "WeakSet" : o && D === WeakMap.prototype ? "WeakMap" : u && D === DataView.prototype ? "DataView" : a && D === R ? "Map Iterator" : i && D === C ? "Set Iterator" : B && D === re ? "Array Iterator" : de && D === V ? "String Iterator" : D === null ? "Object" : Object.prototype.toString.call(E).slice(X, q);
163
+ return D === RegExp.prototype ? "RegExp" : D === Date.prototype ? "Date" : t && D === Promise.prototype ? "Promise" : i && D === Set.prototype ? "Set" : a && D === Map.prototype ? "Map" : c && D === WeakSet.prototype ? "WeakSet" : o && D === WeakMap.prototype ? "WeakMap" : u && D === DataView.prototype ? "DataView" : a && D === R ? "Map Iterator" : i && D === N ? "Set Iterator" : B && D === ne ? "Array Iterator" : de && D === V ? "String Iterator" : D === null ? "Object" : Object.prototype.toString.call(E).slice(X, q);
164
164
  }
165
165
  return Ce;
166
166
  });
167
167
  }(gt)), gt.exports;
168
168
  }
169
- var Dn = Vn();
170
- const Ln = /* @__PURE__ */ $n(Dn), jt = typeof Buffer != "undefined", Un = jt && typeof Buffer.from != "undefined", zn = jt ? (
169
+ var Dr = Vr();
170
+ const Lr = /* @__PURE__ */ $r(Dr), jt = typeof Buffer != "undefined", Ur = jt && typeof Buffer.from != "undefined", zr = jt ? (
171
171
  /**
172
172
  * is value is Buffer?
173
173
  *
174
174
  * @param {*} value
175
175
  * @return {boolean}
176
176
  */
177
- function(n) {
178
- return Buffer.isBuffer(n);
177
+ function(r) {
178
+ return Buffer.isBuffer(r);
179
179
  }
180
180
  ) : (
181
181
  /**
@@ -188,15 +188,15 @@ const Ln = /* @__PURE__ */ $n(Dn), jt = typeof Buffer != "undefined", Un = jt &&
188
188
  function() {
189
189
  return !1;
190
190
  }
191
- ), Wn = Un ? (
191
+ ), Wr = Ur ? (
192
192
  /**
193
193
  * copy Buffer
194
194
  *
195
195
  * @param {Buffer} value
196
196
  * @return {Buffer}
197
197
  */
198
- function(n) {
199
- return Buffer.from(n);
198
+ function(r) {
199
+ return Buffer.from(r);
200
200
  }
201
201
  ) : jt ? (
202
202
  /**
@@ -207,8 +207,8 @@ const Ln = /* @__PURE__ */ $n(Dn), jt = typeof Buffer != "undefined", Un = jt &&
207
207
  * @param {Buffer} value
208
208
  * @return {Buffer}
209
209
  */
210
- function(n) {
211
- return new Buffer(n);
210
+ function(r) {
211
+ return new Buffer(r);
212
212
  }
213
213
  ) : (
214
214
  /**
@@ -219,86 +219,86 @@ const Ln = /* @__PURE__ */ $n(Dn), jt = typeof Buffer != "undefined", Un = jt &&
219
219
  * @param {*}
220
220
  * @return {*}
221
221
  */
222
- function(n) {
223
- return n;
222
+ function(r) {
223
+ return r;
224
224
  }
225
225
  );
226
- function Se(n) {
227
- return zn(n) ? "Buffer" : Ln(n);
226
+ function Se(r) {
227
+ return zr(r) ? "Buffer" : Lr(r);
228
228
  }
229
- const Bn = /* @__PURE__ */ new Set([
229
+ const Br = /* @__PURE__ */ new Set([
230
230
  "Arguments",
231
231
  "Array",
232
232
  "Map",
233
233
  "Object",
234
234
  "Set"
235
235
  ]);
236
- function qn(n, e, t = null) {
237
- switch (t || Se(n)) {
236
+ function qr(r, e, t = null) {
237
+ switch (t || Se(r)) {
238
238
  case "Arguments":
239
239
  case "Array":
240
240
  case "Object":
241
- return n[e];
241
+ return r[e];
242
242
  case "Map":
243
- return n.get(e);
243
+ return r.get(e);
244
244
  case "Set":
245
245
  return e;
246
246
  }
247
247
  }
248
- function vt(n) {
249
- return Bn.has(n);
248
+ function vt(r) {
249
+ return Br.has(r);
250
250
  }
251
- function Ut(n, e, t, s = null) {
252
- switch (s || Se(n)) {
251
+ function Ut(r, e, t, s = null) {
252
+ switch (s || Se(r)) {
253
253
  case "Arguments":
254
254
  case "Array":
255
255
  case "Object":
256
- n[e] = t;
256
+ r[e] = t;
257
257
  break;
258
258
  case "Map":
259
- n.set(e, t);
259
+ r.set(e, t);
260
260
  break;
261
261
  case "Set":
262
- n.add(t);
262
+ r.add(t);
263
263
  break;
264
264
  }
265
- return n;
265
+ return r;
266
266
  }
267
- const Hn = typeof globalThis != "undefined" && globalThis !== null && globalThis.Object === Object && globalThis, Jn = typeof global != "undefined" && global !== null && global.Object === Object && global, Gn = typeof self != "undefined" && self !== null && self.Object === Object && self, ht = Hn || Jn || Gn || Function("return this")();
268
- function Kn(n) {
269
- return n.slice(0);
267
+ const Hr = typeof globalThis != "undefined" && globalThis !== null && globalThis.Object === Object && globalThis, Jr = typeof global != "undefined" && global !== null && global.Object === Object && global, Gr = typeof self != "undefined" && self !== null && self.Object === Object && self, ht = Hr || Jr || Gr || Function("return this")();
268
+ function Kr(r) {
269
+ return r.slice(0);
270
270
  }
271
- function Xn(n) {
272
- return new Boolean(n.valueOf());
271
+ function Xr(r) {
272
+ return new Boolean(r.valueOf());
273
273
  }
274
- function Yn(n) {
275
- return new DataView(n.buffer);
274
+ function Yr(r) {
275
+ return new DataView(r.buffer);
276
276
  }
277
- function Qn(n) {
278
- return Wn(n);
277
+ function Qr(r) {
278
+ return Wr(r);
279
279
  }
280
- function es(n) {
281
- return new Date(n.getTime());
280
+ function es(r) {
281
+ return new Date(r.getTime());
282
282
  }
283
- function ts(n) {
284
- return new Number(n);
283
+ function ts(r) {
284
+ return new Number(r);
285
285
  }
286
- function ns(n) {
287
- return new RegExp(n.source, n.flags);
286
+ function rs(r) {
287
+ return new RegExp(r.source, r.flags);
288
288
  }
289
- function ss(n) {
290
- return new String(n);
289
+ function ss(r) {
290
+ return new String(r);
291
291
  }
292
- function ae(n, e) {
293
- return ht[e].from ? ht[e].from(n) : new ht[e](n);
292
+ function ae(r, e) {
293
+ return ht[e].from ? ht[e].from(r) : new ht[e](r);
294
294
  }
295
- function P(n) {
296
- return n;
295
+ function P(r) {
296
+ return r;
297
297
  }
298
298
  function zt() {
299
299
  return [];
300
300
  }
301
- function rs() {
301
+ function ns() {
302
302
  return /* @__PURE__ */ new Map();
303
303
  }
304
304
  function as() {
@@ -309,13 +309,13 @@ function is() {
309
309
  }
310
310
  const os = /* @__PURE__ */ new Map([
311
311
  // deep copy
312
- ["ArrayBuffer", Kn],
313
- ["Boolean", Xn],
314
- ["Buffer", Qn],
315
- ["DataView", Yn],
312
+ ["ArrayBuffer", Kr],
313
+ ["Boolean", Xr],
314
+ ["Buffer", Qr],
315
+ ["DataView", Yr],
316
316
  ["Date", es],
317
317
  ["Number", ts],
318
- ["RegExp", ns],
318
+ ["RegExp", rs],
319
319
  ["String", ss],
320
320
  // typed arrays
321
321
  // TODO: pass bound function
@@ -350,7 +350,7 @@ const os = /* @__PURE__ */ new Map([
350
350
  // NOTE: return empty value, because recursively copy later.
351
351
  ["Arguments", zt],
352
352
  ["Array", zt],
353
- ["Map", rs],
353
+ ["Map", ns],
354
354
  ["Object", as],
355
355
  ["Set", is]
356
356
  // NOTE: type-detect returns following types
@@ -366,17 +366,17 @@ const os = /* @__PURE__ */ new Map([
366
366
  ]);
367
367
  function cs() {
368
368
  }
369
- function _t(n, e = null, t = cs) {
369
+ function _t(r, e = null, t = cs) {
370
370
  arguments.length === 2 && typeof e == "function" && (t = e, e = null);
371
- const s = e || Se(n), r = os.get(s);
371
+ const s = e || Se(r), n = os.get(s);
372
372
  if (s === "Object") {
373
- const a = t(n, s);
373
+ const a = t(r, s);
374
374
  if (a !== void 0)
375
375
  return a;
376
376
  }
377
- return r ? r(n, s) : n;
377
+ return n ? n(r, s) : r;
378
378
  }
379
- function Ne(n, e = {}) {
379
+ function Ne(r, e = {}) {
380
380
  typeof e == "function" && (e = {
381
381
  customizer: e
382
382
  });
@@ -385,42 +385,42 @@ function Ne(n, e = {}) {
385
385
  customizer: t
386
386
  // TODO: max depth
387
387
  // depth = Infinity,
388
- } = e, s = Se(n);
388
+ } = e, s = Se(r);
389
389
  if (!vt(s))
390
- return bt(n, null, null, null);
391
- const r = _t(n, s, t), a = new WeakMap([[n, r]]), i = new WeakSet([n]);
392
- return bt(n, r, a, i);
390
+ return bt(r, null, null, null);
391
+ const n = _t(r, s, t), a = new WeakMap([[r, n]]), i = new WeakSet([r]);
392
+ return bt(r, n, a, i);
393
393
  }
394
- function bt(n, e, t, s, r) {
395
- const a = Se(n), i = _t(n, a);
394
+ function bt(r, e, t, s, n) {
395
+ const a = Se(r), i = _t(r, a);
396
396
  if (!vt(a))
397
397
  return i;
398
398
  let o;
399
399
  switch (a) {
400
400
  case "Arguments":
401
401
  case "Array":
402
- o = Object.keys(n);
402
+ o = Object.keys(r);
403
403
  break;
404
404
  case "Object":
405
- o = Object.keys(n), o.push(...Object.getOwnPropertySymbols(n));
405
+ o = Object.keys(r), o.push(...Object.getOwnPropertySymbols(r));
406
406
  break;
407
407
  case "Map":
408
408
  case "Set":
409
- o = n.keys();
409
+ o = r.keys();
410
410
  break;
411
411
  }
412
412
  for (let c of o) {
413
- const u = qn(n, c, a);
413
+ const u = qr(r, c, a);
414
414
  if (s.has(u))
415
415
  Ut(e, c, t.get(u), a);
416
416
  else {
417
- const f = Se(u), _ = _t(u, f);
418
- vt(f) && (t.set(u, _), s.add(u)), Ut(
417
+ const f = Se(u), g = _t(u, f);
418
+ vt(f) && (t.set(u, g), s.add(u)), Ut(
419
419
  e,
420
420
  c,
421
421
  bt(
422
422
  u,
423
- _,
423
+ g,
424
424
  t,
425
425
  s
426
426
  ),
@@ -430,8 +430,8 @@ function bt(n, e, t, s, r) {
430
430
  }
431
431
  return e;
432
432
  }
433
- const ds = (n) => new Promise((e) => setTimeout(e, n));
434
- var Ye, ye, Qe, wt, tn;
433
+ const ds = (r) => new Promise((e) => setTimeout(e, r));
434
+ var Ye, ye, Qe, wt, rr;
435
435
  class us {
436
436
  constructor({ maxAttempts: e = 3, func: t }) {
437
437
  W(this, wt), W(this, Ye), W(this, ye), W(this, Qe), j(this, Ye, e), j(this, Qe, t), j(this, ye, 0);
@@ -443,23 +443,23 @@ class us {
443
443
  } catch (e) {
444
444
  if (j(this, ye, T(this, ye) + 1), T(this, ye) > T(this, Ye))
445
445
  throw console.error("Max attempts reached"), e;
446
- const t = ee(this, wt, tn).call(this);
446
+ const t = ee(this, wt, rr).call(this);
447
447
  return yield ds(t), yield this.run();
448
448
  }
449
449
  });
450
450
  }
451
451
  }
452
- Ye = /* @__PURE__ */ new WeakMap(), ye = /* @__PURE__ */ new WeakMap(), Qe = /* @__PURE__ */ new WeakMap(), wt = /* @__PURE__ */ new WeakSet(), tn = function() {
452
+ Ye = /* @__PURE__ */ new WeakMap(), ye = /* @__PURE__ */ new WeakMap(), Qe = /* @__PURE__ */ new WeakMap(), wt = /* @__PURE__ */ new WeakSet(), rr = function() {
453
453
  return T(this, ye) * 1e3 * 1.5;
454
454
  };
455
455
  function ls() {
456
456
  return typeof CompressionStream != "undefined";
457
457
  }
458
- function fs(n) {
458
+ function fs(r) {
459
459
  return A(this, null, function* () {
460
- const e = new Blob([n]).stream().pipeThrough(new CompressionStream("gzip")), t = [];
460
+ const e = new Blob([r]).stream().pipeThrough(new CompressionStream("gzip")), t = [];
461
461
  try {
462
- for (var s = Mn(e), r, a, i; r = !(a = yield s.next()).done; r = !1) {
462
+ for (var s = Mr(e), n, a, i; n = !(a = yield s.next()).done; n = !1) {
463
463
  const o = a.value;
464
464
  t.push(o);
465
465
  }
@@ -467,7 +467,7 @@ function fs(n) {
467
467
  i = [o];
468
468
  } finally {
469
469
  try {
470
- r && (a = s.return) && (yield a.call(s));
470
+ n && (a = s.return) && (yield a.call(s));
471
471
  } finally {
472
472
  if (i)
473
473
  throw i[0];
@@ -476,16 +476,16 @@ function fs(n) {
476
476
  return yield hs(t);
477
477
  });
478
478
  }
479
- function hs(n) {
479
+ function hs(r) {
480
480
  return A(this, null, function* () {
481
- const e = yield new Blob(n).arrayBuffer();
481
+ const e = yield new Blob(r).arrayBuffer();
482
482
  return new Uint8Array(e);
483
483
  });
484
484
  }
485
485
  class ps extends Error {
486
- constructor({ resource: e, api: t, args: s, cause: r }) {
487
- if (super(`API Error on resource "${e}" at api "${t}"`), this.causeProperties = {}, this.name = "API Error", this.resource = e, this.api = t, this.cause = r, this.args = s, r instanceof Error)
488
- for (const [i, o] of Object.entries(r))
486
+ constructor({ resource: e, api: t, args: s, cause: n }) {
487
+ if (super(`API Error on resource "${e}" at api "${t}"`), this.causeProperties = {}, this.name = "API Error", this.resource = e, this.api = t, this.cause = n, this.args = s, n instanceof Error)
488
+ for (const [i, o] of Object.entries(n))
489
489
  if (typeof Headers != "undefined" && o instanceof Headers) {
490
490
  const c = {};
491
491
  o.forEach((u, f) => {
@@ -502,11 +502,11 @@ class Wt extends Error {
502
502
  url: e,
503
503
  method: t,
504
504
  statusCode: s,
505
- requestHeaders: r,
505
+ requestHeaders: n,
506
506
  responseHeaders: a,
507
507
  body: i
508
508
  }) {
509
- if (super("Fetch Error"), this.name = "Fetch Error", this.url = e, this.method = t, this.statusNumber = s, this.requestHeaders = r, this.responseHeaders = a, i)
509
+ if (super("Fetch Error"), this.name = "Fetch Error", this.url = e, this.method = t, this.statusNumber = s, this.requestHeaders = n, this.responseHeaders = a, i)
510
510
  try {
511
511
  const o = JSON.parse(i);
512
512
  this.body = o;
@@ -531,7 +531,7 @@ class pt extends Error {
531
531
  super(e), this.name = "Request Validation Error";
532
532
  }
533
533
  }
534
- function nn() {
534
+ function sr() {
535
535
  return Array.from(
536
536
  { length: 32 },
537
537
  () => Math.floor(Math.random() * 256).toString(16).padStart(2, "0")
@@ -560,78 +560,78 @@ class vs {
560
560
  }
561
561
  get(e) {
562
562
  return A(this, arguments, function* (t, s = {}) {
563
- const { overrideBaseAddress: r, overrideDefaultHeaders: a } = s, i = r != null ? r : this.baseAddress;
563
+ const { overrideBaseAddress: n, overrideDefaultHeaders: a } = s, i = n != null ? n : this.baseAddress;
564
564
  let o = a != null ? a : this.headers;
565
565
  const c = Ne(T(this, F));
566
- return j(this, F, {}), c.extraHeaders && (o = U(U({}, o), c.extraHeaders)), c.requestValidation && (o = Nt(U({}, o), { "X-Request-Nonce": nn(), "X-Request-Timestamp": xt() })), c.async ? yield ee(this, Y, Tt).call(this, `${i}${t}`, c.async, { headers: o }) : yield ee(this, Y, kt).call(this, `${i}${t}`, c, { headers: o });
566
+ return j(this, F, {}), c.extraHeaders && (o = U(U({}, o), c.extraHeaders)), c.requestValidation && (o = Nt(U({}, o), { "X-Request-Nonce": sr(), "X-Request-Timestamp": xt() })), c.async ? yield ee(this, Y, Tt).call(this, `${i}${t}`, c.async, { headers: o }) : yield ee(this, Y, kt).call(this, `${i}${t}`, c, { headers: o });
567
567
  });
568
568
  }
569
569
  post(e, t) {
570
- return A(this, arguments, function* (s, r, a = {}) {
570
+ return A(this, arguments, function* (s, n, a = {}) {
571
571
  const i = Ne(T(this, F));
572
- return j(this, F, {}), ee(this, Y, je).call(this, s, "POST", r, a, i);
572
+ return j(this, F, {}), ee(this, Y, je).call(this, s, "POST", n, a, i);
573
573
  });
574
574
  }
575
575
  put(e, t) {
576
- return A(this, arguments, function* (s, r, a = {}) {
576
+ return A(this, arguments, function* (s, n, a = {}) {
577
577
  const i = Ne(T(this, F));
578
- return j(this, F, {}), ee(this, Y, je).call(this, s, "PUT", r, a, i);
578
+ return j(this, F, {}), ee(this, Y, je).call(this, s, "PUT", n, a, i);
579
579
  });
580
580
  }
581
581
  delete(e, t) {
582
- return A(this, arguments, function* (s, r, a = {}) {
582
+ return A(this, arguments, function* (s, n, a = {}) {
583
583
  const i = Ne(T(this, F));
584
- return j(this, F, {}), ee(this, Y, je).call(this, s, "DELETE", r, a, i);
584
+ return j(this, F, {}), ee(this, Y, je).call(this, s, "DELETE", n, a, i);
585
585
  });
586
586
  }
587
587
  patch(e, t) {
588
- return A(this, arguments, function* (s, r, a = {}) {
588
+ return A(this, arguments, function* (s, n, a = {}) {
589
589
  const i = Ne(T(this, F));
590
- return j(this, F, {}), ee(this, Y, je).call(this, s, "PATCH", r, a, i);
590
+ return j(this, F, {}), ee(this, Y, je).call(this, s, "PATCH", n, a, i);
591
591
  });
592
592
  }
593
593
  }
594
- ge = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakSet(), kt = function(n, e, t) {
594
+ ge = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakSet(), kt = function(r, e, t) {
595
595
  return A(this, null, function* () {
596
596
  const s = () => A(this, null, function* () {
597
597
  var c, u;
598
598
  try {
599
- return yield T(this, ge).call(this, n, U(U({}, t), e.abortSignal && { signal: e.abortSignal }));
599
+ return yield T(this, ge).call(this, r, U(U({}, t), e.abortSignal && { signal: e.abortSignal }));
600
600
  } catch (f) {
601
601
  throw f instanceof Error && f.name === "AbortError" ? new Ie({ canceled: (u = (c = e.abortSignal) == null ? void 0 : c.aborted) != null ? u : !1 }) : f;
602
602
  }
603
- }), { headers: r } = t != null ? t : {}, a = (c, u) => {
604
- var f, _;
605
- return ((f = c == null ? void 0 : c.headers) == null ? void 0 : f.get(u)) || ((_ = c == null ? void 0 : c.headersObject) == null ? void 0 : _[u]) || "";
603
+ }), { headers: n } = t != null ? t : {}, a = (c, u) => {
604
+ var f, g;
605
+ return ((f = c == null ? void 0 : c.headers) == null ? void 0 : f.get(u)) || ((g = c == null ? void 0 : c.headersObject) == null ? void 0 : g[u]) || "";
606
606
  }, i = (c) => A(this, null, function* () {
607
607
  var u;
608
608
  if (!c.ok) {
609
- const _ = yield c.text().catch();
609
+ const g = yield c.text().catch();
610
610
  throw new Wt({
611
- url: n,
611
+ url: r,
612
612
  method: (u = t == null ? void 0 : t.method) != null ? u : "GET",
613
613
  statusCode: c.status,
614
- requestHeaders: r,
614
+ requestHeaders: n,
615
615
  responseHeaders: c.headers,
616
- body: _
616
+ body: g
617
617
  });
618
618
  }
619
619
  if (e.requestValidation && process.env.UI_TESTS !== !0)
620
620
  try {
621
- const _ = a(c, "x-response-nonce"), I = r == null ? void 0 : r["X-Request-Nonce"];
622
- if (!_ || _ !== I)
621
+ const g = a(c, "x-response-nonce"), O = n == null ? void 0 : n["X-Request-Nonce"];
622
+ if (!g || g !== O)
623
623
  throw new pt("Response nonce mismatch");
624
- const O = Number(a(c, "x-response-timestamp")), C = Number(xt()), R = 60 * 60 * 24;
625
- if (isNaN(O) || Math.abs(C - O) > R)
624
+ const C = Number(a(c, "x-response-timestamp")), N = Number(xt()), R = 60 * 60 * 24;
625
+ if (isNaN(C) || Math.abs(N - C) > R)
626
626
  throw new pt("Invalid response timestamp");
627
- } catch (_) {
628
- const I = _ instanceof Error ? _.message : "Request validation failed";
629
- throw new pt(I);
627
+ } catch (g) {
628
+ const O = g instanceof Error ? g.message : "Request validation failed";
629
+ throw new pt(O);
630
630
  }
631
631
  let f = yield c.text();
632
632
  try {
633
633
  f = JSON.parse(f);
634
- } catch (_) {
634
+ } catch (g) {
635
635
  }
636
636
  return f;
637
637
  });
@@ -645,41 +645,41 @@ ge = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), Y = /* @_
645
645
  const o = yield s();
646
646
  return yield i(o);
647
647
  });
648
- }, Tt = function(n, e, t) {
648
+ }, Tt = function(r, e, t) {
649
649
  return A(this, null, function* () {
650
- var s, r;
650
+ var s, n;
651
651
  const {
652
652
  onProgress: a,
653
653
  abortSignal: i,
654
654
  pollingInterval: o = () => gs,
655
655
  maxTimeout: c = ys
656
- } = e, u = `${n}/async`, f = `${n}/async/job`;
657
- let _;
656
+ } = e, u = `${r}/async`, f = `${r}/async/job`;
657
+ let g;
658
658
  try {
659
- _ = yield T(this, ge).call(this, u, U(U({}, t), i && { signal: i }));
660
- } catch (C) {
661
- throw C instanceof Error && C.name === "AbortError" ? new Ie({ canceled: (s = i == null ? void 0 : i.aborted) != null ? s : !1 }) : C;
659
+ g = yield T(this, ge).call(this, u, U(U({}, t), i && { signal: i }));
660
+ } catch (N) {
661
+ throw N instanceof Error && N.name === "AbortError" ? new Ie({ canceled: (s = i == null ? void 0 : i.aborted) != null ? s : !1 }) : N;
662
662
  }
663
- if (!_.ok) {
664
- const C = yield _.text().catch();
663
+ if (!g.ok) {
664
+ const N = yield g.text().catch();
665
665
  throw new Wt({
666
- url: n,
667
- method: (r = t == null ? void 0 : t.method) != null ? r : "GET",
668
- statusCode: _.status,
666
+ url: r,
667
+ method: (n = t == null ? void 0 : t.method) != null ? n : "GET",
668
+ statusCode: g.status,
669
669
  requestHeaders: this.headers,
670
- responseHeaders: _.headers,
671
- body: C
670
+ responseHeaders: g.headers,
671
+ body: N
672
672
  });
673
673
  }
674
- const I = yield _.json(), { job_id: O } = I;
675
- if (!O)
674
+ const O = yield g.json(), { job_id: C } = O;
675
+ if (!C)
676
676
  throw new Error("Job ID not found in response");
677
- return new Promise((C, R) => A(this, null, function* () {
677
+ return new Promise((N, R) => A(this, null, function* () {
678
678
  const B = setTimeout(() => {
679
679
  R(new Error("Job timed out"));
680
- }, c), re = (de = 0) => A(this, null, function* () {
680
+ }, c), ne = (de = 0) => A(this, null, function* () {
681
681
  if (i != null && i.aborted) {
682
- clearTimeout(B), T(this, ge).call(this, `${f}/${O}/cancel`, { method: "POST", headers: this.headers }).then(() => {
682
+ clearTimeout(B), T(this, ge).call(this, `${f}/${C}/cancel`, { method: "POST", headers: this.headers }).then(() => {
683
683
  R(new Ie({ canceled: !0 }));
684
684
  }).catch((V) => {
685
685
  R(new Ie({ canceled: !1 }));
@@ -687,55 +687,55 @@ ge = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), Y = /* @_
687
687
  return;
688
688
  }
689
689
  try {
690
- const V = yield (yield T(this, ge).call(this, `${f}/${O}`, { headers: this.headers })).json();
690
+ const V = yield (yield T(this, ge).call(this, `${f}/${C}`, { headers: this.headers })).json();
691
691
  if (V.status === "success") {
692
692
  clearTimeout(B);
693
693
  const X = V.response_json;
694
- C(X);
694
+ N(X);
695
695
  } else if (V.status === "failed")
696
696
  clearTimeout(B), R(new ms(V.response_json));
697
697
  else {
698
698
  a && a(V.response_json);
699
699
  const X = o(de);
700
- setTimeout(() => re(de + 1), X);
700
+ setTimeout(() => ne(de + 1), X);
701
701
  }
702
702
  } catch (V) {
703
703
  R(V);
704
704
  }
705
705
  });
706
- re();
706
+ ne();
707
707
  }));
708
708
  });
709
- }, je = function(n, e, t, s, r) {
709
+ }, je = function(r, e, t, s, n) {
710
710
  return A(this, null, function* () {
711
711
  const { overrideBaseAddress: a, overrideDefaultHeaders: i } = s, o = a != null ? a : this.baseAddress;
712
712
  let c = i != null ? i : this.headers;
713
- r.extraHeaders && (c = U(U({}, c), r.extraHeaders)), r.requestValidation && (c = Nt(U({}, c), { "X-Request-Nonce": nn(), "X-Request-Timestamp": xt() }));
714
- let u = s.skipBodyJsonStringify ? t : JSON.stringify(t);
715
- return r.compress && ls() && (c["Content-Encoding"] = "gzip", u = yield fs(u)), r.async ? yield ee(this, Y, Tt).call(this, `${o}${n}`, r.async, {
713
+ n.extraHeaders && (c = U(U({}, c), n.extraHeaders)), n.requestValidation && (c = Nt(U({}, c), { "X-Request-Nonce": sr(), "X-Request-Timestamp": xt() }));
714
+ let u = t;
715
+ return typeof FormData != "undefined" && t instanceof FormData ? delete c["Content-Type"] : (u = s.skipBodyJsonStringify ? t : JSON.stringify(t), n.compress && ls() && (c["Content-Encoding"] = "gzip", u = yield fs(u))), n.async ? yield ee(this, Y, Tt).call(this, `${o}${r}`, n.async, {
716
716
  method: e,
717
717
  headers: c,
718
718
  body: u
719
- }) : yield ee(this, Y, kt).call(this, `${o}${n}`, r, { method: e, headers: c, body: u });
719
+ }) : yield ee(this, Y, kt).call(this, `${o}${r}`, n, { method: e, headers: c, body: u });
720
720
  });
721
721
  };
722
- const Bt = (n, e, t, s) => n instanceof Ie ? n : new ps({ resource: e, api: String(t), args: s, cause: n }), mt = (n, e) => new Proxy(e, {
722
+ const Bt = (r, e, t, s) => r instanceof Ie ? r : new ps({ resource: e, api: String(t), args: s, cause: r }), mt = (r, e) => new Proxy(e, {
723
723
  get(t, s) {
724
- return (...r) => {
724
+ return (...n) => {
725
725
  var a;
726
- for (const o of n.plugins) {
727
- const c = (a = o.beforeApi) == null ? void 0 : a.call(o, { resource: t.resourceName, api: s, args: r });
726
+ for (const o of r.plugins) {
727
+ const c = (a = o.beforeApi) == null ? void 0 : a.call(o, { resource: t.resourceName, api: s, args: n });
728
728
  if (c !== void 0)
729
729
  return c;
730
730
  }
731
731
  let i;
732
732
  try {
733
- i = t[s](...r);
733
+ i = t[s](...n);
734
734
  } catch (o) {
735
- throw Bt(o, t.resourceName, s, r);
735
+ throw Bt(o, t.resourceName, s, n);
736
736
  }
737
737
  return i instanceof Promise ? i.catch((o) => {
738
- throw Bt(o, t.resourceName, s, r);
738
+ throw Bt(o, t.resourceName, s, n);
739
739
  }) : i;
740
740
  };
741
741
  }
@@ -747,26 +747,26 @@ class _s {
747
747
  }
748
748
  get(e) {
749
749
  return A(this, arguments, function* ({ fileKey: t, params: s = {} }) {
750
- const r = new URLSearchParams(U({
750
+ const n = new URLSearchParams(U({
751
751
  plugin_data: "857346721138427857"
752
- }, s)).toString(), a = `v1/files/${t}?${r}`;
752
+ }, s)).toString(), a = `v1/files/${t}?${n}`;
753
753
  return yield T(this, Ze).get(a);
754
754
  });
755
755
  }
756
756
  getImageFills(e) {
757
757
  return A(this, arguments, function* ({ fileKey: t }) {
758
- var s, r;
758
+ var s, n;
759
759
  const a = `v1/files/${t}/images`;
760
- return (r = (s = (yield T(this, Ze).get(a)).meta) == null ? void 0 : s.images) != null ? r : {};
760
+ return (n = (s = (yield T(this, Ze).get(a)).meta) == null ? void 0 : s.images) != null ? n : {};
761
761
  });
762
762
  }
763
763
  }
764
764
  Ze = /* @__PURE__ */ new WeakMap();
765
- const bs = (n, e, t) => {
765
+ const bs = (r, e, t) => {
766
766
  const s = e.sort();
767
- return `${n}-${s.join("-")}-${t}`;
768
- }, ws = (n) => n ? n.ts > Date.now() - 1e3 * 30 : !1;
769
- var Q, St, sn;
767
+ return `${r}-${s.join("-")}-${t}`;
768
+ }, ws = (r) => r ? r.ts > Date.now() - 1e3 * 30 : !1;
769
+ var Q, St, nr;
770
770
  class xs {
771
771
  constructor(e) {
772
772
  W(this, St), W(this, Q), this.resourceName = "Images", j(this, Q, e);
@@ -776,15 +776,15 @@ class xs {
776
776
  * Note: Use the `file.images` API to get the _source_ images used on the node fills, which has better quality.
777
777
  */
778
778
  get(e) {
779
- return A(this, arguments, function* ({ fileKey: t, nodeIds: s, format: r = "jpg", scale: a }) {
780
- const i = bs(t, s, r), o = T(this, Q).cache.images.entries.get(i);
779
+ return A(this, arguments, function* ({ fileKey: t, nodeIds: s, format: n = "jpg", scale: a }) {
780
+ const i = bs(t, s, n), o = T(this, Q).cache.images.entries.get(i);
781
781
  if (ws(o))
782
782
  return o.result;
783
783
  o && T(this, Q).cache.images.entries.delete(i);
784
784
  const c = T(this, Q).cache.images.pendingRequests.get(i);
785
785
  if (c)
786
786
  return c;
787
- const u = ee(this, St, sn).call(this, i, t, s, r, a);
787
+ const u = ee(this, St, nr).call(this, i, t, s, n, a);
788
788
  T(this, Q).cache.images.pendingRequests.set(i, u);
789
789
  try {
790
790
  return yield u;
@@ -794,12 +794,12 @@ class xs {
794
794
  });
795
795
  }
796
796
  }
797
- Q = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakSet(), sn = function(n, e, t, s, r) {
797
+ Q = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakSet(), nr = function(r, e, t, s, n) {
798
798
  return A(this, null, function* () {
799
799
  const a = yield T(this, Q).get(
800
- `v1/images/${e}?ids=${t}&format=${s}${r ? `&scale=${r}` : ""}`
800
+ `v1/images/${e}?ids=${t}&format=${s}${n ? `&scale=${n}` : ""}`
801
801
  );
802
- return T(this, Q).cache.images.entries.set(n, {
802
+ return T(this, Q).cache.images.entries.set(r, {
803
803
  result: a,
804
804
  ts: Date.now()
805
805
  }), a;
@@ -811,8 +811,8 @@ class ks {
811
811
  W(this, et), this.resourceName = "Nodes", j(this, et, e);
812
812
  }
813
813
  get(e) {
814
- return A(this, arguments, function* ({ fileKey: t, nodeIds: s, params: r = {} }) {
815
- const a = Nt(U({}, r), {
814
+ return A(this, arguments, function* ({ fileKey: t, nodeIds: s, params: n = {} }) {
815
+ const a = Nt(U({}, n), {
816
816
  ids: s.join(",")
817
817
  }), i = new URLSearchParams(U({
818
818
  plugin_data: "857346721138427857"
@@ -823,7 +823,7 @@ class ks {
823
823
  }
824
824
  et = /* @__PURE__ */ new WeakMap();
825
825
  var le;
826
- class rn extends vs {
826
+ class ar extends vs {
827
827
  constructor({
828
828
  baseAddress: e = "https://api.figma.com/",
829
829
  fetch: t = globalThis.fetch.bind(globalThis)
@@ -851,88 +851,88 @@ class rn extends vs {
851
851
  }
852
852
  }
853
853
  le = /* @__PURE__ */ new WeakMap();
854
- const Ts = (r) => M(void 0, [r], function* ({
855
- fileKey: n,
854
+ const Ts = (n) => M(void 0, [n], function* ({
855
+ fileKey: r,
856
856
  authToken: e,
857
- figmaRestApi: t = new rn(),
857
+ figmaRestApi: t = new ar(),
858
858
  params: s = {}
859
859
  }) {
860
860
  e && (t.token = e);
861
861
  try {
862
862
  return yield t.files.get({
863
- fileKey: n,
863
+ fileKey: r,
864
864
  params: s
865
865
  });
866
866
  } catch (a) {
867
- throw console.error(a), Qt(a, n);
867
+ throw console.error(a), er(a, r);
868
868
  }
869
- }), zr = (a) => M(void 0, [a], function* ({
870
- fileKey: n,
869
+ }), Wn = (a) => M(void 0, [a], function* ({
870
+ fileKey: r,
871
871
  authToken: e,
872
872
  nodeIds: t,
873
- figmaRestApi: s = new rn(),
874
- params: r = {}
873
+ figmaRestApi: s = new ar(),
874
+ params: n = {}
875
875
  }) {
876
876
  e && (s.token = e);
877
877
  try {
878
878
  return (yield s.nodes.get({
879
- fileKey: n,
879
+ fileKey: r,
880
880
  nodeIds: t,
881
- params: d({}, r)
881
+ params: d({}, n)
882
882
  })).nodes;
883
883
  } catch (i) {
884
- throw Qt(i, n);
885
- }
886
- }), an = (n, e) => {
887
- if (n.id === e)
888
- return n;
889
- if ("children" in n)
890
- for (const t of n.children) {
891
- const s = an(t, e);
884
+ throw er(i, r);
885
+ }
886
+ }), ir = (r, e) => {
887
+ if (r.id === e)
888
+ return r;
889
+ if ("children" in r)
890
+ for (const t of r.children) {
891
+ const s = ir(t, e);
892
892
  if (s)
893
893
  return s;
894
894
  }
895
895
  return null;
896
896
  };
897
897
  var x;
898
- (function(n) {
899
- n.assertEqual = (r) => r;
900
- function e(r) {
898
+ (function(r) {
899
+ r.assertEqual = (n) => n;
900
+ function e(n) {
901
901
  }
902
- n.assertIs = e;
903
- function t(r) {
902
+ r.assertIs = e;
903
+ function t(n) {
904
904
  throw new Error();
905
905
  }
906
- n.assertNever = t, n.arrayToEnum = (r) => {
906
+ r.assertNever = t, r.arrayToEnum = (n) => {
907
907
  const a = {};
908
- for (const i of r)
908
+ for (const i of n)
909
909
  a[i] = i;
910
910
  return a;
911
- }, n.getValidEnumValues = (r) => {
912
- const a = n.objectKeys(r).filter((o) => typeof r[r[o]] != "number"), i = {};
911
+ }, r.getValidEnumValues = (n) => {
912
+ const a = r.objectKeys(n).filter((o) => typeof n[n[o]] != "number"), i = {};
913
913
  for (const o of a)
914
- i[o] = r[o];
915
- return n.objectValues(i);
916
- }, n.objectValues = (r) => n.objectKeys(r).map(function(a) {
917
- return r[a];
918
- }), n.objectKeys = typeof Object.keys == "function" ? (r) => Object.keys(r) : (r) => {
914
+ i[o] = n[o];
915
+ return r.objectValues(i);
916
+ }, r.objectValues = (n) => r.objectKeys(n).map(function(a) {
917
+ return n[a];
918
+ }), r.objectKeys = typeof Object.keys == "function" ? (n) => Object.keys(n) : (n) => {
919
919
  const a = [];
920
- for (const i in r)
921
- Object.prototype.hasOwnProperty.call(r, i) && a.push(i);
920
+ for (const i in n)
921
+ Object.prototype.hasOwnProperty.call(n, i) && a.push(i);
922
922
  return a;
923
- }, n.find = (r, a) => {
924
- for (const i of r)
923
+ }, r.find = (n, a) => {
924
+ for (const i of n)
925
925
  if (a(i))
926
926
  return i;
927
- }, n.isInteger = typeof Number.isInteger == "function" ? (r) => Number.isInteger(r) : (r) => typeof r == "number" && isFinite(r) && Math.floor(r) === r;
928
- function s(r, a = " | ") {
929
- return r.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
927
+ }, r.isInteger = typeof Number.isInteger == "function" ? (n) => Number.isInteger(n) : (n) => typeof n == "number" && isFinite(n) && Math.floor(n) === n;
928
+ function s(n, a = " | ") {
929
+ return n.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
930
930
  }
931
- n.joinValues = s, n.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
931
+ r.joinValues = s, r.jsonStringifyReplacer = (n, a) => typeof a == "bigint" ? a.toString() : a;
932
932
  })(x || (x = {}));
933
933
  var Et;
934
- (function(n) {
935
- n.mergeShapes = (e, t) => d(d({}, e), t);
934
+ (function(r) {
935
+ r.mergeShapes = (e, t) => d(d({}, e), t);
936
936
  })(Et || (Et = {}));
937
937
  const p = x.arrayToEnum([
938
938
  "string",
@@ -955,14 +955,14 @@ const p = x.arrayToEnum([
955
955
  "never",
956
956
  "map",
957
957
  "set"
958
- ]), oe = (n) => {
959
- switch (typeof n) {
958
+ ]), oe = (r) => {
959
+ switch (typeof r) {
960
960
  case "undefined":
961
961
  return p.undefined;
962
962
  case "string":
963
963
  return p.string;
964
964
  case "number":
965
- return isNaN(n) ? p.nan : p.number;
965
+ return isNaN(r) ? p.nan : p.number;
966
966
  case "boolean":
967
967
  return p.boolean;
968
968
  case "function":
@@ -972,7 +972,7 @@ const p = x.arrayToEnum([
972
972
  case "symbol":
973
973
  return p.symbol;
974
974
  case "object":
975
- return Array.isArray(n) ? p.array : n === null ? p.null : n.then && typeof n.then == "function" && n.catch && typeof n.catch == "function" ? p.promise : typeof Map != "undefined" && n instanceof Map ? p.map : typeof Set != "undefined" && n instanceof Set ? p.set : typeof Date != "undefined" && n instanceof Date ? p.date : p.object;
975
+ return Array.isArray(r) ? p.array : r === null ? p.null : r.then && typeof r.then == "function" && r.catch && typeof r.catch == "function" ? p.promise : typeof Map != "undefined" && r instanceof Map ? p.map : typeof Set != "undefined" && r instanceof Set ? p.set : typeof Date != "undefined" && r instanceof Date ? p.date : p.object;
976
976
  default:
977
977
  return p.unknown;
978
978
  }
@@ -993,7 +993,7 @@ const p = x.arrayToEnum([
993
993
  "invalid_intersection_types",
994
994
  "not_multiple_of",
995
995
  "not_finite"
996
- ]), Ss = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
996
+ ]), Ss = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
997
997
  class z extends Error {
998
998
  get errors() {
999
999
  return this.issues;
@@ -1010,14 +1010,14 @@ class z extends Error {
1010
1010
  format(e) {
1011
1011
  const t = e || function(a) {
1012
1012
  return a.message;
1013
- }, s = { _errors: [] }, r = (a) => {
1013
+ }, s = { _errors: [] }, n = (a) => {
1014
1014
  for (const i of a.issues)
1015
1015
  if (i.code === "invalid_union")
1016
- i.unionErrors.map(r);
1016
+ i.unionErrors.map(n);
1017
1017
  else if (i.code === "invalid_return_type")
1018
- r(i.returnTypeError);
1018
+ n(i.returnTypeError);
1019
1019
  else if (i.code === "invalid_arguments")
1020
- r(i.argumentsError);
1020
+ n(i.argumentsError);
1021
1021
  else if (i.path.length === 0)
1022
1022
  s._errors.push(t(i));
1023
1023
  else {
@@ -1028,7 +1028,7 @@ class z extends Error {
1028
1028
  }
1029
1029
  }
1030
1030
  };
1031
- return r(this), s;
1031
+ return n(this), s;
1032
1032
  }
1033
1033
  static assert(e) {
1034
1034
  if (!(e instanceof z))
@@ -1045,35 +1045,35 @@ class z extends Error {
1045
1045
  }
1046
1046
  flatten(e = (t) => t.message) {
1047
1047
  const t = {}, s = [];
1048
- for (const r of this.issues)
1049
- r.path.length > 0 ? (t[r.path[0]] = t[r.path[0]] || [], t[r.path[0]].push(e(r))) : s.push(e(r));
1048
+ for (const n of this.issues)
1049
+ n.path.length > 0 ? (t[n.path[0]] = t[n.path[0]] || [], t[n.path[0]].push(e(n))) : s.push(e(n));
1050
1050
  return { formErrors: s, fieldErrors: t };
1051
1051
  }
1052
1052
  get formErrors() {
1053
1053
  return this.flatten();
1054
1054
  }
1055
1055
  }
1056
- z.create = (n) => new z(n);
1057
- const Ee = (n, e) => {
1056
+ z.create = (r) => new z(r);
1057
+ const Ee = (r, e) => {
1058
1058
  let t;
1059
- switch (n.code) {
1059
+ switch (r.code) {
1060
1060
  case l.invalid_type:
1061
- n.received === p.undefined ? t = "Required" : t = `Expected ${n.expected}, received ${n.received}`;
1061
+ r.received === p.undefined ? t = "Required" : t = `Expected ${r.expected}, received ${r.received}`;
1062
1062
  break;
1063
1063
  case l.invalid_literal:
1064
- t = `Invalid literal value, expected ${JSON.stringify(n.expected, x.jsonStringifyReplacer)}`;
1064
+ t = `Invalid literal value, expected ${JSON.stringify(r.expected, x.jsonStringifyReplacer)}`;
1065
1065
  break;
1066
1066
  case l.unrecognized_keys:
1067
- t = `Unrecognized key(s) in object: ${x.joinValues(n.keys, ", ")}`;
1067
+ t = `Unrecognized key(s) in object: ${x.joinValues(r.keys, ", ")}`;
1068
1068
  break;
1069
1069
  case l.invalid_union:
1070
1070
  t = "Invalid input";
1071
1071
  break;
1072
1072
  case l.invalid_union_discriminator:
1073
- t = `Invalid discriminator value. Expected ${x.joinValues(n.options)}`;
1073
+ t = `Invalid discriminator value. Expected ${x.joinValues(r.options)}`;
1074
1074
  break;
1075
1075
  case l.invalid_enum_value:
1076
- t = `Invalid enum value. Expected ${x.joinValues(n.options)}, received '${n.received}'`;
1076
+ t = `Invalid enum value. Expected ${x.joinValues(r.options)}, received '${r.received}'`;
1077
1077
  break;
1078
1078
  case l.invalid_arguments:
1079
1079
  t = "Invalid function arguments";
@@ -1085,13 +1085,13 @@ const Ee = (n, e) => {
1085
1085
  t = "Invalid date";
1086
1086
  break;
1087
1087
  case l.invalid_string:
1088
- typeof n.validation == "object" ? "includes" in n.validation ? (t = `Invalid input: must include "${n.validation.includes}"`, typeof n.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${n.validation.position}`)) : "startsWith" in n.validation ? t = `Invalid input: must start with "${n.validation.startsWith}"` : "endsWith" in n.validation ? t = `Invalid input: must end with "${n.validation.endsWith}"` : x.assertNever(n.validation) : n.validation !== "regex" ? t = `Invalid ${n.validation}` : t = "Invalid";
1088
+ typeof r.validation == "object" ? "includes" in r.validation ? (t = `Invalid input: must include "${r.validation.includes}"`, typeof r.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${r.validation.position}`)) : "startsWith" in r.validation ? t = `Invalid input: must start with "${r.validation.startsWith}"` : "endsWith" in r.validation ? t = `Invalid input: must end with "${r.validation.endsWith}"` : x.assertNever(r.validation) : r.validation !== "regex" ? t = `Invalid ${r.validation}` : t = "Invalid";
1089
1089
  break;
1090
1090
  case l.too_small:
1091
- n.type === "array" ? t = `Array must contain ${n.exact ? "exactly" : n.inclusive ? "at least" : "more than"} ${n.minimum} element(s)` : n.type === "string" ? t = `String must contain ${n.exact ? "exactly" : n.inclusive ? "at least" : "over"} ${n.minimum} character(s)` : n.type === "number" ? t = `Number must be ${n.exact ? "exactly equal to " : n.inclusive ? "greater than or equal to " : "greater than "}${n.minimum}` : n.type === "date" ? t = `Date must be ${n.exact ? "exactly equal to " : n.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(n.minimum))}` : t = "Invalid input";
1091
+ r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "more than"} ${r.minimum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "over"} ${r.minimum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(r.minimum))}` : t = "Invalid input";
1092
1092
  break;
1093
1093
  case l.too_big:
1094
- n.type === "array" ? t = `Array must contain ${n.exact ? "exactly" : n.inclusive ? "at most" : "less than"} ${n.maximum} element(s)` : n.type === "string" ? t = `String must contain ${n.exact ? "exactly" : n.inclusive ? "at most" : "under"} ${n.maximum} character(s)` : n.type === "number" ? t = `Number must be ${n.exact ? "exactly" : n.inclusive ? "less than or equal to" : "less than"} ${n.maximum}` : n.type === "bigint" ? t = `BigInt must be ${n.exact ? "exactly" : n.inclusive ? "less than or equal to" : "less than"} ${n.maximum}` : n.type === "date" ? t = `Date must be ${n.exact ? "exactly" : n.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(n.maximum))}` : t = "Invalid input";
1094
+ r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "less than"} ${r.maximum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "under"} ${r.maximum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "bigint" ? t = `BigInt must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly" : r.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(r.maximum))}` : t = "Invalid input";
1095
1095
  break;
1096
1096
  case l.custom:
1097
1097
  t = "Invalid input";
@@ -1100,58 +1100,58 @@ const Ee = (n, e) => {
1100
1100
  t = "Intersection results could not be merged";
1101
1101
  break;
1102
1102
  case l.not_multiple_of:
1103
- t = `Number must be a multiple of ${n.multipleOf}`;
1103
+ t = `Number must be a multiple of ${r.multipleOf}`;
1104
1104
  break;
1105
1105
  case l.not_finite:
1106
1106
  t = "Number must be finite";
1107
1107
  break;
1108
1108
  default:
1109
- t = e.defaultError, x.assertNever(n);
1109
+ t = e.defaultError, x.assertNever(r);
1110
1110
  }
1111
1111
  return { message: t };
1112
1112
  };
1113
- let on = Ee;
1114
- function Es(n) {
1115
- on = n;
1113
+ let or = Ee;
1114
+ function Es(r) {
1115
+ or = r;
1116
1116
  }
1117
1117
  function tt() {
1118
- return on;
1118
+ return or;
1119
1119
  }
1120
- const nt = (n) => {
1121
- const { data: e, path: t, errorMaps: s, issueData: r } = n, a = [...t, ...r.path || []], i = y(d({}, r), {
1120
+ const rt = (r) => {
1121
+ const { data: e, path: t, errorMaps: s, issueData: n } = r, a = [...t, ...n.path || []], i = y(d({}, n), {
1122
1122
  path: a
1123
1123
  });
1124
- if (r.message !== void 0)
1125
- return y(d({}, r), {
1124
+ if (n.message !== void 0)
1125
+ return y(d({}, n), {
1126
1126
  path: a,
1127
- message: r.message
1127
+ message: n.message
1128
1128
  });
1129
1129
  let o = "";
1130
1130
  const c = s.filter((u) => !!u).slice().reverse();
1131
1131
  for (const u of c)
1132
1132
  o = u(i, { data: e, defaultError: o }).message;
1133
- return y(d({}, r), {
1133
+ return y(d({}, n), {
1134
1134
  path: a,
1135
1135
  message: o
1136
1136
  });
1137
1137
  }, As = [];
1138
- function h(n, e) {
1139
- const t = tt(), s = nt({
1138
+ function h(r, e) {
1139
+ const t = tt(), s = rt({
1140
1140
  issueData: e,
1141
- data: n.data,
1142
- path: n.path,
1141
+ data: r.data,
1142
+ path: r.path,
1143
1143
  errorMaps: [
1144
- n.common.contextualErrorMap,
1144
+ r.common.contextualErrorMap,
1145
1145
  // contextual error map is first priority
1146
- n.schemaErrorMap,
1146
+ r.schemaErrorMap,
1147
1147
  // then schema-bound map if available
1148
1148
  t,
1149
1149
  // then global override map
1150
1150
  t === Ee ? void 0 : Ee
1151
1151
  // then global default map
1152
- ].filter((r) => !!r)
1152
+ ].filter((n) => !!n)
1153
1153
  });
1154
- n.common.issues.push(s);
1154
+ r.common.issues.push(s);
1155
1155
  }
1156
1156
  class Z {
1157
1157
  constructor() {
@@ -1165,18 +1165,18 @@ class Z {
1165
1165
  }
1166
1166
  static mergeArray(e, t) {
1167
1167
  const s = [];
1168
- for (const r of t) {
1169
- if (r.status === "aborted")
1170
- return v;
1171
- r.status === "dirty" && e.dirty(), s.push(r.value);
1168
+ for (const n of t) {
1169
+ if (n.status === "aborted")
1170
+ return _;
1171
+ n.status === "dirty" && e.dirty(), s.push(n.value);
1172
1172
  }
1173
1173
  return { status: e.value, value: s };
1174
1174
  }
1175
1175
  static mergeObjectAsync(e, t) {
1176
1176
  return M(this, null, function* () {
1177
1177
  const s = [];
1178
- for (const r of t) {
1179
- const a = yield r.key, i = yield r.value;
1178
+ for (const n of t) {
1179
+ const a = yield n.key, i = yield n.value;
1180
1180
  s.push({
1181
1181
  key: a,
1182
1182
  value: i
@@ -1187,65 +1187,65 @@ class Z {
1187
1187
  }
1188
1188
  static mergeObjectSync(e, t) {
1189
1189
  const s = {};
1190
- for (const r of t) {
1191
- const { key: a, value: i } = r;
1190
+ for (const n of t) {
1191
+ const { key: a, value: i } = n;
1192
1192
  if (a.status === "aborted" || i.status === "aborted")
1193
- return v;
1194
- a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value != "undefined" || r.alwaysSet) && (s[a.value] = i.value);
1193
+ return _;
1194
+ a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value != "undefined" || n.alwaysSet) && (s[a.value] = i.value);
1195
1195
  }
1196
1196
  return { status: e.value, value: s };
1197
1197
  }
1198
1198
  }
1199
- const v = Object.freeze({
1199
+ const _ = Object.freeze({
1200
1200
  status: "aborted"
1201
- }), ke = (n) => ({ status: "dirty", value: n }), $ = (n) => ({ status: "valid", value: n }), At = (n) => n.status === "aborted", Ot = (n) => n.status === "dirty", _e = (n) => n.status === "valid", Pe = (n) => typeof Promise != "undefined" && n instanceof Promise;
1202
- function st(n, e, t, s) {
1203
- if (typeof e == "function" ? n !== e || !0 : !e.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
1204
- return e.get(n);
1201
+ }), ke = (r) => ({ status: "dirty", value: r }), $ = (r) => ({ status: "valid", value: r }), At = (r) => r.status === "aborted", Ot = (r) => r.status === "dirty", _e = (r) => r.status === "valid", Pe = (r) => typeof Promise != "undefined" && r instanceof Promise;
1202
+ function st(r, e, t, s) {
1203
+ if (typeof e == "function" ? r !== e || !0 : !e.has(r)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
1204
+ return e.get(r);
1205
1205
  }
1206
- function cn(n, e, t, s, r) {
1207
- if (typeof e == "function" ? n !== e || !0 : !e.has(n)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
1208
- return e.set(n, t), t;
1206
+ function cr(r, e, t, s, n) {
1207
+ if (typeof e == "function" ? r !== e || !0 : !e.has(r)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
1208
+ return e.set(r, t), t;
1209
1209
  }
1210
1210
  var m;
1211
- (function(n) {
1212
- n.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, n.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
1211
+ (function(r) {
1212
+ r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
1213
1213
  })(m || (m = {}));
1214
1214
  var Re, Me;
1215
- class ne {
1216
- constructor(e, t, s, r) {
1217
- this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = r;
1215
+ class re {
1216
+ constructor(e, t, s, n) {
1217
+ this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = n;
1218
1218
  }
1219
1219
  get path() {
1220
1220
  return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
1221
1221
  }
1222
1222
  }
1223
- const qt = (n, e) => {
1223
+ const qt = (r, e) => {
1224
1224
  if (_e(e))
1225
1225
  return { success: !0, data: e.value };
1226
- if (!n.common.issues.length)
1226
+ if (!r.common.issues.length)
1227
1227
  throw new Error("Validation failed but no issues detected.");
1228
1228
  return {
1229
1229
  success: !1,
1230
1230
  get error() {
1231
1231
  if (this._error)
1232
1232
  return this._error;
1233
- const t = new z(n.common.issues);
1233
+ const t = new z(r.common.issues);
1234
1234
  return this._error = t, this._error;
1235
1235
  }
1236
1236
  };
1237
1237
  };
1238
- function b(n) {
1239
- if (!n)
1238
+ function b(r) {
1239
+ if (!r)
1240
1240
  return {};
1241
- const { errorMap: e, invalid_type_error: t, required_error: s, description: r } = n;
1241
+ const { errorMap: e, invalid_type_error: t, required_error: s, description: n } = r;
1242
1242
  if (e && (t || s))
1243
1243
  throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
1244
- return e ? { errorMap: e, description: r } : { errorMap: (i, o) => {
1244
+ return e ? { errorMap: e, description: n } : { errorMap: (i, o) => {
1245
1245
  var c, u;
1246
- const { message: f } = n;
1246
+ const { message: f } = r;
1247
1247
  return i.code === "invalid_enum_value" ? { message: f != null ? f : o.defaultError } : typeof o.data == "undefined" ? { message: (c = f != null ? f : s) !== null && c !== void 0 ? c : o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: (u = f != null ? f : t) !== null && u !== void 0 ? u : o.defaultError };
1248
- }, description: r };
1248
+ }, description: n };
1249
1249
  }
1250
1250
  class w {
1251
1251
  get description() {
@@ -1295,7 +1295,7 @@ class w {
1295
1295
  }
1296
1296
  safeParse(e, t) {
1297
1297
  var s;
1298
- const r = {
1298
+ const n = {
1299
1299
  common: {
1300
1300
  issues: [],
1301
1301
  async: (s = t == null ? void 0 : t.async) !== null && s !== void 0 ? s : !1,
@@ -1306,12 +1306,12 @@ class w {
1306
1306
  parent: null,
1307
1307
  data: e,
1308
1308
  parsedType: oe(e)
1309
- }, a = this._parseSync({ data: e, path: r.path, parent: r });
1310
- return qt(r, a);
1309
+ }, a = this._parseSync({ data: e, path: n.path, parent: n });
1310
+ return qt(n, a);
1311
1311
  }
1312
1312
  "~validate"(e) {
1313
1313
  var t, s;
1314
- const r = {
1314
+ const n = {
1315
1315
  common: {
1316
1316
  issues: [],
1317
1317
  async: !!this["~standard"].async
@@ -1324,22 +1324,22 @@ class w {
1324
1324
  };
1325
1325
  if (!this["~standard"].async)
1326
1326
  try {
1327
- const a = this._parseSync({ data: e, path: [], parent: r });
1327
+ const a = this._parseSync({ data: e, path: [], parent: n });
1328
1328
  return _e(a) ? {
1329
1329
  value: a.value
1330
1330
  } : {
1331
- issues: r.common.issues
1331
+ issues: n.common.issues
1332
1332
  };
1333
1333
  } catch (a) {
1334
- !((s = (t = a == null ? void 0 : a.message) === null || t === void 0 ? void 0 : t.toLowerCase()) === null || s === void 0) && s.includes("encountered") && (this["~standard"].async = !0), r.common = {
1334
+ !((s = (t = a == null ? void 0 : a.message) === null || t === void 0 ? void 0 : t.toLowerCase()) === null || s === void 0) && s.includes("encountered") && (this["~standard"].async = !0), n.common = {
1335
1335
  issues: [],
1336
1336
  async: !0
1337
1337
  };
1338
1338
  }
1339
- return this._parseAsync({ data: e, path: [], parent: r }).then((a) => _e(a) ? {
1339
+ return this._parseAsync({ data: e, path: [], parent: n }).then((a) => _e(a) ? {
1340
1340
  value: a.value
1341
1341
  } : {
1342
- issues: r.common.issues
1342
+ issues: n.common.issues
1343
1343
  });
1344
1344
  }
1345
1345
  parseAsync(e, t) {
@@ -1363,26 +1363,26 @@ class w {
1363
1363
  parent: null,
1364
1364
  data: e,
1365
1365
  parsedType: oe(e)
1366
- }, r = this._parse({ data: e, path: s.path, parent: s }), a = yield Pe(r) ? r : Promise.resolve(r);
1366
+ }, n = this._parse({ data: e, path: s.path, parent: s }), a = yield Pe(n) ? n : Promise.resolve(n);
1367
1367
  return qt(s, a);
1368
1368
  });
1369
1369
  }
1370
1370
  refine(e, t) {
1371
- const s = (r) => typeof t == "string" || typeof t == "undefined" ? { message: t } : typeof t == "function" ? t(r) : t;
1372
- return this._refinement((r, a) => {
1373
- const i = e(r), o = () => a.addIssue(d({
1371
+ const s = (n) => typeof t == "string" || typeof t == "undefined" ? { message: t } : typeof t == "function" ? t(n) : t;
1372
+ return this._refinement((n, a) => {
1373
+ const i = e(n), o = () => a.addIssue(d({
1374
1374
  code: l.custom
1375
- }, s(r)));
1375
+ }, s(n)));
1376
1376
  return typeof Promise != "undefined" && i instanceof Promise ? i.then((c) => c ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
1377
1377
  });
1378
1378
  }
1379
1379
  refinement(e, t) {
1380
- return this._refinement((s, r) => e(s) ? !0 : (r.addIssue(typeof t == "function" ? t(s, r) : t), !1));
1380
+ return this._refinement((s, n) => e(s) ? !0 : (n.addIssue(typeof t == "function" ? t(s, n) : t), !1));
1381
1381
  }
1382
1382
  _refinement(e) {
1383
1383
  return new K({
1384
1384
  schema: this,
1385
- typeName: g.ZodEffects,
1385
+ typeName: v.ZodEffects,
1386
1386
  effect: { type: "refinement", refinement: e }
1387
1387
  });
1388
1388
  }
@@ -1420,7 +1420,7 @@ class w {
1420
1420
  transform(e) {
1421
1421
  return new K(y(d({}, b(this._def)), {
1422
1422
  schema: this,
1423
- typeName: g.ZodEffects,
1423
+ typeName: v.ZodEffects,
1424
1424
  effect: { type: "transform", transform: e }
1425
1425
  }));
1426
1426
  }
@@ -1429,12 +1429,12 @@ class w {
1429
1429
  return new qe(y(d({}, b(this._def)), {
1430
1430
  innerType: this,
1431
1431
  defaultValue: t,
1432
- typeName: g.ZodDefault
1432
+ typeName: v.ZodDefault
1433
1433
  }));
1434
1434
  }
1435
1435
  brand() {
1436
1436
  return new Zt(d({
1437
- typeName: g.ZodBranded,
1437
+ typeName: v.ZodBranded,
1438
1438
  type: this
1439
1439
  }, b(this._def)));
1440
1440
  }
@@ -1443,7 +1443,7 @@ class w {
1443
1443
  return new He(y(d({}, b(this._def)), {
1444
1444
  innerType: this,
1445
1445
  catchValue: t,
1446
- typeName: g.ZodCatch
1446
+ typeName: v.ZodCatch
1447
1447
  }));
1448
1448
  }
1449
1449
  describe(e) {
@@ -1467,34 +1467,34 @@ class w {
1467
1467
  }
1468
1468
  const Os = /^c[^\s-]{8,}$/i, Cs = /^[0-9a-z]+$/, Ns = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Is = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, js = /^[a-z0-9_-]{21}$/i, Zs = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Rs = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Ms = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ps = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
1469
1469
  let yt;
1470
- const $s = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Vs = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Ds = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Ls = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Us = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, dn = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", zs = new RegExp(`^${dn}$`);
1471
- function un(n) {
1470
+ const $s = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Fs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Vs = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Ds = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Ls = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Us = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, dr = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", zs = new RegExp(`^${dr}$`);
1471
+ function ur(r) {
1472
1472
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
1473
- return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
1473
+ return r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`), e;
1474
1474
  }
1475
- function Ws(n) {
1476
- return new RegExp(`^${un(n)}$`);
1475
+ function Ws(r) {
1476
+ return new RegExp(`^${ur(r)}$`);
1477
1477
  }
1478
- function ln(n) {
1479
- let e = `${dn}T${un(n)}`;
1478
+ function lr(r) {
1479
+ let e = `${dr}T${ur(r)}`;
1480
1480
  const t = [];
1481
- return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
1481
+ return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
1482
1482
  }
1483
- function Bs(n, e) {
1484
- return !!((e === "v4" || !e) && $s.test(n) || (e === "v6" || !e) && Vs.test(n));
1483
+ function Bs(r, e) {
1484
+ return !!((e === "v4" || !e) && $s.test(r) || (e === "v6" || !e) && Vs.test(r));
1485
1485
  }
1486
- function qs(n, e) {
1487
- if (!Zs.test(n))
1486
+ function qs(r, e) {
1487
+ if (!Zs.test(r))
1488
1488
  return !1;
1489
1489
  try {
1490
- const [t] = n.split("."), s = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), r = JSON.parse(atob(s));
1491
- return !(typeof r != "object" || r === null || !r.typ || !r.alg || e && r.alg !== e);
1490
+ const [t] = r.split("."), s = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), n = JSON.parse(atob(s));
1491
+ return !(typeof n != "object" || n === null || !n.typ || !n.alg || e && n.alg !== e);
1492
1492
  } catch (t) {
1493
1493
  return !1;
1494
1494
  }
1495
1495
  }
1496
- function Hs(n, e) {
1497
- return !!((e === "v4" || !e) && Fs.test(n) || (e === "v6" || !e) && Ds.test(n));
1496
+ function Hs(r, e) {
1497
+ return !!((e === "v4" || !e) && Fs.test(r) || (e === "v6" || !e) && Ds.test(r));
1498
1498
  }
1499
1499
  class J extends w {
1500
1500
  _parse(e) {
@@ -1504,13 +1504,13 @@ class J extends w {
1504
1504
  code: l.invalid_type,
1505
1505
  expected: p.string,
1506
1506
  received: a.parsedType
1507
- }), v;
1507
+ }), _;
1508
1508
  }
1509
1509
  const s = new Z();
1510
- let r;
1510
+ let n;
1511
1511
  for (const a of this._def.checks)
1512
1512
  if (a.kind === "min")
1513
- e.data.length < a.value && (r = this._getOrReturnCtx(e, r), h(r, {
1513
+ e.data.length < a.value && (n = this._getOrReturnCtx(e, n), h(n, {
1514
1514
  code: l.too_small,
1515
1515
  minimum: a.value,
1516
1516
  type: "string",
@@ -1519,7 +1519,7 @@ class J extends w {
1519
1519
  message: a.message
1520
1520
  }), s.dirty());
1521
1521
  else if (a.kind === "max")
1522
- e.data.length > a.value && (r = this._getOrReturnCtx(e, r), h(r, {
1522
+ e.data.length > a.value && (n = this._getOrReturnCtx(e, n), h(n, {
1523
1523
  code: l.too_big,
1524
1524
  maximum: a.value,
1525
1525
  type: "string",
@@ -1529,14 +1529,14 @@ class J extends w {
1529
1529
  }), s.dirty());
1530
1530
  else if (a.kind === "length") {
1531
1531
  const i = e.data.length > a.value, o = e.data.length < a.value;
1532
- (i || o) && (r = this._getOrReturnCtx(e, r), i ? h(r, {
1532
+ (i || o) && (n = this._getOrReturnCtx(e, n), i ? h(n, {
1533
1533
  code: l.too_big,
1534
1534
  maximum: a.value,
1535
1535
  type: "string",
1536
1536
  inclusive: !0,
1537
1537
  exact: !0,
1538
1538
  message: a.message
1539
- }) : o && h(r, {
1539
+ }) : o && h(n, {
1540
1540
  code: l.too_small,
1541
1541
  minimum: a.value,
1542
1542
  type: "string",
@@ -1545,43 +1545,43 @@ class J extends w {
1545
1545
  message: a.message
1546
1546
  }), s.dirty());
1547
1547
  } else if (a.kind === "email")
1548
- Ms.test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
1548
+ Ms.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1549
1549
  validation: "email",
1550
1550
  code: l.invalid_string,
1551
1551
  message: a.message
1552
1552
  }), s.dirty());
1553
1553
  else if (a.kind === "emoji")
1554
- yt || (yt = new RegExp(Ps, "u")), yt.test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
1554
+ yt || (yt = new RegExp(Ps, "u")), yt.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1555
1555
  validation: "emoji",
1556
1556
  code: l.invalid_string,
1557
1557
  message: a.message
1558
1558
  }), s.dirty());
1559
1559
  else if (a.kind === "uuid")
1560
- Is.test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
1560
+ Is.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1561
1561
  validation: "uuid",
1562
1562
  code: l.invalid_string,
1563
1563
  message: a.message
1564
1564
  }), s.dirty());
1565
1565
  else if (a.kind === "nanoid")
1566
- js.test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
1566
+ js.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1567
1567
  validation: "nanoid",
1568
1568
  code: l.invalid_string,
1569
1569
  message: a.message
1570
1570
  }), s.dirty());
1571
1571
  else if (a.kind === "cuid")
1572
- Os.test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
1572
+ Os.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1573
1573
  validation: "cuid",
1574
1574
  code: l.invalid_string,
1575
1575
  message: a.message
1576
1576
  }), s.dirty());
1577
1577
  else if (a.kind === "cuid2")
1578
- Cs.test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
1578
+ Cs.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1579
1579
  validation: "cuid2",
1580
1580
  code: l.invalid_string,
1581
1581
  message: a.message
1582
1582
  }), s.dirty());
1583
1583
  else if (a.kind === "ulid")
1584
- Ns.test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
1584
+ Ns.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1585
1585
  validation: "ulid",
1586
1586
  code: l.invalid_string,
1587
1587
  message: a.message
@@ -1590,61 +1590,61 @@ class J extends w {
1590
1590
  try {
1591
1591
  new URL(e.data);
1592
1592
  } catch (i) {
1593
- r = this._getOrReturnCtx(e, r), h(r, {
1593
+ n = this._getOrReturnCtx(e, n), h(n, {
1594
1594
  validation: "url",
1595
1595
  code: l.invalid_string,
1596
1596
  message: a.message
1597
1597
  }), s.dirty();
1598
1598
  }
1599
- else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
1599
+ else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1600
1600
  validation: "regex",
1601
1601
  code: l.invalid_string,
1602
1602
  message: a.message
1603
- }), s.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (r = this._getOrReturnCtx(e, r), h(r, {
1603
+ }), s.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (n = this._getOrReturnCtx(e, n), h(n, {
1604
1604
  code: l.invalid_string,
1605
1605
  validation: { includes: a.value, position: a.position },
1606
1606
  message: a.message
1607
- }), s.dirty()) : a.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : a.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : a.kind === "startsWith" ? e.data.startsWith(a.value) || (r = this._getOrReturnCtx(e, r), h(r, {
1607
+ }), s.dirty()) : a.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : a.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : a.kind === "startsWith" ? e.data.startsWith(a.value) || (n = this._getOrReturnCtx(e, n), h(n, {
1608
1608
  code: l.invalid_string,
1609
1609
  validation: { startsWith: a.value },
1610
1610
  message: a.message
1611
- }), s.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (r = this._getOrReturnCtx(e, r), h(r, {
1611
+ }), s.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (n = this._getOrReturnCtx(e, n), h(n, {
1612
1612
  code: l.invalid_string,
1613
1613
  validation: { endsWith: a.value },
1614
1614
  message: a.message
1615
- }), s.dirty()) : a.kind === "datetime" ? ln(a).test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
1615
+ }), s.dirty()) : a.kind === "datetime" ? lr(a).test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1616
1616
  code: l.invalid_string,
1617
1617
  validation: "datetime",
1618
1618
  message: a.message
1619
- }), s.dirty()) : a.kind === "date" ? zs.test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
1619
+ }), s.dirty()) : a.kind === "date" ? zs.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1620
1620
  code: l.invalid_string,
1621
1621
  validation: "date",
1622
1622
  message: a.message
1623
- }), s.dirty()) : a.kind === "time" ? Ws(a).test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
1623
+ }), s.dirty()) : a.kind === "time" ? Ws(a).test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1624
1624
  code: l.invalid_string,
1625
1625
  validation: "time",
1626
1626
  message: a.message
1627
- }), s.dirty()) : a.kind === "duration" ? Rs.test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
1627
+ }), s.dirty()) : a.kind === "duration" ? Rs.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1628
1628
  validation: "duration",
1629
1629
  code: l.invalid_string,
1630
1630
  message: a.message
1631
- }), s.dirty()) : a.kind === "ip" ? Bs(e.data, a.version) || (r = this._getOrReturnCtx(e, r), h(r, {
1631
+ }), s.dirty()) : a.kind === "ip" ? Bs(e.data, a.version) || (n = this._getOrReturnCtx(e, n), h(n, {
1632
1632
  validation: "ip",
1633
1633
  code: l.invalid_string,
1634
1634
  message: a.message
1635
- }), s.dirty()) : a.kind === "jwt" ? qs(e.data, a.alg) || (r = this._getOrReturnCtx(e, r), h(r, {
1635
+ }), s.dirty()) : a.kind === "jwt" ? qs(e.data, a.alg) || (n = this._getOrReturnCtx(e, n), h(n, {
1636
1636
  validation: "jwt",
1637
1637
  code: l.invalid_string,
1638
1638
  message: a.message
1639
- }), s.dirty()) : a.kind === "cidr" ? Hs(e.data, a.version) || (r = this._getOrReturnCtx(e, r), h(r, {
1639
+ }), s.dirty()) : a.kind === "cidr" ? Hs(e.data, a.version) || (n = this._getOrReturnCtx(e, n), h(n, {
1640
1640
  validation: "cidr",
1641
1641
  code: l.invalid_string,
1642
1642
  message: a.message
1643
- }), s.dirty()) : a.kind === "base64" ? Ls.test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
1643
+ }), s.dirty()) : a.kind === "base64" ? Ls.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1644
1644
  validation: "base64",
1645
1645
  code: l.invalid_string,
1646
1646
  message: a.message
1647
- }), s.dirty()) : a.kind === "base64url" ? Us.test(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
1647
+ }), s.dirty()) : a.kind === "base64url" ? Us.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1648
1648
  validation: "base64url",
1649
1649
  code: l.invalid_string,
1650
1650
  message: a.message
@@ -1652,7 +1652,7 @@ class J extends w {
1652
1652
  return { status: s.value, value: e.data };
1653
1653
  }
1654
1654
  _regex(e, t, s) {
1655
- return this.refinement((r) => e.test(r), d({
1655
+ return this.refinement((n) => e.test(n), d({
1656
1656
  validation: t,
1657
1657
  code: l.invalid_string
1658
1658
  }, m.errToObj(s)));
@@ -1859,17 +1859,17 @@ class J extends w {
1859
1859
  return e;
1860
1860
  }
1861
1861
  }
1862
- J.create = (n) => {
1862
+ J.create = (r) => {
1863
1863
  var e;
1864
1864
  return new J(d({
1865
1865
  checks: [],
1866
- typeName: g.ZodString,
1867
- coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1
1868
- }, b(n)));
1866
+ typeName: v.ZodString,
1867
+ coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1
1868
+ }, b(r)));
1869
1869
  };
1870
- function Js(n, e) {
1871
- const t = (n.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, r = t > s ? t : s, a = parseInt(n.toFixed(r).replace(".", "")), i = parseInt(e.toFixed(r).replace(".", ""));
1872
- return a % i / Math.pow(10, r);
1870
+ function Js(r, e) {
1871
+ const t = (r.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, n = t > s ? t : s, a = parseInt(r.toFixed(n).replace(".", "")), i = parseInt(e.toFixed(n).replace(".", ""));
1872
+ return a % i / Math.pow(10, n);
1873
1873
  }
1874
1874
  class fe extends w {
1875
1875
  constructor() {
@@ -1882,39 +1882,39 @@ class fe extends w {
1882
1882
  code: l.invalid_type,
1883
1883
  expected: p.number,
1884
1884
  received: a.parsedType
1885
- }), v;
1885
+ }), _;
1886
1886
  }
1887
1887
  let s;
1888
- const r = new Z();
1888
+ const n = new Z();
1889
1889
  for (const a of this._def.checks)
1890
1890
  a.kind === "int" ? x.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
1891
1891
  code: l.invalid_type,
1892
1892
  expected: "integer",
1893
1893
  received: "float",
1894
1894
  message: a.message
1895
- }), r.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), h(s, {
1895
+ }), n.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), h(s, {
1896
1896
  code: l.too_small,
1897
1897
  minimum: a.value,
1898
1898
  type: "number",
1899
1899
  inclusive: a.inclusive,
1900
1900
  exact: !1,
1901
1901
  message: a.message
1902
- }), r.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), h(s, {
1902
+ }), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), h(s, {
1903
1903
  code: l.too_big,
1904
1904
  maximum: a.value,
1905
1905
  type: "number",
1906
1906
  inclusive: a.inclusive,
1907
1907
  exact: !1,
1908
1908
  message: a.message
1909
- }), r.dirty()) : a.kind === "multipleOf" ? Js(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), h(s, {
1909
+ }), n.dirty()) : a.kind === "multipleOf" ? Js(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), h(s, {
1910
1910
  code: l.not_multiple_of,
1911
1911
  multipleOf: a.value,
1912
1912
  message: a.message
1913
- }), r.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
1913
+ }), n.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
1914
1914
  code: l.not_finite,
1915
1915
  message: a.message
1916
- }), r.dirty()) : x.assertNever(a);
1917
- return { status: r.value, value: e.data };
1916
+ }), n.dirty()) : x.assertNever(a);
1917
+ return { status: n.value, value: e.data };
1918
1918
  }
1919
1919
  gte(e, t) {
1920
1920
  return this.setLimit("min", e, !0, m.toString(t));
@@ -1928,7 +1928,7 @@ class fe extends w {
1928
1928
  lt(e, t) {
1929
1929
  return this.setLimit("max", e, !1, m.toString(t));
1930
1930
  }
1931
- setLimit(e, t, s, r) {
1931
+ setLimit(e, t, s, n) {
1932
1932
  return new fe(y(d({}, this._def), {
1933
1933
  checks: [
1934
1934
  ...this._def.checks,
@@ -1936,7 +1936,7 @@ class fe extends w {
1936
1936
  kind: e,
1937
1937
  value: t,
1938
1938
  inclusive: s,
1939
- message: m.toString(r)
1939
+ message: m.toString(n)
1940
1940
  }
1941
1941
  ]
1942
1942
  }));
@@ -2035,11 +2035,11 @@ class fe extends w {
2035
2035
  return Number.isFinite(t) && Number.isFinite(e);
2036
2036
  }
2037
2037
  }
2038
- fe.create = (n) => new fe(d({
2038
+ fe.create = (r) => new fe(d({
2039
2039
  checks: [],
2040
- typeName: g.ZodNumber,
2041
- coerce: (n == null ? void 0 : n.coerce) || !1
2042
- }, b(n)));
2040
+ typeName: v.ZodNumber,
2041
+ coerce: (r == null ? void 0 : r.coerce) || !1
2042
+ }, b(r)));
2043
2043
  class he extends w {
2044
2044
  constructor() {
2045
2045
  super(...arguments), this.min = this.gte, this.max = this.lte;
@@ -2054,7 +2054,7 @@ class he extends w {
2054
2054
  if (this._getType(e) !== p.bigint)
2055
2055
  return this._getInvalidInput(e);
2056
2056
  let s;
2057
- const r = new Z();
2057
+ const n = new Z();
2058
2058
  for (const a of this._def.checks)
2059
2059
  a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), h(s, {
2060
2060
  code: l.too_small,
@@ -2062,18 +2062,18 @@ class he extends w {
2062
2062
  minimum: a.value,
2063
2063
  inclusive: a.inclusive,
2064
2064
  message: a.message
2065
- }), r.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), h(s, {
2065
+ }), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), h(s, {
2066
2066
  code: l.too_big,
2067
2067
  type: "bigint",
2068
2068
  maximum: a.value,
2069
2069
  inclusive: a.inclusive,
2070
2070
  message: a.message
2071
- }), r.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (s = this._getOrReturnCtx(e, s), h(s, {
2071
+ }), n.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (s = this._getOrReturnCtx(e, s), h(s, {
2072
2072
  code: l.not_multiple_of,
2073
2073
  multipleOf: a.value,
2074
2074
  message: a.message
2075
- }), r.dirty()) : x.assertNever(a);
2076
- return { status: r.value, value: e.data };
2075
+ }), n.dirty()) : x.assertNever(a);
2076
+ return { status: n.value, value: e.data };
2077
2077
  }
2078
2078
  _getInvalidInput(e) {
2079
2079
  const t = this._getOrReturnCtx(e);
@@ -2081,7 +2081,7 @@ class he extends w {
2081
2081
  code: l.invalid_type,
2082
2082
  expected: p.bigint,
2083
2083
  received: t.parsedType
2084
- }), v;
2084
+ }), _;
2085
2085
  }
2086
2086
  gte(e, t) {
2087
2087
  return this.setLimit("min", e, !0, m.toString(t));
@@ -2095,7 +2095,7 @@ class he extends w {
2095
2095
  lt(e, t) {
2096
2096
  return this.setLimit("max", e, !1, m.toString(t));
2097
2097
  }
2098
- setLimit(e, t, s, r) {
2098
+ setLimit(e, t, s, n) {
2099
2099
  return new he(y(d({}, this._def), {
2100
2100
  checks: [
2101
2101
  ...this._def.checks,
@@ -2103,7 +2103,7 @@ class he extends w {
2103
2103
  kind: e,
2104
2104
  value: t,
2105
2105
  inclusive: s,
2106
- message: m.toString(r)
2106
+ message: m.toString(n)
2107
2107
  }
2108
2108
  ]
2109
2109
  }));
@@ -2165,13 +2165,13 @@ class he extends w {
2165
2165
  return e;
2166
2166
  }
2167
2167
  }
2168
- he.create = (n) => {
2168
+ he.create = (r) => {
2169
2169
  var e;
2170
2170
  return new he(d({
2171
2171
  checks: [],
2172
- typeName: g.ZodBigInt,
2173
- coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1
2174
- }, b(n)));
2172
+ typeName: v.ZodBigInt,
2173
+ coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1
2174
+ }, b(r)));
2175
2175
  };
2176
2176
  class $e extends w {
2177
2177
  _parse(e) {
@@ -2181,15 +2181,15 @@ class $e extends w {
2181
2181
  code: l.invalid_type,
2182
2182
  expected: p.boolean,
2183
2183
  received: s.parsedType
2184
- }), v;
2184
+ }), _;
2185
2185
  }
2186
2186
  return $(e.data);
2187
2187
  }
2188
2188
  }
2189
- $e.create = (n) => new $e(d({
2190
- typeName: g.ZodBoolean,
2191
- coerce: (n == null ? void 0 : n.coerce) || !1
2192
- }, b(n)));
2189
+ $e.create = (r) => new $e(d({
2190
+ typeName: v.ZodBoolean,
2191
+ coerce: (r == null ? void 0 : r.coerce) || !1
2192
+ }, b(r)));
2193
2193
  class be extends w {
2194
2194
  _parse(e) {
2195
2195
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== p.date) {
@@ -2198,25 +2198,25 @@ class be extends w {
2198
2198
  code: l.invalid_type,
2199
2199
  expected: p.date,
2200
2200
  received: a.parsedType
2201
- }), v;
2201
+ }), _;
2202
2202
  }
2203
2203
  if (isNaN(e.data.getTime())) {
2204
2204
  const a = this._getOrReturnCtx(e);
2205
2205
  return h(a, {
2206
2206
  code: l.invalid_date
2207
- }), v;
2207
+ }), _;
2208
2208
  }
2209
2209
  const s = new Z();
2210
- let r;
2210
+ let n;
2211
2211
  for (const a of this._def.checks)
2212
- a.kind === "min" ? e.data.getTime() < a.value && (r = this._getOrReturnCtx(e, r), h(r, {
2212
+ a.kind === "min" ? e.data.getTime() < a.value && (n = this._getOrReturnCtx(e, n), h(n, {
2213
2213
  code: l.too_small,
2214
2214
  message: a.message,
2215
2215
  inclusive: !0,
2216
2216
  exact: !1,
2217
2217
  minimum: a.value,
2218
2218
  type: "date"
2219
- }), s.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (r = this._getOrReturnCtx(e, r), h(r, {
2219
+ }), s.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (n = this._getOrReturnCtx(e, n), h(n, {
2220
2220
  code: l.too_big,
2221
2221
  message: a.message,
2222
2222
  inclusive: !0,
@@ -2261,12 +2261,12 @@ class be extends w {
2261
2261
  return e != null ? new Date(e) : null;
2262
2262
  }
2263
2263
  }
2264
- be.create = (n) => new be(d({
2264
+ be.create = (r) => new be(d({
2265
2265
  checks: [],
2266
- coerce: (n == null ? void 0 : n.coerce) || !1,
2267
- typeName: g.ZodDate
2268
- }, b(n)));
2269
- class rt extends w {
2266
+ coerce: (r == null ? void 0 : r.coerce) || !1,
2267
+ typeName: v.ZodDate
2268
+ }, b(r)));
2269
+ class nt extends w {
2270
2270
  _parse(e) {
2271
2271
  if (this._getType(e) !== p.symbol) {
2272
2272
  const s = this._getOrReturnCtx(e);
@@ -2274,14 +2274,14 @@ class rt extends w {
2274
2274
  code: l.invalid_type,
2275
2275
  expected: p.symbol,
2276
2276
  received: s.parsedType
2277
- }), v;
2277
+ }), _;
2278
2278
  }
2279
2279
  return $(e.data);
2280
2280
  }
2281
2281
  }
2282
- rt.create = (n) => new rt(d({
2283
- typeName: g.ZodSymbol
2284
- }, b(n)));
2282
+ nt.create = (r) => new nt(d({
2283
+ typeName: v.ZodSymbol
2284
+ }, b(r)));
2285
2285
  class Fe extends w {
2286
2286
  _parse(e) {
2287
2287
  if (this._getType(e) !== p.undefined) {
@@ -2290,14 +2290,14 @@ class Fe extends w {
2290
2290
  code: l.invalid_type,
2291
2291
  expected: p.undefined,
2292
2292
  received: s.parsedType
2293
- }), v;
2293
+ }), _;
2294
2294
  }
2295
2295
  return $(e.data);
2296
2296
  }
2297
2297
  }
2298
- Fe.create = (n) => new Fe(d({
2299
- typeName: g.ZodUndefined
2300
- }, b(n)));
2298
+ Fe.create = (r) => new Fe(d({
2299
+ typeName: v.ZodUndefined
2300
+ }, b(r)));
2301
2301
  class Ve extends w {
2302
2302
  _parse(e) {
2303
2303
  if (this._getType(e) !== p.null) {
@@ -2306,14 +2306,14 @@ class Ve extends w {
2306
2306
  code: l.invalid_type,
2307
2307
  expected: p.null,
2308
2308
  received: s.parsedType
2309
- }), v;
2309
+ }), _;
2310
2310
  }
2311
2311
  return $(e.data);
2312
2312
  }
2313
2313
  }
2314
- Ve.create = (n) => new Ve(d({
2315
- typeName: g.ZodNull
2316
- }, b(n)));
2314
+ Ve.create = (r) => new Ve(d({
2315
+ typeName: v.ZodNull
2316
+ }, b(r)));
2317
2317
  class Ae extends w {
2318
2318
  constructor() {
2319
2319
  super(...arguments), this._any = !0;
@@ -2322,9 +2322,9 @@ class Ae extends w {
2322
2322
  return $(e.data);
2323
2323
  }
2324
2324
  }
2325
- Ae.create = (n) => new Ae(d({
2326
- typeName: g.ZodAny
2327
- }, b(n)));
2325
+ Ae.create = (r) => new Ae(d({
2326
+ typeName: v.ZodAny
2327
+ }, b(r)));
2328
2328
  class ve extends w {
2329
2329
  constructor() {
2330
2330
  super(...arguments), this._unknown = !0;
@@ -2333,9 +2333,9 @@ class ve extends w {
2333
2333
  return $(e.data);
2334
2334
  }
2335
2335
  }
2336
- ve.create = (n) => new ve(d({
2337
- typeName: g.ZodUnknown
2338
- }, b(n)));
2336
+ ve.create = (r) => new ve(d({
2337
+ typeName: v.ZodUnknown
2338
+ }, b(r)));
2339
2339
  class ce extends w {
2340
2340
  _parse(e) {
2341
2341
  const t = this._getOrReturnCtx(e);
@@ -2343,12 +2343,12 @@ class ce extends w {
2343
2343
  code: l.invalid_type,
2344
2344
  expected: p.never,
2345
2345
  received: t.parsedType
2346
- }), v;
2346
+ }), _;
2347
2347
  }
2348
2348
  }
2349
- ce.create = (n) => new ce(d({
2350
- typeName: g.ZodNever
2351
- }, b(n)));
2349
+ ce.create = (r) => new ce(d({
2350
+ typeName: v.ZodNever
2351
+ }, b(r)));
2352
2352
  class at extends w {
2353
2353
  _parse(e) {
2354
2354
  if (this._getType(e) !== p.undefined) {
@@ -2357,52 +2357,52 @@ class at extends w {
2357
2357
  code: l.invalid_type,
2358
2358
  expected: p.void,
2359
2359
  received: s.parsedType
2360
- }), v;
2360
+ }), _;
2361
2361
  }
2362
2362
  return $(e.data);
2363
2363
  }
2364
2364
  }
2365
- at.create = (n) => new at(d({
2366
- typeName: g.ZodVoid
2367
- }, b(n)));
2365
+ at.create = (r) => new at(d({
2366
+ typeName: v.ZodVoid
2367
+ }, b(r)));
2368
2368
  class G extends w {
2369
2369
  _parse(e) {
2370
- const { ctx: t, status: s } = this._processInputParams(e), r = this._def;
2370
+ const { ctx: t, status: s } = this._processInputParams(e), n = this._def;
2371
2371
  if (t.parsedType !== p.array)
2372
2372
  return h(t, {
2373
2373
  code: l.invalid_type,
2374
2374
  expected: p.array,
2375
2375
  received: t.parsedType
2376
- }), v;
2377
- if (r.exactLength !== null) {
2378
- const i = t.data.length > r.exactLength.value, o = t.data.length < r.exactLength.value;
2376
+ }), _;
2377
+ if (n.exactLength !== null) {
2378
+ const i = t.data.length > n.exactLength.value, o = t.data.length < n.exactLength.value;
2379
2379
  (i || o) && (h(t, {
2380
2380
  code: i ? l.too_big : l.too_small,
2381
- minimum: o ? r.exactLength.value : void 0,
2382
- maximum: i ? r.exactLength.value : void 0,
2381
+ minimum: o ? n.exactLength.value : void 0,
2382
+ maximum: i ? n.exactLength.value : void 0,
2383
2383
  type: "array",
2384
2384
  inclusive: !0,
2385
2385
  exact: !0,
2386
- message: r.exactLength.message
2386
+ message: n.exactLength.message
2387
2387
  }), s.dirty());
2388
2388
  }
2389
- if (r.minLength !== null && t.data.length < r.minLength.value && (h(t, {
2389
+ if (n.minLength !== null && t.data.length < n.minLength.value && (h(t, {
2390
2390
  code: l.too_small,
2391
- minimum: r.minLength.value,
2391
+ minimum: n.minLength.value,
2392
2392
  type: "array",
2393
2393
  inclusive: !0,
2394
2394
  exact: !1,
2395
- message: r.minLength.message
2396
- }), s.dirty()), r.maxLength !== null && t.data.length > r.maxLength.value && (h(t, {
2395
+ message: n.minLength.message
2396
+ }), s.dirty()), n.maxLength !== null && t.data.length > n.maxLength.value && (h(t, {
2397
2397
  code: l.too_big,
2398
- maximum: r.maxLength.value,
2398
+ maximum: n.maxLength.value,
2399
2399
  type: "array",
2400
2400
  inclusive: !0,
2401
2401
  exact: !1,
2402
- message: r.maxLength.message
2402
+ message: n.maxLength.message
2403
2403
  }), s.dirty()), t.common.async)
2404
- return Promise.all([...t.data].map((i, o) => r.type._parseAsync(new ne(t, i, t.path, o)))).then((i) => Z.mergeArray(s, i));
2405
- const a = [...t.data].map((i, o) => r.type._parseSync(new ne(t, i, t.path, o)));
2404
+ return Promise.all([...t.data].map((i, o) => n.type._parseAsync(new re(t, i, t.path, o)))).then((i) => Z.mergeArray(s, i));
2405
+ const a = [...t.data].map((i, o) => n.type._parseSync(new re(t, i, t.path, o)));
2406
2406
  return Z.mergeArray(s, a);
2407
2407
  }
2408
2408
  get element() {
@@ -2427,26 +2427,26 @@ class G extends w {
2427
2427
  return this.min(1, e);
2428
2428
  }
2429
2429
  }
2430
- G.create = (n, e) => new G(d({
2431
- type: n,
2430
+ G.create = (r, e) => new G(d({
2431
+ type: r,
2432
2432
  minLength: null,
2433
2433
  maxLength: null,
2434
2434
  exactLength: null,
2435
- typeName: g.ZodArray
2435
+ typeName: v.ZodArray
2436
2436
  }, b(e)));
2437
- function xe(n) {
2438
- if (n instanceof S) {
2437
+ function xe(r) {
2438
+ if (r instanceof S) {
2439
2439
  const e = {};
2440
- for (const t in n.shape) {
2441
- const s = n.shape[t];
2440
+ for (const t in r.shape) {
2441
+ const s = r.shape[t];
2442
2442
  e[t] = te.create(xe(s));
2443
2443
  }
2444
- return new S(y(d({}, n._def), {
2444
+ return new S(y(d({}, r._def), {
2445
2445
  shape: () => e
2446
2446
  }));
2447
- } else return n instanceof G ? new G(y(d({}, n._def), {
2448
- type: xe(n.element)
2449
- })) : n instanceof te ? te.create(xe(n.unwrap())) : n instanceof me ? me.create(xe(n.unwrap())) : n instanceof se ? se.create(n.items.map((e) => xe(e))) : n;
2447
+ } else return r instanceof G ? new G(y(d({}, r._def), {
2448
+ type: xe(r.element)
2449
+ })) : r instanceof te ? te.create(xe(r.unwrap())) : r instanceof me ? me.create(xe(r.unwrap())) : r instanceof se ? se.create(r.items.map((e) => xe(e))) : r;
2450
2450
  }
2451
2451
  class S extends w {
2452
2452
  constructor() {
@@ -2465,19 +2465,19 @@ class S extends w {
2465
2465
  code: l.invalid_type,
2466
2466
  expected: p.object,
2467
2467
  received: u.parsedType
2468
- }), v;
2468
+ }), _;
2469
2469
  }
2470
- const { status: s, ctx: r } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
2470
+ const { status: s, ctx: n } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
2471
2471
  if (!(this._def.catchall instanceof ce && this._def.unknownKeys === "strip"))
2472
- for (const u in r.data)
2472
+ for (const u in n.data)
2473
2473
  i.includes(u) || o.push(u);
2474
2474
  const c = [];
2475
2475
  for (const u of i) {
2476
- const f = a[u], _ = r.data[u];
2476
+ const f = a[u], g = n.data[u];
2477
2477
  c.push({
2478
2478
  key: { status: "valid", value: u },
2479
- value: f._parse(new ne(r, _, r.path, u)),
2480
- alwaysSet: u in r.data
2479
+ value: f._parse(new re(n, g, n.path, u)),
2480
+ alwaysSet: u in n.data
2481
2481
  });
2482
2482
  }
2483
2483
  if (this._def.catchall instanceof ce) {
@@ -2486,10 +2486,10 @@ class S extends w {
2486
2486
  for (const f of o)
2487
2487
  c.push({
2488
2488
  key: { status: "valid", value: f },
2489
- value: { status: "valid", value: r.data[f] }
2489
+ value: { status: "valid", value: n.data[f] }
2490
2490
  });
2491
2491
  else if (u === "strict")
2492
- o.length > 0 && (h(r, {
2492
+ o.length > 0 && (h(n, {
2493
2493
  code: l.unrecognized_keys,
2494
2494
  keys: o
2495
2495
  }), s.dirty());
@@ -2497,24 +2497,24 @@ class S extends w {
2497
2497
  } else {
2498
2498
  const u = this._def.catchall;
2499
2499
  for (const f of o) {
2500
- const _ = r.data[f];
2500
+ const g = n.data[f];
2501
2501
  c.push({
2502
2502
  key: { status: "valid", value: f },
2503
2503
  value: u._parse(
2504
- new ne(r, _, r.path, f)
2504
+ new re(n, g, n.path, f)
2505
2505
  //, ctx.child(key), value, getParsedType(value)
2506
2506
  ),
2507
- alwaysSet: f in r.data
2507
+ alwaysSet: f in n.data
2508
2508
  });
2509
2509
  }
2510
2510
  }
2511
- return r.common.async ? Promise.resolve().then(() => M(this, null, function* () {
2511
+ return n.common.async ? Promise.resolve().then(() => M(this, null, function* () {
2512
2512
  const u = [];
2513
2513
  for (const f of c) {
2514
- const _ = yield f.key, I = yield f.value;
2514
+ const g = yield f.key, O = yield f.value;
2515
2515
  u.push({
2516
- key: _,
2517
- value: I,
2516
+ key: g,
2517
+ value: O,
2518
2518
  alwaysSet: f.alwaysSet
2519
2519
  });
2520
2520
  }
@@ -2529,8 +2529,8 @@ class S extends w {
2529
2529
  unknownKeys: "strict"
2530
2530
  }), e !== void 0 ? {
2531
2531
  errorMap: (t, s) => {
2532
- var r, a, i, o;
2533
- const c = (i = (a = (r = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(r, t, s).message) !== null && i !== void 0 ? i : s.defaultError;
2532
+ var n, a, i, o;
2533
+ const c = (i = (a = (n = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(n, t, s).message) !== null && i !== void 0 ? i : s.defaultError;
2534
2534
  return t.code === "unrecognized_keys" ? {
2535
2535
  message: (o = m.errToObj(e).message) !== null && o !== void 0 ? o : c
2536
2536
  } : {
@@ -2581,7 +2581,7 @@ class S extends w {
2581
2581
  unknownKeys: e._def.unknownKeys,
2582
2582
  catchall: e._def.catchall,
2583
2583
  shape: () => d(d({}, this._def.shape()), e._def.shape()),
2584
- typeName: g.ZodObject
2584
+ typeName: v.ZodObject
2585
2585
  });
2586
2586
  }
2587
2587
  // merge<
@@ -2673,8 +2673,8 @@ class S extends w {
2673
2673
  partial(e) {
2674
2674
  const t = {};
2675
2675
  return x.objectKeys(this.shape).forEach((s) => {
2676
- const r = this.shape[s];
2677
- e && !e[s] ? t[s] = r : t[s] = r.optional();
2676
+ const n = this.shape[s];
2677
+ e && !e[s] ? t[s] = n : t[s] = n.optional();
2678
2678
  }), new S(y(d({}, this._def), {
2679
2679
  shape: () => t
2680
2680
  }));
@@ -2695,31 +2695,31 @@ class S extends w {
2695
2695
  }));
2696
2696
  }
2697
2697
  keyof() {
2698
- return fn(x.objectKeys(this.shape));
2698
+ return fr(x.objectKeys(this.shape));
2699
2699
  }
2700
2700
  }
2701
- S.create = (n, e) => new S(d({
2702
- shape: () => n,
2701
+ S.create = (r, e) => new S(d({
2702
+ shape: () => r,
2703
2703
  unknownKeys: "strip",
2704
2704
  catchall: ce.create(),
2705
- typeName: g.ZodObject
2705
+ typeName: v.ZodObject
2706
2706
  }, b(e)));
2707
- S.strictCreate = (n, e) => new S(d({
2708
- shape: () => n,
2707
+ S.strictCreate = (r, e) => new S(d({
2708
+ shape: () => r,
2709
2709
  unknownKeys: "strict",
2710
2710
  catchall: ce.create(),
2711
- typeName: g.ZodObject
2711
+ typeName: v.ZodObject
2712
2712
  }, b(e)));
2713
- S.lazycreate = (n, e) => new S(d({
2714
- shape: n,
2713
+ S.lazycreate = (r, e) => new S(d({
2714
+ shape: r,
2715
2715
  unknownKeys: "strip",
2716
2716
  catchall: ce.create(),
2717
- typeName: g.ZodObject
2717
+ typeName: v.ZodObject
2718
2718
  }, b(e)));
2719
2719
  class De extends w {
2720
2720
  _parse(e) {
2721
2721
  const { ctx: t } = this._processInputParams(e), s = this._def.options;
2722
- function r(a) {
2722
+ function n(a) {
2723
2723
  for (const o of a)
2724
2724
  if (o.result.status === "valid")
2725
2725
  return o.result;
@@ -2730,7 +2730,7 @@ class De extends w {
2730
2730
  return h(t, {
2731
2731
  code: l.invalid_union,
2732
2732
  unionErrors: i
2733
- }), v;
2733
+ }), _;
2734
2734
  }
2735
2735
  if (t.common.async)
2736
2736
  return Promise.all(s.map((a) => M(this, null, function* () {
@@ -2748,7 +2748,7 @@ class De extends w {
2748
2748
  }),
2749
2749
  ctx: i
2750
2750
  };
2751
- }))).then(r);
2751
+ }))).then(n);
2752
2752
  {
2753
2753
  let a;
2754
2754
  const i = [];
@@ -2773,18 +2773,18 @@ class De extends w {
2773
2773
  return h(t, {
2774
2774
  code: l.invalid_union,
2775
2775
  unionErrors: o
2776
- }), v;
2776
+ }), _;
2777
2777
  }
2778
2778
  }
2779
2779
  get options() {
2780
2780
  return this._def.options;
2781
2781
  }
2782
2782
  }
2783
- De.create = (n, e) => new De(d({
2784
- options: n,
2785
- typeName: g.ZodUnion
2783
+ De.create = (r, e) => new De(d({
2784
+ options: r,
2785
+ typeName: v.ZodUnion
2786
2786
  }, b(e)));
2787
- const ie = (n) => n instanceof ze ? ie(n.schema) : n instanceof K ? ie(n.innerType()) : n instanceof We ? [n.value] : n instanceof pe ? n.options : n instanceof Be ? x.objectValues(n.enum) : n instanceof qe ? ie(n._def.innerType) : n instanceof Fe ? [void 0] : n instanceof Ve ? [null] : n instanceof te ? [void 0, ...ie(n.unwrap())] : n instanceof me ? [null, ...ie(n.unwrap())] : n instanceof Zt || n instanceof Je ? ie(n.unwrap()) : n instanceof He ? ie(n._def.innerType) : [];
2787
+ const ie = (r) => r instanceof ze ? ie(r.schema) : r instanceof K ? ie(r.innerType()) : r instanceof We ? [r.value] : r instanceof pe ? r.options : r instanceof Be ? x.objectValues(r.enum) : r instanceof qe ? ie(r._def.innerType) : r instanceof Fe ? [void 0] : r instanceof Ve ? [null] : r instanceof te ? [void 0, ...ie(r.unwrap())] : r instanceof me ? [null, ...ie(r.unwrap())] : r instanceof Zt || r instanceof Je ? ie(r.unwrap()) : r instanceof He ? ie(r._def.innerType) : [];
2788
2788
  class dt extends w {
2789
2789
  _parse(e) {
2790
2790
  const { ctx: t } = this._processInputParams(e);
@@ -2793,8 +2793,8 @@ class dt extends w {
2793
2793
  code: l.invalid_type,
2794
2794
  expected: p.object,
2795
2795
  received: t.parsedType
2796
- }), v;
2797
- const s = this.discriminator, r = t.data[s], a = this.optionsMap.get(r);
2796
+ }), _;
2797
+ const s = this.discriminator, n = t.data[s], a = this.optionsMap.get(n);
2798
2798
  return a ? t.common.async ? a._parseAsync({
2799
2799
  data: t.data,
2800
2800
  path: t.path,
@@ -2807,7 +2807,7 @@ class dt extends w {
2807
2807
  code: l.invalid_union_discriminator,
2808
2808
  options: Array.from(this.optionsMap.keys()),
2809
2809
  path: [s]
2810
- }), v);
2810
+ }), _);
2811
2811
  }
2812
2812
  get discriminator() {
2813
2813
  return this._def.discriminator;
@@ -2827,60 +2827,60 @@ class dt extends w {
2827
2827
  * @param params
2828
2828
  */
2829
2829
  static create(e, t, s) {
2830
- const r = /* @__PURE__ */ new Map();
2830
+ const n = /* @__PURE__ */ new Map();
2831
2831
  for (const a of t) {
2832
2832
  const i = ie(a.shape[e]);
2833
2833
  if (!i.length)
2834
2834
  throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
2835
2835
  for (const o of i) {
2836
- if (r.has(o))
2836
+ if (n.has(o))
2837
2837
  throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);
2838
- r.set(o, a);
2838
+ n.set(o, a);
2839
2839
  }
2840
2840
  }
2841
2841
  return new dt(d({
2842
- typeName: g.ZodDiscriminatedUnion,
2842
+ typeName: v.ZodDiscriminatedUnion,
2843
2843
  discriminator: e,
2844
2844
  options: t,
2845
- optionsMap: r
2845
+ optionsMap: n
2846
2846
  }, b(s)));
2847
2847
  }
2848
2848
  }
2849
- function Ct(n, e) {
2850
- const t = oe(n), s = oe(e);
2851
- if (n === e)
2852
- return { valid: !0, data: n };
2849
+ function Ct(r, e) {
2850
+ const t = oe(r), s = oe(e);
2851
+ if (r === e)
2852
+ return { valid: !0, data: r };
2853
2853
  if (t === p.object && s === p.object) {
2854
- const r = x.objectKeys(e), a = x.objectKeys(n).filter((o) => r.indexOf(o) !== -1), i = d(d({}, n), e);
2854
+ const n = x.objectKeys(e), a = x.objectKeys(r).filter((o) => n.indexOf(o) !== -1), i = d(d({}, r), e);
2855
2855
  for (const o of a) {
2856
- const c = Ct(n[o], e[o]);
2856
+ const c = Ct(r[o], e[o]);
2857
2857
  if (!c.valid)
2858
2858
  return { valid: !1 };
2859
2859
  i[o] = c.data;
2860
2860
  }
2861
2861
  return { valid: !0, data: i };
2862
2862
  } else if (t === p.array && s === p.array) {
2863
- if (n.length !== e.length)
2863
+ if (r.length !== e.length)
2864
2864
  return { valid: !1 };
2865
- const r = [];
2866
- for (let a = 0; a < n.length; a++) {
2867
- const i = n[a], o = e[a], c = Ct(i, o);
2865
+ const n = [];
2866
+ for (let a = 0; a < r.length; a++) {
2867
+ const i = r[a], o = e[a], c = Ct(i, o);
2868
2868
  if (!c.valid)
2869
2869
  return { valid: !1 };
2870
- r.push(c.data);
2870
+ n.push(c.data);
2871
2871
  }
2872
- return { valid: !0, data: r };
2873
- } else return t === p.date && s === p.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
2872
+ return { valid: !0, data: n };
2873
+ } else return t === p.date && s === p.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
2874
2874
  }
2875
2875
  class Le extends w {
2876
2876
  _parse(e) {
2877
- const { status: t, ctx: s } = this._processInputParams(e), r = (a, i) => {
2877
+ const { status: t, ctx: s } = this._processInputParams(e), n = (a, i) => {
2878
2878
  if (At(a) || At(i))
2879
- return v;
2879
+ return _;
2880
2880
  const o = Ct(a.value, i.value);
2881
2881
  return o.valid ? ((Ot(a) || Ot(i)) && t.dirty(), { status: t.value, value: o.data }) : (h(s, {
2882
2882
  code: l.invalid_intersection_types
2883
- }), v);
2883
+ }), _);
2884
2884
  };
2885
2885
  return s.common.async ? Promise.all([
2886
2886
  this._def.left._parseAsync({
@@ -2893,7 +2893,7 @@ class Le extends w {
2893
2893
  path: s.path,
2894
2894
  parent: s
2895
2895
  })
2896
- ]).then(([a, i]) => r(a, i)) : r(this._def.left._parseSync({
2896
+ ]).then(([a, i]) => n(a, i)) : n(this._def.left._parseSync({
2897
2897
  data: s.data,
2898
2898
  path: s.path,
2899
2899
  parent: s
@@ -2904,10 +2904,10 @@ class Le extends w {
2904
2904
  }));
2905
2905
  }
2906
2906
  }
2907
- Le.create = (n, e, t) => new Le(d({
2908
- left: n,
2907
+ Le.create = (r, e, t) => new Le(d({
2908
+ left: r,
2909
2909
  right: e,
2910
- typeName: g.ZodIntersection
2910
+ typeName: v.ZodIntersection
2911
2911
  }, b(t)));
2912
2912
  class se extends w {
2913
2913
  _parse(e) {
@@ -2917,7 +2917,7 @@ class se extends w {
2917
2917
  code: l.invalid_type,
2918
2918
  expected: p.array,
2919
2919
  received: s.parsedType
2920
- }), v;
2920
+ }), _;
2921
2921
  if (s.data.length < this._def.items.length)
2922
2922
  return h(s, {
2923
2923
  code: l.too_small,
@@ -2925,7 +2925,7 @@ class se extends w {
2925
2925
  inclusive: !0,
2926
2926
  exact: !1,
2927
2927
  type: "array"
2928
- }), v;
2928
+ }), _;
2929
2929
  !this._def.rest && s.data.length > this._def.items.length && (h(s, {
2930
2930
  code: l.too_big,
2931
2931
  maximum: this._def.items.length,
@@ -2935,7 +2935,7 @@ class se extends w {
2935
2935
  }), t.dirty());
2936
2936
  const a = [...s.data].map((i, o) => {
2937
2937
  const c = this._def.items[o] || this._def.rest;
2938
- return c ? c._parse(new ne(s, i, s.path, o)) : null;
2938
+ return c ? c._parse(new re(s, i, s.path, o)) : null;
2939
2939
  }).filter((i) => !!i);
2940
2940
  return s.common.async ? Promise.all(a).then((i) => Z.mergeArray(t, i)) : Z.mergeArray(t, a);
2941
2941
  }
@@ -2948,12 +2948,12 @@ class se extends w {
2948
2948
  }));
2949
2949
  }
2950
2950
  }
2951
- se.create = (n, e) => {
2952
- if (!Array.isArray(n))
2951
+ se.create = (r, e) => {
2952
+ if (!Array.isArray(r))
2953
2953
  throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2954
2954
  return new se(d({
2955
- items: n,
2956
- typeName: g.ZodTuple,
2955
+ items: r,
2956
+ typeName: v.ZodTuple,
2957
2957
  rest: null
2958
2958
  }, b(e)));
2959
2959
  };
@@ -2971,15 +2971,15 @@ class Ue extends w {
2971
2971
  code: l.invalid_type,
2972
2972
  expected: p.object,
2973
2973
  received: s.parsedType
2974
- }), v;
2975
- const r = [], a = this._def.keyType, i = this._def.valueType;
2974
+ }), _;
2975
+ const n = [], a = this._def.keyType, i = this._def.valueType;
2976
2976
  for (const o in s.data)
2977
- r.push({
2978
- key: a._parse(new ne(s, o, s.path, o)),
2979
- value: i._parse(new ne(s, s.data[o], s.path, o)),
2977
+ n.push({
2978
+ key: a._parse(new re(s, o, s.path, o)),
2979
+ value: i._parse(new re(s, s.data[o], s.path, o)),
2980
2980
  alwaysSet: o in s.data
2981
2981
  });
2982
- return s.common.async ? Z.mergeObjectAsync(t, r) : Z.mergeObjectSync(t, r);
2982
+ return s.common.async ? Z.mergeObjectAsync(t, n) : Z.mergeObjectSync(t, n);
2983
2983
  }
2984
2984
  get element() {
2985
2985
  return this._def.valueType;
@@ -2988,11 +2988,11 @@ class Ue extends w {
2988
2988
  return t instanceof w ? new Ue(d({
2989
2989
  keyType: e,
2990
2990
  valueType: t,
2991
- typeName: g.ZodRecord
2991
+ typeName: v.ZodRecord
2992
2992
  }, b(s))) : new Ue(d({
2993
2993
  keyType: J.create(),
2994
2994
  valueType: e,
2995
- typeName: g.ZodRecord
2995
+ typeName: v.ZodRecord
2996
2996
  }, b(t)));
2997
2997
  }
2998
2998
  }
@@ -3010,10 +3010,10 @@ class it extends w {
3010
3010
  code: l.invalid_type,
3011
3011
  expected: p.map,
3012
3012
  received: s.parsedType
3013
- }), v;
3014
- const r = this._def.keyType, a = this._def.valueType, i = [...s.data.entries()].map(([o, c], u) => ({
3015
- key: r._parse(new ne(s, o, s.path, [u, "key"])),
3016
- value: a._parse(new ne(s, c, s.path, [u, "value"]))
3013
+ }), _;
3014
+ const n = this._def.keyType, a = this._def.valueType, i = [...s.data.entries()].map(([o, c], u) => ({
3015
+ key: n._parse(new re(s, o, s.path, [u, "key"])),
3016
+ value: a._parse(new re(s, c, s.path, [u, "value"]))
3017
3017
  }));
3018
3018
  if (s.common.async) {
3019
3019
  const o = /* @__PURE__ */ new Map();
@@ -3021,7 +3021,7 @@ class it extends w {
3021
3021
  for (const c of i) {
3022
3022
  const u = yield c.key, f = yield c.value;
3023
3023
  if (u.status === "aborted" || f.status === "aborted")
3024
- return v;
3024
+ return _;
3025
3025
  (u.status === "dirty" || f.status === "dirty") && t.dirty(), o.set(u.value, f.value);
3026
3026
  }
3027
3027
  return { status: t.value, value: o };
@@ -3031,17 +3031,17 @@ class it extends w {
3031
3031
  for (const c of i) {
3032
3032
  const u = c.key, f = c.value;
3033
3033
  if (u.status === "aborted" || f.status === "aborted")
3034
- return v;
3034
+ return _;
3035
3035
  (u.status === "dirty" || f.status === "dirty") && t.dirty(), o.set(u.value, f.value);
3036
3036
  }
3037
3037
  return { status: t.value, value: o };
3038
3038
  }
3039
3039
  }
3040
3040
  }
3041
- it.create = (n, e, t) => new it(d({
3041
+ it.create = (r, e, t) => new it(d({
3042
3042
  valueType: e,
3043
- keyType: n,
3044
- typeName: g.ZodMap
3043
+ keyType: r,
3044
+ typeName: v.ZodMap
3045
3045
  }, b(t)));
3046
3046
  class we extends w {
3047
3047
  _parse(e) {
@@ -3051,34 +3051,34 @@ class we extends w {
3051
3051
  code: l.invalid_type,
3052
3052
  expected: p.set,
3053
3053
  received: s.parsedType
3054
- }), v;
3055
- const r = this._def;
3056
- r.minSize !== null && s.data.size < r.minSize.value && (h(s, {
3054
+ }), _;
3055
+ const n = this._def;
3056
+ n.minSize !== null && s.data.size < n.minSize.value && (h(s, {
3057
3057
  code: l.too_small,
3058
- minimum: r.minSize.value,
3058
+ minimum: n.minSize.value,
3059
3059
  type: "set",
3060
3060
  inclusive: !0,
3061
3061
  exact: !1,
3062
- message: r.minSize.message
3063
- }), t.dirty()), r.maxSize !== null && s.data.size > r.maxSize.value && (h(s, {
3062
+ message: n.minSize.message
3063
+ }), t.dirty()), n.maxSize !== null && s.data.size > n.maxSize.value && (h(s, {
3064
3064
  code: l.too_big,
3065
- maximum: r.maxSize.value,
3065
+ maximum: n.maxSize.value,
3066
3066
  type: "set",
3067
3067
  inclusive: !0,
3068
3068
  exact: !1,
3069
- message: r.maxSize.message
3069
+ message: n.maxSize.message
3070
3070
  }), t.dirty());
3071
3071
  const a = this._def.valueType;
3072
3072
  function i(c) {
3073
3073
  const u = /* @__PURE__ */ new Set();
3074
3074
  for (const f of c) {
3075
3075
  if (f.status === "aborted")
3076
- return v;
3076
+ return _;
3077
3077
  f.status === "dirty" && t.dirty(), u.add(f.value);
3078
3078
  }
3079
3079
  return { status: t.value, value: u };
3080
3080
  }
3081
- const o = [...s.data.values()].map((c, u) => a._parse(new ne(s, c, s.path, u)));
3081
+ const o = [...s.data.values()].map((c, u) => a._parse(new re(s, c, s.path, u)));
3082
3082
  return s.common.async ? Promise.all(o).then((c) => i(c)) : i(o);
3083
3083
  }
3084
3084
  min(e, t) {
@@ -3098,11 +3098,11 @@ class we extends w {
3098
3098
  return this.min(1, e);
3099
3099
  }
3100
3100
  }
3101
- we.create = (n, e) => new we(d({
3102
- valueType: n,
3101
+ we.create = (r, e) => new we(d({
3102
+ valueType: r,
3103
3103
  minSize: null,
3104
3104
  maxSize: null,
3105
- typeName: g.ZodSet
3105
+ typeName: v.ZodSet
3106
3106
  }, b(e)));
3107
3107
  class Te extends w {
3108
3108
  constructor() {
@@ -3115,9 +3115,9 @@ class Te extends w {
3115
3115
  code: l.invalid_type,
3116
3116
  expected: p.function,
3117
3117
  received: t.parsedType
3118
- }), v;
3118
+ }), _;
3119
3119
  function s(o, c) {
3120
- return nt({
3120
+ return rt({
3121
3121
  data: o,
3122
3122
  path: t.path,
3123
3123
  errorMaps: [
@@ -3132,8 +3132,8 @@ class Te extends w {
3132
3132
  }
3133
3133
  });
3134
3134
  }
3135
- function r(o, c) {
3136
- return nt({
3135
+ function n(o, c) {
3136
+ return rt({
3137
3137
  data: o,
3138
3138
  path: t.path,
3139
3139
  errorMaps: [
@@ -3153,11 +3153,11 @@ class Te extends w {
3153
3153
  const o = this;
3154
3154
  return $(function(...c) {
3155
3155
  return M(this, null, function* () {
3156
- const u = new z([]), f = yield o._def.args.parseAsync(c, a).catch((O) => {
3157
- throw u.addIssue(s(c, O)), u;
3158
- }), _ = yield Reflect.apply(i, this, f);
3159
- return yield o._def.returns._def.type.parseAsync(_, a).catch((O) => {
3160
- throw u.addIssue(r(_, O)), u;
3156
+ const u = new z([]), f = yield o._def.args.parseAsync(c, a).catch((C) => {
3157
+ throw u.addIssue(s(c, C)), u;
3158
+ }), g = yield Reflect.apply(i, this, f);
3159
+ return yield o._def.returns._def.type.parseAsync(g, a).catch((C) => {
3160
+ throw u.addIssue(n(g, C)), u;
3161
3161
  });
3162
3162
  });
3163
3163
  });
@@ -3167,10 +3167,10 @@ class Te extends w {
3167
3167
  const u = o._def.args.safeParse(c, a);
3168
3168
  if (!u.success)
3169
3169
  throw new z([s(c, u.error)]);
3170
- const f = Reflect.apply(i, this, u.data), _ = o._def.returns.safeParse(f, a);
3171
- if (!_.success)
3172
- throw new z([r(f, _.error)]);
3173
- return _.data;
3170
+ const f = Reflect.apply(i, this, u.data), g = o._def.returns.safeParse(f, a);
3171
+ if (!g.success)
3172
+ throw new z([n(f, g.error)]);
3173
+ return g.data;
3174
3174
  });
3175
3175
  }
3176
3176
  }
@@ -3200,7 +3200,7 @@ class Te extends w {
3200
3200
  return new Te(d({
3201
3201
  args: e || se.create([]).rest(ve.create()),
3202
3202
  returns: t || ve.create(),
3203
- typeName: g.ZodFunction
3203
+ typeName: v.ZodFunction
3204
3204
  }, b(s)));
3205
3205
  }
3206
3206
  }
@@ -3213,9 +3213,9 @@ class ze extends w {
3213
3213
  return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
3214
3214
  }
3215
3215
  }
3216
- ze.create = (n, e) => new ze(d({
3217
- getter: n,
3218
- typeName: g.ZodLazy
3216
+ ze.create = (r, e) => new ze(d({
3217
+ getter: r,
3218
+ typeName: v.ZodLazy
3219
3219
  }, b(e)));
3220
3220
  class We extends w {
3221
3221
  _parse(e) {
@@ -3225,7 +3225,7 @@ class We extends w {
3225
3225
  received: t.data,
3226
3226
  code: l.invalid_literal,
3227
3227
  expected: this._def.value
3228
- }), v;
3228
+ }), _;
3229
3229
  }
3230
3230
  return { status: "valid", value: e.data };
3231
3231
  }
@@ -3233,14 +3233,14 @@ class We extends w {
3233
3233
  return this._def.value;
3234
3234
  }
3235
3235
  }
3236
- We.create = (n, e) => new We(d({
3237
- value: n,
3238
- typeName: g.ZodLiteral
3236
+ We.create = (r, e) => new We(d({
3237
+ value: r,
3238
+ typeName: v.ZodLiteral
3239
3239
  }, b(e)));
3240
- function fn(n, e) {
3240
+ function fr(r, e) {
3241
3241
  return new pe(d({
3242
- values: n,
3243
- typeName: g.ZodEnum
3242
+ values: r,
3243
+ typeName: v.ZodEnum
3244
3244
  }, b(e)));
3245
3245
  }
3246
3246
  class pe extends w {
@@ -3254,15 +3254,15 @@ class pe extends w {
3254
3254
  expected: x.joinValues(s),
3255
3255
  received: t.parsedType,
3256
3256
  code: l.invalid_type
3257
- }), v;
3257
+ }), _;
3258
3258
  }
3259
- if (st(this, Re) || cn(this, Re, new Set(this._def.values)), !st(this, Re).has(e.data)) {
3259
+ if (st(this, Re) || cr(this, Re, new Set(this._def.values)), !st(this, Re).has(e.data)) {
3260
3260
  const t = this._getOrReturnCtx(e), s = this._def.values;
3261
3261
  return h(t, {
3262
3262
  received: t.data,
3263
3263
  code: l.invalid_enum_value,
3264
3264
  options: s
3265
- }), v;
3265
+ }), _;
3266
3266
  }
3267
3267
  return $(e.data);
3268
3268
  }
@@ -3295,7 +3295,7 @@ class pe extends w {
3295
3295
  }
3296
3296
  }
3297
3297
  Re = /* @__PURE__ */ new WeakMap();
3298
- pe.create = fn;
3298
+ pe.create = fr;
3299
3299
  class Be extends w {
3300
3300
  constructor() {
3301
3301
  super(...arguments), Me.set(this, void 0);
@@ -3303,20 +3303,20 @@ class Be extends w {
3303
3303
  _parse(e) {
3304
3304
  const t = x.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
3305
3305
  if (s.parsedType !== p.string && s.parsedType !== p.number) {
3306
- const r = x.objectValues(t);
3306
+ const n = x.objectValues(t);
3307
3307
  return h(s, {
3308
- expected: x.joinValues(r),
3308
+ expected: x.joinValues(n),
3309
3309
  received: s.parsedType,
3310
3310
  code: l.invalid_type
3311
- }), v;
3311
+ }), _;
3312
3312
  }
3313
- if (st(this, Me) || cn(this, Me, new Set(x.getValidEnumValues(this._def.values))), !st(this, Me).has(e.data)) {
3314
- const r = x.objectValues(t);
3313
+ if (st(this, Me) || cr(this, Me, new Set(x.getValidEnumValues(this._def.values))), !st(this, Me).has(e.data)) {
3314
+ const n = x.objectValues(t);
3315
3315
  return h(s, {
3316
3316
  received: s.data,
3317
3317
  code: l.invalid_enum_value,
3318
- options: r
3319
- }), v;
3318
+ options: n
3319
+ }), _;
3320
3320
  }
3321
3321
  return $(e.data);
3322
3322
  }
@@ -3325,9 +3325,9 @@ class Be extends w {
3325
3325
  }
3326
3326
  }
3327
3327
  Me = /* @__PURE__ */ new WeakMap();
3328
- Be.create = (n, e) => new Be(d({
3329
- values: n,
3330
- typeName: g.ZodNativeEnum
3328
+ Be.create = (r, e) => new Be(d({
3329
+ values: r,
3330
+ typeName: v.ZodNativeEnum
3331
3331
  }, b(e)));
3332
3332
  class Oe extends w {
3333
3333
  unwrap() {
@@ -3340,27 +3340,27 @@ class Oe extends w {
3340
3340
  code: l.invalid_type,
3341
3341
  expected: p.promise,
3342
3342
  received: t.parsedType
3343
- }), v;
3343
+ }), _;
3344
3344
  const s = t.parsedType === p.promise ? t.data : Promise.resolve(t.data);
3345
- return $(s.then((r) => this._def.type.parseAsync(r, {
3345
+ return $(s.then((n) => this._def.type.parseAsync(n, {
3346
3346
  path: t.path,
3347
3347
  errorMap: t.common.contextualErrorMap
3348
3348
  })));
3349
3349
  }
3350
3350
  }
3351
- Oe.create = (n, e) => new Oe(d({
3352
- type: n,
3353
- typeName: g.ZodPromise
3351
+ Oe.create = (r, e) => new Oe(d({
3352
+ type: r,
3353
+ typeName: v.ZodPromise
3354
3354
  }, b(e)));
3355
3355
  class K extends w {
3356
3356
  innerType() {
3357
3357
  return this._def.schema;
3358
3358
  }
3359
3359
  sourceType() {
3360
- return this._def.schema._def.typeName === g.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
3360
+ return this._def.schema._def.typeName === v.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
3361
3361
  }
3362
3362
  _parse(e) {
3363
- const { status: t, ctx: s } = this._processInputParams(e), r = this._def.effect || null, a = {
3363
+ const { status: t, ctx: s } = this._processInputParams(e), n = this._def.effect || null, a = {
3364
3364
  addIssue: (i) => {
3365
3365
  h(s, i), i.fatal ? t.abort() : t.dirty();
3366
3366
  },
@@ -3368,33 +3368,33 @@ class K extends w {
3368
3368
  return s.path;
3369
3369
  }
3370
3370
  };
3371
- if (a.addIssue = a.addIssue.bind(a), r.type === "preprocess") {
3372
- const i = r.transform(s.data, a);
3371
+ if (a.addIssue = a.addIssue.bind(a), n.type === "preprocess") {
3372
+ const i = n.transform(s.data, a);
3373
3373
  if (s.common.async)
3374
3374
  return Promise.resolve(i).then((o) => M(this, null, function* () {
3375
3375
  if (t.value === "aborted")
3376
- return v;
3376
+ return _;
3377
3377
  const c = yield this._def.schema._parseAsync({
3378
3378
  data: o,
3379
3379
  path: s.path,
3380
3380
  parent: s
3381
3381
  });
3382
- return c.status === "aborted" ? v : c.status === "dirty" || t.value === "dirty" ? ke(c.value) : c;
3382
+ return c.status === "aborted" ? _ : c.status === "dirty" || t.value === "dirty" ? ke(c.value) : c;
3383
3383
  }));
3384
3384
  {
3385
3385
  if (t.value === "aborted")
3386
- return v;
3386
+ return _;
3387
3387
  const o = this._def.schema._parseSync({
3388
3388
  data: i,
3389
3389
  path: s.path,
3390
3390
  parent: s
3391
3391
  });
3392
- return o.status === "aborted" ? v : o.status === "dirty" || t.value === "dirty" ? ke(o.value) : o;
3392
+ return o.status === "aborted" ? _ : o.status === "dirty" || t.value === "dirty" ? ke(o.value) : o;
3393
3393
  }
3394
3394
  }
3395
- if (r.type === "refinement") {
3395
+ if (n.type === "refinement") {
3396
3396
  const i = (o) => {
3397
- const c = r.refinement(o, a);
3397
+ const c = n.refinement(o, a);
3398
3398
  if (s.common.async)
3399
3399
  return Promise.resolve(c);
3400
3400
  if (c instanceof Promise)
@@ -3407,11 +3407,11 @@ class K extends w {
3407
3407
  path: s.path,
3408
3408
  parent: s
3409
3409
  });
3410
- return o.status === "aborted" ? v : (o.status === "dirty" && t.dirty(), i(o.value), { status: t.value, value: o.value });
3410
+ return o.status === "aborted" ? _ : (o.status === "dirty" && t.dirty(), i(o.value), { status: t.value, value: o.value });
3411
3411
  } else
3412
- return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => o.status === "aborted" ? v : (o.status === "dirty" && t.dirty(), i(o.value).then(() => ({ status: t.value, value: o.value }))));
3412
+ return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => o.status === "aborted" ? _ : (o.status === "dirty" && t.dirty(), i(o.value).then(() => ({ status: t.value, value: o.value }))));
3413
3413
  }
3414
- if (r.type === "transform")
3414
+ if (n.type === "transform")
3415
3415
  if (s.common.async === !1) {
3416
3416
  const i = this._def.schema._parseSync({
3417
3417
  data: s.data,
@@ -3420,24 +3420,24 @@ class K extends w {
3420
3420
  });
3421
3421
  if (!_e(i))
3422
3422
  return i;
3423
- const o = r.transform(i.value, a);
3423
+ const o = n.transform(i.value, a);
3424
3424
  if (o instanceof Promise)
3425
3425
  throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
3426
3426
  return { status: t.value, value: o };
3427
3427
  } else
3428
- return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => _e(i) ? Promise.resolve(r.transform(i.value, a)).then((o) => ({ status: t.value, value: o })) : i);
3429
- x.assertNever(r);
3428
+ return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => _e(i) ? Promise.resolve(n.transform(i.value, a)).then((o) => ({ status: t.value, value: o })) : i);
3429
+ x.assertNever(n);
3430
3430
  }
3431
3431
  }
3432
- K.create = (n, e, t) => new K(d({
3433
- schema: n,
3434
- typeName: g.ZodEffects,
3432
+ K.create = (r, e, t) => new K(d({
3433
+ schema: r,
3434
+ typeName: v.ZodEffects,
3435
3435
  effect: e
3436
3436
  }, b(t)));
3437
- K.createWithPreprocess = (n, e, t) => new K(d({
3437
+ K.createWithPreprocess = (r, e, t) => new K(d({
3438
3438
  schema: e,
3439
- effect: { type: "preprocess", transform: n },
3440
- typeName: g.ZodEffects
3439
+ effect: { type: "preprocess", transform: r },
3440
+ typeName: v.ZodEffects
3441
3441
  }, b(t)));
3442
3442
  class te extends w {
3443
3443
  _parse(e) {
@@ -3447,9 +3447,9 @@ class te extends w {
3447
3447
  return this._def.innerType;
3448
3448
  }
3449
3449
  }
3450
- te.create = (n, e) => new te(d({
3451
- innerType: n,
3452
- typeName: g.ZodOptional
3450
+ te.create = (r, e) => new te(d({
3451
+ innerType: r,
3452
+ typeName: v.ZodOptional
3453
3453
  }, b(e)));
3454
3454
  class me extends w {
3455
3455
  _parse(e) {
@@ -3459,9 +3459,9 @@ class me extends w {
3459
3459
  return this._def.innerType;
3460
3460
  }
3461
3461
  }
3462
- me.create = (n, e) => new me(d({
3463
- innerType: n,
3464
- typeName: g.ZodNullable
3462
+ me.create = (r, e) => new me(d({
3463
+ innerType: r,
3464
+ typeName: v.ZodNullable
3465
3465
  }, b(e)));
3466
3466
  class qe extends w {
3467
3467
  _parse(e) {
@@ -3477,9 +3477,9 @@ class qe extends w {
3477
3477
  return this._def.innerType;
3478
3478
  }
3479
3479
  }
3480
- qe.create = (n, e) => new qe(d({
3481
- innerType: n,
3482
- typeName: g.ZodDefault,
3480
+ qe.create = (r, e) => new qe(d({
3481
+ innerType: r,
3482
+ typeName: v.ZodDefault,
3483
3483
  defaultValue: typeof e.default == "function" ? e.default : () => e.default
3484
3484
  }, b(e)));
3485
3485
  class He extends w {
@@ -3488,12 +3488,12 @@ class He extends w {
3488
3488
  common: y(d({}, t.common), {
3489
3489
  issues: []
3490
3490
  })
3491
- }), r = this._def.innerType._parse({
3491
+ }), n = this._def.innerType._parse({
3492
3492
  data: s.data,
3493
3493
  path: s.path,
3494
3494
  parent: d({}, s)
3495
3495
  });
3496
- return Pe(r) ? r.then((a) => ({
3496
+ return Pe(n) ? n.then((a) => ({
3497
3497
  status: "valid",
3498
3498
  value: a.status === "valid" ? a.value : this._def.catchValue({
3499
3499
  get error() {
@@ -3503,7 +3503,7 @@ class He extends w {
3503
3503
  })
3504
3504
  })) : {
3505
3505
  status: "valid",
3506
- value: r.status === "valid" ? r.value : this._def.catchValue({
3506
+ value: n.status === "valid" ? n.value : this._def.catchValue({
3507
3507
  get error() {
3508
3508
  return new z(s.common.issues);
3509
3509
  },
@@ -3515,9 +3515,9 @@ class He extends w {
3515
3515
  return this._def.innerType;
3516
3516
  }
3517
3517
  }
3518
- He.create = (n, e) => new He(d({
3519
- innerType: n,
3520
- typeName: g.ZodCatch,
3518
+ He.create = (r, e) => new He(d({
3519
+ innerType: r,
3520
+ typeName: v.ZodCatch,
3521
3521
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch
3522
3522
  }, b(e)));
3523
3523
  class ot extends w {
@@ -3528,14 +3528,14 @@ class ot extends w {
3528
3528
  code: l.invalid_type,
3529
3529
  expected: p.nan,
3530
3530
  received: s.parsedType
3531
- }), v;
3531
+ }), _;
3532
3532
  }
3533
3533
  return { status: "valid", value: e.data };
3534
3534
  }
3535
3535
  }
3536
- ot.create = (n) => new ot(d({
3537
- typeName: g.ZodNaN
3538
- }, b(n)));
3536
+ ot.create = (r) => new ot(d({
3537
+ typeName: v.ZodNaN
3538
+ }, b(r)));
3539
3539
  const Gs = Symbol("zod_brand");
3540
3540
  class Zt extends w {
3541
3541
  _parse(e) {
@@ -3560,23 +3560,23 @@ class Ke extends w {
3560
3560
  path: s.path,
3561
3561
  parent: s
3562
3562
  });
3563
- return a.status === "aborted" ? v : a.status === "dirty" ? (t.dirty(), ke(a.value)) : this._def.out._parseAsync({
3563
+ return a.status === "aborted" ? _ : a.status === "dirty" ? (t.dirty(), ke(a.value)) : this._def.out._parseAsync({
3564
3564
  data: a.value,
3565
3565
  path: s.path,
3566
3566
  parent: s
3567
3567
  });
3568
3568
  });
3569
3569
  {
3570
- const r = this._def.in._parseSync({
3570
+ const n = this._def.in._parseSync({
3571
3571
  data: s.data,
3572
3572
  path: s.path,
3573
3573
  parent: s
3574
3574
  });
3575
- return r.status === "aborted" ? v : r.status === "dirty" ? (t.dirty(), {
3575
+ return n.status === "aborted" ? _ : n.status === "dirty" ? (t.dirty(), {
3576
3576
  status: "dirty",
3577
- value: r.value
3577
+ value: n.value
3578
3578
  }) : this._def.out._parseSync({
3579
- data: r.value,
3579
+ data: n.value,
3580
3580
  path: s.path,
3581
3581
  parent: s
3582
3582
  });
@@ -3586,60 +3586,73 @@ class Ke extends w {
3586
3586
  return new Ke({
3587
3587
  in: e,
3588
3588
  out: t,
3589
- typeName: g.ZodPipeline
3589
+ typeName: v.ZodPipeline
3590
3590
  });
3591
3591
  }
3592
3592
  }
3593
3593
  class Je extends w {
3594
3594
  _parse(e) {
3595
- const t = this._def.innerType._parse(e), s = (r) => (_e(r) && (r.value = Object.freeze(r.value)), r);
3596
- return Pe(t) ? t.then((r) => s(r)) : s(t);
3595
+ const t = this._def.innerType._parse(e), s = (n) => (_e(n) && (n.value = Object.freeze(n.value)), n);
3596
+ return Pe(t) ? t.then((n) => s(n)) : s(t);
3597
3597
  }
3598
3598
  unwrap() {
3599
3599
  return this._def.innerType;
3600
3600
  }
3601
3601
  }
3602
- Je.create = (n, e) => new Je(d({
3603
- innerType: n,
3604
- typeName: g.ZodReadonly
3602
+ Je.create = (r, e) => new Je(d({
3603
+ innerType: r,
3604
+ typeName: v.ZodReadonly
3605
3605
  }, b(e)));
3606
- function hn(n, e = {}, t) {
3607
- return n ? Ae.create().superRefine((s, r) => {
3606
+ function Ht(r, e) {
3607
+ const t = typeof r == "function" ? r(e) : typeof r == "string" ? { message: r } : r;
3608
+ return typeof t == "string" ? { message: t } : t;
3609
+ }
3610
+ function hr(r, e = {}, t) {
3611
+ return r ? Ae.create().superRefine((s, n) => {
3608
3612
  var a, i;
3609
- if (!n(s)) {
3610
- const o = typeof e == "function" ? e(s) : typeof e == "string" ? { message: e } : e, c = (i = (a = o.fatal) !== null && a !== void 0 ? a : t) !== null && i !== void 0 ? i : !0, u = typeof o == "string" ? { message: o } : o;
3611
- r.addIssue(y(d({ code: "custom" }, u), { fatal: c }));
3613
+ const o = r(s);
3614
+ if (o instanceof Promise)
3615
+ return o.then((c) => {
3616
+ var u, f;
3617
+ if (!c) {
3618
+ const g = Ht(e, s), O = (f = (u = g.fatal) !== null && u !== void 0 ? u : t) !== null && f !== void 0 ? f : !0;
3619
+ n.addIssue(y(d({ code: "custom" }, g), { fatal: O }));
3620
+ }
3621
+ });
3622
+ if (!o) {
3623
+ const c = Ht(e, s), u = (i = (a = c.fatal) !== null && a !== void 0 ? a : t) !== null && i !== void 0 ? i : !0;
3624
+ n.addIssue(y(d({ code: "custom" }, c), { fatal: u }));
3612
3625
  }
3613
3626
  }) : Ae.create();
3614
3627
  }
3615
3628
  const Ks = {
3616
3629
  object: S.lazycreate
3617
3630
  };
3618
- var g;
3619
- (function(n) {
3620
- n.ZodString = "ZodString", n.ZodNumber = "ZodNumber", n.ZodNaN = "ZodNaN", n.ZodBigInt = "ZodBigInt", n.ZodBoolean = "ZodBoolean", n.ZodDate = "ZodDate", n.ZodSymbol = "ZodSymbol", n.ZodUndefined = "ZodUndefined", n.ZodNull = "ZodNull", n.ZodAny = "ZodAny", n.ZodUnknown = "ZodUnknown", n.ZodNever = "ZodNever", n.ZodVoid = "ZodVoid", n.ZodArray = "ZodArray", n.ZodObject = "ZodObject", n.ZodUnion = "ZodUnion", n.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", n.ZodIntersection = "ZodIntersection", n.ZodTuple = "ZodTuple", n.ZodRecord = "ZodRecord", n.ZodMap = "ZodMap", n.ZodSet = "ZodSet", n.ZodFunction = "ZodFunction", n.ZodLazy = "ZodLazy", n.ZodLiteral = "ZodLiteral", n.ZodEnum = "ZodEnum", n.ZodEffects = "ZodEffects", n.ZodNativeEnum = "ZodNativeEnum", n.ZodOptional = "ZodOptional", n.ZodNullable = "ZodNullable", n.ZodDefault = "ZodDefault", n.ZodCatch = "ZodCatch", n.ZodPromise = "ZodPromise", n.ZodBranded = "ZodBranded", n.ZodPipeline = "ZodPipeline", n.ZodReadonly = "ZodReadonly";
3621
- })(g || (g = {}));
3622
- const Xs = (n, e = {
3623
- message: `Input not instance of ${n.name}`
3624
- }) => hn((t) => t instanceof n, e), pn = J.create, mn = fe.create, Ys = ot.create, Qs = he.create, yn = $e.create, er = be.create, tr = rt.create, nr = Fe.create, sr = Ve.create, rr = Ae.create, ar = ve.create, ir = ce.create, or = at.create, cr = G.create, dr = S.create, ur = S.strictCreate, lr = De.create, fr = dt.create, hr = Le.create, pr = se.create, mr = Ue.create, yr = it.create, gr = we.create, vr = Te.create, _r = ze.create, br = We.create, wr = pe.create, xr = Be.create, kr = Oe.create, Ht = K.create, Tr = te.create, Sr = me.create, Er = K.createWithPreprocess, Ar = Ke.create, Or = () => pn().optional(), Cr = () => mn().optional(), Nr = () => yn().optional(), Ir = {
3625
- string: (n) => J.create(y(d({}, n), { coerce: !0 })),
3626
- number: (n) => fe.create(y(d({}, n), { coerce: !0 })),
3627
- boolean: (n) => $e.create(y(d({}, n), {
3631
+ var v;
3632
+ (function(r) {
3633
+ r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
3634
+ })(v || (v = {}));
3635
+ const Xs = (r, e = {
3636
+ message: `Input not instance of ${r.name}`
3637
+ }) => hr((t) => t instanceof r, e), pr = J.create, mr = fe.create, Ys = ot.create, Qs = he.create, yr = $e.create, en = be.create, tn = nt.create, rn = Fe.create, sn = Ve.create, nn = Ae.create, an = ve.create, on = ce.create, cn = at.create, dn = G.create, un = S.create, ln = S.strictCreate, fn = De.create, hn = dt.create, pn = Le.create, mn = se.create, yn = Ue.create, gn = it.create, vn = we.create, _n = Te.create, bn = ze.create, wn = We.create, xn = pe.create, kn = Be.create, Tn = Oe.create, Jt = K.create, Sn = te.create, En = me.create, An = K.createWithPreprocess, On = Ke.create, Cn = () => pr().optional(), Nn = () => mr().optional(), In = () => yr().optional(), jn = {
3638
+ string: (r) => J.create(y(d({}, r), { coerce: !0 })),
3639
+ number: (r) => fe.create(y(d({}, r), { coerce: !0 })),
3640
+ boolean: (r) => $e.create(y(d({}, r), {
3628
3641
  coerce: !0
3629
3642
  })),
3630
- bigint: (n) => he.create(y(d({}, n), { coerce: !0 })),
3631
- date: (n) => be.create(y(d({}, n), { coerce: !0 }))
3632
- }, jr = v;
3633
- var N = /* @__PURE__ */ Object.freeze({
3643
+ bigint: (r) => he.create(y(d({}, r), { coerce: !0 })),
3644
+ date: (r) => be.create(y(d({}, r), { coerce: !0 }))
3645
+ }, Zn = _;
3646
+ var I = /* @__PURE__ */ Object.freeze({
3634
3647
  __proto__: null,
3635
3648
  defaultErrorMap: Ee,
3636
3649
  setErrorMap: Es,
3637
3650
  getErrorMap: tt,
3638
- makeIssue: nt,
3651
+ makeIssue: rt,
3639
3652
  EMPTY_PATH: As,
3640
3653
  addIssueToContext: h,
3641
3654
  ParseStatus: Z,
3642
- INVALID: v,
3655
+ INVALID: _,
3643
3656
  DIRTY: ke,
3644
3657
  OK: $,
3645
3658
  isAborted: At,
@@ -3655,13 +3668,13 @@ var N = /* @__PURE__ */ Object.freeze({
3655
3668
  ZodParsedType: p,
3656
3669
  getParsedType: oe,
3657
3670
  ZodType: w,
3658
- datetimeRegex: ln,
3671
+ datetimeRegex: lr,
3659
3672
  ZodString: J,
3660
3673
  ZodNumber: fe,
3661
3674
  ZodBigInt: he,
3662
3675
  ZodBoolean: $e,
3663
3676
  ZodDate: be,
3664
- ZodSymbol: rt,
3677
+ ZodSymbol: nt,
3665
3678
  ZodUndefined: Fe,
3666
3679
  ZodNull: Ve,
3667
3680
  ZodAny: Ae,
@@ -3694,67 +3707,67 @@ var N = /* @__PURE__ */ Object.freeze({
3694
3707
  ZodBranded: Zt,
3695
3708
  ZodPipeline: Ke,
3696
3709
  ZodReadonly: Je,
3697
- custom: hn,
3710
+ custom: hr,
3698
3711
  Schema: w,
3699
3712
  ZodSchema: w,
3700
3713
  late: Ks,
3701
3714
  get ZodFirstPartyTypeKind() {
3702
- return g;
3715
+ return v;
3703
3716
  },
3704
- coerce: Ir,
3705
- any: rr,
3706
- array: cr,
3717
+ coerce: jn,
3718
+ any: nn,
3719
+ array: dn,
3707
3720
  bigint: Qs,
3708
- boolean: yn,
3709
- date: er,
3710
- discriminatedUnion: fr,
3711
- effect: Ht,
3712
- enum: wr,
3713
- function: vr,
3721
+ boolean: yr,
3722
+ date: en,
3723
+ discriminatedUnion: hn,
3724
+ effect: Jt,
3725
+ enum: xn,
3726
+ function: _n,
3714
3727
  instanceof: Xs,
3715
- intersection: hr,
3716
- lazy: _r,
3717
- literal: br,
3718
- map: yr,
3728
+ intersection: pn,
3729
+ lazy: bn,
3730
+ literal: wn,
3731
+ map: gn,
3719
3732
  nan: Ys,
3720
- nativeEnum: xr,
3721
- never: ir,
3722
- null: sr,
3723
- nullable: Sr,
3724
- number: mn,
3725
- object: dr,
3726
- oboolean: Nr,
3727
- onumber: Cr,
3728
- optional: Tr,
3729
- ostring: Or,
3730
- pipeline: Ar,
3731
- preprocess: Er,
3732
- promise: kr,
3733
- record: mr,
3734
- set: gr,
3735
- strictObject: ur,
3736
- string: pn,
3737
- symbol: tr,
3738
- transformer: Ht,
3739
- tuple: pr,
3740
- undefined: nr,
3741
- union: lr,
3742
- unknown: ar,
3743
- void: or,
3744
- NEVER: jr,
3733
+ nativeEnum: kn,
3734
+ never: on,
3735
+ null: sn,
3736
+ nullable: En,
3737
+ number: mr,
3738
+ object: un,
3739
+ oboolean: In,
3740
+ onumber: Nn,
3741
+ optional: Sn,
3742
+ ostring: Cn,
3743
+ pipeline: On,
3744
+ preprocess: An,
3745
+ promise: Tn,
3746
+ record: yn,
3747
+ set: vn,
3748
+ strictObject: ln,
3749
+ string: pr,
3750
+ symbol: tn,
3751
+ transformer: Jt,
3752
+ tuple: mn,
3753
+ undefined: rn,
3754
+ union: fn,
3755
+ unknown: an,
3756
+ void: cn,
3757
+ NEVER: Zn,
3745
3758
  ZodIssueCode: l,
3746
3759
  quotelessJson: Ss,
3747
3760
  ZodError: z
3748
3761
  });
3749
- const Zr = N.object({
3750
- language: N.enum(["typescript", "javascript"]).optional(),
3751
- disableMarkedForExport: N.boolean().optional()
3762
+ const Rn = I.object({
3763
+ language: I.enum(["typescript", "javascript"]).optional(),
3764
+ disableMarkedForExport: I.boolean().optional()
3752
3765
  }).and(
3753
- N.union([
3754
- N.object({
3755
- framework: N.literal("react"),
3756
- model: N.string().optional(),
3757
- styling: N.enum([
3766
+ I.union([
3767
+ I.object({
3768
+ framework: I.literal("react"),
3769
+ model: I.string().optional(),
3770
+ styling: I.enum([
3758
3771
  "plain_css",
3759
3772
  "css_modules",
3760
3773
  "styled_components",
@@ -3763,33 +3776,33 @@ const Zr = N.object({
3763
3776
  "scss",
3764
3777
  "inline_styles"
3765
3778
  ]),
3766
- uiLibrary: N.enum(["mui", "antd", "radix", "shadcn"]).optional(),
3767
- enableUILibraryTheming: N.boolean().optional(),
3768
- enableCompactStructure: N.boolean().optional(),
3769
- enableAutoSplit: N.boolean().optional(),
3770
- autoSplitThreshold: N.number().optional()
3779
+ uiLibrary: I.enum(["mui", "antd", "radix", "shadcn"]).optional(),
3780
+ enableUILibraryTheming: I.boolean().optional(),
3781
+ enableCompactStructure: I.boolean().optional(),
3782
+ enableAutoSplit: I.boolean().optional(),
3783
+ autoSplitThreshold: I.number().optional()
3771
3784
  }),
3772
- N.object({
3773
- framework: N.literal("html"),
3774
- styling: N.enum(["plain_css", "inline_styles"]),
3775
- enableTranslation: N.boolean().optional()
3785
+ I.object({
3786
+ framework: I.literal("html"),
3787
+ styling: I.enum(["plain_css", "inline_styles"]),
3788
+ enableTranslation: I.boolean().optional()
3776
3789
  })
3777
3790
  ])
3778
- ), Rr = (n) => {
3779
- const e = Zr.safeParse(n);
3791
+ ), Mn = (r) => {
3792
+ const e = Rn.safeParse(r);
3780
3793
  if (e.success === !1) {
3781
3794
  const t = new Error("Invalid codegen settings");
3782
3795
  throw t.cause = e.error, t;
3783
3796
  }
3784
3797
  return e.data;
3785
- }, Jt = /* @__PURE__ */ new Set([
3798
+ }, Gt = /* @__PURE__ */ new Set([
3786
3799
  "FRAME",
3787
3800
  "INSTANCE",
3788
3801
  "COMPONENT",
3789
3802
  "COMPONENT_SET",
3790
3803
  "GROUP"
3791
- ]), Mr = (n, e) => {
3792
- const t = an(n.document, e);
3804
+ ]), Pn = (r, e) => {
3805
+ const t = ir(r.document, e);
3793
3806
  if (!t)
3794
3807
  return {
3795
3808
  isValid: !1,
@@ -3797,7 +3810,7 @@ const Zr = N.object({
3797
3810
  };
3798
3811
  if (t.type === "CANVAS") {
3799
3812
  const s = t.children.filter(
3800
- (r) => Jt.has(r.type)
3813
+ (n) => Gt.has(n.type)
3801
3814
  );
3802
3815
  return s.length === 1 ? {
3803
3816
  isValid: !0,
@@ -3808,13 +3821,13 @@ const Zr = N.object({
3808
3821
  reason: "Selected node is a page with multiple children"
3809
3822
  };
3810
3823
  }
3811
- return Jt.has(t.type) ? { isValid: !0, node: t } : {
3824
+ return Gt.has(t.type) ? { isValid: !0, node: t } : {
3812
3825
  isValid: !1,
3813
3826
  reason: "Selected node type is not supported"
3814
3827
  };
3815
3828
  };
3816
- var L, Ge, ct, gn;
3817
- class Wr {
3829
+ var L, Ge, ct, gr;
3830
+ class Bn {
3818
3831
  constructor({
3819
3832
  auth: e,
3820
3833
  apiBaseAddress: t = "https://public-api.animaapp.com"
@@ -3838,11 +3851,11 @@ class Wr {
3838
3851
  }
3839
3852
  generateCode(s) {
3840
3853
  return M(this, arguments, function* (e, t = {}) {
3841
- var _, I, O, C, R, B, re, de, V;
3854
+ var g, O, C, N, R, B, ne, de, V;
3842
3855
  if (this.hasAuth() === !1)
3843
3856
  throw new Error('It needs to set "auth" before calling this method.');
3844
- e.figmaToken && (yield $t(this, ct, gn).call(this, e.fileKey, e.figmaToken, e.nodesId));
3845
- const r = {}, a = Rr(e.settings);
3857
+ e.figmaToken && (yield $t(this, ct, gr).call(this, e.fileKey, e.figmaToken, e.nodesId));
3858
+ const n = {}, a = Mn(e.settings);
3846
3859
  let i = e.tracking;
3847
3860
  H(this, L) && "userId" in H(this, L) && H(this, L).userId && (i != null && i.externalId || (i = { externalId: H(this, L).userId }));
3848
3861
  const o = yield fetch(`${H(this, Ge)}/v1/codegen`, {
@@ -3876,7 +3889,7 @@ class Wr {
3876
3889
  q = JSON.parse(X);
3877
3890
  } catch (Ce) {
3878
3891
  }
3879
- throw ((_ = q == null ? void 0 : q.error) == null ? void 0 : _.name) === "ZodError" ? new ue({
3892
+ throw ((g = q == null ? void 0 : q.error) == null ? void 0 : g.name) === "ZodError" ? new ue({
3880
3893
  name: "HTTP error from Anima API",
3881
3894
  reason: "Invalid body payload",
3882
3895
  detail: q.error.issues,
@@ -3918,15 +3931,15 @@ class Wr {
3918
3931
  }
3919
3932
  switch (k.type) {
3920
3933
  case "queueing": {
3921
- typeof t == "function" ? t(k) : (I = t.onQueueing) == null || I.call(t);
3934
+ typeof t == "function" ? t(k) : (O = t.onQueueing) == null || O.call(t);
3922
3935
  break;
3923
3936
  }
3924
3937
  case "start": {
3925
- r.sessionId = k.sessionId, typeof t == "function" ? t(k) : (O = t.onStart) == null || O.call(t, { sessionId: k.sessionId });
3938
+ n.sessionId = k.sessionId, typeof t == "function" ? t(k) : (C = t.onStart) == null || C.call(t, { sessionId: k.sessionId });
3926
3939
  break;
3927
3940
  }
3928
3941
  case "pre_codegen": {
3929
- typeof t == "function" ? t(k) : (C = t.onPreCodegen) == null || C.call(t, { message: k.message });
3942
+ typeof t == "function" ? t(k) : (N = t.onPreCodegen) == null || N.call(t, { message: k.message });
3930
3943
  break;
3931
3944
  }
3932
3945
  case "assets_uploaded": {
@@ -3934,18 +3947,18 @@ class Wr {
3934
3947
  break;
3935
3948
  }
3936
3949
  case "assets_list": {
3937
- r.assets = k.payload.assets, typeof t == "function" ? t(k) : (B = t.onAssetsList) == null || B.call(t, k.payload);
3950
+ n.assets = k.payload.assets, typeof t == "function" ? t(k) : (B = t.onAssetsList) == null || B.call(t, k.payload);
3938
3951
  break;
3939
3952
  }
3940
3953
  case "figma_metadata": {
3941
- r.figmaFileName = k.figmaFileName, r.figmaSelectedFrameName = k.figmaSelectedFrameName, typeof t == "function" ? t(k) : (re = t.onFigmaMetadata) == null || re.call(t, {
3954
+ n.figmaFileName = k.figmaFileName, n.figmaSelectedFrameName = k.figmaSelectedFrameName, typeof t == "function" ? t(k) : (ne = t.onFigmaMetadata) == null || ne.call(t, {
3942
3955
  figmaFileName: k.figmaFileName,
3943
3956
  figmaSelectedFrameName: k.figmaSelectedFrameName
3944
3957
  });
3945
3958
  break;
3946
3959
  }
3947
3960
  case "generating_code": {
3948
- k.payload.status === "success" && (r.files = k.payload.files), typeof t == "function" ? t(k) : (de = t.onGeneratingCode) == null || de.call(t, {
3961
+ k.payload.status === "success" && (n.files = k.payload.files), typeof t == "function" ? t(k) : (de = t.onGeneratingCode) == null || de.call(t, {
3949
3962
  status: k.payload.status,
3950
3963
  progress: k.payload.progress,
3951
3964
  files: k.payload.files
@@ -3962,12 +3975,12 @@ class Wr {
3962
3975
  reason: k.payload.reason
3963
3976
  });
3964
3977
  case "done": {
3965
- if (!r.files)
3978
+ if (!n.files)
3966
3979
  throw new ue({
3967
3980
  name: "Invalid response",
3968
3981
  reason: "No code generated"
3969
3982
  });
3970
- return r.tokenUsage = k.payload.tokenUsage, r;
3983
+ return n.tokenUsage = k.payload.tokenUsage, n;
3971
3984
  }
3972
3985
  }
3973
3986
  }
@@ -3983,11 +3996,11 @@ class Wr {
3983
3996
  });
3984
3997
  }
3985
3998
  }
3986
- L = new WeakMap(), Ge = new WeakMap(), ct = new WeakSet(), gn = function(e, t, s) {
3999
+ L = new WeakMap(), Ge = new WeakMap(), ct = new WeakSet(), gr = function(e, t, s) {
3987
4000
  return M(this, null, function* () {
3988
- let r;
4001
+ let n;
3989
4002
  try {
3990
- r = yield Ts({
4003
+ n = yield Ts({
3991
4004
  fileKey: e,
3992
4005
  authToken: t,
3993
4006
  params: {
@@ -3998,7 +4011,7 @@ L = new WeakMap(), Ge = new WeakMap(), ct = new WeakSet(), gn = function(e, t, s
3998
4011
  return;
3999
4012
  }
4000
4013
  const i = s.map(
4001
- (o) => Mr(r, o)
4014
+ (o) => Pn(n, o)
4002
4015
  ).find(
4003
4016
  (o) => !o.isValid
4004
4017
  );
@@ -4009,47 +4022,50 @@ L = new WeakMap(), Ge = new WeakMap(), ct = new WeakSet(), gn = function(e, t, s
4009
4022
  });
4010
4023
  });
4011
4024
  };
4012
- const Br = (n) => {
4025
+ const qn = (r) => {
4013
4026
  var e;
4014
- if (!n)
4027
+ if (!r)
4015
4028
  return [!1, "", ""];
4016
4029
  try {
4017
- const t = new URL(n), s = t.pathname;
4030
+ const t = new URL(r), s = t.pathname;
4018
4031
  if (t.origin !== "https://www.figma.com")
4019
4032
  return [!1, "", ""];
4020
- const r = ((e = t.searchParams.get("node-id")) != null ? e : "").replace(/-/g, ":"), a = s.split("/")[2];
4021
- return [(s.startsWith("/file/") && t.searchParams.get("type") !== "whiteboard" || s.startsWith("/design/")) && a.length === 22, a, r];
4033
+ const n = t.toString();
4034
+ if (r !== n)
4035
+ return [!1, "", ""];
4036
+ const a = ((e = t.searchParams.get("node-id")) != null ? e : "").replace(/-/g, ":"), i = s.split("/")[2];
4037
+ return [(s.startsWith("/file/") && t.searchParams.get("type") !== "whiteboard" || s.startsWith("/design/")) && i.length === 22, i, a];
4022
4038
  } catch (t) {
4023
4039
  return [!1, "", ""];
4024
4040
  }
4025
- }, qr = ({
4026
- fileKey: n,
4041
+ }, Hn = ({
4042
+ fileKey: r,
4027
4043
  nodeId: e,
4028
4044
  duplicate: t
4029
4045
  }) => {
4030
4046
  const s = new URL("https://www.figma.com");
4031
- return s.pathname = `design/${n}`, t && (s.pathname = `${s.pathname}/duplicate`), e && s.searchParams.set("node-id", e.replace(":", "-")), s;
4047
+ return s.pathname = `design/${r}`, t && (s.pathname = `${s.pathname}/duplicate`), e && s.searchParams.set("node-id", e.replace(":", "-")), s;
4032
4048
  };
4033
- class Hr extends Error {
4049
+ class Jn extends Error {
4034
4050
  constructor(e, t) {
4035
4051
  super(e), this.response = t;
4036
4052
  }
4037
4053
  }
4038
- const Jr = ({
4039
- files: n,
4054
+ const Gn = ({
4055
+ files: r,
4040
4056
  screenPath: e = "src/screens"
4041
4057
  }) => {
4042
4058
  const t = {}, s = /* @__PURE__ */ new Set();
4043
- function r(a) {
4044
- if (s.has(a) || !n[a])
4059
+ function n(a) {
4060
+ if (s.has(a) || !r[a])
4045
4061
  return;
4046
- s.add(a), t[a] = n[a], Pr(n[a].content).forEach((o) => {
4062
+ s.add(a), t[a] = r[a], $n(r[a].content).forEach((o) => {
4047
4063
  try {
4048
- const c = $r(a, o);
4064
+ const c = Fn(a, o);
4049
4065
  if (c.startsWith("src/")) {
4050
4066
  const u = c.split("/").slice(0, -1).join("/");
4051
- Fr(n, u).forEach((_) => {
4052
- s.has(_) || r(_);
4067
+ Vn(r, u).forEach((g) => {
4068
+ s.has(g) || n(g);
4053
4069
  });
4054
4070
  }
4055
4071
  } catch (c) {
@@ -4060,33 +4076,33 @@ const Jr = ({
4060
4076
  }
4061
4077
  });
4062
4078
  }
4063
- return Object.entries(n).forEach(([a, i]) => {
4064
- a.startsWith(e) ? r(a) : a.startsWith("src/") || (t[a] = i);
4079
+ return Object.entries(r).forEach(([a, i]) => {
4080
+ a.startsWith(e) ? n(a) : a.startsWith("src/") || (t[a] = i);
4065
4081
  }), t;
4066
4082
  };
4067
- function Pr(n) {
4083
+ function $n(r) {
4068
4084
  const e = /import.*?["']([^"']+)["']/g, t = /export.*from\s+["']([^"']+)["']/g, s = [];
4069
- let r;
4070
- for (; (r = e.exec(n)) !== null; )
4071
- s.push(r[1]);
4072
- for (; (r = t.exec(n)) !== null; )
4073
- s.push(r[1]);
4085
+ let n;
4086
+ for (; (n = e.exec(r)) !== null; )
4087
+ s.push(n[1]);
4088
+ for (; (n = t.exec(r)) !== null; )
4089
+ s.push(n[1]);
4074
4090
  return [...new Set(s)];
4075
4091
  }
4076
- function $r(n, e) {
4092
+ function Fn(r, e) {
4077
4093
  if (!e.startsWith("."))
4078
4094
  return e;
4079
- const t = n.split("/").slice(0, -1), s = e.split("/"), r = [...t];
4095
+ const t = r.split("/").slice(0, -1), s = e.split("/"), n = [...t];
4080
4096
  for (const a of s)
4081
- a === ".." ? r.pop() : a !== "." && r.push(a);
4082
- return r.join("/");
4097
+ a === ".." ? n.pop() : a !== "." && n.push(a);
4098
+ return n.join("/");
4083
4099
  }
4084
- function Fr(n, e) {
4085
- return Object.keys(n).filter((t) => t.startsWith(e));
4100
+ function Vn(r, e) {
4101
+ return Object.keys(r).filter((t) => t.startsWith(e));
4086
4102
  }
4087
- const Vr = (n, e) => new ReadableStream({
4103
+ const Dn = (r, e) => new ReadableStream({
4088
4104
  start(t) {
4089
- n.generateCode(e, (s) => {
4105
+ r.generateCode(e, (s) => {
4090
4106
  s.type === "error" || t.enqueue(s), (s.type === "aborted" || s.type === "error") && t.close();
4091
4107
  }).then((s) => {
4092
4108
  t.enqueue({
@@ -4108,26 +4124,26 @@ const Vr = (n, e) => new ReadableStream({
4108
4124
  }), t.close();
4109
4125
  });
4110
4126
  }
4111
- }), Gr = (n, e) => M(void 0, null, function* () {
4112
- var c, u, f, _, I, O, C;
4113
- const t = Vr(n, e), [s, r] = t.tee(), a = yield s.getReader().read();
4127
+ }), Kn = (r, e) => M(void 0, null, function* () {
4128
+ var c, u, f, g, O, C, N;
4129
+ const t = Dn(r, e), [s, n] = t.tee(), a = yield s.getReader().read();
4114
4130
  if (a.done || !a.value || ((c = a.value) == null ? void 0 : c.type) === "error" && ((f = (u = a.value) == null ? void 0 : u.payload) != null && f.status))
4115
4131
  return new Response(JSON.stringify(a.value), {
4116
- status: ((_ = a.value) == null ? void 0 : _.type) === "error" && (C = (O = (I = a.value) == null ? void 0 : I.payload) == null ? void 0 : O.status) != null ? C : 500,
4132
+ status: ((g = a.value) == null ? void 0 : g.type) === "error" && (N = (C = (O = a.value) == null ? void 0 : O.payload) == null ? void 0 : C.status) != null ? N : 500,
4117
4133
  headers: {
4118
4134
  "Content-Type": "application/json"
4119
4135
  }
4120
4136
  });
4121
- const i = new TextEncoder(), o = r.pipeThrough(
4137
+ const i = new TextEncoder(), o = n.pipeThrough(
4122
4138
  new TransformStream({
4123
4139
  transform(R, B) {
4124
- const re = `event: ${R.type}
4140
+ const ne = `event: ${R.type}
4125
4141
  data: ${JSON.stringify(
4126
4142
  R
4127
4143
  )}
4128
4144
 
4129
4145
  `;
4130
- B.enqueue(i.encode(re));
4146
+ B.enqueue(i.encode(ne));
4131
4147
  }
4132
4148
  })
4133
4149
  );
@@ -4141,28 +4157,28 @@ data: ${JSON.stringify(
4141
4157
  });
4142
4158
  });
4143
4159
  export {
4144
- Wr as Anima,
4160
+ Bn as Anima,
4145
4161
  ue as CodegenError,
4146
- kn as FigmaTokenIssue,
4147
- Sn as NotFound,
4148
- Tn as RateLimitExceeded,
4149
- Hr as ResponseError,
4150
- An as UnknownFigmaApiException,
4151
- Gr as createCodegenResponseEventStream,
4152
- Vr as createCodegenStream,
4153
- an as findChildrenNode,
4154
- qr as formatToFigmaLink,
4155
- Ur as getFigmaApiErrorType,
4162
+ kr as FigmaTokenIssue,
4163
+ Sr as NotFound,
4164
+ Tr as RateLimitExceeded,
4165
+ Jn as ResponseError,
4166
+ Ar as UnknownFigmaApiException,
4167
+ Kn as createCodegenResponseEventStream,
4168
+ Dn as createCodegenStream,
4169
+ ir as findChildrenNode,
4170
+ Hn as formatToFigmaLink,
4171
+ zn as getFigmaApiErrorType,
4156
4172
  Ts as getFigmaFile,
4157
- zr as getFileNodes,
4158
- Jr as getRelatedScreenFiles,
4159
- Cn as isFigmaTokenIssue,
4160
- Mr as isNodeCodegenCompatible,
4161
- En as isNotFound,
4162
- On as isRateLimitExceeded,
4163
- Lr as isUnknownFigmaApiException,
4164
- Br as isValidFigmaUrl,
4165
- Rr as validateSettings,
4166
- Qt as wrapFigmaApiError
4173
+ Wn as getFileNodes,
4174
+ Gn as getRelatedScreenFiles,
4175
+ Cr as isFigmaTokenIssue,
4176
+ Pn as isNodeCodegenCompatible,
4177
+ Er as isNotFound,
4178
+ Or as isRateLimitExceeded,
4179
+ Un as isUnknownFigmaApiException,
4180
+ qn as isValidFigmaUrl,
4181
+ Mn as validateSettings,
4182
+ er as wrapFigmaApiError
4167
4183
  };
4168
4184
  //# sourceMappingURL=index.js.map