@arenarium/maps 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.cjs.js +1 -1
- package/dist/main.d.ts +35 -19
- package/dist/main.es.js +1736 -1656
- package/dist/main.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +5 -5
package/dist/main.es.js
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
var
|
|
2
|
-
function
|
|
1
|
+
var Er = Array.isArray, bn = Array.prototype.indexOf, Mn = Array.from, xt = Object.defineProperty, Ue = Object.getOwnPropertyDescriptor, xn = Object.prototype, Pn = Array.prototype, Sn = Object.getPrototypeOf, sr = Object.isExtensible;
|
|
2
|
+
function An(t) {
|
|
3
3
|
for (var e = 0; e < t.length; e++)
|
|
4
4
|
t[e]();
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
var t, e,
|
|
8
|
-
t =
|
|
6
|
+
function Cn() {
|
|
7
|
+
var t, e, r = new Promise((n, i) => {
|
|
8
|
+
t = n, e = i;
|
|
9
9
|
});
|
|
10
|
-
return { promise:
|
|
10
|
+
return { promise: r, resolve: t, reject: e };
|
|
11
11
|
}
|
|
12
|
-
const
|
|
12
|
+
const R = 2, Ot = 4, kr = 8, Ie = 16, fe = 32, ge = 64, Ft = 128, q = 256, ot = 512, I = 1024, re = 2048, ce = 4096, Ae = 8192, De = 16384, Rt = 32768, br = 65536, or = 1 << 17, Tn = 1 << 18, Oe = 1 << 19, Ln = 1 << 20, Pt = 1 << 21, Nt = 1 << 22, ve = 1 << 23, nt = Symbol("$state"), jt = new class extends Error {
|
|
13
13
|
name = "StaleReactionError";
|
|
14
14
|
message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
|
|
15
15
|
}();
|
|
16
|
-
function
|
|
16
|
+
function In() {
|
|
17
17
|
throw new Error("https://svelte.dev/e/async_derived_orphan");
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Dn(t) {
|
|
20
20
|
throw new Error("https://svelte.dev/e/effect_in_teardown");
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function On() {
|
|
23
23
|
throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function Fn(t) {
|
|
26
26
|
throw new Error("https://svelte.dev/e/effect_orphan");
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function Rn() {
|
|
29
29
|
throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Nn() {
|
|
32
32
|
throw new Error("https://svelte.dev/e/state_descriptors_fixed");
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function jn() {
|
|
35
35
|
throw new Error("https://svelte.dev/e/state_prototype_fixed");
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function zn() {
|
|
38
38
|
throw new Error("https://svelte.dev/e/state_unsafe_mutation");
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function Bn() {
|
|
41
41
|
throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
|
|
42
42
|
}
|
|
43
|
-
const
|
|
44
|
-
function
|
|
43
|
+
const Un = 2, x = Symbol();
|
|
44
|
+
function Zn() {
|
|
45
45
|
console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function Mr(t) {
|
|
48
48
|
return t === this.v;
|
|
49
49
|
}
|
|
50
|
-
let
|
|
51
|
-
function
|
|
52
|
-
|
|
50
|
+
let Y = null;
|
|
51
|
+
function Ce(t) {
|
|
52
|
+
Y = t;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
|
|
56
|
-
p:
|
|
54
|
+
function zt(t, e = !1, r) {
|
|
55
|
+
Y = {
|
|
56
|
+
p: Y,
|
|
57
57
|
c: null,
|
|
58
58
|
e: null,
|
|
59
59
|
s: t,
|
|
@@ -61,72 +61,72 @@ function Tt(t, e = !1, n) {
|
|
|
61
61
|
l: null
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function Bt(t) {
|
|
65
65
|
var e = (
|
|
66
66
|
/** @type {ComponentContext} */
|
|
67
|
-
|
|
68
|
-
),
|
|
69
|
-
if (
|
|
67
|
+
Y
|
|
68
|
+
), r = e.e;
|
|
69
|
+
if (r !== null) {
|
|
70
70
|
e.e = null;
|
|
71
|
-
for (var
|
|
72
|
-
|
|
71
|
+
for (var n of r)
|
|
72
|
+
Nr(n);
|
|
73
73
|
}
|
|
74
|
-
return t !== void 0 && (e.x = t),
|
|
74
|
+
return t !== void 0 && (e.x = t), Y = e.p, t ?? /** @type {T} */
|
|
75
75
|
{};
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function xr() {
|
|
78
78
|
return !0;
|
|
79
79
|
}
|
|
80
|
-
let
|
|
81
|
-
function
|
|
82
|
-
var t =
|
|
83
|
-
|
|
80
|
+
let Me = [];
|
|
81
|
+
function qn() {
|
|
82
|
+
var t = Me;
|
|
83
|
+
Me = [], An(t);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
if (
|
|
87
|
-
var e =
|
|
85
|
+
function ft(t) {
|
|
86
|
+
if (Me.length === 0) {
|
|
87
|
+
var e = Me;
|
|
88
88
|
queueMicrotask(() => {
|
|
89
|
-
e ===
|
|
89
|
+
e === Me && qn();
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
|
|
92
|
+
Me.push(t);
|
|
93
93
|
}
|
|
94
|
-
const
|
|
95
|
-
function
|
|
94
|
+
const Hn = /* @__PURE__ */ new WeakMap();
|
|
95
|
+
function Pr(t) {
|
|
96
96
|
var e = m;
|
|
97
97
|
if (e === null)
|
|
98
|
-
return v.f |=
|
|
99
|
-
if ((e.f &
|
|
100
|
-
if ((e.f &
|
|
101
|
-
throw !e.parent && t instanceof Error &&
|
|
98
|
+
return v.f |= ve, t;
|
|
99
|
+
if ((e.f & Rt) === 0) {
|
|
100
|
+
if ((e.f & Ft) === 0)
|
|
101
|
+
throw !e.parent && t instanceof Error && Sr(t), t;
|
|
102
102
|
e.b.error(t);
|
|
103
103
|
} else
|
|
104
|
-
|
|
104
|
+
Te(t, e);
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function Te(t, e) {
|
|
107
107
|
for (; e !== null; ) {
|
|
108
|
-
if ((e.f &
|
|
108
|
+
if ((e.f & Ft) !== 0)
|
|
109
109
|
try {
|
|
110
110
|
e.b.error(t);
|
|
111
111
|
return;
|
|
112
|
-
} catch (
|
|
113
|
-
t =
|
|
112
|
+
} catch (r) {
|
|
113
|
+
t = r;
|
|
114
114
|
}
|
|
115
115
|
e = e.parent;
|
|
116
116
|
}
|
|
117
|
-
throw t instanceof Error &&
|
|
117
|
+
throw t instanceof Error && Sr(t), t;
|
|
118
118
|
}
|
|
119
|
-
function
|
|
120
|
-
const e =
|
|
121
|
-
e && (
|
|
119
|
+
function Sr(t) {
|
|
120
|
+
const e = Hn.get(t);
|
|
121
|
+
e && (xt(t, "message", {
|
|
122
122
|
value: e.message
|
|
123
|
-
}),
|
|
123
|
+
}), xt(t, "stack", {
|
|
124
124
|
value: e.stack
|
|
125
125
|
}));
|
|
126
126
|
}
|
|
127
|
-
const
|
|
128
|
-
let
|
|
129
|
-
class
|
|
127
|
+
const Et = /* @__PURE__ */ new Set();
|
|
128
|
+
let A = null, St = /* @__PURE__ */ new Set(), Xe = [], Ut = null, At = !1;
|
|
129
|
+
class ie {
|
|
130
130
|
/**
|
|
131
131
|
* The current values of any sources that are updated in this batch
|
|
132
132
|
* They keys of this map are identical to `this.#previous`
|
|
@@ -154,7 +154,7 @@ class ee {
|
|
|
154
154
|
* TODO replace with Promise.withResolvers once supported widely enough
|
|
155
155
|
* @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
|
|
156
156
|
*/
|
|
157
|
-
#
|
|
157
|
+
#n = null;
|
|
158
158
|
/**
|
|
159
159
|
* True if an async effect inside this batch resolved and
|
|
160
160
|
* its parent branch was already deleted
|
|
@@ -178,7 +178,7 @@ class ee {
|
|
|
178
178
|
* a batch is committed
|
|
179
179
|
* @type {Effect[]}
|
|
180
180
|
*/
|
|
181
|
-
#
|
|
181
|
+
#r = [];
|
|
182
182
|
/**
|
|
183
183
|
* The same as `#render_effects`, but for `$effect` (which runs after)
|
|
184
184
|
* @type {Effect[]}
|
|
@@ -194,7 +194,7 @@ class ee {
|
|
|
194
194
|
* Deferred effects (which run after async work has completed) that are DIRTY
|
|
195
195
|
* @type {Effect[]}
|
|
196
196
|
*/
|
|
197
|
-
#
|
|
197
|
+
#p = [];
|
|
198
198
|
/**
|
|
199
199
|
* Deferred effects that are MAYBE_DIRTY
|
|
200
200
|
* @type {Effect[]}
|
|
@@ -211,19 +211,19 @@ class ee {
|
|
|
211
211
|
* @param {Effect[]} root_effects
|
|
212
212
|
*/
|
|
213
213
|
process(e) {
|
|
214
|
-
|
|
214
|
+
Xe = [];
|
|
215
215
|
for (const i of e)
|
|
216
|
-
this.#
|
|
216
|
+
this.#h(i);
|
|
217
217
|
if (this.#o.length === 0 && this.#a === 0) {
|
|
218
218
|
this.#d();
|
|
219
|
-
var
|
|
220
|
-
this.#
|
|
219
|
+
var r = this.#r, n = this.#s;
|
|
220
|
+
this.#r = [], this.#s = [], this.#l = [], A = null, ar(r), ar(n), A === null ? A = this : Et.delete(this), this.#n?.resolve();
|
|
221
221
|
} else
|
|
222
|
-
this.#u(this.#
|
|
222
|
+
this.#u(this.#r), this.#u(this.#s), this.#u(this.#l);
|
|
223
223
|
for (const i of this.#o)
|
|
224
|
-
|
|
224
|
+
Se(i);
|
|
225
225
|
for (const i of this.#i)
|
|
226
|
-
|
|
226
|
+
Se(i);
|
|
227
227
|
this.#o = [], this.#i = [];
|
|
228
228
|
}
|
|
229
229
|
/**
|
|
@@ -231,37 +231,37 @@ class ee {
|
|
|
231
231
|
* them for later execution as appropriate
|
|
232
232
|
* @param {Effect} root
|
|
233
233
|
*/
|
|
234
|
-
#
|
|
235
|
-
e.f ^=
|
|
236
|
-
for (var
|
|
237
|
-
var
|
|
238
|
-
if (!o &&
|
|
234
|
+
#h(e) {
|
|
235
|
+
e.f ^= I;
|
|
236
|
+
for (var r = e.first; r !== null; ) {
|
|
237
|
+
var n = r.f, i = (n & (fe | ge)) !== 0, s = i && (n & I) !== 0, o = s || (n & Ae) !== 0 || this.skipped_effects.has(r);
|
|
238
|
+
if (!o && r.fn !== null) {
|
|
239
239
|
if (i)
|
|
240
|
-
|
|
241
|
-
else if ((
|
|
242
|
-
this.#s.push(
|
|
243
|
-
else if ((
|
|
244
|
-
if ((
|
|
245
|
-
var
|
|
246
|
-
|
|
247
|
-
} else
|
|
248
|
-
var
|
|
249
|
-
if (
|
|
250
|
-
|
|
240
|
+
r.f ^= I;
|
|
241
|
+
else if ((n & Ot) !== 0)
|
|
242
|
+
this.#s.push(r);
|
|
243
|
+
else if ((n & I) === 0)
|
|
244
|
+
if ((n & Nt) !== 0) {
|
|
245
|
+
var l = r.b?.is_pending() ? this.#i : this.#o;
|
|
246
|
+
l.push(r);
|
|
247
|
+
} else pt(r) && ((r.f & Ie) !== 0 && this.#l.push(r), Se(r));
|
|
248
|
+
var a = r.first;
|
|
249
|
+
if (a !== null) {
|
|
250
|
+
r = a;
|
|
251
251
|
continue;
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
|
-
var u =
|
|
255
|
-
for (
|
|
256
|
-
|
|
254
|
+
var u = r.parent;
|
|
255
|
+
for (r = r.next; r === null && u !== null; )
|
|
256
|
+
r = u.next, u = u.parent;
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
/**
|
|
260
260
|
* @param {Effect[]} effects
|
|
261
261
|
*/
|
|
262
262
|
#u(e) {
|
|
263
|
-
for (const
|
|
264
|
-
((
|
|
263
|
+
for (const r of e)
|
|
264
|
+
((r.f & re) !== 0 ? this.#p : this.#f).push(r), H(r, I);
|
|
265
265
|
e.length = 0;
|
|
266
266
|
}
|
|
267
267
|
/**
|
|
@@ -270,23 +270,23 @@ class ee {
|
|
|
270
270
|
* @param {Source} source
|
|
271
271
|
* @param {any} value
|
|
272
272
|
*/
|
|
273
|
-
capture(e,
|
|
274
|
-
this.#e.has(e) || this.#e.set(e,
|
|
273
|
+
capture(e, r) {
|
|
274
|
+
this.#e.has(e) || this.#e.set(e, r), this.current.set(e, e.v);
|
|
275
275
|
}
|
|
276
276
|
activate() {
|
|
277
|
-
|
|
277
|
+
A = this;
|
|
278
278
|
}
|
|
279
279
|
deactivate() {
|
|
280
|
-
|
|
281
|
-
for (const e of
|
|
282
|
-
if (
|
|
280
|
+
A = null;
|
|
281
|
+
for (const e of St)
|
|
282
|
+
if (St.delete(e), e(), A !== null)
|
|
283
283
|
break;
|
|
284
284
|
}
|
|
285
285
|
neuter() {
|
|
286
286
|
this.#c = !0;
|
|
287
287
|
}
|
|
288
288
|
flush() {
|
|
289
|
-
|
|
289
|
+
Xe.length > 0 ? Yn() : this.#d(), A === this && (this.#a === 0 && Et.delete(this), this.deactivate());
|
|
290
290
|
}
|
|
291
291
|
/**
|
|
292
292
|
* Append and remove branches to/from the DOM
|
|
@@ -302,11 +302,11 @@ class ee {
|
|
|
302
302
|
}
|
|
303
303
|
decrement() {
|
|
304
304
|
if (this.#a -= 1, this.#a === 0) {
|
|
305
|
-
for (const e of this.#
|
|
306
|
-
|
|
305
|
+
for (const e of this.#p)
|
|
306
|
+
H(e, re), We(e);
|
|
307
307
|
for (const e of this.#f)
|
|
308
|
-
|
|
309
|
-
this.#
|
|
308
|
+
H(e, ce), We(e);
|
|
309
|
+
this.#r = [], this.#s = [], this.flush();
|
|
310
310
|
} else
|
|
311
311
|
this.deactivate();
|
|
312
312
|
}
|
|
@@ -315,90 +315,90 @@ class ee {
|
|
|
315
315
|
this.#t.add(e);
|
|
316
316
|
}
|
|
317
317
|
settled() {
|
|
318
|
-
return (this.#
|
|
318
|
+
return (this.#n ??= Cn()).promise;
|
|
319
319
|
}
|
|
320
320
|
static ensure() {
|
|
321
|
-
if (
|
|
322
|
-
const e =
|
|
323
|
-
|
|
324
|
-
|
|
321
|
+
if (A === null) {
|
|
322
|
+
const e = A = new ie();
|
|
323
|
+
Et.add(A), ie.enqueue(() => {
|
|
324
|
+
A === e && e.flush();
|
|
325
325
|
});
|
|
326
326
|
}
|
|
327
|
-
return
|
|
327
|
+
return A;
|
|
328
328
|
}
|
|
329
329
|
/** @param {() => void} task */
|
|
330
330
|
static enqueue(e) {
|
|
331
|
-
|
|
331
|
+
ft(e);
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
|
-
function
|
|
335
|
-
var t =
|
|
336
|
-
|
|
334
|
+
function Yn() {
|
|
335
|
+
var t = Pe;
|
|
336
|
+
At = !0;
|
|
337
337
|
try {
|
|
338
338
|
var e = 0;
|
|
339
|
-
for (
|
|
340
|
-
var
|
|
339
|
+
for (fr(!0); Xe.length > 0; ) {
|
|
340
|
+
var r = ie.ensure();
|
|
341
341
|
if (e++ > 1e3) {
|
|
342
|
-
var
|
|
343
|
-
|
|
342
|
+
var n, i;
|
|
343
|
+
Vn();
|
|
344
344
|
}
|
|
345
|
-
|
|
345
|
+
r.process(Xe), ue.clear();
|
|
346
346
|
}
|
|
347
347
|
} finally {
|
|
348
|
-
|
|
348
|
+
At = !1, fr(t), Ut = null;
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function Vn() {
|
|
352
352
|
try {
|
|
353
|
-
|
|
353
|
+
Rn();
|
|
354
354
|
} catch (t) {
|
|
355
|
-
|
|
355
|
+
Te(t, Ut);
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
-
let
|
|
359
|
-
function
|
|
358
|
+
let de = null;
|
|
359
|
+
function ar(t) {
|
|
360
360
|
var e = t.length;
|
|
361
361
|
if (e !== 0) {
|
|
362
|
-
for (var
|
|
363
|
-
var
|
|
364
|
-
if ((
|
|
365
|
-
|
|
366
|
-
for (const i of
|
|
367
|
-
|
|
368
|
-
|
|
362
|
+
for (var r = 0; r < e; ) {
|
|
363
|
+
var n = t[r++];
|
|
364
|
+
if ((n.f & (De | Ae)) === 0 && pt(n) && (de = [], Se(n), n.deps === null && n.first === null && n.nodes_start === null && (n.teardown === null && n.ac === null ? Ur(n) : n.fn = null), de?.length > 0)) {
|
|
365
|
+
ue.clear();
|
|
366
|
+
for (const i of de)
|
|
367
|
+
Se(i);
|
|
368
|
+
de = [];
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
|
-
|
|
371
|
+
de = null;
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
|
-
function
|
|
375
|
-
for (var e =
|
|
374
|
+
function We(t) {
|
|
375
|
+
for (var e = Ut = t; e.parent !== null; ) {
|
|
376
376
|
e = e.parent;
|
|
377
|
-
var
|
|
378
|
-
if (
|
|
377
|
+
var r = e.f;
|
|
378
|
+
if (At && e === m && (r & Ie) !== 0)
|
|
379
379
|
return;
|
|
380
|
-
if ((
|
|
381
|
-
if ((
|
|
382
|
-
e.f ^=
|
|
380
|
+
if ((r & (ge | fe)) !== 0) {
|
|
381
|
+
if ((r & I) === 0) return;
|
|
382
|
+
e.f ^= I;
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
|
-
|
|
385
|
+
Xe.push(e);
|
|
386
386
|
}
|
|
387
|
-
function
|
|
388
|
-
let e = 0,
|
|
387
|
+
function Xn(t) {
|
|
388
|
+
let e = 0, r = ct(0), n;
|
|
389
389
|
return () => {
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
e -= 1, e === 0 && (
|
|
390
|
+
li() && (g(r), Ht(() => (e === 0 && (n = Wr(() => t(() => Ze(r)))), e += 1, () => {
|
|
391
|
+
ft(() => {
|
|
392
|
+
e -= 1, e === 0 && (n?.(), n = void 0, Ze(r));
|
|
393
393
|
});
|
|
394
394
|
})));
|
|
395
395
|
};
|
|
396
396
|
}
|
|
397
|
-
var
|
|
398
|
-
function
|
|
399
|
-
new
|
|
397
|
+
var Wn = br | Oe | Ft;
|
|
398
|
+
function Gn(t, e, r) {
|
|
399
|
+
new Kn(t, e, r);
|
|
400
400
|
}
|
|
401
|
-
class
|
|
401
|
+
class Kn {
|
|
402
402
|
/** @type {Boundary | null} */
|
|
403
403
|
parent;
|
|
404
404
|
#e = !1;
|
|
@@ -407,7 +407,7 @@ class Rr {
|
|
|
407
407
|
/** @type {TemplateNode | null} */
|
|
408
408
|
#a = null;
|
|
409
409
|
/** @type {BoundaryProps} */
|
|
410
|
-
#
|
|
410
|
+
#n;
|
|
411
411
|
/** @type {((anchor: Node) => void)} */
|
|
412
412
|
#c;
|
|
413
413
|
/** @type {Effect} */
|
|
@@ -415,14 +415,14 @@ class Rr {
|
|
|
415
415
|
/** @type {Effect | null} */
|
|
416
416
|
#i = null;
|
|
417
417
|
/** @type {Effect | null} */
|
|
418
|
-
#
|
|
418
|
+
#r = null;
|
|
419
419
|
/** @type {Effect | null} */
|
|
420
420
|
#s = null;
|
|
421
421
|
/** @type {DocumentFragment | null} */
|
|
422
422
|
#l = null;
|
|
423
|
-
#
|
|
423
|
+
#p = 0;
|
|
424
424
|
#f = 0;
|
|
425
|
-
#
|
|
425
|
+
#h = !1;
|
|
426
426
|
/**
|
|
427
427
|
* A source containing the number of pending async deriveds/expressions.
|
|
428
428
|
* Only created if `$effect.pending()` is used inside the boundary,
|
|
@@ -432,9 +432,9 @@ class Rr {
|
|
|
432
432
|
*/
|
|
433
433
|
#u = null;
|
|
434
434
|
#d = () => {
|
|
435
|
-
this.#u &&
|
|
435
|
+
this.#u && at(this.#u, this.#p);
|
|
436
436
|
};
|
|
437
|
-
#g =
|
|
437
|
+
#g = Xn(() => (this.#u = ct(this.#p), () => {
|
|
438
438
|
this.#u = null;
|
|
439
439
|
}));
|
|
440
440
|
/**
|
|
@@ -442,36 +442,36 @@ class Rr {
|
|
|
442
442
|
* @param {BoundaryProps} props
|
|
443
443
|
* @param {((anchor: Node) => void)} children
|
|
444
444
|
*/
|
|
445
|
-
constructor(e,
|
|
446
|
-
this.#t = e, this.#
|
|
447
|
-
m.b, this.#e = !!this.#
|
|
445
|
+
constructor(e, r, n) {
|
|
446
|
+
this.#t = e, this.#n = r, this.#c = n, this.parent = /** @type {Effect} */
|
|
447
|
+
m.b, this.#e = !!this.#n.pending, this.#o = pi(() => {
|
|
448
448
|
m.b = this;
|
|
449
449
|
{
|
|
450
450
|
try {
|
|
451
|
-
this.#i =
|
|
451
|
+
this.#i = he(() => n(this.#t));
|
|
452
452
|
} catch (i) {
|
|
453
453
|
this.error(i);
|
|
454
454
|
}
|
|
455
455
|
this.#f > 0 ? this.#m() : this.#e = !1;
|
|
456
456
|
}
|
|
457
|
-
},
|
|
457
|
+
}, Wn);
|
|
458
458
|
}
|
|
459
459
|
#_() {
|
|
460
460
|
try {
|
|
461
|
-
this.#i =
|
|
461
|
+
this.#i = he(() => this.#c(this.#t));
|
|
462
462
|
} catch (e) {
|
|
463
463
|
this.error(e);
|
|
464
464
|
}
|
|
465
465
|
this.#e = !1;
|
|
466
466
|
}
|
|
467
467
|
#w() {
|
|
468
|
-
const e = this.#
|
|
469
|
-
e && (this.#
|
|
470
|
-
this.#i = this.#v(() => (
|
|
468
|
+
const e = this.#n.pending;
|
|
469
|
+
e && (this.#r = he(() => e(this.#t)), ie.enqueue(() => {
|
|
470
|
+
this.#i = this.#v(() => (ie.ensure(), he(() => this.#c(this.#t)))), this.#f > 0 ? this.#m() : (it(
|
|
471
471
|
/** @type {Effect} */
|
|
472
|
-
this.#
|
|
472
|
+
this.#r,
|
|
473
473
|
() => {
|
|
474
|
-
this.#
|
|
474
|
+
this.#r = null;
|
|
475
475
|
}
|
|
476
476
|
), this.#e = !1);
|
|
477
477
|
}));
|
|
@@ -484,28 +484,28 @@ class Rr {
|
|
|
484
484
|
return this.#e || !!this.parent && this.parent.is_pending();
|
|
485
485
|
}
|
|
486
486
|
has_pending_snippet() {
|
|
487
|
-
return !!this.#
|
|
487
|
+
return !!this.#n.pending;
|
|
488
488
|
}
|
|
489
489
|
/**
|
|
490
490
|
* @param {() => Effect | null} fn
|
|
491
491
|
*/
|
|
492
492
|
#v(e) {
|
|
493
|
-
var
|
|
494
|
-
|
|
493
|
+
var r = m, n = v, i = Y;
|
|
494
|
+
ne(this.#o), D(this.#o), Ce(this.#o.ctx);
|
|
495
495
|
try {
|
|
496
496
|
return e();
|
|
497
497
|
} catch (s) {
|
|
498
|
-
return
|
|
498
|
+
return Pr(s), null;
|
|
499
499
|
} finally {
|
|
500
|
-
|
|
500
|
+
ne(r), D(n), Ce(i);
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
503
|
#m() {
|
|
504
504
|
const e = (
|
|
505
505
|
/** @type {(anchor: Node) => void} */
|
|
506
|
-
this.#
|
|
506
|
+
this.#n.pending
|
|
507
507
|
);
|
|
508
|
-
this.#i !== null && (this.#l = document.createDocumentFragment(),
|
|
508
|
+
this.#i !== null && (this.#l = document.createDocumentFragment(), Jn(this.#i, this.#l)), this.#r === null && (this.#r = he(() => e(this.#t)));
|
|
509
509
|
}
|
|
510
510
|
/**
|
|
511
511
|
* Updates the pending count associated with the currently visible pending snippet,
|
|
@@ -517,8 +517,8 @@ class Rr {
|
|
|
517
517
|
this.parent && this.parent.#y(e);
|
|
518
518
|
return;
|
|
519
519
|
}
|
|
520
|
-
this.#f += e, this.#f === 0 && (this.#e = !1, this.#
|
|
521
|
-
this.#
|
|
520
|
+
this.#f += e, this.#f === 0 && (this.#e = !1, this.#r && it(this.#r, () => {
|
|
521
|
+
this.#r = null;
|
|
522
522
|
}), this.#l && (this.#t.before(this.#l), this.#l = null));
|
|
523
523
|
}
|
|
524
524
|
/**
|
|
@@ -528,191 +528,191 @@ class Rr {
|
|
|
528
528
|
* @param {1 | -1} d
|
|
529
529
|
*/
|
|
530
530
|
update_pending_count(e) {
|
|
531
|
-
this.#y(e), this.#
|
|
531
|
+
this.#y(e), this.#p += e, St.add(this.#d);
|
|
532
532
|
}
|
|
533
533
|
get_effect_pending() {
|
|
534
|
-
return this.#g(),
|
|
534
|
+
return this.#g(), g(
|
|
535
535
|
/** @type {Source<number>} */
|
|
536
536
|
this.#u
|
|
537
537
|
);
|
|
538
538
|
}
|
|
539
539
|
/** @param {unknown} error */
|
|
540
540
|
error(e) {
|
|
541
|
-
var
|
|
542
|
-
let
|
|
543
|
-
if (this.#
|
|
541
|
+
var r = this.#n.onerror;
|
|
542
|
+
let n = this.#n.failed;
|
|
543
|
+
if (this.#h || !r && !n)
|
|
544
544
|
throw e;
|
|
545
|
-
this.#i && (
|
|
545
|
+
this.#i && (ee(this.#i), this.#i = null), this.#r && (ee(this.#r), this.#r = null), this.#s && (ee(this.#s), this.#s = null);
|
|
546
546
|
var i = !1, s = !1;
|
|
547
547
|
const o = () => {
|
|
548
548
|
if (i) {
|
|
549
|
-
|
|
549
|
+
Zn();
|
|
550
550
|
return;
|
|
551
551
|
}
|
|
552
|
-
i = !0, s &&
|
|
552
|
+
i = !0, s && Bn(), ie.ensure(), this.#p = 0, this.#s !== null && it(this.#s, () => {
|
|
553
553
|
this.#s = null;
|
|
554
|
-
}), this.#e = this.has_pending_snippet(), this.#i = this.#v(() => (this.#
|
|
554
|
+
}), this.#e = this.has_pending_snippet(), this.#i = this.#v(() => (this.#h = !1, he(() => this.#c(this.#t)))), this.#f > 0 ? this.#m() : this.#e = !1;
|
|
555
555
|
};
|
|
556
|
-
var
|
|
556
|
+
var l = v;
|
|
557
557
|
try {
|
|
558
|
-
|
|
559
|
-
} catch (
|
|
560
|
-
|
|
558
|
+
D(null), s = !0, r?.(e, o), s = !1;
|
|
559
|
+
} catch (a) {
|
|
560
|
+
Te(a, this.#o && this.#o.parent);
|
|
561
561
|
} finally {
|
|
562
|
-
|
|
562
|
+
D(l);
|
|
563
563
|
}
|
|
564
|
-
|
|
564
|
+
n && ft(() => {
|
|
565
565
|
this.#s = this.#v(() => {
|
|
566
|
-
this.#
|
|
566
|
+
this.#h = !0;
|
|
567
567
|
try {
|
|
568
|
-
return
|
|
569
|
-
|
|
568
|
+
return he(() => {
|
|
569
|
+
n(
|
|
570
570
|
this.#t,
|
|
571
571
|
() => e,
|
|
572
572
|
() => o
|
|
573
573
|
);
|
|
574
574
|
});
|
|
575
|
-
} catch (
|
|
576
|
-
return
|
|
577
|
-
|
|
575
|
+
} catch (a) {
|
|
576
|
+
return Te(
|
|
577
|
+
a,
|
|
578
578
|
/** @type {Effect} */
|
|
579
579
|
this.#o.parent
|
|
580
580
|
), null;
|
|
581
581
|
} finally {
|
|
582
|
-
this.#
|
|
582
|
+
this.#h = !1;
|
|
583
583
|
}
|
|
584
584
|
});
|
|
585
585
|
});
|
|
586
586
|
}
|
|
587
587
|
}
|
|
588
|
-
function
|
|
589
|
-
for (var
|
|
590
|
-
var i =
|
|
588
|
+
function Jn(t, e) {
|
|
589
|
+
for (var r = t.nodes_start, n = t.nodes_end; r !== null; ) {
|
|
590
|
+
var i = r === n ? null : (
|
|
591
591
|
/** @type {TemplateNode} */
|
|
592
|
-
/* @__PURE__ */
|
|
592
|
+
/* @__PURE__ */ qt(r)
|
|
593
593
|
);
|
|
594
|
-
e.append(
|
|
594
|
+
e.append(r), r = i;
|
|
595
595
|
}
|
|
596
596
|
}
|
|
597
|
-
function
|
|
598
|
-
const
|
|
597
|
+
function Qn(t, e, r) {
|
|
598
|
+
const n = ei;
|
|
599
599
|
if (e.length === 0) {
|
|
600
|
-
|
|
600
|
+
r(t.map(n));
|
|
601
601
|
return;
|
|
602
602
|
}
|
|
603
|
-
var i =
|
|
603
|
+
var i = A, s = (
|
|
604
604
|
/** @type {Effect} */
|
|
605
605
|
m
|
|
606
|
-
), o =
|
|
607
|
-
Promise.all(e.map((
|
|
606
|
+
), o = $n();
|
|
607
|
+
Promise.all(e.map((l) => /* @__PURE__ */ ti(l))).then((l) => {
|
|
608
608
|
i?.activate(), o();
|
|
609
609
|
try {
|
|
610
|
-
|
|
611
|
-
} catch (
|
|
612
|
-
(s.f &
|
|
610
|
+
r([...t.map(n), ...l]);
|
|
611
|
+
} catch (a) {
|
|
612
|
+
(s.f & De) === 0 && Te(a, s);
|
|
613
613
|
}
|
|
614
|
-
i?.deactivate(),
|
|
615
|
-
}).catch((
|
|
616
|
-
|
|
614
|
+
i?.deactivate(), Ar();
|
|
615
|
+
}).catch((l) => {
|
|
616
|
+
Te(l, s);
|
|
617
617
|
});
|
|
618
618
|
}
|
|
619
|
-
function
|
|
620
|
-
var t = m, e = v,
|
|
619
|
+
function $n() {
|
|
620
|
+
var t = m, e = v, r = Y, n = A;
|
|
621
621
|
return function() {
|
|
622
|
-
|
|
622
|
+
ne(t), D(e), Ce(r), n?.activate();
|
|
623
623
|
};
|
|
624
624
|
}
|
|
625
|
-
function
|
|
626
|
-
|
|
625
|
+
function Ar() {
|
|
626
|
+
ne(null), D(null), Ce(null);
|
|
627
627
|
}
|
|
628
628
|
// @__NO_SIDE_EFFECTS__
|
|
629
|
-
function
|
|
630
|
-
var e =
|
|
629
|
+
function ei(t) {
|
|
630
|
+
var e = R | re, r = v !== null && (v.f & R) !== 0 ? (
|
|
631
631
|
/** @type {Derived} */
|
|
632
632
|
v
|
|
633
633
|
) : null;
|
|
634
|
-
return m === null ||
|
|
635
|
-
ctx:
|
|
634
|
+
return m === null || r !== null && (r.f & q) !== 0 ? e |= q : m.f |= Oe, {
|
|
635
|
+
ctx: Y,
|
|
636
636
|
deps: null,
|
|
637
637
|
effects: null,
|
|
638
|
-
equals:
|
|
638
|
+
equals: Mr,
|
|
639
639
|
f: e,
|
|
640
640
|
fn: t,
|
|
641
641
|
reactions: null,
|
|
642
642
|
rv: 0,
|
|
643
643
|
v: (
|
|
644
644
|
/** @type {V} */
|
|
645
|
-
|
|
645
|
+
x
|
|
646
646
|
),
|
|
647
647
|
wv: 0,
|
|
648
|
-
parent:
|
|
648
|
+
parent: r ?? m,
|
|
649
649
|
ac: null
|
|
650
650
|
};
|
|
651
651
|
}
|
|
652
652
|
// @__NO_SIDE_EFFECTS__
|
|
653
|
-
function
|
|
654
|
-
let
|
|
653
|
+
function ti(t, e) {
|
|
654
|
+
let r = (
|
|
655
655
|
/** @type {Effect | null} */
|
|
656
656
|
m
|
|
657
657
|
);
|
|
658
|
-
|
|
659
|
-
var
|
|
658
|
+
r === null && In();
|
|
659
|
+
var n = (
|
|
660
660
|
/** @type {Boundary} */
|
|
661
|
-
|
|
661
|
+
r.b
|
|
662
662
|
), i = (
|
|
663
663
|
/** @type {Promise<V>} */
|
|
664
664
|
/** @type {unknown} */
|
|
665
665
|
void 0
|
|
666
|
-
), s =
|
|
666
|
+
), s = ct(
|
|
667
667
|
/** @type {V} */
|
|
668
|
-
|
|
669
|
-
), o = null,
|
|
670
|
-
return
|
|
668
|
+
x
|
|
669
|
+
), o = null, l = !v;
|
|
670
|
+
return ci(() => {
|
|
671
671
|
try {
|
|
672
|
-
var
|
|
673
|
-
o && Promise.resolve(
|
|
672
|
+
var a = t();
|
|
673
|
+
o && Promise.resolve(a).catch(() => {
|
|
674
674
|
});
|
|
675
675
|
} catch (c) {
|
|
676
|
-
|
|
676
|
+
a = Promise.reject(c);
|
|
677
677
|
}
|
|
678
|
-
var u = () =>
|
|
679
|
-
i = o?.then(u, u) ?? Promise.resolve(
|
|
678
|
+
var u = () => a;
|
|
679
|
+
i = o?.then(u, u) ?? Promise.resolve(a), o = i;
|
|
680
680
|
var f = (
|
|
681
681
|
/** @type {Batch} */
|
|
682
|
-
|
|
683
|
-
), h =
|
|
684
|
-
|
|
682
|
+
A
|
|
683
|
+
), h = n.is_pending();
|
|
684
|
+
l && (n.update_pending_count(1), h || f.increment());
|
|
685
685
|
const p = (c, d = void 0) => {
|
|
686
|
-
o = null, h || f.activate(), d ? d !==
|
|
686
|
+
o = null, h || f.activate(), d ? d !== jt && (s.f |= ve, at(s, d)) : ((s.f & ve) !== 0 && (s.f ^= ve), at(s, c)), l && (n.update_pending_count(-1), h || f.decrement()), Ar();
|
|
687
687
|
};
|
|
688
688
|
if (i.then(p, (c) => p(null, c || "unknown")), f)
|
|
689
689
|
return () => {
|
|
690
690
|
queueMicrotask(() => f.neuter());
|
|
691
691
|
};
|
|
692
|
-
}), new Promise((
|
|
692
|
+
}), new Promise((a) => {
|
|
693
693
|
function u(f) {
|
|
694
694
|
function h() {
|
|
695
|
-
f === i ?
|
|
695
|
+
f === i ? a(s) : u(i);
|
|
696
696
|
}
|
|
697
697
|
f.then(h, h);
|
|
698
698
|
}
|
|
699
699
|
u(i);
|
|
700
700
|
});
|
|
701
701
|
}
|
|
702
|
-
function
|
|
702
|
+
function Cr(t) {
|
|
703
703
|
var e = t.effects;
|
|
704
704
|
if (e !== null) {
|
|
705
705
|
t.effects = null;
|
|
706
|
-
for (var
|
|
707
|
-
|
|
706
|
+
for (var r = 0; r < e.length; r += 1)
|
|
707
|
+
ee(
|
|
708
708
|
/** @type {Effect} */
|
|
709
|
-
e[
|
|
709
|
+
e[r]
|
|
710
710
|
);
|
|
711
711
|
}
|
|
712
712
|
}
|
|
713
|
-
function
|
|
713
|
+
function ri(t) {
|
|
714
714
|
for (var e = t.parent; e !== null; ) {
|
|
715
|
-
if ((e.f &
|
|
715
|
+
if ((e.f & R) === 0)
|
|
716
716
|
return (
|
|
717
717
|
/** @type {Effect} */
|
|
718
718
|
e
|
|
@@ -721,142 +721,142 @@ function Zr(t) {
|
|
|
721
721
|
}
|
|
722
722
|
return null;
|
|
723
723
|
}
|
|
724
|
-
function
|
|
725
|
-
var e,
|
|
726
|
-
|
|
724
|
+
function Zt(t) {
|
|
725
|
+
var e, r = m;
|
|
726
|
+
ne(ri(t));
|
|
727
727
|
try {
|
|
728
|
-
|
|
728
|
+
Cr(t), e = Vr(t);
|
|
729
729
|
} finally {
|
|
730
|
-
|
|
730
|
+
ne(r);
|
|
731
731
|
}
|
|
732
732
|
return e;
|
|
733
733
|
}
|
|
734
|
-
function
|
|
735
|
-
var e =
|
|
736
|
-
if (t.equals(e) || (t.v = e, t.wv =
|
|
737
|
-
var
|
|
738
|
-
|
|
734
|
+
function Tr(t) {
|
|
735
|
+
var e = Zt(t);
|
|
736
|
+
if (t.equals(e) || (t.v = e, t.wv = Hr()), !Fe) {
|
|
737
|
+
var r = (le || (t.f & q) !== 0) && t.deps !== null ? ce : I;
|
|
738
|
+
H(t, r);
|
|
739
739
|
}
|
|
740
740
|
}
|
|
741
|
-
const
|
|
742
|
-
function
|
|
743
|
-
var
|
|
741
|
+
const ue = /* @__PURE__ */ new Map();
|
|
742
|
+
function ct(t, e) {
|
|
743
|
+
var r = {
|
|
744
744
|
f: 0,
|
|
745
745
|
// TODO ideally we could skip this altogether, but it causes type errors
|
|
746
746
|
v: t,
|
|
747
747
|
reactions: null,
|
|
748
|
-
equals:
|
|
748
|
+
equals: Mr,
|
|
749
749
|
rv: 0,
|
|
750
750
|
wv: 0
|
|
751
751
|
};
|
|
752
|
-
return
|
|
752
|
+
return r;
|
|
753
753
|
}
|
|
754
754
|
// @__NO_SIDE_EFFECTS__
|
|
755
|
-
function
|
|
756
|
-
const
|
|
757
|
-
return
|
|
755
|
+
function C(t, e) {
|
|
756
|
+
const r = ct(t);
|
|
757
|
+
return mi(r), r;
|
|
758
758
|
}
|
|
759
|
-
function
|
|
759
|
+
function P(t, e, r = !1) {
|
|
760
760
|
v !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
|
|
761
761
|
// to ensure we error if state is set inside an inspect effect
|
|
762
|
-
(!
|
|
763
|
-
let
|
|
764
|
-
return
|
|
762
|
+
(!G || (v.f & or) !== 0) && xr() && (v.f & (R | Ie | Nt | or)) !== 0 && !se?.includes(t) && zn();
|
|
763
|
+
let n = r ? je(e) : e;
|
|
764
|
+
return at(t, n);
|
|
765
765
|
}
|
|
766
|
-
function
|
|
766
|
+
function at(t, e) {
|
|
767
767
|
if (!t.equals(e)) {
|
|
768
|
-
var
|
|
769
|
-
|
|
770
|
-
var
|
|
771
|
-
|
|
768
|
+
var r = t.v;
|
|
769
|
+
Fe ? ue.set(t, e) : ue.set(t, r), t.v = e;
|
|
770
|
+
var n = ie.ensure();
|
|
771
|
+
n.capture(t, r), (t.f & R) !== 0 && ((t.f & re) !== 0 && Zt(
|
|
772
772
|
/** @type {Derived} */
|
|
773
773
|
t
|
|
774
|
-
),
|
|
774
|
+
), H(t, (t.f & q) === 0 ? I : ce)), t.wv = Hr(), Lr(t, re), m !== null && (m.f & I) !== 0 && (m.f & (fe | ge)) === 0 && (j === null ? yi([t]) : j.push(t));
|
|
775
775
|
}
|
|
776
776
|
return e;
|
|
777
777
|
}
|
|
778
|
-
function
|
|
779
|
-
|
|
778
|
+
function Ze(t) {
|
|
779
|
+
P(t, t.v + 1);
|
|
780
780
|
}
|
|
781
|
-
function
|
|
782
|
-
var
|
|
783
|
-
if (
|
|
784
|
-
for (var
|
|
785
|
-
var s =
|
|
786
|
-
|
|
781
|
+
function Lr(t, e) {
|
|
782
|
+
var r = t.reactions;
|
|
783
|
+
if (r !== null)
|
|
784
|
+
for (var n = r.length, i = 0; i < n; i++) {
|
|
785
|
+
var s = r[i], o = s.f, l = (o & re) === 0;
|
|
786
|
+
l && H(s, e), (o & R) !== 0 ? Lr(
|
|
787
787
|
/** @type {Derived} */
|
|
788
788
|
s,
|
|
789
|
-
|
|
790
|
-
) :
|
|
789
|
+
ce
|
|
790
|
+
) : l && ((o & Ie) !== 0 && de !== null && de.push(
|
|
791
791
|
/** @type {Effect} */
|
|
792
792
|
s
|
|
793
|
-
),
|
|
793
|
+
), We(
|
|
794
794
|
/** @type {Effect} */
|
|
795
795
|
s
|
|
796
796
|
));
|
|
797
797
|
}
|
|
798
798
|
}
|
|
799
|
-
function
|
|
800
|
-
if (typeof t != "object" || t === null ||
|
|
799
|
+
function je(t) {
|
|
800
|
+
if (typeof t != "object" || t === null || nt in t)
|
|
801
801
|
return t;
|
|
802
|
-
const e =
|
|
803
|
-
if (e !==
|
|
802
|
+
const e = Sn(t);
|
|
803
|
+
if (e !== xn && e !== Pn)
|
|
804
804
|
return t;
|
|
805
|
-
var
|
|
806
|
-
if (
|
|
807
|
-
return
|
|
808
|
-
var
|
|
809
|
-
|
|
810
|
-
var f =
|
|
811
|
-
return
|
|
805
|
+
var r = /* @__PURE__ */ new Map(), n = Er(t), i = /* @__PURE__ */ C(0), s = me, o = (l) => {
|
|
806
|
+
if (me === s)
|
|
807
|
+
return l();
|
|
808
|
+
var a = v, u = me;
|
|
809
|
+
D(null), pr(s);
|
|
810
|
+
var f = l();
|
|
811
|
+
return D(a), pr(u), f;
|
|
812
812
|
};
|
|
813
|
-
return
|
|
813
|
+
return n && r.set("length", /* @__PURE__ */ C(
|
|
814
814
|
/** @type {any[]} */
|
|
815
815
|
t.length
|
|
816
816
|
)), new Proxy(
|
|
817
817
|
/** @type {any} */
|
|
818
818
|
t,
|
|
819
819
|
{
|
|
820
|
-
defineProperty(
|
|
821
|
-
(!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) &&
|
|
822
|
-
var f =
|
|
820
|
+
defineProperty(l, a, u) {
|
|
821
|
+
(!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Nn();
|
|
822
|
+
var f = r.get(a);
|
|
823
823
|
return f === void 0 ? f = o(() => {
|
|
824
|
-
var h = /* @__PURE__ */
|
|
825
|
-
return
|
|
826
|
-
}) :
|
|
824
|
+
var h = /* @__PURE__ */ C(u.value);
|
|
825
|
+
return r.set(a, h), h;
|
|
826
|
+
}) : P(f, u.value, !0), !0;
|
|
827
827
|
},
|
|
828
|
-
deleteProperty(
|
|
829
|
-
var u =
|
|
828
|
+
deleteProperty(l, a) {
|
|
829
|
+
var u = r.get(a);
|
|
830
830
|
if (u === void 0) {
|
|
831
|
-
if (
|
|
832
|
-
const f = o(() => /* @__PURE__ */
|
|
833
|
-
|
|
831
|
+
if (a in l) {
|
|
832
|
+
const f = o(() => /* @__PURE__ */ C(x));
|
|
833
|
+
r.set(a, f), Ze(i);
|
|
834
834
|
}
|
|
835
835
|
} else
|
|
836
|
-
|
|
836
|
+
P(u, x), Ze(i);
|
|
837
837
|
return !0;
|
|
838
838
|
},
|
|
839
|
-
get(
|
|
840
|
-
if (
|
|
839
|
+
get(l, a, u) {
|
|
840
|
+
if (a === nt)
|
|
841
841
|
return t;
|
|
842
|
-
var f =
|
|
843
|
-
if (f === void 0 && (!h ||
|
|
844
|
-
var c =
|
|
842
|
+
var f = r.get(a), h = a in l;
|
|
843
|
+
if (f === void 0 && (!h || Ue(l, a)?.writable) && (f = o(() => {
|
|
844
|
+
var c = je(h ? l[a] : x), d = /* @__PURE__ */ C(c);
|
|
845
845
|
return d;
|
|
846
|
-
}),
|
|
847
|
-
var p =
|
|
848
|
-
return p ===
|
|
846
|
+
}), r.set(a, f)), f !== void 0) {
|
|
847
|
+
var p = g(f);
|
|
848
|
+
return p === x ? void 0 : p;
|
|
849
849
|
}
|
|
850
|
-
return Reflect.get(
|
|
850
|
+
return Reflect.get(l, a, u);
|
|
851
851
|
},
|
|
852
|
-
getOwnPropertyDescriptor(
|
|
853
|
-
var u = Reflect.getOwnPropertyDescriptor(
|
|
852
|
+
getOwnPropertyDescriptor(l, a) {
|
|
853
|
+
var u = Reflect.getOwnPropertyDescriptor(l, a);
|
|
854
854
|
if (u && "value" in u) {
|
|
855
|
-
var f =
|
|
856
|
-
f && (u.value =
|
|
855
|
+
var f = r.get(a);
|
|
856
|
+
f && (u.value = g(f));
|
|
857
857
|
} else if (u === void 0) {
|
|
858
|
-
var h =
|
|
859
|
-
if (h !== void 0 && p !==
|
|
858
|
+
var h = r.get(a), p = h?.v;
|
|
859
|
+
if (h !== void 0 && p !== x)
|
|
860
860
|
return {
|
|
861
861
|
enumerable: !0,
|
|
862
862
|
configurable: !0,
|
|
@@ -866,119 +866,119 @@ function Fe(t) {
|
|
|
866
866
|
}
|
|
867
867
|
return u;
|
|
868
868
|
},
|
|
869
|
-
has(
|
|
870
|
-
if (
|
|
869
|
+
has(l, a) {
|
|
870
|
+
if (a === nt)
|
|
871
871
|
return !0;
|
|
872
|
-
var u =
|
|
873
|
-
if (u !== void 0 || m !== null && (!f ||
|
|
872
|
+
var u = r.get(a), f = u !== void 0 && u.v !== x || Reflect.has(l, a);
|
|
873
|
+
if (u !== void 0 || m !== null && (!f || Ue(l, a)?.writable)) {
|
|
874
874
|
u === void 0 && (u = o(() => {
|
|
875
|
-
var p = f ?
|
|
875
|
+
var p = f ? je(l[a]) : x, c = /* @__PURE__ */ C(p);
|
|
876
876
|
return c;
|
|
877
|
-
}),
|
|
878
|
-
var h =
|
|
879
|
-
if (h ===
|
|
877
|
+
}), r.set(a, u));
|
|
878
|
+
var h = g(u);
|
|
879
|
+
if (h === x)
|
|
880
880
|
return !1;
|
|
881
881
|
}
|
|
882
882
|
return f;
|
|
883
883
|
},
|
|
884
|
-
set(
|
|
885
|
-
var h =
|
|
886
|
-
if (
|
|
884
|
+
set(l, a, u, f) {
|
|
885
|
+
var h = r.get(a), p = a in l;
|
|
886
|
+
if (n && a === "length")
|
|
887
887
|
for (var c = u; c < /** @type {Source<number>} */
|
|
888
888
|
h.v; c += 1) {
|
|
889
|
-
var d =
|
|
890
|
-
d !== void 0 ?
|
|
889
|
+
var d = r.get(c + "");
|
|
890
|
+
d !== void 0 ? P(d, x) : c in l && (d = o(() => /* @__PURE__ */ C(x)), r.set(c + "", d));
|
|
891
891
|
}
|
|
892
892
|
if (h === void 0)
|
|
893
|
-
(!p ||
|
|
893
|
+
(!p || Ue(l, a)?.writable) && (h = o(() => /* @__PURE__ */ C(void 0)), P(h, je(u)), r.set(a, h));
|
|
894
894
|
else {
|
|
895
|
-
p = h.v !==
|
|
896
|
-
var
|
|
897
|
-
|
|
895
|
+
p = h.v !== x;
|
|
896
|
+
var w = o(() => je(u));
|
|
897
|
+
P(h, w);
|
|
898
898
|
}
|
|
899
|
-
var
|
|
900
|
-
if (
|
|
901
|
-
if (
|
|
902
|
-
var
|
|
899
|
+
var O = Reflect.getOwnPropertyDescriptor(l, a);
|
|
900
|
+
if (O?.set && O.set.call(f, u), !p) {
|
|
901
|
+
if (n && typeof a == "string") {
|
|
902
|
+
var K = (
|
|
903
903
|
/** @type {Source<number>} */
|
|
904
|
-
|
|
905
|
-
),
|
|
906
|
-
Number.isInteger(
|
|
904
|
+
r.get("length")
|
|
905
|
+
), b = Number(a);
|
|
906
|
+
Number.isInteger(b) && b >= K.v && P(K, b + 1);
|
|
907
907
|
}
|
|
908
|
-
|
|
908
|
+
Ze(i);
|
|
909
909
|
}
|
|
910
910
|
return !0;
|
|
911
911
|
},
|
|
912
|
-
ownKeys(
|
|
913
|
-
|
|
914
|
-
var
|
|
915
|
-
var p =
|
|
916
|
-
return p === void 0 || p.v !==
|
|
912
|
+
ownKeys(l) {
|
|
913
|
+
g(i);
|
|
914
|
+
var a = Reflect.ownKeys(l).filter((h) => {
|
|
915
|
+
var p = r.get(h);
|
|
916
|
+
return p === void 0 || p.v !== x;
|
|
917
917
|
});
|
|
918
|
-
for (var [u, f] of
|
|
919
|
-
f.v !==
|
|
920
|
-
return
|
|
918
|
+
for (var [u, f] of r)
|
|
919
|
+
f.v !== x && !(u in l) && a.push(u);
|
|
920
|
+
return a;
|
|
921
921
|
},
|
|
922
922
|
setPrototypeOf() {
|
|
923
|
-
|
|
923
|
+
jn();
|
|
924
924
|
}
|
|
925
925
|
}
|
|
926
926
|
);
|
|
927
927
|
}
|
|
928
|
-
var
|
|
929
|
-
function
|
|
930
|
-
if (
|
|
931
|
-
|
|
932
|
-
var t = Element.prototype, e = Node.prototype,
|
|
933
|
-
|
|
928
|
+
var lr, Ir, Dr, Or;
|
|
929
|
+
function ni() {
|
|
930
|
+
if (lr === void 0) {
|
|
931
|
+
lr = window, Ir = /Firefox/.test(navigator.userAgent);
|
|
932
|
+
var t = Element.prototype, e = Node.prototype, r = Text.prototype;
|
|
933
|
+
Dr = Ue(e, "firstChild").get, Or = Ue(e, "nextSibling").get, sr(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), sr(r) && (r.__t = void 0);
|
|
934
934
|
}
|
|
935
935
|
}
|
|
936
|
-
function
|
|
936
|
+
function ii(t = "") {
|
|
937
937
|
return document.createTextNode(t);
|
|
938
938
|
}
|
|
939
939
|
// @__NO_SIDE_EFFECTS__
|
|
940
|
-
function
|
|
941
|
-
return
|
|
940
|
+
function Fr(t) {
|
|
941
|
+
return Dr.call(t);
|
|
942
942
|
}
|
|
943
943
|
// @__NO_SIDE_EFFECTS__
|
|
944
|
-
function
|
|
945
|
-
return
|
|
944
|
+
function qt(t) {
|
|
945
|
+
return Or.call(t);
|
|
946
946
|
}
|
|
947
|
-
function
|
|
948
|
-
return /* @__PURE__ */
|
|
947
|
+
function ur(t, e) {
|
|
948
|
+
return /* @__PURE__ */ Fr(t);
|
|
949
949
|
}
|
|
950
|
-
function
|
|
951
|
-
let
|
|
950
|
+
function si(t, e = 1, r = !1) {
|
|
951
|
+
let n = t;
|
|
952
952
|
for (; e--; )
|
|
953
|
-
|
|
954
|
-
/* @__PURE__ */
|
|
955
|
-
return
|
|
953
|
+
n = /** @type {TemplateNode} */
|
|
954
|
+
/* @__PURE__ */ qt(n);
|
|
955
|
+
return n;
|
|
956
956
|
}
|
|
957
|
-
function
|
|
958
|
-
var e = v,
|
|
959
|
-
|
|
957
|
+
function Rr(t) {
|
|
958
|
+
var e = v, r = m;
|
|
959
|
+
D(null), ne(null);
|
|
960
960
|
try {
|
|
961
961
|
return t();
|
|
962
962
|
} finally {
|
|
963
|
-
|
|
963
|
+
D(e), ne(r);
|
|
964
964
|
}
|
|
965
965
|
}
|
|
966
|
-
function
|
|
967
|
-
m === null && v === null &&
|
|
966
|
+
function oi(t) {
|
|
967
|
+
m === null && v === null && Fn(), v !== null && (v.f & q) !== 0 && m === null && On(), Fe && Dn();
|
|
968
968
|
}
|
|
969
|
-
function
|
|
970
|
-
var
|
|
971
|
-
|
|
969
|
+
function ai(t, e) {
|
|
970
|
+
var r = e.last;
|
|
971
|
+
r === null ? e.last = e.first = t : (r.next = t, t.prev = r, e.last = t);
|
|
972
972
|
}
|
|
973
|
-
function
|
|
973
|
+
function pe(t, e, r, n = !0) {
|
|
974
974
|
var i = m;
|
|
975
|
-
i !== null && (i.f &
|
|
975
|
+
i !== null && (i.f & Ae) !== 0 && (t |= Ae);
|
|
976
976
|
var s = {
|
|
977
|
-
ctx:
|
|
977
|
+
ctx: Y,
|
|
978
978
|
deps: null,
|
|
979
979
|
nodes_start: null,
|
|
980
980
|
nodes_end: null,
|
|
981
|
-
f: t |
|
|
981
|
+
f: t | re,
|
|
982
982
|
first: null,
|
|
983
983
|
fn: e,
|
|
984
984
|
last: null,
|
|
@@ -991,403 +991,403 @@ function ue(t, e, n, r = !0) {
|
|
|
991
991
|
wv: 0,
|
|
992
992
|
ac: null
|
|
993
993
|
};
|
|
994
|
-
if (
|
|
994
|
+
if (r)
|
|
995
995
|
try {
|
|
996
|
-
|
|
997
|
-
} catch (
|
|
998
|
-
throw
|
|
996
|
+
Se(s), s.f |= Rt;
|
|
997
|
+
} catch (a) {
|
|
998
|
+
throw ee(s), a;
|
|
999
999
|
}
|
|
1000
|
-
else e !== null &&
|
|
1001
|
-
if (
|
|
1000
|
+
else e !== null && We(s);
|
|
1001
|
+
if (n) {
|
|
1002
1002
|
var o = s;
|
|
1003
|
-
if (
|
|
1004
|
-
(o.f &
|
|
1005
|
-
var
|
|
1003
|
+
if (r && o.deps === null && o.teardown === null && o.nodes_start === null && o.first === o.last && // either `null`, or a singular child
|
|
1004
|
+
(o.f & Oe) === 0 && (o = o.first), o !== null && (o.parent = i, i !== null && ai(o, i), v !== null && (v.f & R) !== 0 && (t & ge) === 0)) {
|
|
1005
|
+
var l = (
|
|
1006
1006
|
/** @type {Derived} */
|
|
1007
1007
|
v
|
|
1008
1008
|
);
|
|
1009
|
-
(
|
|
1009
|
+
(l.effects ??= []).push(o);
|
|
1010
1010
|
}
|
|
1011
1011
|
}
|
|
1012
1012
|
return s;
|
|
1013
1013
|
}
|
|
1014
|
-
function
|
|
1015
|
-
return v !== null && !
|
|
1014
|
+
function li() {
|
|
1015
|
+
return v !== null && !G;
|
|
1016
1016
|
}
|
|
1017
|
-
function
|
|
1018
|
-
|
|
1017
|
+
function J(t) {
|
|
1018
|
+
oi();
|
|
1019
1019
|
var e = (
|
|
1020
1020
|
/** @type {Effect} */
|
|
1021
1021
|
m.f
|
|
1022
|
-
),
|
|
1023
|
-
if (
|
|
1024
|
-
var
|
|
1022
|
+
), r = !v && (e & fe) !== 0 && (e & Rt) === 0;
|
|
1023
|
+
if (r) {
|
|
1024
|
+
var n = (
|
|
1025
1025
|
/** @type {ComponentContext} */
|
|
1026
|
-
|
|
1026
|
+
Y
|
|
1027
1027
|
);
|
|
1028
|
-
(
|
|
1028
|
+
(n.e ??= []).push(t);
|
|
1029
1029
|
} else
|
|
1030
|
-
return
|
|
1031
|
-
}
|
|
1032
|
-
function
|
|
1033
|
-
return
|
|
1034
|
-
}
|
|
1035
|
-
function
|
|
1036
|
-
|
|
1037
|
-
const e =
|
|
1038
|
-
return (
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
}) : (
|
|
1030
|
+
return Nr(t);
|
|
1031
|
+
}
|
|
1032
|
+
function Nr(t) {
|
|
1033
|
+
return pe(Ot | Ln, t, !1);
|
|
1034
|
+
}
|
|
1035
|
+
function ui(t) {
|
|
1036
|
+
ie.ensure();
|
|
1037
|
+
const e = pe(ge | Oe, t, !0);
|
|
1038
|
+
return (r = {}) => new Promise((n) => {
|
|
1039
|
+
r.outro ? it(e, () => {
|
|
1040
|
+
ee(e), n(void 0);
|
|
1041
|
+
}) : (ee(e), n(void 0));
|
|
1042
1042
|
});
|
|
1043
1043
|
}
|
|
1044
|
-
function
|
|
1045
|
-
return
|
|
1044
|
+
function fi(t) {
|
|
1045
|
+
return pe(Ot, t, !1);
|
|
1046
1046
|
}
|
|
1047
|
-
function
|
|
1048
|
-
return
|
|
1047
|
+
function ci(t) {
|
|
1048
|
+
return pe(Nt | Oe, t, !0);
|
|
1049
1049
|
}
|
|
1050
|
-
function
|
|
1051
|
-
return
|
|
1050
|
+
function Ht(t, e = 0) {
|
|
1051
|
+
return pe(kr | e, t, !0);
|
|
1052
1052
|
}
|
|
1053
|
-
function
|
|
1054
|
-
|
|
1055
|
-
|
|
1053
|
+
function jr(t, e = [], r = []) {
|
|
1054
|
+
Qn(e, r, (n) => {
|
|
1055
|
+
pe(kr, () => t(...n.map(g)), !0);
|
|
1056
1056
|
});
|
|
1057
1057
|
}
|
|
1058
|
-
function
|
|
1059
|
-
var
|
|
1060
|
-
return
|
|
1058
|
+
function pi(t, e = 0) {
|
|
1059
|
+
var r = pe(Ie | e, t, !0);
|
|
1060
|
+
return r;
|
|
1061
1061
|
}
|
|
1062
|
-
function
|
|
1063
|
-
return
|
|
1062
|
+
function he(t, e = !0) {
|
|
1063
|
+
return pe(fe | Oe, t, !0, e);
|
|
1064
1064
|
}
|
|
1065
|
-
function
|
|
1065
|
+
function zr(t) {
|
|
1066
1066
|
var e = t.teardown;
|
|
1067
1067
|
if (e !== null) {
|
|
1068
|
-
const
|
|
1069
|
-
|
|
1068
|
+
const r = Fe, n = v;
|
|
1069
|
+
cr(!0), D(null);
|
|
1070
1070
|
try {
|
|
1071
1071
|
e.call(null);
|
|
1072
1072
|
} finally {
|
|
1073
|
-
|
|
1073
|
+
cr(r), D(n);
|
|
1074
1074
|
}
|
|
1075
1075
|
}
|
|
1076
1076
|
}
|
|
1077
|
-
function
|
|
1078
|
-
var
|
|
1079
|
-
for (t.first = t.last = null;
|
|
1080
|
-
const i =
|
|
1081
|
-
i !== null &&
|
|
1082
|
-
i.abort(
|
|
1077
|
+
function Br(t, e = !1) {
|
|
1078
|
+
var r = t.first;
|
|
1079
|
+
for (t.first = t.last = null; r !== null; ) {
|
|
1080
|
+
const i = r.ac;
|
|
1081
|
+
i !== null && Rr(() => {
|
|
1082
|
+
i.abort(jt);
|
|
1083
1083
|
});
|
|
1084
|
-
var
|
|
1085
|
-
(
|
|
1084
|
+
var n = r.next;
|
|
1085
|
+
(r.f & ge) !== 0 ? r.parent = null : ee(r, e), r = n;
|
|
1086
1086
|
}
|
|
1087
1087
|
}
|
|
1088
|
-
function
|
|
1088
|
+
function hi(t) {
|
|
1089
1089
|
for (var e = t.first; e !== null; ) {
|
|
1090
|
-
var
|
|
1091
|
-
(e.f &
|
|
1090
|
+
var r = e.next;
|
|
1091
|
+
(e.f & fe) === 0 && ee(e), e = r;
|
|
1092
1092
|
}
|
|
1093
1093
|
}
|
|
1094
|
-
function
|
|
1095
|
-
var
|
|
1096
|
-
(e || (t.f &
|
|
1094
|
+
function ee(t, e = !0) {
|
|
1095
|
+
var r = !1;
|
|
1096
|
+
(e || (t.f & Tn) !== 0) && t.nodes_start !== null && t.nodes_end !== null && (di(
|
|
1097
1097
|
t.nodes_start,
|
|
1098
1098
|
/** @type {TemplateNode} */
|
|
1099
1099
|
t.nodes_end
|
|
1100
|
-
),
|
|
1101
|
-
var
|
|
1102
|
-
if (
|
|
1103
|
-
for (const s of
|
|
1100
|
+
), r = !0), Br(t, e && !r), lt(t, 0), H(t, De);
|
|
1101
|
+
var n = t.transitions;
|
|
1102
|
+
if (n !== null)
|
|
1103
|
+
for (const s of n)
|
|
1104
1104
|
s.stop();
|
|
1105
|
-
|
|
1105
|
+
zr(t);
|
|
1106
1106
|
var i = t.parent;
|
|
1107
|
-
i !== null && i.first !== null &&
|
|
1107
|
+
i !== null && i.first !== null && Ur(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes_start = t.nodes_end = t.ac = null;
|
|
1108
1108
|
}
|
|
1109
|
-
function
|
|
1109
|
+
function di(t, e) {
|
|
1110
1110
|
for (; t !== null; ) {
|
|
1111
|
-
var
|
|
1111
|
+
var r = t === e ? null : (
|
|
1112
1112
|
/** @type {TemplateNode} */
|
|
1113
|
-
/* @__PURE__ */
|
|
1113
|
+
/* @__PURE__ */ qt(t)
|
|
1114
1114
|
);
|
|
1115
|
-
t.remove(), t =
|
|
1115
|
+
t.remove(), t = r;
|
|
1116
1116
|
}
|
|
1117
1117
|
}
|
|
1118
|
-
function
|
|
1119
|
-
var e = t.parent,
|
|
1120
|
-
|
|
1118
|
+
function Ur(t) {
|
|
1119
|
+
var e = t.parent, r = t.prev, n = t.next;
|
|
1120
|
+
r !== null && (r.next = n), n !== null && (n.prev = r), e !== null && (e.first === t && (e.first = n), e.last === t && (e.last = r));
|
|
1121
1121
|
}
|
|
1122
|
-
function
|
|
1123
|
-
var
|
|
1124
|
-
|
|
1125
|
-
|
|
1122
|
+
function it(t, e) {
|
|
1123
|
+
var r = [];
|
|
1124
|
+
Zr(t, r, !0), vi(r, () => {
|
|
1125
|
+
ee(t), e && e();
|
|
1126
1126
|
});
|
|
1127
1127
|
}
|
|
1128
|
-
function
|
|
1129
|
-
var
|
|
1130
|
-
if (
|
|
1131
|
-
var
|
|
1128
|
+
function vi(t, e) {
|
|
1129
|
+
var r = t.length;
|
|
1130
|
+
if (r > 0) {
|
|
1131
|
+
var n = () => --r || e();
|
|
1132
1132
|
for (var i of t)
|
|
1133
|
-
i.out(
|
|
1133
|
+
i.out(n);
|
|
1134
1134
|
} else
|
|
1135
1135
|
e();
|
|
1136
1136
|
}
|
|
1137
|
-
function
|
|
1138
|
-
if ((t.f &
|
|
1139
|
-
if (t.f ^=
|
|
1137
|
+
function Zr(t, e, r) {
|
|
1138
|
+
if ((t.f & Ae) === 0) {
|
|
1139
|
+
if (t.f ^= Ae, t.transitions !== null)
|
|
1140
1140
|
for (const o of t.transitions)
|
|
1141
|
-
(o.is_global ||
|
|
1142
|
-
for (var
|
|
1143
|
-
var i =
|
|
1144
|
-
|
|
1141
|
+
(o.is_global || r) && e.push(o);
|
|
1142
|
+
for (var n = t.first; n !== null; ) {
|
|
1143
|
+
var i = n.next, s = (n.f & br) !== 0 || (n.f & fe) !== 0;
|
|
1144
|
+
Zr(n, e, s ? r : !1), n = i;
|
|
1145
1145
|
}
|
|
1146
1146
|
}
|
|
1147
1147
|
}
|
|
1148
|
-
let
|
|
1149
|
-
function
|
|
1150
|
-
|
|
1148
|
+
let Pe = !1;
|
|
1149
|
+
function fr(t) {
|
|
1150
|
+
Pe = t;
|
|
1151
1151
|
}
|
|
1152
|
-
let
|
|
1153
|
-
function
|
|
1154
|
-
|
|
1152
|
+
let Fe = !1;
|
|
1153
|
+
function cr(t) {
|
|
1154
|
+
Fe = t;
|
|
1155
1155
|
}
|
|
1156
|
-
let v = null,
|
|
1157
|
-
function
|
|
1156
|
+
let v = null, G = !1;
|
|
1157
|
+
function D(t) {
|
|
1158
1158
|
v = t;
|
|
1159
1159
|
}
|
|
1160
1160
|
let m = null;
|
|
1161
|
-
function
|
|
1161
|
+
function ne(t) {
|
|
1162
1162
|
m = t;
|
|
1163
1163
|
}
|
|
1164
|
-
let
|
|
1165
|
-
function
|
|
1166
|
-
v !== null && (
|
|
1164
|
+
let se = null;
|
|
1165
|
+
function mi(t) {
|
|
1166
|
+
v !== null && (se === null ? se = [t] : se.push(t));
|
|
1167
1167
|
}
|
|
1168
|
-
let
|
|
1169
|
-
function
|
|
1170
|
-
|
|
1168
|
+
let T = null, F = 0, j = null;
|
|
1169
|
+
function yi(t) {
|
|
1170
|
+
j = t;
|
|
1171
1171
|
}
|
|
1172
|
-
let
|
|
1173
|
-
function
|
|
1174
|
-
|
|
1172
|
+
let qr = 1, Ge = 0, me = Ge;
|
|
1173
|
+
function pr(t) {
|
|
1174
|
+
me = t;
|
|
1175
1175
|
}
|
|
1176
|
-
let
|
|
1177
|
-
function
|
|
1178
|
-
return ++
|
|
1176
|
+
let le = !1;
|
|
1177
|
+
function Hr() {
|
|
1178
|
+
return ++qr;
|
|
1179
1179
|
}
|
|
1180
|
-
function
|
|
1180
|
+
function pt(t) {
|
|
1181
1181
|
var e = t.f;
|
|
1182
|
-
if ((e &
|
|
1182
|
+
if ((e & re) !== 0)
|
|
1183
1183
|
return !0;
|
|
1184
|
-
if ((e &
|
|
1185
|
-
var
|
|
1186
|
-
if (
|
|
1187
|
-
var i, s, o = (e &
|
|
1188
|
-
if ((o ||
|
|
1184
|
+
if ((e & ce) !== 0) {
|
|
1185
|
+
var r = t.deps, n = (e & q) !== 0;
|
|
1186
|
+
if (r !== null) {
|
|
1187
|
+
var i, s, o = (e & ot) !== 0, l = n && m !== null && !le, a = r.length;
|
|
1188
|
+
if ((o || l) && (m === null || (m.f & De) === 0)) {
|
|
1189
1189
|
var u = (
|
|
1190
1190
|
/** @type {Derived} */
|
|
1191
1191
|
t
|
|
1192
1192
|
), f = u.parent;
|
|
1193
|
-
for (i = 0; i <
|
|
1194
|
-
s =
|
|
1195
|
-
o && (u.f ^=
|
|
1193
|
+
for (i = 0; i < a; i++)
|
|
1194
|
+
s = r[i], (o || !s?.reactions?.includes(u)) && (s.reactions ??= []).push(u);
|
|
1195
|
+
o && (u.f ^= ot), l && f !== null && (f.f & q) === 0 && (u.f ^= q);
|
|
1196
1196
|
}
|
|
1197
|
-
for (i = 0; i <
|
|
1198
|
-
if (s =
|
|
1197
|
+
for (i = 0; i < a; i++)
|
|
1198
|
+
if (s = r[i], pt(
|
|
1199
1199
|
/** @type {Derived} */
|
|
1200
1200
|
s
|
|
1201
|
-
) &&
|
|
1201
|
+
) && Tr(
|
|
1202
1202
|
/** @type {Derived} */
|
|
1203
1203
|
s
|
|
1204
1204
|
), s.wv > t.wv)
|
|
1205
1205
|
return !0;
|
|
1206
1206
|
}
|
|
1207
|
-
(!
|
|
1207
|
+
(!n || m !== null && !le) && H(t, I);
|
|
1208
1208
|
}
|
|
1209
1209
|
return !1;
|
|
1210
1210
|
}
|
|
1211
|
-
function
|
|
1212
|
-
var
|
|
1213
|
-
if (
|
|
1214
|
-
for (var i = 0; i <
|
|
1215
|
-
var s =
|
|
1216
|
-
(s.f &
|
|
1211
|
+
function Yr(t, e, r = !0) {
|
|
1212
|
+
var n = t.reactions;
|
|
1213
|
+
if (n !== null && !se?.includes(t))
|
|
1214
|
+
for (var i = 0; i < n.length; i++) {
|
|
1215
|
+
var s = n[i];
|
|
1216
|
+
(s.f & R) !== 0 ? Yr(
|
|
1217
1217
|
/** @type {Derived} */
|
|
1218
1218
|
s,
|
|
1219
1219
|
e,
|
|
1220
1220
|
!1
|
|
1221
|
-
) : e === s && (
|
|
1221
|
+
) : e === s && (r ? H(s, re) : (s.f & I) !== 0 && H(s, ce), We(
|
|
1222
1222
|
/** @type {Effect} */
|
|
1223
1223
|
s
|
|
1224
1224
|
));
|
|
1225
1225
|
}
|
|
1226
1226
|
}
|
|
1227
|
-
function
|
|
1228
|
-
var e =
|
|
1229
|
-
|
|
1230
|
-
null, F = 0,
|
|
1231
|
-
t.ac.abort(
|
|
1227
|
+
function Vr(t) {
|
|
1228
|
+
var e = T, r = F, n = j, i = v, s = le, o = se, l = Y, a = G, u = me, f = t.f;
|
|
1229
|
+
T = /** @type {null | Value[]} */
|
|
1230
|
+
null, F = 0, j = null, le = (f & q) !== 0 && (G || !Pe || v === null), v = (f & (fe | ge)) === 0 ? t : null, se = null, Ce(t.ctx), G = !1, me = ++Ge, t.ac !== null && (Rr(() => {
|
|
1231
|
+
t.ac.abort(jt);
|
|
1232
1232
|
}), t.ac = null);
|
|
1233
1233
|
try {
|
|
1234
|
-
t.f |=
|
|
1234
|
+
t.f |= Pt;
|
|
1235
1235
|
var h = (
|
|
1236
1236
|
/** @type {Function} */
|
|
1237
1237
|
t.fn
|
|
1238
1238
|
), p = h(), c = t.deps;
|
|
1239
|
-
if (
|
|
1239
|
+
if (T !== null) {
|
|
1240
1240
|
var d;
|
|
1241
|
-
if (
|
|
1242
|
-
for (c.length = F +
|
|
1243
|
-
c[F + d] =
|
|
1241
|
+
if (lt(t, F), c !== null && F > 0)
|
|
1242
|
+
for (c.length = F + T.length, d = 0; d < T.length; d++)
|
|
1243
|
+
c[F + d] = T[d];
|
|
1244
1244
|
else
|
|
1245
|
-
t.deps = c =
|
|
1246
|
-
if (!
|
|
1247
|
-
(f &
|
|
1245
|
+
t.deps = c = T;
|
|
1246
|
+
if (!le || // Deriveds that already have reactions can cleanup, so we still add them as reactions
|
|
1247
|
+
(f & R) !== 0 && /** @type {import('#client').Derived} */
|
|
1248
1248
|
t.reactions !== null)
|
|
1249
1249
|
for (d = F; d < c.length; d++)
|
|
1250
1250
|
(c[d].reactions ??= []).push(t);
|
|
1251
|
-
} else c !== null && F < c.length && (
|
|
1252
|
-
if (
|
|
1251
|
+
} else c !== null && F < c.length && (lt(t, F), c.length = F);
|
|
1252
|
+
if (xr() && j !== null && !G && c !== null && (t.f & (R | ce | re)) === 0)
|
|
1253
1253
|
for (d = 0; d < /** @type {Source[]} */
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1254
|
+
j.length; d++)
|
|
1255
|
+
Yr(
|
|
1256
|
+
j[d],
|
|
1257
1257
|
/** @type {Effect} */
|
|
1258
1258
|
t
|
|
1259
1259
|
);
|
|
1260
|
-
return i !== null && i !== t && (
|
|
1261
|
-
|
|
1262
|
-
} catch (
|
|
1263
|
-
return
|
|
1260
|
+
return i !== null && i !== t && (Ge++, j !== null && (n === null ? n = j : n.push(.../** @type {Source[]} */
|
|
1261
|
+
j))), (t.f & ve) !== 0 && (t.f ^= ve), p;
|
|
1262
|
+
} catch (w) {
|
|
1263
|
+
return Pr(w);
|
|
1264
1264
|
} finally {
|
|
1265
|
-
t.f ^=
|
|
1265
|
+
t.f ^= Pt, T = e, F = r, j = n, v = i, le = s, se = o, Ce(l), G = a, me = u;
|
|
1266
1266
|
}
|
|
1267
1267
|
}
|
|
1268
|
-
function
|
|
1269
|
-
let
|
|
1270
|
-
if (
|
|
1271
|
-
var
|
|
1272
|
-
if (
|
|
1273
|
-
var i =
|
|
1274
|
-
i === 0 ?
|
|
1268
|
+
function gi(t, e) {
|
|
1269
|
+
let r = e.reactions;
|
|
1270
|
+
if (r !== null) {
|
|
1271
|
+
var n = bn.call(r, t);
|
|
1272
|
+
if (n !== -1) {
|
|
1273
|
+
var i = r.length - 1;
|
|
1274
|
+
i === 0 ? r = e.reactions = null : (r[n] = r[i], r.pop());
|
|
1275
1275
|
}
|
|
1276
1276
|
}
|
|
1277
|
-
|
|
1277
|
+
r === null && (e.f & R) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
|
|
1278
1278
|
// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
|
|
1279
1279
|
// allows us to skip the expensive work of disconnecting and immediately reconnecting it
|
|
1280
|
-
(
|
|
1280
|
+
(T === null || !T.includes(e)) && (H(e, ce), (e.f & (q | ot)) === 0 && (e.f ^= ot), Cr(
|
|
1281
1281
|
/** @type {Derived} **/
|
|
1282
1282
|
e
|
|
1283
|
-
),
|
|
1283
|
+
), lt(
|
|
1284
1284
|
/** @type {Derived} **/
|
|
1285
1285
|
e,
|
|
1286
1286
|
0
|
|
1287
1287
|
));
|
|
1288
1288
|
}
|
|
1289
|
-
function
|
|
1290
|
-
var
|
|
1291
|
-
if (
|
|
1292
|
-
for (var
|
|
1293
|
-
|
|
1289
|
+
function lt(t, e) {
|
|
1290
|
+
var r = t.deps;
|
|
1291
|
+
if (r !== null)
|
|
1292
|
+
for (var n = e; n < r.length; n++)
|
|
1293
|
+
gi(t, r[n]);
|
|
1294
1294
|
}
|
|
1295
|
-
function
|
|
1295
|
+
function Se(t) {
|
|
1296
1296
|
var e = t.f;
|
|
1297
|
-
if ((e &
|
|
1298
|
-
|
|
1299
|
-
var
|
|
1300
|
-
m = t,
|
|
1297
|
+
if ((e & De) === 0) {
|
|
1298
|
+
H(t, I);
|
|
1299
|
+
var r = m, n = Pe;
|
|
1300
|
+
m = t, Pe = !0;
|
|
1301
1301
|
try {
|
|
1302
|
-
(e &
|
|
1303
|
-
var i =
|
|
1304
|
-
t.teardown = typeof i == "function" ? i : null, t.wv =
|
|
1302
|
+
(e & Ie) !== 0 ? hi(t) : Br(t), zr(t);
|
|
1303
|
+
var i = Vr(t);
|
|
1304
|
+
t.teardown = typeof i == "function" ? i : null, t.wv = qr;
|
|
1305
1305
|
var s;
|
|
1306
1306
|
} finally {
|
|
1307
|
-
|
|
1307
|
+
Pe = n, m = r;
|
|
1308
1308
|
}
|
|
1309
1309
|
}
|
|
1310
1310
|
}
|
|
1311
|
-
function
|
|
1312
|
-
var e = t.f,
|
|
1313
|
-
if (v !== null && !
|
|
1314
|
-
var
|
|
1315
|
-
if (!
|
|
1311
|
+
function g(t) {
|
|
1312
|
+
var e = t.f, r = (e & R) !== 0;
|
|
1313
|
+
if (v !== null && !G) {
|
|
1314
|
+
var n = m !== null && (m.f & De) !== 0;
|
|
1315
|
+
if (!n && !se?.includes(t)) {
|
|
1316
1316
|
var i = v.deps;
|
|
1317
|
-
if ((v.f &
|
|
1318
|
-
t.rv <
|
|
1317
|
+
if ((v.f & Pt) !== 0)
|
|
1318
|
+
t.rv < Ge && (t.rv = Ge, T === null && i !== null && i[F] === t ? F++ : T === null ? T = [t] : (!le || !T.includes(t)) && T.push(t));
|
|
1319
1319
|
else {
|
|
1320
1320
|
(v.deps ??= []).push(t);
|
|
1321
1321
|
var s = t.reactions;
|
|
1322
1322
|
s === null ? t.reactions = [v] : s.includes(v) || s.push(v);
|
|
1323
1323
|
}
|
|
1324
1324
|
}
|
|
1325
|
-
} else if (
|
|
1325
|
+
} else if (r && /** @type {Derived} */
|
|
1326
1326
|
t.deps === null && /** @type {Derived} */
|
|
1327
1327
|
t.effects === null) {
|
|
1328
1328
|
var o = (
|
|
1329
1329
|
/** @type {Derived} */
|
|
1330
1330
|
t
|
|
1331
|
-
),
|
|
1332
|
-
|
|
1331
|
+
), l = o.parent;
|
|
1332
|
+
l !== null && (l.f & q) === 0 && (o.f ^= q);
|
|
1333
1333
|
}
|
|
1334
|
-
if (
|
|
1335
|
-
if (
|
|
1336
|
-
return
|
|
1337
|
-
if (
|
|
1334
|
+
if (Fe) {
|
|
1335
|
+
if (ue.has(t))
|
|
1336
|
+
return ue.get(t);
|
|
1337
|
+
if (r) {
|
|
1338
1338
|
o = /** @type {Derived} */
|
|
1339
1339
|
t;
|
|
1340
|
-
var
|
|
1341
|
-
return ((o.f &
|
|
1340
|
+
var a = o.v;
|
|
1341
|
+
return ((o.f & I) === 0 && o.reactions !== null || Xr(o)) && (a = Zt(o)), ue.set(o, a), a;
|
|
1342
1342
|
}
|
|
1343
|
-
} else
|
|
1344
|
-
t,
|
|
1345
|
-
if ((t.f &
|
|
1343
|
+
} else r && (o = /** @type {Derived} */
|
|
1344
|
+
t, pt(o) && Tr(o));
|
|
1345
|
+
if ((t.f & ve) !== 0)
|
|
1346
1346
|
throw t.v;
|
|
1347
1347
|
return t.v;
|
|
1348
1348
|
}
|
|
1349
|
-
function
|
|
1350
|
-
if (t.v ===
|
|
1349
|
+
function Xr(t) {
|
|
1350
|
+
if (t.v === x) return !0;
|
|
1351
1351
|
if (t.deps === null) return !1;
|
|
1352
1352
|
for (const e of t.deps)
|
|
1353
|
-
if (
|
|
1353
|
+
if (ue.has(e) || (e.f & R) !== 0 && Xr(
|
|
1354
1354
|
/** @type {Derived} */
|
|
1355
1355
|
e
|
|
1356
1356
|
))
|
|
1357
1357
|
return !0;
|
|
1358
1358
|
return !1;
|
|
1359
1359
|
}
|
|
1360
|
-
function
|
|
1361
|
-
var e =
|
|
1360
|
+
function Wr(t) {
|
|
1361
|
+
var e = G;
|
|
1362
1362
|
try {
|
|
1363
|
-
return
|
|
1363
|
+
return G = !0, t();
|
|
1364
1364
|
} finally {
|
|
1365
|
-
|
|
1365
|
+
G = e;
|
|
1366
1366
|
}
|
|
1367
1367
|
}
|
|
1368
|
-
const
|
|
1369
|
-
function
|
|
1370
|
-
t.f = t.f &
|
|
1368
|
+
const _i = -7169;
|
|
1369
|
+
function H(t, e) {
|
|
1370
|
+
t.f = t.f & _i | e;
|
|
1371
1371
|
}
|
|
1372
|
-
const
|
|
1373
|
-
function
|
|
1374
|
-
return
|
|
1372
|
+
const wi = ["touchstart", "touchmove"];
|
|
1373
|
+
function Ei(t) {
|
|
1374
|
+
return wi.includes(t);
|
|
1375
1375
|
}
|
|
1376
|
-
const
|
|
1377
|
-
let
|
|
1378
|
-
function
|
|
1379
|
-
var e = this,
|
|
1376
|
+
const ki = /* @__PURE__ */ new Set(), hr = /* @__PURE__ */ new Set();
|
|
1377
|
+
let dr = null;
|
|
1378
|
+
function tt(t) {
|
|
1379
|
+
var e = this, r = (
|
|
1380
1380
|
/** @type {Node} */
|
|
1381
1381
|
e.ownerDocument
|
|
1382
|
-
),
|
|
1382
|
+
), n = t.type, i = t.composedPath?.() || [], s = (
|
|
1383
1383
|
/** @type {null | Element} */
|
|
1384
1384
|
i[0] || t.target
|
|
1385
1385
|
);
|
|
1386
|
-
|
|
1387
|
-
var o = 0,
|
|
1388
|
-
if (
|
|
1389
|
-
var
|
|
1390
|
-
if (
|
|
1386
|
+
dr = t;
|
|
1387
|
+
var o = 0, l = dr === t && t.__root;
|
|
1388
|
+
if (l) {
|
|
1389
|
+
var a = i.indexOf(l);
|
|
1390
|
+
if (a !== -1 && (e === document || e === /** @type {any} */
|
|
1391
1391
|
window)) {
|
|
1392
1392
|
t.__root = e;
|
|
1393
1393
|
return;
|
|
@@ -1395,104 +1395,104 @@ function Ke(t) {
|
|
|
1395
1395
|
var u = i.indexOf(e);
|
|
1396
1396
|
if (u === -1)
|
|
1397
1397
|
return;
|
|
1398
|
-
|
|
1398
|
+
a <= u && (o = a);
|
|
1399
1399
|
}
|
|
1400
1400
|
if (s = /** @type {Element} */
|
|
1401
1401
|
i[o] || t.target, s !== e) {
|
|
1402
|
-
|
|
1402
|
+
xt(t, "currentTarget", {
|
|
1403
1403
|
configurable: !0,
|
|
1404
1404
|
get() {
|
|
1405
|
-
return s ||
|
|
1405
|
+
return s || r;
|
|
1406
1406
|
}
|
|
1407
1407
|
});
|
|
1408
1408
|
var f = v, h = m;
|
|
1409
|
-
|
|
1409
|
+
D(null), ne(null);
|
|
1410
1410
|
try {
|
|
1411
1411
|
for (var p, c = []; s !== null; ) {
|
|
1412
1412
|
var d = s.assignedSlot || s.parentNode || /** @type {any} */
|
|
1413
1413
|
s.host || null;
|
|
1414
1414
|
try {
|
|
1415
|
-
var
|
|
1416
|
-
if (
|
|
1415
|
+
var w = s["__" + n];
|
|
1416
|
+
if (w != null && (!/** @type {any} */
|
|
1417
1417
|
s.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
|
|
1418
1418
|
// -> the target could not have been disabled because it emits the event in the first place
|
|
1419
1419
|
t.target === s))
|
|
1420
|
-
if (
|
|
1421
|
-
var [
|
|
1422
|
-
|
|
1420
|
+
if (Er(w)) {
|
|
1421
|
+
var [O, ...K] = w;
|
|
1422
|
+
O.apply(s, [t, ...K]);
|
|
1423
1423
|
} else
|
|
1424
|
-
|
|
1425
|
-
} catch (
|
|
1426
|
-
p ? c.push(
|
|
1424
|
+
w.call(s, t);
|
|
1425
|
+
} catch (b) {
|
|
1426
|
+
p ? c.push(b) : p = b;
|
|
1427
1427
|
}
|
|
1428
1428
|
if (t.cancelBubble || d === e || d === null)
|
|
1429
1429
|
break;
|
|
1430
1430
|
s = d;
|
|
1431
1431
|
}
|
|
1432
1432
|
if (p) {
|
|
1433
|
-
for (let
|
|
1433
|
+
for (let b of c)
|
|
1434
1434
|
queueMicrotask(() => {
|
|
1435
|
-
throw
|
|
1435
|
+
throw b;
|
|
1436
1436
|
});
|
|
1437
1437
|
throw p;
|
|
1438
1438
|
}
|
|
1439
1439
|
} finally {
|
|
1440
|
-
t.__root = e, delete t.currentTarget,
|
|
1440
|
+
t.__root = e, delete t.currentTarget, D(f), ne(h);
|
|
1441
1441
|
}
|
|
1442
1442
|
}
|
|
1443
1443
|
}
|
|
1444
|
-
function
|
|
1444
|
+
function bi(t) {
|
|
1445
1445
|
var e = document.createElement("template");
|
|
1446
1446
|
return e.innerHTML = t.replaceAll("<!>", "<!---->"), e.content;
|
|
1447
1447
|
}
|
|
1448
|
-
function
|
|
1449
|
-
var
|
|
1448
|
+
function Mi(t, e) {
|
|
1449
|
+
var r = (
|
|
1450
1450
|
/** @type {Effect} */
|
|
1451
1451
|
m
|
|
1452
1452
|
);
|
|
1453
|
-
|
|
1453
|
+
r.nodes_start === null && (r.nodes_start = t, r.nodes_end = e);
|
|
1454
1454
|
}
|
|
1455
1455
|
// @__NO_SIDE_EFFECTS__
|
|
1456
|
-
function
|
|
1457
|
-
var
|
|
1456
|
+
function Gr(t, e) {
|
|
1457
|
+
var r = (e & Un) !== 0, n, i = !t.startsWith("<!>");
|
|
1458
1458
|
return () => {
|
|
1459
|
-
|
|
1460
|
-
/* @__PURE__ */
|
|
1459
|
+
n === void 0 && (n = bi(i ? t : "<!>" + t), n = /** @type {Node} */
|
|
1460
|
+
/* @__PURE__ */ Fr(n));
|
|
1461
1461
|
var s = (
|
|
1462
1462
|
/** @type {TemplateNode} */
|
|
1463
|
-
|
|
1463
|
+
r || Ir ? document.importNode(n, !0) : n.cloneNode(!0)
|
|
1464
1464
|
);
|
|
1465
|
-
return
|
|
1465
|
+
return Mi(s, s), s;
|
|
1466
1466
|
};
|
|
1467
1467
|
}
|
|
1468
|
-
function
|
|
1468
|
+
function Kr(t, e) {
|
|
1469
1469
|
t !== null && t.before(
|
|
1470
1470
|
/** @type {Node} */
|
|
1471
1471
|
e
|
|
1472
1472
|
);
|
|
1473
1473
|
}
|
|
1474
|
-
function
|
|
1475
|
-
return
|
|
1474
|
+
function Yt(t, e) {
|
|
1475
|
+
return xi(t, e);
|
|
1476
1476
|
}
|
|
1477
|
-
const
|
|
1478
|
-
function
|
|
1479
|
-
|
|
1480
|
-
var
|
|
1477
|
+
const be = /* @__PURE__ */ new Map();
|
|
1478
|
+
function xi(t, { target: e, anchor: r, props: n = {}, events: i, context: s, intro: o = !0 }) {
|
|
1479
|
+
ni();
|
|
1480
|
+
var l = /* @__PURE__ */ new Set(), a = (h) => {
|
|
1481
1481
|
for (var p = 0; p < h.length; p++) {
|
|
1482
1482
|
var c = h[p];
|
|
1483
|
-
if (!
|
|
1484
|
-
|
|
1485
|
-
var d =
|
|
1486
|
-
e.addEventListener(c,
|
|
1487
|
-
var
|
|
1488
|
-
|
|
1483
|
+
if (!l.has(c)) {
|
|
1484
|
+
l.add(c);
|
|
1485
|
+
var d = Ei(c);
|
|
1486
|
+
e.addEventListener(c, tt, { passive: d });
|
|
1487
|
+
var w = be.get(c);
|
|
1488
|
+
w === void 0 ? (document.addEventListener(c, tt, { passive: d }), be.set(c, 1)) : be.set(c, w + 1);
|
|
1489
1489
|
}
|
|
1490
1490
|
}
|
|
1491
1491
|
};
|
|
1492
|
-
|
|
1493
|
-
var u = void 0, f =
|
|
1494
|
-
var h =
|
|
1495
|
-
return
|
|
1492
|
+
a(Mn(ki)), hr.add(a);
|
|
1493
|
+
var u = void 0, f = ui(() => {
|
|
1494
|
+
var h = r ?? e.appendChild(ii());
|
|
1495
|
+
return Gn(
|
|
1496
1496
|
/** @type {TemplateNode} */
|
|
1497
1497
|
h,
|
|
1498
1498
|
{
|
|
@@ -1501,70 +1501,88 @@ function ci(t, { target: e, anchor: n, props: r = {}, events: i, context: s, int
|
|
|
1501
1501
|
},
|
|
1502
1502
|
(p) => {
|
|
1503
1503
|
if (s) {
|
|
1504
|
-
|
|
1504
|
+
zt({});
|
|
1505
1505
|
var c = (
|
|
1506
1506
|
/** @type {ComponentContext} */
|
|
1507
|
-
|
|
1507
|
+
Y
|
|
1508
1508
|
);
|
|
1509
1509
|
c.c = s;
|
|
1510
1510
|
}
|
|
1511
|
-
i && (
|
|
1511
|
+
i && (n.$$events = i), u = t(p, n) || {}, s && Bt();
|
|
1512
1512
|
}
|
|
1513
1513
|
), () => {
|
|
1514
|
-
for (var p of
|
|
1515
|
-
e.removeEventListener(p,
|
|
1514
|
+
for (var p of l) {
|
|
1515
|
+
e.removeEventListener(p, tt);
|
|
1516
1516
|
var c = (
|
|
1517
1517
|
/** @type {number} */
|
|
1518
|
-
|
|
1518
|
+
be.get(p)
|
|
1519
1519
|
);
|
|
1520
|
-
--c === 0 ? (document.removeEventListener(p,
|
|
1520
|
+
--c === 0 ? (document.removeEventListener(p, tt), be.delete(p)) : be.set(p, c);
|
|
1521
1521
|
}
|
|
1522
|
-
|
|
1522
|
+
hr.delete(a), h !== r && h.parentNode?.removeChild(h);
|
|
1523
1523
|
};
|
|
1524
1524
|
});
|
|
1525
|
-
return
|
|
1525
|
+
return Pi.set(u, f), u;
|
|
1526
1526
|
}
|
|
1527
|
-
let
|
|
1528
|
-
function
|
|
1529
|
-
var e,
|
|
1530
|
-
if (typeof t == "string" || typeof t == "number")
|
|
1527
|
+
let Pi = /* @__PURE__ */ new WeakMap();
|
|
1528
|
+
function Jr(t) {
|
|
1529
|
+
var e, r, n = "";
|
|
1530
|
+
if (typeof t == "string" || typeof t == "number") n += t;
|
|
1531
1531
|
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
1532
1532
|
var i = t.length;
|
|
1533
|
-
for (e = 0; e < i; e++) t[e] && (
|
|
1534
|
-
} else for (
|
|
1535
|
-
return
|
|
1533
|
+
for (e = 0; e < i; e++) t[e] && (r = Jr(t[e])) && (n && (n += " "), n += r);
|
|
1534
|
+
} else for (r in t) t[r] && (n && (n += " "), n += r);
|
|
1535
|
+
return n;
|
|
1536
1536
|
}
|
|
1537
|
-
function
|
|
1538
|
-
for (var t, e,
|
|
1539
|
-
return
|
|
1537
|
+
function Si() {
|
|
1538
|
+
for (var t, e, r = 0, n = "", i = arguments.length; r < i; r++) (t = arguments[r]) && (e = Jr(t)) && (n && (n += " "), n += e);
|
|
1539
|
+
return n;
|
|
1540
1540
|
}
|
|
1541
|
-
function
|
|
1542
|
-
return typeof t == "object" ?
|
|
1541
|
+
function Qr(t) {
|
|
1542
|
+
return typeof t == "object" ? Si(t) : t ?? "";
|
|
1543
1543
|
}
|
|
1544
|
-
function
|
|
1545
|
-
var
|
|
1546
|
-
return e && (
|
|
1544
|
+
function Ai(t, e, r) {
|
|
1545
|
+
var n = t == null ? "" : "" + t;
|
|
1546
|
+
return e && (n = n ? n + " " + e : e), n === "" ? null : n;
|
|
1547
1547
|
}
|
|
1548
|
-
function
|
|
1549
|
-
|
|
1548
|
+
function vr(t, e = !1) {
|
|
1549
|
+
var r = e ? " !important;" : ";", n = "";
|
|
1550
|
+
for (var i in t) {
|
|
1551
|
+
var s = t[i];
|
|
1552
|
+
s != null && s !== "" && (n += " " + i + ": " + s + r);
|
|
1553
|
+
}
|
|
1554
|
+
return n;
|
|
1555
|
+
}
|
|
1556
|
+
function Ci(t, e) {
|
|
1557
|
+
if (e) {
|
|
1558
|
+
var r = "", n, i;
|
|
1559
|
+
return Array.isArray(e) ? (n = e[0], i = e[1]) : n = e, n && (r += vr(n)), i && (r += vr(i, !0)), r = r.trim(), r === "" ? null : r;
|
|
1560
|
+
}
|
|
1561
|
+
return String(t);
|
|
1550
1562
|
}
|
|
1551
|
-
function
|
|
1563
|
+
function $r(t, e, r, n, i, s) {
|
|
1552
1564
|
var o = t.__className;
|
|
1553
|
-
if (o !==
|
|
1554
|
-
var
|
|
1555
|
-
|
|
1565
|
+
if (o !== r || o === void 0) {
|
|
1566
|
+
var l = Ai(r, n);
|
|
1567
|
+
l == null ? t.removeAttribute("class") : t.className = l, t.__className = r;
|
|
1556
1568
|
}
|
|
1557
1569
|
return s;
|
|
1558
1570
|
}
|
|
1559
|
-
function
|
|
1571
|
+
function kt(t, e = {}, r, n) {
|
|
1572
|
+
for (var i in r) {
|
|
1573
|
+
var s = r[i];
|
|
1574
|
+
e[i] !== s && (r[i] == null ? t.style.removeProperty(i) : t.style.setProperty(i, s, n));
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1577
|
+
function ze(t, e, r, n) {
|
|
1560
1578
|
var i = t.__style;
|
|
1561
1579
|
if (i !== e) {
|
|
1562
|
-
var s =
|
|
1580
|
+
var s = Ci(e, n);
|
|
1563
1581
|
s == null ? t.removeAttribute("style") : t.style.cssText = s, t.__style = e;
|
|
1564
|
-
}
|
|
1565
|
-
return
|
|
1582
|
+
} else n && (Array.isArray(n) ? (kt(t, r?.[0], n[0]), kt(t, r?.[1], n[1], "important")) : kt(t, r, n));
|
|
1583
|
+
return n;
|
|
1566
1584
|
}
|
|
1567
|
-
const
|
|
1585
|
+
const Ti = () => performance.now(), Q = {
|
|
1568
1586
|
// don't access requestAnimationFrame eagerly outside method
|
|
1569
1587
|
// this allows basic testing of user code without JSDOM
|
|
1570
1588
|
// bunder will eval and remove ternary when the user's app is built
|
|
@@ -1572,63 +1590,63 @@ const mi = () => performance.now(), W = {
|
|
|
1572
1590
|
/** @param {any} _ */
|
|
1573
1591
|
(t) => requestAnimationFrame(t)
|
|
1574
1592
|
),
|
|
1575
|
-
now: () =>
|
|
1593
|
+
now: () => Ti(),
|
|
1576
1594
|
tasks: /* @__PURE__ */ new Set()
|
|
1577
1595
|
};
|
|
1578
|
-
function
|
|
1579
|
-
const t =
|
|
1580
|
-
|
|
1581
|
-
e.c(t) || (
|
|
1582
|
-
}),
|
|
1596
|
+
function en() {
|
|
1597
|
+
const t = Q.now();
|
|
1598
|
+
Q.tasks.forEach((e) => {
|
|
1599
|
+
e.c(t) || (Q.tasks.delete(e), e.f());
|
|
1600
|
+
}), Q.tasks.size !== 0 && Q.tick(en);
|
|
1583
1601
|
}
|
|
1584
|
-
function
|
|
1602
|
+
function Li(t) {
|
|
1585
1603
|
let e;
|
|
1586
|
-
return
|
|
1587
|
-
promise: new Promise((
|
|
1588
|
-
|
|
1604
|
+
return Q.tasks.size === 0 && Q.tick(en), {
|
|
1605
|
+
promise: new Promise((r) => {
|
|
1606
|
+
Q.tasks.add(e = { c: t, f: r });
|
|
1589
1607
|
}),
|
|
1590
1608
|
abort() {
|
|
1591
|
-
|
|
1609
|
+
Q.tasks.delete(e);
|
|
1592
1610
|
}
|
|
1593
1611
|
};
|
|
1594
1612
|
}
|
|
1595
|
-
function
|
|
1596
|
-
return t === e || t?.[
|
|
1613
|
+
function mr(t, e) {
|
|
1614
|
+
return t === e || t?.[nt] === e;
|
|
1597
1615
|
}
|
|
1598
|
-
function
|
|
1599
|
-
return
|
|
1616
|
+
function Be(t = {}, e, r, n) {
|
|
1617
|
+
return fi(() => {
|
|
1600
1618
|
var i, s;
|
|
1601
|
-
return
|
|
1602
|
-
i = s, s = [],
|
|
1603
|
-
t !==
|
|
1619
|
+
return Ht(() => {
|
|
1620
|
+
i = s, s = [], Wr(() => {
|
|
1621
|
+
t !== r(...s) && (e(t, ...s), i && mr(r(...i), t) && e(null, ...i));
|
|
1604
1622
|
});
|
|
1605
1623
|
}), () => {
|
|
1606
|
-
|
|
1607
|
-
s &&
|
|
1624
|
+
ft(() => {
|
|
1625
|
+
s && mr(r(...s), t) && e(null, ...s);
|
|
1608
1626
|
});
|
|
1609
1627
|
};
|
|
1610
1628
|
}), t;
|
|
1611
1629
|
}
|
|
1612
|
-
const
|
|
1613
|
-
typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(
|
|
1614
|
-
function
|
|
1630
|
+
const Ii = "5";
|
|
1631
|
+
typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(Ii);
|
|
1632
|
+
function Di(t) {
|
|
1615
1633
|
return t;
|
|
1616
1634
|
}
|
|
1617
|
-
function
|
|
1635
|
+
function Ct(t) {
|
|
1618
1636
|
return -0.5 * (Math.cos(Math.PI * t) - 1);
|
|
1619
1637
|
}
|
|
1620
|
-
function
|
|
1638
|
+
function Oi(t) {
|
|
1621
1639
|
const e = Math.cos(t * Math.PI * 0.5);
|
|
1622
1640
|
return Math.abs(e) < 1e-14 ? 1 : 1 - e;
|
|
1623
1641
|
}
|
|
1624
|
-
function
|
|
1642
|
+
function Fi(t) {
|
|
1625
1643
|
return Math.sin(t * Math.PI / 2);
|
|
1626
1644
|
}
|
|
1627
|
-
const
|
|
1628
|
-
class
|
|
1645
|
+
const Ri = 128, Ni = 0, ji = 1, zi = 2;
|
|
1646
|
+
class Bi {
|
|
1629
1647
|
animationsStarted = !1;
|
|
1630
1648
|
animationsCount = 0;
|
|
1631
|
-
animationsLimit =
|
|
1649
|
+
animationsLimit = Ri;
|
|
1632
1650
|
layers = new Array();
|
|
1633
1651
|
start() {
|
|
1634
1652
|
window.requestAnimationFrame(this.tick.bind(this));
|
|
@@ -1637,12 +1655,12 @@ class Pi {
|
|
|
1637
1655
|
try {
|
|
1638
1656
|
this.animationsCount = 0;
|
|
1639
1657
|
for (let e = 0; e < this.layers.length; e++) {
|
|
1640
|
-
const
|
|
1641
|
-
if (
|
|
1642
|
-
const
|
|
1643
|
-
if (
|
|
1644
|
-
for (let i = 0; i <
|
|
1645
|
-
const s =
|
|
1658
|
+
const r = this.layers[e];
|
|
1659
|
+
if (r == null) continue;
|
|
1660
|
+
const n = r.animations;
|
|
1661
|
+
if (n != null)
|
|
1662
|
+
for (let i = 0; i < n.length; i++) {
|
|
1663
|
+
const s = n[i];
|
|
1646
1664
|
if (s != null) {
|
|
1647
1665
|
for (const o of s.values())
|
|
1648
1666
|
if (!o.executed && (o.executed = !0, o.function(), this.animationsCount++, this.animationsCount == this.animationsLimit))
|
|
@@ -1655,23 +1673,23 @@ class Pi {
|
|
|
1655
1673
|
window.requestAnimationFrame(this.tick.bind(this));
|
|
1656
1674
|
}
|
|
1657
1675
|
}
|
|
1658
|
-
equeue(e,
|
|
1676
|
+
equeue(e, r, n, i) {
|
|
1659
1677
|
let s = this.layers[e];
|
|
1660
1678
|
s == null && (s = this.layers[e] = { animations: new Array() });
|
|
1661
|
-
let o = s.animations[
|
|
1662
|
-
o == null && (o = s.animations[
|
|
1663
|
-
let
|
|
1664
|
-
o.set(
|
|
1665
|
-
}
|
|
1666
|
-
clear(e,
|
|
1667
|
-
for (let
|
|
1668
|
-
let i = this.layers[
|
|
1679
|
+
let o = s.animations[r];
|
|
1680
|
+
o == null && (o = s.animations[r] = /* @__PURE__ */ new Map());
|
|
1681
|
+
let l = { id: n, priority: r, executed: !1, function: i };
|
|
1682
|
+
o.set(n, l), this.animationsStarted == !1 && (this.animationsStarted = !0, this.start());
|
|
1683
|
+
}
|
|
1684
|
+
clear(e, r) {
|
|
1685
|
+
for (let n = 0; n < this.layers.length; n++) {
|
|
1686
|
+
let i = this.layers[n];
|
|
1669
1687
|
if (i == null) continue;
|
|
1670
1688
|
let s = i.animations[e];
|
|
1671
1689
|
if (s == null) return;
|
|
1672
|
-
let o = s.get(
|
|
1690
|
+
let o = s.get(r);
|
|
1673
1691
|
if (o == null || o.executed == !1) return;
|
|
1674
|
-
s.delete(
|
|
1692
|
+
s.delete(r);
|
|
1675
1693
|
}
|
|
1676
1694
|
}
|
|
1677
1695
|
speed() {
|
|
@@ -1684,66 +1702,66 @@ class Pi {
|
|
|
1684
1702
|
this.animationsLimit = e;
|
|
1685
1703
|
}
|
|
1686
1704
|
}
|
|
1687
|
-
const
|
|
1688
|
-
function
|
|
1705
|
+
const ae = new Bi();
|
|
1706
|
+
function yr(t) {
|
|
1689
1707
|
return Object.prototype.toString.call(t) === "[object Date]";
|
|
1690
1708
|
}
|
|
1691
|
-
function
|
|
1709
|
+
function Tt(t, e) {
|
|
1692
1710
|
if (t === e || t !== t) return () => t;
|
|
1693
|
-
const
|
|
1694
|
-
if (
|
|
1711
|
+
const r = typeof t;
|
|
1712
|
+
if (r !== typeof e || Array.isArray(t) !== Array.isArray(e))
|
|
1695
1713
|
throw new Error("Cannot interpolate values of different type");
|
|
1696
1714
|
if (Array.isArray(t)) {
|
|
1697
|
-
const
|
|
1715
|
+
const n = (
|
|
1698
1716
|
/** @type {Array<any>} */
|
|
1699
|
-
e.map((i, s) =>
|
|
1717
|
+
e.map((i, s) => Tt(
|
|
1700
1718
|
/** @type {Array<any>} */
|
|
1701
1719
|
t[s],
|
|
1702
1720
|
i
|
|
1703
1721
|
))
|
|
1704
1722
|
);
|
|
1705
|
-
return (i) =>
|
|
1723
|
+
return (i) => n.map((s) => s(i));
|
|
1706
1724
|
}
|
|
1707
|
-
if (
|
|
1725
|
+
if (r === "object") {
|
|
1708
1726
|
if (!t || !e)
|
|
1709
1727
|
throw new Error("Object cannot be null");
|
|
1710
|
-
if (
|
|
1711
|
-
const s = t.getTime(),
|
|
1712
|
-
return (
|
|
1728
|
+
if (yr(t) && yr(e)) {
|
|
1729
|
+
const s = t.getTime(), l = e.getTime() - s;
|
|
1730
|
+
return (a) => new Date(s + a * l);
|
|
1713
1731
|
}
|
|
1714
|
-
const
|
|
1715
|
-
return
|
|
1716
|
-
i[s] =
|
|
1732
|
+
const n = Object.keys(e), i = {};
|
|
1733
|
+
return n.forEach((s) => {
|
|
1734
|
+
i[s] = Tt(t[s], e[s]);
|
|
1717
1735
|
}), (s) => {
|
|
1718
1736
|
const o = {};
|
|
1719
|
-
return
|
|
1720
|
-
o[
|
|
1737
|
+
return n.forEach((l) => {
|
|
1738
|
+
o[l] = i[l](s);
|
|
1721
1739
|
}), o;
|
|
1722
1740
|
};
|
|
1723
1741
|
}
|
|
1724
|
-
if (
|
|
1725
|
-
const
|
|
1742
|
+
if (r === "number") {
|
|
1743
|
+
const n = (
|
|
1726
1744
|
/** @type {number} */
|
|
1727
1745
|
e - /** @type {number} */
|
|
1728
1746
|
t
|
|
1729
1747
|
);
|
|
1730
|
-
return (i) => t + i *
|
|
1748
|
+
return (i) => t + i * n;
|
|
1731
1749
|
}
|
|
1732
1750
|
return () => e;
|
|
1733
1751
|
}
|
|
1734
|
-
class
|
|
1752
|
+
class Vt {
|
|
1735
1753
|
#e;
|
|
1736
1754
|
#t;
|
|
1737
1755
|
/** @type {TweenedOptions<T>} */
|
|
1738
1756
|
#a;
|
|
1739
1757
|
/** @type {import('../internal/client/types').Task | null} */
|
|
1740
|
-
#
|
|
1758
|
+
#n = null;
|
|
1741
1759
|
/**
|
|
1742
1760
|
* @param {T} value
|
|
1743
1761
|
* @param {TweenedOptions<T>} options
|
|
1744
1762
|
*/
|
|
1745
|
-
constructor(e,
|
|
1746
|
-
this.#e = /* @__PURE__ */
|
|
1763
|
+
constructor(e, r = {}) {
|
|
1764
|
+
this.#e = /* @__PURE__ */ C(e), this.#t = /* @__PURE__ */ C(e), this.#a = r;
|
|
1747
1765
|
}
|
|
1748
1766
|
/**
|
|
1749
1767
|
* Create a tween whose value is bound to the return value of `fn`. This must be called
|
|
@@ -1762,11 +1780,11 @@ class zt {
|
|
|
1762
1780
|
* @param {() => U} fn
|
|
1763
1781
|
* @param {TweenedOptions<U>} [options]
|
|
1764
1782
|
*/
|
|
1765
|
-
static of(e,
|
|
1766
|
-
const
|
|
1767
|
-
return
|
|
1768
|
-
|
|
1769
|
-
}),
|
|
1783
|
+
static of(e, r) {
|
|
1784
|
+
const n = new Vt(e(), r);
|
|
1785
|
+
return Ht(() => {
|
|
1786
|
+
n.set(e());
|
|
1787
|
+
}), n;
|
|
1770
1788
|
}
|
|
1771
1789
|
/**
|
|
1772
1790
|
* Sets `tween.target` to `value` and returns a `Promise` that resolves if and when `tween.current` catches up to it.
|
|
@@ -1776,50 +1794,50 @@ class zt {
|
|
|
1776
1794
|
* @param {TweenedOptions<T>} [options]
|
|
1777
1795
|
* @returns
|
|
1778
1796
|
*/
|
|
1779
|
-
set(e,
|
|
1780
|
-
|
|
1797
|
+
set(e, r) {
|
|
1798
|
+
P(this.#t, e);
|
|
1781
1799
|
let {
|
|
1782
|
-
delay:
|
|
1800
|
+
delay: n = 0,
|
|
1783
1801
|
duration: i = 400,
|
|
1784
|
-
easing: s =
|
|
1785
|
-
interpolate: o =
|
|
1786
|
-
} = { ...this.#a, ...
|
|
1802
|
+
easing: s = Di,
|
|
1803
|
+
interpolate: o = Tt
|
|
1804
|
+
} = { ...this.#a, ...r };
|
|
1787
1805
|
if (i === 0)
|
|
1788
|
-
return this.#
|
|
1789
|
-
const
|
|
1790
|
-
let
|
|
1791
|
-
return this.#
|
|
1792
|
-
if (h <
|
|
1806
|
+
return this.#n?.abort(), P(this.#e, e), Promise.resolve();
|
|
1807
|
+
const l = Q.now() + n;
|
|
1808
|
+
let a, u = !1, f = this.#n;
|
|
1809
|
+
return this.#n = Li((h) => {
|
|
1810
|
+
if (h < l)
|
|
1793
1811
|
return !0;
|
|
1794
1812
|
if (!u) {
|
|
1795
1813
|
u = !0;
|
|
1796
1814
|
const c = this.#e.v;
|
|
1797
|
-
|
|
1815
|
+
a = o(c, e), typeof i == "function" && (i = i(c, e)), f?.abort();
|
|
1798
1816
|
}
|
|
1799
|
-
const p = h -
|
|
1817
|
+
const p = h - l;
|
|
1800
1818
|
return p > /** @type {number} */
|
|
1801
|
-
i ? (
|
|
1819
|
+
i ? (P(this.#e, e), !1) : (P(this.#e, a(s(p / /** @type {number} */
|
|
1802
1820
|
i))), !0);
|
|
1803
|
-
}), this.#
|
|
1821
|
+
}), this.#n.promise;
|
|
1804
1822
|
}
|
|
1805
1823
|
get current() {
|
|
1806
|
-
return
|
|
1824
|
+
return g(this.#e);
|
|
1807
1825
|
}
|
|
1808
1826
|
get target() {
|
|
1809
|
-
return
|
|
1827
|
+
return g(this.#t);
|
|
1810
1828
|
}
|
|
1811
1829
|
set target(e) {
|
|
1812
1830
|
this.set(e);
|
|
1813
1831
|
}
|
|
1814
1832
|
}
|
|
1815
|
-
class
|
|
1833
|
+
class st {
|
|
1816
1834
|
value;
|
|
1817
1835
|
motion;
|
|
1818
|
-
constructor(e,
|
|
1819
|
-
this.value = e, this.motion = new
|
|
1836
|
+
constructor(e, r) {
|
|
1837
|
+
this.value = e, this.motion = new Vt(e, r);
|
|
1820
1838
|
}
|
|
1821
|
-
set(e,
|
|
1822
|
-
this.value = e, this.motion.set(e,
|
|
1839
|
+
set(e, r) {
|
|
1840
|
+
this.value = e, this.motion.set(e, r);
|
|
1823
1841
|
}
|
|
1824
1842
|
update(e) {
|
|
1825
1843
|
this.motion.set(this.value, e);
|
|
@@ -1828,319 +1846,183 @@ class et {
|
|
|
1828
1846
|
this.motion.set(this.value, { duration: 0 });
|
|
1829
1847
|
}
|
|
1830
1848
|
}
|
|
1831
|
-
var
|
|
1832
|
-
function
|
|
1833
|
-
|
|
1834
|
-
let n,
|
|
1835
|
-
function
|
|
1836
|
-
return
|
|
1849
|
+
var Ui = /* @__PURE__ */ Gr("<div></div>");
|
|
1850
|
+
function Zi(t, e) {
|
|
1851
|
+
zt(e, !0);
|
|
1852
|
+
let r = e.style.width, n = e.style.height, i = e.style.radius, s = e.colors?.background ?? "darkgreen", o = e.colors?.border ?? "white", l = e.colors?.shadow ?? "0px 2px 2px rgba(0, 0, 0, 0.5)", a;
|
|
1853
|
+
function u() {
|
|
1854
|
+
return a;
|
|
1837
1855
|
}
|
|
1838
|
-
let
|
|
1839
|
-
function
|
|
1840
|
-
|
|
1841
|
-
}
|
|
1842
|
-
function a() {
|
|
1843
|
-
return _(s);
|
|
1844
|
-
}
|
|
1845
|
-
let l = /* @__PURE__ */ A(!0), u = 0, f = 150;
|
|
1846
|
-
function h(b) {
|
|
1847
|
-
b != _(l) && (x(l, b, !0), u = performance.now());
|
|
1856
|
+
let f = /* @__PURE__ */ C(!1);
|
|
1857
|
+
function h(E) {
|
|
1858
|
+
P(f, E, !0);
|
|
1848
1859
|
}
|
|
1849
1860
|
function p() {
|
|
1850
|
-
return
|
|
1851
|
-
}
|
|
1852
|
-
let c = 0, d =
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
}
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
});
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
});
|
|
1864
|
-
}
|
|
1865
|
-
|
|
1866
|
-
b != c && (c = b, d.set(b, { duration: 75 }));
|
|
1867
|
-
}
|
|
1868
|
-
function V() {
|
|
1869
|
-
return d.value;
|
|
1870
|
-
}
|
|
1871
|
-
var w = {
|
|
1872
|
-
getBody: i,
|
|
1873
|
-
setDisplayed: o,
|
|
1874
|
-
getDisplayed: a,
|
|
1875
|
-
setCollapsed: h,
|
|
1876
|
-
getCollapsed: p,
|
|
1877
|
-
setScale: I,
|
|
1878
|
-
getScale: V
|
|
1879
|
-
}, fe = Si(), ne = _t(fe);
|
|
1880
|
-
return Ee(
|
|
1881
|
-
ne,
|
|
1882
|
-
(b) => (
|
|
1883
|
-
//#endregion
|
|
1884
|
-
r = b
|
|
1885
|
-
),
|
|
1886
|
-
() => r
|
|
1887
|
-
), Ee(fe, (b) => n = b, () => n), xn(() => {
|
|
1888
|
-
Bn(fe, 1, jn(["pin", _(s) && "displayed"]), "svelte-zz3jrb"), it(fe, `width: ${e.width}px; height: ${e.height}px; border-radius: ${e.radius}px`), it(ne, `width: ${e.width - 4}px; height: ${e.height - 4}px; border-radius: ${e.radius - 2}px`);
|
|
1889
|
-
}), Nn(t, fe), Lt(w);
|
|
1890
|
-
}
|
|
1891
|
-
var Ne;
|
|
1892
|
-
((t) => {
|
|
1893
|
-
function e(n, r, i) {
|
|
1894
|
-
const s = n / 2, o = r / 2, a = Math.sqrt(s * s + o * o), l = Math.atan(o / s) * (180 / Math.PI), u = i * (Math.PI / 180);
|
|
1895
|
-
return i < 180 ? i < 90 ? i < l ? {
|
|
1896
|
-
x: 0,
|
|
1897
|
-
y: a * Math.sin(u) - o
|
|
1898
|
-
} : {
|
|
1899
|
-
x: a * Math.cos(u) - s,
|
|
1900
|
-
y: 0
|
|
1901
|
-
} : i < 180 - l ? {
|
|
1902
|
-
x: a * Math.cos(u) - s,
|
|
1903
|
-
y: 0
|
|
1904
|
-
} : {
|
|
1905
|
-
x: -n,
|
|
1906
|
-
y: a * Math.sin(u) - o
|
|
1907
|
-
} : i < 270 ? i < 180 + l ? {
|
|
1908
|
-
x: -n,
|
|
1909
|
-
y: a * Math.sin(u) - o
|
|
1910
|
-
} : {
|
|
1911
|
-
x: a * Math.cos(u) - s,
|
|
1912
|
-
y: -r
|
|
1913
|
-
} : i < 360 - l ? {
|
|
1914
|
-
x: a * Math.cos(u) - s,
|
|
1915
|
-
y: -r
|
|
1916
|
-
} : {
|
|
1917
|
-
x: 0,
|
|
1918
|
-
y: a * Math.sin(u) - o
|
|
1919
|
-
};
|
|
1920
|
-
}
|
|
1921
|
-
t.getOffsets = e;
|
|
1922
|
-
})(Ne || (Ne = {}));
|
|
1923
|
-
var Di = /* @__PURE__ */ Rn('<div><div class="pointer svelte-11extwn"></div> <div class="bubble svelte-11extwn"><div class="body svelte-11extwn"></div></div></div>');
|
|
1924
|
-
function Zn(t, e) {
|
|
1925
|
-
Tt(e, !0);
|
|
1926
|
-
let n, r, i, s;
|
|
1927
|
-
const o = e.width + 2 * e.margin, a = e.height + 2 * e.margin, l = () => s;
|
|
1928
|
-
X(() => {
|
|
1929
|
-
i.style.width = `${e.margin * 4}px`, i.style.height = `${e.margin * 4}px`;
|
|
1861
|
+
return g(f);
|
|
1862
|
+
}
|
|
1863
|
+
let c = /* @__PURE__ */ C(!0), d = 0, w = 150;
|
|
1864
|
+
function O(E) {
|
|
1865
|
+
E != g(c) && (P(c, E, !0), d = performance.now());
|
|
1866
|
+
}
|
|
1867
|
+
function K() {
|
|
1868
|
+
return performance.now() - d < w ? V.motion.current == 0 : V.value == 0;
|
|
1869
|
+
}
|
|
1870
|
+
let b = 0, V = new st(0, { easing: Ct });
|
|
1871
|
+
J(() => {
|
|
1872
|
+
g(f) == !1 && (V.snap(), ae.clear(e.priority, e.id));
|
|
1873
|
+
}), J(() => {
|
|
1874
|
+
V.set(g(c) ? 0 : b, { duration: 75 });
|
|
1875
|
+
}), J(() => {
|
|
1876
|
+
Qe(V.motion.current);
|
|
1930
1877
|
});
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
}
|
|
1935
|
-
function h() {
|
|
1936
|
-
return _(u);
|
|
1937
|
-
}
|
|
1938
|
-
let p = /* @__PURE__ */ A(!0), c = 0, d = 300;
|
|
1939
|
-
function k(y) {
|
|
1940
|
-
y != _(p) && (x(p, y, !0), c = performance.now());
|
|
1941
|
-
}
|
|
1942
|
-
function I() {
|
|
1943
|
-
return performance.now() - c < d ? w.motion.current == 0 : w.value == 0;
|
|
1944
|
-
}
|
|
1945
|
-
function V() {
|
|
1946
|
-
return performance.now() - c < d ? w.motion.current == 1 : w.value == 1;
|
|
1947
|
-
}
|
|
1948
|
-
let w = new et(0);
|
|
1949
|
-
X(() => {
|
|
1950
|
-
_(u) == !1 && (w.snap(), ie.clear(e.priority, e.id + "_scale"));
|
|
1951
|
-
}), X(() => {
|
|
1952
|
-
_(p) == !0 && w.value != 0 && (ie.stacked() ? w.set(0, { duration: 0 }) : w.set(0, { duration: 150, easing: wi })), _(p) == !1 && w.value != 1 && w.set(1, { duration: 150, easing: Ei });
|
|
1953
|
-
}), X(() => {
|
|
1954
|
-
fe(w.motion.current);
|
|
1955
|
-
});
|
|
1956
|
-
function fe(y) {
|
|
1957
|
-
!n || !r || !i || ie.equeue(_(p) ? 0 : e.layer, e.priority, e.id + "_scale", () => {
|
|
1958
|
-
n.style.opacity = `${y}`, r.style.scale = `${y}`, i.style.scale = `${y}`;
|
|
1959
|
-
});
|
|
1960
|
-
}
|
|
1961
|
-
let ne = NaN, b = /* @__PURE__ */ A(!1), re = new et(-o / 2, { easing: wt }), Ve = new et(-a / 2, { easing: wt });
|
|
1962
|
-
X(() => {
|
|
1963
|
-
_(u) == !1 && (re.snap(), re.snap(), ie.clear(e.priority, e.id + "_angle"));
|
|
1964
|
-
}), X(() => {
|
|
1965
|
-
_(p) == !0 && _(b) && (re.update({ duration: 75 }), re.update({ duration: 75 }));
|
|
1966
|
-
}), X(() => {
|
|
1967
|
-
Ht(re.motion.current, Ve.motion.current);
|
|
1968
|
-
});
|
|
1969
|
-
function Ht(y, We) {
|
|
1970
|
-
if (!n || !r || !i) return;
|
|
1971
|
-
const $ = y + o / 2, Ge = We + a / 2, ye = a < o ? $ * a / o : $, ge = a > o ? Ge * o / a : Ge, ir = Math.atan2(ge, ye) / Math.PI * 180 - 45, Xt = 0, sr = 30, ct = Math.sqrt(ye * ye + ge * ge), Ie = Math.min(o, a) / 2, or = Ie * Math.SQRT2, ar = (ct - Ie) / (or - Ie), Wt = Xt + ar * (sr - Xt), lr = ct < Ie ? ct / Ie : 1;
|
|
1972
|
-
ie.equeue(e.layer, e.priority, e.id + "_angle", () => {
|
|
1973
|
-
r.style.transform = `translate(${Math.round(y)}px, ${Math.round(We)}px)`, i.style.transform = `scale(${lr}) rotate(${ir}deg) skew(${Wt}deg, ${Wt}deg)`;
|
|
1878
|
+
function Qe(E) {
|
|
1879
|
+
a && ae.equeue(e.layer, e.priority, e.id, () => {
|
|
1880
|
+
a.style.scale = E.toString(), a.style.filter = `brightness(${0.25 + 0.75 * E})`;
|
|
1974
1881
|
});
|
|
1975
1882
|
}
|
|
1976
|
-
function
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
setAngle: tr,
|
|
1996
|
-
getOffsets: nr
|
|
1997
|
-
}, Xe = Di(), Yt = _t(Xe);
|
|
1998
|
-
Ee(
|
|
1999
|
-
Yt,
|
|
2000
|
-
(y) => (
|
|
1883
|
+
function dt(E) {
|
|
1884
|
+
E != b && (b = E, V.set(E, { duration: 75 }));
|
|
1885
|
+
}
|
|
1886
|
+
function vt() {
|
|
1887
|
+
return V.value;
|
|
1888
|
+
}
|
|
1889
|
+
var mt = {
|
|
1890
|
+
getBody: u,
|
|
1891
|
+
setDisplayed: h,
|
|
1892
|
+
getDisplayed: p,
|
|
1893
|
+
setCollapsed: O,
|
|
1894
|
+
getCollapsed: K,
|
|
1895
|
+
setScale: dt,
|
|
1896
|
+
getScale: vt
|
|
1897
|
+
}, M = Ui();
|
|
1898
|
+
let $e;
|
|
1899
|
+
return Be(
|
|
1900
|
+
M,
|
|
1901
|
+
(E) => (
|
|
2001
1902
|
//#endregion
|
|
2002
|
-
|
|
1903
|
+
a = E
|
|
2003
1904
|
),
|
|
2004
|
-
() =>
|
|
2005
|
-
)
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
1905
|
+
() => a
|
|
1906
|
+
), jr(
|
|
1907
|
+
(E) => {
|
|
1908
|
+
$r(M, 1, Qr(["pin", g(f) && "displayed"]), "svelte-zz3jrb"), $e = ze(M, "", $e, E);
|
|
1909
|
+
},
|
|
1910
|
+
[
|
|
1911
|
+
() => ({
|
|
1912
|
+
width: `${r}px`,
|
|
1913
|
+
height: `${n}px`,
|
|
1914
|
+
"border-radius": `${i}px`,
|
|
1915
|
+
"border-color": o,
|
|
1916
|
+
"background-color": s,
|
|
1917
|
+
"box-shadow": l
|
|
1918
|
+
})
|
|
1919
|
+
]
|
|
1920
|
+
), Kr(t, M), Bt(mt);
|
|
1921
|
+
}
|
|
1922
|
+
class Je {
|
|
1923
|
+
provider;
|
|
1924
|
+
providerMarker;
|
|
1925
|
+
id;
|
|
1926
|
+
lat;
|
|
1927
|
+
lng;
|
|
1928
|
+
shown;
|
|
1929
|
+
element;
|
|
1930
|
+
component;
|
|
1931
|
+
constructor(e, r) {
|
|
1932
|
+
if (new.target === Je)
|
|
1933
|
+
throw new Error("Cannot instantiate an abstract class directly.");
|
|
1934
|
+
this.provider = e, this.id = r.id, this.lat = r.lat, this.lng = r.lng, this.shown = !0;
|
|
2031
1935
|
}
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
var be;
|
|
2035
|
-
((t) => {
|
|
2036
|
-
function e(a, l, u) {
|
|
2037
|
-
return {
|
|
2038
|
-
x: r(l) * u,
|
|
2039
|
-
y: i(a) * u
|
|
2040
|
-
};
|
|
1936
|
+
create() {
|
|
1937
|
+
this.createElement(), this.createMarker(), this.setZIndex();
|
|
2041
1938
|
}
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
return {
|
|
2045
|
-
lat: o(l / u),
|
|
2046
|
-
lng: s(a / u)
|
|
2047
|
-
};
|
|
1939
|
+
remove() {
|
|
1940
|
+
this.removeMarker();
|
|
2048
1941
|
}
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
return (180 + a) / 360;
|
|
1942
|
+
createElement() {
|
|
1943
|
+
throw new Error("Create element not implemented");
|
|
2052
1944
|
}
|
|
2053
|
-
|
|
2054
|
-
|
|
1945
|
+
createMarker() {
|
|
1946
|
+
const e = this.element;
|
|
1947
|
+
if (!e) throw new Error("Failed to create provider marker");
|
|
1948
|
+
this.providerMarker = this.provider.createMarker(e, this.lat, this.lng, this.getZindex());
|
|
2055
1949
|
}
|
|
2056
|
-
|
|
2057
|
-
|
|
1950
|
+
updateMarker(e) {
|
|
1951
|
+
if (this.providerMarker == null) throw new Error("Failed to update provider marker map");
|
|
1952
|
+
e ? this.providerMarker.inserted() == !1 && this.providerMarker.insert() : this.providerMarker.inserted() == !0 && this.providerMarker.remove();
|
|
2058
1953
|
}
|
|
2059
|
-
|
|
2060
|
-
|
|
1954
|
+
removeMarker() {
|
|
1955
|
+
this.providerMarker?.remove();
|
|
2061
1956
|
}
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
swLng;
|
|
2066
|
-
neLat;
|
|
2067
|
-
neLng;
|
|
2068
|
-
/**
|
|
2069
|
-
* @param mapBounds - The bounds of the map.
|
|
2070
|
-
* @param mapZoom - The zoom level of the map.
|
|
2071
|
-
* @param mapSize - The size of the map in pixels at zoom level 0.
|
|
2072
|
-
* @param offsetX - The x offset of the map in pixels at zoom level n.
|
|
2073
|
-
* @param offsetY - The y offset of the map in pixels at zoom level n.
|
|
2074
|
-
*/
|
|
2075
|
-
constructor(e, n, r, i, s) {
|
|
2076
|
-
const o = r * Math.pow(2, n), a = be.project(e.sw.lat, e.sw.lng, o), l = be.project(e.ne.lat, e.ne.lng, o), u = a.x - i, f = a.y + s, h = l.x + i, p = l.y - s, c = be.unproject(u, f, o), d = be.unproject(h, p, o);
|
|
2077
|
-
this.swLat = c.lat, this.swLng = c.lng, this.neLat = d.lat, this.neLng = d.lng;
|
|
1957
|
+
setZIndex() {
|
|
1958
|
+
if (this.providerMarker == null) throw new Error("Failed to update provider marker z-index");
|
|
1959
|
+
this.providerMarker.update(this.getZindex());
|
|
2078
1960
|
}
|
|
2079
|
-
|
|
2080
|
-
|
|
1961
|
+
getZindex() {
|
|
1962
|
+
throw new Error("Get z-index not implemented");
|
|
2081
1963
|
}
|
|
2082
1964
|
}
|
|
2083
|
-
var
|
|
1965
|
+
var bt;
|
|
2084
1966
|
// @__NO_SIDE_EFFECTS__
|
|
2085
|
-
function
|
|
1967
|
+
function tn(t) {
|
|
2086
1968
|
return {
|
|
2087
|
-
lang: t?.lang ??
|
|
1969
|
+
lang: t?.lang ?? bt?.lang,
|
|
2088
1970
|
message: t?.message,
|
|
2089
|
-
abortEarly: t?.abortEarly ??
|
|
2090
|
-
abortPipeEarly: t?.abortPipeEarly ??
|
|
1971
|
+
abortEarly: t?.abortEarly ?? bt?.abortEarly,
|
|
1972
|
+
abortPipeEarly: t?.abortPipeEarly ?? bt?.abortPipeEarly
|
|
2091
1973
|
};
|
|
2092
1974
|
}
|
|
2093
|
-
var
|
|
1975
|
+
var qi;
|
|
2094
1976
|
// @__NO_SIDE_EFFECTS__
|
|
2095
|
-
function
|
|
2096
|
-
return
|
|
1977
|
+
function Hi(t) {
|
|
1978
|
+
return qi?.get(t);
|
|
2097
1979
|
}
|
|
2098
|
-
var
|
|
1980
|
+
var Yi;
|
|
2099
1981
|
// @__NO_SIDE_EFFECTS__
|
|
2100
|
-
function
|
|
2101
|
-
return
|
|
1982
|
+
function Vi(t) {
|
|
1983
|
+
return Yi?.get(t);
|
|
2102
1984
|
}
|
|
2103
|
-
var
|
|
1985
|
+
var Xi;
|
|
2104
1986
|
// @__NO_SIDE_EFFECTS__
|
|
2105
|
-
function
|
|
2106
|
-
return
|
|
1987
|
+
function Wi(t, e) {
|
|
1988
|
+
return Xi?.get(t)?.get(e);
|
|
2107
1989
|
}
|
|
2108
1990
|
// @__NO_SIDE_EFFECTS__
|
|
2109
|
-
function
|
|
1991
|
+
function Ke(t) {
|
|
2110
1992
|
const e = typeof t;
|
|
2111
1993
|
return e === "string" ? `"${t}"` : e === "number" || e === "bigint" || e === "boolean" ? `${t}` : e === "object" || e === "function" ? (t && Object.getPrototypeOf(t)?.constructor?.name) ?? "null" : e;
|
|
2112
1994
|
}
|
|
2113
|
-
function
|
|
2114
|
-
const s = i && "input" in i ? i.input :
|
|
1995
|
+
function S(t, e, r, n, i) {
|
|
1996
|
+
const s = i && "input" in i ? i.input : r.value, o = i?.expected ?? t.expects ?? null, l = i?.received ?? /* @__PURE__ */ Ke(s), a = {
|
|
2115
1997
|
kind: t.kind,
|
|
2116
1998
|
type: t.type,
|
|
2117
1999
|
input: s,
|
|
2118
2000
|
expected: o,
|
|
2119
|
-
received:
|
|
2120
|
-
message: `Invalid ${e}: ${o ? `Expected ${o} but r` : "R"}eceived ${
|
|
2001
|
+
received: l,
|
|
2002
|
+
message: `Invalid ${e}: ${o ? `Expected ${o} but r` : "R"}eceived ${l}`,
|
|
2121
2003
|
requirement: t.requirement,
|
|
2122
2004
|
path: i?.path,
|
|
2123
2005
|
issues: i?.issues,
|
|
2124
|
-
lang:
|
|
2125
|
-
abortEarly:
|
|
2126
|
-
abortPipeEarly:
|
|
2127
|
-
}, u = t.kind === "schema", f = i?.message ?? t.message ?? /* @__PURE__ */
|
|
2128
|
-
f !== void 0 && (
|
|
2006
|
+
lang: n.lang,
|
|
2007
|
+
abortEarly: n.abortEarly,
|
|
2008
|
+
abortPipeEarly: n.abortPipeEarly
|
|
2009
|
+
}, u = t.kind === "schema", f = i?.message ?? t.message ?? /* @__PURE__ */ Wi(t.reference, a.lang) ?? (u ? /* @__PURE__ */ Vi(a.lang) : null) ?? n.message ?? /* @__PURE__ */ Hi(a.lang);
|
|
2010
|
+
f !== void 0 && (a.message = typeof f == "function" ? (
|
|
2129
2011
|
// @ts-expect-error
|
|
2130
|
-
f(
|
|
2131
|
-
) : f), u && (
|
|
2012
|
+
f(a)
|
|
2013
|
+
) : f), u && (r.typed = !1), r.issues ? r.issues.push(a) : r.issues = [a];
|
|
2132
2014
|
}
|
|
2133
2015
|
// @__NO_SIDE_EFFECTS__
|
|
2134
|
-
function
|
|
2016
|
+
function N(t) {
|
|
2135
2017
|
return {
|
|
2136
2018
|
version: 1,
|
|
2137
2019
|
vendor: "valibot",
|
|
2138
2020
|
validate(e) {
|
|
2139
|
-
return t["~run"]({ value: e }, /* @__PURE__ */
|
|
2021
|
+
return t["~run"]({ value: e }, /* @__PURE__ */ tn());
|
|
2140
2022
|
}
|
|
2141
2023
|
};
|
|
2142
2024
|
}
|
|
2143
|
-
var
|
|
2025
|
+
var ht = class extends Error {
|
|
2144
2026
|
/**
|
|
2145
2027
|
* Creates a Valibot error with useful information.
|
|
2146
2028
|
*
|
|
@@ -2158,23 +2040,23 @@ function z(t) {
|
|
|
2158
2040
|
reference: z,
|
|
2159
2041
|
async: !1,
|
|
2160
2042
|
schema: t,
|
|
2161
|
-
"~run"(e,
|
|
2162
|
-
const
|
|
2043
|
+
"~run"(e, r) {
|
|
2044
|
+
const n = e.value;
|
|
2163
2045
|
return e.value = (...i) => {
|
|
2164
|
-
const s = this.schema["~run"]({ value: i },
|
|
2046
|
+
const s = this.schema["~run"]({ value: i }, r);
|
|
2165
2047
|
if (s.issues)
|
|
2166
|
-
throw new
|
|
2167
|
-
return
|
|
2048
|
+
throw new ht(s.issues);
|
|
2049
|
+
return n(...s.value);
|
|
2168
2050
|
}, e;
|
|
2169
2051
|
}
|
|
2170
2052
|
};
|
|
2171
2053
|
}
|
|
2172
2054
|
// @__NO_SIDE_EFFECTS__
|
|
2173
|
-
function
|
|
2055
|
+
function rn() {
|
|
2174
2056
|
return {
|
|
2175
2057
|
kind: "transformation",
|
|
2176
2058
|
type: "await",
|
|
2177
|
-
reference:
|
|
2059
|
+
reference: rn,
|
|
2178
2060
|
async: !0,
|
|
2179
2061
|
async "~run"(t) {
|
|
2180
2062
|
return t.value = await t.value, t;
|
|
@@ -2182,307 +2064,307 @@ function Yn() {
|
|
|
2182
2064
|
};
|
|
2183
2065
|
}
|
|
2184
2066
|
// @__NO_SIDE_EFFECTS__
|
|
2185
|
-
function
|
|
2067
|
+
function nn(t, e) {
|
|
2186
2068
|
return {
|
|
2187
2069
|
kind: "validation",
|
|
2188
2070
|
type: "check",
|
|
2189
|
-
reference:
|
|
2071
|
+
reference: nn,
|
|
2190
2072
|
async: !1,
|
|
2191
2073
|
expects: null,
|
|
2192
2074
|
requirement: t,
|
|
2193
2075
|
message: e,
|
|
2194
|
-
"~run"(
|
|
2195
|
-
return
|
|
2076
|
+
"~run"(r, n) {
|
|
2077
|
+
return r.typed && !this.requirement(r.value) && S(this, "input", r, n), r;
|
|
2196
2078
|
}
|
|
2197
2079
|
};
|
|
2198
2080
|
}
|
|
2199
2081
|
// @__NO_SIDE_EFFECTS__
|
|
2200
|
-
function
|
|
2082
|
+
function sn(t, e) {
|
|
2201
2083
|
return {
|
|
2202
2084
|
kind: "validation",
|
|
2203
2085
|
type: "length",
|
|
2204
|
-
reference:
|
|
2086
|
+
reference: sn,
|
|
2205
2087
|
async: !1,
|
|
2206
2088
|
expects: `${t}`,
|
|
2207
2089
|
requirement: t,
|
|
2208
2090
|
message: e,
|
|
2209
|
-
"~run"(
|
|
2210
|
-
return
|
|
2211
|
-
received: `${
|
|
2212
|
-
}),
|
|
2091
|
+
"~run"(r, n) {
|
|
2092
|
+
return r.typed && r.value.length !== this.requirement && S(this, "length", r, n, {
|
|
2093
|
+
received: `${r.value.length}`
|
|
2094
|
+
}), r;
|
|
2213
2095
|
}
|
|
2214
2096
|
};
|
|
2215
2097
|
}
|
|
2216
2098
|
// @__NO_SIDE_EFFECTS__
|
|
2217
|
-
function
|
|
2099
|
+
function Le(t, e) {
|
|
2218
2100
|
return {
|
|
2219
2101
|
kind: "validation",
|
|
2220
2102
|
type: "max_value",
|
|
2221
|
-
reference:
|
|
2103
|
+
reference: Le,
|
|
2222
2104
|
async: !1,
|
|
2223
|
-
expects: `<=${t instanceof Date ? t.toJSON() : /* @__PURE__ */
|
|
2105
|
+
expects: `<=${t instanceof Date ? t.toJSON() : /* @__PURE__ */ Ke(t)}`,
|
|
2224
2106
|
requirement: t,
|
|
2225
2107
|
message: e,
|
|
2226
|
-
"~run"(
|
|
2227
|
-
return
|
|
2228
|
-
received:
|
|
2229
|
-
}),
|
|
2108
|
+
"~run"(r, n) {
|
|
2109
|
+
return r.typed && !(r.value <= this.requirement) && S(this, "value", r, n, {
|
|
2110
|
+
received: r.value instanceof Date ? r.value.toJSON() : /* @__PURE__ */ Ke(r.value)
|
|
2111
|
+
}), r;
|
|
2230
2112
|
}
|
|
2231
2113
|
};
|
|
2232
2114
|
}
|
|
2233
2115
|
// @__NO_SIDE_EFFECTS__
|
|
2234
|
-
function
|
|
2116
|
+
function Xt(t, e) {
|
|
2235
2117
|
return {
|
|
2236
2118
|
kind: "validation",
|
|
2237
2119
|
type: "min_length",
|
|
2238
|
-
reference:
|
|
2120
|
+
reference: Xt,
|
|
2239
2121
|
async: !1,
|
|
2240
2122
|
expects: `>=${t}`,
|
|
2241
2123
|
requirement: t,
|
|
2242
2124
|
message: e,
|
|
2243
|
-
"~run"(
|
|
2244
|
-
return
|
|
2245
|
-
received: `${
|
|
2246
|
-
}),
|
|
2125
|
+
"~run"(r, n) {
|
|
2126
|
+
return r.typed && r.value.length < this.requirement && S(this, "length", r, n, {
|
|
2127
|
+
received: `${r.value.length}`
|
|
2128
|
+
}), r;
|
|
2247
2129
|
}
|
|
2248
2130
|
};
|
|
2249
2131
|
}
|
|
2250
2132
|
// @__NO_SIDE_EFFECTS__
|
|
2251
|
-
function
|
|
2133
|
+
function $(t, e) {
|
|
2252
2134
|
return {
|
|
2253
2135
|
kind: "validation",
|
|
2254
2136
|
type: "min_value",
|
|
2255
|
-
reference:
|
|
2137
|
+
reference: $,
|
|
2256
2138
|
async: !1,
|
|
2257
|
-
expects: `>=${t instanceof Date ? t.toJSON() : /* @__PURE__ */
|
|
2139
|
+
expects: `>=${t instanceof Date ? t.toJSON() : /* @__PURE__ */ Ke(t)}`,
|
|
2258
2140
|
requirement: t,
|
|
2259
2141
|
message: e,
|
|
2260
|
-
"~run"(
|
|
2261
|
-
return
|
|
2262
|
-
received:
|
|
2263
|
-
}),
|
|
2142
|
+
"~run"(r, n) {
|
|
2143
|
+
return r.typed && !(r.value >= this.requirement) && S(this, "value", r, n, {
|
|
2144
|
+
received: r.value instanceof Date ? r.value.toJSON() : /* @__PURE__ */ Ke(r.value)
|
|
2145
|
+
}), r;
|
|
2264
2146
|
}
|
|
2265
2147
|
};
|
|
2266
2148
|
}
|
|
2267
2149
|
// @__NO_SIDE_EFFECTS__
|
|
2268
|
-
function
|
|
2150
|
+
function W(t) {
|
|
2269
2151
|
return {
|
|
2270
2152
|
kind: "transformation",
|
|
2271
2153
|
type: "returns",
|
|
2272
|
-
reference:
|
|
2154
|
+
reference: W,
|
|
2273
2155
|
async: !1,
|
|
2274
2156
|
schema: t,
|
|
2275
|
-
"~run"(e,
|
|
2276
|
-
const
|
|
2157
|
+
"~run"(e, r) {
|
|
2158
|
+
const n = e.value;
|
|
2277
2159
|
return e.value = (...i) => {
|
|
2278
2160
|
const s = this.schema["~run"](
|
|
2279
|
-
{ value:
|
|
2280
|
-
|
|
2161
|
+
{ value: n(...i) },
|
|
2162
|
+
r
|
|
2281
2163
|
);
|
|
2282
2164
|
if (s.issues)
|
|
2283
|
-
throw new
|
|
2165
|
+
throw new ht(s.issues);
|
|
2284
2166
|
return s.value;
|
|
2285
2167
|
}, e;
|
|
2286
2168
|
}
|
|
2287
2169
|
};
|
|
2288
2170
|
}
|
|
2289
2171
|
// @__NO_SIDE_EFFECTS__
|
|
2290
|
-
function
|
|
2172
|
+
function on(t) {
|
|
2291
2173
|
return {
|
|
2292
2174
|
kind: "transformation",
|
|
2293
2175
|
type: "returns",
|
|
2294
|
-
reference:
|
|
2176
|
+
reference: on,
|
|
2295
2177
|
async: !1,
|
|
2296
2178
|
schema: t,
|
|
2297
|
-
"~run"(e,
|
|
2298
|
-
const
|
|
2179
|
+
"~run"(e, r) {
|
|
2180
|
+
const n = e.value;
|
|
2299
2181
|
return e.value = async (...i) => {
|
|
2300
2182
|
const s = await this.schema["~run"](
|
|
2301
|
-
{ value: await
|
|
2302
|
-
|
|
2183
|
+
{ value: await n(...i) },
|
|
2184
|
+
r
|
|
2303
2185
|
);
|
|
2304
2186
|
if (s.issues)
|
|
2305
|
-
throw new
|
|
2187
|
+
throw new ht(s.issues);
|
|
2306
2188
|
return s.value;
|
|
2307
2189
|
}, e;
|
|
2308
2190
|
}
|
|
2309
2191
|
};
|
|
2310
2192
|
}
|
|
2311
2193
|
// @__NO_SIDE_EFFECTS__
|
|
2312
|
-
function
|
|
2194
|
+
function Gi(t, e, r) {
|
|
2313
2195
|
return typeof t.fallback == "function" ? (
|
|
2314
2196
|
// @ts-expect-error
|
|
2315
|
-
t.fallback(e,
|
|
2197
|
+
t.fallback(e, r)
|
|
2316
2198
|
) : (
|
|
2317
2199
|
// @ts-expect-error
|
|
2318
2200
|
t.fallback
|
|
2319
2201
|
);
|
|
2320
2202
|
}
|
|
2321
2203
|
// @__NO_SIDE_EFFECTS__
|
|
2322
|
-
function
|
|
2204
|
+
function an(t, e, r) {
|
|
2323
2205
|
return typeof t.default == "function" ? (
|
|
2324
2206
|
// @ts-expect-error
|
|
2325
|
-
t.default(e,
|
|
2207
|
+
t.default(e, r)
|
|
2326
2208
|
) : (
|
|
2327
2209
|
// @ts-expect-error
|
|
2328
2210
|
t.default
|
|
2329
2211
|
);
|
|
2330
2212
|
}
|
|
2331
2213
|
// @__NO_SIDE_EFFECTS__
|
|
2332
|
-
function
|
|
2214
|
+
function ln(t, e) {
|
|
2333
2215
|
return {
|
|
2334
2216
|
kind: "schema",
|
|
2335
2217
|
type: "array",
|
|
2336
|
-
reference:
|
|
2218
|
+
reference: ln,
|
|
2337
2219
|
expects: "Array",
|
|
2338
2220
|
async: !1,
|
|
2339
2221
|
item: t,
|
|
2340
2222
|
message: e,
|
|
2341
2223
|
get "~standard"() {
|
|
2342
|
-
return /* @__PURE__ */
|
|
2224
|
+
return /* @__PURE__ */ N(this);
|
|
2343
2225
|
},
|
|
2344
|
-
"~run"(
|
|
2345
|
-
const i =
|
|
2226
|
+
"~run"(r, n) {
|
|
2227
|
+
const i = r.value;
|
|
2346
2228
|
if (Array.isArray(i)) {
|
|
2347
|
-
|
|
2229
|
+
r.typed = !0, r.value = [];
|
|
2348
2230
|
for (let s = 0; s < i.length; s++) {
|
|
2349
|
-
const o = i[s],
|
|
2350
|
-
if (
|
|
2351
|
-
const
|
|
2231
|
+
const o = i[s], l = this.item["~run"]({ value: o }, n);
|
|
2232
|
+
if (l.issues) {
|
|
2233
|
+
const a = {
|
|
2352
2234
|
type: "array",
|
|
2353
2235
|
origin: "value",
|
|
2354
2236
|
input: i,
|
|
2355
2237
|
key: s,
|
|
2356
2238
|
value: o
|
|
2357
2239
|
};
|
|
2358
|
-
for (const u of
|
|
2359
|
-
u.path ? u.path.unshift(
|
|
2360
|
-
if (
|
|
2361
|
-
|
|
2240
|
+
for (const u of l.issues)
|
|
2241
|
+
u.path ? u.path.unshift(a) : u.path = [a], r.issues?.push(u);
|
|
2242
|
+
if (r.issues || (r.issues = l.issues), n.abortEarly) {
|
|
2243
|
+
r.typed = !1;
|
|
2362
2244
|
break;
|
|
2363
2245
|
}
|
|
2364
2246
|
}
|
|
2365
|
-
|
|
2247
|
+
l.typed || (r.typed = !1), r.value.push(l.value);
|
|
2366
2248
|
}
|
|
2367
2249
|
} else
|
|
2368
|
-
|
|
2369
|
-
return
|
|
2250
|
+
S(this, "type", r, n);
|
|
2251
|
+
return r;
|
|
2370
2252
|
}
|
|
2371
2253
|
};
|
|
2372
2254
|
}
|
|
2373
2255
|
// @__NO_SIDE_EFFECTS__
|
|
2374
|
-
function
|
|
2256
|
+
function un(t) {
|
|
2375
2257
|
return {
|
|
2376
2258
|
kind: "schema",
|
|
2377
2259
|
type: "boolean",
|
|
2378
|
-
reference:
|
|
2260
|
+
reference: un,
|
|
2379
2261
|
expects: "boolean",
|
|
2380
2262
|
async: !1,
|
|
2381
2263
|
message: t,
|
|
2382
2264
|
get "~standard"() {
|
|
2383
|
-
return /* @__PURE__ */
|
|
2265
|
+
return /* @__PURE__ */ N(this);
|
|
2384
2266
|
},
|
|
2385
|
-
"~run"(e,
|
|
2386
|
-
return typeof e.value == "boolean" ? e.typed = !0 :
|
|
2267
|
+
"~run"(e, r) {
|
|
2268
|
+
return typeof e.value == "boolean" ? e.typed = !0 : S(this, "type", e, r), e;
|
|
2387
2269
|
}
|
|
2388
2270
|
};
|
|
2389
2271
|
}
|
|
2390
2272
|
// @__NO_SIDE_EFFECTS__
|
|
2391
|
-
function
|
|
2273
|
+
function fn(t, e) {
|
|
2392
2274
|
return {
|
|
2393
2275
|
kind: "schema",
|
|
2394
2276
|
type: "custom",
|
|
2395
|
-
reference:
|
|
2277
|
+
reference: fn,
|
|
2396
2278
|
expects: "unknown",
|
|
2397
2279
|
async: !1,
|
|
2398
2280
|
check: t,
|
|
2399
2281
|
message: e,
|
|
2400
2282
|
get "~standard"() {
|
|
2401
|
-
return /* @__PURE__ */
|
|
2283
|
+
return /* @__PURE__ */ N(this);
|
|
2402
2284
|
},
|
|
2403
|
-
"~run"(
|
|
2404
|
-
return this.check(
|
|
2285
|
+
"~run"(r, n) {
|
|
2286
|
+
return this.check(r.value) ? r.typed = !0 : S(this, "type", r, n), r;
|
|
2405
2287
|
}
|
|
2406
2288
|
};
|
|
2407
2289
|
}
|
|
2408
2290
|
// @__NO_SIDE_EFFECTS__
|
|
2409
|
-
function
|
|
2291
|
+
function B(t) {
|
|
2410
2292
|
return {
|
|
2411
2293
|
kind: "schema",
|
|
2412
2294
|
type: "function",
|
|
2413
|
-
reference:
|
|
2295
|
+
reference: B,
|
|
2414
2296
|
expects: "Function",
|
|
2415
2297
|
async: !1,
|
|
2416
2298
|
message: t,
|
|
2417
2299
|
get "~standard"() {
|
|
2418
|
-
return /* @__PURE__ */
|
|
2300
|
+
return /* @__PURE__ */ N(this);
|
|
2419
2301
|
},
|
|
2420
|
-
"~run"(e,
|
|
2421
|
-
return typeof e.value == "function" ? e.typed = !0 :
|
|
2302
|
+
"~run"(e, r) {
|
|
2303
|
+
return typeof e.value == "function" ? e.typed = !0 : S(this, "type", e, r), e;
|
|
2422
2304
|
}
|
|
2423
2305
|
};
|
|
2424
2306
|
}
|
|
2425
2307
|
// @__NO_SIDE_EFFECTS__
|
|
2426
|
-
function
|
|
2308
|
+
function k(t) {
|
|
2427
2309
|
return {
|
|
2428
2310
|
kind: "schema",
|
|
2429
2311
|
type: "number",
|
|
2430
|
-
reference:
|
|
2312
|
+
reference: k,
|
|
2431
2313
|
expects: "number",
|
|
2432
2314
|
async: !1,
|
|
2433
2315
|
message: t,
|
|
2434
2316
|
get "~standard"() {
|
|
2435
|
-
return /* @__PURE__ */
|
|
2317
|
+
return /* @__PURE__ */ N(this);
|
|
2436
2318
|
},
|
|
2437
|
-
"~run"(e,
|
|
2438
|
-
return typeof e.value == "number" && !isNaN(e.value) ? e.typed = !0 :
|
|
2319
|
+
"~run"(e, r) {
|
|
2320
|
+
return typeof e.value == "number" && !isNaN(e.value) ? e.typed = !0 : S(this, "type", e, r), e;
|
|
2439
2321
|
}
|
|
2440
2322
|
};
|
|
2441
2323
|
}
|
|
2442
2324
|
// @__NO_SIDE_EFFECTS__
|
|
2443
|
-
function
|
|
2325
|
+
function L(t, e) {
|
|
2444
2326
|
return {
|
|
2445
2327
|
kind: "schema",
|
|
2446
2328
|
type: "object",
|
|
2447
|
-
reference:
|
|
2329
|
+
reference: L,
|
|
2448
2330
|
expects: "Object",
|
|
2449
2331
|
async: !1,
|
|
2450
2332
|
entries: t,
|
|
2451
2333
|
message: e,
|
|
2452
2334
|
get "~standard"() {
|
|
2453
|
-
return /* @__PURE__ */
|
|
2335
|
+
return /* @__PURE__ */ N(this);
|
|
2454
2336
|
},
|
|
2455
|
-
"~run"(
|
|
2456
|
-
const i =
|
|
2337
|
+
"~run"(r, n) {
|
|
2338
|
+
const i = r.value;
|
|
2457
2339
|
if (i && typeof i == "object") {
|
|
2458
|
-
|
|
2340
|
+
r.typed = !0, r.value = {};
|
|
2459
2341
|
for (const s in this.entries) {
|
|
2460
2342
|
const o = this.entries[s];
|
|
2461
2343
|
if (s in i || (o.type === "exact_optional" || o.type === "optional" || o.type === "nullish") && // @ts-expect-error
|
|
2462
2344
|
o.default !== void 0) {
|
|
2463
|
-
const
|
|
2345
|
+
const l = s in i ? (
|
|
2464
2346
|
// @ts-expect-error
|
|
2465
2347
|
i[s]
|
|
2466
|
-
) : /* @__PURE__ */
|
|
2467
|
-
if (
|
|
2348
|
+
) : /* @__PURE__ */ an(o), a = o["~run"]({ value: l }, n);
|
|
2349
|
+
if (a.issues) {
|
|
2468
2350
|
const u = {
|
|
2469
2351
|
type: "object",
|
|
2470
2352
|
origin: "value",
|
|
2471
2353
|
input: i,
|
|
2472
2354
|
key: s,
|
|
2473
|
-
value:
|
|
2355
|
+
value: l
|
|
2474
2356
|
};
|
|
2475
|
-
for (const f of
|
|
2476
|
-
f.path ? f.path.unshift(u) : f.path = [u],
|
|
2477
|
-
if (
|
|
2478
|
-
|
|
2357
|
+
for (const f of a.issues)
|
|
2358
|
+
f.path ? f.path.unshift(u) : f.path = [u], r.issues?.push(f);
|
|
2359
|
+
if (r.issues || (r.issues = a.issues), n.abortEarly) {
|
|
2360
|
+
r.typed = !1;
|
|
2479
2361
|
break;
|
|
2480
2362
|
}
|
|
2481
2363
|
}
|
|
2482
|
-
|
|
2364
|
+
a.typed || (r.typed = !1), r.value[s] = a.value;
|
|
2483
2365
|
} else if (o.fallback !== void 0)
|
|
2484
|
-
|
|
2485
|
-
else if (o.type !== "exact_optional" && o.type !== "optional" && o.type !== "nullish" && (
|
|
2366
|
+
r.value[s] = /* @__PURE__ */ Gi(o);
|
|
2367
|
+
else if (o.type !== "exact_optional" && o.type !== "optional" && o.type !== "nullish" && (S(this, "key", r, n, {
|
|
2486
2368
|
input: void 0,
|
|
2487
2369
|
expected: `"${s}"`,
|
|
2488
2370
|
path: [
|
|
@@ -2495,590 +2377,539 @@ function C(t, e) {
|
|
|
2495
2377
|
value: i[s]
|
|
2496
2378
|
}
|
|
2497
2379
|
]
|
|
2498
|
-
}),
|
|
2380
|
+
}), n.abortEarly))
|
|
2499
2381
|
break;
|
|
2500
2382
|
}
|
|
2501
2383
|
} else
|
|
2502
|
-
|
|
2503
|
-
return
|
|
2384
|
+
S(this, "type", r, n);
|
|
2385
|
+
return r;
|
|
2504
2386
|
}
|
|
2505
2387
|
};
|
|
2506
2388
|
}
|
|
2507
2389
|
// @__NO_SIDE_EFFECTS__
|
|
2508
|
-
function
|
|
2390
|
+
function U(t, e) {
|
|
2509
2391
|
return {
|
|
2510
2392
|
kind: "schema",
|
|
2511
2393
|
type: "optional",
|
|
2512
|
-
reference:
|
|
2394
|
+
reference: U,
|
|
2513
2395
|
expects: `(${t.expects} | undefined)`,
|
|
2514
2396
|
async: !1,
|
|
2515
2397
|
wrapped: t,
|
|
2516
2398
|
default: e,
|
|
2517
2399
|
get "~standard"() {
|
|
2518
|
-
return /* @__PURE__ */
|
|
2400
|
+
return /* @__PURE__ */ N(this);
|
|
2519
2401
|
},
|
|
2520
|
-
"~run"(
|
|
2521
|
-
return
|
|
2402
|
+
"~run"(r, n) {
|
|
2403
|
+
return r.value === void 0 && (this.default !== void 0 && (r.value = /* @__PURE__ */ an(this, r, n)), r.value === void 0) ? (r.typed = !0, r) : this.wrapped["~run"](r, n);
|
|
2522
2404
|
}
|
|
2523
2405
|
};
|
|
2524
2406
|
}
|
|
2525
2407
|
// @__NO_SIDE_EFFECTS__
|
|
2526
|
-
function
|
|
2408
|
+
function cn(t) {
|
|
2527
2409
|
return {
|
|
2528
2410
|
kind: "schema",
|
|
2529
2411
|
type: "promise",
|
|
2530
|
-
reference:
|
|
2412
|
+
reference: cn,
|
|
2531
2413
|
expects: "Promise",
|
|
2532
2414
|
async: !1,
|
|
2533
2415
|
message: t,
|
|
2534
2416
|
get "~standard"() {
|
|
2535
|
-
return /* @__PURE__ */
|
|
2417
|
+
return /* @__PURE__ */ N(this);
|
|
2536
2418
|
},
|
|
2537
|
-
"~run"(e,
|
|
2538
|
-
return e.value instanceof Promise ? e.typed = !0 :
|
|
2419
|
+
"~run"(e, r) {
|
|
2420
|
+
return e.value instanceof Promise ? e.typed = !0 : S(this, "type", e, r), e;
|
|
2539
2421
|
}
|
|
2540
2422
|
};
|
|
2541
2423
|
}
|
|
2542
2424
|
// @__NO_SIDE_EFFECTS__
|
|
2543
|
-
function
|
|
2425
|
+
function te(t) {
|
|
2544
2426
|
return {
|
|
2545
2427
|
kind: "schema",
|
|
2546
2428
|
type: "string",
|
|
2547
|
-
reference:
|
|
2429
|
+
reference: te,
|
|
2548
2430
|
expects: "string",
|
|
2549
2431
|
async: !1,
|
|
2550
2432
|
message: t,
|
|
2551
2433
|
get "~standard"() {
|
|
2552
|
-
return /* @__PURE__ */
|
|
2434
|
+
return /* @__PURE__ */ N(this);
|
|
2553
2435
|
},
|
|
2554
|
-
"~run"(e,
|
|
2555
|
-
return typeof e.value == "string" ? e.typed = !0 :
|
|
2436
|
+
"~run"(e, r) {
|
|
2437
|
+
return typeof e.value == "string" ? e.typed = !0 : S(this, "type", e, r), e;
|
|
2556
2438
|
}
|
|
2557
2439
|
};
|
|
2558
2440
|
}
|
|
2559
2441
|
// @__NO_SIDE_EFFECTS__
|
|
2560
|
-
function
|
|
2442
|
+
function Z(t, e) {
|
|
2561
2443
|
return {
|
|
2562
2444
|
kind: "schema",
|
|
2563
2445
|
type: "tuple",
|
|
2564
|
-
reference:
|
|
2446
|
+
reference: Z,
|
|
2565
2447
|
expects: "Array",
|
|
2566
2448
|
async: !1,
|
|
2567
2449
|
items: t,
|
|
2568
2450
|
message: e,
|
|
2569
2451
|
get "~standard"() {
|
|
2570
|
-
return /* @__PURE__ */
|
|
2452
|
+
return /* @__PURE__ */ N(this);
|
|
2571
2453
|
},
|
|
2572
|
-
"~run"(
|
|
2573
|
-
const i =
|
|
2454
|
+
"~run"(r, n) {
|
|
2455
|
+
const i = r.value;
|
|
2574
2456
|
if (Array.isArray(i)) {
|
|
2575
|
-
|
|
2457
|
+
r.typed = !0, r.value = [];
|
|
2576
2458
|
for (let s = 0; s < this.items.length; s++) {
|
|
2577
|
-
const o = i[s],
|
|
2578
|
-
if (
|
|
2579
|
-
const
|
|
2459
|
+
const o = i[s], l = this.items[s]["~run"]({ value: o }, n);
|
|
2460
|
+
if (l.issues) {
|
|
2461
|
+
const a = {
|
|
2580
2462
|
type: "array",
|
|
2581
2463
|
origin: "value",
|
|
2582
2464
|
input: i,
|
|
2583
2465
|
key: s,
|
|
2584
2466
|
value: o
|
|
2585
2467
|
};
|
|
2586
|
-
for (const u of
|
|
2587
|
-
u.path ? u.path.unshift(
|
|
2588
|
-
if (
|
|
2589
|
-
|
|
2468
|
+
for (const u of l.issues)
|
|
2469
|
+
u.path ? u.path.unshift(a) : u.path = [a], r.issues?.push(u);
|
|
2470
|
+
if (r.issues || (r.issues = l.issues), n.abortEarly) {
|
|
2471
|
+
r.typed = !1;
|
|
2590
2472
|
break;
|
|
2591
2473
|
}
|
|
2592
2474
|
}
|
|
2593
|
-
|
|
2475
|
+
l.typed || (r.typed = !1), r.value.push(l.value);
|
|
2594
2476
|
}
|
|
2595
2477
|
} else
|
|
2596
|
-
|
|
2597
|
-
return
|
|
2478
|
+
S(this, "type", r, n);
|
|
2479
|
+
return r;
|
|
2598
2480
|
}
|
|
2599
2481
|
};
|
|
2600
2482
|
}
|
|
2601
2483
|
// @__NO_SIDE_EFFECTS__
|
|
2602
|
-
function
|
|
2484
|
+
function qe(t) {
|
|
2603
2485
|
return {
|
|
2604
2486
|
kind: "schema",
|
|
2605
2487
|
type: "void",
|
|
2606
|
-
reference:
|
|
2488
|
+
reference: qe,
|
|
2607
2489
|
expects: "void",
|
|
2608
2490
|
async: !1,
|
|
2609
2491
|
message: t,
|
|
2610
2492
|
get "~standard"() {
|
|
2611
|
-
return /* @__PURE__ */
|
|
2493
|
+
return /* @__PURE__ */ N(this);
|
|
2612
2494
|
},
|
|
2613
|
-
"~run"(e,
|
|
2614
|
-
return e.value === void 0 ? e.typed = !0 :
|
|
2495
|
+
"~run"(e, r) {
|
|
2496
|
+
return e.value === void 0 ? e.typed = !0 : S(this, "type", e, r), e;
|
|
2615
2497
|
}
|
|
2616
2498
|
};
|
|
2617
2499
|
}
|
|
2618
|
-
function
|
|
2619
|
-
const
|
|
2620
|
-
if (
|
|
2621
|
-
throw new
|
|
2622
|
-
return
|
|
2500
|
+
function rt(t, e, r) {
|
|
2501
|
+
const n = t["~run"]({ value: e }, /* @__PURE__ */ tn(r));
|
|
2502
|
+
if (n.issues)
|
|
2503
|
+
throw new ht(n.issues);
|
|
2504
|
+
return n.value;
|
|
2623
2505
|
}
|
|
2624
2506
|
// @__NO_SIDE_EFFECTS__
|
|
2625
|
-
function
|
|
2507
|
+
function _(...t) {
|
|
2626
2508
|
return {
|
|
2627
2509
|
...t[0],
|
|
2628
2510
|
pipe: t,
|
|
2629
2511
|
get "~standard"() {
|
|
2630
|
-
return /* @__PURE__ */
|
|
2512
|
+
return /* @__PURE__ */ N(this);
|
|
2631
2513
|
},
|
|
2632
|
-
"~run"(e,
|
|
2633
|
-
for (const
|
|
2634
|
-
if (
|
|
2635
|
-
if (e.issues && (
|
|
2514
|
+
"~run"(e, r) {
|
|
2515
|
+
for (const n of t)
|
|
2516
|
+
if (n.kind !== "metadata") {
|
|
2517
|
+
if (e.issues && (n.kind === "schema" || n.kind === "transformation")) {
|
|
2636
2518
|
e.typed = !1;
|
|
2637
2519
|
break;
|
|
2638
2520
|
}
|
|
2639
|
-
(!e.issues || !
|
|
2521
|
+
(!e.issues || !r.abortEarly && !r.abortPipeEarly) && (e = n["~run"](e, r));
|
|
2640
2522
|
}
|
|
2641
2523
|
return e;
|
|
2642
2524
|
}
|
|
2643
2525
|
};
|
|
2644
2526
|
}
|
|
2645
2527
|
// @__NO_SIDE_EFFECTS__
|
|
2646
|
-
function
|
|
2528
|
+
function Ki(...t) {
|
|
2647
2529
|
return {
|
|
2648
2530
|
...t[0],
|
|
2649
2531
|
pipe: t,
|
|
2650
2532
|
async: !0,
|
|
2651
2533
|
get "~standard"() {
|
|
2652
|
-
return /* @__PURE__ */
|
|
2534
|
+
return /* @__PURE__ */ N(this);
|
|
2653
2535
|
},
|
|
2654
|
-
async "~run"(e,
|
|
2655
|
-
for (const
|
|
2656
|
-
if (
|
|
2657
|
-
if (e.issues && (
|
|
2536
|
+
async "~run"(e, r) {
|
|
2537
|
+
for (const n of t)
|
|
2538
|
+
if (n.kind !== "metadata") {
|
|
2539
|
+
if (e.issues && (n.kind === "schema" || n.kind === "transformation")) {
|
|
2658
2540
|
e.typed = !1;
|
|
2659
2541
|
break;
|
|
2660
2542
|
}
|
|
2661
|
-
(!e.issues || !
|
|
2543
|
+
(!e.issues || !r.abortEarly && !r.abortPipeEarly) && (e = await n["~run"](e, r));
|
|
2662
2544
|
}
|
|
2663
2545
|
return e;
|
|
2664
2546
|
}
|
|
2665
2547
|
};
|
|
2666
2548
|
}
|
|
2667
|
-
const
|
|
2668
|
-
sw: /* @__PURE__ */
|
|
2669
|
-
ne: /* @__PURE__ */
|
|
2670
|
-
}),
|
|
2671
|
-
mapSize: /* @__PURE__ */
|
|
2672
|
-
zoomMin: /* @__PURE__ */
|
|
2673
|
-
zoomMax: /* @__PURE__ */
|
|
2674
|
-
zoomScale: /* @__PURE__ */
|
|
2675
|
-
}),
|
|
2676
|
-
inserted: /* @__PURE__ */
|
|
2677
|
-
insert: /* @__PURE__ */
|
|
2678
|
-
remove: /* @__PURE__ */
|
|
2679
|
-
update: /* @__PURE__ */
|
|
2680
|
-
}),
|
|
2681
|
-
getParameters: /* @__PURE__ */
|
|
2682
|
-
getContainer: /* @__PURE__ */
|
|
2683
|
-
getZoom: /* @__PURE__ */
|
|
2684
|
-
getBounds: /* @__PURE__ */
|
|
2685
|
-
panBy: /* @__PURE__ */
|
|
2686
|
-
createMarker: /* @__PURE__ */
|
|
2687
|
-
/* @__PURE__ */
|
|
2688
|
-
/* @__PURE__ */ z(/* @__PURE__ */
|
|
2689
|
-
/* @__PURE__ */
|
|
2549
|
+
const Lt = /* @__PURE__ */ _(/* @__PURE__ */ k(), /* @__PURE__ */ $(-90), /* @__PURE__ */ Le(90)), It = /* @__PURE__ */ _(/* @__PURE__ */ k(), /* @__PURE__ */ $(-180), /* @__PURE__ */ Le(180)), Ji = /* @__PURE__ */ L({
|
|
2550
|
+
sw: /* @__PURE__ */ L({ lat: Lt, lng: It }),
|
|
2551
|
+
ne: /* @__PURE__ */ L({ lat: Lt, lng: It })
|
|
2552
|
+
}), Dt = /* @__PURE__ */ fn((t) => t instanceof HTMLElement, "Must be an HTMLElement"), Qi = /* @__PURE__ */ L({
|
|
2553
|
+
mapSize: /* @__PURE__ */ _(/* @__PURE__ */ k(), /* @__PURE__ */ $(1)),
|
|
2554
|
+
zoomMin: /* @__PURE__ */ _(/* @__PURE__ */ k(), /* @__PURE__ */ $(0)),
|
|
2555
|
+
zoomMax: /* @__PURE__ */ _(/* @__PURE__ */ k(), /* @__PURE__ */ $(0)),
|
|
2556
|
+
zoomScale: /* @__PURE__ */ _(/* @__PURE__ */ k(), /* @__PURE__ */ $(1), /* @__PURE__ */ Le(10))
|
|
2557
|
+
}), $i = /* @__PURE__ */ L({
|
|
2558
|
+
inserted: /* @__PURE__ */ _(/* @__PURE__ */ B(), /* @__PURE__ */ z(/* @__PURE__ */ Z([])), /* @__PURE__ */ W(/* @__PURE__ */ un())),
|
|
2559
|
+
insert: /* @__PURE__ */ _(/* @__PURE__ */ B(), /* @__PURE__ */ z(/* @__PURE__ */ Z([])), /* @__PURE__ */ W(/* @__PURE__ */ qe())),
|
|
2560
|
+
remove: /* @__PURE__ */ _(/* @__PURE__ */ B(), /* @__PURE__ */ z(/* @__PURE__ */ Z([])), /* @__PURE__ */ W(/* @__PURE__ */ qe())),
|
|
2561
|
+
update: /* @__PURE__ */ _(/* @__PURE__ */ B(), /* @__PURE__ */ z(/* @__PURE__ */ Z([/* @__PURE__ */ k()])), /* @__PURE__ */ W(/* @__PURE__ */ qe()))
|
|
2562
|
+
}), es = /* @__PURE__ */ L({
|
|
2563
|
+
getParameters: /* @__PURE__ */ _(/* @__PURE__ */ B(), /* @__PURE__ */ z(/* @__PURE__ */ Z([])), /* @__PURE__ */ W(Qi)),
|
|
2564
|
+
getContainer: /* @__PURE__ */ _(/* @__PURE__ */ B(), /* @__PURE__ */ z(/* @__PURE__ */ Z([])), /* @__PURE__ */ W(Dt)),
|
|
2565
|
+
getZoom: /* @__PURE__ */ _(/* @__PURE__ */ B(), /* @__PURE__ */ z(/* @__PURE__ */ Z([])), /* @__PURE__ */ W(/* @__PURE__ */ k())),
|
|
2566
|
+
getBounds: /* @__PURE__ */ _(/* @__PURE__ */ B(), /* @__PURE__ */ z(/* @__PURE__ */ Z([])), /* @__PURE__ */ W(Ji)),
|
|
2567
|
+
panBy: /* @__PURE__ */ _(/* @__PURE__ */ B(), /* @__PURE__ */ z(/* @__PURE__ */ Z([/* @__PURE__ */ k(), /* @__PURE__ */ k()])), /* @__PURE__ */ W(/* @__PURE__ */ qe())),
|
|
2568
|
+
createMarker: /* @__PURE__ */ _(
|
|
2569
|
+
/* @__PURE__ */ B(),
|
|
2570
|
+
/* @__PURE__ */ z(/* @__PURE__ */ Z([Dt, Lt, It, /* @__PURE__ */ k()])),
|
|
2571
|
+
/* @__PURE__ */ W($i)
|
|
2690
2572
|
)
|
|
2691
|
-
}),
|
|
2692
|
-
/* @__PURE__ */
|
|
2693
|
-
/* @__PURE__ */ z(/* @__PURE__ */
|
|
2694
|
-
/* @__PURE__ */
|
|
2695
|
-
),
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
),
|
|
2713
|
-
body: dt
|
|
2573
|
+
}), Mt = /* @__PURE__ */ _(
|
|
2574
|
+
/* @__PURE__ */ B(),
|
|
2575
|
+
/* @__PURE__ */ z(/* @__PURE__ */ Z([/* @__PURE__ */ te()])),
|
|
2576
|
+
/* @__PURE__ */ on(/* @__PURE__ */ Ki(/* @__PURE__ */ cn(), /* @__PURE__ */ rn(), Dt))
|
|
2577
|
+
), ts = /* @__PURE__ */ L({
|
|
2578
|
+
background: /* @__PURE__ */ U(/* @__PURE__ */ te()),
|
|
2579
|
+
border: /* @__PURE__ */ U(/* @__PURE__ */ te()),
|
|
2580
|
+
shadow: /* @__PURE__ */ U(/* @__PURE__ */ te())
|
|
2581
|
+
}), rs = /* @__PURE__ */ L({
|
|
2582
|
+
width: /* @__PURE__ */ k(),
|
|
2583
|
+
height: /* @__PURE__ */ k(),
|
|
2584
|
+
radius: /* @__PURE__ */ k()
|
|
2585
|
+
}), gr = /* @__PURE__ */ L({
|
|
2586
|
+
background: /* @__PURE__ */ U(/* @__PURE__ */ te()),
|
|
2587
|
+
shadow: /* @__PURE__ */ U(/* @__PURE__ */ te())
|
|
2588
|
+
}), _r = /* @__PURE__ */ _(
|
|
2589
|
+
/* @__PURE__ */ L({
|
|
2590
|
+
width: /* @__PURE__ */ k(),
|
|
2591
|
+
height: /* @__PURE__ */ k(),
|
|
2592
|
+
margin: /* @__PURE__ */ k(),
|
|
2593
|
+
radius: /* @__PURE__ */ k()
|
|
2714
2594
|
}),
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2595
|
+
/* @__PURE__ */ nn(
|
|
2596
|
+
(t) => Math.min(t.width, t.height) / t.margin >= 6,
|
|
2597
|
+
"Minimum of width or height must be greater than or equal to 6 * margin"
|
|
2598
|
+
)
|
|
2599
|
+
), ns = /* @__PURE__ */ L({
|
|
2600
|
+
id: /* @__PURE__ */ _(/* @__PURE__ */ te(), /* @__PURE__ */ Xt(1)),
|
|
2601
|
+
rank: /* @__PURE__ */ _(/* @__PURE__ */ k(), /* @__PURE__ */ $(0)),
|
|
2602
|
+
lat: /* @__PURE__ */ _(/* @__PURE__ */ k(), /* @__PURE__ */ $(-90), /* @__PURE__ */ Le(90)),
|
|
2603
|
+
lng: /* @__PURE__ */ _(/* @__PURE__ */ k(), /* @__PURE__ */ $(-180), /* @__PURE__ */ Le(180)),
|
|
2604
|
+
tooltip: /* @__PURE__ */ L({
|
|
2605
|
+
body: Mt,
|
|
2606
|
+
style: _r,
|
|
2607
|
+
colors: /* @__PURE__ */ U(gr)
|
|
2608
|
+
}),
|
|
2609
|
+
pin: /* @__PURE__ */ U(
|
|
2610
|
+
/* @__PURE__ */ L({
|
|
2611
|
+
body: Mt,
|
|
2612
|
+
style: /* @__PURE__ */ U(rs),
|
|
2613
|
+
colors: /* @__PURE__ */ U(ts)
|
|
2723
2614
|
})
|
|
2724
2615
|
),
|
|
2725
|
-
popup: /* @__PURE__ */
|
|
2726
|
-
/* @__PURE__ */
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
radius: /* @__PURE__ */ g(),
|
|
2731
|
-
margin: /* @__PURE__ */ g()
|
|
2732
|
-
}),
|
|
2733
|
-
body: dt
|
|
2616
|
+
popup: /* @__PURE__ */ U(
|
|
2617
|
+
/* @__PURE__ */ L({
|
|
2618
|
+
body: Mt,
|
|
2619
|
+
style: _r,
|
|
2620
|
+
colors: /* @__PURE__ */ U(gr)
|
|
2734
2621
|
})
|
|
2735
2622
|
)
|
|
2736
|
-
}),
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
markerDataArray = new Array();
|
|
2748
|
-
markerDataMap = /* @__PURE__ */ new Map();
|
|
2749
|
-
markerDataUpdating = !1;
|
|
2750
|
-
markerPinProcessor;
|
|
2751
|
-
markerTooltipProcessor;
|
|
2752
|
-
markerPopupProcessor;
|
|
2753
|
-
constructor(e, n, r, i) {
|
|
2754
|
-
Je(Hi, e), Je(Yi, n), Je(Ui, r), this.apiKey = e, this.apiToken = n, this.apiDevEnvironment = window?.location.host.startsWith("localhost") || window?.location.host.startsWith("127.0.0.1"), this.mapProvider = r, this.markerPinProcessor = new st(r), this.markerTooltipProcessor = new Ki(r), this.markerPopupProcessor = new Ji(r), this.setConfiguration(i);
|
|
2623
|
+
}), is = /* @__PURE__ */ ln(ns);
|
|
2624
|
+
class He extends Je {
|
|
2625
|
+
static DEFAULT_SIZE = 16;
|
|
2626
|
+
style;
|
|
2627
|
+
colors;
|
|
2628
|
+
zoom;
|
|
2629
|
+
bodyLoading = !1;
|
|
2630
|
+
bodyLoaded = !1;
|
|
2631
|
+
bodyCallback;
|
|
2632
|
+
constructor(e, r, n) {
|
|
2633
|
+
super(e, r), this.style = r.pin?.style ?? { width: He.DEFAULT_SIZE, height: He.DEFAULT_SIZE, radius: He.DEFAULT_SIZE }, this.colors = r.pin?.colors, this.zoom = n, this.bodyCallback = r.pin?.body;
|
|
2755
2634
|
}
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2635
|
+
createElement() {
|
|
2636
|
+
this.element = document.createElement("div"), this.element.classList.add("pin"), this.component = Yt(Zi, {
|
|
2637
|
+
target: this.element,
|
|
2638
|
+
props: {
|
|
2639
|
+
id: this.id + "_pin",
|
|
2640
|
+
layer: zi,
|
|
2641
|
+
priority: this.zoom * this.provider.getParameters().zoomScale,
|
|
2642
|
+
style: this.style,
|
|
2643
|
+
colors: this.colors
|
|
2644
|
+
}
|
|
2645
|
+
});
|
|
2761
2646
|
}
|
|
2762
|
-
|
|
2763
|
-
|
|
2647
|
+
update(e) {
|
|
2648
|
+
this.zoom = e[0], this.setZIndex();
|
|
2764
2649
|
}
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
try {
|
|
2768
|
-
await this.updateMarkerData(e), this.processMarkerDataCallback();
|
|
2769
|
-
} catch (n) {
|
|
2770
|
-
throw console.error(n), this.removeMarkerData(), n instanceof Error && this.log("error", "Failed to update markers", n), n;
|
|
2771
|
-
}
|
|
2650
|
+
updateMarker(e) {
|
|
2651
|
+
super.updateMarker(e), this.component?.setDisplayed(e);
|
|
2772
2652
|
}
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
}
|
|
2653
|
+
updateBody() {
|
|
2654
|
+
if (this.bodyCallback == null || this.bodyLoaded || this.bodyLoading) return;
|
|
2655
|
+
const e = this.component?.getBody();
|
|
2656
|
+
e != null && (this.bodyLoading = !0, this.bodyCallback(this.id).then((r) => {
|
|
2657
|
+
r instanceof HTMLElement ? e.appendChild(r) : console.error("Failed to load pin body");
|
|
2658
|
+
}).catch((r) => console.error(r)).finally(() => {
|
|
2659
|
+
this.bodyLoaded = !0, this.bodyLoading = !1;
|
|
2660
|
+
}));
|
|
2779
2661
|
}
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
n.marker.id == e ? this.markerPopupProcessor.show(n) : this.markerPopupProcessor.hide(n);
|
|
2784
|
-
} catch (n) {
|
|
2785
|
-
console.error(n);
|
|
2786
|
-
for (const r of this.markerDataArray)
|
|
2787
|
-
this.markerPopupProcessor.hide(r);
|
|
2788
|
-
throw n instanceof Error && this.log("error", "Failed to show popup", n), n;
|
|
2789
|
-
}
|
|
2662
|
+
setCollapsed(e) {
|
|
2663
|
+
if (this.component == null) throw new Error("Failed to set pin collapsed");
|
|
2664
|
+
this.component.setCollapsed(e);
|
|
2790
2665
|
}
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
const n = this.markerDataMap.get(e);
|
|
2795
|
-
if (n == null) return;
|
|
2796
|
-
this.markerPopupProcessor.hide(n);
|
|
2797
|
-
} else
|
|
2798
|
-
for (const n of this.markerDataArray)
|
|
2799
|
-
this.markerPopupProcessor.hide(n);
|
|
2800
|
-
} catch (n) {
|
|
2801
|
-
console.error(n);
|
|
2802
|
-
for (const r of this.markerDataArray)
|
|
2803
|
-
this.markerPopupProcessor.hide(r);
|
|
2804
|
-
throw n instanceof Error && this.log("error", "Failed to hide popup", n), n;
|
|
2805
|
-
}
|
|
2666
|
+
setScale(e) {
|
|
2667
|
+
if (this.component == null) throw new Error("Failed to set pin scale");
|
|
2668
|
+
this.component.setScale(e);
|
|
2806
2669
|
}
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
let n = this.markerDataArray.map((i) => i.marker);
|
|
2810
|
-
for (let i = 0; i < e.length; i++) {
|
|
2811
|
-
const s = e[i];
|
|
2812
|
-
this.markerDataMap.get(s.id) || n.push(s);
|
|
2813
|
-
}
|
|
2814
|
-
const r = await this.getMarkerStates(n);
|
|
2815
|
-
try {
|
|
2816
|
-
this.markerDataUpdating = !0;
|
|
2817
|
-
for (let i = 0; i < n.length; i++) {
|
|
2818
|
-
const s = n[i], o = r[i], a = this.markerDataMap.get(s.id);
|
|
2819
|
-
if (a)
|
|
2820
|
-
a.update(o);
|
|
2821
|
-
else {
|
|
2822
|
-
const l = new Gi(this.mapProvider, s, o);
|
|
2823
|
-
l.create(), this.markerDataMap.set(s.id, l), this.markerDataArray.push(l);
|
|
2824
|
-
}
|
|
2825
|
-
}
|
|
2826
|
-
this.markerDataArray.sort((i, s) => i.zoom - s.zoom), this.markerPinProcessor.updateElements(this.markerDataArray.map((i) => i.pin)), this.markerTooltipProcessor.updateElements(this.markerDataArray.map((i) => i.tooltip)), this.markerPopupProcessor.updateElements(this.markerDataArray.map((i) => i.popup).filter((i) => i != null));
|
|
2827
|
-
} finally {
|
|
2828
|
-
this.markerDataUpdating = !1;
|
|
2829
|
-
}
|
|
2830
|
-
} catch (n) {
|
|
2831
|
-
throw console.error(n), this.markerDataArray.forEach((r) => r.remove()), this.markerDataArray.length = 0, this.markerDataMap.clear(), n instanceof Error && this.log("error", "Failed to update marker data", n), n;
|
|
2832
|
-
} finally {
|
|
2833
|
-
this.markerDataUpdating = !1;
|
|
2834
|
-
}
|
|
2670
|
+
getScaleFromZoomDistance(e) {
|
|
2671
|
+
return this.zoom < e ? 1 : Math.max(0, 1 - (this.zoom - e) * 0.125);
|
|
2835
2672
|
}
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
} catch (e) {
|
|
2840
|
-
throw console.error(e), e instanceof Error && this.log("error", "Failed to remove marker data", e), e;
|
|
2841
|
-
} finally {
|
|
2842
|
-
this.markerDataUpdating = !1;
|
|
2843
|
-
}
|
|
2673
|
+
getZindex() {
|
|
2674
|
+
const e = this.provider.getParameters();
|
|
2675
|
+
return Math.round((e.zoomMax - this.zoom) * e.zoomScale);
|
|
2844
2676
|
}
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
if (e.length == 1) return [[0, [[0, ve.DEGREES.indexOf(ve.DEGREES_DEFAULT)]]]];
|
|
2848
|
-
const n = e.map((s) => ({
|
|
2849
|
-
id: s.id,
|
|
2850
|
-
rank: s.rank,
|
|
2851
|
-
lat: s.lat,
|
|
2852
|
-
lng: s.lng,
|
|
2853
|
-
width: s.tooltip.style.width,
|
|
2854
|
-
height: s.tooltip.style.height,
|
|
2855
|
-
margin: s.tooltip.style.margin
|
|
2856
|
-
})), r = {
|
|
2857
|
-
key: this.apiKey,
|
|
2858
|
-
token: this.apiToken,
|
|
2859
|
-
parameters: this.mapProvider.getParameters(),
|
|
2860
|
-
input: n
|
|
2861
|
-
}, i = await ze.post(Xi, r, {
|
|
2862
|
-
headers: { "Cache-Control": this.apiDevEnvironment ? "no-cache" : "" }
|
|
2863
|
-
});
|
|
2864
|
-
return i.token && (this.apiToken = i.token), i.states;
|
|
2865
|
-
}
|
|
2866
|
-
processMarkerDataCallback() {
|
|
2867
|
-
if (this.mapProvider.getContainer().parentElement != null && this.markerDataArray.length != 0)
|
|
2868
|
-
try {
|
|
2869
|
-
this.processMarkerData(), window.setTimeout(this.processMarkerDataCallback.bind(this), 25);
|
|
2870
|
-
} catch (e) {
|
|
2871
|
-
console.error(e), e instanceof Error && this.log("error", "Failed to process marker data", e);
|
|
2872
|
-
}
|
|
2873
|
-
}
|
|
2874
|
-
processMarkerData() {
|
|
2875
|
-
if (this.markerDataUpdating) return;
|
|
2876
|
-
const e = this.mapProvider.getBounds(), n = this.mapProvider.getZoom();
|
|
2877
|
-
this.markerPopupProcessor.process(), this.markerTooltipProcessor.process(e, n), this.markerPinProcessor.process(e, n);
|
|
2878
|
-
}
|
|
2879
|
-
async log(e, n, r) {
|
|
2880
|
-
if (!this.apiDevEnvironment)
|
|
2881
|
-
try {
|
|
2882
|
-
const i = {
|
|
2883
|
-
key: this.apiKey,
|
|
2884
|
-
title: n,
|
|
2885
|
-
level: e,
|
|
2886
|
-
content: {
|
|
2887
|
-
version: an,
|
|
2888
|
-
...r
|
|
2889
|
-
}
|
|
2890
|
-
};
|
|
2891
|
-
await ze.post(Wi, i);
|
|
2892
|
-
} catch (i) {
|
|
2893
|
-
console.error(i);
|
|
2894
|
-
}
|
|
2895
|
-
}
|
|
2896
|
-
}
|
|
2897
|
-
class Gi {
|
|
2898
|
-
marker;
|
|
2899
|
-
zoom;
|
|
2900
|
-
pin;
|
|
2901
|
-
tooltip;
|
|
2902
|
-
popup;
|
|
2903
|
-
constructor(e, n, r) {
|
|
2904
|
-
this.marker = n, this.zoom = r[0], this.pin = new Be(e, n, r), this.tooltip = new Zt(e, n, r), n.popup && (this.popup = new qt(e, n));
|
|
2905
|
-
}
|
|
2906
|
-
create() {
|
|
2907
|
-
this.pin.create(), this.tooltip.create(), this.popup?.create();
|
|
2908
|
-
}
|
|
2909
|
-
update(e) {
|
|
2910
|
-
this.pin.update(e), this.tooltip.update(e);
|
|
2677
|
+
isCollapsed() {
|
|
2678
|
+
return this.component == null ? !1 : this.component.getCollapsed();
|
|
2911
2679
|
}
|
|
2912
|
-
|
|
2913
|
-
|
|
2680
|
+
isBodyLoaded() {
|
|
2681
|
+
return this.bodyCallback == null || this.bodyLoaded;
|
|
2914
2682
|
}
|
|
2915
2683
|
}
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2684
|
+
var Ye;
|
|
2685
|
+
((t) => {
|
|
2686
|
+
function e(r, n, i) {
|
|
2687
|
+
const s = r / 2, o = n / 2, l = Math.sqrt(s * s + o * o), a = Math.atan(o / s) * (180 / Math.PI), u = i * (Math.PI / 180);
|
|
2688
|
+
return i < 180 ? i < 90 ? i < a ? {
|
|
2689
|
+
x: 0,
|
|
2690
|
+
y: l * Math.sin(u) - o
|
|
2691
|
+
} : {
|
|
2692
|
+
x: l * Math.cos(u) - s,
|
|
2693
|
+
y: 0
|
|
2694
|
+
} : i < 180 - a ? {
|
|
2695
|
+
x: l * Math.cos(u) - s,
|
|
2696
|
+
y: 0
|
|
2697
|
+
} : {
|
|
2698
|
+
x: -r,
|
|
2699
|
+
y: l * Math.sin(u) - o
|
|
2700
|
+
} : i < 270 ? i < 180 + a ? {
|
|
2701
|
+
x: -r,
|
|
2702
|
+
y: l * Math.sin(u) - o
|
|
2703
|
+
} : {
|
|
2704
|
+
x: l * Math.cos(u) - s,
|
|
2705
|
+
y: -n
|
|
2706
|
+
} : i < 360 - a ? {
|
|
2707
|
+
x: l * Math.cos(u) - s,
|
|
2708
|
+
y: -n
|
|
2709
|
+
} : {
|
|
2710
|
+
x: 0,
|
|
2711
|
+
y: l * Math.sin(u) - o
|
|
2712
|
+
};
|
|
2942
2713
|
}
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2714
|
+
t.getOffsets = e;
|
|
2715
|
+
})(Ye || (Ye = {}));
|
|
2716
|
+
var ss = /* @__PURE__ */ Gr('<div><div class="pointer svelte-11extwn"></div> <div class="bubble svelte-11extwn"><div class="body svelte-11extwn"></div></div></div>');
|
|
2717
|
+
function pn(t, e) {
|
|
2718
|
+
zt(e, !0);
|
|
2719
|
+
let r = e.style.width, n = e.style.height, i = e.style.margin, s = e.style.radius, o = e.colors?.background ?? "white", l = e.colors?.shadow ?? "0px 2px 2px rgba(0, 0, 0, 0.5)", a, u, f, h;
|
|
2720
|
+
const p = r + 2 * i, c = n + 2 * i, d = () => h;
|
|
2721
|
+
J(() => {
|
|
2722
|
+
f.style.width = `${i * 4}px`, f.style.height = `${i * 4}px`;
|
|
2723
|
+
});
|
|
2724
|
+
let w = /* @__PURE__ */ C(!0);
|
|
2725
|
+
function O(y) {
|
|
2726
|
+
P(w, y, !0);
|
|
2727
|
+
}
|
|
2728
|
+
function K() {
|
|
2729
|
+
return g(w);
|
|
2730
|
+
}
|
|
2731
|
+
let b = /* @__PURE__ */ C(!0), V = 0, Qe = 300;
|
|
2732
|
+
function dt(y) {
|
|
2733
|
+
y != g(b) && (P(b, y, !0), V = performance.now());
|
|
2734
|
+
}
|
|
2735
|
+
function vt() {
|
|
2736
|
+
return performance.now() - V < Qe ? M.motion.current == 0 : M.value == 0;
|
|
2737
|
+
}
|
|
2738
|
+
function mt() {
|
|
2739
|
+
return performance.now() - V < Qe ? M.motion.current == 1 : M.value == 1;
|
|
2740
|
+
}
|
|
2741
|
+
let M = new st(0);
|
|
2742
|
+
J(() => {
|
|
2743
|
+
g(w) == !1 && (M.snap(), ae.clear(e.priority, e.id + "_scale"));
|
|
2744
|
+
}), J(() => {
|
|
2745
|
+
g(b) == !0 && M.value != 0 && (ae.stacked() ? M.set(0, { duration: 0 }) : M.set(0, { duration: 150, easing: Oi })), g(b) == !1 && M.value != 1 && M.set(1, { duration: 150, easing: Fi });
|
|
2746
|
+
}), J(() => {
|
|
2747
|
+
$e(M.motion.current);
|
|
2748
|
+
});
|
|
2749
|
+
function $e(y) {
|
|
2750
|
+
!a || !u || !f || ae.equeue(g(b) ? 0 : e.layer, e.priority, e.id + "_scale", () => {
|
|
2751
|
+
a.style.opacity = `${y}`, u.style.scale = `${y}`, f.style.scale = `${y}`;
|
|
2752
|
+
});
|
|
2947
2753
|
}
|
|
2948
|
-
|
|
2949
|
-
|
|
2754
|
+
let E = NaN, yt = /* @__PURE__ */ C(!1), oe = new st(-p / 2, { easing: Ct }), et = new st(-c / 2, { easing: Ct });
|
|
2755
|
+
J(() => {
|
|
2756
|
+
g(w) == !1 && (oe.snap(), oe.snap(), ae.clear(e.priority, e.id + "_angle"));
|
|
2757
|
+
}), J(() => {
|
|
2758
|
+
g(b) == !0 && g(yt) && (oe.update({ duration: 75 }), oe.update({ duration: 75 }));
|
|
2759
|
+
}), J(() => {
|
|
2760
|
+
Jt(oe.motion.current, et.motion.current);
|
|
2761
|
+
});
|
|
2762
|
+
function Jt(y, _e) {
|
|
2763
|
+
if (!a || !u || !f) return;
|
|
2764
|
+
const X = y + p / 2, we = _e + c / 2, Ee = c < p ? X * c / p : X, ke = c > p ? we * p / c : we, gn = Math.atan2(ke, Ee) / Math.PI * 180 - 45, nr = 0, _n = 30, wt = Math.sqrt(Ee * Ee + ke * ke), Ne = Math.min(p, c) / 2, wn = Ne * Math.SQRT2, En = (wt - Ne) / (wn - Ne), ir = nr + En * (_n - nr), kn = wt < Ne ? wt / Ne : 1;
|
|
2765
|
+
ae.equeue(e.layer, e.priority, e.id + "_angle", () => {
|
|
2766
|
+
u.style.transform = `translate(${Math.round(y)}px, ${Math.round(_e)}px)`, f.style.transform = `scale(${kn}) rotate(${gn}deg) skew(${ir}deg, ${ir}deg)`;
|
|
2767
|
+
});
|
|
2950
2768
|
}
|
|
2951
|
-
|
|
2952
|
-
|
|
2769
|
+
function vn(y, _e) {
|
|
2770
|
+
if (g(yt) == !1 || _e == !0) {
|
|
2771
|
+
let X = Ye.getOffsets(p, c, y);
|
|
2772
|
+
oe.set(Math.round(X.x), { duration: 0 }), et.set(Math.round(X.y), { duration: 0 }), Jt(oe.value, et.value), E = y, P(yt, !0);
|
|
2773
|
+
} else if (y != E) {
|
|
2774
|
+
let X = Math.abs(y - E), we = X < 180 ? X : 360 - X, Ee = Math.log(we) * 75, ke = Ye.getOffsets(p, c, y);
|
|
2775
|
+
oe.set(Math.round(ke.x), { duration: Ee }), et.set(Math.round(ke.y), { duration: Ee }), E = y;
|
|
2776
|
+
}
|
|
2953
2777
|
}
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2778
|
+
function mn() {
|
|
2779
|
+
return Ye.getOffsets(p, c, E);
|
|
2780
|
+
}
|
|
2781
|
+
var yn = {
|
|
2782
|
+
getBody: d,
|
|
2783
|
+
setDisplayed: O,
|
|
2784
|
+
getDisplayed: K,
|
|
2785
|
+
setCollapsed: dt,
|
|
2786
|
+
getCollapsed: vt,
|
|
2787
|
+
getExpanded: mt,
|
|
2788
|
+
setAngle: vn,
|
|
2789
|
+
getOffsets: mn
|
|
2790
|
+
}, Re = ss();
|
|
2791
|
+
let Qt;
|
|
2792
|
+
var gt = ur(Re);
|
|
2793
|
+
let $t;
|
|
2794
|
+
Be(
|
|
2795
|
+
gt,
|
|
2796
|
+
(y) => (
|
|
2797
|
+
//#endregion
|
|
2798
|
+
f = y
|
|
2799
|
+
),
|
|
2800
|
+
() => f
|
|
2801
|
+
);
|
|
2802
|
+
var _t = si(gt, 2);
|
|
2803
|
+
let er;
|
|
2804
|
+
var tr = ur(_t);
|
|
2805
|
+
let rr;
|
|
2806
|
+
return Be(tr, (y) => h = y, () => h), Be(_t, (y) => u = y, () => u), Be(Re, (y) => a = y, () => a), jr(
|
|
2807
|
+
(y, _e, X, we) => {
|
|
2808
|
+
$r(Re, 1, Qr(["anchor", g(w) && "displayed"]), "svelte-11extwn"), Qt = ze(Re, "", Qt, y), $t = ze(gt, "", $t, _e), er = ze(_t, "", er, X), rr = ze(tr, "", rr, we);
|
|
2809
|
+
},
|
|
2810
|
+
[
|
|
2811
|
+
() => ({ filter: `drop-shadow(${l})` }),
|
|
2812
|
+
() => ({ "background-color": o }),
|
|
2813
|
+
() => ({ margin: `${i}px;` }),
|
|
2814
|
+
() => ({
|
|
2815
|
+
width: `${r}px`,
|
|
2816
|
+
height: `${n}px`,
|
|
2817
|
+
"border-radius": `${s}px;`,
|
|
2818
|
+
"background-color": o
|
|
2819
|
+
})
|
|
2820
|
+
]
|
|
2821
|
+
), Kr(t, Re), Bt(yn);
|
|
2822
|
+
}
|
|
2823
|
+
class Wt extends Je {
|
|
2824
|
+
static Z_INDEX_OFFSET = 2e6;
|
|
2825
|
+
style;
|
|
2826
|
+
colors;
|
|
2961
2827
|
bodyLoading = !1;
|
|
2962
2828
|
bodyLoaded = !1;
|
|
2963
2829
|
bodyCallback;
|
|
2964
|
-
constructor(e,
|
|
2965
|
-
|
|
2830
|
+
constructor(e, r) {
|
|
2831
|
+
if (r.popup == null) throw new Error("Failed to create popup");
|
|
2832
|
+
super(e, r), this.shown = !1, this.style = r.popup.style, this.colors = r.popup.colors, this.bodyCallback = r.popup.body;
|
|
2966
2833
|
}
|
|
2967
2834
|
createElement() {
|
|
2968
|
-
this.element = document.createElement("div"), this.element.classList.add("
|
|
2835
|
+
this.element = document.createElement("div"), this.element.classList.add("popup"), this.component = Yt(pn, {
|
|
2969
2836
|
target: this.element,
|
|
2970
2837
|
props: {
|
|
2971
|
-
id: this.id + "
|
|
2972
|
-
layer:
|
|
2973
|
-
priority:
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
radius: this.radius
|
|
2838
|
+
id: this.id + "_popup",
|
|
2839
|
+
layer: Ni,
|
|
2840
|
+
priority: 0,
|
|
2841
|
+
style: this.style,
|
|
2842
|
+
colors: this.colors
|
|
2977
2843
|
}
|
|
2978
2844
|
});
|
|
2979
2845
|
}
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
}
|
|
2983
|
-
updateMap(e) {
|
|
2984
|
-
super.updateMap(e), this.component?.setDisplayed(e);
|
|
2846
|
+
updateMarker(e) {
|
|
2847
|
+
super.updateMarker(e), this.component?.setDisplayed(e);
|
|
2985
2848
|
}
|
|
2986
2849
|
updateBody() {
|
|
2987
|
-
if (this.
|
|
2850
|
+
if (this.bodyLoaded || this.bodyLoading) return;
|
|
2988
2851
|
const e = this.component?.getBody();
|
|
2989
|
-
e != null && (this.bodyLoading = !0, this.bodyCallback(this.id).then((
|
|
2990
|
-
|
|
2991
|
-
}).catch((
|
|
2852
|
+
e != null && (this.bodyLoading = !0, this.bodyCallback(this.id).then((r) => {
|
|
2853
|
+
r instanceof HTMLElement ? e.appendChild(r) : console.error("Failed to load popup body");
|
|
2854
|
+
}).catch((r) => console.error(r)).finally(() => {
|
|
2992
2855
|
this.bodyLoaded = !0, this.bodyLoading = !1;
|
|
2993
2856
|
}));
|
|
2994
2857
|
}
|
|
2858
|
+
getZindex() {
|
|
2859
|
+
return Wt.Z_INDEX_OFFSET;
|
|
2860
|
+
}
|
|
2995
2861
|
setCollapsed(e) {
|
|
2996
|
-
if (this.component == null) throw new Error("Failed to set
|
|
2862
|
+
if (this.component == null) throw new Error("Failed to set popup collapsed");
|
|
2997
2863
|
this.component.setCollapsed(e);
|
|
2998
2864
|
}
|
|
2999
|
-
|
|
3000
|
-
if (this.component == null) throw new Error("Failed to set
|
|
3001
|
-
this.component.
|
|
3002
|
-
}
|
|
3003
|
-
getScaleFromZoomDistance(e) {
|
|
3004
|
-
return this.zoom < e ? 1 : Math.max(0, 1 - (this.zoom - e) * 0.125);
|
|
2865
|
+
setAngle(e) {
|
|
2866
|
+
if (this.component == null) throw new Error("Failed to set popup angle");
|
|
2867
|
+
this.component.setAngle(e, !0);
|
|
3005
2868
|
}
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
return Math.round((e.zoomMax - this.zoom) * e.zoomScale);
|
|
2869
|
+
isExpanded() {
|
|
2870
|
+
return this.component == null ? !1 : this.component.getExpanded();
|
|
3009
2871
|
}
|
|
3010
2872
|
isCollapsed() {
|
|
3011
2873
|
return this.component == null ? !1 : this.component.getCollapsed();
|
|
3012
2874
|
}
|
|
3013
2875
|
isBodyLoaded() {
|
|
3014
|
-
return this.
|
|
3015
|
-
}
|
|
3016
|
-
}
|
|
3017
|
-
class st {
|
|
3018
|
-
static MAP_PINS_MAX_ZOOM = 2;
|
|
3019
|
-
static MAP_PINS_MAX_COUNT = 128;
|
|
3020
|
-
provider;
|
|
3021
|
-
// Data
|
|
3022
|
-
pinElements = new Array();
|
|
3023
|
-
// Configuration
|
|
3024
|
-
pinMaxWidth = 0;
|
|
3025
|
-
pinMaxHeight = 0;
|
|
3026
|
-
pinFade = !1;
|
|
3027
|
-
pinMaxCount = 0;
|
|
3028
|
-
pinMaxZoomDelta = 0;
|
|
3029
|
-
constructor(e) {
|
|
3030
|
-
this.provider = e;
|
|
3031
|
-
}
|
|
3032
|
-
setConfiguration(e) {
|
|
3033
|
-
this.pinFade = e?.pin?.fade ?? !0, this.pinMaxCount = e?.pin?.maxCount ?? Math.max(st.MAP_PINS_MAX_COUNT, 8 * navigator.hardwareConcurrency), this.pinMaxZoomDelta = e?.pin?.maxZoom ?? st.MAP_PINS_MAX_ZOOM;
|
|
3034
|
-
}
|
|
3035
|
-
updateElements(e) {
|
|
3036
|
-
this.pinElements = e, this.pinMaxWidth = e.reduce((n, r) => Math.max(n, r.width), 0), this.pinMaxHeight = e.reduce((n, r) => Math.max(n, r.height), 0);
|
|
3037
|
-
}
|
|
3038
|
-
removeElements() {
|
|
3039
|
-
this.pinElements.forEach((e) => e.remove()), this.pinElements.length = 0;
|
|
3040
|
-
}
|
|
3041
|
-
process(e, n) {
|
|
3042
|
-
const r = this.provider.getParameters().mapSize, i = new qn(e, n, r, this.pinMaxWidth * 2, this.pinMaxHeight * 2);
|
|
3043
|
-
let s = 0;
|
|
3044
|
-
for (const o of this.pinElements)
|
|
3045
|
-
i.contains(o.lat, o.lng) ? o.shown && n < o.zoom && o.zoom < n + this.pinMaxZoomDelta ? (s < this.pinMaxCount && (o.setCollapsed(!1), o.setScale(this.pinFade ? o.getScaleFromZoomDistance(n) : 1), o.updateMap(!0), o.isBodyLoaded() == !1 && o.updateBody()), s++) : (o.setCollapsed(!0), o.isCollapsed() && o.updateMap(!1)) : o.updateMap(!1);
|
|
2876
|
+
return this.bodyLoaded;
|
|
3046
2877
|
}
|
|
3047
2878
|
}
|
|
3048
|
-
|
|
2879
|
+
var ye;
|
|
2880
|
+
((t) => {
|
|
2881
|
+
t.COUNT = 12, t.DEGREES = [0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330], t.DEGREES_DEFAULT = 270;
|
|
2882
|
+
})(ye || (ye = {}));
|
|
2883
|
+
class Gt extends Je {
|
|
3049
2884
|
static Z_INDEX_OFFSET = 1e6;
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
margin;
|
|
3053
|
-
radius;
|
|
2885
|
+
style;
|
|
2886
|
+
colors;
|
|
3054
2887
|
zoom;
|
|
3055
2888
|
angle;
|
|
3056
2889
|
states;
|
|
3057
2890
|
bodyLoading = !1;
|
|
3058
2891
|
bodyLoaded = !1;
|
|
3059
2892
|
bodyCallback;
|
|
3060
|
-
constructor(e,
|
|
3061
|
-
super(e,
|
|
2893
|
+
constructor(e, r, n) {
|
|
2894
|
+
super(e, r), this.style = r.tooltip.style, this.colors = r.tooltip.colors, this.zoom = n[0], this.angle = ye.DEGREES_DEFAULT, this.states = n[1].map((i) => [i[0], ye.DEGREES[i[1]]]), this.bodyCallback = r.tooltip.body;
|
|
3062
2895
|
}
|
|
3063
2896
|
createElement() {
|
|
3064
|
-
this.element = document.createElement("div"), this.element.classList.add("tooltip"), this.component =
|
|
2897
|
+
this.element = document.createElement("div"), this.element.classList.add("tooltip"), this.component = Yt(pn, {
|
|
3065
2898
|
target: this.element,
|
|
3066
2899
|
props: {
|
|
3067
2900
|
id: this.id + "_tooltip",
|
|
3068
|
-
layer:
|
|
2901
|
+
layer: ji,
|
|
3069
2902
|
priority: this.zoom * this.provider.getParameters().zoomScale,
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
margin: this.margin,
|
|
3073
|
-
radius: this.radius
|
|
2903
|
+
style: this.style,
|
|
2904
|
+
colors: this.colors
|
|
3074
2905
|
}
|
|
3075
2906
|
});
|
|
3076
2907
|
}
|
|
3077
2908
|
update(e) {
|
|
3078
|
-
this.zoom = e[0], this.states = e[1].map((
|
|
2909
|
+
this.zoom = e[0], this.states = e[1].map((r) => [r[0], ye.DEGREES[r[1]]]), this.setZIndex();
|
|
3079
2910
|
}
|
|
3080
|
-
|
|
3081
|
-
super.
|
|
2911
|
+
updateMarker(e) {
|
|
2912
|
+
super.updateMarker(e), this.component?.setDisplayed(e);
|
|
3082
2913
|
}
|
|
3083
2914
|
updateState(e) {
|
|
3084
2915
|
if (this.component == null) throw new Error("Failed to update tooltip state");
|
|
@@ -3087,20 +2918,20 @@ class Zt extends Ut {
|
|
|
3087
2918
|
updateBody() {
|
|
3088
2919
|
if (this.bodyLoaded || this.bodyLoading) return;
|
|
3089
2920
|
const e = this.component?.getBody();
|
|
3090
|
-
e != null && (this.bodyLoading = !0, this.bodyCallback(this.id).then((
|
|
3091
|
-
|
|
3092
|
-
}).catch((
|
|
2921
|
+
e != null && (this.bodyLoading = !0, this.bodyCallback(this.id).then((r) => {
|
|
2922
|
+
r instanceof HTMLElement ? e.appendChild(r) : console.error("Failed to load tooltip body");
|
|
2923
|
+
}).catch((r) => console.error(r)).finally(() => {
|
|
3093
2924
|
this.bodyLoaded = !0, this.bodyLoading = !1;
|
|
3094
2925
|
}));
|
|
3095
2926
|
}
|
|
3096
2927
|
getAngle(e) {
|
|
3097
|
-
const
|
|
3098
|
-
if (!
|
|
3099
|
-
return
|
|
2928
|
+
const r = this.states.findLast((n) => n[0] <= e);
|
|
2929
|
+
if (!r) throw new Error("Angle not found");
|
|
2930
|
+
return r[1];
|
|
3100
2931
|
}
|
|
3101
2932
|
getZindex() {
|
|
3102
2933
|
const e = this.provider.getParameters();
|
|
3103
|
-
return Math.round((e.zoomMax - this.zoom) * e.zoomScale) +
|
|
2934
|
+
return Math.round((e.zoomMax - this.zoom) * e.zoomScale) + Gt.Z_INDEX_OFFSET;
|
|
3104
2935
|
}
|
|
3105
2936
|
setCollapsed(e) {
|
|
3106
2937
|
if (this.component == null) throw new Error("Failed to set tooltip collapsed");
|
|
@@ -3116,89 +2947,128 @@ class Zt extends Ut {
|
|
|
3116
2947
|
return this.bodyLoaded;
|
|
3117
2948
|
}
|
|
3118
2949
|
}
|
|
3119
|
-
class
|
|
2950
|
+
class os {
|
|
2951
|
+
marker;
|
|
2952
|
+
zoom;
|
|
2953
|
+
pin;
|
|
2954
|
+
tooltip;
|
|
2955
|
+
popup;
|
|
2956
|
+
constructor(e, r, n) {
|
|
2957
|
+
this.marker = r, this.zoom = n[0], this.pin = new He(e, r, n[0]), this.tooltip = new Gt(e, r, n), this.popup = r.popup ? new Wt(e, r) : void 0;
|
|
2958
|
+
}
|
|
2959
|
+
create() {
|
|
2960
|
+
this.pin.create(), this.tooltip.create(), this.popup?.create();
|
|
2961
|
+
}
|
|
2962
|
+
update(e) {
|
|
2963
|
+
this.pin.update(e), this.tooltip.update(e);
|
|
2964
|
+
}
|
|
2965
|
+
remove() {
|
|
2966
|
+
this.pin.remove(), this.tooltip.remove(), this.popup?.remove();
|
|
2967
|
+
}
|
|
2968
|
+
}
|
|
2969
|
+
var xe;
|
|
2970
|
+
((t) => {
|
|
2971
|
+
function e(l, a, u) {
|
|
2972
|
+
return {
|
|
2973
|
+
x: n(a) * u,
|
|
2974
|
+
y: i(l) * u
|
|
2975
|
+
};
|
|
2976
|
+
}
|
|
2977
|
+
t.project = e;
|
|
2978
|
+
function r(l, a, u) {
|
|
2979
|
+
return {
|
|
2980
|
+
lat: o(a / u),
|
|
2981
|
+
lng: s(l / u)
|
|
2982
|
+
};
|
|
2983
|
+
}
|
|
2984
|
+
t.unproject = r;
|
|
2985
|
+
function n(l) {
|
|
2986
|
+
return (180 + l) / 360;
|
|
2987
|
+
}
|
|
2988
|
+
function i(l) {
|
|
2989
|
+
return (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + l * Math.PI / 360))) / 360;
|
|
2990
|
+
}
|
|
2991
|
+
function s(l) {
|
|
2992
|
+
return l * 360 - 180;
|
|
2993
|
+
}
|
|
2994
|
+
function o(l) {
|
|
2995
|
+
return 360 / Math.PI * Math.atan(Math.exp((180 - l * 360) * Math.PI / 180)) - 90;
|
|
2996
|
+
}
|
|
2997
|
+
})(xe || (xe = {}));
|
|
2998
|
+
class hn {
|
|
2999
|
+
swLat;
|
|
3000
|
+
swLng;
|
|
3001
|
+
neLat;
|
|
3002
|
+
neLng;
|
|
3003
|
+
/**
|
|
3004
|
+
* @param mapBounds - The bounds of the map.
|
|
3005
|
+
* @param mapZoom - The zoom level of the map.
|
|
3006
|
+
* @param mapSize - The size of the map in pixels at zoom level 0.
|
|
3007
|
+
* @param offsetX - The x offset of the map in pixels at zoom level n.
|
|
3008
|
+
* @param offsetY - The y offset of the map in pixels at zoom level n.
|
|
3009
|
+
*/
|
|
3010
|
+
constructor(e, r, n, i, s) {
|
|
3011
|
+
const o = n * Math.pow(2, r), l = xe.project(e.sw.lat, e.sw.lng, o), a = xe.project(e.ne.lat, e.ne.lng, o), u = l.x - i, f = l.y + s, h = a.x + i, p = a.y - s, c = xe.unproject(u, f, o), d = xe.unproject(h, p, o);
|
|
3012
|
+
this.swLat = c.lat, this.swLng = c.lng, this.neLat = d.lat, this.neLng = d.lng;
|
|
3013
|
+
}
|
|
3014
|
+
contains(e, r) {
|
|
3015
|
+
return this.swLat <= e && e <= this.neLat ? this.swLng < this.neLng ? this.swLng <= r && r <= this.neLng : r <= this.neLng || this.swLng <= r : !1;
|
|
3016
|
+
}
|
|
3017
|
+
}
|
|
3018
|
+
class ut {
|
|
3019
|
+
static MAP_PINS_MAX_ZOOM = 2;
|
|
3020
|
+
static MAP_PINS_MAX_COUNT = 128;
|
|
3120
3021
|
provider;
|
|
3121
3022
|
// Data
|
|
3122
|
-
|
|
3023
|
+
pinElements = new Array();
|
|
3123
3024
|
// Configuration
|
|
3124
|
-
|
|
3125
|
-
|
|
3025
|
+
pinMaxWidth = 0;
|
|
3026
|
+
pinMaxHeight = 0;
|
|
3027
|
+
pinFade = !1;
|
|
3028
|
+
pinMaxCount = 0;
|
|
3029
|
+
pinMaxZoomDelta = 0;
|
|
3126
3030
|
constructor(e) {
|
|
3127
3031
|
this.provider = e;
|
|
3128
3032
|
}
|
|
3033
|
+
setConfiguration(e) {
|
|
3034
|
+
this.pinFade = e?.pin?.fade ?? !0, this.pinMaxCount = e?.pin?.maxCount ?? Math.max(ut.MAP_PINS_MAX_COUNT, 8 * navigator.hardwareConcurrency), this.pinMaxZoomDelta = e?.pin?.maxZoom ?? ut.MAP_PINS_MAX_ZOOM;
|
|
3035
|
+
}
|
|
3129
3036
|
updateElements(e) {
|
|
3130
|
-
this.
|
|
3037
|
+
this.pinElements = e, this.pinMaxWidth = e.reduce((r, n) => Math.max(r, n.style.width), 0), this.pinMaxHeight = e.reduce((r, n) => Math.max(r, n.style.height), 0);
|
|
3131
3038
|
}
|
|
3132
3039
|
removeElements() {
|
|
3133
|
-
this.
|
|
3040
|
+
this.pinElements.forEach((e) => e.removeMarker()), this.pinElements.length = 0;
|
|
3134
3041
|
}
|
|
3135
|
-
process(e,
|
|
3136
|
-
const
|
|
3137
|
-
|
|
3138
|
-
|
|
3042
|
+
process(e, r) {
|
|
3043
|
+
const n = this.provider.getParameters().mapSize, i = new hn(e, r, n, this.pinMaxWidth * 2, this.pinMaxHeight * 2);
|
|
3044
|
+
let s = 0;
|
|
3045
|
+
for (const o of this.pinElements)
|
|
3046
|
+
i.contains(o.lat, o.lng) ? o.shown && r < o.zoom && o.zoom < r + this.pinMaxZoomDelta ? (s < this.pinMaxCount && (o.setCollapsed(!1), o.setScale(this.pinFade ? o.getScaleFromZoomDistance(r) : 1), o.updateMarker(!0), o.isBodyLoaded() == !1 && o.updateBody()), s++) : (o.setCollapsed(!0), o.isCollapsed() && o.updateMarker(!1)) : o.updateMarker(!1);
|
|
3139
3047
|
}
|
|
3140
3048
|
}
|
|
3141
|
-
class
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
constructor(e, n) {
|
|
3151
|
-
if (n.popup == null) throw new Error("Failed to create popup");
|
|
3152
|
-
super(e, n), 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;
|
|
3153
|
-
}
|
|
3154
|
-
createElement() {
|
|
3155
|
-
this.element = document.createElement("div"), this.element.classList.add("popup"), this.component = Nt(Zn, {
|
|
3156
|
-
target: this.element,
|
|
3157
|
-
props: {
|
|
3158
|
-
id: this.id + "_popup",
|
|
3159
|
-
layer: ki,
|
|
3160
|
-
priority: 0,
|
|
3161
|
-
width: this.width,
|
|
3162
|
-
height: this.height,
|
|
3163
|
-
margin: this.margin,
|
|
3164
|
-
radius: this.radius
|
|
3165
|
-
}
|
|
3166
|
-
});
|
|
3167
|
-
}
|
|
3168
|
-
updateMap(e) {
|
|
3169
|
-
super.updateMap(e), this.component?.setDisplayed(e);
|
|
3170
|
-
}
|
|
3171
|
-
updateBody() {
|
|
3172
|
-
if (this.bodyLoaded || this.bodyLoading) return;
|
|
3173
|
-
const e = this.component?.getBody();
|
|
3174
|
-
e != null && (this.bodyLoading = !0, this.bodyCallback(this.id).then((n) => {
|
|
3175
|
-
n instanceof HTMLElement ? e.appendChild(n) : console.error("Failed to load popup body");
|
|
3176
|
-
}).catch((n) => console.error(n)).finally(() => {
|
|
3177
|
-
this.bodyLoaded = !0, this.bodyLoading = !1;
|
|
3178
|
-
}));
|
|
3179
|
-
}
|
|
3180
|
-
getZindex() {
|
|
3181
|
-
return qt.Z_INDEX_OFFSET;
|
|
3182
|
-
}
|
|
3183
|
-
setCollapsed(e) {
|
|
3184
|
-
if (this.component == null) throw new Error("Failed to set popup collapsed");
|
|
3185
|
-
this.component.setCollapsed(e);
|
|
3186
|
-
}
|
|
3187
|
-
setAngle(e) {
|
|
3188
|
-
if (this.component == null) throw new Error("Failed to set popup angle");
|
|
3189
|
-
this.component.setAngle(e, !0);
|
|
3049
|
+
class as {
|
|
3050
|
+
provider;
|
|
3051
|
+
// Data
|
|
3052
|
+
tooltipElements = new Array();
|
|
3053
|
+
// Configuration
|
|
3054
|
+
tooltipMaxWidth = 0;
|
|
3055
|
+
tooltipMaxHeight = 0;
|
|
3056
|
+
constructor(e) {
|
|
3057
|
+
this.provider = e;
|
|
3190
3058
|
}
|
|
3191
|
-
|
|
3192
|
-
|
|
3059
|
+
updateElements(e) {
|
|
3060
|
+
this.tooltipElements = e, this.tooltipMaxWidth = this.tooltipElements.reduce((r, n) => Math.max(r, n.style.width), 0), this.tooltipMaxHeight = this.tooltipElements.reduce((r, n) => Math.max(r, n.style.height), 0);
|
|
3193
3061
|
}
|
|
3194
|
-
|
|
3195
|
-
|
|
3062
|
+
removeElements() {
|
|
3063
|
+
this.tooltipElements.forEach((e) => e.removeMarker()), this.tooltipElements.length = 0;
|
|
3196
3064
|
}
|
|
3197
|
-
|
|
3198
|
-
|
|
3065
|
+
process(e, r) {
|
|
3066
|
+
const n = this.provider.getParameters().mapSize, i = new hn(e, r, n, this.tooltipMaxWidth * 2, this.tooltipMaxHeight * 2);
|
|
3067
|
+
for (const s of this.tooltipElements)
|
|
3068
|
+
i.contains(s.lat, s.lng) ? s.shown && s.zoom <= r ? (s.updateState(r), s.setCollapsed(!1), s.updateMarker(!0), s.isCollapsed() == !1 && s.isBodyLoaded() == !1 && s.updateBody()) : (s.setCollapsed(!0), s.isCollapsed() && s.updateMarker(!1)) : s.updateMarker(!1);
|
|
3199
3069
|
}
|
|
3200
3070
|
}
|
|
3201
|
-
class
|
|
3071
|
+
class ls {
|
|
3202
3072
|
provider;
|
|
3203
3073
|
// Data
|
|
3204
3074
|
popupElements = new Array();
|
|
@@ -3213,31 +3083,241 @@ class Ji {
|
|
|
3213
3083
|
e.popup && (e.pin.shown = !0, e.tooltip.shown = !0, e.popup.shown = !1);
|
|
3214
3084
|
}
|
|
3215
3085
|
updateElements(e) {
|
|
3216
|
-
this.popupElements = e, this.popupPositioned = new Map(e.map((
|
|
3086
|
+
this.popupElements = e, this.popupPositioned = new Map(e.map((r) => [r.id, !1]));
|
|
3217
3087
|
}
|
|
3218
3088
|
removeElements() {
|
|
3219
|
-
this.popupElements.forEach((e) => e.
|
|
3089
|
+
this.popupElements.forEach((e) => e.removeMarker()), this.popupElements.length = 0, this.popupPositioned.clear();
|
|
3220
3090
|
}
|
|
3221
3091
|
process() {
|
|
3222
3092
|
for (const e of this.popupElements)
|
|
3223
3093
|
if (e.shown) {
|
|
3224
|
-
if (e.setCollapsed(!1), e.
|
|
3225
|
-
const
|
|
3226
|
-
if (n == null) continue;
|
|
3227
|
-
const r = e.component?.getOffsets();
|
|
3094
|
+
if (e.setCollapsed(!1), e.updateMarker(!0), e.isExpanded() && e.isBodyLoaded() == !1 && e.updateBody(), e.isCollapsed() == !1 && this.popupPositioned.get(e.id) == !1) {
|
|
3095
|
+
const r = e.component?.getBody();
|
|
3228
3096
|
if (r == null) continue;
|
|
3229
|
-
const
|
|
3097
|
+
const n = e.component?.getOffsets();
|
|
3098
|
+
if (n == null) continue;
|
|
3099
|
+
const i = r.getBoundingClientRect();
|
|
3230
3100
|
if (i.x == 0 && i.y == 0 && i.width == 0 && i.height == 0) continue;
|
|
3231
|
-
const s = i.x + i.width / 2, o = i.y + i.height / 2,
|
|
3232
|
-
this.provider.panBy(
|
|
3101
|
+
const s = i.x + i.width / 2, o = i.y + i.height / 2, l = s + n.x, a = o + n.y, u = l + e.style.width, f = a + e.style.height, h = this.provider.getContainer().getBoundingClientRect(), p = l - h.left, c = h.right - u, d = a - h.top, w = h.bottom - f, O = Math.min(e.style.width, e.style.height) / 4, K = p < 0 ? p - O : c < 0 ? -c + O : 0, b = d < 0 ? d - O : w < 0 ? -w + O : 0;
|
|
3102
|
+
this.provider.panBy(K, b), this.popupPositioned.set(e.id, !0);
|
|
3233
3103
|
}
|
|
3234
3104
|
} else
|
|
3235
|
-
e.setCollapsed(!0), e.isCollapsed() && e.
|
|
3105
|
+
e.setCollapsed(!0), e.isCollapsed() && e.updateMarker(!1);
|
|
3106
|
+
}
|
|
3107
|
+
}
|
|
3108
|
+
class us {
|
|
3109
|
+
markerPinProcessor;
|
|
3110
|
+
markerTooltipProcessor;
|
|
3111
|
+
markerPopupProcessor;
|
|
3112
|
+
constructor(e) {
|
|
3113
|
+
this.markerPinProcessor = new ut(e), this.markerTooltipProcessor = new as(e), this.markerPopupProcessor = new ls(e);
|
|
3114
|
+
}
|
|
3115
|
+
setConfiguration(e) {
|
|
3116
|
+
this.markerPinProcessor.setConfiguration(e);
|
|
3117
|
+
}
|
|
3118
|
+
updateElements(e) {
|
|
3119
|
+
this.markerPinProcessor.updateElements(e.map((r) => r.pin)), this.markerTooltipProcessor.updateElements(e.map((r) => r.tooltip)), this.markerPopupProcessor.updateElements(e.map((r) => r.popup).filter((r) => r != null));
|
|
3120
|
+
}
|
|
3121
|
+
removeElements() {
|
|
3122
|
+
this.markerPinProcessor.removeElements(), this.markerTooltipProcessor.removeElements(), this.markerPopupProcessor.removeElements();
|
|
3123
|
+
}
|
|
3124
|
+
processElements(e, r) {
|
|
3125
|
+
this.markerPinProcessor.process(e, r), this.markerTooltipProcessor.process(e, r), this.markerPopupProcessor.process();
|
|
3126
|
+
}
|
|
3127
|
+
showPopup(e) {
|
|
3128
|
+
this.markerPopupProcessor.show(e);
|
|
3129
|
+
}
|
|
3130
|
+
hidePopup(e) {
|
|
3131
|
+
this.markerPopupProcessor.hide(e);
|
|
3132
|
+
}
|
|
3133
|
+
}
|
|
3134
|
+
var Ve;
|
|
3135
|
+
((t) => {
|
|
3136
|
+
async function e(n, i) {
|
|
3137
|
+
const s = await fetch(n, i);
|
|
3138
|
+
if (!s.ok) throw new Error(s.statusText);
|
|
3139
|
+
return s.json();
|
|
3140
|
+
}
|
|
3141
|
+
t.get = e;
|
|
3142
|
+
async function r(n, i, s) {
|
|
3143
|
+
const o = await fetch(n, {
|
|
3144
|
+
method: "POST",
|
|
3145
|
+
body: JSON.stringify(i),
|
|
3146
|
+
headers: {
|
|
3147
|
+
"Content-Type": "application/json",
|
|
3148
|
+
...s?.headers
|
|
3149
|
+
},
|
|
3150
|
+
...s
|
|
3151
|
+
});
|
|
3152
|
+
if (!o.ok) throw new Error(o.statusText);
|
|
3153
|
+
return o.json();
|
|
3154
|
+
}
|
|
3155
|
+
t.post = r;
|
|
3156
|
+
})(Ve || (Ve = {}));
|
|
3157
|
+
const fs = /* @__PURE__ */ _(/* @__PURE__ */ te(), /* @__PURE__ */ sn(32)), cs = /* @__PURE__ */ _(/* @__PURE__ */ te(), /* @__PURE__ */ Xt(1)), wr = "1.2.1", Kt = "https://maps.api.arenarium.dev", ps = `${Kt}/auth`, hs = `${Kt}/states`, ds = `${Kt}/log`;
|
|
3158
|
+
class dn {
|
|
3159
|
+
apiKey;
|
|
3160
|
+
apiToken;
|
|
3161
|
+
apiDevEnvironment;
|
|
3162
|
+
mapProvider;
|
|
3163
|
+
mapMarkerProcessor;
|
|
3164
|
+
mapMarkerElementArray = new Array();
|
|
3165
|
+
mapMarkerElementMap = /* @__PURE__ */ new Map();
|
|
3166
|
+
mapMarkerElementsUpdating = !1;
|
|
3167
|
+
constructor(e, r, n, i) {
|
|
3168
|
+
rt(fs, e), rt(cs, r), rt(es, n), this.apiKey = e, this.apiToken = r, this.apiDevEnvironment = window?.location.host.startsWith("localhost") || window?.location.host.startsWith("127.0.0.1"), this.mapProvider = n, this.mapMarkerProcessor = new us(n), this.setConfiguration(i);
|
|
3169
|
+
}
|
|
3170
|
+
static async create(e, r, n) {
|
|
3171
|
+
const i = { key: e, version: wr };
|
|
3172
|
+
let o = (await Ve.post(ps, i)).token;
|
|
3173
|
+
if (!o) throw new Error("Failed to get api token");
|
|
3174
|
+
return new dn(e, o, r, n);
|
|
3175
|
+
}
|
|
3176
|
+
setConfiguration(e) {
|
|
3177
|
+
ae.setLimit(e?.animation?.queue?.limit ?? 8 * navigator.hardwareConcurrency), this.mapMarkerProcessor.setConfiguration(e);
|
|
3178
|
+
}
|
|
3179
|
+
async updateMarkers(e) {
|
|
3180
|
+
rt(is, e);
|
|
3181
|
+
try {
|
|
3182
|
+
await this.updateMarkerElements(e), this.processMarkerElementsCallback();
|
|
3183
|
+
} catch (r) {
|
|
3184
|
+
throw this.removeMarkerElements(), this.log("error", "Failed to update markers", r), r;
|
|
3185
|
+
}
|
|
3186
|
+
}
|
|
3187
|
+
removeMarkers() {
|
|
3188
|
+
try {
|
|
3189
|
+
this.removeMarkerElements();
|
|
3190
|
+
} catch (e) {
|
|
3191
|
+
throw this.log("error", "Failed to remove markers", e), e;
|
|
3192
|
+
}
|
|
3193
|
+
}
|
|
3194
|
+
showPopup(e) {
|
|
3195
|
+
try {
|
|
3196
|
+
for (const r of this.mapMarkerElementArray)
|
|
3197
|
+
r.marker.id == e ? this.mapMarkerProcessor.showPopup(r) : this.mapMarkerProcessor.hidePopup(r);
|
|
3198
|
+
} catch (r) {
|
|
3199
|
+
for (const n of this.mapMarkerElementArray)
|
|
3200
|
+
this.mapMarkerProcessor.hidePopup(n);
|
|
3201
|
+
throw this.log("error", "Failed to show popup", r), r;
|
|
3202
|
+
}
|
|
3203
|
+
}
|
|
3204
|
+
hidePopup(e) {
|
|
3205
|
+
try {
|
|
3206
|
+
if (e) {
|
|
3207
|
+
const r = this.mapMarkerElementMap.get(e);
|
|
3208
|
+
if (r == null) return;
|
|
3209
|
+
this.mapMarkerProcessor.hidePopup(r);
|
|
3210
|
+
} else
|
|
3211
|
+
for (const r of this.mapMarkerElementArray)
|
|
3212
|
+
this.mapMarkerProcessor.hidePopup(r);
|
|
3213
|
+
} catch (r) {
|
|
3214
|
+
for (const n of this.mapMarkerElementArray)
|
|
3215
|
+
this.mapMarkerProcessor.hidePopup(n);
|
|
3216
|
+
throw this.log("error", "Failed to hide popup", r), r;
|
|
3217
|
+
}
|
|
3218
|
+
}
|
|
3219
|
+
async updateMarkerElements(e) {
|
|
3220
|
+
try {
|
|
3221
|
+
let r = this.mapMarkerElementArray.map((i) => i.marker);
|
|
3222
|
+
for (let i = 0; i < e.length; i++) {
|
|
3223
|
+
const s = e[i];
|
|
3224
|
+
this.mapMarkerElementMap.get(s.id) || r.push(s);
|
|
3225
|
+
}
|
|
3226
|
+
const n = await this.getMarkerStates(r);
|
|
3227
|
+
try {
|
|
3228
|
+
this.mapMarkerElementsUpdating = !0;
|
|
3229
|
+
for (let i = 0; i < r.length; i++) {
|
|
3230
|
+
const s = r[i], o = n[i], l = this.mapMarkerElementMap.get(s.id);
|
|
3231
|
+
if (l)
|
|
3232
|
+
l.update(o);
|
|
3233
|
+
else {
|
|
3234
|
+
const a = new os(this.mapProvider, s, o);
|
|
3235
|
+
a.create(), this.mapMarkerElementMap.set(s.id, a), this.mapMarkerElementArray.push(a);
|
|
3236
|
+
}
|
|
3237
|
+
}
|
|
3238
|
+
this.mapMarkerElementArray.sort((i, s) => i.zoom - s.zoom), this.mapMarkerProcessor.updateElements(this.mapMarkerElementArray);
|
|
3239
|
+
} finally {
|
|
3240
|
+
this.mapMarkerElementsUpdating = !1;
|
|
3241
|
+
}
|
|
3242
|
+
} catch (r) {
|
|
3243
|
+
throw this.mapMarkerProcessor.removeElements(), this.mapMarkerElementArray.length = 0, this.mapMarkerElementMap.clear(), r;
|
|
3244
|
+
} finally {
|
|
3245
|
+
this.mapMarkerElementsUpdating = !1;
|
|
3246
|
+
}
|
|
3247
|
+
}
|
|
3248
|
+
removeMarkerElements() {
|
|
3249
|
+
try {
|
|
3250
|
+
this.mapMarkerElementsUpdating = !0, this.mapMarkerProcessor.removeElements(), this.mapMarkerElementArray.length = 0, this.mapMarkerElementMap.clear();
|
|
3251
|
+
} finally {
|
|
3252
|
+
this.mapMarkerElementsUpdating = !1;
|
|
3253
|
+
}
|
|
3254
|
+
}
|
|
3255
|
+
async getMarkerStates(e) {
|
|
3256
|
+
if (e.length == 0) return [];
|
|
3257
|
+
if (e.length == 1) return [[0, [[0, ye.DEGREES.indexOf(ye.DEGREES_DEFAULT)]]]];
|
|
3258
|
+
const r = e.map((s) => ({
|
|
3259
|
+
id: s.id,
|
|
3260
|
+
rank: s.rank,
|
|
3261
|
+
lat: s.lat,
|
|
3262
|
+
lng: s.lng,
|
|
3263
|
+
width: s.tooltip.style.width,
|
|
3264
|
+
height: s.tooltip.style.height,
|
|
3265
|
+
margin: s.tooltip.style.margin
|
|
3266
|
+
})), n = {
|
|
3267
|
+
key: this.apiKey,
|
|
3268
|
+
token: this.apiToken,
|
|
3269
|
+
parameters: this.mapProvider.getParameters(),
|
|
3270
|
+
input: r
|
|
3271
|
+
}, i = await Ve.post(hs, n, {
|
|
3272
|
+
headers: { "Cache-Control": this.apiDevEnvironment ? "no-cache" : "" }
|
|
3273
|
+
});
|
|
3274
|
+
return i.token && (this.apiToken = i.token), i.states;
|
|
3275
|
+
}
|
|
3276
|
+
processMarkerElementsCallback() {
|
|
3277
|
+
if (this.mapProvider.getContainer().parentElement != null && this.mapMarkerElementArray.length != 0)
|
|
3278
|
+
try {
|
|
3279
|
+
this.processMarkerElements(), window.setTimeout(this.processMarkerElementsCallback.bind(this), 25);
|
|
3280
|
+
} catch (e) {
|
|
3281
|
+
this.log("error", "Failed to process marker elements", e);
|
|
3282
|
+
}
|
|
3283
|
+
}
|
|
3284
|
+
processMarkerElements() {
|
|
3285
|
+
if (this.mapMarkerElementsUpdating) return;
|
|
3286
|
+
const e = this.mapProvider.getBounds(), r = this.mapProvider.getZoom();
|
|
3287
|
+
this.mapMarkerProcessor.processElements(e, r);
|
|
3288
|
+
}
|
|
3289
|
+
async log(e, r, n) {
|
|
3290
|
+
switch (e) {
|
|
3291
|
+
case "info":
|
|
3292
|
+
console.info(n);
|
|
3293
|
+
break;
|
|
3294
|
+
case "warn":
|
|
3295
|
+
console.warn(n);
|
|
3296
|
+
break;
|
|
3297
|
+
case "error":
|
|
3298
|
+
console.error(n);
|
|
3299
|
+
break;
|
|
3300
|
+
}
|
|
3301
|
+
if (n instanceof Error && !this.apiDevEnvironment)
|
|
3302
|
+
try {
|
|
3303
|
+
const i = {
|
|
3304
|
+
key: this.apiKey,
|
|
3305
|
+
title: r,
|
|
3306
|
+
level: e,
|
|
3307
|
+
content: {
|
|
3308
|
+
version: wr,
|
|
3309
|
+
...n
|
|
3310
|
+
}
|
|
3311
|
+
};
|
|
3312
|
+
await Ve.post(ds, i);
|
|
3313
|
+
} catch (i) {
|
|
3314
|
+
console.error(i);
|
|
3315
|
+
}
|
|
3236
3316
|
}
|
|
3237
3317
|
}
|
|
3238
|
-
const
|
|
3318
|
+
const vs = () => '<img src="https://arenarium.dev/favicon.svg" alt="Arenarium Maps" style="height: 1.25em; vertical-align: middle;" />', gs = () => `<a href="https://arenarium.dev" target="_blank" style="color: inherit;">${vs()}<span> @arenarium/maps</span></a>`;
|
|
3239
3319
|
export {
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3320
|
+
dn as MapManager,
|
|
3321
|
+
gs as getAttributionHtml,
|
|
3322
|
+
vs as getImageHtml
|
|
3243
3323
|
};
|