@solidjs/signals 0.13.12 → 2.0.0-beta.7

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 (39) hide show
  1. package/README.md +8 -7
  2. package/dist/dev.js +188 -102
  3. package/dist/node.cjs +501 -446
  4. package/dist/prod.js +368 -305
  5. package/dist/types/core/graph.d.ts +1 -0
  6. package/dist/types/core/types.d.ts +2 -2
  7. package/dist/types/signals.d.ts +15 -21
  8. package/dist/types/store/optimistic.d.ts +2 -2
  9. package/dist/types/store/projection.d.ts +4 -4
  10. package/dist/types/store/store.d.ts +2 -2
  11. package/dist/types-cjs/boundaries.d.cts +52 -0
  12. package/dist/types-cjs/core/action.d.cts +1 -0
  13. package/dist/types-cjs/core/async.d.cts +6 -0
  14. package/dist/types-cjs/core/constants.d.cts +25 -0
  15. package/dist/types-cjs/core/context.d.cts +28 -0
  16. package/dist/types-cjs/core/core.d.cts +54 -0
  17. package/dist/types-cjs/core/dev.d.cts +49 -0
  18. package/dist/types-cjs/core/effect.d.cts +30 -0
  19. package/dist/types-cjs/core/error.d.cts +14 -0
  20. package/dist/types-cjs/core/external.d.cts +26 -0
  21. package/dist/types-cjs/core/graph.d.cts +4 -0
  22. package/dist/types-cjs/core/heap.d.cts +14 -0
  23. package/dist/types-cjs/core/index.d.cts +12 -0
  24. package/dist/types-cjs/core/lanes.d.cts +54 -0
  25. package/dist/types-cjs/core/owner.d.cts +26 -0
  26. package/dist/types-cjs/core/scheduler.d.cts +81 -0
  27. package/dist/types-cjs/core/types.d.cts +86 -0
  28. package/dist/types-cjs/index.d.cts +9 -0
  29. package/dist/types-cjs/map.d.cts +24 -0
  30. package/dist/types-cjs/package.json +3 -0
  31. package/dist/types-cjs/signals.d.cts +186 -0
  32. package/dist/types-cjs/store/index.d.cts +9 -0
  33. package/dist/types-cjs/store/optimistic.d.cts +19 -0
  34. package/dist/types-cjs/store/projection.d.cts +26 -0
  35. package/dist/types-cjs/store/reconcile.d.cts +1 -0
  36. package/dist/types-cjs/store/store.d.cts +68 -0
  37. package/dist/types-cjs/store/storePath.d.cts +30 -0
  38. package/dist/types-cjs/store/utils.d.cts +43 -0
  39. package/package.json +31 -24
