@pie-element/mc-populated-blank 0.3.0-next.4 → 0.3.0-next.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,16 @@
1
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/disclose-version.js
1
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/disclose-version.js
2
2
  if (typeof window !== "undefined") {
3
3
  var _window$__svelte, _window;
4
4
  ((_window$__svelte = (_window = window).__svelte ?? (_window.__svelte = {})).v ?? (_window$__svelte.v = /* @__PURE__ */ new Set())).add("5");
5
5
  }
6
6
  //#endregion
7
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/constants.js
7
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/constants.js
8
8
  var HYDRATION_ERROR = {};
9
9
  var UNINITIALIZED = Symbol("uninitialized");
10
10
  var NAMESPACE_SVG = "http://www.w3.org/2000/svg";
11
11
  var NAMESPACE_MATHML = "http://www.w3.org/1998/Math/MathML";
12
12
  //#endregion
13
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/shared/utils.js
13
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/shared/utils.js
14
14
  var is_array = Array.isArray;
15
15
  var index_of = Array.prototype.indexOf;
16
16
  var includes = Array.prototype.includes;
@@ -112,6 +112,8 @@ var REACTION_IS_UPDATING = 1 << 21;
112
112
  var ASYNC = 1 << 22;
113
113
  var ERROR_VALUE = 1 << 23;
114
114
  var STATE_SYMBOL = Symbol("$state");
115
+ /** Marks component export objects, so that `proxy(...)` leaves them untouched */
116
+ var COMPONENT_SYMBOL = Symbol("component");
115
117
  var LEGACY_PROPS = Symbol("legacy props");
116
118
  var LOADING_ATTR_SYMBOL = Symbol("");
117
119
  var ATTRIBUTES_CACHE = Symbol("attributes");
@@ -127,98 +129,6 @@ var STALE_REACTION = new class StaleReactionError extends Error {
127
129
  }
128
130
  }();
129
131
  var IS_XHTML = !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml");
130
- //#endregion
131
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/errors.js
132
- /**
133
- * Cannot create a `$derived(...)` with an `await` expression outside of an effect tree
134
- * @returns {never}
135
- */
136
- function async_derived_orphan() {
137
- throw new Error(`https://svelte.dev/e/async_derived_orphan`);
138
- }
139
- /**
140
- * Keyed each block has duplicate key `%value%` at indexes %a% and %b%
141
- * @param {string} a
142
- * @param {string} b
143
- * @param {string | undefined | null} [value]
144
- * @returns {never}
145
- */
146
- function each_key_duplicate(a, b, value) {
147
- throw new Error(`https://svelte.dev/e/each_key_duplicate`);
148
- }
149
- /**
150
- * `%rune%` cannot be used inside an effect cleanup function
151
- * @param {string} rune
152
- * @returns {never}
153
- */
154
- function effect_in_teardown(rune) {
155
- throw new Error(`https://svelte.dev/e/effect_in_teardown`);
156
- }
157
- /**
158
- * Effect cannot be created inside a `$derived` value that was not itself created inside an effect
159
- * @returns {never}
160
- */
161
- function effect_in_unowned_derived() {
162
- throw new Error(`https://svelte.dev/e/effect_in_unowned_derived`);
163
- }
164
- /**
165
- * `%rune%` can only be used inside an effect (e.g. during component initialisation)
166
- * @param {string} rune
167
- * @returns {never}
168
- */
169
- function effect_orphan(rune) {
170
- throw new Error(`https://svelte.dev/e/effect_orphan`);
171
- }
172
- /**
173
- * Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
174
- * @returns {never}
175
- */
176
- function effect_update_depth_exceeded() {
177
- throw new Error(`https://svelte.dev/e/effect_update_depth_exceeded`);
178
- }
179
- /**
180
- * Failed to hydrate the application
181
- * @returns {never}
182
- */
183
- function hydration_failed() {
184
- throw new Error(`https://svelte.dev/e/hydration_failed`);
185
- }
186
- /**
187
- * Cannot do `bind:%key%={undefined}` when `%key%` has a fallback value
188
- * @param {string} key
189
- * @returns {never}
190
- */
191
- function props_invalid_value(key) {
192
- throw new Error(`https://svelte.dev/e/props_invalid_value`);
193
- }
194
- /**
195
- * Property descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.
196
- * @returns {never}
197
- */
198
- function state_descriptors_fixed() {
199
- throw new Error(`https://svelte.dev/e/state_descriptors_fixed`);
200
- }
201
- /**
202
- * Cannot set prototype of `$state` object
203
- * @returns {never}
204
- */
205
- function state_prototype_fixed() {
206
- throw new Error(`https://svelte.dev/e/state_prototype_fixed`);
207
- }
208
- /**
209
- * Updating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`
210
- * @returns {never}
211
- */
212
- function state_unsafe_mutation() {
213
- throw new Error(`https://svelte.dev/e/state_unsafe_mutation`);
214
- }
215
- /**
216
- * A `<svelte:boundary>` `reset` function cannot be called while an error is still being handled
217
- * @returns {never}
218
- */
219
- function svelte_boundary_reset_onerror() {
220
- throw new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);
221
- }
222
132
  /**
223
133
  * Reading a derived belonging to a now-destroyed effect may result in stale values
224
134
  */
@@ -239,7 +149,7 @@ function svelte_boundary_reset_noop() {
239
149
  console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`);
240
150
  }
241
151
  //#endregion
242
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/hydration.js
152
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/hydration.js
243
153
  /** @import { TemplateNode } from '#client' */
244
154
  /**
245
155
  * Use this variable to guard everything related to hydration code so it can be treeshaken out
@@ -318,7 +228,7 @@ function read_hydration_instruction(node) {
318
228
  return node.data;
319
229
  }
320
230
  //#endregion
321
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/reactivity/equality.js
231
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/equality.js
322
232
  /** @import { Equals } from '#client' */
323
233
  /** @type {Equals} */
324
234
  function equals(value) {
@@ -337,13 +247,105 @@ function safe_equals(value) {
337
247
  return !safe_not_equal(value, this.v);
338
248
  }
339
249
  //#endregion
340
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/flags/index.js
250
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/errors.js
251
+ /**
252
+ * Cannot create a `$derived(...)` with an `await` expression outside of an effect tree
253
+ * @returns {never}
254
+ */
255
+ function async_derived_orphan() {
256
+ throw new Error(`https://svelte.dev/e/async_derived_orphan`);
257
+ }
258
+ /**
259
+ * Keyed each block has duplicate key `%value%` at indexes %a% and %b%
260
+ * @param {string} a
261
+ * @param {string} b
262
+ * @param {string | undefined | null} [value]
263
+ * @returns {never}
264
+ */
265
+ function each_key_duplicate(a, b, value) {
266
+ throw new Error(`https://svelte.dev/e/each_key_duplicate`);
267
+ }
268
+ /**
269
+ * `%rune%` cannot be used inside an effect cleanup function
270
+ * @param {string} rune
271
+ * @returns {never}
272
+ */
273
+ function effect_in_teardown(rune) {
274
+ throw new Error(`https://svelte.dev/e/effect_in_teardown`);
275
+ }
276
+ /**
277
+ * Effect cannot be created inside a `$derived` value that was not itself created inside an effect
278
+ * @returns {never}
279
+ */
280
+ function effect_in_unowned_derived() {
281
+ throw new Error(`https://svelte.dev/e/effect_in_unowned_derived`);
282
+ }
283
+ /**
284
+ * `%rune%` can only be used inside an effect (e.g. during component initialisation)
285
+ * @param {string} rune
286
+ * @returns {never}
287
+ */
288
+ function effect_orphan(rune) {
289
+ throw new Error(`https://svelte.dev/e/effect_orphan`);
290
+ }
291
+ /**
292
+ * Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
293
+ * @returns {never}
294
+ */
295
+ function effect_update_depth_exceeded() {
296
+ throw new Error(`https://svelte.dev/e/effect_update_depth_exceeded`);
297
+ }
298
+ /**
299
+ * Failed to hydrate the application
300
+ * @returns {never}
301
+ */
302
+ function hydration_failed() {
303
+ throw new Error(`https://svelte.dev/e/hydration_failed`);
304
+ }
305
+ /**
306
+ * Cannot do `bind:%key%={undefined}` when `%key%` has a fallback value
307
+ * @param {string} key
308
+ * @returns {never}
309
+ */
310
+ function props_invalid_value(key) {
311
+ throw new Error(`https://svelte.dev/e/props_invalid_value`);
312
+ }
313
+ /**
314
+ * Property descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.
315
+ * @returns {never}
316
+ */
317
+ function state_descriptors_fixed() {
318
+ throw new Error(`https://svelte.dev/e/state_descriptors_fixed`);
319
+ }
320
+ /**
321
+ * Cannot set prototype of `$state` object
322
+ * @returns {never}
323
+ */
324
+ function state_prototype_fixed() {
325
+ throw new Error(`https://svelte.dev/e/state_prototype_fixed`);
326
+ }
327
+ /**
328
+ * Updating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`
329
+ * @returns {never}
330
+ */
331
+ function state_unsafe_mutation() {
332
+ throw new Error(`https://svelte.dev/e/state_unsafe_mutation`);
333
+ }
334
+ /**
335
+ * A `<svelte:boundary>` `reset` function cannot be called while an error is still being handled
336
+ * @returns {never}
337
+ */
338
+ function svelte_boundary_reset_onerror() {
339
+ throw new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);
340
+ }
341
+ //#endregion
342
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/flags/index.js
341
343
  /** True if experimental.async=true */
342
344
  var async_mode_flag = false;
343
345
  /** True if we're not certain that we only have Svelte 5 code in the compilation */
344
346
  var legacy_mode_flag = false;
345
347
  //#endregion
346
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/context.js
348
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/context.js
347
349
  /** @import { ComponentContext, DevStackEntry, Effect } from '#client' */
348
350
  /** @type {ComponentContext | null} */
349
351
  var component_context = null;
@@ -388,14 +390,22 @@ function pop(component) {
388
390
  if (component !== void 0) context.x = component;
389
391
  context.i = true;
390
392
  component_context = context.p;
391
- return component ?? {};
393
+ return mark_as_component(component);
394
+ }
395
+ /**
396
+ * Add a symbol to the object (or create one if undefined) to mark it as a component so it isn't proxified.
397
+ * @param {any} component
398
+ */
399
+ function mark_as_component(component = {}) {
400
+ define_property(component, COMPONENT_SYMBOL, { value: true });
401
+ return component;
392
402
  }
393
403
  /** @returns {boolean} */
394
404
  function is_runes() {
395
405
  return !legacy_mode_flag || component_context !== null && component_context.l === null;
396
406
  }
397
407
  //#endregion
398
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/task.js
408
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/task.js
399
409
  /** @type {Array<() => void>} */
400
410
  var micro_tasks = [];
