@arenarium/maps 1.0.178 → 1.0.180
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -2
- package/dist/main.cjs.js +2 -2
- package/dist/main.es.js +906 -905
- package/package.json +1 -1
package/dist/main.es.js
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
var
|
|
1
|
+
var xs = Object.defineProperty;
|
|
2
2
|
var Qr = (r) => {
|
|
3
3
|
throw TypeError(r);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var h = (r, e, t) =>
|
|
7
|
-
var k = (r, e, t) => (Kt(r, e, "read from private field"), t ? t.call(r) : e.get(r)), P = (r, e, t) => e.has(r) ? Qr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), Z = (r, e, t,
|
|
8
|
-
import { R as Qt, M as Tt, g as
|
|
9
|
-
const
|
|
10
|
-
var
|
|
11
|
-
function
|
|
5
|
+
var bs = (r, e, t) => e in r ? xs(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
6
|
+
var h = (r, e, t) => bs(r, typeof e != "symbol" ? e + "" : e, t), Kt = (r, e, t) => e.has(r) || Qr("Cannot " + t);
|
|
7
|
+
var k = (r, e, t) => (Kt(r, e, "read from private field"), t ? t.call(r) : e.get(r)), P = (r, e, t) => e.has(r) ? Qr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), Z = (r, e, t, n) => (Kt(r, e, "write to private field"), n ? n.call(r, t) : e.set(r, t), t), ot = (r, e, t) => (Kt(r, e, "access private method"), t);
|
|
8
|
+
import { R as Qt, M as Tt, g as Es, A as ct } from "./states-CxxqUf8M.js";
|
|
9
|
+
const en = !1;
|
|
10
|
+
var Mn = Array.isArray, Cs = Array.prototype.indexOf, Ss = Array.from, ar = Object.defineProperty, ft = Object.getOwnPropertyDescriptor, Ts = Object.prototype, As = Array.prototype, Ms = Object.getPrototypeOf, tn = Object.isExtensible;
|
|
11
|
+
function Os(r) {
|
|
12
12
|
for (var e = 0; e < r.length; e++)
|
|
13
13
|
r[e]();
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
var r, e, t = new Promise((
|
|
17
|
-
r =
|
|
15
|
+
function Ns() {
|
|
16
|
+
var r, e, t = new Promise((n, s) => {
|
|
17
|
+
r = n, e = s;
|
|
18
18
|
});
|
|
19
19
|
return { promise: t, resolve: r, reject: e };
|
|
20
20
|
}
|
|
21
|
-
const H = 2, Nr = 4,
|
|
21
|
+
const H = 2, Nr = 4, On = 8, Yt = 16, Ce = 32, rt = 64, Nn = 128, X = 256, Rt = 512, z = 1024, ee = 2048, De = 4096, He = 8192, nt = 16384, Ir = 32768, Is = 65536, rn = 1 << 17, Rs = 1 << 18, Rr = 1 << 19, In = 1 << 20, ir = 1 << 21, Lr = 1 << 22, Me = 1 << 23, Ot = Symbol("$state"), Dr = new class extends Error {
|
|
22
22
|
constructor() {
|
|
23
23
|
super(...arguments);
|
|
24
24
|
h(this, "name", "StaleReactionError");
|
|
25
25
|
h(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
|
|
26
26
|
}
|
|
27
27
|
}();
|
|
28
|
-
function
|
|
28
|
+
function Ls() {
|
|
29
29
|
throw new Error("https://svelte.dev/e/await_outside_boundary");
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Ds() {
|
|
32
32
|
throw new Error("https://svelte.dev/e/async_derived_orphan");
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function Ps(r) {
|
|
35
35
|
throw new Error("https://svelte.dev/e/effect_in_teardown");
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function Zs() {
|
|
38
38
|
throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function js(r) {
|
|
41
41
|
throw new Error("https://svelte.dev/e/effect_orphan");
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function Fs() {
|
|
44
44
|
throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function zs() {
|
|
47
47
|
throw new Error("https://svelte.dev/e/state_descriptors_fixed");
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function Vs() {
|
|
50
50
|
throw new Error("https://svelte.dev/e/state_prototype_fixed");
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function Bs() {
|
|
53
53
|
throw new Error("https://svelte.dev/e/state_unsafe_mutation");
|
|
54
54
|
}
|
|
55
|
-
const
|
|
56
|
-
function
|
|
55
|
+
const Us = 2, j = Symbol();
|
|
56
|
+
function Rn(r) {
|
|
57
57
|
return r === this.v;
|
|
58
58
|
}
|
|
59
|
-
let $
|
|
59
|
+
let $s = !1, ne = null;
|
|
60
60
|
function Lt(r) {
|
|
61
|
-
|
|
61
|
+
ne = r;
|
|
62
62
|
}
|
|
63
63
|
function Pr(r, e = !1, t) {
|
|
64
|
-
|
|
65
|
-
p:
|
|
64
|
+
ne = {
|
|
65
|
+
p: ne,
|
|
66
66
|
c: null,
|
|
67
67
|
e: null,
|
|
68
68
|
s: r,
|
|
@@ -73,34 +73,34 @@ function Pr(r, e = !1, t) {
|
|
|
73
73
|
function Zr(r) {
|
|
74
74
|
var e = (
|
|
75
75
|
/** @type {ComponentContext} */
|
|
76
|
-
|
|
76
|
+
ne
|
|
77
77
|
), t = e.e;
|
|
78
78
|
if (t !== null) {
|
|
79
79
|
e.e = null;
|
|
80
|
-
for (var
|
|
81
|
-
|
|
80
|
+
for (var n of t)
|
|
81
|
+
Xn(n);
|
|
82
82
|
}
|
|
83
|
-
return r !== void 0 && (e.x = r),
|
|
83
|
+
return r !== void 0 && (e.x = r), ne = e.p, r ?? /** @type {T} */
|
|
84
84
|
{};
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function Ln() {
|
|
87
87
|
return !0;
|
|
88
88
|
}
|
|
89
|
-
const
|
|
90
|
-
function
|
|
89
|
+
const qs = /* @__PURE__ */ new WeakMap();
|
|
90
|
+
function Ws(r) {
|
|
91
91
|
var e = M;
|
|
92
92
|
if (e === null)
|
|
93
93
|
return C.f |= Me, r;
|
|
94
94
|
if ((e.f & Ir) === 0) {
|
|
95
|
-
if ((e.f &
|
|
96
|
-
throw !e.parent && r instanceof Error &&
|
|
95
|
+
if ((e.f & Nn) === 0)
|
|
96
|
+
throw !e.parent && r instanceof Error && Dn(r), r;
|
|
97
97
|
e.b.error(r);
|
|
98
98
|
} else
|
|
99
99
|
jr(r, e);
|
|
100
100
|
}
|
|
101
101
|
function jr(r, e) {
|
|
102
102
|
for (; e !== null; ) {
|
|
103
|
-
if ((e.f &
|
|
103
|
+
if ((e.f & Nn) !== 0)
|
|
104
104
|
try {
|
|
105
105
|
e.b.error(r);
|
|
106
106
|
return;
|
|
@@ -108,10 +108,10 @@ function jr(r, e) {
|
|
|
108
108
|
}
|
|
109
109
|
e = e.parent;
|
|
110
110
|
}
|
|
111
|
-
throw r instanceof Error &&
|
|
111
|
+
throw r instanceof Error && Dn(r), r;
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
const e =
|
|
113
|
+
function Dn(r) {
|
|
114
|
+
const e = qs.get(r);
|
|
115
115
|
e && (ar(r, "message", {
|
|
116
116
|
value: e.message
|
|
117
117
|
}), ar(r, "stack", {
|
|
@@ -119,32 +119,32 @@ function Ls(r) {
|
|
|
119
119
|
}));
|
|
120
120
|
}
|
|
121
121
|
let Dt = [];
|
|
122
|
-
function
|
|
122
|
+
function Ys() {
|
|
123
123
|
var r = Dt;
|
|
124
|
-
Dt = [],
|
|
124
|
+
Dt = [], Os(r);
|
|
125
125
|
}
|
|
126
|
-
function
|
|
127
|
-
Dt.length === 0 && queueMicrotask(
|
|
126
|
+
function Xs(r) {
|
|
127
|
+
Dt.length === 0 && queueMicrotask(Ys), Dt.push(r);
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function Hs() {
|
|
130
130
|
for (var r = (
|
|
131
131
|
/** @type {Effect} */
|
|
132
132
|
M.b
|
|
133
133
|
); r !== null && !r.has_pending_snippet(); )
|
|
134
134
|
r = r.parent;
|
|
135
|
-
return r === null &&
|
|
135
|
+
return r === null && Ls(), r;
|
|
136
136
|
}
|
|
137
137
|
// @__NO_SIDE_EFFECTS__
|
|
138
|
-
function
|
|
138
|
+
function Js(r) {
|
|
139
139
|
var e = H | ee, t = C !== null && (C.f & H) !== 0 ? (
|
|
140
140
|
/** @type {Derived} */
|
|
141
141
|
C
|
|
142
142
|
) : null;
|
|
143
143
|
return M === null || t !== null && (t.f & X) !== 0 ? e |= X : M.f |= Rr, {
|
|
144
|
-
ctx:
|
|
144
|
+
ctx: ne,
|
|
145
145
|
deps: null,
|
|
146
146
|
effects: null,
|
|
147
|
-
equals:
|
|
147
|
+
equals: Rn,
|
|
148
148
|
f: e,
|
|
149
149
|
fn: r,
|
|
150
150
|
reactions: null,
|
|
@@ -159,20 +159,20 @@ function Jn(r) {
|
|
|
159
159
|
};
|
|
160
160
|
}
|
|
161
161
|
// @__NO_SIDE_EFFECTS__
|
|
162
|
-
function
|
|
162
|
+
function Gs(r, e) {
|
|
163
163
|
let t = (
|
|
164
164
|
/** @type {Effect | null} */
|
|
165
165
|
M
|
|
166
166
|
);
|
|
167
|
-
t === null &&
|
|
168
|
-
var
|
|
167
|
+
t === null && Ds();
|
|
168
|
+
var n = (
|
|
169
169
|
/** @type {Boundary} */
|
|
170
170
|
t.b
|
|
171
|
-
),
|
|
171
|
+
), s = (
|
|
172
172
|
/** @type {Promise<V>} */
|
|
173
173
|
/** @type {unknown} */
|
|
174
174
|
void 0
|
|
175
|
-
), a =
|
|
175
|
+
), a = Vn(
|
|
176
176
|
/** @type {V} */
|
|
177
177
|
j
|
|
178
178
|
), i = null, o = !C;
|
|
@@ -183,30 +183,30 @@ function Gn(r, e) {
|
|
|
183
183
|
l = Promise.reject(v);
|
|
184
184
|
}
|
|
185
185
|
var u = () => l;
|
|
186
|
-
|
|
186
|
+
s = (i == null ? void 0 : i.then(u, u)) ?? Promise.resolve(l), i = s;
|
|
187
187
|
var d = (
|
|
188
188
|
/** @type {Batch} */
|
|
189
189
|
re
|
|
190
|
-
), f =
|
|
191
|
-
o && (
|
|
190
|
+
), f = n.pending;
|
|
191
|
+
o && (n.update_pending_count(1), f || d.increment());
|
|
192
192
|
const p = (v, x = void 0) => {
|
|
193
|
-
i = null, f || d.activate(), x ? x !== Dr && (a.f |= Me, ur(a, x)) : ((a.f & Me) !== 0 && (a.f ^= Me), ur(a, v)), o && (
|
|
193
|
+
i = null, f || d.activate(), x ? x !== Dr && (a.f |= Me, ur(a, x)) : ((a.f & Me) !== 0 && (a.f ^= Me), ur(a, v)), o && (n.update_pending_count(-1), f || d.decrement()), jn();
|
|
194
194
|
};
|
|
195
|
-
if (
|
|
195
|
+
if (s.then(p, (v) => p(null, v || "unknown")), d)
|
|
196
196
|
return () => {
|
|
197
197
|
queueMicrotask(() => d.neuter());
|
|
198
198
|
};
|
|
199
199
|
}), new Promise((l) => {
|
|
200
200
|
function u(d) {
|
|
201
201
|
function f() {
|
|
202
|
-
d ===
|
|
202
|
+
d === s ? l(a) : u(s);
|
|
203
203
|
}
|
|
204
204
|
d.then(f, f);
|
|
205
205
|
}
|
|
206
|
-
u(
|
|
206
|
+
u(s);
|
|
207
207
|
});
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function Pn(r) {
|
|
210
210
|
var e = r.effects;
|
|
211
211
|
if (e !== null) {
|
|
212
212
|
r.effects = null;
|
|
@@ -217,7 +217,7 @@ function Ds(r) {
|
|
|
217
217
|
);
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function Ks(r) {
|
|
221
221
|
for (var e = r.parent; e !== null; ) {
|
|
222
222
|
if ((e.f & H) === 0)
|
|
223
223
|
return (
|
|
@@ -230,17 +230,17 @@ function Kn(r) {
|
|
|
230
230
|
}
|
|
231
231
|
function Fr(r) {
|
|
232
232
|
var e, t = M;
|
|
233
|
-
Je(
|
|
233
|
+
Je(Ks(r));
|
|
234
234
|
try {
|
|
235
|
-
|
|
235
|
+
Pn(r), e = ns(r);
|
|
236
236
|
} finally {
|
|
237
237
|
Je(t);
|
|
238
238
|
}
|
|
239
239
|
return e;
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function Zn(r) {
|
|
242
242
|
var e = Fr(r);
|
|
243
|
-
if (r.equals(e) || (r.v = e, r.wv =
|
|
243
|
+
if (r.equals(e) || (r.v = e, r.wv = ts()), !st)
|
|
244
244
|
if (_e !== null)
|
|
245
245
|
_e.set(r, r.v);
|
|
246
246
|
else {
|
|
@@ -248,41 +248,41 @@ function Ps(r) {
|
|
|
248
248
|
U(r, t);
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
|
-
function
|
|
252
|
-
const
|
|
251
|
+
function Qs(r, e, t) {
|
|
252
|
+
const n = Js;
|
|
253
253
|
if (e.length === 0) {
|
|
254
|
-
t(r.map(
|
|
254
|
+
t(r.map(n));
|
|
255
255
|
return;
|
|
256
256
|
}
|
|
257
|
-
var
|
|
257
|
+
var s = re, a = (
|
|
258
258
|
/** @type {Effect} */
|
|
259
259
|
M
|
|
260
|
-
), i = ea(), o =
|
|
261
|
-
Promise.all(e.map((l) => /* @__PURE__ */
|
|
262
|
-
|
|
260
|
+
), i = ea(), o = Hs();
|
|
261
|
+
Promise.all(e.map((l) => /* @__PURE__ */ Gs(l))).then((l) => {
|
|
262
|
+
s == null || s.activate(), i();
|
|
263
263
|
try {
|
|
264
|
-
t([...r.map(
|
|
264
|
+
t([...r.map(n), ...l]);
|
|
265
265
|
} catch (u) {
|
|
266
|
-
(a.f &
|
|
266
|
+
(a.f & nt) === 0 && jr(u, a);
|
|
267
267
|
}
|
|
268
|
-
|
|
268
|
+
s == null || s.deactivate(), jn();
|
|
269
269
|
}).catch((l) => {
|
|
270
270
|
o.error(l);
|
|
271
271
|
});
|
|
272
272
|
}
|
|
273
273
|
function ea() {
|
|
274
|
-
var r = M, e = C, t =
|
|
274
|
+
var r = M, e = C, t = ne;
|
|
275
275
|
return function() {
|
|
276
276
|
Je(r), xe(e), Lt(t);
|
|
277
277
|
};
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function jn() {
|
|
280
280
|
Je(null), xe(null), Lt(null);
|
|
281
281
|
}
|
|
282
282
|
const At = /* @__PURE__ */ new Set();
|
|
283
283
|
let re = null, _e = null;
|
|
284
284
|
let lt = [], Pt = null, or = !1;
|
|
285
|
-
var wt, qe, We, ve, kt, xt, Se, Ye, ge, de, Te, he,
|
|
285
|
+
var wt, qe, We, ve, kt, xt, Se, Ye, ge, de, Te, he, Fn, zn, lr;
|
|
286
286
|
const qr = class qr {
|
|
287
287
|
constructor() {
|
|
288
288
|
P(this, he);
|
|
@@ -382,10 +382,10 @@ const qr = class qr {
|
|
|
382
382
|
or = !0;
|
|
383
383
|
try {
|
|
384
384
|
var t = 0;
|
|
385
|
-
for (
|
|
386
|
-
t++ > 1e3 && ta(), ot(this, he,
|
|
385
|
+
for (an(!0); lt.length > 0; )
|
|
386
|
+
t++ > 1e3 && ta(), ot(this, he, Fn).call(this, lt), Ne.clear();
|
|
387
387
|
} finally {
|
|
388
|
-
or = !1,
|
|
388
|
+
or = !1, an(e), Pt = null;
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
391
|
increment() {
|
|
@@ -407,7 +407,7 @@ const qr = class qr {
|
|
|
407
407
|
k(this, We).add(e);
|
|
408
408
|
}
|
|
409
409
|
settled() {
|
|
410
|
-
return (k(this, kt) ?? Z(this, kt,
|
|
410
|
+
return (k(this, kt) ?? Z(this, kt, Ns())).promise;
|
|
411
411
|
}
|
|
412
412
|
static ensure() {
|
|
413
413
|
if (re === null) {
|
|
@@ -423,7 +423,7 @@ wt = new WeakMap(), qe = new WeakMap(), We = new WeakMap(), ve = new WeakMap(),
|
|
|
423
423
|
*
|
|
424
424
|
* @param {Effect[]} root_effects
|
|
425
425
|
*/
|
|
426
|
-
|
|
426
|
+
Fn = function(e) {
|
|
427
427
|
var a;
|
|
428
428
|
lt = [];
|
|
429
429
|
var t = null;
|
|
@@ -437,10 +437,10 @@ js = function(e) {
|
|
|
437
437
|
t.has(o) || (t.set(o, { v: o.v, wv: o.wv }), o.v = l);
|
|
438
438
|
}
|
|
439
439
|
for (const i of e)
|
|
440
|
-
ot(this, he,
|
|
440
|
+
ot(this, he, zn).call(this, i);
|
|
441
441
|
if (k(this, Se).length === 0 && k(this, ve) === 0) {
|
|
442
|
-
var
|
|
443
|
-
Z(this, ge, []), Z(this, de, []), Z(this, Te, []), ot(this, he, lr).call(this),
|
|
442
|
+
var n = k(this, ge), s = k(this, de);
|
|
443
|
+
Z(this, ge, []), Z(this, de, []), Z(this, Te, []), ot(this, he, lr).call(this), nn(n), nn(s), (a = k(this, kt)) == null || a.resolve();
|
|
444
444
|
} else {
|
|
445
445
|
for (const i of k(this, ge)) U(i, z);
|
|
446
446
|
for (const i of k(this, de)) U(i, z);
|
|
@@ -461,18 +461,18 @@ js = function(e) {
|
|
|
461
461
|
* them for later execution as appropriate
|
|
462
462
|
* @param {Effect} root
|
|
463
463
|
*/
|
|
464
|
-
|
|
464
|
+
zn = function(e) {
|
|
465
465
|
var d;
|
|
466
466
|
e.f ^= z;
|
|
467
467
|
for (var t = e.first; t !== null; ) {
|
|
468
|
-
var
|
|
468
|
+
var n = t.f, s = (n & (Ce | rt)) !== 0, a = s && (n & z) !== 0, i = a || (n & He) !== 0 || this.skipped_effects.has(t);
|
|
469
469
|
if (!i && t.fn !== null) {
|
|
470
|
-
if (
|
|
470
|
+
if (s)
|
|
471
471
|
t.f ^= z;
|
|
472
|
-
else if ((
|
|
472
|
+
else if ((n & Nr) !== 0)
|
|
473
473
|
k(this, de).push(t);
|
|
474
474
|
else if (Xt(t))
|
|
475
|
-
if ((
|
|
475
|
+
if ((n & Lr) !== 0) {
|
|
476
476
|
var o = (d = t.b) != null && d.pending ? k(this, Ye) : k(this, Se);
|
|
477
477
|
o.push(t);
|
|
478
478
|
} else
|
|
@@ -499,7 +499,7 @@ lr = function() {
|
|
|
499
499
|
let Zt = qr;
|
|
500
500
|
function ta() {
|
|
501
501
|
try {
|
|
502
|
-
|
|
502
|
+
Fs();
|
|
503
503
|
} catch (r) {
|
|
504
504
|
if (Pt !== null)
|
|
505
505
|
jr(r, Pt);
|
|
@@ -507,14 +507,14 @@ function ta() {
|
|
|
507
507
|
throw r;
|
|
508
508
|
}
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function nn(r) {
|
|
511
511
|
var e = r.length;
|
|
512
512
|
if (e !== 0) {
|
|
513
513
|
for (var t = 0; t < e; t++) {
|
|
514
|
-
var
|
|
515
|
-
if ((
|
|
516
|
-
var
|
|
517
|
-
if (ht(
|
|
514
|
+
var n = r[t];
|
|
515
|
+
if ((n.f & (nt | He)) === 0 && Xt(n)) {
|
|
516
|
+
var s = jt;
|
|
517
|
+
if (ht(n), n.deps === null && n.first === null && n.nodes_start === null && (n.teardown === null ? Qn(n) : n.fn = null), jt > s && (n.f & In) !== 0)
|
|
518
518
|
break;
|
|
519
519
|
}
|
|
520
520
|
}
|
|
@@ -536,13 +536,13 @@ function Oe(r) {
|
|
|
536
536
|
lt.push(e);
|
|
537
537
|
}
|
|
538
538
|
const Ne = /* @__PURE__ */ new Map();
|
|
539
|
-
function
|
|
539
|
+
function Vn(r, e) {
|
|
540
540
|
var t = {
|
|
541
541
|
f: 0,
|
|
542
542
|
// TODO ideally we could skip this altogether, but it causes type errors
|
|
543
543
|
v: r,
|
|
544
544
|
reactions: null,
|
|
545
|
-
equals:
|
|
545
|
+
equals: Rn,
|
|
546
546
|
rv: 0,
|
|
547
547
|
wv: 0
|
|
548
548
|
};
|
|
@@ -550,35 +550,35 @@ function zs(r, e) {
|
|
|
550
550
|
}
|
|
551
551
|
// @__NO_SIDE_EFFECTS__
|
|
552
552
|
function q(r, e) {
|
|
553
|
-
const t =
|
|
553
|
+
const t = Vn(r);
|
|
554
554
|
return ma(t), t;
|
|
555
555
|
}
|
|
556
556
|
function F(r, e, t = !1) {
|
|
557
557
|
C !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
|
|
558
558
|
// to ensure we error if state is set inside an inspect effect
|
|
559
|
-
(!
|
|
560
|
-
let
|
|
561
|
-
return ur(r,
|
|
559
|
+
(!se || (C.f & rn) !== 0) && Ln() && (C.f & (H | Yt | Lr | rn)) !== 0 && !($ != null && $.includes(r)) && Bs();
|
|
560
|
+
let n = t ? ut(e) : e;
|
|
561
|
+
return ur(r, n);
|
|
562
562
|
}
|
|
563
563
|
function ur(r, e) {
|
|
564
564
|
if (!r.equals(e)) {
|
|
565
565
|
var t = r.v;
|
|
566
|
-
|
|
566
|
+
st ? Ne.set(r, e) : Ne.set(r, t), r.v = e, Zt.ensure().capture(r, t), (r.f & H) !== 0 && ((r.f & ee) !== 0 && Fr(
|
|
567
567
|
/** @type {Derived} */
|
|
568
568
|
r
|
|
569
|
-
), U(r, (r.f & X) === 0 ? z : De)), r.wv =
|
|
569
|
+
), U(r, (r.f & X) === 0 ? z : De)), r.wv = ts(), Bn(r, ee), M !== null && (M.f & z) !== 0 && (M.f & (Ce | rt)) === 0 && (Q === null ? va([r]) : Q.push(r));
|
|
570
570
|
}
|
|
571
571
|
return e;
|
|
572
572
|
}
|
|
573
573
|
function er(r) {
|
|
574
574
|
F(r, r.v + 1);
|
|
575
575
|
}
|
|
576
|
-
function
|
|
576
|
+
function Bn(r, e) {
|
|
577
577
|
var t = r.reactions;
|
|
578
578
|
if (t !== null)
|
|
579
|
-
for (var
|
|
580
|
-
var a = t[
|
|
581
|
-
(i & ee) === 0 && (U(a, e), (i & (z | X)) !== 0 && ((i & H) !== 0 ?
|
|
579
|
+
for (var n = t.length, s = 0; s < n; s++) {
|
|
580
|
+
var a = t[s], i = a.f;
|
|
581
|
+
(i & ee) === 0 && (U(a, e), (i & (z | X)) !== 0 && ((i & H) !== 0 ? Bn(
|
|
582
582
|
/** @type {Derived} */
|
|
583
583
|
a,
|
|
584
584
|
De
|
|
@@ -591,18 +591,18 @@ function Vs(r, e) {
|
|
|
591
591
|
function ut(r) {
|
|
592
592
|
if (typeof r != "object" || r === null || Ot in r)
|
|
593
593
|
return r;
|
|
594
|
-
const e =
|
|
595
|
-
if (e !==
|
|
594
|
+
const e = Ms(r);
|
|
595
|
+
if (e !== Ts && e !== As)
|
|
596
596
|
return r;
|
|
597
|
-
var t = /* @__PURE__ */ new Map(),
|
|
597
|
+
var t = /* @__PURE__ */ new Map(), n = Mn(r), s = /* @__PURE__ */ q(0), a = Ie, i = (o) => {
|
|
598
598
|
if (Ie === a)
|
|
599
599
|
return o();
|
|
600
600
|
var l = C, u = Ie;
|
|
601
|
-
xe(null),
|
|
601
|
+
xe(null), ln(a);
|
|
602
602
|
var d = o();
|
|
603
|
-
return xe(l),
|
|
603
|
+
return xe(l), ln(u), d;
|
|
604
604
|
};
|
|
605
|
-
return
|
|
605
|
+
return n && t.set("length", /* @__PURE__ */ q(
|
|
606
606
|
/** @type {any[]} */
|
|
607
607
|
r.length
|
|
608
608
|
)), new Proxy(
|
|
@@ -610,7 +610,7 @@ function ut(r) {
|
|
|
610
610
|
r,
|
|
611
611
|
{
|
|
612
612
|
defineProperty(o, l, u) {
|
|
613
|
-
(!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) &&
|
|
613
|
+
(!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && zs();
|
|
614
614
|
var d = t.get(l);
|
|
615
615
|
return d === void 0 ? d = i(() => {
|
|
616
616
|
var f = /* @__PURE__ */ q(u.value);
|
|
@@ -622,17 +622,17 @@ function ut(r) {
|
|
|
622
622
|
if (u === void 0) {
|
|
623
623
|
if (l in o) {
|
|
624
624
|
const p = i(() => /* @__PURE__ */ q(j));
|
|
625
|
-
t.set(l, p), er(
|
|
625
|
+
t.set(l, p), er(s);
|
|
626
626
|
}
|
|
627
627
|
} else {
|
|
628
|
-
if (
|
|
628
|
+
if (n && typeof l == "string") {
|
|
629
629
|
var d = (
|
|
630
630
|
/** @type {Source<number>} */
|
|
631
631
|
t.get("length")
|
|
632
632
|
), f = Number(l);
|
|
633
633
|
Number.isInteger(f) && f < d.v && F(d, f);
|
|
634
634
|
}
|
|
635
|
-
F(u, j), er(
|
|
635
|
+
F(u, j), er(s);
|
|
636
636
|
}
|
|
637
637
|
return !0;
|
|
638
638
|
},
|
|
@@ -686,7 +686,7 @@ function ut(r) {
|
|
|
686
686
|
set(o, l, u, d) {
|
|
687
687
|
var V;
|
|
688
688
|
var f = t.get(l), p = l in o;
|
|
689
|
-
if (
|
|
689
|
+
if (n && l === "length")
|
|
690
690
|
for (var v = u; v < /** @type {Source<number>} */
|
|
691
691
|
f.v; v += 1) {
|
|
692
692
|
var x = t.get(v + "");
|
|
@@ -701,19 +701,19 @@ function ut(r) {
|
|
|
701
701
|
}
|
|
702
702
|
var R = Reflect.getOwnPropertyDescriptor(o, l);
|
|
703
703
|
if (R != null && R.set && R.set.call(d, u), !p) {
|
|
704
|
-
if (
|
|
704
|
+
if (n && typeof l == "string") {
|
|
705
705
|
var G = (
|
|
706
706
|
/** @type {Source<number>} */
|
|
707
707
|
t.get("length")
|
|
708
708
|
), T = Number(l);
|
|
709
709
|
Number.isInteger(T) && T >= G.v && F(G, T + 1);
|
|
710
710
|
}
|
|
711
|
-
er(
|
|
711
|
+
er(s);
|
|
712
712
|
}
|
|
713
713
|
return !0;
|
|
714
714
|
},
|
|
715
715
|
ownKeys(o) {
|
|
716
|
-
L(
|
|
716
|
+
L(s);
|
|
717
717
|
var l = Reflect.ownKeys(o).filter((f) => {
|
|
718
718
|
var p = t.get(f);
|
|
719
719
|
return p === void 0 || p.v !== j;
|
|
@@ -723,52 +723,52 @@ function ut(r) {
|
|
|
723
723
|
return l;
|
|
724
724
|
},
|
|
725
725
|
setPrototypeOf() {
|
|
726
|
-
|
|
726
|
+
Vs();
|
|
727
727
|
}
|
|
728
728
|
}
|
|
729
729
|
);
|
|
730
730
|
}
|
|
731
|
-
var
|
|
731
|
+
var sn, Un, $n, qn;
|
|
732
732
|
function ra() {
|
|
733
|
-
if (
|
|
734
|
-
|
|
733
|
+
if (sn === void 0) {
|
|
734
|
+
sn = window, Un = /Firefox/.test(navigator.userAgent);
|
|
735
735
|
var r = Element.prototype, e = Node.prototype, t = Text.prototype;
|
|
736
|
-
|
|
736
|
+
$n = ft(e, "firstChild").get, qn = ft(e, "nextSibling").get, tn(r) && (r.__click = void 0, r.__className = void 0, r.__attributes = null, r.__style = void 0, r.__e = void 0), tn(t) && (t.__t = void 0);
|
|
737
737
|
}
|
|
738
738
|
}
|
|
739
|
-
function
|
|
739
|
+
function na(r = "") {
|
|
740
740
|
return document.createTextNode(r);
|
|
741
741
|
}
|
|
742
742
|
// @__NO_SIDE_EFFECTS__
|
|
743
|
-
function
|
|
744
|
-
return
|
|
743
|
+
function Wn(r) {
|
|
744
|
+
return $n.call(r);
|
|
745
745
|
}
|
|
746
746
|
// @__NO_SIDE_EFFECTS__
|
|
747
|
-
function
|
|
748
|
-
return
|
|
747
|
+
function Yn(r) {
|
|
748
|
+
return qn.call(r);
|
|
749
749
|
}
|
|
750
750
|
function dr(r, e) {
|
|
751
|
-
return /* @__PURE__ */
|
|
751
|
+
return /* @__PURE__ */ Wn(r);
|
|
752
752
|
}
|
|
753
|
-
function
|
|
754
|
-
let
|
|
753
|
+
function sa(r, e = 1, t = !1) {
|
|
754
|
+
let n = r;
|
|
755
755
|
for (; e--; )
|
|
756
|
-
|
|
757
|
-
/* @__PURE__ */
|
|
758
|
-
return
|
|
756
|
+
n = /** @type {TemplateNode} */
|
|
757
|
+
/* @__PURE__ */ Yn(n);
|
|
758
|
+
return n;
|
|
759
759
|
}
|
|
760
760
|
function aa(r) {
|
|
761
|
-
M === null && C === null &&
|
|
761
|
+
M === null && C === null && js(), C !== null && (C.f & X) !== 0 && M === null && Zs(), st && Ps();
|
|
762
762
|
}
|
|
763
763
|
function ia(r, e) {
|
|
764
764
|
var t = e.last;
|
|
765
765
|
t === null ? e.last = e.first = r : (t.next = r, r.prev = t, e.last = r);
|
|
766
766
|
}
|
|
767
|
-
function Pe(r, e, t,
|
|
768
|
-
var
|
|
769
|
-
|
|
767
|
+
function Pe(r, e, t, n = !0) {
|
|
768
|
+
var s = M;
|
|
769
|
+
s !== null && (s.f & He) !== 0 && (r |= He);
|
|
770
770
|
var a = {
|
|
771
|
-
ctx:
|
|
771
|
+
ctx: ne,
|
|
772
772
|
deps: null,
|
|
773
773
|
nodes_start: null,
|
|
774
774
|
nodes_end: null,
|
|
@@ -777,8 +777,8 @@ function Pe(r, e, t, s = !0) {
|
|
|
777
777
|
fn: e,
|
|
778
778
|
last: null,
|
|
779
779
|
next: null,
|
|
780
|
-
parent:
|
|
781
|
-
b:
|
|
780
|
+
parent: s,
|
|
781
|
+
b: s && s.b,
|
|
782
782
|
prev: null,
|
|
783
783
|
teardown: null,
|
|
784
784
|
transitions: null,
|
|
@@ -793,7 +793,7 @@ function Pe(r, e, t, s = !0) {
|
|
|
793
793
|
}
|
|
794
794
|
else e !== null && Oe(a);
|
|
795
795
|
var i = t && a.deps === null && a.first === null && a.nodes_start === null && a.teardown === null && (a.f & Rr) === 0;
|
|
796
|
-
if (!i &&
|
|
796
|
+
if (!i && n && (s !== null && ia(a, s), C !== null && (C.f & H) !== 0)) {
|
|
797
797
|
var o = (
|
|
798
798
|
/** @type {Derived} */
|
|
799
799
|
C
|
|
@@ -809,24 +809,24 @@ function ue(r) {
|
|
|
809
809
|
M.f
|
|
810
810
|
), t = !C && (e & Ce) !== 0 && (e & Ir) === 0;
|
|
811
811
|
if (t) {
|
|
812
|
-
var
|
|
812
|
+
var n = (
|
|
813
813
|
/** @type {ComponentContext} */
|
|
814
|
-
|
|
814
|
+
ne
|
|
815
815
|
);
|
|
816
|
-
(
|
|
816
|
+
(n.e ?? (n.e = [])).push(r);
|
|
817
817
|
} else
|
|
818
|
-
return
|
|
818
|
+
return Xn(r);
|
|
819
819
|
}
|
|
820
|
-
function
|
|
821
|
-
return Pe(Nr |
|
|
820
|
+
function Xn(r) {
|
|
821
|
+
return Pe(Nr | In, r, !1);
|
|
822
822
|
}
|
|
823
823
|
function oa(r) {
|
|
824
824
|
Zt.ensure();
|
|
825
825
|
const e = Pe(rt, r, !0);
|
|
826
|
-
return (t = {}) => new Promise((
|
|
826
|
+
return (t = {}) => new Promise((n) => {
|
|
827
827
|
t.outro ? ha(e, () => {
|
|
828
|
-
Re(e),
|
|
829
|
-
}) : (Re(e),
|
|
828
|
+
Re(e), n(void 0);
|
|
829
|
+
}) : (Re(e), n(void 0));
|
|
830
830
|
});
|
|
831
831
|
}
|
|
832
832
|
function la(r) {
|
|
@@ -835,36 +835,36 @@ function la(r) {
|
|
|
835
835
|
function ua(r) {
|
|
836
836
|
return Pe(Lr | Rr, r, !0);
|
|
837
837
|
}
|
|
838
|
-
function
|
|
839
|
-
return Pe(
|
|
838
|
+
function Hn(r, e = 0) {
|
|
839
|
+
return Pe(On | e, r, !0);
|
|
840
840
|
}
|
|
841
|
-
function
|
|
842
|
-
|
|
843
|
-
Pe(
|
|
841
|
+
function Jn(r, e = [], t = []) {
|
|
842
|
+
Qs(e, t, (n) => {
|
|
843
|
+
Pe(On, () => r(...n.map(L)), !0);
|
|
844
844
|
});
|
|
845
845
|
}
|
|
846
846
|
function da(r, e = !0) {
|
|
847
847
|
return Pe(Ce, r, !0, e);
|
|
848
848
|
}
|
|
849
|
-
function
|
|
849
|
+
function Gn(r) {
|
|
850
850
|
var e = r.teardown;
|
|
851
851
|
if (e !== null) {
|
|
852
|
-
const t =
|
|
853
|
-
|
|
852
|
+
const t = st, n = C;
|
|
853
|
+
on(!0), xe(null);
|
|
854
854
|
try {
|
|
855
855
|
e.call(null);
|
|
856
856
|
} finally {
|
|
857
|
-
|
|
857
|
+
on(t), xe(n);
|
|
858
858
|
}
|
|
859
859
|
}
|
|
860
860
|
}
|
|
861
|
-
function
|
|
862
|
-
var
|
|
861
|
+
function Kn(r, e = !1) {
|
|
862
|
+
var s;
|
|
863
863
|
var t = r.first;
|
|
864
864
|
for (r.first = r.last = null; t !== null; ) {
|
|
865
|
-
(
|
|
866
|
-
var
|
|
867
|
-
(t.f & rt) !== 0 ? t.parent = null : Re(t, e), t =
|
|
865
|
+
(s = t.ac) == null || s.abort(Dr);
|
|
866
|
+
var n = t.next;
|
|
867
|
+
(t.f & rt) !== 0 ? t.parent = null : Re(t, e), t = n;
|
|
868
868
|
}
|
|
869
869
|
}
|
|
870
870
|
function ca(r) {
|
|
@@ -875,67 +875,67 @@ function ca(r) {
|
|
|
875
875
|
}
|
|
876
876
|
function Re(r, e = !0) {
|
|
877
877
|
var t = !1;
|
|
878
|
-
(e || (r.f &
|
|
878
|
+
(e || (r.f & Rs) !== 0) && r.nodes_start !== null && r.nodes_end !== null && (fa(
|
|
879
879
|
r.nodes_start,
|
|
880
880
|
/** @type {TemplateNode} */
|
|
881
881
|
r.nodes_end
|
|
882
|
-
), t = !0),
|
|
883
|
-
var
|
|
884
|
-
if (
|
|
885
|
-
for (const a of
|
|
882
|
+
), t = !0), Kn(r, e && !t), Ft(r, 0), U(r, nt);
|
|
883
|
+
var n = r.transitions;
|
|
884
|
+
if (n !== null)
|
|
885
|
+
for (const a of n)
|
|
886
886
|
a.stop();
|
|
887
|
-
|
|
888
|
-
var
|
|
889
|
-
|
|
887
|
+
Gn(r);
|
|
888
|
+
var s = r.parent;
|
|
889
|
+
s !== null && s.first !== null && Qn(r), r.next = r.prev = r.teardown = r.ctx = r.deps = r.fn = r.nodes_start = r.nodes_end = r.ac = null;
|
|
890
890
|
}
|
|
891
891
|
function fa(r, e) {
|
|
892
892
|
for (; r !== null; ) {
|
|
893
893
|
var t = r === e ? null : (
|
|
894
894
|
/** @type {TemplateNode} */
|
|
895
|
-
/* @__PURE__ */
|
|
895
|
+
/* @__PURE__ */ Yn(r)
|
|
896
896
|
);
|
|
897
897
|
r.remove(), r = t;
|
|
898
898
|
}
|
|
899
899
|
}
|
|
900
|
-
function
|
|
901
|
-
var e = r.parent, t = r.prev,
|
|
902
|
-
t !== null && (t.next =
|
|
900
|
+
function Qn(r) {
|
|
901
|
+
var e = r.parent, t = r.prev, n = r.next;
|
|
902
|
+
t !== null && (t.next = n), n !== null && (n.prev = t), e !== null && (e.first === r && (e.first = n), e.last === r && (e.last = t));
|
|
903
903
|
}
|
|
904
904
|
function ha(r, e) {
|
|
905
905
|
var t = [];
|
|
906
|
-
|
|
906
|
+
es(r, t, !0), pa(t, () => {
|
|
907
907
|
Re(r), e && e();
|
|
908
908
|
});
|
|
909
909
|
}
|
|
910
910
|
function pa(r, e) {
|
|
911
911
|
var t = r.length;
|
|
912
912
|
if (t > 0) {
|
|
913
|
-
var
|
|
914
|
-
for (var
|
|
915
|
-
|
|
913
|
+
var n = () => --t || e();
|
|
914
|
+
for (var s of r)
|
|
915
|
+
s.out(n);
|
|
916
916
|
} else
|
|
917
917
|
e();
|
|
918
918
|
}
|
|
919
|
-
function
|
|
919
|
+
function es(r, e, t) {
|
|
920
920
|
if ((r.f & He) === 0) {
|
|
921
921
|
if (r.f ^= He, r.transitions !== null)
|
|
922
922
|
for (const i of r.transitions)
|
|
923
923
|
(i.is_global || t) && e.push(i);
|
|
924
|
-
for (var
|
|
925
|
-
var
|
|
926
|
-
|
|
924
|
+
for (var n = r.first; n !== null; ) {
|
|
925
|
+
var s = n.next, a = (n.f & Is) !== 0 || (n.f & Ce) !== 0;
|
|
926
|
+
es(n, e, a ? t : !1), n = s;
|
|
927
927
|
}
|
|
928
928
|
}
|
|
929
929
|
}
|
|
930
930
|
let Ue = !1;
|
|
931
|
-
function
|
|
931
|
+
function an(r) {
|
|
932
932
|
Ue = r;
|
|
933
933
|
}
|
|
934
|
-
let
|
|
935
|
-
function
|
|
936
|
-
|
|
934
|
+
let st = !1;
|
|
935
|
+
function on(r) {
|
|
936
|
+
st = r;
|
|
937
937
|
}
|
|
938
|
-
let C = null,
|
|
938
|
+
let C = null, se = !1;
|
|
939
939
|
function xe(r) {
|
|
940
940
|
C = r;
|
|
941
941
|
}
|
|
@@ -952,11 +952,11 @@ function va(r) {
|
|
|
952
952
|
Q = r;
|
|
953
953
|
}
|
|
954
954
|
let jt = 1, mt = 0, Ie = mt;
|
|
955
|
-
function
|
|
955
|
+
function ln(r) {
|
|
956
956
|
Ie = r;
|
|
957
957
|
}
|
|
958
958
|
let ye = !1;
|
|
959
|
-
function
|
|
959
|
+
function ts() {
|
|
960
960
|
return ++jt;
|
|
961
961
|
}
|
|
962
962
|
function Xt(r) {
|
|
@@ -965,38 +965,38 @@ function Xt(r) {
|
|
|
965
965
|
if ((e & ee) !== 0)
|
|
966
966
|
return !0;
|
|
967
967
|
if ((e & De) !== 0) {
|
|
968
|
-
var t = r.deps,
|
|
968
|
+
var t = r.deps, n = (e & X) !== 0;
|
|
969
969
|
if (t !== null) {
|
|
970
|
-
var
|
|
971
|
-
if ((i || o) && (M === null || (M.f &
|
|
970
|
+
var s, a, i = (e & Rt) !== 0, o = n && M !== null && !ye, l = t.length;
|
|
971
|
+
if ((i || o) && (M === null || (M.f & nt) === 0)) {
|
|
972
972
|
var u = (
|
|
973
973
|
/** @type {Derived} */
|
|
974
974
|
r
|
|
975
975
|
), d = u.parent;
|
|
976
|
-
for (
|
|
977
|
-
a = t[
|
|
976
|
+
for (s = 0; s < l; s++)
|
|
977
|
+
a = t[s], (i || !((f = a == null ? void 0 : a.reactions) != null && f.includes(u))) && (a.reactions ?? (a.reactions = [])).push(u);
|
|
978
978
|
i && (u.f ^= Rt), o && d !== null && (d.f & X) === 0 && (u.f ^= X);
|
|
979
979
|
}
|
|
980
|
-
for (
|
|
981
|
-
if (a = t[
|
|
980
|
+
for (s = 0; s < l; s++)
|
|
981
|
+
if (a = t[s], Xt(
|
|
982
982
|
/** @type {Derived} */
|
|
983
983
|
a
|
|
984
|
-
) &&
|
|
984
|
+
) && Zn(
|
|
985
985
|
/** @type {Derived} */
|
|
986
986
|
a
|
|
987
987
|
), a.wv > r.wv)
|
|
988
988
|
return !0;
|
|
989
989
|
}
|
|
990
|
-
(!
|
|
990
|
+
(!n || M !== null && !ye) && U(r, z);
|
|
991
991
|
}
|
|
992
992
|
return !1;
|
|
993
993
|
}
|
|
994
|
-
function
|
|
995
|
-
var
|
|
996
|
-
if (
|
|
997
|
-
for (var
|
|
998
|
-
var a = s
|
|
999
|
-
(a.f & H) !== 0 ?
|
|
994
|
+
function rs(r, e, t = !0) {
|
|
995
|
+
var n = r.reactions;
|
|
996
|
+
if (n !== null && !($ != null && $.includes(r)))
|
|
997
|
+
for (var s = 0; s < n.length; s++) {
|
|
998
|
+
var a = n[s];
|
|
999
|
+
(a.f & H) !== 0 ? rs(
|
|
1000
1000
|
/** @type {Derived} */
|
|
1001
1001
|
a,
|
|
1002
1002
|
e,
|
|
@@ -1007,11 +1007,11 @@ function tn(r, e, t = !0) {
|
|
|
1007
1007
|
));
|
|
1008
1008
|
}
|
|
1009
1009
|
}
|
|
1010
|
-
function
|
|
1010
|
+
function ns(r) {
|
|
1011
1011
|
var x;
|
|
1012
|
-
var e = B, t = Y,
|
|
1012
|
+
var e = B, t = Y, n = Q, s = C, a = ye, i = $, o = ne, l = se, u = Ie, d = r.f;
|
|
1013
1013
|
B = /** @type {null | Value[]} */
|
|
1014
|
-
null, Y = 0, Q = null, ye = (d & X) !== 0 && (
|
|
1014
|
+
null, Y = 0, Q = null, ye = (d & X) !== 0 && (se || !Ue || C === null), C = (d & (Ce | rt)) === 0 ? r : null, $ = null, Lt(r.ctx), se = !1, Ie = ++mt, r.ac !== null && (r.ac.abort(Dr), r.ac = null);
|
|
1015
1015
|
try {
|
|
1016
1016
|
r.f |= ir;
|
|
1017
1017
|
var f = (
|
|
@@ -1031,35 +1031,35 @@ function rn(r) {
|
|
|
1031
1031
|
for (v = Y; v < p.length; v++)
|
|
1032
1032
|
((x = p[v]).reactions ?? (x.reactions = [])).push(r);
|
|
1033
1033
|
} else p !== null && Y < p.length && (Ft(r, Y), p.length = Y);
|
|
1034
|
-
if (
|
|
1034
|
+
if (Ln() && Q !== null && !se && p !== null && (r.f & (H | De | ee)) === 0)
|
|
1035
1035
|
for (v = 0; v < /** @type {Source[]} */
|
|
1036
1036
|
Q.length; v++)
|
|
1037
|
-
|
|
1037
|
+
rs(
|
|
1038
1038
|
Q[v],
|
|
1039
1039
|
/** @type {Effect} */
|
|
1040
1040
|
r
|
|
1041
1041
|
);
|
|
1042
|
-
return
|
|
1042
|
+
return s !== null && s !== r && (mt++, Q !== null && (n === null ? n = Q : n.push(.../** @type {Source[]} */
|
|
1043
1043
|
Q))), (r.f & Me) !== 0 && (r.f ^= Me), f;
|
|
1044
1044
|
} catch (N) {
|
|
1045
|
-
return
|
|
1045
|
+
return Ws(N);
|
|
1046
1046
|
} finally {
|
|
1047
|
-
r.f ^= ir, B = e, Y = t, Q =
|
|
1047
|
+
r.f ^= ir, B = e, Y = t, Q = n, C = s, ye = a, $ = i, Lt(o), se = l, Ie = u;
|
|
1048
1048
|
}
|
|
1049
1049
|
}
|
|
1050
1050
|
function ga(r, e) {
|
|
1051
1051
|
let t = e.reactions;
|
|
1052
1052
|
if (t !== null) {
|
|
1053
|
-
var
|
|
1054
|
-
if (
|
|
1055
|
-
var
|
|
1056
|
-
|
|
1053
|
+
var n = Cs.call(t, r);
|
|
1054
|
+
if (n !== -1) {
|
|
1055
|
+
var s = t.length - 1;
|
|
1056
|
+
s === 0 ? t = e.reactions = null : (t[n] = t[s], t.pop());
|
|
1057
1057
|
}
|
|
1058
1058
|
}
|
|
1059
1059
|
t === null && (e.f & H) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
|
|
1060
1060
|
// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
|
|
1061
1061
|
// allows us to skip the expensive work of disconnecting and immediately reconnecting it
|
|
1062
|
-
(B === null || !B.includes(e)) && (U(e, De), (e.f & (X | Rt)) === 0 && (e.f ^= Rt),
|
|
1062
|
+
(B === null || !B.includes(e)) && (U(e, De), (e.f & (X | Rt)) === 0 && (e.f ^= Rt), Pn(
|
|
1063
1063
|
/** @type {Derived} **/
|
|
1064
1064
|
e
|
|
1065
1065
|
), Ft(
|
|
@@ -1071,34 +1071,34 @@ function ga(r, e) {
|
|
|
1071
1071
|
function Ft(r, e) {
|
|
1072
1072
|
var t = r.deps;
|
|
1073
1073
|
if (t !== null)
|
|
1074
|
-
for (var
|
|
1075
|
-
ga(r, t[
|
|
1074
|
+
for (var n = e; n < t.length; n++)
|
|
1075
|
+
ga(r, t[n]);
|
|
1076
1076
|
}
|
|
1077
1077
|
function ht(r) {
|
|
1078
1078
|
var e = r.f;
|
|
1079
|
-
if ((e &
|
|
1079
|
+
if ((e & nt) === 0) {
|
|
1080
1080
|
U(r, z);
|
|
1081
|
-
var t = M,
|
|
1081
|
+
var t = M, n = Ue;
|
|
1082
1082
|
M = r, Ue = !0;
|
|
1083
1083
|
try {
|
|
1084
|
-
(e & Yt) !== 0 ? ca(r) :
|
|
1085
|
-
var
|
|
1086
|
-
r.teardown = typeof
|
|
1084
|
+
(e & Yt) !== 0 ? ca(r) : Kn(r), Gn(r);
|
|
1085
|
+
var s = ns(r);
|
|
1086
|
+
r.teardown = typeof s == "function" ? s : null, r.wv = jt;
|
|
1087
1087
|
var a;
|
|
1088
|
-
|
|
1088
|
+
en && $s && (r.f & ee) !== 0 && r.deps;
|
|
1089
1089
|
} finally {
|
|
1090
|
-
Ue =
|
|
1090
|
+
Ue = n, M = t;
|
|
1091
1091
|
}
|
|
1092
1092
|
}
|
|
1093
1093
|
}
|
|
1094
1094
|
function L(r) {
|
|
1095
1095
|
var e = r.f, t = (e & H) !== 0;
|
|
1096
|
-
if (C !== null && !
|
|
1097
|
-
var
|
|
1098
|
-
if (!
|
|
1099
|
-
var
|
|
1096
|
+
if (C !== null && !se) {
|
|
1097
|
+
var n = M !== null && (M.f & nt) !== 0;
|
|
1098
|
+
if (!n && !($ != null && $.includes(r))) {
|
|
1099
|
+
var s = C.deps;
|
|
1100
1100
|
if ((C.f & ir) !== 0)
|
|
1101
|
-
r.rv < mt && (r.rv = mt, B === null &&
|
|
1101
|
+
r.rv < mt && (r.rv = mt, B === null && s !== null && s[Y] === r ? Y++ : B === null ? B = [r] : (!ye || !B.includes(r)) && B.push(r));
|
|
1102
1102
|
else {
|
|
1103
1103
|
(C.deps ?? (C.deps = [])).push(r);
|
|
1104
1104
|
var a = r.reactions;
|
|
@@ -1114,30 +1114,30 @@ function L(r) {
|
|
|
1114
1114
|
), o = i.parent;
|
|
1115
1115
|
o !== null && (o.f & X) === 0 && (i.f ^= X);
|
|
1116
1116
|
}
|
|
1117
|
-
if (
|
|
1117
|
+
if (st) {
|
|
1118
1118
|
if (Ne.has(r))
|
|
1119
1119
|
return Ne.get(r);
|
|
1120
1120
|
if (t) {
|
|
1121
1121
|
i = /** @type {Derived} */
|
|
1122
1122
|
r;
|
|
1123
1123
|
var l = i.v;
|
|
1124
|
-
return ((i.f & z) !== 0 ||
|
|
1124
|
+
return ((i.f & z) !== 0 || ss(i)) && (l = Fr(i)), Ne.set(i, l), l;
|
|
1125
1125
|
}
|
|
1126
1126
|
} else if (t) {
|
|
1127
1127
|
if (i = /** @type {Derived} */
|
|
1128
1128
|
r, _e != null && _e.has(i))
|
|
1129
1129
|
return _e.get(i);
|
|
1130
|
-
Xt(i) &&
|
|
1130
|
+
Xt(i) && Zn(i);
|
|
1131
1131
|
}
|
|
1132
1132
|
if ((r.f & Me) !== 0)
|
|
1133
1133
|
throw r.v;
|
|
1134
1134
|
return r.v;
|
|
1135
1135
|
}
|
|
1136
|
-
function
|
|
1136
|
+
function ss(r) {
|
|
1137
1137
|
if (r.v === j) return !0;
|
|
1138
1138
|
if (r.deps === null) return !1;
|
|
1139
1139
|
for (const e of r.deps)
|
|
1140
|
-
if (Ne.has(e) || (e.f & H) !== 0 &&
|
|
1140
|
+
if (Ne.has(e) || (e.f & H) !== 0 && ss(
|
|
1141
1141
|
/** @type {Derived} */
|
|
1142
1142
|
e
|
|
1143
1143
|
))
|
|
@@ -1145,11 +1145,11 @@ function sn(r) {
|
|
|
1145
1145
|
return !1;
|
|
1146
1146
|
}
|
|
1147
1147
|
function _a(r) {
|
|
1148
|
-
var e =
|
|
1148
|
+
var e = se;
|
|
1149
1149
|
try {
|
|
1150
|
-
return
|
|
1150
|
+
return se = !0, r();
|
|
1151
1151
|
} finally {
|
|
1152
|
-
|
|
1152
|
+
se = e;
|
|
1153
1153
|
}
|
|
1154
1154
|
}
|
|
1155
1155
|
const ya = -7169;
|
|
@@ -1160,30 +1160,30 @@ const wa = ["touchstart", "touchmove"];
|
|
|
1160
1160
|
function ka(r) {
|
|
1161
1161
|
return wa.includes(r);
|
|
1162
1162
|
}
|
|
1163
|
-
const xa = /* @__PURE__ */ new Set(),
|
|
1163
|
+
const xa = /* @__PURE__ */ new Set(), un = /* @__PURE__ */ new Set();
|
|
1164
1164
|
function Mt(r) {
|
|
1165
1165
|
var T;
|
|
1166
1166
|
var e = this, t = (
|
|
1167
1167
|
/** @type {Node} */
|
|
1168
1168
|
e.ownerDocument
|
|
1169
|
-
),
|
|
1169
|
+
), n = r.type, s = ((T = r.composedPath) == null ? void 0 : T.call(r)) || [], a = (
|
|
1170
1170
|
/** @type {null | Element} */
|
|
1171
|
-
|
|
1171
|
+
s[0] || r.target
|
|
1172
1172
|
), i = 0, o = r.__root;
|
|
1173
1173
|
if (o) {
|
|
1174
|
-
var l =
|
|
1174
|
+
var l = s.indexOf(o);
|
|
1175
1175
|
if (l !== -1 && (e === document || e === /** @type {any} */
|
|
1176
1176
|
window)) {
|
|
1177
1177
|
r.__root = e;
|
|
1178
1178
|
return;
|
|
1179
1179
|
}
|
|
1180
|
-
var u =
|
|
1180
|
+
var u = s.indexOf(e);
|
|
1181
1181
|
if (u === -1)
|
|
1182
1182
|
return;
|
|
1183
1183
|
l <= u && (i = l);
|
|
1184
1184
|
}
|
|
1185
1185
|
if (a = /** @type {Element} */
|
|
1186
|
-
|
|
1186
|
+
s[i] || r.target, a !== e) {
|
|
1187
1187
|
ar(r, "currentTarget", {
|
|
1188
1188
|
configurable: !0,
|
|
1189
1189
|
get() {
|
|
@@ -1197,12 +1197,12 @@ function Mt(r) {
|
|
|
1197
1197
|
var x = a.assignedSlot || a.parentNode || /** @type {any} */
|
|
1198
1198
|
a.host || null;
|
|
1199
1199
|
try {
|
|
1200
|
-
var N = a["__" +
|
|
1200
|
+
var N = a["__" + n];
|
|
1201
1201
|
if (N != null && (!/** @type {any} */
|
|
1202
1202
|
a.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
|
|
1203
1203
|
// -> the target could not have been disabled because it emits the event in the first place
|
|
1204
1204
|
r.target === a))
|
|
1205
|
-
if (
|
|
1205
|
+
if (Mn(N)) {
|
|
1206
1206
|
var [R, ...G] = N;
|
|
1207
1207
|
R.apply(a, [r, ...G]);
|
|
1208
1208
|
} else
|
|
@@ -1238,19 +1238,19 @@ function Ea(r, e) {
|
|
|
1238
1238
|
t.nodes_start === null && (t.nodes_start = r, t.nodes_end = e);
|
|
1239
1239
|
}
|
|
1240
1240
|
// @__NO_SIDE_EFFECTS__
|
|
1241
|
-
function
|
|
1242
|
-
var t = (e &
|
|
1241
|
+
function as(r, e) {
|
|
1242
|
+
var t = (e & Us) !== 0, n, s = !r.startsWith("<!>");
|
|
1243
1243
|
return () => {
|
|
1244
|
-
|
|
1245
|
-
/* @__PURE__ */
|
|
1244
|
+
n === void 0 && (n = ba(s ? r : "<!>" + r), n = /** @type {Node} */
|
|
1245
|
+
/* @__PURE__ */ Wn(n));
|
|
1246
1246
|
var a = (
|
|
1247
1247
|
/** @type {TemplateNode} */
|
|
1248
|
-
t ||
|
|
1248
|
+
t || Un ? document.importNode(n, !0) : n.cloneNode(!0)
|
|
1249
1249
|
);
|
|
1250
1250
|
return Ea(a, a), a;
|
|
1251
1251
|
};
|
|
1252
1252
|
}
|
|
1253
|
-
function
|
|
1253
|
+
function is(r, e) {
|
|
1254
1254
|
r !== null && r.before(
|
|
1255
1255
|
/** @type {Node} */
|
|
1256
1256
|
e
|
|
@@ -1260,7 +1260,7 @@ function zr(r, e) {
|
|
|
1260
1260
|
return Ca(r, e);
|
|
1261
1261
|
}
|
|
1262
1262
|
const je = /* @__PURE__ */ new Map();
|
|
1263
|
-
function Ca(r, { target: e, anchor: t, props:
|
|
1263
|
+
function Ca(r, { target: e, anchor: t, props: n = {}, events: s, context: a, intro: i = !0 }) {
|
|
1264
1264
|
ra();
|
|
1265
1265
|
var o = /* @__PURE__ */ new Set(), l = (f) => {
|
|
1266
1266
|
for (var p = 0; p < f.length; p++) {
|
|
@@ -1274,19 +1274,19 @@ function Ca(r, { target: e, anchor: t, props: s = {}, events: n, context: a, int
|
|
|
1274
1274
|
}
|
|
1275
1275
|
}
|
|
1276
1276
|
};
|
|
1277
|
-
l(
|
|
1277
|
+
l(Ss(xa)), un.add(l);
|
|
1278
1278
|
var u = void 0, d = oa(() => {
|
|
1279
|
-
var f = t ?? e.appendChild(
|
|
1279
|
+
var f = t ?? e.appendChild(na());
|
|
1280
1280
|
return da(() => {
|
|
1281
1281
|
if (a) {
|
|
1282
1282
|
Pr({});
|
|
1283
1283
|
var p = (
|
|
1284
1284
|
/** @type {ComponentContext} */
|
|
1285
|
-
|
|
1285
|
+
ne
|
|
1286
1286
|
);
|
|
1287
1287
|
p.c = a;
|
|
1288
1288
|
}
|
|
1289
|
-
|
|
1289
|
+
s && (n.$$events = s), u = r(f, n) || {}, a && Zr();
|
|
1290
1290
|
}), () => {
|
|
1291
1291
|
var x;
|
|
1292
1292
|
for (var p of o) {
|
|
@@ -1297,46 +1297,46 @@ function Ca(r, { target: e, anchor: t, props: s = {}, events: n, context: a, int
|
|
|
1297
1297
|
);
|
|
1298
1298
|
--v === 0 ? (document.removeEventListener(p, Mt), je.delete(p)) : je.set(p, v);
|
|
1299
1299
|
}
|
|
1300
|
-
|
|
1300
|
+
un.delete(l), f !== t && ((x = f.parentNode) == null || x.removeChild(f));
|
|
1301
1301
|
};
|
|
1302
1302
|
});
|
|
1303
1303
|
return Sa.set(u, d), u;
|
|
1304
1304
|
}
|
|
1305
1305
|
let Sa = /* @__PURE__ */ new WeakMap();
|
|
1306
|
-
const
|
|
1306
|
+
const dn = [...`
|
|
1307
1307
|
\r\f \v\uFEFF`];
|
|
1308
1308
|
function Ta(r, e, t) {
|
|
1309
|
-
var
|
|
1309
|
+
var n = r == null ? "" : "" + r;
|
|
1310
1310
|
if (t) {
|
|
1311
|
-
for (var
|
|
1312
|
-
if (t[
|
|
1313
|
-
|
|
1314
|
-
else if (
|
|
1315
|
-
for (var a =
|
|
1311
|
+
for (var s in t)
|
|
1312
|
+
if (t[s])
|
|
1313
|
+
n = n ? n + " " + s : s;
|
|
1314
|
+
else if (n.length)
|
|
1315
|
+
for (var a = s.length, i = 0; (i = n.indexOf(s, i)) >= 0; ) {
|
|
1316
1316
|
var o = i + a;
|
|
1317
|
-
(i === 0 ||
|
|
1317
|
+
(i === 0 || dn.includes(n[i - 1])) && (o === n.length || dn.includes(n[o])) ? n = (i === 0 ? "" : n.substring(0, i)) + n.substring(o + 1) : i = o;
|
|
1318
1318
|
}
|
|
1319
1319
|
}
|
|
1320
|
-
return
|
|
1320
|
+
return n === "" ? null : n;
|
|
1321
1321
|
}
|
|
1322
|
-
function
|
|
1323
|
-
var t = e ? " !important;" : ";",
|
|
1324
|
-
for (var
|
|
1325
|
-
var a = r[
|
|
1326
|
-
a != null && a !== "" && (
|
|
1322
|
+
function cn(r, e = !1) {
|
|
1323
|
+
var t = e ? " !important;" : ";", n = "";
|
|
1324
|
+
for (var s in r) {
|
|
1325
|
+
var a = r[s];
|
|
1326
|
+
a != null && a !== "" && (n += " " + s + ": " + a + t);
|
|
1327
1327
|
}
|
|
1328
|
-
return
|
|
1328
|
+
return n;
|
|
1329
1329
|
}
|
|
1330
1330
|
function tr(r) {
|
|
1331
1331
|
return r[0] !== "-" || r[1] !== "-" ? r.toLowerCase() : r;
|
|
1332
1332
|
}
|
|
1333
1333
|
function Aa(r, e) {
|
|
1334
1334
|
if (e) {
|
|
1335
|
-
var t = "",
|
|
1336
|
-
if (Array.isArray(e) ? (
|
|
1335
|
+
var t = "", n, s;
|
|
1336
|
+
if (Array.isArray(e) ? (n = e[0], s = e[1]) : n = e, r) {
|
|
1337
1337
|
r = String(r).replaceAll(/\s*\/\*.*?\*\/\s*/g, "").trim();
|
|
1338
1338
|
var a = !1, i = 0, o = !1, l = [];
|
|
1339
|
-
|
|
1339
|
+
n && l.push(...Object.keys(n).map(tr)), s && l.push(...Object.keys(s).map(tr));
|
|
1340
1340
|
var u = 0, d = -1;
|
|
1341
1341
|
const N = r.length;
|
|
1342
1342
|
for (var f = 0; f < N; f++) {
|
|
@@ -1358,35 +1358,35 @@ function Aa(r, e) {
|
|
|
1358
1358
|
}
|
|
1359
1359
|
}
|
|
1360
1360
|
}
|
|
1361
|
-
return
|
|
1361
|
+
return n && (t += cn(n)), s && (t += cn(s, !0)), t = t.trim(), t === "" ? null : t;
|
|
1362
1362
|
}
|
|
1363
1363
|
return r == null ? null : String(r);
|
|
1364
1364
|
}
|
|
1365
|
-
function
|
|
1365
|
+
function os(r, e, t, n, s, a) {
|
|
1366
1366
|
var i = r.__className;
|
|
1367
1367
|
if (i !== t || i === void 0) {
|
|
1368
|
-
var o = Ta(t,
|
|
1368
|
+
var o = Ta(t, n, a);
|
|
1369
1369
|
o == null ? r.removeAttribute("class") : r.className = o, r.__className = t;
|
|
1370
|
-
} else if (a &&
|
|
1370
|
+
} else if (a && s !== a)
|
|
1371
1371
|
for (var l in a) {
|
|
1372
1372
|
var u = !!a[l];
|
|
1373
|
-
(
|
|
1373
|
+
(s == null || u !== !!s[l]) && r.classList.toggle(l, u);
|
|
1374
1374
|
}
|
|
1375
1375
|
return a;
|
|
1376
1376
|
}
|
|
1377
|
-
function rr(r, e = {}, t,
|
|
1378
|
-
for (var
|
|
1379
|
-
var a = t[
|
|
1380
|
-
e[
|
|
1377
|
+
function rr(r, e = {}, t, n) {
|
|
1378
|
+
for (var s in t) {
|
|
1379
|
+
var a = t[s];
|
|
1380
|
+
e[s] !== a && (t[s] == null ? r.style.removeProperty(s) : r.style.setProperty(s, a, n));
|
|
1381
1381
|
}
|
|
1382
1382
|
}
|
|
1383
|
-
function zt(r, e, t,
|
|
1384
|
-
var
|
|
1385
|
-
if (
|
|
1386
|
-
var a = Aa(e,
|
|
1383
|
+
function zt(r, e, t, n) {
|
|
1384
|
+
var s = r.__style;
|
|
1385
|
+
if (s !== e) {
|
|
1386
|
+
var a = Aa(e, n);
|
|
1387
1387
|
a == null ? r.removeAttribute("style") : r.style.cssText = a, r.__style = e;
|
|
1388
|
-
} else
|
|
1389
|
-
return
|
|
1388
|
+
} else n && (Array.isArray(n) ? (rr(r, t == null ? void 0 : t[0], n[0]), rr(r, t == null ? void 0 : t[1], n[1], "important")) : rr(r, t, n));
|
|
1389
|
+
return n;
|
|
1390
1390
|
}
|
|
1391
1391
|
const Ma = () => performance.now(), ae = {
|
|
1392
1392
|
// don't access requestAnimationFrame eagerly outside method
|
|
@@ -1399,15 +1399,15 @@ const Ma = () => performance.now(), ae = {
|
|
|
1399
1399
|
now: () => Ma(),
|
|
1400
1400
|
tasks: /* @__PURE__ */ new Set()
|
|
1401
1401
|
};
|
|
1402
|
-
function
|
|
1402
|
+
function ls() {
|
|
1403
1403
|
const r = ae.now();
|
|
1404
1404
|
ae.tasks.forEach((e) => {
|
|
1405
1405
|
e.c(r) || (ae.tasks.delete(e), e.f());
|
|
1406
|
-
}), ae.tasks.size !== 0 && ae.tick(
|
|
1406
|
+
}), ae.tasks.size !== 0 && ae.tick(ls);
|
|
1407
1407
|
}
|
|
1408
1408
|
function Oa(r) {
|
|
1409
1409
|
let e;
|
|
1410
|
-
return ae.tasks.size === 0 && ae.tick(
|
|
1410
|
+
return ae.tasks.size === 0 && ae.tick(ls), {
|
|
1411
1411
|
promise: new Promise((t) => {
|
|
1412
1412
|
ae.tasks.add(e = { c: r, f: t });
|
|
1413
1413
|
}),
|
|
@@ -1416,26 +1416,26 @@ function Oa(r) {
|
|
|
1416
1416
|
}
|
|
1417
1417
|
};
|
|
1418
1418
|
}
|
|
1419
|
-
function
|
|
1419
|
+
function fn(r, e) {
|
|
1420
1420
|
return r === e || (r == null ? void 0 : r[Ot]) === e;
|
|
1421
1421
|
}
|
|
1422
|
-
function ze(r = {}, e, t,
|
|
1422
|
+
function ze(r = {}, e, t, n) {
|
|
1423
1423
|
return la(() => {
|
|
1424
|
-
var
|
|
1425
|
-
return
|
|
1426
|
-
|
|
1427
|
-
r !== t(...a) && (e(r, ...a),
|
|
1424
|
+
var s, a;
|
|
1425
|
+
return Hn(() => {
|
|
1426
|
+
s = a, a = [], _a(() => {
|
|
1427
|
+
r !== t(...a) && (e(r, ...a), s && fn(t(...s), r) && e(null, ...s));
|
|
1428
1428
|
});
|
|
1429
1429
|
}), () => {
|
|
1430
|
-
|
|
1431
|
-
a &&
|
|
1430
|
+
Xs(() => {
|
|
1431
|
+
a && fn(t(...a), r) && e(null, ...a);
|
|
1432
1432
|
});
|
|
1433
1433
|
};
|
|
1434
1434
|
}), r;
|
|
1435
1435
|
}
|
|
1436
1436
|
const Na = "5";
|
|
1437
|
-
var
|
|
1438
|
-
typeof window < "u" && ((
|
|
1437
|
+
var An;
|
|
1438
|
+
typeof window < "u" && ((An = window.__svelte ?? (window.__svelte = {})).v ?? (An.v = /* @__PURE__ */ new Set())).add(Na);
|
|
1439
1439
|
function Ia(r) {
|
|
1440
1440
|
return r;
|
|
1441
1441
|
}
|
|
@@ -1466,10 +1466,10 @@ class Fa {
|
|
|
1466
1466
|
for (let e = 0; e < this.layers.length; e++) {
|
|
1467
1467
|
const t = this.layers[e];
|
|
1468
1468
|
if (t == null) continue;
|
|
1469
|
-
const
|
|
1470
|
-
if (
|
|
1471
|
-
for (let
|
|
1472
|
-
const a = s
|
|
1469
|
+
const n = t.animations;
|
|
1470
|
+
if (n != null)
|
|
1471
|
+
for (let s = 0; s < n.length; s++) {
|
|
1472
|
+
const a = n[s];
|
|
1473
1473
|
if (a != null) {
|
|
1474
1474
|
for (const i of a.values())
|
|
1475
1475
|
if (!i.executed && (i.executed = !0, i.function(), this.animationsCount++, this.animationsCount == this.animationsLimit))
|
|
@@ -1482,19 +1482,19 @@ class Fa {
|
|
|
1482
1482
|
window.requestAnimationFrame(this.tick.bind(this));
|
|
1483
1483
|
}
|
|
1484
1484
|
}
|
|
1485
|
-
equeue(e, t,
|
|
1485
|
+
equeue(e, t, n, s) {
|
|
1486
1486
|
let a = this.layers[e];
|
|
1487
1487
|
a == null && (a = this.layers[e] = { animations: new Array() });
|
|
1488
1488
|
let i = a.animations[t];
|
|
1489
1489
|
i == null && (i = a.animations[t] = /* @__PURE__ */ new Map());
|
|
1490
|
-
let o = { id:
|
|
1491
|
-
i.set(
|
|
1490
|
+
let o = { id: n, priority: t, executed: !1, function: s };
|
|
1491
|
+
i.set(n, o), this.animationsStarted == !1 && (this.animationsStarted = !0, this.start());
|
|
1492
1492
|
}
|
|
1493
1493
|
clear(e, t) {
|
|
1494
|
-
for (let
|
|
1495
|
-
let
|
|
1496
|
-
if (
|
|
1497
|
-
let a =
|
|
1494
|
+
for (let n = 0; n < this.layers.length; n++) {
|
|
1495
|
+
let s = this.layers[n];
|
|
1496
|
+
if (s == null) continue;
|
|
1497
|
+
let a = s.animations[e];
|
|
1498
1498
|
if (a == null) return;
|
|
1499
1499
|
let i = a.get(t);
|
|
1500
1500
|
if (i == null || i.executed == !1) return;
|
|
@@ -1512,7 +1512,7 @@ class Fa {
|
|
|
1512
1512
|
}
|
|
1513
1513
|
}
|
|
1514
1514
|
const me = new Fa();
|
|
1515
|
-
function
|
|
1515
|
+
function hn(r) {
|
|
1516
1516
|
return Object.prototype.toString.call(r) === "[object Date]";
|
|
1517
1517
|
}
|
|
1518
1518
|
function fr(r, e) {
|
|
@@ -1521,40 +1521,40 @@ function fr(r, e) {
|
|
|
1521
1521
|
if (t !== typeof e || Array.isArray(r) !== Array.isArray(e))
|
|
1522
1522
|
throw new Error("Cannot interpolate values of different type");
|
|
1523
1523
|
if (Array.isArray(r)) {
|
|
1524
|
-
const
|
|
1524
|
+
const n = (
|
|
1525
1525
|
/** @type {Array<any>} */
|
|
1526
|
-
e.map((
|
|
1526
|
+
e.map((s, a) => fr(
|
|
1527
1527
|
/** @type {Array<any>} */
|
|
1528
1528
|
r[a],
|
|
1529
|
-
|
|
1529
|
+
s
|
|
1530
1530
|
))
|
|
1531
1531
|
);
|
|
1532
|
-
return (
|
|
1532
|
+
return (s) => n.map((a) => a(s));
|
|
1533
1533
|
}
|
|
1534
1534
|
if (t === "object") {
|
|
1535
1535
|
if (!r || !e)
|
|
1536
1536
|
throw new Error("Object cannot be null");
|
|
1537
|
-
if (
|
|
1537
|
+
if (hn(r) && hn(e)) {
|
|
1538
1538
|
const a = r.getTime(), o = e.getTime() - a;
|
|
1539
1539
|
return (l) => new Date(a + l * o);
|
|
1540
1540
|
}
|
|
1541
|
-
const
|
|
1542
|
-
return
|
|
1543
|
-
|
|
1541
|
+
const n = Object.keys(e), s = {};
|
|
1542
|
+
return n.forEach((a) => {
|
|
1543
|
+
s[a] = fr(r[a], e[a]);
|
|
1544
1544
|
}), (a) => {
|
|
1545
1545
|
const i = {};
|
|
1546
|
-
return
|
|
1547
|
-
i[o] =
|
|
1546
|
+
return n.forEach((o) => {
|
|
1547
|
+
i[o] = s[o](a);
|
|
1548
1548
|
}), i;
|
|
1549
1549
|
};
|
|
1550
1550
|
}
|
|
1551
1551
|
if (t === "number") {
|
|
1552
|
-
const
|
|
1552
|
+
const n = (
|
|
1553
1553
|
/** @type {number} */
|
|
1554
1554
|
e - /** @type {number} */
|
|
1555
1555
|
r
|
|
1556
1556
|
);
|
|
1557
|
-
return (
|
|
1557
|
+
return (s) => r + s * n;
|
|
1558
1558
|
}
|
|
1559
1559
|
return () => e;
|
|
1560
1560
|
}
|
|
@@ -1591,10 +1591,10 @@ const Wr = class Wr {
|
|
|
1591
1591
|
* @param {TweenedOptions<U>} [options]
|
|
1592
1592
|
*/
|
|
1593
1593
|
static of(e, t) {
|
|
1594
|
-
const
|
|
1595
|
-
return
|
|
1596
|
-
|
|
1597
|
-
}),
|
|
1594
|
+
const n = new Wr(e(), t);
|
|
1595
|
+
return Hn(() => {
|
|
1596
|
+
n.set(e());
|
|
1597
|
+
}), n;
|
|
1598
1598
|
}
|
|
1599
1599
|
/**
|
|
1600
1600
|
* Sets `tween.target` to `value` and returns a `Promise` that resolves if and when `tween.current` catches up to it.
|
|
@@ -1608,14 +1608,14 @@ const Wr = class Wr {
|
|
|
1608
1608
|
var f;
|
|
1609
1609
|
F(k(this, Xe), e);
|
|
1610
1610
|
let {
|
|
1611
|
-
delay:
|
|
1612
|
-
duration:
|
|
1611
|
+
delay: n = 0,
|
|
1612
|
+
duration: s = 400,
|
|
1613
1613
|
easing: a = Ia,
|
|
1614
1614
|
interpolate: i = fr
|
|
1615
1615
|
} = { ...k(this, bt), ...t };
|
|
1616
|
-
if (
|
|
1616
|
+
if (s === 0)
|
|
1617
1617
|
return (f = k(this, Ae)) == null || f.abort(), F(k(this, ce), e), Promise.resolve();
|
|
1618
|
-
const o = ae.now() +
|
|
1618
|
+
const o = ae.now() + n;
|
|
1619
1619
|
let l, u = !1, d = k(this, Ae);
|
|
1620
1620
|
return Z(this, Ae, Oa((p) => {
|
|
1621
1621
|
if (p < o)
|
|
@@ -1623,12 +1623,12 @@ const Wr = class Wr {
|
|
|
1623
1623
|
if (!u) {
|
|
1624
1624
|
u = !0;
|
|
1625
1625
|
const x = k(this, ce).v;
|
|
1626
|
-
l = i(x, e), typeof
|
|
1626
|
+
l = i(x, e), typeof s == "function" && (s = s(x, e)), d == null || d.abort();
|
|
1627
1627
|
}
|
|
1628
1628
|
const v = p - o;
|
|
1629
1629
|
return v > /** @type {number} */
|
|
1630
|
-
|
|
1631
|
-
|
|
1630
|
+
s ? (F(k(this, ce), e), !1) : (F(k(this, ce), l(a(v / /** @type {number} */
|
|
1631
|
+
s))), !0);
|
|
1632
1632
|
})), k(this, Ae).promise;
|
|
1633
1633
|
}
|
|
1634
1634
|
get current() {
|
|
@@ -1659,12 +1659,12 @@ class Nt {
|
|
|
1659
1659
|
this.motion.set(this.value, { duration: 0 });
|
|
1660
1660
|
}
|
|
1661
1661
|
}
|
|
1662
|
-
var za = /* @__PURE__ */
|
|
1662
|
+
var za = /* @__PURE__ */ as('<div><div class="body svelte-1nfn9j8"></div></div>');
|
|
1663
1663
|
function Va(r, e) {
|
|
1664
1664
|
Pr(e, !0);
|
|
1665
|
-
let t,
|
|
1666
|
-
function
|
|
1667
|
-
return
|
|
1665
|
+
let t, n;
|
|
1666
|
+
function s() {
|
|
1667
|
+
return n;
|
|
1668
1668
|
}
|
|
1669
1669
|
let a = /* @__PURE__ */ q(!1);
|
|
1670
1670
|
function i(T) {
|
|
@@ -1681,7 +1681,7 @@ function Va(r, e) {
|
|
|
1681
1681
|
});
|
|
1682
1682
|
function u(T) {
|
|
1683
1683
|
t && me.equeue(e.layer, e.priority, e.id, () => {
|
|
1684
|
-
t.style.scale = T.toString(), t.style.filter = `brightness(${0.25 + 0.75 * T})`,
|
|
1684
|
+
t.style.scale = T.toString(), t.style.filter = `brightness(${0.25 + 0.75 * T})`, n.style.opacity = T.toString();
|
|
1685
1685
|
});
|
|
1686
1686
|
}
|
|
1687
1687
|
function d(T) {
|
|
@@ -1701,12 +1701,12 @@ function Va(r, e) {
|
|
|
1701
1701
|
R,
|
|
1702
1702
|
(T) => (
|
|
1703
1703
|
//#endregion
|
|
1704
|
-
|
|
1704
|
+
n = T
|
|
1705
1705
|
),
|
|
1706
|
-
() =>
|
|
1707
|
-
), ze(v, (T) => t = T, () => t),
|
|
1706
|
+
() => n
|
|
1707
|
+
), ze(v, (T) => t = T, () => t), Jn(
|
|
1708
1708
|
(T, V, K) => {
|
|
1709
|
-
x =
|
|
1709
|
+
x = os(v, 1, "pin svelte-1nfn9j8", null, x, T), N = zt(v, "", N, V), G = zt(R, "", G, K);
|
|
1710
1710
|
},
|
|
1711
1711
|
[
|
|
1712
1712
|
() => ({ displayed: L(a) }),
|
|
@@ -1721,8 +1721,8 @@ function Va(r, e) {
|
|
|
1721
1721
|
"border-radius": `${e.radius - 2}px`
|
|
1722
1722
|
})
|
|
1723
1723
|
]
|
|
1724
|
-
),
|
|
1725
|
-
getBody:
|
|
1724
|
+
), is(r, v), Zr({
|
|
1725
|
+
getBody: s,
|
|
1726
1726
|
setDisplayed: i,
|
|
1727
1727
|
getDisplayed: o,
|
|
1728
1728
|
setScale: d,
|
|
@@ -1730,13 +1730,13 @@ function Va(r, e) {
|
|
|
1730
1730
|
getScale: p
|
|
1731
1731
|
});
|
|
1732
1732
|
}
|
|
1733
|
-
var Ba = /* @__PURE__ */
|
|
1734
|
-
function
|
|
1733
|
+
var Ba = /* @__PURE__ */ as('<div><div class="pointer svelte-j5igi2"></div> <div class="bubble svelte-j5igi2"><div class="body svelte-j5igi2"></div></div></div>');
|
|
1734
|
+
function us(r, e) {
|
|
1735
1735
|
Pr(e, !0);
|
|
1736
|
-
let t,
|
|
1736
|
+
let t, n, s, a;
|
|
1737
1737
|
const i = e.width + 2 * e.margin, o = e.height + 2 * e.margin, l = () => a;
|
|
1738
1738
|
ue(() => {
|
|
1739
|
-
|
|
1739
|
+
s.style.width = `${e.margin * 4}px`, s.style.height = `${e.margin * 4}px`;
|
|
1740
1740
|
});
|
|
1741
1741
|
let u = /* @__PURE__ */ q(!0);
|
|
1742
1742
|
function d(O) {
|
|
@@ -1764,8 +1764,8 @@ function un(r, e) {
|
|
|
1764
1764
|
L(p) == !0 && R.value != 0 && (me.stacked() ? R.set(0, { duration: 0 }) : R.set(0, { duration: 150, easing: Ra })), L(p) == !1 && R.value != 1 && R.set(1, { duration: 150, easing: La });
|
|
1765
1765
|
});
|
|
1766
1766
|
function G(O) {
|
|
1767
|
-
!t || !
|
|
1768
|
-
t.style.opacity = `${O}`,
|
|
1767
|
+
!t || !n || !s || me.equeue(L(p) ? 0 : e.layer, e.priority, e.id + "_scale", () => {
|
|
1768
|
+
t.style.opacity = `${O}`, n.style.scale = `${O}`, s.style.scale = `${O}`;
|
|
1769
1769
|
});
|
|
1770
1770
|
}
|
|
1771
1771
|
let T = NaN, V = /* @__PURE__ */ q(!1), K = new Nt(-i / 2, { easing: cr }), Et = new Nt(-o / 2, { easing: cr });
|
|
@@ -1777,13 +1777,13 @@ function un(r, e) {
|
|
|
1777
1777
|
L(p) == !0 && L(V) && (K.update({ duration: 75 }), K.update({ duration: 75 }));
|
|
1778
1778
|
});
|
|
1779
1779
|
function Yr(O, le) {
|
|
1780
|
-
if (!t || !
|
|
1781
|
-
const St = O + i / 2, at = le + o / 2, Ze = o < i ? St * o / i : St, Jt = o > i ? at * i / o : at,
|
|
1780
|
+
if (!t || !n || !s) return;
|
|
1781
|
+
const St = O + i / 2, at = le + o / 2, Ze = o < i ? St * o / i : St, Jt = o > i ? at * i / o : at, gs = Math.atan2(Jt, Ze) / Math.PI * 180 - 45, Gr = 0, _s = 30, Gt = Math.sqrt(Ze * Ze + Jt * Jt), it = Math.min(i, o) / 2, ys = it * Math.SQRT2, ws = (Gt - it) / (ys - it), Kr = Gr + ws * (_s - Gr), ks = Gt < it ? Gt / it : 1;
|
|
1782
1782
|
me.equeue(e.layer, e.priority, e.id + "_angle", () => {
|
|
1783
|
-
|
|
1783
|
+
n.style.transform = `translate(${Math.round(O)}px, ${Math.round(le)}px)`, s.style.transform = `scale(${ks}) rotate(${gs}deg) skew(${Kr}deg, ${Kr}deg)`;
|
|
1784
1784
|
});
|
|
1785
1785
|
}
|
|
1786
|
-
function
|
|
1786
|
+
function ms(O) {
|
|
1787
1787
|
if (L(V) == !1) {
|
|
1788
1788
|
let le = Qt.getOffsets(i, o, O);
|
|
1789
1789
|
K.set(Math.round(le.offsetX), { duration: 0 }), Et.set(Math.round(le.offsetY), { duration: 0 }), Yr(K.value, Et.value), T = O, F(V, !0);
|
|
@@ -1792,7 +1792,7 @@ function un(r, e) {
|
|
|
1792
1792
|
K.set(Math.round(Ze.offsetX), { duration: at }), Et.set(Math.round(Ze.offsetY), { duration: at }), T = O;
|
|
1793
1793
|
}
|
|
1794
1794
|
}
|
|
1795
|
-
function
|
|
1795
|
+
function vs() {
|
|
1796
1796
|
return Qt.getOffsets(i, o, T);
|
|
1797
1797
|
}
|
|
1798
1798
|
var Ct = Ba();
|
|
@@ -1802,28 +1802,28 @@ function un(r, e) {
|
|
|
1802
1802
|
Hr,
|
|
1803
1803
|
(O) => (
|
|
1804
1804
|
//#endregion
|
|
1805
|
-
|
|
1805
|
+
s = O
|
|
1806
1806
|
),
|
|
1807
|
-
() =>
|
|
1807
|
+
() => s
|
|
1808
1808
|
);
|
|
1809
|
-
var Ht =
|
|
1810
|
-
return ze(Jr, (O) => a = O, () => a), ze(Ht, (O) =>
|
|
1809
|
+
var Ht = sa(Hr, 2), Jr = dr(Ht);
|
|
1810
|
+
return ze(Jr, (O) => a = O, () => a), ze(Ht, (O) => n = O, () => n), ze(Ct, (O) => t = O, () => t), Jn(
|
|
1811
1811
|
(O) => {
|
|
1812
|
-
Xr =
|
|
1812
|
+
Xr = os(Ct, 1, "anchor svelte-j5igi2", null, Xr, O), zt(Ht, `margin: ${e.margin}px;`), zt(Jr, `width: ${e.width}px; height: ${e.height}px; border-radius: ${e.radius}px;`);
|
|
1813
1813
|
},
|
|
1814
1814
|
[() => ({ displayed: L(u) })]
|
|
1815
|
-
),
|
|
1815
|
+
), is(r, Ct), Zr({
|
|
1816
1816
|
getBody: l,
|
|
1817
1817
|
setDisplayed: d,
|
|
1818
1818
|
getDisplayed: f,
|
|
1819
1819
|
setCollapsed: v,
|
|
1820
1820
|
getCollapsed: x,
|
|
1821
1821
|
getExpanded: N,
|
|
1822
|
-
setAngle:
|
|
1823
|
-
getOffsets:
|
|
1822
|
+
setAngle: ms,
|
|
1823
|
+
getOffsets: vs
|
|
1824
1824
|
});
|
|
1825
1825
|
}
|
|
1826
|
-
class
|
|
1826
|
+
class ds {
|
|
1827
1827
|
/**
|
|
1828
1828
|
* @param mapBounds - The bounds of the map.
|
|
1829
1829
|
* @param mapZoom - The zoom level of the map.
|
|
@@ -1831,12 +1831,12 @@ class dn {
|
|
|
1831
1831
|
* @param offsetX - The x offset of the map in pixels at zoom level n.
|
|
1832
1832
|
* @param offsetY - The y offset of the map in pixels at zoom level n.
|
|
1833
1833
|
*/
|
|
1834
|
-
constructor(e, t,
|
|
1834
|
+
constructor(e, t, n, s, a) {
|
|
1835
1835
|
h(this, "swLat");
|
|
1836
1836
|
h(this, "swLng");
|
|
1837
1837
|
h(this, "neLat");
|
|
1838
1838
|
h(this, "neLng");
|
|
1839
|
-
const i =
|
|
1839
|
+
const i = n * Math.pow(2, t), o = Tt.project(e.sw.lat, e.sw.lng, i), l = Tt.project(e.ne.lat, e.ne.lng, i), u = o.x - s, d = o.y + a, f = l.x + s, p = l.y - a, v = Tt.unproject(u, d, i), x = Tt.unproject(f, p, i);
|
|
1840
1840
|
this.swLat = v.lat, this.swLng = v.lng, this.neLat = x.lat, this.neLng = x.lng;
|
|
1841
1841
|
}
|
|
1842
1842
|
contains(e, t) {
|
|
@@ -1845,49 +1845,49 @@ class dn {
|
|
|
1845
1845
|
}
|
|
1846
1846
|
var A;
|
|
1847
1847
|
(function(r) {
|
|
1848
|
-
r.assertEqual = (
|
|
1848
|
+
r.assertEqual = (s) => {
|
|
1849
1849
|
};
|
|
1850
|
-
function e(
|
|
1850
|
+
function e(s) {
|
|
1851
1851
|
}
|
|
1852
1852
|
r.assertIs = e;
|
|
1853
|
-
function t(
|
|
1853
|
+
function t(s) {
|
|
1854
1854
|
throw new Error();
|
|
1855
1855
|
}
|
|
1856
|
-
r.assertNever = t, r.arrayToEnum = (
|
|
1856
|
+
r.assertNever = t, r.arrayToEnum = (s) => {
|
|
1857
1857
|
const a = {};
|
|
1858
|
-
for (const i of
|
|
1858
|
+
for (const i of s)
|
|
1859
1859
|
a[i] = i;
|
|
1860
1860
|
return a;
|
|
1861
|
-
}, r.getValidEnumValues = (
|
|
1862
|
-
const a = r.objectKeys(
|
|
1861
|
+
}, r.getValidEnumValues = (s) => {
|
|
1862
|
+
const a = r.objectKeys(s).filter((o) => typeof s[s[o]] != "number"), i = {};
|
|
1863
1863
|
for (const o of a)
|
|
1864
|
-
i[o] =
|
|
1864
|
+
i[o] = s[o];
|
|
1865
1865
|
return r.objectValues(i);
|
|
1866
|
-
}, r.objectValues = (
|
|
1867
|
-
return
|
|
1868
|
-
}), r.objectKeys = typeof Object.keys == "function" ? (
|
|
1866
|
+
}, r.objectValues = (s) => r.objectKeys(s).map(function(a) {
|
|
1867
|
+
return s[a];
|
|
1868
|
+
}), r.objectKeys = typeof Object.keys == "function" ? (s) => Object.keys(s) : (s) => {
|
|
1869
1869
|
const a = [];
|
|
1870
|
-
for (const i in
|
|
1871
|
-
Object.prototype.hasOwnProperty.call(
|
|
1870
|
+
for (const i in s)
|
|
1871
|
+
Object.prototype.hasOwnProperty.call(s, i) && a.push(i);
|
|
1872
1872
|
return a;
|
|
1873
|
-
}, r.find = (
|
|
1874
|
-
for (const i of
|
|
1873
|
+
}, r.find = (s, a) => {
|
|
1874
|
+
for (const i of s)
|
|
1875
1875
|
if (a(i))
|
|
1876
1876
|
return i;
|
|
1877
|
-
}, r.isInteger = typeof Number.isInteger == "function" ? (
|
|
1878
|
-
function s
|
|
1879
|
-
return
|
|
1877
|
+
}, r.isInteger = typeof Number.isInteger == "function" ? (s) => Number.isInteger(s) : (s) => typeof s == "number" && Number.isFinite(s) && Math.floor(s) === s;
|
|
1878
|
+
function n(s, a = " | ") {
|
|
1879
|
+
return s.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
|
|
1880
1880
|
}
|
|
1881
|
-
r.joinValues =
|
|
1881
|
+
r.joinValues = n, r.jsonStringifyReplacer = (s, a) => typeof a == "bigint" ? a.toString() : a;
|
|
1882
1882
|
})(A || (A = {}));
|
|
1883
|
-
var
|
|
1883
|
+
var pn;
|
|
1884
1884
|
(function(r) {
|
|
1885
1885
|
r.mergeShapes = (e, t) => ({
|
|
1886
1886
|
...e,
|
|
1887
1887
|
...t
|
|
1888
1888
|
// second overwrites first
|
|
1889
1889
|
});
|
|
1890
|
-
})(
|
|
1890
|
+
})(pn || (pn = {}));
|
|
1891
1891
|
const g = A.arrayToEnum([
|
|
1892
1892
|
"string",
|
|
1893
1893
|
"nan",
|
|
@@ -1953,10 +1953,10 @@ class te extends Error {
|
|
|
1953
1953
|
return this.issues;
|
|
1954
1954
|
}
|
|
1955
1955
|
constructor(e) {
|
|
1956
|
-
super(), this.issues = [], this.addIssue = (
|
|
1957
|
-
this.issues = [...this.issues,
|
|
1958
|
-
}, this.addIssues = (
|
|
1959
|
-
this.issues = [...this.issues, ...
|
|
1956
|
+
super(), this.issues = [], this.addIssue = (n) => {
|
|
1957
|
+
this.issues = [...this.issues, n];
|
|
1958
|
+
}, this.addIssues = (n = []) => {
|
|
1959
|
+
this.issues = [...this.issues, ...n];
|
|
1960
1960
|
};
|
|
1961
1961
|
const t = new.target.prototype;
|
|
1962
1962
|
Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e;
|
|
@@ -1964,25 +1964,25 @@ class te extends Error {
|
|
|
1964
1964
|
format(e) {
|
|
1965
1965
|
const t = e || function(a) {
|
|
1966
1966
|
return a.message;
|
|
1967
|
-
},
|
|
1967
|
+
}, n = { _errors: [] }, s = (a) => {
|
|
1968
1968
|
for (const i of a.issues)
|
|
1969
1969
|
if (i.code === "invalid_union")
|
|
1970
|
-
i.unionErrors.map(
|
|
1970
|
+
i.unionErrors.map(s);
|
|
1971
1971
|
else if (i.code === "invalid_return_type")
|
|
1972
|
-
|
|
1972
|
+
s(i.returnTypeError);
|
|
1973
1973
|
else if (i.code === "invalid_arguments")
|
|
1974
|
-
|
|
1974
|
+
s(i.argumentsError);
|
|
1975
1975
|
else if (i.path.length === 0)
|
|
1976
|
-
|
|
1976
|
+
n._errors.push(t(i));
|
|
1977
1977
|
else {
|
|
1978
|
-
let o =
|
|
1978
|
+
let o = n, l = 0;
|
|
1979
1979
|
for (; l < i.path.length; ) {
|
|
1980
1980
|
const u = i.path[l];
|
|
1981
1981
|
l === i.path.length - 1 ? (o[u] = o[u] || { _errors: [] }, o[u]._errors.push(t(i))) : o[u] = o[u] || { _errors: [] }, o = o[u], l++;
|
|
1982
1982
|
}
|
|
1983
1983
|
}
|
|
1984
1984
|
};
|
|
1985
|
-
return
|
|
1985
|
+
return s(this), n;
|
|
1986
1986
|
}
|
|
1987
1987
|
static assert(e) {
|
|
1988
1988
|
if (!(e instanceof te))
|
|
@@ -1998,14 +1998,14 @@ class te extends Error {
|
|
|
1998
1998
|
return this.issues.length === 0;
|
|
1999
1999
|
}
|
|
2000
2000
|
flatten(e = (t) => t.message) {
|
|
2001
|
-
const t = {},
|
|
2002
|
-
for (const
|
|
2003
|
-
if (
|
|
2004
|
-
const a =
|
|
2005
|
-
t[a] = t[a] || [], t[a].push(e(
|
|
2001
|
+
const t = {}, n = [];
|
|
2002
|
+
for (const s of this.issues)
|
|
2003
|
+
if (s.path.length > 0) {
|
|
2004
|
+
const a = s.path[0];
|
|
2005
|
+
t[a] = t[a] || [], t[a].push(e(s));
|
|
2006
2006
|
} else
|
|
2007
|
-
|
|
2008
|
-
return { formErrors:
|
|
2007
|
+
n.push(e(s));
|
|
2008
|
+
return { formErrors: n, fieldErrors: t };
|
|
2009
2009
|
}
|
|
2010
2010
|
get formErrors() {
|
|
2011
2011
|
return this.flatten();
|
|
@@ -2073,28 +2073,28 @@ function pr() {
|
|
|
2073
2073
|
return Ua;
|
|
2074
2074
|
}
|
|
2075
2075
|
const mr = (r) => {
|
|
2076
|
-
const { data: e, path: t, errorMaps:
|
|
2077
|
-
...
|
|
2076
|
+
const { data: e, path: t, errorMaps: n, issueData: s } = r, a = [...t, ...s.path || []], i = {
|
|
2077
|
+
...s,
|
|
2078
2078
|
path: a
|
|
2079
2079
|
};
|
|
2080
|
-
if (
|
|
2080
|
+
if (s.message !== void 0)
|
|
2081
2081
|
return {
|
|
2082
|
-
...
|
|
2082
|
+
...s,
|
|
2083
2083
|
path: a,
|
|
2084
|
-
message:
|
|
2084
|
+
message: s.message
|
|
2085
2085
|
};
|
|
2086
2086
|
let o = "";
|
|
2087
|
-
const l =
|
|
2087
|
+
const l = n.filter((u) => !!u).slice().reverse();
|
|
2088
2088
|
for (const u of l)
|
|
2089
2089
|
o = u(i, { data: e, defaultError: o }).message;
|
|
2090
2090
|
return {
|
|
2091
|
-
...
|
|
2091
|
+
...s,
|
|
2092
2092
|
path: a,
|
|
2093
2093
|
message: o
|
|
2094
2094
|
};
|
|
2095
2095
|
};
|
|
2096
2096
|
function m(r, e) {
|
|
2097
|
-
const t = pr(),
|
|
2097
|
+
const t = pr(), n = mr({
|
|
2098
2098
|
issueData: e,
|
|
2099
2099
|
data: r.data,
|
|
2100
2100
|
path: r.path,
|
|
@@ -2107,9 +2107,9 @@ function m(r, e) {
|
|
|
2107
2107
|
// then global override map
|
|
2108
2108
|
t === vt ? void 0 : vt
|
|
2109
2109
|
// then global default map
|
|
2110
|
-
].filter((
|
|
2110
|
+
].filter((s) => !!s)
|
|
2111
2111
|
});
|
|
2112
|
-
r.common.issues.push(
|
|
2112
|
+
r.common.issues.push(n);
|
|
2113
2113
|
}
|
|
2114
2114
|
class J {
|
|
2115
2115
|
constructor() {
|
|
@@ -2122,52 +2122,52 @@ class J {
|
|
|
2122
2122
|
this.value !== "aborted" && (this.value = "aborted");
|
|
2123
2123
|
}
|
|
2124
2124
|
static mergeArray(e, t) {
|
|
2125
|
-
const
|
|
2126
|
-
for (const
|
|
2127
|
-
if (
|
|
2125
|
+
const n = [];
|
|
2126
|
+
for (const s of t) {
|
|
2127
|
+
if (s.status === "aborted")
|
|
2128
2128
|
return y;
|
|
2129
|
-
|
|
2129
|
+
s.status === "dirty" && e.dirty(), n.push(s.value);
|
|
2130
2130
|
}
|
|
2131
|
-
return { status: e.value, value:
|
|
2131
|
+
return { status: e.value, value: n };
|
|
2132
2132
|
}
|
|
2133
2133
|
static async mergeObjectAsync(e, t) {
|
|
2134
|
-
const
|
|
2135
|
-
for (const
|
|
2136
|
-
const a = await
|
|
2137
|
-
|
|
2134
|
+
const n = [];
|
|
2135
|
+
for (const s of t) {
|
|
2136
|
+
const a = await s.key, i = await s.value;
|
|
2137
|
+
n.push({
|
|
2138
2138
|
key: a,
|
|
2139
2139
|
value: i
|
|
2140
2140
|
});
|
|
2141
2141
|
}
|
|
2142
|
-
return J.mergeObjectSync(e,
|
|
2142
|
+
return J.mergeObjectSync(e, n);
|
|
2143
2143
|
}
|
|
2144
2144
|
static mergeObjectSync(e, t) {
|
|
2145
|
-
const
|
|
2146
|
-
for (const
|
|
2147
|
-
const { key: a, value: i } =
|
|
2145
|
+
const n = {};
|
|
2146
|
+
for (const s of t) {
|
|
2147
|
+
const { key: a, value: i } = s;
|
|
2148
2148
|
if (a.status === "aborted" || i.status === "aborted")
|
|
2149
2149
|
return y;
|
|
2150
|
-
a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value < "u" ||
|
|
2150
|
+
a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value < "u" || s.alwaysSet) && (n[a.value] = i.value);
|
|
2151
2151
|
}
|
|
2152
|
-
return { status: e.value, value:
|
|
2152
|
+
return { status: e.value, value: n };
|
|
2153
2153
|
}
|
|
2154
2154
|
}
|
|
2155
2155
|
const y = Object.freeze({
|
|
2156
2156
|
status: "aborted"
|
|
2157
|
-
}), dt = (r) => ({ status: "dirty", value: r }), W = (r) => ({ status: "valid", value: r }),
|
|
2157
|
+
}), dt = (r) => ({ status: "dirty", value: r }), W = (r) => ({ status: "valid", value: r }), mn = (r) => r.status === "aborted", vn = (r) => r.status === "dirty", Ge = (r) => r.status === "valid", Vt = (r) => typeof Promise < "u" && r instanceof Promise;
|
|
2158
2158
|
var _;
|
|
2159
2159
|
(function(r) {
|
|
2160
2160
|
r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
2161
2161
|
})(_ || (_ = {}));
|
|
2162
2162
|
class be {
|
|
2163
|
-
constructor(e, t,
|
|
2164
|
-
this._cachedPath = [], this.parent = e, this.data = t, this._path =
|
|
2163
|
+
constructor(e, t, n, s) {
|
|
2164
|
+
this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = s;
|
|
2165
2165
|
}
|
|
2166
2166
|
get path() {
|
|
2167
2167
|
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
2168
2168
|
}
|
|
2169
2169
|
}
|
|
2170
|
-
const
|
|
2170
|
+
const gn = (r, e) => {
|
|
2171
2171
|
if (Ge(e))
|
|
2172
2172
|
return { success: !0, data: e.value };
|
|
2173
2173
|
if (!r.common.issues.length)
|
|
@@ -2185,13 +2185,13 @@ const vs = (r, e) => {
|
|
|
2185
2185
|
function b(r) {
|
|
2186
2186
|
if (!r)
|
|
2187
2187
|
return {};
|
|
2188
|
-
const { errorMap: e, invalid_type_error: t, required_error:
|
|
2189
|
-
if (e && (t ||
|
|
2188
|
+
const { errorMap: e, invalid_type_error: t, required_error: n, description: s } = r;
|
|
2189
|
+
if (e && (t || n))
|
|
2190
2190
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
2191
|
-
return e ? { errorMap: e, description:
|
|
2191
|
+
return e ? { errorMap: e, description: s } : { errorMap: (i, o) => {
|
|
2192
2192
|
const { message: l } = r;
|
|
2193
|
-
return i.code === "invalid_enum_value" ? { message: l ?? o.defaultError } : typeof o.data > "u" ? { message: l ??
|
|
2194
|
-
}, description:
|
|
2193
|
+
return i.code === "invalid_enum_value" ? { message: l ?? o.defaultError } : typeof o.data > "u" ? { message: l ?? n ?? o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: l ?? t ?? o.defaultError };
|
|
2194
|
+
}, description: s };
|
|
2195
2195
|
}
|
|
2196
2196
|
class S {
|
|
2197
2197
|
get description() {
|
|
@@ -2234,13 +2234,13 @@ class S {
|
|
|
2234
2234
|
return Promise.resolve(t);
|
|
2235
2235
|
}
|
|
2236
2236
|
parse(e, t) {
|
|
2237
|
-
const
|
|
2238
|
-
if (
|
|
2239
|
-
return
|
|
2240
|
-
throw
|
|
2237
|
+
const n = this.safeParse(e, t);
|
|
2238
|
+
if (n.success)
|
|
2239
|
+
return n.data;
|
|
2240
|
+
throw n.error;
|
|
2241
2241
|
}
|
|
2242
2242
|
safeParse(e, t) {
|
|
2243
|
-
const
|
|
2243
|
+
const n = {
|
|
2244
2244
|
common: {
|
|
2245
2245
|
issues: [],
|
|
2246
2246
|
async: (t == null ? void 0 : t.async) ?? !1,
|
|
@@ -2251,11 +2251,11 @@ class S {
|
|
|
2251
2251
|
parent: null,
|
|
2252
2252
|
data: e,
|
|
2253
2253
|
parsedType: pe(e)
|
|
2254
|
-
},
|
|
2255
|
-
return
|
|
2254
|
+
}, s = this._parseSync({ data: e, path: n.path, parent: n });
|
|
2255
|
+
return gn(n, s);
|
|
2256
2256
|
}
|
|
2257
2257
|
"~validate"(e) {
|
|
2258
|
-
var
|
|
2258
|
+
var n, s;
|
|
2259
2259
|
const t = {
|
|
2260
2260
|
common: {
|
|
2261
2261
|
issues: [],
|
|
@@ -2276,7 +2276,7 @@ class S {
|
|
|
2276
2276
|
issues: t.common.issues
|
|
2277
2277
|
};
|
|
2278
2278
|
} catch (a) {
|
|
2279
|
-
(
|
|
2279
|
+
(s = (n = a == null ? void 0 : a.message) == null ? void 0 : n.toLowerCase()) != null && s.includes("encountered") && (this["~standard"].async = !0), t.common = {
|
|
2280
2280
|
issues: [],
|
|
2281
2281
|
async: !0
|
|
2282
2282
|
};
|
|
@@ -2288,13 +2288,13 @@ class S {
|
|
|
2288
2288
|
});
|
|
2289
2289
|
}
|
|
2290
2290
|
async parseAsync(e, t) {
|
|
2291
|
-
const
|
|
2292
|
-
if (
|
|
2293
|
-
return
|
|
2294
|
-
throw
|
|
2291
|
+
const n = await this.safeParseAsync(e, t);
|
|
2292
|
+
if (n.success)
|
|
2293
|
+
return n.data;
|
|
2294
|
+
throw n.error;
|
|
2295
2295
|
}
|
|
2296
2296
|
async safeParseAsync(e, t) {
|
|
2297
|
-
const
|
|
2297
|
+
const n = {
|
|
2298
2298
|
common: {
|
|
2299
2299
|
issues: [],
|
|
2300
2300
|
contextualErrorMap: t == null ? void 0 : t.errorMap,
|
|
@@ -2305,21 +2305,21 @@ class S {
|
|
|
2305
2305
|
parent: null,
|
|
2306
2306
|
data: e,
|
|
2307
2307
|
parsedType: pe(e)
|
|
2308
|
-
},
|
|
2309
|
-
return
|
|
2308
|
+
}, s = this._parse({ data: e, path: n.path, parent: n }), a = await (Vt(s) ? s : Promise.resolve(s));
|
|
2309
|
+
return gn(n, a);
|
|
2310
2310
|
}
|
|
2311
2311
|
refine(e, t) {
|
|
2312
|
-
const
|
|
2313
|
-
return this._refinement((
|
|
2314
|
-
const i = e(
|
|
2312
|
+
const n = (s) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(s) : t;
|
|
2313
|
+
return this._refinement((s, a) => {
|
|
2314
|
+
const i = e(s), o = () => a.addIssue({
|
|
2315
2315
|
code: c.custom,
|
|
2316
|
-
...s
|
|
2316
|
+
...n(s)
|
|
2317
2317
|
});
|
|
2318
2318
|
return typeof Promise < "u" && i instanceof Promise ? i.then((l) => l ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
|
|
2319
2319
|
});
|
|
2320
2320
|
}
|
|
2321
2321
|
refinement(e, t) {
|
|
2322
|
-
return this._refinement((
|
|
2322
|
+
return this._refinement((n, s) => e(n) ? !0 : (s.addIssue(typeof t == "function" ? t(n, s) : t), !1));
|
|
2323
2323
|
}
|
|
2324
2324
|
_refinement(e) {
|
|
2325
2325
|
return new et({
|
|
@@ -2413,19 +2413,19 @@ class S {
|
|
|
2413
2413
|
}
|
|
2414
2414
|
}
|
|
2415
2415
|
const $a = /^c[^\s-]{8,}$/i, qa = /^[0-9a-z]+$/, Wa = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Ya = /^[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, Xa = /^[a-z0-9_-]{21}$/i, Ha = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Ja = /^[-+]?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)?)??$/, Ga = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ka = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
2416
|
-
let
|
|
2417
|
-
const Qa = /^(?:(?: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])$/, ei = /^(?:(?: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])$/, ti = /^(([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]))$/, ri = /^(([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])$/,
|
|
2418
|
-
function
|
|
2416
|
+
let nr;
|
|
2417
|
+
const Qa = /^(?:(?: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])$/, ei = /^(?:(?: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])$/, ti = /^(([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]))$/, ri = /^(([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])$/, ni = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, si = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, cs = "((\\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])))", ai = new RegExp(`^${cs}$`);
|
|
2418
|
+
function fs(r) {
|
|
2419
2419
|
let e = "[0-5]\\d";
|
|
2420
2420
|
r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`);
|
|
2421
2421
|
const t = r.precision ? "+" : "?";
|
|
2422
2422
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
|
|
2423
2423
|
}
|
|
2424
2424
|
function ii(r) {
|
|
2425
|
-
return new RegExp(`^${
|
|
2425
|
+
return new RegExp(`^${fs(r)}$`);
|
|
2426
2426
|
}
|
|
2427
2427
|
function oi(r) {
|
|
2428
|
-
let e = `${
|
|
2428
|
+
let e = `${cs}T${fs(r)}`;
|
|
2429
2429
|
const t = [];
|
|
2430
2430
|
return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
2431
2431
|
}
|
|
@@ -2439,8 +2439,8 @@ function ui(r, e) {
|
|
|
2439
2439
|
const [t] = r.split(".");
|
|
2440
2440
|
if (!t)
|
|
2441
2441
|
return !1;
|
|
2442
|
-
const
|
|
2443
|
-
return !(typeof
|
|
2442
|
+
const n = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), s = JSON.parse(atob(n));
|
|
2443
|
+
return !(typeof s != "object" || s === null || "typ" in s && (s == null ? void 0 : s.typ) !== "JWT" || !s.alg || e && s.alg !== e);
|
|
2444
2444
|
} catch {
|
|
2445
2445
|
return !1;
|
|
2446
2446
|
}
|
|
@@ -2458,156 +2458,156 @@ class we extends S {
|
|
|
2458
2458
|
received: a.parsedType
|
|
2459
2459
|
}), y;
|
|
2460
2460
|
}
|
|
2461
|
-
const
|
|
2462
|
-
let
|
|
2461
|
+
const n = new J();
|
|
2462
|
+
let s;
|
|
2463
2463
|
for (const a of this._def.checks)
|
|
2464
2464
|
if (a.kind === "min")
|
|
2465
|
-
e.data.length < a.value && (
|
|
2465
|
+
e.data.length < a.value && (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2466
2466
|
code: c.too_small,
|
|
2467
2467
|
minimum: a.value,
|
|
2468
2468
|
type: "string",
|
|
2469
2469
|
inclusive: !0,
|
|
2470
2470
|
exact: !1,
|
|
2471
2471
|
message: a.message
|
|
2472
|
-
}),
|
|
2472
|
+
}), n.dirty());
|
|
2473
2473
|
else if (a.kind === "max")
|
|
2474
|
-
e.data.length > a.value && (
|
|
2474
|
+
e.data.length > a.value && (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2475
2475
|
code: c.too_big,
|
|
2476
2476
|
maximum: a.value,
|
|
2477
2477
|
type: "string",
|
|
2478
2478
|
inclusive: !0,
|
|
2479
2479
|
exact: !1,
|
|
2480
2480
|
message: a.message
|
|
2481
|
-
}),
|
|
2481
|
+
}), n.dirty());
|
|
2482
2482
|
else if (a.kind === "length") {
|
|
2483
2483
|
const i = e.data.length > a.value, o = e.data.length < a.value;
|
|
2484
|
-
(i || o) && (
|
|
2484
|
+
(i || o) && (s = this._getOrReturnCtx(e, s), i ? m(s, {
|
|
2485
2485
|
code: c.too_big,
|
|
2486
2486
|
maximum: a.value,
|
|
2487
2487
|
type: "string",
|
|
2488
2488
|
inclusive: !0,
|
|
2489
2489
|
exact: !0,
|
|
2490
2490
|
message: a.message
|
|
2491
|
-
}) : o && m(
|
|
2491
|
+
}) : o && m(s, {
|
|
2492
2492
|
code: c.too_small,
|
|
2493
2493
|
minimum: a.value,
|
|
2494
2494
|
type: "string",
|
|
2495
2495
|
inclusive: !0,
|
|
2496
2496
|
exact: !0,
|
|
2497
2497
|
message: a.message
|
|
2498
|
-
}),
|
|
2498
|
+
}), n.dirty());
|
|
2499
2499
|
} else if (a.kind === "email")
|
|
2500
|
-
Ga.test(e.data) || (
|
|
2500
|
+
Ga.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2501
2501
|
validation: "email",
|
|
2502
2502
|
code: c.invalid_string,
|
|
2503
2503
|
message: a.message
|
|
2504
|
-
}),
|
|
2504
|
+
}), n.dirty());
|
|
2505
2505
|
else if (a.kind === "emoji")
|
|
2506
|
-
|
|
2506
|
+
nr || (nr = new RegExp(Ka, "u")), nr.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2507
2507
|
validation: "emoji",
|
|
2508
2508
|
code: c.invalid_string,
|
|
2509
2509
|
message: a.message
|
|
2510
|
-
}),
|
|
2510
|
+
}), n.dirty());
|
|
2511
2511
|
else if (a.kind === "uuid")
|
|
2512
|
-
Ya.test(e.data) || (
|
|
2512
|
+
Ya.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2513
2513
|
validation: "uuid",
|
|
2514
2514
|
code: c.invalid_string,
|
|
2515
2515
|
message: a.message
|
|
2516
|
-
}),
|
|
2516
|
+
}), n.dirty());
|
|
2517
2517
|
else if (a.kind === "nanoid")
|
|
2518
|
-
Xa.test(e.data) || (
|
|
2518
|
+
Xa.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2519
2519
|
validation: "nanoid",
|
|
2520
2520
|
code: c.invalid_string,
|
|
2521
2521
|
message: a.message
|
|
2522
|
-
}),
|
|
2522
|
+
}), n.dirty());
|
|
2523
2523
|
else if (a.kind === "cuid")
|
|
2524
|
-
$a.test(e.data) || (
|
|
2524
|
+
$a.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2525
2525
|
validation: "cuid",
|
|
2526
2526
|
code: c.invalid_string,
|
|
2527
2527
|
message: a.message
|
|
2528
|
-
}),
|
|
2528
|
+
}), n.dirty());
|
|
2529
2529
|
else if (a.kind === "cuid2")
|
|
2530
|
-
qa.test(e.data) || (
|
|
2530
|
+
qa.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2531
2531
|
validation: "cuid2",
|
|
2532
2532
|
code: c.invalid_string,
|
|
2533
2533
|
message: a.message
|
|
2534
|
-
}),
|
|
2534
|
+
}), n.dirty());
|
|
2535
2535
|
else if (a.kind === "ulid")
|
|
2536
|
-
Wa.test(e.data) || (
|
|
2536
|
+
Wa.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2537
2537
|
validation: "ulid",
|
|
2538
2538
|
code: c.invalid_string,
|
|
2539
2539
|
message: a.message
|
|
2540
|
-
}),
|
|
2540
|
+
}), n.dirty());
|
|
2541
2541
|
else if (a.kind === "url")
|
|
2542
2542
|
try {
|
|
2543
2543
|
new URL(e.data);
|
|
2544
2544
|
} catch {
|
|
2545
|
-
|
|
2545
|
+
s = this._getOrReturnCtx(e, s), m(s, {
|
|
2546
2546
|
validation: "url",
|
|
2547
2547
|
code: c.invalid_string,
|
|
2548
2548
|
message: a.message
|
|
2549
|
-
}),
|
|
2549
|
+
}), n.dirty();
|
|
2550
2550
|
}
|
|
2551
|
-
else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (
|
|
2551
|
+
else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2552
2552
|
validation: "regex",
|
|
2553
2553
|
code: c.invalid_string,
|
|
2554
2554
|
message: a.message
|
|
2555
|
-
}),
|
|
2555
|
+
}), n.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2556
2556
|
code: c.invalid_string,
|
|
2557
2557
|
validation: { includes: a.value, position: a.position },
|
|
2558
2558
|
message: a.message
|
|
2559
|
-
}),
|
|
2559
|
+
}), n.dirty()) : a.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : a.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : a.kind === "startsWith" ? e.data.startsWith(a.value) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2560
2560
|
code: c.invalid_string,
|
|
2561
2561
|
validation: { startsWith: a.value },
|
|
2562
2562
|
message: a.message
|
|
2563
|
-
}),
|
|
2563
|
+
}), n.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2564
2564
|
code: c.invalid_string,
|
|
2565
2565
|
validation: { endsWith: a.value },
|
|
2566
2566
|
message: a.message
|
|
2567
|
-
}),
|
|
2567
|
+
}), n.dirty()) : a.kind === "datetime" ? oi(a).test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2568
2568
|
code: c.invalid_string,
|
|
2569
2569
|
validation: "datetime",
|
|
2570
2570
|
message: a.message
|
|
2571
|
-
}),
|
|
2571
|
+
}), n.dirty()) : a.kind === "date" ? ai.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2572
2572
|
code: c.invalid_string,
|
|
2573
2573
|
validation: "date",
|
|
2574
2574
|
message: a.message
|
|
2575
|
-
}),
|
|
2575
|
+
}), n.dirty()) : a.kind === "time" ? ii(a).test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2576
2576
|
code: c.invalid_string,
|
|
2577
2577
|
validation: "time",
|
|
2578
2578
|
message: a.message
|
|
2579
|
-
}),
|
|
2579
|
+
}), n.dirty()) : a.kind === "duration" ? Ja.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2580
2580
|
validation: "duration",
|
|
2581
2581
|
code: c.invalid_string,
|
|
2582
2582
|
message: a.message
|
|
2583
|
-
}),
|
|
2583
|
+
}), n.dirty()) : a.kind === "ip" ? li(e.data, a.version) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2584
2584
|
validation: "ip",
|
|
2585
2585
|
code: c.invalid_string,
|
|
2586
2586
|
message: a.message
|
|
2587
|
-
}),
|
|
2587
|
+
}), n.dirty()) : a.kind === "jwt" ? ui(e.data, a.alg) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2588
2588
|
validation: "jwt",
|
|
2589
2589
|
code: c.invalid_string,
|
|
2590
2590
|
message: a.message
|
|
2591
|
-
}),
|
|
2591
|
+
}), n.dirty()) : a.kind === "cidr" ? di(e.data, a.version) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2592
2592
|
validation: "cidr",
|
|
2593
2593
|
code: c.invalid_string,
|
|
2594
2594
|
message: a.message
|
|
2595
|
-
}),
|
|
2595
|
+
}), n.dirty()) : a.kind === "base64" ? ni.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2596
2596
|
validation: "base64",
|
|
2597
2597
|
code: c.invalid_string,
|
|
2598
2598
|
message: a.message
|
|
2599
|
-
}),
|
|
2599
|
+
}), n.dirty()) : a.kind === "base64url" ? si.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2600
2600
|
validation: "base64url",
|
|
2601
2601
|
code: c.invalid_string,
|
|
2602
2602
|
message: a.message
|
|
2603
|
-
}),
|
|
2604
|
-
return { status:
|
|
2603
|
+
}), n.dirty()) : A.assertNever(a);
|
|
2604
|
+
return { status: n.value, value: e.data };
|
|
2605
2605
|
}
|
|
2606
|
-
_regex(e, t,
|
|
2607
|
-
return this.refinement((
|
|
2606
|
+
_regex(e, t, n) {
|
|
2607
|
+
return this.refinement((s) => e.test(s), {
|
|
2608
2608
|
validation: t,
|
|
2609
2609
|
code: c.invalid_string,
|
|
2610
|
-
..._.errToObj(
|
|
2610
|
+
..._.errToObj(n)
|
|
2611
2611
|
});
|
|
2612
2612
|
}
|
|
2613
2613
|
_addCheck(e) {
|
|
@@ -2832,8 +2832,8 @@ we.create = (r) => new we({
|
|
|
2832
2832
|
...b(r)
|
|
2833
2833
|
});
|
|
2834
2834
|
function ci(r, e) {
|
|
2835
|
-
const t = (r.toString().split(".")[1] || "").length,
|
|
2836
|
-
return a % i / 10 **
|
|
2835
|
+
const t = (r.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, s = t > n ? t : n, a = Number.parseInt(r.toFixed(s).replace(".", "")), i = Number.parseInt(e.toFixed(s).replace(".", ""));
|
|
2836
|
+
return a % i / 10 ** s;
|
|
2837
2837
|
}
|
|
2838
2838
|
class Ke extends S {
|
|
2839
2839
|
constructor() {
|
|
@@ -2848,37 +2848,37 @@ class Ke extends S {
|
|
|
2848
2848
|
received: a.parsedType
|
|
2849
2849
|
}), y;
|
|
2850
2850
|
}
|
|
2851
|
-
let
|
|
2852
|
-
const
|
|
2851
|
+
let n;
|
|
2852
|
+
const s = new J();
|
|
2853
2853
|
for (const a of this._def.checks)
|
|
2854
|
-
a.kind === "int" ? A.isInteger(e.data) || (
|
|
2854
|
+
a.kind === "int" ? A.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), m(n, {
|
|
2855
2855
|
code: c.invalid_type,
|
|
2856
2856
|
expected: "integer",
|
|
2857
2857
|
received: "float",
|
|
2858
2858
|
message: a.message
|
|
2859
|
-
}),
|
|
2859
|
+
}), s.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), m(n, {
|
|
2860
2860
|
code: c.too_small,
|
|
2861
2861
|
minimum: a.value,
|
|
2862
2862
|
type: "number",
|
|
2863
2863
|
inclusive: a.inclusive,
|
|
2864
2864
|
exact: !1,
|
|
2865
2865
|
message: a.message
|
|
2866
|
-
}),
|
|
2866
|
+
}), s.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (n = this._getOrReturnCtx(e, n), m(n, {
|
|
2867
2867
|
code: c.too_big,
|
|
2868
2868
|
maximum: a.value,
|
|
2869
2869
|
type: "number",
|
|
2870
2870
|
inclusive: a.inclusive,
|
|
2871
2871
|
exact: !1,
|
|
2872
2872
|
message: a.message
|
|
2873
|
-
}),
|
|
2873
|
+
}), s.dirty()) : a.kind === "multipleOf" ? ci(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), m(n, {
|
|
2874
2874
|
code: c.not_multiple_of,
|
|
2875
2875
|
multipleOf: a.value,
|
|
2876
2876
|
message: a.message
|
|
2877
|
-
}),
|
|
2877
|
+
}), s.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), m(n, {
|
|
2878
2878
|
code: c.not_finite,
|
|
2879
2879
|
message: a.message
|
|
2880
|
-
}),
|
|
2881
|
-
return { status:
|
|
2880
|
+
}), s.dirty()) : A.assertNever(a);
|
|
2881
|
+
return { status: s.value, value: e.data };
|
|
2882
2882
|
}
|
|
2883
2883
|
gte(e, t) {
|
|
2884
2884
|
return this.setLimit("min", e, !0, _.toString(t));
|
|
@@ -2892,7 +2892,7 @@ class Ke extends S {
|
|
|
2892
2892
|
lt(e, t) {
|
|
2893
2893
|
return this.setLimit("max", e, !1, _.toString(t));
|
|
2894
2894
|
}
|
|
2895
|
-
setLimit(e, t,
|
|
2895
|
+
setLimit(e, t, n, s) {
|
|
2896
2896
|
return new Ke({
|
|
2897
2897
|
...this._def,
|
|
2898
2898
|
checks: [
|
|
@@ -2900,8 +2900,8 @@ class Ke extends S {
|
|
|
2900
2900
|
{
|
|
2901
2901
|
kind: e,
|
|
2902
2902
|
value: t,
|
|
2903
|
-
inclusive:
|
|
2904
|
-
message: _.toString(
|
|
2903
|
+
inclusive: n,
|
|
2904
|
+
message: _.toString(s)
|
|
2905
2905
|
}
|
|
2906
2906
|
]
|
|
2907
2907
|
});
|
|
@@ -2993,10 +2993,10 @@ class Ke extends S {
|
|
|
2993
2993
|
}
|
|
2994
2994
|
get isFinite() {
|
|
2995
2995
|
let e = null, t = null;
|
|
2996
|
-
for (const
|
|
2997
|
-
if (
|
|
2996
|
+
for (const n of this._def.checks) {
|
|
2997
|
+
if (n.kind === "finite" || n.kind === "int" || n.kind === "multipleOf")
|
|
2998
2998
|
return !0;
|
|
2999
|
-
|
|
2999
|
+
n.kind === "min" ? (t === null || n.value > t) && (t = n.value) : n.kind === "max" && (e === null || n.value < e) && (e = n.value);
|
|
3000
3000
|
}
|
|
3001
3001
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
3002
3002
|
}
|
|
@@ -3020,27 +3020,27 @@ class gt extends S {
|
|
|
3020
3020
|
}
|
|
3021
3021
|
if (this._getType(e) !== g.bigint)
|
|
3022
3022
|
return this._getInvalidInput(e);
|
|
3023
|
-
let
|
|
3024
|
-
const
|
|
3023
|
+
let n;
|
|
3024
|
+
const s = new J();
|
|
3025
3025
|
for (const a of this._def.checks)
|
|
3026
|
-
a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (
|
|
3026
|
+
a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), m(n, {
|
|
3027
3027
|
code: c.too_small,
|
|
3028
3028
|
type: "bigint",
|
|
3029
3029
|
minimum: a.value,
|
|
3030
3030
|
inclusive: a.inclusive,
|
|
3031
3031
|
message: a.message
|
|
3032
|
-
}),
|
|
3032
|
+
}), s.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (n = this._getOrReturnCtx(e, n), m(n, {
|
|
3033
3033
|
code: c.too_big,
|
|
3034
3034
|
type: "bigint",
|
|
3035
3035
|
maximum: a.value,
|
|
3036
3036
|
inclusive: a.inclusive,
|
|
3037
3037
|
message: a.message
|
|
3038
|
-
}),
|
|
3038
|
+
}), s.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n), m(n, {
|
|
3039
3039
|
code: c.not_multiple_of,
|
|
3040
3040
|
multipleOf: a.value,
|
|
3041
3041
|
message: a.message
|
|
3042
|
-
}),
|
|
3043
|
-
return { status:
|
|
3042
|
+
}), s.dirty()) : A.assertNever(a);
|
|
3043
|
+
return { status: s.value, value: e.data };
|
|
3044
3044
|
}
|
|
3045
3045
|
_getInvalidInput(e) {
|
|
3046
3046
|
const t = this._getOrReturnCtx(e);
|
|
@@ -3062,7 +3062,7 @@ class gt extends S {
|
|
|
3062
3062
|
lt(e, t) {
|
|
3063
3063
|
return this.setLimit("max", e, !1, _.toString(t));
|
|
3064
3064
|
}
|
|
3065
|
-
setLimit(e, t,
|
|
3065
|
+
setLimit(e, t, n, s) {
|
|
3066
3066
|
return new gt({
|
|
3067
3067
|
...this._def,
|
|
3068
3068
|
checks: [
|
|
@@ -3070,8 +3070,8 @@ class gt extends S {
|
|
|
3070
3070
|
{
|
|
3071
3071
|
kind: e,
|
|
3072
3072
|
value: t,
|
|
3073
|
-
inclusive:
|
|
3074
|
-
message: _.toString(
|
|
3073
|
+
inclusive: n,
|
|
3074
|
+
message: _.toString(s)
|
|
3075
3075
|
}
|
|
3076
3076
|
]
|
|
3077
3077
|
});
|
|
@@ -3143,11 +3143,11 @@ gt.create = (r) => new gt({
|
|
|
3143
3143
|
class vr extends S {
|
|
3144
3144
|
_parse(e) {
|
|
3145
3145
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== g.boolean) {
|
|
3146
|
-
const
|
|
3147
|
-
return m(
|
|
3146
|
+
const n = this._getOrReturnCtx(e);
|
|
3147
|
+
return m(n, {
|
|
3148
3148
|
code: c.invalid_type,
|
|
3149
3149
|
expected: g.boolean,
|
|
3150
|
-
received:
|
|
3150
|
+
received: n.parsedType
|
|
3151
3151
|
}), y;
|
|
3152
3152
|
}
|
|
3153
3153
|
return W(e.data);
|
|
@@ -3174,26 +3174,26 @@ class Bt extends S {
|
|
|
3174
3174
|
code: c.invalid_date
|
|
3175
3175
|
}), y;
|
|
3176
3176
|
}
|
|
3177
|
-
const
|
|
3178
|
-
let
|
|
3177
|
+
const n = new J();
|
|
3178
|
+
let s;
|
|
3179
3179
|
for (const a of this._def.checks)
|
|
3180
|
-
a.kind === "min" ? e.data.getTime() < a.value && (
|
|
3180
|
+
a.kind === "min" ? e.data.getTime() < a.value && (s = this._getOrReturnCtx(e, s), m(s, {
|
|
3181
3181
|
code: c.too_small,
|
|
3182
3182
|
message: a.message,
|
|
3183
3183
|
inclusive: !0,
|
|
3184
3184
|
exact: !1,
|
|
3185
3185
|
minimum: a.value,
|
|
3186
3186
|
type: "date"
|
|
3187
|
-
}),
|
|
3187
|
+
}), n.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (s = this._getOrReturnCtx(e, s), m(s, {
|
|
3188
3188
|
code: c.too_big,
|
|
3189
3189
|
message: a.message,
|
|
3190
3190
|
inclusive: !0,
|
|
3191
3191
|
exact: !1,
|
|
3192
3192
|
maximum: a.value,
|
|
3193
3193
|
type: "date"
|
|
3194
|
-
}),
|
|
3194
|
+
}), n.dirty()) : A.assertNever(a);
|
|
3195
3195
|
return {
|
|
3196
|
-
status:
|
|
3196
|
+
status: n.value,
|
|
3197
3197
|
value: new Date(e.data.getTime())
|
|
3198
3198
|
};
|
|
3199
3199
|
}
|
|
@@ -3236,54 +3236,54 @@ Bt.create = (r) => new Bt({
|
|
|
3236
3236
|
typeName: w.ZodDate,
|
|
3237
3237
|
...b(r)
|
|
3238
3238
|
});
|
|
3239
|
-
class
|
|
3239
|
+
class _n extends S {
|
|
3240
3240
|
_parse(e) {
|
|
3241
3241
|
if (this._getType(e) !== g.symbol) {
|
|
3242
|
-
const
|
|
3243
|
-
return m(
|
|
3242
|
+
const n = this._getOrReturnCtx(e);
|
|
3243
|
+
return m(n, {
|
|
3244
3244
|
code: c.invalid_type,
|
|
3245
3245
|
expected: g.symbol,
|
|
3246
|
-
received:
|
|
3246
|
+
received: n.parsedType
|
|
3247
3247
|
}), y;
|
|
3248
3248
|
}
|
|
3249
3249
|
return W(e.data);
|
|
3250
3250
|
}
|
|
3251
3251
|
}
|
|
3252
|
-
|
|
3252
|
+
_n.create = (r) => new _n({
|
|
3253
3253
|
typeName: w.ZodSymbol,
|
|
3254
3254
|
...b(r)
|
|
3255
3255
|
});
|
|
3256
|
-
class
|
|
3256
|
+
class yn extends S {
|
|
3257
3257
|
_parse(e) {
|
|
3258
3258
|
if (this._getType(e) !== g.undefined) {
|
|
3259
|
-
const
|
|
3260
|
-
return m(
|
|
3259
|
+
const n = this._getOrReturnCtx(e);
|
|
3260
|
+
return m(n, {
|
|
3261
3261
|
code: c.invalid_type,
|
|
3262
3262
|
expected: g.undefined,
|
|
3263
|
-
received:
|
|
3263
|
+
received: n.parsedType
|
|
3264
3264
|
}), y;
|
|
3265
3265
|
}
|
|
3266
3266
|
return W(e.data);
|
|
3267
3267
|
}
|
|
3268
3268
|
}
|
|
3269
|
-
|
|
3269
|
+
yn.create = (r) => new yn({
|
|
3270
3270
|
typeName: w.ZodUndefined,
|
|
3271
3271
|
...b(r)
|
|
3272
3272
|
});
|
|
3273
|
-
class
|
|
3273
|
+
class wn extends S {
|
|
3274
3274
|
_parse(e) {
|
|
3275
3275
|
if (this._getType(e) !== g.null) {
|
|
3276
|
-
const
|
|
3277
|
-
return m(
|
|
3276
|
+
const n = this._getOrReturnCtx(e);
|
|
3277
|
+
return m(n, {
|
|
3278
3278
|
code: c.invalid_type,
|
|
3279
3279
|
expected: g.null,
|
|
3280
|
-
received:
|
|
3280
|
+
received: n.parsedType
|
|
3281
3281
|
}), y;
|
|
3282
3282
|
}
|
|
3283
3283
|
return W(e.data);
|
|
3284
3284
|
}
|
|
3285
3285
|
}
|
|
3286
|
-
|
|
3286
|
+
wn.create = (r) => new wn({
|
|
3287
3287
|
typeName: w.ZodNull,
|
|
3288
3288
|
...b(r)
|
|
3289
3289
|
});
|
|
@@ -3328,11 +3328,11 @@ Ee.create = (r) => new Ee({
|
|
|
3328
3328
|
class _r extends S {
|
|
3329
3329
|
_parse(e) {
|
|
3330
3330
|
if (this._getType(e) !== g.undefined) {
|
|
3331
|
-
const
|
|
3332
|
-
return m(
|
|
3331
|
+
const n = this._getOrReturnCtx(e);
|
|
3332
|
+
return m(n, {
|
|
3333
3333
|
code: c.invalid_type,
|
|
3334
3334
|
expected: g.void,
|
|
3335
|
-
received:
|
|
3335
|
+
received: n.parsedType
|
|
3336
3336
|
}), y;
|
|
3337
3337
|
}
|
|
3338
3338
|
return W(e.data);
|
|
@@ -3344,43 +3344,43 @@ _r.create = (r) => new _r({
|
|
|
3344
3344
|
});
|
|
3345
3345
|
class oe extends S {
|
|
3346
3346
|
_parse(e) {
|
|
3347
|
-
const { ctx: t, status:
|
|
3347
|
+
const { ctx: t, status: n } = this._processInputParams(e), s = this._def;
|
|
3348
3348
|
if (t.parsedType !== g.array)
|
|
3349
3349
|
return m(t, {
|
|
3350
3350
|
code: c.invalid_type,
|
|
3351
3351
|
expected: g.array,
|
|
3352
3352
|
received: t.parsedType
|
|
3353
3353
|
}), y;
|
|
3354
|
-
if (
|
|
3355
|
-
const i = t.data.length >
|
|
3354
|
+
if (s.exactLength !== null) {
|
|
3355
|
+
const i = t.data.length > s.exactLength.value, o = t.data.length < s.exactLength.value;
|
|
3356
3356
|
(i || o) && (m(t, {
|
|
3357
3357
|
code: i ? c.too_big : c.too_small,
|
|
3358
|
-
minimum: o ?
|
|
3359
|
-
maximum: i ?
|
|
3358
|
+
minimum: o ? s.exactLength.value : void 0,
|
|
3359
|
+
maximum: i ? s.exactLength.value : void 0,
|
|
3360
3360
|
type: "array",
|
|
3361
3361
|
inclusive: !0,
|
|
3362
3362
|
exact: !0,
|
|
3363
|
-
message:
|
|
3364
|
-
}),
|
|
3363
|
+
message: s.exactLength.message
|
|
3364
|
+
}), n.dirty());
|
|
3365
3365
|
}
|
|
3366
|
-
if (
|
|
3366
|
+
if (s.minLength !== null && t.data.length < s.minLength.value && (m(t, {
|
|
3367
3367
|
code: c.too_small,
|
|
3368
|
-
minimum:
|
|
3368
|
+
minimum: s.minLength.value,
|
|
3369
3369
|
type: "array",
|
|
3370
3370
|
inclusive: !0,
|
|
3371
3371
|
exact: !1,
|
|
3372
|
-
message:
|
|
3373
|
-
}),
|
|
3372
|
+
message: s.minLength.message
|
|
3373
|
+
}), n.dirty()), s.maxLength !== null && t.data.length > s.maxLength.value && (m(t, {
|
|
3374
3374
|
code: c.too_big,
|
|
3375
|
-
maximum:
|
|
3375
|
+
maximum: s.maxLength.value,
|
|
3376
3376
|
type: "array",
|
|
3377
3377
|
inclusive: !0,
|
|
3378
3378
|
exact: !1,
|
|
3379
|
-
message:
|
|
3380
|
-
}),
|
|
3381
|
-
return Promise.all([...t.data].map((i, o) =>
|
|
3382
|
-
const a = [...t.data].map((i, o) =>
|
|
3383
|
-
return J.mergeArray(
|
|
3379
|
+
message: s.maxLength.message
|
|
3380
|
+
}), n.dirty()), t.common.async)
|
|
3381
|
+
return Promise.all([...t.data].map((i, o) => s.type._parseAsync(new be(t, i, t.path, o)))).then((i) => J.mergeArray(n, i));
|
|
3382
|
+
const a = [...t.data].map((i, o) => s.type._parseSync(new be(t, i, t.path, o)));
|
|
3383
|
+
return J.mergeArray(n, a);
|
|
3384
3384
|
}
|
|
3385
3385
|
get element() {
|
|
3386
3386
|
return this._def.type;
|
|
@@ -3419,8 +3419,8 @@ function Fe(r) {
|
|
|
3419
3419
|
if (r instanceof D) {
|
|
3420
3420
|
const e = {};
|
|
3421
3421
|
for (const t in r.shape) {
|
|
3422
|
-
const
|
|
3423
|
-
e[t] = ke.create(Fe(
|
|
3422
|
+
const n = r.shape[t];
|
|
3423
|
+
e[t] = ke.create(Fe(n));
|
|
3424
3424
|
}
|
|
3425
3425
|
return new D({
|
|
3426
3426
|
...r._def,
|
|
@@ -3450,17 +3450,17 @@ class D extends S {
|
|
|
3450
3450
|
received: u.parsedType
|
|
3451
3451
|
}), y;
|
|
3452
3452
|
}
|
|
3453
|
-
const { status:
|
|
3453
|
+
const { status: n, ctx: s } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
|
|
3454
3454
|
if (!(this._def.catchall instanceof Ee && this._def.unknownKeys === "strip"))
|
|
3455
|
-
for (const u in
|
|
3455
|
+
for (const u in s.data)
|
|
3456
3456
|
i.includes(u) || o.push(u);
|
|
3457
3457
|
const l = [];
|
|
3458
3458
|
for (const u of i) {
|
|
3459
|
-
const d = a[u], f =
|
|
3459
|
+
const d = a[u], f = s.data[u];
|
|
3460
3460
|
l.push({
|
|
3461
3461
|
key: { status: "valid", value: u },
|
|
3462
|
-
value: d._parse(new be(
|
|
3463
|
-
alwaysSet: u in
|
|
3462
|
+
value: d._parse(new be(s, f, s.path, u)),
|
|
3463
|
+
alwaysSet: u in s.data
|
|
3464
3464
|
});
|
|
3465
3465
|
}
|
|
3466
3466
|
if (this._def.catchall instanceof Ee) {
|
|
@@ -3469,29 +3469,29 @@ class D extends S {
|
|
|
3469
3469
|
for (const d of o)
|
|
3470
3470
|
l.push({
|
|
3471
3471
|
key: { status: "valid", value: d },
|
|
3472
|
-
value: { status: "valid", value:
|
|
3472
|
+
value: { status: "valid", value: s.data[d] }
|
|
3473
3473
|
});
|
|
3474
3474
|
else if (u === "strict")
|
|
3475
|
-
o.length > 0 && (m(
|
|
3475
|
+
o.length > 0 && (m(s, {
|
|
3476
3476
|
code: c.unrecognized_keys,
|
|
3477
3477
|
keys: o
|
|
3478
|
-
}),
|
|
3478
|
+
}), n.dirty());
|
|
3479
3479
|
else if (u !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
3480
3480
|
} else {
|
|
3481
3481
|
const u = this._def.catchall;
|
|
3482
3482
|
for (const d of o) {
|
|
3483
|
-
const f =
|
|
3483
|
+
const f = s.data[d];
|
|
3484
3484
|
l.push({
|
|
3485
3485
|
key: { status: "valid", value: d },
|
|
3486
3486
|
value: u._parse(
|
|
3487
|
-
new be(
|
|
3487
|
+
new be(s, f, s.path, d)
|
|
3488
3488
|
//, ctx.child(key), value, getParsedType(value)
|
|
3489
3489
|
),
|
|
3490
|
-
alwaysSet: d in
|
|
3490
|
+
alwaysSet: d in s.data
|
|
3491
3491
|
});
|
|
3492
3492
|
}
|
|
3493
3493
|
}
|
|
3494
|
-
return
|
|
3494
|
+
return s.common.async ? Promise.resolve().then(async () => {
|
|
3495
3495
|
const u = [];
|
|
3496
3496
|
for (const d of l) {
|
|
3497
3497
|
const f = await d.key, p = await d.value;
|
|
@@ -3502,7 +3502,7 @@ class D extends S {
|
|
|
3502
3502
|
});
|
|
3503
3503
|
}
|
|
3504
3504
|
return u;
|
|
3505
|
-
}).then((u) => J.mergeObjectSync(
|
|
3505
|
+
}).then((u) => J.mergeObjectSync(n, u)) : J.mergeObjectSync(n, l);
|
|
3506
3506
|
}
|
|
3507
3507
|
get shape() {
|
|
3508
3508
|
return this._def.shape();
|
|
@@ -3512,13 +3512,13 @@ class D extends S {
|
|
|
3512
3512
|
...this._def,
|
|
3513
3513
|
unknownKeys: "strict",
|
|
3514
3514
|
...e !== void 0 ? {
|
|
3515
|
-
errorMap: (t,
|
|
3515
|
+
errorMap: (t, n) => {
|
|
3516
3516
|
var a, i;
|
|
3517
|
-
const
|
|
3517
|
+
const s = ((i = (a = this._def).errorMap) == null ? void 0 : i.call(a, t, n).message) ?? n.defaultError;
|
|
3518
3518
|
return t.code === "unrecognized_keys" ? {
|
|
3519
|
-
message: _.errToObj(e).message ??
|
|
3519
|
+
message: _.errToObj(e).message ?? s
|
|
3520
3520
|
} : {
|
|
3521
|
-
message:
|
|
3521
|
+
message: s
|
|
3522
3522
|
};
|
|
3523
3523
|
}
|
|
3524
3524
|
} : {}
|
|
@@ -3645,8 +3645,8 @@ class D extends S {
|
|
|
3645
3645
|
}
|
|
3646
3646
|
pick(e) {
|
|
3647
3647
|
const t = {};
|
|
3648
|
-
for (const
|
|
3649
|
-
e[
|
|
3648
|
+
for (const n of A.objectKeys(e))
|
|
3649
|
+
e[n] && this.shape[n] && (t[n] = this.shape[n]);
|
|
3650
3650
|
return new D({
|
|
3651
3651
|
...this._def,
|
|
3652
3652
|
shape: () => t
|
|
@@ -3654,8 +3654,8 @@ class D extends S {
|
|
|
3654
3654
|
}
|
|
3655
3655
|
omit(e) {
|
|
3656
3656
|
const t = {};
|
|
3657
|
-
for (const
|
|
3658
|
-
e[
|
|
3657
|
+
for (const n of A.objectKeys(this.shape))
|
|
3658
|
+
e[n] || (t[n] = this.shape[n]);
|
|
3659
3659
|
return new D({
|
|
3660
3660
|
...this._def,
|
|
3661
3661
|
shape: () => t
|
|
@@ -3669,9 +3669,9 @@ class D extends S {
|
|
|
3669
3669
|
}
|
|
3670
3670
|
partial(e) {
|
|
3671
3671
|
const t = {};
|
|
3672
|
-
for (const
|
|
3673
|
-
const
|
|
3674
|
-
e && !e[
|
|
3672
|
+
for (const n of A.objectKeys(this.shape)) {
|
|
3673
|
+
const s = this.shape[n];
|
|
3674
|
+
e && !e[n] ? t[n] = s : t[n] = s.optional();
|
|
3675
3675
|
}
|
|
3676
3676
|
return new D({
|
|
3677
3677
|
...this._def,
|
|
@@ -3680,14 +3680,14 @@ class D extends S {
|
|
|
3680
3680
|
}
|
|
3681
3681
|
required(e) {
|
|
3682
3682
|
const t = {};
|
|
3683
|
-
for (const
|
|
3684
|
-
if (e && !e[
|
|
3685
|
-
t[
|
|
3683
|
+
for (const n of A.objectKeys(this.shape))
|
|
3684
|
+
if (e && !e[n])
|
|
3685
|
+
t[n] = this.shape[n];
|
|
3686
3686
|
else {
|
|
3687
|
-
let a = this.shape[
|
|
3687
|
+
let a = this.shape[n];
|
|
3688
3688
|
for (; a instanceof ke; )
|
|
3689
3689
|
a = a._def.innerType;
|
|
3690
|
-
t[
|
|
3690
|
+
t[n] = a;
|
|
3691
3691
|
}
|
|
3692
3692
|
return new D({
|
|
3693
3693
|
...this._def,
|
|
@@ -3695,7 +3695,7 @@ class D extends S {
|
|
|
3695
3695
|
});
|
|
3696
3696
|
}
|
|
3697
3697
|
keyof() {
|
|
3698
|
-
return
|
|
3698
|
+
return hs(A.objectKeys(this.shape));
|
|
3699
3699
|
}
|
|
3700
3700
|
}
|
|
3701
3701
|
D.create = (r, e) => new D({
|
|
@@ -3721,8 +3721,8 @@ D.lazycreate = (r, e) => new D({
|
|
|
3721
3721
|
});
|
|
3722
3722
|
class Ut extends S {
|
|
3723
3723
|
_parse(e) {
|
|
3724
|
-
const { ctx: t } = this._processInputParams(e),
|
|
3725
|
-
function
|
|
3724
|
+
const { ctx: t } = this._processInputParams(e), n = this._def.options;
|
|
3725
|
+
function s(a) {
|
|
3726
3726
|
for (const o of a)
|
|
3727
3727
|
if (o.result.status === "valid")
|
|
3728
3728
|
return o.result;
|
|
@@ -3736,7 +3736,7 @@ class Ut extends S {
|
|
|
3736
3736
|
}), y;
|
|
3737
3737
|
}
|
|
3738
3738
|
if (t.common.async)
|
|
3739
|
-
return Promise.all(
|
|
3739
|
+
return Promise.all(n.map(async (a) => {
|
|
3740
3740
|
const i = {
|
|
3741
3741
|
...t,
|
|
3742
3742
|
common: {
|
|
@@ -3753,11 +3753,11 @@ class Ut extends S {
|
|
|
3753
3753
|
}),
|
|
3754
3754
|
ctx: i
|
|
3755
3755
|
};
|
|
3756
|
-
})).then(
|
|
3756
|
+
})).then(s);
|
|
3757
3757
|
{
|
|
3758
3758
|
let a;
|
|
3759
3759
|
const i = [];
|
|
3760
|
-
for (const l of
|
|
3760
|
+
for (const l of n) {
|
|
3761
3761
|
const u = {
|
|
3762
3762
|
...t,
|
|
3763
3763
|
common: {
|
|
@@ -3793,11 +3793,11 @@ Ut.create = (r, e) => new Ut({
|
|
|
3793
3793
|
...b(e)
|
|
3794
3794
|
});
|
|
3795
3795
|
function yr(r, e) {
|
|
3796
|
-
const t = pe(r),
|
|
3796
|
+
const t = pe(r), n = pe(e);
|
|
3797
3797
|
if (r === e)
|
|
3798
3798
|
return { valid: !0, data: r };
|
|
3799
|
-
if (t === g.object &&
|
|
3800
|
-
const
|
|
3799
|
+
if (t === g.object && n === g.object) {
|
|
3800
|
+
const s = A.objectKeys(e), a = A.objectKeys(r).filter((o) => s.indexOf(o) !== -1), i = { ...r, ...e };
|
|
3801
3801
|
for (const o of a) {
|
|
3802
3802
|
const l = yr(r[o], e[o]);
|
|
3803
3803
|
if (!l.valid)
|
|
@@ -3805,48 +3805,48 @@ function yr(r, e) {
|
|
|
3805
3805
|
i[o] = l.data;
|
|
3806
3806
|
}
|
|
3807
3807
|
return { valid: !0, data: i };
|
|
3808
|
-
} else if (t === g.array &&
|
|
3808
|
+
} else if (t === g.array && n === g.array) {
|
|
3809
3809
|
if (r.length !== e.length)
|
|
3810
3810
|
return { valid: !1 };
|
|
3811
|
-
const
|
|
3811
|
+
const s = [];
|
|
3812
3812
|
for (let a = 0; a < r.length; a++) {
|
|
3813
3813
|
const i = r[a], o = e[a], l = yr(i, o);
|
|
3814
3814
|
if (!l.valid)
|
|
3815
3815
|
return { valid: !1 };
|
|
3816
|
-
|
|
3816
|
+
s.push(l.data);
|
|
3817
3817
|
}
|
|
3818
|
-
return { valid: !0, data:
|
|
3819
|
-
} else return t === g.date &&
|
|
3818
|
+
return { valid: !0, data: s };
|
|
3819
|
+
} else return t === g.date && n === g.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
|
|
3820
3820
|
}
|
|
3821
3821
|
class $t extends S {
|
|
3822
3822
|
_parse(e) {
|
|
3823
|
-
const { status: t, ctx:
|
|
3824
|
-
if (
|
|
3823
|
+
const { status: t, ctx: n } = this._processInputParams(e), s = (a, i) => {
|
|
3824
|
+
if (mn(a) || mn(i))
|
|
3825
3825
|
return y;
|
|
3826
3826
|
const o = yr(a.value, i.value);
|
|
3827
|
-
return o.valid ? ((
|
|
3827
|
+
return o.valid ? ((vn(a) || vn(i)) && t.dirty(), { status: t.value, value: o.data }) : (m(n, {
|
|
3828
3828
|
code: c.invalid_intersection_types
|
|
3829
3829
|
}), y);
|
|
3830
3830
|
};
|
|
3831
|
-
return
|
|
3831
|
+
return n.common.async ? Promise.all([
|
|
3832
3832
|
this._def.left._parseAsync({
|
|
3833
|
-
data:
|
|
3834
|
-
path:
|
|
3835
|
-
parent:
|
|
3833
|
+
data: n.data,
|
|
3834
|
+
path: n.path,
|
|
3835
|
+
parent: n
|
|
3836
3836
|
}),
|
|
3837
3837
|
this._def.right._parseAsync({
|
|
3838
|
-
data:
|
|
3839
|
-
path:
|
|
3840
|
-
parent:
|
|
3838
|
+
data: n.data,
|
|
3839
|
+
path: n.path,
|
|
3840
|
+
parent: n
|
|
3841
3841
|
})
|
|
3842
|
-
]).then(([a, i]) =>
|
|
3843
|
-
data:
|
|
3844
|
-
path:
|
|
3845
|
-
parent:
|
|
3842
|
+
]).then(([a, i]) => s(a, i)) : s(this._def.left._parseSync({
|
|
3843
|
+
data: n.data,
|
|
3844
|
+
path: n.path,
|
|
3845
|
+
parent: n
|
|
3846
3846
|
}), this._def.right._parseSync({
|
|
3847
|
-
data:
|
|
3848
|
-
path:
|
|
3849
|
-
parent:
|
|
3847
|
+
data: n.data,
|
|
3848
|
+
path: n.path,
|
|
3849
|
+
parent: n
|
|
3850
3850
|
}));
|
|
3851
3851
|
}
|
|
3852
3852
|
}
|
|
@@ -3858,33 +3858,33 @@ $t.create = (r, e, t) => new $t({
|
|
|
3858
3858
|
});
|
|
3859
3859
|
class fe extends S {
|
|
3860
3860
|
_parse(e) {
|
|
3861
|
-
const { status: t, ctx:
|
|
3862
|
-
if (
|
|
3863
|
-
return m(
|
|
3861
|
+
const { status: t, ctx: n } = this._processInputParams(e);
|
|
3862
|
+
if (n.parsedType !== g.array)
|
|
3863
|
+
return m(n, {
|
|
3864
3864
|
code: c.invalid_type,
|
|
3865
3865
|
expected: g.array,
|
|
3866
|
-
received:
|
|
3866
|
+
received: n.parsedType
|
|
3867
3867
|
}), y;
|
|
3868
|
-
if (
|
|
3869
|
-
return m(
|
|
3868
|
+
if (n.data.length < this._def.items.length)
|
|
3869
|
+
return m(n, {
|
|
3870
3870
|
code: c.too_small,
|
|
3871
3871
|
minimum: this._def.items.length,
|
|
3872
3872
|
inclusive: !0,
|
|
3873
3873
|
exact: !1,
|
|
3874
3874
|
type: "array"
|
|
3875
3875
|
}), y;
|
|
3876
|
-
!this._def.rest &&
|
|
3876
|
+
!this._def.rest && n.data.length > this._def.items.length && (m(n, {
|
|
3877
3877
|
code: c.too_big,
|
|
3878
3878
|
maximum: this._def.items.length,
|
|
3879
3879
|
inclusive: !0,
|
|
3880
3880
|
exact: !1,
|
|
3881
3881
|
type: "array"
|
|
3882
3882
|
}), t.dirty());
|
|
3883
|
-
const a = [...
|
|
3883
|
+
const a = [...n.data].map((i, o) => {
|
|
3884
3884
|
const l = this._def.items[o] || this._def.rest;
|
|
3885
|
-
return l ? l._parse(new be(
|
|
3885
|
+
return l ? l._parse(new be(n, i, n.path, o)) : null;
|
|
3886
3886
|
}).filter((i) => !!i);
|
|
3887
|
-
return
|
|
3887
|
+
return n.common.async ? Promise.all(a).then((i) => J.mergeArray(t, i)) : J.mergeArray(t, a);
|
|
3888
3888
|
}
|
|
3889
3889
|
get items() {
|
|
3890
3890
|
return this._def.items;
|
|
@@ -3906,7 +3906,7 @@ fe.create = (r, e) => {
|
|
|
3906
3906
|
...b(e)
|
|
3907
3907
|
});
|
|
3908
3908
|
};
|
|
3909
|
-
class
|
|
3909
|
+
class kn extends S {
|
|
3910
3910
|
get keySchema() {
|
|
3911
3911
|
return this._def.keyType;
|
|
3912
3912
|
}
|
|
@@ -3914,18 +3914,18 @@ class ws extends S {
|
|
|
3914
3914
|
return this._def.valueType;
|
|
3915
3915
|
}
|
|
3916
3916
|
_parse(e) {
|
|
3917
|
-
const { status: t, ctx:
|
|
3918
|
-
if (
|
|
3919
|
-
return m(
|
|
3917
|
+
const { status: t, ctx: n } = this._processInputParams(e);
|
|
3918
|
+
if (n.parsedType !== g.map)
|
|
3919
|
+
return m(n, {
|
|
3920
3920
|
code: c.invalid_type,
|
|
3921
3921
|
expected: g.map,
|
|
3922
|
-
received:
|
|
3922
|
+
received: n.parsedType
|
|
3923
3923
|
}), y;
|
|
3924
|
-
const
|
|
3925
|
-
key:
|
|
3926
|
-
value: a._parse(new be(
|
|
3924
|
+
const s = this._def.keyType, a = this._def.valueType, i = [...n.data.entries()].map(([o, l], u) => ({
|
|
3925
|
+
key: s._parse(new be(n, o, n.path, [u, "key"])),
|
|
3926
|
+
value: a._parse(new be(n, l, n.path, [u, "value"]))
|
|
3927
3927
|
}));
|
|
3928
|
-
if (
|
|
3928
|
+
if (n.common.async) {
|
|
3929
3929
|
const o = /* @__PURE__ */ new Map();
|
|
3930
3930
|
return Promise.resolve().then(async () => {
|
|
3931
3931
|
for (const l of i) {
|
|
@@ -3948,7 +3948,7 @@ class ws extends S {
|
|
|
3948
3948
|
}
|
|
3949
3949
|
}
|
|
3950
3950
|
}
|
|
3951
|
-
|
|
3951
|
+
kn.create = (r, e, t) => new kn({
|
|
3952
3952
|
valueType: e,
|
|
3953
3953
|
keyType: r,
|
|
3954
3954
|
typeName: w.ZodMap,
|
|
@@ -3956,28 +3956,28 @@ ws.create = (r, e, t) => new ws({
|
|
|
3956
3956
|
});
|
|
3957
3957
|
class _t extends S {
|
|
3958
3958
|
_parse(e) {
|
|
3959
|
-
const { status: t, ctx:
|
|
3960
|
-
if (
|
|
3961
|
-
return m(
|
|
3959
|
+
const { status: t, ctx: n } = this._processInputParams(e);
|
|
3960
|
+
if (n.parsedType !== g.set)
|
|
3961
|
+
return m(n, {
|
|
3962
3962
|
code: c.invalid_type,
|
|
3963
3963
|
expected: g.set,
|
|
3964
|
-
received:
|
|
3964
|
+
received: n.parsedType
|
|
3965
3965
|
}), y;
|
|
3966
|
-
const
|
|
3967
|
-
|
|
3966
|
+
const s = this._def;
|
|
3967
|
+
s.minSize !== null && n.data.size < s.minSize.value && (m(n, {
|
|
3968
3968
|
code: c.too_small,
|
|
3969
|
-
minimum:
|
|
3969
|
+
minimum: s.minSize.value,
|
|
3970
3970
|
type: "set",
|
|
3971
3971
|
inclusive: !0,
|
|
3972
3972
|
exact: !1,
|
|
3973
|
-
message:
|
|
3974
|
-
}), t.dirty()),
|
|
3973
|
+
message: s.minSize.message
|
|
3974
|
+
}), t.dirty()), s.maxSize !== null && n.data.size > s.maxSize.value && (m(n, {
|
|
3975
3975
|
code: c.too_big,
|
|
3976
|
-
maximum:
|
|
3976
|
+
maximum: s.maxSize.value,
|
|
3977
3977
|
type: "set",
|
|
3978
3978
|
inclusive: !0,
|
|
3979
3979
|
exact: !1,
|
|
3980
|
-
message:
|
|
3980
|
+
message: s.maxSize.message
|
|
3981
3981
|
}), t.dirty());
|
|
3982
3982
|
const a = this._def.valueType;
|
|
3983
3983
|
function i(l) {
|
|
@@ -3989,8 +3989,8 @@ class _t extends S {
|
|
|
3989
3989
|
}
|
|
3990
3990
|
return { status: t.value, value: u };
|
|
3991
3991
|
}
|
|
3992
|
-
const o = [...
|
|
3993
|
-
return
|
|
3992
|
+
const o = [...n.data.values()].map((l, u) => a._parse(new be(n, l, n.path, u)));
|
|
3993
|
+
return n.common.async ? Promise.all(o).then((l) => i(l)) : i(o);
|
|
3994
3994
|
}
|
|
3995
3995
|
min(e, t) {
|
|
3996
3996
|
return new _t({
|
|
@@ -4030,7 +4030,7 @@ class pt extends S {
|
|
|
4030
4030
|
expected: g.function,
|
|
4031
4031
|
received: t.parsedType
|
|
4032
4032
|
}), y;
|
|
4033
|
-
function
|
|
4033
|
+
function n(o, l) {
|
|
4034
4034
|
return mr({
|
|
4035
4035
|
data: o,
|
|
4036
4036
|
path: t.path,
|
|
@@ -4041,7 +4041,7 @@ class pt extends S {
|
|
|
4041
4041
|
}
|
|
4042
4042
|
});
|
|
4043
4043
|
}
|
|
4044
|
-
function
|
|
4044
|
+
function s(o, l) {
|
|
4045
4045
|
return mr({
|
|
4046
4046
|
data: o,
|
|
4047
4047
|
path: t.path,
|
|
@@ -4057,10 +4057,10 @@ class pt extends S {
|
|
|
4057
4057
|
const o = this;
|
|
4058
4058
|
return W(async function(...l) {
|
|
4059
4059
|
const u = new te([]), d = await o._def.args.parseAsync(l, a).catch((v) => {
|
|
4060
|
-
throw u.addIssue(
|
|
4060
|
+
throw u.addIssue(n(l, v)), u;
|
|
4061
4061
|
}), f = await Reflect.apply(i, this, d);
|
|
4062
4062
|
return await o._def.returns._def.type.parseAsync(f, a).catch((v) => {
|
|
4063
|
-
throw u.addIssue(
|
|
4063
|
+
throw u.addIssue(s(f, v)), u;
|
|
4064
4064
|
});
|
|
4065
4065
|
});
|
|
4066
4066
|
} else {
|
|
@@ -4068,10 +4068,10 @@ class pt extends S {
|
|
|
4068
4068
|
return W(function(...l) {
|
|
4069
4069
|
const u = o._def.args.safeParse(l, a);
|
|
4070
4070
|
if (!u.success)
|
|
4071
|
-
throw new te([
|
|
4071
|
+
throw new te([n(l, u.error)]);
|
|
4072
4072
|
const d = Reflect.apply(i, this, u.data), f = o._def.returns.safeParse(d, a);
|
|
4073
4073
|
if (!f.success)
|
|
4074
|
-
throw new te([
|
|
4074
|
+
throw new te([s(d, f.error)]);
|
|
4075
4075
|
return f.data;
|
|
4076
4076
|
});
|
|
4077
4077
|
}
|
|
@@ -4100,16 +4100,16 @@ class pt extends S {
|
|
|
4100
4100
|
strictImplement(e) {
|
|
4101
4101
|
return this.parse(e);
|
|
4102
4102
|
}
|
|
4103
|
-
static create(e, t,
|
|
4103
|
+
static create(e, t, n) {
|
|
4104
4104
|
return new pt({
|
|
4105
4105
|
args: e || fe.create([]).rest($e.create()),
|
|
4106
4106
|
returns: t || $e.create(),
|
|
4107
4107
|
typeName: w.ZodFunction,
|
|
4108
|
-
...b(
|
|
4108
|
+
...b(n)
|
|
4109
4109
|
});
|
|
4110
4110
|
}
|
|
4111
4111
|
}
|
|
4112
|
-
class
|
|
4112
|
+
class xn extends S {
|
|
4113
4113
|
get schema() {
|
|
4114
4114
|
return this._def.getter();
|
|
4115
4115
|
}
|
|
@@ -4118,12 +4118,12 @@ class ks extends S {
|
|
|
4118
4118
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
4119
4119
|
}
|
|
4120
4120
|
}
|
|
4121
|
-
|
|
4121
|
+
xn.create = (r, e) => new xn({
|
|
4122
4122
|
getter: r,
|
|
4123
4123
|
typeName: w.ZodLazy,
|
|
4124
4124
|
...b(e)
|
|
4125
4125
|
});
|
|
4126
|
-
class
|
|
4126
|
+
class bn extends S {
|
|
4127
4127
|
_parse(e) {
|
|
4128
4128
|
if (e.data !== this._def.value) {
|
|
4129
4129
|
const t = this._getOrReturnCtx(e);
|
|
@@ -4139,12 +4139,12 @@ class xs extends S {
|
|
|
4139
4139
|
return this._def.value;
|
|
4140
4140
|
}
|
|
4141
4141
|
}
|
|
4142
|
-
|
|
4142
|
+
bn.create = (r, e) => new bn({
|
|
4143
4143
|
value: r,
|
|
4144
4144
|
typeName: w.ZodLiteral,
|
|
4145
4145
|
...b(e)
|
|
4146
4146
|
});
|
|
4147
|
-
function
|
|
4147
|
+
function hs(r, e) {
|
|
4148
4148
|
return new Qe({
|
|
4149
4149
|
values: r,
|
|
4150
4150
|
typeName: w.ZodEnum,
|
|
@@ -4154,19 +4154,19 @@ function hn(r, e) {
|
|
|
4154
4154
|
class Qe extends S {
|
|
4155
4155
|
_parse(e) {
|
|
4156
4156
|
if (typeof e.data != "string") {
|
|
4157
|
-
const t = this._getOrReturnCtx(e),
|
|
4157
|
+
const t = this._getOrReturnCtx(e), n = this._def.values;
|
|
4158
4158
|
return m(t, {
|
|
4159
|
-
expected: A.joinValues(
|
|
4159
|
+
expected: A.joinValues(n),
|
|
4160
4160
|
received: t.parsedType,
|
|
4161
4161
|
code: c.invalid_type
|
|
4162
4162
|
}), y;
|
|
4163
4163
|
}
|
|
4164
4164
|
if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(e.data)) {
|
|
4165
|
-
const t = this._getOrReturnCtx(e),
|
|
4165
|
+
const t = this._getOrReturnCtx(e), n = this._def.values;
|
|
4166
4166
|
return m(t, {
|
|
4167
4167
|
received: t.data,
|
|
4168
4168
|
code: c.invalid_enum_value,
|
|
4169
|
-
options:
|
|
4169
|
+
options: n
|
|
4170
4170
|
}), y;
|
|
4171
4171
|
}
|
|
4172
4172
|
return W(e.data);
|
|
@@ -4199,30 +4199,30 @@ class Qe extends S {
|
|
|
4199
4199
|
});
|
|
4200
4200
|
}
|
|
4201
4201
|
exclude(e, t = this._def) {
|
|
4202
|
-
return Qe.create(this.options.filter((
|
|
4202
|
+
return Qe.create(this.options.filter((n) => !e.includes(n)), {
|
|
4203
4203
|
...this._def,
|
|
4204
4204
|
...t
|
|
4205
4205
|
});
|
|
4206
4206
|
}
|
|
4207
4207
|
}
|
|
4208
|
-
Qe.create =
|
|
4209
|
-
class
|
|
4208
|
+
Qe.create = hs;
|
|
4209
|
+
class En extends S {
|
|
4210
4210
|
_parse(e) {
|
|
4211
|
-
const t = A.getValidEnumValues(this._def.values),
|
|
4212
|
-
if (
|
|
4213
|
-
const
|
|
4214
|
-
return m(
|
|
4215
|
-
expected: A.joinValues(
|
|
4216
|
-
received:
|
|
4211
|
+
const t = A.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
4212
|
+
if (n.parsedType !== g.string && n.parsedType !== g.number) {
|
|
4213
|
+
const s = A.objectValues(t);
|
|
4214
|
+
return m(n, {
|
|
4215
|
+
expected: A.joinValues(s),
|
|
4216
|
+
received: n.parsedType,
|
|
4217
4217
|
code: c.invalid_type
|
|
4218
4218
|
}), y;
|
|
4219
4219
|
}
|
|
4220
4220
|
if (this._cache || (this._cache = new Set(A.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
|
|
4221
|
-
const
|
|
4222
|
-
return m(
|
|
4223
|
-
received:
|
|
4221
|
+
const s = A.objectValues(t);
|
|
4222
|
+
return m(n, {
|
|
4223
|
+
received: n.data,
|
|
4224
4224
|
code: c.invalid_enum_value,
|
|
4225
|
-
options:
|
|
4225
|
+
options: s
|
|
4226
4226
|
}), y;
|
|
4227
4227
|
}
|
|
4228
4228
|
return W(e.data);
|
|
@@ -4231,7 +4231,7 @@ class bs extends S {
|
|
|
4231
4231
|
return this._def.values;
|
|
4232
4232
|
}
|
|
4233
4233
|
}
|
|
4234
|
-
|
|
4234
|
+
En.create = (r, e) => new En({
|
|
4235
4235
|
values: r,
|
|
4236
4236
|
typeName: w.ZodNativeEnum,
|
|
4237
4237
|
...b(e)
|
|
@@ -4248,8 +4248,8 @@ class yt extends S {
|
|
|
4248
4248
|
expected: g.promise,
|
|
4249
4249
|
received: t.parsedType
|
|
4250
4250
|
}), y;
|
|
4251
|
-
const
|
|
4252
|
-
return W(
|
|
4251
|
+
const n = t.parsedType === g.promise ? t.data : Promise.resolve(t.data);
|
|
4252
|
+
return W(n.then((s) => this._def.type.parseAsync(s, {
|
|
4253
4253
|
path: t.path,
|
|
4254
4254
|
errorMap: t.common.contextualErrorMap
|
|
4255
4255
|
})));
|
|
@@ -4268,24 +4268,24 @@ class et extends S {
|
|
|
4268
4268
|
return this._def.schema._def.typeName === w.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
4269
4269
|
}
|
|
4270
4270
|
_parse(e) {
|
|
4271
|
-
const { status: t, ctx:
|
|
4271
|
+
const { status: t, ctx: n } = this._processInputParams(e), s = this._def.effect || null, a = {
|
|
4272
4272
|
addIssue: (i) => {
|
|
4273
|
-
m(
|
|
4273
|
+
m(n, i), i.fatal ? t.abort() : t.dirty();
|
|
4274
4274
|
},
|
|
4275
4275
|
get path() {
|
|
4276
|
-
return
|
|
4276
|
+
return n.path;
|
|
4277
4277
|
}
|
|
4278
4278
|
};
|
|
4279
|
-
if (a.addIssue = a.addIssue.bind(a),
|
|
4280
|
-
const i =
|
|
4281
|
-
if (
|
|
4279
|
+
if (a.addIssue = a.addIssue.bind(a), s.type === "preprocess") {
|
|
4280
|
+
const i = s.transform(n.data, a);
|
|
4281
|
+
if (n.common.async)
|
|
4282
4282
|
return Promise.resolve(i).then(async (o) => {
|
|
4283
4283
|
if (t.value === "aborted")
|
|
4284
4284
|
return y;
|
|
4285
4285
|
const l = await this._def.schema._parseAsync({
|
|
4286
4286
|
data: o,
|
|
4287
|
-
path:
|
|
4288
|
-
parent:
|
|
4287
|
+
path: n.path,
|
|
4288
|
+
parent: n
|
|
4289
4289
|
});
|
|
4290
4290
|
return l.status === "aborted" ? y : l.status === "dirty" || t.value === "dirty" ? dt(l.value) : l;
|
|
4291
4291
|
});
|
|
@@ -4294,50 +4294,50 @@ class et extends S {
|
|
|
4294
4294
|
return y;
|
|
4295
4295
|
const o = this._def.schema._parseSync({
|
|
4296
4296
|
data: i,
|
|
4297
|
-
path:
|
|
4298
|
-
parent:
|
|
4297
|
+
path: n.path,
|
|
4298
|
+
parent: n
|
|
4299
4299
|
});
|
|
4300
4300
|
return o.status === "aborted" ? y : o.status === "dirty" || t.value === "dirty" ? dt(o.value) : o;
|
|
4301
4301
|
}
|
|
4302
4302
|
}
|
|
4303
|
-
if (
|
|
4303
|
+
if (s.type === "refinement") {
|
|
4304
4304
|
const i = (o) => {
|
|
4305
|
-
const l =
|
|
4306
|
-
if (
|
|
4305
|
+
const l = s.refinement(o, a);
|
|
4306
|
+
if (n.common.async)
|
|
4307
4307
|
return Promise.resolve(l);
|
|
4308
4308
|
if (l instanceof Promise)
|
|
4309
4309
|
throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
4310
4310
|
return o;
|
|
4311
4311
|
};
|
|
4312
|
-
if (
|
|
4312
|
+
if (n.common.async === !1) {
|
|
4313
4313
|
const o = this._def.schema._parseSync({
|
|
4314
|
-
data:
|
|
4315
|
-
path:
|
|
4316
|
-
parent:
|
|
4314
|
+
data: n.data,
|
|
4315
|
+
path: n.path,
|
|
4316
|
+
parent: n
|
|
4317
4317
|
});
|
|
4318
4318
|
return o.status === "aborted" ? y : (o.status === "dirty" && t.dirty(), i(o.value), { status: t.value, value: o.value });
|
|
4319
4319
|
} else
|
|
4320
|
-
return this._def.schema._parseAsync({ data:
|
|
4320
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => o.status === "aborted" ? y : (o.status === "dirty" && t.dirty(), i(o.value).then(() => ({ status: t.value, value: o.value }))));
|
|
4321
4321
|
}
|
|
4322
|
-
if (
|
|
4323
|
-
if (
|
|
4322
|
+
if (s.type === "transform")
|
|
4323
|
+
if (n.common.async === !1) {
|
|
4324
4324
|
const i = this._def.schema._parseSync({
|
|
4325
|
-
data:
|
|
4326
|
-
path:
|
|
4327
|
-
parent:
|
|
4325
|
+
data: n.data,
|
|
4326
|
+
path: n.path,
|
|
4327
|
+
parent: n
|
|
4328
4328
|
});
|
|
4329
4329
|
if (!Ge(i))
|
|
4330
4330
|
return y;
|
|
4331
|
-
const o =
|
|
4331
|
+
const o = s.transform(i.value, a);
|
|
4332
4332
|
if (o instanceof Promise)
|
|
4333
4333
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
4334
4334
|
return { status: t.value, value: o };
|
|
4335
4335
|
} else
|
|
4336
|
-
return this._def.schema._parseAsync({ data:
|
|
4336
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => Ge(i) ? Promise.resolve(s.transform(i.value, a)).then((o) => ({
|
|
4337
4337
|
status: t.value,
|
|
4338
4338
|
value: o
|
|
4339
4339
|
})) : y);
|
|
4340
|
-
A.assertNever(
|
|
4340
|
+
A.assertNever(s);
|
|
4341
4341
|
}
|
|
4342
4342
|
}
|
|
4343
4343
|
et.create = (r, e, t) => new et({
|
|
@@ -4381,9 +4381,9 @@ tt.create = (r, e) => new tt({
|
|
|
4381
4381
|
class wr extends S {
|
|
4382
4382
|
_parse(e) {
|
|
4383
4383
|
const { ctx: t } = this._processInputParams(e);
|
|
4384
|
-
let
|
|
4385
|
-
return t.parsedType === g.undefined && (
|
|
4386
|
-
data:
|
|
4384
|
+
let n = t.data;
|
|
4385
|
+
return t.parsedType === g.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({
|
|
4386
|
+
data: n,
|
|
4387
4387
|
path: t.path,
|
|
4388
4388
|
parent: t
|
|
4389
4389
|
});
|
|
@@ -4400,34 +4400,34 @@ wr.create = (r, e) => new wr({
|
|
|
4400
4400
|
});
|
|
4401
4401
|
class kr extends S {
|
|
4402
4402
|
_parse(e) {
|
|
4403
|
-
const { ctx: t } = this._processInputParams(e),
|
|
4403
|
+
const { ctx: t } = this._processInputParams(e), n = {
|
|
4404
4404
|
...t,
|
|
4405
4405
|
common: {
|
|
4406
4406
|
...t.common,
|
|
4407
4407
|
issues: []
|
|
4408
4408
|
}
|
|
4409
|
-
},
|
|
4410
|
-
data:
|
|
4411
|
-
path:
|
|
4409
|
+
}, s = this._def.innerType._parse({
|
|
4410
|
+
data: n.data,
|
|
4411
|
+
path: n.path,
|
|
4412
4412
|
parent: {
|
|
4413
|
-
...
|
|
4413
|
+
...n
|
|
4414
4414
|
}
|
|
4415
4415
|
});
|
|
4416
|
-
return Vt(
|
|
4416
|
+
return Vt(s) ? s.then((a) => ({
|
|
4417
4417
|
status: "valid",
|
|
4418
4418
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
4419
4419
|
get error() {
|
|
4420
|
-
return new te(
|
|
4420
|
+
return new te(n.common.issues);
|
|
4421
4421
|
},
|
|
4422
|
-
input:
|
|
4422
|
+
input: n.data
|
|
4423
4423
|
})
|
|
4424
4424
|
})) : {
|
|
4425
4425
|
status: "valid",
|
|
4426
|
-
value:
|
|
4426
|
+
value: s.status === "valid" ? s.value : this._def.catchValue({
|
|
4427
4427
|
get error() {
|
|
4428
|
-
return new te(
|
|
4428
|
+
return new te(n.common.issues);
|
|
4429
4429
|
},
|
|
4430
|
-
input:
|
|
4430
|
+
input: n.data
|
|
4431
4431
|
})
|
|
4432
4432
|
};
|
|
4433
4433
|
}
|
|
@@ -4441,28 +4441,28 @@ kr.create = (r, e) => new kr({
|
|
|
4441
4441
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
4442
4442
|
...b(e)
|
|
4443
4443
|
});
|
|
4444
|
-
class
|
|
4444
|
+
class Cn extends S {
|
|
4445
4445
|
_parse(e) {
|
|
4446
4446
|
if (this._getType(e) !== g.nan) {
|
|
4447
|
-
const
|
|
4448
|
-
return m(
|
|
4447
|
+
const n = this._getOrReturnCtx(e);
|
|
4448
|
+
return m(n, {
|
|
4449
4449
|
code: c.invalid_type,
|
|
4450
4450
|
expected: g.nan,
|
|
4451
|
-
received:
|
|
4451
|
+
received: n.parsedType
|
|
4452
4452
|
}), y;
|
|
4453
4453
|
}
|
|
4454
4454
|
return { status: "valid", value: e.data };
|
|
4455
4455
|
}
|
|
4456
4456
|
}
|
|
4457
|
-
|
|
4457
|
+
Cn.create = (r) => new Cn({
|
|
4458
4458
|
typeName: w.ZodNaN,
|
|
4459
4459
|
...b(r)
|
|
4460
4460
|
});
|
|
4461
4461
|
class fi extends S {
|
|
4462
4462
|
_parse(e) {
|
|
4463
|
-
const { ctx: t } = this._processInputParams(e),
|
|
4463
|
+
const { ctx: t } = this._processInputParams(e), n = t.data;
|
|
4464
4464
|
return this._def.type._parse({
|
|
4465
|
-
data:
|
|
4465
|
+
data: n,
|
|
4466
4466
|
path: t.path,
|
|
4467
4467
|
parent: t
|
|
4468
4468
|
});
|
|
@@ -4473,33 +4473,33 @@ class fi extends S {
|
|
|
4473
4473
|
}
|
|
4474
4474
|
class Vr extends S {
|
|
4475
4475
|
_parse(e) {
|
|
4476
|
-
const { status: t, ctx:
|
|
4477
|
-
if (
|
|
4476
|
+
const { status: t, ctx: n } = this._processInputParams(e);
|
|
4477
|
+
if (n.common.async)
|
|
4478
4478
|
return (async () => {
|
|
4479
4479
|
const a = await this._def.in._parseAsync({
|
|
4480
|
-
data:
|
|
4481
|
-
path:
|
|
4482
|
-
parent:
|
|
4480
|
+
data: n.data,
|
|
4481
|
+
path: n.path,
|
|
4482
|
+
parent: n
|
|
4483
4483
|
});
|
|
4484
4484
|
return a.status === "aborted" ? y : a.status === "dirty" ? (t.dirty(), dt(a.value)) : this._def.out._parseAsync({
|
|
4485
4485
|
data: a.value,
|
|
4486
|
-
path:
|
|
4487
|
-
parent:
|
|
4486
|
+
path: n.path,
|
|
4487
|
+
parent: n
|
|
4488
4488
|
});
|
|
4489
4489
|
})();
|
|
4490
4490
|
{
|
|
4491
|
-
const
|
|
4492
|
-
data:
|
|
4493
|
-
path:
|
|
4494
|
-
parent:
|
|
4491
|
+
const s = this._def.in._parseSync({
|
|
4492
|
+
data: n.data,
|
|
4493
|
+
path: n.path,
|
|
4494
|
+
parent: n
|
|
4495
4495
|
});
|
|
4496
|
-
return
|
|
4496
|
+
return s.status === "aborted" ? y : s.status === "dirty" ? (t.dirty(), {
|
|
4497
4497
|
status: "dirty",
|
|
4498
|
-
value:
|
|
4498
|
+
value: s.value
|
|
4499
4499
|
}) : this._def.out._parseSync({
|
|
4500
|
-
data:
|
|
4501
|
-
path:
|
|
4502
|
-
parent:
|
|
4500
|
+
data: s.value,
|
|
4501
|
+
path: n.path,
|
|
4502
|
+
parent: n
|
|
4503
4503
|
});
|
|
4504
4504
|
}
|
|
4505
4505
|
}
|
|
@@ -4513,8 +4513,8 @@ class Vr extends S {
|
|
|
4513
4513
|
}
|
|
4514
4514
|
class xr extends S {
|
|
4515
4515
|
_parse(e) {
|
|
4516
|
-
const t = this._def.innerType._parse(e),
|
|
4517
|
-
return Vt(t) ? t.then((
|
|
4516
|
+
const t = this._def.innerType._parse(e), n = (s) => (Ge(s) && (s.value = Object.freeze(s.value)), s);
|
|
4517
|
+
return Vt(t) ? t.then((s) => n(s)) : n(t);
|
|
4518
4518
|
}
|
|
4519
4519
|
unwrap() {
|
|
4520
4520
|
return this._def.innerType;
|
|
@@ -4535,9 +4535,7 @@ Ee.create;
|
|
|
4535
4535
|
const It = _r.create, Ur = oe.create, I = D.create;
|
|
4536
4536
|
Ut.create;
|
|
4537
4537
|
$t.create;
|
|
4538
|
-
const
|
|
4539
|
-
Qe.create;
|
|
4540
|
-
const hi = yt.create;
|
|
4538
|
+
const Sn = fe.create, ie = pt.create, hi = Qe.create, pi = yt.create;
|
|
4541
4539
|
ke.create;
|
|
4542
4540
|
tt.create;
|
|
4543
4541
|
I({
|
|
@@ -4561,28 +4559,28 @@ I({
|
|
|
4561
4559
|
}).optional()
|
|
4562
4560
|
}).optional()
|
|
4563
4561
|
});
|
|
4564
|
-
const Er = E().min(-90).max(90), Cr = E().min(-180).max(180),
|
|
4562
|
+
const Er = E().min(-90).max(90), Cr = E().min(-180).max(180), mi = I({
|
|
4565
4563
|
sw: I({ lat: Er, lng: Cr }),
|
|
4566
4564
|
ne: I({ lat: Er, lng: Cr })
|
|
4567
|
-
}), Sr = Br().refine((r) => r instanceof HTMLElement, "Must be an HTMLElement"),
|
|
4565
|
+
}), Sr = Br().refine((r) => r instanceof HTMLElement, "Must be an HTMLElement"), ps = I({
|
|
4568
4566
|
mapSize: E(),
|
|
4569
4567
|
zoomMin: E(),
|
|
4570
4568
|
zoomMax: E(),
|
|
4571
4569
|
zoomScale: E()
|
|
4572
|
-
}),
|
|
4570
|
+
}), vi = I({
|
|
4573
4571
|
instance: Br(),
|
|
4574
4572
|
inserted: ie().returns(br()),
|
|
4575
4573
|
insert: ie().returns(It()),
|
|
4576
4574
|
remove: ie().returns(It()),
|
|
4577
4575
|
update: ie().args(E()).returns(It())
|
|
4578
|
-
}),
|
|
4579
|
-
parameters:
|
|
4576
|
+
}), gi = I({
|
|
4577
|
+
parameters: ps,
|
|
4580
4578
|
getContainer: ie().args().returns(Sr),
|
|
4581
4579
|
getZoom: ie().args().returns(E()),
|
|
4582
|
-
getBounds: ie().args().returns(
|
|
4580
|
+
getBounds: ie().args().returns(mi),
|
|
4583
4581
|
panBy: ie().args(E(), E()).returns(It()),
|
|
4584
|
-
createMarker: ie().args(Sr, Er, Cr, E()).returns(
|
|
4585
|
-
}),
|
|
4582
|
+
createMarker: ie().args(Sr, Er, Cr, E()).returns(vi)
|
|
4583
|
+
}), sr = ie().args(Le()).returns(pi(Sr)), _i = I({
|
|
4586
4584
|
id: Le().min(1),
|
|
4587
4585
|
rank: E(),
|
|
4588
4586
|
lat: E().min(-90).max(90),
|
|
@@ -4594,7 +4592,7 @@ const Er = E().min(-90).max(90), Cr = E().min(-180).max(180), pi = I({
|
|
|
4594
4592
|
margin: E(),
|
|
4595
4593
|
radius: E()
|
|
4596
4594
|
}).refine((r) => Math.min(r.width, r.height) / r.margin >= 5, "Tooltip width and height must be at least 5 times the margin"),
|
|
4597
|
-
body:
|
|
4595
|
+
body: sr
|
|
4598
4596
|
}),
|
|
4599
4597
|
pin: I({
|
|
4600
4598
|
style: I({
|
|
@@ -4602,7 +4600,7 @@ const Er = E().min(-90).max(90), Cr = E().min(-180).max(180), pi = I({
|
|
|
4602
4600
|
height: E(),
|
|
4603
4601
|
radius: E()
|
|
4604
4602
|
}),
|
|
4605
|
-
body:
|
|
4603
|
+
body: sr
|
|
4606
4604
|
}).optional(),
|
|
4607
4605
|
popup: I({
|
|
4608
4606
|
style: I({
|
|
@@ -4611,11 +4609,11 @@ const Er = E().min(-90).max(90), Cr = E().min(-180).max(180), pi = I({
|
|
|
4611
4609
|
radius: E(),
|
|
4612
4610
|
margin: E()
|
|
4613
4611
|
}),
|
|
4614
|
-
body:
|
|
4612
|
+
body: sr
|
|
4615
4613
|
}).optional()
|
|
4616
|
-
}),
|
|
4617
|
-
|
|
4618
|
-
const
|
|
4614
|
+
}), yi = Ur(_i);
|
|
4615
|
+
Sn([E(), Ur(Sn([E(), E()]))]);
|
|
4616
|
+
const wi = I({
|
|
4619
4617
|
id: Le(),
|
|
4620
4618
|
rank: E(),
|
|
4621
4619
|
lat: E(),
|
|
@@ -4626,72 +4624,74 @@ const yi = I({
|
|
|
4626
4624
|
});
|
|
4627
4625
|
I({
|
|
4628
4626
|
key: Le(),
|
|
4629
|
-
parameters:
|
|
4630
|
-
input: Ur(
|
|
4627
|
+
parameters: ps,
|
|
4628
|
+
input: Ur(wi)
|
|
4631
4629
|
});
|
|
4630
|
+
const ki = hi(["info", "warn", "error"]);
|
|
4632
4631
|
I({
|
|
4633
4632
|
title: Le(),
|
|
4633
|
+
level: ki,
|
|
4634
4634
|
content: Br()
|
|
4635
4635
|
});
|
|
4636
|
-
class
|
|
4636
|
+
class Ai {
|
|
4637
4637
|
constructor(e, t) {
|
|
4638
4638
|
h(this, "provider");
|
|
4639
4639
|
h(this, "apiStatesUrl");
|
|
4640
4640
|
h(this, "apiStatesKey");
|
|
4641
|
-
h(this, "apiLogEnabled"
|
|
4641
|
+
h(this, "apiLogEnabled");
|
|
4642
4642
|
h(this, "markerDataArray", new Array());
|
|
4643
4643
|
h(this, "markerDataMap", /* @__PURE__ */ new Map());
|
|
4644
4644
|
h(this, "markerDataUpdating", !1);
|
|
4645
4645
|
h(this, "markerPinProcessor");
|
|
4646
4646
|
h(this, "markerTooltipProcessor");
|
|
4647
4647
|
h(this, "markerPopupProcessor");
|
|
4648
|
-
|
|
4648
|
+
gi.parse(e), this.provider = e, this.markerPinProcessor = new Ar(e), this.markerTooltipProcessor = new xi(e), this.markerPopupProcessor = new bi(e), this.configuration = t, this.log("info", "[CLIENT] Map manager created");
|
|
4649
4649
|
}
|
|
4650
4650
|
set configuration(e) {
|
|
4651
|
-
var t,
|
|
4652
|
-
this.apiStatesUrl = (
|
|
4651
|
+
var t, n, s, a, i, o, l, u;
|
|
4652
|
+
this.apiStatesUrl = (n = (t = e == null ? void 0 : e.api) == null ? void 0 : t.states) == null ? void 0 : n.url, this.apiStatesKey = (a = (s = e == null ? void 0 : e.api) == null ? void 0 : s.states) == null ? void 0 : a.key, this.apiLogEnabled = (o = (i = e == null ? void 0 : e.api) == null ? void 0 : i.log) == null ? void 0 : o.enabled, this.markerPinProcessor.setConfiguration(e), me.setLimit(((u = (l = e == null ? void 0 : e.animation) == null ? void 0 : l.queue) == null ? void 0 : u.limit) ?? 8 * navigator.hardwareConcurrency);
|
|
4653
4653
|
}
|
|
4654
4654
|
async updateMarkers(e) {
|
|
4655
|
-
await
|
|
4655
|
+
await yi.parseAsync(e);
|
|
4656
4656
|
try {
|
|
4657
4657
|
let t;
|
|
4658
4658
|
if (e.length > 1) {
|
|
4659
|
-
const
|
|
4660
|
-
id:
|
|
4661
|
-
rank:
|
|
4662
|
-
lat:
|
|
4663
|
-
lng:
|
|
4664
|
-
width:
|
|
4665
|
-
height:
|
|
4666
|
-
margin:
|
|
4659
|
+
const n = e.map((s) => ({
|
|
4660
|
+
id: s.id,
|
|
4661
|
+
rank: s.rank,
|
|
4662
|
+
lat: s.lat,
|
|
4663
|
+
lng: s.lng,
|
|
4664
|
+
width: s.tooltip.style.width,
|
|
4665
|
+
height: s.tooltip.style.height,
|
|
4666
|
+
margin: s.tooltip.style.margin
|
|
4667
4667
|
}));
|
|
4668
4668
|
if (this.apiStatesUrl != null && this.apiStatesKey != null) {
|
|
4669
|
-
const
|
|
4669
|
+
const s = {
|
|
4670
4670
|
key: this.apiStatesKey,
|
|
4671
4671
|
parameters: this.provider.parameters,
|
|
4672
|
-
input:
|
|
4672
|
+
input: n
|
|
4673
4673
|
}, a = await fetch(this.apiStatesUrl, {
|
|
4674
4674
|
method: "POST",
|
|
4675
4675
|
headers: { "Content-Type": "application/json" },
|
|
4676
|
-
body: JSON.stringify(
|
|
4676
|
+
body: JSON.stringify(s)
|
|
4677
4677
|
});
|
|
4678
4678
|
if (!a.ok || !a.body)
|
|
4679
4679
|
throw new Error("Failed to get marker states: " + a.statusText);
|
|
4680
4680
|
t = await a.json();
|
|
4681
4681
|
} else
|
|
4682
|
-
t =
|
|
4682
|
+
t = Es(this.provider.parameters, n);
|
|
4683
4683
|
} else
|
|
4684
4684
|
t = [[0, [[0, ct.DEGREES.indexOf(ct.DEFAULT)]]]];
|
|
4685
4685
|
this.updateMarkerData(e, t), this.processMarkerDataCallback();
|
|
4686
4686
|
} catch (t) {
|
|
4687
|
-
throw console.error(t), this.removeMarkerData(), t instanceof Error && this.log("[CLIENT] Failed to update markers",
|
|
4687
|
+
throw console.error(t), this.removeMarkerData(), t instanceof Error && this.log("error", "[CLIENT] Failed to update markers", t), t;
|
|
4688
4688
|
}
|
|
4689
4689
|
}
|
|
4690
4690
|
removeMarkers() {
|
|
4691
4691
|
try {
|
|
4692
4692
|
this.removeMarkerData();
|
|
4693
4693
|
} catch (e) {
|
|
4694
|
-
throw console.error(e), e instanceof Error && this.log("[CLIENT] Failed to remove markers",
|
|
4694
|
+
throw console.error(e), e instanceof Error && this.log("error", "[CLIENT] Failed to remove markers", e), e;
|
|
4695
4695
|
}
|
|
4696
4696
|
}
|
|
4697
4697
|
showPopup(e) {
|
|
@@ -4700,9 +4700,9 @@ class Si {
|
|
|
4700
4700
|
t.marker.id == e ? this.markerPopupProcessor.show(t) : this.markerPopupProcessor.hide(t);
|
|
4701
4701
|
} catch (t) {
|
|
4702
4702
|
console.error(t);
|
|
4703
|
-
for (const
|
|
4704
|
-
this.markerPopupProcessor.hide(
|
|
4705
|
-
throw t instanceof Error && this.log("[CLIENT] Failed to show popup",
|
|
4703
|
+
for (const n of this.markerDataArray)
|
|
4704
|
+
this.markerPopupProcessor.hide(n);
|
|
4705
|
+
throw t instanceof Error && this.log("error", "[CLIENT] Failed to show popup", t), t;
|
|
4706
4706
|
}
|
|
4707
4707
|
}
|
|
4708
4708
|
hidePopup(e) {
|
|
@@ -4716,29 +4716,29 @@ class Si {
|
|
|
4716
4716
|
this.markerPopupProcessor.hide(t);
|
|
4717
4717
|
} catch (t) {
|
|
4718
4718
|
console.error(t);
|
|
4719
|
-
for (const
|
|
4720
|
-
this.markerPopupProcessor.hide(
|
|
4721
|
-
throw t instanceof Error && this.log("[CLIENT] Failed to hide popup",
|
|
4719
|
+
for (const n of this.markerDataArray)
|
|
4720
|
+
this.markerPopupProcessor.hide(n);
|
|
4721
|
+
throw t instanceof Error && this.log("error", "[CLIENT] Failed to hide popup", t), t;
|
|
4722
4722
|
}
|
|
4723
4723
|
}
|
|
4724
4724
|
updateMarkerData(e, t) {
|
|
4725
4725
|
try {
|
|
4726
4726
|
this.markerDataUpdating = !0;
|
|
4727
|
-
const
|
|
4728
|
-
for (const a of
|
|
4729
|
-
|
|
4727
|
+
const n = new Map(e.map((a, i) => [a.id, new Tn(this.provider, a, t[i])])), s = Array.from(this.markerDataArray);
|
|
4728
|
+
for (const a of s)
|
|
4729
|
+
n.has(a.marker.id) == !1 && (a.remove(), this.markerDataMap.delete(a.marker.id), this.markerDataArray.splice(this.markerDataArray.indexOf(a), 1));
|
|
4730
4730
|
for (let a = 0; a < e.length; a++) {
|
|
4731
4731
|
const i = e[a], o = t[a], l = this.markerDataMap.get(i.id);
|
|
4732
4732
|
if (l)
|
|
4733
4733
|
l.update(o);
|
|
4734
4734
|
else {
|
|
4735
|
-
const u = new
|
|
4735
|
+
const u = new Tn(this.provider, i, o);
|
|
4736
4736
|
u.create(), this.markerDataMap.set(i.id, u), this.markerDataArray.push(u);
|
|
4737
4737
|
}
|
|
4738
4738
|
}
|
|
4739
4739
|
this.markerDataArray.sort((a, i) => a.zoom - i.zoom), this.markerPinProcessor.updateElements(this.markerDataArray.map((a) => a.pin)), this.markerTooltipProcessor.updateElements(this.markerDataArray.map((a) => a.tooltip));
|
|
4740
|
-
} catch (
|
|
4741
|
-
throw console.error(
|
|
4740
|
+
} catch (n) {
|
|
4741
|
+
throw console.error(n), this.markerDataArray.forEach((s) => s.remove()), this.markerDataArray.length = 0, this.markerDataMap.clear(), n instanceof Error && this.log("error", "[CLIENT] Failed to update marker data", n), n;
|
|
4742
4742
|
} finally {
|
|
4743
4743
|
this.markerDataUpdating = !1;
|
|
4744
4744
|
}
|
|
@@ -4747,7 +4747,7 @@ class Si {
|
|
|
4747
4747
|
try {
|
|
4748
4748
|
this.markerDataUpdating = !0, this.markerPinProcessor.removeElements(), this.markerTooltipProcessor.removeElements(), this.markerPopupProcessor.clear(), this.markerDataArray.length = 0, this.markerDataMap.clear();
|
|
4749
4749
|
} catch (e) {
|
|
4750
|
-
throw console.error(e), e instanceof Error && this.log("[CLIENT] Failed to remove marker data",
|
|
4750
|
+
throw console.error(e), e instanceof Error && this.log("error", "[CLIENT] Failed to remove marker data", e), e;
|
|
4751
4751
|
} finally {
|
|
4752
4752
|
this.markerDataUpdating = !1;
|
|
4753
4753
|
}
|
|
@@ -4757,7 +4757,7 @@ class Si {
|
|
|
4757
4757
|
try {
|
|
4758
4758
|
this.processMarkerData(), window.setTimeout(this.processMarkerDataCallback.bind(this), 25);
|
|
4759
4759
|
} catch (e) {
|
|
4760
|
-
console.error(e), e instanceof Error && this.log("[CLIENT] Failed to process marker data",
|
|
4760
|
+
console.error(e), e instanceof Error && this.log("error", "[CLIENT] Failed to process marker data", e);
|
|
4761
4761
|
}
|
|
4762
4762
|
}
|
|
4763
4763
|
processMarkerData() {
|
|
@@ -4765,15 +4765,16 @@ class Si {
|
|
|
4765
4765
|
const e = this.provider.getBounds(), t = this.provider.getZoom();
|
|
4766
4766
|
this.markerPopupProcessor.process(), this.markerTooltipProcessor.process(e, t), this.markerPinProcessor.process(e, t);
|
|
4767
4767
|
}
|
|
4768
|
-
async log(e, t) {
|
|
4769
|
-
if (!(this.apiLogEnabled ==
|
|
4768
|
+
async log(e, t, n) {
|
|
4769
|
+
if (!(this.apiLogEnabled == null && (window != null && window.location.host.startsWith("localhost"))) && this.apiLogEnabled != !1)
|
|
4770
4770
|
try {
|
|
4771
4771
|
await fetch("https://arenarium.dev/api/public/v1/log", {
|
|
4772
4772
|
method: "POST",
|
|
4773
4773
|
headers: { "Content-Type": "application/json" },
|
|
4774
4774
|
body: JSON.stringify({
|
|
4775
|
-
title:
|
|
4776
|
-
|
|
4775
|
+
title: t,
|
|
4776
|
+
level: e,
|
|
4777
|
+
content: n
|
|
4777
4778
|
})
|
|
4778
4779
|
});
|
|
4779
4780
|
} catch (s) {
|
|
@@ -4781,13 +4782,13 @@ class Si {
|
|
|
4781
4782
|
}
|
|
4782
4783
|
}
|
|
4783
4784
|
}
|
|
4784
|
-
class
|
|
4785
|
-
constructor(e, t,
|
|
4785
|
+
class Tn {
|
|
4786
|
+
constructor(e, t, n) {
|
|
4786
4787
|
h(this, "marker");
|
|
4787
4788
|
h(this, "zoom");
|
|
4788
4789
|
h(this, "pin");
|
|
4789
4790
|
h(this, "tooltip");
|
|
4790
|
-
this.marker = t, this.zoom =
|
|
4791
|
+
this.marker = t, this.zoom = n[0], this.pin = new Tr(e, t, n), this.tooltip = new Mr(e, t, n);
|
|
4791
4792
|
}
|
|
4792
4793
|
create() {
|
|
4793
4794
|
this.pin.create(), this.tooltip.create();
|
|
@@ -4827,8 +4828,8 @@ class $r {
|
|
|
4827
4828
|
this.marker.update(this.getZindex());
|
|
4828
4829
|
}
|
|
4829
4830
|
updateMap(e) {
|
|
4830
|
-
const t = this.marker,
|
|
4831
|
-
if (t == null ||
|
|
4831
|
+
const t = this.marker, n = this.component;
|
|
4832
|
+
if (t == null || n == null) throw new Error("Failed to update provider marker map");
|
|
4832
4833
|
e ? t.inserted() == !1 && t.insert() : t.inserted() == !0 && t.remove();
|
|
4833
4834
|
}
|
|
4834
4835
|
getZindex() {
|
|
@@ -4840,9 +4841,9 @@ class $r {
|
|
|
4840
4841
|
}
|
|
4841
4842
|
}
|
|
4842
4843
|
const Ve = class Ve extends $r {
|
|
4843
|
-
constructor(t,
|
|
4844
|
+
constructor(t, n, s) {
|
|
4844
4845
|
var a, i, o, l;
|
|
4845
|
-
super(t,
|
|
4846
|
+
super(t, n);
|
|
4846
4847
|
h(this, "width");
|
|
4847
4848
|
h(this, "height");
|
|
4848
4849
|
h(this, "radius");
|
|
@@ -4850,7 +4851,7 @@ const Ve = class Ve extends $r {
|
|
|
4850
4851
|
h(this, "bodyLoading", !1);
|
|
4851
4852
|
h(this, "bodyLoaded", !1);
|
|
4852
4853
|
h(this, "bodyCallback");
|
|
4853
|
-
this.width = ((a =
|
|
4854
|
+
this.width = ((a = n.pin) == null ? void 0 : a.style.width) ?? Ve.DEFAULT_SIZE, this.height = ((i = n.pin) == null ? void 0 : i.style.height) ?? Ve.DEFAULT_SIZE, this.radius = ((o = n.pin) == null ? void 0 : o.style.radius) ?? Ve.DEFAULT_SIZE, this.zoom = s[0], this.bodyCallback = (l = n.pin) == null ? void 0 : l.body;
|
|
4854
4855
|
}
|
|
4855
4856
|
createElement() {
|
|
4856
4857
|
this.element = document.createElement("div"), this.element.classList.add("pin"), this.component = zr(Va, {
|
|
@@ -4869,18 +4870,18 @@ const Ve = class Ve extends $r {
|
|
|
4869
4870
|
this.zoom = t[0], this.updateZIndex();
|
|
4870
4871
|
}
|
|
4871
4872
|
updateMap(t) {
|
|
4872
|
-
var
|
|
4873
|
-
super.updateMap(t), (
|
|
4873
|
+
var n;
|
|
4874
|
+
super.updateMap(t), (n = this.component) == null || n.setDisplayed(t);
|
|
4874
4875
|
}
|
|
4875
4876
|
updateState(t) {
|
|
4876
4877
|
if (this.component == null) throw new Error("Failed to update pin state");
|
|
4877
4878
|
this.component.setScale(this.getScale(t));
|
|
4878
4879
|
}
|
|
4879
4880
|
updateBody() {
|
|
4880
|
-
var
|
|
4881
|
+
var n;
|
|
4881
4882
|
if (this.bodyCallback == null || this.bodyLoaded || this.bodyLoading) return;
|
|
4882
|
-
const t = (
|
|
4883
|
-
t != null && (this.bodyLoading = !0, this.bodyCallback(this.id).then((
|
|
4883
|
+
const t = (n = this.component) == null ? void 0 : n.getBody();
|
|
4884
|
+
t != null && (this.bodyLoading = !0, this.bodyCallback(this.id).then((s) => t.appendChild(s)).catch((s) => console.error(s)).finally(() => {
|
|
4884
4885
|
this.bodyLoaded = !0, this.bodyLoading = !1;
|
|
4885
4886
|
}));
|
|
4886
4887
|
}
|
|
@@ -4917,27 +4918,27 @@ const Be = class Be {
|
|
|
4917
4918
|
this.provider = e;
|
|
4918
4919
|
}
|
|
4919
4920
|
setConfiguration(e) {
|
|
4920
|
-
var t,
|
|
4921
|
-
this.pinFade = ((t = e == null ? void 0 : e.pin) == null ? void 0 : t.fade) ?? !0, this.pinMaxCount = ((
|
|
4921
|
+
var t, n, s;
|
|
4922
|
+
this.pinFade = ((t = e == null ? void 0 : e.pin) == null ? void 0 : t.fade) ?? !0, this.pinMaxCount = ((n = e == null ? void 0 : e.pin) == null ? void 0 : n.maxCount) ?? Math.max(Be.MAP_PINS_MAX_COUNT, 8 * navigator.hardwareConcurrency), this.pinMaxZoomDelta = ((s = e == null ? void 0 : e.pin) == null ? void 0 : s.maxZoom) ?? Be.MAP_PINS_MAX_ZOOM;
|
|
4922
4923
|
}
|
|
4923
4924
|
updateElements(e) {
|
|
4924
|
-
this.pinElements = e, this.pinMaxWidth = e.reduce((t,
|
|
4925
|
+
this.pinElements = e, this.pinMaxWidth = e.reduce((t, n) => Math.max(t, n.width), 0), this.pinMaxHeight = e.reduce((t, n) => Math.max(t, n.height), 0);
|
|
4925
4926
|
}
|
|
4926
4927
|
removeElements() {
|
|
4927
4928
|
this.pinElements.forEach((e) => e.remove()), this.pinElements.length = 0;
|
|
4928
4929
|
}
|
|
4929
4930
|
process(e, t) {
|
|
4930
|
-
const
|
|
4931
|
+
const n = this.provider.parameters.mapSize, s = new ds(e, t, n, this.pinMaxWidth * 2, this.pinMaxHeight * 2);
|
|
4931
4932
|
let a = 0;
|
|
4932
4933
|
for (const i of this.pinElements)
|
|
4933
|
-
|
|
4934
|
+
s.contains(i.lat, i.lng) ? i.shown && t <= i.zoom && i.zoom <= t + this.pinMaxZoomDelta ? (a < this.pinMaxCount && (this.pinFade == !0 ? i.updateState(t) : i.setCollapsed(!1), i.updateMap(!0), i.isBodyLoaded() == !1 && i.updateBody()), a++) : (i.setCollapsed(!0), i.isCollapsed() && i.updateMap(!1)) : i.updateMap(!1);
|
|
4934
4935
|
}
|
|
4935
4936
|
};
|
|
4936
4937
|
h(Be, "MAP_PINS_MAX_ZOOM", 2), h(Be, "MAP_PINS_MAX_COUNT", 128);
|
|
4937
4938
|
let Ar = Be;
|
|
4938
4939
|
const qt = class qt extends $r {
|
|
4939
|
-
constructor(t,
|
|
4940
|
-
super(t,
|
|
4940
|
+
constructor(t, n, s) {
|
|
4941
|
+
super(t, n);
|
|
4941
4942
|
h(this, "width");
|
|
4942
4943
|
h(this, "height");
|
|
4943
4944
|
h(this, "margin");
|
|
@@ -4948,10 +4949,10 @@ const qt = class qt extends $r {
|
|
|
4948
4949
|
h(this, "bodyLoading", !1);
|
|
4949
4950
|
h(this, "bodyLoaded", !1);
|
|
4950
4951
|
h(this, "bodyCallback");
|
|
4951
|
-
this.width =
|
|
4952
|
+
this.width = n.tooltip.style.width, this.height = n.tooltip.style.height, this.margin = n.tooltip.style.margin, this.radius = n.tooltip.style.radius, this.zoom = s[0], this.angle = ct.DEFAULT, this.states = s[1].map((a) => [a[0], ct.DEGREES[a[1]]]), this.bodyCallback = n.tooltip.body;
|
|
4952
4953
|
}
|
|
4953
4954
|
createElement() {
|
|
4954
|
-
this.element = document.createElement("div"), this.element.classList.add("tooltip"), this.component = zr(
|
|
4955
|
+
this.element = document.createElement("div"), this.element.classList.add("tooltip"), this.component = zr(us, {
|
|
4955
4956
|
target: this.element,
|
|
4956
4957
|
props: {
|
|
4957
4958
|
id: this.id + "_tooltip",
|
|
@@ -4965,28 +4966,28 @@ const qt = class qt extends $r {
|
|
|
4965
4966
|
});
|
|
4966
4967
|
}
|
|
4967
4968
|
update(t) {
|
|
4968
|
-
this.zoom = t[0], this.states = t[1].map((
|
|
4969
|
+
this.zoom = t[0], this.states = t[1].map((n) => [n[0], ct.DEGREES[n[1]]]), this.updateZIndex();
|
|
4969
4970
|
}
|
|
4970
4971
|
updateMap(t) {
|
|
4971
|
-
var
|
|
4972
|
-
super.updateMap(t), (
|
|
4972
|
+
var n;
|
|
4973
|
+
super.updateMap(t), (n = this.component) == null || n.setDisplayed(t);
|
|
4973
4974
|
}
|
|
4974
4975
|
updateState(t) {
|
|
4975
4976
|
if (this.component == null) throw new Error("Failed to update tooltip state");
|
|
4976
4977
|
this.angle = this.getAngle(t), this.component.setAngle(this.angle);
|
|
4977
4978
|
}
|
|
4978
4979
|
updateBody() {
|
|
4979
|
-
var
|
|
4980
|
+
var n;
|
|
4980
4981
|
if (this.bodyLoaded || this.bodyLoading) return;
|
|
4981
|
-
const t = (
|
|
4982
|
-
t != null && (this.bodyLoading = !0, this.bodyCallback(this.id).then((
|
|
4982
|
+
const t = (n = this.component) == null ? void 0 : n.getBody();
|
|
4983
|
+
t != null && (this.bodyLoading = !0, this.bodyCallback(this.id).then((s) => t.appendChild(s)).catch((s) => console.error(s)).finally(() => {
|
|
4983
4984
|
this.bodyLoaded = !0, this.bodyLoading = !1;
|
|
4984
4985
|
}));
|
|
4985
4986
|
}
|
|
4986
4987
|
getAngle(t) {
|
|
4987
|
-
const
|
|
4988
|
-
if (!
|
|
4989
|
-
return
|
|
4988
|
+
const n = this.states.findLast((s) => s[0] <= t);
|
|
4989
|
+
if (!n) throw new Error("Angle not found");
|
|
4990
|
+
return n[1];
|
|
4990
4991
|
}
|
|
4991
4992
|
getZindex() {
|
|
4992
4993
|
return Math.round((this.provider.parameters.zoomMax - this.zoom) * this.provider.parameters.zoomScale) + qt.Z_INDEX_OFFSET;
|
|
@@ -5007,7 +5008,7 @@ const qt = class qt extends $r {
|
|
|
5007
5008
|
};
|
|
5008
5009
|
h(qt, "Z_INDEX_OFFSET", 1e6);
|
|
5009
5010
|
let Mr = qt;
|
|
5010
|
-
class
|
|
5011
|
+
class xi {
|
|
5011
5012
|
constructor(e) {
|
|
5012
5013
|
h(this, "provider");
|
|
5013
5014
|
// Data
|
|
@@ -5018,21 +5019,21 @@ class wi {
|
|
|
5018
5019
|
this.provider = e;
|
|
5019
5020
|
}
|
|
5020
5021
|
updateElements(e) {
|
|
5021
|
-
this.tooltipElements = e, this.tooltipMaxWidth = this.tooltipElements.reduce((t,
|
|
5022
|
+
this.tooltipElements = e, this.tooltipMaxWidth = this.tooltipElements.reduce((t, n) => Math.max(t, n.width), 0), this.tooltipMaxHeight = this.tooltipElements.reduce((t, n) => Math.max(t, n.height), 0);
|
|
5022
5023
|
}
|
|
5023
5024
|
removeElements() {
|
|
5024
5025
|
this.tooltipElements.forEach((e) => e.remove()), this.tooltipElements.length = 0;
|
|
5025
5026
|
}
|
|
5026
5027
|
process(e, t) {
|
|
5027
|
-
const
|
|
5028
|
+
const n = this.provider.parameters.mapSize, s = new ds(e, t, n, this.tooltipMaxWidth * 2, this.tooltipMaxHeight * 2);
|
|
5028
5029
|
for (const a of this.tooltipElements)
|
|
5029
|
-
|
|
5030
|
+
s.contains(a.lat, a.lng) ? a.shown && a.zoom <= t ? (a.updateState(t), a.setCollapsed(!1), a.updateMap(!0), a.isCollapsed() == !1 && a.isBodyLoaded() == !1 && a.updateBody()) : (a.setCollapsed(!0), a.isCollapsed() && a.updateMap(!1)) : a.updateMap(!1);
|
|
5030
5031
|
}
|
|
5031
5032
|
}
|
|
5032
5033
|
const Wt = class Wt extends $r {
|
|
5033
|
-
constructor(t,
|
|
5034
|
-
if (
|
|
5035
|
-
super(t,
|
|
5034
|
+
constructor(t, n) {
|
|
5035
|
+
if (n.popup == null) throw new Error("Failed to create popup");
|
|
5036
|
+
super(t, n);
|
|
5036
5037
|
h(this, "width");
|
|
5037
5038
|
h(this, "height");
|
|
5038
5039
|
h(this, "margin");
|
|
@@ -5040,10 +5041,10 @@ const Wt = class Wt extends $r {
|
|
|
5040
5041
|
h(this, "bodyLoading", !1);
|
|
5041
5042
|
h(this, "bodyLoaded", !1);
|
|
5042
5043
|
h(this, "bodyCallback");
|
|
5043
|
-
this.shown = !1, this.width =
|
|
5044
|
+
this.shown = !1, this.width = n.popup.style.width, this.height = n.popup.style.height, this.margin = n.popup.style.margin, this.radius = n.popup.style.radius, this.bodyCallback = n.popup.body;
|
|
5044
5045
|
}
|
|
5045
5046
|
createElement() {
|
|
5046
|
-
this.element = document.createElement("div"), this.element.classList.add("popup"), this.component = zr(
|
|
5047
|
+
this.element = document.createElement("div"), this.element.classList.add("popup"), this.component = zr(us, {
|
|
5047
5048
|
target: this.element,
|
|
5048
5049
|
props: {
|
|
5049
5050
|
id: this.id + "_popup",
|
|
@@ -5057,14 +5058,14 @@ const Wt = class Wt extends $r {
|
|
|
5057
5058
|
});
|
|
5058
5059
|
}
|
|
5059
5060
|
updateMap(t) {
|
|
5060
|
-
var
|
|
5061
|
-
super.updateMap(t), (
|
|
5061
|
+
var n;
|
|
5062
|
+
super.updateMap(t), (n = this.component) == null || n.setDisplayed(t);
|
|
5062
5063
|
}
|
|
5063
5064
|
updateBody() {
|
|
5064
|
-
var
|
|
5065
|
+
var n;
|
|
5065
5066
|
if (this.bodyLoaded || this.bodyLoading) return;
|
|
5066
|
-
const t = (
|
|
5067
|
-
t != null && (this.bodyLoading = !0, this.bodyCallback(this.id).then((
|
|
5067
|
+
const t = (n = this.component) == null ? void 0 : n.getBody();
|
|
5068
|
+
t != null && (this.bodyLoading = !0, this.bodyCallback(this.id).then((s) => t.appendChild(s)).catch((s) => console.error(s)).finally(() => {
|
|
5068
5069
|
this.bodyLoaded = !0, this.bodyLoading = !1;
|
|
5069
5070
|
}));
|
|
5070
5071
|
}
|
|
@@ -5091,7 +5092,7 @@ const Wt = class Wt extends $r {
|
|
|
5091
5092
|
};
|
|
5092
5093
|
h(Wt, "Z_INDEX_OFFSET", 2e6);
|
|
5093
5094
|
let Or = Wt;
|
|
5094
|
-
class
|
|
5095
|
+
class bi {
|
|
5095
5096
|
constructor(e) {
|
|
5096
5097
|
h(this, "provider");
|
|
5097
5098
|
// Data
|
|
@@ -5114,22 +5115,22 @@ class ki {
|
|
|
5114
5115
|
}
|
|
5115
5116
|
process() {
|
|
5116
5117
|
var e, t;
|
|
5117
|
-
for (const
|
|
5118
|
-
if (
|
|
5119
|
-
if (
|
|
5120
|
-
const
|
|
5121
|
-
if (
|
|
5122
|
-
const a = (t =
|
|
5118
|
+
for (const n of this.popupElements.values())
|
|
5119
|
+
if (n.shown) {
|
|
5120
|
+
if (n.setCollapsed(!1), n.updateMap(!0), n.isExpanded() && n.isBodyLoaded() == !1 && n.updateBody(), n.isCollapsed() == !1 && this.popupPositioned.get(n.id) == !1) {
|
|
5121
|
+
const s = (e = n.component) == null ? void 0 : e.getBody();
|
|
5122
|
+
if (s == null) continue;
|
|
5123
|
+
const a = (t = n.component) == null ? void 0 : t.getOffsets();
|
|
5123
5124
|
if (a == null) continue;
|
|
5124
|
-
const i =
|
|
5125
|
+
const i = s.getBoundingClientRect();
|
|
5125
5126
|
if (i.x == 0 && i.y == 0 && i.width == 0 && i.height == 0) continue;
|
|
5126
|
-
const o = i.x + i.width / 2, l = i.y + i.height / 2, u = o + a.offsetX, d = l + a.offsetY, f = u +
|
|
5127
|
-
this.provider.panBy(V, K), this.popupPositioned.set(
|
|
5127
|
+
const o = i.x + i.width / 2, l = i.y + i.height / 2, u = o + a.offsetX, d = l + a.offsetY, f = u + n.width, p = d + n.height, v = this.provider.getContainer().getBoundingClientRect(), x = u - v.left, N = v.right - f, R = d - v.top, G = v.bottom - p, T = Math.min(n.width, n.height) / 4, V = x < 0 ? x - T : N < 0 ? -N + T : 0, K = R < 0 ? R - T : G < 0 ? -G + T : 0;
|
|
5128
|
+
this.provider.panBy(V, K), this.popupPositioned.set(n.id, !0);
|
|
5128
5129
|
}
|
|
5129
5130
|
} else
|
|
5130
|
-
|
|
5131
|
+
n.setCollapsed(!0), n.isCollapsed() && (n.updateMap(!1), n.remove(), this.popupElements.delete(n.id), this.popupPositioned.delete(n.id));
|
|
5131
5132
|
}
|
|
5132
5133
|
}
|
|
5133
5134
|
export {
|
|
5134
|
-
|
|
5135
|
+
Ai as MapManager
|
|
5135
5136
|
};
|