@hintergrund/ui 0.1.5 → 0.1.7

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.
@@ -1,3150 +0,0 @@
1
- typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add("5");
2
- const at = 1, ft = 2, cn = 4, or = 8, cr = 16, hr = 1, dr = 2, _r = 4, vr = 8, pr = 16, Cs = 1, Rs = 2, Is = 4, mr = 1, gr = 2, hn = "[", lt = "[!", jt = "]", Re = {}, N = Symbol(), yr = "http://www.w3.org/1999/xhtml", dn = !1;
3
- var ut = Array.isArray, wr = Array.prototype.indexOf, qt = Array.from, tt = Object.keys, Ie = Object.defineProperty, ye = Object.getOwnPropertyDescriptor, _n = Object.getOwnPropertyDescriptors, $r = Object.prototype, br = Array.prototype, Bt = Object.getPrototypeOf, Zt = Object.isExtensible;
4
- function Ps(e) {
5
- return typeof e == "function";
6
- }
7
- const Ms = () => {
8
- };
9
- function Ls(e) {
10
- return typeof e?.then == "function";
11
- }
12
- function Ds(e) {
13
- return e();
14
- }
15
- function Er(e) {
16
- for (var t = 0; t < e.length; t++)
17
- e[t]();
18
- }
19
- function vn() {
20
- var e, t, n = new Promise((r, s) => {
21
- e = r, t = s;
22
- });
23
- return { promise: n, resolve: e, reject: t };
24
- }
25
- function Fs(e, t) {
26
- if (Array.isArray(e))
27
- return e;
28
- if (!(Symbol.iterator in e))
29
- return Array.from(e);
30
- const n = [];
31
- for (const r of e)
32
- if (n.push(r), n.length === t) break;
33
- return n;
34
- }
35
- const F = 2, Ht = 4, ot = 8, Se = 16, ue = 32, ve = 64, ct = 128, W = 256, nt = 512, P = 1024, U = 2048, pe = 4096, H = 8192, fe = 16384, Ut = 32768, ht = 65536, Qt = 1 << 17, Sr = 1 << 18, Te = 1 << 19, pn = 1 << 20, xt = 1 << 21, Vt = 1 << 22, we = 1 << 23, he = Symbol("$state"), mn = Symbol("legacy props"), Tr = Symbol(""), xe = new class extends Error {
36
- name = "StaleReactionError";
37
- message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
38
- }(), dt = 3, De = 8;
39
- function kr(e) {
40
- throw new Error("https://svelte.dev/e/lifecycle_outside_component");
41
- }
42
- function Ar() {
43
- throw new Error("https://svelte.dev/e/async_derived_orphan");
44
- }
45
- function xr(e) {
46
- throw new Error("https://svelte.dev/e/effect_in_teardown");
47
- }
48
- function Nr() {
49
- throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
50
- }
51
- function Or(e) {
52
- throw new Error("https://svelte.dev/e/effect_orphan");
53
- }
54
- function Cr() {
55
- throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
56
- }
57
- function Rr() {
58
- throw new Error("https://svelte.dev/e/hydration_failed");
59
- }
60
- function Ir(e) {
61
- throw new Error("https://svelte.dev/e/props_invalid_value");
62
- }
63
- function Pr() {
64
- throw new Error("https://svelte.dev/e/state_descriptors_fixed");
65
- }
66
- function Mr() {
67
- throw new Error("https://svelte.dev/e/state_prototype_fixed");
68
- }
69
- function Lr() {
70
- throw new Error("https://svelte.dev/e/state_unsafe_mutation");
71
- }
72
- function Dr() {
73
- throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
74
- }
75
- function _t(e) {
76
- console.warn("https://svelte.dev/e/hydration_mismatch");
77
- }
78
- function Fr() {
79
- console.warn("https://svelte.dev/e/select_multiple_invalid_value");
80
- }
81
- function jr() {
82
- console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
83
- }
84
- let v = !1;
85
- function B(e) {
86
- v = e;
87
- }
88
- let w;
89
- function C(e) {
90
- if (e === null)
91
- throw _t(), Re;
92
- return w = e;
93
- }
94
- function vt() {
95
- return C(
96
- /** @type {TemplateNode} */
97
- /* @__PURE__ */ ie(w)
98
- );
99
- }
100
- function qs(e) {
101
- if (v) {
102
- if (/* @__PURE__ */ ie(w) !== null)
103
- throw _t(), Re;
104
- w = e;
105
- }
106
- }
107
- function qr(e = 1) {
108
- if (v) {
109
- for (var t = e, n = w; t--; )
110
- n = /** @type {TemplateNode} */
111
- /* @__PURE__ */ ie(n);
112
- w = n;
113
- }
114
- }
115
- function rt(e = !0) {
116
- for (var t = 0, n = w; ; ) {
117
- if (n.nodeType === De) {
118
- var r = (
119
- /** @type {Comment} */
120
- n.data
121
- );
122
- if (r === jt) {
123
- if (t === 0) return n;
124
- t -= 1;
125
- } else (r === hn || r === lt) && (t += 1);
126
- }
127
- var s = (
128
- /** @type {TemplateNode} */
129
- /* @__PURE__ */ ie(n)
130
- );
131
- e && n.remove(), n = s;
132
- }
133
- }
134
- function gn(e) {
135
- if (!e || e.nodeType !== De)
136
- throw _t(), Re;
137
- return (
138
- /** @type {Comment} */
139
- e.data
140
- );
141
- }
142
- function yn(e) {
143
- return e === this.v;
144
- }
145
- function Br(e, t) {
146
- return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
147
- }
148
- function wn(e) {
149
- return !Br(e, this.v);
150
- }
151
- let Ge = !1, Hr = !1;
152
- function Bs() {
153
- Ge = !0;
154
- }
155
- let A = null;
156
- function Pe(e) {
157
- A = e;
158
- }
159
- function Hs(e) {
160
- return (
161
- /** @type {T} */
162
- $n().get(e)
163
- );
164
- }
165
- function Us(e, t) {
166
- return $n().set(e, t), t;
167
- }
168
- function Ur(e, t = !1, n) {
169
- A = {
170
- p: A,
171
- c: null,
172
- e: null,
173
- s: e,
174
- x: null,
175
- l: Ge && !t ? { s: null, u: null, $: [] } : null
176
- };
177
- }
178
- function Vr(e) {
179
- var t = (
180
- /** @type {ComponentContext} */
181
- A
182
- ), n = t.e;
183
- if (n !== null) {
184
- t.e = null;
185
- for (var r of n)
186
- qn(r);
187
- }
188
- return e !== void 0 && (t.x = e), A = t.p, e ?? /** @type {T} */
189
- {};
190
- }
191
- function Ke() {
192
- return !Ge || A !== null && A.l === null;
193
- }
194
- function $n(e) {
195
- return A === null && kr(), A.c ??= new Map(Yr(A) || void 0);
196
- }
197
- function Yr(e) {
198
- let t = e.p;
199
- for (; t !== null; ) {
200
- const n = t.c;
201
- if (n !== null)
202
- return n;
203
- t = t.p;
204
- }
205
- return null;
206
- }
207
- let ge = [];
208
- function bn() {
209
- var e = ge;
210
- ge = [], Er(e);
211
- }
212
- function _e(e) {
213
- if (ge.length === 0 && !Ue) {
214
- var t = ge;
215
- queueMicrotask(() => {
216
- t === ge && bn();
217
- });
218
- }
219
- ge.push(e);
220
- }
221
- function Wr() {
222
- for (; ge.length > 0; )
223
- bn();
224
- }
225
- const Gr = /* @__PURE__ */ new WeakMap();
226
- function En(e) {
227
- var t = m;
228
- if (t === null)
229
- return y.f |= we, e;
230
- if ((t.f & Ut) === 0) {
231
- if ((t.f & ct) === 0)
232
- throw !t.parent && e instanceof Error && Sn(e), e;
233
- t.b.error(e);
234
- } else
235
- Me(e, t);
236
- }
237
- function Me(e, t) {
238
- for (; t !== null; ) {
239
- if ((t.f & ct) !== 0)
240
- try {
241
- t.b.error(e);
242
- return;
243
- } catch (n) {
244
- e = n;
245
- }
246
- t = t.parent;
247
- }
248
- throw e instanceof Error && Sn(e), e;
249
- }
250
- function Sn(e) {
251
- const t = Gr.get(e);
252
- t && (Ie(e, "message", {
253
- value: t.message
254
- }), Ie(e, "stack", {
255
- value: t.stack
256
- }));
257
- }
258
- const Ze = /* @__PURE__ */ new Set();
259
- let b = null, He = null, z = null, Nt = /* @__PURE__ */ new Set(), te = [], pt = null, Ot = !1, Ue = !1;
260
- class ne {
261
- committed = !1;
262
- /**
263
- * The current values of any sources that are updated in this batch
264
- * They keys of this map are identical to `this.#previous`
265
- * @type {Map<Source, any>}
266
- */
267
- current = /* @__PURE__ */ new Map();
268
- /**
269
- * The values of any sources that are updated in this batch _before_ those updates took place.
270
- * They keys of this map are identical to `this.#current`
271
- * @type {Map<Source, any>}
272
- */
273
- #t = /* @__PURE__ */ new Map();
274
- /**
275
- * When the batch is committed (and the DOM is updated), we need to remove old branches
276
- * and append new ones by calling the functions added inside (if/each/key/etc) blocks
277
- * @type {Set<() => void>}
278
- */
279
- #e = /* @__PURE__ */ new Set();
280
- /**
281
- * The number of async effects that are currently in flight
282
- */
283
- #n = 0;
284
- /**
285
- * The number of async effects that are currently in flight, _not_ inside a pending boundary
286
- */
287
- #r = 0;
288
- /**
289
- * A deferred that resolves when the batch is committed, used with `settled()`
290
- * TODO replace with Promise.withResolvers once supported widely enough
291
- * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
292
- */
293
- #l = null;
294
- /**
295
- * Deferred effects (which run after async work has completed) that are DIRTY
296
- * @type {Effect[]}
297
- */
298
- #f = [];
299
- /**
300
- * Deferred effects that are MAYBE_DIRTY
301
- * @type {Effect[]}
302
- */
303
- #a = [];
304
- /**
305
- * A set of branches that still exist, but will be destroyed when this batch
306
- * is committed — we skip over these during `process`
307
- * @type {Set<Effect>}
308
- */
309
- skipped_effects = /* @__PURE__ */ new Set();
310
- /**
311
- *
312
- * @param {Effect[]} root_effects
313
- */
314
- process(t) {
315
- te = [], He = null, this.apply();
316
- var n = {
317
- parent: null,
318
- effect: null,
319
- effects: [],
320
- render_effects: [],
321
- block_effects: []
322
- };
323
- for (const r of t)
324
- this.#s(r, n);
325
- this.#u(), this.#r > 0 ? (this.#i(n.effects), this.#i(n.render_effects), this.#i(n.block_effects)) : (He = this, b = null, en(n.render_effects), en(n.effects), He = null), z = null;
326
- }
327
- /**
328
- * Traverse the effect tree, executing effects or stashing
329
- * them for later execution as appropriate
330
- * @param {Effect} root
331
- * @param {EffectTarget} target
332
- */
333
- #s(t, n) {
334
- t.f ^= P;
335
- for (var r = t.first; r !== null; ) {
336
- var s = r.f, i = (s & (ue | ve)) !== 0, a = i && (s & P) !== 0, f = a || (s & H) !== 0 || this.skipped_effects.has(r);
337
- if ((r.f & ct) !== 0 && r.b?.is_pending() && (n = {
338
- parent: n,
339
- effect: r,
340
- effects: [],
341
- render_effects: [],
342
- block_effects: []
343
- }), !f && r.fn !== null) {
344
- i ? r.f ^= P : (s & Ht) !== 0 ? n.effects.push(r) : wt(r) && ((r.f & Se) !== 0 && n.block_effects.push(r), it(r));
345
- var l = r.first;
346
- if (l !== null) {
347
- r = l;
348
- continue;
349
- }
350
- }
351
- var u = r.parent;
352
- for (r = r.next; r === null && u !== null; )
353
- u === n.effect && (this.#i(n.effects), this.#i(n.render_effects), this.#i(n.block_effects), n = /** @type {EffectTarget} */
354
- n.parent), r = u.next, u = u.parent;
355
- }
356
- }
357
- /**
358
- * @param {Effect[]} effects
359
- */
360
- #i(t) {
361
- for (const n of t)
362
- ((n.f & U) !== 0 ? this.#f : this.#a).push(n), D(n, P);
363
- }
364
- /**
365
- * Associate a change to a given source with the current
366
- * batch, noting its previous and current values
367
- * @param {Source} source
368
- * @param {any} value
369
- */
370
- capture(t, n) {
371
- this.#t.has(t) || this.#t.set(t, n), this.current.set(t, t.v), z?.set(t, t.v);
372
- }
373
- activate() {
374
- b = this;
375
- }
376
- deactivate() {
377
- b = null, z = null;
378
- }
379
- flush() {
380
- if (te.length > 0) {
381
- if (this.activate(), kn(), b !== null && b !== this)
382
- return;
383
- } else
384
- this.#u();
385
- this.deactivate();
386
- for (const t of Nt)
387
- if (Nt.delete(t), t(), b !== null)
388
- break;
389
- }
390
- #u() {
391
- if (this.#r === 0) {
392
- for (const t of this.#e) t();
393
- this.#e.clear();
394
- }
395
- this.#n === 0 && this.#o();
396
- }
397
- #o() {
398
- if (Ze.size > 1) {
399
- this.#t.clear();
400
- var t = z, n = !0, r = {
401
- parent: null,
402
- effect: null,
403
- effects: [],
404
- render_effects: [],
405
- block_effects: []
406
- };
407
- for (const s of Ze) {
408
- if (s === this) {
409
- n = !1;
410
- continue;
411
- }
412
- const i = [];
413
- for (const [f, l] of this.current) {
414
- if (s.current.has(f))
415
- if (n && l !== s.current.get(f))
416
- s.current.set(f, l);
417
- else
418
- continue;
419
- i.push(f);
420
- }
421
- if (i.length === 0)
422
- continue;
423
- const a = [...s.current.keys()].filter((f) => !this.current.has(f));
424
- if (a.length > 0) {
425
- for (const f of i)
426
- An(f, a);
427
- if (te.length > 0) {
428
- b = s, s.apply();
429
- for (const f of te)
430
- s.#s(f, r);
431
- te = [], s.deactivate();
432
- }
433
- }
434
- }
435
- b = null, z = t;
436
- }
437
- this.committed = !0, Ze.delete(this), this.#l?.resolve();
438
- }
439
- /**
440
- *
441
- * @param {boolean} blocking
442
- */
443
- increment(t) {
444
- this.#n += 1, t && (this.#r += 1);
445
- }
446
- /**
447
- *
448
- * @param {boolean} blocking
449
- */
450
- decrement(t) {
451
- this.#n -= 1, t && (this.#r -= 1);
452
- for (const n of this.#f)
453
- D(n, U), be(n);
454
- for (const n of this.#a)
455
- D(n, pe), be(n);
456
- this.#f = [], this.#a = [], this.flush();
457
- }
458
- /** @param {() => void} fn */
459
- add_callback(t) {
460
- this.#e.add(t);
461
- }
462
- settled() {
463
- return (this.#l ??= vn()).promise;
464
- }
465
- static ensure() {
466
- if (b === null) {
467
- const t = b = new ne();
468
- Ze.add(b), Ue || ne.enqueue(() => {
469
- b === t && t.flush();
470
- });
471
- }
472
- return b;
473
- }
474
- /** @param {() => void} task */
475
- static enqueue(t) {
476
- _e(t);
477
- }
478
- apply() {
479
- }
480
- }
481
- function Tn(e) {
482
- var t = Ue;
483
- Ue = !0;
484
- try {
485
- for (var n; ; ) {
486
- if (Wr(), te.length === 0 && (b?.flush(), te.length === 0))
487
- return pt = null, /** @type {T} */
488
- n;
489
- kn();
490
- }
491
- } finally {
492
- Ue = t;
493
- }
494
- }
495
- function kn() {
496
- var e = Ce;
497
- Ot = !0;
498
- try {
499
- var t = 0;
500
- for (sn(!0); te.length > 0; ) {
501
- var n = ne.ensure();
502
- if (t++ > 1e3) {
503
- var r, s;
504
- Kr();
505
- }
506
- n.process(te), de.clear();
507
- }
508
- } finally {
509
- Ot = !1, sn(e), pt = null;
510
- }
511
- }
512
- function Kr() {
513
- try {
514
- Cr();
515
- } catch (e) {
516
- Me(e, pt);
517
- }
518
- }
519
- let ae = null;
520
- function en(e) {
521
- var t = e.length;
522
- if (t !== 0) {
523
- for (var n = 0; n < t; ) {
524
- var r = e[n++];
525
- if ((r.f & (fe | H)) === 0 && wt(r) && (ae = /* @__PURE__ */ new Set(), it(r), r.deps === null && r.first === null && r.nodes_start === null && (r.teardown === null && r.ac === null ? Vn(r) : r.fn = null), ae?.size > 0)) {
526
- de.clear();
527
- for (const s of ae) {
528
- if ((s.f & (fe | H)) !== 0) continue;
529
- const i = [s];
530
- let a = s.parent;
531
- for (; a !== null; )
532
- ae.has(a) && (ae.delete(a), i.push(a)), a = a.parent;
533
- for (let f = i.length - 1; f >= 0; f--) {
534
- const l = i[f];
535
- (l.f & (fe | H)) === 0 && it(l);
536
- }
537
- }
538
- ae.clear();
539
- }
540
- }
541
- ae = null;
542
- }
543
- }
544
- function An(e, t) {
545
- if (e.reactions !== null)
546
- for (const n of e.reactions) {
547
- const r = n.f;
548
- (r & F) !== 0 ? An(
549
- /** @type {Derived} */
550
- n,
551
- t
552
- ) : (r & (Vt | Se)) !== 0 && xn(n, t) && (D(n, U), be(
553
- /** @type {Effect} */
554
- n
555
- ));
556
- }
557
- }
558
- function xn(e, t) {
559
- if (e.deps !== null) {
560
- for (const n of e.deps)
561
- if (t.includes(n) || (n.f & F) !== 0 && xn(
562
- /** @type {Derived} */
563
- n,
564
- t
565
- ))
566
- return !0;
567
- }
568
- return !1;
569
- }
570
- function be(e) {
571
- for (var t = pt = e; t.parent !== null; ) {
572
- t = t.parent;
573
- var n = t.f;
574
- if (Ot && t === m && (n & Se) !== 0)
575
- return;
576
- if ((n & (ve | ue)) !== 0) {
577
- if ((n & P) === 0) return;
578
- t.f ^= P;
579
- }
580
- }
581
- te.push(t);
582
- }
583
- function zr(e) {
584
- let t = 0, n = Ee(0), r;
585
- return () => {
586
- ss() && (M(n), Fe(() => (t === 0 && (r = $t(() => e(() => Ve(n)))), t += 1, () => {
587
- _e(() => {
588
- t -= 1, t === 0 && (r?.(), r = void 0, Ve(n));
589
- });
590
- })));
591
- };
592
- }
593
- var Jr = ht | Te | ct;
594
- function Xr(e, t, n) {
595
- new Zr(e, t, n);
596
- }
597
- class Zr {
598
- /** @type {Boundary | null} */
599
- parent;
600
- #t = !1;
601
- /** @type {TemplateNode} */
602
- #e;
603
- /** @type {TemplateNode | null} */
604
- #n = v ? w : null;
605
- /** @type {BoundaryProps} */
606
- #r;
607
- /** @type {((anchor: Node) => void)} */
608
- #l;
609
- /** @type {Effect} */
610
- #f;
611
- /** @type {Effect | null} */
612
- #a = null;
613
- /** @type {Effect | null} */
614
- #s = null;
615
- /** @type {Effect | null} */
616
- #i = null;
617
- /** @type {DocumentFragment | null} */
618
- #u = null;
619
- #o = 0;
620
- #c = 0;
621
- #d = !1;
622
- /**
623
- * A source containing the number of pending async deriveds/expressions.
624
- * Only created if `$effect.pending()` is used inside the boundary,
625
- * otherwise updating the source results in needless `Batch.ensure()`
626
- * calls followed by no-op flushes
627
- * @type {Source<number> | null}
628
- */
629
- #h = null;
630
- #m = () => {
631
- this.#h && Le(this.#h, this.#o);
632
- };
633
- #g = zr(() => (this.#h = Ee(this.#o), () => {
634
- this.#h = null;
635
- }));
636
- /**
637
- * @param {TemplateNode} node
638
- * @param {BoundaryProps} props
639
- * @param {((anchor: Node) => void)} children
640
- */
641
- constructor(t, n, r) {
642
- this.#e = t, this.#r = n, this.#l = r, this.parent = /** @type {Effect} */
643
- m.b, this.#t = !!this.#r.pending, this.#f = Kt(() => {
644
- if (m.b = this, v) {
645
- const s = this.#n;
646
- vt(), /** @type {Comment} */
647
- s.nodeType === De && /** @type {Comment} */
648
- s.data === lt ? this.#w() : this.#y();
649
- } else {
650
- try {
651
- this.#a = Y(() => r(this.#e));
652
- } catch (s) {
653
- this.error(s);
654
- }
655
- this.#c > 0 ? this.#v() : this.#t = !1;
656
- }
657
- }, Jr), v && (this.#e = w);
658
- }
659
- #y() {
660
- try {
661
- this.#a = Y(() => this.#l(this.#e));
662
- } catch (t) {
663
- this.error(t);
664
- }
665
- this.#t = !1;
666
- }
667
- #w() {
668
- const t = this.#r.pending;
669
- t && (this.#s = Y(() => t(this.#e)), ne.enqueue(() => {
670
- this.#a = this.#_(() => (ne.ensure(), Y(() => this.#l(this.#e)))), this.#c > 0 ? this.#v() : (Oe(
671
- /** @type {Effect} */
672
- this.#s,
673
- () => {
674
- this.#s = null;
675
- }
676
- ), this.#t = !1);
677
- }));
678
- }
679
- /**
680
- * Returns `true` if the effect exists inside a boundary whose pending snippet is shown
681
- * @returns {boolean}
682
- */
683
- is_pending() {
684
- return this.#t || !!this.parent && this.parent.is_pending();
685
- }
686
- has_pending_snippet() {
687
- return !!this.#r.pending;
688
- }
689
- /**
690
- * @param {() => Effect | null} fn
691
- */
692
- #_(t) {
693
- var n = m, r = y, s = A;
694
- K(this.#f), O(this.#f), Pe(this.#f.ctx);
695
- try {
696
- return t();
697
- } catch (i) {
698
- return En(i), null;
699
- } finally {
700
- K(n), O(r), Pe(s);
701
- }
702
- }
703
- #v() {
704
- const t = (
705
- /** @type {(anchor: Node) => void} */
706
- this.#r.pending
707
- );
708
- this.#a !== null && (this.#u = document.createDocumentFragment(), Gn(this.#a, this.#u)), this.#s === null && (this.#s = Y(() => t(this.#e)));
709
- }
710
- /**
711
- * Updates the pending count associated with the currently visible pending snippet,
712
- * if any, such that we can replace the snippet with content once work is done
713
- * @param {1 | -1} d
714
- */
715
- #p(t) {
716
- if (!this.has_pending_snippet()) {
717
- this.parent && this.parent.#p(t);
718
- return;
719
- }
720
- this.#c += t, this.#c === 0 && (this.#t = !1, this.#s && Oe(this.#s, () => {
721
- this.#s = null;
722
- }), this.#u && (this.#e.before(this.#u), this.#u = null));
723
- }
724
- /**
725
- * Update the source that powers `$effect.pending()` inside this boundary,
726
- * and controls when the current `pending` snippet (if any) is removed.
727
- * Do not call from inside the class
728
- * @param {1 | -1} d
729
- */
730
- update_pending_count(t) {
731
- this.#p(t), this.#o += t, Nt.add(this.#m);
732
- }
733
- get_effect_pending() {
734
- return this.#g(), M(
735
- /** @type {Source<number>} */
736
- this.#h
737
- );
738
- }
739
- /** @param {unknown} error */
740
- error(t) {
741
- var n = this.#r.onerror;
742
- let r = this.#r.failed;
743
- if (this.#d || !n && !r)
744
- throw t;
745
- this.#a && (L(this.#a), this.#a = null), this.#s && (L(this.#s), this.#s = null), this.#i && (L(this.#i), this.#i = null), v && (C(
746
- /** @type {TemplateNode} */
747
- this.#n
748
- ), qr(), C(rt()));
749
- var s = !1, i = !1;
750
- const a = () => {
751
- if (s) {
752
- jr();
753
- return;
754
- }
755
- s = !0, i && Dr(), ne.ensure(), this.#o = 0, this.#i !== null && Oe(this.#i, () => {
756
- this.#i = null;
757
- }), this.#t = this.has_pending_snippet(), this.#a = this.#_(() => (this.#d = !1, Y(() => this.#l(this.#e)))), this.#c > 0 ? this.#v() : this.#t = !1;
758
- };
759
- var f = y;
760
- try {
761
- O(null), i = !0, n?.(t, a), i = !1;
762
- } catch (l) {
763
- Me(l, this.#f && this.#f.parent);
764
- } finally {
765
- O(f);
766
- }
767
- r && _e(() => {
768
- this.#i = this.#_(() => {
769
- this.#d = !0;
770
- try {
771
- return Y(() => {
772
- r(
773
- this.#e,
774
- () => t,
775
- () => a
776
- );
777
- });
778
- } catch (l) {
779
- return Me(
780
- l,
781
- /** @type {Effect} */
782
- this.#f.parent
783
- ), null;
784
- } finally {
785
- this.#d = !1;
786
- }
787
- });
788
- });
789
- }
790
- }
791
- function Qr(e, t, n) {
792
- const r = Ke() ? mt : Yt;
793
- if (t.length === 0) {
794
- n(e.map(r));
795
- return;
796
- }
797
- var s = b, i = (
798
- /** @type {Effect} */
799
- m
800
- ), a = es(), f = v;
801
- Promise.all(t.map((l) => /* @__PURE__ */ ts(l))).then((l) => {
802
- a();
803
- try {
804
- n([...e.map(r), ...l]);
805
- } catch (u) {
806
- (i.f & fe) === 0 && Me(u, i);
807
- }
808
- f && B(!1), s?.deactivate(), Ct();
809
- }).catch((l) => {
810
- Me(l, i);
811
- });
812
- }
813
- function es() {
814
- var e = m, t = y, n = A, r = b, s = v;
815
- if (s)
816
- var i = w;
817
- return function() {
818
- K(e), O(t), Pe(n), r?.activate(), s && (B(!0), C(i));
819
- };
820
- }
821
- function Ct() {
822
- K(null), O(null), Pe(null);
823
- }
824
- // @__NO_SIDE_EFFECTS__
825
- function mt(e) {
826
- var t = F | U, n = y !== null && (y.f & F) !== 0 ? (
827
- /** @type {Derived} */
828
- y
829
- ) : null;
830
- return m === null || n !== null && (n.f & W) !== 0 ? t |= W : m.f |= Te, {
831
- ctx: A,
832
- deps: null,
833
- effects: null,
834
- equals: yn,
835
- f: t,
836
- fn: e,
837
- reactions: null,
838
- rv: 0,
839
- v: (
840
- /** @type {V} */
841
- N
842
- ),
843
- wv: 0,
844
- parent: n ?? m,
845
- ac: null
846
- };
847
- }
848
- // @__NO_SIDE_EFFECTS__
849
- function ts(e, t) {
850
- let n = (
851
- /** @type {Effect | null} */
852
- m
853
- );
854
- n === null && Ar();
855
- var r = (
856
- /** @type {Boundary} */
857
- n.b
858
- ), s = (
859
- /** @type {Promise<V>} */
860
- /** @type {unknown} */
861
- void 0
862
- ), i = Ee(
863
- /** @type {V} */
864
- N
865
- ), a = !y, f = /* @__PURE__ */ new Map();
866
- return fs(() => {
867
- var l = vn();
868
- s = l.promise;
869
- try {
870
- Promise.resolve(e()).then(l.resolve, l.reject).then(() => {
871
- u === b && u.committed && u.deactivate(), Ct();
872
- });
873
- } catch (h) {
874
- l.reject(h), Ct();
875
- }
876
- var u = (
877
- /** @type {Batch} */
878
- b
879
- );
880
- if (a) {
881
- var c = !r.is_pending();
882
- r.update_pending_count(1), u.increment(c), f.get(u)?.reject(xe), f.delete(u), f.set(u, l);
883
- }
884
- const _ = (h, d = void 0) => {
885
- if (u.activate(), d)
886
- d !== xe && (i.f |= we, Le(i, d));
887
- else {
888
- (i.f & we) !== 0 && (i.f ^= we), Le(i, h);
889
- for (const [o, g] of f) {
890
- if (f.delete(o), o === u) break;
891
- g.reject(xe);
892
- }
893
- }
894
- a && (r.update_pending_count(-1), u.decrement(c));
895
- };
896
- l.promise.then(_, (h) => _(null, h || "unknown"));
897
- }), yt(() => {
898
- for (const l of f.values())
899
- l.reject(xe);
900
- }), new Promise((l) => {
901
- function u(c) {
902
- function _() {
903
- c === s ? l(i) : u(s);
904
- }
905
- c.then(_, _);
906
- }
907
- u(s);
908
- });
909
- }
910
- // @__NO_SIDE_EFFECTS__
911
- function Vs(e) {
912
- const t = /* @__PURE__ */ mt(e);
913
- return Kn(t), t;
914
- }
915
- // @__NO_SIDE_EFFECTS__
916
- function Yt(e) {
917
- const t = /* @__PURE__ */ mt(e);
918
- return t.equals = wn, t;
919
- }
920
- function Nn(e) {
921
- var t = e.effects;
922
- if (t !== null) {
923
- e.effects = null;
924
- for (var n = 0; n < t.length; n += 1)
925
- L(
926
- /** @type {Effect} */
927
- t[n]
928
- );
929
- }
930
- }
931
- function ns(e) {
932
- for (var t = e.parent; t !== null; ) {
933
- if ((t.f & F) === 0)
934
- return (
935
- /** @type {Effect} */
936
- t
937
- );
938
- t = t.parent;
939
- }
940
- return null;
941
- }
942
- function Wt(e) {
943
- var t, n = m;
944
- K(ns(e));
945
- try {
946
- Nn(e), t = Zn(e);
947
- } finally {
948
- K(n);
949
- }
950
- return t;
951
- }
952
- function On(e) {
953
- var t = Wt(e);
954
- if (e.equals(t) || (e.v = t, e.wv = Jn()), !ke)
955
- if (z !== null)
956
- z.set(e, e.v);
957
- else {
958
- var n = (ce || (e.f & W) !== 0) && e.deps !== null ? pe : P;
959
- D(e, n);
960
- }
961
- }
962
- const de = /* @__PURE__ */ new Map();
963
- function Ee(e, t) {
964
- var n = {
965
- f: 0,
966
- // TODO ideally we could skip this altogether, but it causes type errors
967
- v: e,
968
- reactions: null,
969
- equals: yn,
970
- rv: 0,
971
- wv: 0
972
- };
973
- return n;
974
- }
975
- // @__NO_SIDE_EFFECTS__
976
- function oe(e, t) {
977
- const n = Ee(e);
978
- return Kn(n), n;
979
- }
980
- // @__NO_SIDE_EFFECTS__
981
- function Cn(e, t = !1, n = !0) {
982
- const r = Ee(e);
983
- return t || (r.equals = wn), Ge && n && A !== null && A.l !== null && (A.l.s ??= []).push(r), r;
984
- }
985
- function ee(e, t, n = !1) {
986
- y !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
987
- // to ensure we error if state is set inside an inspect effect
988
- (!J || (y.f & Qt) !== 0) && Ke() && (y.f & (F | Se | Vt | Qt)) !== 0 && !le?.includes(e) && Lr();
989
- let r = n ? Ne(t) : t;
990
- return Le(e, r);
991
- }
992
- function Le(e, t) {
993
- if (!e.equals(t)) {
994
- var n = e.v;
995
- ke ? de.set(e, t) : de.set(e, n), e.v = t;
996
- var r = ne.ensure();
997
- r.capture(e, n), (e.f & F) !== 0 && ((e.f & U) !== 0 && Wt(
998
- /** @type {Derived} */
999
- e
1000
- ), D(e, (e.f & W) === 0 ? P : pe)), e.wv = Jn(), Rn(e, U), Ke() && m !== null && (m.f & P) !== 0 && (m.f & (ue | ve)) === 0 && (V === null ? os([e]) : V.push(e));
1001
- }
1002
- return t;
1003
- }
1004
- function Ys(e, t = 1) {
1005
- var n = M(e), r = t === 1 ? n++ : n--;
1006
- return ee(e, n), r;
1007
- }
1008
- function Ve(e) {
1009
- ee(e, e.v + 1);
1010
- }
1011
- function Rn(e, t) {
1012
- var n = e.reactions;
1013
- if (n !== null)
1014
- for (var r = Ke(), s = n.length, i = 0; i < s; i++) {
1015
- var a = n[i], f = a.f;
1016
- if (!(!r && a === m)) {
1017
- var l = (f & U) === 0;
1018
- l && D(a, t), (f & F) !== 0 ? Rn(
1019
- /** @type {Derived} */
1020
- a,
1021
- pe
1022
- ) : l && ((f & Se) !== 0 && ae !== null && ae.add(
1023
- /** @type {Effect} */
1024
- a
1025
- ), be(
1026
- /** @type {Effect} */
1027
- a
1028
- ));
1029
- }
1030
- }
1031
- }
1032
- function Ne(e) {
1033
- if (typeof e != "object" || e === null || he in e)
1034
- return e;
1035
- const t = Bt(e);
1036
- if (t !== $r && t !== br)
1037
- return e;
1038
- var n = /* @__PURE__ */ new Map(), r = ut(e), s = /* @__PURE__ */ oe(0), i = $e, a = (f) => {
1039
- if ($e === i)
1040
- return f();
1041
- var l = y, u = $e;
1042
- O(null), fn(i);
1043
- var c = f();
1044
- return O(l), fn(u), c;
1045
- };
1046
- return r && n.set("length", /* @__PURE__ */ oe(
1047
- /** @type {any[]} */
1048
- e.length
1049
- )), new Proxy(
1050
- /** @type {any} */
1051
- e,
1052
- {
1053
- defineProperty(f, l, u) {
1054
- (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Pr();
1055
- var c = n.get(l);
1056
- return c === void 0 ? c = a(() => {
1057
- var _ = /* @__PURE__ */ oe(u.value);
1058
- return n.set(l, _), _;
1059
- }) : ee(c, u.value, !0), !0;
1060
- },
1061
- deleteProperty(f, l) {
1062
- var u = n.get(l);
1063
- if (u === void 0) {
1064
- if (l in f) {
1065
- const c = a(() => /* @__PURE__ */ oe(N));
1066
- n.set(l, c), Ve(s);
1067
- }
1068
- } else
1069
- ee(u, N), Ve(s);
1070
- return !0;
1071
- },
1072
- get(f, l, u) {
1073
- if (l === he)
1074
- return e;
1075
- var c = n.get(l), _ = l in f;
1076
- if (c === void 0 && (!_ || ye(f, l)?.writable) && (c = a(() => {
1077
- var d = Ne(_ ? f[l] : N), o = /* @__PURE__ */ oe(d);
1078
- return o;
1079
- }), n.set(l, c)), c !== void 0) {
1080
- var h = M(c);
1081
- return h === N ? void 0 : h;
1082
- }
1083
- return Reflect.get(f, l, u);
1084
- },
1085
- getOwnPropertyDescriptor(f, l) {
1086
- var u = Reflect.getOwnPropertyDescriptor(f, l);
1087
- if (u && "value" in u) {
1088
- var c = n.get(l);
1089
- c && (u.value = M(c));
1090
- } else if (u === void 0) {
1091
- var _ = n.get(l), h = _?.v;
1092
- if (_ !== void 0 && h !== N)
1093
- return {
1094
- enumerable: !0,
1095
- configurable: !0,
1096
- value: h,
1097
- writable: !0
1098
- };
1099
- }
1100
- return u;
1101
- },
1102
- has(f, l) {
1103
- if (l === he)
1104
- return !0;
1105
- var u = n.get(l), c = u !== void 0 && u.v !== N || Reflect.has(f, l);
1106
- if (u !== void 0 || m !== null && (!c || ye(f, l)?.writable)) {
1107
- u === void 0 && (u = a(() => {
1108
- var h = c ? Ne(f[l]) : N, d = /* @__PURE__ */ oe(h);
1109
- return d;
1110
- }), n.set(l, u));
1111
- var _ = M(u);
1112
- if (_ === N)
1113
- return !1;
1114
- }
1115
- return c;
1116
- },
1117
- set(f, l, u, c) {
1118
- var _ = n.get(l), h = l in f;
1119
- if (r && l === "length")
1120
- for (var d = u; d < /** @type {Source<number>} */
1121
- _.v; d += 1) {
1122
- var o = n.get(d + "");
1123
- o !== void 0 ? ee(o, N) : d in f && (o = a(() => /* @__PURE__ */ oe(N)), n.set(d + "", o));
1124
- }
1125
- if (_ === void 0)
1126
- (!h || ye(f, l)?.writable) && (_ = a(() => /* @__PURE__ */ oe(void 0)), ee(_, Ne(u)), n.set(l, _));
1127
- else {
1128
- h = _.v !== N;
1129
- var g = a(() => Ne(u));
1130
- ee(_, g);
1131
- }
1132
- var $ = Reflect.getOwnPropertyDescriptor(f, l);
1133
- if ($?.set && $.set.call(c, u), !h) {
1134
- if (r && typeof l == "string") {
1135
- var E = (
1136
- /** @type {Source<number>} */
1137
- n.get("length")
1138
- ), k = Number(l);
1139
- Number.isInteger(k) && k >= E.v && ee(E, k + 1);
1140
- }
1141
- Ve(s);
1142
- }
1143
- return !0;
1144
- },
1145
- ownKeys(f) {
1146
- M(s);
1147
- var l = Reflect.ownKeys(f).filter((_) => {
1148
- var h = n.get(_);
1149
- return h === void 0 || h.v !== N;
1150
- });
1151
- for (var [u, c] of n)
1152
- c.v !== N && !(u in f) && l.push(u);
1153
- return l;
1154
- },
1155
- setPrototypeOf() {
1156
- Mr();
1157
- }
1158
- }
1159
- );
1160
- }
1161
- function tn(e) {
1162
- try {
1163
- if (e !== null && typeof e == "object" && he in e)
1164
- return e[he];
1165
- } catch {
1166
- }
1167
- return e;
1168
- }
1169
- function In(e, t) {
1170
- return Object.is(tn(e), tn(t));
1171
- }
1172
- var nn, Pn, Mn, Ln;
1173
- function Rt() {
1174
- if (nn === void 0) {
1175
- nn = window, Pn = /Firefox/.test(navigator.userAgent);
1176
- var e = Element.prototype, t = Node.prototype, n = Text.prototype;
1177
- Mn = ye(t, "firstChild").get, Ln = ye(t, "nextSibling").get, Zt(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), Zt(n) && (n.__t = void 0);
1178
- }
1179
- }
1180
- function G(e = "") {
1181
- return document.createTextNode(e);
1182
- }
1183
- // @__NO_SIDE_EFFECTS__
1184
- function se(e) {
1185
- return Mn.call(e);
1186
- }
1187
- // @__NO_SIDE_EFFECTS__
1188
- function ie(e) {
1189
- return Ln.call(e);
1190
- }
1191
- function Ws(e, t) {
1192
- if (!v)
1193
- return /* @__PURE__ */ se(e);
1194
- var n = (
1195
- /** @type {TemplateNode} */
1196
- /* @__PURE__ */ se(w)
1197
- );
1198
- if (n === null)
1199
- n = w.appendChild(G());
1200
- else if (t && n.nodeType !== dt) {
1201
- var r = G();
1202
- return n?.before(r), C(r), r;
1203
- }
1204
- return C(n), n;
1205
- }
1206
- function Gs(e, t = !1) {
1207
- if (!v) {
1208
- var n = (
1209
- /** @type {DocumentFragment} */
1210
- /* @__PURE__ */ se(
1211
- /** @type {Node} */
1212
- e
1213
- )
1214
- );
1215
- return n instanceof Comment && n.data === "" ? /* @__PURE__ */ ie(n) : n;
1216
- }
1217
- if (t && w?.nodeType !== dt) {
1218
- var r = G();
1219
- return w?.before(r), C(r), r;
1220
- }
1221
- return w;
1222
- }
1223
- function Ks(e, t = 1, n = !1) {
1224
- let r = v ? w : e;
1225
- for (var s; t--; )
1226
- s = r, r = /** @type {TemplateNode} */
1227
- /* @__PURE__ */ ie(r);
1228
- if (!v)
1229
- return r;
1230
- if (n && r?.nodeType !== dt) {
1231
- var i = G();
1232
- return r === null ? s?.after(i) : r.before(i), C(i), i;
1233
- }
1234
- return C(r), /** @type {TemplateNode} */
1235
- r;
1236
- }
1237
- function Gt(e) {
1238
- e.textContent = "";
1239
- }
1240
- function Dn() {
1241
- return !1;
1242
- }
1243
- function zs(e) {
1244
- v && /* @__PURE__ */ se(e) !== null && Gt(e);
1245
- }
1246
- let rn = !1;
1247
- function Fn() {
1248
- rn || (rn = !0, document.addEventListener(
1249
- "reset",
1250
- (e) => {
1251
- Promise.resolve().then(() => {
1252
- if (!e.defaultPrevented)
1253
- for (
1254
- const t of
1255
- /**@type {HTMLFormElement} */
1256
- e.target.elements
1257
- )
1258
- t.__on_r?.();
1259
- });
1260
- },
1261
- // In the capture phase to guarantee we get noticed of it (no possiblity of stopPropagation)
1262
- { capture: !0 }
1263
- ));
1264
- }
1265
- function gt(e) {
1266
- var t = y, n = m;
1267
- O(null), K(null);
1268
- try {
1269
- return e();
1270
- } finally {
1271
- O(t), K(n);
1272
- }
1273
- }
1274
- function ze(e, t, n, r = n) {
1275
- e.addEventListener(t, () => gt(n));
1276
- const s = e.__on_r;
1277
- s ? e.__on_r = () => {
1278
- s(), r(!0);
1279
- } : e.__on_r = () => r(!0), Fn();
1280
- }
1281
- function jn(e) {
1282
- m === null && y === null && Or(), y !== null && (y.f & W) !== 0 && m === null && Nr(), ke && xr();
1283
- }
1284
- function rs(e, t) {
1285
- var n = t.last;
1286
- n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e);
1287
- }
1288
- function X(e, t, n, r = !0) {
1289
- var s = m;
1290
- s !== null && (s.f & H) !== 0 && (e |= H);
1291
- var i = {
1292
- ctx: A,
1293
- deps: null,
1294
- nodes_start: null,
1295
- nodes_end: null,
1296
- f: e | U,
1297
- first: null,
1298
- fn: t,
1299
- last: null,
1300
- next: null,
1301
- parent: s,
1302
- b: s && s.b,
1303
- prev: null,
1304
- teardown: null,
1305
- transitions: null,
1306
- wv: 0,
1307
- ac: null
1308
- };
1309
- if (n)
1310
- try {
1311
- it(i), i.f |= Ut;
1312
- } catch (l) {
1313
- throw L(i), l;
1314
- }
1315
- else t !== null && be(i);
1316
- if (r) {
1317
- var a = i;
1318
- if (n && a.deps === null && a.teardown === null && a.nodes_start === null && a.first === a.last && // either `null`, or a singular child
1319
- (a.f & Te) === 0 && (a = a.first), a !== null && (a.parent = s, s !== null && rs(a, s), y !== null && (y.f & F) !== 0 && (e & ve) === 0)) {
1320
- var f = (
1321
- /** @type {Derived} */
1322
- y
1323
- );
1324
- (f.effects ??= []).push(a);
1325
- }
1326
- }
1327
- return i;
1328
- }
1329
- function ss() {
1330
- return y !== null && !J;
1331
- }
1332
- function yt(e) {
1333
- const t = X(ot, null, !1);
1334
- return D(t, P), t.teardown = e, t;
1335
- }
1336
- function Js(e) {
1337
- jn();
1338
- var t = (
1339
- /** @type {Effect} */
1340
- m.f
1341
- ), n = !y && (t & ue) !== 0 && (t & Ut) === 0;
1342
- if (n) {
1343
- var r = (
1344
- /** @type {ComponentContext} */
1345
- A
1346
- );
1347
- (r.e ??= []).push(e);
1348
- } else
1349
- return qn(e);
1350
- }
1351
- function qn(e) {
1352
- return X(Ht | pn, e, !1);
1353
- }
1354
- function Xs(e) {
1355
- return jn(), X(ot | pn, e, !0);
1356
- }
1357
- function is(e) {
1358
- ne.ensure();
1359
- const t = X(ve | Te, e, !0);
1360
- return () => {
1361
- L(t);
1362
- };
1363
- }
1364
- function as(e) {
1365
- ne.ensure();
1366
- const t = X(ve | Te, e, !0);
1367
- return (n = {}) => new Promise((r) => {
1368
- n.outro ? Oe(t, () => {
1369
- L(t), r(void 0);
1370
- }) : (L(t), r(void 0));
1371
- });
1372
- }
1373
- function Bn(e) {
1374
- return X(Ht, e, !1);
1375
- }
1376
- function fs(e) {
1377
- return X(Vt | Te, e, !0);
1378
- }
1379
- function Fe(e, t = 0) {
1380
- return X(ot | t, e, !0);
1381
- }
1382
- function Zs(e, t = [], n = []) {
1383
- Qr(t, n, (r) => {
1384
- X(ot, () => e(...r.map(M)), !0);
1385
- });
1386
- }
1387
- function Kt(e, t = 0) {
1388
- var n = X(Se | t, e, !0);
1389
- return n;
1390
- }
1391
- function Y(e, t = !0) {
1392
- return X(ue | Te, e, !0, t);
1393
- }
1394
- function Hn(e) {
1395
- var t = e.teardown;
1396
- if (t !== null) {
1397
- const n = ke, r = y;
1398
- an(!0), O(null);
1399
- try {
1400
- t.call(null);
1401
- } finally {
1402
- an(n), O(r);
1403
- }
1404
- }
1405
- }
1406
- function Un(e, t = !1) {
1407
- var n = e.first;
1408
- for (e.first = e.last = null; n !== null; ) {
1409
- const s = n.ac;
1410
- s !== null && gt(() => {
1411
- s.abort(xe);
1412
- });
1413
- var r = n.next;
1414
- (n.f & ve) !== 0 ? n.parent = null : L(n, t), n = r;
1415
- }
1416
- }
1417
- function ls(e) {
1418
- for (var t = e.first; t !== null; ) {
1419
- var n = t.next;
1420
- (t.f & ue) === 0 && L(t), t = n;
1421
- }
1422
- }
1423
- function L(e, t = !0) {
1424
- var n = !1;
1425
- (t || (e.f & Sr) !== 0) && e.nodes_start !== null && e.nodes_end !== null && (us(
1426
- e.nodes_start,
1427
- /** @type {TemplateNode} */
1428
- e.nodes_end
1429
- ), n = !0), Un(e, t && !n), st(e, 0), D(e, fe);
1430
- var r = e.transitions;
1431
- if (r !== null)
1432
- for (const i of r)
1433
- i.stop();
1434
- Hn(e);
1435
- var s = e.parent;
1436
- s !== null && s.first !== null && Vn(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes_start = e.nodes_end = e.ac = null;
1437
- }
1438
- function us(e, t) {
1439
- for (; e !== null; ) {
1440
- var n = e === t ? null : (
1441
- /** @type {TemplateNode} */
1442
- /* @__PURE__ */ ie(e)
1443
- );
1444
- e.remove(), e = n;
1445
- }
1446
- }
1447
- function Vn(e) {
1448
- var t = e.parent, n = e.prev, r = e.next;
1449
- n !== null && (n.next = r), r !== null && (r.prev = n), t !== null && (t.first === e && (t.first = r), t.last === e && (t.last = n));
1450
- }
1451
- function Oe(e, t, n = !0) {
1452
- var r = [];
1453
- zt(e, r, !0), Yn(r, () => {
1454
- n && L(e), t && t();
1455
- });
1456
- }
1457
- function Yn(e, t) {
1458
- var n = e.length;
1459
- if (n > 0) {
1460
- var r = () => --n || t();
1461
- for (var s of e)
1462
- s.out(r);
1463
- } else
1464
- t();
1465
- }
1466
- function zt(e, t, n) {
1467
- if ((e.f & H) === 0) {
1468
- if (e.f ^= H, e.transitions !== null)
1469
- for (const a of e.transitions)
1470
- (a.is_global || n) && t.push(a);
1471
- for (var r = e.first; r !== null; ) {
1472
- var s = r.next, i = (r.f & ht) !== 0 || (r.f & ue) !== 0;
1473
- zt(r, t, i ? n : !1), r = s;
1474
- }
1475
- }
1476
- }
1477
- function Jt(e) {
1478
- Wn(e, !0);
1479
- }
1480
- function Wn(e, t) {
1481
- if ((e.f & H) !== 0) {
1482
- e.f ^= H, (e.f & P) === 0 && (D(e, U), be(e));
1483
- for (var n = e.first; n !== null; ) {
1484
- var r = n.next, s = (n.f & ht) !== 0 || (n.f & ue) !== 0;
1485
- Wn(n, s ? t : !1), n = r;
1486
- }
1487
- if (e.transitions !== null)
1488
- for (const i of e.transitions)
1489
- (i.is_global || t) && i.in();
1490
- }
1491
- }
1492
- function Gn(e, t) {
1493
- for (var n = e.nodes_start, r = e.nodes_end; n !== null; ) {
1494
- var s = n === r ? null : (
1495
- /** @type {TemplateNode} */
1496
- /* @__PURE__ */ ie(n)
1497
- );
1498
- t.append(n), n = s;
1499
- }
1500
- }
1501
- let Ce = !1;
1502
- function sn(e) {
1503
- Ce = e;
1504
- }
1505
- let ke = !1;
1506
- function an(e) {
1507
- ke = e;
1508
- }
1509
- let y = null, J = !1;
1510
- function O(e) {
1511
- y = e;
1512
- }
1513
- let m = null;
1514
- function K(e) {
1515
- m = e;
1516
- }
1517
- let le = null;
1518
- function Kn(e) {
1519
- y !== null && (le === null ? le = [e] : le.push(e));
1520
- }
1521
- let I = null, q = 0, V = null;
1522
- function os(e) {
1523
- V = e;
1524
- }
1525
- let zn = 1, We = 0, $e = We;
1526
- function fn(e) {
1527
- $e = e;
1528
- }
1529
- let ce = !1;
1530
- function Jn() {
1531
- return ++zn;
1532
- }
1533
- function wt(e) {
1534
- var t = e.f;
1535
- if ((t & U) !== 0)
1536
- return !0;
1537
- if ((t & pe) !== 0) {
1538
- var n = e.deps, r = (t & W) !== 0;
1539
- if (n !== null) {
1540
- var s, i, a = (t & nt) !== 0, f = r && m !== null && !ce, l = n.length;
1541
- if ((a || f) && (m === null || (m.f & fe) === 0)) {
1542
- var u = (
1543
- /** @type {Derived} */
1544
- e
1545
- ), c = u.parent;
1546
- for (s = 0; s < l; s++)
1547
- i = n[s], (a || !i?.reactions?.includes(u)) && (i.reactions ??= []).push(u);
1548
- a && (u.f ^= nt), f && c !== null && (c.f & W) === 0 && (u.f ^= W);
1549
- }
1550
- for (s = 0; s < l; s++)
1551
- if (i = n[s], wt(
1552
- /** @type {Derived} */
1553
- i
1554
- ) && On(
1555
- /** @type {Derived} */
1556
- i
1557
- ), i.wv > e.wv)
1558
- return !0;
1559
- }
1560
- (!r || m !== null && !ce) && D(e, P);
1561
- }
1562
- return !1;
1563
- }
1564
- function Xn(e, t, n = !0) {
1565
- var r = e.reactions;
1566
- if (r !== null && !le?.includes(e))
1567
- for (var s = 0; s < r.length; s++) {
1568
- var i = r[s];
1569
- (i.f & F) !== 0 ? Xn(
1570
- /** @type {Derived} */
1571
- i,
1572
- t,
1573
- !1
1574
- ) : t === i && (n ? D(i, U) : (i.f & P) !== 0 && D(i, pe), be(
1575
- /** @type {Effect} */
1576
- i
1577
- ));
1578
- }
1579
- }
1580
- function Zn(e) {
1581
- var t = I, n = q, r = V, s = y, i = ce, a = le, f = A, l = J, u = $e, c = e.f;
1582
- I = /** @type {null | Value[]} */
1583
- null, q = 0, V = null, ce = (c & W) !== 0 && (J || !Ce || y === null), y = (c & (ue | ve)) === 0 ? e : null, le = null, Pe(e.ctx), J = !1, $e = ++We, e.ac !== null && (gt(() => {
1584
- e.ac.abort(xe);
1585
- }), e.ac = null);
1586
- try {
1587
- e.f |= xt;
1588
- var _ = (
1589
- /** @type {Function} */
1590
- e.fn
1591
- ), h = _(), d = e.deps;
1592
- if (I !== null) {
1593
- var o;
1594
- if (st(e, q), d !== null && q > 0)
1595
- for (d.length = q + I.length, o = 0; o < I.length; o++)
1596
- d[q + o] = I[o];
1597
- else
1598
- e.deps = d = I;
1599
- if (!ce || // Deriveds that already have reactions can cleanup, so we still add them as reactions
1600
- (c & F) !== 0 && /** @type {import('#client').Derived} */
1601
- e.reactions !== null)
1602
- for (o = q; o < d.length; o++)
1603
- (d[o].reactions ??= []).push(e);
1604
- } else d !== null && q < d.length && (st(e, q), d.length = q);
1605
- if (Ke() && V !== null && !J && d !== null && (e.f & (F | pe | U)) === 0)
1606
- for (o = 0; o < /** @type {Source[]} */
1607
- V.length; o++)
1608
- Xn(
1609
- V[o],
1610
- /** @type {Effect} */
1611
- e
1612
- );
1613
- return s !== null && s !== e && (We++, V !== null && (r === null ? r = V : r.push(.../** @type {Source[]} */
1614
- V))), (e.f & we) !== 0 && (e.f ^= we), h;
1615
- } catch (g) {
1616
- return En(g);
1617
- } finally {
1618
- e.f ^= xt, I = t, q = n, V = r, y = s, ce = i, le = a, Pe(f), J = l, $e = u;
1619
- }
1620
- }
1621
- function cs(e, t) {
1622
- let n = t.reactions;
1623
- if (n !== null) {
1624
- var r = wr.call(n, e);
1625
- if (r !== -1) {
1626
- var s = n.length - 1;
1627
- s === 0 ? n = t.reactions = null : (n[r] = n[s], n.pop());
1628
- }
1629
- }
1630
- n === null && (t.f & F) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1631
- // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
1632
- // allows us to skip the expensive work of disconnecting and immediately reconnecting it
1633
- (I === null || !I.includes(t)) && (D(t, pe), (t.f & (W | nt)) === 0 && (t.f ^= nt), Nn(
1634
- /** @type {Derived} **/
1635
- t
1636
- ), st(
1637
- /** @type {Derived} **/
1638
- t,
1639
- 0
1640
- ));
1641
- }
1642
- function st(e, t) {
1643
- var n = e.deps;
1644
- if (n !== null)
1645
- for (var r = t; r < n.length; r++)
1646
- cs(e, n[r]);
1647
- }
1648
- function it(e) {
1649
- var t = e.f;
1650
- if ((t & fe) === 0) {
1651
- D(e, P);
1652
- var n = m, r = Ce;
1653
- m = e, Ce = !0;
1654
- try {
1655
- (t & Se) !== 0 ? ls(e) : Un(e), Hn(e);
1656
- var s = Zn(e);
1657
- e.teardown = typeof s == "function" ? s : null, e.wv = zn;
1658
- var i;
1659
- dn && Hr && (e.f & U) !== 0 && e.deps;
1660
- } finally {
1661
- Ce = r, m = n;
1662
- }
1663
- }
1664
- }
1665
- async function hs() {
1666
- await Promise.resolve(), Tn();
1667
- }
1668
- function M(e) {
1669
- var t = e.f, n = (t & F) !== 0;
1670
- if (y !== null && !J) {
1671
- var r = m !== null && (m.f & fe) !== 0;
1672
- if (!r && !le?.includes(e)) {
1673
- var s = y.deps;
1674
- if ((y.f & xt) !== 0)
1675
- e.rv < We && (e.rv = We, I === null && s !== null && s[q] === e ? q++ : I === null ? I = [e] : (!ce || !I.includes(e)) && I.push(e));
1676
- else {
1677
- (y.deps ??= []).push(e);
1678
- var i = e.reactions;
1679
- i === null ? e.reactions = [y] : i.includes(y) || i.push(y);
1680
- }
1681
- }
1682
- } else if (n && /** @type {Derived} */
1683
- e.deps === null && /** @type {Derived} */
1684
- e.effects === null) {
1685
- var a = (
1686
- /** @type {Derived} */
1687
- e
1688
- ), f = a.parent;
1689
- f !== null && (f.f & W) === 0 && (a.f ^= W);
1690
- }
1691
- if (ke) {
1692
- if (de.has(e))
1693
- return de.get(e);
1694
- if (n) {
1695
- a = /** @type {Derived} */
1696
- e;
1697
- var l = a.v;
1698
- return ((a.f & P) === 0 && a.reactions !== null || Qn(a)) && (l = Wt(a)), de.set(a, l), l;
1699
- }
1700
- } else if (n) {
1701
- if (a = /** @type {Derived} */
1702
- e, z?.has(a))
1703
- return z.get(a);
1704
- wt(a) && On(a);
1705
- }
1706
- if (z?.has(e))
1707
- return z.get(e);
1708
- if ((e.f & we) !== 0)
1709
- throw e.v;
1710
- return e.v;
1711
- }
1712
- function Qn(e) {
1713
- if (e.v === N) return !0;
1714
- if (e.deps === null) return !1;
1715
- for (const t of e.deps)
1716
- if (de.has(t) || (t.f & F) !== 0 && Qn(
1717
- /** @type {Derived} */
1718
- t
1719
- ))
1720
- return !0;
1721
- return !1;
1722
- }
1723
- function $t(e) {
1724
- var t = J;
1725
- try {
1726
- return J = !0, e();
1727
- } finally {
1728
- J = t;
1729
- }
1730
- }
1731
- const ds = -7169;
1732
- function D(e, t) {
1733
- e.f = e.f & ds | t;
1734
- }
1735
- function Qs(e) {
1736
- if (!(typeof e != "object" || !e || e instanceof EventTarget)) {
1737
- if (he in e)
1738
- It(e);
1739
- else if (!Array.isArray(e))
1740
- for (let t in e) {
1741
- const n = e[t];
1742
- typeof n == "object" && n && he in n && It(n);
1743
- }
1744
- }
1745
- }
1746
- function It(e, t = /* @__PURE__ */ new Set()) {
1747
- if (typeof e == "object" && e !== null && // We don't want to traverse DOM elements
1748
- !(e instanceof EventTarget) && !t.has(e)) {
1749
- t.add(e), e instanceof Date && e.getTime();
1750
- for (let r in e)
1751
- try {
1752
- It(e[r], t);
1753
- } catch {
1754
- }
1755
- const n = Bt(e);
1756
- if (n !== Object.prototype && n !== Array.prototype && n !== Map.prototype && n !== Set.prototype && n !== Date.prototype) {
1757
- const r = _n(n);
1758
- for (let s in r) {
1759
- const i = r[s].get;
1760
- if (i)
1761
- try {
1762
- i.call(e);
1763
- } catch {
1764
- }
1765
- }
1766
- }
1767
- }
1768
- }
1769
- const er = /* @__PURE__ */ new Set(), Pt = /* @__PURE__ */ new Set();
1770
- function ei(e) {
1771
- if (!v) return;
1772
- e.removeAttribute("onload"), e.removeAttribute("onerror");
1773
- const t = e.__e;
1774
- t !== void 0 && (e.__e = void 0, queueMicrotask(() => {
1775
- e.isConnected && e.dispatchEvent(t);
1776
- }));
1777
- }
1778
- function _s(e, t, n, r = {}) {
1779
- function s(i) {
1780
- if (r.capture || Be.call(t, i), !i.cancelBubble)
1781
- return gt(() => n?.call(this, i));
1782
- }
1783
- return e.startsWith("pointer") || e.startsWith("touch") || e === "wheel" ? _e(() => {
1784
- t.addEventListener(e, s, r);
1785
- }) : t.addEventListener(e, s, r), s;
1786
- }
1787
- function ti(e, t, n, r, s) {
1788
- var i = { capture: r, passive: s }, a = _s(e, t, n, i);
1789
- (t === document.body || // @ts-ignore
1790
- t === window || // @ts-ignore
1791
- t === document || // Firefox has quirky behavior, it can happen that we still get "canplay" events when the element is already removed
1792
- t instanceof HTMLMediaElement) && yt(() => {
1793
- t.removeEventListener(e, a, i);
1794
- });
1795
- }
1796
- function ni(e) {
1797
- for (var t = 0; t < e.length; t++)
1798
- er.add(e[t]);
1799
- for (var n of Pt)
1800
- n(e);
1801
- }
1802
- let ln = null;
1803
- function Be(e) {
1804
- var t = this, n = (
1805
- /** @type {Node} */
1806
- t.ownerDocument
1807
- ), r = e.type, s = e.composedPath?.() || [], i = (
1808
- /** @type {null | Element} */
1809
- s[0] || e.target
1810
- );
1811
- ln = e;
1812
- var a = 0, f = ln === e && e.__root;
1813
- if (f) {
1814
- var l = s.indexOf(f);
1815
- if (l !== -1 && (t === document || t === /** @type {any} */
1816
- window)) {
1817
- e.__root = t;
1818
- return;
1819
- }
1820
- var u = s.indexOf(t);
1821
- if (u === -1)
1822
- return;
1823
- l <= u && (a = l);
1824
- }
1825
- if (i = /** @type {Element} */
1826
- s[a] || e.target, i !== t) {
1827
- Ie(e, "currentTarget", {
1828
- configurable: !0,
1829
- get() {
1830
- return i || n;
1831
- }
1832
- });
1833
- var c = y, _ = m;
1834
- O(null), K(null);
1835
- try {
1836
- for (var h, d = []; i !== null; ) {
1837
- var o = i.assignedSlot || i.parentNode || /** @type {any} */
1838
- i.host || null;
1839
- try {
1840
- var g = i["__" + r];
1841
- if (g != null && (!/** @type {any} */
1842
- i.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
1843
- // -> the target could not have been disabled because it emits the event in the first place
1844
- e.target === i))
1845
- if (ut(g)) {
1846
- var [$, ...E] = g;
1847
- $.apply(i, [e, ...E]);
1848
- } else
1849
- g.call(i, e);
1850
- } catch (k) {
1851
- h ? d.push(k) : h = k;
1852
- }
1853
- if (e.cancelBubble || o === t || o === null)
1854
- break;
1855
- i = o;
1856
- }
1857
- if (h) {
1858
- for (let k of d)
1859
- queueMicrotask(() => {
1860
- throw k;
1861
- });
1862
- throw h;
1863
- }
1864
- } finally {
1865
- e.__root = t, delete e.currentTarget, O(c), K(_);
1866
- }
1867
- }
1868
- }
1869
- function tr(e) {
1870
- var t = document.createElement("template");
1871
- return t.innerHTML = e.replaceAll("<!>", "<!---->"), t.content;
1872
- }
1873
- function re(e, t) {
1874
- var n = (
1875
- /** @type {Effect} */
1876
- m
1877
- );
1878
- n.nodes_start === null && (n.nodes_start = e, n.nodes_end = t);
1879
- }
1880
- // @__NO_SIDE_EFFECTS__
1881
- function ri(e, t) {
1882
- var n = (t & mr) !== 0, r = (t & gr) !== 0, s, i = !e.startsWith("<!>");
1883
- return () => {
1884
- if (v)
1885
- return re(w, null), w;
1886
- s === void 0 && (s = tr(i ? e : "<!>" + e), n || (s = /** @type {Node} */
1887
- /* @__PURE__ */ se(s)));
1888
- var a = (
1889
- /** @type {TemplateNode} */
1890
- r || Pn ? document.importNode(s, !0) : s.cloneNode(!0)
1891
- );
1892
- if (n) {
1893
- var f = (
1894
- /** @type {TemplateNode} */
1895
- /* @__PURE__ */ se(a)
1896
- ), l = (
1897
- /** @type {TemplateNode} */
1898
- a.lastChild
1899
- );
1900
- re(f, l);
1901
- } else
1902
- re(a, a);
1903
- return a;
1904
- };
1905
- }
1906
- // @__NO_SIDE_EFFECTS__
1907
- function vs(e, t, n = "svg") {
1908
- var r = !e.startsWith("<!>"), s = `<${n}>${r ? e : "<!>" + e}</${n}>`, i;
1909
- return () => {
1910
- if (v)
1911
- return re(w, null), w;
1912
- if (!i) {
1913
- var a = (
1914
- /** @type {DocumentFragment} */
1915
- tr(s)
1916
- ), f = (
1917
- /** @type {Element} */
1918
- /* @__PURE__ */ se(a)
1919
- );
1920
- i = /** @type {Element} */
1921
- /* @__PURE__ */ se(f);
1922
- }
1923
- var l = (
1924
- /** @type {TemplateNode} */
1925
- i.cloneNode(!0)
1926
- );
1927
- return re(l, l), l;
1928
- };
1929
- }
1930
- // @__NO_SIDE_EFFECTS__
1931
- function si(e, t) {
1932
- return /* @__PURE__ */ vs(e, t, "svg");
1933
- }
1934
- function ii(e = "") {
1935
- if (!v) {
1936
- var t = G(e + "");
1937
- return re(t, t), t;
1938
- }
1939
- var n = w;
1940
- return n.nodeType !== dt && (n.before(n = G()), C(n)), re(n, n), n;
1941
- }
1942
- function ai() {
1943
- if (v)
1944
- return re(w, null), w;
1945
- var e = document.createDocumentFragment(), t = document.createComment(""), n = G();
1946
- return e.append(t, n), re(t, n), e;
1947
- }
1948
- function ps(e, t) {
1949
- if (v) {
1950
- m.nodes_end = w, vt();
1951
- return;
1952
- }
1953
- e !== null && e.before(
1954
- /** @type {Node} */
1955
- t
1956
- );
1957
- }
1958
- const ms = ["touchstart", "touchmove"];
1959
- function gs(e) {
1960
- return ms.includes(e);
1961
- }
1962
- let un = !0;
1963
- function fi(e, t) {
1964
- var n = t == null ? "" : typeof t == "object" ? t + "" : t;
1965
- n !== (e.__t ??= e.nodeValue) && (e.__t = n, e.nodeValue = n + "");
1966
- }
1967
- function nr(e, t) {
1968
- return rr(e, t);
1969
- }
1970
- function ys(e, t) {
1971
- Rt(), t.intro = t.intro ?? !1;
1972
- const n = t.target, r = v, s = w;
1973
- try {
1974
- for (var i = (
1975
- /** @type {TemplateNode} */
1976
- /* @__PURE__ */ se(n)
1977
- ); i && (i.nodeType !== De || /** @type {Comment} */
1978
- i.data !== hn); )
1979
- i = /** @type {TemplateNode} */
1980
- /* @__PURE__ */ ie(i);
1981
- if (!i)
1982
- throw Re;
1983
- B(!0), C(
1984
- /** @type {Comment} */
1985
- i
1986
- );
1987
- const a = rr(e, { ...t, anchor: i });
1988
- return B(!1), /** @type {Exports} */
1989
- a;
1990
- } catch (a) {
1991
- if (a instanceof Error && a.message.split(`
1992
- `).some((f) => f.startsWith("https://svelte.dev/e/")))
1993
- throw a;
1994
- return a !== Re && console.warn("Failed to hydrate: ", a), t.recover === !1 && Rr(), Rt(), Gt(n), B(!1), nr(e, t);
1995
- } finally {
1996
- B(r), C(s);
1997
- }
1998
- }
1999
- const Ae = /* @__PURE__ */ new Map();
2000
- function rr(e, { target: t, anchor: n, props: r = {}, events: s, context: i, intro: a = !0 }) {
2001
- Rt();
2002
- var f = /* @__PURE__ */ new Set(), l = (_) => {
2003
- for (var h = 0; h < _.length; h++) {
2004
- var d = _[h];
2005
- if (!f.has(d)) {
2006
- f.add(d);
2007
- var o = gs(d);
2008
- t.addEventListener(d, Be, { passive: o });
2009
- var g = Ae.get(d);
2010
- g === void 0 ? (document.addEventListener(d, Be, { passive: o }), Ae.set(d, 1)) : Ae.set(d, g + 1);
2011
- }
2012
- }
2013
- };
2014
- l(qt(er)), Pt.add(l);
2015
- var u = void 0, c = as(() => {
2016
- var _ = n ?? t.appendChild(G());
2017
- return Xr(
2018
- /** @type {TemplateNode} */
2019
- _,
2020
- {
2021
- pending: () => {
2022
- }
2023
- },
2024
- (h) => {
2025
- if (i) {
2026
- Ur({});
2027
- var d = (
2028
- /** @type {ComponentContext} */
2029
- A
2030
- );
2031
- d.c = i;
2032
- }
2033
- if (s && (r.$$events = s), v && re(
2034
- /** @type {TemplateNode} */
2035
- h,
2036
- null
2037
- ), un = a, u = e(h, r) || {}, un = !0, v && (m.nodes_end = w, w === null || w.nodeType !== De || /** @type {Comment} */
2038
- w.data !== jt))
2039
- throw _t(), Re;
2040
- i && Vr();
2041
- }
2042
- ), () => {
2043
- for (var h of f) {
2044
- t.removeEventListener(h, Be);
2045
- var d = (
2046
- /** @type {number} */
2047
- Ae.get(h)
2048
- );
2049
- --d === 0 ? (document.removeEventListener(h, Be), Ae.delete(h)) : Ae.set(h, d);
2050
- }
2051
- Pt.delete(l), _ !== n && _.parentNode?.removeChild(_);
2052
- };
2053
- });
2054
- return Mt.set(u, c), u;
2055
- }
2056
- let Mt = /* @__PURE__ */ new WeakMap();
2057
- function ws(e, t) {
2058
- const n = Mt.get(e);
2059
- return n ? (Mt.delete(e), n(t)) : Promise.resolve();
2060
- }
2061
- class $s {
2062
- /** @type {TemplateNode} */
2063
- anchor;
2064
- /** @type {Map<Batch, Key>} */
2065
- #t = /* @__PURE__ */ new Map();
2066
- /** @type {Map<Key, Effect>} */
2067
- #e = /* @__PURE__ */ new Map();
2068
- /** @type {Map<Key, Branch>} */
2069
- #n = /* @__PURE__ */ new Map();
2070
- /**
2071
- * Whether to pause (i.e. outro) on change, or destroy immediately.
2072
- * This is necessary for `<svelte:element>`
2073
- */
2074
- #r = !0;
2075
- /**
2076
- * @param {TemplateNode} anchor
2077
- * @param {boolean} transition
2078
- */
2079
- constructor(t, n = !0) {
2080
- this.anchor = t, this.#r = n;
2081
- }
2082
- #l = () => {
2083
- var t = (
2084
- /** @type {Batch} */
2085
- b
2086
- );
2087
- if (this.#t.has(t)) {
2088
- var n = (
2089
- /** @type {Key} */
2090
- this.#t.get(t)
2091
- ), r = this.#e.get(n);
2092
- if (r)
2093
- Jt(r);
2094
- else {
2095
- var s = this.#n.get(n);
2096
- s && (this.#e.set(n, s.effect), this.#n.delete(n), s.fragment.lastChild.remove(), this.anchor.before(s.fragment), r = s.effect);
2097
- }
2098
- for (const [i, a] of this.#t) {
2099
- if (this.#t.delete(i), i === t)
2100
- break;
2101
- const f = this.#n.get(a);
2102
- f && (L(f.effect), this.#n.delete(a));
2103
- }
2104
- for (const [i, a] of this.#e) {
2105
- if (i === n) continue;
2106
- const f = () => {
2107
- if (Array.from(this.#t.values()).includes(i)) {
2108
- var u = document.createDocumentFragment();
2109
- Gn(a, u), u.append(G()), this.#n.set(i, { effect: a, fragment: u });
2110
- } else
2111
- L(a);
2112
- this.#e.delete(i);
2113
- };
2114
- this.#r || !r ? Oe(a, f, !1) : f();
2115
- }
2116
- }
2117
- };
2118
- /**
2119
- *
2120
- * @param {any} key
2121
- * @param {null | ((target: TemplateNode) => void)} fn
2122
- */
2123
- ensure(t, n) {
2124
- var r = (
2125
- /** @type {Batch} */
2126
- b
2127
- ), s = Dn();
2128
- if (n && !this.#e.has(t) && !this.#n.has(t))
2129
- if (s) {
2130
- var i = document.createDocumentFragment(), a = G();
2131
- i.append(a), this.#n.set(t, {
2132
- effect: Y(() => n(a)),
2133
- fragment: i
2134
- });
2135
- } else
2136
- this.#e.set(
2137
- t,
2138
- Y(() => n(this.anchor))
2139
- );
2140
- if (this.#t.set(r, t), s) {
2141
- for (const [f, l] of this.#e)
2142
- f === t ? r.skipped_effects.delete(l) : r.skipped_effects.add(l);
2143
- for (const [f, l] of this.#n)
2144
- f === t ? r.skipped_effects.delete(l.effect) : r.skipped_effects.add(l.effect);
2145
- r.add_callback(this.#l);
2146
- } else
2147
- v && (this.anchor = w), this.#l();
2148
- }
2149
- }
2150
- function li(e, t, n = !1) {
2151
- v && vt();
2152
- var r = new $s(e), s = n ? ht : 0;
2153
- function i(a, f) {
2154
- if (v) {
2155
- const u = gn(e) === lt;
2156
- if (a === u) {
2157
- var l = rt();
2158
- C(l), r.anchor = l, B(!1), r.ensure(a, f), B(!0);
2159
- return;
2160
- }
2161
- }
2162
- r.ensure(a, f);
2163
- }
2164
- Kt(() => {
2165
- var a = !1;
2166
- t((f, l = !0) => {
2167
- a = !0, i(l, f);
2168
- }), a || i(!1, null);
2169
- }, s);
2170
- }
2171
- function ui(e, t) {
2172
- return t;
2173
- }
2174
- function bs(e, t, n) {
2175
- for (var r = e.items, s = [], i = t.length, a = 0; a < i; a++)
2176
- zt(t[a].e, s, !0);
2177
- var f = i > 0 && s.length === 0 && n !== null;
2178
- if (f) {
2179
- var l = (
2180
- /** @type {Element} */
2181
- /** @type {Element} */
2182
- n.parentNode
2183
- );
2184
- Gt(l), l.append(
2185
- /** @type {Element} */
2186
- n
2187
- ), r.clear(), Q(e, t[0].prev, t[i - 1].next);
2188
- }
2189
- Yn(s, () => {
2190
- for (var u = 0; u < i; u++) {
2191
- var c = t[u];
2192
- f || (r.delete(c.k), Q(e, c.prev, c.next)), L(c.e, !f);
2193
- }
2194
- });
2195
- }
2196
- function oi(e, t, n, r, s, i = null) {
2197
- var a = e, f = { flags: t, items: /* @__PURE__ */ new Map(), first: null }, l = (t & cn) !== 0;
2198
- if (l) {
2199
- var u = (
2200
- /** @type {Element} */
2201
- e
2202
- );
2203
- a = v ? C(
2204
- /** @type {Comment | Text} */
2205
- /* @__PURE__ */ se(u)
2206
- ) : u.appendChild(G());
2207
- }
2208
- v && vt();
2209
- var c = null, _ = !1, h = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ Yt(() => {
2210
- var E = n();
2211
- return ut(E) ? E : E == null ? [] : qt(E);
2212
- }), o, g;
2213
- function $() {
2214
- Es(
2215
- g,
2216
- o,
2217
- f,
2218
- h,
2219
- a,
2220
- s,
2221
- t,
2222
- r,
2223
- n
2224
- ), i !== null && (o.length === 0 ? c ? Jt(c) : c = Y(() => i(a)) : c !== null && Oe(c, () => {
2225
- c = null;
2226
- }));
2227
- }
2228
- Kt(() => {
2229
- g ??= /** @type {Effect} */
2230
- m, o = /** @type {V[]} */
2231
- M(d);
2232
- var E = o.length;
2233
- if (_ && E === 0)
2234
- return;
2235
- _ = E === 0;
2236
- let k = !1;
2237
- if (v) {
2238
- var T = gn(a) === lt;
2239
- T !== (E === 0) && (a = rt(), C(a), B(!1), k = !0);
2240
- }
2241
- if (v) {
2242
- for (var j = null, x, p = 0; p < E; p++) {
2243
- if (w.nodeType === De && /** @type {Comment} */
2244
- w.data === jt) {
2245
- a = /** @type {Comment} */
2246
- w, k = !0, B(!1);
2247
- break;
2248
- }
2249
- var S = o[p], R = r(S, p);
2250
- x = Lt(
2251
- w,
2252
- f,
2253
- j,
2254
- null,
2255
- S,
2256
- R,
2257
- p,
2258
- s,
2259
- t,
2260
- n
2261
- ), f.items.set(R, x), j = x;
2262
- }
2263
- E > 0 && C(rt());
2264
- }
2265
- if (v)
2266
- E === 0 && i && (c = Y(() => i(a)));
2267
- else if (Dn()) {
2268
- var je = /* @__PURE__ */ new Set(), Je = (
2269
- /** @type {Batch} */
2270
- b
2271
- );
2272
- for (p = 0; p < E; p += 1) {
2273
- S = o[p], R = r(S, p);
2274
- var me = f.items.get(R) ?? h.get(R);
2275
- me ? (t & (at | ft)) !== 0 && sr(me, S, p, t) : (x = Lt(
2276
- null,
2277
- f,
2278
- null,
2279
- null,
2280
- S,
2281
- R,
2282
- p,
2283
- s,
2284
- t,
2285
- n,
2286
- !0
2287
- ), h.set(R, x)), je.add(R);
2288
- }
2289
- for (const [Z, Xe] of f.items)
2290
- je.has(Z) || Je.skipped_effects.add(Xe.e);
2291
- Je.add_callback($);
2292
- } else
2293
- $();
2294
- k && B(!0), M(d);
2295
- }), v && (a = w);
2296
- }
2297
- function Es(e, t, n, r, s, i, a, f, l) {
2298
- var u = (a & or) !== 0, c = (a & (at | ft)) !== 0, _ = t.length, h = n.items, d = n.first, o = d, g, $ = null, E, k = [], T = [], j, x, p, S;
2299
- if (u)
2300
- for (S = 0; S < _; S += 1)
2301
- j = t[S], x = f(j, S), p = h.get(x), p !== void 0 && (p.a?.measure(), (E ??= /* @__PURE__ */ new Set()).add(p));
2302
- for (S = 0; S < _; S += 1) {
2303
- if (j = t[S], x = f(j, S), p = h.get(x), p === void 0) {
2304
- var R = r.get(x);
2305
- if (R !== void 0) {
2306
- r.delete(x), h.set(x, R);
2307
- var je = $ ? $.next : o;
2308
- Q(n, $, R), Q(n, R, je), St(R, je, s), $ = R;
2309
- } else {
2310
- var Je = o ? (
2311
- /** @type {TemplateNode} */
2312
- o.e.nodes_start
2313
- ) : s;
2314
- $ = Lt(
2315
- Je,
2316
- n,
2317
- $,
2318
- $ === null ? n.first : $.next,
2319
- j,
2320
- x,
2321
- S,
2322
- i,
2323
- a,
2324
- l
2325
- );
2326
- }
2327
- h.set(x, $), k = [], T = [], o = $.next;
2328
- continue;
2329
- }
2330
- if (c && sr(p, j, S, a), (p.e.f & H) !== 0 && (Jt(p.e), u && (p.a?.unfix(), (E ??= /* @__PURE__ */ new Set()).delete(p))), p !== o) {
2331
- if (g !== void 0 && g.has(p)) {
2332
- if (k.length < T.length) {
2333
- var me = T[0], Z;
2334
- $ = me.prev;
2335
- var Xe = k[0], bt = k[k.length - 1];
2336
- for (Z = 0; Z < k.length; Z += 1)
2337
- St(k[Z], me, s);
2338
- for (Z = 0; Z < T.length; Z += 1)
2339
- g.delete(T[Z]);
2340
- Q(n, Xe.prev, bt.next), Q(n, $, Xe), Q(n, bt, me), o = me, $ = bt, S -= 1, k = [], T = [];
2341
- } else
2342
- g.delete(p), St(p, o, s), Q(n, p.prev, p.next), Q(n, p, $ === null ? n.first : $.next), Q(n, $, p), $ = p;
2343
- continue;
2344
- }
2345
- for (k = [], T = []; o !== null && o.k !== x; )
2346
- (o.e.f & H) === 0 && (g ??= /* @__PURE__ */ new Set()).add(o), T.push(o), o = o.next;
2347
- if (o === null)
2348
- continue;
2349
- p = o;
2350
- }
2351
- k.push(p), $ = p, o = p.next;
2352
- }
2353
- if (o !== null || g !== void 0) {
2354
- for (var qe = g === void 0 ? [] : qt(g); o !== null; )
2355
- (o.e.f & H) === 0 && qe.push(o), o = o.next;
2356
- var Et = qe.length;
2357
- if (Et > 0) {
2358
- var lr = (a & cn) !== 0 && _ === 0 ? s : null;
2359
- if (u) {
2360
- for (S = 0; S < Et; S += 1)
2361
- qe[S].a?.measure();
2362
- for (S = 0; S < Et; S += 1)
2363
- qe[S].a?.fix();
2364
- }
2365
- bs(n, qe, lr);
2366
- }
2367
- }
2368
- u && _e(() => {
2369
- if (E !== void 0)
2370
- for (p of E)
2371
- p.a?.apply();
2372
- }), e.first = n.first && n.first.e, e.last = $ && $.e;
2373
- for (var ur of r.values())
2374
- L(ur.e);
2375
- r.clear();
2376
- }
2377
- function sr(e, t, n, r) {
2378
- (r & at) !== 0 && Le(e.v, t), (r & ft) !== 0 ? Le(
2379
- /** @type {Value<number>} */
2380
- e.i,
2381
- n
2382
- ) : e.i = n;
2383
- }
2384
- function Lt(e, t, n, r, s, i, a, f, l, u, c) {
2385
- var _ = (l & at) !== 0, h = (l & cr) === 0, d = _ ? h ? /* @__PURE__ */ Cn(s, !1, !1) : Ee(s) : s, o = (l & ft) === 0 ? a : Ee(a), g = {
2386
- i: o,
2387
- v: d,
2388
- k: i,
2389
- a: null,
2390
- // @ts-expect-error
2391
- e: null,
2392
- prev: n,
2393
- next: r
2394
- };
2395
- try {
2396
- if (e === null) {
2397
- var $ = document.createDocumentFragment();
2398
- $.append(e = G());
2399
- }
2400
- return g.e = Y(() => f(
2401
- /** @type {Node} */
2402
- e,
2403
- d,
2404
- o,
2405
- u
2406
- ), v), g.e.prev = n && n.e, g.e.next = r && r.e, n === null ? c || (t.first = g) : (n.next = g, n.e.next = g.e), r !== null && (r.prev = g, r.e.prev = g.e), g;
2407
- } finally {
2408
- }
2409
- }
2410
- function St(e, t, n) {
2411
- for (var r = e.next ? (
2412
- /** @type {TemplateNode} */
2413
- e.next.e.nodes_start
2414
- ) : n, s = t ? (
2415
- /** @type {TemplateNode} */
2416
- t.e.nodes_start
2417
- ) : n, i = (
2418
- /** @type {TemplateNode} */
2419
- e.e.nodes_start
2420
- ); i !== null && i !== r; ) {
2421
- var a = (
2422
- /** @type {TemplateNode} */
2423
- /* @__PURE__ */ ie(i)
2424
- );
2425
- s.before(i), i = a;
2426
- }
2427
- }
2428
- function Q(e, t, n) {
2429
- t === null ? e.first = n : (t.next = n, t.e.next = n && n.e), n !== null && (n.prev = t, n.e.prev = t && t.e);
2430
- }
2431
- function ci(e, t) {
2432
- Bn(() => {
2433
- var n = e.getRootNode(), r = (
2434
- /** @type {ShadowRoot} */
2435
- n.host ? (
2436
- /** @type {ShadowRoot} */
2437
- n
2438
- ) : (
2439
- /** @type {Document} */
2440
- n.head ?? /** @type {Document} */
2441
- n.ownerDocument.head
2442
- )
2443
- );
2444
- if (!r.querySelector("#" + t.hash)) {
2445
- const s = document.createElement("style");
2446
- s.id = t.hash, s.textContent = t.code, r.appendChild(s);
2447
- }
2448
- });
2449
- }
2450
- function ir(e, t, n = !1) {
2451
- if (e.multiple) {
2452
- if (t == null)
2453
- return;
2454
- if (!ut(t))
2455
- return Fr();
2456
- for (var r of e.options)
2457
- r.selected = t.includes(Ye(r));
2458
- return;
2459
- }
2460
- for (r of e.options) {
2461
- var s = Ye(r);
2462
- if (In(s, t)) {
2463
- r.selected = !0;
2464
- return;
2465
- }
2466
- }
2467
- (!n || t !== void 0) && (e.selectedIndex = -1);
2468
- }
2469
- function Ss(e) {
2470
- var t = new MutationObserver(() => {
2471
- ir(e, e.__value);
2472
- });
2473
- t.observe(e, {
2474
- // Listen to option element changes
2475
- childList: !0,
2476
- subtree: !0,
2477
- // because of <optgroup>
2478
- // Listen to option element value attribute changes
2479
- // (doesn't get notified of select value changes,
2480
- // because that property is not reflected as an attribute)
2481
- attributes: !0,
2482
- attributeFilter: ["value"]
2483
- }), yt(() => {
2484
- t.disconnect();
2485
- });
2486
- }
2487
- function hi(e, t, n = t) {
2488
- var r = /* @__PURE__ */ new WeakSet(), s = !0;
2489
- ze(e, "change", (i) => {
2490
- var a = i ? "[selected]" : ":checked", f;
2491
- if (e.multiple)
2492
- f = [].map.call(e.querySelectorAll(a), Ye);
2493
- else {
2494
- var l = e.querySelector(a) ?? // will fall back to first non-disabled option if no option is selected
2495
- e.querySelector("option:not([disabled])");
2496
- f = l && Ye(l);
2497
- }
2498
- n(f), b !== null && r.add(b);
2499
- }), Bn(() => {
2500
- var i = t();
2501
- if (e === document.activeElement) {
2502
- var a = (
2503
- /** @type {Batch} */
2504
- He ?? b
2505
- );
2506
- if (r.has(a))
2507
- return;
2508
- }
2509
- if (ir(e, i, s), s && i === void 0) {
2510
- var f = e.querySelector(":checked");
2511
- f !== null && (i = Ye(f), n(i));
2512
- }
2513
- e.__value = i, s = !1;
2514
- }), Ss(e);
2515
- }
2516
- function Ye(e) {
2517
- return "__value" in e ? e.__value : e.value;
2518
- }
2519
- const Ts = Symbol("is custom element"), ks = Symbol("is html");
2520
- function di(e) {
2521
- if (v) {
2522
- var t = !1, n = () => {
2523
- if (!t) {
2524
- if (t = !0, e.hasAttribute("value")) {
2525
- var r = e.value;
2526
- Dt(e, "value", null), e.value = r;
2527
- }
2528
- if (e.hasAttribute("checked")) {
2529
- var s = e.checked;
2530
- Dt(e, "checked", null), e.checked = s;
2531
- }
2532
- }
2533
- };
2534
- e.__on_r = n, _e(n), Fn();
2535
- }
2536
- }
2537
- function _i(e, t) {
2538
- var n = Xt(e);
2539
- n.value === (n.value = // treat null and undefined the same for the initial value
2540
- t ?? void 0) || // @ts-expect-error
2541
- // `progress` elements always need their value set when it's `0`
2542
- e.value === t && (t !== 0 || e.nodeName !== "PROGRESS") || (e.value = t ?? "");
2543
- }
2544
- function vi(e, t) {
2545
- var n = Xt(e);
2546
- n.checked !== (n.checked = // treat null and undefined the same for the initial value
2547
- t ?? void 0) && (e.checked = t);
2548
- }
2549
- function Dt(e, t, n, r) {
2550
- var s = Xt(e);
2551
- v && (s[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === "LINK") || s[t] !== (s[t] = n) && (t === "loading" && (e[Tr] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && ar(e).includes(t) ? e[t] = n : e.setAttribute(t, n));
2552
- }
2553
- function pi(e, t, n) {
2554
- var r = y, s = m;
2555
- let i = v;
2556
- v && B(!1), O(null), K(null);
2557
- try {
2558
- // `style` should use `set_attribute` rather than the setter
2559
- t !== "style" && // Don't compute setters for custom elements while they aren't registered yet,
2560
- // because during their upgrade/instantiation they might add more setters.
2561
- // Instead, fall back to a simple "an object, then set as property" heuristic.
2562
- (Ft.has(e.getAttribute("is") || e.nodeName) || // customElements may not be available in browser extension contexts
2563
- !customElements || customElements.get(e.getAttribute("is") || e.tagName.toLowerCase()) ? ar(e).includes(t) : n && typeof n == "object") ? e[t] = n : Dt(e, t, n == null ? n : String(n));
2564
- } finally {
2565
- O(r), K(s), i && B(!0);
2566
- }
2567
- }
2568
- function Xt(e) {
2569
- return (
2570
- /** @type {Record<string | symbol, unknown>} **/
2571
- // @ts-expect-error
2572
- e.__attributes ??= {
2573
- [Ts]: e.nodeName.includes("-"),
2574
- [ks]: e.namespaceURI === yr
2575
- }
2576
- );
2577
- }
2578
- var Ft = /* @__PURE__ */ new Map();
2579
- function ar(e) {
2580
- var t = e.getAttribute("is") || e.nodeName, n = Ft.get(t);
2581
- if (n) return n;
2582
- Ft.set(t, n = []);
2583
- for (var r, s = e, i = Element.prototype; i !== s; ) {
2584
- r = _n(s);
2585
- for (var a in r)
2586
- r[a].set && n.push(a);
2587
- s = Bt(s);
2588
- }
2589
- return n;
2590
- }
2591
- function mi(e, t, n = t) {
2592
- var r = /* @__PURE__ */ new WeakSet();
2593
- ze(e, "input", async (s) => {
2594
- var i = s ? e.defaultValue : e.value;
2595
- if (i = kt(e) ? At(i) : i, n(i), b !== null && r.add(b), await hs(), i !== (i = t())) {
2596
- var a = e.selectionStart, f = e.selectionEnd, l = e.value.length;
2597
- if (e.value = i ?? "", f !== null) {
2598
- var u = e.value.length;
2599
- a === f && f === l && u > l ? (e.selectionStart = u, e.selectionEnd = u) : (e.selectionStart = a, e.selectionEnd = Math.min(f, u));
2600
- }
2601
- }
2602
- }), // If we are hydrating and the value has since changed,
2603
- // then use the updated value from the input instead.
2604
- (v && e.defaultValue !== e.value || // If defaultValue is set, then value == defaultValue
2605
- // TODO Svelte 6: remove input.value check and set to empty string?
2606
- $t(t) == null && e.value) && (n(kt(e) ? At(e.value) : e.value), b !== null && r.add(b)), Fe(() => {
2607
- var s = t();
2608
- if (e === document.activeElement) {
2609
- var i = (
2610
- /** @type {Batch} */
2611
- He ?? b
2612
- );
2613
- if (r.has(i))
2614
- return;
2615
- }
2616
- kt(e) && s === At(e.value) || e.type === "date" && !s && !e.value || s !== e.value && (e.value = s ?? "");
2617
- });
2618
- }
2619
- const Tt = /* @__PURE__ */ new Set();
2620
- function gi(e, t, n, r, s = r) {
2621
- var i = n.getAttribute("type") === "checkbox", a = e;
2622
- let f = !1;
2623
- if (t !== null)
2624
- for (var l of t)
2625
- a = a[l] ??= [];
2626
- a.push(n), ze(
2627
- n,
2628
- "change",
2629
- () => {
2630
- var u = n.__value;
2631
- i && (u = on(a, u, n.checked)), s(u);
2632
- },
2633
- // TODO better default value handling
2634
- () => s(i ? [] : null)
2635
- ), Fe(() => {
2636
- var u = r();
2637
- if (v && n.defaultChecked !== n.checked) {
2638
- f = !0;
2639
- return;
2640
- }
2641
- i ? (u = u || [], n.checked = u.includes(n.__value)) : n.checked = In(n.__value, u);
2642
- }), yt(() => {
2643
- var u = a.indexOf(n);
2644
- u !== -1 && a.splice(u, 1);
2645
- }), Tt.has(a) || (Tt.add(a), _e(() => {
2646
- a.sort((u, c) => u.compareDocumentPosition(c) === 4 ? -1 : 1), Tt.delete(a);
2647
- })), _e(() => {
2648
- if (f) {
2649
- var u;
2650
- if (i)
2651
- u = on(a, u, n.checked);
2652
- else {
2653
- var c = a.find((_) => _.checked);
2654
- u = c?.__value;
2655
- }
2656
- s(u);
2657
- }
2658
- });
2659
- }
2660
- function yi(e, t, n = t) {
2661
- ze(e, "change", (r) => {
2662
- var s = r ? e.defaultChecked : e.checked;
2663
- n(s);
2664
- }), // If we are hydrating and the value has since changed,
2665
- // then use the update value from the input instead.
2666
- (v && e.defaultChecked !== e.checked || // If defaultChecked is set, then checked == defaultChecked
2667
- $t(t) == null) && n(e.checked), Fe(() => {
2668
- var r = t();
2669
- e.checked = !!r;
2670
- });
2671
- }
2672
- function on(e, t, n) {
2673
- for (var r = /* @__PURE__ */ new Set(), s = 0; s < e.length; s += 1)
2674
- e[s].checked && r.add(e[s].__value);
2675
- return n || r.delete(t), Array.from(r);
2676
- }
2677
- function kt(e) {
2678
- var t = e.type;
2679
- return t === "number" || t === "range";
2680
- }
2681
- function At(e) {
2682
- return e === "" ? null : +e;
2683
- }
2684
- function wi(e, t, n = t) {
2685
- ze(e, "change", () => {
2686
- n(e.files);
2687
- }), // If we are hydrating and the value has since changed,
2688
- // then use the updated value from the input instead.
2689
- v && e.files && n(e.files), Fe(() => {
2690
- e.files = t();
2691
- });
2692
- }
2693
- let Qe = !1;
2694
- function As(e) {
2695
- var t = Qe;
2696
- try {
2697
- return Qe = !1, [e(), Qe];
2698
- } finally {
2699
- Qe = t;
2700
- }
2701
- }
2702
- function $i(e, t, n, r) {
2703
- var s = !Ge || (n & dr) !== 0, i = (n & vr) !== 0, a = (n & pr) !== 0, f = (
2704
- /** @type {V} */
2705
- r
2706
- ), l = !0, u = () => (l && (l = !1, f = a ? $t(
2707
- /** @type {() => V} */
2708
- r
2709
- ) : (
2710
- /** @type {V} */
2711
- r
2712
- )), f), c;
2713
- if (i) {
2714
- var _ = he in e || mn in e;
2715
- c = ye(e, t)?.set ?? (_ && t in e ? (T) => e[t] = T : void 0);
2716
- }
2717
- var h, d = !1;
2718
- i ? [h, d] = As(() => (
2719
- /** @type {V} */
2720
- e[t]
2721
- )) : h = /** @type {V} */
2722
- e[t], h === void 0 && r !== void 0 && (h = u(), c && (s && Ir(), c(h)));
2723
- var o;
2724
- if (s ? o = () => {
2725
- var T = (
2726
- /** @type {V} */
2727
- e[t]
2728
- );
2729
- return T === void 0 ? u() : (l = !0, T);
2730
- } : o = () => {
2731
- var T = (
2732
- /** @type {V} */
2733
- e[t]
2734
- );
2735
- return T !== void 0 && (f = /** @type {V} */
2736
- void 0), T === void 0 ? f : T;
2737
- }, s && (n & _r) === 0)
2738
- return o;
2739
- if (c) {
2740
- var g = e.$$legacy;
2741
- return (
2742
- /** @type {() => V} */
2743
- (function(T, j) {
2744
- return arguments.length > 0 ? ((!s || !j || g || d) && c(j ? o() : T), T) : o();
2745
- })
2746
- );
2747
- }
2748
- var $ = !1, E = ((n & hr) !== 0 ? mt : Yt)(() => ($ = !1, o()));
2749
- i && M(E);
2750
- var k = (
2751
- /** @type {Effect} */
2752
- m
2753
- );
2754
- return (
2755
- /** @type {() => V} */
2756
- (function(T, j) {
2757
- if (arguments.length > 0) {
2758
- const x = j ? M(E) : s && i ? Ne(T) : T;
2759
- return ee(E, x), $ = !0, f !== void 0 && (f = x), T;
2760
- }
2761
- return ke && $ || (k.f & fe) !== 0 ? E.v : M(E);
2762
- })
2763
- );
2764
- }
2765
- function xs(e) {
2766
- return new Ns(e);
2767
- }
2768
- class Ns {
2769
- /** @type {any} */
2770
- #t;
2771
- /** @type {Record<string, any>} */
2772
- #e;
2773
- /**
2774
- * @param {ComponentConstructorOptions & {
2775
- * component: any;
2776
- * }} options
2777
- */
2778
- constructor(t) {
2779
- var n = /* @__PURE__ */ new Map(), r = (i, a) => {
2780
- var f = /* @__PURE__ */ Cn(a, !1, !1);
2781
- return n.set(i, f), f;
2782
- };
2783
- const s = new Proxy(
2784
- { ...t.props || {}, $$events: {} },
2785
- {
2786
- get(i, a) {
2787
- return M(n.get(a) ?? r(a, Reflect.get(i, a)));
2788
- },
2789
- has(i, a) {
2790
- return a === mn ? !0 : (M(n.get(a) ?? r(a, Reflect.get(i, a))), Reflect.has(i, a));
2791
- },
2792
- set(i, a, f) {
2793
- return ee(n.get(a) ?? r(a, f), f), Reflect.set(i, a, f);
2794
- }
2795
- }
2796
- );
2797
- this.#e = (t.hydrate ? ys : nr)(t.component, {
2798
- target: t.target,
2799
- anchor: t.anchor,
2800
- props: s,
2801
- context: t.context,
2802
- intro: t.intro ?? !1,
2803
- recover: t.recover
2804
- }), (!t?.props?.$$host || t.sync === !1) && Tn(), this.#t = s.$$events;
2805
- for (const i of Object.keys(this.#e))
2806
- i === "$set" || i === "$destroy" || i === "$on" || Ie(this, i, {
2807
- get() {
2808
- return this.#e[i];
2809
- },
2810
- /** @param {any} value */
2811
- set(a) {
2812
- this.#e[i] = a;
2813
- },
2814
- enumerable: !0
2815
- });
2816
- this.#e.$set = /** @param {Record<string, any>} next */
2817
- (i) => {
2818
- Object.assign(s, i);
2819
- }, this.#e.$destroy = () => {
2820
- ws(this.#e);
2821
- };
2822
- }
2823
- /** @param {Record<string, any>} props */
2824
- $set(t) {
2825
- this.#e.$set(t);
2826
- }
2827
- /**
2828
- * @param {string} event
2829
- * @param {(...args: any[]) => any} callback
2830
- * @returns {any}
2831
- */
2832
- $on(t, n) {
2833
- this.#t[t] = this.#t[t] || [];
2834
- const r = (...s) => n.call(this, ...s);
2835
- return this.#t[t].push(r), () => {
2836
- this.#t[t] = this.#t[t].filter(
2837
- /** @param {any} fn */
2838
- (s) => s !== r
2839
- );
2840
- };
2841
- }
2842
- $destroy() {
2843
- this.#e.$destroy();
2844
- }
2845
- }
2846
- let fr;
2847
- typeof HTMLElement == "function" && (fr = class extends HTMLElement {
2848
- /** The Svelte component constructor */
2849
- $$ctor;
2850
- /** Slots */
2851
- $$s;
2852
- /** @type {any} The Svelte component instance */
2853
- $$c;
2854
- /** Whether or not the custom element is connected */
2855
- $$cn = !1;
2856
- /** @type {Record<string, any>} Component props data */
2857
- $$d = {};
2858
- /** `true` if currently in the process of reflecting component props back to attributes */
2859
- $$r = !1;
2860
- /** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */
2861
- $$p_d = {};
2862
- /** @type {Record<string, EventListenerOrEventListenerObject[]>} Event listeners */
2863
- $$l = {};
2864
- /** @type {Map<EventListenerOrEventListenerObject, Function>} Event listener unsubscribe functions */
2865
- $$l_u = /* @__PURE__ */ new Map();
2866
- /** @type {any} The managed render effect for reflecting attributes */
2867
- $$me;
2868
- /**
2869
- * @param {*} $$componentCtor
2870
- * @param {*} $$slots
2871
- * @param {*} use_shadow_dom
2872
- */
2873
- constructor(e, t, n) {
2874
- super(), this.$$ctor = e, this.$$s = t, n && this.attachShadow({ mode: "open" });
2875
- }
2876
- /**
2877
- * @param {string} type
2878
- * @param {EventListenerOrEventListenerObject} listener
2879
- * @param {boolean | AddEventListenerOptions} [options]
2880
- */
2881
- addEventListener(e, t, n) {
2882
- if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(t), this.$$c) {
2883
- const r = this.$$c.$on(e, t);
2884
- this.$$l_u.set(t, r);
2885
- }
2886
- super.addEventListener(e, t, n);
2887
- }
2888
- /**
2889
- * @param {string} type
2890
- * @param {EventListenerOrEventListenerObject} listener
2891
- * @param {boolean | AddEventListenerOptions} [options]
2892
- */
2893
- removeEventListener(e, t, n) {
2894
- if (super.removeEventListener(e, t, n), this.$$c) {
2895
- const r = this.$$l_u.get(t);
2896
- r && (r(), this.$$l_u.delete(t));
2897
- }
2898
- }
2899
- async connectedCallback() {
2900
- if (this.$$cn = !0, !this.$$c) {
2901
- let e = function(r) {
2902
- return (s) => {
2903
- const i = document.createElement("slot");
2904
- r !== "default" && (i.name = r), ps(s, i);
2905
- };
2906
- };
2907
- if (await Promise.resolve(), !this.$$cn || this.$$c)
2908
- return;
2909
- const t = {}, n = Os(this);
2910
- for (const r of this.$$s)
2911
- r in n && (r === "default" && !this.$$d.children ? (this.$$d.children = e(r), t.default = !0) : t[r] = e(r));
2912
- for (const r of this.attributes) {
2913
- const s = this.$$g_p(r.name);
2914
- s in this.$$d || (this.$$d[s] = et(s, r.value, this.$$p_d, "toProp"));
2915
- }
2916
- for (const r in this.$$p_d)
2917
- !(r in this.$$d) && this[r] !== void 0 && (this.$$d[r] = this[r], delete this[r]);
2918
- this.$$c = xs({
2919
- component: this.$$ctor,
2920
- target: this.shadowRoot || this,
2921
- props: {
2922
- ...this.$$d,
2923
- $$slots: t,
2924
- $$host: this
2925
- }
2926
- }), this.$$me = is(() => {
2927
- Fe(() => {
2928
- this.$$r = !0;
2929
- for (const r of tt(this.$$c)) {
2930
- if (!this.$$p_d[r]?.reflect) continue;
2931
- this.$$d[r] = this.$$c[r];
2932
- const s = et(
2933
- r,
2934
- this.$$d[r],
2935
- this.$$p_d,
2936
- "toAttribute"
2937
- );
2938
- s == null ? this.removeAttribute(this.$$p_d[r].attribute || r) : this.setAttribute(this.$$p_d[r].attribute || r, s);
2939
- }
2940
- this.$$r = !1;
2941
- });
2942
- });
2943
- for (const r in this.$$l)
2944
- for (const s of this.$$l[r]) {
2945
- const i = this.$$c.$on(r, s);
2946
- this.$$l_u.set(s, i);
2947
- }
2948
- this.$$l = {};
2949
- }
2950
- }
2951
- // We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte
2952
- // and setting attributes through setAttribute etc, this is helpful
2953
- /**
2954
- * @param {string} attr
2955
- * @param {string} _oldValue
2956
- * @param {string} newValue
2957
- */
2958
- attributeChangedCallback(e, t, n) {
2959
- this.$$r || (e = this.$$g_p(e), this.$$d[e] = et(e, n, this.$$p_d, "toProp"), this.$$c?.$set({ [e]: this.$$d[e] }));
2960
- }
2961
- disconnectedCallback() {
2962
- this.$$cn = !1, Promise.resolve().then(() => {
2963
- !this.$$cn && this.$$c && (this.$$c.$destroy(), this.$$me(), this.$$c = void 0);
2964
- });
2965
- }
2966
- /**
2967
- * @param {string} attribute_name
2968
- */
2969
- $$g_p(e) {
2970
- return tt(this.$$p_d).find(
2971
- (t) => this.$$p_d[t].attribute === e || !this.$$p_d[t].attribute && t.toLowerCase() === e
2972
- ) || e;
2973
- }
2974
- });
2975
- function et(e, t, n, r) {
2976
- const s = n[e]?.type;
2977
- if (t = s === "Boolean" && typeof t != "boolean" ? t != null : t, !r || !n[e])
2978
- return t;
2979
- if (r === "toAttribute")
2980
- switch (s) {
2981
- case "Object":
2982
- case "Array":
2983
- return t == null ? null : JSON.stringify(t);
2984
- case "Boolean":
2985
- return t ? "" : null;
2986
- case "Number":
2987
- return t ?? null;
2988
- default:
2989
- return t;
2990
- }
2991
- else
2992
- switch (s) {
2993
- case "Object":
2994
- case "Array":
2995
- return t && JSON.parse(t);
2996
- case "Boolean":
2997
- return t;
2998
- // conversion already handled above
2999
- case "Number":
3000
- return t != null ? +t : t;
3001
- default:
3002
- return t;
3003
- }
3004
- }
3005
- function Os(e) {
3006
- const t = {};
3007
- return e.childNodes.forEach((n) => {
3008
- t[
3009
- /** @type {Element} node */
3010
- n.slot || "default"
3011
- ] = !0;
3012
- }), t;
3013
- }
3014
- function bi(e, t, n, r, s, i) {
3015
- let a = class extends fr {
3016
- constructor() {
3017
- super(e, n, s), this.$$p_d = t;
3018
- }
3019
- static get observedAttributes() {
3020
- return tt(t).map(
3021
- (f) => (t[f].attribute || f).toLowerCase()
3022
- );
3023
- }
3024
- };
3025
- return tt(t).forEach((f) => {
3026
- Ie(a.prototype, f, {
3027
- get() {
3028
- return this.$$c && f in this.$$c ? this.$$c[f] : this.$$d[f];
3029
- },
3030
- set(l) {
3031
- l = et(f, l, t), this.$$d[f] = l;
3032
- var u = this.$$c;
3033
- if (u) {
3034
- var c = ye(u, f)?.get;
3035
- c ? u[f] = l : u.$set({ [f]: l });
3036
- }
3037
- }
3038
- });
3039
- }), r.forEach((f) => {
3040
- Ie(a.prototype, f, {
3041
- get() {
3042
- return this.$$c?.[f];
3043
- }
3044
- });
3045
- }), e.element = /** @type {any} */
3046
- a, a;
3047
- }
3048
- export {
3049
- Er as $,
3050
- us as A,
3051
- $s as B,
3052
- tr as C,
3053
- re as D,
3054
- ht as E,
3055
- se as F,
3056
- w as G,
3057
- lt as H,
3058
- De as I,
3059
- ie as J,
3060
- _t as K,
3061
- Re as L,
3062
- gt as M,
3063
- Ps as N,
3064
- Ms as O,
3065
- un as P,
3066
- Se as Q,
3067
- Ut as R,
3068
- Bn as S,
3069
- Is as T,
3070
- N as U,
3071
- Cs as V,
3072
- Rs as W,
3073
- Fe as X,
3074
- he as Y,
3075
- Xs as Z,
3076
- Ds as _,
3077
- $t as a,
3078
- M as a0,
3079
- Qs as a1,
3080
- mt as a2,
3081
- bi as a3,
3082
- $i as a4,
3083
- ai as a5,
3084
- Gs as a6,
3085
- li as a7,
3086
- ps as a8,
3087
- Vr as a9,
3088
- Yt as aA,
3089
- nn as aB,
3090
- ei as aC,
3091
- mi as aD,
3092
- wi as aE,
3093
- vi as aF,
3094
- _i as aG,
3095
- Ys as aH,
3096
- zs as aI,
3097
- yi as aJ,
3098
- hi as aK,
3099
- Ur as aa,
3100
- Vs as ab,
3101
- si as ac,
3102
- Ws as ad,
3103
- qs as ae,
3104
- Dt as af,
3105
- ni as ag,
3106
- ci as ah,
3107
- ri as ai,
3108
- ti as aj,
3109
- oe as ak,
3110
- ee as al,
3111
- Ks as am,
3112
- fi as an,
3113
- oi as ao,
3114
- ui as ap,
3115
- Ne as aq,
3116
- Hs as ar,
3117
- Us as as,
3118
- pi as at,
3119
- ii as au,
3120
- qr as av,
3121
- di as aw,
3122
- gi as ax,
3123
- Fs as ay,
3124
- Bs as az,
3125
- Kt as b,
3126
- A as c,
3127
- Ge as d,
3128
- vt as e,
3129
- Ke as f,
3130
- Bt as g,
3131
- v as h,
3132
- ut as i,
3133
- Ls as j,
3134
- rt as k,
3135
- kr as l,
3136
- B as m,
3137
- Le as n,
3138
- $r as o,
3139
- Ee as p,
3140
- _e as q,
3141
- Cn as r,
3142
- C as s,
3143
- es as t,
3144
- Js as u,
3145
- Ct as v,
3146
- Ue as w,
3147
- Tn as x,
3148
- Zs as y,
3149
- m as z
3150
- };