@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.es.js CHANGED
@@ -1,59 +1,59 @@
1
- var ln = Array.isArray, ur = Array.prototype.indexOf, fr = Array.from, vt = Object.defineProperty, Oe = Object.getOwnPropertyDescriptor, cr = Object.prototype, hr = Array.prototype, pr = Object.getPrototypeOf, Gt = Object.isExtensible;
2
- function dr(t) {
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 vr() {
7
- var t, e, n = new Promise((r, i) => {
8
- t = r, e = i;
6
+ function Cn() {
7
+ var t, e, r = new Promise((n, i) => {
8
+ t = n, e = i;
9
9
  });
10
- return { promise: n, resolve: t, reject: e };
10
+ return { promise: r, resolve: t, reject: e };
11
11
  }
12
- const O = 2, Pt = 4, un = 8, De = 16, ae = 32, me = 64, St = 128, U = 256, tt = 512, T = 1024, J = 2048, le = 4096, xe = 8192, Ce = 16384, At = 32768, fn = 65536, Kt = 1 << 17, mr = 1 << 18, Te = 1 << 19, yr = 1 << 20, mt = 1 << 21, Dt = 1 << 22, pe = 1 << 23, Qe = Symbol("$state"), Ct = new class extends Error {
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 gr() {
16
+ function In() {
17
17
  throw new Error("https://svelte.dev/e/async_derived_orphan");
18
18
  }
19
- function _r(t) {
19
+ function Dn(t) {
20
20
  throw new Error("https://svelte.dev/e/effect_in_teardown");
21
21
  }
22
- function wr() {
22
+ function On() {
23
23
  throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
24
24
  }
25
- function Er(t) {
25
+ function Fn(t) {
26
26
  throw new Error("https://svelte.dev/e/effect_orphan");
27
27
  }
28
- function br() {
28
+ function Rn() {
29
29
  throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
30
30
  }
31
- function kr() {
31
+ function Nn() {
32
32
  throw new Error("https://svelte.dev/e/state_descriptors_fixed");
33
33
  }
34
- function Mr() {
34
+ function jn() {
35
35
  throw new Error("https://svelte.dev/e/state_prototype_fixed");
36
36
  }
37
- function xr() {
37
+ function zn() {
38
38
  throw new Error("https://svelte.dev/e/state_unsafe_mutation");
39
39
  }
40
- function Pr() {
40
+ function Bn() {
41
41
  throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
42
42
  }
43
- const Sr = 2, M = Symbol();
44
- function Ar() {
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 cn(t) {
47
+ function Mr(t) {
48
48
  return t === this.v;
49
49
  }
50
- let q = null;
51
- function Pe(t) {
52
- q = t;
50
+ let Y = null;
51
+ function Ce(t) {
52
+ Y = t;
53
53
  }
54
- function Tt(t, e = !1, n) {
55
- q = {
56
- p: q,
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 Lt(t) {
64
+ function Bt(t) {
65
65
  var e = (
66
66
  /** @type {ComponentContext} */
67
- q
68
- ), n = e.e;
69
- if (n !== null) {
67
+ Y
68
+ ), r = e.e;
69
+ if (r !== null) {
70
70
  e.e = null;
71
- for (var r of n)
72
- Mn(r);
71
+ for (var n of r)
72
+ Nr(n);
73
73
  }
74
- return t !== void 0 && (e.x = t), q = e.p, t ?? /** @type {T} */
74
+ return t !== void 0 && (e.x = t), Y = e.p, t ?? /** @type {T} */
75
75
  {};
76
76
  }
77
- function hn() {
77
+ function xr() {
78
78
  return !0;
79
79
  }
80
- let we = [];
81
- function Dr() {
82
- var t = we;
83
- we = [], dr(t);
80
+ let Me = [];
81
+ function qn() {
82
+ var t = Me;
83
+ Me = [], An(t);
84
84
  }
85
- function ot(t) {
86
- if (we.length === 0) {
87
- var e = we;
85
+ function ft(t) {
86
+ if (Me.length === 0) {
87
+ var e = Me;
88
88
  queueMicrotask(() => {
89
- e === we && Dr();
89
+ e === Me && qn();
90
90
  });
91
91
  }
92
- we.push(t);
92
+ Me.push(t);
93
93
  }
94
- const Cr = /* @__PURE__ */ new WeakMap();
95
- function pn(t) {
94
+ const Hn = /* @__PURE__ */ new WeakMap();
95
+ function Pr(t) {
96
96
  var e = m;
97
97
  if (e === null)
98
- return v.f |= pe, t;
99
- if ((e.f & At) === 0) {
100
- if ((e.f & St) === 0)
101
- throw !e.parent && t instanceof Error && dn(t), t;
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
- Se(t, e);
104
+ Te(t, e);
105
105
  }
106
- function Se(t, e) {
106
+ function Te(t, e) {
107
107
  for (; e !== null; ) {
108
- if ((e.f & St) !== 0)
108
+ if ((e.f & Ft) !== 0)
109
109
  try {
110
110
  e.b.error(t);
111
111
  return;
112
- } catch (n) {
113
- t = n;
112
+ } catch (r) {
113
+ t = r;
114
114
  }
115
115
  e = e.parent;
116
116
  }
117
- throw t instanceof Error && dn(t), t;
117
+ throw t instanceof Error && Sr(t), t;
118
118
  }
119
- function dn(t) {
120
- const e = Cr.get(t);
121
- e && (vt(t, "message", {
119
+ function Sr(t) {
120
+ const e = Hn.get(t);
121
+ e && (xt(t, "message", {
122
122
  value: e.message
123
- }), vt(t, "stack", {
123
+ }), xt(t, "stack", {
124
124
  value: e.stack
125
125
  }));
126
126
  }
127
- const ht = /* @__PURE__ */ new Set();
128
- let S = null, yt = /* @__PURE__ */ new Set(), Ue = [], It = null, gt = !1;
129
- class ee {
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
- #r = null;
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
- #n = [];
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
- #h = [];
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
- Ue = [];
214
+ Xe = [];
215
215
  for (const i of e)
216
- this.#p(i);
216
+ this.#h(i);
217
217
  if (this.#o.length === 0 && this.#a === 0) {
218
218
  this.#d();
219
- var n = this.#n, r = this.#s;
220
- this.#n = [], this.#s = [], this.#l = [], S = null, Jt(n), Jt(r), S === null ? S = this : ht.delete(this), this.#r?.resolve();
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.#n), this.#u(this.#s), this.#u(this.#l);
222
+ this.#u(this.#r), this.#u(this.#s), this.#u(this.#l);
223
223
  for (const i of this.#o)
224
- Me(i);
224
+ Se(i);
225
225
  for (const i of this.#i)
226
- Me(i);
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
- #p(e) {
235
- e.f ^= T;
236
- for (var n = e.first; n !== null; ) {
237
- var r = n.f, i = (r & (ae | me)) !== 0, s = i && (r & T) !== 0, o = s || (r & xe) !== 0 || this.skipped_effects.has(n);
238
- if (!o && n.fn !== null) {
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
- n.f ^= T;
241
- else if ((r & Pt) !== 0)
242
- this.#s.push(n);
243
- else if ((r & T) === 0)
244
- if ((r & Dt) !== 0) {
245
- var a = n.b?.is_pending() ? this.#i : this.#o;
246
- a.push(n);
247
- } else lt(n) && ((n.f & De) !== 0 && this.#l.push(n), Me(n));
248
- var l = n.first;
249
- if (l !== null) {
250
- n = l;
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 = n.parent;
255
- for (n = n.next; n === null && u !== null; )
256
- n = u.next, u = u.parent;
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 n of e)
264
- ((n.f & J) !== 0 ? this.#h : this.#f).push(n), Z(n, T);
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, n) {
274
- this.#e.has(e) || this.#e.set(e, n), this.current.set(e, e.v);
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
- S = this;
277
+ A = this;
278
278
  }
279
279
  deactivate() {
280
- S = null;
281
- for (const e of yt)
282
- if (yt.delete(e), e(), S !== null)
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
- Ue.length > 0 ? Tr() : this.#d(), S === this && (this.#a === 0 && ht.delete(this), this.deactivate());
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.#h)
306
- Z(e, J), Ze(e);
305
+ for (const e of this.#p)
306
+ H(e, re), We(e);
307
307
  for (const e of this.#f)
308
- Z(e, le), Ze(e);
309
- this.#n = [], this.#s = [], this.flush();
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.#r ??= vr()).promise;
318
+ return (this.#n ??= Cn()).promise;
319
319
  }
320
320
  static ensure() {
321
- if (S === null) {
322
- const e = S = new ee();
323
- ht.add(S), ee.enqueue(() => {
324
- S === e && e.flush();
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 S;
327
+ return A;
328
328
  }
329
329
  /** @param {() => void} task */
330
330
  static enqueue(e) {
331
- ot(e);
331
+ ft(e);
332
332
  }
333
333
  }
334
- function Tr() {
335
- var t = ke;
336
- gt = !0;
334
+ function Yn() {
335
+ var t = Pe;
336
+ At = !0;
337
337
  try {
338
338
  var e = 0;
339
- for ($t(!0); Ue.length > 0; ) {
340
- var n = ee.ensure();
339
+ for (fr(!0); Xe.length > 0; ) {
340
+ var r = ie.ensure();
341
341
  if (e++ > 1e3) {
342
- var r, i;
343
- Lr();
342
+ var n, i;
343
+ Vn();
344
344
  }
345
- n.process(Ue), oe.clear();
345
+ r.process(Xe), ue.clear();
346
346
  }
347
347
  } finally {
348
- gt = !1, $t(t), It = null;
348
+ At = !1, fr(t), Ut = null;
349
349
  }
350
350
  }
351
- function Lr() {
351
+ function Vn() {
352
352
  try {
353
- br();
353
+ Rn();
354
354
  } catch (t) {
355
- Se(t, It);
355
+ Te(t, Ut);
356
356
  }
357
357
  }
358
- let he = null;
359
- function Jt(t) {
358
+ let de = null;
359
+ function ar(t) {
360
360
  var e = t.length;
361
361
  if (e !== 0) {
362
- for (var n = 0; n < e; ) {
363
- var r = t[n++];
364
- if ((r.f & (Ce | xe)) === 0 && lt(r) && (he = [], Me(r), r.deps === null && r.first === null && r.nodes_start === null && (r.teardown === null && r.ac === null ? An(r) : r.fn = null), he?.length > 0)) {
365
- oe.clear();
366
- for (const i of he)
367
- Me(i);
368
- he = [];
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
- he = null;
371
+ de = null;
372
372
  }
373
373
  }
374
- function Ze(t) {
375
- for (var e = It = t; e.parent !== null; ) {
374
+ function We(t) {
375
+ for (var e = Ut = t; e.parent !== null; ) {
376
376
  e = e.parent;
377
- var n = e.f;
378
- if (gt && e === m && (n & De) !== 0)
377
+ var r = e.f;
378
+ if (At && e === m && (r & Ie) !== 0)
379
379
  return;
380
- if ((n & (me | ae)) !== 0) {
381
- if ((n & T) === 0) return;
382
- e.f ^= T;
380
+ if ((r & (ge | fe)) !== 0) {
381
+ if ((r & I) === 0) return;
382
+ e.f ^= I;
383
383
  }
384
384
  }
385
- Ue.push(e);
385
+ Xe.push(e);
386
386
  }
387
- function Ir(t) {
388
- let e = 0, n = at(0), r;
387
+ function Xn(t) {
388
+ let e = 0, r = ct(0), n;
389
389
  return () => {
390
- Wr() && (_(n), Rt(() => (e === 0 && (r = On(() => t(() => Re(n)))), e += 1, () => {
391
- ot(() => {
392
- e -= 1, e === 0 && (r?.(), r = void 0, Re(n));
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 Fr = fn | Te | St;
398
- function Or(t, e, n) {
399
- new Rr(t, e, n);
397
+ var Wn = br | Oe | Ft;
398
+ function Gn(t, e, r) {
399
+ new Kn(t, e, r);
400
400
  }
401
- class Rr {
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
- #r;
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
- #n = null;
418
+ #r = null;
419
419
  /** @type {Effect | null} */
420
420
  #s = null;
421
421
  /** @type {DocumentFragment | null} */
422
422
  #l = null;
423
- #h = 0;
423
+ #p = 0;
424
424
  #f = 0;
425
- #p = !1;
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 && nt(this.#u, this.#h);
435
+ this.#u && at(this.#u, this.#p);
436
436
  };
437
- #g = Ir(() => (this.#u = at(this.#h), () => {
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, n, r) {
446
- this.#t = e, this.#r = n, this.#c = r, this.parent = /** @type {Effect} */
447
- m.b, this.#e = !!this.#r.pending, this.#o = Qr(() => {
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 = ce(() => r(this.#t));
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
- }, Fr);
457
+ }, Wn);
458
458
  }
459
459
  #_() {
460
460
  try {
461
- this.#i = ce(() => this.#c(this.#t));
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.#r.pending;
469
- e && (this.#n = ce(() => e(this.#t)), ee.enqueue(() => {
470
- this.#i = this.#v(() => (ee.ensure(), ce(() => this.#c(this.#t)))), this.#f > 0 ? this.#m() : ($e(
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.#n,
472
+ this.#r,
473
473
  () => {
474
- this.#n = null;
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.#r.pending;
487
+ return !!this.#n.pending;
488
488
  }
489
489
  /**
490
490
  * @param {() => Effect | null} fn
491
491
  */
492
492
  #v(e) {
493
- var n = m, r = v, i = q;
494
- Q(this.#o), L(this.#o), Pe(this.#o.ctx);
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 pn(s), null;
498
+ return Pr(s), null;
499
499
  } finally {
500
- Q(n), L(r), Pe(i);
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.#r.pending
506
+ this.#n.pending
507
507
  );
508
- this.#i !== null && (this.#l = document.createDocumentFragment(), Nr(this.#i, this.#l)), this.#n === null && (this.#n = ce(() => e(this.#t)));
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.#n && $e(this.#n, () => {
521
- this.#n = null;
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.#h += e, yt.add(this.#d);
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 n = this.#r.onerror;
542
- let r = this.#r.failed;
543
- if (this.#p || !n && !r)
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 && (K(this.#i), this.#i = null), this.#n && (K(this.#n), this.#n = null), this.#s && (K(this.#s), this.#s = null);
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
- Ar();
549
+ Zn();
550
550
  return;
551
551
  }
552
- i = !0, s && Pr(), ee.ensure(), this.#h = 0, this.#s !== null && $e(this.#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.#p = !1, ce(() => this.#c(this.#t)))), this.#f > 0 ? this.#m() : this.#e = !1;
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 a = v;
556
+ var l = v;
557
557
  try {
558
- L(null), s = !0, n?.(e, o), s = !1;
559
- } catch (l) {
560
- Se(l, this.#o && this.#o.parent);
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
- L(a);
562
+ D(l);
563
563
  }
564
- r && ot(() => {
564
+ n && ft(() => {
565
565
  this.#s = this.#v(() => {
566
- this.#p = !0;
566
+ this.#h = !0;
567
567
  try {
568
- return ce(() => {
569
- r(
568
+ return he(() => {
569
+ n(
570
570
  this.#t,
571
571
  () => e,
572
572
  () => o
573
573
  );
574
574
  });
575
- } catch (l) {
576
- return Se(
577
- l,
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.#p = !1;
582
+ this.#h = !1;
583
583
  }
584
584
  });
585
585
  });
586
586
  }
587
587
  }
588
- function Nr(t, e) {
589
- for (var n = t.nodes_start, r = t.nodes_end; n !== null; ) {
590
- var i = n === r ? null : (
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__ */ Ot(n)
592
+ /* @__PURE__ */ qt(r)
593
593
  );
594
- e.append(n), n = i;
594
+ e.append(r), r = i;
595
595
  }
596
596
  }
597
- function zr(t, e, n) {
598
- const r = Br;
597
+ function Qn(t, e, r) {
598
+ const n = ei;
599
599
  if (e.length === 0) {
600
- n(t.map(r));
600
+ r(t.map(n));
601
601
  return;
602
602
  }
603
- var i = S, s = (
603
+ var i = A, s = (
604
604
  /** @type {Effect} */
605
605
  m
606
- ), o = jr();
607
- Promise.all(e.map((a) => /* @__PURE__ */ Ur(a))).then((a) => {
606
+ ), o = $n();
607
+ Promise.all(e.map((l) => /* @__PURE__ */ ti(l))).then((l) => {
608
608
  i?.activate(), o();
609
609
  try {
610
- n([...t.map(r), ...a]);
611
- } catch (l) {
612
- (s.f & Ce) === 0 && Se(l, s);
610
+ r([...t.map(n), ...l]);
611
+ } catch (a) {
612
+ (s.f & De) === 0 && Te(a, s);
613
613
  }
614
- i?.deactivate(), vn();
615
- }).catch((a) => {
616
- Se(a, s);
614
+ i?.deactivate(), Ar();
615
+ }).catch((l) => {
616
+ Te(l, s);
617
617
  });
618
618
  }
619
- function jr() {
620
- var t = m, e = v, n = q, r = S;
619
+ function $n() {
620
+ var t = m, e = v, r = Y, n = A;
621
621
  return function() {
622
- Q(t), L(e), Pe(n), r?.activate();
622
+ ne(t), D(e), Ce(r), n?.activate();
623
623
  };
624
624
  }
625
- function vn() {
626
- Q(null), L(null), Pe(null);
625
+ function Ar() {
626
+ ne(null), D(null), Ce(null);
627
627
  }
628
628
  // @__NO_SIDE_EFFECTS__
629
- function Br(t) {
630
- var e = O | J, n = v !== null && (v.f & O) !== 0 ? (
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 || n !== null && (n.f & U) !== 0 ? e |= U : m.f |= Te, {
635
- ctx: q,
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: cn,
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
- M
645
+ x
646
646
  ),
647
647
  wv: 0,
648
- parent: n ?? m,
648
+ parent: r ?? m,
649
649
  ac: null
650
650
  };
651
651
  }
652
652
  // @__NO_SIDE_EFFECTS__
653
- function Ur(t, e) {
654
- let n = (
653
+ function ti(t, e) {
654
+ let r = (
655
655
  /** @type {Effect | null} */
656
656
  m
657
657
  );
658
- n === null && gr();
659
- var r = (
658
+ r === null && In();
659
+ var n = (
660
660
  /** @type {Boundary} */
661
- n.b
661
+ r.b
662
662
  ), i = (
663
663
  /** @type {Promise<V>} */
664
664
  /** @type {unknown} */
665
665
  void 0
666
- ), s = at(
666
+ ), s = ct(
667
667
  /** @type {V} */
668
- M
669
- ), o = null, a = !v;
670
- return Jr(() => {
668
+ x
669
+ ), o = null, l = !v;
670
+ return ci(() => {
671
671
  try {
672
- var l = t();
673
- o && Promise.resolve(l).catch(() => {
672
+ var a = t();
673
+ o && Promise.resolve(a).catch(() => {
674
674
  });
675
675
  } catch (c) {
676
- l = Promise.reject(c);
676
+ a = Promise.reject(c);
677
677
  }
678
- var u = () => l;
679
- i = o?.then(u, u) ?? Promise.resolve(l), o = i;
678
+ var u = () => a;
679
+ i = o?.then(u, u) ?? Promise.resolve(a), o = i;
680
680
  var f = (
681
681
  /** @type {Batch} */
682
- S
683
- ), h = r.is_pending();
684
- a && (r.update_pending_count(1), h || f.increment());
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 !== Ct && (s.f |= pe, nt(s, d)) : ((s.f & pe) !== 0 && (s.f ^= pe), nt(s, c)), a && (r.update_pending_count(-1), h || f.decrement()), vn();
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((l) => {
692
+ }), new Promise((a) => {
693
693
  function u(f) {
694
694
  function h() {
695
- f === i ? l(s) : u(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 mn(t) {
702
+ function Cr(t) {
703
703
  var e = t.effects;
704
704
  if (e !== null) {
705
705
  t.effects = null;
706
- for (var n = 0; n < e.length; n += 1)
707
- K(
706
+ for (var r = 0; r < e.length; r += 1)
707
+ ee(
708
708
  /** @type {Effect} */
709
- e[n]
709
+ e[r]
710
710
  );
711
711
  }
712
712
  }
713
- function Zr(t) {
713
+ function ri(t) {
714
714
  for (var e = t.parent; e !== null; ) {
715
- if ((e.f & O) === 0)
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 Ft(t) {
725
- var e, n = m;
726
- Q(Zr(t));
724
+ function Zt(t) {
725
+ var e, r = m;
726
+ ne(ri(t));
727
727
  try {
728
- mn(t), e = In(t);
728
+ Cr(t), e = Vr(t);
729
729
  } finally {
730
- Q(n);
730
+ ne(r);
731
731
  }
732
732
  return e;
733
733
  }
734
- function yn(t) {
735
- var e = Ft(t);
736
- if (t.equals(e) || (t.v = e, t.wv = Tn()), !Le) {
737
- var n = (se || (t.f & U) !== 0) && t.deps !== null ? le : T;
738
- Z(t, n);
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 oe = /* @__PURE__ */ new Map();
742
- function at(t, e) {
743
- var n = {
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: cn,
748
+ equals: Mr,
749
749
  rv: 0,
750
750
  wv: 0
751
751
  };
752
- return n;
752
+ return r;
753
753
  }
754
754
  // @__NO_SIDE_EFFECTS__
755
- function A(t, e) {
756
- const n = at(t);
757
- return ni(n), n;
755
+ function C(t, e) {
756
+ const r = ct(t);
757
+ return mi(r), r;
758
758
  }
759
- function x(t, e, n = !1) {
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
- (!Y || (v.f & Kt) !== 0) && hn() && (v.f & (O | De | Dt | Kt)) !== 0 && !te?.includes(t) && xr();
763
- let r = n ? Fe(e) : e;
764
- return nt(t, r);
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 nt(t, e) {
766
+ function at(t, e) {
767
767
  if (!t.equals(e)) {
768
- var n = t.v;
769
- Le ? oe.set(t, e) : oe.set(t, n), t.v = e;
770
- var r = ee.ensure();
771
- r.capture(t, n), (t.f & O) !== 0 && ((t.f & J) !== 0 && Ft(
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
- ), Z(t, (t.f & U) === 0 ? T : le)), t.wv = Tn(), gn(t, J), m !== null && (m.f & T) !== 0 && (m.f & (ae | me)) === 0 && (N === null ? ri([t]) : N.push(t));
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 Re(t) {
779
- x(t, t.v + 1);
778
+ function Ze(t) {
779
+ P(t, t.v + 1);
780
780
  }
781
- function gn(t, e) {
782
- var n = t.reactions;
783
- if (n !== null)
784
- for (var r = n.length, i = 0; i < r; i++) {
785
- var s = n[i], o = s.f, a = (o & J) === 0;
786
- a && Z(s, e), (o & O) !== 0 ? gn(
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
- le
790
- ) : a && ((o & De) !== 0 && he !== null && he.push(
789
+ ce
790
+ ) : l && ((o & Ie) !== 0 && de !== null && de.push(
791
791
  /** @type {Effect} */
792
792
  s
793
- ), Ze(
793
+ ), We(
794
794
  /** @type {Effect} */
795
795
  s
796
796
  ));
797
797
  }
798
798
  }
799
- function Fe(t) {
800
- if (typeof t != "object" || t === null || Qe in t)
799
+ function je(t) {
800
+ if (typeof t != "object" || t === null || nt in t)
801
801
  return t;
802
- const e = pr(t);
803
- if (e !== cr && e !== hr)
802
+ const e = Sn(t);
803
+ if (e !== xn && e !== Pn)
804
804
  return t;
805
- var n = /* @__PURE__ */ new Map(), r = ln(t), i = /* @__PURE__ */ A(0), s = de, o = (a) => {
806
- if (de === s)
807
- return a();
808
- var l = v, u = de;
809
- L(null), tn(s);
810
- var f = a();
811
- return L(l), tn(u), f;
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 r && n.set("length", /* @__PURE__ */ A(
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(a, l, u) {
821
- (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && kr();
822
- var f = n.get(l);
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__ */ A(u.value);
825
- return n.set(l, h), h;
826
- }) : x(f, u.value, !0), !0;
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(a, l) {
829
- var u = n.get(l);
828
+ deleteProperty(l, a) {
829
+ var u = r.get(a);
830
830
  if (u === void 0) {
831
- if (l in a) {
832
- const f = o(() => /* @__PURE__ */ A(M));
833
- n.set(l, f), Re(i);
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
- x(u, M), Re(i);
836
+ P(u, x), Ze(i);
837
837
  return !0;
838
838
  },
839
- get(a, l, u) {
840
- if (l === Qe)
839
+ get(l, a, u) {
840
+ if (a === nt)
841
841
  return t;
842
- var f = n.get(l), h = l in a;
843
- if (f === void 0 && (!h || Oe(a, l)?.writable) && (f = o(() => {
844
- var c = Fe(h ? a[l] : M), d = /* @__PURE__ */ A(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
- }), n.set(l, f)), f !== void 0) {
847
- var p = _(f);
848
- return p === M ? void 0 : 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(a, l, u);
850
+ return Reflect.get(l, a, u);
851
851
  },
852
- getOwnPropertyDescriptor(a, l) {
853
- var u = Reflect.getOwnPropertyDescriptor(a, l);
852
+ getOwnPropertyDescriptor(l, a) {
853
+ var u = Reflect.getOwnPropertyDescriptor(l, a);
854
854
  if (u && "value" in u) {
855
- var f = n.get(l);
856
- f && (u.value = _(f));
855
+ var f = r.get(a);
856
+ f && (u.value = g(f));
857
857
  } else if (u === void 0) {
858
- var h = n.get(l), p = h?.v;
859
- if (h !== void 0 && p !== M)
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(a, l) {
870
- if (l === Qe)
869
+ has(l, a) {
870
+ if (a === nt)
871
871
  return !0;
872
- var u = n.get(l), f = u !== void 0 && u.v !== M || Reflect.has(a, l);
873
- if (u !== void 0 || m !== null && (!f || Oe(a, l)?.writable)) {
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 ? Fe(a[l]) : M, c = /* @__PURE__ */ A(p);
875
+ var p = f ? je(l[a]) : x, c = /* @__PURE__ */ C(p);
876
876
  return c;
877
- }), n.set(l, u));
878
- var h = _(u);
879
- if (h === M)
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(a, l, u, f) {
885
- var h = n.get(l), p = l in a;
886
- if (r && l === "length")
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 = n.get(c + "");
890
- d !== void 0 ? x(d, M) : c in a && (d = o(() => /* @__PURE__ */ A(M)), n.set(c + "", d));
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 || Oe(a, l)?.writable) && (h = o(() => /* @__PURE__ */ A(void 0)), x(h, Fe(u)), n.set(l, h));
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 !== M;
896
- var k = o(() => Fe(u));
897
- x(h, k);
895
+ p = h.v !== x;
896
+ var w = o(() => je(u));
897
+ P(h, w);
898
898
  }
899
- var I = Reflect.getOwnPropertyDescriptor(a, l);
900
- if (I?.set && I.set.call(f, u), !p) {
901
- if (r && typeof l == "string") {
902
- var V = (
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
- n.get("length")
905
- ), w = Number(l);
906
- Number.isInteger(w) && w >= V.v && x(V, w + 1);
904
+ r.get("length")
905
+ ), b = Number(a);
906
+ Number.isInteger(b) && b >= K.v && P(K, b + 1);
907
907
  }
908
- Re(i);
908
+ Ze(i);
909
909
  }
910
910
  return !0;
911
911
  },
912
- ownKeys(a) {
913
- _(i);
914
- var l = Reflect.ownKeys(a).filter((h) => {
915
- var p = n.get(h);
916
- return p === void 0 || p.v !== M;
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 n)
919
- f.v !== M && !(u in a) && l.push(u);
920
- return l;
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
- Mr();
923
+ jn();
924
924
  }
925
925
  }
926
926
  );
927
927
  }
928
- var Qt, _n, wn, En;
929
- function qr() {
930
- if (Qt === void 0) {
931
- Qt = window, _n = /Firefox/.test(navigator.userAgent);
932
- var t = Element.prototype, e = Node.prototype, n = Text.prototype;
933
- wn = Oe(e, "firstChild").get, En = Oe(e, "nextSibling").get, Gt(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), Gt(n) && (n.__t = void 0);
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 Hr(t = "") {
936
+ function ii(t = "") {
937
937
  return document.createTextNode(t);
938
938
  }
939
939
  // @__NO_SIDE_EFFECTS__
940
- function bn(t) {
941
- return wn.call(t);
940
+ function Fr(t) {
941
+ return Dr.call(t);
942
942
  }
943
943
  // @__NO_SIDE_EFFECTS__
944
- function Ot(t) {
945
- return En.call(t);
944
+ function qt(t) {
945
+ return Or.call(t);
946
946
  }
947
- function _t(t, e) {
948
- return /* @__PURE__ */ bn(t);
947
+ function ur(t, e) {
948
+ return /* @__PURE__ */ Fr(t);
949
949
  }
950
- function Yr(t, e = 1, n = !1) {
951
- let r = t;
950
+ function si(t, e = 1, r = !1) {
951
+ let n = t;
952
952
  for (; e--; )
953
- r = /** @type {TemplateNode} */
954
- /* @__PURE__ */ Ot(r);
955
- return r;
953
+ n = /** @type {TemplateNode} */
954
+ /* @__PURE__ */ qt(n);
955
+ return n;
956
956
  }
957
- function kn(t) {
958
- var e = v, n = m;
959
- L(null), Q(null);
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
- L(e), Q(n);
963
+ D(e), ne(r);
964
964
  }
965
965
  }
966
- function Vr(t) {
967
- m === null && v === null && Er(), v !== null && (v.f & U) !== 0 && m === null && wr(), Le && _r();
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 Xr(t, e) {
970
- var n = e.last;
971
- n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t);
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 ue(t, e, n, r = !0) {
973
+ function pe(t, e, r, n = !0) {
974
974
  var i = m;
975
- i !== null && (i.f & xe) !== 0 && (t |= xe);
975
+ i !== null && (i.f & Ae) !== 0 && (t |= Ae);
976
976
  var s = {
977
- ctx: q,
977
+ ctx: Y,
978
978
  deps: null,
979
979
  nodes_start: null,
980
980
  nodes_end: null,
981
- f: t | J,
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 (n)
994
+ if (r)
995
995
  try {
996
- Me(s), s.f |= At;
997
- } catch (l) {
998
- throw K(s), l;
996
+ Se(s), s.f |= Rt;
997
+ } catch (a) {
998
+ throw ee(s), a;
999
999
  }
1000
- else e !== null && Ze(s);
1001
- if (r) {
1000
+ else e !== null && We(s);
1001
+ if (n) {
1002
1002
  var o = s;
1003
- if (n && o.deps === null && o.teardown === null && o.nodes_start === null && o.first === o.last && // either `null`, or a singular child
1004
- (o.f & Te) === 0 && (o = o.first), o !== null && (o.parent = i, i !== null && Xr(o, i), v !== null && (v.f & O) !== 0 && (t & me) === 0)) {
1005
- var a = (
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
- (a.effects ??= []).push(o);
1009
+ (l.effects ??= []).push(o);
1010
1010
  }
1011
1011
  }
1012
1012
  return s;
1013
1013
  }
1014
- function Wr() {
1015
- return v !== null && !Y;
1014
+ function li() {
1015
+ return v !== null && !G;
1016
1016
  }
1017
- function X(t) {
1018
- Vr();
1017
+ function J(t) {
1018
+ oi();
1019
1019
  var e = (
1020
1020
  /** @type {Effect} */
1021
1021
  m.f
1022
- ), n = !v && (e & ae) !== 0 && (e & At) === 0;
1023
- if (n) {
1024
- var r = (
1022
+ ), r = !v && (e & fe) !== 0 && (e & Rt) === 0;
1023
+ if (r) {
1024
+ var n = (
1025
1025
  /** @type {ComponentContext} */
1026
- q
1026
+ Y
1027
1027
  );
1028
- (r.e ??= []).push(t);
1028
+ (n.e ??= []).push(t);
1029
1029
  } else
1030
- return Mn(t);
1031
- }
1032
- function Mn(t) {
1033
- return ue(Pt | yr, t, !1);
1034
- }
1035
- function Gr(t) {
1036
- ee.ensure();
1037
- const e = ue(me | Te, t, !0);
1038
- return (n = {}) => new Promise((r) => {
1039
- n.outro ? $e(e, () => {
1040
- K(e), r(void 0);
1041
- }) : (K(e), r(void 0));
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 Kr(t) {
1045
- return ue(Pt, t, !1);
1044
+ function fi(t) {
1045
+ return pe(Ot, t, !1);
1046
1046
  }
1047
- function Jr(t) {
1048
- return ue(Dt | Te, t, !0);
1047
+ function ci(t) {
1048
+ return pe(Nt | Oe, t, !0);
1049
1049
  }
1050
- function Rt(t, e = 0) {
1051
- return ue(un | e, t, !0);
1050
+ function Ht(t, e = 0) {
1051
+ return pe(kr | e, t, !0);
1052
1052
  }
1053
- function xn(t, e = [], n = []) {
1054
- zr(e, n, (r) => {
1055
- ue(un, () => t(...r.map(_)), !0);
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 Qr(t, e = 0) {
1059
- var n = ue(De | e, t, !0);
1060
- return n;
1058
+ function pi(t, e = 0) {
1059
+ var r = pe(Ie | e, t, !0);
1060
+ return r;
1061
1061
  }
1062
- function ce(t, e = !0) {
1063
- return ue(ae | Te, t, !0, e);
1062
+ function he(t, e = !0) {
1063
+ return pe(fe | Oe, t, !0, e);
1064
1064
  }
1065
- function Pn(t) {
1065
+ function zr(t) {
1066
1066
  var e = t.teardown;
1067
1067
  if (e !== null) {
1068
- const n = Le, r = v;
1069
- en(!0), L(null);
1068
+ const r = Fe, n = v;
1069
+ cr(!0), D(null);
1070
1070
  try {
1071
1071
  e.call(null);
1072
1072
  } finally {
1073
- en(n), L(r);
1073
+ cr(r), D(n);
1074
1074
  }
1075
1075
  }
1076
1076
  }
1077
- function Sn(t, e = !1) {
1078
- var n = t.first;
1079
- for (t.first = t.last = null; n !== null; ) {
1080
- const i = n.ac;
1081
- i !== null && kn(() => {
1082
- i.abort(Ct);
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 r = n.next;
1085
- (n.f & me) !== 0 ? n.parent = null : K(n, e), n = r;
1084
+ var n = r.next;
1085
+ (r.f & ge) !== 0 ? r.parent = null : ee(r, e), r = n;
1086
1086
  }
1087
1087
  }
1088
- function $r(t) {
1088
+ function hi(t) {
1089
1089
  for (var e = t.first; e !== null; ) {
1090
- var n = e.next;
1091
- (e.f & ae) === 0 && K(e), e = n;
1090
+ var r = e.next;
1091
+ (e.f & fe) === 0 && ee(e), e = r;
1092
1092
  }
1093
1093
  }
1094
- function K(t, e = !0) {
1095
- var n = !1;
1096
- (e || (t.f & mr) !== 0) && t.nodes_start !== null && t.nodes_end !== null && (ei(
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
- ), n = !0), Sn(t, e && !n), rt(t, 0), Z(t, Ce);
1101
- var r = t.transitions;
1102
- if (r !== null)
1103
- for (const s of r)
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
- Pn(t);
1105
+ zr(t);
1106
1106
  var i = t.parent;
1107
- i !== null && i.first !== null && An(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes_start = t.nodes_end = t.ac = 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 ei(t, e) {
1109
+ function di(t, e) {
1110
1110
  for (; t !== null; ) {
1111
- var n = t === e ? null : (
1111
+ var r = t === e ? null : (
1112
1112
  /** @type {TemplateNode} */
1113
- /* @__PURE__ */ Ot(t)
1113
+ /* @__PURE__ */ qt(t)
1114
1114
  );
1115
- t.remove(), t = n;
1115
+ t.remove(), t = r;
1116
1116
  }
1117
1117
  }
1118
- function An(t) {
1119
- var e = t.parent, n = t.prev, r = t.next;
1120
- n !== null && (n.next = r), r !== null && (r.prev = n), e !== null && (e.first === t && (e.first = r), e.last === t && (e.last = n));
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 $e(t, e) {
1123
- var n = [];
1124
- Dn(t, n, !0), ti(n, () => {
1125
- K(t), e && e();
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 ti(t, e) {
1129
- var n = t.length;
1130
- if (n > 0) {
1131
- var r = () => --n || e();
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(r);
1133
+ i.out(n);
1134
1134
  } else
1135
1135
  e();
1136
1136
  }
1137
- function Dn(t, e, n) {
1138
- if ((t.f & xe) === 0) {
1139
- if (t.f ^= xe, t.transitions !== null)
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 || n) && e.push(o);
1142
- for (var r = t.first; r !== null; ) {
1143
- var i = r.next, s = (r.f & fn) !== 0 || (r.f & ae) !== 0;
1144
- Dn(r, e, s ? n : !1), r = i;
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 ke = !1;
1149
- function $t(t) {
1150
- ke = t;
1148
+ let Pe = !1;
1149
+ function fr(t) {
1150
+ Pe = t;
1151
1151
  }
1152
- let Le = !1;
1153
- function en(t) {
1154
- Le = t;
1152
+ let Fe = !1;
1153
+ function cr(t) {
1154
+ Fe = t;
1155
1155
  }
1156
- let v = null, Y = !1;
1157
- function L(t) {
1156
+ let v = null, G = !1;
1157
+ function D(t) {
1158
1158
  v = t;
1159
1159
  }
1160
1160
  let m = null;
1161
- function Q(t) {
1161
+ function ne(t) {
1162
1162
  m = t;
1163
1163
  }
1164
- let te = null;
1165
- function ni(t) {
1166
- v !== null && (te === null ? te = [t] : te.push(t));
1164
+ let se = null;
1165
+ function mi(t) {
1166
+ v !== null && (se === null ? se = [t] : se.push(t));
1167
1167
  }
1168
- let D = null, F = 0, N = null;
1169
- function ri(t) {
1170
- N = t;
1168
+ let T = null, F = 0, j = null;
1169
+ function yi(t) {
1170
+ j = t;
1171
1171
  }
1172
- let Cn = 1, qe = 0, de = qe;
1173
- function tn(t) {
1174
- de = t;
1172
+ let qr = 1, Ge = 0, me = Ge;
1173
+ function pr(t) {
1174
+ me = t;
1175
1175
  }
1176
- let se = !1;
1177
- function Tn() {
1178
- return ++Cn;
1176
+ let le = !1;
1177
+ function Hr() {
1178
+ return ++qr;
1179
1179
  }
1180
- function lt(t) {
1180
+ function pt(t) {
1181
1181
  var e = t.f;
1182
- if ((e & J) !== 0)
1182
+ if ((e & re) !== 0)
1183
1183
  return !0;
1184
- if ((e & le) !== 0) {
1185
- var n = t.deps, r = (e & U) !== 0;
1186
- if (n !== null) {
1187
- var i, s, o = (e & tt) !== 0, a = r && m !== null && !se, l = n.length;
1188
- if ((o || a) && (m === null || (m.f & Ce) === 0)) {
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 < l; i++)
1194
- s = n[i], (o || !s?.reactions?.includes(u)) && (s.reactions ??= []).push(u);
1195
- o && (u.f ^= tt), a && f !== null && (f.f & U) === 0 && (u.f ^= U);
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 < l; i++)
1198
- if (s = n[i], lt(
1197
+ for (i = 0; i < a; i++)
1198
+ if (s = r[i], pt(
1199
1199
  /** @type {Derived} */
1200
1200
  s
1201
- ) && yn(
1201
+ ) && Tr(
1202
1202
  /** @type {Derived} */
1203
1203
  s
1204
1204
  ), s.wv > t.wv)
1205
1205
  return !0;
1206
1206
  }
1207
- (!r || m !== null && !se) && Z(t, T);
1207
+ (!n || m !== null && !le) && H(t, I);
1208
1208
  }
1209
1209
  return !1;
1210
1210
  }
1211
- function Ln(t, e, n = !0) {
1212
- var r = t.reactions;
1213
- if (r !== null && !te?.includes(t))
1214
- for (var i = 0; i < r.length; i++) {
1215
- var s = r[i];
1216
- (s.f & O) !== 0 ? Ln(
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 && (n ? Z(s, J) : (s.f & T) !== 0 && Z(s, le), Ze(
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 In(t) {
1228
- var e = D, n = F, r = N, i = v, s = se, o = te, a = q, l = Y, u = de, f = t.f;
1229
- D = /** @type {null | Value[]} */
1230
- null, F = 0, N = null, se = (f & U) !== 0 && (Y || !ke || v === null), v = (f & (ae | me)) === 0 ? t : null, te = null, Pe(t.ctx), Y = !1, de = ++qe, t.ac !== null && (kn(() => {
1231
- t.ac.abort(Ct);
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 |= mt;
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 (D !== null) {
1239
+ if (T !== null) {
1240
1240
  var d;
1241
- if (rt(t, F), c !== null && F > 0)
1242
- for (c.length = F + D.length, d = 0; d < D.length; d++)
1243
- c[F + d] = D[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 = D;
1246
- if (!se || // Deriveds that already have reactions can cleanup, so we still add them as reactions
1247
- (f & O) !== 0 && /** @type {import('#client').Derived} */
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 && (rt(t, F), c.length = F);
1252
- if (hn() && N !== null && !Y && c !== null && (t.f & (O | le | J)) === 0)
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
- N.length; d++)
1255
- Ln(
1256
- N[d],
1254
+ j.length; d++)
1255
+ Yr(
1256
+ j[d],
1257
1257
  /** @type {Effect} */
1258
1258
  t
1259
1259
  );
1260
- return i !== null && i !== t && (qe++, N !== null && (r === null ? r = N : r.push(.../** @type {Source[]} */
1261
- N))), (t.f & pe) !== 0 && (t.f ^= pe), p;
1262
- } catch (k) {
1263
- return pn(k);
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 ^= mt, D = e, F = n, N = r, v = i, se = s, te = o, Pe(a), Y = l, de = u;
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 ii(t, e) {
1269
- let n = e.reactions;
1270
- if (n !== null) {
1271
- var r = ur.call(n, t);
1272
- if (r !== -1) {
1273
- var i = n.length - 1;
1274
- i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop());
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
- n === null && (e.f & O) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
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
- (D === null || !D.includes(e)) && (Z(e, le), (e.f & (U | tt)) === 0 && (e.f ^= tt), mn(
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
- ), rt(
1283
+ ), lt(
1284
1284
  /** @type {Derived} **/
1285
1285
  e,
1286
1286
  0
1287
1287
  ));
1288
1288
  }
1289
- function rt(t, e) {
1290
- var n = t.deps;
1291
- if (n !== null)
1292
- for (var r = e; r < n.length; r++)
1293
- ii(t, n[r]);
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 Me(t) {
1295
+ function Se(t) {
1296
1296
  var e = t.f;
1297
- if ((e & Ce) === 0) {
1298
- Z(t, T);
1299
- var n = m, r = ke;
1300
- m = t, ke = !0;
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 & De) !== 0 ? $r(t) : Sn(t), Pn(t);
1303
- var i = In(t);
1304
- t.teardown = typeof i == "function" ? i : null, t.wv = Cn;
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
- ke = r, m = n;
1307
+ Pe = n, m = r;
1308
1308
  }
1309
1309
  }
1310
1310
  }
1311
- function _(t) {
1312
- var e = t.f, n = (e & O) !== 0;
1313
- if (v !== null && !Y) {
1314
- var r = m !== null && (m.f & Ce) !== 0;
1315
- if (!r && !te?.includes(t)) {
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 & mt) !== 0)
1318
- t.rv < qe && (t.rv = qe, D === null && i !== null && i[F] === t ? F++ : D === null ? D = [t] : (!se || !D.includes(t)) && D.push(t));
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 (n && /** @type {Derived} */
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
- ), a = o.parent;
1332
- a !== null && (a.f & U) === 0 && (o.f ^= U);
1331
+ ), l = o.parent;
1332
+ l !== null && (l.f & q) === 0 && (o.f ^= q);
1333
1333
  }
1334
- if (Le) {
1335
- if (oe.has(t))
1336
- return oe.get(t);
1337
- if (n) {
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 l = o.v;
1341
- return ((o.f & T) === 0 && o.reactions !== null || Fn(o)) && (l = Ft(o)), oe.set(o, l), l;
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 n && (o = /** @type {Derived} */
1344
- t, lt(o) && yn(o));
1345
- if ((t.f & pe) !== 0)
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 Fn(t) {
1350
- if (t.v === M) return !0;
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 (oe.has(e) || (e.f & O) !== 0 && Fn(
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 On(t) {
1361
- var e = Y;
1360
+ function Wr(t) {
1361
+ var e = G;
1362
1362
  try {
1363
- return Y = !0, t();
1363
+ return G = !0, t();
1364
1364
  } finally {
1365
- Y = e;
1365
+ G = e;
1366
1366
  }
1367
1367
  }
1368
- const si = -7169;
1369
- function Z(t, e) {
1370
- t.f = t.f & si | e;
1368
+ const _i = -7169;
1369
+ function H(t, e) {
1370
+ t.f = t.f & _i | e;
1371
1371
  }
1372
- const oi = ["touchstart", "touchmove"];
1373
- function ai(t) {
1374
- return oi.includes(t);
1372
+ const wi = ["touchstart", "touchmove"];
1373
+ function Ei(t) {
1374
+ return wi.includes(t);
1375
1375
  }
1376
- const li = /* @__PURE__ */ new Set(), nn = /* @__PURE__ */ new Set();
1377
- let rn = null;
1378
- function Ke(t) {
1379
- var e = this, n = (
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
- ), r = t.type, i = t.composedPath?.() || [], s = (
1382
+ ), n = t.type, i = t.composedPath?.() || [], s = (
1383
1383
  /** @type {null | Element} */
1384
1384
  i[0] || t.target
1385
1385
  );
1386
- rn = t;
1387
- var o = 0, a = rn === t && t.__root;
1388
- if (a) {
1389
- var l = i.indexOf(a);
1390
- if (l !== -1 && (e === document || e === /** @type {any} */
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
- l <= u && (o = l);
1398
+ a <= u && (o = a);
1399
1399
  }
1400
1400
  if (s = /** @type {Element} */
1401
1401
  i[o] || t.target, s !== e) {
1402
- vt(t, "currentTarget", {
1402
+ xt(t, "currentTarget", {
1403
1403
  configurable: !0,
1404
1404
  get() {
1405
- return s || n;
1405
+ return s || r;
1406
1406
  }
1407
1407
  });
1408
1408
  var f = v, h = m;
1409
- L(null), Q(null);
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 k = s["__" + r];
1416
- if (k != null && (!/** @type {any} */
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 (ln(k)) {
1421
- var [I, ...V] = k;
1422
- I.apply(s, [t, ...V]);
1420
+ if (Er(w)) {
1421
+ var [O, ...K] = w;
1422
+ O.apply(s, [t, ...K]);
1423
1423
  } else
1424
- k.call(s, t);
1425
- } catch (w) {
1426
- p ? c.push(w) : p = w;
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 w of c)
1433
+ for (let b of c)
1434
1434
  queueMicrotask(() => {
1435
- throw w;
1435
+ throw b;
1436
1436
  });
1437
1437
  throw p;
1438
1438
  }
1439
1439
  } finally {
1440
- t.__root = e, delete t.currentTarget, L(f), Q(h);
1440
+ t.__root = e, delete t.currentTarget, D(f), ne(h);
1441
1441
  }
1442
1442
  }
1443
1443
  }
1444
- function ui(t) {
1444
+ function bi(t) {
1445
1445
  var e = document.createElement("template");
1446
1446
  return e.innerHTML = t.replaceAll("<!>", "<!---->"), e.content;
1447
1447
  }
1448
- function fi(t, e) {
1449
- var n = (
1448
+ function Mi(t, e) {
1449
+ var r = (
1450
1450
  /** @type {Effect} */
1451
1451
  m
1452
1452
  );
1453
- n.nodes_start === null && (n.nodes_start = t, n.nodes_end = e);
1453
+ r.nodes_start === null && (r.nodes_start = t, r.nodes_end = e);
1454
1454
  }
1455
1455
  // @__NO_SIDE_EFFECTS__
1456
- function Rn(t, e) {
1457
- var n = (e & Sr) !== 0, r, i = !t.startsWith("<!>");
1456
+ function Gr(t, e) {
1457
+ var r = (e & Un) !== 0, n, i = !t.startsWith("<!>");
1458
1458
  return () => {
1459
- r === void 0 && (r = ui(i ? t : "<!>" + t), r = /** @type {Node} */
1460
- /* @__PURE__ */ bn(r));
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
- n || _n ? document.importNode(r, !0) : r.cloneNode(!0)
1463
+ r || Ir ? document.importNode(n, !0) : n.cloneNode(!0)
1464
1464
  );
1465
- return fi(s, s), s;
1465
+ return Mi(s, s), s;
1466
1466
  };
1467
1467
  }
1468
- function Nn(t, e) {
1468
+ function Kr(t, e) {
1469
1469
  t !== null && t.before(
1470
1470
  /** @type {Node} */
1471
1471
  e
1472
1472
  );
1473
1473
  }
1474
- function Nt(t, e) {
1475
- return ci(t, e);
1474
+ function Yt(t, e) {
1475
+ return xi(t, e);
1476
1476
  }
1477
- const _e = /* @__PURE__ */ new Map();
1478
- function ci(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: o = !0 }) {
1479
- qr();
1480
- var a = /* @__PURE__ */ new Set(), l = (h) => {
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 (!a.has(c)) {
1484
- a.add(c);
1485
- var d = ai(c);
1486
- e.addEventListener(c, Ke, { passive: d });
1487
- var k = _e.get(c);
1488
- k === void 0 ? (document.addEventListener(c, Ke, { passive: d }), _e.set(c, 1)) : _e.set(c, k + 1);
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
- l(fr(li)), nn.add(l);
1493
- var u = void 0, f = Gr(() => {
1494
- var h = n ?? e.appendChild(Hr());
1495
- return Or(
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
- Tt({});
1504
+ zt({});
1505
1505
  var c = (
1506
1506
  /** @type {ComponentContext} */
1507
- q
1507
+ Y
1508
1508
  );
1509
1509
  c.c = s;
1510
1510
  }
1511
- i && (r.$$events = i), u = t(p, r) || {}, s && Lt();
1511
+ i && (n.$$events = i), u = t(p, n) || {}, s && Bt();
1512
1512
  }
1513
1513
  ), () => {
1514
- for (var p of a) {
1515
- e.removeEventListener(p, Ke);
1514
+ for (var p of l) {
1515
+ e.removeEventListener(p, tt);
1516
1516
  var c = (
1517
1517
  /** @type {number} */
1518
- _e.get(p)
1518
+ be.get(p)
1519
1519
  );
1520
- --c === 0 ? (document.removeEventListener(p, Ke), _e.delete(p)) : _e.set(p, c);
1520
+ --c === 0 ? (document.removeEventListener(p, tt), be.delete(p)) : be.set(p, c);
1521
1521
  }
1522
- nn.delete(l), h !== n && h.parentNode?.removeChild(h);
1522
+ hr.delete(a), h !== r && h.parentNode?.removeChild(h);
1523
1523
  };
1524
1524
  });
1525
- return hi.set(u, f), u;
1525
+ return Pi.set(u, f), u;
1526
1526
  }
1527
- let hi = /* @__PURE__ */ new WeakMap();
1528
- function zn(t) {
1529
- var e, n, r = "";
1530
- if (typeof t == "string" || typeof t == "number") r += t;
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] && (n = zn(t[e])) && (r && (r += " "), r += n);
1534
- } else for (n in t) t[n] && (r && (r += " "), r += n);
1535
- return r;
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 pi() {
1538
- for (var t, e, n = 0, r = "", i = arguments.length; n < i; n++) (t = arguments[n]) && (e = zn(t)) && (r && (r += " "), r += e);
1539
- return r;
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 jn(t) {
1542
- return typeof t == "object" ? pi(t) : t ?? "";
1541
+ function Qr(t) {
1542
+ return typeof t == "object" ? Si(t) : t ?? "";
1543
1543
  }
1544
- function di(t, e, n) {
1545
- var r = t == null ? "" : "" + t;
1546
- return e && (r = r ? r + " " + e : e), r === "" ? null : r;
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 vi(t, e) {
1549
- return t == null ? null : String(t);
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 Bn(t, e, n, r, i, s) {
1563
+ function $r(t, e, r, n, i, s) {
1552
1564
  var o = t.__className;
1553
- if (o !== n || o === void 0) {
1554
- var a = di(n, r);
1555
- a == null ? t.removeAttribute("class") : t.className = a, t.__className = n;
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 it(t, e, n, r) {
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 = vi(e);
1580
+ var s = Ci(e, n);
1563
1581
  s == null ? t.removeAttribute("style") : t.style.cssText = s, t.__style = e;
1564
- }
1565
- return r;
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 mi = () => performance.now(), W = {
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: () => mi(),
1593
+ now: () => Ti(),
1576
1594
  tasks: /* @__PURE__ */ new Set()
1577
1595
  };
1578
- function Un() {
1579
- const t = W.now();
1580
- W.tasks.forEach((e) => {
1581
- e.c(t) || (W.tasks.delete(e), e.f());
1582
- }), W.tasks.size !== 0 && W.tick(Un);
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 yi(t) {
1602
+ function Li(t) {
1585
1603
  let e;
1586
- return W.tasks.size === 0 && W.tick(Un), {
1587
- promise: new Promise((n) => {
1588
- W.tasks.add(e = { c: t, f: n });
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
- W.tasks.delete(e);
1609
+ Q.tasks.delete(e);
1592
1610
  }
1593
1611
  };
1594
1612
  }
1595
- function sn(t, e) {
1596
- return t === e || t?.[Qe] === e;
1613
+ function mr(t, e) {
1614
+ return t === e || t?.[nt] === e;
1597
1615
  }
1598
- function Ee(t = {}, e, n, r) {
1599
- return Kr(() => {
1616
+ function Be(t = {}, e, r, n) {
1617
+ return fi(() => {
1600
1618
  var i, s;
1601
- return Rt(() => {
1602
- i = s, s = [], On(() => {
1603
- t !== n(...s) && (e(t, ...s), i && sn(n(...i), t) && e(null, ...i));
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
- ot(() => {
1607
- s && sn(n(...s), t) && e(null, ...s);
1624
+ ft(() => {
1625
+ s && mr(r(...s), t) && e(null, ...s);
1608
1626
  });
1609
1627
  };
1610
1628
  }), t;
1611
1629
  }
1612
- const gi = "5";
1613
- typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(gi);
1614
- function _i(t) {
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 wt(t) {
1635
+ function Ct(t) {
1618
1636
  return -0.5 * (Math.cos(Math.PI * t) - 1);
1619
1637
  }
1620
- function wi(t) {
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 Ei(t) {
1642
+ function Fi(t) {
1625
1643
  return Math.sin(t * Math.PI / 2);
1626
1644
  }
1627
- const bi = 128, ki = 0, Mi = 1, xi = 2;
1628
- class Pi {
1645
+ const Ri = 128, Ni = 0, ji = 1, zi = 2;
1646
+ class Bi {
1629
1647
  animationsStarted = !1;
1630
1648
  animationsCount = 0;
1631
- animationsLimit = bi;
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 n = this.layers[e];
1641
- if (n == null) continue;
1642
- const r = n.animations;
1643
- if (r != null)
1644
- for (let i = 0; i < r.length; i++) {
1645
- const s = r[i];
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, n, r, i) {
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[n];
1662
- o == null && (o = s.animations[n] = /* @__PURE__ */ new Map());
1663
- let a = { id: r, priority: n, executed: !1, function: i };
1664
- o.set(r, a), this.animationsStarted == !1 && (this.animationsStarted = !0, this.start());
1665
- }
1666
- clear(e, n) {
1667
- for (let r = 0; r < this.layers.length; r++) {
1668
- let i = this.layers[r];
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(n);
1690
+ let o = s.get(r);
1673
1691
  if (o == null || o.executed == !1) return;
1674
- s.delete(n);
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 ie = new Pi();
1688
- function on(t) {
1705
+ const ae = new Bi();
1706
+ function yr(t) {
1689
1707
  return Object.prototype.toString.call(t) === "[object Date]";
1690
1708
  }
1691
- function Et(t, e) {
1709
+ function Tt(t, e) {
1692
1710
  if (t === e || t !== t) return () => t;
1693
- const n = typeof t;
1694
- if (n !== typeof e || Array.isArray(t) !== Array.isArray(e))
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 r = (
1715
+ const n = (
1698
1716
  /** @type {Array<any>} */
1699
- e.map((i, s) => Et(
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) => r.map((s) => s(i));
1723
+ return (i) => n.map((s) => s(i));
1706
1724
  }
1707
- if (n === "object") {
1725
+ if (r === "object") {
1708
1726
  if (!t || !e)
1709
1727
  throw new Error("Object cannot be null");
1710
- if (on(t) && on(e)) {
1711
- const s = t.getTime(), a = e.getTime() - s;
1712
- return (l) => new Date(s + l * a);
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 r = Object.keys(e), i = {};
1715
- return r.forEach((s) => {
1716
- i[s] = Et(t[s], e[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 r.forEach((a) => {
1720
- o[a] = i[a](s);
1737
+ return n.forEach((l) => {
1738
+ o[l] = i[l](s);
1721
1739
  }), o;
1722
1740
  };
1723
1741
  }
1724
- if (n === "number") {
1725
- const r = (
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 * r;
1748
+ return (i) => t + i * n;
1731
1749
  }
1732
1750
  return () => e;
1733
1751
  }
1734
- class zt {
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
- #r = null;
1758
+ #n = null;
1741
1759
  /**
1742
1760
  * @param {T} value
1743
1761
  * @param {TweenedOptions<T>} options
1744
1762
  */
1745
- constructor(e, n = {}) {
1746
- this.#e = /* @__PURE__ */ A(e), this.#t = /* @__PURE__ */ A(e), this.#a = n;
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, n) {
1766
- const r = new zt(e(), n);
1767
- return Rt(() => {
1768
- r.set(e());
1769
- }), r;
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, n) {
1780
- x(this.#t, e);
1797
+ set(e, r) {
1798
+ P(this.#t, e);
1781
1799
  let {
1782
- delay: r = 0,
1800
+ delay: n = 0,
1783
1801
  duration: i = 400,
1784
- easing: s = _i,
1785
- interpolate: o = Et
1786
- } = { ...this.#a, ...n };
1802
+ easing: s = Di,
1803
+ interpolate: o = Tt
1804
+ } = { ...this.#a, ...r };
1787
1805
  if (i === 0)
1788
- return this.#r?.abort(), x(this.#e, e), Promise.resolve();
1789
- const a = W.now() + r;
1790
- let l, u = !1, f = this.#r;
1791
- return this.#r = yi((h) => {
1792
- if (h < a)
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
- l = o(c, e), typeof i == "function" && (i = i(c, e)), f?.abort();
1815
+ a = o(c, e), typeof i == "function" && (i = i(c, e)), f?.abort();
1798
1816
  }
1799
- const p = h - a;
1817
+ const p = h - l;
1800
1818
  return p > /** @type {number} */
1801
- i ? (x(this.#e, e), !1) : (x(this.#e, l(s(p / /** @type {number} */
1819
+ i ? (P(this.#e, e), !1) : (P(this.#e, a(s(p / /** @type {number} */
1802
1820
  i))), !0);
1803
- }), this.#r.promise;
1821
+ }), this.#n.promise;
1804
1822
  }
1805
1823
  get current() {
1806
- return _(this.#e);
1824
+ return g(this.#e);
1807
1825
  }
1808
1826
  get target() {
1809
- return _(this.#t);
1827
+ return g(this.#t);
1810
1828
  }
1811
1829
  set target(e) {
1812
1830
  this.set(e);
1813
1831
  }
1814
1832
  }
1815
- class et {
1833
+ class st {
1816
1834
  value;
1817
1835
  motion;
1818
- constructor(e, n) {
1819
- this.value = e, this.motion = new zt(e, n);
1836
+ constructor(e, r) {
1837
+ this.value = e, this.motion = new Vt(e, r);
1820
1838
  }
1821
- set(e, n) {
1822
- this.value = e, this.motion.set(e, n);
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 Si = /* @__PURE__ */ Rn('<div><div class="body svelte-zz3jrb"></div></div>');
1832
- function Ai(t, e) {
1833
- Tt(e, !0);
1834
- let n, r;
1835
- function i() {
1836
- return r;
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 s = /* @__PURE__ */ A(!1);
1839
- function o(b) {
1840
- x(s, b, !0);
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 performance.now() - u < f ? d.motion.current == 0 : d.value == 0;
1851
- }
1852
- let c = 0, d = new et(0, { easing: wt });
1853
- X(() => {
1854
- _(s) == !1 && (d.snap(), ie.clear(e.priority, e.id));
1855
- }), X(() => {
1856
- d.set(_(l) ? 0 : c, { duration: 75 });
1857
- }), X(() => {
1858
- k(d.motion.current);
1859
- });
1860
- function k(b) {
1861
- n && ie.equeue(e.layer, e.priority, e.id, () => {
1862
- n.style.scale = b.toString(), n.style.filter = `brightness(${0.25 + 0.75 * b})`, r.style.opacity = b.toString();
1863
- });
1864
- }
1865
- function I(b) {
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
- let u = /* @__PURE__ */ A(!0);
1932
- function f(y) {
1933
- x(u, y, !0);
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 tr(y, We) {
1977
- if (_(b) == !1 || We == !0) {
1978
- let $ = Ne.getOffsets(o, a, y);
1979
- re.set(Math.round($.x), { duration: 0 }), Ve.set(Math.round($.y), { duration: 0 }), Ht(re.value, Ve.value), ne = y, x(b, !0);
1980
- } else if (y != ne) {
1981
- let $ = Math.abs(y - ne), Ge = $ < 180 ? $ : 360 - $, ye = Math.log(Ge) * 75, ge = Ne.getOffsets(o, a, y);
1982
- re.set(Math.round(ge.x), { duration: ye }), Ve.set(Math.round(ge.y), { duration: ye }), ne = y;
1983
- }
1984
- }
1985
- function nr() {
1986
- return Ne.getOffsets(o, a, ne);
1987
- }
1988
- var rr = {
1989
- getBody: l,
1990
- setDisplayed: f,
1991
- getDisplayed: h,
1992
- setCollapsed: k,
1993
- getCollapsed: I,
1994
- getExpanded: V,
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
- i = y
1903
+ a = E
2003
1904
  ),
2004
- () => i
2005
- );
2006
- var ft = Yr(Yt, 2), Vt = _t(ft);
2007
- return Ee(Vt, (y) => s = y, () => s), Ee(ft, (y) => r = y, () => r), Ee(Xe, (y) => n = y, () => n), xn(() => {
2008
- Bn(Xe, 1, jn(["anchor", _(u) && "displayed"]), "svelte-11extwn"), it(ft, `margin: ${e.margin}px;`), it(Vt, `width: ${e.width}px; height: ${e.height}px; border-radius: ${e.radius}px;`);
2009
- }), Nn(t, Xe), Lt(rr);
2010
- }
2011
- var ze;
2012
- ((t) => {
2013
- async function e(r, i) {
2014
- const s = await fetch(r, i);
2015
- if (!s.ok) throw new Error(s.statusText);
2016
- return s.json();
2017
- }
2018
- t.get = e;
2019
- async function n(r, i, s) {
2020
- const o = await fetch(r, {
2021
- method: "POST",
2022
- body: JSON.stringify(i),
2023
- headers: {
2024
- "Content-Type": "application/json",
2025
- ...s?.headers
2026
- },
2027
- ...s
2028
- });
2029
- if (!o.ok) throw new Error(o.statusText);
2030
- return o.json();
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
- t.post = n;
2033
- })(ze || (ze = {}));
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
- t.project = e;
2043
- function n(a, l, u) {
2044
- return {
2045
- lat: o(l / u),
2046
- lng: s(a / u)
2047
- };
1939
+ remove() {
1940
+ this.removeMarker();
2048
1941
  }
2049
- t.unproject = n;
2050
- function r(a) {
2051
- return (180 + a) / 360;
1942
+ createElement() {
1943
+ throw new Error("Create element not implemented");
2052
1944
  }
2053
- function i(a) {
2054
- return (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + a * Math.PI / 360))) / 360;
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
- function s(a) {
2057
- return a * 360 - 180;
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
- function o(a) {
2060
- return 360 / Math.PI * Math.atan(Math.exp((180 - a * 360) * Math.PI / 180)) - 90;
1954
+ removeMarker() {
1955
+ this.providerMarker?.remove();
2061
1956
  }
2062
- })(be || (be = {}));
2063
- class qn {
2064
- swLat;
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
- contains(e, n) {
2080
- return this.swLat <= e && e <= this.neLat ? this.swLng < this.neLng ? this.swLng <= n && n <= this.neLng : n <= this.neLng || this.swLng <= n : !1;
1961
+ getZindex() {
1962
+ throw new Error("Get z-index not implemented");
2081
1963
  }
2082
1964
  }
2083
- var pt;
1965
+ var bt;
2084
1966
  // @__NO_SIDE_EFFECTS__
2085
- function Hn(t) {
1967
+ function tn(t) {
2086
1968
  return {
2087
- lang: t?.lang ?? pt?.lang,
1969
+ lang: t?.lang ?? bt?.lang,
2088
1970
  message: t?.message,
2089
- abortEarly: t?.abortEarly ?? pt?.abortEarly,
2090
- abortPipeEarly: t?.abortPipeEarly ?? pt?.abortPipeEarly
1971
+ abortEarly: t?.abortEarly ?? bt?.abortEarly,
1972
+ abortPipeEarly: t?.abortPipeEarly ?? bt?.abortPipeEarly
2091
1973
  };
2092
1974
  }
2093
- var Ci;
1975
+ var qi;
2094
1976
  // @__NO_SIDE_EFFECTS__
2095
- function Ti(t) {
2096
- return Ci?.get(t);
1977
+ function Hi(t) {
1978
+ return qi?.get(t);
2097
1979
  }
2098
- var Li;
1980
+ var Yi;
2099
1981
  // @__NO_SIDE_EFFECTS__
2100
- function Ii(t) {
2101
- return Li?.get(t);
1982
+ function Vi(t) {
1983
+ return Yi?.get(t);
2102
1984
  }
2103
- var Fi;
1985
+ var Xi;
2104
1986
  // @__NO_SIDE_EFFECTS__
2105
- function Oi(t, e) {
2106
- return Fi?.get(t)?.get(e);
1987
+ function Wi(t, e) {
1988
+ return Xi?.get(t)?.get(e);
2107
1989
  }
2108
1990
  // @__NO_SIDE_EFFECTS__
2109
- function He(t) {
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 P(t, e, n, r, i) {
2114
- const s = i && "input" in i ? i.input : n.value, o = i?.expected ?? t.expects ?? null, a = i?.received ?? /* @__PURE__ */ He(s), l = {
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: a,
2120
- message: `Invalid ${e}: ${o ? `Expected ${o} but r` : "R"}eceived ${a}`,
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: r.lang,
2125
- abortEarly: r.abortEarly,
2126
- abortPipeEarly: r.abortPipeEarly
2127
- }, u = t.kind === "schema", f = i?.message ?? t.message ?? /* @__PURE__ */ Oi(t.reference, l.lang) ?? (u ? /* @__PURE__ */ Ii(l.lang) : null) ?? r.message ?? /* @__PURE__ */ Ti(l.lang);
2128
- f !== void 0 && (l.message = typeof f == "function" ? (
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(l)
2131
- ) : f), u && (n.typed = !1), n.issues ? n.issues.push(l) : n.issues = [l];
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 R(t) {
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__ */ Hn());
2021
+ return t["~run"]({ value: e }, /* @__PURE__ */ tn());
2140
2022
  }
2141
2023
  };
2142
2024
  }
2143
- var ut = class extends Error {
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, n) {
2162
- const r = e.value;
2043
+ "~run"(e, r) {
2044
+ const n = e.value;
2163
2045
  return e.value = (...i) => {
2164
- const s = this.schema["~run"]({ value: i }, n);
2046
+ const s = this.schema["~run"]({ value: i }, r);
2165
2047
  if (s.issues)
2166
- throw new ut(s.issues);
2167
- return r(...s.value);
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 Yn() {
2055
+ function rn() {
2174
2056
  return {
2175
2057
  kind: "transformation",
2176
2058
  type: "await",
2177
- reference: Yn,
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 Vn(t, e) {
2067
+ function nn(t, e) {
2186
2068
  return {
2187
2069
  kind: "validation",
2188
2070
  type: "check",
2189
- reference: Vn,
2071
+ reference: nn,
2190
2072
  async: !1,
2191
2073
  expects: null,
2192
2074
  requirement: t,
2193
2075
  message: e,
2194
- "~run"(n, r) {
2195
- return n.typed && !this.requirement(n.value) && P(this, "input", n, r), n;
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 Xn(t, e) {
2082
+ function sn(t, e) {
2201
2083
  return {
2202
2084
  kind: "validation",
2203
2085
  type: "length",
2204
- reference: Xn,
2086
+ reference: sn,
2205
2087
  async: !1,
2206
2088
  expects: `${t}`,
2207
2089
  requirement: t,
2208
2090
  message: e,
2209
- "~run"(n, r) {
2210
- return n.typed && n.value.length !== this.requirement && P(this, "length", n, r, {
2211
- received: `${n.value.length}`
2212
- }), n;
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 Ae(t, e) {
2099
+ function Le(t, e) {
2218
2100
  return {
2219
2101
  kind: "validation",
2220
2102
  type: "max_value",
2221
- reference: Ae,
2103
+ reference: Le,
2222
2104
  async: !1,
2223
- expects: `<=${t instanceof Date ? t.toJSON() : /* @__PURE__ */ He(t)}`,
2105
+ expects: `<=${t instanceof Date ? t.toJSON() : /* @__PURE__ */ Ke(t)}`,
2224
2106
  requirement: t,
2225
2107
  message: e,
2226
- "~run"(n, r) {
2227
- return n.typed && !(n.value <= this.requirement) && P(this, "value", n, r, {
2228
- received: n.value instanceof Date ? n.value.toJSON() : /* @__PURE__ */ He(n.value)
2229
- }), n;
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 jt(t, e) {
2116
+ function Xt(t, e) {
2235
2117
  return {
2236
2118
  kind: "validation",
2237
2119
  type: "min_length",
2238
- reference: jt,
2120
+ reference: Xt,
2239
2121
  async: !1,
2240
2122
  expects: `>=${t}`,
2241
2123
  requirement: t,
2242
2124
  message: e,
2243
- "~run"(n, r) {
2244
- return n.typed && n.value.length < this.requirement && P(this, "length", n, r, {
2245
- received: `${n.value.length}`
2246
- }), n;
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 G(t, e) {
2133
+ function $(t, e) {
2252
2134
  return {
2253
2135
  kind: "validation",
2254
2136
  type: "min_value",
2255
- reference: G,
2137
+ reference: $,
2256
2138
  async: !1,
2257
- expects: `>=${t instanceof Date ? t.toJSON() : /* @__PURE__ */ He(t)}`,
2139
+ expects: `>=${t instanceof Date ? t.toJSON() : /* @__PURE__ */ Ke(t)}`,
2258
2140
  requirement: t,
2259
2141
  message: e,
2260
- "~run"(n, r) {
2261
- return n.typed && !(n.value >= this.requirement) && P(this, "value", n, r, {
2262
- received: n.value instanceof Date ? n.value.toJSON() : /* @__PURE__ */ He(n.value)
2263
- }), n;
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 H(t) {
2150
+ function W(t) {
2269
2151
  return {
2270
2152
  kind: "transformation",
2271
2153
  type: "returns",
2272
- reference: H,
2154
+ reference: W,
2273
2155
  async: !1,
2274
2156
  schema: t,
2275
- "~run"(e, n) {
2276
- const r = e.value;
2157
+ "~run"(e, r) {
2158
+ const n = e.value;
2277
2159
  return e.value = (...i) => {
2278
2160
  const s = this.schema["~run"](
2279
- { value: r(...i) },
2280
- n
2161
+ { value: n(...i) },
2162
+ r
2281
2163
  );
2282
2164
  if (s.issues)
2283
- throw new ut(s.issues);
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 Wn(t) {
2172
+ function on(t) {
2291
2173
  return {
2292
2174
  kind: "transformation",
2293
2175
  type: "returns",
2294
- reference: Wn,
2176
+ reference: on,
2295
2177
  async: !1,
2296
2178
  schema: t,
2297
- "~run"(e, n) {
2298
- const r = e.value;
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 r(...i) },
2302
- n
2183
+ { value: await n(...i) },
2184
+ r
2303
2185
  );
2304
2186
  if (s.issues)
2305
- throw new ut(s.issues);
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 Ri(t, e, n) {
2194
+ function Gi(t, e, r) {
2313
2195
  return typeof t.fallback == "function" ? (
2314
2196
  // @ts-expect-error
2315
- t.fallback(e, n)
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 Gn(t, e, n) {
2204
+ function an(t, e, r) {
2323
2205
  return typeof t.default == "function" ? (
2324
2206
  // @ts-expect-error
2325
- t.default(e, n)
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 Kn(t, e) {
2214
+ function ln(t, e) {
2333
2215
  return {
2334
2216
  kind: "schema",
2335
2217
  type: "array",
2336
- reference: Kn,
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__ */ R(this);
2224
+ return /* @__PURE__ */ N(this);
2343
2225
  },
2344
- "~run"(n, r) {
2345
- const i = n.value;
2226
+ "~run"(r, n) {
2227
+ const i = r.value;
2346
2228
  if (Array.isArray(i)) {
2347
- n.typed = !0, n.value = [];
2229
+ r.typed = !0, r.value = [];
2348
2230
  for (let s = 0; s < i.length; s++) {
2349
- const o = i[s], a = this.item["~run"]({ value: o }, r);
2350
- if (a.issues) {
2351
- const l = {
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 a.issues)
2359
- u.path ? u.path.unshift(l) : u.path = [l], n.issues?.push(u);
2360
- if (n.issues || (n.issues = a.issues), r.abortEarly) {
2361
- n.typed = !1;
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
- a.typed || (n.typed = !1), n.value.push(a.value);
2247
+ l.typed || (r.typed = !1), r.value.push(l.value);
2366
2248
  }
2367
2249
  } else
2368
- P(this, "type", n, r);
2369
- return n;
2250
+ S(this, "type", r, n);
2251
+ return r;
2370
2252
  }
2371
2253
  };
2372
2254
  }
2373
2255
  // @__NO_SIDE_EFFECTS__
2374
- function Jn(t) {
2256
+ function un(t) {
2375
2257
  return {
2376
2258
  kind: "schema",
2377
2259
  type: "boolean",
2378
- reference: Jn,
2260
+ reference: un,
2379
2261
  expects: "boolean",
2380
2262
  async: !1,
2381
2263
  message: t,
2382
2264
  get "~standard"() {
2383
- return /* @__PURE__ */ R(this);
2265
+ return /* @__PURE__ */ N(this);
2384
2266
  },
2385
- "~run"(e, n) {
2386
- return typeof e.value == "boolean" ? e.typed = !0 : P(this, "type", e, n), e;
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 Qn(t, e) {
2273
+ function fn(t, e) {
2392
2274
  return {
2393
2275
  kind: "schema",
2394
2276
  type: "custom",
2395
- reference: Qn,
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__ */ R(this);
2283
+ return /* @__PURE__ */ N(this);
2402
2284
  },
2403
- "~run"(n, r) {
2404
- return this.check(n.value) ? n.typed = !0 : P(this, "type", n, r), n;
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 j(t) {
2291
+ function B(t) {
2410
2292
  return {
2411
2293
  kind: "schema",
2412
2294
  type: "function",
2413
- reference: j,
2295
+ reference: B,
2414
2296
  expects: "Function",
2415
2297
  async: !1,
2416
2298
  message: t,
2417
2299
  get "~standard"() {
2418
- return /* @__PURE__ */ R(this);
2300
+ return /* @__PURE__ */ N(this);
2419
2301
  },
2420
- "~run"(e, n) {
2421
- return typeof e.value == "function" ? e.typed = !0 : P(this, "type", e, n), e;
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 g(t) {
2308
+ function k(t) {
2427
2309
  return {
2428
2310
  kind: "schema",
2429
2311
  type: "number",
2430
- reference: g,
2312
+ reference: k,
2431
2313
  expects: "number",
2432
2314
  async: !1,
2433
2315
  message: t,
2434
2316
  get "~standard"() {
2435
- return /* @__PURE__ */ R(this);
2317
+ return /* @__PURE__ */ N(this);
2436
2318
  },
2437
- "~run"(e, n) {
2438
- return typeof e.value == "number" && !isNaN(e.value) ? e.typed = !0 : P(this, "type", e, n), e;
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 C(t, e) {
2325
+ function L(t, e) {
2444
2326
  return {
2445
2327
  kind: "schema",
2446
2328
  type: "object",
2447
- reference: C,
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__ */ R(this);
2335
+ return /* @__PURE__ */ N(this);
2454
2336
  },
2455
- "~run"(n, r) {
2456
- const i = n.value;
2337
+ "~run"(r, n) {
2338
+ const i = r.value;
2457
2339
  if (i && typeof i == "object") {
2458
- n.typed = !0, n.value = {};
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 a = s in i ? (
2345
+ const l = s in i ? (
2464
2346
  // @ts-expect-error
2465
2347
  i[s]
2466
- ) : /* @__PURE__ */ Gn(o), l = o["~run"]({ value: a }, r);
2467
- if (l.issues) {
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: a
2355
+ value: l
2474
2356
  };
2475
- for (const f of l.issues)
2476
- f.path ? f.path.unshift(u) : f.path = [u], n.issues?.push(f);
2477
- if (n.issues || (n.issues = l.issues), r.abortEarly) {
2478
- n.typed = !1;
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
- l.typed || (n.typed = !1), n.value[s] = l.value;
2364
+ a.typed || (r.typed = !1), r.value[s] = a.value;
2483
2365
  } else if (o.fallback !== void 0)
2484
- n.value[s] = /* @__PURE__ */ Ri(o);
2485
- else if (o.type !== "exact_optional" && o.type !== "optional" && o.type !== "nullish" && (P(this, "key", n, r, {
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
- }), r.abortEarly))
2380
+ }), n.abortEarly))
2499
2381
  break;
2500
2382
  }
2501
2383
  } else
2502
- P(this, "type", n, r);
2503
- return n;
2384
+ S(this, "type", r, n);
2385
+ return r;
2504
2386
  }
2505
2387
  };
2506
2388
  }
2507
2389
  // @__NO_SIDE_EFFECTS__
2508
- function bt(t, e) {
2390
+ function U(t, e) {
2509
2391
  return {
2510
2392
  kind: "schema",
2511
2393
  type: "optional",
2512
- reference: bt,
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__ */ R(this);
2400
+ return /* @__PURE__ */ N(this);
2519
2401
  },
2520
- "~run"(n, r) {
2521
- return n.value === void 0 && (this.default !== void 0 && (n.value = /* @__PURE__ */ Gn(this, n, r)), n.value === void 0) ? (n.typed = !0, n) : this.wrapped["~run"](n, r);
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 $n(t) {
2408
+ function cn(t) {
2527
2409
  return {
2528
2410
  kind: "schema",
2529
2411
  type: "promise",
2530
- reference: $n,
2412
+ reference: cn,
2531
2413
  expects: "Promise",
2532
2414
  async: !1,
2533
2415
  message: t,
2534
2416
  get "~standard"() {
2535
- return /* @__PURE__ */ R(this);
2417
+ return /* @__PURE__ */ N(this);
2536
2418
  },
2537
- "~run"(e, n) {
2538
- return e.value instanceof Promise ? e.typed = !0 : P(this, "type", e, n), e;
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 Ye(t) {
2425
+ function te(t) {
2544
2426
  return {
2545
2427
  kind: "schema",
2546
2428
  type: "string",
2547
- reference: Ye,
2429
+ reference: te,
2548
2430
  expects: "string",
2549
2431
  async: !1,
2550
2432
  message: t,
2551
2433
  get "~standard"() {
2552
- return /* @__PURE__ */ R(this);
2434
+ return /* @__PURE__ */ N(this);
2553
2435
  },
2554
- "~run"(e, n) {
2555
- return typeof e.value == "string" ? e.typed = !0 : P(this, "type", e, n), e;
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 B(t, e) {
2442
+ function Z(t, e) {
2561
2443
  return {
2562
2444
  kind: "schema",
2563
2445
  type: "tuple",
2564
- reference: B,
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__ */ R(this);
2452
+ return /* @__PURE__ */ N(this);
2571
2453
  },
2572
- "~run"(n, r) {
2573
- const i = n.value;
2454
+ "~run"(r, n) {
2455
+ const i = r.value;
2574
2456
  if (Array.isArray(i)) {
2575
- n.typed = !0, n.value = [];
2457
+ r.typed = !0, r.value = [];
2576
2458
  for (let s = 0; s < this.items.length; s++) {
2577
- const o = i[s], a = this.items[s]["~run"]({ value: o }, r);
2578
- if (a.issues) {
2579
- const l = {
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 a.issues)
2587
- u.path ? u.path.unshift(l) : u.path = [l], n.issues?.push(u);
2588
- if (n.issues || (n.issues = a.issues), r.abortEarly) {
2589
- n.typed = !1;
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
- a.typed || (n.typed = !1), n.value.push(a.value);
2475
+ l.typed || (r.typed = !1), r.value.push(l.value);
2594
2476
  }
2595
2477
  } else
2596
- P(this, "type", n, r);
2597
- return n;
2478
+ S(this, "type", r, n);
2479
+ return r;
2598
2480
  }
2599
2481
  };
2600
2482
  }
2601
2483
  // @__NO_SIDE_EFFECTS__
2602
- function je(t) {
2484
+ function qe(t) {
2603
2485
  return {
2604
2486
  kind: "schema",
2605
2487
  type: "void",
2606
- reference: je,
2488
+ reference: qe,
2607
2489
  expects: "void",
2608
2490
  async: !1,
2609
2491
  message: t,
2610
2492
  get "~standard"() {
2611
- return /* @__PURE__ */ R(this);
2493
+ return /* @__PURE__ */ N(this);
2612
2494
  },
2613
- "~run"(e, n) {
2614
- return e.value === void 0 ? e.typed = !0 : P(this, "type", e, n), e;
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 Je(t, e, n) {
2619
- const r = t["~run"]({ value: e }, /* @__PURE__ */ Hn(n));
2620
- if (r.issues)
2621
- throw new ut(r.issues);
2622
- return r.value;
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 E(...t) {
2507
+ function _(...t) {
2626
2508
  return {
2627
2509
  ...t[0],
2628
2510
  pipe: t,
2629
2511
  get "~standard"() {
2630
- return /* @__PURE__ */ R(this);
2512
+ return /* @__PURE__ */ N(this);
2631
2513
  },
2632
- "~run"(e, n) {
2633
- for (const r of t)
2634
- if (r.kind !== "metadata") {
2635
- if (e.issues && (r.kind === "schema" || r.kind === "transformation")) {
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 || !n.abortEarly && !n.abortPipeEarly) && (e = r["~run"](e, n));
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 Ni(...t) {
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__ */ R(this);
2534
+ return /* @__PURE__ */ N(this);
2653
2535
  },
2654
- async "~run"(e, n) {
2655
- for (const r of t)
2656
- if (r.kind !== "metadata") {
2657
- if (e.issues && (r.kind === "schema" || r.kind === "transformation")) {
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 || !n.abortEarly && !n.abortPipeEarly) && (e = await r["~run"](e, n));
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 kt = /* @__PURE__ */ E(/* @__PURE__ */ g(), /* @__PURE__ */ G(-90), /* @__PURE__ */ Ae(90)), Mt = /* @__PURE__ */ E(/* @__PURE__ */ g(), /* @__PURE__ */ G(-180), /* @__PURE__ */ Ae(180)), zi = /* @__PURE__ */ C({
2668
- sw: /* @__PURE__ */ C({ lat: kt, lng: Mt }),
2669
- ne: /* @__PURE__ */ C({ lat: kt, lng: Mt })
2670
- }), xt = /* @__PURE__ */ Qn((t) => t instanceof HTMLElement, "Must be an HTMLElement"), ji = /* @__PURE__ */ C({
2671
- mapSize: /* @__PURE__ */ E(/* @__PURE__ */ g(), /* @__PURE__ */ G(1)),
2672
- zoomMin: /* @__PURE__ */ E(/* @__PURE__ */ g(), /* @__PURE__ */ G(0)),
2673
- zoomMax: /* @__PURE__ */ E(/* @__PURE__ */ g(), /* @__PURE__ */ G(0)),
2674
- zoomScale: /* @__PURE__ */ E(/* @__PURE__ */ g(), /* @__PURE__ */ G(1), /* @__PURE__ */ Ae(10))
2675
- }), Bi = /* @__PURE__ */ C({
2676
- inserted: /* @__PURE__ */ E(/* @__PURE__ */ j(), /* @__PURE__ */ z(/* @__PURE__ */ B([])), /* @__PURE__ */ H(/* @__PURE__ */ Jn())),
2677
- insert: /* @__PURE__ */ E(/* @__PURE__ */ j(), /* @__PURE__ */ z(/* @__PURE__ */ B([])), /* @__PURE__ */ H(/* @__PURE__ */ je())),
2678
- remove: /* @__PURE__ */ E(/* @__PURE__ */ j(), /* @__PURE__ */ z(/* @__PURE__ */ B([])), /* @__PURE__ */ H(/* @__PURE__ */ je())),
2679
- update: /* @__PURE__ */ E(/* @__PURE__ */ j(), /* @__PURE__ */ z(/* @__PURE__ */ B([/* @__PURE__ */ g()])), /* @__PURE__ */ H(/* @__PURE__ */ je()))
2680
- }), Ui = /* @__PURE__ */ C({
2681
- getParameters: /* @__PURE__ */ E(/* @__PURE__ */ j(), /* @__PURE__ */ z(/* @__PURE__ */ B([])), /* @__PURE__ */ H(ji)),
2682
- getContainer: /* @__PURE__ */ E(/* @__PURE__ */ j(), /* @__PURE__ */ z(/* @__PURE__ */ B([])), /* @__PURE__ */ H(xt)),
2683
- getZoom: /* @__PURE__ */ E(/* @__PURE__ */ j(), /* @__PURE__ */ z(/* @__PURE__ */ B([])), /* @__PURE__ */ H(/* @__PURE__ */ g())),
2684
- getBounds: /* @__PURE__ */ E(/* @__PURE__ */ j(), /* @__PURE__ */ z(/* @__PURE__ */ B([])), /* @__PURE__ */ H(zi)),
2685
- panBy: /* @__PURE__ */ E(/* @__PURE__ */ j(), /* @__PURE__ */ z(/* @__PURE__ */ B([/* @__PURE__ */ g(), /* @__PURE__ */ g()])), /* @__PURE__ */ H(/* @__PURE__ */ je())),
2686
- createMarker: /* @__PURE__ */ E(
2687
- /* @__PURE__ */ j(),
2688
- /* @__PURE__ */ z(/* @__PURE__ */ B([xt, kt, Mt, /* @__PURE__ */ g()])),
2689
- /* @__PURE__ */ H(Bi)
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
- }), dt = /* @__PURE__ */ E(
2692
- /* @__PURE__ */ j(),
2693
- /* @__PURE__ */ z(/* @__PURE__ */ B([/* @__PURE__ */ Ye()])),
2694
- /* @__PURE__ */ Wn(/* @__PURE__ */ Ni(/* @__PURE__ */ $n(), /* @__PURE__ */ Yn(), xt))
2695
- ), Zi = /* @__PURE__ */ C({
2696
- id: /* @__PURE__ */ E(/* @__PURE__ */ Ye(), /* @__PURE__ */ jt(1)),
2697
- rank: /* @__PURE__ */ E(/* @__PURE__ */ g(), /* @__PURE__ */ G(0)),
2698
- lat: /* @__PURE__ */ E(/* @__PURE__ */ g(), /* @__PURE__ */ G(-90), /* @__PURE__ */ Ae(90)),
2699
- lng: /* @__PURE__ */ E(/* @__PURE__ */ g(), /* @__PURE__ */ G(-180), /* @__PURE__ */ Ae(180)),
2700
- tooltip: /* @__PURE__ */ C({
2701
- style: /* @__PURE__ */ E(
2702
- /* @__PURE__ */ C({
2703
- width: /* @__PURE__ */ g(),
2704
- height: /* @__PURE__ */ g(),
2705
- margin: /* @__PURE__ */ g(),
2706
- radius: /* @__PURE__ */ g()
2707
- }),
2708
- /* @__PURE__ */ Vn(
2709
- (t) => Math.min(t.width, t.height) / t.margin >= 6,
2710
- "Tooltip: minimum of width or height must be greater than or equal to 6 * margin"
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
- pin: /* @__PURE__ */ bt(
2716
- /* @__PURE__ */ C({
2717
- style: /* @__PURE__ */ C({
2718
- width: /* @__PURE__ */ g(),
2719
- height: /* @__PURE__ */ g(),
2720
- radius: /* @__PURE__ */ g()
2721
- }),
2722
- body: dt
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__ */ bt(
2726
- /* @__PURE__ */ C({
2727
- style: /* @__PURE__ */ C({
2728
- width: /* @__PURE__ */ g(),
2729
- height: /* @__PURE__ */ g(),
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
- }), qi = /* @__PURE__ */ Kn(Zi);
2737
- var ve;
2738
- ((t) => {
2739
- t.COUNT = 12, t.DEGREES = [0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330], t.DEGREES_DEFAULT = 270;
2740
- })(ve || (ve = {}));
2741
- const Hi = /* @__PURE__ */ E(/* @__PURE__ */ Ye(), /* @__PURE__ */ Xn(32)), Yi = /* @__PURE__ */ E(/* @__PURE__ */ Ye(), /* @__PURE__ */ jt(1)), an = "1.1.4", Bt = "https://maps.api.arenarium.dev", Vi = `${Bt}/auth`, Xi = `${Bt}/states`, Wi = `${Bt}/log`;
2742
- class er {
2743
- apiKey;
2744
- apiToken;
2745
- apiDevEnvironment;
2746
- mapProvider;
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
- static async create(e, n, r) {
2757
- const i = { key: e, version: an };
2758
- let o = (await ze.post(Vi, i)).token;
2759
- if (!o) throw new Error("Failed to get api token");
2760
- return new er(e, o, n, r);
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
- setConfiguration(e) {
2763
- ie.setLimit(e?.animation?.queue?.limit ?? 8 * navigator.hardwareConcurrency), this.markerPinProcessor.setConfiguration(e);
2647
+ update(e) {
2648
+ this.zoom = e[0], this.setZIndex();
2764
2649
  }
2765
- async updateMarkers(e) {
2766
- Je(qi, e);
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
- removeMarkers() {
2774
- try {
2775
- this.removeMarkerData();
2776
- } catch (e) {
2777
- throw console.error(e), e instanceof Error && this.log("error", "Failed to remove markers", e), e;
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
- showPopup(e) {
2781
- try {
2782
- for (const n of this.markerDataArray)
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
- hidePopup(e) {
2792
- try {
2793
- if (e) {
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
- async updateMarkerData(e) {
2808
- try {
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
- removeMarkerData() {
2837
- try {
2838
- this.markerDataUpdating = !0, this.markerPinProcessor.removeElements(), this.markerTooltipProcessor.removeElements(), this.markerPopupProcessor.removeElements(), this.markerDataArray.length = 0, this.markerDataMap.clear();
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
- async getMarkerStates(e) {
2846
- if (e.length == 0) return [];
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
- remove() {
2913
- this.pin.remove(), this.tooltip.remove(), this.popup?.remove();
2680
+ isBodyLoaded() {
2681
+ return this.bodyCallback == null || this.bodyLoaded;
2914
2682
  }
2915
2683
  }
2916
- class Ut {
2917
- provider;
2918
- id;
2919
- lat;
2920
- lng;
2921
- shown;
2922
- element;
2923
- component;
2924
- marker;
2925
- constructor(e, n) {
2926
- this.provider = e, this.id = n.id, this.lat = n.lat, this.lng = n.lng, this.shown = !0;
2927
- }
2928
- create() {
2929
- this.createElement(), this.createMarker(), this.updateZIndex();
2930
- }
2931
- createElement() {
2932
- throw new Error("Create element not implemented");
2933
- }
2934
- createMarker() {
2935
- const e = this.element;
2936
- if (!e) throw new Error("Failed to create provider marker");
2937
- this.marker = this.provider.createMarker(e, this.lat, this.lng, this.getZindex());
2938
- }
2939
- updateZIndex() {
2940
- if (this.marker == null) throw new Error("Failed to update provider marker z-index");
2941
- this.marker.update(this.getZindex());
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
- updateMap(e) {
2944
- const n = this.marker, r = this.component;
2945
- if (n == null || r == null) throw new Error("Failed to update provider marker map");
2946
- e ? n.inserted() == !1 && n.insert() : n.inserted() == !0 && n.remove();
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
- getZindex() {
2949
- throw new Error("Get z-index not implemented");
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
- remove() {
2952
- this.marker?.remove();
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
- class Be extends Ut {
2956
- static DEFAULT_SIZE = 16;
2957
- width;
2958
- height;
2959
- radius;
2960
- zoom;
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, n, r) {
2965
- super(e, n), this.width = n.pin?.style.width ?? Be.DEFAULT_SIZE, this.height = n.pin?.style.height ?? Be.DEFAULT_SIZE, this.radius = n.pin?.style.radius ?? Be.DEFAULT_SIZE, this.zoom = r[0], this.bodyCallback = n.pin?.body;
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("pin"), this.component = Nt(Ai, {
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 + "_pin",
2972
- layer: xi,
2973
- priority: this.zoom * this.provider.getParameters().zoomScale,
2974
- width: this.width,
2975
- height: this.height,
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
- update(e) {
2981
- this.zoom = e[0], this.updateZIndex();
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.bodyCallback == null || this.bodyLoaded || this.bodyLoading) return;
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((n) => {
2990
- n instanceof HTMLElement ? e.appendChild(n) : console.error("Failed to load pin body");
2991
- }).catch((n) => console.error(n)).finally(() => {
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 pin collapsed");
2862
+ if (this.component == null) throw new Error("Failed to set popup collapsed");
2997
2863
  this.component.setCollapsed(e);
2998
2864
  }
2999
- setScale(e) {
3000
- if (this.component == null) throw new Error("Failed to set pin scale");
3001
- this.component.setScale(e);
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
- getZindex() {
3007
- const e = this.provider.getParameters();
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.bodyCallback == null || this.bodyLoaded;
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
- class Zt extends Ut {
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
- width;
3051
- height;
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, n, r) {
3061
- super(e, n), this.width = n.tooltip.style.width, this.height = n.tooltip.style.height, this.margin = n.tooltip.style.margin, this.radius = n.tooltip.style.radius, this.zoom = r[0], this.angle = ve.DEGREES_DEFAULT, this.states = r[1].map((i) => [i[0], ve.DEGREES[i[1]]]), this.bodyCallback = n.tooltip.body;
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 = Nt(Zn, {
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: Mi,
2901
+ layer: ji,
3069
2902
  priority: this.zoom * this.provider.getParameters().zoomScale,
3070
- width: this.width,
3071
- height: this.height,
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((n) => [n[0], ve.DEGREES[n[1]]]), this.updateZIndex();
2909
+ this.zoom = e[0], this.states = e[1].map((r) => [r[0], ye.DEGREES[r[1]]]), this.setZIndex();
3079
2910
  }
3080
- updateMap(e) {
3081
- super.updateMap(e), this.component?.setDisplayed(e);
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((n) => {
3091
- n instanceof HTMLElement ? e.appendChild(n) : console.error("Failed to load tooltip body");
3092
- }).catch((n) => console.error(n)).finally(() => {
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 n = this.states.findLast((r) => r[0] <= e);
3098
- if (!n) throw new Error("Angle not found");
3099
- return n[1];
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) + Zt.Z_INDEX_OFFSET;
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 Ki {
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
- tooltipElements = new Array();
3023
+ pinElements = new Array();
3123
3024
  // Configuration
3124
- tooltipMaxWidth = 0;
3125
- tooltipMaxHeight = 0;
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.tooltipElements = e, this.tooltipMaxWidth = this.tooltipElements.reduce((n, r) => Math.max(n, r.width), 0), this.tooltipMaxHeight = this.tooltipElements.reduce((n, r) => Math.max(n, r.height), 0);
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.tooltipElements.forEach((e) => e.remove()), this.tooltipElements.length = 0;
3040
+ this.pinElements.forEach((e) => e.removeMarker()), this.pinElements.length = 0;
3134
3041
  }
3135
- process(e, n) {
3136
- const r = this.provider.getParameters().mapSize, i = new qn(e, n, r, this.tooltipMaxWidth * 2, this.tooltipMaxHeight * 2);
3137
- for (const s of this.tooltipElements)
3138
- i.contains(s.lat, s.lng) ? s.shown && s.zoom <= n ? (s.updateState(n), s.setCollapsed(!1), s.updateMap(!0), s.isCollapsed() == !1 && s.isBodyLoaded() == !1 && s.updateBody()) : (s.setCollapsed(!0), s.isCollapsed() && s.updateMap(!1)) : s.updateMap(!1);
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 qt extends Ut {
3142
- static Z_INDEX_OFFSET = 2e6;
3143
- width;
3144
- height;
3145
- margin;
3146
- radius;
3147
- bodyLoading = !1;
3148
- bodyLoaded = !1;
3149
- bodyCallback;
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
- isExpanded() {
3192
- return this.component == null ? !1 : this.component.getExpanded();
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
- isCollapsed() {
3195
- return this.component == null ? !1 : this.component.getCollapsed();
3062
+ removeElements() {
3063
+ this.tooltipElements.forEach((e) => e.removeMarker()), this.tooltipElements.length = 0;
3196
3064
  }
3197
- isBodyLoaded() {
3198
- return this.bodyLoaded;
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 Ji {
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((n) => [n.id, !1]));
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.remove()), this.popupElements.length = 0, this.popupPositioned.clear();
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.updateMap(!0), e.isExpanded() && e.isBodyLoaded() == !1 && e.updateBody(), e.isCollapsed() == !1 && this.popupPositioned.get(e.id) == !1) {
3225
- const n = e.component?.getBody();
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 i = n.getBoundingClientRect();
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, a = s + r.x, l = o + r.y, u = a + e.width, f = l + e.height, h = this.provider.getContainer().getBoundingClientRect(), p = a - h.left, c = h.right - u, d = l - h.top, k = h.bottom - f, I = Math.min(e.width, e.height) / 4, V = p < 0 ? p - I : c < 0 ? -c + I : 0, w = d < 0 ? d - I : k < 0 ? -k + I : 0;
3232
- this.provider.panBy(V, w), this.popupPositioned.set(e.id, !0);
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.updateMap(!1);
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 Qi = () => '<img src="https://arenarium.dev/favicon.svg" alt="Arenarium Maps" style="height: 1.25em; vertical-align: middle;" />', ts = () => `<a href="https://arenarium.dev" target="_blank" style="color: inherit;">${Qi()}<span>&nbsp;@arenarium/maps</span></a>`;
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>&nbsp;@arenarium/maps</span></a>`;
3239
3319
  export {
3240
- er as MapManager,
3241
- ts as getAttributionHtml,
3242
- Qi as getImageHtml
3320
+ dn as MapManager,
3321
+ gs as getAttributionHtml,
3322
+ vs as getImageHtml
3243
3323
  };