@arenarium/maps 1.0.186 → 1.0.188
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/api.cjs.js +1 -1
- package/dist/api.d.ts +4 -4
- package/dist/api.es.js +58 -50
- package/dist/index.d.ts +5 -1
- package/dist/index.js +2 -2
- package/dist/main.cjs.js +2 -2
- package/dist/main.es.js +1349 -1321
- package/dist/states-BVsyCOND.js +413 -0
- package/dist/states-Dr9TQeEe.cjs +1 -0
- package/package.json +6 -6
- package/dist/states-CqXqpk4z.js +0 -454
- package/dist/states-D6BEdwDG.cjs +0 -1
package/dist/main.es.js
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var As = Object.defineProperty;
|
|
2
|
+
var tn = (r) => {
|
|
3
3
|
throw TypeError(r);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var k = (r, e, t) => (
|
|
8
|
-
import { R as
|
|
9
|
-
const
|
|
10
|
-
var
|
|
11
|
-
function
|
|
5
|
+
var Ms = (r, e, t) => e in r ? As(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
6
|
+
var f = (r, e, t) => Ms(r, typeof e != "symbol" ? e + "" : e, t), er = (r, e, t) => e.has(r) || tn("Cannot " + t);
|
|
7
|
+
var k = (r, e, t) => (er(r, e, "read from private field"), t ? t.call(r) : e.get(r)), P = (r, e, t) => e.has(r) ? tn("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), Ce = (r, e, t) => (er(r, e, "access private method"), t);
|
|
8
|
+
import { R as tr, M as Ot, g as Os, A as ct } from "./states-BVsyCOND.js";
|
|
9
|
+
const Rn = !1;
|
|
10
|
+
var In = Array.isArray, Ns = Array.prototype.indexOf, Rs = Array.from, or = Object.defineProperty, ft = Object.getOwnPropertyDescriptor, Is = Object.prototype, Ls = Array.prototype, Ds = Object.getPrototypeOf, rn = Object.isExtensible;
|
|
11
|
+
function Ps(r) {
|
|
12
12
|
for (var e = 0; e < r.length; e++)
|
|
13
13
|
r[e]();
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function Zs() {
|
|
16
16
|
var r, e, t = new Promise((n, s) => {
|
|
17
17
|
r = n, e = s;
|
|
18
18
|
});
|
|
19
19
|
return { promise: t, resolve: r, reject: e };
|
|
20
20
|
}
|
|
21
|
-
const
|
|
21
|
+
const H = 2, Ir = 4, Ln = 8, Xt = 16, Ee = 32, De = 64, Dn = 128, Q = 256, Pt = 512, q = 1024, ne = 2048, Se = 4096, Ge = 8192, st = 16384, Lr = 32768, js = 65536, nn = 1 << 17, Fs = 1 << 18, Dr = 1 << 19, Pn = 1 << 20, lr = 1 << 21, Pr = 1 << 22, Oe = 1 << 23, Rt = Symbol("$state"), Zr = new class extends Error {
|
|
22
22
|
constructor() {
|
|
23
23
|
super(...arguments);
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
f(this, "name", "StaleReactionError");
|
|
25
|
+
f(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
|
|
26
26
|
}
|
|
27
27
|
}();
|
|
28
|
-
function
|
|
28
|
+
function zs() {
|
|
29
29
|
throw new Error("https://svelte.dev/e/await_outside_boundary");
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Vs() {
|
|
32
32
|
throw new Error("https://svelte.dev/e/async_derived_orphan");
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function Bs(r) {
|
|
35
35
|
throw new Error("https://svelte.dev/e/effect_in_teardown");
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function Us() {
|
|
38
38
|
throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function $s(r) {
|
|
41
41
|
throw new Error("https://svelte.dev/e/effect_orphan");
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function qs() {
|
|
44
44
|
throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function Ws() {
|
|
47
47
|
throw new Error("https://svelte.dev/e/state_descriptors_fixed");
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function Ys() {
|
|
50
50
|
throw new Error("https://svelte.dev/e/state_prototype_fixed");
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function Hs() {
|
|
53
53
|
throw new Error("https://svelte.dev/e/state_unsafe_mutation");
|
|
54
54
|
}
|
|
55
|
-
const
|
|
56
|
-
function
|
|
55
|
+
const Xs = 2, F = Symbol();
|
|
56
|
+
function Zn(r) {
|
|
57
57
|
return r === this.v;
|
|
58
58
|
}
|
|
59
|
-
let
|
|
60
|
-
function
|
|
61
|
-
|
|
59
|
+
let Gs = !1, se = null;
|
|
60
|
+
function Zt(r) {
|
|
61
|
+
se = r;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
|
|
65
|
-
p:
|
|
63
|
+
function jr(r, e = !1, t) {
|
|
64
|
+
se = {
|
|
65
|
+
p: se,
|
|
66
66
|
c: null,
|
|
67
67
|
e: null,
|
|
68
68
|
s: r,
|
|
@@ -70,37 +70,37 @@ function Dr(r, e = !1, t) {
|
|
|
70
70
|
l: null
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function Fr(r) {
|
|
74
74
|
var e = (
|
|
75
75
|
/** @type {ComponentContext} */
|
|
76
|
-
|
|
76
|
+
se
|
|
77
77
|
), t = e.e;
|
|
78
78
|
if (t !== null) {
|
|
79
79
|
e.e = null;
|
|
80
80
|
for (var n of t)
|
|
81
|
-
|
|
81
|
+
Kn(n);
|
|
82
82
|
}
|
|
83
|
-
return r !== void 0 && (e.x = r),
|
|
83
|
+
return r !== void 0 && (e.x = r), se = e.p, r ?? /** @type {T} */
|
|
84
84
|
{};
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function jn() {
|
|
87
87
|
return !0;
|
|
88
88
|
}
|
|
89
|
-
const
|
|
90
|
-
function
|
|
89
|
+
const Js = /* @__PURE__ */ new WeakMap();
|
|
90
|
+
function Ks(r) {
|
|
91
91
|
var e = M;
|
|
92
92
|
if (e === null)
|
|
93
|
-
return S.f |=
|
|
94
|
-
if ((e.f &
|
|
95
|
-
if ((e.f &
|
|
96
|
-
throw !e.parent && r instanceof Error &&
|
|
93
|
+
return S.f |= Oe, r;
|
|
94
|
+
if ((e.f & Lr) === 0) {
|
|
95
|
+
if ((e.f & Dn) === 0)
|
|
96
|
+
throw !e.parent && r instanceof Error && Fn(r), r;
|
|
97
97
|
e.b.error(r);
|
|
98
98
|
} else
|
|
99
|
-
|
|
99
|
+
zr(r, e);
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function zr(r, e) {
|
|
102
102
|
for (; e !== null; ) {
|
|
103
|
-
if ((e.f &
|
|
103
|
+
if ((e.f & Dn) !== 0)
|
|
104
104
|
try {
|
|
105
105
|
e.b.error(r);
|
|
106
106
|
return;
|
|
@@ -109,50 +109,50 @@ function Zr(r, e) {
|
|
|
109
109
|
}
|
|
110
110
|
e = e.parent;
|
|
111
111
|
}
|
|
112
|
-
throw r instanceof Error &&
|
|
112
|
+
throw r instanceof Error && Fn(r), r;
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
const e =
|
|
116
|
-
e && (
|
|
114
|
+
function Fn(r) {
|
|
115
|
+
const e = Js.get(r);
|
|
116
|
+
e && (or(r, "message", {
|
|
117
117
|
value: e.message
|
|
118
|
-
}),
|
|
118
|
+
}), or(r, "stack", {
|
|
119
119
|
value: e.stack
|
|
120
120
|
}));
|
|
121
121
|
}
|
|
122
|
-
let
|
|
123
|
-
function
|
|
124
|
-
var r =
|
|
125
|
-
|
|
122
|
+
let jt = [];
|
|
123
|
+
function Qs() {
|
|
124
|
+
var r = jt;
|
|
125
|
+
jt = [], Ps(r);
|
|
126
126
|
}
|
|
127
|
-
function
|
|
128
|
-
|
|
127
|
+
function ei(r) {
|
|
128
|
+
jt.length === 0 && queueMicrotask(Qs), jt.push(r);
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function ti() {
|
|
131
131
|
for (var r = (
|
|
132
132
|
/** @type {Effect} */
|
|
133
133
|
M.b
|
|
134
134
|
); r !== null && !r.has_pending_snippet(); )
|
|
135
135
|
r = r.parent;
|
|
136
|
-
return r === null &&
|
|
136
|
+
return r === null && zs(), r;
|
|
137
137
|
}
|
|
138
138
|
// @__NO_SIDE_EFFECTS__
|
|
139
|
-
function
|
|
140
|
-
var e =
|
|
139
|
+
function ri(r) {
|
|
140
|
+
var e = H | ne, t = S !== null && (S.f & H) !== 0 ? (
|
|
141
141
|
/** @type {Derived} */
|
|
142
142
|
S
|
|
143
143
|
) : null;
|
|
144
|
-
return M === null || t !== null && (t.f &
|
|
145
|
-
ctx:
|
|
144
|
+
return M === null || t !== null && (t.f & Q) !== 0 ? e |= Q : M.f |= Dr, {
|
|
145
|
+
ctx: se,
|
|
146
146
|
deps: null,
|
|
147
147
|
effects: null,
|
|
148
|
-
equals:
|
|
148
|
+
equals: Zn,
|
|
149
149
|
f: e,
|
|
150
150
|
fn: r,
|
|
151
151
|
reactions: null,
|
|
152
152
|
rv: 0,
|
|
153
153
|
v: (
|
|
154
154
|
/** @type {V} */
|
|
155
|
-
|
|
155
|
+
F
|
|
156
156
|
),
|
|
157
157
|
wv: 0,
|
|
158
158
|
parent: t ?? M,
|
|
@@ -160,12 +160,12 @@ function Qs(r) {
|
|
|
160
160
|
};
|
|
161
161
|
}
|
|
162
162
|
// @__NO_SIDE_EFFECTS__
|
|
163
|
-
function
|
|
163
|
+
function ni(r, e) {
|
|
164
164
|
let t = (
|
|
165
165
|
/** @type {Effect | null} */
|
|
166
166
|
M
|
|
167
167
|
);
|
|
168
|
-
t === null &&
|
|
168
|
+
t === null && Vs();
|
|
169
169
|
var n = (
|
|
170
170
|
/** @type {Boundary} */
|
|
171
171
|
t.b
|
|
@@ -173,25 +173,25 @@ function ea(r, e) {
|
|
|
173
173
|
/** @type {Promise<V>} */
|
|
174
174
|
/** @type {unknown} */
|
|
175
175
|
void 0
|
|
176
|
-
),
|
|
176
|
+
), i = qn(
|
|
177
177
|
/** @type {V} */
|
|
178
|
-
|
|
179
|
-
),
|
|
180
|
-
return
|
|
178
|
+
F
|
|
179
|
+
), a = null, o = !S;
|
|
180
|
+
return vi(() => {
|
|
181
181
|
try {
|
|
182
182
|
var l = r();
|
|
183
183
|
} catch (v) {
|
|
184
184
|
l = Promise.reject(v);
|
|
185
185
|
}
|
|
186
186
|
var u = () => l;
|
|
187
|
-
s = (
|
|
187
|
+
s = (a == null ? void 0 : a.then(u, u)) ?? Promise.resolve(l), a = s;
|
|
188
188
|
var d = (
|
|
189
189
|
/** @type {Batch} */
|
|
190
|
-
|
|
191
|
-
),
|
|
192
|
-
o && (n.update_pending_count(1),
|
|
190
|
+
Z
|
|
191
|
+
), h = n.pending;
|
|
192
|
+
o && (n.update_pending_count(1), h || d.increment());
|
|
193
193
|
const p = (v, x = void 0) => {
|
|
194
|
-
|
|
194
|
+
a = null, h || d.activate(), x ? x !== Zr && (i.f |= Oe, cr(i, x)) : ((i.f & Oe) !== 0 && (i.f ^= Oe), cr(i, v)), o && (n.update_pending_count(-1), h || d.decrement()), Bn();
|
|
195
195
|
};
|
|
196
196
|
if (s.then(p, (v) => p(null, v || "unknown")), d)
|
|
197
197
|
return () => {
|
|
@@ -199,15 +199,15 @@ function ea(r, e) {
|
|
|
199
199
|
};
|
|
200
200
|
}), new Promise((l) => {
|
|
201
201
|
function u(d) {
|
|
202
|
-
function
|
|
203
|
-
d === s ? l(
|
|
202
|
+
function h() {
|
|
203
|
+
d === s ? l(i) : u(s);
|
|
204
204
|
}
|
|
205
|
-
d.then(
|
|
205
|
+
d.then(h, h);
|
|
206
206
|
}
|
|
207
207
|
u(s);
|
|
208
208
|
});
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function zn(r) {
|
|
211
211
|
var e = r.effects;
|
|
212
212
|
if (e !== null) {
|
|
213
213
|
r.effects = null;
|
|
@@ -218,9 +218,9 @@ function jn(r) {
|
|
|
218
218
|
);
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
|
-
function
|
|
221
|
+
function si(r) {
|
|
222
222
|
for (var e = r.parent; e !== null; ) {
|
|
223
|
-
if ((e.f &
|
|
223
|
+
if ((e.f & H) === 0)
|
|
224
224
|
return (
|
|
225
225
|
/** @type {Effect} */
|
|
226
226
|
e
|
|
@@ -229,69 +229,77 @@ function ta(r) {
|
|
|
229
229
|
}
|
|
230
230
|
return null;
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function Vr(r) {
|
|
233
233
|
var e, t = M;
|
|
234
|
-
|
|
234
|
+
Ke(si(r));
|
|
235
235
|
try {
|
|
236
|
-
|
|
236
|
+
zn(r), e = ls(r);
|
|
237
237
|
} finally {
|
|
238
|
-
|
|
238
|
+
Ke(t);
|
|
239
239
|
}
|
|
240
240
|
return e;
|
|
241
241
|
}
|
|
242
|
-
function
|
|
243
|
-
var e =
|
|
244
|
-
if (r.equals(e) || (r.v = e, r.wv =
|
|
245
|
-
if (
|
|
246
|
-
|
|
242
|
+
function Vn(r) {
|
|
243
|
+
var e = Vr(r);
|
|
244
|
+
if (r.equals(e) || (r.v = e, r.wv = as()), !it)
|
|
245
|
+
if (ge !== null)
|
|
246
|
+
ge.set(r, r.v);
|
|
247
247
|
else {
|
|
248
|
-
var t = (
|
|
249
|
-
|
|
248
|
+
var t = (_e || (r.f & Q) !== 0) && r.deps !== null ? Se : q;
|
|
249
|
+
ee(r, t);
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
|
-
function
|
|
253
|
-
const n =
|
|
252
|
+
function ii(r, e, t) {
|
|
253
|
+
const n = ri;
|
|
254
254
|
if (e.length === 0) {
|
|
255
255
|
t(r.map(n));
|
|
256
256
|
return;
|
|
257
257
|
}
|
|
258
|
-
var s =
|
|
258
|
+
var s = Z, i = (
|
|
259
259
|
/** @type {Effect} */
|
|
260
260
|
M
|
|
261
|
-
),
|
|
262
|
-
Promise.all(e.map((l) => /* @__PURE__ */
|
|
263
|
-
s == null || s.activate(),
|
|
261
|
+
), a = ai(), o = ti();
|
|
262
|
+
Promise.all(e.map((l) => /* @__PURE__ */ ni(l))).then((l) => {
|
|
263
|
+
s == null || s.activate(), a();
|
|
264
264
|
try {
|
|
265
265
|
t([...r.map(n), ...l]);
|
|
266
266
|
} catch (u) {
|
|
267
|
-
(
|
|
267
|
+
(i.f & st) === 0 && zr(u, i);
|
|
268
268
|
}
|
|
269
|
-
s == null || s.deactivate(),
|
|
269
|
+
s == null || s.deactivate(), Bn();
|
|
270
270
|
}).catch((l) => {
|
|
271
271
|
o.error(l);
|
|
272
272
|
});
|
|
273
273
|
}
|
|
274
|
-
function
|
|
275
|
-
var r = M, e = S, t =
|
|
274
|
+
function ai() {
|
|
275
|
+
var r = M, e = S, t = se;
|
|
276
276
|
return function() {
|
|
277
|
-
|
|
277
|
+
Ke(r), ke(e), Zt(t);
|
|
278
278
|
};
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
|
|
280
|
+
function Bn() {
|
|
281
|
+
Ke(null), ke(null), Zt(null);
|
|
282
|
+
}
|
|
283
|
+
const lt = /* @__PURE__ */ new Set();
|
|
284
|
+
let Z = null, ge = null, sn = /* @__PURE__ */ new Set(), Ft = [];
|
|
285
|
+
function Un() {
|
|
286
|
+
const r = (
|
|
287
|
+
/** @type {() => void} */
|
|
288
|
+
Ft.shift()
|
|
289
|
+
);
|
|
290
|
+
Ft.length > 0 && queueMicrotask(Un), r();
|
|
282
291
|
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
const qr = class qr {
|
|
292
|
+
let mt = [], Br = null, ur = !1;
|
|
293
|
+
var qe, We, me, xt, bt, Te, Ye, Ae, ve, He, Et, St, re, $n, It, dr;
|
|
294
|
+
const Wt = class Wt {
|
|
287
295
|
constructor() {
|
|
288
|
-
P(this,
|
|
296
|
+
P(this, re);
|
|
289
297
|
/**
|
|
290
298
|
* The current values of any sources that are updated in this batch
|
|
291
299
|
* They keys of this map are identical to `this.#previous`
|
|
292
300
|
* @type {Map<Source, any>}
|
|
293
301
|
*/
|
|
294
|
-
|
|
302
|
+
f(this, "current", /* @__PURE__ */ new Map());
|
|
295
303
|
/**
|
|
296
304
|
* The values of any sources that are updated in this batch _before_ those updates took place.
|
|
297
305
|
* They keys of this map are identical to `this.#current`
|
|
@@ -307,25 +315,25 @@ const qr = class qr {
|
|
|
307
315
|
/**
|
|
308
316
|
* The number of async effects that are currently in flight
|
|
309
317
|
*/
|
|
310
|
-
P(this,
|
|
318
|
+
P(this, me, 0);
|
|
311
319
|
/**
|
|
312
320
|
* A deferred that resolves when the batch is committed, used with `settled()`
|
|
313
321
|
* TODO replace with Promise.withResolvers once supported widely enough
|
|
314
322
|
* @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
|
|
315
323
|
*/
|
|
316
|
-
P(this,
|
|
324
|
+
P(this, xt, null);
|
|
317
325
|
/**
|
|
318
326
|
* True if an async effect inside this batch resolved and
|
|
319
327
|
* its parent branch was already deleted
|
|
320
328
|
*/
|
|
321
|
-
P(this,
|
|
329
|
+
P(this, bt, !1);
|
|
322
330
|
/**
|
|
323
331
|
* Async effects (created inside `async_derived`) encountered during processing.
|
|
324
332
|
* These run after the rest of the batch has updated, since they should
|
|
325
333
|
* always have the latest values
|
|
326
334
|
* @type {Effect[]}
|
|
327
335
|
*/
|
|
328
|
-
P(this,
|
|
336
|
+
P(this, Te, []);
|
|
329
337
|
/**
|
|
330
338
|
* The same as `#async_effects`, but for effects inside a newly-created
|
|
331
339
|
* `<svelte:boundary>` — these do not prevent the batch from committing
|
|
@@ -337,24 +345,70 @@ const qr = class qr {
|
|
|
337
345
|
* a batch is committed
|
|
338
346
|
* @type {Effect[]}
|
|
339
347
|
*/
|
|
340
|
-
P(this,
|
|
348
|
+
P(this, Ae, []);
|
|
341
349
|
/**
|
|
342
350
|
* The same as `#render_effects`, but for `$effect` (which runs after)
|
|
343
351
|
* @type {Effect[]}
|
|
344
352
|
*/
|
|
345
|
-
P(this,
|
|
353
|
+
P(this, ve, []);
|
|
346
354
|
/**
|
|
347
355
|
* Block effects, which may need to re-run on subsequent flushes
|
|
348
356
|
* in order to update internal sources (e.g. each block items)
|
|
349
357
|
* @type {Effect[]}
|
|
350
358
|
*/
|
|
351
|
-
P(this,
|
|
359
|
+
P(this, He, []);
|
|
360
|
+
/**
|
|
361
|
+
* Deferred effects (which run after async work has completed) that are DIRTY
|
|
362
|
+
* @type {Effect[]}
|
|
363
|
+
*/
|
|
364
|
+
P(this, Et, []);
|
|
365
|
+
/**
|
|
366
|
+
* Deferred effects that are MAYBE_DIRTY
|
|
367
|
+
* @type {Effect[]}
|
|
368
|
+
*/
|
|
369
|
+
P(this, St, []);
|
|
352
370
|
/**
|
|
353
371
|
* A set of branches that still exist, but will be destroyed when this batch
|
|
354
372
|
* is committed — we skip over these during `process`
|
|
355
373
|
* @type {Set<Effect>}
|
|
356
374
|
*/
|
|
357
|
-
|
|
375
|
+
f(this, "skipped_effects", /* @__PURE__ */ new Set());
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
*
|
|
379
|
+
* @param {Effect[]} root_effects
|
|
380
|
+
*/
|
|
381
|
+
process(e) {
|
|
382
|
+
var i;
|
|
383
|
+
mt = [];
|
|
384
|
+
var t = null;
|
|
385
|
+
if (lt.size > 1) {
|
|
386
|
+
t = /* @__PURE__ */ new Map(), ge = /* @__PURE__ */ new Map();
|
|
387
|
+
for (const [a, o] of this.current)
|
|
388
|
+
t.set(a, { v: a.v, wv: a.wv }), a.v = o;
|
|
389
|
+
for (const a of lt)
|
|
390
|
+
if (a !== this)
|
|
391
|
+
for (const [o, l] of k(a, qe))
|
|
392
|
+
t.has(o) || (t.set(o, { v: o.v, wv: o.wv }), o.v = l);
|
|
393
|
+
}
|
|
394
|
+
for (const a of e)
|
|
395
|
+
Ce(this, re, $n).call(this, a);
|
|
396
|
+
if (k(this, Te).length === 0 && k(this, me) === 0) {
|
|
397
|
+
Ce(this, re, dr).call(this);
|
|
398
|
+
var n = k(this, Ae), s = k(this, ve);
|
|
399
|
+
j(this, Ae, []), j(this, ve, []), j(this, He, []), Z = null, an(n), an(s), Z === null ? Z = this : lt.delete(this), (i = k(this, xt)) == null || i.resolve();
|
|
400
|
+
} else
|
|
401
|
+
Ce(this, re, It).call(this, k(this, Ae)), Ce(this, re, It).call(this, k(this, ve)), Ce(this, re, It).call(this, k(this, He));
|
|
402
|
+
if (t) {
|
|
403
|
+
for (const [a, { v: o, wv: l }] of t)
|
|
404
|
+
a.wv <= l && (a.v = o);
|
|
405
|
+
ge = null;
|
|
406
|
+
}
|
|
407
|
+
for (const a of k(this, Te))
|
|
408
|
+
ht(a);
|
|
409
|
+
for (const a of k(this, Ye))
|
|
410
|
+
ht(a);
|
|
411
|
+
j(this, Te, []), j(this, Ye, []);
|
|
358
412
|
}
|
|
359
413
|
/**
|
|
360
414
|
* Associate a change to a given source with the current
|
|
@@ -363,51 +417,33 @@ const qr = class qr {
|
|
|
363
417
|
* @param {any} value
|
|
364
418
|
*/
|
|
365
419
|
capture(e, t) {
|
|
366
|
-
k(this, qe).has(e) || k(this, qe).set(e, t),
|
|
420
|
+
k(this, qe).has(e) || k(this, qe).set(e, t), this.current.set(e, e.v);
|
|
367
421
|
}
|
|
368
422
|
activate() {
|
|
369
|
-
|
|
423
|
+
Z = this;
|
|
370
424
|
}
|
|
371
425
|
deactivate() {
|
|
372
|
-
|
|
373
|
-
for (const e of
|
|
374
|
-
if (
|
|
426
|
+
Z = null;
|
|
427
|
+
for (const e of sn)
|
|
428
|
+
if (sn.delete(e), e(), Z !== null)
|
|
375
429
|
break;
|
|
376
430
|
}
|
|
377
431
|
neuter() {
|
|
378
|
-
|
|
432
|
+
j(this, bt, !0);
|
|
379
433
|
}
|
|
380
434
|
flush() {
|
|
381
|
-
|
|
382
|
-
}
|
|
383
|
-
flush_effects() {
|
|
384
|
-
var e = Ue;
|
|
385
|
-
ir = !0;
|
|
386
|
-
try {
|
|
387
|
-
var t = 0;
|
|
388
|
-
for (an(!0); lt.length > 0; ) {
|
|
389
|
-
if (t++ > 1e3) {
|
|
390
|
-
var n, s;
|
|
391
|
-
sa();
|
|
392
|
-
}
|
|
393
|
-
ot(this, he, Vn).call(this, lt), Ne.clear();
|
|
394
|
-
}
|
|
395
|
-
} finally {
|
|
396
|
-
ir = !1, an(e), Fr = null;
|
|
397
|
-
}
|
|
435
|
+
mt.length > 0 ? oi() : Ce(this, re, dr).call(this), Z === this && (k(this, me) === 0 && lt.delete(this), this.deactivate());
|
|
398
436
|
}
|
|
399
437
|
increment() {
|
|
400
|
-
|
|
438
|
+
j(this, me, k(this, me) + 1);
|
|
401
439
|
}
|
|
402
440
|
decrement() {
|
|
403
|
-
if (
|
|
404
|
-
for (const e of k(this,
|
|
405
|
-
|
|
406
|
-
for (const e of k(this,
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
U(e, ee), Oe(e);
|
|
410
|
-
Z(this, ge, []), Z(this, de, []), this.flush();
|
|
441
|
+
if (j(this, me, k(this, me) - 1), k(this, me) === 0) {
|
|
442
|
+
for (const e of k(this, Et))
|
|
443
|
+
ee(e, ne), Je(e);
|
|
444
|
+
for (const e of k(this, St))
|
|
445
|
+
ee(e, Se), Je(e);
|
|
446
|
+
j(this, Ae, []), j(this, ve, []), this.flush();
|
|
411
447
|
} else
|
|
412
448
|
this.deactivate();
|
|
413
449
|
}
|
|
@@ -416,76 +452,42 @@ const qr = class qr {
|
|
|
416
452
|
k(this, We).add(e);
|
|
417
453
|
}
|
|
418
454
|
settled() {
|
|
419
|
-
return (k(this,
|
|
455
|
+
return (k(this, xt) ?? j(this, xt, Zs())).promise;
|
|
420
456
|
}
|
|
421
|
-
static ensure(
|
|
422
|
-
if (
|
|
423
|
-
const
|
|
424
|
-
|
|
425
|
-
|
|
457
|
+
static ensure() {
|
|
458
|
+
if (Z === null) {
|
|
459
|
+
const e = Z = new Wt();
|
|
460
|
+
lt.add(Z), Wt.enqueue(() => {
|
|
461
|
+
Z === e && e.flush();
|
|
426
462
|
});
|
|
427
463
|
}
|
|
428
|
-
return
|
|
464
|
+
return Z;
|
|
429
465
|
}
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
* @param {Effect[]} root_effects
|
|
434
|
-
*/
|
|
435
|
-
Vn = function(e) {
|
|
436
|
-
var a;
|
|
437
|
-
lt = [];
|
|
438
|
-
var t = null;
|
|
439
|
-
if (At.size > 1) {
|
|
440
|
-
t = /* @__PURE__ */ new Map(), _e = /* @__PURE__ */ new Map();
|
|
441
|
-
for (const [i, o] of k(this, wt))
|
|
442
|
-
t.set(i, { v: i.v, wv: i.wv }), i.v = o;
|
|
443
|
-
for (const i of At)
|
|
444
|
-
if (i !== this)
|
|
445
|
-
for (const [o, l] of k(i, qe))
|
|
446
|
-
t.has(o) || (t.set(o, { v: o.v, wv: o.wv }), o.v = l);
|
|
447
|
-
}
|
|
448
|
-
for (const i of e)
|
|
449
|
-
ot(this, he, Bn).call(this, i);
|
|
450
|
-
if (k(this, Ce).length === 0 && k(this, ve) === 0) {
|
|
451
|
-
var n = k(this, ge), s = k(this, de);
|
|
452
|
-
Z(this, ge, []), Z(this, de, []), Z(this, Te, []), ot(this, he, or).call(this), nn(n), nn(s), (a = k(this, kt)) == null || a.resolve();
|
|
453
|
-
} else {
|
|
454
|
-
for (const i of k(this, ge)) U(i, F);
|
|
455
|
-
for (const i of k(this, de)) U(i, F);
|
|
456
|
-
for (const i of k(this, Te)) U(i, F);
|
|
466
|
+
/** @param {() => void} task */
|
|
467
|
+
static enqueue(e) {
|
|
468
|
+
Ft.length === 0 && queueMicrotask(Un), Ft.unshift(e);
|
|
457
469
|
}
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
i.wv <= l && (i.v = o);
|
|
461
|
-
_e = null;
|
|
462
|
-
}
|
|
463
|
-
for (const i of k(this, Ce))
|
|
464
|
-
ht(i);
|
|
465
|
-
for (const i of k(this, Ye))
|
|
466
|
-
ht(i);
|
|
467
|
-
Z(this, Ce, []), Z(this, Ye, []);
|
|
468
|
-
}, /**
|
|
470
|
+
};
|
|
471
|
+
qe = new WeakMap(), We = new WeakMap(), me = new WeakMap(), xt = new WeakMap(), bt = new WeakMap(), Te = new WeakMap(), Ye = new WeakMap(), Ae = new WeakMap(), ve = new WeakMap(), He = new WeakMap(), Et = new WeakMap(), St = new WeakMap(), re = new WeakSet(), /**
|
|
469
472
|
* Traverse the effect tree, executing effects or stashing
|
|
470
473
|
* them for later execution as appropriate
|
|
471
474
|
* @param {Effect} root
|
|
472
475
|
*/
|
|
473
|
-
|
|
476
|
+
$n = function(e) {
|
|
474
477
|
var d;
|
|
475
|
-
e.f ^=
|
|
478
|
+
e.f ^= q;
|
|
476
479
|
for (var t = e.first; t !== null; ) {
|
|
477
|
-
var n = t.f, s = (n & (
|
|
478
|
-
if (!
|
|
480
|
+
var n = t.f, s = (n & (Ee | De)) !== 0, i = s && (n & q) !== 0, a = i || (n & Ge) !== 0 || this.skipped_effects.has(t);
|
|
481
|
+
if (!a && t.fn !== null) {
|
|
479
482
|
if (s)
|
|
480
|
-
t.f ^=
|
|
481
|
-
else if ((n &
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
if ((n &
|
|
485
|
-
var o = (d = t.b) != null && d.pending ? k(this, Ye) : k(this,
|
|
483
|
+
t.f ^= q;
|
|
484
|
+
else if ((n & q) === 0)
|
|
485
|
+
if ((n & Ir) !== 0)
|
|
486
|
+
k(this, ve).push(t);
|
|
487
|
+
else if ((n & Pr) !== 0) {
|
|
488
|
+
var o = (d = t.b) != null && d.pending ? k(this, Ye) : k(this, Te);
|
|
486
489
|
o.push(t);
|
|
487
|
-
} else
|
|
488
|
-
(t.f & Wt) !== 0 && k(this, Te).push(t), ht(t);
|
|
490
|
+
} else Gt(t) && ((t.f & Xt) !== 0 && k(this, He).push(t), ht(t));
|
|
489
491
|
var l = t.first;
|
|
490
492
|
if (l !== null) {
|
|
491
493
|
t = l;
|
|
@@ -496,119 +498,145 @@ Bn = function(e) {
|
|
|
496
498
|
for (t = t.next; t === null && u !== null; )
|
|
497
499
|
t = u.next, u = u.parent;
|
|
498
500
|
}
|
|
501
|
+
}, /**
|
|
502
|
+
* @param {Effect[]} effects
|
|
503
|
+
*/
|
|
504
|
+
It = function(e) {
|
|
505
|
+
for (const t of e)
|
|
506
|
+
((t.f & ne) !== 0 ? k(this, Et) : k(this, St)).push(t), ee(t, q);
|
|
507
|
+
e.length = 0;
|
|
499
508
|
}, /**
|
|
500
509
|
* Append and remove branches to/from the DOM
|
|
501
510
|
*/
|
|
502
|
-
|
|
503
|
-
if (!k(this,
|
|
511
|
+
dr = function() {
|
|
512
|
+
if (!k(this, bt))
|
|
504
513
|
for (const e of k(this, We))
|
|
505
514
|
e();
|
|
506
515
|
k(this, We).clear();
|
|
507
516
|
};
|
|
508
|
-
let
|
|
509
|
-
function
|
|
517
|
+
let vt = Wt;
|
|
518
|
+
function oi() {
|
|
519
|
+
var r = Ue;
|
|
520
|
+
ur = !0;
|
|
521
|
+
try {
|
|
522
|
+
var e = 0;
|
|
523
|
+
for (ln(!0); mt.length > 0; ) {
|
|
524
|
+
var t = vt.ensure();
|
|
525
|
+
if (e++ > 1e3) {
|
|
526
|
+
var n, s;
|
|
527
|
+
li();
|
|
528
|
+
}
|
|
529
|
+
t.process(mt), Ne.clear();
|
|
530
|
+
}
|
|
531
|
+
} finally {
|
|
532
|
+
ur = !1, ln(r), Br = null;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
function li() {
|
|
510
536
|
try {
|
|
511
|
-
|
|
537
|
+
qs();
|
|
512
538
|
} catch (r) {
|
|
513
|
-
|
|
539
|
+
zr(r, Br);
|
|
514
540
|
}
|
|
515
541
|
}
|
|
516
|
-
function
|
|
542
|
+
function an(r) {
|
|
517
543
|
var e = r.length;
|
|
518
544
|
if (e !== 0) {
|
|
519
|
-
for (var t = 0; t < e;
|
|
520
|
-
var n = r[t];
|
|
521
|
-
if ((n.f & (
|
|
522
|
-
var s =
|
|
523
|
-
if (ht(n), n.deps === null && n.first === null && n.nodes_start === null && (n.teardown === null && n.ac === null ?
|
|
545
|
+
for (var t = 0; t < e; ) {
|
|
546
|
+
var n = r[t++];
|
|
547
|
+
if ((n.f & (st | Ge)) === 0 && Gt(n)) {
|
|
548
|
+
var s = Z ? Z.current.size : 0;
|
|
549
|
+
if (ht(n), n.deps === null && n.first === null && n.nodes_start === null && (n.teardown === null && n.ac === null ? ns(n) : n.fn = null), Z !== null && Z.current.size > s && (n.f & Pn) !== 0)
|
|
524
550
|
break;
|
|
525
551
|
}
|
|
526
552
|
}
|
|
527
|
-
for (; t < e;
|
|
528
|
-
|
|
553
|
+
for (; t < e; )
|
|
554
|
+
Je(r[t++]);
|
|
529
555
|
}
|
|
530
556
|
}
|
|
531
|
-
function
|
|
532
|
-
for (var e =
|
|
557
|
+
function Je(r) {
|
|
558
|
+
for (var e = Br = r; e.parent !== null; ) {
|
|
533
559
|
e = e.parent;
|
|
534
560
|
var t = e.f;
|
|
535
|
-
if (
|
|
561
|
+
if (ur && e === M && (t & Xt) !== 0)
|
|
536
562
|
return;
|
|
537
|
-
if ((t & (
|
|
538
|
-
if ((t &
|
|
539
|
-
e.f ^=
|
|
563
|
+
if ((t & (De | Ee)) !== 0) {
|
|
564
|
+
if ((t & q) === 0) return;
|
|
565
|
+
e.f ^= q;
|
|
540
566
|
}
|
|
541
567
|
}
|
|
542
|
-
|
|
568
|
+
mt.push(e);
|
|
543
569
|
}
|
|
544
570
|
const Ne = /* @__PURE__ */ new Map();
|
|
545
|
-
function
|
|
571
|
+
function qn(r, e) {
|
|
546
572
|
var t = {
|
|
547
573
|
f: 0,
|
|
548
574
|
// TODO ideally we could skip this altogether, but it causes type errors
|
|
549
575
|
v: r,
|
|
550
576
|
reactions: null,
|
|
551
|
-
equals:
|
|
577
|
+
equals: Zn,
|
|
552
578
|
rv: 0,
|
|
553
579
|
wv: 0
|
|
554
580
|
};
|
|
555
581
|
return t;
|
|
556
582
|
}
|
|
557
583
|
// @__NO_SIDE_EFFECTS__
|
|
558
|
-
function
|
|
559
|
-
const t =
|
|
560
|
-
return
|
|
584
|
+
function $(r, e) {
|
|
585
|
+
const t = qn(r);
|
|
586
|
+
return xi(t), t;
|
|
561
587
|
}
|
|
562
588
|
function B(r, e, t = !1) {
|
|
563
589
|
S !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
|
|
564
590
|
// to ensure we error if state is set inside an inspect effect
|
|
565
|
-
(!
|
|
591
|
+
(!ie || (S.f & nn) !== 0) && jn() && (S.f & (H | Xt | Pr | nn)) !== 0 && !(U != null && U.includes(r)) && Hs();
|
|
566
592
|
let n = t ? ut(e) : e;
|
|
567
|
-
return
|
|
593
|
+
return cr(r, n);
|
|
568
594
|
}
|
|
569
|
-
function
|
|
595
|
+
function cr(r, e) {
|
|
570
596
|
if (!r.equals(e)) {
|
|
571
597
|
var t = r.v;
|
|
572
|
-
|
|
598
|
+
it ? Ne.set(r, e) : Ne.set(r, t), r.v = e;
|
|
599
|
+
var n = vt.ensure();
|
|
600
|
+
n.capture(r, t), (r.f & H) !== 0 && ((r.f & ne) !== 0 && Vr(
|
|
573
601
|
/** @type {Derived} */
|
|
574
602
|
r
|
|
575
|
-
),
|
|
603
|
+
), ee(r, (r.f & Q) === 0 ? q : Se)), r.wv = as(), Wn(r, ne), M !== null && (M.f & q) !== 0 && (M.f & (Ee | De)) === 0 && (K === null ? bi([r]) : K.push(r));
|
|
576
604
|
}
|
|
577
605
|
return e;
|
|
578
606
|
}
|
|
579
|
-
function
|
|
607
|
+
function rr(r) {
|
|
580
608
|
B(r, r.v + 1);
|
|
581
609
|
}
|
|
582
|
-
function
|
|
610
|
+
function Wn(r, e) {
|
|
583
611
|
var t = r.reactions;
|
|
584
612
|
if (t !== null)
|
|
585
613
|
for (var n = t.length, s = 0; s < n; s++) {
|
|
586
|
-
var
|
|
587
|
-
|
|
614
|
+
var i = t[s], a = i.f, o = (a & ne) === 0;
|
|
615
|
+
o && ee(i, e), (a & H) !== 0 ? Wn(
|
|
588
616
|
/** @type {Derived} */
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
) :
|
|
617
|
+
i,
|
|
618
|
+
Se
|
|
619
|
+
) : o && Je(
|
|
592
620
|
/** @type {Effect} */
|
|
593
|
-
|
|
594
|
-
)
|
|
621
|
+
i
|
|
622
|
+
);
|
|
595
623
|
}
|
|
596
624
|
}
|
|
597
625
|
function ut(r) {
|
|
598
|
-
if (typeof r != "object" || r === null ||
|
|
626
|
+
if (typeof r != "object" || r === null || Rt in r)
|
|
599
627
|
return r;
|
|
600
|
-
const e =
|
|
601
|
-
if (e !==
|
|
628
|
+
const e = Ds(r);
|
|
629
|
+
if (e !== Is && e !== Ls)
|
|
602
630
|
return r;
|
|
603
|
-
var t = /* @__PURE__ */ new Map(), n =
|
|
604
|
-
if (Re ===
|
|
631
|
+
var t = /* @__PURE__ */ new Map(), n = In(r), s = /* @__PURE__ */ $(0), i = Re, a = (o) => {
|
|
632
|
+
if (Re === i)
|
|
605
633
|
return o();
|
|
606
634
|
var l = S, u = Re;
|
|
607
|
-
|
|
635
|
+
ke(null), dn(i);
|
|
608
636
|
var d = o();
|
|
609
|
-
return
|
|
637
|
+
return ke(l), dn(u), d;
|
|
610
638
|
};
|
|
611
|
-
return n && t.set("length", /* @__PURE__ */
|
|
639
|
+
return n && t.set("length", /* @__PURE__ */ $(
|
|
612
640
|
/** @type {any[]} */
|
|
613
641
|
r.length
|
|
614
642
|
)), new Proxy(
|
|
@@ -616,35 +644,35 @@ function ut(r) {
|
|
|
616
644
|
r,
|
|
617
645
|
{
|
|
618
646
|
defineProperty(o, l, u) {
|
|
619
|
-
(!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) &&
|
|
647
|
+
(!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Ws();
|
|
620
648
|
var d = t.get(l);
|
|
621
|
-
return d === void 0 ? d =
|
|
622
|
-
var
|
|
623
|
-
return t.set(l,
|
|
649
|
+
return d === void 0 ? d = a(() => {
|
|
650
|
+
var h = /* @__PURE__ */ $(u.value);
|
|
651
|
+
return t.set(l, h), h;
|
|
624
652
|
}) : B(d, u.value, !0), !0;
|
|
625
653
|
},
|
|
626
654
|
deleteProperty(o, l) {
|
|
627
655
|
var u = t.get(l);
|
|
628
656
|
if (u === void 0) {
|
|
629
657
|
if (l in o) {
|
|
630
|
-
const d =
|
|
631
|
-
t.set(l, d),
|
|
658
|
+
const d = a(() => /* @__PURE__ */ $(F));
|
|
659
|
+
t.set(l, d), rr(s);
|
|
632
660
|
}
|
|
633
661
|
} else
|
|
634
|
-
B(u,
|
|
662
|
+
B(u, F), rr(s);
|
|
635
663
|
return !0;
|
|
636
664
|
},
|
|
637
665
|
get(o, l, u) {
|
|
638
666
|
var v;
|
|
639
|
-
if (l ===
|
|
667
|
+
if (l === Rt)
|
|
640
668
|
return r;
|
|
641
|
-
var d = t.get(l),
|
|
642
|
-
if (d === void 0 && (!
|
|
643
|
-
var x = ut(
|
|
669
|
+
var d = t.get(l), h = l in o;
|
|
670
|
+
if (d === void 0 && (!h || (v = ft(o, l)) != null && v.writable) && (d = a(() => {
|
|
671
|
+
var x = ut(h ? o[l] : F), N = /* @__PURE__ */ $(x);
|
|
644
672
|
return N;
|
|
645
673
|
}), t.set(l, d)), d !== void 0) {
|
|
646
674
|
var p = L(d);
|
|
647
|
-
return p ===
|
|
675
|
+
return p === F ? void 0 : p;
|
|
648
676
|
}
|
|
649
677
|
return Reflect.get(o, l, u);
|
|
650
678
|
},
|
|
@@ -654,8 +682,8 @@ function ut(r) {
|
|
|
654
682
|
var d = t.get(l);
|
|
655
683
|
d && (u.value = L(d));
|
|
656
684
|
} else if (u === void 0) {
|
|
657
|
-
var
|
|
658
|
-
if (
|
|
685
|
+
var h = t.get(l), p = h == null ? void 0 : h.v;
|
|
686
|
+
if (h !== void 0 && p !== F)
|
|
659
687
|
return {
|
|
660
688
|
enumerable: !0,
|
|
661
689
|
configurable: !0,
|
|
@@ -667,110 +695,110 @@ function ut(r) {
|
|
|
667
695
|
},
|
|
668
696
|
has(o, l) {
|
|
669
697
|
var p;
|
|
670
|
-
if (l ===
|
|
698
|
+
if (l === Rt)
|
|
671
699
|
return !0;
|
|
672
|
-
var u = t.get(l), d = u !== void 0 && u.v !==
|
|
700
|
+
var u = t.get(l), d = u !== void 0 && u.v !== F || Reflect.has(o, l);
|
|
673
701
|
if (u !== void 0 || M !== null && (!d || (p = ft(o, l)) != null && p.writable)) {
|
|
674
|
-
u === void 0 && (u =
|
|
675
|
-
var v = d ? ut(o[l]) :
|
|
702
|
+
u === void 0 && (u = a(() => {
|
|
703
|
+
var v = d ? ut(o[l]) : F, x = /* @__PURE__ */ $(v);
|
|
676
704
|
return x;
|
|
677
705
|
}), t.set(l, u));
|
|
678
|
-
var
|
|
679
|
-
if (
|
|
706
|
+
var h = L(u);
|
|
707
|
+
if (h === F)
|
|
680
708
|
return !1;
|
|
681
709
|
}
|
|
682
710
|
return d;
|
|
683
711
|
},
|
|
684
712
|
set(o, l, u, d) {
|
|
685
713
|
var z;
|
|
686
|
-
var
|
|
714
|
+
var h = t.get(l), p = l in o;
|
|
687
715
|
if (n && l === "length")
|
|
688
716
|
for (var v = u; v < /** @type {Source<number>} */
|
|
689
|
-
|
|
717
|
+
h.v; v += 1) {
|
|
690
718
|
var x = t.get(v + "");
|
|
691
|
-
x !== void 0 ? B(x,
|
|
719
|
+
x !== void 0 ? B(x, F) : v in o && (x = a(() => /* @__PURE__ */ $(F)), t.set(v + "", x));
|
|
692
720
|
}
|
|
693
|
-
if (
|
|
694
|
-
(!p || (z = ft(o, l)) != null && z.writable) && (
|
|
721
|
+
if (h === void 0)
|
|
722
|
+
(!p || (z = ft(o, l)) != null && z.writable) && (h = a(() => /* @__PURE__ */ $(void 0)), B(h, ut(u)), t.set(l, h));
|
|
695
723
|
else {
|
|
696
|
-
p =
|
|
697
|
-
var N =
|
|
698
|
-
B(
|
|
724
|
+
p = h.v !== F;
|
|
725
|
+
var N = a(() => ut(u));
|
|
726
|
+
B(h, N);
|
|
699
727
|
}
|
|
700
728
|
var I = Reflect.getOwnPropertyDescriptor(o, l);
|
|
701
729
|
if (I != null && I.set && I.set.call(d, u), !p) {
|
|
702
730
|
if (n && typeof l == "string") {
|
|
703
|
-
var
|
|
731
|
+
var G = (
|
|
704
732
|
/** @type {Source<number>} */
|
|
705
733
|
t.get("length")
|
|
706
734
|
), T = Number(l);
|
|
707
|
-
Number.isInteger(T) && T >=
|
|
735
|
+
Number.isInteger(T) && T >= G.v && B(G, T + 1);
|
|
708
736
|
}
|
|
709
|
-
|
|
737
|
+
rr(s);
|
|
710
738
|
}
|
|
711
739
|
return !0;
|
|
712
740
|
},
|
|
713
741
|
ownKeys(o) {
|
|
714
742
|
L(s);
|
|
715
|
-
var l = Reflect.ownKeys(o).filter((
|
|
716
|
-
var p = t.get(
|
|
717
|
-
return p === void 0 || p.v !==
|
|
743
|
+
var l = Reflect.ownKeys(o).filter((h) => {
|
|
744
|
+
var p = t.get(h);
|
|
745
|
+
return p === void 0 || p.v !== F;
|
|
718
746
|
});
|
|
719
747
|
for (var [u, d] of t)
|
|
720
|
-
d.v !==
|
|
748
|
+
d.v !== F && !(u in o) && l.push(u);
|
|
721
749
|
return l;
|
|
722
750
|
},
|
|
723
751
|
setPrototypeOf() {
|
|
724
|
-
|
|
752
|
+
Ys();
|
|
725
753
|
}
|
|
726
754
|
}
|
|
727
755
|
);
|
|
728
756
|
}
|
|
729
|
-
var
|
|
730
|
-
function
|
|
731
|
-
if (
|
|
732
|
-
|
|
757
|
+
var on, Yn, Hn, Xn;
|
|
758
|
+
function ui() {
|
|
759
|
+
if (on === void 0) {
|
|
760
|
+
on = window, Yn = /Firefox/.test(navigator.userAgent);
|
|
733
761
|
var r = Element.prototype, e = Node.prototype, t = Text.prototype;
|
|
734
|
-
|
|
762
|
+
Hn = ft(e, "firstChild").get, Xn = ft(e, "nextSibling").get, rn(r) && (r.__click = void 0, r.__className = void 0, r.__attributes = null, r.__style = void 0, r.__e = void 0), rn(t) && (t.__t = void 0);
|
|
735
763
|
}
|
|
736
764
|
}
|
|
737
|
-
function
|
|
765
|
+
function di(r = "") {
|
|
738
766
|
return document.createTextNode(r);
|
|
739
767
|
}
|
|
740
768
|
// @__NO_SIDE_EFFECTS__
|
|
741
|
-
function
|
|
742
|
-
return
|
|
769
|
+
function Gn(r) {
|
|
770
|
+
return Hn.call(r);
|
|
743
771
|
}
|
|
744
772
|
// @__NO_SIDE_EFFECTS__
|
|
745
|
-
function
|
|
746
|
-
return
|
|
773
|
+
function Jn(r) {
|
|
774
|
+
return Xn.call(r);
|
|
747
775
|
}
|
|
748
|
-
function
|
|
749
|
-
return /* @__PURE__ */
|
|
776
|
+
function fr(r, e) {
|
|
777
|
+
return /* @__PURE__ */ Gn(r);
|
|
750
778
|
}
|
|
751
|
-
function
|
|
779
|
+
function ci(r, e = 1, t = !1) {
|
|
752
780
|
let n = r;
|
|
753
781
|
for (; e--; )
|
|
754
782
|
n = /** @type {TemplateNode} */
|
|
755
|
-
/* @__PURE__ */
|
|
783
|
+
/* @__PURE__ */ Jn(n);
|
|
756
784
|
return n;
|
|
757
785
|
}
|
|
758
|
-
function
|
|
759
|
-
M === null && S === null &&
|
|
786
|
+
function fi(r) {
|
|
787
|
+
M === null && S === null && $s(), S !== null && (S.f & Q) !== 0 && M === null && Us(), it && Bs();
|
|
760
788
|
}
|
|
761
|
-
function
|
|
789
|
+
function hi(r, e) {
|
|
762
790
|
var t = e.last;
|
|
763
791
|
t === null ? e.last = e.first = r : (t.next = r, r.prev = t, e.last = r);
|
|
764
792
|
}
|
|
765
793
|
function Pe(r, e, t, n = !0) {
|
|
766
794
|
var s = M;
|
|
767
|
-
s !== null && (s.f &
|
|
768
|
-
var
|
|
769
|
-
ctx:
|
|
795
|
+
s !== null && (s.f & Ge) !== 0 && (r |= Ge);
|
|
796
|
+
var i = {
|
|
797
|
+
ctx: se,
|
|
770
798
|
deps: null,
|
|
771
799
|
nodes_start: null,
|
|
772
800
|
nodes_end: null,
|
|
773
|
-
f: r |
|
|
801
|
+
f: r | ne,
|
|
774
802
|
first: null,
|
|
775
803
|
fn: e,
|
|
776
804
|
last: null,
|
|
@@ -785,127 +813,127 @@ function Pe(r, e, t, n = !0) {
|
|
|
785
813
|
};
|
|
786
814
|
if (t)
|
|
787
815
|
try {
|
|
788
|
-
ht(
|
|
816
|
+
ht(i), i.f |= Lr;
|
|
789
817
|
} catch (l) {
|
|
790
|
-
throw Ie(
|
|
818
|
+
throw Ie(i), l;
|
|
791
819
|
}
|
|
792
|
-
else e !== null &&
|
|
793
|
-
var
|
|
794
|
-
if (!
|
|
820
|
+
else e !== null && Je(i);
|
|
821
|
+
var a = t && i.deps === null && i.first === null && i.nodes_start === null && i.teardown === null && (i.f & Dr) === 0;
|
|
822
|
+
if (!a && n && (s !== null && hi(i, s), S !== null && (S.f & H) !== 0 && (r & De) === 0)) {
|
|
795
823
|
var o = (
|
|
796
824
|
/** @type {Derived} */
|
|
797
825
|
S
|
|
798
826
|
);
|
|
799
|
-
(o.effects ?? (o.effects = [])).push(
|
|
827
|
+
(o.effects ?? (o.effects = [])).push(i);
|
|
800
828
|
}
|
|
801
|
-
return
|
|
829
|
+
return i;
|
|
802
830
|
}
|
|
803
|
-
function
|
|
804
|
-
|
|
831
|
+
function de(r) {
|
|
832
|
+
fi();
|
|
805
833
|
var e = (
|
|
806
834
|
/** @type {Effect} */
|
|
807
835
|
M.f
|
|
808
|
-
), t = !S && (e &
|
|
836
|
+
), t = !S && (e & Ee) !== 0 && (e & Lr) === 0;
|
|
809
837
|
if (t) {
|
|
810
838
|
var n = (
|
|
811
839
|
/** @type {ComponentContext} */
|
|
812
|
-
|
|
840
|
+
se
|
|
813
841
|
);
|
|
814
842
|
(n.e ?? (n.e = [])).push(r);
|
|
815
843
|
} else
|
|
816
|
-
return
|
|
844
|
+
return Kn(r);
|
|
817
845
|
}
|
|
818
|
-
function
|
|
819
|
-
return Pe(
|
|
846
|
+
function Kn(r) {
|
|
847
|
+
return Pe(Ir | Pn, r, !1);
|
|
820
848
|
}
|
|
821
|
-
function
|
|
822
|
-
|
|
823
|
-
const e = Pe(
|
|
849
|
+
function pi(r) {
|
|
850
|
+
vt.ensure();
|
|
851
|
+
const e = Pe(De, r, !0);
|
|
824
852
|
return (t = {}) => new Promise((n) => {
|
|
825
|
-
t.outro ?
|
|
853
|
+
t.outro ? wi(e, () => {
|
|
826
854
|
Ie(e), n(void 0);
|
|
827
855
|
}) : (Ie(e), n(void 0));
|
|
828
856
|
});
|
|
829
857
|
}
|
|
830
|
-
function
|
|
831
|
-
return Pe(
|
|
858
|
+
function mi(r) {
|
|
859
|
+
return Pe(Ir, r, !1);
|
|
832
860
|
}
|
|
833
|
-
function
|
|
834
|
-
return Pe(
|
|
861
|
+
function vi(r) {
|
|
862
|
+
return Pe(Pr | Dr, r, !0);
|
|
835
863
|
}
|
|
836
|
-
function
|
|
837
|
-
return Pe(
|
|
864
|
+
function Qn(r, e = 0) {
|
|
865
|
+
return Pe(Ln | e, r, !0);
|
|
838
866
|
}
|
|
839
|
-
function
|
|
840
|
-
|
|
841
|
-
Pe(
|
|
867
|
+
function es(r, e = [], t = []) {
|
|
868
|
+
ii(e, t, (n) => {
|
|
869
|
+
Pe(Ln, () => r(...n.map(L)), !0);
|
|
842
870
|
});
|
|
843
871
|
}
|
|
844
|
-
function
|
|
845
|
-
return Pe(
|
|
872
|
+
function gi(r, e = !0) {
|
|
873
|
+
return Pe(Ee, r, !0, e);
|
|
846
874
|
}
|
|
847
|
-
function
|
|
875
|
+
function ts(r) {
|
|
848
876
|
var e = r.teardown;
|
|
849
877
|
if (e !== null) {
|
|
850
|
-
const t =
|
|
851
|
-
|
|
878
|
+
const t = it, n = S;
|
|
879
|
+
un(!0), ke(null);
|
|
852
880
|
try {
|
|
853
881
|
e.call(null);
|
|
854
882
|
} finally {
|
|
855
|
-
|
|
883
|
+
un(t), ke(n);
|
|
856
884
|
}
|
|
857
885
|
}
|
|
858
886
|
}
|
|
859
|
-
function
|
|
887
|
+
function rs(r, e = !1) {
|
|
860
888
|
var s;
|
|
861
889
|
var t = r.first;
|
|
862
890
|
for (r.first = r.last = null; t !== null; ) {
|
|
863
|
-
(s = t.ac) == null || s.abort(
|
|
891
|
+
(s = t.ac) == null || s.abort(Zr);
|
|
864
892
|
var n = t.next;
|
|
865
|
-
(t.f &
|
|
893
|
+
(t.f & De) !== 0 ? t.parent = null : Ie(t, e), t = n;
|
|
866
894
|
}
|
|
867
895
|
}
|
|
868
|
-
function
|
|
896
|
+
function _i(r) {
|
|
869
897
|
for (var e = r.first; e !== null; ) {
|
|
870
898
|
var t = e.next;
|
|
871
|
-
(e.f &
|
|
899
|
+
(e.f & Ee) === 0 && Ie(e), e = t;
|
|
872
900
|
}
|
|
873
901
|
}
|
|
874
902
|
function Ie(r, e = !0) {
|
|
875
903
|
var t = !1;
|
|
876
|
-
(e || (r.f &
|
|
904
|
+
(e || (r.f & Fs) !== 0) && r.nodes_start !== null && r.nodes_end !== null && (yi(
|
|
877
905
|
r.nodes_start,
|
|
878
906
|
/** @type {TemplateNode} */
|
|
879
907
|
r.nodes_end
|
|
880
|
-
), t = !0),
|
|
908
|
+
), t = !0), rs(r, e && !t), zt(r, 0), ee(r, st);
|
|
881
909
|
var n = r.transitions;
|
|
882
910
|
if (n !== null)
|
|
883
|
-
for (const
|
|
884
|
-
|
|
885
|
-
|
|
911
|
+
for (const i of n)
|
|
912
|
+
i.stop();
|
|
913
|
+
ts(r);
|
|
886
914
|
var s = r.parent;
|
|
887
|
-
s !== null && s.first !== null &&
|
|
915
|
+
s !== null && s.first !== null && ns(r), r.next = r.prev = r.teardown = r.ctx = r.deps = r.fn = r.nodes_start = r.nodes_end = r.ac = null;
|
|
888
916
|
}
|
|
889
|
-
function
|
|
917
|
+
function yi(r, e) {
|
|
890
918
|
for (; r !== null; ) {
|
|
891
919
|
var t = r === e ? null : (
|
|
892
920
|
/** @type {TemplateNode} */
|
|
893
|
-
/* @__PURE__ */
|
|
921
|
+
/* @__PURE__ */ Jn(r)
|
|
894
922
|
);
|
|
895
923
|
r.remove(), r = t;
|
|
896
924
|
}
|
|
897
925
|
}
|
|
898
|
-
function
|
|
926
|
+
function ns(r) {
|
|
899
927
|
var e = r.parent, t = r.prev, n = r.next;
|
|
900
928
|
t !== null && (t.next = n), n !== null && (n.prev = t), e !== null && (e.first === r && (e.first = n), e.last === r && (e.last = t));
|
|
901
929
|
}
|
|
902
|
-
function
|
|
930
|
+
function wi(r, e) {
|
|
903
931
|
var t = [];
|
|
904
|
-
|
|
932
|
+
ss(r, t, !0), ki(t, () => {
|
|
905
933
|
Ie(r), e && e();
|
|
906
934
|
});
|
|
907
935
|
}
|
|
908
|
-
function
|
|
936
|
+
function ki(r, e) {
|
|
909
937
|
var t = r.length;
|
|
910
938
|
if (t > 0) {
|
|
911
939
|
var n = () => --t || e();
|
|
@@ -914,260 +942,260 @@ function ga(r, e) {
|
|
|
914
942
|
} else
|
|
915
943
|
e();
|
|
916
944
|
}
|
|
917
|
-
function
|
|
918
|
-
if ((r.f &
|
|
919
|
-
if (r.f ^=
|
|
920
|
-
for (const
|
|
921
|
-
(
|
|
945
|
+
function ss(r, e, t) {
|
|
946
|
+
if ((r.f & Ge) === 0) {
|
|
947
|
+
if (r.f ^= Ge, r.transitions !== null)
|
|
948
|
+
for (const a of r.transitions)
|
|
949
|
+
(a.is_global || t) && e.push(a);
|
|
922
950
|
for (var n = r.first; n !== null; ) {
|
|
923
|
-
var s = n.next,
|
|
924
|
-
|
|
951
|
+
var s = n.next, i = (n.f & js) !== 0 || (n.f & Ee) !== 0;
|
|
952
|
+
ss(n, e, i ? t : !1), n = s;
|
|
925
953
|
}
|
|
926
954
|
}
|
|
927
955
|
}
|
|
928
956
|
let Ue = !1;
|
|
929
|
-
function
|
|
957
|
+
function ln(r) {
|
|
930
958
|
Ue = r;
|
|
931
959
|
}
|
|
932
|
-
let
|
|
933
|
-
function
|
|
934
|
-
|
|
960
|
+
let it = !1;
|
|
961
|
+
function un(r) {
|
|
962
|
+
it = r;
|
|
935
963
|
}
|
|
936
|
-
let S = null,
|
|
937
|
-
function
|
|
964
|
+
let S = null, ie = !1;
|
|
965
|
+
function ke(r) {
|
|
938
966
|
S = r;
|
|
939
967
|
}
|
|
940
968
|
let M = null;
|
|
941
|
-
function
|
|
969
|
+
function Ke(r) {
|
|
942
970
|
M = r;
|
|
943
971
|
}
|
|
944
|
-
let
|
|
945
|
-
function
|
|
946
|
-
S !== null && (
|
|
972
|
+
let U = null;
|
|
973
|
+
function xi(r) {
|
|
974
|
+
S !== null && (U === null ? U = [r] : U.push(r));
|
|
947
975
|
}
|
|
948
|
-
let V = null, Y = 0,
|
|
949
|
-
function
|
|
950
|
-
|
|
976
|
+
let V = null, Y = 0, K = null;
|
|
977
|
+
function bi(r) {
|
|
978
|
+
K = r;
|
|
951
979
|
}
|
|
952
|
-
let
|
|
953
|
-
function
|
|
980
|
+
let is = 1, gt = 0, Re = gt;
|
|
981
|
+
function dn(r) {
|
|
954
982
|
Re = r;
|
|
955
983
|
}
|
|
956
|
-
let
|
|
957
|
-
function
|
|
958
|
-
return ++
|
|
984
|
+
let _e = !1;
|
|
985
|
+
function as() {
|
|
986
|
+
return ++is;
|
|
959
987
|
}
|
|
960
|
-
function
|
|
961
|
-
var
|
|
988
|
+
function Gt(r) {
|
|
989
|
+
var h;
|
|
962
990
|
var e = r.f;
|
|
963
|
-
if ((e &
|
|
991
|
+
if ((e & ne) !== 0)
|
|
964
992
|
return !0;
|
|
965
|
-
if ((e &
|
|
966
|
-
var t = r.deps, n = (e &
|
|
993
|
+
if ((e & Se) !== 0) {
|
|
994
|
+
var t = r.deps, n = (e & Q) !== 0;
|
|
967
995
|
if (t !== null) {
|
|
968
|
-
var s,
|
|
969
|
-
if ((
|
|
996
|
+
var s, i, a = (e & Pt) !== 0, o = n && M !== null && !_e, l = t.length;
|
|
997
|
+
if ((a || o) && (M === null || (M.f & st) === 0)) {
|
|
970
998
|
var u = (
|
|
971
999
|
/** @type {Derived} */
|
|
972
1000
|
r
|
|
973
1001
|
), d = u.parent;
|
|
974
1002
|
for (s = 0; s < l; s++)
|
|
975
|
-
|
|
976
|
-
|
|
1003
|
+
i = t[s], (a || !((h = i == null ? void 0 : i.reactions) != null && h.includes(u))) && (i.reactions ?? (i.reactions = [])).push(u);
|
|
1004
|
+
a && (u.f ^= Pt), o && d !== null && (d.f & Q) === 0 && (u.f ^= Q);
|
|
977
1005
|
}
|
|
978
1006
|
for (s = 0; s < l; s++)
|
|
979
|
-
if (
|
|
1007
|
+
if (i = t[s], Gt(
|
|
980
1008
|
/** @type {Derived} */
|
|
981
|
-
|
|
982
|
-
) &&
|
|
1009
|
+
i
|
|
1010
|
+
) && Vn(
|
|
983
1011
|
/** @type {Derived} */
|
|
984
|
-
|
|
985
|
-
),
|
|
1012
|
+
i
|
|
1013
|
+
), i.wv > r.wv)
|
|
986
1014
|
return !0;
|
|
987
1015
|
}
|
|
988
|
-
(!n || M !== null && !
|
|
1016
|
+
(!n || M !== null && !_e) && ee(r, q);
|
|
989
1017
|
}
|
|
990
1018
|
return !1;
|
|
991
1019
|
}
|
|
992
|
-
function
|
|
1020
|
+
function os(r, e, t = !0) {
|
|
993
1021
|
var n = r.reactions;
|
|
994
|
-
if (n !== null && !(
|
|
1022
|
+
if (n !== null && !(U != null && U.includes(r)))
|
|
995
1023
|
for (var s = 0; s < n.length; s++) {
|
|
996
|
-
var
|
|
997
|
-
(
|
|
1024
|
+
var i = n[s];
|
|
1025
|
+
(i.f & H) !== 0 ? os(
|
|
998
1026
|
/** @type {Derived} */
|
|
999
|
-
|
|
1027
|
+
i,
|
|
1000
1028
|
e,
|
|
1001
1029
|
!1
|
|
1002
|
-
) : e ===
|
|
1030
|
+
) : e === i && (t ? ee(i, ne) : (i.f & q) !== 0 && ee(i, Se), Je(
|
|
1003
1031
|
/** @type {Effect} */
|
|
1004
|
-
|
|
1032
|
+
i
|
|
1005
1033
|
));
|
|
1006
1034
|
}
|
|
1007
1035
|
}
|
|
1008
|
-
function
|
|
1036
|
+
function ls(r) {
|
|
1009
1037
|
var x;
|
|
1010
|
-
var e = V, t = Y, n =
|
|
1038
|
+
var e = V, t = Y, n = K, s = S, i = _e, a = U, o = se, l = ie, u = Re, d = r.f;
|
|
1011
1039
|
V = /** @type {null | Value[]} */
|
|
1012
|
-
null, Y = 0,
|
|
1040
|
+
null, Y = 0, K = null, _e = (d & Q) !== 0 && (ie || !Ue || S === null), S = (d & (Ee | De)) === 0 ? r : null, U = null, Zt(r.ctx), ie = !1, Re = ++gt, r.ac !== null && (r.ac.abort(Zr), r.ac = null);
|
|
1013
1041
|
try {
|
|
1014
|
-
r.f |=
|
|
1015
|
-
var
|
|
1042
|
+
r.f |= lr;
|
|
1043
|
+
var h = (
|
|
1016
1044
|
/** @type {Function} */
|
|
1017
1045
|
(0, r.fn)()
|
|
1018
1046
|
), p = r.deps;
|
|
1019
1047
|
if (V !== null) {
|
|
1020
1048
|
var v;
|
|
1021
|
-
if (
|
|
1049
|
+
if (zt(r, Y), p !== null && Y > 0)
|
|
1022
1050
|
for (p.length = Y + V.length, v = 0; v < V.length; v++)
|
|
1023
1051
|
p[Y + v] = V[v];
|
|
1024
1052
|
else
|
|
1025
1053
|
r.deps = p = V;
|
|
1026
|
-
if (!
|
|
1027
|
-
(d &
|
|
1054
|
+
if (!_e || // Deriveds that already have reactions can cleanup, so we still add them as reactions
|
|
1055
|
+
(d & H) !== 0 && /** @type {import('#client').Derived} */
|
|
1028
1056
|
r.reactions !== null)
|
|
1029
1057
|
for (v = Y; v < p.length; v++)
|
|
1030
1058
|
((x = p[v]).reactions ?? (x.reactions = [])).push(r);
|
|
1031
|
-
} else p !== null && Y < p.length && (
|
|
1032
|
-
if (
|
|
1059
|
+
} else p !== null && Y < p.length && (zt(r, Y), p.length = Y);
|
|
1060
|
+
if (jn() && K !== null && !ie && p !== null && (r.f & (H | Se | ne)) === 0)
|
|
1033
1061
|
for (v = 0; v < /** @type {Source[]} */
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1062
|
+
K.length; v++)
|
|
1063
|
+
os(
|
|
1064
|
+
K[v],
|
|
1037
1065
|
/** @type {Effect} */
|
|
1038
1066
|
r
|
|
1039
1067
|
);
|
|
1040
|
-
return s !== null && s !== r && (
|
|
1041
|
-
|
|
1068
|
+
return s !== null && s !== r && (gt++, K !== null && (n === null ? n = K : n.push(.../** @type {Source[]} */
|
|
1069
|
+
K))), (r.f & Oe) !== 0 && (r.f ^= Oe), h;
|
|
1042
1070
|
} catch (N) {
|
|
1043
|
-
return
|
|
1071
|
+
return Ks(N);
|
|
1044
1072
|
} finally {
|
|
1045
|
-
r.f ^=
|
|
1073
|
+
r.f ^= lr, V = e, Y = t, K = n, S = s, _e = i, U = a, Zt(o), ie = l, Re = u;
|
|
1046
1074
|
}
|
|
1047
1075
|
}
|
|
1048
|
-
function
|
|
1076
|
+
function Ei(r, e) {
|
|
1049
1077
|
let t = e.reactions;
|
|
1050
1078
|
if (t !== null) {
|
|
1051
|
-
var n =
|
|
1079
|
+
var n = Ns.call(t, r);
|
|
1052
1080
|
if (n !== -1) {
|
|
1053
1081
|
var s = t.length - 1;
|
|
1054
1082
|
s === 0 ? t = e.reactions = null : (t[n] = t[s], t.pop());
|
|
1055
1083
|
}
|
|
1056
1084
|
}
|
|
1057
|
-
t === null && (e.f &
|
|
1085
|
+
t === null && (e.f & H) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
|
|
1058
1086
|
// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
|
|
1059
1087
|
// allows us to skip the expensive work of disconnecting and immediately reconnecting it
|
|
1060
|
-
(V === null || !V.includes(e)) && (
|
|
1088
|
+
(V === null || !V.includes(e)) && (ee(e, Se), (e.f & (Q | Pt)) === 0 && (e.f ^= Pt), zn(
|
|
1061
1089
|
/** @type {Derived} **/
|
|
1062
1090
|
e
|
|
1063
|
-
),
|
|
1091
|
+
), zt(
|
|
1064
1092
|
/** @type {Derived} **/
|
|
1065
1093
|
e,
|
|
1066
1094
|
0
|
|
1067
1095
|
));
|
|
1068
1096
|
}
|
|
1069
|
-
function
|
|
1097
|
+
function zt(r, e) {
|
|
1070
1098
|
var t = r.deps;
|
|
1071
1099
|
if (t !== null)
|
|
1072
1100
|
for (var n = e; n < t.length; n++)
|
|
1073
|
-
|
|
1101
|
+
Ei(r, t[n]);
|
|
1074
1102
|
}
|
|
1075
1103
|
function ht(r) {
|
|
1076
1104
|
var e = r.f;
|
|
1077
|
-
if ((e &
|
|
1078
|
-
|
|
1105
|
+
if ((e & st) === 0) {
|
|
1106
|
+
ee(r, q);
|
|
1079
1107
|
var t = M, n = Ue;
|
|
1080
1108
|
M = r, Ue = !0;
|
|
1081
1109
|
try {
|
|
1082
|
-
(e &
|
|
1083
|
-
var s =
|
|
1084
|
-
r.teardown = typeof s == "function" ? s : null, r.wv =
|
|
1085
|
-
var
|
|
1086
|
-
|
|
1110
|
+
(e & Xt) !== 0 ? _i(r) : rs(r), ts(r);
|
|
1111
|
+
var s = ls(r);
|
|
1112
|
+
r.teardown = typeof s == "function" ? s : null, r.wv = is;
|
|
1113
|
+
var i;
|
|
1114
|
+
Rn && Gs && (r.f & ne) !== 0 && r.deps;
|
|
1087
1115
|
} finally {
|
|
1088
1116
|
Ue = n, M = t;
|
|
1089
1117
|
}
|
|
1090
1118
|
}
|
|
1091
1119
|
}
|
|
1092
1120
|
function L(r) {
|
|
1093
|
-
var e = r.f, t = (e &
|
|
1094
|
-
if (S !== null && !
|
|
1095
|
-
var n = M !== null && (M.f &
|
|
1096
|
-
if (!n && !(
|
|
1121
|
+
var e = r.f, t = (e & H) !== 0;
|
|
1122
|
+
if (S !== null && !ie) {
|
|
1123
|
+
var n = M !== null && (M.f & st) !== 0;
|
|
1124
|
+
if (!n && !(U != null && U.includes(r))) {
|
|
1097
1125
|
var s = S.deps;
|
|
1098
|
-
if ((S.f &
|
|
1099
|
-
r.rv <
|
|
1126
|
+
if ((S.f & lr) !== 0)
|
|
1127
|
+
r.rv < gt && (r.rv = gt, V === null && s !== null && s[Y] === r ? Y++ : V === null ? V = [r] : (!_e || !V.includes(r)) && V.push(r));
|
|
1100
1128
|
else {
|
|
1101
1129
|
(S.deps ?? (S.deps = [])).push(r);
|
|
1102
|
-
var
|
|
1103
|
-
|
|
1130
|
+
var i = r.reactions;
|
|
1131
|
+
i === null ? r.reactions = [S] : i.includes(S) || i.push(S);
|
|
1104
1132
|
}
|
|
1105
1133
|
}
|
|
1106
1134
|
} else if (t && /** @type {Derived} */
|
|
1107
1135
|
r.deps === null && /** @type {Derived} */
|
|
1108
1136
|
r.effects === null) {
|
|
1109
|
-
var
|
|
1137
|
+
var a = (
|
|
1110
1138
|
/** @type {Derived} */
|
|
1111
1139
|
r
|
|
1112
|
-
), o =
|
|
1113
|
-
o !== null && (o.f &
|
|
1140
|
+
), o = a.parent;
|
|
1141
|
+
o !== null && (o.f & Q) === 0 && (a.f ^= Q);
|
|
1114
1142
|
}
|
|
1115
|
-
if (
|
|
1143
|
+
if (it) {
|
|
1116
1144
|
if (Ne.has(r))
|
|
1117
1145
|
return Ne.get(r);
|
|
1118
1146
|
if (t) {
|
|
1119
|
-
|
|
1147
|
+
a = /** @type {Derived} */
|
|
1120
1148
|
r;
|
|
1121
|
-
var l =
|
|
1122
|
-
return ((
|
|
1149
|
+
var l = a.v;
|
|
1150
|
+
return ((a.f & q) === 0 && a.reactions !== null || us(a)) && (l = Vr(a)), Ne.set(a, l), l;
|
|
1123
1151
|
}
|
|
1124
1152
|
} else if (t) {
|
|
1125
|
-
if (
|
|
1126
|
-
r,
|
|
1127
|
-
return
|
|
1128
|
-
|
|
1153
|
+
if (a = /** @type {Derived} */
|
|
1154
|
+
r, ge != null && ge.has(a))
|
|
1155
|
+
return ge.get(a);
|
|
1156
|
+
Gt(a) && Vn(a);
|
|
1129
1157
|
}
|
|
1130
|
-
if ((r.f &
|
|
1158
|
+
if ((r.f & Oe) !== 0)
|
|
1131
1159
|
throw r.v;
|
|
1132
1160
|
return r.v;
|
|
1133
1161
|
}
|
|
1134
|
-
function
|
|
1135
|
-
if (r.v ===
|
|
1162
|
+
function us(r) {
|
|
1163
|
+
if (r.v === F) return !0;
|
|
1136
1164
|
if (r.deps === null) return !1;
|
|
1137
1165
|
for (const e of r.deps)
|
|
1138
|
-
if (Ne.has(e) || (e.f &
|
|
1166
|
+
if (Ne.has(e) || (e.f & H) !== 0 && us(
|
|
1139
1167
|
/** @type {Derived} */
|
|
1140
1168
|
e
|
|
1141
1169
|
))
|
|
1142
1170
|
return !0;
|
|
1143
1171
|
return !1;
|
|
1144
1172
|
}
|
|
1145
|
-
function
|
|
1146
|
-
var e =
|
|
1173
|
+
function Si(r) {
|
|
1174
|
+
var e = ie;
|
|
1147
1175
|
try {
|
|
1148
|
-
return
|
|
1176
|
+
return ie = !0, r();
|
|
1149
1177
|
} finally {
|
|
1150
|
-
|
|
1178
|
+
ie = e;
|
|
1151
1179
|
}
|
|
1152
1180
|
}
|
|
1153
|
-
const
|
|
1154
|
-
function
|
|
1155
|
-
r.f = r.f &
|
|
1181
|
+
const Ci = -7169;
|
|
1182
|
+
function ee(r, e) {
|
|
1183
|
+
r.f = r.f & Ci | e;
|
|
1156
1184
|
}
|
|
1157
|
-
const
|
|
1158
|
-
function
|
|
1159
|
-
return
|
|
1185
|
+
const Ti = ["touchstart", "touchmove"];
|
|
1186
|
+
function Ai(r) {
|
|
1187
|
+
return Ti.includes(r);
|
|
1160
1188
|
}
|
|
1161
|
-
const
|
|
1162
|
-
function
|
|
1189
|
+
const Mi = /* @__PURE__ */ new Set(), cn = /* @__PURE__ */ new Set();
|
|
1190
|
+
function Nt(r) {
|
|
1163
1191
|
var T;
|
|
1164
1192
|
var e = this, t = (
|
|
1165
1193
|
/** @type {Node} */
|
|
1166
1194
|
e.ownerDocument
|
|
1167
|
-
), n = r.type, s = ((T = r.composedPath) == null ? void 0 : T.call(r)) || [],
|
|
1195
|
+
), n = r.type, s = ((T = r.composedPath) == null ? void 0 : T.call(r)) || [], i = (
|
|
1168
1196
|
/** @type {null | Element} */
|
|
1169
1197
|
s[0] || r.target
|
|
1170
|
-
),
|
|
1198
|
+
), a = 0, o = r.__root;
|
|
1171
1199
|
if (o) {
|
|
1172
1200
|
var l = s.indexOf(o);
|
|
1173
1201
|
if (l !== -1 && (e === document || e === /** @type {any} */
|
|
@@ -1178,39 +1206,39 @@ function Mt(r) {
|
|
|
1178
1206
|
var u = s.indexOf(e);
|
|
1179
1207
|
if (u === -1)
|
|
1180
1208
|
return;
|
|
1181
|
-
l <= u && (
|
|
1209
|
+
l <= u && (a = l);
|
|
1182
1210
|
}
|
|
1183
|
-
if (
|
|
1184
|
-
s[
|
|
1185
|
-
|
|
1211
|
+
if (i = /** @type {Element} */
|
|
1212
|
+
s[a] || r.target, i !== e) {
|
|
1213
|
+
or(r, "currentTarget", {
|
|
1186
1214
|
configurable: !0,
|
|
1187
1215
|
get() {
|
|
1188
|
-
return
|
|
1216
|
+
return i || t;
|
|
1189
1217
|
}
|
|
1190
1218
|
});
|
|
1191
|
-
var d = S,
|
|
1192
|
-
|
|
1219
|
+
var d = S, h = M;
|
|
1220
|
+
ke(null), Ke(null);
|
|
1193
1221
|
try {
|
|
1194
|
-
for (var p, v = [];
|
|
1195
|
-
var x =
|
|
1196
|
-
|
|
1222
|
+
for (var p, v = []; i !== null; ) {
|
|
1223
|
+
var x = i.assignedSlot || i.parentNode || /** @type {any} */
|
|
1224
|
+
i.host || null;
|
|
1197
1225
|
try {
|
|
1198
|
-
var N =
|
|
1226
|
+
var N = i["__" + n];
|
|
1199
1227
|
if (N != null && (!/** @type {any} */
|
|
1200
|
-
|
|
1228
|
+
i.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
|
|
1201
1229
|
// -> the target could not have been disabled because it emits the event in the first place
|
|
1202
|
-
r.target ===
|
|
1203
|
-
if (
|
|
1204
|
-
var [I, ...
|
|
1205
|
-
I.apply(
|
|
1230
|
+
r.target === i))
|
|
1231
|
+
if (In(N)) {
|
|
1232
|
+
var [I, ...G] = N;
|
|
1233
|
+
I.apply(i, [r, ...G]);
|
|
1206
1234
|
} else
|
|
1207
|
-
N.call(
|
|
1235
|
+
N.call(i, r);
|
|
1208
1236
|
} catch (z) {
|
|
1209
1237
|
p ? v.push(z) : p = z;
|
|
1210
1238
|
}
|
|
1211
1239
|
if (r.cancelBubble || x === e || x === null)
|
|
1212
1240
|
break;
|
|
1213
|
-
|
|
1241
|
+
i = x;
|
|
1214
1242
|
}
|
|
1215
1243
|
if (p) {
|
|
1216
1244
|
for (let z of v)
|
|
@@ -1220,15 +1248,15 @@ function Mt(r) {
|
|
|
1220
1248
|
throw p;
|
|
1221
1249
|
}
|
|
1222
1250
|
} finally {
|
|
1223
|
-
r.__root = e, delete r.currentTarget,
|
|
1251
|
+
r.__root = e, delete r.currentTarget, ke(d), Ke(h);
|
|
1224
1252
|
}
|
|
1225
1253
|
}
|
|
1226
1254
|
}
|
|
1227
|
-
function
|
|
1255
|
+
function Oi(r) {
|
|
1228
1256
|
var e = document.createElement("template");
|
|
1229
1257
|
return e.innerHTML = r.replaceAll("<!>", "<!---->"), e.content;
|
|
1230
1258
|
}
|
|
1231
|
-
function
|
|
1259
|
+
function Ni(r, e) {
|
|
1232
1260
|
var t = (
|
|
1233
1261
|
/** @type {Effect} */
|
|
1234
1262
|
M
|
|
@@ -1236,157 +1264,157 @@ function Ta(r, e) {
|
|
|
1236
1264
|
t.nodes_start === null && (t.nodes_start = r, t.nodes_end = e);
|
|
1237
1265
|
}
|
|
1238
1266
|
// @__NO_SIDE_EFFECTS__
|
|
1239
|
-
function
|
|
1240
|
-
var t = (e &
|
|
1267
|
+
function ds(r, e) {
|
|
1268
|
+
var t = (e & Xs) !== 0, n, s = !r.startsWith("<!>");
|
|
1241
1269
|
return () => {
|
|
1242
|
-
n === void 0 && (n =
|
|
1243
|
-
/* @__PURE__ */
|
|
1244
|
-
var
|
|
1270
|
+
n === void 0 && (n = Oi(s ? r : "<!>" + r), n = /** @type {Node} */
|
|
1271
|
+
/* @__PURE__ */ Gn(n));
|
|
1272
|
+
var i = (
|
|
1245
1273
|
/** @type {TemplateNode} */
|
|
1246
|
-
t ||
|
|
1274
|
+
t || Yn ? document.importNode(n, !0) : n.cloneNode(!0)
|
|
1247
1275
|
);
|
|
1248
|
-
return
|
|
1276
|
+
return Ni(i, i), i;
|
|
1249
1277
|
};
|
|
1250
1278
|
}
|
|
1251
|
-
function
|
|
1279
|
+
function cs(r, e) {
|
|
1252
1280
|
r !== null && r.before(
|
|
1253
1281
|
/** @type {Node} */
|
|
1254
1282
|
e
|
|
1255
1283
|
);
|
|
1256
1284
|
}
|
|
1257
|
-
function
|
|
1258
|
-
return
|
|
1285
|
+
function Ur(r, e) {
|
|
1286
|
+
return Ri(r, e);
|
|
1259
1287
|
}
|
|
1260
1288
|
const je = /* @__PURE__ */ new Map();
|
|
1261
|
-
function
|
|
1262
|
-
|
|
1263
|
-
var o = /* @__PURE__ */ new Set(), l = (
|
|
1264
|
-
for (var p = 0; p <
|
|
1265
|
-
var v =
|
|
1289
|
+
function Ri(r, { target: e, anchor: t, props: n = {}, events: s, context: i, intro: a = !0 }) {
|
|
1290
|
+
ui();
|
|
1291
|
+
var o = /* @__PURE__ */ new Set(), l = (h) => {
|
|
1292
|
+
for (var p = 0; p < h.length; p++) {
|
|
1293
|
+
var v = h[p];
|
|
1266
1294
|
if (!o.has(v)) {
|
|
1267
1295
|
o.add(v);
|
|
1268
|
-
var x =
|
|
1269
|
-
e.addEventListener(v,
|
|
1296
|
+
var x = Ai(v);
|
|
1297
|
+
e.addEventListener(v, Nt, { passive: x });
|
|
1270
1298
|
var N = je.get(v);
|
|
1271
|
-
N === void 0 ? (document.addEventListener(v,
|
|
1299
|
+
N === void 0 ? (document.addEventListener(v, Nt, { passive: x }), je.set(v, 1)) : je.set(v, N + 1);
|
|
1272
1300
|
}
|
|
1273
1301
|
}
|
|
1274
1302
|
};
|
|
1275
|
-
l(
|
|
1276
|
-
var u = void 0, d =
|
|
1277
|
-
var
|
|
1278
|
-
return
|
|
1279
|
-
if (
|
|
1280
|
-
|
|
1303
|
+
l(Rs(Mi)), cn.add(l);
|
|
1304
|
+
var u = void 0, d = pi(() => {
|
|
1305
|
+
var h = t ?? e.appendChild(di());
|
|
1306
|
+
return gi(() => {
|
|
1307
|
+
if (i) {
|
|
1308
|
+
jr({});
|
|
1281
1309
|
var p = (
|
|
1282
1310
|
/** @type {ComponentContext} */
|
|
1283
|
-
|
|
1311
|
+
se
|
|
1284
1312
|
);
|
|
1285
|
-
p.c =
|
|
1313
|
+
p.c = i;
|
|
1286
1314
|
}
|
|
1287
|
-
s && (n.$$events = s), u = r(
|
|
1315
|
+
s && (n.$$events = s), u = r(h, n) || {}, i && Fr();
|
|
1288
1316
|
}), () => {
|
|
1289
1317
|
var x;
|
|
1290
1318
|
for (var p of o) {
|
|
1291
|
-
e.removeEventListener(p,
|
|
1319
|
+
e.removeEventListener(p, Nt);
|
|
1292
1320
|
var v = (
|
|
1293
1321
|
/** @type {number} */
|
|
1294
1322
|
je.get(p)
|
|
1295
1323
|
);
|
|
1296
|
-
--v === 0 ? (document.removeEventListener(p,
|
|
1324
|
+
--v === 0 ? (document.removeEventListener(p, Nt), je.delete(p)) : je.set(p, v);
|
|
1297
1325
|
}
|
|
1298
|
-
|
|
1326
|
+
cn.delete(l), h !== t && ((x = h.parentNode) == null || x.removeChild(h));
|
|
1299
1327
|
};
|
|
1300
1328
|
});
|
|
1301
|
-
return
|
|
1329
|
+
return Ii.set(u, d), u;
|
|
1302
1330
|
}
|
|
1303
|
-
let
|
|
1304
|
-
const
|
|
1331
|
+
let Ii = /* @__PURE__ */ new WeakMap();
|
|
1332
|
+
const fn = [...`
|
|
1305
1333
|
\r\f \v\uFEFF`];
|
|
1306
|
-
function
|
|
1334
|
+
function Li(r, e, t) {
|
|
1307
1335
|
var n = r == null ? "" : "" + r;
|
|
1308
1336
|
if (t) {
|
|
1309
1337
|
for (var s in t)
|
|
1310
1338
|
if (t[s])
|
|
1311
1339
|
n = n ? n + " " + s : s;
|
|
1312
1340
|
else if (n.length)
|
|
1313
|
-
for (var
|
|
1314
|
-
var o =
|
|
1315
|
-
(
|
|
1341
|
+
for (var i = s.length, a = 0; (a = n.indexOf(s, a)) >= 0; ) {
|
|
1342
|
+
var o = a + i;
|
|
1343
|
+
(a === 0 || fn.includes(n[a - 1])) && (o === n.length || fn.includes(n[o])) ? n = (a === 0 ? "" : n.substring(0, a)) + n.substring(o + 1) : a = o;
|
|
1316
1344
|
}
|
|
1317
1345
|
}
|
|
1318
1346
|
return n === "" ? null : n;
|
|
1319
1347
|
}
|
|
1320
|
-
function
|
|
1348
|
+
function hn(r, e = !1) {
|
|
1321
1349
|
var t = e ? " !important;" : ";", n = "";
|
|
1322
1350
|
for (var s in r) {
|
|
1323
|
-
var
|
|
1324
|
-
|
|
1351
|
+
var i = r[s];
|
|
1352
|
+
i != null && i !== "" && (n += " " + s + ": " + i + t);
|
|
1325
1353
|
}
|
|
1326
1354
|
return n;
|
|
1327
1355
|
}
|
|
1328
|
-
function
|
|
1356
|
+
function nr(r) {
|
|
1329
1357
|
return r[0] !== "-" || r[1] !== "-" ? r.toLowerCase() : r;
|
|
1330
1358
|
}
|
|
1331
|
-
function
|
|
1359
|
+
function Di(r, e) {
|
|
1332
1360
|
if (e) {
|
|
1333
1361
|
var t = "", n, s;
|
|
1334
1362
|
if (Array.isArray(e) ? (n = e[0], s = e[1]) : n = e, r) {
|
|
1335
1363
|
r = String(r).replaceAll(/\s*\/\*.*?\*\/\s*/g, "").trim();
|
|
1336
|
-
var
|
|
1337
|
-
n && l.push(...Object.keys(n).map(
|
|
1364
|
+
var i = !1, a = 0, o = !1, l = [];
|
|
1365
|
+
n && l.push(...Object.keys(n).map(nr)), s && l.push(...Object.keys(s).map(nr));
|
|
1338
1366
|
var u = 0, d = -1;
|
|
1339
1367
|
const N = r.length;
|
|
1340
|
-
for (var
|
|
1341
|
-
var p = r[
|
|
1342
|
-
if (o ? p === "/" && r[
|
|
1368
|
+
for (var h = 0; h < N; h++) {
|
|
1369
|
+
var p = r[h];
|
|
1370
|
+
if (o ? p === "/" && r[h - 1] === "*" && (o = !1) : i ? i === p && (i = !1) : p === "/" && r[h + 1] === "*" ? o = !0 : p === '"' || p === "'" ? i = p : p === "(" ? a++ : p === ")" && a--, !o && i === !1 && a === 0) {
|
|
1343
1371
|
if (p === ":" && d === -1)
|
|
1344
|
-
d =
|
|
1345
|
-
else if (p === ";" ||
|
|
1372
|
+
d = h;
|
|
1373
|
+
else if (p === ";" || h === N - 1) {
|
|
1346
1374
|
if (d !== -1) {
|
|
1347
|
-
var v =
|
|
1375
|
+
var v = nr(r.substring(u, d).trim());
|
|
1348
1376
|
if (!l.includes(v)) {
|
|
1349
|
-
p !== ";" &&
|
|
1350
|
-
var x = r.substring(u,
|
|
1377
|
+
p !== ";" && h++;
|
|
1378
|
+
var x = r.substring(u, h).trim();
|
|
1351
1379
|
t += " " + x + ";";
|
|
1352
1380
|
}
|
|
1353
1381
|
}
|
|
1354
|
-
u =
|
|
1382
|
+
u = h + 1, d = -1;
|
|
1355
1383
|
}
|
|
1356
1384
|
}
|
|
1357
1385
|
}
|
|
1358
1386
|
}
|
|
1359
|
-
return n && (t +=
|
|
1387
|
+
return n && (t += hn(n)), s && (t += hn(s, !0)), t = t.trim(), t === "" ? null : t;
|
|
1360
1388
|
}
|
|
1361
1389
|
return r == null ? null : String(r);
|
|
1362
1390
|
}
|
|
1363
|
-
function
|
|
1364
|
-
var
|
|
1365
|
-
if (
|
|
1366
|
-
var o =
|
|
1391
|
+
function fs(r, e, t, n, s, i) {
|
|
1392
|
+
var a = r.__className;
|
|
1393
|
+
if (a !== t || a === void 0) {
|
|
1394
|
+
var o = Li(t, n, i);
|
|
1367
1395
|
o == null ? r.removeAttribute("class") : r.className = o, r.__className = t;
|
|
1368
|
-
} else if (
|
|
1369
|
-
for (var l in
|
|
1370
|
-
var u = !!
|
|
1396
|
+
} else if (i && s !== i)
|
|
1397
|
+
for (var l in i) {
|
|
1398
|
+
var u = !!i[l];
|
|
1371
1399
|
(s == null || u !== !!s[l]) && r.classList.toggle(l, u);
|
|
1372
1400
|
}
|
|
1373
|
-
return
|
|
1401
|
+
return i;
|
|
1374
1402
|
}
|
|
1375
|
-
function
|
|
1403
|
+
function sr(r, e = {}, t, n) {
|
|
1376
1404
|
for (var s in t) {
|
|
1377
|
-
var
|
|
1378
|
-
e[s] !==
|
|
1405
|
+
var i = t[s];
|
|
1406
|
+
e[s] !== i && (t[s] == null ? r.style.removeProperty(s) : r.style.setProperty(s, i, n));
|
|
1379
1407
|
}
|
|
1380
1408
|
}
|
|
1381
|
-
function
|
|
1409
|
+
function Vt(r, e, t, n) {
|
|
1382
1410
|
var s = r.__style;
|
|
1383
1411
|
if (s !== e) {
|
|
1384
|
-
var
|
|
1385
|
-
|
|
1386
|
-
} else n && (Array.isArray(n) ? (
|
|
1412
|
+
var i = Di(e, n);
|
|
1413
|
+
i == null ? r.removeAttribute("style") : r.style.cssText = i, r.__style = e;
|
|
1414
|
+
} else n && (Array.isArray(n) ? (sr(r, t == null ? void 0 : t[0], n[0]), sr(r, t == null ? void 0 : t[1], n[1], "important")) : sr(r, t, n));
|
|
1387
1415
|
return n;
|
|
1388
1416
|
}
|
|
1389
|
-
const
|
|
1417
|
+
const Pi = () => performance.now(), ae = {
|
|
1390
1418
|
// don't access requestAnimationFrame eagerly outside method
|
|
1391
1419
|
// this allows basic testing of user code without JSDOM
|
|
1392
1420
|
// bunder will eval and remove ternary when the user's app is built
|
|
@@ -1394,18 +1422,18 @@ const Ra = () => performance.now(), ae = {
|
|
|
1394
1422
|
/** @param {any} _ */
|
|
1395
1423
|
(r) => requestAnimationFrame(r)
|
|
1396
1424
|
),
|
|
1397
|
-
now: () =>
|
|
1425
|
+
now: () => Pi(),
|
|
1398
1426
|
tasks: /* @__PURE__ */ new Set()
|
|
1399
1427
|
};
|
|
1400
|
-
function
|
|
1428
|
+
function hs() {
|
|
1401
1429
|
const r = ae.now();
|
|
1402
1430
|
ae.tasks.forEach((e) => {
|
|
1403
1431
|
e.c(r) || (ae.tasks.delete(e), e.f());
|
|
1404
|
-
}), ae.tasks.size !== 0 && ae.tick(
|
|
1432
|
+
}), ae.tasks.size !== 0 && ae.tick(hs);
|
|
1405
1433
|
}
|
|
1406
|
-
function
|
|
1434
|
+
function Zi(r) {
|
|
1407
1435
|
let e;
|
|
1408
|
-
return ae.tasks.size === 0 && ae.tick(
|
|
1436
|
+
return ae.tasks.size === 0 && ae.tick(hs), {
|
|
1409
1437
|
promise: new Promise((t) => {
|
|
1410
1438
|
ae.tasks.add(e = { c: r, f: t });
|
|
1411
1439
|
}),
|
|
@@ -1414,46 +1442,46 @@ function Ia(r) {
|
|
|
1414
1442
|
}
|
|
1415
1443
|
};
|
|
1416
1444
|
}
|
|
1417
|
-
function
|
|
1418
|
-
return r === e || (r == null ? void 0 : r[
|
|
1445
|
+
function pn(r, e) {
|
|
1446
|
+
return r === e || (r == null ? void 0 : r[Rt]) === e;
|
|
1419
1447
|
}
|
|
1420
1448
|
function ze(r = {}, e, t, n) {
|
|
1421
|
-
return
|
|
1422
|
-
var s,
|
|
1423
|
-
return
|
|
1424
|
-
s =
|
|
1425
|
-
r !== t(...
|
|
1449
|
+
return mi(() => {
|
|
1450
|
+
var s, i;
|
|
1451
|
+
return Qn(() => {
|
|
1452
|
+
s = i, i = [], Si(() => {
|
|
1453
|
+
r !== t(...i) && (e(r, ...i), s && pn(t(...s), r) && e(null, ...s));
|
|
1426
1454
|
});
|
|
1427
1455
|
}), () => {
|
|
1428
|
-
|
|
1429
|
-
|
|
1456
|
+
ei(() => {
|
|
1457
|
+
i && pn(t(...i), r) && e(null, ...i);
|
|
1430
1458
|
});
|
|
1431
1459
|
};
|
|
1432
1460
|
}), r;
|
|
1433
1461
|
}
|
|
1434
|
-
const
|
|
1435
|
-
var
|
|
1436
|
-
typeof window < "u" && ((
|
|
1437
|
-
function
|
|
1462
|
+
const ji = "5";
|
|
1463
|
+
var Nn;
|
|
1464
|
+
typeof window < "u" && ((Nn = window.__svelte ?? (window.__svelte = {})).v ?? (Nn.v = /* @__PURE__ */ new Set())).add(ji);
|
|
1465
|
+
function Fi(r) {
|
|
1438
1466
|
return r;
|
|
1439
1467
|
}
|
|
1440
|
-
function
|
|
1468
|
+
function hr(r) {
|
|
1441
1469
|
return -0.5 * (Math.cos(Math.PI * r) - 1);
|
|
1442
1470
|
}
|
|
1443
|
-
function
|
|
1471
|
+
function zi(r) {
|
|
1444
1472
|
const e = Math.cos(r * Math.PI * 0.5);
|
|
1445
1473
|
return Math.abs(e) < 1e-14 ? 1 : 1 - e;
|
|
1446
1474
|
}
|
|
1447
|
-
function
|
|
1475
|
+
function Vi(r) {
|
|
1448
1476
|
return Math.sin(r * Math.PI / 2);
|
|
1449
1477
|
}
|
|
1450
|
-
const
|
|
1451
|
-
class
|
|
1478
|
+
const Bi = 128, Ui = 0, $i = 1, qi = 2;
|
|
1479
|
+
class Wi {
|
|
1452
1480
|
constructor() {
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1481
|
+
f(this, "animationsStarted", !1);
|
|
1482
|
+
f(this, "animationsCount", 0);
|
|
1483
|
+
f(this, "animationsLimit", Bi);
|
|
1484
|
+
f(this, "layers", new Array());
|
|
1457
1485
|
}
|
|
1458
1486
|
start() {
|
|
1459
1487
|
window.requestAnimationFrame(this.tick.bind(this));
|
|
@@ -1467,10 +1495,10 @@ class Ba {
|
|
|
1467
1495
|
const n = t.animations;
|
|
1468
1496
|
if (n != null)
|
|
1469
1497
|
for (let s = 0; s < n.length; s++) {
|
|
1470
|
-
const
|
|
1471
|
-
if (
|
|
1472
|
-
for (const
|
|
1473
|
-
if (!
|
|
1498
|
+
const i = n[s];
|
|
1499
|
+
if (i != null) {
|
|
1500
|
+
for (const a of i.values())
|
|
1501
|
+
if (!a.executed && (a.executed = !0, a.function(), this.animationsCount++, this.animationsCount == this.animationsLimit))
|
|
1474
1502
|
return;
|
|
1475
1503
|
}
|
|
1476
1504
|
}
|
|
@@ -1481,22 +1509,22 @@ class Ba {
|
|
|
1481
1509
|
}
|
|
1482
1510
|
}
|
|
1483
1511
|
equeue(e, t, n, s) {
|
|
1484
|
-
let
|
|
1485
|
-
|
|
1486
|
-
let
|
|
1487
|
-
|
|
1512
|
+
let i = this.layers[e];
|
|
1513
|
+
i == null && (i = this.layers[e] = { animations: new Array() });
|
|
1514
|
+
let a = i.animations[t];
|
|
1515
|
+
a == null && (a = i.animations[t] = /* @__PURE__ */ new Map());
|
|
1488
1516
|
let o = { id: n, priority: t, executed: !1, function: s };
|
|
1489
|
-
|
|
1517
|
+
a.set(n, o), this.animationsStarted == !1 && (this.animationsStarted = !0, this.start());
|
|
1490
1518
|
}
|
|
1491
1519
|
clear(e, t) {
|
|
1492
1520
|
for (let n = 0; n < this.layers.length; n++) {
|
|
1493
1521
|
let s = this.layers[n];
|
|
1494
1522
|
if (s == null) continue;
|
|
1495
|
-
let
|
|
1496
|
-
if (
|
|
1497
|
-
let
|
|
1498
|
-
if (
|
|
1499
|
-
|
|
1523
|
+
let i = s.animations[e];
|
|
1524
|
+
if (i == null) return;
|
|
1525
|
+
let a = i.get(t);
|
|
1526
|
+
if (a == null || a.executed == !1) return;
|
|
1527
|
+
i.delete(t);
|
|
1500
1528
|
}
|
|
1501
1529
|
}
|
|
1502
1530
|
speed() {
|
|
@@ -1509,11 +1537,11 @@ class Ba {
|
|
|
1509
1537
|
this.animationsLimit = e;
|
|
1510
1538
|
}
|
|
1511
1539
|
}
|
|
1512
|
-
const
|
|
1513
|
-
function
|
|
1540
|
+
const pe = new Wi();
|
|
1541
|
+
function mn(r) {
|
|
1514
1542
|
return Object.prototype.toString.call(r) === "[object Date]";
|
|
1515
1543
|
}
|
|
1516
|
-
function
|
|
1544
|
+
function pr(r, e) {
|
|
1517
1545
|
if (r === e || r !== r) return () => r;
|
|
1518
1546
|
const t = typeof r;
|
|
1519
1547
|
if (t !== typeof e || Array.isArray(r) !== Array.isArray(e))
|
|
@@ -1521,29 +1549,29 @@ function cr(r, e) {
|
|
|
1521
1549
|
if (Array.isArray(r)) {
|
|
1522
1550
|
const n = (
|
|
1523
1551
|
/** @type {Array<any>} */
|
|
1524
|
-
e.map((s,
|
|
1552
|
+
e.map((s, i) => pr(
|
|
1525
1553
|
/** @type {Array<any>} */
|
|
1526
|
-
r[
|
|
1554
|
+
r[i],
|
|
1527
1555
|
s
|
|
1528
1556
|
))
|
|
1529
1557
|
);
|
|
1530
|
-
return (s) => n.map((
|
|
1558
|
+
return (s) => n.map((i) => i(s));
|
|
1531
1559
|
}
|
|
1532
1560
|
if (t === "object") {
|
|
1533
1561
|
if (!r || !e)
|
|
1534
1562
|
throw new Error("Object cannot be null");
|
|
1535
|
-
if (
|
|
1536
|
-
const
|
|
1537
|
-
return (l) => new Date(
|
|
1563
|
+
if (mn(r) && mn(e)) {
|
|
1564
|
+
const i = r.getTime(), o = e.getTime() - i;
|
|
1565
|
+
return (l) => new Date(i + l * o);
|
|
1538
1566
|
}
|
|
1539
1567
|
const n = Object.keys(e), s = {};
|
|
1540
|
-
return n.forEach((
|
|
1541
|
-
s[
|
|
1542
|
-
}), (
|
|
1543
|
-
const
|
|
1568
|
+
return n.forEach((i) => {
|
|
1569
|
+
s[i] = pr(r[i], e[i]);
|
|
1570
|
+
}), (i) => {
|
|
1571
|
+
const a = {};
|
|
1544
1572
|
return n.forEach((o) => {
|
|
1545
|
-
|
|
1546
|
-
}),
|
|
1573
|
+
a[o] = s[o](i);
|
|
1574
|
+
}), a;
|
|
1547
1575
|
};
|
|
1548
1576
|
}
|
|
1549
1577
|
if (t === "number") {
|
|
@@ -1556,20 +1584,20 @@ function cr(r, e) {
|
|
|
1556
1584
|
}
|
|
1557
1585
|
return () => e;
|
|
1558
1586
|
}
|
|
1559
|
-
var ce,
|
|
1560
|
-
const
|
|
1587
|
+
var ce, Xe, Ct, Me;
|
|
1588
|
+
const Hr = class Hr {
|
|
1561
1589
|
/**
|
|
1562
1590
|
* @param {T} value
|
|
1563
1591
|
* @param {TweenedOptions<T>} options
|
|
1564
1592
|
*/
|
|
1565
1593
|
constructor(e, t = {}) {
|
|
1566
1594
|
P(this, ce);
|
|
1567
|
-
P(this,
|
|
1595
|
+
P(this, Xe);
|
|
1568
1596
|
/** @type {TweenedOptions<T>} */
|
|
1569
|
-
P(this,
|
|
1597
|
+
P(this, Ct);
|
|
1570
1598
|
/** @type {import('../internal/client/types').Task | null} */
|
|
1571
|
-
P(this,
|
|
1572
|
-
|
|
1599
|
+
P(this, Me, null);
|
|
1600
|
+
j(this, ce, /* @__PURE__ */ $(e)), j(this, Xe, /* @__PURE__ */ $(e)), j(this, Ct, t);
|
|
1573
1601
|
}
|
|
1574
1602
|
/**
|
|
1575
1603
|
* Create a tween whose value is bound to the return value of `fn`. This must be called
|
|
@@ -1589,8 +1617,8 @@ const Wr = class Wr {
|
|
|
1589
1617
|
* @param {TweenedOptions<U>} [options]
|
|
1590
1618
|
*/
|
|
1591
1619
|
static of(e, t) {
|
|
1592
|
-
const n = new
|
|
1593
|
-
return
|
|
1620
|
+
const n = new Hr(e(), t);
|
|
1621
|
+
return Qn(() => {
|
|
1594
1622
|
n.set(e());
|
|
1595
1623
|
}), n;
|
|
1596
1624
|
}
|
|
@@ -1603,49 +1631,49 @@ const Wr = class Wr {
|
|
|
1603
1631
|
* @returns
|
|
1604
1632
|
*/
|
|
1605
1633
|
set(e, t) {
|
|
1606
|
-
var
|
|
1607
|
-
B(k(this,
|
|
1634
|
+
var h;
|
|
1635
|
+
B(k(this, Xe), e);
|
|
1608
1636
|
let {
|
|
1609
1637
|
delay: n = 0,
|
|
1610
1638
|
duration: s = 400,
|
|
1611
|
-
easing:
|
|
1612
|
-
interpolate:
|
|
1613
|
-
} = { ...k(this,
|
|
1639
|
+
easing: i = Fi,
|
|
1640
|
+
interpolate: a = pr
|
|
1641
|
+
} = { ...k(this, Ct), ...t };
|
|
1614
1642
|
if (s === 0)
|
|
1615
|
-
return (
|
|
1643
|
+
return (h = k(this, Me)) == null || h.abort(), B(k(this, ce), e), Promise.resolve();
|
|
1616
1644
|
const o = ae.now() + n;
|
|
1617
|
-
let l, u = !1, d = k(this,
|
|
1618
|
-
return
|
|
1645
|
+
let l, u = !1, d = k(this, Me);
|
|
1646
|
+
return j(this, Me, Zi((p) => {
|
|
1619
1647
|
if (p < o)
|
|
1620
1648
|
return !0;
|
|
1621
1649
|
if (!u) {
|
|
1622
1650
|
u = !0;
|
|
1623
1651
|
const x = k(this, ce).v;
|
|
1624
|
-
l =
|
|
1652
|
+
l = a(x, e), typeof s == "function" && (s = s(x, e)), d == null || d.abort();
|
|
1625
1653
|
}
|
|
1626
1654
|
const v = p - o;
|
|
1627
1655
|
return v > /** @type {number} */
|
|
1628
|
-
s ? (B(k(this, ce), e), !1) : (B(k(this, ce), l(
|
|
1656
|
+
s ? (B(k(this, ce), e), !1) : (B(k(this, ce), l(i(v / /** @type {number} */
|
|
1629
1657
|
s))), !0);
|
|
1630
|
-
})), k(this,
|
|
1658
|
+
})), k(this, Me).promise;
|
|
1631
1659
|
}
|
|
1632
1660
|
get current() {
|
|
1633
1661
|
return L(k(this, ce));
|
|
1634
1662
|
}
|
|
1635
1663
|
get target() {
|
|
1636
|
-
return L(k(this,
|
|
1664
|
+
return L(k(this, Xe));
|
|
1637
1665
|
}
|
|
1638
1666
|
set target(e) {
|
|
1639
1667
|
this.set(e);
|
|
1640
1668
|
}
|
|
1641
1669
|
};
|
|
1642
|
-
ce = new WeakMap(),
|
|
1643
|
-
let
|
|
1644
|
-
class
|
|
1670
|
+
ce = new WeakMap(), Xe = new WeakMap(), Ct = new WeakMap(), Me = new WeakMap();
|
|
1671
|
+
let mr = Hr;
|
|
1672
|
+
class Lt {
|
|
1645
1673
|
constructor(e, t) {
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
this.value = e, this.motion = new
|
|
1674
|
+
f(this, "value");
|
|
1675
|
+
f(this, "motion");
|
|
1676
|
+
this.value = e, this.motion = new mr(e, t);
|
|
1649
1677
|
}
|
|
1650
1678
|
set(e, t) {
|
|
1651
1679
|
this.value = e, this.motion.set(e, t);
|
|
@@ -1657,44 +1685,44 @@ class Nt {
|
|
|
1657
1685
|
this.motion.set(this.value, { duration: 0 });
|
|
1658
1686
|
}
|
|
1659
1687
|
}
|
|
1660
|
-
var
|
|
1661
|
-
function
|
|
1662
|
-
|
|
1688
|
+
var Yi = /* @__PURE__ */ ds('<div><div class="body svelte-1nfn9j8"></div></div>');
|
|
1689
|
+
function Hi(r, e) {
|
|
1690
|
+
jr(e, !0);
|
|
1663
1691
|
let t, n;
|
|
1664
1692
|
function s() {
|
|
1665
1693
|
return n;
|
|
1666
1694
|
}
|
|
1667
|
-
let
|
|
1668
|
-
function
|
|
1669
|
-
B(
|
|
1695
|
+
let i = /* @__PURE__ */ $(!1);
|
|
1696
|
+
function a(T) {
|
|
1697
|
+
B(i, T, !0);
|
|
1670
1698
|
}
|
|
1671
1699
|
function o() {
|
|
1672
|
-
return L(
|
|
1700
|
+
return L(i);
|
|
1673
1701
|
}
|
|
1674
|
-
let l = new
|
|
1675
|
-
|
|
1702
|
+
let l = new Lt(0, { easing: hr });
|
|
1703
|
+
de(() => {
|
|
1676
1704
|
u(l.motion.current);
|
|
1677
|
-
}),
|
|
1678
|
-
L(
|
|
1705
|
+
}), de(() => {
|
|
1706
|
+
L(i) == !1 && (l.snap(), pe.clear(e.priority, e.id));
|
|
1679
1707
|
});
|
|
1680
1708
|
function u(T) {
|
|
1681
|
-
t &&
|
|
1709
|
+
t && pe.equeue(e.layer, e.priority, e.id, () => {
|
|
1682
1710
|
t.style.scale = T.toString(), t.style.filter = `brightness(${0.25 + 0.75 * T})`, n.style.opacity = T.toString();
|
|
1683
1711
|
});
|
|
1684
1712
|
}
|
|
1685
1713
|
function d(T) {
|
|
1686
1714
|
T != l.value && l.set(T, { duration: 75 });
|
|
1687
1715
|
}
|
|
1688
|
-
function
|
|
1716
|
+
function h() {
|
|
1689
1717
|
return l.motion.current == 0;
|
|
1690
1718
|
}
|
|
1691
1719
|
function p() {
|
|
1692
1720
|
return l.value;
|
|
1693
1721
|
}
|
|
1694
|
-
var v =
|
|
1722
|
+
var v = Yi();
|
|
1695
1723
|
let x, N;
|
|
1696
|
-
var I =
|
|
1697
|
-
let
|
|
1724
|
+
var I = fr(v);
|
|
1725
|
+
let G;
|
|
1698
1726
|
return ze(
|
|
1699
1727
|
I,
|
|
1700
1728
|
(T) => (
|
|
@@ -1702,12 +1730,12 @@ function $a(r, e) {
|
|
|
1702
1730
|
n = T
|
|
1703
1731
|
),
|
|
1704
1732
|
() => n
|
|
1705
|
-
), ze(v, (T) => t = T, () => t),
|
|
1706
|
-
(T, z,
|
|
1707
|
-
x =
|
|
1733
|
+
), ze(v, (T) => t = T, () => t), es(
|
|
1734
|
+
(T, z, J) => {
|
|
1735
|
+
x = fs(v, 1, "pin svelte-1nfn9j8", null, x, T), N = Vt(v, "", N, z), G = Vt(I, "", G, J);
|
|
1708
1736
|
},
|
|
1709
1737
|
[
|
|
1710
|
-
() => ({ displayed: L(
|
|
1738
|
+
() => ({ displayed: L(i) }),
|
|
1711
1739
|
() => ({
|
|
1712
1740
|
width: `${e.width}px`,
|
|
1713
1741
|
height: `${e.height}px`,
|
|
@@ -1719,31 +1747,31 @@ function $a(r, e) {
|
|
|
1719
1747
|
"border-radius": `${e.radius - 2}px`
|
|
1720
1748
|
})
|
|
1721
1749
|
]
|
|
1722
|
-
),
|
|
1750
|
+
), cs(r, v), Fr({
|
|
1723
1751
|
getBody: s,
|
|
1724
|
-
setDisplayed:
|
|
1752
|
+
setDisplayed: a,
|
|
1725
1753
|
getDisplayed: o,
|
|
1726
1754
|
setScale: d,
|
|
1727
|
-
getCollapsed:
|
|
1755
|
+
getCollapsed: h,
|
|
1728
1756
|
getScale: p
|
|
1729
1757
|
});
|
|
1730
1758
|
}
|
|
1731
|
-
var
|
|
1732
|
-
function
|
|
1733
|
-
|
|
1734
|
-
let t, n, s,
|
|
1735
|
-
const
|
|
1736
|
-
|
|
1759
|
+
var Xi = /* @__PURE__ */ ds('<div><div class="pointer svelte-j5igi2"></div> <div class="bubble svelte-j5igi2"><div class="body svelte-j5igi2"></div></div></div>');
|
|
1760
|
+
function ps(r, e) {
|
|
1761
|
+
jr(e, !0);
|
|
1762
|
+
let t, n, s, i;
|
|
1763
|
+
const a = e.width + 2 * e.margin, o = e.height + 2 * e.margin, l = () => i;
|
|
1764
|
+
de(() => {
|
|
1737
1765
|
s.style.width = `${e.margin * 4}px`, s.style.height = `${e.margin * 4}px`;
|
|
1738
1766
|
});
|
|
1739
|
-
let u = /* @__PURE__ */
|
|
1767
|
+
let u = /* @__PURE__ */ $(!0);
|
|
1740
1768
|
function d(O) {
|
|
1741
1769
|
B(u, O, !0);
|
|
1742
1770
|
}
|
|
1743
|
-
function
|
|
1771
|
+
function h() {
|
|
1744
1772
|
return L(u);
|
|
1745
1773
|
}
|
|
1746
|
-
let p = /* @__PURE__ */
|
|
1774
|
+
let p = /* @__PURE__ */ $(!0);
|
|
1747
1775
|
function v(O) {
|
|
1748
1776
|
B(p, O, !0);
|
|
1749
1777
|
}
|
|
@@ -1753,75 +1781,75 @@ function cs(r, e) {
|
|
|
1753
1781
|
function N() {
|
|
1754
1782
|
return I.motion.current == 1;
|
|
1755
1783
|
}
|
|
1756
|
-
let I = new
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
}),
|
|
1760
|
-
L(u) == !1 && (I.snap(),
|
|
1761
|
-
}),
|
|
1762
|
-
L(p) == !0 && I.value != 0 && (
|
|
1784
|
+
let I = new Lt(0);
|
|
1785
|
+
de(() => {
|
|
1786
|
+
G(I.motion.current);
|
|
1787
|
+
}), de(() => {
|
|
1788
|
+
L(u) == !1 && (I.snap(), pe.clear(e.priority, e.id + "_scale"));
|
|
1789
|
+
}), de(() => {
|
|
1790
|
+
L(p) == !0 && I.value != 0 && (pe.stacked() ? I.set(0, { duration: 0 }) : I.set(0, { duration: 150, easing: zi })), L(p) == !1 && I.value != 1 && I.set(1, { duration: 150, easing: Vi });
|
|
1763
1791
|
});
|
|
1764
|
-
function
|
|
1765
|
-
!t || !n || !s ||
|
|
1792
|
+
function G(O) {
|
|
1793
|
+
!t || !n || !s || pe.equeue(L(p) ? 0 : e.layer, e.priority, e.id + "_scale", () => {
|
|
1766
1794
|
t.style.opacity = `${O}`, n.style.scale = `${O}`, s.style.scale = `${O}`;
|
|
1767
1795
|
});
|
|
1768
1796
|
}
|
|
1769
|
-
let T = NaN, z = /* @__PURE__ */
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
}),
|
|
1773
|
-
L(u) == !1 && (
|
|
1774
|
-
}),
|
|
1775
|
-
L(p) == !0 && L(z) && (
|
|
1797
|
+
let T = NaN, z = /* @__PURE__ */ $(!1), J = new Lt(-a / 2, { easing: hr }), Tt = new Lt(-o / 2, { easing: hr });
|
|
1798
|
+
de(() => {
|
|
1799
|
+
Xr(J.motion.current, Tt.motion.current);
|
|
1800
|
+
}), de(() => {
|
|
1801
|
+
L(u) == !1 && (J.snap(), J.snap(), pe.clear(e.priority, e.id + "_angle"));
|
|
1802
|
+
}), de(() => {
|
|
1803
|
+
L(p) == !0 && L(z) && (J.update({ duration: 75 }), J.update({ duration: 75 }));
|
|
1776
1804
|
});
|
|
1777
|
-
function
|
|
1805
|
+
function Xr(O, ue) {
|
|
1778
1806
|
if (!t || !n || !s) return;
|
|
1779
|
-
const
|
|
1780
|
-
|
|
1781
|
-
n.style.transform = `translate(${Math.round(O)}px, ${Math.round(
|
|
1807
|
+
const Mt = O + a / 2, at = ue + o / 2, Ze = o < a ? Mt * o / a : Mt, Kt = o > a ? at * a / o : at, bs = Math.atan2(Kt, Ze) / Math.PI * 180 - 45, Qr = 0, Es = 30, Qt = Math.sqrt(Ze * Ze + Kt * Kt), ot = Math.min(a, o) / 2, Ss = ot * Math.SQRT2, Cs = (Qt - ot) / (Ss - ot), en = Qr + Cs * (Es - Qr), Ts = Qt < ot ? Qt / ot : 1;
|
|
1808
|
+
pe.equeue(e.layer, e.priority, e.id + "_angle", () => {
|
|
1809
|
+
n.style.transform = `translate(${Math.round(O)}px, ${Math.round(ue)}px)`, s.style.transform = `scale(${Ts}) rotate(${bs}deg) skew(${en}deg, ${en}deg)`;
|
|
1782
1810
|
});
|
|
1783
1811
|
}
|
|
1784
|
-
function
|
|
1812
|
+
function ks(O) {
|
|
1785
1813
|
if (L(z) == !1) {
|
|
1786
|
-
let
|
|
1787
|
-
|
|
1814
|
+
let ue = tr.getOffsets(a, o, O);
|
|
1815
|
+
J.set(Math.round(ue.x), { duration: 0 }), Tt.set(Math.round(ue.y), { duration: 0 }), Xr(J.value, Tt.value), T = O, B(z, !0);
|
|
1788
1816
|
} else if (O != T) {
|
|
1789
|
-
let
|
|
1790
|
-
|
|
1817
|
+
let ue = Math.abs(O - T), Mt = ue < 180 ? ue : 360 - ue, at = Math.log(Mt) * 75, Ze = tr.getOffsets(a, o, O);
|
|
1818
|
+
J.set(Math.round(Ze.x), { duration: at }), Tt.set(Math.round(Ze.y), { duration: at }), T = O;
|
|
1791
1819
|
}
|
|
1792
1820
|
}
|
|
1793
|
-
function
|
|
1794
|
-
return
|
|
1821
|
+
function xs() {
|
|
1822
|
+
return tr.getOffsets(a, o, T);
|
|
1795
1823
|
}
|
|
1796
|
-
var
|
|
1797
|
-
let
|
|
1798
|
-
var
|
|
1824
|
+
var At = Xi();
|
|
1825
|
+
let Gr;
|
|
1826
|
+
var Jr = fr(At);
|
|
1799
1827
|
ze(
|
|
1800
|
-
|
|
1828
|
+
Jr,
|
|
1801
1829
|
(O) => (
|
|
1802
1830
|
//#endregion
|
|
1803
1831
|
s = O
|
|
1804
1832
|
),
|
|
1805
1833
|
() => s
|
|
1806
1834
|
);
|
|
1807
|
-
var
|
|
1808
|
-
return ze(
|
|
1835
|
+
var Jt = ci(Jr, 2), Kr = fr(Jt);
|
|
1836
|
+
return ze(Kr, (O) => i = O, () => i), ze(Jt, (O) => n = O, () => n), ze(At, (O) => t = O, () => t), es(
|
|
1809
1837
|
(O) => {
|
|
1810
|
-
|
|
1838
|
+
Gr = fs(At, 1, "anchor svelte-j5igi2", null, Gr, O), Vt(Jt, `margin: ${e.margin}px;`), Vt(Kr, `width: ${e.width}px; height: ${e.height}px; border-radius: ${e.radius}px;`);
|
|
1811
1839
|
},
|
|
1812
1840
|
[() => ({ displayed: L(u) })]
|
|
1813
|
-
),
|
|
1841
|
+
), cs(r, At), Fr({
|
|
1814
1842
|
getBody: l,
|
|
1815
1843
|
setDisplayed: d,
|
|
1816
|
-
getDisplayed:
|
|
1844
|
+
getDisplayed: h,
|
|
1817
1845
|
setCollapsed: v,
|
|
1818
1846
|
getCollapsed: x,
|
|
1819
1847
|
getExpanded: N,
|
|
1820
|
-
setAngle:
|
|
1821
|
-
getOffsets:
|
|
1848
|
+
setAngle: ks,
|
|
1849
|
+
getOffsets: xs
|
|
1822
1850
|
});
|
|
1823
1851
|
}
|
|
1824
|
-
class
|
|
1852
|
+
class ms {
|
|
1825
1853
|
/**
|
|
1826
1854
|
* @param mapBounds - The bounds of the map.
|
|
1827
1855
|
* @param mapZoom - The zoom level of the map.
|
|
@@ -1829,12 +1857,12 @@ class fs {
|
|
|
1829
1857
|
* @param offsetX - The x offset of the map in pixels at zoom level n.
|
|
1830
1858
|
* @param offsetY - The y offset of the map in pixels at zoom level n.
|
|
1831
1859
|
*/
|
|
1832
|
-
constructor(e, t, n, s,
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
const
|
|
1860
|
+
constructor(e, t, n, s, i) {
|
|
1861
|
+
f(this, "swLat");
|
|
1862
|
+
f(this, "swLng");
|
|
1863
|
+
f(this, "neLat");
|
|
1864
|
+
f(this, "neLng");
|
|
1865
|
+
const a = n * Math.pow(2, t), o = Ot.project(e.sw.lat, e.sw.lng, a), l = Ot.project(e.ne.lat, e.ne.lng, a), u = o.x - s, d = o.y + i, h = l.x + s, p = l.y - i, v = Ot.unproject(u, d, a), x = Ot.unproject(h, p, a);
|
|
1838
1866
|
this.swLat = v.lat, this.swLng = v.lng, this.neLat = x.lat, this.neLng = x.lng;
|
|
1839
1867
|
}
|
|
1840
1868
|
contains(e, t) {
|
|
@@ -1852,40 +1880,40 @@ var A;
|
|
|
1852
1880
|
throw new Error();
|
|
1853
1881
|
}
|
|
1854
1882
|
r.assertNever = t, r.arrayToEnum = (s) => {
|
|
1855
|
-
const
|
|
1856
|
-
for (const
|
|
1857
|
-
a
|
|
1858
|
-
return
|
|
1883
|
+
const i = {};
|
|
1884
|
+
for (const a of s)
|
|
1885
|
+
i[a] = a;
|
|
1886
|
+
return i;
|
|
1859
1887
|
}, r.getValidEnumValues = (s) => {
|
|
1860
|
-
const
|
|
1861
|
-
for (const o of
|
|
1862
|
-
|
|
1863
|
-
return r.objectValues(
|
|
1864
|
-
}, r.objectValues = (s) => r.objectKeys(s).map(function(
|
|
1865
|
-
return s[
|
|
1888
|
+
const i = r.objectKeys(s).filter((o) => typeof s[s[o]] != "number"), a = {};
|
|
1889
|
+
for (const o of i)
|
|
1890
|
+
a[o] = s[o];
|
|
1891
|
+
return r.objectValues(a);
|
|
1892
|
+
}, r.objectValues = (s) => r.objectKeys(s).map(function(i) {
|
|
1893
|
+
return s[i];
|
|
1866
1894
|
}), r.objectKeys = typeof Object.keys == "function" ? (s) => Object.keys(s) : (s) => {
|
|
1867
|
-
const
|
|
1868
|
-
for (const
|
|
1869
|
-
Object.prototype.hasOwnProperty.call(s,
|
|
1870
|
-
return
|
|
1871
|
-
}, r.find = (s,
|
|
1872
|
-
for (const
|
|
1873
|
-
if (a
|
|
1874
|
-
return
|
|
1895
|
+
const i = [];
|
|
1896
|
+
for (const a in s)
|
|
1897
|
+
Object.prototype.hasOwnProperty.call(s, a) && i.push(a);
|
|
1898
|
+
return i;
|
|
1899
|
+
}, r.find = (s, i) => {
|
|
1900
|
+
for (const a of s)
|
|
1901
|
+
if (i(a))
|
|
1902
|
+
return a;
|
|
1875
1903
|
}, r.isInteger = typeof Number.isInteger == "function" ? (s) => Number.isInteger(s) : (s) => typeof s == "number" && Number.isFinite(s) && Math.floor(s) === s;
|
|
1876
|
-
function n(s,
|
|
1877
|
-
return s.map((
|
|
1904
|
+
function n(s, i = " | ") {
|
|
1905
|
+
return s.map((a) => typeof a == "string" ? `'${a}'` : a).join(i);
|
|
1878
1906
|
}
|
|
1879
|
-
r.joinValues = n, r.jsonStringifyReplacer = (s,
|
|
1907
|
+
r.joinValues = n, r.jsonStringifyReplacer = (s, i) => typeof i == "bigint" ? i.toString() : i;
|
|
1880
1908
|
})(A || (A = {}));
|
|
1881
|
-
var
|
|
1909
|
+
var vn;
|
|
1882
1910
|
(function(r) {
|
|
1883
1911
|
r.mergeShapes = (e, t) => ({
|
|
1884
1912
|
...e,
|
|
1885
1913
|
...t
|
|
1886
1914
|
// second overwrites first
|
|
1887
1915
|
});
|
|
1888
|
-
})(
|
|
1916
|
+
})(vn || (vn = {}));
|
|
1889
1917
|
const g = A.arrayToEnum([
|
|
1890
1918
|
"string",
|
|
1891
1919
|
"nan",
|
|
@@ -1907,7 +1935,7 @@ const g = A.arrayToEnum([
|
|
|
1907
1935
|
"never",
|
|
1908
1936
|
"map",
|
|
1909
1937
|
"set"
|
|
1910
|
-
]),
|
|
1938
|
+
]), he = (r) => {
|
|
1911
1939
|
switch (typeof r) {
|
|
1912
1940
|
case "undefined":
|
|
1913
1941
|
return g.undefined;
|
|
@@ -1960,23 +1988,23 @@ class te extends Error {
|
|
|
1960
1988
|
Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e;
|
|
1961
1989
|
}
|
|
1962
1990
|
format(e) {
|
|
1963
|
-
const t = e || function(
|
|
1964
|
-
return
|
|
1965
|
-
}, n = { _errors: [] }, s = (
|
|
1966
|
-
for (const
|
|
1967
|
-
if (
|
|
1968
|
-
|
|
1969
|
-
else if (
|
|
1970
|
-
s(
|
|
1971
|
-
else if (
|
|
1972
|
-
s(
|
|
1973
|
-
else if (
|
|
1974
|
-
n._errors.push(t(
|
|
1991
|
+
const t = e || function(i) {
|
|
1992
|
+
return i.message;
|
|
1993
|
+
}, n = { _errors: [] }, s = (i) => {
|
|
1994
|
+
for (const a of i.issues)
|
|
1995
|
+
if (a.code === "invalid_union")
|
|
1996
|
+
a.unionErrors.map(s);
|
|
1997
|
+
else if (a.code === "invalid_return_type")
|
|
1998
|
+
s(a.returnTypeError);
|
|
1999
|
+
else if (a.code === "invalid_arguments")
|
|
2000
|
+
s(a.argumentsError);
|
|
2001
|
+
else if (a.path.length === 0)
|
|
2002
|
+
n._errors.push(t(a));
|
|
1975
2003
|
else {
|
|
1976
2004
|
let o = n, l = 0;
|
|
1977
|
-
for (; l <
|
|
1978
|
-
const u =
|
|
1979
|
-
l ===
|
|
2005
|
+
for (; l < a.path.length; ) {
|
|
2006
|
+
const u = a.path[l];
|
|
2007
|
+
l === a.path.length - 1 ? (o[u] = o[u] || { _errors: [] }, o[u]._errors.push(t(a))) : o[u] = o[u] || { _errors: [] }, o = o[u], l++;
|
|
1980
2008
|
}
|
|
1981
2009
|
}
|
|
1982
2010
|
};
|
|
@@ -1999,8 +2027,8 @@ class te extends Error {
|
|
|
1999
2027
|
const t = {}, n = [];
|
|
2000
2028
|
for (const s of this.issues)
|
|
2001
2029
|
if (s.path.length > 0) {
|
|
2002
|
-
const
|
|
2003
|
-
t[
|
|
2030
|
+
const i = s.path[0];
|
|
2031
|
+
t[i] = t[i] || [], t[i].push(e(s));
|
|
2004
2032
|
} else
|
|
2005
2033
|
n.push(e(s));
|
|
2006
2034
|
return { formErrors: n, fieldErrors: t };
|
|
@@ -2010,7 +2038,7 @@ class te extends Error {
|
|
|
2010
2038
|
}
|
|
2011
2039
|
}
|
|
2012
2040
|
te.create = (r) => new te(r);
|
|
2013
|
-
const
|
|
2041
|
+
const _t = (r, e) => {
|
|
2014
2042
|
let t;
|
|
2015
2043
|
switch (r.code) {
|
|
2016
2044
|
case c.invalid_type:
|
|
@@ -2066,33 +2094,33 @@ const vt = (r, e) => {
|
|
|
2066
2094
|
}
|
|
2067
2095
|
return { message: t };
|
|
2068
2096
|
};
|
|
2069
|
-
let
|
|
2070
|
-
function
|
|
2071
|
-
return
|
|
2097
|
+
let Gi = _t;
|
|
2098
|
+
function vr() {
|
|
2099
|
+
return Gi;
|
|
2072
2100
|
}
|
|
2073
|
-
const
|
|
2074
|
-
const { data: e, path: t, errorMaps: n, issueData: s } = r,
|
|
2101
|
+
const gr = (r) => {
|
|
2102
|
+
const { data: e, path: t, errorMaps: n, issueData: s } = r, i = [...t, ...s.path || []], a = {
|
|
2075
2103
|
...s,
|
|
2076
|
-
path:
|
|
2104
|
+
path: i
|
|
2077
2105
|
};
|
|
2078
2106
|
if (s.message !== void 0)
|
|
2079
2107
|
return {
|
|
2080
2108
|
...s,
|
|
2081
|
-
path:
|
|
2109
|
+
path: i,
|
|
2082
2110
|
message: s.message
|
|
2083
2111
|
};
|
|
2084
2112
|
let o = "";
|
|
2085
2113
|
const l = n.filter((u) => !!u).slice().reverse();
|
|
2086
2114
|
for (const u of l)
|
|
2087
|
-
o = u(
|
|
2115
|
+
o = u(a, { data: e, defaultError: o }).message;
|
|
2088
2116
|
return {
|
|
2089
2117
|
...s,
|
|
2090
|
-
path:
|
|
2118
|
+
path: i,
|
|
2091
2119
|
message: o
|
|
2092
2120
|
};
|
|
2093
2121
|
};
|
|
2094
2122
|
function m(r, e) {
|
|
2095
|
-
const t =
|
|
2123
|
+
const t = vr(), n = gr({
|
|
2096
2124
|
issueData: e,
|
|
2097
2125
|
data: r.data,
|
|
2098
2126
|
path: r.path,
|
|
@@ -2103,13 +2131,13 @@ function m(r, e) {
|
|
|
2103
2131
|
// then schema-bound map if available
|
|
2104
2132
|
t,
|
|
2105
2133
|
// then global override map
|
|
2106
|
-
t ===
|
|
2134
|
+
t === _t ? void 0 : _t
|
|
2107
2135
|
// then global default map
|
|
2108
2136
|
].filter((s) => !!s)
|
|
2109
2137
|
});
|
|
2110
2138
|
r.common.issues.push(n);
|
|
2111
2139
|
}
|
|
2112
|
-
class
|
|
2140
|
+
class X {
|
|
2113
2141
|
constructor() {
|
|
2114
2142
|
this.value = "valid";
|
|
2115
2143
|
}
|
|
@@ -2131,33 +2159,33 @@ class G {
|
|
|
2131
2159
|
static async mergeObjectAsync(e, t) {
|
|
2132
2160
|
const n = [];
|
|
2133
2161
|
for (const s of t) {
|
|
2134
|
-
const
|
|
2162
|
+
const i = await s.key, a = await s.value;
|
|
2135
2163
|
n.push({
|
|
2136
|
-
key:
|
|
2137
|
-
value:
|
|
2164
|
+
key: i,
|
|
2165
|
+
value: a
|
|
2138
2166
|
});
|
|
2139
2167
|
}
|
|
2140
|
-
return
|
|
2168
|
+
return X.mergeObjectSync(e, n);
|
|
2141
2169
|
}
|
|
2142
2170
|
static mergeObjectSync(e, t) {
|
|
2143
2171
|
const n = {};
|
|
2144
2172
|
for (const s of t) {
|
|
2145
|
-
const { key:
|
|
2146
|
-
if (
|
|
2173
|
+
const { key: i, value: a } = s;
|
|
2174
|
+
if (i.status === "aborted" || a.status === "aborted")
|
|
2147
2175
|
return y;
|
|
2148
|
-
|
|
2176
|
+
i.status === "dirty" && e.dirty(), a.status === "dirty" && e.dirty(), i.value !== "__proto__" && (typeof a.value < "u" || s.alwaysSet) && (n[i.value] = a.value);
|
|
2149
2177
|
}
|
|
2150
2178
|
return { status: e.value, value: n };
|
|
2151
2179
|
}
|
|
2152
2180
|
}
|
|
2153
2181
|
const y = Object.freeze({
|
|
2154
2182
|
status: "aborted"
|
|
2155
|
-
}), dt = (r) => ({ status: "dirty", value: r }), W = (r) => ({ status: "valid", value: r }),
|
|
2183
|
+
}), dt = (r) => ({ status: "dirty", value: r }), W = (r) => ({ status: "valid", value: r }), gn = (r) => r.status === "aborted", _n = (r) => r.status === "dirty", Qe = (r) => r.status === "valid", Bt = (r) => typeof Promise < "u" && r instanceof Promise;
|
|
2156
2184
|
var _;
|
|
2157
2185
|
(function(r) {
|
|
2158
2186
|
r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
2159
2187
|
})(_ || (_ = {}));
|
|
2160
|
-
class
|
|
2188
|
+
class xe {
|
|
2161
2189
|
constructor(e, t, n, s) {
|
|
2162
2190
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = s;
|
|
2163
2191
|
}
|
|
@@ -2165,8 +2193,8 @@ class be {
|
|
|
2165
2193
|
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
2166
2194
|
}
|
|
2167
2195
|
}
|
|
2168
|
-
const
|
|
2169
|
-
if (
|
|
2196
|
+
const yn = (r, e) => {
|
|
2197
|
+
if (Qe(e))
|
|
2170
2198
|
return { success: !0, data: e.value };
|
|
2171
2199
|
if (!r.common.issues.length)
|
|
2172
2200
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -2186,9 +2214,9 @@ function b(r) {
|
|
|
2186
2214
|
const { errorMap: e, invalid_type_error: t, required_error: n, description: s } = r;
|
|
2187
2215
|
if (e && (t || n))
|
|
2188
2216
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
2189
|
-
return e ? { errorMap: e, description: s } : { errorMap: (
|
|
2217
|
+
return e ? { errorMap: e, description: s } : { errorMap: (a, o) => {
|
|
2190
2218
|
const { message: l } = r;
|
|
2191
|
-
return
|
|
2219
|
+
return a.code === "invalid_enum_value" ? { message: l ?? o.defaultError } : typeof o.data > "u" ? { message: l ?? n ?? o.defaultError } : a.code !== "invalid_type" ? { message: o.defaultError } : { message: l ?? t ?? o.defaultError };
|
|
2192
2220
|
}, description: s };
|
|
2193
2221
|
}
|
|
2194
2222
|
class C {
|
|
@@ -2196,13 +2224,13 @@ class C {
|
|
|
2196
2224
|
return this._def.description;
|
|
2197
2225
|
}
|
|
2198
2226
|
_getType(e) {
|
|
2199
|
-
return
|
|
2227
|
+
return he(e.data);
|
|
2200
2228
|
}
|
|
2201
2229
|
_getOrReturnCtx(e, t) {
|
|
2202
2230
|
return t || {
|
|
2203
2231
|
common: e.parent.common,
|
|
2204
2232
|
data: e.data,
|
|
2205
|
-
parsedType:
|
|
2233
|
+
parsedType: he(e.data),
|
|
2206
2234
|
schemaErrorMap: this._def.errorMap,
|
|
2207
2235
|
path: e.path,
|
|
2208
2236
|
parent: e.parent
|
|
@@ -2210,11 +2238,11 @@ class C {
|
|
|
2210
2238
|
}
|
|
2211
2239
|
_processInputParams(e) {
|
|
2212
2240
|
return {
|
|
2213
|
-
status: new
|
|
2241
|
+
status: new X(),
|
|
2214
2242
|
ctx: {
|
|
2215
2243
|
common: e.parent.common,
|
|
2216
2244
|
data: e.data,
|
|
2217
|
-
parsedType:
|
|
2245
|
+
parsedType: he(e.data),
|
|
2218
2246
|
schemaErrorMap: this._def.errorMap,
|
|
2219
2247
|
path: e.path,
|
|
2220
2248
|
parent: e.parent
|
|
@@ -2223,7 +2251,7 @@ class C {
|
|
|
2223
2251
|
}
|
|
2224
2252
|
_parseSync(e) {
|
|
2225
2253
|
const t = this._parse(e);
|
|
2226
|
-
if (
|
|
2254
|
+
if (Bt(t))
|
|
2227
2255
|
throw new Error("Synchronous parse encountered promise.");
|
|
2228
2256
|
return t;
|
|
2229
2257
|
}
|
|
@@ -2248,9 +2276,9 @@ class C {
|
|
|
2248
2276
|
schemaErrorMap: this._def.errorMap,
|
|
2249
2277
|
parent: null,
|
|
2250
2278
|
data: e,
|
|
2251
|
-
parsedType:
|
|
2279
|
+
parsedType: he(e)
|
|
2252
2280
|
}, s = this._parseSync({ data: e, path: n.path, parent: n });
|
|
2253
|
-
return
|
|
2281
|
+
return yn(n, s);
|
|
2254
2282
|
}
|
|
2255
2283
|
"~validate"(e) {
|
|
2256
2284
|
var n, s;
|
|
@@ -2263,24 +2291,24 @@ class C {
|
|
|
2263
2291
|
schemaErrorMap: this._def.errorMap,
|
|
2264
2292
|
parent: null,
|
|
2265
2293
|
data: e,
|
|
2266
|
-
parsedType:
|
|
2294
|
+
parsedType: he(e)
|
|
2267
2295
|
};
|
|
2268
2296
|
if (!this["~standard"].async)
|
|
2269
2297
|
try {
|
|
2270
|
-
const
|
|
2271
|
-
return
|
|
2272
|
-
value:
|
|
2298
|
+
const i = this._parseSync({ data: e, path: [], parent: t });
|
|
2299
|
+
return Qe(i) ? {
|
|
2300
|
+
value: i.value
|
|
2273
2301
|
} : {
|
|
2274
2302
|
issues: t.common.issues
|
|
2275
2303
|
};
|
|
2276
|
-
} catch (
|
|
2277
|
-
(s = (n =
|
|
2304
|
+
} catch (i) {
|
|
2305
|
+
(s = (n = i == null ? void 0 : i.message) == null ? void 0 : n.toLowerCase()) != null && s.includes("encountered") && (this["~standard"].async = !0), t.common = {
|
|
2278
2306
|
issues: [],
|
|
2279
2307
|
async: !0
|
|
2280
2308
|
};
|
|
2281
2309
|
}
|
|
2282
|
-
return this._parseAsync({ data: e, path: [], parent: t }).then((
|
|
2283
|
-
value:
|
|
2310
|
+
return this._parseAsync({ data: e, path: [], parent: t }).then((i) => Qe(i) ? {
|
|
2311
|
+
value: i.value
|
|
2284
2312
|
} : {
|
|
2285
2313
|
issues: t.common.issues
|
|
2286
2314
|
});
|
|
@@ -2302,25 +2330,25 @@ class C {
|
|
|
2302
2330
|
schemaErrorMap: this._def.errorMap,
|
|
2303
2331
|
parent: null,
|
|
2304
2332
|
data: e,
|
|
2305
|
-
parsedType:
|
|
2306
|
-
}, s = this._parse({ data: e, path: n.path, parent: n }),
|
|
2307
|
-
return
|
|
2333
|
+
parsedType: he(e)
|
|
2334
|
+
}, s = this._parse({ data: e, path: n.path, parent: n }), i = await (Bt(s) ? s : Promise.resolve(s));
|
|
2335
|
+
return yn(n, i);
|
|
2308
2336
|
}
|
|
2309
2337
|
refine(e, t) {
|
|
2310
2338
|
const n = (s) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(s) : t;
|
|
2311
|
-
return this._refinement((s,
|
|
2312
|
-
const
|
|
2339
|
+
return this._refinement((s, i) => {
|
|
2340
|
+
const a = e(s), o = () => i.addIssue({
|
|
2313
2341
|
code: c.custom,
|
|
2314
2342
|
...n(s)
|
|
2315
2343
|
});
|
|
2316
|
-
return typeof Promise < "u" &&
|
|
2344
|
+
return typeof Promise < "u" && a instanceof Promise ? a.then((l) => l ? !0 : (o(), !1)) : a ? !0 : (o(), !1);
|
|
2317
2345
|
});
|
|
2318
2346
|
}
|
|
2319
2347
|
refinement(e, t) {
|
|
2320
2348
|
return this._refinement((n, s) => e(n) ? !0 : (s.addIssue(typeof t == "function" ? t(n, s) : t), !1));
|
|
2321
2349
|
}
|
|
2322
2350
|
_refinement(e) {
|
|
2323
|
-
return new
|
|
2351
|
+
return new rt({
|
|
2324
2352
|
schema: this,
|
|
2325
2353
|
typeName: w.ZodEffects,
|
|
2326
2354
|
effect: { type: "refinement", refinement: e }
|
|
@@ -2337,28 +2365,28 @@ class C {
|
|
|
2337
2365
|
};
|
|
2338
2366
|
}
|
|
2339
2367
|
optional() {
|
|
2340
|
-
return
|
|
2368
|
+
return we.create(this, this._def);
|
|
2341
2369
|
}
|
|
2342
2370
|
nullable() {
|
|
2343
|
-
return
|
|
2371
|
+
return nt.create(this, this._def);
|
|
2344
2372
|
}
|
|
2345
2373
|
nullish() {
|
|
2346
2374
|
return this.nullable().optional();
|
|
2347
2375
|
}
|
|
2348
2376
|
array() {
|
|
2349
|
-
return
|
|
2377
|
+
return le.create(this);
|
|
2350
2378
|
}
|
|
2351
2379
|
promise() {
|
|
2352
|
-
return
|
|
2380
|
+
return kt.create(this, this._def);
|
|
2353
2381
|
}
|
|
2354
2382
|
or(e) {
|
|
2355
|
-
return
|
|
2383
|
+
return $t.create([this, e], this._def);
|
|
2356
2384
|
}
|
|
2357
2385
|
and(e) {
|
|
2358
|
-
return
|
|
2386
|
+
return qt.create(this, e, this._def);
|
|
2359
2387
|
}
|
|
2360
2388
|
transform(e) {
|
|
2361
|
-
return new
|
|
2389
|
+
return new rt({
|
|
2362
2390
|
...b(this._def),
|
|
2363
2391
|
schema: this,
|
|
2364
2392
|
typeName: w.ZodEffects,
|
|
@@ -2367,7 +2395,7 @@ class C {
|
|
|
2367
2395
|
}
|
|
2368
2396
|
default(e) {
|
|
2369
2397
|
const t = typeof e == "function" ? e : () => e;
|
|
2370
|
-
return new
|
|
2398
|
+
return new xr({
|
|
2371
2399
|
...b(this._def),
|
|
2372
2400
|
innerType: this,
|
|
2373
2401
|
defaultValue: t,
|
|
@@ -2375,7 +2403,7 @@ class C {
|
|
|
2375
2403
|
});
|
|
2376
2404
|
}
|
|
2377
2405
|
brand() {
|
|
2378
|
-
return new
|
|
2406
|
+
return new ya({
|
|
2379
2407
|
typeName: w.ZodBranded,
|
|
2380
2408
|
type: this,
|
|
2381
2409
|
...b(this._def)
|
|
@@ -2383,7 +2411,7 @@ class C {
|
|
|
2383
2411
|
}
|
|
2384
2412
|
catch(e) {
|
|
2385
2413
|
const t = typeof e == "function" ? e : () => e;
|
|
2386
|
-
return new
|
|
2414
|
+
return new br({
|
|
2387
2415
|
...b(this._def),
|
|
2388
2416
|
innerType: this,
|
|
2389
2417
|
catchValue: t,
|
|
@@ -2398,10 +2426,10 @@ class C {
|
|
|
2398
2426
|
});
|
|
2399
2427
|
}
|
|
2400
2428
|
pipe(e) {
|
|
2401
|
-
return
|
|
2429
|
+
return $r.create(this, e);
|
|
2402
2430
|
}
|
|
2403
2431
|
readonly() {
|
|
2404
|
-
return
|
|
2432
|
+
return Er.create(this);
|
|
2405
2433
|
}
|
|
2406
2434
|
isOptional() {
|
|
2407
2435
|
return this.safeParse(void 0).success;
|
|
@@ -2410,28 +2438,28 @@ class C {
|
|
|
2410
2438
|
return this.safeParse(null).success;
|
|
2411
2439
|
}
|
|
2412
2440
|
}
|
|
2413
|
-
const
|
|
2414
|
-
let
|
|
2415
|
-
const
|
|
2416
|
-
function
|
|
2441
|
+
const Ji = /^c[^\s-]{8,}$/i, Ki = /^[0-9a-z]+$/, Qi = /^[0-9A-HJKMNP-TV-Z]{26}$/i, ea = /^[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, ta = /^[a-z0-9_-]{21}$/i, ra = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, na = /^[-+]?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)?)??$/, sa = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ia = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
2442
|
+
let ir;
|
|
2443
|
+
const aa = /^(?:(?: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])$/, oa = /^(?:(?: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])$/, la = /^(([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]))$/, ua = /^(([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])$/, da = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, ca = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, vs = "((\\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])))", fa = new RegExp(`^${vs}$`);
|
|
2444
|
+
function gs(r) {
|
|
2417
2445
|
let e = "[0-5]\\d";
|
|
2418
2446
|
r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`);
|
|
2419
2447
|
const t = r.precision ? "+" : "?";
|
|
2420
2448
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
|
|
2421
2449
|
}
|
|
2422
|
-
function
|
|
2423
|
-
return new RegExp(`^${
|
|
2450
|
+
function ha(r) {
|
|
2451
|
+
return new RegExp(`^${gs(r)}$`);
|
|
2424
2452
|
}
|
|
2425
|
-
function
|
|
2426
|
-
let e = `${
|
|
2453
|
+
function pa(r) {
|
|
2454
|
+
let e = `${vs}T${gs(r)}`;
|
|
2427
2455
|
const t = [];
|
|
2428
2456
|
return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
2429
2457
|
}
|
|
2430
|
-
function
|
|
2431
|
-
return !!((e === "v4" || !e) &&
|
|
2458
|
+
function ma(r, e) {
|
|
2459
|
+
return !!((e === "v4" || !e) && aa.test(r) || (e === "v6" || !e) && la.test(r));
|
|
2432
2460
|
}
|
|
2433
|
-
function
|
|
2434
|
-
if (!
|
|
2461
|
+
function va(r, e) {
|
|
2462
|
+
if (!ra.test(r))
|
|
2435
2463
|
return !1;
|
|
2436
2464
|
try {
|
|
2437
2465
|
const [t] = r.split(".");
|
|
@@ -2443,162 +2471,162 @@ function fi(r, e) {
|
|
|
2443
2471
|
return !1;
|
|
2444
2472
|
}
|
|
2445
2473
|
}
|
|
2446
|
-
function
|
|
2447
|
-
return !!((e === "v4" || !e) &&
|
|
2474
|
+
function ga(r, e) {
|
|
2475
|
+
return !!((e === "v4" || !e) && oa.test(r) || (e === "v6" || !e) && ua.test(r));
|
|
2448
2476
|
}
|
|
2449
|
-
class
|
|
2477
|
+
class ye extends C {
|
|
2450
2478
|
_parse(e) {
|
|
2451
2479
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== g.string) {
|
|
2452
|
-
const
|
|
2453
|
-
return m(
|
|
2480
|
+
const i = this._getOrReturnCtx(e);
|
|
2481
|
+
return m(i, {
|
|
2454
2482
|
code: c.invalid_type,
|
|
2455
2483
|
expected: g.string,
|
|
2456
|
-
received:
|
|
2484
|
+
received: i.parsedType
|
|
2457
2485
|
}), y;
|
|
2458
2486
|
}
|
|
2459
|
-
const n = new
|
|
2487
|
+
const n = new X();
|
|
2460
2488
|
let s;
|
|
2461
|
-
for (const
|
|
2462
|
-
if (
|
|
2463
|
-
e.data.length <
|
|
2489
|
+
for (const i of this._def.checks)
|
|
2490
|
+
if (i.kind === "min")
|
|
2491
|
+
e.data.length < i.value && (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2464
2492
|
code: c.too_small,
|
|
2465
|
-
minimum:
|
|
2493
|
+
minimum: i.value,
|
|
2466
2494
|
type: "string",
|
|
2467
2495
|
inclusive: !0,
|
|
2468
2496
|
exact: !1,
|
|
2469
|
-
message:
|
|
2497
|
+
message: i.message
|
|
2470
2498
|
}), n.dirty());
|
|
2471
|
-
else if (
|
|
2472
|
-
e.data.length >
|
|
2499
|
+
else if (i.kind === "max")
|
|
2500
|
+
e.data.length > i.value && (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2473
2501
|
code: c.too_big,
|
|
2474
|
-
maximum:
|
|
2502
|
+
maximum: i.value,
|
|
2475
2503
|
type: "string",
|
|
2476
2504
|
inclusive: !0,
|
|
2477
2505
|
exact: !1,
|
|
2478
|
-
message:
|
|
2506
|
+
message: i.message
|
|
2479
2507
|
}), n.dirty());
|
|
2480
|
-
else if (
|
|
2481
|
-
const
|
|
2482
|
-
(
|
|
2508
|
+
else if (i.kind === "length") {
|
|
2509
|
+
const a = e.data.length > i.value, o = e.data.length < i.value;
|
|
2510
|
+
(a || o) && (s = this._getOrReturnCtx(e, s), a ? m(s, {
|
|
2483
2511
|
code: c.too_big,
|
|
2484
|
-
maximum:
|
|
2512
|
+
maximum: i.value,
|
|
2485
2513
|
type: "string",
|
|
2486
2514
|
inclusive: !0,
|
|
2487
2515
|
exact: !0,
|
|
2488
|
-
message:
|
|
2516
|
+
message: i.message
|
|
2489
2517
|
}) : o && m(s, {
|
|
2490
2518
|
code: c.too_small,
|
|
2491
|
-
minimum:
|
|
2519
|
+
minimum: i.value,
|
|
2492
2520
|
type: "string",
|
|
2493
2521
|
inclusive: !0,
|
|
2494
2522
|
exact: !0,
|
|
2495
|
-
message:
|
|
2523
|
+
message: i.message
|
|
2496
2524
|
}), n.dirty());
|
|
2497
|
-
} else if (
|
|
2498
|
-
|
|
2525
|
+
} else if (i.kind === "email")
|
|
2526
|
+
sa.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2499
2527
|
validation: "email",
|
|
2500
2528
|
code: c.invalid_string,
|
|
2501
|
-
message:
|
|
2529
|
+
message: i.message
|
|
2502
2530
|
}), n.dirty());
|
|
2503
|
-
else if (
|
|
2504
|
-
|
|
2531
|
+
else if (i.kind === "emoji")
|
|
2532
|
+
ir || (ir = new RegExp(ia, "u")), ir.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2505
2533
|
validation: "emoji",
|
|
2506
2534
|
code: c.invalid_string,
|
|
2507
|
-
message:
|
|
2535
|
+
message: i.message
|
|
2508
2536
|
}), n.dirty());
|
|
2509
|
-
else if (
|
|
2510
|
-
|
|
2537
|
+
else if (i.kind === "uuid")
|
|
2538
|
+
ea.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2511
2539
|
validation: "uuid",
|
|
2512
2540
|
code: c.invalid_string,
|
|
2513
|
-
message:
|
|
2541
|
+
message: i.message
|
|
2514
2542
|
}), n.dirty());
|
|
2515
|
-
else if (
|
|
2516
|
-
|
|
2543
|
+
else if (i.kind === "nanoid")
|
|
2544
|
+
ta.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2517
2545
|
validation: "nanoid",
|
|
2518
2546
|
code: c.invalid_string,
|
|
2519
|
-
message:
|
|
2547
|
+
message: i.message
|
|
2520
2548
|
}), n.dirty());
|
|
2521
|
-
else if (
|
|
2522
|
-
|
|
2549
|
+
else if (i.kind === "cuid")
|
|
2550
|
+
Ji.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2523
2551
|
validation: "cuid",
|
|
2524
2552
|
code: c.invalid_string,
|
|
2525
|
-
message:
|
|
2553
|
+
message: i.message
|
|
2526
2554
|
}), n.dirty());
|
|
2527
|
-
else if (
|
|
2528
|
-
|
|
2555
|
+
else if (i.kind === "cuid2")
|
|
2556
|
+
Ki.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2529
2557
|
validation: "cuid2",
|
|
2530
2558
|
code: c.invalid_string,
|
|
2531
|
-
message:
|
|
2559
|
+
message: i.message
|
|
2532
2560
|
}), n.dirty());
|
|
2533
|
-
else if (
|
|
2534
|
-
|
|
2561
|
+
else if (i.kind === "ulid")
|
|
2562
|
+
Qi.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2535
2563
|
validation: "ulid",
|
|
2536
2564
|
code: c.invalid_string,
|
|
2537
|
-
message:
|
|
2565
|
+
message: i.message
|
|
2538
2566
|
}), n.dirty());
|
|
2539
|
-
else if (
|
|
2567
|
+
else if (i.kind === "url")
|
|
2540
2568
|
try {
|
|
2541
2569
|
new URL(e.data);
|
|
2542
2570
|
} catch {
|
|
2543
2571
|
s = this._getOrReturnCtx(e, s), m(s, {
|
|
2544
2572
|
validation: "url",
|
|
2545
2573
|
code: c.invalid_string,
|
|
2546
|
-
message:
|
|
2574
|
+
message: i.message
|
|
2547
2575
|
}), n.dirty();
|
|
2548
2576
|
}
|
|
2549
|
-
else
|
|
2577
|
+
else i.kind === "regex" ? (i.regex.lastIndex = 0, i.regex.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2550
2578
|
validation: "regex",
|
|
2551
2579
|
code: c.invalid_string,
|
|
2552
|
-
message:
|
|
2553
|
-
}), n.dirty())) :
|
|
2580
|
+
message: i.message
|
|
2581
|
+
}), n.dirty())) : i.kind === "trim" ? e.data = e.data.trim() : i.kind === "includes" ? e.data.includes(i.value, i.position) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2554
2582
|
code: c.invalid_string,
|
|
2555
|
-
validation: { includes:
|
|
2556
|
-
message:
|
|
2557
|
-
}), n.dirty()) :
|
|
2583
|
+
validation: { includes: i.value, position: i.position },
|
|
2584
|
+
message: i.message
|
|
2585
|
+
}), n.dirty()) : i.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : i.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : i.kind === "startsWith" ? e.data.startsWith(i.value) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2558
2586
|
code: c.invalid_string,
|
|
2559
|
-
validation: { startsWith:
|
|
2560
|
-
message:
|
|
2561
|
-
}), n.dirty()) :
|
|
2587
|
+
validation: { startsWith: i.value },
|
|
2588
|
+
message: i.message
|
|
2589
|
+
}), n.dirty()) : i.kind === "endsWith" ? e.data.endsWith(i.value) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2562
2590
|
code: c.invalid_string,
|
|
2563
|
-
validation: { endsWith:
|
|
2564
|
-
message:
|
|
2565
|
-
}), n.dirty()) :
|
|
2591
|
+
validation: { endsWith: i.value },
|
|
2592
|
+
message: i.message
|
|
2593
|
+
}), n.dirty()) : i.kind === "datetime" ? pa(i).test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2566
2594
|
code: c.invalid_string,
|
|
2567
2595
|
validation: "datetime",
|
|
2568
|
-
message:
|
|
2569
|
-
}), n.dirty()) :
|
|
2596
|
+
message: i.message
|
|
2597
|
+
}), n.dirty()) : i.kind === "date" ? fa.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2570
2598
|
code: c.invalid_string,
|
|
2571
2599
|
validation: "date",
|
|
2572
|
-
message:
|
|
2573
|
-
}), n.dirty()) :
|
|
2600
|
+
message: i.message
|
|
2601
|
+
}), n.dirty()) : i.kind === "time" ? ha(i).test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2574
2602
|
code: c.invalid_string,
|
|
2575
2603
|
validation: "time",
|
|
2576
|
-
message:
|
|
2577
|
-
}), n.dirty()) :
|
|
2604
|
+
message: i.message
|
|
2605
|
+
}), n.dirty()) : i.kind === "duration" ? na.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2578
2606
|
validation: "duration",
|
|
2579
2607
|
code: c.invalid_string,
|
|
2580
|
-
message:
|
|
2581
|
-
}), n.dirty()) :
|
|
2608
|
+
message: i.message
|
|
2609
|
+
}), n.dirty()) : i.kind === "ip" ? ma(e.data, i.version) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2582
2610
|
validation: "ip",
|
|
2583
2611
|
code: c.invalid_string,
|
|
2584
|
-
message:
|
|
2585
|
-
}), n.dirty()) :
|
|
2612
|
+
message: i.message
|
|
2613
|
+
}), n.dirty()) : i.kind === "jwt" ? va(e.data, i.alg) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2586
2614
|
validation: "jwt",
|
|
2587
2615
|
code: c.invalid_string,
|
|
2588
|
-
message:
|
|
2589
|
-
}), n.dirty()) :
|
|
2616
|
+
message: i.message
|
|
2617
|
+
}), n.dirty()) : i.kind === "cidr" ? ga(e.data, i.version) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2590
2618
|
validation: "cidr",
|
|
2591
2619
|
code: c.invalid_string,
|
|
2592
|
-
message:
|
|
2593
|
-
}), n.dirty()) :
|
|
2620
|
+
message: i.message
|
|
2621
|
+
}), n.dirty()) : i.kind === "base64" ? da.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2594
2622
|
validation: "base64",
|
|
2595
2623
|
code: c.invalid_string,
|
|
2596
|
-
message:
|
|
2597
|
-
}), n.dirty()) :
|
|
2624
|
+
message: i.message
|
|
2625
|
+
}), n.dirty()) : i.kind === "base64url" ? ca.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
2598
2626
|
validation: "base64url",
|
|
2599
2627
|
code: c.invalid_string,
|
|
2600
|
-
message:
|
|
2601
|
-
}), n.dirty()) : A.assertNever(
|
|
2628
|
+
message: i.message
|
|
2629
|
+
}), n.dirty()) : A.assertNever(i);
|
|
2602
2630
|
return { status: n.value, value: e.data };
|
|
2603
2631
|
}
|
|
2604
2632
|
_regex(e, t, n) {
|
|
@@ -2609,7 +2637,7 @@ class we extends C {
|
|
|
2609
2637
|
});
|
|
2610
2638
|
}
|
|
2611
2639
|
_addCheck(e) {
|
|
2612
|
-
return new
|
|
2640
|
+
return new ye({
|
|
2613
2641
|
...this._def,
|
|
2614
2642
|
checks: [...this._def.checks, e]
|
|
2615
2643
|
});
|
|
@@ -2745,19 +2773,19 @@ class we extends C {
|
|
|
2745
2773
|
return this.min(1, _.errToObj(e));
|
|
2746
2774
|
}
|
|
2747
2775
|
trim() {
|
|
2748
|
-
return new
|
|
2776
|
+
return new ye({
|
|
2749
2777
|
...this._def,
|
|
2750
2778
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
2751
2779
|
});
|
|
2752
2780
|
}
|
|
2753
2781
|
toLowerCase() {
|
|
2754
|
-
return new
|
|
2782
|
+
return new ye({
|
|
2755
2783
|
...this._def,
|
|
2756
2784
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
2757
2785
|
});
|
|
2758
2786
|
}
|
|
2759
2787
|
toUpperCase() {
|
|
2760
|
-
return new
|
|
2788
|
+
return new ye({
|
|
2761
2789
|
...this._def,
|
|
2762
2790
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
2763
2791
|
});
|
|
@@ -2823,59 +2851,59 @@ class we extends C {
|
|
|
2823
2851
|
return e;
|
|
2824
2852
|
}
|
|
2825
2853
|
}
|
|
2826
|
-
|
|
2854
|
+
ye.create = (r) => new ye({
|
|
2827
2855
|
checks: [],
|
|
2828
2856
|
typeName: w.ZodString,
|
|
2829
2857
|
coerce: (r == null ? void 0 : r.coerce) ?? !1,
|
|
2830
2858
|
...b(r)
|
|
2831
2859
|
});
|
|
2832
|
-
function
|
|
2833
|
-
const t = (r.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, s = t > n ? t : n,
|
|
2834
|
-
return
|
|
2860
|
+
function _a(r, e) {
|
|
2861
|
+
const t = (r.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, s = t > n ? t : n, i = Number.parseInt(r.toFixed(s).replace(".", "")), a = Number.parseInt(e.toFixed(s).replace(".", ""));
|
|
2862
|
+
return i % a / 10 ** s;
|
|
2835
2863
|
}
|
|
2836
|
-
class
|
|
2864
|
+
class et extends C {
|
|
2837
2865
|
constructor() {
|
|
2838
2866
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
2839
2867
|
}
|
|
2840
2868
|
_parse(e) {
|
|
2841
2869
|
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== g.number) {
|
|
2842
|
-
const
|
|
2843
|
-
return m(
|
|
2870
|
+
const i = this._getOrReturnCtx(e);
|
|
2871
|
+
return m(i, {
|
|
2844
2872
|
code: c.invalid_type,
|
|
2845
2873
|
expected: g.number,
|
|
2846
|
-
received:
|
|
2874
|
+
received: i.parsedType
|
|
2847
2875
|
}), y;
|
|
2848
2876
|
}
|
|
2849
2877
|
let n;
|
|
2850
|
-
const s = new
|
|
2851
|
-
for (const
|
|
2852
|
-
|
|
2878
|
+
const s = new X();
|
|
2879
|
+
for (const i of this._def.checks)
|
|
2880
|
+
i.kind === "int" ? A.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), m(n, {
|
|
2853
2881
|
code: c.invalid_type,
|
|
2854
2882
|
expected: "integer",
|
|
2855
2883
|
received: "float",
|
|
2856
|
-
message:
|
|
2857
|
-
}), s.dirty()) :
|
|
2884
|
+
message: i.message
|
|
2885
|
+
}), s.dirty()) : i.kind === "min" ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (n = this._getOrReturnCtx(e, n), m(n, {
|
|
2858
2886
|
code: c.too_small,
|
|
2859
|
-
minimum:
|
|
2887
|
+
minimum: i.value,
|
|
2860
2888
|
type: "number",
|
|
2861
|
-
inclusive:
|
|
2889
|
+
inclusive: i.inclusive,
|
|
2862
2890
|
exact: !1,
|
|
2863
|
-
message:
|
|
2864
|
-
}), s.dirty()) :
|
|
2891
|
+
message: i.message
|
|
2892
|
+
}), s.dirty()) : i.kind === "max" ? (i.inclusive ? e.data > i.value : e.data >= i.value) && (n = this._getOrReturnCtx(e, n), m(n, {
|
|
2865
2893
|
code: c.too_big,
|
|
2866
|
-
maximum:
|
|
2894
|
+
maximum: i.value,
|
|
2867
2895
|
type: "number",
|
|
2868
|
-
inclusive:
|
|
2896
|
+
inclusive: i.inclusive,
|
|
2869
2897
|
exact: !1,
|
|
2870
|
-
message:
|
|
2871
|
-
}), s.dirty()) :
|
|
2898
|
+
message: i.message
|
|
2899
|
+
}), s.dirty()) : i.kind === "multipleOf" ? _a(e.data, i.value) !== 0 && (n = this._getOrReturnCtx(e, n), m(n, {
|
|
2872
2900
|
code: c.not_multiple_of,
|
|
2873
|
-
multipleOf:
|
|
2874
|
-
message:
|
|
2875
|
-
}), s.dirty()) :
|
|
2901
|
+
multipleOf: i.value,
|
|
2902
|
+
message: i.message
|
|
2903
|
+
}), s.dirty()) : i.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), m(n, {
|
|
2876
2904
|
code: c.not_finite,
|
|
2877
|
-
message:
|
|
2878
|
-
}), s.dirty()) : A.assertNever(
|
|
2905
|
+
message: i.message
|
|
2906
|
+
}), s.dirty()) : A.assertNever(i);
|
|
2879
2907
|
return { status: s.value, value: e.data };
|
|
2880
2908
|
}
|
|
2881
2909
|
gte(e, t) {
|
|
@@ -2891,7 +2919,7 @@ class Ke extends C {
|
|
|
2891
2919
|
return this.setLimit("max", e, !1, _.toString(t));
|
|
2892
2920
|
}
|
|
2893
2921
|
setLimit(e, t, n, s) {
|
|
2894
|
-
return new
|
|
2922
|
+
return new et({
|
|
2895
2923
|
...this._def,
|
|
2896
2924
|
checks: [
|
|
2897
2925
|
...this._def.checks,
|
|
@@ -2905,7 +2933,7 @@ class Ke extends C {
|
|
|
2905
2933
|
});
|
|
2906
2934
|
}
|
|
2907
2935
|
_addCheck(e) {
|
|
2908
|
-
return new
|
|
2936
|
+
return new et({
|
|
2909
2937
|
...this._def,
|
|
2910
2938
|
checks: [...this._def.checks, e]
|
|
2911
2939
|
});
|
|
@@ -2999,13 +3027,13 @@ class Ke extends C {
|
|
|
2999
3027
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
3000
3028
|
}
|
|
3001
3029
|
}
|
|
3002
|
-
|
|
3030
|
+
et.create = (r) => new et({
|
|
3003
3031
|
checks: [],
|
|
3004
3032
|
typeName: w.ZodNumber,
|
|
3005
3033
|
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
3006
3034
|
...b(r)
|
|
3007
3035
|
});
|
|
3008
|
-
class
|
|
3036
|
+
class yt extends C {
|
|
3009
3037
|
constructor() {
|
|
3010
3038
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
3011
3039
|
}
|
|
@@ -3019,25 +3047,25 @@ class gt extends C {
|
|
|
3019
3047
|
if (this._getType(e) !== g.bigint)
|
|
3020
3048
|
return this._getInvalidInput(e);
|
|
3021
3049
|
let n;
|
|
3022
|
-
const s = new
|
|
3023
|
-
for (const
|
|
3024
|
-
|
|
3050
|
+
const s = new X();
|
|
3051
|
+
for (const i of this._def.checks)
|
|
3052
|
+
i.kind === "min" ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (n = this._getOrReturnCtx(e, n), m(n, {
|
|
3025
3053
|
code: c.too_small,
|
|
3026
3054
|
type: "bigint",
|
|
3027
|
-
minimum:
|
|
3028
|
-
inclusive:
|
|
3029
|
-
message:
|
|
3030
|
-
}), s.dirty()) :
|
|
3055
|
+
minimum: i.value,
|
|
3056
|
+
inclusive: i.inclusive,
|
|
3057
|
+
message: i.message
|
|
3058
|
+
}), s.dirty()) : i.kind === "max" ? (i.inclusive ? e.data > i.value : e.data >= i.value) && (n = this._getOrReturnCtx(e, n), m(n, {
|
|
3031
3059
|
code: c.too_big,
|
|
3032
3060
|
type: "bigint",
|
|
3033
|
-
maximum:
|
|
3034
|
-
inclusive:
|
|
3035
|
-
message:
|
|
3036
|
-
}), s.dirty()) :
|
|
3061
|
+
maximum: i.value,
|
|
3062
|
+
inclusive: i.inclusive,
|
|
3063
|
+
message: i.message
|
|
3064
|
+
}), s.dirty()) : i.kind === "multipleOf" ? e.data % i.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n), m(n, {
|
|
3037
3065
|
code: c.not_multiple_of,
|
|
3038
|
-
multipleOf:
|
|
3039
|
-
message:
|
|
3040
|
-
}), s.dirty()) : A.assertNever(
|
|
3066
|
+
multipleOf: i.value,
|
|
3067
|
+
message: i.message
|
|
3068
|
+
}), s.dirty()) : A.assertNever(i);
|
|
3041
3069
|
return { status: s.value, value: e.data };
|
|
3042
3070
|
}
|
|
3043
3071
|
_getInvalidInput(e) {
|
|
@@ -3061,7 +3089,7 @@ class gt extends C {
|
|
|
3061
3089
|
return this.setLimit("max", e, !1, _.toString(t));
|
|
3062
3090
|
}
|
|
3063
3091
|
setLimit(e, t, n, s) {
|
|
3064
|
-
return new
|
|
3092
|
+
return new yt({
|
|
3065
3093
|
...this._def,
|
|
3066
3094
|
checks: [
|
|
3067
3095
|
...this._def.checks,
|
|
@@ -3075,7 +3103,7 @@ class gt extends C {
|
|
|
3075
3103
|
});
|
|
3076
3104
|
}
|
|
3077
3105
|
_addCheck(e) {
|
|
3078
|
-
return new
|
|
3106
|
+
return new yt({
|
|
3079
3107
|
...this._def,
|
|
3080
3108
|
checks: [...this._def.checks, e]
|
|
3081
3109
|
});
|
|
@@ -3132,13 +3160,13 @@ class gt extends C {
|
|
|
3132
3160
|
return e;
|
|
3133
3161
|
}
|
|
3134
3162
|
}
|
|
3135
|
-
|
|
3163
|
+
yt.create = (r) => new yt({
|
|
3136
3164
|
checks: [],
|
|
3137
3165
|
typeName: w.ZodBigInt,
|
|
3138
3166
|
coerce: (r == null ? void 0 : r.coerce) ?? !1,
|
|
3139
3167
|
...b(r)
|
|
3140
3168
|
});
|
|
3141
|
-
class
|
|
3169
|
+
class _r extends C {
|
|
3142
3170
|
_parse(e) {
|
|
3143
3171
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== g.boolean) {
|
|
3144
3172
|
const n = this._getOrReturnCtx(e);
|
|
@@ -3151,52 +3179,52 @@ class mr extends C {
|
|
|
3151
3179
|
return W(e.data);
|
|
3152
3180
|
}
|
|
3153
3181
|
}
|
|
3154
|
-
|
|
3182
|
+
_r.create = (r) => new _r({
|
|
3155
3183
|
typeName: w.ZodBoolean,
|
|
3156
3184
|
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
3157
3185
|
...b(r)
|
|
3158
3186
|
});
|
|
3159
|
-
class
|
|
3187
|
+
class Ut extends C {
|
|
3160
3188
|
_parse(e) {
|
|
3161
3189
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== g.date) {
|
|
3162
|
-
const
|
|
3163
|
-
return m(
|
|
3190
|
+
const i = this._getOrReturnCtx(e);
|
|
3191
|
+
return m(i, {
|
|
3164
3192
|
code: c.invalid_type,
|
|
3165
3193
|
expected: g.date,
|
|
3166
|
-
received:
|
|
3194
|
+
received: i.parsedType
|
|
3167
3195
|
}), y;
|
|
3168
3196
|
}
|
|
3169
3197
|
if (Number.isNaN(e.data.getTime())) {
|
|
3170
|
-
const
|
|
3171
|
-
return m(
|
|
3198
|
+
const i = this._getOrReturnCtx(e);
|
|
3199
|
+
return m(i, {
|
|
3172
3200
|
code: c.invalid_date
|
|
3173
3201
|
}), y;
|
|
3174
3202
|
}
|
|
3175
|
-
const n = new
|
|
3203
|
+
const n = new X();
|
|
3176
3204
|
let s;
|
|
3177
|
-
for (const
|
|
3178
|
-
|
|
3205
|
+
for (const i of this._def.checks)
|
|
3206
|
+
i.kind === "min" ? e.data.getTime() < i.value && (s = this._getOrReturnCtx(e, s), m(s, {
|
|
3179
3207
|
code: c.too_small,
|
|
3180
|
-
message:
|
|
3208
|
+
message: i.message,
|
|
3181
3209
|
inclusive: !0,
|
|
3182
3210
|
exact: !1,
|
|
3183
|
-
minimum:
|
|
3211
|
+
minimum: i.value,
|
|
3184
3212
|
type: "date"
|
|
3185
|
-
}), n.dirty()) :
|
|
3213
|
+
}), n.dirty()) : i.kind === "max" ? e.data.getTime() > i.value && (s = this._getOrReturnCtx(e, s), m(s, {
|
|
3186
3214
|
code: c.too_big,
|
|
3187
|
-
message:
|
|
3215
|
+
message: i.message,
|
|
3188
3216
|
inclusive: !0,
|
|
3189
3217
|
exact: !1,
|
|
3190
|
-
maximum:
|
|
3218
|
+
maximum: i.value,
|
|
3191
3219
|
type: "date"
|
|
3192
|
-
}), n.dirty()) : A.assertNever(
|
|
3220
|
+
}), n.dirty()) : A.assertNever(i);
|
|
3193
3221
|
return {
|
|
3194
3222
|
status: n.value,
|
|
3195
3223
|
value: new Date(e.data.getTime())
|
|
3196
3224
|
};
|
|
3197
3225
|
}
|
|
3198
3226
|
_addCheck(e) {
|
|
3199
|
-
return new
|
|
3227
|
+
return new Ut({
|
|
3200
3228
|
...this._def,
|
|
3201
3229
|
checks: [...this._def.checks, e]
|
|
3202
3230
|
});
|
|
@@ -3228,13 +3256,13 @@ class Vt extends C {
|
|
|
3228
3256
|
return e != null ? new Date(e) : null;
|
|
3229
3257
|
}
|
|
3230
3258
|
}
|
|
3231
|
-
|
|
3259
|
+
Ut.create = (r) => new Ut({
|
|
3232
3260
|
checks: [],
|
|
3233
3261
|
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
3234
3262
|
typeName: w.ZodDate,
|
|
3235
3263
|
...b(r)
|
|
3236
3264
|
});
|
|
3237
|
-
class
|
|
3265
|
+
class wn extends C {
|
|
3238
3266
|
_parse(e) {
|
|
3239
3267
|
if (this._getType(e) !== g.symbol) {
|
|
3240
3268
|
const n = this._getOrReturnCtx(e);
|
|
@@ -3247,11 +3275,11 @@ class _n extends C {
|
|
|
3247
3275
|
return W(e.data);
|
|
3248
3276
|
}
|
|
3249
3277
|
}
|
|
3250
|
-
|
|
3278
|
+
wn.create = (r) => new wn({
|
|
3251
3279
|
typeName: w.ZodSymbol,
|
|
3252
3280
|
...b(r)
|
|
3253
3281
|
});
|
|
3254
|
-
class
|
|
3282
|
+
class kn extends C {
|
|
3255
3283
|
_parse(e) {
|
|
3256
3284
|
if (this._getType(e) !== g.undefined) {
|
|
3257
3285
|
const n = this._getOrReturnCtx(e);
|
|
@@ -3264,11 +3292,11 @@ class yn extends C {
|
|
|
3264
3292
|
return W(e.data);
|
|
3265
3293
|
}
|
|
3266
3294
|
}
|
|
3267
|
-
|
|
3295
|
+
kn.create = (r) => new kn({
|
|
3268
3296
|
typeName: w.ZodUndefined,
|
|
3269
3297
|
...b(r)
|
|
3270
3298
|
});
|
|
3271
|
-
class
|
|
3299
|
+
class xn extends C {
|
|
3272
3300
|
_parse(e) {
|
|
3273
3301
|
if (this._getType(e) !== g.null) {
|
|
3274
3302
|
const n = this._getOrReturnCtx(e);
|
|
@@ -3281,11 +3309,11 @@ class wn extends C {
|
|
|
3281
3309
|
return W(e.data);
|
|
3282
3310
|
}
|
|
3283
3311
|
}
|
|
3284
|
-
|
|
3312
|
+
xn.create = (r) => new xn({
|
|
3285
3313
|
typeName: w.ZodNull,
|
|
3286
3314
|
...b(r)
|
|
3287
3315
|
});
|
|
3288
|
-
class
|
|
3316
|
+
class yr extends C {
|
|
3289
3317
|
constructor() {
|
|
3290
3318
|
super(...arguments), this._any = !0;
|
|
3291
3319
|
}
|
|
@@ -3293,7 +3321,7 @@ class vr extends C {
|
|
|
3293
3321
|
return W(e.data);
|
|
3294
3322
|
}
|
|
3295
3323
|
}
|
|
3296
|
-
|
|
3324
|
+
yr.create = (r) => new yr({
|
|
3297
3325
|
typeName: w.ZodAny,
|
|
3298
3326
|
...b(r)
|
|
3299
3327
|
});
|
|
@@ -3309,7 +3337,7 @@ $e.create = (r) => new $e({
|
|
|
3309
3337
|
typeName: w.ZodUnknown,
|
|
3310
3338
|
...b(r)
|
|
3311
3339
|
});
|
|
3312
|
-
class
|
|
3340
|
+
class be extends C {
|
|
3313
3341
|
_parse(e) {
|
|
3314
3342
|
const t = this._getOrReturnCtx(e);
|
|
3315
3343
|
return m(t, {
|
|
@@ -3319,11 +3347,11 @@ class Ee extends C {
|
|
|
3319
3347
|
}), y;
|
|
3320
3348
|
}
|
|
3321
3349
|
}
|
|
3322
|
-
|
|
3350
|
+
be.create = (r) => new be({
|
|
3323
3351
|
typeName: w.ZodNever,
|
|
3324
3352
|
...b(r)
|
|
3325
3353
|
});
|
|
3326
|
-
class
|
|
3354
|
+
class wr extends C {
|
|
3327
3355
|
_parse(e) {
|
|
3328
3356
|
if (this._getType(e) !== g.undefined) {
|
|
3329
3357
|
const n = this._getOrReturnCtx(e);
|
|
@@ -3336,11 +3364,11 @@ class gr extends C {
|
|
|
3336
3364
|
return W(e.data);
|
|
3337
3365
|
}
|
|
3338
3366
|
}
|
|
3339
|
-
|
|
3367
|
+
wr.create = (r) => new wr({
|
|
3340
3368
|
typeName: w.ZodVoid,
|
|
3341
3369
|
...b(r)
|
|
3342
3370
|
});
|
|
3343
|
-
class
|
|
3371
|
+
class le extends C {
|
|
3344
3372
|
_parse(e) {
|
|
3345
3373
|
const { ctx: t, status: n } = this._processInputParams(e), s = this._def;
|
|
3346
3374
|
if (t.parsedType !== g.array)
|
|
@@ -3350,11 +3378,11 @@ class oe extends C {
|
|
|
3350
3378
|
received: t.parsedType
|
|
3351
3379
|
}), y;
|
|
3352
3380
|
if (s.exactLength !== null) {
|
|
3353
|
-
const
|
|
3354
|
-
(
|
|
3355
|
-
code:
|
|
3381
|
+
const a = t.data.length > s.exactLength.value, o = t.data.length < s.exactLength.value;
|
|
3382
|
+
(a || o) && (m(t, {
|
|
3383
|
+
code: a ? c.too_big : c.too_small,
|
|
3356
3384
|
minimum: o ? s.exactLength.value : void 0,
|
|
3357
|
-
maximum:
|
|
3385
|
+
maximum: a ? s.exactLength.value : void 0,
|
|
3358
3386
|
type: "array",
|
|
3359
3387
|
inclusive: !0,
|
|
3360
3388
|
exact: !0,
|
|
@@ -3376,27 +3404,27 @@ class oe extends C {
|
|
|
3376
3404
|
exact: !1,
|
|
3377
3405
|
message: s.maxLength.message
|
|
3378
3406
|
}), n.dirty()), t.common.async)
|
|
3379
|
-
return Promise.all([...t.data].map((
|
|
3380
|
-
const
|
|
3381
|
-
return
|
|
3407
|
+
return Promise.all([...t.data].map((a, o) => s.type._parseAsync(new xe(t, a, t.path, o)))).then((a) => X.mergeArray(n, a));
|
|
3408
|
+
const i = [...t.data].map((a, o) => s.type._parseSync(new xe(t, a, t.path, o)));
|
|
3409
|
+
return X.mergeArray(n, i);
|
|
3382
3410
|
}
|
|
3383
3411
|
get element() {
|
|
3384
3412
|
return this._def.type;
|
|
3385
3413
|
}
|
|
3386
3414
|
min(e, t) {
|
|
3387
|
-
return new
|
|
3415
|
+
return new le({
|
|
3388
3416
|
...this._def,
|
|
3389
3417
|
minLength: { value: e, message: _.toString(t) }
|
|
3390
3418
|
});
|
|
3391
3419
|
}
|
|
3392
3420
|
max(e, t) {
|
|
3393
|
-
return new
|
|
3421
|
+
return new le({
|
|
3394
3422
|
...this._def,
|
|
3395
3423
|
maxLength: { value: e, message: _.toString(t) }
|
|
3396
3424
|
});
|
|
3397
3425
|
}
|
|
3398
3426
|
length(e, t) {
|
|
3399
|
-
return new
|
|
3427
|
+
return new le({
|
|
3400
3428
|
...this._def,
|
|
3401
3429
|
exactLength: { value: e, message: _.toString(t) }
|
|
3402
3430
|
});
|
|
@@ -3405,7 +3433,7 @@ class oe extends C {
|
|
|
3405
3433
|
return this.min(1, e);
|
|
3406
3434
|
}
|
|
3407
3435
|
}
|
|
3408
|
-
|
|
3436
|
+
le.create = (r, e) => new le({
|
|
3409
3437
|
type: r,
|
|
3410
3438
|
minLength: null,
|
|
3411
3439
|
maxLength: null,
|
|
@@ -3418,16 +3446,16 @@ function Fe(r) {
|
|
|
3418
3446
|
const e = {};
|
|
3419
3447
|
for (const t in r.shape) {
|
|
3420
3448
|
const n = r.shape[t];
|
|
3421
|
-
e[t] =
|
|
3449
|
+
e[t] = we.create(Fe(n));
|
|
3422
3450
|
}
|
|
3423
3451
|
return new D({
|
|
3424
3452
|
...r._def,
|
|
3425
3453
|
shape: () => e
|
|
3426
3454
|
});
|
|
3427
|
-
} else return r instanceof
|
|
3455
|
+
} else return r instanceof le ? new le({
|
|
3428
3456
|
...r._def,
|
|
3429
3457
|
type: Fe(r.element)
|
|
3430
|
-
}) : r instanceof
|
|
3458
|
+
}) : r instanceof we ? we.create(Fe(r.unwrap())) : r instanceof nt ? nt.create(Fe(r.unwrap())) : r instanceof fe ? fe.create(r.items.map((e) => Fe(e))) : r;
|
|
3431
3459
|
}
|
|
3432
3460
|
class D extends C {
|
|
3433
3461
|
constructor() {
|
|
@@ -3448,20 +3476,20 @@ class D extends C {
|
|
|
3448
3476
|
received: u.parsedType
|
|
3449
3477
|
}), y;
|
|
3450
3478
|
}
|
|
3451
|
-
const { status: n, ctx: s } = this._processInputParams(e), { shape:
|
|
3452
|
-
if (!(this._def.catchall instanceof
|
|
3479
|
+
const { status: n, ctx: s } = this._processInputParams(e), { shape: i, keys: a } = this._getCached(), o = [];
|
|
3480
|
+
if (!(this._def.catchall instanceof be && this._def.unknownKeys === "strip"))
|
|
3453
3481
|
for (const u in s.data)
|
|
3454
|
-
|
|
3482
|
+
a.includes(u) || o.push(u);
|
|
3455
3483
|
const l = [];
|
|
3456
|
-
for (const u of
|
|
3457
|
-
const d =
|
|
3484
|
+
for (const u of a) {
|
|
3485
|
+
const d = i[u], h = s.data[u];
|
|
3458
3486
|
l.push({
|
|
3459
3487
|
key: { status: "valid", value: u },
|
|
3460
|
-
value: d._parse(new
|
|
3488
|
+
value: d._parse(new xe(s, h, s.path, u)),
|
|
3461
3489
|
alwaysSet: u in s.data
|
|
3462
3490
|
});
|
|
3463
3491
|
}
|
|
3464
|
-
if (this._def.catchall instanceof
|
|
3492
|
+
if (this._def.catchall instanceof be) {
|
|
3465
3493
|
const u = this._def.unknownKeys;
|
|
3466
3494
|
if (u === "passthrough")
|
|
3467
3495
|
for (const d of o)
|
|
@@ -3478,11 +3506,11 @@ class D extends C {
|
|
|
3478
3506
|
} else {
|
|
3479
3507
|
const u = this._def.catchall;
|
|
3480
3508
|
for (const d of o) {
|
|
3481
|
-
const
|
|
3509
|
+
const h = s.data[d];
|
|
3482
3510
|
l.push({
|
|
3483
3511
|
key: { status: "valid", value: d },
|
|
3484
3512
|
value: u._parse(
|
|
3485
|
-
new
|
|
3513
|
+
new xe(s, h, s.path, d)
|
|
3486
3514
|
//, ctx.child(key), value, getParsedType(value)
|
|
3487
3515
|
),
|
|
3488
3516
|
alwaysSet: d in s.data
|
|
@@ -3492,15 +3520,15 @@ class D extends C {
|
|
|
3492
3520
|
return s.common.async ? Promise.resolve().then(async () => {
|
|
3493
3521
|
const u = [];
|
|
3494
3522
|
for (const d of l) {
|
|
3495
|
-
const
|
|
3523
|
+
const h = await d.key, p = await d.value;
|
|
3496
3524
|
u.push({
|
|
3497
|
-
key:
|
|
3525
|
+
key: h,
|
|
3498
3526
|
value: p,
|
|
3499
3527
|
alwaysSet: d.alwaysSet
|
|
3500
3528
|
});
|
|
3501
3529
|
}
|
|
3502
3530
|
return u;
|
|
3503
|
-
}).then((u) =>
|
|
3531
|
+
}).then((u) => X.mergeObjectSync(n, u)) : X.mergeObjectSync(n, l);
|
|
3504
3532
|
}
|
|
3505
3533
|
get shape() {
|
|
3506
3534
|
return this._def.shape();
|
|
@@ -3511,8 +3539,8 @@ class D extends C {
|
|
|
3511
3539
|
unknownKeys: "strict",
|
|
3512
3540
|
...e !== void 0 ? {
|
|
3513
3541
|
errorMap: (t, n) => {
|
|
3514
|
-
var
|
|
3515
|
-
const s = ((
|
|
3542
|
+
var i, a;
|
|
3543
|
+
const s = ((a = (i = this._def).errorMap) == null ? void 0 : a.call(i, t, n).message) ?? n.defaultError;
|
|
3516
3544
|
return t.code === "unrecognized_keys" ? {
|
|
3517
3545
|
message: _.errToObj(e).message ?? s
|
|
3518
3546
|
} : {
|
|
@@ -3682,10 +3710,10 @@ class D extends C {
|
|
|
3682
3710
|
if (e && !e[n])
|
|
3683
3711
|
t[n] = this.shape[n];
|
|
3684
3712
|
else {
|
|
3685
|
-
let
|
|
3686
|
-
for (;
|
|
3687
|
-
|
|
3688
|
-
t[n] =
|
|
3713
|
+
let i = this.shape[n];
|
|
3714
|
+
for (; i instanceof we; )
|
|
3715
|
+
i = i._def.innerType;
|
|
3716
|
+
t[n] = i;
|
|
3689
3717
|
}
|
|
3690
3718
|
return new D({
|
|
3691
3719
|
...this._def,
|
|
@@ -3693,49 +3721,49 @@ class D extends C {
|
|
|
3693
3721
|
});
|
|
3694
3722
|
}
|
|
3695
3723
|
keyof() {
|
|
3696
|
-
return
|
|
3724
|
+
return _s(A.objectKeys(this.shape));
|
|
3697
3725
|
}
|
|
3698
3726
|
}
|
|
3699
3727
|
D.create = (r, e) => new D({
|
|
3700
3728
|
shape: () => r,
|
|
3701
3729
|
unknownKeys: "strip",
|
|
3702
|
-
catchall:
|
|
3730
|
+
catchall: be.create(),
|
|
3703
3731
|
typeName: w.ZodObject,
|
|
3704
3732
|
...b(e)
|
|
3705
3733
|
});
|
|
3706
3734
|
D.strictCreate = (r, e) => new D({
|
|
3707
3735
|
shape: () => r,
|
|
3708
3736
|
unknownKeys: "strict",
|
|
3709
|
-
catchall:
|
|
3737
|
+
catchall: be.create(),
|
|
3710
3738
|
typeName: w.ZodObject,
|
|
3711
3739
|
...b(e)
|
|
3712
3740
|
});
|
|
3713
3741
|
D.lazycreate = (r, e) => new D({
|
|
3714
3742
|
shape: r,
|
|
3715
3743
|
unknownKeys: "strip",
|
|
3716
|
-
catchall:
|
|
3744
|
+
catchall: be.create(),
|
|
3717
3745
|
typeName: w.ZodObject,
|
|
3718
3746
|
...b(e)
|
|
3719
3747
|
});
|
|
3720
|
-
class
|
|
3748
|
+
class $t extends C {
|
|
3721
3749
|
_parse(e) {
|
|
3722
3750
|
const { ctx: t } = this._processInputParams(e), n = this._def.options;
|
|
3723
|
-
function s(
|
|
3724
|
-
for (const o of
|
|
3751
|
+
function s(i) {
|
|
3752
|
+
for (const o of i)
|
|
3725
3753
|
if (o.result.status === "valid")
|
|
3726
3754
|
return o.result;
|
|
3727
|
-
for (const o of
|
|
3755
|
+
for (const o of i)
|
|
3728
3756
|
if (o.result.status === "dirty")
|
|
3729
3757
|
return t.common.issues.push(...o.ctx.common.issues), o.result;
|
|
3730
|
-
const
|
|
3758
|
+
const a = i.map((o) => new te(o.ctx.common.issues));
|
|
3731
3759
|
return m(t, {
|
|
3732
3760
|
code: c.invalid_union,
|
|
3733
|
-
unionErrors:
|
|
3761
|
+
unionErrors: a
|
|
3734
3762
|
}), y;
|
|
3735
3763
|
}
|
|
3736
3764
|
if (t.common.async)
|
|
3737
|
-
return Promise.all(n.map(async (
|
|
3738
|
-
const
|
|
3765
|
+
return Promise.all(n.map(async (i) => {
|
|
3766
|
+
const a = {
|
|
3739
3767
|
...t,
|
|
3740
3768
|
common: {
|
|
3741
3769
|
...t.common,
|
|
@@ -3744,17 +3772,17 @@ class Bt extends C {
|
|
|
3744
3772
|
parent: null
|
|
3745
3773
|
};
|
|
3746
3774
|
return {
|
|
3747
|
-
result: await
|
|
3775
|
+
result: await i._parseAsync({
|
|
3748
3776
|
data: t.data,
|
|
3749
3777
|
path: t.path,
|
|
3750
|
-
parent:
|
|
3778
|
+
parent: a
|
|
3751
3779
|
}),
|
|
3752
|
-
ctx:
|
|
3780
|
+
ctx: a
|
|
3753
3781
|
};
|
|
3754
3782
|
})).then(s);
|
|
3755
3783
|
{
|
|
3756
|
-
let
|
|
3757
|
-
const
|
|
3784
|
+
let i;
|
|
3785
|
+
const a = [];
|
|
3758
3786
|
for (const l of n) {
|
|
3759
3787
|
const u = {
|
|
3760
3788
|
...t,
|
|
@@ -3770,11 +3798,11 @@ class Bt extends C {
|
|
|
3770
3798
|
});
|
|
3771
3799
|
if (d.status === "valid")
|
|
3772
3800
|
return d;
|
|
3773
|
-
d.status === "dirty" && !
|
|
3801
|
+
d.status === "dirty" && !i && (i = { result: d, ctx: u }), u.common.issues.length && a.push(u.common.issues);
|
|
3774
3802
|
}
|
|
3775
|
-
if (
|
|
3776
|
-
return t.common.issues.push(...
|
|
3777
|
-
const o =
|
|
3803
|
+
if (i)
|
|
3804
|
+
return t.common.issues.push(...i.ctx.common.issues), i.result;
|
|
3805
|
+
const o = a.map((l) => new te(l));
|
|
3778
3806
|
return m(t, {
|
|
3779
3807
|
code: c.invalid_union,
|
|
3780
3808
|
unionErrors: o
|
|
@@ -3785,30 +3813,30 @@ class Bt extends C {
|
|
|
3785
3813
|
return this._def.options;
|
|
3786
3814
|
}
|
|
3787
3815
|
}
|
|
3788
|
-
|
|
3816
|
+
$t.create = (r, e) => new $t({
|
|
3789
3817
|
options: r,
|
|
3790
3818
|
typeName: w.ZodUnion,
|
|
3791
3819
|
...b(e)
|
|
3792
3820
|
});
|
|
3793
|
-
function
|
|
3794
|
-
const t =
|
|
3821
|
+
function kr(r, e) {
|
|
3822
|
+
const t = he(r), n = he(e);
|
|
3795
3823
|
if (r === e)
|
|
3796
3824
|
return { valid: !0, data: r };
|
|
3797
3825
|
if (t === g.object && n === g.object) {
|
|
3798
|
-
const s = A.objectKeys(e),
|
|
3799
|
-
for (const o of
|
|
3800
|
-
const l =
|
|
3826
|
+
const s = A.objectKeys(e), i = A.objectKeys(r).filter((o) => s.indexOf(o) !== -1), a = { ...r, ...e };
|
|
3827
|
+
for (const o of i) {
|
|
3828
|
+
const l = kr(r[o], e[o]);
|
|
3801
3829
|
if (!l.valid)
|
|
3802
3830
|
return { valid: !1 };
|
|
3803
|
-
|
|
3831
|
+
a[o] = l.data;
|
|
3804
3832
|
}
|
|
3805
|
-
return { valid: !0, data:
|
|
3833
|
+
return { valid: !0, data: a };
|
|
3806
3834
|
} else if (t === g.array && n === g.array) {
|
|
3807
3835
|
if (r.length !== e.length)
|
|
3808
3836
|
return { valid: !1 };
|
|
3809
3837
|
const s = [];
|
|
3810
|
-
for (let
|
|
3811
|
-
const
|
|
3838
|
+
for (let i = 0; i < r.length; i++) {
|
|
3839
|
+
const a = r[i], o = e[i], l = kr(a, o);
|
|
3812
3840
|
if (!l.valid)
|
|
3813
3841
|
return { valid: !1 };
|
|
3814
3842
|
s.push(l.data);
|
|
@@ -3816,13 +3844,13 @@ function _r(r, e) {
|
|
|
3816
3844
|
return { valid: !0, data: s };
|
|
3817
3845
|
} else return t === g.date && n === g.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
|
|
3818
3846
|
}
|
|
3819
|
-
class
|
|
3847
|
+
class qt extends C {
|
|
3820
3848
|
_parse(e) {
|
|
3821
|
-
const { status: t, ctx: n } = this._processInputParams(e), s = (
|
|
3822
|
-
if (
|
|
3849
|
+
const { status: t, ctx: n } = this._processInputParams(e), s = (i, a) => {
|
|
3850
|
+
if (gn(i) || gn(a))
|
|
3823
3851
|
return y;
|
|
3824
|
-
const o =
|
|
3825
|
-
return o.valid ? ((
|
|
3852
|
+
const o = kr(i.value, a.value);
|
|
3853
|
+
return o.valid ? ((_n(i) || _n(a)) && t.dirty(), { status: t.value, value: o.data }) : (m(n, {
|
|
3826
3854
|
code: c.invalid_intersection_types
|
|
3827
3855
|
}), y);
|
|
3828
3856
|
};
|
|
@@ -3837,7 +3865,7 @@ class Ut extends C {
|
|
|
3837
3865
|
path: n.path,
|
|
3838
3866
|
parent: n
|
|
3839
3867
|
})
|
|
3840
|
-
]).then(([
|
|
3868
|
+
]).then(([i, a]) => s(i, a)) : s(this._def.left._parseSync({
|
|
3841
3869
|
data: n.data,
|
|
3842
3870
|
path: n.path,
|
|
3843
3871
|
parent: n
|
|
@@ -3848,7 +3876,7 @@ class Ut extends C {
|
|
|
3848
3876
|
}));
|
|
3849
3877
|
}
|
|
3850
3878
|
}
|
|
3851
|
-
|
|
3879
|
+
qt.create = (r, e, t) => new qt({
|
|
3852
3880
|
left: r,
|
|
3853
3881
|
right: e,
|
|
3854
3882
|
typeName: w.ZodIntersection,
|
|
@@ -3878,11 +3906,11 @@ class fe extends C {
|
|
|
3878
3906
|
exact: !1,
|
|
3879
3907
|
type: "array"
|
|
3880
3908
|
}), t.dirty());
|
|
3881
|
-
const
|
|
3909
|
+
const i = [...n.data].map((a, o) => {
|
|
3882
3910
|
const l = this._def.items[o] || this._def.rest;
|
|
3883
|
-
return l ? l._parse(new
|
|
3884
|
-
}).filter((
|
|
3885
|
-
return n.common.async ? Promise.all(
|
|
3911
|
+
return l ? l._parse(new xe(n, a, n.path, o)) : null;
|
|
3912
|
+
}).filter((a) => !!a);
|
|
3913
|
+
return n.common.async ? Promise.all(i).then((a) => X.mergeArray(t, a)) : X.mergeArray(t, i);
|
|
3886
3914
|
}
|
|
3887
3915
|
get items() {
|
|
3888
3916
|
return this._def.items;
|
|
@@ -3904,7 +3932,7 @@ fe.create = (r, e) => {
|
|
|
3904
3932
|
...b(e)
|
|
3905
3933
|
});
|
|
3906
3934
|
};
|
|
3907
|
-
class
|
|
3935
|
+
class bn extends C {
|
|
3908
3936
|
get keySchema() {
|
|
3909
3937
|
return this._def.keyType;
|
|
3910
3938
|
}
|
|
@@ -3919,14 +3947,14 @@ class kn extends C {
|
|
|
3919
3947
|
expected: g.map,
|
|
3920
3948
|
received: n.parsedType
|
|
3921
3949
|
}), y;
|
|
3922
|
-
const s = this._def.keyType,
|
|
3923
|
-
key: s._parse(new
|
|
3924
|
-
value:
|
|
3950
|
+
const s = this._def.keyType, i = this._def.valueType, a = [...n.data.entries()].map(([o, l], u) => ({
|
|
3951
|
+
key: s._parse(new xe(n, o, n.path, [u, "key"])),
|
|
3952
|
+
value: i._parse(new xe(n, l, n.path, [u, "value"]))
|
|
3925
3953
|
}));
|
|
3926
3954
|
if (n.common.async) {
|
|
3927
3955
|
const o = /* @__PURE__ */ new Map();
|
|
3928
3956
|
return Promise.resolve().then(async () => {
|
|
3929
|
-
for (const l of
|
|
3957
|
+
for (const l of a) {
|
|
3930
3958
|
const u = await l.key, d = await l.value;
|
|
3931
3959
|
if (u.status === "aborted" || d.status === "aborted")
|
|
3932
3960
|
return y;
|
|
@@ -3936,7 +3964,7 @@ class kn extends C {
|
|
|
3936
3964
|
});
|
|
3937
3965
|
} else {
|
|
3938
3966
|
const o = /* @__PURE__ */ new Map();
|
|
3939
|
-
for (const l of
|
|
3967
|
+
for (const l of a) {
|
|
3940
3968
|
const u = l.key, d = l.value;
|
|
3941
3969
|
if (u.status === "aborted" || d.status === "aborted")
|
|
3942
3970
|
return y;
|
|
@@ -3946,13 +3974,13 @@ class kn extends C {
|
|
|
3946
3974
|
}
|
|
3947
3975
|
}
|
|
3948
3976
|
}
|
|
3949
|
-
|
|
3977
|
+
bn.create = (r, e, t) => new bn({
|
|
3950
3978
|
valueType: e,
|
|
3951
3979
|
keyType: r,
|
|
3952
3980
|
typeName: w.ZodMap,
|
|
3953
3981
|
...b(t)
|
|
3954
3982
|
});
|
|
3955
|
-
class
|
|
3983
|
+
class wt extends C {
|
|
3956
3984
|
_parse(e) {
|
|
3957
3985
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
3958
3986
|
if (n.parsedType !== g.set)
|
|
@@ -3977,8 +4005,8 @@ class _t extends C {
|
|
|
3977
4005
|
exact: !1,
|
|
3978
4006
|
message: s.maxSize.message
|
|
3979
4007
|
}), t.dirty());
|
|
3980
|
-
const
|
|
3981
|
-
function
|
|
4008
|
+
const i = this._def.valueType;
|
|
4009
|
+
function a(l) {
|
|
3982
4010
|
const u = /* @__PURE__ */ new Set();
|
|
3983
4011
|
for (const d of l) {
|
|
3984
4012
|
if (d.status === "aborted")
|
|
@@ -3987,17 +4015,17 @@ class _t extends C {
|
|
|
3987
4015
|
}
|
|
3988
4016
|
return { status: t.value, value: u };
|
|
3989
4017
|
}
|
|
3990
|
-
const o = [...n.data.values()].map((l, u) =>
|
|
3991
|
-
return n.common.async ? Promise.all(o).then((l) =>
|
|
4018
|
+
const o = [...n.data.values()].map((l, u) => i._parse(new xe(n, l, n.path, u)));
|
|
4019
|
+
return n.common.async ? Promise.all(o).then((l) => a(l)) : a(o);
|
|
3992
4020
|
}
|
|
3993
4021
|
min(e, t) {
|
|
3994
|
-
return new
|
|
4022
|
+
return new wt({
|
|
3995
4023
|
...this._def,
|
|
3996
4024
|
minSize: { value: e, message: _.toString(t) }
|
|
3997
4025
|
});
|
|
3998
4026
|
}
|
|
3999
4027
|
max(e, t) {
|
|
4000
|
-
return new
|
|
4028
|
+
return new wt({
|
|
4001
4029
|
...this._def,
|
|
4002
4030
|
maxSize: { value: e, message: _.toString(t) }
|
|
4003
4031
|
});
|
|
@@ -4009,7 +4037,7 @@ class _t extends C {
|
|
|
4009
4037
|
return this.min(1, e);
|
|
4010
4038
|
}
|
|
4011
4039
|
}
|
|
4012
|
-
|
|
4040
|
+
wt.create = (r, e) => new wt({
|
|
4013
4041
|
valueType: r,
|
|
4014
4042
|
minSize: null,
|
|
4015
4043
|
maxSize: null,
|
|
@@ -4029,10 +4057,10 @@ class pt extends C {
|
|
|
4029
4057
|
received: t.parsedType
|
|
4030
4058
|
}), y;
|
|
4031
4059
|
function n(o, l) {
|
|
4032
|
-
return
|
|
4060
|
+
return gr({
|
|
4033
4061
|
data: o,
|
|
4034
4062
|
path: t.path,
|
|
4035
|
-
errorMaps: [t.common.contextualErrorMap, t.schemaErrorMap,
|
|
4063
|
+
errorMaps: [t.common.contextualErrorMap, t.schemaErrorMap, vr(), _t].filter((u) => !!u),
|
|
4036
4064
|
issueData: {
|
|
4037
4065
|
code: c.invalid_arguments,
|
|
4038
4066
|
argumentsError: l
|
|
@@ -4040,37 +4068,37 @@ class pt extends C {
|
|
|
4040
4068
|
});
|
|
4041
4069
|
}
|
|
4042
4070
|
function s(o, l) {
|
|
4043
|
-
return
|
|
4071
|
+
return gr({
|
|
4044
4072
|
data: o,
|
|
4045
4073
|
path: t.path,
|
|
4046
|
-
errorMaps: [t.common.contextualErrorMap, t.schemaErrorMap,
|
|
4074
|
+
errorMaps: [t.common.contextualErrorMap, t.schemaErrorMap, vr(), _t].filter((u) => !!u),
|
|
4047
4075
|
issueData: {
|
|
4048
4076
|
code: c.invalid_return_type,
|
|
4049
4077
|
returnTypeError: l
|
|
4050
4078
|
}
|
|
4051
4079
|
});
|
|
4052
4080
|
}
|
|
4053
|
-
const
|
|
4054
|
-
if (this._def.returns instanceof
|
|
4081
|
+
const i = { errorMap: t.common.contextualErrorMap }, a = t.data;
|
|
4082
|
+
if (this._def.returns instanceof kt) {
|
|
4055
4083
|
const o = this;
|
|
4056
4084
|
return W(async function(...l) {
|
|
4057
|
-
const u = new te([]), d = await o._def.args.parseAsync(l,
|
|
4085
|
+
const u = new te([]), d = await o._def.args.parseAsync(l, i).catch((v) => {
|
|
4058
4086
|
throw u.addIssue(n(l, v)), u;
|
|
4059
|
-
}),
|
|
4060
|
-
return await o._def.returns._def.type.parseAsync(
|
|
4061
|
-
throw u.addIssue(s(
|
|
4087
|
+
}), h = await Reflect.apply(a, this, d);
|
|
4088
|
+
return await o._def.returns._def.type.parseAsync(h, i).catch((v) => {
|
|
4089
|
+
throw u.addIssue(s(h, v)), u;
|
|
4062
4090
|
});
|
|
4063
4091
|
});
|
|
4064
4092
|
} else {
|
|
4065
4093
|
const o = this;
|
|
4066
4094
|
return W(function(...l) {
|
|
4067
|
-
const u = o._def.args.safeParse(l,
|
|
4095
|
+
const u = o._def.args.safeParse(l, i);
|
|
4068
4096
|
if (!u.success)
|
|
4069
4097
|
throw new te([n(l, u.error)]);
|
|
4070
|
-
const d = Reflect.apply(
|
|
4071
|
-
if (!
|
|
4072
|
-
throw new te([s(d,
|
|
4073
|
-
return
|
|
4098
|
+
const d = Reflect.apply(a, this, u.data), h = o._def.returns.safeParse(d, i);
|
|
4099
|
+
if (!h.success)
|
|
4100
|
+
throw new te([s(d, h.error)]);
|
|
4101
|
+
return h.data;
|
|
4074
4102
|
});
|
|
4075
4103
|
}
|
|
4076
4104
|
}
|
|
@@ -4107,7 +4135,7 @@ class pt extends C {
|
|
|
4107
4135
|
});
|
|
4108
4136
|
}
|
|
4109
4137
|
}
|
|
4110
|
-
class
|
|
4138
|
+
class En extends C {
|
|
4111
4139
|
get schema() {
|
|
4112
4140
|
return this._def.getter();
|
|
4113
4141
|
}
|
|
@@ -4116,12 +4144,12 @@ class xn extends C {
|
|
|
4116
4144
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
4117
4145
|
}
|
|
4118
4146
|
}
|
|
4119
|
-
|
|
4147
|
+
En.create = (r, e) => new En({
|
|
4120
4148
|
getter: r,
|
|
4121
4149
|
typeName: w.ZodLazy,
|
|
4122
4150
|
...b(e)
|
|
4123
4151
|
});
|
|
4124
|
-
class
|
|
4152
|
+
class Sn extends C {
|
|
4125
4153
|
_parse(e) {
|
|
4126
4154
|
if (e.data !== this._def.value) {
|
|
4127
4155
|
const t = this._getOrReturnCtx(e);
|
|
@@ -4137,19 +4165,19 @@ class bn extends C {
|
|
|
4137
4165
|
return this._def.value;
|
|
4138
4166
|
}
|
|
4139
4167
|
}
|
|
4140
|
-
|
|
4168
|
+
Sn.create = (r, e) => new Sn({
|
|
4141
4169
|
value: r,
|
|
4142
4170
|
typeName: w.ZodLiteral,
|
|
4143
4171
|
...b(e)
|
|
4144
4172
|
});
|
|
4145
|
-
function
|
|
4146
|
-
return new
|
|
4173
|
+
function _s(r, e) {
|
|
4174
|
+
return new tt({
|
|
4147
4175
|
values: r,
|
|
4148
4176
|
typeName: w.ZodEnum,
|
|
4149
4177
|
...b(e)
|
|
4150
4178
|
});
|
|
4151
4179
|
}
|
|
4152
|
-
class
|
|
4180
|
+
class tt extends C {
|
|
4153
4181
|
_parse(e) {
|
|
4154
4182
|
if (typeof e.data != "string") {
|
|
4155
4183
|
const t = this._getOrReturnCtx(e), n = this._def.values;
|
|
@@ -4191,20 +4219,20 @@ class Qe extends C {
|
|
|
4191
4219
|
return e;
|
|
4192
4220
|
}
|
|
4193
4221
|
extract(e, t = this._def) {
|
|
4194
|
-
return
|
|
4222
|
+
return tt.create(e, {
|
|
4195
4223
|
...this._def,
|
|
4196
4224
|
...t
|
|
4197
4225
|
});
|
|
4198
4226
|
}
|
|
4199
4227
|
exclude(e, t = this._def) {
|
|
4200
|
-
return
|
|
4228
|
+
return tt.create(this.options.filter((n) => !e.includes(n)), {
|
|
4201
4229
|
...this._def,
|
|
4202
4230
|
...t
|
|
4203
4231
|
});
|
|
4204
4232
|
}
|
|
4205
4233
|
}
|
|
4206
|
-
|
|
4207
|
-
class
|
|
4234
|
+
tt.create = _s;
|
|
4235
|
+
class Cn extends C {
|
|
4208
4236
|
_parse(e) {
|
|
4209
4237
|
const t = A.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
4210
4238
|
if (n.parsedType !== g.string && n.parsedType !== g.number) {
|
|
@@ -4229,12 +4257,12 @@ class En extends C {
|
|
|
4229
4257
|
return this._def.values;
|
|
4230
4258
|
}
|
|
4231
4259
|
}
|
|
4232
|
-
|
|
4260
|
+
Cn.create = (r, e) => new Cn({
|
|
4233
4261
|
values: r,
|
|
4234
4262
|
typeName: w.ZodNativeEnum,
|
|
4235
4263
|
...b(e)
|
|
4236
4264
|
});
|
|
4237
|
-
class
|
|
4265
|
+
class kt extends C {
|
|
4238
4266
|
unwrap() {
|
|
4239
4267
|
return this._def.type;
|
|
4240
4268
|
}
|
|
@@ -4253,12 +4281,12 @@ class yt extends C {
|
|
|
4253
4281
|
})));
|
|
4254
4282
|
}
|
|
4255
4283
|
}
|
|
4256
|
-
|
|
4284
|
+
kt.create = (r, e) => new kt({
|
|
4257
4285
|
type: r,
|
|
4258
4286
|
typeName: w.ZodPromise,
|
|
4259
4287
|
...b(e)
|
|
4260
4288
|
});
|
|
4261
|
-
class
|
|
4289
|
+
class rt extends C {
|
|
4262
4290
|
innerType() {
|
|
4263
4291
|
return this._def.schema;
|
|
4264
4292
|
}
|
|
@@ -4266,18 +4294,18 @@ class et extends C {
|
|
|
4266
4294
|
return this._def.schema._def.typeName === w.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
4267
4295
|
}
|
|
4268
4296
|
_parse(e) {
|
|
4269
|
-
const { status: t, ctx: n } = this._processInputParams(e), s = this._def.effect || null,
|
|
4270
|
-
addIssue: (
|
|
4271
|
-
m(n,
|
|
4297
|
+
const { status: t, ctx: n } = this._processInputParams(e), s = this._def.effect || null, i = {
|
|
4298
|
+
addIssue: (a) => {
|
|
4299
|
+
m(n, a), a.fatal ? t.abort() : t.dirty();
|
|
4272
4300
|
},
|
|
4273
4301
|
get path() {
|
|
4274
4302
|
return n.path;
|
|
4275
4303
|
}
|
|
4276
4304
|
};
|
|
4277
|
-
if (
|
|
4278
|
-
const
|
|
4305
|
+
if (i.addIssue = i.addIssue.bind(i), s.type === "preprocess") {
|
|
4306
|
+
const a = s.transform(n.data, i);
|
|
4279
4307
|
if (n.common.async)
|
|
4280
|
-
return Promise.resolve(
|
|
4308
|
+
return Promise.resolve(a).then(async (o) => {
|
|
4281
4309
|
if (t.value === "aborted")
|
|
4282
4310
|
return y;
|
|
4283
4311
|
const l = await this._def.schema._parseAsync({
|
|
@@ -4291,7 +4319,7 @@ class et extends C {
|
|
|
4291
4319
|
if (t.value === "aborted")
|
|
4292
4320
|
return y;
|
|
4293
4321
|
const o = this._def.schema._parseSync({
|
|
4294
|
-
data:
|
|
4322
|
+
data: a,
|
|
4295
4323
|
path: n.path,
|
|
4296
4324
|
parent: n
|
|
4297
4325
|
});
|
|
@@ -4299,8 +4327,8 @@ class et extends C {
|
|
|
4299
4327
|
}
|
|
4300
4328
|
}
|
|
4301
4329
|
if (s.type === "refinement") {
|
|
4302
|
-
const
|
|
4303
|
-
const l = s.refinement(o,
|
|
4330
|
+
const a = (o) => {
|
|
4331
|
+
const l = s.refinement(o, i);
|
|
4304
4332
|
if (n.common.async)
|
|
4305
4333
|
return Promise.resolve(l);
|
|
4306
4334
|
if (l instanceof Promise)
|
|
@@ -4313,44 +4341,44 @@ class et extends C {
|
|
|
4313
4341
|
path: n.path,
|
|
4314
4342
|
parent: n
|
|
4315
4343
|
});
|
|
4316
|
-
return o.status === "aborted" ? y : (o.status === "dirty" && t.dirty(),
|
|
4344
|
+
return o.status === "aborted" ? y : (o.status === "dirty" && t.dirty(), a(o.value), { status: t.value, value: o.value });
|
|
4317
4345
|
} else
|
|
4318
|
-
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => o.status === "aborted" ? y : (o.status === "dirty" && t.dirty(),
|
|
4346
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => o.status === "aborted" ? y : (o.status === "dirty" && t.dirty(), a(o.value).then(() => ({ status: t.value, value: o.value }))));
|
|
4319
4347
|
}
|
|
4320
4348
|
if (s.type === "transform")
|
|
4321
4349
|
if (n.common.async === !1) {
|
|
4322
|
-
const
|
|
4350
|
+
const a = this._def.schema._parseSync({
|
|
4323
4351
|
data: n.data,
|
|
4324
4352
|
path: n.path,
|
|
4325
4353
|
parent: n
|
|
4326
4354
|
});
|
|
4327
|
-
if (!
|
|
4355
|
+
if (!Qe(a))
|
|
4328
4356
|
return y;
|
|
4329
|
-
const o = s.transform(
|
|
4357
|
+
const o = s.transform(a.value, i);
|
|
4330
4358
|
if (o instanceof Promise)
|
|
4331
4359
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
4332
4360
|
return { status: t.value, value: o };
|
|
4333
4361
|
} else
|
|
4334
|
-
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((
|
|
4362
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((a) => Qe(a) ? Promise.resolve(s.transform(a.value, i)).then((o) => ({
|
|
4335
4363
|
status: t.value,
|
|
4336
4364
|
value: o
|
|
4337
4365
|
})) : y);
|
|
4338
4366
|
A.assertNever(s);
|
|
4339
4367
|
}
|
|
4340
4368
|
}
|
|
4341
|
-
|
|
4369
|
+
rt.create = (r, e, t) => new rt({
|
|
4342
4370
|
schema: r,
|
|
4343
4371
|
typeName: w.ZodEffects,
|
|
4344
4372
|
effect: e,
|
|
4345
4373
|
...b(t)
|
|
4346
4374
|
});
|
|
4347
|
-
|
|
4375
|
+
rt.createWithPreprocess = (r, e, t) => new rt({
|
|
4348
4376
|
schema: e,
|
|
4349
4377
|
effect: { type: "preprocess", transform: r },
|
|
4350
4378
|
typeName: w.ZodEffects,
|
|
4351
4379
|
...b(t)
|
|
4352
4380
|
});
|
|
4353
|
-
class
|
|
4381
|
+
class we extends C {
|
|
4354
4382
|
_parse(e) {
|
|
4355
4383
|
return this._getType(e) === g.undefined ? W(void 0) : this._def.innerType._parse(e);
|
|
4356
4384
|
}
|
|
@@ -4358,12 +4386,12 @@ class ke extends C {
|
|
|
4358
4386
|
return this._def.innerType;
|
|
4359
4387
|
}
|
|
4360
4388
|
}
|
|
4361
|
-
|
|
4389
|
+
we.create = (r, e) => new we({
|
|
4362
4390
|
innerType: r,
|
|
4363
4391
|
typeName: w.ZodOptional,
|
|
4364
4392
|
...b(e)
|
|
4365
4393
|
});
|
|
4366
|
-
class
|
|
4394
|
+
class nt extends C {
|
|
4367
4395
|
_parse(e) {
|
|
4368
4396
|
return this._getType(e) === g.null ? W(null) : this._def.innerType._parse(e);
|
|
4369
4397
|
}
|
|
@@ -4371,12 +4399,12 @@ class tt extends C {
|
|
|
4371
4399
|
return this._def.innerType;
|
|
4372
4400
|
}
|
|
4373
4401
|
}
|
|
4374
|
-
|
|
4402
|
+
nt.create = (r, e) => new nt({
|
|
4375
4403
|
innerType: r,
|
|
4376
4404
|
typeName: w.ZodNullable,
|
|
4377
4405
|
...b(e)
|
|
4378
4406
|
});
|
|
4379
|
-
class
|
|
4407
|
+
class xr extends C {
|
|
4380
4408
|
_parse(e) {
|
|
4381
4409
|
const { ctx: t } = this._processInputParams(e);
|
|
4382
4410
|
let n = t.data;
|
|
@@ -4390,13 +4418,13 @@ class yr extends C {
|
|
|
4390
4418
|
return this._def.innerType;
|
|
4391
4419
|
}
|
|
4392
4420
|
}
|
|
4393
|
-
|
|
4421
|
+
xr.create = (r, e) => new xr({
|
|
4394
4422
|
innerType: r,
|
|
4395
4423
|
typeName: w.ZodDefault,
|
|
4396
4424
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
4397
4425
|
...b(e)
|
|
4398
4426
|
});
|
|
4399
|
-
class
|
|
4427
|
+
class br extends C {
|
|
4400
4428
|
_parse(e) {
|
|
4401
4429
|
const { ctx: t } = this._processInputParams(e), n = {
|
|
4402
4430
|
...t,
|
|
@@ -4411,9 +4439,9 @@ class wr extends C {
|
|
|
4411
4439
|
...n
|
|
4412
4440
|
}
|
|
4413
4441
|
});
|
|
4414
|
-
return
|
|
4442
|
+
return Bt(s) ? s.then((i) => ({
|
|
4415
4443
|
status: "valid",
|
|
4416
|
-
value:
|
|
4444
|
+
value: i.status === "valid" ? i.value : this._def.catchValue({
|
|
4417
4445
|
get error() {
|
|
4418
4446
|
return new te(n.common.issues);
|
|
4419
4447
|
},
|
|
@@ -4433,13 +4461,13 @@ class wr extends C {
|
|
|
4433
4461
|
return this._def.innerType;
|
|
4434
4462
|
}
|
|
4435
4463
|
}
|
|
4436
|
-
|
|
4464
|
+
br.create = (r, e) => new br({
|
|
4437
4465
|
innerType: r,
|
|
4438
4466
|
typeName: w.ZodCatch,
|
|
4439
4467
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
4440
4468
|
...b(e)
|
|
4441
4469
|
});
|
|
4442
|
-
class
|
|
4470
|
+
class Tn extends C {
|
|
4443
4471
|
_parse(e) {
|
|
4444
4472
|
if (this._getType(e) !== g.nan) {
|
|
4445
4473
|
const n = this._getOrReturnCtx(e);
|
|
@@ -4452,11 +4480,11 @@ class Sn extends C {
|
|
|
4452
4480
|
return { status: "valid", value: e.data };
|
|
4453
4481
|
}
|
|
4454
4482
|
}
|
|
4455
|
-
|
|
4483
|
+
Tn.create = (r) => new Tn({
|
|
4456
4484
|
typeName: w.ZodNaN,
|
|
4457
4485
|
...b(r)
|
|
4458
4486
|
});
|
|
4459
|
-
class
|
|
4487
|
+
class ya extends C {
|
|
4460
4488
|
_parse(e) {
|
|
4461
4489
|
const { ctx: t } = this._processInputParams(e), n = t.data;
|
|
4462
4490
|
return this._def.type._parse({
|
|
@@ -4469,18 +4497,18 @@ class mi extends C {
|
|
|
4469
4497
|
return this._def.type;
|
|
4470
4498
|
}
|
|
4471
4499
|
}
|
|
4472
|
-
class
|
|
4500
|
+
class $r extends C {
|
|
4473
4501
|
_parse(e) {
|
|
4474
4502
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
4475
4503
|
if (n.common.async)
|
|
4476
4504
|
return (async () => {
|
|
4477
|
-
const
|
|
4505
|
+
const i = await this._def.in._parseAsync({
|
|
4478
4506
|
data: n.data,
|
|
4479
4507
|
path: n.path,
|
|
4480
4508
|
parent: n
|
|
4481
4509
|
});
|
|
4482
|
-
return
|
|
4483
|
-
data:
|
|
4510
|
+
return i.status === "aborted" ? y : i.status === "dirty" ? (t.dirty(), dt(i.value)) : this._def.out._parseAsync({
|
|
4511
|
+
data: i.value,
|
|
4484
4512
|
path: n.path,
|
|
4485
4513
|
parent: n
|
|
4486
4514
|
});
|
|
@@ -4502,23 +4530,23 @@ class Vr extends C {
|
|
|
4502
4530
|
}
|
|
4503
4531
|
}
|
|
4504
4532
|
static create(e, t) {
|
|
4505
|
-
return new
|
|
4533
|
+
return new $r({
|
|
4506
4534
|
in: e,
|
|
4507
4535
|
out: t,
|
|
4508
4536
|
typeName: w.ZodPipeline
|
|
4509
4537
|
});
|
|
4510
4538
|
}
|
|
4511
4539
|
}
|
|
4512
|
-
class
|
|
4540
|
+
class Er extends C {
|
|
4513
4541
|
_parse(e) {
|
|
4514
|
-
const t = this._def.innerType._parse(e), n = (s) => (
|
|
4515
|
-
return
|
|
4542
|
+
const t = this._def.innerType._parse(e), n = (s) => (Qe(s) && (s.value = Object.freeze(s.value)), s);
|
|
4543
|
+
return Bt(t) ? t.then((s) => n(s)) : n(t);
|
|
4516
4544
|
}
|
|
4517
4545
|
unwrap() {
|
|
4518
4546
|
return this._def.innerType;
|
|
4519
4547
|
}
|
|
4520
4548
|
}
|
|
4521
|
-
|
|
4549
|
+
Er.create = (r, e) => new Er({
|
|
4522
4550
|
innerType: r,
|
|
4523
4551
|
typeName: w.ZodReadonly,
|
|
4524
4552
|
...b(e)
|
|
@@ -4527,18 +4555,18 @@ var w;
|
|
|
4527
4555
|
(function(r) {
|
|
4528
4556
|
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";
|
|
4529
4557
|
})(w || (w = {}));
|
|
4530
|
-
const Le =
|
|
4558
|
+
const Le = ye.create, E = et.create, Sr = _r.create, qr = yr.create;
|
|
4531
4559
|
$e.create;
|
|
4532
|
-
|
|
4533
|
-
const
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
const
|
|
4537
|
-
|
|
4538
|
-
|
|
4560
|
+
be.create;
|
|
4561
|
+
const Dt = wr.create, Wr = le.create, R = D.create;
|
|
4562
|
+
$t.create;
|
|
4563
|
+
qt.create;
|
|
4564
|
+
const An = fe.create, oe = pt.create, wa = tt.create, ka = kt.create;
|
|
4565
|
+
we.create;
|
|
4566
|
+
nt.create;
|
|
4539
4567
|
R({
|
|
4540
4568
|
pin: R({
|
|
4541
|
-
fade:
|
|
4569
|
+
fade: Sr().optional(),
|
|
4542
4570
|
maxCount: E().optional(),
|
|
4543
4571
|
maxZoom: E().optional()
|
|
4544
4572
|
}).optional(),
|
|
@@ -4553,32 +4581,32 @@ R({
|
|
|
4553
4581
|
key: Le()
|
|
4554
4582
|
}).optional(),
|
|
4555
4583
|
log: R({
|
|
4556
|
-
enabled:
|
|
4584
|
+
enabled: Sr()
|
|
4557
4585
|
}).optional()
|
|
4558
4586
|
}).optional()
|
|
4559
4587
|
});
|
|
4560
|
-
const
|
|
4561
|
-
sw: R({ lat:
|
|
4562
|
-
ne: R({ lat:
|
|
4563
|
-
}),
|
|
4588
|
+
const Cr = E().min(-90).max(90), Tr = E().min(-180).max(180), xa = R({
|
|
4589
|
+
sw: R({ lat: Cr, lng: Tr }),
|
|
4590
|
+
ne: R({ lat: Cr, lng: Tr })
|
|
4591
|
+
}), Ar = qr().refine((r) => r instanceof HTMLElement, "Must be an HTMLElement"), ys = R({
|
|
4564
4592
|
mapSize: E(),
|
|
4565
4593
|
zoomMin: E(),
|
|
4566
4594
|
zoomMax: E(),
|
|
4567
4595
|
zoomScale: E()
|
|
4568
|
-
}),
|
|
4569
|
-
instance:
|
|
4570
|
-
inserted:
|
|
4571
|
-
insert:
|
|
4572
|
-
remove:
|
|
4573
|
-
update:
|
|
4574
|
-
}),
|
|
4575
|
-
parameters:
|
|
4576
|
-
getContainer:
|
|
4577
|
-
getZoom:
|
|
4578
|
-
getBounds:
|
|
4579
|
-
panBy:
|
|
4580
|
-
createMarker:
|
|
4581
|
-
}),
|
|
4596
|
+
}), ba = R({
|
|
4597
|
+
instance: qr(),
|
|
4598
|
+
inserted: oe().returns(Sr()),
|
|
4599
|
+
insert: oe().returns(Dt()),
|
|
4600
|
+
remove: oe().returns(Dt()),
|
|
4601
|
+
update: oe().args(E()).returns(Dt())
|
|
4602
|
+
}), Ea = R({
|
|
4603
|
+
parameters: ys,
|
|
4604
|
+
getContainer: oe().args().returns(Ar),
|
|
4605
|
+
getZoom: oe().args().returns(E()),
|
|
4606
|
+
getBounds: oe().args().returns(xa),
|
|
4607
|
+
panBy: oe().args(E(), E()).returns(Dt()),
|
|
4608
|
+
createMarker: oe().args(Ar, Cr, Tr, E()).returns(ba)
|
|
4609
|
+
}), ar = oe().args(Le()).returns(ka(Ar)), Sa = R({
|
|
4582
4610
|
id: Le().min(1),
|
|
4583
4611
|
rank: E(),
|
|
4584
4612
|
lat: E().min(-90).max(90),
|
|
@@ -4590,7 +4618,7 @@ const br = E().min(-90).max(90), Er = E().min(-180).max(180), _i = R({
|
|
|
4590
4618
|
margin: E(),
|
|
4591
4619
|
radius: E()
|
|
4592
4620
|
}).refine((r) => Math.min(r.width, r.height) / r.margin >= 5, "Tooltip width and height must be at least 5 times the margin"),
|
|
4593
|
-
body:
|
|
4621
|
+
body: ar
|
|
4594
4622
|
}),
|
|
4595
4623
|
pin: R({
|
|
4596
4624
|
style: R({
|
|
@@ -4598,7 +4626,7 @@ const br = E().min(-90).max(90), Er = E().min(-180).max(180), _i = R({
|
|
|
4598
4626
|
height: E(),
|
|
4599
4627
|
radius: E()
|
|
4600
4628
|
}),
|
|
4601
|
-
body:
|
|
4629
|
+
body: ar
|
|
4602
4630
|
}).optional(),
|
|
4603
4631
|
popup: R({
|
|
4604
4632
|
style: R({
|
|
@@ -4607,11 +4635,11 @@ const br = E().min(-90).max(90), Er = E().min(-180).max(180), _i = R({
|
|
|
4607
4635
|
radius: E(),
|
|
4608
4636
|
margin: E()
|
|
4609
4637
|
}),
|
|
4610
|
-
body:
|
|
4638
|
+
body: ar
|
|
4611
4639
|
}).optional()
|
|
4612
|
-
}),
|
|
4613
|
-
|
|
4614
|
-
const
|
|
4640
|
+
}), Ca = Wr(Sa);
|
|
4641
|
+
An([E(), Wr(An([E(), E()]))]);
|
|
4642
|
+
const Ta = R({
|
|
4615
4643
|
id: Le(),
|
|
4616
4644
|
rank: E(),
|
|
4617
4645
|
lat: E(),
|
|
@@ -4622,36 +4650,36 @@ const bi = R({
|
|
|
4622
4650
|
});
|
|
4623
4651
|
R({
|
|
4624
4652
|
key: Le(),
|
|
4625
|
-
parameters:
|
|
4626
|
-
input:
|
|
4653
|
+
parameters: ys,
|
|
4654
|
+
input: Wr(Ta)
|
|
4627
4655
|
});
|
|
4628
|
-
const
|
|
4656
|
+
const Aa = wa(["info", "warn", "error"]);
|
|
4629
4657
|
R({
|
|
4630
4658
|
title: Le(),
|
|
4631
|
-
level:
|
|
4632
|
-
content:
|
|
4659
|
+
level: Aa,
|
|
4660
|
+
content: qr()
|
|
4633
4661
|
});
|
|
4634
|
-
const
|
|
4635
|
-
class
|
|
4662
|
+
const ws = "https://arenarium.dev/api/public/v1", Ma = `${ws}/log`, Oa = `${ws}/tooltip/states`, Mn = "1.0.187";
|
|
4663
|
+
class Za {
|
|
4636
4664
|
constructor(e, t) {
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4665
|
+
f(this, "provider");
|
|
4666
|
+
f(this, "apiStatesUrl");
|
|
4667
|
+
f(this, "apiStatesKey");
|
|
4668
|
+
f(this, "apiLogEnabled");
|
|
4669
|
+
f(this, "markerDataArray", new Array());
|
|
4670
|
+
f(this, "markerDataMap", /* @__PURE__ */ new Map());
|
|
4671
|
+
f(this, "markerDataUpdating", !1);
|
|
4672
|
+
f(this, "markerPinProcessor");
|
|
4673
|
+
f(this, "markerTooltipProcessor");
|
|
4674
|
+
f(this, "markerPopupProcessor");
|
|
4675
|
+
Ea.parse(e), this.provider = e, this.markerPinProcessor = new Or(e), this.markerTooltipProcessor = new Na(e), this.markerPopupProcessor = new Ra(e), this.configuration = t, this.log("info", "Loaded");
|
|
4648
4676
|
}
|
|
4649
4677
|
set configuration(e) {
|
|
4650
|
-
var t, n, s,
|
|
4651
|
-
this.apiStatesUrl = (n = (t = e == null ? void 0 : e.api) == null ? void 0 : t.states) == null ? void 0 : n.url, this.apiStatesKey = (
|
|
4678
|
+
var t, n, s, i, a, o, l, u;
|
|
4679
|
+
this.apiStatesUrl = (n = (t = e == null ? void 0 : e.api) == null ? void 0 : t.states) == null ? void 0 : n.url, this.apiStatesKey = (i = (s = e == null ? void 0 : e.api) == null ? void 0 : s.states) == null ? void 0 : i.key, this.apiLogEnabled = (o = (a = e == null ? void 0 : e.api) == null ? void 0 : a.log) == null ? void 0 : o.enabled, this.markerPinProcessor.setConfiguration(e), pe.setLimit(((u = (l = e == null ? void 0 : e.animation) == null ? void 0 : l.queue) == null ? void 0 : u.limit) ?? 8 * navigator.hardwareConcurrency);
|
|
4652
4680
|
}
|
|
4653
4681
|
async updateMarkers(e) {
|
|
4654
|
-
|
|
4682
|
+
Ca.parse(e);
|
|
4655
4683
|
try {
|
|
4656
4684
|
let t;
|
|
4657
4685
|
if (e.length > 1) {
|
|
@@ -4669,18 +4697,18 @@ class Ii {
|
|
|
4669
4697
|
key: this.apiStatesKey,
|
|
4670
4698
|
parameters: this.provider.parameters,
|
|
4671
4699
|
input: n
|
|
4672
|
-
},
|
|
4700
|
+
}, i = await fetch(this.apiStatesUrl ?? Oa, {
|
|
4673
4701
|
method: "POST",
|
|
4674
4702
|
headers: { "Content-Type": "application/json" },
|
|
4675
4703
|
body: JSON.stringify(s)
|
|
4676
4704
|
});
|
|
4677
|
-
if (!
|
|
4678
|
-
throw new Error("Failed to get marker states: " +
|
|
4679
|
-
t = await
|
|
4705
|
+
if (!i.ok || !i.body)
|
|
4706
|
+
throw new Error("Failed to get marker states: " + i.statusText);
|
|
4707
|
+
t = await i.json();
|
|
4680
4708
|
} else
|
|
4681
|
-
t =
|
|
4709
|
+
t = Os(this.provider.parameters, n);
|
|
4682
4710
|
} else
|
|
4683
|
-
t = [[0, [[0, ct.DEGREES.indexOf(ct.
|
|
4711
|
+
t = [[0, [[0, ct.DEGREES.indexOf(ct.DEGREES_DEFAULT)]]]];
|
|
4684
4712
|
this.updateMarkerData(e, t), this.processMarkerDataCallback();
|
|
4685
4713
|
} catch (t) {
|
|
4686
4714
|
throw console.error(t), this.removeMarkerData(), t instanceof Error && this.log("error", "Failed to update markers", t), t;
|
|
@@ -4723,19 +4751,19 @@ class Ii {
|
|
|
4723
4751
|
updateMarkerData(e, t) {
|
|
4724
4752
|
try {
|
|
4725
4753
|
this.markerDataUpdating = !0;
|
|
4726
|
-
const n = new Map(e.map((
|
|
4727
|
-
for (const
|
|
4728
|
-
n.has(
|
|
4729
|
-
for (let
|
|
4730
|
-
const
|
|
4754
|
+
const n = new Map(e.map((i, a) => [i.id, new On(this.provider, i, t[a])])), s = Array.from(this.markerDataArray);
|
|
4755
|
+
for (const i of s)
|
|
4756
|
+
n.has(i.marker.id) == !1 && (i.remove(), this.markerDataMap.delete(i.marker.id), this.markerDataArray.splice(this.markerDataArray.indexOf(i), 1));
|
|
4757
|
+
for (let i = 0; i < e.length; i++) {
|
|
4758
|
+
const a = e[i], o = t[i], l = this.markerDataMap.get(a.id);
|
|
4731
4759
|
if (l)
|
|
4732
4760
|
l.update(o);
|
|
4733
4761
|
else {
|
|
4734
|
-
const u = new
|
|
4735
|
-
u.create(), this.markerDataMap.set(
|
|
4762
|
+
const u = new On(this.provider, a, o);
|
|
4763
|
+
u.create(), this.markerDataMap.set(a.id, u), this.markerDataArray.push(u);
|
|
4736
4764
|
}
|
|
4737
4765
|
}
|
|
4738
|
-
this.markerDataArray.sort((
|
|
4766
|
+
this.markerDataArray.sort((i, a) => i.zoom - a.zoom), this.markerPinProcessor.updateElements(this.markerDataArray.map((i) => i.pin)), this.markerTooltipProcessor.updateElements(this.markerDataArray.map((i) => i.tooltip));
|
|
4739
4767
|
} catch (n) {
|
|
4740
4768
|
throw console.error(n), this.markerDataArray.forEach((s) => s.remove()), this.markerDataArray.length = 0, this.markerDataMap.clear(), n instanceof Error && this.log("error", "Failed to update marker data", n), n;
|
|
4741
4769
|
} finally {
|
|
@@ -4768,14 +4796,14 @@ class Ii {
|
|
|
4768
4796
|
if (!(this.apiLogEnabled == null && (window != null && window.location.host.startsWith("localhost"))) && this.apiLogEnabled != !1)
|
|
4769
4797
|
try {
|
|
4770
4798
|
const s = {
|
|
4771
|
-
title: `[CLIENT:${
|
|
4799
|
+
title: `[CLIENT:${Mn}] ${t}`,
|
|
4772
4800
|
level: e,
|
|
4773
4801
|
content: {
|
|
4774
|
-
version:
|
|
4802
|
+
version: Mn,
|
|
4775
4803
|
...n
|
|
4776
4804
|
}
|
|
4777
4805
|
};
|
|
4778
|
-
await fetch(
|
|
4806
|
+
await fetch(Ma, {
|
|
4779
4807
|
method: "POST",
|
|
4780
4808
|
headers: { "Content-Type": "application/json" },
|
|
4781
4809
|
body: JSON.stringify(s)
|
|
@@ -4785,13 +4813,13 @@ class Ii {
|
|
|
4785
4813
|
}
|
|
4786
4814
|
}
|
|
4787
4815
|
}
|
|
4788
|
-
class
|
|
4816
|
+
class On {
|
|
4789
4817
|
constructor(e, t, n) {
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
this.marker = t, this.zoom = n[0], this.pin = new
|
|
4818
|
+
f(this, "marker");
|
|
4819
|
+
f(this, "zoom");
|
|
4820
|
+
f(this, "pin");
|
|
4821
|
+
f(this, "tooltip");
|
|
4822
|
+
this.marker = t, this.zoom = n[0], this.pin = new Mr(e, t, n), this.tooltip = new Nr(e, t, n);
|
|
4795
4823
|
}
|
|
4796
4824
|
create() {
|
|
4797
4825
|
this.pin.create(), this.tooltip.create();
|
|
@@ -4803,16 +4831,16 @@ class An {
|
|
|
4803
4831
|
this.pin.remove(), this.tooltip.remove();
|
|
4804
4832
|
}
|
|
4805
4833
|
}
|
|
4806
|
-
class
|
|
4834
|
+
class Yr {
|
|
4807
4835
|
constructor(e, t) {
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4836
|
+
f(this, "provider");
|
|
4837
|
+
f(this, "id");
|
|
4838
|
+
f(this, "lat");
|
|
4839
|
+
f(this, "lng");
|
|
4840
|
+
f(this, "shown");
|
|
4841
|
+
f(this, "element");
|
|
4842
|
+
f(this, "component");
|
|
4843
|
+
f(this, "marker");
|
|
4816
4844
|
this.provider = e, this.id = t.id, this.lat = t.lat, this.lng = t.lng, this.shown = !0;
|
|
4817
4845
|
}
|
|
4818
4846
|
create() {
|
|
@@ -4843,25 +4871,25 @@ class $r {
|
|
|
4843
4871
|
(e = this.marker) == null || e.remove(), (t = this.element) == null || t.remove();
|
|
4844
4872
|
}
|
|
4845
4873
|
}
|
|
4846
|
-
const Ve = class Ve extends
|
|
4874
|
+
const Ve = class Ve extends Yr {
|
|
4847
4875
|
constructor(t, n, s) {
|
|
4848
|
-
var
|
|
4876
|
+
var i, a, o, l;
|
|
4849
4877
|
super(t, n);
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
this.width = ((
|
|
4878
|
+
f(this, "width");
|
|
4879
|
+
f(this, "height");
|
|
4880
|
+
f(this, "radius");
|
|
4881
|
+
f(this, "zoom");
|
|
4882
|
+
f(this, "bodyLoading", !1);
|
|
4883
|
+
f(this, "bodyLoaded", !1);
|
|
4884
|
+
f(this, "bodyCallback");
|
|
4885
|
+
this.width = ((i = n.pin) == null ? void 0 : i.style.width) ?? Ve.DEFAULT_SIZE, this.height = ((a = n.pin) == null ? void 0 : a.style.height) ?? Ve.DEFAULT_SIZE, this.radius = ((o = n.pin) == null ? void 0 : o.style.radius) ?? Ve.DEFAULT_SIZE, this.zoom = s[0], this.bodyCallback = (l = n.pin) == null ? void 0 : l.body;
|
|
4858
4886
|
}
|
|
4859
4887
|
createElement() {
|
|
4860
|
-
this.element = document.createElement("div"), this.element.classList.add("pin"), this.component =
|
|
4888
|
+
this.element = document.createElement("div"), this.element.classList.add("pin"), this.component = Ur(Hi, {
|
|
4861
4889
|
target: this.element,
|
|
4862
4890
|
props: {
|
|
4863
4891
|
id: this.id + "_pin",
|
|
4864
|
-
layer:
|
|
4892
|
+
layer: qi,
|
|
4865
4893
|
priority: this.zoom * this.provider.parameters.zoomScale,
|
|
4866
4894
|
width: this.width,
|
|
4867
4895
|
height: this.height,
|
|
@@ -4907,19 +4935,19 @@ const Ve = class Ve extends $r {
|
|
|
4907
4935
|
return this.bodyCallback == null || this.bodyLoaded;
|
|
4908
4936
|
}
|
|
4909
4937
|
};
|
|
4910
|
-
|
|
4911
|
-
let
|
|
4938
|
+
f(Ve, "DEFAULT_SIZE", 16);
|
|
4939
|
+
let Mr = Ve;
|
|
4912
4940
|
const Be = class Be {
|
|
4913
4941
|
constructor(e) {
|
|
4914
|
-
|
|
4942
|
+
f(this, "provider");
|
|
4915
4943
|
// Data
|
|
4916
|
-
|
|
4944
|
+
f(this, "pinElements", new Array());
|
|
4917
4945
|
// Configuration
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4946
|
+
f(this, "pinMaxWidth", 0);
|
|
4947
|
+
f(this, "pinMaxHeight", 0);
|
|
4948
|
+
f(this, "pinFade", !1);
|
|
4949
|
+
f(this, "pinMaxCount", 0);
|
|
4950
|
+
f(this, "pinMaxZoomDelta", 0);
|
|
4923
4951
|
this.provider = e;
|
|
4924
4952
|
}
|
|
4925
4953
|
setConfiguration(e) {
|
|
@@ -4933,35 +4961,35 @@ const Be = class Be {
|
|
|
4933
4961
|
this.pinElements.forEach((e) => e.remove()), this.pinElements.length = 0;
|
|
4934
4962
|
}
|
|
4935
4963
|
process(e, t) {
|
|
4936
|
-
const n = this.provider.parameters.mapSize, s = new
|
|
4937
|
-
let
|
|
4938
|
-
for (const
|
|
4939
|
-
s.contains(
|
|
4964
|
+
const n = this.provider.parameters.mapSize, s = new ms(e, t, n, this.pinMaxWidth * 2, this.pinMaxHeight * 2);
|
|
4965
|
+
let i = 0;
|
|
4966
|
+
for (const a of this.pinElements)
|
|
4967
|
+
s.contains(a.lat, a.lng) ? a.shown && t <= a.zoom && a.zoom <= t + this.pinMaxZoomDelta ? (i < this.pinMaxCount && (this.pinFade == !0 ? a.updateState(t) : a.setCollapsed(!1), a.updateMap(!0), a.isBodyLoaded() == !1 && a.updateBody()), i++) : (a.setCollapsed(!0), a.isCollapsed() && a.updateMap(!1)) : a.updateMap(!1);
|
|
4940
4968
|
}
|
|
4941
4969
|
};
|
|
4942
|
-
|
|
4943
|
-
let
|
|
4944
|
-
const
|
|
4970
|
+
f(Be, "MAP_PINS_MAX_ZOOM", 2), f(Be, "MAP_PINS_MAX_COUNT", 128);
|
|
4971
|
+
let Or = Be;
|
|
4972
|
+
const Yt = class Yt extends Yr {
|
|
4945
4973
|
constructor(t, n, s) {
|
|
4946
4974
|
super(t, n);
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
this.width = n.tooltip.style.width, this.height = n.tooltip.style.height, this.margin = n.tooltip.style.margin, this.radius = n.tooltip.style.radius, this.zoom = s[0], this.angle = ct.
|
|
4975
|
+
f(this, "width");
|
|
4976
|
+
f(this, "height");
|
|
4977
|
+
f(this, "margin");
|
|
4978
|
+
f(this, "radius");
|
|
4979
|
+
f(this, "zoom");
|
|
4980
|
+
f(this, "angle");
|
|
4981
|
+
f(this, "states");
|
|
4982
|
+
f(this, "bodyLoading", !1);
|
|
4983
|
+
f(this, "bodyLoaded", !1);
|
|
4984
|
+
f(this, "bodyCallback");
|
|
4985
|
+
this.width = n.tooltip.style.width, this.height = n.tooltip.style.height, this.margin = n.tooltip.style.margin, this.radius = n.tooltip.style.radius, this.zoom = s[0], this.angle = ct.DEGREES_DEFAULT, this.states = s[1].map((i) => [i[0], ct.DEGREES[i[1]]]), this.bodyCallback = n.tooltip.body;
|
|
4958
4986
|
}
|
|
4959
4987
|
createElement() {
|
|
4960
|
-
this.element = document.createElement("div"), this.element.classList.add("tooltip"), this.component =
|
|
4988
|
+
this.element = document.createElement("div"), this.element.classList.add("tooltip"), this.component = Ur(ps, {
|
|
4961
4989
|
target: this.element,
|
|
4962
4990
|
props: {
|
|
4963
4991
|
id: this.id + "_tooltip",
|
|
4964
|
-
layer:
|
|
4992
|
+
layer: $i,
|
|
4965
4993
|
priority: this.zoom * this.provider.parameters.zoomScale,
|
|
4966
4994
|
width: this.width,
|
|
4967
4995
|
height: this.height,
|
|
@@ -4997,7 +5025,7 @@ const $t = class $t extends $r {
|
|
|
4997
5025
|
return n[1];
|
|
4998
5026
|
}
|
|
4999
5027
|
getZindex() {
|
|
5000
|
-
return Math.round((this.provider.parameters.zoomMax - this.zoom) * this.provider.parameters.zoomScale) +
|
|
5028
|
+
return Math.round((this.provider.parameters.zoomMax - this.zoom) * this.provider.parameters.zoomScale) + Yt.Z_INDEX_OFFSET;
|
|
5001
5029
|
}
|
|
5002
5030
|
setCollapsed(t) {
|
|
5003
5031
|
if (this.component == null) throw new Error("Failed to set tooltip collapsed");
|
|
@@ -5013,16 +5041,16 @@ const $t = class $t extends $r {
|
|
|
5013
5041
|
return this.bodyLoaded;
|
|
5014
5042
|
}
|
|
5015
5043
|
};
|
|
5016
|
-
|
|
5017
|
-
let
|
|
5018
|
-
class
|
|
5044
|
+
f(Yt, "Z_INDEX_OFFSET", 1e6);
|
|
5045
|
+
let Nr = Yt;
|
|
5046
|
+
class Na {
|
|
5019
5047
|
constructor(e) {
|
|
5020
|
-
|
|
5048
|
+
f(this, "provider");
|
|
5021
5049
|
// Data
|
|
5022
|
-
|
|
5050
|
+
f(this, "tooltipElements", new Array());
|
|
5023
5051
|
// Configuration
|
|
5024
|
-
|
|
5025
|
-
|
|
5052
|
+
f(this, "tooltipMaxWidth", 0);
|
|
5053
|
+
f(this, "tooltipMaxHeight", 0);
|
|
5026
5054
|
this.provider = e;
|
|
5027
5055
|
}
|
|
5028
5056
|
updateElements(e) {
|
|
@@ -5032,30 +5060,30 @@ class Ti {
|
|
|
5032
5060
|
this.tooltipElements.forEach((e) => e.remove()), this.tooltipElements.length = 0;
|
|
5033
5061
|
}
|
|
5034
5062
|
process(e, t) {
|
|
5035
|
-
const n = this.provider.parameters.mapSize, s = new
|
|
5036
|
-
for (const
|
|
5037
|
-
s.contains(
|
|
5063
|
+
const n = this.provider.parameters.mapSize, s = new ms(e, t, n, this.tooltipMaxWidth * 2, this.tooltipMaxHeight * 2);
|
|
5064
|
+
for (const i of this.tooltipElements)
|
|
5065
|
+
s.contains(i.lat, i.lng) ? i.shown && i.zoom <= t ? (i.updateState(t), i.setCollapsed(!1), i.updateMap(!0), i.isCollapsed() == !1 && i.isBodyLoaded() == !1 && i.updateBody()) : (i.setCollapsed(!0), i.isCollapsed() && i.updateMap(!1)) : i.updateMap(!1);
|
|
5038
5066
|
}
|
|
5039
5067
|
}
|
|
5040
|
-
const
|
|
5068
|
+
const Ht = class Ht extends Yr {
|
|
5041
5069
|
constructor(t, n) {
|
|
5042
5070
|
if (n.popup == null) throw new Error("Failed to create popup");
|
|
5043
5071
|
super(t, n);
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5072
|
+
f(this, "width");
|
|
5073
|
+
f(this, "height");
|
|
5074
|
+
f(this, "margin");
|
|
5075
|
+
f(this, "radius");
|
|
5076
|
+
f(this, "bodyLoading", !1);
|
|
5077
|
+
f(this, "bodyLoaded", !1);
|
|
5078
|
+
f(this, "bodyCallback");
|
|
5051
5079
|
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;
|
|
5052
5080
|
}
|
|
5053
5081
|
createElement() {
|
|
5054
|
-
this.element = document.createElement("div"), this.element.classList.add("popup"), this.component =
|
|
5082
|
+
this.element = document.createElement("div"), this.element.classList.add("popup"), this.component = Ur(ps, {
|
|
5055
5083
|
target: this.element,
|
|
5056
5084
|
props: {
|
|
5057
5085
|
id: this.id + "_popup",
|
|
5058
|
-
layer:
|
|
5086
|
+
layer: Ui,
|
|
5059
5087
|
priority: 0,
|
|
5060
5088
|
width: this.width,
|
|
5061
5089
|
height: this.height,
|
|
@@ -5079,7 +5107,7 @@ const qt = class qt extends $r {
|
|
|
5079
5107
|
}));
|
|
5080
5108
|
}
|
|
5081
5109
|
getZindex() {
|
|
5082
|
-
return
|
|
5110
|
+
return Ht.Z_INDEX_OFFSET;
|
|
5083
5111
|
}
|
|
5084
5112
|
setCollapsed(t) {
|
|
5085
5113
|
if (this.component == null) throw new Error("Failed to set popup collapsed");
|
|
@@ -5099,19 +5127,19 @@ const qt = class qt extends $r {
|
|
|
5099
5127
|
return this.bodyLoaded;
|
|
5100
5128
|
}
|
|
5101
5129
|
};
|
|
5102
|
-
|
|
5103
|
-
let
|
|
5104
|
-
class
|
|
5130
|
+
f(Ht, "Z_INDEX_OFFSET", 2e6);
|
|
5131
|
+
let Rr = Ht;
|
|
5132
|
+
class Ra {
|
|
5105
5133
|
constructor(e) {
|
|
5106
|
-
|
|
5134
|
+
f(this, "provider");
|
|
5107
5135
|
// Data
|
|
5108
|
-
|
|
5109
|
-
|
|
5136
|
+
f(this, "popupElements", /* @__PURE__ */ new Map());
|
|
5137
|
+
f(this, "popupPositioned", /* @__PURE__ */ new Map());
|
|
5110
5138
|
this.provider = e;
|
|
5111
5139
|
}
|
|
5112
5140
|
show(e) {
|
|
5113
5141
|
e.pin.shown = !1, e.tooltip.shown = !1;
|
|
5114
|
-
const t = new
|
|
5142
|
+
const t = new Rr(this.provider, e.marker);
|
|
5115
5143
|
this.popupElements.set(e.marker.id, t), this.popupPositioned.set(e.marker.id, !1), t.create(), t.setAngle(e.tooltip.angle), t.shown = !0;
|
|
5116
5144
|
}
|
|
5117
5145
|
hide(e) {
|
|
@@ -5129,17 +5157,17 @@ class Ai {
|
|
|
5129
5157
|
if (n.setCollapsed(!1), n.updateMap(!0), n.isExpanded() && n.isBodyLoaded() == !1 && n.updateBody(), n.isCollapsed() == !1 && this.popupPositioned.get(n.id) == !1) {
|
|
5130
5158
|
const s = (e = n.component) == null ? void 0 : e.getBody();
|
|
5131
5159
|
if (s == null) continue;
|
|
5132
|
-
const
|
|
5133
|
-
if (
|
|
5134
|
-
const
|
|
5135
|
-
if (
|
|
5136
|
-
const o =
|
|
5137
|
-
this.provider.panBy(z,
|
|
5160
|
+
const i = (t = n.component) == null ? void 0 : t.getOffsets();
|
|
5161
|
+
if (i == null) continue;
|
|
5162
|
+
const a = s.getBoundingClientRect();
|
|
5163
|
+
if (a.x == 0 && a.y == 0 && a.width == 0 && a.height == 0) continue;
|
|
5164
|
+
const o = a.x + a.width / 2, l = a.y + a.height / 2, u = o + i.x, d = l + i.y, h = u + n.width, p = d + n.height, v = this.provider.getContainer().getBoundingClientRect(), x = u - v.left, N = v.right - h, I = d - v.top, G = v.bottom - p, T = Math.min(n.width, n.height) / 4, z = x < 0 ? x - T : N < 0 ? -N + T : 0, J = I < 0 ? I - T : G < 0 ? -G + T : 0;
|
|
5165
|
+
this.provider.panBy(z, J), this.popupPositioned.set(n.id, !0);
|
|
5138
5166
|
}
|
|
5139
5167
|
} else
|
|
5140
5168
|
n.setCollapsed(!0), n.isCollapsed() && (n.updateMap(!1), n.remove(), this.popupElements.delete(n.id), this.popupPositioned.delete(n.id));
|
|
5141
5169
|
}
|
|
5142
5170
|
}
|
|
5143
5171
|
export {
|
|
5144
|
-
|
|
5172
|
+
Za as MapManager
|
|
5145
5173
|
};
|