mertani-web-toolkit 0.1.12 → 0.1.14

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.
Files changed (58) hide show
  1. package/dist/index.esm.js +1494 -0
  2. package/dist/index.umd.js +2 -0
  3. package/dist/mertani-web-toolkit.css +1 -0
  4. package/dist/vite.svg +1 -0
  5. package/package.json +5 -18
  6. package/dist/index.d.ts +0 -2
  7. package/src/App.svelte +0 -49
  8. package/src/app.css +0 -79
  9. package/src/assets/font/OpenSans-Light-webfont.eot +0 -0
  10. package/src/assets/font/OpenSans-Light-webfont.svg +0 -252
  11. package/src/assets/font/OpenSans-Light-webfont.ttf +0 -0
  12. package/src/assets/font/OpenSans-Light-webfont.woff +0 -0
  13. package/src/assets/font/OpenSans-Regular-webfont.eot +0 -0
  14. package/src/assets/font/OpenSans-Regular-webfont.svg +0 -252
  15. package/src/assets/font/OpenSans-Regular-webfont.ttf +0 -0
  16. package/src/assets/font/OpenSans-Regular-webfont.woff +0 -0
  17. package/src/assets/icon/percolate.eot +0 -0
  18. package/src/assets/icon/percolate.svg +0 -139
  19. package/src/assets/icon/percolate.ttf +0 -0
  20. package/src/assets/icon/percolate.woff +0 -0
  21. package/src/assets/icon/todos.eot +0 -0
  22. package/src/assets/icon/todos.svg +0 -27
  23. package/src/assets/icon/todos.ttf +0 -0
  24. package/src/assets/icon/todos.woff +0 -0
  25. package/src/assets/svelte.svg +0 -1
  26. package/src/index.css +0 -466
  27. package/src/index.ts +0 -3
  28. package/src/lib/Button.svelte +0 -30
  29. package/src/lib/Counter.svelte +0 -10
  30. package/src/lib/button.css +0 -30
  31. package/src/main.ts +0 -9
  32. package/src/stories/Button.stories.svelte +0 -31
  33. package/src/stories/Button.svelte +0 -30
  34. package/src/stories/Configure.mdx +0 -364
  35. package/src/stories/Header.stories.svelte +0 -26
  36. package/src/stories/Header.svelte +0 -45
  37. package/src/stories/Page.stories.svelte +0 -30
  38. package/src/stories/Page.svelte +0 -70
  39. package/src/stories/assets/accessibility.png +0 -0
  40. package/src/stories/assets/accessibility.svg +0 -1
  41. package/src/stories/assets/addon-library.png +0 -0
  42. package/src/stories/assets/assets.png +0 -0
  43. package/src/stories/assets/avif-test-image.avif +0 -0
  44. package/src/stories/assets/context.png +0 -0
  45. package/src/stories/assets/discord.svg +0 -1
  46. package/src/stories/assets/docs.png +0 -0
  47. package/src/stories/assets/figma-plugin.png +0 -0
  48. package/src/stories/assets/github.svg +0 -1
  49. package/src/stories/assets/share.png +0 -0
  50. package/src/stories/assets/styling.png +0 -0
  51. package/src/stories/assets/testing.png +0 -0
  52. package/src/stories/assets/theming.png +0 -0
  53. package/src/stories/assets/tutorials.svg +0 -1
  54. package/src/stories/assets/youtube.svg +0 -1
  55. package/src/stories/button.css +0 -30
  56. package/src/stories/header.css +0 -32
  57. package/src/stories/page.css +0 -68
  58. package/src/vite-env.d.ts +0 -2
