@solidjs/signals 0.3.0 → 0.3.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/node.cjs CHANGED
@@ -48,42 +48,39 @@ function schedule() {
48
48
  if (!globalQueue.J)
49
49
  queueMicrotask(flushSync);
50
50
  }
51
+ var pureQueue = [];
51
52
  var Queue = class {
53
+ o = null;
52
54
  J = false;
53
- s = [[], [], []];
54
- F = [];
55
+ K = [[], []];
56
+ E = [];
55
57
  created = clock;
56
58
  enqueue(type, node) {
57
- this.s[0].push(node);
59
+ pureQueue.push(node);
58
60
  if (type)
59
- this.s[type].push(node);
61
+ this.K[type - 1].push(node);
60
62
  schedule();
61
63
  }
62
64
  run(type) {
63
- if (this.s[type].length) {
64
- if (type === EFFECT_PURE) {
65
- runPureQueue(this.s[type]);
66
- this.s[type] = [];
67
- } else {
68
- const effects = this.s[type];
69
- this.s[type] = [];
70
- runEffectQueue(effects);
71
- }
65
+ if (type === EFFECT_PURE) {
66
+ pureQueue.length && runPureQueue(pureQueue);
67
+ pureQueue = [];
68
+ return;
69
+ } else if (this.K[type - 1].length) {
70
+ const effects = this.K[type - 1];
71
+ this.K[type - 1] = [];
72
+ runEffectQueue(effects);
72
73
  }
73
- let rerun = false;
74
- for (let i = 0; i < this.F.length; i++) {
75
- rerun = this.F[i].run(type) || rerun;
74
+ for (let i = 0; i < this.E.length; i++) {
75
+ this.E[i].run(type);
76
76
  }
77
- if (type === EFFECT_PURE)
78
- return rerun || !!this.s[type].length;
79
77
  }
80
78
  flush() {
81
79
  if (this.J)
82
80
  return;
83
81
  this.J = true;
84
82
  try {
85
- while (this.run(EFFECT_PURE)) {
86
- }
83
+ this.run(EFFECT_PURE);
87
84
  incrementClock();
88
85
  scheduled = false;
89
86
  this.run(EFFECT_RENDER);
@@ -93,12 +90,18 @@ var Queue = class {
93
90
  }
94
91
  }
95
92
  addChild(child) {
96
- this.F.push(child);
93
+ this.E.push(child);
94
+ child.o = this;
97
95
  }
98
96
  removeChild(child) {
99
- const index = this.F.indexOf(child);
97
+ const index = this.E.indexOf(child);
100
98
  if (index >= 0)
101
- this.F.splice(index, 1);
99
+ this.E.splice(index, 1);
100
+ }
101
+ notify(...args) {
102
+ if (this.o)
103
+ return this.o.notify(...args);
104
+ return false;
102
105
  }
103
106
  };
104
107
  var globalQueue = new Queue();
@@ -109,14 +112,14 @@ function flushSync() {
109
112
  }
110
113
  function runTop(node) {
111
114
  const ancestors = [];
112
- for (let current = node; current !== null; current = current.x) {
115
+ for (let current = node; current !== null; current = current.o) {
113
116
  if (current.a !== STATE_CLEAN) {
114
117
  ancestors.push(current);
115
118
  }
116
119
  }
117
120
  for (let i = ancestors.length - 1; i >= 0; i--) {
118
121
  if (ancestors[i].a !== STATE_DISPOSED)
119
- ancestors[i].y();
122
+ ancestors[i].x();
120
123
  }
121
124
  }
122
125
  function runPureQueue(queue) {
@@ -127,7 +130,7 @@ function runPureQueue(queue) {
127
130
  }
128
131
  function runEffectQueue(queue) {
129
132
  for (let i = 0; i < queue.length; i++)
130
- queue[i].T();
133
+ queue[i].V();
131
134
  }
132
135
 
133
136
  // src/core/utils.ts
@@ -174,38 +177,32 @@ var Owner = class {
174
177
  // We flatten the owner tree into a linked list so that we don't need a pointer to .firstChild
175
178
  // However, the children are actually added in reverse creation order
176
179
  // See comment at the top of the file for an example of the _nextSibling traversal
177
- x = null;
178
- l = null;
179
- t = null;
180
- a = STATE_CLEAN;
180
+ o = null;
181
181
  m = null;
182
- o = defaultContext;
183
- n = null;
182
+ s = null;
183
+ a = STATE_CLEAN;
184
+ l = null;
185
+ p = defaultContext;
184
186
  h = globalQueue;
185
- O = null;
186
- X = 0;
187
+ W = 0;
187
188
  id = null;
188
189
  constructor(id = null, skipAppend = false) {
189
190
  this.id = id;
190
- if (currentOwner && !skipAppend)
191
- currentOwner.append(this);
191
+ if (currentOwner) {
192
+ if (id == null && currentOwner.id != null)
193
+ this.id = currentOwner.getNextChildId();
194
+ !skipAppend && currentOwner.append(this);
195
+ }
192
196
  }
193
197
  append(child) {
194
- child.x = this;
195
- child.t = this;
196
- if (this.id) {
197
- child.O = this.l ? this.l.O + 1 : 0;
198
- child.id = formatId(this.id, child.O);
199
- }
200
- if (this.l)
201
- this.l.t = child;
202
- child.l = this.l;
203
- this.l = child;
204
- if (child.o !== this.o) {
205
- child.o = { ...this.o, ...child.o };
206
- }
207
- if (this.n) {
208
- child.n = !child.n ? this.n : [...child.n, ...this.n];
198
+ child.o = this;
199
+ child.s = this;
200
+ if (this.m)
201
+ this.m.s = child;
202
+ child.m = this.m;
203
+ this.m = child;
204
+ if (child.p !== this.p) {
205
+ child.p = { ...this.p, ...child.p };
209
206
  }
210
207
  if (this.h)
211
208
  child.h = this.h;
@@ -213,65 +210,47 @@ var Owner = class {
213
210
  dispose(self = true) {
214
211
  if (this.a === STATE_DISPOSED)
215
212
  return;
216
- let head = self ? this.t || this.x : this, current = this.l, next = null;
217
- while (current && current.x === this) {
213
+ let head = self ? this.s || this.o : this, current = this.m, next = null;
214
+ while (current && current.o === this) {
218
215
  current.dispose(true);
219
- current.z();
220
- next = current.l;
221
- current.l = null;
216
+ current.y();
217
+ next = current.m;
218
+ current.m = null;
222
219
  current = next;
223
220
  }
221
+ this.W = 0;
224
222
  if (self)
225
- this.z();
223
+ this.y();
226
224
  if (current)
227
- current.t = !self ? this : this.t;
225
+ current.s = !self ? this : this.s;
228
226
  if (head)
229
- head.l = current;
230
- }
231
- z() {
232
- if (this.t)
233
- this.t.l = null;
234
- this.x = null;
235
- this.t = null;
236
- this.o = defaultContext;
237
- this.n = null;
227
+ head.m = current;
228
+ }
229
+ y() {
230
+ if (this.s)
231
+ this.s.m = null;
232
+ this.o = null;
233
+ this.s = null;
234
+ this.p = defaultContext;
238
235
  this.a = STATE_DISPOSED;
239
236
  this.emptyDisposal();
240
237
  }
241
238
  emptyDisposal() {
242
- if (!this.m)
239
+ if (!this.l)
243
240
  return;
244
- if (Array.isArray(this.m)) {
245
- for (let i = 0; i < this.m.length; i++) {
246
- const callable = this.m[i];
241
+ if (Array.isArray(this.l)) {
242
+ for (let i = 0; i < this.l.length; i++) {
243
+ const callable = this.l[i];
247
244
  callable.call(callable);
248
245
  }
249
246
  } else {
250
- this.m.call(this.m);
247
+ this.l.call(this.l);
251
248
  }
252
- this.m = null;
253
- }
254
- addErrorHandler(handler) {
255
- this.n = this.n ? [handler, ...this.n] : [handler];
256
- }
257
- handleError(error) {
258
- if (!this.n)
259
- throw error;
260
- let i = 0, len = this.n.length;
261
- for (i = 0; i < len; i++) {
262
- try {
263
- this.n[i](error, this);
264
- break;
265
- } catch (e) {
266
- error = e;
267
- }
268
- }
269
- if (i === len)
270
- throw error;
249
+ this.l = null;
271
250
  }
272
251
  getNextChildId() {
273
- if (this.id)
274
- return formatId(this.id + "-", this.X++);
252
+ if (this.id != null)
253
+ return formatId(this.id, this.W++);
275
254
  throw new Error("Cannot get child id from owner without an id");
276
255
  }
277
256
  };
@@ -282,7 +261,7 @@ function getContext(context, owner = currentOwner) {
282
261
  if (!owner) {
283
262
  throw new NoOwnerError();
284
263
  }
285
- const value = hasContext(context, owner) ? owner.o[context.id] : context.defaultValue;
264
+ const value = hasContext(context, owner) ? owner.p[context.id] : context.defaultValue;
286
265
  if (isUndefined(value)) {
287
266
  throw new ContextNotFoundError();
288
267
  }
@@ -292,24 +271,24 @@ function setContext(context, value, owner = currentOwner) {
292
271
  if (!owner) {
293
272
  throw new NoOwnerError();
294
273
  }
295
- owner.o = {
296
- ...owner.o,
274
+ owner.p = {
275
+ ...owner.p,
297
276
  [context.id]: isUndefined(value) ? context.defaultValue : value
298
277
  };
299
278
  }
300
279
  function hasContext(context, owner = currentOwner) {
301
- return !isUndefined(owner == null ? void 0 : owner.o[context.id]);
280
+ return !isUndefined(owner == null ? void 0 : owner.p[context.id]);
302
281
  }
303
282
  function onCleanup(fn) {
304
283
  if (!currentOwner)
305
284
  return fn;
306
285
  const node = currentOwner;
307
- if (!node.m) {
308
- node.m = fn;
309
- } else if (Array.isArray(node.m)) {
310
- node.m.push(fn);
286
+ if (!node.l) {
287
+ node.l = fn;
288
+ } else if (Array.isArray(node.l)) {
289
+ node.l.push(fn);
311
290
  } else {
312
- node.m = [node.m, fn];
291
+ node.l = [node.l, fn];
313
292
  }
314
293
  return fn;
315
294
  }
@@ -338,44 +317,44 @@ function getObserver() {
338
317
  var UNCHANGED = Symbol(0);
339
318
  var Computation = class extends Owner {
340
319
  c = null;
341
- f = null;
320
+ e = null;
342
321
  g;
343
- G;
344
- A;
322
+ F;
323
+ z;
345
324
  // Used in __DEV__ mode, hopefully removed in production
346
- $;
325
+ ba;
347
326
  // Using false is an optimization as an alternative to _equals: () => false
348
327
  // which could enable more efficient DIRTY notification
349
- P = isEqual;
350
- U;
328
+ S = isEqual;
329
+ X;
351
330
  /** Whether the computation is an error or has ancestors that are unresolved */
352
- d = 0;
331
+ f = 0;
353
332
  /** Which flags raised by sources are handled, vs. being passed through. */
354
- Q = DEFAULT_FLAGS;
355
- B = -1;
356
- K = false;
333
+ T = DEFAULT_FLAGS;
334
+ A = -1;
335
+ w = false;
357
336
  constructor(initialValue, compute2, options) {
358
337
  super(null, compute2 === null);
359
- this.A = compute2;
338
+ this.z = compute2;
360
339
  this.a = compute2 ? STATE_DIRTY : STATE_CLEAN;
361
- this.d = compute2 && initialValue === void 0 ? UNINITIALIZED_BIT : 0;
340
+ this.f = compute2 && initialValue === void 0 ? UNINITIALIZED_BIT : 0;
362
341
  this.g = initialValue;
363
342
  if ((options == null ? void 0 : options.equals) !== void 0)
364
- this.P = options.equals;
343
+ this.S = options.equals;
365
344
  if (options == null ? void 0 : options.unobserved)
366
- this.U = options == null ? void 0 : options.unobserved;
345
+ this.X = options == null ? void 0 : options.unobserved;
367
346
  }
368
- V() {
369
- if (this.A) {
370
- if (this.d & ERROR_BIT && this.B <= getClock())
347
+ Y() {
348
+ if (this.z) {
349
+ if (this.f & ERROR_BIT && this.A <= getClock())
371
350
  update(this);
372
351
  else
373
- this.y();
352
+ this.x();
374
353
  }
375
354
  track(this);
376
- newFlags |= this.d & ~currentMask;
377
- if (this.d & ERROR_BIT) {
378
- throw this.G;
355
+ newFlags |= this.f & ~currentMask;
356
+ if (this.f & ERROR_BIT) {
357
+ throw this.F;
379
358
  } else {
380
359
  return this.g;
381
360
  }
@@ -385,7 +364,7 @@ var Computation = class extends Owner {
385
364
  * Automatically re-executes the surrounding computation when the value changes
386
365
  */
387
366
  read() {
388
- return this.V();
367
+ return this.Y();
389
368
  }
390
369
  /**
391
370
  * Return the current value of this computation
@@ -395,37 +374,37 @@ var Computation = class extends Owner {
395
374
  * before continuing
396
375
  */
397
376
  wait() {
398
- if (this.A && this.d & ERROR_BIT && this.B <= getClock()) {
377
+ if (this.z && this.f & ERROR_BIT && this.A <= getClock()) {
399
378
  update(this);
400
379
  } else {
401
- this.y();
380
+ this.x();
402
381
  }
403
382
  track(this);
404
- if ((notStale || this.d & UNINITIALIZED_BIT) && this.d & LOADING_BIT) {
383
+ if ((notStale || this.f & UNINITIALIZED_BIT) && this.f & LOADING_BIT) {
405
384
  throw new NotReadyError();
406
385
  }
407
- if (staleCheck && this.d & LOADING_BIT) {
386
+ if (staleCheck && this.f & LOADING_BIT) {
408
387
  staleCheck.g = true;
409
388
  }
410
- return this.V();
389
+ return this.Y();
411
390
  }
412
391
  /** Update the computation with a new value. */
413
392
  write(value, flags = 0, raw = false) {
414
393
  const newValue = !raw && typeof value === "function" ? value(this.g) : value;
415
- const valueChanged = newValue !== UNCHANGED && (!!(this.d & UNINITIALIZED_BIT) || this.d & LOADING_BIT & ~flags || this.P === false || !this.P(this.g, newValue));
394
+ const valueChanged = newValue !== UNCHANGED && (!!(this.f & UNINITIALIZED_BIT) || this.f & LOADING_BIT & ~flags || this.S === false || !this.S(this.g, newValue));
416
395
  if (valueChanged) {
417
396
  this.g = newValue;
418
- this.G = void 0;
397
+ this.F = void 0;
419
398
  }
420
- const changedFlagsMask = this.d ^ flags, changedFlags = changedFlagsMask & flags;
421
- this.d = flags;
422
- this.B = getClock() + 1;
423
- if (this.f) {
424
- for (let i = 0; i < this.f.length; i++) {
399
+ const changedFlagsMask = this.f ^ flags, changedFlags = changedFlagsMask & flags;
400
+ this.f = flags;
401
+ this.A = getClock() + 1;
402
+ if (this.e) {
403
+ for (let i = 0; i < this.e.length; i++) {
425
404
  if (valueChanged) {
426
- this.f[i].r(STATE_DIRTY);
405
+ this.e[i].r(STATE_DIRTY);
427
406
  } else if (changedFlagsMask) {
428
- this.f[i].W(changedFlagsMask, changedFlags);
407
+ this.e[i].Z(changedFlagsMask, changedFlags);
429
408
  }
430
409
  }
431
410
  }
@@ -435,13 +414,13 @@ var Computation = class extends Owner {
435
414
  * Set the current node's state, and recursively mark all of this node's observers as STATE_CHECK
436
415
  */
437
416
  r(state, skipQueue) {
438
- if (this.a >= state && !this.K)
417
+ if (this.a >= state && !this.w)
439
418
  return;
440
- this.K = !!skipQueue;
419
+ this.w = !!skipQueue;
441
420
  this.a = state;
442
- if (this.f) {
443
- for (let i = 0; i < this.f.length; i++) {
444
- this.f[i].r(STATE_CHECK, skipQueue);
421
+ if (this.e) {
422
+ for (let i = 0; i < this.e.length; i++) {
423
+ this.e[i].r(STATE_CHECK, skipQueue);
445
424
  }
446
425
  }
447
426
  }
@@ -451,31 +430,31 @@ var Computation = class extends Owner {
451
430
  * @param mask A bitmask for which flag(s) were changed.
452
431
  * @param newFlags The source's new flags, masked to just the changed ones.
453
432
  */
454
- W(mask, newFlags2) {
433
+ Z(mask, newFlags2) {
455
434
  if (this.a >= STATE_DIRTY)
456
435
  return;
457
- if (mask & this.Q) {
436
+ if (mask & this.T) {
458
437
  this.r(STATE_DIRTY);
459
438
  return;
460
439
  }
461
440
  if (this.a >= STATE_CHECK)
462
441
  return;
463
- const prevFlags = this.d & mask;
442
+ const prevFlags = this.f & mask;
464
443
  const deltaFlags = prevFlags ^ newFlags2;
465
444
  if (newFlags2 === prevFlags) ; else if (deltaFlags & prevFlags & mask) {
466
445
  this.r(STATE_CHECK);
467
446
  } else {
468
- this.d ^= deltaFlags;
469
- if (this.f) {
470
- for (let i = 0; i < this.f.length; i++) {
471
- this.f[i].W(mask, newFlags2);
447
+ this.f ^= deltaFlags;
448
+ if (this.e) {
449
+ for (let i = 0; i < this.e.length; i++) {
450
+ this.e[i].Z(mask, newFlags2);
472
451
  }
473
452
  }
474
453
  }
475
454
  }
476
- H(error) {
477
- this.G = error;
478
- this.write(UNCHANGED, this.d & ~LOADING_BIT | ERROR_BIT | UNINITIALIZED_BIT);
455
+ L(error) {
456
+ this.F = error;
457
+ this.write(UNCHANGED, this.f & ~LOADING_BIT | ERROR_BIT | UNINITIALIZED_BIT);
479
458
  }
480
459
  /**
481
460
  * This is the core part of the reactivity system, which makes sure that the values are updated
@@ -484,8 +463,8 @@ var Computation = class extends Owner {
484
463
  *
485
464
  * This function will ensure that the value and states we read from the computation are up to date
486
465
  */
487
- y() {
488
- if (!this.A) {
466
+ x() {
467
+ if (!this.z) {
489
468
  return;
490
469
  }
491
470
  if (this.a === STATE_DISPOSED) {
@@ -497,8 +476,8 @@ var Computation = class extends Owner {
497
476
  let observerFlags = 0;
498
477
  if (this.a === STATE_CHECK) {
499
478
  for (let i = 0; i < this.c.length; i++) {
500
- this.c[i].y();
501
- observerFlags |= this.c[i].d;
479
+ this.c[i].x();
480
+ observerFlags |= this.c[i].f;
502
481
  if (this.a === STATE_DIRTY) {
503
482
  break;
504
483
  }
@@ -514,12 +493,12 @@ var Computation = class extends Owner {
514
493
  /**
515
494
  * Remove ourselves from the owner graph and the computation graph
516
495
  */
517
- z() {
496
+ y() {
518
497
  if (this.a === STATE_DISPOSED)
519
498
  return;
520
499
  if (this.c)
521
500
  removeSourceObservers(this, 0);
522
- super.z();
501
+ super.y();
523
502
  }
524
503
  };
525
504
  function track(computation) {
@@ -532,7 +511,7 @@ function track(computation) {
532
511
  newSources.push(computation);
533
512
  }
534
513
  if (updateCheck) {
535
- updateCheck.g = computation.B > currentObserver.B;
514
+ updateCheck.g = computation.A > currentObserver.A;
536
515
  }
537
516
  }
538
517
  }
@@ -544,13 +523,13 @@ function update(node) {
544
523
  try {
545
524
  node.dispose(false);
546
525
  node.emptyDisposal();
547
- const result = compute(node, node.A, node);
526
+ const result = compute(node, node.z, node);
548
527
  node.write(result, newFlags, true);
549
528
  } catch (error) {
550
529
  if (error instanceof NotReadyError) {
551
- node.write(UNCHANGED, newFlags | LOADING_BIT | node.d & UNINITIALIZED_BIT);
530
+ node.write(UNCHANGED, newFlags | LOADING_BIT | node.f & UNINITIALIZED_BIT);
552
531
  } else {
553
- node.H(error);
532
+ node.L(error);
554
533
  }
555
534
  } finally {
556
535
  if (newSources) {
@@ -567,10 +546,10 @@ function update(node) {
567
546
  let source;
568
547
  for (let i = newSourcesIndex; i < node.c.length; i++) {
569
548
  source = node.c[i];
570
- if (!source.f)
571
- source.f = [node];
549
+ if (!source.e)
550
+ source.e = [node];
572
551
  else
573
- source.f.push(node);
552
+ source.e.push(node);
574
553
  }
575
554
  } else if (node.c && newSourcesIndex < node.c.length) {
576
555
  removeSourceObservers(node, newSourcesIndex);
@@ -579,7 +558,7 @@ function update(node) {
579
558
  newSources = prevSources;
580
559
  newSourcesIndex = prevSourcesIndex;
581
560
  newFlags = prevFlags;
582
- node.B = getClock() + 1;
561
+ node.A = getClock() + 1;
583
562
  node.a = STATE_CLEAN;
584
563
  }
585
564
  }
@@ -589,12 +568,12 @@ function removeSourceObservers(node, index) {
589
568
  let swap;
590
569
  for (let i = index; i < node.c.length; i++) {
591
570
  source = node.c[i];
592
- if (source.f) {
593
- swap = source.f.indexOf(node);
594
- source.f[swap] = source.f[source.f.length - 1];
595
- source.f.pop();
596
- if (!source.f.length)
597
- (_a = source.U) == null ? void 0 : _a.call(source);
571
+ if (source.e) {
572
+ swap = source.e.indexOf(node);
573
+ source.e[swap] = source.e[source.e.length - 1];
574
+ source.e.pop();
575
+ if (!source.e.length)
576
+ (_a = source.X) == null ? void 0 : _a.call(source);
598
577
  }
599
578
  }
600
579
  }
@@ -636,7 +615,7 @@ function isPending(fn, loadingValue) {
636
615
  if (!currentObserver)
637
616
  return pendingCheck(fn, loadingValue);
638
617
  const c = new Computation(void 0, () => pendingCheck(fn, loadingValue));
639
- c.Q |= LOADING_BIT;
618
+ c.T |= LOADING_BIT;
640
619
  return c.read();
641
620
  }
642
621
  function latest(fn, fallback) {
@@ -666,10 +645,10 @@ function runWithObserver(observer, run) {
666
645
  if (error instanceof NotReadyError) {
667
646
  observer.write(
668
647
  UNCHANGED,
669
- newFlags | LOADING_BIT | observer.d & UNINITIALIZED_BIT
648
+ newFlags | LOADING_BIT | observer.f & UNINITIALIZED_BIT
670
649
  );
671
650
  } else {
672
- observer.H(error);
651
+ observer.L(error);
673
652
  }
674
653
  } finally {
675
654
  if (newSources) {
@@ -684,10 +663,10 @@ function runWithObserver(observer, run) {
684
663
  let source;
685
664
  for (let i = newSourcesIndex; i < observer.c.length; i++) {
686
665
  source = observer.c[i];
687
- if (!source.f)
688
- source.f = [observer];
666
+ if (!source.e)
667
+ source.e = [observer];
689
668
  else
690
- source.f.push(observer);
669
+ source.e.push(observer);
691
670
  }
692
671
  }
693
672
  newSources = prevSources;
@@ -698,7 +677,7 @@ function runWithObserver(observer, run) {
698
677
  function compute(owner, fn, observer) {
699
678
  const prevOwner = setOwner(owner), prevObserver = currentObserver, prevMask = currentMask, prevNotStale = notStale;
700
679
  currentObserver = observer;
701
- currentMask = (observer == null ? void 0 : observer.Q) ?? DEFAULT_FLAGS;
680
+ currentMask = (observer == null ? void 0 : observer.T) ?? DEFAULT_FLAGS;
702
681
  notStale = true;
703
682
  try {
704
683
  return fn(observer ? observer.g : void 0);
@@ -774,84 +753,84 @@ function flattenArray(children, results = [], options) {
774
753
 
775
754
  // src/core/effect.ts
776
755
  var Effect = class extends Computation {
777
- L;
778
756
  M;
779
- C;
780
- R = false;
781
757
  N;
782
- u;
758
+ B;
759
+ U = false;
760
+ O;
761
+ t;
783
762
  constructor(initialValue, compute2, effect, error, options) {
784
763
  super(initialValue, compute2, options);
785
- this.L = effect;
786
- this.M = error;
787
- this.N = initialValue;
788
- this.u = (options == null ? void 0 : options.render) ? EFFECT_RENDER : EFFECT_USER;
789
- if (this.u === EFFECT_RENDER) {
790
- this.A = (p) => getClock() > this.h.created && !(this.d & ERROR_BIT) ? latest(() => compute2(p)) : compute2(p);
764
+ this.M = effect;
765
+ this.N = error;
766
+ this.O = initialValue;
767
+ this.t = (options == null ? void 0 : options.render) ? EFFECT_RENDER : EFFECT_USER;
768
+ if (this.t === EFFECT_RENDER) {
769
+ this.z = (p) => getClock() > this.h.created && !(this.f & ERROR_BIT) ? latest(() => compute2(p)) : compute2(p);
791
770
  }
792
- this.y();
793
- !(options == null ? void 0 : options.defer) && (this.u === EFFECT_USER ? this.h.enqueue(this.u, this) : this.T());
771
+ this.x();
772
+ !(options == null ? void 0 : options.defer) && (this.t === EFFECT_USER ? this.h.enqueue(this.t, this) : this.V());
794
773
  }
795
774
  write(value, flags = 0) {
796
- var _a, _b;
797
775
  if (this.a == STATE_DIRTY) {
798
- const currentFlags = this.d;
799
- this.d = flags;
800
- if (this.u === EFFECT_RENDER && (flags & LOADING_BIT) !== (currentFlags & LOADING_BIT)) {
801
- (_b = (_a = this.h).S) == null ? void 0 : _b.call(_a, this);
776
+ this.f;
777
+ this.f = flags;
778
+ if (this.t === EFFECT_RENDER) {
779
+ this.h.notify(this, LOADING_BIT | ERROR_BIT, flags);
802
780
  }
803
781
  }
804
782
  if (value === UNCHANGED)
805
783
  return this.g;
806
784
  this.g = value;
807
- this.R = true;
785
+ this.U = true;
808
786
  return value;
809
787
  }
810
788
  r(state, skipQueue) {
811
789
  if (this.a >= state || skipQueue)
812
790
  return;
813
791
  if (this.a === STATE_CLEAN)
814
- this.h.enqueue(this.u, this);
792
+ this.h.enqueue(this.t, this);
815
793
  this.a = state;
816
794
  }
817
- H(error) {
818
- var _a, _b, _c;
819
- (_a = this.C) == null ? void 0 : _a.call(this);
820
- if (this.d & LOADING_BIT) {
821
- (_c = (_b = this.h).S) == null ? void 0 : _c.call(_b, this);
822
- }
823
- this.d = ERROR_BIT;
824
- if (this.u === EFFECT_USER) {
795
+ L(error) {
796
+ var _a;
797
+ this.F = error;
798
+ (_a = this.B) == null ? void 0 : _a.call(this);
799
+ this.h.notify(this, LOADING_BIT, 0);
800
+ this.f = ERROR_BIT;
801
+ if (this.t === EFFECT_USER) {
825
802
  try {
826
- return this.M ? this.C = this.M(error) : console.error(new EffectError(this.L, error));
803
+ return this.N ? this.B = this.N(error) : console.error(new EffectError(this.M, error));
827
804
  } catch (e) {
828
805
  error = e;
829
806
  }
830
807
  }
831
- this.handleError(error);
808
+ if (!this.h.notify(this, ERROR_BIT, ERROR_BIT))
809
+ throw error;
832
810
  }
833
- z() {
811
+ y() {
834
812
  var _a;
835
813
  if (this.a === STATE_DISPOSED)
836
814
  return;
837
- this.L = void 0;
838
- this.N = void 0;
839
815
  this.M = void 0;
840
- (_a = this.C) == null ? void 0 : _a.call(this);
841
- this.C = void 0;
842
- super.z();
816
+ this.O = void 0;
817
+ this.N = void 0;
818
+ (_a = this.B) == null ? void 0 : _a.call(this);
819
+ this.B = void 0;
820
+ super.y();
843
821
  }
844
- T() {
822
+ V() {
845
823
  var _a;
846
- if (this.R && this.a !== STATE_DISPOSED) {
847
- (_a = this.C) == null ? void 0 : _a.call(this);
824
+ if (this.U && this.a !== STATE_DISPOSED) {
825
+ (_a = this.B) == null ? void 0 : _a.call(this);
848
826
  try {
849
- this.C = this.L(this.g, this.N);
827
+ this.B = this.M(this.g, this.O);
850
828
  } catch (e) {
851
- this.handleError(e);
829
+ if (!this.h.notify(this, ERROR_BIT, ERROR_BIT))
830
+ throw e;
852
831
  } finally {
853
- this.N = this.g;
854
- this.R = false;
832
+ this.O = this.g;
833
+ this.U = false;
855
834
  }
856
835
  }
857
836
  }
@@ -859,12 +838,12 @@ var Effect = class extends Computation {
859
838
  var EagerComputation = class extends Computation {
860
839
  constructor(initialValue, compute2, options) {
861
840
  super(initialValue, compute2, options);
862
- !(options == null ? void 0 : options.defer) && this.y();
841
+ !(options == null ? void 0 : options.defer) && this.x();
863
842
  }
864
843
  r(state, skipQueue) {
865
- if (this.a >= state && !this.K)
844
+ if (this.a >= state && !this.w)
866
845
  return;
867
- if (this.a === STATE_CLEAN && !skipQueue)
846
+ if (!skipQueue && (this.a === STATE_CLEAN || this.a === STATE_CHECK && this.w))
868
847
  this.h.enqueue(EFFECT_PURE, this);
869
848
  super.r(state, skipQueue);
870
849
  }
@@ -874,110 +853,142 @@ var ProjectionComputation = class extends Computation {
874
853
  super(void 0, compute2);
875
854
  }
876
855
  r(state, skipQueue) {
877
- if (this.a >= state && !this.K)
856
+ if (this.a >= state && !this.w)
878
857
  return;
879
- if (this.a === STATE_CLEAN && !skipQueue)
858
+ if (!skipQueue && (this.a === STATE_CLEAN || this.a === STATE_CHECK && this.w))
880
859
  this.h.enqueue(EFFECT_PURE, this);
881
860
  super.r(state, true);
861
+ this.w = !!skipQueue;
882
862
  }
883
863
  };
884
864
 
885
865
  // src/core/boundaries.ts
886
- function createBoundary(owner, fn, queue) {
887
- if (queue) {
888
- const parentQueue = owner.h;
889
- parentQueue.addChild(owner.h = queue);
890
- onCleanup(() => parentQueue.removeChild(owner.h));
866
+ var BoundaryComputation = class extends EagerComputation {
867
+ G;
868
+ constructor(compute2, propagationMask) {
869
+ super(void 0, compute2, { defer: true });
870
+ this.G = propagationMask;
871
+ }
872
+ write(value, flags) {
873
+ super.write(value, flags & ~this.G);
874
+ if (this.G & LOADING_BIT && !(this.f & UNINITIALIZED_BIT)) {
875
+ flags &= ~LOADING_BIT;
876
+ }
877
+ this.h.notify(this, this.G, flags);
878
+ return this.g;
891
879
  }
880
+ };
881
+ function createBoundChildren(owner, fn, queue, mask) {
882
+ const parentQueue = owner.h;
883
+ parentQueue.addChild(owner.h = queue);
884
+ onCleanup(() => parentQueue.removeChild(owner.h));
892
885
  return compute(
893
886
  owner,
894
887
  () => {
895
888
  const c = new Computation(void 0, fn);
896
- return new EagerComputation(void 0, () => flatten(c.wait()), { defer: true });
889
+ return new BoundaryComputation(() => flatten(c.wait()), mask);
897
890
  },
898
891
  null
899
892
  );
900
893
  }
901
- function createDecision(main, condition, fallback) {
902
- const decision = new Computation(void 0, () => {
903
- if (!condition.read()) {
904
- const resolved = main.read();
905
- if (!condition.read())
906
- return resolved;
894
+ var ConditionalQueue = class extends Queue {
895
+ n;
896
+ P = /* @__PURE__ */ new Set();
897
+ Q = /* @__PURE__ */ new Set();
898
+ constructor(disabled) {
899
+ super();
900
+ this.n = disabled;
901
+ }
902
+ run(type) {
903
+ if (!type || this.n.read())
904
+ return;
905
+ return super.run(type);
906
+ }
907
+ notify(node, type, flags) {
908
+ if (this.n.read()) {
909
+ if (type === LOADING_BIT) {
910
+ flags & LOADING_BIT ? this.Q.add(node) : this.Q.delete(node);
911
+ }
912
+ if (type === ERROR_BIT) {
913
+ flags & ERROR_BIT ? this.P.add(node) : this.P.delete(node);
914
+ }
915
+ return true;
907
916
  }
908
- return fallback();
909
- });
910
- return decision.read.bind(decision);
911
- }
912
- var SuspenseQueue = class extends Queue {
917
+ return super.notify(node, type, flags);
918
+ }
919
+ };
920
+ var CollectionQueue = class extends Queue {
921
+ R;
913
922
  b = /* @__PURE__ */ new Set();
914
- p = new Computation(false, null);
923
+ n = new Computation(false, null);
924
+ constructor(type) {
925
+ super();
926
+ this.R = type;
927
+ }
915
928
  run(type) {
916
- if (type && this.p.read())
929
+ if (!type || this.n.read())
917
930
  return;
918
931
  return super.run(type);
919
932
  }
920
- S(node) {
921
- if (node.d & LOADING_BIT) {
933
+ notify(node, type, flags) {
934
+ if (!(type & this.R))
935
+ return super.notify(node, type, flags);
936
+ if (flags & this.R) {
922
937
  this.b.add(node);
923
938
  if (this.b.size === 1)
924
- this.p.write(true);
939
+ this.n.write(true);
925
940
  } else {
926
941
  this.b.delete(node);
927
942
  if (this.b.size === 0)
928
- this.p.write(false);
943
+ this.n.write(false);
929
944
  }
945
+ type &= ~this.R;
946
+ return type ? super.notify(node, type, flags) : true;
930
947
  }
931
948
  };
932
- function createSuspense(fn, fallback) {
949
+ function createBoundary(fn, condition) {
933
950
  const owner = new Owner();
934
- const queue = new SuspenseQueue();
935
- const tree = createBoundary(owner, fn, queue);
936
- const ogWrite = tree.write;
937
- tree.write = function(value, flags = 0) {
938
- var _a, _b;
939
- const currentFlags = this.d;
940
- const dirty = this.a === STATE_DIRTY;
941
- ogWrite.call(this, value, flags);
942
- if (dirty && (flags & LOADING_BIT) !== (currentFlags & LOADING_BIT)) {
943
- (_b = (_a = this.h).S) == null ? void 0 : _b.call(_a, this);
951
+ const queue = new ConditionalQueue(new Computation(void 0, () => condition() === "hidden" /* HIDDEN */));
952
+ const tree = createBoundChildren(owner, fn, queue, 0);
953
+ new EagerComputation(void 0, () => {
954
+ const disabled = queue.n.read();
955
+ tree.G = disabled ? ERROR_BIT | LOADING_BIT : 0;
956
+ if (!disabled) {
957
+ queue.Q.forEach((node) => queue.notify(node, LOADING_BIT, LOADING_BIT));
958
+ queue.P.forEach((node) => queue.notify(node, ERROR_BIT, ERROR_BIT));
959
+ queue.Q.clear();
960
+ queue.P.clear();
944
961
  }
945
- return this.g;
946
- };
947
- return createDecision(tree, queue.p, fallback);
962
+ });
963
+ return () => queue.n.read() ? void 0 : tree.read();
948
964
  }
949
- function createErrorBoundary(fn, fallback) {
965
+ function createCollectionBoundary(type, fn, fallback) {
950
966
  const owner = new Owner();
951
- const error = new Computation(void 0, null);
952
- const nodes = /* @__PURE__ */ new Set();
953
- function handler(err, node) {
954
- if (nodes.has(node))
955
- return;
956
- compute(
957
- node,
958
- () => onCleanup(() => {
959
- nodes.delete(node);
960
- if (!nodes.size)
961
- error.write(void 0);
962
- }),
963
- null
964
- );
965
- nodes.add(node);
966
- if (nodes.size === 1)
967
- error.write({ G: err });
968
- }
969
- owner.addErrorHandler(handler);
970
- const tree = createBoundary(owner, fn);
971
- tree.H = tree.handleError;
972
- return createDecision(
973
- tree,
974
- error,
975
- () => fallback(error.read().G, () => {
967
+ const queue = new CollectionQueue(type);
968
+ const tree = createBoundChildren(owner, fn, queue, type);
969
+ const decision = new Computation(void 0, () => {
970
+ if (!queue.n.read()) {
971
+ const resolved = tree.read();
972
+ if (!queue.n.read())
973
+ return resolved;
974
+ }
975
+ return fallback(queue);
976
+ });
977
+ return decision.read.bind(decision);
978
+ }
979
+ function createSuspense(fn, fallback) {
980
+ return createCollectionBoundary(LOADING_BIT, fn, () => fallback());
981
+ }
982
+ function createErrorBoundary(fn, fallback) {
983
+ return createCollectionBoundary(
984
+ ERROR_BIT,
985
+ fn,
986
+ (queue) => fallback(queue.b.values().next().value.F, () => {
976
987
  var _a;
977
988
  incrementClock();
978
- for (let node of nodes) {
989
+ for (let node of queue.b) {
979
990
  node.a = STATE_DIRTY;
980
- (_a = node.h) == null ? void 0 : _a.enqueue(node.u, node);
991
+ (_a = node.h) == null ? void 0 : _a.enqueue(node.t, node);
981
992
  }
982
993
  })
983
994
  );
@@ -1014,7 +1025,7 @@ function createMemo(compute2, value, options) {
1014
1025
  return resolvedValue;
1015
1026
  }
1016
1027
  resolvedValue = node.wait();
1017
- if (!((_a = node.c) == null ? void 0 : _a.length) && ((_b = node.l) == null ? void 0 : _b.x) !== node) {
1028
+ if (!((_a = node.c) == null ? void 0 : _a.length) && ((_b = node.m) == null ? void 0 : _b.o) !== node) {
1018
1029
  node.dispose();
1019
1030
  node = void 0;
1020
1031
  }
@@ -1044,7 +1055,7 @@ function createAsync(compute2, value, options) {
1044
1055
  (error) => {
1045
1056
  if (abort)
1046
1057
  return;
1047
- node.H(error);
1058
+ node.L(error);
1048
1059
  }
1049
1060
  );
1050
1061
  } else {
@@ -1235,7 +1246,7 @@ function ownKeys(target) {
1235
1246
  trackSelf(target);
1236
1247
  return Reflect.ownKeys(target[STORE_VALUE]);
1237
1248
  }
1238
- var Writing = /* @__PURE__ */ new Set();
1249
+ var Writing = null;
1239
1250
  var proxyTraps = {
1240
1251
  get(target, property, receiver) {
1241
1252
  if (property === $TARGET)
@@ -1256,7 +1267,7 @@ var proxyTraps = {
1256
1267
  if (desc && desc.get)
1257
1268
  return desc.get.call(receiver);
1258
1269
  }
1259
- if (Writing.has(storeValue)) {
1270
+ if (Writing == null ? void 0 : Writing.has(storeValue)) {
1260
1271
  const value2 = tracked ? tracked.g : storeValue[property];
1261
1272
  return isWrappable(value2) ? (Writing.add(value2[$RAW] || value2), wrap2(value2)) : value2;
1262
1273
  }
@@ -1279,11 +1290,11 @@ var proxyTraps = {
1279
1290
  return has;
1280
1291
  },
1281
1292
  set(target, property, value) {
1282
- Writing.has(target[STORE_VALUE]) && setProperty(target[STORE_VALUE], property, unwrap(value, false));
1293
+ (Writing == null ? void 0 : Writing.has(target[STORE_VALUE])) && setProperty(target[STORE_VALUE], property, unwrap(value, false));
1283
1294
  return true;
1284
1295
  },
1285
1296
  deleteProperty(target, property) {
1286
- Writing.has(target[STORE_VALUE]) && setProperty(target[STORE_VALUE], property, void 0, true);
1297
+ (Writing == null ? void 0 : Writing.has(target[STORE_VALUE])) && setProperty(target[STORE_VALUE], property, void 0, true);
1287
1298
  return true;
1288
1299
  },
1289
1300
  ownKeys,
@@ -1368,11 +1379,14 @@ function createStore(first, second) {
1368
1379
  const unwrappedStore = unwrap(store);
1369
1380
  let wrappedStore = wrap2(unwrappedStore);
1370
1381
  const setStore = (fn) => {
1382
+ const prevWriting = Writing;
1383
+ Writing = /* @__PURE__ */ new Set();
1384
+ Writing.add(unwrappedStore);
1371
1385
  try {
1372
- Writing.add(unwrappedStore);
1373
1386
  fn(wrappedStore);
1374
1387
  } finally {
1375
1388
  Writing.clear();
1389
+ Writing = prevWriting;
1376
1390
  }
1377
1391
  };
1378
1392
  if (derived)
@@ -1649,72 +1663,72 @@ function omit(props, ...keys) {
1649
1663
  function mapArray(list, map, options) {
1650
1664
  const keyFn = typeof (options == null ? void 0 : options.keyed) === "function" ? options.keyed : void 0;
1651
1665
  return updateKeyedMap.bind({
1652
- I: new Owner(),
1666
+ H: new Owner(),
1653
1667
  i: 0,
1654
- Y: list,
1655
- w: [],
1656
- D: map,
1657
- e: [],
1668
+ _: list,
1669
+ u: [],
1670
+ C: map,
1671
+ d: [],
1658
1672
  b: [],
1659
- E: keyFn,
1673
+ D: keyFn,
1660
1674
  j: keyFn || (options == null ? void 0 : options.keyed) === false ? [] : void 0,
1661
1675
  k: map.length > 1 ? [] : void 0,
1662
- p: options == null ? void 0 : options.fallback
1676
+ I: options == null ? void 0 : options.fallback
1663
1677
  });
1664
1678
  }
1665
1679
  function updateKeyedMap() {
1666
- const newItems = this.Y() || [], newLen = newItems.length;
1680
+ const newItems = this._() || [], newLen = newItems.length;
1667
1681
  newItems[$TRACK];
1668
- runWithOwner(this.I, () => {
1682
+ runWithOwner(this.H, () => {
1669
1683
  let i, j, mapper = this.j ? () => {
1670
1684
  this.j[j] = new Computation(newItems[j], null);
1671
1685
  this.k && (this.k[j] = new Computation(j, null));
1672
- return this.D(
1686
+ return this.C(
1673
1687
  Computation.prototype.read.bind(this.j[j]),
1674
1688
  this.k ? Computation.prototype.read.bind(this.k[j]) : void 0
1675
1689
  );
1676
1690
  } : this.k ? () => {
1677
1691
  const item = newItems[j];
1678
1692
  this.k[j] = new Computation(j, null);
1679
- return this.D(() => item, Computation.prototype.read.bind(this.k[j]));
1693
+ return this.C(() => item, Computation.prototype.read.bind(this.k[j]));
1680
1694
  } : () => {
1681
1695
  const item = newItems[j];
1682
- return this.D(() => item);
1696
+ return this.C(() => item);
1683
1697
  };
1684
1698
  if (newLen === 0) {
1685
1699
  if (this.i !== 0) {
1686
- this.I.dispose(false);
1700
+ this.H.dispose(false);
1687
1701
  this.b = [];
1688
- this.w = [];
1689
- this.e = [];
1702
+ this.u = [];
1703
+ this.d = [];
1690
1704
  this.i = 0;
1691
1705
  this.j && (this.j = []);
1692
1706
  this.k && (this.k = []);
1693
1707
  }
1694
- if (this.p && !this.e[0]) {
1695
- this.e[0] = compute(
1708
+ if (this.I && !this.d[0]) {
1709
+ this.d[0] = compute(
1696
1710
  this.b[0] = new Owner(),
1697
- this.p,
1711
+ this.I,
1698
1712
  null
1699
1713
  );
1700
1714
  }
1701
1715
  } else if (this.i === 0) {
1702
1716
  if (this.b[0])
1703
1717
  this.b[0].dispose();
1704
- this.e = new Array(newLen);
1718
+ this.d = new Array(newLen);
1705
1719
  for (j = 0; j < newLen; j++) {
1706
- this.w[j] = newItems[j];
1707
- this.e[j] = compute(this.b[j] = new Owner(), mapper, null);
1720
+ this.u[j] = newItems[j];
1721
+ this.d[j] = compute(this.b[j] = new Owner(), mapper, null);
1708
1722
  }
1709
1723
  this.i = newLen;
1710
1724
  } else {
1711
1725
  let start, end, newEnd, item, key, newIndices, newIndicesNext, temp = new Array(newLen), tempNodes = new Array(newLen), tempRows = this.j ? new Array(newLen) : void 0, tempIndexes = this.k ? new Array(newLen) : void 0;
1712
- for (start = 0, end = Math.min(this.i, newLen); start < end && (this.w[start] === newItems[start] || this.j && compare(this.E, this.w[start], newItems[start])); start++) {
1726
+ for (start = 0, end = Math.min(this.i, newLen); start < end && (this.u[start] === newItems[start] || this.j && compare(this.D, this.u[start], newItems[start])); start++) {
1713
1727
  if (this.j)
1714
1728
  this.j[start].write(newItems[start]);
1715
1729
  }
1716
- for (end = this.i - 1, newEnd = newLen - 1; end >= start && newEnd >= start && (this.w[end] === newItems[newEnd] || this.j && compare(this.E, this.w[end], newItems[newEnd])); end--, newEnd--) {
1717
- temp[newEnd] = this.e[end];
1730
+ for (end = this.i - 1, newEnd = newLen - 1; end >= start && newEnd >= start && (this.u[end] === newItems[newEnd] || this.j && compare(this.D, this.u[end], newItems[newEnd])); end--, newEnd--) {
1731
+ temp[newEnd] = this.d[end];
1718
1732
  tempNodes[newEnd] = this.b[end];
1719
1733
  tempRows && (tempRows[newEnd] = this.j[end]);
1720
1734
  tempIndexes && (tempIndexes[newEnd] = this.k[end]);
@@ -1723,17 +1737,17 @@ function updateKeyedMap() {
1723
1737
  newIndicesNext = new Array(newEnd + 1);
1724
1738
  for (j = newEnd; j >= start; j--) {
1725
1739
  item = newItems[j];
1726
- key = this.E ? this.E(item) : item;
1740
+ key = this.D ? this.D(item) : item;
1727
1741
  i = newIndices.get(key);
1728
1742
  newIndicesNext[j] = i === void 0 ? -1 : i;
1729
1743
  newIndices.set(key, j);
1730
1744
  }
1731
1745
  for (i = start; i <= end; i++) {
1732
- item = this.w[i];
1733
- key = this.E ? this.E(item) : item;
1746
+ item = this.u[i];
1747
+ key = this.D ? this.D(item) : item;
1734
1748
  j = newIndices.get(key);
1735
1749
  if (j !== void 0 && j !== -1) {
1736
- temp[j] = this.e[i];
1750
+ temp[j] = this.d[i];
1737
1751
  tempNodes[j] = this.b[i];
1738
1752
  tempRows && (tempRows[j] = this.j[i]);
1739
1753
  tempIndexes && (tempIndexes[j] = this.k[i]);
@@ -1744,7 +1758,7 @@ function updateKeyedMap() {
1744
1758
  }
1745
1759
  for (j = start; j < newLen; j++) {
1746
1760
  if (j in temp) {
1747
- this.e[j] = temp[j];
1761
+ this.d[j] = temp[j];
1748
1762
  this.b[j] = tempNodes[j];
1749
1763
  if (tempRows) {
1750
1764
  this.j[j] = tempRows[j];
@@ -1755,44 +1769,44 @@ function updateKeyedMap() {
1755
1769
  this.k[j].write(j);
1756
1770
  }
1757
1771
  } else {
1758
- this.e[j] = compute(this.b[j] = new Owner(), mapper, null);
1772
+ this.d[j] = compute(this.b[j] = new Owner(), mapper, null);
1759
1773
  }
1760
1774
  }
1761
- this.e = this.e.slice(0, this.i = newLen);
1762
- this.w = newItems.slice(0);
1775
+ this.d = this.d.slice(0, this.i = newLen);
1776
+ this.u = newItems.slice(0);
1763
1777
  }
1764
1778
  });
1765
- return this.e;
1779
+ return this.d;
1766
1780
  }
1767
1781
  function repeat(count, map, options) {
1768
1782
  return updateRepeat.bind({
1769
- I: new Owner(),
1783
+ H: new Owner(),
1770
1784
  i: 0,
1771
1785
  q: 0,
1772
- Z: count,
1773
- D: map,
1786
+ $: count,
1787
+ C: map,
1774
1788
  b: [],
1775
- e: [],
1776
- _: options == null ? void 0 : options.from,
1777
- p: options == null ? void 0 : options.fallback
1789
+ d: [],
1790
+ aa: options == null ? void 0 : options.from,
1791
+ I: options == null ? void 0 : options.fallback
1778
1792
  });
1779
1793
  }
1780
1794
  function updateRepeat() {
1781
1795
  var _a;
1782
- const newLen = this.Z();
1783
- const from = ((_a = this._) == null ? void 0 : _a.call(this)) || 0;
1784
- runWithOwner(this.I, () => {
1796
+ const newLen = this.$();
1797
+ const from = ((_a = this.aa) == null ? void 0 : _a.call(this)) || 0;
1798
+ runWithOwner(this.H, () => {
1785
1799
  if (newLen === 0) {
1786
1800
  if (this.i !== 0) {
1787
- this.I.dispose(false);
1801
+ this.H.dispose(false);
1788
1802
  this.b = [];
1789
- this.e = [];
1803
+ this.d = [];
1790
1804
  this.i = 0;
1791
1805
  }
1792
- if (this.p && !this.e[0]) {
1793
- this.e[0] = compute(
1806
+ if (this.I && !this.d[0]) {
1807
+ this.d[0] = compute(
1794
1808
  this.b[0] = new Owner(),
1795
- this.p,
1809
+ this.I,
1796
1810
  null
1797
1811
  );
1798
1812
  }
@@ -1809,36 +1823,36 @@ function updateRepeat() {
1809
1823
  while (i < from && i < this.i)
1810
1824
  this.b[i++].dispose();
1811
1825
  this.b.splice(0, from - this.q);
1812
- this.e.splice(0, from - this.q);
1826
+ this.d.splice(0, from - this.q);
1813
1827
  } else if (this.q > from) {
1814
1828
  let i = prevTo - this.q - 1;
1815
1829
  let difference = this.q - from;
1816
- this.b.length = this.e.length = newLen;
1830
+ this.b.length = this.d.length = newLen;
1817
1831
  while (i >= difference) {
1818
1832
  this.b[i] = this.b[i - difference];
1819
- this.e[i] = this.e[i - difference];
1833
+ this.d[i] = this.d[i - difference];
1820
1834
  i--;
1821
1835
  }
1822
1836
  for (let i2 = 0; i2 < difference; i2++) {
1823
- this.e[i2] = compute(
1837
+ this.d[i2] = compute(
1824
1838
  this.b[i2] = new Owner(),
1825
- () => this.D(i2 + from),
1839
+ () => this.C(i2 + from),
1826
1840
  null
1827
1841
  );
1828
1842
  }
1829
1843
  }
1830
1844
  for (let i = prevTo; i < to; i++) {
1831
- this.e[i - from] = compute(
1845
+ this.d[i - from] = compute(
1832
1846
  this.b[i - from] = new Owner(),
1833
- () => this.D(i),
1847
+ () => this.C(i),
1834
1848
  null
1835
1849
  );
1836
1850
  }
1837
- this.e = this.e.slice(0, newLen);
1851
+ this.d = this.d.slice(0, newLen);
1838
1852
  this.q = from;
1839
1853
  this.i = newLen;
1840
1854
  });
1841
- return this.e;
1855
+ return this.d;
1842
1856
  }
1843
1857
  function compare(key, a, b) {
1844
1858
  return key ? key(a) === key(b) : true;
@@ -1856,6 +1870,7 @@ exports.Owner = Owner;
1856
1870
  exports.Queue = Queue;
1857
1871
  exports.SUPPORTS_PROXY = SUPPORTS_PROXY;
1858
1872
  exports.createAsync = createAsync;
1873
+ exports.createBoundary = createBoundary;
1859
1874
  exports.createContext = createContext;
1860
1875
  exports.createEffect = createEffect;
1861
1876
  exports.createErrorBoundary = createErrorBoundary;