401
411
  function run_micro_tasks() {
@@ -421,40 +431,8 @@ function queue_micro_task(fn) {
421
431
  function flush_tasks() {
422
432
  while (micro_tasks.length > 0) run_micro_tasks();
423
433
  }
424
- /**
425
- * @param {unknown} error
426
- */
427
- function handle_error(error) {
428
- var effect = active_effect;
429
- if (effect === null) {
430
- /** @type {Derived} */ active_reaction.f |= ERROR_VALUE;
431
- return error;
432
- }
433
- if ((effect.f & 32768) === 0 && (effect.f & 4) === 0) throw error;
434
- invoke_error_boundary(error, effect);
435
- }
436
- /**
437
- * @param {unknown} error
438
- * @param {Effect | null} effect
439
- */
440
- function invoke_error_boundary(error, effect) {
441
- if (effect !== null && (effect.f & 16384) !== 0) return;
442
- while (effect !== null) {
443
- if ((effect.f & 128) !== 0) {
444
- if ((effect.f & 32768) === 0) throw error;
445
- try {
446
- /** @type {Boundary} */ effect.b.error(error);
447
- return;
448
- } catch (e) {
449
- error = e;
450
- }
451
- }
452
- effect = effect.parent;
453
- }
454
- throw error;
455
- }
456
434
  //#endregion
457
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/reactivity/status.js
435
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/status.js
458
436
  /** @import { Derived, Signal } from '#client' */
459
437
  var STATUS_MASK = ~(DIRTY | MAYBE_DIRTY | CLEAN);
460
438
  /**
@@ -473,7 +451,7 @@ function update_derived_status(derived) {
473
451
  else set_signal_status(derived, MAYBE_DIRTY);
474
452
  }
475
453
  //#endregion
476
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/reactivity/utils.js
454
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/utils.js
477
455
  /** @import { Derived, Effect, Value } from '#client' */
478
456
  /**
479
457
  * @param {Value[] | null} deps
@@ -501,7 +479,7 @@ function defer_effect(effect, dirty_effects, maybe_dirty_effects) {
501
479
  set_signal_status(effect, CLEAN);
502
480
  }
503
481
  //#endregion
504
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/reactivity/store.js
482
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/store.js
505
483
  /**
506
484
  * We set this to `true` when updating a store so that we correctly
507
485
  * schedule effects if the update takes place inside a `$:` effect
@@ -531,7 +509,7 @@ function capture_store_binding(fn) {
531
509
  }
532
510
  }
533
511
  //#endregion
534
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js
512
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js
535
513
  /**
536
514
  * @template T
537
515
  * @param {() => T} fn
@@ -549,482 +527,8 @@ function without_reactive_context(fn) {
549
527
  }
550
528
  }
551
529
  //#endregion
552
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/reactivity/create-subscriber.js
553
- /**
554
- * Returns a `subscribe` function that integrates external event-based systems with Svelte's reactivity.
555
- * It's particularly useful for integrating with web APIs like `MediaQuery`, `IntersectionObserver`, or `WebSocket`.
556
- *
557
- * If `subscribe` is called inside an effect (including indirectly, for example inside a getter),
558
- * the `start` callback will be called with an `update` function. Whenever `update` is called, the effect re-runs.
559
- *
560
- * If `start` returns a cleanup function, it will be called when the effect is destroyed.
561
- *
562
- * If `subscribe` is called in multiple effects, `start` will only be called once as long as the effects
563
- * are active, and the returned teardown function will only be called when all effects are destroyed.
564
- *
565
- * It's best understood with an example. Here's an implementation of [`MediaQuery`](https://svelte.dev/docs/svelte/svelte-reactivity#MediaQuery):
566
- *
567
- * ```js
568
- * import { createSubscriber } from 'svelte/reactivity';
569
- * import { on } from 'svelte/events';
570
- *
571
- * export class MediaQuery {
572
- * #query;
573
- * #subscribe;
574
- *
575
- * constructor(query) {
576
- * this.#query = window.matchMedia(`(${query})`);
577
- *
578
- * this.#subscribe = createSubscriber((update) => {
579
- * // when the `change` event occurs, re-run any effects that read `this.current`
580
- * const off = on(this.#query, 'change', update);
581
- *
582
- * // stop listening when all the effects are destroyed
583
- * return () => off();
584
- * });
585
- * }
586
- *
587
- * get current() {
588
- * // This makes the getter reactive, if read in an effect
589
- * this.#subscribe();
590
- *
591
- * // Return the current state of the query, whether or not we're in an effect
592
- * return this.#query.matches;
593
- * }
594
- * }
595
- * ```
596
- * @param {(update: () => void) => (() => void) | void} start
597
- * @since 5.7.0
598
- */
599
- function createSubscriber(start) {
600
- let subscribers = 0;
601
- let version = source(0);
602
- /** @type {(() => void) | void} */
603
- let stop;
604
- return () => {
605
- if (effect_tracking()) {
606
- get(version);
607
- render_effect(() => {
608
- if (subscribers === 0) stop = untrack(() => start(() => increment(version)));
609
- subscribers += 1;
610
- return () => {
611
- queue_micro_task(() => {
612
- subscribers -= 1;
613
- if (subscribers === 0) {
614
- stop?.();
615
- stop = void 0;
616
- increment(version);
617
- }
618
- });
619
- };
620
- });
621
- }
622
- };
623
- }
624
- //#endregion
625
- //#region \0@oxc-project+runtime@0.139.0/helpers/esm/checkPrivateRedeclaration.js
626
- function _checkPrivateRedeclaration(e, t) {
627
- if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
628
- }
629
- //#endregion
630
- //#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateMethodInitSpec.js
631
- function _classPrivateMethodInitSpec(e, a) {
632
- _checkPrivateRedeclaration(e, a), a.add(e);
633
- }
634
- //#endregion
635
- //#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateFieldInitSpec.js
636
- function _classPrivateFieldInitSpec(e, t, a) {
637
- _checkPrivateRedeclaration(e, t), t.set(e, a);
638
- }
639
- //#endregion
640
- //#region \0@oxc-project+runtime@0.139.0/helpers/esm/assertClassBrand.js
641
- function _assertClassBrand(e, t, n) {
642
- if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
643
- throw new TypeError("Private element is not present on this object");
644
- }
645
- //#endregion
646
- //#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateFieldSet2.js
647
- function _classPrivateFieldSet2(s, a, r) {
648
- return s.set(_assertClassBrand(s, a), r), r;
649
- }
650
- //#endregion
651
- //#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateFieldGet2.js
652
- function _classPrivateFieldGet2(s, a) {
653
- return s.get(_assertClassBrand(s, a));
654
- }
655
- //#endregion
656
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/blocks/boundary.js
657
- /** @import { Effect, Source, TemplateNode, } from '#client' */
658
- /**
659
- * @typedef {{
660
- * onerror?: ((error: unknown, reset: () => void) => void) | null;
661
- * failed?: ((anchor: Node, error: () => unknown, reset: () => () => void) => void) | null;
662
- * pending?: ((anchor: Node) => void) | null;
663
- * }} BoundaryProps
664
- */
665
- var flags = EFFECT_TRANSPARENT | EFFECT_PRESERVED;
666
- /**
667
- * @param {TemplateNode} node
668
- * @param {BoundaryProps} props
669
- * @param {((anchor: Node) => void)} children
670
- * @param {((error: unknown) => unknown) | undefined} [transform_error]
671
- * @returns {void}
672
- */
673
- function boundary(node, props, children, transform_error) {
674
- new Boundary(node, props, children, transform_error);
675
- }
676
- var _anchor = /* @__PURE__ */ new WeakMap();
677
- var _hydrate_open = /* @__PURE__ */ new WeakMap();
678
- var _props = /* @__PURE__ */ new WeakMap();
679
- var _children = /* @__PURE__ */ new WeakMap();
680
- var _effect = /* @__PURE__ */ new WeakMap();
681
- var _main_effect = /* @__PURE__ */ new WeakMap();
682
- var _pending_effect = /* @__PURE__ */ new WeakMap();
683
- var _failed_effect = /* @__PURE__ */ new WeakMap();
684
- var _offscreen_fragment = /* @__PURE__ */ new WeakMap();
685
- var _local_pending_count = /* @__PURE__ */ new WeakMap();
686
- var _pending_count = /* @__PURE__ */ new WeakMap();
687
- var _pending_count_update_queued = /* @__PURE__ */ new WeakMap();
688
- var _dirty_effects$1 = /* @__PURE__ */ new WeakMap();
689
- var _maybe_dirty_effects$1 = /* @__PURE__ */ new WeakMap();
690
- var _effect_pending = /* @__PURE__ */ new WeakMap();
691
- var _effect_pending_subscriber = /* @__PURE__ */ new WeakMap();
692
- var _Boundary_brand = /* @__PURE__ */ new WeakSet();
693
- var Boundary = class {
694
- /**
695
- * @param {TemplateNode} node
696
- * @param {BoundaryProps} props
697
- * @param {((anchor: Node) => void)} children
698
- * @param {((error: unknown) => unknown) | undefined} [transform_error]
699
- */
700
- constructor(node, props, children, transform_error) {
701
- _classPrivateMethodInitSpec(this, _Boundary_brand);
702
- _defineProperty(
703
- this,
704
- /** @type {Boundary | null} */
705
- "parent",
706
- void 0
707
- );
708
- _defineProperty(this, "is_pending", false);
709
- _defineProperty(
710
- this,
711
- /**
712
- * API-level transformError transform function. Transforms errors before they reach the `failed` snippet.
713
- * Inherited from parent boundary, or defaults to identity.
714
- * @type {(error: unknown) => unknown}
715
- */
716
- "transform_error",
717
- void 0
718
- );
719
- _classPrivateFieldInitSpec(this, _anchor, void 0);
720
- _classPrivateFieldInitSpec(this, _hydrate_open, hydrating ? hydrate_node : null);
721
- _classPrivateFieldInitSpec(this, _props, void 0);
722
- _classPrivateFieldInitSpec(this, _children, void 0);
723
- _classPrivateFieldInitSpec(this, _effect, void 0);
724
- _classPrivateFieldInitSpec(this, _main_effect, null);
725
- _classPrivateFieldInitSpec(this, _pending_effect, null);
726
- _classPrivateFieldInitSpec(this, _failed_effect, null);
727
- _classPrivateFieldInitSpec(this, _offscreen_fragment, null);
728
- _classPrivateFieldInitSpec(this, _local_pending_count, 0);
729
- _classPrivateFieldInitSpec(this, _pending_count, 0);
730
- _classPrivateFieldInitSpec(this, _pending_count_update_queued, false);
731
- _classPrivateFieldInitSpec(this, _dirty_effects$1, /* @__PURE__ */ new Set());
732
- _classPrivateFieldInitSpec(this, _maybe_dirty_effects$1, /* @__PURE__ */ new Set());
733
- _classPrivateFieldInitSpec(this, _effect_pending, null);
734
- _classPrivateFieldInitSpec(this, _effect_pending_subscriber, createSubscriber(() => {
735
- _classPrivateFieldSet2(_effect_pending, this, source(_classPrivateFieldGet2(_local_pending_count, this)));
736
- return () => {
737
- _classPrivateFieldSet2(_effect_pending, this, null);
738
- };
739
- }));
740
- _classPrivateFieldSet2(_anchor, this, node);
741
- _classPrivateFieldSet2(_props, this, props);
742
- _classPrivateFieldSet2(_children, this, (anchor) => {
743
- var effect = active_effect;
744
- effect.b = this;
745
- effect.f |= 128;
746
- children(anchor);
747
- });
748
- this.parent = active_effect.b;
749
- this.transform_error = transform_error ?? this.parent?.transform_error ?? ((e) => e);
750
- _classPrivateFieldSet2(_effect, this, block(() => {
751
- if (hydrating) {
752
- const comment = _classPrivateFieldGet2(_hydrate_open, this);
753
- hydrate_next();
754
- const server_rendered_pending = comment.data === "[!";
755
- if (comment.data.startsWith("[?")) {
756
- const serialized_error = JSON.parse(comment.data.slice(2));
757
- _assertClassBrand(_Boundary_brand, this, _hydrate_failed_content).call(this, serialized_error);
758
- } else if (server_rendered_pending) _assertClassBrand(_Boundary_brand, this, _hydrate_pending_content).call(this);
759
- else _assertClassBrand(_Boundary_brand, this, _hydrate_resolved_content).call(this);
760
- } else _assertClassBrand(_Boundary_brand, this, _render).call(this);
761
- }, flags));
762
- if (hydrating) _classPrivateFieldSet2(_anchor, this, hydrate_node);
763
- }
764
- /**
765
- * Defer an effect inside a pending boundary until the boundary resolves
766
- * @param {Effect} effect
767
- */
768
- defer_effect(effect) {
769
- defer_effect(effect, _classPrivateFieldGet2(_dirty_effects$1, this), _classPrivateFieldGet2(_maybe_dirty_effects$1, this));
770
- }
771
- /**
772
- * Returns `false` if the effect exists inside a boundary whose pending snippet is shown
773
- * @returns {boolean}
774
- */
775
- is_rendered() {
776
- return !this.is_pending && (!this.parent || this.parent.is_rendered());
777
- }
778
- has_pending_snippet() {
779
- return !!_classPrivateFieldGet2(_props, this).pending;
780
- }
781
- /**
782
- * Update the source that powers `$effect.pending()` inside this boundary,
783
- * and controls when the current `pending` snippet (if any) is removed.
784
- * Do not call from inside the class
785
- * @param {1 | -1} d
786
- * @param {Batch} batch
787
- */
788
- update_pending_count(d, batch) {
789
- _assertClassBrand(_Boundary_brand, this, _update_pending_count).call(this, d, batch);
790
- _classPrivateFieldSet2(_local_pending_count, this, _classPrivateFieldGet2(_local_pending_count, this) + d);
791
- if (!_classPrivateFieldGet2(_effect_pending, this) || _classPrivateFieldGet2(_pending_count_update_queued, this)) return;
792
- _classPrivateFieldSet2(_pending_count_update_queued, this, true);
793
- queue_micro_task(() => {
794
- _classPrivateFieldSet2(_pending_count_update_queued, this, false);
795
- if (_classPrivateFieldGet2(_effect_pending, this)) internal_set(_classPrivateFieldGet2(_effect_pending, this), _classPrivateFieldGet2(_local_pending_count, this));
796
- });
797
- }
798
- get_effect_pending() {
799
- _classPrivateFieldGet2(_effect_pending_subscriber, this).call(this);
800
- return get(_classPrivateFieldGet2(_effect_pending, this));
801
- }
802
- /** @param {unknown} error */
803
- error(error) {
804
- if (!_classPrivateFieldGet2(_props, this).onerror && !_classPrivateFieldGet2(_props, this).failed) throw error;
805
- if (current_batch?.is_fork) {
806
- if (_classPrivateFieldGet2(_main_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_main_effect, this));
807
- if (_classPrivateFieldGet2(_pending_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_pending_effect, this));
808
- if (_classPrivateFieldGet2(_failed_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_failed_effect, this));
809
- current_batch.oncommit(() => {
810
- _assertClassBrand(_Boundary_brand, this, _handle_error).call(this, error);
811
- });
812
- } else _assertClassBrand(_Boundary_brand, this, _handle_error).call(this, error);
813
- }
814
- };
815
- function _hydrate_resolved_content() {
816
- try {
817
- _classPrivateFieldSet2(_main_effect, this, branch(() => _classPrivateFieldGet2(_children, this).call(this, _classPrivateFieldGet2(_anchor, this))));
818
- } catch (error) {
819
- this.error(error);
820
- }
821
- }
822
- /**
823
- * @param {unknown} error The deserialized error from the server's hydration comment
824
- */
825
- function _hydrate_failed_content(error) {
826
- const failed = _classPrivateFieldGet2(_props, this).failed;
827
- const { reset, invoke_onerror } = _assertClassBrand(_Boundary_brand, this, _create_reset).call(this, error);
828
- queue_micro_task(invoke_onerror);
829
- if (!failed) return;
830
- _classPrivateFieldSet2(_failed_effect, this, branch(() => {
831
- failed(_classPrivateFieldGet2(_anchor, this), () => error, () => reset);
832
- }));
833
- }
834
- /**
835
- * Creates the `reset` function for a failed boundary, along with a function
836
- * that invokes `onerror` with it (if provided)
837
- * @param {unknown} error
838
- * @returns {{ reset: () => void, invoke_onerror: () => void }}
839
- */
840
- function _create_reset(error) {
841
- var did_reset = false;
842
- var calling_on_error = false;
843
- const reset = () => {
844
- if (did_reset) {
845
- svelte_boundary_reset_noop();
846
- return;
847
- }
848
- did_reset = true;
849
- if (calling_on_error) svelte_boundary_reset_onerror();
850
- if (_classPrivateFieldGet2(_failed_effect, this) !== null) pause_effect(_classPrivateFieldGet2(_failed_effect, this), () => {
851
- _classPrivateFieldSet2(_failed_effect, this, null);
852
- });
853
- _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
854
- _assertClassBrand(_Boundary_brand, this, _render).call(this);
855
- });
856
- };
857
- const invoke_onerror = () => {
858
- try {
859
- calling_on_error = true;
860
- _classPrivateFieldGet2(_props, this).onerror?.(error, reset);
861
- calling_on_error = false;
862
- } catch (err) {
863
- invoke_error_boundary(err, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
864
- }
865
- };
866
- return {
867
- reset,
868
- invoke_onerror
869
- };
870
- }
871
- function _hydrate_pending_content() {
872
- const pending = _classPrivateFieldGet2(_props, this).pending;
873
- if (!pending) return;
874
- this.is_pending = true;
875
- _classPrivateFieldSet2(_pending_effect, this, branch(() => pending(_classPrivateFieldGet2(_anchor, this))));
876
- queue_micro_task(() => {
877
- var fragment = _classPrivateFieldSet2(_offscreen_fragment, this, document.createDocumentFragment());
878
- var anchor = create_text();
879
- fragment.append(anchor);
880
- _classPrivateFieldSet2(_main_effect, this, _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
881
- return branch(() => _classPrivateFieldGet2(_children, this).call(this, anchor));
882
- }));
883
- if (_classPrivateFieldGet2(_pending_count, this) === 0) {
884
- _classPrivateFieldGet2(_anchor, this).before(fragment);
885
- _classPrivateFieldSet2(_offscreen_fragment, this, null);
886
- pause_effect(_classPrivateFieldGet2(_pending_effect, this), () => {
887
- _classPrivateFieldSet2(_pending_effect, this, null);
888
- });
889
- _assertClassBrand(_Boundary_brand, this, _resolve).call(this, current_batch);
890
- }
891
- });
892
- }
893
- function _render() {
894
- try {
895
- this.is_pending = this.has_pending_snippet();
896
- _classPrivateFieldSet2(_pending_count, this, 0);
897
- _classPrivateFieldSet2(_local_pending_count, this, 0);
898
- _classPrivateFieldSet2(_main_effect, this, branch(() => {
899
- _classPrivateFieldGet2(_children, this).call(this, _classPrivateFieldGet2(_anchor, this));
900
- }));
901
- if (_classPrivateFieldGet2(_pending_count, this) > 0) {
902
- var fragment = _classPrivateFieldSet2(_offscreen_fragment, this, document.createDocumentFragment());
903
- move_effect(_classPrivateFieldGet2(_main_effect, this), fragment);
904
- const pending = _classPrivateFieldGet2(_props, this).pending;
905
- _classPrivateFieldSet2(_pending_effect, this, branch(() => pending(_classPrivateFieldGet2(_anchor, this))));
906
- } else _assertClassBrand(_Boundary_brand, this, _resolve).call(this, current_batch);
907
- } catch (error) {
908
- this.error(error);
909
- }
910
- }
911
- /**
912
- * @param {Batch} batch
913
- */
914
- function _resolve(batch) {
915
- this.is_pending = false;
916
- batch.transfer_effects(_classPrivateFieldGet2(_dirty_effects$1, this), _classPrivateFieldGet2(_maybe_dirty_effects$1, this));
917
- }
918
- /**
919
- * @template T
920
- * @param {() => T} fn
921
- */
922
- function _run(fn) {
923
- var previous_effect = active_effect;
924
- var previous_reaction = active_reaction;
925
- var previous_ctx = component_context;
926
- set_active_effect(_classPrivateFieldGet2(_effect, this));
927
- set_active_reaction(_classPrivateFieldGet2(_effect, this));
928
- set_component_context(_classPrivateFieldGet2(_effect, this).ctx);
929
- try {
930
- Batch.ensure();
931
- return fn();
932
- } catch (e) {
933
- handle_error(e);
934
- return null;
935
- } finally {
936
- set_active_effect(previous_effect);
937
- set_active_reaction(previous_reaction);
938
- set_component_context(previous_ctx);
939
- }
940
- }
941
- /**
942
- * Updates the pending count associated with the currently visible pending snippet,
943
- * if any, such that we can replace the snippet with content once work is done
944
- * @param {1 | -1} d
945
- * @param {Batch} batch
946
- */
947
- function _update_pending_count(d, batch) {
948
- if (!this.has_pending_snippet()) {
949
- if (this.parent) {
950
- var _this$parent;
951
- _assertClassBrand(_Boundary_brand, _this$parent = this.parent, _update_pending_count).call(_this$parent, d, batch);
952
- }
953
- return;
954
- }
955
- _classPrivateFieldSet2(_pending_count, this, _classPrivateFieldGet2(_pending_count, this) + d);
956
- if (_classPrivateFieldGet2(_pending_count, this) === 0) {
957
- _assertClassBrand(_Boundary_brand, this, _resolve).call(this, batch);
958
- if (_classPrivateFieldGet2(_pending_effect, this)) pause_effect(_classPrivateFieldGet2(_pending_effect, this), () => {
959
- _classPrivateFieldSet2(_pending_effect, this, null);
960
- });
961
- if (_classPrivateFieldGet2(_offscreen_fragment, this)) {
962
- _classPrivateFieldGet2(_anchor, this).before(_classPrivateFieldGet2(_offscreen_fragment, this));
963
- _classPrivateFieldSet2(_offscreen_fragment, this, null);
964
- }
965
- }
966
- }
967
- /**
968
- * @param {unknown} error
969
- */
970
- function _handle_error(error) {
971
- if (_classPrivateFieldGet2(_main_effect, this)) {
972
- destroy_effect(_classPrivateFieldGet2(_main_effect, this));
973
- _classPrivateFieldSet2(_main_effect, this, null);
974
- }
975
- if (_classPrivateFieldGet2(_pending_effect, this)) {
976
- destroy_effect(_classPrivateFieldGet2(_pending_effect, this));
977
- _classPrivateFieldSet2(_pending_effect, this, null);
978
- }
979
- if (_classPrivateFieldGet2(_failed_effect, this)) {
980
- destroy_effect(_classPrivateFieldGet2(_failed_effect, this));
981
- _classPrivateFieldSet2(_failed_effect, this, null);
982
- }
983
- if (hydrating) {
984
- set_hydrate_node(_classPrivateFieldGet2(_hydrate_open, this));
985
- next();
986
- set_hydrate_node(skip_nodes());
987
- }
988
- let failed = _classPrivateFieldGet2(_props, this).failed;
989
- /** @param {unknown} transformed_error */
990
- const handle_error_result = (transformed_error) => {
991
- const { reset, invoke_onerror } = _assertClassBrand(_Boundary_brand, this, _create_reset).call(this, transformed_error);
992
- invoke_onerror();
993
- if (failed) _classPrivateFieldSet2(_failed_effect, this, _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
994
- try {
995
- return branch(() => {
996
- var effect = active_effect;
997
- effect.b = this;
998
- effect.f |= 128;
999
- failed(_classPrivateFieldGet2(_anchor, this), () => transformed_error, () => reset);
1000
- });
1001
- } catch (error) {
1002
- invoke_error_boundary(error, _classPrivateFieldGet2(_effect, this).parent);
1003
- return null;
1004
- }
1005
- }));
1006
- };
1007
- queue_micro_task(() => {
1008
- /** @type {unknown} */
1009
- var result;
1010
- try {
1011
- result = this.transform_error(error);
1012
- } catch (e) {
1013
- invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
1014
- return;
1015
- }
1016
- if (result !== null && typeof result === "object" && typeof result.then === "function")
1017
- /** @type {any} */ result.then(
1018
- handle_error_result,
1019
- /** @param {unknown} e */
1020
- (e) => invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent)
1021
- );
1022
- else handle_error_result(result);
1023
- });
1024
- }
1025
- //#endregion
1026
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/reactivity/async.js
1027
- /** @import { Blocker, Effect, Source, Value } from '#client' */
530
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/async.js
531
+ /** @import { Blocker, Effect, Source, Value } from '#client' */
1028
532
  /**
1029
533
  * @param {Blocker[]} blockers
1030
534
  * @param {Array<() => any>} sync
@@ -1312,7 +816,38 @@ function unfreeze_derived_effects(derived) {
1312
816
  for (const e of derived.effects) if (e.teardown && e.fn !== null) update_effect(e);
1313
817
  }
1314
818
  //#endregion
1315
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/reactivity/batch.js
819
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/checkPrivateRedeclaration.js
820
+ function _checkPrivateRedeclaration(e, t) {
821
+ if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
822
+ }
823
+ //#endregion
824
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateMethodInitSpec.js
825
+ function _classPrivateMethodInitSpec(e, a) {
826
+ _checkPrivateRedeclaration(e, a), a.add(e);
827
+ }
828
+ //#endregion
829
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateFieldInitSpec.js
830
+ function _classPrivateFieldInitSpec(e, t, a) {
831
+ _checkPrivateRedeclaration(e, t), t.set(e, a);
832
+ }
833
+ //#endregion
834
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/assertClassBrand.js
835
+ function _assertClassBrand(e, t, n) {
836
+ if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
837
+ throw new TypeError("Private element is not present on this object");
838
+ }
839
+ //#endregion
840
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateFieldSet2.js
841
+ function _classPrivateFieldSet2(s, a, r) {
842
+ return s.set(_assertClassBrand(s, a), r), r;
843
+ }
844
+ //#endregion
845
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateFieldGet2.js
846
+ function _classPrivateFieldGet2(s, a) {
847
+ return s.get(_assertClassBrand(s, a));
848
+ }
849
+ //#endregion
850
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/batch.js
1316
851
  /** @import { Fork } from 'svelte' */
