@arenarium/maps 1.0.202 → 1.0.205
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/README.md +1 -1
- package/dist/index.js +1 -2
- package/dist/main.cjs.js +1 -2
- package/dist/main.es.js +1120 -1189
- package/package.json +1 -1
package/dist/main.es.js
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var ws = Object.defineProperty;
|
|
2
|
+
var Xr = (r) => {
|
|
3
3
|
throw TypeError(r);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
function
|
|
5
|
+
var xs = (r, e, t) => e in r ? ws(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
6
|
+
var f = (r, e, t) => xs(r, typeof e != "symbol" ? e + "" : e, t), er = (r, e, t) => e.has(r) || Xr("Cannot " + t);
|
|
7
|
+
var x = (r, e, t) => (er(r, e, "read from private field"), t ? t.call(r) : e.get(r)), L = (r, e, t) => e.has(r) ? Xr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), j = (r, e, t, n) => (er(r, e, "write to private field"), n ? n.call(r, t) : e.set(r, t), t), Se = (r, e, t) => (er(r, e, "access private method"), t);
|
|
8
|
+
var kn = Array.isArray, ks = Array.prototype.indexOf, bs = Array.from, sr = Object.defineProperty, ft = Object.getOwnPropertyDescriptor, Es = Object.prototype, Cs = Array.prototype, Ss = Object.getPrototypeOf, Gr = Object.isExtensible;
|
|
9
|
+
function Ts(r) {
|
|
10
10
|
for (var e = 0; e < r.length; e++)
|
|
11
11
|
r[e]();
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function Ms() {
|
|
14
14
|
var r, e, t = new Promise((n, s) => {
|
|
15
15
|
r = n, e = s;
|
|
16
16
|
});
|
|
17
17
|
return { promise: t, resolve: r, reject: e };
|
|
18
18
|
}
|
|
19
|
-
const Y = 2,
|
|
19
|
+
const Y = 2, Ar = 4, bn = 8, Xt = 16, Ee = 32, Le = 64, En = 128, J = 256, Dt = 512, $ = 1024, oe = 2048, Ce = 4096, Je = 8192, at = 16384, Or = 32768, As = 65536, Jr = 1 << 17, Os = 1 << 18, Nr = 1 << 19, Cn = 1 << 20, ar = 1 << 21, Rr = 1 << 22, Oe = 1 << 23, Rt = Symbol("$state"), Ir = new class extends Error {
|
|
20
20
|
constructor() {
|
|
21
21
|
super(...arguments);
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
f(this, "name", "StaleReactionError");
|
|
23
|
+
f(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
|
|
24
24
|
}
|
|
25
25
|
}();
|
|
26
|
-
function
|
|
26
|
+
function Ns() {
|
|
27
27
|
throw new Error("https://svelte.dev/e/await_outside_boundary");
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function Rs() {
|
|
30
30
|
throw new Error("https://svelte.dev/e/async_derived_orphan");
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function Is(r) {
|
|
33
33
|
throw new Error("https://svelte.dev/e/effect_in_teardown");
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function Ps() {
|
|
36
36
|
throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function Ls(r) {
|
|
39
39
|
throw new Error("https://svelte.dev/e/effect_orphan");
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function Ds() {
|
|
42
42
|
throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function Zs() {
|
|
45
45
|
throw new Error("https://svelte.dev/e/state_descriptors_fixed");
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function js() {
|
|
48
48
|
throw new Error("https://svelte.dev/e/state_prototype_fixed");
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function Fs() {
|
|
51
51
|
throw new Error("https://svelte.dev/e/state_unsafe_mutation");
|
|
52
52
|
}
|
|
53
|
-
const
|
|
54
|
-
function
|
|
53
|
+
const zs = 2, F = Symbol();
|
|
54
|
+
function Sn(r) {
|
|
55
55
|
return r === this.v;
|
|
56
56
|
}
|
|
57
|
-
let
|
|
57
|
+
let re = null;
|
|
58
58
|
function Zt(r) {
|
|
59
|
-
|
|
59
|
+
re = r;
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
|
|
63
|
-
p:
|
|
61
|
+
function Pr(r, e = !1, t) {
|
|
62
|
+
re = {
|
|
63
|
+
p: re,
|
|
64
64
|
c: null,
|
|
65
65
|
e: null,
|
|
66
66
|
s: r,
|
|
@@ -68,37 +68,37 @@ function Dr(r, e = !1, t) {
|
|
|
68
68
|
l: null
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function Lr(r) {
|
|
72
72
|
var e = (
|
|
73
73
|
/** @type {ComponentContext} */
|
|
74
|
-
|
|
74
|
+
re
|
|
75
75
|
), t = e.e;
|
|
76
76
|
if (t !== null) {
|
|
77
77
|
e.e = null;
|
|
78
78
|
for (var n of t)
|
|
79
|
-
|
|
79
|
+
Vn(n);
|
|
80
80
|
}
|
|
81
|
-
return r !== void 0 && (e.x = r),
|
|
81
|
+
return r !== void 0 && (e.x = r), re = e.p, r ?? /** @type {T} */
|
|
82
82
|
{};
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function Tn() {
|
|
85
85
|
return !0;
|
|
86
86
|
}
|
|
87
|
-
const
|
|
88
|
-
function
|
|
87
|
+
const Vs = /* @__PURE__ */ new WeakMap();
|
|
88
|
+
function Us(r) {
|
|
89
89
|
var e = M;
|
|
90
90
|
if (e === null)
|
|
91
91
|
return E.f |= Oe, r;
|
|
92
|
-
if ((e.f &
|
|
93
|
-
if ((e.f &
|
|
94
|
-
throw !e.parent && r instanceof Error &&
|
|
92
|
+
if ((e.f & Or) === 0) {
|
|
93
|
+
if ((e.f & En) === 0)
|
|
94
|
+
throw !e.parent && r instanceof Error && Mn(r), r;
|
|
95
95
|
e.b.error(r);
|
|
96
96
|
} else
|
|
97
|
-
|
|
97
|
+
Dr(r, e);
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function Dr(r, e) {
|
|
100
100
|
for (; e !== null; ) {
|
|
101
|
-
if ((e.f &
|
|
101
|
+
if ((e.f & En) !== 0)
|
|
102
102
|
try {
|
|
103
103
|
e.b.error(r);
|
|
104
104
|
return;
|
|
@@ -107,43 +107,43 @@ function jr(r, e) {
|
|
|
107
107
|
}
|
|
108
108
|
e = e.parent;
|
|
109
109
|
}
|
|
110
|
-
throw r instanceof Error &&
|
|
110
|
+
throw r instanceof Error && Mn(r), r;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
const e =
|
|
114
|
-
e && (
|
|
112
|
+
function Mn(r) {
|
|
113
|
+
const e = Vs.get(r);
|
|
114
|
+
e && (sr(r, "message", {
|
|
115
115
|
value: e.message
|
|
116
|
-
}),
|
|
116
|
+
}), sr(r, "stack", {
|
|
117
117
|
value: e.stack
|
|
118
118
|
}));
|
|
119
119
|
}
|
|
120
120
|
let jt = [];
|
|
121
|
-
function
|
|
121
|
+
function Bs() {
|
|
122
122
|
var r = jt;
|
|
123
|
-
jt = [],
|
|
123
|
+
jt = [], Ts(r);
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
jt.length === 0 && queueMicrotask(
|
|
125
|
+
function $s(r) {
|
|
126
|
+
jt.length === 0 && queueMicrotask(Bs), jt.push(r);
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function qs() {
|
|
129
129
|
for (var r = (
|
|
130
130
|
/** @type {Effect} */
|
|
131
131
|
M.b
|
|
132
132
|
); r !== null && !r.has_pending_snippet(); )
|
|
133
133
|
r = r.parent;
|
|
134
|
-
return r === null &&
|
|
134
|
+
return r === null && Ns(), r;
|
|
135
135
|
}
|
|
136
136
|
// @__NO_SIDE_EFFECTS__
|
|
137
|
-
function
|
|
138
|
-
var e = Y |
|
|
137
|
+
function Ws(r) {
|
|
138
|
+
var e = Y | oe, t = E !== null && (E.f & Y) !== 0 ? (
|
|
139
139
|
/** @type {Derived} */
|
|
140
140
|
E
|
|
141
141
|
) : null;
|
|
142
|
-
return M === null || t !== null && (t.f &
|
|
143
|
-
ctx:
|
|
142
|
+
return M === null || t !== null && (t.f & J) !== 0 ? e |= J : M.f |= Nr, {
|
|
143
|
+
ctx: re,
|
|
144
144
|
deps: null,
|
|
145
145
|
effects: null,
|
|
146
|
-
equals:
|
|
146
|
+
equals: Sn,
|
|
147
147
|
f: e,
|
|
148
148
|
fn: r,
|
|
149
149
|
reactions: null,
|
|
@@ -158,12 +158,12 @@ function Xs(r) {
|
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
160
|
// @__NO_SIDE_EFFECTS__
|
|
161
|
-
function
|
|
161
|
+
function Hs(r, e) {
|
|
162
162
|
let t = (
|
|
163
163
|
/** @type {Effect | null} */
|
|
164
164
|
M
|
|
165
165
|
);
|
|
166
|
-
t === null &&
|
|
166
|
+
t === null && Rs();
|
|
167
167
|
var n = (
|
|
168
168
|
/** @type {Boundary} */
|
|
169
169
|
t.b
|
|
@@ -171,41 +171,41 @@ function Gs(r, e) {
|
|
|
171
171
|
/** @type {Promise<V>} */
|
|
172
172
|
/** @type {unknown} */
|
|
173
173
|
void 0
|
|
174
|
-
), a =
|
|
174
|
+
), a = Pn(
|
|
175
175
|
/** @type {V} */
|
|
176
176
|
F
|
|
177
177
|
), i = null, o = !E;
|
|
178
|
-
return
|
|
178
|
+
return ia(() => {
|
|
179
179
|
try {
|
|
180
180
|
var l = r();
|
|
181
|
-
} catch (
|
|
182
|
-
l = Promise.reject(
|
|
181
|
+
} catch (m) {
|
|
182
|
+
l = Promise.reject(m);
|
|
183
183
|
}
|
|
184
184
|
var u = () => l;
|
|
185
185
|
s = (i == null ? void 0 : i.then(u, u)) ?? Promise.resolve(l), i = s;
|
|
186
186
|
var d = (
|
|
187
187
|
/** @type {Batch} */
|
|
188
|
-
|
|
189
|
-
),
|
|
190
|
-
o && (n.update_pending_count(1),
|
|
191
|
-
const
|
|
192
|
-
i = null,
|
|
188
|
+
D
|
|
189
|
+
), p = n.pending;
|
|
190
|
+
o && (n.update_pending_count(1), p || d.increment());
|
|
191
|
+
const v = (m, k = void 0) => {
|
|
192
|
+
i = null, p || d.activate(), k ? k !== Ir && (a.f |= Oe, lr(a, k)) : ((a.f & Oe) !== 0 && (a.f ^= Oe), lr(a, m)), o && (n.update_pending_count(-1), p || d.decrement()), Nn();
|
|
193
193
|
};
|
|
194
|
-
if (s.then(
|
|
194
|
+
if (s.then(v, (m) => v(null, m || "unknown")), d)
|
|
195
195
|
return () => {
|
|
196
196
|
queueMicrotask(() => d.neuter());
|
|
197
197
|
};
|
|
198
198
|
}), new Promise((l) => {
|
|
199
199
|
function u(d) {
|
|
200
|
-
function
|
|
200
|
+
function p() {
|
|
201
201
|
d === s ? l(a) : u(s);
|
|
202
202
|
}
|
|
203
|
-
d.then(
|
|
203
|
+
d.then(p, p);
|
|
204
204
|
}
|
|
205
205
|
u(s);
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
|
-
function
|
|
208
|
+
function An(r) {
|
|
209
209
|
var e = r.effects;
|
|
210
210
|
if (e !== null) {
|
|
211
211
|
r.effects = null;
|
|
@@ -216,7 +216,7 @@ function Pn(r) {
|
|
|
216
216
|
);
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
|
-
function
|
|
219
|
+
function Ys(r) {
|
|
220
220
|
for (var e = r.parent; e !== null; ) {
|
|
221
221
|
if ((e.f & Y) === 0)
|
|
222
222
|
return (
|
|
@@ -227,150 +227,150 @@ function Js(r) {
|
|
|
227
227
|
}
|
|
228
228
|
return null;
|
|
229
229
|
}
|
|
230
|
-
function
|
|
230
|
+
function Zr(r) {
|
|
231
231
|
var e, t = M;
|
|
232
|
-
Qe(
|
|
232
|
+
Qe(Ys(r));
|
|
233
233
|
try {
|
|
234
|
-
|
|
234
|
+
An(r), e = Jn(r);
|
|
235
235
|
} finally {
|
|
236
236
|
Qe(t);
|
|
237
237
|
}
|
|
238
238
|
return e;
|
|
239
239
|
}
|
|
240
|
-
function
|
|
241
|
-
var e =
|
|
242
|
-
if (r.equals(e) || (r.v = e, r.wv =
|
|
243
|
-
if (
|
|
244
|
-
|
|
240
|
+
function On(r) {
|
|
241
|
+
var e = Zr(r);
|
|
242
|
+
if (r.equals(e) || (r.v = e, r.wv = Xn()), !it)
|
|
243
|
+
if (_e !== null)
|
|
244
|
+
_e.set(r, r.v);
|
|
245
245
|
else {
|
|
246
|
-
var t = (
|
|
247
|
-
|
|
246
|
+
var t = (ge || (r.f & J) !== 0) && r.deps !== null ? Ce : $;
|
|
247
|
+
K(r, t);
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
|
-
function
|
|
251
|
-
const n =
|
|
250
|
+
function Xs(r, e, t) {
|
|
251
|
+
const n = Ws;
|
|
252
252
|
if (e.length === 0) {
|
|
253
253
|
t(r.map(n));
|
|
254
254
|
return;
|
|
255
255
|
}
|
|
256
|
-
var s =
|
|
256
|
+
var s = D, a = (
|
|
257
257
|
/** @type {Effect} */
|
|
258
258
|
M
|
|
259
|
-
), i =
|
|
260
|
-
Promise.all(e.map((l) => /* @__PURE__ */
|
|
259
|
+
), i = Gs(), o = qs();
|
|
260
|
+
Promise.all(e.map((l) => /* @__PURE__ */ Hs(l))).then((l) => {
|
|
261
261
|
s == null || s.activate(), i();
|
|
262
262
|
try {
|
|
263
263
|
t([...r.map(n), ...l]);
|
|
264
264
|
} catch (u) {
|
|
265
|
-
(a.f & at) === 0 &&
|
|
265
|
+
(a.f & at) === 0 && Dr(u, a);
|
|
266
266
|
}
|
|
267
|
-
s == null || s.deactivate(),
|
|
267
|
+
s == null || s.deactivate(), Nn();
|
|
268
268
|
}).catch((l) => {
|
|
269
269
|
o.error(l);
|
|
270
270
|
});
|
|
271
271
|
}
|
|
272
|
-
function
|
|
273
|
-
var r = M, e = E, t =
|
|
272
|
+
function Gs() {
|
|
273
|
+
var r = M, e = E, t = re;
|
|
274
274
|
return function() {
|
|
275
|
-
Qe(r),
|
|
275
|
+
Qe(r), xe(e), Zt(t);
|
|
276
276
|
};
|
|
277
277
|
}
|
|
278
|
-
function
|
|
279
|
-
Qe(null),
|
|
278
|
+
function Nn() {
|
|
279
|
+
Qe(null), xe(null), Zt(null);
|
|
280
280
|
}
|
|
281
281
|
const ut = /* @__PURE__ */ new Set();
|
|
282
|
-
let
|
|
283
|
-
function
|
|
282
|
+
let D = null, _e = null, Kr = /* @__PURE__ */ new Set(), Ft = [];
|
|
283
|
+
function Rn() {
|
|
284
284
|
const r = (
|
|
285
285
|
/** @type {() => void} */
|
|
286
286
|
Ft.shift()
|
|
287
287
|
);
|
|
288
|
-
Ft.length > 0 && queueMicrotask(
|
|
288
|
+
Ft.length > 0 && queueMicrotask(Rn), r();
|
|
289
289
|
}
|
|
290
|
-
let vt = [],
|
|
291
|
-
var We, He, me, bt, Et, Te, Ye, Me, ve, Xe, Ct, St,
|
|
290
|
+
let vt = [], jr = null, ir = !1;
|
|
291
|
+
var We, He, me, bt, Et, Te, Ye, Me, ve, Xe, Ct, St, te, In, It, or;
|
|
292
292
|
const Wt = class Wt {
|
|
293
293
|
constructor() {
|
|
294
|
-
|
|
294
|
+
L(this, te);
|
|
295
295
|
/**
|
|
296
296
|
* The current values of any sources that are updated in this batch
|
|
297
297
|
* They keys of this map are identical to `this.#previous`
|
|
298
298
|
* @type {Map<Source, any>}
|
|
299
299
|
*/
|
|
300
|
-
|
|
300
|
+
f(this, "current", /* @__PURE__ */ new Map());
|
|
301
301
|
/**
|
|
302
302
|
* The values of any sources that are updated in this batch _before_ those updates took place.
|
|
303
303
|
* They keys of this map are identical to `this.#current`
|
|
304
304
|
* @type {Map<Source, any>}
|
|
305
305
|
*/
|
|
306
|
-
|
|
306
|
+
L(this, We, /* @__PURE__ */ new Map());
|
|
307
307
|
/**
|
|
308
308
|
* When the batch is committed (and the DOM is updated), we need to remove old branches
|
|
309
309
|
* and append new ones by calling the functions added inside (if/each/key/etc) blocks
|
|
310
310
|
* @type {Set<() => void>}
|
|
311
311
|
*/
|
|
312
|
-
|
|
312
|
+
L(this, He, /* @__PURE__ */ new Set());
|
|
313
313
|
/**
|
|
314
314
|
* The number of async effects that are currently in flight
|
|
315
315
|
*/
|
|
316
|
-
|
|
316
|
+
L(this, me, 0);
|
|
317
317
|
/**
|
|
318
318
|
* A deferred that resolves when the batch is committed, used with `settled()`
|
|
319
319
|
* TODO replace with Promise.withResolvers once supported widely enough
|
|
320
320
|
* @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
|
|
321
321
|
*/
|
|
322
|
-
|
|
322
|
+
L(this, bt, null);
|
|
323
323
|
/**
|
|
324
324
|
* True if an async effect inside this batch resolved and
|
|
325
325
|
* its parent branch was already deleted
|
|
326
326
|
*/
|
|
327
|
-
|
|
327
|
+
L(this, Et, !1);
|
|
328
328
|
/**
|
|
329
329
|
* Async effects (created inside `async_derived`) encountered during processing.
|
|
330
330
|
* These run after the rest of the batch has updated, since they should
|
|
331
331
|
* always have the latest values
|
|
332
332
|
* @type {Effect[]}
|
|
333
333
|
*/
|
|
334
|
-
|
|
334
|
+
L(this, Te, []);
|
|
335
335
|
/**
|
|
336
336
|
* The same as `#async_effects`, but for effects inside a newly-created
|
|
337
337
|
* `<svelte:boundary>` — these do not prevent the batch from committing
|
|
338
338
|
* @type {Effect[]}
|
|
339
339
|
*/
|
|
340
|
-
|
|
340
|
+
L(this, Ye, []);
|
|
341
341
|
/**
|
|
342
342
|
* Template effects and `$effect.pre` effects, which run when
|
|
343
343
|
* a batch is committed
|
|
344
344
|
* @type {Effect[]}
|
|
345
345
|
*/
|
|
346
|
-
|
|
346
|
+
L(this, Me, []);
|
|
347
347
|
/**
|
|
348
348
|
* The same as `#render_effects`, but for `$effect` (which runs after)
|
|
349
349
|
* @type {Effect[]}
|
|
350
350
|
*/
|
|
351
|
-
|
|
351
|
+
L(this, ve, []);
|
|
352
352
|
/**
|
|
353
353
|
* Block effects, which may need to re-run on subsequent flushes
|
|
354
354
|
* in order to update internal sources (e.g. each block items)
|
|
355
355
|
* @type {Effect[]}
|
|
356
356
|
*/
|
|
357
|
-
|
|
357
|
+
L(this, Xe, []);
|
|
358
358
|
/**
|
|
359
359
|
* Deferred effects (which run after async work has completed) that are DIRTY
|
|
360
360
|
* @type {Effect[]}
|
|
361
361
|
*/
|
|
362
|
-
|
|
362
|
+
L(this, Ct, []);
|
|
363
363
|
/**
|
|
364
364
|
* Deferred effects that are MAYBE_DIRTY
|
|
365
365
|
* @type {Effect[]}
|
|
366
366
|
*/
|
|
367
|
-
|
|
367
|
+
L(this, St, []);
|
|
368
368
|
/**
|
|
369
369
|
* A set of branches that still exist, but will be destroyed when this batch
|
|
370
370
|
* is committed — we skip over these during `process`
|
|
371
371
|
* @type {Set<Effect>}
|
|
372
372
|
*/
|
|
373
|
-
|
|
373
|
+
f(this, "skipped_effects", /* @__PURE__ */ new Set());
|
|
374
374
|
}
|
|
375
375
|
/**
|
|
376
376
|
*
|
|
@@ -381,30 +381,30 @@ const Wt = class Wt {
|
|
|
381
381
|
vt = [];
|
|
382
382
|
var t = null;
|
|
383
383
|
if (ut.size > 1) {
|
|
384
|
-
t = /* @__PURE__ */ new Map(),
|
|
384
|
+
t = /* @__PURE__ */ new Map(), _e = /* @__PURE__ */ new Map();
|
|
385
385
|
for (const [i, o] of this.current)
|
|
386
386
|
t.set(i, { v: i.v, wv: i.wv }), i.v = o;
|
|
387
387
|
for (const i of ut)
|
|
388
388
|
if (i !== this)
|
|
389
|
-
for (const [o, l] of
|
|
389
|
+
for (const [o, l] of x(i, We))
|
|
390
390
|
t.has(o) || (t.set(o, { v: o.v, wv: o.wv }), o.v = l);
|
|
391
391
|
}
|
|
392
392
|
for (const i of e)
|
|
393
|
-
Se(this,
|
|
394
|
-
if (
|
|
395
|
-
Se(this,
|
|
396
|
-
var n =
|
|
397
|
-
j(this, Me, []), j(this, ve, []), j(this, Xe, []),
|
|
393
|
+
Se(this, te, In).call(this, i);
|
|
394
|
+
if (x(this, Te).length === 0 && x(this, me) === 0) {
|
|
395
|
+
Se(this, te, or).call(this);
|
|
396
|
+
var n = x(this, Me), s = x(this, ve);
|
|
397
|
+
j(this, Me, []), j(this, ve, []), j(this, Xe, []), D = null, Qr(n), Qr(s), D === null ? D = this : ut.delete(this), (a = x(this, bt)) == null || a.resolve();
|
|
398
398
|
} else
|
|
399
|
-
Se(this,
|
|
399
|
+
Se(this, te, It).call(this, x(this, Me)), Se(this, te, It).call(this, x(this, ve)), Se(this, te, It).call(this, x(this, Xe));
|
|
400
400
|
if (t) {
|
|
401
401
|
for (const [i, { v: o, wv: l }] of t)
|
|
402
402
|
i.wv <= l && (i.v = o);
|
|
403
|
-
|
|
403
|
+
_e = null;
|
|
404
404
|
}
|
|
405
|
-
for (const i of
|
|
405
|
+
for (const i of x(this, Te))
|
|
406
406
|
ht(i);
|
|
407
|
-
for (const i of
|
|
407
|
+
for (const i of x(this, Ye))
|
|
408
408
|
ht(i);
|
|
409
409
|
j(this, Te, []), j(this, Ye, []);
|
|
410
410
|
}
|
|
@@ -415,77 +415,77 @@ const Wt = class Wt {
|
|
|
415
415
|
* @param {any} value
|
|
416
416
|
*/
|
|
417
417
|
capture(e, t) {
|
|
418
|
-
|
|
418
|
+
x(this, We).has(e) || x(this, We).set(e, t), this.current.set(e, e.v);
|
|
419
419
|
}
|
|
420
420
|
activate() {
|
|
421
|
-
|
|
421
|
+
D = this;
|
|
422
422
|
}
|
|
423
423
|
deactivate() {
|
|
424
|
-
|
|
425
|
-
for (const e of
|
|
426
|
-
if (
|
|
424
|
+
D = null;
|
|
425
|
+
for (const e of Kr)
|
|
426
|
+
if (Kr.delete(e), e(), D !== null)
|
|
427
427
|
break;
|
|
428
428
|
}
|
|
429
429
|
neuter() {
|
|
430
430
|
j(this, Et, !0);
|
|
431
431
|
}
|
|
432
432
|
flush() {
|
|
433
|
-
vt.length > 0 ?
|
|
433
|
+
vt.length > 0 ? Js() : Se(this, te, or).call(this), D === this && (x(this, me) === 0 && ut.delete(this), this.deactivate());
|
|
434
434
|
}
|
|
435
435
|
increment() {
|
|
436
|
-
j(this, me,
|
|
436
|
+
j(this, me, x(this, me) + 1);
|
|
437
437
|
}
|
|
438
438
|
decrement() {
|
|
439
|
-
if (j(this, me,
|
|
440
|
-
for (const e of
|
|
441
|
-
|
|
442
|
-
for (const e of
|
|
443
|
-
|
|
439
|
+
if (j(this, me, x(this, me) - 1), x(this, me) === 0) {
|
|
440
|
+
for (const e of x(this, Ct))
|
|
441
|
+
K(e, oe), Ke(e);
|
|
442
|
+
for (const e of x(this, St))
|
|
443
|
+
K(e, Ce), Ke(e);
|
|
444
444
|
j(this, Me, []), j(this, ve, []), this.flush();
|
|
445
445
|
} else
|
|
446
446
|
this.deactivate();
|
|
447
447
|
}
|
|
448
448
|
/** @param {() => void} fn */
|
|
449
449
|
add_callback(e) {
|
|
450
|
-
|
|
450
|
+
x(this, He).add(e);
|
|
451
451
|
}
|
|
452
452
|
settled() {
|
|
453
|
-
return (
|
|
453
|
+
return (x(this, bt) ?? j(this, bt, Ms())).promise;
|
|
454
454
|
}
|
|
455
455
|
static ensure() {
|
|
456
|
-
if (
|
|
457
|
-
const e =
|
|
458
|
-
ut.add(
|
|
459
|
-
|
|
456
|
+
if (D === null) {
|
|
457
|
+
const e = D = new Wt();
|
|
458
|
+
ut.add(D), Wt.enqueue(() => {
|
|
459
|
+
D === e && e.flush();
|
|
460
460
|
});
|
|
461
461
|
}
|
|
462
|
-
return
|
|
462
|
+
return D;
|
|
463
463
|
}
|
|
464
464
|
/** @param {() => void} task */
|
|
465
465
|
static enqueue(e) {
|
|
466
|
-
Ft.length === 0 && queueMicrotask(
|
|
466
|
+
Ft.length === 0 && queueMicrotask(Rn), Ft.unshift(e);
|
|
467
467
|
}
|
|
468
468
|
};
|
|
469
|
-
We = new WeakMap(), He = new WeakMap(), me = new WeakMap(), bt = new WeakMap(), Et = new WeakMap(), Te = new WeakMap(), Ye = new WeakMap(), Me = new WeakMap(), ve = new WeakMap(), Xe = new WeakMap(), Ct = new WeakMap(), St = new WeakMap(),
|
|
469
|
+
We = new WeakMap(), He = new WeakMap(), me = new WeakMap(), bt = new WeakMap(), Et = new WeakMap(), Te = new WeakMap(), Ye = new WeakMap(), Me = new WeakMap(), ve = new WeakMap(), Xe = new WeakMap(), Ct = new WeakMap(), St = new WeakMap(), te = new WeakSet(), /**
|
|
470
470
|
* Traverse the effect tree, executing effects or stashing
|
|
471
471
|
* them for later execution as appropriate
|
|
472
472
|
* @param {Effect} root
|
|
473
473
|
*/
|
|
474
|
-
|
|
474
|
+
In = function(e) {
|
|
475
475
|
var d;
|
|
476
|
-
e.f ^=
|
|
476
|
+
e.f ^= $;
|
|
477
477
|
for (var t = e.first; t !== null; ) {
|
|
478
|
-
var n = t.f, s = (n & (Ee | Le)) !== 0, a = s && (n &
|
|
478
|
+
var n = t.f, s = (n & (Ee | Le)) !== 0, a = s && (n & $) !== 0, i = a || (n & Je) !== 0 || this.skipped_effects.has(t);
|
|
479
479
|
if (!i && t.fn !== null) {
|
|
480
480
|
if (s)
|
|
481
|
-
t.f ^=
|
|
482
|
-
else if ((n &
|
|
483
|
-
if ((n &
|
|
484
|
-
|
|
485
|
-
else if ((n &
|
|
486
|
-
var o = (d = t.b) != null && d.pending ?
|
|
481
|
+
t.f ^= $;
|
|
482
|
+
else if ((n & $) === 0)
|
|
483
|
+
if ((n & Ar) !== 0)
|
|
484
|
+
x(this, ve).push(t);
|
|
485
|
+
else if ((n & Rr) !== 0) {
|
|
486
|
+
var o = (d = t.b) != null && d.pending ? x(this, Ye) : x(this, Te);
|
|
487
487
|
o.push(t);
|
|
488
|
-
} else Gt(t) && ((t.f & Xt) !== 0 &&
|
|
488
|
+
} else Gt(t) && ((t.f & Xt) !== 0 && x(this, Xe).push(t), ht(t));
|
|
489
489
|
var l = t.first;
|
|
490
490
|
if (l !== null) {
|
|
491
491
|
t = l;
|
|
@@ -501,50 +501,50 @@ jn = function(e) {
|
|
|
501
501
|
*/
|
|
502
502
|
It = function(e) {
|
|
503
503
|
for (const t of e)
|
|
504
|
-
((t.f &
|
|
504
|
+
((t.f & oe) !== 0 ? x(this, Ct) : x(this, St)).push(t), K(t, $);
|
|
505
505
|
e.length = 0;
|
|
506
506
|
}, /**
|
|
507
507
|
* Append and remove branches to/from the DOM
|
|
508
508
|
*/
|
|
509
|
-
|
|
510
|
-
if (!
|
|
511
|
-
for (const e of
|
|
509
|
+
or = function() {
|
|
510
|
+
if (!x(this, Et))
|
|
511
|
+
for (const e of x(this, He))
|
|
512
512
|
e();
|
|
513
|
-
|
|
513
|
+
x(this, He).clear();
|
|
514
514
|
};
|
|
515
|
-
let
|
|
516
|
-
function
|
|
515
|
+
let _t = Wt;
|
|
516
|
+
function Js() {
|
|
517
517
|
var r = $e;
|
|
518
|
-
|
|
518
|
+
ir = !0;
|
|
519
519
|
try {
|
|
520
520
|
var e = 0;
|
|
521
|
-
for (
|
|
522
|
-
var t =
|
|
521
|
+
for (tn(!0); vt.length > 0; ) {
|
|
522
|
+
var t = _t.ensure();
|
|
523
523
|
if (e++ > 1e3) {
|
|
524
524
|
var n, s;
|
|
525
|
-
|
|
525
|
+
Ks();
|
|
526
526
|
}
|
|
527
527
|
t.process(vt), Ne.clear();
|
|
528
528
|
}
|
|
529
529
|
} finally {
|
|
530
|
-
|
|
530
|
+
ir = !1, tn(r), jr = null;
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
|
-
function
|
|
533
|
+
function Ks() {
|
|
534
534
|
try {
|
|
535
|
-
|
|
535
|
+
Ds();
|
|
536
536
|
} catch (r) {
|
|
537
|
-
|
|
537
|
+
Dr(r, jr);
|
|
538
538
|
}
|
|
539
539
|
}
|
|
540
|
-
function
|
|
540
|
+
function Qr(r) {
|
|
541
541
|
var e = r.length;
|
|
542
542
|
if (e !== 0) {
|
|
543
543
|
for (var t = 0; t < e; ) {
|
|
544
544
|
var n = r[t++];
|
|
545
545
|
if ((n.f & (at | Je)) === 0 && Gt(n)) {
|
|
546
|
-
var s =
|
|
547
|
-
if (ht(n), n.deps === null && n.first === null && n.nodes_start === null && (n.teardown === null && n.ac === null ?
|
|
546
|
+
var s = D ? D.current.size : 0;
|
|
547
|
+
if (ht(n), n.deps === null && n.first === null && n.nodes_start === null && (n.teardown === null && n.ac === null ? Wn(n) : n.fn = null), D !== null && D.current.size > s && (n.f & Cn) !== 0)
|
|
548
548
|
break;
|
|
549
549
|
}
|
|
550
550
|
}
|
|
@@ -553,64 +553,64 @@ function rn(r) {
|
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
555
|
function Ke(r) {
|
|
556
|
-
for (var e =
|
|
556
|
+
for (var e = jr = r; e.parent !== null; ) {
|
|
557
557
|
e = e.parent;
|
|
558
558
|
var t = e.f;
|
|
559
|
-
if (
|
|
559
|
+
if (ir && e === M && (t & Xt) !== 0)
|
|
560
560
|
return;
|
|
561
561
|
if ((t & (Le | Ee)) !== 0) {
|
|
562
|
-
if ((t &
|
|
563
|
-
e.f ^=
|
|
562
|
+
if ((t & $) === 0) return;
|
|
563
|
+
e.f ^= $;
|
|
564
564
|
}
|
|
565
565
|
}
|
|
566
566
|
vt.push(e);
|
|
567
567
|
}
|
|
568
568
|
const Ne = /* @__PURE__ */ new Map();
|
|
569
|
-
function
|
|
569
|
+
function Pn(r, e) {
|
|
570
570
|
var t = {
|
|
571
571
|
f: 0,
|
|
572
572
|
// TODO ideally we could skip this altogether, but it causes type errors
|
|
573
573
|
v: r,
|
|
574
574
|
reactions: null,
|
|
575
|
-
equals:
|
|
575
|
+
equals: Sn,
|
|
576
576
|
rv: 0,
|
|
577
577
|
wv: 0
|
|
578
578
|
};
|
|
579
579
|
return t;
|
|
580
580
|
}
|
|
581
581
|
// @__NO_SIDE_EFFECTS__
|
|
582
|
-
function
|
|
583
|
-
const t =
|
|
584
|
-
return
|
|
582
|
+
function B(r, e) {
|
|
583
|
+
const t = Pn(r);
|
|
584
|
+
return fa(t), t;
|
|
585
585
|
}
|
|
586
|
-
function
|
|
586
|
+
function V(r, e, t = !1) {
|
|
587
587
|
E !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
|
|
588
588
|
// to ensure we error if state is set inside an inspect effect
|
|
589
|
-
(!
|
|
589
|
+
(!se || (E.f & Jr) !== 0) && Tn() && (E.f & (Y | Xt | Rr | Jr)) !== 0 && !(U != null && U.includes(r)) && Fs();
|
|
590
590
|
let n = t ? dt(e) : e;
|
|
591
|
-
return
|
|
591
|
+
return lr(r, n);
|
|
592
592
|
}
|
|
593
|
-
function
|
|
593
|
+
function lr(r, e) {
|
|
594
594
|
if (!r.equals(e)) {
|
|
595
595
|
var t = r.v;
|
|
596
596
|
it ? Ne.set(r, e) : Ne.set(r, t), r.v = e;
|
|
597
|
-
var n =
|
|
598
|
-
n.capture(r, t), (r.f & Y) !== 0 && ((r.f &
|
|
597
|
+
var n = _t.ensure();
|
|
598
|
+
n.capture(r, t), (r.f & Y) !== 0 && ((r.f & oe) !== 0 && Zr(
|
|
599
599
|
/** @type {Derived} */
|
|
600
600
|
r
|
|
601
|
-
),
|
|
601
|
+
), K(r, (r.f & J) === 0 ? $ : Ce)), r.wv = Xn(), Ln(r, oe), M !== null && (M.f & $) !== 0 && (M.f & (Ee | Le)) === 0 && (G === null ? ha([r]) : G.push(r));
|
|
602
602
|
}
|
|
603
603
|
return e;
|
|
604
604
|
}
|
|
605
605
|
function tr(r) {
|
|
606
|
-
|
|
606
|
+
V(r, r.v + 1);
|
|
607
607
|
}
|
|
608
|
-
function
|
|
608
|
+
function Ln(r, e) {
|
|
609
609
|
var t = r.reactions;
|
|
610
610
|
if (t !== null)
|
|
611
611
|
for (var n = t.length, s = 0; s < n; s++) {
|
|
612
|
-
var a = t[s], i = a.f, o = (i &
|
|
613
|
-
o &&
|
|
612
|
+
var a = t[s], i = a.f, o = (i & oe) === 0;
|
|
613
|
+
o && K(a, e), (i & Y) !== 0 ? Ln(
|
|
614
614
|
/** @type {Derived} */
|
|
615
615
|
a,
|
|
616
616
|
Ce
|
|
@@ -623,18 +623,18 @@ function zn(r, e) {
|
|
|
623
623
|
function dt(r) {
|
|
624
624
|
if (typeof r != "object" || r === null || Rt in r)
|
|
625
625
|
return r;
|
|
626
|
-
const e =
|
|
627
|
-
if (e !==
|
|
626
|
+
const e = Ss(r);
|
|
627
|
+
if (e !== Es && e !== Cs)
|
|
628
628
|
return r;
|
|
629
|
-
var t = /* @__PURE__ */ new Map(), n =
|
|
629
|
+
var t = /* @__PURE__ */ new Map(), n = kn(r), s = /* @__PURE__ */ B(0), a = Re, i = (o) => {
|
|
630
630
|
if (Re === a)
|
|
631
631
|
return o();
|
|
632
632
|
var l = E, u = Re;
|
|
633
|
-
|
|
633
|
+
xe(null), nn(a);
|
|
634
634
|
var d = o();
|
|
635
|
-
return
|
|
635
|
+
return xe(l), nn(u), d;
|
|
636
636
|
};
|
|
637
|
-
return n && t.set("length", /* @__PURE__ */
|
|
637
|
+
return n && t.set("length", /* @__PURE__ */ B(
|
|
638
638
|
/** @type {any[]} */
|
|
639
639
|
r.length
|
|
640
640
|
)), new Proxy(
|
|
@@ -642,35 +642,35 @@ function dt(r) {
|
|
|
642
642
|
r,
|
|
643
643
|
{
|
|
644
644
|
defineProperty(o, l, u) {
|
|
645
|
-
(!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) &&
|
|
645
|
+
(!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Zs();
|
|
646
646
|
var d = t.get(l);
|
|
647
647
|
return d === void 0 ? d = i(() => {
|
|
648
|
-
var
|
|
649
|
-
return t.set(l,
|
|
650
|
-
}) :
|
|
648
|
+
var p = /* @__PURE__ */ B(u.value);
|
|
649
|
+
return t.set(l, p), p;
|
|
650
|
+
}) : V(d, u.value, !0), !0;
|
|
651
651
|
},
|
|
652
652
|
deleteProperty(o, l) {
|
|
653
653
|
var u = t.get(l);
|
|
654
654
|
if (u === void 0) {
|
|
655
655
|
if (l in o) {
|
|
656
|
-
const d = i(() => /* @__PURE__ */
|
|
656
|
+
const d = i(() => /* @__PURE__ */ B(F));
|
|
657
657
|
t.set(l, d), tr(s);
|
|
658
658
|
}
|
|
659
659
|
} else
|
|
660
|
-
|
|
660
|
+
V(u, F), tr(s);
|
|
661
661
|
return !0;
|
|
662
662
|
},
|
|
663
663
|
get(o, l, u) {
|
|
664
|
-
var
|
|
664
|
+
var m;
|
|
665
665
|
if (l === Rt)
|
|
666
666
|
return r;
|
|
667
|
-
var d = t.get(l),
|
|
668
|
-
if (d === void 0 && (!
|
|
669
|
-
var
|
|
670
|
-
return
|
|
667
|
+
var d = t.get(l), p = l in o;
|
|
668
|
+
if (d === void 0 && (!p || (m = ft(o, l)) != null && m.writable) && (d = i(() => {
|
|
669
|
+
var k = dt(p ? o[l] : F), T = /* @__PURE__ */ B(k);
|
|
670
|
+
return T;
|
|
671
671
|
}), t.set(l, d)), d !== void 0) {
|
|
672
|
-
var
|
|
673
|
-
return
|
|
672
|
+
var v = N(d);
|
|
673
|
+
return v === F ? void 0 : v;
|
|
674
674
|
}
|
|
675
675
|
return Reflect.get(o, l, u);
|
|
676
676
|
},
|
|
@@ -678,113 +678,113 @@ function dt(r) {
|
|
|
678
678
|
var u = Reflect.getOwnPropertyDescriptor(o, l);
|
|
679
679
|
if (u && "value" in u) {
|
|
680
680
|
var d = t.get(l);
|
|
681
|
-
d && (u.value =
|
|
681
|
+
d && (u.value = N(d));
|
|
682
682
|
} else if (u === void 0) {
|
|
683
|
-
var
|
|
684
|
-
if (
|
|
683
|
+
var p = t.get(l), v = p == null ? void 0 : p.v;
|
|
684
|
+
if (p !== void 0 && v !== F)
|
|
685
685
|
return {
|
|
686
686
|
enumerable: !0,
|
|
687
687
|
configurable: !0,
|
|
688
|
-
value:
|
|
688
|
+
value: v,
|
|
689
689
|
writable: !0
|
|
690
690
|
};
|
|
691
691
|
}
|
|
692
692
|
return u;
|
|
693
693
|
},
|
|
694
694
|
has(o, l) {
|
|
695
|
-
var
|
|
695
|
+
var v;
|
|
696
696
|
if (l === Rt)
|
|
697
697
|
return !0;
|
|
698
698
|
var u = t.get(l), d = u !== void 0 && u.v !== F || Reflect.has(o, l);
|
|
699
|
-
if (u !== void 0 || M !== null && (!d || (
|
|
699
|
+
if (u !== void 0 || M !== null && (!d || (v = ft(o, l)) != null && v.writable)) {
|
|
700
700
|
u === void 0 && (u = i(() => {
|
|
701
|
-
var
|
|
702
|
-
return
|
|
701
|
+
var m = d ? dt(o[l]) : F, k = /* @__PURE__ */ B(m);
|
|
702
|
+
return k;
|
|
703
703
|
}), t.set(l, u));
|
|
704
|
-
var
|
|
705
|
-
if (
|
|
704
|
+
var p = N(u);
|
|
705
|
+
if (p === F)
|
|
706
706
|
return !1;
|
|
707
707
|
}
|
|
708
708
|
return d;
|
|
709
709
|
},
|
|
710
710
|
set(o, l, u, d) {
|
|
711
|
-
var
|
|
712
|
-
var
|
|
711
|
+
var W;
|
|
712
|
+
var p = t.get(l), v = l in o;
|
|
713
713
|
if (n && l === "length")
|
|
714
|
-
for (var
|
|
715
|
-
|
|
716
|
-
var
|
|
717
|
-
|
|
714
|
+
for (var m = u; m < /** @type {Source<number>} */
|
|
715
|
+
p.v; m += 1) {
|
|
716
|
+
var k = t.get(m + "");
|
|
717
|
+
k !== void 0 ? V(k, F) : m in o && (k = i(() => /* @__PURE__ */ B(F)), t.set(m + "", k));
|
|
718
718
|
}
|
|
719
|
-
if (
|
|
720
|
-
(!
|
|
719
|
+
if (p === void 0)
|
|
720
|
+
(!v || (W = ft(o, l)) != null && W.writable) && (p = i(() => /* @__PURE__ */ B(void 0)), V(p, dt(u)), t.set(l, p));
|
|
721
721
|
else {
|
|
722
|
-
|
|
723
|
-
var
|
|
724
|
-
|
|
722
|
+
v = p.v !== F;
|
|
723
|
+
var T = i(() => dt(u));
|
|
724
|
+
V(p, T);
|
|
725
725
|
}
|
|
726
|
-
var
|
|
727
|
-
if (
|
|
726
|
+
var I = Reflect.getOwnPropertyDescriptor(o, l);
|
|
727
|
+
if (I != null && I.set && I.set.call(d, u), !v) {
|
|
728
728
|
if (n && typeof l == "string") {
|
|
729
|
-
var
|
|
729
|
+
var le = (
|
|
730
730
|
/** @type {Source<number>} */
|
|
731
731
|
t.get("length")
|
|
732
|
-
),
|
|
733
|
-
Number.isInteger(
|
|
732
|
+
), Z = Number(l);
|
|
733
|
+
Number.isInteger(Z) && Z >= le.v && V(le, Z + 1);
|
|
734
734
|
}
|
|
735
735
|
tr(s);
|
|
736
736
|
}
|
|
737
737
|
return !0;
|
|
738
738
|
},
|
|
739
739
|
ownKeys(o) {
|
|
740
|
-
|
|
741
|
-
var l = Reflect.ownKeys(o).filter((
|
|
742
|
-
var
|
|
743
|
-
return
|
|
740
|
+
N(s);
|
|
741
|
+
var l = Reflect.ownKeys(o).filter((p) => {
|
|
742
|
+
var v = t.get(p);
|
|
743
|
+
return v === void 0 || v.v !== F;
|
|
744
744
|
});
|
|
745
745
|
for (var [u, d] of t)
|
|
746
746
|
d.v !== F && !(u in o) && l.push(u);
|
|
747
747
|
return l;
|
|
748
748
|
},
|
|
749
749
|
setPrototypeOf() {
|
|
750
|
-
|
|
750
|
+
js();
|
|
751
751
|
}
|
|
752
752
|
}
|
|
753
753
|
);
|
|
754
754
|
}
|
|
755
|
-
var
|
|
756
|
-
function
|
|
757
|
-
if (
|
|
758
|
-
|
|
755
|
+
var en, Dn, Zn, jn;
|
|
756
|
+
function Qs() {
|
|
757
|
+
if (en === void 0) {
|
|
758
|
+
en = window, Dn = /Firefox/.test(navigator.userAgent);
|
|
759
759
|
var r = Element.prototype, e = Node.prototype, t = Text.prototype;
|
|
760
|
-
|
|
760
|
+
Zn = ft(e, "firstChild").get, jn = ft(e, "nextSibling").get, Gr(r) && (r.__click = void 0, r.__className = void 0, r.__attributes = null, r.__style = void 0, r.__e = void 0), Gr(t) && (t.__t = void 0);
|
|
761
761
|
}
|
|
762
762
|
}
|
|
763
|
-
function
|
|
763
|
+
function ea(r = "") {
|
|
764
764
|
return document.createTextNode(r);
|
|
765
765
|
}
|
|
766
766
|
// @__NO_SIDE_EFFECTS__
|
|
767
|
-
function
|
|
768
|
-
return
|
|
767
|
+
function Fn(r) {
|
|
768
|
+
return Zn.call(r);
|
|
769
769
|
}
|
|
770
770
|
// @__NO_SIDE_EFFECTS__
|
|
771
|
-
function
|
|
772
|
-
return
|
|
771
|
+
function zn(r) {
|
|
772
|
+
return jn.call(r);
|
|
773
773
|
}
|
|
774
|
-
function
|
|
775
|
-
return /* @__PURE__ */
|
|
774
|
+
function ur(r, e) {
|
|
775
|
+
return /* @__PURE__ */ Fn(r);
|
|
776
776
|
}
|
|
777
|
-
function
|
|
777
|
+
function ta(r, e = 1, t = !1) {
|
|
778
778
|
let n = r;
|
|
779
779
|
for (; e--; )
|
|
780
780
|
n = /** @type {TemplateNode} */
|
|
781
|
-
/* @__PURE__ */
|
|
781
|
+
/* @__PURE__ */ zn(n);
|
|
782
782
|
return n;
|
|
783
783
|
}
|
|
784
|
-
function
|
|
785
|
-
M === null && E === null &&
|
|
784
|
+
function ra(r) {
|
|
785
|
+
M === null && E === null && Ls(), E !== null && (E.f & J) !== 0 && M === null && Ps(), it && Is();
|
|
786
786
|
}
|
|
787
|
-
function
|
|
787
|
+
function na(r, e) {
|
|
788
788
|
var t = e.last;
|
|
789
789
|
t === null ? e.last = e.first = r : (t.next = r, r.prev = t, e.last = r);
|
|
790
790
|
}
|
|
@@ -792,11 +792,11 @@ function De(r, e, t, n = !0) {
|
|
|
792
792
|
var s = M;
|
|
793
793
|
s !== null && (s.f & Je) !== 0 && (r |= Je);
|
|
794
794
|
var a = {
|
|
795
|
-
ctx:
|
|
795
|
+
ctx: re,
|
|
796
796
|
deps: null,
|
|
797
797
|
nodes_start: null,
|
|
798
798
|
nodes_end: null,
|
|
799
|
-
f: r |
|
|
799
|
+
f: r | oe,
|
|
800
800
|
first: null,
|
|
801
801
|
fn: e,
|
|
802
802
|
last: null,
|
|
@@ -811,13 +811,13 @@ function De(r, e, t, n = !0) {
|
|
|
811
811
|
};
|
|
812
812
|
if (t)
|
|
813
813
|
try {
|
|
814
|
-
ht(a), a.f |=
|
|
814
|
+
ht(a), a.f |= Or;
|
|
815
815
|
} catch (l) {
|
|
816
816
|
throw Pe(a), l;
|
|
817
817
|
}
|
|
818
818
|
else e !== null && Ke(a);
|
|
819
|
-
var i = t && a.deps === null && a.first === null && a.nodes_start === null && a.teardown === null && (a.f &
|
|
820
|
-
if (!i && n && (s !== null &&
|
|
819
|
+
var i = t && a.deps === null && a.first === null && a.nodes_start === null && a.teardown === null && (a.f & Nr) === 0;
|
|
820
|
+
if (!i && n && (s !== null && na(a, s), E !== null && (E.f & Y) !== 0 && (r & Le) === 0)) {
|
|
821
821
|
var o = (
|
|
822
822
|
/** @type {Derived} */
|
|
823
823
|
E
|
|
@@ -827,71 +827,71 @@ function De(r, e, t, n = !0) {
|
|
|
827
827
|
return a;
|
|
828
828
|
}
|
|
829
829
|
function de(r) {
|
|
830
|
-
|
|
830
|
+
ra();
|
|
831
831
|
var e = (
|
|
832
832
|
/** @type {Effect} */
|
|
833
833
|
M.f
|
|
834
|
-
), t = !E && (e & Ee) !== 0 && (e &
|
|
834
|
+
), t = !E && (e & Ee) !== 0 && (e & Or) === 0;
|
|
835
835
|
if (t) {
|
|
836
836
|
var n = (
|
|
837
837
|
/** @type {ComponentContext} */
|
|
838
|
-
|
|
838
|
+
re
|
|
839
839
|
);
|
|
840
840
|
(n.e ?? (n.e = [])).push(r);
|
|
841
841
|
} else
|
|
842
|
-
return
|
|
842
|
+
return Vn(r);
|
|
843
843
|
}
|
|
844
|
-
function
|
|
845
|
-
return De(
|
|
844
|
+
function Vn(r) {
|
|
845
|
+
return De(Ar | Cn, r, !1);
|
|
846
846
|
}
|
|
847
|
-
function
|
|
848
|
-
|
|
847
|
+
function sa(r) {
|
|
848
|
+
_t.ensure();
|
|
849
849
|
const e = De(Le, r, !0);
|
|
850
850
|
return (t = {}) => new Promise((n) => {
|
|
851
|
-
t.outro ?
|
|
851
|
+
t.outro ? da(e, () => {
|
|
852
852
|
Pe(e), n(void 0);
|
|
853
853
|
}) : (Pe(e), n(void 0));
|
|
854
854
|
});
|
|
855
855
|
}
|
|
856
|
-
function
|
|
857
|
-
return De(
|
|
856
|
+
function aa(r) {
|
|
857
|
+
return De(Ar, r, !1);
|
|
858
858
|
}
|
|
859
|
-
function
|
|
860
|
-
return De(
|
|
859
|
+
function ia(r) {
|
|
860
|
+
return De(Rr | Nr, r, !0);
|
|
861
861
|
}
|
|
862
|
-
function
|
|
863
|
-
return De(
|
|
862
|
+
function Un(r, e = 0) {
|
|
863
|
+
return De(bn | e, r, !0);
|
|
864
864
|
}
|
|
865
|
-
function
|
|
866
|
-
|
|
867
|
-
De(
|
|
865
|
+
function Bn(r, e = [], t = []) {
|
|
866
|
+
Xs(e, t, (n) => {
|
|
867
|
+
De(bn, () => r(...n.map(N)), !0);
|
|
868
868
|
});
|
|
869
869
|
}
|
|
870
|
-
function
|
|
870
|
+
function oa(r, e = !0) {
|
|
871
871
|
return De(Ee, r, !0, e);
|
|
872
872
|
}
|
|
873
|
-
function
|
|
873
|
+
function $n(r) {
|
|
874
874
|
var e = r.teardown;
|
|
875
875
|
if (e !== null) {
|
|
876
876
|
const t = it, n = E;
|
|
877
|
-
|
|
877
|
+
rn(!0), xe(null);
|
|
878
878
|
try {
|
|
879
879
|
e.call(null);
|
|
880
880
|
} finally {
|
|
881
|
-
|
|
881
|
+
rn(t), xe(n);
|
|
882
882
|
}
|
|
883
883
|
}
|
|
884
884
|
}
|
|
885
|
-
function
|
|
885
|
+
function qn(r, e = !1) {
|
|
886
886
|
var s;
|
|
887
887
|
var t = r.first;
|
|
888
888
|
for (r.first = r.last = null; t !== null; ) {
|
|
889
|
-
(s = t.ac) == null || s.abort(
|
|
889
|
+
(s = t.ac) == null || s.abort(Ir);
|
|
890
890
|
var n = t.next;
|
|
891
891
|
(t.f & Le) !== 0 ? t.parent = null : Pe(t, e), t = n;
|
|
892
892
|
}
|
|
893
893
|
}
|
|
894
|
-
function
|
|
894
|
+
function la(r) {
|
|
895
895
|
for (var e = r.first; e !== null; ) {
|
|
896
896
|
var t = e.next;
|
|
897
897
|
(e.f & Ee) === 0 && Pe(e), e = t;
|
|
@@ -899,39 +899,39 @@ function ca(r) {
|
|
|
899
899
|
}
|
|
900
900
|
function Pe(r, e = !0) {
|
|
901
901
|
var t = !1;
|
|
902
|
-
(e || (r.f &
|
|
902
|
+
(e || (r.f & Os) !== 0) && r.nodes_start !== null && r.nodes_end !== null && (ua(
|
|
903
903
|
r.nodes_start,
|
|
904
904
|
/** @type {TemplateNode} */
|
|
905
905
|
r.nodes_end
|
|
906
|
-
), t = !0),
|
|
906
|
+
), t = !0), qn(r, e && !t), zt(r, 0), K(r, at);
|
|
907
907
|
var n = r.transitions;
|
|
908
908
|
if (n !== null)
|
|
909
909
|
for (const a of n)
|
|
910
910
|
a.stop();
|
|
911
|
-
|
|
911
|
+
$n(r);
|
|
912
912
|
var s = r.parent;
|
|
913
|
-
s !== null && s.first !== null &&
|
|
913
|
+
s !== null && s.first !== null && Wn(r), r.next = r.prev = r.teardown = r.ctx = r.deps = r.fn = r.nodes_start = r.nodes_end = r.ac = null;
|
|
914
914
|
}
|
|
915
|
-
function
|
|
915
|
+
function ua(r, e) {
|
|
916
916
|
for (; r !== null; ) {
|
|
917
917
|
var t = r === e ? null : (
|
|
918
918
|
/** @type {TemplateNode} */
|
|
919
|
-
/* @__PURE__ */
|
|
919
|
+
/* @__PURE__ */ zn(r)
|
|
920
920
|
);
|
|
921
921
|
r.remove(), r = t;
|
|
922
922
|
}
|
|
923
923
|
}
|
|
924
|
-
function
|
|
924
|
+
function Wn(r) {
|
|
925
925
|
var e = r.parent, t = r.prev, n = r.next;
|
|
926
926
|
t !== null && (t.next = n), n !== null && (n.prev = t), e !== null && (e.first === r && (e.first = n), e.last === r && (e.last = t));
|
|
927
927
|
}
|
|
928
|
-
function
|
|
928
|
+
function da(r, e) {
|
|
929
929
|
var t = [];
|
|
930
|
-
|
|
930
|
+
Hn(r, t, !0), ca(t, () => {
|
|
931
931
|
Pe(r), e && e();
|
|
932
932
|
});
|
|
933
933
|
}
|
|
934
|
-
function
|
|
934
|
+
function ca(r, e) {
|
|
935
935
|
var t = r.length;
|
|
936
936
|
if (t > 0) {
|
|
937
937
|
var n = () => --t || e();
|
|
@@ -940,141 +940,141 @@ function pa(r, e) {
|
|
|
940
940
|
} else
|
|
941
941
|
e();
|
|
942
942
|
}
|
|
943
|
-
function
|
|
943
|
+
function Hn(r, e, t) {
|
|
944
944
|
if ((r.f & Je) === 0) {
|
|
945
945
|
if (r.f ^= Je, r.transitions !== null)
|
|
946
946
|
for (const i of r.transitions)
|
|
947
947
|
(i.is_global || t) && e.push(i);
|
|
948
948
|
for (var n = r.first; n !== null; ) {
|
|
949
|
-
var s = n.next, a = (n.f &
|
|
950
|
-
|
|
949
|
+
var s = n.next, a = (n.f & As) !== 0 || (n.f & Ee) !== 0;
|
|
950
|
+
Hn(n, e, a ? t : !1), n = s;
|
|
951
951
|
}
|
|
952
952
|
}
|
|
953
953
|
}
|
|
954
954
|
let $e = !1;
|
|
955
|
-
function
|
|
955
|
+
function tn(r) {
|
|
956
956
|
$e = r;
|
|
957
957
|
}
|
|
958
958
|
let it = !1;
|
|
959
|
-
function
|
|
959
|
+
function rn(r) {
|
|
960
960
|
it = r;
|
|
961
961
|
}
|
|
962
|
-
let E = null,
|
|
963
|
-
function
|
|
962
|
+
let E = null, se = !1;
|
|
963
|
+
function xe(r) {
|
|
964
964
|
E = r;
|
|
965
965
|
}
|
|
966
966
|
let M = null;
|
|
967
967
|
function Qe(r) {
|
|
968
968
|
M = r;
|
|
969
969
|
}
|
|
970
|
-
let
|
|
971
|
-
function
|
|
972
|
-
E !== null && (
|
|
970
|
+
let U = null;
|
|
971
|
+
function fa(r) {
|
|
972
|
+
E !== null && (U === null ? U = [r] : U.push(r));
|
|
973
973
|
}
|
|
974
|
-
let
|
|
975
|
-
function
|
|
976
|
-
|
|
974
|
+
let z = null, H = 0, G = null;
|
|
975
|
+
function ha(r) {
|
|
976
|
+
G = r;
|
|
977
977
|
}
|
|
978
|
-
let
|
|
979
|
-
function
|
|
978
|
+
let Yn = 1, gt = 0, Re = gt;
|
|
979
|
+
function nn(r) {
|
|
980
980
|
Re = r;
|
|
981
981
|
}
|
|
982
|
-
let
|
|
983
|
-
function
|
|
984
|
-
return ++
|
|
982
|
+
let ge = !1;
|
|
983
|
+
function Xn() {
|
|
984
|
+
return ++Yn;
|
|
985
985
|
}
|
|
986
986
|
function Gt(r) {
|
|
987
|
-
var
|
|
987
|
+
var p;
|
|
988
988
|
var e = r.f;
|
|
989
|
-
if ((e &
|
|
989
|
+
if ((e & oe) !== 0)
|
|
990
990
|
return !0;
|
|
991
991
|
if ((e & Ce) !== 0) {
|
|
992
|
-
var t = r.deps, n = (e &
|
|
992
|
+
var t = r.deps, n = (e & J) !== 0;
|
|
993
993
|
if (t !== null) {
|
|
994
|
-
var s, a, i = (e & Dt) !== 0, o = n && M !== null && !
|
|
994
|
+
var s, a, i = (e & Dt) !== 0, o = n && M !== null && !ge, l = t.length;
|
|
995
995
|
if ((i || o) && (M === null || (M.f & at) === 0)) {
|
|
996
996
|
var u = (
|
|
997
997
|
/** @type {Derived} */
|
|
998
998
|
r
|
|
999
999
|
), d = u.parent;
|
|
1000
1000
|
for (s = 0; s < l; s++)
|
|
1001
|
-
a = t[s], (i || !((
|
|
1002
|
-
i && (u.f ^= Dt), o && d !== null && (d.f &
|
|
1001
|
+
a = t[s], (i || !((p = a == null ? void 0 : a.reactions) != null && p.includes(u))) && (a.reactions ?? (a.reactions = [])).push(u);
|
|
1002
|
+
i && (u.f ^= Dt), o && d !== null && (d.f & J) === 0 && (u.f ^= J);
|
|
1003
1003
|
}
|
|
1004
1004
|
for (s = 0; s < l; s++)
|
|
1005
1005
|
if (a = t[s], Gt(
|
|
1006
1006
|
/** @type {Derived} */
|
|
1007
1007
|
a
|
|
1008
|
-
) &&
|
|
1008
|
+
) && On(
|
|
1009
1009
|
/** @type {Derived} */
|
|
1010
1010
|
a
|
|
1011
1011
|
), a.wv > r.wv)
|
|
1012
1012
|
return !0;
|
|
1013
1013
|
}
|
|
1014
|
-
(!n || M !== null && !
|
|
1014
|
+
(!n || M !== null && !ge) && K(r, $);
|
|
1015
1015
|
}
|
|
1016
1016
|
return !1;
|
|
1017
1017
|
}
|
|
1018
|
-
function
|
|
1018
|
+
function Gn(r, e, t = !0) {
|
|
1019
1019
|
var n = r.reactions;
|
|
1020
|
-
if (n !== null && !(
|
|
1020
|
+
if (n !== null && !(U != null && U.includes(r)))
|
|
1021
1021
|
for (var s = 0; s < n.length; s++) {
|
|
1022
1022
|
var a = n[s];
|
|
1023
|
-
(a.f & Y) !== 0 ?
|
|
1023
|
+
(a.f & Y) !== 0 ? Gn(
|
|
1024
1024
|
/** @type {Derived} */
|
|
1025
1025
|
a,
|
|
1026
1026
|
e,
|
|
1027
1027
|
!1
|
|
1028
|
-
) : e === a && (t ?
|
|
1028
|
+
) : e === a && (t ? K(a, oe) : (a.f & $) !== 0 && K(a, Ce), Ke(
|
|
1029
1029
|
/** @type {Effect} */
|
|
1030
1030
|
a
|
|
1031
1031
|
));
|
|
1032
1032
|
}
|
|
1033
1033
|
}
|
|
1034
|
-
function
|
|
1035
|
-
var
|
|
1036
|
-
var e =
|
|
1037
|
-
|
|
1038
|
-
null, H = 0,
|
|
1034
|
+
function Jn(r) {
|
|
1035
|
+
var k;
|
|
1036
|
+
var e = z, t = H, n = G, s = E, a = ge, i = U, o = re, l = se, u = Re, d = r.f;
|
|
1037
|
+
z = /** @type {null | Value[]} */
|
|
1038
|
+
null, H = 0, G = null, ge = (d & J) !== 0 && (se || !$e || E === null), E = (d & (Ee | Le)) === 0 ? r : null, U = null, Zt(r.ctx), se = !1, Re = ++gt, r.ac !== null && (r.ac.abort(Ir), r.ac = null);
|
|
1039
1039
|
try {
|
|
1040
|
-
r.f |=
|
|
1041
|
-
var
|
|
1040
|
+
r.f |= ar;
|
|
1041
|
+
var p = (
|
|
1042
1042
|
/** @type {Function} */
|
|
1043
1043
|
(0, r.fn)()
|
|
1044
|
-
),
|
|
1045
|
-
if (
|
|
1046
|
-
var
|
|
1047
|
-
if (zt(r, H),
|
|
1048
|
-
for (
|
|
1049
|
-
|
|
1044
|
+
), v = r.deps;
|
|
1045
|
+
if (z !== null) {
|
|
1046
|
+
var m;
|
|
1047
|
+
if (zt(r, H), v !== null && H > 0)
|
|
1048
|
+
for (v.length = H + z.length, m = 0; m < z.length; m++)
|
|
1049
|
+
v[H + m] = z[m];
|
|
1050
1050
|
else
|
|
1051
|
-
r.deps =
|
|
1052
|
-
if (!
|
|
1051
|
+
r.deps = v = z;
|
|
1052
|
+
if (!ge || // Deriveds that already have reactions can cleanup, so we still add them as reactions
|
|
1053
1053
|
(d & Y) !== 0 && /** @type {import('#client').Derived} */
|
|
1054
1054
|
r.reactions !== null)
|
|
1055
|
-
for (
|
|
1056
|
-
((
|
|
1057
|
-
} else
|
|
1058
|
-
if (
|
|
1059
|
-
for (
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1055
|
+
for (m = H; m < v.length; m++)
|
|
1056
|
+
((k = v[m]).reactions ?? (k.reactions = [])).push(r);
|
|
1057
|
+
} else v !== null && H < v.length && (zt(r, H), v.length = H);
|
|
1058
|
+
if (Tn() && G !== null && !se && v !== null && (r.f & (Y | Ce | oe)) === 0)
|
|
1059
|
+
for (m = 0; m < /** @type {Source[]} */
|
|
1060
|
+
G.length; m++)
|
|
1061
|
+
Gn(
|
|
1062
|
+
G[m],
|
|
1063
1063
|
/** @type {Effect} */
|
|
1064
1064
|
r
|
|
1065
1065
|
);
|
|
1066
|
-
return s !== null && s !== r && (
|
|
1067
|
-
|
|
1068
|
-
} catch (
|
|
1069
|
-
return
|
|
1066
|
+
return s !== null && s !== r && (gt++, G !== null && (n === null ? n = G : n.push(.../** @type {Source[]} */
|
|
1067
|
+
G))), (r.f & Oe) !== 0 && (r.f ^= Oe), p;
|
|
1068
|
+
} catch (T) {
|
|
1069
|
+
return Us(T);
|
|
1070
1070
|
} finally {
|
|
1071
|
-
r.f ^=
|
|
1071
|
+
r.f ^= ar, z = e, H = t, G = n, E = s, ge = a, U = i, Zt(o), se = l, Re = u;
|
|
1072
1072
|
}
|
|
1073
1073
|
}
|
|
1074
|
-
function
|
|
1074
|
+
function pa(r, e) {
|
|
1075
1075
|
let t = e.reactions;
|
|
1076
1076
|
if (t !== null) {
|
|
1077
|
-
var n =
|
|
1077
|
+
var n = ks.call(t, r);
|
|
1078
1078
|
if (n !== -1) {
|
|
1079
1079
|
var s = t.length - 1;
|
|
1080
1080
|
s === 0 ? t = e.reactions = null : (t[n] = t[s], t.pop());
|
|
@@ -1083,7 +1083,7 @@ function ga(r, e) {
|
|
|
1083
1083
|
t === null && (e.f & Y) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
|
|
1084
1084
|
// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
|
|
1085
1085
|
// allows us to skip the expensive work of disconnecting and immediately reconnecting it
|
|
1086
|
-
(
|
|
1086
|
+
(z === null || !z.includes(e)) && (K(e, Ce), (e.f & (J | Dt)) === 0 && (e.f ^= Dt), An(
|
|
1087
1087
|
/** @type {Derived} **/
|
|
1088
1088
|
e
|
|
1089
1089
|
), zt(
|
|
@@ -1096,32 +1096,32 @@ function zt(r, e) {
|
|
|
1096
1096
|
var t = r.deps;
|
|
1097
1097
|
if (t !== null)
|
|
1098
1098
|
for (var n = e; n < t.length; n++)
|
|
1099
|
-
|
|
1099
|
+
pa(r, t[n]);
|
|
1100
1100
|
}
|
|
1101
1101
|
function ht(r) {
|
|
1102
1102
|
var e = r.f;
|
|
1103
1103
|
if ((e & at) === 0) {
|
|
1104
|
-
|
|
1104
|
+
K(r, $);
|
|
1105
1105
|
var t = M, n = $e;
|
|
1106
1106
|
M = r, $e = !0;
|
|
1107
1107
|
try {
|
|
1108
|
-
(e & Xt) !== 0 ?
|
|
1109
|
-
var s =
|
|
1110
|
-
r.teardown = typeof s == "function" ? s : null, r.wv =
|
|
1108
|
+
(e & Xt) !== 0 ? la(r) : qn(r), $n(r);
|
|
1109
|
+
var s = Jn(r);
|
|
1110
|
+
r.teardown = typeof s == "function" ? s : null, r.wv = Yn;
|
|
1111
1111
|
var a;
|
|
1112
1112
|
} finally {
|
|
1113
1113
|
$e = n, M = t;
|
|
1114
1114
|
}
|
|
1115
1115
|
}
|
|
1116
1116
|
}
|
|
1117
|
-
function
|
|
1117
|
+
function N(r) {
|
|
1118
1118
|
var e = r.f, t = (e & Y) !== 0;
|
|
1119
|
-
if (E !== null && !
|
|
1119
|
+
if (E !== null && !se) {
|
|
1120
1120
|
var n = M !== null && (M.f & at) !== 0;
|
|
1121
|
-
if (!n && !(
|
|
1121
|
+
if (!n && !(U != null && U.includes(r))) {
|
|
1122
1122
|
var s = E.deps;
|
|
1123
|
-
if ((E.f &
|
|
1124
|
-
r.rv <
|
|
1123
|
+
if ((E.f & ar) !== 0)
|
|
1124
|
+
r.rv < gt && (r.rv = gt, z === null && s !== null && s[H] === r ? H++ : z === null ? z = [r] : (!ge || !z.includes(r)) && z.push(r));
|
|
1125
1125
|
else {
|
|
1126
1126
|
(E.deps ?? (E.deps = [])).push(r);
|
|
1127
1127
|
var a = r.reactions;
|
|
@@ -1135,7 +1135,7 @@ function I(r) {
|
|
|
1135
1135
|
/** @type {Derived} */
|
|
1136
1136
|
r
|
|
1137
1137
|
), o = i.parent;
|
|
1138
|
-
o !== null && (o.f &
|
|
1138
|
+
o !== null && (o.f & J) === 0 && (i.f ^= J);
|
|
1139
1139
|
}
|
|
1140
1140
|
if (it) {
|
|
1141
1141
|
if (Ne.has(r))
|
|
@@ -1144,52 +1144,52 @@ function I(r) {
|
|
|
1144
1144
|
i = /** @type {Derived} */
|
|
1145
1145
|
r;
|
|
1146
1146
|
var l = i.v;
|
|
1147
|
-
return ((i.f &
|
|
1147
|
+
return ((i.f & $) === 0 && i.reactions !== null || Kn(i)) && (l = Zr(i)), Ne.set(i, l), l;
|
|
1148
1148
|
}
|
|
1149
1149
|
} else if (t) {
|
|
1150
1150
|
if (i = /** @type {Derived} */
|
|
1151
|
-
r,
|
|
1152
|
-
return
|
|
1153
|
-
Gt(i) &&
|
|
1151
|
+
r, _e != null && _e.has(i))
|
|
1152
|
+
return _e.get(i);
|
|
1153
|
+
Gt(i) && On(i);
|
|
1154
1154
|
}
|
|
1155
1155
|
if ((r.f & Oe) !== 0)
|
|
1156
1156
|
throw r.v;
|
|
1157
1157
|
return r.v;
|
|
1158
1158
|
}
|
|
1159
|
-
function
|
|
1159
|
+
function Kn(r) {
|
|
1160
1160
|
if (r.v === F) return !0;
|
|
1161
1161
|
if (r.deps === null) return !1;
|
|
1162
1162
|
for (const e of r.deps)
|
|
1163
|
-
if (Ne.has(e) || (e.f & Y) !== 0 &&
|
|
1163
|
+
if (Ne.has(e) || (e.f & Y) !== 0 && Kn(
|
|
1164
1164
|
/** @type {Derived} */
|
|
1165
1165
|
e
|
|
1166
1166
|
))
|
|
1167
1167
|
return !0;
|
|
1168
1168
|
return !1;
|
|
1169
1169
|
}
|
|
1170
|
-
function
|
|
1171
|
-
var e =
|
|
1170
|
+
function ma(r) {
|
|
1171
|
+
var e = se;
|
|
1172
1172
|
try {
|
|
1173
|
-
return
|
|
1173
|
+
return se = !0, r();
|
|
1174
1174
|
} finally {
|
|
1175
|
-
|
|
1175
|
+
se = e;
|
|
1176
1176
|
}
|
|
1177
1177
|
}
|
|
1178
|
-
const
|
|
1179
|
-
function
|
|
1180
|
-
r.f = r.f &
|
|
1178
|
+
const va = -7169;
|
|
1179
|
+
function K(r, e) {
|
|
1180
|
+
r.f = r.f & va | e;
|
|
1181
1181
|
}
|
|
1182
|
-
const
|
|
1183
|
-
function
|
|
1184
|
-
return
|
|
1182
|
+
const _a = ["touchstart", "touchmove"];
|
|
1183
|
+
function ga(r) {
|
|
1184
|
+
return _a.includes(r);
|
|
1185
1185
|
}
|
|
1186
|
-
const
|
|
1186
|
+
const ya = /* @__PURE__ */ new Set(), sn = /* @__PURE__ */ new Set();
|
|
1187
1187
|
function Nt(r) {
|
|
1188
|
-
var
|
|
1188
|
+
var Z;
|
|
1189
1189
|
var e = this, t = (
|
|
1190
1190
|
/** @type {Node} */
|
|
1191
1191
|
e.ownerDocument
|
|
1192
|
-
), n = r.type, s = ((
|
|
1192
|
+
), n = r.type, s = ((Z = r.composedPath) == null ? void 0 : Z.call(r)) || [], a = (
|
|
1193
1193
|
/** @type {null | Element} */
|
|
1194
1194
|
s[0] || r.target
|
|
1195
1195
|
), i = 0, o = r.__root;
|
|
@@ -1207,53 +1207,53 @@ function Nt(r) {
|
|
|
1207
1207
|
}
|
|
1208
1208
|
if (a = /** @type {Element} */
|
|
1209
1209
|
s[i] || r.target, a !== e) {
|
|
1210
|
-
|
|
1210
|
+
sr(r, "currentTarget", {
|
|
1211
1211
|
configurable: !0,
|
|
1212
1212
|
get() {
|
|
1213
1213
|
return a || t;
|
|
1214
1214
|
}
|
|
1215
1215
|
});
|
|
1216
|
-
var d = E,
|
|
1217
|
-
|
|
1216
|
+
var d = E, p = M;
|
|
1217
|
+
xe(null), Qe(null);
|
|
1218
1218
|
try {
|
|
1219
|
-
for (var
|
|
1220
|
-
var
|
|
1219
|
+
for (var v, m = []; a !== null; ) {
|
|
1220
|
+
var k = a.assignedSlot || a.parentNode || /** @type {any} */
|
|
1221
1221
|
a.host || null;
|
|
1222
1222
|
try {
|
|
1223
|
-
var
|
|
1224
|
-
if (
|
|
1223
|
+
var T = a["__" + n];
|
|
1224
|
+
if (T != null && (!/** @type {any} */
|
|
1225
1225
|
a.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
|
|
1226
1226
|
// -> the target could not have been disabled because it emits the event in the first place
|
|
1227
1227
|
r.target === a))
|
|
1228
|
-
if (
|
|
1229
|
-
var [
|
|
1230
|
-
|
|
1228
|
+
if (kn(T)) {
|
|
1229
|
+
var [I, ...le] = T;
|
|
1230
|
+
I.apply(a, [r, ...le]);
|
|
1231
1231
|
} else
|
|
1232
|
-
|
|
1233
|
-
} catch (
|
|
1234
|
-
|
|
1232
|
+
T.call(a, r);
|
|
1233
|
+
} catch (W) {
|
|
1234
|
+
v ? m.push(W) : v = W;
|
|
1235
1235
|
}
|
|
1236
|
-
if (r.cancelBubble ||
|
|
1236
|
+
if (r.cancelBubble || k === e || k === null)
|
|
1237
1237
|
break;
|
|
1238
|
-
a =
|
|
1238
|
+
a = k;
|
|
1239
1239
|
}
|
|
1240
|
-
if (
|
|
1241
|
-
for (let
|
|
1240
|
+
if (v) {
|
|
1241
|
+
for (let W of m)
|
|
1242
1242
|
queueMicrotask(() => {
|
|
1243
|
-
throw
|
|
1243
|
+
throw W;
|
|
1244
1244
|
});
|
|
1245
|
-
throw
|
|
1245
|
+
throw v;
|
|
1246
1246
|
}
|
|
1247
1247
|
} finally {
|
|
1248
|
-
r.__root = e, delete r.currentTarget,
|
|
1248
|
+
r.__root = e, delete r.currentTarget, xe(d), Qe(p);
|
|
1249
1249
|
}
|
|
1250
1250
|
}
|
|
1251
1251
|
}
|
|
1252
|
-
function
|
|
1252
|
+
function wa(r) {
|
|
1253
1253
|
var e = document.createElement("template");
|
|
1254
1254
|
return e.innerHTML = r.replaceAll("<!>", "<!---->"), e.content;
|
|
1255
1255
|
}
|
|
1256
|
-
function
|
|
1256
|
+
function xa(r, e) {
|
|
1257
1257
|
var t = (
|
|
1258
1258
|
/** @type {Effect} */
|
|
1259
1259
|
M
|
|
@@ -1261,157 +1261,111 @@ function Ea(r, e) {
|
|
|
1261
1261
|
t.nodes_start === null && (t.nodes_start = r, t.nodes_end = e);
|
|
1262
1262
|
}
|
|
1263
1263
|
// @__NO_SIDE_EFFECTS__
|
|
1264
|
-
function
|
|
1265
|
-
var t = (e &
|
|
1264
|
+
function Qn(r, e) {
|
|
1265
|
+
var t = (e & zs) !== 0, n, s = !r.startsWith("<!>");
|
|
1266
1266
|
return () => {
|
|
1267
|
-
n === void 0 && (n =
|
|
1268
|
-
/* @__PURE__ */
|
|
1267
|
+
n === void 0 && (n = wa(s ? r : "<!>" + r), n = /** @type {Node} */
|
|
1268
|
+
/* @__PURE__ */ Fn(n));
|
|
1269
1269
|
var a = (
|
|
1270
1270
|
/** @type {TemplateNode} */
|
|
1271
|
-
t ||
|
|
1271
|
+
t || Dn ? document.importNode(n, !0) : n.cloneNode(!0)
|
|
1272
1272
|
);
|
|
1273
|
-
return
|
|
1273
|
+
return xa(a, a), a;
|
|
1274
1274
|
};
|
|
1275
1275
|
}
|
|
1276
|
-
function
|
|
1276
|
+
function es(r, e) {
|
|
1277
1277
|
r !== null && r.before(
|
|
1278
1278
|
/** @type {Node} */
|
|
1279
1279
|
e
|
|
1280
1280
|
);
|
|
1281
1281
|
}
|
|
1282
|
-
function
|
|
1283
|
-
return
|
|
1282
|
+
function Fr(r, e) {
|
|
1283
|
+
return ka(r, e);
|
|
1284
1284
|
}
|
|
1285
1285
|
const je = /* @__PURE__ */ new Map();
|
|
1286
|
-
function
|
|
1287
|
-
|
|
1288
|
-
var o = /* @__PURE__ */ new Set(), l = (
|
|
1289
|
-
for (var
|
|
1290
|
-
var
|
|
1291
|
-
if (!o.has(
|
|
1292
|
-
o.add(
|
|
1293
|
-
var
|
|
1294
|
-
e.addEventListener(
|
|
1295
|
-
var
|
|
1296
|
-
|
|
1286
|
+
function ka(r, { target: e, anchor: t, props: n = {}, events: s, context: a, intro: i = !0 }) {
|
|
1287
|
+
Qs();
|
|
1288
|
+
var o = /* @__PURE__ */ new Set(), l = (p) => {
|
|
1289
|
+
for (var v = 0; v < p.length; v++) {
|
|
1290
|
+
var m = p[v];
|
|
1291
|
+
if (!o.has(m)) {
|
|
1292
|
+
o.add(m);
|
|
1293
|
+
var k = ga(m);
|
|
1294
|
+
e.addEventListener(m, Nt, { passive: k });
|
|
1295
|
+
var T = je.get(m);
|
|
1296
|
+
T === void 0 ? (document.addEventListener(m, Nt, { passive: k }), je.set(m, 1)) : je.set(m, T + 1);
|
|
1297
1297
|
}
|
|
1298
1298
|
}
|
|
1299
1299
|
};
|
|
1300
|
-
l(
|
|
1301
|
-
var u = void 0, d =
|
|
1302
|
-
var
|
|
1303
|
-
return
|
|
1300
|
+
l(bs(ya)), sn.add(l);
|
|
1301
|
+
var u = void 0, d = sa(() => {
|
|
1302
|
+
var p = t ?? e.appendChild(ea());
|
|
1303
|
+
return oa(() => {
|
|
1304
1304
|
if (a) {
|
|
1305
|
-
|
|
1306
|
-
var
|
|
1305
|
+
Pr({});
|
|
1306
|
+
var v = (
|
|
1307
1307
|
/** @type {ComponentContext} */
|
|
1308
|
-
|
|
1308
|
+
re
|
|
1309
1309
|
);
|
|
1310
|
-
|
|
1310
|
+
v.c = a;
|
|
1311
1311
|
}
|
|
1312
|
-
s && (n.$$events = s), u = r(
|
|
1312
|
+
s && (n.$$events = s), u = r(p, n) || {}, a && Lr();
|
|
1313
1313
|
}), () => {
|
|
1314
|
-
var
|
|
1315
|
-
for (var
|
|
1316
|
-
e.removeEventListener(
|
|
1317
|
-
var
|
|
1314
|
+
var k;
|
|
1315
|
+
for (var v of o) {
|
|
1316
|
+
e.removeEventListener(v, Nt);
|
|
1317
|
+
var m = (
|
|
1318
1318
|
/** @type {number} */
|
|
1319
|
-
je.get(
|
|
1319
|
+
je.get(v)
|
|
1320
1320
|
);
|
|
1321
|
-
--
|
|
1321
|
+
--m === 0 ? (document.removeEventListener(v, Nt), je.delete(v)) : je.set(v, m);
|
|
1322
1322
|
}
|
|
1323
|
-
|
|
1323
|
+
sn.delete(l), p !== t && ((k = p.parentNode) == null || k.removeChild(p));
|
|
1324
1324
|
};
|
|
1325
1325
|
});
|
|
1326
|
-
return
|
|
1327
|
-
}
|
|
1328
|
-
let
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
for (
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
else if (n.length)
|
|
1338
|
-
for (var a = s.length, i = 0; (i = n.indexOf(s, i)) >= 0; ) {
|
|
1339
|
-
var o = i + a;
|
|
1340
|
-
(i === 0 || un.includes(n[i - 1])) && (o === n.length || un.includes(n[o])) ? n = (i === 0 ? "" : n.substring(0, i)) + n.substring(o + 1) : i = o;
|
|
1341
|
-
}
|
|
1342
|
-
}
|
|
1343
|
-
return n === "" ? null : n;
|
|
1326
|
+
return ba.set(u, d), u;
|
|
1327
|
+
}
|
|
1328
|
+
let ba = /* @__PURE__ */ new WeakMap();
|
|
1329
|
+
function ts(r) {
|
|
1330
|
+
var e, t, n = "";
|
|
1331
|
+
if (typeof r == "string" || typeof r == "number") n += r;
|
|
1332
|
+
else if (typeof r == "object") if (Array.isArray(r)) {
|
|
1333
|
+
var s = r.length;
|
|
1334
|
+
for (e = 0; e < s; e++) r[e] && (t = ts(r[e])) && (n && (n += " "), n += t);
|
|
1335
|
+
} else for (t in r) r[t] && (n && (n += " "), n += t);
|
|
1336
|
+
return n;
|
|
1344
1337
|
}
|
|
1345
|
-
function
|
|
1346
|
-
var t =
|
|
1347
|
-
for (var s in r) {
|
|
1348
|
-
var a = r[s];
|
|
1349
|
-
a != null && a !== "" && (n += " " + s + ": " + a + t);
|
|
1350
|
-
}
|
|
1338
|
+
function Ea() {
|
|
1339
|
+
for (var r, e, t = 0, n = "", s = arguments.length; t < s; t++) (r = arguments[t]) && (e = ts(r)) && (n && (n += " "), n += e);
|
|
1351
1340
|
return n;
|
|
1352
1341
|
}
|
|
1353
|
-
function
|
|
1354
|
-
return
|
|
1355
|
-
}
|
|
1356
|
-
function
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
var a = !1, i = 0, o = !1, l = [];
|
|
1362
|
-
n && l.push(...Object.keys(n).map(rr)), s && l.push(...Object.keys(s).map(rr));
|
|
1363
|
-
var u = 0, d = -1;
|
|
1364
|
-
const N = r.length;
|
|
1365
|
-
for (var f = 0; f < N; f++) {
|
|
1366
|
-
var p = r[f];
|
|
1367
|
-
if (o ? p === "/" && r[f - 1] === "*" && (o = !1) : a ? a === p && (a = !1) : p === "/" && r[f + 1] === "*" ? o = !0 : p === '"' || p === "'" ? a = p : p === "(" ? i++ : p === ")" && i--, !o && a === !1 && i === 0) {
|
|
1368
|
-
if (p === ":" && d === -1)
|
|
1369
|
-
d = f;
|
|
1370
|
-
else if (p === ";" || f === N - 1) {
|
|
1371
|
-
if (d !== -1) {
|
|
1372
|
-
var v = rr(r.substring(u, d).trim());
|
|
1373
|
-
if (!l.includes(v)) {
|
|
1374
|
-
p !== ";" && f++;
|
|
1375
|
-
var x = r.substring(u, f).trim();
|
|
1376
|
-
t += " " + x + ";";
|
|
1377
|
-
}
|
|
1378
|
-
}
|
|
1379
|
-
u = f + 1, d = -1;
|
|
1380
|
-
}
|
|
1381
|
-
}
|
|
1382
|
-
}
|
|
1383
|
-
}
|
|
1384
|
-
return n && (t += dn(n)), s && (t += dn(s, !0)), t = t.trim(), t === "" ? null : t;
|
|
1385
|
-
}
|
|
1342
|
+
function rs(r) {
|
|
1343
|
+
return typeof r == "object" ? Ea(r) : r ?? "";
|
|
1344
|
+
}
|
|
1345
|
+
function Ca(r, e, t) {
|
|
1346
|
+
var n = r == null ? "" : "" + r;
|
|
1347
|
+
return e && (n = n ? n + " " + e : e), n === "" ? null : n;
|
|
1348
|
+
}
|
|
1349
|
+
function Sa(r, e) {
|
|
1386
1350
|
return r == null ? null : String(r);
|
|
1387
1351
|
}
|
|
1388
|
-
function
|
|
1352
|
+
function ns(r, e, t, n, s, a) {
|
|
1389
1353
|
var i = r.__className;
|
|
1390
1354
|
if (i !== t || i === void 0) {
|
|
1391
|
-
var o =
|
|
1355
|
+
var o = Ca(t, n);
|
|
1392
1356
|
o == null ? r.removeAttribute("class") : r.className = o, r.__className = t;
|
|
1393
|
-
} else if (a && s !== a)
|
|
1394
|
-
for (var l in a) {
|
|
1395
|
-
var u = !!a[l];
|
|
1396
|
-
(s == null || u !== !!s[l]) && r.classList.toggle(l, u);
|
|
1397
|
-
}
|
|
1398
|
-
return a;
|
|
1399
|
-
}
|
|
1400
|
-
function nr(r, e = {}, t, n) {
|
|
1401
|
-
for (var s in t) {
|
|
1402
|
-
var a = t[s];
|
|
1403
|
-
e[s] !== a && (t[s] == null ? r.style.removeProperty(s) : r.style.setProperty(s, a, n));
|
|
1404
1357
|
}
|
|
1358
|
+
return a;
|
|
1405
1359
|
}
|
|
1406
1360
|
function Vt(r, e, t, n) {
|
|
1407
1361
|
var s = r.__style;
|
|
1408
1362
|
if (s !== e) {
|
|
1409
|
-
var a =
|
|
1363
|
+
var a = Sa(e);
|
|
1410
1364
|
a == null ? r.removeAttribute("style") : r.style.cssText = a, r.__style = e;
|
|
1411
|
-
}
|
|
1365
|
+
}
|
|
1412
1366
|
return n;
|
|
1413
1367
|
}
|
|
1414
|
-
const
|
|
1368
|
+
const Ta = () => performance.now(), ae = {
|
|
1415
1369
|
// don't access requestAnimationFrame eagerly outside method
|
|
1416
1370
|
// this allows basic testing of user code without JSDOM
|
|
1417
1371
|
// bunder will eval and remove ternary when the user's app is built
|
|
@@ -1419,66 +1373,66 @@ const Aa = () => performance.now(), ie = {
|
|
|
1419
1373
|
/** @param {any} _ */
|
|
1420
1374
|
(r) => requestAnimationFrame(r)
|
|
1421
1375
|
),
|
|
1422
|
-
now: () =>
|
|
1376
|
+
now: () => Ta(),
|
|
1423
1377
|
tasks: /* @__PURE__ */ new Set()
|
|
1424
1378
|
};
|
|
1425
|
-
function
|
|
1426
|
-
const r =
|
|
1427
|
-
|
|
1428
|
-
e.c(r) || (
|
|
1429
|
-
}),
|
|
1379
|
+
function ss() {
|
|
1380
|
+
const r = ae.now();
|
|
1381
|
+
ae.tasks.forEach((e) => {
|
|
1382
|
+
e.c(r) || (ae.tasks.delete(e), e.f());
|
|
1383
|
+
}), ae.tasks.size !== 0 && ae.tick(ss);
|
|
1430
1384
|
}
|
|
1431
|
-
function
|
|
1385
|
+
function Ma(r) {
|
|
1432
1386
|
let e;
|
|
1433
|
-
return
|
|
1387
|
+
return ae.tasks.size === 0 && ae.tick(ss), {
|
|
1434
1388
|
promise: new Promise((t) => {
|
|
1435
|
-
|
|
1389
|
+
ae.tasks.add(e = { c: r, f: t });
|
|
1436
1390
|
}),
|
|
1437
1391
|
abort() {
|
|
1438
|
-
|
|
1392
|
+
ae.tasks.delete(e);
|
|
1439
1393
|
}
|
|
1440
1394
|
};
|
|
1441
1395
|
}
|
|
1442
|
-
function
|
|
1396
|
+
function an(r, e) {
|
|
1443
1397
|
return r === e || (r == null ? void 0 : r[Rt]) === e;
|
|
1444
1398
|
}
|
|
1445
1399
|
function ze(r = {}, e, t, n) {
|
|
1446
|
-
return
|
|
1400
|
+
return aa(() => {
|
|
1447
1401
|
var s, a;
|
|
1448
|
-
return
|
|
1449
|
-
s = a, a = [],
|
|
1450
|
-
r !== t(...a) && (e(r, ...a), s &&
|
|
1402
|
+
return Un(() => {
|
|
1403
|
+
s = a, a = [], ma(() => {
|
|
1404
|
+
r !== t(...a) && (e(r, ...a), s && an(t(...s), r) && e(null, ...s));
|
|
1451
1405
|
});
|
|
1452
1406
|
}), () => {
|
|
1453
|
-
|
|
1454
|
-
a &&
|
|
1407
|
+
$s(() => {
|
|
1408
|
+
a && an(t(...a), r) && e(null, ...a);
|
|
1455
1409
|
});
|
|
1456
1410
|
};
|
|
1457
1411
|
}), r;
|
|
1458
1412
|
}
|
|
1459
|
-
const
|
|
1460
|
-
var
|
|
1461
|
-
typeof window < "u" && ((
|
|
1462
|
-
function
|
|
1413
|
+
const Aa = "5";
|
|
1414
|
+
var xn;
|
|
1415
|
+
typeof window < "u" && ((xn = window.__svelte ?? (window.__svelte = {})).v ?? (xn.v = /* @__PURE__ */ new Set())).add(Aa);
|
|
1416
|
+
function Oa(r) {
|
|
1463
1417
|
return r;
|
|
1464
1418
|
}
|
|
1465
|
-
function
|
|
1419
|
+
function dr(r) {
|
|
1466
1420
|
return -0.5 * (Math.cos(Math.PI * r) - 1);
|
|
1467
1421
|
}
|
|
1468
|
-
function
|
|
1422
|
+
function Na(r) {
|
|
1469
1423
|
const e = Math.cos(r * Math.PI * 0.5);
|
|
1470
1424
|
return Math.abs(e) < 1e-14 ? 1 : 1 - e;
|
|
1471
1425
|
}
|
|
1472
|
-
function
|
|
1426
|
+
function Ra(r) {
|
|
1473
1427
|
return Math.sin(r * Math.PI / 2);
|
|
1474
1428
|
}
|
|
1475
|
-
const
|
|
1476
|
-
class
|
|
1429
|
+
const Ia = 128, Pa = 0, La = 1, Da = 2;
|
|
1430
|
+
class Za {
|
|
1477
1431
|
constructor() {
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1432
|
+
f(this, "animationsStarted", !1);
|
|
1433
|
+
f(this, "animationsCount", 0);
|
|
1434
|
+
f(this, "animationsLimit", Ia);
|
|
1435
|
+
f(this, "layers", new Array());
|
|
1482
1436
|
}
|
|
1483
1437
|
start() {
|
|
1484
1438
|
window.requestAnimationFrame(this.tick.bind(this));
|
|
@@ -1534,11 +1488,11 @@ class Fa {
|
|
|
1534
1488
|
this.animationsLimit = e;
|
|
1535
1489
|
}
|
|
1536
1490
|
}
|
|
1537
|
-
const pe = new
|
|
1538
|
-
function
|
|
1491
|
+
const pe = new Za();
|
|
1492
|
+
function on(r) {
|
|
1539
1493
|
return Object.prototype.toString.call(r) === "[object Date]";
|
|
1540
1494
|
}
|
|
1541
|
-
function
|
|
1495
|
+
function cr(r, e) {
|
|
1542
1496
|
if (r === e || r !== r) return () => r;
|
|
1543
1497
|
const t = typeof r;
|
|
1544
1498
|
if (t !== typeof e || Array.isArray(r) !== Array.isArray(e))
|
|
@@ -1546,7 +1500,7 @@ function hr(r, e) {
|
|
|
1546
1500
|
if (Array.isArray(r)) {
|
|
1547
1501
|
const n = (
|
|
1548
1502
|
/** @type {Array<any>} */
|
|
1549
|
-
e.map((s, a) =>
|
|
1503
|
+
e.map((s, a) => cr(
|
|
1550
1504
|
/** @type {Array<any>} */
|
|
1551
1505
|
r[a],
|
|
1552
1506
|
s
|
|
@@ -1557,13 +1511,13 @@ function hr(r, e) {
|
|
|
1557
1511
|
if (t === "object") {
|
|
1558
1512
|
if (!r || !e)
|
|
1559
1513
|
throw new Error("Object cannot be null");
|
|
1560
|
-
if (
|
|
1514
|
+
if (on(r) && on(e)) {
|
|
1561
1515
|
const a = r.getTime(), o = e.getTime() - a;
|
|
1562
1516
|
return (l) => new Date(a + l * o);
|
|
1563
1517
|
}
|
|
1564
1518
|
const n = Object.keys(e), s = {};
|
|
1565
1519
|
return n.forEach((a) => {
|
|
1566
|
-
s[a] =
|
|
1520
|
+
s[a] = cr(r[a], e[a]);
|
|
1567
1521
|
}), (a) => {
|
|
1568
1522
|
const i = {};
|
|
1569
1523
|
return n.forEach((o) => {
|
|
@@ -1582,19 +1536,19 @@ function hr(r, e) {
|
|
|
1582
1536
|
return () => e;
|
|
1583
1537
|
}
|
|
1584
1538
|
var ce, Ge, Tt, Ae;
|
|
1585
|
-
const
|
|
1539
|
+
const Br = class Br {
|
|
1586
1540
|
/**
|
|
1587
1541
|
* @param {T} value
|
|
1588
1542
|
* @param {TweenedOptions<T>} options
|
|
1589
1543
|
*/
|
|
1590
1544
|
constructor(e, t = {}) {
|
|
1591
|
-
|
|
1592
|
-
|
|
1545
|
+
L(this, ce);
|
|
1546
|
+
L(this, Ge);
|
|
1593
1547
|
/** @type {TweenedOptions<T>} */
|
|
1594
|
-
|
|
1548
|
+
L(this, Tt);
|
|
1595
1549
|
/** @type {import('../internal/client/types').Task | null} */
|
|
1596
|
-
|
|
1597
|
-
j(this, ce, /* @__PURE__ */
|
|
1550
|
+
L(this, Ae, null);
|
|
1551
|
+
j(this, ce, /* @__PURE__ */ B(e)), j(this, Ge, /* @__PURE__ */ B(e)), j(this, Tt, t);
|
|
1598
1552
|
}
|
|
1599
1553
|
/**
|
|
1600
1554
|
* Create a tween whose value is bound to the return value of `fn`. This must be called
|
|
@@ -1614,8 +1568,8 @@ const qr = class qr {
|
|
|
1614
1568
|
* @param {TweenedOptions<U>} [options]
|
|
1615
1569
|
*/
|
|
1616
1570
|
static of(e, t) {
|
|
1617
|
-
const n = new
|
|
1618
|
-
return
|
|
1571
|
+
const n = new Br(e(), t);
|
|
1572
|
+
return Un(() => {
|
|
1619
1573
|
n.set(e());
|
|
1620
1574
|
}), n;
|
|
1621
1575
|
}
|
|
@@ -1628,49 +1582,49 @@ const qr = class qr {
|
|
|
1628
1582
|
* @returns
|
|
1629
1583
|
*/
|
|
1630
1584
|
set(e, t) {
|
|
1631
|
-
var
|
|
1632
|
-
|
|
1585
|
+
var p;
|
|
1586
|
+
V(x(this, Ge), e);
|
|
1633
1587
|
let {
|
|
1634
1588
|
delay: n = 0,
|
|
1635
1589
|
duration: s = 400,
|
|
1636
|
-
easing: a =
|
|
1637
|
-
interpolate: i =
|
|
1638
|
-
} = { ...
|
|
1590
|
+
easing: a = Oa,
|
|
1591
|
+
interpolate: i = cr
|
|
1592
|
+
} = { ...x(this, Tt), ...t };
|
|
1639
1593
|
if (s === 0)
|
|
1640
|
-
return (
|
|
1641
|
-
const o =
|
|
1642
|
-
let l, u = !1, d =
|
|
1643
|
-
return j(this, Ae,
|
|
1644
|
-
if (
|
|
1594
|
+
return (p = x(this, Ae)) == null || p.abort(), V(x(this, ce), e), Promise.resolve();
|
|
1595
|
+
const o = ae.now() + n;
|
|
1596
|
+
let l, u = !1, d = x(this, Ae);
|
|
1597
|
+
return j(this, Ae, Ma((v) => {
|
|
1598
|
+
if (v < o)
|
|
1645
1599
|
return !0;
|
|
1646
1600
|
if (!u) {
|
|
1647
1601
|
u = !0;
|
|
1648
|
-
const
|
|
1649
|
-
l = i(
|
|
1602
|
+
const k = x(this, ce).v;
|
|
1603
|
+
l = i(k, e), typeof s == "function" && (s = s(k, e)), d == null || d.abort();
|
|
1650
1604
|
}
|
|
1651
|
-
const
|
|
1652
|
-
return
|
|
1653
|
-
s ? (
|
|
1605
|
+
const m = v - o;
|
|
1606
|
+
return m > /** @type {number} */
|
|
1607
|
+
s ? (V(x(this, ce), e), !1) : (V(x(this, ce), l(a(m / /** @type {number} */
|
|
1654
1608
|
s))), !0);
|
|
1655
|
-
})),
|
|
1609
|
+
})), x(this, Ae).promise;
|
|
1656
1610
|
}
|
|
1657
1611
|
get current() {
|
|
1658
|
-
return
|
|
1612
|
+
return N(x(this, ce));
|
|
1659
1613
|
}
|
|
1660
1614
|
get target() {
|
|
1661
|
-
return
|
|
1615
|
+
return N(x(this, Ge));
|
|
1662
1616
|
}
|
|
1663
1617
|
set target(e) {
|
|
1664
1618
|
this.set(e);
|
|
1665
1619
|
}
|
|
1666
1620
|
};
|
|
1667
1621
|
ce = new WeakMap(), Ge = new WeakMap(), Tt = new WeakMap(), Ae = new WeakMap();
|
|
1668
|
-
let
|
|
1622
|
+
let fr = Br;
|
|
1669
1623
|
class Pt {
|
|
1670
1624
|
constructor(e, t) {
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
this.value = e, this.motion = new
|
|
1625
|
+
f(this, "value");
|
|
1626
|
+
f(this, "motion");
|
|
1627
|
+
this.value = e, this.motion = new fr(e, t);
|
|
1674
1628
|
}
|
|
1675
1629
|
set(e, t) {
|
|
1676
1630
|
this.value = e, this.motion.set(e, t);
|
|
@@ -1682,75 +1636,57 @@ class Pt {
|
|
|
1682
1636
|
this.motion.set(this.value, { duration: 0 });
|
|
1683
1637
|
}
|
|
1684
1638
|
}
|
|
1685
|
-
var
|
|
1686
|
-
function
|
|
1687
|
-
|
|
1639
|
+
var ja = /* @__PURE__ */ Qn('<div><div class="body svelte-1nfn9j8"></div></div>');
|
|
1640
|
+
function Fa(r, e) {
|
|
1641
|
+
Pr(e, !0);
|
|
1688
1642
|
let t, n;
|
|
1689
1643
|
function s() {
|
|
1690
1644
|
return n;
|
|
1691
1645
|
}
|
|
1692
|
-
let a = /* @__PURE__ */
|
|
1693
|
-
function i(
|
|
1694
|
-
|
|
1646
|
+
let a = /* @__PURE__ */ B(!1);
|
|
1647
|
+
function i(T) {
|
|
1648
|
+
V(a, T, !0);
|
|
1695
1649
|
}
|
|
1696
1650
|
function o() {
|
|
1697
|
-
return
|
|
1651
|
+
return N(a);
|
|
1698
1652
|
}
|
|
1699
|
-
let l = new Pt(0, { easing:
|
|
1653
|
+
let l = new Pt(0, { easing: dr });
|
|
1700
1654
|
de(() => {
|
|
1701
1655
|
u(l.motion.current);
|
|
1702
1656
|
}), de(() => {
|
|
1703
|
-
|
|
1657
|
+
N(a) == !1 && (l.snap(), pe.clear(e.priority, e.id));
|
|
1704
1658
|
});
|
|
1705
|
-
function u(
|
|
1659
|
+
function u(T) {
|
|
1706
1660
|
t && pe.equeue(e.layer, e.priority, e.id, () => {
|
|
1707
|
-
t.style.scale =
|
|
1661
|
+
t.style.scale = T.toString(), t.style.filter = `brightness(${0.25 + 0.75 * T})`, n.style.opacity = T.toString();
|
|
1708
1662
|
});
|
|
1709
1663
|
}
|
|
1710
|
-
function d(
|
|
1711
|
-
|
|
1664
|
+
function d(T) {
|
|
1665
|
+
T != l.value && l.set(T, { duration: 75 });
|
|
1712
1666
|
}
|
|
1713
|
-
function
|
|
1667
|
+
function p() {
|
|
1714
1668
|
return l.motion.current == 0;
|
|
1715
1669
|
}
|
|
1716
|
-
function
|
|
1670
|
+
function v() {
|
|
1717
1671
|
return l.value;
|
|
1718
1672
|
}
|
|
1719
|
-
var
|
|
1720
|
-
let x, N;
|
|
1721
|
-
var R = cr(v);
|
|
1722
|
-
let G;
|
|
1673
|
+
var m = ja(), k = ur(m);
|
|
1723
1674
|
return ze(
|
|
1724
|
-
|
|
1725
|
-
(
|
|
1675
|
+
k,
|
|
1676
|
+
(T) => (
|
|
1726
1677
|
//#endregion
|
|
1727
|
-
n =
|
|
1678
|
+
n = T
|
|
1728
1679
|
),
|
|
1729
1680
|
() => n
|
|
1730
|
-
), ze(
|
|
1731
|
-
(
|
|
1732
|
-
|
|
1733
|
-
},
|
|
1734
|
-
[
|
|
1735
|
-
() => ({ displayed: I(a) }),
|
|
1736
|
-
() => ({
|
|
1737
|
-
width: `${e.width}px`,
|
|
1738
|
-
height: `${e.height}px`,
|
|
1739
|
-
"border-radius": `${e.radius}px`
|
|
1740
|
-
}),
|
|
1741
|
-
() => ({
|
|
1742
|
-
width: `${e.width - 4}px`,
|
|
1743
|
-
height: `${e.height - 4}px`,
|
|
1744
|
-
"border-radius": `${e.radius - 2}px`
|
|
1745
|
-
})
|
|
1746
|
-
]
|
|
1747
|
-
), as(r, v), Zr({
|
|
1681
|
+
), ze(m, (T) => t = T, () => t), Bn(() => {
|
|
1682
|
+
ns(m, 1, rs(["pin", N(a) && "displayed"]), "svelte-1nfn9j8"), Vt(m, `width: ${e.width}px; height: ${e.height}px; border-radius: ${e.radius}px`), Vt(k, `width: ${e.width - 4}px; height: ${e.height - 4}px; border-radius: ${e.radius - 2}px`);
|
|
1683
|
+
}), es(r, m), Lr({
|
|
1748
1684
|
getBody: s,
|
|
1749
1685
|
setDisplayed: i,
|
|
1750
1686
|
getDisplayed: o,
|
|
1751
1687
|
setScale: d,
|
|
1752
|
-
getCollapsed:
|
|
1753
|
-
getScale:
|
|
1688
|
+
getCollapsed: p,
|
|
1689
|
+
getScale: v
|
|
1754
1690
|
});
|
|
1755
1691
|
}
|
|
1756
1692
|
var pt;
|
|
@@ -1785,97 +1721,92 @@ var pt;
|
|
|
1785
1721
|
}
|
|
1786
1722
|
r.getOffsets = e;
|
|
1787
1723
|
})(pt || (pt = {}));
|
|
1788
|
-
var
|
|
1789
|
-
function
|
|
1790
|
-
|
|
1724
|
+
var za = /* @__PURE__ */ Qn('<div><div class="pointer svelte-j5igi2"></div> <div class="bubble svelte-j5igi2"><div class="body svelte-j5igi2"></div></div></div>');
|
|
1725
|
+
function as(r, e) {
|
|
1726
|
+
Pr(e, !0);
|
|
1791
1727
|
let t, n, s, a;
|
|
1792
1728
|
const i = e.width + 2 * e.margin, o = e.height + 2 * e.margin, l = () => a;
|
|
1793
1729
|
de(() => {
|
|
1794
1730
|
s.style.width = `${e.margin * 4}px`, s.style.height = `${e.margin * 4}px`;
|
|
1795
1731
|
});
|
|
1796
|
-
let u = /* @__PURE__ */
|
|
1732
|
+
let u = /* @__PURE__ */ B(!0);
|
|
1797
1733
|
function d(O) {
|
|
1798
|
-
|
|
1734
|
+
V(u, O, !0);
|
|
1799
1735
|
}
|
|
1800
|
-
function
|
|
1801
|
-
return
|
|
1736
|
+
function p() {
|
|
1737
|
+
return N(u);
|
|
1802
1738
|
}
|
|
1803
|
-
let
|
|
1804
|
-
function
|
|
1805
|
-
|
|
1739
|
+
let v = /* @__PURE__ */ B(!0);
|
|
1740
|
+
function m(O) {
|
|
1741
|
+
V(v, O, !0);
|
|
1806
1742
|
}
|
|
1807
|
-
function
|
|
1808
|
-
return
|
|
1743
|
+
function k() {
|
|
1744
|
+
return I.motion.current == 0;
|
|
1809
1745
|
}
|
|
1810
|
-
function
|
|
1811
|
-
return
|
|
1746
|
+
function T() {
|
|
1747
|
+
return I.motion.current == 1;
|
|
1812
1748
|
}
|
|
1813
|
-
let
|
|
1749
|
+
let I = new Pt(0);
|
|
1814
1750
|
de(() => {
|
|
1815
|
-
|
|
1751
|
+
le(I.motion.current);
|
|
1816
1752
|
}), de(() => {
|
|
1817
|
-
|
|
1753
|
+
N(u) == !1 && (I.snap(), pe.clear(e.priority, e.id + "_scale"));
|
|
1818
1754
|
}), de(() => {
|
|
1819
|
-
|
|
1755
|
+
N(v) == !0 && I.value != 0 && (pe.stacked() ? I.set(0, { duration: 0 }) : I.set(0, { duration: 150, easing: Na })), N(v) == !1 && I.value != 1 && I.set(1, { duration: 150, easing: Ra });
|
|
1820
1756
|
});
|
|
1821
|
-
function
|
|
1822
|
-
!t || !n || !s || pe.equeue(
|
|
1757
|
+
function le(O) {
|
|
1758
|
+
!t || !n || !s || pe.equeue(N(v) ? 0 : e.layer, e.priority, e.id + "_scale", () => {
|
|
1823
1759
|
t.style.opacity = `${O}`, n.style.scale = `${O}`, s.style.scale = `${O}`;
|
|
1824
1760
|
});
|
|
1825
1761
|
}
|
|
1826
|
-
let
|
|
1762
|
+
let Z = NaN, W = /* @__PURE__ */ B(!1), ne = new Pt(-i / 2, { easing: dr }), Mt = new Pt(-o / 2, { easing: dr });
|
|
1827
1763
|
de(() => {
|
|
1828
|
-
|
|
1764
|
+
$r(ne.motion.current, Mt.motion.current);
|
|
1829
1765
|
}), de(() => {
|
|
1830
|
-
|
|
1766
|
+
N(u) == !1 && (ne.snap(), ne.snap(), pe.clear(e.priority, e.id + "_angle"));
|
|
1831
1767
|
}), de(() => {
|
|
1832
|
-
|
|
1768
|
+
N(v) == !0 && N(W) && (ne.update({ duration: 75 }), ne.update({ duration: 75 }));
|
|
1833
1769
|
});
|
|
1834
|
-
function
|
|
1770
|
+
function $r(O, ue) {
|
|
1835
1771
|
if (!t || !n || !s) return;
|
|
1836
|
-
const Ot = O + i / 2, ot = ue + o / 2, Ze = o < i ? Ot * o / i : Ot, Kt = o > i ? ot * i / o : ot,
|
|
1772
|
+
const Ot = O + i / 2, ot = ue + o / 2, Ze = o < i ? Ot * o / i : Ot, Kt = o > i ? ot * i / o : ot, ms = Math.atan2(Kt, Ze) / Math.PI * 180 - 45, Hr = 0, vs = 30, Qt = Math.sqrt(Ze * Ze + Kt * Kt), lt = Math.min(i, o) / 2, _s = lt * Math.SQRT2, gs = (Qt - lt) / (_s - lt), Yr = Hr + gs * (vs - Hr), ys = Qt < lt ? Qt / lt : 1;
|
|
1837
1773
|
pe.equeue(e.layer, e.priority, e.id + "_angle", () => {
|
|
1838
|
-
n.style.transform = `translate(${Math.round(O)}px, ${Math.round(ue)}px)`, s.style.transform = `scale(${
|
|
1774
|
+
n.style.transform = `translate(${Math.round(O)}px, ${Math.round(ue)}px)`, s.style.transform = `scale(${ys}) rotate(${ms}deg) skew(${Yr}deg, ${Yr}deg)`;
|
|
1839
1775
|
});
|
|
1840
1776
|
}
|
|
1841
|
-
function
|
|
1842
|
-
if (
|
|
1777
|
+
function hs(O) {
|
|
1778
|
+
if (N(W) == !1) {
|
|
1843
1779
|
let ue = pt.getOffsets(i, o, O);
|
|
1844
|
-
|
|
1845
|
-
} else if (O !=
|
|
1846
|
-
let ue = Math.abs(O -
|
|
1847
|
-
|
|
1780
|
+
ne.set(Math.round(ue.x), { duration: 0 }), Mt.set(Math.round(ue.y), { duration: 0 }), $r(ne.value, Mt.value), Z = O, V(W, !0);
|
|
1781
|
+
} else if (O != Z) {
|
|
1782
|
+
let ue = Math.abs(O - Z), Ot = ue < 180 ? ue : 360 - ue, ot = Math.log(Ot) * 75, Ze = pt.getOffsets(i, o, O);
|
|
1783
|
+
ne.set(Math.round(Ze.x), { duration: ot }), Mt.set(Math.round(Ze.y), { duration: ot }), Z = O;
|
|
1848
1784
|
}
|
|
1849
1785
|
}
|
|
1850
|
-
function
|
|
1851
|
-
return pt.getOffsets(i, o,
|
|
1786
|
+
function ps() {
|
|
1787
|
+
return pt.getOffsets(i, o, Z);
|
|
1852
1788
|
}
|
|
1853
|
-
var At =
|
|
1854
|
-
let Hr;
|
|
1855
|
-
var Yr = cr(At);
|
|
1789
|
+
var At = za(), qr = ur(At);
|
|
1856
1790
|
ze(
|
|
1857
|
-
|
|
1791
|
+
qr,
|
|
1858
1792
|
(O) => (
|
|
1859
1793
|
//#endregion
|
|
1860
1794
|
s = O
|
|
1861
1795
|
),
|
|
1862
1796
|
() => s
|
|
1863
1797
|
);
|
|
1864
|
-
var Jt =
|
|
1865
|
-
return ze(
|
|
1866
|
-
(
|
|
1867
|
-
|
|
1868
|
-
},
|
|
1869
|
-
[() => ({ displayed: I(u) })]
|
|
1870
|
-
), as(r, At), Zr({
|
|
1798
|
+
var Jt = ta(qr, 2), Wr = ur(Jt);
|
|
1799
|
+
return ze(Wr, (O) => a = O, () => a), ze(Jt, (O) => n = O, () => n), ze(At, (O) => t = O, () => t), Bn(() => {
|
|
1800
|
+
ns(At, 1, rs(["anchor", N(u) && "displayed"]), "svelte-j5igi2"), Vt(Jt, `margin: ${e.margin}px;`), Vt(Wr, `width: ${e.width}px; height: ${e.height}px; border-radius: ${e.radius}px;`);
|
|
1801
|
+
}), es(r, At), Lr({
|
|
1871
1802
|
getBody: l,
|
|
1872
1803
|
setDisplayed: d,
|
|
1873
|
-
getDisplayed:
|
|
1874
|
-
setCollapsed:
|
|
1875
|
-
getCollapsed:
|
|
1876
|
-
getExpanded:
|
|
1877
|
-
setAngle:
|
|
1878
|
-
getOffsets:
|
|
1804
|
+
getDisplayed: p,
|
|
1805
|
+
setCollapsed: m,
|
|
1806
|
+
getCollapsed: k,
|
|
1807
|
+
getExpanded: T,
|
|
1808
|
+
setAngle: hs,
|
|
1809
|
+
getOffsets: ps
|
|
1879
1810
|
});
|
|
1880
1811
|
}
|
|
1881
1812
|
var Ve;
|
|
@@ -1907,7 +1838,7 @@ var Ve;
|
|
|
1907
1838
|
return 360 / Math.PI * Math.atan(Math.exp((180 - o * 360) * Math.PI / 180)) - 90;
|
|
1908
1839
|
}
|
|
1909
1840
|
})(Ve || (Ve = {}));
|
|
1910
|
-
class
|
|
1841
|
+
class is {
|
|
1911
1842
|
/**
|
|
1912
1843
|
* @param mapBounds - The bounds of the map.
|
|
1913
1844
|
* @param mapZoom - The zoom level of the map.
|
|
@@ -1916,18 +1847,18 @@ class us {
|
|
|
1916
1847
|
* @param offsetY - The y offset of the map in pixels at zoom level n.
|
|
1917
1848
|
*/
|
|
1918
1849
|
constructor(e, t, n, s, a) {
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
const i = n * Math.pow(2, t), o = Ve.project(e.sw.lat, e.sw.lng, i), l = Ve.project(e.ne.lat, e.ne.lng, i), u = o.x - s, d = o.y + a,
|
|
1924
|
-
this.swLat =
|
|
1850
|
+
f(this, "swLat");
|
|
1851
|
+
f(this, "swLng");
|
|
1852
|
+
f(this, "neLat");
|
|
1853
|
+
f(this, "neLng");
|
|
1854
|
+
const i = n * Math.pow(2, t), o = Ve.project(e.sw.lat, e.sw.lng, i), l = Ve.project(e.ne.lat, e.ne.lng, i), u = o.x - s, d = o.y + a, p = l.x + s, v = l.y - a, m = Ve.unproject(u, d, i), k = Ve.unproject(p, v, i);
|
|
1855
|
+
this.swLat = m.lat, this.swLng = m.lng, this.neLat = k.lat, this.neLng = k.lng;
|
|
1925
1856
|
}
|
|
1926
1857
|
contains(e, t) {
|
|
1927
1858
|
return this.swLat <= e && e <= this.neLat ? this.swLng < this.neLng ? this.swLng <= t && t <= this.neLng : t <= this.neLng || this.swLng <= t : !1;
|
|
1928
1859
|
}
|
|
1929
1860
|
}
|
|
1930
|
-
var
|
|
1861
|
+
var S;
|
|
1931
1862
|
(function(r) {
|
|
1932
1863
|
r.assertEqual = (s) => {
|
|
1933
1864
|
};
|
|
@@ -1963,16 +1894,16 @@ var T;
|
|
|
1963
1894
|
return s.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
|
|
1964
1895
|
}
|
|
1965
1896
|
r.joinValues = n, r.jsonStringifyReplacer = (s, a) => typeof a == "bigint" ? a.toString() : a;
|
|
1966
|
-
})(
|
|
1967
|
-
var
|
|
1897
|
+
})(S || (S = {}));
|
|
1898
|
+
var ln;
|
|
1968
1899
|
(function(r) {
|
|
1969
1900
|
r.mergeShapes = (e, t) => ({
|
|
1970
1901
|
...e,
|
|
1971
1902
|
...t
|
|
1972
1903
|
// second overwrites first
|
|
1973
1904
|
});
|
|
1974
|
-
})(
|
|
1975
|
-
const
|
|
1905
|
+
})(ln || (ln = {}));
|
|
1906
|
+
const _ = S.arrayToEnum([
|
|
1976
1907
|
"string",
|
|
1977
1908
|
"nan",
|
|
1978
1909
|
"number",
|
|
@@ -1996,25 +1927,25 @@ const g = T.arrayToEnum([
|
|
|
1996
1927
|
]), he = (r) => {
|
|
1997
1928
|
switch (typeof r) {
|
|
1998
1929
|
case "undefined":
|
|
1999
|
-
return
|
|
1930
|
+
return _.undefined;
|
|
2000
1931
|
case "string":
|
|
2001
|
-
return
|
|
1932
|
+
return _.string;
|
|
2002
1933
|
case "number":
|
|
2003
|
-
return Number.isNaN(r) ?
|
|
1934
|
+
return Number.isNaN(r) ? _.nan : _.number;
|
|
2004
1935
|
case "boolean":
|
|
2005
|
-
return
|
|
1936
|
+
return _.boolean;
|
|
2006
1937
|
case "function":
|
|
2007
|
-
return
|
|
1938
|
+
return _.function;
|
|
2008
1939
|
case "bigint":
|
|
2009
|
-
return
|
|
1940
|
+
return _.bigint;
|
|
2010
1941
|
case "symbol":
|
|
2011
|
-
return
|
|
1942
|
+
return _.symbol;
|
|
2012
1943
|
case "object":
|
|
2013
|
-
return Array.isArray(r) ?
|
|
1944
|
+
return Array.isArray(r) ? _.array : r === null ? _.null : r.then && typeof r.then == "function" && r.catch && typeof r.catch == "function" ? _.promise : typeof Map < "u" && r instanceof Map ? _.map : typeof Set < "u" && r instanceof Set ? _.set : typeof Date < "u" && r instanceof Date ? _.date : _.object;
|
|
2014
1945
|
default:
|
|
2015
|
-
return
|
|
1946
|
+
return _.unknown;
|
|
2016
1947
|
}
|
|
2017
|
-
}, c =
|
|
1948
|
+
}, c = S.arrayToEnum([
|
|
2018
1949
|
"invalid_type",
|
|
2019
1950
|
"invalid_literal",
|
|
2020
1951
|
"custom",
|
|
@@ -2032,7 +1963,7 @@ const g = T.arrayToEnum([
|
|
|
2032
1963
|
"not_multiple_of",
|
|
2033
1964
|
"not_finite"
|
|
2034
1965
|
]);
|
|
2035
|
-
class
|
|
1966
|
+
class Q extends Error {
|
|
2036
1967
|
get errors() {
|
|
2037
1968
|
return this.issues;
|
|
2038
1969
|
}
|
|
@@ -2069,14 +2000,14 @@ class te extends Error {
|
|
|
2069
2000
|
return s(this), n;
|
|
2070
2001
|
}
|
|
2071
2002
|
static assert(e) {
|
|
2072
|
-
if (!(e instanceof
|
|
2003
|
+
if (!(e instanceof Q))
|
|
2073
2004
|
throw new Error(`Not a ZodError: ${e}`);
|
|
2074
2005
|
}
|
|
2075
2006
|
toString() {
|
|
2076
2007
|
return this.message;
|
|
2077
2008
|
}
|
|
2078
2009
|
get message() {
|
|
2079
|
-
return JSON.stringify(this.issues,
|
|
2010
|
+
return JSON.stringify(this.issues, S.jsonStringifyReplacer, 2);
|
|
2080
2011
|
}
|
|
2081
2012
|
get isEmpty() {
|
|
2082
2013
|
return this.issues.length === 0;
|
|
@@ -2095,27 +2026,27 @@ class te extends Error {
|
|
|
2095
2026
|
return this.flatten();
|
|
2096
2027
|
}
|
|
2097
2028
|
}
|
|
2098
|
-
|
|
2029
|
+
Q.create = (r) => new Q(r);
|
|
2099
2030
|
const yt = (r, e) => {
|
|
2100
2031
|
let t;
|
|
2101
2032
|
switch (r.code) {
|
|
2102
2033
|
case c.invalid_type:
|
|
2103
|
-
r.received ===
|
|
2034
|
+
r.received === _.undefined ? t = "Required" : t = `Expected ${r.expected}, received ${r.received}`;
|
|
2104
2035
|
break;
|
|
2105
2036
|
case c.invalid_literal:
|
|
2106
|
-
t = `Invalid literal value, expected ${JSON.stringify(r.expected,
|
|
2037
|
+
t = `Invalid literal value, expected ${JSON.stringify(r.expected, S.jsonStringifyReplacer)}`;
|
|
2107
2038
|
break;
|
|
2108
2039
|
case c.unrecognized_keys:
|
|
2109
|
-
t = `Unrecognized key(s) in object: ${
|
|
2040
|
+
t = `Unrecognized key(s) in object: ${S.joinValues(r.keys, ", ")}`;
|
|
2110
2041
|
break;
|
|
2111
2042
|
case c.invalid_union:
|
|
2112
2043
|
t = "Invalid input";
|
|
2113
2044
|
break;
|
|
2114
2045
|
case c.invalid_union_discriminator:
|
|
2115
|
-
t = `Invalid discriminator value. Expected ${
|
|
2046
|
+
t = `Invalid discriminator value. Expected ${S.joinValues(r.options)}`;
|
|
2116
2047
|
break;
|
|
2117
2048
|
case c.invalid_enum_value:
|
|
2118
|
-
t = `Invalid enum value. Expected ${
|
|
2049
|
+
t = `Invalid enum value. Expected ${S.joinValues(r.options)}, received '${r.received}'`;
|
|
2119
2050
|
break;
|
|
2120
2051
|
case c.invalid_arguments:
|
|
2121
2052
|
t = "Invalid function arguments";
|
|
@@ -2127,7 +2058,7 @@ const yt = (r, e) => {
|
|
|
2127
2058
|
t = "Invalid date";
|
|
2128
2059
|
break;
|
|
2129
2060
|
case c.invalid_string:
|
|
2130
|
-
typeof r.validation == "object" ? "includes" in r.validation ? (t = `Invalid input: must include "${r.validation.includes}"`, typeof r.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${r.validation.position}`)) : "startsWith" in r.validation ? t = `Invalid input: must start with "${r.validation.startsWith}"` : "endsWith" in r.validation ? t = `Invalid input: must end with "${r.validation.endsWith}"` :
|
|
2061
|
+
typeof r.validation == "object" ? "includes" in r.validation ? (t = `Invalid input: must include "${r.validation.includes}"`, typeof r.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${r.validation.position}`)) : "startsWith" in r.validation ? t = `Invalid input: must start with "${r.validation.startsWith}"` : "endsWith" in r.validation ? t = `Invalid input: must end with "${r.validation.endsWith}"` : S.assertNever(r.validation) : r.validation !== "regex" ? t = `Invalid ${r.validation}` : t = "Invalid";
|
|
2131
2062
|
break;
|
|
2132
2063
|
case c.too_small:
|
|
2133
2064
|
r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "more than"} ${r.minimum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "over"} ${r.minimum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "bigint" ? t = `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(r.minimum))}` : t = "Invalid input";
|
|
@@ -2148,15 +2079,15 @@ const yt = (r, e) => {
|
|
|
2148
2079
|
t = "Number must be finite";
|
|
2149
2080
|
break;
|
|
2150
2081
|
default:
|
|
2151
|
-
t = e.defaultError,
|
|
2082
|
+
t = e.defaultError, S.assertNever(r);
|
|
2152
2083
|
}
|
|
2153
2084
|
return { message: t };
|
|
2154
2085
|
};
|
|
2155
|
-
let
|
|
2156
|
-
function
|
|
2157
|
-
return
|
|
2086
|
+
let Va = yt;
|
|
2087
|
+
function hr() {
|
|
2088
|
+
return Va;
|
|
2158
2089
|
}
|
|
2159
|
-
const
|
|
2090
|
+
const pr = (r) => {
|
|
2160
2091
|
const { data: e, path: t, errorMaps: n, issueData: s } = r, a = [...t, ...s.path || []], i = {
|
|
2161
2092
|
...s,
|
|
2162
2093
|
path: a
|
|
@@ -2177,8 +2108,8 @@ const vr = (r) => {
|
|
|
2177
2108
|
message: o
|
|
2178
2109
|
};
|
|
2179
2110
|
};
|
|
2180
|
-
function
|
|
2181
|
-
const t =
|
|
2111
|
+
function h(r, e) {
|
|
2112
|
+
const t = hr(), n = pr({
|
|
2182
2113
|
issueData: e,
|
|
2183
2114
|
data: r.data,
|
|
2184
2115
|
path: r.path,
|
|
@@ -2238,12 +2169,12 @@ class X {
|
|
|
2238
2169
|
}
|
|
2239
2170
|
const y = Object.freeze({
|
|
2240
2171
|
status: "aborted"
|
|
2241
|
-
}), ct = (r) => ({ status: "dirty", value: r }),
|
|
2242
|
-
var
|
|
2172
|
+
}), ct = (r) => ({ status: "dirty", value: r }), q = (r) => ({ status: "valid", value: r }), un = (r) => r.status === "aborted", dn = (r) => r.status === "dirty", et = (r) => r.status === "valid", Ut = (r) => typeof Promise < "u" && r instanceof Promise;
|
|
2173
|
+
var g;
|
|
2243
2174
|
(function(r) {
|
|
2244
2175
|
r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
2245
|
-
})(
|
|
2246
|
-
class
|
|
2176
|
+
})(g || (g = {}));
|
|
2177
|
+
class ke {
|
|
2247
2178
|
constructor(e, t, n, s) {
|
|
2248
2179
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = s;
|
|
2249
2180
|
}
|
|
@@ -2251,7 +2182,7 @@ class xe {
|
|
|
2251
2182
|
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
2252
2183
|
}
|
|
2253
2184
|
}
|
|
2254
|
-
const
|
|
2185
|
+
const cn = (r, e) => {
|
|
2255
2186
|
if (et(e))
|
|
2256
2187
|
return { success: !0, data: e.value };
|
|
2257
2188
|
if (!r.common.issues.length)
|
|
@@ -2261,7 +2192,7 @@ const vn = (r, e) => {
|
|
|
2261
2192
|
get error() {
|
|
2262
2193
|
if (this._error)
|
|
2263
2194
|
return this._error;
|
|
2264
|
-
const t = new
|
|
2195
|
+
const t = new Q(r.common.issues);
|
|
2265
2196
|
return this._error = t, this._error;
|
|
2266
2197
|
}
|
|
2267
2198
|
};
|
|
@@ -2336,7 +2267,7 @@ class C {
|
|
|
2336
2267
|
data: e,
|
|
2337
2268
|
parsedType: he(e)
|
|
2338
2269
|
}, s = this._parseSync({ data: e, path: n.path, parent: n });
|
|
2339
|
-
return
|
|
2270
|
+
return cn(n, s);
|
|
2340
2271
|
}
|
|
2341
2272
|
"~validate"(e) {
|
|
2342
2273
|
var n, s;
|
|
@@ -2390,7 +2321,7 @@ class C {
|
|
|
2390
2321
|
data: e,
|
|
2391
2322
|
parsedType: he(e)
|
|
2392
2323
|
}, s = this._parse({ data: e, path: n.path, parent: n }), a = await (Ut(s) ? s : Promise.resolve(s));
|
|
2393
|
-
return
|
|
2324
|
+
return cn(n, a);
|
|
2394
2325
|
}
|
|
2395
2326
|
refine(e, t) {
|
|
2396
2327
|
const n = (s) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(s) : t;
|
|
@@ -2432,10 +2363,10 @@ class C {
|
|
|
2432
2363
|
return this.nullable().optional();
|
|
2433
2364
|
}
|
|
2434
2365
|
array() {
|
|
2435
|
-
return
|
|
2366
|
+
return ie.create(this);
|
|
2436
2367
|
}
|
|
2437
2368
|
promise() {
|
|
2438
|
-
return
|
|
2369
|
+
return kt.create(this, this._def);
|
|
2439
2370
|
}
|
|
2440
2371
|
or(e) {
|
|
2441
2372
|
return $t.create([this, e], this._def);
|
|
@@ -2453,7 +2384,7 @@ class C {
|
|
|
2453
2384
|
}
|
|
2454
2385
|
default(e) {
|
|
2455
2386
|
const t = typeof e == "function" ? e : () => e;
|
|
2456
|
-
return new
|
|
2387
|
+
return new yr({
|
|
2457
2388
|
...b(this._def),
|
|
2458
2389
|
innerType: this,
|
|
2459
2390
|
defaultValue: t,
|
|
@@ -2461,7 +2392,7 @@ class C {
|
|
|
2461
2392
|
});
|
|
2462
2393
|
}
|
|
2463
2394
|
brand() {
|
|
2464
|
-
return new
|
|
2395
|
+
return new di({
|
|
2465
2396
|
typeName: w.ZodBranded,
|
|
2466
2397
|
type: this,
|
|
2467
2398
|
...b(this._def)
|
|
@@ -2469,7 +2400,7 @@ class C {
|
|
|
2469
2400
|
}
|
|
2470
2401
|
catch(e) {
|
|
2471
2402
|
const t = typeof e == "function" ? e : () => e;
|
|
2472
|
-
return new
|
|
2403
|
+
return new wr({
|
|
2473
2404
|
...b(this._def),
|
|
2474
2405
|
innerType: this,
|
|
2475
2406
|
catchValue: t,
|
|
@@ -2484,10 +2415,10 @@ class C {
|
|
|
2484
2415
|
});
|
|
2485
2416
|
}
|
|
2486
2417
|
pipe(e) {
|
|
2487
|
-
return
|
|
2418
|
+
return zr.create(this, e);
|
|
2488
2419
|
}
|
|
2489
2420
|
readonly() {
|
|
2490
|
-
return
|
|
2421
|
+
return xr.create(this);
|
|
2491
2422
|
}
|
|
2492
2423
|
isOptional() {
|
|
2493
2424
|
return this.safeParse(void 0).success;
|
|
@@ -2496,28 +2427,28 @@ class C {
|
|
|
2496
2427
|
return this.safeParse(null).success;
|
|
2497
2428
|
}
|
|
2498
2429
|
}
|
|
2499
|
-
const
|
|
2500
|
-
let
|
|
2501
|
-
const
|
|
2502
|
-
function
|
|
2430
|
+
const Ua = /^c[^\s-]{8,}$/i, Ba = /^[0-9a-z]+$/, $a = /^[0-9A-HJKMNP-TV-Z]{26}$/i, qa = /^[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, Wa = /^[a-z0-9_-]{21}$/i, Ha = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Ya = /^[-+]?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)?)??$/, Xa = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ga = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
2431
|
+
let rr;
|
|
2432
|
+
const Ja = /^(?:(?: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])$/, Ka = /^(?:(?: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])$/, Qa = /^(([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]))$/, ei = /^(([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])$/, ti = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, ri = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, os = "((\\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])))", ni = new RegExp(`^${os}$`);
|
|
2433
|
+
function ls(r) {
|
|
2503
2434
|
let e = "[0-5]\\d";
|
|
2504
2435
|
r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`);
|
|
2505
2436
|
const t = r.precision ? "+" : "?";
|
|
2506
2437
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
|
|
2507
2438
|
}
|
|
2508
|
-
function
|
|
2509
|
-
return new RegExp(`^${
|
|
2439
|
+
function si(r) {
|
|
2440
|
+
return new RegExp(`^${ls(r)}$`);
|
|
2510
2441
|
}
|
|
2511
|
-
function
|
|
2512
|
-
let e = `${
|
|
2442
|
+
function ai(r) {
|
|
2443
|
+
let e = `${os}T${ls(r)}`;
|
|
2513
2444
|
const t = [];
|
|
2514
2445
|
return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
2515
2446
|
}
|
|
2516
|
-
function
|
|
2517
|
-
return !!((e === "v4" || !e) &&
|
|
2447
|
+
function ii(r, e) {
|
|
2448
|
+
return !!((e === "v4" || !e) && Ja.test(r) || (e === "v6" || !e) && Qa.test(r));
|
|
2518
2449
|
}
|
|
2519
|
-
function
|
|
2520
|
-
if (!
|
|
2450
|
+
function oi(r, e) {
|
|
2451
|
+
if (!Ha.test(r))
|
|
2521
2452
|
return !1;
|
|
2522
2453
|
try {
|
|
2523
2454
|
const [t] = r.split(".");
|
|
@@ -2529,16 +2460,16 @@ function ui(r, e) {
|
|
|
2529
2460
|
return !1;
|
|
2530
2461
|
}
|
|
2531
2462
|
}
|
|
2532
|
-
function
|
|
2533
|
-
return !!((e === "v4" || !e) &&
|
|
2463
|
+
function li(r, e) {
|
|
2464
|
+
return !!((e === "v4" || !e) && Ka.test(r) || (e === "v6" || !e) && ei.test(r));
|
|
2534
2465
|
}
|
|
2535
2466
|
class ye extends C {
|
|
2536
2467
|
_parse(e) {
|
|
2537
|
-
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !==
|
|
2468
|
+
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== _.string) {
|
|
2538
2469
|
const a = this._getOrReturnCtx(e);
|
|
2539
|
-
return
|
|
2470
|
+
return h(a, {
|
|
2540
2471
|
code: c.invalid_type,
|
|
2541
|
-
expected:
|
|
2472
|
+
expected: _.string,
|
|
2542
2473
|
received: a.parsedType
|
|
2543
2474
|
}), y;
|
|
2544
2475
|
}
|
|
@@ -2546,7 +2477,7 @@ class ye extends C {
|
|
|
2546
2477
|
let s;
|
|
2547
2478
|
for (const a of this._def.checks)
|
|
2548
2479
|
if (a.kind === "min")
|
|
2549
|
-
e.data.length < a.value && (s = this._getOrReturnCtx(e, s),
|
|
2480
|
+
e.data.length < a.value && (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2550
2481
|
code: c.too_small,
|
|
2551
2482
|
minimum: a.value,
|
|
2552
2483
|
type: "string",
|
|
@@ -2555,7 +2486,7 @@ class ye extends C {
|
|
|
2555
2486
|
message: a.message
|
|
2556
2487
|
}), n.dirty());
|
|
2557
2488
|
else if (a.kind === "max")
|
|
2558
|
-
e.data.length > a.value && (s = this._getOrReturnCtx(e, s),
|
|
2489
|
+
e.data.length > a.value && (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2559
2490
|
code: c.too_big,
|
|
2560
2491
|
maximum: a.value,
|
|
2561
2492
|
type: "string",
|
|
@@ -2565,14 +2496,14 @@ class ye extends C {
|
|
|
2565
2496
|
}), n.dirty());
|
|
2566
2497
|
else if (a.kind === "length") {
|
|
2567
2498
|
const i = e.data.length > a.value, o = e.data.length < a.value;
|
|
2568
|
-
(i || o) && (s = this._getOrReturnCtx(e, s), i ?
|
|
2499
|
+
(i || o) && (s = this._getOrReturnCtx(e, s), i ? h(s, {
|
|
2569
2500
|
code: c.too_big,
|
|
2570
2501
|
maximum: a.value,
|
|
2571
2502
|
type: "string",
|
|
2572
2503
|
inclusive: !0,
|
|
2573
2504
|
exact: !0,
|
|
2574
2505
|
message: a.message
|
|
2575
|
-
}) : o &&
|
|
2506
|
+
}) : o && h(s, {
|
|
2576
2507
|
code: c.too_small,
|
|
2577
2508
|
minimum: a.value,
|
|
2578
2509
|
type: "string",
|
|
@@ -2581,43 +2512,43 @@ class ye extends C {
|
|
|
2581
2512
|
message: a.message
|
|
2582
2513
|
}), n.dirty());
|
|
2583
2514
|
} else if (a.kind === "email")
|
|
2584
|
-
|
|
2515
|
+
Xa.test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2585
2516
|
validation: "email",
|
|
2586
2517
|
code: c.invalid_string,
|
|
2587
2518
|
message: a.message
|
|
2588
2519
|
}), n.dirty());
|
|
2589
2520
|
else if (a.kind === "emoji")
|
|
2590
|
-
|
|
2521
|
+
rr || (rr = new RegExp(Ga, "u")), rr.test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2591
2522
|
validation: "emoji",
|
|
2592
2523
|
code: c.invalid_string,
|
|
2593
2524
|
message: a.message
|
|
2594
2525
|
}), n.dirty());
|
|
2595
2526
|
else if (a.kind === "uuid")
|
|
2596
|
-
|
|
2527
|
+
qa.test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2597
2528
|
validation: "uuid",
|
|
2598
2529
|
code: c.invalid_string,
|
|
2599
2530
|
message: a.message
|
|
2600
2531
|
}), n.dirty());
|
|
2601
2532
|
else if (a.kind === "nanoid")
|
|
2602
|
-
|
|
2533
|
+
Wa.test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2603
2534
|
validation: "nanoid",
|
|
2604
2535
|
code: c.invalid_string,
|
|
2605
2536
|
message: a.message
|
|
2606
2537
|
}), n.dirty());
|
|
2607
2538
|
else if (a.kind === "cuid")
|
|
2608
|
-
|
|
2539
|
+
Ua.test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2609
2540
|
validation: "cuid",
|
|
2610
2541
|
code: c.invalid_string,
|
|
2611
2542
|
message: a.message
|
|
2612
2543
|
}), n.dirty());
|
|
2613
2544
|
else if (a.kind === "cuid2")
|
|
2614
|
-
|
|
2545
|
+
Ba.test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2615
2546
|
validation: "cuid2",
|
|
2616
2547
|
code: c.invalid_string,
|
|
2617
2548
|
message: a.message
|
|
2618
2549
|
}), n.dirty());
|
|
2619
2550
|
else if (a.kind === "ulid")
|
|
2620
|
-
|
|
2551
|
+
$a.test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2621
2552
|
validation: "ulid",
|
|
2622
2553
|
code: c.invalid_string,
|
|
2623
2554
|
message: a.message
|
|
@@ -2626,72 +2557,72 @@ class ye extends C {
|
|
|
2626
2557
|
try {
|
|
2627
2558
|
new URL(e.data);
|
|
2628
2559
|
} catch {
|
|
2629
|
-
s = this._getOrReturnCtx(e, s),
|
|
2560
|
+
s = this._getOrReturnCtx(e, s), h(s, {
|
|
2630
2561
|
validation: "url",
|
|
2631
2562
|
code: c.invalid_string,
|
|
2632
2563
|
message: a.message
|
|
2633
2564
|
}), n.dirty();
|
|
2634
2565
|
}
|
|
2635
|
-
else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (s = this._getOrReturnCtx(e, s),
|
|
2566
|
+
else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2636
2567
|
validation: "regex",
|
|
2637
2568
|
code: c.invalid_string,
|
|
2638
2569
|
message: a.message
|
|
2639
|
-
}), 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),
|
|
2570
|
+
}), 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), h(s, {
|
|
2640
2571
|
code: c.invalid_string,
|
|
2641
2572
|
validation: { includes: a.value, position: a.position },
|
|
2642
2573
|
message: a.message
|
|
2643
|
-
}), 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),
|
|
2574
|
+
}), 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), h(s, {
|
|
2644
2575
|
code: c.invalid_string,
|
|
2645
2576
|
validation: { startsWith: a.value },
|
|
2646
2577
|
message: a.message
|
|
2647
|
-
}), n.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (s = this._getOrReturnCtx(e, s),
|
|
2578
|
+
}), n.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2648
2579
|
code: c.invalid_string,
|
|
2649
2580
|
validation: { endsWith: a.value },
|
|
2650
2581
|
message: a.message
|
|
2651
|
-
}), n.dirty()) : a.kind === "datetime" ?
|
|
2582
|
+
}), n.dirty()) : a.kind === "datetime" ? ai(a).test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2652
2583
|
code: c.invalid_string,
|
|
2653
2584
|
validation: "datetime",
|
|
2654
2585
|
message: a.message
|
|
2655
|
-
}), n.dirty()) : a.kind === "date" ?
|
|
2586
|
+
}), n.dirty()) : a.kind === "date" ? ni.test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2656
2587
|
code: c.invalid_string,
|
|
2657
2588
|
validation: "date",
|
|
2658
2589
|
message: a.message
|
|
2659
|
-
}), n.dirty()) : a.kind === "time" ?
|
|
2590
|
+
}), n.dirty()) : a.kind === "time" ? si(a).test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2660
2591
|
code: c.invalid_string,
|
|
2661
2592
|
validation: "time",
|
|
2662
2593
|
message: a.message
|
|
2663
|
-
}), n.dirty()) : a.kind === "duration" ?
|
|
2594
|
+
}), n.dirty()) : a.kind === "duration" ? Ya.test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2664
2595
|
validation: "duration",
|
|
2665
2596
|
code: c.invalid_string,
|
|
2666
2597
|
message: a.message
|
|
2667
|
-
}), n.dirty()) : a.kind === "ip" ?
|
|
2598
|
+
}), n.dirty()) : a.kind === "ip" ? ii(e.data, a.version) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2668
2599
|
validation: "ip",
|
|
2669
2600
|
code: c.invalid_string,
|
|
2670
2601
|
message: a.message
|
|
2671
|
-
}), n.dirty()) : a.kind === "jwt" ?
|
|
2602
|
+
}), n.dirty()) : a.kind === "jwt" ? oi(e.data, a.alg) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2672
2603
|
validation: "jwt",
|
|
2673
2604
|
code: c.invalid_string,
|
|
2674
2605
|
message: a.message
|
|
2675
|
-
}), n.dirty()) : a.kind === "cidr" ?
|
|
2606
|
+
}), n.dirty()) : a.kind === "cidr" ? li(e.data, a.version) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2676
2607
|
validation: "cidr",
|
|
2677
2608
|
code: c.invalid_string,
|
|
2678
2609
|
message: a.message
|
|
2679
|
-
}), n.dirty()) : a.kind === "base64" ?
|
|
2610
|
+
}), n.dirty()) : a.kind === "base64" ? ti.test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2680
2611
|
validation: "base64",
|
|
2681
2612
|
code: c.invalid_string,
|
|
2682
2613
|
message: a.message
|
|
2683
|
-
}), n.dirty()) : a.kind === "base64url" ?
|
|
2614
|
+
}), n.dirty()) : a.kind === "base64url" ? ri.test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2684
2615
|
validation: "base64url",
|
|
2685
2616
|
code: c.invalid_string,
|
|
2686
2617
|
message: a.message
|
|
2687
|
-
}), n.dirty()) :
|
|
2618
|
+
}), n.dirty()) : S.assertNever(a);
|
|
2688
2619
|
return { status: n.value, value: e.data };
|
|
2689
2620
|
}
|
|
2690
2621
|
_regex(e, t, n) {
|
|
2691
2622
|
return this.refinement((s) => e.test(s), {
|
|
2692
2623
|
validation: t,
|
|
2693
2624
|
code: c.invalid_string,
|
|
2694
|
-
...
|
|
2625
|
+
...g.errToObj(n)
|
|
2695
2626
|
});
|
|
2696
2627
|
}
|
|
2697
2628
|
_addCheck(e) {
|
|
@@ -2701,46 +2632,46 @@ class ye extends C {
|
|
|
2701
2632
|
});
|
|
2702
2633
|
}
|
|
2703
2634
|
email(e) {
|
|
2704
|
-
return this._addCheck({ kind: "email", ...
|
|
2635
|
+
return this._addCheck({ kind: "email", ...g.errToObj(e) });
|
|
2705
2636
|
}
|
|
2706
2637
|
url(e) {
|
|
2707
|
-
return this._addCheck({ kind: "url", ...
|
|
2638
|
+
return this._addCheck({ kind: "url", ...g.errToObj(e) });
|
|
2708
2639
|
}
|
|
2709
2640
|
emoji(e) {
|
|
2710
|
-
return this._addCheck({ kind: "emoji", ...
|
|
2641
|
+
return this._addCheck({ kind: "emoji", ...g.errToObj(e) });
|
|
2711
2642
|
}
|
|
2712
2643
|
uuid(e) {
|
|
2713
|
-
return this._addCheck({ kind: "uuid", ...
|
|
2644
|
+
return this._addCheck({ kind: "uuid", ...g.errToObj(e) });
|
|
2714
2645
|
}
|
|
2715
2646
|
nanoid(e) {
|
|
2716
|
-
return this._addCheck({ kind: "nanoid", ...
|
|
2647
|
+
return this._addCheck({ kind: "nanoid", ...g.errToObj(e) });
|
|
2717
2648
|
}
|
|
2718
2649
|
cuid(e) {
|
|
2719
|
-
return this._addCheck({ kind: "cuid", ...
|
|
2650
|
+
return this._addCheck({ kind: "cuid", ...g.errToObj(e) });
|
|
2720
2651
|
}
|
|
2721
2652
|
cuid2(e) {
|
|
2722
|
-
return this._addCheck({ kind: "cuid2", ...
|
|
2653
|
+
return this._addCheck({ kind: "cuid2", ...g.errToObj(e) });
|
|
2723
2654
|
}
|
|
2724
2655
|
ulid(e) {
|
|
2725
|
-
return this._addCheck({ kind: "ulid", ...
|
|
2656
|
+
return this._addCheck({ kind: "ulid", ...g.errToObj(e) });
|
|
2726
2657
|
}
|
|
2727
2658
|
base64(e) {
|
|
2728
|
-
return this._addCheck({ kind: "base64", ...
|
|
2659
|
+
return this._addCheck({ kind: "base64", ...g.errToObj(e) });
|
|
2729
2660
|
}
|
|
2730
2661
|
base64url(e) {
|
|
2731
2662
|
return this._addCheck({
|
|
2732
2663
|
kind: "base64url",
|
|
2733
|
-
...
|
|
2664
|
+
...g.errToObj(e)
|
|
2734
2665
|
});
|
|
2735
2666
|
}
|
|
2736
2667
|
jwt(e) {
|
|
2737
|
-
return this._addCheck({ kind: "jwt", ...
|
|
2668
|
+
return this._addCheck({ kind: "jwt", ...g.errToObj(e) });
|
|
2738
2669
|
}
|
|
2739
2670
|
ip(e) {
|
|
2740
|
-
return this._addCheck({ kind: "ip", ...
|
|
2671
|
+
return this._addCheck({ kind: "ip", ...g.errToObj(e) });
|
|
2741
2672
|
}
|
|
2742
2673
|
cidr(e) {
|
|
2743
|
-
return this._addCheck({ kind: "cidr", ...
|
|
2674
|
+
return this._addCheck({ kind: "cidr", ...g.errToObj(e) });
|
|
2744
2675
|
}
|
|
2745
2676
|
datetime(e) {
|
|
2746
2677
|
return typeof e == "string" ? this._addCheck({
|
|
@@ -2754,7 +2685,7 @@ class ye extends C {
|
|
|
2754
2685
|
precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
|
|
2755
2686
|
offset: (e == null ? void 0 : e.offset) ?? !1,
|
|
2756
2687
|
local: (e == null ? void 0 : e.local) ?? !1,
|
|
2757
|
-
...
|
|
2688
|
+
...g.errToObj(e == null ? void 0 : e.message)
|
|
2758
2689
|
});
|
|
2759
2690
|
}
|
|
2760
2691
|
date(e) {
|
|
@@ -2768,17 +2699,17 @@ class ye extends C {
|
|
|
2768
2699
|
}) : this._addCheck({
|
|
2769
2700
|
kind: "time",
|
|
2770
2701
|
precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
|
|
2771
|
-
...
|
|
2702
|
+
...g.errToObj(e == null ? void 0 : e.message)
|
|
2772
2703
|
});
|
|
2773
2704
|
}
|
|
2774
2705
|
duration(e) {
|
|
2775
|
-
return this._addCheck({ kind: "duration", ...
|
|
2706
|
+
return this._addCheck({ kind: "duration", ...g.errToObj(e) });
|
|
2776
2707
|
}
|
|
2777
2708
|
regex(e, t) {
|
|
2778
2709
|
return this._addCheck({
|
|
2779
2710
|
kind: "regex",
|
|
2780
2711
|
regex: e,
|
|
2781
|
-
...
|
|
2712
|
+
...g.errToObj(t)
|
|
2782
2713
|
});
|
|
2783
2714
|
}
|
|
2784
2715
|
includes(e, t) {
|
|
@@ -2786,49 +2717,49 @@ class ye extends C {
|
|
|
2786
2717
|
kind: "includes",
|
|
2787
2718
|
value: e,
|
|
2788
2719
|
position: t == null ? void 0 : t.position,
|
|
2789
|
-
...
|
|
2720
|
+
...g.errToObj(t == null ? void 0 : t.message)
|
|
2790
2721
|
});
|
|
2791
2722
|
}
|
|
2792
2723
|
startsWith(e, t) {
|
|
2793
2724
|
return this._addCheck({
|
|
2794
2725
|
kind: "startsWith",
|
|
2795
2726
|
value: e,
|
|
2796
|
-
...
|
|
2727
|
+
...g.errToObj(t)
|
|
2797
2728
|
});
|
|
2798
2729
|
}
|
|
2799
2730
|
endsWith(e, t) {
|
|
2800
2731
|
return this._addCheck({
|
|
2801
2732
|
kind: "endsWith",
|
|
2802
2733
|
value: e,
|
|
2803
|
-
...
|
|
2734
|
+
...g.errToObj(t)
|
|
2804
2735
|
});
|
|
2805
2736
|
}
|
|
2806
2737
|
min(e, t) {
|
|
2807
2738
|
return this._addCheck({
|
|
2808
2739
|
kind: "min",
|
|
2809
2740
|
value: e,
|
|
2810
|
-
...
|
|
2741
|
+
...g.errToObj(t)
|
|
2811
2742
|
});
|
|
2812
2743
|
}
|
|
2813
2744
|
max(e, t) {
|
|
2814
2745
|
return this._addCheck({
|
|
2815
2746
|
kind: "max",
|
|
2816
2747
|
value: e,
|
|
2817
|
-
...
|
|
2748
|
+
...g.errToObj(t)
|
|
2818
2749
|
});
|
|
2819
2750
|
}
|
|
2820
2751
|
length(e, t) {
|
|
2821
2752
|
return this._addCheck({
|
|
2822
2753
|
kind: "length",
|
|
2823
2754
|
value: e,
|
|
2824
|
-
...
|
|
2755
|
+
...g.errToObj(t)
|
|
2825
2756
|
});
|
|
2826
2757
|
}
|
|
2827
2758
|
/**
|
|
2828
2759
|
* Equivalent to `.min(1)`
|
|
2829
2760
|
*/
|
|
2830
2761
|
nonempty(e) {
|
|
2831
|
-
return this.min(1,
|
|
2762
|
+
return this.min(1, g.errToObj(e));
|
|
2832
2763
|
}
|
|
2833
2764
|
trim() {
|
|
2834
2765
|
return new ye({
|
|
@@ -2915,7 +2846,7 @@ ye.create = (r) => new ye({
|
|
|
2915
2846
|
coerce: (r == null ? void 0 : r.coerce) ?? !1,
|
|
2916
2847
|
...b(r)
|
|
2917
2848
|
});
|
|
2918
|
-
function
|
|
2849
|
+
function ui(r, e) {
|
|
2919
2850
|
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(".", ""));
|
|
2920
2851
|
return a % i / 10 ** s;
|
|
2921
2852
|
}
|
|
@@ -2924,57 +2855,57 @@ class tt extends C {
|
|
|
2924
2855
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
2925
2856
|
}
|
|
2926
2857
|
_parse(e) {
|
|
2927
|
-
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !==
|
|
2858
|
+
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== _.number) {
|
|
2928
2859
|
const a = this._getOrReturnCtx(e);
|
|
2929
|
-
return
|
|
2860
|
+
return h(a, {
|
|
2930
2861
|
code: c.invalid_type,
|
|
2931
|
-
expected:
|
|
2862
|
+
expected: _.number,
|
|
2932
2863
|
received: a.parsedType
|
|
2933
2864
|
}), y;
|
|
2934
2865
|
}
|
|
2935
2866
|
let n;
|
|
2936
2867
|
const s = new X();
|
|
2937
2868
|
for (const a of this._def.checks)
|
|
2938
|
-
a.kind === "int" ?
|
|
2869
|
+
a.kind === "int" ? S.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
2939
2870
|
code: c.invalid_type,
|
|
2940
2871
|
expected: "integer",
|
|
2941
2872
|
received: "float",
|
|
2942
2873
|
message: a.message
|
|
2943
|
-
}), s.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n),
|
|
2874
|
+
}), s.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), h(n, {
|
|
2944
2875
|
code: c.too_small,
|
|
2945
2876
|
minimum: a.value,
|
|
2946
2877
|
type: "number",
|
|
2947
2878
|
inclusive: a.inclusive,
|
|
2948
2879
|
exact: !1,
|
|
2949
2880
|
message: a.message
|
|
2950
|
-
}), s.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (n = this._getOrReturnCtx(e, n),
|
|
2881
|
+
}), s.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (n = this._getOrReturnCtx(e, n), h(n, {
|
|
2951
2882
|
code: c.too_big,
|
|
2952
2883
|
maximum: a.value,
|
|
2953
2884
|
type: "number",
|
|
2954
2885
|
inclusive: a.inclusive,
|
|
2955
2886
|
exact: !1,
|
|
2956
2887
|
message: a.message
|
|
2957
|
-
}), s.dirty()) : a.kind === "multipleOf" ?
|
|
2888
|
+
}), s.dirty()) : a.kind === "multipleOf" ? ui(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), h(n, {
|
|
2958
2889
|
code: c.not_multiple_of,
|
|
2959
2890
|
multipleOf: a.value,
|
|
2960
2891
|
message: a.message
|
|
2961
|
-
}), s.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n),
|
|
2892
|
+
}), s.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
2962
2893
|
code: c.not_finite,
|
|
2963
2894
|
message: a.message
|
|
2964
|
-
}), s.dirty()) :
|
|
2895
|
+
}), s.dirty()) : S.assertNever(a);
|
|
2965
2896
|
return { status: s.value, value: e.data };
|
|
2966
2897
|
}
|
|
2967
2898
|
gte(e, t) {
|
|
2968
|
-
return this.setLimit("min", e, !0,
|
|
2899
|
+
return this.setLimit("min", e, !0, g.toString(t));
|
|
2969
2900
|
}
|
|
2970
2901
|
gt(e, t) {
|
|
2971
|
-
return this.setLimit("min", e, !1,
|
|
2902
|
+
return this.setLimit("min", e, !1, g.toString(t));
|
|
2972
2903
|
}
|
|
2973
2904
|
lte(e, t) {
|
|
2974
|
-
return this.setLimit("max", e, !0,
|
|
2905
|
+
return this.setLimit("max", e, !0, g.toString(t));
|
|
2975
2906
|
}
|
|
2976
2907
|
lt(e, t) {
|
|
2977
|
-
return this.setLimit("max", e, !1,
|
|
2908
|
+
return this.setLimit("max", e, !1, g.toString(t));
|
|
2978
2909
|
}
|
|
2979
2910
|
setLimit(e, t, n, s) {
|
|
2980
2911
|
return new tt({
|
|
@@ -2985,7 +2916,7 @@ class tt extends C {
|
|
|
2985
2916
|
kind: e,
|
|
2986
2917
|
value: t,
|
|
2987
2918
|
inclusive: n,
|
|
2988
|
-
message:
|
|
2919
|
+
message: g.toString(s)
|
|
2989
2920
|
}
|
|
2990
2921
|
]
|
|
2991
2922
|
});
|
|
@@ -2999,7 +2930,7 @@ class tt extends C {
|
|
|
2999
2930
|
int(e) {
|
|
3000
2931
|
return this._addCheck({
|
|
3001
2932
|
kind: "int",
|
|
3002
|
-
message:
|
|
2933
|
+
message: g.toString(e)
|
|
3003
2934
|
});
|
|
3004
2935
|
}
|
|
3005
2936
|
positive(e) {
|
|
@@ -3007,7 +2938,7 @@ class tt extends C {
|
|
|
3007
2938
|
kind: "min",
|
|
3008
2939
|
value: 0,
|
|
3009
2940
|
inclusive: !1,
|
|
3010
|
-
message:
|
|
2941
|
+
message: g.toString(e)
|
|
3011
2942
|
});
|
|
3012
2943
|
}
|
|
3013
2944
|
negative(e) {
|
|
@@ -3015,7 +2946,7 @@ class tt extends C {
|
|
|
3015
2946
|
kind: "max",
|
|
3016
2947
|
value: 0,
|
|
3017
2948
|
inclusive: !1,
|
|
3018
|
-
message:
|
|
2949
|
+
message: g.toString(e)
|
|
3019
2950
|
});
|
|
3020
2951
|
}
|
|
3021
2952
|
nonpositive(e) {
|
|
@@ -3023,7 +2954,7 @@ class tt extends C {
|
|
|
3023
2954
|
kind: "max",
|
|
3024
2955
|
value: 0,
|
|
3025
2956
|
inclusive: !0,
|
|
3026
|
-
message:
|
|
2957
|
+
message: g.toString(e)
|
|
3027
2958
|
});
|
|
3028
2959
|
}
|
|
3029
2960
|
nonnegative(e) {
|
|
@@ -3031,20 +2962,20 @@ class tt extends C {
|
|
|
3031
2962
|
kind: "min",
|
|
3032
2963
|
value: 0,
|
|
3033
2964
|
inclusive: !0,
|
|
3034
|
-
message:
|
|
2965
|
+
message: g.toString(e)
|
|
3035
2966
|
});
|
|
3036
2967
|
}
|
|
3037
2968
|
multipleOf(e, t) {
|
|
3038
2969
|
return this._addCheck({
|
|
3039
2970
|
kind: "multipleOf",
|
|
3040
2971
|
value: e,
|
|
3041
|
-
message:
|
|
2972
|
+
message: g.toString(t)
|
|
3042
2973
|
});
|
|
3043
2974
|
}
|
|
3044
2975
|
finite(e) {
|
|
3045
2976
|
return this._addCheck({
|
|
3046
2977
|
kind: "finite",
|
|
3047
|
-
message:
|
|
2978
|
+
message: g.toString(e)
|
|
3048
2979
|
});
|
|
3049
2980
|
}
|
|
3050
2981
|
safe(e) {
|
|
@@ -3052,12 +2983,12 @@ class tt extends C {
|
|
|
3052
2983
|
kind: "min",
|
|
3053
2984
|
inclusive: !0,
|
|
3054
2985
|
value: Number.MIN_SAFE_INTEGER,
|
|
3055
|
-
message:
|
|
2986
|
+
message: g.toString(e)
|
|
3056
2987
|
})._addCheck({
|
|
3057
2988
|
kind: "max",
|
|
3058
2989
|
inclusive: !0,
|
|
3059
2990
|
value: Number.MAX_SAFE_INTEGER,
|
|
3060
|
-
message:
|
|
2991
|
+
message: g.toString(e)
|
|
3061
2992
|
});
|
|
3062
2993
|
}
|
|
3063
2994
|
get minValue() {
|
|
@@ -3073,7 +3004,7 @@ class tt extends C {
|
|
|
3073
3004
|
return e;
|
|
3074
3005
|
}
|
|
3075
3006
|
get isInt() {
|
|
3076
|
-
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" &&
|
|
3007
|
+
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && S.isInteger(e.value));
|
|
3077
3008
|
}
|
|
3078
3009
|
get isFinite() {
|
|
3079
3010
|
let e = null, t = null;
|
|
@@ -3102,49 +3033,49 @@ class wt extends C {
|
|
|
3102
3033
|
} catch {
|
|
3103
3034
|
return this._getInvalidInput(e);
|
|
3104
3035
|
}
|
|
3105
|
-
if (this._getType(e) !==
|
|
3036
|
+
if (this._getType(e) !== _.bigint)
|
|
3106
3037
|
return this._getInvalidInput(e);
|
|
3107
3038
|
let n;
|
|
3108
3039
|
const s = new X();
|
|
3109
3040
|
for (const a of this._def.checks)
|
|
3110
|
-
a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n),
|
|
3041
|
+
a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), h(n, {
|
|
3111
3042
|
code: c.too_small,
|
|
3112
3043
|
type: "bigint",
|
|
3113
3044
|
minimum: a.value,
|
|
3114
3045
|
inclusive: a.inclusive,
|
|
3115
3046
|
message: a.message
|
|
3116
|
-
}), s.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (n = this._getOrReturnCtx(e, n),
|
|
3047
|
+
}), s.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (n = this._getOrReturnCtx(e, n), h(n, {
|
|
3117
3048
|
code: c.too_big,
|
|
3118
3049
|
type: "bigint",
|
|
3119
3050
|
maximum: a.value,
|
|
3120
3051
|
inclusive: a.inclusive,
|
|
3121
3052
|
message: a.message
|
|
3122
|
-
}), s.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n),
|
|
3053
|
+
}), s.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n), h(n, {
|
|
3123
3054
|
code: c.not_multiple_of,
|
|
3124
3055
|
multipleOf: a.value,
|
|
3125
3056
|
message: a.message
|
|
3126
|
-
}), s.dirty()) :
|
|
3057
|
+
}), s.dirty()) : S.assertNever(a);
|
|
3127
3058
|
return { status: s.value, value: e.data };
|
|
3128
3059
|
}
|
|
3129
3060
|
_getInvalidInput(e) {
|
|
3130
3061
|
const t = this._getOrReturnCtx(e);
|
|
3131
|
-
return
|
|
3062
|
+
return h(t, {
|
|
3132
3063
|
code: c.invalid_type,
|
|
3133
|
-
expected:
|
|
3064
|
+
expected: _.bigint,
|
|
3134
3065
|
received: t.parsedType
|
|
3135
3066
|
}), y;
|
|
3136
3067
|
}
|
|
3137
3068
|
gte(e, t) {
|
|
3138
|
-
return this.setLimit("min", e, !0,
|
|
3069
|
+
return this.setLimit("min", e, !0, g.toString(t));
|
|
3139
3070
|
}
|
|
3140
3071
|
gt(e, t) {
|
|
3141
|
-
return this.setLimit("min", e, !1,
|
|
3072
|
+
return this.setLimit("min", e, !1, g.toString(t));
|
|
3142
3073
|
}
|
|
3143
3074
|
lte(e, t) {
|
|
3144
|
-
return this.setLimit("max", e, !0,
|
|
3075
|
+
return this.setLimit("max", e, !0, g.toString(t));
|
|
3145
3076
|
}
|
|
3146
3077
|
lt(e, t) {
|
|
3147
|
-
return this.setLimit("max", e, !1,
|
|
3078
|
+
return this.setLimit("max", e, !1, g.toString(t));
|
|
3148
3079
|
}
|
|
3149
3080
|
setLimit(e, t, n, s) {
|
|
3150
3081
|
return new wt({
|
|
@@ -3155,7 +3086,7 @@ class wt extends C {
|
|
|
3155
3086
|
kind: e,
|
|
3156
3087
|
value: t,
|
|
3157
3088
|
inclusive: n,
|
|
3158
|
-
message:
|
|
3089
|
+
message: g.toString(s)
|
|
3159
3090
|
}
|
|
3160
3091
|
]
|
|
3161
3092
|
});
|
|
@@ -3171,7 +3102,7 @@ class wt extends C {
|
|
|
3171
3102
|
kind: "min",
|
|
3172
3103
|
value: BigInt(0),
|
|
3173
3104
|
inclusive: !1,
|
|
3174
|
-
message:
|
|
3105
|
+
message: g.toString(e)
|
|
3175
3106
|
});
|
|
3176
3107
|
}
|
|
3177
3108
|
negative(e) {
|
|
@@ -3179,7 +3110,7 @@ class wt extends C {
|
|
|
3179
3110
|
kind: "max",
|
|
3180
3111
|
value: BigInt(0),
|
|
3181
3112
|
inclusive: !1,
|
|
3182
|
-
message:
|
|
3113
|
+
message: g.toString(e)
|
|
3183
3114
|
});
|
|
3184
3115
|
}
|
|
3185
3116
|
nonpositive(e) {
|
|
@@ -3187,7 +3118,7 @@ class wt extends C {
|
|
|
3187
3118
|
kind: "max",
|
|
3188
3119
|
value: BigInt(0),
|
|
3189
3120
|
inclusive: !0,
|
|
3190
|
-
message:
|
|
3121
|
+
message: g.toString(e)
|
|
3191
3122
|
});
|
|
3192
3123
|
}
|
|
3193
3124
|
nonnegative(e) {
|
|
@@ -3195,14 +3126,14 @@ class wt extends C {
|
|
|
3195
3126
|
kind: "min",
|
|
3196
3127
|
value: BigInt(0),
|
|
3197
3128
|
inclusive: !0,
|
|
3198
|
-
message:
|
|
3129
|
+
message: g.toString(e)
|
|
3199
3130
|
});
|
|
3200
3131
|
}
|
|
3201
3132
|
multipleOf(e, t) {
|
|
3202
3133
|
return this._addCheck({
|
|
3203
3134
|
kind: "multipleOf",
|
|
3204
3135
|
value: e,
|
|
3205
|
-
message:
|
|
3136
|
+
message: g.toString(t)
|
|
3206
3137
|
});
|
|
3207
3138
|
}
|
|
3208
3139
|
get minValue() {
|
|
@@ -3224,58 +3155,58 @@ wt.create = (r) => new wt({
|
|
|
3224
3155
|
coerce: (r == null ? void 0 : r.coerce) ?? !1,
|
|
3225
3156
|
...b(r)
|
|
3226
3157
|
});
|
|
3227
|
-
class
|
|
3158
|
+
class mr extends C {
|
|
3228
3159
|
_parse(e) {
|
|
3229
|
-
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !==
|
|
3160
|
+
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== _.boolean) {
|
|
3230
3161
|
const n = this._getOrReturnCtx(e);
|
|
3231
|
-
return
|
|
3162
|
+
return h(n, {
|
|
3232
3163
|
code: c.invalid_type,
|
|
3233
|
-
expected:
|
|
3164
|
+
expected: _.boolean,
|
|
3234
3165
|
received: n.parsedType
|
|
3235
3166
|
}), y;
|
|
3236
3167
|
}
|
|
3237
|
-
return
|
|
3168
|
+
return q(e.data);
|
|
3238
3169
|
}
|
|
3239
3170
|
}
|
|
3240
|
-
|
|
3171
|
+
mr.create = (r) => new mr({
|
|
3241
3172
|
typeName: w.ZodBoolean,
|
|
3242
3173
|
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
3243
3174
|
...b(r)
|
|
3244
3175
|
});
|
|
3245
3176
|
class Bt extends C {
|
|
3246
3177
|
_parse(e) {
|
|
3247
|
-
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !==
|
|
3178
|
+
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== _.date) {
|
|
3248
3179
|
const a = this._getOrReturnCtx(e);
|
|
3249
|
-
return
|
|
3180
|
+
return h(a, {
|
|
3250
3181
|
code: c.invalid_type,
|
|
3251
|
-
expected:
|
|
3182
|
+
expected: _.date,
|
|
3252
3183
|
received: a.parsedType
|
|
3253
3184
|
}), y;
|
|
3254
3185
|
}
|
|
3255
3186
|
if (Number.isNaN(e.data.getTime())) {
|
|
3256
3187
|
const a = this._getOrReturnCtx(e);
|
|
3257
|
-
return
|
|
3188
|
+
return h(a, {
|
|
3258
3189
|
code: c.invalid_date
|
|
3259
3190
|
}), y;
|
|
3260
3191
|
}
|
|
3261
3192
|
const n = new X();
|
|
3262
3193
|
let s;
|
|
3263
3194
|
for (const a of this._def.checks)
|
|
3264
|
-
a.kind === "min" ? e.data.getTime() < a.value && (s = this._getOrReturnCtx(e, s),
|
|
3195
|
+
a.kind === "min" ? e.data.getTime() < a.value && (s = this._getOrReturnCtx(e, s), h(s, {
|
|
3265
3196
|
code: c.too_small,
|
|
3266
3197
|
message: a.message,
|
|
3267
3198
|
inclusive: !0,
|
|
3268
3199
|
exact: !1,
|
|
3269
3200
|
minimum: a.value,
|
|
3270
3201
|
type: "date"
|
|
3271
|
-
}), n.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (s = this._getOrReturnCtx(e, s),
|
|
3202
|
+
}), n.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (s = this._getOrReturnCtx(e, s), h(s, {
|
|
3272
3203
|
code: c.too_big,
|
|
3273
3204
|
message: a.message,
|
|
3274
3205
|
inclusive: !0,
|
|
3275
3206
|
exact: !1,
|
|
3276
3207
|
maximum: a.value,
|
|
3277
3208
|
type: "date"
|
|
3278
|
-
}), n.dirty()) :
|
|
3209
|
+
}), n.dirty()) : S.assertNever(a);
|
|
3279
3210
|
return {
|
|
3280
3211
|
status: n.value,
|
|
3281
3212
|
value: new Date(e.data.getTime())
|
|
@@ -3291,14 +3222,14 @@ class Bt extends C {
|
|
|
3291
3222
|
return this._addCheck({
|
|
3292
3223
|
kind: "min",
|
|
3293
3224
|
value: e.getTime(),
|
|
3294
|
-
message:
|
|
3225
|
+
message: g.toString(t)
|
|
3295
3226
|
});
|
|
3296
3227
|
}
|
|
3297
3228
|
max(e, t) {
|
|
3298
3229
|
return this._addCheck({
|
|
3299
3230
|
kind: "max",
|
|
3300
3231
|
value: e.getTime(),
|
|
3301
|
-
message:
|
|
3232
|
+
message: g.toString(t)
|
|
3302
3233
|
});
|
|
3303
3234
|
}
|
|
3304
3235
|
get minDate() {
|
|
@@ -3320,66 +3251,66 @@ Bt.create = (r) => new Bt({
|
|
|
3320
3251
|
typeName: w.ZodDate,
|
|
3321
3252
|
...b(r)
|
|
3322
3253
|
});
|
|
3323
|
-
class
|
|
3254
|
+
class fn extends C {
|
|
3324
3255
|
_parse(e) {
|
|
3325
|
-
if (this._getType(e) !==
|
|
3256
|
+
if (this._getType(e) !== _.symbol) {
|
|
3326
3257
|
const n = this._getOrReturnCtx(e);
|
|
3327
|
-
return
|
|
3258
|
+
return h(n, {
|
|
3328
3259
|
code: c.invalid_type,
|
|
3329
|
-
expected:
|
|
3260
|
+
expected: _.symbol,
|
|
3330
3261
|
received: n.parsedType
|
|
3331
3262
|
}), y;
|
|
3332
3263
|
}
|
|
3333
|
-
return
|
|
3264
|
+
return q(e.data);
|
|
3334
3265
|
}
|
|
3335
3266
|
}
|
|
3336
|
-
|
|
3267
|
+
fn.create = (r) => new fn({
|
|
3337
3268
|
typeName: w.ZodSymbol,
|
|
3338
3269
|
...b(r)
|
|
3339
3270
|
});
|
|
3340
|
-
class
|
|
3271
|
+
class hn extends C {
|
|
3341
3272
|
_parse(e) {
|
|
3342
|
-
if (this._getType(e) !==
|
|
3273
|
+
if (this._getType(e) !== _.undefined) {
|
|
3343
3274
|
const n = this._getOrReturnCtx(e);
|
|
3344
|
-
return
|
|
3275
|
+
return h(n, {
|
|
3345
3276
|
code: c.invalid_type,
|
|
3346
|
-
expected:
|
|
3277
|
+
expected: _.undefined,
|
|
3347
3278
|
received: n.parsedType
|
|
3348
3279
|
}), y;
|
|
3349
3280
|
}
|
|
3350
|
-
return
|
|
3281
|
+
return q(e.data);
|
|
3351
3282
|
}
|
|
3352
3283
|
}
|
|
3353
|
-
|
|
3284
|
+
hn.create = (r) => new hn({
|
|
3354
3285
|
typeName: w.ZodUndefined,
|
|
3355
3286
|
...b(r)
|
|
3356
3287
|
});
|
|
3357
|
-
class
|
|
3288
|
+
class pn extends C {
|
|
3358
3289
|
_parse(e) {
|
|
3359
|
-
if (this._getType(e) !==
|
|
3290
|
+
if (this._getType(e) !== _.null) {
|
|
3360
3291
|
const n = this._getOrReturnCtx(e);
|
|
3361
|
-
return
|
|
3292
|
+
return h(n, {
|
|
3362
3293
|
code: c.invalid_type,
|
|
3363
|
-
expected:
|
|
3294
|
+
expected: _.null,
|
|
3364
3295
|
received: n.parsedType
|
|
3365
3296
|
}), y;
|
|
3366
3297
|
}
|
|
3367
|
-
return
|
|
3298
|
+
return q(e.data);
|
|
3368
3299
|
}
|
|
3369
3300
|
}
|
|
3370
|
-
|
|
3301
|
+
pn.create = (r) => new pn({
|
|
3371
3302
|
typeName: w.ZodNull,
|
|
3372
3303
|
...b(r)
|
|
3373
3304
|
});
|
|
3374
|
-
class
|
|
3305
|
+
class vr extends C {
|
|
3375
3306
|
constructor() {
|
|
3376
3307
|
super(...arguments), this._any = !0;
|
|
3377
3308
|
}
|
|
3378
3309
|
_parse(e) {
|
|
3379
|
-
return
|
|
3310
|
+
return q(e.data);
|
|
3380
3311
|
}
|
|
3381
3312
|
}
|
|
3382
|
-
|
|
3313
|
+
vr.create = (r) => new vr({
|
|
3383
3314
|
typeName: w.ZodAny,
|
|
3384
3315
|
...b(r)
|
|
3385
3316
|
});
|
|
@@ -3388,7 +3319,7 @@ class qe extends C {
|
|
|
3388
3319
|
super(...arguments), this._unknown = !0;
|
|
3389
3320
|
}
|
|
3390
3321
|
_parse(e) {
|
|
3391
|
-
return
|
|
3322
|
+
return q(e.data);
|
|
3392
3323
|
}
|
|
3393
3324
|
}
|
|
3394
3325
|
qe.create = (r) => new qe({
|
|
@@ -3398,9 +3329,9 @@ qe.create = (r) => new qe({
|
|
|
3398
3329
|
class be extends C {
|
|
3399
3330
|
_parse(e) {
|
|
3400
3331
|
const t = this._getOrReturnCtx(e);
|
|
3401
|
-
return
|
|
3332
|
+
return h(t, {
|
|
3402
3333
|
code: c.invalid_type,
|
|
3403
|
-
expected:
|
|
3334
|
+
expected: _.never,
|
|
3404
3335
|
received: t.parsedType
|
|
3405
3336
|
}), y;
|
|
3406
3337
|
}
|
|
@@ -3409,35 +3340,35 @@ be.create = (r) => new be({
|
|
|
3409
3340
|
typeName: w.ZodNever,
|
|
3410
3341
|
...b(r)
|
|
3411
3342
|
});
|
|
3412
|
-
class
|
|
3343
|
+
class _r extends C {
|
|
3413
3344
|
_parse(e) {
|
|
3414
|
-
if (this._getType(e) !==
|
|
3345
|
+
if (this._getType(e) !== _.undefined) {
|
|
3415
3346
|
const n = this._getOrReturnCtx(e);
|
|
3416
|
-
return
|
|
3347
|
+
return h(n, {
|
|
3417
3348
|
code: c.invalid_type,
|
|
3418
|
-
expected:
|
|
3349
|
+
expected: _.void,
|
|
3419
3350
|
received: n.parsedType
|
|
3420
3351
|
}), y;
|
|
3421
3352
|
}
|
|
3422
|
-
return
|
|
3353
|
+
return q(e.data);
|
|
3423
3354
|
}
|
|
3424
3355
|
}
|
|
3425
|
-
|
|
3356
|
+
_r.create = (r) => new _r({
|
|
3426
3357
|
typeName: w.ZodVoid,
|
|
3427
3358
|
...b(r)
|
|
3428
3359
|
});
|
|
3429
|
-
class
|
|
3360
|
+
class ie extends C {
|
|
3430
3361
|
_parse(e) {
|
|
3431
3362
|
const { ctx: t, status: n } = this._processInputParams(e), s = this._def;
|
|
3432
|
-
if (t.parsedType !==
|
|
3433
|
-
return
|
|
3363
|
+
if (t.parsedType !== _.array)
|
|
3364
|
+
return h(t, {
|
|
3434
3365
|
code: c.invalid_type,
|
|
3435
|
-
expected:
|
|
3366
|
+
expected: _.array,
|
|
3436
3367
|
received: t.parsedType
|
|
3437
3368
|
}), y;
|
|
3438
3369
|
if (s.exactLength !== null) {
|
|
3439
3370
|
const i = t.data.length > s.exactLength.value, o = t.data.length < s.exactLength.value;
|
|
3440
|
-
(i || o) && (
|
|
3371
|
+
(i || o) && (h(t, {
|
|
3441
3372
|
code: i ? c.too_big : c.too_small,
|
|
3442
3373
|
minimum: o ? s.exactLength.value : void 0,
|
|
3443
3374
|
maximum: i ? s.exactLength.value : void 0,
|
|
@@ -3447,14 +3378,14 @@ class oe extends C {
|
|
|
3447
3378
|
message: s.exactLength.message
|
|
3448
3379
|
}), n.dirty());
|
|
3449
3380
|
}
|
|
3450
|
-
if (s.minLength !== null && t.data.length < s.minLength.value && (
|
|
3381
|
+
if (s.minLength !== null && t.data.length < s.minLength.value && (h(t, {
|
|
3451
3382
|
code: c.too_small,
|
|
3452
3383
|
minimum: s.minLength.value,
|
|
3453
3384
|
type: "array",
|
|
3454
3385
|
inclusive: !0,
|
|
3455
3386
|
exact: !1,
|
|
3456
3387
|
message: s.minLength.message
|
|
3457
|
-
}), n.dirty()), s.maxLength !== null && t.data.length > s.maxLength.value && (
|
|
3388
|
+
}), n.dirty()), s.maxLength !== null && t.data.length > s.maxLength.value && (h(t, {
|
|
3458
3389
|
code: c.too_big,
|
|
3459
3390
|
maximum: s.maxLength.value,
|
|
3460
3391
|
type: "array",
|
|
@@ -3462,36 +3393,36 @@ class oe extends C {
|
|
|
3462
3393
|
exact: !1,
|
|
3463
3394
|
message: s.maxLength.message
|
|
3464
3395
|
}), n.dirty()), t.common.async)
|
|
3465
|
-
return Promise.all([...t.data].map((i, o) => s.type._parseAsync(new
|
|
3466
|
-
const a = [...t.data].map((i, o) => s.type._parseSync(new
|
|
3396
|
+
return Promise.all([...t.data].map((i, o) => s.type._parseAsync(new ke(t, i, t.path, o)))).then((i) => X.mergeArray(n, i));
|
|
3397
|
+
const a = [...t.data].map((i, o) => s.type._parseSync(new ke(t, i, t.path, o)));
|
|
3467
3398
|
return X.mergeArray(n, a);
|
|
3468
3399
|
}
|
|
3469
3400
|
get element() {
|
|
3470
3401
|
return this._def.type;
|
|
3471
3402
|
}
|
|
3472
3403
|
min(e, t) {
|
|
3473
|
-
return new
|
|
3404
|
+
return new ie({
|
|
3474
3405
|
...this._def,
|
|
3475
|
-
minLength: { value: e, message:
|
|
3406
|
+
minLength: { value: e, message: g.toString(t) }
|
|
3476
3407
|
});
|
|
3477
3408
|
}
|
|
3478
3409
|
max(e, t) {
|
|
3479
|
-
return new
|
|
3410
|
+
return new ie({
|
|
3480
3411
|
...this._def,
|
|
3481
|
-
maxLength: { value: e, message:
|
|
3412
|
+
maxLength: { value: e, message: g.toString(t) }
|
|
3482
3413
|
});
|
|
3483
3414
|
}
|
|
3484
3415
|
length(e, t) {
|
|
3485
|
-
return new
|
|
3416
|
+
return new ie({
|
|
3486
3417
|
...this._def,
|
|
3487
|
-
exactLength: { value: e, message:
|
|
3418
|
+
exactLength: { value: e, message: g.toString(t) }
|
|
3488
3419
|
});
|
|
3489
3420
|
}
|
|
3490
3421
|
nonempty(e) {
|
|
3491
3422
|
return this.min(1, e);
|
|
3492
3423
|
}
|
|
3493
3424
|
}
|
|
3494
|
-
|
|
3425
|
+
ie.create = (r, e) => new ie({
|
|
3495
3426
|
type: r,
|
|
3496
3427
|
minLength: null,
|
|
3497
3428
|
maxLength: null,
|
|
@@ -3500,37 +3431,37 @@ oe.create = (r, e) => new oe({
|
|
|
3500
3431
|
...b(e)
|
|
3501
3432
|
});
|
|
3502
3433
|
function Fe(r) {
|
|
3503
|
-
if (r instanceof
|
|
3434
|
+
if (r instanceof R) {
|
|
3504
3435
|
const e = {};
|
|
3505
3436
|
for (const t in r.shape) {
|
|
3506
3437
|
const n = r.shape[t];
|
|
3507
3438
|
e[t] = we.create(Fe(n));
|
|
3508
3439
|
}
|
|
3509
|
-
return new
|
|
3440
|
+
return new R({
|
|
3510
3441
|
...r._def,
|
|
3511
3442
|
shape: () => e
|
|
3512
3443
|
});
|
|
3513
|
-
} else return r instanceof
|
|
3444
|
+
} else return r instanceof ie ? new ie({
|
|
3514
3445
|
...r._def,
|
|
3515
3446
|
type: Fe(r.element)
|
|
3516
3447
|
}) : r instanceof we ? we.create(Fe(r.unwrap())) : r instanceof st ? st.create(Fe(r.unwrap())) : r instanceof fe ? fe.create(r.items.map((e) => Fe(e))) : r;
|
|
3517
3448
|
}
|
|
3518
|
-
class
|
|
3449
|
+
class R extends C {
|
|
3519
3450
|
constructor() {
|
|
3520
3451
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
3521
3452
|
}
|
|
3522
3453
|
_getCached() {
|
|
3523
3454
|
if (this._cached !== null)
|
|
3524
3455
|
return this._cached;
|
|
3525
|
-
const e = this._def.shape(), t =
|
|
3456
|
+
const e = this._def.shape(), t = S.objectKeys(e);
|
|
3526
3457
|
return this._cached = { shape: e, keys: t }, this._cached;
|
|
3527
3458
|
}
|
|
3528
3459
|
_parse(e) {
|
|
3529
|
-
if (this._getType(e) !==
|
|
3460
|
+
if (this._getType(e) !== _.object) {
|
|
3530
3461
|
const u = this._getOrReturnCtx(e);
|
|
3531
|
-
return
|
|
3462
|
+
return h(u, {
|
|
3532
3463
|
code: c.invalid_type,
|
|
3533
|
-
expected:
|
|
3464
|
+
expected: _.object,
|
|
3534
3465
|
received: u.parsedType
|
|
3535
3466
|
}), y;
|
|
3536
3467
|
}
|
|
@@ -3540,10 +3471,10 @@ class P extends C {
|
|
|
3540
3471
|
i.includes(u) || o.push(u);
|
|
3541
3472
|
const l = [];
|
|
3542
3473
|
for (const u of i) {
|
|
3543
|
-
const d = a[u],
|
|
3474
|
+
const d = a[u], p = s.data[u];
|
|
3544
3475
|
l.push({
|
|
3545
3476
|
key: { status: "valid", value: u },
|
|
3546
|
-
value: d._parse(new
|
|
3477
|
+
value: d._parse(new ke(s, p, s.path, u)),
|
|
3547
3478
|
alwaysSet: u in s.data
|
|
3548
3479
|
});
|
|
3549
3480
|
}
|
|
@@ -3556,7 +3487,7 @@ class P extends C {
|
|
|
3556
3487
|
value: { status: "valid", value: s.data[d] }
|
|
3557
3488
|
});
|
|
3558
3489
|
else if (u === "strict")
|
|
3559
|
-
o.length > 0 && (
|
|
3490
|
+
o.length > 0 && (h(s, {
|
|
3560
3491
|
code: c.unrecognized_keys,
|
|
3561
3492
|
keys: o
|
|
3562
3493
|
}), n.dirty());
|
|
@@ -3564,11 +3495,11 @@ class P extends C {
|
|
|
3564
3495
|
} else {
|
|
3565
3496
|
const u = this._def.catchall;
|
|
3566
3497
|
for (const d of o) {
|
|
3567
|
-
const
|
|
3498
|
+
const p = s.data[d];
|
|
3568
3499
|
l.push({
|
|
3569
3500
|
key: { status: "valid", value: d },
|
|
3570
3501
|
value: u._parse(
|
|
3571
|
-
new
|
|
3502
|
+
new ke(s, p, s.path, d)
|
|
3572
3503
|
//, ctx.child(key), value, getParsedType(value)
|
|
3573
3504
|
),
|
|
3574
3505
|
alwaysSet: d in s.data
|
|
@@ -3578,10 +3509,10 @@ class P extends C {
|
|
|
3578
3509
|
return s.common.async ? Promise.resolve().then(async () => {
|
|
3579
3510
|
const u = [];
|
|
3580
3511
|
for (const d of l) {
|
|
3581
|
-
const
|
|
3512
|
+
const p = await d.key, v = await d.value;
|
|
3582
3513
|
u.push({
|
|
3583
|
-
key:
|
|
3584
|
-
value:
|
|
3514
|
+
key: p,
|
|
3515
|
+
value: v,
|
|
3585
3516
|
alwaysSet: d.alwaysSet
|
|
3586
3517
|
});
|
|
3587
3518
|
}
|
|
@@ -3592,7 +3523,7 @@ class P extends C {
|
|
|
3592
3523
|
return this._def.shape();
|
|
3593
3524
|
}
|
|
3594
3525
|
strict(e) {
|
|
3595
|
-
return
|
|
3526
|
+
return g.errToObj, new R({
|
|
3596
3527
|
...this._def,
|
|
3597
3528
|
unknownKeys: "strict",
|
|
3598
3529
|
...e !== void 0 ? {
|
|
@@ -3600,7 +3531,7 @@ class P extends C {
|
|
|
3600
3531
|
var a, i;
|
|
3601
3532
|
const s = ((i = (a = this._def).errorMap) == null ? void 0 : i.call(a, t, n).message) ?? n.defaultError;
|
|
3602
3533
|
return t.code === "unrecognized_keys" ? {
|
|
3603
|
-
message:
|
|
3534
|
+
message: g.errToObj(e).message ?? s
|
|
3604
3535
|
} : {
|
|
3605
3536
|
message: s
|
|
3606
3537
|
};
|
|
@@ -3609,13 +3540,13 @@ class P extends C {
|
|
|
3609
3540
|
});
|
|
3610
3541
|
}
|
|
3611
3542
|
strip() {
|
|
3612
|
-
return new
|
|
3543
|
+
return new R({
|
|
3613
3544
|
...this._def,
|
|
3614
3545
|
unknownKeys: "strip"
|
|
3615
3546
|
});
|
|
3616
3547
|
}
|
|
3617
3548
|
passthrough() {
|
|
3618
|
-
return new
|
|
3549
|
+
return new R({
|
|
3619
3550
|
...this._def,
|
|
3620
3551
|
unknownKeys: "passthrough"
|
|
3621
3552
|
});
|
|
@@ -3638,7 +3569,7 @@ class P extends C {
|
|
|
3638
3569
|
// }) as any;
|
|
3639
3570
|
// };
|
|
3640
3571
|
extend(e) {
|
|
3641
|
-
return new
|
|
3572
|
+
return new R({
|
|
3642
3573
|
...this._def,
|
|
3643
3574
|
shape: () => ({
|
|
3644
3575
|
...this._def.shape(),
|
|
@@ -3652,7 +3583,7 @@ class P extends C {
|
|
|
3652
3583
|
* upgrade if you are experiencing issues.
|
|
3653
3584
|
*/
|
|
3654
3585
|
merge(e) {
|
|
3655
|
-
return new
|
|
3586
|
+
return new R({
|
|
3656
3587
|
unknownKeys: e._def.unknownKeys,
|
|
3657
3588
|
catchall: e._def.catchall,
|
|
3658
3589
|
shape: () => ({
|
|
@@ -3722,25 +3653,25 @@ class P extends C {
|
|
|
3722
3653
|
// return merged;
|
|
3723
3654
|
// }
|
|
3724
3655
|
catchall(e) {
|
|
3725
|
-
return new
|
|
3656
|
+
return new R({
|
|
3726
3657
|
...this._def,
|
|
3727
3658
|
catchall: e
|
|
3728
3659
|
});
|
|
3729
3660
|
}
|
|
3730
3661
|
pick(e) {
|
|
3731
3662
|
const t = {};
|
|
3732
|
-
for (const n of
|
|
3663
|
+
for (const n of S.objectKeys(e))
|
|
3733
3664
|
e[n] && this.shape[n] && (t[n] = this.shape[n]);
|
|
3734
|
-
return new
|
|
3665
|
+
return new R({
|
|
3735
3666
|
...this._def,
|
|
3736
3667
|
shape: () => t
|
|
3737
3668
|
});
|
|
3738
3669
|
}
|
|
3739
3670
|
omit(e) {
|
|
3740
3671
|
const t = {};
|
|
3741
|
-
for (const n of
|
|
3672
|
+
for (const n of S.objectKeys(this.shape))
|
|
3742
3673
|
e[n] || (t[n] = this.shape[n]);
|
|
3743
|
-
return new
|
|
3674
|
+
return new R({
|
|
3744
3675
|
...this._def,
|
|
3745
3676
|
shape: () => t
|
|
3746
3677
|
});
|
|
@@ -3753,18 +3684,18 @@ class P extends C {
|
|
|
3753
3684
|
}
|
|
3754
3685
|
partial(e) {
|
|
3755
3686
|
const t = {};
|
|
3756
|
-
for (const n of
|
|
3687
|
+
for (const n of S.objectKeys(this.shape)) {
|
|
3757
3688
|
const s = this.shape[n];
|
|
3758
3689
|
e && !e[n] ? t[n] = s : t[n] = s.optional();
|
|
3759
3690
|
}
|
|
3760
|
-
return new
|
|
3691
|
+
return new R({
|
|
3761
3692
|
...this._def,
|
|
3762
3693
|
shape: () => t
|
|
3763
3694
|
});
|
|
3764
3695
|
}
|
|
3765
3696
|
required(e) {
|
|
3766
3697
|
const t = {};
|
|
3767
|
-
for (const n of
|
|
3698
|
+
for (const n of S.objectKeys(this.shape))
|
|
3768
3699
|
if (e && !e[n])
|
|
3769
3700
|
t[n] = this.shape[n];
|
|
3770
3701
|
else {
|
|
@@ -3773,30 +3704,30 @@ class P extends C {
|
|
|
3773
3704
|
a = a._def.innerType;
|
|
3774
3705
|
t[n] = a;
|
|
3775
3706
|
}
|
|
3776
|
-
return new
|
|
3707
|
+
return new R({
|
|
3777
3708
|
...this._def,
|
|
3778
3709
|
shape: () => t
|
|
3779
3710
|
});
|
|
3780
3711
|
}
|
|
3781
3712
|
keyof() {
|
|
3782
|
-
return
|
|
3713
|
+
return us(S.objectKeys(this.shape));
|
|
3783
3714
|
}
|
|
3784
3715
|
}
|
|
3785
|
-
|
|
3716
|
+
R.create = (r, e) => new R({
|
|
3786
3717
|
shape: () => r,
|
|
3787
3718
|
unknownKeys: "strip",
|
|
3788
3719
|
catchall: be.create(),
|
|
3789
3720
|
typeName: w.ZodObject,
|
|
3790
3721
|
...b(e)
|
|
3791
3722
|
});
|
|
3792
|
-
|
|
3723
|
+
R.strictCreate = (r, e) => new R({
|
|
3793
3724
|
shape: () => r,
|
|
3794
3725
|
unknownKeys: "strict",
|
|
3795
3726
|
catchall: be.create(),
|
|
3796
3727
|
typeName: w.ZodObject,
|
|
3797
3728
|
...b(e)
|
|
3798
3729
|
});
|
|
3799
|
-
|
|
3730
|
+
R.lazycreate = (r, e) => new R({
|
|
3800
3731
|
shape: r,
|
|
3801
3732
|
unknownKeys: "strip",
|
|
3802
3733
|
catchall: be.create(),
|
|
@@ -3813,8 +3744,8 @@ class $t extends C {
|
|
|
3813
3744
|
for (const o of a)
|
|
3814
3745
|
if (o.result.status === "dirty")
|
|
3815
3746
|
return t.common.issues.push(...o.ctx.common.issues), o.result;
|
|
3816
|
-
const i = a.map((o) => new
|
|
3817
|
-
return
|
|
3747
|
+
const i = a.map((o) => new Q(o.ctx.common.issues));
|
|
3748
|
+
return h(t, {
|
|
3818
3749
|
code: c.invalid_union,
|
|
3819
3750
|
unionErrors: i
|
|
3820
3751
|
}), y;
|
|
@@ -3860,8 +3791,8 @@ class $t extends C {
|
|
|
3860
3791
|
}
|
|
3861
3792
|
if (a)
|
|
3862
3793
|
return t.common.issues.push(...a.ctx.common.issues), a.result;
|
|
3863
|
-
const o = i.map((l) => new
|
|
3864
|
-
return
|
|
3794
|
+
const o = i.map((l) => new Q(l));
|
|
3795
|
+
return h(t, {
|
|
3865
3796
|
code: c.invalid_union,
|
|
3866
3797
|
unionErrors: o
|
|
3867
3798
|
}), y;
|
|
@@ -3876,39 +3807,39 @@ $t.create = (r, e) => new $t({
|
|
|
3876
3807
|
typeName: w.ZodUnion,
|
|
3877
3808
|
...b(e)
|
|
3878
3809
|
});
|
|
3879
|
-
function
|
|
3810
|
+
function gr(r, e) {
|
|
3880
3811
|
const t = he(r), n = he(e);
|
|
3881
3812
|
if (r === e)
|
|
3882
3813
|
return { valid: !0, data: r };
|
|
3883
|
-
if (t ===
|
|
3884
|
-
const s =
|
|
3814
|
+
if (t === _.object && n === _.object) {
|
|
3815
|
+
const s = S.objectKeys(e), a = S.objectKeys(r).filter((o) => s.indexOf(o) !== -1), i = { ...r, ...e };
|
|
3885
3816
|
for (const o of a) {
|
|
3886
|
-
const l =
|
|
3817
|
+
const l = gr(r[o], e[o]);
|
|
3887
3818
|
if (!l.valid)
|
|
3888
3819
|
return { valid: !1 };
|
|
3889
3820
|
i[o] = l.data;
|
|
3890
3821
|
}
|
|
3891
3822
|
return { valid: !0, data: i };
|
|
3892
|
-
} else if (t ===
|
|
3823
|
+
} else if (t === _.array && n === _.array) {
|
|
3893
3824
|
if (r.length !== e.length)
|
|
3894
3825
|
return { valid: !1 };
|
|
3895
3826
|
const s = [];
|
|
3896
3827
|
for (let a = 0; a < r.length; a++) {
|
|
3897
|
-
const i = r[a], o = e[a], l =
|
|
3828
|
+
const i = r[a], o = e[a], l = gr(i, o);
|
|
3898
3829
|
if (!l.valid)
|
|
3899
3830
|
return { valid: !1 };
|
|
3900
3831
|
s.push(l.data);
|
|
3901
3832
|
}
|
|
3902
3833
|
return { valid: !0, data: s };
|
|
3903
|
-
} else return t ===
|
|
3834
|
+
} else return t === _.date && n === _.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
|
|
3904
3835
|
}
|
|
3905
3836
|
class qt extends C {
|
|
3906
3837
|
_parse(e) {
|
|
3907
3838
|
const { status: t, ctx: n } = this._processInputParams(e), s = (a, i) => {
|
|
3908
|
-
if (
|
|
3839
|
+
if (un(a) || un(i))
|
|
3909
3840
|
return y;
|
|
3910
|
-
const o =
|
|
3911
|
-
return o.valid ? ((
|
|
3841
|
+
const o = gr(a.value, i.value);
|
|
3842
|
+
return o.valid ? ((dn(a) || dn(i)) && t.dirty(), { status: t.value, value: o.data }) : (h(n, {
|
|
3912
3843
|
code: c.invalid_intersection_types
|
|
3913
3844
|
}), y);
|
|
3914
3845
|
};
|
|
@@ -3943,21 +3874,21 @@ qt.create = (r, e, t) => new qt({
|
|
|
3943
3874
|
class fe extends C {
|
|
3944
3875
|
_parse(e) {
|
|
3945
3876
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
3946
|
-
if (n.parsedType !==
|
|
3947
|
-
return
|
|
3877
|
+
if (n.parsedType !== _.array)
|
|
3878
|
+
return h(n, {
|
|
3948
3879
|
code: c.invalid_type,
|
|
3949
|
-
expected:
|
|
3880
|
+
expected: _.array,
|
|
3950
3881
|
received: n.parsedType
|
|
3951
3882
|
}), y;
|
|
3952
3883
|
if (n.data.length < this._def.items.length)
|
|
3953
|
-
return
|
|
3884
|
+
return h(n, {
|
|
3954
3885
|
code: c.too_small,
|
|
3955
3886
|
minimum: this._def.items.length,
|
|
3956
3887
|
inclusive: !0,
|
|
3957
3888
|
exact: !1,
|
|
3958
3889
|
type: "array"
|
|
3959
3890
|
}), y;
|
|
3960
|
-
!this._def.rest && n.data.length > this._def.items.length && (
|
|
3891
|
+
!this._def.rest && n.data.length > this._def.items.length && (h(n, {
|
|
3961
3892
|
code: c.too_big,
|
|
3962
3893
|
maximum: this._def.items.length,
|
|
3963
3894
|
inclusive: !0,
|
|
@@ -3966,7 +3897,7 @@ class fe extends C {
|
|
|
3966
3897
|
}), t.dirty());
|
|
3967
3898
|
const a = [...n.data].map((i, o) => {
|
|
3968
3899
|
const l = this._def.items[o] || this._def.rest;
|
|
3969
|
-
return l ? l._parse(new
|
|
3900
|
+
return l ? l._parse(new ke(n, i, n.path, o)) : null;
|
|
3970
3901
|
}).filter((i) => !!i);
|
|
3971
3902
|
return n.common.async ? Promise.all(a).then((i) => X.mergeArray(t, i)) : X.mergeArray(t, a);
|
|
3972
3903
|
}
|
|
@@ -3990,7 +3921,7 @@ fe.create = (r, e) => {
|
|
|
3990
3921
|
...b(e)
|
|
3991
3922
|
});
|
|
3992
3923
|
};
|
|
3993
|
-
class
|
|
3924
|
+
class mn extends C {
|
|
3994
3925
|
get keySchema() {
|
|
3995
3926
|
return this._def.keyType;
|
|
3996
3927
|
}
|
|
@@ -3999,15 +3930,15 @@ class wn extends C {
|
|
|
3999
3930
|
}
|
|
4000
3931
|
_parse(e) {
|
|
4001
3932
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
4002
|
-
if (n.parsedType !==
|
|
4003
|
-
return
|
|
3933
|
+
if (n.parsedType !== _.map)
|
|
3934
|
+
return h(n, {
|
|
4004
3935
|
code: c.invalid_type,
|
|
4005
|
-
expected:
|
|
3936
|
+
expected: _.map,
|
|
4006
3937
|
received: n.parsedType
|
|
4007
3938
|
}), y;
|
|
4008
3939
|
const s = this._def.keyType, a = this._def.valueType, i = [...n.data.entries()].map(([o, l], u) => ({
|
|
4009
|
-
key: s._parse(new
|
|
4010
|
-
value: a._parse(new
|
|
3940
|
+
key: s._parse(new ke(n, o, n.path, [u, "key"])),
|
|
3941
|
+
value: a._parse(new ke(n, l, n.path, [u, "value"]))
|
|
4011
3942
|
}));
|
|
4012
3943
|
if (n.common.async) {
|
|
4013
3944
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -4032,30 +3963,30 @@ class wn extends C {
|
|
|
4032
3963
|
}
|
|
4033
3964
|
}
|
|
4034
3965
|
}
|
|
4035
|
-
|
|
3966
|
+
mn.create = (r, e, t) => new mn({
|
|
4036
3967
|
valueType: e,
|
|
4037
3968
|
keyType: r,
|
|
4038
3969
|
typeName: w.ZodMap,
|
|
4039
3970
|
...b(t)
|
|
4040
3971
|
});
|
|
4041
|
-
class
|
|
3972
|
+
class xt extends C {
|
|
4042
3973
|
_parse(e) {
|
|
4043
3974
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
4044
|
-
if (n.parsedType !==
|
|
4045
|
-
return
|
|
3975
|
+
if (n.parsedType !== _.set)
|
|
3976
|
+
return h(n, {
|
|
4046
3977
|
code: c.invalid_type,
|
|
4047
|
-
expected:
|
|
3978
|
+
expected: _.set,
|
|
4048
3979
|
received: n.parsedType
|
|
4049
3980
|
}), y;
|
|
4050
3981
|
const s = this._def;
|
|
4051
|
-
s.minSize !== null && n.data.size < s.minSize.value && (
|
|
3982
|
+
s.minSize !== null && n.data.size < s.minSize.value && (h(n, {
|
|
4052
3983
|
code: c.too_small,
|
|
4053
3984
|
minimum: s.minSize.value,
|
|
4054
3985
|
type: "set",
|
|
4055
3986
|
inclusive: !0,
|
|
4056
3987
|
exact: !1,
|
|
4057
3988
|
message: s.minSize.message
|
|
4058
|
-
}), t.dirty()), s.maxSize !== null && n.data.size > s.maxSize.value && (
|
|
3989
|
+
}), t.dirty()), s.maxSize !== null && n.data.size > s.maxSize.value && (h(n, {
|
|
4059
3990
|
code: c.too_big,
|
|
4060
3991
|
maximum: s.maxSize.value,
|
|
4061
3992
|
type: "set",
|
|
@@ -4073,19 +4004,19 @@ class kt extends C {
|
|
|
4073
4004
|
}
|
|
4074
4005
|
return { status: t.value, value: u };
|
|
4075
4006
|
}
|
|
4076
|
-
const o = [...n.data.values()].map((l, u) => a._parse(new
|
|
4007
|
+
const o = [...n.data.values()].map((l, u) => a._parse(new ke(n, l, n.path, u)));
|
|
4077
4008
|
return n.common.async ? Promise.all(o).then((l) => i(l)) : i(o);
|
|
4078
4009
|
}
|
|
4079
4010
|
min(e, t) {
|
|
4080
|
-
return new
|
|
4011
|
+
return new xt({
|
|
4081
4012
|
...this._def,
|
|
4082
|
-
minSize: { value: e, message:
|
|
4013
|
+
minSize: { value: e, message: g.toString(t) }
|
|
4083
4014
|
});
|
|
4084
4015
|
}
|
|
4085
4016
|
max(e, t) {
|
|
4086
|
-
return new
|
|
4017
|
+
return new xt({
|
|
4087
4018
|
...this._def,
|
|
4088
|
-
maxSize: { value: e, message:
|
|
4019
|
+
maxSize: { value: e, message: g.toString(t) }
|
|
4089
4020
|
});
|
|
4090
4021
|
}
|
|
4091
4022
|
size(e, t) {
|
|
@@ -4095,7 +4026,7 @@ class kt extends C {
|
|
|
4095
4026
|
return this.min(1, e);
|
|
4096
4027
|
}
|
|
4097
4028
|
}
|
|
4098
|
-
|
|
4029
|
+
xt.create = (r, e) => new xt({
|
|
4099
4030
|
valueType: r,
|
|
4100
4031
|
minSize: null,
|
|
4101
4032
|
maxSize: null,
|
|
@@ -4108,17 +4039,17 @@ class mt extends C {
|
|
|
4108
4039
|
}
|
|
4109
4040
|
_parse(e) {
|
|
4110
4041
|
const { ctx: t } = this._processInputParams(e);
|
|
4111
|
-
if (t.parsedType !==
|
|
4112
|
-
return
|
|
4042
|
+
if (t.parsedType !== _.function)
|
|
4043
|
+
return h(t, {
|
|
4113
4044
|
code: c.invalid_type,
|
|
4114
|
-
expected:
|
|
4045
|
+
expected: _.function,
|
|
4115
4046
|
received: t.parsedType
|
|
4116
4047
|
}), y;
|
|
4117
4048
|
function n(o, l) {
|
|
4118
|
-
return
|
|
4049
|
+
return pr({
|
|
4119
4050
|
data: o,
|
|
4120
4051
|
path: t.path,
|
|
4121
|
-
errorMaps: [t.common.contextualErrorMap, t.schemaErrorMap,
|
|
4052
|
+
errorMaps: [t.common.contextualErrorMap, t.schemaErrorMap, hr(), yt].filter((u) => !!u),
|
|
4122
4053
|
issueData: {
|
|
4123
4054
|
code: c.invalid_arguments,
|
|
4124
4055
|
argumentsError: l
|
|
@@ -4126,10 +4057,10 @@ class mt extends C {
|
|
|
4126
4057
|
});
|
|
4127
4058
|
}
|
|
4128
4059
|
function s(o, l) {
|
|
4129
|
-
return
|
|
4060
|
+
return pr({
|
|
4130
4061
|
data: o,
|
|
4131
4062
|
path: t.path,
|
|
4132
|
-
errorMaps: [t.common.contextualErrorMap, t.schemaErrorMap,
|
|
4063
|
+
errorMaps: [t.common.contextualErrorMap, t.schemaErrorMap, hr(), yt].filter((u) => !!u),
|
|
4133
4064
|
issueData: {
|
|
4134
4065
|
code: c.invalid_return_type,
|
|
4135
4066
|
returnTypeError: l
|
|
@@ -4137,26 +4068,26 @@ class mt extends C {
|
|
|
4137
4068
|
});
|
|
4138
4069
|
}
|
|
4139
4070
|
const a = { errorMap: t.common.contextualErrorMap }, i = t.data;
|
|
4140
|
-
if (this._def.returns instanceof
|
|
4071
|
+
if (this._def.returns instanceof kt) {
|
|
4141
4072
|
const o = this;
|
|
4142
|
-
return
|
|
4143
|
-
const u = new
|
|
4144
|
-
throw u.addIssue(n(l,
|
|
4145
|
-
}),
|
|
4146
|
-
return await o._def.returns._def.type.parseAsync(
|
|
4147
|
-
throw u.addIssue(s(
|
|
4073
|
+
return q(async function(...l) {
|
|
4074
|
+
const u = new Q([]), d = await o._def.args.parseAsync(l, a).catch((m) => {
|
|
4075
|
+
throw u.addIssue(n(l, m)), u;
|
|
4076
|
+
}), p = await Reflect.apply(i, this, d);
|
|
4077
|
+
return await o._def.returns._def.type.parseAsync(p, a).catch((m) => {
|
|
4078
|
+
throw u.addIssue(s(p, m)), u;
|
|
4148
4079
|
});
|
|
4149
4080
|
});
|
|
4150
4081
|
} else {
|
|
4151
4082
|
const o = this;
|
|
4152
|
-
return
|
|
4083
|
+
return q(function(...l) {
|
|
4153
4084
|
const u = o._def.args.safeParse(l, a);
|
|
4154
4085
|
if (!u.success)
|
|
4155
|
-
throw new
|
|
4156
|
-
const d = Reflect.apply(i, this, u.data),
|
|
4157
|
-
if (!
|
|
4158
|
-
throw new
|
|
4159
|
-
return
|
|
4086
|
+
throw new Q([n(l, u.error)]);
|
|
4087
|
+
const d = Reflect.apply(i, this, u.data), p = o._def.returns.safeParse(d, a);
|
|
4088
|
+
if (!p.success)
|
|
4089
|
+
throw new Q([s(d, p.error)]);
|
|
4090
|
+
return p.data;
|
|
4160
4091
|
});
|
|
4161
4092
|
}
|
|
4162
4093
|
}
|
|
@@ -4193,7 +4124,7 @@ class mt extends C {
|
|
|
4193
4124
|
});
|
|
4194
4125
|
}
|
|
4195
4126
|
}
|
|
4196
|
-
class
|
|
4127
|
+
class vn extends C {
|
|
4197
4128
|
get schema() {
|
|
4198
4129
|
return this._def.getter();
|
|
4199
4130
|
}
|
|
@@ -4202,16 +4133,16 @@ class kn extends C {
|
|
|
4202
4133
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
4203
4134
|
}
|
|
4204
4135
|
}
|
|
4205
|
-
|
|
4136
|
+
vn.create = (r, e) => new vn({
|
|
4206
4137
|
getter: r,
|
|
4207
4138
|
typeName: w.ZodLazy,
|
|
4208
4139
|
...b(e)
|
|
4209
4140
|
});
|
|
4210
|
-
class
|
|
4141
|
+
class _n extends C {
|
|
4211
4142
|
_parse(e) {
|
|
4212
4143
|
if (e.data !== this._def.value) {
|
|
4213
4144
|
const t = this._getOrReturnCtx(e);
|
|
4214
|
-
return
|
|
4145
|
+
return h(t, {
|
|
4215
4146
|
received: t.data,
|
|
4216
4147
|
code: c.invalid_literal,
|
|
4217
4148
|
expected: this._def.value
|
|
@@ -4223,12 +4154,12 @@ class xn extends C {
|
|
|
4223
4154
|
return this._def.value;
|
|
4224
4155
|
}
|
|
4225
4156
|
}
|
|
4226
|
-
|
|
4157
|
+
_n.create = (r, e) => new _n({
|
|
4227
4158
|
value: r,
|
|
4228
4159
|
typeName: w.ZodLiteral,
|
|
4229
4160
|
...b(e)
|
|
4230
4161
|
});
|
|
4231
|
-
function
|
|
4162
|
+
function us(r, e) {
|
|
4232
4163
|
return new rt({
|
|
4233
4164
|
values: r,
|
|
4234
4165
|
typeName: w.ZodEnum,
|
|
@@ -4239,21 +4170,21 @@ class rt extends C {
|
|
|
4239
4170
|
_parse(e) {
|
|
4240
4171
|
if (typeof e.data != "string") {
|
|
4241
4172
|
const t = this._getOrReturnCtx(e), n = this._def.values;
|
|
4242
|
-
return
|
|
4243
|
-
expected:
|
|
4173
|
+
return h(t, {
|
|
4174
|
+
expected: S.joinValues(n),
|
|
4244
4175
|
received: t.parsedType,
|
|
4245
4176
|
code: c.invalid_type
|
|
4246
4177
|
}), y;
|
|
4247
4178
|
}
|
|
4248
4179
|
if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(e.data)) {
|
|
4249
4180
|
const t = this._getOrReturnCtx(e), n = this._def.values;
|
|
4250
|
-
return
|
|
4181
|
+
return h(t, {
|
|
4251
4182
|
received: t.data,
|
|
4252
4183
|
code: c.invalid_enum_value,
|
|
4253
4184
|
options: n
|
|
4254
4185
|
}), y;
|
|
4255
4186
|
}
|
|
4256
|
-
return
|
|
4187
|
+
return q(e.data);
|
|
4257
4188
|
}
|
|
4258
4189
|
get options() {
|
|
4259
4190
|
return this._def.values;
|
|
@@ -4289,57 +4220,57 @@ class rt extends C {
|
|
|
4289
4220
|
});
|
|
4290
4221
|
}
|
|
4291
4222
|
}
|
|
4292
|
-
rt.create =
|
|
4293
|
-
class
|
|
4223
|
+
rt.create = us;
|
|
4224
|
+
class gn extends C {
|
|
4294
4225
|
_parse(e) {
|
|
4295
|
-
const t =
|
|
4296
|
-
if (n.parsedType !==
|
|
4297
|
-
const s =
|
|
4298
|
-
return
|
|
4299
|
-
expected:
|
|
4226
|
+
const t = S.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
4227
|
+
if (n.parsedType !== _.string && n.parsedType !== _.number) {
|
|
4228
|
+
const s = S.objectValues(t);
|
|
4229
|
+
return h(n, {
|
|
4230
|
+
expected: S.joinValues(s),
|
|
4300
4231
|
received: n.parsedType,
|
|
4301
4232
|
code: c.invalid_type
|
|
4302
4233
|
}), y;
|
|
4303
4234
|
}
|
|
4304
|
-
if (this._cache || (this._cache = new Set(
|
|
4305
|
-
const s =
|
|
4306
|
-
return
|
|
4235
|
+
if (this._cache || (this._cache = new Set(S.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
|
|
4236
|
+
const s = S.objectValues(t);
|
|
4237
|
+
return h(n, {
|
|
4307
4238
|
received: n.data,
|
|
4308
4239
|
code: c.invalid_enum_value,
|
|
4309
4240
|
options: s
|
|
4310
4241
|
}), y;
|
|
4311
4242
|
}
|
|
4312
|
-
return
|
|
4243
|
+
return q(e.data);
|
|
4313
4244
|
}
|
|
4314
4245
|
get enum() {
|
|
4315
4246
|
return this._def.values;
|
|
4316
4247
|
}
|
|
4317
4248
|
}
|
|
4318
|
-
|
|
4249
|
+
gn.create = (r, e) => new gn({
|
|
4319
4250
|
values: r,
|
|
4320
4251
|
typeName: w.ZodNativeEnum,
|
|
4321
4252
|
...b(e)
|
|
4322
4253
|
});
|
|
4323
|
-
class
|
|
4254
|
+
class kt extends C {
|
|
4324
4255
|
unwrap() {
|
|
4325
4256
|
return this._def.type;
|
|
4326
4257
|
}
|
|
4327
4258
|
_parse(e) {
|
|
4328
4259
|
const { ctx: t } = this._processInputParams(e);
|
|
4329
|
-
if (t.parsedType !==
|
|
4330
|
-
return
|
|
4260
|
+
if (t.parsedType !== _.promise && t.common.async === !1)
|
|
4261
|
+
return h(t, {
|
|
4331
4262
|
code: c.invalid_type,
|
|
4332
|
-
expected:
|
|
4263
|
+
expected: _.promise,
|
|
4333
4264
|
received: t.parsedType
|
|
4334
4265
|
}), y;
|
|
4335
|
-
const n = t.parsedType ===
|
|
4336
|
-
return
|
|
4266
|
+
const n = t.parsedType === _.promise ? t.data : Promise.resolve(t.data);
|
|
4267
|
+
return q(n.then((s) => this._def.type.parseAsync(s, {
|
|
4337
4268
|
path: t.path,
|
|
4338
4269
|
errorMap: t.common.contextualErrorMap
|
|
4339
4270
|
})));
|
|
4340
4271
|
}
|
|
4341
4272
|
}
|
|
4342
|
-
|
|
4273
|
+
kt.create = (r, e) => new kt({
|
|
4343
4274
|
type: r,
|
|
4344
4275
|
typeName: w.ZodPromise,
|
|
4345
4276
|
...b(e)
|
|
@@ -4354,7 +4285,7 @@ class nt extends C {
|
|
|
4354
4285
|
_parse(e) {
|
|
4355
4286
|
const { status: t, ctx: n } = this._processInputParams(e), s = this._def.effect || null, a = {
|
|
4356
4287
|
addIssue: (i) => {
|
|
4357
|
-
|
|
4288
|
+
h(n, i), i.fatal ? t.abort() : t.dirty();
|
|
4358
4289
|
},
|
|
4359
4290
|
get path() {
|
|
4360
4291
|
return n.path;
|
|
@@ -4421,7 +4352,7 @@ class nt extends C {
|
|
|
4421
4352
|
status: t.value,
|
|
4422
4353
|
value: o
|
|
4423
4354
|
})) : y);
|
|
4424
|
-
|
|
4355
|
+
S.assertNever(s);
|
|
4425
4356
|
}
|
|
4426
4357
|
}
|
|
4427
4358
|
nt.create = (r, e, t) => new nt({
|
|
@@ -4438,7 +4369,7 @@ nt.createWithPreprocess = (r, e, t) => new nt({
|
|
|
4438
4369
|
});
|
|
4439
4370
|
class we extends C {
|
|
4440
4371
|
_parse(e) {
|
|
4441
|
-
return this._getType(e) ===
|
|
4372
|
+
return this._getType(e) === _.undefined ? q(void 0) : this._def.innerType._parse(e);
|
|
4442
4373
|
}
|
|
4443
4374
|
unwrap() {
|
|
4444
4375
|
return this._def.innerType;
|
|
@@ -4451,7 +4382,7 @@ we.create = (r, e) => new we({
|
|
|
4451
4382
|
});
|
|
4452
4383
|
class st extends C {
|
|
4453
4384
|
_parse(e) {
|
|
4454
|
-
return this._getType(e) ===
|
|
4385
|
+
return this._getType(e) === _.null ? q(null) : this._def.innerType._parse(e);
|
|
4455
4386
|
}
|
|
4456
4387
|
unwrap() {
|
|
4457
4388
|
return this._def.innerType;
|
|
@@ -4462,11 +4393,11 @@ st.create = (r, e) => new st({
|
|
|
4462
4393
|
typeName: w.ZodNullable,
|
|
4463
4394
|
...b(e)
|
|
4464
4395
|
});
|
|
4465
|
-
class
|
|
4396
|
+
class yr extends C {
|
|
4466
4397
|
_parse(e) {
|
|
4467
4398
|
const { ctx: t } = this._processInputParams(e);
|
|
4468
4399
|
let n = t.data;
|
|
4469
|
-
return t.parsedType ===
|
|
4400
|
+
return t.parsedType === _.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({
|
|
4470
4401
|
data: n,
|
|
4471
4402
|
path: t.path,
|
|
4472
4403
|
parent: t
|
|
@@ -4476,13 +4407,13 @@ class kr extends C {
|
|
|
4476
4407
|
return this._def.innerType;
|
|
4477
4408
|
}
|
|
4478
4409
|
}
|
|
4479
|
-
|
|
4410
|
+
yr.create = (r, e) => new yr({
|
|
4480
4411
|
innerType: r,
|
|
4481
4412
|
typeName: w.ZodDefault,
|
|
4482
4413
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
4483
4414
|
...b(e)
|
|
4484
4415
|
});
|
|
4485
|
-
class
|
|
4416
|
+
class wr extends C {
|
|
4486
4417
|
_parse(e) {
|
|
4487
4418
|
const { ctx: t } = this._processInputParams(e), n = {
|
|
4488
4419
|
...t,
|
|
@@ -4501,7 +4432,7 @@ class xr extends C {
|
|
|
4501
4432
|
status: "valid",
|
|
4502
4433
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
4503
4434
|
get error() {
|
|
4504
|
-
return new
|
|
4435
|
+
return new Q(n.common.issues);
|
|
4505
4436
|
},
|
|
4506
4437
|
input: n.data
|
|
4507
4438
|
})
|
|
@@ -4509,7 +4440,7 @@ class xr extends C {
|
|
|
4509
4440
|
status: "valid",
|
|
4510
4441
|
value: s.status === "valid" ? s.value : this._def.catchValue({
|
|
4511
4442
|
get error() {
|
|
4512
|
-
return new
|
|
4443
|
+
return new Q(n.common.issues);
|
|
4513
4444
|
},
|
|
4514
4445
|
input: n.data
|
|
4515
4446
|
})
|
|
@@ -4519,30 +4450,30 @@ class xr extends C {
|
|
|
4519
4450
|
return this._def.innerType;
|
|
4520
4451
|
}
|
|
4521
4452
|
}
|
|
4522
|
-
|
|
4453
|
+
wr.create = (r, e) => new wr({
|
|
4523
4454
|
innerType: r,
|
|
4524
4455
|
typeName: w.ZodCatch,
|
|
4525
4456
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
4526
4457
|
...b(e)
|
|
4527
4458
|
});
|
|
4528
|
-
class
|
|
4459
|
+
class yn extends C {
|
|
4529
4460
|
_parse(e) {
|
|
4530
|
-
if (this._getType(e) !==
|
|
4461
|
+
if (this._getType(e) !== _.nan) {
|
|
4531
4462
|
const n = this._getOrReturnCtx(e);
|
|
4532
|
-
return
|
|
4463
|
+
return h(n, {
|
|
4533
4464
|
code: c.invalid_type,
|
|
4534
|
-
expected:
|
|
4465
|
+
expected: _.nan,
|
|
4535
4466
|
received: n.parsedType
|
|
4536
4467
|
}), y;
|
|
4537
4468
|
}
|
|
4538
4469
|
return { status: "valid", value: e.data };
|
|
4539
4470
|
}
|
|
4540
4471
|
}
|
|
4541
|
-
|
|
4472
|
+
yn.create = (r) => new yn({
|
|
4542
4473
|
typeName: w.ZodNaN,
|
|
4543
4474
|
...b(r)
|
|
4544
4475
|
});
|
|
4545
|
-
class
|
|
4476
|
+
class di extends C {
|
|
4546
4477
|
_parse(e) {
|
|
4547
4478
|
const { ctx: t } = this._processInputParams(e), n = t.data;
|
|
4548
4479
|
return this._def.type._parse({
|
|
@@ -4555,7 +4486,7 @@ class fi extends C {
|
|
|
4555
4486
|
return this._def.type;
|
|
4556
4487
|
}
|
|
4557
4488
|
}
|
|
4558
|
-
class
|
|
4489
|
+
class zr extends C {
|
|
4559
4490
|
_parse(e) {
|
|
4560
4491
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
4561
4492
|
if (n.common.async)
|
|
@@ -4588,14 +4519,14 @@ class Ur extends C {
|
|
|
4588
4519
|
}
|
|
4589
4520
|
}
|
|
4590
4521
|
static create(e, t) {
|
|
4591
|
-
return new
|
|
4522
|
+
return new zr({
|
|
4592
4523
|
in: e,
|
|
4593
4524
|
out: t,
|
|
4594
4525
|
typeName: w.ZodPipeline
|
|
4595
4526
|
});
|
|
4596
4527
|
}
|
|
4597
4528
|
}
|
|
4598
|
-
class
|
|
4529
|
+
class xr extends C {
|
|
4599
4530
|
_parse(e) {
|
|
4600
4531
|
const t = this._def.innerType._parse(e), n = (s) => (et(s) && (s.value = Object.freeze(s.value)), s);
|
|
4601
4532
|
return Ut(t) ? t.then((s) => n(s)) : n(t);
|
|
@@ -4604,7 +4535,7 @@ class br extends C {
|
|
|
4604
4535
|
return this._def.innerType;
|
|
4605
4536
|
}
|
|
4606
4537
|
}
|
|
4607
|
-
|
|
4538
|
+
xr.create = (r, e) => new xr({
|
|
4608
4539
|
innerType: r,
|
|
4609
4540
|
typeName: w.ZodReadonly,
|
|
4610
4541
|
...b(e)
|
|
@@ -4613,112 +4544,112 @@ var w;
|
|
|
4613
4544
|
(function(r) {
|
|
4614
4545
|
r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
|
|
4615
4546
|
})(w || (w = {}));
|
|
4616
|
-
const
|
|
4547
|
+
const Vr = ye.create, A = tt.create, ds = mr.create, cs = vr.create;
|
|
4617
4548
|
qe.create;
|
|
4618
4549
|
be.create;
|
|
4619
|
-
const Lt =
|
|
4550
|
+
const Lt = _r.create, ci = ie.create, P = R.create;
|
|
4620
4551
|
$t.create;
|
|
4621
4552
|
qt.create;
|
|
4622
4553
|
fe.create;
|
|
4623
|
-
const
|
|
4554
|
+
const ee = mt.create;
|
|
4624
4555
|
rt.create;
|
|
4625
|
-
const
|
|
4556
|
+
const fi = kt.create;
|
|
4626
4557
|
we.create;
|
|
4627
4558
|
st.create;
|
|
4628
|
-
|
|
4629
|
-
pin:
|
|
4630
|
-
fade:
|
|
4559
|
+
P({
|
|
4560
|
+
pin: P({
|
|
4561
|
+
fade: ds().optional(),
|
|
4631
4562
|
maxCount: A().optional(),
|
|
4632
4563
|
maxZoom: A().optional()
|
|
4633
4564
|
}).optional(),
|
|
4634
|
-
animation:
|
|
4635
|
-
queue:
|
|
4565
|
+
animation: P({
|
|
4566
|
+
queue: P({
|
|
4636
4567
|
limit: A().optional()
|
|
4637
4568
|
}).optional()
|
|
4638
4569
|
}).optional(),
|
|
4639
|
-
api:
|
|
4640
|
-
states:
|
|
4641
|
-
url:
|
|
4570
|
+
api: P({
|
|
4571
|
+
states: P({
|
|
4572
|
+
url: Vr()
|
|
4642
4573
|
}).optional()
|
|
4643
4574
|
}).optional()
|
|
4644
4575
|
});
|
|
4645
|
-
const
|
|
4646
|
-
sw:
|
|
4647
|
-
ne:
|
|
4648
|
-
}),
|
|
4576
|
+
const kr = A().min(-90).max(90), br = A().min(-180).max(180), hi = P({
|
|
4577
|
+
sw: P({ lat: kr, lng: br }),
|
|
4578
|
+
ne: P({ lat: kr, lng: br })
|
|
4579
|
+
}), Er = cs().refine((r) => r instanceof HTMLElement, "Must be an HTMLElement"), pi = P({
|
|
4649
4580
|
mapSize: A().min(1),
|
|
4650
4581
|
zoomMin: A().min(0),
|
|
4651
4582
|
zoomMax: A().min(0),
|
|
4652
4583
|
zoomScale: A().min(1).max(10)
|
|
4653
|
-
}),
|
|
4654
|
-
instance:
|
|
4655
|
-
inserted:
|
|
4656
|
-
insert:
|
|
4657
|
-
remove:
|
|
4658
|
-
update:
|
|
4659
|
-
}),
|
|
4660
|
-
getParameters:
|
|
4661
|
-
getContainer:
|
|
4662
|
-
getZoom:
|
|
4663
|
-
getBounds:
|
|
4664
|
-
panBy:
|
|
4665
|
-
createMarker:
|
|
4666
|
-
}),
|
|
4667
|
-
id:
|
|
4584
|
+
}), mi = P({
|
|
4585
|
+
instance: cs(),
|
|
4586
|
+
inserted: ee().returns(ds()),
|
|
4587
|
+
insert: ee().returns(Lt()),
|
|
4588
|
+
remove: ee().returns(Lt()),
|
|
4589
|
+
update: ee().args(A()).returns(Lt())
|
|
4590
|
+
}), vi = P({
|
|
4591
|
+
getParameters: ee().args().returns(pi),
|
|
4592
|
+
getContainer: ee().args().returns(Er),
|
|
4593
|
+
getZoom: ee().args().returns(A()),
|
|
4594
|
+
getBounds: ee().args().returns(hi),
|
|
4595
|
+
panBy: ee().args(A(), A()).returns(Lt()),
|
|
4596
|
+
createMarker: ee().args(Er, kr, br, A()).returns(mi)
|
|
4597
|
+
}), nr = ee().args(Vr()).returns(fi(Er)), _i = P({
|
|
4598
|
+
id: Vr().min(1),
|
|
4668
4599
|
rank: A(),
|
|
4669
4600
|
lat: A().min(-90).max(90),
|
|
4670
4601
|
lng: A().min(-180).max(180),
|
|
4671
|
-
tooltip:
|
|
4672
|
-
style:
|
|
4602
|
+
tooltip: P({
|
|
4603
|
+
style: P({
|
|
4673
4604
|
width: A(),
|
|
4674
4605
|
height: A(),
|
|
4675
4606
|
margin: A(),
|
|
4676
4607
|
radius: A()
|
|
4677
4608
|
}).refine((r) => Math.min(r.width, r.height) / r.margin >= 5, "Tooltip width and height must be at least 5 times the margin"),
|
|
4678
|
-
body:
|
|
4609
|
+
body: nr
|
|
4679
4610
|
}),
|
|
4680
|
-
pin:
|
|
4681
|
-
style:
|
|
4611
|
+
pin: P({
|
|
4612
|
+
style: P({
|
|
4682
4613
|
width: A(),
|
|
4683
4614
|
height: A(),
|
|
4684
4615
|
radius: A()
|
|
4685
4616
|
}),
|
|
4686
|
-
body:
|
|
4617
|
+
body: nr
|
|
4687
4618
|
}).optional(),
|
|
4688
|
-
popup:
|
|
4689
|
-
style:
|
|
4619
|
+
popup: P({
|
|
4620
|
+
style: P({
|
|
4690
4621
|
width: A(),
|
|
4691
4622
|
height: A(),
|
|
4692
4623
|
radius: A(),
|
|
4693
4624
|
margin: A()
|
|
4694
4625
|
}),
|
|
4695
|
-
body:
|
|
4626
|
+
body: nr
|
|
4696
4627
|
}).optional()
|
|
4697
|
-
}),
|
|
4628
|
+
}), gi = ci(_i);
|
|
4698
4629
|
var Ie;
|
|
4699
4630
|
((r) => {
|
|
4700
4631
|
r.COUNT = 12, r.DEGREES = [0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330], r.DEGREES_DEFAULT = 270;
|
|
4701
4632
|
})(Ie || (Ie = {}));
|
|
4702
|
-
const
|
|
4703
|
-
class
|
|
4633
|
+
const wn = "1.0.204", fs = "https://maps.api.arenarium.dev", yi = `${fs}/log`, wi = `${fs}/tooltip/states`;
|
|
4634
|
+
class Ti {
|
|
4704
4635
|
constructor(e, t, n) {
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4636
|
+
f(this, "apiKey");
|
|
4637
|
+
f(this, "apiStatesUrl");
|
|
4638
|
+
f(this, "mapProvider");
|
|
4639
|
+
f(this, "markerDataArray", new Array());
|
|
4640
|
+
f(this, "markerDataMap", /* @__PURE__ */ new Map());
|
|
4641
|
+
f(this, "markerDataUpdating", !1);
|
|
4642
|
+
f(this, "markerPinProcessor");
|
|
4643
|
+
f(this, "markerTooltipProcessor");
|
|
4644
|
+
f(this, "markerPopupProcessor");
|
|
4645
|
+
vi.parse(t), this.apiKey = e, this.mapProvider = t, this.markerPinProcessor = new Sr(t), this.markerTooltipProcessor = new ki(t), this.markerPopupProcessor = new bi(t), this.configuration = n, this.log("info", "Loaded");
|
|
4715
4646
|
}
|
|
4716
4647
|
set configuration(e) {
|
|
4717
4648
|
var t, n, s, a;
|
|
4718
4649
|
this.markerPinProcessor.setConfiguration(e), this.apiStatesUrl = ((n = (t = e == null ? void 0 : e.api) == null ? void 0 : t.states) == null ? void 0 : n.url) ?? void 0, pe.setLimit(((a = (s = e == null ? void 0 : e.animation) == null ? void 0 : s.queue) == null ? void 0 : a.limit) ?? 8 * navigator.hardwareConcurrency);
|
|
4719
4650
|
}
|
|
4720
4651
|
async updateMarkers(e) {
|
|
4721
|
-
|
|
4652
|
+
gi.parse(e);
|
|
4722
4653
|
try {
|
|
4723
4654
|
await this.updateMarkerData(e), this.processMarkerDataCallback();
|
|
4724
4655
|
} catch (t) {
|
|
@@ -4780,7 +4711,7 @@ class Ai {
|
|
|
4780
4711
|
key: this.apiKey,
|
|
4781
4712
|
parameters: s,
|
|
4782
4713
|
input: a
|
|
4783
|
-
}, o = this.apiStatesUrl ??
|
|
4714
|
+
}, o = this.apiStatesUrl ?? wi, l = await fetch(o, {
|
|
4784
4715
|
method: "POST",
|
|
4785
4716
|
headers: { "Content-Type": "application/json" },
|
|
4786
4717
|
body: JSON.stringify(i)
|
|
@@ -4797,7 +4728,7 @@ class Ai {
|
|
|
4797
4728
|
if (o)
|
|
4798
4729
|
o.update(i);
|
|
4799
4730
|
else {
|
|
4800
|
-
const l = new
|
|
4731
|
+
const l = new xi(this.mapProvider, a, i);
|
|
4801
4732
|
l.create(), this.markerDataMap.set(a.id, l), this.markerDataArray.push(l);
|
|
4802
4733
|
}
|
|
4803
4734
|
}
|
|
@@ -4837,14 +4768,14 @@ class Ai {
|
|
|
4837
4768
|
if (!(window != null && window.location.host.startsWith("localhost") || window != null && window.location.host.startsWith("127.0.0.1")))
|
|
4838
4769
|
try {
|
|
4839
4770
|
const s = {
|
|
4840
|
-
title: `[CLIENT:${
|
|
4771
|
+
title: `[CLIENT:${wn}] ${t}`,
|
|
4841
4772
|
level: e,
|
|
4842
4773
|
content: {
|
|
4843
|
-
version:
|
|
4774
|
+
version: wn,
|
|
4844
4775
|
...n
|
|
4845
4776
|
}
|
|
4846
4777
|
};
|
|
4847
|
-
await fetch(
|
|
4778
|
+
await fetch(yi, {
|
|
4848
4779
|
method: "POST",
|
|
4849
4780
|
headers: { "Content-Type": "application/json" },
|
|
4850
4781
|
body: JSON.stringify(s)
|
|
@@ -4854,13 +4785,13 @@ class Ai {
|
|
|
4854
4785
|
}
|
|
4855
4786
|
}
|
|
4856
4787
|
}
|
|
4857
|
-
class
|
|
4788
|
+
class xi {
|
|
4858
4789
|
constructor(e, t, n) {
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
this.marker = t, this.zoom = n[0], this.pin = new
|
|
4790
|
+
f(this, "marker");
|
|
4791
|
+
f(this, "zoom");
|
|
4792
|
+
f(this, "pin");
|
|
4793
|
+
f(this, "tooltip");
|
|
4794
|
+
this.marker = t, this.zoom = n[0], this.pin = new Cr(e, t, n), this.tooltip = new Tr(e, t, n);
|
|
4864
4795
|
}
|
|
4865
4796
|
create() {
|
|
4866
4797
|
this.pin.create(), this.tooltip.create();
|
|
@@ -4872,16 +4803,16 @@ class bi {
|
|
|
4872
4803
|
this.pin.remove(), this.tooltip.remove();
|
|
4873
4804
|
}
|
|
4874
4805
|
}
|
|
4875
|
-
class
|
|
4806
|
+
class Ur {
|
|
4876
4807
|
constructor(e, t) {
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4808
|
+
f(this, "provider");
|
|
4809
|
+
f(this, "id");
|
|
4810
|
+
f(this, "lat");
|
|
4811
|
+
f(this, "lng");
|
|
4812
|
+
f(this, "shown");
|
|
4813
|
+
f(this, "element");
|
|
4814
|
+
f(this, "component");
|
|
4815
|
+
f(this, "marker");
|
|
4885
4816
|
this.provider = e, this.id = t.id, this.lat = t.lat, this.lng = t.lng, this.shown = !0;
|
|
4886
4817
|
}
|
|
4887
4818
|
create() {
|
|
@@ -4912,25 +4843,25 @@ class $r {
|
|
|
4912
4843
|
(e = this.marker) == null || e.remove(), (t = this.element) == null || t.remove();
|
|
4913
4844
|
}
|
|
4914
4845
|
}
|
|
4915
|
-
const Ue = class Ue extends
|
|
4846
|
+
const Ue = class Ue extends Ur {
|
|
4916
4847
|
constructor(t, n, s) {
|
|
4917
4848
|
var a, i, o, l;
|
|
4918
4849
|
super(t, n);
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4850
|
+
f(this, "width");
|
|
4851
|
+
f(this, "height");
|
|
4852
|
+
f(this, "radius");
|
|
4853
|
+
f(this, "zoom");
|
|
4854
|
+
f(this, "bodyLoading", !1);
|
|
4855
|
+
f(this, "bodyLoaded", !1);
|
|
4856
|
+
f(this, "bodyCallback");
|
|
4926
4857
|
this.width = ((a = n.pin) == null ? void 0 : a.style.width) ?? Ue.DEFAULT_SIZE, this.height = ((i = n.pin) == null ? void 0 : i.style.height) ?? Ue.DEFAULT_SIZE, this.radius = ((o = n.pin) == null ? void 0 : o.style.radius) ?? Ue.DEFAULT_SIZE, this.zoom = s[0], this.bodyCallback = (l = n.pin) == null ? void 0 : l.body;
|
|
4927
4858
|
}
|
|
4928
4859
|
createElement() {
|
|
4929
|
-
this.element = document.createElement("div"), this.element.classList.add("pin"), this.component =
|
|
4860
|
+
this.element = document.createElement("div"), this.element.classList.add("pin"), this.component = Fr(Fa, {
|
|
4930
4861
|
target: this.element,
|
|
4931
4862
|
props: {
|
|
4932
4863
|
id: this.id + "_pin",
|
|
4933
|
-
layer:
|
|
4864
|
+
layer: Da,
|
|
4934
4865
|
priority: this.zoom * this.provider.getParameters().zoomScale,
|
|
4935
4866
|
width: this.width,
|
|
4936
4867
|
height: this.height,
|
|
@@ -4977,19 +4908,19 @@ const Ue = class Ue extends $r {
|
|
|
4977
4908
|
return this.bodyCallback == null || this.bodyLoaded;
|
|
4978
4909
|
}
|
|
4979
4910
|
};
|
|
4980
|
-
|
|
4981
|
-
let
|
|
4911
|
+
f(Ue, "DEFAULT_SIZE", 16);
|
|
4912
|
+
let Cr = Ue;
|
|
4982
4913
|
const Be = class Be {
|
|
4983
4914
|
constructor(e) {
|
|
4984
|
-
|
|
4915
|
+
f(this, "provider");
|
|
4985
4916
|
// Data
|
|
4986
|
-
|
|
4917
|
+
f(this, "pinElements", new Array());
|
|
4987
4918
|
// Configuration
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
4919
|
+
f(this, "pinMaxWidth", 0);
|
|
4920
|
+
f(this, "pinMaxHeight", 0);
|
|
4921
|
+
f(this, "pinFade", !1);
|
|
4922
|
+
f(this, "pinMaxCount", 0);
|
|
4923
|
+
f(this, "pinMaxZoomDelta", 0);
|
|
4993
4924
|
this.provider = e;
|
|
4994
4925
|
}
|
|
4995
4926
|
setConfiguration(e) {
|
|
@@ -5003,35 +4934,35 @@ const Be = class Be {
|
|
|
5003
4934
|
this.pinElements.forEach((e) => e.remove()), this.pinElements.length = 0;
|
|
5004
4935
|
}
|
|
5005
4936
|
process(e, t) {
|
|
5006
|
-
const n = this.provider.getParameters().mapSize, s = new
|
|
4937
|
+
const n = this.provider.getParameters().mapSize, s = new is(e, t, n, this.pinMaxWidth * 2, this.pinMaxHeight * 2);
|
|
5007
4938
|
let a = 0;
|
|
5008
4939
|
for (const i of this.pinElements)
|
|
5009
4940
|
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);
|
|
5010
4941
|
}
|
|
5011
4942
|
};
|
|
5012
|
-
|
|
5013
|
-
let
|
|
5014
|
-
const Ht = class Ht extends
|
|
4943
|
+
f(Be, "MAP_PINS_MAX_ZOOM", 2), f(Be, "MAP_PINS_MAX_COUNT", 128);
|
|
4944
|
+
let Sr = Be;
|
|
4945
|
+
const Ht = class Ht extends Ur {
|
|
5015
4946
|
constructor(t, n, s) {
|
|
5016
4947
|
super(t, n);
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
4948
|
+
f(this, "width");
|
|
4949
|
+
f(this, "height");
|
|
4950
|
+
f(this, "margin");
|
|
4951
|
+
f(this, "radius");
|
|
4952
|
+
f(this, "zoom");
|
|
4953
|
+
f(this, "angle");
|
|
4954
|
+
f(this, "states");
|
|
4955
|
+
f(this, "bodyLoading", !1);
|
|
4956
|
+
f(this, "bodyLoaded", !1);
|
|
4957
|
+
f(this, "bodyCallback");
|
|
5027
4958
|
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 = Ie.DEGREES_DEFAULT, this.states = s[1].map((a) => [a[0], Ie.DEGREES[a[1]]]), this.bodyCallback = n.tooltip.body;
|
|
5028
4959
|
}
|
|
5029
4960
|
createElement() {
|
|
5030
|
-
this.element = document.createElement("div"), this.element.classList.add("tooltip"), this.component =
|
|
4961
|
+
this.element = document.createElement("div"), this.element.classList.add("tooltip"), this.component = Fr(as, {
|
|
5031
4962
|
target: this.element,
|
|
5032
4963
|
props: {
|
|
5033
4964
|
id: this.id + "_tooltip",
|
|
5034
|
-
layer:
|
|
4965
|
+
layer: La,
|
|
5035
4966
|
priority: this.zoom * this.provider.getParameters().zoomScale,
|
|
5036
4967
|
width: this.width,
|
|
5037
4968
|
height: this.height,
|
|
@@ -5084,16 +5015,16 @@ const Ht = class Ht extends $r {
|
|
|
5084
5015
|
return this.bodyLoaded;
|
|
5085
5016
|
}
|
|
5086
5017
|
};
|
|
5087
|
-
|
|
5088
|
-
let
|
|
5089
|
-
class
|
|
5018
|
+
f(Ht, "Z_INDEX_OFFSET", 1e6);
|
|
5019
|
+
let Tr = Ht;
|
|
5020
|
+
class ki {
|
|
5090
5021
|
constructor(e) {
|
|
5091
|
-
|
|
5022
|
+
f(this, "provider");
|
|
5092
5023
|
// Data
|
|
5093
|
-
|
|
5024
|
+
f(this, "tooltipElements", new Array());
|
|
5094
5025
|
// Configuration
|
|
5095
|
-
|
|
5096
|
-
|
|
5026
|
+
f(this, "tooltipMaxWidth", 0);
|
|
5027
|
+
f(this, "tooltipMaxHeight", 0);
|
|
5097
5028
|
this.provider = e;
|
|
5098
5029
|
}
|
|
5099
5030
|
updateElements(e) {
|
|
@@ -5103,30 +5034,30 @@ class Ei {
|
|
|
5103
5034
|
this.tooltipElements.forEach((e) => e.remove()), this.tooltipElements.length = 0;
|
|
5104
5035
|
}
|
|
5105
5036
|
process(e, t) {
|
|
5106
|
-
const n = this.provider.getParameters().mapSize, s = new
|
|
5037
|
+
const n = this.provider.getParameters().mapSize, s = new is(e, t, n, this.tooltipMaxWidth * 2, this.tooltipMaxHeight * 2);
|
|
5107
5038
|
for (const a of this.tooltipElements)
|
|
5108
5039
|
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);
|
|
5109
5040
|
}
|
|
5110
5041
|
}
|
|
5111
|
-
const Yt = class Yt extends
|
|
5042
|
+
const Yt = class Yt extends Ur {
|
|
5112
5043
|
constructor(t, n) {
|
|
5113
5044
|
if (n.popup == null) throw new Error("Failed to create popup");
|
|
5114
5045
|
super(t, n);
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5046
|
+
f(this, "width");
|
|
5047
|
+
f(this, "height");
|
|
5048
|
+
f(this, "margin");
|
|
5049
|
+
f(this, "radius");
|
|
5050
|
+
f(this, "bodyLoading", !1);
|
|
5051
|
+
f(this, "bodyLoaded", !1);
|
|
5052
|
+
f(this, "bodyCallback");
|
|
5122
5053
|
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;
|
|
5123
5054
|
}
|
|
5124
5055
|
createElement() {
|
|
5125
|
-
this.element = document.createElement("div"), this.element.classList.add("popup"), this.component =
|
|
5056
|
+
this.element = document.createElement("div"), this.element.classList.add("popup"), this.component = Fr(as, {
|
|
5126
5057
|
target: this.element,
|
|
5127
5058
|
props: {
|
|
5128
5059
|
id: this.id + "_popup",
|
|
5129
|
-
layer:
|
|
5060
|
+
layer: Pa,
|
|
5130
5061
|
priority: 0,
|
|
5131
5062
|
width: this.width,
|
|
5132
5063
|
height: this.height,
|
|
@@ -5170,19 +5101,19 @@ const Yt = class Yt extends $r {
|
|
|
5170
5101
|
return this.bodyLoaded;
|
|
5171
5102
|
}
|
|
5172
5103
|
};
|
|
5173
|
-
|
|
5174
|
-
let
|
|
5175
|
-
class
|
|
5104
|
+
f(Yt, "Z_INDEX_OFFSET", 2e6);
|
|
5105
|
+
let Mr = Yt;
|
|
5106
|
+
class bi {
|
|
5176
5107
|
constructor(e) {
|
|
5177
|
-
|
|
5108
|
+
f(this, "provider");
|
|
5178
5109
|
// Data
|
|
5179
|
-
|
|
5180
|
-
|
|
5110
|
+
f(this, "popupElements", /* @__PURE__ */ new Map());
|
|
5111
|
+
f(this, "popupPositioned", /* @__PURE__ */ new Map());
|
|
5181
5112
|
this.provider = e;
|
|
5182
5113
|
}
|
|
5183
5114
|
show(e) {
|
|
5184
5115
|
e.pin.shown = !1, e.tooltip.shown = !1;
|
|
5185
|
-
const t = new
|
|
5116
|
+
const t = new Mr(this.provider, e.marker);
|
|
5186
5117
|
this.popupElements.set(e.marker.id, t), this.popupPositioned.set(e.marker.id, !1), t.create(), t.setAngle(e.tooltip.angle), t.shown = !0;
|
|
5187
5118
|
}
|
|
5188
5119
|
hide(e) {
|
|
@@ -5204,13 +5135,13 @@ class Ci {
|
|
|
5204
5135
|
if (a == null) continue;
|
|
5205
5136
|
const i = s.getBoundingClientRect();
|
|
5206
5137
|
if (i.x == 0 && i.y == 0 && i.width == 0 && i.height == 0) continue;
|
|
5207
|
-
const o = i.x + i.width / 2, l = i.y + i.height / 2, u = o + a.x, d = l + a.y,
|
|
5208
|
-
this.provider.panBy(
|
|
5138
|
+
const o = i.x + i.width / 2, l = i.y + i.height / 2, u = o + a.x, d = l + a.y, p = u + n.width, v = d + n.height, m = this.provider.getContainer().getBoundingClientRect(), k = u - m.left, T = m.right - p, I = d - m.top, le = m.bottom - v, Z = Math.min(n.width, n.height) / 4, W = k < 0 ? k - Z : T < 0 ? -T + Z : 0, ne = I < 0 ? I - Z : le < 0 ? -le + Z : 0;
|
|
5139
|
+
this.provider.panBy(W, ne), this.popupPositioned.set(n.id, !0);
|
|
5209
5140
|
}
|
|
5210
5141
|
} else
|
|
5211
5142
|
n.setCollapsed(!0), n.isCollapsed() && (n.updateMap(!1), n.remove(), this.popupElements.delete(n.id), this.popupPositioned.delete(n.id));
|
|
5212
5143
|
}
|
|
5213
5144
|
}
|
|
5214
5145
|
export {
|
|
5215
|
-
|
|
5146
|
+
Ti as MapManager
|
|
5216
5147
|
};
|