sibujs 3.3.0 → 3.3.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 (54) hide show
  1. package/dist/browser.cjs +210 -26
  2. package/dist/browser.js +4 -4
  3. package/dist/build.cjs +193 -89
  4. package/dist/build.js +10 -10
  5. package/dist/cdn.global.js +7 -7
  6. package/dist/{chunk-24DBWDTK.js → chunk-37BUKSLH.js} +1 -1
  7. package/dist/{chunk-IHBVTURX.js → chunk-4UUMSLSL.js} +4 -4
  8. package/dist/{chunk-USDR2GFV.js → chunk-6LTFHJQG.js} +3 -3
  9. package/dist/{chunk-MWZFOIBG.js → chunk-AMIKDMLP.js} +4 -4
  10. package/dist/{chunk-JBXNCZSC.js → chunk-F7FXQ3QS.js} +1 -1
  11. package/dist/{chunk-BEIKESVL.js → chunk-IKLYI3RF.js} +9 -9
  12. package/dist/{chunk-NUWKIEHE.js → chunk-LU2MQXQQ.js} +2 -2
  13. package/dist/{chunk-WVJJUFPC.js → chunk-M5KBNOSJ.js} +2 -2
  14. package/dist/{chunk-7JHWAGRQ.js → chunk-MHBCEJQO.js} +1 -1
  15. package/dist/{chunk-Q2ERM6NT.js → chunk-NHKQKKZU.js} +1 -1
  16. package/dist/{chunk-6G6UNHZI.js → chunk-RYMOSG5B.js} +5 -5
  17. package/dist/{chunk-F4UM7QBJ.js → chunk-SLMFA3ZZ.js} +1 -1
  18. package/dist/{chunk-X3NHE2DK.js → chunk-TEFZT5PJ.js} +83 -17
  19. package/dist/{chunk-SLCUP2EK.js → chunk-ULLTNDRA.js} +3 -3
  20. package/dist/{chunk-M6WSIGYW.js → chunk-VOVVTOEA.js} +2 -2
  21. package/dist/{chunk-XQ7XSGYP.js → chunk-WL7BIR6O.js} +1 -1
  22. package/dist/{chunk-CVMMULHO.js → chunk-WW6DAGGR.js} +4 -4
  23. package/dist/{chunk-5K72I3UQ.js → chunk-WZG2SZOT.js} +21 -4
  24. package/dist/{chunk-S4FHR5ZZ.js → chunk-XH2RTYEQ.js} +3 -3
  25. package/dist/{chunk-4WXWJ4SW.js → chunk-Z37APKBV.js} +4 -4
  26. package/dist/data.cjs +161 -23
  27. package/dist/data.js +6 -6
  28. package/dist/devtools.cjs +245 -31
  29. package/dist/devtools.js +4 -4
  30. package/dist/ecosystem.cjs +183 -45
  31. package/dist/ecosystem.js +7 -7
  32. package/dist/extras.cjs +185 -86
  33. package/dist/extras.js +19 -19
  34. package/dist/index.cjs +193 -89
  35. package/dist/index.d.cts +59 -8
  36. package/dist/index.d.ts +59 -8
  37. package/dist/index.js +10 -10
  38. package/dist/motion.cjs +329 -13
  39. package/dist/motion.js +3 -3
  40. package/dist/patterns.cjs +161 -23
  41. package/dist/patterns.js +5 -5
  42. package/dist/performance.cjs +258 -23
  43. package/dist/performance.js +4 -4
  44. package/dist/plugins.cjs +244 -51
  45. package/dist/plugins.js +6 -6
  46. package/dist/ssr.cjs +183 -44
  47. package/dist/ssr.js +7 -7
  48. package/dist/testing.cjs +396 -5
  49. package/dist/testing.js +2 -2
  50. package/dist/ui.cjs +221 -32
  51. package/dist/ui.js +6 -6
  52. package/dist/widgets.cjs +146 -26
  53. package/dist/widgets.js +6 -6
  54. package/package.json +1 -1
package/dist/extras.cjs CHANGED
@@ -145,7 +145,7 @@ __export(extras_exports, {
145
145
  getPerformanceReport: () => getPerformanceReport,
146
146
  getQueryData: () => getQueryData,
147
147
  getSignalName: () => getSignalName,
148
- getSubscriberCount: () => getSubscriberCount2,
148
+ getSubscriberCount: () => getSubscriberCount3,
149
149
  globalStore: () => globalStore,
150
150
  healthCheck: () => healthCheck,
151
151
  hmrState: () => hmrState,
@@ -337,7 +337,7 @@ function devWarn(message) {
337
337
  }
338
338
  }
339
339
 
340
- // src/reactivity/track.ts
340
+ // src/reactivity/track-core.ts
341
341
  var _isDev2 = isDev();
342
342
  var POOL_MAX = 4096;
343
343
  var nodePool = [];
@@ -451,6 +451,17 @@ function resumeTracking() {
451
451
  trackingSuspended = false;
452
452
  }
453
453
  }
454
+ function isTrackingSuspended() {
455
+ return trackingSuspended;
456
+ }
457
+ function untracked(fn) {
458
+ suspendTracking();
459
+ try {
460
+ return fn();
461
+ } finally {
462
+ resumeTracking();
463
+ }
464
+ }
454
465
  var subscriberEpochCounter = 0;