1317
852
  /** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
1318
853
  var _Batch;
@@ -1365,8 +900,8 @@ var _blocking_pending = /* @__PURE__ */ new WeakMap();
1365
900
  var _deferred = /* @__PURE__ */ new WeakMap();
1366
901
  var _roots = /* @__PURE__ */ new WeakMap();
1367
902
  var _new_effects = /* @__PURE__ */ new WeakMap();
1368
- var _dirty_effects = /* @__PURE__ */ new WeakMap();
1369
- var _maybe_dirty_effects = /* @__PURE__ */ new WeakMap();
903
+ var _dirty_effects$1 = /* @__PURE__ */ new WeakMap();
904
+ var _maybe_dirty_effects$1 = /* @__PURE__ */ new WeakMap();
1370
905
  var _skipped_branches = /* @__PURE__ */ new WeakMap();
1371
906
  var _unskipped_branches = /* @__PURE__ */ new WeakMap();
1372
907
  var _decrement_queued = /* @__PURE__ */ new WeakMap();
@@ -1413,8 +948,8 @@ var Batch = class Batch {
1413
948
  _classPrivateFieldInitSpec(this, _deferred, null);
1414
949
  _classPrivateFieldInitSpec(this, _roots, []);
1415
950
  _classPrivateFieldInitSpec(this, _new_effects, []);
1416
- _classPrivateFieldInitSpec(this, _dirty_effects, /* @__PURE__ */ new Set());
1417
- _classPrivateFieldInitSpec(this, _maybe_dirty_effects, /* @__PURE__ */ new Set());
951
+ _classPrivateFieldInitSpec(this, _dirty_effects$1, /* @__PURE__ */ new Set());
952
+ _classPrivateFieldInitSpec(this, _maybe_dirty_effects$1, /* @__PURE__ */ new Set());
1418
953
  _classPrivateFieldInitSpec(this, _skipped_branches, /* @__PURE__ */ new Map());
1419
954
  _classPrivateFieldInitSpec(this, _unskipped_branches, /* @__PURE__ */ new Set());
1420
955
  _defineProperty(this, "is_fork", false);
@@ -1543,8 +1078,8 @@ var Batch = class Batch {
1543
1078
  * @param {Set<Effect>} maybe_dirty_effects
1544
1079
  */
1545
1080
  transfer_effects(dirty_effects, maybe_dirty_effects) {
1546
- for (const e of dirty_effects) _classPrivateFieldGet2(_dirty_effects, this).add(e);
1547
- for (const e of maybe_dirty_effects) _classPrivateFieldGet2(_maybe_dirty_effects, this).add(e);
1081
+ for (const e of dirty_effects) _classPrivateFieldGet2(_dirty_effects$1, this).add(e);
1082
+ for (const e of maybe_dirty_effects) _classPrivateFieldGet2(_maybe_dirty_effects$1, this).add(e);
1548
1083
  dirty_effects.clear();
1549
1084
  maybe_dirty_effects.clear();
1550
1085
  }
@@ -1639,12 +1174,12 @@ function _process() {
1639
1174
  _assertClassBrand(_Batch_brand, this, _unlink).call(this);
1640
1175
  infinite_loop_guard();
1641
1176
  }
1642
- for (const e of _classPrivateFieldGet2(_dirty_effects, this)) {
1643
- _classPrivateFieldGet2(_maybe_dirty_effects, this).delete(e);
1177
+ for (const e of _classPrivateFieldGet2(_dirty_effects$1, this)) {
1178
+ _classPrivateFieldGet2(_maybe_dirty_effects$1, this).delete(e);
1644
1179
  set_signal_status(e, DIRTY);
1645
1180
  this.schedule(e);
1646
1181
  }
1647
- for (const e of _classPrivateFieldGet2(_maybe_dirty_effects, this)) {
1182
+ for (const e of _classPrivateFieldGet2(_maybe_dirty_effects$1, this)) {
1648
1183
  set_signal_status(e, MAYBE_DIRTY);
1649
1184
  this.schedule(e);
1650
1185
  }
@@ -1689,8 +1224,8 @@ function _process() {
1689
1224
  _assertClassBrand(_Batch_brand, earlier_batch, _merge).call(earlier_batch, this);
1690
1225
  return;
1691
1226
  }
1692
- _classPrivateFieldGet2(_dirty_effects, this).clear();
1693
- _classPrivateFieldGet2(_maybe_dirty_effects, this).clear();
1227
+ _classPrivateFieldGet2(_dirty_effects$1, this).clear();
1228
+ _classPrivateFieldGet2(_maybe_dirty_effects$1, this).clear();
1694
1229
  for (const fn of _classPrivateFieldGet2(_commit_callbacks, this)) fn(this);
1695
1230
  _classPrivateFieldGet2(_commit_callbacks, this).clear();
1696
1231
  previous_batch = this;
@@ -1710,7 +1245,10 @@ function _process() {
1710
1245
  const batch = next_batch;
1711
1246
  _classPrivateFieldGet2(_roots, batch).push(..._classPrivateFieldGet2(_roots, this).filter((r) => !_classPrivateFieldGet2(_roots, batch).includes(r)));
1712
1247
  } else next_batch = this;
1713
- if (next_batch !== null) _assertClassBrand(_Batch_brand, next_batch, _process).call(next_batch);
1248
+ if (next_batch !== null) {
1249
+ old_values.clear();
1250
+ _assertClassBrand(_Batch_brand, next_batch, _process).call(next_batch);
1251
+ }
1714
1252
  }
1715
1253
  /**
1716
1254
  * Traverse the effect tree, executing effects or stashing
@@ -1730,7 +1268,7 @@ function _traverse(root, effects, render_effects) {
1730
1268
  else if ((flags & 4) !== 0) effects.push(effect);
1731
1269
  else if (async_mode_flag && (flags & 16777224) !== 0) render_effects.push(effect);
1732
1270
  else if (is_dirty(effect)) {
1733
- if ((flags & 16) !== 0) _classPrivateFieldGet2(_maybe_dirty_effects, this).add(effect);
1271
+ if ((flags & 16) !== 0) _classPrivateFieldGet2(_maybe_dirty_effects$1, this).add(effect);
1734
1272
  update_effect(effect);
1735
1273
  }
1736
1274
  var child = effect.first;
@@ -1772,7 +1310,7 @@ function _merge(batch) {
1772
1310
  if (d) deferred.promise.then(d.resolve).catch(d.reject);
1773
1311
  }
1774
1312
  batch.async_deriveds.clear();
1775
- this.transfer_effects(_classPrivateFieldGet2(_dirty_effects, batch), _classPrivateFieldGet2(_maybe_dirty_effects, batch));
1313
+ this.transfer_effects(_classPrivateFieldGet2(_dirty_effects$1, batch), _classPrivateFieldGet2(_maybe_dirty_effects$1, batch));
1776
1314
  /**
1777
1315
  * mark all effects that depend on `batch.current`, except the
1778
1316
  * async effects that we just resolved (TODO unless they depend
@@ -1791,7 +1329,7 @@ function _merge(batch) {
1791
1329
  else {
1792
1330
  var effect = reaction;
1793
1331
  if (flags & 4194320 && !this.async_deriveds.has(effect)) {
1794
- _classPrivateFieldGet2(_maybe_dirty_effects, this).delete(effect);
1332
+ _classPrivateFieldGet2(_maybe_dirty_effects$1, this).delete(effect);
1795
1333
  set_signal_status(effect, DIRTY);
1796
1334
  this.schedule(effect);
1797
1335
  }
@@ -1808,7 +1346,7 @@ function _merge(batch) {
1808
1346
  * @param {Effect[]} effects
1809
1347
  */
1810
1348
  function _defer_effects(effects) {
1811
- for (var i = 0; i < effects.length; i += 1) defer_effect(effects[i], _classPrivateFieldGet2(_dirty_effects, this), _classPrivateFieldGet2(_maybe_dirty_effects, this));
1349
+ for (var i = 0; i < effects.length; i += 1) defer_effect(effects[i], _classPrivateFieldGet2(_dirty_effects$1, this), _classPrivateFieldGet2(_maybe_dirty_effects$1, this));
1812
1350
  }
1813
1351
  function _commit$1() {
1814
1352
  for (let batch = first_batch; batch !== null; batch = _classPrivateFieldGet2(_next, batch)) {
@@ -1853,7 +1391,7 @@ function _commit$1() {
1853
1391
  for (const effect of _classPrivateFieldGet2(_new_effects, this)) if ((effect.f & 155648) === 0 && depends_on(effect, current_unequal, checked)) if ((effect.f & 4194320) !== 0) {
1854
1392
  set_signal_status(effect, DIRTY);
1855
1393
  batch.schedule(effect);
1856
- } else _classPrivateFieldGet2(_dirty_effects, batch).add(effect);
1394
+ } else _classPrivateFieldGet2(_dirty_effects$1, batch).add(effect);
1857
1395
  }
1858
1396
  if (_classPrivateFieldGet2(_roots, batch).length > 0 && !_classPrivateFieldGet2(_decrement_queued, batch)) {
1859
1397
  batch.apply();
@@ -2025,7 +1563,7 @@ function reset_all(effect) {
2025
1563
  }
2026
1564
  }
2027
1565
  //#endregion
2028
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/reactivity/sources.js
1566
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/sources.js
2029
1567
  /** @import { Derived, Effect, Source, Value } from '#client' */
2030
1568
  /** @type {Set<Effect>} */
2031
1569
  var eager_effects = /* @__PURE__ */ new Set();
@@ -2095,7 +1633,8 @@ function set(source, value, should_proxy = false) {
2095
1633
  */
2096
1634
  function internal_set(source, value, updated_during_traversal = null) {
2097
1635
  if (!source.equals(value)) {
2098
- old_values.set(source, is_destroying_effect ? value : source.v);
1636
+ if (is_destroying_effect) old_values.set(source, value);
1637
+ else if (!old_values.has(source)) old_values.set(source, source.v);
2099
1638
  var batch = Batch.ensure();
2100
1639
  batch.capture(source, value);
2101
1640
  if ((source.f & 2) !== 0) {
@@ -2171,7 +1710,7 @@ function mark_reactions(signal, status, updated_during_traversal) {
2171
1710
  * @returns {T}
2172
1711
  */
2173
1712
  function proxy(value) {
2174
- if (typeof value !== "object" || value === null || STATE_SYMBOL in value) return value;
1713
+ if (typeof value !== "object" || value === null || STATE_SYMBOL in value || COMPONENT_SYMBOL in value) return value;
2175
1714
  const prototype = get_prototype_of(value);
2176
1715
  if (prototype !== object_prototype && prototype !== array_prototype) return value;
2177
1716
  /** @type {Map<any, Source<any>>} */
@@ -2324,7 +1863,7 @@ function proxy(value) {
2324
1863
  });
2325
1864
  }
2326
1865
  //#endregion
2327
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/operations.js
1866
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/operations.js
2328
1867
  /** @import { Effect, TemplateNode } from '#client' */
2329
1868
  /** @type {Window} */
2330
1869
  var $window;
@@ -2424,6 +1963,21 @@ function first_child(node, is_text = false) {
2424
1963
  return hydrate_node;
2425
1964
  }
2426
1965
  /**
1966
+ * `child`, for the very common case of an element with exactly one child. Resetting the
1967
+ * hydration cursor is part of the same step, so the compiler doesn't have to emit a
1968
+ * separate `reset` call for every `<p>{text}</p>` in an app.
1969
+ * Don't mark this as side-effect-free, hydration needs to walk all nodes
1970
+ * @param {TemplateNode} node
1971
+ * @param {boolean} [is_text]
1972
+ * @returns {TemplateNode | null}
1973
+ */
1974
+ function only_child(node, is_text = false) {
1975
+ if (!hydrating) return /* @__PURE__ */ get_first_child(node);
1976
+ var first = child(node, is_text);
1977
+ reset(node);
1978
+ return first;
1979
+ }
1980
+ /**
2427
1981
  * Don't mark this as side-effect-free, hydration needs to walk all nodes
2428
1982
  * @param {TemplateNode} node
2429
1983
  * @param {number} count
@@ -2501,8 +2055,40 @@ function merge_text_nodes(text) {
2501
2055
  next = text.nextSibling;
2502
2056
  }
2503
2057
  }
2058
+ /**
2059
+ * @param {unknown} error
2060
+ */
2061
+ function handle_error(error) {
2062
+ var effect = active_effect;
2063
+ if (effect === null) {
2064
+ /** @type {Derived} */ active_reaction.f |= ERROR_VALUE;
2065
+ return error;
2066
+ }
2067
+ if ((effect.f & 32768) === 0 && (effect.f & 4) === 0) throw error;
2068
+ invoke_error_boundary(error, effect);
2069
+ }
2070
+ /**
2071
+ * @param {unknown} error
2072
+ * @param {Effect | null} effect
2073
+ */
2074
+ function invoke_error_boundary(error, effect) {
2075
+ if (effect !== null && (effect.f & 16384) !== 0) return;
2076
+ while (effect !== null) {
2077
+ if ((effect.f & 128) !== 0 && (effect.f & 33570816) === 0) {
2078
+ if ((effect.f & 32768) === 0) throw error;
2079
+ try {
2080
+ /** @type {Boundary} */ effect.b.error(error);
2081
+ return;
2082
+ } catch (e) {
2083
+ error = e;
2084
+ }
2085
+ }
2086
+ effect = effect.parent;
2087
+ }
2088
+ throw error;
2089
+ }
2504
2090
  //#endregion
2505
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/reactivity/effects.js
2091
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/effects.js
2506
2092
  /** @import { Blocker, ComponentContext, ComponentContextLegacy, Derived, Effect, TemplateNode, TransitionManager } from '#client' */
2507
2093
  /**
2508
2094
  * @param {'$effect' | '$effect.pre' | '$inspect'} rune
@@ -2650,820 +2236,1297 @@ function component_root(fn) {
2650
2236
  * @param {() => void | (() => void)} fn
2651
2237
  * @returns {Effect}
2652
2238
  */
2653
- function effect(fn) {
2654
- return create_effect(4, fn);
2239
+ function effect(fn) {
2240
+ return create_effect(4, fn);
2241
+ }
2242
+ /**
2243
+ * @param {() => void | (() => void)} fn
2244
+ * @returns {Effect}
2245
+ */
2246
+ function async_effect(fn) {
2247
+ return create_effect(ASYNC | EFFECT_PRESERVED, fn);
2248
+ }
2249
+ /**
2250
+ * @param {() => void | (() => void)} fn
2251
+ * @returns {Effect}
2252
+ */
2253
+ function render_effect(fn, flags = 0) {
2254
+ return create_effect(8 | flags, fn);
2255
+ }
2256
+ /**
2257
+ * @param {(...expressions: any) => void | (() => void)} fn
2258
+ * @param {Array<() => any>} sync
2259
+ * @param {Array<() => Promise<any>>} async
2260
+ * @param {Blocker[]} blockers
2261
+ */
2262
+ function template_effect(fn, sync = [], async = [], blockers = []) {
2263
+ flatten(blockers, sync, async, (values) => {
2264
+ create_effect(8, () => {
2265
+ fn(...values.map(get));
2266
+ });
2267
+ });
2268
+ }
2269
+ /**
2270
+ * @param {(() => void)} fn
2271
+ * @param {number} flags
2272
+ */
2273
+ function block(fn, flags = 0) {
2274
+ return create_effect(16 | flags, fn);
2275
+ }
2276
+ /**
2277
+ * @param {(() => void)} fn
2278
+ */
2279
+ function branch(fn) {
2280
+ return create_effect(32 | EFFECT_PRESERVED, fn);
2281
+ }
2282
+ /**
2283
+ * @param {Effect} effect
2284
+ */
2285
+ function execute_effect_teardown(effect) {
2286
+ var teardown = effect.teardown;
2287
+ if (teardown !== null) {
2288
+ const previously_destroying_effect = is_destroying_effect;
2289
+ const previous_reaction = active_reaction;
2290
+ set_is_destroying_effect(true);
2291
+ set_active_reaction(null);
2292
+ try {
2293
+ teardown.call(null);
2294
+ } catch (error) {
2295
+ invoke_error_boundary(error, effect.parent);
2296
+ } finally {
2297
+ set_is_destroying_effect(previously_destroying_effect);
2298
+ set_active_reaction(previous_reaction);
2299
+ }
2300
+ }
2301
+ }
2302
+ /**
2303
+ * @param {Effect} signal
2304
+ * @param {boolean} remove_dom
2305
+ * @returns {void}
2306
+ */
2307
+ function destroy_effect_children(signal, remove_dom = false) {
2308
+ var effect = signal.first;
2309
+ signal.first = signal.last = null;
2310
+ while (effect !== null) {
2311
+ const controller = effect.ac;
2312
+ if (controller !== null) without_reactive_context(() => {
2313
+ controller.abort(STALE_REACTION);
2314
+ });
2315
+ var next = effect.next;
2316
+ if ((effect.f & 64) !== 0) effect.parent = null;
2317
+ else destroy_effect(effect, remove_dom);
2318
+ effect = next;
2319
+ }
2320
+ }
2321
+ /**
2322
+ * @param {Effect} signal
2323
+ * @returns {void}
2324
+ */
2325
+ function destroy_block_effect_children(signal) {
2326
+ var effect = signal.first;
2327
+ while (effect !== null) {
2328
+ var next = effect.next;
2329
+ if ((effect.f & 32) === 0) destroy_effect(effect);
2330
+ effect = next;
2331
+ }
2332
+ }
2333
+ /**
2334
+ * @param {Effect} effect
2335
+ * @param {boolean} [remove_dom]
2336
+ * @returns {void}
2337
+ */
2338
+ function destroy_effect(effect, remove_dom = true) {
2339
+ var removed = false;
2340
+ if ((remove_dom || (effect.f & 262144) !== 0) && effect.nodes !== null && effect.nodes.end !== null) {
2341
+ remove_effect_dom(effect.nodes.start, effect.nodes.end);
2342
+ removed = true;
2343
+ }
2344
+ effect.f |= DESTROYING;
2345
+ destroy_effect_children(effect, remove_dom && !removed);
2346
+ remove_reactions(effect, 0);
2347
+ var transitions = effect.nodes && effect.nodes.t;
2348
+ if (transitions !== null) for (const transition of transitions) transition.stop();
2349
+ execute_effect_teardown(effect);
2350
+ effect.f ^= DESTROYING;
2351
+ effect.f |= DESTROYED;
2352
+ var parent = effect.parent;
2353
+ if (parent !== null && parent.first !== null) unlink_effect(effect);
2354
+ effect.next = effect.prev = effect.teardown = effect.ctx = effect.deps = effect.fn = effect.nodes = effect.ac = effect.b = null;
2355
+ }
2356
+ /**
2357
+ *
2358
+ * @param {TemplateNode | null} node
2359
+ * @param {TemplateNode} end
2360
+ */
2361
+ function remove_effect_dom(node, end) {
2362
+ while (node !== null) {
2363
+ /** @type {TemplateNode | null} */
2364
+ var next = node === end ? null : /* @__PURE__ */ get_next_sibling(node);
2365
+ node.remove();
2366
+ node = next;
2367
+ }
2368
+ }
2369
+ /**
2370
+ * Detach an effect from the effect tree, freeing up memory and
2371
+ * reducing the amount of work that happens on subsequent traversals
2372
+ * @param {Effect} effect
2373
+ */
2374
+ function unlink_effect(effect) {
2375
+ var parent = effect.parent;
2376
+ var prev = effect.prev;
2377
+ var next = effect.next;
2378
+ if (prev !== null) prev.next = next;
2379
+ if (next !== null) next.prev = prev;
2380
+ if (parent !== null) {
2381
+ if (parent.first === effect) parent.first = next;
2382
+ if (parent.last === effect) parent.last = prev;
2383
+ }
2384
+ }
2385
+ /**
2386
+ * When a block effect is removed, we don't immediately destroy it or yank it
2387
+ * out of the DOM, because it might have transitions. Instead, we 'pause' it.
2388
+ * It stays around (in memory, and in the DOM) until outro transitions have
2389
+ * completed, and if the state change is reversed then we _resume_ it.
2390
+ * A paused effect does not update, and the DOM subtree becomes inert.
2391
+ * @param {Effect} effect
2392
+ * @param {() => void} [callback]
2393
+ * @param {boolean} [destroy]
2394
+ */
2395
+ function pause_effect(effect, callback, destroy = true) {
2396
+ /** @type {TransitionManager[]} */
2397
+ var transitions = [];
2398
+ effect.f |= 256;
2399
+ pause_children(effect, transitions, true);
2400
+ var fn = () => {
2401
+ if (destroy) destroy_effect(effect);
2402
+ if (callback) callback();
2403
+ };
2404
+ var remaining = transitions.length;
2405
+ if (remaining > 0) {
2406
+ var check = () => --remaining || fn();
2407
+ for (var transition of transitions) transition.out(check);
2408
+ } else fn();
2409
+ }
2410
+ /**
2411
+ * @param {Effect} effect
2412
+ * @param {TransitionManager[]} transitions
2413
+ * @param {boolean} local
2414
+ */
2415
+ function pause_children(effect, transitions, local) {
2416
+ if ((effect.f & 8192) !== 0) return;
2417
+ effect.f ^= INERT;
2418
+ var t = effect.nodes && effect.nodes.t;
2419
+ if (t !== null) {
2420
+ for (const transition of t) if (transition.is_global || local) transitions.push(transition);
2421
+ }
2422
+ var child = effect.first;
2423
+ while (child !== null) {
2424
+ var sibling = child.next;
2425
+ if ((child.f & 64) === 0) {
2426
+ var transparent = (child.f & 65536) !== 0 || (child.f & 32) !== 0 && (effect.f & 16) !== 0;
2427
+ pause_children(child, transitions, transparent ? local : false);
2428
+ }
2429
+ child = sibling;
2430
+ }
2431
+ }
2432
+ /**
2433
+ * The opposite of `pause_effect`. We call this if (for example)
2434
+ * `x` becomes falsy then truthy: `{#if x}...{/if}`
2435
+ * @param {Effect} effect
2436
+ */
2437
+ function resume_effect(effect) {
2438
+ effect.f &= -257;
2439
+ resume_children(effect, true);
2440
+ }
2441
+ /**
2442
+ * @param {Effect} effect
2443
+ * @param {boolean} local
2444
+ */
2445
+ function resume_children(effect, local) {
2446
+ if ((effect.f & 256) !== 0) return;
2447
+ if ((effect.f & 8192) === 0) return;
2448
+ effect.f ^= INERT;
2449
+ if ((effect.f & 1024) === 0) {
2450
+ set_signal_status(effect, DIRTY);
2451
+ Batch.ensure().schedule(effect);
2452
+ }
2453
+ var child = effect.first;
2454
+ while (child !== null) {
2455
+ var sibling = child.next;
2456
+ var transparent = (child.f & 65536) !== 0 || (child.f & 32) !== 0;
2457
+ resume_children(child, transparent ? local : false);
2458
+ child = sibling;
2459
+ }
2460
+ var t = effect.nodes && effect.nodes.t;
2461
+ if (t !== null) {
2462
+ for (const transition of t) if (transition.is_global || local) transition.in();
2463
+ }
2464
+ }
2465
+ /**
2466
+ * @param {Effect} effect
2467
+ * @param {DocumentFragment} fragment
2468
+ */
2469
+ function move_effect(effect, fragment) {
2470
+ if (!effect.nodes) return;
2471
+ /** @type {TemplateNode | null} */
2472
+ var node = effect.nodes.start;
2473
+ var end = effect.nodes.end;
2474
+ while (node !== null) {
2475
+ /** @type {TemplateNode | null} */
2476
+ var next = node === end ? null : /* @__PURE__ */ get_next_sibling(node);
2477
+ fragment.append(node);
2478
+ node = next;
2479
+ }
2480
+ }
2481
+ //#endregion
2482
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/legacy.js
2483
+ /**
2484
+ * @type {Set<Value> | null}
2485
+ * @deprecated
2486
+ */
2487
+ var captured_signals = null;
2488
+ //#endregion
2489
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/runtime.js
2490
+ /** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
2491
+ /**
2492
+ * True if updating in an effect context that is reactive (i.e. not branch/root effects)
2493
+ */
2494
+ var is_updating_effect = false;
2495
+ var is_destroying_effect = false;
2496
+ /** @param {boolean} value */
2497
+ function set_is_destroying_effect(value) {
2498
+ is_destroying_effect = value;
2499
+ }
2500
+ /** @type {null | Reaction} */
2501
+ var active_reaction = null;
2502
+ var untracking = false;
2503
+ /** @param {null | Reaction} reaction */
2504
+ function set_active_reaction(reaction) {
2505
+ active_reaction = reaction;
2506
+ }
2507
+ /** @type {null | Effect} */
2508
+ var active_effect = null;
2509
+ /** @param {null | Effect} effect */
2510
+ function set_active_effect(effect) {
2511
+ active_effect = effect;
2655
2512
  }
2656
2513
  /**
2657
- * @param {() => void | (() => void)} fn
2658
- * @returns {Effect}
2514
+ * When sources are created within a reaction, reading and writing
2515
+ * them within that reaction should not cause a re-run
2516
+ * @type {null | Set<Source>}
2659
2517
  */
2660
- function async_effect(fn) {
2661
- return create_effect(ASYNC | EFFECT_PRESERVED, fn);
2518
+ var current_sources = null;
2519
+ /** @param {Value} value */
2520
+ function push_reaction_value(value) {
2521
+ if (active_reaction !== null && (!async_mode_flag || (active_reaction.f & 2) !== 0)) (current_sources ?? (current_sources = /* @__PURE__ */ new Set())).add(value);
2662
2522
  }
2663
2523
  /**
2664
- * @param {() => void | (() => void)} fn
2665
- * @returns {Effect}
2524
+ * The dependencies of the reaction that is currently being executed. In many cases,
2525
+ * the dependencies are unchanged between runs, and so this will be `null` unless
2526
+ * and until a new dependency is accessed — we track this via `skipped_deps`
2527
+ * @type {null | Value[]}
2666
2528
  */
2667
- function render_effect(fn, flags = 0) {
2668
- return create_effect(8 | flags, fn);
2669
- }
2529
+ var new_deps = null;
2530
+ var skipped_deps = 0;
2670
2531
  /**
2671
- * @param {(...expressions: any) => void | (() => void)} fn
2672
- * @param {Array<() => any>} sync
2673
- * @param {Array<() => Promise<any>>} async
2674
- * @param {Blocker[]} blockers
2532
+ * Tracks writes that the effect it's executed in doesn't listen to yet,
2533
+ * so that the dependency can be added to the effect later on if it then reads it
2534
+ * @type {null | Source[]}
2675
2535
  */
2676
- function template_effect(fn, sync = [], async = [], blockers = []) {
2677
- flatten(blockers, sync, async, (values) => {
2678
- create_effect(8, () => {
2679
- fn(...values.map(get));
2680
- });
2681
- });
2536
+ var untracked_writes = null;
2537
+ /** @param {null | Source[]} value */
2538
+ function set_untracked_writes(value) {
2539
+ untracked_writes = value;
2682
2540
  }
2683
2541
  /**
2684
- * @param {(() => void)} fn
2685
- * @param {number} flags
2686
- */
2687
- function block(fn, flags = 0) {
2688
- return create_effect(16 | flags, fn);
2542
+ * @type {number} Used by sources and deriveds for handling updates.
2543
+ * Version starts from 1 so that unowned deriveds differentiate between a created effect and a run one for tracing
2544
+ **/
2545
+ var write_version = 1;
2546
+ /** @type {number} Used to version each read of a source of derived to avoid duplicating dependencies inside a reaction */
2547
+ var read_version = 0;
2548
+ var update_version = read_version;
2549
+ /** @param {number} value */
2550
+ function set_update_version(value) {
2551
+ update_version = value;
2552
+ }
2553
+ function increment_write_version() {
2554
+ return ++write_version;
2689
2555
  }
2690
2556
  /**
2691
- * @param {(() => void)} fn
2557
+ * Determines whether a derived or effect is dirty.
2558
+ * If it is MAYBE_DIRTY, will set the status to CLEAN
2559
+ * @param {Reaction} reaction
2560
+ * @returns {boolean}
2692
2561
  */
2693
- function branch(fn) {
2694
- return create_effect(32 | EFFECT_PRESERVED, fn);
2562
+ function is_dirty(reaction) {
2563
+ var flags = reaction.f;
2564
+ if ((flags & 2048) !== 0) return true;
2565
+ if (flags & 2) reaction.f &= ~WAS_MARKED;
2566
+ if ((flags & 4096) !== 0) {
2567
+ var dependencies = reaction.deps;
2568
+ var length = dependencies.length;
2569
+ for (var i = 0; i < length; i++) {
2570
+ var dependency = dependencies[i];
2571
+ if (is_dirty(dependency)) update_derived(dependency);
2572
+ if (dependency.wv > reaction.wv) return true;
2573
+ }
2574
+ if ((flags & 512) !== 0 && batch_values === null) set_signal_status(reaction, CLEAN);
2575
+ }
2576
+ return false;
2695
2577
  }
2696
2578
  /**
2579
+ * @param {Value} signal
2697
2580
  * @param {Effect} effect
2581
+ * @param {boolean} [root]
2698
2582
  */
2699
- function execute_effect_teardown(effect) {
2700
- var teardown = effect.teardown;
2701
- if (teardown !== null) {
2702
- const previously_destroying_effect = is_destroying_effect;
2703
- const previous_reaction = active_reaction;
2704
- set_is_destroying_effect(true);
2705
- set_active_reaction(null);
2706
- try {
2707
- teardown.call(null);
2708
- } finally {
2709
- set_is_destroying_effect(previously_destroying_effect);
2710
- set_active_reaction(previous_reaction);
2583
+ function schedule_possible_effect_self_invalidation(signal, effect, root = true) {
2584
+ var reactions = signal.reactions;
2585
+ if (reactions === null) return;
2586
+ if (!async_mode_flag && current_sources !== null && current_sources.has(signal)) return;
2587
+ for (var i = 0; i < reactions.length; i++) {
2588
+ var reaction = reactions[i];
2589
+ if ((reaction.f & 2) !== 0) schedule_possible_effect_self_invalidation(reaction, effect, false);
2590
+ else if (effect === reaction) {
2591
+ if (root) set_signal_status(reaction, DIRTY);
2592
+ else if ((reaction.f & 1024) !== 0) set_signal_status(reaction, MAYBE_DIRTY);
2593
+ schedule_effect(reaction);
2711
2594
  }
2712
2595
  }
2713
2596
  }
2714
- /**
2715
- * @param {Effect} signal
2716
- * @param {boolean} remove_dom
2717
- * @returns {void}
2718
- */
2719
- function destroy_effect_children(signal, remove_dom = false) {
2720
- var effect = signal.first;
2721
- signal.first = signal.last = null;
2722
- while (effect !== null) {
2723
- const controller = effect.ac;
2724
- if (controller !== null) without_reactive_context(() => {
2725
- controller.abort(STALE_REACTION);
2597
+ /** @param {Reaction} reaction */
2598
+ function update_reaction(reaction) {
2599
+ var previous_deps = new_deps;
2600
+ var previous_skipped_deps = skipped_deps;
2601
+ var previous_untracked_writes = untracked_writes;
2602
+ var previous_reaction = active_reaction;
2603
+ var previous_sources = current_sources;
2604
+ var previous_component_context = component_context;
2605
+ var previous_untracking = untracking;
2606
+ var previous_update_version = update_version;
2607
+ var flags = reaction.f;
2608
+ new_deps = null;
2609
+ skipped_deps = 0;
2610
+ untracked_writes = null;
2611
+ active_reaction = (flags & 96) === 0 ? reaction : null;
2612
+ current_sources = null;
2613
+ set_component_context(reaction.ctx);
2614
+ untracking = false;
2615
+ update_version = ++read_version;
2616
+ if (reaction.ac !== null) {
2617
+ without_reactive_context(() => {
2618
+ /** @type {AbortController} */ reaction.ac.abort(STALE_REACTION);
2726
2619
  });
2727
- var next = effect.next;
2728
- if ((effect.f & 64) !== 0) effect.parent = null;
2729
- else destroy_effect(effect, remove_dom);
2730
- effect = next;
2620
+ reaction.ac = null;
2621
+ }
2622
+ try {
2623
+ reaction.f |= REACTION_IS_UPDATING;
2624
+ var fn = reaction.fn;
2625
+ var result = fn();
2626
+ reaction.f |= REACTION_RAN;
2627
+ var deps = update_dependencies(reaction);
2628
+ if (is_runes() && untracked_writes !== null && !untracking && deps !== null && (reaction.f & 6146) === 0) for (var i = 0; i < untracked_writes.length; i++) schedule_possible_effect_self_invalidation(untracked_writes[i], reaction);
2629
+ if (previous_reaction !== null && previous_reaction !== reaction) {
2630
+ read_version++;
2631
+ if (previous_reaction.deps !== null) for (let i = 0; i < previous_skipped_deps; i += 1) previous_reaction.deps[i].rv = read_version;
2632
+ if (previous_deps !== null) for (const dep of previous_deps) dep.rv = read_version;
2633
+ if (untracked_writes !== null) if (previous_untracked_writes === null) previous_untracked_writes = untracked_writes;
2634
+ else previous_untracked_writes.push(...untracked_writes);
2635
+ }
2636
+ if ((reaction.f & 8388608) !== 0) reaction.f ^= ERROR_VALUE;
2637
+ return result;
2638
+ } catch (error) {
2639
+ update_dependencies(reaction);
2640
+ return handle_error(error);
2641
+ } finally {
2642
+ reaction.f ^= REACTION_IS_UPDATING;
2643
+ new_deps = previous_deps;
2644
+ skipped_deps = previous_skipped_deps;
2645
+ untracked_writes = previous_untracked_writes;
2646
+ active_reaction = previous_reaction;
2647
+ current_sources = previous_sources;
2648
+ set_component_context(previous_component_context);
2649
+ untracking = previous_untracking;
2650
+ update_version = previous_update_version;
2731
2651
  }
2732
2652
  }
2733
2653
  /**
2734
- * @param {Effect} signal
2735
- * @returns {void}
2654
+ * @param {Reaction} reaction
2736
2655
  */
2737
- function destroy_block_effect_children(signal) {
2738
- var effect = signal.first;
2739
- while (effect !== null) {
2740
- var next = effect.next;
2741
- if ((effect.f & 32) === 0) destroy_effect(effect);
2742
- effect = next;
2656
+ function update_dependencies(reaction) {
2657
+ var deps = reaction.deps;
2658
+ var is_fork = current_batch?.is_fork;
2659
+ if (new_deps !== null) {
2660
+ var i;
2661
+ if (!is_fork) remove_reactions(reaction, skipped_deps);
2662
+ if (deps !== null && skipped_deps > 0) {
2663
+ deps.length = skipped_deps + new_deps.length;
2664
+ for (i = 0; i < new_deps.length; i++) deps[skipped_deps + i] = new_deps[i];
2665
+ } else reaction.deps = deps = new_deps;
2666
+ if (effect_tracking() && (reaction.f & 512) !== 0) for (i = skipped_deps; i < deps.length; i++) {
2667
+ var _deps$i;
2668
+ ((_deps$i = deps[i]).reactions ?? (_deps$i.reactions = [])).push(reaction);
2669
+ }
2670
+ } else if (!is_fork && deps !== null && skipped_deps < deps.length) {
2671
+ remove_reactions(reaction, skipped_deps);
2672
+ deps.length = skipped_deps;
2743
2673
  }
2674
+ return deps;
2744
2675
  }
2745
2676
  /**
2746
- * @param {Effect} effect
2747
- * @param {boolean} [remove_dom]
2677
+ * @template V
2678
+ * @param {Reaction} signal
2679
+ * @param {Value<V>} dependency
2748
2680
  * @returns {void}
2749
2681
  */
2750
- function destroy_effect(effect, remove_dom = true) {
2751
- var removed = false;
2752
- if ((remove_dom || (effect.f & 262144) !== 0) && effect.nodes !== null && effect.nodes.end !== null) {
2753
- remove_effect_dom(effect.nodes.start, effect.nodes.end);
2754
- removed = true;
2682
+ function remove_reaction(signal, dependency) {
2683
+ let reactions = dependency.reactions;
2684
+ if (reactions !== null) {
2685
+ var index = index_of.call(reactions, signal);
2686
+ if (index !== -1) {
2687
+ var new_length = reactions.length - 1;
2688
+ if (new_length === 0) reactions = dependency.reactions = null;
2689
+ else {
2690
+ reactions[index] = reactions[new_length];
2691
+ reactions.pop();
2692
+ }
2693
+ }
2755
2694
  }
2756
- effect.f |= DESTROYING;
2757
- destroy_effect_children(effect, remove_dom && !removed);
2758
- remove_reactions(effect, 0);
2759
- var transitions = effect.nodes && effect.nodes.t;
2760
- if (transitions !== null) for (const transition of transitions) transition.stop();
2761
- execute_effect_teardown(effect);
2762
- effect.f ^= DESTROYING;
2763
- effect.f |= DESTROYED;
2764
- var parent = effect.parent;
2765
- if (parent !== null && parent.first !== null) unlink_effect(effect);
2766
- effect.next = effect.prev = effect.teardown = effect.ctx = effect.deps = effect.fn = effect.nodes = effect.ac = effect.b = null;
2767
- }
2768
- /**
2769
- *
2770
- * @param {TemplateNode | null} node
2771
- * @param {TemplateNode} end
2772
- */
2773
- function remove_effect_dom(node, end) {
2774
- while (node !== null) {
2775
- /** @type {TemplateNode | null} */
2776
- var next = node === end ? null : /* @__PURE__ */ get_next_sibling(node);
2777
- node.remove();
2778
- node = next;
2695
+ if (reactions === null && (dependency.f & 2) !== 0 && (new_deps === null || !includes.call(new_deps, dependency))) {
2696
+ var derived = dependency;
2697
+ if ((derived.f & 512) !== 0) {
2698
+ derived.f ^= 512;
2699
+ derived.f &= ~WAS_MARKED;
2700
+ }
2701
+ if (derived.v !== UNINITIALIZED) update_derived_status(derived);
2702
+ if (derived.ac !== null) without_reactive_context(() => {
2703
+ /** @type {AbortController} */ derived.ac.abort(STALE_REACTION);
2704
+ derived.ac = null;
2705
+ set_signal_status(derived, DIRTY);
2706
+ });
2707
+ freeze_derived_effects(derived);
2708
+ remove_reactions(derived, 0);
2779
2709
  }
2780
2710
  }
2781
2711
  /**
2782
- * Detach an effect from the effect tree, freeing up memory and
2783
- * reducing the amount of work that happens on subsequent traversals
2784
- * @param {Effect} effect
2712
+ * @param {Reaction} signal
2713
+ * @param {number} start_index
2714
+ * @returns {void}
2785
2715
  */
2786
- function unlink_effect(effect) {
2787
- var parent = effect.parent;
2788
- var prev = effect.prev;
2789
- var next = effect.next;
2790
- if (prev !== null) prev.next = next;
2791
- if (next !== null) next.prev = prev;
2792
- if (parent !== null) {
2793
- if (parent.first === effect) parent.first = next;
2794
- if (parent.last === effect) parent.last = prev;
2795
- }
2716
+ function remove_reactions(signal, start_index) {
2717
+ var dependencies = signal.deps;
2718
+ if (dependencies === null) return;
2719
+ for (var i = start_index; i < dependencies.length; i++) remove_reaction(signal, dependencies[i]);
2796
2720
  }
2797
2721
  /**
2798
- * When a block effect is removed, we don't immediately destroy it or yank it
2799
- * out of the DOM, because it might have transitions. Instead, we 'pause' it.
2800
- * It stays around (in memory, and in the DOM) until outro transitions have
2801
- * completed, and if the state change is reversed then we _resume_ it.
2802
- * A paused effect does not update, and the DOM subtree becomes inert.
2803
2722
  * @param {Effect} effect
2804
- * @param {() => void} [callback]
2805
- * @param {boolean} [destroy]
2723
+ * @returns {void}
2806
2724
  */
2807
- function pause_effect(effect, callback, destroy = true) {
2808
- /** @type {TransitionManager[]} */
2809
- var transitions = [];
2810
- pause_children(effect, transitions, true);
2811
- var fn = () => {
2812
- if (destroy) destroy_effect(effect);
2813
- if (callback) callback();
2814
- };
2815
- var remaining = transitions.length;
2816
- if (remaining > 0) {
2817
- var check = () => --remaining || fn();
2818
- for (var transition of transitions) transition.out(check);
2819
- } else fn();
2725
+ function update_effect(effect) {
2726
+ var flags = effect.f;
2727
+ if ((flags & 16384) !== 0) return;
2728
+ set_signal_status(effect, CLEAN);
2729
+ var previous_effect = active_effect;
2730
+ var was_updating_effect = is_updating_effect;
2731
+ active_effect = effect;
2732
+ is_updating_effect = (flags & 96) === 0;
2733
+ try {
2734
+ if ((flags & 16777232) !== 0) destroy_block_effect_children(effect);
2735
+ else destroy_effect_children(effect);
2736
+ execute_effect_teardown(effect);
2737
+ var teardown = update_reaction(effect);
2738
+ effect.teardown = typeof teardown === "function" ? teardown : null;
2739
+ effect.wv = write_version;
2740
+ } finally {
2741
+ is_updating_effect = was_updating_effect;
2742
+ active_effect = previous_effect;
2743
+ }
2820
2744
  }
2821
2745
  /**
2822
- * @param {Effect} effect
2823
- * @param {TransitionManager[]} transitions
2824
- * @param {boolean} local
2746
+ * @template V
2747
+ * @param {Value<V>} signal
2748
+ * @returns {V}
2825
2749
  */
2826
- function pause_children(effect, transitions, local) {
2827
- if ((effect.f & 8192) !== 0) return;
2828
- effect.f ^= INERT;
2829
- var t = effect.nodes && effect.nodes.t;
2830
- if (t !== null) {
2831
- for (const transition of t) if (transition.is_global || local) transitions.push(transition);
2750
+ function get(signal) {
2751
+ var is_derived = (signal.f & 2) !== 0;
2752
+ captured_signals?.add(signal);
2753
+ if (active_reaction !== null && !untracking) {
2754
+ if (!(active_effect !== null && (active_effect.f & 16384) !== 0) && (current_sources === null || !current_sources.has(signal))) {
2755
+ var deps = active_reaction.deps;
2756
+ if ((active_reaction.f & 2097152) !== 0) {
2757
+ if (signal.rv < read_version) {
2758
+ signal.rv = read_version;
2759
+ if (new_deps === null && deps !== null && deps[skipped_deps] === signal) skipped_deps++;
2760
+ else if (new_deps === null) new_deps = [signal];
2761
+ else new_deps.push(signal);
2762
+ }
2763
+ } else {
2764
+ var _active_reaction;
2765
+ (_active_reaction = active_reaction).deps ?? (_active_reaction.deps = []);
2766
+ if (!includes.call(active_reaction.deps, signal)) active_reaction.deps.push(signal);
2767
+ var reactions = signal.reactions;
2768
+ if (reactions === null) signal.reactions = [active_reaction];
2769
+ else if (!includes.call(reactions, active_reaction)) reactions.push(active_reaction);
2770
+ }
2771
+ }
2832
2772
  }
2833
- var child = effect.first;
2834
- while (child !== null) {
2835
- var sibling = child.next;
2836
- if ((child.f & 64) === 0) {
2837
- var transparent = (child.f & 65536) !== 0 || (child.f & 32) !== 0 && (effect.f & 16) !== 0;
2838
- pause_children(child, transitions, transparent ? local : false);
2773
+ if (is_destroying_effect && old_values.has(signal)) return old_values.get(signal);
2774
+ if (is_derived) {
2775
+ var derived = signal;
2776
+ if (is_destroying_effect) {
2777
+ var value = derived.v;
2778
+ if ((derived.f & 1024) === 0 && derived.reactions !== null || depends_on_old_values(derived)) value = execute_derived(derived);
2779
+ old_values.set(derived, value);
2780
+ return value;
2781
+ }
2782
+ var should_connect = (derived.f & 512) === 0 && !untracking && active_reaction !== null && (is_updating_effect || (active_reaction.f & 512) !== 0);
2783
+ var is_new = (derived.f & REACTION_RAN) === 0;
2784
+ if (is_dirty(derived)) {
2785
+ if (should_connect) derived.f |= 512;
2786
+ update_derived(derived);
2787
+ }
2788
+ if (should_connect && !is_new) {
2789
+ unfreeze_derived_effects(derived);
2790
+ reconnect(derived);
2839
2791
  }
2840
- child = sibling;
2841
2792
  }
2793
+ if (batch_values?.has(signal)) return batch_values.get(signal);
2794
+ if ((signal.f & 8388608) !== 0) throw signal.v;
2795
+ return signal.v;
2842
2796
  }
2843
2797
  /**
2844
- * The opposite of `pause_effect`. We call this if (for example)
2845
- * `x` becomes falsy then truthy: `{#if x}...{/if}`
2846
- * @param {Effect} effect
2798
+ * (Re)connect a disconnected derived, so that it is notified
2799
+ * of changes in `mark_reactions`
2800
+ * @param {Derived} derived
2847
2801
  */
2848
- function resume_effect(effect) {
2849
- resume_children(effect, true);
2802
+ function reconnect(derived) {
2803
+ derived.f |= 512;
2804
+ if (derived.deps === null) return;
2805
+ for (const dep of derived.deps) {
2806
+ (dep.reactions ?? (dep.reactions = [])).push(derived);
2807
+ if ((dep.f & 2) !== 0 && (dep.f & 512) === 0) {
2808
+ unfreeze_derived_effects(dep);
2809
+ reconnect(dep);
2810
+ }
2811
+ }
2812
+ }
2813
+ /** @param {Derived} derived */
2814
+ function depends_on_old_values(derived) {
2815
+ if (derived.v === UNINITIALIZED) return true;
2816
+ if (derived.deps === null) return false;
2817
+ for (const dep of derived.deps) {
2818
+ if (old_values.has(dep)) return true;
2819
+ if ((dep.f & 2) !== 0 && depends_on_old_values(dep)) return true;
2820
+ }
2821
+ return false;
2850
2822
  }
2851
2823
  /**
2852
- * @param {Effect} effect
2853
- * @param {boolean} local
2824
+ * When used inside a [`$derived`](https://svelte.dev/docs/svelte/$derived) or [`$effect`](https://svelte.dev/docs/svelte/$effect),
2825
+ * any state read inside `fn` will not be treated as a dependency.
2826
+ *
2827
+ * ```ts
2828
+ * $effect(() => {
2829
+ * // this will run when `data` changes, but not when `time` changes
2830
+ * save(data, {
2831
+ * timestamp: untrack(() => time)
2832
+ * });
2833
+ * });
2834
+ * ```
2835
+ * @template T
2836
+ * @param {() => T} fn
2837
+ * @returns {T}
2854
2838
  */
2855
- function resume_children(effect, local) {
2856
- if ((effect.f & 8192) === 0) return;
2857
- effect.f ^= INERT;
2858
- if ((effect.f & 1024) === 0) {
2859
- set_signal_status(effect, DIRTY);
2860
- Batch.ensure().schedule(effect);
2861
- }
2862
- var child = effect.first;
2863
- while (child !== null) {
2864
- var sibling = child.next;
2865
- var transparent = (child.f & 65536) !== 0 || (child.f & 32) !== 0;
2866
- resume_children(child, transparent ? local : false);
2867
- child = sibling;
2868
- }
2869
- var t = effect.nodes && effect.nodes.t;
2870
- if (t !== null) {
2871
- for (const transition of t) if (transition.is_global || local) transition.in();
2839
+ function untrack(fn) {
2840
+ var previous_untracking = untracking;
2841
+ try {
2842
+ untracking = true;
2843
+ return fn();
2844
+ } finally {
2845
+ untracking = previous_untracking;
2872
2846
  }
2873
2847
  }
2848
+ //#endregion
2849
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/events.js
2874
2850
  /**
2875
- * @param {Effect} effect
2876
- * @param {DocumentFragment} fragment
2851
+ * Used on elements, as a map of event type -> event handler,
2852
+ * and on events themselves to track which element handled an event
2877
2853
  */
2878
- function move_effect(effect, fragment) {
2879
- if (!effect.nodes) return;
2880
- /** @type {TemplateNode | null} */
2881
- var node = effect.nodes.start;
2882
- var end = effect.nodes.end;
2883
- while (node !== null) {
2884
- /** @type {TemplateNode | null} */
2885
- var next = node === end ? null : /* @__PURE__ */ get_next_sibling(node);
2886
- fragment.append(node);
2887
- node = next;
2854
+ var event_symbol = Symbol("events");
2855
+ /** @type {Set<string>} */
2856
+ var all_registered_events = /* @__PURE__ */ new Set();
2857
+ /** @type {Set<(events: Array<string>) => void>} */
2858
+ var root_event_handles = /* @__PURE__ */ new Set();
2859
+ var last_propagated_event = null;
2860
+ var last_propagated_event_clear_scheduled = false;
2861
+ /**
2862
+ * @this {EventTarget}
2863
+ * @param {Event} event
2864
+ * @returns {void}
2865
+ */
2866
+ function handle_event_propagation(event) {
2867
+ var handler_element = this;
2868
+ var owner_document = handler_element.ownerDocument;
2869
+ var event_name = event.type;
2870
+ var path = event.composedPath?.() || [];
2871
+ var current_target = path[0] || event.target;
2872
+ last_propagated_event = event;
2873
+ if (!last_propagated_event_clear_scheduled) {
2874
+ last_propagated_event_clear_scheduled = true;
2875
+ setTimeout(() => {
2876
+ last_propagated_event_clear_scheduled = false;
2877
+ last_propagated_event = null;
2878
+ });
2879
+ }
2880
+ var path_idx = 0;
2881
+ var handled_at = last_propagated_event === event && event[event_symbol];
2882
+ if (handled_at) {
2883
+ var at_idx = path.indexOf(handled_at);
2884
+ if (at_idx !== -1 && (handler_element === document || handler_element === window)) {
2885
+ event[event_symbol] = handler_element;
2886
+ return;
2887
+ }
2888
+ var handler_idx = path.indexOf(handler_element);
2889
+ if (handler_idx === -1) return;
2890
+ if (at_idx <= handler_idx) path_idx = at_idx;
2891
+ }
2892
+ current_target = path[path_idx] || event.target;
2893
+ if (current_target === handler_element) return;
2894
+ define_property(event, "currentTarget", {
2895
+ configurable: true,
2896
+ get() {
2897
+ return current_target || owner_document;
2898
+ }
2899
+ });
2900
+ var previous_reaction = active_reaction;
2901
+ var previous_effect = active_effect;
2902
+ set_active_reaction(null);
2903
+ set_active_effect(null);
2904
+ try {
2905
+ /**
2906
+ * @type {unknown}
2907
+ */
2908
+ var throw_error;
2909
+ /**
2910
+ * @type {unknown[]}
2911
+ */
2912
+ var other_errors = [];
2913
+ while (current_target !== null) {
2914
+ if (current_target === handler_element) break;
2915
+ try {
2916
+ var delegated = current_target[event_symbol]?.[event_name];
2917
+ if (delegated != null && (!current_target.disabled || event.target === current_target)) delegated.call(current_target, event);
2918
+ } catch (error) {
2919
+ if (throw_error) other_errors.push(error);
2920
+ else throw_error = error;
2921
+ }
2922
+ if (event.cancelBubble) break;
2923
+ path_idx++;
2924
+ current_target = path_idx < path.length ? path[path_idx] : null;
2925
+ }
2926
+ if (throw_error) {
2927
+ for (let error of other_errors) queueMicrotask(() => {
2928
+ throw error;
2929
+ });
2930
+ throw throw_error;
2931
+ }
2932
+ } finally {
2933
+ event[event_symbol] = handler_element;
2934
+ delete event.currentTarget;
2935
+ set_active_reaction(previous_reaction);
2936
+ set_active_effect(previous_effect);
2888
2937
  }
2889
2938
  }
2890
2939
  //#endregion
2891
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/legacy.js
2892
- /**
2893
- * @type {Set<Value> | null}
2894
- * @deprecated
2895
- */
2896
- var captured_signals = null;
2897
- //#endregion
2898
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/runtime.js
2899
- /** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
2900
- /**
2901
- * True if updating in an effect context that is reactive (i.e. not branch/root effects)
2902
- */
2903
- var is_updating_effect = false;
2904
- var is_destroying_effect = false;
2905
- /** @param {boolean} value */
2906
- function set_is_destroying_effect(value) {
2907
- is_destroying_effect = value;
2908
- }
2909
- /** @type {null | Reaction} */
2910
- var active_reaction = null;
2911
- var untracking = false;
2912
- /** @param {null | Reaction} reaction */
2913
- function set_active_reaction(reaction) {
2914
- active_reaction = reaction;
2915
- }
2916
- /** @type {null | Effect} */
2917
- var active_effect = null;
2918
- /** @param {null | Effect} effect */
2919
- function set_active_effect(effect) {
2920
- active_effect = effect;
2940
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/reconciler.js
2941
+ var policy = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", {
2942
+ /** @param {string} html */
2943
+ createHTML: (html) => {
2944
+ return html;
2945
+ } });
2946
+ /** @param {string} html */
2947
+ function create_trusted_html(html) {
2948
+ return policy?.createHTML(html) ?? html;
2921
2949
  }
2922
2950
  /**
2923
- * When sources are created within a reaction, reading and writing
2924
- * them within that reaction should not cause a re-run
2925
- * @type {null | Set<Source>}
2951
+ * @param {string} html
2926
2952
  */
2927
- var current_sources = null;
2928
- /** @param {Value} value */
2929
- function push_reaction_value(value) {
2930
- if (active_reaction !== null && (!async_mode_flag || (active_reaction.f & 2) !== 0)) (current_sources ?? (current_sources = /* @__PURE__ */ new Set())).add(value);
2953
+ function create_fragment_from_html(html) {
2954
+ var elem = create_element("template");
2955
+ elem.innerHTML = create_trusted_html(html.replaceAll("<!>", "<!---->"));
2956
+ return elem.content;
2931
2957
  }
2958
+ //#endregion
2959
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/template.js
2960
+ /** @import { Effect, EffectNodes, TemplateNode } from '#client' */
2961
+ /** @import { TemplateStructure } from './types' */
2932
2962
  /**
2933
- * The dependencies of the reaction that is currently being executed. In many cases,
2934
- * the dependencies are unchanged between runs, and so this will be `null` unless
2935
- * and until a new dependency is accessed — we track this via `skipped_deps`
2936
- * @type {null | Value[]}
2937
- */
2938
- var new_deps = null;
2939
- var skipped_deps = 0;
2940
- /**
2941
- * Tracks writes that the effect it's executed in doesn't listen to yet,
2942
- * so that the dependency can be added to the effect later on if it then reads it
2943
- * @type {null | Source[]}
2963
+ * @param {TemplateNode} start
2964
+ * @param {TemplateNode | null} end
2944
2965
  */
2945
- var untracked_writes = null;
2946
- /** @param {null | Source[]} value */
2947
- function set_untracked_writes(value) {
2948
- untracked_writes = value;
2949
- }
2950
- /**
2951
- * @type {number} Used by sources and deriveds for handling updates.
2952
- * Version starts from 1 so that unowned deriveds differentiate between a created effect and a run one for tracing
2953
- **/
2954
- var write_version = 1;
2955
- /** @type {number} Used to version each read of a source of derived to avoid duplicating depedencies inside a reaction */
2956
- var read_version = 0;
2957
- var update_version = read_version;
2958
- /** @param {number} value */
2959
- function set_update_version(value) {
2960
- update_version = value;
2961
- }
2962
- function increment_write_version() {
2963
- return ++write_version;
2966
+ function assign_nodes(start, end) {
2967
+ var effect = active_effect;
2968
+ if (effect.nodes === null) effect.nodes = {
2969
+ start,
2970
+ end,
2971
+ a: null,
2972
+ t: null
2973
+ };
2964
2974
  }
2965
2975
  /**
2966
- * Determines whether a derived or effect is dirty.
2967
- * If it is MAYBE_DIRTY, will set the status to CLEAN
2968
- * @param {Reaction} reaction
2969
- * @returns {boolean}
2976
+ * @param {string} content
2977
+ * @param {number} flags
2978
+ * @returns {() => Node | Node[]}
2970
2979
  */
2971
- function is_dirty(reaction) {
2972
- var flags = reaction.f;
2973
- if ((flags & 2048) !== 0) return true;
2974
- if (flags & 2) reaction.f &= ~WAS_MARKED;
2975
- if ((flags & 4096) !== 0) {
2976
- var dependencies = reaction.deps;
2977
- var length = dependencies.length;
2978
- for (var i = 0; i < length; i++) {
2979
- var dependency = dependencies[i];
2980
- if (is_dirty(dependency)) update_derived(dependency);
2981
- if (dependency.wv > reaction.wv) return true;
2980
+ /*#__NO_SIDE_EFFECTS__*/
2981
+ function from_html(content, flags) {
2982
+ var is_fragment = (flags & 1) !== 0;
2983
+ var use_import_node = (flags & 2) !== 0;
2984
+ /** @type {Node} */
2985
+ var node;
2986
+ /**
2987
+ * Whether or not the first item is a text/element node. If not, we need to
2988
+ * create an additional comment node to act as `effect.nodes.start`
2989
+ */
2990
+ var has_start = !content.startsWith("<!>");
2991
+ return () => {
2992
+ if (hydrating) {
2993
+ assign_nodes(hydrate_node, null);
2994
+ return hydrate_node;
2982
2995
  }
2983
- if ((flags & 512) !== 0 && batch_values === null) set_signal_status(reaction, CLEAN);
2984
- }
2985
- return false;
2996
+ if (node === void 0) {
2997
+ node = create_fragment_from_html(has_start ? content : "<!>" + content);
2998
+ if (!is_fragment) node = /* @__PURE__ */ get_first_child(node);
2999
+ }
3000
+ var clone = use_import_node || is_firefox ? document.importNode(node, true) : node.cloneNode(true);
3001
+ if (is_fragment) {
3002
+ var start = /* @__PURE__ */ get_first_child(clone);
3003
+ var end = clone.lastChild;
3004
+ assign_nodes(start, end);
3005
+ } else assign_nodes(clone, clone);
3006
+ return clone;
3007
+ };
2986
3008
  }
2987
3009
  /**
2988
- * @param {Value} signal
2989
- * @param {Effect} effect
2990
- * @param {boolean} [root]
3010
+ * Don't mark this as side-effect-free, hydration needs to walk all nodes
3011
+ * @param {any} value
2991
3012
  */
2992
- function schedule_possible_effect_self_invalidation(signal, effect, root = true) {
2993
- var reactions = signal.reactions;
2994
- if (reactions === null) return;
2995
- if (!async_mode_flag && current_sources !== null && current_sources.has(signal)) return;
2996
- for (var i = 0; i < reactions.length; i++) {
2997
- var reaction = reactions[i];
2998
- if ((reaction.f & 2) !== 0) schedule_possible_effect_self_invalidation(reaction, effect, false);
2999
- else if (effect === reaction) {
3000
- if (root) set_signal_status(reaction, DIRTY);
3001
- else if ((reaction.f & 1024) !== 0) set_signal_status(reaction, MAYBE_DIRTY);
3002
- schedule_effect(reaction);
3003
- }
3013
+ function text(value = "") {
3014
+ if (!hydrating) {
3015
+ var t = create_text(value + "");
3016
+ assign_nodes(t, t);
3017
+ return t;
3004
3018
  }
3019
+ var node = hydrate_node;
3020
+ if (node.nodeType !== 3) {
3021
+ node.before(node = create_text());
3022
+ set_hydrate_node(node);
3023
+ } else merge_text_nodes(node);
3024
+ assign_nodes(node, node);
3025
+ return node;
3005
3026
  }
3006
- /** @param {Reaction} reaction */
3007
- function update_reaction(reaction) {
3008
- var previous_deps = new_deps;
3009
- var previous_skipped_deps = skipped_deps;
3010
- var previous_untracked_writes = untracked_writes;
3011
- var previous_reaction = active_reaction;
3012
- var previous_sources = current_sources;
3013
- var previous_component_context = component_context;
3014
- var previous_untracking = untracking;
3015
- var previous_update_version = update_version;
3016
- var flags = reaction.f;
3017
- new_deps = null;
3018
- skipped_deps = 0;
3019
- untracked_writes = null;
3020
- active_reaction = (flags & 96) === 0 ? reaction : null;
3021
- current_sources = null;
3022
- set_component_context(reaction.ctx);
3023
- untracking = false;
3024
- update_version = ++read_version;
3025
- if (reaction.ac !== null) {
3026
- without_reactive_context(() => {
3027
- /** @type {AbortController} */ reaction.ac.abort(STALE_REACTION);
3028
- });
3029
- reaction.ac = null;
3030
- }
3031
- try {
3032
- reaction.f |= REACTION_IS_UPDATING;
3033
- var fn = reaction.fn;
3034
- var result = fn();
3035
- reaction.f |= REACTION_RAN;
3036
- var deps = reaction.deps;
3037
- var is_fork = current_batch?.is_fork;
3038
- if (new_deps !== null) {
3039
- var i;
3040
- if (!is_fork) remove_reactions(reaction, skipped_deps);
3041
- if (deps !== null && skipped_deps > 0) {
3042
- deps.length = skipped_deps + new_deps.length;
3043
- for (i = 0; i < new_deps.length; i++) deps[skipped_deps + i] = new_deps[i];
3044
- } else reaction.deps = deps = new_deps;
3045
- if (effect_tracking() && (reaction.f & 512) !== 0) for (i = skipped_deps; i < deps.length; i++) {
3046
- var _deps$i;
3047
- ((_deps$i = deps[i]).reactions ?? (_deps$i.reactions = [])).push(reaction);
3048
- }
3049
- } else if (!is_fork && deps !== null && skipped_deps < deps.length) {
3050
- remove_reactions(reaction, skipped_deps);
3051
- deps.length = skipped_deps;
3052
- }
3053
- if (is_runes() && untracked_writes !== null && !untracking && deps !== null && (reaction.f & 6146) === 0) for (i = 0; i < untracked_writes.length; i++) schedule_possible_effect_self_invalidation(untracked_writes[i], reaction);
3054
- if (previous_reaction !== null && previous_reaction !== reaction) {
3055
- read_version++;
3056
- if (previous_reaction.deps !== null) for (let i = 0; i < previous_skipped_deps; i += 1) previous_reaction.deps[i].rv = read_version;
3057
- if (previous_deps !== null) for (const dep of previous_deps) dep.rv = read_version;
3058
- if (untracked_writes !== null) if (previous_untracked_writes === null) previous_untracked_writes = untracked_writes;
3059
- else previous_untracked_writes.push(...untracked_writes);
3060
- }
3061
- if ((reaction.f & 8388608) !== 0) reaction.f ^= ERROR_VALUE;
3062
- return result;
3063
- } catch (error) {
3064
- return handle_error(error);
3065
- } finally {
3066
- reaction.f ^= REACTION_IS_UPDATING;
3067
- new_deps = previous_deps;
3068
- skipped_deps = previous_skipped_deps;
3069
- untracked_writes = previous_untracked_writes;
3070
- active_reaction = previous_reaction;
3071
- current_sources = previous_sources;
3072
- set_component_context(previous_component_context);
3073
- untracking = previous_untracking;
3074
- update_version = previous_update_version;
3027
+ /**
3028
+ * @returns {TemplateNode | DocumentFragment}
3029
+ */
3030
+ function comment() {
3031
+ if (hydrating) {
3032
+ assign_nodes(hydrate_node, null);
3033
+ return hydrate_node;
3075
3034
  }
3035
+ var frag = document.createDocumentFragment();
3036
+ var start = document.createComment("");
3037
+ var anchor = create_text();
3038
+ frag.append(start, anchor);
3039
+ assign_nodes(start, anchor);
3040
+ return frag;
3076
3041
  }
3077
3042
  /**
3078
- * @template V
3079
- * @param {Reaction} signal
3080
- * @param {Value<V>} dependency
3081
- * @returns {void}
3043
+ * Assign the created (or in hydration mode, traversed) dom elements to the current block
3044
+ * and insert the elements into the dom (in client mode).
3045
+ * @param {Text | Comment | Element} anchor
3046
+ * @param {DocumentFragment | Element} dom
3082
3047
  */
3083
- function remove_reaction(signal, dependency) {
3084
- let reactions = dependency.reactions;
3085
- if (reactions !== null) {
3086
- var index = index_of.call(reactions, signal);
3087
- if (index !== -1) {
3088
- var new_length = reactions.length - 1;
3089
- if (new_length === 0) reactions = dependency.reactions = null;
3090
- else {
3091
- reactions[index] = reactions[new_length];
3092
- reactions.pop();
3093
- }
3094
- }
3095
- }
3096
- if (reactions === null && (dependency.f & 2) !== 0 && (new_deps === null || !includes.call(new_deps, dependency))) {
3097
- var derived = dependency;
3098
- if ((derived.f & 512) !== 0) {
3099
- derived.f ^= 512;
3100
- derived.f &= ~WAS_MARKED;
3101
- }
3102
- if (derived.v !== UNINITIALIZED) update_derived_status(derived);
3103
- if (derived.ac !== null) without_reactive_context(() => {
3104
- /** @type {AbortController} */ derived.ac.abort(STALE_REACTION);
3105
- derived.ac = null;
3106
- set_signal_status(derived, DIRTY);
3107
- });
3108
- freeze_derived_effects(derived);
3109
- remove_reactions(derived, 0);
3048
+ function append(anchor, dom) {
3049
+ if (hydrating) {
3050
+ var effect = active_effect;
3051
+ if ((effect.f & 32768) === 0 || effect.nodes.end === null) effect.nodes.end = hydrate_node;
3052
+ hydrate_next();
3053
+ return;
3110
3054
  }
3055
+ if (anchor === null) return;
3056
+ anchor.before(dom);
3111
3057
  }
3112
3058
  /**
3113
- * @param {Reaction} signal
3114
- * @param {number} start_index
3115
- * @returns {void}
3059
+ * Subset of delegated events which should be passive by default.
3060
+ * These two are already passive via browser defaults on window, document and body.
3061
+ * But since
3062
+ * - we're delegating them
3063
+ * - they happen often
3064
+ * - they apply to mobile which is generally less performant
3065
+ * we're marking them as passive by default for other elements, too.
3116
3066
  */
3117
- function remove_reactions(signal, start_index) {
3118
- var dependencies = signal.deps;
3119
- if (dependencies === null) return;
3120
- for (var i = start_index; i < dependencies.length; i++) remove_reaction(signal, dependencies[i]);
3067
+ var PASSIVE_EVENTS = ["touchstart", "touchmove"];
3068
+ /**
3069
+ * Returns `true` if `name` is a passive event
3070
+ * @param {string} name
3071
+ */
3072
+ function is_passive_event(name) {
3073
+ return PASSIVE_EVENTS.includes(name);
3121
3074
  }
3075
+ //#endregion
3076
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/reactivity/create-subscriber.js
3122
3077
  /**
3123
- * @param {Effect} effect
3078
+ * Returns a `subscribe` function that integrates external event-based systems with Svelte's reactivity.
3079
+ * It's particularly useful for integrating with web APIs like `MediaQuery`, `IntersectionObserver`, or `WebSocket`.
3080
+ *
3081
+ * If `subscribe` is called inside an effect (including indirectly, for example inside a getter),
3082
+ * the `start` callback will be called with an `update` function. Whenever `update` is called, the effect re-runs.
3083
+ *
3084
+ * If `start` returns a cleanup function, it will be called when the effect is destroyed.
3085
+ *
3086
+ * If `subscribe` is called in multiple effects, `start` will only be called once as long as the effects
3087
+ * are active, and the returned teardown function will only be called when all effects are destroyed.
3088
+ *
3089
+ * It's best understood with an example. Here's an implementation of [`MediaQuery`](https://svelte.dev/docs/svelte/svelte-reactivity#MediaQuery):
3090
+ *
3091
+ * ```js
3092
+ * import { createSubscriber } from 'svelte/reactivity';
3093
+ * import { on } from 'svelte/events';
3094
+ *
3095
+ * export class MediaQuery {
3096
+ * #query;
3097
+ * #subscribe;
3098
+ *
3099
+ * constructor(query) {
3100
+ * this.#query = window.matchMedia(`(${query})`);
3101
+ *
3102
+ * this.#subscribe = createSubscriber((update) => {
3103
+ * // when the `change` event occurs, re-run any effects that read `this.current`
3104
+ * const off = on(this.#query, 'change', update);
3105
+ *
3106
+ * // stop listening when all the effects are destroyed
3107
+ * return () => off();
3108
+ * });
3109
+ * }
3110
+ *
3111
+ * get current() {
3112
+ * // This makes the getter reactive, if read in an effect
3113
+ * this.#subscribe();
3114
+ *
3115
+ * // Return the current state of the query, whether or not we're in an effect
3116
+ * return this.#query.matches;
3117
+ * }
3118
+ * }
3119
+ * ```
3120
+ * @param {(update: () => void) => (() => void) | void} start
3121
+ * @since 5.7.0
3122
+ */
3123
+ function createSubscriber(start) {
3124
+ let subscribers = 0;
3125
+ let version = source(0);
3126
+ /** @type {(() => void) | void} */
3127
+ let stop;
3128
+ return () => {
3129
+ if (effect_tracking()) {
3130
+ get(version);
3131
+ render_effect(() => {
3132
+ if (subscribers === 0) stop = untrack(() => start(() => increment(version)));
3133
+ subscribers += 1;
3134
+ return () => {
3135
+ queue_micro_task(() => {
3136
+ subscribers -= 1;
3137
+ if (subscribers === 0) {
3138
+ stop?.();
3139
+ stop = void 0;
3140
+ increment(version);
3141
+ }
3142
+ });
3143
+ };
3144
+ });
3145
+ }
3146
+ };
3147
+ }
3148
+ //#endregion
3149
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/blocks/boundary.js
3150
+ /** @import { Effect, Source, TemplateNode, } from '#client' */
3151
+ /**
3152
+ * @typedef {{
3153
+ * onerror?: ((error: unknown, reset: () => void) => void) | null;
3154
+ * failed?: ((anchor: Node, error: () => unknown, reset: () => () => void) => void) | null;
3155
+ * pending?: ((anchor: Node) => void) | null;
3156
+ * }} BoundaryProps
3157
+ */
3158
+ var flags = EFFECT_TRANSPARENT | EFFECT_PRESERVED;
3159
+ /**
3160
+ * @param {TemplateNode} node
3161
+ * @param {BoundaryProps} props
3162
+ * @param {((anchor: Node) => void)} children
3163
+ * @param {((error: unknown) => unknown) | undefined} [transform_error]
3124
3164
  * @returns {void}
3125
3165
  */
3126
- function update_effect(effect) {
3127
- var flags = effect.f;
3128
- if ((flags & 16384) !== 0) return;
3129
- set_signal_status(effect, CLEAN);
3130
- var previous_effect = active_effect;
3131
- var was_updating_effect = is_updating_effect;
3132
- active_effect = effect;
3133
- is_updating_effect = (flags & 96) === 0;
3134
- try {
3135
- if ((flags & 16777232) !== 0) destroy_block_effect_children(effect);
3136
- else destroy_effect_children(effect);
3137
- execute_effect_teardown(effect);
3138
- var teardown = update_reaction(effect);
3139
- effect.teardown = typeof teardown === "function" ? teardown : null;
3140
- effect.wv = write_version;
3141
- } finally {
3142
- is_updating_effect = was_updating_effect;
3143
- active_effect = previous_effect;
3166
+ function boundary(node, props, children, transform_error) {
3167
+ new Boundary(node, props, children, transform_error);
3168
+ }
3169
+ var _anchor = /* @__PURE__ */ new WeakMap();
3170
+ var _hydrate_open = /* @__PURE__ */ new WeakMap();
3171
+ var _props = /* @__PURE__ */ new WeakMap();
3172
+ var _children = /* @__PURE__ */ new WeakMap();
3173
+ var _effect = /* @__PURE__ */ new WeakMap();
3174
+ var _main_effect = /* @__PURE__ */ new WeakMap();
3175
+ var _pending_effect = /* @__PURE__ */ new WeakMap();
3176
+ var _failed_effect = /* @__PURE__ */ new WeakMap();
3177
+ var _offscreen_fragment = /* @__PURE__ */ new WeakMap();
3178
+ var _local_pending_count = /* @__PURE__ */ new WeakMap();
3179
+ var _pending_count = /* @__PURE__ */ new WeakMap();
3180
+ var _pending_count_update_queued = /* @__PURE__ */ new WeakMap();
3181
+ var _dirty_effects = /* @__PURE__ */ new WeakMap();
3182
+ var _maybe_dirty_effects = /* @__PURE__ */ new WeakMap();
3183
+ var _effect_pending = /* @__PURE__ */ new WeakMap();
3184
+ var _effect_pending_subscriber = /* @__PURE__ */ new WeakMap();
3185
+ var _Boundary_brand = /* @__PURE__ */ new WeakSet();
3186
+ var Boundary = class {
3187
+ /**
3188
+ * @param {TemplateNode} node
3189
+ * @param {BoundaryProps} props
3190
+ * @param {((anchor: Node) => void)} children
3191
+ * @param {((error: unknown) => unknown) | undefined} [transform_error]
3192
+ */
3193
+ constructor(node, props, children, transform_error) {
3194
+ _classPrivateMethodInitSpec(this, _Boundary_brand);
3195
+ _defineProperty(
3196
+ this,
3197
+ /** @type {Boundary | null} */
3198
+ "parent",
3199
+ void 0
3200
+ );
3201
+ _defineProperty(this, "is_pending", false);
3202
+ _defineProperty(
3203
+ this,
3204
+ /**
3205
+ * API-level transformError transform function. Transforms errors before they reach the `failed` snippet.
3206
+ * Inherited from parent boundary, or defaults to identity.
3207
+ * @type {(error: unknown) => unknown}
3208
+ */
3209
+ "transform_error",
3210
+ void 0
3211
+ );
3212
+ _classPrivateFieldInitSpec(this, _anchor, void 0);
3213
+ _classPrivateFieldInitSpec(this, _hydrate_open, hydrating ? hydrate_node : null);
3214
+ _classPrivateFieldInitSpec(this, _props, void 0);
3215
+ _classPrivateFieldInitSpec(this, _children, void 0);
3216
+ _classPrivateFieldInitSpec(this, _effect, void 0);
3217
+ _classPrivateFieldInitSpec(this, _main_effect, null);
3218
+ _classPrivateFieldInitSpec(this, _pending_effect, null);
3219
+ _classPrivateFieldInitSpec(this, _failed_effect, null);
3220
+ _classPrivateFieldInitSpec(this, _offscreen_fragment, null);
3221
+ _classPrivateFieldInitSpec(this, _local_pending_count, 0);
3222
+ _classPrivateFieldInitSpec(this, _pending_count, 0);
3223
+ _classPrivateFieldInitSpec(this, _pending_count_update_queued, false);
3224
+ _classPrivateFieldInitSpec(this, _dirty_effects, /* @__PURE__ */ new Set());
3225
+ _classPrivateFieldInitSpec(this, _maybe_dirty_effects, /* @__PURE__ */ new Set());
3226
+ _classPrivateFieldInitSpec(this, _effect_pending, null);
3227
+ _classPrivateFieldInitSpec(this, _effect_pending_subscriber, createSubscriber(() => {
3228
+ _classPrivateFieldSet2(_effect_pending, this, source(_classPrivateFieldGet2(_local_pending_count, this)));
3229
+ return () => {
3230
+ _classPrivateFieldSet2(_effect_pending, this, null);
3231
+ };
3232
+ }));
3233
+ _classPrivateFieldSet2(_anchor, this, node);
3234
+ _classPrivateFieldSet2(_props, this, props);
3235
+ _classPrivateFieldSet2(_children, this, (anchor) => {
3236
+ var effect = active_effect;
3237
+ effect.b = this;
3238
+ effect.f |= 128;
3239
+ children(anchor);
3240
+ });
3241
+ this.parent = active_effect.b;
3242
+ this.transform_error = transform_error ?? this.parent?.transform_error ?? ((e) => e);
3243
+ _classPrivateFieldSet2(_effect, this, block(() => {
3244
+ if (hydrating) {
3245
+ const comment = _classPrivateFieldGet2(_hydrate_open, this);
3246
+ hydrate_next();
3247
+ const server_rendered_pending = comment.data === "[!";
3248
+ if (comment.data.startsWith("[?")) {
3249
+ const serialized_error = JSON.parse(comment.data.slice(2));
3250
+ _assertClassBrand(_Boundary_brand, this, _hydrate_failed_content).call(this, serialized_error);
3251
+ } else if (server_rendered_pending) _assertClassBrand(_Boundary_brand, this, _hydrate_pending_content).call(this);
3252
+ else _assertClassBrand(_Boundary_brand, this, _hydrate_resolved_content).call(this);
3253
+ } else _assertClassBrand(_Boundary_brand, this, _render).call(this);
3254
+ }, flags));
3255
+ if (hydrating) _classPrivateFieldSet2(_anchor, this, hydrate_node);
3144
3256
  }
3145
- }
3146
- /**
3147
- * @template V
3148
- * @param {Value<V>} signal
3149
- * @returns {V}
3150
- */
3151
- function get(signal) {
3152
- var is_derived = (signal.f & 2) !== 0;
3153
- captured_signals?.add(signal);
3154
- if (active_reaction !== null && !untracking) {
3155
- if (!(active_effect !== null && (active_effect.f & 16384) !== 0) && (current_sources === null || !current_sources.has(signal))) {
3156
- var deps = active_reaction.deps;
3157
- if ((active_reaction.f & 2097152) !== 0) {
3158
- if (signal.rv < read_version) {
3159
- signal.rv = read_version;
3160
- if (new_deps === null && deps !== null && deps[skipped_deps] === signal) skipped_deps++;
3161
- else if (new_deps === null) new_deps = [signal];
3162
- else new_deps.push(signal);
3163
- }
3164
- } else {
3165
- var _active_reaction;
3166
- (_active_reaction = active_reaction).deps ?? (_active_reaction.deps = []);
3167
- if (!includes.call(active_reaction.deps, signal)) active_reaction.deps.push(signal);
3168
- var reactions = signal.reactions;
3169
- if (reactions === null) signal.reactions = [active_reaction];
3170
- else if (!includes.call(reactions, active_reaction)) reactions.push(active_reaction);
3171
- }
3172
- }
3257
+ /**
3258
+ * Defer an effect inside a pending boundary until the boundary resolves
3259
+ * @param {Effect} effect
3260
+ */
3261
+ defer_effect(effect) {
3262
+ defer_effect(effect, _classPrivateFieldGet2(_dirty_effects, this), _classPrivateFieldGet2(_maybe_dirty_effects, this));
3173
3263
  }
3174
- if (is_destroying_effect && old_values.has(signal)) return old_values.get(signal);
3175
- if (is_derived) {
3176
- var derived = signal;
3177
- if (is_destroying_effect) {
3178
- var value = derived.v;
3179
- if ((derived.f & 1024) === 0 && derived.reactions !== null || depends_on_old_values(derived)) value = execute_derived(derived);
3180
- old_values.set(derived, value);
3181
- return value;
3182
- }
3183
- var should_connect = (derived.f & 512) === 0 && !untracking && active_reaction !== null && (is_updating_effect || (active_reaction.f & 512) !== 0);
3184
- var is_new = (derived.f & REACTION_RAN) === 0;
3185
- if (is_dirty(derived)) {
3186
- if (should_connect) derived.f |= 512;
3187
- update_derived(derived);
3188
- }
3189
- if (should_connect && !is_new) {
3190
- unfreeze_derived_effects(derived);
3191
- reconnect(derived);
3192
- }
3264
+ /**
3265
+ * Returns `false` if the effect exists inside a boundary whose pending snippet is shown
3266
+ * @returns {boolean}
3267
+ */
3268
+ is_rendered() {
3269
+ return !this.is_pending && (!this.parent || this.parent.is_rendered());
3193
3270
  }
3194
- if (batch_values?.has(signal)) return batch_values.get(signal);
3195
- if ((signal.f & 8388608) !== 0) throw signal.v;
3196
- return signal.v;
3197
- }
3198
- /**
3199
- * (Re)connect a disconnected derived, so that it is notified
3200
- * of changes in `mark_reactions`
3201
- * @param {Derived} derived
3202
- */
3203
- function reconnect(derived) {
3204
- derived.f |= 512;
3205
- if (derived.deps === null) return;
3206
- for (const dep of derived.deps) {
3207
- (dep.reactions ?? (dep.reactions = [])).push(derived);
3208
- if ((dep.f & 2) !== 0 && (dep.f & 512) === 0) {
3209
- unfreeze_derived_effects(dep);
3210
- reconnect(dep);
3211
- }
3271
+ has_pending_snippet() {
3272
+ return !!_classPrivateFieldGet2(_props, this).pending;
3212
3273
  }
3213
- }
3214
- /** @param {Derived} derived */
3215
- function depends_on_old_values(derived) {
3216
- if (derived.v === UNINITIALIZED) return true;
3217
- if (derived.deps === null) return false;
3218
- for (const dep of derived.deps) {
3219
- if (old_values.has(dep)) return true;
3220
- if ((dep.f & 2) !== 0 && depends_on_old_values(dep)) return true;
3274
+ /**
3275
+ * Update the source that powers `$effect.pending()` inside this boundary,
3276
+ * and controls when the current `pending` snippet (if any) is removed.
3277
+ * Do not call from inside the class
3278
+ * @param {1 | -1} d
3279
+ * @param {Batch} batch
3280
+ */
3281
+ update_pending_count(d, batch) {
3282
+ _assertClassBrand(_Boundary_brand, this, _update_pending_count).call(this, d, batch);
3283
+ _classPrivateFieldSet2(_local_pending_count, this, _classPrivateFieldGet2(_local_pending_count, this) + d);
3284
+ if (!_classPrivateFieldGet2(_effect_pending, this) || _classPrivateFieldGet2(_pending_count_update_queued, this)) return;
3285
+ _classPrivateFieldSet2(_pending_count_update_queued, this, true);
3286
+ queue_micro_task(() => {
3287
+ _classPrivateFieldSet2(_pending_count_update_queued, this, false);
3288
+ if (_classPrivateFieldGet2(_effect_pending, this)) internal_set(_classPrivateFieldGet2(_effect_pending, this), _classPrivateFieldGet2(_local_pending_count, this));
3289
+ });
3221
3290
  }
3222
- return false;
3223
- }
3224
- /**
3225
- * When used inside a [`$derived`](https://svelte.dev/docs/svelte/$derived) or [`$effect`](https://svelte.dev/docs/svelte/$effect),
3226
- * any state read inside `fn` will not be treated as a dependency.
3227
- *
3228
- * ```ts
3229
- * $effect(() => {
3230
- * // this will run when `data` changes, but not when `time` changes
3231
- * save(data, {
3232
- * timestamp: untrack(() => time)
3233
- * });
3234
- * });
3235
- * ```
3236
- * @template T
3237
- * @param {() => T} fn
3238
- * @returns {T}
3239
- */
3240
- function untrack(fn) {
3241
- var previous_untracking = untracking;
3291
+ get_effect_pending() {
3292
+ _classPrivateFieldGet2(_effect_pending_subscriber, this).call(this);
3293
+ return get(_classPrivateFieldGet2(_effect_pending, this));
3294
+ }
3295
+ /** @param {unknown} error */
3296
+ error(error) {
3297
+ if (!_classPrivateFieldGet2(_props, this).onerror && !_classPrivateFieldGet2(_props, this).failed) throw error;
3298
+ if (current_batch?.is_fork) {
3299
+ if (_classPrivateFieldGet2(_main_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_main_effect, this));
3300
+ if (_classPrivateFieldGet2(_pending_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_pending_effect, this));
3301
+ if (_classPrivateFieldGet2(_failed_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_failed_effect, this));
3302
+ current_batch.oncommit(() => {
3303
+ _assertClassBrand(_Boundary_brand, this, _handle_error).call(this, error);
3304
+ });
3305
+ } else _assertClassBrand(_Boundary_brand, this, _handle_error).call(this, error);
3306
+ }
3307
+ };
3308
+ function _hydrate_resolved_content() {
3242
3309
  try {
3243
- untracking = true;
3244
- return fn();
3245
- } finally {
3246
- untracking = previous_untracking;
3310
+ _classPrivateFieldSet2(_main_effect, this, branch(() => _classPrivateFieldGet2(_children, this).call(this, _classPrivateFieldGet2(_anchor, this))));
3311
+ } catch (error) {
3312
+ this.error(error);
3247
3313
  }
3248
3314
  }
3249
- //#endregion
3250
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/elements/events.js
3251
3315
  /**
3252
- * Used on elements, as a map of event type -> event handler,
3253
- * and on events themselves to track which element handled an event
3316
+ * @param {unknown} error The deserialized error from the server's hydration comment
3254
3317
  */
3255
- var event_symbol = Symbol("events");
3256
- /** @type {Set<string>} */
3257
- var all_registered_events = /* @__PURE__ */ new Set();
3258
- /** @type {Set<(events: Array<string>) => void>} */
3259
- var root_event_handles = /* @__PURE__ */ new Set();
3260
- var last_propagated_event = null;
3318
+ function _hydrate_failed_content(error) {
3319
+ const failed = _classPrivateFieldGet2(_props, this).failed;
3320
+ const { reset, invoke_onerror } = _assertClassBrand(_Boundary_brand, this, _create_reset).call(this, error);
3321
+ queue_micro_task(invoke_onerror);
3322
+ if (!failed) return;
3323
+ _classPrivateFieldSet2(_failed_effect, this, branch(() => {
3324
+ failed(_classPrivateFieldGet2(_anchor, this), () => error, () => reset);
3325
+ }));
3326
+ }
3261
3327
  /**
3262
- * @this {EventTarget}
3263
- * @param {Event} event
3264
- * @returns {void}
3328
+ * Creates the `reset` function for a failed boundary, along with a function
3329
+ * that invokes `onerror` with it (if provided)
3330
+ * @param {unknown} error
3331
+ * @returns {{ reset: () => void, invoke_onerror: () => void }}
3265
3332
  */
3266
- function handle_event_propagation(event) {
3267
- var handler_element = this;
3268
- var owner_document = handler_element.ownerDocument;
3269
- var event_name = event.type;
3270
- var path = event.composedPath?.() || [];
3271
- var current_target = path[0] || event.target;
3272
- last_propagated_event = event;
3273
- var path_idx = 0;
3274
- var handled_at = last_propagated_event === event && event[event_symbol];
3275
- if (handled_at) {
3276
- var at_idx = path.indexOf(handled_at);
3277
- if (at_idx !== -1 && (handler_element === document || handler_element === window)) {
3278
- event[event_symbol] = handler_element;
3333
+ function _create_reset(error) {
3334
+ var did_reset = false;
3335
+ var calling_on_error = false;
3336
+ const reset = () => {
3337
+ if (did_reset) {
3338
+ svelte_boundary_reset_noop();
3279
3339
  return;
3280
3340
  }
3281
- var handler_idx = path.indexOf(handler_element);
3282
- if (handler_idx === -1) return;
3283
- if (at_idx <= handler_idx) path_idx = at_idx;
3284
- }
3285
- current_target = path[path_idx] || event.target;
3286
- if (current_target === handler_element) return;
3287
- define_property(event, "currentTarget", {
3288
- configurable: true,
3289
- get() {
3290
- return current_target || owner_document;
3341
+ did_reset = true;
3342
+ if (calling_on_error) svelte_boundary_reset_onerror();
3343
+ if (_classPrivateFieldGet2(_failed_effect, this) !== null) pause_effect(_classPrivateFieldGet2(_failed_effect, this), () => {
3344
+ _classPrivateFieldSet2(_failed_effect, this, null);
3345
+ });
3346
+ _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
3347
+ _assertClassBrand(_Boundary_brand, this, _render).call(this);
3348
+ });
3349
+ };
3350
+ const invoke_onerror = () => {
3351
+ try {
3352
+ calling_on_error = true;
3353
+ _classPrivateFieldGet2(_props, this).onerror?.(error, reset);
3354
+ calling_on_error = false;
3355
+ } catch (err) {
3356
+ invoke_error_boundary(err, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
3291
3357
  }
3292
- });
3293
- var previous_reaction = active_reaction;
3294
- var previous_effect = active_effect;
3295
- set_active_reaction(null);
3296
- set_active_effect(null);
3297
- try {
3298
- /**
3299
- * @type {unknown}
3300
- */
3301
- var throw_error;
3302
- /**
3303
- * @type {unknown[]}
3304
- */
3305
- var other_errors = [];
3306
- while (current_target !== null) {
3307
- if (current_target === handler_element) break;
3358
+ };
3359
+ return {
3360
+ reset,
3361
+ invoke_onerror
3362
+ };
3363
+ }
3364
+ function _hydrate_pending_content() {
3365
+ const pending = _classPrivateFieldGet2(_props, this).pending;
3366
+ if (!pending) return;
3367
+ this.is_pending = true;
3368
+ _classPrivateFieldSet2(_pending_effect, this, branch(() => pending(_classPrivateFieldGet2(_anchor, this))));
3369
+ queue_micro_task(() => {
3370
+ var fragment = _classPrivateFieldSet2(_offscreen_fragment, this, document.createDocumentFragment());
3371
+ var anchor = create_text();
3372
+ var handled = false;
3373
+ fragment.append(anchor);
3374
+ _classPrivateFieldSet2(_main_effect, this, _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
3308
3375
  try {
3309
- var delegated = current_target[event_symbol]?.[event_name];
3310
- if (delegated != null && (!current_target.disabled || event.target === current_target)) delegated.call(current_target, event);
3376
+ return branch(() => _classPrivateFieldGet2(_children, this).call(this, anchor));
3311
3377
  } catch (error) {
3312
- if (throw_error) other_errors.push(error);
3313
- else throw_error = error;
3378
+ try {
3379
+ this.error(error);
3380
+ handled = true;
3381
+ } catch (error) {
3382
+ invoke_error_boundary(error, _classPrivateFieldGet2(_effect, this).parent);
3383
+ }
3384
+ return null;
3314
3385
  }
3315
- if (event.cancelBubble) break;
3316
- path_idx++;
3317
- current_target = path_idx < path.length ? path[path_idx] : null;
3386
+ }));
3387
+ if (_classPrivateFieldGet2(_main_effect, this) === null) {
3388
+ _classPrivateFieldSet2(_offscreen_fragment, this, null);
3389
+ if (handled) _assertClassBrand(_Boundary_brand, this, _resolve).call(this, current_batch);
3390
+ return;
3318
3391
  }
3319
- if (throw_error) {
3320
- for (let error of other_errors) queueMicrotask(() => {
3321
- throw error;
3392
+ if (_classPrivateFieldGet2(_pending_count, this) === 0) {
3393
+ _classPrivateFieldGet2(_anchor, this).before(fragment);
3394
+ _classPrivateFieldSet2(_offscreen_fragment, this, null);
3395
+ pause_effect(_classPrivateFieldGet2(_pending_effect, this), () => {
3396
+ _classPrivateFieldSet2(_pending_effect, this, null);
3322
3397
  });
3323
- throw throw_error;
3398
+ _assertClassBrand(_Boundary_brand, this, _resolve).call(this, current_batch);
3324
3399
  }
3325
- } finally {
3326
- event[event_symbol] = handler_element;
3327
- delete event.currentTarget;
3328
- set_active_reaction(previous_reaction);
3329
- set_active_effect(previous_effect);
3330
- }
3400
+ });
3331
3401
  }
3332
- //#endregion
3333
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/reconciler.js
3334
- var policy = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", {
3335
- /** @param {string} html */
3336
- createHTML: (html) => {
3337
- return html;
3338
- } });
3339
- /** @param {string} html */
3340
- function create_trusted_html(html) {
3341
- return policy?.createHTML(html) ?? html;
3402
+ function _render() {
3403
+ try {
3404
+ this.is_pending = this.has_pending_snippet();
3405
+ _classPrivateFieldSet2(_pending_count, this, 0);
3406
+ _classPrivateFieldSet2(_local_pending_count, this, 0);
3407
+ _classPrivateFieldSet2(_main_effect, this, branch(() => {
3408
+ _classPrivateFieldGet2(_children, this).call(this, _classPrivateFieldGet2(_anchor, this));
3409
+ }));
3410
+ if (_classPrivateFieldGet2(_pending_count, this) > 0) {
3411
+ var fragment = _classPrivateFieldSet2(_offscreen_fragment, this, document.createDocumentFragment());
3412
+ move_effect(_classPrivateFieldGet2(_main_effect, this), fragment);
3413
+ const pending = _classPrivateFieldGet2(_props, this).pending;
3414
+ _classPrivateFieldSet2(_pending_effect, this, branch(() => pending(_classPrivateFieldGet2(_anchor, this))));
3415
+ } else _assertClassBrand(_Boundary_brand, this, _resolve).call(this, current_batch);
3416
+ } catch (error) {
3417
+ this.error(error);
3418
+ }
3342
3419
  }
3343
3420
  /**
3344
- * @param {string} html
3421
+ * @param {Batch} batch
3345
3422
  */
3346
- function create_fragment_from_html(html) {
3347
- var elem = create_element("template");
3348
- elem.innerHTML = create_trusted_html(html.replaceAll("<!>", "<!---->"));
3349
- return elem.content;
3423
+ function _resolve(batch) {
3424
+ this.is_pending = false;
3425
+ batch.transfer_effects(_classPrivateFieldGet2(_dirty_effects, this), _classPrivateFieldGet2(_maybe_dirty_effects, this));
3350
3426
  }
3351
- //#endregion
3352
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/template.js
3353
- /** @import { Effect, EffectNodes, TemplateNode } from '#client' */
3354
- /** @import { TemplateStructure } from './types' */
3355
3427
  /**
3356
- * @param {TemplateNode} start
3357
- * @param {TemplateNode | null} end
3428
+ * @template T
3429
+ * @param {() => T} fn
3358
3430
  */
3359
- function assign_nodes(start, end) {
3360
- var effect = active_effect;
3361
- if (effect.nodes === null) effect.nodes = {
3362
- start,
3363
- end,
3364
- a: null,
3365
- t: null
3366
- };
3431
+ function _run(fn) {
3432
+ var previous_effect = active_effect;
3433
+ var previous_reaction = active_reaction;
3434
+ var previous_ctx = component_context;
3435
+ set_active_effect(_classPrivateFieldGet2(_effect, this));
3436
+ set_active_reaction(_classPrivateFieldGet2(_effect, this));
3437
+ set_component_context(_classPrivateFieldGet2(_effect, this).ctx);
3438
+ try {
3439
+ Batch.ensure();
3440
+ return fn();
3441
+ } finally {
3442
+ set_active_effect(previous_effect);
3443
+ set_active_reaction(previous_reaction);
3444
+ set_component_context(previous_ctx);
3445
+ }
3367
3446
  }
3368
3447
  /**
3369
- * @param {string} content
3370
- * @param {number} flags
3371
- * @returns {() => Node | Node[]}
3448
+ * Updates the pending count associated with the currently visible pending snippet,
3449
+ * if any, such that we can replace the snippet with content once work is done
3450
+ * @param {1 | -1} d
3451
+ * @param {Batch} batch
3372
3452
  */
3373
- /*#__NO_SIDE_EFFECTS__*/
3374
- function from_html(content, flags) {
3375
- var is_fragment = (flags & 1) !== 0;
3376
- var use_import_node = (flags & 2) !== 0;
3377
- /** @type {Node} */
3378
- var node;
3379
- /**
3380
- * Whether or not the first item is a text/element node. If not, we need to
3381
- * create an additional comment node to act as `effect.nodes.start`
3382
- */
3383
- var has_start = !content.startsWith("<!>");
3384
- return () => {
3385
- if (hydrating) {
3386
- assign_nodes(hydrate_node, null);
3387
- return hydrate_node;
3453
+ function _update_pending_count(d, batch) {
3454
+ if (!this.has_pending_snippet()) {
3455
+ if (this.parent) {
3456
+ var _this$parent;
3457
+ _assertClassBrand(_Boundary_brand, _this$parent = this.parent, _update_pending_count).call(_this$parent, d, batch);
3388
3458
  }
3389
- if (node === void 0) {
3390
- node = create_fragment_from_html(has_start ? content : "<!>" + content);
3391
- if (!is_fragment) node = /* @__PURE__ */ get_first_child(node);
3459
+ return;
3460
+ }
3461
+ _classPrivateFieldSet2(_pending_count, this, _classPrivateFieldGet2(_pending_count, this) + d);
3462
+ if (_classPrivateFieldGet2(_pending_count, this) === 0) {
3463
+ _assertClassBrand(_Boundary_brand, this, _resolve).call(this, batch);
3464
+ if (_classPrivateFieldGet2(_pending_effect, this)) pause_effect(_classPrivateFieldGet2(_pending_effect, this), () => {
3465
+ _classPrivateFieldSet2(_pending_effect, this, null);
3466
+ });
3467
+ if (_classPrivateFieldGet2(_offscreen_fragment, this)) {
3468
+ _classPrivateFieldGet2(_anchor, this).before(_classPrivateFieldGet2(_offscreen_fragment, this));
3469
+ _classPrivateFieldSet2(_offscreen_fragment, this, null);
3392
3470
  }
3393
- var clone = use_import_node || is_firefox ? document.importNode(node, true) : node.cloneNode(true);
3394
- if (is_fragment) {
3395
- var start = /* @__PURE__ */ get_first_child(clone);
3396
- var end = clone.lastChild;
3397
- assign_nodes(start, end);
3398
- } else assign_nodes(clone, clone);
3399
- return clone;
3400
- };
3401
- }
3402
- /**
3403
- * Don't mark this as side-effect-free, hydration needs to walk all nodes
3404
- * @param {any} value
3405
- */
3406
- function text(value = "") {
3407
- if (!hydrating) {
3408
- var t = create_text(value + "");
3409
- assign_nodes(t, t);
3410
- return t;
3411
3471
  }
3412
- var node = hydrate_node;
3413
- if (node.nodeType !== 3) {
3414
- node.before(node = create_text());
3415
- set_hydrate_node(node);
3416
- } else merge_text_nodes(node);
3417
- assign_nodes(node, node);
3418
- return node;
3419
3472
  }
3420
3473
  /**
3421
- * @returns {TemplateNode | DocumentFragment}
3474
+ * @param {unknown} error
3422
3475
  */
3423
- function comment() {
3424
- if (hydrating) {
3425
- assign_nodes(hydrate_node, null);
3426
- return hydrate_node;
3476
+ function _handle_error(error) {
3477
+ if (_classPrivateFieldGet2(_main_effect, this)) {
3478
+ destroy_effect(_classPrivateFieldGet2(_main_effect, this));
3479
+ _classPrivateFieldSet2(_main_effect, this, null);
3480
+ }
3481
+ if (_classPrivateFieldGet2(_pending_effect, this)) {
3482
+ destroy_effect(_classPrivateFieldGet2(_pending_effect, this));
3483
+ _classPrivateFieldSet2(_pending_effect, this, null);
3484
+ }
3485
+ if (_classPrivateFieldGet2(_failed_effect, this)) {
3486
+ destroy_effect(_classPrivateFieldGet2(_failed_effect, this));
3487
+ _classPrivateFieldSet2(_failed_effect, this, null);
3427
3488
  }
3428
- var frag = document.createDocumentFragment();
3429
- var start = document.createComment("");
3430
- var anchor = create_text();
3431
- frag.append(start, anchor);
3432
- assign_nodes(start, anchor);
3433
- return frag;
3434
- }
3435
- /**
3436
- * Assign the created (or in hydration mode, traversed) dom elements to the current block
3437
- * and insert the elements into the dom (in client mode).
3438
- * @param {Text | Comment | Element} anchor
3439
- * @param {DocumentFragment | Element} dom
3440
- */
3441
- function append(anchor, dom) {
3442
3489
  if (hydrating) {
3443
- var effect = active_effect;
3444
- if ((effect.f & 32768) === 0 || effect.nodes.end === null) effect.nodes.end = hydrate_node;
3445
- hydrate_next();
3446
- return;
3490
+ set_hydrate_node(_classPrivateFieldGet2(_hydrate_open, this));
3491
+ next();
3492
+ set_hydrate_node(skip_nodes());
3447
3493
  }
3448
- if (anchor === null) return;
3449
- anchor.before(dom);
3450
- }
3451
- /**
3452
- * Subset of delegated events which should be passive by default.
3453
- * These two are already passive via browser defaults on window, document and body.
3454
- * But since
3455
- * - we're delegating them
3456
- * - they happen often
3457
- * - they apply to mobile which is generally less performant
3458
- * we're marking them as passive by default for other elements, too.
3459
- */
3460
- var PASSIVE_EVENTS = ["touchstart", "touchmove"];
3461
- /**
3462
- * Returns `true` if `name` is a passive event
3463
- * @param {string} name
3464
- */
3465
- function is_passive_event(name) {
3466
- return PASSIVE_EVENTS.includes(name);
3494
+ let failed = _classPrivateFieldGet2(_props, this).failed;
3495
+ /** @param {unknown} transformed_error */
3496
+ const handle_error_result = (transformed_error) => {
3497
+ const { reset, invoke_onerror } = _assertClassBrand(_Boundary_brand, this, _create_reset).call(this, transformed_error);
3498
+ invoke_onerror();
3499
+ if (failed) _classPrivateFieldSet2(_failed_effect, this, _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
3500
+ try {
3501
+ return branch(() => {
3502
+ var effect = active_effect;
3503
+ effect.b = this;
3504
+ effect.f |= 128;
3505
+ failed(_classPrivateFieldGet2(_anchor, this), () => transformed_error, () => reset);
3506
+ });
3507
+ } catch (error) {
3508
+ invoke_error_boundary(error, _classPrivateFieldGet2(_effect, this).parent);
3509
+ return null;
3510
+ }
3511
+ }));
3512
+ };
3513
+ queue_micro_task(() => {
3514
+ /** @type {unknown} */
3515
+ var result;
3516
+ try {
3517
+ result = this.transform_error(error);
3518
+ } catch (e) {
3519
+ invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
3520
+ return;
3521
+ }
3522
+ if (result !== null && typeof result === "object" && typeof result.then === "function")
3523
+ /** @type {any} */ result.then(
3524
+ handle_error_result,
3525
+ /** @param {unknown} e */
3526
+ (e) => invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent)
3527
+ );
3528
+ else handle_error_result(result);
3529
+ });
3467
3530
  }
3468
3531
  /**
3469
3532
  * @param {Element} text
@@ -3567,7 +3630,7 @@ function _mount(Component, { target, anchor, props = {}, events, context, intro
3567
3630
  if (events)
3568
3631
  /** @type {any} */ props.$$events = events;
3569
3632
  if (hydrating) assign_nodes(anchor_node, null);
3570
- component = Component(anchor_node, props) || {};
3633
+ component = Component(anchor_node, props) || mark_as_component();
3571
3634
  if (hydrating) {
3572
3635
  /** @type {Effect & { nodes: EffectNodes }} */ active_effect.nodes.end = hydrate_node;
3573
3636
  if (hydrate_node === null || hydrate_node.nodeType !== 8 || hydrate_node.data !== "]") {
@@ -3653,7 +3716,7 @@ function unmount(component, options) {
3653
3716
  return Promise.resolve();
3654
3717
  }
3655
3718
  //#endregion
3656
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/blocks/branches.js
3719
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/blocks/branches.js
3657
3720
  /** @import { Effect, TemplateNode } from '#client' */
3658
3721
  var _batches = /* @__PURE__ */ new WeakMap();
3659
3722
  var _onscreen = /* @__PURE__ */ new WeakMap();
@@ -3776,7 +3839,7 @@ var BranchManager = class {
3776
3839
  }
3777
3840
  };
3778
3841
  //#endregion
3779
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/blocks/if.js
3842
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/blocks/if.js
3780
3843
  /** @import { TemplateNode } from '#client' */
3781
3844
  /**
3782
3845
  * @param {TemplateNode} node
@@ -3822,7 +3885,7 @@ function if_block(node, fn, elseif = false) {
3822
3885
  }, flags);
3823
3886
  }
3824
3887
  //#endregion
3825
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/blocks/each.js
3888
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/blocks/each.js
3826
3889
  /** @import { EachItem, EachOutroGroup, EachState, Effect, EffectNodes, MaybeSource, Source, TemplateNode, TransitionManager, Value } from '#client' */
3827
3890
  /** @import { Batch } from '../../reactivity/batch.js'; */
3828
3891
  /**
@@ -3862,7 +3925,7 @@ function pause_effects(state, to_destroy, controlled_anchor) {
3862
3925
  }, false);
3863
3926
  }
3864
3927
  if (remaining === 0) {
3865
- var fast_path = transitions.length === 0 && controlled_anchor !== null;
3928
+ var fast_path = transitions.length === 0 && controlled_anchor !== null && state.pending.size === 0;
3866
3929
  if (fast_path) {
3867
3930
  var anchor = controlled_anchor;
3868
3931
  var parent_node = anchor.parentNode;
@@ -4294,13 +4357,14 @@ function html(node, get_value, is_controlled = false, svg = false, mathml = fals
4294
4357
  });
4295
4358
  }
4296
4359
  //#endregion
4297
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/css.js
4360
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/css.js
4298
4361
  /**
4299
4362
  * @param {Node} anchor
4300
4363
  * @param {{ hash: string, code: string }} css
4301
4364
  */
4302
4365
  function append_styles(anchor, css) {
4303
4366
  effect(() => {
4367
+ anchor = active_effect?.parent?.nodes?.start ?? anchor;
4304
4368
  var root = anchor.getRootNode();
4305
4369
  var target = root.host ? root : /** @type {Document} */ root.head ?? root.ownerDocument.head;
4306
4370
  if (!target.querySelector("#" + css.hash)) {
@@ -4312,7 +4376,7 @@ function append_styles(anchor, css) {
4312
4376
  });
4313
4377
  }
4314
4378
  //#endregion
4315
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/elements/attributes.js
4379
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/attributes.js
4316
4380
  /** @import { Blocker, Effect } from '#client' */
4317
4381
  var IS_CUSTOM_ELEMENT = Symbol("is custom element");
4318
4382
  var IS_HTML = Symbol("is html");
@@ -4335,7 +4399,7 @@ function set_attribute(element, attribute, value, skip_warning) {
4335
4399
  if (attributes[attribute] === (attributes[attribute] = value)) return;
4336
4400
  if (attribute === "loading") element[LOADING_ATTR_SYMBOL] = value;
4337
4401
  if (value == null) element.removeAttribute(attribute);
4338
- else if (typeof value !== "string" && get_setters(element).includes(attribute)) element[attribute] = value;
4402
+ else if (typeof value !== "string" && get_setters(element).has(attribute)) element[attribute] = value;
4339
4403
  else element.setAttribute(attribute, value);
4340
4404
  }
4341
4405
  /**
@@ -4348,26 +4412,26 @@ function get_attributes(element) {
4348
4412
  [IS_HTML]: element.namespaceURI === "http://www.w3.org/1999/xhtml"
4349
4413
  });
4350
4414
  }
4351
- /** @type {Map<string, string[]>} */
4415
+ /** @type {Map<string, Set<string>>} */
4352
4416
  var setters_cache = /* @__PURE__ */ new Map();
4353
4417
  /** @param {Element} element */
4354
4418
  function get_setters(element) {
4355
4419
  var cache_key = element.getAttribute("is") || element.nodeName;
4356
4420
  var setters = setters_cache.get(cache_key);
4357
4421
  if (setters) return setters;
4358
- setters_cache.set(cache_key, setters = []);
4422
+ setters_cache.set(cache_key, setters = /* @__PURE__ */ new Set());
4359
4423
  var descriptors;
4360
4424
  var proto = element;
4361
4425
  var element_proto = Element.prototype;
4362
4426
  while (element_proto !== proto) {
4363
4427
  descriptors = get_descriptors(proto);
4364
- for (var key in descriptors) if (descriptors[key].set && key !== "innerHTML" && key !== "textContent" && key !== "innerText") setters.push(key);
4428
+ for (var key in descriptors) if (descriptors[key].set && key !== "innerHTML" && key !== "textContent" && key !== "innerText") setters.add(key);
4365
4429
  proto = get_prototype_of(proto);
4366
4430
  }
4367
4431
  return setters;
4368
4432
  }
4369
4433
  //#endregion
4370
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/elements/bindings/size.js
4434
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/bindings/size.js
4371
4435
  var _ResizeObserverSingleton;
4372
4436
  var _listeners = /* @__PURE__ */ new WeakMap();
4373
4437
  var _observer = /* @__PURE__ */ new WeakMap();
@@ -4419,7 +4483,7 @@ function _getObserver() {
4419
4483
  }
4420
4484
  _defineProperty(ResizeObserverSingleton, "entries", /* @__PURE__ */ new WeakMap());
4421
4485
  //#endregion
4422
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/reactivity/props.js
4486
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/props.js
4423
4487
  /** @import { Derived, Effect, Source } from './types.js' */
4424
4488
  /**
4425
4489
  * This function is responsible for synchronizing a possibly bound prop with the inner component state.
@@ -4512,7 +4576,7 @@ function prop(props, key, flags, fallback) {
4512
4576
  });
4513
4577
  }
4514
4578
  //#endregion
4515
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/legacy/legacy-client.js
4579
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/legacy/legacy-client.js
4516
4580
  /** @import { ComponentConstructorOptions, ComponentType, SvelteComponent, Component } from 'svelte' */
4517
4581
  /**
4518
4582
  * Takes the same options as a Svelte 4 component and the component function and returns a Svelte 4 compatible component.
@@ -4631,7 +4695,7 @@ var Svelte4Component = class {
4631
4695
  }
4632
4696
  };
4633
4697
  //#endregion
4634
- //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/elements/custom-element.js
4698
+ //#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/custom-element.js
4635
4699
  /**
4636
4700
  * @typedef {Object} CustomElementPropDefinition
4637
4701
  * @property {string} [attribute]
@@ -5064,8 +5128,7 @@ function Print($$anchor, $$props) {
5064
5128
  var consequent_9 = ($$anchor) => {
5065
5129
  var fragment_1 = root_7();
5066
5130
  var span_1 = first_child(fragment_1);
5067
- var text_3 = child(span_1, true);
5068
- reset(span_1);
5131
+ var text_3 = only_child(span_1, true);
5069
5132
  var node_11 = sibling(span_1, 2);
5070
5133
  var consequent_8 = ($$anchor) => {
5071
5134
  append($$anchor, text("(key)"));