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