@animaapp/anima-sdk 0.8.0 → 0.10.0
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 +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +32 -18
- package/dist/index.js +811 -779
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Dr = Object.defineProperty, Lr = Object.defineProperties;
|
|
2
|
+
var Fr = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var yn = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
4
|
+
var $r = Object.prototype.hasOwnProperty, jr = Object.prototype.propertyIsEnumerable;
|
|
5
5
|
var bn = (e) => {
|
|
6
6
|
throw TypeError(e);
|
|
7
|
-
}, wn = Math.pow, vn = (e, t, n) => t in e ?
|
|
7
|
+
}, wn = Math.pow, vn = (e, t, n) => t in e ? Dr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, d = (e, t) => {
|
|
8
8
|
for (var n in t || (t = {}))
|
|
9
|
-
|
|
9
|
+
$r.call(t, n) && vn(e, n, t[n]);
|
|
10
10
|
if (yn)
|
|
11
11
|
for (var n of yn(t))
|
|
12
|
-
|
|
12
|
+
jr.call(t, n) && vn(e, n, t[n]);
|
|
13
13
|
return e;
|
|
14
|
-
}, v = (e, t) =>
|
|
15
|
-
var
|
|
16
|
-
var w = (e, t, n) => (
|
|
14
|
+
}, v = (e, t) => Lr(e, Fr(t));
|
|
15
|
+
var zt = (e, t, n) => t.has(e) || bn("Cannot " + n);
|
|
16
|
+
var w = (e, t, n) => (zt(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Y = (e, t, n) => t.has(e) ? bn("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), W = (e, t, n, r) => (zt(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), F = (e, t, n) => (zt(e, t, "access private method"), n);
|
|
17
17
|
var O = (e, t, n) => new Promise((r, a) => {
|
|
18
18
|
var i = (c) => {
|
|
19
19
|
try {
|
|
@@ -31,96 +31,96 @@ var O = (e, t, n) => new Promise((r, a) => {
|
|
|
31
31
|
o((n = n.apply(e, t)).next());
|
|
32
32
|
});
|
|
33
33
|
/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */
|
|
34
|
-
function
|
|
34
|
+
function $e(e) {
|
|
35
35
|
let t = e.length;
|
|
36
36
|
for (; --t >= 0; )
|
|
37
37
|
e[t] = 0;
|
|
38
38
|
}
|
|
39
|
-
const
|
|
39
|
+
const Mr = 0, er = 1, Ur = 2, Pr = 3, Br = 258, un = 29, ot = 256, Ye = ot + 1 + un, Oe = 30, fn = 19, tr = 2 * Ye + 1, we = 15, Dt = 16, Vr = 7, hn = 256, nr = 16, rr = 17, ar = 18, Bt = (
|
|
40
40
|
/* extra bits for each length code */
|
|
41
41
|
new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0])
|
|
42
|
-
),
|
|
42
|
+
), yt = (
|
|
43
43
|
/* extra bits for each distance code */
|
|
44
44
|
new Uint8Array([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13])
|
|
45
|
-
),
|
|
45
|
+
), Hr = (
|
|
46
46
|
/* extra bits for each bit length code */
|
|
47
47
|
new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7])
|
|
48
|
-
),
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
48
|
+
), ir = new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), Wr = 512, ie = new Array((Ye + 2) * 2);
|
|
49
|
+
$e(ie);
|
|
50
|
+
const Ge = new Array(Oe * 2);
|
|
51
|
+
$e(Ge);
|
|
52
|
+
const Je = new Array(Wr);
|
|
53
|
+
$e(Je);
|
|
54
|
+
const Qe = new Array(Br - Pr + 1);
|
|
55
|
+
$e(Qe);
|
|
56
56
|
const _n = new Array(un);
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
57
|
+
$e(_n);
|
|
58
|
+
const wt = new Array(Oe);
|
|
59
|
+
$e(wt);
|
|
60
60
|
function Lt(e, t, n, r, a) {
|
|
61
61
|
this.static_tree = e, this.extra_bits = t, this.extra_base = n, this.elems = r, this.max_length = a, this.has_stree = e && e.length;
|
|
62
62
|
}
|
|
63
|
-
let
|
|
64
|
-
function
|
|
63
|
+
let sr, or, lr;
|
|
64
|
+
function Ft(e, t) {
|
|
65
65
|
this.dyn_tree = e, this.max_code = 0, this.stat_desc = t;
|
|
66
66
|
}
|
|
67
|
-
const
|
|
67
|
+
const cr = (e) => e < 256 ? Je[e] : Je[256 + (e >>> 7)], et = (e, t) => {
|
|
68
68
|
e.pending_buf[e.pending++] = t & 255, e.pending_buf[e.pending++] = t >>> 8 & 255;
|
|
69
|
-
},
|
|
70
|
-
e.bi_valid >
|
|
69
|
+
}, U = (e, t, n) => {
|
|
70
|
+
e.bi_valid > Dt - n ? (e.bi_buf |= t << e.bi_valid & 65535, et(e, e.bi_buf), e.bi_buf = t >> Dt - e.bi_valid, e.bi_valid += n - Dt) : (e.bi_buf |= t << e.bi_valid & 65535, e.bi_valid += n);
|
|
71
71
|
}, Q = (e, t, n) => {
|
|
72
|
-
|
|
72
|
+
U(
|
|
73
73
|
e,
|
|
74
74
|
n[t * 2],
|
|
75
75
|
n[t * 2 + 1]
|
|
76
76
|
/*.Len*/
|
|
77
77
|
);
|
|
78
|
-
},
|
|
78
|
+
}, dr = (e, t) => {
|
|
79
79
|
let n = 0;
|
|
80
80
|
do
|
|
81
81
|
n |= e & 1, e >>>= 1, n <<= 1;
|
|
82
82
|
while (--t > 0);
|
|
83
83
|
return n >>> 1;
|
|
84
|
-
},
|
|
85
|
-
e.bi_valid === 16 ? (
|
|
86
|
-
},
|
|
84
|
+
}, qr = (e) => {
|
|
85
|
+
e.bi_valid === 16 ? (et(e, e.bi_buf), e.bi_buf = 0, e.bi_valid = 0) : e.bi_valid >= 8 && (e.pending_buf[e.pending++] = e.bi_buf & 255, e.bi_buf >>= 8, e.bi_valid -= 8);
|
|
86
|
+
}, Kr = (e, t) => {
|
|
87
87
|
const n = t.dyn_tree, r = t.max_code, a = t.stat_desc.static_tree, i = t.stat_desc.has_stree, s = t.stat_desc.extra_bits, o = t.stat_desc.extra_base, c = t.stat_desc.max_length;
|
|
88
|
-
let l, h, S, y,
|
|
88
|
+
let l, h, S, y, N, Z, B = 0;
|
|
89
89
|
for (y = 0; y <= we; y++)
|
|
90
90
|
e.bl_count[y] = 0;
|
|
91
|
-
for (n[e.heap[e.heap_max] * 2 + 1] = 0, l = e.heap_max + 1; l <
|
|
92
|
-
h = e.heap[l], y = n[n[h * 2 + 1] * 2 + 1] + 1, y > c && (y = c,
|
|
93
|
-
if (
|
|
91
|
+
for (n[e.heap[e.heap_max] * 2 + 1] = 0, l = e.heap_max + 1; l < tr; l++)
|
|
92
|
+
h = e.heap[l], y = n[n[h * 2 + 1] * 2 + 1] + 1, y > c && (y = c, B++), n[h * 2 + 1] = y, !(h > r) && (e.bl_count[y]++, N = 0, h >= o && (N = s[h - o]), Z = n[h * 2], e.opt_len += Z * (y + N), i && (e.static_len += Z * (a[h * 2 + 1] + N)));
|
|
93
|
+
if (B !== 0) {
|
|
94
94
|
do {
|
|
95
95
|
for (y = c - 1; e.bl_count[y] === 0; )
|
|
96
96
|
y--;
|
|
97
|
-
e.bl_count[y]--, e.bl_count[y + 1] += 2, e.bl_count[c]--,
|
|
98
|
-
} while (
|
|
97
|
+
e.bl_count[y]--, e.bl_count[y + 1] += 2, e.bl_count[c]--, B -= 2;
|
|
98
|
+
} while (B > 0);
|
|
99
99
|
for (y = c; y !== 0; y--)
|
|
100
100
|
for (h = e.bl_count[y]; h !== 0; )
|
|
101
101
|
S = e.heap[--l], !(S > r) && (n[S * 2 + 1] !== y && (e.opt_len += (y - n[S * 2 + 1]) * n[S * 2], n[S * 2 + 1] = y), h--);
|
|
102
102
|
}
|
|
103
|
-
},
|
|
103
|
+
}, ur = (e, t, n) => {
|
|
104
104
|
const r = new Array(we + 1);
|
|
105
105
|
let a = 0, i, s;
|
|
106
106
|
for (i = 1; i <= we; i++)
|
|
107
107
|
a = a + n[i - 1] << 1, r[i] = a;
|
|
108
108
|
for (s = 0; s <= t; s++) {
|
|
109
109
|
let o = e[s * 2 + 1];
|
|
110
|
-
o !== 0 && (e[s * 2] =
|
|
110
|
+
o !== 0 && (e[s * 2] = dr(r[o]++, o));
|
|
111
111
|
}
|
|
112
|
-
},
|
|
112
|
+
}, Gr = () => {
|
|
113
113
|
let e, t, n, r, a;
|
|
114
114
|
const i = new Array(we + 1);
|
|
115
115
|
for (n = 0, r = 0; r < un - 1; r++)
|
|
116
|
-
for (_n[r] = n, e = 0; e < 1 <<
|
|
117
|
-
|
|
118
|
-
for (
|
|
119
|
-
for (
|
|
120
|
-
|
|
116
|
+
for (_n[r] = n, e = 0; e < 1 << Bt[r]; e++)
|
|
117
|
+
Qe[n++] = r;
|
|
118
|
+
for (Qe[n - 1] = r, a = 0, r = 0; r < 16; r++)
|
|
119
|
+
for (wt[r] = a, e = 0; e < 1 << yt[r]; e++)
|
|
120
|
+
Je[a++] = r;
|
|
121
121
|
for (a >>= 7; r < Oe; r++)
|
|
122
|
-
for (
|
|
123
|
-
|
|
122
|
+
for (wt[r] = a << 7, e = 0; e < 1 << yt[r] - 7; e++)
|
|
123
|
+
Je[256 + a++] = r;
|
|
124
124
|
for (t = 0; t <= we; t++)
|
|
125
125
|
i[t] = 0;
|
|
126
126
|
for (e = 0; e <= 143; )
|
|
@@ -131,20 +131,20 @@ const sr = (e) => e < 256 ? Ye[e] : Ye[256 + (e >>> 7)], Qe = (e, t) => {
|
|
|
131
131
|
ie[e * 2 + 1] = 7, e++, i[7]++;
|
|
132
132
|
for (; e <= 287; )
|
|
133
133
|
ie[e * 2 + 1] = 8, e++, i[8]++;
|
|
134
|
-
for (
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
},
|
|
134
|
+
for (ur(ie, Ye + 1, i), e = 0; e < Oe; e++)
|
|
135
|
+
Ge[e * 2 + 1] = 5, Ge[e * 2] = dr(e, 5);
|
|
136
|
+
sr = new Lt(ie, Bt, ot + 1, Ye, we), or = new Lt(Ge, yt, 0, Oe, we), lr = new Lt(new Array(0), Hr, 0, fn, Vr);
|
|
137
|
+
}, fr = (e) => {
|
|
138
138
|
let t;
|
|
139
|
-
for (t = 0; t <
|
|
139
|
+
for (t = 0; t < Ye; t++)
|
|
140
140
|
e.dyn_ltree[t * 2] = 0;
|
|
141
141
|
for (t = 0; t < Oe; t++)
|
|
142
142
|
e.dyn_dtree[t * 2] = 0;
|
|
143
143
|
for (t = 0; t < fn; t++)
|
|
144
144
|
e.bl_tree[t * 2] = 0;
|
|
145
145
|
e.dyn_ltree[hn * 2] = 1, e.opt_len = e.static_len = 0, e.sym_next = e.matches = 0;
|
|
146
|
-
},
|
|
147
|
-
e.bi_valid > 8 ?
|
|
146
|
+
}, hr = (e) => {
|
|
147
|
+
e.bi_valid > 8 ? et(e, e.bi_buf) : e.bi_valid > 0 && (e.pending_buf[e.pending++] = e.bi_buf), e.bi_buf = 0, e.bi_valid = 0;
|
|
148
148
|
}, xn = (e, t, n, r) => {
|
|
149
149
|
const a = t * 2, i = n * 2;
|
|
150
150
|
return e[a] < e[i] || e[a] === e[i] && r[t] <= r[n];
|
|
@@ -158,13 +158,13 @@ const sr = (e) => e < 256 ? Ye[e] : Ye[256 + (e >>> 7)], Qe = (e, t) => {
|
|
|
158
158
|
let r, a, i = 0, s, o;
|
|
159
159
|
if (e.sym_next !== 0)
|
|
160
160
|
do
|
|
161
|
-
r = e.pending_buf[e.sym_buf + i++] & 255, r += (e.pending_buf[e.sym_buf + i++] & 255) << 8, a = e.pending_buf[e.sym_buf + i++], r === 0 ? Q(e, a, t) : (s =
|
|
161
|
+
r = e.pending_buf[e.sym_buf + i++] & 255, r += (e.pending_buf[e.sym_buf + i++] & 255) << 8, a = e.pending_buf[e.sym_buf + i++], r === 0 ? Q(e, a, t) : (s = Qe[a], Q(e, s + ot + 1, t), o = Bt[s], o !== 0 && (a -= _n[s], U(e, a, o)), r--, s = cr(r), Q(e, s, n), o = yt[s], o !== 0 && (r -= wt[s], U(e, r, o)));
|
|
162
162
|
while (i < e.sym_next);
|
|
163
163
|
Q(e, hn, t);
|
|
164
|
-
},
|
|
164
|
+
}, Vt = (e, t) => {
|
|
165
165
|
const n = t.dyn_tree, r = t.stat_desc.static_tree, a = t.stat_desc.has_stree, i = t.stat_desc.elems;
|
|
166
166
|
let s, o, c = -1, l;
|
|
167
|
-
for (e.heap_len = 0, e.heap_max =
|
|
167
|
+
for (e.heap_len = 0, e.heap_max = tr, s = 0; s < i; s++)
|
|
168
168
|
n[s * 2] !== 0 ? (e.heap[++e.heap_len] = c = s, e.depth[s] = 0) : n[s * 2 + 1] = 0;
|
|
169
169
|
for (; e.heap_len < 2; )
|
|
170
170
|
l = e.heap[++e.heap_len] = c < 2 ? ++c : 0, n[l * 2] = 1, e.depth[l] = 0, e.opt_len--, a && (e.static_len -= r[l * 2 + 1]);
|
|
@@ -199,11 +199,11 @@ const sr = (e) => e < 256 ? Ye[e] : Ye[256 + (e >>> 7)], Qe = (e, t) => {
|
|
|
199
199
|
e.heap[--e.heap_max] = e.heap[
|
|
200
200
|
1
|
|
201
201
|
/*SMALLEST*/
|
|
202
|
-
],
|
|
202
|
+
], Kr(e, t), ur(n, c, e.bl_count);
|
|
203
203
|
}, Sn = (e, t, n) => {
|
|
204
204
|
let r, a = -1, i, s = t[1], o = 0, c = 7, l = 4;
|
|
205
205
|
for (s === 0 && (c = 138, l = 3), t[(n + 1) * 2 + 1] = 65535, r = 0; r <= n; r++)
|
|
206
|
-
i = s, s = t[(r + 1) * 2 + 1], !(++o < c && i === s) && (o < l ? e.bl_tree[i * 2] += o : i !== 0 ? (i !== a && e.bl_tree[i * 2]++, e.bl_tree[
|
|
206
|
+
i = s, s = t[(r + 1) * 2 + 1], !(++o < c && i === s) && (o < l ? e.bl_tree[i * 2] += o : i !== 0 ? (i !== a && e.bl_tree[i * 2]++, e.bl_tree[nr * 2]++) : o <= 10 ? e.bl_tree[rr * 2]++ : e.bl_tree[ar * 2]++, o = 0, a = i, s === 0 ? (c = 138, l = 3) : i === s ? (c = 6, l = 3) : (c = 7, l = 4));
|
|
207
207
|
}, Tn = (e, t, n) => {
|
|
208
208
|
let r, a = -1, i, s = t[1], o = 0, c = 7, l = 4;
|
|
209
209
|
for (s === 0 && (c = 138, l = 3), r = 0; r <= n; r++)
|
|
@@ -212,50 +212,50 @@ const sr = (e) => e < 256 ? Ye[e] : Ye[256 + (e >>> 7)], Qe = (e, t) => {
|
|
|
212
212
|
do
|
|
213
213
|
Q(e, i, e.bl_tree);
|
|
214
214
|
while (--o !== 0);
|
|
215
|
-
else i !== 0 ? (i !== a && (Q(e, i, e.bl_tree), o--), Q(e,
|
|
215
|
+
else i !== 0 ? (i !== a && (Q(e, i, e.bl_tree), o--), Q(e, nr, e.bl_tree), U(e, o - 3, 2)) : o <= 10 ? (Q(e, rr, e.bl_tree), U(e, o - 3, 3)) : (Q(e, ar, e.bl_tree), U(e, o - 11, 7));
|
|
216
216
|
o = 0, a = i, s === 0 ? (c = 138, l = 3) : i === s ? (c = 6, l = 3) : (c = 7, l = 4);
|
|
217
217
|
}
|
|
218
|
-
},
|
|
218
|
+
}, Xr = (e) => {
|
|
219
219
|
let t;
|
|
220
|
-
for (Sn(e, e.dyn_ltree, e.l_desc.max_code), Sn(e, e.dyn_dtree, e.d_desc.max_code),
|
|
220
|
+
for (Sn(e, e.dyn_ltree, e.l_desc.max_code), Sn(e, e.dyn_dtree, e.d_desc.max_code), Vt(e, e.bl_desc), t = fn - 1; t >= 3 && e.bl_tree[ir[t] * 2 + 1] === 0; t--)
|
|
221
221
|
;
|
|
222
222
|
return e.opt_len += 3 * (t + 1) + 5 + 5 + 4, t;
|
|
223
|
-
},
|
|
223
|
+
}, Yr = (e, t, n, r) => {
|
|
224
224
|
let a;
|
|
225
|
-
for (
|
|
226
|
-
|
|
225
|
+
for (U(e, t - 257, 5), U(e, n - 1, 5), U(e, r - 4, 4), a = 0; a < r; a++)
|
|
226
|
+
U(e, e.bl_tree[ir[a] * 2 + 1], 3);
|
|
227
227
|
Tn(e, e.dyn_ltree, t - 1), Tn(e, e.dyn_dtree, n - 1);
|
|
228
|
-
},
|
|
228
|
+
}, Jr = (e) => {
|
|
229
229
|
let t = 4093624447, n;
|
|
230
230
|
for (n = 0; n <= 31; n++, t >>>= 1)
|
|
231
231
|
if (t & 1 && e.dyn_ltree[n * 2] !== 0)
|
|
232
232
|
return 0;
|
|
233
233
|
if (e.dyn_ltree[18] !== 0 || e.dyn_ltree[20] !== 0 || e.dyn_ltree[26] !== 0)
|
|
234
234
|
return 1;
|
|
235
|
-
for (n = 32; n <
|
|
235
|
+
for (n = 32; n < ot; n++)
|
|
236
236
|
if (e.dyn_ltree[n * 2] !== 0)
|
|
237
237
|
return 1;
|
|
238
238
|
return 0;
|
|
239
239
|
};
|
|
240
|
-
let
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
},
|
|
244
|
-
|
|
245
|
-
},
|
|
246
|
-
|
|
247
|
-
},
|
|
240
|
+
let En = !1;
|
|
241
|
+
const Qr = (e) => {
|
|
242
|
+
En || (Gr(), En = !0), e.l_desc = new Ft(e.dyn_ltree, sr), e.d_desc = new Ft(e.dyn_dtree, or), e.bl_desc = new Ft(e.bl_tree, lr), e.bi_buf = 0, e.bi_valid = 0, fr(e);
|
|
243
|
+
}, _r = (e, t, n, r) => {
|
|
244
|
+
U(e, (Mr << 1) + (r ? 1 : 0), 3), hr(e), et(e, n), et(e, ~n), n && e.pending_buf.set(e.window.subarray(t, t + n), e.pending), e.pending += n;
|
|
245
|
+
}, ea = (e) => {
|
|
246
|
+
U(e, er << 1, 3), Q(e, hn, ie), qr(e);
|
|
247
|
+
}, ta = (e, t, n, r) => {
|
|
248
248
|
let a, i, s = 0;
|
|
249
|
-
e.level > 0 ? (e.strm.data_type === 2 && (e.strm.data_type =
|
|
250
|
-
},
|
|
251
|
-
var
|
|
252
|
-
_tr_init:
|
|
253
|
-
_tr_stored_block:
|
|
254
|
-
_tr_flush_block:
|
|
255
|
-
_tr_tally:
|
|
256
|
-
_tr_align:
|
|
249
|
+
e.level > 0 ? (e.strm.data_type === 2 && (e.strm.data_type = Jr(e)), Vt(e, e.l_desc), Vt(e, e.d_desc), s = Xr(e), a = e.opt_len + 3 + 7 >>> 3, i = e.static_len + 3 + 7 >>> 3, i <= a && (a = i)) : a = i = n + 5, n + 4 <= a && t !== -1 ? _r(e, t, n, r) : e.strategy === 4 || i === a ? (U(e, (er << 1) + (r ? 1 : 0), 3), kn(e, ie, Ge)) : (U(e, (Ur << 1) + (r ? 1 : 0), 3), Yr(e, e.l_desc.max_code + 1, e.d_desc.max_code + 1, s + 1), kn(e, e.dyn_ltree, e.dyn_dtree)), fr(e), r && hr(e);
|
|
250
|
+
}, na = (e, t, n) => (e.pending_buf[e.sym_buf + e.sym_next++] = t, e.pending_buf[e.sym_buf + e.sym_next++] = t >> 8, e.pending_buf[e.sym_buf + e.sym_next++] = n, t === 0 ? e.dyn_ltree[n * 2]++ : (e.matches++, t--, e.dyn_ltree[(Qe[n] + ot + 1) * 2]++, e.dyn_dtree[cr(t) * 2]++), e.sym_next === e.sym_end);
|
|
251
|
+
var ra = Qr, aa = _r, ia = ta, sa = na, oa = ea, la = {
|
|
252
|
+
_tr_init: ra,
|
|
253
|
+
_tr_stored_block: aa,
|
|
254
|
+
_tr_flush_block: ia,
|
|
255
|
+
_tr_tally: sa,
|
|
256
|
+
_tr_align: oa
|
|
257
257
|
};
|
|
258
|
-
const
|
|
258
|
+
const ca = (e, t, n, r) => {
|
|
259
259
|
let a = e & 65535 | 0, i = e >>> 16 & 65535 | 0, s = 0;
|
|
260
260
|
for (; n !== 0; ) {
|
|
261
261
|
s = n > 2e3 ? 2e3 : n, n -= s;
|
|
@@ -266,8 +266,8 @@ const oa = (e, t, n, r) => {
|
|
|
266
266
|
}
|
|
267
267
|
return a | i << 16 | 0;
|
|
268
268
|
};
|
|
269
|
-
var
|
|
270
|
-
const
|
|
269
|
+
var pr = ca;
|
|
270
|
+
const da = () => {
|
|
271
271
|
let e, t = [];
|
|
272
272
|
for (var n = 0; n < 256; n++) {
|
|
273
273
|
e = n;
|
|
@@ -276,14 +276,14 @@ const la = () => {
|
|
|
276
276
|
t[n] = e;
|
|
277
277
|
}
|
|
278
278
|
return t;
|
|
279
|
-
},
|
|
280
|
-
const a =
|
|
279
|
+
}, ua = new Uint32Array(da()), fa = (e, t, n, r) => {
|
|
280
|
+
const a = ua, i = r + n;
|
|
281
281
|
e ^= -1;
|
|
282
282
|
for (let s = r; s < i; s++)
|
|
283
283
|
e = e >>> 8 ^ a[(e ^ t[s]) & 255];
|
|
284
284
|
return e ^ -1;
|
|
285
285
|
};
|
|
286
|
-
var de =
|
|
286
|
+
var de = fa, xt = {
|
|
287
287
|
2: "need dictionary",
|
|
288
288
|
/* Z_NEED_DICT 2 */
|
|
289
289
|
1: "stream end",
|
|
@@ -302,7 +302,7 @@ var de = da, wt = {
|
|
|
302
302
|
/* Z_BUF_ERROR (-5) */
|
|
303
303
|
"-6": "incompatible version"
|
|
304
304
|
/* Z_VERSION_ERROR (-6) */
|
|
305
|
-
},
|
|
305
|
+
}, gr = {
|
|
306
306
|
/* Allowed flush values; see deflate() and inflate() below for details */
|
|
307
307
|
Z_NO_FLUSH: 0,
|
|
308
308
|
Z_PARTIAL_FLUSH: 1,
|
|
@@ -330,30 +330,30 @@ var de = da, wt = {
|
|
|
330
330
|
Z_DEFLATED: 8
|
|
331
331
|
//Z_NULL: null // Use -1 or null inline, depending on var type
|
|
332
332
|
};
|
|
333
|
-
const { _tr_init:
|
|
333
|
+
const { _tr_init: ha, _tr_stored_block: Ht, _tr_flush_block: _a, _tr_tally: _e, _tr_align: pa } = la, {
|
|
334
334
|
Z_NO_FLUSH: pe,
|
|
335
|
-
Z_PARTIAL_FLUSH:
|
|
336
|
-
Z_FULL_FLUSH:
|
|
337
|
-
Z_FINISH:
|
|
338
|
-
Z_BLOCK:
|
|
339
|
-
Z_OK:
|
|
335
|
+
Z_PARTIAL_FLUSH: ga,
|
|
336
|
+
Z_FULL_FLUSH: ma,
|
|
337
|
+
Z_FINISH: K,
|
|
338
|
+
Z_BLOCK: An,
|
|
339
|
+
Z_OK: D,
|
|
340
340
|
Z_STREAM_END: On,
|
|
341
341
|
Z_STREAM_ERROR: ee,
|
|
342
|
-
Z_DATA_ERROR:
|
|
343
|
-
Z_BUF_ERROR:
|
|
344
|
-
Z_DEFAULT_COMPRESSION:
|
|
345
|
-
Z_FILTERED:
|
|
346
|
-
Z_HUFFMAN_ONLY:
|
|
347
|
-
Z_RLE:
|
|
348
|
-
Z_FIXED:
|
|
349
|
-
Z_DEFAULT_STRATEGY:
|
|
350
|
-
Z_UNKNOWN:
|
|
351
|
-
Z_DEFLATED:
|
|
352
|
-
} =
|
|
342
|
+
Z_DATA_ERROR: ya,
|
|
343
|
+
Z_BUF_ERROR: jt,
|
|
344
|
+
Z_DEFAULT_COMPRESSION: va,
|
|
345
|
+
Z_FILTERED: ba,
|
|
346
|
+
Z_HUFFMAN_ONLY: _t,
|
|
347
|
+
Z_RLE: wa,
|
|
348
|
+
Z_FIXED: xa,
|
|
349
|
+
Z_DEFAULT_STRATEGY: ka,
|
|
350
|
+
Z_UNKNOWN: Sa,
|
|
351
|
+
Z_DEFLATED: Rt
|
|
352
|
+
} = gr, Ta = 9, Ea = 15, Aa = 8, Oa = 29, Ca = 256, Wt = Ca + 1 + Oa, Ra = 30, Na = 19, Ia = 2 * Wt + 1, Za = 15, x = 3, he = 258, te = he + x + 1, za = 32, Re = 42, pn = 57, qt = 69, Kt = 73, Gt = 91, Xt = 103, xe = 113, Ve = 666, j = 1, je = 2, Se = 3, Me = 4, Da = 3, ke = (e, t) => (e.msg = xt[t], t), Cn = (e) => e * 2 - (e > 4 ? 9 : 0), fe = (e) => {
|
|
353
353
|
let t = e.length;
|
|
354
354
|
for (; --t >= 0; )
|
|
355
355
|
e[t] = 0;
|
|
356
|
-
},
|
|
356
|
+
}, La = (e) => {
|
|
357
357
|
let t, n, r, a = e.w_size;
|
|
358
358
|
t = e.hash_size, r = t;
|
|
359
359
|
do
|
|
@@ -364,27 +364,27 @@ const { _tr_init: ua, _tr_stored_block: Vt, _tr_flush_block: fa, _tr_tally: _e,
|
|
|
364
364
|
n = e.prev[--r], e.prev[r] = n >= a ? n - a : 0;
|
|
365
365
|
while (--t);
|
|
366
366
|
};
|
|
367
|
-
let
|
|
368
|
-
const
|
|
367
|
+
let Fa = (e, t, n) => (t << e.hash_shift ^ n) & e.hash_mask, ge = Fa;
|
|
368
|
+
const V = (e) => {
|
|
369
369
|
const t = e.state;
|
|
370
370
|
let n = t.pending;
|
|
371
371
|
n > e.avail_out && (n = e.avail_out), n !== 0 && (e.output.set(t.pending_buf.subarray(t.pending_out, t.pending_out + n), e.next_out), e.next_out += n, t.pending_out += n, e.total_out += n, e.avail_out -= n, t.pending -= n, t.pending === 0 && (t.pending_out = 0));
|
|
372
|
-
},
|
|
373
|
-
|
|
374
|
-
},
|
|
372
|
+
}, H = (e, t) => {
|
|
373
|
+
_a(e, e.block_start >= 0 ? e.block_start : -1, e.strstart - e.block_start, t), e.block_start = e.strstart, V(e.strm);
|
|
374
|
+
}, A = (e, t) => {
|
|
375
375
|
e.pending_buf[e.pending++] = t;
|
|
376
376
|
}, Be = (e, t) => {
|
|
377
377
|
e.pending_buf[e.pending++] = t >>> 8 & 255, e.pending_buf[e.pending++] = t & 255;
|
|
378
|
-
},
|
|
378
|
+
}, Yt = (e, t, n, r) => {
|
|
379
379
|
let a = e.avail_in;
|
|
380
|
-
return a > r && (a = r), a === 0 ? 0 : (e.avail_in -= a, t.set(e.input.subarray(e.next_in, e.next_in + a), n), e.state.wrap === 1 ? e.adler =
|
|
381
|
-
},
|
|
380
|
+
return a > r && (a = r), a === 0 ? 0 : (e.avail_in -= a, t.set(e.input.subarray(e.next_in, e.next_in + a), n), e.state.wrap === 1 ? e.adler = pr(e.adler, t, a, n) : e.state.wrap === 2 && (e.adler = de(e.adler, t, a, n)), e.next_in += a, e.total_in += a, a);
|
|
381
|
+
}, mr = (e, t) => {
|
|
382
382
|
let n = e.max_chain_length, r = e.strstart, a, i, s = e.prev_length, o = e.nice_match;
|
|
383
383
|
const c = e.strstart > e.w_size - te ? e.strstart - (e.w_size - te) : 0, l = e.window, h = e.w_mask, S = e.prev, y = e.strstart + he;
|
|
384
|
-
let
|
|
384
|
+
let N = l[r + s - 1], Z = l[r + s];
|
|
385
385
|
e.prev_length >= e.good_match && (n >>= 2), o > e.lookahead && (o = e.lookahead);
|
|
386
386
|
do
|
|
387
|
-
if (a = t, !(l[a + s] !== Z || l[a + s - 1] !==
|
|
387
|
+
if (a = t, !(l[a + s] !== Z || l[a + s - 1] !== N || l[a] !== l[r] || l[++a] !== l[r + 1])) {
|
|
388
388
|
r += 2, a++;
|
|
389
389
|
do
|
|
390
390
|
;
|
|
@@ -392,39 +392,39 @@ const B = (e) => {
|
|
|
392
392
|
if (i = he - (y - r), r = y - he, i > s) {
|
|
393
393
|
if (e.match_start = t, s = i, i >= o)
|
|
394
394
|
break;
|
|
395
|
-
|
|
395
|
+
N = l[r + s - 1], Z = l[r + s];
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
398
|
while ((t = S[t & h]) > c && --n !== 0);
|
|
399
399
|
return s <= e.lookahead ? s : e.lookahead;
|
|
400
|
-
},
|
|
400
|
+
}, Ne = (e) => {
|
|
401
401
|
const t = e.w_size;
|
|
402
402
|
let n, r, a;
|
|
403
403
|
do {
|
|
404
|
-
if (r = e.window_size - e.lookahead - e.strstart, e.strstart >= t + (t - te) && (e.window.set(e.window.subarray(t, t + t - r), 0), e.match_start -= t, e.strstart -= t, e.block_start -= t, e.insert > e.strstart && (e.insert = e.strstart),
|
|
404
|
+
if (r = e.window_size - e.lookahead - e.strstart, e.strstart >= t + (t - te) && (e.window.set(e.window.subarray(t, t + t - r), 0), e.match_start -= t, e.strstart -= t, e.block_start -= t, e.insert > e.strstart && (e.insert = e.strstart), La(e), r += t), e.strm.avail_in === 0)
|
|
405
405
|
break;
|
|
406
|
-
if (n =
|
|
406
|
+
if (n = Yt(e.strm, e.window, e.strstart + e.lookahead, r), e.lookahead += n, e.lookahead + e.insert >= x)
|
|
407
407
|
for (a = e.strstart - e.insert, e.ins_h = e.window[a], e.ins_h = ge(e, e.ins_h, e.window[a + 1]); e.insert && (e.ins_h = ge(e, e.ins_h, e.window[a + x - 1]), e.prev[a & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = a, a++, e.insert--, !(e.lookahead + e.insert < x)); )
|
|
408
408
|
;
|
|
409
409
|
} while (e.lookahead < te && e.strm.avail_in !== 0);
|
|
410
|
-
},
|
|
410
|
+
}, yr = (e, t) => {
|
|
411
411
|
let n = e.pending_buf_size - 5 > e.w_size ? e.w_size : e.pending_buf_size - 5, r, a, i, s = 0, o = e.strm.avail_in;
|
|
412
412
|
do {
|
|
413
|
-
if (r = 65535, i = e.bi_valid + 42 >> 3, e.strm.avail_out < i || (i = e.strm.avail_out - i, a = e.strstart - e.block_start, r > a + e.strm.avail_in && (r = a + e.strm.avail_in), r > i && (r = i), r < n && (r === 0 && t !==
|
|
413
|
+
if (r = 65535, i = e.bi_valid + 42 >> 3, e.strm.avail_out < i || (i = e.strm.avail_out - i, a = e.strstart - e.block_start, r > a + e.strm.avail_in && (r = a + e.strm.avail_in), r > i && (r = i), r < n && (r === 0 && t !== K || t === pe || r !== a + e.strm.avail_in)))
|
|
414
414
|
break;
|
|
415
|
-
s = t ===
|
|
415
|
+
s = t === K && r === a + e.strm.avail_in ? 1 : 0, Ht(e, 0, 0, s), e.pending_buf[e.pending - 4] = r, e.pending_buf[e.pending - 3] = r >> 8, e.pending_buf[e.pending - 2] = ~r, e.pending_buf[e.pending - 1] = ~r >> 8, V(e.strm), a && (a > r && (a = r), e.strm.output.set(e.window.subarray(e.block_start, e.block_start + a), e.strm.next_out), e.strm.next_out += a, e.strm.avail_out -= a, e.strm.total_out += a, e.block_start += a, r -= a), r && (Yt(e.strm, e.strm.output, e.strm.next_out, r), e.strm.next_out += r, e.strm.avail_out -= r, e.strm.total_out += r);
|
|
416
416
|
} while (s === 0);
|
|
417
|
-
return o -= e.strm.avail_in, o && (o >= e.w_size ? (e.matches = 2, e.window.set(e.strm.input.subarray(e.strm.next_in - e.w_size, e.strm.next_in), 0), e.strstart = e.w_size, e.insert = e.strstart) : (e.window_size - e.strstart <= o && (e.strstart -= e.w_size, e.window.set(e.window.subarray(e.w_size, e.w_size + e.strstart), 0), e.matches < 2 && e.matches++, e.insert > e.strstart && (e.insert = e.strstart)), e.window.set(e.strm.input.subarray(e.strm.next_in - o, e.strm.next_in), e.strstart), e.strstart += o, e.insert += o > e.w_size - e.insert ? e.w_size - e.insert : o), e.block_start = e.strstart), e.high_water < e.strstart && (e.high_water = e.strstart), s ? Me : t !== pe && t !==
|
|
418
|
-
},
|
|
417
|
+
return o -= e.strm.avail_in, o && (o >= e.w_size ? (e.matches = 2, e.window.set(e.strm.input.subarray(e.strm.next_in - e.w_size, e.strm.next_in), 0), e.strstart = e.w_size, e.insert = e.strstart) : (e.window_size - e.strstart <= o && (e.strstart -= e.w_size, e.window.set(e.window.subarray(e.w_size, e.w_size + e.strstart), 0), e.matches < 2 && e.matches++, e.insert > e.strstart && (e.insert = e.strstart)), e.window.set(e.strm.input.subarray(e.strm.next_in - o, e.strm.next_in), e.strstart), e.strstart += o, e.insert += o > e.w_size - e.insert ? e.w_size - e.insert : o), e.block_start = e.strstart), e.high_water < e.strstart && (e.high_water = e.strstart), s ? Me : t !== pe && t !== K && e.strm.avail_in === 0 && e.strstart === e.block_start ? je : (i = e.window_size - e.strstart, e.strm.avail_in > i && e.block_start >= e.w_size && (e.block_start -= e.w_size, e.strstart -= e.w_size, e.window.set(e.window.subarray(e.w_size, e.w_size + e.strstart), 0), e.matches < 2 && e.matches++, i += e.w_size, e.insert > e.strstart && (e.insert = e.strstart)), i > e.strm.avail_in && (i = e.strm.avail_in), i && (Yt(e.strm, e.window, e.strstart, i), e.strstart += i, e.insert += i > e.w_size - e.insert ? e.w_size - e.insert : i), e.high_water < e.strstart && (e.high_water = e.strstart), i = e.bi_valid + 42 >> 3, i = e.pending_buf_size - i > 65535 ? 65535 : e.pending_buf_size - i, n = i > e.w_size ? e.w_size : i, a = e.strstart - e.block_start, (a >= n || (a || t === K) && t !== pe && e.strm.avail_in === 0 && a <= i) && (r = a > i ? i : a, s = t === K && e.strm.avail_in === 0 && r === a ? 1 : 0, Ht(e, e.block_start, r, s), e.block_start += r, V(e.strm)), s ? Se : j);
|
|
418
|
+
}, Mt = (e, t) => {
|
|
419
419
|
let n, r;
|
|
420
420
|
for (; ; ) {
|
|
421
421
|
if (e.lookahead < te) {
|
|
422
|
-
if (
|
|
423
|
-
return
|
|
422
|
+
if (Ne(e), e.lookahead < te && t === pe)
|
|
423
|
+
return j;
|
|
424
424
|
if (e.lookahead === 0)
|
|
425
425
|
break;
|
|
426
426
|
}
|
|
427
|
-
if (n = 0, e.lookahead >= x && (e.ins_h = ge(e, e.ins_h, e.window[e.strstart + x - 1]), n = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart), n !== 0 && e.strstart - n <= e.w_size - te && (e.match_length =
|
|
427
|
+
if (n = 0, e.lookahead >= x && (e.ins_h = ge(e, e.ins_h, e.window[e.strstart + x - 1]), n = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart), n !== 0 && e.strstart - n <= e.w_size - te && (e.match_length = mr(e, n)), e.match_length >= x)
|
|
428
428
|
if (r = _e(e, e.strstart - e.match_start, e.match_length - x), e.lookahead -= e.match_length, e.match_length <= e.max_lazy_match && e.lookahead >= x) {
|
|
429
429
|
e.match_length--;
|
|
430
430
|
do
|
|
@@ -435,40 +435,40 @@ const B = (e) => {
|
|
|
435
435
|
e.strstart += e.match_length, e.match_length = 0, e.ins_h = e.window[e.strstart], e.ins_h = ge(e, e.ins_h, e.window[e.strstart + 1]);
|
|
436
436
|
else
|
|
437
437
|
r = _e(e, 0, e.window[e.strstart]), e.lookahead--, e.strstart++;
|
|
438
|
-
if (r && (
|
|
439
|
-
return
|
|
438
|
+
if (r && (H(e, !1), e.strm.avail_out === 0))
|
|
439
|
+
return j;
|
|
440
440
|
}
|
|
441
|
-
return e.insert = e.strstart < x - 1 ? e.strstart : x - 1, t ===
|
|
442
|
-
},
|
|
441
|
+
return e.insert = e.strstart < x - 1 ? e.strstart : x - 1, t === K ? (H(e, !0), e.strm.avail_out === 0 ? Se : Me) : e.sym_next && (H(e, !1), e.strm.avail_out === 0) ? j : je;
|
|
442
|
+
}, Ee = (e, t) => {
|
|
443
443
|
let n, r, a;
|
|
444
444
|
for (; ; ) {
|
|
445
445
|
if (e.lookahead < te) {
|
|
446
|
-
if (
|
|
447
|
-
return
|
|
446
|
+
if (Ne(e), e.lookahead < te && t === pe)
|
|
447
|
+
return j;
|
|
448
448
|
if (e.lookahead === 0)
|
|
449
449
|
break;
|
|
450
450
|
}
|
|
451
|
-
if (n = 0, e.lookahead >= x && (e.ins_h = ge(e, e.ins_h, e.window[e.strstart + x - 1]), n = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart), e.prev_length = e.match_length, e.prev_match = e.match_start, e.match_length = x - 1, n !== 0 && e.prev_length < e.max_lazy_match && e.strstart - n <= e.w_size - te && (e.match_length =
|
|
451
|
+
if (n = 0, e.lookahead >= x && (e.ins_h = ge(e, e.ins_h, e.window[e.strstart + x - 1]), n = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart), e.prev_length = e.match_length, e.prev_match = e.match_start, e.match_length = x - 1, n !== 0 && e.prev_length < e.max_lazy_match && e.strstart - n <= e.w_size - te && (e.match_length = mr(e, n), e.match_length <= 5 && (e.strategy === ba || e.match_length === x && e.strstart - e.match_start > 4096) && (e.match_length = x - 1)), e.prev_length >= x && e.match_length <= e.prev_length) {
|
|
452
452
|
a = e.strstart + e.lookahead - x, r = _e(e, e.strstart - 1 - e.prev_match, e.prev_length - x), e.lookahead -= e.prev_length - 1, e.prev_length -= 2;
|
|
453
453
|
do
|
|
454
454
|
++e.strstart <= a && (e.ins_h = ge(e, e.ins_h, e.window[e.strstart + x - 1]), n = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart);
|
|
455
455
|
while (--e.prev_length !== 0);
|
|
456
|
-
if (e.match_available = 0, e.match_length = x - 1, e.strstart++, r && (
|
|
457
|
-
return
|
|
456
|
+
if (e.match_available = 0, e.match_length = x - 1, e.strstart++, r && (H(e, !1), e.strm.avail_out === 0))
|
|
457
|
+
return j;
|
|
458
458
|
} else if (e.match_available) {
|
|
459
|
-
if (r = _e(e, 0, e.window[e.strstart - 1]), r &&
|
|
460
|
-
return
|
|
459
|
+
if (r = _e(e, 0, e.window[e.strstart - 1]), r && H(e, !1), e.strstart++, e.lookahead--, e.strm.avail_out === 0)
|
|
460
|
+
return j;
|
|
461
461
|
} else
|
|
462
462
|
e.match_available = 1, e.strstart++, e.lookahead--;
|
|
463
463
|
}
|
|
464
|
-
return e.match_available && (r = _e(e, 0, e.window[e.strstart - 1]), e.match_available = 0), e.insert = e.strstart < x - 1 ? e.strstart : x - 1, t ===
|
|
465
|
-
},
|
|
464
|
+
return e.match_available && (r = _e(e, 0, e.window[e.strstart - 1]), e.match_available = 0), e.insert = e.strstart < x - 1 ? e.strstart : x - 1, t === K ? (H(e, !0), e.strm.avail_out === 0 ? Se : Me) : e.sym_next && (H(e, !1), e.strm.avail_out === 0) ? j : je;
|
|
465
|
+
}, $a = (e, t) => {
|
|
466
466
|
let n, r, a, i;
|
|
467
467
|
const s = e.window;
|
|
468
468
|
for (; ; ) {
|
|
469
469
|
if (e.lookahead <= he) {
|
|
470
|
-
if (
|
|
471
|
-
return
|
|
470
|
+
if (Ne(e), e.lookahead <= he && t === pe)
|
|
471
|
+
return j;
|
|
472
472
|
if (e.lookahead === 0)
|
|
473
473
|
break;
|
|
474
474
|
}
|
|
@@ -479,212 +479,212 @@ const B = (e) => {
|
|
|
479
479
|
while (r === s[++a] && r === s[++a] && r === s[++a] && r === s[++a] && r === s[++a] && r === s[++a] && r === s[++a] && r === s[++a] && a < i);
|
|
480
480
|
e.match_length = he - (i - a), e.match_length > e.lookahead && (e.match_length = e.lookahead);
|
|
481
481
|
}
|
|
482
|
-
if (e.match_length >= x ? (n = _e(e, 1, e.match_length - x), e.lookahead -= e.match_length, e.strstart += e.match_length, e.match_length = 0) : (n = _e(e, 0, e.window[e.strstart]), e.lookahead--, e.strstart++), n && (
|
|
483
|
-
return
|
|
482
|
+
if (e.match_length >= x ? (n = _e(e, 1, e.match_length - x), e.lookahead -= e.match_length, e.strstart += e.match_length, e.match_length = 0) : (n = _e(e, 0, e.window[e.strstart]), e.lookahead--, e.strstart++), n && (H(e, !1), e.strm.avail_out === 0))
|
|
483
|
+
return j;
|
|
484
484
|
}
|
|
485
|
-
return e.insert = 0, t ===
|
|
486
|
-
},
|
|
485
|
+
return e.insert = 0, t === K ? (H(e, !0), e.strm.avail_out === 0 ? Se : Me) : e.sym_next && (H(e, !1), e.strm.avail_out === 0) ? j : je;
|
|
486
|
+
}, ja = (e, t) => {
|
|
487
487
|
let n;
|
|
488
488
|
for (; ; ) {
|
|
489
|
-
if (e.lookahead === 0 && (
|
|
489
|
+
if (e.lookahead === 0 && (Ne(e), e.lookahead === 0)) {
|
|
490
490
|
if (t === pe)
|
|
491
|
-
return
|
|
491
|
+
return j;
|
|
492
492
|
break;
|
|
493
493
|
}
|
|
494
|
-
if (e.match_length = 0, n = _e(e, 0, e.window[e.strstart]), e.lookahead--, e.strstart++, n && (
|
|
495
|
-
return
|
|
494
|
+
if (e.match_length = 0, n = _e(e, 0, e.window[e.strstart]), e.lookahead--, e.strstart++, n && (H(e, !1), e.strm.avail_out === 0))
|
|
495
|
+
return j;
|
|
496
496
|
}
|
|
497
|
-
return e.insert = 0, t ===
|
|
497
|
+
return e.insert = 0, t === K ? (H(e, !0), e.strm.avail_out === 0 ? Se : Me) : e.sym_next && (H(e, !1), e.strm.avail_out === 0) ? j : je;
|
|
498
498
|
};
|
|
499
499
|
function J(e, t, n, r, a) {
|
|
500
500
|
this.good_length = e, this.max_lazy = t, this.nice_length = n, this.max_chain = r, this.func = a;
|
|
501
501
|
}
|
|
502
502
|
const He = [
|
|
503
503
|
/* good lazy nice chain */
|
|
504
|
-
new J(0, 0, 0, 0,
|
|
504
|
+
new J(0, 0, 0, 0, yr),
|
|
505
505
|
/* 0 store only */
|
|
506
|
-
new J(4, 4, 8, 4,
|
|
506
|
+
new J(4, 4, 8, 4, Mt),
|
|
507
507
|
/* 1 max speed, no lazy matches */
|
|
508
|
-
new J(4, 5, 16, 8,
|
|
508
|
+
new J(4, 5, 16, 8, Mt),
|
|
509
509
|
/* 2 */
|
|
510
|
-
new J(4, 6, 32, 32,
|
|
510
|
+
new J(4, 6, 32, 32, Mt),
|
|
511
511
|
/* 3 */
|
|
512
|
-
new J(4, 4, 16, 16,
|
|
512
|
+
new J(4, 4, 16, 16, Ee),
|
|
513
513
|
/* 4 lazy matches */
|
|
514
|
-
new J(8, 16, 32, 32,
|
|
514
|
+
new J(8, 16, 32, 32, Ee),
|
|
515
515
|
/* 5 */
|
|
516
|
-
new J(8, 16, 128, 128,
|
|
516
|
+
new J(8, 16, 128, 128, Ee),
|
|
517
517
|
/* 6 */
|
|
518
|
-
new J(8, 32, 128, 256,
|
|
518
|
+
new J(8, 32, 128, 256, Ee),
|
|
519
519
|
/* 7 */
|
|
520
|
-
new J(32, 128, 258, 1024,
|
|
520
|
+
new J(32, 128, 258, 1024, Ee),
|
|
521
521
|
/* 8 */
|
|
522
|
-
new J(32, 258, 258, 4096,
|
|
522
|
+
new J(32, 258, 258, 4096, Ee)
|
|
523
523
|
/* 9 max compression */
|
|
524
|
-
],
|
|
524
|
+
], Ma = (e) => {
|
|
525
525
|
e.window_size = 2 * e.w_size, fe(e.head), e.max_lazy_match = He[e.level].max_lazy, e.good_match = He[e.level].good_length, e.nice_match = He[e.level].nice_length, e.max_chain_length = He[e.level].max_chain, e.strstart = 0, e.block_start = 0, e.lookahead = 0, e.insert = 0, e.match_length = e.prev_length = x - 1, e.match_available = 0, e.ins_h = 0;
|
|
526
526
|
};
|
|
527
|
-
function
|
|
528
|
-
this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method =
|
|
527
|
+
function Ua() {
|
|
528
|
+
this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = Rt, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new Uint16Array(Ia * 2), this.dyn_dtree = new Uint16Array((2 * Ra + 1) * 2), this.bl_tree = new Uint16Array((2 * Na + 1) * 2), fe(this.dyn_ltree), fe(this.dyn_dtree), fe(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new Uint16Array(Za + 1), this.heap = new Uint16Array(2 * Wt + 1), fe(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new Uint16Array(2 * Wt + 1), fe(this.depth), this.sym_buf = 0, this.lit_bufsize = 0, this.sym_next = 0, this.sym_end = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;
|
|
529
529
|
}
|
|
530
|
-
const
|
|
530
|
+
const lt = (e) => {
|
|
531
531
|
if (!e)
|
|
532
532
|
return 1;
|
|
533
533
|
const t = e.state;
|
|
534
534
|
return !t || t.strm !== e || t.status !== Re && //#ifdef GZIP
|
|
535
535
|
t.status !== pn && //#endif
|
|
536
|
-
t.status !==
|
|
537
|
-
},
|
|
538
|
-
if (
|
|
536
|
+
t.status !== qt && t.status !== Kt && t.status !== Gt && t.status !== Xt && t.status !== xe && t.status !== Ve ? 1 : 0;
|
|
537
|
+
}, vr = (e) => {
|
|
538
|
+
if (lt(e))
|
|
539
539
|
return ke(e, ee);
|
|
540
|
-
e.total_in = e.total_out = 0, e.data_type =
|
|
540
|
+
e.total_in = e.total_out = 0, e.data_type = Sa;
|
|
541
541
|
const t = e.state;
|
|
542
542
|
return t.pending = 0, t.pending_out = 0, t.wrap < 0 && (t.wrap = -t.wrap), t.status = //#ifdef GZIP
|
|
543
543
|
t.wrap === 2 ? pn : (
|
|
544
544
|
//#endif
|
|
545
545
|
t.wrap ? Re : xe
|
|
546
|
-
), e.adler = t.wrap === 2 ? 0 : 1, t.last_flush = -2,
|
|
547
|
-
},
|
|
548
|
-
const t =
|
|
549
|
-
return t ===
|
|
550
|
-
},
|
|
546
|
+
), e.adler = t.wrap === 2 ? 0 : 1, t.last_flush = -2, ha(t), D;
|
|
547
|
+
}, br = (e) => {
|
|
548
|
+
const t = vr(e);
|
|
549
|
+
return t === D && Ma(e.state), t;
|
|
550
|
+
}, Pa = (e, t) => lt(e) || e.state.wrap !== 2 ? ee : (e.state.gzhead = t, D), wr = (e, t, n, r, a, i) => {
|
|
551
551
|
if (!e)
|
|
552
552
|
return ee;
|
|
553
553
|
let s = 1;
|
|
554
|
-
if (t ===
|
|
554
|
+
if (t === va && (t = 6), r < 0 ? (s = 0, r = -r) : r > 15 && (s = 2, r -= 16), a < 1 || a > Ta || n !== Rt || r < 8 || r > 15 || t < 0 || t > 9 || i < 0 || i > xa || r === 8 && s !== 1)
|
|
555
555
|
return ke(e, ee);
|
|
556
556
|
r === 8 && (r = 9);
|
|
557
|
-
const o = new
|
|
558
|
-
return e.state = o, o.strm = e, o.status = Re, o.wrap = s, o.gzhead = null, o.w_bits = r, o.w_size = 1 << o.w_bits, o.w_mask = o.w_size - 1, o.hash_bits = a + 7, o.hash_size = 1 << o.hash_bits, o.hash_mask = o.hash_size - 1, o.hash_shift = ~~((o.hash_bits + x - 1) / x), o.window = new Uint8Array(o.w_size * 2), o.head = new Uint16Array(o.hash_size), o.prev = new Uint16Array(o.w_size), o.lit_bufsize = 1 << a + 6, o.pending_buf_size = o.lit_bufsize * 4, o.pending_buf = new Uint8Array(o.pending_buf_size), o.sym_buf = o.lit_bufsize, o.sym_end = (o.lit_bufsize - 1) * 3, o.level = t, o.strategy = i, o.method = n,
|
|
559
|
-
},
|
|
560
|
-
if (
|
|
557
|
+
const o = new Ua();
|
|
558
|
+
return e.state = o, o.strm = e, o.status = Re, o.wrap = s, o.gzhead = null, o.w_bits = r, o.w_size = 1 << o.w_bits, o.w_mask = o.w_size - 1, o.hash_bits = a + 7, o.hash_size = 1 << o.hash_bits, o.hash_mask = o.hash_size - 1, o.hash_shift = ~~((o.hash_bits + x - 1) / x), o.window = new Uint8Array(o.w_size * 2), o.head = new Uint16Array(o.hash_size), o.prev = new Uint16Array(o.w_size), o.lit_bufsize = 1 << a + 6, o.pending_buf_size = o.lit_bufsize * 4, o.pending_buf = new Uint8Array(o.pending_buf_size), o.sym_buf = o.lit_bufsize, o.sym_end = (o.lit_bufsize - 1) * 3, o.level = t, o.strategy = i, o.method = n, br(e);
|
|
559
|
+
}, Ba = (e, t) => wr(e, t, Rt, Ea, Aa, ka), Va = (e, t) => {
|
|
560
|
+
if (lt(e) || t > An || t < 0)
|
|
561
561
|
return e ? ke(e, ee) : ee;
|
|
562
562
|
const n = e.state;
|
|
563
|
-
if (!e.output || e.avail_in !== 0 && !e.input || n.status === Ve && t !==
|
|
564
|
-
return ke(e, e.avail_out === 0 ?
|
|
563
|
+
if (!e.output || e.avail_in !== 0 && !e.input || n.status === Ve && t !== K)
|
|
564
|
+
return ke(e, e.avail_out === 0 ? jt : ee);
|
|
565
565
|
const r = n.last_flush;
|
|
566
566
|
if (n.last_flush = t, n.pending !== 0) {
|
|
567
|
-
if (
|
|
568
|
-
return n.last_flush = -1,
|
|
569
|
-
} else if (e.avail_in === 0 && Cn(t) <= Cn(r) && t !==
|
|
570
|
-
return ke(e,
|
|
567
|
+
if (V(e), e.avail_out === 0)
|
|
568
|
+
return n.last_flush = -1, D;
|
|
569
|
+
} else if (e.avail_in === 0 && Cn(t) <= Cn(r) && t !== K)
|
|
570
|
+
return ke(e, jt);
|
|
571
571
|
if (n.status === Ve && e.avail_in !== 0)
|
|
572
|
-
return ke(e,
|
|
572
|
+
return ke(e, jt);
|
|
573
573
|
if (n.status === Re && n.wrap === 0 && (n.status = xe), n.status === Re) {
|
|
574
|
-
let a =
|
|
575
|
-
if (n.strategy >=
|
|
576
|
-
return n.last_flush = -1,
|
|
574
|
+
let a = Rt + (n.w_bits - 8 << 4) << 8, i = -1;
|
|
575
|
+
if (n.strategy >= _t || n.level < 2 ? i = 0 : n.level < 6 ? i = 1 : n.level === 6 ? i = 2 : i = 3, a |= i << 6, n.strstart !== 0 && (a |= za), a += 31 - a % 31, Be(n, a), n.strstart !== 0 && (Be(n, e.adler >>> 16), Be(n, e.adler & 65535)), e.adler = 1, n.status = xe, V(e), n.pending !== 0)
|
|
576
|
+
return n.last_flush = -1, D;
|
|
577
577
|
}
|
|
578
578
|
if (n.status === pn) {
|
|
579
|
-
if (e.adler = 0,
|
|
580
|
-
|
|
579
|
+
if (e.adler = 0, A(n, 31), A(n, 139), A(n, 8), n.gzhead)
|
|
580
|
+
A(
|
|
581
581
|
n,
|
|
582
582
|
(n.gzhead.text ? 1 : 0) + (n.gzhead.hcrc ? 2 : 0) + (n.gzhead.extra ? 4 : 0) + (n.gzhead.name ? 8 : 0) + (n.gzhead.comment ? 16 : 0)
|
|
583
|
-
),
|
|
584
|
-
else if (
|
|
585
|
-
return n.last_flush = -1,
|
|
583
|
+
), A(n, n.gzhead.time & 255), A(n, n.gzhead.time >> 8 & 255), A(n, n.gzhead.time >> 16 & 255), A(n, n.gzhead.time >> 24 & 255), A(n, n.level === 9 ? 2 : n.strategy >= _t || n.level < 2 ? 4 : 0), A(n, n.gzhead.os & 255), n.gzhead.extra && n.gzhead.extra.length && (A(n, n.gzhead.extra.length & 255), A(n, n.gzhead.extra.length >> 8 & 255)), n.gzhead.hcrc && (e.adler = de(e.adler, n.pending_buf, n.pending, 0)), n.gzindex = 0, n.status = qt;
|
|
584
|
+
else if (A(n, 0), A(n, 0), A(n, 0), A(n, 0), A(n, 0), A(n, n.level === 9 ? 2 : n.strategy >= _t || n.level < 2 ? 4 : 0), A(n, Da), n.status = xe, V(e), n.pending !== 0)
|
|
585
|
+
return n.last_flush = -1, D;
|
|
586
586
|
}
|
|
587
|
-
if (n.status ===
|
|
587
|
+
if (n.status === qt) {
|
|
588
588
|
if (n.gzhead.extra) {
|
|
589
589
|
let a = n.pending, i = (n.gzhead.extra.length & 65535) - n.gzindex;
|
|
590
590
|
for (; n.pending + i > n.pending_buf_size; ) {
|
|
591
591
|
let o = n.pending_buf_size - n.pending;
|
|
592
|
-
if (n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex, n.gzindex + o), n.pending), n.pending = n.pending_buf_size, n.gzhead.hcrc && n.pending > a && (e.adler = de(e.adler, n.pending_buf, n.pending - a, a)), n.gzindex += o,
|
|
593
|
-
return n.last_flush = -1,
|
|
592
|
+
if (n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex, n.gzindex + o), n.pending), n.pending = n.pending_buf_size, n.gzhead.hcrc && n.pending > a && (e.adler = de(e.adler, n.pending_buf, n.pending - a, a)), n.gzindex += o, V(e), n.pending !== 0)
|
|
593
|
+
return n.last_flush = -1, D;
|
|
594
594
|
a = 0, i -= o;
|
|
595
595
|
}
|
|
596
596
|
let s = new Uint8Array(n.gzhead.extra);
|
|
597
597
|
n.pending_buf.set(s.subarray(n.gzindex, n.gzindex + i), n.pending), n.pending += i, n.gzhead.hcrc && n.pending > a && (e.adler = de(e.adler, n.pending_buf, n.pending - a, a)), n.gzindex = 0;
|
|
598
598
|
}
|
|
599
|
-
n.status =
|
|
599
|
+
n.status = Kt;
|
|
600
600
|
}
|
|
601
|
-
if (n.status ===
|
|
601
|
+
if (n.status === Kt) {
|
|
602
602
|
if (n.gzhead.name) {
|
|
603
603
|
let a = n.pending, i;
|
|
604
604
|
do {
|
|
605
605
|
if (n.pending === n.pending_buf_size) {
|
|
606
|
-
if (n.gzhead.hcrc && n.pending > a && (e.adler = de(e.adler, n.pending_buf, n.pending - a, a)),
|
|
607
|
-
return n.last_flush = -1,
|
|
606
|
+
if (n.gzhead.hcrc && n.pending > a && (e.adler = de(e.adler, n.pending_buf, n.pending - a, a)), V(e), n.pending !== 0)
|
|
607
|
+
return n.last_flush = -1, D;
|
|
608
608
|
a = 0;
|
|
609
609
|
}
|
|
610
|
-
n.gzindex < n.gzhead.name.length ? i = n.gzhead.name.charCodeAt(n.gzindex++) & 255 : i = 0,
|
|
610
|
+
n.gzindex < n.gzhead.name.length ? i = n.gzhead.name.charCodeAt(n.gzindex++) & 255 : i = 0, A(n, i);
|
|
611
611
|
} while (i !== 0);
|
|
612
612
|
n.gzhead.hcrc && n.pending > a && (e.adler = de(e.adler, n.pending_buf, n.pending - a, a)), n.gzindex = 0;
|
|
613
613
|
}
|
|
614
|
-
n.status =
|
|
614
|
+
n.status = Gt;
|
|
615
615
|
}
|
|
616
|
-
if (n.status ===
|
|
616
|
+
if (n.status === Gt) {
|
|
617
617
|
if (n.gzhead.comment) {
|
|
618
618
|
let a = n.pending, i;
|
|
619
619
|
do {
|
|
620
620
|
if (n.pending === n.pending_buf_size) {
|
|
621
|
-
if (n.gzhead.hcrc && n.pending > a && (e.adler = de(e.adler, n.pending_buf, n.pending - a, a)),
|
|
622
|
-
return n.last_flush = -1,
|
|
621
|
+
if (n.gzhead.hcrc && n.pending > a && (e.adler = de(e.adler, n.pending_buf, n.pending - a, a)), V(e), n.pending !== 0)
|
|
622
|
+
return n.last_flush = -1, D;
|
|
623
623
|
a = 0;
|
|
624
624
|
}
|
|
625
|
-
n.gzindex < n.gzhead.comment.length ? i = n.gzhead.comment.charCodeAt(n.gzindex++) & 255 : i = 0,
|
|
625
|
+
n.gzindex < n.gzhead.comment.length ? i = n.gzhead.comment.charCodeAt(n.gzindex++) & 255 : i = 0, A(n, i);
|
|
626
626
|
} while (i !== 0);
|
|
627
627
|
n.gzhead.hcrc && n.pending > a && (e.adler = de(e.adler, n.pending_buf, n.pending - a, a));
|
|
628
628
|
}
|
|
629
|
-
n.status =
|
|
629
|
+
n.status = Xt;
|
|
630
630
|
}
|
|
631
|
-
if (n.status ===
|
|
631
|
+
if (n.status === Xt) {
|
|
632
632
|
if (n.gzhead.hcrc) {
|
|
633
|
-
if (n.pending + 2 > n.pending_buf_size && (
|
|
634
|
-
return n.last_flush = -1,
|
|
635
|
-
|
|
633
|
+
if (n.pending + 2 > n.pending_buf_size && (V(e), n.pending !== 0))
|
|
634
|
+
return n.last_flush = -1, D;
|
|
635
|
+
A(n, e.adler & 255), A(n, e.adler >> 8 & 255), e.adler = 0;
|
|
636
636
|
}
|
|
637
|
-
if (n.status = xe,
|
|
638
|
-
return n.last_flush = -1,
|
|
637
|
+
if (n.status = xe, V(e), n.pending !== 0)
|
|
638
|
+
return n.last_flush = -1, D;
|
|
639
639
|
}
|
|
640
640
|
if (e.avail_in !== 0 || n.lookahead !== 0 || t !== pe && n.status !== Ve) {
|
|
641
|
-
let a = n.level === 0 ?
|
|
642
|
-
if ((a === Se || a === Me) && (n.status = Ve), a ===
|
|
643
|
-
return e.avail_out === 0 && (n.last_flush = -1),
|
|
644
|
-
if (a === je && (t ===
|
|
645
|
-
return n.last_flush = -1,
|
|
646
|
-
}
|
|
647
|
-
return t !==
|
|
648
|
-
},
|
|
649
|
-
if (
|
|
641
|
+
let a = n.level === 0 ? yr(n, t) : n.strategy === _t ? ja(n, t) : n.strategy === wa ? $a(n, t) : He[n.level].func(n, t);
|
|
642
|
+
if ((a === Se || a === Me) && (n.status = Ve), a === j || a === Se)
|
|
643
|
+
return e.avail_out === 0 && (n.last_flush = -1), D;
|
|
644
|
+
if (a === je && (t === ga ? pa(n) : t !== An && (Ht(n, 0, 0, !1), t === ma && (fe(n.head), n.lookahead === 0 && (n.strstart = 0, n.block_start = 0, n.insert = 0))), V(e), e.avail_out === 0))
|
|
645
|
+
return n.last_flush = -1, D;
|
|
646
|
+
}
|
|
647
|
+
return t !== K ? D : n.wrap <= 0 ? On : (n.wrap === 2 ? (A(n, e.adler & 255), A(n, e.adler >> 8 & 255), A(n, e.adler >> 16 & 255), A(n, e.adler >> 24 & 255), A(n, e.total_in & 255), A(n, e.total_in >> 8 & 255), A(n, e.total_in >> 16 & 255), A(n, e.total_in >> 24 & 255)) : (Be(n, e.adler >>> 16), Be(n, e.adler & 65535)), V(e), n.wrap > 0 && (n.wrap = -n.wrap), n.pending !== 0 ? D : On);
|
|
648
|
+
}, Ha = (e) => {
|
|
649
|
+
if (lt(e))
|
|
650
650
|
return ee;
|
|
651
651
|
const t = e.state.status;
|
|
652
|
-
return e.state = null, t === xe ? ke(e,
|
|
653
|
-
},
|
|
652
|
+
return e.state = null, t === xe ? ke(e, ya) : D;
|
|
653
|
+
}, Wa = (e, t) => {
|
|
654
654
|
let n = t.length;
|
|
655
|
-
if (
|
|
655
|
+
if (lt(e))
|
|
656
656
|
return ee;
|
|
657
657
|
const r = e.state, a = r.wrap;
|
|
658
658
|
if (a === 2 || a === 1 && r.status !== Re || r.lookahead)
|
|
659
659
|
return ee;
|
|
660
|
-
if (a === 1 && (e.adler =
|
|
660
|
+
if (a === 1 && (e.adler = pr(e.adler, t, n, 0)), r.wrap = 0, n >= r.w_size) {
|
|
661
661
|
a === 0 && (fe(r.head), r.strstart = 0, r.block_start = 0, r.insert = 0);
|
|
662
662
|
let c = new Uint8Array(r.w_size);
|
|
663
663
|
c.set(t.subarray(n - r.w_size, n), 0), t = c, n = r.w_size;
|
|
664
664
|
}
|
|
665
665
|
const i = e.avail_in, s = e.next_in, o = e.input;
|
|
666
|
-
for (e.avail_in = n, e.next_in = 0, e.input = t,
|
|
666
|
+
for (e.avail_in = n, e.next_in = 0, e.input = t, Ne(r); r.lookahead >= x; ) {
|
|
667
667
|
let c = r.strstart, l = r.lookahead - (x - 1);
|
|
668
668
|
do
|
|
669
669
|
r.ins_h = ge(r, r.ins_h, r.window[c + x - 1]), r.prev[c & r.w_mask] = r.head[r.ins_h], r.head[r.ins_h] = c, c++;
|
|
670
670
|
while (--l);
|
|
671
|
-
r.strstart = c, r.lookahead = x - 1,
|
|
671
|
+
r.strstart = c, r.lookahead = x - 1, Ne(r);
|
|
672
672
|
}
|
|
673
|
-
return r.strstart += r.lookahead, r.block_start = r.strstart, r.insert = r.lookahead, r.lookahead = 0, r.match_length = r.prev_length = x - 1, r.match_available = 0, e.next_in = s, e.input = o, e.avail_in = i, r.wrap = a,
|
|
673
|
+
return r.strstart += r.lookahead, r.block_start = r.strstart, r.insert = r.lookahead, r.lookahead = 0, r.match_length = r.prev_length = x - 1, r.match_available = 0, e.next_in = s, e.input = o, e.avail_in = i, r.wrap = a, D;
|
|
674
674
|
};
|
|
675
|
-
var
|
|
676
|
-
deflateInit:
|
|
677
|
-
deflateInit2:
|
|
678
|
-
deflateReset:
|
|
679
|
-
deflateResetKeep:
|
|
680
|
-
deflateSetHeader:
|
|
681
|
-
deflate:
|
|
682
|
-
deflateEnd:
|
|
683
|
-
deflateSetDictionary:
|
|
684
|
-
deflateInfo:
|
|
675
|
+
var qa = Ba, Ka = wr, Ga = br, Xa = vr, Ya = Pa, Ja = Va, Qa = Ha, ei = Wa, ti = "pako deflate (from Nodeca project)", Xe = {
|
|
676
|
+
deflateInit: qa,
|
|
677
|
+
deflateInit2: Ka,
|
|
678
|
+
deflateReset: Ga,
|
|
679
|
+
deflateResetKeep: Xa,
|
|
680
|
+
deflateSetHeader: Ya,
|
|
681
|
+
deflate: Ja,
|
|
682
|
+
deflateEnd: Qa,
|
|
683
|
+
deflateSetDictionary: ei,
|
|
684
|
+
deflateInfo: ti
|
|
685
685
|
};
|
|
686
|
-
const
|
|
687
|
-
var
|
|
686
|
+
const ni = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
|
|
687
|
+
var ri = function(e) {
|
|
688
688
|
const t = Array.prototype.slice.call(arguments, 1);
|
|
689
689
|
for (; t.length; ) {
|
|
690
690
|
const n = t.shift();
|
|
@@ -692,11 +692,11 @@ var ti = function(e) {
|
|
|
692
692
|
if (typeof n != "object")
|
|
693
693
|
throw new TypeError(n + "must be non-object");
|
|
694
694
|
for (const r in n)
|
|
695
|
-
|
|
695
|
+
ni(n, r) && (e[r] = n[r]);
|
|
696
696
|
}
|
|
697
697
|
}
|
|
698
698
|
return e;
|
|
699
|
-
},
|
|
699
|
+
}, ai = (e) => {
|
|
700
700
|
let t = 0;
|
|
701
701
|
for (let r = 0, a = e.length; r < a; r++)
|
|
702
702
|
t += e[r].length;
|
|
@@ -706,21 +706,21 @@ var ti = function(e) {
|
|
|
706
706
|
n.set(s, a), a += s.length;
|
|
707
707
|
}
|
|
708
708
|
return n;
|
|
709
|
-
},
|
|
710
|
-
assign:
|
|
711
|
-
flattenChunks:
|
|
709
|
+
}, xr = {
|
|
710
|
+
assign: ri,
|
|
711
|
+
flattenChunks: ai
|
|
712
712
|
};
|
|
713
|
-
let
|
|
713
|
+
let kr = !0;
|
|
714
714
|
try {
|
|
715
715
|
String.fromCharCode.apply(null, new Uint8Array(1));
|
|
716
716
|
} catch (e) {
|
|
717
|
-
|
|
717
|
+
kr = !1;
|
|
718
718
|
}
|
|
719
|
-
const
|
|
719
|
+
const tt = new Uint8Array(256);
|
|
720
720
|
for (let e = 0; e < 256; e++)
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
var
|
|
721
|
+
tt[e] = e >= 252 ? 6 : e >= 248 ? 5 : e >= 240 ? 4 : e >= 224 ? 3 : e >= 192 ? 2 : 1;
|
|
722
|
+
tt[254] = tt[254] = 1;
|
|
723
|
+
var ii = (e) => {
|
|
724
724
|
if (typeof TextEncoder == "function" && TextEncoder.prototype.encode)
|
|
725
725
|
return new TextEncoder().encode(e);
|
|
726
726
|
let t, n, r, a, i, s = e.length, o = 0;
|
|
@@ -730,15 +730,15 @@ var ri = (e) => {
|
|
|
730
730
|
n = e.charCodeAt(a), (n & 64512) === 55296 && a + 1 < s && (r = e.charCodeAt(a + 1), (r & 64512) === 56320 && (n = 65536 + (n - 55296 << 10) + (r - 56320), a++)), n < 128 ? t[i++] = n : n < 2048 ? (t[i++] = 192 | n >>> 6, t[i++] = 128 | n & 63) : n < 65536 ? (t[i++] = 224 | n >>> 12, t[i++] = 128 | n >>> 6 & 63, t[i++] = 128 | n & 63) : (t[i++] = 240 | n >>> 18, t[i++] = 128 | n >>> 12 & 63, t[i++] = 128 | n >>> 6 & 63, t[i++] = 128 | n & 63);
|
|
731
731
|
return t;
|
|
732
732
|
};
|
|
733
|
-
const
|
|
734
|
-
if (t < 65534 && e.subarray &&
|
|
733
|
+
const si = (e, t) => {
|
|
734
|
+
if (t < 65534 && e.subarray && kr)
|
|
735
735
|
return String.fromCharCode.apply(null, e.length === t ? e : e.subarray(0, t));
|
|
736
736
|
let n = "";
|
|
737
737
|
for (let r = 0; r < t; r++)
|
|
738
738
|
n += String.fromCharCode(e[r]);
|
|
739
739
|
return n;
|
|
740
740
|
};
|
|
741
|
-
var
|
|
741
|
+
var oi = (e, t) => {
|
|
742
742
|
const n = t || e.length;
|
|
743
743
|
if (typeof TextDecoder == "function" && TextDecoder.prototype.decode)
|
|
744
744
|
return new TextDecoder().decode(e.subarray(0, t));
|
|
@@ -750,7 +750,7 @@ var ii = (e, t) => {
|
|
|
750
750
|
i[a++] = s;
|
|
751
751
|
continue;
|
|
752
752
|
}
|
|
753
|
-
let o =
|
|
753
|
+
let o = tt[s];
|
|
754
754
|
if (o > 4) {
|
|
755
755
|
i[a++] = 65533, r += o - 1;
|
|
756
756
|
continue;
|
|
@@ -763,45 +763,45 @@ var ii = (e, t) => {
|
|
|
763
763
|
}
|
|
764
764
|
s < 65536 ? i[a++] = s : (s -= 65536, i[a++] = 55296 | s >> 10 & 1023, i[a++] = 56320 | s & 1023);
|
|
765
765
|
}
|
|
766
|
-
return
|
|
767
|
-
},
|
|
766
|
+
return si(i, a);
|
|
767
|
+
}, li = (e, t) => {
|
|
768
768
|
t = t || e.length, t > e.length && (t = e.length);
|
|
769
769
|
let n = t - 1;
|
|
770
770
|
for (; n >= 0 && (e[n] & 192) === 128; )
|
|
771
771
|
n--;
|
|
772
|
-
return n < 0 || n === 0 ? t : n +
|
|
773
|
-
},
|
|
774
|
-
string2buf:
|
|
775
|
-
buf2string:
|
|
776
|
-
utf8border:
|
|
772
|
+
return n < 0 || n === 0 ? t : n + tt[e[n]] > t ? n : t;
|
|
773
|
+
}, Sr = {
|
|
774
|
+
string2buf: ii,
|
|
775
|
+
buf2string: oi,
|
|
776
|
+
utf8border: li
|
|
777
777
|
};
|
|
778
|
-
function
|
|
778
|
+
function ci() {
|
|
779
779
|
this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0;
|
|
780
780
|
}
|
|
781
|
-
var
|
|
782
|
-
const
|
|
783
|
-
Z_NO_FLUSH:
|
|
784
|
-
Z_SYNC_FLUSH:
|
|
785
|
-
Z_FULL_FLUSH:
|
|
786
|
-
Z_FINISH:
|
|
787
|
-
Z_OK:
|
|
788
|
-
Z_STREAM_END:
|
|
789
|
-
Z_DEFAULT_COMPRESSION:
|
|
790
|
-
Z_DEFAULT_STRATEGY:
|
|
791
|
-
Z_DEFLATED:
|
|
792
|
-
} =
|
|
793
|
-
function
|
|
794
|
-
this.options =
|
|
795
|
-
level:
|
|
796
|
-
method:
|
|
781
|
+
var di = ci;
|
|
782
|
+
const Tr = Object.prototype.toString, {
|
|
783
|
+
Z_NO_FLUSH: ui,
|
|
784
|
+
Z_SYNC_FLUSH: fi,
|
|
785
|
+
Z_FULL_FLUSH: hi,
|
|
786
|
+
Z_FINISH: _i,
|
|
787
|
+
Z_OK: kt,
|
|
788
|
+
Z_STREAM_END: pi,
|
|
789
|
+
Z_DEFAULT_COMPRESSION: gi,
|
|
790
|
+
Z_DEFAULT_STRATEGY: mi,
|
|
791
|
+
Z_DEFLATED: yi
|
|
792
|
+
} = gr;
|
|
793
|
+
function Nt(e) {
|
|
794
|
+
this.options = xr.assign({
|
|
795
|
+
level: gi,
|
|
796
|
+
method: yi,
|
|
797
797
|
chunkSize: 16384,
|
|
798
798
|
windowBits: 15,
|
|
799
799
|
memLevel: 8,
|
|
800
|
-
strategy:
|
|
800
|
+
strategy: mi
|
|
801
801
|
}, e || {});
|
|
802
802
|
let t = this.options;
|
|
803
|
-
t.raw && t.windowBits > 0 ? t.windowBits = -t.windowBits : t.gzip && t.windowBits > 0 && t.windowBits < 16 && (t.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new
|
|
804
|
-
let n =
|
|
803
|
+
t.raw && t.windowBits > 0 ? t.windowBits = -t.windowBits : t.gzip && t.windowBits > 0 && t.windowBits < 16 && (t.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new di(), this.strm.avail_out = 0;
|
|
804
|
+
let n = Xe.deflateInit2(
|
|
805
805
|
this.strm,
|
|
806
806
|
t.level,
|
|
807
807
|
t.method,
|
|
@@ -809,27 +809,27 @@ function Rt(e) {
|
|
|
809
809
|
t.memLevel,
|
|
810
810
|
t.strategy
|
|
811
811
|
);
|
|
812
|
-
if (n !==
|
|
813
|
-
throw new Error(
|
|
814
|
-
if (t.header &&
|
|
812
|
+
if (n !== kt)
|
|
813
|
+
throw new Error(xt[n]);
|
|
814
|
+
if (t.header && Xe.deflateSetHeader(this.strm, t.header), t.dictionary) {
|
|
815
815
|
let r;
|
|
816
|
-
if (typeof t.dictionary == "string" ? r =
|
|
817
|
-
throw new Error(
|
|
816
|
+
if (typeof t.dictionary == "string" ? r = Sr.string2buf(t.dictionary) : Tr.call(t.dictionary) === "[object ArrayBuffer]" ? r = new Uint8Array(t.dictionary) : r = t.dictionary, n = Xe.deflateSetDictionary(this.strm, r), n !== kt)
|
|
817
|
+
throw new Error(xt[n]);
|
|
818
818
|
this._dict_set = !0;
|
|
819
819
|
}
|
|
820
820
|
}
|
|
821
|
-
|
|
821
|
+
Nt.prototype.push = function(e, t) {
|
|
822
822
|
const n = this.strm, r = this.options.chunkSize;
|
|
823
823
|
let a, i;
|
|
824
824
|
if (this.ended)
|
|
825
825
|
return !1;
|
|
826
|
-
for (t === ~~t ? i = t : i = t === !0 ?
|
|
827
|
-
if (n.avail_out === 0 && (n.output = new Uint8Array(r), n.next_out = 0, n.avail_out = r), (i ===
|
|
826
|
+
for (t === ~~t ? i = t : i = t === !0 ? _i : ui, typeof e == "string" ? n.input = Sr.string2buf(e) : Tr.call(e) === "[object ArrayBuffer]" ? n.input = new Uint8Array(e) : n.input = e, n.next_in = 0, n.avail_in = n.input.length; ; ) {
|
|
827
|
+
if (n.avail_out === 0 && (n.output = new Uint8Array(r), n.next_out = 0, n.avail_out = r), (i === fi || i === hi) && n.avail_out <= 6) {
|
|
828
828
|
this.onData(n.output.subarray(0, n.next_out)), n.avail_out = 0;
|
|
829
829
|
continue;
|
|
830
830
|
}
|
|
831
|
-
if (a =
|
|
832
|
-
return n.next_out > 0 && this.onData(n.output.subarray(0, n.next_out)), a =
|
|
831
|
+
if (a = Xe.deflate(n, i), a === pi)
|
|
832
|
+
return n.next_out > 0 && this.onData(n.output.subarray(0, n.next_out)), a = Xe.deflateEnd(this.strm), this.onEnd(a), this.ended = !0, a === kt;
|
|
833
833
|
if (n.avail_out === 0) {
|
|
834
834
|
this.onData(n.output);
|
|
835
835
|
continue;
|
|
@@ -842,26 +842,26 @@ Rt.prototype.push = function(e, t) {
|
|
|
842
842
|
}
|
|
843
843
|
return !0;
|
|
844
844
|
};
|
|
845
|
-
|
|
845
|
+
Nt.prototype.onData = function(e) {
|
|
846
846
|
this.chunks.push(e);
|
|
847
847
|
};
|
|
848
|
-
|
|
849
|
-
e ===
|
|
848
|
+
Nt.prototype.onEnd = function(e) {
|
|
849
|
+
e === kt && (this.result = xr.flattenChunks(this.chunks)), this.chunks = [], this.err = e, this.msg = this.strm.msg;
|
|
850
850
|
};
|
|
851
|
-
function
|
|
852
|
-
const n = new
|
|
851
|
+
function vi(e, t) {
|
|
852
|
+
const n = new Nt(t);
|
|
853
853
|
if (n.push(e, !0), n.err)
|
|
854
|
-
throw n.msg ||
|
|
854
|
+
throw n.msg || xt[n.err];
|
|
855
855
|
return n.result;
|
|
856
856
|
}
|
|
857
|
-
function
|
|
858
|
-
return t = t || {}, t.gzip = !0,
|
|
857
|
+
function bi(e, t) {
|
|
858
|
+
return t = t || {}, t.gzip = !0, vi(e, t);
|
|
859
859
|
}
|
|
860
|
-
var
|
|
861
|
-
gzip:
|
|
860
|
+
var wi = bi, xi = {
|
|
861
|
+
gzip: wi
|
|
862
862
|
};
|
|
863
|
-
const { gzip:
|
|
864
|
-
var
|
|
863
|
+
const { gzip: ki } = xi;
|
|
864
|
+
var Si = ki;
|
|
865
865
|
class be extends Error {
|
|
866
866
|
constructor({
|
|
867
867
|
name: t,
|
|
@@ -872,48 +872,57 @@ class be extends Error {
|
|
|
872
872
|
super(), this.name = t, this.message = n, this.detail = a, this.status = r;
|
|
873
873
|
}
|
|
874
874
|
}
|
|
875
|
-
class
|
|
875
|
+
class Ti extends Error {
|
|
876
876
|
constructor() {
|
|
877
|
-
super("
|
|
877
|
+
super("Malformatted Figma Token");
|
|
878
878
|
}
|
|
879
879
|
}
|
|
880
|
-
class
|
|
880
|
+
class Ei extends Error {
|
|
881
881
|
constructor() {
|
|
882
882
|
super("Missing Figma Token");
|
|
883
883
|
}
|
|
884
884
|
}
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
super(kr), this.cause = t;
|
|
885
|
+
class Rn extends Error {
|
|
886
|
+
constructor() {
|
|
887
|
+
super("Needs Reauth Figma Token");
|
|
889
888
|
}
|
|
890
889
|
}
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
super(Sr), this.cause = t;
|
|
890
|
+
class Nn extends Error {
|
|
891
|
+
constructor() {
|
|
892
|
+
super("Expired Figma Token");
|
|
895
893
|
}
|
|
896
894
|
}
|
|
897
|
-
|
|
898
|
-
|
|
895
|
+
class In extends Error {
|
|
896
|
+
constructor({ reason: t }) {
|
|
897
|
+
super("Unknown Forbidden Figma Error"), this.reason = t;
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
const Er = "Not Found";
|
|
901
|
+
class Ai extends Error {
|
|
899
902
|
constructor({ cause: t }) {
|
|
900
|
-
super(
|
|
903
|
+
super(Er), this.cause = t;
|
|
901
904
|
}
|
|
902
905
|
}
|
|
903
|
-
const
|
|
904
|
-
class
|
|
906
|
+
const Hs = (e) => e.message === Er, Ar = "Unknown Figma API Exception";
|
|
907
|
+
class Oi extends Error {
|
|
905
908
|
constructor({ cause: t }) {
|
|
906
909
|
super(Ar), this.cause = t;
|
|
907
910
|
}
|
|
908
911
|
}
|
|
909
|
-
const
|
|
910
|
-
class
|
|
912
|
+
const Ws = (e) => e.message === Ar, Or = "Rate Limit Exceeded";
|
|
913
|
+
class Zn extends Error {
|
|
911
914
|
constructor({ cause: t }) {
|
|
912
|
-
super(
|
|
915
|
+
super(Or), this.cause = t;
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
const qs = (e) => e.message === Or, Cr = "Request Too Large";
|
|
919
|
+
class Ci extends Error {
|
|
920
|
+
constructor({ cause: t }) {
|
|
921
|
+
super(Cr), this.cause = t;
|
|
913
922
|
}
|
|
914
923
|
}
|
|
915
|
-
const
|
|
916
|
-
var
|
|
924
|
+
const Ks = (e) => e.message === Cr;
|
|
925
|
+
var E;
|
|
917
926
|
(function(e) {
|
|
918
927
|
e.assertEqual = (a) => {
|
|
919
928
|
};
|
|
@@ -949,12 +958,12 @@ var A;
|
|
|
949
958
|
return a.map((s) => typeof s == "string" ? `'${s}'` : s).join(i);
|
|
950
959
|
}
|
|
951
960
|
e.joinValues = r, e.jsonStringifyReplacer = (a, i) => typeof i == "bigint" ? i.toString() : i;
|
|
952
|
-
})(
|
|
953
|
-
var
|
|
961
|
+
})(E || (E = {}));
|
|
962
|
+
var zn;
|
|
954
963
|
(function(e) {
|
|
955
964
|
e.mergeShapes = (t, n) => d(d({}, t), n);
|
|
956
|
-
})(
|
|
957
|
-
const _ =
|
|
965
|
+
})(zn || (zn = {}));
|
|
966
|
+
const _ = E.arrayToEnum([
|
|
958
967
|
"string",
|
|
959
968
|
"nan",
|
|
960
969
|
"number",
|
|
@@ -996,7 +1005,7 @@ const _ = A.arrayToEnum([
|
|
|
996
1005
|
default:
|
|
997
1006
|
return _.unknown;
|
|
998
1007
|
}
|
|
999
|
-
}, u =
|
|
1008
|
+
}, u = E.arrayToEnum([
|
|
1000
1009
|
"invalid_type",
|
|
1001
1010
|
"invalid_literal",
|
|
1002
1011
|
"custom",
|
|
@@ -1058,7 +1067,7 @@ class ce extends Error {
|
|
|
1058
1067
|
return this.message;
|
|
1059
1068
|
}
|
|
1060
1069
|
get message() {
|
|
1061
|
-
return JSON.stringify(this.issues,
|
|
1070
|
+
return JSON.stringify(this.issues, E.jsonStringifyReplacer, 2);
|
|
1062
1071
|
}
|
|
1063
1072
|
get isEmpty() {
|
|
1064
1073
|
return this.issues.length === 0;
|
|
@@ -1078,26 +1087,26 @@ class ce extends Error {
|
|
|
1078
1087
|
}
|
|
1079
1088
|
}
|
|
1080
1089
|
ce.create = (e) => new ce(e);
|
|
1081
|
-
const
|
|
1090
|
+
const Jt = (e, t) => {
|
|
1082
1091
|
let n;
|
|
1083
1092
|
switch (e.code) {
|
|
1084
1093
|
case u.invalid_type:
|
|
1085
1094
|
e.received === _.undefined ? n = "Required" : n = `Expected ${e.expected}, received ${e.received}`;
|
|
1086
1095
|
break;
|
|
1087
1096
|
case u.invalid_literal:
|
|
1088
|
-
n = `Invalid literal value, expected ${JSON.stringify(e.expected,
|
|
1097
|
+
n = `Invalid literal value, expected ${JSON.stringify(e.expected, E.jsonStringifyReplacer)}`;
|
|
1089
1098
|
break;
|
|
1090
1099
|
case u.unrecognized_keys:
|
|
1091
|
-
n = `Unrecognized key(s) in object: ${
|
|
1100
|
+
n = `Unrecognized key(s) in object: ${E.joinValues(e.keys, ", ")}`;
|
|
1092
1101
|
break;
|
|
1093
1102
|
case u.invalid_union:
|
|
1094
1103
|
n = "Invalid input";
|
|
1095
1104
|
break;
|
|
1096
1105
|
case u.invalid_union_discriminator:
|
|
1097
|
-
n = `Invalid discriminator value. Expected ${
|
|
1106
|
+
n = `Invalid discriminator value. Expected ${E.joinValues(e.options)}`;
|
|
1098
1107
|
break;
|
|
1099
1108
|
case u.invalid_enum_value:
|
|
1100
|
-
n = `Invalid enum value. Expected ${
|
|
1109
|
+
n = `Invalid enum value. Expected ${E.joinValues(e.options)}, received '${e.received}'`;
|
|
1101
1110
|
break;
|
|
1102
1111
|
case u.invalid_arguments:
|
|
1103
1112
|
n = "Invalid function arguments";
|
|
@@ -1109,7 +1118,7 @@ const Yt = (e, t) => {
|
|
|
1109
1118
|
n = "Invalid date";
|
|
1110
1119
|
break;
|
|
1111
1120
|
case u.invalid_string:
|
|
1112
|
-
typeof e.validation == "object" ? "includes" in e.validation ? (n = `Invalid input: must include "${e.validation.includes}"`, typeof e.validation.position == "number" && (n = `${n} at one or more positions greater than or equal to ${e.validation.position}`)) : "startsWith" in e.validation ? n = `Invalid input: must start with "${e.validation.startsWith}"` : "endsWith" in e.validation ? n = `Invalid input: must end with "${e.validation.endsWith}"` :
|
|
1121
|
+
typeof e.validation == "object" ? "includes" in e.validation ? (n = `Invalid input: must include "${e.validation.includes}"`, typeof e.validation.position == "number" && (n = `${n} at one or more positions greater than or equal to ${e.validation.position}`)) : "startsWith" in e.validation ? n = `Invalid input: must start with "${e.validation.startsWith}"` : "endsWith" in e.validation ? n = `Invalid input: must end with "${e.validation.endsWith}"` : E.assertNever(e.validation) : e.validation !== "regex" ? n = `Invalid ${e.validation}` : n = "Invalid";
|
|
1113
1122
|
break;
|
|
1114
1123
|
case u.too_small:
|
|
1115
1124
|
e.type === "array" ? n = `Array must contain ${e.exact ? "exactly" : e.inclusive ? "at least" : "more than"} ${e.minimum} element(s)` : e.type === "string" ? n = `String must contain ${e.exact ? "exactly" : e.inclusive ? "at least" : "over"} ${e.minimum} character(s)` : e.type === "number" ? n = `Number must be ${e.exact ? "exactly equal to " : e.inclusive ? "greater than or equal to " : "greater than "}${e.minimum}` : e.type === "bigint" ? n = `Number must be ${e.exact ? "exactly equal to " : e.inclusive ? "greater than or equal to " : "greater than "}${e.minimum}` : e.type === "date" ? n = `Date must be ${e.exact ? "exactly equal to " : e.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(e.minimum))}` : n = "Invalid input";
|
|
@@ -1130,15 +1139,15 @@ const Yt = (e, t) => {
|
|
|
1130
1139
|
n = "Number must be finite";
|
|
1131
1140
|
break;
|
|
1132
1141
|
default:
|
|
1133
|
-
n = t.defaultError,
|
|
1142
|
+
n = t.defaultError, E.assertNever(e);
|
|
1134
1143
|
}
|
|
1135
1144
|
return { message: n };
|
|
1136
1145
|
};
|
|
1137
|
-
let
|
|
1138
|
-
function
|
|
1139
|
-
return
|
|
1146
|
+
let Ri = Jt;
|
|
1147
|
+
function Ni() {
|
|
1148
|
+
return Ri;
|
|
1140
1149
|
}
|
|
1141
|
-
const
|
|
1150
|
+
const Ii = (e) => {
|
|
1142
1151
|
const { data: t, path: n, errorMaps: r, issueData: a } = e, i = [...n, ...a.path || []], s = v(d({}, a), {
|
|
1143
1152
|
path: i
|
|
1144
1153
|
});
|
|
@@ -1157,7 +1166,7 @@ const Li = (e) => {
|
|
|
1157
1166
|
});
|
|
1158
1167
|
};
|
|
1159
1168
|
function f(e, t) {
|
|
1160
|
-
const n =
|
|
1169
|
+
const n = Ni(), r = Ii({
|
|
1161
1170
|
issueData: t,
|
|
1162
1171
|
data: e.data,
|
|
1163
1172
|
path: e.path,
|
|
@@ -1168,13 +1177,13 @@ function f(e, t) {
|
|
|
1168
1177
|
// then schema-bound map if available
|
|
1169
1178
|
n,
|
|
1170
1179
|
// then global override map
|
|
1171
|
-
n ===
|
|
1180
|
+
n === Jt ? void 0 : Jt
|
|
1172
1181
|
// then global default map
|
|
1173
1182
|
].filter((a) => !!a)
|
|
1174
1183
|
});
|
|
1175
1184
|
e.common.issues.push(r);
|
|
1176
1185
|
}
|
|
1177
|
-
class
|
|
1186
|
+
class M {
|
|
1178
1187
|
constructor() {
|
|
1179
1188
|
this.value = "valid";
|
|
1180
1189
|
}
|
|
@@ -1203,7 +1212,7 @@ class j {
|
|
|
1203
1212
|
value: s
|
|
1204
1213
|
});
|
|
1205
1214
|
}
|
|
1206
|
-
return
|
|
1215
|
+
return M.mergeObjectSync(t, r);
|
|
1207
1216
|
});
|
|
1208
1217
|
}
|
|
1209
1218
|
static mergeObjectSync(t, n) {
|
|
@@ -1219,7 +1228,7 @@ class j {
|
|
|
1219
1228
|
}
|
|
1220
1229
|
const m = Object.freeze({
|
|
1221
1230
|
status: "aborted"
|
|
1222
|
-
}), We = (e) => ({ status: "dirty", value: e }),
|
|
1231
|
+
}), We = (e) => ({ status: "dirty", value: e }), G = (e) => ({ status: "valid", value: e }), Dn = (e) => e.status === "aborted", Ln = (e) => e.status === "dirty", Ie = (e) => e.status === "valid", St = (e) => typeof Promise != "undefined" && e instanceof Promise;
|
|
1223
1232
|
var p;
|
|
1224
1233
|
(function(e) {
|
|
1225
1234
|
e.errToObj = (t) => typeof t == "string" ? { message: t } : t || {}, e.toString = (t) => typeof t == "string" ? t : t == null ? void 0 : t.message;
|
|
@@ -1232,8 +1241,8 @@ class re {
|
|
|
1232
1241
|
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
1233
1242
|
}
|
|
1234
1243
|
}
|
|
1235
|
-
const
|
|
1236
|
-
if (
|
|
1244
|
+
const Fn = (e, t) => {
|
|
1245
|
+
if (Ie(t))
|
|
1237
1246
|
return { success: !0, data: t.value };
|
|
1238
1247
|
if (!e.common.issues.length)
|
|
1239
1248
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -1278,7 +1287,7 @@ class k {
|
|
|
1278
1287
|
}
|
|
1279
1288
|
_processInputParams(t) {
|
|
1280
1289
|
return {
|
|
1281
|
-
status: new
|
|
1290
|
+
status: new M(),
|
|
1282
1291
|
ctx: {
|
|
1283
1292
|
common: t.parent.common,
|
|
1284
1293
|
data: t.data,
|
|
@@ -1291,7 +1300,7 @@ class k {
|
|
|
1291
1300
|
}
|
|
1292
1301
|
_parseSync(t) {
|
|
1293
1302
|
const n = this._parse(t);
|
|
1294
|
-
if (
|
|
1303
|
+
if (St(n))
|
|
1295
1304
|
throw new Error("Synchronous parse encountered promise.");
|
|
1296
1305
|
return n;
|
|
1297
1306
|
}
|
|
@@ -1319,7 +1328,7 @@ class k {
|
|
|
1319
1328
|
data: t,
|
|
1320
1329
|
parsedType: ue(t)
|
|
1321
1330
|
}, a = this._parseSync({ data: t, path: r.path, parent: r });
|
|
1322
|
-
return
|
|
1331
|
+
return Fn(r, a);
|
|
1323
1332
|
}
|
|
1324
1333
|
"~validate"(t) {
|
|
1325
1334
|
var r, a;
|
|
@@ -1337,7 +1346,7 @@ class k {
|
|
|
1337
1346
|
if (!this["~standard"].async)
|
|
1338
1347
|
try {
|
|
1339
1348
|
const i = this._parseSync({ data: t, path: [], parent: n });
|
|
1340
|
-
return
|
|
1349
|
+
return Ie(i) ? {
|
|
1341
1350
|
value: i.value
|
|
1342
1351
|
} : {
|
|
1343
1352
|
issues: n.common.issues
|
|
@@ -1348,7 +1357,7 @@ class k {
|
|
|
1348
1357
|
async: !0
|
|
1349
1358
|
};
|
|
1350
1359
|
}
|
|
1351
|
-
return this._parseAsync({ data: t, path: [], parent: n }).then((i) =>
|
|
1360
|
+
return this._parseAsync({ data: t, path: [], parent: n }).then((i) => Ie(i) ? {
|
|
1352
1361
|
value: i.value
|
|
1353
1362
|
} : {
|
|
1354
1363
|
issues: n.common.issues
|
|
@@ -1375,8 +1384,8 @@ class k {
|
|
|
1375
1384
|
parent: null,
|
|
1376
1385
|
data: t,
|
|
1377
1386
|
parsedType: ue(t)
|
|
1378
|
-
}, a = this._parse({ data: t, path: r.path, parent: r }), i = yield
|
|
1379
|
-
return
|
|
1387
|
+
}, a = this._parse({ data: t, path: r.path, parent: r }), i = yield St(a) ? a : Promise.resolve(a);
|
|
1388
|
+
return Fn(r, i);
|
|
1380
1389
|
});
|
|
1381
1390
|
}
|
|
1382
1391
|
refine(t, n) {
|
|
@@ -1392,7 +1401,7 @@ class k {
|
|
|
1392
1401
|
return this._refinement((r, a) => t(r) ? !0 : (a.addIssue(typeof n == "function" ? n(r, a) : n), !1));
|
|
1393
1402
|
}
|
|
1394
1403
|
_refinement(t) {
|
|
1395
|
-
return new
|
|
1404
|
+
return new De({
|
|
1396
1405
|
schema: this,
|
|
1397
1406
|
typeName: g.ZodEffects,
|
|
1398
1407
|
effect: { type: "refinement", refinement: t }
|
|
@@ -1412,7 +1421,7 @@ class k {
|
|
|
1412
1421
|
return me.create(this, this._def);
|
|
1413
1422
|
}
|
|
1414
1423
|
nullable() {
|
|
1415
|
-
return
|
|
1424
|
+
return Le.create(this, this._def);
|
|
1416
1425
|
}
|
|
1417
1426
|
nullish() {
|
|
1418
1427
|
return this.nullable().optional();
|
|
@@ -1421,16 +1430,16 @@ class k {
|
|
|
1421
1430
|
return ne.create(this);
|
|
1422
1431
|
}
|
|
1423
1432
|
promise() {
|
|
1424
|
-
return
|
|
1433
|
+
return Ct.create(this, this._def);
|
|
1425
1434
|
}
|
|
1426
1435
|
or(t) {
|
|
1427
|
-
return
|
|
1436
|
+
return Et.create([this, t], this._def);
|
|
1428
1437
|
}
|
|
1429
1438
|
and(t) {
|
|
1430
1439
|
return At.create(this, t, this._def);
|
|
1431
1440
|
}
|
|
1432
1441
|
transform(t) {
|
|
1433
|
-
return new
|
|
1442
|
+
return new De(v(d({}, b(this._def)), {
|
|
1434
1443
|
schema: this,
|
|
1435
1444
|
typeName: g.ZodEffects,
|
|
1436
1445
|
effect: { type: "transform", transform: t }
|
|
@@ -1438,21 +1447,21 @@ class k {
|
|
|
1438
1447
|
}
|
|
1439
1448
|
default(t) {
|
|
1440
1449
|
const n = typeof t == "function" ? t : () => t;
|
|
1441
|
-
return new
|
|
1450
|
+
return new rn(v(d({}, b(this._def)), {
|
|
1442
1451
|
innerType: this,
|
|
1443
1452
|
defaultValue: n,
|
|
1444
1453
|
typeName: g.ZodDefault
|
|
1445
1454
|
}));
|
|
1446
1455
|
}
|
|
1447
1456
|
brand() {
|
|
1448
|
-
return new
|
|
1457
|
+
return new ts(d({
|
|
1449
1458
|
typeName: g.ZodBranded,
|
|
1450
1459
|
type: this
|
|
1451
1460
|
}, b(this._def)));
|
|
1452
1461
|
}
|
|
1453
1462
|
catch(t) {
|
|
1454
1463
|
const n = typeof t == "function" ? t : () => t;
|
|
1455
|
-
return new
|
|
1464
|
+
return new an(v(d({}, b(this._def)), {
|
|
1456
1465
|
innerType: this,
|
|
1457
1466
|
catchValue: n,
|
|
1458
1467
|
typeName: g.ZodCatch
|
|
@@ -1468,7 +1477,7 @@ class k {
|
|
|
1468
1477
|
return gn.create(this, t);
|
|
1469
1478
|
}
|
|
1470
1479
|
readonly() {
|
|
1471
|
-
return
|
|
1480
|
+
return sn.create(this);
|
|
1472
1481
|
}
|
|
1473
1482
|
isOptional() {
|
|
1474
1483
|
return this.safeParse(void 0).success;
|
|
@@ -1477,28 +1486,28 @@ class k {
|
|
|
1477
1486
|
return this.safeParse(null).success;
|
|
1478
1487
|
}
|
|
1479
1488
|
}
|
|
1480
|
-
const
|
|
1481
|
-
let
|
|
1482
|
-
const
|
|
1483
|
-
function
|
|
1489
|
+
const Zi = /^c[^\s-]{8,}$/i, zi = /^[0-9a-z]+$/, Di = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Li = /^[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, Fi = /^[a-z0-9_-]{21}$/i, $i = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, ji = /^[-+]?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)?)??$/, Mi = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ui = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
1490
|
+
let Ut;
|
|
1491
|
+
const Pi = /^(?:(?: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])$/, Bi = /^(?:(?: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])$/, 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]))$/, Hi = /^(([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])$/, Wi = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, qi = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Rr = "((\\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(`^${Rr}$`);
|
|
1492
|
+
function Nr(e) {
|
|
1484
1493
|
let t = "[0-5]\\d";
|
|
1485
1494
|
e.precision ? t = `${t}\\.\\d{${e.precision}}` : e.precision == null && (t = `${t}(\\.\\d+)?`);
|
|
1486
1495
|
const n = e.precision ? "+" : "?";
|
|
1487
1496
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`;
|
|
1488
1497
|
}
|
|
1489
|
-
function
|
|
1490
|
-
return new RegExp(`^${
|
|
1498
|
+
function Gi(e) {
|
|
1499
|
+
return new RegExp(`^${Nr(e)}$`);
|
|
1491
1500
|
}
|
|
1492
|
-
function
|
|
1493
|
-
let t = `${
|
|
1501
|
+
function Xi(e) {
|
|
1502
|
+
let t = `${Rr}T${Nr(e)}`;
|
|
1494
1503
|
const n = [];
|
|
1495
1504
|
return n.push(e.local ? "Z?" : "Z"), e.offset && n.push("([+-]\\d{2}:?\\d{2})"), t = `${t}(${n.join("|")})`, new RegExp(`^${t}$`);
|
|
1496
1505
|
}
|
|
1497
|
-
function
|
|
1498
|
-
return !!((t === "v4" || !t) &&
|
|
1506
|
+
function Yi(e, t) {
|
|
1507
|
+
return !!((t === "v4" || !t) && Pi.test(e) || (t === "v6" || !t) && Vi.test(e));
|
|
1499
1508
|
}
|
|
1500
|
-
function
|
|
1501
|
-
if (
|
|
1509
|
+
function Ji(e, t) {
|
|
1510
|
+
if (!$i.test(e))
|
|
1502
1511
|
return !1;
|
|
1503
1512
|
try {
|
|
1504
1513
|
const [n] = e.split(".");
|
|
@@ -1510,8 +1519,8 @@ function ts(e, t) {
|
|
|
1510
1519
|
return !1;
|
|
1511
1520
|
}
|
|
1512
1521
|
}
|
|
1513
|
-
function
|
|
1514
|
-
return !!((t === "v4" || !t) &&
|
|
1522
|
+
function Qi(e, t) {
|
|
1523
|
+
return !!((t === "v4" || !t) && Bi.test(e) || (t === "v6" || !t) && Hi.test(e));
|
|
1515
1524
|
}
|
|
1516
1525
|
class oe extends k {
|
|
1517
1526
|
_parse(t) {
|
|
@@ -1523,7 +1532,7 @@ class oe extends k {
|
|
|
1523
1532
|
received: i.parsedType
|
|
1524
1533
|
}), m;
|
|
1525
1534
|
}
|
|
1526
|
-
const r = new
|
|
1535
|
+
const r = new M();
|
|
1527
1536
|
let a;
|
|
1528
1537
|
for (const i of this._def.checks)
|
|
1529
1538
|
if (i.kind === "min")
|
|
@@ -1562,43 +1571,43 @@ class oe extends k {
|
|
|
1562
1571
|
message: i.message
|
|
1563
1572
|
}), r.dirty());
|
|
1564
1573
|
} else if (i.kind === "email")
|
|
1565
|
-
|
|
1574
|
+
Mi.test(t.data) || (a = this._getOrReturnCtx(t, a), f(a, {
|
|
1566
1575
|
validation: "email",
|
|
1567
1576
|
code: u.invalid_string,
|
|
1568
1577
|
message: i.message
|
|
1569
1578
|
}), r.dirty());
|
|
1570
1579
|
else if (i.kind === "emoji")
|
|
1571
|
-
|
|
1580
|
+
Ut || (Ut = new RegExp(Ui, "u")), Ut.test(t.data) || (a = this._getOrReturnCtx(t, a), f(a, {
|
|
1572
1581
|
validation: "emoji",
|
|
1573
1582
|
code: u.invalid_string,
|
|
1574
1583
|
message: i.message
|
|
1575
1584
|
}), r.dirty());
|
|
1576
1585
|
else if (i.kind === "uuid")
|
|
1577
|
-
|
|
1586
|
+
Li.test(t.data) || (a = this._getOrReturnCtx(t, a), f(a, {
|
|
1578
1587
|
validation: "uuid",
|
|
1579
1588
|
code: u.invalid_string,
|
|
1580
1589
|
message: i.message
|
|
1581
1590
|
}), r.dirty());
|
|
1582
1591
|
else if (i.kind === "nanoid")
|
|
1583
|
-
|
|
1592
|
+
Fi.test(t.data) || (a = this._getOrReturnCtx(t, a), f(a, {
|
|
1584
1593
|
validation: "nanoid",
|
|
1585
1594
|
code: u.invalid_string,
|
|
1586
1595
|
message: i.message
|
|
1587
1596
|
}), r.dirty());
|
|
1588
1597
|
else if (i.kind === "cuid")
|
|
1589
|
-
|
|
1598
|
+
Zi.test(t.data) || (a = this._getOrReturnCtx(t, a), f(a, {
|
|
1590
1599
|
validation: "cuid",
|
|
1591
1600
|
code: u.invalid_string,
|
|
1592
1601
|
message: i.message
|
|
1593
1602
|
}), r.dirty());
|
|
1594
1603
|
else if (i.kind === "cuid2")
|
|
1595
|
-
|
|
1604
|
+
zi.test(t.data) || (a = this._getOrReturnCtx(t, a), f(a, {
|
|
1596
1605
|
validation: "cuid2",
|
|
1597
1606
|
code: u.invalid_string,
|
|
1598
1607
|
message: i.message
|
|
1599
1608
|
}), r.dirty());
|
|
1600
1609
|
else if (i.kind === "ulid")
|
|
1601
|
-
|
|
1610
|
+
Di.test(t.data) || (a = this._getOrReturnCtx(t, a), f(a, {
|
|
1602
1611
|
validation: "ulid",
|
|
1603
1612
|
code: u.invalid_string,
|
|
1604
1613
|
message: i.message
|
|
@@ -1629,43 +1638,43 @@ class oe extends k {
|
|
|
1629
1638
|
code: u.invalid_string,
|
|
1630
1639
|
validation: { endsWith: i.value },
|
|
1631
1640
|
message: i.message
|
|
1632
|
-
}), r.dirty()) : i.kind === "datetime" ?
|
|
1641
|
+
}), r.dirty()) : i.kind === "datetime" ? Xi(i).test(t.data) || (a = this._getOrReturnCtx(t, a), f(a, {
|
|
1633
1642
|
code: u.invalid_string,
|
|
1634
1643
|
validation: "datetime",
|
|
1635
1644
|
message: i.message
|
|
1636
|
-
}), r.dirty()) : i.kind === "date" ?
|
|
1645
|
+
}), r.dirty()) : i.kind === "date" ? Ki.test(t.data) || (a = this._getOrReturnCtx(t, a), f(a, {
|
|
1637
1646
|
code: u.invalid_string,
|
|
1638
1647
|
validation: "date",
|
|
1639
1648
|
message: i.message
|
|
1640
|
-
}), r.dirty()) : i.kind === "time" ?
|
|
1649
|
+
}), r.dirty()) : i.kind === "time" ? Gi(i).test(t.data) || (a = this._getOrReturnCtx(t, a), f(a, {
|
|
1641
1650
|
code: u.invalid_string,
|
|
1642
1651
|
validation: "time",
|
|
1643
1652
|
message: i.message
|
|
1644
|
-
}), r.dirty()) : i.kind === "duration" ?
|
|
1653
|
+
}), r.dirty()) : i.kind === "duration" ? ji.test(t.data) || (a = this._getOrReturnCtx(t, a), f(a, {
|
|
1645
1654
|
validation: "duration",
|
|
1646
1655
|
code: u.invalid_string,
|
|
1647
1656
|
message: i.message
|
|
1648
|
-
}), r.dirty()) : i.kind === "ip" ?
|
|
1657
|
+
}), r.dirty()) : i.kind === "ip" ? Yi(t.data, i.version) || (a = this._getOrReturnCtx(t, a), f(a, {
|
|
1649
1658
|
validation: "ip",
|
|
1650
1659
|
code: u.invalid_string,
|
|
1651
1660
|
message: i.message
|
|
1652
|
-
}), r.dirty()) : i.kind === "jwt" ?
|
|
1661
|
+
}), r.dirty()) : i.kind === "jwt" ? Ji(t.data, i.alg) || (a = this._getOrReturnCtx(t, a), f(a, {
|
|
1653
1662
|
validation: "jwt",
|
|
1654
1663
|
code: u.invalid_string,
|
|
1655
1664
|
message: i.message
|
|
1656
|
-
}), r.dirty()) : i.kind === "cidr" ?
|
|
1665
|
+
}), r.dirty()) : i.kind === "cidr" ? Qi(t.data, i.version) || (a = this._getOrReturnCtx(t, a), f(a, {
|
|
1657
1666
|
validation: "cidr",
|
|
1658
1667
|
code: u.invalid_string,
|
|
1659
1668
|
message: i.message
|
|
1660
|
-
}), r.dirty()) : i.kind === "base64" ?
|
|
1669
|
+
}), r.dirty()) : i.kind === "base64" ? Wi.test(t.data) || (a = this._getOrReturnCtx(t, a), f(a, {
|
|
1661
1670
|
validation: "base64",
|
|
1662
1671
|
code: u.invalid_string,
|
|
1663
1672
|
message: i.message
|
|
1664
|
-
}), r.dirty()) : i.kind === "base64url" ?
|
|
1673
|
+
}), r.dirty()) : i.kind === "base64url" ? qi.test(t.data) || (a = this._getOrReturnCtx(t, a), f(a, {
|
|
1665
1674
|
validation: "base64url",
|
|
1666
1675
|
code: u.invalid_string,
|
|
1667
1676
|
message: i.message
|
|
1668
|
-
}), r.dirty()) :
|
|
1677
|
+
}), r.dirty()) : E.assertNever(i);
|
|
1669
1678
|
return { status: r.value, value: t.data };
|
|
1670
1679
|
}
|
|
1671
1680
|
_regex(t, n, r) {
|
|
@@ -1884,7 +1893,7 @@ oe.create = (e) => {
|
|
|
1884
1893
|
coerce: (t = e == null ? void 0 : e.coerce) != null ? t : !1
|
|
1885
1894
|
}, b(e)));
|
|
1886
1895
|
};
|
|
1887
|
-
function
|
|
1896
|
+
function es(e, t) {
|
|
1888
1897
|
const n = (e.toString().split(".")[1] || "").length, r = (t.toString().split(".")[1] || "").length, a = n > r ? n : r, i = Number.parseInt(e.toFixed(a).replace(".", "")), s = Number.parseInt(t.toFixed(a).replace(".", ""));
|
|
1889
1898
|
return i % s / wn(10, a);
|
|
1890
1899
|
}
|
|
@@ -1902,9 +1911,9 @@ class Ze extends k {
|
|
|
1902
1911
|
}), m;
|
|
1903
1912
|
}
|
|
1904
1913
|
let r;
|
|
1905
|
-
const a = new
|
|
1914
|
+
const a = new M();
|
|
1906
1915
|
for (const i of this._def.checks)
|
|
1907
|
-
i.kind === "int" ?
|
|
1916
|
+
i.kind === "int" ? E.isInteger(t.data) || (r = this._getOrReturnCtx(t, r), f(r, {
|
|
1908
1917
|
code: u.invalid_type,
|
|
1909
1918
|
expected: "integer",
|
|
1910
1919
|
received: "float",
|
|
@@ -1923,14 +1932,14 @@ class Ze extends k {
|
|
|
1923
1932
|
inclusive: i.inclusive,
|
|
1924
1933
|
exact: !1,
|
|
1925
1934
|
message: i.message
|
|
1926
|
-
}), a.dirty()) : i.kind === "multipleOf" ?
|
|
1935
|
+
}), a.dirty()) : i.kind === "multipleOf" ? es(t.data, i.value) !== 0 && (r = this._getOrReturnCtx(t, r), f(r, {
|
|
1927
1936
|
code: u.not_multiple_of,
|
|
1928
1937
|
multipleOf: i.value,
|
|
1929
1938
|
message: i.message
|
|
1930
1939
|
}), a.dirty()) : i.kind === "finite" ? Number.isFinite(t.data) || (r = this._getOrReturnCtx(t, r), f(r, {
|
|
1931
1940
|
code: u.not_finite,
|
|
1932
1941
|
message: i.message
|
|
1933
|
-
}), a.dirty()) :
|
|
1942
|
+
}), a.dirty()) : E.assertNever(i);
|
|
1934
1943
|
return { status: a.value, value: t.data };
|
|
1935
1944
|
}
|
|
1936
1945
|
gte(t, n) {
|
|
@@ -2040,7 +2049,7 @@ class Ze extends k {
|
|
|
2040
2049
|
return t;
|
|
2041
2050
|
}
|
|
2042
2051
|
get isInt() {
|
|
2043
|
-
return !!this._def.checks.find((t) => t.kind === "int" || t.kind === "multipleOf" &&
|
|
2052
|
+
return !!this._def.checks.find((t) => t.kind === "int" || t.kind === "multipleOf" && E.isInteger(t.value));
|
|
2044
2053
|
}
|
|
2045
2054
|
get isFinite() {
|
|
2046
2055
|
let t = null, n = null;
|
|
@@ -2057,7 +2066,7 @@ Ze.create = (e) => new Ze(d({
|
|
|
2057
2066
|
typeName: g.ZodNumber,
|
|
2058
2067
|
coerce: (e == null ? void 0 : e.coerce) || !1
|
|
2059
2068
|
}, b(e)));
|
|
2060
|
-
class
|
|
2069
|
+
class nt extends k {
|
|
2061
2070
|
constructor() {
|
|
2062
2071
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
2063
2072
|
}
|
|
@@ -2071,7 +2080,7 @@ class tt extends k {
|
|
|
2071
2080
|
if (this._getType(t) !== _.bigint)
|
|
2072
2081
|
return this._getInvalidInput(t);
|
|
2073
2082
|
let r;
|
|
2074
|
-
const a = new
|
|
2083
|
+
const a = new M();
|
|
2075
2084
|
for (const i of this._def.checks)
|
|
2076
2085
|
i.kind === "min" ? (i.inclusive ? t.data < i.value : t.data <= i.value) && (r = this._getOrReturnCtx(t, r), f(r, {
|
|
2077
2086
|
code: u.too_small,
|
|
@@ -2089,7 +2098,7 @@ class tt extends k {
|
|
|
2089
2098
|
code: u.not_multiple_of,
|
|
2090
2099
|
multipleOf: i.value,
|
|
2091
2100
|
message: i.message
|
|
2092
|
-
}), a.dirty()) :
|
|
2101
|
+
}), a.dirty()) : E.assertNever(i);
|
|
2093
2102
|
return { status: a.value, value: t.data };
|
|
2094
2103
|
}
|
|
2095
2104
|
_getInvalidInput(t) {
|
|
@@ -2113,7 +2122,7 @@ class tt extends k {
|
|
|
2113
2122
|
return this.setLimit("max", t, !1, p.toString(n));
|
|
2114
2123
|
}
|
|
2115
2124
|
setLimit(t, n, r, a) {
|
|
2116
|
-
return new
|
|
2125
|
+
return new nt(v(d({}, this._def), {
|
|
2117
2126
|
checks: [
|
|
2118
2127
|
...this._def.checks,
|
|
2119
2128
|
{
|
|
@@ -2126,7 +2135,7 @@ class tt extends k {
|
|
|
2126
2135
|
}));
|
|
2127
2136
|
}
|
|
2128
2137
|
_addCheck(t) {
|
|
2129
|
-
return new
|
|
2138
|
+
return new nt(v(d({}, this._def), {
|
|
2130
2139
|
checks: [...this._def.checks, t]
|
|
2131
2140
|
}));
|
|
2132
2141
|
}
|
|
@@ -2182,15 +2191,15 @@ class tt extends k {
|
|
|
2182
2191
|
return t;
|
|
2183
2192
|
}
|
|
2184
2193
|
}
|
|
2185
|
-
|
|
2194
|
+
nt.create = (e) => {
|
|
2186
2195
|
var t;
|
|
2187
|
-
return new
|
|
2196
|
+
return new nt(d({
|
|
2188
2197
|
checks: [],
|
|
2189
2198
|
typeName: g.ZodBigInt,
|
|
2190
2199
|
coerce: (t = e == null ? void 0 : e.coerce) != null ? t : !1
|
|
2191
2200
|
}, b(e)));
|
|
2192
2201
|
};
|
|
2193
|
-
class
|
|
2202
|
+
class Qt extends k {
|
|
2194
2203
|
_parse(t) {
|
|
2195
2204
|
if (this._def.coerce && (t.data = !!t.data), this._getType(t) !== _.boolean) {
|
|
2196
2205
|
const r = this._getOrReturnCtx(t);
|
|
@@ -2200,14 +2209,14 @@ class Jt extends k {
|
|
|
2200
2209
|
received: r.parsedType
|
|
2201
2210
|
}), m;
|
|
2202
2211
|
}
|
|
2203
|
-
return
|
|
2212
|
+
return G(t.data);
|
|
2204
2213
|
}
|
|
2205
2214
|
}
|
|
2206
|
-
|
|
2215
|
+
Qt.create = (e) => new Qt(d({
|
|
2207
2216
|
typeName: g.ZodBoolean,
|
|
2208
2217
|
coerce: (e == null ? void 0 : e.coerce) || !1
|
|
2209
2218
|
}, b(e)));
|
|
2210
|
-
class
|
|
2219
|
+
class Tt extends k {
|
|
2211
2220
|
_parse(t) {
|
|
2212
2221
|
if (this._def.coerce && (t.data = new Date(t.data)), this._getType(t) !== _.date) {
|
|
2213
2222
|
const i = this._getOrReturnCtx(t);
|
|
@@ -2223,7 +2232,7 @@ class St extends k {
|
|
|
2223
2232
|
code: u.invalid_date
|
|
2224
2233
|
}), m;
|
|
2225
2234
|
}
|
|
2226
|
-
const r = new
|
|
2235
|
+
const r = new M();
|
|
2227
2236
|
let a;
|
|
2228
2237
|
for (const i of this._def.checks)
|
|
2229
2238
|
i.kind === "min" ? t.data.getTime() < i.value && (a = this._getOrReturnCtx(t, a), f(a, {
|
|
@@ -2240,14 +2249,14 @@ class St extends k {
|
|
|
2240
2249
|
exact: !1,
|
|
2241
2250
|
maximum: i.value,
|
|
2242
2251
|
type: "date"
|
|
2243
|
-
}), r.dirty()) :
|
|
2252
|
+
}), r.dirty()) : E.assertNever(i);
|
|
2244
2253
|
return {
|
|
2245
2254
|
status: r.value,
|
|
2246
2255
|
value: new Date(t.data.getTime())
|
|
2247
2256
|
};
|
|
2248
2257
|
}
|
|
2249
2258
|
_addCheck(t) {
|
|
2250
|
-
return new
|
|
2259
|
+
return new Tt(v(d({}, this._def), {
|
|
2251
2260
|
checks: [...this._def.checks, t]
|
|
2252
2261
|
}));
|
|
2253
2262
|
}
|
|
@@ -2278,12 +2287,12 @@ class St extends k {
|
|
|
2278
2287
|
return t != null ? new Date(t) : null;
|
|
2279
2288
|
}
|
|
2280
2289
|
}
|
|
2281
|
-
|
|
2290
|
+
Tt.create = (e) => new Tt(d({
|
|
2282
2291
|
checks: [],
|
|
2283
2292
|
coerce: (e == null ? void 0 : e.coerce) || !1,
|
|
2284
2293
|
typeName: g.ZodDate
|
|
2285
2294
|
}, b(e)));
|
|
2286
|
-
class
|
|
2295
|
+
class $n extends k {
|
|
2287
2296
|
_parse(t) {
|
|
2288
2297
|
if (this._getType(t) !== _.symbol) {
|
|
2289
2298
|
const r = this._getOrReturnCtx(t);
|
|
@@ -2293,13 +2302,13 @@ class Ln extends k {
|
|
|
2293
2302
|
received: r.parsedType
|
|
2294
2303
|
}), m;
|
|
2295
2304
|
}
|
|
2296
|
-
return
|
|
2305
|
+
return G(t.data);
|
|
2297
2306
|
}
|
|
2298
2307
|
}
|
|
2299
|
-
|
|
2308
|
+
$n.create = (e) => new $n(d({
|
|
2300
2309
|
typeName: g.ZodSymbol
|
|
2301
2310
|
}, b(e)));
|
|
2302
|
-
class
|
|
2311
|
+
class jn extends k {
|
|
2303
2312
|
_parse(t) {
|
|
2304
2313
|
if (this._getType(t) !== _.undefined) {
|
|
2305
2314
|
const r = this._getOrReturnCtx(t);
|
|
@@ -2309,13 +2318,13 @@ class Dn extends k {
|
|
|
2309
2318
|
received: r.parsedType
|
|
2310
2319
|
}), m;
|
|
2311
2320
|
}
|
|
2312
|
-
return
|
|
2321
|
+
return G(t.data);
|
|
2313
2322
|
}
|
|
2314
2323
|
}
|
|
2315
|
-
|
|
2324
|
+
jn.create = (e) => new jn(d({
|
|
2316
2325
|
typeName: g.ZodUndefined
|
|
2317
2326
|
}, b(e)));
|
|
2318
|
-
class
|
|
2327
|
+
class Mn extends k {
|
|
2319
2328
|
_parse(t) {
|
|
2320
2329
|
if (this._getType(t) !== _.null) {
|
|
2321
2330
|
const r = this._getOrReturnCtx(t);
|
|
@@ -2325,32 +2334,32 @@ class $n extends k {
|
|
|
2325
2334
|
received: r.parsedType
|
|
2326
2335
|
}), m;
|
|
2327
2336
|
}
|
|
2328
|
-
return
|
|
2337
|
+
return G(t.data);
|
|
2329
2338
|
}
|
|
2330
2339
|
}
|
|
2331
|
-
|
|
2340
|
+
Mn.create = (e) => new Mn(d({
|
|
2332
2341
|
typeName: g.ZodNull
|
|
2333
2342
|
}, b(e)));
|
|
2334
|
-
class
|
|
2343
|
+
class Un extends k {
|
|
2335
2344
|
constructor() {
|
|
2336
2345
|
super(...arguments), this._any = !0;
|
|
2337
2346
|
}
|
|
2338
2347
|
_parse(t) {
|
|
2339
|
-
return
|
|
2348
|
+
return G(t.data);
|
|
2340
2349
|
}
|
|
2341
2350
|
}
|
|
2342
|
-
|
|
2351
|
+
Un.create = (e) => new Un(d({
|
|
2343
2352
|
typeName: g.ZodAny
|
|
2344
2353
|
}, b(e)));
|
|
2345
|
-
class
|
|
2354
|
+
class en extends k {
|
|
2346
2355
|
constructor() {
|
|
2347
2356
|
super(...arguments), this._unknown = !0;
|
|
2348
2357
|
}
|
|
2349
2358
|
_parse(t) {
|
|
2350
|
-
return
|
|
2359
|
+
return G(t.data);
|
|
2351
2360
|
}
|
|
2352
2361
|
}
|
|
2353
|
-
|
|
2362
|
+
en.create = (e) => new en(d({
|
|
2354
2363
|
typeName: g.ZodUnknown
|
|
2355
2364
|
}, b(e)));
|
|
2356
2365
|
class ye extends k {
|
|
@@ -2366,7 +2375,7 @@ class ye extends k {
|
|
|
2366
2375
|
ye.create = (e) => new ye(d({
|
|
2367
2376
|
typeName: g.ZodNever
|
|
2368
2377
|
}, b(e)));
|
|
2369
|
-
class
|
|
2378
|
+
class Pn extends k {
|
|
2370
2379
|
_parse(t) {
|
|
2371
2380
|
if (this._getType(t) !== _.undefined) {
|
|
2372
2381
|
const r = this._getOrReturnCtx(t);
|
|
@@ -2376,10 +2385,10 @@ class jn extends k {
|
|
|
2376
2385
|
received: r.parsedType
|
|
2377
2386
|
}), m;
|
|
2378
2387
|
}
|
|
2379
|
-
return
|
|
2388
|
+
return G(t.data);
|
|
2380
2389
|
}
|
|
2381
2390
|
}
|
|
2382
|
-
|
|
2391
|
+
Pn.create = (e) => new Pn(d({
|
|
2383
2392
|
typeName: g.ZodVoid
|
|
2384
2393
|
}, b(e)));
|
|
2385
2394
|
class ne extends k {
|
|
@@ -2418,9 +2427,9 @@ class ne extends k {
|
|
|
2418
2427
|
exact: !1,
|
|
2419
2428
|
message: a.maxLength.message
|
|
2420
2429
|
}), r.dirty()), n.common.async)
|
|
2421
|
-
return Promise.all([...n.data].map((s, o) => a.type._parseAsync(new re(n, s, n.path, o)))).then((s) =>
|
|
2430
|
+
return Promise.all([...n.data].map((s, o) => a.type._parseAsync(new re(n, s, n.path, o)))).then((s) => M.mergeArray(r, s));
|
|
2422
2431
|
const i = [...n.data].map((s, o) => a.type._parseSync(new re(n, s, n.path, o)));
|
|
2423
|
-
return
|
|
2432
|
+
return M.mergeArray(r, i);
|
|
2424
2433
|
}
|
|
2425
2434
|
get element() {
|
|
2426
2435
|
return this._def.type;
|
|
@@ -2451,28 +2460,28 @@ ne.create = (e, t) => new ne(d({
|
|
|
2451
2460
|
exactLength: null,
|
|
2452
2461
|
typeName: g.ZodArray
|
|
2453
2462
|
}, b(t)));
|
|
2454
|
-
function
|
|
2455
|
-
if (e instanceof
|
|
2463
|
+
function Ae(e) {
|
|
2464
|
+
if (e instanceof I) {
|
|
2456
2465
|
const t = {};
|
|
2457
2466
|
for (const n in e.shape) {
|
|
2458
2467
|
const r = e.shape[n];
|
|
2459
|
-
t[n] = me.create(
|
|
2468
|
+
t[n] = me.create(Ae(r));
|
|
2460
2469
|
}
|
|
2461
|
-
return new
|
|
2470
|
+
return new I(v(d({}, e._def), {
|
|
2462
2471
|
shape: () => t
|
|
2463
2472
|
}));
|
|
2464
2473
|
} else return e instanceof ne ? new ne(v(d({}, e._def), {
|
|
2465
|
-
type:
|
|
2466
|
-
})) : e instanceof me ? me.create(
|
|
2474
|
+
type: Ae(e.element)
|
|
2475
|
+
})) : e instanceof me ? me.create(Ae(e.unwrap())) : e instanceof Le ? Le.create(Ae(e.unwrap())) : e instanceof Te ? Te.create(e.items.map((t) => Ae(t))) : e;
|
|
2467
2476
|
}
|
|
2468
|
-
class
|
|
2477
|
+
class I extends k {
|
|
2469
2478
|
constructor() {
|
|
2470
2479
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
2471
2480
|
}
|
|
2472
2481
|
_getCached() {
|
|
2473
2482
|
if (this._cached !== null)
|
|
2474
2483
|
return this._cached;
|
|
2475
|
-
const t = this._def.shape(), n =
|
|
2484
|
+
const t = this._def.shape(), n = E.objectKeys(t);
|
|
2476
2485
|
return this._cached = { shape: t, keys: n }, this._cached;
|
|
2477
2486
|
}
|
|
2478
2487
|
_parse(t) {
|
|
@@ -2536,13 +2545,13 @@ class N extends k {
|
|
|
2536
2545
|
});
|
|
2537
2546
|
}
|
|
2538
2547
|
return l;
|
|
2539
|
-
})).then((l) =>
|
|
2548
|
+
})).then((l) => M.mergeObjectSync(r, l)) : M.mergeObjectSync(r, c);
|
|
2540
2549
|
}
|
|
2541
2550
|
get shape() {
|
|
2542
2551
|
return this._def.shape();
|
|
2543
2552
|
}
|
|
2544
2553
|
strict(t) {
|
|
2545
|
-
return p.errToObj, new
|
|
2554
|
+
return p.errToObj, new I(d(v(d({}, this._def), {
|
|
2546
2555
|
unknownKeys: "strict"
|
|
2547
2556
|
}), t !== void 0 ? {
|
|
2548
2557
|
errorMap: (n, r) => {
|
|
@@ -2557,12 +2566,12 @@ class N extends k {
|
|
|
2557
2566
|
} : {}));
|
|
2558
2567
|
}
|
|
2559
2568
|
strip() {
|
|
2560
|
-
return new
|
|
2569
|
+
return new I(v(d({}, this._def), {
|
|
2561
2570
|
unknownKeys: "strip"
|
|
2562
2571
|
}));
|
|
2563
2572
|
}
|
|
2564
2573
|
passthrough() {
|
|
2565
|
-
return new
|
|
2574
|
+
return new I(v(d({}, this._def), {
|
|
2566
2575
|
unknownKeys: "passthrough"
|
|
2567
2576
|
}));
|
|
2568
2577
|
}
|
|
@@ -2584,7 +2593,7 @@ class N extends k {
|
|
|
2584
2593
|
// }) as any;
|
|
2585
2594
|
// };
|
|
2586
2595
|
extend(t) {
|
|
2587
|
-
return new
|
|
2596
|
+
return new I(v(d({}, this._def), {
|
|
2588
2597
|
shape: () => d(d({}, this._def.shape()), t)
|
|
2589
2598
|
}));
|
|
2590
2599
|
}
|
|
@@ -2594,7 +2603,7 @@ class N extends k {
|
|
|
2594
2603
|
* upgrade if you are experiencing issues.
|
|
2595
2604
|
*/
|
|
2596
2605
|
merge(t) {
|
|
2597
|
-
return new
|
|
2606
|
+
return new I({
|
|
2598
2607
|
unknownKeys: t._def.unknownKeys,
|
|
2599
2608
|
catchall: t._def.catchall,
|
|
2600
2609
|
shape: () => d(d({}, this._def.shape()), t._def.shape()),
|
|
@@ -2661,23 +2670,23 @@ class N extends k {
|
|
|
2661
2670
|
// return merged;
|
|
2662
2671
|
// }
|
|
2663
2672
|
catchall(t) {
|
|
2664
|
-
return new
|
|
2673
|
+
return new I(v(d({}, this._def), {
|
|
2665
2674
|
catchall: t
|
|
2666
2675
|
}));
|
|
2667
2676
|
}
|
|
2668
2677
|
pick(t) {
|
|
2669
2678
|
const n = {};
|
|
2670
|
-
for (const r of
|
|
2679
|
+
for (const r of E.objectKeys(t))
|
|
2671
2680
|
t[r] && this.shape[r] && (n[r] = this.shape[r]);
|
|
2672
|
-
return new
|
|
2681
|
+
return new I(v(d({}, this._def), {
|
|
2673
2682
|
shape: () => n
|
|
2674
2683
|
}));
|
|
2675
2684
|
}
|
|
2676
2685
|
omit(t) {
|
|
2677
2686
|
const n = {};
|
|
2678
|
-
for (const r of
|
|
2687
|
+
for (const r of E.objectKeys(this.shape))
|
|
2679
2688
|
t[r] || (n[r] = this.shape[r]);
|
|
2680
|
-
return new
|
|
2689
|
+
return new I(v(d({}, this._def), {
|
|
2681
2690
|
shape: () => n
|
|
2682
2691
|
}));
|
|
2683
2692
|
}
|
|
@@ -2685,21 +2694,21 @@ class N extends k {
|
|
|
2685
2694
|
* @deprecated
|
|
2686
2695
|
*/
|
|
2687
2696
|
deepPartial() {
|
|
2688
|
-
return
|
|
2697
|
+
return Ae(this);
|
|
2689
2698
|
}
|
|
2690
2699
|
partial(t) {
|
|
2691
2700
|
const n = {};
|
|
2692
|
-
for (const r of
|
|
2701
|
+
for (const r of E.objectKeys(this.shape)) {
|
|
2693
2702
|
const a = this.shape[r];
|
|
2694
2703
|
t && !t[r] ? n[r] = a : n[r] = a.optional();
|
|
2695
2704
|
}
|
|
2696
|
-
return new
|
|
2705
|
+
return new I(v(d({}, this._def), {
|
|
2697
2706
|
shape: () => n
|
|
2698
2707
|
}));
|
|
2699
2708
|
}
|
|
2700
2709
|
required(t) {
|
|
2701
2710
|
const n = {};
|
|
2702
|
-
for (const r of
|
|
2711
|
+
for (const r of E.objectKeys(this.shape))
|
|
2703
2712
|
if (t && !t[r])
|
|
2704
2713
|
n[r] = this.shape[r];
|
|
2705
2714
|
else {
|
|
@@ -2708,33 +2717,33 @@ class N extends k {
|
|
|
2708
2717
|
i = i._def.innerType;
|
|
2709
2718
|
n[r] = i;
|
|
2710
2719
|
}
|
|
2711
|
-
return new
|
|
2720
|
+
return new I(v(d({}, this._def), {
|
|
2712
2721
|
shape: () => n
|
|
2713
2722
|
}));
|
|
2714
2723
|
}
|
|
2715
2724
|
keyof() {
|
|
2716
|
-
return
|
|
2725
|
+
return Ir(E.objectKeys(this.shape));
|
|
2717
2726
|
}
|
|
2718
2727
|
}
|
|
2719
|
-
|
|
2728
|
+
I.create = (e, t) => new I(d({
|
|
2720
2729
|
shape: () => e,
|
|
2721
2730
|
unknownKeys: "strip",
|
|
2722
2731
|
catchall: ye.create(),
|
|
2723
2732
|
typeName: g.ZodObject
|
|
2724
2733
|
}, b(t)));
|
|
2725
|
-
|
|
2734
|
+
I.strictCreate = (e, t) => new I(d({
|
|
2726
2735
|
shape: () => e,
|
|
2727
2736
|
unknownKeys: "strict",
|
|
2728
2737
|
catchall: ye.create(),
|
|
2729
2738
|
typeName: g.ZodObject
|
|
2730
2739
|
}, b(t)));
|
|
2731
|
-
|
|
2740
|
+
I.lazycreate = (e, t) => new I(d({
|
|
2732
2741
|
shape: e,
|
|
2733
2742
|
unknownKeys: "strip",
|
|
2734
2743
|
catchall: ye.create(),
|
|
2735
2744
|
typeName: g.ZodObject
|
|
2736
2745
|
}, b(t)));
|
|
2737
|
-
class
|
|
2746
|
+
class Et extends k {
|
|
2738
2747
|
_parse(t) {
|
|
2739
2748
|
const { ctx: n } = this._processInputParams(t), r = this._def.options;
|
|
2740
2749
|
function a(i) {
|
|
@@ -2798,18 +2807,18 @@ class Tt extends k {
|
|
|
2798
2807
|
return this._def.options;
|
|
2799
2808
|
}
|
|
2800
2809
|
}
|
|
2801
|
-
|
|
2810
|
+
Et.create = (e, t) => new Et(d({
|
|
2802
2811
|
options: e,
|
|
2803
2812
|
typeName: g.ZodUnion
|
|
2804
2813
|
}, b(t)));
|
|
2805
|
-
function
|
|
2814
|
+
function tn(e, t) {
|
|
2806
2815
|
const n = ue(e), r = ue(t);
|
|
2807
2816
|
if (e === t)
|
|
2808
2817
|
return { valid: !0, data: e };
|
|
2809
2818
|
if (n === _.object && r === _.object) {
|
|
2810
|
-
const a =
|
|
2819
|
+
const a = E.objectKeys(t), i = E.objectKeys(e).filter((o) => a.indexOf(o) !== -1), s = d(d({}, e), t);
|
|
2811
2820
|
for (const o of i) {
|
|
2812
|
-
const c =
|
|
2821
|
+
const c = tn(e[o], t[o]);
|
|
2813
2822
|
if (!c.valid)
|
|
2814
2823
|
return { valid: !1 };
|
|
2815
2824
|
s[o] = c.data;
|
|
@@ -2820,7 +2829,7 @@ function en(e, t) {
|
|
|
2820
2829
|
return { valid: !1 };
|
|
2821
2830
|
const a = [];
|
|
2822
2831
|
for (let i = 0; i < e.length; i++) {
|
|
2823
|
-
const s = e[i], o = t[i], c =
|
|
2832
|
+
const s = e[i], o = t[i], c = tn(s, o);
|
|
2824
2833
|
if (!c.valid)
|
|
2825
2834
|
return { valid: !1 };
|
|
2826
2835
|
a.push(c.data);
|
|
@@ -2831,10 +2840,10 @@ function en(e, t) {
|
|
|
2831
2840
|
class At extends k {
|
|
2832
2841
|
_parse(t) {
|
|
2833
2842
|
const { status: n, ctx: r } = this._processInputParams(t), a = (i, s) => {
|
|
2834
|
-
if (
|
|
2843
|
+
if (Dn(i) || Dn(s))
|
|
2835
2844
|
return m;
|
|
2836
|
-
const o =
|
|
2837
|
-
return o.valid ? ((
|
|
2845
|
+
const o = tn(i.value, s.value);
|
|
2846
|
+
return o.valid ? ((Ln(i) || Ln(s)) && n.dirty(), { status: n.value, value: o.data }) : (f(r, {
|
|
2838
2847
|
code: u.invalid_intersection_types
|
|
2839
2848
|
}), m);
|
|
2840
2849
|
};
|
|
@@ -2893,7 +2902,7 @@ class Te extends k {
|
|
|
2893
2902
|
const c = this._def.items[o] || this._def.rest;
|
|
2894
2903
|
return c ? c._parse(new re(r, s, r.path, o)) : null;
|
|
2895
2904
|
}).filter((s) => !!s);
|
|
2896
|
-
return r.common.async ? Promise.all(i).then((s) =>
|
|
2905
|
+
return r.common.async ? Promise.all(i).then((s) => M.mergeArray(n, s)) : M.mergeArray(n, i);
|
|
2897
2906
|
}
|
|
2898
2907
|
get items() {
|
|
2899
2908
|
return this._def.items;
|
|
@@ -2913,7 +2922,7 @@ Te.create = (e, t) => {
|
|
|
2913
2922
|
rest: null
|
|
2914
2923
|
}, b(t)));
|
|
2915
2924
|
};
|
|
2916
|
-
class
|
|
2925
|
+
class Ot extends k {
|
|
2917
2926
|
get keySchema() {
|
|
2918
2927
|
return this._def.keyType;
|
|
2919
2928
|
}
|
|
@@ -2935,24 +2944,24 @@ class Et extends k {
|
|
|
2935
2944
|
value: s._parse(new re(r, r.data[o], r.path, o)),
|
|
2936
2945
|
alwaysSet: o in r.data
|
|
2937
2946
|
});
|
|
2938
|
-
return r.common.async ?
|
|
2947
|
+
return r.common.async ? M.mergeObjectAsync(n, a) : M.mergeObjectSync(n, a);
|
|
2939
2948
|
}
|
|
2940
2949
|
get element() {
|
|
2941
2950
|
return this._def.valueType;
|
|
2942
2951
|
}
|
|
2943
2952
|
static create(t, n, r) {
|
|
2944
|
-
return n instanceof k ? new
|
|
2953
|
+
return n instanceof k ? new Ot(d({
|
|
2945
2954
|
keyType: t,
|
|
2946
2955
|
valueType: n,
|
|
2947
2956
|
typeName: g.ZodRecord
|
|
2948
|
-
}, b(r))) : new
|
|
2957
|
+
}, b(r))) : new Ot(d({
|
|
2949
2958
|
keyType: oe.create(),
|
|
2950
2959
|
valueType: t,
|
|
2951
2960
|
typeName: g.ZodRecord
|
|
2952
2961
|
}, b(n)));
|
|
2953
2962
|
}
|
|
2954
2963
|
}
|
|
2955
|
-
class
|
|
2964
|
+
class Bn extends k {
|
|
2956
2965
|
get keySchema() {
|
|
2957
2966
|
return this._def.keyType;
|
|
2958
2967
|
}
|
|
@@ -2994,12 +3003,12 @@ class Mn extends k {
|
|
|
2994
3003
|
}
|
|
2995
3004
|
}
|
|
2996
3005
|
}
|
|
2997
|
-
|
|
3006
|
+
Bn.create = (e, t, n) => new Bn(d({
|
|
2998
3007
|
valueType: t,
|
|
2999
3008
|
keyType: e,
|
|
3000
3009
|
typeName: g.ZodMap
|
|
3001
3010
|
}, b(n)));
|
|
3002
|
-
class
|
|
3011
|
+
class rt extends k {
|
|
3003
3012
|
_parse(t) {
|
|
3004
3013
|
const { status: n, ctx: r } = this._processInputParams(t);
|
|
3005
3014
|
if (r.parsedType !== _.set)
|
|
@@ -3038,12 +3047,12 @@ class nt extends k {
|
|
|
3038
3047
|
return r.common.async ? Promise.all(o).then((c) => s(c)) : s(o);
|
|
3039
3048
|
}
|
|
3040
3049
|
min(t, n) {
|
|
3041
|
-
return new
|
|
3050
|
+
return new rt(v(d({}, this._def), {
|
|
3042
3051
|
minSize: { value: t, message: p.toString(n) }
|
|
3043
3052
|
}));
|
|
3044
3053
|
}
|
|
3045
3054
|
max(t, n) {
|
|
3046
|
-
return new
|
|
3055
|
+
return new rt(v(d({}, this._def), {
|
|
3047
3056
|
maxSize: { value: t, message: p.toString(n) }
|
|
3048
3057
|
}));
|
|
3049
3058
|
}
|
|
@@ -3054,13 +3063,13 @@ class nt extends k {
|
|
|
3054
3063
|
return this.min(1, t);
|
|
3055
3064
|
}
|
|
3056
3065
|
}
|
|
3057
|
-
|
|
3066
|
+
rt.create = (e, t) => new rt(d({
|
|
3058
3067
|
valueType: e,
|
|
3059
3068
|
minSize: null,
|
|
3060
3069
|
maxSize: null,
|
|
3061
3070
|
typeName: g.ZodSet
|
|
3062
3071
|
}, b(t)));
|
|
3063
|
-
class
|
|
3072
|
+
class Vn extends k {
|
|
3064
3073
|
get schema() {
|
|
3065
3074
|
return this._def.getter();
|
|
3066
3075
|
}
|
|
@@ -3069,11 +3078,11 @@ class Un extends k {
|
|
|
3069
3078
|
return this._def.getter()._parse({ data: n.data, path: n.path, parent: n });
|
|
3070
3079
|
}
|
|
3071
3080
|
}
|
|
3072
|
-
|
|
3081
|
+
Vn.create = (e, t) => new Vn(d({
|
|
3073
3082
|
getter: e,
|
|
3074
3083
|
typeName: g.ZodLazy
|
|
3075
3084
|
}, b(t)));
|
|
3076
|
-
class
|
|
3085
|
+
class nn extends k {
|
|
3077
3086
|
_parse(t) {
|
|
3078
3087
|
if (t.data !== this._def.value) {
|
|
3079
3088
|
const n = this._getOrReturnCtx(t);
|
|
@@ -3089,11 +3098,11 @@ class tn extends k {
|
|
|
3089
3098
|
return this._def.value;
|
|
3090
3099
|
}
|
|
3091
3100
|
}
|
|
3092
|
-
|
|
3101
|
+
nn.create = (e, t) => new nn(d({
|
|
3093
3102
|
value: e,
|
|
3094
3103
|
typeName: g.ZodLiteral
|
|
3095
3104
|
}, b(t)));
|
|
3096
|
-
function
|
|
3105
|
+
function Ir(e, t) {
|
|
3097
3106
|
return new ze(d({
|
|
3098
3107
|
values: e,
|
|
3099
3108
|
typeName: g.ZodEnum
|
|
@@ -3104,7 +3113,7 @@ class ze extends k {
|
|
|
3104
3113
|
if (typeof t.data != "string") {
|
|
3105
3114
|
const n = this._getOrReturnCtx(t), r = this._def.values;
|
|
3106
3115
|
return f(n, {
|
|
3107
|
-
expected:
|
|
3116
|
+
expected: E.joinValues(r),
|
|
3108
3117
|
received: n.parsedType,
|
|
3109
3118
|
code: u.invalid_type
|
|
3110
3119
|
}), m;
|
|
@@ -3117,7 +3126,7 @@ class ze extends k {
|
|
|
3117
3126
|
options: r
|
|
3118
3127
|
}), m;
|
|
3119
3128
|
}
|
|
3120
|
-
return
|
|
3129
|
+
return G(t.data);
|
|
3121
3130
|
}
|
|
3122
3131
|
get options() {
|
|
3123
3132
|
return this._def.values;
|
|
@@ -3147,37 +3156,37 @@ class ze extends k {
|
|
|
3147
3156
|
return ze.create(this.options.filter((r) => !t.includes(r)), d(d({}, this._def), n));
|
|
3148
3157
|
}
|
|
3149
3158
|
}
|
|
3150
|
-
ze.create =
|
|
3151
|
-
class
|
|
3159
|
+
ze.create = Ir;
|
|
3160
|
+
class Hn extends k {
|
|
3152
3161
|
_parse(t) {
|
|
3153
|
-
const n =
|
|
3162
|
+
const n = E.getValidEnumValues(this._def.values), r = this._getOrReturnCtx(t);
|
|
3154
3163
|
if (r.parsedType !== _.string && r.parsedType !== _.number) {
|
|
3155
|
-
const a =
|
|
3164
|
+
const a = E.objectValues(n);
|
|
3156
3165
|
return f(r, {
|
|
3157
|
-
expected:
|
|
3166
|
+
expected: E.joinValues(a),
|
|
3158
3167
|
received: r.parsedType,
|
|
3159
3168
|
code: u.invalid_type
|
|
3160
3169
|
}), m;
|
|
3161
3170
|
}
|
|
3162
|
-
if (this._cache || (this._cache = new Set(
|
|
3163
|
-
const a =
|
|
3171
|
+
if (this._cache || (this._cache = new Set(E.getValidEnumValues(this._def.values))), !this._cache.has(t.data)) {
|
|
3172
|
+
const a = E.objectValues(n);
|
|
3164
3173
|
return f(r, {
|
|
3165
3174
|
received: r.data,
|
|
3166
3175
|
code: u.invalid_enum_value,
|
|
3167
3176
|
options: a
|
|
3168
3177
|
}), m;
|
|
3169
3178
|
}
|
|
3170
|
-
return
|
|
3179
|
+
return G(t.data);
|
|
3171
3180
|
}
|
|
3172
3181
|
get enum() {
|
|
3173
3182
|
return this._def.values;
|
|
3174
3183
|
}
|
|
3175
3184
|
}
|
|
3176
|
-
|
|
3185
|
+
Hn.create = (e, t) => new Hn(d({
|
|
3177
3186
|
values: e,
|
|
3178
3187
|
typeName: g.ZodNativeEnum
|
|
3179
3188
|
}, b(t)));
|
|
3180
|
-
class
|
|
3189
|
+
class Ct extends k {
|
|
3181
3190
|
unwrap() {
|
|
3182
3191
|
return this._def.type;
|
|
3183
3192
|
}
|
|
@@ -3190,17 +3199,17 @@ class Ot extends k {
|
|
|
3190
3199
|
received: n.parsedType
|
|
3191
3200
|
}), m;
|
|
3192
3201
|
const r = n.parsedType === _.promise ? n.data : Promise.resolve(n.data);
|
|
3193
|
-
return
|
|
3202
|
+
return G(r.then((a) => this._def.type.parseAsync(a, {
|
|
3194
3203
|
path: n.path,
|
|
3195
3204
|
errorMap: n.common.contextualErrorMap
|
|
3196
3205
|
})));
|
|
3197
3206
|
}
|
|
3198
3207
|
}
|
|
3199
|
-
|
|
3208
|
+
Ct.create = (e, t) => new Ct(d({
|
|
3200
3209
|
type: e,
|
|
3201
3210
|
typeName: g.ZodPromise
|
|
3202
3211
|
}, b(t)));
|
|
3203
|
-
class
|
|
3212
|
+
class De extends k {
|
|
3204
3213
|
innerType() {
|
|
3205
3214
|
return this._def.schema;
|
|
3206
3215
|
}
|
|
@@ -3266,33 +3275,33 @@ class Le extends k {
|
|
|
3266
3275
|
path: r.path,
|
|
3267
3276
|
parent: r
|
|
3268
3277
|
});
|
|
3269
|
-
if (!
|
|
3278
|
+
if (!Ie(s))
|
|
3270
3279
|
return m;
|
|
3271
3280
|
const o = a.transform(s.value, i);
|
|
3272
3281
|
if (o instanceof Promise)
|
|
3273
3282
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
3274
3283
|
return { status: n.value, value: o };
|
|
3275
3284
|
} else
|
|
3276
|
-
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((s) =>
|
|
3285
|
+
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((s) => Ie(s) ? Promise.resolve(a.transform(s.value, i)).then((o) => ({
|
|
3277
3286
|
status: n.value,
|
|
3278
3287
|
value: o
|
|
3279
3288
|
})) : m);
|
|
3280
|
-
|
|
3289
|
+
E.assertNever(a);
|
|
3281
3290
|
}
|
|
3282
3291
|
}
|
|
3283
|
-
|
|
3292
|
+
De.create = (e, t, n) => new De(d({
|
|
3284
3293
|
schema: e,
|
|
3285
3294
|
typeName: g.ZodEffects,
|
|
3286
3295
|
effect: t
|
|
3287
3296
|
}, b(n)));
|
|
3288
|
-
|
|
3297
|
+
De.createWithPreprocess = (e, t, n) => new De(d({
|
|
3289
3298
|
schema: t,
|
|
3290
3299
|
effect: { type: "preprocess", transform: e },
|
|
3291
3300
|
typeName: g.ZodEffects
|
|
3292
3301
|
}, b(n)));
|
|
3293
3302
|
class me extends k {
|
|
3294
3303
|
_parse(t) {
|
|
3295
|
-
return this._getType(t) === _.undefined ?
|
|
3304
|
+
return this._getType(t) === _.undefined ? G(void 0) : this._def.innerType._parse(t);
|
|
3296
3305
|
}
|
|
3297
3306
|
unwrap() {
|
|
3298
3307
|
return this._def.innerType;
|
|
@@ -3302,19 +3311,19 @@ me.create = (e, t) => new me(d({
|
|
|
3302
3311
|
innerType: e,
|
|
3303
3312
|
typeName: g.ZodOptional
|
|
3304
3313
|
}, b(t)));
|
|
3305
|
-
class
|
|
3314
|
+
class Le extends k {
|
|
3306
3315
|
_parse(t) {
|
|
3307
|
-
return this._getType(t) === _.null ?
|
|
3316
|
+
return this._getType(t) === _.null ? G(null) : this._def.innerType._parse(t);
|
|
3308
3317
|
}
|
|
3309
3318
|
unwrap() {
|
|
3310
3319
|
return this._def.innerType;
|
|
3311
3320
|
}
|
|
3312
3321
|
}
|
|
3313
|
-
|
|
3322
|
+
Le.create = (e, t) => new Le(d({
|
|
3314
3323
|
innerType: e,
|
|
3315
3324
|
typeName: g.ZodNullable
|
|
3316
3325
|
}, b(t)));
|
|
3317
|
-
class
|
|
3326
|
+
class rn extends k {
|
|
3318
3327
|
_parse(t) {
|
|
3319
3328
|
const { ctx: n } = this._processInputParams(t);
|
|
3320
3329
|
let r = n.data;
|
|
@@ -3328,12 +3337,12 @@ class nn extends k {
|
|
|
3328
3337
|
return this._def.innerType;
|
|
3329
3338
|
}
|
|
3330
3339
|
}
|
|
3331
|
-
|
|
3340
|
+
rn.create = (e, t) => new rn(d({
|
|
3332
3341
|
innerType: e,
|
|
3333
3342
|
typeName: g.ZodDefault,
|
|
3334
3343
|
defaultValue: typeof t.default == "function" ? t.default : () => t.default
|
|
3335
3344
|
}, b(t)));
|
|
3336
|
-
class
|
|
3345
|
+
class an extends k {
|
|
3337
3346
|
_parse(t) {
|
|
3338
3347
|
const { ctx: n } = this._processInputParams(t), r = v(d({}, n), {
|
|
3339
3348
|
common: v(d({}, n.common), {
|
|
@@ -3344,7 +3353,7 @@ class rn extends k {
|
|
|
3344
3353
|
path: r.path,
|
|
3345
3354
|
parent: d({}, r)
|
|
3346
3355
|
});
|
|
3347
|
-
return
|
|
3356
|
+
return St(a) ? a.then((i) => ({
|
|
3348
3357
|
status: "valid",
|
|
3349
3358
|
value: i.status === "valid" ? i.value : this._def.catchValue({
|
|
3350
3359
|
get error() {
|
|
@@ -3366,12 +3375,12 @@ class rn extends k {
|
|
|
3366
3375
|
return this._def.innerType;
|
|
3367
3376
|
}
|
|
3368
3377
|
}
|
|
3369
|
-
|
|
3378
|
+
an.create = (e, t) => new an(d({
|
|
3370
3379
|
innerType: e,
|
|
3371
3380
|
typeName: g.ZodCatch,
|
|
3372
3381
|
catchValue: typeof t.catch == "function" ? t.catch : () => t.catch
|
|
3373
3382
|
}, b(t)));
|
|
3374
|
-
class
|
|
3383
|
+
class Wn extends k {
|
|
3375
3384
|
_parse(t) {
|
|
3376
3385
|
if (this._getType(t) !== _.nan) {
|
|
3377
3386
|
const r = this._getOrReturnCtx(t);
|
|
@@ -3384,10 +3393,10 @@ class Bn extends k {
|
|
|
3384
3393
|
return { status: "valid", value: t.data };
|
|
3385
3394
|
}
|
|
3386
3395
|
}
|
|
3387
|
-
|
|
3396
|
+
Wn.create = (e) => new Wn(d({
|
|
3388
3397
|
typeName: g.ZodNaN
|
|
3389
3398
|
}, b(e)));
|
|
3390
|
-
class
|
|
3399
|
+
class ts extends k {
|
|
3391
3400
|
_parse(t) {
|
|
3392
3401
|
const { ctx: n } = this._processInputParams(t), r = n.data;
|
|
3393
3402
|
return this._def.type._parse({
|
|
@@ -3440,16 +3449,16 @@ class gn extends k {
|
|
|
3440
3449
|
});
|
|
3441
3450
|
}
|
|
3442
3451
|
}
|
|
3443
|
-
class
|
|
3452
|
+
class sn extends k {
|
|
3444
3453
|
_parse(t) {
|
|
3445
|
-
const n = this._def.innerType._parse(t), r = (a) => (
|
|
3446
|
-
return
|
|
3454
|
+
const n = this._def.innerType._parse(t), r = (a) => (Ie(a) && (a.value = Object.freeze(a.value)), a);
|
|
3455
|
+
return St(n) ? n.then((a) => r(a)) : r(n);
|
|
3447
3456
|
}
|
|
3448
3457
|
unwrap() {
|
|
3449
3458
|
return this._def.innerType;
|
|
3450
3459
|
}
|
|
3451
3460
|
}
|
|
3452
|
-
|
|
3461
|
+
sn.create = (e, t) => new sn(d({
|
|
3453
3462
|
innerType: e,
|
|
3454
3463
|
typeName: g.ZodReadonly
|
|
3455
3464
|
}, b(t)));
|
|
@@ -3457,75 +3466,75 @@ var g;
|
|
|
3457
3466
|
(function(e) {
|
|
3458
3467
|
e.ZodString = "ZodString", e.ZodNumber = "ZodNumber", e.ZodNaN = "ZodNaN", e.ZodBigInt = "ZodBigInt", e.ZodBoolean = "ZodBoolean", e.ZodDate = "ZodDate", e.ZodSymbol = "ZodSymbol", e.ZodUndefined = "ZodUndefined", e.ZodNull = "ZodNull", e.ZodAny = "ZodAny", e.ZodUnknown = "ZodUnknown", e.ZodNever = "ZodNever", e.ZodVoid = "ZodVoid", e.ZodArray = "ZodArray", e.ZodObject = "ZodObject", e.ZodUnion = "ZodUnion", e.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", e.ZodIntersection = "ZodIntersection", e.ZodTuple = "ZodTuple", e.ZodRecord = "ZodRecord", e.ZodMap = "ZodMap", e.ZodSet = "ZodSet", e.ZodFunction = "ZodFunction", e.ZodLazy = "ZodLazy", e.ZodLiteral = "ZodLiteral", e.ZodEnum = "ZodEnum", e.ZodEffects = "ZodEffects", e.ZodNativeEnum = "ZodNativeEnum", e.ZodOptional = "ZodOptional", e.ZodNullable = "ZodNullable", e.ZodDefault = "ZodDefault", e.ZodCatch = "ZodCatch", e.ZodPromise = "ZodPromise", e.ZodBranded = "ZodBranded", e.ZodPipeline = "ZodPipeline", e.ZodReadonly = "ZodReadonly";
|
|
3459
3468
|
})(g || (g = {}));
|
|
3460
|
-
const
|
|
3469
|
+
const pt = oe.create, ns = Ze.create, X = Qt.create, rs = en.create;
|
|
3461
3470
|
ye.create;
|
|
3462
|
-
const
|
|
3471
|
+
const qn = ne.create, gt = I.create, as = Et.create;
|
|
3463
3472
|
At.create;
|
|
3464
3473
|
Te.create;
|
|
3465
|
-
const
|
|
3466
|
-
|
|
3474
|
+
const is = Ot.create, Kn = nn.create, mt = ze.create;
|
|
3475
|
+
Ct.create;
|
|
3467
3476
|
me.create;
|
|
3468
|
-
|
|
3469
|
-
const
|
|
3470
|
-
language:
|
|
3471
|
-
disableMarkedForExport:
|
|
3472
|
-
allowAutoSelectFirstNode:
|
|
3473
|
-
enableDisplayDataId:
|
|
3474
|
-
enableDisplayDataName:
|
|
3477
|
+
Le.create;
|
|
3478
|
+
const ss = gt({
|
|
3479
|
+
language: mt(["typescript", "javascript"]).optional(),
|
|
3480
|
+
disableMarkedForExport: X().optional(),
|
|
3481
|
+
allowAutoSelectFirstNode: X().optional().default(!0),
|
|
3482
|
+
enableDisplayDataId: X().optional(),
|
|
3483
|
+
enableDisplayDataName: X().optional()
|
|
3475
3484
|
}).and(
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
framework:
|
|
3479
|
-
model:
|
|
3480
|
-
styling:
|
|
3481
|
-
uiLibrary:
|
|
3482
|
-
responsivePages:
|
|
3483
|
-
|
|
3484
|
-
name:
|
|
3485
|
-
framesId:
|
|
3485
|
+
as([
|
|
3486
|
+
gt({
|
|
3487
|
+
framework: Kn("react"),
|
|
3488
|
+
model: pt().optional(),
|
|
3489
|
+
styling: mt(["plain_css", "tailwind", "inline_styles"]),
|
|
3490
|
+
uiLibrary: mt(["mui", "antd", "radix", "shadcn", "clean_react"]).optional(),
|
|
3491
|
+
responsivePages: qn(
|
|
3492
|
+
gt({
|
|
3493
|
+
name: pt(),
|
|
3494
|
+
framesId: qn(pt())
|
|
3486
3495
|
})
|
|
3487
3496
|
).optional(),
|
|
3488
|
-
enableUILibraryTheming:
|
|
3489
|
-
enableCompactStructure:
|
|
3490
|
-
enableDisplayScreenModelId:
|
|
3491
|
-
enableGeneratePackageLock:
|
|
3492
|
-
enableAnimationsPreset:
|
|
3493
|
-
enableAutoSplit:
|
|
3494
|
-
autoSplitThreshold:
|
|
3495
|
-
url:
|
|
3496
|
-
codegenSettings:
|
|
3497
|
+
enableUILibraryTheming: X().optional(),
|
|
3498
|
+
enableCompactStructure: X().optional(),
|
|
3499
|
+
enableDisplayScreenModelId: X().optional(),
|
|
3500
|
+
enableGeneratePackageLock: X().optional(),
|
|
3501
|
+
enableAnimationsPreset: X().optional(),
|
|
3502
|
+
enableAutoSplit: X().optional(),
|
|
3503
|
+
autoSplitThreshold: ns().optional(),
|
|
3504
|
+
url: pt().url().optional(),
|
|
3505
|
+
codegenSettings: is(rs()).optional()
|
|
3497
3506
|
}),
|
|
3498
|
-
|
|
3499
|
-
framework:
|
|
3500
|
-
styling:
|
|
3501
|
-
enableTranslation:
|
|
3507
|
+
gt({
|
|
3508
|
+
framework: Kn("html"),
|
|
3509
|
+
styling: mt(["plain_css", "inline_styles", "tailwind"]),
|
|
3510
|
+
enableTranslation: X().optional()
|
|
3502
3511
|
})
|
|
3503
3512
|
])
|
|
3504
|
-
),
|
|
3505
|
-
const t =
|
|
3513
|
+
), os = (e) => {
|
|
3514
|
+
const t = ss.safeParse(e);
|
|
3506
3515
|
if (t.success === !1) {
|
|
3507
3516
|
const n = new Error("Invalid codegen settings");
|
|
3508
3517
|
throw n.cause = t.error, n;
|
|
3509
3518
|
}
|
|
3510
3519
|
return t.data;
|
|
3511
|
-
},
|
|
3520
|
+
}, Zr = (e, t) => {
|
|
3512
3521
|
if (e.id === t)
|
|
3513
3522
|
return e;
|
|
3514
3523
|
if ("children" in e)
|
|
3515
3524
|
for (const n of e.children) {
|
|
3516
|
-
const r =
|
|
3525
|
+
const r = Zr(n, t);
|
|
3517
3526
|
if (r)
|
|
3518
3527
|
return r;
|
|
3519
3528
|
}
|
|
3520
3529
|
return null;
|
|
3521
|
-
},
|
|
3530
|
+
}, Gn = /* @__PURE__ */ new Set([
|
|
3522
3531
|
"FRAME",
|
|
3523
3532
|
"INSTANCE",
|
|
3524
3533
|
"COMPONENT",
|
|
3525
3534
|
"COMPONENT_SET",
|
|
3526
3535
|
"GROUP"
|
|
3527
|
-
]),
|
|
3528
|
-
const r =
|
|
3536
|
+
]), ls = (e, t, n = { allowAutoSelectFirstNode: !0 }) => {
|
|
3537
|
+
const r = Zr(e.document, t);
|
|
3529
3538
|
if (!r)
|
|
3530
3539
|
return {
|
|
3531
3540
|
isValid: !1,
|
|
@@ -3533,7 +3542,7 @@ const cs = pt({
|
|
|
3533
3542
|
};
|
|
3534
3543
|
if (r.type === "CANVAS") {
|
|
3535
3544
|
const a = r.children.filter(
|
|
3536
|
-
(i) =>
|
|
3545
|
+
(i) => Gn.has(i.type)
|
|
3537
3546
|
);
|
|
3538
3547
|
return a.length === 0 ? {
|
|
3539
3548
|
isValid: !1,
|
|
@@ -3551,20 +3560,20 @@ const cs = pt({
|
|
|
3551
3560
|
reason: "Selected node is a page with multiple children"
|
|
3552
3561
|
};
|
|
3553
3562
|
}
|
|
3554
|
-
return
|
|
3563
|
+
return Gn.has(r.type) ? { isValid: !0, node: r } : {
|
|
3555
3564
|
isValid: !1,
|
|
3556
3565
|
reason: "Selected node type is not supported"
|
|
3557
3566
|
};
|
|
3558
3567
|
};
|
|
3559
|
-
function
|
|
3568
|
+
function cs(e) {
|
|
3560
3569
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
3561
3570
|
}
|
|
3562
|
-
var
|
|
3563
|
-
function
|
|
3564
|
-
return
|
|
3571
|
+
var vt = { exports: {} }, ds = vt.exports, Xn;
|
|
3572
|
+
function us() {
|
|
3573
|
+
return Xn || (Xn = 1, (function(e, t) {
|
|
3565
3574
|
(function(n, r) {
|
|
3566
3575
|
e.exports = r();
|
|
3567
|
-
})(
|
|
3576
|
+
})(ds, (function() {
|
|
3568
3577
|
var n = typeof Promise == "function", r = (function(R) {
|
|
3569
3578
|
if (typeof globalThis == "object")
|
|
3570
3579
|
return globalThis;
|
|
@@ -3574,13 +3583,13 @@ function _s() {
|
|
|
3574
3583
|
},
|
|
3575
3584
|
configurable: !0
|
|
3576
3585
|
});
|
|
3577
|
-
var
|
|
3578
|
-
return delete R.typeDetectGlobalObject,
|
|
3579
|
-
})(Object.prototype), a = typeof Symbol != "undefined", i = typeof Map != "undefined", s = typeof Set != "undefined", o = typeof WeakMap != "undefined", c = typeof WeakSet != "undefined", l = typeof DataView != "undefined", h = a && typeof Symbol.iterator != "undefined", S = a && typeof Symbol.toStringTag != "undefined", y = s && typeof Set.prototype.entries == "function",
|
|
3580
|
-
function
|
|
3581
|
-
var
|
|
3582
|
-
if (
|
|
3583
|
-
return
|
|
3586
|
+
var L = typeDetectGlobalObject;
|
|
3587
|
+
return delete R.typeDetectGlobalObject, L;
|
|
3588
|
+
})(Object.prototype), a = typeof Symbol != "undefined", i = typeof Map != "undefined", s = typeof Set != "undefined", o = typeof WeakMap != "undefined", c = typeof WeakSet != "undefined", l = typeof DataView != "undefined", h = a && typeof Symbol.iterator != "undefined", S = a && typeof Symbol.toStringTag != "undefined", y = s && typeof Set.prototype.entries == "function", N = i && typeof Map.prototype.entries == "function", Z = y && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), B = N && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), Ue = h && typeof Array.prototype[Symbol.iterator] == "function", ct = Ue && Object.getPrototypeOf([][Symbol.iterator]()), Pe = h && typeof String.prototype[Symbol.iterator] == "function", dt = Pe && Object.getPrototypeOf(""[Symbol.iterator]()), ut = 8, ft = -1;
|
|
3589
|
+
function ht(R) {
|
|
3590
|
+
var L = typeof R;
|
|
3591
|
+
if (L !== "object")
|
|
3592
|
+
return L;
|
|
3584
3593
|
if (R === null)
|
|
3585
3594
|
return "null";
|
|
3586
3595
|
if (R === r)
|
|
@@ -3611,14 +3620,14 @@ function _s() {
|
|
|
3611
3620
|
if (typeof ve == "string")
|
|
3612
3621
|
return ve;
|
|
3613
3622
|
var z = Object.getPrototypeOf(R);
|
|
3614
|
-
return z === RegExp.prototype ? "RegExp" : z === Date.prototype ? "Date" : n && z === Promise.prototype ? "Promise" : s && z === Set.prototype ? "Set" : i && z === Map.prototype ? "Map" : c && z === WeakSet.prototype ? "WeakSet" : o && z === WeakMap.prototype ? "WeakMap" : l && z === DataView.prototype ? "DataView" : i && z ===
|
|
3623
|
+
return z === RegExp.prototype ? "RegExp" : z === Date.prototype ? "Date" : n && z === Promise.prototype ? "Promise" : s && z === Set.prototype ? "Set" : i && z === Map.prototype ? "Map" : c && z === WeakSet.prototype ? "WeakSet" : o && z === WeakMap.prototype ? "WeakMap" : l && z === DataView.prototype ? "DataView" : i && z === B ? "Map Iterator" : s && z === Z ? "Set Iterator" : Ue && z === ct ? "Array Iterator" : Pe && z === dt ? "String Iterator" : z === null ? "Object" : Object.prototype.toString.call(R).slice(ut, ft);
|
|
3615
3624
|
}
|
|
3616
|
-
return
|
|
3625
|
+
return ht;
|
|
3617
3626
|
}));
|
|
3618
|
-
})(
|
|
3627
|
+
})(vt)), vt.exports;
|
|
3619
3628
|
}
|
|
3620
|
-
var
|
|
3621
|
-
const
|
|
3629
|
+
var fs = us();
|
|
3630
|
+
const hs = /* @__PURE__ */ cs(fs), mn = typeof Buffer != "undefined", _s = mn && typeof Buffer.from != "undefined", ps = mn ? (
|
|
3622
3631
|
/**
|
|
3623
3632
|
* is value is Buffer?
|
|
3624
3633
|
*
|
|
@@ -3639,7 +3648,7 @@ const gs = /* @__PURE__ */ fs(ps), mn = typeof Buffer != "undefined", ms = mn &&
|
|
|
3639
3648
|
function() {
|
|
3640
3649
|
return !1;
|
|
3641
3650
|
}
|
|
3642
|
-
),
|
|
3651
|
+
), gs = _s ? (
|
|
3643
3652
|
/**
|
|
3644
3653
|
* copy Buffer
|
|
3645
3654
|
*
|
|
@@ -3674,18 +3683,18 @@ const gs = /* @__PURE__ */ fs(ps), mn = typeof Buffer != "undefined", ms = mn &&
|
|
|
3674
3683
|
return t;
|
|
3675
3684
|
}
|
|
3676
3685
|
);
|
|
3677
|
-
function
|
|
3678
|
-
return
|
|
3686
|
+
function Fe(e) {
|
|
3687
|
+
return ps(e) ? "Buffer" : hs(e);
|
|
3679
3688
|
}
|
|
3680
|
-
const
|
|
3689
|
+
const ms = /* @__PURE__ */ new Set([
|
|
3681
3690
|
"Arguments",
|
|
3682
3691
|
"Array",
|
|
3683
3692
|
"Map",
|
|
3684
3693
|
"Object",
|
|
3685
3694
|
"Set"
|
|
3686
3695
|
]);
|
|
3687
|
-
function
|
|
3688
|
-
switch (n ||
|
|
3696
|
+
function ys(e, t, n = null) {
|
|
3697
|
+
switch (n || Fe(e)) {
|
|
3689
3698
|
case "Arguments":
|
|
3690
3699
|
case "Array":
|
|
3691
3700
|
case "Object":
|
|
@@ -3696,11 +3705,11 @@ function ws(e, t, n = null) {
|
|
|
3696
3705
|
return t;
|
|
3697
3706
|
}
|
|
3698
3707
|
}
|
|
3699
|
-
function
|
|
3700
|
-
return
|
|
3708
|
+
function on(e) {
|
|
3709
|
+
return ms.has(e);
|
|
3701
3710
|
}
|
|
3702
|
-
function
|
|
3703
|
-
switch (r ||
|
|
3711
|
+
function Yn(e, t, n, r = null) {
|
|
3712
|
+
switch (r || Fe(e)) {
|
|
3704
3713
|
case "Arguments":
|
|
3705
3714
|
case "Array":
|
|
3706
3715
|
case "Object":
|
|
@@ -3715,59 +3724,59 @@ function Kn(e, t, n, r = null) {
|
|
|
3715
3724
|
}
|
|
3716
3725
|
return e;
|
|
3717
3726
|
}
|
|
3718
|
-
const
|
|
3719
|
-
function
|
|
3727
|
+
const vs = typeof globalThis != "undefined" && globalThis !== null && globalThis.Object === Object && globalThis, bs = typeof global != "undefined" && global !== null && global.Object === Object && global, ws = typeof self != "undefined" && self !== null && self.Object === Object && self, Pt = vs || bs || ws || Function("return this")();
|
|
3728
|
+
function xs(e) {
|
|
3720
3729
|
return e.slice(0);
|
|
3721
3730
|
}
|
|
3722
|
-
function
|
|
3731
|
+
function ks(e) {
|
|
3723
3732
|
return new Boolean(e.valueOf());
|
|
3724
3733
|
}
|
|
3725
|
-
function
|
|
3734
|
+
function Ss(e) {
|
|
3726
3735
|
return new DataView(e.buffer);
|
|
3727
3736
|
}
|
|
3728
|
-
function
|
|
3729
|
-
return
|
|
3737
|
+
function Ts(e) {
|
|
3738
|
+
return gs(e);
|
|
3730
3739
|
}
|
|
3731
|
-
function
|
|
3740
|
+
function Es(e) {
|
|
3732
3741
|
return new Date(e.getTime());
|
|
3733
3742
|
}
|
|
3734
|
-
function
|
|
3743
|
+
function As(e) {
|
|
3735
3744
|
return new Number(e);
|
|
3736
3745
|
}
|
|
3737
|
-
function
|
|
3746
|
+
function Os(e) {
|
|
3738
3747
|
return new RegExp(e.source, e.flags);
|
|
3739
3748
|
}
|
|
3740
|
-
function
|
|
3749
|
+
function Cs(e) {
|
|
3741
3750
|
return new String(e);
|
|
3742
3751
|
}
|
|
3743
3752
|
function ae(e, t) {
|
|
3744
|
-
return
|
|
3753
|
+
return Pt[t].from ? Pt[t].from(e) : new Pt[t](e);
|
|
3745
3754
|
}
|
|
3746
3755
|
function $(e) {
|
|
3747
3756
|
return e;
|
|
3748
3757
|
}
|
|
3749
|
-
function
|
|
3758
|
+
function Jn() {
|
|
3750
3759
|
return [];
|
|
3751
3760
|
}
|
|
3752
|
-
function
|
|
3761
|
+
function Rs() {
|
|
3753
3762
|
return /* @__PURE__ */ new Map();
|
|
3754
3763
|
}
|
|
3755
|
-
function
|
|
3764
|
+
function Ns() {
|
|
3756
3765
|
return {};
|
|
3757
3766
|
}
|
|
3758
|
-
function
|
|
3767
|
+
function Is() {
|
|
3759
3768
|
return /* @__PURE__ */ new Set();
|
|
3760
3769
|
}
|
|
3761
|
-
const
|
|
3770
|
+
const Zs = /* @__PURE__ */ new Map([
|
|
3762
3771
|
// deep copy
|
|
3763
|
-
["ArrayBuffer",
|
|
3764
|
-
["Boolean",
|
|
3765
|
-
["Buffer",
|
|
3766
|
-
["DataView",
|
|
3767
|
-
["Date",
|
|
3768
|
-
["Number",
|
|
3769
|
-
["RegExp",
|
|
3770
|
-
["String",
|
|
3772
|
+
["ArrayBuffer", xs],
|
|
3773
|
+
["Boolean", ks],
|
|
3774
|
+
["Buffer", Ts],
|
|
3775
|
+
["DataView", Ss],
|
|
3776
|
+
["Date", Es],
|
|
3777
|
+
["Number", As],
|
|
3778
|
+
["RegExp", Os],
|
|
3779
|
+
["String", Cs],
|
|
3771
3780
|
// typed arrays
|
|
3772
3781
|
// TODO: pass bound function
|
|
3773
3782
|
["Float32Array", ae],
|
|
@@ -3799,11 +3808,11 @@ const Ds = /* @__PURE__ */ new Map([
|
|
|
3799
3808
|
["undefined", $],
|
|
3800
3809
|
// collections
|
|
3801
3810
|
// NOTE: return empty value, because recursively copy later.
|
|
3802
|
-
["Arguments",
|
|
3803
|
-
["Array",
|
|
3804
|
-
["Map",
|
|
3805
|
-
["Object",
|
|
3806
|
-
["Set",
|
|
3811
|
+
["Arguments", Jn],
|
|
3812
|
+
["Array", Jn],
|
|
3813
|
+
["Map", Rs],
|
|
3814
|
+
["Object", Ns],
|
|
3815
|
+
["Set", Is]
|
|
3807
3816
|
// NOTE: type-detect returns following types
|
|
3808
3817
|
// 'Location'
|
|
3809
3818
|
// 'Document'
|
|
@@ -3815,11 +3824,11 @@ const Ds = /* @__PURE__ */ new Map([
|
|
|
3815
3824
|
// TODO: is type-detect never return 'object'?
|
|
3816
3825
|
// 'object'
|
|
3817
3826
|
]);
|
|
3818
|
-
function
|
|
3827
|
+
function zs() {
|
|
3819
3828
|
}
|
|
3820
|
-
function
|
|
3829
|
+
function ln(e, t = null, n = zs) {
|
|
3821
3830
|
arguments.length === 2 && typeof t == "function" && (n = t, t = null);
|
|
3822
|
-
const r = t ||
|
|
3831
|
+
const r = t || Fe(e), a = Zs.get(r);
|
|
3823
3832
|
if (r === "Object") {
|
|
3824
3833
|
const i = n(e, r);
|
|
3825
3834
|
if (i !== void 0)
|
|
@@ -3827,7 +3836,7 @@ function on(e, t = null, n = $s) {
|
|
|
3827
3836
|
}
|
|
3828
3837
|
return a ? a(e, r) : e;
|
|
3829
3838
|
}
|
|
3830
|
-
function
|
|
3839
|
+
function Qn(e, t = {}) {
|
|
3831
3840
|
typeof t == "function" && (t = {
|
|
3832
3841
|
customizer: t
|
|
3833
3842
|
});
|
|
@@ -3836,15 +3845,15 @@ function Xn(e, t = {}) {
|
|
|
3836
3845
|
customizer: n
|
|
3837
3846
|
// TODO: max depth
|
|
3838
3847
|
// depth = Infinity,
|
|
3839
|
-
} = t, r =
|
|
3840
|
-
if (!
|
|
3841
|
-
return
|
|
3842
|
-
const a =
|
|
3843
|
-
return
|
|
3848
|
+
} = t, r = Fe(e);
|
|
3849
|
+
if (!on(r))
|
|
3850
|
+
return cn(e, null, null, null);
|
|
3851
|
+
const a = ln(e, r, n), i = new WeakMap([[e, a]]), s = new WeakSet([e]);
|
|
3852
|
+
return cn(e, a, i, s);
|
|
3844
3853
|
}
|
|
3845
|
-
function
|
|
3846
|
-
const i =
|
|
3847
|
-
if (!
|
|
3854
|
+
function cn(e, t, n, r, a) {
|
|
3855
|
+
const i = Fe(e), s = ln(e, i);
|
|
3856
|
+
if (!on(i))
|
|
3848
3857
|
return s;
|
|
3849
3858
|
let o;
|
|
3850
3859
|
switch (i) {
|
|
@@ -3861,15 +3870,15 @@ function ln(e, t, n, r, a) {
|
|
|
3861
3870
|
break;
|
|
3862
3871
|
}
|
|
3863
3872
|
for (let c of o) {
|
|
3864
|
-
const l =
|
|
3873
|
+
const l = ys(e, c, i);
|
|
3865
3874
|
if (r.has(l))
|
|
3866
|
-
|
|
3875
|
+
Yn(t, c, n.get(l), i);
|
|
3867
3876
|
else {
|
|
3868
|
-
const h =
|
|
3869
|
-
|
|
3877
|
+
const h = Fe(l), S = ln(l, h);
|
|
3878
|
+
on(h) && (n.set(l, S), r.add(l)), Yn(
|
|
3870
3879
|
t,
|
|
3871
3880
|
c,
|
|
3872
|
-
|
|
3881
|
+
cn(
|
|
3873
3882
|
l,
|
|
3874
3883
|
S,
|
|
3875
3884
|
n,
|
|
@@ -3881,36 +3890,39 @@ function ln(e, t, n, r, a) {
|
|
|
3881
3890
|
}
|
|
3882
3891
|
return t;
|
|
3883
3892
|
}
|
|
3884
|
-
var
|
|
3885
|
-
class
|
|
3893
|
+
var at, Ce, se, q, P, dn, bt, qe;
|
|
3894
|
+
class Ds {
|
|
3886
3895
|
constructor({
|
|
3887
3896
|
fetch: t = globalThis.fetch.bind(globalThis),
|
|
3888
3897
|
baseAddress: n = "https://api.figma.com/",
|
|
3889
3898
|
defaultOptions: r = {}
|
|
3890
3899
|
} = {}) {
|
|
3891
|
-
Y(this,
|
|
3892
|
-
Y(this,
|
|
3900
|
+
Y(this, P);
|
|
3901
|
+
Y(this, at);
|
|
3893
3902
|
Y(this, Ce);
|
|
3894
3903
|
Y(this, se);
|
|
3895
|
-
Y(this,
|
|
3896
|
-
|
|
3904
|
+
Y(this, q);
|
|
3905
|
+
W(this, at, n), W(this, Ce, t), W(this, q, r), W(this, se, w(this, q)), r.token && F(this, P, dn).call(this, r.token);
|
|
3906
|
+
}
|
|
3907
|
+
hasDefaultToken() {
|
|
3908
|
+
return !!w(this, q).token;
|
|
3897
3909
|
}
|
|
3898
3910
|
updateDefaultOptions(t) {
|
|
3899
|
-
t.token &&
|
|
3911
|
+
t.token && F(this, P, dn).call(this, t.token), W(this, q, d(d({}, w(this, q)), t)), W(this, se, w(this, q));
|
|
3900
3912
|
}
|
|
3901
3913
|
withOptions(t) {
|
|
3902
|
-
return
|
|
3914
|
+
return W(this, se, d(d(d({}, w(this, q)), w(this, se)), t)), this;
|
|
3903
3915
|
}
|
|
3904
3916
|
getHeaders(t) {
|
|
3905
3917
|
const n = {
|
|
3906
3918
|
"Content-Type": "application/json"
|
|
3907
|
-
}, r = t != null ? t : w(this,
|
|
3919
|
+
}, r = t != null ? t : w(this, q).token;
|
|
3908
3920
|
if (r != null && r.startsWith("figd_"))
|
|
3909
3921
|
n["X-FIGMA-TOKEN"] = r;
|
|
3910
3922
|
else if (r != null && r.startsWith("figu_"))
|
|
3911
3923
|
n.Authorization = `Bearer ${r}`;
|
|
3912
3924
|
else
|
|
3913
|
-
throw new
|
|
3925
|
+
throw new Ei();
|
|
3914
3926
|
return n;
|
|
3915
3927
|
}
|
|
3916
3928
|
getFile(a) {
|
|
@@ -3925,7 +3937,7 @@ class Fs {
|
|
|
3925
3937
|
});
|
|
3926
3938
|
n.length > 0 && i.append("ids", n.join(",")), r && i.append("depth", `${r}`);
|
|
3927
3939
|
const s = i.toString(), o = `v1/files/${t}?${s}`;
|
|
3928
|
-
return yield
|
|
3940
|
+
return yield F(this, P, qe).call(this, o);
|
|
3929
3941
|
});
|
|
3930
3942
|
}
|
|
3931
3943
|
getNodeImages(s) {
|
|
@@ -3936,20 +3948,20 @@ class Fs {
|
|
|
3936
3948
|
as: a = "arrayBuffer",
|
|
3937
3949
|
format: i = "jpg"
|
|
3938
3950
|
}) {
|
|
3939
|
-
const c = (yield
|
|
3951
|
+
const c = (yield F(this, P, qe).call(this, `v1/images/${t}?ids=${n}&format=${i}&scale=${r}`)).images;
|
|
3940
3952
|
if (a === "links")
|
|
3941
3953
|
return c;
|
|
3942
3954
|
const l = n.map((y) => O(this, null, function* () {
|
|
3943
|
-
const
|
|
3944
|
-
if (!
|
|
3955
|
+
const N = c[y];
|
|
3956
|
+
if (!N)
|
|
3945
3957
|
return null;
|
|
3946
|
-
const Z = yield w(this, Ce).call(this,
|
|
3958
|
+
const Z = yield w(this, Ce).call(this, N);
|
|
3947
3959
|
return Z.ok ? yield Z.arrayBuffer() : null;
|
|
3948
3960
|
})), h = yield Promise.allSettled(l);
|
|
3949
3961
|
return n.reduce(
|
|
3950
|
-
(y,
|
|
3951
|
-
const
|
|
3952
|
-
return
|
|
3962
|
+
(y, N, Z) => {
|
|
3963
|
+
const B = h[Z];
|
|
3964
|
+
return B.status === "fulfilled" ? y[N] = B.value : y[N] = null, y;
|
|
3953
3965
|
},
|
|
3954
3966
|
{}
|
|
3955
3967
|
);
|
|
@@ -3961,14 +3973,19 @@ class Fs {
|
|
|
3961
3973
|
}) {
|
|
3962
3974
|
var i, s;
|
|
3963
3975
|
const r = `v1/files/${t}/images`;
|
|
3964
|
-
return (s = (i = (yield
|
|
3976
|
+
return (s = (i = (yield F(this, P, qe).call(this, r)).meta) == null ? void 0 : i.images) != null ? s : {};
|
|
3977
|
+
});
|
|
3978
|
+
}
|
|
3979
|
+
getMe() {
|
|
3980
|
+
return O(this, null, function* () {
|
|
3981
|
+
return yield F(this, P, qe).call(this, "v1/me");
|
|
3965
3982
|
});
|
|
3966
3983
|
}
|
|
3967
3984
|
}
|
|
3968
|
-
|
|
3985
|
+
at = new WeakMap(), Ce = new WeakMap(), se = new WeakMap(), q = new WeakMap(), P = new WeakSet(), dn = function(t) {
|
|
3969
3986
|
if (!t.startsWith("figd_") && !t.startsWith("figu_"))
|
|
3970
|
-
throw new
|
|
3971
|
-
},
|
|
3987
|
+
throw new Ti();
|
|
3988
|
+
}, bt = function(t, n) {
|
|
3972
3989
|
return O(this, null, function* () {
|
|
3973
3990
|
var a;
|
|
3974
3991
|
const r = yield n();
|
|
@@ -3980,15 +3997,13 @@ rt = new WeakMap(), Ce = new WeakMap(), se = new WeakMap(), X = new WeakMap(), q
|
|
|
3980
3997
|
} catch (o) {
|
|
3981
3998
|
}
|
|
3982
3999
|
if (i === 403)
|
|
3983
|
-
throw new
|
|
3984
|
-
cause: r
|
|
3985
|
-
});
|
|
4000
|
+
throw s != null && s.includes("Invalid token") ? new Rn() : s != null && s.includes("Token expired") ? new Nn() : new In({ reason: s });
|
|
3986
4001
|
if (i === 404)
|
|
3987
|
-
throw new
|
|
4002
|
+
throw new Ai({ cause: r });
|
|
3988
4003
|
if (i === 429) {
|
|
3989
4004
|
const o = r.headers.get("Retry-After"), c = o ? Number(o) : null;
|
|
3990
4005
|
if (!c)
|
|
3991
|
-
throw new
|
|
4006
|
+
throw new Zn({
|
|
3992
4007
|
cause: r
|
|
3993
4008
|
});
|
|
3994
4009
|
if (yield (a = t.onRateLimited) == null ? void 0 : a.call(t, {
|
|
@@ -4001,57 +4016,66 @@ rt = new WeakMap(), Ce = new WeakMap(), se = new WeakMap(), X = new WeakMap(), q
|
|
|
4001
4016
|
)
|
|
4002
4017
|
}))
|
|
4003
4018
|
return new Promise((h, S) => {
|
|
4004
|
-
var
|
|
4019
|
+
var N;
|
|
4005
4020
|
const y = setTimeout(
|
|
4006
4021
|
() => {
|
|
4007
4022
|
var Z;
|
|
4008
|
-
(Z = t.abortSignal) != null && Z.aborted ||
|
|
4023
|
+
(Z = t.abortSignal) != null && Z.aborted || F(this, P, bt).call(this, t, n).then(h).catch(S);
|
|
4009
4024
|
},
|
|
4010
4025
|
c * 1e3 + 1e3
|
|
4011
4026
|
);
|
|
4012
|
-
(
|
|
4027
|
+
(N = t.abortSignal) == null || N.addEventListener("abort", () => {
|
|
4013
4028
|
clearTimeout(y), S(new Error("The operation was aborted."));
|
|
4014
4029
|
});
|
|
4015
4030
|
});
|
|
4016
|
-
throw new
|
|
4017
|
-
} else throw i === 500 && (s != null && s.includes("Request too large")) ? new
|
|
4031
|
+
throw new Zn({ cause: r });
|
|
4032
|
+
} else throw i === 500 && (s != null && s.includes("Request too large")) ? new Ci({ cause: r }) : new Oi({
|
|
4018
4033
|
cause: r
|
|
4019
4034
|
});
|
|
4020
4035
|
}
|
|
4021
4036
|
return r;
|
|
4022
4037
|
});
|
|
4023
|
-
},
|
|
4038
|
+
}, qe = function(t) {
|
|
4024
4039
|
return O(this, null, function* () {
|
|
4025
|
-
const n =
|
|
4026
|
-
|
|
4040
|
+
const n = Qn(w(this, se));
|
|
4041
|
+
W(this, se, Qn(w(this, q)));
|
|
4027
4042
|
const r = () => O(this, null, function* () {
|
|
4028
|
-
return yield w(this, Ce).call(this, `${w(this,
|
|
4043
|
+
return yield w(this, Ce).call(this, `${w(this, at)}${t}`, {
|
|
4029
4044
|
method: "GET",
|
|
4030
4045
|
headers: this.getHeaders(n.token),
|
|
4031
4046
|
signal: n.abortSignal
|
|
4032
4047
|
});
|
|
4033
4048
|
});
|
|
4034
|
-
|
|
4049
|
+
try {
|
|
4050
|
+
return yield (yield F(this, P, bt).call(this, n, r)).json();
|
|
4051
|
+
} catch (a) {
|
|
4052
|
+
if (n.onForbidden && (a instanceof Rn || a instanceof Nn || a instanceof In)) {
|
|
4053
|
+
const i = yield n.onForbidden(a);
|
|
4054
|
+
if (i)
|
|
4055
|
+
return n.token = i.retry.newToken, yield (yield F(this, P, bt).call(this, n, r)).json();
|
|
4056
|
+
}
|
|
4057
|
+
throw a;
|
|
4058
|
+
}
|
|
4035
4059
|
});
|
|
4036
4060
|
};
|
|
4037
|
-
var C,
|
|
4038
|
-
class
|
|
4061
|
+
var C, it, st, le, zr, Ke;
|
|
4062
|
+
class Gs {
|
|
4039
4063
|
constructor({
|
|
4040
4064
|
auth: t,
|
|
4041
4065
|
apiBaseAddress: n = "https://public-api.animaapp.com",
|
|
4042
|
-
figmaRestApi: r = new
|
|
4066
|
+
figmaRestApi: r = new Ds()
|
|
4043
4067
|
} = {}) {
|
|
4044
4068
|
Y(this, le);
|
|
4045
4069
|
Y(this, C);
|
|
4046
|
-
Y(this, at);
|
|
4047
4070
|
Y(this, it);
|
|
4048
|
-
|
|
4071
|
+
Y(this, st);
|
|
4072
|
+
W(this, it, n), W(this, st, r), t && (this.auth = t);
|
|
4049
4073
|
}
|
|
4050
4074
|
hasAuth() {
|
|
4051
4075
|
return !!w(this, C);
|
|
4052
4076
|
}
|
|
4053
4077
|
set auth(t) {
|
|
4054
|
-
|
|
4078
|
+
W(this, C, t);
|
|
4055
4079
|
}
|
|
4056
4080
|
get headers() {
|
|
4057
4081
|
const t = {
|
|
@@ -4064,15 +4088,15 @@ class Xs {
|
|
|
4064
4088
|
var l;
|
|
4065
4089
|
let i;
|
|
4066
4090
|
try {
|
|
4067
|
-
i = yield w(this,
|
|
4091
|
+
i = yield w(this, st).withOptions({ token: t.figmaToken, abortSignal: r }).getFile({
|
|
4068
4092
|
fileKey: t.fileKey
|
|
4069
4093
|
});
|
|
4070
4094
|
} catch (h) {
|
|
4071
4095
|
if (h instanceof Error && h.name === "AbortError")
|
|
4072
4096
|
throw h;
|
|
4073
4097
|
}
|
|
4074
|
-
const s =
|
|
4075
|
-
i && (yield
|
|
4098
|
+
const s = os(t.settings);
|
|
4099
|
+
i && (yield F(this, le, zr).call(this, i, t.nodesId, {
|
|
4076
4100
|
allowAutoSelectFirstNode: (l = s.allowAutoSelectFirstNode) != null ? l : !0
|
|
4077
4101
|
}));
|
|
4078
4102
|
let o = t.tracking;
|
|
@@ -4104,9 +4128,11 @@ class Xs {
|
|
|
4104
4128
|
codegenSettings: s.codegenSettings,
|
|
4105
4129
|
webhookUrl: t.webhookUrl,
|
|
4106
4130
|
prompt: t.prompt,
|
|
4107
|
-
images: t.images
|
|
4131
|
+
images: t.images,
|
|
4132
|
+
// @ts-expect-error: We don't need to expose this parameter to GetCodeParams
|
|
4133
|
+
createSession: t.createSession
|
|
4108
4134
|
};
|
|
4109
|
-
return
|
|
4135
|
+
return F(this, le, Ke).call(this, "/v1/codegen", c, n, "codegen", r);
|
|
4110
4136
|
});
|
|
4111
4137
|
}
|
|
4112
4138
|
generateCodeFromWebsite(a) {
|
|
@@ -4114,7 +4140,13 @@ class Xs {
|
|
|
4114
4140
|
let i = t.tracking;
|
|
4115
4141
|
w(this, C) && "userId" in w(this, C) && w(this, C).userId && (i != null && i.externalId || (i = { externalId: w(this, C).userId }));
|
|
4116
4142
|
let s;
|
|
4117
|
-
if (t.
|
|
4143
|
+
if (t.mhtmlUrl)
|
|
4144
|
+
s = {
|
|
4145
|
+
type: "hosted-mhtml",
|
|
4146
|
+
mhtmlUrl: t.mhtmlUrl,
|
|
4147
|
+
url: t.url
|
|
4148
|
+
};
|
|
4149
|
+
else if (t.mhtml)
|
|
4118
4150
|
s = {
|
|
4119
4151
|
type: "mhtml",
|
|
4120
4152
|
mhtml: t.mhtml,
|
|
@@ -4126,7 +4158,7 @@ class Xs {
|
|
|
4126
4158
|
url: t.url
|
|
4127
4159
|
};
|
|
4128
4160
|
else
|
|
4129
|
-
throw new Error("Either 'url' or '
|
|
4161
|
+
throw new Error("Either 'url', 'mhtml' or 'mhtmlUrl' must be provided");
|
|
4130
4162
|
let o;
|
|
4131
4163
|
t.experimental_useNewReactEngine && (o = "react-v2");
|
|
4132
4164
|
const c = {
|
|
@@ -4147,7 +4179,7 @@ class Xs {
|
|
|
4147
4179
|
engine: o
|
|
4148
4180
|
}
|
|
4149
4181
|
};
|
|
4150
|
-
return
|
|
4182
|
+
return F(this, le, Ke).call(this, "/v1/l2c", c, n, "l2c", r);
|
|
4151
4183
|
});
|
|
4152
4184
|
}
|
|
4153
4185
|
/**
|
|
@@ -4202,7 +4234,7 @@ class Xs {
|
|
|
4202
4234
|
}, (o = t.settings.codegenSettings) != null ? o : {}),
|
|
4203
4235
|
webhookUrl: t.webhookUrl
|
|
4204
4236
|
};
|
|
4205
|
-
return
|
|
4237
|
+
return F(this, le, Ke).call(this, "/v1/p2c", s, n, "p2c", r);
|
|
4206
4238
|
});
|
|
4207
4239
|
}
|
|
4208
4240
|
/**
|
|
@@ -4217,14 +4249,14 @@ class Xs {
|
|
|
4217
4249
|
assetsStorage: t.assetsStorage,
|
|
4218
4250
|
params: t.params
|
|
4219
4251
|
};
|
|
4220
|
-
return
|
|
4252
|
+
return F(this, le, Ke).call(this, "/v1/l2c", s, n, "l2c", r);
|
|
4221
4253
|
});
|
|
4222
4254
|
}
|
|
4223
4255
|
}
|
|
4224
|
-
C = new WeakMap(),
|
|
4256
|
+
C = new WeakMap(), it = new WeakMap(), st = new WeakMap(), le = new WeakSet(), zr = function(t, n, r) {
|
|
4225
4257
|
return O(this, null, function* () {
|
|
4226
4258
|
const i = n.map(
|
|
4227
|
-
(s) =>
|
|
4259
|
+
(s) => ls(t, s, r)
|
|
4228
4260
|
).find(
|
|
4229
4261
|
(s) => !s.isValid
|
|
4230
4262
|
);
|
|
@@ -4234,12 +4266,12 @@ C = new WeakMap(), at = new WeakMap(), it = new WeakMap(), le = new WeakSet(), N
|
|
|
4234
4266
|
reason: i.reason
|
|
4235
4267
|
});
|
|
4236
4268
|
});
|
|
4237
|
-
},
|
|
4269
|
+
}, Ke = function(t, n, r, a, i) {
|
|
4238
4270
|
return O(this, null, function* () {
|
|
4239
|
-
var y,
|
|
4271
|
+
var y, N, Z, B, Ue, ct, Pe, dt, ut, ft, ht;
|
|
4240
4272
|
if (this.hasAuth() === !1)
|
|
4241
4273
|
throw new Error('It needs to set "auth" before calling this method.');
|
|
4242
|
-
const s = {}, o =
|
|
4274
|
+
const s = {}, o = Si(JSON.stringify(n)), c = yield fetch(`${w(this, it)}${t}`, {
|
|
4243
4275
|
method: "POST",
|
|
4244
4276
|
headers: v(d({}, this.headers), {
|
|
4245
4277
|
Accept: "text/event-stream",
|
|
@@ -4251,21 +4283,21 @@ C = new WeakMap(), at = new WeakMap(), it = new WeakMap(), le = new WeakSet(), N
|
|
|
4251
4283
|
});
|
|
4252
4284
|
if (!c.ok) {
|
|
4253
4285
|
const R = yield c.text();
|
|
4254
|
-
let
|
|
4286
|
+
let L;
|
|
4255
4287
|
try {
|
|
4256
|
-
|
|
4288
|
+
L = JSON.parse(R);
|
|
4257
4289
|
} catch (ve) {
|
|
4258
4290
|
}
|
|
4259
|
-
throw ((y =
|
|
4291
|
+
throw ((y = L == null ? void 0 : L.error) == null ? void 0 : y.name) === "ZodError" ? (console.log(
|
|
4260
4292
|
"Zod validation error:",
|
|
4261
|
-
JSON.stringify(
|
|
4293
|
+
JSON.stringify(L.error.issues, null, 2)
|
|
4262
4294
|
), new be({
|
|
4263
4295
|
name: "HTTP error from Anima API",
|
|
4264
4296
|
reason: "Invalid body payload",
|
|
4265
|
-
detail:
|
|
4297
|
+
detail: L.error.issues,
|
|
4266
4298
|
status: c.status
|
|
4267
|
-
})) : typeof
|
|
4268
|
-
name: `Error "${
|
|
4299
|
+
})) : typeof L == "object" ? new be({
|
|
4300
|
+
name: `Error "${L}"`,
|
|
4269
4301
|
reason: "Unknown",
|
|
4270
4302
|
status: c.status
|
|
4271
4303
|
}) : new be({
|
|
@@ -4284,10 +4316,10 @@ C = new WeakMap(), at = new WeakMap(), it = new WeakMap(), le = new WeakSet(), N
|
|
|
4284
4316
|
let S = "";
|
|
4285
4317
|
try {
|
|
4286
4318
|
for (; ; ) {
|
|
4287
|
-
const { done: R, value:
|
|
4319
|
+
const { done: R, value: L } = yield l.read();
|
|
4288
4320
|
if (R)
|
|
4289
4321
|
break;
|
|
4290
|
-
S += h.decode(
|
|
4322
|
+
S += h.decode(L, { stream: !0 });
|
|
4291
4323
|
const ve = S.split(`
|
|
4292
4324
|
`);
|
|
4293
4325
|
S = ve.pop() || "";
|
|
@@ -4296,12 +4328,12 @@ C = new WeakMap(), at = new WeakMap(), it = new WeakMap(), le = new WeakSet(), N
|
|
|
4296
4328
|
let T;
|
|
4297
4329
|
try {
|
|
4298
4330
|
T = JSON.parse(z.slice(6));
|
|
4299
|
-
} catch (
|
|
4331
|
+
} catch (Bs) {
|
|
4300
4332
|
continue;
|
|
4301
4333
|
}
|
|
4302
4334
|
switch (T.type) {
|
|
4303
4335
|
case "queueing": {
|
|
4304
|
-
typeof r == "function" ? r(T) : (
|
|
4336
|
+
typeof r == "function" ? r(T) : (N = r.onQueueing) == null || N.call(r, {
|
|
4305
4337
|
sessionId: T.sessionId
|
|
4306
4338
|
});
|
|
4307
4339
|
break;
|
|
@@ -4311,7 +4343,7 @@ C = new WeakMap(), at = new WeakMap(), it = new WeakMap(), le = new WeakSet(), N
|
|
|
4311
4343
|
break;
|
|
4312
4344
|
}
|
|
4313
4345
|
case "pre_codegen": {
|
|
4314
|
-
a === "codegen" && (typeof r == "function" ? r(T) : (
|
|
4346
|
+
a === "codegen" && (typeof r == "function" ? r(T) : (B = r.onPreCodegen) == null || B.call(r, {
|
|
4315
4347
|
message: T.message
|
|
4316
4348
|
}));
|
|
4317
4349
|
break;
|
|
@@ -4321,7 +4353,7 @@ C = new WeakMap(), at = new WeakMap(), it = new WeakMap(), le = new WeakSet(), N
|
|
|
4321
4353
|
break;
|
|
4322
4354
|
}
|
|
4323
4355
|
case "assets_list": {
|
|
4324
|
-
s.assets = T.payload.assets, typeof r == "function" ? r(T) : (
|
|
4356
|
+
s.assets = T.payload.assets, typeof r == "function" ? r(T) : (ct = r.onAssetsList) == null || ct.call(r, T.payload);
|
|
4325
4357
|
break;
|
|
4326
4358
|
}
|
|
4327
4359
|
case "figma_metadata": {
|
|
@@ -4332,7 +4364,7 @@ C = new WeakMap(), at = new WeakMap(), it = new WeakMap(), le = new WeakSet(), N
|
|
|
4332
4364
|
break;
|
|
4333
4365
|
}
|
|
4334
4366
|
case "generating_code": {
|
|
4335
|
-
T.payload.status === "success" && (s.files = T.payload.files), typeof r == "function" ? r(T) : (
|
|
4367
|
+
T.payload.status === "success" && (s.files = T.payload.files), typeof r == "function" ? r(T) : (dt = r.onGeneratingCode) == null || dt.call(r, {
|
|
4336
4368
|
status: T.payload.status,
|
|
4337
4369
|
progress: T.payload.progress,
|
|
4338
4370
|
files: T.payload.files
|
|
@@ -4340,19 +4372,19 @@ C = new WeakMap(), at = new WeakMap(), it = new WeakMap(), le = new WeakSet(), N
|
|
|
4340
4372
|
break;
|
|
4341
4373
|
}
|
|
4342
4374
|
case "progress_messages_updated": {
|
|
4343
|
-
typeof r == "function" ? r(T) : (
|
|
4375
|
+
typeof r == "function" ? r(T) : (ut = r.onProgressMessagesUpdated) == null || ut.call(
|
|
4344
4376
|
r,
|
|
4345
4377
|
T.payload.progressMessages
|
|
4346
4378
|
);
|
|
4347
4379
|
break;
|
|
4348
4380
|
}
|
|
4349
4381
|
case "job_status_updated": {
|
|
4350
|
-
typeof r == "function" ? r(T) : (
|
|
4382
|
+
typeof r == "function" ? r(T) : (ft = r.onJobStatusUpdated) == null || ft.call(r, T.payload.jobStatus);
|
|
4351
4383
|
break;
|
|
4352
4384
|
}
|
|
4353
4385
|
case "codegen_completed":
|
|
4354
4386
|
case "generation_completed": {
|
|
4355
|
-
typeof r == "function" ? r(T) : (
|
|
4387
|
+
typeof r == "function" ? r(T) : (ht = r.onCodegenCompleted) == null || ht.call(r);
|
|
4356
4388
|
break;
|
|
4357
4389
|
}
|
|
4358
4390
|
case "error":
|
|
@@ -4375,7 +4407,7 @@ C = new WeakMap(), at = new WeakMap(), it = new WeakMap(), le = new WeakSet(), N
|
|
|
4375
4407
|
});
|
|
4376
4408
|
});
|
|
4377
4409
|
};
|
|
4378
|
-
const
|
|
4410
|
+
const Xs = (e) => {
|
|
4379
4411
|
var t;
|
|
4380
4412
|
if (!e)
|
|
4381
4413
|
return [!1, "", ""];
|
|
@@ -4391,7 +4423,7 @@ const Ys = (e) => {
|
|
|
4391
4423
|
} catch (n) {
|
|
4392
4424
|
return [!1, "", ""];
|
|
4393
4425
|
}
|
|
4394
|
-
},
|
|
4426
|
+
}, Ys = ({
|
|
4395
4427
|
fileKey: e,
|
|
4396
4428
|
nodeId: t,
|
|
4397
4429
|
duplicate: n
|
|
@@ -4399,12 +4431,12 @@ const Ys = (e) => {
|
|
|
4399
4431
|
const r = new URL("https://www.figma.com");
|
|
4400
4432
|
return r.pathname = `design/${e}`, n && (r.pathname = `${r.pathname}/dummy/duplicate`), t && r.searchParams.set("node-id", t.replace(":", "-")), r;
|
|
4401
4433
|
};
|
|
4402
|
-
class
|
|
4434
|
+
class Js extends Error {
|
|
4403
4435
|
constructor(t, n) {
|
|
4404
4436
|
super(t), this.response = n;
|
|
4405
4437
|
}
|
|
4406
4438
|
}
|
|
4407
|
-
const
|
|
4439
|
+
const Qs = ({
|
|
4408
4440
|
files: e,
|
|
4409
4441
|
screenPath: t = "src/screens"
|
|
4410
4442
|
}) => {
|
|
@@ -4412,12 +4444,12 @@ const eo = ({
|
|
|
4412
4444
|
function a(i) {
|
|
4413
4445
|
if (r.has(i) || !e[i])
|
|
4414
4446
|
return;
|
|
4415
|
-
r.add(i), n[i] = e[i],
|
|
4447
|
+
r.add(i), n[i] = e[i], Ls(e[i].content).forEach((o) => {
|
|
4416
4448
|
try {
|
|
4417
|
-
const c =
|
|
4449
|
+
const c = Fs(i, o);
|
|
4418
4450
|
if (c.startsWith("src/")) {
|
|
4419
4451
|
const l = c.split("/").slice(0, -1).join("/");
|
|
4420
|
-
|
|
4452
|
+
$s(e, l).forEach((S) => {
|
|
4421
4453
|
r.has(S) || a(S);
|
|
4422
4454
|
});
|
|
4423
4455
|
}
|
|
@@ -4433,7 +4465,7 @@ const eo = ({
|
|
|
4433
4465
|
i.startsWith(t) ? a(i) : i.startsWith("src/") || (n[i] = s);
|
|
4434
4466
|
}), n;
|
|
4435
4467
|
};
|
|
4436
|
-
function
|
|
4468
|
+
function Ls(e) {
|
|
4437
4469
|
const t = /import.*?["']([^"']+)["']/g, n = /export.*from\s+["']([^"']+)["']/g, r = [];
|
|
4438
4470
|
let a;
|
|
4439
4471
|
for (; (a = t.exec(e)) !== null; )
|
|
@@ -4442,7 +4474,7 @@ function js(e) {
|
|
|
4442
4474
|
r.push(a[1]);
|
|
4443
4475
|
return [...new Set(r)];
|
|
4444
4476
|
}
|
|
4445
|
-
function
|
|
4477
|
+
function Fs(e, t) {
|
|
4446
4478
|
if (!t.startsWith("."))
|
|
4447
4479
|
return t;
|
|
4448
4480
|
const n = e.split("/").slice(0, -1), r = t.split("/"), a = [...n];
|
|
@@ -4450,7 +4482,7 @@ function Ms(e, t) {
|
|
|
4450
4482
|
i === ".." ? a.pop() : i !== "." && a.push(i);
|
|
4451
4483
|
return a.join("/");
|
|
4452
4484
|
}
|
|
4453
|
-
function
|
|
4485
|
+
function $s(e, t) {
|
|
4454
4486
|
return Object.keys(e).filter((n) => n.startsWith(t));
|
|
4455
4487
|
}
|
|
4456
4488
|
function It(e, t, n) {
|
|
@@ -4481,8 +4513,8 @@ function It(e, t, n) {
|
|
|
4481
4513
|
}
|
|
4482
4514
|
});
|
|
4483
4515
|
}
|
|
4484
|
-
const
|
|
4485
|
-
function
|
|
4516
|
+
const js = (e, t) => It(e, t, e.generateCode);
|
|
4517
|
+
function Zt(e) {
|
|
4486
4518
|
return O(this, null, function* () {
|
|
4487
4519
|
var s, o, c, l;
|
|
4488
4520
|
const [t, n] = e.tee(), r = yield t.getReader().read();
|
|
@@ -4516,50 +4548,50 @@ data: ${JSON.stringify(
|
|
|
4516
4548
|
});
|
|
4517
4549
|
});
|
|
4518
4550
|
}
|
|
4519
|
-
const
|
|
4551
|
+
const eo = (e, t) => O(null, null, function* () {
|
|
4552
|
+
const n = js(e, t);
|
|
4553
|
+
return Zt(n);
|
|
4554
|
+
}), Ms = (e, t) => It(e, t, e.generateCodeFromWebsite), to = (e, t) => O(null, null, function* () {
|
|
4555
|
+
const n = Ms(e, t);
|
|
4556
|
+
return Zt(n);
|
|
4557
|
+
}), Us = (e, t) => It(e, t, e.generateCodeFromPrompt), no = (e, t) => O(null, null, function* () {
|
|
4558
|
+
const n = Us(e, t);
|
|
4559
|
+
return Zt(n);
|
|
4560
|
+
}), Ps = (e, t) => It(e, t, e.generateLink2Code), ro = (e, t) => O(null, null, function* () {
|
|
4520
4561
|
const n = Ps(e, t);
|
|
4521
|
-
return
|
|
4522
|
-
}), Bs = (e, t) => It(e, t, e.generateCodeFromWebsite), no = (e, t) => O(null, null, function* () {
|
|
4523
|
-
const n = Bs(e, t);
|
|
4524
|
-
return Nt(n);
|
|
4525
|
-
}), Vs = (e, t) => It(e, t, e.generateCodeFromPrompt), ro = (e, t) => O(null, null, function* () {
|
|
4526
|
-
const n = Vs(e, t);
|
|
4527
|
-
return Nt(n);
|
|
4528
|
-
}), Hs = (e, t) => It(e, t, e.generateLink2Code), ao = (e, t) => O(null, null, function* () {
|
|
4529
|
-
const n = Hs(e, t);
|
|
4530
|
-
return Nt(n);
|
|
4562
|
+
return Zt(n);
|
|
4531
4563
|
});
|
|
4532
4564
|
export {
|
|
4533
|
-
|
|
4565
|
+
Gs as Anima,
|
|
4534
4566
|
be as CodegenError,
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
no as
|
|
4547
|
-
|
|
4548
|
-
to as
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4567
|
+
Nn as ExpiredFigmaToken,
|
|
4568
|
+
Ds as FigmaRestApi,
|
|
4569
|
+
Ti as MalformattedFigmaToken,
|
|
4570
|
+
Ei as MissingFigmaToken,
|
|
4571
|
+
Rn as NeedsReauthFigmaToken,
|
|
4572
|
+
Ai as NotFound,
|
|
4573
|
+
Zn as RateLimitExceeded,
|
|
4574
|
+
Ci as RequestTooLarge,
|
|
4575
|
+
Js as ResponseError,
|
|
4576
|
+
Oi as UnknownFigmaApiException,
|
|
4577
|
+
In as UnknownForbiddenFigmaError,
|
|
4578
|
+
no as createCodeFromPromptResponseEventStream,
|
|
4579
|
+
Us as createCodeFromPromptStream,
|
|
4580
|
+
to as createCodeFromWebsiteResponseEventStream,
|
|
4581
|
+
Ms as createCodeFromWebsiteStream,
|
|
4582
|
+
eo as createCodegenResponseEventStream,
|
|
4583
|
+
js as createCodegenStream,
|
|
4584
|
+
ro as createLink2CodeResponseEventStream,
|
|
4585
|
+
Ps as createLink2CodeStream,
|
|
4586
|
+
Zr as findChildrenNode,
|
|
4587
|
+
Ys as formatToFigmaLink,
|
|
4588
|
+
Qs as getRelatedScreenFiles,
|
|
4589
|
+
ls as isNodeCodegenCompatible,
|
|
4590
|
+
Hs as isNotFound,
|
|
4591
|
+
qs as isRateLimitExceeded,
|
|
4592
|
+
Ks as isRequestTooLarge,
|
|
4593
|
+
Ws as isUnknownFigmaApiException,
|
|
4594
|
+
Xs as isValidFigmaUrl,
|
|
4595
|
+
os as validateSettings
|
|
4564
4596
|
};
|
|
4565
4597
|
//# sourceMappingURL=index.js.map
|