@animaapp/anima-sdk 0.6.22 → 0.6.23

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,189 +1,189 @@
1
- var xr = Object.defineProperty, kr = Object.defineProperties;
2
- var Tr = Object.getOwnPropertyDescriptors;
1
+ var xs = Object.defineProperty, ks = Object.defineProperties;
2
+ var Ts = Object.getOwnPropertyDescriptors;
3
3
  var Ft = Object.getOwnPropertySymbols;
4
- var Sr = Object.prototype.hasOwnProperty, Er = Object.prototype.propertyIsEnumerable;
5
- var Lt = (r) => {
6
- throw TypeError(r);
4
+ var Ss = Object.prototype.hasOwnProperty, Es = Object.prototype.propertyIsEnumerable;
5
+ var Lt = (s) => {
6
+ throw TypeError(s);
7
7
  };
8
- var Dt = (r, e, t) => e in r ? xr(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, u = (r, e) => {
8
+ var Dt = (s, e, t) => e in s ? xs(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, d = (s, e) => {
9
9
  for (var t in e || (e = {}))
10
- Sr.call(e, t) && Dt(r, t, e[t]);
10
+ Ss.call(e, t) && Dt(s, t, e[t]);
11
11
  if (Ft)
12
12
  for (var t of Ft(e))
13
- Er.call(e, t) && Dt(r, t, e[t]);
14
- return r;
15
- }, g = (r, e) => kr(r, Tr(e));
16
- var mt = (r, e, t) => e.has(r) || Lt("Cannot " + t);
17
- var A = (r, e, t) => (mt(r, e, "read from private field"), t ? t.call(r) : e.get(r)), tt = (r, e, t) => e.has(r) ? Lt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), gt = (r, e, t, s) => (mt(r, e, "write to private field"), s ? s.call(r, t) : e.set(r, t), t), Se = (r, e, t) => (mt(r, e, "access private method"), t);
18
- var C = (r, e, t) => new Promise((s, n) => {
13
+ Es.call(e, t) && Dt(s, t, e[t]);
14
+ return s;
15
+ }, g = (s, e) => ks(s, Ts(e));
16
+ var mt = (s, e, t) => e.has(s) || Lt("Cannot " + t);
17
+ var C = (s, e, t) => (mt(s, e, "read from private field"), t ? t.call(s) : e.get(s)), tt = (s, e, t) => e.has(s) ? Lt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), gt = (s, e, t, r) => (mt(s, e, "write to private field"), r ? r.call(s, t) : e.set(s, t), t), Te = (s, e, t) => (mt(s, e, "access private method"), t);
18
+ var I = (s, e, t) => new Promise((r, n) => {
19
19
  var a = (c) => {
20
20
  try {
21
21
  o(t.next(c));
22
- } catch (d) {
23
- n(d);
22
+ } catch (u) {
23
+ n(u);
24
24
  }
25
25
  }, i = (c) => {
26
26
  try {
27
27
  o(t.throw(c));
28
- } catch (d) {
29
- n(d);
28
+ } catch (u) {
29
+ n(u);
30
30
  }
31
- }, o = (c) => c.done ? s(c.value) : Promise.resolve(c.value).then(a, i);
32
- o((t = t.apply(r, e)).next());
31
+ }, o = (c) => c.done ? r(c.value) : Promise.resolve(c.value).then(a, i);
32
+ o((t = t.apply(s, e)).next());
33
33
  });
34
- class ye extends Error {
34
+ class me extends Error {
35
35
  constructor({
36
36
  name: e,
37
37
  reason: t,
38
- status: s,
38
+ status: r,
39
39
  detail: n
40
40
  }) {
41
- super(), this.name = e, this.message = t, this.detail = n, this.status = s;
41
+ super(), this.name = e, this.message = t, this.detail = n, this.status = r;
42
42
  }
43
43
  }
44
44
  const Qt = "Figma Token Issue";
45
- class Ar extends Error {
45
+ class As extends Error {
46
46
  constructor({
47
47
  fileKey: e,
48
48
  reason: t,
49
- cause: s
49
+ cause: r
50
50
  }) {
51
- super(Qt), this.fileKey = e, this.reason = t, this.cause = s;
51
+ super(Qt), this.fileKey = e, this.reason = t, this.cause = r;
52
52
  }
53
53
  }
54
- const er = "Rate Limit Exceeded";
55
- class Cr extends Error {
54
+ const es = "Rate Limit Exceeded";
55
+ class Cs extends Error {
56
56
  constructor({ fileKey: e, cause: t }) {
57
- super(er), this.fileKey = e, this.cause = t;
57
+ super(es), this.fileKey = e, this.cause = t;
58
58
  }
59
59
  }
60
- const tr = "Request Too Large";
61
- class Ir extends Error {
60
+ const ts = "Request Too Large";
61
+ class Is extends Error {
62
62
  constructor({ fileKey: e, cause: t }) {
63
- super(tr), this.fileKey = e, this.cause = t;
63
+ super(ts), this.fileKey = e, this.cause = t;
64
64
  }
65
65
  }
66
- const rr = "Not Found";
67
- class Or extends Error {
66
+ const ss = "Not Found";
67
+ class Os extends Error {
68
68
  constructor({ fileKey: e, cause: t }) {
69
- super(rr), this.fileKey = e, this.cause = t;
69
+ super(ss), this.fileKey = e, this.cause = t;
70
70
  }
71
71
  }
72
- const Nr = (r) => r.message === rr, sr = "Unknown Figma API Exception";
73
- class jr extends Error {
72
+ const Ns = (s) => s.message === ss, rs = "Unknown Figma API Exception";
73
+ class js extends Error {
74
74
  constructor({ fileKey: e, cause: t }) {
75
- super(sr), this.name = "UnknownFigmaApiException", this.fileKey = e, this.cause = t;
75
+ super(rs), this.name = "UnknownFigmaApiException", this.fileKey = e, this.cause = t;
76
76
  }
77
77
  }
78
- const Xn = (r) => r.message === sr, Rr = (r) => r.message === er, Zr = (r) => [Qt, ...[
78
+ const Yn = (s) => s.message === rs, Rs = (s) => s.message === es, Zs = (s) => [Qt, ...[
79
79
  "Invalid Figma token",
80
80
  "Figma token expired"
81
81
  ]].includes(
82
- r.message
83
- ), Mr = (r) => r.message === tr, nr = (r, e) => {
84
- var s;
85
- if (((s = r == null ? void 0 : r.cause) == null ? void 0 : s.message) === "Fetch Error") {
86
- const { err: n, status: a } = r.cause.body;
82
+ s.message
83
+ ), Ms = (s) => s.message === ts, ns = (s, e) => {
84
+ var r;
85
+ if (((r = s == null ? void 0 : s.cause) == null ? void 0 : r.message) === "Fetch Error") {
86
+ const { err: n, status: a } = s.cause.body;
87
87
  if (a === 403)
88
- return new Ar({
88
+ return new As({
89
89
  fileKey: e,
90
90
  reason: n,
91
- cause: r
91
+ cause: s
92
92
  });
93
93
  if (a === 429)
94
- return new Cr({ fileKey: e, cause: r });
94
+ return new Cs({ fileKey: e, cause: s });
95
95
  if (a === 404)
96
- return new Or({ fileKey: e, cause: r });
96
+ return new Os({ fileKey: e, cause: s });
97
97
  if (a === 400 && n.includes("Request too large"))
98
- return new Ir({ fileKey: e, cause: r });
98
+ return new Is({ fileKey: e, cause: s });
99
99
  }
100
- return new jr({ fileKey: e, cause: r });
101
- }, Yn = (r) => Nr(r) ? "NotFound" : Rr(r) ? "RateLimitExceeded" : Zr(r) ? "FigmaTokenIssue" : Mr(r) ? "RequestTooLarge" : "UnknownFigmaApiException";
102
- var Pr = Object.defineProperty, $r = Object.defineProperties, Fr = Object.getOwnPropertyDescriptors, Vt = Object.getOwnPropertySymbols, Dr = Object.prototype.hasOwnProperty, Lr = Object.prototype.propertyIsEnumerable, Ut = (r, e) => (e = Symbol[r]) ? e : Symbol.for("Symbol." + r), ar = (r) => {
103
- throw TypeError(r);
104
- }, Wt = (r, e, t) => e in r ? Pr(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, U = (r, e) => {
100
+ return new js({ fileKey: e, cause: s });
101
+ }, Qn = (s) => Ns(s) ? "NotFound" : Rs(s) ? "RateLimitExceeded" : Zs(s) ? "FigmaTokenIssue" : Ms(s) ? "RequestTooLarge" : "UnknownFigmaApiException";
102
+ var Ps = Object.defineProperty, $s = Object.defineProperties, Fs = Object.getOwnPropertyDescriptors, Vt = Object.getOwnPropertySymbols, Ds = Object.prototype.hasOwnProperty, Ls = Object.prototype.propertyIsEnumerable, Ut = (s, e) => (e = Symbol[s]) ? e : Symbol.for("Symbol." + s), as = (s) => {
103
+ throw TypeError(s);
104
+ }, Wt = (s, e, t) => e in s ? Ps(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, V = (s, e) => {
105
105
  for (var t in e || (e = {}))
106
- Dr.call(e, t) && Wt(r, t, e[t]);
106
+ Ds.call(e, t) && Wt(s, t, e[t]);
107
107
  if (Vt)
108
108
  for (var t of Vt(e))
109
- Lr.call(e, t) && Wt(r, t, e[t]);
110
- return r;
111
- }, Zt = (r, e) => $r(r, Fr(e)), Mt = (r, e, t) => e.has(r) || ar("Cannot " + t), S = (r, e, t) => (Mt(r, e, "read from private field"), t ? t.call(r) : e.get(r)), q = (r, e, t) => e.has(r) ? ar("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), R = (r, e, t, s) => (Mt(r, e, "write to private field"), e.set(r, t), t), Y = (r, e, t) => (Mt(r, e, "access private method"), t), N = (r, e, t) => new Promise((s, n) => {
109
+ Ls.call(e, t) && Wt(s, t, e[t]);
110
+ return s;
111
+ }, Zt = (s, e) => $s(s, Fs(e)), Mt = (s, e, t) => e.has(s) || as("Cannot " + t), S = (s, e, t) => (Mt(s, e, "read from private field"), t ? t.call(s) : e.get(s)), z = (s, e, t) => e.has(s) ? as("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), R = (s, e, t, r) => (Mt(s, e, "write to private field"), e.set(s, t), t), K = (s, e, t) => (Mt(s, e, "access private method"), t), N = (s, e, t) => new Promise((r, n) => {
112
112
  var a = (c) => {
113
113
  try {
114
114
  o(t.next(c));
115
- } catch (d) {
116
- n(d);
115
+ } catch (u) {
116
+ n(u);
117
117
  }
118
118
  }, i = (c) => {
119
119
  try {
120
120
  o(t.throw(c));
121
- } catch (d) {
122
- n(d);
121
+ } catch (u) {
122
+ n(u);
123
123
  }
124
- }, o = (c) => c.done ? s(c.value) : Promise.resolve(c.value).then(a, i);
125
- o((t = t.apply(r, e)).next());
126
- }), Vr = (r, e, t) => (e = r[Ut("asyncIterator")]) ? e.call(r) : (r = r[Ut("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((d) => i({ value: d, done: c }), o)))), t("next"), t("return"), e), Ur = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};
127
- function Wr(r) {
128
- return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
124
+ }, o = (c) => c.done ? r(c.value) : Promise.resolve(c.value).then(a, i);
125
+ o((t = t.apply(s, e)).next());
126
+ }), Vs = (s, e, t) => (e = s[Ut("asyncIterator")]) ? e.call(s) : (s = s[Ut("iterator")](), e = {}, t = (r, n) => (n = s[r]) && (e[r] = (a) => new Promise((i, o, c) => (a = n.call(s, a), c = a.done, Promise.resolve(a.value).then((u) => i({ value: u, done: c }), o)))), t("next"), t("return"), e), Us = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};
127
+ function Ws(s) {
128
+ return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
129
129
  }
130
- var wt = { exports: {} }, zr = wt.exports, zt;
131
- function Br() {
132
- return zt || (zt = 1, function(r, e) {
133
- (function(t, s) {
134
- r.exports = s();
135
- })(zr, function() {
136
- var t = typeof Promise == "function", s = typeof self == "object" ? self : Ur, n = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", c = typeof WeakSet != "undefined", d = typeof DataView != "undefined", f = n && typeof Symbol.iterator != "undefined", v = n && typeof Symbol.toStringTag != "undefined", j = i && typeof Set.prototype.entries == "function", M = a && typeof Map.prototype.entries == "function", F = j && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), z = M && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), re = f && typeof Array.prototype[Symbol.iterator] == "function", me = re && Object.getPrototypeOf([][Symbol.iterator]()), ce = f && typeof String.prototype[Symbol.iterator] == "function", V = ce && Object.getPrototypeOf(""[Symbol.iterator]()), de = 8, Te = -1;
137
- function B(O) {
138
- var ge = typeof O;
139
- if (ge !== "object")
140
- return ge;
141
- if (O === null)
130
+ var wt = { exports: {} }, zs = wt.exports, zt;
131
+ function Bs() {
132
+ return zt || (zt = 1, function(s, e) {
133
+ (function(t, r) {
134
+ s.exports = r();
135
+ })(zs, function() {
136
+ var t = typeof Promise == "function", r = typeof self == "object" ? self : Us, 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", v = n && typeof Symbol.toStringTag != "undefined", j = i && typeof Set.prototype.entries == "function", M = a && typeof Map.prototype.entries == "function", F = j && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), W = M && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), ee = f && typeof Array.prototype[Symbol.iterator] == "function", he = ee && Object.getPrototypeOf([][Symbol.iterator]()), ie = f && typeof String.prototype[Symbol.iterator] == "function", L = ie && Object.getPrototypeOf(""[Symbol.iterator]()), oe = 8, et = -1;
137
+ function xe(E) {
138
+ var ke = typeof E;
139
+ if (ke !== "object")
140
+ return ke;
141
+ if (E === null)
142
142
  return "null";
143
- if (O === s)
143
+ if (E === r)
144
144
  return "global";
145
- if (Array.isArray(O) && (v === !1 || !(Symbol.toStringTag in O)))
145
+ if (Array.isArray(E) && (v === !1 || !(Symbol.toStringTag in E)))
146
146
  return "Array";
147
147
  if (typeof window == "object" && window !== null) {
148
- if (typeof window.location == "object" && O === window.location)
148
+ if (typeof window.location == "object" && E === window.location)
149
149
  return "Location";
150
- if (typeof window.document == "object" && O === window.document)
150
+ if (typeof window.document == "object" && E === window.document)
151
151
  return "Document";
152
152
  if (typeof window.navigator == "object") {
153
- if (typeof window.navigator.mimeTypes == "object" && O === window.navigator.mimeTypes)
153
+ if (typeof window.navigator.mimeTypes == "object" && E === window.navigator.mimeTypes)
154
154
  return "MimeTypeArray";
155
- if (typeof window.navigator.plugins == "object" && O === window.navigator.plugins)
155
+ if (typeof window.navigator.plugins == "object" && E === window.navigator.plugins)
156
156
  return "PluginArray";
157
157
  }
158
- if ((typeof window.HTMLElement == "function" || typeof window.HTMLElement == "object") && O instanceof window.HTMLElement) {
159
- if (O.tagName === "BLOCKQUOTE")
158
+ if ((typeof window.HTMLElement == "function" || typeof window.HTMLElement == "object") && E instanceof window.HTMLElement) {
159
+ if (E.tagName === "BLOCKQUOTE")
160
160
  return "HTMLQuoteElement";
161
- if (O.tagName === "TD")
161
+ if (E.tagName === "TD")
162
162
  return "HTMLTableDataCellElement";
163
- if (O.tagName === "TH")
163
+ if (E.tagName === "TH")
164
164
  return "HTMLTableHeaderCellElement";
165
165
  }
166
166
  }
167
- var k = v && O[Symbol.toStringTag];
168
- if (typeof k == "string")
169
- return k;
170
- var D = Object.getPrototypeOf(O);
171
- 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" : d && D === DataView.prototype ? "DataView" : a && D === z ? "Map Iterator" : i && D === F ? "Set Iterator" : re && D === me ? "Array Iterator" : ce && D === V ? "String Iterator" : D === null ? "Object" : Object.prototype.toString.call(O).slice(de, Te);
167
+ var pe = v && E[Symbol.toStringTag];
168
+ if (typeof pe == "string")
169
+ return pe;
170
+ var b = Object.getPrototypeOf(E);
171
+ return b === RegExp.prototype ? "RegExp" : b === Date.prototype ? "Date" : t && b === Promise.prototype ? "Promise" : i && b === Set.prototype ? "Set" : a && b === Map.prototype ? "Map" : c && b === WeakSet.prototype ? "WeakSet" : o && b === WeakMap.prototype ? "WeakMap" : u && b === DataView.prototype ? "DataView" : a && b === W ? "Map Iterator" : i && b === F ? "Set Iterator" : ee && b === he ? "Array Iterator" : ie && b === L ? "String Iterator" : b === null ? "Object" : Object.prototype.toString.call(E).slice(oe, et);
172
172
  }
173
- return B;
173
+ return xe;
174
174
  });
175
175
  }(wt)), wt.exports;
176
176
  }
177
- var qr = Br();
178
- const Hr = /* @__PURE__ */ Wr(qr), Pt = typeof Buffer != "undefined", Jr = Pt && typeof Buffer.from != "undefined", Gr = Pt ? (
177
+ var qs = Bs();
178
+ const Hs = /* @__PURE__ */ Ws(qs), Pt = typeof Buffer != "undefined", Js = Pt && typeof Buffer.from != "undefined", Gs = Pt ? (
179
179
  /**
180
180
  * is value is Buffer?
181
181
  *
182
182
  * @param {*} value
183
183
  * @return {boolean}
184
184
  */
185
- function(r) {
186
- return Buffer.isBuffer(r);
185
+ function(s) {
186
+ return Buffer.isBuffer(s);
187
187
  }
188
188
  ) : (
189
189
  /**
@@ -196,15 +196,15 @@ const Hr = /* @__PURE__ */ Wr(qr), Pt = typeof Buffer != "undefined", Jr = Pt &&
196
196
  function() {
197
197
  return !1;
198
198
  }
199
- ), Kr = Jr ? (
199
+ ), Ks = Js ? (
200
200
  /**
201
201
  * copy Buffer
202
202
  *
203
203
  * @param {Buffer} value
204
204
  * @return {Buffer}
205
205
  */
206
- function(r) {
207
- return Buffer.from(r);
206
+ function(s) {
207
+ return Buffer.from(s);
208
208
  }
209
209
  ) : Pt ? (
210
210
  /**
@@ -215,8 +215,8 @@ const Hr = /* @__PURE__ */ Wr(qr), Pt = typeof Buffer != "undefined", Jr = Pt &&
215
215
  * @param {Buffer} value
216
216
  * @return {Buffer}
217
217
  */
218
- function(r) {
219
- return new Buffer(r);
218
+ function(s) {
219
+ return new Buffer(s);
220
220
  }
221
221
  ) : (
222
222
  /**
@@ -227,115 +227,115 @@ const Hr = /* @__PURE__ */ Wr(qr), Pt = typeof Buffer != "undefined", Jr = Pt &&
227
227
  * @param {*}
228
228
  * @return {*}
229
229
  */
230
- function(r) {
231
- return r;
230
+ function(s) {
231
+ return s;
232
232
  }
233
233
  );
234
- function Ie(r) {
235
- return Gr(r) ? "Buffer" : Hr(r);
234
+ function Ce(s) {
235
+ return Gs(s) ? "Buffer" : Hs(s);
236
236
  }
237
- const Xr = /* @__PURE__ */ new Set([
237
+ const Xs = /* @__PURE__ */ new Set([
238
238
  "Arguments",
239
239
  "Array",
240
240
  "Map",
241
241
  "Object",
242
242
  "Set"
243
243
  ]);
244
- function Yr(r, e, t = null) {
245
- switch (t || Ie(r)) {
244
+ function Ys(s, e, t = null) {
245
+ switch (t || Ce(s)) {
246
246
  case "Arguments":
247
247
  case "Array":
248
248
  case "Object":
249
- return r[e];
249
+ return s[e];
250
250
  case "Map":
251
- return r.get(e);
251
+ return s.get(e);
252
252
  case "Set":
253
253
  return e;
254
254
  }
255
255
  }
256
- function xt(r) {
257
- return Xr.has(r);
256
+ function xt(s) {
257
+ return Xs.has(s);
258
258
  }
259
- function Bt(r, e, t, s = null) {
260
- switch (s || Ie(r)) {
259
+ function Bt(s, e, t, r = null) {
260
+ switch (r || Ce(s)) {
261
261
  case "Arguments":
262
262
  case "Array":
263
263
  case "Object":
264
- r[e] = t;
264
+ s[e] = t;
265
265
  break;
266
266
  case "Map":
267
- r.set(e, t);
267
+ s.set(e, t);
268
268
  break;
269
269
  case "Set":
270
- r.add(t);
270
+ s.add(t);
271
271
  break;
272
272
  }
273
- return r;
273
+ return s;
274
274
  }
275
- const Qr = typeof globalThis != "undefined" && globalThis !== null && globalThis.Object === Object && globalThis, es = typeof global != "undefined" && global !== null && global.Object === Object && global, ts = typeof self != "undefined" && self !== null && self.Object === Object && self, yt = Qr || es || ts || Function("return this")();
276
- function rs(r) {
277
- return r.slice(0);
275
+ const Qs = typeof globalThis != "undefined" && globalThis !== null && globalThis.Object === Object && globalThis, er = typeof global != "undefined" && global !== null && global.Object === Object && global, tr = typeof self != "undefined" && self !== null && self.Object === Object && self, yt = Qs || er || tr || Function("return this")();
276
+ function sr(s) {
277
+ return s.slice(0);
278
278
  }
279
- function ss(r) {
280
- return new Boolean(r.valueOf());
279
+ function rr(s) {
280
+ return new Boolean(s.valueOf());
281
281
  }
282
- function ns(r) {
283
- return new DataView(r.buffer);
282
+ function nr(s) {
283
+ return new DataView(s.buffer);
284
284
  }
285
- function as(r) {
286
- return Kr(r);
285
+ function ar(s) {
286
+ return Ks(s);
287
287
  }
288
- function is(r) {
289
- return new Date(r.getTime());
288
+ function ir(s) {
289
+ return new Date(s.getTime());
290
290
  }
291
- function os(r) {
292
- return new Number(r);
291
+ function or(s) {
292
+ return new Number(s);
293
293
  }
294
- function cs(r) {
295
- return new RegExp(r.source, r.flags);
294
+ function cr(s) {
295
+ return new RegExp(s.source, s.flags);
296
296
  }
297
- function ds(r) {
298
- return new String(r);
297
+ function ur(s) {
298
+ return new String(s);
299
299
  }
300
- function se(r, e) {
301
- return yt[e].from ? yt[e].from(r) : new yt[e](r);
300
+ function te(s, e) {
301
+ return yt[e].from ? yt[e].from(s) : new yt[e](s);
302
302
  }
303
- function P(r) {
304
- return r;
303
+ function P(s) {
304
+ return s;
305
305
  }
306
306
  function qt() {
307
307
  return [];
308
308
  }
309
- function us() {
309
+ function dr() {
310
310
  return /* @__PURE__ */ new Map();
311
311
  }
312
- function ls() {
312
+ function lr() {
313
313
  return {};
314
314
  }
315
- function fs() {
315
+ function fr() {
316
316
  return /* @__PURE__ */ new Set();
317
317
  }
318
- const hs = /* @__PURE__ */ new Map([
318
+ const hr = /* @__PURE__ */ new Map([
319
319
  // deep copy
320
- ["ArrayBuffer", rs],
321
- ["Boolean", ss],
322
- ["Buffer", as],
323
- ["DataView", ns],
324
- ["Date", is],
325
- ["Number", os],
326
- ["RegExp", cs],
327
- ["String", ds],
320
+ ["ArrayBuffer", sr],
321
+ ["Boolean", rr],
322
+ ["Buffer", ar],
323
+ ["DataView", nr],
324
+ ["Date", ir],
325
+ ["Number", or],
326
+ ["RegExp", cr],
327
+ ["String", ur],
328
328
  // typed arrays
329
329
  // TODO: pass bound function
330
- ["Float32Array", se],
331
- ["Float64Array", se],
332
- ["Int16Array", se],
333
- ["Int32Array", se],
334
- ["Int8Array", se],
335
- ["Uint16Array", se],
336
- ["Uint32Array", se],
337
- ["Uint8Array", se],
338
- ["Uint8ClampedArray", se],
330
+ ["Float32Array", te],
331
+ ["Float64Array", te],
332
+ ["Int16Array", te],
333
+ ["Int32Array", te],
334
+ ["Int8Array", te],
335
+ ["Uint16Array", te],
336
+ ["Uint32Array", te],
337
+ ["Uint8Array", te],
338
+ ["Uint8ClampedArray", te],
339
339
  // shallow copy
340
340
  ["Array Iterator", P],
341
341
  ["Map Iterator", P],
@@ -358,9 +358,9 @@ const hs = /* @__PURE__ */ new Map([
358
358
  // NOTE: return empty value, because recursively copy later.
359
359
  ["Arguments", qt],
360
360
  ["Array", qt],
361
- ["Map", us],
362
- ["Object", ls],
363
- ["Set", fs]
361
+ ["Map", dr],
362
+ ["Object", lr],
363
+ ["Set", fr]
364
364
  // NOTE: type-detect returns following types
365
365
  // 'Location'
366
366
  // 'Document'
@@ -372,19 +372,19 @@ const hs = /* @__PURE__ */ new Map([
372
372
  // TODO: is type-detect never return 'object'?
373
373
  // 'object'
374
374
  ]);
375
- function ps() {
375
+ function pr() {
376
376
  }
377
- function kt(r, e = null, t = ps) {
377
+ function kt(s, e = null, t = pr) {
378
378
  arguments.length === 2 && typeof e == "function" && (t = e, e = null);
379
- const s = e || Ie(r), n = hs.get(s);
380
- if (s === "Object") {
381
- const a = t(r, s);
379
+ const r = e || Ce(s), n = hr.get(r);
380
+ if (r === "Object") {
381
+ const a = t(s, r);
382
382
  if (a !== void 0)
383
383
  return a;
384
384
  }
385
- return n ? n(r, s) : r;
385
+ return n ? n(s, r) : s;
386
386
  }
387
- function Re(r, e = {}) {
387
+ function je(s, e = {}) {
388
388
  typeof e == "function" && (e = {
389
389
  customizer: e
390
390
  });
@@ -393,44 +393,44 @@ function Re(r, e = {}) {
393
393
  customizer: t
394
394
  // TODO: max depth
395
395
  // depth = Infinity,
396
- } = e, s = Ie(r);
397
- if (!xt(s))
398
- return Tt(r, null, null, null);
399
- const n = kt(r, s, t), a = new WeakMap([[r, n]]), i = new WeakSet([r]);
400
- return Tt(r, n, a, i);
396
+ } = e, r = Ce(s);
397
+ if (!xt(r))
398
+ return Tt(s, null, null, null);
399
+ const n = kt(s, r, t), a = new WeakMap([[s, n]]), i = new WeakSet([s]);
400
+ return Tt(s, n, a, i);
401
401
  }
402
- function Tt(r, e, t, s, n) {
403
- const a = Ie(r), i = kt(r, a);
402
+ function Tt(s, e, t, r, n) {
403
+ const a = Ce(s), i = kt(s, a);
404
404
  if (!xt(a))
405
405
  return i;
406
406
  let o;
407
407
  switch (a) {
408
408
  case "Arguments":
409
409
  case "Array":
410
- o = Object.keys(r);
410
+ o = Object.keys(s);
411
411
  break;
412
412
  case "Object":
413
- o = Object.keys(r), o.push(...Object.getOwnPropertySymbols(r));
413
+ o = Object.keys(s), o.push(...Object.getOwnPropertySymbols(s));
414
414
  break;
415
415
  case "Map":
416
416
  case "Set":
417
- o = r.keys();
417
+ o = s.keys();
418
418
  break;
419
419
  }
420
420
  for (let c of o) {
421
- const d = Yr(r, c, a);
422
- if (s.has(d))
423
- Bt(e, c, t.get(d), a);
421
+ const u = Ys(s, c, a);
422
+ if (r.has(u))
423
+ Bt(e, c, t.get(u), a);
424
424
  else {
425
- const f = Ie(d), v = kt(d, f);
426
- xt(f) && (t.set(d, v), s.add(d)), Bt(
425
+ const f = Ce(u), v = kt(u, f);
426
+ xt(f) && (t.set(u, v), r.add(u)), Bt(
427
427
  e,
428
428
  c,
429
429
  Tt(
430
- d,
430
+ u,
431
431
  v,
432
432
  t,
433
- s
433
+ r
434
434
  ),
435
435
  a
436
436
  );
@@ -438,36 +438,36 @@ function Tt(r, e, t, s, n) {
438
438
  }
439
439
  return e;
440
440
  }
441
- const ms = (r) => new Promise((e) => setTimeout(e, r));
442
- var rt, ve, st, St, ir;
443
- class gs {
441
+ const mr = (s) => new Promise((e) => setTimeout(e, s));
442
+ var st, ge, rt, St, is;
443
+ class gr {
444
444
  constructor({ maxAttempts: e = 3, func: t }) {
445
- q(this, St), q(this, rt), q(this, ve), q(this, st), R(this, rt, e), R(this, st, t), R(this, ve, 0);
445
+ z(this, St), z(this, st), z(this, ge), z(this, rt), R(this, st, e), R(this, rt, t), R(this, ge, 0);
446
446
  }
447
447
  run() {
448
448
  return N(this, null, function* () {
449
449
  try {
450
- return yield S(this, st).call(this);
450
+ return yield S(this, rt).call(this);
451
451
  } catch (e) {
452
- if (R(this, ve, S(this, ve) + 1), S(this, ve) > S(this, rt))
452
+ if (R(this, ge, S(this, ge) + 1), S(this, ge) > S(this, st))
453
453
  throw console.error("Max attempts reached"), e;
454
- const t = Y(this, St, ir).call(this);
455
- return yield ms(t), yield this.run();
454
+ const t = K(this, St, is).call(this);
455
+ return yield mr(t), yield this.run();
456
456
  }
457
457
  });
458
458
  }
459
459
  }
460
- rt = /* @__PURE__ */ new WeakMap(), ve = /* @__PURE__ */ new WeakMap(), st = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakSet(), ir = function() {
461
- return S(this, ve) * 1e3 * 1.5;
460
+ st = /* @__PURE__ */ new WeakMap(), ge = /* @__PURE__ */ new WeakMap(), rt = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakSet(), is = function() {
461
+ return S(this, ge) * 1e3 * 1.5;
462
462
  };
463
- function ys() {
463
+ function yr() {
464
464
  return typeof CompressionStream != "undefined";
465
465
  }
466
- function vs(r) {
466
+ function vr(s) {
467
467
  return N(this, null, function* () {
468
- const e = new Blob([r]).stream().pipeThrough(new CompressionStream("gzip")), t = [];
468
+ const e = new Blob([s]).stream().pipeThrough(new CompressionStream("gzip")), t = [];
469
469
  try {
470
- for (var s = Vr(e), n, a, i; n = !(a = yield s.next()).done; n = !1) {
470
+ for (var r = Vs(e), n, a, i; n = !(a = yield r.next()).done; n = !1) {
471
471
  const o = a.value;
472
472
  t.push(o);
473
473
  }
@@ -475,29 +475,29 @@ function vs(r) {
475
475
  i = [o];
476
476
  } finally {
477
477
  try {
478
- n && (a = s.return) && (yield a.call(s));
478
+ n && (a = r.return) && (yield a.call(r));
479
479
  } finally {
480
480
  if (i)
481
481
  throw i[0];
482
482
  }
483
483
  }
484
- return yield _s(t);
484
+ return yield _r(t);
485
485
  });
486
486
  }
487
- function _s(r) {
487
+ function _r(s) {
488
488
  return N(this, null, function* () {
489
- const e = yield new Blob(r).arrayBuffer();
489
+ const e = yield new Blob(s).arrayBuffer();
490
490
  return new Uint8Array(e);
491
491
  });
492
492
  }
493
- class bs extends Error {
494
- constructor({ resource: e, api: t, args: s, cause: n }) {
495
- 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)
493
+ class br extends Error {
494
+ constructor({ resource: e, api: t, args: r, cause: n }) {
495
+ 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 = r, n instanceof Error)
496
496
  for (const [i, o] of Object.entries(n))
497
497
  if (typeof Headers != "undefined" && o instanceof Headers) {
498
498
  const c = {};
499
- o.forEach((d, f) => {
500
- c[f] = d;
499
+ o.forEach((u, f) => {
500
+ c[f] = u;
501
501
  }), this.causeProperties[i] = c;
502
502
  } else
503
503
  this.causeProperties[i] = o;
@@ -509,12 +509,12 @@ class Ht extends Error {
509
509
  constructor({
510
510
  url: e,
511
511
  method: t,
512
- statusCode: s,
512
+ statusCode: r,
513
513
  requestHeaders: n,
514
514
  responseHeaders: a,
515
515
  body: i
516
516
  }) {
517
- if (super("Fetch Error"), this.name = "Fetch Error", this.url = e, this.method = t, this.statusNumber = s, this.requestHeaders = n, this.responseHeaders = a, i)
517
+ if (super("Fetch Error"), this.name = "Fetch Error", this.url = e, this.method = t, this.statusNumber = r, this.requestHeaders = n, this.responseHeaders = a, i)
518
518
  try {
519
519
  const o = JSON.parse(i);
520
520
  this.body = o;
@@ -523,13 +523,13 @@ class Ht extends Error {
523
523
  }
524
524
  }
525
525
  }
526
- class Ze extends Error {
526
+ class Re extends Error {
527
527
  constructor(e = {}) {
528
528
  const { canceled: t = !1 } = e;
529
529
  super("Abort Error"), this.name = "Abort Error", this.canceled = t;
530
530
  }
531
531
  }
532
- class ws extends Error {
532
+ class wr extends Error {
533
533
  constructor(e) {
534
534
  super(`Async API Error: ${JSON.stringify(e)}`), this.name = "Async API Error", this.body = e;
535
535
  }
@@ -539,7 +539,7 @@ class vt extends Error {
539
539
  super(e), this.name = "Request Validation Error";
540
540
  }
541
541
  }
542
- function or() {
542
+ function os() {
543
543
  return Array.from(
544
544
  { length: 32 },
545
545
  () => Math.floor(Math.random() * 256).toString(16).padStart(2, "0")
@@ -548,11 +548,11 @@ function or() {
548
548
  function Et() {
549
549
  return Math.floor(Date.now() / 1e3).toString();
550
550
  }
551
- const xs = 5 * 60 * 1e3, ks = 1 * 1e3;
552
- var _e, L, K, At, Ct, Me;
553
- class Ts {
551
+ const xr = 5 * 60 * 1e3, kr = 1 * 1e3;
552
+ var ye, D, J, At, Ct, Ze;
553
+ class Tr {
554
554
  constructor({ fetch: e = globalThis.fetch.bind(globalThis), baseAddress: t }) {
555
- q(this, K), q(this, _e), q(this, L), this.baseAddress = t, R(this, _e, e), R(this, L, {}), this.plugins = [];
555
+ z(this, J), z(this, ye), z(this, D), this.baseAddress = t, R(this, ye, e), R(this, D, {}), this.plugins = [];
556
556
  }
557
557
  get headers() {
558
558
  throw new Error("Missing implementation");
@@ -564,60 +564,60 @@ class Ts {
564
564
  this.plugins = this.plugins.filter((t) => t.name !== e);
565
565
  }
566
566
  withOptions(e = {}) {
567
- return R(this, L, e), this;
567
+ return R(this, D, e), this;
568
568
  }
569
569
  get(e) {
570
- return N(this, arguments, function* (t, s = {}) {
571
- const { overrideBaseAddress: n, overrideDefaultHeaders: a } = s, i = n != null ? n : this.baseAddress;
570
+ return N(this, arguments, function* (t, r = {}) {
571
+ const { overrideBaseAddress: n, overrideDefaultHeaders: a } = r, i = n != null ? n : this.baseAddress;
572
572
  let o = a != null ? a : this.headers;
573
- const c = Re(S(this, L));
574
- return R(this, L, {}), c.extraHeaders && (o = U(U({}, o), c.extraHeaders)), c.requestValidation && (o = Zt(U({}, o), { "X-Request-Nonce": or(), "X-Request-Timestamp": Et() })), c.async ? yield Y(this, K, Ct).call(this, `${i}${t}`, c.async, { headers: o }) : yield Y(this, K, At).call(this, `${i}${t}`, c, { headers: o });
573
+ const c = je(S(this, D));
574
+ return R(this, D, {}), c.extraHeaders && (o = V(V({}, o), c.extraHeaders)), c.requestValidation && (o = Zt(V({}, o), { "X-Request-Nonce": os(), "X-Request-Timestamp": Et() })), c.async ? yield K(this, J, Ct).call(this, `${i}${t}`, c.async, { headers: o }) : yield K(this, J, At).call(this, `${i}${t}`, c, { headers: o });
575
575
  });
576
576
  }
577
577
  post(e, t) {
578
- return N(this, arguments, function* (s, n, a = {}) {
579
- const i = Re(S(this, L));
580
- return R(this, L, {}), Y(this, K, Me).call(this, s, "POST", n, a, i);
578
+ return N(this, arguments, function* (r, n, a = {}) {
579
+ const i = je(S(this, D));
580
+ return R(this, D, {}), K(this, J, Ze).call(this, r, "POST", n, a, i);
581
581
  });
582
582
  }
583
583
  put(e, t) {
584
- return N(this, arguments, function* (s, n, a = {}) {
585
- const i = Re(S(this, L));
586
- return R(this, L, {}), Y(this, K, Me).call(this, s, "PUT", n, a, i);
584
+ return N(this, arguments, function* (r, n, a = {}) {
585
+ const i = je(S(this, D));
586
+ return R(this, D, {}), K(this, J, Ze).call(this, r, "PUT", n, a, i);
587
587
  });
588
588
  }
589
589
  delete(e, t) {
590
- return N(this, arguments, function* (s, n, a = {}) {
591
- const i = Re(S(this, L));
592
- return R(this, L, {}), Y(this, K, Me).call(this, s, "DELETE", n, a, i);
590
+ return N(this, arguments, function* (r, n, a = {}) {
591
+ const i = je(S(this, D));
592
+ return R(this, D, {}), K(this, J, Ze).call(this, r, "DELETE", n, a, i);
593
593
  });
594
594
  }
595
595
  patch(e, t) {
596
- return N(this, arguments, function* (s, n, a = {}) {
597
- const i = Re(S(this, L));
598
- return R(this, L, {}), Y(this, K, Me).call(this, s, "PATCH", n, a, i);
596
+ return N(this, arguments, function* (r, n, a = {}) {
597
+ const i = je(S(this, D));
598
+ return R(this, D, {}), K(this, J, Ze).call(this, r, "PATCH", n, a, i);
599
599
  });
600
600
  }
601
601
  }
602
- _e = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakSet(), At = function(r, e, t) {
602
+ ye = /* @__PURE__ */ new WeakMap(), D = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakSet(), At = function(s, e, t) {
603
603
  return N(this, null, function* () {
604
- const s = () => N(this, null, function* () {
605
- var c, d;
604
+ const r = () => N(this, null, function* () {
605
+ var c, u;
606
606
  try {
607
- return yield S(this, _e).call(this, r, U(U({}, t), e.abortSignal && { signal: e.abortSignal }));
607
+ return yield S(this, ye).call(this, s, V(V({}, t), e.abortSignal && { signal: e.abortSignal }));
608
608
  } catch (f) {
609
- throw f instanceof Error && f.name === "AbortError" ? new Ze({ canceled: (d = (c = e.abortSignal) == null ? void 0 : c.aborted) != null ? d : !1 }) : f;
609
+ throw f instanceof Error && f.name === "AbortError" ? new Re({ canceled: (u = (c = e.abortSignal) == null ? void 0 : c.aborted) != null ? u : !1 }) : f;
610
610
  }
611
- }), { headers: n } = t != null ? t : {}, a = (c, d) => {
611
+ }), { headers: n } = t != null ? t : {}, a = (c, u) => {
612
612
  var f, v;
613
- return ((f = c == null ? void 0 : c.headers) == null ? void 0 : f.get(d)) || ((v = c == null ? void 0 : c.headersObject) == null ? void 0 : v[d]) || "";
613
+ return ((f = c == null ? void 0 : c.headers) == null ? void 0 : f.get(u)) || ((v = c == null ? void 0 : c.headersObject) == null ? void 0 : v[u]) || "";
614
614
  }, i = (c) => N(this, null, function* () {
615
- var d;
615
+ var u;
616
616
  if (!c.ok) {
617
617
  const v = yield c.text().catch();
618
618
  throw new Ht({
619
- url: r,
620
- method: (d = t == null ? void 0 : t.method) != null ? d : "GET",
619
+ url: s,
620
+ method: (u = t == null ? void 0 : t.method) != null ? u : "GET",
621
621
  statusCode: c.status,
622
622
  requestHeaders: n,
623
623
  responseHeaders: c.headers,
@@ -629,8 +629,8 @@ _e = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), K = /* @_
629
629
  const v = a(c, "x-response-nonce"), j = n == null ? void 0 : n["X-Request-Nonce"];
630
630
  if (!v || v !== j)
631
631
  throw new vt("Response nonce mismatch");
632
- const M = Number(a(c, "x-response-timestamp")), F = Number(Et()), z = 60 * 60 * 24;
633
- if (isNaN(M) || Math.abs(F - M) > z)
632
+ const M = Number(a(c, "x-response-timestamp")), F = Number(Et()), W = 60 * 60 * 24;
633
+ if (isNaN(M) || Math.abs(F - M) > W)
634
634
  throw new vt("Invalid response timestamp");
635
635
  } catch (v) {
636
636
  const j = v instanceof Error ? v.message : "Request validation failed";
@@ -644,34 +644,34 @@ _e = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), K = /* @_
644
644
  return f;
645
645
  });
646
646
  if (e.retry) {
647
- const c = yield new gs({
647
+ const c = yield new gr({
648
648
  maxAttempts: e.retry,
649
- func: s
649
+ func: r
650
650
  }).run();
651
651
  return yield i(c);
652
652
  }
653
- const o = yield s();
653
+ const o = yield r();
654
654
  return yield i(o);
655
655
  });
656
- }, Ct = function(r, e, t) {
656
+ }, Ct = function(s, e, t) {
657
657
  return N(this, null, function* () {
658
- var s, n;
658
+ var r, n;
659
659
  const {
660
660
  onProgress: a,
661
661
  abortSignal: i,
662
- pollingInterval: o = () => ks,
663
- maxTimeout: c = xs
664
- } = e, d = `${r}/async`, f = `${r}/async/job`;
662
+ pollingInterval: o = () => kr,
663
+ maxTimeout: c = xr
664
+ } = e, u = `${s}/async`, f = `${s}/async/job`;
665
665
  let v;
666
666
  try {
667
- v = yield S(this, _e).call(this, d, U(U({}, t), i && { signal: i }));
667
+ v = yield S(this, ye).call(this, u, V(V({}, t), i && { signal: i }));
668
668
  } catch (F) {
669
- throw F instanceof Error && F.name === "AbortError" ? new Ze({ canceled: (s = i == null ? void 0 : i.aborted) != null ? s : !1 }) : F;
669
+ throw F instanceof Error && F.name === "AbortError" ? new Re({ canceled: (r = i == null ? void 0 : i.aborted) != null ? r : !1 }) : F;
670
670
  }
671
671
  if (!v.ok) {
672
672
  const F = yield v.text().catch();
673
673
  throw new Ht({
674
- url: r,
674
+ url: s,
675
675
  method: (n = t == null ? void 0 : t.method) != null ? n : "GET",
676
676
  statusCode: v.status,
677
677
  requestHeaders: this.headers,
@@ -682,147 +682,147 @@ _e = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), K = /* @_
682
682
  const j = yield v.json(), { job_id: M } = j;
683
683
  if (!M)
684
684
  throw new Error("Job ID not found in response");
685
- return new Promise((F, z) => N(this, null, function* () {
686
- const re = setTimeout(() => {
687
- z(new Error("Job timed out"));
688
- }, c), me = (ce = 0) => N(this, null, function* () {
685
+ return new Promise((F, W) => N(this, null, function* () {
686
+ const ee = setTimeout(() => {
687
+ W(new Error("Job timed out"));
688
+ }, c), he = (ie = 0) => N(this, null, function* () {
689
689
  if (i != null && i.aborted) {
690
- clearTimeout(re), S(this, _e).call(this, `${f}/${M}/cancel`, { method: "POST", headers: this.headers }).then(() => {
691
- z(new Ze({ canceled: !0 }));
692
- }).catch((V) => {
693
- z(new Ze({ canceled: !1 }));
690
+ clearTimeout(ee), S(this, ye).call(this, `${f}/${M}/cancel`, { method: "POST", headers: this.headers }).then(() => {
691
+ W(new Re({ canceled: !0 }));
692
+ }).catch((L) => {
693
+ W(new Re({ canceled: !1 }));
694
694
  });
695
695
  return;
696
696
  }
697
697
  try {
698
- const V = yield (yield S(this, _e).call(this, `${f}/${M}`, { headers: this.headers })).json();
699
- if (V.status === "success") {
700
- clearTimeout(re);
701
- const de = V.response_json;
702
- F(de);
703
- } else if (V.status === "failed")
704
- clearTimeout(re), z(new ws(V.response_json));
698
+ const L = yield (yield S(this, ye).call(this, `${f}/${M}`, { headers: this.headers })).json();
699
+ if (L.status === "success") {
700
+ clearTimeout(ee);
701
+ const oe = L.response_json;
702
+ F(oe);
703
+ } else if (L.status === "failed")
704
+ clearTimeout(ee), W(new wr(L.response_json));
705
705
  else {
706
- a && a(V.response_json);
707
- const de = o(ce);
708
- setTimeout(() => me(ce + 1), de);
706
+ a && a(L.response_json);
707
+ const oe = o(ie);
708
+ setTimeout(() => he(ie + 1), oe);
709
709
  }
710
- } catch (V) {
711
- z(V);
710
+ } catch (L) {
711
+ W(L);
712
712
  }
713
713
  });
714
- me();
714
+ he();
715
715
  }));
716
716
  });
717
- }, Me = function(r, e, t, s, n) {
717
+ }, Ze = function(s, e, t, r, n) {
718
718
  return N(this, null, function* () {
719
- const { overrideBaseAddress: a, overrideDefaultHeaders: i } = s, o = a != null ? a : this.baseAddress;
719
+ const { overrideBaseAddress: a, overrideDefaultHeaders: i } = r, o = a != null ? a : this.baseAddress;
720
720
  let c = i != null ? i : this.headers;
721
- n.extraHeaders && (c = U(U({}, c), n.extraHeaders)), n.requestValidation && (c = Zt(U({}, c), { "X-Request-Nonce": or(), "X-Request-Timestamp": Et() }));
722
- let d = t;
723
- return typeof FormData != "undefined" && t instanceof FormData ? delete c["Content-Type"] : (d = s.skipBodyJsonStringify ? t : JSON.stringify(t), n.compress && ys() && (c["Content-Encoding"] = "gzip", d = yield vs(d))), n.async ? yield Y(this, K, Ct).call(this, `${o}${r}`, n.async, {
721
+ n.extraHeaders && (c = V(V({}, c), n.extraHeaders)), n.requestValidation && (c = Zt(V({}, c), { "X-Request-Nonce": os(), "X-Request-Timestamp": Et() }));
722
+ let u = t;
723
+ return typeof FormData != "undefined" && t instanceof FormData ? delete c["Content-Type"] : (u = r.skipBodyJsonStringify ? t : JSON.stringify(t), n.compress && yr() && (c["Content-Encoding"] = "gzip", u = yield vr(u))), n.async ? yield K(this, J, Ct).call(this, `${o}${s}`, n.async, {
724
724
  method: e,
725
725
  headers: c,
726
- body: d
727
- }) : yield Y(this, K, At).call(this, `${o}${r}`, n, { method: e, headers: c, body: d });
726
+ body: u
727
+ }) : yield K(this, J, At).call(this, `${o}${s}`, n, { method: e, headers: c, body: u });
728
728
  });
729
729
  };
730
- const Jt = (r, e, t, s) => r instanceof Ze ? r : new bs({ resource: e, api: String(t), args: s, cause: r }), _t = (r, e) => new Proxy(e, {
731
- get(t, s) {
730
+ const Jt = (s, e, t, r) => s instanceof Re ? s : new br({ resource: e, api: String(t), args: r, cause: s }), _t = (s, e) => new Proxy(e, {
731
+ get(t, r) {
732
732
  return (...n) => {
733
733
  var a;
734
- for (const o of r.plugins) {
735
- const c = (a = o.beforeApi) == null ? void 0 : a.call(o, { resource: t.resourceName, api: s, args: n });
734
+ for (const o of s.plugins) {
735
+ const c = (a = o.beforeApi) == null ? void 0 : a.call(o, { resource: t.resourceName, api: r, args: n });
736
736
  if (c !== void 0)
737
737
  return c;
738
738
  }
739
739
  let i;
740
740
  try {
741
- i = t[s](...n);
741
+ i = t[r](...n);
742
742
  } catch (o) {
743
- throw Jt(o, t.resourceName, s, n);
743
+ throw Jt(o, t.resourceName, r, n);
744
744
  }
745
745
  return i instanceof Promise ? i.catch((o) => {
746
- throw Jt(o, t.resourceName, s, n);
746
+ throw Jt(o, t.resourceName, r, n);
747
747
  }) : i;
748
748
  };
749
749
  }
750
750
  });
751
- var Pe;
752
- class Ss {
751
+ var Me;
752
+ class Sr {
753
753
  constructor(e) {
754
- q(this, Pe), this.resourceName = "Files", R(this, Pe, e);
754
+ z(this, Me), this.resourceName = "Files", R(this, Me, e);
755
755
  }
756
756
  get(e) {
757
- return N(this, arguments, function* ({ fileKey: t, params: s = {} }) {
758
- const n = new URLSearchParams(U({
757
+ return N(this, arguments, function* ({ fileKey: t, params: r = {} }) {
758
+ const n = new URLSearchParams(V({
759
759
  plugin_data: "857346721138427857"
760
- }, s)).toString(), a = `v1/files/${t}?${n}`;
761
- return yield S(this, Pe).get(a);
760
+ }, r)).toString(), a = `v1/files/${t}?${n}`;
761
+ return yield S(this, Me).get(a);
762
762
  });
763
763
  }
764
764
  getImageFills(e) {
765
765
  return N(this, arguments, function* ({ fileKey: t }) {
766
- var s, n;
766
+ var r, n;
767
767
  const a = `v1/files/${t}/images`;
768
- return (n = (s = (yield S(this, Pe).get(a)).meta) == null ? void 0 : s.images) != null ? n : {};
768
+ return (n = (r = (yield S(this, Me).get(a)).meta) == null ? void 0 : r.images) != null ? n : {};
769
769
  });
770
770
  }
771
771
  }
772
- Pe = /* @__PURE__ */ new WeakMap();
773
- const Es = (r, e, t) => {
774
- const s = e.sort();
775
- return `${r}-${s.join("-")}-${t}`;
776
- }, As = (r) => r ? r.ts > Date.now() - 1e3 * 30 : !1;
777
- var X, It, cr;
778
- class Cs {
772
+ Me = /* @__PURE__ */ new WeakMap();
773
+ const Er = (s, e, t) => {
774
+ const r = e.sort();
775
+ return `${s}-${r.join("-")}-${t}`;
776
+ }, Ar = (s) => s ? s.ts > Date.now() - 1e3 * 30 : !1;
777
+ var G, It, cs;
778
+ class Cr {
779
779
  constructor(e) {
780
- q(this, It), q(this, X), this.resourceName = "Images", R(this, X, e);
780
+ z(this, It), z(this, G), this.resourceName = "Images", R(this, G, e);
781
781
  }
782
782
  /**
783
783
  * Return the URL for the _layer_ images for the given nodes.
784
784
  * Note: Use the `file.images` API to get the _source_ images used on the node fills, which has better quality.
785
785
  */
786
786
  get(e) {
787
- return N(this, arguments, function* ({ fileKey: t, nodeIds: s, format: n = "jpg", scale: a }) {
788
- const i = Es(t, s, n), o = S(this, X).cache.images.entries.get(i);
789
- if (As(o))
787
+ return N(this, arguments, function* ({ fileKey: t, nodeIds: r, format: n = "jpg", scale: a }) {
788
+ const i = Er(t, r, n), o = S(this, G).cache.images.entries.get(i);
789
+ if (Ar(o))
790
790
  return o.result;
791
- o && S(this, X).cache.images.entries.delete(i);
792
- const c = S(this, X).cache.images.pendingRequests.get(i);
791
+ o && S(this, G).cache.images.entries.delete(i);
792
+ const c = S(this, G).cache.images.pendingRequests.get(i);
793
793
  if (c)
794
794
  return c;
795
- const d = Y(this, It, cr).call(this, i, t, s, n, a);
796
- S(this, X).cache.images.pendingRequests.set(i, d);
795
+ const u = K(this, It, cs).call(this, i, t, r, n, a);
796
+ S(this, G).cache.images.pendingRequests.set(i, u);
797
797
  try {
798
- return yield d;
798
+ return yield u;
799
799
  } finally {
800
- S(this, X).cache.images.pendingRequests.delete(i);
800
+ S(this, G).cache.images.pendingRequests.delete(i);
801
801
  }
802
802
  });
803
803
  }
804
804
  }
805
- X = /* @__PURE__ */ new WeakMap(), It = /* @__PURE__ */ new WeakSet(), cr = function(r, e, t, s, n) {
805
+ G = /* @__PURE__ */ new WeakMap(), It = /* @__PURE__ */ new WeakSet(), cs = function(s, e, t, r, n) {
806
806
  return N(this, null, function* () {
807
- const a = yield S(this, X).get(
808
- `v1/images/${e}?ids=${t}&format=${s}${n ? `&scale=${n}` : ""}`
807
+ const a = yield S(this, G).get(
808
+ `v1/images/${e}?ids=${t}&format=${r}${n ? `&scale=${n}` : ""}`
809
809
  );
810
- return S(this, X).cache.images.entries.set(r, {
810
+ return S(this, G).cache.images.entries.set(s, {
811
811
  result: a,
812
812
  ts: Date.now()
813
813
  }), a;
814
814
  });
815
815
  };
816
816
  var nt;
817
- class Is {
817
+ class Ir {
818
818
  constructor(e) {
819
- q(this, nt), this.resourceName = "Nodes", R(this, nt, e);
819
+ z(this, nt), this.resourceName = "Nodes", R(this, nt, e);
820
820
  }
821
821
  get(e) {
822
- return N(this, arguments, function* ({ fileKey: t, nodeIds: s, params: n = {} }) {
823
- const a = Zt(U({}, n), {
824
- ids: s.join(",")
825
- }), i = new URLSearchParams(U({
822
+ return N(this, arguments, function* ({ fileKey: t, nodeIds: r, params: n = {} }) {
823
+ const a = Zt(V({}, n), {
824
+ ids: r.join(",")
825
+ }), i = new URLSearchParams(V({
826
826
  plugin_data: "857346721138427857"
827
827
  }, a)).toString(), o = `v1/files/${t}/nodes?${i}`;
828
828
  return yield S(this, nt).get(o);
@@ -830,40 +830,40 @@ class Is {
830
830
  }
831
831
  }
832
832
  nt = /* @__PURE__ */ new WeakMap();
833
- var ue;
834
- class dr extends Ts {
833
+ var ce;
834
+ class us extends Tr {
835
835
  constructor({
836
836
  baseAddress: e = "https://api.figma.com/",
837
837
  fetch: t = globalThis.fetch.bind(globalThis)
838
838
  } = {}) {
839
- super({ fetch: t, baseAddress: e }), q(this, ue, ""), this.cache = {
839
+ super({ fetch: t, baseAddress: e }), z(this, ce, ""), this.cache = {
840
840
  images: {
841
841
  entries: /* @__PURE__ */ new Map(),
842
842
  pendingRequests: /* @__PURE__ */ new Map()
843
843
  }
844
- }, this.files = _t(this, new Ss(this)), this.nodes = _t(this, new Is(this)), this.images = _t(this, new Cs(this));
844
+ }, this.files = _t(this, new Sr(this)), this.nodes = _t(this, new Ir(this)), this.images = _t(this, new Cr(this));
845
845
  }
846
846
  set token(e) {
847
847
  if (!e.startsWith("figd_") && !e.startsWith("figu_"))
848
848
  throw new Error("Invalid Figma access token");
849
- R(this, ue, e);
849
+ R(this, ce, e);
850
850
  }
851
851
  get token() {
852
- return S(this, ue);
852
+ return S(this, ce);
853
853
  }
854
854
  get headers() {
855
855
  const e = {
856
856
  "Content-Type": "application/json"
857
857
  };
858
- return S(this, ue).startsWith("figd_") ? e["X-FIGMA-TOKEN"] = S(this, ue) : S(this, ue).startsWith("figu_") && (e.Authorization = `Bearer ${S(this, ue)}`), e;
858
+ return S(this, ce).startsWith("figd_") ? e["X-FIGMA-TOKEN"] = S(this, ce) : S(this, ce).startsWith("figu_") && (e.Authorization = `Bearer ${S(this, ce)}`), e;
859
859
  }
860
860
  }
861
- ue = /* @__PURE__ */ new WeakMap();
862
- const Os = (a) => C(void 0, [a], function* ({
863
- fileKey: r,
861
+ ce = /* @__PURE__ */ new WeakMap();
862
+ const Or = (a) => I(void 0, [a], function* ({
863
+ fileKey: s,
864
864
  authToken: e,
865
- figmaRestApi: t = new dr(),
866
- params: s = {},
865
+ figmaRestApi: t = new us(),
866
+ params: r = {},
867
867
  signal: n
868
868
  }) {
869
869
  e && (t.token = e);
@@ -871,84 +871,84 @@ const Os = (a) => C(void 0, [a], function* ({
871
871
  return yield t.withOptions({
872
872
  abortSignal: n
873
873
  }).files.get({
874
- fileKey: r,
875
- params: s
874
+ fileKey: s,
875
+ params: r
876
876
  });
877
877
  } catch (i) {
878
- throw i instanceof Error && i.name === "AbortError" ? i : (console.error(i), nr(i, r));
878
+ throw i instanceof Error && i.name === "AbortError" ? i : (console.error(i), ns(i, s));
879
879
  }
880
- }), Qn = (i) => C(void 0, [i], function* ({
881
- fileKey: r,
880
+ }), ea = (i) => I(void 0, [i], function* ({
881
+ fileKey: s,
882
882
  authToken: e,
883
883
  nodeIds: t,
884
- figmaRestApi: s = new dr(),
884
+ figmaRestApi: r = new us(),
885
885
  params: n = {},
886
886
  signal: a
887
887
  }) {
888
- e && (s.token = e);
888
+ e && (r.token = e);
889
889
  try {
890
- return (yield s.withOptions({
890
+ return (yield r.withOptions({
891
891
  abortSignal: a
892
892
  }).nodes.get({
893
- fileKey: r,
893
+ fileKey: s,
894
894
  nodeIds: t,
895
- params: u({}, n)
895
+ params: d({}, n)
896
896
  })).nodes;
897
897
  } catch (o) {
898
- throw o instanceof Error && o.name === "AbortError" ? o : nr(o, r);
899
- }
900
- }), ur = (r, e) => {
901
- if (r.id === e)
902
- return r;
903
- if ("children" in r)
904
- for (const t of r.children) {
905
- const s = ur(t, e);
906
- if (s)
907
- return s;
898
+ throw o instanceof Error && o.name === "AbortError" ? o : ns(o, s);
899
+ }
900
+ }), ds = (s, e) => {
901
+ if (s.id === e)
902
+ return s;
903
+ if ("children" in s)
904
+ for (const t of s.children) {
905
+ const r = ds(t, e);
906
+ if (r)
907
+ return r;
908
908
  }
909
909
  return null;
910
910
  };
911
- var x;
912
- (function(r) {
913
- r.assertEqual = (n) => n;
911
+ var k;
912
+ (function(s) {
913
+ s.assertEqual = (n) => n;
914
914
  function e(n) {
915
915
  }
916
- r.assertIs = e;
916
+ s.assertIs = e;
917
917
  function t(n) {
918
918
  throw new Error();
919
919
  }
920
- r.assertNever = t, r.arrayToEnum = (n) => {
920
+ s.assertNever = t, s.arrayToEnum = (n) => {
921
921
  const a = {};
922
922
  for (const i of n)
923
923
  a[i] = i;
924
924
  return a;
925
- }, r.getValidEnumValues = (n) => {
926
- const a = r.objectKeys(n).filter((o) => typeof n[n[o]] != "number"), i = {};
925
+ }, s.getValidEnumValues = (n) => {
926
+ const a = s.objectKeys(n).filter((o) => typeof n[n[o]] != "number"), i = {};
927
927
  for (const o of a)
928
928
  i[o] = n[o];
929
- return r.objectValues(i);
930
- }, r.objectValues = (n) => r.objectKeys(n).map(function(a) {
929
+ return s.objectValues(i);
930
+ }, s.objectValues = (n) => s.objectKeys(n).map(function(a) {
931
931
  return n[a];
932
- }), r.objectKeys = typeof Object.keys == "function" ? (n) => Object.keys(n) : (n) => {
932
+ }), s.objectKeys = typeof Object.keys == "function" ? (n) => Object.keys(n) : (n) => {
933
933
  const a = [];
934
934
  for (const i in n)
935
935
  Object.prototype.hasOwnProperty.call(n, i) && a.push(i);
936
936
  return a;
937
- }, r.find = (n, a) => {
937
+ }, s.find = (n, a) => {
938
938
  for (const i of n)
939
939
  if (a(i))
940
940
  return i;
941
- }, r.isInteger = typeof Number.isInteger == "function" ? (n) => Number.isInteger(n) : (n) => typeof n == "number" && isFinite(n) && Math.floor(n) === n;
942
- function s(n, a = " | ") {
941
+ }, s.isInteger = typeof Number.isInteger == "function" ? (n) => Number.isInteger(n) : (n) => typeof n == "number" && isFinite(n) && Math.floor(n) === n;
942
+ function r(n, a = " | ") {
943
943
  return n.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
944
944
  }
945
- r.joinValues = s, r.jsonStringifyReplacer = (n, a) => typeof a == "bigint" ? a.toString() : a;
946
- })(x || (x = {}));
945
+ s.joinValues = r, s.jsonStringifyReplacer = (n, a) => typeof a == "bigint" ? a.toString() : a;
946
+ })(k || (k = {}));
947
947
  var Ot;
948
- (function(r) {
949
- r.mergeShapes = (e, t) => u(u({}, e), t);
948
+ (function(s) {
949
+ s.mergeShapes = (e, t) => d(d({}, e), t);
950
950
  })(Ot || (Ot = {}));
951
- const p = x.arrayToEnum([
951
+ const p = k.arrayToEnum([
952
952
  "string",
953
953
  "nan",
954
954
  "number",
@@ -969,14 +969,14 @@ const p = x.arrayToEnum([
969
969
  "never",
970
970
  "map",
971
971
  "set"
972
- ]), ae = (r) => {
973
- switch (typeof r) {
972
+ ]), re = (s) => {
973
+ switch (typeof s) {
974
974
  case "undefined":
975
975
  return p.undefined;
976
976
  case "string":
977
977
  return p.string;
978
978
  case "number":
979
- return isNaN(r) ? p.nan : p.number;
979
+ return isNaN(s) ? p.nan : p.number;
980
980
  case "boolean":
981
981
  return p.boolean;
982
982
  case "function":
@@ -986,11 +986,11 @@ const p = x.arrayToEnum([
986
986
  case "symbol":
987
987
  return p.symbol;
988
988
  case "object":
989
- 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;
989
+ return Array.isArray(s) ? p.array : s === null ? p.null : s.then && typeof s.then == "function" && s.catch && typeof s.catch == "function" ? p.promise : typeof Map != "undefined" && s instanceof Map ? p.map : typeof Set != "undefined" && s instanceof Set ? p.set : typeof Date != "undefined" && s instanceof Date ? p.date : p.object;
990
990
  default:
991
991
  return p.unknown;
992
992
  }
993
- }, l = x.arrayToEnum([
993
+ }, l = k.arrayToEnum([
994
994
  "invalid_type",
995
995
  "invalid_literal",
996
996
  "custom",
@@ -1007,16 +1007,16 @@ const p = x.arrayToEnum([
1007
1007
  "invalid_intersection_types",
1008
1008
  "not_multiple_of",
1009
1009
  "not_finite"
1010
- ]), Ns = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
1011
- class W extends Error {
1010
+ ]), Nr = (s) => JSON.stringify(s, null, 2).replace(/"([^"]+)":/g, "$1:");
1011
+ class U extends Error {
1012
1012
  get errors() {
1013
1013
  return this.issues;
1014
1014
  }
1015
1015
  constructor(e) {
1016
- super(), this.issues = [], this.addIssue = (s) => {
1017
- this.issues = [...this.issues, s];
1018
- }, this.addIssues = (s = []) => {
1019
- this.issues = [...this.issues, ...s];
1016
+ super(), this.issues = [], this.addIssue = (r) => {
1017
+ this.issues = [...this.issues, r];
1018
+ }, this.addIssues = (r = []) => {
1019
+ this.issues = [...this.issues, ...r];
1020
1020
  };
1021
1021
  const t = new.target.prototype;
1022
1022
  Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e;
@@ -1024,7 +1024,7 @@ class W extends Error {
1024
1024
  format(e) {
1025
1025
  const t = e || function(a) {
1026
1026
  return a.message;
1027
- }, s = { _errors: [] }, n = (a) => {
1027
+ }, r = { _errors: [] }, n = (a) => {
1028
1028
  for (const i of a.issues)
1029
1029
  if (i.code === "invalid_union")
1030
1030
  i.unionErrors.map(n);
@@ -1033,61 +1033,61 @@ class W extends Error {
1033
1033
  else if (i.code === "invalid_arguments")
1034
1034
  n(i.argumentsError);
1035
1035
  else if (i.path.length === 0)
1036
- s._errors.push(t(i));
1036
+ r._errors.push(t(i));
1037
1037
  else {
1038
- let o = s, c = 0;
1038
+ let o = r, c = 0;
1039
1039
  for (; c < i.path.length; ) {
1040
- const d = i.path[c];
1041
- c === i.path.length - 1 ? (o[d] = o[d] || { _errors: [] }, o[d]._errors.push(t(i))) : o[d] = o[d] || { _errors: [] }, o = o[d], c++;
1040
+ const u = i.path[c];
1041
+ c === i.path.length - 1 ? (o[u] = o[u] || { _errors: [] }, o[u]._errors.push(t(i))) : o[u] = o[u] || { _errors: [] }, o = o[u], c++;
1042
1042
  }
1043
1043
  }
1044
1044
  };
1045
- return n(this), s;
1045
+ return n(this), r;
1046
1046
  }
1047
1047
  static assert(e) {
1048
- if (!(e instanceof W))
1048
+ if (!(e instanceof U))
1049
1049
  throw new Error(`Not a ZodError: ${e}`);
1050
1050
  }
1051
1051
  toString() {
1052
1052
  return this.message;
1053
1053
  }
1054
1054
  get message() {
1055
- return JSON.stringify(this.issues, x.jsonStringifyReplacer, 2);
1055
+ return JSON.stringify(this.issues, k.jsonStringifyReplacer, 2);
1056
1056
  }
1057
1057
  get isEmpty() {
1058
1058
  return this.issues.length === 0;
1059
1059
  }
1060
1060
  flatten(e = (t) => t.message) {
1061
- const t = {}, s = [];
1061
+ const t = {}, r = [];
1062
1062
  for (const n of this.issues)
1063
- n.path.length > 0 ? (t[n.path[0]] = t[n.path[0]] || [], t[n.path[0]].push(e(n))) : s.push(e(n));
1064
- return { formErrors: s, fieldErrors: t };
1063
+ n.path.length > 0 ? (t[n.path[0]] = t[n.path[0]] || [], t[n.path[0]].push(e(n))) : r.push(e(n));
1064
+ return { formErrors: r, fieldErrors: t };
1065
1065
  }
1066
1066
  get formErrors() {
1067
1067
  return this.flatten();
1068
1068
  }
1069
1069
  }
1070
- W.create = (r) => new W(r);
1071
- const Oe = (r, e) => {
1070
+ U.create = (s) => new U(s);
1071
+ const Ie = (s, e) => {
1072
1072
  let t;
1073
- switch (r.code) {
1073
+ switch (s.code) {
1074
1074
  case l.invalid_type:
1075
- r.received === p.undefined ? t = "Required" : t = `Expected ${r.expected}, received ${r.received}`;
1075
+ s.received === p.undefined ? t = "Required" : t = `Expected ${s.expected}, received ${s.received}`;
1076
1076
  break;
1077
1077
  case l.invalid_literal:
1078
- t = `Invalid literal value, expected ${JSON.stringify(r.expected, x.jsonStringifyReplacer)}`;
1078
+ t = `Invalid literal value, expected ${JSON.stringify(s.expected, k.jsonStringifyReplacer)}`;
1079
1079
  break;
1080
1080
  case l.unrecognized_keys:
1081
- t = `Unrecognized key(s) in object: ${x.joinValues(r.keys, ", ")}`;
1081
+ t = `Unrecognized key(s) in object: ${k.joinValues(s.keys, ", ")}`;
1082
1082
  break;
1083
1083
  case l.invalid_union:
1084
1084
  t = "Invalid input";
1085
1085
  break;
1086
1086
  case l.invalid_union_discriminator:
1087
- t = `Invalid discriminator value. Expected ${x.joinValues(r.options)}`;
1087
+ t = `Invalid discriminator value. Expected ${k.joinValues(s.options)}`;
1088
1088
  break;
1089
1089
  case l.invalid_enum_value:
1090
- t = `Invalid enum value. Expected ${x.joinValues(r.options)}, received '${r.received}'`;
1090
+ t = `Invalid enum value. Expected ${k.joinValues(s.options)}, received '${s.received}'`;
1091
1091
  break;
1092
1092
  case l.invalid_arguments:
1093
1093
  t = "Invalid function arguments";
@@ -1099,13 +1099,13 @@ const Oe = (r, e) => {
1099
1099
  t = "Invalid date";
1100
1100
  break;
1101
1101
  case l.invalid_string:
1102
- 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";
1102
+ typeof s.validation == "object" ? "includes" in s.validation ? (t = `Invalid input: must include "${s.validation.includes}"`, typeof s.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${s.validation.position}`)) : "startsWith" in s.validation ? t = `Invalid input: must start with "${s.validation.startsWith}"` : "endsWith" in s.validation ? t = `Invalid input: must end with "${s.validation.endsWith}"` : k.assertNever(s.validation) : s.validation !== "regex" ? t = `Invalid ${s.validation}` : t = "Invalid";
1103
1103
  break;
1104
1104
  case l.too_small:
1105
- 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";
1105
+ s.type === "array" ? t = `Array must contain ${s.exact ? "exactly" : s.inclusive ? "at least" : "more than"} ${s.minimum} element(s)` : s.type === "string" ? t = `String must contain ${s.exact ? "exactly" : s.inclusive ? "at least" : "over"} ${s.minimum} character(s)` : s.type === "number" ? t = `Number must be ${s.exact ? "exactly equal to " : s.inclusive ? "greater than or equal to " : "greater than "}${s.minimum}` : s.type === "date" ? t = `Date must be ${s.exact ? "exactly equal to " : s.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(s.minimum))}` : t = "Invalid input";
1106
1106
  break;
1107
1107
  case l.too_big:
1108
- 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";
1108
+ s.type === "array" ? t = `Array must contain ${s.exact ? "exactly" : s.inclusive ? "at most" : "less than"} ${s.maximum} element(s)` : s.type === "string" ? t = `String must contain ${s.exact ? "exactly" : s.inclusive ? "at most" : "under"} ${s.maximum} character(s)` : s.type === "number" ? t = `Number must be ${s.exact ? "exactly" : s.inclusive ? "less than or equal to" : "less than"} ${s.maximum}` : s.type === "bigint" ? t = `BigInt must be ${s.exact ? "exactly" : s.inclusive ? "less than or equal to" : "less than"} ${s.maximum}` : s.type === "date" ? t = `Date must be ${s.exact ? "exactly" : s.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(s.maximum))}` : t = "Invalid input";
1109
1109
  break;
1110
1110
  case l.custom:
1111
1111
  t = "Invalid input";
@@ -1114,58 +1114,58 @@ const Oe = (r, e) => {
1114
1114
  t = "Intersection results could not be merged";
1115
1115
  break;
1116
1116
  case l.not_multiple_of:
1117
- t = `Number must be a multiple of ${r.multipleOf}`;
1117
+ t = `Number must be a multiple of ${s.multipleOf}`;
1118
1118
  break;
1119
1119
  case l.not_finite:
1120
1120
  t = "Number must be finite";
1121
1121
  break;
1122
1122
  default:
1123
- t = e.defaultError, x.assertNever(r);
1123
+ t = e.defaultError, k.assertNever(s);
1124
1124
  }
1125
1125
  return { message: t };
1126
1126
  };
1127
- let lr = Oe;
1128
- function js(r) {
1129
- lr = r;
1127
+ let ls = Ie;
1128
+ function jr(s) {
1129
+ ls = s;
1130
1130
  }
1131
1131
  function at() {
1132
- return lr;
1132
+ return ls;
1133
1133
  }
1134
- const it = (r) => {
1135
- const { data: e, path: t, errorMaps: s, issueData: n } = r, a = [...t, ...n.path || []], i = g(u({}, n), {
1134
+ const it = (s) => {
1135
+ const { data: e, path: t, errorMaps: r, issueData: n } = s, a = [...t, ...n.path || []], i = g(d({}, n), {
1136
1136
  path: a
1137
1137
  });
1138
1138
  if (n.message !== void 0)
1139
- return g(u({}, n), {
1139
+ return g(d({}, n), {
1140
1140
  path: a,
1141
1141
  message: n.message
1142
1142
  });
1143
1143
  let o = "";
1144
- const c = s.filter((d) => !!d).slice().reverse();
1145
- for (const d of c)
1146
- o = d(i, { data: e, defaultError: o }).message;
1147
- return g(u({}, n), {
1144
+ const c = r.filter((u) => !!u).slice().reverse();
1145
+ for (const u of c)
1146
+ o = u(i, { data: e, defaultError: o }).message;
1147
+ return g(d({}, n), {
1148
1148
  path: a,
1149
1149
  message: o
1150
1150
  });
1151
- }, Rs = [];
1152
- function h(r, e) {
1153
- const t = at(), s = it({
1151
+ }, Rr = [];
1152
+ function h(s, e) {
1153
+ const t = at(), r = it({
1154
1154
  issueData: e,
1155
- data: r.data,
1156
- path: r.path,
1155
+ data: s.data,
1156
+ path: s.path,
1157
1157
  errorMaps: [
1158
- r.common.contextualErrorMap,
1158
+ s.common.contextualErrorMap,
1159
1159
  // contextual error map is first priority
1160
- r.schemaErrorMap,
1160
+ s.schemaErrorMap,
1161
1161
  // then schema-bound map if available
1162
1162
  t,
1163
1163
  // then global override map
1164
- t === Oe ? void 0 : Oe
1164
+ t === Ie ? void 0 : Ie
1165
1165
  // then global default map
1166
1166
  ].filter((n) => !!n)
1167
1167
  });
1168
- r.common.issues.push(s);
1168
+ s.common.issues.push(r);
1169
1169
  }
1170
1170
  class Z {
1171
1171
  constructor() {
@@ -1178,101 +1178,101 @@ class Z {
1178
1178
  this.value !== "aborted" && (this.value = "aborted");
1179
1179
  }
1180
1180
  static mergeArray(e, t) {
1181
- const s = [];
1181
+ const r = [];
1182
1182
  for (const n of t) {
1183
1183
  if (n.status === "aborted")
1184
1184
  return _;
1185
- n.status === "dirty" && e.dirty(), s.push(n.value);
1185
+ n.status === "dirty" && e.dirty(), r.push(n.value);
1186
1186
  }
1187
- return { status: e.value, value: s };
1187
+ return { status: e.value, value: r };
1188
1188
  }
1189
1189
  static mergeObjectAsync(e, t) {
1190
- return C(this, null, function* () {
1191
- const s = [];
1190
+ return I(this, null, function* () {
1191
+ const r = [];
1192
1192
  for (const n of t) {
1193
1193
  const a = yield n.key, i = yield n.value;
1194
- s.push({
1194
+ r.push({
1195
1195
  key: a,
1196
1196
  value: i
1197
1197
  });
1198
1198
  }
1199
- return Z.mergeObjectSync(e, s);
1199
+ return Z.mergeObjectSync(e, r);
1200
1200
  });
1201
1201
  }
1202
1202
  static mergeObjectSync(e, t) {
1203
- const s = {};
1203
+ const r = {};
1204
1204
  for (const n of t) {
1205
1205
  const { key: a, value: i } = n;
1206
1206
  if (a.status === "aborted" || i.status === "aborted")
1207
1207
  return _;
1208
- a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value != "undefined" || n.alwaysSet) && (s[a.value] = i.value);
1208
+ a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value != "undefined" || n.alwaysSet) && (r[a.value] = i.value);
1209
1209
  }
1210
- return { status: e.value, value: s };
1210
+ return { status: e.value, value: r };
1211
1211
  }
1212
1212
  }
1213
1213
  const _ = Object.freeze({
1214
1214
  status: "aborted"
1215
- }), Ae = (r) => ({ status: "dirty", value: r }), $ = (r) => ({ status: "valid", value: r }), Nt = (r) => r.status === "aborted", jt = (r) => r.status === "dirty", we = (r) => r.status === "valid", Le = (r) => typeof Promise != "undefined" && r instanceof Promise;
1216
- function ot(r, e, t, s) {
1217
- 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");
1218
- return e.get(r);
1215
+ }), Ee = (s) => ({ status: "dirty", value: s }), $ = (s) => ({ status: "valid", value: s }), Nt = (s) => s.status === "aborted", jt = (s) => s.status === "dirty", _e = (s) => s.status === "valid", De = (s) => typeof Promise != "undefined" && s instanceof Promise;
1216
+ function ot(s, e, t, r) {
1217
+ if (typeof e == "function" ? s !== e || !0 : !e.has(s)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
1218
+ return e.get(s);
1219
1219
  }
1220
- function fr(r, e, t, s, n) {
1221
- 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");
1222
- return e.set(r, t), t;
1220
+ function fs(s, e, t, r, n) {
1221
+ if (typeof e == "function" ? s !== e || !0 : !e.has(s)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
1222
+ return e.set(s, t), t;
1223
1223
  }
1224
1224
  var m;
1225
- (function(r) {
1226
- r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
1225
+ (function(s) {
1226
+ s.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, s.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
1227
1227
  })(m || (m = {}));
1228
- var $e, Fe;
1229
- class ee {
1230
- constructor(e, t, s, n) {
1231
- this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = n;
1228
+ var Pe, $e;
1229
+ class Y {
1230
+ constructor(e, t, r, n) {
1231
+ this._cachedPath = [], this.parent = e, this.data = t, this._path = r, this._key = n;
1232
1232
  }
1233
1233
  get path() {
1234
1234
  return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
1235
1235
  }
1236
1236
  }
1237
- const Gt = (r, e) => {
1238
- if (we(e))
1237
+ const Gt = (s, e) => {
1238
+ if (_e(e))
1239
1239
  return { success: !0, data: e.value };
1240
- if (!r.common.issues.length)
1240
+ if (!s.common.issues.length)
1241
1241
  throw new Error("Validation failed but no issues detected.");
1242
1242
  return {
1243
1243
  success: !1,
1244
1244
  get error() {
1245
1245
  if (this._error)
1246
1246
  return this._error;
1247
- const t = new W(r.common.issues);
1247
+ const t = new U(s.common.issues);
1248
1248
  return this._error = t, this._error;
1249
1249
  }
1250
1250
  };
1251
1251
  };
1252
- function b(r) {
1253
- if (!r)
1252
+ function w(s) {
1253
+ if (!s)
1254
1254
  return {};
1255
- const { errorMap: e, invalid_type_error: t, required_error: s, description: n } = r;
1256
- if (e && (t || s))
1255
+ const { errorMap: e, invalid_type_error: t, required_error: r, description: n } = s;
1256
+ if (e && (t || r))
1257
1257
  throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
1258
1258
  return e ? { errorMap: e, description: n } : { errorMap: (i, o) => {
1259
- var c, d;
1260
- const { message: f } = r;
1261
- 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: (d = f != null ? f : t) !== null && d !== void 0 ? d : o.defaultError };
1259
+ var c, u;
1260
+ const { message: f } = s;
1261
+ return i.code === "invalid_enum_value" ? { message: f != null ? f : o.defaultError } : typeof o.data == "undefined" ? { message: (c = f != null ? f : r) !== 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 };
1262
1262
  }, description: n };
1263
1263
  }
1264
- class w {
1264
+ class x {
1265
1265
  get description() {
1266
1266
  return this._def.description;
1267
1267
  }
1268
1268
  _getType(e) {
1269
- return ae(e.data);
1269
+ return re(e.data);
1270
1270
  }
1271
1271
  _getOrReturnCtx(e, t) {
1272
1272
  return t || {
1273
1273
  common: e.parent.common,
1274
1274
  data: e.data,
1275
- parsedType: ae(e.data),
1275
+ parsedType: re(e.data),
1276
1276
  schemaErrorMap: this._def.errorMap,
1277
1277
  path: e.path,
1278
1278
  parent: e.parent
@@ -1284,7 +1284,7 @@ class w {
1284
1284
  ctx: {
1285
1285
  common: e.parent.common,
1286
1286
  data: e.data,
1287
- parsedType: ae(e.data),
1287
+ parsedType: re(e.data),
1288
1288
  schemaErrorMap: this._def.errorMap,
1289
1289
  path: e.path,
1290
1290
  parent: e.parent
@@ -1293,7 +1293,7 @@ class w {
1293
1293
  }
1294
1294
  _parseSync(e) {
1295
1295
  const t = this._parse(e);
1296
- if (Le(t))
1296
+ if (De(t))
1297
1297
  throw new Error("Synchronous parse encountered promise.");
1298
1298
  return t;
1299
1299
  }
@@ -1302,29 +1302,29 @@ class w {
1302
1302
  return Promise.resolve(t);
1303
1303
  }
1304
1304
  parse(e, t) {
1305
- const s = this.safeParse(e, t);
1306
- if (s.success)
1307
- return s.data;
1308
- throw s.error;
1305
+ const r = this.safeParse(e, t);
1306
+ if (r.success)
1307
+ return r.data;
1308
+ throw r.error;
1309
1309
  }
1310
1310
  safeParse(e, t) {
1311
- var s;
1311
+ var r;
1312
1312
  const n = {
1313
1313
  common: {
1314
1314
  issues: [],
1315
- async: (s = t == null ? void 0 : t.async) !== null && s !== void 0 ? s : !1,
1315
+ async: (r = t == null ? void 0 : t.async) !== null && r !== void 0 ? r : !1,
1316
1316
  contextualErrorMap: t == null ? void 0 : t.errorMap
1317
1317
  },
1318
1318
  path: (t == null ? void 0 : t.path) || [],
1319
1319
  schemaErrorMap: this._def.errorMap,
1320
1320
  parent: null,
1321
1321
  data: e,
1322
- parsedType: ae(e)
1322
+ parsedType: re(e)
1323
1323
  }, a = this._parseSync({ data: e, path: n.path, parent: n });
1324
1324
  return Gt(n, a);
1325
1325
  }
1326
1326
  "~validate"(e) {
1327
- var t, s;
1327
+ var t, r;
1328
1328
  const n = {
1329
1329
  common: {
1330
1330
  issues: [],
@@ -1334,39 +1334,39 @@ class w {
1334
1334
  schemaErrorMap: this._def.errorMap,
1335
1335
  parent: null,
1336
1336
  data: e,
1337
- parsedType: ae(e)
1337
+ parsedType: re(e)
1338
1338
  };
1339
1339
  if (!this["~standard"].async)
1340
1340
  try {
1341
1341
  const a = this._parseSync({ data: e, path: [], parent: n });
1342
- return we(a) ? {
1342
+ return _e(a) ? {
1343
1343
  value: a.value
1344
1344
  } : {
1345
1345
  issues: n.common.issues
1346
1346
  };
1347
1347
  } catch (a) {
1348
- !((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 = {
1348
+ !((r = (t = a == null ? void 0 : a.message) === null || t === void 0 ? void 0 : t.toLowerCase()) === null || r === void 0) && r.includes("encountered") && (this["~standard"].async = !0), n.common = {
1349
1349
  issues: [],
1350
1350
  async: !0
1351
1351
  };
1352
1352
  }
1353
- return this._parseAsync({ data: e, path: [], parent: n }).then((a) => we(a) ? {
1353
+ return this._parseAsync({ data: e, path: [], parent: n }).then((a) => _e(a) ? {
1354
1354
  value: a.value
1355
1355
  } : {
1356
1356
  issues: n.common.issues
1357
1357
  });
1358
1358
  }
1359
1359
  parseAsync(e, t) {
1360
- return C(this, null, function* () {
1361
- const s = yield this.safeParseAsync(e, t);
1362
- if (s.success)
1363
- return s.data;
1364
- throw s.error;
1360
+ return I(this, null, function* () {
1361
+ const r = yield this.safeParseAsync(e, t);
1362
+ if (r.success)
1363
+ return r.data;
1364
+ throw r.error;
1365
1365
  });
1366
1366
  }
1367
1367
  safeParseAsync(e, t) {
1368
- return C(this, null, function* () {
1369
- const s = {
1368
+ return I(this, null, function* () {
1369
+ const r = {
1370
1370
  common: {
1371
1371
  issues: [],
1372
1372
  contextualErrorMap: t == null ? void 0 : t.errorMap,
@@ -1376,25 +1376,25 @@ class w {
1376
1376
  schemaErrorMap: this._def.errorMap,
1377
1377
  parent: null,
1378
1378
  data: e,
1379
- parsedType: ae(e)
1380
- }, n = this._parse({ data: e, path: s.path, parent: s }), a = yield Le(n) ? n : Promise.resolve(n);
1381
- return Gt(s, a);
1379
+ parsedType: re(e)
1380
+ }, n = this._parse({ data: e, path: r.path, parent: r }), a = yield De(n) ? n : Promise.resolve(n);
1381
+ return Gt(r, a);
1382
1382
  });
1383
1383
  }
1384
1384
  refine(e, t) {
1385
- const s = (n) => typeof t == "string" || typeof t == "undefined" ? { message: t } : typeof t == "function" ? t(n) : t;
1385
+ const r = (n) => typeof t == "string" || typeof t == "undefined" ? { message: t } : typeof t == "function" ? t(n) : t;
1386
1386
  return this._refinement((n, a) => {
1387
- const i = e(n), o = () => a.addIssue(u({
1387
+ const i = e(n), o = () => a.addIssue(d({
1388
1388
  code: l.custom
1389
- }, s(n)));
1389
+ }, r(n)));
1390
1390
  return typeof Promise != "undefined" && i instanceof Promise ? i.then((c) => c ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
1391
1391
  });
1392
1392
  }
1393
1393
  refinement(e, t) {
1394
- return this._refinement((s, n) => e(s) ? !0 : (n.addIssue(typeof t == "function" ? t(s, n) : t), !1));
1394
+ return this._refinement((r, n) => e(r) ? !0 : (n.addIssue(typeof t == "function" ? t(r, n) : t), !1));
1395
1395
  }
1396
1396
  _refinement(e) {
1397
- return new G({
1397
+ return new H({
1398
1398
  schema: this,
1399
1399
  typeName: y.ZodEffects,
1400
1400
  effect: { type: "refinement", refinement: e }
@@ -1411,28 +1411,28 @@ class w {
1411
1411
  };
1412
1412
  }
1413
1413
  optional() {
1414
- return Q.create(this, this._def);
1414
+ return X.create(this, this._def);
1415
1415
  }
1416
1416
  nullable() {
1417
- return pe.create(this, this._def);
1417
+ return fe.create(this, this._def);
1418
1418
  }
1419
1419
  nullish() {
1420
1420
  return this.nullable().optional();
1421
1421
  }
1422
1422
  array() {
1423
- return J.create(this);
1423
+ return q.create(this);
1424
1424
  }
1425
1425
  promise() {
1426
- return je.create(this, this._def);
1426
+ return Ne.create(this, this._def);
1427
1427
  }
1428
1428
  or(e) {
1429
- return ze.create([this, e], this._def);
1429
+ return We.create([this, e], this._def);
1430
1430
  }
1431
1431
  and(e) {
1432
- return Be.create(this, e, this._def);
1432
+ return ze.create(this, e, this._def);
1433
1433
  }
1434
1434
  transform(e) {
1435
- return new G(g(u({}, b(this._def)), {
1435
+ return new H(g(d({}, w(this._def)), {
1436
1436
  schema: this,
1437
1437
  typeName: y.ZodEffects,
1438
1438
  effect: { type: "transform", transform: e }
@@ -1440,21 +1440,21 @@ class w {
1440
1440
  }
1441
1441
  default(e) {
1442
1442
  const t = typeof e == "function" ? e : () => e;
1443
- return new Ke(g(u({}, b(this._def)), {
1443
+ return new Ge(g(d({}, w(this._def)), {
1444
1444
  innerType: this,
1445
1445
  defaultValue: t,
1446
1446
  typeName: y.ZodDefault
1447
1447
  }));
1448
1448
  }
1449
1449
  brand() {
1450
- return new $t(u({
1450
+ return new $t(d({
1451
1451
  typeName: y.ZodBranded,
1452
1452
  type: this
1453
- }, b(this._def)));
1453
+ }, w(this._def)));
1454
1454
  }
1455
1455
  catch(e) {
1456
1456
  const t = typeof e == "function" ? e : () => e;
1457
- return new Xe(g(u({}, b(this._def)), {
1457
+ return new Ke(g(d({}, w(this._def)), {
1458
1458
  innerType: this,
1459
1459
  catchValue: t,
1460
1460
  typeName: y.ZodCatch
@@ -1462,15 +1462,15 @@ class w {
1462
1462
  }
1463
1463
  describe(e) {
1464
1464
  const t = this.constructor;
1465
- return new t(g(u({}, this._def), {
1465
+ return new t(g(d({}, this._def), {
1466
1466
  description: e
1467
1467
  }));
1468
1468
  }
1469
1469
  pipe(e) {
1470
- return et.create(this, e);
1470
+ return Qe.create(this, e);
1471
1471
  }
1472
1472
  readonly() {
1473
- return Ye.create(this);
1473
+ return Xe.create(this);
1474
1474
  }
1475
1475
  isOptional() {
1476
1476
  return this.safeParse(void 0).success;
@@ -1479,38 +1479,38 @@ class w {
1479
1479
  return this.safeParse(null).success;
1480
1480
  }
1481
1481
  }
1482
- const Zs = /^c[^\s-]{8,}$/i, Ms = /^[0-9a-z]+$/, Ps = /^[0-9A-HJKMNP-TV-Z]{26}$/i, $s = /^[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, Fs = /^[a-z0-9_-]{21}$/i, Ds = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Ls = /^[-+]?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)?)??$/, Vs = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Us = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
1482
+ const Zr = /^c[^\s-]{8,}$/i, Mr = /^[0-9a-z]+$/, Pr = /^[0-9A-HJKMNP-TV-Z]{26}$/i, $r = /^[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, Fr = /^[a-z0-9_-]{21}$/i, Dr = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Lr = /^[-+]?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)?)??$/, Vr = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ur = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
1483
1483
  let bt;
1484
- const Ws = /^(?:(?: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])$/, zs = /^(?:(?: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])$/, Bs = /^(([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]))$/, qs = /^(([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])$/, Hs = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Js = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, hr = "((\\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])))", Gs = new RegExp(`^${hr}$`);
1485
- function pr(r) {
1484
+ const Wr = /^(?:(?: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])$/, zr = /^(?:(?: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])$/, Br = /^(([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]))$/, qr = /^(([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])$/, Hr = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Jr = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, hs = "((\\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])))", Gr = new RegExp(`^${hs}$`);
1485
+ function ps(s) {
1486
1486
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
1487
- return r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`), e;
1487
+ return s.precision ? e = `${e}\\.\\d{${s.precision}}` : s.precision == null && (e = `${e}(\\.\\d+)?`), e;
1488
1488
  }
1489
- function Ks(r) {
1490
- return new RegExp(`^${pr(r)}$`);
1489
+ function Kr(s) {
1490
+ return new RegExp(`^${ps(s)}$`);
1491
1491
  }
1492
- function mr(r) {
1493
- let e = `${hr}T${pr(r)}`;
1492
+ function ms(s) {
1493
+ let e = `${hs}T${ps(s)}`;
1494
1494
  const t = [];
1495
- return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
1495
+ return t.push(s.local ? "Z?" : "Z"), s.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
1496
1496
  }
1497
- function Xs(r, e) {
1498
- return !!((e === "v4" || !e) && Ws.test(r) || (e === "v6" || !e) && Bs.test(r));
1497
+ function Xr(s, e) {
1498
+ return !!((e === "v4" || !e) && Wr.test(s) || (e === "v6" || !e) && Br.test(s));
1499
1499
  }
1500
- function Ys(r, e) {
1501
- if (!Ds.test(r))
1500
+ function Yr(s, e) {
1501
+ if (!Dr.test(s))
1502
1502
  return !1;
1503
1503
  try {
1504
- const [t] = r.split("."), s = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), n = JSON.parse(atob(s));
1504
+ const [t] = s.split("."), r = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), n = JSON.parse(atob(r));
1505
1505
  return !(typeof n != "object" || n === null || !n.typ || !n.alg || e && n.alg !== e);
1506
1506
  } catch (t) {
1507
1507
  return !1;
1508
1508
  }
1509
1509
  }
1510
- function Qs(r, e) {
1511
- return !!((e === "v4" || !e) && zs.test(r) || (e === "v6" || !e) && qs.test(r));
1510
+ function Qr(s, e) {
1511
+ return !!((e === "v4" || !e) && zr.test(s) || (e === "v6" || !e) && qr.test(s));
1512
1512
  }
1513
- class H extends w {
1513
+ class B extends x {
1514
1514
  _parse(e) {
1515
1515
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== p.string) {
1516
1516
  const a = this._getOrReturnCtx(e);
@@ -1520,7 +1520,7 @@ class H extends w {
1520
1520
  received: a.parsedType
1521
1521
  }), _;
1522
1522
  }
1523
- const s = new Z();
1523
+ const r = new Z();
1524
1524
  let n;
1525
1525
  for (const a of this._def.checks)
1526
1526
  if (a.kind === "min")
@@ -1531,7 +1531,7 @@ class H extends w {
1531
1531
  inclusive: !0,
1532
1532
  exact: !1,
1533
1533
  message: a.message
1534
- }), s.dirty());
1534
+ }), r.dirty());
1535
1535
  else if (a.kind === "max")
1536
1536
  e.data.length > a.value && (n = this._getOrReturnCtx(e, n), h(n, {
1537
1537
  code: l.too_big,
@@ -1540,7 +1540,7 @@ class H extends w {
1540
1540
  inclusive: !0,
1541
1541
  exact: !1,
1542
1542
  message: a.message
1543
- }), s.dirty());
1543
+ }), r.dirty());
1544
1544
  else if (a.kind === "length") {
1545
1545
  const i = e.data.length > a.value, o = e.data.length < a.value;
1546
1546
  (i || o) && (n = this._getOrReturnCtx(e, n), i ? h(n, {
@@ -1557,49 +1557,49 @@ class H extends w {
1557
1557
  inclusive: !0,
1558
1558
  exact: !0,
1559
1559
  message: a.message
1560
- }), s.dirty());
1560
+ }), r.dirty());
1561
1561
  } else if (a.kind === "email")
1562
- Vs.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1562
+ Vr.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1563
1563
  validation: "email",
1564
1564
  code: l.invalid_string,
1565
1565
  message: a.message
1566
- }), s.dirty());
1566
+ }), r.dirty());
1567
1567
  else if (a.kind === "emoji")
1568
- bt || (bt = new RegExp(Us, "u")), bt.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1568
+ bt || (bt = new RegExp(Ur, "u")), bt.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1569
1569
  validation: "emoji",
1570
1570
  code: l.invalid_string,
1571
1571
  message: a.message
1572
- }), s.dirty());
1572
+ }), r.dirty());
1573
1573
  else if (a.kind === "uuid")
1574
- $s.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1574
+ $r.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1575
1575
  validation: "uuid",
1576
1576
  code: l.invalid_string,
1577
1577
  message: a.message
1578
- }), s.dirty());
1578
+ }), r.dirty());
1579
1579
  else if (a.kind === "nanoid")
1580
- Fs.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1580
+ Fr.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1581
1581
  validation: "nanoid",
1582
1582
  code: l.invalid_string,
1583
1583
  message: a.message
1584
- }), s.dirty());
1584
+ }), r.dirty());
1585
1585
  else if (a.kind === "cuid")
1586
- Zs.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1586
+ Zr.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1587
1587
  validation: "cuid",
1588
1588
  code: l.invalid_string,
1589
1589
  message: a.message
1590
- }), s.dirty());
1590
+ }), r.dirty());
1591
1591
  else if (a.kind === "cuid2")
1592
- Ms.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1592
+ Mr.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1593
1593
  validation: "cuid2",
1594
1594
  code: l.invalid_string,
1595
1595
  message: a.message
1596
- }), s.dirty());
1596
+ }), r.dirty());
1597
1597
  else if (a.kind === "ulid")
1598
- Ps.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1598
+ Pr.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1599
1599
  validation: "ulid",
1600
1600
  code: l.invalid_string,
1601
1601
  message: a.message
1602
- }), s.dirty());
1602
+ }), r.dirty());
1603
1603
  else if (a.kind === "url")
1604
1604
  try {
1605
1605
  new URL(e.data);
@@ -1608,128 +1608,128 @@ class H extends w {
1608
1608
  validation: "url",
1609
1609
  code: l.invalid_string,
1610
1610
  message: a.message
1611
- }), s.dirty();
1611
+ }), r.dirty();
1612
1612
  }
1613
1613
  else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1614
1614
  validation: "regex",
1615
1615
  code: l.invalid_string,
1616
1616
  message: a.message
1617
- }), 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, {
1617
+ }), r.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, {
1618
1618
  code: l.invalid_string,
1619
1619
  validation: { includes: a.value, position: a.position },
1620
1620
  message: a.message
1621
- }), 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, {
1621
+ }), r.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, {
1622
1622
  code: l.invalid_string,
1623
1623
  validation: { startsWith: a.value },
1624
1624
  message: a.message
1625
- }), s.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (n = this._getOrReturnCtx(e, n), h(n, {
1625
+ }), r.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (n = this._getOrReturnCtx(e, n), h(n, {
1626
1626
  code: l.invalid_string,
1627
1627
  validation: { endsWith: a.value },
1628
1628
  message: a.message
1629
- }), s.dirty()) : a.kind === "datetime" ? mr(a).test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1629
+ }), r.dirty()) : a.kind === "datetime" ? ms(a).test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1630
1630
  code: l.invalid_string,
1631
1631
  validation: "datetime",
1632
1632
  message: a.message
1633
- }), s.dirty()) : a.kind === "date" ? Gs.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1633
+ }), r.dirty()) : a.kind === "date" ? Gr.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1634
1634
  code: l.invalid_string,
1635
1635
  validation: "date",
1636
1636
  message: a.message
1637
- }), s.dirty()) : a.kind === "time" ? Ks(a).test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1637
+ }), r.dirty()) : a.kind === "time" ? Kr(a).test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1638
1638
  code: l.invalid_string,
1639
1639
  validation: "time",
1640
1640
  message: a.message
1641
- }), s.dirty()) : a.kind === "duration" ? Ls.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1641
+ }), r.dirty()) : a.kind === "duration" ? Lr.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1642
1642
  validation: "duration",
1643
1643
  code: l.invalid_string,
1644
1644
  message: a.message
1645
- }), s.dirty()) : a.kind === "ip" ? Xs(e.data, a.version) || (n = this._getOrReturnCtx(e, n), h(n, {
1645
+ }), r.dirty()) : a.kind === "ip" ? Xr(e.data, a.version) || (n = this._getOrReturnCtx(e, n), h(n, {
1646
1646
  validation: "ip",
1647
1647
  code: l.invalid_string,
1648
1648
  message: a.message
1649
- }), s.dirty()) : a.kind === "jwt" ? Ys(e.data, a.alg) || (n = this._getOrReturnCtx(e, n), h(n, {
1649
+ }), r.dirty()) : a.kind === "jwt" ? Yr(e.data, a.alg) || (n = this._getOrReturnCtx(e, n), h(n, {
1650
1650
  validation: "jwt",
1651
1651
  code: l.invalid_string,
1652
1652
  message: a.message
1653
- }), s.dirty()) : a.kind === "cidr" ? Qs(e.data, a.version) || (n = this._getOrReturnCtx(e, n), h(n, {
1653
+ }), r.dirty()) : a.kind === "cidr" ? Qr(e.data, a.version) || (n = this._getOrReturnCtx(e, n), h(n, {
1654
1654
  validation: "cidr",
1655
1655
  code: l.invalid_string,
1656
1656
  message: a.message
1657
- }), s.dirty()) : a.kind === "base64" ? Hs.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1657
+ }), r.dirty()) : a.kind === "base64" ? Hr.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1658
1658
  validation: "base64",
1659
1659
  code: l.invalid_string,
1660
1660
  message: a.message
1661
- }), s.dirty()) : a.kind === "base64url" ? Js.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1661
+ }), r.dirty()) : a.kind === "base64url" ? Jr.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
1662
1662
  validation: "base64url",
1663
1663
  code: l.invalid_string,
1664
1664
  message: a.message
1665
- }), s.dirty()) : x.assertNever(a);
1666
- return { status: s.value, value: e.data };
1665
+ }), r.dirty()) : k.assertNever(a);
1666
+ return { status: r.value, value: e.data };
1667
1667
  }
1668
- _regex(e, t, s) {
1669
- return this.refinement((n) => e.test(n), u({
1668
+ _regex(e, t, r) {
1669
+ return this.refinement((n) => e.test(n), d({
1670
1670
  validation: t,
1671
1671
  code: l.invalid_string
1672
- }, m.errToObj(s)));
1672
+ }, m.errToObj(r)));
1673
1673
  }
1674
1674
  _addCheck(e) {
1675
- return new H(g(u({}, this._def), {
1675
+ return new B(g(d({}, this._def), {
1676
1676
  checks: [...this._def.checks, e]
1677
1677
  }));
1678
1678
  }
1679
1679
  email(e) {
1680
- return this._addCheck(u({ kind: "email" }, m.errToObj(e)));
1680
+ return this._addCheck(d({ kind: "email" }, m.errToObj(e)));
1681
1681
  }
1682
1682
  url(e) {
1683
- return this._addCheck(u({ kind: "url" }, m.errToObj(e)));
1683
+ return this._addCheck(d({ kind: "url" }, m.errToObj(e)));
1684
1684
  }
1685
1685
  emoji(e) {
1686
- return this._addCheck(u({ kind: "emoji" }, m.errToObj(e)));
1686
+ return this._addCheck(d({ kind: "emoji" }, m.errToObj(e)));
1687
1687
  }
1688
1688
  uuid(e) {
1689
- return this._addCheck(u({ kind: "uuid" }, m.errToObj(e)));
1689
+ return this._addCheck(d({ kind: "uuid" }, m.errToObj(e)));
1690
1690
  }
1691
1691
  nanoid(e) {
1692
- return this._addCheck(u({ kind: "nanoid" }, m.errToObj(e)));
1692
+ return this._addCheck(d({ kind: "nanoid" }, m.errToObj(e)));
1693
1693
  }
1694
1694
  cuid(e) {
1695
- return this._addCheck(u({ kind: "cuid" }, m.errToObj(e)));
1695
+ return this._addCheck(d({ kind: "cuid" }, m.errToObj(e)));
1696
1696
  }
1697
1697
  cuid2(e) {
1698
- return this._addCheck(u({ kind: "cuid2" }, m.errToObj(e)));
1698
+ return this._addCheck(d({ kind: "cuid2" }, m.errToObj(e)));
1699
1699
  }
1700
1700
  ulid(e) {
1701
- return this._addCheck(u({ kind: "ulid" }, m.errToObj(e)));
1701
+ return this._addCheck(d({ kind: "ulid" }, m.errToObj(e)));
1702
1702
  }
1703
1703
  base64(e) {
1704
- return this._addCheck(u({ kind: "base64" }, m.errToObj(e)));
1704
+ return this._addCheck(d({ kind: "base64" }, m.errToObj(e)));
1705
1705
  }
1706
1706
  base64url(e) {
1707
- return this._addCheck(u({
1707
+ return this._addCheck(d({
1708
1708
  kind: "base64url"
1709
1709
  }, m.errToObj(e)));
1710
1710
  }
1711
1711
  jwt(e) {
1712
- return this._addCheck(u({ kind: "jwt" }, m.errToObj(e)));
1712
+ return this._addCheck(d({ kind: "jwt" }, m.errToObj(e)));
1713
1713
  }
1714
1714
  ip(e) {
1715
- return this._addCheck(u({ kind: "ip" }, m.errToObj(e)));
1715
+ return this._addCheck(d({ kind: "ip" }, m.errToObj(e)));
1716
1716
  }
1717
1717
  cidr(e) {
1718
- return this._addCheck(u({ kind: "cidr" }, m.errToObj(e)));
1718
+ return this._addCheck(d({ kind: "cidr" }, m.errToObj(e)));
1719
1719
  }
1720
1720
  datetime(e) {
1721
- var t, s;
1721
+ var t, r;
1722
1722
  return typeof e == "string" ? this._addCheck({
1723
1723
  kind: "datetime",
1724
1724
  precision: null,
1725
1725
  offset: !1,
1726
1726
  local: !1,
1727
1727
  message: e
1728
- }) : this._addCheck(u({
1728
+ }) : this._addCheck(d({
1729
1729
  kind: "datetime",
1730
1730
  precision: typeof (e == null ? void 0 : e.precision) == "undefined" ? null : e == null ? void 0 : e.precision,
1731
1731
  offset: (t = e == null ? void 0 : e.offset) !== null && t !== void 0 ? t : !1,
1732
- local: (s = e == null ? void 0 : e.local) !== null && s !== void 0 ? s : !1
1732
+ local: (r = e == null ? void 0 : e.local) !== null && r !== void 0 ? r : !1
1733
1733
  }, m.errToObj(e == null ? void 0 : e.message)));
1734
1734
  }
1735
1735
  date(e) {
@@ -1740,53 +1740,53 @@ class H extends w {
1740
1740
  kind: "time",
1741
1741
  precision: null,
1742
1742
  message: e
1743
- }) : this._addCheck(u({
1743
+ }) : this._addCheck(d({
1744
1744
  kind: "time",
1745
1745
  precision: typeof (e == null ? void 0 : e.precision) == "undefined" ? null : e == null ? void 0 : e.precision
1746
1746
  }, m.errToObj(e == null ? void 0 : e.message)));
1747
1747
  }
1748
1748
  duration(e) {
1749
- return this._addCheck(u({ kind: "duration" }, m.errToObj(e)));
1749
+ return this._addCheck(d({ kind: "duration" }, m.errToObj(e)));
1750
1750
  }
1751
1751
  regex(e, t) {
1752
- return this._addCheck(u({
1752
+ return this._addCheck(d({
1753
1753
  kind: "regex",
1754
1754
  regex: e
1755
1755
  }, m.errToObj(t)));
1756
1756
  }
1757
1757
  includes(e, t) {
1758
- return this._addCheck(u({
1758
+ return this._addCheck(d({
1759
1759
  kind: "includes",
1760
1760
  value: e,
1761
1761
  position: t == null ? void 0 : t.position
1762
1762
  }, m.errToObj(t == null ? void 0 : t.message)));
1763
1763
  }
1764
1764
  startsWith(e, t) {
1765
- return this._addCheck(u({
1765
+ return this._addCheck(d({
1766
1766
  kind: "startsWith",
1767
1767
  value: e
1768
1768
  }, m.errToObj(t)));
1769
1769
  }
1770
1770
  endsWith(e, t) {
1771
- return this._addCheck(u({
1771
+ return this._addCheck(d({
1772
1772
  kind: "endsWith",
1773
1773
  value: e
1774
1774
  }, m.errToObj(t)));
1775
1775
  }
1776
1776
  min(e, t) {
1777
- return this._addCheck(u({
1777
+ return this._addCheck(d({
1778
1778
  kind: "min",
1779
1779
  value: e
1780
1780
  }, m.errToObj(t)));
1781
1781
  }
1782
1782
  max(e, t) {
1783
- return this._addCheck(u({
1783
+ return this._addCheck(d({
1784
1784
  kind: "max",
1785
1785
  value: e
1786
1786
  }, m.errToObj(t)));
1787
1787
  }
1788
1788
  length(e, t) {
1789
- return this._addCheck(u({
1789
+ return this._addCheck(d({
1790
1790
  kind: "length",
1791
1791
  value: e
1792
1792
  }, m.errToObj(t)));
@@ -1798,17 +1798,17 @@ class H extends w {
1798
1798
  return this.min(1, m.errToObj(e));
1799
1799
  }
1800
1800
  trim() {
1801
- return new H(g(u({}, this._def), {
1801
+ return new B(g(d({}, this._def), {
1802
1802
  checks: [...this._def.checks, { kind: "trim" }]
1803
1803
  }));
1804
1804
  }
1805
1805
  toLowerCase() {
1806
- return new H(g(u({}, this._def), {
1806
+ return new B(g(d({}, this._def), {
1807
1807
  checks: [...this._def.checks, { kind: "toLowerCase" }]
1808
1808
  }));
1809
1809
  }
1810
1810
  toUpperCase() {
1811
- return new H(g(u({}, this._def), {
1811
+ return new B(g(d({}, this._def), {
1812
1812
  checks: [...this._def.checks, { kind: "toUpperCase" }]
1813
1813
  }));
1814
1814
  }
@@ -1873,19 +1873,19 @@ class H extends w {
1873
1873
  return e;
1874
1874
  }
1875
1875
  }
1876
- H.create = (r) => {
1876
+ B.create = (s) => {
1877
1877
  var e;
1878
- return new H(u({
1878
+ return new B(d({
1879
1879
  checks: [],
1880
1880
  typeName: y.ZodString,
1881
- coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1
1882
- }, b(r)));
1881
+ coerce: (e = s == null ? void 0 : s.coerce) !== null && e !== void 0 ? e : !1
1882
+ }, w(s)));
1883
1883
  };
1884
- function en(r, e) {
1885
- 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(".", ""));
1884
+ function en(s, e) {
1885
+ const t = (s.toString().split(".")[1] || "").length, r = (e.toString().split(".")[1] || "").length, n = t > r ? t : r, a = parseInt(s.toFixed(n).replace(".", "")), i = parseInt(e.toFixed(n).replace(".", ""));
1886
1886
  return a % i / Math.pow(10, n);
1887
1887
  }
1888
- class le extends w {
1888
+ class ue extends x {
1889
1889
  constructor() {
1890
1890
  super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
1891
1891
  }
@@ -1898,36 +1898,36 @@ class le extends w {
1898
1898
  received: a.parsedType
1899
1899
  }), _;
1900
1900
  }
1901
- let s;
1901
+ let r;
1902
1902
  const n = new Z();
1903
1903
  for (const a of this._def.checks)
1904
- a.kind === "int" ? x.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
1904
+ a.kind === "int" ? k.isInteger(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
1905
1905
  code: l.invalid_type,
1906
1906
  expected: "integer",
1907
1907
  received: "float",
1908
1908
  message: a.message
1909
- }), n.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), h(s, {
1909
+ }), n.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (r = this._getOrReturnCtx(e, r), h(r, {
1910
1910
  code: l.too_small,
1911
1911
  minimum: a.value,
1912
1912
  type: "number",
1913
1913
  inclusive: a.inclusive,
1914
1914
  exact: !1,
1915
1915
  message: a.message
1916
- }), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), h(s, {
1916
+ }), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (r = this._getOrReturnCtx(e, r), h(r, {
1917
1917
  code: l.too_big,
1918
1918
  maximum: a.value,
1919
1919
  type: "number",
1920
1920
  inclusive: a.inclusive,
1921
1921
  exact: !1,
1922
1922
  message: a.message
1923
- }), n.dirty()) : a.kind === "multipleOf" ? en(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), h(s, {
1923
+ }), n.dirty()) : a.kind === "multipleOf" ? en(e.data, a.value) !== 0 && (r = this._getOrReturnCtx(e, r), h(r, {
1924
1924
  code: l.not_multiple_of,
1925
1925
  multipleOf: a.value,
1926
1926
  message: a.message
1927
- }), n.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
1927
+ }), n.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
1928
1928
  code: l.not_finite,
1929
1929
  message: a.message
1930
- }), n.dirty()) : x.assertNever(a);
1930
+ }), n.dirty()) : k.assertNever(a);
1931
1931
  return { status: n.value, value: e.data };
1932
1932
  }
1933
1933
  gte(e, t) {
@@ -1942,21 +1942,21 @@ class le extends w {
1942
1942
  lt(e, t) {
1943
1943
  return this.setLimit("max", e, !1, m.toString(t));
1944
1944
  }
1945
- setLimit(e, t, s, n) {
1946
- return new le(g(u({}, this._def), {
1945
+ setLimit(e, t, r, n) {
1946
+ return new ue(g(d({}, this._def), {
1947
1947
  checks: [
1948
1948
  ...this._def.checks,
1949
1949
  {
1950
1950
  kind: e,
1951
1951
  value: t,
1952
- inclusive: s,
1952
+ inclusive: r,
1953
1953
  message: m.toString(n)
1954
1954
  }
1955
1955
  ]
1956
1956
  }));
1957
1957
  }
1958
1958
  _addCheck(e) {
1959
- return new le(g(u({}, this._def), {
1959
+ return new ue(g(d({}, this._def), {
1960
1960
  checks: [...this._def.checks, e]
1961
1961
  }));
1962
1962
  }
@@ -2037,24 +2037,24 @@ class le extends w {
2037
2037
  return e;
2038
2038
  }
2039
2039
  get isInt() {
2040
- return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && x.isInteger(e.value));
2040
+ return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && k.isInteger(e.value));
2041
2041
  }
2042
2042
  get isFinite() {
2043
2043
  let e = null, t = null;
2044
- for (const s of this._def.checks) {
2045
- if (s.kind === "finite" || s.kind === "int" || s.kind === "multipleOf")
2044
+ for (const r of this._def.checks) {
2045
+ if (r.kind === "finite" || r.kind === "int" || r.kind === "multipleOf")
2046
2046
  return !0;
2047
- s.kind === "min" ? (t === null || s.value > t) && (t = s.value) : s.kind === "max" && (e === null || s.value < e) && (e = s.value);
2047
+ r.kind === "min" ? (t === null || r.value > t) && (t = r.value) : r.kind === "max" && (e === null || r.value < e) && (e = r.value);
2048
2048
  }
2049
2049
  return Number.isFinite(t) && Number.isFinite(e);
2050
2050
  }
2051
2051
  }
2052
- le.create = (r) => new le(u({
2052
+ ue.create = (s) => new ue(d({
2053
2053
  checks: [],
2054
2054
  typeName: y.ZodNumber,
2055
- coerce: (r == null ? void 0 : r.coerce) || !1
2056
- }, b(r)));
2057
- class fe extends w {
2055
+ coerce: (s == null ? void 0 : s.coerce) || !1
2056
+ }, w(s)));
2057
+ class de extends x {
2058
2058
  constructor() {
2059
2059
  super(...arguments), this.min = this.gte, this.max = this.lte;
2060
2060
  }
@@ -2067,26 +2067,26 @@ class fe extends w {
2067
2067
  }
2068
2068
  if (this._getType(e) !== p.bigint)
2069
2069
  return this._getInvalidInput(e);
2070
- let s;
2070
+ let r;
2071
2071
  const n = new Z();
2072
2072
  for (const a of this._def.checks)
2073
- a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), h(s, {
2073
+ a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (r = this._getOrReturnCtx(e, r), h(r, {
2074
2074
  code: l.too_small,
2075
2075
  type: "bigint",
2076
2076
  minimum: a.value,
2077
2077
  inclusive: a.inclusive,
2078
2078
  message: a.message
2079
- }), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), h(s, {
2079
+ }), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (r = this._getOrReturnCtx(e, r), h(r, {
2080
2080
  code: l.too_big,
2081
2081
  type: "bigint",
2082
2082
  maximum: a.value,
2083
2083
  inclusive: a.inclusive,
2084
2084
  message: a.message
2085
- }), n.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (s = this._getOrReturnCtx(e, s), h(s, {
2085
+ }), n.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (r = this._getOrReturnCtx(e, r), h(r, {
2086
2086
  code: l.not_multiple_of,
2087
2087
  multipleOf: a.value,
2088
2088
  message: a.message
2089
- }), n.dirty()) : x.assertNever(a);
2089
+ }), n.dirty()) : k.assertNever(a);
2090
2090
  return { status: n.value, value: e.data };
2091
2091
  }
2092
2092
  _getInvalidInput(e) {
@@ -2109,21 +2109,21 @@ class fe extends w {
2109
2109
  lt(e, t) {
2110
2110
  return this.setLimit("max", e, !1, m.toString(t));
2111
2111
  }
2112
- setLimit(e, t, s, n) {
2113
- return new fe(g(u({}, this._def), {
2112
+ setLimit(e, t, r, n) {
2113
+ return new de(g(d({}, this._def), {
2114
2114
  checks: [
2115
2115
  ...this._def.checks,
2116
2116
  {
2117
2117
  kind: e,
2118
2118
  value: t,
2119
- inclusive: s,
2119
+ inclusive: r,
2120
2120
  message: m.toString(n)
2121
2121
  }
2122
2122
  ]
2123
2123
  }));
2124
2124
  }
2125
2125
  _addCheck(e) {
2126
- return new fe(g(u({}, this._def), {
2126
+ return new de(g(d({}, this._def), {
2127
2127
  checks: [...this._def.checks, e]
2128
2128
  }));
2129
2129
  }
@@ -2179,32 +2179,32 @@ class fe extends w {
2179
2179
  return e;
2180
2180
  }
2181
2181
  }
2182
- fe.create = (r) => {
2182
+ de.create = (s) => {
2183
2183
  var e;
2184
- return new fe(u({
2184
+ return new de(d({
2185
2185
  checks: [],
2186
2186
  typeName: y.ZodBigInt,
2187
- coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1
2188
- }, b(r)));
2187
+ coerce: (e = s == null ? void 0 : s.coerce) !== null && e !== void 0 ? e : !1
2188
+ }, w(s)));
2189
2189
  };
2190
- class Ve extends w {
2190
+ class Le extends x {
2191
2191
  _parse(e) {
2192
2192
  if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== p.boolean) {
2193
- const s = this._getOrReturnCtx(e);
2194
- return h(s, {
2193
+ const r = this._getOrReturnCtx(e);
2194
+ return h(r, {
2195
2195
  code: l.invalid_type,
2196
2196
  expected: p.boolean,
2197
- received: s.parsedType
2197
+ received: r.parsedType
2198
2198
  }), _;
2199
2199
  }
2200
2200
  return $(e.data);
2201
2201
  }
2202
2202
  }
2203
- Ve.create = (r) => new Ve(u({
2203
+ Le.create = (s) => new Le(d({
2204
2204
  typeName: y.ZodBoolean,
2205
- coerce: (r == null ? void 0 : r.coerce) || !1
2206
- }, b(r)));
2207
- class xe extends w {
2205
+ coerce: (s == null ? void 0 : s.coerce) || !1
2206
+ }, w(s)));
2207
+ class be extends x {
2208
2208
  _parse(e) {
2209
2209
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== p.date) {
2210
2210
  const a = this._getOrReturnCtx(e);
@@ -2220,7 +2220,7 @@ class xe extends w {
2220
2220
  code: l.invalid_date
2221
2221
  }), _;
2222
2222
  }
2223
- const s = new Z();
2223
+ const r = new Z();
2224
2224
  let n;
2225
2225
  for (const a of this._def.checks)
2226
2226
  a.kind === "min" ? e.data.getTime() < a.value && (n = this._getOrReturnCtx(e, n), h(n, {
@@ -2230,21 +2230,21 @@ class xe extends w {
2230
2230
  exact: !1,
2231
2231
  minimum: a.value,
2232
2232
  type: "date"
2233
- }), s.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (n = this._getOrReturnCtx(e, n), h(n, {
2233
+ }), r.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (n = this._getOrReturnCtx(e, n), h(n, {
2234
2234
  code: l.too_big,
2235
2235
  message: a.message,
2236
2236
  inclusive: !0,
2237
2237
  exact: !1,
2238
2238
  maximum: a.value,
2239
2239
  type: "date"
2240
- }), s.dirty()) : x.assertNever(a);
2240
+ }), r.dirty()) : k.assertNever(a);
2241
2241
  return {
2242
- status: s.value,
2242
+ status: r.value,
2243
2243
  value: new Date(e.data.getTime())
2244
2244
  };
2245
2245
  }
2246
2246
  _addCheck(e) {
2247
- return new xe(g(u({}, this._def), {
2247
+ return new be(g(d({}, this._def), {
2248
2248
  checks: [...this._def.checks, e]
2249
2249
  }));
2250
2250
  }
@@ -2275,60 +2275,60 @@ class xe extends w {
2275
2275
  return e != null ? new Date(e) : null;
2276
2276
  }
2277
2277
  }
2278
- xe.create = (r) => new xe(u({
2278
+ be.create = (s) => new be(d({
2279
2279
  checks: [],
2280
- coerce: (r == null ? void 0 : r.coerce) || !1,
2280
+ coerce: (s == null ? void 0 : s.coerce) || !1,
2281
2281
  typeName: y.ZodDate
2282
- }, b(r)));
2283
- class ct extends w {
2282
+ }, w(s)));
2283
+ class ct extends x {
2284
2284
  _parse(e) {
2285
2285
  if (this._getType(e) !== p.symbol) {
2286
- const s = this._getOrReturnCtx(e);
2287
- return h(s, {
2286
+ const r = this._getOrReturnCtx(e);
2287
+ return h(r, {
2288
2288
  code: l.invalid_type,
2289
2289
  expected: p.symbol,
2290
- received: s.parsedType
2290
+ received: r.parsedType
2291
2291
  }), _;
2292
2292
  }
2293
2293
  return $(e.data);
2294
2294
  }
2295
2295
  }
2296
- ct.create = (r) => new ct(u({
2296
+ ct.create = (s) => new ct(d({
2297
2297
  typeName: y.ZodSymbol
2298
- }, b(r)));
2299
- class Ue extends w {
2298
+ }, w(s)));
2299
+ class Ve extends x {
2300
2300
  _parse(e) {
2301
2301
  if (this._getType(e) !== p.undefined) {
2302
- const s = this._getOrReturnCtx(e);
2303
- return h(s, {
2302
+ const r = this._getOrReturnCtx(e);
2303
+ return h(r, {
2304
2304
  code: l.invalid_type,
2305
2305
  expected: p.undefined,
2306
- received: s.parsedType
2306
+ received: r.parsedType
2307
2307
  }), _;
2308
2308
  }
2309
2309
  return $(e.data);
2310
2310
  }
2311
2311
  }
2312
- Ue.create = (r) => new Ue(u({
2312
+ Ve.create = (s) => new Ve(d({
2313
2313
  typeName: y.ZodUndefined
2314
- }, b(r)));
2315
- class We extends w {
2314
+ }, w(s)));
2315
+ class Ue extends x {
2316
2316
  _parse(e) {
2317
2317
  if (this._getType(e) !== p.null) {
2318
- const s = this._getOrReturnCtx(e);
2319
- return h(s, {
2318
+ const r = this._getOrReturnCtx(e);
2319
+ return h(r, {
2320
2320
  code: l.invalid_type,
2321
2321
  expected: p.null,
2322
- received: s.parsedType
2322
+ received: r.parsedType
2323
2323
  }), _;
2324
2324
  }
2325
2325
  return $(e.data);
2326
2326
  }
2327
2327
  }
2328
- We.create = (r) => new We(u({
2328
+ Ue.create = (s) => new Ue(d({
2329
2329
  typeName: y.ZodNull
2330
- }, b(r)));
2331
- class Ne extends w {
2330
+ }, w(s)));
2331
+ class Oe extends x {
2332
2332
  constructor() {
2333
2333
  super(...arguments), this._any = !0;
2334
2334
  }
@@ -2336,10 +2336,10 @@ class Ne extends w {
2336
2336
  return $(e.data);
2337
2337
  }
2338
2338
  }
2339
- Ne.create = (r) => new Ne(u({
2339
+ Oe.create = (s) => new Oe(d({
2340
2340
  typeName: y.ZodAny
2341
- }, b(r)));
2342
- class be extends w {
2341
+ }, w(s)));
2342
+ class ve extends x {
2343
2343
  constructor() {
2344
2344
  super(...arguments), this._unknown = !0;
2345
2345
  }
@@ -2347,10 +2347,10 @@ class be extends w {
2347
2347
  return $(e.data);
2348
2348
  }
2349
2349
  }
2350
- be.create = (r) => new be(u({
2350
+ ve.create = (s) => new ve(d({
2351
2351
  typeName: y.ZodUnknown
2352
- }, b(r)));
2353
- class oe extends w {
2352
+ }, w(s)));
2353
+ class ae extends x {
2354
2354
  _parse(e) {
2355
2355
  const t = this._getOrReturnCtx(e);
2356
2356
  return h(t, {
@@ -2360,28 +2360,28 @@ class oe extends w {
2360
2360
  }), _;
2361
2361
  }
2362
2362
  }
2363
- oe.create = (r) => new oe(u({
2363
+ ae.create = (s) => new ae(d({
2364
2364
  typeName: y.ZodNever
2365
- }, b(r)));
2366
- class dt extends w {
2365
+ }, w(s)));
2366
+ class ut extends x {
2367
2367
  _parse(e) {
2368
2368
  if (this._getType(e) !== p.undefined) {
2369
- const s = this._getOrReturnCtx(e);
2370
- return h(s, {
2369
+ const r = this._getOrReturnCtx(e);
2370
+ return h(r, {
2371
2371
  code: l.invalid_type,
2372
2372
  expected: p.void,
2373
- received: s.parsedType
2373
+ received: r.parsedType
2374
2374
  }), _;
2375
2375
  }
2376
2376
  return $(e.data);
2377
2377
  }
2378
2378
  }
2379
- dt.create = (r) => new dt(u({
2379
+ ut.create = (s) => new ut(d({
2380
2380
  typeName: y.ZodVoid
2381
- }, b(r)));
2382
- class J extends w {
2381
+ }, w(s)));
2382
+ class q extends x {
2383
2383
  _parse(e) {
2384
- const { ctx: t, status: s } = this._processInputParams(e), n = this._def;
2384
+ const { ctx: t, status: r } = this._processInputParams(e), n = this._def;
2385
2385
  if (t.parsedType !== p.array)
2386
2386
  return h(t, {
2387
2387
  code: l.invalid_type,
@@ -2398,7 +2398,7 @@ class J extends w {
2398
2398
  inclusive: !0,
2399
2399
  exact: !0,
2400
2400
  message: n.exactLength.message
2401
- }), s.dirty());
2401
+ }), r.dirty());
2402
2402
  }
2403
2403
  if (n.minLength !== null && t.data.length < n.minLength.value && (h(t, {
2404
2404
  code: l.too_small,
@@ -2407,33 +2407,33 @@ class J extends w {
2407
2407
  inclusive: !0,
2408
2408
  exact: !1,
2409
2409
  message: n.minLength.message
2410
- }), s.dirty()), n.maxLength !== null && t.data.length > n.maxLength.value && (h(t, {
2410
+ }), r.dirty()), n.maxLength !== null && t.data.length > n.maxLength.value && (h(t, {
2411
2411
  code: l.too_big,
2412
2412
  maximum: n.maxLength.value,
2413
2413
  type: "array",
2414
2414
  inclusive: !0,
2415
2415
  exact: !1,
2416
2416
  message: n.maxLength.message
2417
- }), s.dirty()), t.common.async)
2418
- return Promise.all([...t.data].map((i, o) => n.type._parseAsync(new ee(t, i, t.path, o)))).then((i) => Z.mergeArray(s, i));
2419
- const a = [...t.data].map((i, o) => n.type._parseSync(new ee(t, i, t.path, o)));
2420
- return Z.mergeArray(s, a);
2417
+ }), r.dirty()), t.common.async)
2418
+ return Promise.all([...t.data].map((i, o) => n.type._parseAsync(new Y(t, i, t.path, o)))).then((i) => Z.mergeArray(r, i));
2419
+ const a = [...t.data].map((i, o) => n.type._parseSync(new Y(t, i, t.path, o)));
2420
+ return Z.mergeArray(r, a);
2421
2421
  }
2422
2422
  get element() {
2423
2423
  return this._def.type;
2424
2424
  }
2425
2425
  min(e, t) {
2426
- return new J(g(u({}, this._def), {
2426
+ return new q(g(d({}, this._def), {
2427
2427
  minLength: { value: e, message: m.toString(t) }
2428
2428
  }));
2429
2429
  }
2430
2430
  max(e, t) {
2431
- return new J(g(u({}, this._def), {
2431
+ return new q(g(d({}, this._def), {
2432
2432
  maxLength: { value: e, message: m.toString(t) }
2433
2433
  }));
2434
2434
  }
2435
2435
  length(e, t) {
2436
- return new J(g(u({}, this._def), {
2436
+ return new q(g(d({}, this._def), {
2437
2437
  exactLength: { value: e, message: m.toString(t) }
2438
2438
  }));
2439
2439
  }
@@ -2441,110 +2441,110 @@ class J extends w {
2441
2441
  return this.min(1, e);
2442
2442
  }
2443
2443
  }
2444
- J.create = (r, e) => new J(u({
2445
- type: r,
2444
+ q.create = (s, e) => new q(d({
2445
+ type: s,
2446
2446
  minLength: null,
2447
2447
  maxLength: null,
2448
2448
  exactLength: null,
2449
2449
  typeName: y.ZodArray
2450
- }, b(e)));
2451
- function Ee(r) {
2452
- if (r instanceof I) {
2450
+ }, w(e)));
2451
+ function Se(s) {
2452
+ if (s instanceof O) {
2453
2453
  const e = {};
2454
- for (const t in r.shape) {
2455
- const s = r.shape[t];
2456
- e[t] = Q.create(Ee(s));
2454
+ for (const t in s.shape) {
2455
+ const r = s.shape[t];
2456
+ e[t] = X.create(Se(r));
2457
2457
  }
2458
- return new I(g(u({}, r._def), {
2458
+ return new O(g(d({}, s._def), {
2459
2459
  shape: () => e
2460
2460
  }));
2461
- } else return r instanceof J ? new J(g(u({}, r._def), {
2462
- type: Ee(r.element)
2463
- })) : r instanceof Q ? Q.create(Ee(r.unwrap())) : r instanceof pe ? pe.create(Ee(r.unwrap())) : r instanceof te ? te.create(r.items.map((e) => Ee(e))) : r;
2461
+ } else return s instanceof q ? new q(g(d({}, s._def), {
2462
+ type: Se(s.element)
2463
+ })) : s instanceof X ? X.create(Se(s.unwrap())) : s instanceof fe ? fe.create(Se(s.unwrap())) : s instanceof Q ? Q.create(s.items.map((e) => Se(e))) : s;
2464
2464
  }
2465
- class I extends w {
2465
+ class O extends x {
2466
2466
  constructor() {
2467
2467
  super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
2468
2468
  }
2469
2469
  _getCached() {
2470
2470
  if (this._cached !== null)
2471
2471
  return this._cached;
2472
- const e = this._def.shape(), t = x.objectKeys(e);
2472
+ const e = this._def.shape(), t = k.objectKeys(e);
2473
2473
  return this._cached = { shape: e, keys: t };
2474
2474
  }
2475
2475
  _parse(e) {
2476
2476
  if (this._getType(e) !== p.object) {
2477
- const d = this._getOrReturnCtx(e);
2478
- return h(d, {
2477
+ const u = this._getOrReturnCtx(e);
2478
+ return h(u, {
2479
2479
  code: l.invalid_type,
2480
2480
  expected: p.object,
2481
- received: d.parsedType
2481
+ received: u.parsedType
2482
2482
  }), _;
2483
2483
  }
2484
- const { status: s, ctx: n } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
2485
- if (!(this._def.catchall instanceof oe && this._def.unknownKeys === "strip"))
2486
- for (const d in n.data)
2487
- i.includes(d) || o.push(d);
2484
+ const { status: r, ctx: n } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
2485
+ if (!(this._def.catchall instanceof ae && this._def.unknownKeys === "strip"))
2486
+ for (const u in n.data)
2487
+ i.includes(u) || o.push(u);
2488
2488
  const c = [];
2489
- for (const d of i) {
2490
- const f = a[d], v = n.data[d];
2489
+ for (const u of i) {
2490
+ const f = a[u], v = n.data[u];
2491
2491
  c.push({
2492
- key: { status: "valid", value: d },
2493
- value: f._parse(new ee(n, v, n.path, d)),
2494
- alwaysSet: d in n.data
2492
+ key: { status: "valid", value: u },
2493
+ value: f._parse(new Y(n, v, n.path, u)),
2494
+ alwaysSet: u in n.data
2495
2495
  });
2496
2496
  }
2497
- if (this._def.catchall instanceof oe) {
2498
- const d = this._def.unknownKeys;
2499
- if (d === "passthrough")
2497
+ if (this._def.catchall instanceof ae) {
2498
+ const u = this._def.unknownKeys;
2499
+ if (u === "passthrough")
2500
2500
  for (const f of o)
2501
2501
  c.push({
2502
2502
  key: { status: "valid", value: f },
2503
2503
  value: { status: "valid", value: n.data[f] }
2504
2504
  });
2505
- else if (d === "strict")
2505
+ else if (u === "strict")
2506
2506
  o.length > 0 && (h(n, {
2507
2507
  code: l.unrecognized_keys,
2508
2508
  keys: o
2509
- }), s.dirty());
2510
- else if (d !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
2509
+ }), r.dirty());
2510
+ else if (u !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
2511
2511
  } else {
2512
- const d = this._def.catchall;
2512
+ const u = this._def.catchall;
2513
2513
  for (const f of o) {
2514
2514
  const v = n.data[f];
2515
2515
  c.push({
2516
2516
  key: { status: "valid", value: f },
2517
- value: d._parse(
2518
- new ee(n, v, n.path, f)
2517
+ value: u._parse(
2518
+ new Y(n, v, n.path, f)
2519
2519
  //, ctx.child(key), value, getParsedType(value)
2520
2520
  ),
2521
2521
  alwaysSet: f in n.data
2522
2522
  });
2523
2523
  }
2524
2524
  }
2525
- return n.common.async ? Promise.resolve().then(() => C(this, null, function* () {
2526
- const d = [];
2525
+ return n.common.async ? Promise.resolve().then(() => I(this, null, function* () {
2526
+ const u = [];
2527
2527
  for (const f of c) {
2528
2528
  const v = yield f.key, j = yield f.value;
2529
- d.push({
2529
+ u.push({
2530
2530
  key: v,
2531
2531
  value: j,
2532
2532
  alwaysSet: f.alwaysSet
2533
2533
  });
2534
2534
  }
2535
- return d;
2536
- })).then((d) => Z.mergeObjectSync(s, d)) : Z.mergeObjectSync(s, c);
2535
+ return u;
2536
+ })).then((u) => Z.mergeObjectSync(r, u)) : Z.mergeObjectSync(r, c);
2537
2537
  }
2538
2538
  get shape() {
2539
2539
  return this._def.shape();
2540
2540
  }
2541
2541
  strict(e) {
2542
- return m.errToObj, new I(u(g(u({}, this._def), {
2542
+ return m.errToObj, new O(d(g(d({}, this._def), {
2543
2543
  unknownKeys: "strict"
2544
2544
  }), e !== void 0 ? {
2545
- errorMap: (t, s) => {
2545
+ errorMap: (t, r) => {
2546
2546
  var n, a, i, o;
2547
- 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;
2547
+ const c = (i = (a = (n = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(n, t, r).message) !== null && i !== void 0 ? i : r.defaultError;
2548
2548
  return t.code === "unrecognized_keys" ? {
2549
2549
  message: (o = m.errToObj(e).message) !== null && o !== void 0 ? o : c
2550
2550
  } : {
@@ -2554,12 +2554,12 @@ class I extends w {
2554
2554
  } : {}));
2555
2555
  }
2556
2556
  strip() {
2557
- return new I(g(u({}, this._def), {
2557
+ return new O(g(d({}, this._def), {
2558
2558
  unknownKeys: "strip"
2559
2559
  }));
2560
2560
  }
2561
2561
  passthrough() {
2562
- return new I(g(u({}, this._def), {
2562
+ return new O(g(d({}, this._def), {
2563
2563
  unknownKeys: "passthrough"
2564
2564
  }));
2565
2565
  }
@@ -2581,8 +2581,8 @@ class I extends w {
2581
2581
  // }) as any;
2582
2582
  // };
2583
2583
  extend(e) {
2584
- return new I(g(u({}, this._def), {
2585
- shape: () => u(u({}, this._def.shape()), e)
2584
+ return new O(g(d({}, this._def), {
2585
+ shape: () => d(d({}, this._def.shape()), e)
2586
2586
  }));
2587
2587
  }
2588
2588
  /**
@@ -2591,10 +2591,10 @@ class I extends w {
2591
2591
  * upgrade if you are experiencing issues.
2592
2592
  */
2593
2593
  merge(e) {
2594
- return new I({
2594
+ return new O({
2595
2595
  unknownKeys: e._def.unknownKeys,
2596
2596
  catchall: e._def.catchall,
2597
- shape: () => u(u({}, this._def.shape()), e._def.shape()),
2597
+ shape: () => d(d({}, this._def.shape()), e._def.shape()),
2598
2598
  typeName: y.ZodObject
2599
2599
  });
2600
2600
  }
@@ -2658,23 +2658,23 @@ class I extends w {
2658
2658
  // return merged;
2659
2659
  // }
2660
2660
  catchall(e) {
2661
- return new I(g(u({}, this._def), {
2661
+ return new O(g(d({}, this._def), {
2662
2662
  catchall: e
2663
2663
  }));
2664
2664
  }
2665
2665
  pick(e) {
2666
2666
  const t = {};
2667
- return x.objectKeys(e).forEach((s) => {
2668
- e[s] && this.shape[s] && (t[s] = this.shape[s]);
2669
- }), new I(g(u({}, this._def), {
2667
+ return k.objectKeys(e).forEach((r) => {
2668
+ e[r] && this.shape[r] && (t[r] = this.shape[r]);
2669
+ }), new O(g(d({}, this._def), {
2670
2670
  shape: () => t
2671
2671
  }));
2672
2672
  }
2673
2673
  omit(e) {
2674
2674
  const t = {};
2675
- return x.objectKeys(this.shape).forEach((s) => {
2676
- e[s] || (t[s] = this.shape[s]);
2677
- }), new I(g(u({}, this._def), {
2675
+ return k.objectKeys(this.shape).forEach((r) => {
2676
+ e[r] || (t[r] = this.shape[r]);
2677
+ }), new O(g(d({}, this._def), {
2678
2678
  shape: () => t
2679
2679
  }));
2680
2680
  }
@@ -2682,57 +2682,57 @@ class I extends w {
2682
2682
  * @deprecated
2683
2683
  */
2684
2684
  deepPartial() {
2685
- return Ee(this);
2685
+ return Se(this);
2686
2686
  }
2687
2687
  partial(e) {
2688
2688
  const t = {};
2689
- return x.objectKeys(this.shape).forEach((s) => {
2690
- const n = this.shape[s];
2691
- e && !e[s] ? t[s] = n : t[s] = n.optional();
2692
- }), new I(g(u({}, this._def), {
2689
+ return k.objectKeys(this.shape).forEach((r) => {
2690
+ const n = this.shape[r];
2691
+ e && !e[r] ? t[r] = n : t[r] = n.optional();
2692
+ }), new O(g(d({}, this._def), {
2693
2693
  shape: () => t
2694
2694
  }));
2695
2695
  }
2696
2696
  required(e) {
2697
2697
  const t = {};
2698
- return x.objectKeys(this.shape).forEach((s) => {
2699
- if (e && !e[s])
2700
- t[s] = this.shape[s];
2698
+ return k.objectKeys(this.shape).forEach((r) => {
2699
+ if (e && !e[r])
2700
+ t[r] = this.shape[r];
2701
2701
  else {
2702
- let a = this.shape[s];
2703
- for (; a instanceof Q; )
2702
+ let a = this.shape[r];
2703
+ for (; a instanceof X; )
2704
2704
  a = a._def.innerType;
2705
- t[s] = a;
2705
+ t[r] = a;
2706
2706
  }
2707
- }), new I(g(u({}, this._def), {
2707
+ }), new O(g(d({}, this._def), {
2708
2708
  shape: () => t
2709
2709
  }));
2710
2710
  }
2711
2711
  keyof() {
2712
- return gr(x.objectKeys(this.shape));
2712
+ return gs(k.objectKeys(this.shape));
2713
2713
  }
2714
2714
  }
2715
- I.create = (r, e) => new I(u({
2716
- shape: () => r,
2715
+ O.create = (s, e) => new O(d({
2716
+ shape: () => s,
2717
2717
  unknownKeys: "strip",
2718
- catchall: oe.create(),
2718
+ catchall: ae.create(),
2719
2719
  typeName: y.ZodObject
2720
- }, b(e)));
2721
- I.strictCreate = (r, e) => new I(u({
2722
- shape: () => r,
2720
+ }, w(e)));
2721
+ O.strictCreate = (s, e) => new O(d({
2722
+ shape: () => s,
2723
2723
  unknownKeys: "strict",
2724
- catchall: oe.create(),
2724
+ catchall: ae.create(),
2725
2725
  typeName: y.ZodObject
2726
- }, b(e)));
2727
- I.lazycreate = (r, e) => new I(u({
2728
- shape: r,
2726
+ }, w(e)));
2727
+ O.lazycreate = (s, e) => new O(d({
2728
+ shape: s,
2729
2729
  unknownKeys: "strip",
2730
- catchall: oe.create(),
2730
+ catchall: ae.create(),
2731
2731
  typeName: y.ZodObject
2732
- }, b(e)));
2733
- class ze extends w {
2732
+ }, w(e)));
2733
+ class We extends x {
2734
2734
  _parse(e) {
2735
- const { ctx: t } = this._processInputParams(e), s = this._def.options;
2735
+ const { ctx: t } = this._processInputParams(e), r = this._def.options;
2736
2736
  function n(a) {
2737
2737
  for (const o of a)
2738
2738
  if (o.result.status === "valid")
@@ -2740,16 +2740,16 @@ class ze extends w {
2740
2740
  for (const o of a)
2741
2741
  if (o.result.status === "dirty")
2742
2742
  return t.common.issues.push(...o.ctx.common.issues), o.result;
2743
- const i = a.map((o) => new W(o.ctx.common.issues));
2743
+ const i = a.map((o) => new U(o.ctx.common.issues));
2744
2744
  return h(t, {
2745
2745
  code: l.invalid_union,
2746
2746
  unionErrors: i
2747
2747
  }), _;
2748
2748
  }
2749
2749
  if (t.common.async)
2750
- return Promise.all(s.map((a) => C(this, null, function* () {
2751
- const i = g(u({}, t), {
2752
- common: g(u({}, t.common), {
2750
+ return Promise.all(r.map((a) => I(this, null, function* () {
2751
+ const i = g(d({}, t), {
2752
+ common: g(d({}, t.common), {
2753
2753
  issues: []
2754
2754
  }),
2755
2755
  parent: null
@@ -2766,24 +2766,24 @@ class ze extends w {
2766
2766
  {
2767
2767
  let a;
2768
2768
  const i = [];
2769
- for (const c of s) {
2770
- const d = g(u({}, t), {
2771
- common: g(u({}, t.common), {
2769
+ for (const c of r) {
2770
+ const u = g(d({}, t), {
2771
+ common: g(d({}, t.common), {
2772
2772
  issues: []
2773
2773
  }),
2774
2774
  parent: null
2775
2775
  }), f = c._parseSync({
2776
2776
  data: t.data,
2777
2777
  path: t.path,
2778
- parent: d
2778
+ parent: u
2779
2779
  });
2780
2780
  if (f.status === "valid")
2781
2781
  return f;
2782
- f.status === "dirty" && !a && (a = { result: f, ctx: d }), d.common.issues.length && i.push(d.common.issues);
2782
+ f.status === "dirty" && !a && (a = { result: f, ctx: u }), u.common.issues.length && i.push(u.common.issues);
2783
2783
  }
2784
2784
  if (a)
2785
2785
  return t.common.issues.push(...a.ctx.common.issues), a.result;
2786
- const o = i.map((c) => new W(c));
2786
+ const o = i.map((c) => new U(c));
2787
2787
  return h(t, {
2788
2788
  code: l.invalid_union,
2789
2789
  unionErrors: o
@@ -2794,12 +2794,12 @@ class ze extends w {
2794
2794
  return this._def.options;
2795
2795
  }
2796
2796
  }
2797
- ze.create = (r, e) => new ze(u({
2798
- options: r,
2797
+ We.create = (s, e) => new We(d({
2798
+ options: s,
2799
2799
  typeName: y.ZodUnion
2800
- }, b(e)));
2801
- const ne = (r) => r instanceof He ? ne(r.schema) : r instanceof G ? ne(r.innerType()) : r instanceof Je ? [r.value] : r instanceof he ? r.options : r instanceof Ge ? x.objectValues(r.enum) : r instanceof Ke ? ne(r._def.innerType) : r instanceof Ue ? [void 0] : r instanceof We ? [null] : r instanceof Q ? [void 0, ...ne(r.unwrap())] : r instanceof pe ? [null, ...ne(r.unwrap())] : r instanceof $t || r instanceof Ye ? ne(r.unwrap()) : r instanceof Xe ? ne(r._def.innerType) : [];
2802
- class ft extends w {
2800
+ }, w(e)));
2801
+ const se = (s) => s instanceof qe ? se(s.schema) : s instanceof H ? se(s.innerType()) : s instanceof He ? [s.value] : s instanceof le ? s.options : s instanceof Je ? k.objectValues(s.enum) : s instanceof Ge ? se(s._def.innerType) : s instanceof Ve ? [void 0] : s instanceof Ue ? [null] : s instanceof X ? [void 0, ...se(s.unwrap())] : s instanceof fe ? [null, ...se(s.unwrap())] : s instanceof $t || s instanceof Xe ? se(s.unwrap()) : s instanceof Ke ? se(s._def.innerType) : [];
2802
+ class ft extends x {
2803
2803
  _parse(e) {
2804
2804
  const { ctx: t } = this._processInputParams(e);
2805
2805
  if (t.parsedType !== p.object)
@@ -2808,7 +2808,7 @@ class ft extends w {
2808
2808
  expected: p.object,
2809
2809
  received: t.parsedType
2810
2810
  }), _;
2811
- const s = this.discriminator, n = t.data[s], a = this.optionsMap.get(n);
2811
+ const r = this.discriminator, n = t.data[r], a = this.optionsMap.get(n);
2812
2812
  return a ? t.common.async ? a._parseAsync({
2813
2813
  data: t.data,
2814
2814
  path: t.path,
@@ -2820,7 +2820,7 @@ class ft extends w {
2820
2820
  }) : (h(t, {
2821
2821
  code: l.invalid_union_discriminator,
2822
2822
  options: Array.from(this.optionsMap.keys()),
2823
- path: [s]
2823
+ path: [r]
2824
2824
  }), _);
2825
2825
  }
2826
2826
  get discriminator() {
@@ -2840,10 +2840,10 @@ class ft extends w {
2840
2840
  * @param types an array of object schemas
2841
2841
  * @param params
2842
2842
  */
2843
- static create(e, t, s) {
2843
+ static create(e, t, r) {
2844
2844
  const n = /* @__PURE__ */ new Map();
2845
2845
  for (const a of t) {
2846
- const i = ne(a.shape[e]);
2846
+ const i = se(a.shape[e]);
2847
2847
  if (!i.length)
2848
2848
  throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
2849
2849
  for (const o of i) {
@@ -2852,126 +2852,126 @@ class ft extends w {
2852
2852
  n.set(o, a);
2853
2853
  }
2854
2854
  }
2855
- return new ft(u({
2855
+ return new ft(d({
2856
2856
  typeName: y.ZodDiscriminatedUnion,
2857
2857
  discriminator: e,
2858
2858
  options: t,
2859
2859
  optionsMap: n
2860
- }, b(s)));
2860
+ }, w(r)));
2861
2861
  }
2862
2862
  }
2863
- function Rt(r, e) {
2864
- const t = ae(r), s = ae(e);
2865
- if (r === e)
2866
- return { valid: !0, data: r };
2867
- if (t === p.object && s === p.object) {
2868
- const n = x.objectKeys(e), a = x.objectKeys(r).filter((o) => n.indexOf(o) !== -1), i = u(u({}, r), e);
2863
+ function Rt(s, e) {
2864
+ const t = re(s), r = re(e);
2865
+ if (s === e)
2866
+ return { valid: !0, data: s };
2867
+ if (t === p.object && r === p.object) {
2868
+ const n = k.objectKeys(e), a = k.objectKeys(s).filter((o) => n.indexOf(o) !== -1), i = d(d({}, s), e);
2869
2869
  for (const o of a) {
2870
- const c = Rt(r[o], e[o]);
2870
+ const c = Rt(s[o], e[o]);
2871
2871
  if (!c.valid)
2872
2872
  return { valid: !1 };
2873
2873
  i[o] = c.data;
2874
2874
  }
2875
2875
  return { valid: !0, data: i };
2876
- } else if (t === p.array && s === p.array) {
2877
- if (r.length !== e.length)
2876
+ } else if (t === p.array && r === p.array) {
2877
+ if (s.length !== e.length)
2878
2878
  return { valid: !1 };
2879
2879
  const n = [];
2880
- for (let a = 0; a < r.length; a++) {
2881
- const i = r[a], o = e[a], c = Rt(i, o);
2880
+ for (let a = 0; a < s.length; a++) {
2881
+ const i = s[a], o = e[a], c = Rt(i, o);
2882
2882
  if (!c.valid)
2883
2883
  return { valid: !1 };
2884
2884
  n.push(c.data);
2885
2885
  }
2886
2886
  return { valid: !0, data: n };
2887
- } else return t === p.date && s === p.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
2887
+ } else return t === p.date && r === p.date && +s == +e ? { valid: !0, data: s } : { valid: !1 };
2888
2888
  }
2889
- class Be extends w {
2889
+ class ze extends x {
2890
2890
  _parse(e) {
2891
- const { status: t, ctx: s } = this._processInputParams(e), n = (a, i) => {
2891
+ const { status: t, ctx: r } = this._processInputParams(e), n = (a, i) => {
2892
2892
  if (Nt(a) || Nt(i))
2893
2893
  return _;
2894
2894
  const o = Rt(a.value, i.value);
2895
- return o.valid ? ((jt(a) || jt(i)) && t.dirty(), { status: t.value, value: o.data }) : (h(s, {
2895
+ return o.valid ? ((jt(a) || jt(i)) && t.dirty(), { status: t.value, value: o.data }) : (h(r, {
2896
2896
  code: l.invalid_intersection_types
2897
2897
  }), _);
2898
2898
  };
2899
- return s.common.async ? Promise.all([
2899
+ return r.common.async ? Promise.all([
2900
2900
  this._def.left._parseAsync({
2901
- data: s.data,
2902
- path: s.path,
2903
- parent: s
2901
+ data: r.data,
2902
+ path: r.path,
2903
+ parent: r
2904
2904
  }),
2905
2905
  this._def.right._parseAsync({
2906
- data: s.data,
2907
- path: s.path,
2908
- parent: s
2906
+ data: r.data,
2907
+ path: r.path,
2908
+ parent: r
2909
2909
  })
2910
2910
  ]).then(([a, i]) => n(a, i)) : n(this._def.left._parseSync({
2911
- data: s.data,
2912
- path: s.path,
2913
- parent: s
2911
+ data: r.data,
2912
+ path: r.path,
2913
+ parent: r
2914
2914
  }), this._def.right._parseSync({
2915
- data: s.data,
2916
- path: s.path,
2917
- parent: s
2915
+ data: r.data,
2916
+ path: r.path,
2917
+ parent: r
2918
2918
  }));
2919
2919
  }
2920
2920
  }
2921
- Be.create = (r, e, t) => new Be(u({
2922
- left: r,
2921
+ ze.create = (s, e, t) => new ze(d({
2922
+ left: s,
2923
2923
  right: e,
2924
2924
  typeName: y.ZodIntersection
2925
- }, b(t)));
2926
- class te extends w {
2925
+ }, w(t)));
2926
+ class Q extends x {
2927
2927
  _parse(e) {
2928
- const { status: t, ctx: s } = this._processInputParams(e);
2929
- if (s.parsedType !== p.array)
2930
- return h(s, {
2928
+ const { status: t, ctx: r } = this._processInputParams(e);
2929
+ if (r.parsedType !== p.array)
2930
+ return h(r, {
2931
2931
  code: l.invalid_type,
2932
2932
  expected: p.array,
2933
- received: s.parsedType
2933
+ received: r.parsedType
2934
2934
  }), _;
2935
- if (s.data.length < this._def.items.length)
2936
- return h(s, {
2935
+ if (r.data.length < this._def.items.length)
2936
+ return h(r, {
2937
2937
  code: l.too_small,
2938
2938
  minimum: this._def.items.length,
2939
2939
  inclusive: !0,
2940
2940
  exact: !1,
2941
2941
  type: "array"
2942
2942
  }), _;
2943
- !this._def.rest && s.data.length > this._def.items.length && (h(s, {
2943
+ !this._def.rest && r.data.length > this._def.items.length && (h(r, {
2944
2944
  code: l.too_big,
2945
2945
  maximum: this._def.items.length,
2946
2946
  inclusive: !0,
2947
2947
  exact: !1,
2948
2948
  type: "array"
2949
2949
  }), t.dirty());
2950
- const a = [...s.data].map((i, o) => {
2950
+ const a = [...r.data].map((i, o) => {
2951
2951
  const c = this._def.items[o] || this._def.rest;
2952
- return c ? c._parse(new ee(s, i, s.path, o)) : null;
2952
+ return c ? c._parse(new Y(r, i, r.path, o)) : null;
2953
2953
  }).filter((i) => !!i);
2954
- return s.common.async ? Promise.all(a).then((i) => Z.mergeArray(t, i)) : Z.mergeArray(t, a);
2954
+ return r.common.async ? Promise.all(a).then((i) => Z.mergeArray(t, i)) : Z.mergeArray(t, a);
2955
2955
  }
2956
2956
  get items() {
2957
2957
  return this._def.items;
2958
2958
  }
2959
2959
  rest(e) {
2960
- return new te(g(u({}, this._def), {
2960
+ return new Q(g(d({}, this._def), {
2961
2961
  rest: e
2962
2962
  }));
2963
2963
  }
2964
2964
  }
2965
- te.create = (r, e) => {
2966
- if (!Array.isArray(r))
2965
+ Q.create = (s, e) => {
2966
+ if (!Array.isArray(s))
2967
2967
  throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2968
- return new te(u({
2969
- items: r,
2968
+ return new Q(d({
2969
+ items: s,
2970
2970
  typeName: y.ZodTuple,
2971
2971
  rest: null
2972
- }, b(e)));
2972
+ }, w(e)));
2973
2973
  };
2974
- class qe extends w {
2974
+ class Be extends x {
2975
2975
  get keySchema() {
2976
2976
  return this._def.keyType;
2977
2977
  }
@@ -2979,38 +2979,38 @@ class qe extends w {
2979
2979
  return this._def.valueType;
2980
2980
  }
2981
2981
  _parse(e) {
2982
- const { status: t, ctx: s } = this._processInputParams(e);
2983
- if (s.parsedType !== p.object)
2984
- return h(s, {
2982
+ const { status: t, ctx: r } = this._processInputParams(e);
2983
+ if (r.parsedType !== p.object)
2984
+ return h(r, {
2985
2985
  code: l.invalid_type,
2986
2986
  expected: p.object,
2987
- received: s.parsedType
2987
+ received: r.parsedType
2988
2988
  }), _;
2989
2989
  const n = [], a = this._def.keyType, i = this._def.valueType;
2990
- for (const o in s.data)
2990
+ for (const o in r.data)
2991
2991
  n.push({
2992
- key: a._parse(new ee(s, o, s.path, o)),
2993
- value: i._parse(new ee(s, s.data[o], s.path, o)),
2994
- alwaysSet: o in s.data
2992
+ key: a._parse(new Y(r, o, r.path, o)),
2993
+ value: i._parse(new Y(r, r.data[o], r.path, o)),
2994
+ alwaysSet: o in r.data
2995
2995
  });
2996
- return s.common.async ? Z.mergeObjectAsync(t, n) : Z.mergeObjectSync(t, n);
2996
+ return r.common.async ? Z.mergeObjectAsync(t, n) : Z.mergeObjectSync(t, n);
2997
2997
  }
2998
2998
  get element() {
2999
2999
  return this._def.valueType;
3000
3000
  }
3001
- static create(e, t, s) {
3002
- return t instanceof w ? new qe(u({
3001
+ static create(e, t, r) {
3002
+ return t instanceof x ? new Be(d({
3003
3003
  keyType: e,
3004
3004
  valueType: t,
3005
3005
  typeName: y.ZodRecord
3006
- }, b(s))) : new qe(u({
3007
- keyType: H.create(),
3006
+ }, w(r))) : new Be(d({
3007
+ keyType: B.create(),
3008
3008
  valueType: e,
3009
3009
  typeName: y.ZodRecord
3010
- }, b(t)));
3010
+ }, w(t)));
3011
3011
  }
3012
3012
  }
3013
- class ut extends w {
3013
+ class dt extends x {
3014
3014
  get keySchema() {
3015
3015
  return this._def.keyType;
3016
3016
  }
@@ -3018,63 +3018,63 @@ class ut extends w {
3018
3018
  return this._def.valueType;
3019
3019
  }
3020
3020
  _parse(e) {
3021
- const { status: t, ctx: s } = this._processInputParams(e);
3022
- if (s.parsedType !== p.map)
3023
- return h(s, {
3021
+ const { status: t, ctx: r } = this._processInputParams(e);
3022
+ if (r.parsedType !== p.map)
3023
+ return h(r, {
3024
3024
  code: l.invalid_type,
3025
3025
  expected: p.map,
3026
- received: s.parsedType
3026
+ received: r.parsedType
3027
3027
  }), _;
3028
- const n = this._def.keyType, a = this._def.valueType, i = [...s.data.entries()].map(([o, c], d) => ({
3029
- key: n._parse(new ee(s, o, s.path, [d, "key"])),
3030
- value: a._parse(new ee(s, c, s.path, [d, "value"]))
3028
+ const n = this._def.keyType, a = this._def.valueType, i = [...r.data.entries()].map(([o, c], u) => ({
3029
+ key: n._parse(new Y(r, o, r.path, [u, "key"])),
3030
+ value: a._parse(new Y(r, c, r.path, [u, "value"]))
3031
3031
  }));
3032
- if (s.common.async) {
3032
+ if (r.common.async) {
3033
3033
  const o = /* @__PURE__ */ new Map();
3034
- return Promise.resolve().then(() => C(this, null, function* () {
3034
+ return Promise.resolve().then(() => I(this, null, function* () {
3035
3035
  for (const c of i) {
3036
- const d = yield c.key, f = yield c.value;
3037
- if (d.status === "aborted" || f.status === "aborted")
3036
+ const u = yield c.key, f = yield c.value;
3037
+ if (u.status === "aborted" || f.status === "aborted")
3038
3038
  return _;
3039
- (d.status === "dirty" || f.status === "dirty") && t.dirty(), o.set(d.value, f.value);
3039
+ (u.status === "dirty" || f.status === "dirty") && t.dirty(), o.set(u.value, f.value);
3040
3040
  }
3041
3041
  return { status: t.value, value: o };
3042
3042
  }));
3043
3043
  } else {
3044
3044
  const o = /* @__PURE__ */ new Map();
3045
3045
  for (const c of i) {
3046
- const d = c.key, f = c.value;
3047
- if (d.status === "aborted" || f.status === "aborted")
3046
+ const u = c.key, f = c.value;
3047
+ if (u.status === "aborted" || f.status === "aborted")
3048
3048
  return _;
3049
- (d.status === "dirty" || f.status === "dirty") && t.dirty(), o.set(d.value, f.value);
3049
+ (u.status === "dirty" || f.status === "dirty") && t.dirty(), o.set(u.value, f.value);
3050
3050
  }
3051
3051
  return { status: t.value, value: o };
3052
3052
  }
3053
3053
  }
3054
3054
  }
3055
- ut.create = (r, e, t) => new ut(u({
3055
+ dt.create = (s, e, t) => new dt(d({
3056
3056
  valueType: e,
3057
- keyType: r,
3057
+ keyType: s,
3058
3058
  typeName: y.ZodMap
3059
- }, b(t)));
3060
- class ke extends w {
3059
+ }, w(t)));
3060
+ class we extends x {
3061
3061
  _parse(e) {
3062
- const { status: t, ctx: s } = this._processInputParams(e);
3063
- if (s.parsedType !== p.set)
3064
- return h(s, {
3062
+ const { status: t, ctx: r } = this._processInputParams(e);
3063
+ if (r.parsedType !== p.set)
3064
+ return h(r, {
3065
3065
  code: l.invalid_type,
3066
3066
  expected: p.set,
3067
- received: s.parsedType
3067
+ received: r.parsedType
3068
3068
  }), _;
3069
3069
  const n = this._def;
3070
- n.minSize !== null && s.data.size < n.minSize.value && (h(s, {
3070
+ n.minSize !== null && r.data.size < n.minSize.value && (h(r, {
3071
3071
  code: l.too_small,
3072
3072
  minimum: n.minSize.value,
3073
3073
  type: "set",
3074
3074
  inclusive: !0,
3075
3075
  exact: !1,
3076
3076
  message: n.minSize.message
3077
- }), t.dirty()), n.maxSize !== null && s.data.size > n.maxSize.value && (h(s, {
3077
+ }), t.dirty()), n.maxSize !== null && r.data.size > n.maxSize.value && (h(r, {
3078
3078
  code: l.too_big,
3079
3079
  maximum: n.maxSize.value,
3080
3080
  type: "set",
@@ -3084,24 +3084,24 @@ class ke extends w {
3084
3084
  }), t.dirty());
3085
3085
  const a = this._def.valueType;
3086
3086
  function i(c) {
3087
- const d = /* @__PURE__ */ new Set();
3087
+ const u = /* @__PURE__ */ new Set();
3088
3088
  for (const f of c) {
3089
3089
  if (f.status === "aborted")
3090
3090
  return _;
3091
- f.status === "dirty" && t.dirty(), d.add(f.value);
3091
+ f.status === "dirty" && t.dirty(), u.add(f.value);
3092
3092
  }
3093
- return { status: t.value, value: d };
3093
+ return { status: t.value, value: u };
3094
3094
  }
3095
- const o = [...s.data.values()].map((c, d) => a._parse(new ee(s, c, s.path, d)));
3096
- return s.common.async ? Promise.all(o).then((c) => i(c)) : i(o);
3095
+ const o = [...r.data.values()].map((c, u) => a._parse(new Y(r, c, r.path, u)));
3096
+ return r.common.async ? Promise.all(o).then((c) => i(c)) : i(o);
3097
3097
  }
3098
3098
  min(e, t) {
3099
- return new ke(g(u({}, this._def), {
3099
+ return new we(g(d({}, this._def), {
3100
3100
  minSize: { value: e, message: m.toString(t) }
3101
3101
  }));
3102
3102
  }
3103
3103
  max(e, t) {
3104
- return new ke(g(u({}, this._def), {
3104
+ return new we(g(d({}, this._def), {
3105
3105
  maxSize: { value: e, message: m.toString(t) }
3106
3106
  }));
3107
3107
  }
@@ -3112,13 +3112,13 @@ class ke extends w {
3112
3112
  return this.min(1, e);
3113
3113
  }
3114
3114
  }
3115
- ke.create = (r, e) => new ke(u({
3116
- valueType: r,
3115
+ we.create = (s, e) => new we(d({
3116
+ valueType: s,
3117
3117
  minSize: null,
3118
3118
  maxSize: null,
3119
3119
  typeName: y.ZodSet
3120
- }, b(e)));
3121
- class Ce extends w {
3120
+ }, w(e)));
3121
+ class Ae extends x {
3122
3122
  constructor() {
3123
3123
  super(...arguments), this.validate = this.implement;
3124
3124
  }
@@ -3130,7 +3130,7 @@ class Ce extends w {
3130
3130
  expected: p.function,
3131
3131
  received: t.parsedType
3132
3132
  }), _;
3133
- function s(o, c) {
3133
+ function r(o, c) {
3134
3134
  return it({
3135
3135
  data: o,
3136
3136
  path: t.path,
@@ -3138,8 +3138,8 @@ class Ce extends w {
3138
3138
  t.common.contextualErrorMap,
3139
3139
  t.schemaErrorMap,
3140
3140
  at(),
3141
- Oe
3142
- ].filter((d) => !!d),
3141
+ Ie
3142
+ ].filter((u) => !!u),
3143
3143
  issueData: {
3144
3144
  code: l.invalid_arguments,
3145
3145
  argumentsError: c
@@ -3154,8 +3154,8 @@ class Ce extends w {
3154
3154
  t.common.contextualErrorMap,
3155
3155
  t.schemaErrorMap,
3156
3156
  at(),
3157
- Oe
3158
- ].filter((d) => !!d),
3157
+ Ie
3158
+ ].filter((u) => !!u),
3159
3159
  issueData: {
3160
3160
  code: l.invalid_return_type,
3161
3161
  returnTypeError: c
@@ -3163,27 +3163,27 @@ class Ce extends w {
3163
3163
  });
3164
3164
  }
3165
3165
  const a = { errorMap: t.common.contextualErrorMap }, i = t.data;
3166
- if (this._def.returns instanceof je) {
3166
+ if (this._def.returns instanceof Ne) {
3167
3167
  const o = this;
3168
3168
  return $(function(...c) {
3169
- return C(this, null, function* () {
3170
- const d = new W([]), f = yield o._def.args.parseAsync(c, a).catch((M) => {
3171
- throw d.addIssue(s(c, M)), d;
3169
+ return I(this, null, function* () {
3170
+ const u = new U([]), f = yield o._def.args.parseAsync(c, a).catch((M) => {
3171
+ throw u.addIssue(r(c, M)), u;
3172
3172
  }), v = yield Reflect.apply(i, this, f);
3173
3173
  return yield o._def.returns._def.type.parseAsync(v, a).catch((M) => {
3174
- throw d.addIssue(n(v, M)), d;
3174
+ throw u.addIssue(n(v, M)), u;
3175
3175
  });
3176
3176
  });
3177
3177
  });
3178
3178
  } else {
3179
3179
  const o = this;
3180
3180
  return $(function(...c) {
3181
- const d = o._def.args.safeParse(c, a);
3182
- if (!d.success)
3183
- throw new W([s(c, d.error)]);
3184
- const f = Reflect.apply(i, this, d.data), v = o._def.returns.safeParse(f, a);
3181
+ const u = o._def.args.safeParse(c, a);
3182
+ if (!u.success)
3183
+ throw new U([r(c, u.error)]);
3184
+ const f = Reflect.apply(i, this, u.data), v = o._def.returns.safeParse(f, a);
3185
3185
  if (!v.success)
3186
- throw new W([n(f, v.error)]);
3186
+ throw new U([n(f, v.error)]);
3187
3187
  return v.data;
3188
3188
  });
3189
3189
  }
@@ -3195,12 +3195,12 @@ class Ce extends w {
3195
3195
  return this._def.returns;
3196
3196
  }
3197
3197
  args(...e) {
3198
- return new Ce(g(u({}, this._def), {
3199
- args: te.create(e).rest(be.create())
3198
+ return new Ae(g(d({}, this._def), {
3199
+ args: Q.create(e).rest(ve.create())
3200
3200
  }));
3201
3201
  }
3202
3202
  returns(e) {
3203
- return new Ce(g(u({}, this._def), {
3203
+ return new Ae(g(d({}, this._def), {
3204
3204
  returns: e
3205
3205
  }));
3206
3206
  }
@@ -3210,15 +3210,15 @@ class Ce extends w {
3210
3210
  strictImplement(e) {
3211
3211
  return this.parse(e);
3212
3212
  }
3213
- static create(e, t, s) {
3214
- return new Ce(u({
3215
- args: e || te.create([]).rest(be.create()),
3216
- returns: t || be.create(),
3213
+ static create(e, t, r) {
3214
+ return new Ae(d({
3215
+ args: e || Q.create([]).rest(ve.create()),
3216
+ returns: t || ve.create(),
3217
3217
  typeName: y.ZodFunction
3218
- }, b(s)));
3218
+ }, w(r)));
3219
3219
  }
3220
3220
  }
3221
- class He extends w {
3221
+ class qe extends x {
3222
3222
  get schema() {
3223
3223
  return this._def.getter();
3224
3224
  }
@@ -3227,11 +3227,11 @@ class He extends w {
3227
3227
  return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
3228
3228
  }
3229
3229
  }
3230
- He.create = (r, e) => new He(u({
3231
- getter: r,
3230
+ qe.create = (s, e) => new qe(d({
3231
+ getter: s,
3232
3232
  typeName: y.ZodLazy
3233
- }, b(e)));
3234
- class Je extends w {
3233
+ }, w(e)));
3234
+ class He extends x {
3235
3235
  _parse(e) {
3236
3236
  if (e.data !== this._def.value) {
3237
3237
  const t = this._getOrReturnCtx(e);
@@ -3247,35 +3247,35 @@ class Je extends w {
3247
3247
  return this._def.value;
3248
3248
  }
3249
3249
  }
3250
- Je.create = (r, e) => new Je(u({
3251
- value: r,
3250
+ He.create = (s, e) => new He(d({
3251
+ value: s,
3252
3252
  typeName: y.ZodLiteral
3253
- }, b(e)));
3254
- function gr(r, e) {
3255
- return new he(u({
3256
- values: r,
3253
+ }, w(e)));
3254
+ function gs(s, e) {
3255
+ return new le(d({
3256
+ values: s,
3257
3257
  typeName: y.ZodEnum
3258
- }, b(e)));
3258
+ }, w(e)));
3259
3259
  }
3260
- class he extends w {
3260
+ class le extends x {
3261
3261
  constructor() {
3262
- super(...arguments), $e.set(this, void 0);
3262
+ super(...arguments), Pe.set(this, void 0);
3263
3263
  }
3264
3264
  _parse(e) {
3265
3265
  if (typeof e.data != "string") {
3266
- const t = this._getOrReturnCtx(e), s = this._def.values;
3266
+ const t = this._getOrReturnCtx(e), r = this._def.values;
3267
3267
  return h(t, {
3268
- expected: x.joinValues(s),
3268
+ expected: k.joinValues(r),
3269
3269
  received: t.parsedType,
3270
3270
  code: l.invalid_type
3271
3271
  }), _;
3272
3272
  }
3273
- if (ot(this, $e) || fr(this, $e, new Set(this._def.values)), !ot(this, $e).has(e.data)) {
3274
- const t = this._getOrReturnCtx(e), s = this._def.values;
3273
+ if (ot(this, Pe) || fs(this, Pe, new Set(this._def.values)), !ot(this, Pe).has(e.data)) {
3274
+ const t = this._getOrReturnCtx(e), r = this._def.values;
3275
3275
  return h(t, {
3276
3276
  received: t.data,
3277
3277
  code: l.invalid_enum_value,
3278
- options: s
3278
+ options: r
3279
3279
  }), _;
3280
3280
  }
3281
3281
  return $(e.data);
@@ -3302,32 +3302,32 @@ class he extends w {
3302
3302
  return e;
3303
3303
  }
3304
3304
  extract(e, t = this._def) {
3305
- return he.create(e, u(u({}, this._def), t));
3305
+ return le.create(e, d(d({}, this._def), t));
3306
3306
  }
3307
3307
  exclude(e, t = this._def) {
3308
- return he.create(this.options.filter((s) => !e.includes(s)), u(u({}, this._def), t));
3308
+ return le.create(this.options.filter((r) => !e.includes(r)), d(d({}, this._def), t));
3309
3309
  }
3310
3310
  }
3311
- $e = /* @__PURE__ */ new WeakMap();
3312
- he.create = gr;
3313
- class Ge extends w {
3311
+ Pe = /* @__PURE__ */ new WeakMap();
3312
+ le.create = gs;
3313
+ class Je extends x {
3314
3314
  constructor() {
3315
- super(...arguments), Fe.set(this, void 0);
3315
+ super(...arguments), $e.set(this, void 0);
3316
3316
  }
3317
3317
  _parse(e) {
3318
- const t = x.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
3319
- if (s.parsedType !== p.string && s.parsedType !== p.number) {
3320
- const n = x.objectValues(t);
3321
- return h(s, {
3322
- expected: x.joinValues(n),
3323
- received: s.parsedType,
3318
+ const t = k.getValidEnumValues(this._def.values), r = this._getOrReturnCtx(e);
3319
+ if (r.parsedType !== p.string && r.parsedType !== p.number) {
3320
+ const n = k.objectValues(t);
3321
+ return h(r, {
3322
+ expected: k.joinValues(n),
3323
+ received: r.parsedType,
3324
3324
  code: l.invalid_type
3325
3325
  }), _;
3326
3326
  }
3327
- if (ot(this, Fe) || fr(this, Fe, new Set(x.getValidEnumValues(this._def.values))), !ot(this, Fe).has(e.data)) {
3328
- const n = x.objectValues(t);
3329
- return h(s, {
3330
- received: s.data,
3327
+ if (ot(this, $e) || fs(this, $e, new Set(k.getValidEnumValues(this._def.values))), !ot(this, $e).has(e.data)) {
3328
+ const n = k.objectValues(t);
3329
+ return h(r, {
3330
+ received: r.data,
3331
3331
  code: l.invalid_enum_value,
3332
3332
  options: n
3333
3333
  }), _;
@@ -3338,12 +3338,12 @@ class Ge extends w {
3338
3338
  return this._def.values;
3339
3339
  }
3340
3340
  }
3341
- Fe = /* @__PURE__ */ new WeakMap();
3342
- Ge.create = (r, e) => new Ge(u({
3343
- values: r,
3341
+ $e = /* @__PURE__ */ new WeakMap();
3342
+ Je.create = (s, e) => new Je(d({
3343
+ values: s,
3344
3344
  typeName: y.ZodNativeEnum
3345
- }, b(e)));
3346
- class je extends w {
3345
+ }, w(e)));
3346
+ class Ne extends x {
3347
3347
  unwrap() {
3348
3348
  return this._def.type;
3349
3349
  }
@@ -3355,18 +3355,18 @@ class je extends w {
3355
3355
  expected: p.promise,
3356
3356
  received: t.parsedType
3357
3357
  }), _;
3358
- const s = t.parsedType === p.promise ? t.data : Promise.resolve(t.data);
3359
- return $(s.then((n) => this._def.type.parseAsync(n, {
3358
+ const r = t.parsedType === p.promise ? t.data : Promise.resolve(t.data);
3359
+ return $(r.then((n) => this._def.type.parseAsync(n, {
3360
3360
  path: t.path,
3361
3361
  errorMap: t.common.contextualErrorMap
3362
3362
  })));
3363
3363
  }
3364
3364
  }
3365
- je.create = (r, e) => new je(u({
3366
- type: r,
3365
+ Ne.create = (s, e) => new Ne(d({
3366
+ type: s,
3367
3367
  typeName: y.ZodPromise
3368
- }, b(e)));
3369
- class G extends w {
3368
+ }, w(e)));
3369
+ class H extends x {
3370
3370
  innerType() {
3371
3371
  return this._def.schema;
3372
3372
  }
@@ -3374,86 +3374,86 @@ class G extends w {
3374
3374
  return this._def.schema._def.typeName === y.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
3375
3375
  }
3376
3376
  _parse(e) {
3377
- const { status: t, ctx: s } = this._processInputParams(e), n = this._def.effect || null, a = {
3377
+ const { status: t, ctx: r } = this._processInputParams(e), n = this._def.effect || null, a = {
3378
3378
  addIssue: (i) => {
3379
- h(s, i), i.fatal ? t.abort() : t.dirty();
3379
+ h(r, i), i.fatal ? t.abort() : t.dirty();
3380
3380
  },
3381
3381
  get path() {
3382
- return s.path;
3382
+ return r.path;
3383
3383
  }
3384
3384
  };
3385
3385
  if (a.addIssue = a.addIssue.bind(a), n.type === "preprocess") {
3386
- const i = n.transform(s.data, a);
3387
- if (s.common.async)
3388
- return Promise.resolve(i).then((o) => C(this, null, function* () {
3386
+ const i = n.transform(r.data, a);
3387
+ if (r.common.async)
3388
+ return Promise.resolve(i).then((o) => I(this, null, function* () {
3389
3389
  if (t.value === "aborted")
3390
3390
  return _;
3391
3391
  const c = yield this._def.schema._parseAsync({
3392
3392
  data: o,
3393
- path: s.path,
3394
- parent: s
3393
+ path: r.path,
3394
+ parent: r
3395
3395
  });
3396
- return c.status === "aborted" ? _ : c.status === "dirty" || t.value === "dirty" ? Ae(c.value) : c;
3396
+ return c.status === "aborted" ? _ : c.status === "dirty" || t.value === "dirty" ? Ee(c.value) : c;
3397
3397
  }));
3398
3398
  {
3399
3399
  if (t.value === "aborted")
3400
3400
  return _;
3401
3401
  const o = this._def.schema._parseSync({
3402
3402
  data: i,
3403
- path: s.path,
3404
- parent: s
3403
+ path: r.path,
3404
+ parent: r
3405
3405
  });
3406
- return o.status === "aborted" ? _ : o.status === "dirty" || t.value === "dirty" ? Ae(o.value) : o;
3406
+ return o.status === "aborted" ? _ : o.status === "dirty" || t.value === "dirty" ? Ee(o.value) : o;
3407
3407
  }
3408
3408
  }
3409
3409
  if (n.type === "refinement") {
3410
3410
  const i = (o) => {
3411
3411
  const c = n.refinement(o, a);
3412
- if (s.common.async)
3412
+ if (r.common.async)
3413
3413
  return Promise.resolve(c);
3414
3414
  if (c instanceof Promise)
3415
3415
  throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
3416
3416
  return o;
3417
3417
  };
3418
- if (s.common.async === !1) {
3418
+ if (r.common.async === !1) {
3419
3419
  const o = this._def.schema._parseSync({
3420
- data: s.data,
3421
- path: s.path,
3422
- parent: s
3420
+ data: r.data,
3421
+ path: r.path,
3422
+ parent: r
3423
3423
  });
3424
3424
  return o.status === "aborted" ? _ : (o.status === "dirty" && t.dirty(), i(o.value), { status: t.value, value: o.value });
3425
3425
  } else
3426
- 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 }))));
3426
+ return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((o) => o.status === "aborted" ? _ : (o.status === "dirty" && t.dirty(), i(o.value).then(() => ({ status: t.value, value: o.value }))));
3427
3427
  }
3428
3428
  if (n.type === "transform")
3429
- if (s.common.async === !1) {
3429
+ if (r.common.async === !1) {
3430
3430
  const i = this._def.schema._parseSync({
3431
- data: s.data,
3432
- path: s.path,
3433
- parent: s
3431
+ data: r.data,
3432
+ path: r.path,
3433
+ parent: r
3434
3434
  });
3435
- if (!we(i))
3435
+ if (!_e(i))
3436
3436
  return i;
3437
3437
  const o = n.transform(i.value, a);
3438
3438
  if (o instanceof Promise)
3439
3439
  throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
3440
3440
  return { status: t.value, value: o };
3441
3441
  } else
3442
- return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => we(i) ? Promise.resolve(n.transform(i.value, a)).then((o) => ({ status: t.value, value: o })) : i);
3443
- x.assertNever(n);
3442
+ return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((i) => _e(i) ? Promise.resolve(n.transform(i.value, a)).then((o) => ({ status: t.value, value: o })) : i);
3443
+ k.assertNever(n);
3444
3444
  }
3445
3445
  }
3446
- G.create = (r, e, t) => new G(u({
3447
- schema: r,
3446
+ H.create = (s, e, t) => new H(d({
3447
+ schema: s,
3448
3448
  typeName: y.ZodEffects,
3449
3449
  effect: e
3450
- }, b(t)));
3451
- G.createWithPreprocess = (r, e, t) => new G(u({
3450
+ }, w(t)));
3451
+ H.createWithPreprocess = (s, e, t) => new H(d({
3452
3452
  schema: e,
3453
- effect: { type: "preprocess", transform: r },
3453
+ effect: { type: "preprocess", transform: s },
3454
3454
  typeName: y.ZodEffects
3455
- }, b(t)));
3456
- class Q extends w {
3455
+ }, w(t)));
3456
+ class X extends x {
3457
3457
  _parse(e) {
3458
3458
  return this._getType(e) === p.undefined ? $(void 0) : this._def.innerType._parse(e);
3459
3459
  }
@@ -3461,11 +3461,11 @@ class Q extends w {
3461
3461
  return this._def.innerType;
3462
3462
  }
3463
3463
  }
3464
- Q.create = (r, e) => new Q(u({
3465
- innerType: r,
3464
+ X.create = (s, e) => new X(d({
3465
+ innerType: s,
3466
3466
  typeName: y.ZodOptional
3467
- }, b(e)));
3468
- class pe extends w {
3467
+ }, w(e)));
3468
+ class fe extends x {
3469
3469
  _parse(e) {
3470
3470
  return this._getType(e) === p.null ? $(null) : this._def.innerType._parse(e);
3471
3471
  }
@@ -3473,16 +3473,16 @@ class pe extends w {
3473
3473
  return this._def.innerType;
3474
3474
  }
3475
3475
  }
3476
- pe.create = (r, e) => new pe(u({
3477
- innerType: r,
3476
+ fe.create = (s, e) => new fe(d({
3477
+ innerType: s,
3478
3478
  typeName: y.ZodNullable
3479
- }, b(e)));
3480
- class Ke extends w {
3479
+ }, w(e)));
3480
+ class Ge extends x {
3481
3481
  _parse(e) {
3482
3482
  const { ctx: t } = this._processInputParams(e);
3483
- let s = t.data;
3484
- return t.parsedType === p.undefined && (s = this._def.defaultValue()), this._def.innerType._parse({
3485
- data: s,
3483
+ let r = t.data;
3484
+ return t.parsedType === p.undefined && (r = this._def.defaultValue()), this._def.innerType._parse({
3485
+ data: r,
3486
3486
  path: t.path,
3487
3487
  parent: t
3488
3488
  });
@@ -3491,37 +3491,37 @@ class Ke extends w {
3491
3491
  return this._def.innerType;
3492
3492
  }
3493
3493
  }
3494
- Ke.create = (r, e) => new Ke(u({
3495
- innerType: r,
3494
+ Ge.create = (s, e) => new Ge(d({
3495
+ innerType: s,
3496
3496
  typeName: y.ZodDefault,
3497
3497
  defaultValue: typeof e.default == "function" ? e.default : () => e.default
3498
- }, b(e)));
3499
- class Xe extends w {
3498
+ }, w(e)));
3499
+ class Ke extends x {
3500
3500
  _parse(e) {
3501
- const { ctx: t } = this._processInputParams(e), s = g(u({}, t), {
3502
- common: g(u({}, t.common), {
3501
+ const { ctx: t } = this._processInputParams(e), r = g(d({}, t), {
3502
+ common: g(d({}, t.common), {
3503
3503
  issues: []
3504
3504
  })
3505
3505
  }), n = this._def.innerType._parse({
3506
- data: s.data,
3507
- path: s.path,
3508
- parent: u({}, s)
3506
+ data: r.data,
3507
+ path: r.path,
3508
+ parent: d({}, r)
3509
3509
  });
3510
- return Le(n) ? n.then((a) => ({
3510
+ return De(n) ? n.then((a) => ({
3511
3511
  status: "valid",
3512
3512
  value: a.status === "valid" ? a.value : this._def.catchValue({
3513
3513
  get error() {
3514
- return new W(s.common.issues);
3514
+ return new U(r.common.issues);
3515
3515
  },
3516
- input: s.data
3516
+ input: r.data
3517
3517
  })
3518
3518
  })) : {
3519
3519
  status: "valid",
3520
3520
  value: n.status === "valid" ? n.value : this._def.catchValue({
3521
3521
  get error() {
3522
- return new W(s.common.issues);
3522
+ return new U(r.common.issues);
3523
3523
  },
3524
- input: s.data
3524
+ input: r.data
3525
3525
  })
3526
3526
  };
3527
3527
  }
@@ -3529,33 +3529,33 @@ class Xe extends w {
3529
3529
  return this._def.innerType;
3530
3530
  }
3531
3531
  }
3532
- Xe.create = (r, e) => new Xe(u({
3533
- innerType: r,
3532
+ Ke.create = (s, e) => new Ke(d({
3533
+ innerType: s,
3534
3534
  typeName: y.ZodCatch,
3535
3535
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch
3536
- }, b(e)));
3537
- class lt extends w {
3536
+ }, w(e)));
3537
+ class lt extends x {
3538
3538
  _parse(e) {
3539
3539
  if (this._getType(e) !== p.nan) {
3540
- const s = this._getOrReturnCtx(e);
3541
- return h(s, {
3540
+ const r = this._getOrReturnCtx(e);
3541
+ return h(r, {
3542
3542
  code: l.invalid_type,
3543
3543
  expected: p.nan,
3544
- received: s.parsedType
3544
+ received: r.parsedType
3545
3545
  }), _;
3546
3546
  }
3547
3547
  return { status: "valid", value: e.data };
3548
3548
  }
3549
3549
  }
3550
- lt.create = (r) => new lt(u({
3550
+ lt.create = (s) => new lt(d({
3551
3551
  typeName: y.ZodNaN
3552
- }, b(r)));
3552
+ }, w(s)));
3553
3553
  const tn = Symbol("zod_brand");
3554
- class $t extends w {
3554
+ class $t extends x {
3555
3555
  _parse(e) {
3556
- const { ctx: t } = this._processInputParams(e), s = t.data;
3556
+ const { ctx: t } = this._processInputParams(e), r = t.data;
3557
3557
  return this._def.type._parse({
3558
- data: s,
3558
+ data: r,
3559
3559
  path: t.path,
3560
3560
  parent: t
3561
3561
  });
@@ -3564,167 +3564,167 @@ class $t extends w {
3564
3564
  return this._def.type;
3565
3565
  }
3566
3566
  }
3567
- class et extends w {
3567
+ class Qe extends x {
3568
3568
  _parse(e) {
3569
- const { status: t, ctx: s } = this._processInputParams(e);
3570
- if (s.common.async)
3571
- return C(this, null, function* () {
3569
+ const { status: t, ctx: r } = this._processInputParams(e);
3570
+ if (r.common.async)
3571
+ return I(this, null, function* () {
3572
3572
  const a = yield this._def.in._parseAsync({
3573
- data: s.data,
3574
- path: s.path,
3575
- parent: s
3573
+ data: r.data,
3574
+ path: r.path,
3575
+ parent: r
3576
3576
  });
3577
- return a.status === "aborted" ? _ : a.status === "dirty" ? (t.dirty(), Ae(a.value)) : this._def.out._parseAsync({
3577
+ return a.status === "aborted" ? _ : a.status === "dirty" ? (t.dirty(), Ee(a.value)) : this._def.out._parseAsync({
3578
3578
  data: a.value,
3579
- path: s.path,
3580
- parent: s
3579
+ path: r.path,
3580
+ parent: r
3581
3581
  });
3582
3582
  });
3583
3583
  {
3584
3584
  const n = this._def.in._parseSync({
3585
- data: s.data,
3586
- path: s.path,
3587
- parent: s
3585
+ data: r.data,
3586
+ path: r.path,
3587
+ parent: r
3588
3588
  });
3589
3589
  return n.status === "aborted" ? _ : n.status === "dirty" ? (t.dirty(), {
3590
3590
  status: "dirty",
3591
3591
  value: n.value
3592
3592
  }) : this._def.out._parseSync({
3593
3593
  data: n.value,
3594
- path: s.path,
3595
- parent: s
3594
+ path: r.path,
3595
+ parent: r
3596
3596
  });
3597
3597
  }
3598
3598
  }
3599
3599
  static create(e, t) {
3600
- return new et({
3600
+ return new Qe({
3601
3601
  in: e,
3602
3602
  out: t,
3603
3603
  typeName: y.ZodPipeline
3604
3604
  });
3605
3605
  }
3606
3606
  }
3607
- class Ye extends w {
3607
+ class Xe extends x {
3608
3608
  _parse(e) {
3609
- const t = this._def.innerType._parse(e), s = (n) => (we(n) && (n.value = Object.freeze(n.value)), n);
3610
- return Le(t) ? t.then((n) => s(n)) : s(t);
3609
+ const t = this._def.innerType._parse(e), r = (n) => (_e(n) && (n.value = Object.freeze(n.value)), n);
3610
+ return De(t) ? t.then((n) => r(n)) : r(t);
3611
3611
  }
3612
3612
  unwrap() {
3613
3613
  return this._def.innerType;
3614
3614
  }
3615
3615
  }
3616
- Ye.create = (r, e) => new Ye(u({
3617
- innerType: r,
3616
+ Xe.create = (s, e) => new Xe(d({
3617
+ innerType: s,
3618
3618
  typeName: y.ZodReadonly
3619
- }, b(e)));
3620
- function Kt(r, e) {
3621
- const t = typeof r == "function" ? r(e) : typeof r == "string" ? { message: r } : r;
3619
+ }, w(e)));
3620
+ function Kt(s, e) {
3621
+ const t = typeof s == "function" ? s(e) : typeof s == "string" ? { message: s } : s;
3622
3622
  return typeof t == "string" ? { message: t } : t;
3623
3623
  }
3624
- function yr(r, e = {}, t) {
3625
- return r ? Ne.create().superRefine((s, n) => {
3624
+ function ys(s, e = {}, t) {
3625
+ return s ? Oe.create().superRefine((r, n) => {
3626
3626
  var a, i;
3627
- const o = r(s);
3627
+ const o = s(r);
3628
3628
  if (o instanceof Promise)
3629
3629
  return o.then((c) => {
3630
- var d, f;
3630
+ var u, f;
3631
3631
  if (!c) {
3632
- const v = Kt(e, s), j = (f = (d = v.fatal) !== null && d !== void 0 ? d : t) !== null && f !== void 0 ? f : !0;
3633
- n.addIssue(g(u({ code: "custom" }, v), { fatal: j }));
3632
+ const v = Kt(e, r), j = (f = (u = v.fatal) !== null && u !== void 0 ? u : t) !== null && f !== void 0 ? f : !0;
3633
+ n.addIssue(g(d({ code: "custom" }, v), { fatal: j }));
3634
3634
  }
3635
3635
  });
3636
3636
  if (!o) {
3637
- const c = Kt(e, s), d = (i = (a = c.fatal) !== null && a !== void 0 ? a : t) !== null && i !== void 0 ? i : !0;
3638
- n.addIssue(g(u({ code: "custom" }, c), { fatal: d }));
3637
+ const c = Kt(e, r), u = (i = (a = c.fatal) !== null && a !== void 0 ? a : t) !== null && i !== void 0 ? i : !0;
3638
+ n.addIssue(g(d({ code: "custom" }, c), { fatal: u }));
3639
3639
  }
3640
- }) : Ne.create();
3640
+ }) : Oe.create();
3641
3641
  }
3642
- const rn = {
3643
- object: I.lazycreate
3642
+ const sn = {
3643
+ object: O.lazycreate
3644
3644
  };
3645
3645
  var y;
3646
- (function(r) {
3647
- 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";
3646
+ (function(s) {
3647
+ s.ZodString = "ZodString", s.ZodNumber = "ZodNumber", s.ZodNaN = "ZodNaN", s.ZodBigInt = "ZodBigInt", s.ZodBoolean = "ZodBoolean", s.ZodDate = "ZodDate", s.ZodSymbol = "ZodSymbol", s.ZodUndefined = "ZodUndefined", s.ZodNull = "ZodNull", s.ZodAny = "ZodAny", s.ZodUnknown = "ZodUnknown", s.ZodNever = "ZodNever", s.ZodVoid = "ZodVoid", s.ZodArray = "ZodArray", s.ZodObject = "ZodObject", s.ZodUnion = "ZodUnion", s.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", s.ZodIntersection = "ZodIntersection", s.ZodTuple = "ZodTuple", s.ZodRecord = "ZodRecord", s.ZodMap = "ZodMap", s.ZodSet = "ZodSet", s.ZodFunction = "ZodFunction", s.ZodLazy = "ZodLazy", s.ZodLiteral = "ZodLiteral", s.ZodEnum = "ZodEnum", s.ZodEffects = "ZodEffects", s.ZodNativeEnum = "ZodNativeEnum", s.ZodOptional = "ZodOptional", s.ZodNullable = "ZodNullable", s.ZodDefault = "ZodDefault", s.ZodCatch = "ZodCatch", s.ZodPromise = "ZodPromise", s.ZodBranded = "ZodBranded", s.ZodPipeline = "ZodPipeline", s.ZodReadonly = "ZodReadonly";
3648
3648
  })(y || (y = {}));
3649
- const sn = (r, e = {
3650
- message: `Input not instance of ${r.name}`
3651
- }) => yr((t) => t instanceof r, e), vr = H.create, _r = le.create, nn = lt.create, an = fe.create, br = Ve.create, on = xe.create, cn = ct.create, dn = Ue.create, un = We.create, ln = Ne.create, fn = be.create, hn = oe.create, pn = dt.create, mn = J.create, gn = I.create, yn = I.strictCreate, vn = ze.create, _n = ft.create, bn = Be.create, wn = te.create, xn = qe.create, kn = ut.create, Tn = ke.create, Sn = Ce.create, En = He.create, An = Je.create, Cn = he.create, In = Ge.create, On = je.create, Xt = G.create, Nn = Q.create, jn = pe.create, Rn = G.createWithPreprocess, Zn = et.create, Mn = () => vr().optional(), Pn = () => _r().optional(), $n = () => br().optional(), Fn = {
3652
- string: (r) => H.create(g(u({}, r), { coerce: !0 })),
3653
- number: (r) => le.create(g(u({}, r), { coerce: !0 })),
3654
- boolean: (r) => Ve.create(g(u({}, r), {
3649
+ const rn = (s, e = {
3650
+ message: `Input not instance of ${s.name}`
3651
+ }) => ys((t) => t instanceof s, e), vs = B.create, _s = ue.create, nn = lt.create, an = de.create, bs = Le.create, on = be.create, cn = ct.create, un = Ve.create, dn = Ue.create, ln = Oe.create, fn = ve.create, hn = ae.create, pn = ut.create, mn = q.create, gn = O.create, yn = O.strictCreate, vn = We.create, _n = ft.create, bn = ze.create, wn = Q.create, xn = Be.create, kn = dt.create, Tn = we.create, Sn = Ae.create, En = qe.create, An = He.create, Cn = le.create, In = Je.create, On = Ne.create, Xt = H.create, Nn = X.create, jn = fe.create, Rn = H.createWithPreprocess, Zn = Qe.create, Mn = () => vs().optional(), Pn = () => _s().optional(), $n = () => bs().optional(), Fn = {
3652
+ string: (s) => B.create(g(d({}, s), { coerce: !0 })),
3653
+ number: (s) => ue.create(g(d({}, s), { coerce: !0 })),
3654
+ boolean: (s) => Le.create(g(d({}, s), {
3655
3655
  coerce: !0
3656
3656
  })),
3657
- bigint: (r) => fe.create(g(u({}, r), { coerce: !0 })),
3658
- date: (r) => xe.create(g(u({}, r), { coerce: !0 }))
3657
+ bigint: (s) => de.create(g(d({}, s), { coerce: !0 })),
3658
+ date: (s) => be.create(g(d({}, s), { coerce: !0 }))
3659
3659
  }, Dn = _;
3660
3660
  var T = /* @__PURE__ */ Object.freeze({
3661
3661
  __proto__: null,
3662
- defaultErrorMap: Oe,
3663
- setErrorMap: js,
3662
+ defaultErrorMap: Ie,
3663
+ setErrorMap: jr,
3664
3664
  getErrorMap: at,
3665
3665
  makeIssue: it,
3666
- EMPTY_PATH: Rs,
3666
+ EMPTY_PATH: Rr,
3667
3667
  addIssueToContext: h,
3668
3668
  ParseStatus: Z,
3669
3669
  INVALID: _,
3670
- DIRTY: Ae,
3670
+ DIRTY: Ee,
3671
3671
  OK: $,
3672
3672
  isAborted: Nt,
3673
3673
  isDirty: jt,
3674
- isValid: we,
3675
- isAsync: Le,
3674
+ isValid: _e,
3675
+ isAsync: De,
3676
3676
  get util() {
3677
- return x;
3677
+ return k;
3678
3678
  },
3679
3679
  get objectUtil() {
3680
3680
  return Ot;
3681
3681
  },
3682
3682
  ZodParsedType: p,
3683
- getParsedType: ae,
3684
- ZodType: w,
3685
- datetimeRegex: mr,
3686
- ZodString: H,
3687
- ZodNumber: le,
3688
- ZodBigInt: fe,
3689
- ZodBoolean: Ve,
3690
- ZodDate: xe,
3683
+ getParsedType: re,
3684
+ ZodType: x,
3685
+ datetimeRegex: ms,
3686
+ ZodString: B,
3687
+ ZodNumber: ue,
3688
+ ZodBigInt: de,
3689
+ ZodBoolean: Le,
3690
+ ZodDate: be,
3691
3691
  ZodSymbol: ct,
3692
- ZodUndefined: Ue,
3693
- ZodNull: We,
3694
- ZodAny: Ne,
3695
- ZodUnknown: be,
3696
- ZodNever: oe,
3697
- ZodVoid: dt,
3698
- ZodArray: J,
3699
- ZodObject: I,
3700
- ZodUnion: ze,
3692
+ ZodUndefined: Ve,
3693
+ ZodNull: Ue,
3694
+ ZodAny: Oe,
3695
+ ZodUnknown: ve,
3696
+ ZodNever: ae,
3697
+ ZodVoid: ut,
3698
+ ZodArray: q,
3699
+ ZodObject: O,
3700
+ ZodUnion: We,
3701
3701
  ZodDiscriminatedUnion: ft,
3702
- ZodIntersection: Be,
3703
- ZodTuple: te,
3704
- ZodRecord: qe,
3705
- ZodMap: ut,
3706
- ZodSet: ke,
3707
- ZodFunction: Ce,
3708
- ZodLazy: He,
3709
- ZodLiteral: Je,
3710
- ZodEnum: he,
3711
- ZodNativeEnum: Ge,
3712
- ZodPromise: je,
3713
- ZodEffects: G,
3714
- ZodTransformer: G,
3715
- ZodOptional: Q,
3716
- ZodNullable: pe,
3717
- ZodDefault: Ke,
3718
- ZodCatch: Xe,
3702
+ ZodIntersection: ze,
3703
+ ZodTuple: Q,
3704
+ ZodRecord: Be,
3705
+ ZodMap: dt,
3706
+ ZodSet: we,
3707
+ ZodFunction: Ae,
3708
+ ZodLazy: qe,
3709
+ ZodLiteral: He,
3710
+ ZodEnum: le,
3711
+ ZodNativeEnum: Je,
3712
+ ZodPromise: Ne,
3713
+ ZodEffects: H,
3714
+ ZodTransformer: H,
3715
+ ZodOptional: X,
3716
+ ZodNullable: fe,
3717
+ ZodDefault: Ge,
3718
+ ZodCatch: Ke,
3719
3719
  ZodNaN: lt,
3720
3720
  BRAND: tn,
3721
3721
  ZodBranded: $t,
3722
- ZodPipeline: et,
3723
- ZodReadonly: Ye,
3724
- custom: yr,
3725
- Schema: w,
3726
- ZodSchema: w,
3727
- late: rn,
3722
+ ZodPipeline: Qe,
3723
+ ZodReadonly: Xe,
3724
+ custom: ys,
3725
+ Schema: x,
3726
+ ZodSchema: x,
3727
+ late: sn,
3728
3728
  get ZodFirstPartyTypeKind() {
3729
3729
  return y;
3730
3730
  },
@@ -3732,13 +3732,13 @@ var T = /* @__PURE__ */ Object.freeze({
3732
3732
  any: ln,
3733
3733
  array: mn,
3734
3734
  bigint: an,
3735
- boolean: br,
3735
+ boolean: bs,
3736
3736
  date: on,
3737
3737
  discriminatedUnion: _n,
3738
3738
  effect: Xt,
3739
3739
  enum: Cn,
3740
3740
  function: Sn,
3741
- instanceof: sn,
3741
+ instanceof: rn,
3742
3742
  intersection: bn,
3743
3743
  lazy: En,
3744
3744
  literal: An,
@@ -3746,9 +3746,9 @@ var T = /* @__PURE__ */ Object.freeze({
3746
3746
  nan: nn,
3747
3747
  nativeEnum: In,
3748
3748
  never: hn,
3749
- null: un,
3749
+ null: dn,
3750
3750
  nullable: jn,
3751
- number: _r,
3751
+ number: _s,
3752
3752
  object: gn,
3753
3753
  oboolean: $n,
3754
3754
  onumber: Pn,
@@ -3760,18 +3760,18 @@ var T = /* @__PURE__ */ Object.freeze({
3760
3760
  record: xn,
3761
3761
  set: Tn,
3762
3762
  strictObject: yn,
3763
- string: vr,
3763
+ string: vs,
3764
3764
  symbol: cn,
3765
3765
  transformer: Xt,
3766
3766
  tuple: wn,
3767
- undefined: dn,
3767
+ undefined: un,
3768
3768
  union: vn,
3769
3769
  unknown: fn,
3770
3770
  void: pn,
3771
3771
  NEVER: Dn,
3772
3772
  ZodIssueCode: l,
3773
- quotelessJson: Ns,
3774
- ZodError: W
3773
+ quotelessJson: Nr,
3774
+ ZodError: U
3775
3775
  });
3776
3776
  const Ln = T.object({
3777
3777
  language: T.enum(["typescript", "javascript"]).optional(),
@@ -3816,8 +3816,8 @@ const Ln = T.object({
3816
3816
  enableTranslation: T.boolean().optional()
3817
3817
  })
3818
3818
  ])
3819
- ), Vn = (r) => {
3820
- const e = Ln.safeParse(r);
3819
+ ), Vn = (s) => {
3820
+ const e = Ln.safeParse(s);
3821
3821
  if (e.success === !1) {
3822
3822
  const t = new Error("Invalid codegen settings");
3823
3823
  throw t.cause = e.error, t;
@@ -3829,15 +3829,15 @@ const Ln = T.object({
3829
3829
  "COMPONENT",
3830
3830
  "COMPONENT_SET",
3831
3831
  "GROUP"
3832
- ]), Un = (r, e, t = { allowAutoSelectFirstNode: !0 }) => {
3833
- const s = ur(r.document, e);
3834
- if (!s)
3832
+ ]), Un = (s, e, t = { allowAutoSelectFirstNode: !0 }) => {
3833
+ const r = ds(s.document, e);
3834
+ if (!r)
3835
3835
  return {
3836
3836
  isValid: !1,
3837
3837
  reason: "There is no node with the given id"
3838
3838
  };
3839
- if (s.type === "CANVAS") {
3840
- const n = s.children.filter(
3839
+ if (r.type === "CANVAS") {
3840
+ const n = r.children.filter(
3841
3841
  (a) => Yt.has(a.type)
3842
3842
  );
3843
3843
  return n.length === 0 ? {
@@ -3856,41 +3856,41 @@ const Ln = T.object({
3856
3856
  reason: "Selected node is a page with multiple children"
3857
3857
  };
3858
3858
  }
3859
- return Yt.has(s.type) ? { isValid: !0, node: s } : {
3859
+ return Yt.has(r.type) ? { isValid: !0, node: r } : {
3860
3860
  isValid: !1,
3861
3861
  reason: "Selected node type is not supported"
3862
3862
  };
3863
3863
  };
3864
- var E, Qe, ie, wr, De;
3865
- class ea {
3864
+ var A, Ye, ne, ws, Fe;
3865
+ class ta {
3866
3866
  constructor({
3867
3867
  auth: e,
3868
3868
  apiBaseAddress: t = "https://public-api.animaapp.com"
3869
3869
  } = {}) {
3870
- tt(this, ie);
3871
- tt(this, E);
3872
- tt(this, Qe);
3873
- gt(this, Qe, t), e && (this.auth = e);
3870
+ tt(this, ne);
3871
+ tt(this, A);
3872
+ tt(this, Ye);
3873
+ gt(this, Ye, t), e && (this.auth = e);
3874
3874
  }
3875
3875
  hasAuth() {
3876
- return !!A(this, E);
3876
+ return !!C(this, A);
3877
3877
  }
3878
3878
  set auth(e) {
3879
- gt(this, E, e);
3879
+ gt(this, A, e);
3880
3880
  }
3881
3881
  get headers() {
3882
3882
  const e = {
3883
3883
  "Content-Type": "application/json"
3884
3884
  };
3885
- return A(this, E) && (e.Authorization = `Bearer ${A(this, E).token}`, "teamId" in A(this, E) && (e["X-Team-Id"] = A(this, E).teamId)), e;
3885
+ return C(this, A) && (e.Authorization = `Bearer ${C(this, A).token}`, "teamId" in C(this, A) && (e["X-Team-Id"] = C(this, A).teamId)), e;
3886
3886
  }
3887
3887
  generateCode(n) {
3888
- return C(this, arguments, function* (e, t = {}, s) {
3888
+ return I(this, arguments, function* (e, t = {}, r) {
3889
3889
  var c;
3890
3890
  const a = Vn(e.settings);
3891
- e.figmaToken && (yield Se(this, ie, wr).call(this, e.fileKey, e.figmaToken, e.nodesId, { allowAutoSelectFirstNode: (c = a.allowAutoSelectFirstNode) != null ? c : !0 }, s));
3891
+ e.figmaToken && (yield Te(this, ne, ws).call(this, e.fileKey, e.figmaToken, e.nodesId, { allowAutoSelectFirstNode: (c = a.allowAutoSelectFirstNode) != null ? c : !0 }, r));
3892
3892
  let i = e.tracking;
3893
- A(this, E) && "userId" in A(this, E) && A(this, E).userId && (i != null && i.externalId || (i = { externalId: A(this, E).userId }));
3893
+ C(this, A) && "userId" in C(this, A) && C(this, A).userId && (i != null && i.externalId || (i = { externalId: C(this, A).userId }));
3894
3894
  const o = {
3895
3895
  tracking: i,
3896
3896
  fileKey: e.fileKey,
@@ -3917,13 +3917,13 @@ class ea {
3917
3917
  codegenSettings: a.codegenSettings,
3918
3918
  webhookUrl: e.webhookUrl
3919
3919
  };
3920
- return Se(this, ie, De).call(this, "/v1/codegen", o, t, "codegen", s);
3920
+ return Te(this, ne, Fe).call(this, "/v1/codegen", o, t, "codegen", r);
3921
3921
  });
3922
3922
  }
3923
3923
  generateCodeFromWebsite(n) {
3924
- return C(this, arguments, function* (e, t = {}, s) {
3924
+ return I(this, arguments, function* (e, t = {}, r) {
3925
3925
  let a = e.tracking;
3926
- A(this, E) && "userId" in A(this, E) && A(this, E).userId && (a != null && a.externalId || (a = { externalId: A(this, E).userId }));
3926
+ C(this, A) && "userId" in C(this, A) && C(this, A).userId && (a != null && a.externalId || (a = { externalId: C(this, A).userId }));
3927
3927
  let i;
3928
3928
  if (e.mhtml)
3929
3929
  i = {
@@ -3953,7 +3953,7 @@ class ea {
3953
3953
  }
3954
3954
  }
3955
3955
  };
3956
- return Se(this, ie, De).call(this, "/v1/l2c", o, t, "l2c", s);
3956
+ return Te(this, ne, Fe).call(this, "/v1/l2c", o, t, "l2c", r);
3957
3957
  });
3958
3958
  }
3959
3959
  /**
@@ -3989,14 +3989,14 @@ class ea {
3989
3989
  * ```
3990
3990
  */
3991
3991
  generateCodeFromPrompt(n) {
3992
- return C(this, arguments, function* (e, t = {}, s) {
3992
+ return I(this, arguments, function* (e, t = {}, r) {
3993
3993
  var o;
3994
3994
  let a = e.tracking;
3995
- A(this, E) && "userId" in A(this, E) && A(this, E).userId && (a != null && a.externalId || (a = { externalId: A(this, E).userId }));
3995
+ C(this, A) && "userId" in C(this, A) && C(this, A).userId && (a != null && a.externalId || (a = { externalId: C(this, A).userId }));
3996
3996
  const i = {
3997
3997
  tracking: a,
3998
3998
  assetsStorage: e.assetsStorage,
3999
- params: u({
3999
+ params: d({
4000
4000
  prompt: e.prompt,
4001
4001
  conventions: {
4002
4002
  language: e.settings.language,
@@ -4007,30 +4007,30 @@ class ea {
4007
4007
  }, (o = e.settings.codegenSettings) != null ? o : {}),
4008
4008
  webhookUrl: e.webhookUrl
4009
4009
  };
4010
- return console.log("P2C Request Body:", JSON.stringify(i, null, 2)), Se(this, ie, De).call(this, "/v1/p2c", i, t, "p2c", s);
4010
+ return console.log("P2C Request Body:", JSON.stringify(i, null, 2)), Te(this, ne, Fe).call(this, "/v1/p2c", i, t, "p2c", r);
4011
4011
  });
4012
4012
  }
4013
4013
  /**
4014
4014
  * @deprecated This method will be removed soon, please use `generateCodeFromWebsite` instead.
4015
4015
  */
4016
4016
  generateLink2Code(n) {
4017
- return C(this, arguments, function* (e, t = {}, s) {
4017
+ return I(this, arguments, function* (e, t = {}, r) {
4018
4018
  let a = e.tracking;
4019
- A(this, E) && "userId" in A(this, E) && A(this, E).userId && (a != null && a.externalId || (a = { externalId: A(this, E).userId }));
4019
+ C(this, A) && "userId" in C(this, A) && C(this, A).userId && (a != null && a.externalId || (a = { externalId: C(this, A).userId }));
4020
4020
  const i = {
4021
4021
  tracking: a,
4022
4022
  assetsStorage: e.assetsStorage,
4023
4023
  params: e.params
4024
4024
  };
4025
- return Se(this, ie, De).call(this, "/v1/l2c", i, t, "l2c", s);
4025
+ return Te(this, ne, Fe).call(this, "/v1/l2c", i, t, "l2c", r);
4026
4026
  });
4027
4027
  }
4028
4028
  }
4029
- E = new WeakMap(), Qe = new WeakMap(), ie = new WeakSet(), wr = function(e, t, s, n, a) {
4030
- return C(this, null, function* () {
4029
+ A = new WeakMap(), Ye = new WeakMap(), ne = new WeakSet(), ws = function(e, t, r, n, a) {
4030
+ return I(this, null, function* () {
4031
4031
  let i;
4032
4032
  try {
4033
- i = yield Os({
4033
+ i = yield Or({
4034
4034
  fileKey: e,
4035
4035
  authToken: t,
4036
4036
  params: {
@@ -4038,199 +4038,205 @@ E = new WeakMap(), Qe = new WeakMap(), ie = new WeakSet(), wr = function(e, t, s
4038
4038
  },
4039
4039
  signal: a
4040
4040
  });
4041
- } catch (d) {
4042
- if (d instanceof Error && d.name === "AbortError")
4043
- throw d;
4041
+ } catch (u) {
4042
+ if (u instanceof Error && u.name === "AbortError")
4043
+ throw u;
4044
4044
  return;
4045
4045
  }
4046
- const c = s.map(
4047
- (d) => Un(i, d, n)
4046
+ const c = r.map(
4047
+ (u) => Un(i, u, n)
4048
4048
  ).find(
4049
- (d) => !d.isValid
4049
+ (u) => !u.isValid
4050
4050
  );
4051
4051
  if (c)
4052
- throw new ye({
4052
+ throw new me({
4053
4053
  name: "Task Crashed",
4054
4054
  reason: c.reason
4055
4055
  });
4056
4056
  });
4057
- }, De = function(e, t, s, n, a) {
4058
- return C(this, null, function* () {
4059
- var v, j, M, F, z, re, me, ce, V, de;
4057
+ }, Fe = function(e, t, r, n, a) {
4058
+ return I(this, null, function* () {
4059
+ var v, j, M, F, W, ee, he, ie, L, oe, et;
4060
4060
  if (this.hasAuth() === !1)
4061
4061
  throw new Error('It needs to set "auth" before calling this method.');
4062
- const i = {}, o = yield fetch(`${A(this, Qe)}${e}`, {
4062
+ const i = {}, o = yield fetch(`${C(this, Ye)}${e}`, {
4063
4063
  method: "POST",
4064
- headers: g(u({}, this.headers), {
4064
+ headers: g(d({}, this.headers), {
4065
4065
  Accept: "text/event-stream"
4066
4066
  }),
4067
4067
  body: JSON.stringify(t),
4068
4068
  signal: a
4069
4069
  });
4070
4070
  if (!o.ok) {
4071
- const Te = yield o.text();
4072
- let B;
4071
+ const xe = yield o.text();
4072
+ let E;
4073
4073
  try {
4074
- B = JSON.parse(Te);
4075
- } catch (O) {
4074
+ E = JSON.parse(xe);
4075
+ } catch (ke) {
4076
4076
  }
4077
- throw ((v = B == null ? void 0 : B.error) == null ? void 0 : v.name) === "ZodError" ? (console.log(
4077
+ throw ((v = E == null ? void 0 : E.error) == null ? void 0 : v.name) === "ZodError" ? (console.log(
4078
4078
  "Zod validation error:",
4079
- JSON.stringify(B.error.issues, null, 2)
4080
- ), new ye({
4079
+ JSON.stringify(E.error.issues, null, 2)
4080
+ ), new me({
4081
4081
  name: "HTTP error from Anima API",
4082
4082
  reason: "Invalid body payload",
4083
- detail: B.error.issues,
4083
+ detail: E.error.issues,
4084
4084
  status: o.status
4085
- })) : typeof B == "object" ? new ye({
4086
- name: `Error "${B}"`,
4085
+ })) : typeof E == "object" ? new me({
4086
+ name: `Error "${E}"`,
4087
4087
  reason: "Unknown",
4088
4088
  status: o.status
4089
- }) : new ye({
4089
+ }) : new me({
4090
4090
  name: "HTTP error from Anima API",
4091
- reason: Te,
4091
+ reason: xe,
4092
4092
  status: o.status
4093
4093
  });
4094
4094
  }
4095
4095
  if (!o.body)
4096
- throw new ye({
4096
+ throw new me({
4097
4097
  name: "Stream Error",
4098
4098
  reason: "Response body is null",
4099
4099
  status: o.status
4100
4100
  });
4101
- const c = o.body.getReader(), d = new TextDecoder();
4101
+ const c = o.body.getReader(), u = new TextDecoder();
4102
4102
  let f = "";
4103
4103
  try {
4104
4104
  for (; ; ) {
4105
- const { done: Te, value: B } = yield c.read();
4106
- if (Te)
4105
+ const { done: xe, value: E } = yield c.read();
4106
+ if (xe)
4107
4107
  break;
4108
- f += d.decode(B, { stream: !0 });
4109
- const O = f.split(`
4108
+ f += u.decode(E, { stream: !0 });
4109
+ const ke = f.split(`
4110
4110
  `);
4111
- f = O.pop() || "";
4112
- for (const ge of O)
4113
- if (!(!ge.trim() || ge.startsWith(":")) && ge.startsWith("data: ")) {
4114
- let k;
4111
+ f = ke.pop() || "";
4112
+ for (const pe of ke)
4113
+ if (!(!pe.trim() || pe.startsWith(":")) && pe.startsWith("data: ")) {
4114
+ let b;
4115
4115
  try {
4116
- k = JSON.parse(ge.slice(6));
4117
- } catch (D) {
4116
+ b = JSON.parse(pe.slice(6));
4117
+ } catch (Kn) {
4118
4118
  continue;
4119
4119
  }
4120
- switch (k.type) {
4120
+ switch (b.type) {
4121
4121
  case "queueing": {
4122
- typeof s == "function" ? s(k) : (j = s.onQueueing) == null || j.call(s);
4122
+ typeof r == "function" ? r(b) : (j = r.onQueueing) == null || j.call(r, {
4123
+ sessionId: b.sessionId
4124
+ });
4123
4125
  break;
4124
4126
  }
4125
4127
  case "start": {
4126
- i.sessionId = k.sessionId, typeof s == "function" ? s(k) : (M = s.onStart) == null || M.call(s, { sessionId: k.sessionId });
4128
+ i.sessionId = b.sessionId, typeof r == "function" ? r(b) : (M = r.onStart) == null || M.call(r, { sessionId: b.sessionId });
4127
4129
  break;
4128
4130
  }
4129
4131
  case "pre_codegen": {
4130
- n === "codegen" && (typeof s == "function" ? s(k) : (F = s.onPreCodegen) == null || F.call(s, {
4131
- message: k.message
4132
+ n === "codegen" && (typeof r == "function" ? r(b) : (F = r.onPreCodegen) == null || F.call(r, {
4133
+ message: b.message
4132
4134
  }));
4133
4135
  break;
4134
4136
  }
4135
4137
  case "assets_uploaded": {
4136
- typeof s == "function" ? s(k) : (z = s.onAssetsUploaded) == null || z.call(s);
4138
+ typeof r == "function" ? r(b) : (W = r.onAssetsUploaded) == null || W.call(r);
4137
4139
  break;
4138
4140
  }
4139
4141
  case "assets_list": {
4140
- i.assets = k.payload.assets, typeof s == "function" ? s(k) : (re = s.onAssetsList) == null || re.call(s, k.payload);
4142
+ i.assets = b.payload.assets, typeof r == "function" ? r(b) : (ee = r.onAssetsList) == null || ee.call(r, b.payload);
4141
4143
  break;
4142
4144
  }
4143
4145
  case "figma_metadata": {
4144
- n === "codegen" && (i.figmaFileName = k.figmaFileName, i.figmaSelectedFrameName = k.figmaSelectedFrameName, typeof s == "function" ? s(k) : (me = s.onFigmaMetadata) == null || me.call(s, {
4145
- figmaFileName: k.figmaFileName,
4146
- figmaSelectedFrameName: k.figmaSelectedFrameName
4146
+ n === "codegen" && (i.figmaFileName = b.figmaFileName, i.figmaSelectedFrameName = b.figmaSelectedFrameName, typeof r == "function" ? r(b) : (he = r.onFigmaMetadata) == null || he.call(r, {
4147
+ figmaFileName: b.figmaFileName,
4148
+ figmaSelectedFrameName: b.figmaSelectedFrameName
4147
4149
  }));
4148
4150
  break;
4149
4151
  }
4150
4152
  case "generating_code": {
4151
- k.payload.status === "success" && (i.files = k.payload.files), typeof s == "function" ? s(k) : (ce = s.onGeneratingCode) == null || ce.call(s, {
4152
- status: k.payload.status,
4153
- progress: k.payload.progress,
4154
- files: k.payload.files
4153
+ b.payload.status === "success" && (i.files = b.payload.files), typeof r == "function" ? r(b) : (ie = r.onGeneratingCode) == null || ie.call(r, {
4154
+ status: b.payload.status,
4155
+ progress: b.payload.progress,
4156
+ files: b.payload.files
4155
4157
  });
4156
4158
  break;
4157
4159
  }
4158
4160
  case "progress_messages_updated": {
4159
- typeof s == "function" ? s(k) : (V = s.onProgressMessagesUpdated) == null || V.call(
4160
- s,
4161
- k.payload.progressMessages
4161
+ typeof r == "function" ? r(b) : (L = r.onProgressMessagesUpdated) == null || L.call(
4162
+ r,
4163
+ b.payload.progressMessages
4162
4164
  );
4163
4165
  break;
4164
4166
  }
4167
+ case "job_status_updated": {
4168
+ typeof r == "function" ? r(b) : (oe = r.onJobStatusUpdated) == null || oe.call(r, b.payload.jobStatus);
4169
+ break;
4170
+ }
4165
4171
  case "codegen_completed":
4166
4172
  case "generation_completed": {
4167
- typeof s == "function" ? s(k) : (de = s.onCodegenCompleted) == null || de.call(s);
4173
+ typeof r == "function" ? r(b) : (et = r.onCodegenCompleted) == null || et.call(r);
4168
4174
  break;
4169
4175
  }
4170
4176
  case "error":
4171
- throw new ye({
4172
- name: k.payload.errorName,
4173
- reason: k.payload.reason
4177
+ throw new me({
4178
+ name: b.payload.errorName,
4179
+ reason: b.payload.reason
4174
4180
  });
4175
4181
  case "done":
4176
- return i.tokenUsage = k.payload.tokenUsage, i.sessionId = k.payload.sessionId, i;
4182
+ return i.tokenUsage = b.payload.tokenUsage, i.sessionId = b.payload.sessionId, i;
4177
4183
  }
4178
4184
  }
4179
4185
  }
4180
4186
  } finally {
4181
4187
  c.cancel();
4182
4188
  }
4183
- throw new ye({
4189
+ throw new me({
4184
4190
  name: "Connection",
4185
4191
  reason: "Connection closed before the 'done' message",
4186
4192
  status: 500
4187
4193
  });
4188
4194
  });
4189
4195
  };
4190
- const ta = (r) => {
4196
+ const sa = (s) => {
4191
4197
  var e;
4192
- if (!r)
4198
+ if (!s)
4193
4199
  return [!1, "", ""];
4194
4200
  try {
4195
- const t = new URL(r), s = t.pathname;
4201
+ const t = new URL(s), r = t.pathname;
4196
4202
  if (t.origin !== "https://www.figma.com")
4197
4203
  return [!1, "", ""];
4198
4204
  const n = t.toString();
4199
- if (r !== n)
4205
+ if (s !== n)
4200
4206
  return [!1, "", ""];
4201
- const a = ((e = t.searchParams.get("node-id")) != null ? e : "").replace(/-/g, ":"), i = s.split("/")[2];
4202
- return [(s.startsWith("/file/") && t.searchParams.get("type") !== "whiteboard" || s.startsWith("/design/") || s.startsWith("/proto/")) && i.length === 22, i, a];
4207
+ const a = ((e = t.searchParams.get("node-id")) != null ? e : "").replace(/-/g, ":"), i = r.split("/")[2];
4208
+ return [(r.startsWith("/file/") && t.searchParams.get("type") !== "whiteboard" || r.startsWith("/design/") || r.startsWith("/proto/")) && i.length === 22, i, a];
4203
4209
  } catch (t) {
4204
4210
  return [!1, "", ""];
4205
4211
  }
4206
4212
  }, ra = ({
4207
- fileKey: r,
4213
+ fileKey: s,
4208
4214
  nodeId: e,
4209
4215
  duplicate: t
4210
4216
  }) => {
4211
- const s = new URL("https://www.figma.com");
4212
- return s.pathname = `design/${r}`, t && (s.pathname = `${s.pathname}/dummy/duplicate`), e && s.searchParams.set("node-id", e.replace(":", "-")), s;
4217
+ const r = new URL("https://www.figma.com");
4218
+ return r.pathname = `design/${s}`, t && (r.pathname = `${r.pathname}/dummy/duplicate`), e && r.searchParams.set("node-id", e.replace(":", "-")), r;
4213
4219
  };
4214
- class sa extends Error {
4220
+ class na extends Error {
4215
4221
  constructor(e, t) {
4216
4222
  super(e), this.response = t;
4217
4223
  }
4218
4224
  }
4219
- const na = ({
4220
- files: r,
4225
+ const aa = ({
4226
+ files: s,
4221
4227
  screenPath: e = "src/screens"
4222
4228
  }) => {
4223
- const t = {}, s = /* @__PURE__ */ new Set();
4229
+ const t = {}, r = /* @__PURE__ */ new Set();
4224
4230
  function n(a) {
4225
- if (s.has(a) || !r[a])
4231
+ if (r.has(a) || !s[a])
4226
4232
  return;
4227
- s.add(a), t[a] = r[a], Wn(r[a].content).forEach((o) => {
4233
+ r.add(a), t[a] = s[a], Wn(s[a].content).forEach((o) => {
4228
4234
  try {
4229
4235
  const c = zn(a, o);
4230
4236
  if (c.startsWith("src/")) {
4231
- const d = c.split("/").slice(0, -1).join("/");
4232
- Bn(r, d).forEach((v) => {
4233
- s.has(v) || n(v);
4237
+ const u = c.split("/").slice(0, -1).join("/");
4238
+ Bn(s, u).forEach((v) => {
4239
+ r.has(v) || n(v);
4234
4240
  });
4235
4241
  }
4236
4242
  } catch (c) {
@@ -4241,45 +4247,45 @@ const na = ({
4241
4247
  }
4242
4248
  });
4243
4249
  }
4244
- return Object.entries(r).forEach(([a, i]) => {
4250
+ return Object.entries(s).forEach(([a, i]) => {
4245
4251
  a.startsWith(e) ? n(a) : a.startsWith("src/") || (t[a] = i);
4246
4252
  }), t;
4247
4253
  };
4248
- function Wn(r) {
4249
- const e = /import.*?["']([^"']+)["']/g, t = /export.*from\s+["']([^"']+)["']/g, s = [];
4254
+ function Wn(s) {
4255
+ const e = /import.*?["']([^"']+)["']/g, t = /export.*from\s+["']([^"']+)["']/g, r = [];
4250
4256
  let n;
4251
- for (; (n = e.exec(r)) !== null; )
4252
- s.push(n[1]);
4253
- for (; (n = t.exec(r)) !== null; )
4254
- s.push(n[1]);
4255
- return [...new Set(s)];
4257
+ for (; (n = e.exec(s)) !== null; )
4258
+ r.push(n[1]);
4259
+ for (; (n = t.exec(s)) !== null; )
4260
+ r.push(n[1]);
4261
+ return [...new Set(r)];
4256
4262
  }
4257
- function zn(r, e) {
4263
+ function zn(s, e) {
4258
4264
  if (!e.startsWith("."))
4259
4265
  return e;
4260
- const t = r.split("/").slice(0, -1), s = e.split("/"), n = [...t];
4261
- for (const a of s)
4266
+ const t = s.split("/").slice(0, -1), r = e.split("/"), n = [...t];
4267
+ for (const a of r)
4262
4268
  a === ".." ? n.pop() : a !== "." && n.push(a);
4263
4269
  return n.join("/");
4264
4270
  }
4265
- function Bn(r, e) {
4266
- return Object.keys(r).filter((t) => t.startsWith(e));
4271
+ function Bn(s, e) {
4272
+ return Object.keys(s).filter((t) => t.startsWith(e));
4267
4273
  }
4268
- function ht(r, e, t) {
4274
+ function ht(s, e, t) {
4269
4275
  return new ReadableStream({
4270
- start(s) {
4271
- t.call(r, e, (n) => {
4272
- n.type === "error" || s.enqueue(n), (n.type === "aborted" || n.type === "error") && s.close();
4276
+ start(r) {
4277
+ t.call(s, e, (n) => {
4278
+ n.type === "error" || r.enqueue(n), (n.type === "aborted" || n.type === "error") && r.close();
4273
4279
  }).then((n) => {
4274
- s.enqueue({
4280
+ r.enqueue({
4275
4281
  type: "done",
4276
4282
  payload: {
4277
4283
  tokenUsage: n.tokenUsage,
4278
4284
  sessionId: n.sessionId
4279
4285
  }
4280
- }), s.close();
4286
+ }), r.close();
4281
4287
  }).catch((n) => {
4282
- s.enqueue({
4288
+ r.enqueue({
4283
4289
  type: "error",
4284
4290
  payload: {
4285
4291
  name: "name" in n ? n.name : "Unknown error",
@@ -4288,19 +4294,19 @@ function ht(r, e, t) {
4288
4294
  detail: "detail" in n ? n.detail : void 0,
4289
4295
  errorPayload: "payload" in n ? n.payload : void 0
4290
4296
  }
4291
- }), s.close();
4297
+ }), r.close();
4292
4298
  });
4293
4299
  }
4294
4300
  });
4295
4301
  }
4296
- const qn = (r, e) => ht(r, e, r.generateCode);
4297
- function pt(r) {
4298
- return C(this, null, function* () {
4299
- var i, o, c, d;
4300
- const [e, t] = r.tee(), s = yield e.getReader().read();
4301
- if (s.done || !s.value || s.value.type === "error" && ((i = s.value.payload) != null && i.status))
4302
- return new Response(JSON.stringify(s.value), {
4303
- status: ((o = s.value) == null ? void 0 : o.type) === "error" && (d = (c = s.value.payload) == null ? void 0 : c.status) != null ? d : 500,
4302
+ const qn = (s, e) => ht(s, e, s.generateCode);
4303
+ function pt(s) {
4304
+ return I(this, null, function* () {
4305
+ var i, o, c, u;
4306
+ const [e, t] = s.tee(), r = yield e.getReader().read();
4307
+ if (r.done || !r.value || r.value.type === "error" && ((i = r.value.payload) != null && i.status))
4308
+ return new Response(JSON.stringify(r.value), {
4309
+ status: ((o = r.value) == null ? void 0 : o.type) === "error" && (u = (c = r.value.payload) == null ? void 0 : c.status) != null ? u : 500,
4304
4310
  headers: {
4305
4311
  "Content-Type": "application/json"
4306
4312
  }
@@ -4328,50 +4334,50 @@ data: ${JSON.stringify(
4328
4334
  });
4329
4335
  });
4330
4336
  }
4331
- const aa = (r, e) => C(void 0, null, function* () {
4332
- const t = qn(r, e);
4337
+ const ia = (s, e) => I(void 0, null, function* () {
4338
+ const t = qn(s, e);
4333
4339
  return pt(t);
4334
- }), Hn = (r, e) => ht(r, e, r.generateCodeFromWebsite), ia = (r, e) => C(void 0, null, function* () {
4335
- const t = Hn(r, e);
4340
+ }), Hn = (s, e) => ht(s, e, s.generateCodeFromWebsite), oa = (s, e) => I(void 0, null, function* () {
4341
+ const t = Hn(s, e);
4336
4342
  return pt(t);
4337
- }), Jn = (r, e) => ht(r, e, r.generateCodeFromPrompt), oa = (r, e) => C(void 0, null, function* () {
4338
- const t = Jn(r, e);
4343
+ }), Jn = (s, e) => ht(s, e, s.generateCodeFromPrompt), ca = (s, e) => I(void 0, null, function* () {
4344
+ const t = Jn(s, e);
4339
4345
  return pt(t);
4340
- }), Gn = (r, e) => ht(r, e, r.generateLink2Code), ca = (r, e) => C(void 0, null, function* () {
4341
- const t = Gn(r, e);
4346
+ }), Gn = (s, e) => ht(s, e, s.generateLink2Code), ua = (s, e) => I(void 0, null, function* () {
4347
+ const t = Gn(s, e);
4342
4348
  return pt(t);
4343
4349
  });
4344
4350
  export {
4345
- ea as Anima,
4346
- ye as CodegenError,
4347
- Ar as FigmaTokenIssue,
4348
- Or as NotFound,
4349
- Cr as RateLimitExceeded,
4350
- Ir as RequestTooLarge,
4351
- sa as ResponseError,
4352
- jr as UnknownFigmaApiException,
4353
- oa as createCodeFromPromptResponseEventStream,
4351
+ ta as Anima,
4352
+ me as CodegenError,
4353
+ As as FigmaTokenIssue,
4354
+ Os as NotFound,
4355
+ Cs as RateLimitExceeded,
4356
+ Is as RequestTooLarge,
4357
+ na as ResponseError,
4358
+ js as UnknownFigmaApiException,
4359
+ ca as createCodeFromPromptResponseEventStream,
4354
4360
  Jn as createCodeFromPromptStream,
4355
- ia as createCodeFromWebsiteResponseEventStream,
4361
+ oa as createCodeFromWebsiteResponseEventStream,
4356
4362
  Hn as createCodeFromWebsiteStream,
4357
- aa as createCodegenResponseEventStream,
4363
+ ia as createCodegenResponseEventStream,
4358
4364
  qn as createCodegenStream,
4359
- ca as createLink2CodeResponseEventStream,
4365
+ ua as createLink2CodeResponseEventStream,
4360
4366
  Gn as createLink2CodeStream,
4361
- ur as findChildrenNode,
4367
+ ds as findChildrenNode,
4362
4368
  ra as formatToFigmaLink,
4363
- Yn as getFigmaApiErrorType,
4364
- Os as getFigmaFile,
4365
- Qn as getFileNodes,
4366
- na as getRelatedScreenFiles,
4367
- Zr as isFigmaTokenIssue,
4369
+ Qn as getFigmaApiErrorType,
4370
+ Or as getFigmaFile,
4371
+ ea as getFileNodes,
4372
+ aa as getRelatedScreenFiles,
4373
+ Zs as isFigmaTokenIssue,
4368
4374
  Un as isNodeCodegenCompatible,
4369
- Nr as isNotFound,
4370
- Rr as isRateLimitExceeded,
4371
- Mr as isRequestTooLarge,
4372
- Xn as isUnknownFigmaApiException,
4373
- ta as isValidFigmaUrl,
4375
+ Ns as isNotFound,
4376
+ Rs as isRateLimitExceeded,
4377
+ Ms as isRequestTooLarge,
4378
+ Yn as isUnknownFigmaApiException,
4379
+ sa as isValidFigmaUrl,
4374
4380
  Vn as validateSettings,
4375
- nr as wrapFigmaApiError
4381
+ ns as wrapFigmaApiError
4376
4382
  };
4377
4383
  //# sourceMappingURL=index.js.map