sibujs 4.12.0 → 4.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/browser.cjs +71 -18
  2. package/dist/browser.js +4 -4
  3. package/dist/build.cjs +6618 -6178
  4. package/dist/build.d.cts +554 -415
  5. package/dist/build.d.ts +554 -415
  6. package/dist/build.js +2091 -1735
  7. package/dist/cdn.dev.global.js +12 -12
  8. package/dist/cdn.full.dev.global.js +13 -13
  9. package/dist/cdn.full.global.js +12 -12
  10. package/dist/cdn.global.js +12 -12
  11. package/dist/{chunk-WFRQ6D7H.js → chunk-22OPSWMF.js} +1 -1
  12. package/dist/{chunk-ZJCHY2IB.js → chunk-2NC56RGY.js} +1 -1
  13. package/dist/{chunk-NB7TFSJE.js → chunk-2O6JJCUR.js} +4 -4
  14. package/dist/{chunk-B2Y5BJSP.js → chunk-4UTGDVSA.js} +70 -16
  15. package/dist/{chunk-NAVLCP4S.js → chunk-5RIBLY2N.js} +4 -4
  16. package/dist/{chunk-T5O2CUHV.js → chunk-5XUGJM3J.js} +1 -1
  17. package/dist/{chunk-HXT2RNH5.js → chunk-ADZHPN2B.js} +1 -1
  18. package/dist/chunk-B36ADEIR.js +21 -0
  19. package/dist/{chunk-DFZL3AX7.js → chunk-C73VBPEF.js} +9 -5
  20. package/dist/{chunk-WH4U2VUE.js → chunk-CPQKWCJ2.js} +13 -5
  21. package/dist/{chunk-LEUEKK4G.js → chunk-EU7T7EB3.js} +2 -2
  22. package/dist/{chunk-QLG5IK7F.js → chunk-G3Z2FEBR.js} +4 -4
  23. package/dist/{chunk-ZPY2UAKM.js → chunk-J4X7ICH4.js} +3 -3
  24. package/dist/{chunk-XX4BRMWF.js → chunk-K4LNUT5L.js} +1 -1
  25. package/dist/{chunk-CI4W6XAU.js → chunk-KC62VURU.js} +3 -3
  26. package/dist/chunk-N5TBYXHW.js +17 -0
  27. package/dist/{chunk-653KGQS2.js → chunk-OIKD7YDY.js} +2 -2
  28. package/dist/{chunk-LYTUTXQP.js → chunk-PBJYCE2Z.js} +46 -4
  29. package/dist/{chunk-EMB5PG7V.js → chunk-QC3NP47A.js} +1 -1
  30. package/dist/{chunk-IHA62NGJ.js → chunk-QKFVMIAV.js} +1 -1
  31. package/dist/{chunk-LXBMVGVB.js → chunk-QZ47OZ25.js} +3 -3
  32. package/dist/{chunk-ZTYCCBU3.js → chunk-VFPLWUT7.js} +44 -26
  33. package/dist/{chunk-RK7EPQPG.js → chunk-YFTBCCVH.js} +1 -1
  34. package/dist/data.cjs +71 -18
  35. package/dist/data.js +5 -5
  36. package/dist/datePicker-DxuxWpgF.d.cts +285 -0
  37. package/dist/datePicker-DxuxWpgF.d.ts +285 -0
  38. package/dist/devtools.cjs +71 -18
  39. package/dist/devtools.js +4 -4
  40. package/dist/ecosystem.cjs +82 -21
  41. package/dist/ecosystem.js +7 -7
  42. package/dist/extras.cjs +131 -23
  43. package/dist/extras.d.cts +2 -2
  44. package/dist/extras.d.ts +2 -2
  45. package/dist/extras.js +21 -20
  46. package/dist/index.cjs +115 -37
  47. package/dist/index.d.cts +59 -5
  48. package/dist/index.d.ts +59 -5
  49. package/dist/index.js +10 -10
  50. package/dist/motion.cjs +69 -16
  51. package/dist/motion.js +3 -3
  52. package/dist/patterns.cjs +71 -18
  53. package/dist/patterns.js +5 -5
  54. package/dist/performance.cjs +69 -16
  55. package/dist/performance.js +4 -4
  56. package/dist/plugins.cjs +1421 -996
  57. package/dist/plugins.d.cts +132 -3
  58. package/dist/plugins.d.ts +132 -3
  59. package/dist/plugins.js +262 -11
  60. package/dist/routeMiddleware-B1sp4P7a.d.ts +688 -0
  61. package/dist/routeMiddleware-CedQTsLK.d.cts +688 -0
  62. package/dist/ssr.cjs +3607 -3524
  63. package/dist/ssr.d.cts +20 -671
  64. package/dist/ssr.d.ts +20 -671
  65. package/dist/ssr.js +15 -7
  66. package/dist/testing.cjs +71 -18
  67. package/dist/testing.js +2 -2
  68. package/dist/ui.cjs +78 -18
  69. package/dist/ui.js +8 -7
  70. package/dist/widgets.cjs +1352 -952
  71. package/dist/widgets.d.cts +100 -268
  72. package/dist/widgets.d.ts +100 -268
  73. package/dist/widgets.js +316 -7
  74. package/package.json +9 -1
