@solidjs/signals 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/prod.js CHANGED
@@ -40,56 +40,56 @@ function actualInsertIntoHeap(e, t) {
40
40
  if (r === undefined) t.l[i] = e;
41
41
  else {
42
42
  const t = r.T;
43
- t.h = e;
43
+ t.R = e;
44
44
  e.T = t;
45
45
  r.T = e;
46
46
  }
47
- if (i > t.R) t.R = i;
47
+ if (i > t.h) t.h = i;
48
48
  }
49
49
  function insertIntoHeap(e, t) {
50
- let n = e._;
50
+ let n = e.S;
51
51
  if (n & (REACTIVE_IN_HEAP | REACTIVE_RECOMPUTING_DEPS)) return;
52
52
  if (n & REACTIVE_CHECK) {
53
- e._ = (n & -4) | REACTIVE_DIRTY | REACTIVE_IN_HEAP;
54
- } else e._ = n | REACTIVE_IN_HEAP;
53
+ e.S = (n & -4) | REACTIVE_DIRTY | REACTIVE_IN_HEAP;
54
+ } else e.S = n | REACTIVE_IN_HEAP;
55
55
  if (!(n & REACTIVE_IN_HEAP_HEIGHT)) actualInsertIntoHeap(e, t);
56
56
  }
57
57
  function insertIntoHeapHeight(e, t) {
58
- let n = e._;
58
+ let n = e.S;
59
59
  if (n & (REACTIVE_IN_HEAP | REACTIVE_RECOMPUTING_DEPS | REACTIVE_IN_HEAP_HEIGHT)) return;
60
- e._ = n | REACTIVE_IN_HEAP_HEIGHT;
60
+ e.S = n | REACTIVE_IN_HEAP_HEIGHT;
61
61
  actualInsertIntoHeap(e, t);
62
62
  }
63
63
  function deleteFromHeap(e, t) {
64
- const n = e._;
64
+ const n = e.S;
65
65
  if (!(n & (REACTIVE_IN_HEAP | REACTIVE_IN_HEAP_HEIGHT))) return;
66
- e._ = n & -25;
66
+ e.S = n & -25;
67
67
  const i = e.o;
68
68
  if (e.T === e) t.l[i] = undefined;
69
69
  else {
70
- const n = e.h;
70
+ const n = e.R;
71
71
  const r = t.l[i];
72
72
  const s = n ?? r;
73
73
  if (e === r) t.l[i] = n;
74
- else e.T.h = n;
74
+ else e.T.R = n;
75
75
  s.T = e.T;
76
76
  }
77
77
  e.T = e;
78
- e.h = undefined;
78
+ e.R = undefined;
79
79
  }