@@ -0,0 +1,1494 @@
1
+ typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add("5");
2
+ const Te = 2, vt = Symbol(), Se = "http://www.w3.org/1999/xhtml", me = "@attach", Yt = !1;
3
+ var Ht = Array.isArray, Oe = Array.prototype.indexOf, gt = Object.defineProperty, Ne = Object.getOwnPropertyDescriptors, Ce = Object.getPrototypeOf;
4
+ function Re(t) {
5
+ for (var e = 0; e < t.length; e++)
6
+ t[e]();
7
+ }
8
+ function Ie() {
9
+ var t, e, r = new Promise((n, l) => {
10
+ t = n, e = l;
11
+ });
12
+ return { promise: r, resolve: t, reject: e };
13
+ }
14
+ const C = 2, At = 4, Wt = 8, et = 16, z = 32, $ = 64, Kt = 128, R = 256, lt = 512, T = 1024, I = 2048, V = 4096, ut = 8192, G = 16384, zt = 32768, Le = 1 << 18, _t = 1 << 19, Pe = 1 << 20, wt = 1 << 21, $t = 1 << 22, U = 1 << 23, Nt = Symbol("$state"), Me = Symbol(""), kt = new class extends Error {
15
+ name = "StaleReactionError";
16
+ message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
17
+ }();
18
+ function De() {
19
+ throw new Error("https://svelte.dev/e/await_outside_boundary");
20
+ }
21
+ function Fe() {
22
+ throw new Error("https://svelte.dev/e/async_derived_orphan");
23
+ }
24
+ function je() {
25
+ throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
26
+ }
27
+ function Ve() {
28
+ console.warn("https://svelte.dev/e/select_multiple_invalid_value");
29
+ }
30
+ function Gt(t) {
31
+ return t === this.v;
32
+ }
33
+ let qe = !1, L = null;
34
+ function it(t) {
35
+ L = t;
36
+ }
37
+ function Ue(t, e = !1, r) {
38
+ L = {
39
+ p: L,
40
+ c: null,
41
+ e: null,
42
+ s: t,
43
+ x: null,
44
+ l: null
45
+ };
46
+ }
47
+ function Be(t) {
48
+ var e = (
49
+ /** @type {ComponentContext} */
50
+ L
51
+ ), r = e.e;
52
+ if (r !== null) {
53
+ e.e = null;
54
+ for (var n of r)
55
+ sr(n);
56
+ }
57
+ return L = e.p, /** @type {T} */
58
+ {};
59
+ }
60
+ function xe() {
61
+ return !0;
62
+ }
63
+ const Ye = /* @__PURE__ */ new WeakMap();
64
+ function He(t) {
65
+ var e = p;
66
+ if (e === null)
67
+ return d.f |= U, t;
68
+ if ((e.f & zt) === 0) {
69
+ if ((e.f & Kt) === 0)
70
+ throw !e.parent && t instanceof Error && Zt(t), t;
71
+ e.b.error(t);
72
+ } else
73
+ Tt(t, e);
74
+ }
75
+ function Tt(t, e) {
76
+ for (; e !== null; ) {
77
+ if ((e.f & Kt) !== 0)
78
+ try {
79
+ e.b.error(t);
80
+ return;
81
+ } catch (r) {
82
+ t = r;
83
+ }
84
+ e = e.parent;
85
+ }
86
+ throw t instanceof Error && Zt(t), t;
87
+ }
88
+ function Zt(t) {
89
+ const e = Ye.get(t);
90
+ e && (gt(t, "message", {
91
+ value: e.message
92
+ }), gt(t, "stack", {
93
+ value: e.stack
94
+ }));
95
+ }
96
+ let ft = [];
97
+ function We() {
98
+ var t = ft;
99
+ ft = [], Re(t);
100
+ }
101
+ function Jt(t) {
102
+ ft.length === 0 && queueMicrotask(We), ft.push(t);
103
+ }
104
+ function Ke() {
105
+ for (var t = (
106
+ /** @type {Effect} */
107
+ p.b
108
+ ); t !== null && !t.has_pending_snippet(); )
109
+ t = t.parent;
110
+ return t === null && De(), t;
111
+ }
112
+ // @__NO_SIDE_EFFECTS__
113
+ function Qt(t) {
114
+ var e = C | I, r = d !== null && (d.f & C) !== 0 ? (
115
+ /** @type {Derived} */
116
+ d
117
+ ) : null;
118
+ return p === null || r !== null && (r.f & R) !== 0 ? e |= R : p.f |= _t, {
119
+ ctx: L,
120
+ deps: null,
121
+ effects: null,
122
+ equals: Gt,
123
+ f: e,
124
+ fn: t,
125
+ reactions: null,
126
+ rv: 0,
127
+ v: (
128
+ /** @type {V} */
129
+ vt
130
+ ),
131
+ wv: 0,
132
+ parent: r ?? p,
133
+ ac: null
134
+ };
135
+ }
136
+ // @__NO_SIDE_EFFECTS__
137
+ function ze(t, e) {
138
+ let r = (
139
+ /** @type {Effect | null} */
140
+ p
141
+ );
142
+ r === null && Fe();
143
+ var n = (
144
+ /** @type {Boundary} */
145
+ r.b
146
+ ), l = (
147
+ /** @type {Promise<V>} */
148
+ /** @type {unknown} */
149
+ void 0
150
+ ), u = Qe(
151
+ /** @type {V} */
152
+ vt
153
+ ), i = null, s = !d;
154
+ return ar(() => {
155
+ try {
156
+ var f = t();
157
+ i && Promise.resolve(f).catch(() => {
158
+ });
159
+ } catch (c) {
160
+ f = Promise.reject(c);
161
+ }
162
+ var a = () => f;
163
+ l = i?.then(a, a) ?? Promise.resolve(f), i = l;
164
+ var _ = (
165
+ /** @type {Batch} */
166
+ A
167
+ ), h = n.pending;
168
+ s && (n.update_pending_count(1), h || _.increment());
169
+ const o = (c, w = void 0) => {
170
+ i = null, h || _.activate(), w ? w !== kt && (u.f |= U, Lt(u, w)) : ((u.f & U) !== 0 && (u.f ^= U), Lt(u, c)), s && (n.update_pending_count(-1), h || _.decrement()), re();
171
+ };
172
+ if (l.then(o, (c) => o(null, c || "unknown")), _)
173
+ return () => {
174
+ queueMicrotask(() => _.neuter());
175
+ };
176
+ }), new Promise((f) => {
177
+ function a(_) {
178
+ function h() {
179
+ _ === l ? f(u) : a(l);
180
+ }
181
+ _.then(h, h);
182
+ }
183
+ a(l);
184
+ });
185
+ }
186
+ // @__NO_SIDE_EFFECTS__
187
+ function Ct(t) {
188
+ const e = /* @__PURE__ */ Qt(t);
189
+ return _r(e), e;
190
+ }
191
+ function Xt(t) {
192
+ var e = t.effects;
193
+ if (e !== null) {
194
+ t.effects = null;
195
+ for (var r = 0; r < e.length; r += 1)
196
+ B(
197
+ /** @type {Effect} */
198
+ e[r]
199
+ );
200
+ }
201
+ }
202
+ function $e(t) {
203
+ for (var e = t.parent; e !== null; ) {
204
+ if ((e.f & C) === 0)
205
+ return (
206
+ /** @type {Effect} */
207
+ e
208
+ );
209
+ e = e.parent;
210
+ }
211
+ return null;
212
+ }
213
+ function St(t) {
214
+ var e, r = p;
215
+ j($e(t));
216
+ try {
217
+ Xt(t), e = he(t);
218
+ } finally {
219
+ j(r);
220
+ }
221
+ return e;
222
+ }
223
+ function te(t) {
224
+ var e = St(t);
225
+ if (t.equals(e) || (t.v = e, t.wv = _e()), !rt) {
226
+ var r = (P || (t.f & R) !== 0) && t.deps !== null ? V : T;
227
+ O(t, r);
228
+ }
229
+ }
230
+ function ee(t, e, r) {
231
+ const n = Qt;
232
+ if (e.length === 0) {
233
+ r(t.map(n));
234
+ return;
235
+ }
236
+ var l = A, u = (
237
+ /** @type {Effect} */
238
+ p
239
+ ), i = Ge(), s = Ke();
240
+ Promise.all(e.map((f) => /* @__PURE__ */ ze(f))).then((f) => {
241
+ l?.activate(), i();
242
+ try {
243
+ r([...t.map(n), ...f]);
244
+ } catch (a) {
245
+ (u.f & G) === 0 && Tt(a, u);
246
+ }
247
+ l?.deactivate(), re();
248
+ }).catch((f) => {
249
+ s.error(f);
250
+ });
251
+ }
252
+ function Ge() {
253
+ var t = p, e = d, r = L, n = A;
254
+ return function() {
255
+ j(t), F(e), it(r), n?.activate();
256
+ };
257
+ }
258
+ function re() {
259
+ j(null), F(null), it(null);
260
+ }
261
+ const ht = /* @__PURE__ */ new Set();
262
+ let A = null, Rt = /* @__PURE__ */ new Set(), st = [];
263
+ function ne() {
264
+ const t = (
265
+ /** @type {() => void} */
266
+ st.shift()
267
+ );
268
+ st.length > 0 && queueMicrotask(ne), t();
269
+ }
270
+ let Q = [], mt = null, Et = !1;
271
+ class X {
272
+ /**
273
+ * The current values of any sources that are updated in this batch
274
+ * They keys of this map are identical to `this.#previous`
275
+ * @type {Map<Source, any>}
276
+ */
277
+ current = /* @__PURE__ */ new Map();
278
+ /**
279
+ * The values of any sources that are updated in this batch _before_ those updates took place.
280
+ * They keys of this map are identical to `this.#current`
281
+ * @type {Map<Source, any>}
282
+ */
283
+ #s = /* @__PURE__ */ new Map();
284
+ /**
285
+ * When the batch is committed (and the DOM is updated), we need to remove old branches
286
+ * and append new ones by calling the functions added inside (if/each/key/etc) blocks
287
+ * @type {Set<() => void>}
288
+ */
289
+ #l = /* @__PURE__ */ new Set();
290
+ /**
291
+ * The number of async effects that are currently in flight
292
+ */
293
+ #t = 0;
294
+ /**
295
+ * A deferred that resolves when the batch is committed, used with `settled()`
296
+ * TODO replace with Promise.withResolvers once supported widely enough
297
+ * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
298
+ */
299
+ #a = null;
300
+ /**
301
+ * True if an async effect inside this batch resolved and
302
+ * its parent branch was already deleted
303
+ */
304
+ #o = !1;
305
+ /**
306
+ * Async effects (created inside `async_derived`) encountered during processing.
307
+ * These run after the rest of the batch has updated, since they should
308
+ * always have the latest values
309
+ * @type {Effect[]}
310
+ */
311
+ #r = [];
312
+ /**
313
+ * The same as `#async_effects`, but for effects inside a newly-created
314
+ * `<svelte:boundary>` — these do not prevent the batch from committing
315
+ * @type {Effect[]}
316
+ */
317
+ #u = [];
318
+ /**
319
+ * Template effects and `$effect.pre` effects, which run when
320
+ * a batch is committed
321
+ * @type {Effect[]}
322
+ */
323
+ #n = [];
324
+ /**
325
+ * The same as `#render_effects`, but for `$effect` (which runs after)
326
+ * @type {Effect[]}
327
+ */
328
+ #e = [];
329
+ /**
330
+ * Block effects, which may need to re-run on subsequent flushes
331
+ * in order to update internal sources (e.g. each block items)
332
+ * @type {Effect[]}
333
+ */
334
+ #i = [];
335
+ /**
336
+ * Deferred effects (which run after async work has completed) that are DIRTY
337
+ * @type {Effect[]}
338
+ */
339
+ #c = [];
340
+ /**
341
+ * Deferred effects that are MAYBE_DIRTY
342
+ * @type {Effect[]}
343
+ */
344
+ #v = [];
345
+ /**
346
+ * A set of branches that still exist, but will be destroyed when this batch
347
+ * is committed — we skip over these during `process`
348
+ * @type {Set<Effect>}
349
+ */
350
+ skipped_effects = /* @__PURE__ */ new Set();
351
+ /**
352
+ *
353
+ * @param {Effect[]} root_effects
354
+ */
355
+ process(e) {
356
+ Q = [];
357
+ for (const l of e)
358
+ this.#p(l);
359
+ if (this.#r.length === 0 && this.#t === 0) {
360
+ this.#_();
361
+ var r = this.#n, n = this.#e;
362
+ this.#n = [], this.#e = [], this.#i = [], A = null, It(r), It(n), A === null ? A = this : ht.delete(this), this.#a?.resolve();
363
+ } else
364
+ this.#f(this.#n), this.#f(this.#e), this.#f(this.#i);
365
+ for (const l of this.#r)
366
+ K(l);
367
+ for (const l of this.#u)
368
+ K(l);
369
+ this.#r = [], this.#u = [];
370
+ }
371
+ /**
372
+ * Traverse the effect tree, executing effects or stashing
373
+ * them for later execution as appropriate
374
+ * @param {Effect} root
375
+ */
376
+ #p(e) {
377
+ e.f ^= T;
378
+ for (var r = e.first; r !== null; ) {
379
+ var n = r.f, l = (n & (z | $)) !== 0, u = l && (n & T) !== 0, i = u || (n & ut) !== 0 || this.skipped_effects.has(r);
380
+ if (!i && r.fn !== null) {
381
+ if (l)
382
+ r.f ^= T;
383
+ else if ((n & At) !== 0)
384
+ this.#e.push(r);
385
+ else if ((n & T) === 0)
386
+ if ((n & $t) !== 0) {
387
+ var s = r.b?.pending ? this.#u : this.#r;
388
+ s.push(r);
389
+ } else pt(r) && ((r.f & et) !== 0 && this.#i.push(r), K(r));
390
+ var f = r.first;
391
+ if (f !== null) {
392
+ r = f;
393
+ continue;
394
+ }
395
+ }
396
+ var a = r.parent;
397
+ for (r = r.next; r === null && a !== null; )
398
+ r = a.next, a = a.parent;
399
+ }
400
+ }
401
+ /**
402
+ * @param {Effect[]} effects
403
+ */
404
+ #f(e) {
405
+ for (const r of e)
406
+ ((r.f & I) !== 0 ? this.#c : this.#v).push(r), O(r, T);
407
+ e.length = 0;
408
+ }
409
+ /**
410
+ * Associate a change to a given source with the current
411
+ * batch, noting its previous and current values
412
+ * @param {Source} source
413
+ * @param {any} value
414
+ */
415
+ capture(e, r) {
416
+ this.#s.has(e) || this.#s.set(e, r), this.current.set(e, e.v);
417
+ }
418
+ activate() {
419
+ A = this;
420
+ }
421
+ deactivate() {
422
+ A = null;
423
+ for (const e of Rt)
424
+ if (Rt.delete(e), e(), A !== null)
425
+ break;
426
+ }
427
+ neuter() {
428
+ this.#o = !0;
429
+ }
430
+ flush() {
431
+ Q.length > 0 ? Ze() : this.#_(), A === this && (this.#t === 0 && ht.delete(this), this.deactivate());
432
+ }
433
+ /**
434
+ * Append and remove branches to/from the DOM
435
+ */
436
+ #_() {
437
+ if (!this.#o)
438
+ for (const e of this.#l)
439
+ e();
440
+ this.#l.clear();
441
+ }
442
+ increment() {
443
+ this.#t += 1;
444
+ }
445
+ decrement() {
446
+ if (this.#t -= 1, this.#t === 0) {
447
+ for (const e of this.#c)
448
+ O(e, I), tt(e);
449
+ for (const e of this.#v)
450
+ O(e, V), tt(e);
451
+ this.#n = [], this.#e = [], this.flush();
452
+ } else
453
+ this.deactivate();
454
+ }
455
+ /** @param {() => void} fn */
456
+ add_callback(e) {
457
+ this.#l.add(e);
458
+ }
459
+ settled() {
460
+ return (this.#a ??= Ie()).promise;
461
+ }
462
+ static ensure() {
463
+ if (A === null) {
464
+ const e = A = new X();
465
+ ht.add(A), X.enqueue(() => {
466
+ A === e && e.flush();
467
+ });
468
+ }
469
+ return A;
470
+ }
471
+ /** @param {() => void} task */
472
+ static enqueue(e) {
473
+ st.length === 0 && queueMicrotask(ne), st.unshift(e);
474
+ }
475
+ }
476
+ function Ze() {
477
+ var t = W;
478
+ Et = !0;
479
+ try {
480
+ var e = 0;
481
+ for (Mt(!0); Q.length > 0; ) {
482
+ var r = X.ensure();
483
+ if (e++ > 1e3) {
484
+ var n, l;
485
+ Je();
486
+ }
487
+ r.process(Q), M.clear();
488
+ }
489
+ } finally {
490
+ Et = !1, Mt(t), mt = null;
491
+ }
492
+ }
493
+ function Je() {
494
+ try {
495
+ je();
496
+ } catch (t) {
497
+ Tt(t, mt);
498
+ }
499
+ }
500
+ let q = null;
501
+ function It(t) {
502
+ var e = t.length;
503
+ if (e !== 0) {
504
+ for (var r = 0; r < e; ) {
505
+ var n = t[r++];
506
+ if ((n.f & (G | ut)) === 0 && pt(n) && (q = [], K(n), n.deps === null && n.first === null && n.nodes_start === null && (n.teardown === null && n.ac === null ? ce(n) : n.fn = null), q?.length > 0)) {
507
+ M.clear();
508
+ for (const l of q)
509
+ K(l);
510
+ q = [];
511
+ }
512
+ }
513
+ q = null;
514
+ }
515
+ }
516
+ function tt(t) {
517
+ for (var e = mt = t; e.parent !== null; ) {
518
+ e = e.parent;
519
+ var r = e.f;
520
+ if (Et && e === p && (r & et) !== 0)
521
+ return;
522
+ if ((r & ($ | z)) !== 0) {
523
+ if ((r & T) === 0) return;
524
+ e.f ^= T;
525
+ }
526
+ }
527
+ Q.push(e);
528
+ }
529
+ const M = /* @__PURE__ */ new Map();
530
+ function Qe(t, e) {
531
+ var r = {
532
+ f: 0,
533
+ // TODO ideally we could skip this altogether, but it causes type errors
534
+ v: t,
535
+ reactions: null,
536
+ equals: Gt,
537
+ rv: 0,
538
+ wv: 0
539
+ };
540
+ return r;
541
+ }
542
+ function Lt(t, e) {
543
+ if (!t.equals(e)) {
544
+ var r = t.v;
545
+ rt ? M.set(t, e) : M.set(t, r), t.v = e;
546
+ var n = X.ensure();
547
+ n.capture(t, r), (t.f & C) !== 0 && ((t.f & I) !== 0 && St(
548
+ /** @type {Derived} */
549
+ t
550
+ ), O(t, (t.f & R) === 0 ? T : V)), t.wv = _e(), le(t, I), p !== null && (p.f & T) !== 0 && (p.f & (z | $)) === 0 && (N === null ? pr([t]) : N.push(t));
551
+ }
552
+ return e;
553
+ }
554
+ function le(t, e) {
555
+ var r = t.reactions;
556
+ if (r !== null)
557
+ for (var n = r.length, l = 0; l < n; l++) {
558
+ var u = r[l], i = u.f, s = (i & I) === 0;
559
+ s && O(u, e), (i & C) !== 0 ? le(
560
+ /** @type {Derived} */
561
+ u,
562
+ V
563
+ ) : s && ((i & et) !== 0 && q !== null && q.push(
564
+ /** @type {Effect} */
565
+ u
566
+ ), tt(
567
+ /** @type {Effect} */
568
+ u
569
+ ));
570
+ }
571
+ }
572
+ function Pt(t) {
573
+ try {
574
+ if (t !== null && typeof t == "object" && Nt in t)
575
+ return t[Nt];
576
+ } catch {
577
+ }
578
+ return t;
579
+ }
580
+ function Xe(t, e) {
581
+ return Object.is(Pt(t), Pt(e));
582
+ }
583
+ var tr, er, rr;
584
+ // @__NO_SIDE_EFFECTS__
585
+ function ue(t) {
586
+ return er.call(t);
587
+ }
588
+ // @__NO_SIDE_EFFECTS__
589
+ function nr(t) {
590
+ return rr.call(t);
591
+ }
592
+ function lr(t, e) {
593
+ return /* @__PURE__ */ ue(t);
594
+ }
595
+ function ur(t, e) {
596
+ if (e) {
597
+ const r = document.body;
598
+ t.autofocus = !0, Jt(() => {
599
+ document.activeElement === r && t.focus();
600
+ });
601
+ }
602
+ }
603
+ function Ot(t) {
604
+ var e = d, r = p;
605
+ F(null), j(null);
606
+ try {
607
+ return t();
608
+ } finally {
609
+ F(e), j(r);
610
+ }
611
+ }
612
+ function ir(t, e) {
613
+ var r = e.last;
614
+ r === null ? e.last = e.first = t : (r.next = t, t.prev = r, e.last = t);
615
+ }
616
+ function x(t, e, r, n = !0) {
617
+ var l = p;
618
+ l !== null && (l.f & ut) !== 0 && (t |= ut);
619
+ var u = {
620
+ ctx: L,
621
+ deps: null,
622
+ nodes_start: null,
623
+ nodes_end: null,
624
+ f: t | I,
625
+ first: null,
626
+ fn: e,
627
+ last: null,
628
+ next: null,
629
+ parent: l,
630
+ b: l && l.b,
631
+ prev: null,
632
+ teardown: null,
633
+ transitions: null,
634
+ wv: 0,
635
+ ac: null
636
+ };
637
+ if (r)
638
+ try {
639
+ K(u), u.f |= zt;
640
+ } catch (f) {
641
+ throw B(u), f;
642
+ }
643
+ else e !== null && tt(u);
644
+ if (n) {
645
+ var i = u;
646
+ if (r && i.deps === null && i.teardown === null && i.nodes_start === null && i.first === i.last && // either `null`, or a singular child
647
+ (i.f & _t) === 0 && (i = i.first), i !== null && (i.parent = l, l !== null && ir(i, l), d !== null && (d.f & C) !== 0 && (t & $) === 0)) {
648
+ var s = (
649
+ /** @type {Derived} */
650
+ d
651
+ );
652
+ (s.effects ??= []).push(i);
653
+ }
654
+ }
655
+ return u;
656
+ }
657
+ function fr(t) {
658
+ const e = x(Wt, null, !1);
659
+ return O(e, T), e.teardown = t, e;
660
+ }
661
+ function sr(t) {
662
+ return x(At | Pe, t, !1);
663
+ }
664
+ function ie(t) {
665
+ return x(At, t, !1);
666
+ }
667
+ function ar(t) {
668
+ return x($t | _t, t, !0);
669
+ }
670
+ function or(t, e = [], r = []) {
671
+ ee(e, r, (n) => {
672
+ x(Wt, () => t(...n.map(ct)), !0);
673
+ });
674
+ }
675
+ function fe(t, e = 0) {
676
+ var r = x(et | e, t, !0);
677
+ return r;
678
+ }
679
+ function se(t, e = !0) {
680
+ return x(z | _t, t, !0, e);
681
+ }
682
+ function ae(t) {
683
+ var e = t.teardown;
684
+ if (e !== null) {
685
+ const r = rt, n = d;
686
+ Dt(!0), F(null);
687
+ try {
688
+ e.call(null);
689
+ } finally {
690
+ Dt(r), F(n);
691
+ }
692
+ }
693
+ }
694
+ function oe(t, e = !1) {
695
+ var r = t.first;
696
+ for (t.first = t.last = null; r !== null; ) {
697
+ const l = r.ac;
698
+ l !== null && Ot(() => {
699
+ l.abort(kt);
700
+ });
701
+ var n = r.next;
702
+ (r.f & $) !== 0 ? r.parent = null : B(r, e), r = n;
703
+ }
704
+ }
705
+ function cr(t) {
706
+ for (var e = t.first; e !== null; ) {
707
+ var r = e.next;
708
+ (e.f & z) === 0 && B(e), e = r;
709
+ }
710
+ }
711
+ function B(t, e = !0) {
712
+ var r = !1;
713
+ (e || (t.f & Le) !== 0) && t.nodes_start !== null && t.nodes_end !== null && (vr(
714
+ t.nodes_start,
715
+ /** @type {TemplateNode} */
716
+ t.nodes_end
717
+ ), r = !0), oe(t, e && !r), ot(t, 0), O(t, G);
718
+ var n = t.transitions;
719
+ if (n !== null)
720
+ for (const u of n)
721
+ u.stop();
722
+ ae(t);
723
+ var l = t.parent;
724
+ l !== null && l.first !== null && ce(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes_start = t.nodes_end = t.ac = null;
725
+ }
726
+ function vr(t, e) {
727
+ for (; t !== null; ) {
728
+ var r = t === e ? null : (
729
+ /** @type {TemplateNode} */
730
+ /* @__PURE__ */ nr(t)
731
+ );
732
+ t.remove(), t = r;
733
+ }
734
+ }
735
+ function ce(t) {
736
+ var e = t.parent, r = t.prev, n = t.next;
737
+ r !== null && (r.next = n), n !== null && (n.prev = r), e !== null && (e.first === t && (e.first = n), e.last === t && (e.last = r));
738
+ }
739
+ let W = !1;
740
+ function Mt(t) {
741
+ W = t;
742
+ }
743
+ let rt = !1;
744
+ function Dt(t) {
745
+ rt = t;
746
+ }
747
+ let d = null, H = !1;
748
+ function F(t) {
749
+ d = t;
750
+ }
751
+ let p = null;
752
+ function j(t) {
753
+ p = t;
754
+ }
755
+ let D = null;
756
+ function _r(t) {
757
+ d !== null && (D === null ? D = [t] : D.push(t));
758
+ }
759
+ let k = null, m = 0, N = null;
760
+ function pr(t) {
761
+ N = t;
762
+ }
763
+ let ve = 1, at = 0, P = !1;
764
+ function _e() {
765
+ return ++ve;
766
+ }
767
+ function pt(t) {
768
+ var e = t.f;
769
+ if ((e & I) !== 0)
770
+ return !0;
771
+ if ((e & V) !== 0) {
772
+ var r = t.deps, n = (e & R) !== 0;
773
+ if (r !== null) {
774
+ var l, u, i = (e & lt) !== 0, s = n && p !== null && !P, f = r.length;
775
+ if ((i || s) && (p === null || (p.f & G) === 0)) {
776
+ var a = (
777
+ /** @type {Derived} */
778
+ t
779
+ ), _ = a.parent;
780
+ for (l = 0; l < f; l++)
781
+ u = r[l], (i || !u?.reactions?.includes(a)) && (u.reactions ??= []).push(a);
782
+ i && (a.f ^= lt), s && _ !== null && (_.f & R) === 0 && (a.f ^= R);
783
+ }
784
+ for (l = 0; l < f; l++)
785
+ if (u = r[l], pt(
786
+ /** @type {Derived} */
787
+ u
788
+ ) && te(
789
+ /** @type {Derived} */
790
+ u
791
+ ), u.wv > t.wv)
792
+ return !0;
793
+ }
794
+ (!n || p !== null && !P) && O(t, T);
795
+ }
796
+ return !1;
797
+ }
798
+ function pe(t, e, r = !0) {
799
+ var n = t.reactions;
800
+ if (n !== null && !D?.includes(t))
801
+ for (var l = 0; l < n.length; l++) {
802
+ var u = n[l];
803
+ (u.f & C) !== 0 ? pe(
804
+ /** @type {Derived} */
805
+ u,
806
+ e,
807
+ !1
808
+ ) : e === u && (r ? O(u, I) : (u.f & T) !== 0 && O(u, V), tt(
809
+ /** @type {Effect} */
810
+ u
811
+ ));
812
+ }
813
+ }
814
+ function he(t) {
815
+ var e = k, r = m, n = N, l = d, u = P, i = D, s = L, f = H, a = t.f;
816
+ k = /** @type {null | Value[]} */
817
+ null, m = 0, N = null, P = (a & R) !== 0 && (H || !W || d === null), d = (a & (z | $)) === 0 ? t : null, D = null, it(t.ctx), H = !1, ++at, t.ac !== null && (Ot(() => {
818
+ t.ac.abort(kt);
819
+ }), t.ac = null);
820
+ try {
821
+ t.f |= wt;
822
+ var _ = (
823
+ /** @type {Function} */
824
+ t.fn
825
+ ), h = _(), o = t.deps;
826
+ if (k !== null) {
827
+ var c;
828
+ if (ot(t, m), o !== null && m > 0)
829
+ for (o.length = m + k.length, c = 0; c < k.length; c++)
830
+ o[m + c] = k[c];
831
+ else
832
+ t.deps = o = k;
833
+ if (!P || // Deriveds that already have reactions can cleanup, so we still add them as reactions
834
+ (a & C) !== 0 && /** @type {import('#client').Derived} */
835
+ t.reactions !== null)
836
+ for (c = m; c < o.length; c++)
837
+ (o[c].reactions ??= []).push(t);
838
+ } else o !== null && m < o.length && (ot(t, m), o.length = m);
839
+ if (xe() && N !== null && !H && o !== null && (t.f & (C | V | I)) === 0)
840
+ for (c = 0; c < /** @type {Source[]} */
841
+ N.length; c++)
842
+ pe(
843
+ N[c],
844
+ /** @type {Effect} */
845
+ t
846
+ );
847
+ return l !== null && l !== t && (at++, N !== null && (n === null ? n = N : n.push(.../** @type {Source[]} */
848
+ N))), (t.f & U) !== 0 && (t.f ^= U), h;
849
+ } catch (w) {
850
+ return He(w);
851
+ } finally {
852
+ t.f ^= wt, k = e, m = r, N = n, d = l, P = u, D = i, it(s), H = f;
853
+ }
854
+ }
855
+ function hr(t, e) {
856
+ let r = e.reactions;
857
+ if (r !== null) {
858
+ var n = Oe.call(r, t);
859
+ if (n !== -1) {
860
+ var l = r.length - 1;
861
+ l === 0 ? r = e.reactions = null : (r[n] = r[l], r.pop());
862
+ }
863
+ }
864
+ r === null && (e.f & C) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
865
+ // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
866
+ // allows us to skip the expensive work of disconnecting and immediately reconnecting it
867
+ (k === null || !k.includes(e)) && (O(e, V), (e.f & (R | lt)) === 0 && (e.f ^= lt), Xt(
868
+ /** @type {Derived} **/
869
+ e
870
+ ), ot(
871
+ /** @type {Derived} **/
872
+ e,
873
+ 0
874
+ ));
875
+ }
876
+ function ot(t, e) {
877
+ var r = t.deps;
878
+ if (r !== null)
879
+ for (var n = e; n < r.length; n++)
880
+ hr(t, r[n]);
881
+ }
882
+ function K(t) {
883
+ var e = t.f;
884
+ if ((e & G) === 0) {
885
+ O(t, T);
886
+ var r = p, n = W;
887
+ p = t, W = !0;
888
+ try {
889
+ (e & et) !== 0 ? cr(t) : oe(t), ae(t);
890
+ var l = he(t);
891
+ t.teardown = typeof l == "function" ? l : null, t.wv = ve;
892
+ var u;
893
+ Yt && qe && (t.f & I) !== 0 && t.deps;
894
+ } finally {
895
+ W = n, p = r;
896
+ }
897
+ }
898
+ }
899
+ function ct(t) {
900
+ var e = t.f, r = (e & C) !== 0;
901
+ if (d !== null && !H) {
902
+ var n = p !== null && (p.f & G) !== 0;
903
+ if (!n && !D?.includes(t)) {
904
+ var l = d.deps;
905
+ if ((d.f & wt) !== 0)
906
+ t.rv < at && (t.rv = at, k === null && l !== null && l[m] === t ? m++ : k === null ? k = [t] : (!P || !k.includes(t)) && k.push(t));
907
+ else {
908
+ (d.deps ??= []).push(t);
909
+ var u = t.reactions;
910
+ u === null ? t.reactions = [d] : u.includes(d) || u.push(d);
911
+ }
912
+ }
913
+ } else if (r && /** @type {Derived} */
914
+ t.deps === null && /** @type {Derived} */
915
+ t.effects === null) {
916
+ var i = (
917
+ /** @type {Derived} */
918
+ t
919
+ ), s = i.parent;
920
+ s !== null && (s.f & R) === 0 && (i.f ^= R);
921
+ }
922
+ if (rt) {
923
+ if (M.has(t))
924
+ return M.get(t);
925
+ if (r) {
926
+ i = /** @type {Derived} */
927
+ t;
928
+ var f = i.v;
929
+ return ((i.f & T) === 0 && i.reactions !== null || de(i)) && (f = St(i)), M.set(i, f), f;
930
+ }
931
+ } else r && (i = /** @type {Derived} */
932
+ t, pt(i) && te(i));
933
+ if ((t.f & U) !== 0)
934
+ throw t.v;
935
+ return t.v;
936
+ }
937
+ function de(t) {
938
+ if (t.v === vt) return !0;
939
+ if (t.deps === null) return !1;
940
+ for (const e of t.deps)
941
+ if (M.has(e) || (e.f & C) !== 0 && de(
942
+ /** @type {Derived} */
943
+ e
944
+ ))
945
+ return !0;
946
+ return !1;
947
+ }
948
+ const dr = -7169;
949
+ function O(t, e) {
950
+ t.f = t.f & dr | e;
951
+ }
952
+ const br = /* @__PURE__ */ new Set(), gr = /* @__PURE__ */ new Set();
953
+ function wr(t, e, r, n = {}) {
954
+ function l(u) {
955
+ if (n.capture || yr.call(e, u), !u.cancelBubble)
956
+ return Ot(() => r?.call(this, u));
957
+ }
958
+ return t.startsWith("pointer") || t.startsWith("touch") || t === "wheel" ? Jt(() => {
959
+ e.addEventListener(t, l, n);
960
+ }) : e.addEventListener(t, l, n), l;
961
+ }
962
+ function Er(t) {
963
+ for (var e = 0; e < t.length; e++)
964
+ br.add(t[e]);
965
+ for (var r of gr)
966
+ r(t);
967
+ }
968
+ let Ft = null;
969
+ function yr(t) {
970
+ var e = this, r = (
971
+ /** @type {Node} */
972
+ e.ownerDocument
973
+ ), n = t.type, l = t.composedPath?.() || [], u = (
974
+ /** @type {null | Element} */
975
+ l[0] || t.target
976
+ );
977
+ Ft = t;
978
+ var i = 0, s = Ft === t && t.__root;
979
+ if (s) {
980
+ var f = l.indexOf(s);
981
+ if (f !== -1 && (e === document || e === /** @type {any} */
982
+ window)) {
983
+ t.__root = e;
984
+ return;
985
+ }
986
+ var a = l.indexOf(e);
987
+ if (a === -1)
988
+ return;
989
+ f <= a && (i = f);
990
+ }
991
+ if (u = /** @type {Element} */
992
+ l[i] || t.target, u !== e) {
993
+ gt(t, "currentTarget", {
994
+ configurable: !0,
995
+ get() {
996
+ return u || r;
997
+ }
998
+ });
999
+ var _ = d, h = p;
1000
+ F(null), j(null);
1001
+ try {
1002
+ for (var o, c = []; u !== null; ) {
1003
+ var w = u.assignedSlot || u.parentNode || /** @type {any} */
1004
+ u.host || null;
1005
+ try {
1006
+ var b = u["__" + n];
1007
+ if (b != null && (!/** @type {any} */
1008
+ u.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
1009
+ // -> the target could not have been disabled because it emits the event in the first place
1010
+ t.target === u))
1011
+ if (Ht(b)) {
1012
+ var [E, ...nt] = b;
1013
+ E.apply(u, [t, ...nt]);
1014
+ } else
1015
+ b.call(u, t);
1016
+ } catch (v) {
1017
+ o ? c.push(v) : o = v;
1018
+ }
1019
+ if (t.cancelBubble || w === e || w === null)
1020
+ break;
1021
+ u = w;
1022
+ }
1023
+ if (o) {
1024
+ for (let v of c)
1025
+ queueMicrotask(() => {
1026
+ throw v;
1027
+ });
1028
+ throw o;
1029
+ }
1030
+ } finally {
1031
+ t.__root = e, delete t.currentTarget, F(_), j(h);
1032
+ }
1033
+ }
1034
+ }
1035
+ function Ar(t) {
1036
+ var e = document.createElement("template");
1037
+ return e.innerHTML = t.replaceAll("<!>", "<!---->"), e.content;
1038
+ }
1039
+ function kr(t, e) {
1040
+ var r = (
1041
+ /** @type {Effect} */
1042
+ p
1043
+ );
1044
+ r.nodes_start === null && (r.nodes_start = t, r.nodes_end = e);
1045
+ }
1046
+ // @__NO_SIDE_EFFECTS__
1047
+ function Tr(t, e) {
1048
+ var r = (e & Te) !== 0, n, l = !t.startsWith("<!>");
1049
+ return () => {
1050
+ n === void 0 && (n = Ar(l ? t : "<!>" + t), n = /** @type {Node} */
1051
+ /* @__PURE__ */ ue(n));
1052
+ var u = (
1053
+ /** @type {TemplateNode} */
1054
+ r || tr ? document.importNode(n, !0) : n.cloneNode(!0)
1055
+ );
1056
+ return kr(u, u), u;
1057
+ };
1058
+ }
1059
+ function Sr(t, e) {
1060
+ t !== null && t.before(
1061
+ /** @type {Node} */
1062
+ e
1063
+ );
1064
+ }
1065
+ function mr(t) {
1066
+ return t.endsWith("capture") && t !== "gotpointercapture" && t !== "lostpointercapture";
1067
+ }
1068
+ const Or = [
1069
+ "beforeinput",
1070
+ "click",
1071
+ "change",
1072
+ "dblclick",
1073
+ "contextmenu",
1074
+ "focusin",
1075
+ "focusout",
1076
+ "input",
1077
+ "keydown",
1078
+ "keyup",
1079
+ "mousedown",
1080
+ "mousemove",
1081
+ "mouseout",
1082
+ "mouseover",
1083
+ "mouseup",
1084
+ "pointerdown",
1085
+ "pointermove",
1086
+ "pointerout",
1087
+ "pointerover",
1088
+ "pointerup",
1089
+ "touchend",
1090
+ "touchmove",
1091
+ "touchstart"
1092
+ ];
1093
+ function Nr(t) {
1094
+ return Or.includes(t);
1095
+ }
1096
+ const Cr = {
1097
+ // no `class: 'className'` because we handle that separately
1098
+ formnovalidate: "formNoValidate",
1099
+ ismap: "isMap",
1100
+ nomodule: "noModule",
1101
+ playsinline: "playsInline",
1102
+ readonly: "readOnly",
1103
+ defaultvalue: "defaultValue",
1104
+ defaultchecked: "defaultChecked",
1105
+ srcobject: "srcObject",
1106
+ novalidate: "noValidate",
1107
+ allowfullscreen: "allowFullscreen",
1108
+ disablepictureinpicture: "disablePictureInPicture",
1109
+ disableremoteplayback: "disableRemotePlayback"
1110
+ };
1111
+ function Rr(t) {
1112
+ return t = t.toLowerCase(), Cr[t] ?? t;
1113
+ }
1114
+ function Ir(t, e) {
1115
+ var r = e == null ? "" : typeof e == "object" ? e + "" : e;
1116
+ r !== (t.__t ??= t.nodeValue) && (t.__t = r, t.nodeValue = r + "");
1117
+ }
1118
+ function Lr(t, e) {
1119
+ var r = void 0, n;
1120
+ fe(() => {
1121
+ r !== (r = e()) && (n && (B(n), n = null), r && (n = se(() => {
1122
+ ie(() => (
1123
+ /** @type {(node: Element) => void} */
1124
+ r(t)
1125
+ ));
1126
+ })));
1127
+ });
1128
+ }
1129
+ function be(t) {
1130
+ var e, r, n = "";
1131
+ if (typeof t == "string" || typeof t == "number") n += t;
1132
+ else if (typeof t == "object") if (Array.isArray(t)) {
1133
+ var l = t.length;
1134
+ for (e = 0; e < l; e++) t[e] && (r = be(t[e])) && (n && (n += " "), n += r);
1135
+ } else for (r in t) t[r] && (n && (n += " "), n += r);
1136
+ return n;
1137
+ }
1138
+ function Pr() {
1139
+ for (var t, e, r = 0, n = "", l = arguments.length; r < l; r++) (t = arguments[r]) && (e = be(t)) && (n && (n += " "), n += e);
1140
+ return n;
1141
+ }
1142
+ function Mr(t) {
1143
+ return typeof t == "object" ? Pr(t) : t ?? "";
1144
+ }
1145
+ const jt = [...`
1146
+ \r\f \v\uFEFF`];
1147
+ function Dr(t, e, r) {
1148
+ var n = t == null ? "" : "" + t;
1149
+ if (r) {
1150
+ for (var l in r)
1151
+ if (r[l])
1152
+ n = n ? n + " " + l : l;
1153
+ else if (n.length)
1154
+ for (var u = l.length, i = 0; (i = n.indexOf(l, i)) >= 0; ) {
1155
+ var s = i + u;
1156
+ (i === 0 || jt.includes(n[i - 1])) && (s === n.length || jt.includes(n[s])) ? n = (i === 0 ? "" : n.substring(0, i)) + n.substring(s + 1) : i = s;
1157
+ }
1158
+ }
1159
+ return n === "" ? null : n;
1160
+ }
1161
+ function Vt(t, e = !1) {
1162
+ var r = e ? " !important;" : ";", n = "";
1163
+ for (var l in t) {
1164
+ var u = t[l];
1165
+ u != null && u !== "" && (n += " " + l + ": " + u + r);
1166
+ }
1167
+ return n;
1168
+ }
1169
+ function dt(t) {
1170
+ return t[0] !== "-" || t[1] !== "-" ? t.toLowerCase() : t;
1171
+ }
1172
+ function Fr(t, e) {
1173
+ if (e) {
1174
+ var r = "", n, l;
1175
+ if (Array.isArray(e) ? (n = e[0], l = e[1]) : n = e, t) {
1176
+ t = String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g, "").trim();
1177
+ var u = !1, i = 0, s = !1, f = [];
1178
+ n && f.push(...Object.keys(n).map(dt)), l && f.push(...Object.keys(l).map(dt));
1179
+ var a = 0, _ = -1;
1180
+ const b = t.length;
1181
+ for (var h = 0; h < b; h++) {
1182
+ var o = t[h];
1183
+ if (s ? o === "/" && t[h - 1] === "*" && (s = !1) : u ? u === o && (u = !1) : o === "/" && t[h + 1] === "*" ? s = !0 : o === '"' || o === "'" ? u = o : o === "(" ? i++ : o === ")" && i--, !s && u === !1 && i === 0) {
1184
+ if (o === ":" && _ === -1)
1185
+ _ = h;
1186
+ else if (o === ";" || h === b - 1) {
1187
+ if (_ !== -1) {
1188
+ var c = dt(t.substring(a, _).trim());
1189
+ if (!f.includes(c)) {
1190
+ o !== ";" && h++;
1191
+ var w = t.substring(a, h).trim();
1192
+ r += " " + w + ";";
1193
+ }
1194
+ }
1195
+ a = h + 1, _ = -1;
1196
+ }
1197
+ }
1198
+ }
1199
+ }
1200
+ return n && (r += Vt(n)), l && (r += Vt(l, !0)), r = r.trim(), r === "" ? null : r;
1201
+ }
1202
+ return t == null ? null : String(t);
1203
+ }
1204
+ function jr(t, e, r, n, l, u) {
1205
+ var i = t.__className;
1206
+ if (i !== r || i === void 0) {
1207
+ var s = Dr(r, n, u);
1208
+ s == null ? t.removeAttribute("class") : e ? t.className = s : t.setAttribute("class", s), t.__className = r;
1209
+ } else if (u && l !== u)
1210
+ for (var f in u) {
1211
+ var a = !!u[f];
1212
+ (l == null || a !== !!l[f]) && t.classList.toggle(f, a);
1213
+ }
1214
+ return u;
1215
+ }
1216
+ function bt(t, e = {}, r, n) {
1217
+ for (var l in r) {
1218
+ var u = r[l];
1219
+ e[l] !== u && (r[l] == null ? t.style.removeProperty(l) : t.style.setProperty(l, u, n));
1220
+ }
1221
+ }
1222
+ function Vr(t, e, r, n) {
1223
+ var l = t.__style;
1224
+ if (l !== e) {
1225
+ var u = Fr(e, n);
1226
+ u == null ? t.removeAttribute("style") : t.style.cssText = u, t.__style = e;
1227
+ } else n && (Array.isArray(n) ? (bt(t, r?.[0], n[0]), bt(t, r?.[1], n[1], "important")) : bt(t, r, n));
1228
+ return n;
1229
+ }
1230
+ function yt(t, e, r = !1) {
1231
+ if (t.multiple) {
1232
+ if (e == null)
1233
+ return;
1234
+ if (!Ht(e))
1235
+ return Ve();
1236
+ for (var n of t.options)
1237
+ n.selected = e.includes(qt(n));
1238
+ return;
1239
+ }
1240
+ for (n of t.options) {
1241
+ var l = qt(n);
1242
+ if (Xe(l, e)) {
1243
+ n.selected = !0;
1244
+ return;
1245
+ }
1246
+ }
1247
+ (!r || e !== void 0) && (t.selectedIndex = -1);
1248
+ }
1249
+ function qr(t) {
1250
+ var e = new MutationObserver(() => {
1251
+ yt(t, t.__value);
1252
+ });
1253
+ e.observe(t, {
1254
+ // Listen to option element changes
1255
+ childList: !0,
1256
+ subtree: !0,
1257
+ // because of <optgroup>
1258
+ // Listen to option element value attribute changes
1259
+ // (doesn't get notified of select value changes,
1260
+ // because that property is not reflected as an attribute)
1261
+ attributes: !0,
1262
+ attributeFilter: ["value"]
1263
+ }), fr(() => {
1264
+ e.disconnect();
1265
+ });
1266
+ }
1267
+ function qt(t) {
1268
+ return "__value" in t ? t.__value : t.value;
1269
+ }
1270
+ const Z = Symbol("class"), J = Symbol("style"), ge = Symbol("is custom element"), we = Symbol("is html");
1271
+ function Ur(t, e) {
1272
+ e ? t.hasAttribute("selected") || t.setAttribute("selected", "") : t.removeAttribute("selected");
1273
+ }
1274
+ function Ut(t, e, r, n) {
1275
+ var l = Ee(t);
1276
+ l[e] !== (l[e] = r) && (e === "loading" && (t[Me] = r), r == null ? t.removeAttribute(e) : typeof r != "string" && ye(t).includes(e) ? t[e] = r : t.setAttribute(e, r));
1277
+ }
1278
+ function Br(t, e, r, n, l = !1) {
1279
+ var u = Ee(t), i = u[ge], s = !u[we], f = e || {}, a = t.tagName === "OPTION";
1280
+ for (var _ in e)
1281
+ _ in r || (r[_] = null);
1282
+ r.class ? r.class = Mr(r.class) : r[Z] && (r.class = null), r[J] && (r.style ??= null);
1283
+ var h = ye(t);
1284
+ for (const v in r) {
1285
+ let g = r[v];
1286
+ if (a && v === "value" && g == null) {
1287
+ t.value = t.__value = "", f[v] = g;
1288
+ continue;
1289
+ }
1290
+ if (v === "class") {
1291
+ var o = t.namespaceURI === "http://www.w3.org/1999/xhtml";
1292
+ jr(t, o, g, n, e?.[Z], r[Z]), f[v] = g, f[Z] = r[Z];
1293
+ continue;
1294
+ }
1295
+ if (v === "style") {
1296
+ Vr(t, g, e?.[J], r[J]), f[v] = g, f[J] = r[J];
1297
+ continue;
1298
+ }
1299
+ var c = f[v];
1300
+ if (!(g === c && !(g === void 0 && t.hasAttribute(v)))) {
1301
+ f[v] = g;
1302
+ var w = v[0] + v[1];
1303
+ if (w !== "$$")
1304
+ if (w === "on") {
1305
+ const S = {}, Y = "$$" + v;
1306
+ let y = v.slice(2);
1307
+ var b = Nr(y);
1308
+ if (mr(y) && (y = y.slice(0, -7), S.capture = !0), !b && c) {
1309
+ if (g != null) continue;
1310
+ t.removeEventListener(y, f[Y], S), f[Y] = null;
1311
+ }
1312
+ if (g != null)
1313
+ if (b)
1314
+ t[`__${y}`] = g, Er([y]);
1315
+ else {
1316
+ let Ae = function(ke) {
1317
+ f[v].call(this, ke);
1318
+ };
1319
+ f[Y] = wr(y, t, Ae, S);
1320
+ }
1321
+ else b && (t[`__${y}`] = void 0);
1322
+ } else if (v === "style")
1323
+ Ut(t, v, g);
1324
+ else if (v === "autofocus")
1325
+ ur(
1326
+ /** @type {HTMLElement} */
1327
+ t,
1328
+ !!g
1329
+ );
1330
+ else if (!i && (v === "__value" || v === "value" && g != null))
1331
+ t.value = t.__value = g;
1332
+ else if (v === "selected" && a)
1333
+ Ur(
1334
+ /** @type {HTMLOptionElement} */
1335
+ t,
1336
+ g
1337
+ );
1338
+ else {
1339
+ var E = v;
1340
+ s || (E = Rr(E));
1341
+ var nt = E === "defaultValue" || E === "defaultChecked";
1342
+ if (g == null && !i && !nt)
1343
+ if (u[v] = null, E === "value" || E === "checked") {
1344
+ let S = (
1345
+ /** @type {HTMLInputElement} */
1346
+ t
1347
+ );
1348
+ const Y = e === void 0;
1349
+ if (E === "value") {
1350
+ let y = S.defaultValue;
1351
+ S.removeAttribute(E), S.defaultValue = y, S.value = S.__value = Y ? y : null;
1352
+ } else {
1353
+ let y = S.defaultChecked;
1354
+ S.removeAttribute(E), S.defaultChecked = y, S.checked = Y ? y : !1;
1355
+ }
1356
+ } else
1357
+ t.removeAttribute(v);
1358
+ else nt || h.includes(E) && (i || typeof g != "string") ? (t[E] = g, E in u && (u[E] = vt)) : typeof g != "function" && Ut(t, E, g);
1359
+ }
1360
+ }
1361
+ }
1362
+ return f;
1363
+ }
1364
+ function xr(t, e, r = [], n = [], l, u = !1) {
1365
+ ee(r, n, (i) => {
1366
+ var s = void 0, f = {}, a = t.nodeName === "SELECT", _ = !1;
1367
+ if (fe(() => {
1368
+ var o = e(...i.map(ct)), c = Br(t, s, o, l, u);
1369
+ _ && a && "value" in o && yt(
1370
+ /** @type {HTMLSelectElement} */
1371
+ t,
1372
+ o.value
1373
+ );
1374
+ for (let b of Object.getOwnPropertySymbols(f))
1375
+ o[b] || B(f[b]);
1376
+ for (let b of Object.getOwnPropertySymbols(o)) {
1377
+ var w = o[b];
1378
+ b.description === me && (!s || w !== s[b]) && (f[b] && B(f[b]), f[b] = se(() => Lr(t, () => w))), c[b] = w;
1379
+ }
1380
+ s = c;
1381
+ }), a) {
1382
+ var h = (
1383
+ /** @type {HTMLSelectElement} */
1384
+ t
1385
+ );
1386
+ ie(() => {
1387
+ yt(
1388
+ h,
1389
+ /** @type {Record<string | symbol, any>} */
1390
+ s.value,
1391
+ !0
1392
+ ), qr(h);
1393
+ });
1394
+ }
1395
+ _ = !0;
1396
+ });
1397
+ }
1398
+ function Ee(t) {
1399
+ return (
1400
+ /** @type {Record<string | symbol, unknown>} **/
1401
+ // @ts-expect-error
1402
+ t.__attributes ??= {
1403
+ [ge]: t.nodeName.includes("-"),
1404
+ [we]: t.namespaceURI === Se
1405
+ }
1406
+ );
1407
+ }
1408
+ var Bt = /* @__PURE__ */ new Map();
1409
+ function ye(t) {
1410
+ var e = t.getAttribute("is") || t.nodeName, r = Bt.get(e);
1411
+ if (r) return r;
1412
+ Bt.set(e, r = []);
1413
+ for (var n, l = t, u = Element.prototype; u !== l; ) {
1414
+ n = Ne(l);
1415
+ for (var i in n)
1416
+ n[i].set && r.push(i);
1417
+ l = Ce(l);
1418
+ }
1419
+ return r;
1420
+ }
1421
+ const Yr = {
1422
+ get(t, e) {
1423
+ if (!t.exclude.includes(e))
1424
+ return t.props[e];
1425
+ },
1426
+ set(t, e) {
1427
+ return !1;
1428
+ },
1429
+ getOwnPropertyDescriptor(t, e) {
1430
+ if (!t.exclude.includes(e) && e in t.props)
1431
+ return {
1432
+ enumerable: !0,
1433
+ configurable: !0,
1434
+ value: t.props[e]
1435
+ };
1436
+ },
1437
+ has(t, e) {
1438
+ return t.exclude.includes(e) ? !1 : e in t.props;
1439
+ },
1440
+ ownKeys(t) {
1441
+ return Reflect.ownKeys(t.props).filter((e) => !t.exclude.includes(e));
1442
+ }
1443
+ };
1444
+ // @__NO_SIDE_EFFECTS__
1445
+ function Hr(t, e, r) {
1446
+ return new Proxy(
1447
+ { props: t, exclude: e },
1448
+ Yr
1449
+ );
1450
+ }
1451
+ function xt(t, e, r, n) {
1452
+ var l = (
1453
+ /** @type {V} */
1454
+ n
1455
+ ), u = !0, i = () => (u && (u = !1, l = /** @type {V} */
1456
+ n), l), s;
1457
+ s = /** @type {V} */
1458
+ t[e], s === void 0 && n !== void 0 && (s = i());
1459
+ var f;
1460
+ return f = () => {
1461
+ var a = (
1462
+ /** @type {V} */
1463
+ t[e]
1464
+ );
1465
+ return a === void 0 ? i() : (u = !0, a);
1466
+ }, f;
1467
+ }
1468
+ var Wr = /* @__PURE__ */ Tr("<button> </button>");
1469
+ function zr(t, e) {
1470
+ Ue(e, !0);
1471
+ const r = xt(e, "primary", 3, !1), n = xt(e, "size", 3, "medium"), l = /* @__PURE__ */ Hr(e, [
1472
+ "$$slots",
1473
+ "$$events",
1474
+ "$$legacy",
1475
+ "primary",
1476
+ "backgroundColor",
1477
+ "size",
1478
+ "label"
1479
+ ]);
1480
+ let u = /* @__PURE__ */ Ct(() => r() ? "storybook-button--primary" : "storybook-button--secondary"), i = /* @__PURE__ */ Ct(() => e.backgroundColor ? `background-color: ${e.backgroundColor}` : "");
1481
+ var s = Wr();
1482
+ xr(s, (a) => ({ type: "button", class: a, style: ct(i), ...l }), [
1483
+ () => [
1484
+ "storybook-button",
1485
+ `storybook-button--${n()}`,
1486
+ ct(u)
1487
+ ].join(" ")
1488
+ ]);
1489
+ var f = lr(s);
1490
+ or(() => Ir(f, e.label)), Sr(t, s), Be();
1491
+ }
1492
+ export {
1493
+ zr as Button
1494
+ };