package/dist/prod.js CHANGED
@@ -103,12 +103,12 @@ function markNode(e, t = REACTIVE_DIRTY) {
103
103
  const n = e.O;
104
104
  if ((n & (REACTIVE_CHECK | REACTIVE_DIRTY)) >= t) return;
105
105
  e.O = (n & -4) | t;
106
- for (let t = e.h; t !== null; t = t.I) {
106
+ for (let t = e.I; t !== null; t = t.h) {
107
107
  markNode(t.p, REACTIVE_CHECK);
108
108
  }
109
109
  if (e.A !== null) {
110
110
  for (let t = e.A; t !== null; t = t.N) {
111
- for (let e = t.h; e !== null; e = e.I) {
111
+ for (let e = t.I; e !== null; e = e.h) {
112
112
  markNode(e.p, REACTIVE_CHECK);
113
113
  }
114
114
  }
@@ -136,7 +136,7 @@ function adjustHeight(e, t) {
136
136
  }
137
137
  if (e.o !== n) {
138
138
  e.o = n;
139
- for (let n = e.h; n !== null; n = n.I) {
139
+ for (let n = e.I; n !== null; n = n.h) {
140
140
  insertIntoHeapHeight(n.p, t);
141
141
  }
142
142
  }
@@ -165,7 +165,7 @@ function runLaneEffects(e) {
165
165
  }
166
166
  }
167
167
  function queueStashedOptimisticEffects(e) {
168
- for (let t = e.h; t !== null; t = t.I) {
168
+ for (let t = e.I; t !== null; t = t.h) {
169
169
  const e = t.p;
170
170
  if (!e.W) continue;
171
171
  if (e.W === EFFECT_TRACKED) {
@@ -184,14 +184,14 @@ function setProjectionWriteActive(e) {
184
184
  projectionWriteActive = e;
185
185
  }
186
186
  function mergeTransitionState(e, t) {
187
- t.$ = e;
188
- e.j.push(...t.j);
187
+ t.j = e;
188
+ e.$.push(...t.$);
189
189
  for (const n of activeLanes) if (n.K === t) n.K = e;
190
190
  e.Y.push(...t.Y);
191
- for (const n of t.B) e.B.add(n);
192
- for (const [n, i] of t.Z) {
193
- let t = e.Z.get(n);
194
- if (!t) e.Z.set(n, (t = new Set()));
191
+ for (const n of t.Z) e.Z.add(n);
192
+ for (const [n, i] of t.B) {
193
+ let t = e.B.get(n);
194
+ if (!t) e.B.set(n, (t = new Set()));
195
195
  for (const e of i) t.add(e);
196
196
  }
197
197
  }
@@ -298,7 +298,7 @@ class GlobalQueue extends Queue {
298
298
  ne = false;
299
299
  se = [];
300
300
  Y = [];
301
- B = new Set();
301
+ Z = new Set();
302
302
  static oe;
303
303
  static ue;
304
304
  static ce = null;
@@ -314,7 +314,7 @@ class GlobalQueue extends Queue {
314
314
  runHeap(zombieQueue, GlobalQueue.oe);
315
315
  this.se = [];
316
316
  this.Y = [];
317
- this.B = new Set();
317
+ this.Z = new Set();
318
318
  runLaneEffects(EFFECT_RENDER);
319
319
  runLaneEffects(EFFECT_USER);
320
320
  this.stashQueues(e.ae);
@@ -322,7 +322,7 @@ class GlobalQueue extends Queue {
322
322
  scheduled = dirtyQueue.R >= dirtyQueue.P;
323
323
  reassignPendingTransition(e.se);
324
324
  activeTransition = null;
325
- if (!e.j.length && e.Y.length) {
325
+ if (!e.$.length && e.Y.length) {
326
326
  stashedOptimisticReads = new Set();
327
327
  for (let t = 0; t < e.Y.length; t++) {
328
328
  const n = e.Y[t];
@@ -366,8 +366,8 @@ class GlobalQueue extends Queue {
366
366
  const t = i !== undefined ? i : e.fe;
367
367
  if (activeTransition && t) {
368
368
  const n = t.source;
369
- let i = activeTransition.Z.get(n);
370
- if (!i) activeTransition.Z.set(n, (i = new Set()));
369
+ let i = activeTransition.B.get(n);
370
+ if (!i) activeTransition.B.set(n, (i = new Set()));
371
371
  const r = i.size;
372
372
  i.add(e);
373
373
  if (i.size !== r) schedule();
@@ -385,12 +385,12 @@ class GlobalQueue extends Queue {
385
385
  activeTransition = e ?? {
386
386
  Ee: clock,
387
387
  se: [],
388
- Z: new Map(),
388
+ B: new Map(),
389
389
  Y: [],
390
- B: new Set(),
391
- j: [],
390
+ Z: new Set(),
391
+ $: [],
392
392
  ae: { ie: [[], []], re: [] },
393
- $: false
393
+ j: false
394
394
  };
395
395
  } else if (e) {
396
396
  const t = activeTransition;
@@ -419,16 +419,16 @@ class GlobalQueue extends Queue {
419
419
  for (const e of activeLanes) {
420
420
  if (!e.K) e.K = activeTransition;
421
421
  }
422
- if (this.B !== activeTransition.B) {
423
- for (const e of this.B) activeTransition.B.add(e);
424
- this.B = activeTransition.B;
422
+ if (this.Z !== activeTransition.Z) {
423
+ for (const e of this.Z) activeTransition.Z.add(e);
424
+ this.Z = activeTransition.Z;
425
425
  }
426
426
  }
427
427
  }
428
428
  function insertSubs(e, t = false) {
429
429
  const n = e.q || currentOptimisticLane;
430
430
  const i = e.de !== undefined;
431
- for (let r = e.h; r !== null; r = r.I) {
431
+ for (let r = e.I; r !== null; r = r.h) {
432
432
  if (i && r.p.Te) {
433
433
  r.p.O |= REACTIVE_SNAPSHOT_STALE;
434
434
  continue;
@@ -475,7 +475,7 @@ function finalizePureQueue(e = null, t = false) {
475
475
  if (n) {
476
476
  commitPendingNodes();
477
477
  resolveOptimisticNodes(e ? e.Y : globalQueue.Y);
478
- const t = e ? e.B : globalQueue.B;
478
+ const t = e ? e.Z : globalQueue.Z;
479
479
  if (GlobalQueue.ce && t.size) {
480
480
  for (const e of t) {
481
481
  GlobalQueue.ce(e);
@@ -493,7 +493,7 @@ function checkBoundaryChildren(e) {
493
493
  }
494
494
  }
495
495
  function trackOptimisticStore(e) {
496
- globalQueue.B.add(e);
496
+ globalQueue.Z.add(e);
497
497
  schedule();
498
498
  }
499
499
  function reassignPendingTransition(e) {
@@ -526,10 +526,10 @@ function reporterBlocksSource(e, t) {
526
526
  return !!(e.Se & STATUS_PENDING && e.fe instanceof NotReadyError && e.fe.source === t);
527
527
  }
528
528
  function transitionComplete(e) {
529
- if (e.$) return true;
530
- if (e.j.length) return false;
529
+ if (e.j) return true;
530
+ if (e.$.length) return false;
531
531
  let t = true;
532
- for (const [n, i] of e.Z) {
532
+ for (const [n, i] of e.B) {
533
533
  let r = false;
534
534
  for (const e of i) {
535
535
  if (reporterBlocksSource(e, n)) {
@@ -538,7 +538,7 @@ function transitionComplete(e) {
538
538
  }
539
539
  i.delete(e);
540
540
  }
541
- if (!r) e.Z.delete(n);
541
+ if (!r) e.B.delete(n);
542
542
  else if (n.Se & STATUS_PENDING && n.fe?.source === n) {
543
543
  t = false;
544
544
  break;
@@ -559,11 +559,11 @@ function transitionComplete(e) {
559
559
  }
560
560
  }
561
561
  }
562
- t && (e.$ = true);
562
+ t && (e.j = true);
563
563
  return t;
564
564
  }
565
565
  function currentTransition(e) {
566
- while (e.$ && typeof e.$ === "object") e = e.$;
566
+ while (e.j && typeof e.j === "object") e = e.j;
567
567
  return e;
568
568
  }
569
569
  function setActiveTransition(e) {
@@ -587,10 +587,10 @@ function getOrCreateLane(e) {
587
587
  }
588
588
  const n = e._e;
589
589
  const i = n?.q ? findLane(n.q) : null;
590
- t = { te: e, k: new Set(), G: [[], []], U: null, K: activeTransition, he: i };
590
+ t = { te: e, k: new Set(), G: [[], []], U: null, K: activeTransition, Ie: i };
591
591
  signalLanes.set(e, t);
592
592
  activeLanes.add(t);
593
- e.Ie = false;
593
+ e.he = false;
594
594
  return t;
595
595
  }
596
596
  function findLane(e) {
@@ -632,9 +632,9 @@ function assignOrMergeLane(e, t) {
632
632
  const r = findLane(i);
633
633
  if (activeLanes.has(r)) {
634
634
  if (r !== n && !hasActiveOverride(e)) {
635
- if (n.he && findLane(n.he) === r) {
635
+ if (n.Ie && findLane(n.Ie) === r) {
636
636
  e.q = t;
637
- } else if (r.he && findLane(r.he) === n);
637
+ } else if (r.Ie && findLane(r.Ie) === n);
638
638
  else mergeLanes(n, r);
639
639
  }
640
640
  return;
@@ -645,16 +645,16 @@ function assignOrMergeLane(e, t) {
645
645
  function unlinkSubs(e) {
646
646
  const t = e.m;
647
647
  const n = e.D;
648
- const i = e.I;
648
+ const i = e.h;
649
649
  const r = e.pe;
650
650
  if (i !== null) i.pe = r;
651
651
  else t.Ae = r;
652
- if (r !== null) r.I = i;
652
+ if (r !== null) r.h = i;
653
653
  else {
654
- t.h = i;
654
+ t.I = i;
655
655
  if (i === null) {
656
656
  t.Ne?.();
657
- t.L && !t.ge && !(t.O & REACTIVE_ZOMBIE) && unobserved(t);
657
+ t.L && !t.Pe && !(t.O & REACTIVE_ZOMBIE) && unobserved(t);
658
658
  }
659
659
  }
660
660
  return n;
@@ -666,30 +666,31 @@ function unobserved(e) {
666
666
  t = unlinkSubs(t);
667
667
  }
668
668
  e.C = null;
669
+ e.ge = null;
669
670
  disposeChildren(e, true);
670
671
  }
671
672
  function link(e, t) {
672
- const n = t.Pe;
673
+ const n = t.ge;
673
674
  if (n !== null && n.m === e) return;
674
675
  let i = null;
675
676
  const r = t.O & REACTIVE_RECOMPUTING_DEPS;
676
677
  if (r) {
677
678
  i = n !== null ? n.D : t.C;
678
679
  if (i !== null && i.m === e) {
679
- t.Pe = i;
680
+ t.ge = i;
680
681
  return;
681
682
  }
682
683
  }
683
684
  const s = e.Ae;
684
685
  if (s !== null && s.p === t && (!r || isValidLink(s, t))) return;
685
- const o = (t.Pe = e.Ae = { m: e, p: t, D: i, pe: s, I: null });
686
+ const o = (t.ge = e.Ae = { m: e, p: t, D: i, pe: s, h: null });
686
687
  if (n !== null) n.D = o;
687
688
  else t.C = o;
688
- if (s !== null) s.I = o;
689
- else e.h = o;
689
+ if (s !== null) s.h = o;
690
+ else e.I = o;
690
691
  }
691
692
  function isValidLink(e, t) {
692
- const n = t.Pe;
693
+ const n = t.ge;
693
694
  if (n !== null) {
694
695
  let i = t.C;
695
696
  do {
@@ -719,7 +720,7 @@ function dispose(e) {
719
720
  t = unlinkSubs(t);
720
721
  } while (t !== null);
721
722
  e.C = null;
722
- e.Pe = null;
723
+ e.ge = null;
723
724
  disposeChildren(e, true);
724
725
  }
725
726
  function disposeChildren(e, t = false, n) {
@@ -737,7 +738,7 @@ function disposeChildren(e, t = false, n) {
737
738
  t = unlinkSubs(t);
738
739
  } while (t !== null);
739
740
  e.C = null;
740
- e.Pe = null;
741
+ e.ge = null;
741
742
  }
742
743
  disposeChildren(i, true);
743
744
  i = e;
@@ -746,12 +747,12 @@ function disposeChildren(e, t = false, n) {
746
747
  e.ve = null;
747
748
  } else {
748
749
  e.Ce = null;
749
- e.me = 0;
750
+ e.we = 0;
750
751
  }
751
752
  runDisposal(e, n);
752
753
  }
753
754
  function runDisposal(e, t) {
754
- let n = t ? e.we : e.Ve;
755
+ let n = t ? e.me : e.Ve;
755
756
  if (!n) return;
756
757
  if (Array.isArray(n)) {
757
758
  for (let e = 0; e < n.length; e++) {
@@ -761,12 +762,12 @@ function runDisposal(e, t) {
761
762
  } else {
762
763
  n.call(n);
763
764
  }
764
- t ? (e.we = null) : (e.Ve = null);
765
+ t ? (e.me = null) : (e.Ve = null);
765
766
  }
766
767
  function childId(e, t) {
767
768
  let n = e;
768
769
  while (n.be && n.i) n = n.i;
769
- if (n.id != null) return formatId(n.id, t ? n.me++ : n.me);
770
+ if (n.id != null) return formatId(n.id, t ? n.we++ : n.we);
770
771
  throw new Error("Cannot get child id from owner without an id");
771
772
  }
772
773
  function getNextChildId(e) {
@@ -810,8 +811,8 @@ function createOwner(e) {
810
811
  Ve: null,
811
812
  F: t?.F ?? globalQueue,
812
813
  Le: t?.Le || defaultContext,
813
- me: 0,
814
- we: null,
814
+ we: 0,
815
+ me: null,
815
816
  ve: null,
816
817
  i: t,
817
818
  dispose(e = true) {
@@ -882,9 +883,9 @@ function setPendingError(e, t, n) {
882
883
  }
883
884
  }
884
885
  function forEachDependent(e, t) {
885
- for (let n = e.h; n !== null; n = n.I) t(n.p);
886
+ for (let n = e.I; n !== null; n = n.h) t(n.p);
886
887
  for (let n = e.A; n !== null; n = n.N) {
887
- for (let e = n.h; e !== null; e = e.I) t(e.p);
888
+ for (let e = n.I; e !== null; e = e.h) t(e.p);
888
889
  }
889
890
  }
890
891
  function settlePendingSource(e) {
@@ -943,9 +944,10 @@ function handleAsync(e, t, n) {
943
944
  if (e.ye !== t) return;
944
945
  if (e.O & (REACTIVE_DIRTY | REACTIVE_OPTIMISTIC_DIRTY)) return;
945
946
  globalQueue.initTransition(resolveTransition(e));
947
+ const s = !!(e.Se & STATUS_UNINITIALIZED);
946
948
  clearStatus(e);
947
- const s = resolveLane(e);
948
- if (s) s.k.delete(e);
949
+ const o = resolveLane(e);
950
+ if (o) o.k.delete(e);
949
951
  if (n) n(i);
950
952
  else if (e.ee !== undefined) {
951
953
  if (e.ee !== undefined && e.ee !== NOT_PENDING) e.X = i;
@@ -954,10 +956,11 @@ function handleAsync(e, t, n) {
954
956
  insertSubs(e);
955
957
  }
956
958
  e.Ee = clock;
957
- } else if (s) {
958
- const t = e.J;
959
- const n = e.ke;
960
- if (!n || !n(i, t)) {
959
+ } else if (o) {
960
+ const t = e.W;
961
+ const n = e.J;
962
+ const r = e.ke;
963
+ if ((!t && s) || !r || !r(i, n)) {
961
964
  e.J = i;
962
965
  e.Ee = clock;
963
966
  if (e.xe) {
@@ -1198,32 +1201,33 @@ function recompute(e, t = false) {
1198
1201
  if (e.K || n === EFFECT_TRACKED) disposeChildren(e);
1199
1202
  else {
1200
1203
  markDisposal(e);
1201
- e.we = e.Ve;
1204
+ e.me = e.Ve;
1202
1205
  e.ve = e.Ce;
1203
1206
  e.Ve = null;
1204
1207
  e.Ce = null;
1205
- e.me = 0;
1208
+ e.we = 0;
1206
1209
  }
1207
1210
  }
1208
1211
  const i = !!(e.O & REACTIVE_OPTIMISTIC_DIRTY);
1209
1212
  const r = e.ee !== undefined && e.ee !== NOT_PENDING;
1210
1213
  const s = !!(e.Se & STATUS_PENDING);
1211
- const o = context;
1214
+ const o = !!(e.Se & STATUS_UNINITIALIZED);
1215
+ const u = context;
1212
1216
  context = e;
1213
- e.Pe = null;
1217
+ e.ge = null;
1214
1218
  e.O = REACTIVE_RECOMPUTING_DEPS;
1215
1219
  e.Ee = clock;
1216
- let u = e.X === NOT_PENDING ? e.J : e.X;
1217
- let c = e.o;
1218
- let a = tracking;
1219
- let l = currentOptimisticLane;
1220
+ let c = e.X === NOT_PENDING ? e.J : e.X;
1221
+ let a = e.o;
1222
+ let l = tracking;
1223
+ let f = currentOptimisticLane;
1220
1224
  tracking = true;
1221
1225
  if (i) {
1222
1226
  const t = resolveLane(e);
1223
1227
  if (t) currentOptimisticLane = t;
1224
1228
  }
1225
1229
  try {
1226
- u = handleAsync(e, e.L(u));
1230
+ c = handleAsync(e, e.L(c));
1227
1231
  clearStatus(e, t);
1228
1232
  const n = resolveLane(e);
1229
1233
  if (n) {
@@ -1248,42 +1252,42 @@ function recompute(e, t = false) {
1248
1252
  t instanceof NotReadyError ? e.q : undefined
1249
1253
  );
1250
1254
  } finally {
1251
- tracking = a;
1255
+ tracking = l;
1252
1256
  e.O = REACTIVE_NONE | (t ? e.O & REACTIVE_SNAPSHOT_STALE : 0);
1253
- context = o;
1257
+ context = u;
1254
1258
  }
1255
1259
  if (!e.fe) {
1256
- const o = e.Pe;
1257
- let a = o !== null ? o.D : e.C;
1258
- if (a !== null) {
1260
+ const u = e.ge;
1261
+ let l = u !== null ? u.D : e.C;
1262
+ if (l !== null) {
1259
1263
  do {
1260
- a = unlinkSubs(a);
1261
- } while (a !== null);
1262
- if (o !== null) o.D = null;
1264
+ l = unlinkSubs(l);
1265
+ } while (l !== null);
1266
+ if (u !== null) u.D = null;
1263
1267
  else e.C = null;
1264
1268
  }
1265
- const l = r ? e.ee : e.X === NOT_PENDING ? e.J : e.X;
1266
- const f = !e.ke || !e.ke(l, u);
1267
- if (f) {
1269
+ const f = r ? e.ee : e.X === NOT_PENDING ? e.J : e.X;
1270
+ const E = (!n && o) || !e.ke || !e.ke(f, c);
1271
+ if (E) {
1268
1272
  const o = r ? e.ee : undefined;
1269
1273
  if (t || (n && activeTransition !== e.K) || i) {
1270
- e.J = u;
1274
+ e.J = c;
1271
1275
  if (r && i) {
1272
- e.ee = u;
1273
- e.X = u;
1276
+ e.ee = c;
1277
+ e.X = c;
1274
1278
  }
1275
- } else e.X = u;
1276
- if (r && !i && s && !e.Ie) e.ee = u;
1279
+ } else e.X = c;
1280
+ if (r && !i && s && !e.he) e.ee = c;
1277
1281
  if (!r || i || e.ee !== o) insertSubs(e, i || r);
1278
1282
  } else if (r) {
1279
- e.X = u;
1280
- } else if (e.o != c) {
1281
- for (let t = e.h; t !== null; t = t.I) {
1283
+ e.X = c;
1284
+ } else if (e.o != a) {
1285
+ for (let t = e.I; t !== null; t = t.h) {
1282
1286
  insertIntoHeapHeight(t.p, t.p.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
1283
1287
  }
1284
1288
  }
1285
1289
  }
1286
- currentOptimisticLane = l;
1290
+ currentOptimisticLane = f;
1287
1291
  (!t || e.Se & STATUS_PENDING) && !e.K && !(activeTransition && r) && globalQueue.se.push(e);
1288
1292
  e.K && n && activeTransition !== e.K && runInTransition(e.K, () => recompute(e));
1289
1293
  }
@@ -1311,12 +1315,12 @@ function computed(e, t, n) {
1311
1315
  id: n?.id ?? (i ? context?.id : context?.id != null ? getNextChildId(context) : undefined),
1312
1316
  be: i || undefined,
1313
1317
  ke: n?.equals != null ? n.equals : isEqual,
1314
- le: !!n?.pureWrite,
1318
+ le: !!n?.ownedWrite,
1315
1319
  Ne: n?.unobserved,
1316
1320
  Ve: null,
1317
1321
  F: context?.F ?? globalQueue,
1318
1322
  Le: context?.Le ?? defaultContext,
1319
- me: 0,
1323
+ we: 0,
1320
1324
  L: e,
1321
1325
  J: t,
1322
1326
  o: 0,
@@ -1324,8 +1328,8 @@ function computed(e, t, n) {
1324
1328
  S: undefined,
1325
1329
  T: null,
1326
1330
  C: null,
1327
- Pe: null,
1328
- h: null,
1331
+ ge: null,
1332
+ I: null,
1329
1333
  Ae: null,
1330
1334
  i: context,
1331
1335
  De: null,
@@ -1334,7 +1338,7 @@ function computed(e, t, n) {
1334
1338
  Se: STATUS_UNINITIALIZED,
1335
1339
  Ee: clock,
1336
1340
  X: NOT_PENDING,
1337
- we: null,
1341
+ me: null,
1338
1342
  ve: null,
1339
1343
  ye: null,
1340
1344
  K: null
@@ -1353,7 +1357,7 @@ function computed(e, t, n) {
1353
1357
  if (s) r.o = s.o + 1;
1354
1358
  if (snapshotCaptureActive && ownerInSnapshotScope(context)) r.Te = true;
1355
1359
  if (externalSourceConfig) {
1356
- const e = signal(undefined, { equals: false, pureWrite: true });
1360
+ const e = signal(undefined, { equals: false, ownedWrite: true });
1357
1361
  const t = externalSourceConfig.factory(r.L, () => {
1358
1362
  setSignal(e, undefined);
1359
1363
  });
@@ -1375,11 +1379,11 @@ function computed(e, t, n) {
1375
1379
  function signal(e, t, n = null) {
1376
1380
  const i = {
1377
1381
  ke: t?.equals != null ? t.equals : isEqual,
1378
- le: !!t?.pureWrite,
1382
+ le: !!t?.ownedWrite,
1379
1383
  He: !!t?.He,
1380
1384
  Ne: t?.unobserved,
1381
1385
  J: e,
1382
- h: null,
1386
+ I: null,
1383
1387
  Ae: null,
1384
1388
  Ee: clock,
1385
1389
  V: n,
@@ -1464,46 +1468,51 @@ function read(e) {
1464
1468
  }
1465
1469
  let t = context;
1466
1470
  if (t?.t) t = t.u;
1467
- if (refreshing && e.L) recompute(e);
1468
- if (e.O & REACTIVE_LAZY) {
1469
- e.O &= ~REACTIVE_LAZY;
1470
- recompute(e, true);
1471
- }
1472
- const n = e.V || e;
1471
+ const n = e;
1472
+ if (typeof n.L === "function") {
1473
+ const t = e;
1474
+ if (refreshing && !(t.O & REACTIVE_DISPOSED)) recompute(t);
1475
+ if (t.O & REACTIVE_LAZY) {
1476
+ t.O &= ~REACTIVE_LAZY;
1477
+ recompute(t, true);
1478
+ } else if (t.O & REACTIVE_DISPOSED) {
1479
+ recompute(t, true);
1480
+ }
1481
+ }
1482
+ const i = e.V || e;
1473
1483
  if (t && tracking) {
1474
- if (e.L && e.O & REACTIVE_DISPOSED) recompute(e);
1475
1484
  link(e, t);
1476
- if (n.L) {
1477
- const i = e.O & REACTIVE_ZOMBIE;
1478
- if (n.o >= (i ? zombieQueue.P : dirtyQueue.P)) {
1485
+ if (i.L) {
1486
+ const n = e.O & REACTIVE_ZOMBIE;
1487
+ if (i.o >= (n ? zombieQueue.P : dirtyQueue.P)) {
1479
1488
  markNode(t);
1480
- markHeap(i ? zombieQueue : dirtyQueue);
1481
- updateIfNecessary(n);
1489
+ markHeap(n ? zombieQueue : dirtyQueue);
1490
+ updateIfNecessary(i);
1482
1491
  }
1483
- const r = n.o;
1492
+ const r = i.o;
1484
1493
  if (r >= t.o && e.i !== t) {
1485
1494
  t.o = r + 1;
1486
1495
  }
1487
1496
  }
1488
1497
  }
1489
- if (n.Se & STATUS_PENDING) {
1490
- if (t && !(stale && n.K && activeTransition !== n.K)) {
1498
+ if (i.Se & STATUS_PENDING) {
1499
+ if (t && !(stale && i.K && activeTransition !== i.K)) {
1491
1500
  if (currentOptimisticLane) {
1492
- const i = n.q;
1501
+ const n = i.q;
1493
1502
  const r = findLane(currentOptimisticLane);
1494
- if (i && findLane(i) === r && !hasActiveOverride(n)) {
1503
+ if (n && findLane(n) === r && !hasActiveOverride(i)) {
1495
1504
  if (!tracking && e !== t) link(e, t);
1496
- throw n.fe;
1505
+ throw i.fe;
1497
1506
  }
1498
1507
  } else {
1499
1508
  if (!tracking && e !== t) link(e, t);
1500
- throw n.fe;
1509
+ throw i.fe;
1501
1510
  }
1502
- } else if (t && n !== e && n.Se & STATUS_UNINITIALIZED) {
1511
+ } else if (t && i !== e && i.Se & STATUS_UNINITIALIZED) {
1503
1512
  if (!tracking && e !== t) link(e, t);
1504
- throw n.fe;
1505
- } else if (!t && n.Se & STATUS_UNINITIALIZED) {
1506
- throw n.fe;
1513
+ throw i.fe;
1514
+ } else if (!t && i.Se & STATUS_UNINITIALIZED) {
1515
+ throw i.fe;
1507
1516
  }
1508
1517
  }
1509
1518
  if (e.L && e.Se & STATUS_ERROR) {
@@ -1525,13 +1534,26 @@ function read(e) {
1525
1534
  if (t && stale && shouldReadStashedOptimisticValue(e)) return e.J;
1526
1535
  return e.ee;
1527
1536
  }
1528
- return !t ||
1537
+ const r =
1538
+ !t ||
1529
1539
  (currentOptimisticLane !== null &&
1530
- (e.ee !== undefined || e.q || (n === e && stale) || !!(n.Se & STATUS_PENDING))) ||
1540
+ (e.ee !== undefined || e.q || (i === e && stale) || !!(i.Se & STATUS_PENDING))) ||
1531
1541
  e.X === NOT_PENDING ||
1532
1542
  (stale && e.K && activeTransition !== e.K)
1533
- ? e.J
1534
- : e.X;
1543
+ ? e.J
1544
+ : e.X;
1545
+ if (
1546
+ !t &&
1547
+ i === e &&
1548
+ typeof n.L === "function" &&
1549
+ !n.Pe &&
1550
+ !(i.Se & STATUS_PENDING) &&
1551
+ !n.i &&
1552
+ !e.I
1553
+ ) {
1554
+ unobserved(e);
1555
+ }
1556
+ return r;
1535
1557
  }
1536
1558
  function setSignal(e, t) {
1537
1559
  if (e.K && activeTransition !== e.K) globalQueue.initTransition(e.K);
@@ -1554,7 +1576,7 @@ function setSignal(e, t) {
1554
1576
  e.X = e.J;
1555
1577
  globalQueue.Y.push(e);
1556
1578
  }
1557
- e.Ie = true;
1579
+ e.he = true;
1558
1580
  const i = getOrCreateLane(e);
1559
1581
  e.q = i;
1560
1582
  e.ee = t;
@@ -1585,7 +1607,7 @@ function runWithOwner(e, t) {
1585
1607
  }
1586
1608
  function getPendingSignal(e) {
1587
1609
  if (!e.Fe) {
1588
- e.Fe = optimisticSignal(false, { pureWrite: true });
1610
+ e.Fe = optimisticSignal(false, { ownedWrite: true });
1589
1611
  if (e._e) {
1590
1612
  e.Fe._e = e;
1591
1613
  }
@@ -1737,8 +1759,8 @@ function effect(e, t, n, i, r) {
1737
1759
  });
1738
1760
  o.Qe = i;
1739
1761
  o.Me = t;
1740
- o.$e = n;
1741
- o.je = undefined;
1762
+ o.je = n;
1763
+ o.$e = undefined;
1742
1764
  o.W = r?.render ? EFFECT_RENDER : EFFECT_USER;
1743
1765
  o.Ge = (e, t) => {
1744
1766
  const n = e !== undefined ? e : o.Se;
@@ -1748,10 +1770,10 @@ function effect(e, t, n, i, r) {
1748
1770
  o.F.notify(o, STATUS_PENDING, 0);
1749
1771
  if (o.W === EFFECT_USER) {
1750
1772
  try {
1751
- return o.$e
1752
- ? o.$e(e, () => {
1753
- o.je?.();
1754
- o.je = undefined;
1773
+ return o.je
1774
+ ? o.je(e, () => {
1775
+ o.$e?.();
1776
+ o.$e = undefined;
1755
1777
  })
1756
1778
  : console.error(e);
1757
1779
  } catch (t) {
@@ -1766,16 +1788,16 @@ function effect(e, t, n, i, r) {
1766
1788
  recompute(o, true);
1767
1789
  !r?.defer && (o.W === EFFECT_USER ? o.F.enqueue(o.W, runEffect.bind(o)) : runEffect.call(o));
1768
1790
  s = true;
1769
- cleanup(() => o.je?.());
1791
+ cleanup(() => o.$e?.());
1770
1792
  }
1771
1793
  function runEffect() {
1772
1794
  if (!this.H || this.O & REACTIVE_DISPOSED) return;
1773
- this.je?.();
1774
- this.je = undefined;
1795
+ this.$e?.();
1796
+ this.$e = undefined;
1775
1797
  try {
1776
1798
  const e = this.Me(this.J, this.Qe);
1777
1799
  if (false && e !== undefined && typeof e !== "function");
1778
- this.je = e;
1800
+ this.$e = e;
1779
1801
  } catch (e) {
1780
1802
  this.fe = new StatusError(this, e);
1781
1803
  this.Se |= STATUS_ERROR;
@@ -1796,15 +1818,15 @@ function trackedEffect(e, t) {
1796
1818
  };
1797
1819
  const n = computed(
1798
1820
  () => {
1799
- n.je?.();
1800
- n.je = undefined;
1821
+ n.$e?.();
1822
+ n.$e = undefined;
1801
1823
  const t = staleValues(e);
1802
- n.je = t;
1824
+ n.$e = t;
1803
1825
  },
1804
1826
  undefined,
1805
1827
  { ...t, lazy: true }
1806
1828
  );
1807
- n.je = undefined;
1829
+ n.$e = undefined;
1808
1830
  n.Ke = true;
1809
1831
  n.H = true;
1810
1832
  n.W = EFFECT_TRACKED;
@@ -1818,7 +1840,7 @@ function trackedEffect(e, t) {
1818
1840
  };
1819
1841
  n.M = run;
1820
1842
  n.F.enqueue(EFFECT_USER, run);
1821
- cleanup(() => n.je?.());
1843
+ cleanup(() => n.$e?.());
1822
1844
  }
1823
1845
  function restoreTransition(e, t) {
1824
1846
  globalQueue.initTransition(e);
@@ -1832,11 +1854,11 @@ function action(e) {
1832
1854
  const r = e(...t);
1833
1855
  globalQueue.initTransition();
1834
1856
  let s = activeTransition;
1835
- s.j.push(r);
1857
+ s.$.push(r);
1836
1858
  const done = (e, t) => {
1837
1859
  s = currentTransition(s);
1838
- const o = s.j.indexOf(r);
1839
- if (o >= 0) s.j.splice(o, 1);
1860
+ const o = s.$.indexOf(r);
1861
+ if (o >= 0) s.$.splice(o, 1);
1840
1862
  setActiveTransition(s);
1841
1863
  schedule();
1842
1864
  t ? i(t) : n(e);
@@ -1872,23 +1894,24 @@ function accessor(e) {
1872
1894
  t.$r = true;
1873
1895
  return t;
1874
1896
  }
1875
- function createSignal(e, t, n) {
1897
+ function createSignal(e, t) {
1876
1898
  if (typeof e === "function") {
1877
- const i = computed(e, t, n);
1878
- return [accessor(i), setSignal.bind(null, i)];
1899
+ const n = computed(e, undefined, t);
1900
+ n.Pe = true;
1901
+ return [accessor(n), setSignal.bind(null, n)];
1879
1902
  }
1880
- const i = signal(e, t);
1881
- return [accessor(i), setSignal.bind(null, i)];
1903
+ const n = signal(e, t);
1904
+ return [accessor(n), setSignal.bind(null, n)];
1882
1905
  }
1883
- function createMemo(e, t, n) {
1884
- let i = computed(e, t, n);
1885
- return accessor(i);
1906
+ function createMemo(e, t) {
1907
+ let n = computed(e, undefined, t);
1908
+ return accessor(n);
1886
1909
  }
1887
- function createEffect(e, t, n, i) {
1888
- effect(e, t.effect || t, t.error, n, i);
1910
+ function createEffect(e, t, n) {
1911
+ effect(e, t.effect || t, t.error, undefined, n);
1889
1912
  }
1890
- function createRenderEffect(e, t, n, i) {
1891
- effect(e, t, undefined, n, { render: true, ...i });
1913
+ function createRenderEffect(e, t, n) {
1914
+ effect(e, t, undefined, undefined, { render: true, ...n });
1892
1915
  }
1893
1916
  function createTrackedEffect(e, t) {
1894
1917
  trackedEffect(e, t);
@@ -1930,13 +1953,14 @@ function resolve(e) {
1930
1953
  });
1931
1954
  });
1932
1955
  }
1933
- function createOptimistic(e, t, n) {
1956
+ function createOptimistic(e, t) {
1934
1957
  if (typeof e === "function") {
1935
- const i = optimisticComputed(e, t, n);
1936
- return [accessor(i), setSignal.bind(null, i)];
1958
+ const n = optimisticComputed(e, undefined, t);
1959
+ n.Pe = true;
1960
+ return [accessor(n), setSignal.bind(null, n)];
1937
1961
  }
1938
- const i = optimisticSignal(e, t);
1939
- return [accessor(i), setSignal.bind(null, i)];
1962
+ const n = optimisticSignal(e, t);
1963
+ return [accessor(n), setSignal.bind(null, n)];
1940
1964
  }
1941
1965
  function onSettled(e) {
1942
1966
  const t = getOwner();
@@ -2083,7 +2107,7 @@ function reconcile(e, t) {
2083
2107
  applyState(e, n, i);
2084
2108
  };
2085
2109
  }
2086
- function createProjectionInternal(e, t = {}, n) {
2110
+ function createProjectionInternal(e, t, n) {
2087
2111
  let i;
2088
2112
  const r = new WeakMap();
2089
2113
  const wrapper = e => {
@@ -2121,10 +2145,10 @@ function createProjectionInternal(e, t = {}, n) {
2121
2145
  u !== o && u !== undefined && reconcile(u, n?.key || "id")(s);
2122
2146
  });
2123
2147
  });
2124
- i.ge = true;
2148
+ i.Pe = true;
2125
2149
  return { store: s, node: i };
2126
2150
  }
2127
- function createProjection(e, t = {}, n) {
2151
+ function createProjection(e, t, n) {
2128
2152
  return createProjectionInternal(e, t, n).store;
2129
2153
  }
2130
2154
  function createWriteTraps(e) {
@@ -2269,12 +2293,54 @@ function getKeys(e, t, n = true) {
2269
2293
  return Array.from(r);
2270
2294
  }
2271
2295
  function getPropertyDescriptor(e, t, n) {
2272
- let i = e;
2273
2296
  if (t && n in t) {
2274
- if (i[n] === $DELETED) return void 0;
2275
- if (!(n in i)) i = t;
2297
+ if (t[n] === $DELETED) return void 0;
2298
+ const i = Reflect.getOwnPropertyDescriptor(t, n);
2299
+ if (i?.get || i?.set || !(n in e)) return i;
2300
+ }
2301
+ return Reflect.getOwnPropertyDescriptor(e, n);
2302
+ }
2303
+ function prepareStoreWrite(e, t, n) {
2304
+ if (e[STORE_OPTIMISTIC]) {
2305
+ const t = e[STORE_FIREWALL];
2306
+ if (t?.K) {
2307
+ globalQueue.initTransition(t.K);
2308
+ }
2309
+ }
2310
+ const i = e[STORE_VALUE];
2311
+ const r = i[n];
2312
+ if (
2313
+ snapshotCaptureActive &&
2314
+ typeof n !== "symbol" &&
2315
+ !((e[STORE_FIREWALL]?.Se ?? 0) & STATUS_PENDING)
2316
+ ) {
2317
+ if (!e[STORE_SNAPSHOT_PROPS]) {
2318
+ e[STORE_SNAPSHOT_PROPS] = Object.create(null);
2319
+ snapshotSources?.add(e);
2320
+ }
2321
+ if (!(n in e[STORE_SNAPSHOT_PROPS])) {
2322
+ e[STORE_SNAPSHOT_PROPS][n] = r;
2323
+ }
2324
+ }
2325
+ const s = e[STORE_OPTIMISTIC] && !projectionWriteActive;
2326
+ const o = s ? STORE_OPTIMISTIC_OVERRIDE : STORE_OVERRIDE;
2327
+ if (s) trackOptimisticStore(t);
2328
+ return { base: r, overrideKey: o, state: i };
2329
+ }
2330
+ function notifyStoreProperty(e, t, n, i) {
2331
+ if (e[STORE_HAS]?.[t]) setSignal(e[STORE_HAS][t], n !== "delete");
2332
+ const r = getNodes(e, STORE_NODE);
2333
+ if (n === "set") {
2334
+ r[t] && setSignal(r[t], () => (isWrappable(i) ? wrap(i, e) : i));
2335
+ } else if (n === "invalidate") {
2336
+ if (r[t]) {
2337
+ setSignal(r[t], {});
2338
+ delete r[t];
2339
+ }
2340
+ } else {
2341
+ r[t] && setSignal(r[t], undefined);
2276
2342
  }
2277
- return Reflect.getOwnPropertyDescriptor(i, n);
2343
+ r[$TRACK] && setSignal(r[$TRACK], undefined);
2278
2344
  }
2279
2345
  let Writing = null;
2280
2346
  const storeTraps = {
@@ -2360,64 +2426,51 @@ const storeTraps = {
2360
2426
  set(e, t, n) {
2361
2427
  const i = e[$PROXY];
2362
2428
  if (writeOnly(i)) {
2363
- if (e[STORE_OPTIMISTIC]) {
2364
- const t = e[STORE_FIREWALL];
2365
- if (t?.K) {
2366
- globalQueue.initTransition(t.K);
2367
- }
2368
- }
2369
2429
  untrack(() => {
2370
- const r = e[STORE_VALUE];
2371
- const s = r[t];
2372
- if (
2373
- snapshotCaptureActive &&
2374
- typeof t !== "symbol" &&
2375
- !((e[STORE_FIREWALL]?.Se ?? 0) & STATUS_PENDING)
2376
- ) {
2377
- if (!e[STORE_SNAPSHOT_PROPS]) {
2378
- e[STORE_SNAPSHOT_PROPS] = Object.create(null);
2379
- snapshotSources?.add(e);
2380
- }
2381
- if (!(t in e[STORE_SNAPSHOT_PROPS])) {
2382
- e[STORE_SNAPSHOT_PROPS][t] = s;
2383
- }
2384
- }
2385
- const o = e[STORE_OPTIMISTIC] && !projectionWriteActive;
2386
- const u = o ? STORE_OPTIMISTIC_OVERRIDE : STORE_OVERRIDE;
2387
- if (o) trackOptimisticStore(i);
2388
- const c =
2430
+ const { base: r, overrideKey: s, state: o } = prepareStoreWrite(e, i, t);
2431
+ const u =
2389
2432
  e[STORE_OPTIMISTIC_OVERRIDE] && t in e[STORE_OPTIMISTIC_OVERRIDE]
2390
2433
  ? e[STORE_OPTIMISTIC_OVERRIDE][t]
2391
2434
  : e[STORE_OVERRIDE] && t in e[STORE_OVERRIDE]
2392
2435
  ? e[STORE_OVERRIDE][t]
2393
- : s;
2394
- const a = n?.[$TARGET]?.[STORE_VALUE] ?? n;
2395
- const l = Array.isArray(r) && t !== "length";
2396
- const f = l ? parseInt(t) + 1 : 0;
2397
- const E =
2398
- l &&
2436
+ : r;
2437
+ const c = n?.[$TARGET]?.[STORE_VALUE] ?? n;
2438
+ const a = Array.isArray(o) && t !== "length";
2439
+ const l = a ? parseInt(t) + 1 : 0;
2440
+ const f =
2441
+ a &&
2399
2442
  (e[STORE_OPTIMISTIC_OVERRIDE] && "length" in e[STORE_OPTIMISTIC_OVERRIDE]
2400
2443
  ? e[STORE_OPTIMISTIC_OVERRIDE].length
2401
2444
  : e[STORE_OVERRIDE] && "length" in e[STORE_OVERRIDE]
2402
2445
  ? e[STORE_OVERRIDE].length
2403
- : r.length);
2404
- const d = l && f > E ? f : undefined;
2405
- if (c === a && d === undefined) return true;
2406
- if (a !== undefined && a === s && d === undefined) delete e[u]?.[t];
2446
+ : o.length);
2447
+ const E = a && l > f ? l : undefined;
2448
+ if (u === c && E === undefined) return true;
2449
+ if (c !== undefined && c === r && E === undefined) delete e[s]?.[t];
2407
2450
  else {
2408
- const n = e[u] || (e[u] = Object.create(null));
2409
- n[t] = a;
2410
- if (d !== undefined) n.length = d;
2451
+ const n = e[s] || (e[s] = Object.create(null));
2452
+ n[t] = c;
2453
+ if (E !== undefined) n.length = E;
2411
2454
  }
2412
- const T = isWrappable(a);
2413
- e[STORE_HAS]?.[t] && setSignal(e[STORE_HAS][t], true);
2414
- const S = getNodes(e, STORE_NODE);
2415
- S[t] && setSignal(S[t], () => (T ? wrap(a, e) : a));
2416
- if (Array.isArray(r)) {
2417
- const e = t === "length" ? a : d;
2418
- e !== undefined && S.length && setSignal(S.length, e);
2455
+ notifyStoreProperty(e, t, "set", c);
2456
+ if (Array.isArray(o)) {
2457
+ const n = getNodes(e, STORE_NODE);
2458
+ const i = t === "length" ? c : E;
2459
+ i !== undefined && n.length && setSignal(n.length, i);
2419
2460
  }
2420
- S[$TRACK] && setSignal(S[$TRACK], undefined);
2461
+ if (false);
2462
+ });
2463
+ }
2464
+ return true;
2465
+ },
2466
+ defineProperty(e, t, n) {
2467
+ const i = e[$PROXY];
2468
+ if (writeOnly(i)) {
2469
+ untrack(() => {
2470
+ const { base: r, overrideKey: s } = prepareStoreWrite(e, i, t);
2471
+ const o = "value" in n ? { ...n, value: n.value?.[$TARGET]?.[STORE_VALUE] ?? n.value } : n;
2472
+ Object.defineProperty(e[s] || (e[s] = Object.create(null)), t, o);
2473
+ notifyStoreProperty(e, t, "invalidate");
2421
2474
  if (false);
2422
2475
  });
2423
2476
  }
@@ -2442,10 +2495,7 @@ const storeTraps = {
2442
2495
  } else if (e[i] && t in e[i]) {
2443
2496
  delete e[i][t];
2444
2497
  } else return true;
2445
- if (e[STORE_HAS]?.[t]) setSignal(e[STORE_HAS][t], false);
2446
- const s = getNodes(e, STORE_NODE);
2447
- s[t] && setSignal(s[t], undefined);
2448
- s[$TRACK] && setSignal(s[$TRACK], undefined);
2498
+ notifyStoreProperty(e, t, "delete");
2449
2499
  });
2450
2500
  }
2451
2501
  return true;
@@ -2467,9 +2517,11 @@ const storeTraps = {
2467
2517
  if (t === $PROXY) return { value: e[$PROXY], writable: true, configurable: true };
2468
2518
  if (e[STORE_OPTIMISTIC_OVERRIDE] && t in e[STORE_OPTIMISTIC_OVERRIDE]) {
2469
2519
  if (e[STORE_OPTIMISTIC_OVERRIDE][t] === $DELETED) return undefined;
2470
- const n = getPropertyDescriptor(e[STORE_VALUE], e[STORE_OVERRIDE], t);
2471
- if (n) {
2472
- return { ...n, value: e[STORE_OPTIMISTIC_OVERRIDE][t] };
2520
+ const n = Reflect.getOwnPropertyDescriptor(e[STORE_OPTIMISTIC_OVERRIDE], t);
2521
+ if (n?.get || n?.set || !(t in e[STORE_VALUE])) return n;
2522
+ const i = getPropertyDescriptor(e[STORE_VALUE], e[STORE_OVERRIDE], t);
2523
+ if (i) {
2524
+ return { ...i, value: e[STORE_OPTIMISTIC_OVERRIDE][t] };
2473
2525
  }
2474
2526
  return {
2475
2527
  value: e[STORE_OPTIMISTIC_OVERRIDE][t],
@@ -2515,7 +2567,7 @@ function createStore(e, t, n) {
2515
2567
  function createOptimisticStore(e, t, n) {
2516
2568
  GlobalQueue.ce ||= clearOptimisticStore;
2517
2569
  const i = typeof e === "function";
2518
- const r = (i ? t : e) ?? {};
2570
+ const r = i ? t : e;
2519
2571
  const s = i ? e : undefined;
2520
2572
  const { store: o } = createOptimisticProjectionInternal(s, r, n);
2521
2573
  return [o, e => storeSetter(o, e)];
@@ -2547,7 +2599,7 @@ function clearOptimisticStore(e) {
2547
2599
  }
2548
2600
  delete t[STORE_OPTIMISTIC_OVERRIDE];
2549
2601
  }
2550
- function createOptimisticProjectionInternal(e, t = {}, n) {
2602
+ function createOptimisticProjectionInternal(e, t, n) {
2551
2603
  let i;
2552
2604
  const r = new WeakMap();
2553
2605
  const wrapper = e => {
@@ -2597,7 +2649,7 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
2597
2649
  setProjectionWriteActive(false);
2598
2650
  }
2599
2651
  });
2600
- i.ge = true;
2652
+ i.Pe = true;
2601
2653
  }
2602
2654
  return { store: s, node: i };
2603
2655
  }
@@ -2650,7 +2702,12 @@ function updatePath(e, t, n = 0) {
2650
2702
  } else if (i === undefined || (isWrappable(r) && isWrappable(s) && !Array.isArray(s))) {
2651
2703
  const t = i !== undefined ? e[i] : e;
2652
2704
  const n = Object.keys(s);
2653
- for (let e = 0; e < n.length; e++) t[n[e]] = s[n[e]];
2705
+ for (let e = 0; e < n.length; e++) {
2706
+ const i = n[e];
2707
+ const r = Object.getOwnPropertyDescriptor(s, i);
2708
+ if (r.get || r.set) Object.defineProperty(t, i, r);
2709
+ else t[i] = r.value;
2710
+ }
2654
2711
  } else {
2655
2712
  e[i] = s;
2656
2713
  }
@@ -2852,14 +2909,14 @@ function mapArray(e, t, n) {
2852
2909
  const i = typeof n?.keyed === "function" ? n.keyed : undefined;
2853
2910
  const r = t.length > 1;
2854
2911
  const s = t;
2855
- return createMemo(
2912
+ const o = computed(
2856
2913
  updateKeyedMap.bind({
2857
2914
  Ye: createOwner(),
2858
- Be: 0,
2859
- Ze: e,
2915
+ Ze: 0,
2916
+ Be: e,
2860
2917
  qe: [],
2861
- ze: s,
2862
- Xe: [],
2918
+ Xe: s,
2919
+ ze: [],
2863
2920
  Je: [],
2864
2921
  et: i,
2865
2922
  tt: i || n?.keyed === false ? [] : undefined,
@@ -2867,10 +2924,12 @@ function mapArray(e, t, n) {
2867
2924
  it: n?.fallback
2868
2925
  })
2869
2926
  );
2927
+ o.Pe = true;
2928
+ return accessor(o);
2870
2929
  }
2871
- const pureOptions = { pureWrite: true };
2930
+ const pureOptions = { ownedWrite: true };
2872
2931
  function updateKeyedMap() {
2873
- const e = this.Ze() || [],
2932
+ const e = this.Be() || [],
2874
2933
  t = e.length;
2875
2934
  e[$TRACK];
2876
2935
  runWithOwner(this.Ye, () => {
@@ -2880,39 +2939,39 @@ function updateKeyedMap() {
2880
2939
  ? () => {
2881
2940
  this.tt[i] = signal(e[i], pureOptions);
2882
2941
  this.nt && (this.nt[i] = signal(i, pureOptions));
2883
- return this.ze(accessor(this.tt[i]), this.nt ? accessor(this.nt[i]) : undefined);
2942
+ return this.Xe(accessor(this.tt[i]), this.nt ? accessor(this.nt[i]) : undefined);
2884
2943
  }
2885
2944
  : this.nt
2886
2945
  ? () => {
2887
2946
  const t = e[i];
2888
2947
  this.nt[i] = signal(i, pureOptions);
2889
- return this.ze(() => t, accessor(this.nt[i]));
2948
+ return this.Xe(() => t, accessor(this.nt[i]));
2890
2949
  }
2891
2950
  : () => {
2892
2951
  const t = e[i];
2893
- return this.ze(() => t);
2952
+ return this.Xe(() => t);
2894
2953
  };
2895
2954
  if (t === 0) {
2896
- if (this.Be !== 0) {
2955
+ if (this.Ze !== 0) {
2897
2956
  this.Ye.dispose(false);
2898
2957
  this.Je = [];
2899
2958
  this.qe = [];
2900
- this.Xe = [];
2901
- this.Be = 0;
2959
+ this.ze = [];
2960
+ this.Ze = 0;
2902
2961
  this.tt && (this.tt = []);
2903
2962
  this.nt && (this.nt = []);
2904
2963
  }
2905
- if (this.it && !this.Xe[0]) {
2906
- this.Xe[0] = runWithOwner((this.Je[0] = createOwner()), this.it);
2964
+ if (this.it && !this.ze[0]) {
2965
+ this.ze[0] = runWithOwner((this.Je[0] = createOwner()), this.it);
2907
2966
  }
2908
- } else if (this.Be === 0) {
2967
+ } else if (this.Ze === 0) {
2909
2968
  if (this.Je[0]) this.Je[0].dispose();
2910
- this.Xe = new Array(t);
2969
+ this.ze = new Array(t);
2911
2970
  for (i = 0; i < t; i++) {
2912
2971
  this.qe[i] = e[i];
2913
- this.Xe[i] = runWithOwner((this.Je[i] = createOwner()), r);
2972
+ this.ze[i] = runWithOwner((this.Je[i] = createOwner()), r);
2914
2973
  }
2915
- this.Be = t;
2974
+ this.Ze = t;
2916
2975
  } else {
2917
2976
  let s,
2918
2977
  o,
@@ -2926,20 +2985,20 @@ function updateKeyedMap() {
2926
2985
  T = this.tt ? new Array(t) : undefined,
2927
2986
  S = this.nt ? new Array(t) : undefined;
2928
2987
  for (
2929
- s = 0, o = Math.min(this.Be, t);
2988
+ s = 0, o = Math.min(this.Ze, t);
2930
2989
  s < o && (this.qe[s] === e[s] || (this.tt && compare(this.et, this.qe[s], e[s])));
2931
2990
  s++
2932
2991
  ) {
2933
2992
  if (this.tt) setSignal(this.tt[s], e[s]);
2934
2993
  }
2935
2994
  for (
2936
- o = this.Be - 1, u = t - 1;
2995
+ o = this.Ze - 1, u = t - 1;
2937
2996
  o >= s &&
2938
2997
  u >= s &&
2939
2998
  (this.qe[o] === e[u] || (this.tt && compare(this.et, this.qe[o], e[u])));
2940
2999
  o--, u--
2941
3000
  ) {
2942
- E[u] = this.Xe[o];
3001
+ E[u] = this.ze[o];
2943
3002
  d[u] = this.Je[o];
2944
3003
  T && (T[u] = this.tt[o]);
2945
3004
  S && (S[u] = this.nt[o]);
@@ -2958,7 +3017,7 @@ function updateKeyedMap() {
2958
3017
  a = this.et ? this.et(c) : c;
2959
3018
  i = l.get(a);
2960
3019
  if (i !== undefined && i !== -1) {
2961
- E[i] = this.Xe[n];
3020
+ E[i] = this.ze[n];
2962
3021
  d[i] = this.Je[n];
2963
3022
  T && (T[i] = this.tt[n]);
2964
3023
  S && (S[i] = this.nt[n]);
@@ -2968,7 +3027,7 @@ function updateKeyedMap() {
2968
3027
  }
2969
3028
  for (i = s; i < t; i++) {
2970
3029
  if (i in E) {
2971
- this.Xe[i] = E[i];
3030
+ this.ze[i] = E[i];
2972
3031
  this.Je[i] = d[i];
2973
3032
  if (T) {
2974
3033
  this.tt[i] = T[i];
@@ -2979,75 +3038,79 @@ function updateKeyedMap() {
2979
3038
  setSignal(this.nt[i], i);
2980
3039
  }
2981
3040
  } else {
2982
- this.Xe[i] = runWithOwner((this.Je[i] = createOwner()), r);
3041
+ this.ze[i] = runWithOwner((this.Je[i] = createOwner()), r);
2983
3042
  }
2984
3043
  }
2985
- this.Xe = this.Xe.slice(0, (this.Be = t));
3044
+ this.ze = this.ze.slice(0, (this.Ze = t));
2986
3045
  this.qe = e.slice(0);
2987
3046
  }
2988
3047
  });
2989
- return this.Xe;
3048
+ return this.ze;
2990
3049
  }
2991
3050
  function repeat(e, t, n) {
2992
3051
  const i = t;
2993
- return updateRepeat.bind({
2994
- Ye: createOwner(),
2995
- Be: 0,
2996
- rt: 0,
2997
- st: e,
2998
- ze: i,
2999
- Je: [],
3000
- Xe: [],
3001
- ot: n?.from,
3002
- it: n?.fallback
3003
- });
3052
+ const r = computed(
3053
+ updateRepeat.bind({
3054
+ Ye: createOwner(),
3055
+ Ze: 0,
3056
+ rt: 0,
3057
+ st: e,
3058
+ Xe: i,
3059
+ Je: [],
3060
+ ze: [],
3061
+ ot: n?.from,
3062
+ it: n?.fallback
3063
+ })
3064
+ );
3065
+ r.Pe = true;
3066
+ return accessor(r);
3004
3067
  }
3005
3068
  function updateRepeat() {
3006
3069
  const e = this.st();
3007
3070
  const t = this.ot?.() || 0;
3008
3071
  runWithOwner(this.Ye, () => {
3009
3072
  if (e === 0) {
3010
- if (this.Be !== 0) {
3073
+ if (this.Ze !== 0) {
3011
3074
  this.Ye.dispose(false);
3012
3075
  this.Je = [];
3013
- this.Xe = [];
3014
- this.Be = 0;
3076
+ this.ze = [];
3077
+ this.Ze = 0;
3015
3078
  }
3016
- if (this.it && !this.Xe[0]) {
3017
- this.Xe[0] = runWithOwner((this.Je[0] = createOwner()), this.it);
3079
+ if (this.it && !this.ze[0]) {
3080
+ this.ze[0] = runWithOwner((this.Je[0] = createOwner()), this.it);
3018
3081
  }
3019
3082
  return;
3020
3083
  }
3021
3084
  const n = t + e;
3022
- const i = this.rt + this.Be;
3023
- if (this.Be === 0 && this.Je[0]) this.Je[0].dispose();
3085
+ const i = this.rt + this.Ze;
3086
+ if (this.Ze === 0 && this.Je[0]) this.Je[0].dispose();
3024
3087
  for (let e = n; e < i; e++) this.Je[e - this.rt].dispose();
3025
3088
  if (this.rt < t) {
3026
3089
  let e = this.rt;
3027
- while (e < t && e < this.Be) this.Je[e++].dispose();
3090
+ while (e < t && e < this.Ze) this.Je[e++].dispose();
3028
3091
  this.Je.splice(0, t - this.rt);
3029
- this.Xe.splice(0, t - this.rt);
3092
+ this.ze.splice(0, t - this.rt);
3030
3093
  } else if (this.rt > t) {
3031
3094
  let n = i - this.rt - 1;
3032
3095
  let r = this.rt - t;
3033
- this.Je.length = this.Xe.length = e;
3096
+ this.Je.length = this.ze.length = e;
3034
3097
  while (n >= r) {
3035
3098
  this.Je[n] = this.Je[n - r];
3036
- this.Xe[n] = this.Xe[n - r];
3099
+ this.ze[n] = this.ze[n - r];
3037
3100
  n--;
3038
3101
  }
3039
3102
  for (let e = 0; e < r; e++) {
3040
- this.Xe[e] = runWithOwner((this.Je[e] = createOwner()), () => this.ze(e + t));
3103
+ this.ze[e] = runWithOwner((this.Je[e] = createOwner()), () => this.Xe(e + t));
3041
3104
  }
3042
3105
  }
3043
3106
  for (let e = i; e < n; e++) {
3044
- this.Xe[e - t] = runWithOwner((this.Je[e - t] = createOwner()), () => this.ze(e));
3107
+ this.ze[e - t] = runWithOwner((this.Je[e - t] = createOwner()), () => this.Xe(e));
3045
3108
  }
3046
- this.Xe = this.Xe.slice(0, e);
3109
+ this.ze = this.ze.slice(0, e);
3047
3110
  this.rt = t;
3048
- this.Be = e;
3111
+ this.Ze = e;
3049
3112
  });
3050
- return this.Xe;
3113
+ return this.ze;
3051
3114
  }
3052
3115
  function compare(e, t, n) {
3053
3116
  return e ? e(t) === e(n) : true;
@@ -3061,7 +3124,7 @@ function boundaryComputed(e, t) {
3061
3124
  n.F.notify(n, n.ut, i, r);
3062
3125
  };
3063
3126
  n.ut = t;
3064
- n.ge = true;
3127
+ n.Pe = true;
3065
3128
  recompute(n, true);
3066
3129
  return n;
3067
3130
  }
@@ -3098,10 +3161,10 @@ class RevealController {
3098
3161
  Ot;
3099
3162
  _t = [];
3100
3163
  dt;
3101
- ft = signal(false, { pureWrite: true, He: true });
3102
- Et = signal(false, { pureWrite: true, He: true });
3103
- ht = true;
3104
- It = false;
3164
+ ft = signal(false, { ownedWrite: true, He: true });
3165
+ Et = signal(false, { ownedWrite: true, He: true });
3166
+ It = true;
3167
+ ht = false;
3105
3168
  constructor(e, t) {
3106
3169
  this.Rt = e;
3107
3170
  this.Ot = t;
@@ -3121,7 +3184,7 @@ class RevealController {
3121
3184
  if (this._t.includes(e)) return;
3122
3185
  this._t.push(e);
3123
3186
  const t = !!untrack(this.Rt);
3124
- setSignal(e.ft, true), setSignal(e.Et, t ? false : !!untrack(this.Ot));
3187
+ (setSignal(e.ft, true), setSignal(e.Et, t ? false : !!untrack(this.Ot)));
3125
3188
  untrack(() => this.evaluate());
3126
3189
  }
3127
3190
  unregister(e) {
@@ -3130,9 +3193,9 @@ class RevealController {
3130
3193
  untrack(() => this.evaluate());
3131
3194
  }
3132
3195
  evaluate(e, t) {
3133
- if (this.It) return;
3134
- this.It = true;
3135
- const n = this.ht;
3196
+ if (this.ht) return;
3197
+ this.ht = true;
3198
+ const n = this.It;
3136
3199
  try {
3137
3200
  const n = e ?? read(this.ft),
3138
3201
  i = !!untrack(this.Ot),
@@ -3151,22 +3214,22 @@ class RevealController {
3151
3214
  });
3152
3215
  }
3153
3216
  } finally {
3154
- this.ht = this.isReady();
3155
- this.It = false;
3217
+ this.It = this.isReady();
3218
+ this.ht = false;
3156
3219
  }
3157
- if (this.dt && n !== this.ht) this.dt.evaluate();
3220
+ if (this.dt && n !== this.It) this.dt.evaluate();
3158
3221
  }
3159
3222
  }
3160
3223
  class CollectionQueue extends Queue {
3161
3224
  Nt;
3162
3225
  ct = new Set();
3163
- gt;
3226
+ Pt;
3164
3227
  lt = true;
3165
- ft = signal(false, { pureWrite: true, He: true });
3166
- Et = signal(false, { pureWrite: true, He: true });
3228
+ ft = signal(false, { ownedWrite: true, He: true });
3229
+ Et = signal(false, { ownedWrite: true, He: true });
3167
3230
  Tt;
3168
3231
  St = false;
3169
- Pt;
3232
+ gt;
3170
3233
  Ct = ON_INIT;
3171
3234
  constructor(e) {
3172
3235
  super();
@@ -3178,10 +3241,10 @@ class CollectionQueue extends Queue {
3178
3241
  }
3179
3242
  notify(e, t, n, i) {
3180
3243
  if (!(t & this.Nt)) return super.notify(e, t, n, i);
3181
- if (this.St && this.Pt) {
3244
+ if (this.St && this.gt) {
3182
3245
  const e = untrack(() => {
3183
3246
  try {
3184
- return this.Pt();
3247
+ return this.gt();
3185
3248
  } catch {
3186
3249
  return ON_INIT;
3187
3250
  }
@@ -3217,16 +3280,16 @@ class CollectionQueue extends Queue {
3217
3280
  this.ct.delete(e);
3218
3281
  }
3219
3282
  if (!this.ct.size) {
3220
- if (this.Nt & STATUS_PENDING && this.lt && !this.St && this.gt) {
3221
- this.lt = !!(this.gt.Se & this.Nt);
3283
+ if (this.Nt & STATUS_PENDING && this.lt && !this.St && this.Pt) {
3284
+ this.lt = !!(this.Pt.Se & this.Nt);
3222
3285
  } else {
3223
3286
  this.lt = false;
3224
3287
  }
3225
3288
  if (!this.lt) {
3226
3289
  setSignal(this.ft, false);
3227
- if (this.Pt) {
3290
+ if (this.gt) {
3228
3291
  try {
3229
- this.Ct = untrack(() => this.Pt());
3292
+ this.Ct = untrack(() => this.gt());
3230
3293
  } catch {}
3231
3294
  }
3232
3295
  }
@@ -3238,8 +3301,8 @@ function createCollectionBoundary(e, t, n, i) {
3238
3301
  const r = createOwner();
3239
3302
  if (_revealUsed) setContext(RevealControllerContext, null, r);
3240
3303
  const s = new CollectionQueue(e);
3241
- if (i) s.Pt = i;
3242
- const o = (s.gt = createBoundChildren(r, t, s, e));
3304
+ if (i) s.gt = i;
3305
+ const o = (s.Pt = createBoundChildren(r, t, s, e));
3243
3306
  untrack(() => {
3244
3307
  let t = false;
3245
3308
  try {
@@ -3259,7 +3322,7 @@ function createCollectionBoundary(e, t, n, i) {
3259
3322
  const c = computed(() => {
3260
3323
  if (!read(s.ft)) {
3261
3324
  const e = read(o);
3262
- if (!untrack(() => read(s.ft))) return (s.St = true), e;
3325
+ if (!untrack(() => read(s.ft))) return ((s.St = true), e);
3263
3326
  }
3264
3327
  if (_revealUsed && read(s.Et)) return undefined;
3265
3328
  return n(s);