80
80
  function markHeap(e) {
81
- if (e.S) return;
82
- e.S = true;
83
- for (let t = 0; t <= e.R; t++) {
84
- for (let n = e.l[t]; n !== undefined; n = n.h) {
85
- if (n._ & REACTIVE_IN_HEAP) markNode(n);
81
+ if (e._) return;
82
+ e._ = true;
83
+ for (let t = 0; t <= e.h; t++) {
84
+ for (let n = e.l[t]; n !== undefined; n = n.R) {
85
+ if (n.S & REACTIVE_IN_HEAP) markNode(n);
86
86
  }
87
87
  }
88
88
  }
89
89
  function markNode(e, t = REACTIVE_DIRTY) {
90
- const n = e._;
90
+ const n = e.S;
91
91
  if ((n & (REACTIVE_CHECK | REACTIVE_DIRTY)) >= t) return;
92
- e._ = (n & -4) | t;
92
+ e.S = (n & -4) | t;
93
93
  for (let t = e.O; t !== null; t = t.p) {
94
94
  markNode(t.A, REACTIVE_CHECK);
95
95
  }
@@ -102,24 +102,24 @@ function markNode(e, t = REACTIVE_DIRTY) {
102
102
  }
103
103
  }
104
104
  function runHeap(e, t) {
105
- e.S = false;
106
- for (e.C = 0; e.C <= e.R; e.C++) {
105
+ e._ = false;
106
+ for (e.C = 0; e.C <= e.h; e.C++) {
107
107
  let n = e.l[e.C];
108
108
  while (n !== undefined) {
109
- if (n._ & REACTIVE_IN_HEAP) t(n);
109
+ if (n.S & REACTIVE_IN_HEAP) t(n);
110
110
  else adjustHeight(n, e);
111
111
  n = e.l[e.C];
112
112
  }
113
113
  }
114
- e.R = 0;
114
+ e.h = 0;
115
115
  }
116
116
  function adjustHeight(e, t) {
117
117
  deleteFromHeap(e, t);
118
118
  let n = e.o;
119
119
  for (let t = e.D; t; t = t.P) {
120
120
  const e = t.V;
121
- const i = e.U || e;
122
- if (i.m && i.o >= n) n = i.o + 1;
121
+ const i = e.m || e;
122
+ if (i.U && i.o >= n) n = i.o + 1;
123
123
  }
124
124
  if (e.o !== n) {
125
125
  e.o = n;
@@ -129,8 +129,9 @@ function adjustHeight(e, t) {
129
129
  }
130
130
  }
131
131
  const transitions = new Set();
132
- const dirtyQueue = { l: new Array(2e3).fill(undefined), S: false, C: 0, R: 0 };
133
- const zombieQueue = { l: new Array(2e3).fill(undefined), S: false, C: 0, R: 0 };
132
+ let optimisticRun = false;
133
+ const dirtyQueue = { l: new Array(2e3).fill(undefined), _: false, C: 0, h: 0 };
134
+ const zombieQueue = { l: new Array(2e3).fill(undefined), _: false, C: 0, h: 0 };
134
135
  let clock = 0;
135
136
  let activeTransition = null;
136
137
  let scheduled = false;
@@ -200,22 +201,25 @@ class Queue {
200
201
  class GlobalQueue extends Queue {
201
202
  k = false;
202
203
  $ = [];
203
- static L;
204
+ L = [];
204
205
  static F;
206
+ static W;
205
207
  flush() {
206
208
  if (this.k) return;
207
209
  this.k = true;
208
210
  try {
209
- runHeap(dirtyQueue, GlobalQueue.L);
211
+ runHeap(dirtyQueue, GlobalQueue.F);
210
212
  if (activeTransition) {
211
213
  if (!transitionComplete(activeTransition)) {
212
- runHeap(zombieQueue, GlobalQueue.L);
214
+ let e = activeTransition;
215
+ runHeap(zombieQueue, GlobalQueue.F);
213
216
  this.$ = [];
214
217
  this.stashQueues(activeTransition.queueStash);
215
218
  clock++;
216
219
  scheduled = false;
217
220
  runTransitionPending(activeTransition.pendingNodes, true);
218
221
  activeTransition = null;
222
+ runOptimistic(e);
219
223
  return;
220
224
  }
221
225
  this.$.push(...activeTransition.pendingNodes);
@@ -223,13 +227,8 @@ class GlobalQueue extends Queue {
223
227
  transitions.delete(activeTransition);
224
228
  activeTransition = null;
225
229
  runTransitionPending(this.$, false);
226
- dirtyQueue.R >= dirtyQueue.C && runHeap(dirtyQueue, GlobalQueue.L);
227
- } else if (transitions.size) runHeap(zombieQueue, GlobalQueue.L);
228
- runPending(this.$);
229
- while (dirtyQueue.R >= dirtyQueue.C) {
230
- runHeap(dirtyQueue, GlobalQueue.L);
231
- runPending(this.$);
232
- }
230
+ } else if (transitions.size) runHeap(zombieQueue, GlobalQueue.F);
231
+ runOptimistic();
233
232
  clock++;
234
233
  scheduled = false;
235
234
  this.run(EFFECT_RENDER);
@@ -241,8 +240,8 @@ class GlobalQueue extends Queue {
241
240
  notify(e, t, n) {
242
241
  if (t & STATUS_PENDING) {
243
242
  if (n & STATUS_PENDING) {
244
- if (activeTransition && !activeTransition.asyncNodes.includes(e.W.cause)) {
245
- activeTransition.asyncNodes.push(e.W.cause);
243
+ if (activeTransition && !activeTransition.asyncNodes.includes(e.j.cause)) {
244
+ activeTransition.asyncNodes.push(e.j.cause);
246
245
  schedule();
247
246
  }
248
247
  }
@@ -253,33 +252,68 @@ class GlobalQueue extends Queue {
253
252
  initTransition(e) {
254
253
  if (activeTransition && activeTransition.time === clock) return;
255
254
  if (!activeTransition) {
256
- activeTransition = e.j ?? {
255
+ activeTransition = e.K ?? {
257
256
  time: clock,
258
257
  pendingNodes: [],
259
258
  asyncNodes: [],
260
- queueStash: { G: [[], []], H: [] }
259
+ optimisticNodes: [],
260
+ queueStash: { G: [[], []], H: [] },
261
+ done: false
261
262
  };
262
263
  }
263
264
  transitions.add(activeTransition);
264
265
  activeTransition.time = clock;
265
266
  for (let e = 0; e < this.$.length; e++) {
266
267
  const t = this.$[e];
267
- t.j = activeTransition;
268
+ t.K = activeTransition;
268
269
  activeTransition.pendingNodes.push(t);
269
270
  }
271
+ for (let e = 0; e < this.L.length; e++) {
272
+ const t = this.L[e];
273
+ t.K = activeTransition;
274
+ activeTransition.optimisticNodes.push(t);
275
+ }
270
276
  this.$ = activeTransition.pendingNodes;
277
+ this.L = activeTransition.optimisticNodes;
278
+ }
279
+ }
280
+ function notifySubs(e) {
281
+ for (let t = e.O; t !== null; t = t.p) {
282
+ const e = t.A.S & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue;
283
+ if (e.C > t.A.o) e.C = t.A.o;
284
+ insertIntoHeap(t.A, e);
271
285
  }
272
286
  }
287
+ function runOptimistic(e = null) {
288
+ let t = !e;
289
+ const n = globalQueue.L;
290
+ optimisticRun = true;
291
+ for (let t = 0; t < n.length; t++) {
292
+ const i = n[t];
293
+ if (!e && (!i.K || i.K.done) && i.M !== NOT_PENDING) {
294
+ i.Y = i.M;
295
+ i.M = NOT_PENDING;
296
+ }
297
+ i.K = e;
298
+ notifySubs(i);
299
+ }
300
+ globalQueue.L = [];
301
+ if (dirtyQueue.h >= dirtyQueue.C) {
302
+ t = true;
303
+ runHeap(dirtyQueue, GlobalQueue.F);
304
+ }
305
+ optimisticRun = false;
306
+ t && runPending(globalQueue.$);
307
+ }
273
308
  function runPending(e) {
274
309
  for (let t = 0; t < e.length; t++) {
275
310
  const n = e[t];
276
- if (n.K !== NOT_PENDING) {
277
- n.M = n.K;
278
- n.K = NOT_PENDING;
279
- if (n.Y) n.B = true;
311
+ if (n.M !== NOT_PENDING) {
312
+ n.Y = n.M;
313
+ n.M = NOT_PENDING;
314
+ if (n.B) n.X = true;
280
315
  }
281
- if (n.X && n.X.K !== NOT_PENDING) n.X.q(n.X.K);
282
- if (n.m) GlobalQueue.F(n, false, true);
316
+ if (n.U) GlobalQueue.W(n, false, true);
283
317
  }
284
318
  e.length = 0;
285
319
  }
@@ -287,12 +321,8 @@ function runTransitionPending(e, t) {
287
321
  const n = e.slice();
288
322
  for (let e = 0; e < n.length; e++) {
289
323
  const i = n[e];
290
- i.j = activeTransition;
291
- if (i.Z) i.Z.q(t);
292
- if (i.X && i.X.K !== NOT_PENDING) {
293
- i.X.q(i.X.K);
294
- i.X.K = NOT_PENDING;
295
- }
324
+ i.K = activeTransition;
325
+ if (i.q) i.q.Z(t);
296
326
  }
297
327
  }
298
328
  const globalQueue = new GlobalQueue();
@@ -305,6 +335,7 @@ function runQueue(e, t) {
305
335
  for (let n = 0; n < e.length; n++) e[n](t);
306
336
  }
307
337
  function transitionComplete(e) {
338
+ if (e.done) return true;
308
339
  let t = true;
309
340
  for (let n = 0; n < e.asyncNodes.length; n++) {
310
341
  if (e.asyncNodes[n].J & STATUS_PENDING) {
@@ -312,35 +343,29 @@ function transitionComplete(e) {
312
343
  break;
313
344
  }
314
345
  }
346
+ t && (e.done = true);
315
347
  return t;
316
348
  }
317
349
  function runInTransition(e, t) {
318
350
  const n = activeTransition;
319
- activeTransition = e.j;
351
+ activeTransition = e.K;
320
352
  t(e);
321
353
  activeTransition = n;
322
354
  }
323
- GlobalQueue.L = recompute;
324
- GlobalQueue.F = disposeChildren;
355
+ GlobalQueue.F = recompute;
356
+ GlobalQueue.W = disposeChildren;
325
357
  let tracking = false;
326
358
  let stale = false;
327
359
  let pendingValueCheck = false;
328
360
  let pendingCheck = null;
329
361
  let refreshing = false;
330
362
  let context = null;
331
- function notifySubs(e) {
332
- for (let t = e.O; t !== null; t = t.p) {
333
- const e = t.A._ & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue;
334
- if (e.C > t.A.o) e.C = t.A.o;
335
- insertIntoHeap(t.A, e);
336
- }
337
- }
338
363
  function recompute(e, t = false) {
339
- const n = e.Y && e.j != activeTransition;
364
+ const n = e.B && e.K != activeTransition;
340
365
  if (!t) {
341
- if (e.j && activeTransition !== e.j && !n) globalQueue.initTransition(e);
342
- deleteFromHeap(e, e._ & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
343
- if (e.j) disposeChildren(e);
366
+ if (e.K && activeTransition !== e.K && !n) globalQueue.initTransition(e);
367
+ deleteFromHeap(e, e.S & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
368
+ if (e.K) disposeChildren(e);
344
369
  else {
345
370
  markDisposal(e);
346
371
  e.ee = e.te;
@@ -352,17 +377,17 @@ function recompute(e, t = false) {
352
377
  const i = context;
353
378
  context = e;
354
379
  e.re = null;
355
- e._ = REACTIVE_RECOMPUTING_DEPS;
380
+ e.S = REACTIVE_RECOMPUTING_DEPS;
356
381
  e.se = clock;
357
- let r = e.K === NOT_PENDING ? e.M : e.K;
382
+ let r = e.M === NOT_PENDING || (e.oe && e.K) ? e.Y : e.M;
358
383
  let s = e.o;
359
384
  let o = e.J;
360
- let u = e.W;
385
+ let u = e.j;
361
386
  let l = tracking;
362
387
  setStatusFlags(e, STATUS_NONE | (o & STATUS_UNINITIALIZED));
363
388
  tracking = true;
364
389
  try {
365
- r = handleAsync(e, e.m(r));
390
+ r = handleAsync(e, e.U(r));
366
391
  e.J &= ~STATUS_UNINITIALIZED;
367
392
  } catch (t) {
368
393
  if (t instanceof NotReadyError) {
@@ -372,7 +397,7 @@ function recompute(e, t = false) {
372
397
  } finally {
373
398
  tracking = l;
374
399
  }
375
- e._ = REACTIVE_NONE;
400
+ e.S = REACTIVE_NONE;
376
401
  context = i;
377
402
  if (!(e.J & STATUS_PENDING)) {
378
403
  const t = e.re;
@@ -385,45 +410,42 @@ function recompute(e, t = false) {
385
410
  else e.D = null;
386
411
  }
387
412
  }
388
- const c = !e.oe || !e.oe(e.K === NOT_PENDING || e.ue || n ? e.M : e.K, r);
389
- const a = e.J !== o || e.W !== u;
413
+ const c = !e.ue || !e.ue(e.M === NOT_PENDING || e.oe || n ? e.Y : e.M, r);
414
+ const a = e.J !== o || e.j !== u;
390
415
  e.le?.(a, o);
391
416
  if (c || a) {
392
417
  if (c) {
393
- if (t || e.ue || n) e.M = r;
394
- else e.K = r;
395
- if (e.X) e.X.K = r;
396
- }
397
- for (let t = e.O; t !== null; t = t.p) {
398
- const n = t.A._ & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue;
399
- if (t.A.o < e.o && n.C > t.A.o) n.C = t.A.o;
400
- insertIntoHeap(t.A, n);
418
+ if (t || e.oe || n) e.Y = r;
419
+ else e.M = r;
420
+ if (e.ce) setSignal(e.ce, r);
401
421
  }
422
+ (!e.oe || optimisticRun) && notifySubs(e);
402
423
  } else if (e.o != s) {
403
424
  for (let t = e.O; t !== null; t = t.p) {
404
- insertIntoHeapHeight(t.A, t.A._ & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
425
+ insertIntoHeapHeight(t.A, t.A.S & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
405
426
  }
406
427
  }
407
- if ((!t || e.J & STATUS_PENDING) && !e.ue && !e.j) globalQueue.$.push(e);
408
- if (e.j && n) runInTransition(e, recompute);
428
+ e.oe && !optimisticRun && globalQueue.L.push(e);
429
+ (!t || e.J & STATUS_PENDING) && !e.K && globalQueue.$.push(e);
430
+ e.K && n && runInTransition(e, recompute);
409
431
  }
410
432
  function handleAsync(e, t, n) {
411
433
  const i = typeof t === "object" && t !== null;
412
434
  const r = i && t instanceof Promise;
413
435
  const s = i && untrack(() => t[Symbol.asyncIterator]);
414
436
  if (!r && !s) {
415
- e.ce = null;
437
+ e.ae = null;
416
438
  return t;
417
439
  }
418
- e.ce = t;
440
+ e.ae = t;
419
441
  if (r) {
420
442
  t.then(i => {
421
- if (e.ce !== t) return;
443
+ if (e.ae !== t) return;
422
444
  globalQueue.initTransition(e);
423
445
  n?.(i) ?? setSignal(e, () => i);
424
446
  flush();
425
447
  }).catch(n => {
426
- if (e.ce !== t) return;
448
+ if (e.ae !== t) return;
427
449
  globalQueue.initTransition(e);
428
450
  setStatusFlags(e, STATUS_ERROR, n);
429
451
  e.se = clock;
@@ -435,13 +457,13 @@ function handleAsync(e, t, n) {
435
457
  (async () => {
436
458
  try {
437
459
  for await (let i of t) {
438
- if (e.ce !== t) return;
460
+ if (e.ae !== t) return;
439
461
  globalQueue.initTransition(e);
440
462
  n?.(i) ?? setSignal(e, () => i);
441
463
  flush();
442
464
  }
443
465
  } catch (n) {
444
- if (e.ce !== t) return;
466
+ if (e.ae !== t) return;
445
467
  globalQueue.initTransition(e);
446
468
  setStatusFlags(e, STATUS_ERROR, n);
447
469
  e.se = clock;
@@ -455,42 +477,42 @@ function handleAsync(e, t, n) {
455
477
  throw new NotReadyError(context);
456
478
  }
457
479
  function updateIfNecessary(e) {
458
- if (e._ & REACTIVE_CHECK) {
480
+ if (e.S & REACTIVE_CHECK) {
459
481
  for (let t = e.D; t; t = t.P) {
460
482
  const n = t.V;
461
- const i = n.U || n;
462
- if (i.m) {
483
+ const i = n.m || n;
484
+ if (i.U) {
463
485
  updateIfNecessary(i);
464
486
  }
465
- if (e._ & REACTIVE_DIRTY) {
487
+ if (e.S & REACTIVE_DIRTY) {
466
488
  break;
467
489
  }
468
490
  }
469
491
  }
470
- if (e._ & REACTIVE_DIRTY) {
492
+ if (e.S & REACTIVE_DIRTY) {
471
493
  recompute(e);
472
494
  }
473
- e._ = REACTIVE_NONE;
495
+ e.S = REACTIVE_NONE;
474
496
  }
475
497
  function unlinkSubs(e) {
476
498
  const t = e.V;
477
499
  const n = e.P;
478
500
  const i = e.p;
479
- const r = e.ae;
480
- if (i !== null) i.ae = r;
481
- else t.fe = r;
501
+ const r = e.fe;
502
+ if (i !== null) i.fe = r;
503
+ else t.Ee = r;
482
504
  if (r !== null) r.p = i;
483
505
  else {
484
506
  t.O = i;
485
507
  if (i === null) {
486
- t.Ee?.();
487
- t.m && !t.de && unobserved(t);
508
+ t.de?.();
509
+ t.U && !t.Te && unobserved(t);
488
510
  }
489
511
  }
490
512
  return n;
491
513
  }
492
514
  function unobserved(e) {
493
- deleteFromHeap(e, e._ & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
515
+ deleteFromHeap(e, e.S & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
494
516
  let t = e.D;
495
517
  while (t !== null) {
496
518
  t = unlinkSubs(t);
@@ -502,7 +524,7 @@ function link(e, t) {
502
524
  const n = t.re;
503
525
  if (n !== null && n.V === e) return;
504
526
  let i = null;
505
- const r = t._ & REACTIVE_RECOMPUTING_DEPS;
527
+ const r = t.S & REACTIVE_RECOMPUTING_DEPS;
506
528
  if (r) {
507
529
  i = n !== null ? n.P : t.D;
508
530
  if (i !== null && i.V === e) {
@@ -510,9 +532,9 @@ function link(e, t) {
510
532
  return;
511
533
  }
512
534
  }
513
- const s = e.fe;
535
+ const s = e.Ee;
514
536
  if (s !== null && s.A === t && (!r || isValidLink(s, t))) return;
515
- const o = (t.re = e.fe = { V: e, A: t, P: i, ae: s, p: null });
537
+ const o = (t.re = e.Ee = { V: e, A: t, P: i, fe: s, p: null });
516
538
  if (n !== null) n.P = o;
517
539
  else t.D = o;
518
540
  if (s !== null) s.p = o;
@@ -532,18 +554,18 @@ function isValidLink(e, t) {
532
554
  }
533
555
  function setStatusFlags(e, t, n = null) {
534
556
  e.J = t;
535
- e.W = n;
557
+ e.j = n;
536
558
  }
537
559
  function markDisposal(e) {
538
560
  let t = e.ie;
539
561
  while (t) {
540
- t._ |= REACTIVE_ZOMBIE;
541
- if (t._ & REACTIVE_IN_HEAP) {
562
+ t.S |= REACTIVE_ZOMBIE;
563
+ if (t.S & REACTIVE_IN_HEAP) {
542
564
  deleteFromHeap(t, dirtyQueue);
543
565
  insertIntoHeap(t, zombieQueue);
544
566
  }
545
567
  markDisposal(t);
546
- t = t.Te;
568
+ t = t.Re;
547
569
  }
548
570
  }
549
571
  function dispose(e) {
@@ -556,14 +578,14 @@ function dispose(e) {
556
578
  disposeChildren(e, true);
557
579
  }
558
580
  function disposeChildren(e, t = false, n) {
559
- if (e._ & REACTIVE_DISPOSED) return;
560
- if (t) e._ = REACTIVE_DISPOSED;
581
+ if (e.S & REACTIVE_DISPOSED) return;
582
+ if (t) e.S = REACTIVE_DISPOSED;
561
583
  let i = n ? e.ne : e.ie;
562
584
  while (i) {
563
- const e = i.Te;
585
+ const e = i.Re;
564
586
  if (i.D) {
565
587
  const e = i;
566
- deleteFromHeap(e, e._ & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
588
+ deleteFromHeap(e, e.S & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
567
589
  let t = e.D;
568
590
  do {
569
591
  t = unlinkSubs(t);
@@ -578,7 +600,7 @@ function disposeChildren(e, t = false, n) {
578
600
  e.ne = null;
579
601
  } else {
580
602
  e.ie = null;
581
- e.Te = null;
603
+ e.Re = null;
582
604
  }
583
605
  runDisposal(e, n);
584
606
  }
@@ -607,36 +629,36 @@ function formatId(e, t) {
607
629
  function computed(e, t, n) {
608
630
  const i = {
609
631
  id: n?.id ?? (context?.id != null ? getNextChildId(context) : undefined),
610
- oe: n?.equals != null ? n.equals : isEqual,
611
- Re: !!n?.pureWrite,
612
- Ee: n?.unobserved,
632
+ ue: n?.equals != null ? n.equals : isEqual,
633
+ Se: !!n?.pureWrite,
634
+ de: n?.unobserved,
613
635
  te: null,
614
636
  _e: context?._e ?? globalQueue,
615
- Se: context?.Se ?? defaultContext,
637
+ Oe: context?.Oe ?? defaultContext,
616
638
  he: 0,
617
- m: e,
618
- M: t,
639
+ U: e,
640
+ Y: t,
619
641
  o: 0,
620
642
  N: null,
621
- h: undefined,
643
+ R: undefined,
622
644
  T: null,
623
645
  D: null,
624
646
  re: null,
625
647
  O: null,
626
- fe: null,
648
+ Ee: null,
627
649
  i: context,
628
- Te: null,
650
+ Re: null,
629
651
  ie: null,
630
- _: REACTIVE_NONE,
652
+ S: REACTIVE_NONE,
631
653
  J: STATUS_UNINITIALIZED,
632
654
  se: clock,
633
- K: NOT_PENDING,
655
+ M: NOT_PENDING,
634
656
  ee: null,
635
657
  ne: null,
636
- ce: null,
637
- j: null
658
+ ae: null,
659
+ K: null
638
660
  };
639
- if (n?.Oe) Object.assign(i, n.Oe);
661
+ if (n?.pe) Object.assign(i, n.pe);
640
662
  i.T = i;
641
663
  const r = context?.t ? context.u : context;
642
664
  if (context) {
@@ -644,28 +666,28 @@ function computed(e, t, n) {
644
666
  if (e === null) {
645
667
  context.ie = i;
646
668
  } else {
647
- i.Te = e;
669
+ i.Re = e;
648
670
  context.ie = i;
649
671
  }
650
672
  }
651
673
  if (r) i.o = r.o + 1;
652
- recompute(i, true);
674
+ !n?.lazy && recompute(i, true);
653
675
  return i;
654
676
  }
655
677
  function signal(e, t, n = null) {
656
678
  const i = {
657
679
  id: t?.id ?? (context?.id != null ? getNextChildId(context) : undefined),
658
- oe: t?.equals != null ? t.equals : isEqual,
659
- Re: !!t?.pureWrite,
660
- Ee: t?.unobserved,
661
- M: e,
680
+ ue: t?.equals != null ? t.equals : isEqual,
681
+ Se: !!t?.pureWrite,
682
+ de: t?.unobserved,
683
+ Y: e,
662
684
  O: null,
663
- fe: null,
685
+ Ee: null,
664
686
  J: STATUS_NONE,
665
687
  se: clock,
666
- U: n,
688
+ m: n,
667
689
  I: n?.N || null,
668
- K: NOT_PENDING
690
+ M: NOT_PENDING
669
691
  };
670
692
  n && (n.N = i);
671
693
  return i;
@@ -685,13 +707,13 @@ function untrack(e) {
685
707
  function read(e) {
686
708
  let t = context;
687
709
  if (t?.t) t = t.u;
688
- if (refreshing && e.m) recompute(e);
710
+ if (refreshing && e.U) recompute(e);
689
711
  if (t && tracking && !pendingCheck && !pendingValueCheck) {
690
- if (e.m && e._ & REACTIVE_DISPOSED) recompute(e);
712
+ if (e.U && e.S & REACTIVE_DISPOSED) recompute(e);
691
713
  link(e, t);
692
- const n = e.U || e;
693
- if (n.m) {
694
- const i = e._ & REACTIVE_ZOMBIE;
714
+ const n = e.m || e;
715
+ if (n.U) {
716
+ const i = e.S & REACTIVE_ZOMBIE;
695
717
  if (n.o >= (i ? zombieQueue.C : dirtyQueue.C)) {
696
718
  markNode(t);
697
719
  markHeap(i ? zombieQueue : dirtyQueue);
@@ -704,33 +726,32 @@ function read(e) {
704
726
  }
705
727
  }
706
728
  if (pendingCheck) {
707
- if (!e.Z) {
708
- e.Z = signal(false);
709
- e.Z.ue = true;
710
- e.Z.q = t => setSignal(e.Z, t);
729
+ if (!e.q) {
730
+ e.q = signal(false);
731
+ e.q.oe = true;
732
+ e.q.Z = t => setSignal(e.q, t);
711
733
  }
712
734
  const t = pendingCheck;
713
735
  pendingCheck = null;
714
- t.M = read(e.Z) || t.M;
736
+ t.Y = read(e.q) || t.Y;
715
737
  pendingCheck = t;
716
738
  }
717
739
  if (pendingValueCheck) {
718
- if (!e.X) {
719
- e.X = signal(e.M);
720
- e.X.ue = true;
721
- e.X.q = t => setSignal(e.X, t);
740
+ if (!e.ce) {
741
+ e.ce = signal(e.Y);
742
+ e.ce.oe = true;
722
743
  }
723
744
  pendingValueCheck = false;
724
745
  try {
725
- return read(e.X);
746
+ return read(e.ce);
726
747
  } finally {
727
748
  pendingValueCheck = true;
728
749
  }
729
750
  }
730
751
  if (e.J & STATUS_PENDING && !pendingCheck) {
731
- if ((t && !stale) || e.J & STATUS_UNINITIALIZED) throw e.W;
752
+ if ((t && !stale) || e.J & STATUS_UNINITIALIZED) throw e.j;
732
753
  else if (t && stale) {
733
- setStatusFlags(t, t.J | 1, e.W);
754
+ setStatusFlags(t, t.J | 1, e.j);
734
755
  }
735
756
  }
736
757
  if (e.J & STATUS_ERROR) {
@@ -738,33 +759,33 @@ function read(e) {
738
759
  recompute(e, true);
739
760
  return read(e);
740
761
  } else {
741
- throw e.W;
762
+ throw e.j;
742
763
  }
743
764
  }
744
765
  return !t ||
745
- e.ue ||
746
- e.K === NOT_PENDING ||
747
- (stale && !pendingCheck && e.j && activeTransition !== e.j)
748
- ? e.M
749
- : e.K;
766
+ e.oe ||
767
+ e.M === NOT_PENDING ||
768
+ (stale && !pendingCheck && (t.oe || (e.K && activeTransition !== e.K)))
769
+ ? e.Y
770
+ : e.M;
750
771
  }
751
772
  function setSignal(e, t) {
752
773
  if (typeof t === "function") {
753
- t = t(e.K === NOT_PENDING ? e.M : e.K);
774
+ t = t(e.M === NOT_PENDING || (e.oe && e.K) ? e.Y : e.M);
754
775
  }
755
- const n = !e.oe || !e.oe(e.K === NOT_PENDING || e.ue ? e.M : e.K, t);
776
+ const n = !e.ue || !e.ue(e.M === NOT_PENDING || e.oe ? e.Y : e.M, t);
756
777
  if (!n && !e.J) return t;
757
778
  if (n) {
758
- if (e.ue) e.M = t;
779
+ if (e.oe) e.Y = t;
759
780
  else {
760
- if (e.K === NOT_PENDING) globalQueue.$.push(e);
761
- e.K = t;
781
+ if (e.M === NOT_PENDING) globalQueue.$.push(e);
782
+ e.M = t;
762
783
  }
763
- if (e.X) e.X.K = t;
784
+ if (e.ce) setSignal(e.ce, t);
764
785
  }
765
786
  setStatusFlags(e, STATUS_NONE);
766
787
  e.se = clock;
767
- notifySubs(e);
788
+ e.oe && !optimisticRun ? globalQueue.L.push(e) : notifySubs(e);
768
789
  schedule();
769
790
  return t;
770
791
  }
@@ -792,11 +813,11 @@ function createOwner(e) {
792
813
  t: true,
793
814
  u: t?.t ? t.u : t,
794
815
  ie: null,
795
- Te: null,
816
+ Re: null,
796
817
  te: null,
797
818
  id: e?.id ?? (t?.id != null ? getNextChildId(t) : undefined),
798
819
  _e: t?._e ?? globalQueue,
799
- Se: t?.Se || defaultContext,
820
+ Oe: t?.Oe || defaultContext,
800
821
  he: 0,
801
822
  ee: null,
802
823
  ne: null,
@@ -810,7 +831,7 @@ function createOwner(e) {
810
831
  if (e === null) {
811
832
  t.ie = n;
812
833
  } else {
813
- n.Te = e;
834
+ n.Re = e;
814
835
  t.ie = n;
815
836
  }
816
837
  }
@@ -849,10 +870,10 @@ function pending(e) {
849
870
  }
850
871
  function isPending(e) {
851
872
  const t = pendingCheck;
852
- pendingCheck = { M: false };
873
+ pendingCheck = { Y: false };
853
874
  try {
854
875
  staleValues(e);
855
- return pendingCheck.M;
876
+ return pendingCheck.Y;
856
877
  } catch (e) {
857
878
  if (!(e instanceof NotReadyError)) return false;
858
879
  throw e;
@@ -883,7 +904,7 @@ function getContext(e, t = getOwner()) {
883
904
  if (!t) {
884
905
  throw new NoOwnerError();
885
906
  }
886
- const n = hasContext(e, t) ? t.Se[e.id] : e.defaultValue;
907
+ const n = hasContext(e, t) ? t.Oe[e.id] : e.defaultValue;
887
908
  if (isUndefined(n)) {
888
909
  throw new ContextNotFoundError();
889
910
  }
@@ -893,10 +914,10 @@ function setContext(e, t, n = getOwner()) {
893
914
  if (!n) {
894
915
  throw new NoOwnerError();
895
916
  }
896
- n.Se = { ...n.Se, [e.id]: isUndefined(t) ? e.defaultValue : t };
917
+ n.Oe = { ...n.Oe, [e.id]: isUndefined(t) ? e.defaultValue : t };
897
918
  }
898
919
  function hasContext(e, t) {
899
- return !isUndefined(t?.Se[e.id]);
920
+ return !isUndefined(t?.Oe[e.id]);
900
921
  }
901
922
  function isUndefined(e) {
902
923
  return typeof e === "undefined";
@@ -905,23 +926,23 @@ function effect(e, t, n, i, r) {
905
926
  let s = false;
906
927
  const o = computed(e, i, {
907
928
  ...r,
908
- Oe: {
909
- B: true,
910
- pe: i,
911
- Ae: t,
929
+ pe: {
930
+ X: true,
931
+ Ae: i,
932
+ ge: t,
912
933
  Ne: n,
913
934
  Ie: undefined,
914
- Y: r?.render ? EFFECT_RENDER : EFFECT_USER,
935
+ B: r?.render ? EFFECT_RENDER : EFFECT_USER,
915
936
  le(e, t) {
916
937
  if (s) {
917
938
  const n = this.J && this.J === t && e;
918
- this.B = !(this.J & STATUS_ERROR) && !(this.J & STATUS_PENDING & ~t) && !n;
919
- if (this.B) this._e.enqueue(this.Y, runEffect.bind(this));
939
+ this.X = !(this.J & STATUS_ERROR) && !(this.J & STATUS_PENDING & ~t) && !n;
940
+ if (this.X) this._e.enqueue(this.B, runEffect.bind(this));
920
941
  }
921
942
  if (this.J & STATUS_ERROR) {
922
- let e = this.W;
943
+ let e = this.j;
923
944
  this._e.notify(this, STATUS_PENDING, 0);
924
- if (this.Y === EFFECT_USER) {
945
+ if (this.B === EFFECT_USER) {
925
946
  try {
926
947
  return this.Ne
927
948
  ? this.Ne(e, () => {
@@ -934,30 +955,30 @@ function effect(e, t, n, i, r) {
934
955
  }
935
956
  }
936
957
  if (!this._e.notify(this, STATUS_ERROR, STATUS_ERROR)) throw e;
937
- } else if (this.Y === EFFECT_RENDER) {
958
+ } else if (this.B === EFFECT_RENDER) {
938
959
  this._e.notify(this, STATUS_PENDING | STATUS_ERROR, this.J);
939
960
  }
940
961
  }
941
962
  }
942
963
  });
943
964
  s = true;
944
- if (o.Y === EFFECT_RENDER) o.m = t => staleValues(() => e(t));
965
+ if (o.B === EFFECT_RENDER) o.U = t => staleValues(() => e(t));
945
966
  !r?.defer &&
946
967
  !(o.J & (STATUS_ERROR | STATUS_PENDING)) &&
947
- (o.Y === EFFECT_USER ? o._e.enqueue(o.Y, runEffect.bind(o)) : runEffect.call(o));
968
+ (o.B === EFFECT_USER ? o._e.enqueue(o.B, runEffect.bind(o)) : runEffect.call(o));
948
969
  onCleanup(() => o.Ie?.());
949
970
  }
950
971
  function runEffect() {
951
- if (!this.B || this._ & REACTIVE_DISPOSED) return;
972
+ if (!this.X || this.S & REACTIVE_DISPOSED) return;
952
973
  this.Ie?.();
953
974
  this.Ie = undefined;
954
975
  try {
955
- this.Ie = this.Ae(this.M, this.pe);
976
+ this.Ie = this.ge(this.Y, this.Ae);
956
977
  } catch (e) {
957
978
  if (!this._e.notify(this, STATUS_ERROR, STATUS_ERROR)) throw e;
958
979
  } finally {
959
- this.pe = this.M;
960
- this.B = false;
980
+ this.Ae = this.Y;
981
+ this.X = false;
961
982
  }
962
983
  }
963
984
  function createSignal(e, t, n) {
@@ -1017,7 +1038,30 @@ function resolve(e) {
1017
1038
  });
1018
1039
  }
1019
1040
  function createOptimistic(e, t, n) {
1020
- return {};
1041
+ if (typeof e === "function") {
1042
+ const i = computed(
1043
+ t => {
1044
+ let n = i || getOwner();
1045
+ n.M = e(t);
1046
+ return t;
1047
+ },
1048
+ t,
1049
+ n
1050
+ );
1051
+ i.oe = true;
1052
+ return [read.bind(null, i), setSignal.bind(null, i)];
1053
+ }
1054
+ const i = getOwner();
1055
+ const r = i?.id != null;
1056
+ const s = signal(e, r ? { id: getNextChildId(i), ...t } : t);
1057
+ s.oe = true;
1058
+ return [
1059
+ read.bind(null, s),
1060
+ t => {
1061
+ s.M = e;
1062
+ return setSignal(s, t);
1063
+ }
1064
+ ];
1021
1065
  }
1022
1066
  function onSettled(e) {
1023
1067
  let t;
@@ -1053,7 +1097,7 @@ function applyState(e, t, n, i) {
1053
1097
  let t = false;
1054
1098
  const l = getOverrideValue(s, o, u, "length");
1055
1099
  if (e.length && l && e[0] && n(e[0]) != null) {
1056
- let c, a, f, E, d, T, h, R;
1100
+ let c, a, f, E, d, T, R, h;
1057
1101
  for (
1058
1102
  f = 0, E = Math.min(l, e.length);
1059
1103
  f < E && ((T = getOverrideValue(s, o, u, f)) === e[f] || (T && e[f] && n(T) === n(e[f])));
@@ -1061,8 +1105,8 @@ function applyState(e, t, n, i) {
1061
1105
  ) {
1062
1106
  applyState(e[f], wrap(T, r), n, i);
1063
1107
  }
1064
- const _ = new Array(e.length),
1065
- S = new Map();
1108
+ const S = new Array(e.length),
1109
+ _ = new Map();
1066
1110
  for (
1067
1111
  E = l - 1, d = e.length - 1;
1068
1112
  E >= f &&
@@ -1070,7 +1114,7 @@ function applyState(e, t, n, i) {
1070
1114
  ((T = getOverrideValue(s, o, u, E)) === e[d] || (T && e[d] && n(T) === n(e[d])));
1071
1115
  E--, d--
1072
1116
  ) {
1073
- _[d] = T;
1117
+ S[d] = T;
1074
1118
  }
1075
1119
  if (f > d || f > E) {
1076
1120
  for (a = f; a <= d; a++) {
@@ -1079,7 +1123,7 @@ function applyState(e, t, n, i) {
1079
1123
  }
1080
1124
  for (; a < e.length; a++) {
1081
1125
  t = true;
1082
- const s = wrap(_[a], r);
1126
+ const s = wrap(S[a], r);
1083
1127
  r[STORE_NODE][a] && setSignal(r[STORE_NODE][a], s);
1084
1128
  applyState(e[a], s, n, i);
1085
1129
  }
@@ -1087,27 +1131,27 @@ function applyState(e, t, n, i) {
1087
1131
  l !== e.length && r[STORE_NODE].length && setSignal(r[STORE_NODE].length, e.length);
1088
1132
  return;
1089
1133
  }
1090
- h = new Array(d + 1);
1134
+ R = new Array(d + 1);
1091
1135
  for (a = d; a >= f; a--) {
1092
1136
  T = e[a];
1093
- R = T ? n(T) : T;
1094
- c = S.get(R);
1095
- h[a] = c === undefined ? -1 : c;
1096
- S.set(R, a);
1137
+ h = T ? n(T) : T;
1138
+ c = _.get(h);
1139
+ R[a] = c === undefined ? -1 : c;
1140
+ _.set(h, a);
1097
1141
  }
1098
1142
  for (c = f; c <= E; c++) {
1099
1143
  T = getOverrideValue(s, o, u, c);
1100
- R = T ? n(T) : T;
1101
- a = S.get(R);
1144
+ h = T ? n(T) : T;
1145
+ a = _.get(h);
1102
1146
  if (a !== undefined && a !== -1) {
1103
- _[a] = T;
1104
- a = h[a];
1105
- S.set(R, a);
1147
+ S[a] = T;
1148
+ a = R[a];
1149
+ _.set(h, a);
1106
1150
  }
1107
1151
  }
1108
1152
  for (a = f; a < e.length; a++) {
1109
- if (a in _) {
1110
- const t = wrap(_[a], r);
1153
+ if (a in S) {
1154
+ const t = wrap(S[a], r);
1111
1155
  r[STORE_NODE][a] && setSignal(r[STORE_NODE][a], t);
1112
1156
  applyState(e[a], t, n, i);
1113
1157
  } else r[STORE_NODE][a] && setSignal(r[STORE_NODE][a], wrap(e[a], r));
@@ -1282,7 +1326,7 @@ const storeTraps = {
1282
1326
  if (e && e.get) return e.get.call(n);
1283
1327
  }
1284
1328
  if (Writing?.has(n)) {
1285
- let n = r && (s || !o) ? (r.K !== NOT_PENDING ? r.K : r.M) : u[t];
1329
+ let n = r && (s || !o) ? (r.M !== NOT_PENDING ? r.M : r.Y) : u[t];
1286
1330
  n === $DELETED && (n = undefined);
1287
1331
  if (!isWrappable(n)) return n;
1288
1332
  const i = wrap(n, e);
@@ -1642,68 +1686,68 @@ function mapArray(e, t, n) {
1642
1686
  const i = typeof n?.keyed === "function" ? n.keyed : undefined;
1643
1687
  return createMemo(
1644
1688
  updateKeyedMap.bind({
1645
- ge: createOwner(),
1646
- ye: 0,
1647
- Ce: e,
1648
- De: [],
1649
- Pe: t,
1650
- we: [],
1689
+ ye: createOwner(),
1690
+ Ce: 0,
1691
+ De: e,
1692
+ Pe: [],
1693
+ we: t,
1651
1694
  be: [],
1652
- Ve: i,
1695
+ Ve: [],
1696
+ me: i,
1653
1697
  Ue: i || n?.keyed === false ? [] : undefined,
1654
- me: t.length > 1 ? [] : undefined,
1655
- ke: n?.fallback
1698
+ ke: t.length > 1 ? [] : undefined,
1699
+ ve: n?.fallback
1656
1700
  })
1657
1701
  );
1658
1702
  }
1659
1703
  const pureOptions = { pureWrite: true };
1660
1704
  function updateKeyedMap() {
1661
- const e = this.Ce() || [],
1705
+ const e = this.De() || [],
1662
1706
  t = e.length;
1663
1707
  e[$TRACK];
1664
- runWithOwner(this.ge, () => {
1708
+ runWithOwner(this.ye, () => {
1665
1709
  let n,
1666
1710
  i,
1667
1711
  r = this.Ue
1668
1712
  ? () => {
1669
1713
  this.Ue[i] = signal(e[i], pureOptions);
1670
- this.me && (this.me[i] = signal(i, pureOptions));
1671
- return this.Pe(
1714
+ this.ke && (this.ke[i] = signal(i, pureOptions));
1715
+ return this.we(
1672
1716
  read.bind(null, this.Ue[i]),
1673
- this.me ? read.bind(null, this.me[i]) : undefined
1717
+ this.ke ? read.bind(null, this.ke[i]) : undefined
1674
1718
  );
1675
1719
  }
1676
- : this.me
1720
+ : this.ke
1677
1721
  ? () => {
1678
1722
  const t = e[i];
1679
- this.me[i] = signal(i, pureOptions);
1680
- return this.Pe(() => t, read.bind(null, this.me[i]));
1723
+ this.ke[i] = signal(i, pureOptions);
1724
+ return this.we(() => t, read.bind(null, this.ke[i]));
1681
1725
  }
1682
1726
  : () => {
1683
1727
  const t = e[i];
1684
- return this.Pe(() => t);
1728
+ return this.we(() => t);
1685
1729
  };
1686
1730
  if (t === 0) {
1687
- if (this.ye !== 0) {
1688
- this.ge.dispose(false);
1731
+ if (this.Ce !== 0) {
1732
+ this.ye.dispose(false);
1733
+ this.Ve = [];
1734
+ this.Pe = [];
1689
1735
  this.be = [];
1690
- this.De = [];
1691
- this.we = [];
1692
- this.ye = 0;
1736
+ this.Ce = 0;
1693
1737
  this.Ue && (this.Ue = []);
1694
- this.me && (this.me = []);
1738
+ this.ke && (this.ke = []);
1695
1739
  }
1696
- if (this.ke && !this.we[0]) {
1697
- this.we[0] = runWithOwner((this.be[0] = createOwner()), this.ke);
1740
+ if (this.ve && !this.be[0]) {
1741
+ this.be[0] = runWithOwner((this.Ve[0] = createOwner()), this.ve);
1698
1742
  }
1699
- } else if (this.ye === 0) {
1700
- if (this.be[0]) this.be[0].dispose();
1701
- this.we = new Array(t);
1743
+ } else if (this.Ce === 0) {
1744
+ if (this.Ve[0]) this.Ve[0].dispose();
1745
+ this.be = new Array(t);
1702
1746
  for (i = 0; i < t; i++) {
1703
- this.De[i] = e[i];
1704
- this.we[i] = runWithOwner((this.be[i] = createOwner()), r);
1747
+ this.Pe[i] = e[i];
1748
+ this.be[i] = runWithOwner((this.Ve[i] = createOwner()), r);
1705
1749
  }
1706
- this.ye = t;
1750
+ this.Ce = t;
1707
1751
  } else {
1708
1752
  let s,
1709
1753
  o,
@@ -1715,149 +1759,149 @@ function updateKeyedMap() {
1715
1759
  E = new Array(t),
1716
1760
  d = new Array(t),
1717
1761
  T = this.Ue ? new Array(t) : undefined,
1718
- h = this.me ? new Array(t) : undefined;
1762
+ R = this.ke ? new Array(t) : undefined;
1719
1763
  for (
1720
- s = 0, o = Math.min(this.ye, t);
1721
- s < o && (this.De[s] === e[s] || (this.Ue && compare(this.Ve, this.De[s], e[s])));
1764
+ s = 0, o = Math.min(this.Ce, t);
1765
+ s < o && (this.Pe[s] === e[s] || (this.Ue && compare(this.me, this.Pe[s], e[s])));
1722
1766
  s++
1723
1767
  ) {
1724
1768
  if (this.Ue) setSignal(this.Ue[s], e[s]);
1725
1769
  }
1726
1770
  for (
1727
- o = this.ye - 1, u = t - 1;
1771
+ o = this.Ce - 1, u = t - 1;
1728
1772
  o >= s &&
1729
1773
  u >= s &&
1730
- (this.De[o] === e[u] || (this.Ue && compare(this.Ve, this.De[o], e[u])));
1774
+ (this.Pe[o] === e[u] || (this.Ue && compare(this.me, this.Pe[o], e[u])));
1731
1775
  o--, u--
1732
1776
  ) {
1733
- E[u] = this.we[o];
1734
- d[u] = this.be[o];
1777
+ E[u] = this.be[o];
1778
+ d[u] = this.Ve[o];
1735
1779
  T && (T[u] = this.Ue[o]);
1736
- h && (h[u] = this.me[o]);
1780
+ R && (R[u] = this.ke[o]);
1737
1781
  }
1738
1782
  a = new Map();
1739
1783
  f = new Array(u + 1);
1740
1784
  for (i = u; i >= s; i--) {
1741
1785
  l = e[i];
1742
- c = this.Ve ? this.Ve(l) : l;
1786
+ c = this.me ? this.me(l) : l;
1743
1787
  n = a.get(c);
1744
1788
  f[i] = n === undefined ? -1 : n;
1745
1789
  a.set(c, i);
1746
1790
  }
1747
1791
  for (n = s; n <= o; n++) {
1748
- l = this.De[n];
1749
- c = this.Ve ? this.Ve(l) : l;
1792
+ l = this.Pe[n];
1793
+ c = this.me ? this.me(l) : l;
1750
1794
  i = a.get(c);
1751
1795
  if (i !== undefined && i !== -1) {
1752
- E[i] = this.we[n];
1753
- d[i] = this.be[n];
1796
+ E[i] = this.be[n];
1797
+ d[i] = this.Ve[n];
1754
1798
  T && (T[i] = this.Ue[n]);
1755
- h && (h[i] = this.me[n]);
1799
+ R && (R[i] = this.ke[n]);
1756
1800
  i = f[i];
1757
1801
  a.set(c, i);
1758
- } else this.be[n].dispose();
1802
+ } else this.Ve[n].dispose();
1759
1803
  }
1760
1804
  for (i = s; i < t; i++) {
1761
1805
  if (i in E) {
1762
- this.we[i] = E[i];
1763
- this.be[i] = d[i];
1806
+ this.be[i] = E[i];
1807
+ this.Ve[i] = d[i];
1764
1808
  if (T) {
1765
1809
  this.Ue[i] = T[i];
1766
1810
  setSignal(this.Ue[i], e[i]);
1767
1811
  }
1768
- if (h) {
1769
- this.me[i] = h[i];
1770
- setSignal(this.me[i], i);
1812
+ if (R) {
1813
+ this.ke[i] = R[i];
1814
+ setSignal(this.ke[i], i);
1771
1815
  }
1772
1816
  } else {
1773
- this.we[i] = runWithOwner((this.be[i] = createOwner()), r);
1817
+ this.be[i] = runWithOwner((this.Ve[i] = createOwner()), r);
1774
1818
  }
1775
1819
  }
1776
- this.we = this.we.slice(0, (this.ye = t));
1777
- this.De = e.slice(0);
1820
+ this.be = this.be.slice(0, (this.Ce = t));
1821
+ this.Pe = e.slice(0);
1778
1822
  }
1779
1823
  });
1780
- return this.we;
1824
+ return this.be;
1781
1825
  }
1782
1826
  function repeat(e, t, n) {
1783
1827
  return updateRepeat.bind({
1784
- ge: createOwner(),
1785
- ye: 0,
1786
- ve: 0,
1787
- xe: e,
1788
- Pe: t,
1828
+ ye: createOwner(),
1829
+ Ce: 0,
1830
+ xe: 0,
1831
+ Ge: e,
1832
+ we: t,
1833
+ Ve: [],
1789
1834
  be: [],
1790
- we: [],
1791
- Ge: n?.from,
1792
- ke: n?.fallback
1835
+ He: n?.from,
1836
+ ve: n?.fallback
1793
1837
  });
1794
1838
  }
1795
1839
  function updateRepeat() {
1796
- const e = this.xe();
1797
- const t = this.Ge?.() || 0;
1798
- runWithOwner(this.ge, () => {
1840
+ const e = this.Ge();
1841
+ const t = this.He?.() || 0;
1842
+ runWithOwner(this.ye, () => {
1799
1843
  if (e === 0) {
1800
- if (this.ye !== 0) {
1801
- this.ge.dispose(false);
1844
+ if (this.Ce !== 0) {
1845
+ this.ye.dispose(false);
1846
+ this.Ve = [];
1802
1847
  this.be = [];
1803
- this.we = [];
1804
- this.ye = 0;
1848
+ this.Ce = 0;
1805
1849
  }
1806
- if (this.ke && !this.we[0]) {
1807
- this.we[0] = runWithOwner((this.be[0] = createOwner()), this.ke);
1850
+ if (this.ve && !this.be[0]) {
1851
+ this.be[0] = runWithOwner((this.Ve[0] = createOwner()), this.ve);
1808
1852
  }
1809
1853
  return;
1810
1854
  }
1811
1855
  const n = t + e;
1812
- const i = this.ve + this.ye;
1813
- if (this.ye === 0 && this.be[0]) this.be[0].dispose();
1814
- for (let e = n; e < i; e++) this.be[e - this.ve].dispose();
1815
- if (this.ve < t) {
1816
- let e = this.ve;
1817
- while (e < t && e < this.ye) this.be[e++].dispose();
1818
- this.be.splice(0, t - this.ve);
1819
- this.we.splice(0, t - this.ve);
1820
- } else if (this.ve > t) {
1821
- let n = i - this.ve - 1;
1822
- let r = this.ve - t;
1823
- this.be.length = this.we.length = e;
1856
+ const i = this.xe + this.Ce;
1857
+ if (this.Ce === 0 && this.Ve[0]) this.Ve[0].dispose();
1858
+ for (let e = n; e < i; e++) this.Ve[e - this.xe].dispose();
1859
+ if (this.xe < t) {
1860
+ let e = this.xe;
1861
+ while (e < t && e < this.Ce) this.Ve[e++].dispose();
1862
+ this.Ve.splice(0, t - this.xe);
1863
+ this.be.splice(0, t - this.xe);
1864
+ } else if (this.xe > t) {
1865
+ let n = i - this.xe - 1;
1866
+ let r = this.xe - t;
1867
+ this.Ve.length = this.be.length = e;
1824
1868
  while (n >= r) {
1869
+ this.Ve[n] = this.Ve[n - r];
1825
1870
  this.be[n] = this.be[n - r];
1826
- this.we[n] = this.we[n - r];
1827
1871
  n--;
1828
1872
  }
1829
1873
  for (let e = 0; e < r; e++) {
1830
- this.we[e] = runWithOwner((this.be[e] = createOwner()), () => this.Pe(e + t));
1874
+ this.be[e] = runWithOwner((this.Ve[e] = createOwner()), () => this.we(e + t));
1831
1875
  }
1832
1876
  }
1833
1877
  for (let e = i; e < n; e++) {
1834
- this.we[e - t] = runWithOwner((this.be[e - t] = createOwner()), () => this.Pe(e));
1878
+ this.be[e - t] = runWithOwner((this.Ve[e - t] = createOwner()), () => this.we(e));
1835
1879
  }
1836
- this.we = this.we.slice(0, e);
1837
- this.ve = t;
1838
- this.ye = e;
1880
+ this.be = this.be.slice(0, e);
1881
+ this.xe = t;
1882
+ this.Ce = e;
1839
1883
  });
1840
- return this.we;
1884
+ return this.be;
1841
1885
  }
1842
1886
  function compare(e, t, n) {
1843
1887
  return e ? e(t) === e(n) : true;
1844
1888
  }
1845
1889
  function boundaryComputed(e, t) {
1846
1890
  const n = computed(e, undefined, {
1847
- Oe: {
1891
+ pe: {
1848
1892
  le() {
1849
1893
  let e = this.J;
1850
- this.J &= ~this.He;
1851
- if (this.He & STATUS_PENDING && !(this.J & STATUS_UNINITIALIZED)) {
1894
+ this.J &= ~this.Qe;
1895
+ if (this.Qe & STATUS_PENDING && !(this.J & STATUS_UNINITIALIZED)) {
1852
1896
  e &= ~STATUS_PENDING;
1853
1897
  }
1854
- this._e.notify(this, this.He, e);
1898
+ this._e.notify(this, this.Qe, e);
1855
1899
  },
1856
- He: t
1900
+ Qe: t
1857
1901
  }
1858
1902
  });
1859
- n.He = t;
1860
- n.de = true;
1903
+ n.Qe = t;
1904
+ n.Te = true;
1861
1905
  return n;
1862
1906
  }
1863
1907
  function createBoundChildren(e, t, n, i) {
@@ -1870,19 +1914,19 @@ function createBoundChildren(e, t, n, i) {
1870
1914
  });
1871
1915
  }
1872
1916
  class ConditionalQueue extends Queue {
1873
- Qe;
1874
- $e = new Set();
1917
+ $e;
1918
+ Le = new Set();
1875
1919
  $ = new Set();
1876
1920
  constructor(e) {
1877
1921
  super();
1878
- this.Qe = e;
1922
+ this.$e = e;
1879
1923
  }
1880
1924
  run(e) {
1881
- if (!e || read(this.Qe)) return;
1925
+ if (!e || read(this.$e)) return;
1882
1926
  return super.run(e);
1883
1927
  }
1884
1928
  notify(e, t, n) {
1885
- if (read(this.Qe)) {
1929
+ if (read(this.$e)) {
1886
1930
  if (t & STATUS_PENDING) {
1887
1931
  if (n & STATUS_PENDING) {
1888
1932
  this.$.add(e);
@@ -1891,37 +1935,37 @@ class ConditionalQueue extends Queue {
1891
1935
  }
1892
1936
  if (t & STATUS_ERROR) {
1893
1937
  if (n & STATUS_ERROR) {
1894
- this.$e.add(e);
1938
+ this.Le.add(e);
1895
1939
  t &= ~STATUS_ERROR;
1896
- } else if (this.$e.delete(e)) t &= ~STATUS_ERROR;
1940
+ } else if (this.Le.delete(e)) t &= ~STATUS_ERROR;
1897
1941
  }
1898
1942
  }
1899
1943
  return t ? super.notify(e, t, n) : true;
1900
1944
  }
1901
1945
  }
1902
1946
  class CollectionQueue extends Queue {
1903
- Le;
1904
- be = new Set();
1905
- Qe = signal(false, { pureWrite: true });
1906
- Fe = false;
1947
+ Fe;
1948
+ Ve = new Set();
1949
+ $e = signal(false, { pureWrite: true });
1950
+ We = false;
1907
1951
  constructor(e) {
1908
1952
  super();
1909
- this.Le = e;
1953
+ this.Fe = e;
1910
1954
  }
1911
1955
  run(e) {
1912
- if (!e || read(this.Qe)) return;
1956
+ if (!e || read(this.$e)) return;
1913
1957
  return super.run(e);
1914
1958
  }
1915
1959
  notify(e, t, n) {
1916
- if (!(t & this.Le) || (this.Le & STATUS_PENDING && this.Fe)) return super.notify(e, t, n);
1917
- if (n & this.Le) {
1918
- this.be.add(e);
1919
- if (this.be.size === 1) setSignal(this.Qe, true);
1920
- } else if (this.be.size > 0) {
1921
- this.be.delete(e);
1922
- if (this.be.size === 0) setSignal(this.Qe, false);
1923
- }
1924
- t &= ~this.Le;
1960
+ if (!(t & this.Fe) || (this.Fe & STATUS_PENDING && this.We)) return super.notify(e, t, n);
1961
+ if (n & this.Fe) {
1962
+ this.Ve.add(e);
1963
+ if (this.Ve.size === 1) setSignal(this.$e, true);
1964
+ } else if (this.Ve.size > 0) {
1965
+ this.Ve.delete(e);
1966
+ if (this.Ve.size === 0) setSignal(this.$e, false);
1967
+ }
1968
+ t &= ~this.Fe;
1925
1969
  return t ? super.notify(e, t, n) : true;
1926
1970
  }
1927
1971
  }
@@ -1935,25 +1979,25 @@ function createBoundary(e, t) {
1935
1979
  const i = new ConditionalQueue(computed(() => t() === BoundaryMode.HIDDEN));
1936
1980
  const r = createBoundChildren(n, e, i, 0);
1937
1981
  computed(() => {
1938
- const e = read(i.Qe);
1939
- r.He = e ? STATUS_ERROR | STATUS_PENDING : 0;
1982
+ const e = read(i.$e);
1983
+ r.Qe = e ? STATUS_ERROR | STATUS_PENDING : 0;
1940
1984
  if (!e) {
1941
1985
  i.$.forEach(e => i.notify(e, STATUS_PENDING, STATUS_PENDING));
1942
- i.$e.forEach(e => i.notify(e, STATUS_ERROR, STATUS_ERROR));
1986
+ i.Le.forEach(e => i.notify(e, STATUS_ERROR, STATUS_ERROR));
1943
1987
  i.$.clear();
1944
- i.$e.clear();
1988
+ i.Le.clear();
1945
1989
  }
1946
1990
  });
1947
- return () => (read(i.Qe) ? undefined : read(r));
1991
+ return () => (read(i.$e) ? undefined : read(r));
1948
1992
  }
1949
1993
  function createCollectionBoundary(e, t, n) {
1950
1994
  const i = createOwner();
1951
1995
  const r = new CollectionQueue(e);
1952
1996
  const s = createBoundChildren(i, t, r, e);
1953
1997
  const o = computed(() => {
1954
- if (!read(r.Qe)) {
1998
+ if (!read(r.$e)) {
1955
1999
  const e = read(s);
1956
- if (!untrack(() => read(r.Qe))) r.Fe = true;
2000
+ if (!untrack(() => read(r.$e))) r.We = true;
1957
2001
  return e;
1958
2002
  }
1959
2003
  return n(r);
@@ -1978,10 +2022,10 @@ function collectErrorSources(e, t) {
1978
2022
  }
1979
2023
  function createErrorBoundary(e, t) {
1980
2024
  return createCollectionBoundary(STATUS_ERROR, e, e => {
1981
- let n = e.be.values().next().value;
1982
- return t(n.W, () => {
2025
+ let n = e.Ve.values().next().value;
2026
+ return t(n.j, () => {
1983
2027
  const t = [];
1984
- for (const n of e.be) collectErrorSources(n, t);
2028
+ for (const n of e.Ve) collectErrorSources(n, t);
1985
2029
  for (const e of t) recompute(e);
1986
2030
  schedule();
1987
2031
  });