@animaapp/anima-sdk-react 0.3.4 → 0.3.5
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.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +604 -559
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,14 +2,14 @@ var aa = Object.defineProperty, ia = Object.defineProperties;
|
|
|
2
2
|
var oa = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var Br = Object.getOwnPropertySymbols;
|
|
4
4
|
var ua = Object.prototype.hasOwnProperty, ca = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var
|
|
5
|
+
var Kr = (t, e, n) => e in t ? aa(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Be = (t, e) => {
|
|
6
6
|
for (var n in e || (e = {}))
|
|
7
|
-
ua.call(e, n) &&
|
|
7
|
+
ua.call(e, n) && Kr(t, n, e[n]);
|
|
8
8
|
if (Br)
|
|
9
9
|
for (var n of Br(e))
|
|
10
|
-
ca.call(e, n) &&
|
|
10
|
+
ca.call(e, n) && Kr(t, n, e[n]);
|
|
11
11
|
return t;
|
|
12
|
-
},
|
|
12
|
+
}, qr = (t, e) => ia(t, oa(e));
|
|
13
13
|
var Ie = (t, e, n) => new Promise((r, s) => {
|
|
14
14
|
var a = (u) => {
|
|
15
15
|
try {
|
|
@@ -26,7 +26,7 @@ var Ie = (t, e, n) => new Promise((r, s) => {
|
|
|
26
26
|
}, o = (u) => u.done ? r(u.value) : Promise.resolve(u.value).then(a, i);
|
|
27
27
|
o((n = n.apply(t, e)).next());
|
|
28
28
|
});
|
|
29
|
-
import Gt, { useState as da, useCallback as an, createContext as la, useEffect as fa, useLayoutEffect as ha, useContext as pa, useRef as
|
|
29
|
+
import Gt, { useState as da, useCallback as an, createContext as la, useEffect as fa, useLayoutEffect as ha, useContext as pa, useRef as Ke, useMemo as ma, useDebugValue as ya } from "react";
|
|
30
30
|
const ga = (t) => {
|
|
31
31
|
let e = "";
|
|
32
32
|
const n = new Uint8Array(t), r = n.byteLength;
|
|
@@ -34,14 +34,14 @@ const ga = (t) => {
|
|
|
34
34
|
e += String.fromCharCode(n[s]);
|
|
35
35
|
return btoa(e);
|
|
36
36
|
};
|
|
37
|
-
var _a = Object.defineProperty, va = Object.defineProperties, ba = Object.getOwnPropertyDescriptors,
|
|
37
|
+
var _a = Object.defineProperty, va = Object.defineProperties, ba = Object.getOwnPropertyDescriptors, Hr = Object.getOwnPropertySymbols, wa = Object.prototype.hasOwnProperty, ka = Object.prototype.propertyIsEnumerable, Gr = (t, e, n) => e in t ? _a(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, d = (t, e) => {
|
|
38
38
|
for (var n in e || (e = {}))
|
|
39
39
|
wa.call(e, n) && Gr(t, n, e[n]);
|
|
40
|
-
if (
|
|
41
|
-
for (var n of
|
|
40
|
+
if (Hr)
|
|
41
|
+
for (var n of Hr(e))
|
|
42
42
|
ka.call(e, n) && Gr(t, n, e[n]);
|
|
43
43
|
return t;
|
|
44
|
-
},
|
|
44
|
+
}, E = (t, e) => va(t, ba(e)), ke = (t, e, n) => new Promise((r, s) => {
|
|
45
45
|
var a = (u) => {
|
|
46
46
|
try {
|
|
47
47
|
o(n.next(u));
|
|
@@ -67,16 +67,61 @@ class Jr extends Error {
|
|
|
67
67
|
super(), this.name = e, this.message = n, this.detail = s, this.status = r;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
|
|
70
|
+
const xa = "Figma Token Issue";
|
|
71
|
+
class Ea extends Error {
|
|
72
|
+
constructor({
|
|
73
|
+
fileKey: e,
|
|
74
|
+
reason: n,
|
|
75
|
+
cause: r
|
|
76
|
+
}) {
|
|
77
|
+
super(xa), this.fileKey = e, this.reason = n, this.cause = r;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const Sa = "Rate Limit Exceeded";
|
|
81
|
+
class Oa extends Error {
|
|
82
|
+
constructor({ fileKey: e, cause: n }) {
|
|
83
|
+
super(Sa), this.fileKey = e, this.cause = n;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const Ta = "Not Found";
|
|
87
|
+
class Aa extends Error {
|
|
88
|
+
constructor({ fileKey: e, cause: n }) {
|
|
89
|
+
super(Ta), this.fileKey = e, this.cause = n;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
const Ca = "Unknown Figma API Exception";
|
|
93
|
+
class Na extends Error {
|
|
94
|
+
constructor({ fileKey: e, cause: n }) {
|
|
95
|
+
super(Ca), this.name = "UnknownFigmaApiException", this.fileKey = e, this.cause = n;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
const Pa = (t, e) => {
|
|
99
|
+
var n;
|
|
100
|
+
if (((n = t == null ? void 0 : t.cause) == null ? void 0 : n.message) === "Fetch Error") {
|
|
101
|
+
const { err: r, status: s } = t.cause.body;
|
|
102
|
+
if (s === 403)
|
|
103
|
+
return new Ea({
|
|
104
|
+
fileKey: e,
|
|
105
|
+
reason: r,
|
|
106
|
+
cause: t
|
|
107
|
+
});
|
|
108
|
+
if (s === 429)
|
|
109
|
+
return new Oa({ fileKey: e, cause: t });
|
|
110
|
+
if (s === 404)
|
|
111
|
+
return new Aa({ fileKey: e, cause: t });
|
|
112
|
+
}
|
|
113
|
+
return new Na({ fileKey: e, cause: t });
|
|
114
|
+
};
|
|
115
|
+
var Ra = Object.defineProperty, Ia = Object.defineProperties, ja = Object.getOwnPropertyDescriptors, Xr = Object.getOwnPropertySymbols, Za = Object.prototype.hasOwnProperty, Da = Object.prototype.propertyIsEnumerable, Yr = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), Os = (t) => {
|
|
71
116
|
throw TypeError(t);
|
|
72
|
-
}, Qr = (t, e, n) => e in t ?
|
|
117
|
+
}, Qr = (t, e, n) => e in t ? Ra(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, ae = (t, e) => {
|
|
73
118
|
for (var n in e || (e = {}))
|
|
74
|
-
|
|
119
|
+
Za.call(e, n) && Qr(t, n, e[n]);
|
|
75
120
|
if (Xr)
|
|
76
121
|
for (var n of Xr(e))
|
|
77
|
-
|
|
122
|
+
Da.call(e, n) && Qr(t, n, e[n]);
|
|
78
123
|
return t;
|
|
79
|
-
},
|
|
124
|
+
}, Ar = (t, e) => Ia(t, ja(e)), Cr = (t, e, n) => e.has(t) || Os("Cannot " + n), R = (t, e, n) => (Cr(t, e, "read from private field"), n ? n.call(t) : e.get(t)), de = (t, e, n) => e.has(t) ? Os("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), J = (t, e, n, r) => (Cr(t, e, "write to private field"), e.set(t, n), n), ve = (t, e, n) => (Cr(t, e, "access private method"), n), U = (t, e, n) => new Promise((r, s) => {
|
|
80
125
|
var a = (u) => {
|
|
81
126
|
try {
|
|
82
127
|
o(n.next(u));
|
|
@@ -91,18 +136,18 @@ var Ea = Object.defineProperty, xa = Object.defineProperties, Sa = Object.getOwn
|
|
|
91
136
|
}
|
|
92
137
|
}, o = (u) => u.done ? r(u.value) : Promise.resolve(u.value).then(a, i);
|
|
93
138
|
o((n = n.apply(t, e)).next());
|
|
94
|
-
}),
|
|
95
|
-
function
|
|
139
|
+
}), Ma = (t, e, n) => (e = t[Yr("asyncIterator")]) ? e.call(t) : (t = t[Yr("iterator")](), e = {}, n = (r, s) => (s = t[r]) && (e[r] = (a) => new Promise((i, o, u) => (a = s.call(t, a), u = a.done, Promise.resolve(a.value).then((c) => i({ value: c, done: u }), o)))), n("next"), n("return"), e), La = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};
|
|
140
|
+
function $a(t) {
|
|
96
141
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
97
142
|
}
|
|
98
|
-
var
|
|
99
|
-
function
|
|
143
|
+
var qn = { exports: {} }, Fa = qn.exports, es;
|
|
144
|
+
function Wa() {
|
|
100
145
|
return es || (es = 1, function(t, e) {
|
|
101
146
|
(function(n, r) {
|
|
102
147
|
t.exports = r();
|
|
103
|
-
})(
|
|
104
|
-
var n = typeof Promise == "function", r = typeof self == "object" ? self :
|
|
105
|
-
function
|
|
148
|
+
})(Fa, function() {
|
|
149
|
+
var n = typeof Promise == "function", r = typeof self == "object" ? self : La, s = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", u = typeof WeakSet != "undefined", c = typeof DataView != "undefined", h = s && typeof Symbol.iterator != "undefined", p = s && typeof Symbol.toStringTag != "undefined", k = i && typeof Set.prototype.entries == "function", _ = a && typeof Map.prototype.entries == "function", b = k && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), l = _ && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), y = h && typeof Array.prototype[Symbol.iterator] == "function", m = y && Object.getPrototypeOf([][Symbol.iterator]()), $ = h && typeof String.prototype[Symbol.iterator] == "function", P = $ && Object.getPrototypeOf(""[Symbol.iterator]()), z = 8, D = -1;
|
|
150
|
+
function K(I) {
|
|
106
151
|
var F = typeof I;
|
|
107
152
|
if (F !== "object")
|
|
108
153
|
return F;
|
|
@@ -138,12 +183,12 @@ function Ra() {
|
|
|
138
183
|
var M = Object.getPrototypeOf(I);
|
|
139
184
|
return M === RegExp.prototype ? "RegExp" : M === Date.prototype ? "Date" : n && M === Promise.prototype ? "Promise" : i && M === Set.prototype ? "Set" : a && M === Map.prototype ? "Map" : u && M === WeakSet.prototype ? "WeakSet" : o && M === WeakMap.prototype ? "WeakMap" : c && M === DataView.prototype ? "DataView" : a && M === l ? "Map Iterator" : i && M === b ? "Set Iterator" : y && M === m ? "Array Iterator" : $ && M === P ? "String Iterator" : M === null ? "Object" : Object.prototype.toString.call(I).slice(z, D);
|
|
140
185
|
}
|
|
141
|
-
return
|
|
186
|
+
return K;
|
|
142
187
|
});
|
|
143
|
-
}(
|
|
188
|
+
}(qn)), qn.exports;
|
|
144
189
|
}
|
|
145
|
-
var
|
|
146
|
-
const
|
|
190
|
+
var za = Wa();
|
|
191
|
+
const Va = /* @__PURE__ */ $a(za), Nr = typeof Buffer != "undefined", Ua = Nr && typeof Buffer.from != "undefined", Ba = Nr ? (
|
|
147
192
|
/**
|
|
148
193
|
* is value is Buffer?
|
|
149
194
|
*
|
|
@@ -164,7 +209,7 @@ const ja = /* @__PURE__ */ Na(Ia), Nr = typeof Buffer != "undefined", Za = Nr &&
|
|
|
164
209
|
function() {
|
|
165
210
|
return !1;
|
|
166
211
|
}
|
|
167
|
-
),
|
|
212
|
+
), Ka = Ua ? (
|
|
168
213
|
/**
|
|
169
214
|
* copy Buffer
|
|
170
215
|
*
|
|
@@ -200,16 +245,16 @@ const ja = /* @__PURE__ */ Na(Ia), Nr = typeof Buffer != "undefined", Za = Nr &&
|
|
|
200
245
|
}
|
|
201
246
|
);
|
|
202
247
|
function mt(t) {
|
|
203
|
-
return
|
|
248
|
+
return Ba(t) ? "Buffer" : Va(t);
|
|
204
249
|
}
|
|
205
|
-
const
|
|
250
|
+
const qa = /* @__PURE__ */ new Set([
|
|
206
251
|
"Arguments",
|
|
207
252
|
"Array",
|
|
208
253
|
"Map",
|
|
209
254
|
"Object",
|
|
210
255
|
"Set"
|
|
211
256
|
]);
|
|
212
|
-
function
|
|
257
|
+
function Ha(t, e, n = null) {
|
|
213
258
|
switch (n || mt(t)) {
|
|
214
259
|
case "Arguments":
|
|
215
260
|
case "Array":
|
|
@@ -221,8 +266,8 @@ function $a(t, e, n = null) {
|
|
|
221
266
|
return e;
|
|
222
267
|
}
|
|
223
268
|
}
|
|
224
|
-
function
|
|
225
|
-
return
|
|
269
|
+
function Hn(t) {
|
|
270
|
+
return qa.has(t);
|
|
226
271
|
}
|
|
227
272
|
function ts(t, e, n, r = null) {
|
|
228
273
|
switch (r || mt(t)) {
|
|
@@ -240,32 +285,32 @@ function ts(t, e, n, r = null) {
|
|
|
240
285
|
}
|
|
241
286
|
return t;
|
|
242
287
|
}
|
|
243
|
-
const
|
|
244
|
-
function
|
|
288
|
+
const Ga = typeof globalThis != "undefined" && globalThis !== null && globalThis.Object === Object && globalThis, Ja = typeof global != "undefined" && global !== null && global.Object === Object && global, Xa = typeof self != "undefined" && self !== null && self.Object === Object && self, Rn = Ga || Ja || Xa || Function("return this")();
|
|
289
|
+
function Ya(t) {
|
|
245
290
|
return t.slice(0);
|
|
246
291
|
}
|
|
247
|
-
function
|
|
292
|
+
function Qa(t) {
|
|
248
293
|
return new Boolean(t.valueOf());
|
|
249
294
|
}
|
|
250
|
-
function
|
|
295
|
+
function ei(t) {
|
|
251
296
|
return new DataView(t.buffer);
|
|
252
297
|
}
|
|
253
|
-
function
|
|
254
|
-
return
|
|
298
|
+
function ti(t) {
|
|
299
|
+
return Ka(t);
|
|
255
300
|
}
|
|
256
|
-
function
|
|
301
|
+
function ni(t) {
|
|
257
302
|
return new Date(t.getTime());
|
|
258
303
|
}
|
|
259
|
-
function
|
|
304
|
+
function ri(t) {
|
|
260
305
|
return new Number(t);
|
|
261
306
|
}
|
|
262
|
-
function
|
|
307
|
+
function si(t) {
|
|
263
308
|
return new RegExp(t.source, t.flags);
|
|
264
309
|
}
|
|
265
|
-
function
|
|
310
|
+
function ai(t) {
|
|
266
311
|
return new String(t);
|
|
267
312
|
}
|
|
268
|
-
function
|
|
313
|
+
function Ae(t, e) {
|
|
269
314
|
return Rn[e].from ? Rn[e].from(t) : new Rn[e](t);
|
|
270
315
|
}
|
|
271
316
|
function Q(t) {
|
|
@@ -274,36 +319,36 @@ function Q(t) {
|
|
|
274
319
|
function ns() {
|
|
275
320
|
return [];
|
|
276
321
|
}
|
|
277
|
-
function
|
|
322
|
+
function ii() {
|
|
278
323
|
return /* @__PURE__ */ new Map();
|
|
279
324
|
}
|
|
280
|
-
function
|
|
325
|
+
function oi() {
|
|
281
326
|
return {};
|
|
282
327
|
}
|
|
283
|
-
function
|
|
328
|
+
function ui() {
|
|
284
329
|
return /* @__PURE__ */ new Set();
|
|
285
330
|
}
|
|
286
|
-
const
|
|
331
|
+
const ci = /* @__PURE__ */ new Map([
|
|
287
332
|
// deep copy
|
|
288
|
-
["ArrayBuffer",
|
|
289
|
-
["Boolean",
|
|
290
|
-
["Buffer",
|
|
291
|
-
["DataView",
|
|
292
|
-
["Date",
|
|
293
|
-
["Number",
|
|
294
|
-
["RegExp",
|
|
295
|
-
["String",
|
|
333
|
+
["ArrayBuffer", Ya],
|
|
334
|
+
["Boolean", Qa],
|
|
335
|
+
["Buffer", ti],
|
|
336
|
+
["DataView", ei],
|
|
337
|
+
["Date", ni],
|
|
338
|
+
["Number", ri],
|
|
339
|
+
["RegExp", si],
|
|
340
|
+
["String", ai],
|
|
296
341
|
// typed arrays
|
|
297
342
|
// TODO: pass bound function
|
|
298
|
-
["Float32Array",
|
|
299
|
-
["Float64Array",
|
|
300
|
-
["Int16Array",
|
|
301
|
-
["Int32Array",
|
|
302
|
-
["Int8Array",
|
|
303
|
-
["Uint16Array",
|
|
304
|
-
["Uint32Array",
|
|
305
|
-
["Uint8Array",
|
|
306
|
-
["Uint8ClampedArray",
|
|
343
|
+
["Float32Array", Ae],
|
|
344
|
+
["Float64Array", Ae],
|
|
345
|
+
["Int16Array", Ae],
|
|
346
|
+
["Int32Array", Ae],
|
|
347
|
+
["Int8Array", Ae],
|
|
348
|
+
["Uint16Array", Ae],
|
|
349
|
+
["Uint32Array", Ae],
|
|
350
|
+
["Uint8Array", Ae],
|
|
351
|
+
["Uint8ClampedArray", Ae],
|
|
307
352
|
// shallow copy
|
|
308
353
|
["Array Iterator", Q],
|
|
309
354
|
["Map Iterator", Q],
|
|
@@ -326,9 +371,9 @@ const ei = /* @__PURE__ */ new Map([
|
|
|
326
371
|
// NOTE: return empty value, because recursively copy later.
|
|
327
372
|
["Arguments", ns],
|
|
328
373
|
["Array", ns],
|
|
329
|
-
["Map",
|
|
330
|
-
["Object",
|
|
331
|
-
["Set",
|
|
374
|
+
["Map", ii],
|
|
375
|
+
["Object", oi],
|
|
376
|
+
["Set", ui]
|
|
332
377
|
// NOTE: type-detect returns following types
|
|
333
378
|
// 'Location'
|
|
334
379
|
// 'Document'
|
|
@@ -340,11 +385,11 @@ const ei = /* @__PURE__ */ new Map([
|
|
|
340
385
|
// TODO: is type-detect never return 'object'?
|
|
341
386
|
// 'object'
|
|
342
387
|
]);
|
|
343
|
-
function
|
|
388
|
+
function di() {
|
|
344
389
|
}
|
|
345
|
-
function Gn(t, e = null, n =
|
|
390
|
+
function Gn(t, e = null, n = di) {
|
|
346
391
|
arguments.length === 2 && typeof e == "function" && (n = e, e = null);
|
|
347
|
-
const r = e || mt(t), s =
|
|
392
|
+
const r = e || mt(t), s = ci.get(r);
|
|
348
393
|
if (r === "Object") {
|
|
349
394
|
const a = n(t, r);
|
|
350
395
|
if (a !== void 0)
|
|
@@ -362,14 +407,14 @@ function kt(t, e = {}) {
|
|
|
362
407
|
// TODO: max depth
|
|
363
408
|
// depth = Infinity,
|
|
364
409
|
} = e, r = mt(t);
|
|
365
|
-
if (!
|
|
410
|
+
if (!Hn(r))
|
|
366
411
|
return Jn(t, null, null, null);
|
|
367
412
|
const s = Gn(t, r, n), a = new WeakMap([[t, s]]), i = new WeakSet([t]);
|
|
368
413
|
return Jn(t, s, a, i);
|
|
369
414
|
}
|
|
370
415
|
function Jn(t, e, n, r, s) {
|
|
371
416
|
const a = mt(t), i = Gn(t, a);
|
|
372
|
-
if (!
|
|
417
|
+
if (!Hn(a))
|
|
373
418
|
return i;
|
|
374
419
|
let o;
|
|
375
420
|
switch (a) {
|
|
@@ -386,12 +431,12 @@ function Jn(t, e, n, r, s) {
|
|
|
386
431
|
break;
|
|
387
432
|
}
|
|
388
433
|
for (let u of o) {
|
|
389
|
-
const c =
|
|
434
|
+
const c = Ha(t, u, a);
|
|
390
435
|
if (r.has(c))
|
|
391
436
|
ts(e, u, n.get(c), a);
|
|
392
437
|
else {
|
|
393
438
|
const h = mt(c), p = Gn(c, h);
|
|
394
|
-
|
|
439
|
+
Hn(h) && (n.set(c, p), r.add(c)), ts(
|
|
395
440
|
e,
|
|
396
441
|
u,
|
|
397
442
|
Jn(
|
|
@@ -406,36 +451,36 @@ function Jn(t, e, n, r, s) {
|
|
|
406
451
|
}
|
|
407
452
|
return e;
|
|
408
453
|
}
|
|
409
|
-
const
|
|
410
|
-
var on,
|
|
411
|
-
class
|
|
454
|
+
const li = (t) => new Promise((e) => setTimeout(e, t));
|
|
455
|
+
var on, He, un, Xn, Ts;
|
|
456
|
+
class fi {
|
|
412
457
|
constructor({ maxAttempts: e = 3, func: n }) {
|
|
413
|
-
de(this, Xn), de(this, on), de(this,
|
|
458
|
+
de(this, Xn), de(this, on), de(this, He), de(this, un), J(this, on, e), J(this, un, n), J(this, He, 0);
|
|
414
459
|
}
|
|
415
460
|
run() {
|
|
416
461
|
return U(this, null, function* () {
|
|
417
462
|
try {
|
|
418
463
|
return yield R(this, un).call(this);
|
|
419
464
|
} catch (e) {
|
|
420
|
-
if (J(this,
|
|
465
|
+
if (J(this, He, R(this, He) + 1), R(this, He) > R(this, on))
|
|
421
466
|
throw console.error("Max attempts reached"), e;
|
|
422
467
|
const n = ve(this, Xn, Ts).call(this);
|
|
423
|
-
return yield
|
|
468
|
+
return yield li(n), yield this.run();
|
|
424
469
|
}
|
|
425
470
|
});
|
|
426
471
|
}
|
|
427
472
|
}
|
|
428
|
-
on = /* @__PURE__ */ new WeakMap(),
|
|
429
|
-
return R(this,
|
|
473
|
+
on = /* @__PURE__ */ new WeakMap(), He = /* @__PURE__ */ new WeakMap(), un = /* @__PURE__ */ new WeakMap(), Xn = /* @__PURE__ */ new WeakSet(), Ts = function() {
|
|
474
|
+
return R(this, He) * 1e3 * 1.5;
|
|
430
475
|
};
|
|
431
|
-
function
|
|
476
|
+
function hi() {
|
|
432
477
|
return typeof CompressionStream != "undefined";
|
|
433
478
|
}
|
|
434
|
-
function
|
|
479
|
+
function pi(t) {
|
|
435
480
|
return U(this, null, function* () {
|
|
436
481
|
const e = new Blob([t]).stream().pipeThrough(new CompressionStream("gzip")), n = [];
|
|
437
482
|
try {
|
|
438
|
-
for (var r =
|
|
483
|
+
for (var r = Ma(e), s, a, i; s = !(a = yield r.next()).done; s = !1) {
|
|
439
484
|
const o = a.value;
|
|
440
485
|
n.push(o);
|
|
441
486
|
}
|
|
@@ -449,16 +494,16 @@ function ai(t) {
|
|
|
449
494
|
throw i[0];
|
|
450
495
|
}
|
|
451
496
|
}
|
|
452
|
-
return yield
|
|
497
|
+
return yield mi(n);
|
|
453
498
|
});
|
|
454
499
|
}
|
|
455
|
-
function
|
|
500
|
+
function mi(t) {
|
|
456
501
|
return U(this, null, function* () {
|
|
457
502
|
const e = yield new Blob(t).arrayBuffer();
|
|
458
503
|
return new Uint8Array(e);
|
|
459
504
|
});
|
|
460
505
|
}
|
|
461
|
-
class
|
|
506
|
+
class yi extends Error {
|
|
462
507
|
constructor({ resource: e, api: n, args: r, cause: s }) {
|
|
463
508
|
if (super(`API Error on resource "${e}" at api "${n}"`), this.causeProperties = {}, this.name = "API Error", this.resource = e, this.api = n, this.cause = s, this.args = r, s instanceof Error)
|
|
464
509
|
for (const [i, o] of Object.entries(s))
|
|
@@ -491,13 +536,13 @@ class rs extends Error {
|
|
|
491
536
|
}
|
|
492
537
|
}
|
|
493
538
|
}
|
|
494
|
-
class
|
|
539
|
+
class xt extends Error {
|
|
495
540
|
constructor(e = {}) {
|
|
496
541
|
const { canceled: n = !1 } = e;
|
|
497
542
|
super("Abort Error"), this.name = "Abort Error", this.canceled = n;
|
|
498
543
|
}
|
|
499
544
|
}
|
|
500
|
-
class
|
|
545
|
+
class gi extends Error {
|
|
501
546
|
constructor(e) {
|
|
502
547
|
super(`Async API Error: ${JSON.stringify(e)}`), this.name = "Async API Error", this.body = e;
|
|
503
548
|
}
|
|
@@ -507,7 +552,7 @@ class In extends Error {
|
|
|
507
552
|
super(e), this.name = "Request Validation Error";
|
|
508
553
|
}
|
|
509
554
|
}
|
|
510
|
-
function
|
|
555
|
+
function As() {
|
|
511
556
|
return Array.from(
|
|
512
557
|
{ length: 32 },
|
|
513
558
|
() => Math.floor(Math.random() * 256).toString(16).padStart(2, "0")
|
|
@@ -516,9 +561,9 @@ function Cs() {
|
|
|
516
561
|
function Yn() {
|
|
517
562
|
return Math.floor(Date.now() / 1e3).toString();
|
|
518
563
|
}
|
|
519
|
-
const
|
|
520
|
-
var Ge, ne, ge, Qn, er,
|
|
521
|
-
class
|
|
564
|
+
const _i = 5 * 60 * 1e3, vi = 1 * 1e3;
|
|
565
|
+
var Ge, ne, ge, Qn, er, Et;
|
|
566
|
+
class bi {
|
|
522
567
|
constructor({ fetch: e = globalThis.fetch.bind(globalThis), baseAddress: n }) {
|
|
523
568
|
de(this, ge), de(this, Ge), de(this, ne), this.baseAddress = n, J(this, Ge, e), J(this, ne, {}), this.plugins = [];
|
|
524
569
|
}
|
|
@@ -539,31 +584,31 @@ class li {
|
|
|
539
584
|
const { overrideBaseAddress: s, overrideDefaultHeaders: a } = r, i = s != null ? s : this.baseAddress;
|
|
540
585
|
let o = a != null ? a : this.headers;
|
|
541
586
|
const u = kt(R(this, ne));
|
|
542
|
-
return J(this, ne, {}), u.extraHeaders && (o = ae(ae({}, o), u.extraHeaders)), u.requestValidation && (o =
|
|
587
|
+
return J(this, ne, {}), u.extraHeaders && (o = ae(ae({}, o), u.extraHeaders)), u.requestValidation && (o = Ar(ae({}, o), { "X-Request-Nonce": As(), "X-Request-Timestamp": Yn() })), u.async ? yield ve(this, ge, er).call(this, `${i}${n}`, u.async, { headers: o }) : yield ve(this, ge, Qn).call(this, `${i}${n}`, u, { headers: o });
|
|
543
588
|
});
|
|
544
589
|
}
|
|
545
590
|
post(e, n) {
|
|
546
591
|
return U(this, arguments, function* (r, s, a = {}) {
|
|
547
592
|
const i = kt(R(this, ne));
|
|
548
|
-
return J(this, ne, {}), ve(this, ge,
|
|
593
|
+
return J(this, ne, {}), ve(this, ge, Et).call(this, r, "POST", s, a, i);
|
|
549
594
|
});
|
|
550
595
|
}
|
|
551
596
|
put(e, n) {
|
|
552
597
|
return U(this, arguments, function* (r, s, a = {}) {
|
|
553
598
|
const i = kt(R(this, ne));
|
|
554
|
-
return J(this, ne, {}), ve(this, ge,
|
|
599
|
+
return J(this, ne, {}), ve(this, ge, Et).call(this, r, "PUT", s, a, i);
|
|
555
600
|
});
|
|
556
601
|
}
|
|
557
602
|
delete(e, n) {
|
|
558
603
|
return U(this, arguments, function* (r, s, a = {}) {
|
|
559
604
|
const i = kt(R(this, ne));
|
|
560
|
-
return J(this, ne, {}), ve(this, ge,
|
|
605
|
+
return J(this, ne, {}), ve(this, ge, Et).call(this, r, "DELETE", s, a, i);
|
|
561
606
|
});
|
|
562
607
|
}
|
|
563
608
|
patch(e, n) {
|
|
564
609
|
return U(this, arguments, function* (r, s, a = {}) {
|
|
565
610
|
const i = kt(R(this, ne));
|
|
566
|
-
return J(this, ne, {}), ve(this, ge,
|
|
611
|
+
return J(this, ne, {}), ve(this, ge, Et).call(this, r, "PATCH", s, a, i);
|
|
567
612
|
});
|
|
568
613
|
}
|
|
569
614
|
}
|
|
@@ -574,7 +619,7 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
|
|
|
574
619
|
try {
|
|
575
620
|
return yield R(this, Ge).call(this, t, ae(ae({}, n), e.abortSignal && { signal: e.abortSignal }));
|
|
576
621
|
} catch (h) {
|
|
577
|
-
throw h instanceof Error && h.name === "AbortError" ? new
|
|
622
|
+
throw h instanceof Error && h.name === "AbortError" ? new xt({ canceled: (c = (u = e.abortSignal) == null ? void 0 : u.aborted) != null ? c : !1 }) : h;
|
|
578
623
|
}
|
|
579
624
|
}), { headers: s } = n != null ? n : {}, a = (u, c) => {
|
|
580
625
|
var h, p;
|
|
@@ -612,7 +657,7 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
|
|
|
612
657
|
return h;
|
|
613
658
|
});
|
|
614
659
|
if (e.retry) {
|
|
615
|
-
const u = yield new
|
|
660
|
+
const u = yield new fi({
|
|
616
661
|
maxAttempts: e.retry,
|
|
617
662
|
func: r
|
|
618
663
|
}).run();
|
|
@@ -627,14 +672,14 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
|
|
|
627
672
|
const {
|
|
628
673
|
onProgress: a,
|
|
629
674
|
abortSignal: i,
|
|
630
|
-
pollingInterval: o = () =>
|
|
631
|
-
maxTimeout: u =
|
|
675
|
+
pollingInterval: o = () => vi,
|
|
676
|
+
maxTimeout: u = _i
|
|
632
677
|
} = e, c = `${t}/async`, h = `${t}/async/job`;
|
|
633
678
|
let p;
|
|
634
679
|
try {
|
|
635
680
|
p = yield R(this, Ge).call(this, c, ae(ae({}, n), i && { signal: i }));
|
|
636
681
|
} catch (b) {
|
|
637
|
-
throw b instanceof Error && b.name === "AbortError" ? new
|
|
682
|
+
throw b instanceof Error && b.name === "AbortError" ? new xt({ canceled: (r = i == null ? void 0 : i.aborted) != null ? r : !1 }) : b;
|
|
638
683
|
}
|
|
639
684
|
if (!p.ok) {
|
|
640
685
|
const b = yield p.text().catch();
|
|
@@ -656,9 +701,9 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
|
|
|
656
701
|
}, u), m = ($ = 0) => U(this, null, function* () {
|
|
657
702
|
if (i != null && i.aborted) {
|
|
658
703
|
clearTimeout(y), R(this, Ge).call(this, `${h}/${_}/cancel`, { method: "POST", headers: this.headers }).then(() => {
|
|
659
|
-
l(new
|
|
704
|
+
l(new xt({ canceled: !0 }));
|
|
660
705
|
}).catch((P) => {
|
|
661
|
-
l(new
|
|
706
|
+
l(new xt({ canceled: !1 }));
|
|
662
707
|
});
|
|
663
708
|
return;
|
|
664
709
|
}
|
|
@@ -669,7 +714,7 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
|
|
|
669
714
|
const z = P.response_json;
|
|
670
715
|
b(z);
|
|
671
716
|
} else if (P.status === "failed")
|
|
672
|
-
clearTimeout(y), l(new
|
|
717
|
+
clearTimeout(y), l(new gi(P.response_json));
|
|
673
718
|
else {
|
|
674
719
|
a && a(P.response_json);
|
|
675
720
|
const z = o($);
|
|
@@ -682,20 +727,20 @@ Ge = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), ge = /*
|
|
|
682
727
|
m();
|
|
683
728
|
}));
|
|
684
729
|
});
|
|
685
|
-
},
|
|
730
|
+
}, Et = function(t, e, n, r, s) {
|
|
686
731
|
return U(this, null, function* () {
|
|
687
732
|
const { overrideBaseAddress: a, overrideDefaultHeaders: i } = r, o = a != null ? a : this.baseAddress;
|
|
688
733
|
let u = i != null ? i : this.headers;
|
|
689
|
-
s.extraHeaders && (u = ae(ae({}, u), s.extraHeaders)), s.requestValidation && (u =
|
|
734
|
+
s.extraHeaders && (u = ae(ae({}, u), s.extraHeaders)), s.requestValidation && (u = Ar(ae({}, u), { "X-Request-Nonce": As(), "X-Request-Timestamp": Yn() }));
|
|
690
735
|
let c = r.skipBodyJsonStringify ? n : JSON.stringify(n);
|
|
691
|
-
return s.compress &&
|
|
736
|
+
return s.compress && hi() && (u["Content-Encoding"] = "gzip", c = yield pi(c)), s.async ? yield ve(this, ge, er).call(this, `${o}${t}`, s.async, {
|
|
692
737
|
method: e,
|
|
693
738
|
headers: u,
|
|
694
739
|
body: c
|
|
695
740
|
}) : yield ve(this, ge, Qn).call(this, `${o}${t}`, s, { method: e, headers: u, body: c });
|
|
696
741
|
});
|
|
697
742
|
};
|
|
698
|
-
const ss = (t, e, n, r) => t instanceof
|
|
743
|
+
const ss = (t, e, n, r) => t instanceof xt ? t : new yi({ resource: e, api: String(n), args: r, cause: t }), jn = (t, e) => new Proxy(e, {
|
|
699
744
|
get(n, r) {
|
|
700
745
|
return (...s) => {
|
|
701
746
|
var a;
|
|
@@ -717,7 +762,7 @@ const ss = (t, e, n, r) => t instanceof Et ? t : new oi({ resource: e, api: Stri
|
|
|
717
762
|
}
|
|
718
763
|
});
|
|
719
764
|
var St;
|
|
720
|
-
class
|
|
765
|
+
class wi {
|
|
721
766
|
constructor(e) {
|
|
722
767
|
de(this, St), this.resourceName = "Files", J(this, St, e);
|
|
723
768
|
}
|
|
@@ -738,12 +783,12 @@ class fi {
|
|
|
738
783
|
}
|
|
739
784
|
}
|
|
740
785
|
St = /* @__PURE__ */ new WeakMap();
|
|
741
|
-
const
|
|
786
|
+
const ki = (t, e, n) => {
|
|
742
787
|
const r = e.sort();
|
|
743
788
|
return `${t}-${r.join("-")}-${n}`;
|
|
744
|
-
},
|
|
745
|
-
var _e, tr,
|
|
746
|
-
class
|
|
789
|
+
}, xi = (t) => t ? t.ts > Date.now() - 1e3 * 30 : !1;
|
|
790
|
+
var _e, tr, Cs;
|
|
791
|
+
class Ei {
|
|
747
792
|
constructor(e) {
|
|
748
793
|
de(this, tr), de(this, _e), this.resourceName = "Images", J(this, _e, e);
|
|
749
794
|
}
|
|
@@ -753,14 +798,14 @@ class mi {
|
|
|
753
798
|
*/
|
|
754
799
|
get(e) {
|
|
755
800
|
return U(this, arguments, function* ({ fileKey: n, nodeIds: r, format: s = "jpg", scale: a }) {
|
|
756
|
-
const i =
|
|
757
|
-
if (
|
|
801
|
+
const i = ki(n, r, s), o = R(this, _e).cache.images.entries.get(i);
|
|
802
|
+
if (xi(o))
|
|
758
803
|
return o.result;
|
|
759
804
|
o && R(this, _e).cache.images.entries.delete(i);
|
|
760
805
|
const u = R(this, _e).cache.images.pendingRequests.get(i);
|
|
761
806
|
if (u)
|
|
762
807
|
return u;
|
|
763
|
-
const c = ve(this, tr,
|
|
808
|
+
const c = ve(this, tr, Cs).call(this, i, n, r, s, a);
|
|
764
809
|
R(this, _e).cache.images.pendingRequests.set(i, c);
|
|
765
810
|
try {
|
|
766
811
|
return yield c;
|
|
@@ -770,7 +815,7 @@ class mi {
|
|
|
770
815
|
});
|
|
771
816
|
}
|
|
772
817
|
}
|
|
773
|
-
_e = /* @__PURE__ */ new WeakMap(), tr = /* @__PURE__ */ new WeakSet(),
|
|
818
|
+
_e = /* @__PURE__ */ new WeakMap(), tr = /* @__PURE__ */ new WeakSet(), Cs = function(t, e, n, r, s) {
|
|
774
819
|
return U(this, null, function* () {
|
|
775
820
|
const a = yield R(this, _e).get(
|
|
776
821
|
`v1/images/${e}?ids=${n}&format=${r}${s ? `&scale=${s}` : ""}`
|
|
@@ -782,13 +827,13 @@ _e = /* @__PURE__ */ new WeakMap(), tr = /* @__PURE__ */ new WeakSet(), As = fun
|
|
|
782
827
|
});
|
|
783
828
|
};
|
|
784
829
|
var cn;
|
|
785
|
-
class
|
|
830
|
+
class Si {
|
|
786
831
|
constructor(e) {
|
|
787
832
|
de(this, cn), this.resourceName = "Nodes", J(this, cn, e);
|
|
788
833
|
}
|
|
789
834
|
get(e) {
|
|
790
835
|
return U(this, arguments, function* ({ fileKey: n, nodeIds: r, params: s = {} }) {
|
|
791
|
-
const a =
|
|
836
|
+
const a = Ar(ae({}, s), {
|
|
792
837
|
ids: r.join(",")
|
|
793
838
|
}), i = new URLSearchParams(ae({
|
|
794
839
|
plugin_data: "857346721138427857"
|
|
@@ -799,7 +844,7 @@ class yi {
|
|
|
799
844
|
}
|
|
800
845
|
cn = /* @__PURE__ */ new WeakMap();
|
|
801
846
|
var je;
|
|
802
|
-
class
|
|
847
|
+
class Oi extends bi {
|
|
803
848
|
constructor({
|
|
804
849
|
baseAddress: e = "https://api.figma.com/",
|
|
805
850
|
fetch: n = globalThis.fetch.bind(globalThis)
|
|
@@ -809,7 +854,7 @@ class gi extends li {
|
|
|
809
854
|
entries: /* @__PURE__ */ new Map(),
|
|
810
855
|
pendingRequests: /* @__PURE__ */ new Map()
|
|
811
856
|
}
|
|
812
|
-
}, this.files = jn(this, new
|
|
857
|
+
}, this.files = jn(this, new wi(this)), this.nodes = jn(this, new Si(this)), this.images = jn(this, new Ei(this));
|
|
813
858
|
}
|
|
814
859
|
set token(e) {
|
|
815
860
|
if (!e.startsWith("figd_") && !e.startsWith("figu_"))
|
|
@@ -827,10 +872,10 @@ class gi extends li {
|
|
|
827
872
|
}
|
|
828
873
|
}
|
|
829
874
|
je = /* @__PURE__ */ new WeakMap();
|
|
830
|
-
const
|
|
875
|
+
const Ti = (t) => ke(void 0, [t], function* ({
|
|
831
876
|
fileKey: e,
|
|
832
877
|
authToken: n,
|
|
833
|
-
figmaRestApi: r = new
|
|
878
|
+
figmaRestApi: r = new Oi(),
|
|
834
879
|
params: s = {}
|
|
835
880
|
}) {
|
|
836
881
|
n && (r.token = n);
|
|
@@ -840,10 +885,10 @@ const _i = (t) => ke(void 0, [t], function* ({
|
|
|
840
885
|
params: s
|
|
841
886
|
});
|
|
842
887
|
} catch (a) {
|
|
843
|
-
throw console.error(a), a;
|
|
888
|
+
throw console.error(a), Pa(a, e);
|
|
844
889
|
}
|
|
845
890
|
});
|
|
846
|
-
var
|
|
891
|
+
var C;
|
|
847
892
|
(function(t) {
|
|
848
893
|
t.assertEqual = (s) => s;
|
|
849
894
|
function e(s) {
|
|
@@ -878,12 +923,12 @@ var A;
|
|
|
878
923
|
return s.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
|
|
879
924
|
}
|
|
880
925
|
t.joinValues = r, t.jsonStringifyReplacer = (s, a) => typeof a == "bigint" ? a.toString() : a;
|
|
881
|
-
})(
|
|
926
|
+
})(C || (C = {}));
|
|
882
927
|
var nr;
|
|
883
928
|
(function(t) {
|
|
884
929
|
t.mergeShapes = (e, n) => d(d({}, e), n);
|
|
885
930
|
})(nr || (nr = {}));
|
|
886
|
-
const v =
|
|
931
|
+
const v = C.arrayToEnum([
|
|
887
932
|
"string",
|
|
888
933
|
"nan",
|
|
889
934
|
"number",
|
|
@@ -925,7 +970,7 @@ const v = A.arrayToEnum([
|
|
|
925
970
|
default:
|
|
926
971
|
return v.unknown;
|
|
927
972
|
}
|
|
928
|
-
}, f =
|
|
973
|
+
}, f = C.arrayToEnum([
|
|
929
974
|
"invalid_type",
|
|
930
975
|
"invalid_literal",
|
|
931
976
|
"custom",
|
|
@@ -942,7 +987,7 @@ const v = A.arrayToEnum([
|
|
|
942
987
|
"invalid_intersection_types",
|
|
943
988
|
"not_multiple_of",
|
|
944
989
|
"not_finite"
|
|
945
|
-
]),
|
|
990
|
+
]), Ai = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
946
991
|
class ie extends Error {
|
|
947
992
|
get errors() {
|
|
948
993
|
return this.issues;
|
|
@@ -987,7 +1032,7 @@ class ie extends Error {
|
|
|
987
1032
|
return this.message;
|
|
988
1033
|
}
|
|
989
1034
|
get message() {
|
|
990
|
-
return JSON.stringify(this.issues,
|
|
1035
|
+
return JSON.stringify(this.issues, C.jsonStringifyReplacer, 2);
|
|
991
1036
|
}
|
|
992
1037
|
get isEmpty() {
|
|
993
1038
|
return this.issues.length === 0;
|
|
@@ -1010,19 +1055,19 @@ const yt = (t, e) => {
|
|
|
1010
1055
|
t.received === v.undefined ? n = "Required" : n = `Expected ${t.expected}, received ${t.received}`;
|
|
1011
1056
|
break;
|
|
1012
1057
|
case f.invalid_literal:
|
|
1013
|
-
n = `Invalid literal value, expected ${JSON.stringify(t.expected,
|
|
1058
|
+
n = `Invalid literal value, expected ${JSON.stringify(t.expected, C.jsonStringifyReplacer)}`;
|
|
1014
1059
|
break;
|
|
1015
1060
|
case f.unrecognized_keys:
|
|
1016
|
-
n = `Unrecognized key(s) in object: ${
|
|
1061
|
+
n = `Unrecognized key(s) in object: ${C.joinValues(t.keys, ", ")}`;
|
|
1017
1062
|
break;
|
|
1018
1063
|
case f.invalid_union:
|
|
1019
1064
|
n = "Invalid input";
|
|
1020
1065
|
break;
|
|
1021
1066
|
case f.invalid_union_discriminator:
|
|
1022
|
-
n = `Invalid discriminator value. Expected ${
|
|
1067
|
+
n = `Invalid discriminator value. Expected ${C.joinValues(t.options)}`;
|
|
1023
1068
|
break;
|
|
1024
1069
|
case f.invalid_enum_value:
|
|
1025
|
-
n = `Invalid enum value. Expected ${
|
|
1070
|
+
n = `Invalid enum value. Expected ${C.joinValues(t.options)}, received '${t.received}'`;
|
|
1026
1071
|
break;
|
|
1027
1072
|
case f.invalid_arguments:
|
|
1028
1073
|
n = "Invalid function arguments";
|
|
@@ -1034,7 +1079,7 @@ const yt = (t, e) => {
|
|
|
1034
1079
|
n = "Invalid date";
|
|
1035
1080
|
break;
|
|
1036
1081
|
case f.invalid_string:
|
|
1037
|
-
typeof t.validation == "object" ? "includes" in t.validation ? (n = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (n = `${n} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? n = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? n = `Invalid input: must end with "${t.validation.endsWith}"` :
|
|
1082
|
+
typeof t.validation == "object" ? "includes" in t.validation ? (n = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (n = `${n} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? n = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? n = `Invalid input: must end with "${t.validation.endsWith}"` : C.assertNever(t.validation) : t.validation !== "regex" ? n = `Invalid ${t.validation}` : n = "Invalid";
|
|
1038
1083
|
break;
|
|
1039
1084
|
case f.too_small:
|
|
1040
1085
|
t.type === "array" ? n = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "more than"} ${t.minimum} element(s)` : t.type === "string" ? n = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "over"} ${t.minimum} character(s)` : t.type === "number" ? n = `Number must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${t.minimum}` : t.type === "date" ? n = `Date must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(t.minimum))}` : n = "Invalid input";
|
|
@@ -1055,23 +1100,23 @@ const yt = (t, e) => {
|
|
|
1055
1100
|
n = "Number must be finite";
|
|
1056
1101
|
break;
|
|
1057
1102
|
default:
|
|
1058
|
-
n = e.defaultError,
|
|
1103
|
+
n = e.defaultError, C.assertNever(t);
|
|
1059
1104
|
}
|
|
1060
1105
|
return { message: n };
|
|
1061
1106
|
};
|
|
1062
1107
|
let Ns = yt;
|
|
1063
|
-
function
|
|
1108
|
+
function Ci(t) {
|
|
1064
1109
|
Ns = t;
|
|
1065
1110
|
}
|
|
1066
1111
|
function fn() {
|
|
1067
1112
|
return Ns;
|
|
1068
1113
|
}
|
|
1069
1114
|
const hn = (t) => {
|
|
1070
|
-
const { data: e, path: n, errorMaps: r, issueData: s } = t, a = [...n, ...s.path || []], i =
|
|
1115
|
+
const { data: e, path: n, errorMaps: r, issueData: s } = t, a = [...n, ...s.path || []], i = E(d({}, s), {
|
|
1071
1116
|
path: a
|
|
1072
1117
|
});
|
|
1073
1118
|
if (s.message !== void 0)
|
|
1074
|
-
return
|
|
1119
|
+
return E(d({}, s), {
|
|
1075
1120
|
path: a,
|
|
1076
1121
|
message: s.message
|
|
1077
1122
|
});
|
|
@@ -1079,11 +1124,11 @@ const hn = (t) => {
|
|
|
1079
1124
|
const u = r.filter((c) => !!c).slice().reverse();
|
|
1080
1125
|
for (const c of u)
|
|
1081
1126
|
o = c(i, { data: e, defaultError: o }).message;
|
|
1082
|
-
return
|
|
1127
|
+
return E(d({}, s), {
|
|
1083
1128
|
path: a,
|
|
1084
1129
|
message: o
|
|
1085
1130
|
});
|
|
1086
|
-
},
|
|
1131
|
+
}, Ni = [];
|
|
1087
1132
|
function g(t, e) {
|
|
1088
1133
|
const n = fn(), r = hn({
|
|
1089
1134
|
issueData: e,
|
|
@@ -1161,7 +1206,7 @@ var w;
|
|
|
1161
1206
|
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
1162
1207
|
})(w || (w = {}));
|
|
1163
1208
|
var Ot, Tt;
|
|
1164
|
-
class
|
|
1209
|
+
class xe {
|
|
1165
1210
|
constructor(e, n, r, s) {
|
|
1166
1211
|
this._cachedPath = [], this.parent = e, this.data = n, this._path = r, this._key = s;
|
|
1167
1212
|
}
|
|
@@ -1331,7 +1376,7 @@ class T {
|
|
|
1331
1376
|
_refinement(e) {
|
|
1332
1377
|
return new me({
|
|
1333
1378
|
schema: this,
|
|
1334
|
-
typeName:
|
|
1379
|
+
typeName: x.ZodEffects,
|
|
1335
1380
|
effect: { type: "refinement", refinement: e }
|
|
1336
1381
|
});
|
|
1337
1382
|
}
|
|
@@ -1367,37 +1412,37 @@ class T {
|
|
|
1367
1412
|
return Mt.create(this, e, this._def);
|
|
1368
1413
|
}
|
|
1369
1414
|
transform(e) {
|
|
1370
|
-
return new me(
|
|
1415
|
+
return new me(E(d({}, O(this._def)), {
|
|
1371
1416
|
schema: this,
|
|
1372
|
-
typeName:
|
|
1417
|
+
typeName: x.ZodEffects,
|
|
1373
1418
|
effect: { type: "transform", transform: e }
|
|
1374
1419
|
}));
|
|
1375
1420
|
}
|
|
1376
1421
|
default(e) {
|
|
1377
1422
|
const n = typeof e == "function" ? e : () => e;
|
|
1378
|
-
return new zt(
|
|
1423
|
+
return new zt(E(d({}, O(this._def)), {
|
|
1379
1424
|
innerType: this,
|
|
1380
1425
|
defaultValue: n,
|
|
1381
|
-
typeName:
|
|
1426
|
+
typeName: x.ZodDefault
|
|
1382
1427
|
}));
|
|
1383
1428
|
}
|
|
1384
1429
|
brand() {
|
|
1385
1430
|
return new Pr(d({
|
|
1386
|
-
typeName:
|
|
1431
|
+
typeName: x.ZodBranded,
|
|
1387
1432
|
type: this
|
|
1388
1433
|
}, O(this._def)));
|
|
1389
1434
|
}
|
|
1390
1435
|
catch(e) {
|
|
1391
1436
|
const n = typeof e == "function" ? e : () => e;
|
|
1392
|
-
return new Vt(
|
|
1437
|
+
return new Vt(E(d({}, O(this._def)), {
|
|
1393
1438
|
innerType: this,
|
|
1394
1439
|
catchValue: n,
|
|
1395
|
-
typeName:
|
|
1440
|
+
typeName: x.ZodCatch
|
|
1396
1441
|
}));
|
|
1397
1442
|
}
|
|
1398
1443
|
describe(e) {
|
|
1399
1444
|
const n = this.constructor;
|
|
1400
|
-
return new n(
|
|
1445
|
+
return new n(E(d({}, this._def), {
|
|
1401
1446
|
description: e
|
|
1402
1447
|
}));
|
|
1403
1448
|
}
|
|
@@ -1414,14 +1459,14 @@ class T {
|
|
|
1414
1459
|
return this.safeParse(null).success;
|
|
1415
1460
|
}
|
|
1416
1461
|
}
|
|
1417
|
-
const
|
|
1462
|
+
const Pi = /^c[^\s-]{8,}$/i, Ri = /^[0-9a-z]+$/, Ii = /^[0-9A-HJKMNP-TV-Z]{26}$/i, ji = /^[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, Zi = /^[a-z0-9_-]{21}$/i, Di = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Mi = /^[-+]?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)?)??$/, Li = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, $i = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
1418
1463
|
let Zn;
|
|
1419
|
-
const
|
|
1464
|
+
const Fi = /^(?:(?: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])$/, Wi = /^(?:(?: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])$/, zi = /^(([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]))$/, Vi = /^(([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])$/, Ui = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Bi = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Rs = "((\\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])))", Ki = new RegExp(`^${Rs}$`);
|
|
1420
1465
|
function Is(t) {
|
|
1421
1466
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
1422
1467
|
return t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
1423
1468
|
}
|
|
1424
|
-
function
|
|
1469
|
+
function qi(t) {
|
|
1425
1470
|
return new RegExp(`^${Is(t)}$`);
|
|
1426
1471
|
}
|
|
1427
1472
|
function js(t) {
|
|
@@ -1429,11 +1474,11 @@ function js(t) {
|
|
|
1429
1474
|
const n = [];
|
|
1430
1475
|
return n.push(t.local ? "Z?" : "Z"), t.offset && n.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${n.join("|")})`, new RegExp(`^${e}$`);
|
|
1431
1476
|
}
|
|
1432
|
-
function
|
|
1433
|
-
return !!((e === "v4" || !e) &&
|
|
1477
|
+
function Hi(t, e) {
|
|
1478
|
+
return !!((e === "v4" || !e) && Fi.test(t) || (e === "v6" || !e) && zi.test(t));
|
|
1434
1479
|
}
|
|
1435
|
-
function
|
|
1436
|
-
if (!
|
|
1480
|
+
function Gi(t, e) {
|
|
1481
|
+
if (!Di.test(t))
|
|
1437
1482
|
return !1;
|
|
1438
1483
|
try {
|
|
1439
1484
|
const [n] = t.split("."), r = n.replace(/-/g, "+").replace(/_/g, "/").padEnd(n.length + (4 - n.length % 4) % 4, "="), s = JSON.parse(atob(r));
|
|
@@ -1442,8 +1487,8 @@ function Fi(t, e) {
|
|
|
1442
1487
|
return !1;
|
|
1443
1488
|
}
|
|
1444
1489
|
}
|
|
1445
|
-
function
|
|
1446
|
-
return !!((e === "v4" || !e) &&
|
|
1490
|
+
function Ji(t, e) {
|
|
1491
|
+
return !!((e === "v4" || !e) && Wi.test(t) || (e === "v6" || !e) && Vi.test(t));
|
|
1447
1492
|
}
|
|
1448
1493
|
class he extends T {
|
|
1449
1494
|
_parse(e) {
|
|
@@ -1494,43 +1539,43 @@ class he extends T {
|
|
|
1494
1539
|
message: s.message
|
|
1495
1540
|
}), n.dirty());
|
|
1496
1541
|
} else if (s.kind === "email")
|
|
1497
|
-
|
|
1542
|
+
Li.test(e.data) || (r = this._getOrReturnCtx(e, r), g(r, {
|
|
1498
1543
|
validation: "email",
|
|
1499
1544
|
code: f.invalid_string,
|
|
1500
1545
|
message: s.message
|
|
1501
1546
|
}), n.dirty());
|
|
1502
1547
|
else if (s.kind === "emoji")
|
|
1503
|
-
Zn || (Zn = new RegExp(
|
|
1548
|
+
Zn || (Zn = new RegExp($i, "u")), Zn.test(e.data) || (r = this._getOrReturnCtx(e, r), g(r, {
|
|
1504
1549
|
validation: "emoji",
|
|
1505
1550
|
code: f.invalid_string,
|
|
1506
1551
|
message: s.message
|
|
1507
1552
|
}), n.dirty());
|
|
1508
1553
|
else if (s.kind === "uuid")
|
|
1509
|
-
|
|
1554
|
+
ji.test(e.data) || (r = this._getOrReturnCtx(e, r), g(r, {
|
|
1510
1555
|
validation: "uuid",
|
|
1511
1556
|
code: f.invalid_string,
|
|
1512
1557
|
message: s.message
|
|
1513
1558
|
}), n.dirty());
|
|
1514
1559
|
else if (s.kind === "nanoid")
|
|
1515
|
-
|
|
1560
|
+
Zi.test(e.data) || (r = this._getOrReturnCtx(e, r), g(r, {
|
|
1516
1561
|
validation: "nanoid",
|
|
1517
1562
|
code: f.invalid_string,
|
|
1518
1563
|
message: s.message
|
|
1519
1564
|
}), n.dirty());
|
|
1520
1565
|
else if (s.kind === "cuid")
|
|
1521
|
-
|
|
1566
|
+
Pi.test(e.data) || (r = this._getOrReturnCtx(e, r), g(r, {
|
|
1522
1567
|
validation: "cuid",
|
|
1523
1568
|
code: f.invalid_string,
|
|
1524
1569
|
message: s.message
|
|
1525
1570
|
}), n.dirty());
|
|
1526
1571
|
else if (s.kind === "cuid2")
|
|
1527
|
-
|
|
1572
|
+
Ri.test(e.data) || (r = this._getOrReturnCtx(e, r), g(r, {
|
|
1528
1573
|
validation: "cuid2",
|
|
1529
1574
|
code: f.invalid_string,
|
|
1530
1575
|
message: s.message
|
|
1531
1576
|
}), n.dirty());
|
|
1532
1577
|
else if (s.kind === "ulid")
|
|
1533
|
-
|
|
1578
|
+
Ii.test(e.data) || (r = this._getOrReturnCtx(e, r), g(r, {
|
|
1534
1579
|
validation: "ulid",
|
|
1535
1580
|
code: f.invalid_string,
|
|
1536
1581
|
message: s.message
|
|
@@ -1565,39 +1610,39 @@ class he extends T {
|
|
|
1565
1610
|
code: f.invalid_string,
|
|
1566
1611
|
validation: "datetime",
|
|
1567
1612
|
message: s.message
|
|
1568
|
-
}), n.dirty()) : s.kind === "date" ?
|
|
1613
|
+
}), n.dirty()) : s.kind === "date" ? Ki.test(e.data) || (r = this._getOrReturnCtx(e, r), g(r, {
|
|
1569
1614
|
code: f.invalid_string,
|
|
1570
1615
|
validation: "date",
|
|
1571
1616
|
message: s.message
|
|
1572
|
-
}), n.dirty()) : s.kind === "time" ?
|
|
1617
|
+
}), n.dirty()) : s.kind === "time" ? qi(s).test(e.data) || (r = this._getOrReturnCtx(e, r), g(r, {
|
|
1573
1618
|
code: f.invalid_string,
|
|
1574
1619
|
validation: "time",
|
|
1575
1620
|
message: s.message
|
|
1576
|
-
}), n.dirty()) : s.kind === "duration" ?
|
|
1621
|
+
}), n.dirty()) : s.kind === "duration" ? Mi.test(e.data) || (r = this._getOrReturnCtx(e, r), g(r, {
|
|
1577
1622
|
validation: "duration",
|
|
1578
1623
|
code: f.invalid_string,
|
|
1579
1624
|
message: s.message
|
|
1580
|
-
}), n.dirty()) : s.kind === "ip" ?
|
|
1625
|
+
}), n.dirty()) : s.kind === "ip" ? Hi(e.data, s.version) || (r = this._getOrReturnCtx(e, r), g(r, {
|
|
1581
1626
|
validation: "ip",
|
|
1582
1627
|
code: f.invalid_string,
|
|
1583
1628
|
message: s.message
|
|
1584
|
-
}), n.dirty()) : s.kind === "jwt" ?
|
|
1629
|
+
}), n.dirty()) : s.kind === "jwt" ? Gi(e.data, s.alg) || (r = this._getOrReturnCtx(e, r), g(r, {
|
|
1585
1630
|
validation: "jwt",
|
|
1586
1631
|
code: f.invalid_string,
|
|
1587
1632
|
message: s.message
|
|
1588
|
-
}), n.dirty()) : s.kind === "cidr" ?
|
|
1633
|
+
}), n.dirty()) : s.kind === "cidr" ? Ji(e.data, s.version) || (r = this._getOrReturnCtx(e, r), g(r, {
|
|
1589
1634
|
validation: "cidr",
|
|
1590
1635
|
code: f.invalid_string,
|
|
1591
1636
|
message: s.message
|
|
1592
|
-
}), n.dirty()) : s.kind === "base64" ?
|
|
1637
|
+
}), n.dirty()) : s.kind === "base64" ? Ui.test(e.data) || (r = this._getOrReturnCtx(e, r), g(r, {
|
|
1593
1638
|
validation: "base64",
|
|
1594
1639
|
code: f.invalid_string,
|
|
1595
1640
|
message: s.message
|
|
1596
|
-
}), n.dirty()) : s.kind === "base64url" ?
|
|
1641
|
+
}), n.dirty()) : s.kind === "base64url" ? Bi.test(e.data) || (r = this._getOrReturnCtx(e, r), g(r, {
|
|
1597
1642
|
validation: "base64url",
|
|
1598
1643
|
code: f.invalid_string,
|
|
1599
1644
|
message: s.message
|
|
1600
|
-
}), n.dirty()) :
|
|
1645
|
+
}), n.dirty()) : C.assertNever(s);
|
|
1601
1646
|
return { status: n.value, value: e.data };
|
|
1602
1647
|
}
|
|
1603
1648
|
_regex(e, n, r) {
|
|
@@ -1607,7 +1652,7 @@ class he extends T {
|
|
|
1607
1652
|
}, w.errToObj(r)));
|
|
1608
1653
|
}
|
|
1609
1654
|
_addCheck(e) {
|
|
1610
|
-
return new he(
|
|
1655
|
+
return new he(E(d({}, this._def), {
|
|
1611
1656
|
checks: [...this._def.checks, e]
|
|
1612
1657
|
}));
|
|
1613
1658
|
}
|
|
@@ -1733,17 +1778,17 @@ class he extends T {
|
|
|
1733
1778
|
return this.min(1, w.errToObj(e));
|
|
1734
1779
|
}
|
|
1735
1780
|
trim() {
|
|
1736
|
-
return new he(
|
|
1781
|
+
return new he(E(d({}, this._def), {
|
|
1737
1782
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
1738
1783
|
}));
|
|
1739
1784
|
}
|
|
1740
1785
|
toLowerCase() {
|
|
1741
|
-
return new he(
|
|
1786
|
+
return new he(E(d({}, this._def), {
|
|
1742
1787
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
1743
1788
|
}));
|
|
1744
1789
|
}
|
|
1745
1790
|
toUpperCase() {
|
|
1746
|
-
return new he(
|
|
1791
|
+
return new he(E(d({}, this._def), {
|
|
1747
1792
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
1748
1793
|
}));
|
|
1749
1794
|
}
|
|
@@ -1812,11 +1857,11 @@ he.create = (t) => {
|
|
|
1812
1857
|
var e;
|
|
1813
1858
|
return new he(d({
|
|
1814
1859
|
checks: [],
|
|
1815
|
-
typeName:
|
|
1860
|
+
typeName: x.ZodString,
|
|
1816
1861
|
coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1
|
|
1817
1862
|
}, O(t)));
|
|
1818
1863
|
};
|
|
1819
|
-
function
|
|
1864
|
+
function Xi(t, e) {
|
|
1820
1865
|
const n = (t.toString().split(".")[1] || "").length, r = (e.toString().split(".")[1] || "").length, s = n > r ? n : r, a = parseInt(t.toFixed(s).replace(".", "")), i = parseInt(e.toFixed(s).replace(".", ""));
|
|
1821
1866
|
return a % i / Math.pow(10, s);
|
|
1822
1867
|
}
|
|
@@ -1836,7 +1881,7 @@ class Le extends T {
|
|
|
1836
1881
|
let n;
|
|
1837
1882
|
const r = new X();
|
|
1838
1883
|
for (const s of this._def.checks)
|
|
1839
|
-
s.kind === "int" ?
|
|
1884
|
+
s.kind === "int" ? C.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1840
1885
|
code: f.invalid_type,
|
|
1841
1886
|
expected: "integer",
|
|
1842
1887
|
received: "float",
|
|
@@ -1855,14 +1900,14 @@ class Le extends T {
|
|
|
1855
1900
|
inclusive: s.inclusive,
|
|
1856
1901
|
exact: !1,
|
|
1857
1902
|
message: s.message
|
|
1858
|
-
}), r.dirty()) : s.kind === "multipleOf" ?
|
|
1903
|
+
}), r.dirty()) : s.kind === "multipleOf" ? Xi(e.data, s.value) !== 0 && (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1859
1904
|
code: f.not_multiple_of,
|
|
1860
1905
|
multipleOf: s.value,
|
|
1861
1906
|
message: s.message
|
|
1862
1907
|
}), r.dirty()) : s.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), g(n, {
|
|
1863
1908
|
code: f.not_finite,
|
|
1864
1909
|
message: s.message
|
|
1865
|
-
}), r.dirty()) :
|
|
1910
|
+
}), r.dirty()) : C.assertNever(s);
|
|
1866
1911
|
return { status: r.value, value: e.data };
|
|
1867
1912
|
}
|
|
1868
1913
|
gte(e, n) {
|
|
@@ -1878,7 +1923,7 @@ class Le extends T {
|
|
|
1878
1923
|
return this.setLimit("max", e, !1, w.toString(n));
|
|
1879
1924
|
}
|
|
1880
1925
|
setLimit(e, n, r, s) {
|
|
1881
|
-
return new Le(
|
|
1926
|
+
return new Le(E(d({}, this._def), {
|
|
1882
1927
|
checks: [
|
|
1883
1928
|
...this._def.checks,
|
|
1884
1929
|
{
|
|
@@ -1891,7 +1936,7 @@ class Le extends T {
|
|
|
1891
1936
|
}));
|
|
1892
1937
|
}
|
|
1893
1938
|
_addCheck(e) {
|
|
1894
|
-
return new Le(
|
|
1939
|
+
return new Le(E(d({}, this._def), {
|
|
1895
1940
|
checks: [...this._def.checks, e]
|
|
1896
1941
|
}));
|
|
1897
1942
|
}
|
|
@@ -1972,7 +2017,7 @@ class Le extends T {
|
|
|
1972
2017
|
return e;
|
|
1973
2018
|
}
|
|
1974
2019
|
get isInt() {
|
|
1975
|
-
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" &&
|
|
2020
|
+
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && C.isInteger(e.value));
|
|
1976
2021
|
}
|
|
1977
2022
|
get isFinite() {
|
|
1978
2023
|
let e = null, n = null;
|
|
@@ -1986,7 +2031,7 @@ class Le extends T {
|
|
|
1986
2031
|
}
|
|
1987
2032
|
Le.create = (t) => new Le(d({
|
|
1988
2033
|
checks: [],
|
|
1989
|
-
typeName:
|
|
2034
|
+
typeName: x.ZodNumber,
|
|
1990
2035
|
coerce: (t == null ? void 0 : t.coerce) || !1
|
|
1991
2036
|
}, O(t)));
|
|
1992
2037
|
class $e extends T {
|
|
@@ -2021,7 +2066,7 @@ class $e extends T {
|
|
|
2021
2066
|
code: f.not_multiple_of,
|
|
2022
2067
|
multipleOf: s.value,
|
|
2023
2068
|
message: s.message
|
|
2024
|
-
}), r.dirty()) :
|
|
2069
|
+
}), r.dirty()) : C.assertNever(s);
|
|
2025
2070
|
return { status: r.value, value: e.data };
|
|
2026
2071
|
}
|
|
2027
2072
|
_getInvalidInput(e) {
|
|
@@ -2045,7 +2090,7 @@ class $e extends T {
|
|
|
2045
2090
|
return this.setLimit("max", e, !1, w.toString(n));
|
|
2046
2091
|
}
|
|
2047
2092
|
setLimit(e, n, r, s) {
|
|
2048
|
-
return new $e(
|
|
2093
|
+
return new $e(E(d({}, this._def), {
|
|
2049
2094
|
checks: [
|
|
2050
2095
|
...this._def.checks,
|
|
2051
2096
|
{
|
|
@@ -2058,7 +2103,7 @@ class $e extends T {
|
|
|
2058
2103
|
}));
|
|
2059
2104
|
}
|
|
2060
2105
|
_addCheck(e) {
|
|
2061
|
-
return new $e(
|
|
2106
|
+
return new $e(E(d({}, this._def), {
|
|
2062
2107
|
checks: [...this._def.checks, e]
|
|
2063
2108
|
}));
|
|
2064
2109
|
}
|
|
@@ -2118,7 +2163,7 @@ $e.create = (t) => {
|
|
|
2118
2163
|
var e;
|
|
2119
2164
|
return new $e(d({
|
|
2120
2165
|
checks: [],
|
|
2121
|
-
typeName:
|
|
2166
|
+
typeName: x.ZodBigInt,
|
|
2122
2167
|
coerce: (e = t == null ? void 0 : t.coerce) !== null && e !== void 0 ? e : !1
|
|
2123
2168
|
}, O(t)));
|
|
2124
2169
|
};
|
|
@@ -2136,7 +2181,7 @@ class It extends T {
|
|
|
2136
2181
|
}
|
|
2137
2182
|
}
|
|
2138
2183
|
It.create = (t) => new It(d({
|
|
2139
|
-
typeName:
|
|
2184
|
+
typeName: x.ZodBoolean,
|
|
2140
2185
|
coerce: (t == null ? void 0 : t.coerce) || !1
|
|
2141
2186
|
}, O(t)));
|
|
2142
2187
|
class Qe extends T {
|
|
@@ -2172,14 +2217,14 @@ class Qe extends T {
|
|
|
2172
2217
|
exact: !1,
|
|
2173
2218
|
maximum: s.value,
|
|
2174
2219
|
type: "date"
|
|
2175
|
-
}), n.dirty()) :
|
|
2220
|
+
}), n.dirty()) : C.assertNever(s);
|
|
2176
2221
|
return {
|
|
2177
2222
|
status: n.value,
|
|
2178
2223
|
value: new Date(e.data.getTime())
|
|
2179
2224
|
};
|
|
2180
2225
|
}
|
|
2181
2226
|
_addCheck(e) {
|
|
2182
|
-
return new Qe(
|
|
2227
|
+
return new Qe(E(d({}, this._def), {
|
|
2183
2228
|
checks: [...this._def.checks, e]
|
|
2184
2229
|
}));
|
|
2185
2230
|
}
|
|
@@ -2213,7 +2258,7 @@ class Qe extends T {
|
|
|
2213
2258
|
Qe.create = (t) => new Qe(d({
|
|
2214
2259
|
checks: [],
|
|
2215
2260
|
coerce: (t == null ? void 0 : t.coerce) || !1,
|
|
2216
|
-
typeName:
|
|
2261
|
+
typeName: x.ZodDate
|
|
2217
2262
|
}, O(t)));
|
|
2218
2263
|
class yn extends T {
|
|
2219
2264
|
_parse(e) {
|
|
@@ -2229,7 +2274,7 @@ class yn extends T {
|
|
|
2229
2274
|
}
|
|
2230
2275
|
}
|
|
2231
2276
|
yn.create = (t) => new yn(d({
|
|
2232
|
-
typeName:
|
|
2277
|
+
typeName: x.ZodSymbol
|
|
2233
2278
|
}, O(t)));
|
|
2234
2279
|
class jt extends T {
|
|
2235
2280
|
_parse(e) {
|
|
@@ -2245,7 +2290,7 @@ class jt extends T {
|
|
|
2245
2290
|
}
|
|
2246
2291
|
}
|
|
2247
2292
|
jt.create = (t) => new jt(d({
|
|
2248
|
-
typeName:
|
|
2293
|
+
typeName: x.ZodUndefined
|
|
2249
2294
|
}, O(t)));
|
|
2250
2295
|
class Zt extends T {
|
|
2251
2296
|
_parse(e) {
|
|
@@ -2261,7 +2306,7 @@ class Zt extends T {
|
|
|
2261
2306
|
}
|
|
2262
2307
|
}
|
|
2263
2308
|
Zt.create = (t) => new Zt(d({
|
|
2264
|
-
typeName:
|
|
2309
|
+
typeName: x.ZodNull
|
|
2265
2310
|
}, O(t)));
|
|
2266
2311
|
class gt extends T {
|
|
2267
2312
|
constructor() {
|
|
@@ -2272,7 +2317,7 @@ class gt extends T {
|
|
|
2272
2317
|
}
|
|
2273
2318
|
}
|
|
2274
2319
|
gt.create = (t) => new gt(d({
|
|
2275
|
-
typeName:
|
|
2320
|
+
typeName: x.ZodAny
|
|
2276
2321
|
}, O(t)));
|
|
2277
2322
|
class Xe extends T {
|
|
2278
2323
|
constructor() {
|
|
@@ -2283,7 +2328,7 @@ class Xe extends T {
|
|
|
2283
2328
|
}
|
|
2284
2329
|
}
|
|
2285
2330
|
Xe.create = (t) => new Xe(d({
|
|
2286
|
-
typeName:
|
|
2331
|
+
typeName: x.ZodUnknown
|
|
2287
2332
|
}, O(t)));
|
|
2288
2333
|
class Re extends T {
|
|
2289
2334
|
_parse(e) {
|
|
@@ -2296,7 +2341,7 @@ class Re extends T {
|
|
|
2296
2341
|
}
|
|
2297
2342
|
}
|
|
2298
2343
|
Re.create = (t) => new Re(d({
|
|
2299
|
-
typeName:
|
|
2344
|
+
typeName: x.ZodNever
|
|
2300
2345
|
}, O(t)));
|
|
2301
2346
|
class gn extends T {
|
|
2302
2347
|
_parse(e) {
|
|
@@ -2312,7 +2357,7 @@ class gn extends T {
|
|
|
2312
2357
|
}
|
|
2313
2358
|
}
|
|
2314
2359
|
gn.create = (t) => new gn(d({
|
|
2315
|
-
typeName:
|
|
2360
|
+
typeName: x.ZodVoid
|
|
2316
2361
|
}, O(t)));
|
|
2317
2362
|
class pe extends T {
|
|
2318
2363
|
_parse(e) {
|
|
@@ -2350,25 +2395,25 @@ class pe extends T {
|
|
|
2350
2395
|
exact: !1,
|
|
2351
2396
|
message: s.maxLength.message
|
|
2352
2397
|
}), r.dirty()), n.common.async)
|
|
2353
|
-
return Promise.all([...n.data].map((i, o) => s.type._parseAsync(new
|
|
2354
|
-
const a = [...n.data].map((i, o) => s.type._parseSync(new
|
|
2398
|
+
return Promise.all([...n.data].map((i, o) => s.type._parseAsync(new xe(n, i, n.path, o)))).then((i) => X.mergeArray(r, i));
|
|
2399
|
+
const a = [...n.data].map((i, o) => s.type._parseSync(new xe(n, i, n.path, o)));
|
|
2355
2400
|
return X.mergeArray(r, a);
|
|
2356
2401
|
}
|
|
2357
2402
|
get element() {
|
|
2358
2403
|
return this._def.type;
|
|
2359
2404
|
}
|
|
2360
2405
|
min(e, n) {
|
|
2361
|
-
return new pe(
|
|
2406
|
+
return new pe(E(d({}, this._def), {
|
|
2362
2407
|
minLength: { value: e, message: w.toString(n) }
|
|
2363
2408
|
}));
|
|
2364
2409
|
}
|
|
2365
2410
|
max(e, n) {
|
|
2366
|
-
return new pe(
|
|
2411
|
+
return new pe(E(d({}, this._def), {
|
|
2367
2412
|
maxLength: { value: e, message: w.toString(n) }
|
|
2368
2413
|
}));
|
|
2369
2414
|
}
|
|
2370
2415
|
length(e, n) {
|
|
2371
|
-
return new pe(
|
|
2416
|
+
return new pe(E(d({}, this._def), {
|
|
2372
2417
|
exactLength: { value: e, message: w.toString(n) }
|
|
2373
2418
|
}));
|
|
2374
2419
|
}
|
|
@@ -2381,7 +2426,7 @@ pe.create = (t, e) => new pe(d({
|
|
|
2381
2426
|
minLength: null,
|
|
2382
2427
|
maxLength: null,
|
|
2383
2428
|
exactLength: null,
|
|
2384
|
-
typeName:
|
|
2429
|
+
typeName: x.ZodArray
|
|
2385
2430
|
}, O(e)));
|
|
2386
2431
|
function ut(t) {
|
|
2387
2432
|
if (t instanceof W) {
|
|
@@ -2390,12 +2435,12 @@ function ut(t) {
|
|
|
2390
2435
|
const r = t.shape[n];
|
|
2391
2436
|
e[n] = we.create(ut(r));
|
|
2392
2437
|
}
|
|
2393
|
-
return new W(
|
|
2438
|
+
return new W(E(d({}, t._def), {
|
|
2394
2439
|
shape: () => e
|
|
2395
2440
|
}));
|
|
2396
|
-
} else return t instanceof pe ? new pe(
|
|
2441
|
+
} else return t instanceof pe ? new pe(E(d({}, t._def), {
|
|
2397
2442
|
type: ut(t.element)
|
|
2398
|
-
})) : t instanceof we ? we.create(ut(t.unwrap())) : t instanceof We ? We.create(ut(t.unwrap())) : t instanceof
|
|
2443
|
+
})) : t instanceof we ? we.create(ut(t.unwrap())) : t instanceof We ? We.create(ut(t.unwrap())) : t instanceof Ee ? Ee.create(t.items.map((e) => ut(e))) : t;
|
|
2399
2444
|
}
|
|
2400
2445
|
class W extends T {
|
|
2401
2446
|
constructor() {
|
|
@@ -2404,7 +2449,7 @@ class W extends T {
|
|
|
2404
2449
|
_getCached() {
|
|
2405
2450
|
if (this._cached !== null)
|
|
2406
2451
|
return this._cached;
|
|
2407
|
-
const e = this._def.shape(), n =
|
|
2452
|
+
const e = this._def.shape(), n = C.objectKeys(e);
|
|
2408
2453
|
return this._cached = { shape: e, keys: n };
|
|
2409
2454
|
}
|
|
2410
2455
|
_parse(e) {
|
|
@@ -2425,7 +2470,7 @@ class W extends T {
|
|
|
2425
2470
|
const c = s[u], h = r.data[u];
|
|
2426
2471
|
o.push({
|
|
2427
2472
|
key: { status: "valid", value: u },
|
|
2428
|
-
value: c._parse(new
|
|
2473
|
+
value: c._parse(new xe(r, h, r.path, u)),
|
|
2429
2474
|
alwaysSet: u in r.data
|
|
2430
2475
|
});
|
|
2431
2476
|
}
|
|
@@ -2450,7 +2495,7 @@ class W extends T {
|
|
|
2450
2495
|
o.push({
|
|
2451
2496
|
key: { status: "valid", value: c },
|
|
2452
2497
|
value: u._parse(
|
|
2453
|
-
new
|
|
2498
|
+
new xe(r, h, r.path, c)
|
|
2454
2499
|
//, ctx.child(key), value, getParsedType(value)
|
|
2455
2500
|
),
|
|
2456
2501
|
alwaysSet: c in r.data
|
|
@@ -2474,7 +2519,7 @@ class W extends T {
|
|
|
2474
2519
|
return this._def.shape();
|
|
2475
2520
|
}
|
|
2476
2521
|
strict(e) {
|
|
2477
|
-
return w.errToObj, new W(d(
|
|
2522
|
+
return w.errToObj, new W(d(E(d({}, this._def), {
|
|
2478
2523
|
unknownKeys: "strict"
|
|
2479
2524
|
}), e !== void 0 ? {
|
|
2480
2525
|
errorMap: (n, r) => {
|
|
@@ -2489,12 +2534,12 @@ class W extends T {
|
|
|
2489
2534
|
} : {}));
|
|
2490
2535
|
}
|
|
2491
2536
|
strip() {
|
|
2492
|
-
return new W(
|
|
2537
|
+
return new W(E(d({}, this._def), {
|
|
2493
2538
|
unknownKeys: "strip"
|
|
2494
2539
|
}));
|
|
2495
2540
|
}
|
|
2496
2541
|
passthrough() {
|
|
2497
|
-
return new W(
|
|
2542
|
+
return new W(E(d({}, this._def), {
|
|
2498
2543
|
unknownKeys: "passthrough"
|
|
2499
2544
|
}));
|
|
2500
2545
|
}
|
|
@@ -2516,7 +2561,7 @@ class W extends T {
|
|
|
2516
2561
|
// }) as any;
|
|
2517
2562
|
// };
|
|
2518
2563
|
extend(e) {
|
|
2519
|
-
return new W(
|
|
2564
|
+
return new W(E(d({}, this._def), {
|
|
2520
2565
|
shape: () => d(d({}, this._def.shape()), e)
|
|
2521
2566
|
}));
|
|
2522
2567
|
}
|
|
@@ -2530,7 +2575,7 @@ class W extends T {
|
|
|
2530
2575
|
unknownKeys: e._def.unknownKeys,
|
|
2531
2576
|
catchall: e._def.catchall,
|
|
2532
2577
|
shape: () => d(d({}, this._def.shape()), e._def.shape()),
|
|
2533
|
-
typeName:
|
|
2578
|
+
typeName: x.ZodObject
|
|
2534
2579
|
});
|
|
2535
2580
|
}
|
|
2536
2581
|
// merge<
|
|
@@ -2593,23 +2638,23 @@ class W extends T {
|
|
|
2593
2638
|
// return merged;
|
|
2594
2639
|
// }
|
|
2595
2640
|
catchall(e) {
|
|
2596
|
-
return new W(
|
|
2641
|
+
return new W(E(d({}, this._def), {
|
|
2597
2642
|
catchall: e
|
|
2598
2643
|
}));
|
|
2599
2644
|
}
|
|
2600
2645
|
pick(e) {
|
|
2601
2646
|
const n = {};
|
|
2602
|
-
return
|
|
2647
|
+
return C.objectKeys(e).forEach((r) => {
|
|
2603
2648
|
e[r] && this.shape[r] && (n[r] = this.shape[r]);
|
|
2604
|
-
}), new W(
|
|
2649
|
+
}), new W(E(d({}, this._def), {
|
|
2605
2650
|
shape: () => n
|
|
2606
2651
|
}));
|
|
2607
2652
|
}
|
|
2608
2653
|
omit(e) {
|
|
2609
2654
|
const n = {};
|
|
2610
|
-
return
|
|
2655
|
+
return C.objectKeys(this.shape).forEach((r) => {
|
|
2611
2656
|
e[r] || (n[r] = this.shape[r]);
|
|
2612
|
-
}), new W(
|
|
2657
|
+
}), new W(E(d({}, this._def), {
|
|
2613
2658
|
shape: () => n
|
|
2614
2659
|
}));
|
|
2615
2660
|
}
|
|
@@ -2621,16 +2666,16 @@ class W extends T {
|
|
|
2621
2666
|
}
|
|
2622
2667
|
partial(e) {
|
|
2623
2668
|
const n = {};
|
|
2624
|
-
return
|
|
2669
|
+
return C.objectKeys(this.shape).forEach((r) => {
|
|
2625
2670
|
const s = this.shape[r];
|
|
2626
2671
|
e && !e[r] ? n[r] = s : n[r] = s.optional();
|
|
2627
|
-
}), new W(
|
|
2672
|
+
}), new W(E(d({}, this._def), {
|
|
2628
2673
|
shape: () => n
|
|
2629
2674
|
}));
|
|
2630
2675
|
}
|
|
2631
2676
|
required(e) {
|
|
2632
2677
|
const n = {};
|
|
2633
|
-
return
|
|
2678
|
+
return C.objectKeys(this.shape).forEach((r) => {
|
|
2634
2679
|
if (e && !e[r])
|
|
2635
2680
|
n[r] = this.shape[r];
|
|
2636
2681
|
else {
|
|
@@ -2639,31 +2684,31 @@ class W extends T {
|
|
|
2639
2684
|
s = s._def.innerType;
|
|
2640
2685
|
n[r] = s;
|
|
2641
2686
|
}
|
|
2642
|
-
}), new W(
|
|
2687
|
+
}), new W(E(d({}, this._def), {
|
|
2643
2688
|
shape: () => n
|
|
2644
2689
|
}));
|
|
2645
2690
|
}
|
|
2646
2691
|
keyof() {
|
|
2647
|
-
return Zs(
|
|
2692
|
+
return Zs(C.objectKeys(this.shape));
|
|
2648
2693
|
}
|
|
2649
2694
|
}
|
|
2650
2695
|
W.create = (t, e) => new W(d({
|
|
2651
2696
|
shape: () => t,
|
|
2652
2697
|
unknownKeys: "strip",
|
|
2653
2698
|
catchall: Re.create(),
|
|
2654
|
-
typeName:
|
|
2699
|
+
typeName: x.ZodObject
|
|
2655
2700
|
}, O(e)));
|
|
2656
2701
|
W.strictCreate = (t, e) => new W(d({
|
|
2657
2702
|
shape: () => t,
|
|
2658
2703
|
unknownKeys: "strict",
|
|
2659
2704
|
catchall: Re.create(),
|
|
2660
|
-
typeName:
|
|
2705
|
+
typeName: x.ZodObject
|
|
2661
2706
|
}, O(e)));
|
|
2662
2707
|
W.lazycreate = (t, e) => new W(d({
|
|
2663
2708
|
shape: t,
|
|
2664
2709
|
unknownKeys: "strip",
|
|
2665
2710
|
catchall: Re.create(),
|
|
2666
|
-
typeName:
|
|
2711
|
+
typeName: x.ZodObject
|
|
2667
2712
|
}, O(e)));
|
|
2668
2713
|
class Dt extends T {
|
|
2669
2714
|
_parse(e) {
|
|
@@ -2683,8 +2728,8 @@ class Dt extends T {
|
|
|
2683
2728
|
}
|
|
2684
2729
|
if (n.common.async)
|
|
2685
2730
|
return Promise.all(r.map((a) => ke(this, null, function* () {
|
|
2686
|
-
const i =
|
|
2687
|
-
common:
|
|
2731
|
+
const i = E(d({}, n), {
|
|
2732
|
+
common: E(d({}, n.common), {
|
|
2688
2733
|
issues: []
|
|
2689
2734
|
}),
|
|
2690
2735
|
parent: null
|
|
@@ -2702,8 +2747,8 @@ class Dt extends T {
|
|
|
2702
2747
|
let a;
|
|
2703
2748
|
const i = [];
|
|
2704
2749
|
for (const u of r) {
|
|
2705
|
-
const c =
|
|
2706
|
-
common:
|
|
2750
|
+
const c = E(d({}, n), {
|
|
2751
|
+
common: E(d({}, n.common), {
|
|
2707
2752
|
issues: []
|
|
2708
2753
|
}),
|
|
2709
2754
|
parent: null
|
|
@@ -2731,10 +2776,10 @@ class Dt extends T {
|
|
|
2731
2776
|
}
|
|
2732
2777
|
Dt.create = (t, e) => new Dt(d({
|
|
2733
2778
|
options: t,
|
|
2734
|
-
typeName:
|
|
2779
|
+
typeName: x.ZodUnion
|
|
2735
2780
|
}, O(e)));
|
|
2736
|
-
const Ze = (t) => t instanceof $t ? Ze(t.schema) : t instanceof me ? Ze(t.innerType()) : t instanceof Ft ? [t.value] : t instanceof Fe ? t.options : t instanceof Wt ?
|
|
2737
|
-
class
|
|
2781
|
+
const Ze = (t) => t instanceof $t ? Ze(t.schema) : t instanceof me ? Ze(t.innerType()) : t instanceof Ft ? [t.value] : t instanceof Fe ? t.options : t instanceof Wt ? C.objectValues(t.enum) : t instanceof zt ? Ze(t._def.innerType) : t instanceof jt ? [void 0] : t instanceof Zt ? [null] : t instanceof we ? [void 0, ...Ze(t.unwrap())] : t instanceof We ? [null, ...Ze(t.unwrap())] : t instanceof Pr || t instanceof Ut ? Ze(t.unwrap()) : t instanceof Vt ? Ze(t._def.innerType) : [];
|
|
2782
|
+
class En extends T {
|
|
2738
2783
|
_parse(e) {
|
|
2739
2784
|
const { ctx: n } = this._processInputParams(e);
|
|
2740
2785
|
if (n.parsedType !== v.object)
|
|
@@ -2787,8 +2832,8 @@ class xn extends T {
|
|
|
2787
2832
|
s.set(o, a);
|
|
2788
2833
|
}
|
|
2789
2834
|
}
|
|
2790
|
-
return new
|
|
2791
|
-
typeName:
|
|
2835
|
+
return new En(d({
|
|
2836
|
+
typeName: x.ZodDiscriminatedUnion,
|
|
2792
2837
|
discriminator: e,
|
|
2793
2838
|
options: n,
|
|
2794
2839
|
optionsMap: s
|
|
@@ -2800,7 +2845,7 @@ function ar(t, e) {
|
|
|
2800
2845
|
if (t === e)
|
|
2801
2846
|
return { valid: !0, data: t };
|
|
2802
2847
|
if (n === v.object && r === v.object) {
|
|
2803
|
-
const s =
|
|
2848
|
+
const s = C.objectKeys(e), a = C.objectKeys(t).filter((o) => s.indexOf(o) !== -1), i = d(d({}, t), e);
|
|
2804
2849
|
for (const o of a) {
|
|
2805
2850
|
const u = ar(t[o], e[o]);
|
|
2806
2851
|
if (!u.valid)
|
|
@@ -2856,9 +2901,9 @@ class Mt extends T {
|
|
|
2856
2901
|
Mt.create = (t, e, n) => new Mt(d({
|
|
2857
2902
|
left: t,
|
|
2858
2903
|
right: e,
|
|
2859
|
-
typeName:
|
|
2904
|
+
typeName: x.ZodIntersection
|
|
2860
2905
|
}, O(n)));
|
|
2861
|
-
class
|
|
2906
|
+
class Ee extends T {
|
|
2862
2907
|
_parse(e) {
|
|
2863
2908
|
const { status: n, ctx: r } = this._processInputParams(e);
|
|
2864
2909
|
if (r.parsedType !== v.array)
|
|
@@ -2884,7 +2929,7 @@ class xe extends T {
|
|
|
2884
2929
|
}), n.dirty());
|
|
2885
2930
|
const s = [...r.data].map((a, i) => {
|
|
2886
2931
|
const o = this._def.items[i] || this._def.rest;
|
|
2887
|
-
return o ? o._parse(new
|
|
2932
|
+
return o ? o._parse(new xe(r, a, r.path, i)) : null;
|
|
2888
2933
|
}).filter((a) => !!a);
|
|
2889
2934
|
return r.common.async ? Promise.all(s).then((a) => X.mergeArray(n, a)) : X.mergeArray(n, s);
|
|
2890
2935
|
}
|
|
@@ -2892,17 +2937,17 @@ class xe extends T {
|
|
|
2892
2937
|
return this._def.items;
|
|
2893
2938
|
}
|
|
2894
2939
|
rest(e) {
|
|
2895
|
-
return new
|
|
2940
|
+
return new Ee(E(d({}, this._def), {
|
|
2896
2941
|
rest: e
|
|
2897
2942
|
}));
|
|
2898
2943
|
}
|
|
2899
2944
|
}
|
|
2900
|
-
|
|
2945
|
+
Ee.create = (t, e) => {
|
|
2901
2946
|
if (!Array.isArray(t))
|
|
2902
2947
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2903
|
-
return new
|
|
2948
|
+
return new Ee(d({
|
|
2904
2949
|
items: t,
|
|
2905
|
-
typeName:
|
|
2950
|
+
typeName: x.ZodTuple,
|
|
2906
2951
|
rest: null
|
|
2907
2952
|
}, O(e)));
|
|
2908
2953
|
};
|
|
@@ -2924,8 +2969,8 @@ class Lt extends T {
|
|
|
2924
2969
|
const s = [], a = this._def.keyType, i = this._def.valueType;
|
|
2925
2970
|
for (const o in r.data)
|
|
2926
2971
|
s.push({
|
|
2927
|
-
key: a._parse(new
|
|
2928
|
-
value: i._parse(new
|
|
2972
|
+
key: a._parse(new xe(r, o, r.path, o)),
|
|
2973
|
+
value: i._parse(new xe(r, r.data[o], r.path, o)),
|
|
2929
2974
|
alwaysSet: o in r.data
|
|
2930
2975
|
});
|
|
2931
2976
|
return r.common.async ? X.mergeObjectAsync(n, s) : X.mergeObjectSync(n, s);
|
|
@@ -2937,11 +2982,11 @@ class Lt extends T {
|
|
|
2937
2982
|
return n instanceof T ? new Lt(d({
|
|
2938
2983
|
keyType: e,
|
|
2939
2984
|
valueType: n,
|
|
2940
|
-
typeName:
|
|
2985
|
+
typeName: x.ZodRecord
|
|
2941
2986
|
}, O(r))) : new Lt(d({
|
|
2942
2987
|
keyType: he.create(),
|
|
2943
2988
|
valueType: e,
|
|
2944
|
-
typeName:
|
|
2989
|
+
typeName: x.ZodRecord
|
|
2945
2990
|
}, O(n)));
|
|
2946
2991
|
}
|
|
2947
2992
|
}
|
|
@@ -2961,8 +3006,8 @@ class _n extends T {
|
|
|
2961
3006
|
received: r.parsedType
|
|
2962
3007
|
}), S;
|
|
2963
3008
|
const s = this._def.keyType, a = this._def.valueType, i = [...r.data.entries()].map(([o, u], c) => ({
|
|
2964
|
-
key: s._parse(new
|
|
2965
|
-
value: a._parse(new
|
|
3009
|
+
key: s._parse(new xe(r, o, r.path, [c, "key"])),
|
|
3010
|
+
value: a._parse(new xe(r, u, r.path, [c, "value"]))
|
|
2966
3011
|
}));
|
|
2967
3012
|
if (r.common.async) {
|
|
2968
3013
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -2990,7 +3035,7 @@ class _n extends T {
|
|
|
2990
3035
|
_n.create = (t, e, n) => new _n(d({
|
|
2991
3036
|
valueType: e,
|
|
2992
3037
|
keyType: t,
|
|
2993
|
-
typeName:
|
|
3038
|
+
typeName: x.ZodMap
|
|
2994
3039
|
}, O(n)));
|
|
2995
3040
|
class et extends T {
|
|
2996
3041
|
_parse(e) {
|
|
@@ -3027,16 +3072,16 @@ class et extends T {
|
|
|
3027
3072
|
}
|
|
3028
3073
|
return { status: n.value, value: c };
|
|
3029
3074
|
}
|
|
3030
|
-
const o = [...r.data.values()].map((u, c) => a._parse(new
|
|
3075
|
+
const o = [...r.data.values()].map((u, c) => a._parse(new xe(r, u, r.path, c)));
|
|
3031
3076
|
return r.common.async ? Promise.all(o).then((u) => i(u)) : i(o);
|
|
3032
3077
|
}
|
|
3033
3078
|
min(e, n) {
|
|
3034
|
-
return new et(
|
|
3079
|
+
return new et(E(d({}, this._def), {
|
|
3035
3080
|
minSize: { value: e, message: w.toString(n) }
|
|
3036
3081
|
}));
|
|
3037
3082
|
}
|
|
3038
3083
|
max(e, n) {
|
|
3039
|
-
return new et(
|
|
3084
|
+
return new et(E(d({}, this._def), {
|
|
3040
3085
|
maxSize: { value: e, message: w.toString(n) }
|
|
3041
3086
|
}));
|
|
3042
3087
|
}
|
|
@@ -3051,7 +3096,7 @@ et.create = (t, e) => new et(d({
|
|
|
3051
3096
|
valueType: t,
|
|
3052
3097
|
minSize: null,
|
|
3053
3098
|
maxSize: null,
|
|
3054
|
-
typeName:
|
|
3099
|
+
typeName: x.ZodSet
|
|
3055
3100
|
}, O(e)));
|
|
3056
3101
|
class ht extends T {
|
|
3057
3102
|
constructor() {
|
|
@@ -3130,12 +3175,12 @@ class ht extends T {
|
|
|
3130
3175
|
return this._def.returns;
|
|
3131
3176
|
}
|
|
3132
3177
|
args(...e) {
|
|
3133
|
-
return new ht(
|
|
3134
|
-
args:
|
|
3178
|
+
return new ht(E(d({}, this._def), {
|
|
3179
|
+
args: Ee.create(e).rest(Xe.create())
|
|
3135
3180
|
}));
|
|
3136
3181
|
}
|
|
3137
3182
|
returns(e) {
|
|
3138
|
-
return new ht(
|
|
3183
|
+
return new ht(E(d({}, this._def), {
|
|
3139
3184
|
returns: e
|
|
3140
3185
|
}));
|
|
3141
3186
|
}
|
|
@@ -3147,9 +3192,9 @@ class ht extends T {
|
|
|
3147
3192
|
}
|
|
3148
3193
|
static create(e, n, r) {
|
|
3149
3194
|
return new ht(d({
|
|
3150
|
-
args: e ||
|
|
3195
|
+
args: e || Ee.create([]).rest(Xe.create()),
|
|
3151
3196
|
returns: n || Xe.create(),
|
|
3152
|
-
typeName:
|
|
3197
|
+
typeName: x.ZodFunction
|
|
3153
3198
|
}, O(r)));
|
|
3154
3199
|
}
|
|
3155
3200
|
}
|
|
@@ -3164,7 +3209,7 @@ class $t extends T {
|
|
|
3164
3209
|
}
|
|
3165
3210
|
$t.create = (t, e) => new $t(d({
|
|
3166
3211
|
getter: t,
|
|
3167
|
-
typeName:
|
|
3212
|
+
typeName: x.ZodLazy
|
|
3168
3213
|
}, O(e)));
|
|
3169
3214
|
class Ft extends T {
|
|
3170
3215
|
_parse(e) {
|
|
@@ -3184,12 +3229,12 @@ class Ft extends T {
|
|
|
3184
3229
|
}
|
|
3185
3230
|
Ft.create = (t, e) => new Ft(d({
|
|
3186
3231
|
value: t,
|
|
3187
|
-
typeName:
|
|
3232
|
+
typeName: x.ZodLiteral
|
|
3188
3233
|
}, O(e)));
|
|
3189
3234
|
function Zs(t, e) {
|
|
3190
3235
|
return new Fe(d({
|
|
3191
3236
|
values: t,
|
|
3192
|
-
typeName:
|
|
3237
|
+
typeName: x.ZodEnum
|
|
3193
3238
|
}, O(e)));
|
|
3194
3239
|
}
|
|
3195
3240
|
class Fe extends T {
|
|
@@ -3200,7 +3245,7 @@ class Fe extends T {
|
|
|
3200
3245
|
if (typeof e.data != "string") {
|
|
3201
3246
|
const n = this._getOrReturnCtx(e), r = this._def.values;
|
|
3202
3247
|
return g(n, {
|
|
3203
|
-
expected:
|
|
3248
|
+
expected: C.joinValues(r),
|
|
3204
3249
|
received: n.parsedType,
|
|
3205
3250
|
code: f.invalid_type
|
|
3206
3251
|
}), S;
|
|
@@ -3250,17 +3295,17 @@ class Wt extends T {
|
|
|
3250
3295
|
super(...arguments), Tt.set(this, void 0);
|
|
3251
3296
|
}
|
|
3252
3297
|
_parse(e) {
|
|
3253
|
-
const n =
|
|
3298
|
+
const n = C.getValidEnumValues(this._def.values), r = this._getOrReturnCtx(e);
|
|
3254
3299
|
if (r.parsedType !== v.string && r.parsedType !== v.number) {
|
|
3255
|
-
const s =
|
|
3300
|
+
const s = C.objectValues(n);
|
|
3256
3301
|
return g(r, {
|
|
3257
|
-
expected:
|
|
3302
|
+
expected: C.joinValues(s),
|
|
3258
3303
|
received: r.parsedType,
|
|
3259
3304
|
code: f.invalid_type
|
|
3260
3305
|
}), S;
|
|
3261
3306
|
}
|
|
3262
|
-
if (mn(this, Tt) || Ps(this, Tt, new Set(
|
|
3263
|
-
const s =
|
|
3307
|
+
if (mn(this, Tt) || Ps(this, Tt, new Set(C.getValidEnumValues(this._def.values))), !mn(this, Tt).has(e.data)) {
|
|
3308
|
+
const s = C.objectValues(n);
|
|
3264
3309
|
return g(r, {
|
|
3265
3310
|
received: r.data,
|
|
3266
3311
|
code: f.invalid_enum_value,
|
|
@@ -3276,7 +3321,7 @@ class Wt extends T {
|
|
|
3276
3321
|
Tt = /* @__PURE__ */ new WeakMap();
|
|
3277
3322
|
Wt.create = (t, e) => new Wt(d({
|
|
3278
3323
|
values: t,
|
|
3279
|
-
typeName:
|
|
3324
|
+
typeName: x.ZodNativeEnum
|
|
3280
3325
|
}, O(e)));
|
|
3281
3326
|
class _t extends T {
|
|
3282
3327
|
unwrap() {
|
|
@@ -3299,14 +3344,14 @@ class _t extends T {
|
|
|
3299
3344
|
}
|
|
3300
3345
|
_t.create = (t, e) => new _t(d({
|
|
3301
3346
|
type: t,
|
|
3302
|
-
typeName:
|
|
3347
|
+
typeName: x.ZodPromise
|
|
3303
3348
|
}, O(e)));
|
|
3304
3349
|
class me extends T {
|
|
3305
3350
|
innerType() {
|
|
3306
3351
|
return this._def.schema;
|
|
3307
3352
|
}
|
|
3308
3353
|
sourceType() {
|
|
3309
|
-
return this._def.schema._def.typeName ===
|
|
3354
|
+
return this._def.schema._def.typeName === x.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
3310
3355
|
}
|
|
3311
3356
|
_parse(e) {
|
|
3312
3357
|
const { status: n, ctx: r } = this._processInputParams(e), s = this._def.effect || null, a = {
|
|
@@ -3375,18 +3420,18 @@ class me extends T {
|
|
|
3375
3420
|
return { status: n.value, value: o };
|
|
3376
3421
|
} else
|
|
3377
3422
|
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((i) => Ye(i) ? Promise.resolve(s.transform(i.value, a)).then((o) => ({ status: n.value, value: o })) : i);
|
|
3378
|
-
|
|
3423
|
+
C.assertNever(s);
|
|
3379
3424
|
}
|
|
3380
3425
|
}
|
|
3381
3426
|
me.create = (t, e, n) => new me(d({
|
|
3382
3427
|
schema: t,
|
|
3383
|
-
typeName:
|
|
3428
|
+
typeName: x.ZodEffects,
|
|
3384
3429
|
effect: e
|
|
3385
3430
|
}, O(n)));
|
|
3386
3431
|
me.createWithPreprocess = (t, e, n) => new me(d({
|
|
3387
3432
|
schema: e,
|
|
3388
3433
|
effect: { type: "preprocess", transform: t },
|
|
3389
|
-
typeName:
|
|
3434
|
+
typeName: x.ZodEffects
|
|
3390
3435
|
}, O(n)));
|
|
3391
3436
|
class we extends T {
|
|
3392
3437
|
_parse(e) {
|
|
@@ -3398,7 +3443,7 @@ class we extends T {
|
|
|
3398
3443
|
}
|
|
3399
3444
|
we.create = (t, e) => new we(d({
|
|
3400
3445
|
innerType: t,
|
|
3401
|
-
typeName:
|
|
3446
|
+
typeName: x.ZodOptional
|
|
3402
3447
|
}, O(e)));
|
|
3403
3448
|
class We extends T {
|
|
3404
3449
|
_parse(e) {
|
|
@@ -3410,7 +3455,7 @@ class We extends T {
|
|
|
3410
3455
|
}
|
|
3411
3456
|
We.create = (t, e) => new We(d({
|
|
3412
3457
|
innerType: t,
|
|
3413
|
-
typeName:
|
|
3458
|
+
typeName: x.ZodNullable
|
|
3414
3459
|
}, O(e)));
|
|
3415
3460
|
class zt extends T {
|
|
3416
3461
|
_parse(e) {
|
|
@@ -3428,13 +3473,13 @@ class zt extends T {
|
|
|
3428
3473
|
}
|
|
3429
3474
|
zt.create = (t, e) => new zt(d({
|
|
3430
3475
|
innerType: t,
|
|
3431
|
-
typeName:
|
|
3476
|
+
typeName: x.ZodDefault,
|
|
3432
3477
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default
|
|
3433
3478
|
}, O(e)));
|
|
3434
3479
|
class Vt extends T {
|
|
3435
3480
|
_parse(e) {
|
|
3436
|
-
const { ctx: n } = this._processInputParams(e), r =
|
|
3437
|
-
common:
|
|
3481
|
+
const { ctx: n } = this._processInputParams(e), r = E(d({}, n), {
|
|
3482
|
+
common: E(d({}, n.common), {
|
|
3438
3483
|
issues: []
|
|
3439
3484
|
})
|
|
3440
3485
|
}), s = this._def.innerType._parse({
|
|
@@ -3466,7 +3511,7 @@ class Vt extends T {
|
|
|
3466
3511
|
}
|
|
3467
3512
|
Vt.create = (t, e) => new Vt(d({
|
|
3468
3513
|
innerType: t,
|
|
3469
|
-
typeName:
|
|
3514
|
+
typeName: x.ZodCatch,
|
|
3470
3515
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch
|
|
3471
3516
|
}, O(e)));
|
|
3472
3517
|
class vn extends T {
|
|
@@ -3483,9 +3528,9 @@ class vn extends T {
|
|
|
3483
3528
|
}
|
|
3484
3529
|
}
|
|
3485
3530
|
vn.create = (t) => new vn(d({
|
|
3486
|
-
typeName:
|
|
3531
|
+
typeName: x.ZodNaN
|
|
3487
3532
|
}, O(t)));
|
|
3488
|
-
const
|
|
3533
|
+
const Yi = Symbol("zod_brand");
|
|
3489
3534
|
class Pr extends T {
|
|
3490
3535
|
_parse(e) {
|
|
3491
3536
|
const { ctx: n } = this._processInputParams(e), r = n.data;
|
|
@@ -3535,7 +3580,7 @@ class Jt extends T {
|
|
|
3535
3580
|
return new Jt({
|
|
3536
3581
|
in: e,
|
|
3537
3582
|
out: n,
|
|
3538
|
-
typeName:
|
|
3583
|
+
typeName: x.ZodPipeline
|
|
3539
3584
|
});
|
|
3540
3585
|
}
|
|
3541
3586
|
}
|
|
@@ -3550,42 +3595,42 @@ class Ut extends T {
|
|
|
3550
3595
|
}
|
|
3551
3596
|
Ut.create = (t, e) => new Ut(d({
|
|
3552
3597
|
innerType: t,
|
|
3553
|
-
typeName:
|
|
3598
|
+
typeName: x.ZodReadonly
|
|
3554
3599
|
}, O(e)));
|
|
3555
3600
|
function Ds(t, e = {}, n) {
|
|
3556
3601
|
return t ? gt.create().superRefine((r, s) => {
|
|
3557
3602
|
var a, i;
|
|
3558
3603
|
if (!t(r)) {
|
|
3559
3604
|
const o = typeof e == "function" ? e(r) : typeof e == "string" ? { message: e } : e, u = (i = (a = o.fatal) !== null && a !== void 0 ? a : n) !== null && i !== void 0 ? i : !0, c = typeof o == "string" ? { message: o } : o;
|
|
3560
|
-
s.addIssue(
|
|
3605
|
+
s.addIssue(E(d({ code: "custom" }, c), { fatal: u }));
|
|
3561
3606
|
}
|
|
3562
3607
|
}) : gt.create();
|
|
3563
3608
|
}
|
|
3564
|
-
const
|
|
3609
|
+
const Qi = {
|
|
3565
3610
|
object: W.lazycreate
|
|
3566
3611
|
};
|
|
3567
|
-
var
|
|
3612
|
+
var x;
|
|
3568
3613
|
(function(t) {
|
|
3569
3614
|
t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
|
|
3570
|
-
})(
|
|
3571
|
-
const
|
|
3615
|
+
})(x || (x = {}));
|
|
3616
|
+
const eo = (t, e = {
|
|
3572
3617
|
message: `Input not instance of ${t.name}`
|
|
3573
|
-
}) => Ds((n) => n instanceof t, e), Ms = he.create, Ls = Le.create,
|
|
3574
|
-
string: (t) => he.create(
|
|
3575
|
-
number: (t) => Le.create(
|
|
3576
|
-
boolean: (t) => It.create(
|
|
3618
|
+
}) => Ds((n) => n instanceof t, e), Ms = he.create, Ls = Le.create, to = vn.create, no = $e.create, $s = It.create, ro = Qe.create, so = yn.create, ao = jt.create, io = Zt.create, oo = gt.create, uo = Xe.create, co = Re.create, lo = gn.create, fo = pe.create, ho = W.create, po = W.strictCreate, mo = Dt.create, yo = En.create, go = Mt.create, _o = Ee.create, vo = Lt.create, bo = _n.create, wo = et.create, ko = ht.create, xo = $t.create, Eo = Ft.create, So = Fe.create, Oo = Wt.create, To = _t.create, is = me.create, Ao = we.create, Co = We.create, No = me.createWithPreprocess, Po = Jt.create, Ro = () => Ms().optional(), Io = () => Ls().optional(), jo = () => $s().optional(), Zo = {
|
|
3619
|
+
string: (t) => he.create(E(d({}, t), { coerce: !0 })),
|
|
3620
|
+
number: (t) => Le.create(E(d({}, t), { coerce: !0 })),
|
|
3621
|
+
boolean: (t) => It.create(E(d({}, t), {
|
|
3577
3622
|
coerce: !0
|
|
3578
3623
|
})),
|
|
3579
|
-
bigint: (t) => $e.create(
|
|
3580
|
-
date: (t) => Qe.create(
|
|
3581
|
-
},
|
|
3582
|
-
var
|
|
3624
|
+
bigint: (t) => $e.create(E(d({}, t), { coerce: !0 })),
|
|
3625
|
+
date: (t) => Qe.create(E(d({}, t), { coerce: !0 }))
|
|
3626
|
+
}, Do = S;
|
|
3627
|
+
var H = /* @__PURE__ */ Object.freeze({
|
|
3583
3628
|
__proto__: null,
|
|
3584
3629
|
defaultErrorMap: yt,
|
|
3585
|
-
setErrorMap:
|
|
3630
|
+
setErrorMap: Ci,
|
|
3586
3631
|
getErrorMap: fn,
|
|
3587
3632
|
makeIssue: hn,
|
|
3588
|
-
EMPTY_PATH:
|
|
3633
|
+
EMPTY_PATH: Ni,
|
|
3589
3634
|
addIssueToContext: g,
|
|
3590
3635
|
ParseStatus: X,
|
|
3591
3636
|
INVALID: S,
|
|
@@ -3596,7 +3641,7 @@ var K = /* @__PURE__ */ Object.freeze({
|
|
|
3596
3641
|
isValid: Ye,
|
|
3597
3642
|
isAsync: Rt,
|
|
3598
3643
|
get util() {
|
|
3599
|
-
return
|
|
3644
|
+
return C;
|
|
3600
3645
|
},
|
|
3601
3646
|
get objectUtil() {
|
|
3602
3647
|
return nr;
|
|
@@ -3620,9 +3665,9 @@ var K = /* @__PURE__ */ Object.freeze({
|
|
|
3620
3665
|
ZodArray: pe,
|
|
3621
3666
|
ZodObject: W,
|
|
3622
3667
|
ZodUnion: Dt,
|
|
3623
|
-
ZodDiscriminatedUnion:
|
|
3668
|
+
ZodDiscriminatedUnion: En,
|
|
3624
3669
|
ZodIntersection: Mt,
|
|
3625
|
-
ZodTuple:
|
|
3670
|
+
ZodTuple: Ee,
|
|
3626
3671
|
ZodRecord: Lt,
|
|
3627
3672
|
ZodMap: _n,
|
|
3628
3673
|
ZodSet: et,
|
|
@@ -3639,71 +3684,71 @@ var K = /* @__PURE__ */ Object.freeze({
|
|
|
3639
3684
|
ZodDefault: zt,
|
|
3640
3685
|
ZodCatch: Vt,
|
|
3641
3686
|
ZodNaN: vn,
|
|
3642
|
-
BRAND:
|
|
3687
|
+
BRAND: Yi,
|
|
3643
3688
|
ZodBranded: Pr,
|
|
3644
3689
|
ZodPipeline: Jt,
|
|
3645
3690
|
ZodReadonly: Ut,
|
|
3646
3691
|
custom: Ds,
|
|
3647
3692
|
Schema: T,
|
|
3648
3693
|
ZodSchema: T,
|
|
3649
|
-
late:
|
|
3694
|
+
late: Qi,
|
|
3650
3695
|
get ZodFirstPartyTypeKind() {
|
|
3651
|
-
return
|
|
3696
|
+
return x;
|
|
3652
3697
|
},
|
|
3653
|
-
coerce:
|
|
3654
|
-
any:
|
|
3655
|
-
array:
|
|
3656
|
-
bigint:
|
|
3698
|
+
coerce: Zo,
|
|
3699
|
+
any: oo,
|
|
3700
|
+
array: fo,
|
|
3701
|
+
bigint: no,
|
|
3657
3702
|
boolean: $s,
|
|
3658
|
-
date:
|
|
3659
|
-
discriminatedUnion:
|
|
3703
|
+
date: ro,
|
|
3704
|
+
discriminatedUnion: yo,
|
|
3660
3705
|
effect: is,
|
|
3661
|
-
enum:
|
|
3662
|
-
function:
|
|
3663
|
-
instanceof:
|
|
3664
|
-
intersection:
|
|
3665
|
-
lazy:
|
|
3666
|
-
literal:
|
|
3667
|
-
map:
|
|
3668
|
-
nan:
|
|
3669
|
-
nativeEnum:
|
|
3670
|
-
never:
|
|
3671
|
-
null:
|
|
3672
|
-
nullable:
|
|
3706
|
+
enum: So,
|
|
3707
|
+
function: ko,
|
|
3708
|
+
instanceof: eo,
|
|
3709
|
+
intersection: go,
|
|
3710
|
+
lazy: xo,
|
|
3711
|
+
literal: Eo,
|
|
3712
|
+
map: bo,
|
|
3713
|
+
nan: to,
|
|
3714
|
+
nativeEnum: Oo,
|
|
3715
|
+
never: co,
|
|
3716
|
+
null: io,
|
|
3717
|
+
nullable: Co,
|
|
3673
3718
|
number: Ls,
|
|
3674
|
-
object:
|
|
3675
|
-
oboolean:
|
|
3676
|
-
onumber:
|
|
3677
|
-
optional:
|
|
3678
|
-
ostring:
|
|
3679
|
-
pipeline:
|
|
3680
|
-
preprocess:
|
|
3681
|
-
promise:
|
|
3682
|
-
record:
|
|
3683
|
-
set:
|
|
3684
|
-
strictObject:
|
|
3719
|
+
object: ho,
|
|
3720
|
+
oboolean: jo,
|
|
3721
|
+
onumber: Io,
|
|
3722
|
+
optional: Ao,
|
|
3723
|
+
ostring: Ro,
|
|
3724
|
+
pipeline: Po,
|
|
3725
|
+
preprocess: No,
|
|
3726
|
+
promise: To,
|
|
3727
|
+
record: vo,
|
|
3728
|
+
set: wo,
|
|
3729
|
+
strictObject: po,
|
|
3685
3730
|
string: Ms,
|
|
3686
|
-
symbol:
|
|
3731
|
+
symbol: so,
|
|
3687
3732
|
transformer: is,
|
|
3688
|
-
tuple:
|
|
3689
|
-
undefined:
|
|
3690
|
-
union:
|
|
3691
|
-
unknown:
|
|
3692
|
-
void:
|
|
3693
|
-
NEVER:
|
|
3733
|
+
tuple: _o,
|
|
3734
|
+
undefined: ao,
|
|
3735
|
+
union: mo,
|
|
3736
|
+
unknown: uo,
|
|
3737
|
+
void: lo,
|
|
3738
|
+
NEVER: Do,
|
|
3694
3739
|
ZodIssueCode: f,
|
|
3695
|
-
quotelessJson:
|
|
3740
|
+
quotelessJson: Ai,
|
|
3696
3741
|
ZodError: ie
|
|
3697
3742
|
});
|
|
3698
|
-
|
|
3699
|
-
language:
|
|
3700
|
-
disableMarkedForExport:
|
|
3743
|
+
H.object({
|
|
3744
|
+
language: H.enum(["typescript", "javascript"]).optional(),
|
|
3745
|
+
disableMarkedForExport: H.boolean().optional()
|
|
3701
3746
|
}).and(
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
framework:
|
|
3705
|
-
model:
|
|
3706
|
-
styling:
|
|
3747
|
+
H.union([
|
|
3748
|
+
H.object({
|
|
3749
|
+
framework: H.literal("react"),
|
|
3750
|
+
model: H.string().optional(),
|
|
3751
|
+
styling: H.enum([
|
|
3707
3752
|
"plain_css",
|
|
3708
3753
|
"css_modules",
|
|
3709
3754
|
"styled_components",
|
|
@@ -3712,20 +3757,20 @@ K.object({
|
|
|
3712
3757
|
"scss",
|
|
3713
3758
|
"inline_styles"
|
|
3714
3759
|
]),
|
|
3715
|
-
uiLibrary:
|
|
3716
|
-
enableUILibraryTheming:
|
|
3717
|
-
enableCompactStructure:
|
|
3718
|
-
enableAutoSplit:
|
|
3719
|
-
autoSplitThreshold:
|
|
3760
|
+
uiLibrary: H.enum(["mui", "antd", "radix", "shadcn"]).optional(),
|
|
3761
|
+
enableUILibraryTheming: H.boolean().optional(),
|
|
3762
|
+
enableCompactStructure: H.boolean().optional(),
|
|
3763
|
+
enableAutoSplit: H.boolean().optional(),
|
|
3764
|
+
autoSplitThreshold: H.number().optional()
|
|
3720
3765
|
}),
|
|
3721
|
-
|
|
3722
|
-
framework:
|
|
3723
|
-
styling:
|
|
3724
|
-
enableTranslation:
|
|
3766
|
+
H.object({
|
|
3767
|
+
framework: H.literal("html"),
|
|
3768
|
+
styling: H.enum(["plain_css", "inline_styles"]),
|
|
3769
|
+
enableTranslation: H.boolean().optional()
|
|
3725
3770
|
})
|
|
3726
3771
|
])
|
|
3727
3772
|
);
|
|
3728
|
-
var
|
|
3773
|
+
var Mo = Object.defineProperty, Lo = (t, e, n) => e in t ? Mo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, tn = (t, e, n) => Lo(t, typeof e != "symbol" ? e + "" : e, n);
|
|
3729
3774
|
class os extends Error {
|
|
3730
3775
|
constructor(e, n) {
|
|
3731
3776
|
super(e), tn(this, "type"), tn(this, "field"), tn(this, "value"), tn(this, "line"), this.name = "ParseError", this.type = n.type, this.field = n.field, this.value = n.value, this.line = n.line;
|
|
@@ -3733,11 +3778,11 @@ class os extends Error {
|
|
|
3733
3778
|
}
|
|
3734
3779
|
function Dn(t) {
|
|
3735
3780
|
}
|
|
3736
|
-
function
|
|
3781
|
+
function $o(t) {
|
|
3737
3782
|
const { onEvent: e = Dn, onError: n = Dn, onRetry: r = Dn, onComment: s } = t;
|
|
3738
3783
|
let a = "", i = !0, o, u = "", c = "";
|
|
3739
3784
|
function h(l) {
|
|
3740
|
-
const y = i ? l.replace(/^\xEF\xBB\xBF/, "") : l, [m, $] =
|
|
3785
|
+
const y = i ? l.replace(/^\xEF\xBB\xBF/, "") : l, [m, $] = Fo(`${a}${y}`);
|
|
3741
3786
|
for (const P of m)
|
|
3742
3787
|
p(P);
|
|
3743
3788
|
a = $, i = !1;
|
|
@@ -3805,7 +3850,7 @@ function No(t) {
|
|
|
3805
3850
|
}
|
|
3806
3851
|
return { feed: h, reset: b };
|
|
3807
3852
|
}
|
|
3808
|
-
function
|
|
3853
|
+
function Fo(t) {
|
|
3809
3854
|
const e = [];
|
|
3810
3855
|
let n = "";
|
|
3811
3856
|
const r = t.length;
|
|
@@ -3859,7 +3904,7 @@ class us extends Event {
|
|
|
3859
3904
|
return e(cs(this), n);
|
|
3860
3905
|
}
|
|
3861
3906
|
}
|
|
3862
|
-
function
|
|
3907
|
+
function Wo(t) {
|
|
3863
3908
|
const e = globalThis.DOMException;
|
|
3864
3909
|
return typeof e == "function" ? new e(t, "SyntaxError") : new SyntaxError(t);
|
|
3865
3910
|
}
|
|
@@ -3878,69 +3923,69 @@ function cs(t) {
|
|
|
3878
3923
|
}
|
|
3879
3924
|
var Fs = (t) => {
|
|
3880
3925
|
throw TypeError(t);
|
|
3881
|
-
}, Rr = (t, e, n) => e.has(t) || Fs("Cannot " + n),
|
|
3926
|
+
}, Rr = (t, e, n) => e.has(t) || Fs("Cannot " + n), A = (t, e, n) => (Rr(t, e, "read from private field"), n ? n.call(t) : e.get(t)), B = (t, e, n) => e.has(t) ? Fs("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), L = (t, e, n, r) => (Rr(t, e, "write to private field"), e.set(t, n), n), Ce = (t, e, n) => (Rr(t, e, "access private method"), n), re, Je, ct, dn, bn, Nt, ft, Pt, De, dt, pt, lt, At, fe, or, ur, cr, ds, dr, lr, Ct, fr, hr;
|
|
3882
3927
|
class ln extends EventTarget {
|
|
3883
3928
|
constructor(e, n) {
|
|
3884
3929
|
var r, s;
|
|
3885
|
-
super(), B(this, fe), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, B(this, re), B(this, Je), B(this, ct), B(this, dn), B(this, bn), B(this, Nt), B(this, ft), B(this, Pt, null), B(this, De), B(this, dt), B(this, pt, null), B(this, lt, null), B(this,
|
|
3930
|
+
super(), B(this, fe), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, B(this, re), B(this, Je), B(this, ct), B(this, dn), B(this, bn), B(this, Nt), B(this, ft), B(this, Pt, null), B(this, De), B(this, dt), B(this, pt, null), B(this, lt, null), B(this, At, null), B(this, ur, (a) => Ie(this, null, function* () {
|
|
3886
3931
|
var i;
|
|
3887
|
-
|
|
3932
|
+
A(this, dt).reset();
|
|
3888
3933
|
const { body: o, redirected: u, status: c, headers: h } = a;
|
|
3889
3934
|
if (c === 204) {
|
|
3890
|
-
|
|
3935
|
+
Ce(this, fe, Ct).call(this, "Server sent HTTP 204, not reconnecting", 204), this.close();
|
|
3891
3936
|
return;
|
|
3892
3937
|
}
|
|
3893
3938
|
if (u ? L(this, ct, new URL(a.url)) : L(this, ct, void 0), c !== 200) {
|
|
3894
|
-
|
|
3939
|
+
Ce(this, fe, Ct).call(this, `Non-200 status code (${c})`, c);
|
|
3895
3940
|
return;
|
|
3896
3941
|
}
|
|
3897
3942
|
if (!(h.get("content-type") || "").startsWith("text/event-stream")) {
|
|
3898
|
-
|
|
3943
|
+
Ce(this, fe, Ct).call(this, 'Invalid content type, expected "text/event-stream"', c);
|
|
3899
3944
|
return;
|
|
3900
3945
|
}
|
|
3901
|
-
if (
|
|
3946
|
+
if (A(this, re) === this.CLOSED)
|
|
3902
3947
|
return;
|
|
3903
3948
|
L(this, re, this.OPEN);
|
|
3904
3949
|
const p = new Event("open");
|
|
3905
|
-
if ((i =
|
|
3906
|
-
|
|
3950
|
+
if ((i = A(this, At)) == null || i.call(this, p), this.dispatchEvent(p), typeof o != "object" || !o || !("getReader" in o)) {
|
|
3951
|
+
Ce(this, fe, Ct).call(this, "Invalid response body, expected a web ReadableStream", c), this.close();
|
|
3907
3952
|
return;
|
|
3908
3953
|
}
|
|
3909
3954
|
const k = new TextDecoder(), _ = o.getReader();
|
|
3910
3955
|
let b = !0;
|
|
3911
3956
|
do {
|
|
3912
3957
|
const { done: l, value: y } = yield _.read();
|
|
3913
|
-
y &&
|
|
3958
|
+
y && A(this, dt).feed(k.decode(y, { stream: !l })), l && (b = !1, A(this, dt).reset(), Ce(this, fe, fr).call(this));
|
|
3914
3959
|
} while (b);
|
|
3915
3960
|
})), B(this, cr, (a) => {
|
|
3916
|
-
L(this, De, void 0), !(a.name === "AbortError" || a.type === "aborted") &&
|
|
3961
|
+
L(this, De, void 0), !(a.name === "AbortError" || a.type === "aborted") && Ce(this, fe, fr).call(this, ir(a));
|
|
3917
3962
|
}), B(this, dr, (a) => {
|
|
3918
3963
|
typeof a.id == "string" && L(this, Pt, a.id);
|
|
3919
3964
|
const i = new MessageEvent(a.event || "message", {
|
|
3920
3965
|
data: a.data,
|
|
3921
|
-
origin:
|
|
3966
|
+
origin: A(this, ct) ? A(this, ct).origin : A(this, Je).origin,
|
|
3922
3967
|
lastEventId: a.id || ""
|
|
3923
3968
|
});
|
|
3924
|
-
|
|
3969
|
+
A(this, lt) && (!a.event || a.event === "message") && A(this, lt).call(this, i), this.dispatchEvent(i);
|
|
3925
3970
|
}), B(this, lr, (a) => {
|
|
3926
3971
|
L(this, Nt, a);
|
|
3927
3972
|
}), B(this, hr, () => {
|
|
3928
|
-
L(this, ft, void 0),
|
|
3973
|
+
L(this, ft, void 0), A(this, re) === this.CONNECTING && Ce(this, fe, or).call(this);
|
|
3929
3974
|
});
|
|
3930
3975
|
try {
|
|
3931
3976
|
if (e instanceof URL)
|
|
3932
3977
|
L(this, Je, e);
|
|
3933
3978
|
else if (typeof e == "string")
|
|
3934
|
-
L(this, Je, new URL(e,
|
|
3979
|
+
L(this, Je, new URL(e, zo()));
|
|
3935
3980
|
else
|
|
3936
3981
|
throw new Error("Invalid URL");
|
|
3937
3982
|
} catch (a) {
|
|
3938
|
-
throw
|
|
3983
|
+
throw Wo("An invalid or illegal string was specified");
|
|
3939
3984
|
}
|
|
3940
|
-
L(this, dt,
|
|
3941
|
-
onEvent:
|
|
3942
|
-
onRetry:
|
|
3943
|
-
})), L(this, re, this.CONNECTING), L(this, Nt, 3e3), L(this, bn, (r = n == null ? void 0 : n.fetch) != null ? r : globalThis.fetch), L(this, dn, (s = n == null ? void 0 : n.withCredentials) != null ? s : !1),
|
|
3985
|
+
L(this, dt, $o({
|
|
3986
|
+
onEvent: A(this, dr),
|
|
3987
|
+
onRetry: A(this, lr)
|
|
3988
|
+
})), L(this, re, this.CONNECTING), L(this, Nt, 3e3), L(this, bn, (r = n == null ? void 0 : n.fetch) != null ? r : globalThis.fetch), L(this, dn, (s = n == null ? void 0 : n.withCredentials) != null ? s : !1), Ce(this, fe, or).call(this);
|
|
3944
3989
|
}
|
|
3945
3990
|
/**
|
|
3946
3991
|
* Returns the state of this EventSource object's connection. It can have the values described below.
|
|
@@ -3953,7 +3998,7 @@ class ln extends EventTarget {
|
|
|
3953
3998
|
* @public
|
|
3954
3999
|
*/
|
|
3955
4000
|
get readyState() {
|
|
3956
|
-
return
|
|
4001
|
+
return A(this, re);
|
|
3957
4002
|
}
|
|
3958
4003
|
/**
|
|
3959
4004
|
* Returns the URL providing the event stream.
|
|
@@ -3963,7 +4008,7 @@ class ln extends EventTarget {
|
|
|
3963
4008
|
* @public
|
|
3964
4009
|
*/
|
|
3965
4010
|
get url() {
|
|
3966
|
-
return
|
|
4011
|
+
return A(this, Je).href;
|
|
3967
4012
|
}
|
|
3968
4013
|
/**
|
|
3969
4014
|
* Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
|
|
@@ -3971,28 +4016,28 @@ class ln extends EventTarget {
|
|
|
3971
4016
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
|
|
3972
4017
|
*/
|
|
3973
4018
|
get withCredentials() {
|
|
3974
|
-
return
|
|
4019
|
+
return A(this, dn);
|
|
3975
4020
|
}
|
|
3976
4021
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
3977
4022
|
get onerror() {
|
|
3978
|
-
return
|
|
4023
|
+
return A(this, pt);
|
|
3979
4024
|
}
|
|
3980
4025
|
set onerror(e) {
|
|
3981
4026
|
L(this, pt, e);
|
|
3982
4027
|
}
|
|
3983
4028
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
3984
4029
|
get onmessage() {
|
|
3985
|
-
return
|
|
4030
|
+
return A(this, lt);
|
|
3986
4031
|
}
|
|
3987
4032
|
set onmessage(e) {
|
|
3988
4033
|
L(this, lt, e);
|
|
3989
4034
|
}
|
|
3990
4035
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
3991
4036
|
get onopen() {
|
|
3992
|
-
return
|
|
4037
|
+
return A(this, At);
|
|
3993
4038
|
}
|
|
3994
4039
|
set onopen(e) {
|
|
3995
|
-
L(this,
|
|
4040
|
+
L(this, At, e);
|
|
3996
4041
|
}
|
|
3997
4042
|
addEventListener(e, n, r) {
|
|
3998
4043
|
const s = n;
|
|
@@ -4010,16 +4055,16 @@ class ln extends EventTarget {
|
|
|
4010
4055
|
* @public
|
|
4011
4056
|
*/
|
|
4012
4057
|
close() {
|
|
4013
|
-
|
|
4058
|
+
A(this, ft) && clearTimeout(A(this, ft)), A(this, re) !== this.CLOSED && (A(this, De) && A(this, De).abort(), L(this, re, this.CLOSED), L(this, De, void 0));
|
|
4014
4059
|
}
|
|
4015
4060
|
}
|
|
4016
|
-
re = /* @__PURE__ */ new WeakMap(), Je = /* @__PURE__ */ new WeakMap(), ct = /* @__PURE__ */ new WeakMap(), dn = /* @__PURE__ */ new WeakMap(), bn = /* @__PURE__ */ new WeakMap(), Nt = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), De = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), pt = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap(),
|
|
4061
|
+
re = /* @__PURE__ */ new WeakMap(), Je = /* @__PURE__ */ new WeakMap(), ct = /* @__PURE__ */ new WeakMap(), dn = /* @__PURE__ */ new WeakMap(), bn = /* @__PURE__ */ new WeakMap(), Nt = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), De = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), pt = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap(), At = /* @__PURE__ */ new WeakMap(), fe = /* @__PURE__ */ new WeakSet(), /**
|
|
4017
4062
|
* Connect to the given URL and start receiving events
|
|
4018
4063
|
*
|
|
4019
4064
|
* @internal
|
|
4020
4065
|
*/
|
|
4021
4066
|
or = function() {
|
|
4022
|
-
L(this, re, this.CONNECTING), L(this, De, new AbortController()),
|
|
4067
|
+
L(this, re, this.CONNECTING), L(this, De, new AbortController()), A(this, bn)(A(this, Je), Ce(this, fe, ds).call(this)).then(A(this, ur)).catch(A(this, cr));
|
|
4023
4068
|
}, ur = /* @__PURE__ */ new WeakMap(), cr = /* @__PURE__ */ new WeakMap(), /**
|
|
4024
4069
|
* Get request options for the `fetch()` request
|
|
4025
4070
|
*
|
|
@@ -4033,9 +4078,9 @@ ds = function() {
|
|
|
4033
4078
|
// [spec] …will have their mode set to "cors"…
|
|
4034
4079
|
mode: "cors",
|
|
4035
4080
|
redirect: "follow",
|
|
4036
|
-
headers: Be({ Accept: "text/event-stream" },
|
|
4081
|
+
headers: Be({ Accept: "text/event-stream" }, A(this, Pt) ? { "Last-Event-ID": A(this, Pt) } : void 0),
|
|
4037
4082
|
cache: "no-store",
|
|
4038
|
-
signal: (t =
|
|
4083
|
+
signal: (t = A(this, De)) == null ? void 0 : t.signal
|
|
4039
4084
|
};
|
|
4040
4085
|
return "window" in globalThis && (e.credentials = this.withCredentials ? "include" : "same-origin"), e;
|
|
4041
4086
|
}, dr = /* @__PURE__ */ new WeakMap(), lr = /* @__PURE__ */ new WeakMap(), /**
|
|
@@ -4045,11 +4090,11 @@ ds = function() {
|
|
|
4045
4090
|
* @param code - The HTTP status code, if available
|
|
4046
4091
|
* @internal
|
|
4047
4092
|
*/
|
|
4048
|
-
|
|
4093
|
+
Ct = function(t, e) {
|
|
4049
4094
|
var n;
|
|
4050
|
-
|
|
4095
|
+
A(this, re) !== this.CLOSED && L(this, re, this.CLOSED);
|
|
4051
4096
|
const r = new us("error", { code: e, message: t });
|
|
4052
|
-
(n =
|
|
4097
|
+
(n = A(this, pt)) == null || n.call(this, r), this.dispatchEvent(r);
|
|
4053
4098
|
}, /**
|
|
4054
4099
|
* Schedules a reconnection attempt against the EventSource endpoint.
|
|
4055
4100
|
*
|
|
@@ -4059,11 +4104,11 @@ At = function(t, e) {
|
|
|
4059
4104
|
*/
|
|
4060
4105
|
fr = function(t, e) {
|
|
4061
4106
|
var n;
|
|
4062
|
-
if (
|
|
4107
|
+
if (A(this, re) === this.CLOSED)
|
|
4063
4108
|
return;
|
|
4064
4109
|
L(this, re, this.CONNECTING);
|
|
4065
4110
|
const r = new us("error", { code: e, message: t });
|
|
4066
|
-
(n =
|
|
4111
|
+
(n = A(this, pt)) == null || n.call(this, r), this.dispatchEvent(r), L(this, ft, setTimeout(A(this, hr), A(this, Nt)));
|
|
4067
4112
|
}, hr = /* @__PURE__ */ new WeakMap(), /**
|
|
4068
4113
|
* ReadyState representing an EventSource currently trying to connect
|
|
4069
4114
|
*
|
|
@@ -4080,11 +4125,11 @@ ln.OPEN = 1, /**
|
|
|
4080
4125
|
* @public
|
|
4081
4126
|
*/
|
|
4082
4127
|
ln.CLOSED = 2;
|
|
4083
|
-
function
|
|
4128
|
+
function zo() {
|
|
4084
4129
|
const t = "document" in globalThis ? globalThis.document : void 0;
|
|
4085
4130
|
return t && typeof t == "object" && "baseURI" in t && typeof t.baseURI == "string" ? t.baseURI : void 0;
|
|
4086
4131
|
}
|
|
4087
|
-
var Ws = Symbol.for("immer-nothing"), ls = Symbol.for("immer-draftable"), oe = Symbol.for("immer-state"),
|
|
4132
|
+
var Ws = Symbol.for("immer-nothing"), ls = Symbol.for("immer-draftable"), oe = Symbol.for("immer-state"), Vo = process.env.NODE_ENV !== "production" ? [
|
|
4088
4133
|
// All error codes, starting by 0:
|
|
4089
4134
|
function(t) {
|
|
4090
4135
|
return `The plugin for '${t}' has not been loaded into Immer. To enable the plugin, import and call \`enable${t}()\` when initializing your application.`;
|
|
@@ -4117,7 +4162,7 @@ var Ws = Symbol.for("immer-nothing"), ls = Symbol.for("immer-draftable"), oe = S
|
|
|
4117
4162
|
] : [];
|
|
4118
4163
|
function se(t, ...e) {
|
|
4119
4164
|
if (process.env.NODE_ENV !== "production") {
|
|
4120
|
-
const n =
|
|
4165
|
+
const n = Vo[t], r = typeof n == "function" ? n.apply(null, e) : n;
|
|
4121
4166
|
throw new Error(`[Immer] ${r}`);
|
|
4122
4167
|
}
|
|
4123
4168
|
throw new Error(
|
|
@@ -4132,7 +4177,7 @@ function tt(t) {
|
|
|
4132
4177
|
var e;
|
|
4133
4178
|
return t ? zs(t) || Array.isArray(t) || !!t[ls] || !!((e = t.constructor) != null && e[ls]) || On(t) || Tn(t) : !1;
|
|
4134
4179
|
}
|
|
4135
|
-
var
|
|
4180
|
+
var Uo = Object.prototype.constructor.toString();
|
|
4136
4181
|
function zs(t) {
|
|
4137
4182
|
if (!t || typeof t != "object")
|
|
4138
4183
|
return !1;
|
|
@@ -4140,7 +4185,7 @@ function zs(t) {
|
|
|
4140
4185
|
if (e === null)
|
|
4141
4186
|
return !0;
|
|
4142
4187
|
const n = Object.hasOwnProperty.call(e, "constructor") && e.constructor;
|
|
4143
|
-
return n === Object ? !0 : typeof n == "function" && Function.toString.call(n) ===
|
|
4188
|
+
return n === Object ? !0 : typeof n == "function" && Function.toString.call(n) === Uo;
|
|
4144
4189
|
}
|
|
4145
4190
|
function wn(t, e) {
|
|
4146
4191
|
Sn(t) === 0 ? Reflect.ownKeys(t).forEach((n) => {
|
|
@@ -4158,7 +4203,7 @@ function Vs(t, e, n) {
|
|
|
4158
4203
|
const r = Sn(t);
|
|
4159
4204
|
r === 2 ? t.set(e, n) : r === 3 ? t.add(n) : t[e] = n;
|
|
4160
4205
|
}
|
|
4161
|
-
function
|
|
4206
|
+
function Bo(t, e) {
|
|
4162
4207
|
return t === e ? t !== 0 || 1 / t === 1 / e : t !== t && e !== e;
|
|
4163
4208
|
}
|
|
4164
4209
|
function On(t) {
|
|
@@ -4167,7 +4212,7 @@ function On(t) {
|
|
|
4167
4212
|
function Tn(t) {
|
|
4168
4213
|
return t instanceof Set;
|
|
4169
4214
|
}
|
|
4170
|
-
function
|
|
4215
|
+
function qe(t) {
|
|
4171
4216
|
return t.copy_ || t.base_;
|
|
4172
4217
|
}
|
|
4173
4218
|
function mr(t, e) {
|
|
@@ -4202,24 +4247,24 @@ function mr(t, e) {
|
|
|
4202
4247
|
}
|
|
4203
4248
|
}
|
|
4204
4249
|
function Bt(t, e = !1) {
|
|
4205
|
-
return
|
|
4250
|
+
return An(t) || bt(t) || !tt(t) || (Sn(t) > 1 && (t.set = t.add = t.clear = t.delete = Ko), Object.freeze(t), e && Object.entries(t).forEach(([n, r]) => Bt(r, !0))), t;
|
|
4206
4251
|
}
|
|
4207
|
-
function
|
|
4252
|
+
function Ko() {
|
|
4208
4253
|
se(2);
|
|
4209
4254
|
}
|
|
4210
|
-
function
|
|
4255
|
+
function An(t) {
|
|
4211
4256
|
return Object.isFrozen(t);
|
|
4212
4257
|
}
|
|
4213
|
-
var
|
|
4258
|
+
var qo = {};
|
|
4214
4259
|
function nt(t) {
|
|
4215
|
-
const e =
|
|
4260
|
+
const e = qo[t];
|
|
4216
4261
|
return e || se(0, t), e;
|
|
4217
4262
|
}
|
|
4218
|
-
var
|
|
4263
|
+
var Kt;
|
|
4219
4264
|
function Us() {
|
|
4220
|
-
return
|
|
4265
|
+
return Kt;
|
|
4221
4266
|
}
|
|
4222
|
-
function
|
|
4267
|
+
function Ho(t, e) {
|
|
4223
4268
|
return {
|
|
4224
4269
|
drafts_: [],
|
|
4225
4270
|
parent_: t,
|
|
@@ -4234,22 +4279,22 @@ function fs(t, e) {
|
|
|
4234
4279
|
e && (nt("Patches"), t.patches_ = [], t.inversePatches_ = [], t.patchListener_ = e);
|
|
4235
4280
|
}
|
|
4236
4281
|
function yr(t) {
|
|
4237
|
-
gr(t), t.drafts_.forEach(
|
|
4282
|
+
gr(t), t.drafts_.forEach(Go), t.drafts_ = null;
|
|
4238
4283
|
}
|
|
4239
4284
|
function gr(t) {
|
|
4240
|
-
t ===
|
|
4285
|
+
t === Kt && (Kt = t.parent_);
|
|
4241
4286
|
}
|
|
4242
4287
|
function hs(t) {
|
|
4243
|
-
return
|
|
4288
|
+
return Kt = Ho(Kt, t);
|
|
4244
4289
|
}
|
|
4245
|
-
function
|
|
4290
|
+
function Go(t) {
|
|
4246
4291
|
const e = t[oe];
|
|
4247
4292
|
e.type_ === 0 || e.type_ === 1 ? e.revoke_() : e.revoked_ = !0;
|
|
4248
4293
|
}
|
|
4249
4294
|
function ps(t, e) {
|
|
4250
4295
|
e.unfinalizedDrafts_ = e.drafts_.length;
|
|
4251
4296
|
const n = e.drafts_[0];
|
|
4252
|
-
return t !== void 0 && t !== n ? (n[oe].modified_ && (yr(e), se(4)), tt(t) && (t = kn(e, t), e.parent_ ||
|
|
4297
|
+
return t !== void 0 && t !== n ? (n[oe].modified_ && (yr(e), se(4)), tt(t) && (t = kn(e, t), e.parent_ || xn(e, t)), e.patches_ && nt("Patches").generateReplacementPatches_(
|
|
4253
4298
|
n[oe].base_,
|
|
4254
4299
|
t,
|
|
4255
4300
|
e.patches_,
|
|
@@ -4257,7 +4302,7 @@ function ps(t, e) {
|
|
|
4257
4302
|
)) : t = kn(e, n, []), yr(e), e.patches_ && e.patchListener_(e.patches_, e.inversePatches_), t !== Ws ? t : void 0;
|
|
4258
4303
|
}
|
|
4259
4304
|
function kn(t, e, n) {
|
|
4260
|
-
if (
|
|
4305
|
+
if (An(e))
|
|
4261
4306
|
return e;
|
|
4262
4307
|
const r = e[oe];
|
|
4263
4308
|
if (!r)
|
|
@@ -4268,7 +4313,7 @@ function kn(t, e, n) {
|
|
|
4268
4313
|
if (r.scope_ !== t)
|
|
4269
4314
|
return e;
|
|
4270
4315
|
if (!r.modified_)
|
|
4271
|
-
return
|
|
4316
|
+
return xn(t, r.base_, !0), r.base_;
|
|
4272
4317
|
if (!r.finalized_) {
|
|
4273
4318
|
r.finalized_ = !0, r.scope_.unfinalizedDrafts_--;
|
|
4274
4319
|
const s = r.copy_;
|
|
@@ -4276,7 +4321,7 @@ function kn(t, e, n) {
|
|
|
4276
4321
|
r.type_ === 3 && (a = new Set(s), s.clear(), i = !0), wn(
|
|
4277
4322
|
a,
|
|
4278
4323
|
(o, u) => ms(t, r, s, o, u, n, i)
|
|
4279
|
-
),
|
|
4324
|
+
), xn(t, s, !1), n && t.patches_ && nt("Patches").generatePatches_(
|
|
4280
4325
|
r,
|
|
4281
4326
|
n,
|
|
4282
4327
|
t.patches_,
|
|
@@ -4294,16 +4339,16 @@ function ms(t, e, n, r, s, a, i) {
|
|
|
4294
4339
|
else
|
|
4295
4340
|
return;
|
|
4296
4341
|
} else i && n.add(s);
|
|
4297
|
-
if (tt(s) && !
|
|
4342
|
+
if (tt(s) && !An(s)) {
|
|
4298
4343
|
if (!t.immer_.autoFreeze_ && t.unfinalizedDrafts_ < 1)
|
|
4299
4344
|
return;
|
|
4300
|
-
kn(t, s), (!e || !e.scope_.parent_) && typeof r != "symbol" && Object.prototype.propertyIsEnumerable.call(n, r) &&
|
|
4345
|
+
kn(t, s), (!e || !e.scope_.parent_) && typeof r != "symbol" && Object.prototype.propertyIsEnumerable.call(n, r) && xn(t, s);
|
|
4301
4346
|
}
|
|
4302
4347
|
}
|
|
4303
|
-
function
|
|
4348
|
+
function xn(t, e, n = !1) {
|
|
4304
4349
|
!t.parent_ && t.immer_.autoFreeze_ && t.canAutoFreeze_ && Bt(e, n);
|
|
4305
4350
|
}
|
|
4306
|
-
function
|
|
4351
|
+
function Jo(t, e) {
|
|
4307
4352
|
const n = Array.isArray(t), r = {
|
|
4308
4353
|
type_: n ? 1 : 0,
|
|
4309
4354
|
// Track which produce call this is associated with.
|
|
@@ -4328,7 +4373,7 @@ function Wo(t, e) {
|
|
|
4328
4373
|
isManual_: !1
|
|
4329
4374
|
};
|
|
4330
4375
|
let s = r, a = Ir;
|
|
4331
|
-
n && (s = [r], a =
|
|
4376
|
+
n && (s = [r], a = qt);
|
|
4332
4377
|
const { revoke: i, proxy: o } = Proxy.revocable(s, a);
|
|
4333
4378
|
return r.draft_ = o, r.revoke_ = i, o;
|
|
4334
4379
|
}
|
|
@@ -4336,27 +4381,27 @@ var Ir = {
|
|
|
4336
4381
|
get(t, e) {
|
|
4337
4382
|
if (e === oe)
|
|
4338
4383
|
return t;
|
|
4339
|
-
const n =
|
|
4384
|
+
const n = qe(t);
|
|
4340
4385
|
if (!pr(n, e))
|
|
4341
|
-
return
|
|
4386
|
+
return Xo(t, n, e);
|
|
4342
4387
|
const r = n[e];
|
|
4343
4388
|
return t.finalized_ || !tt(r) ? r : r === Mn(t.base_, e) ? (Ln(t), t.copy_[e] = vr(r, t)) : r;
|
|
4344
4389
|
},
|
|
4345
4390
|
has(t, e) {
|
|
4346
|
-
return e in
|
|
4391
|
+
return e in qe(t);
|
|
4347
4392
|
},
|
|
4348
4393
|
ownKeys(t) {
|
|
4349
|
-
return Reflect.ownKeys(
|
|
4394
|
+
return Reflect.ownKeys(qe(t));
|
|
4350
4395
|
},
|
|
4351
4396
|
set(t, e, n) {
|
|
4352
|
-
const r = Bs(
|
|
4397
|
+
const r = Bs(qe(t), e);
|
|
4353
4398
|
if (r != null && r.set)
|
|
4354
4399
|
return r.set.call(t.draft_, n), !0;
|
|
4355
4400
|
if (!t.modified_) {
|
|
4356
|
-
const s = Mn(
|
|
4401
|
+
const s = Mn(qe(t), e), a = s == null ? void 0 : s[oe];
|
|
4357
4402
|
if (a && a.base_ === n)
|
|
4358
4403
|
return t.copy_[e] = n, t.assigned_[e] = !1, !0;
|
|
4359
|
-
if (
|
|
4404
|
+
if (Bo(n, s) && (n !== void 0 || pr(t.base_, e)))
|
|
4360
4405
|
return !0;
|
|
4361
4406
|
Ln(t), _r(t);
|
|
4362
4407
|
}
|
|
@@ -4370,7 +4415,7 @@ var Ir = {
|
|
|
4370
4415
|
// Note: We never coerce `desc.value` into an Immer draft, because we can't make
|
|
4371
4416
|
// the same guarantee in ES5 mode.
|
|
4372
4417
|
getOwnPropertyDescriptor(t, e) {
|
|
4373
|
-
const n =
|
|
4418
|
+
const n = qe(t), r = Reflect.getOwnPropertyDescriptor(n, e);
|
|
4374
4419
|
return r && {
|
|
4375
4420
|
writable: !0,
|
|
4376
4421
|
configurable: t.type_ !== 1 || e !== "length",
|
|
@@ -4387,23 +4432,23 @@ var Ir = {
|
|
|
4387
4432
|
setPrototypeOf() {
|
|
4388
4433
|
se(12);
|
|
4389
4434
|
}
|
|
4390
|
-
},
|
|
4435
|
+
}, qt = {};
|
|
4391
4436
|
wn(Ir, (t, e) => {
|
|
4392
|
-
|
|
4437
|
+
qt[t] = function() {
|
|
4393
4438
|
return arguments[0] = arguments[0][0], e.apply(this, arguments);
|
|
4394
4439
|
};
|
|
4395
4440
|
});
|
|
4396
|
-
|
|
4397
|
-
return process.env.NODE_ENV !== "production" && isNaN(parseInt(e)) && se(13),
|
|
4441
|
+
qt.deleteProperty = function(t, e) {
|
|
4442
|
+
return process.env.NODE_ENV !== "production" && isNaN(parseInt(e)) && se(13), qt.set.call(this, t, e, void 0);
|
|
4398
4443
|
};
|
|
4399
|
-
|
|
4444
|
+
qt.set = function(t, e, n) {
|
|
4400
4445
|
return process.env.NODE_ENV !== "production" && e !== "length" && isNaN(parseInt(e)) && se(14), Ir.set.call(this, t[0], e, n, t[0]);
|
|
4401
4446
|
};
|
|
4402
4447
|
function Mn(t, e) {
|
|
4403
4448
|
const n = t[oe];
|
|
4404
|
-
return (n ?
|
|
4449
|
+
return (n ? qe(n) : t)[e];
|
|
4405
4450
|
}
|
|
4406
|
-
function
|
|
4451
|
+
function Xo(t, e, n) {
|
|
4407
4452
|
var s;
|
|
4408
4453
|
const r = Bs(e, n);
|
|
4409
4454
|
return r ? "value" in r ? r.value : (
|
|
@@ -4432,7 +4477,7 @@ function Ln(t) {
|
|
|
4432
4477
|
t.scope_.immer_.useStrictShallowCopy_
|
|
4433
4478
|
));
|
|
4434
4479
|
}
|
|
4435
|
-
var
|
|
4480
|
+
var Yo = class {
|
|
4436
4481
|
constructor(t) {
|
|
4437
4482
|
this.autoFreeze_ = !0, this.useStrictShallowCopy_ = !1, this.produce = (e, n, r) => {
|
|
4438
4483
|
if (typeof e == "function" && typeof n != "function") {
|
|
@@ -4472,7 +4517,7 @@ var Vo = class {
|
|
|
4472
4517
|
}, typeof (t == null ? void 0 : t.autoFreeze) == "boolean" && this.setAutoFreeze(t.autoFreeze), typeof (t == null ? void 0 : t.useStrictShallowCopy) == "boolean" && this.setUseStrictShallowCopy(t.useStrictShallowCopy);
|
|
4473
4518
|
}
|
|
4474
4519
|
createDraft(t) {
|
|
4475
|
-
tt(t) || se(8), bt(t) && (t =
|
|
4520
|
+
tt(t) || se(8), bt(t) && (t = Qo(t));
|
|
4476
4521
|
const e = hs(this), n = vr(t, void 0);
|
|
4477
4522
|
return n[oe].isManual_ = !0, gr(e), n;
|
|
4478
4523
|
}
|
|
@@ -4516,14 +4561,14 @@ var Vo = class {
|
|
|
4516
4561
|
}
|
|
4517
4562
|
};
|
|
4518
4563
|
function vr(t, e) {
|
|
4519
|
-
const n = On(t) ? nt("MapSet").proxyMap_(t, e) : Tn(t) ? nt("MapSet").proxySet_(t, e) :
|
|
4564
|
+
const n = On(t) ? nt("MapSet").proxyMap_(t, e) : Tn(t) ? nt("MapSet").proxySet_(t, e) : Jo(t, e);
|
|
4520
4565
|
return (e ? e.scope_ : Us()).drafts_.push(n), n;
|
|
4521
4566
|
}
|
|
4522
|
-
function
|
|
4523
|
-
return bt(t) || se(10, t),
|
|
4567
|
+
function Qo(t) {
|
|
4568
|
+
return bt(t) || se(10, t), Ks(t);
|
|
4524
4569
|
}
|
|
4525
|
-
function
|
|
4526
|
-
if (!tt(t) ||
|
|
4570
|
+
function Ks(t) {
|
|
4571
|
+
if (!tt(t) || An(t))
|
|
4527
4572
|
return t;
|
|
4528
4573
|
const e = t[oe];
|
|
4529
4574
|
let n;
|
|
@@ -4534,10 +4579,10 @@ function qs(t) {
|
|
|
4534
4579
|
} else
|
|
4535
4580
|
n = mr(t, !0);
|
|
4536
4581
|
return wn(n, (r, s) => {
|
|
4537
|
-
Vs(n, r,
|
|
4582
|
+
Vs(n, r, Ks(s));
|
|
4538
4583
|
}), e && (e.finalized_ = !1), n;
|
|
4539
4584
|
}
|
|
4540
|
-
var ue = new
|
|
4585
|
+
var ue = new Yo(), eu = ue.produce;
|
|
4541
4586
|
ue.produceWithPatches.bind(
|
|
4542
4587
|
ue
|
|
4543
4588
|
);
|
|
@@ -4546,12 +4591,12 @@ ue.setUseStrictShallowCopy.bind(ue);
|
|
|
4546
4591
|
ue.applyPatches.bind(ue);
|
|
4547
4592
|
ue.createDraft.bind(ue);
|
|
4548
4593
|
ue.finishDraft.bind(ue);
|
|
4549
|
-
function
|
|
4594
|
+
function tu(t) {
|
|
4550
4595
|
var e = da(function() {
|
|
4551
4596
|
return Bt(typeof t == "function" ? t() : t, !0);
|
|
4552
4597
|
}), n = e[1];
|
|
4553
4598
|
return [e[0], an(function(r) {
|
|
4554
|
-
n(typeof r == "function" ?
|
|
4599
|
+
n(typeof r == "function" ? eu(r) : Bt(r));
|
|
4555
4600
|
}, [])];
|
|
4556
4601
|
}
|
|
4557
4602
|
const ys = {
|
|
@@ -4570,11 +4615,11 @@ const ys = {
|
|
|
4570
4615
|
} : {
|
|
4571
4616
|
filePath: t.filePath.replace(/^\//, ""),
|
|
4572
4617
|
referencePath: t.referencePath === "/" ? "" : t.referencePath
|
|
4573
|
-
},
|
|
4618
|
+
}, Lu = ({
|
|
4574
4619
|
url: t,
|
|
4575
4620
|
method: e = "POST"
|
|
4576
4621
|
}) => {
|
|
4577
|
-
const [n, r] =
|
|
4622
|
+
const [n, r] = tu(ys);
|
|
4578
4623
|
return {
|
|
4579
4624
|
getCode: (a) => Ie(void 0, null, function* () {
|
|
4580
4625
|
var h, p, k;
|
|
@@ -4593,7 +4638,7 @@ const ys = {
|
|
|
4593
4638
|
}
|
|
4594
4639
|
let o;
|
|
4595
4640
|
const u = new ln(t, {
|
|
4596
|
-
fetch: (_, b) => (o = fetch(_,
|
|
4641
|
+
fetch: (_, b) => (o = fetch(_, qr(Be({}, b), {
|
|
4597
4642
|
method: e,
|
|
4598
4643
|
body: JSON.stringify(a)
|
|
4599
4644
|
})), o)
|
|
@@ -4684,11 +4729,11 @@ const ys = {
|
|
|
4684
4729
|
for (const P of $) {
|
|
4685
4730
|
const z = {};
|
|
4686
4731
|
if (P.status === "fulfilled") {
|
|
4687
|
-
const { assetName: D, base64:
|
|
4688
|
-
z[D] =
|
|
4732
|
+
const { assetName: D, base64: K } = P.value;
|
|
4733
|
+
z[D] = K;
|
|
4689
4734
|
const I = y ? `${y}/${D}` : D;
|
|
4690
4735
|
l.files[I] = {
|
|
4691
|
-
content:
|
|
4736
|
+
content: K,
|
|
4692
4737
|
isBinary: !0
|
|
4693
4738
|
};
|
|
4694
4739
|
}
|
|
@@ -4716,7 +4761,7 @@ var nn = { exports: {} }, $n = {};
|
|
|
4716
4761
|
* LICENSE file in the root directory of this source tree.
|
|
4717
4762
|
*/
|
|
4718
4763
|
var _s;
|
|
4719
|
-
function
|
|
4764
|
+
function nu() {
|
|
4720
4765
|
if (_s) return $n;
|
|
4721
4766
|
_s = 1;
|
|
4722
4767
|
var t = Gt;
|
|
@@ -4767,7 +4812,7 @@ var Fn = {};
|
|
|
4767
4812
|
* LICENSE file in the root directory of this source tree.
|
|
4768
4813
|
*/
|
|
4769
4814
|
var vs;
|
|
4770
|
-
function
|
|
4815
|
+
function ru() {
|
|
4771
4816
|
return vs || (vs = 1, process.env.NODE_ENV !== "production" && function() {
|
|
4772
4817
|
function t(_, b) {
|
|
4773
4818
|
return _ === b && (_ !== 0 || 1 / _ === 1 / b) || _ !== _ && b !== b;
|
|
@@ -4820,11 +4865,11 @@ function Ko() {
|
|
|
4820
4865
|
}()), Fn;
|
|
4821
4866
|
}
|
|
4822
4867
|
var bs;
|
|
4823
|
-
function
|
|
4824
|
-
return bs || (bs = 1, process.env.NODE_ENV === "production" ? nn.exports =
|
|
4868
|
+
function su() {
|
|
4869
|
+
return bs || (bs = 1, process.env.NODE_ENV === "production" ? nn.exports = nu() : nn.exports = ru()), nn.exports;
|
|
4825
4870
|
}
|
|
4826
|
-
var
|
|
4827
|
-
const
|
|
4871
|
+
var au = su();
|
|
4872
|
+
const qs = 0, Hs = 1, Gs = 2, ws = 3;
|
|
4828
4873
|
var ks = Object.prototype.hasOwnProperty;
|
|
4829
4874
|
function br(t, e) {
|
|
4830
4875
|
var n, r;
|
|
@@ -4850,7 +4895,7 @@ const Pe = /* @__PURE__ */ new WeakMap(), Me = () => {
|
|
|
4850
4895
|
}, ee = (
|
|
4851
4896
|
/*#__NOINLINE__*/
|
|
4852
4897
|
Me()
|
|
4853
|
-
), wr = Object, N = (t) => t === ee, be = (t) => typeof t == "function", ze = (t, e) => Be(Be({}, t), e), Js = (t) => be(t.then), Wn = {}, rn = {}, jr = "undefined", Xt = typeof window != jr, kr = typeof document != jr,
|
|
4898
|
+
), wr = Object, N = (t) => t === ee, be = (t) => typeof t == "function", ze = (t, e) => Be(Be({}, t), e), Js = (t) => be(t.then), Wn = {}, rn = {}, jr = "undefined", Xt = typeof window != jr, kr = typeof document != jr, iu = Xt && "Deno" in window, ou = () => Xt && typeof window.requestAnimationFrame != jr, Xs = (t, e) => {
|
|
4854
4899
|
const n = Pe.get(t);
|
|
4855
4900
|
return [
|
|
4856
4901
|
// Getter
|
|
@@ -4868,44 +4913,44 @@ const Pe = /* @__PURE__ */ new WeakMap(), Me = () => {
|
|
|
4868
4913
|
() => !N(e) && e in rn ? rn[e] : !N(e) && t.get(e) || Wn
|
|
4869
4914
|
];
|
|
4870
4915
|
};
|
|
4871
|
-
let
|
|
4872
|
-
const
|
|
4916
|
+
let xr = !0;
|
|
4917
|
+
const uu = () => xr, [Er, Sr] = Xt && window.addEventListener ? [
|
|
4873
4918
|
window.addEventListener.bind(window),
|
|
4874
4919
|
window.removeEventListener.bind(window)
|
|
4875
4920
|
] : [
|
|
4876
4921
|
Me,
|
|
4877
4922
|
Me
|
|
4878
|
-
],
|
|
4923
|
+
], cu = () => {
|
|
4879
4924
|
const t = kr && document.visibilityState;
|
|
4880
4925
|
return N(t) || t !== "hidden";
|
|
4881
|
-
},
|
|
4926
|
+
}, du = (t) => (kr && document.addEventListener("visibilitychange", t), Er("focus", t), () => {
|
|
4882
4927
|
kr && document.removeEventListener("visibilitychange", t), Sr("focus", t);
|
|
4883
|
-
}),
|
|
4928
|
+
}), lu = (t) => {
|
|
4884
4929
|
const e = () => {
|
|
4885
|
-
|
|
4930
|
+
xr = !0, t();
|
|
4886
4931
|
}, n = () => {
|
|
4887
|
-
|
|
4932
|
+
xr = !1;
|
|
4888
4933
|
};
|
|
4889
|
-
return
|
|
4934
|
+
return Er("online", e), Er("offline", n), () => {
|
|
4890
4935
|
Sr("online", e), Sr("offline", n);
|
|
4891
4936
|
};
|
|
4892
|
-
},
|
|
4893
|
-
isOnline:
|
|
4894
|
-
isVisible:
|
|
4895
|
-
},
|
|
4896
|
-
initFocus:
|
|
4897
|
-
initReconnect:
|
|
4898
|
-
},
|
|
4937
|
+
}, fu = {
|
|
4938
|
+
isOnline: uu,
|
|
4939
|
+
isVisible: cu
|
|
4940
|
+
}, hu = {
|
|
4941
|
+
initFocus: du,
|
|
4942
|
+
initReconnect: lu
|
|
4943
|
+
}, xs = !Gt.useId, Ht = !Xt || iu, pu = (t) => ou() ? window.requestAnimationFrame(t) : setTimeout(t, 1), zn = Ht ? fa : ha, Vn = typeof navigator != "undefined" && navigator.connection, Es = !Ht && Vn && ([
|
|
4899
4944
|
"slow-2g",
|
|
4900
4945
|
"2g"
|
|
4901
4946
|
].includes(Vn.effectiveType) || Vn.saveData), sn = /* @__PURE__ */ new WeakMap(), Un = (t, e) => wr.prototype.toString.call(t) === `[object ${e}]`;
|
|
4902
|
-
let
|
|
4947
|
+
let mu = 0;
|
|
4903
4948
|
const Or = (t) => {
|
|
4904
4949
|
const e = typeof t, n = Un(t, "Date"), r = Un(t, "RegExp"), s = Un(t, "Object");
|
|
4905
4950
|
let a, i;
|
|
4906
4951
|
if (wr(t) === t && !n && !r) {
|
|
4907
4952
|
if (a = sn.get(t), a) return a;
|
|
4908
|
-
if (a = ++
|
|
4953
|
+
if (a = ++mu + "~", sn.set(t, a), Array.isArray(t)) {
|
|
4909
4954
|
for (a = "@", i = 0; i < t.length; i++)
|
|
4910
4955
|
a += Or(t[i]) + ",";
|
|
4911
4956
|
sn.set(t, a);
|
|
@@ -4933,8 +4978,8 @@ const Or = (t) => {
|
|
|
4933
4978
|
e
|
|
4934
4979
|
];
|
|
4935
4980
|
};
|
|
4936
|
-
let
|
|
4937
|
-
const Tr = () => ++
|
|
4981
|
+
let yu = 0;
|
|
4982
|
+
const Tr = () => ++yu;
|
|
4938
4983
|
function Ys(...t) {
|
|
4939
4984
|
return Ie(this, null, function* () {
|
|
4940
4985
|
const [e, n, r, s] = t, a = ze({
|
|
@@ -4965,7 +5010,7 @@ function Ys(...t) {
|
|
|
4965
5010
|
};
|
|
4966
5011
|
if (t.length < 3)
|
|
4967
5012
|
return z();
|
|
4968
|
-
let D = r,
|
|
5013
|
+
let D = r, K;
|
|
4969
5014
|
const I = Tr();
|
|
4970
5015
|
m[_] = [
|
|
4971
5016
|
I,
|
|
@@ -4979,19 +5024,19 @@ function Ys(...t) {
|
|
|
4979
5024
|
try {
|
|
4980
5025
|
D = D(Ve);
|
|
4981
5026
|
} catch (le) {
|
|
4982
|
-
|
|
5027
|
+
K = le;
|
|
4983
5028
|
}
|
|
4984
5029
|
if (D && Js(D))
|
|
4985
5030
|
if (D = yield D.catch((le) => {
|
|
4986
|
-
|
|
5031
|
+
K = le;
|
|
4987
5032
|
}), I !== m[_][0]) {
|
|
4988
|
-
if (
|
|
5033
|
+
if (K) throw K;
|
|
4989
5034
|
return D;
|
|
4990
|
-
} else
|
|
5035
|
+
} else K && F && c(K) && (i = !0, l({
|
|
4991
5036
|
data: Ve,
|
|
4992
5037
|
_c: ee
|
|
4993
5038
|
}));
|
|
4994
|
-
if (i && !
|
|
5039
|
+
if (i && !K)
|
|
4995
5040
|
if (be(i)) {
|
|
4996
5041
|
const le = i(D, Ve);
|
|
4997
5042
|
l({
|
|
@@ -5009,8 +5054,8 @@ function Ys(...t) {
|
|
|
5009
5054
|
l({
|
|
5010
5055
|
_c: ee
|
|
5011
5056
|
});
|
|
5012
|
-
}),
|
|
5013
|
-
if (h) throw
|
|
5057
|
+
}), K) {
|
|
5058
|
+
if (h) throw K;
|
|
5014
5059
|
return;
|
|
5015
5060
|
}
|
|
5016
5061
|
return D;
|
|
@@ -5021,9 +5066,9 @@ function Ys(...t) {
|
|
|
5021
5066
|
const Ss = (t, e) => {
|
|
5022
5067
|
for (const n in t)
|
|
5023
5068
|
t[n][0] && t[n][0](e);
|
|
5024
|
-
},
|
|
5069
|
+
}, gu = (t, e) => {
|
|
5025
5070
|
if (!Pe.has(t)) {
|
|
5026
|
-
const n = ze(
|
|
5071
|
+
const n = ze(hu, e), r = {}, s = Ys.bind(ee, t);
|
|
5027
5072
|
let a = Me;
|
|
5028
5073
|
const i = {}, o = (h, p) => {
|
|
5029
5074
|
const k = i[h] || [];
|
|
@@ -5043,8 +5088,8 @@ const Ss = (t, e) => {
|
|
|
5043
5088
|
s,
|
|
5044
5089
|
u,
|
|
5045
5090
|
o
|
|
5046
|
-
]), !
|
|
5047
|
-
const h = n.initFocus(setTimeout.bind(ee, Ss.bind(ee, r,
|
|
5091
|
+
]), !Ht)) {
|
|
5092
|
+
const h = n.initFocus(setTimeout.bind(ee, Ss.bind(ee, r, qs))), p = n.initReconnect(setTimeout.bind(ee, Ss.bind(ee, r, Hs)));
|
|
5048
5093
|
a = () => {
|
|
5049
5094
|
h && h(), p && p(), Pe.delete(t);
|
|
5050
5095
|
};
|
|
@@ -5061,16 +5106,16 @@ const Ss = (t, e) => {
|
|
|
5061
5106
|
t,
|
|
5062
5107
|
Pe.get(t)[4]
|
|
5063
5108
|
];
|
|
5064
|
-
},
|
|
5109
|
+
}, _u = (t, e, n, r, s) => {
|
|
5065
5110
|
const a = n.errorRetryCount, i = s.retryCount, o = ~~((Math.random() + 0.5) * (1 << (i < 8 ? i : 8))) * n.errorRetryInterval;
|
|
5066
5111
|
!N(a) && i > a || setTimeout(r, o, s);
|
|
5067
|
-
},
|
|
5112
|
+
}, vu = br, [Qs, bu] = gu(/* @__PURE__ */ new Map()), wu = ze(
|
|
5068
5113
|
{
|
|
5069
5114
|
// events
|
|
5070
5115
|
onLoadingSlow: Me,
|
|
5071
5116
|
onSuccess: Me,
|
|
5072
5117
|
onError: Me,
|
|
5073
|
-
onErrorRetry:
|
|
5118
|
+
onErrorRetry: _u,
|
|
5074
5119
|
onDiscarded: Me,
|
|
5075
5120
|
// switches
|
|
5076
5121
|
revalidateOnFocus: !0,
|
|
@@ -5078,29 +5123,29 @@ const Ss = (t, e) => {
|
|
|
5078
5123
|
revalidateIfStale: !0,
|
|
5079
5124
|
shouldRetryOnError: !0,
|
|
5080
5125
|
// timeouts
|
|
5081
|
-
errorRetryInterval:
|
|
5126
|
+
errorRetryInterval: Es ? 1e4 : 5e3,
|
|
5082
5127
|
focusThrottleInterval: 5 * 1e3,
|
|
5083
5128
|
dedupingInterval: 2 * 1e3,
|
|
5084
|
-
loadingTimeout:
|
|
5129
|
+
loadingTimeout: Es ? 5e3 : 3e3,
|
|
5085
5130
|
// providers
|
|
5086
|
-
compare:
|
|
5131
|
+
compare: vu,
|
|
5087
5132
|
isPaused: () => !1,
|
|
5088
5133
|
cache: Qs,
|
|
5089
|
-
mutate:
|
|
5134
|
+
mutate: bu,
|
|
5090
5135
|
fallback: {}
|
|
5091
5136
|
},
|
|
5092
5137
|
// use web preset by default
|
|
5093
|
-
|
|
5094
|
-
),
|
|
5138
|
+
fu
|
|
5139
|
+
), ku = (t, e) => {
|
|
5095
5140
|
const n = ze(t, e);
|
|
5096
5141
|
if (e) {
|
|
5097
5142
|
const { use: r, fallback: s } = t, { use: a, fallback: i } = e;
|
|
5098
5143
|
r && a && (n.use = r.concat(a)), s && i && (n.fallback = ze(s, i));
|
|
5099
5144
|
}
|
|
5100
5145
|
return n;
|
|
5101
|
-
},
|
|
5146
|
+
}, xu = la({}), Eu = "$inf$", ea = Xt && window.__SWR_DEVTOOLS_USE__, Su = ea ? window.__SWR_DEVTOOLS_USE__ : [], Ou = () => {
|
|
5102
5147
|
ea && (window.__SWR_DEVTOOLS_REACT__ = Gt);
|
|
5103
|
-
},
|
|
5148
|
+
}, Tu = (t) => be(t[1]) ? [
|
|
5104
5149
|
t[0],
|
|
5105
5150
|
t[1],
|
|
5106
5151
|
t[2] || {}
|
|
@@ -5108,27 +5153,27 @@ const Ss = (t, e) => {
|
|
|
5108
5153
|
t[0],
|
|
5109
5154
|
null,
|
|
5110
5155
|
(t[1] === null ? t[2] : t[1]) || {}
|
|
5111
|
-
],
|
|
5156
|
+
], Au = () => ze(wu, pa(xu)), Cu = (t) => (e, n, r) => t(e, n && ((...a) => {
|
|
5112
5157
|
const [i] = Zr(e), [, , , o] = Pe.get(Qs);
|
|
5113
|
-
if (i.startsWith(
|
|
5158
|
+
if (i.startsWith(Eu))
|
|
5114
5159
|
return n(...a);
|
|
5115
5160
|
const u = o[i];
|
|
5116
5161
|
return N(u) ? n(...a) : (delete o[i], u);
|
|
5117
|
-
}), r),
|
|
5118
|
-
const r =
|
|
5162
|
+
}), r), Nu = Su.concat(Cu), Pu = (t) => function(...n) {
|
|
5163
|
+
const r = Au(), [s, a, i] = Tu(n), o = ku(r, i);
|
|
5119
5164
|
let u = t;
|
|
5120
|
-
const { use: c } = o, h = (c || []).concat(
|
|
5165
|
+
const { use: c } = o, h = (c || []).concat(Nu);
|
|
5121
5166
|
for (let p = h.length; p--; )
|
|
5122
5167
|
u = h[p](u);
|
|
5123
5168
|
return u(s, a || o.fetcher || null, o);
|
|
5124
|
-
},
|
|
5169
|
+
}, Ru = (t, e, n) => {
|
|
5125
5170
|
const r = e[t] || (e[t] = []);
|
|
5126
5171
|
return r.push(n), () => {
|
|
5127
5172
|
const s = r.indexOf(n);
|
|
5128
5173
|
s >= 0 && (r[s] = r[r.length - 1], r.pop());
|
|
5129
5174
|
};
|
|
5130
5175
|
};
|
|
5131
|
-
|
|
5176
|
+
Ou();
|
|
5132
5177
|
const Bn = Gt.use || // This extra generic is to avoid TypeScript mixing up the generic and JSX sytax
|
|
5133
5178
|
// and emitting an error.
|
|
5134
5179
|
// We assume that this is only for the `use(thenable)` case, not `use(context)`.
|
|
@@ -5148,10 +5193,10 @@ const Bn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5148
5193
|
t.status = "rejected", t.reason = e;
|
|
5149
5194
|
}), t;
|
|
5150
5195
|
}
|
|
5151
|
-
}),
|
|
5196
|
+
}), Kn = {
|
|
5152
5197
|
dedupe: !0
|
|
5153
|
-
},
|
|
5154
|
-
const { cache: r, compare: s, suspense: a, fallbackData: i, revalidateOnMount: o, revalidateIfStale: u, refreshInterval: c, refreshWhenHidden: h, refreshWhenOffline: p, keepPreviousData: k } = n, [_, b, l, y] = Pe.get(r), [m, $] = Zr(t), P =
|
|
5198
|
+
}, Iu = (t, e, n) => {
|
|
5199
|
+
const { cache: r, compare: s, suspense: a, fallbackData: i, revalidateOnMount: o, revalidateIfStale: u, refreshInterval: c, refreshWhenHidden: h, refreshWhenOffline: p, keepPreviousData: k } = n, [_, b, l, y] = Pe.get(r), [m, $] = Zr(t), P = Ke(!1), z = Ke(!1), D = Ke(m), K = Ke(e), I = Ke(n), F = () => I.current, Se = () => F().isVisible() && F().isOnline(), [M, rt, Ve, le] = Xs(r, m), st = Ke({}).current, Yt = N(i) ? N(n.fallback) ? ee : n.fallback[m] : i, Dr = (j, Z) => {
|
|
5155
5200
|
for (const G in st) {
|
|
5156
5201
|
const V = G;
|
|
5157
5202
|
if (V === "data") {
|
|
@@ -5169,18 +5214,18 @@ const Bn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5169
5214
|
isLoading: !0
|
|
5170
5215
|
}, Oe) : Oe;
|
|
5171
5216
|
}, G = M(), V = le(), ye = Z(G), ot = G === V ? ye : Z(V);
|
|
5172
|
-
let
|
|
5217
|
+
let q = ye;
|
|
5173
5218
|
return [
|
|
5174
5219
|
() => {
|
|
5175
5220
|
const Y = Z(M());
|
|
5176
|
-
return Dr(Y,
|
|
5221
|
+
return Dr(Y, q) ? (q.data = Y.data, q.isLoading = Y.isLoading, q.isValidating = Y.isValidating, q.error = Y.error, q) : (q = Y, Y);
|
|
5177
5222
|
},
|
|
5178
5223
|
() => ot
|
|
5179
5224
|
];
|
|
5180
5225
|
}, [
|
|
5181
5226
|
r,
|
|
5182
5227
|
m
|
|
5183
|
-
]), at =
|
|
5228
|
+
]), at = au.useSyncExternalStore(an(
|
|
5184
5229
|
(j) => Ve(m, (Z, G) => {
|
|
5185
5230
|
Dr(G, Z) || j();
|
|
5186
5231
|
}),
|
|
@@ -5189,13 +5234,13 @@ const Bn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5189
5234
|
r,
|
|
5190
5235
|
m
|
|
5191
5236
|
]
|
|
5192
|
-
), Mr[0], Mr[1]), Lr = !P.current, ta = _[m] && _[m].length > 0, it = at.data, Ue = N(it) ? Yt && Js(Yt) ? Bn(Yt) : Yt : it, Qt = at.error,
|
|
5237
|
+
), Mr[0], Mr[1]), Lr = !P.current, ta = _[m] && _[m].length > 0, it = at.data, Ue = N(it) ? Yt && Js(Yt) ? Bn(Yt) : Yt : it, Qt = at.error, Cn = Ke(Ue), en = k ? N(it) ? N(Cn.current) ? Ue : Cn.current : it : Ue, $r = ta && !N(Qt) ? !1 : Lr && !N(o) ? o : F().isPaused() ? !1 : a ? N(Ue) ? !1 : u : N(Ue) || u, Fr = !!(m && e && Lr && $r), na = N(at.isValidating) ? Fr : at.isValidating, ra = N(at.isLoading) ? Fr : at.isLoading, wt = an(
|
|
5193
5238
|
(j) => Ie(void 0, null, function* () {
|
|
5194
|
-
const Z =
|
|
5239
|
+
const Z = K.current;
|
|
5195
5240
|
if (!m || !Z || z.current || F().isPaused())
|
|
5196
5241
|
return !1;
|
|
5197
5242
|
let G, V, ye = !0;
|
|
5198
|
-
const ot = j || {},
|
|
5243
|
+
const ot = j || {}, q = !l[m] || !ot.dedupe, Y = () => xs ? !z.current && m === D.current && P.current : m === D.current, Oe = {
|
|
5199
5244
|
isValidating: !1,
|
|
5200
5245
|
isLoading: !1
|
|
5201
5246
|
}, zr = () => {
|
|
@@ -5208,26 +5253,26 @@ const Bn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5208
5253
|
};
|
|
5209
5254
|
N(M().data) && (Ur.isLoading = !0);
|
|
5210
5255
|
try {
|
|
5211
|
-
if (
|
|
5256
|
+
if (q && (rt(Ur), n.loadingTimeout && N(M().data) && setTimeout(() => {
|
|
5212
5257
|
ye && Y() && F().onLoadingSlow(m, n);
|
|
5213
5258
|
}, n.loadingTimeout), l[m] = [
|
|
5214
5259
|
Z($),
|
|
5215
5260
|
Tr()
|
|
5216
|
-
]), [G, V] = l[m], G = yield G,
|
|
5217
|
-
return
|
|
5261
|
+
]), [G, V] = l[m], G = yield G, q && setTimeout(Vr, n.dedupingInterval), !l[m] || l[m][1] !== V)
|
|
5262
|
+
return q && Y() && F().onDiscarded(m), !1;
|
|
5218
5263
|
Oe.error = ee;
|
|
5219
5264
|
const ce = b[m];
|
|
5220
5265
|
if (!N(ce) && // case 1
|
|
5221
5266
|
(V <= ce[0] || // case 2
|
|
5222
5267
|
V <= ce[1] || // case 3
|
|
5223
5268
|
ce[1] === 0))
|
|
5224
|
-
return zr(),
|
|
5269
|
+
return zr(), q && Y() && F().onDiscarded(m), !1;
|
|
5225
5270
|
const Te = M().data;
|
|
5226
|
-
Oe.data = s(Te, G) ? Te : G,
|
|
5271
|
+
Oe.data = s(Te, G) ? Te : G, q && Y() && F().onSuccess(G, m, n);
|
|
5227
5272
|
} catch (ce) {
|
|
5228
5273
|
Vr();
|
|
5229
5274
|
const Te = F(), { shouldRetryOnError: Nn } = Te;
|
|
5230
|
-
Te.isPaused() || (Oe.error = ce,
|
|
5275
|
+
Te.isPaused() || (Oe.error = ce, q && Y() && (Te.onError(ce, m, Te), (Nn === !0 || be(Nn) && Nn(ce)) && (!F().revalidateOnFocus || !F().revalidateOnReconnect || Se()) && Te.onErrorRetry(ce, m, Te, (sa) => {
|
|
5231
5276
|
const Pn = _[m];
|
|
5232
5277
|
Pn && Pn[0] && Pn[0](ws, sa);
|
|
5233
5278
|
}, {
|
|
@@ -5259,16 +5304,16 @@ const Bn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5259
5304
|
[]
|
|
5260
5305
|
);
|
|
5261
5306
|
if (zn(() => {
|
|
5262
|
-
|
|
5307
|
+
K.current = e, I.current = n, N(it) || (Cn.current = it);
|
|
5263
5308
|
}), zn(() => {
|
|
5264
5309
|
if (!m) return;
|
|
5265
|
-
const j = wt.bind(ee,
|
|
5310
|
+
const j = wt.bind(ee, Kn);
|
|
5266
5311
|
let Z = 0;
|
|
5267
|
-
const V =
|
|
5268
|
-
if (ye ==
|
|
5269
|
-
const
|
|
5270
|
-
F().revalidateOnFocus &&
|
|
5271
|
-
} else if (ye ==
|
|
5312
|
+
const V = Ru(m, _, (ye, ot = {}) => {
|
|
5313
|
+
if (ye == qs) {
|
|
5314
|
+
const q = Date.now();
|
|
5315
|
+
F().revalidateOnFocus && q > Z && Se() && (Z = q + F().focusThrottleInterval, j());
|
|
5316
|
+
} else if (ye == Hs)
|
|
5272
5317
|
F().revalidateOnReconnect && Se() && j();
|
|
5273
5318
|
else {
|
|
5274
5319
|
if (ye == Gs)
|
|
@@ -5279,7 +5324,7 @@ const Bn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5279
5324
|
});
|
|
5280
5325
|
return z.current = !1, D.current = m, P.current = !0, rt({
|
|
5281
5326
|
_k: $
|
|
5282
|
-
}), $r && (N(Ue) ||
|
|
5327
|
+
}), $r && (N(Ue) || Ht ? j() : pu(j)), () => {
|
|
5283
5328
|
z.current = !0, V();
|
|
5284
5329
|
};
|
|
5285
5330
|
}, [
|
|
@@ -5291,7 +5336,7 @@ const Bn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5291
5336
|
V && j !== -1 && (j = setTimeout(G, V));
|
|
5292
5337
|
}
|
|
5293
5338
|
function G() {
|
|
5294
|
-
!M().error && (h || F().isVisible()) && (p || F().isOnline()) ? wt(
|
|
5339
|
+
!M().error && (h || F().isVisible()) && (p || F().isOnline()) ? wt(Kn).then(Z) : Z();
|
|
5295
5340
|
}
|
|
5296
5341
|
return Z(), () => {
|
|
5297
5342
|
j && (clearTimeout(j), j = -1);
|
|
@@ -5302,16 +5347,16 @@ const Bn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5302
5347
|
p,
|
|
5303
5348
|
m
|
|
5304
5349
|
]), ya(en), a && N(Ue) && m) {
|
|
5305
|
-
if (!
|
|
5350
|
+
if (!xs && Ht)
|
|
5306
5351
|
throw new Error("Fallback data is required when using Suspense in SSR.");
|
|
5307
|
-
|
|
5352
|
+
K.current = e, I.current = n, z.current = !1;
|
|
5308
5353
|
const j = y[m];
|
|
5309
5354
|
if (!N(j)) {
|
|
5310
5355
|
const Z = Wr(j);
|
|
5311
5356
|
Bn(Z);
|
|
5312
5357
|
}
|
|
5313
5358
|
if (N(Qt)) {
|
|
5314
|
-
const Z = wt(
|
|
5359
|
+
const Z = wt(Kn);
|
|
5315
5360
|
N(en) || (Z.status = "fulfilled", Z.value = !0), Bn(Z);
|
|
5316
5361
|
} else
|
|
5317
5362
|
throw Qt;
|
|
@@ -5331,15 +5376,15 @@ const Bn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5331
5376
|
return st.isLoading = !0, ra;
|
|
5332
5377
|
}
|
|
5333
5378
|
};
|
|
5334
|
-
},
|
|
5379
|
+
}, ju = Pu(Iu), $u = ({
|
|
5335
5380
|
fileKey: t,
|
|
5336
5381
|
authToken: e,
|
|
5337
5382
|
enabled: n = !0,
|
|
5338
5383
|
params: r = {}
|
|
5339
5384
|
}) => {
|
|
5340
|
-
const s = !!(n && t && e), { data: a, isLoading: i, error: o } =
|
|
5385
|
+
const s = !!(n && t && e), { data: a, isLoading: i, error: o } = ju(
|
|
5341
5386
|
["figma", t, e, r],
|
|
5342
|
-
() => s ?
|
|
5387
|
+
() => s ? Ti({
|
|
5343
5388
|
fileKey: t,
|
|
5344
5389
|
authToken: e,
|
|
5345
5390
|
params: r
|
|
@@ -5357,7 +5402,7 @@ const Bn = Gt.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
5357
5402
|
};
|
|
5358
5403
|
};
|
|
5359
5404
|
export {
|
|
5360
|
-
|
|
5361
|
-
|
|
5405
|
+
Lu as useAnimaCodegen,
|
|
5406
|
+
$u as useFigmaFile
|
|
5362
5407
|
};
|
|
5363
5408
|
//# sourceMappingURL=index.js.map
|