@solidjs/signals 0.13.5 → 0.13.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.
- package/dist/dev.js +297 -228
- package/dist/node.cjs +497 -457
- package/dist/prod.js +605 -565
- package/dist/types/core/scheduler.d.ts +5 -5
- package/package.json +1 -1
package/dist/node.cjs
CHANGED
|
@@ -133,7 +133,7 @@ function adjustHeight(e, t) {
|
|
|
133
133
|
for (let t = e.A; t; t = t.N) {
|
|
134
134
|
const e = t.L;
|
|
135
135
|
const r = e.I || e;
|
|
136
|
-
if (r.
|
|
136
|
+
if (r.R && r.o >= n) n = r.o + 1;
|
|
137
137
|
}
|
|
138
138
|
if (e.o !== n) {
|
|
139
139
|
e.o = n;
|
|
@@ -156,7 +156,7 @@ function shouldReadStashedOptimisticValue(e) {
|
|
|
156
156
|
}
|
|
157
157
|
function runLaneEffects(e) {
|
|
158
158
|
for (const t of L) {
|
|
159
|
-
if (t.
|
|
159
|
+
if (t.T || t.H.size > 0) continue;
|
|
160
160
|
const n = t.q[e - 1];
|
|
161
161
|
if (n.length) {
|
|
162
162
|
t.q[e - 1] = [];
|
|
@@ -169,9 +169,9 @@ function queueStashedOptimisticEffects(e) {
|
|
|
169
169
|
const e = t.k;
|
|
170
170
|
if (!e.D) continue;
|
|
171
171
|
if (e.D === y) {
|
|
172
|
-
if (!e.
|
|
173
|
-
e.
|
|
174
|
-
e.
|
|
172
|
+
if (!e.F) {
|
|
173
|
+
e.F = true;
|
|
174
|
+
e.V.enqueue(g, e.M);
|
|
175
175
|
}
|
|
176
176
|
continue;
|
|
177
177
|
}
|
|
@@ -184,7 +184,7 @@ function setProjectionWriteActive(e) {
|
|
|
184
184
|
W = e;
|
|
185
185
|
}
|
|
186
186
|
function mergeTransitionState(e, t) {
|
|
187
|
-
t.
|
|
187
|
+
t.B = e;
|
|
188
188
|
e.G.push(...t.G);
|
|
189
189
|
for (const n of L) {
|
|
190
190
|
if (n.K === t) n.K = e;
|
|
@@ -214,7 +214,7 @@ function cleanupCompletedLanes(e) {
|
|
|
214
214
|
for (const t of L) {
|
|
215
215
|
const n = e ? t.K === e : !t.K;
|
|
216
216
|
if (!n) continue;
|
|
217
|
-
if (!t.
|
|
217
|
+
if (!t.T) {
|
|
218
218
|
if (t.q[0].length) runQueue(t.q[0], h);
|
|
219
219
|
if (t.q[1].length) runQueue(t.q[1], g);
|
|
220
220
|
}
|
|
@@ -231,20 +231,6 @@ function schedule() {
|
|
|
231
231
|
C = true;
|
|
232
232
|
if (!A.ne && !W) queueMicrotask(flush);
|
|
233
233
|
}
|
|
234
|
-
function addTransitionBlocker(e) {
|
|
235
|
-
if (k && !k.X.includes(e)) {
|
|
236
|
-
k.X.push(e);
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
function removeTransitionBlocker(e) {
|
|
240
|
-
const remove = t => {
|
|
241
|
-
if (!t) return;
|
|
242
|
-
const n = t.indexOf(e);
|
|
243
|
-
if (n >= 0) t.splice(n, 1);
|
|
244
|
-
};
|
|
245
|
-
remove(e.K?.X);
|
|
246
|
-
remove(k?.X);
|
|
247
|
-
}
|
|
248
234
|
class Queue {
|
|
249
235
|
i = null;
|
|
250
236
|
re = [[], []];
|
|
@@ -275,8 +261,8 @@ class Queue {
|
|
|
275
261
|
}
|
|
276
262
|
enqueue(e, t) {
|
|
277
263
|
if (e) {
|
|
278
|
-
if (
|
|
279
|
-
const n = findLane(
|
|
264
|
+
if (M) {
|
|
265
|
+
const n = findLane(M);
|
|
280
266
|
n.q[e - 1].push(t);
|
|
281
267
|
} else {
|
|
282
268
|
this.re[e - 1].push(t);
|
|
@@ -340,7 +326,7 @@ class GlobalQueue extends Queue {
|
|
|
340
326
|
j = new Set();
|
|
341
327
|
for (let t = 0; t < e.U.length; t++) {
|
|
342
328
|
const n = e.U[t];
|
|
343
|
-
if (n.
|
|
329
|
+
if (n.R || n.le) continue;
|
|
344
330
|
j.add(n);
|
|
345
331
|
queueStashedOptimisticEffects(n);
|
|
346
332
|
}
|
|
@@ -402,7 +388,7 @@ class GlobalQueue extends Queue {
|
|
|
402
388
|
J: new Set(),
|
|
403
389
|
G: [],
|
|
404
390
|
ce: { re: [[], []], ie: [] },
|
|
405
|
-
|
|
391
|
+
B: false
|
|
406
392
|
};
|
|
407
393
|
} else if (e) {
|
|
408
394
|
const t = k;
|
|
@@ -438,7 +424,7 @@ class GlobalQueue extends Queue {
|
|
|
438
424
|
}
|
|
439
425
|
}
|
|
440
426
|
function insertSubs(e, t = false) {
|
|
441
|
-
const n = e.Y ||
|
|
427
|
+
const n = e.Y || M;
|
|
442
428
|
const r = e.pe !== undefined;
|
|
443
429
|
for (let i = e.O; i !== null; i = i.P) {
|
|
444
430
|
if (r && i.k.he) {
|
|
@@ -454,9 +440,9 @@ function insertSubs(e, t = false) {
|
|
|
454
440
|
}
|
|
455
441
|
const e = i.k;
|
|
456
442
|
if (e.D === y) {
|
|
457
|
-
if (!e.
|
|
458
|
-
e.
|
|
459
|
-
e.
|
|
443
|
+
if (!e.F) {
|
|
444
|
+
e.F = true;
|
|
445
|
+
e.V.enqueue(g, e.M);
|
|
460
446
|
}
|
|
461
447
|
continue;
|
|
462
448
|
}
|
|
@@ -472,10 +458,10 @@ function commitPendingNodes() {
|
|
|
472
458
|
if (n.Z !== S) {
|
|
473
459
|
n.$ = n.Z;
|
|
474
460
|
n.Z = S;
|
|
475
|
-
if (n.D && n.D !== y) n.
|
|
461
|
+
if (n.D && n.D !== y) n.F = true;
|
|
476
462
|
}
|
|
477
463
|
if (!(n.ge & a)) n.ge &= ~p;
|
|
478
|
-
if (n.
|
|
464
|
+
if (n.R) GlobalQueue.ue(n, false, true);
|
|
479
465
|
}
|
|
480
466
|
e.length = 0;
|
|
481
467
|
}
|
|
@@ -515,6 +501,9 @@ function reassignPendingTransition(e) {
|
|
|
515
501
|
}
|
|
516
502
|
const A = new GlobalQueue();
|
|
517
503
|
function flush() {
|
|
504
|
+
if (A.ne) {
|
|
505
|
+
return;
|
|
506
|
+
}
|
|
518
507
|
while (C || k) {
|
|
519
508
|
A.flush();
|
|
520
509
|
}
|
|
@@ -523,7 +512,7 @@ function runQueue(e, t) {
|
|
|
523
512
|
for (let n = 0; n < e.length; n++) e[n](t);
|
|
524
513
|
}
|
|
525
514
|
function transitionComplete(e) {
|
|
526
|
-
if (e.
|
|
515
|
+
if (e.B) return true;
|
|
527
516
|
if (e.G.length) return false;
|
|
528
517
|
let t = true;
|
|
529
518
|
for (let n = 0; n < e.X.length; n++) {
|
|
@@ -533,11 +522,26 @@ function transitionComplete(e) {
|
|
|
533
522
|
break;
|
|
534
523
|
}
|
|
535
524
|
}
|
|
536
|
-
|
|
525
|
+
if (t) {
|
|
526
|
+
for (let n = 0; n < e.U.length; n++) {
|
|
527
|
+
const r = e.U[n];
|
|
528
|
+
if (
|
|
529
|
+
hasActiveOverride(r) &&
|
|
530
|
+
"ge" in r &&
|
|
531
|
+
r.ge & a &&
|
|
532
|
+
r.ae instanceof NotReadyError &&
|
|
533
|
+
r.ae.source !== r
|
|
534
|
+
) {
|
|
535
|
+
t = false;
|
|
536
|
+
break;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
t && (e.B = true);
|
|
537
541
|
return t;
|
|
538
542
|
}
|
|
539
543
|
function currentTransition(e) {
|
|
540
|
-
while (e.
|
|
544
|
+
while (e.B && typeof e.B === "object") e = e.B;
|
|
541
545
|
return e;
|
|
542
546
|
}
|
|
543
547
|
function setActiveTransition(e) {
|
|
@@ -561,21 +565,21 @@ function getOrCreateLane(e) {
|
|
|
561
565
|
}
|
|
562
566
|
const n = e.ye;
|
|
563
567
|
const r = n?.Y ? findLane(n.Y) : null;
|
|
564
|
-
t = { te: e, H: new Set(), q: [[], []],
|
|
568
|
+
t = { te: e, H: new Set(), q: [[], []], T: null, K: k, Se: r };
|
|
565
569
|
N.set(e, t);
|
|
566
570
|
L.add(t);
|
|
567
571
|
e.we = false;
|
|
568
572
|
return t;
|
|
569
573
|
}
|
|
570
574
|
function findLane(e) {
|
|
571
|
-
while (e.
|
|
575
|
+
while (e.T) e = e.T;
|
|
572
576
|
return e;
|
|
573
577
|
}
|
|
574
578
|
function mergeLanes(e, t) {
|
|
575
579
|
e = findLane(e);
|
|
576
580
|
t = findLane(t);
|
|
577
581
|
if (e === t) return e;
|
|
578
|
-
t.
|
|
582
|
+
t.T = e;
|
|
579
583
|
for (const n of t.H) e.H.add(n);
|
|
580
584
|
e.q[0].push(...t.q[0]);
|
|
581
585
|
e.q[1].push(...t.q[1]);
|
|
@@ -599,7 +603,7 @@ function assignOrMergeLane(e, t) {
|
|
|
599
603
|
const n = findLane(t);
|
|
600
604
|
const r = e.Y;
|
|
601
605
|
if (r) {
|
|
602
|
-
if (r.
|
|
606
|
+
if (r.T) {
|
|
603
607
|
e.Y = t;
|
|
604
608
|
return;
|
|
605
609
|
}
|
|
@@ -616,39 +620,230 @@ function assignOrMergeLane(e, t) {
|
|
|
616
620
|
}
|
|
617
621
|
e.Y = t;
|
|
618
622
|
}
|
|
623
|
+
function unlinkSubs(e) {
|
|
624
|
+
const t = e.L;
|
|
625
|
+
const n = e.N;
|
|
626
|
+
const r = e.P;
|
|
627
|
+
const i = e.me;
|
|
628
|
+
if (r !== null) r.me = i;
|
|
629
|
+
else t.be = i;
|
|
630
|
+
if (i !== null) i.P = r;
|
|
631
|
+
else {
|
|
632
|
+
t.O = r;
|
|
633
|
+
if (r === null) {
|
|
634
|
+
t._e?.();
|
|
635
|
+
t.R && !t.Oe && !(t.m & o) && unobserved(t);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
return n;
|
|
639
|
+
}
|
|
640
|
+
function unobserved(e) {
|
|
641
|
+
deleteFromHeap(e, e.m & o ? v : P);
|
|
642
|
+
let t = e.A;
|
|
643
|
+
while (t !== null) {
|
|
644
|
+
t = unlinkSubs(t);
|
|
645
|
+
}
|
|
646
|
+
e.A = null;
|
|
647
|
+
disposeChildren(e, true);
|
|
648
|
+
}
|
|
649
|
+
function link(e, t) {
|
|
650
|
+
const n = t.xe;
|
|
651
|
+
if (n !== null && n.L === e) return;
|
|
652
|
+
let i = null;
|
|
653
|
+
const s = t.m & r;
|
|
654
|
+
if (s) {
|
|
655
|
+
i = n !== null ? n.N : t.A;
|
|
656
|
+
if (i !== null && i.L === e) {
|
|
657
|
+
t.xe = i;
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
const o = e.be;
|
|
662
|
+
if (o !== null && o.k === t && (!s || isValidLink(o, t))) return;
|
|
663
|
+
const u = (t.xe = e.be = { L: e, k: t, N: i, me: o, P: null });
|
|
664
|
+
if (n !== null) n.N = u;
|
|
665
|
+
else t.A = u;
|
|
666
|
+
if (o !== null) o.P = u;
|
|
667
|
+
else e.O = u;
|
|
668
|
+
}
|
|
669
|
+
function isValidLink(e, t) {
|
|
670
|
+
const n = t.xe;
|
|
671
|
+
if (n !== null) {
|
|
672
|
+
let r = t.A;
|
|
673
|
+
do {
|
|
674
|
+
if (r === e) return true;
|
|
675
|
+
if (r === n) break;
|
|
676
|
+
r = r.N;
|
|
677
|
+
} while (r !== null);
|
|
678
|
+
}
|
|
679
|
+
return false;
|
|
680
|
+
}
|
|
681
|
+
const I = {};
|
|
682
|
+
function markDisposal(e) {
|
|
683
|
+
let t = e.Pe;
|
|
684
|
+
while (t) {
|
|
685
|
+
t.m |= o;
|
|
686
|
+
if (t.m & i) {
|
|
687
|
+
deleteFromHeap(t, P);
|
|
688
|
+
insertIntoHeap(t, v);
|
|
689
|
+
}
|
|
690
|
+
markDisposal(t);
|
|
691
|
+
t = t.ve;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
function dispose(e) {
|
|
695
|
+
let t = e.A || null;
|
|
696
|
+
do {
|
|
697
|
+
t = unlinkSubs(t);
|
|
698
|
+
} while (t !== null);
|
|
699
|
+
e.A = null;
|
|
700
|
+
e.xe = null;
|
|
701
|
+
disposeChildren(e, true);
|
|
702
|
+
}
|
|
703
|
+
function disposeChildren(e, t = false, n) {
|
|
704
|
+
if (e.m & u) return;
|
|
705
|
+
if (t) e.m = u;
|
|
706
|
+
if (t && e.R) e.Ee = null;
|
|
707
|
+
let r = n ? e.ke : e.Pe;
|
|
708
|
+
while (r) {
|
|
709
|
+
const e = r.ve;
|
|
710
|
+
if (r.A) {
|
|
711
|
+
const e = r;
|
|
712
|
+
deleteFromHeap(e, e.m & o ? v : P);
|
|
713
|
+
let t = e.A;
|
|
714
|
+
do {
|
|
715
|
+
t = unlinkSubs(t);
|
|
716
|
+
} while (t !== null);
|
|
717
|
+
e.A = null;
|
|
718
|
+
e.xe = null;
|
|
719
|
+
}
|
|
720
|
+
disposeChildren(r, true);
|
|
721
|
+
r = e;
|
|
722
|
+
}
|
|
723
|
+
if (n) {
|
|
724
|
+
e.ke = null;
|
|
725
|
+
} else {
|
|
726
|
+
e.Pe = null;
|
|
727
|
+
e.Ce = 0;
|
|
728
|
+
}
|
|
729
|
+
runDisposal(e, n);
|
|
730
|
+
}
|
|
731
|
+
function runDisposal(e, t) {
|
|
732
|
+
let n = t ? e.We : e.je;
|
|
733
|
+
if (!n) return;
|
|
734
|
+
if (Array.isArray(n)) {
|
|
735
|
+
for (let e = 0; e < n.length; e++) {
|
|
736
|
+
const t = n[e];
|
|
737
|
+
t.call(t);
|
|
738
|
+
}
|
|
739
|
+
} else {
|
|
740
|
+
n.call(n);
|
|
741
|
+
}
|
|
742
|
+
t ? (e.We = null) : (e.je = null);
|
|
743
|
+
}
|
|
744
|
+
function childId(e, t) {
|
|
745
|
+
let n = e;
|
|
746
|
+
while (n.Ae && n.i) n = n.i;
|
|
747
|
+
if (n.id != null) return formatId(n.id, t ? n.Ce++ : n.Ce);
|
|
748
|
+
throw new Error("Cannot get child id from owner without an id");
|
|
749
|
+
}
|
|
750
|
+
function getNextChildId(e) {
|
|
751
|
+
return childId(e, true);
|
|
752
|
+
}
|
|
753
|
+
function peekNextChildId(e) {
|
|
754
|
+
return childId(e, false);
|
|
755
|
+
}
|
|
756
|
+
function formatId(e, t) {
|
|
757
|
+
const n = t.toString(36),
|
|
758
|
+
r = n.length - 1;
|
|
759
|
+
return e + (r ? String.fromCharCode(64 + r) : "") + n;
|
|
760
|
+
}
|
|
761
|
+
function getObserver() {
|
|
762
|
+
if (q || F) return I;
|
|
763
|
+
return T ? V : null;
|
|
764
|
+
}
|
|
765
|
+
function getOwner() {
|
|
766
|
+
return V;
|
|
767
|
+
}
|
|
768
|
+
function cleanup(e) {
|
|
769
|
+
if (!V) return e;
|
|
770
|
+
if (!V.je) V.je = e;
|
|
771
|
+
else if (Array.isArray(V.je)) V.je.push(e);
|
|
772
|
+
else V.je = [V.je, e];
|
|
773
|
+
return e;
|
|
774
|
+
}
|
|
775
|
+
function isDisposed(e) {
|
|
776
|
+
return !!(e.m & (u | o));
|
|
777
|
+
}
|
|
778
|
+
function createOwner(e) {
|
|
779
|
+
const t = V;
|
|
780
|
+
const n = e?.transparent ?? false;
|
|
781
|
+
const r = {
|
|
782
|
+
id: e?.id ?? (n ? t?.id : t?.id != null ? getNextChildId(t) : undefined),
|
|
783
|
+
Ae: n || undefined,
|
|
784
|
+
t: true,
|
|
785
|
+
u: t?.t ? t.u : t,
|
|
786
|
+
Pe: null,
|
|
787
|
+
ve: null,
|
|
788
|
+
je: null,
|
|
789
|
+
V: t?.V ?? A,
|
|
790
|
+
Ne: t?.Ne || _,
|
|
791
|
+
Ce: 0,
|
|
792
|
+
We: null,
|
|
793
|
+
ke: null,
|
|
794
|
+
i: t,
|
|
795
|
+
dispose(e = true) {
|
|
796
|
+
disposeChildren(r, e);
|
|
797
|
+
}
|
|
798
|
+
};
|
|
799
|
+
if (t) {
|
|
800
|
+
const e = t.Pe;
|
|
801
|
+
if (e === null) {
|
|
802
|
+
t.Pe = r;
|
|
803
|
+
} else {
|
|
804
|
+
r.ve = e;
|
|
805
|
+
t.Pe = r;
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
return r;
|
|
809
|
+
}
|
|
810
|
+
function createRoot(e, t) {
|
|
811
|
+
const n = createOwner(t);
|
|
812
|
+
return runWithOwner(n, () => e(n.dispose));
|
|
813
|
+
}
|
|
619
814
|
function addPendingSource(e, t) {
|
|
620
|
-
if (e.
|
|
621
|
-
if (!e.
|
|
622
|
-
e.
|
|
815
|
+
if (e.Le === t || e.Ie?.has(t)) return false;
|
|
816
|
+
if (!e.Le) {
|
|
817
|
+
e.Le = t;
|
|
623
818
|
return true;
|
|
624
819
|
}
|
|
625
|
-
if (!e.
|
|
626
|
-
e.
|
|
820
|
+
if (!e.Ie) {
|
|
821
|
+
e.Ie = new Set([e.Le, t]);
|
|
627
822
|
} else {
|
|
628
|
-
e.
|
|
823
|
+
e.Ie.add(t);
|
|
629
824
|
}
|
|
630
|
-
e.
|
|
825
|
+
e.Le = undefined;
|
|
631
826
|
return true;
|
|
632
827
|
}
|
|
633
828
|
function removePendingSource(e, t) {
|
|
634
|
-
if (e.
|
|
635
|
-
if (e.
|
|
636
|
-
e.
|
|
829
|
+
if (e.Le) {
|
|
830
|
+
if (e.Le !== t) return false;
|
|
831
|
+
e.Le = undefined;
|
|
637
832
|
return true;
|
|
638
833
|
}
|
|
639
|
-
if (!e.
|
|
640
|
-
if (e.
|
|
641
|
-
e.
|
|
642
|
-
e.
|
|
643
|
-
} else if (e.
|
|
644
|
-
e.
|
|
834
|
+
if (!e.Ie?.delete(t)) return false;
|
|
835
|
+
if (e.Ie.size === 1) {
|
|
836
|
+
e.Le = e.Ie.values().next().value;
|
|
837
|
+
e.Ie = undefined;
|
|
838
|
+
} else if (e.Ie.size === 0) {
|
|
839
|
+
e.Ie = undefined;
|
|
645
840
|
}
|
|
646
841
|
return true;
|
|
647
842
|
}
|
|
648
843
|
function clearPendingSources(e) {
|
|
649
|
-
e.
|
|
650
|
-
e.
|
|
651
|
-
e.
|
|
844
|
+
e.Le = undefined;
|
|
845
|
+
e.Ie?.clear();
|
|
846
|
+
e.Ie = undefined;
|
|
652
847
|
}
|
|
653
848
|
function setPendingError(e, t, n) {
|
|
654
849
|
if (!t) {
|
|
@@ -677,7 +872,7 @@ function settlePendingSource(e) {
|
|
|
677
872
|
if (n.has(r) || !removePendingSource(r, e)) return;
|
|
678
873
|
n.add(r);
|
|
679
874
|
r.de = E;
|
|
680
|
-
const i = r.
|
|
875
|
+
const i = r.Le ?? r.Ie?.values().next().value;
|
|
681
876
|
if (i) {
|
|
682
877
|
setPendingError(r, i);
|
|
683
878
|
updatePendingSignal(r);
|
|
@@ -685,12 +880,12 @@ function settlePendingSource(e) {
|
|
|
685
880
|
r.ge &= ~a;
|
|
686
881
|
setPendingError(r);
|
|
687
882
|
updatePendingSignal(r);
|
|
688
|
-
if (r.
|
|
883
|
+
if (r.Re) {
|
|
689
884
|
if (r.D === y) {
|
|
690
885
|
const e = r;
|
|
691
|
-
if (!e.
|
|
692
|
-
e.
|
|
693
|
-
e.
|
|
886
|
+
if (!e.F) {
|
|
887
|
+
e.F = true;
|
|
888
|
+
e.V.enqueue(g, e.M);
|
|
694
889
|
}
|
|
695
890
|
} else {
|
|
696
891
|
const e = r.m & o ? v : P;
|
|
@@ -699,7 +894,7 @@ function settlePendingSource(e) {
|
|
|
699
894
|
}
|
|
700
895
|
t = true;
|
|
701
896
|
}
|
|
702
|
-
r.
|
|
897
|
+
r.Re = false;
|
|
703
898
|
}
|
|
704
899
|
forEachDependent(r, settle);
|
|
705
900
|
};
|
|
@@ -711,19 +906,19 @@ function handleAsync(e, t, r) {
|
|
|
711
906
|
const s = i && untrack(() => t[Symbol.asyncIterator]);
|
|
712
907
|
const o = !s && i && untrack(() => typeof t.then === "function");
|
|
713
908
|
if (!o && !s) {
|
|
714
|
-
e.
|
|
909
|
+
e.Ee = null;
|
|
715
910
|
return t;
|
|
716
911
|
}
|
|
717
|
-
e.
|
|
912
|
+
e.Ee = t;
|
|
718
913
|
let u;
|
|
719
914
|
const handleError = n => {
|
|
720
|
-
if (e.
|
|
915
|
+
if (e.Ee !== t) return;
|
|
721
916
|
A.initTransition(resolveTransition(e));
|
|
722
917
|
notifyStatus(e, n instanceof NotReadyError ? a : d, n);
|
|
723
918
|
e.de = E;
|
|
724
919
|
};
|
|
725
920
|
const asyncWrite = (i, s) => {
|
|
726
|
-
if (e.
|
|
921
|
+
if (e.Ee !== t) return;
|
|
727
922
|
if (e.m & (n | f)) return;
|
|
728
923
|
A.initTransition(resolveTransition(e));
|
|
729
924
|
clearStatus(e);
|
|
@@ -739,12 +934,12 @@ function handleAsync(e, t, r) {
|
|
|
739
934
|
e.de = E;
|
|
740
935
|
} else if (o) {
|
|
741
936
|
const t = e.$;
|
|
742
|
-
const n = e.
|
|
937
|
+
const n = e.Te;
|
|
743
938
|
if (!n || !n(i, t)) {
|
|
744
939
|
e.$ = i;
|
|
745
940
|
e.de = E;
|
|
746
|
-
if (e.
|
|
747
|
-
setSignal(e.
|
|
941
|
+
if (e.He) {
|
|
942
|
+
setSignal(e.He, i);
|
|
748
943
|
}
|
|
749
944
|
insertSubs(e, true);
|
|
750
945
|
}
|
|
@@ -773,55 +968,72 @@ function handleAsync(e, t, r) {
|
|
|
773
968
|
r = false;
|
|
774
969
|
if (!n) {
|
|
775
970
|
A.initTransition(resolveTransition(e));
|
|
776
|
-
throw new NotReadyError(
|
|
971
|
+
throw new NotReadyError(V);
|
|
777
972
|
}
|
|
778
973
|
}
|
|
779
974
|
if (s) {
|
|
780
975
|
const n = t[Symbol.asyncIterator]();
|
|
781
976
|
let r = false;
|
|
977
|
+
let i = false;
|
|
978
|
+
cleanup(() => {
|
|
979
|
+
if (i) return;
|
|
980
|
+
i = true;
|
|
981
|
+
try {
|
|
982
|
+
const e = n.return?.();
|
|
983
|
+
if (e && typeof e.then === "function") {
|
|
984
|
+
e.then(undefined, () => {});
|
|
985
|
+
}
|
|
986
|
+
} catch {}
|
|
987
|
+
});
|
|
782
988
|
const iterate = () => {
|
|
783
|
-
let
|
|
784
|
-
|
|
785
|
-
|
|
989
|
+
let s,
|
|
990
|
+
o = false,
|
|
991
|
+
f = true;
|
|
786
992
|
n.next().then(
|
|
787
993
|
n => {
|
|
788
|
-
if (
|
|
789
|
-
|
|
790
|
-
|
|
994
|
+
if (f) {
|
|
995
|
+
s = n;
|
|
996
|
+
o = true;
|
|
997
|
+
if (n.done) i = true;
|
|
998
|
+
} else if (e.Ee !== t) {
|
|
999
|
+
return;
|
|
791
1000
|
} else if (!n.done) asyncWrite(n.value, iterate);
|
|
792
1001
|
else {
|
|
1002
|
+
i = true;
|
|
793
1003
|
schedule();
|
|
794
1004
|
flush();
|
|
795
1005
|
}
|
|
796
1006
|
},
|
|
797
|
-
|
|
798
|
-
if (!
|
|
1007
|
+
n => {
|
|
1008
|
+
if (!f && e.Ee === t) {
|
|
1009
|
+
i = true;
|
|
1010
|
+
handleError(n);
|
|
1011
|
+
}
|
|
799
1012
|
}
|
|
800
1013
|
);
|
|
801
|
-
|
|
802
|
-
if (
|
|
803
|
-
u =
|
|
1014
|
+
f = false;
|
|
1015
|
+
if (o && !s.done) {
|
|
1016
|
+
u = s.value;
|
|
804
1017
|
r = true;
|
|
805
1018
|
return iterate();
|
|
806
1019
|
}
|
|
807
|
-
return
|
|
1020
|
+
return o && s.done;
|
|
808
1021
|
};
|
|
809
|
-
const
|
|
810
|
-
if (!r && !
|
|
1022
|
+
const s = iterate();
|
|
1023
|
+
if (!r && !s) {
|
|
811
1024
|
A.initTransition(resolveTransition(e));
|
|
812
|
-
throw new NotReadyError(
|
|
1025
|
+
throw new NotReadyError(V);
|
|
813
1026
|
}
|
|
814
1027
|
}
|
|
815
1028
|
return u;
|
|
816
1029
|
}
|
|
817
1030
|
function clearStatus(e, t = false) {
|
|
818
1031
|
clearPendingSources(e);
|
|
819
|
-
|
|
820
|
-
e._e = false;
|
|
1032
|
+
e.Re = false;
|
|
821
1033
|
e.ge = t ? 0 : e.ge & p;
|
|
822
1034
|
setPendingError(e);
|
|
823
1035
|
updatePendingSignal(e);
|
|
824
|
-
e.
|
|
1036
|
+
e.Qe?.();
|
|
825
1037
|
}
|
|
826
1038
|
function notifyStatus(e, t, n, r, i) {
|
|
827
1039
|
if (t === d && !(n instanceof StatusError) && !(n instanceof NotReadyError))
|
|
@@ -834,11 +1046,9 @@ function notifyStatus(e, t, n, r, i) {
|
|
|
834
1046
|
if (t === a && s) {
|
|
835
1047
|
addPendingSource(e, s);
|
|
836
1048
|
e.ge = a | (e.ge & p);
|
|
837
|
-
setPendingError(e,
|
|
838
|
-
if (s === e) addTransitionBlocker(e);
|
|
1049
|
+
setPendingError(e, s, n);
|
|
839
1050
|
} else {
|
|
840
1051
|
clearPendingSources(e);
|
|
841
|
-
removeTransitionBlocker(e);
|
|
842
1052
|
e.ge = t | (t !== d ? e.ge & p : 0);
|
|
843
1053
|
e.ae = n;
|
|
844
1054
|
}
|
|
@@ -849,31 +1059,34 @@ function notifyStatus(e, t, n, r, i) {
|
|
|
849
1059
|
}
|
|
850
1060
|
const c = r || f;
|
|
851
1061
|
const l = r || u ? undefined : i;
|
|
852
|
-
if (e.
|
|
1062
|
+
if (e.Qe) {
|
|
1063
|
+
if (r && t === a) {
|
|
1064
|
+
return;
|
|
1065
|
+
}
|
|
853
1066
|
if (c) {
|
|
854
|
-
e.
|
|
1067
|
+
e.Qe(t, n);
|
|
855
1068
|
} else {
|
|
856
|
-
e.
|
|
1069
|
+
e.Qe();
|
|
857
1070
|
}
|
|
858
1071
|
return;
|
|
859
1072
|
}
|
|
860
1073
|
forEachDependent(e, e => {
|
|
861
1074
|
e.de = E;
|
|
862
1075
|
if (
|
|
863
|
-
(t === a && s && e.
|
|
864
|
-
(t !== a && (e.ae !== n || e.
|
|
1076
|
+
(t === a && s && e.Le !== s && !e.Ie?.has(s)) ||
|
|
1077
|
+
(t !== a && (e.ae !== n || e.Le || e.Ie))
|
|
865
1078
|
) {
|
|
866
|
-
!e.K
|
|
1079
|
+
if (!c && !e.K) A.se.push(e);
|
|
867
1080
|
notifyStatus(e, t, n, c, l);
|
|
868
1081
|
}
|
|
869
1082
|
});
|
|
870
1083
|
}
|
|
871
|
-
let
|
|
1084
|
+
let R = null;
|
|
872
1085
|
function enableExternalSource(e) {
|
|
873
1086
|
const { factory: t, untrack: n = e => e() } = e;
|
|
874
|
-
if (
|
|
875
|
-
const { factory: e, untrack: r } =
|
|
876
|
-
|
|
1087
|
+
if (R) {
|
|
1088
|
+
const { factory: e, untrack: r } = R;
|
|
1089
|
+
R = {
|
|
877
1090
|
factory: (n, r) => {
|
|
878
1091
|
const i = e(n, r);
|
|
879
1092
|
const s = t(e => i.track(e), r);
|
|
@@ -888,210 +1101,20 @@ function enableExternalSource(e) {
|
|
|
888
1101
|
untrack: e => r(() => n(e))
|
|
889
1102
|
};
|
|
890
1103
|
} else {
|
|
891
|
-
|
|
1104
|
+
R = { factory: t, untrack: n };
|
|
892
1105
|
}
|
|
893
1106
|
}
|
|
894
|
-
const T = {};
|
|
895
|
-
function markDisposal(e) {
|
|
896
|
-
let t = e.Ee;
|
|
897
|
-
while (t) {
|
|
898
|
-
t.m |= o;
|
|
899
|
-
if (t.m & i) {
|
|
900
|
-
deleteFromHeap(t, P);
|
|
901
|
-
insertIntoHeap(t, v);
|
|
902
|
-
}
|
|
903
|
-
markDisposal(t);
|
|
904
|
-
t = t.ke;
|
|
905
|
-
}
|
|
906
|
-
}
|
|
907
|
-
function dispose(e) {
|
|
908
|
-
let t = e.A || null;
|
|
909
|
-
do {
|
|
910
|
-
t = unlinkSubs(t);
|
|
911
|
-
} while (t !== null);
|
|
912
|
-
e.A = null;
|
|
913
|
-
e.Ce = null;
|
|
914
|
-
disposeChildren(e, true);
|
|
915
|
-
}
|
|
916
|
-
function disposeChildren(e, t = false, n) {
|
|
917
|
-
if (e.m & u) return;
|
|
918
|
-
if (t) e.m = u;
|
|
919
|
-
let r = n ? e.We : e.Ee;
|
|
920
|
-
while (r) {
|
|
921
|
-
const e = r.ke;
|
|
922
|
-
if (r.A) {
|
|
923
|
-
const e = r;
|
|
924
|
-
deleteFromHeap(e, e.m & o ? v : P);
|
|
925
|
-
let t = e.A;
|
|
926
|
-
do {
|
|
927
|
-
t = unlinkSubs(t);
|
|
928
|
-
} while (t !== null);
|
|
929
|
-
e.A = null;
|
|
930
|
-
e.Ce = null;
|
|
931
|
-
}
|
|
932
|
-
disposeChildren(r, true);
|
|
933
|
-
r = e;
|
|
934
|
-
}
|
|
935
|
-
if (n) {
|
|
936
|
-
e.We = null;
|
|
937
|
-
} else {
|
|
938
|
-
e.Ee = null;
|
|
939
|
-
e.je = 0;
|
|
940
|
-
}
|
|
941
|
-
runDisposal(e, n);
|
|
942
|
-
}
|
|
943
|
-
function runDisposal(e, t) {
|
|
944
|
-
let n = t ? e.Ae : e.Ne;
|
|
945
|
-
if (!n) return;
|
|
946
|
-
if (Array.isArray(n)) {
|
|
947
|
-
for (let e = 0; e < n.length; e++) {
|
|
948
|
-
const t = n[e];
|
|
949
|
-
t.call(t);
|
|
950
|
-
}
|
|
951
|
-
} else {
|
|
952
|
-
n.call(n);
|
|
953
|
-
}
|
|
954
|
-
t ? (e.Ae = null) : (e.Ne = null);
|
|
955
|
-
}
|
|
956
|
-
function childId(e, t) {
|
|
957
|
-
let n = e;
|
|
958
|
-
while (n.Le && n.i) n = n.i;
|
|
959
|
-
if (n.id != null) return formatId(n.id, t ? n.je++ : n.je);
|
|
960
|
-
throw new Error("Cannot get child id from owner without an id");
|
|
961
|
-
}
|
|
962
|
-
function getNextChildId(e) {
|
|
963
|
-
return childId(e, true);
|
|
964
|
-
}
|
|
965
|
-
function peekNextChildId(e) {
|
|
966
|
-
return childId(e, false);
|
|
967
|
-
}
|
|
968
|
-
function formatId(e, t) {
|
|
969
|
-
const n = t.toString(36),
|
|
970
|
-
r = n.length - 1;
|
|
971
|
-
return e + (r ? String.fromCharCode(64 + r) : "") + n;
|
|
972
|
-
}
|
|
973
|
-
function getObserver() {
|
|
974
|
-
if (q || V) return T;
|
|
975
|
-
return R ? B : null;
|
|
976
|
-
}
|
|
977
|
-
function getOwner() {
|
|
978
|
-
return B;
|
|
979
|
-
}
|
|
980
|
-
function cleanup(e) {
|
|
981
|
-
if (!B) return e;
|
|
982
|
-
if (!B.Ne) B.Ne = e;
|
|
983
|
-
else if (Array.isArray(B.Ne)) B.Ne.push(e);
|
|
984
|
-
else B.Ne = [B.Ne, e];
|
|
985
|
-
return e;
|
|
986
|
-
}
|
|
987
|
-
function isDisposed(e) {
|
|
988
|
-
return !!(e.m & (u | o));
|
|
989
|
-
}
|
|
990
|
-
function createOwner(e) {
|
|
991
|
-
const t = B;
|
|
992
|
-
const n = e?.transparent ?? false;
|
|
993
|
-
const r = {
|
|
994
|
-
id: e?.id ?? (n ? t?.id : t?.id != null ? getNextChildId(t) : undefined),
|
|
995
|
-
Le: n || undefined,
|
|
996
|
-
t: true,
|
|
997
|
-
u: t?.t ? t.u : t,
|
|
998
|
-
Ee: null,
|
|
999
|
-
ke: null,
|
|
1000
|
-
Ne: null,
|
|
1001
|
-
B: t?.B ?? A,
|
|
1002
|
-
Ie: t?.Ie || _,
|
|
1003
|
-
je: 0,
|
|
1004
|
-
Ae: null,
|
|
1005
|
-
We: null,
|
|
1006
|
-
i: t,
|
|
1007
|
-
dispose(e = true) {
|
|
1008
|
-
disposeChildren(r, e);
|
|
1009
|
-
}
|
|
1010
|
-
};
|
|
1011
|
-
if (t) {
|
|
1012
|
-
const e = t.Ee;
|
|
1013
|
-
if (e === null) {
|
|
1014
|
-
t.Ee = r;
|
|
1015
|
-
} else {
|
|
1016
|
-
r.ke = e;
|
|
1017
|
-
t.Ee = r;
|
|
1018
|
-
}
|
|
1019
|
-
}
|
|
1020
|
-
return r;
|
|
1021
|
-
}
|
|
1022
|
-
function createRoot(e, t) {
|
|
1023
|
-
const n = createOwner(t);
|
|
1024
|
-
return runWithOwner(n, () => e(n.dispose));
|
|
1025
|
-
}
|
|
1026
|
-
function unlinkSubs(e) {
|
|
1027
|
-
const t = e.L;
|
|
1028
|
-
const n = e.N;
|
|
1029
|
-
const r = e.P;
|
|
1030
|
-
const i = e.Te;
|
|
1031
|
-
if (r !== null) r.Te = i;
|
|
1032
|
-
else t.Re = i;
|
|
1033
|
-
if (i !== null) i.P = r;
|
|
1034
|
-
else {
|
|
1035
|
-
t.O = r;
|
|
1036
|
-
if (r === null) {
|
|
1037
|
-
t.He?.();
|
|
1038
|
-
t.T && !t.Qe && !(t.m & o) && unobserved(t);
|
|
1039
|
-
}
|
|
1040
|
-
}
|
|
1041
|
-
return n;
|
|
1042
|
-
}
|
|
1043
|
-
function unobserved(e) {
|
|
1044
|
-
deleteFromHeap(e, e.m & o ? v : P);
|
|
1045
|
-
let t = e.A;
|
|
1046
|
-
while (t !== null) {
|
|
1047
|
-
t = unlinkSubs(t);
|
|
1048
|
-
}
|
|
1049
|
-
e.A = null;
|
|
1050
|
-
disposeChildren(e, true);
|
|
1051
|
-
}
|
|
1052
|
-
function link(e, t) {
|
|
1053
|
-
const n = t.Ce;
|
|
1054
|
-
if (n !== null && n.L === e) return;
|
|
1055
|
-
let i = null;
|
|
1056
|
-
const s = t.m & r;
|
|
1057
|
-
if (s) {
|
|
1058
|
-
i = n !== null ? n.N : t.A;
|
|
1059
|
-
if (i !== null && i.L === e) {
|
|
1060
|
-
t.Ce = i;
|
|
1061
|
-
return;
|
|
1062
|
-
}
|
|
1063
|
-
}
|
|
1064
|
-
const o = e.Re;
|
|
1065
|
-
if (o !== null && o.k === t && (!s || isValidLink(o, t))) return;
|
|
1066
|
-
const u = (t.Ce = e.Re = { L: e, k: t, N: i, Te: o, P: null });
|
|
1067
|
-
if (n !== null) n.N = u;
|
|
1068
|
-
else t.A = u;
|
|
1069
|
-
if (o !== null) o.P = u;
|
|
1070
|
-
else e.O = u;
|
|
1071
|
-
}
|
|
1072
|
-
function isValidLink(e, t) {
|
|
1073
|
-
const n = t.Ce;
|
|
1074
|
-
if (n !== null) {
|
|
1075
|
-
let r = t.A;
|
|
1076
|
-
do {
|
|
1077
|
-
if (r === e) return true;
|
|
1078
|
-
if (r === n) break;
|
|
1079
|
-
r = r.N;
|
|
1080
|
-
} while (r !== null);
|
|
1081
|
-
}
|
|
1082
|
-
return false;
|
|
1083
|
-
}
|
|
1084
1107
|
GlobalQueue.oe = recompute;
|
|
1085
1108
|
GlobalQueue.ue = disposeChildren;
|
|
1086
|
-
let
|
|
1109
|
+
let T = false;
|
|
1087
1110
|
let H = false;
|
|
1088
1111
|
let Q = false;
|
|
1089
1112
|
let q = false;
|
|
1090
1113
|
let D = false;
|
|
1091
|
-
let
|
|
1092
|
-
let
|
|
1093
|
-
let
|
|
1094
|
-
let
|
|
1114
|
+
let F = false;
|
|
1115
|
+
let V = null;
|
|
1116
|
+
let M = null;
|
|
1117
|
+
let B = false;
|
|
1095
1118
|
let G = null;
|
|
1096
1119
|
function ownerInSnapshotScope(e) {
|
|
1097
1120
|
while (e) {
|
|
@@ -1101,7 +1124,7 @@ function ownerInSnapshotScope(e) {
|
|
|
1101
1124
|
return false;
|
|
1102
1125
|
}
|
|
1103
1126
|
function setSnapshotCapture(e) {
|
|
1104
|
-
|
|
1127
|
+
B = e;
|
|
1105
1128
|
if (e && !G) G = new Set();
|
|
1106
1129
|
}
|
|
1107
1130
|
function markSnapshotScope(e) {
|
|
@@ -1113,13 +1136,13 @@ function releaseSnapshotScope(e) {
|
|
|
1113
1136
|
schedule();
|
|
1114
1137
|
}
|
|
1115
1138
|
function releaseSubtree(e) {
|
|
1116
|
-
let t = e.
|
|
1139
|
+
let t = e.Pe;
|
|
1117
1140
|
while (t) {
|
|
1118
1141
|
if (t.qe) {
|
|
1119
|
-
t = t.
|
|
1142
|
+
t = t.ve;
|
|
1120
1143
|
continue;
|
|
1121
1144
|
}
|
|
1122
|
-
if (t.
|
|
1145
|
+
if (t.R) {
|
|
1123
1146
|
const e = t;
|
|
1124
1147
|
e.he = false;
|
|
1125
1148
|
if (e.m & c) {
|
|
@@ -1130,7 +1153,7 @@ function releaseSubtree(e) {
|
|
|
1130
1153
|
}
|
|
1131
1154
|
}
|
|
1132
1155
|
releaseSubtree(t);
|
|
1133
|
-
t = t.
|
|
1156
|
+
t = t.ve;
|
|
1134
1157
|
}
|
|
1135
1158
|
}
|
|
1136
1159
|
function clearSnapshots() {
|
|
@@ -1141,42 +1164,43 @@ function clearSnapshots() {
|
|
|
1141
1164
|
}
|
|
1142
1165
|
G = null;
|
|
1143
1166
|
}
|
|
1144
|
-
|
|
1167
|
+
B = false;
|
|
1145
1168
|
}
|
|
1146
1169
|
function recompute(t, n = false) {
|
|
1147
1170
|
const i = t.D;
|
|
1148
1171
|
if (!n) {
|
|
1149
1172
|
if (t.K && (!i || k) && k !== t.K) A.initTransition(t.K);
|
|
1150
1173
|
deleteFromHeap(t, t.m & o ? v : P);
|
|
1174
|
+
t.Ee = null;
|
|
1151
1175
|
if (t.K || i === y) disposeChildren(t);
|
|
1152
1176
|
else {
|
|
1153
1177
|
markDisposal(t);
|
|
1154
|
-
t.
|
|
1155
|
-
t.
|
|
1156
|
-
t.
|
|
1157
|
-
t.
|
|
1158
|
-
t.
|
|
1178
|
+
t.We = t.je;
|
|
1179
|
+
t.ke = t.Pe;
|
|
1180
|
+
t.je = null;
|
|
1181
|
+
t.Pe = null;
|
|
1182
|
+
t.Ce = 0;
|
|
1159
1183
|
}
|
|
1160
1184
|
}
|
|
1161
1185
|
const s = !!(t.m & f);
|
|
1162
1186
|
const u = t.ee !== undefined && t.ee !== S;
|
|
1163
1187
|
const l = !!(t.ge & a);
|
|
1164
|
-
const p =
|
|
1165
|
-
|
|
1166
|
-
t.
|
|
1188
|
+
const p = V;
|
|
1189
|
+
V = t;
|
|
1190
|
+
t.xe = null;
|
|
1167
1191
|
t.m = r;
|
|
1168
1192
|
t.de = E;
|
|
1169
1193
|
let h = t.Z === S ? t.$ : t.Z;
|
|
1170
1194
|
let g = t.o;
|
|
1171
|
-
let w =
|
|
1172
|
-
let m =
|
|
1173
|
-
|
|
1195
|
+
let w = T;
|
|
1196
|
+
let m = M;
|
|
1197
|
+
T = true;
|
|
1174
1198
|
if (s) {
|
|
1175
1199
|
const e = resolveLane(t);
|
|
1176
|
-
if (e)
|
|
1200
|
+
if (e) M = e;
|
|
1177
1201
|
}
|
|
1178
1202
|
try {
|
|
1179
|
-
h = handleAsync(t, t.
|
|
1203
|
+
h = handleAsync(t, t.R(h));
|
|
1180
1204
|
clearStatus(t, n);
|
|
1181
1205
|
const e = resolveLane(t);
|
|
1182
1206
|
if (e) {
|
|
@@ -1184,15 +1208,15 @@ function recompute(t, n = false) {
|
|
|
1184
1208
|
updatePendingSignal(e.te);
|
|
1185
1209
|
}
|
|
1186
1210
|
} catch (e) {
|
|
1187
|
-
if (e instanceof NotReadyError &&
|
|
1188
|
-
const e = findLane(
|
|
1211
|
+
if (e instanceof NotReadyError && M) {
|
|
1212
|
+
const e = findLane(M);
|
|
1189
1213
|
if (e.te !== t) {
|
|
1190
1214
|
e.H.add(t);
|
|
1191
1215
|
t.Y = e;
|
|
1192
1216
|
updatePendingSignal(e.te);
|
|
1193
1217
|
}
|
|
1194
1218
|
}
|
|
1195
|
-
if (e instanceof NotReadyError) t.
|
|
1219
|
+
if (e instanceof NotReadyError) t.Re = true;
|
|
1196
1220
|
notifyStatus(
|
|
1197
1221
|
t,
|
|
1198
1222
|
e instanceof NotReadyError ? a : d,
|
|
@@ -1201,12 +1225,12 @@ function recompute(t, n = false) {
|
|
|
1201
1225
|
e instanceof NotReadyError ? t.Y : undefined
|
|
1202
1226
|
);
|
|
1203
1227
|
} finally {
|
|
1204
|
-
|
|
1228
|
+
T = w;
|
|
1205
1229
|
t.m = e | (n ? t.m & c : 0);
|
|
1206
|
-
|
|
1230
|
+
V = p;
|
|
1207
1231
|
}
|
|
1208
1232
|
if (!t.ae) {
|
|
1209
|
-
const e = t.
|
|
1233
|
+
const e = t.xe;
|
|
1210
1234
|
let r = e !== null ? e.N : t.A;
|
|
1211
1235
|
if (r !== null) {
|
|
1212
1236
|
do {
|
|
@@ -1216,7 +1240,7 @@ function recompute(t, n = false) {
|
|
|
1216
1240
|
else t.A = null;
|
|
1217
1241
|
}
|
|
1218
1242
|
const f = u ? t.ee : t.Z === S ? t.$ : t.Z;
|
|
1219
|
-
const c = !t.
|
|
1243
|
+
const c = !t.Te || !t.Te(f, h);
|
|
1220
1244
|
if (c) {
|
|
1221
1245
|
const e = u ? t.ee : undefined;
|
|
1222
1246
|
if (n || (i && k !== t.K) || s) {
|
|
@@ -1236,7 +1260,7 @@ function recompute(t, n = false) {
|
|
|
1236
1260
|
}
|
|
1237
1261
|
}
|
|
1238
1262
|
}
|
|
1239
|
-
|
|
1263
|
+
M = m;
|
|
1240
1264
|
(!n || t.ge & a) && !t.K && !(k && u) && A.se.push(t);
|
|
1241
1265
|
t.K && i && k !== t.K && runInTransition(t.K, () => recompute(t));
|
|
1242
1266
|
}
|
|
@@ -1245,7 +1269,7 @@ function updateIfNecessary(r) {
|
|
|
1245
1269
|
for (let e = r.A; e; e = e.N) {
|
|
1246
1270
|
const t = e.L;
|
|
1247
1271
|
const i = t.I || t;
|
|
1248
|
-
if (i.
|
|
1272
|
+
if (i.R) {
|
|
1249
1273
|
updateIfNecessary(i);
|
|
1250
1274
|
}
|
|
1251
1275
|
if (r.m & n) {
|
|
@@ -1253,7 +1277,7 @@ function updateIfNecessary(r) {
|
|
|
1253
1277
|
}
|
|
1254
1278
|
}
|
|
1255
1279
|
}
|
|
1256
|
-
if (r.m & (n | f) || (r.ae && r.de < E && !r.
|
|
1280
|
+
if (r.m & (n | f) || (r.ae && r.de < E && !r.Ee)) {
|
|
1257
1281
|
recompute(r);
|
|
1258
1282
|
}
|
|
1259
1283
|
r.m = e | (r.m & c);
|
|
@@ -1261,63 +1285,63 @@ function updateIfNecessary(r) {
|
|
|
1261
1285
|
function computed(t, n, r) {
|
|
1262
1286
|
const i = r?.transparent ?? false;
|
|
1263
1287
|
const s = {
|
|
1264
|
-
id: r?.id ?? (i ?
|
|
1265
|
-
|
|
1266
|
-
|
|
1288
|
+
id: r?.id ?? (i ? V?.id : V?.id != null ? getNextChildId(V) : undefined),
|
|
1289
|
+
Ae: i || undefined,
|
|
1290
|
+
Te: r?.equals != null ? r.equals : isEqual,
|
|
1267
1291
|
le: !!r?.pureWrite,
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1292
|
+
_e: r?.unobserved,
|
|
1293
|
+
je: null,
|
|
1294
|
+
V: V?.V ?? A,
|
|
1295
|
+
Ne: V?.Ne ?? _,
|
|
1296
|
+
Ce: 0,
|
|
1297
|
+
R: t,
|
|
1274
1298
|
$: n,
|
|
1275
1299
|
o: 0,
|
|
1276
1300
|
C: null,
|
|
1277
1301
|
h: undefined,
|
|
1278
1302
|
p: null,
|
|
1279
1303
|
A: null,
|
|
1280
|
-
|
|
1304
|
+
xe: null,
|
|
1281
1305
|
O: null,
|
|
1282
|
-
|
|
1283
|
-
i:
|
|
1284
|
-
|
|
1285
|
-
|
|
1306
|
+
be: null,
|
|
1307
|
+
i: V,
|
|
1308
|
+
ve: null,
|
|
1309
|
+
Pe: null,
|
|
1286
1310
|
m: r?.lazy ? l : e,
|
|
1287
1311
|
ge: p,
|
|
1288
1312
|
de: E,
|
|
1289
1313
|
Z: S,
|
|
1290
|
-
Ae: null,
|
|
1291
1314
|
We: null,
|
|
1292
|
-
|
|
1315
|
+
ke: null,
|
|
1316
|
+
Ee: null,
|
|
1293
1317
|
K: null
|
|
1294
1318
|
};
|
|
1295
1319
|
s.p = s;
|
|
1296
|
-
const o =
|
|
1297
|
-
if (
|
|
1298
|
-
const e =
|
|
1320
|
+
const o = V?.t ? V.u : V;
|
|
1321
|
+
if (V) {
|
|
1322
|
+
const e = V.Pe;
|
|
1299
1323
|
if (e === null) {
|
|
1300
|
-
|
|
1324
|
+
V.Pe = s;
|
|
1301
1325
|
} else {
|
|
1302
|
-
s.
|
|
1303
|
-
|
|
1326
|
+
s.ve = e;
|
|
1327
|
+
V.Pe = s;
|
|
1304
1328
|
}
|
|
1305
1329
|
}
|
|
1306
1330
|
if (o) s.o = o.o + 1;
|
|
1307
|
-
if (
|
|
1308
|
-
if (
|
|
1331
|
+
if (B && ownerInSnapshotScope(V)) s.he = true;
|
|
1332
|
+
if (R) {
|
|
1309
1333
|
const e = signal(undefined, { equals: false, pureWrite: true });
|
|
1310
|
-
const t =
|
|
1334
|
+
const t = R.factory(s.R, () => {
|
|
1311
1335
|
setSignal(e, undefined);
|
|
1312
1336
|
});
|
|
1313
1337
|
cleanup(() => t.dispose());
|
|
1314
|
-
s.
|
|
1338
|
+
s.R = n => {
|
|
1315
1339
|
read(e);
|
|
1316
1340
|
return t.track(n);
|
|
1317
1341
|
};
|
|
1318
1342
|
}
|
|
1319
1343
|
!r?.lazy && recompute(s, true);
|
|
1320
|
-
if (
|
|
1344
|
+
if (B && !r?.lazy) {
|
|
1321
1345
|
if (!(s.ge & a)) {
|
|
1322
1346
|
s.pe = s.$ === undefined ? w : s.$;
|
|
1323
1347
|
G.add(s);
|
|
@@ -1327,20 +1351,20 @@ function computed(t, n, r) {
|
|
|
1327
1351
|
}
|
|
1328
1352
|
function signal(e, t, n = null) {
|
|
1329
1353
|
const r = {
|
|
1330
|
-
|
|
1354
|
+
Te: t?.equals != null ? t.equals : isEqual,
|
|
1331
1355
|
le: !!t?.pureWrite,
|
|
1332
1356
|
De: !!t?.De,
|
|
1333
|
-
|
|
1357
|
+
_e: t?.unobserved,
|
|
1334
1358
|
$: e,
|
|
1335
1359
|
O: null,
|
|
1336
|
-
|
|
1360
|
+
be: null,
|
|
1337
1361
|
de: E,
|
|
1338
1362
|
I: n,
|
|
1339
1363
|
W: n?.C || null,
|
|
1340
1364
|
Z: S
|
|
1341
1365
|
};
|
|
1342
1366
|
n && (n.C = r);
|
|
1343
|
-
if (
|
|
1367
|
+
if (B && !r.De && !((n?.ge ?? 0) & a)) {
|
|
1344
1368
|
r.pe = e === undefined ? w : e;
|
|
1345
1369
|
G.add(r);
|
|
1346
1370
|
}
|
|
@@ -1360,35 +1384,35 @@ function isEqual(e, t) {
|
|
|
1360
1384
|
return e === t;
|
|
1361
1385
|
}
|
|
1362
1386
|
function untrack(e, t) {
|
|
1363
|
-
if (!
|
|
1364
|
-
const n =
|
|
1365
|
-
|
|
1387
|
+
if (!R && !T && true) return e();
|
|
1388
|
+
const n = T;
|
|
1389
|
+
T = false;
|
|
1366
1390
|
try {
|
|
1367
|
-
if (
|
|
1391
|
+
if (R) return R.untrack(e);
|
|
1368
1392
|
return e();
|
|
1369
1393
|
} finally {
|
|
1370
|
-
|
|
1394
|
+
T = n;
|
|
1371
1395
|
}
|
|
1372
1396
|
}
|
|
1373
1397
|
function read(e) {
|
|
1374
|
-
if (
|
|
1398
|
+
if (F) {
|
|
1375
1399
|
const t = getLatestValueComputed(e);
|
|
1376
|
-
const n =
|
|
1377
|
-
|
|
1400
|
+
const n = F;
|
|
1401
|
+
F = false;
|
|
1378
1402
|
const r = e.ee !== undefined && e.ee !== S ? e.ee : e.$;
|
|
1379
1403
|
let i;
|
|
1380
1404
|
try {
|
|
1381
1405
|
i = read(t);
|
|
1382
1406
|
} catch (e) {
|
|
1383
|
-
if (!
|
|
1407
|
+
if (!V && e instanceof NotReadyError) return r;
|
|
1384
1408
|
throw e;
|
|
1385
1409
|
} finally {
|
|
1386
|
-
|
|
1410
|
+
F = n;
|
|
1387
1411
|
}
|
|
1388
1412
|
if (t.ge & a) return r;
|
|
1389
|
-
if (H &&
|
|
1413
|
+
if (H && M && t.Y) {
|
|
1390
1414
|
const e = findLane(t.Y);
|
|
1391
|
-
const n = findLane(
|
|
1415
|
+
const n = findLane(M);
|
|
1392
1416
|
if (e !== n && e.H.size > 0) {
|
|
1393
1417
|
return r;
|
|
1394
1418
|
}
|
|
@@ -1400,9 +1424,14 @@ function read(e) {
|
|
|
1400
1424
|
const n = q;
|
|
1401
1425
|
q = false;
|
|
1402
1426
|
if (t && e.ee !== undefined) {
|
|
1403
|
-
if (e.ee !== S && (t.
|
|
1427
|
+
if (e.ee !== S && (t.Ee || !!(t.ge & a))) {
|
|
1404
1428
|
D = true;
|
|
1405
1429
|
}
|
|
1430
|
+
let n = V;
|
|
1431
|
+
if (n?.t) n = n.u;
|
|
1432
|
+
if (n && T) link(e, n);
|
|
1433
|
+
read(getPendingSignal(e));
|
|
1434
|
+
read(getPendingSignal(t));
|
|
1406
1435
|
} else {
|
|
1407
1436
|
if (read(getPendingSignal(e))) D = true;
|
|
1408
1437
|
if (t && read(getPendingSignal(t))) D = true;
|
|
@@ -1410,18 +1439,18 @@ function read(e) {
|
|
|
1410
1439
|
q = n;
|
|
1411
1440
|
return e.$;
|
|
1412
1441
|
}
|
|
1413
|
-
let t =
|
|
1442
|
+
let t = V;
|
|
1414
1443
|
if (t?.t) t = t.u;
|
|
1415
|
-
if (Q && e.
|
|
1444
|
+
if (Q && e.R) recompute(e);
|
|
1416
1445
|
if (e.m & l) {
|
|
1417
1446
|
e.m &= ~l;
|
|
1418
1447
|
recompute(e, true);
|
|
1419
1448
|
}
|
|
1420
1449
|
const n = e.I || e;
|
|
1421
|
-
if (t &&
|
|
1422
|
-
if (e.
|
|
1450
|
+
if (t && T) {
|
|
1451
|
+
if (e.R && e.m & u) recompute(e);
|
|
1423
1452
|
link(e, t);
|
|
1424
|
-
if (n.
|
|
1453
|
+
if (n.R) {
|
|
1425
1454
|
const r = e.m & o;
|
|
1426
1455
|
if (n.o >= (r ? v.j : P.j)) {
|
|
1427
1456
|
markNode(t);
|
|
@@ -1436,28 +1465,31 @@ function read(e) {
|
|
|
1436
1465
|
}
|
|
1437
1466
|
if (n.ge & a) {
|
|
1438
1467
|
if (t && !(H && n.K && k !== n.K)) {
|
|
1439
|
-
if (
|
|
1468
|
+
if (M) {
|
|
1440
1469
|
const r = n.Y;
|
|
1441
|
-
const i = findLane(
|
|
1470
|
+
const i = findLane(M);
|
|
1442
1471
|
if (r && findLane(r) === i && !hasActiveOverride(n)) {
|
|
1443
|
-
if (!
|
|
1472
|
+
if (!T && e !== t) link(e, t);
|
|
1444
1473
|
throw n.ae;
|
|
1445
1474
|
}
|
|
1446
1475
|
} else {
|
|
1447
|
-
if (!
|
|
1476
|
+
if (!T && e !== t) link(e, t);
|
|
1448
1477
|
throw n.ae;
|
|
1449
1478
|
}
|
|
1479
|
+
} else if (t && n !== e && n.ge & p) {
|
|
1480
|
+
if (!T && e !== t) link(e, t);
|
|
1481
|
+
throw n.ae;
|
|
1450
1482
|
} else if (!t && n.ge & p) {
|
|
1451
1483
|
throw n.ae;
|
|
1452
1484
|
}
|
|
1453
1485
|
}
|
|
1454
|
-
if (e.
|
|
1486
|
+
if (e.R && e.ge & d) {
|
|
1455
1487
|
if (e.de < E) {
|
|
1456
1488
|
recompute(e, true);
|
|
1457
1489
|
return read(e);
|
|
1458
1490
|
} else throw e.ae;
|
|
1459
1491
|
}
|
|
1460
|
-
if (
|
|
1492
|
+
if (B && t && t.he) {
|
|
1461
1493
|
const n = e.pe;
|
|
1462
1494
|
if (n !== undefined) {
|
|
1463
1495
|
const r = n === w ? undefined : n;
|
|
@@ -1471,7 +1503,7 @@ function read(e) {
|
|
|
1471
1503
|
return e.ee;
|
|
1472
1504
|
}
|
|
1473
1505
|
return !t ||
|
|
1474
|
-
(
|
|
1506
|
+
(M !== null && (e.ee !== undefined || e.Y || (n === e && H) || !!(n.ge & a))) ||
|
|
1475
1507
|
e.Z === S ||
|
|
1476
1508
|
(H && e.K && k !== e.K)
|
|
1477
1509
|
? e.$
|
|
@@ -1483,9 +1515,9 @@ function setSignal(e, t) {
|
|
|
1483
1515
|
const r = e.ee !== undefined && e.ee !== S;
|
|
1484
1516
|
const i = n ? (r ? e.ee : e.$) : e.Z === S ? e.$ : e.Z;
|
|
1485
1517
|
if (typeof t === "function") t = t(i);
|
|
1486
|
-
const s = !e.
|
|
1518
|
+
const s = !e.Te || !e.Te(i, t) || !!(e.ge & p);
|
|
1487
1519
|
if (!s) {
|
|
1488
|
-
if (n && r && e.
|
|
1520
|
+
if (n && r && e.R) {
|
|
1489
1521
|
insertSubs(e, true);
|
|
1490
1522
|
schedule();
|
|
1491
1523
|
}
|
|
@@ -1507,8 +1539,8 @@ function setSignal(e, t) {
|
|
|
1507
1539
|
e.Z = t;
|
|
1508
1540
|
}
|
|
1509
1541
|
updatePendingSignal(e);
|
|
1510
|
-
if (e.
|
|
1511
|
-
setSignal(e.
|
|
1542
|
+
if (e.He) {
|
|
1543
|
+
setSignal(e.He, t);
|
|
1512
1544
|
}
|
|
1513
1545
|
e.de = E;
|
|
1514
1546
|
insertSubs(e, n);
|
|
@@ -1516,32 +1548,32 @@ function setSignal(e, t) {
|
|
|
1516
1548
|
return t;
|
|
1517
1549
|
}
|
|
1518
1550
|
function runWithOwner(e, t) {
|
|
1519
|
-
const n =
|
|
1520
|
-
const r =
|
|
1521
|
-
|
|
1522
|
-
|
|
1551
|
+
const n = V;
|
|
1552
|
+
const r = T;
|
|
1553
|
+
V = e;
|
|
1554
|
+
T = false;
|
|
1523
1555
|
try {
|
|
1524
1556
|
return t();
|
|
1525
1557
|
} finally {
|
|
1526
|
-
|
|
1527
|
-
|
|
1558
|
+
V = n;
|
|
1559
|
+
T = r;
|
|
1528
1560
|
}
|
|
1529
1561
|
}
|
|
1530
1562
|
function getPendingSignal(e) {
|
|
1531
|
-
if (!e.
|
|
1532
|
-
e.
|
|
1563
|
+
if (!e.Fe) {
|
|
1564
|
+
e.Fe = optimisticSignal(false, { pureWrite: true });
|
|
1533
1565
|
if (e.ye) {
|
|
1534
|
-
e.
|
|
1566
|
+
e.Fe.ye = e;
|
|
1535
1567
|
}
|
|
1536
|
-
if (computePendingState(e)) setSignal(e.
|
|
1568
|
+
if (computePendingState(e)) setSignal(e.Fe, true);
|
|
1537
1569
|
}
|
|
1538
|
-
return e.
|
|
1570
|
+
return e.Fe;
|
|
1539
1571
|
}
|
|
1540
1572
|
function computePendingState(e) {
|
|
1541
1573
|
const t = e;
|
|
1542
1574
|
const n = e.I;
|
|
1543
1575
|
if (n && e.Z !== S) {
|
|
1544
|
-
return !n.
|
|
1576
|
+
return !n.Ee && !(n.ge & a);
|
|
1545
1577
|
}
|
|
1546
1578
|
if (e.ee !== undefined && e.ee !== S) {
|
|
1547
1579
|
if (t.ge & a && !(t.ge & p)) return true;
|
|
@@ -1558,9 +1590,9 @@ function computePendingState(e) {
|
|
|
1558
1590
|
return !!(t.ge & a && !(t.ge & p));
|
|
1559
1591
|
}
|
|
1560
1592
|
function updatePendingSignal(e) {
|
|
1561
|
-
if (e.
|
|
1593
|
+
if (e.Fe) {
|
|
1562
1594
|
const t = computePendingState(e);
|
|
1563
|
-
const n = e.
|
|
1595
|
+
const n = e.Fe;
|
|
1564
1596
|
setSignal(n, t);
|
|
1565
1597
|
if (!t && n.Y) {
|
|
1566
1598
|
const t = resolveLane(e);
|
|
@@ -1576,20 +1608,20 @@ function updatePendingSignal(e) {
|
|
|
1576
1608
|
}
|
|
1577
1609
|
}
|
|
1578
1610
|
function getLatestValueComputed(e) {
|
|
1579
|
-
if (!e.
|
|
1580
|
-
const t =
|
|
1581
|
-
|
|
1611
|
+
if (!e.He) {
|
|
1612
|
+
const t = F;
|
|
1613
|
+
F = false;
|
|
1582
1614
|
const n = q;
|
|
1583
1615
|
q = false;
|
|
1584
|
-
const r =
|
|
1585
|
-
|
|
1586
|
-
e.
|
|
1587
|
-
e.
|
|
1588
|
-
|
|
1616
|
+
const r = V;
|
|
1617
|
+
V = null;
|
|
1618
|
+
e.He = optimisticComputed(() => read(e));
|
|
1619
|
+
e.He.ye = e;
|
|
1620
|
+
V = r;
|
|
1589
1621
|
q = n;
|
|
1590
|
-
|
|
1622
|
+
F = t;
|
|
1591
1623
|
}
|
|
1592
|
-
return e.
|
|
1624
|
+
return e.He;
|
|
1593
1625
|
}
|
|
1594
1626
|
function staleValues(e, t = true) {
|
|
1595
1627
|
const n = H;
|
|
@@ -1601,12 +1633,12 @@ function staleValues(e, t = true) {
|
|
|
1601
1633
|
}
|
|
1602
1634
|
}
|
|
1603
1635
|
function latest(e) {
|
|
1604
|
-
const t =
|
|
1605
|
-
|
|
1636
|
+
const t = F;
|
|
1637
|
+
F = true;
|
|
1606
1638
|
try {
|
|
1607
1639
|
return e();
|
|
1608
1640
|
} finally {
|
|
1609
|
-
|
|
1641
|
+
F = t;
|
|
1610
1642
|
}
|
|
1611
1643
|
}
|
|
1612
1644
|
function isPending(e) {
|
|
@@ -1650,7 +1682,7 @@ function getContext(e, t = getOwner()) {
|
|
|
1650
1682
|
if (!t) {
|
|
1651
1683
|
throw new NoOwnerError();
|
|
1652
1684
|
}
|
|
1653
|
-
const n = hasContext(e, t) ? t.
|
|
1685
|
+
const n = hasContext(e, t) ? t.Ne[e.id] : e.defaultValue;
|
|
1654
1686
|
if (isUndefined(n)) {
|
|
1655
1687
|
throw new ContextNotFoundError();
|
|
1656
1688
|
}
|
|
@@ -1660,10 +1692,10 @@ function setContext(e, t, n = getOwner()) {
|
|
|
1660
1692
|
if (!n) {
|
|
1661
1693
|
throw new NoOwnerError();
|
|
1662
1694
|
}
|
|
1663
|
-
n.
|
|
1695
|
+
n.Ne = { ...n.Ne, [e.id]: isUndefined(t) ? e.defaultValue : t };
|
|
1664
1696
|
}
|
|
1665
1697
|
function hasContext(e, t) {
|
|
1666
|
-
return !isUndefined(t?.
|
|
1698
|
+
return !isUndefined(t?.Ne[e.id]);
|
|
1667
1699
|
}
|
|
1668
1700
|
function isUndefined(e) {
|
|
1669
1701
|
return typeof e === "undefined";
|
|
@@ -1673,27 +1705,27 @@ function effect(e, t, n, r, i) {
|
|
|
1673
1705
|
const o = computed(i?.render ? t => staleValues(() => e(t)) : e, r, {
|
|
1674
1706
|
...i,
|
|
1675
1707
|
equals: () => {
|
|
1676
|
-
o.
|
|
1677
|
-
if (s) o.
|
|
1708
|
+
o.F = !o.ae;
|
|
1709
|
+
if (s) o.V.enqueue(o.D, runEffect.bind(o));
|
|
1678
1710
|
return false;
|
|
1679
1711
|
},
|
|
1680
1712
|
lazy: true
|
|
1681
1713
|
});
|
|
1682
|
-
o.
|
|
1683
|
-
o.
|
|
1684
|
-
o.
|
|
1714
|
+
o.Ve = r;
|
|
1715
|
+
o.Me = t;
|
|
1716
|
+
o.Be = n;
|
|
1685
1717
|
o.Ge = undefined;
|
|
1686
1718
|
o.D = i?.render ? h : g;
|
|
1687
|
-
o.
|
|
1719
|
+
o.Qe = (e, t) => {
|
|
1688
1720
|
const n = e !== undefined ? e : o.ge;
|
|
1689
1721
|
const r = t !== undefined ? t : o.ae;
|
|
1690
1722
|
if (n & d) {
|
|
1691
1723
|
let e = r;
|
|
1692
|
-
o.
|
|
1724
|
+
o.V.notify(o, a, 0);
|
|
1693
1725
|
if (o.D === g) {
|
|
1694
1726
|
try {
|
|
1695
|
-
return o.
|
|
1696
|
-
? o.
|
|
1727
|
+
return o.Be
|
|
1728
|
+
? o.Be(e, () => {
|
|
1697
1729
|
o.Ge?.();
|
|
1698
1730
|
o.Ge = undefined;
|
|
1699
1731
|
})
|
|
@@ -1702,60 +1734,66 @@ function effect(e, t, n, r, i) {
|
|
|
1702
1734
|
e = t;
|
|
1703
1735
|
}
|
|
1704
1736
|
}
|
|
1705
|
-
if (!o.
|
|
1737
|
+
if (!o.V.notify(o, d, d)) throw e;
|
|
1706
1738
|
} else if (o.D === h) {
|
|
1707
|
-
o.
|
|
1739
|
+
o.V.notify(o, a | d, n, r);
|
|
1708
1740
|
}
|
|
1709
1741
|
};
|
|
1710
1742
|
recompute(o, true);
|
|
1711
|
-
!i?.defer && (o.D === g ? o.
|
|
1743
|
+
!i?.defer && (o.D === g ? o.V.enqueue(o.D, runEffect.bind(o)) : runEffect.call(o));
|
|
1712
1744
|
s = true;
|
|
1713
1745
|
cleanup(() => o.Ge?.());
|
|
1714
1746
|
}
|
|
1715
1747
|
function runEffect() {
|
|
1716
|
-
if (!this.
|
|
1748
|
+
if (!this.F || this.m & u) return;
|
|
1717
1749
|
this.Ge?.();
|
|
1718
1750
|
this.Ge = undefined;
|
|
1719
1751
|
try {
|
|
1720
|
-
|
|
1752
|
+
const e = this.Me(this.$, this.Ve);
|
|
1753
|
+
if (false && e !== undefined && typeof e !== "function");
|
|
1754
|
+
this.Ge = e;
|
|
1721
1755
|
} catch (e) {
|
|
1722
1756
|
this.ae = new StatusError(this, e);
|
|
1723
1757
|
this.ge |= d;
|
|
1724
|
-
if (!this.
|
|
1758
|
+
if (!this.V.notify(this, d, d)) throw e;
|
|
1725
1759
|
} finally {
|
|
1726
|
-
this.
|
|
1727
|
-
this.
|
|
1760
|
+
this.Ve = this.$;
|
|
1761
|
+
this.F = false;
|
|
1728
1762
|
}
|
|
1729
1763
|
}
|
|
1730
1764
|
function trackedEffect(e, t) {
|
|
1731
1765
|
const run = () => {
|
|
1732
|
-
if (!n.
|
|
1733
|
-
|
|
1734
|
-
|
|
1766
|
+
if (!n.F || n.m & u) return;
|
|
1767
|
+
try {
|
|
1768
|
+
n.F = false;
|
|
1769
|
+
recompute(n);
|
|
1770
|
+
} finally {
|
|
1771
|
+
}
|
|
1735
1772
|
};
|
|
1736
1773
|
const n = computed(
|
|
1737
1774
|
() => {
|
|
1738
1775
|
n.Ge?.();
|
|
1739
1776
|
n.Ge = undefined;
|
|
1740
|
-
|
|
1777
|
+
const t = staleValues(e);
|
|
1778
|
+
n.Ge = t;
|
|
1741
1779
|
},
|
|
1742
1780
|
undefined,
|
|
1743
1781
|
{ ...t, lazy: true }
|
|
1744
1782
|
);
|
|
1745
1783
|
n.Ge = undefined;
|
|
1746
1784
|
n.Ke = true;
|
|
1747
|
-
n.
|
|
1785
|
+
n.F = true;
|
|
1748
1786
|
n.D = y;
|
|
1749
|
-
n.
|
|
1787
|
+
n.Qe = (e, t) => {
|
|
1750
1788
|
const r = e !== undefined ? e : n.ge;
|
|
1751
1789
|
if (r & d) {
|
|
1752
|
-
n.
|
|
1790
|
+
n.V.notify(n, a, 0);
|
|
1753
1791
|
const e = t !== undefined ? t : n.ae;
|
|
1754
|
-
if (!n.
|
|
1792
|
+
if (!n.V.notify(n, d, d)) throw e;
|
|
1755
1793
|
}
|
|
1756
1794
|
};
|
|
1757
|
-
n.
|
|
1758
|
-
n.
|
|
1795
|
+
n.M = run;
|
|
1796
|
+
n.V.enqueue(g, run);
|
|
1759
1797
|
cleanup(() => n.Ge?.());
|
|
1760
1798
|
}
|
|
1761
1799
|
function restoreTransition(e, t) {
|
|
@@ -1841,7 +1879,9 @@ function createReaction(e, t) {
|
|
|
1841
1879
|
() => (i(), getOwner()),
|
|
1842
1880
|
t => {
|
|
1843
1881
|
n?.();
|
|
1844
|
-
|
|
1882
|
+
const r = (e.effect || e)?.();
|
|
1883
|
+
if (false && r !== undefined && typeof r !== "function");
|
|
1884
|
+
n = r;
|
|
1845
1885
|
dispose(t);
|
|
1846
1886
|
},
|
|
1847
1887
|
e.error,
|
|
@@ -1873,7 +1913,7 @@ function createOptimistic(e, t, n) {
|
|
|
1873
1913
|
function onSettled(e) {
|
|
1874
1914
|
const t = getOwner();
|
|
1875
1915
|
t && !t.Ke
|
|
1876
|
-
? createTrackedEffect(() => untrack(e))
|
|
1916
|
+
? createTrackedEffect(() => untrack(e), undefined)
|
|
1877
1917
|
: A.enqueue(g, () => {
|
|
1878
1918
|
const t = e();
|
|
1879
1919
|
t?.();
|
|
@@ -2040,7 +2080,7 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
2040
2080
|
let i;
|
|
2041
2081
|
const o = new Proxy(
|
|
2042
2082
|
s,
|
|
2043
|
-
createWriteTraps(() => !r || t.
|
|
2083
|
+
createWriteTraps(() => !r || t.Ee === i)
|
|
2044
2084
|
);
|
|
2045
2085
|
storeSetter(o, o => {
|
|
2046
2086
|
i = e(o);
|
|
@@ -2051,7 +2091,7 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
2051
2091
|
u !== o && u !== undefined && reconcile(u, n?.key || "id")(s);
|
|
2052
2092
|
});
|
|
2053
2093
|
});
|
|
2054
|
-
r.
|
|
2094
|
+
r.Oe = true;
|
|
2055
2095
|
return { store: s, node: r };
|
|
2056
2096
|
}
|
|
2057
2097
|
function createProjection(e, t = {}, n) {
|
|
@@ -2247,7 +2287,7 @@ const fe = {
|
|
|
2247
2287
|
untrack(() => {
|
|
2248
2288
|
const i = e[X];
|
|
2249
2289
|
const s = i[t];
|
|
2250
|
-
if (
|
|
2290
|
+
if (B && typeof t !== "symbol" && !((e[re]?.ge ?? 0) & a)) {
|
|
2251
2291
|
if (!e[m]) {
|
|
2252
2292
|
e[m] = Object.create(null);
|
|
2253
2293
|
G?.add(e);
|
|
@@ -2424,7 +2464,7 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2424
2464
|
let i;
|
|
2425
2465
|
const o = new Proxy(
|
|
2426
2466
|
s,
|
|
2427
|
-
createWriteTraps(() => !r || t.
|
|
2467
|
+
createWriteTraps(() => !r || t.Ee === i)
|
|
2428
2468
|
);
|
|
2429
2469
|
setProjectionWriteActive(true);
|
|
2430
2470
|
try {
|
|
@@ -2445,7 +2485,7 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2445
2485
|
setProjectionWriteActive(false);
|
|
2446
2486
|
}
|
|
2447
2487
|
});
|
|
2448
|
-
r.
|
|
2488
|
+
r.Oe = true;
|
|
2449
2489
|
}
|
|
2450
2490
|
return { store: s, node: r };
|
|
2451
2491
|
}
|
|
@@ -2899,21 +2939,21 @@ function compare(e, t, n) {
|
|
|
2899
2939
|
}
|
|
2900
2940
|
function boundaryComputed(e, t) {
|
|
2901
2941
|
const n = computed(e, undefined, { lazy: true });
|
|
2902
|
-
n.
|
|
2942
|
+
n.Qe = (e, t) => {
|
|
2903
2943
|
const r = e !== undefined ? e : n.ge;
|
|
2904
2944
|
const i = t !== undefined ? t : n.ae;
|
|
2905
2945
|
n.ge &= ~n.ut;
|
|
2906
|
-
n.
|
|
2946
|
+
n.V.notify(n, n.ut, r, i);
|
|
2907
2947
|
};
|
|
2908
2948
|
n.ut = t;
|
|
2909
|
-
n.
|
|
2949
|
+
n.Oe = true;
|
|
2910
2950
|
recompute(n, true);
|
|
2911
2951
|
return n;
|
|
2912
2952
|
}
|
|
2913
2953
|
function createBoundChildren(e, t, n, r) {
|
|
2914
|
-
const i = e.
|
|
2915
|
-
i.addChild((e.
|
|
2916
|
-
cleanup(() => i.removeChild(e.
|
|
2954
|
+
const i = e.V;
|
|
2955
|
+
i.addChild((e.V = n));
|
|
2956
|
+
cleanup(() => i.removeChild(e.V));
|
|
2917
2957
|
return runWithOwner(e, () => {
|
|
2918
2958
|
const e = computed(t);
|
|
2919
2959
|
return boundaryComputed(() => staleValues(() => flatten(read(e))), r);
|