package/dist/motion.cjs CHANGED
@@ -432,6 +432,7 @@ function bindOwnerScope(fn) {
432
432
  if (scope === null) return fn;
433
433
  return (...args) => runWithOwnerScope(scope, () => fn(...args));
434
434
  }
435
+ var currentStructOwner = null;
435
436
  var subscriberEpochCounter = 0;
436
437
  function retrack(effectFn, subscriber) {
437
438
  const prev = currentSubscriber;
@@ -451,6 +452,9 @@ function retrack(effectFn, subscriber) {
451
452
  if (prevScope !== null && !sub._epoch && sub._scope === void 0) sub._scope = prevScope;
452
453
  const scope = sub._scope === void 0 ? null : sub._scope;
453
454
  if (scope !== prevScope) currentOwnerScope = scope;
455
+ const prevStructOwner = currentStructOwner;
456
+ if (prevStructOwner !== null && !sub._epoch && !sub._c && sub._owner == null) sub._owner = prevStructOwner;
457
+ if (sub._tok != null) currentStructOwner = sub._tok;
454
458
  const epoch = ++subscriberEpochCounter;
455
459
  sub._epoch = epoch;
456
460
  sub._structDirty = false;
@@ -464,6 +468,7 @@ function retrack(effectFn, subscriber) {
464
468
  } finally {
465
469
  currentSubscriber = prev;
466
470
  currentOwnerScope = prevScope;
471
+ currentStructOwner = prevStructOwner;
467
472
  if (savedDepth !== 0) {
468
473
  suspendDepth = savedDepth;
469
474
  suspendSavedSub = savedSuspendSub;
@@ -520,7 +525,25 @@ function track(effectFn, subscriber) {
520
525
  }
521
526
  return sub._dispose ?? (sub._dispose = () => cleanup(subscriber));
522
527
  }
523
- function reactiveBinding(commit, ownerNode) {
528
+ function reactiveBinding(commit, ownerNode, structural) {
529
+ return createBinding(commit, ownerNode, structural === true)._dispose;
530
+ }
531
+ function structuralBinding(commit, ownerNode) {
532
+ const sub = createBinding(commit, ownerNode, true);
533
+ return {
534
+ stop: sub._dispose,
535
+ run: (fn) => {
536
+ const prev = currentStructOwner;
537
+ currentStructOwner = sub._tok ?? null;
538
+ try {
539
+ return fn();
540
+ } finally {
541
+ currentStructOwner = prev;
542
+ }
543
+ }
544
+ };
545
+ }
546
+ function createBinding(commit, ownerNode, structural) {
524
547
  const run = () => {
525
548
  const s = subscriber;
526
549
  if (s._disposed || s._reentrant) return;
@@ -543,19 +566,25 @@ function reactiveBinding(commit, ownerNode) {
543
566
  subscriber._disposed = false;
544
567
  subscriber._errorPhase = "binding";
545
568
  subscriber._errorNode = ownerNode;
569
+ subscriber._tok = null;
570
+ subscriber._owner = null;
571
+ if (structural) subscriber._tok = { sub: subscriber };
546
572
  try {
547
573
  run();
548
574
  } catch (err) {
549
575
  subscriber._disposed = true;
550
576
  subscriber._errorNode = void 0;
577
+ if (subscriber._tok != null) subscriber._tok.sub = null;
551
578
  cleanup(subscriber);
552
579
  throw err;
553
580
  }
554
- return subscriber._dispose ?? (subscriber._dispose = () => {
581
+ subscriber._dispose = () => {
555
582
  subscriber._disposed = true;
556
583
  subscriber._errorNode = void 0;
584
+ if (subscriber._tok != null) subscriber._tok.sub = null;
557
585
  cleanup(subscriber);
558
- });
586
+ };
587
+ return subscriber;
559
588
  }
560
589
  function recordDependency(signal2) {
561
590
  if (!currentSubscriber) return;
@@ -579,6 +608,7 @@ function recordDependency(signal2) {
579
608
  }
580
609
  function cleanup(subscriber) {
581
610
  const sub = subscriber;
611
+ if (sub._owner != null) sub._owner = null;
582
612
  let node = sub.depsHead ?? null;
583
613
  sub.depsHead = null;
584
614
  sub.depsTail = null;
@@ -638,20 +668,41 @@ function drainQueue() {
638
668
  break;
639
669
  }
640
670
  const sub = pendingQueue[i++];
641
- pendingSet.delete(sub);
642
- if (quarantined.size > 0 && quarantined.has(sub)) continue;
643
- if (sub._hasComputedDep === true && !depsChanged(sub)) continue;
644
- if (tickRepeat(sub)) {
645
- cycleError(sub);
646
- quarantined.add(sub);
647
- continue;
671
+ if (!pendingSet.delete(sub)) continue;
672
+ if (sub._owner != null && pendingSet.size > 0) {
673
+ runPendingOwners(sub);
674
+ if (pendingSet.has(sub)) continue;
648
675
  }
649
- const pushed = beginDisposerCapture(sub._cap ?? null);
650
- try {
651
- safeInvoke(sub);
652
- } finally {
653
- if (pushed) endDisposerCapture();
676
+ runQueued(sub);
677
+ }
678
+ }
679
+ function runPendingOwners(sub) {
680
+ for (; ; ) {
681
+ let outer = null;
682
+ for (let t = sub._owner ?? null; t !== null; ) {
683
+ const o = t.sub;
684
+ if (o === null) break;
685
+ if (pendingSet.has(o)) outer = o;
686
+ t = o._owner ?? null;
654
687
  }
688
+ if (outer === null) return;
689
+ pendingSet.delete(outer);
690
+ runQueued(outer);
691
+ }
692
+ }
693
+ function runQueued(sub) {
694
+ if (quarantined.size > 0 && quarantined.has(sub)) return;
695
+ if (sub._hasComputedDep === true && !depsChanged(sub)) return;
696
+ if (tickRepeat(sub)) {
697
+ cycleError(sub);
698
+ quarantined.add(sub);
699
+ return;
700
+ }
701
+ const pushed = beginDisposerCapture(sub._cap ?? null);
702
+ try {
703
+ safeInvoke(sub);
704
+ } finally {
705
+ if (pushed) endDisposerCapture();
655
706
  }
656
707
  }
657
708
  function drainNotificationQueue() {
@@ -787,7 +838,7 @@ function forEachSubscriber(signal2, visit) {
787
838
  }
788
839
 
789
840
  // src/reactivity/track.ts
790
- var _runtimeVersion = true ? "4.12.0" : "dev";
841
+ var _runtimeVersion = true ? "4.13.1" : "dev";
791
842
  var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
792
843
  function resolveReactiveApi() {
793
844
  const g = globalThis;
@@ -822,6 +873,7 @@ function resolveReactiveApi() {
822
873
  getOwnerScope,
823
874
  runWithOwnerScope,
824
875
  bindOwnerScope,
876
+ structuralBinding,
825
877
  version: _runtimeVersion
826
878
  };
827
879
  g[REGISTRY_KEY] = local;
@@ -848,6 +900,7 @@ var forEachSubscriber2 = API.forEachSubscriber;
848
900
  var getOwnerScope2 = API.getOwnerScope ?? getOwnerScope;
849
901
  var runWithOwnerScope2 = API.runWithOwnerScope ?? runWithOwnerScope;
850
902
  var bindOwnerScope2 = API.bindOwnerScope ?? bindOwnerScope;
903
+ var structuralBinding2 = API.structuralBinding ?? ((commit, ownerNode) => ({ stop: API.reactiveBinding(commit, ownerNode), run: (fn) => fn() }));
851
904
 
852
905
  // src/reactivity/batch.ts
853
906
  var batchDepth = 0;
package/dist/motion.js CHANGED
@@ -20,10 +20,10 @@ import {
20
20
  stagger,
21
21
  transition,
22
22
  viewTransition
23
- } from "./chunk-ZJCHY2IB.js";
23
+ } from "./chunk-2NC56RGY.js";
24
24
  import "./chunk-5HZXGZ6T.js";
25
- import "./chunk-IHA62NGJ.js";
26
- import "./chunk-B2Y5BJSP.js";
25
+ import "./chunk-QKFVMIAV.js";
26
+ import "./chunk-4UTGDVSA.js";
27
27
  import "./chunk-NYNYSPK7.js";
28
28
  export {
29
29
  TransitionGroup,
package/dist/patterns.cjs CHANGED
@@ -328,6 +328,7 @@ function bindOwnerScope(fn) {
328
328
  if (scope === null) return fn;
329
329
  return (...args) => runWithOwnerScope(scope, () => fn(...args));
330
330
  }
331
+ var currentStructOwner = null;
331
332
  var subscriberEpochCounter = 0;
332
333
  function retrack(effectFn, subscriber) {
333
334
  const prev = currentSubscriber;
@@ -347,6 +348,9 @@ function retrack(effectFn, subscriber) {
347
348
  if (prevScope !== null && !sub._epoch && sub._scope === void 0) sub._scope = prevScope;
348
349
  const scope = sub._scope === void 0 ? null : sub._scope;
349
350
  if (scope !== prevScope) currentOwnerScope = scope;
351
+ const prevStructOwner = currentStructOwner;
352
+ if (prevStructOwner !== null && !sub._epoch && !sub._c && sub._owner == null) sub._owner = prevStructOwner;
353
+ if (sub._tok != null) currentStructOwner = sub._tok;
350
354
  const epoch = ++subscriberEpochCounter;
351
355
  sub._epoch = epoch;
352
356
  sub._structDirty = false;
@@ -360,6 +364,7 @@ function retrack(effectFn, subscriber) {
360
364
  } finally {
361
365
  currentSubscriber = prev;
362
366
  currentOwnerScope = prevScope;
367
+ currentStructOwner = prevStructOwner;
363
368
  if (savedDepth !== 0) {
364
369
  suspendDepth = savedDepth;
365
370
  suspendSavedSub = savedSuspendSub;
@@ -416,7 +421,25 @@ function track(effectFn, subscriber) {
416
421
  }
417
422
  return sub._dispose ?? (sub._dispose = () => cleanup(subscriber));
418
423
  }
419
- function reactiveBinding(commit, ownerNode) {
424
+ function reactiveBinding(commit, ownerNode, structural) {
425
+ return createBinding(commit, ownerNode, structural === true)._dispose;
426
+ }
427
+ function structuralBinding(commit, ownerNode) {
428
+ const sub = createBinding(commit, ownerNode, true);
429
+ return {
430
+ stop: sub._dispose,
431
+ run: (fn) => {
432
+ const prev = currentStructOwner;
433
+ currentStructOwner = sub._tok ?? null;
434
+ try {
435
+ return fn();
436
+ } finally {
437
+ currentStructOwner = prev;
438
+ }
439
+ }
440
+ };
441
+ }
442
+ function createBinding(commit, ownerNode, structural) {
420
443
  const run = () => {
421
444
  const s = subscriber;
422
445
  if (s._disposed || s._reentrant) return;
@@ -439,19 +462,25 @@ function reactiveBinding(commit, ownerNode) {
439
462
  subscriber._disposed = false;
440
463
  subscriber._errorPhase = "binding";
441
464
  subscriber._errorNode = ownerNode;
465
+ subscriber._tok = null;
466
+ subscriber._owner = null;
467
+ if (structural) subscriber._tok = { sub: subscriber };
442
468
  try {
443
469
  run();
444
470
  } catch (err) {
445
471
  subscriber._disposed = true;
446
472
  subscriber._errorNode = void 0;
473
+ if (subscriber._tok != null) subscriber._tok.sub = null;
447
474
  cleanup(subscriber);
448
475
  throw err;
449
476
  }
450
- return subscriber._dispose ?? (subscriber._dispose = () => {
477
+ subscriber._dispose = () => {
451
478
  subscriber._disposed = true;
452
479
  subscriber._errorNode = void 0;
480
+ if (subscriber._tok != null) subscriber._tok.sub = null;
453
481
  cleanup(subscriber);
454
- });
482
+ };
483
+ return subscriber;
455
484
  }
456
485
  function recordDependency(signal2) {
457
486
  if (!currentSubscriber) return;
@@ -475,6 +504,7 @@ function recordDependency(signal2) {
475
504
  }
476
505
  function cleanup(subscriber) {
477
506
  const sub = subscriber;
507
+ if (sub._owner != null) sub._owner = null;
478
508
  let node = sub.depsHead ?? null;
479
509
  sub.depsHead = null;
480
510
  sub.depsTail = null;
@@ -534,20 +564,41 @@ function drainQueue() {
534
564
  break;
535
565
  }
536
566
  const sub = pendingQueue[i++];
537
- pendingSet.delete(sub);
538
- if (quarantined.size > 0 && quarantined.has(sub)) continue;
539
- if (sub._hasComputedDep === true && !depsChanged(sub)) continue;
540
- if (tickRepeat(sub)) {
541
- cycleError(sub);
542
- quarantined.add(sub);
543
- continue;
544
- }
545
- const pushed = beginDisposerCapture(sub._cap ?? null);
546
- try {
547
- safeInvoke(sub);
548
- } finally {
549
- if (pushed) endDisposerCapture();
550
- }
567
+ if (!pendingSet.delete(sub)) continue;
568
+ if (sub._owner != null && pendingSet.size > 0) {
569
+ runPendingOwners(sub);
570
+ if (pendingSet.has(sub)) continue;
571
+ }
572
+ runQueued(sub);
573
+ }
574
+ }
575
+ function runPendingOwners(sub) {
576
+ for (; ; ) {
577
+ let outer = null;
578
+ for (let t = sub._owner ?? null; t !== null; ) {
579
+ const o = t.sub;
580
+ if (o === null) break;
581
+ if (pendingSet.has(o)) outer = o;
582
+ t = o._owner ?? null;
583
+ }
584
+ if (outer === null) return;
585
+ pendingSet.delete(outer);
586
+ runQueued(outer);
587
+ }
588
+ }
589
+ function runQueued(sub) {
590
+ if (quarantined.size > 0 && quarantined.has(sub)) return;
591
+ if (sub._hasComputedDep === true && !depsChanged(sub)) return;
592
+ if (tickRepeat(sub)) {
593
+ cycleError(sub);
594
+ quarantined.add(sub);
595
+ return;
596
+ }
597
+ const pushed = beginDisposerCapture(sub._cap ?? null);
598
+ try {
599
+ safeInvoke(sub);
600
+ } finally {
601
+ if (pushed) endDisposerCapture();
551
602
  }
552
603
  }
553
604
  function drainNotificationQueue() {
@@ -683,7 +734,7 @@ function forEachSubscriber(signal2, visit) {
683
734
  }
684
735
 
685
736
  // src/reactivity/track.ts
686
- var _runtimeVersion = true ? "4.12.0" : "dev";
737
+ var _runtimeVersion = true ? "4.13.1" : "dev";
687
738
  var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
688
739
  function resolveReactiveApi() {
689
740
  const g = globalThis;
@@ -718,6 +769,7 @@ function resolveReactiveApi() {
718
769
  getOwnerScope,
719
770
  runWithOwnerScope,
720
771
  bindOwnerScope,
772
+ structuralBinding,
721
773
  version: _runtimeVersion
722
774
  };
723
775
  g[REGISTRY_KEY] = local;
@@ -744,6 +796,7 @@ var forEachSubscriber2 = API.forEachSubscriber;
744
796
  var getOwnerScope2 = API.getOwnerScope ?? getOwnerScope;
745
797
  var runWithOwnerScope2 = API.runWithOwnerScope ?? runWithOwnerScope;
746
798
  var bindOwnerScope2 = API.bindOwnerScope ?? bindOwnerScope;
799
+ var structuralBinding2 = API.structuralBinding ?? ((commit, ownerNode) => ({ stop: API.reactiveBinding(commit, ownerNode), run: (fn) => fn() }));
747
800
 
748
801
  // src/reactivity/batch.ts
749
802
  var batchDepth = 0;
package/dist/patterns.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  optimisticList,
6
6
  persisted,
7
7
  timeline
8
- } from "./chunk-LXBMVGVB.js";
8
+ } from "./chunk-QZ47OZ25.js";
9
9
  import {
10
10
  RenderProp,
11
11
  assertType,
@@ -23,11 +23,11 @@ import {
23
23
  withWrapper
24
24
  } from "./chunk-TUCPL2HB.js";
25
25
  import "./chunk-62BDYGAG.js";
26
- import "./chunk-RK7EPQPG.js";
27
- import "./chunk-EMB5PG7V.js";
26
+ import "./chunk-YFTBCCVH.js";
27
+ import "./chunk-QC3NP47A.js";
28
28
  import "./chunk-7XHATCIH.js";
29
- import "./chunk-IHA62NGJ.js";
30
- import "./chunk-B2Y5BJSP.js";
29
+ import "./chunk-QKFVMIAV.js";
30
+ import "./chunk-4UTGDVSA.js";
31
31
  import "./chunk-NYNYSPK7.js";
32
32
  export {
33
33
  RenderProp,
@@ -594,6 +594,7 @@ function bindOwnerScope(fn) {
594
594
  if (scope === null) return fn;
595
595
  return (...args) => runWithOwnerScope(scope, () => fn(...args));
596
596
  }
597
+ var currentStructOwner = null;
597
598
  var subscriberEpochCounter = 0;
598
599
  function retrack(effectFn, subscriber) {
599
600
  const prev = currentSubscriber;
@@ -613,6 +614,9 @@ function retrack(effectFn, subscriber) {
613
614
  if (prevScope !== null && !sub._epoch && sub._scope === void 0) sub._scope = prevScope;
614
615
  const scope = sub._scope === void 0 ? null : sub._scope;
615
616
  if (scope !== prevScope) currentOwnerScope = scope;
617
+ const prevStructOwner = currentStructOwner;
618
+ if (prevStructOwner !== null && !sub._epoch && !sub._c && sub._owner == null) sub._owner = prevStructOwner;
619
+ if (sub._tok != null) currentStructOwner = sub._tok;
616
620
  const epoch = ++subscriberEpochCounter;
617
621
  sub._epoch = epoch;
618
622
  sub._structDirty = false;
@@ -626,6 +630,7 @@ function retrack(effectFn, subscriber) {
626
630
  } finally {
627
631
  currentSubscriber = prev;
628
632
  currentOwnerScope = prevScope;
633
+ currentStructOwner = prevStructOwner;
629
634
  if (savedDepth !== 0) {
630
635
  suspendDepth = savedDepth;
631
636
  suspendSavedSub = savedSuspendSub;
@@ -682,7 +687,25 @@ function track(effectFn, subscriber) {
682
687
  }
683
688
  return sub._dispose ?? (sub._dispose = () => cleanup(subscriber));
684
689
  }
685
- function reactiveBinding(commit, ownerNode) {
690
+ function reactiveBinding(commit, ownerNode, structural) {
691
+ return createBinding(commit, ownerNode, structural === true)._dispose;
692
+ }
693
+ function structuralBinding(commit, ownerNode) {
694
+ const sub = createBinding(commit, ownerNode, true);
695
+ return {
696
+ stop: sub._dispose,
697
+ run: (fn) => {
698
+ const prev = currentStructOwner;
699
+ currentStructOwner = sub._tok ?? null;
700
+ try {
701
+ return fn();
702
+ } finally {
703
+ currentStructOwner = prev;
704
+ }
705
+ }
706
+ };
707
+ }
708
+ function createBinding(commit, ownerNode, structural) {
686
709
  const run = () => {
687
710
  const s = subscriber;
688
711
  if (s._disposed || s._reentrant) return;
@@ -705,19 +728,25 @@ function reactiveBinding(commit, ownerNode) {
705
728
  subscriber._disposed = false;
706
729
  subscriber._errorPhase = "binding";
707
730
  subscriber._errorNode = ownerNode;
731
+ subscriber._tok = null;
732
+ subscriber._owner = null;
733
+ if (structural) subscriber._tok = { sub: subscriber };
708
734
  try {
709
735
  run();
710
736
  } catch (err) {
711
737
  subscriber._disposed = true;
712
738
  subscriber._errorNode = void 0;
739
+ if (subscriber._tok != null) subscriber._tok.sub = null;
713
740
  cleanup(subscriber);
714
741
  throw err;
715
742
  }
716
- return subscriber._dispose ?? (subscriber._dispose = () => {
743
+ subscriber._dispose = () => {
717
744
  subscriber._disposed = true;
718
745
  subscriber._errorNode = void 0;
746
+ if (subscriber._tok != null) subscriber._tok.sub = null;
719
747
  cleanup(subscriber);
720
- });
748
+ };
749
+ return subscriber;
721
750
  }
722
751
  function recordDependency(signal2) {
723
752
  if (!currentSubscriber) return;
@@ -741,6 +770,7 @@ function recordDependency(signal2) {
741
770
  }
742
771
  function cleanup(subscriber) {
743
772
  const sub = subscriber;
773
+ if (sub._owner != null) sub._owner = null;
744
774
  let node = sub.depsHead ?? null;
745
775
  sub.depsHead = null;
746
776
  sub.depsTail = null;
@@ -800,20 +830,41 @@ function drainQueue() {
800
830
  break;
801
831
  }
802
832
  const sub = pendingQueue[i++];
803
- pendingSet.delete(sub);
804
- if (quarantined.size > 0 && quarantined.has(sub)) continue;
805
- if (sub._hasComputedDep === true && !depsChanged(sub)) continue;
806
- if (tickRepeat(sub)) {
807
- cycleError(sub);
808
- quarantined.add(sub);
809
- continue;
833
+ if (!pendingSet.delete(sub)) continue;
834
+ if (sub._owner != null && pendingSet.size > 0) {
835
+ runPendingOwners(sub);
836
+ if (pendingSet.has(sub)) continue;
810
837
  }
811
- const pushed = beginDisposerCapture(sub._cap ?? null);
812
- try {
813
- safeInvoke(sub);
814
- } finally {
815
- if (pushed) endDisposerCapture();
838
+ runQueued(sub);
839
+ }
840
+ }
841
+ function runPendingOwners(sub) {
842
+ for (; ; ) {
843
+ let outer = null;
844
+ for (let t = sub._owner ?? null; t !== null; ) {
845
+ const o = t.sub;
846
+ if (o === null) break;
847
+ if (pendingSet.has(o)) outer = o;
848
+ t = o._owner ?? null;
816
849
  }
850
+ if (outer === null) return;
851
+ pendingSet.delete(outer);
852
+ runQueued(outer);
853
+ }
854
+ }
855
+ function runQueued(sub) {
856
+ if (quarantined.size > 0 && quarantined.has(sub)) return;
857
+ if (sub._hasComputedDep === true && !depsChanged(sub)) return;
858
+ if (tickRepeat(sub)) {
859
+ cycleError(sub);
860
+ quarantined.add(sub);
861
+ return;
862
+ }
863
+ const pushed = beginDisposerCapture(sub._cap ?? null);
864
+ try {
865
+ safeInvoke(sub);
866
+ } finally {
867
+ if (pushed) endDisposerCapture();
817
868
  }
818
869
  }
819
870
  function drainNotificationQueue() {
@@ -949,7 +1000,7 @@ function forEachSubscriber(signal2, visit) {
949
1000
  }
950
1001
 
951
1002
  // src/reactivity/track.ts
952
- var _runtimeVersion = true ? "4.12.0" : "dev";
1003
+ var _runtimeVersion = true ? "4.13.1" : "dev";
953
1004
  var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
954
1005
  function resolveReactiveApi() {
955
1006
  const g = globalThis;
@@ -984,6 +1035,7 @@ function resolveReactiveApi() {
984
1035
  getOwnerScope,
985
1036
  runWithOwnerScope,
986
1037
  bindOwnerScope,
1038
+ structuralBinding,
987
1039
  version: _runtimeVersion
988
1040
  };
989
1041
  g[REGISTRY_KEY] = local;
@@ -1010,6 +1062,7 @@ var forEachSubscriber2 = API.forEachSubscriber;
1010
1062
  var getOwnerScope2 = API.getOwnerScope ?? getOwnerScope;
1011
1063
  var runWithOwnerScope2 = API.runWithOwnerScope ?? runWithOwnerScope;
1012
1064
  var bindOwnerScope2 = API.bindOwnerScope ?? bindOwnerScope;
1065
+ var structuralBinding2 = API.structuralBinding ?? ((commit, ownerNode) => ({ stop: API.reactiveBinding(commit, ownerNode), run: (fn) => fn() }));
1013
1066
 
1014
1067
  // src/core/devtoolsHook.ts
1015
1068
  function emitDevtools(hook, event, payload) {
@@ -33,7 +33,7 @@ import {
33
33
  transitionState,
34
34
  uniqueId,
35
35
  yieldToMain
36
- } from "./chunk-CI4W6XAU.js";
36
+ } from "./chunk-KC62VURU.js";
37
37
  import {
38
38
  trustHTML
39
39
  } from "./chunk-2F4PSJ5Z.js";
@@ -41,11 +41,11 @@ import "./chunk-AM6DZLBM.js";
41
41
  import "./chunk-62BDYGAG.js";
42
42
  import "./chunk-F2UWOZ6J.js";
43
43
  import "./chunk-7ZHH77QA.js";
44
- import "./chunk-EMB5PG7V.js";
44
+ import "./chunk-QC3NP47A.js";
45
45
  import "./chunk-EXXSN3BW.js";
46
46
  import "./chunk-7XHATCIH.js";
47
- import "./chunk-IHA62NGJ.js";
48
- import "./chunk-B2Y5BJSP.js";
47
+ import "./chunk-QKFVMIAV.js";
48
+ import "./chunk-4UTGDVSA.js";
49
49
  import "./chunk-NYNYSPK7.js";
50
50
  export {
51
51
  DOMPool,