@solidjs/signals 0.10.2 → 0.10.4

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.
package/dist/prod.js CHANGED
@@ -103,7 +103,7 @@ function markNode(e, t = REACTIVE_DIRTY) {
103
103
  markNode(t.h, REACTIVE_CHECK);
104
104
  }
105
105
  if (e.A !== null) {
106
- for (let t = e.A; t !== null; t = t.P) {
106
+ for (let t = e.A; t !== null; t = t.C) {
107
107
  for (let e = t.I; e !== null; e = e.p) {
108
108
  markNode(e.h, REACTIVE_CHECK);
109
109
  }
@@ -112,12 +112,12 @@ function markNode(e, t = REACTIVE_DIRTY) {
112
112
  }
113
113
  function runHeap(e, t) {
114
114
  e._ = false;
115
- for (e.C = 0; e.C <= e.O; e.C++) {
116
- let n = e.l[e.C];
115
+ for (e.P = 0; e.P <= e.O; e.P++) {
116
+ let n = e.l[e.P];
117
117
  while (n !== undefined) {
118
118
  if (n.S & REACTIVE_IN_HEAP) t(n);
119
119
  else adjustHeight(n, e);
120
- n = e.l[e.C];
120
+ n = e.l[e.P];
121
121
  }
122
122
  }
123
123
  e.O = 0;
@@ -138,8 +138,8 @@ function adjustHeight(e, t) {
138
138
  }
139
139
  }
140
140
  const transitions = new Set();
141
- const dirtyQueue = { l: new Array(2e3).fill(undefined), _: false, C: 0, O: 0 };
142
- const zombieQueue = { l: new Array(2e3).fill(undefined), _: false, C: 0, O: 0 };
141
+ const dirtyQueue = { l: new Array(2e3).fill(undefined), _: false, P: 0, O: 0 };
142
+ const zombieQueue = { l: new Array(2e3).fill(undefined), _: false, P: 0, O: 0 };
143
143
  let clock = 0;
144
144
  let activeTransition = null;
145
145
  let scheduled = false;
@@ -250,7 +250,7 @@ class GlobalQueue extends Queue {
250
250
  runLaneEffects(EFFECT_USER);
251
251
  this.stashQueues(activeTransition.X);
252
252
  clock++;
253
- scheduled = dirtyQueue.O >= dirtyQueue.C;
253
+ scheduled = dirtyQueue.O >= dirtyQueue.P;
254
254
  reassignPendingTransition(activeTransition.$);
255
255
  activeTransition = null;
256
256
  finalizePureQueue(null, true);
@@ -268,7 +268,7 @@ class GlobalQueue extends Queue {
268
268
  finalizePureQueue();
269
269
  }
270
270
  clock++;
271
- scheduled = dirtyQueue.O >= dirtyQueue.C;
271
+ scheduled = dirtyQueue.O >= dirtyQueue.P;
272
272
  runLaneEffects(EFFECT_RENDER);
273
273
  this.run(EFFECT_RENDER);
274
274
  runLaneEffects(EFFECT_USER);
@@ -359,14 +359,14 @@ function insertSubs(e, t = false) {
359
359
  continue;
360
360
  }
361
361
  const r = i.h.S & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue;
362
- if (r.C > i.h.o) r.C = i.h.o;
362
+ if (r.P > i.h.o) r.P = i.h.o;
363
363
  insertIntoHeap(i.h, r);
364
364
  }
365
365
  }
366
366
  function finalizePureQueue(e = null, t = false) {
367
367
  let n = !t;
368
368
  if (!t) checkBoundaryChildren(globalQueue);
369
- if (dirtyQueue.O >= dirtyQueue.C) runHeap(dirtyQueue, GlobalQueue.K);
369
+ if (dirtyQueue.O >= dirtyQueue.P) runHeap(dirtyQueue, GlobalQueue.K);
370
370
  if (n) {
371
371
  const t = globalQueue.$;
372
372
  for (let e = 0; e < t.length; e++) {
@@ -679,7 +679,7 @@ function notifyStatus(e, t, n, i, r) {
679
679
  notifyStatus(i.h, t, n, c, l);
680
680
  }
681
681
  }
682
- for (let i = e.A; i !== null; i = i.P) {
682
+ for (let i = e.A; i !== null; i = i.C) {
683
683
  for (let e = i.I; e !== null; e = e.p) {
684
684
  e.h.J = clock;
685
685
  if (e.h.q !== n) {
@@ -689,89 +689,67 @@ function notifyStatus(e, t, n, i, r) {
689
689
  }
690
690
  }
691
691
  }
692
- function effect(e, t, n, i, r) {
693
- let o = false;
694
- const s = computed(r?.render ? t => staleValues(() => e(t)) : e, i, {
695
- ...r,
696
- equals: () => {
697
- s.oe = !s.q;
698
- if (o) s.se.enqueue(s.re, runEffect.bind(s));
699
- return false;
700
- },
701
- lazy: true
702
- });
703
- s.he = i;
704
- s.Ae = t;
705
- s.ge = n;
706
- s.Pe = undefined;
707
- s.re = r?.render ? EFFECT_RENDER : EFFECT_USER;
708
- s.pe = (e, t) => {
709
- const n = e !== undefined ? e : s.ae;
710
- const i = t !== undefined ? t : s.q;
711
- if (n & STATUS_ERROR) {
712
- let e = i;
713
- s.se.notify(s, STATUS_PENDING, 0);
714
- if (s.re === EFFECT_USER) {
715
- try {
716
- return s.ge
717
- ? s.ge(e, () => {
718
- s.Pe?.();
719
- s.Pe = undefined;
720
- })
721
- : console.error(e);
722
- } catch (t) {
723
- e = t;
724
- }
725
- }
726
- if (!s.se.notify(s, STATUS_ERROR, STATUS_ERROR)) throw e;
727
- } else if (s.re === EFFECT_RENDER) s.se.notify(s, STATUS_PENDING | STATUS_ERROR, n, i);
728
- };
729
- recompute(s, true);
730
- !r?.defer && (s.re === EFFECT_USER ? s.se.enqueue(s.re, runEffect.bind(s)) : runEffect.call(s));
731
- o = true;
732
- onCleanup(() => s.Pe?.());
692
+ function unlinkSubs(e) {
693
+ const t = e.V;
694
+ const n = e.D;
695
+ const i = e.p;
696
+ const r = e.he;
697
+ if (i !== null) i.he = r;
698
+ else t.Ae = r;
699
+ if (r !== null) r.p = i;
700
+ else {
701
+ t.I = i;
702
+ if (i === null) {
703
+ t.ge?.();
704
+ t.L && !t.Ce && unobserved(t);
705
+ }
706
+ }
707
+ return n;
733
708
  }
734
- function runEffect() {
735
- if (!this.oe || this.S & REACTIVE_DISPOSED) return;
736
- this.Pe?.();
737
- this.Pe = undefined;
738
- try {
739
- this.Pe = this.Ae(this.le, this.he);
740
- } catch (e) {
741
- if (!this.se.notify(this, STATUS_ERROR, STATUS_ERROR)) throw e;
742
- } finally {
743
- this.he = this.le;
744
- this.oe = false;
709
+ function unobserved(e) {
710
+ deleteFromHeap(e, e.S & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
711
+ let t = e.N;
712
+ while (t !== null) {
713
+ t = unlinkSubs(t);
745
714
  }
715
+ e.N = null;
716
+ disposeChildren(e, true);
746
717
  }
747
- function trackedEffect(e, t) {
748
- const run = () => {
749
- if (!n.oe || n.S & REACTIVE_DISPOSED) return;
750
- n.oe = false;
751
- recompute(n);
752
- };
753
- const n = computed(
754
- () => {
755
- try {
756
- n.Pe?.();
757
- n.Pe = undefined;
758
- n.Pe = staleValues(e) || undefined;
759
- } finally {
760
- }
761
- },
762
- undefined,
763
- { ...t, lazy: true, pureWrite: true }
764
- );
765
- n.Pe = undefined;
766
- n.oe = true;
767
- n.re = EFFECT_TRACKED;
768
- n.ue = run;
769
- n.se.enqueue(EFFECT_USER, run);
770
- onCleanup(() => n.Pe?.());
718
+ function link(e, t) {
719
+ const n = t.Pe;
720
+ if (n !== null && n.V === e) return;
721
+ let i = null;
722
+ const r = t.S & REACTIVE_RECOMPUTING_DEPS;
723
+ if (r) {
724
+ i = n !== null ? n.D : t.N;
725
+ if (i !== null && i.V === e) {
726
+ t.Pe = i;
727
+ return;
728
+ }
729
+ }
730
+ const o = e.Ae;
731
+ if (o !== null && o.h === t && (!r || isValidLink(o, t))) return;
732
+ const s = (t.Pe = e.Ae = { V: e, h: t, D: i, he: o, p: null });
733
+ if (n !== null) n.D = s;
734
+ else t.N = s;
735
+ if (o !== null) o.p = s;
736
+ else e.I = s;
737
+ }
738
+ function isValidLink(e, t) {
739
+ const n = t.Pe;
740
+ if (n !== null) {
741
+ let i = t.N;
742
+ do {
743
+ if (i === e) return true;
744
+ if (i === n) break;
745
+ i = i.D;
746
+ } while (i !== null);
747
+ }
748
+ return false;
771
749
  }
772
750
  const PENDING_OWNER = {};
773
751
  function markDisposal(e) {
774
- let t = e.Ce;
752
+ let t = e.Ne;
775
753
  while (t) {
776
754
  t.S |= REACTIVE_ZOMBIE;
777
755
  if (t.S & REACTIVE_IN_HEAP) {
@@ -779,7 +757,7 @@ function markDisposal(e) {
779
757
  insertIntoHeap(t, zombieQueue);
780
758
  }
781
759
  markDisposal(t);
782
- t = t.Ne;
760
+ t = t.ye;
783
761
  }
784
762
  }
785
763
  function dispose(e) {
@@ -788,15 +766,15 @@ function dispose(e) {
788
766
  t = unlinkSubs(t);
789
767
  } while (t !== null);
790
768
  e.N = null;
791
- e.ye = null;
769
+ e.Pe = null;
792
770
  disposeChildren(e, true);
793
771
  }
794
772
  function disposeChildren(e, t = false, n) {
795
773
  if (e.S & REACTIVE_DISPOSED) return;
796
774
  if (t) e.S = REACTIVE_DISPOSED;
797
- let i = n ? e.De : e.Ce;
775
+ let i = n ? e.De : e.Ne;
798
776
  while (i) {
799
- const e = i.Ne;
777
+ const e = i.ye;
800
778
  if (i.N) {
801
779
  const e = i;
802
780
  deleteFromHeap(e, e.S & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
@@ -805,7 +783,7 @@ function disposeChildren(e, t = false, n) {
805
783
  t = unlinkSubs(t);
806
784
  } while (t !== null);
807
785
  e.N = null;
808
- e.ye = null;
786
+ e.Pe = null;
809
787
  }
810
788
  disposeChildren(i, true);
811
789
  i = e;
@@ -813,8 +791,8 @@ function disposeChildren(e, t = false, n) {
813
791
  if (n) {
814
792
  e.De = null;
815
793
  } else {
816
- e.Ce = null;
817
794
  e.Ne = null;
795
+ e.ye = null;
818
796
  e.ve = 0;
819
797
  }
820
798
  runDisposal(e, n);
@@ -832,10 +810,18 @@ function runDisposal(e, t) {
832
810
  }
833
811
  t ? (e.we = null) : (e.be = null);
834
812
  }
835
- function getNextChildId(e) {
836
- if (e.id != null) return formatId(e.id, e.ve++);
813
+ function childId(e, t) {
814
+ let n = e;
815
+ while (n.Ve && n.i) n = n.i;
816
+ if (n.id != null) return formatId(n.id, t ? n.ve++ : n.ve);
837
817
  throw new Error("Cannot get child id from owner without an id");
838
818
  }
819
+ function getNextChildId(e) {
820
+ return childId(e, true);
821
+ }
822
+ function peekNextChildId(e) {
823
+ return childId(e, false);
824
+ }
839
825
  function formatId(e, t) {
840
826
  const n = t.toString(36),
841
827
  i = n.length - 1;
@@ -857,95 +843,119 @@ function onCleanup(e) {
857
843
  }
858
844
  function createOwner(e) {
859
845
  const t = context;
860
- const n = {
861
- id: e?.id ?? (t?.id != null ? getNextChildId(t) : undefined),
846
+ const n = e?.transparent ?? false;
847
+ const i = {
848
+ id: e?.id ?? (n ? t?.id : t?.id != null ? getNextChildId(t) : undefined),
849
+ Ve: n || undefined,
862
850
  t: true,
863
851
  u: t?.t ? t.u : t,
864
- Ce: null,
865
852
  Ne: null,
853
+ ye: null,
866
854
  be: null,
867
855
  se: t?.se ?? globalQueue,
868
- Ve: t?.Ve || defaultContext,
856
+ me: t?.me || defaultContext,
869
857
  ve: 0,
870
858
  we: null,
871
859
  De: null,
872
860
  i: t,
873
861
  dispose(e = true) {
874
- disposeChildren(n, e);
862
+ disposeChildren(i, e);
875
863
  }
876
864
  };
877
865
  if (t) {
878
- const e = t.Ce;
866
+ const e = t.Ne;
879
867
  if (e === null) {
880
- t.Ce = n;
868
+ t.Ne = i;
881
869
  } else {
882
- n.Ne = e;
883
- t.Ce = n;
870
+ i.ye = e;
871
+ t.Ne = i;
884
872
  }
885
873
  }
886
- return n;
874
+ return i;
887
875
  }
888
876
  function createRoot(e, t) {
889
877
  const n = createOwner(t);
890
878
  return runWithOwner(n, () => e(n.dispose));
891
879
  }
892
- function unlinkSubs(e) {
893
- const t = e.V;
894
- const n = e.D;
895
- const i = e.p;
896
- const r = e.me;
897
- if (i !== null) i.me = r;
898
- else t.Le = r;
899
- if (r !== null) r.p = i;
900
- else {
901
- t.I = i;
902
- if (i === null) {
903
- t.ke?.();
904
- t.L && !t.Ue && unobserved(t);
905
- }
906
- }
907
- return n;
908
- }
909
- function unobserved(e) {
910
- deleteFromHeap(e, e.S & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
911
- let t = e.N;
912
- while (t !== null) {
913
- t = unlinkSubs(t);
914
- }
915
- e.N = null;
916
- disposeChildren(e, true);
880
+ function effect(e, t, n, i, r) {
881
+ let o = false;
882
+ const s = computed(r?.render ? t => staleValues(() => e(t)) : e, i, {
883
+ ...r,
884
+ equals: () => {
885
+ s.oe = !s.q;
886
+ if (o) s.se.enqueue(s.re, runEffect.bind(s));
887
+ return false;
888
+ },
889
+ lazy: true
890
+ });
891
+ s.Le = i;
892
+ s.ke = t;
893
+ s.Ue = n;
894
+ s.We = undefined;
895
+ s.re = r?.render ? EFFECT_RENDER : EFFECT_USER;
896
+ s.pe = (e, t) => {
897
+ const n = e !== undefined ? e : s.ae;
898
+ const i = t !== undefined ? t : s.q;
899
+ if (n & STATUS_ERROR) {
900
+ let e = i;
901
+ s.se.notify(s, STATUS_PENDING, 0);
902
+ if (s.re === EFFECT_USER) {
903
+ try {
904
+ return s.Ue
905
+ ? s.Ue(e, () => {
906
+ s.We?.();
907
+ s.We = undefined;
908
+ })
909
+ : console.error(e);
910
+ } catch (t) {
911
+ e = t;
912
+ }
913
+ }
914
+ if (!s.se.notify(s, STATUS_ERROR, STATUS_ERROR)) throw e;
915
+ } else if (s.re === EFFECT_RENDER) s.se.notify(s, STATUS_PENDING | STATUS_ERROR, n, i);
916
+ };
917
+ recompute(s, true);
918
+ !r?.defer && (s.re === EFFECT_USER ? s.se.enqueue(s.re, runEffect.bind(s)) : runEffect.call(s));
919
+ o = true;
920
+ onCleanup(() => s.We?.());
917
921
  }
918
- function link(e, t) {
919
- const n = t.ye;
920
- if (n !== null && n.V === e) return;
921
- let i = null;
922
- const r = t.S & REACTIVE_RECOMPUTING_DEPS;
923
- if (r) {
924
- i = n !== null ? n.D : t.N;
925
- if (i !== null && i.V === e) {
926
- t.ye = i;
927
- return;
928
- }
922
+ function runEffect() {
923
+ if (!this.oe || this.S & REACTIVE_DISPOSED) return;
924
+ this.We?.();
925
+ this.We = undefined;
926
+ try {
927
+ this.We = this.ke(this.le, this.Le);
928
+ } catch (e) {
929
+ if (!this.se.notify(this, STATUS_ERROR, STATUS_ERROR)) throw e;
930
+ } finally {
931
+ this.Le = this.le;
932
+ this.oe = false;
929
933
  }
930
- const o = e.Le;
931
- if (o !== null && o.h === t && (!r || isValidLink(o, t))) return;
932
- const s = (t.ye = e.Le = { V: e, h: t, D: i, me: o, p: null });
933
- if (n !== null) n.D = s;
934
- else t.N = s;
935
- if (o !== null) o.p = s;
936
- else e.I = s;
937
934
  }
938
- function isValidLink(e, t) {
939
- const n = t.ye;
940
- if (n !== null) {
941
- let i = t.N;
942
- do {
943
- if (i === e) return true;
944
- if (i === n) break;
945
- i = i.D;
946
- } while (i !== null);
947
- }
948
- return false;
935
+ function trackedEffect(e, t) {
936
+ const run = () => {
937
+ if (!n.oe || n.S & REACTIVE_DISPOSED) return;
938
+ n.oe = false;
939
+ recompute(n);
940
+ };
941
+ const n = computed(
942
+ () => {
943
+ try {
944
+ n.We?.();
945
+ n.We = undefined;
946
+ n.We = staleValues(e) || undefined;
947
+ } finally {
948
+ }
949
+ },
950
+ undefined,
951
+ { ...t, lazy: true, pureWrite: true }
952
+ );
953
+ n.We = undefined;
954
+ n.oe = true;
955
+ n.re = EFFECT_TRACKED;
956
+ n.ue = run;
957
+ n.se.enqueue(EFFECT_USER, run);
958
+ onCleanup(() => n.We?.());
949
959
  }
950
960
  GlobalQueue.K = recompute;
951
961
  GlobalQueue.Y = disposeChildren;
@@ -967,9 +977,9 @@ function recompute(e, t = false) {
967
977
  else {
968
978
  markDisposal(e);
969
979
  e.we = e.be;
970
- e.De = e.Ce;
980
+ e.De = e.Ne;
971
981
  e.be = null;
972
- e.Ce = null;
982
+ e.Ne = null;
973
983
  e.ve = 0;
974
984
  }
975
985
  }
@@ -978,7 +988,7 @@ function recompute(e, t = false) {
978
988
  const o = !!(e.ae & STATUS_PENDING);
979
989
  const s = context;
980
990
  context = e;
981
- e.ye = null;
991
+ e.Pe = null;
982
992
  e.S = REACTIVE_RECOMPUTING_DEPS;
983
993
  e.J = clock;
984
994
  let u = e.ce === NOT_PENDING ? e.le : e.ce;
@@ -1020,7 +1030,7 @@ function recompute(e, t = false) {
1020
1030
  context = s;
1021
1031
  }
1022
1032
  if (!e.q) {
1023
- const s = e.ye;
1033
+ const s = e.Pe;
1024
1034
  let l = s !== null ? s.D : e.N;
1025
1035
  if (l !== null) {
1026
1036
  do {
@@ -1074,14 +1084,16 @@ function updateIfNecessary(e) {
1074
1084
  e.S = REACTIVE_NONE;
1075
1085
  }
1076
1086
  function computed(e, t, n) {
1077
- const i = {
1078
- id: n?.id ?? (context?.id != null ? getNextChildId(context) : undefined),
1087
+ const i = n?.transparent ?? false;
1088
+ const r = {
1089
+ id: n?.id ?? (i ? context?.id : context?.id != null ? getNextChildId(context) : undefined),
1090
+ Ve: i || undefined,
1079
1091
  _e: n?.equals != null ? n.equals : isEqual,
1080
- We: !!n?.pureWrite,
1081
- ke: n?.unobserved,
1092
+ xe: !!n?.pureWrite,
1093
+ ge: n?.unobserved,
1082
1094
  be: null,
1083
1095
  se: context?.se ?? globalQueue,
1084
- Ve: context?.Ve ?? defaultContext,
1096
+ me: context?.me ?? defaultContext,
1085
1097
  ve: 0,
1086
1098
  L: e,
1087
1099
  le: t,
@@ -1090,12 +1102,12 @@ function computed(e, t, n) {
1090
1102
  R: undefined,
1091
1103
  T: null,
1092
1104
  N: null,
1093
- ye: null,
1105
+ Pe: null,
1094
1106
  I: null,
1095
- Le: null,
1107
+ Ae: null,
1096
1108
  i: context,
1109
+ ye: null,
1097
1110
  Ne: null,
1098
- Ce: null,
1099
1111
  S: REACTIVE_NONE,
1100
1112
  ae: STATUS_UNINITIALIZED,
1101
1113
  J: clock,
@@ -1105,32 +1117,32 @@ function computed(e, t, n) {
1105
1117
  Se: null,
1106
1118
  ne: null
1107
1119
  };
1108
- i.T = i;
1109
- const r = context?.t ? context.u : context;
1120
+ r.T = r;
1121
+ const o = context?.t ? context.u : context;
1110
1122
  if (context) {
1111
- const e = context.Ce;
1123
+ const e = context.Ne;
1112
1124
  if (e === null) {
1113
- context.Ce = i;
1125
+ context.Ne = r;
1114
1126
  } else {
1115
- i.Ne = e;
1116
- context.Ce = i;
1127
+ r.ye = e;
1128
+ context.Ne = r;
1117
1129
  }
1118
1130
  }
1119
- if (r) i.o = r.o + 1;
1120
- !n?.lazy && recompute(i, true);
1121
- return i;
1131
+ if (o) r.o = o.o + 1;
1132
+ !n?.lazy && recompute(r, true);
1133
+ return r;
1122
1134
  }
1123
1135
  function signal(e, t, n = null) {
1124
1136
  const i = {
1125
1137
  _e: t?.equals != null ? t.equals : isEqual,
1126
- We: !!t?.pureWrite,
1127
- ke: t?.unobserved,
1138
+ xe: !!t?.pureWrite,
1139
+ ge: t?.unobserved,
1128
1140
  le: e,
1129
1141
  I: null,
1130
- Le: null,
1142
+ Ae: null,
1131
1143
  J: clock,
1132
1144
  m: n,
1133
- P: n?.A || null,
1145
+ C: n?.A || null,
1134
1146
  ce: NOT_PENDING
1135
1147
  };
1136
1148
  n && (n.A = i);
@@ -1195,7 +1207,7 @@ function read(e) {
1195
1207
  const n = e.m || e;
1196
1208
  if (n.L) {
1197
1209
  const i = e.S & REACTIVE_ZOMBIE;
1198
- if (n.o >= (i ? zombieQueue.C : dirtyQueue.C)) {
1210
+ if (n.o >= (i ? zombieQueue.P : dirtyQueue.P)) {
1199
1211
  markNode(t);
1200
1212
  markHeap(i ? zombieQueue : dirtyQueue);
1201
1213
  updateIfNecessary(n);
@@ -1402,7 +1414,7 @@ function getContext(e, t = getOwner()) {
1402
1414
  if (!t) {
1403
1415
  throw new NoOwnerError();
1404
1416
  }
1405
- const n = hasContext(e, t) ? t.Ve[e.id] : e.defaultValue;
1417
+ const n = hasContext(e, t) ? t.me[e.id] : e.defaultValue;
1406
1418
  if (isUndefined(n)) {
1407
1419
  throw new ContextNotFoundError();
1408
1420
  }
@@ -1412,10 +1424,10 @@ function setContext(e, t, n = getOwner()) {
1412
1424
  if (!n) {
1413
1425
  throw new NoOwnerError();
1414
1426
  }
1415
- n.Ve = { ...n.Ve, [e.id]: isUndefined(t) ? e.defaultValue : t };
1427
+ n.me = { ...n.me, [e.id]: isUndefined(t) ? e.defaultValue : t };
1416
1428
  }
1417
1429
  function hasContext(e, t) {
1418
- return !isUndefined(t?.Ve[e.id]);
1430
+ return !isUndefined(t?.me[e.id]);
1419
1431
  }
1420
1432
  function isUndefined(e) {
1421
1433
  return typeof e === "undefined";
@@ -1699,7 +1711,7 @@ function createProjectionInternal(e, t = {}, n) {
1699
1711
  r !== i && r !== undefined && reconcile(r, n?.key || "id", n?.all)(o);
1700
1712
  });
1701
1713
  });
1702
- i.Ue = true;
1714
+ i.Ce = true;
1703
1715
  return { store: o, node: i };
1704
1716
  }
1705
1717
  function createProjection(e, t = {}, n) {
@@ -2167,7 +2179,7 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
2167
2179
  setProjectionWriteActive(false);
2168
2180
  }
2169
2181
  });
2170
- i.Ue = true;
2182
+ i.Ce = true;
2171
2183
  }
2172
2184
  return { store: o, node: i };
2173
2185
  }
@@ -2351,68 +2363,68 @@ function mapArray(e, t, n) {
2351
2363
  const i = typeof n?.keyed === "function" ? n.keyed : undefined;
2352
2364
  return createMemo(
2353
2365
  updateKeyedMap.bind({
2354
- xe: createOwner(),
2355
- Me: 0,
2356
- Fe: e,
2357
- Ge: [],
2358
- $e: t,
2359
- He: [],
2366
+ Me: createOwner(),
2367
+ Fe: 0,
2368
+ Ge: e,
2369
+ $e: [],
2370
+ He: t,
2360
2371
  je: [],
2361
- Ke: i,
2362
- Ye: i || n?.keyed === false ? [] : undefined,
2363
- Be: t.length > 1 ? [] : undefined,
2364
- Xe: n?.fallback
2372
+ Ke: [],
2373
+ Ye: i,
2374
+ Be: i || n?.keyed === false ? [] : undefined,
2375
+ Xe: t.length > 1 ? [] : undefined,
2376
+ qe: n?.fallback
2365
2377
  })
2366
2378
  );
2367
2379
  }
2368
2380
  const pureOptions = { pureWrite: true };
2369
2381
  function updateKeyedMap() {
2370
- const e = this.Fe() || [],
2382
+ const e = this.Ge() || [],
2371
2383
  t = e.length;
2372
2384
  e[$TRACK];
2373
- runWithOwner(this.xe, () => {
2385
+ runWithOwner(this.Me, () => {
2374
2386
  let n,
2375
2387
  i,
2376
- r = this.Ye
2388
+ r = this.Be
2377
2389
  ? () => {
2378
- this.Ye[i] = signal(e[i], pureOptions);
2379
- this.Be && (this.Be[i] = signal(i, pureOptions));
2380
- return this.$e(
2381
- read.bind(null, this.Ye[i]),
2382
- this.Be ? read.bind(null, this.Be[i]) : undefined
2390
+ this.Be[i] = signal(e[i], pureOptions);
2391
+ this.Xe && (this.Xe[i] = signal(i, pureOptions));
2392
+ return this.He(
2393
+ read.bind(null, this.Be[i]),
2394
+ this.Xe ? read.bind(null, this.Xe[i]) : undefined
2383
2395
  );
2384
2396
  }
2385
- : this.Be
2397
+ : this.Xe
2386
2398
  ? () => {
2387
2399
  const t = e[i];
2388
- this.Be[i] = signal(i, pureOptions);
2389
- return this.$e(() => t, read.bind(null, this.Be[i]));
2400
+ this.Xe[i] = signal(i, pureOptions);
2401
+ return this.He(() => t, read.bind(null, this.Xe[i]));
2390
2402
  }
2391
2403
  : () => {
2392
2404
  const t = e[i];
2393
- return this.$e(() => t);
2405
+ return this.He(() => t);
2394
2406
  };
2395
2407
  if (t === 0) {
2396
- if (this.Me !== 0) {
2397
- this.xe.dispose(false);
2408
+ if (this.Fe !== 0) {
2409
+ this.Me.dispose(false);
2410
+ this.Ke = [];
2411
+ this.$e = [];
2398
2412
  this.je = [];
2399
- this.Ge = [];
2400
- this.He = [];
2401
- this.Me = 0;
2402
- this.Ye && (this.Ye = []);
2413
+ this.Fe = 0;
2403
2414
  this.Be && (this.Be = []);
2415
+ this.Xe && (this.Xe = []);
2404
2416
  }
2405
- if (this.Xe && !this.He[0]) {
2406
- this.He[0] = runWithOwner((this.je[0] = createOwner()), this.Xe);
2417
+ if (this.qe && !this.je[0]) {
2418
+ this.je[0] = runWithOwner((this.Ke[0] = createOwner()), this.qe);
2407
2419
  }
2408
- } else if (this.Me === 0) {
2409
- if (this.je[0]) this.je[0].dispose();
2410
- this.He = new Array(t);
2420
+ } else if (this.Fe === 0) {
2421
+ if (this.Ke[0]) this.Ke[0].dispose();
2422
+ this.je = new Array(t);
2411
2423
  for (i = 0; i < t; i++) {
2412
- this.Ge[i] = e[i];
2413
- this.He[i] = runWithOwner((this.je[i] = createOwner()), r);
2424
+ this.$e[i] = e[i];
2425
+ this.je[i] = runWithOwner((this.Ke[i] = createOwner()), r);
2414
2426
  }
2415
- this.Me = t;
2427
+ this.Fe = t;
2416
2428
  } else {
2417
2429
  let o,
2418
2430
  s,
@@ -2423,130 +2435,130 @@ function updateKeyedMap() {
2423
2435
  f,
2424
2436
  E = new Array(t),
2425
2437
  T = new Array(t),
2426
- d = this.Ye ? new Array(t) : undefined,
2427
- R = this.Be ? new Array(t) : undefined;
2438
+ d = this.Be ? new Array(t) : undefined,
2439
+ R = this.Xe ? new Array(t) : undefined;
2428
2440
  for (
2429
- o = 0, s = Math.min(this.Me, t);
2430
- o < s && (this.Ge[o] === e[o] || (this.Ye && compare(this.Ke, this.Ge[o], e[o])));
2441
+ o = 0, s = Math.min(this.Fe, t);
2442
+ o < s && (this.$e[o] === e[o] || (this.Be && compare(this.Ye, this.$e[o], e[o])));
2431
2443
  o++
2432
2444
  ) {
2433
- if (this.Ye) setSignal(this.Ye[o], e[o]);
2445
+ if (this.Be) setSignal(this.Be[o], e[o]);
2434
2446
  }
2435
2447
  for (
2436
- s = this.Me - 1, u = t - 1;
2448
+ s = this.Fe - 1, u = t - 1;
2437
2449
  s >= o &&
2438
2450
  u >= o &&
2439
- (this.Ge[s] === e[u] || (this.Ye && compare(this.Ke, this.Ge[s], e[u])));
2451
+ (this.$e[s] === e[u] || (this.Be && compare(this.Ye, this.$e[s], e[u])));
2440
2452
  s--, u--
2441
2453
  ) {
2442
- E[u] = this.He[s];
2443
- T[u] = this.je[s];
2444
- d && (d[u] = this.Ye[s]);
2445
- R && (R[u] = this.Be[s]);
2454
+ E[u] = this.je[s];
2455
+ T[u] = this.Ke[s];
2456
+ d && (d[u] = this.Be[s]);
2457
+ R && (R[u] = this.Xe[s]);
2446
2458
  }
2447
2459
  a = new Map();
2448
2460
  f = new Array(u + 1);
2449
2461
  for (i = u; i >= o; i--) {
2450
2462
  c = e[i];
2451
- l = this.Ke ? this.Ke(c) : c;
2463
+ l = this.Ye ? this.Ye(c) : c;
2452
2464
  n = a.get(l);
2453
2465
  f[i] = n === undefined ? -1 : n;
2454
2466
  a.set(l, i);
2455
2467
  }
2456
2468
  for (n = o; n <= s; n++) {
2457
- c = this.Ge[n];
2458
- l = this.Ke ? this.Ke(c) : c;
2469
+ c = this.$e[n];
2470
+ l = this.Ye ? this.Ye(c) : c;
2459
2471
  i = a.get(l);
2460
2472
  if (i !== undefined && i !== -1) {
2461
- E[i] = this.He[n];
2462
- T[i] = this.je[n];
2463
- d && (d[i] = this.Ye[n]);
2464
- R && (R[i] = this.Be[n]);
2473
+ E[i] = this.je[n];
2474
+ T[i] = this.Ke[n];
2475
+ d && (d[i] = this.Be[n]);
2476
+ R && (R[i] = this.Xe[n]);
2465
2477
  i = f[i];
2466
2478
  a.set(l, i);
2467
- } else this.je[n].dispose();
2479
+ } else this.Ke[n].dispose();
2468
2480
  }
2469
2481
  for (i = o; i < t; i++) {
2470
2482
  if (i in E) {
2471
- this.He[i] = E[i];
2472
- this.je[i] = T[i];
2483
+ this.je[i] = E[i];
2484
+ this.Ke[i] = T[i];
2473
2485
  if (d) {
2474
- this.Ye[i] = d[i];
2475
- setSignal(this.Ye[i], e[i]);
2486
+ this.Be[i] = d[i];
2487
+ setSignal(this.Be[i], e[i]);
2476
2488
  }
2477
2489
  if (R) {
2478
- this.Be[i] = R[i];
2479
- setSignal(this.Be[i], i);
2490
+ this.Xe[i] = R[i];
2491
+ setSignal(this.Xe[i], i);
2480
2492
  }
2481
2493
  } else {
2482
- this.He[i] = runWithOwner((this.je[i] = createOwner()), r);
2494
+ this.je[i] = runWithOwner((this.Ke[i] = createOwner()), r);
2483
2495
  }
2484
2496
  }
2485
- this.He = this.He.slice(0, (this.Me = t));
2486
- this.Ge = e.slice(0);
2497
+ this.je = this.je.slice(0, (this.Fe = t));
2498
+ this.$e = e.slice(0);
2487
2499
  }
2488
2500
  });
2489
- return this.He;
2501
+ return this.je;
2490
2502
  }
2491
2503
  function repeat(e, t, n) {
2492
2504
  return updateRepeat.bind({
2493
- xe: createOwner(),
2494
- Me: 0,
2495
- qe: 0,
2496
- ze: e,
2497
- $e: t,
2505
+ Me: createOwner(),
2506
+ Fe: 0,
2507
+ ze: 0,
2508
+ Ze: e,
2509
+ He: t,
2510
+ Ke: [],
2498
2511
  je: [],
2499
- He: [],
2500
- Ze: n?.from,
2501
- Xe: n?.fallback
2512
+ Je: n?.from,
2513
+ qe: n?.fallback
2502
2514
  });
2503
2515
  }
2504
2516
  function updateRepeat() {
2505
- const e = this.ze();
2506
- const t = this.Ze?.() || 0;
2507
- runWithOwner(this.xe, () => {
2517
+ const e = this.Ze();
2518
+ const t = this.Je?.() || 0;
2519
+ runWithOwner(this.Me, () => {
2508
2520
  if (e === 0) {
2509
- if (this.Me !== 0) {
2510
- this.xe.dispose(false);
2521
+ if (this.Fe !== 0) {
2522
+ this.Me.dispose(false);
2523
+ this.Ke = [];
2511
2524
  this.je = [];
2512
- this.He = [];
2513
- this.Me = 0;
2525
+ this.Fe = 0;
2514
2526
  }
2515
- if (this.Xe && !this.He[0]) {
2516
- this.He[0] = runWithOwner((this.je[0] = createOwner()), this.Xe);
2527
+ if (this.qe && !this.je[0]) {
2528
+ this.je[0] = runWithOwner((this.Ke[0] = createOwner()), this.qe);
2517
2529
  }
2518
2530
  return;
2519
2531
  }
2520
2532
  const n = t + e;
2521
- const i = this.qe + this.Me;
2522
- if (this.Me === 0 && this.je[0]) this.je[0].dispose();
2523
- for (let e = n; e < i; e++) this.je[e - this.qe].dispose();
2524
- if (this.qe < t) {
2525
- let e = this.qe;
2526
- while (e < t && e < this.Me) this.je[e++].dispose();
2527
- this.je.splice(0, t - this.qe);
2528
- this.He.splice(0, t - this.qe);
2529
- } else if (this.qe > t) {
2530
- let n = i - this.qe - 1;
2531
- let r = this.qe - t;
2532
- this.je.length = this.He.length = e;
2533
+ const i = this.ze + this.Fe;
2534
+ if (this.Fe === 0 && this.Ke[0]) this.Ke[0].dispose();
2535
+ for (let e = n; e < i; e++) this.Ke[e - this.ze].dispose();
2536
+ if (this.ze < t) {
2537
+ let e = this.ze;
2538
+ while (e < t && e < this.Fe) this.Ke[e++].dispose();
2539
+ this.Ke.splice(0, t - this.ze);
2540
+ this.je.splice(0, t - this.ze);
2541
+ } else if (this.ze > t) {
2542
+ let n = i - this.ze - 1;
2543
+ let r = this.ze - t;
2544
+ this.Ke.length = this.je.length = e;
2533
2545
  while (n >= r) {
2546
+ this.Ke[n] = this.Ke[n - r];
2534
2547
  this.je[n] = this.je[n - r];
2535
- this.He[n] = this.He[n - r];
2536
2548
  n--;
2537
2549
  }
2538
2550
  for (let e = 0; e < r; e++) {
2539
- this.He[e] = runWithOwner((this.je[e] = createOwner()), () => this.$e(e + t));
2551
+ this.je[e] = runWithOwner((this.Ke[e] = createOwner()), () => this.He(e + t));
2540
2552
  }
2541
2553
  }
2542
2554
  for (let e = i; e < n; e++) {
2543
- this.He[e - t] = runWithOwner((this.je[e - t] = createOwner()), () => this.$e(e));
2555
+ this.je[e - t] = runWithOwner((this.Ke[e - t] = createOwner()), () => this.He(e));
2544
2556
  }
2545
- this.He = this.He.slice(0, e);
2546
- this.qe = t;
2547
- this.Me = e;
2557
+ this.je = this.je.slice(0, e);
2558
+ this.ze = t;
2559
+ this.Fe = e;
2548
2560
  });
2549
- return this.He;
2561
+ return this.je;
2550
2562
  }
2551
2563
  function compare(e, t, n) {
2552
2564
  return e ? e(t) === e(n) : true;
@@ -2556,11 +2568,11 @@ function boundaryComputed(e, t) {
2556
2568
  n.pe = (e, t) => {
2557
2569
  const i = e !== undefined ? e : n.ae;
2558
2570
  const r = t !== undefined ? t : n.q;
2559
- n.ae &= ~n.Je;
2560
- n.se.notify(n, n.Je, i, r);
2571
+ n.ae &= ~n.et;
2572
+ n.se.notify(n, n.et, i, r);
2561
2573
  };
2562
- n.Je = t;
2563
- n.Ue = true;
2574
+ n.et = t;
2575
+ n.Ce = true;
2564
2576
  recompute(n, true);
2565
2577
  return n;
2566
2578
  }
@@ -2574,36 +2586,36 @@ function createBoundChildren(e, t, n, i) {
2574
2586
  });
2575
2587
  }
2576
2588
  class CollectionQueue extends Queue {
2577
- et;
2578
- tt = new Set();
2579
- nt = signal(false, { pureWrite: true });
2580
- it = false;
2589
+ tt;
2590
+ nt = new Set();
2591
+ it = signal(false, { pureWrite: true });
2592
+ rt = false;
2581
2593
  constructor(e) {
2582
2594
  super();
2583
- this.et = e;
2595
+ this.tt = e;
2584
2596
  }
2585
2597
  run(e) {
2586
- if (!e || read(this.nt)) return;
2598
+ if (!e || read(this.it)) return;
2587
2599
  return super.run(e);
2588
2600
  }
2589
2601
  notify(e, t, n, i) {
2590
- if (!(t & this.et) || (this.et & STATUS_PENDING && this.it)) return super.notify(e, t, n, i);
2591
- if (n & this.et) {
2602
+ if (!(t & this.tt) || (this.tt & STATUS_PENDING && this.rt)) return super.notify(e, t, n, i);
2603
+ if (n & this.tt) {
2592
2604
  const t = i?.source || e.q?.source;
2593
2605
  if (t) {
2594
- const e = this.tt.size === 0;
2595
- this.tt.add(t);
2596
- if (e) setSignal(this.nt, true);
2606
+ const e = this.nt.size === 0;
2607
+ this.nt.add(t);
2608
+ if (e) setSignal(this.it, true);
2597
2609
  }
2598
2610
  }
2599
- t &= ~this.et;
2611
+ t &= ~this.tt;
2600
2612
  return t ? super.notify(e, t, n, i) : true;
2601
2613
  }
2602
2614
  checkSources() {
2603
- for (const e of this.tt) {
2604
- if (!(e.ae & this.et)) this.tt.delete(e);
2615
+ for (const e of this.nt) {
2616
+ if (!(e.ae & this.tt)) this.nt.delete(e);
2605
2617
  }
2606
- if (!this.tt.size) setSignal(this.nt, false);
2618
+ if (!this.nt.size) setSignal(this.it, false);
2607
2619
  }
2608
2620
  }
2609
2621
  function createCollectionBoundary(e, t, n) {
@@ -2611,10 +2623,10 @@ function createCollectionBoundary(e, t, n) {
2611
2623
  const r = new CollectionQueue(e);
2612
2624
  const o = createBoundChildren(i, t, r, e);
2613
2625
  const s = computed(() => {
2614
- if (!read(r.nt)) {
2626
+ if (!read(r.it)) {
2615
2627
  const e = read(o);
2616
- if (!untrack(() => read(r.nt))) {
2617
- r.it = true;
2628
+ if (!untrack(() => read(r.it))) {
2629
+ r.rt = true;
2618
2630
  return e;
2619
2631
  }
2620
2632
  }
@@ -2627,10 +2639,10 @@ function createLoadBoundary(e, t) {
2627
2639
  }
2628
2640
  function createErrorBoundary(e, t) {
2629
2641
  return createCollectionBoundary(STATUS_ERROR, e, e => {
2630
- let n = e.tt.values().next().value;
2642
+ let n = e.nt.values().next().value;
2631
2643
  const i = n.q?.cause ?? n.q;
2632
2644
  return t(i, () => {
2633
- for (const t of e.tt) recompute(t);
2645
+ for (const t of e.nt) recompute(t);
2634
2646
  schedule();
2635
2647
  });
2636
2648
  });
@@ -2724,6 +2736,7 @@ export {
2724
2736
  omit,
2725
2737
  onCleanup,
2726
2738
  onSettled,
2739
+ peekNextChildId,
2727
2740
  pending,
2728
2741
  reconcile,
2729
2742
  refresh,