@solidjs/universal 2.0.0-beta.2 → 2.0.0-beta.3

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 CHANGED
@@ -70,9 +70,9 @@ function deleteFromHeap(e, t) {
70
70
  if (e.T === e) t.l[i] = undefined;else {
71
71
  const n = e.S;
72
72
  const r = t.l[i];
73
- const s = n ?? r;
73
+ const o = n ?? r;
74
74
  if (e === r) t.l[i] = n;else e.T.S = n;
75
- s.T = e.T;
75
+ o.T = e.T;
76
76
  }
77
77
  e.T = e;
78
78
  e.S = undefined;
@@ -94,7 +94,7 @@ function markNode(e, t = REACTIVE_DIRTY) {
94
94
  markNode(t.h, REACTIVE_CHECK);
95
95
  }
96
96
  if (e.A !== null) {
97
- for (let t = e.A; t !== null; t = t.P) {
97
+ for (let t = e.A; t !== null; t = t.N) {
98
98
  for (let e = t.I; e !== null; e = e.p) {
99
99
  markNode(e.h, REACTIVE_CHECK);
100
100
  }
@@ -103,11 +103,11 @@ function markNode(e, t = REACTIVE_DIRTY) {
103
103
  }
104
104
  function runHeap(e, t) {
105
105
  e._ = false;
106
- for (e.N = 0; e.N <= e.R; e.N++) {
107
- let n = e.l[e.N];
106
+ for (e.P = 0; e.P <= e.R; e.P++) {
107
+ let n = e.l[e.P];
108
108
  while (n !== undefined) {
109
109
  if (n.O & REACTIVE_IN_HEAP) t(n);else adjustHeight(n, e);
110
- n = e.l[e.N];
110
+ n = e.l[e.P];
111
111
  }
112
112
  }
113
113
  e.R = 0;
@@ -116,8 +116,8 @@ function adjustHeight(e, t) {
116
116
  deleteFromHeap(e, t);
117
117
  let n = e.o;
118
118
  for (let t = e.C; t; t = t.D) {
119
- const e = t.V;
120
- const i = e.m || e;
119
+ const e = t.m;
120
+ const i = e.V || e;
121
121
  if (i.L && i.o >= n) n = i.o + 1;
122
122
  }
123
123
  if (e.o !== n) {
@@ -131,13 +131,13 @@ const transitions = new Set();
131
131
  const dirtyQueue = {
132
132
  l: new Array(2e3).fill(undefined),
133
133
  _: false,
134
- N: 0,
134
+ P: 0,
135
135
  R: 0
136
136
  };
137
137
  const zombieQueue = {
138
138
  l: new Array(2e3).fill(undefined),
139
139
  _: false,
140
- N: 0,
140
+ P: 0,
141
141
  R: 0
142
142
  };
143
143
  let clock = 0;
@@ -161,16 +161,16 @@ function schedule() {
161
161
  class Queue {
162
162
  i = null;
163
163
  G = [[], []];
164
- M = [];
164
+ F = [];
165
165
  created = clock;
166
166
  addChild(e) {
167
- this.M.push(e);
167
+ this.F.push(e);
168
168
  e.i = this;
169
169
  }
170
170
  removeChild(e) {
171
- const t = this.M.indexOf(e);
171
+ const t = this.F.indexOf(e);
172
172
  if (t >= 0) {
173
- this.M.splice(t, 1);
173
+ this.F.splice(t, 1);
174
174
  e.i = null;
175
175
  }
176
176
  }
@@ -184,7 +184,7 @@ class Queue {
184
184
  this.G[e - 1] = [];
185
185
  runQueue(t, e);
186
186
  }
187
- for (let t = 0; t < this.M.length; t++) this.M[t].run?.(e);
187
+ for (let t = 0; t < this.F.length; t++) this.F[t].run?.(e);
188
188
  }
189
189
  enqueue(e, t) {
190
190
  if (e) {
@@ -201,15 +201,15 @@ class Queue {
201
201
  e.G[0].push(...this.G[0]);
202
202
  e.G[1].push(...this.G[1]);
203
203
  this.G = [[], []];
204
- for (let t = 0; t < this.M.length; t++) {
205
- let n = this.M[t];
206
- let i = e.M[t];
204
+ for (let t = 0; t < this.F.length; t++) {
205
+ let n = this.F[t];
206
+ let i = e.F[t];
207
207
  if (!i) {
208
208
  i = {
209
209
  G: [[], []],
210
- M: []
210
+ F: []
211
211
  };
212
- e.M[t] = i;
212
+ e.F[t] = i;
213
213
  }
214
214
  n.stashQueues(i);
215
215
  }
@@ -217,21 +217,21 @@ class Queue {
217
217
  restoreQueues(e) {
218
218
  this.G[0].push(...e.G[0]);
219
219
  this.G[1].push(...e.G[1]);
220
- for (let t = 0; t < e.M.length; t++) {
221
- const n = e.M[t];
222
- let i = this.M[t];
220
+ for (let t = 0; t < e.F.length; t++) {
221
+ const n = e.F[t];
222
+ let i = this.F[t];
223
223
  if (i) i.restoreQueues(n);
224
224
  }
225
225
  }
226
226
  }
227
227
  class GlobalQueue extends Queue {
228
228
  H = false;
229
- F = [];
229
+ M = [];
230
230
  $ = [];
231
231
  j = new Set();
232
232
  static K;
233
233
  static Y;
234
- static Z = null;
234
+ static B = null;
235
235
  flush() {
236
236
  if (this.H) return;
237
237
  this.H = true;
@@ -242,32 +242,32 @@ class GlobalQueue extends Queue {
242
242
  if (!e) {
243
243
  let e = activeTransition;
244
244
  runHeap(zombieQueue, GlobalQueue.K);
245
- this.F = [];
245
+ this.M = [];
246
246
  this.$ = [];
247
247
  this.j = new Set();
248
248
  runLaneEffects(EFFECT_RENDER);
249
249
  runLaneEffects(EFFECT_USER);
250
- this.stashQueues(activeTransition.B);
250
+ this.stashQueues(activeTransition.Z);
251
251
  clock++;
252
- scheduled = dirtyQueue.R >= dirtyQueue.N;
253
- reassignPendingTransition(activeTransition.F);
252
+ scheduled = dirtyQueue.R >= dirtyQueue.P;
253
+ reassignPendingTransition(activeTransition.M);
254
254
  activeTransition = null;
255
255
  finalizePureQueue(null, true);
256
256
  return;
257
257
  }
258
- this.F !== activeTransition.F && this.F.push(...activeTransition.F);
259
- this.restoreQueues(activeTransition.B);
258
+ this.M !== activeTransition.M && this.M.push(...activeTransition.M);
259
+ this.restoreQueues(activeTransition.Z);
260
260
  transitions.delete(activeTransition);
261
261
  const t = activeTransition;
262
262
  activeTransition = null;
263
- reassignPendingTransition(this.F);
263
+ reassignPendingTransition(this.M);
264
264
  finalizePureQueue(t);
265
265
  } else {
266
266
  if (transitions.size) runHeap(zombieQueue, GlobalQueue.K);
267
267
  finalizePureQueue();
268
268
  }
269
269
  clock++;
270
- scheduled = dirtyQueue.R >= dirtyQueue.N;
270
+ scheduled = dirtyQueue.R >= dirtyQueue.P;
271
271
  runLaneEffects(EFFECT_RENDER);
272
272
  this.run(EFFECT_RENDER);
273
273
  runLaneEffects(EFFECT_USER);
@@ -279,9 +279,9 @@ class GlobalQueue extends Queue {
279
279
  notify(e, t, n, i) {
280
280
  if (t & STATUS_PENDING) {
281
281
  if (n & STATUS_PENDING) {
282
- const t = i !== undefined ? i : e.X;
283
- if (activeTransition && t && !activeTransition.q.includes(t.source)) {
284
- activeTransition.q.push(t.source);
282
+ const t = i !== undefined ? i : e.q;
283
+ if (activeTransition && t && !activeTransition.X.includes(t.source)) {
284
+ activeTransition.X.push(t.source);
285
285
  schedule();
286
286
  }
287
287
  }
@@ -296,14 +296,14 @@ class GlobalQueue extends Queue {
296
296
  if (!activeTransition) {
297
297
  activeTransition = e ?? {
298
298
  J: clock,
299
- F: [],
300
- q: [],
299
+ M: [],
300
+ X: [],
301
301
  $: [],
302
302
  j: new Set(),
303
303
  ee: [],
304
- B: {
304
+ Z: {
305
305
  G: [[], []],
306
- M: []
306
+ F: []
307
307
  },
308
308
  te: false
309
309
  };
@@ -323,12 +323,12 @@ class GlobalQueue extends Queue {
323
323
  }
324
324
  transitions.add(activeTransition);
325
325
  activeTransition.J = clock;
326
- for (let e = 0; e < this.F.length; e++) {
327
- const t = this.F[e];
326
+ for (let e = 0; e < this.M.length; e++) {
327
+ const t = this.M[e];
328
328
  t.ne = activeTransition;
329
- activeTransition.F.push(t);
329
+ activeTransition.M.push(t);
330
330
  }
331
- this.F = activeTransition.F;
331
+ this.M = activeTransition.M;
332
332
  for (let e = 0; e < this.$.length; e++) {
333
333
  const t = this.$[e];
334
334
  t.ne = activeTransition;
@@ -346,7 +346,7 @@ function insertSubs(e, t = false) {
346
346
  const n = e.ie || currentOptimisticLane;
347
347
  const i = e.re !== undefined;
348
348
  for (let r = e.I; r !== null; r = r.p) {
349
- if (i && r.h.se) {
349
+ if (i && r.h.oe) {
350
350
  r.h.O |= REACTIVE_SNAPSHOT_STALE;
351
351
  continue;
352
352
  }
@@ -358,48 +358,59 @@ function insertSubs(e, t = false) {
358
358
  r.h.ie = undefined;
359
359
  }
360
360
  const e = r.h;
361
- if (e.oe === EFFECT_TRACKED) {
361
+ if (e.se === EFFECT_TRACKED) {
362
362
  if (!e.ue) {
363
363
  e.ue = true;
364
- e.ce.enqueue(EFFECT_USER, e.le);
364
+ e.ce.enqueue(EFFECT_USER, e.ae);
365
365
  }
366
366
  continue;
367
367
  }
368
- const s = r.h.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue;
369
- if (s.N > r.h.o) s.N = r.h.o;
370
- insertIntoHeap(r.h, s);
368
+ const o = r.h.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue;
369
+ if (o.P > r.h.o) o.P = r.h.o;
370
+ insertIntoHeap(r.h, o);
371
+ }
372
+ }
373
+ function commitPendingNodes() {
374
+ const e = globalQueue.M;
375
+ for (let t = 0; t < e.length; t++) {
376
+ const n = e[t];
377
+ if (n.le !== NOT_PENDING) {
378
+ n.fe = n.le;
379
+ n.le = NOT_PENDING;
380
+ if (n.se && n.se !== EFFECT_TRACKED) n.ue = true;
381
+ }
382
+ if (n.Ee & STATUS_PENDING) {
383
+ const e = n.q?.source;
384
+ if (e && !(e.Ee & STATUS_PENDING)) {
385
+ n.Ee &= -6;
386
+ n.q = null;
387
+ }
388
+ } else n.Ee &= ~STATUS_UNINITIALIZED;
389
+ if (n.L) GlobalQueue.Y(n, false, true);
371
390
  }
391
+ e.length = 0;
372
392
  }
373
393
  function finalizePureQueue(e = null, t = false) {
374
394
  let n = !t;
395
+ if (n) commitPendingNodes();
375
396
  if (!t) checkBoundaryChildren(globalQueue);
376
- if (dirtyQueue.R >= dirtyQueue.N) runHeap(dirtyQueue, GlobalQueue.K);
397
+ if (dirtyQueue.R >= dirtyQueue.P) runHeap(dirtyQueue, GlobalQueue.K);
377
398
  if (n) {
378
- const t = globalQueue.F;
399
+ commitPendingNodes();
400
+ const t = e ? e.$ : globalQueue.$;
379
401
  for (let e = 0; e < t.length; e++) {
380
402
  const n = t[e];
381
- if (n.ae !== NOT_PENDING) {
382
- n.fe = n.ae;
383
- n.ae = NOT_PENDING;
384
- if (n.oe && n.oe !== EFFECT_TRACKED) n.ue = true;
403
+ n.ie = undefined;
404
+ if (n.le !== NOT_PENDING) {
405
+ n.fe = n.le;
406
+ n.le = NOT_PENDING;
385
407
  }
386
- if (!(n.Ee & STATUS_PENDING)) n.Ee &= ~STATUS_UNINITIALIZED;
387
- if (n.L) GlobalQueue.Y(n, false, true);
408
+ const i = n.Te;
409
+ n.Te = NOT_PENDING;
410
+ if (i !== NOT_PENDING && n.fe !== i) insertSubs(n, true);
411
+ n.ne = null;
388
412
  }
389
413
  t.length = 0;
390
- const n = e ? e.$ : globalQueue.$;
391
- for (let e = 0; e < n.length; e++) {
392
- const t = n[e];
393
- const i = t.ae;
394
- t.ie = undefined;
395
- if (i !== NOT_PENDING && t.fe !== i) {
396
- t.fe = i;
397
- insertSubs(t, true);
398
- }
399
- t.ae = NOT_PENDING;
400
- t.ne = null;
401
- }
402
- n.length = 0;
403
414
  e ? e.j : globalQueue.j;
404
415
  for (const t of activeLanes) {
405
416
  const n = e ? t.ne === e : !t.ne;
@@ -408,17 +419,17 @@ function finalizePureQueue(e = null, t = false) {
408
419
  if (t.W[0].length) runQueue(t.W[0], EFFECT_RENDER);
409
420
  if (t.W[1].length) runQueue(t.W[1], EFFECT_USER);
410
421
  }
411
- if (t.Te.ie === t) t.Te.ie = undefined;
422
+ if (t.de.ie === t) t.de.ie = undefined;
412
423
  t.U.clear();
413
424
  t.W[0].length = 0;
414
425
  t.W[1].length = 0;
415
426
  activeLanes.delete(t);
416
- signalLanes.delete(t.Te);
427
+ signalLanes.delete(t.de);
417
428
  }
418
429
  }
419
430
  }
420
431
  function checkBoundaryChildren(e) {
421
- for (const t of e.M) {
432
+ for (const t of e.F) {
422
433
  t.checkSources?.();
423
434
  checkBoundaryChildren(t);
424
435
  }
@@ -441,9 +452,9 @@ function transitionComplete(e) {
441
452
  if (e.te) return true;
442
453
  if (e.ee.length) return false;
443
454
  let t = true;
444
- for (let n = 0; n < e.q.length; n++) {
445
- const i = e.q[n];
446
- if (i.Ee & STATUS_PENDING && i.X?.source === i) {
455
+ for (let n = 0; n < e.X.length; n++) {
456
+ const i = e.X[n];
457
+ if (i.Ee & STATUS_PENDING && i.q?.source === i) {
447
458
  t = false;
448
459
  break;
449
460
  }
@@ -471,19 +482,19 @@ function getOrCreateLane(e) {
471
482
  if (t) {
472
483
  return findLane(t);
473
484
  }
474
- const n = e.de;
485
+ const n = e.Se;
475
486
  const i = n?.ie ? findLane(n.ie) : null;
476
487
  t = {
477
- Te: e,
488
+ de: e,
478
489
  U: new Set(),
479
490
  W: [[], []],
480
491
  k: null,
481
492
  ne: activeTransition,
482
- Se: i
493
+ Re: i
483
494
  };
484
495
  signalLanes.set(e, t);
485
496
  activeLanes.add(t);
486
- e.Re = e.Oe || 0;
497
+ e.Oe = false;
487
498
  return t;
488
499
  }
489
500
  function findLane(e) {
@@ -509,7 +520,7 @@ function resolveLane(e) {
509
520
  return undefined;
510
521
  }
511
522
  function hasActiveOverride(e) {
512
- return !!(e._e && e.ae !== NOT_PENDING);
523
+ return !!(e.Te !== undefined && e.Te !== NOT_PENDING);
513
524
  }
514
525
  function assignOrMergeLane(e, t) {
515
526
  const n = findLane(t);
@@ -522,9 +533,9 @@ function assignOrMergeLane(e, t) {
522
533
  const r = findLane(i);
523
534
  if (activeLanes.has(r)) {
524
535
  if (r !== n && !hasActiveOverride(e)) {
525
- if (n.Se && findLane(n.Se) === r) {
536
+ if (n.Re && findLane(n.Re) === r) {
526
537
  e.ie = t;
527
- } else if (r.Se && findLane(r.Se) === n) ;else mergeLanes(n, r);
538
+ } else if (r.Re && findLane(r.Re) === n) ;else mergeLanes(n, r);
528
539
  }
529
540
  return;
530
541
  }
@@ -534,42 +545,40 @@ function assignOrMergeLane(e, t) {
534
545
  function handleAsync(e, t, n) {
535
546
  const i = typeof t === "object" && t !== null;
536
547
  const r = i && untrack(() => t[Symbol.asyncIterator]);
537
- const s = !r && i && untrack(() => typeof t.then === "function");
538
- if (!s && !r) {
539
- e.Ie = null;
548
+ const o = !r && i && untrack(() => typeof t.then === "function");
549
+ if (!o && !r) {
550
+ e._e = null;
540
551
  return t;
541
552
  }
542
- e.Ie = t;
543
- let o;
553
+ e._e = t;
554
+ let s;
544
555
  const handleError = n => {
545
- if (e.Ie !== t) return;
556
+ if (e._e !== t) return;
546
557
  globalQueue.initTransition(e.ne);
547
558
  notifyStatus(e, n instanceof NotReadyError ? STATUS_PENDING : STATUS_ERROR, n);
548
559
  e.J = clock;
549
560
  };
550
561
  const asyncWrite = (i, r) => {
551
- if (e.Ie !== t) return;
562
+ if (e._e !== t) return;
552
563
  if (e.O & (REACTIVE_DIRTY | REACTIVE_OPTIMISTIC_DIRTY)) return;
553
564
  globalQueue.initTransition(e.ne);
554
565
  clearStatus(e);
555
- const s = resolveLane(e);
556
- if (s) s.U.delete(e);
557
- if (e._e) {
558
- const t = e.ae !== NOT_PENDING;
559
- if (e.L) e.ae = i;
560
- if (!t) {
566
+ const o = resolveLane(e);
567
+ if (o) o.U.delete(e);
568
+ if (e.Te !== undefined) {
569
+ if (e.Te !== undefined && e.Te !== NOT_PENDING) e.le = i;else {
561
570
  e.fe = i;
562
571
  insertSubs(e);
563
572
  }
564
573
  e.J = clock;
565
- } else if (s) {
574
+ } else if (o) {
566
575
  const t = e.fe;
567
- const n = e.pe;
576
+ const n = e.Ie;
568
577
  if (!n || !n(i, t)) {
569
578
  e.fe = i;
570
579
  e.J = clock;
571
- if (e.he) {
572
- setSignal(e.he, i);
580
+ if (e.pe) {
581
+ setSignal(e.pe, i);
573
582
  }
574
583
  insertSubs(e, true);
575
584
  }
@@ -580,12 +589,12 @@ function handleAsync(e, t, n) {
580
589
  flush();
581
590
  r?.();
582
591
  };
583
- if (s) {
592
+ if (o) {
584
593
  let n = false,
585
594
  i = true;
586
595
  t.then(e => {
587
596
  if (i) {
588
- o = e;
597
+ s = e;
589
598
  n = true;
590
599
  } else asyncWrite(e);
591
600
  }, e => {
@@ -617,7 +626,7 @@ function handleAsync(e, t, n) {
617
626
  });
618
627
  r = false;
619
628
  if (t && !e.done) {
620
- o = e.value;
629
+ s = e.value;
621
630
  i = true;
622
631
  return iterate();
623
632
  }
@@ -629,22 +638,22 @@ function handleAsync(e, t, n) {
629
638
  throw new NotReadyError(context);
630
639
  }
631
640
  }
632
- return o;
641
+ return s;
633
642
  }
634
643
  function clearStatus(e) {
635
644
  e.Ee = e.Ee & STATUS_UNINITIALIZED;
636
- e.X = null;
645
+ e.q = null;
637
646
  updatePendingSignal(e);
638
- e.Ae?.();
647
+ e.he?.();
639
648
  }
640
649
  function notifyStatus(e, t, n, i, r) {
641
650
  if (t === STATUS_ERROR && !(n instanceof StatusError) && !(n instanceof NotReadyError)) n = new StatusError(e, n);
642
- const s = n instanceof NotReadyError && n.source === e;
643
- const o = t === STATUS_PENDING && e._e && !s;
644
- const u = o && hasActiveOverride(e);
651
+ const o = n instanceof NotReadyError && n.source === e;
652
+ const s = t === STATUS_PENDING && e.Te !== undefined && !o;
653
+ const u = s && hasActiveOverride(e);
645
654
  if (!i) {
646
655
  e.Ee = t | (t !== STATUS_ERROR ? e.Ee & STATUS_UNINITIALIZED : 0);
647
- e.X = n;
656
+ e.q = n;
648
657
  updatePendingSignal(e);
649
658
  }
650
659
  if (r && !i) {
@@ -652,48 +661,48 @@ function notifyStatus(e, t, n, i, r) {
652
661
  }
653
662
  if (u && activeTransition && n instanceof NotReadyError) {
654
663
  const e = n.source;
655
- if (!activeTransition.q.includes(e)) {
656
- activeTransition.q.push(e);
664
+ if (!activeTransition.X.includes(e)) {
665
+ activeTransition.X.push(e);
657
666
  }
658
667
  }
659
668
  const c = i || u;
660
- const l = i || o ? undefined : r;
661
- if (e.Ae) {
669
+ const a = i || s ? undefined : r;
670
+ if (e.he) {
662
671
  if (c) {
663
- e.Ae(t, n);
672
+ e.he(t, n);
664
673
  } else {
665
- e.Ae();
674
+ e.he();
666
675
  }
667
676
  return;
668
677
  }
669
678
  for (let i = e.I; i !== null; i = i.p) {
670
679
  i.h.J = clock;
671
- if (i.h.X !== n) {
672
- !i.h.ne && globalQueue.F.push(i.h);
673
- notifyStatus(i.h, t, n, c, l);
680
+ if (i.h.q !== n) {
681
+ !i.h.ne && globalQueue.M.push(i.h);
682
+ notifyStatus(i.h, t, n, c, a);
674
683
  }
675
684
  }
676
- for (let i = e.A; i !== null; i = i.P) {
685
+ for (let i = e.A; i !== null; i = i.N) {
677
686
  for (let e = i.I; e !== null; e = e.p) {
678
687
  e.h.J = clock;
679
- if (e.h.X !== n) {
680
- !e.h.ne && globalQueue.F.push(e.h);
681
- notifyStatus(e.h, t, n, c, l);
688
+ if (e.h.q !== n) {
689
+ !e.h.ne && globalQueue.M.push(e.h);
690
+ notifyStatus(e.h, t, n, c, a);
682
691
  }
683
692
  }
684
693
  }
685
694
  }
686
695
  function unlinkSubs(e) {
687
- const t = e.V;
696
+ const t = e.m;
688
697
  const n = e.D;
689
698
  const i = e.p;
690
- const r = e.Pe;
691
- if (i !== null) i.Pe = r;else t.Ne = r;
699
+ const r = e.Ae;
700
+ if (i !== null) i.Ae = r;else t.Ne = r;
692
701
  if (r !== null) r.p = i;else {
693
702
  t.I = i;
694
703
  if (i === null) {
695
704
  t.ge?.();
696
- t.L && !t.Ce && !(t.O & REACTIVE_ZOMBIE) && unobserved(t);
705
+ t.L && !t.Pe && !(t.O & REACTIVE_ZOMBIE) && unobserved(t);
697
706
  }
698
707
  }
699
708
  return n;
@@ -708,31 +717,31 @@ function unobserved(e) {
708
717
  disposeChildren(e, true);
709
718
  }
710
719
  function link(e, t) {
711
- const n = t.ye;
712
- if (n !== null && n.V === e) return;
720
+ const n = t.Ce;
721
+ if (n !== null && n.m === e) return;
713
722
  let i = null;
714
723
  const r = t.O & REACTIVE_RECOMPUTING_DEPS;
715
724
  if (r) {
716
725
  i = n !== null ? n.D : t.C;
717
- if (i !== null && i.V === e) {
718
- t.ye = i;
726
+ if (i !== null && i.m === e) {
727
+ t.Ce = i;
719
728
  return;
720
729
  }
721
730
  }
722
- const s = e.Ne;
723
- if (s !== null && s.h === t && (!r || isValidLink(s, t))) return;
724
- const o = t.ye = e.Ne = {
725
- V: e,
731
+ const o = e.Ne;
732
+ if (o !== null && o.h === t && (!r || isValidLink(o, t))) return;
733
+ const s = t.Ce = e.Ne = {
734
+ m: e,
726
735
  h: t,
727
736
  D: i,
728
- Pe: s,
737
+ Ae: o,
729
738
  p: null
730
739
  };
731
- if (n !== null) n.D = o;else t.C = o;
732
- if (s !== null) s.p = o;else e.I = o;
740
+ if (n !== null) n.D = s;else t.C = s;
741
+ if (o !== null) o.p = s;else e.I = s;
733
742
  }
734
743
  function isValidLink(e, t) {
735
- const n = t.ye;
744
+ const n = t.Ce;
736
745
  if (n !== null) {
737
746
  let i = t.C;
738
747
  do {
@@ -752,15 +761,15 @@ function markDisposal(e) {
752
761
  insertIntoHeap(t, zombieQueue);
753
762
  }
754
763
  markDisposal(t);
755
- t = t.ve;
764
+ t = t.ye;
756
765
  }
757
766
  }
758
767
  function disposeChildren(e, t = false, n) {
759
768
  if (e.O & REACTIVE_DISPOSED) return;
760
769
  if (t) e.O = REACTIVE_DISPOSED;
761
- let i = n ? e.be : e.De;
770
+ let i = n ? e.ve : e.De;
762
771
  while (i) {
763
- const e = i.ve;
772
+ const e = i.ye;
764
773
  if (i.C) {
765
774
  const e = i;
766
775
  deleteFromHeap(e, e.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
@@ -769,22 +778,21 @@ function disposeChildren(e, t = false, n) {
769
778
  t = unlinkSubs(t);
770
779
  } while (t !== null);
771
780
  e.C = null;
772
- e.ye = null;
781
+ e.Ce = null;
773
782
  }
774
783
  disposeChildren(i, true);
775
784
  i = e;
776
785
  }
777
786
  if (n) {
778
- e.be = null;
787
+ e.ve = null;
779
788
  } else {
780
789
  e.De = null;
781
- e.ve = null;
782
790
  e.we = 0;
783
791
  }
784
792
  runDisposal(e, n);
785
793
  }
786
794
  function runDisposal(e, t) {
787
- let n = t ? e.Ve : e.me;
795
+ let n = t ? e.be : e.me;
788
796
  if (!n) return;
789
797
  if (Array.isArray(n)) {
790
798
  for (let e = 0; e < n.length; e++) {
@@ -794,8 +802,9 @@ function runDisposal(e, t) {
794
802
  } else {
795
803
  n.call(n);
796
804
  }
797
- t ? e.Ve = null : e.me = null;
805
+ t ? e.be = null : e.me = null;
798
806
  }
807
+ let externalSourceConfig = null;
799
808
  GlobalQueue.K = recompute;
800
809
  GlobalQueue.Y = disposeChildren;
801
810
  let tracking = false;
@@ -803,31 +812,31 @@ let stale = false;
803
812
  let context = null;
804
813
  let currentOptimisticLane = null;
805
814
  function recompute(e, t = false) {
806
- const n = e.oe;
815
+ const n = e.se;
807
816
  if (!t) {
808
817
  if (e.ne && (!n || activeTransition) && activeTransition !== e.ne) globalQueue.initTransition(e.ne);
809
818
  deleteFromHeap(e, e.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
810
819
  if (e.ne || n === EFFECT_TRACKED) disposeChildren(e);else {
811
820
  markDisposal(e);
812
- e.Ve = e.me;
813
- e.be = e.De;
821
+ e.be = e.me;
822
+ e.ve = e.De;
814
823
  e.me = null;
815
824
  e.De = null;
816
825
  e.we = 0;
817
826
  }
818
827
  }
819
828
  const i = !!(e.O & REACTIVE_OPTIMISTIC_DIRTY);
820
- const r = hasActiveOverride(e);
821
- const s = !!(e.Ee & STATUS_PENDING);
822
- const o = context;
829
+ const r = e.Te !== undefined && e.Te !== NOT_PENDING;
830
+ const o = !!(e.Ee & STATUS_PENDING);
831
+ const s = context;
823
832
  context = e;
824
- e.ye = null;
833
+ e.Ce = null;
825
834
  e.O = REACTIVE_RECOMPUTING_DEPS;
826
835
  e.J = clock;
827
- let u = e.ae === NOT_PENDING ? e.fe : e.ae;
836
+ let u = e.le === NOT_PENDING ? e.fe : e.le;
828
837
  let c = e.o;
829
- let l = tracking;
830
- let a = currentOptimisticLane;
838
+ let a = tracking;
839
+ let l = currentOptimisticLane;
831
840
  tracking = true;
832
841
  if (i) {
833
842
  const t = resolveLane(e);
@@ -839,62 +848,62 @@ function recompute(e, t = false) {
839
848
  const t = resolveLane(e);
840
849
  if (t) {
841
850
  t.U.delete(e);
842
- updatePendingSignal(t.Te);
851
+ updatePendingSignal(t.de);
843
852
  }
844
853
  } catch (t) {
845
854
  if (t instanceof NotReadyError && currentOptimisticLane) {
846
855
  const t = findLane(currentOptimisticLane);
847
- if (t.Te !== e) {
856
+ if (t.de !== e) {
848
857
  t.U.add(e);
849
858
  e.ie = t;
850
- updatePendingSignal(t.Te);
859
+ updatePendingSignal(t.de);
851
860
  }
852
861
  }
853
862
  notifyStatus(e, t instanceof NotReadyError ? STATUS_PENDING : STATUS_ERROR, t, undefined, t instanceof NotReadyError ? e.ie : undefined);
854
863
  } finally {
855
- tracking = l;
864
+ tracking = a;
856
865
  e.O = REACTIVE_NONE | (t ? e.O & REACTIVE_SNAPSHOT_STALE : 0);
857
- context = o;
866
+ context = s;
858
867
  }
859
- if (!e.X) {
860
- const o = e.ye;
861
- let l = o !== null ? o.D : e.C;
862
- if (l !== null) {
868
+ if (!e.q) {
869
+ const s = e.Ce;
870
+ let a = s !== null ? s.D : e.C;
871
+ if (a !== null) {
863
872
  do {
864
- l = unlinkSubs(l);
865
- } while (l !== null);
866
- if (o !== null) o.D = null;else e.C = null;
873
+ a = unlinkSubs(a);
874
+ } while (a !== null);
875
+ if (s !== null) s.D = null;else e.C = null;
867
876
  }
868
- const a = r ? e.fe : e.ae === NOT_PENDING ? e.fe : e.ae;
869
- const f = !e.pe || !e.pe(a, u);
877
+ const l = r ? e.Te : e.le === NOT_PENDING ? e.fe : e.le;
878
+ const f = !e.Ie || !e.Ie(l, u);
870
879
  if (f) {
871
- const o = r ? e.fe : undefined;
872
- if (t || n && activeTransition !== e.ne || i) e.fe = u;else e.ae = u;
873
- if (r && !i && s) {
874
- const t = e.Oe || 0;
875
- const n = e.Re || 0;
876
- if (t <= n) e.fe = u;
877
- }
878
- if (!r || i || e.fe !== o) {
879
- insertSubs(e, i || r);
880
- }
880
+ const s = r ? e.Te : undefined;
881
+ if (t || n && activeTransition !== e.ne || i) {
882
+ e.fe = u;
883
+ if (r && i) {
884
+ e.Te = u;
885
+ e.le = u;
886
+ }
887
+ } else e.le = u;
888
+ if (r && !i && o && !e.Oe) e.Te = u;
889
+ if (!r || i || e.Te !== s) insertSubs(e, i || r);
881
890
  } else if (r) {
882
- e.ae = u;
891
+ e.le = u;
883
892
  } else if (e.o != c) {
884
893
  for (let t = e.I; t !== null; t = t.p) {
885
894
  insertIntoHeapHeight(t.h, t.h.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
886
895
  }
887
896
  }
888
897
  }
889
- currentOptimisticLane = a;
890
- (!t || e.Ee & STATUS_PENDING) && !e.ne && !(activeTransition && e._e) && globalQueue.F.push(e);
898
+ currentOptimisticLane = l;
899
+ (!t || e.Ee & STATUS_PENDING) && !e.ne && !(activeTransition && r) && globalQueue.M.push(e);
891
900
  e.ne && n && activeTransition !== e.ne && runInTransition(e.ne, () => recompute(e));
892
901
  }
893
902
  function updateIfNecessary(e) {
894
903
  if (e.O & REACTIVE_CHECK) {
895
904
  for (let t = e.C; t; t = t.D) {
896
- const n = t.V;
897
- const i = n.m || n;
905
+ const n = t.m;
906
+ const i = n.V || n;
898
907
  if (i.L) {
899
908
  updateIfNecessary(i);
900
909
  }
@@ -903,7 +912,7 @@ function updateIfNecessary(e) {
903
912
  }
904
913
  }
905
914
  }
906
- if (e.O & (REACTIVE_DIRTY | REACTIVE_OPTIMISTIC_DIRTY) || e.X && e.J < clock && !e.Ie) {
915
+ if (e.O & (REACTIVE_DIRTY | REACTIVE_OPTIMISTIC_DIRTY) || e.q && e.J < clock && !e._e) {
907
916
  recompute(e);
908
917
  }
909
918
  e.O = REACTIVE_NONE | e.O & REACTIVE_SNAPSHOT_STALE;
@@ -912,13 +921,13 @@ function computed(e, t, n) {
912
921
  const i = n?.transparent;
913
922
  const r = {
914
923
  id: n?.id ?? (context?.id ),
915
- Le: i,
916
- pe: n?.equals != null ? n.equals : isEqual,
924
+ Ve: i,
925
+ Ie: n?.equals != null ? n.equals : isEqual,
917
926
  Ge: !!n?.pureWrite,
918
927
  ge: n?.unobserved,
919
928
  me: null,
920
929
  ce: context?.ce ?? globalQueue,
921
- ke: context?.ke ?? defaultContext,
930
+ Le: context?.Le ?? defaultContext,
922
931
  we: 0,
923
932
  L: e,
924
933
  fe: t,
@@ -927,33 +936,33 @@ function computed(e, t, n) {
927
936
  S: undefined,
928
937
  T: null,
929
938
  C: null,
930
- ye: null,
939
+ Ce: null,
931
940
  I: null,
932
941
  Ne: null,
933
942
  i: context,
934
- ve: null,
943
+ ye: null,
935
944
  De: null,
936
945
  O: n?.lazy ? REACTIVE_LAZY : REACTIVE_NONE,
937
946
  Ee: STATUS_UNINITIALIZED,
938
947
  J: clock,
939
- ae: NOT_PENDING,
940
- Ve: null,
948
+ le: NOT_PENDING,
941
949
  be: null,
942
- Ie: null,
950
+ ve: null,
951
+ _e: null,
943
952
  ne: null
944
953
  };
945
954
  r.T = r;
946
- const s = context?.t ? context.u : context;
955
+ const o = context?.t ? context.u : context;
947
956
  if (context) {
948
957
  const e = context.De;
949
958
  if (e === null) {
950
959
  context.De = r;
951
960
  } else {
952
- r.ve = e;
961
+ r.ye = e;
953
962
  context.De = r;
954
963
  }
955
964
  }
956
- if (s) r.o = s.o + 1;
965
+ if (o) r.o = o.o + 1;
957
966
  !n?.lazy && recompute(r, true);
958
967
  return r;
959
968
  }
@@ -965,6 +974,7 @@ function untrack(e, t) {
965
974
  const n = tracking;
966
975
  tracking = false;
967
976
  try {
977
+ if (externalSourceConfig) ;
968
978
  return e();
969
979
  } finally {
970
980
  tracking = n;
@@ -977,13 +987,13 @@ function read(e) {
977
987
  e.O &= ~REACTIVE_LAZY;
978
988
  recompute(e, true);
979
989
  }
980
- const n = e.m || e;
990
+ const n = e.V || e;
981
991
  if (t && tracking) {
982
992
  if (e.L && e.O & REACTIVE_DISPOSED) recompute(e);
983
993
  link(e, t);
984
994
  if (n.L) {
985
995
  const i = e.O & REACTIVE_ZOMBIE;
986
- if (n.o >= (i ? zombieQueue.N : dirtyQueue.N)) {
996
+ if (n.o >= (i ? zombieQueue.P : dirtyQueue.P)) {
987
997
  markNode(t);
988
998
  markHeap(i ? zombieQueue : dirtyQueue);
989
999
  updateIfNecessary(n);
@@ -995,65 +1005,64 @@ function read(e) {
995
1005
  }
996
1006
  }
997
1007
  if (n.Ee & STATUS_PENDING) {
998
- if (t && true) {
1008
+ const i = n.q?.source;
1009
+ if (i && !(i.Ee & STATUS_PENDING)) clearStatus(n);else if (t && true) {
999
1010
  if (currentOptimisticLane) {
1000
1011
  const i = n.ie;
1001
1012
  const r = findLane(currentOptimisticLane);
1002
1013
  if (i && findLane(i) === r && !hasActiveOverride(n)) {
1003
- if (!tracking) link(e, t);
1004
- throw n.X;
1014
+ if (!tracking && e !== t) link(e, t);
1015
+ throw n.q;
1005
1016
  }
1006
1017
  } else {
1007
- if (!tracking) link(e, t);
1008
- throw n.X;
1018
+ if (!tracking && e !== t) link(e, t);
1019
+ throw n.q;
1009
1020
  }
1010
1021
  } else if (!t && n.Ee & STATUS_UNINITIALIZED) {
1011
- throw n.X;
1022
+ throw n.q;
1012
1023
  }
1013
1024
  }
1014
1025
  if (e.L && e.Ee & STATUS_ERROR) {
1015
1026
  if (e.J < clock) {
1016
1027
  recompute(e, true);
1017
1028
  return read(e);
1018
- } else throw e.X;
1029
+ } else throw e.q;
1019
1030
  }
1020
- return !t || currentOptimisticLane !== null && (e._e || e.ie || n === e || !!(n.Ee & STATUS_PENDING)) || e.ae === NOT_PENDING || stale ? e.fe : e.ae;
1031
+ if (e.Te !== undefined && e.Te !== NOT_PENDING) return e.Te;
1032
+ return !t || currentOptimisticLane !== null && (e.Te !== undefined || e.ie || n === e && stale || !!(n.Ee & STATUS_PENDING)) || e.le === NOT_PENDING || stale ? e.fe : e.le;
1021
1033
  }
1022
1034
  function setSignal(e, t) {
1023
1035
  if (e.ne && activeTransition !== e.ne) globalQueue.initTransition(e.ne);
1024
- const n = e._e && true;
1025
- const i = n ? e.fe : e.ae === NOT_PENDING ? e.fe : e.ae;
1026
- if (typeof t === "function") t = t(i);
1027
- const r = !e.pe || !e.pe(i, t) || !!(e.Ee & STATUS_UNINITIALIZED);
1028
- if (!r) {
1029
- if (n && e.ae !== NOT_PENDING && e.L) {
1036
+ const n = e.Te !== undefined && true;
1037
+ const i = e.Te !== undefined && e.Te !== NOT_PENDING;
1038
+ const r = n ? i ? e.Te : e.fe : e.le === NOT_PENDING ? e.fe : e.le;
1039
+ if (typeof t === "function") t = t(r);
1040
+ const o = !e.Ie || !e.Ie(r, t) || !!(e.Ee & STATUS_UNINITIALIZED);
1041
+ if (!o) {
1042
+ if (n && i && e.L) {
1030
1043
  insertSubs(e, true);
1031
1044
  schedule();
1032
1045
  }
1033
1046
  return t;
1034
1047
  }
1035
1048
  if (n) {
1036
- const n = globalQueue.$.includes(e);
1037
- if (e.ne && n) {
1038
- globalQueue.initTransition(e.ne);
1039
- }
1040
- if (e.ae === NOT_PENDING) {
1041
- e.ae = e.fe;
1042
- }
1043
- if (!n) {
1049
+ const n = e.Te === NOT_PENDING;
1050
+ if (!n && e.ne) globalQueue.initTransition(e.ne);
1051
+ if (n) {
1052
+ e.le = e.fe;
1044
1053
  globalQueue.$.push(e);
1045
1054
  }
1046
- e.Oe = (e.Oe || 0) + 1;
1055
+ e.Oe = true;
1047
1056
  const i = getOrCreateLane(e);
1048
1057
  e.ie = i;
1049
- e.fe = t;
1058
+ e.Te = t;
1050
1059
  } else {
1051
- if (e.ae === NOT_PENDING) globalQueue.F.push(e);
1052
- e.ae = t;
1060
+ if (e.le === NOT_PENDING) globalQueue.M.push(e);
1061
+ e.le = t;
1053
1062
  }
1054
1063
  updatePendingSignal(e);
1055
- if (e.he) {
1056
- setSignal(e.he, t);
1064
+ if (e.pe) {
1065
+ setSignal(e.pe, t);
1057
1066
  }
1058
1067
  e.J = clock;
1059
1068
  insertSubs(e, n);
@@ -1062,21 +1071,21 @@ function setSignal(e, t) {
1062
1071
  }
1063
1072
  function computePendingState(e) {
1064
1073
  const t = e;
1065
- if (e._e && e.ae !== NOT_PENDING) {
1074
+ if (e.Te !== undefined && e.Te !== NOT_PENDING) {
1066
1075
  if (t.Ee & STATUS_PENDING && !(t.Ee & STATUS_UNINITIALIZED)) return true;
1067
- if (e.de) {
1076
+ if (e.Se) {
1068
1077
  const t = e.ie ? findLane(e.ie) : null;
1069
1078
  return !!(t && t.U.size > 0);
1070
1079
  }
1071
1080
  return true;
1072
1081
  }
1073
- if (e.ae !== NOT_PENDING && !(t.Ee & STATUS_UNINITIALIZED)) return true;
1082
+ if (e.le !== NOT_PENDING && !(t.Ee & STATUS_UNINITIALIZED)) return true;
1074
1083
  return !!(t.Ee & STATUS_PENDING && !(t.Ee & STATUS_UNINITIALIZED));
1075
1084
  }
1076
1085
  function updatePendingSignal(e) {
1077
- if (e.Me) {
1086
+ if (e.Fe) {
1078
1087
  const t = computePendingState(e);
1079
- const n = e.Me;
1088
+ const n = e.Fe;
1080
1089
  setSignal(n, t);
1081
1090
  if (!t && n.ie) {
1082
1091
  const t = resolveLane(e);
@@ -1091,9 +1100,14 @@ function updatePendingSignal(e) {
1091
1100
  }
1092
1101
  }
1093
1102
  }
1103
+ function accessor(e) {
1104
+ const t = read.bind(null, e);
1105
+ t.$r = true;
1106
+ return t;
1107
+ }
1094
1108
  function createMemo(e, t, n) {
1095
1109
  let i = computed(e, t, n);
1096
- return read.bind(null, i);
1110
+ return accessor(i);
1097
1111
  }
1098
1112
  function isWrappable(e) {
1099
1113
  return e != null && typeof e === "object" && !Object.isFrozen(e);
@@ -1104,8 +1118,8 @@ function updatePath(e, t, n = 0) {
1104
1118
  r = e;
1105
1119
  if (n < t.length - 1) {
1106
1120
  i = t[n];
1107
- const s = typeof i;
1108
- const o = Array.isArray(e);
1121
+ const o = typeof i;
1122
+ const s = Array.isArray(e);
1109
1123
  if (Array.isArray(i)) {
1110
1124
  for (let r = 0; r < i.length; r++) {
1111
1125
  t[n] = i[r];
@@ -1113,7 +1127,7 @@ function updatePath(e, t, n = 0) {
1113
1127
  }
1114
1128
  t[n] = i;
1115
1129
  return;
1116
- } else if (o && s === "function") {
1130
+ } else if (s && o === "function") {
1117
1131
  for (let r = 0; r < e.length; r++) {
1118
1132
  if (i(e[r], r)) {
1119
1133
  t[n] = r;
@@ -1122,13 +1136,13 @@ function updatePath(e, t, n = 0) {
1122
1136
  }
1123
1137
  t[n] = i;
1124
1138
  return;
1125
- } else if (o && s === "object") {
1139
+ } else if (s && o === "object") {
1126
1140
  const {
1127
1141
  from: r = 0,
1128
- to: s = e.length - 1,
1129
- by: o = 1
1142
+ to: o = e.length - 1,
1143
+ by: s = 1
1130
1144
  } = i;
1131
- for (let i = r; i <= s; i += o) {
1145
+ for (let i = r; i <= o; i += s) {
1132
1146
  t[n] = i;
1133
1147
  updatePath(e, t, n);
1134
1148
  }
@@ -1140,20 +1154,20 @@ function updatePath(e, t, n = 0) {
1140
1154
  }
1141
1155
  r = e[i];
1142
1156
  }
1143
- let s = t[t.length - 1];
1144
- if (typeof s === "function") {
1145
- s = s(r);
1146
- if (s === r) return;
1157
+ let o = t[t.length - 1];
1158
+ if (typeof o === "function") {
1159
+ o = o(r);
1160
+ if (o === r) return;
1147
1161
  }
1148
- if (i === undefined && s == undefined) return;
1149
- if (s === DELETE) {
1162
+ if (i === undefined && o == undefined) return;
1163
+ if (o === DELETE) {
1150
1164
  delete e[i];
1151
- } else if (i === undefined || isWrappable(r) && isWrappable(s) && !Array.isArray(s)) {
1165
+ } else if (i === undefined || isWrappable(r) && isWrappable(o) && !Array.isArray(o)) {
1152
1166
  const t = i !== undefined ? e[i] : e;
1153
- const n = Object.keys(s);
1154
- for (let e = 0; e < n.length; e++) t[n[e]] = s[n[e]];
1167
+ const n = Object.keys(o);
1168
+ for (let e = 0; e < n.length; e++) t[n[e]] = o[n[e]];
1155
1169
  } else {
1156
- e[i] = s;
1170
+ e[i] = o;
1157
1171
  }
1158
1172
  }
1159
1173
  Object.assign(function storePath(...e) {