svelte-origin 0.0.0 → 1.0.0-next.15

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.

Potentially problematic release.


This version of svelte-origin might be problematic. Click here for more details.

@@ -0,0 +1,3665 @@
1
+ // src/runtime/attrs.ts
2
+ function bindable(defaultValue) {
3
+ return {
4
+ __bindable: true,
5
+ default: defaultValue
6
+ };
7
+ }
8
+ function isBindable(value) {
9
+ return value !== null && typeof value === "object" && "__bindable" in value && value.__bindable === true;
10
+ }
11
+ function extractAttrSchema(attrsDefinition) {
12
+ const schema = {};
13
+ for (const [key, value] of Object.entries(attrsDefinition)) {
14
+ if (isBindable(value)) {
15
+ schema[key] = {
16
+ default: value.default,
17
+ bindable: true,
18
+ hasDefault: value.default !== undefined
19
+ };
20
+ } else {
21
+ schema[key] = {
22
+ default: value,
23
+ bindable: false,
24
+ hasDefault: value !== undefined
25
+ };
26
+ }
27
+ }
28
+ return schema;
29
+ }
30
+ function applyDefaults(schema, inputAttrs) {
31
+ const target = inputAttrs && typeof inputAttrs === "object" ? inputAttrs : {};
32
+ return new Proxy(target, {
33
+ get(target2, prop) {
34
+ if (typeof prop === "symbol") {
35
+ return target2[prop];
36
+ }
37
+ const value = target2[prop];
38
+ if (value === undefined && prop in schema && schema[prop].hasDefault) {
39
+ return schema[prop].default;
40
+ }
41
+ return value;
42
+ },
43
+ set(target2, prop, value) {
44
+ target2[prop] = value;
45
+ return true;
46
+ },
47
+ has(target2, prop) {
48
+ if (typeof prop === "symbol") {
49
+ return prop in target2;
50
+ }
51
+ return prop in target2 || prop in schema;
52
+ },
53
+ ownKeys(target2) {
54
+ const targetKeys = Reflect.ownKeys(target2);
55
+ const schemaKeys = Object.keys(schema);
56
+ return [...new Set([...targetKeys, ...schemaKeys])];
57
+ },
58
+ getOwnPropertyDescriptor(target2, prop) {
59
+ if (typeof prop === "symbol") {
60
+ return Object.getOwnPropertyDescriptor(target2, prop);
61
+ }
62
+ if (prop in target2) {
63
+ return Object.getOwnPropertyDescriptor(target2, prop);
64
+ }
65
+ if (prop in schema) {
66
+ return {
67
+ configurable: true,
68
+ enumerable: true,
69
+ value: schema[prop].hasDefault ? schema[prop].default : undefined
70
+ };
71
+ }
72
+ return;
73
+ }
74
+ });
75
+ }
76
+ function generateAttrKeys(schema) {
77
+ return Object.keys(schema);
78
+ }
79
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/constants.js
80
+ var EACH_INDEX_REACTIVE = 1 << 1;
81
+ var EACH_IS_CONTROLLED = 1 << 2;
82
+ var EACH_IS_ANIMATED = 1 << 3;
83
+ var EACH_ITEM_IMMUTABLE = 1 << 4;
84
+ var PROPS_IS_RUNES = 1 << 1;
85
+ var PROPS_IS_UPDATED = 1 << 2;
86
+ var PROPS_IS_BINDABLE = 1 << 3;
87
+ var PROPS_IS_LAZY_INITIAL = 1 << 4;
88
+ var TRANSITION_OUT = 1 << 1;
89
+ var TRANSITION_GLOBAL = 1 << 2;
90
+ var TEMPLATE_USE_IMPORT_NODE = 1 << 1;
91
+ var TEMPLATE_USE_SVG = 1 << 2;
92
+ var TEMPLATE_USE_MATHML = 1 << 3;
93
+ var HYDRATION_START = "[";
94
+ var HYDRATION_START_ELSE = "[!";
95
+ var HYDRATION_END = "]";
96
+ var HYDRATION_ERROR = {};
97
+ var ELEMENT_PRESERVE_ATTRIBUTE_CASE = 1 << 1;
98
+ var ELEMENT_IS_INPUT = 1 << 2;
99
+ var UNINITIALIZED = Symbol();
100
+ var FILENAME = Symbol("filename");
101
+ var HMR = Symbol("hmr");
102
+ var ATTACHMENT_KEY = "@attach";
103
+ // ../../node_modules/.bun/esm-env@1.2.2/node_modules/esm-env/false.js
104
+ var false_default = false;
105
+ // ../../node_modules/.bun/esm-env@1.2.2/node_modules/esm-env/true.js
106
+ var true_default = true;
107
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/errors.js
108
+ function derived_references_self() {
109
+ if (true_default) {
110
+ const error = new Error(`derived_references_self
111
+ A derived value cannot reference itself recursively
112
+ https://svelte.dev/e/derived_references_self`);
113
+ error.name = "Svelte error";
114
+ throw error;
115
+ } else {
116
+ throw new Error(`https://svelte.dev/e/derived_references_self`);
117
+ }
118
+ }
119
+ function effect_update_depth_exceeded() {
120
+ if (true_default) {
121
+ const error = new Error(`effect_update_depth_exceeded
122
+ Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
123
+ https://svelte.dev/e/effect_update_depth_exceeded`);
124
+ error.name = "Svelte error";
125
+ throw error;
126
+ } else {
127
+ throw new Error(`https://svelte.dev/e/effect_update_depth_exceeded`);
128
+ }
129
+ }
130
+ function hydration_failed() {
131
+ if (true_default) {
132
+ const error = new Error(`hydration_failed
133
+ Failed to hydrate the application
134
+ https://svelte.dev/e/hydration_failed`);
135
+ error.name = "Svelte error";
136
+ throw error;
137
+ } else {
138
+ throw new Error(`https://svelte.dev/e/hydration_failed`);
139
+ }
140
+ }
141
+ function rune_outside_svelte(rune) {
142
+ if (true_default) {
143
+ const error = new Error(`rune_outside_svelte
144
+ The \`${rune}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files
145
+ https://svelte.dev/e/rune_outside_svelte`);
146
+ error.name = "Svelte error";
147
+ throw error;
148
+ } else {
149
+ throw new Error(`https://svelte.dev/e/rune_outside_svelte`);
150
+ }
151
+ }
152
+ function state_descriptors_fixed() {
153
+ if (true_default) {
154
+ const error = new Error(`state_descriptors_fixed
155
+ Property descriptors defined on \`$state\` objects must contain \`value\` and always be \`enumerable\`, \`configurable\` and \`writable\`.
156
+ https://svelte.dev/e/state_descriptors_fixed`);
157
+ error.name = "Svelte error";
158
+ throw error;
159
+ } else {
160
+ throw new Error(`https://svelte.dev/e/state_descriptors_fixed`);
161
+ }
162
+ }
163
+ function state_prototype_fixed() {
164
+ if (true_default) {
165
+ const error = new Error(`state_prototype_fixed
166
+ Cannot set prototype of \`$state\` object
167
+ https://svelte.dev/e/state_prototype_fixed`);
168
+ error.name = "Svelte error";
169
+ throw error;
170
+ } else {
171
+ throw new Error(`https://svelte.dev/e/state_prototype_fixed`);
172
+ }
173
+ }
174
+ function state_unsafe_mutation() {
175
+ if (true_default) {
176
+ const error = new Error(`state_unsafe_mutation
177
+ Updating state inside \`$derived(...)\`, \`$inspect(...)\` or a template expression is forbidden. If the value should not be reactive, declare it without \`$state\`
178
+ https://svelte.dev/e/state_unsafe_mutation`);
179
+ error.name = "Svelte error";
180
+ throw error;
181
+ } else {
182
+ throw new Error(`https://svelte.dev/e/state_unsafe_mutation`);
183
+ }
184
+ }
185
+ function svelte_boundary_reset_onerror() {
186
+ if (true_default) {
187
+ const error = new Error(`svelte_boundary_reset_onerror
188
+ A \`<svelte:boundary>\` \`reset\` function cannot be called while an error is still being handled
189
+ https://svelte.dev/e/svelte_boundary_reset_onerror`);
190
+ error.name = "Svelte error";
191
+ throw error;
192
+ } else {
193
+ throw new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);
194
+ }
195
+ }
196
+
197
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/shared/utils.js
198
+ var is_array = Array.isArray;
199
+ var index_of = Array.prototype.indexOf;
200
+ var array_from = Array.from;
201
+ var object_keys = Object.keys;
202
+ var define_property = Object.defineProperty;
203
+ var get_descriptor = Object.getOwnPropertyDescriptor;
204
+ var object_prototype = Object.prototype;
205
+ var array_prototype = Array.prototype;
206
+ var get_prototype_of = Object.getPrototypeOf;
207
+ var is_extensible = Object.isExtensible;
208
+ var noop = () => {};
209
+ function run_all(arr) {
210
+ for (var i = 0;i < arr.length; i++) {
211
+ arr[i]();
212
+ }
213
+ }
214
+ function deferred() {
215
+ var resolve;
216
+ var reject;
217
+ var promise = new Promise((res, rej) => {
218
+ resolve = res;
219
+ reject = rej;
220
+ });
221
+ return { promise, resolve, reject };
222
+ }
223
+
224
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/constants.js
225
+ var DERIVED = 1 << 1;
226
+ var EFFECT = 1 << 2;
227
+ var RENDER_EFFECT = 1 << 3;
228
+ var MANAGED_EFFECT = 1 << 24;
229
+ var BLOCK_EFFECT = 1 << 4;
230
+ var BRANCH_EFFECT = 1 << 5;
231
+ var ROOT_EFFECT = 1 << 6;
232
+ var BOUNDARY_EFFECT = 1 << 7;
233
+ var CONNECTED = 1 << 9;
234
+ var CLEAN = 1 << 10;
235
+ var DIRTY = 1 << 11;
236
+ var MAYBE_DIRTY = 1 << 12;
237
+ var INERT = 1 << 13;
238
+ var DESTROYED = 1 << 14;
239
+ var EFFECT_RAN = 1 << 15;
240
+ var EFFECT_TRANSPARENT = 1 << 16;
241
+ var EAGER_EFFECT = 1 << 17;
242
+ var HEAD_EFFECT = 1 << 18;
243
+ var EFFECT_PRESERVED = 1 << 19;
244
+ var USER_EFFECT = 1 << 20;
245
+ var EFFECT_OFFSCREEN = 1 << 25;
246
+ var WAS_MARKED = 1 << 15;
247
+ var REACTION_IS_UPDATING = 1 << 21;
248
+ var ASYNC = 1 << 22;
249
+ var ERROR_VALUE = 1 << 23;
250
+ var STATE_SYMBOL = Symbol("$state");
251
+ var LEGACY_PROPS = Symbol("legacy props");
252
+ var LOADING_ATTR_SYMBOL = Symbol("");
253
+ var PROXY_PATH_SYMBOL = Symbol("proxy path");
254
+ var STALE_REACTION = new class StaleReactionError extends Error {
255
+ name = "StaleReactionError";
256
+ message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
257
+ };
258
+ var COMMENT_NODE = 8;
259
+
260
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/warnings.js
261
+ var bold = "font-weight: bold";
262
+ var normal = "font-weight: normal";
263
+ function hydration_mismatch(location) {
264
+ if (true_default) {
265
+ console.warn(`%c[svelte] hydration_mismatch
266
+ %c${location ? `Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${location}` : "Hydration failed because the initial UI does not match what was rendered on the server"}
267
+ https://svelte.dev/e/hydration_mismatch`, bold, normal);
268
+ } else {
269
+ console.warn(`https://svelte.dev/e/hydration_mismatch`);
270
+ }
271
+ }
272
+ function lifecycle_double_unmount() {
273
+ if (true_default) {
274
+ console.warn(`%c[svelte] lifecycle_double_unmount
275
+ %cTried to unmount a component that was not mounted
276
+ https://svelte.dev/e/lifecycle_double_unmount`, bold, normal);
277
+ } else {
278
+ console.warn(`https://svelte.dev/e/lifecycle_double_unmount`);
279
+ }
280
+ }
281
+ function state_proxy_equality_mismatch(operator) {
282
+ if (true_default) {
283
+ console.warn(`%c[svelte] state_proxy_equality_mismatch
284
+ %cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${operator}\` will produce unexpected results
285
+ https://svelte.dev/e/state_proxy_equality_mismatch`, bold, normal);
286
+ } else {
287
+ console.warn(`https://svelte.dev/e/state_proxy_equality_mismatch`);
288
+ }
289
+ }
290
+ function state_proxy_unmount() {
291
+ if (true_default) {
292
+ console.warn(`%c[svelte] state_proxy_unmount
293
+ %cTried to unmount a state proxy, rather than a component
294
+ https://svelte.dev/e/state_proxy_unmount`, bold, normal);
295
+ } else {
296
+ console.warn(`https://svelte.dev/e/state_proxy_unmount`);
297
+ }
298
+ }
299
+ function svelte_boundary_reset_noop() {
300
+ if (true_default) {
301
+ console.warn(`%c[svelte] svelte_boundary_reset_noop
302
+ %cA \`<svelte:boundary>\` \`reset\` function only resets the boundary the first time it is called
303
+ https://svelte.dev/e/svelte_boundary_reset_noop`, bold, normal);
304
+ } else {
305
+ console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`);
306
+ }
307
+ }
308
+
309
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/dom/hydration.js
310
+ var hydrating = false;
311
+ function set_hydrating(value) {
312
+ hydrating = value;
313
+ }
314
+ var hydrate_node;
315
+ function set_hydrate_node(node) {
316
+ if (node === null) {
317
+ hydration_mismatch();
318
+ throw HYDRATION_ERROR;
319
+ }
320
+ return hydrate_node = node;
321
+ }
322
+ function hydrate_next() {
323
+ return set_hydrate_node(get_next_sibling(hydrate_node));
324
+ }
325
+ function next(count = 1) {
326
+ if (hydrating) {
327
+ var i = count;
328
+ var node = hydrate_node;
329
+ while (i--) {
330
+ node = get_next_sibling(node);
331
+ }
332
+ hydrate_node = node;
333
+ }
334
+ }
335
+ function skip_nodes(remove = true) {
336
+ var depth = 0;
337
+ var node = hydrate_node;
338
+ while (true) {
339
+ if (node.nodeType === COMMENT_NODE) {
340
+ var data = node.data;
341
+ if (data === HYDRATION_END) {
342
+ if (depth === 0)
343
+ return node;
344
+ depth -= 1;
345
+ } else if (data === HYDRATION_START || data === HYDRATION_START_ELSE) {
346
+ depth += 1;
347
+ }
348
+ }
349
+ var next2 = get_next_sibling(node);
350
+ if (remove)
351
+ node.remove();
352
+ node = next2;
353
+ }
354
+ }
355
+
356
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/reactivity/equality.js
357
+ function equals(value) {
358
+ return value === this.v;
359
+ }
360
+ function safe_not_equal(a, b) {
361
+ return a != a ? b == b : a !== b || a !== null && typeof a === "object" || typeof a === "function";
362
+ }
363
+ function safe_equals(value) {
364
+ return !safe_not_equal(value, this.v);
365
+ }
366
+
367
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/flags/index.js
368
+ var async_mode_flag = false;
369
+ var legacy_mode_flag = false;
370
+ var tracing_mode_flag = false;
371
+
372
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/dev/tracing.js
373
+ var tracing_expressions = null;
374
+ function tag(source, label) {
375
+ source.label = label;
376
+ tag_proxy(source.v, label);
377
+ return source;
378
+ }
379
+ function tag_proxy(value, label) {
380
+ value?.[PROXY_PATH_SYMBOL]?.(label);
381
+ return value;
382
+ }
383
+
384
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/shared/dev.js
385
+ function get_error(label) {
386
+ const error = new Error;
387
+ const stack = get_stack();
388
+ if (stack.length === 0) {
389
+ return null;
390
+ }
391
+ stack.unshift(`
392
+ `);
393
+ define_property(error, "stack", {
394
+ value: stack.join(`
395
+ `)
396
+ });
397
+ define_property(error, "name", {
398
+ value: label
399
+ });
400
+ return error;
401
+ }
402
+ function get_stack() {
403
+ const limit = Error.stackTraceLimit;
404
+ Error.stackTraceLimit = Infinity;
405
+ const stack = new Error().stack;
406
+ Error.stackTraceLimit = limit;
407
+ if (!stack)
408
+ return [];
409
+ const lines = stack.split(`
410
+ `);
411
+ const new_lines = [];
412
+ for (let i = 0;i < lines.length; i++) {
413
+ const line = lines[i];
414
+ const posixified = line.replaceAll("\\", "/");
415
+ if (line.trim() === "Error") {
416
+ continue;
417
+ }
418
+ if (line.includes("validate_each_keys")) {
419
+ return [];
420
+ }
421
+ if (posixified.includes("svelte/src/internal") || posixified.includes("node_modules/.vite")) {
422
+ continue;
423
+ }
424
+ new_lines.push(line);
425
+ }
426
+ return new_lines;
427
+ }
428
+
429
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/dom/task.js
430
+ var micro_tasks = [];
431
+ function run_micro_tasks() {
432
+ var tasks = micro_tasks;
433
+ micro_tasks = [];
434
+ run_all(tasks);
435
+ }
436
+ function queue_micro_task(fn) {
437
+ if (micro_tasks.length === 0 && !is_flushing_sync) {
438
+ var tasks = micro_tasks;
439
+ queueMicrotask(() => {
440
+ if (tasks === micro_tasks)
441
+ run_micro_tasks();
442
+ });
443
+ }
444
+ micro_tasks.push(fn);
445
+ }
446
+ function flush_tasks() {
447
+ while (micro_tasks.length > 0) {
448
+ run_micro_tasks();
449
+ }
450
+ }
451
+
452
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/error-handling.js
453
+ var adjustments = new WeakMap;
454
+ function handle_error(error) {
455
+ var effect = active_effect;
456
+ if (effect === null) {
457
+ active_reaction.f |= ERROR_VALUE;
458
+ return error;
459
+ }
460
+ if (true_default && error instanceof Error && !adjustments.has(error)) {
461
+ adjustments.set(error, get_adjustments(error, effect));
462
+ }
463
+ if ((effect.f & EFFECT_RAN) === 0) {
464
+ if ((effect.f & BOUNDARY_EFFECT) === 0) {
465
+ if (true_default && !effect.parent && error instanceof Error) {
466
+ apply_adjustments(error);
467
+ }
468
+ throw error;
469
+ }
470
+ effect.b.error(error);
471
+ } else {
472
+ invoke_error_boundary(error, effect);
473
+ }
474
+ }
475
+ function invoke_error_boundary(error, effect) {
476
+ while (effect !== null) {
477
+ if ((effect.f & BOUNDARY_EFFECT) !== 0) {
478
+ try {
479
+ effect.b.error(error);
480
+ return;
481
+ } catch (e) {
482
+ error = e;
483
+ }
484
+ }
485
+ effect = effect.parent;
486
+ }
487
+ if (true_default && error instanceof Error) {
488
+ apply_adjustments(error);
489
+ }
490
+ throw error;
491
+ }
492
+ function get_adjustments(error, effect) {
493
+ const message_descriptor = get_descriptor(error, "message");
494
+ if (message_descriptor && !message_descriptor.configurable)
495
+ return;
496
+ var indent = is_firefox ? " " : "\t";
497
+ var component_stack = `
498
+ ${indent}in ${effect.fn?.name || "<unknown>"}`;
499
+ var context = effect.ctx;
500
+ while (context !== null) {
501
+ component_stack += `
502
+ ${indent}in ${context.function?.[FILENAME].split("/").pop()}`;
503
+ context = context.p;
504
+ }
505
+ return {
506
+ message: error.message + `
507
+ ${component_stack}
508
+ `,
509
+ stack: error.stack?.split(`
510
+ `).filter((line) => !line.includes("svelte/src/internal")).join(`
511
+ `)
512
+ };
513
+ }
514
+ function apply_adjustments(error) {
515
+ const adjusted = adjustments.get(error);
516
+ if (adjusted) {
517
+ define_property(error, "message", {
518
+ value: adjusted.message
519
+ });
520
+ define_property(error, "stack", {
521
+ value: adjusted.stack
522
+ });
523
+ }
524
+ }
525
+
526
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/reactivity/batch.js
527
+ var batches = new Set;
528
+ var current_batch = null;
529
+ var previous_batch = null;
530
+ var batch_values = null;
531
+ var queued_root_effects = [];
532
+ var last_scheduled_effect = null;
533
+ var is_flushing = false;
534
+ var is_flushing_sync = false;
535
+
536
+ class Batch {
537
+ committed = false;
538
+ current = new Map;
539
+ previous = new Map;
540
+ #commit_callbacks = new Set;
541
+ #discard_callbacks = new Set;
542
+ #pending = 0;
543
+ #blocking_pending = 0;
544
+ #deferred = null;
545
+ #dirty_effects = new Set;
546
+ #maybe_dirty_effects = new Set;
547
+ skipped_effects = new Set;
548
+ is_fork = false;
549
+ is_deferred() {
550
+ return this.is_fork || this.#blocking_pending > 0;
551
+ }
552
+ process(root_effects) {
553
+ queued_root_effects = [];
554
+ previous_batch = null;
555
+ this.apply();
556
+ var target = {
557
+ parent: null,
558
+ effect: null,
559
+ effects: [],
560
+ render_effects: []
561
+ };
562
+ for (const root of root_effects) {
563
+ this.#traverse_effect_tree(root, target);
564
+ }
565
+ if (!this.is_fork) {
566
+ this.#resolve();
567
+ }
568
+ if (this.is_deferred()) {
569
+ this.#defer_effects(target.effects);
570
+ this.#defer_effects(target.render_effects);
571
+ } else {
572
+ previous_batch = this;
573
+ current_batch = null;
574
+ flush_queued_effects(target.render_effects);
575
+ flush_queued_effects(target.effects);
576
+ previous_batch = null;
577
+ this.#deferred?.resolve();
578
+ }
579
+ batch_values = null;
580
+ }
581
+ #traverse_effect_tree(root, target) {
582
+ root.f ^= CLEAN;
583
+ var effect = root.first;
584
+ while (effect !== null) {
585
+ var flags = effect.f;
586
+ var is_branch = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) !== 0;
587
+ var is_skippable_branch = is_branch && (flags & CLEAN) !== 0;
588
+ var skip = is_skippable_branch || (flags & INERT) !== 0 || this.skipped_effects.has(effect);
589
+ if ((effect.f & BOUNDARY_EFFECT) !== 0 && effect.b?.is_pending()) {
590
+ target = {
591
+ parent: target,
592
+ effect,
593
+ effects: [],
594
+ render_effects: []
595
+ };
596
+ }
597
+ if (!skip && effect.fn !== null) {
598
+ if (is_branch) {
599
+ effect.f ^= CLEAN;
600
+ } else if ((flags & EFFECT) !== 0) {
601
+ target.effects.push(effect);
602
+ } else if (async_mode_flag && (flags & (RENDER_EFFECT | MANAGED_EFFECT)) !== 0) {
603
+ target.render_effects.push(effect);
604
+ } else if (is_dirty(effect)) {
605
+ if ((effect.f & BLOCK_EFFECT) !== 0)
606
+ this.#dirty_effects.add(effect);
607
+ update_effect(effect);
608
+ }
609
+ var child = effect.first;
610
+ if (child !== null) {
611
+ effect = child;
612
+ continue;
613
+ }
614
+ }
615
+ var parent = effect.parent;
616
+ effect = effect.next;
617
+ while (effect === null && parent !== null) {
618
+ if (parent === target.effect) {
619
+ this.#defer_effects(target.effects);
620
+ this.#defer_effects(target.render_effects);
621
+ target = target.parent;
622
+ }
623
+ effect = parent.next;
624
+ parent = parent.parent;
625
+ }
626
+ }
627
+ }
628
+ #defer_effects(effects) {
629
+ for (const e of effects) {
630
+ if ((e.f & DIRTY) !== 0) {
631
+ this.#dirty_effects.add(e);
632
+ } else if ((e.f & MAYBE_DIRTY) !== 0) {
633
+ this.#maybe_dirty_effects.add(e);
634
+ }
635
+ this.#clear_marked(e.deps);
636
+ set_signal_status(e, CLEAN);
637
+ }
638
+ }
639
+ #clear_marked(deps) {
640
+ if (deps === null)
641
+ return;
642
+ for (const dep of deps) {
643
+ if ((dep.f & DERIVED) === 0 || (dep.f & WAS_MARKED) === 0) {
644
+ continue;
645
+ }
646
+ dep.f ^= WAS_MARKED;
647
+ this.#clear_marked(dep.deps);
648
+ }
649
+ }
650
+ capture(source2, value) {
651
+ if (!this.previous.has(source2)) {
652
+ this.previous.set(source2, value);
653
+ }
654
+ if ((source2.f & ERROR_VALUE) === 0) {
655
+ this.current.set(source2, source2.v);
656
+ batch_values?.set(source2, source2.v);
657
+ }
658
+ }
659
+ activate() {
660
+ current_batch = this;
661
+ this.apply();
662
+ }
663
+ deactivate() {
664
+ if (current_batch !== this)
665
+ return;
666
+ current_batch = null;
667
+ batch_values = null;
668
+ }
669
+ flush() {
670
+ this.activate();
671
+ if (queued_root_effects.length > 0) {
672
+ flush_effects();
673
+ if (current_batch !== null && current_batch !== this) {
674
+ return;
675
+ }
676
+ } else if (this.#pending === 0) {
677
+ this.process([]);
678
+ }
679
+ this.deactivate();
680
+ }
681
+ discard() {
682
+ for (const fn of this.#discard_callbacks)
683
+ fn(this);
684
+ this.#discard_callbacks.clear();
685
+ }
686
+ #resolve() {
687
+ if (this.#blocking_pending === 0) {
688
+ for (const fn of this.#commit_callbacks)
689
+ fn();
690
+ this.#commit_callbacks.clear();
691
+ }
692
+ if (this.#pending === 0) {
693
+ this.#commit();
694
+ }
695
+ }
696
+ #commit() {
697
+ if (batches.size > 1) {
698
+ this.previous.clear();
699
+ var previous_batch_values = batch_values;
700
+ var is_earlier = true;
701
+ var dummy_target = {
702
+ parent: null,
703
+ effect: null,
704
+ effects: [],
705
+ render_effects: []
706
+ };
707
+ for (const batch of batches) {
708
+ if (batch === this) {
709
+ is_earlier = false;
710
+ continue;
711
+ }
712
+ const sources = [];
713
+ for (const [source2, value] of this.current) {
714
+ if (batch.current.has(source2)) {
715
+ if (is_earlier && value !== batch.current.get(source2)) {
716
+ batch.current.set(source2, value);
717
+ } else {
718
+ continue;
719
+ }
720
+ }
721
+ sources.push(source2);
722
+ }
723
+ if (sources.length === 0) {
724
+ continue;
725
+ }
726
+ const others = [...batch.current.keys()].filter((s) => !this.current.has(s));
727
+ if (others.length > 0) {
728
+ var prev_queued_root_effects = queued_root_effects;
729
+ queued_root_effects = [];
730
+ const marked = new Set;
731
+ const checked = new Map;
732
+ for (const source2 of sources) {
733
+ mark_effects(source2, others, marked, checked);
734
+ }
735
+ if (queued_root_effects.length > 0) {
736
+ current_batch = batch;
737
+ batch.apply();
738
+ for (const root of queued_root_effects) {
739
+ batch.#traverse_effect_tree(root, dummy_target);
740
+ }
741
+ batch.deactivate();
742
+ }
743
+ queued_root_effects = prev_queued_root_effects;
744
+ }
745
+ }
746
+ current_batch = null;
747
+ batch_values = previous_batch_values;
748
+ }
749
+ this.committed = true;
750
+ batches.delete(this);
751
+ }
752
+ increment(blocking) {
753
+ this.#pending += 1;
754
+ if (blocking)
755
+ this.#blocking_pending += 1;
756
+ }
757
+ decrement(blocking) {
758
+ this.#pending -= 1;
759
+ if (blocking)
760
+ this.#blocking_pending -= 1;
761
+ this.revive();
762
+ }
763
+ revive() {
764
+ for (const e of this.#dirty_effects) {
765
+ this.#maybe_dirty_effects.delete(e);
766
+ set_signal_status(e, DIRTY);
767
+ schedule_effect(e);
768
+ }
769
+ for (const e of this.#maybe_dirty_effects) {
770
+ set_signal_status(e, MAYBE_DIRTY);
771
+ schedule_effect(e);
772
+ }
773
+ this.flush();
774
+ }
775
+ oncommit(fn) {
776
+ this.#commit_callbacks.add(fn);
777
+ }
778
+ ondiscard(fn) {
779
+ this.#discard_callbacks.add(fn);
780
+ }
781
+ settled() {
782
+ return (this.#deferred ??= deferred()).promise;
783
+ }
784
+ static ensure() {
785
+ if (current_batch === null) {
786
+ const batch = current_batch = new Batch;
787
+ batches.add(current_batch);
788
+ if (!is_flushing_sync) {
789
+ Batch.enqueue(() => {
790
+ if (current_batch !== batch) {
791
+ return;
792
+ }
793
+ batch.flush();
794
+ });
795
+ }
796
+ }
797
+ return current_batch;
798
+ }
799
+ static enqueue(task) {
800
+ queue_micro_task(task);
801
+ }
802
+ apply() {
803
+ if (!async_mode_flag || !this.is_fork && batches.size === 1)
804
+ return;
805
+ batch_values = new Map(this.current);
806
+ for (const batch of batches) {
807
+ if (batch === this)
808
+ continue;
809
+ for (const [source2, previous] of batch.previous) {
810
+ if (!batch_values.has(source2)) {
811
+ batch_values.set(source2, previous);
812
+ }
813
+ }
814
+ }
815
+ }
816
+ }
817
+ function flushSync(fn) {
818
+ var was_flushing_sync = is_flushing_sync;
819
+ is_flushing_sync = true;
820
+ try {
821
+ var result;
822
+ if (fn) {
823
+ if (current_batch !== null) {
824
+ flush_effects();
825
+ }
826
+ result = fn();
827
+ }
828
+ while (true) {
829
+ flush_tasks();
830
+ if (queued_root_effects.length === 0) {
831
+ current_batch?.flush();
832
+ if (queued_root_effects.length === 0) {
833
+ last_scheduled_effect = null;
834
+ return result;
835
+ }
836
+ }
837
+ flush_effects();
838
+ }
839
+ } finally {
840
+ is_flushing_sync = was_flushing_sync;
841
+ }
842
+ }
843
+ function flush_effects() {
844
+ var was_updating_effect = is_updating_effect;
845
+ is_flushing = true;
846
+ var source_stacks = true_default ? new Set : null;
847
+ try {
848
+ var flush_count = 0;
849
+ set_is_updating_effect(true);
850
+ while (queued_root_effects.length > 0) {
851
+ var batch = Batch.ensure();
852
+ if (flush_count++ > 1000) {
853
+ if (true_default) {
854
+ var updates = new Map;
855
+ for (const source2 of batch.current.keys()) {
856
+ for (const [stack, update2] of source2.updated ?? []) {
857
+ var entry = updates.get(stack);
858
+ if (!entry) {
859
+ entry = { error: update2.error, count: 0 };
860
+ updates.set(stack, entry);
861
+ }
862
+ entry.count += update2.count;
863
+ }
864
+ }
865
+ for (const update2 of updates.values()) {
866
+ if (update2.error) {
867
+ console.error(update2.error);
868
+ }
869
+ }
870
+ }
871
+ infinite_loop_guard();
872
+ }
873
+ batch.process(queued_root_effects);
874
+ old_values.clear();
875
+ if (true_default) {
876
+ for (const source2 of batch.current.keys()) {
877
+ source_stacks.add(source2);
878
+ }
879
+ }
880
+ }
881
+ } finally {
882
+ is_flushing = false;
883
+ set_is_updating_effect(was_updating_effect);
884
+ last_scheduled_effect = null;
885
+ if (true_default) {
886
+ for (const source2 of source_stacks) {
887
+ source2.updated = null;
888
+ }
889
+ }
890
+ }
891
+ }
892
+ function infinite_loop_guard() {
893
+ try {
894
+ effect_update_depth_exceeded();
895
+ } catch (error) {
896
+ if (true_default) {
897
+ define_property(error, "stack", { value: "" });
898
+ }
899
+ invoke_error_boundary(error, last_scheduled_effect);
900
+ }
901
+ }
902
+ var eager_block_effects = null;
903
+ function flush_queued_effects(effects) {
904
+ var length = effects.length;
905
+ if (length === 0)
906
+ return;
907
+ var i = 0;
908
+ while (i < length) {
909
+ var effect = effects[i++];
910
+ if ((effect.f & (DESTROYED | INERT)) === 0 && is_dirty(effect)) {
911
+ eager_block_effects = new Set;
912
+ update_effect(effect);
913
+ if (effect.deps === null && effect.first === null && effect.nodes === null) {
914
+ if (effect.teardown === null && effect.ac === null) {
915
+ unlink_effect(effect);
916
+ } else {
917
+ effect.fn = null;
918
+ }
919
+ }
920
+ if (eager_block_effects?.size > 0) {
921
+ old_values.clear();
922
+ for (const e of eager_block_effects) {
923
+ if ((e.f & (DESTROYED | INERT)) !== 0)
924
+ continue;
925
+ const ordered_effects = [e];
926
+ let ancestor = e.parent;
927
+ while (ancestor !== null) {
928
+ if (eager_block_effects.has(ancestor)) {
929
+ eager_block_effects.delete(ancestor);
930
+ ordered_effects.push(ancestor);
931
+ }
932
+ ancestor = ancestor.parent;
933
+ }
934
+ for (let j = ordered_effects.length - 1;j >= 0; j--) {
935
+ const e2 = ordered_effects[j];
936
+ if ((e2.f & (DESTROYED | INERT)) !== 0)
937
+ continue;
938
+ update_effect(e2);
939
+ }
940
+ }
941
+ eager_block_effects.clear();
942
+ }
943
+ }
944
+ }
945
+ eager_block_effects = null;
946
+ }
947
+ function mark_effects(value, sources, marked, checked) {
948
+ if (marked.has(value))
949
+ return;
950
+ marked.add(value);
951
+ if (value.reactions !== null) {
952
+ for (const reaction of value.reactions) {
953
+ const flags = reaction.f;
954
+ if ((flags & DERIVED) !== 0) {
955
+ mark_effects(reaction, sources, marked, checked);
956
+ } else if ((flags & (ASYNC | BLOCK_EFFECT)) !== 0 && (flags & DIRTY) === 0 && depends_on(reaction, sources, checked)) {
957
+ set_signal_status(reaction, DIRTY);
958
+ schedule_effect(reaction);
959
+ }
960
+ }
961
+ }
962
+ }
963
+ function depends_on(reaction, sources, checked) {
964
+ const depends = checked.get(reaction);
965
+ if (depends !== undefined)
966
+ return depends;
967
+ if (reaction.deps !== null) {
968
+ for (const dep of reaction.deps) {
969
+ if (sources.includes(dep)) {
970
+ return true;
971
+ }
972
+ if ((dep.f & DERIVED) !== 0 && depends_on(dep, sources, checked)) {
973
+ checked.set(dep, true);
974
+ return true;
975
+ }
976
+ }
977
+ }
978
+ checked.set(reaction, false);
979
+ return false;
980
+ }
981
+ function schedule_effect(signal) {
982
+ var effect = last_scheduled_effect = signal;
983
+ while (effect.parent !== null) {
984
+ effect = effect.parent;
985
+ var flags = effect.f;
986
+ if (is_flushing && effect === active_effect && (flags & BLOCK_EFFECT) !== 0 && (flags & HEAD_EFFECT) === 0) {
987
+ return;
988
+ }
989
+ if ((flags & (ROOT_EFFECT | BRANCH_EFFECT)) !== 0) {
990
+ if ((flags & CLEAN) === 0)
991
+ return;
992
+ effect.f ^= CLEAN;
993
+ }
994
+ }
995
+ queued_root_effects.push(effect);
996
+ }
997
+
998
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/reactivity/create-subscriber.js
999
+ function createSubscriber(start) {
1000
+ let subscribers = 0;
1001
+ let version = source(0);
1002
+ let stop;
1003
+ if (true_default) {
1004
+ tag(version, "createSubscriber version");
1005
+ }
1006
+ return () => {
1007
+ if (effect_tracking()) {
1008
+ get(version);
1009
+ render_effect(() => {
1010
+ if (subscribers === 0) {
1011
+ stop = untrack(() => start(() => increment(version)));
1012
+ }
1013
+ subscribers += 1;
1014
+ return () => {
1015
+ queue_micro_task(() => {
1016
+ subscribers -= 1;
1017
+ if (subscribers === 0) {
1018
+ stop?.();
1019
+ stop = undefined;
1020
+ increment(version);
1021
+ }
1022
+ });
1023
+ };
1024
+ });
1025
+ }
1026
+ };
1027
+ }
1028
+
1029
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/dom/blocks/boundary.js
1030
+ var flags = EFFECT_TRANSPARENT | EFFECT_PRESERVED | BOUNDARY_EFFECT;
1031
+ function boundary(node, props, children) {
1032
+ new Boundary(node, props, children);
1033
+ }
1034
+
1035
+ class Boundary {
1036
+ parent;
1037
+ #pending = false;
1038
+ #anchor;
1039
+ #hydrate_open = hydrating ? hydrate_node : null;
1040
+ #props;
1041
+ #children;
1042
+ #effect;
1043
+ #main_effect = null;
1044
+ #pending_effect = null;
1045
+ #failed_effect = null;
1046
+ #offscreen_fragment = null;
1047
+ #pending_anchor = null;
1048
+ #local_pending_count = 0;
1049
+ #pending_count = 0;
1050
+ #is_creating_fallback = false;
1051
+ #effect_pending = null;
1052
+ #effect_pending_subscriber = createSubscriber(() => {
1053
+ this.#effect_pending = source(this.#local_pending_count);
1054
+ if (true_default) {
1055
+ tag(this.#effect_pending, "$effect.pending()");
1056
+ }
1057
+ return () => {
1058
+ this.#effect_pending = null;
1059
+ };
1060
+ });
1061
+ constructor(node, props, children) {
1062
+ this.#anchor = node;
1063
+ this.#props = props;
1064
+ this.#children = children;
1065
+ this.parent = active_effect.b;
1066
+ this.#pending = !!this.#props.pending;
1067
+ this.#effect = block(() => {
1068
+ active_effect.b = this;
1069
+ if (hydrating) {
1070
+ const comment = this.#hydrate_open;
1071
+ hydrate_next();
1072
+ const server_rendered_pending = comment.nodeType === COMMENT_NODE && comment.data === HYDRATION_START_ELSE;
1073
+ if (server_rendered_pending) {
1074
+ this.#hydrate_pending_content();
1075
+ } else {
1076
+ this.#hydrate_resolved_content();
1077
+ }
1078
+ } else {
1079
+ var anchor = this.#get_anchor();
1080
+ try {
1081
+ this.#main_effect = branch(() => children(anchor));
1082
+ } catch (error) {
1083
+ this.error(error);
1084
+ }
1085
+ if (this.#pending_count > 0) {
1086
+ this.#show_pending_snippet();
1087
+ } else {
1088
+ this.#pending = false;
1089
+ }
1090
+ }
1091
+ return () => {
1092
+ this.#pending_anchor?.remove();
1093
+ };
1094
+ }, flags);
1095
+ if (hydrating) {
1096
+ this.#anchor = hydrate_node;
1097
+ }
1098
+ }
1099
+ #hydrate_resolved_content() {
1100
+ try {
1101
+ this.#main_effect = branch(() => this.#children(this.#anchor));
1102
+ } catch (error) {
1103
+ this.error(error);
1104
+ }
1105
+ this.#pending = false;
1106
+ }
1107
+ #hydrate_pending_content() {
1108
+ const pending = this.#props.pending;
1109
+ if (!pending) {
1110
+ return;
1111
+ }
1112
+ this.#pending_effect = branch(() => pending(this.#anchor));
1113
+ Batch.enqueue(() => {
1114
+ var anchor = this.#get_anchor();
1115
+ this.#main_effect = this.#run(() => {
1116
+ Batch.ensure();
1117
+ return branch(() => this.#children(anchor));
1118
+ });
1119
+ if (this.#pending_count > 0) {
1120
+ this.#show_pending_snippet();
1121
+ } else {
1122
+ pause_effect(this.#pending_effect, () => {
1123
+ this.#pending_effect = null;
1124
+ });
1125
+ this.#pending = false;
1126
+ }
1127
+ });
1128
+ }
1129
+ #get_anchor() {
1130
+ var anchor = this.#anchor;
1131
+ if (this.#pending) {
1132
+ this.#pending_anchor = create_text();
1133
+ this.#anchor.before(this.#pending_anchor);
1134
+ anchor = this.#pending_anchor;
1135
+ }
1136
+ return anchor;
1137
+ }
1138
+ is_pending() {
1139
+ return this.#pending || !!this.parent && this.parent.is_pending();
1140
+ }
1141
+ has_pending_snippet() {
1142
+ return !!this.#props.pending;
1143
+ }
1144
+ #run(fn) {
1145
+ var previous_effect = active_effect;
1146
+ var previous_reaction = active_reaction;
1147
+ var previous_ctx = component_context;
1148
+ set_active_effect(this.#effect);
1149
+ set_active_reaction(this.#effect);
1150
+ set_component_context(this.#effect.ctx);
1151
+ try {
1152
+ return fn();
1153
+ } catch (e) {
1154
+ handle_error(e);
1155
+ return null;
1156
+ } finally {
1157
+ set_active_effect(previous_effect);
1158
+ set_active_reaction(previous_reaction);
1159
+ set_component_context(previous_ctx);
1160
+ }
1161
+ }
1162
+ #show_pending_snippet() {
1163
+ const pending = this.#props.pending;
1164
+ if (this.#main_effect !== null) {
1165
+ this.#offscreen_fragment = document.createDocumentFragment();
1166
+ this.#offscreen_fragment.append(this.#pending_anchor);
1167
+ move_effect(this.#main_effect, this.#offscreen_fragment);
1168
+ }
1169
+ if (this.#pending_effect === null) {
1170
+ this.#pending_effect = branch(() => pending(this.#anchor));
1171
+ }
1172
+ }
1173
+ #update_pending_count(d) {
1174
+ if (!this.has_pending_snippet()) {
1175
+ if (this.parent) {
1176
+ this.parent.#update_pending_count(d);
1177
+ }
1178
+ return;
1179
+ }
1180
+ this.#pending_count += d;
1181
+ if (this.#pending_count === 0) {
1182
+ this.#pending = false;
1183
+ if (this.#pending_effect) {
1184
+ pause_effect(this.#pending_effect, () => {
1185
+ this.#pending_effect = null;
1186
+ });
1187
+ }
1188
+ if (this.#offscreen_fragment) {
1189
+ this.#anchor.before(this.#offscreen_fragment);
1190
+ this.#offscreen_fragment = null;
1191
+ }
1192
+ }
1193
+ }
1194
+ update_pending_count(d) {
1195
+ this.#update_pending_count(d);
1196
+ this.#local_pending_count += d;
1197
+ if (this.#effect_pending) {
1198
+ internal_set(this.#effect_pending, this.#local_pending_count);
1199
+ }
1200
+ }
1201
+ get_effect_pending() {
1202
+ this.#effect_pending_subscriber();
1203
+ return get(this.#effect_pending);
1204
+ }
1205
+ error(error) {
1206
+ var onerror = this.#props.onerror;
1207
+ let failed = this.#props.failed;
1208
+ if (this.#is_creating_fallback || !onerror && !failed) {
1209
+ throw error;
1210
+ }
1211
+ if (this.#main_effect) {
1212
+ destroy_effect(this.#main_effect);
1213
+ this.#main_effect = null;
1214
+ }
1215
+ if (this.#pending_effect) {
1216
+ destroy_effect(this.#pending_effect);
1217
+ this.#pending_effect = null;
1218
+ }
1219
+ if (this.#failed_effect) {
1220
+ destroy_effect(this.#failed_effect);
1221
+ this.#failed_effect = null;
1222
+ }
1223
+ if (hydrating) {
1224
+ set_hydrate_node(this.#hydrate_open);
1225
+ next();
1226
+ set_hydrate_node(skip_nodes());
1227
+ }
1228
+ var did_reset = false;
1229
+ var calling_on_error = false;
1230
+ const reset = () => {
1231
+ if (did_reset) {
1232
+ svelte_boundary_reset_noop();
1233
+ return;
1234
+ }
1235
+ did_reset = true;
1236
+ if (calling_on_error) {
1237
+ svelte_boundary_reset_onerror();
1238
+ }
1239
+ Batch.ensure();
1240
+ this.#local_pending_count = 0;
1241
+ if (this.#failed_effect !== null) {
1242
+ pause_effect(this.#failed_effect, () => {
1243
+ this.#failed_effect = null;
1244
+ });
1245
+ }
1246
+ this.#pending = this.has_pending_snippet();
1247
+ this.#main_effect = this.#run(() => {
1248
+ this.#is_creating_fallback = false;
1249
+ return branch(() => this.#children(this.#anchor));
1250
+ });
1251
+ if (this.#pending_count > 0) {
1252
+ this.#show_pending_snippet();
1253
+ } else {
1254
+ this.#pending = false;
1255
+ }
1256
+ };
1257
+ var previous_reaction = active_reaction;
1258
+ try {
1259
+ set_active_reaction(null);
1260
+ calling_on_error = true;
1261
+ onerror?.(error, reset);
1262
+ calling_on_error = false;
1263
+ } catch (error2) {
1264
+ invoke_error_boundary(error2, this.#effect && this.#effect.parent);
1265
+ } finally {
1266
+ set_active_reaction(previous_reaction);
1267
+ }
1268
+ if (failed) {
1269
+ queue_micro_task(() => {
1270
+ this.#failed_effect = this.#run(() => {
1271
+ Batch.ensure();
1272
+ this.#is_creating_fallback = true;
1273
+ try {
1274
+ return branch(() => {
1275
+ failed(this.#anchor, () => error, () => reset);
1276
+ });
1277
+ } catch (error2) {
1278
+ invoke_error_boundary(error2, this.#effect.parent);
1279
+ return null;
1280
+ } finally {
1281
+ this.#is_creating_fallback = false;
1282
+ }
1283
+ });
1284
+ });
1285
+ }
1286
+ }
1287
+ }
1288
+
1289
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/reactivity/deriveds.js
1290
+ var recent_async_deriveds = new Set;
1291
+ function destroy_derived_effects(derived2) {
1292
+ var effects = derived2.effects;
1293
+ if (effects !== null) {
1294
+ derived2.effects = null;
1295
+ for (var i = 0;i < effects.length; i += 1) {
1296
+ destroy_effect(effects[i]);
1297
+ }
1298
+ }
1299
+ }
1300
+ var stack = [];
1301
+ function get_derived_parent_effect(derived2) {
1302
+ var parent = derived2.parent;
1303
+ while (parent !== null) {
1304
+ if ((parent.f & DERIVED) === 0) {
1305
+ return (parent.f & DESTROYED) === 0 ? parent : null;
1306
+ }
1307
+ parent = parent.parent;
1308
+ }
1309
+ return null;
1310
+ }
1311
+ function execute_derived(derived2) {
1312
+ var value;
1313
+ var prev_active_effect = active_effect;
1314
+ set_active_effect(get_derived_parent_effect(derived2));
1315
+ if (true_default) {
1316
+ let prev_eager_effects = eager_effects;
1317
+ set_eager_effects(new Set);
1318
+ try {
1319
+ if (stack.includes(derived2)) {
1320
+ derived_references_self();
1321
+ }
1322
+ stack.push(derived2);
1323
+ derived2.f &= ~WAS_MARKED;
1324
+ destroy_derived_effects(derived2);
1325
+ value = update_reaction(derived2);
1326
+ } finally {
1327
+ set_active_effect(prev_active_effect);
1328
+ set_eager_effects(prev_eager_effects);
1329
+ stack.pop();
1330
+ }
1331
+ } else {
1332
+ try {
1333
+ derived2.f &= ~WAS_MARKED;
1334
+ destroy_derived_effects(derived2);
1335
+ value = update_reaction(derived2);
1336
+ } finally {
1337
+ set_active_effect(prev_active_effect);
1338
+ }
1339
+ }
1340
+ return value;
1341
+ }
1342
+ function update_derived(derived2) {
1343
+ var value = execute_derived(derived2);
1344
+ if (!derived2.equals(value)) {
1345
+ if (!current_batch?.is_fork) {
1346
+ derived2.v = value;
1347
+ }
1348
+ derived2.wv = increment_write_version();
1349
+ }
1350
+ if (is_destroying_effect) {
1351
+ return;
1352
+ }
1353
+ if (batch_values !== null) {
1354
+ if (effect_tracking() || current_batch?.is_fork) {
1355
+ batch_values.set(derived2, value);
1356
+ }
1357
+ } else {
1358
+ var status = (derived2.f & CONNECTED) === 0 ? MAYBE_DIRTY : CLEAN;
1359
+ set_signal_status(derived2, status);
1360
+ }
1361
+ }
1362
+
1363
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/reactivity/sources.js
1364
+ var eager_effects = new Set;
1365
+ var old_values = new Map;
1366
+ function set_eager_effects(v) {
1367
+ eager_effects = v;
1368
+ }
1369
+ var eager_effects_deferred = false;
1370
+ function set_eager_effects_deferred() {
1371
+ eager_effects_deferred = true;
1372
+ }
1373
+ function source(v, stack2) {
1374
+ var signal = {
1375
+ f: 0,
1376
+ v,
1377
+ reactions: null,
1378
+ equals,
1379
+ rv: 0,
1380
+ wv: 0
1381
+ };
1382
+ if (true_default && tracing_mode_flag) {
1383
+ signal.created = stack2 ?? get_error("created at");
1384
+ signal.updated = null;
1385
+ signal.set_during_effect = false;
1386
+ signal.trace = null;
1387
+ }
1388
+ return signal;
1389
+ }
1390
+ function state(v, stack2) {
1391
+ const s = source(v, stack2);
1392
+ push_reaction_value(s);
1393
+ return s;
1394
+ }
1395
+ function mutable_source(initial_value, immutable = false, trackable = true) {
1396
+ const s = source(initial_value);
1397
+ if (!immutable) {
1398
+ s.equals = safe_equals;
1399
+ }
1400
+ if (legacy_mode_flag && trackable && component_context !== null && component_context.l !== null) {
1401
+ (component_context.l.s ??= []).push(s);
1402
+ }
1403
+ return s;
1404
+ }
1405
+ function set(source2, value, should_proxy = false) {
1406
+ if (active_reaction !== null && (!untracking || (active_reaction.f & EAGER_EFFECT) !== 0) && is_runes() && (active_reaction.f & (DERIVED | BLOCK_EFFECT | ASYNC | EAGER_EFFECT)) !== 0 && !current_sources?.includes(source2)) {
1407
+ state_unsafe_mutation();
1408
+ }
1409
+ let new_value = should_proxy ? proxy(value) : value;
1410
+ if (true_default) {
1411
+ tag_proxy(new_value, source2.label);
1412
+ }
1413
+ return internal_set(source2, new_value);
1414
+ }
1415
+ function internal_set(source2, value) {
1416
+ if (!source2.equals(value)) {
1417
+ var old_value = source2.v;
1418
+ if (is_destroying_effect) {
1419
+ old_values.set(source2, value);
1420
+ } else {
1421
+ old_values.set(source2, old_value);
1422
+ }
1423
+ source2.v = value;
1424
+ var batch = Batch.ensure();
1425
+ batch.capture(source2, old_value);
1426
+ if (true_default) {
1427
+ if (tracing_mode_flag || active_effect !== null) {
1428
+ source2.updated ??= new Map;
1429
+ const count = (source2.updated.get("")?.count ?? 0) + 1;
1430
+ source2.updated.set("", { error: null, count });
1431
+ if (tracing_mode_flag || count > 5) {
1432
+ const error = get_error("updated at");
1433
+ if (error !== null) {
1434
+ let entry = source2.updated.get(error.stack);
1435
+ if (!entry) {
1436
+ entry = { error, count: 0 };
1437
+ source2.updated.set(error.stack, entry);
1438
+ }
1439
+ entry.count++;
1440
+ }
1441
+ }
1442
+ }
1443
+ if (active_effect !== null) {
1444
+ source2.set_during_effect = true;
1445
+ }
1446
+ }
1447
+ if ((source2.f & DERIVED) !== 0) {
1448
+ if ((source2.f & DIRTY) !== 0) {
1449
+ execute_derived(source2);
1450
+ }
1451
+ set_signal_status(source2, (source2.f & CONNECTED) !== 0 ? CLEAN : MAYBE_DIRTY);
1452
+ }
1453
+ source2.wv = increment_write_version();
1454
+ mark_reactions(source2, DIRTY);
1455
+ if (is_runes() && active_effect !== null && (active_effect.f & CLEAN) !== 0 && (active_effect.f & (BRANCH_EFFECT | ROOT_EFFECT)) === 0) {
1456
+ if (untracked_writes === null) {
1457
+ set_untracked_writes([source2]);
1458
+ } else {
1459
+ untracked_writes.push(source2);
1460
+ }
1461
+ }
1462
+ if (!batch.is_fork && eager_effects.size > 0 && !eager_effects_deferred) {
1463
+ flush_eager_effects();
1464
+ }
1465
+ }
1466
+ return value;
1467
+ }
1468
+ function flush_eager_effects() {
1469
+ eager_effects_deferred = false;
1470
+ var prev_is_updating_effect = is_updating_effect;
1471
+ set_is_updating_effect(true);
1472
+ const inspects = Array.from(eager_effects);
1473
+ try {
1474
+ for (const effect of inspects) {
1475
+ if ((effect.f & CLEAN) !== 0) {
1476
+ set_signal_status(effect, MAYBE_DIRTY);
1477
+ }
1478
+ if (is_dirty(effect)) {
1479
+ update_effect(effect);
1480
+ }
1481
+ }
1482
+ } finally {
1483
+ set_is_updating_effect(prev_is_updating_effect);
1484
+ }
1485
+ eager_effects.clear();
1486
+ }
1487
+ function increment(source2) {
1488
+ set(source2, source2.v + 1);
1489
+ }
1490
+ function mark_reactions(signal, status) {
1491
+ var reactions = signal.reactions;
1492
+ if (reactions === null)
1493
+ return;
1494
+ var runes = is_runes();
1495
+ var length = reactions.length;
1496
+ for (var i = 0;i < length; i++) {
1497
+ var reaction = reactions[i];
1498
+ var flags2 = reaction.f;
1499
+ if (!runes && reaction === active_effect)
1500
+ continue;
1501
+ if (true_default && (flags2 & EAGER_EFFECT) !== 0) {
1502
+ eager_effects.add(reaction);
1503
+ continue;
1504
+ }
1505
+ var not_dirty = (flags2 & DIRTY) === 0;
1506
+ if (not_dirty) {
1507
+ set_signal_status(reaction, status);
1508
+ }
1509
+ if ((flags2 & DERIVED) !== 0) {
1510
+ var derived2 = reaction;
1511
+ batch_values?.delete(derived2);
1512
+ if ((flags2 & WAS_MARKED) === 0) {
1513
+ if (flags2 & CONNECTED) {
1514
+ reaction.f |= WAS_MARKED;
1515
+ }
1516
+ mark_reactions(derived2, MAYBE_DIRTY);
1517
+ }
1518
+ } else if (not_dirty) {
1519
+ if ((flags2 & BLOCK_EFFECT) !== 0 && eager_block_effects !== null) {
1520
+ eager_block_effects.add(reaction);
1521
+ }
1522
+ schedule_effect(reaction);
1523
+ }
1524
+ }
1525
+ }
1526
+
1527
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/proxy.js
1528
+ var regex_is_valid_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
1529
+ function proxy(value) {
1530
+ if (typeof value !== "object" || value === null || STATE_SYMBOL in value) {
1531
+ return value;
1532
+ }
1533
+ const prototype = get_prototype_of(value);
1534
+ if (prototype !== object_prototype && prototype !== array_prototype) {
1535
+ return value;
1536
+ }
1537
+ var sources = new Map;
1538
+ var is_proxied_array = is_array(value);
1539
+ var version = state(0);
1540
+ var stack2 = true_default && tracing_mode_flag ? get_error("created at") : null;
1541
+ var parent_version = update_version;
1542
+ var with_parent = (fn) => {
1543
+ if (update_version === parent_version) {
1544
+ return fn();
1545
+ }
1546
+ var reaction = active_reaction;
1547
+ var version2 = update_version;
1548
+ set_active_reaction(null);
1549
+ set_update_version(parent_version);
1550
+ var result = fn();
1551
+ set_active_reaction(reaction);
1552
+ set_update_version(version2);
1553
+ return result;
1554
+ };
1555
+ if (is_proxied_array) {
1556
+ sources.set("length", state(value.length, stack2));
1557
+ if (true_default) {
1558
+ value = inspectable_array(value);
1559
+ }
1560
+ }
1561
+ var path = "";
1562
+ let updating = false;
1563
+ function update_path(new_path) {
1564
+ if (updating)
1565
+ return;
1566
+ updating = true;
1567
+ path = new_path;
1568
+ tag(version, `${path} version`);
1569
+ for (const [prop, source2] of sources) {
1570
+ tag(source2, get_label(path, prop));
1571
+ }
1572
+ updating = false;
1573
+ }
1574
+ return new Proxy(value, {
1575
+ defineProperty(_, prop, descriptor) {
1576
+ if (!("value" in descriptor) || descriptor.configurable === false || descriptor.enumerable === false || descriptor.writable === false) {
1577
+ state_descriptors_fixed();
1578
+ }
1579
+ var s = sources.get(prop);
1580
+ if (s === undefined) {
1581
+ s = with_parent(() => {
1582
+ var s2 = state(descriptor.value, stack2);
1583
+ sources.set(prop, s2);
1584
+ if (true_default && typeof prop === "string") {
1585
+ tag(s2, get_label(path, prop));
1586
+ }
1587
+ return s2;
1588
+ });
1589
+ } else {
1590
+ set(s, descriptor.value, true);
1591
+ }
1592
+ return true;
1593
+ },
1594
+ deleteProperty(target, prop) {
1595
+ var s = sources.get(prop);
1596
+ if (s === undefined) {
1597
+ if (prop in target) {
1598
+ const s2 = with_parent(() => state(UNINITIALIZED, stack2));
1599
+ sources.set(prop, s2);
1600
+ increment(version);
1601
+ if (true_default) {
1602
+ tag(s2, get_label(path, prop));
1603
+ }
1604
+ }
1605
+ } else {
1606
+ set(s, UNINITIALIZED);
1607
+ increment(version);
1608
+ }
1609
+ return true;
1610
+ },
1611
+ get(target, prop, receiver) {
1612
+ if (prop === STATE_SYMBOL) {
1613
+ return value;
1614
+ }
1615
+ if (true_default && prop === PROXY_PATH_SYMBOL) {
1616
+ return update_path;
1617
+ }
1618
+ var s = sources.get(prop);
1619
+ var exists = prop in target;
1620
+ if (s === undefined && (!exists || get_descriptor(target, prop)?.writable)) {
1621
+ s = with_parent(() => {
1622
+ var p = proxy(exists ? target[prop] : UNINITIALIZED);
1623
+ var s2 = state(p, stack2);
1624
+ if (true_default) {
1625
+ tag(s2, get_label(path, prop));
1626
+ }
1627
+ return s2;
1628
+ });
1629
+ sources.set(prop, s);
1630
+ }
1631
+ if (s !== undefined) {
1632
+ var v = get(s);
1633
+ return v === UNINITIALIZED ? undefined : v;
1634
+ }
1635
+ return Reflect.get(target, prop, receiver);
1636
+ },
1637
+ getOwnPropertyDescriptor(target, prop) {
1638
+ var descriptor = Reflect.getOwnPropertyDescriptor(target, prop);
1639
+ if (descriptor && "value" in descriptor) {
1640
+ var s = sources.get(prop);
1641
+ if (s)
1642
+ descriptor.value = get(s);
1643
+ } else if (descriptor === undefined) {
1644
+ var source2 = sources.get(prop);
1645
+ var value2 = source2?.v;
1646
+ if (source2 !== undefined && value2 !== UNINITIALIZED) {
1647
+ return {
1648
+ enumerable: true,
1649
+ configurable: true,
1650
+ value: value2,
1651
+ writable: true
1652
+ };
1653
+ }
1654
+ }
1655
+ return descriptor;
1656
+ },
1657
+ has(target, prop) {
1658
+ if (prop === STATE_SYMBOL) {
1659
+ return true;
1660
+ }
1661
+ var s = sources.get(prop);
1662
+ var has = s !== undefined && s.v !== UNINITIALIZED || Reflect.has(target, prop);
1663
+ if (s !== undefined || active_effect !== null && (!has || get_descriptor(target, prop)?.writable)) {
1664
+ if (s === undefined) {
1665
+ s = with_parent(() => {
1666
+ var p = has ? proxy(target[prop]) : UNINITIALIZED;
1667
+ var s2 = state(p, stack2);
1668
+ if (true_default) {
1669
+ tag(s2, get_label(path, prop));
1670
+ }
1671
+ return s2;
1672
+ });
1673
+ sources.set(prop, s);
1674
+ }
1675
+ var value2 = get(s);
1676
+ if (value2 === UNINITIALIZED) {
1677
+ return false;
1678
+ }
1679
+ }
1680
+ return has;
1681
+ },
1682
+ set(target, prop, value2, receiver) {
1683
+ var s = sources.get(prop);
1684
+ var has = prop in target;
1685
+ if (is_proxied_array && prop === "length") {
1686
+ for (var i = value2;i < s.v; i += 1) {
1687
+ var other_s = sources.get(i + "");
1688
+ if (other_s !== undefined) {
1689
+ set(other_s, UNINITIALIZED);
1690
+ } else if (i in target) {
1691
+ other_s = with_parent(() => state(UNINITIALIZED, stack2));
1692
+ sources.set(i + "", other_s);
1693
+ if (true_default) {
1694
+ tag(other_s, get_label(path, i));
1695
+ }
1696
+ }
1697
+ }
1698
+ }
1699
+ if (s === undefined) {
1700
+ if (!has || get_descriptor(target, prop)?.writable) {
1701
+ s = with_parent(() => state(undefined, stack2));
1702
+ if (true_default) {
1703
+ tag(s, get_label(path, prop));
1704
+ }
1705
+ set(s, proxy(value2));
1706
+ sources.set(prop, s);
1707
+ }
1708
+ } else {
1709
+ has = s.v !== UNINITIALIZED;
1710
+ var p = with_parent(() => proxy(value2));
1711
+ set(s, p);
1712
+ }
1713
+ var descriptor = Reflect.getOwnPropertyDescriptor(target, prop);
1714
+ if (descriptor?.set) {
1715
+ descriptor.set.call(receiver, value2);
1716
+ }
1717
+ if (!has) {
1718
+ if (is_proxied_array && typeof prop === "string") {
1719
+ var ls = sources.get("length");
1720
+ var n = Number(prop);
1721
+ if (Number.isInteger(n) && n >= ls.v) {
1722
+ set(ls, n + 1);
1723
+ }
1724
+ }
1725
+ increment(version);
1726
+ }
1727
+ return true;
1728
+ },
1729
+ ownKeys(target) {
1730
+ get(version);
1731
+ var own_keys = Reflect.ownKeys(target).filter((key2) => {
1732
+ var source3 = sources.get(key2);
1733
+ return source3 === undefined || source3.v !== UNINITIALIZED;
1734
+ });
1735
+ for (var [key, source2] of sources) {
1736
+ if (source2.v !== UNINITIALIZED && !(key in target)) {
1737
+ own_keys.push(key);
1738
+ }
1739
+ }
1740
+ return own_keys;
1741
+ },
1742
+ setPrototypeOf() {
1743
+ state_prototype_fixed();
1744
+ }
1745
+ });
1746
+ }
1747
+ function get_label(path, prop) {
1748
+ if (typeof prop === "symbol")
1749
+ return `${path}[Symbol(${prop.description ?? ""})]`;
1750
+ if (regex_is_valid_identifier.test(prop))
1751
+ return `${path}.${prop}`;
1752
+ return /^\d+$/.test(prop) ? `${path}[${prop}]` : `${path}['${prop}']`;
1753
+ }
1754
+ function get_proxied_value(value) {
1755
+ try {
1756
+ if (value !== null && typeof value === "object" && STATE_SYMBOL in value) {
1757
+ return value[STATE_SYMBOL];
1758
+ }
1759
+ } catch {}
1760
+ return value;
1761
+ }
1762
+ var ARRAY_MUTATING_METHODS = new Set([
1763
+ "copyWithin",
1764
+ "fill",
1765
+ "pop",
1766
+ "push",
1767
+ "reverse",
1768
+ "shift",
1769
+ "sort",
1770
+ "splice",
1771
+ "unshift"
1772
+ ]);
1773
+ function inspectable_array(array) {
1774
+ return new Proxy(array, {
1775
+ get(target, prop, receiver) {
1776
+ var value = Reflect.get(target, prop, receiver);
1777
+ if (!ARRAY_MUTATING_METHODS.has(prop)) {
1778
+ return value;
1779
+ }
1780
+ return function(...args) {
1781
+ set_eager_effects_deferred();
1782
+ var result = value.apply(this, args);
1783
+ flush_eager_effects();
1784
+ return result;
1785
+ };
1786
+ }
1787
+ });
1788
+ }
1789
+
1790
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/dev/equality.js
1791
+ function init_array_prototype_warnings() {
1792
+ const array_prototype2 = Array.prototype;
1793
+ const cleanup = Array.__svelte_cleanup;
1794
+ if (cleanup) {
1795
+ cleanup();
1796
+ }
1797
+ const { indexOf, lastIndexOf, includes } = array_prototype2;
1798
+ array_prototype2.indexOf = function(item, from_index) {
1799
+ const index = indexOf.call(this, item, from_index);
1800
+ if (index === -1) {
1801
+ for (let i = from_index ?? 0;i < this.length; i += 1) {
1802
+ if (get_proxied_value(this[i]) === item) {
1803
+ state_proxy_equality_mismatch("array.indexOf(...)");
1804
+ break;
1805
+ }
1806
+ }
1807
+ }
1808
+ return index;
1809
+ };
1810
+ array_prototype2.lastIndexOf = function(item, from_index) {
1811
+ const index = lastIndexOf.call(this, item, from_index ?? this.length - 1);
1812
+ if (index === -1) {
1813
+ for (let i = 0;i <= (from_index ?? this.length - 1); i += 1) {
1814
+ if (get_proxied_value(this[i]) === item) {
1815
+ state_proxy_equality_mismatch("array.lastIndexOf(...)");
1816
+ break;
1817
+ }
1818
+ }
1819
+ }
1820
+ return index;
1821
+ };
1822
+ array_prototype2.includes = function(item, from_index) {
1823
+ const has = includes.call(this, item, from_index);
1824
+ if (!has) {
1825
+ for (let i = 0;i < this.length; i += 1) {
1826
+ if (get_proxied_value(this[i]) === item) {
1827
+ state_proxy_equality_mismatch("array.includes(...)");
1828
+ break;
1829
+ }
1830
+ }
1831
+ }
1832
+ return has;
1833
+ };
1834
+ Array.__svelte_cleanup = () => {
1835
+ array_prototype2.indexOf = indexOf;
1836
+ array_prototype2.lastIndexOf = lastIndexOf;
1837
+ array_prototype2.includes = includes;
1838
+ };
1839
+ }
1840
+
1841
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/dom/operations.js
1842
+ var $window;
1843
+ var $document;
1844
+ var is_firefox;
1845
+ var first_child_getter;
1846
+ var next_sibling_getter;
1847
+ function init_operations() {
1848
+ if ($window !== undefined) {
1849
+ return;
1850
+ }
1851
+ $window = window;
1852
+ $document = document;
1853
+ is_firefox = /Firefox/.test(navigator.userAgent);
1854
+ var element_prototype = Element.prototype;
1855
+ var node_prototype = Node.prototype;
1856
+ var text_prototype = Text.prototype;
1857
+ first_child_getter = get_descriptor(node_prototype, "firstChild").get;
1858
+ next_sibling_getter = get_descriptor(node_prototype, "nextSibling").get;
1859
+ if (is_extensible(element_prototype)) {
1860
+ element_prototype.__click = undefined;
1861
+ element_prototype.__className = undefined;
1862
+ element_prototype.__attributes = null;
1863
+ element_prototype.__style = undefined;
1864
+ element_prototype.__e = undefined;
1865
+ }
1866
+ if (is_extensible(text_prototype)) {
1867
+ text_prototype.__t = undefined;
1868
+ }
1869
+ if (true_default) {
1870
+ element_prototype.__svelte_meta = null;
1871
+ init_array_prototype_warnings();
1872
+ }
1873
+ }
1874
+ function create_text(value = "") {
1875
+ return document.createTextNode(value);
1876
+ }
1877
+ function get_first_child(node) {
1878
+ return first_child_getter.call(node);
1879
+ }
1880
+ function get_next_sibling(node) {
1881
+ return next_sibling_getter.call(node);
1882
+ }
1883
+ function clear_text_content(node) {
1884
+ node.textContent = "";
1885
+ }
1886
+ function should_defer_append() {
1887
+ if (!async_mode_flag)
1888
+ return false;
1889
+ if (eager_block_effects !== null)
1890
+ return false;
1891
+ var flags2 = active_effect.f;
1892
+ return (flags2 & EFFECT_RAN) !== 0;
1893
+ }
1894
+
1895
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js
1896
+ function without_reactive_context(fn) {
1897
+ var previous_reaction = active_reaction;
1898
+ var previous_effect = active_effect;
1899
+ set_active_reaction(null);
1900
+ set_active_effect(null);
1901
+ try {
1902
+ return fn();
1903
+ } finally {
1904
+ set_active_reaction(previous_reaction);
1905
+ set_active_effect(previous_effect);
1906
+ }
1907
+ }
1908
+
1909
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/reactivity/effects.js
1910
+ function push_effect(effect, parent_effect) {
1911
+ var parent_last = parent_effect.last;
1912
+ if (parent_last === null) {
1913
+ parent_effect.last = parent_effect.first = effect;
1914
+ } else {
1915
+ parent_last.next = effect;
1916
+ effect.prev = parent_last;
1917
+ parent_effect.last = effect;
1918
+ }
1919
+ }
1920
+ function create_effect(type, fn, sync) {
1921
+ var parent = active_effect;
1922
+ if (true_default) {
1923
+ while (parent !== null && (parent.f & EAGER_EFFECT) !== 0) {
1924
+ parent = parent.parent;
1925
+ }
1926
+ }
1927
+ if (parent !== null && (parent.f & INERT) !== 0) {
1928
+ type |= INERT;
1929
+ }
1930
+ var effect = {
1931
+ ctx: component_context,
1932
+ deps: null,
1933
+ nodes: null,
1934
+ f: type | DIRTY | CONNECTED,
1935
+ first: null,
1936
+ fn,
1937
+ last: null,
1938
+ next: null,
1939
+ parent,
1940
+ b: parent && parent.b,
1941
+ prev: null,
1942
+ teardown: null,
1943
+ wv: 0,
1944
+ ac: null
1945
+ };
1946
+ if (true_default) {
1947
+ effect.component_function = dev_current_component_function;
1948
+ }
1949
+ if (sync) {
1950
+ try {
1951
+ update_effect(effect);
1952
+ effect.f |= EFFECT_RAN;
1953
+ } catch (e2) {
1954
+ destroy_effect(effect);
1955
+ throw e2;
1956
+ }
1957
+ } else if (fn !== null) {
1958
+ schedule_effect(effect);
1959
+ }
1960
+ var e = effect;
1961
+ if (sync && e.deps === null && e.teardown === null && e.nodes === null && e.first === e.last && (e.f & EFFECT_PRESERVED) === 0) {
1962
+ e = e.first;
1963
+ if ((type & BLOCK_EFFECT) !== 0 && (type & EFFECT_TRANSPARENT) !== 0 && e !== null) {
1964
+ e.f |= EFFECT_TRANSPARENT;
1965
+ }
1966
+ }
1967
+ if (e !== null) {
1968
+ e.parent = parent;
1969
+ if (parent !== null) {
1970
+ push_effect(e, parent);
1971
+ }
1972
+ if (active_reaction !== null && (active_reaction.f & DERIVED) !== 0 && (type & ROOT_EFFECT) === 0) {
1973
+ var derived2 = active_reaction;
1974
+ (derived2.effects ??= []).push(e);
1975
+ }
1976
+ }
1977
+ return effect;
1978
+ }
1979
+ function effect_tracking() {
1980
+ return active_reaction !== null && !untracking;
1981
+ }
1982
+ function create_user_effect(fn) {
1983
+ return create_effect(EFFECT | USER_EFFECT, fn, false);
1984
+ }
1985
+ function effect_root(fn) {
1986
+ Batch.ensure();
1987
+ const effect = create_effect(ROOT_EFFECT | EFFECT_PRESERVED, fn, true);
1988
+ return () => {
1989
+ destroy_effect(effect);
1990
+ };
1991
+ }
1992
+ function component_root(fn) {
1993
+ Batch.ensure();
1994
+ const effect = create_effect(ROOT_EFFECT | EFFECT_PRESERVED, fn, true);
1995
+ return (options = {}) => {
1996
+ return new Promise((fulfil) => {
1997
+ if (options.outro) {
1998
+ pause_effect(effect, () => {
1999
+ destroy_effect(effect);
2000
+ fulfil(undefined);
2001
+ });
2002
+ } else {
2003
+ destroy_effect(effect);
2004
+ fulfil(undefined);
2005
+ }
2006
+ });
2007
+ };
2008
+ }
2009
+ function render_effect(fn, flags2 = 0) {
2010
+ return create_effect(RENDER_EFFECT | flags2, fn, true);
2011
+ }
2012
+ function block(fn, flags2 = 0) {
2013
+ var effect = create_effect(BLOCK_EFFECT | flags2, fn, true);
2014
+ if (true_default) {
2015
+ effect.dev_stack = dev_stack;
2016
+ }
2017
+ return effect;
2018
+ }
2019
+ function branch(fn) {
2020
+ return create_effect(BRANCH_EFFECT | EFFECT_PRESERVED, fn, true);
2021
+ }
2022
+ function execute_effect_teardown(effect) {
2023
+ var teardown2 = effect.teardown;
2024
+ if (teardown2 !== null) {
2025
+ const previously_destroying_effect = is_destroying_effect;
2026
+ const previous_reaction = active_reaction;
2027
+ set_is_destroying_effect(true);
2028
+ set_active_reaction(null);
2029
+ try {
2030
+ teardown2.call(null);
2031
+ } finally {
2032
+ set_is_destroying_effect(previously_destroying_effect);
2033
+ set_active_reaction(previous_reaction);
2034
+ }
2035
+ }
2036
+ }
2037
+ function destroy_effect_children(signal, remove_dom = false) {
2038
+ var effect = signal.first;
2039
+ signal.first = signal.last = null;
2040
+ while (effect !== null) {
2041
+ const controller = effect.ac;
2042
+ if (controller !== null) {
2043
+ without_reactive_context(() => {
2044
+ controller.abort(STALE_REACTION);
2045
+ });
2046
+ }
2047
+ var next2 = effect.next;
2048
+ if ((effect.f & ROOT_EFFECT) !== 0) {
2049
+ effect.parent = null;
2050
+ } else {
2051
+ destroy_effect(effect, remove_dom);
2052
+ }
2053
+ effect = next2;
2054
+ }
2055
+ }
2056
+ function destroy_block_effect_children(signal) {
2057
+ var effect = signal.first;
2058
+ while (effect !== null) {
2059
+ var next2 = effect.next;
2060
+ if ((effect.f & BRANCH_EFFECT) === 0) {
2061
+ destroy_effect(effect);
2062
+ }
2063
+ effect = next2;
2064
+ }
2065
+ }
2066
+ function destroy_effect(effect, remove_dom = true) {
2067
+ var removed = false;
2068
+ if ((remove_dom || (effect.f & HEAD_EFFECT) !== 0) && effect.nodes !== null && effect.nodes.end !== null) {
2069
+ remove_effect_dom(effect.nodes.start, effect.nodes.end);
2070
+ removed = true;
2071
+ }
2072
+ destroy_effect_children(effect, remove_dom && !removed);
2073
+ remove_reactions(effect, 0);
2074
+ set_signal_status(effect, DESTROYED);
2075
+ var transitions = effect.nodes && effect.nodes.t;
2076
+ if (transitions !== null) {
2077
+ for (const transition of transitions) {
2078
+ transition.stop();
2079
+ }
2080
+ }
2081
+ execute_effect_teardown(effect);
2082
+ var parent = effect.parent;
2083
+ if (parent !== null && parent.first !== null) {
2084
+ unlink_effect(effect);
2085
+ }
2086
+ if (true_default) {
2087
+ effect.component_function = null;
2088
+ }
2089
+ effect.next = effect.prev = effect.teardown = effect.ctx = effect.deps = effect.fn = effect.nodes = effect.ac = null;
2090
+ }
2091
+ function remove_effect_dom(node, end) {
2092
+ while (node !== null) {
2093
+ var next2 = node === end ? null : get_next_sibling(node);
2094
+ node.remove();
2095
+ node = next2;
2096
+ }
2097
+ }
2098
+ function unlink_effect(effect) {
2099
+ var parent = effect.parent;
2100
+ var prev = effect.prev;
2101
+ var next2 = effect.next;
2102
+ if (prev !== null)
2103
+ prev.next = next2;
2104
+ if (next2 !== null)
2105
+ next2.prev = prev;
2106
+ if (parent !== null) {
2107
+ if (parent.first === effect)
2108
+ parent.first = next2;
2109
+ if (parent.last === effect)
2110
+ parent.last = prev;
2111
+ }
2112
+ }
2113
+ function pause_effect(effect, callback, destroy = true) {
2114
+ var transitions = [];
2115
+ pause_children(effect, transitions, true);
2116
+ var fn = () => {
2117
+ if (destroy)
2118
+ destroy_effect(effect);
2119
+ if (callback)
2120
+ callback();
2121
+ };
2122
+ var remaining = transitions.length;
2123
+ if (remaining > 0) {
2124
+ var check = () => --remaining || fn();
2125
+ for (var transition of transitions) {
2126
+ transition.out(check);
2127
+ }
2128
+ } else {
2129
+ fn();
2130
+ }
2131
+ }
2132
+ function pause_children(effect, transitions, local) {
2133
+ if ((effect.f & INERT) !== 0)
2134
+ return;
2135
+ effect.f ^= INERT;
2136
+ var t = effect.nodes && effect.nodes.t;
2137
+ if (t !== null) {
2138
+ for (const transition of t) {
2139
+ if (transition.is_global || local) {
2140
+ transitions.push(transition);
2141
+ }
2142
+ }
2143
+ }
2144
+ var child = effect.first;
2145
+ while (child !== null) {
2146
+ var sibling = child.next;
2147
+ var transparent = (child.f & EFFECT_TRANSPARENT) !== 0 || (child.f & BRANCH_EFFECT) !== 0 && (effect.f & BLOCK_EFFECT) !== 0;
2148
+ pause_children(child, transitions, transparent ? local : false);
2149
+ child = sibling;
2150
+ }
2151
+ }
2152
+ function resume_effect(effect) {
2153
+ resume_children(effect, true);
2154
+ }
2155
+ function resume_children(effect, local) {
2156
+ if ((effect.f & INERT) === 0)
2157
+ return;
2158
+ effect.f ^= INERT;
2159
+ if ((effect.f & CLEAN) === 0) {
2160
+ set_signal_status(effect, DIRTY);
2161
+ schedule_effect(effect);
2162
+ }
2163
+ var child = effect.first;
2164
+ while (child !== null) {
2165
+ var sibling = child.next;
2166
+ var transparent = (child.f & EFFECT_TRANSPARENT) !== 0 || (child.f & BRANCH_EFFECT) !== 0;
2167
+ resume_children(child, transparent ? local : false);
2168
+ child = sibling;
2169
+ }
2170
+ var t = effect.nodes && effect.nodes.t;
2171
+ if (t !== null) {
2172
+ for (const transition of t) {
2173
+ if (transition.is_global || local) {
2174
+ transition.in();
2175
+ }
2176
+ }
2177
+ }
2178
+ }
2179
+ function move_effect(effect, fragment) {
2180
+ if (!effect.nodes)
2181
+ return;
2182
+ var node = effect.nodes.start;
2183
+ var end = effect.nodes.end;
2184
+ while (node !== null) {
2185
+ var next2 = node === end ? null : get_next_sibling(node);
2186
+ fragment.append(node);
2187
+ node = next2;
2188
+ }
2189
+ }
2190
+
2191
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/legacy.js
2192
+ var captured_signals = null;
2193
+
2194
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/runtime.js
2195
+ var is_updating_effect = false;
2196
+ function set_is_updating_effect(value) {
2197
+ is_updating_effect = value;
2198
+ }
2199
+ var is_destroying_effect = false;
2200
+ function set_is_destroying_effect(value) {
2201
+ is_destroying_effect = value;
2202
+ }
2203
+ var active_reaction = null;
2204
+ var untracking = false;
2205
+ function set_active_reaction(reaction) {
2206
+ active_reaction = reaction;
2207
+ }
2208
+ var active_effect = null;
2209
+ function set_active_effect(effect) {
2210
+ active_effect = effect;
2211
+ }
2212
+ var current_sources = null;
2213
+ function push_reaction_value(value) {
2214
+ if (active_reaction !== null && (!async_mode_flag || (active_reaction.f & DERIVED) !== 0)) {
2215
+ if (current_sources === null) {
2216
+ current_sources = [value];
2217
+ } else {
2218
+ current_sources.push(value);
2219
+ }
2220
+ }
2221
+ }
2222
+ var new_deps = null;
2223
+ var skipped_deps = 0;
2224
+ var untracked_writes = null;
2225
+ function set_untracked_writes(value) {
2226
+ untracked_writes = value;
2227
+ }
2228
+ var write_version = 1;
2229
+ var read_version = 0;
2230
+ var update_version = read_version;
2231
+ function set_update_version(value) {
2232
+ update_version = value;
2233
+ }
2234
+ function increment_write_version() {
2235
+ return ++write_version;
2236
+ }
2237
+ function is_dirty(reaction) {
2238
+ var flags2 = reaction.f;
2239
+ if ((flags2 & DIRTY) !== 0) {
2240
+ return true;
2241
+ }
2242
+ if (flags2 & DERIVED) {
2243
+ reaction.f &= ~WAS_MARKED;
2244
+ }
2245
+ if ((flags2 & MAYBE_DIRTY) !== 0) {
2246
+ var dependencies = reaction.deps;
2247
+ if (dependencies !== null) {
2248
+ var length = dependencies.length;
2249
+ for (var i = 0;i < length; i++) {
2250
+ var dependency = dependencies[i];
2251
+ if (is_dirty(dependency)) {
2252
+ update_derived(dependency);
2253
+ }
2254
+ if (dependency.wv > reaction.wv) {
2255
+ return true;
2256
+ }
2257
+ }
2258
+ }
2259
+ if ((flags2 & CONNECTED) !== 0 && batch_values === null) {
2260
+ set_signal_status(reaction, CLEAN);
2261
+ }
2262
+ }
2263
+ return false;
2264
+ }
2265
+ function schedule_possible_effect_self_invalidation(signal, effect, root = true) {
2266
+ var reactions = signal.reactions;
2267
+ if (reactions === null)
2268
+ return;
2269
+ if (!async_mode_flag && current_sources?.includes(signal)) {
2270
+ return;
2271
+ }
2272
+ for (var i = 0;i < reactions.length; i++) {
2273
+ var reaction = reactions[i];
2274
+ if ((reaction.f & DERIVED) !== 0) {
2275
+ schedule_possible_effect_self_invalidation(reaction, effect, false);
2276
+ } else if (effect === reaction) {
2277
+ if (root) {
2278
+ set_signal_status(reaction, DIRTY);
2279
+ } else if ((reaction.f & CLEAN) !== 0) {
2280
+ set_signal_status(reaction, MAYBE_DIRTY);
2281
+ }
2282
+ schedule_effect(reaction);
2283
+ }
2284
+ }
2285
+ }
2286
+ function update_reaction(reaction) {
2287
+ var previous_deps = new_deps;
2288
+ var previous_skipped_deps = skipped_deps;
2289
+ var previous_untracked_writes = untracked_writes;
2290
+ var previous_reaction = active_reaction;
2291
+ var previous_sources = current_sources;
2292
+ var previous_component_context = component_context;
2293
+ var previous_untracking = untracking;
2294
+ var previous_update_version = update_version;
2295
+ var flags2 = reaction.f;
2296
+ new_deps = null;
2297
+ skipped_deps = 0;
2298
+ untracked_writes = null;
2299
+ active_reaction = (flags2 & (BRANCH_EFFECT | ROOT_EFFECT)) === 0 ? reaction : null;
2300
+ current_sources = null;
2301
+ set_component_context(reaction.ctx);
2302
+ untracking = false;
2303
+ update_version = ++read_version;
2304
+ if (reaction.ac !== null) {
2305
+ without_reactive_context(() => {
2306
+ reaction.ac.abort(STALE_REACTION);
2307
+ });
2308
+ reaction.ac = null;
2309
+ }
2310
+ try {
2311
+ reaction.f |= REACTION_IS_UPDATING;
2312
+ var fn = reaction.fn;
2313
+ var result = fn();
2314
+ var deps = reaction.deps;
2315
+ if (new_deps !== null) {
2316
+ var i;
2317
+ remove_reactions(reaction, skipped_deps);
2318
+ if (deps !== null && skipped_deps > 0) {
2319
+ deps.length = skipped_deps + new_deps.length;
2320
+ for (i = 0;i < new_deps.length; i++) {
2321
+ deps[skipped_deps + i] = new_deps[i];
2322
+ }
2323
+ } else {
2324
+ reaction.deps = deps = new_deps;
2325
+ }
2326
+ if (effect_tracking() && (reaction.f & CONNECTED) !== 0) {
2327
+ for (i = skipped_deps;i < deps.length; i++) {
2328
+ (deps[i].reactions ??= []).push(reaction);
2329
+ }
2330
+ }
2331
+ } else if (deps !== null && skipped_deps < deps.length) {
2332
+ remove_reactions(reaction, skipped_deps);
2333
+ deps.length = skipped_deps;
2334
+ }
2335
+ if (is_runes() && untracked_writes !== null && !untracking && deps !== null && (reaction.f & (DERIVED | MAYBE_DIRTY | DIRTY)) === 0) {
2336
+ for (i = 0;i < untracked_writes.length; i++) {
2337
+ schedule_possible_effect_self_invalidation(untracked_writes[i], reaction);
2338
+ }
2339
+ }
2340
+ if (previous_reaction !== null && previous_reaction !== reaction) {
2341
+ read_version++;
2342
+ if (untracked_writes !== null) {
2343
+ if (previous_untracked_writes === null) {
2344
+ previous_untracked_writes = untracked_writes;
2345
+ } else {
2346
+ previous_untracked_writes.push(...untracked_writes);
2347
+ }
2348
+ }
2349
+ }
2350
+ if ((reaction.f & ERROR_VALUE) !== 0) {
2351
+ reaction.f ^= ERROR_VALUE;
2352
+ }
2353
+ return result;
2354
+ } catch (error) {
2355
+ return handle_error(error);
2356
+ } finally {
2357
+ reaction.f ^= REACTION_IS_UPDATING;
2358
+ new_deps = previous_deps;
2359
+ skipped_deps = previous_skipped_deps;
2360
+ untracked_writes = previous_untracked_writes;
2361
+ active_reaction = previous_reaction;
2362
+ current_sources = previous_sources;
2363
+ set_component_context(previous_component_context);
2364
+ untracking = previous_untracking;
2365
+ update_version = previous_update_version;
2366
+ }
2367
+ }
2368
+ function remove_reaction(signal, dependency) {
2369
+ let reactions = dependency.reactions;
2370
+ if (reactions !== null) {
2371
+ var index = index_of.call(reactions, signal);
2372
+ if (index !== -1) {
2373
+ var new_length = reactions.length - 1;
2374
+ if (new_length === 0) {
2375
+ reactions = dependency.reactions = null;
2376
+ } else {
2377
+ reactions[index] = reactions[new_length];
2378
+ reactions.pop();
2379
+ }
2380
+ }
2381
+ }
2382
+ if (reactions === null && (dependency.f & DERIVED) !== 0 && (new_deps === null || !new_deps.includes(dependency))) {
2383
+ set_signal_status(dependency, MAYBE_DIRTY);
2384
+ if ((dependency.f & CONNECTED) !== 0) {
2385
+ dependency.f ^= CONNECTED;
2386
+ dependency.f &= ~WAS_MARKED;
2387
+ }
2388
+ destroy_derived_effects(dependency);
2389
+ remove_reactions(dependency, 0);
2390
+ }
2391
+ }
2392
+ function remove_reactions(signal, start_index) {
2393
+ var dependencies = signal.deps;
2394
+ if (dependencies === null)
2395
+ return;
2396
+ for (var i = start_index;i < dependencies.length; i++) {
2397
+ remove_reaction(signal, dependencies[i]);
2398
+ }
2399
+ }
2400
+ function update_effect(effect) {
2401
+ var flags2 = effect.f;
2402
+ if ((flags2 & DESTROYED) !== 0) {
2403
+ return;
2404
+ }
2405
+ set_signal_status(effect, CLEAN);
2406
+ var previous_effect = active_effect;
2407
+ var was_updating_effect = is_updating_effect;
2408
+ active_effect = effect;
2409
+ is_updating_effect = true;
2410
+ if (true_default) {
2411
+ var previous_component_fn = dev_current_component_function;
2412
+ set_dev_current_component_function(effect.component_function);
2413
+ var previous_stack = dev_stack;
2414
+ set_dev_stack(effect.dev_stack ?? dev_stack);
2415
+ }
2416
+ try {
2417
+ if ((flags2 & (BLOCK_EFFECT | MANAGED_EFFECT)) !== 0) {
2418
+ destroy_block_effect_children(effect);
2419
+ } else {
2420
+ destroy_effect_children(effect);
2421
+ }
2422
+ execute_effect_teardown(effect);
2423
+ var teardown2 = update_reaction(effect);
2424
+ effect.teardown = typeof teardown2 === "function" ? teardown2 : null;
2425
+ effect.wv = write_version;
2426
+ if (true_default && tracing_mode_flag && (effect.f & DIRTY) !== 0 && effect.deps !== null) {
2427
+ for (var dep of effect.deps) {
2428
+ if (dep.set_during_effect) {
2429
+ dep.wv = increment_write_version();
2430
+ dep.set_during_effect = false;
2431
+ }
2432
+ }
2433
+ }
2434
+ } finally {
2435
+ is_updating_effect = was_updating_effect;
2436
+ active_effect = previous_effect;
2437
+ if (true_default) {
2438
+ set_dev_current_component_function(previous_component_fn);
2439
+ set_dev_stack(previous_stack);
2440
+ }
2441
+ }
2442
+ }
2443
+ function get(signal) {
2444
+ var flags2 = signal.f;
2445
+ var is_derived = (flags2 & DERIVED) !== 0;
2446
+ captured_signals?.add(signal);
2447
+ if (active_reaction !== null && !untracking) {
2448
+ var destroyed = active_effect !== null && (active_effect.f & DESTROYED) !== 0;
2449
+ if (!destroyed && !current_sources?.includes(signal)) {
2450
+ var deps = active_reaction.deps;
2451
+ if ((active_reaction.f & REACTION_IS_UPDATING) !== 0) {
2452
+ if (signal.rv < read_version) {
2453
+ signal.rv = read_version;
2454
+ if (new_deps === null && deps !== null && deps[skipped_deps] === signal) {
2455
+ skipped_deps++;
2456
+ } else if (new_deps === null) {
2457
+ new_deps = [signal];
2458
+ } else if (!new_deps.includes(signal)) {
2459
+ new_deps.push(signal);
2460
+ }
2461
+ }
2462
+ } else {
2463
+ (active_reaction.deps ??= []).push(signal);
2464
+ var reactions = signal.reactions;
2465
+ if (reactions === null) {
2466
+ signal.reactions = [active_reaction];
2467
+ } else if (!reactions.includes(active_reaction)) {
2468
+ reactions.push(active_reaction);
2469
+ }
2470
+ }
2471
+ }
2472
+ }
2473
+ if (true_default) {
2474
+ recent_async_deriveds.delete(signal);
2475
+ if (tracing_mode_flag && !untracking && tracing_expressions !== null && active_reaction !== null && tracing_expressions.reaction === active_reaction) {
2476
+ if (signal.trace) {
2477
+ signal.trace();
2478
+ } else {
2479
+ var trace = get_error("traced at");
2480
+ if (trace) {
2481
+ var entry = tracing_expressions.entries.get(signal);
2482
+ if (entry === undefined) {
2483
+ entry = { traces: [] };
2484
+ tracing_expressions.entries.set(signal, entry);
2485
+ }
2486
+ var last = entry.traces[entry.traces.length - 1];
2487
+ if (trace.stack !== last?.stack) {
2488
+ entry.traces.push(trace);
2489
+ }
2490
+ }
2491
+ }
2492
+ }
2493
+ }
2494
+ if (is_destroying_effect) {
2495
+ if (old_values.has(signal)) {
2496
+ return old_values.get(signal);
2497
+ }
2498
+ if (is_derived) {
2499
+ var derived2 = signal;
2500
+ var value = derived2.v;
2501
+ if ((derived2.f & CLEAN) === 0 && derived2.reactions !== null || depends_on_old_values(derived2)) {
2502
+ value = execute_derived(derived2);
2503
+ }
2504
+ old_values.set(derived2, value);
2505
+ return value;
2506
+ }
2507
+ } else if (is_derived && (!batch_values?.has(signal) || current_batch?.is_fork && !effect_tracking())) {
2508
+ derived2 = signal;
2509
+ if (is_dirty(derived2)) {
2510
+ update_derived(derived2);
2511
+ }
2512
+ if (is_updating_effect && effect_tracking() && (derived2.f & CONNECTED) === 0) {
2513
+ reconnect(derived2);
2514
+ }
2515
+ }
2516
+ if (batch_values?.has(signal)) {
2517
+ return batch_values.get(signal);
2518
+ }
2519
+ if ((signal.f & ERROR_VALUE) !== 0) {
2520
+ throw signal.v;
2521
+ }
2522
+ return signal.v;
2523
+ }
2524
+ function reconnect(derived2) {
2525
+ if (derived2.deps === null)
2526
+ return;
2527
+ derived2.f ^= CONNECTED;
2528
+ for (const dep of derived2.deps) {
2529
+ (dep.reactions ??= []).push(derived2);
2530
+ if ((dep.f & DERIVED) !== 0 && (dep.f & CONNECTED) === 0) {
2531
+ reconnect(dep);
2532
+ }
2533
+ }
2534
+ }
2535
+ function depends_on_old_values(derived2) {
2536
+ if (derived2.v === UNINITIALIZED)
2537
+ return true;
2538
+ if (derived2.deps === null)
2539
+ return false;
2540
+ for (const dep of derived2.deps) {
2541
+ if (old_values.has(dep)) {
2542
+ return true;
2543
+ }
2544
+ if ((dep.f & DERIVED) !== 0 && depends_on_old_values(dep)) {
2545
+ return true;
2546
+ }
2547
+ }
2548
+ return false;
2549
+ }
2550
+ function untrack(fn) {
2551
+ var previous_untracking = untracking;
2552
+ try {
2553
+ untracking = true;
2554
+ return fn();
2555
+ } finally {
2556
+ untracking = previous_untracking;
2557
+ }
2558
+ }
2559
+ var STATUS_MASK = ~(DIRTY | MAYBE_DIRTY | CLEAN);
2560
+ function set_signal_status(signal, status) {
2561
+ signal.f = signal.f & STATUS_MASK | status;
2562
+ }
2563
+
2564
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/context.js
2565
+ var component_context = null;
2566
+ function set_component_context(context) {
2567
+ component_context = context;
2568
+ }
2569
+ var dev_stack = null;
2570
+ function set_dev_stack(stack2) {
2571
+ dev_stack = stack2;
2572
+ }
2573
+ var dev_current_component_function = null;
2574
+ function set_dev_current_component_function(fn) {
2575
+ dev_current_component_function = fn;
2576
+ }
2577
+ function push(props, runes = false, fn) {
2578
+ component_context = {
2579
+ p: component_context,
2580
+ i: false,
2581
+ c: null,
2582
+ e: null,
2583
+ s: props,
2584
+ x: null,
2585
+ l: legacy_mode_flag && !runes ? { s: null, u: null, $: [] } : null
2586
+ };
2587
+ if (true_default) {
2588
+ component_context.function = fn;
2589
+ dev_current_component_function = fn;
2590
+ }
2591
+ }
2592
+ function pop(component) {
2593
+ var context = component_context;
2594
+ var effects = context.e;
2595
+ if (effects !== null) {
2596
+ context.e = null;
2597
+ for (var fn of effects) {
2598
+ create_user_effect(fn);
2599
+ }
2600
+ }
2601
+ if (component !== undefined) {
2602
+ context.x = component;
2603
+ }
2604
+ context.i = true;
2605
+ component_context = context.p;
2606
+ if (true_default) {
2607
+ dev_current_component_function = component_context?.function ?? null;
2608
+ }
2609
+ return component ?? {};
2610
+ }
2611
+ function is_runes() {
2612
+ return !legacy_mode_flag || component_context !== null && component_context.l === null;
2613
+ }
2614
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/utils.js
2615
+ var DOM_BOOLEAN_ATTRIBUTES = [
2616
+ "allowfullscreen",
2617
+ "async",
2618
+ "autofocus",
2619
+ "autoplay",
2620
+ "checked",
2621
+ "controls",
2622
+ "default",
2623
+ "disabled",
2624
+ "formnovalidate",
2625
+ "indeterminate",
2626
+ "inert",
2627
+ "ismap",
2628
+ "loop",
2629
+ "multiple",
2630
+ "muted",
2631
+ "nomodule",
2632
+ "novalidate",
2633
+ "open",
2634
+ "playsinline",
2635
+ "readonly",
2636
+ "required",
2637
+ "reversed",
2638
+ "seamless",
2639
+ "selected",
2640
+ "webkitdirectory",
2641
+ "defer",
2642
+ "disablepictureinpicture",
2643
+ "disableremoteplayback"
2644
+ ];
2645
+ var DOM_PROPERTIES = [
2646
+ ...DOM_BOOLEAN_ATTRIBUTES,
2647
+ "formNoValidate",
2648
+ "isMap",
2649
+ "noModule",
2650
+ "playsInline",
2651
+ "readOnly",
2652
+ "value",
2653
+ "volume",
2654
+ "defaultValue",
2655
+ "defaultChecked",
2656
+ "srcObject",
2657
+ "noValidate",
2658
+ "allowFullscreen",
2659
+ "disablePictureInPicture",
2660
+ "disableRemotePlayback"
2661
+ ];
2662
+ var PASSIVE_EVENTS = ["touchstart", "touchmove"];
2663
+ function is_passive_event(name) {
2664
+ return PASSIVE_EVENTS.includes(name);
2665
+ }
2666
+ var STATE_CREATION_RUNES = [
2667
+ "$state",
2668
+ "$state.raw",
2669
+ "$derived",
2670
+ "$derived.by"
2671
+ ];
2672
+ var RUNES = [
2673
+ ...STATE_CREATION_RUNES,
2674
+ "$state.eager",
2675
+ "$state.snapshot",
2676
+ "$props",
2677
+ "$props.id",
2678
+ "$bindable",
2679
+ "$effect",
2680
+ "$effect.pre",
2681
+ "$effect.tracking",
2682
+ "$effect.root",
2683
+ "$effect.pending",
2684
+ "$inspect",
2685
+ "$inspect().with",
2686
+ "$inspect.trace",
2687
+ "$host"
2688
+ ];
2689
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/dev/css.js
2690
+ var all_styles = new Map;
2691
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/dom/elements/events.js
2692
+ var all_registered_events = new Set;
2693
+ var root_event_handles = new Set;
2694
+ var last_propagated_event = null;
2695
+ function handle_event_propagation(event) {
2696
+ var handler_element = this;
2697
+ var owner_document = handler_element.ownerDocument;
2698
+ var event_name = event.type;
2699
+ var path = event.composedPath?.() || [];
2700
+ var current_target = path[0] || event.target;
2701
+ last_propagated_event = event;
2702
+ var path_idx = 0;
2703
+ var handled_at = last_propagated_event === event && event.__root;
2704
+ if (handled_at) {
2705
+ var at_idx = path.indexOf(handled_at);
2706
+ if (at_idx !== -1 && (handler_element === document || handler_element === window)) {
2707
+ event.__root = handler_element;
2708
+ return;
2709
+ }
2710
+ var handler_idx = path.indexOf(handler_element);
2711
+ if (handler_idx === -1) {
2712
+ return;
2713
+ }
2714
+ if (at_idx <= handler_idx) {
2715
+ path_idx = at_idx;
2716
+ }
2717
+ }
2718
+ current_target = path[path_idx] || event.target;
2719
+ if (current_target === handler_element)
2720
+ return;
2721
+ define_property(event, "currentTarget", {
2722
+ configurable: true,
2723
+ get() {
2724
+ return current_target || owner_document;
2725
+ }
2726
+ });
2727
+ var previous_reaction = active_reaction;
2728
+ var previous_effect = active_effect;
2729
+ set_active_reaction(null);
2730
+ set_active_effect(null);
2731
+ try {
2732
+ var throw_error;
2733
+ var other_errors = [];
2734
+ while (current_target !== null) {
2735
+ var parent_element = current_target.assignedSlot || current_target.parentNode || current_target.host || null;
2736
+ try {
2737
+ var delegated = current_target["__" + event_name];
2738
+ if (delegated != null && (!current_target.disabled || event.target === current_target)) {
2739
+ delegated.call(current_target, event);
2740
+ }
2741
+ } catch (error) {
2742
+ if (throw_error) {
2743
+ other_errors.push(error);
2744
+ } else {
2745
+ throw_error = error;
2746
+ }
2747
+ }
2748
+ if (event.cancelBubble || parent_element === handler_element || parent_element === null) {
2749
+ break;
2750
+ }
2751
+ current_target = parent_element;
2752
+ }
2753
+ if (throw_error) {
2754
+ for (let error of other_errors) {
2755
+ queueMicrotask(() => {
2756
+ throw error;
2757
+ });
2758
+ }
2759
+ throw throw_error;
2760
+ }
2761
+ } finally {
2762
+ event.__root = handler_element;
2763
+ delete event.currentTarget;
2764
+ set_active_reaction(previous_reaction);
2765
+ set_active_effect(previous_effect);
2766
+ }
2767
+ }
2768
+
2769
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/dom/template.js
2770
+ function assign_nodes(start, end) {
2771
+ var effect = active_effect;
2772
+ if (effect.nodes === null) {
2773
+ effect.nodes = { start, end, a: null, t: null };
2774
+ }
2775
+ }
2776
+ function append(anchor, dom) {
2777
+ if (hydrating) {
2778
+ var effect = active_effect;
2779
+ if ((effect.f & EFFECT_RAN) === 0 || effect.nodes.end === null) {
2780
+ effect.nodes.end = hydrate_node;
2781
+ }
2782
+ hydrate_next();
2783
+ return;
2784
+ }
2785
+ if (anchor === null) {
2786
+ return;
2787
+ }
2788
+ anchor.before(dom);
2789
+ }
2790
+
2791
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/render.js
2792
+ var should_intro = true;
2793
+ function mount(component, options) {
2794
+ return _mount(component, options);
2795
+ }
2796
+ function hydrate(component, options) {
2797
+ init_operations();
2798
+ options.intro = options.intro ?? false;
2799
+ const target = options.target;
2800
+ const was_hydrating = hydrating;
2801
+ const previous_hydrate_node = hydrate_node;
2802
+ try {
2803
+ var anchor = get_first_child(target);
2804
+ while (anchor && (anchor.nodeType !== COMMENT_NODE || anchor.data !== HYDRATION_START)) {
2805
+ anchor = get_next_sibling(anchor);
2806
+ }
2807
+ if (!anchor) {
2808
+ throw HYDRATION_ERROR;
2809
+ }
2810
+ set_hydrating(true);
2811
+ set_hydrate_node(anchor);
2812
+ const instance = _mount(component, { ...options, anchor });
2813
+ set_hydrating(false);
2814
+ return instance;
2815
+ } catch (error) {
2816
+ if (error instanceof Error && error.message.split(`
2817
+ `).some((line) => line.startsWith("https://svelte.dev/e/"))) {
2818
+ throw error;
2819
+ }
2820
+ if (error !== HYDRATION_ERROR) {
2821
+ console.warn("Failed to hydrate: ", error);
2822
+ }
2823
+ if (options.recover === false) {
2824
+ hydration_failed();
2825
+ }
2826
+ init_operations();
2827
+ clear_text_content(target);
2828
+ set_hydrating(false);
2829
+ return mount(component, options);
2830
+ } finally {
2831
+ set_hydrating(was_hydrating);
2832
+ set_hydrate_node(previous_hydrate_node);
2833
+ }
2834
+ }
2835
+ var document_listeners = new Map;
2836
+ function _mount(Component, { target, anchor, props = {}, events, context, intro = true }) {
2837
+ init_operations();
2838
+ var registered_events = new Set;
2839
+ var event_handle = (events2) => {
2840
+ for (var i = 0;i < events2.length; i++) {
2841
+ var event_name = events2[i];
2842
+ if (registered_events.has(event_name))
2843
+ continue;
2844
+ registered_events.add(event_name);
2845
+ var passive = is_passive_event(event_name);
2846
+ target.addEventListener(event_name, handle_event_propagation, { passive });
2847
+ var n = document_listeners.get(event_name);
2848
+ if (n === undefined) {
2849
+ document.addEventListener(event_name, handle_event_propagation, { passive });
2850
+ document_listeners.set(event_name, 1);
2851
+ } else {
2852
+ document_listeners.set(event_name, n + 1);
2853
+ }
2854
+ }
2855
+ };
2856
+ event_handle(array_from(all_registered_events));
2857
+ root_event_handles.add(event_handle);
2858
+ var component = undefined;
2859
+ var unmount = component_root(() => {
2860
+ var anchor_node = anchor ?? target.appendChild(create_text());
2861
+ boundary(anchor_node, {
2862
+ pending: () => {}
2863
+ }, (anchor_node2) => {
2864
+ if (context) {
2865
+ push({});
2866
+ var ctx = component_context;
2867
+ ctx.c = context;
2868
+ }
2869
+ if (events) {
2870
+ props.$$events = events;
2871
+ }
2872
+ if (hydrating) {
2873
+ assign_nodes(anchor_node2, null);
2874
+ }
2875
+ should_intro = intro;
2876
+ component = Component(anchor_node2, props) || {};
2877
+ should_intro = true;
2878
+ if (hydrating) {
2879
+ active_effect.nodes.end = hydrate_node;
2880
+ if (hydrate_node === null || hydrate_node.nodeType !== COMMENT_NODE || hydrate_node.data !== HYDRATION_END) {
2881
+ hydration_mismatch();
2882
+ throw HYDRATION_ERROR;
2883
+ }
2884
+ }
2885
+ if (context) {
2886
+ pop();
2887
+ }
2888
+ });
2889
+ return () => {
2890
+ for (var event_name of registered_events) {
2891
+ target.removeEventListener(event_name, handle_event_propagation);
2892
+ var n = document_listeners.get(event_name);
2893
+ if (--n === 0) {
2894
+ document.removeEventListener(event_name, handle_event_propagation);
2895
+ document_listeners.delete(event_name);
2896
+ } else {
2897
+ document_listeners.set(event_name, n);
2898
+ }
2899
+ }
2900
+ root_event_handles.delete(event_handle);
2901
+ if (anchor_node !== anchor) {
2902
+ anchor_node.parentNode?.removeChild(anchor_node);
2903
+ }
2904
+ };
2905
+ });
2906
+ mounted_components.set(component, unmount);
2907
+ return component;
2908
+ }
2909
+ var mounted_components = new WeakMap;
2910
+ function unmount(component, options) {
2911
+ const fn = mounted_components.get(component);
2912
+ if (fn) {
2913
+ mounted_components.delete(component);
2914
+ return fn(options);
2915
+ }
2916
+ if (true_default) {
2917
+ if (STATE_SYMBOL in component) {
2918
+ state_proxy_unmount();
2919
+ } else {
2920
+ lifecycle_double_unmount();
2921
+ }
2922
+ }
2923
+ return Promise.resolve();
2924
+ }
2925
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/dom/blocks/branches.js
2926
+ class BranchManager {
2927
+ anchor;
2928
+ #batches = new Map;
2929
+ #onscreen = new Map;
2930
+ #offscreen = new Map;
2931
+ #outroing = new Set;
2932
+ #transition = true;
2933
+ constructor(anchor, transition = true) {
2934
+ this.anchor = anchor;
2935
+ this.#transition = transition;
2936
+ }
2937
+ #commit = () => {
2938
+ var batch = current_batch;
2939
+ if (!this.#batches.has(batch))
2940
+ return;
2941
+ var key = this.#batches.get(batch);
2942
+ var onscreen = this.#onscreen.get(key);
2943
+ if (onscreen) {
2944
+ resume_effect(onscreen);
2945
+ this.#outroing.delete(key);
2946
+ } else {
2947
+ var offscreen = this.#offscreen.get(key);
2948
+ if (offscreen) {
2949
+ this.#onscreen.set(key, offscreen.effect);
2950
+ this.#offscreen.delete(key);
2951
+ offscreen.fragment.lastChild.remove();
2952
+ this.anchor.before(offscreen.fragment);
2953
+ onscreen = offscreen.effect;
2954
+ }
2955
+ }
2956
+ for (const [b, k] of this.#batches) {
2957
+ this.#batches.delete(b);
2958
+ if (b === batch) {
2959
+ break;
2960
+ }
2961
+ const offscreen2 = this.#offscreen.get(k);
2962
+ if (offscreen2) {
2963
+ destroy_effect(offscreen2.effect);
2964
+ this.#offscreen.delete(k);
2965
+ }
2966
+ }
2967
+ for (const [k, effect] of this.#onscreen) {
2968
+ if (k === key || this.#outroing.has(k))
2969
+ continue;
2970
+ const on_destroy = () => {
2971
+ const keys = Array.from(this.#batches.values());
2972
+ if (keys.includes(k)) {
2973
+ var fragment = document.createDocumentFragment();
2974
+ move_effect(effect, fragment);
2975
+ fragment.append(create_text());
2976
+ this.#offscreen.set(k, { effect, fragment });
2977
+ } else {
2978
+ destroy_effect(effect);
2979
+ }
2980
+ this.#outroing.delete(k);
2981
+ this.#onscreen.delete(k);
2982
+ };
2983
+ if (this.#transition || !onscreen) {
2984
+ this.#outroing.add(k);
2985
+ pause_effect(effect, on_destroy, false);
2986
+ } else {
2987
+ on_destroy();
2988
+ }
2989
+ }
2990
+ };
2991
+ #discard = (batch) => {
2992
+ this.#batches.delete(batch);
2993
+ const keys = Array.from(this.#batches.values());
2994
+ for (const [k, branch2] of this.#offscreen) {
2995
+ if (!keys.includes(k)) {
2996
+ destroy_effect(branch2.effect);
2997
+ this.#offscreen.delete(k);
2998
+ }
2999
+ }
3000
+ };
3001
+ ensure(key, fn) {
3002
+ var batch = current_batch;
3003
+ var defer = should_defer_append();
3004
+ if (fn && !this.#onscreen.has(key) && !this.#offscreen.has(key)) {
3005
+ if (defer) {
3006
+ var fragment = document.createDocumentFragment();
3007
+ var target = create_text();
3008
+ fragment.append(target);
3009
+ this.#offscreen.set(key, {
3010
+ effect: branch(() => fn(target)),
3011
+ fragment
3012
+ });
3013
+ } else {
3014
+ this.#onscreen.set(key, branch(() => fn(this.anchor)));
3015
+ }
3016
+ }
3017
+ this.#batches.set(batch, key);
3018
+ if (defer) {
3019
+ for (const [k, effect] of this.#onscreen) {
3020
+ if (k === key) {
3021
+ batch.skipped_effects.delete(effect);
3022
+ } else {
3023
+ batch.skipped_effects.add(effect);
3024
+ }
3025
+ }
3026
+ for (const [k, branch2] of this.#offscreen) {
3027
+ if (k === key) {
3028
+ batch.skipped_effects.delete(branch2.effect);
3029
+ } else {
3030
+ batch.skipped_effects.add(branch2.effect);
3031
+ }
3032
+ }
3033
+ batch.oncommit(this.#commit);
3034
+ batch.ondiscard(this.#discard);
3035
+ } else {
3036
+ if (hydrating) {
3037
+ this.anchor = hydrate_node;
3038
+ }
3039
+ this.#commit();
3040
+ }
3041
+ }
3042
+ }
3043
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/timing.js
3044
+ var now = false_default ? () => performance.now() : () => Date.now();
3045
+ var raf = {
3046
+ tick: (_) => (false_default ? requestAnimationFrame : noop)(_),
3047
+ now: () => now(),
3048
+ tasks: new Set
3049
+ };
3050
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/shared/attributes.js
3051
+ var replacements = {
3052
+ translate: new Map([
3053
+ [true, "yes"],
3054
+ [false, "no"]
3055
+ ])
3056
+ };
3057
+ var whitespace = [...`
3058
+ \r\f \v\uFEFF`];
3059
+
3060
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/dom/elements/attributes.js
3061
+ var CLASS = Symbol("class");
3062
+ var STYLE = Symbol("style");
3063
+ var IS_CUSTOM_ELEMENT = Symbol("is custom element");
3064
+ var IS_HTML = Symbol("is html");
3065
+ var setters_cache = new Map;
3066
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/dom/elements/bindings/input.js
3067
+ var pending = new Set;
3068
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/dom/elements/bindings/size.js
3069
+ class ResizeObserverSingleton {
3070
+ #listeners = new WeakMap;
3071
+ #observer;
3072
+ #options;
3073
+ static entries = new WeakMap;
3074
+ constructor(options) {
3075
+ this.#options = options;
3076
+ }
3077
+ observe(element, listener) {
3078
+ var listeners = this.#listeners.get(element) || new Set;
3079
+ listeners.add(listener);
3080
+ this.#listeners.set(element, listeners);
3081
+ this.#getObserver().observe(element, this.#options);
3082
+ return () => {
3083
+ var listeners2 = this.#listeners.get(element);
3084
+ listeners2.delete(listener);
3085
+ if (listeners2.size === 0) {
3086
+ this.#listeners.delete(element);
3087
+ this.#observer.unobserve(element);
3088
+ }
3089
+ };
3090
+ }
3091
+ #getObserver() {
3092
+ return this.#observer ?? (this.#observer = new ResizeObserver((entries) => {
3093
+ for (var entry of entries) {
3094
+ ResizeObserverSingleton.entries.set(entry.target, entry);
3095
+ for (var listener of this.#listeners.get(entry.target) || []) {
3096
+ listener(entry);
3097
+ }
3098
+ }
3099
+ }));
3100
+ }
3101
+ }
3102
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/index-client.js
3103
+ if (true_default) {
3104
+ let throw_rune_error = function(rune) {
3105
+ if (!(rune in globalThis)) {
3106
+ let value;
3107
+ Object.defineProperty(globalThis, rune, {
3108
+ configurable: true,
3109
+ get: () => {
3110
+ if (value !== undefined) {
3111
+ return value;
3112
+ }
3113
+ rune_outside_svelte(rune);
3114
+ },
3115
+ set: (v) => {
3116
+ value = v;
3117
+ }
3118
+ });
3119
+ }
3120
+ };
3121
+ throw_rune_error("$state");
3122
+ throw_rune_error("$effect");
3123
+ throw_rune_error("$derived");
3124
+ throw_rune_error("$inspect");
3125
+ throw_rune_error("$props");
3126
+ throw_rune_error("$bindable");
3127
+ }
3128
+
3129
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/reactivity/store.js
3130
+ var IS_UNMOUNTED = Symbol();
3131
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/legacy/legacy-client.js
3132
+ function createClassComponent(options) {
3133
+ return new Svelte4Component(options);
3134
+ }
3135
+ class Svelte4Component {
3136
+ #events;
3137
+ #instance;
3138
+ constructor(options) {
3139
+ var sources = new Map;
3140
+ var add_source = (key, value) => {
3141
+ var s = mutable_source(value, false, false);
3142
+ sources.set(key, s);
3143
+ return s;
3144
+ };
3145
+ const props = new Proxy({ ...options.props || {}, $$events: {} }, {
3146
+ get(target, prop) {
3147
+ return get(sources.get(prop) ?? add_source(prop, Reflect.get(target, prop)));
3148
+ },
3149
+ has(target, prop) {
3150
+ if (prop === LEGACY_PROPS)
3151
+ return true;
3152
+ get(sources.get(prop) ?? add_source(prop, Reflect.get(target, prop)));
3153
+ return Reflect.has(target, prop);
3154
+ },
3155
+ set(target, prop, value) {
3156
+ set(sources.get(prop) ?? add_source(prop, value), value);
3157
+ return Reflect.set(target, prop, value);
3158
+ }
3159
+ });
3160
+ this.#instance = (options.hydrate ? hydrate : mount)(options.component, {
3161
+ target: options.target,
3162
+ anchor: options.anchor,
3163
+ props,
3164
+ context: options.context,
3165
+ intro: options.intro ?? false,
3166
+ recover: options.recover
3167
+ });
3168
+ if (!async_mode_flag && (!options?.props?.$$host || options.sync === false)) {
3169
+ flushSync();
3170
+ }
3171
+ this.#events = props.$$events;
3172
+ for (const key of Object.keys(this.#instance)) {
3173
+ if (key === "$set" || key === "$destroy" || key === "$on")
3174
+ continue;
3175
+ define_property(this, key, {
3176
+ get() {
3177
+ return this.#instance[key];
3178
+ },
3179
+ set(value) {
3180
+ this.#instance[key] = value;
3181
+ },
3182
+ enumerable: true
3183
+ });
3184
+ }
3185
+ this.#instance.$set = (next2) => {
3186
+ Object.assign(props, next2);
3187
+ };
3188
+ this.#instance.$destroy = () => {
3189
+ unmount(this.#instance);
3190
+ };
3191
+ }
3192
+ $set(props) {
3193
+ this.#instance.$set(props);
3194
+ }
3195
+ $on(event, callback) {
3196
+ this.#events[event] = this.#events[event] || [];
3197
+ const cb = (...args) => callback.call(this, ...args);
3198
+ this.#events[event].push(cb);
3199
+ return () => {
3200
+ this.#events[event] = this.#events[event].filter((fn) => fn !== cb);
3201
+ };
3202
+ }
3203
+ $destroy() {
3204
+ this.#instance.$destroy();
3205
+ }
3206
+ }
3207
+
3208
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/internal/client/dom/elements/custom-element.js
3209
+ var SvelteElement;
3210
+ if (typeof HTMLElement === "function") {
3211
+ SvelteElement = class extends HTMLElement {
3212
+ $$ctor;
3213
+ $$s;
3214
+ $$c;
3215
+ $$cn = false;
3216
+ $$d = {};
3217
+ $$r = false;
3218
+ $$p_d = {};
3219
+ $$l = {};
3220
+ $$l_u = new Map;
3221
+ $$me;
3222
+ constructor($$componentCtor, $$slots, use_shadow_dom) {
3223
+ super();
3224
+ this.$$ctor = $$componentCtor;
3225
+ this.$$s = $$slots;
3226
+ if (use_shadow_dom) {
3227
+ this.attachShadow({ mode: "open" });
3228
+ }
3229
+ }
3230
+ addEventListener(type, listener, options) {
3231
+ this.$$l[type] = this.$$l[type] || [];
3232
+ this.$$l[type].push(listener);
3233
+ if (this.$$c) {
3234
+ const unsub = this.$$c.$on(type, listener);
3235
+ this.$$l_u.set(listener, unsub);
3236
+ }
3237
+ super.addEventListener(type, listener, options);
3238
+ }
3239
+ removeEventListener(type, listener, options) {
3240
+ super.removeEventListener(type, listener, options);
3241
+ if (this.$$c) {
3242
+ const unsub = this.$$l_u.get(listener);
3243
+ if (unsub) {
3244
+ unsub();
3245
+ this.$$l_u.delete(listener);
3246
+ }
3247
+ }
3248
+ }
3249
+ async connectedCallback() {
3250
+ this.$$cn = true;
3251
+ if (!this.$$c) {
3252
+ let create_slot = function(name) {
3253
+ return (anchor) => {
3254
+ const slot = document.createElement("slot");
3255
+ if (name !== "default")
3256
+ slot.name = name;
3257
+ append(anchor, slot);
3258
+ };
3259
+ };
3260
+ await Promise.resolve();
3261
+ if (!this.$$cn || this.$$c) {
3262
+ return;
3263
+ }
3264
+ const $$slots = {};
3265
+ const existing_slots = get_custom_elements_slots(this);
3266
+ for (const name of this.$$s) {
3267
+ if (name in existing_slots) {
3268
+ if (name === "default" && !this.$$d.children) {
3269
+ this.$$d.children = create_slot(name);
3270
+ $$slots.default = true;
3271
+ } else {
3272
+ $$slots[name] = create_slot(name);
3273
+ }
3274
+ }
3275
+ }
3276
+ for (const attribute of this.attributes) {
3277
+ const name = this.$$g_p(attribute.name);
3278
+ if (!(name in this.$$d)) {
3279
+ this.$$d[name] = get_custom_element_value(name, attribute.value, this.$$p_d, "toProp");
3280
+ }
3281
+ }
3282
+ for (const key in this.$$p_d) {
3283
+ if (!(key in this.$$d) && this[key] !== undefined) {
3284
+ this.$$d[key] = this[key];
3285
+ delete this[key];
3286
+ }
3287
+ }
3288
+ this.$$c = createClassComponent({
3289
+ component: this.$$ctor,
3290
+ target: this.shadowRoot || this,
3291
+ props: {
3292
+ ...this.$$d,
3293
+ $$slots,
3294
+ $$host: this
3295
+ }
3296
+ });
3297
+ this.$$me = effect_root(() => {
3298
+ render_effect(() => {
3299
+ this.$$r = true;
3300
+ for (const key of object_keys(this.$$c)) {
3301
+ if (!this.$$p_d[key]?.reflect)
3302
+ continue;
3303
+ this.$$d[key] = this.$$c[key];
3304
+ const attribute_value = get_custom_element_value(key, this.$$d[key], this.$$p_d, "toAttribute");
3305
+ if (attribute_value == null) {
3306
+ this.removeAttribute(this.$$p_d[key].attribute || key);
3307
+ } else {
3308
+ this.setAttribute(this.$$p_d[key].attribute || key, attribute_value);
3309
+ }
3310
+ }
3311
+ this.$$r = false;
3312
+ });
3313
+ });
3314
+ for (const type in this.$$l) {
3315
+ for (const listener of this.$$l[type]) {
3316
+ const unsub = this.$$c.$on(type, listener);
3317
+ this.$$l_u.set(listener, unsub);
3318
+ }
3319
+ }
3320
+ this.$$l = {};
3321
+ }
3322
+ }
3323
+ attributeChangedCallback(attr, _oldValue, newValue) {
3324
+ if (this.$$r)
3325
+ return;
3326
+ attr = this.$$g_p(attr);
3327
+ this.$$d[attr] = get_custom_element_value(attr, newValue, this.$$p_d, "toProp");
3328
+ this.$$c?.$set({ [attr]: this.$$d[attr] });
3329
+ }
3330
+ disconnectedCallback() {
3331
+ this.$$cn = false;
3332
+ Promise.resolve().then(() => {
3333
+ if (!this.$$cn && this.$$c) {
3334
+ this.$$c.$destroy();
3335
+ this.$$me();
3336
+ this.$$c = undefined;
3337
+ }
3338
+ });
3339
+ }
3340
+ $$g_p(attribute_name) {
3341
+ return object_keys(this.$$p_d).find((key) => this.$$p_d[key].attribute === attribute_name || !this.$$p_d[key].attribute && key.toLowerCase() === attribute_name) || attribute_name;
3342
+ }
3343
+ };
3344
+ }
3345
+ function get_custom_element_value(prop, value, props_definition, transform) {
3346
+ const type = props_definition[prop]?.type;
3347
+ value = type === "Boolean" && typeof value !== "boolean" ? value != null : value;
3348
+ if (!transform || !props_definition[prop]) {
3349
+ return value;
3350
+ } else if (transform === "toAttribute") {
3351
+ switch (type) {
3352
+ case "Object":
3353
+ case "Array":
3354
+ return value == null ? null : JSON.stringify(value);
3355
+ case "Boolean":
3356
+ return value ? "" : null;
3357
+ case "Number":
3358
+ return value == null ? null : value;
3359
+ default:
3360
+ return value;
3361
+ }
3362
+ } else {
3363
+ switch (type) {
3364
+ case "Object":
3365
+ case "Array":
3366
+ return value && JSON.parse(value);
3367
+ case "Boolean":
3368
+ return value;
3369
+ case "Number":
3370
+ return value != null ? +value : value;
3371
+ default:
3372
+ return value;
3373
+ }
3374
+ }
3375
+ }
3376
+ function get_custom_elements_slots(element) {
3377
+ const result = {};
3378
+ element.childNodes.forEach((node) => {
3379
+ result[node.slot || "default"] = true;
3380
+ });
3381
+ return result;
3382
+ }
3383
+ // ../../node_modules/.bun/svelte@5.46.0/node_modules/svelte/src/attachments/index.js
3384
+ function createAttachmentKey() {
3385
+ return Symbol(ATTACHMENT_KEY);
3386
+ }
3387
+
3388
+ // src/runtime/origin.ts
3389
+ function __createOrigin(config) {
3390
+ const { __attrSchema, __parents = [], __create, __onInit, __attachments = {} } = config;
3391
+ function factory(attrsOrInitArg, ...initArgs) {
3392
+ let attrs;
3393
+ let allInitArgs;
3394
+ if (attrsOrInitArg === null || attrsOrInitArg === undefined) {
3395
+ attrs = {};
3396
+ allInitArgs = initArgs;
3397
+ } else if (typeof attrsOrInitArg !== "object" || Array.isArray(attrsOrInitArg)) {
3398
+ attrs = {};
3399
+ allInitArgs = [attrsOrInitArg, ...initArgs];
3400
+ } else {
3401
+ attrs = attrsOrInitArg;
3402
+ allInitArgs = initArgs;
3403
+ }
3404
+ const mergedSchema = getMergedAttrSchemaFromConfig(__attrSchema, __parents);
3405
+ const attrsWithDefaults = applyDefaults(mergedSchema, attrs);
3406
+ const superInstances = __parents.map((Parent) => {
3407
+ return Parent(attrsWithDefaults);
3408
+ });
3409
+ const superArg = superInstances.length === 1 ? superInstances[0] : superInstances.length > 1 ? superInstances : undefined;
3410
+ const instance = __create(attrsWithDefaults, superArg);
3411
+ if (instance === null || instance === undefined) {
3412
+ throw new Error("[svelte-origin] __create function returned null/undefined - must return an object");
3413
+ }
3414
+ if (typeof instance !== "object") {
3415
+ throw new Error(`[svelte-origin] __create function returned ${typeof instance} - must return an object`);
3416
+ }
3417
+ if (__onInit) {
3418
+ const cleanup = __onInit.call(instance, ...allInitArgs);
3419
+ if (typeof cleanup === "function") {
3420
+ Object.defineProperty(instance, "__cleanup", {
3421
+ value: cleanup,
3422
+ writable: false,
3423
+ enumerable: false
3424
+ });
3425
+ }
3426
+ }
3427
+ const cachedAttachmentKeys = new Map;
3428
+ for (const name of Object.keys(__attachments)) {
3429
+ cachedAttachmentKeys.set(name, createAttachmentKey());
3430
+ }
3431
+ Object.defineProperty(instance, "$attachments", {
3432
+ get() {
3433
+ const result = {};
3434
+ for (const [name, fn] of Object.entries(__attachments)) {
3435
+ const key2 = cachedAttachmentKeys.get(name);
3436
+ result[key2] = (element2) => fn.call(instance, element2);
3437
+ }
3438
+ for (const sym of Object.getOwnPropertySymbols(attrs)) {
3439
+ const fn = attrs[sym];
3440
+ if (typeof fn === "function") {
3441
+ result[sym] = fn;
3442
+ }
3443
+ }
3444
+ return result;
3445
+ },
3446
+ enumerable: true
3447
+ });
3448
+ return instance;
3449
+ }
3450
+ Object.defineProperty(factory, "__origin", { value: true, writable: false, enumerable: true });
3451
+ Object.defineProperty(factory, "__attrSchema", { value: __attrSchema, writable: false, enumerable: true });
3452
+ Object.defineProperty(factory, "__parents", { value: __parents, writable: false, enumerable: true });
3453
+ Object.defineProperty(factory, "__create", { value: __create, writable: false, enumerable: true });
3454
+ if (__onInit) {
3455
+ Object.defineProperty(factory, "__onInit", { value: __onInit, writable: false, enumerable: true });
3456
+ }
3457
+ return factory;
3458
+ }
3459
+ function getMergedAttrSchemaFromConfig(attrSchema, parents, visited = new Set) {
3460
+ const merged = {};
3461
+ for (const parent of parents) {
3462
+ if (visited.has(parent)) {
3463
+ console.warn("[svelte-origin] Circular inheritance detected - skipping parent to prevent infinite loop");
3464
+ continue;
3465
+ }
3466
+ const parentSchema = getMergedAttrSchema(parent, new Set(visited));
3467
+ Object.assign(merged, parentSchema);
3468
+ }
3469
+ Object.assign(merged, attrSchema);
3470
+ return merged;
3471
+ }
3472
+ function __attrsFor(factory, rawAttrs) {
3473
+ const factoryWithSchema = factory;
3474
+ const schema = getMergedAttrSchema(factoryWithSchema);
3475
+ const wrapper = {};
3476
+ const localValues = {};
3477
+ const hasLocalValue = {};
3478
+ for (const key2 of Object.keys(schema)) {
3479
+ Object.defineProperty(wrapper, key2, {
3480
+ get() {
3481
+ if (hasLocalValue[key2]) {
3482
+ return localValues[key2];
3483
+ }
3484
+ return rawAttrs[key2];
3485
+ },
3486
+ set(value) {
3487
+ localValues[key2] = value;
3488
+ hasLocalValue[key2] = true;
3489
+ try {
3490
+ rawAttrs[key2] = value;
3491
+ } catch {}
3492
+ },
3493
+ enumerable: true,
3494
+ configurable: true
3495
+ });
3496
+ }
3497
+ for (const sym of Object.getOwnPropertySymbols(rawAttrs)) {
3498
+ Object.defineProperty(wrapper, sym, {
3499
+ get() {
3500
+ return rawAttrs[sym];
3501
+ },
3502
+ enumerable: false,
3503
+ configurable: true
3504
+ });
3505
+ }
3506
+ return new Proxy(wrapper, {
3507
+ get(target, prop2) {
3508
+ if (prop2 in target) {
3509
+ return target[prop2];
3510
+ }
3511
+ return rawAttrs[prop2];
3512
+ },
3513
+ set(target, prop2, value) {
3514
+ if (prop2 in target) {
3515
+ target[prop2] = value;
3516
+ return true;
3517
+ }
3518
+ try {
3519
+ rawAttrs[prop2] = value;
3520
+ } catch {
3521
+ localValues[prop2] = value;
3522
+ hasLocalValue[prop2] = true;
3523
+ }
3524
+ return true;
3525
+ },
3526
+ has(target, prop2) {
3527
+ return prop2 in target || prop2 in rawAttrs;
3528
+ },
3529
+ ownKeys() {
3530
+ return [...Object.keys(wrapper), ...Object.getOwnPropertySymbols(rawAttrs)];
3531
+ },
3532
+ getOwnPropertyDescriptor(target, prop2) {
3533
+ if (prop2 in target) {
3534
+ return Object.getOwnPropertyDescriptor(target, prop2);
3535
+ }
3536
+ return Object.getOwnPropertyDescriptor(rawAttrs, prop2);
3537
+ }
3538
+ });
3539
+ }
3540
+ function getMergedAttrSchema(factory, visited = new Set) {
3541
+ if (visited.has(factory)) {
3542
+ console.warn("[svelte-origin] Circular inheritance detected - skipping to prevent infinite loop");
3543
+ return {};
3544
+ }
3545
+ visited.add(factory);
3546
+ const parents = factory.__parents || [];
3547
+ const merged = {};
3548
+ for (const parent of parents) {
3549
+ const parentSchema = getMergedAttrSchema(parent, visited);
3550
+ Object.assign(merged, parentSchema);
3551
+ }
3552
+ Object.assign(merged, factory.__attrSchema);
3553
+ return merged;
3554
+ }
3555
+ function generateAttrsDestructuring(schema) {
3556
+ const parts = [];
3557
+ for (const [key2, info] of Object.entries(schema)) {
3558
+ const defaultStr = serializeDefault(info.default);
3559
+ if (info.bindable) {
3560
+ if (info.hasDefault) {
3561
+ parts.push(`${key2} = $bindable(${defaultStr})`);
3562
+ } else {
3563
+ parts.push(`${key2} = $bindable()`);
3564
+ }
3565
+ } else if (info.hasDefault) {
3566
+ parts.push(`${key2} = ${defaultStr}`);
3567
+ } else {
3568
+ parts.push(key2);
3569
+ }
3570
+ }
3571
+ return `{ ${parts.join(", ")} }`;
3572
+ }
3573
+ function generateReactiveAttrsObject(schema) {
3574
+ const parts = [];
3575
+ for (const [key2, info] of Object.entries(schema)) {
3576
+ parts.push(`get ${key2}() { return ${key2} }`);
3577
+ if (info.bindable) {
3578
+ parts.push(`set ${key2}(v) { ${key2} = v }`);
3579
+ }
3580
+ }
3581
+ return `{ ${parts.join(", ")} }`;
3582
+ }
3583
+ function serializeDefault(value) {
3584
+ if (value === undefined) {
3585
+ return "undefined";
3586
+ }
3587
+ if (value === null) {
3588
+ return "null";
3589
+ }
3590
+ if (typeof value === "string") {
3591
+ return JSON.stringify(value);
3592
+ }
3593
+ if (typeof value === "number" || typeof value === "boolean") {
3594
+ return String(value);
3595
+ }
3596
+ if (typeof value === "symbol") {
3597
+ console.warn("[svelte-origin] Symbol cannot be used as default value - using undefined");
3598
+ return "undefined";
3599
+ }
3600
+ if (typeof value === "function") {
3601
+ console.warn("[svelte-origin] Function cannot be used as default value - using undefined");
3602
+ return "undefined";
3603
+ }
3604
+ if (Array.isArray(value)) {
3605
+ try {
3606
+ return JSON.stringify(value);
3607
+ } catch {
3608
+ console.warn("[svelte-origin] Array contains non-serializable values - using []");
3609
+ return "[]";
3610
+ }
3611
+ }
3612
+ if (typeof value === "object") {
3613
+ try {
3614
+ return JSON.stringify(value);
3615
+ } catch {
3616
+ console.warn("[svelte-origin] Object contains non-serializable values - using {}");
3617
+ return "{}";
3618
+ }
3619
+ }
3620
+ if (typeof value === "bigint") {
3621
+ return `${value}n`;
3622
+ }
3623
+ return String(value);
3624
+ }
3625
+ function __createAttrs(config) {
3626
+ const { __attrSchema, __parents = [] } = config;
3627
+ const factory = {
3628
+ __attrs: true,
3629
+ __attrSchema,
3630
+ __parents
3631
+ };
3632
+ return factory;
3633
+ }
3634
+ function isAttrsFactory(value) {
3635
+ return value !== null && typeof value === "object" && "__attrs" in value && value.__attrs === true;
3636
+ }
3637
+ function getMergedAttrSchemaFromAttrs(factory, visited = new Set) {
3638
+ if (visited.has(factory)) {
3639
+ console.warn("[svelte-origin] Circular inheritance detected in AttrsFactory - skipping to prevent infinite loop");
3640
+ return {};
3641
+ }
3642
+ visited.add(factory);
3643
+ const parents = factory.__parents || [];
3644
+ const merged = {};
3645
+ for (const parent of parents) {
3646
+ const parentSchema = getMergedAttrSchemaFromAttrs(parent, visited);
3647
+ Object.assign(merged, parentSchema);
3648
+ }
3649
+ Object.assign(merged, factory.__attrSchema);
3650
+ return merged;
3651
+ }
3652
+ export {
3653
+ isBindable,
3654
+ isAttrsFactory,
3655
+ getMergedAttrSchemaFromAttrs,
3656
+ generateReactiveAttrsObject,
3657
+ generateAttrsDestructuring,
3658
+ generateAttrKeys,
3659
+ extractAttrSchema,
3660
+ bindable,
3661
+ applyDefaults,
3662
+ __createOrigin,
3663
+ __createAttrs,
3664
+ __attrsFor
3665
+ };