455
466
  function retrack(effectFn, subscriber) {
456
467
  const prev = currentSubscriber;
@@ -560,6 +571,16 @@ function cleanup(subscriber) {
560
571
  var maxSubscriberRepeats = 50;
561
572
  var maxDrainIterations = 1e6;
562
573
  var drainEpoch = 0;
574
+ function setMaxSubscriberRepeats(n) {
575
+ const prev = maxSubscriberRepeats;
576
+ if (Number.isFinite(n) && n > 0) maxSubscriberRepeats = Math.floor(n);
577
+ return prev;
578
+ }
579
+ function setMaxDrainIterations(n) {
580
+ const prev = maxDrainIterations;
581
+ if (Number.isFinite(n) && n > 0) maxDrainIterations = Math.floor(n);
582
+ return prev;
583
+ }
563
584
  function tickRepeat(sub2) {
564
585
  const s2 = sub2;
565
586
  if (s2._runEpoch !== drainEpoch) {
@@ -730,6 +751,64 @@ function forEachSubscriber(signal2, visit) {
730
751
  }
731
752
  }
732
753
 
754
+ // src/reactivity/track.ts
755
+ var _isDev3 = isDev();
756
+ var _runtimeVersion = typeof __SIBU_VERSION__ !== "undefined" ? __SIBU_VERSION__ : "dev";
757
+ var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
758
+ function resolveReactiveApi() {
759
+ const g2 = globalThis;
760
+ const existing = g2[REGISTRY_KEY];
761
+ if (existing) {
762
+ if (_isDev3 && !existing.__dupWarned) {
763
+ existing.__dupWarned = true;
764
+ devWarn(
765
+ `Multiple instances of the reactive runtime detected on this page (active: ${existing.version}, duplicate: ${_runtimeVersion}). Reactivity still works \u2014 all copies share the first one \u2014 but de-duplicate sibujs in your bundler (e.g. Vite optimizeDeps.exclude: ['sibujs'] or resolve.dedupe: ['sibujs']).`
766
+ );
767
+ }
768
+ return existing;
769
+ }
770
+ const local = {
771
+ suspendTracking,
772
+ resumeTracking,
773
+ isTrackingSuspended,
774
+ untracked,
775
+ retrack,
776
+ track,
777
+ reactiveBinding,
778
+ recordDependency,
779
+ cleanup,
780
+ setMaxSubscriberRepeats,
781
+ setMaxDrainIterations,
782
+ drainNotificationQueue,
783
+ queueSignalNotification,
784
+ notifySubscribers,
785
+ getSubscriberCount,
786
+ getSubscriberDeps,
787
+ forEachSubscriber,
788
+ version: _runtimeVersion
789
+ };
790
+ g2[REGISTRY_KEY] = local;
791
+ return local;
792
+ }
793
+ var API = resolveReactiveApi();
794
+ var suspendTracking2 = API.suspendTracking;
795
+ var resumeTracking2 = API.resumeTracking;
796
+ var isTrackingSuspended2 = API.isTrackingSuspended;
797
+ var untracked2 = API.untracked;
798
+ var retrack2 = API.retrack;
799
+ var track2 = API.track;
800
+ var reactiveBinding2 = API.reactiveBinding;
801
+ var recordDependency2 = API.recordDependency;
802
+ var cleanup2 = API.cleanup;
803
+ var setMaxSubscriberRepeats2 = API.setMaxSubscriberRepeats;
804
+ var setMaxDrainIterations2 = API.setMaxDrainIterations;
805
+ var drainNotificationQueue2 = API.drainNotificationQueue;
806
+ var queueSignalNotification2 = API.queueSignalNotification;
807
+ var notifySubscribers2 = API.notifySubscribers;
808
+ var getSubscriberCount2 = API.getSubscriberCount;
809
+ var getSubscriberDeps2 = API.getSubscriberDeps;
810
+ var forEachSubscriber2 = API.forEachSubscriber;
811
+
733
812
  // src/core/signals/derived.ts
734
813
  function derived(getter, options) {
735
814
  devAssert(typeof getter === "function", "derived: argument must be a getter function.");
@@ -752,7 +831,7 @@ function derived(getter, options) {
752
831
  cs._d = false;
753
832
  cs._init = true;
754
833
  };
755
- track(() => {
834
+ track2(() => {
756
835
  let threw = true;
757
836
  try {
758
837
  cs._v = getter();
@@ -771,12 +850,12 @@ function derived(getter, options) {
771
850
  `[SibuJS] Circular dependency detected in derived${debugName ? ` "${debugName}"` : ""}. A derived signal cannot read itself (directly or through a chain).`
772
851
  );
773
852
  }
774
- if (trackingSuspended) {
853
+ if (isTrackingSuspended2()) {
775
854
  if (cs._d) {
776
855
  const prev = cs._v;
777
856
  evaluating = true;
778
857
  try {
779
- retrack(recompute, markDirty);
858
+ retrack2(recompute, markDirty);
780
859
  if (!Object.is(prev, cs._v)) cs.__v++;
781
860
  } finally {
782
861
  evaluating = false;
@@ -784,12 +863,12 @@ function derived(getter, options) {
784
863
  }
785
864
  return cs._v;
786
865
  }
787
- recordDependency(cs);
866
+ recordDependency2(cs);
788
867
  if (cs._d) {
789
868
  const oldValue = cs._v;
790
869
  evaluating = true;
791
870
  try {
792
- retrack(recompute, markDirty);
871
+ retrack2(recompute, markDirty);
793
872
  if (!Object.is(oldValue, cs._v)) cs.__v++;
794
873
  } finally {
795
874
  evaluating = false;
@@ -869,7 +948,7 @@ function drainReruns(ctx) {
869
948
  do {
870
949
  ctx.rerunPending = false;
871
950
  if (ctx.userCleanups.length > 0) flushUserCleanups(ctx);
872
- retrack(ctx.bodyFn, ctx.subscriber);
951
+ retrack2(ctx.bodyFn, ctx.subscriber);
873
952
  } while (ctx.rerunPending && ++reruns <= MAX_RERUNS);
874
953
  if (ctx.rerunPending) {
875
954
  ctx.rerunPending = false;
@@ -898,7 +977,7 @@ function disposeEffect(ctx) {
898
977
  }
899
978
  }
900
979
  try {
901
- cleanup(ctx.subscriber);
980
+ cleanup2(ctx.subscriber);
902
981
  } catch (err) {
903
982
  if (typeof console !== "undefined") {
904
983
  console.warn("[SibuJS effect] dispose threw:", err);
@@ -943,7 +1022,7 @@ function effect(effectFn, options) {
943
1022
  try {
944
1023
  ctx.rerunPending = false;
945
1024
  if (ctx.userCleanups.length > 0) flushUserCleanups(ctx);
946
- retrack(ctx.bodyFn, sub2);
1025
+ retrack2(ctx.bodyFn, sub2);
947
1026
  if (ctx.rerunPending) drainReruns(ctx);
948
1027
  } finally {
949
1028
  ctx.running = false;
@@ -959,7 +1038,7 @@ function effect(effectFn, options) {
959
1038
  ctx.subscriber = sub2;
960
1039
  ctx.running = true;
961
1040
  try {
962
- retrack(ctx.bodyFn, ctx.subscriber);
1041
+ retrack2(ctx.bodyFn, ctx.subscriber);
963
1042
  if (ctx.rerunPending) drainReruns(ctx);
964
1043
  } finally {
965
1044
  ctx.running = false;
@@ -973,7 +1052,7 @@ function effect(effectFn, options) {
973
1052
  // src/reactivity/batch.ts
974
1053
  var batchDepth = 0;
975
1054
  var pendingSignals = /* @__PURE__ */ new Set();
976
- function batch(fn) {
1055
+ function batchImpl(fn) {
977
1056
  batchDepth++;
978
1057
  try {
979
1058
  return fn();
@@ -984,25 +1063,45 @@ function batch(fn) {
984
1063
  }
985
1064
  }
986
1065
  }
987
- function enqueueBatchedSignal(signal2) {
1066
+ function enqueueBatchedSignalImpl(signal2) {
988
1067
  if (batchDepth === 0) return false;
989
1068
  pendingSignals.add(signal2);
990
1069
  return true;
991
1070
  }
1071
+ function isBatchingImpl() {
1072
+ return batchDepth > 0;
1073
+ }
992
1074
  function flushBatch() {
993
1075
  try {
994
1076
  for (const signal2 of pendingSignals) {
995
- queueSignalNotification(signal2);
1077
+ queueSignalNotification2(signal2);
996
1078
  }
997
1079
  } finally {
998
1080
  pendingSignals.clear();
999
1081
  }
1000
- drainNotificationQueue();
1082
+ drainNotificationQueue2();
1001
1083
  }
1084
+ var BATCH_REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.batch.v1");
1085
+ function resolveBatchApi() {
1086
+ const g2 = globalThis;
1087
+ const existing = g2[BATCH_REGISTRY_KEY];
1088
+ if (existing) return existing;
1089
+ const local = {
1090
+ batch: batchImpl,
1091
+ enqueueBatchedSignal: enqueueBatchedSignalImpl,
1092
+ isBatching: isBatchingImpl
1093
+ };
1094
+ g2[BATCH_REGISTRY_KEY] = local;
1095
+ return local;
1096
+ }
1097
+ var API2 = resolveBatchApi();
1098
+ var batch = API2.batch;
1099
+ var enqueueBatchedSignal = API2.enqueueBatchedSignal;
1100
+ var isBatching = API2.isBatching;
1002
1101
 
1003
1102
  // src/core/signals/signal.ts
1004
1103
  var _g2 = globalThis;
1005
- var _isDev3 = isDev();
1104
+ var _isDev4 = isDev();
1006
1105
  function signal(initial, options) {
1007
1106
  const state = {
1008
1107
  value: initial,
@@ -1013,11 +1112,11 @@ function signal(initial, options) {
1013
1112
  __activeNode: null,
1014
1113
  __name: void 0
1015
1114
  };
1016
- const debugName = _isDev3 ? options?.name : void 0;
1115
+ const debugName = _isDev4 ? options?.name : void 0;
1017
1116
  const equalsFn = options?.equals;
1018
1117
  if (debugName) state.__name = debugName;
1019
1118
  function get() {
1020
- recordDependency(state);
1119
+ recordDependency2(state);
1021
1120
  return state.value;
1022
1121
  }
1023
1122
  get.__signal = state;
@@ -1030,15 +1129,15 @@ function signal(initial, options) {
1030
1129
  if (equalsFn(prev, newValue)) return;
1031
1130
  state.value = newValue;
1032
1131
  state.__v++;
1033
- if (_isDev3) {
1132
+ if (_isDev4) {
1034
1133
  const hook = _g2.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
1035
1134
  if (hook) hook.emit("signal:update", { signal: state, name: debugName, oldValue: prev, newValue });
1036
1135
  }
1037
1136
  if (!enqueueBatchedSignal(state)) {
1038
- notifySubscribers(state);
1137
+ notifySubscribers2(state);
1039
1138
  }
1040
1139
  };
1041
- } else if (_isDev3) {
1140
+ } else if (_isDev4) {
1042
1141
  set = (next) => {
1043
1142
  const prev = state.value;
1044
1143
  const newValue = typeof next === "function" ? next(prev) : next;
@@ -1048,7 +1147,7 @@ function signal(initial, options) {
1048
1147
  const hook = _g2.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
1049
1148
  if (hook) hook.emit("signal:update", { signal: state, name: debugName, oldValue: prev, newValue });
1050
1149
  if (!enqueueBatchedSignal(state)) {
1051
- notifySubscribers(state);
1150
+ notifySubscribers2(state);
1052
1151
  }
1053
1152
  };
1054
1153
  } else {
@@ -1059,11 +1158,11 @@ function signal(initial, options) {
1059
1158
  state.value = newValue;
1060
1159
  state.__v++;
1061
1160
  if (!enqueueBatchedSignal(state)) {
1062
- notifySubscribers(state);
1161
+ notifySubscribers2(state);
1063
1162
  }
1064
1163
  };
1065
1164
  }
1066
- if (_isDev3) {
1165
+ if (_isDev4) {
1067
1166
  const hook = _g2.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
1068
1167
  if (hook) hook.emit("signal:create", { signal: state, name: debugName, getter: get, initial });
1069
1168
  }
@@ -2430,7 +2529,7 @@ function resize(target) {
2430
2529
  } };
2431
2530
  }
2432
2531
  const getter = resolveTarget(target);
2433
- const cleanup2 = effect(() => {
2532
+ const cleanup3 = effect(() => {
2434
2533
  const el = getter();
2435
2534
  if (observer) {
2436
2535
  observer.disconnect();
@@ -2449,7 +2548,7 @@ function resize(target) {
2449
2548
  observer.observe(el);
2450
2549
  });
2451
2550
  function dispose2() {
2452
- cleanup2();
2551
+ cleanup3();
2453
2552
  if (observer) {
2454
2553
  observer.disconnect();
2455
2554
  observer = null;
@@ -2733,7 +2832,7 @@ function draggable(element, data2) {
2733
2832
  let onDragStart = null;
2734
2833
  let onDragEnd = null;
2735
2834
  const getter = resolveTarget2(element);
2736
- const cleanup2 = effect(() => {
2835
+ const cleanup3 = effect(() => {
2737
2836
  if (currentEl && onDragStart && onDragEnd) {
2738
2837
  currentEl.removeEventListener("dragstart", onDragStart);
2739
2838
  currentEl.removeEventListener("dragend", onDragEnd);
@@ -2755,7 +2854,7 @@ function draggable(element, data2) {
2755
2854
  el.addEventListener("dragend", onDragEnd);
2756
2855
  });
2757
2856
  function dispose2() {
2758
- cleanup2();
2857
+ cleanup3();
2759
2858
  if (currentEl && onDragStart && onDragEnd) {
2760
2859
  currentEl.removeEventListener("dragstart", onDragStart);
2761
2860
  currentEl.removeEventListener("dragend", onDragEnd);
@@ -2776,7 +2875,7 @@ function dropZone(element, options) {
2776
2875
  let onDragLeave = null;
2777
2876
  let onDrop = null;
2778
2877
  const getter = resolveTarget2(element);
2779
- const cleanup2 = effect(() => {
2878
+ const cleanup3 = effect(() => {
2780
2879
  if (currentEl && onDragOver && onDragEnter && onDragLeave && onDrop) {
2781
2880
  currentEl.removeEventListener("dragover", onDragOver);
2782
2881
  currentEl.removeEventListener("dragenter", onDragEnter);
@@ -2818,7 +2917,7 @@ function dropZone(element, options) {
2818
2917
  el.addEventListener("drop", onDrop);
2819
2918
  });
2820
2919
  function dispose2() {
2821
- cleanup2();
2920
+ cleanup3();
2822
2921
  if (currentEl && onDragOver && onDragEnter && onDragLeave && onDrop) {
2823
2922
  currentEl.removeEventListener("dragover", onDragOver);
2824
2923
  currentEl.removeEventListener("dragenter", onDragEnter);
@@ -2838,11 +2937,11 @@ function title(value) {
2838
2937
  }
2839
2938
  const previousTitle = document.title;
2840
2939
  if (typeof value === "function") {
2841
- const cleanup2 = effect(() => {
2940
+ const cleanup3 = effect(() => {
2842
2941
  document.title = value();
2843
2942
  });
2844
2943
  return () => {
2845
- cleanup2();
2944
+ cleanup3();
2846
2945
  document.title = previousTitle;
2847
2946
  };
2848
2947
  }
@@ -4535,7 +4634,7 @@ function TransitionGroup(options) {
4535
4634
  }
4536
4635
  setElements((prev) => prev.filter((e) => e !== el));
4537
4636
  }
4538
- function track3(newElements) {
4637
+ function track4(newElements) {
4539
4638
  const oldPositions = /* @__PURE__ */ new Map();
4540
4639
  for (const el of elements()) {
4541
4640
  if (typeof el.getBoundingClientRect === "function") {
@@ -4577,7 +4676,7 @@ function TransitionGroup(options) {
4577
4676
  }
4578
4677
  }
4579
4678
  }
4580
- return { add, remove, track: track3 };
4679
+ return { add, remove, track: track4 };
4581
4680
  }
4582
4681
 
4583
4682
  // src/ui/viewTransition.ts
@@ -4881,7 +4980,7 @@ function form(config) {
4881
4980
 
4882
4981
  // src/core/rendering/dispose.ts
4883
4982
  var elementDisposers = /* @__PURE__ */ new WeakMap();
4884
- var _isDev4 = isDev();
4983
+ var _isDev5 = isDev();
4885
4984
  var activeBindingCount = 0;
4886
4985
  function registerDisposer(node, teardown) {
4887
4986
  let disposers = elementDisposers.get(node);
@@ -4890,7 +4989,7 @@ function registerDisposer(node, teardown) {
4890
4989
  elementDisposers.set(node, disposers);
4891
4990
  }
4892
4991
  disposers.push(teardown);
4893
- if (_isDev4) activeBindingCount++;
4992
+ if (_isDev5) activeBindingCount++;
4894
4993
  }
4895
4994
  function dispose(node) {
4896
4995
  const stack = [node];
@@ -4909,12 +5008,12 @@ function dispose(node) {
4909
5008
  if (disposers) {
4910
5009
  const snapshot = disposers.slice();
4911
5010
  elementDisposers.delete(current);
4912
- if (_isDev4) activeBindingCount -= snapshot.length;
5011
+ if (_isDev5) activeBindingCount -= snapshot.length;
4913
5012
  for (const d of snapshot) {
4914
5013
  try {
4915
5014
  d();
4916
5015
  } catch (err) {
4917
- if (_isDev4 && typeof console !== "undefined") {
5016
+ if (_isDev5 && typeof console !== "undefined") {
4918
5017
  console.warn("[SibuJS] Disposer threw during cleanup:", err);
4919
5018
  }
4920
5019
  }
@@ -4925,12 +5024,12 @@ function dispose(node) {
4925
5024
  if (!added || added.length === 0) break;
4926
5025
  const moreSnapshot = added.slice();
4927
5026
  elementDisposers.delete(current);
4928
- if (_isDev4) activeBindingCount -= moreSnapshot.length;
5027
+ if (_isDev5) activeBindingCount -= moreSnapshot.length;
4929
5028
  for (const d of moreSnapshot) {
4930
5029
  try {
4931
5030
  d();
4932
5031
  } catch (err) {
4933
- if (_isDev4 && typeof console !== "undefined") {
5032
+ if (_isDev5 && typeof console !== "undefined") {
4934
5033
  console.warn("[SibuJS] Disposer threw during cleanup:", err);
4935
5034
  }
4936
5035
  }
@@ -5168,7 +5267,7 @@ function aria(element, attrs) {
5168
5267
  const getter = value;
5169
5268
  registerDisposer(
5170
5269
  element,
5171
- track(() => {
5270
+ track2(() => {
5172
5271
  element.setAttribute(ariaKey, String(getter()));
5173
5272
  })
5174
5273
  );
@@ -5441,13 +5540,13 @@ function removeScopedStyle(scopeId) {
5441
5540
  }
5442
5541
 
5443
5542
  // src/reactivity/bindAttribute.ts
5444
- var _isDev5 = isDev();
5543
+ var _isDev6 = isDev();
5445
5544
  function setProp(el, key, val) {
5446
5545
  el[key] = val;
5447
5546
  }
5448
5547
  function bindAttribute(el, attr, getter) {
5449
5548
  if (isEventHandlerAttr(attr)) {
5450
- if (_isDev5)
5549
+ if (_isDev6)
5451
5550
  devWarn(
5452
5551
  `bindAttribute: refusing to bind event-handler attribute "${attr}". Use on:{ ${attr.slice(2)}: fn } instead.`
5453
5552
  );
@@ -5459,7 +5558,7 @@ function bindAttribute(el, attr, getter) {
5459
5558
  try {
5460
5559
  value = getter();
5461
5560
  } catch (err) {
5462
- if (_isDev5)
5561
+ if (_isDev6)
5463
5562
  devWarn(`bindAttribute: getter for "${attr}" threw: ${err instanceof Error ? err.message : String(err)}`);
5464
5563
  return;
5465
5564
  }
@@ -5480,7 +5579,7 @@ function bindAttribute(el, attr, getter) {
5480
5579
  el.setAttribute(attr, sanitizeAttributeString(attr, str));
5481
5580
  }
5482
5581
  }
5483
- return reactiveBinding(commit);
5582
+ return reactiveBinding2(commit);
5484
5583
  }
5485
5584
 
5486
5585
  // src/ui/reactiveAttr.ts
@@ -5530,7 +5629,7 @@ function bindBoolAttr(el, attr, getter) {
5530
5629
  el.removeAttribute(attr);
5531
5630
  }
5532
5631
  }
5533
- const teardown = track(commit);
5632
+ const teardown = track2(commit);
5534
5633
  return teardown;
5535
5634
  }
5536
5635
  function bindData(el, key, getter) {
@@ -5991,7 +6090,7 @@ function uniqueId(suffix) {
5991
6090
  }
5992
6091
 
5993
6092
  // src/performance/domRecycler.ts
5994
- var _isDev6 = isDev();
6093
+ var _isDev7 = isDev();
5995
6094
  var DOMPool = class {
5996
6095
  constructor(maxSize = 50) {
5997
6096
  this.pools = /* @__PURE__ */ new Map();
@@ -6018,7 +6117,7 @@ var DOMPool = class {
6018
6117
  * is almost certainly a bug.
6019
6118
  */
6020
6119
  release(element) {
6021
- if (_isDev6 && element.isConnected) {
6120
+ if (_isDev7 && element.isConnected) {
6022
6121
  devWarn(
6023
6122
  "DOMPool.release() called on a still-connected element. Detach it from the DOM first (remove() / dispose())."
6024
6123
  );
@@ -6133,7 +6232,7 @@ function noSideEffect(fn) {
6133
6232
  function sanitizeUrlAttr(name, value) {
6134
6233
  return name === "srcset" ? sanitizeSrcset(value) : sanitizeUrl(value);
6135
6234
  }
6136
- var _isDev7 = isDev();
6235
+ var _isDev8 = isDev();
6137
6236
  var SAFE_ATTR_NAME = /^[A-Za-z_:][-A-Za-z0-9_.:]*$/;
6138
6237
  function isSafeAttrName(name) {
6139
6238
  return SAFE_ATTR_NAME.test(name);
@@ -6153,7 +6252,7 @@ var URL_ATTRS = /* @__PURE__ */ new Set([
6153
6252
  "xlink:href"
6154
6253
  ]);
6155
6254
  function ssrErrorComment(err) {
6156
- if (_isDev7) {
6255
+ if (_isDev8) {
6157
6256
  const msg = escapeHtml(err instanceof Error ? err.message : String(err));
6158
6257
  return `<!--SSR error: ${safeCommentText(msg)}-->`;
6159
6258
  }
@@ -6199,10 +6298,10 @@ function renderToString(element) {
6199
6298
  }
6200
6299
  const tag = element.tagName.toLowerCase();
6201
6300
  if (tag === "script" || tag === "style") {
6202
- return _isDev7 ? `<!--ssr:${tag}-stripped-->` : "";
6301
+ return _isDev8 ? `<!--ssr:${tag}-stripped-->` : "";
6203
6302
  }
6204
6303
  if (!/^[a-z][a-z0-9-]*$/i.test(tag)) {
6205
- return _isDev7 ? "<!--ssr:invalid-tag-->" : "";
6304
+ return _isDev8 ? "<!--ssr:invalid-tag-->" : "";
6206
6305
  }
6207
6306
  let html2 = `<${tag}`;
6208
6307
  for (const attr of Array.from(element.attributes)) {
@@ -6243,7 +6342,7 @@ function hydrate(component, container, options = {}) {
6243
6342
  const first = mismatches[0];
6244
6343
  if (options.onMismatch) {
6245
6344
  options.onMismatch(first);
6246
- } else if (_isDev7) {
6345
+ } else if (_isDev8) {
6247
6346
  console.warn(
6248
6347
  `[SibuJS hydration] ${first.message}
6249
6348
  at ${first.path}
@@ -6438,11 +6537,11 @@ async function* renderToStream(element) {
6438
6537
  }
6439
6538
  const tag = element.tagName.toLowerCase();
6440
6539
  if (tag === "script" || tag === "style") {
6441
- if (_isDev7) yield `<!--ssr:${tag}-stripped-->`;
6540
+ if (_isDev8) yield `<!--ssr:${tag}-stripped-->`;
6442
6541
  return;
6443
6542
  }
6444
6543
  if (!/^[a-z][a-z0-9-]*$/i.test(tag)) {
6445
- if (_isDev7) yield "<!--ssr:invalid-tag-->";
6544
+ if (_isDev8) yield "<!--ssr:invalid-tag-->";
6446
6545
  return;
6447
6546
  }
6448
6547
  let openTag = `<${tag}`;
@@ -6546,7 +6645,7 @@ function hydrateProgressively(container, islands, options) {
6546
6645
  }
6547
6646
  container.setAttribute("data-sibu-hydrated", "progressive");
6548
6647
  return () => {
6549
- for (const cleanup2 of cleanups) cleanup2();
6648
+ for (const cleanup3 of cleanups) cleanup3();
6550
6649
  };
6551
6650
  }
6552
6651
  function resetSSRState() {
@@ -6575,7 +6674,7 @@ function ssrSuspense(props) {
6575
6674
  },
6576
6675
  (err) => {
6577
6676
  if (timer) clearTimeout(timer);
6578
- if (_isDev7) console.warn("[SibuJS SSR] ssrSuspense rejected:", err);
6677
+ if (_isDev8) console.warn("[SibuJS SSR] ssrSuspense rejected:", err);
6579
6678
  return { id, html: fallbackHtml };
6580
6679
  }
6581
6680
  );
@@ -6621,7 +6720,7 @@ function serializeState(state, nonce, options) {
6621
6720
  }
6622
6721
  function deserializeState(validate) {
6623
6722
  if (typeof window === "undefined") return void 0;
6624
- if (_isDev7 && !validate) {
6723
+ if (_isDev8 && !validate) {
6625
6724
  console.warn(
6626
6725
  "[SibuJS SSR] deserializeState() called without a validate guard \u2014 tampered SSR payloads will not be detected."
6627
6726
  );
@@ -7025,7 +7124,7 @@ function Head(props) {
7025
7124
  const anchor = document.createComment("sibu-head");
7026
7125
  const managedElements = [];
7027
7126
  const effectCleanups = [];
7028
- const cleanup2 = () => {
7127
+ const cleanup3 = () => {
7029
7128
  for (const el of managedElements) {
7030
7129
  if (el.parentNode) el.parentNode.removeChild(el);
7031
7130
  }
@@ -7034,7 +7133,7 @@ function Head(props) {
7034
7133
  effectCleanups.length = 0;
7035
7134
  };
7036
7135
  const apply = () => {
7037
- cleanup2();
7136
+ cleanup3();
7038
7137
  if (props.title) {
7039
7138
  if (typeof props.title === "function") {
7040
7139
  const cleanupFn = effect(() => {
@@ -7588,7 +7687,7 @@ function isWasmCached(key) {
7588
7687
  }
7589
7688
 
7590
7689
  // src/reactivity/bindChildNode.ts
7591
- var _isDev8 = isDev();
7690
+ var _isDev9 = isDev();
7592
7691
  function bindChildNode(placeholder, getter) {
7593
7692
  let lastNodes = [];
7594
7693
  function commit() {
@@ -7596,7 +7695,7 @@ function bindChildNode(placeholder, getter) {
7596
7695
  try {
7597
7696
  result = getter();
7598
7697
  } catch (err) {
7599
- if (_isDev8) devWarn(`bindChildNode: getter threw: ${err instanceof Error ? err.message : String(err)}`);
7698
+ if (_isDev9) devWarn(`bindChildNode: getter threw: ${err instanceof Error ? err.message : String(err)}`);
7600
7699
  return;
7601
7700
  }
7602
7701
  if (result == null || typeof result === "boolean") {
@@ -7622,7 +7721,7 @@ function bindChildNode(placeholder, getter) {
7622
7721
  if (item == null || typeof item === "boolean") continue;
7623
7722
  const node = item instanceof Node ? item : document.createTextNode(String(item));
7624
7723
  if (seen.has(node)) {
7625
- if (_isDev8)
7724
+ if (_isDev9)
7626
7725
  devWarn("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");
7627
7726
  continue;
7628
7727
  }
@@ -7657,12 +7756,12 @@ function bindChildNode(placeholder, getter) {
7657
7756
  }
7658
7757
  lastNodes = newNodes;
7659
7758
  }
7660
- return reactiveBinding(commit);
7759
+ return reactiveBinding2(commit);
7661
7760
  }
7662
7761
 
7663
7762
  // src/core/rendering/tagFactory.ts
7664
7763
  var SVG_NS = "http://www.w3.org/2000/svg";
7665
- var _isDev9 = isDev();
7764
+ var _isDev10 = isDev();
7666
7765
  var BLOCKED_TAGS = /* @__PURE__ */ new Set(["script", "iframe", "object", "embed", "frame", "frameset"]);
7667
7766
  function isBlockedTag(tag) {
7668
7767
  return BLOCKED_TAGS.has(tag.toLowerCase());
@@ -7705,7 +7804,7 @@ function toKebab(prop) {
7705
7804
  }
7706
7805
  function applyStyle(el, style2) {
7707
7806
  if (typeof style2 === "function") {
7708
- const teardown = track(() => {
7807
+ const teardown = track2(() => {
7709
7808
  el.setAttribute("style", style2());
7710
7809
  });
7711
7810
  registerDisposer(el, teardown);
@@ -7721,7 +7820,7 @@ function applyStyle(el, style2) {
7721
7820
  const name = toKebab(prop);
7722
7821
  if (typeof val === "function") {
7723
7822
  const getter = val;
7724
- const teardown = track(() => {
7823
+ const teardown = track2(() => {
7725
7824
  htmlEl.style.setProperty(name, sanitizeCSSValue(String(getter())));
7726
7825
  });
7727
7826
  registerDisposer(el, teardown);
@@ -7736,7 +7835,7 @@ function applyClass(el, cls) {
7736
7835
  return;
7737
7836
  }
7738
7837
  if (typeof cls === "function") {
7739
- const teardown = track(() => {
7838
+ const teardown = track2(() => {
7740
7839
  el.setAttribute("class", cls());
7741
7840
  });
7742
7841
  registerDisposer(el, teardown);
@@ -7763,7 +7862,7 @@ function applyClass(el, cls) {
7763
7862
  }
7764
7863
  el.setAttribute("class", r);
7765
7864
  };
7766
- const teardown = track(update);
7865
+ const teardown = track2(update);
7767
7866
  registerDisposer(el, teardown);
7768
7867
  } else {
7769
7868
  el.setAttribute("class", result);
@@ -7833,7 +7932,7 @@ var tagFactory = (tag, ns) => {
7833
7932
  appendChildren(el, second);
7834
7933
  return el;
7835
7934
  }
7836
- if (_isDev9 && looksLikeClassList(first)) {
7935
+ if (_isDev10 && looksLikeClassList(first)) {
7837
7936
  devWarn(
7838
7937
  `tagFactory: lone string "${first}" looks like a class list but is being rendered as TEXT. For a class, use ${tag}({ class: "${first}" }) \u2014 or ${tag}("${first}", children) to set the class AND add children.`
7839
7938
  );
@@ -7854,7 +7953,7 @@ var tagFactory = (tag, ns) => {
7854
7953
  if (pClass != null) applyClass(el, pClass);
7855
7954
  const pId = props.id;
7856
7955
  if (pId != null) {
7857
- if (_isDev9 && typeof pId === "string" && CLOBBER_RISKY_IDS.has(pId.toLowerCase())) {
7956
+ if (_isDev10 && typeof pId === "string" && CLOBBER_RISKY_IDS.has(pId.toLowerCase())) {
7858
7957
  devWarn(
7859
7958
  `tagFactory: element id="${pId}" matches a common global and may cause DOM clobbering. Avoid setting ids from untrusted input.`
7860
7959
  );
@@ -7869,7 +7968,7 @@ var tagFactory = (tag, ns) => {
7869
7968
  const handler = pOn[ev];
7870
7969
  if (typeof handler === "function") {
7871
7970
  el.addEventListener(ev, handler);
7872
- } else if (_isDev9) {
7971
+ } else if (_isDev10) {
7873
7972
  devWarn(
7874
7973
  `tagFactory: on.${ev} handler is not a function (got ${typeof handler}). Event listener was not attached.`
7875
7974
  );
@@ -7982,7 +8081,7 @@ var area = tagFactory("area");
7982
8081
  var audio = tagFactory("audio");
7983
8082
  var img = tagFactory("img");
7984
8083
  var map = tagFactory("map");
7985
- var track2 = tagFactory("track");
8084
+ var track3 = tagFactory("track");
7986
8085
  var video = tagFactory("video");
7987
8086
  var embed = tagFactory("embed");
7988
8087
  var iframe = tagFactory("iframe");
@@ -9314,18 +9413,18 @@ function clearPerformanceData() {
9314
9413
  perfMarks.clear();
9315
9414
  }
9316
9415
  var trackedCleanups = /* @__PURE__ */ new Map();
9317
- function trackCleanup(component, cleanup2) {
9416
+ function trackCleanup(component, cleanup3) {
9318
9417
  if (!trackedCleanups.has(component)) {
9319
9418
  trackedCleanups.set(component, []);
9320
9419
  }
9321
- trackedCleanups.get(component)?.push(cleanup2);
9420
+ trackedCleanups.get(component)?.push(cleanup3);
9322
9421
  }
9323
9422
  function runCleanups(component) {
9324
9423
  const cleanups = trackedCleanups.get(component);
9325
9424
  if (cleanups) {
9326
- for (const cleanup2 of cleanups) {
9425
+ for (const cleanup3 of cleanups) {
9327
9426
  try {
9328
- cleanup2();
9427
+ cleanup3();
9329
9428
  } catch (err) {
9330
9429
  if (typeof console !== "undefined") {
9331
9430
  console.warn("[SibuJS debug] cleanup threw:", err);
@@ -10332,13 +10431,13 @@ function startMeasure(profiler) {
10332
10431
  function getSignalName(getter) {
10333
10432
  return getter.__name;
10334
10433
  }
10335
- function getSubscriberCount2(getter) {
10434
+ function getSubscriberCount3(getter) {
10336
10435
  const signal2 = getter.__signal;
10337
10436
  if (!signal2) return 0;
10338
- return getSubscriberCount(signal2);
10437
+ return getSubscriberCount2(signal2);
10339
10438
  }
10340
10439
  function getDependencies(subscriberFn) {
10341
- return getSubscriberDeps(subscriberFn);
10440
+ return getSubscriberDeps2(subscriberFn);
10342
10441
  }
10343
10442
  function inspectSignal(getter) {
10344
10443
  const signal2 = getter.__signal;
@@ -10346,7 +10445,7 @@ function inspectSignal(getter) {
10346
10445
  return {
10347
10446
  name: getter.__name,
10348
10447
  signal: signal2,
10349
- subscriberCount: getSubscriberCount(signal2)
10448
+ subscriberCount: getSubscriberCount2(signal2)
10350
10449
  };
10351
10450
  }
10352
10451
  function walkDependencyGraph(getter, maxDepth = 10, visited = /* @__PURE__ */ new WeakSet()) {
@@ -10356,7 +10455,7 @@ function walkDependencyGraph(getter, maxDepth = 10, visited = /* @__PURE__ */ ne
10356
10455
  }
10357
10456
  visited.add(signal2);
10358
10457
  const downstream = [];
10359
- forEachSubscriber(signal2, (sub2) => {
10458
+ forEachSubscriber2(signal2, (sub2) => {
10360
10459
  const subSig = sub2._sig;
10361
10460
  if (subSig && !visited.has(subSig)) {
10362
10461
  const subName = subSig.__name;
@@ -10369,7 +10468,7 @@ function walkDependencyGraph(getter, maxDepth = 10, visited = /* @__PURE__ */ ne
10369
10468
  });
10370
10469
  return {
10371
10470
  name: getSignalName(getter),
10372
- subscribers: getSubscriberCount(signal2),
10471
+ subscribers: getSubscriberCount2(signal2),
10373
10472
  downstream
10374
10473
  };
10375
10474
  }
@@ -10426,15 +10525,15 @@ function watch(getter, callback) {
10426
10525
  if (!Object.is(newValue, oldValue)) {
10427
10526
  const prev = oldValue;
10428
10527
  oldValue = newValue;
10429
- suspendTracking();
10528
+ suspendTracking2();
10430
10529
  try {
10431
10530
  callback(newValue, prev);
10432
10531
  } finally {
10433
- resumeTracking();
10532
+ resumeTracking2();
10434
10533
  }
10435
10534
  }
10436
10535
  };
10437
- const teardown = track(subscriber);
10536
+ const teardown = track2(subscriber);
10438
10537
  return teardown;
10439
10538
  }
10440
10539