@solidjs/signals 0.4.8 → 0.4.9

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
@@ -45,30 +45,30 @@ function schedule() {
45
45
  if (scheduled)
46
46
  return;
47
47
  scheduled = true;
48
- if (!globalQueue.z)
48
+ if (!globalQueue.A)
49
49
  queueMicrotask(flush);
50
50
  }
51
51
  function notifyUnobserved() {
52
52
  for (let i = 0; i < Unobserved.length; i++) {
53
53
  const source = Unobserved[i];
54
54
  if (!source.b || !source.b.length)
55
- Unobserved[i].da?.();
55
+ Unobserved[i].ea?.();
56
56
  }
57
57
  Unobserved = [];
58
58
  }
59
59
  var pureQueue = [];
60
60
  var Queue = class {
61
- m = null;
62
- z = false;
63
- f = [[], []];
64
- e = [];
61
+ k = null;
62
+ A = false;
63
+ g = [[], []];
64
+ f = [];
65
65
  created = clock;
66
66
  enqueue(type, fn) {
67
- if (ActiveTransition && ActiveTransition.u.has(this))
68
- return ActiveTransition.u.get(this).enqueue(type, fn);
67
+ if (ActiveTransition && ActiveTransition.p.has(this))
68
+ return ActiveTransition.p.get(this).enqueue(type, fn);
69
69
  pureQueue.push(fn);
70
70
  if (type)
71
- this.f[type - 1].push(fn);
71
+ this.g[type - 1].push(fn);
72
72
  schedule();
73
73
  }
74
74
  run(type) {
@@ -76,19 +76,19 @@ var Queue = class {
76
76
  pureQueue.length && runQueue(pureQueue, type);
77
77
  pureQueue = [];
78
78
  return;
79
- } else if (this.f[type - 1].length) {
80
- const effects = this.f[type - 1];
81
- this.f[type - 1] = [];
79
+ } else if (this.g[type - 1].length) {
80
+ const effects = this.g[type - 1];
81
+ this.g[type - 1] = [];
82
82
  runQueue(effects, type);
83
83
  }
84
- for (let i = 0; i < this.e.length; i++) {
85
- this.e[i].run(type);
84
+ for (let i = 0; i < this.f.length; i++) {
85
+ this.f[i].run(type);
86
86
  }
87
87
  }
88
88
  flush() {
89
- if (this.z)
89
+ if (this.A)
90
90
  return;
91
- this.z = true;
91
+ this.A = true;
92
92
  try {
93
93
  this.run(EFFECT_PURE);
94
94
  incrementClock();
@@ -96,35 +96,41 @@ var Queue = class {
96
96
  this.run(EFFECT_RENDER);
97
97
  this.run(EFFECT_USER);
98
98
  } finally {
99
- this.z = false;
99
+ this.A = false;
100
100
  Unobserved.length && notifyUnobserved();
101
101
  }
102
102
  }
103
103
  addChild(child) {
104
- this.e.push(child);
105
- child.m = this;
104
+ if (ActiveTransition && ActiveTransition.p.has(this))
105
+ return ActiveTransition.p.get(this).addChild(child);
106
+ this.f.push(child);
107
+ child.k = this;
106
108
  }
107
109
  removeChild(child) {
108
- const index = this.e.indexOf(child);
109
- if (index >= 0)
110
- this.e.splice(index, 1);
110
+ if (ActiveTransition && ActiveTransition.p.has(this))
111
+ return ActiveTransition.p.get(this).removeChild(child);
112
+ const index = this.f.indexOf(child);
113
+ if (index >= 0) {
114
+ this.f.splice(index, 1);
115
+ child.k = null;
116
+ }
111
117
  }
112
118
  notify(...args) {
113
- if (ActiveTransition && ActiveTransition.u.has(this))
114
- return ActiveTransition.u.get(this).notify(...args);
115
- if (this.m)
116
- return this.m.notify(...args);
119
+ if (ActiveTransition && ActiveTransition.p.has(this))
120
+ return ActiveTransition.p.get(this).notify(...args);
121
+ if (this.k)
122
+ return this.k.notify(...args);
117
123
  return false;
118
124
  }
119
125
  merge(queue) {
120
- this.f[0].push.apply(this.f[0], queue.f[0]);
121
- this.f[1].push.apply(this.f[1], queue.f[1]);
122
- for (let i = 0; i < queue.e.length; i++) {
123
- const og = this.e.find((c) => c.h === queue.e[i].h);
126
+ this.g[0].push.apply(this.g[0], queue.g[0]);
127
+ this.g[1].push.apply(this.g[1], queue.g[1]);
128
+ for (let i = 0; i < queue.f.length; i++) {
129
+ const og = this.f.find((c) => c.e === queue.f[i].e);
124
130
  if (og)
125
- og.merge(queue.e[i]);
131
+ og.merge(queue.f[i]);
126
132
  else
127
- this.addChild(queue.e[i]);
133
+ this.addChild(queue.f[i]);
128
134
  }
129
135
  }
130
136
  };
@@ -134,34 +140,50 @@ function flush() {
134
140
  globalQueue.flush();
135
141
  }
136
142
  }
143
+ function removeSourceObservers(node, index) {
144
+ let source;
145
+ let swap;
146
+ for (let i = index; i < node.a.length; i++) {
147
+ source = getTransitionSource(node.a[i]);
148
+ if (source.b) {
149
+ if ((swap = source.b.indexOf(node)) !== -1) {
150
+ source.b[swap] = source.b[source.b.length - 1];
151
+ source.b.pop();
152
+ }
153
+ if (!source.b.length)
154
+ Unobserved.push(source);
155
+ }
156
+ }
157
+ }
137
158
  function runQueue(queue, type) {
138
159
  for (let i = 0; i < queue.length; i++)
139
160
  queue[i](type);
140
161
  }
141
162
  var Transition = class _Transition {
142
163
  a = /* @__PURE__ */ new Map();
143
- s = /* @__PURE__ */ new Set();
144
- R = /* @__PURE__ */ new Set();
164
+ t = /* @__PURE__ */ new Set();
165
+ Q = /* @__PURE__ */ new Set();
145
166
  W = /* @__PURE__ */ new Set();
146
- J = false;
147
- f = [[], []];
148
- u = /* @__PURE__ */ new Map();
167
+ I = false;
168
+ g = [[], []];
169
+ p = /* @__PURE__ */ new Map();
149
170
  E = [];
150
- e = [];
151
- m = null;
152
- z = false;
171
+ f = [];
172
+ k = null;
173
+ A = false;
153
174
  X = false;
175
+ e = globalQueue;
154
176
  created = clock;
155
177
  constructor() {
156
- this.u.set(globalQueue, this);
157
- for (const child of globalQueue.e) {
158
- cloneQueue(child, this, this.u);
178
+ this.p.set(globalQueue, this);
179
+ for (const child of globalQueue.f) {
180
+ cloneQueue(child, this, this.p);
159
181
  }
160
182
  }
161
183
  enqueue(type, fn) {
162
184
  this.E.push(fn);
163
185
  if (type)
164
- this.f[type - 1].push(fn);
186
+ this.g[type - 1].push(fn);
165
187
  this.schedule();
166
188
  }
167
189
  run(type) {
@@ -169,19 +191,19 @@ var Transition = class _Transition {
169
191
  this.E.length && runQueue(this.E, type);
170
192
  this.E = [];
171
193
  return;
172
- } else if (this.f[type - 1].length) {
173
- const effects = this.f[type - 1];
174
- this.f[type - 1] = [];
194
+ } else if (this.g[type - 1].length) {
195
+ const effects = this.g[type - 1];
196
+ this.g[type - 1] = [];
175
197
  runQueue(effects, type);
176
198
  }
177
- for (let i = 0; i < this.e.length; i++) {
178
- this.e[i].run(type);
199
+ for (let i = 0; i < this.f.length; i++) {
200
+ this.f[i].run(type);
179
201
  }
180
202
  }
181
203
  flush() {
182
- if (this.z)
204
+ if (this.A)
183
205
  return;
184
- this.z = true;
206
+ this.A = true;
185
207
  let currentTransition = ActiveTransition;
186
208
  ActiveTransition = this;
187
209
  try {
@@ -191,52 +213,52 @@ var Transition = class _Transition {
191
213
  ActiveTransition = currentTransition;
192
214
  finishTransition(this);
193
215
  } finally {
194
- this.z = false;
216
+ this.A = false;
195
217
  ActiveTransition = currentTransition;
196
218
  }
197
219
  }
198
220
  addChild(child) {
199
- this.e.push(child);
200
- child.m = this;
221
+ this.f.push(child);
222
+ child.k = this;
201
223
  }
202
224
  removeChild(child) {
203
- const index = this.e.indexOf(child);
225
+ const index = this.f.indexOf(child);
204
226
  if (index >= 0)
205
- this.e.splice(index, 1);
227
+ this.f.splice(index, 1);
206
228
  }
207
229
  notify(node, type, flags) {
208
230
  if (!(type & LOADING_BIT))
209
231
  return false;
210
232
  if (flags & LOADING_BIT) {
211
- this.s.add(node);
233
+ this.t.add(node);
212
234
  } else {
213
- this.s.delete(node);
235
+ this.t.delete(node);
214
236
  }
215
237
  return true;
216
238
  }
217
239
  merge(queue) {
218
- this.f[0].push.apply(this.f[0], queue.f[0]);
219
- this.f[1].push.apply(this.f[1], queue.f[1]);
240
+ this.g[0].push.apply(this.g[0], queue.g[0]);
241
+ this.g[1].push.apply(this.g[1], queue.g[1]);
220
242
  this.E.push.apply(this.E, queue.E);
221
- for (let i = 0; i < queue.e.length; i++) {
222
- const og = this.e.find((c) => c.h === queue.e[i].h);
243
+ for (let i = 0; i < queue.f.length; i++) {
244
+ const og = this.f.find((c) => c.e === queue.f[i].e);
223
245
  if (og)
224
- og.merge(queue.e[i]);
246
+ og.merge(queue.f[i]);
225
247
  else
226
- this.addChild(queue.e[i]);
248
+ this.addChild(queue.f[i]);
227
249
  }
228
250
  }
229
251
  schedule() {
230
252
  if (this.X)
231
253
  return;
232
254
  this.X = true;
233
- if (!this.z)
255
+ if (!this.A)
234
256
  queueMicrotask(() => this.flush());
235
257
  }
236
258
  runTransition(fn, force = false) {
237
- if (this.J) {
238
- if (this.J instanceof _Transition)
239
- return this.J.runTransition(fn, force);
259
+ if (this.I) {
260
+ if (this.I instanceof _Transition)
261
+ return this.I.runTransition(fn, force);
240
262
  if (!force)
241
263
  throw new Error("Transition already completed");
242
264
  fn();
@@ -247,9 +269,9 @@ var Transition = class _Transition {
247
269
  const result = fn();
248
270
  const transition2 = ActiveTransition;
249
271
  if (result instanceof Promise) {
250
- transition2.R.add(result);
272
+ transition2.Q.add(result);
251
273
  result.finally(() => {
252
- transition2.R.delete(result);
274
+ transition2.Q.delete(result);
253
275
  finishTransition(transition2);
254
276
  });
255
277
  }
@@ -283,14 +305,12 @@ function cloneGraph(node) {
283
305
  }
284
306
  const clone = Object.create(Object.getPrototypeOf(node));
285
307
  Object.assign(clone, node, {
308
+ o: null,
286
309
  n: null,
287
- r: null,
288
310
  b: null,
289
311
  a: node.a ? [...node.a] : null,
290
- h: node
312
+ e: node
291
313
  });
292
- if (clone.F)
293
- clone.g |= UNINITIALIZED_BIT;
294
314
  ActiveTransition.a.set(node, clone);
295
315
  node.j = ActiveTransition;
296
316
  if (node.a) {
@@ -300,7 +320,7 @@ function cloneGraph(node) {
300
320
  if (node.b) {
301
321
  clone.b = [];
302
322
  for (let i = 0, length = node.b.length; i < length; i++) {
303
- !node.b[i].h && clone.b.push(cloneGraph(node.b[i]));
323
+ !node.b[i].e && clone.b.push(cloneGraph(node.b[i]));
304
324
  }
305
325
  }
306
326
  return clone;
@@ -313,7 +333,7 @@ function replaceSourceObservers(node, transition2) {
313
333
  transitionSource = transition2.a.get(node.a[i]);
314
334
  source = transitionSource || node.a[i];
315
335
  if (source.b && (swap = source.b.indexOf(node)) !== -1) {
316
- source.b[swap] = transitionSource ? node.h : source.b[source.b.length - 1];
336
+ source.b[swap] = transitionSource ? node.e : source.b[source.b.length - 1];
317
337
  !transitionSource && source.b.pop();
318
338
  }
319
339
  }
@@ -321,15 +341,15 @@ function replaceSourceObservers(node, transition2) {
321
341
  function cloneQueue(queue, parent, clonedQueues) {
322
342
  const clone = Object.create(Object.getPrototypeOf(queue));
323
343
  Object.assign(clone, queue, {
324
- h: queue,
325
- m: parent,
326
- e: [],
344
+ e: queue,
345
+ k: parent,
346
+ f: [],
327
347
  enqueue(type, fn) {
328
348
  ActiveTransition?.enqueue(type, fn);
329
349
  },
330
350
  notify(node, type, flags) {
331
- node = node.h || node;
332
- if (!clone.G || type & LOADING_BIT) {
351
+ node = node.e || node;
352
+ if (!clone.F || type & LOADING_BIT) {
333
353
  type &= ~LOADING_BIT;
334
354
  ActiveTransition?.notify(node, LOADING_BIT, flags);
335
355
  if (!type)
@@ -338,26 +358,26 @@ function cloneQueue(queue, parent, clonedQueues) {
338
358
  return queue.notify.call(this, node, type, flags);
339
359
  }
340
360
  });
341
- parent.e.push(clone);
361
+ parent.f.push(clone);
342
362
  clonedQueues.set(queue, clone);
343
- for (const child of queue.e) {
363
+ for (const child of queue.f) {
344
364
  cloneQueue(child, clone, clonedQueues);
345
365
  }
346
366
  }
347
367
  function resolveQueues(children) {
348
368
  for (const child of children) {
349
- const og = child.h;
369
+ const og = child.e;
350
370
  if (og) {
351
- const clonedChildren = child.e;
371
+ const clonedChildren = child.f;
352
372
  delete child.enqueue;
353
373
  delete child.notify;
354
- delete child.m;
355
- delete child.e;
374
+ delete child.k;
375
+ delete child.f;
356
376
  Object.assign(og, child);
357
- delete og.h;
377
+ delete og.e;
358
378
  resolveQueues(clonedChildren);
359
- } else if (child.m.h) {
360
- child.m.h.addChild(child);
379
+ } else if (child.k.e) {
380
+ child.k.e.addChild(child);
361
381
  }
362
382
  }
363
383
  }
@@ -370,31 +390,57 @@ function mergeTransitions(t1, t2) {
370
390
  c.j = t1;
371
391
  t1.W.add(c);
372
392
  });
373
- t2.R.forEach((p) => t1.R.add(p));
374
- t2.s.forEach((n) => t1.s.add(n));
393
+ t2.Q.forEach((p) => t1.Q.add(p));
394
+ t2.t.forEach((n) => t1.t.add(n));
375
395
  t1.merge(t2);
376
- t2.J = t1;
396
+ t2.I = t1;
397
+ }
398
+ function getTransitionSource(input) {
399
+ return ActiveTransition && ActiveTransition.a.get(input) || input;
400
+ }
401
+ function initialDispose(node) {
402
+ let current = node.n;
403
+ while (current !== null && current.k === node) {
404
+ initialDispose(current);
405
+ const clone = ActiveTransition.a.get(current);
406
+ if (clone && !clone.Y)
407
+ clone.dispose(true);
408
+ current = current.n;
409
+ }
377
410
  }
378
411
  function finishTransition(transition2) {
379
- if (transition2.J || transition2.X || transition2.R.size || transition2.s.size)
412
+ if (transition2.I || transition2.X || transition2.Q.size || transition2.t.size)
380
413
  return;
414
+ globalQueue.g[0].push.apply(globalQueue.g[0], transition2.g[0]);
415
+ globalQueue.g[1].push.apply(globalQueue.g[1], transition2.g[1]);
416
+ resolveQueues(transition2.f);
381
417
  for (const [source, clone] of transition2.a) {
382
- if (source === clone || source.j !== transition2)
418
+ if (source === clone || source.j !== transition2) {
419
+ delete source.j;
383
420
  continue;
421
+ }
384
422
  if (clone.a)
385
423
  replaceSourceObservers(clone, transition2);
386
- if (!(clone.g === UNINITIALIZED_BIT)) {
387
- source.dispose(false);
424
+ if (clone.Y || clone.c === STATE_DISPOSED) {
425
+ source.dispose(clone.c === STATE_DISPOSED);
388
426
  source.emptyDisposal();
389
- Object.assign(source, clone);
390
- delete source.h;
427
+ delete clone.Y;
428
+ } else {
429
+ delete clone.n;
430
+ delete clone.o;
431
+ }
432
+ Object.assign(source, clone);
433
+ delete source.e;
434
+ let current = clone.n;
435
+ if (current?.w === clone)
436
+ current.w = source;
437
+ while (current?.k === clone) {
438
+ current.k = source;
439
+ current = current.n;
391
440
  }
392
441
  delete source.j;
393
442
  }
394
- globalQueue.f[0].push.apply(globalQueue.f[0], transition2.f[0]);
395
- globalQueue.f[1].push.apply(globalQueue.f[1], transition2.f[1]);
396
- resolveQueues(transition2.e);
397
- transition2.J = true;
443
+ transition2.I = true;
398
444
  for (const reset of transition2.W) {
399
445
  delete reset.j;
400
446
  reset();
@@ -417,14 +463,14 @@ var Owner = class {
417
463
  // We flatten the owner tree into a linked list so that we don't need a pointer to .firstChild
418
464
  // However, the children are actually added in reverse creation order
419
465
  // See comment at the top of the file for an example of the _nextSibling traversal
420
- m = null;
421
- r = null;
422
- B = null;
423
- c = STATE_CLEAN;
466
+ k = null;
424
467
  n = null;
425
- w = defaultContext;
426
- l = globalQueue;
427
- ea = 0;
468
+ w = null;
469
+ c = STATE_CLEAN;
470
+ o = null;
471
+ x = defaultContext;
472
+ m = globalQueue;
473
+ fa = 0;
428
474
  id = null;
429
475
  constructor(id = null, skipAppend = false) {
430
476
  this.id = id;
@@ -433,64 +479,63 @@ var Owner = class {
433
479
  }
434
480
  }
435
481
  append(child) {
436
- child.m = this;
437
- child.B = this;
438
- if (this.r)
439
- this.r.B = child;
440
- child.r = this.r;
441
- this.r = child;
482
+ child.k = this;
483
+ child.w = this;
484
+ if (this.n)
485
+ this.n.w = child;
486
+ child.n = this.n;
487
+ this.n = child;
442
488
  if (this.id != null && child.id == null)
443
489
  child.id = this.getNextChildId();
444
- if (child.w !== this.w) {
445
- child.w = { ...this.w, ...child.w };
490
+ if (child.x !== this.x) {
491
+ child.x = { ...this.x, ...child.x };
446
492
  }
447
- if (this.l)
448
- child.l = this.l;
493
+ if (this.m)
494
+ child.m = this.m;
449
495
  }
450
496
  dispose(self = true) {
451
497
  if (this.c === STATE_DISPOSED)
452
498
  return;
453
- let head = self ? this.B || this.m : this, current = this.r, next = null;
454
- while (current && current.m === this) {
499
+ let head = self ? this.w || this.k : this, current = this.n, next = null;
500
+ while (current && current.k === this) {
455
501
  current.dispose(true);
456
- current.K();
457
- next = current.r;
458
- current.r = null;
502
+ next = current.n;
503
+ current.n = null;
459
504
  current = next;
460
505
  }
461
- this.ea = 0;
506
+ this.fa = 0;
462
507
  if (self)
463
- this.K();
508
+ this.R();
464
509
  if (current)
465
- current.B = !self ? this : this.B;
510
+ current.w = !self ? this : this.w;
466
511
  if (head)
467
- head.r = current;
468
- }
469
- K() {
470
- if (this.B)
471
- this.B.r = null;
472
- this.m = null;
473
- this.B = null;
474
- this.w = defaultContext;
512
+ head.n = current;
513
+ }
514
+ R() {
515
+ if (this.w)
516
+ this.w.n = null;
517
+ this.k = null;
518
+ this.w = null;
519
+ this.x = defaultContext;
475
520
  this.c = STATE_DISPOSED;
476
521
  this.emptyDisposal();
477
522
  }
478
523
  emptyDisposal() {
479
- if (!this.n)
524
+ if (!this.o)
480
525
  return;
481
- if (Array.isArray(this.n)) {
482
- for (let i = 0; i < this.n.length; i++) {
483
- const callable = this.n[i];
526
+ if (Array.isArray(this.o)) {
527
+ for (let i = 0; i < this.o.length; i++) {
528
+ const callable = this.o[i];
484
529
  callable.call(callable);
485
530
  }
486
531
  } else {
487
- this.n.call(this.n);
532
+ this.o.call(this.o);
488
533
  }
489
- this.n = null;
534
+ this.o = null;
490
535
  }
491
536
  getNextChildId() {
492
537
  if (this.id != null)
493
- return formatId(this.id, this.ea++);
538
+ return formatId(this.id, this.fa++);
494
539
  throw new Error("Cannot get child id from owner without an id");
495
540
  }
496
541
  };
@@ -501,7 +546,7 @@ function getContext(context, owner = currentOwner) {
501
546
  if (!owner) {
502
547
  throw new NoOwnerError();
503
548
  }
504
- const value = hasContext(context, owner) ? owner.w[context.id] : context.defaultValue;
549
+ const value = hasContext(context, owner) ? owner.x[context.id] : context.defaultValue;
505
550
  if (isUndefined(value)) {
506
551
  throw new ContextNotFoundError();
507
552
  }
@@ -511,24 +556,24 @@ function setContext(context, value, owner = currentOwner) {
511
556
  if (!owner) {
512
557
  throw new NoOwnerError();
513
558
  }
514
- owner.w = {
515
- ...owner.w,
559
+ owner.x = {
560
+ ...owner.x,
516
561
  [context.id]: isUndefined(value) ? context.defaultValue : value
517
562
  };
518
563
  }
519
564
  function hasContext(context, owner = currentOwner) {
520
- return !isUndefined(owner?.w[context.id]);
565
+ return !isUndefined(owner?.x[context.id]);
521
566
  }
522
567
  function onCleanup(fn) {
523
568
  if (!currentOwner)
524
569
  return fn;
525
570
  const node = currentOwner;
526
- if (!node.n) {
527
- node.n = fn;
528
- } else if (Array.isArray(node.n)) {
529
- node.n.push(fn);
571
+ if (!node.o) {
572
+ node.o = fn;
573
+ } else if (Array.isArray(node.o)) {
574
+ node.o.push(fn);
530
575
  } else {
531
- node.n = [node.n, fn];
576
+ node.o = [node.o, fn];
532
577
  }
533
578
  return fn;
534
579
  }
@@ -556,48 +601,48 @@ var UNCHANGED = Symbol(0);
556
601
  var Computation = class extends Owner {
557
602
  a = null;
558
603
  b = null;
559
- k;
560
- L;
561
- F;
604
+ l;
605
+ J;
606
+ K;
562
607
  // Used in __DEV__ mode, hopefully removed in production
563
- ka;
608
+ la;
564
609
  // Using false is an optimization as an alternative to _equals: () => false
565
610
  // which could enable more efficient DIRTY notification
566
- $ = isEqual;
567
- da;
568
- ga = false;
611
+ aa = isEqual;
612
+ ea;
613
+ ha = false;
569
614
  /** Whether the computation is an error or has ancestors that are unresolved */
570
- g = 0;
615
+ h = 0;
571
616
  /** Which flags raised by sources are handled, vs. being passed through. */
572
- aa = DEFAULT_FLAGS;
573
- M = -1;
574
- H = false;
617
+ ba = DEFAULT_FLAGS;
618
+ L = -1;
619
+ G = false;
575
620
  j;
576
- h;
621
+ e;
577
622
  constructor(initialValue, compute2, options) {
578
623
  super(options?.id, compute2 === null);
579
- this.F = compute2;
624
+ this.K = compute2;
580
625
  this.c = compute2 ? STATE_DIRTY : STATE_CLEAN;
581
- this.g = compute2 && initialValue === void 0 ? UNINITIALIZED_BIT : 0;
582
- this.k = initialValue;
626
+ this.h = compute2 && initialValue === void 0 ? UNINITIALIZED_BIT : 0;
627
+ this.l = initialValue;
583
628
  if (options?.equals !== void 0)
584
- this.$ = options.equals;
629
+ this.aa = options.equals;
585
630
  if (options?.pureWrite)
586
- this.ga = true;
631
+ this.ha = true;
587
632
  if (options?.unobserved)
588
- this.da = options?.unobserved;
633
+ this.ea = options?.unobserved;
589
634
  if (ActiveTransition) {
590
635
  this.j = ActiveTransition;
591
636
  ActiveTransition.a.set(this, this);
592
637
  }
593
638
  }
594
- fa() {
639
+ ga() {
595
640
  track(this);
596
- newFlags |= this.g & ~currentMask;
597
- if (this.g & ERROR_BIT) {
598
- throw this.L;
641
+ newFlags |= this.h & ~currentMask;
642
+ if (this.h & ERROR_BIT) {
643
+ throw this.J;
599
644
  } else {
600
- return this.k;
645
+ return this.l;
601
646
  }
602
647
  }
603
648
  /**
@@ -605,18 +650,18 @@ var Computation = class extends Owner {
605
650
  * Automatically re-executes the surrounding computation when the value changes
606
651
  */
607
652
  read() {
608
- if (ActiveTransition && (ActiveTransition.a.has(this) || !this.h && this.g & UNINITIALIZED_BIT)) {
653
+ if (ActiveTransition && (ActiveTransition.a.has(this) || !this.e && this.h & UNINITIALIZED_BIT | ERROR_BIT)) {
609
654
  const clone = ActiveTransition.a.get(this) || cloneGraph(this);
610
655
  if (clone !== this)
611
656
  return clone.read();
612
657
  }
613
- if (this.F) {
614
- if (this.g & ERROR_BIT && this.M <= clock)
658
+ if (this.K) {
659
+ if (this.h & ERROR_BIT && this.L <= clock)
615
660
  update(this);
616
661
  else
617
- this.I();
662
+ this.H();
618
663
  }
619
- return this.fa();
664
+ return this.ga();
620
665
  }
621
666
  /**
622
667
  * Return the current value of this computation
@@ -626,65 +671,65 @@ var Computation = class extends Owner {
626
671
  * before continuing
627
672
  */
628
673
  wait() {
629
- if (ActiveTransition && (ActiveTransition.a.has(this) || !this.h && this.g & UNINITIALIZED_BIT)) {
674
+ if (ActiveTransition && (ActiveTransition.a.has(this) || !this.e && this.h & UNINITIALIZED_BIT)) {
630
675
  const clone = ActiveTransition.a.get(this) || cloneGraph(this);
631
676
  if (clone !== this)
632
677
  return clone.wait();
633
678
  }
634
- if (this.F) {
635
- if (this.g & ERROR_BIT && this.M <= clock)
679
+ if (this.K) {
680
+ if (this.h & ERROR_BIT && this.L <= clock)
636
681
  update(this);
637
682
  else
638
- this.I();
683
+ this.H();
639
684
  }
640
- if ((notStale || this.g & UNINITIALIZED_BIT) && this.g & LOADING_BIT) {
685
+ if ((notStale || this.h & UNINITIALIZED_BIT) && this.h & LOADING_BIT) {
641
686
  track(this);
642
687
  throw new NotReadyError();
643
688
  }
644
- if (staleCheck && this.g & LOADING_BIT) {
645
- staleCheck.k = true;
689
+ if (staleCheck && this.h & LOADING_BIT) {
690
+ staleCheck.l = true;
646
691
  }
647
- return this.fa();
692
+ return this.ga();
648
693
  }
649
694
  /** Update the computation with a new value. */
650
695
  write(value, flags = 0, raw = false) {
651
- if (ActiveTransition && !this.h) {
696
+ if (ActiveTransition && !this.e) {
652
697
  const clone = cloneGraph(this);
653
698
  if (clone !== this)
654
699
  return clone.write(value, flags, raw);
655
700
  }
656
- const newValue = !raw && typeof value === "function" ? value(this.k) : value;
657
- const valueChanged = newValue !== UNCHANGED && (!!(this.g & UNINITIALIZED_BIT) || // this._stateFlags & LOADING_BIT & ~flags ||
658
- this.$ === false || !this.$(this.k, newValue));
701
+ const newValue = !raw && typeof value === "function" ? value(this.l) : value;
702
+ const valueChanged = newValue !== UNCHANGED && (!!(this.h & UNINITIALIZED_BIT) || // this._stateFlags & LOADING_BIT & ~flags ||
703
+ this.aa === false || !this.aa(this.l, newValue));
659
704
  if (valueChanged) {
660
- this.k = newValue;
661
- this.L = void 0;
705
+ this.l = newValue;
706
+ this.J = void 0;
662
707
  }
663
- const changedFlagsMask = this.g ^ flags, changedFlags = changedFlagsMask & flags;
664
- this.g = flags;
665
- this.M = clock + 1;
708
+ const changedFlagsMask = this.h ^ flags, changedFlags = changedFlagsMask & flags;
709
+ this.h = flags;
710
+ this.L = clock + 1;
666
711
  if (this.b) {
667
712
  for (let i = 0; i < this.b.length; i++) {
668
713
  if (valueChanged) {
669
- this.b[i].x(STATE_DIRTY);
714
+ this.b[i].y(STATE_DIRTY);
670
715
  } else if (changedFlagsMask) {
671
- this.b[i].Y(changedFlagsMask, changedFlags);
716
+ this.b[i].Z(changedFlagsMask, changedFlags);
672
717
  }
673
718
  }
674
719
  }
675
- return this.k;
720
+ return this.l;
676
721
  }
677
722
  /**
678
723
  * Set the current node's state, and recursively mark all of this node's observers as STATE_CHECK
679
724
  */
680
- x(state, skipQueue) {
681
- if (this.c >= state && !this.H)
725
+ y(state, skipQueue) {
726
+ if (this.c >= state && !this.G)
682
727
  return;
683
- this.H = !!skipQueue;
728
+ this.G = !!skipQueue;
684
729
  this.c = state;
685
730
  if (this.b) {
686
731
  for (let i = 0; i < this.b.length; i++) {
687
- this.b[i].x(STATE_CHECK, skipQueue);
732
+ this.b[i].y(STATE_CHECK, skipQueue);
688
733
  }
689
734
  }
690
735
  }
@@ -694,36 +739,36 @@ var Computation = class extends Owner {
694
739
  * @param mask A bitmask for which flag(s) were changed.
695
740
  * @param newFlags The source's new flags, masked to just the changed ones.
696
741
  */
697
- Y(mask, newFlags2) {
742
+ Z(mask, newFlags2) {
698
743
  if (this.c >= STATE_DIRTY)
699
744
  return;
700
- if (mask & this.aa) {
701
- this.x(STATE_DIRTY);
745
+ if (mask & this.ba) {
746
+ this.y(STATE_DIRTY);
702
747
  return;
703
748
  }
704
749
  if (this.c >= STATE_CHECK)
705
750
  return;
706
- const prevFlags = this.g & mask;
751
+ const prevFlags = this.h & mask;
707
752
  const deltaFlags = prevFlags ^ newFlags2;
708
753
  if (newFlags2 === prevFlags) ; else if (deltaFlags & prevFlags & mask) {
709
- this.x(STATE_CHECK);
754
+ this.y(STATE_CHECK);
710
755
  } else {
711
- this.g ^= deltaFlags;
756
+ this.h ^= deltaFlags;
712
757
  if (this.b) {
713
758
  for (let i = 0; i < this.b.length; i++) {
714
- this.b[i].Y(mask, newFlags2);
759
+ this.b[i].Z(mask, newFlags2);
715
760
  }
716
761
  }
717
762
  }
718
763
  }
719
- N(error) {
720
- if (ActiveTransition && !this.h) {
764
+ M(error) {
765
+ if (ActiveTransition && !this.e) {
721
766
  const clone = cloneGraph(this);
722
767
  if (clone !== this)
723
- return clone.N(error);
768
+ return clone.M(error);
724
769
  }
725
- this.L = error;
726
- this.write(UNCHANGED, this.g & ~LOADING_BIT | ERROR_BIT | UNINITIALIZED_BIT);
770
+ this.J = error;
771
+ this.write(UNCHANGED, this.h & ~LOADING_BIT | ERROR_BIT | UNINITIALIZED_BIT);
727
772
  }
728
773
  /**
729
774
  * This is the core part of the reactivity system, which makes sure that the values are updated
@@ -732,8 +777,8 @@ var Computation = class extends Owner {
732
777
  *
733
778
  * This function will ensure that the value and states we read from the computation are up to date
734
779
  */
735
- I() {
736
- if (!this.F) {
780
+ H() {
781
+ if (!this.K) {
737
782
  return;
738
783
  }
739
784
  if (this.c === STATE_DISPOSED) {
@@ -745,9 +790,9 @@ var Computation = class extends Owner {
745
790
  let observerFlags = 0;
746
791
  if (this.c === STATE_CHECK) {
747
792
  for (let i = 0; i < this.a.length; i++) {
748
- const source = ActiveTransition && ActiveTransition.a.get(this.a[i]) || this.a[i];
749
- source.I();
750
- observerFlags |= source.g & ~UNINITIALIZED_BIT;
793
+ const source = getTransitionSource(this.a[i]);
794
+ source.H();
795
+ observerFlags |= source.h & ~UNINITIALIZED_BIT;
751
796
  if (this.c === STATE_DIRTY) {
752
797
  break;
753
798
  }
@@ -763,17 +808,17 @@ var Computation = class extends Owner {
763
808
  /**
764
809
  * Remove ourselves from the owner graph and the computation graph
765
810
  */
766
- K() {
811
+ R() {
767
812
  if (this.c === STATE_DISPOSED)
768
813
  return;
769
814
  if (this.a)
770
815
  removeSourceObservers(this, 0);
771
- super.K();
816
+ super.R();
772
817
  }
773
818
  };
774
819
  function track(computation) {
775
- if (ActiveTransition && computation.h)
776
- computation = computation.h;
820
+ if (ActiveTransition && computation.e)
821
+ computation = computation.e;
777
822
  if (currentObserver) {
778
823
  if (!newSources && currentObserver.a && currentObserver.a[newSourcesIndex] === computation) {
779
824
  newSourcesIndex++;
@@ -783,7 +828,7 @@ function track(computation) {
783
828
  newSources.push(computation);
784
829
  }
785
830
  if (updateCheck) {
786
- updateCheck.k = computation.M > currentObserver.M;
831
+ updateCheck.l = computation.L > currentObserver.L;
787
832
  }
788
833
  }
789
834
  }
@@ -793,15 +838,19 @@ function update(node) {
793
838
  newSourcesIndex = 0;
794
839
  newFlags = 0;
795
840
  try {
841
+ if (ActiveTransition && node.e && !node.Y) {
842
+ initialDispose(node.e);
843
+ node.Y = true;
844
+ }
796
845
  node.dispose(false);
797
846
  node.emptyDisposal();
798
- const result = compute(node, node.F, node);
847
+ const result = compute(node, node.K, node);
799
848
  node.write(result, newFlags, true);
800
849
  } catch (error) {
801
850
  if (error instanceof NotReadyError) {
802
- node.write(UNCHANGED, newFlags | LOADING_BIT | node.g & UNINITIALIZED_BIT);
851
+ node.write(UNCHANGED, newFlags | LOADING_BIT | node.h & UNINITIALIZED_BIT);
803
852
  } else {
804
- node.N(error);
853
+ node.M(error);
805
854
  }
806
855
  } finally {
807
856
  if (newSources) {
@@ -817,7 +866,7 @@ function update(node) {
817
866
  }
818
867
  let source;
819
868
  for (let i = newSourcesIndex; i < node.a.length; i++) {
820
- source = ActiveTransition && ActiveTransition.a.get(node.a[i]) || node.a[i];
869
+ source = getTransitionSource(node.a[i]);
821
870
  if (!source.b)
822
871
  source.b = [node];
823
872
  else
@@ -830,25 +879,10 @@ function update(node) {
830
879
  newSources = prevSources;
831
880
  newSourcesIndex = prevSourcesIndex;
832
881
  newFlags = prevFlags;
833
- node.M = clock + 1;
882
+ node.L = clock + 1;
834
883
  node.c = STATE_CLEAN;
835
884
  }
836
885
  }
837
- function removeSourceObservers(node, index) {
838
- let source;
839
- let swap;
840
- for (let i = index; i < node.a.length; i++) {
841
- source = ActiveTransition && ActiveTransition.a.get(node.a[i]) || node.a[i];
842
- if (source.b) {
843
- if ((swap = source.b.indexOf(node)) !== -1) {
844
- source.b[swap] = source.b[source.b.length - 1];
845
- source.b.pop();
846
- }
847
- if (!source.b.length)
848
- Unobserved.push(source);
849
- }
850
- }
851
- }
852
886
  function isEqual(a, b) {
853
887
  return a === b;
854
888
  }
@@ -859,20 +893,20 @@ function untrack(fn) {
859
893
  }
860
894
  function hasUpdated(fn) {
861
895
  const current = updateCheck;
862
- updateCheck = { k: false };
896
+ updateCheck = { l: false };
863
897
  try {
864
898
  fn();
865
- return updateCheck.k;
899
+ return updateCheck.l;
866
900
  } finally {
867
901
  updateCheck = current;
868
902
  }
869
903
  }
870
904
  function pendingCheck(fn, loadingValue) {
871
905
  const current = staleCheck;
872
- staleCheck = { k: false };
906
+ staleCheck = { l: false };
873
907
  try {
874
908
  latest(fn);
875
- return staleCheck.k;
909
+ return staleCheck.l;
876
910
  } catch (err) {
877
911
  if (!(err instanceof NotReadyError))
878
912
  return false;
@@ -887,7 +921,7 @@ function isPending(fn, loadingValue) {
887
921
  if (!currentObserver)
888
922
  return pendingCheck(fn, loadingValue);
889
923
  const c = new Computation(void 0, () => pendingCheck(fn, loadingValue));
890
- c.aa |= LOADING_BIT;
924
+ c.ba |= LOADING_BIT;
891
925
  return c.read();
892
926
  }
893
927
  function latest(fn, fallback) {
@@ -917,10 +951,10 @@ function runWithObserver(observer, run) {
917
951
  if (error instanceof NotReadyError) {
918
952
  observer.write(
919
953
  UNCHANGED,
920
- newFlags | LOADING_BIT | observer.g & UNINITIALIZED_BIT
954
+ newFlags | LOADING_BIT | observer.h & UNINITIALIZED_BIT
921
955
  );
922
956
  } else {
923
- observer.N(error);
957
+ observer.M(error);
924
958
  }
925
959
  } finally {
926
960
  if (newSources) {
@@ -949,10 +983,10 @@ function runWithObserver(observer, run) {
949
983
  function compute(owner, fn, observer) {
950
984
  const prevOwner = setOwner(owner), prevObserver = currentObserver, prevMask = currentMask, prevNotStale = notStale;
951
985
  currentObserver = observer;
952
- currentMask = observer?.aa ?? DEFAULT_FLAGS;
986
+ currentMask = observer?.ba ?? DEFAULT_FLAGS;
953
987
  notStale = true;
954
988
  try {
955
- return fn.call(observer, observer ? observer.k : void 0);
989
+ return fn.call(observer, observer ? observer.l : void 0);
956
990
  } finally {
957
991
  setOwner(prevOwner);
958
992
  currentObserver = prevObserver;
@@ -963,99 +997,99 @@ function compute(owner, fn, observer) {
963
997
 
964
998
  // src/core/effect.ts
965
999
  var Effect = class extends Computation {
966
- ba;
967
- Z;
968
- O;
969
- ca = false;
1000
+ ca;
970
1001
  _;
971
- A;
1002
+ N;
1003
+ da = false;
1004
+ $;
1005
+ B;
972
1006
  constructor(initialValue, compute2, effect, error, options) {
973
1007
  super(initialValue, compute2, options);
974
- this.ba = effect;
975
- this.Z = error;
976
- this._ = initialValue;
977
- this.A = options?.render ? EFFECT_RENDER : EFFECT_USER;
978
- if (this.A === EFFECT_RENDER) {
979
- this.F = function(p) {
980
- return !this.h && clock > this.l.created && !(this.g & ERROR_BIT) ? latest(() => compute2(p)) : compute2(p);
1008
+ this.ca = effect;
1009
+ this._ = error;
1010
+ this.$ = initialValue;
1011
+ this.B = options?.render ? EFFECT_RENDER : EFFECT_USER;
1012
+ if (this.B === EFFECT_RENDER) {
1013
+ this.K = function(p) {
1014
+ return !this.e && clock > this.m.created && !(this.h & ERROR_BIT) ? latest(() => compute2(p)) : compute2(p);
981
1015
  };
982
1016
  }
983
- this.I();
984
- !options?.defer && (this.A === EFFECT_USER ? this.l.enqueue(this.A, this.C.bind(this)) : this.C(this.A));
1017
+ this.H();
1018
+ !options?.defer && (this.B === EFFECT_USER ? this.m.enqueue(this.B, this.C.bind(this)) : this.C(this.B));
985
1019
  }
986
1020
  write(value, flags = 0) {
987
1021
  if (this.c == STATE_DIRTY) {
988
- this.g = flags;
989
- if (this.A === EFFECT_RENDER) {
990
- this.l.notify(this, LOADING_BIT | ERROR_BIT, this.g);
1022
+ this.h = flags;
1023
+ if (this.B === EFFECT_RENDER) {
1024
+ this.m.notify(this, LOADING_BIT | ERROR_BIT, this.h);
991
1025
  }
992
1026
  }
993
1027
  if (value === UNCHANGED)
994
- return this.k;
995
- this.k = value;
996
- this.ca = true;
997
- this.L = void 0;
1028
+ return this.l;
1029
+ this.l = value;
1030
+ this.da = true;
1031
+ this.J = void 0;
998
1032
  return value;
999
1033
  }
1000
- x(state, skipQueue) {
1034
+ y(state, skipQueue) {
1001
1035
  if (this.c >= state || skipQueue)
1002
1036
  return;
1003
1037
  if (this.c === STATE_CLEAN)
1004
- this.l.enqueue(this.A, this.C.bind(this));
1038
+ this.m.enqueue(this.B, this.C.bind(this));
1005
1039
  this.c = state;
1006
1040
  }
1007
- Y(mask, newFlags2) {
1008
- if (this.h) {
1041
+ Z(mask, newFlags2) {
1042
+ if (this.e) {
1009
1043
  if (this.c >= STATE_DIRTY)
1010
1044
  return;
1011
1045
  if (mask & 3) {
1012
- this.x(STATE_DIRTY);
1046
+ this.y(STATE_DIRTY);
1013
1047
  return;
1014
1048
  }
1015
1049
  }
1016
- super.Y(mask, newFlags2);
1050
+ super.Z(mask, newFlags2);
1017
1051
  }
1018
- N(error) {
1019
- this.L = error;
1020
- this.l.notify(this, LOADING_BIT, 0);
1021
- this.g = ERROR_BIT;
1022
- if (this.A === EFFECT_USER) {
1052
+ M(error) {
1053
+ this.J = error;
1054
+ this.m.notify(this, LOADING_BIT, 0);
1055
+ this.h = ERROR_BIT;
1056
+ if (this.B === EFFECT_USER) {
1023
1057
  try {
1024
- return this.Z ? this.Z(error, () => {
1025
- this.O?.();
1026
- this.O = void 0;
1058
+ return this._ ? this._(error, () => {
1059
+ this.N?.();
1060
+ this.N = void 0;
1027
1061
  }) : console.error(error);
1028
1062
  } catch (e) {
1029
1063
  error = e;
1030
1064
  }
1031
1065
  }
1032
- if (!this.l.notify(this, ERROR_BIT, ERROR_BIT))
1066
+ if (!this.m.notify(this, ERROR_BIT, ERROR_BIT))
1033
1067
  throw error;
1034
1068
  }
1035
- K() {
1069
+ R() {
1036
1070
  if (this.c === STATE_DISPOSED)
1037
1071
  return;
1038
- this.ba = void 0;
1072
+ this.ca = void 0;
1073
+ this.$ = void 0;
1039
1074
  this._ = void 0;
1040
- this.Z = void 0;
1041
- this.O?.();
1042
- this.O = void 0;
1043
- this.l.notify(this, ERROR_BIT | LOADING_BIT, 0);
1044
- super.K();
1075
+ this.N?.();
1076
+ this.N = void 0;
1077
+ this.m.notify(this, ERROR_BIT | LOADING_BIT, 0);
1078
+ super.R();
1045
1079
  }
1046
1080
  C(type) {
1047
1081
  if (type) {
1048
- const effect = this.h || this;
1049
- if (effect.ca && effect.c !== STATE_DISPOSED) {
1050
- effect.O?.();
1082
+ const effect = this.e || this;
1083
+ if (effect.da && effect.c !== STATE_DISPOSED) {
1084
+ effect.N?.();
1051
1085
  try {
1052
- effect.O = effect.ba(effect.k, effect._);
1086
+ effect.N = effect.ca(effect.l, effect.$);
1053
1087
  } catch (e) {
1054
- if (!effect.l.notify(effect, ERROR_BIT, ERROR_BIT))
1088
+ if (!effect.m.notify(effect, ERROR_BIT, ERROR_BIT))
1055
1089
  throw e;
1056
1090
  } finally {
1057
- effect._ = effect.k;
1058
- effect.ca = false;
1091
+ effect.$ = effect.l;
1092
+ effect.da = false;
1059
1093
  }
1060
1094
  }
1061
1095
  } else
@@ -1065,14 +1099,14 @@ var Effect = class extends Computation {
1065
1099
  var EagerComputation = class extends Computation {
1066
1100
  constructor(initialValue, compute2, options) {
1067
1101
  super(initialValue, compute2, options);
1068
- !options?.defer && this.I();
1102
+ !options?.defer && this.H();
1069
1103
  }
1070
- x(state, skipQueue) {
1071
- if (this.c >= state && !this.H)
1104
+ y(state, skipQueue) {
1105
+ if (this.c >= state && !this.G)
1072
1106
  return;
1073
- if (!skipQueue && (this.c === STATE_CLEAN || this.c === STATE_CHECK && this.H))
1074
- this.l.enqueue(EFFECT_PURE, this.C.bind(this));
1075
- super.x(state, skipQueue);
1107
+ if (!skipQueue && (this.c === STATE_CLEAN || this.c === STATE_CHECK && this.G))
1108
+ this.m.enqueue(EFFECT_PURE, this.C.bind(this));
1109
+ super.y(state, skipQueue);
1076
1110
  }
1077
1111
  C() {
1078
1112
  this.c !== STATE_CLEAN && runTop(this);
@@ -1083,13 +1117,13 @@ var FirewallComputation = class extends Computation {
1083
1117
  constructor(compute2) {
1084
1118
  super(void 0, compute2);
1085
1119
  }
1086
- x(state, skipQueue) {
1087
- if (this.c >= state && !this.H)
1120
+ y(state, skipQueue) {
1121
+ if (this.c >= state && !this.G)
1088
1122
  return;
1089
- if (!skipQueue && (this.c === STATE_CLEAN || this.c === STATE_CHECK && this.H))
1090
- this.l.enqueue(EFFECT_PURE, this.C.bind(this));
1091
- super.x(state, true);
1092
- this.H = !!skipQueue;
1123
+ if (!skipQueue && (this.c === STATE_CLEAN || this.c === STATE_CHECK && this.G))
1124
+ this.m.enqueue(EFFECT_PURE, this.C.bind(this));
1125
+ super.y(state, true);
1126
+ this.G = !!skipQueue;
1093
1127
  }
1094
1128
  C() {
1095
1129
  this.c !== STATE_CLEAN && runTop(this);
@@ -1097,14 +1131,16 @@ var FirewallComputation = class extends Computation {
1097
1131
  };
1098
1132
  function runTop(node) {
1099
1133
  const ancestors = [];
1100
- for (let current = node; current !== null; current = current.m) {
1134
+ for (let current = node; current !== null; current = current.k) {
1135
+ if (ActiveTransition && current.j)
1136
+ current = ActiveTransition.a.get(current);
1101
1137
  if (current.c !== STATE_CLEAN) {
1102
1138
  ancestors.push(current);
1103
1139
  }
1104
1140
  }
1105
1141
  for (let i = ancestors.length - 1; i >= 0; i--) {
1106
1142
  if (ancestors[i].c !== STATE_DISPOSED)
1107
- ancestors[i].I();
1143
+ ancestors[i].H();
1108
1144
  }
1109
1145
  }
1110
1146
 
@@ -1238,7 +1274,7 @@ var storeTraps = {
1238
1274
  return desc.get.call(receiver);
1239
1275
  }
1240
1276
  if (Writing?.has(receiver)) {
1241
- let value2 = tracked && (overridden || !proxySource) ? tracked.k : storeValue[property];
1277
+ let value2 = tracked && (overridden || !proxySource) ? tracked.l : storeValue[property];
1242
1278
  value2 === $DELETED && (value2 = void 0);
1243
1279
  if (!isWrappable(value2))
1244
1280
  return value2;
@@ -1775,7 +1811,7 @@ function createMemo(compute2, value, options) {
1775
1811
  return resolvedValue;
1776
1812
  }
1777
1813
  resolvedValue = node.wait();
1778
- if (!node.a?.length && node.r?.m !== node && !(node.g & UNINITIALIZED_BIT)) {
1814
+ if (!node.a?.length && node.n?.k !== node && !(node.h & UNINITIALIZED_BIT)) {
1779
1815
  node.dispose();
1780
1816
  node = void 0;
1781
1817
  }
@@ -1811,8 +1847,8 @@ function createAsync(compute2, value, options) {
1811
1847
  if (abort)
1812
1848
  return;
1813
1849
  if (transition2)
1814
- return transition2.runTransition(() => node.N(error), true);
1815
- node.N(error);
1850
+ return transition2.runTransition(() => node.M(error), true);
1851
+ node.M(error);
1816
1852
  }
1817
1853
  );
1818
1854
  } else {
@@ -1837,12 +1873,12 @@ function createAsync(compute2, value, options) {
1837
1873
  const read = node.wait.bind(node);
1838
1874
  read.refresh = () => {
1839
1875
  let n = node;
1840
- if (ActiveTransition && !node.h) {
1876
+ if (ActiveTransition && !node.e) {
1841
1877
  n = cloneGraph(node);
1842
1878
  }
1843
1879
  n.c = STATE_DIRTY;
1844
1880
  refreshing = true;
1845
- n.I();
1881
+ n.H();
1846
1882
  };
1847
1883
  return read;
1848
1884
  }
@@ -1955,47 +1991,47 @@ function mapArray(list, map, options) {
1955
1991
  const keyFn = typeof options?.keyed === "function" ? options.keyed : void 0;
1956
1992
  return updateKeyedMap.bind({
1957
1993
  S: new Owner(),
1958
- o: 0,
1959
- ha: list,
1994
+ q: 0,
1995
+ ia: list,
1960
1996
  D: [],
1961
- P: map,
1997
+ O: map,
1962
1998
  i: [],
1963
1999
  d: [],
1964
- Q: keyFn,
1965
- p: keyFn || options?.keyed === false ? [] : void 0,
1966
- q: map.length > 1 ? [] : void 0,
2000
+ P: keyFn,
2001
+ r: keyFn || options?.keyed === false ? [] : void 0,
2002
+ s: map.length > 1 ? [] : void 0,
1967
2003
  T: options?.fallback
1968
2004
  });
1969
2005
  }
1970
2006
  var pureOptions = { pureWrite: true };
1971
2007
  function updateKeyedMap() {
1972
- const newItems = this.ha() || [], newLen = newItems.length;
2008
+ const newItems = this.ia() || [], newLen = newItems.length;
1973
2009
  newItems[$TRACK];
1974
2010
  runWithOwner(this.S, () => {
1975
- let i, j, mapper = this.p ? () => {
1976
- this.p[j] = new Computation(newItems[j], null, pureOptions);
1977
- this.q && (this.q[j] = new Computation(j, null, pureOptions));
1978
- return this.P(
1979
- Computation.prototype.read.bind(this.p[j]),
1980
- this.q ? Computation.prototype.read.bind(this.q[j]) : void 0
2011
+ let i, j, mapper = this.r ? () => {
2012
+ this.r[j] = new Computation(newItems[j], null, pureOptions);
2013
+ this.s && (this.s[j] = new Computation(j, null, pureOptions));
2014
+ return this.O(
2015
+ Computation.prototype.read.bind(this.r[j]),
2016
+ this.s ? Computation.prototype.read.bind(this.s[j]) : void 0
1981
2017
  );
1982
- } : this.q ? () => {
2018
+ } : this.s ? () => {
1983
2019
  const item = newItems[j];
1984
- this.q[j] = new Computation(j, null, pureOptions);
1985
- return this.P(() => item, Computation.prototype.read.bind(this.q[j]));
2020
+ this.s[j] = new Computation(j, null, pureOptions);
2021
+ return this.O(() => item, Computation.prototype.read.bind(this.s[j]));
1986
2022
  } : () => {
1987
2023
  const item = newItems[j];
1988
- return this.P(() => item);
2024
+ return this.O(() => item);
1989
2025
  };
1990
2026
  if (newLen === 0) {
1991
- if (this.o !== 0) {
2027
+ if (this.q !== 0) {
1992
2028
  this.S.dispose(false);
1993
2029
  this.d = [];
1994
2030
  this.D = [];
1995
2031
  this.i = [];
1996
- this.o = 0;
1997
- this.p && (this.p = []);
1998
- this.q && (this.q = []);
2032
+ this.q = 0;
2033
+ this.r && (this.r = []);
2034
+ this.s && (this.s = []);
1999
2035
  }
2000
2036
  if (this.T && !this.i[0]) {
2001
2037
  this.i[0] = compute(
@@ -2004,7 +2040,7 @@ function updateKeyedMap() {
2004
2040
  null
2005
2041
  );
2006
2042
  }
2007
- } else if (this.o === 0) {
2043
+ } else if (this.q === 0) {
2008
2044
  if (this.d[0])
2009
2045
  this.d[0].dispose();
2010
2046
  this.i = new Array(newLen);
@@ -2012,37 +2048,37 @@ function updateKeyedMap() {
2012
2048
  this.D[j] = newItems[j];
2013
2049
  this.i[j] = compute(this.d[j] = new Owner(), mapper, null);
2014
2050
  }
2015
- this.o = newLen;
2051
+ this.q = newLen;
2016
2052
  } else {
2017
- let start, end, newEnd, item, key, newIndices, newIndicesNext, temp = new Array(newLen), tempNodes = new Array(newLen), tempRows = this.p ? new Array(newLen) : void 0, tempIndexes = this.q ? new Array(newLen) : void 0;
2018
- for (start = 0, end = Math.min(this.o, newLen); start < end && (this.D[start] === newItems[start] || this.p && compare(this.Q, this.D[start], newItems[start])); start++) {
2019
- if (this.p)
2020
- this.p[start].write(newItems[start]);
2053
+ let start, end, newEnd, item, key, newIndices, newIndicesNext, temp = new Array(newLen), tempNodes = new Array(newLen), tempRows = this.r ? new Array(newLen) : void 0, tempIndexes = this.s ? new Array(newLen) : void 0;
2054
+ for (start = 0, end = Math.min(this.q, newLen); start < end && (this.D[start] === newItems[start] || this.r && compare(this.P, this.D[start], newItems[start])); start++) {
2055
+ if (this.r)
2056
+ this.r[start].write(newItems[start]);
2021
2057
  }
2022
- for (end = this.o - 1, newEnd = newLen - 1; end >= start && newEnd >= start && (this.D[end] === newItems[newEnd] || this.p && compare(this.Q, this.D[end], newItems[newEnd])); end--, newEnd--) {
2058
+ for (end = this.q - 1, newEnd = newLen - 1; end >= start && newEnd >= start && (this.D[end] === newItems[newEnd] || this.r && compare(this.P, this.D[end], newItems[newEnd])); end--, newEnd--) {
2023
2059
  temp[newEnd] = this.i[end];
2024
2060
  tempNodes[newEnd] = this.d[end];
2025
- tempRows && (tempRows[newEnd] = this.p[end]);
2026
- tempIndexes && (tempIndexes[newEnd] = this.q[end]);
2061
+ tempRows && (tempRows[newEnd] = this.r[end]);
2062
+ tempIndexes && (tempIndexes[newEnd] = this.s[end]);
2027
2063
  }
2028
2064
  newIndices = /* @__PURE__ */ new Map();
2029
2065
  newIndicesNext = new Array(newEnd + 1);
2030
2066
  for (j = newEnd; j >= start; j--) {
2031
2067
  item = newItems[j];
2032
- key = this.Q ? this.Q(item) : item;
2068
+ key = this.P ? this.P(item) : item;
2033
2069
  i = newIndices.get(key);
2034
2070
  newIndicesNext[j] = i === void 0 ? -1 : i;
2035
2071
  newIndices.set(key, j);
2036
2072
  }
2037
2073
  for (i = start; i <= end; i++) {
2038
2074
  item = this.D[i];
2039
- key = this.Q ? this.Q(item) : item;
2075
+ key = this.P ? this.P(item) : item;
2040
2076
  j = newIndices.get(key);
2041
2077
  if (j !== void 0 && j !== -1) {
2042
2078
  temp[j] = this.i[i];
2043
2079
  tempNodes[j] = this.d[i];
2044
- tempRows && (tempRows[j] = this.p[i]);
2045
- tempIndexes && (tempIndexes[j] = this.q[i]);
2080
+ tempRows && (tempRows[j] = this.r[i]);
2081
+ tempIndexes && (tempIndexes[j] = this.s[i]);
2046
2082
  j = newIndicesNext[j];
2047
2083
  newIndices.set(key, j);
2048
2084
  } else
@@ -2053,18 +2089,18 @@ function updateKeyedMap() {
2053
2089
  this.i[j] = temp[j];
2054
2090
  this.d[j] = tempNodes[j];
2055
2091
  if (tempRows) {
2056
- this.p[j] = tempRows[j];
2057
- this.p[j].write(newItems[j]);
2092
+ this.r[j] = tempRows[j];
2093
+ this.r[j].write(newItems[j]);
2058
2094
  }
2059
2095
  if (tempIndexes) {
2060
- this.q[j] = tempIndexes[j];
2061
- this.q[j].write(j);
2096
+ this.s[j] = tempIndexes[j];
2097
+ this.s[j].write(j);
2062
2098
  }
2063
2099
  } else {
2064
2100
  this.i[j] = compute(this.d[j] = new Owner(), mapper, null);
2065
2101
  }
2066
2102
  }
2067
- this.i = this.i.slice(0, this.o = newLen);
2103
+ this.i = this.i.slice(0, this.q = newLen);
2068
2104
  this.D = newItems.slice(0);
2069
2105
  }
2070
2106
  });
@@ -2073,26 +2109,26 @@ function updateKeyedMap() {
2073
2109
  function repeat(count, map, options) {
2074
2110
  return updateRepeat.bind({
2075
2111
  S: new Owner(),
2076
- o: 0,
2077
- y: 0,
2078
- ia: count,
2079
- P: map,
2112
+ q: 0,
2113
+ z: 0,
2114
+ ja: count,
2115
+ O: map,
2080
2116
  d: [],
2081
2117
  i: [],
2082
- ja: options?.from,
2118
+ ka: options?.from,
2083
2119
  T: options?.fallback
2084
2120
  });
2085
2121
  }
2086
2122
  function updateRepeat() {
2087
- const newLen = this.ia();
2088
- const from = this.ja?.() || 0;
2123
+ const newLen = this.ja();
2124
+ const from = this.ka?.() || 0;
2089
2125
  runWithOwner(this.S, () => {
2090
2126
  if (newLen === 0) {
2091
- if (this.o !== 0) {
2127
+ if (this.q !== 0) {
2092
2128
  this.S.dispose(false);
2093
2129
  this.d = [];
2094
2130
  this.i = [];
2095
- this.o = 0;
2131
+ this.q = 0;
2096
2132
  }
2097
2133
  if (this.T && !this.i[0]) {
2098
2134
  this.i[0] = compute(
@@ -2104,20 +2140,20 @@ function updateRepeat() {
2104
2140
  return;
2105
2141
  }
2106
2142
  const to = from + newLen;
2107
- const prevTo = this.y + this.o;
2108
- if (this.o === 0 && this.d[0])
2143
+ const prevTo = this.z + this.q;
2144
+ if (this.q === 0 && this.d[0])
2109
2145
  this.d[0].dispose();
2110
2146
  for (let i = to; i < prevTo; i++)
2111
- this.d[i - this.y].dispose();
2112
- if (this.y < from) {
2113
- let i = this.y;
2114
- while (i < from && i < this.o)
2147
+ this.d[i - this.z].dispose();
2148
+ if (this.z < from) {
2149
+ let i = this.z;
2150
+ while (i < from && i < this.q)
2115
2151
  this.d[i++].dispose();
2116
- this.d.splice(0, from - this.y);
2117
- this.i.splice(0, from - this.y);
2118
- } else if (this.y > from) {
2119
- let i = prevTo - this.y - 1;
2120
- let difference = this.y - from;
2152
+ this.d.splice(0, from - this.z);
2153
+ this.i.splice(0, from - this.z);
2154
+ } else if (this.z > from) {
2155
+ let i = prevTo - this.z - 1;
2156
+ let difference = this.z - from;
2121
2157
  this.d.length = this.i.length = newLen;
2122
2158
  while (i >= difference) {
2123
2159
  this.d[i] = this.d[i - difference];
@@ -2127,7 +2163,7 @@ function updateRepeat() {
2127
2163
  for (let i2 = 0; i2 < difference; i2++) {
2128
2164
  this.i[i2] = compute(
2129
2165
  this.d[i2] = new Owner(),
2130
- () => this.P(i2 + from),
2166
+ () => this.O(i2 + from),
2131
2167
  null
2132
2168
  );
2133
2169
  }
@@ -2135,13 +2171,13 @@ function updateRepeat() {
2135
2171
  for (let i = prevTo; i < to; i++) {
2136
2172
  this.i[i - from] = compute(
2137
2173
  this.d[i - from] = new Owner(),
2138
- () => this.P(i),
2174
+ () => this.O(i),
2139
2175
  null
2140
2176
  );
2141
2177
  }
2142
2178
  this.i = this.i.slice(0, newLen);
2143
- this.y = from;
2144
- this.o = newLen;
2179
+ this.z = from;
2180
+ this.q = newLen;
2145
2181
  });
2146
2182
  return this.i;
2147
2183
  }
@@ -2158,17 +2194,17 @@ var BoundaryComputation = class extends EagerComputation {
2158
2194
  }
2159
2195
  write(value, flags) {
2160
2196
  super.write(value, flags & ~this.U);
2161
- if (this.U & LOADING_BIT && !(this.g & UNINITIALIZED_BIT)) {
2197
+ if (this.U & LOADING_BIT && !(this.h & UNINITIALIZED_BIT)) {
2162
2198
  flags &= ~LOADING_BIT;
2163
2199
  }
2164
- this.l.notify(this, this.U, flags);
2165
- return this.k;
2200
+ this.m.notify(this, this.U, flags);
2201
+ return this.l;
2166
2202
  }
2167
2203
  };
2168
2204
  function createBoundChildren(owner, fn, queue, mask) {
2169
- const parentQueue = owner.l;
2170
- parentQueue.addChild(owner.l = queue);
2171
- onCleanup(() => parentQueue.removeChild(owner.l));
2205
+ const parentQueue = owner.m;
2206
+ parentQueue.addChild(owner.m = queue);
2207
+ onCleanup(() => parentQueue.removeChild(owner.m));
2172
2208
  return compute(
2173
2209
  owner,
2174
2210
  () => {
@@ -2179,27 +2215,27 @@ function createBoundChildren(owner, fn, queue, mask) {
2179
2215
  );
2180
2216
  }
2181
2217
  var ConditionalQueue = class extends Queue {
2182
- t;
2218
+ u;
2183
2219
  V = /* @__PURE__ */ new Set();
2184
- s = /* @__PURE__ */ new Set();
2220
+ t = /* @__PURE__ */ new Set();
2185
2221
  constructor(disabled) {
2186
2222
  super();
2187
- this.t = disabled;
2223
+ this.u = disabled;
2188
2224
  }
2189
2225
  run(type) {
2190
- if (!type || this.t.read())
2226
+ if (!type || this.u.read())
2191
2227
  return;
2192
2228
  return super.run(type);
2193
2229
  }
2194
2230
  notify(node, type, flags) {
2195
- if (ActiveTransition && ActiveTransition.u.has(this))
2196
- return ActiveTransition.u.get(this).notify(node, type, flags);
2197
- if (this.t.read()) {
2231
+ if (ActiveTransition && ActiveTransition.p.has(this))
2232
+ return ActiveTransition.p.get(this).notify(node, type, flags);
2233
+ if (this.u.read()) {
2198
2234
  if (type & LOADING_BIT) {
2199
2235
  if (flags & LOADING_BIT) {
2200
- this.s.add(node);
2236
+ this.t.add(node);
2201
2237
  type &= ~LOADING_BIT;
2202
- } else if (this.s.delete(node))
2238
+ } else if (this.t.delete(node))
2203
2239
  type &= ~LOADING_BIT;
2204
2240
  }
2205
2241
  if (type & ERROR_BIT) {
@@ -2213,43 +2249,43 @@ var ConditionalQueue = class extends Queue {
2213
2249
  return type ? super.notify(node, type, flags) : true;
2214
2250
  }
2215
2251
  merge(queue) {
2216
- queue.s.forEach((n) => this.notify(n, LOADING_BIT, LOADING_BIT));
2252
+ queue.t.forEach((n) => this.notify(n, LOADING_BIT, LOADING_BIT));
2217
2253
  queue.V.forEach((n) => this.notify(n, ERROR_BIT, ERROR_BIT));
2218
2254
  super.merge(queue);
2219
2255
  }
2220
2256
  };
2221
2257
  var CollectionQueue = class extends Queue {
2222
- G;
2258
+ F;
2223
2259
  d = /* @__PURE__ */ new Set();
2224
- t = new Computation(false, null, { pureWrite: true });
2260
+ u = new Computation(false, null, { pureWrite: true });
2225
2261
  constructor(type) {
2226
2262
  super();
2227
- this.G = type;
2263
+ this.F = type;
2228
2264
  }
2229
2265
  run(type) {
2230
- if (!type || this.t.read())
2266
+ if (!type || this.u.read())
2231
2267
  return;
2232
2268
  return super.run(type);
2233
2269
  }
2234
2270
  notify(node, type, flags) {
2235
- if (ActiveTransition && ActiveTransition.u.has(this))
2236
- return ActiveTransition.u.get(this).notify(node, type, flags);
2237
- if (!(type & this.G))
2271
+ if (ActiveTransition && ActiveTransition.p.has(this))
2272
+ return ActiveTransition.p.get(this).notify(node, type, flags);
2273
+ if (!(type & this.F))
2238
2274
  return super.notify(node, type, flags);
2239
- if (flags & this.G) {
2275
+ if (flags & this.F) {
2240
2276
  this.d.add(node);
2241
2277
  if (this.d.size === 1)
2242
- this.t.write(true);
2243
- } else {
2278
+ this.u.write(true);
2279
+ } else if (this.d.size > 0) {
2244
2280
  this.d.delete(node);
2245
2281
  if (this.d.size === 0)
2246
- this.t.write(false);
2282
+ this.u.write(false);
2247
2283
  }
2248
- type &= ~this.G;
2284
+ type &= ~this.F;
2249
2285
  return type ? super.notify(node, type, flags) : true;
2250
2286
  }
2251
2287
  merge(queue) {
2252
- queue.d.forEach((n) => this.notify(n, this.G, this.G));
2288
+ queue.d.forEach((n) => this.notify(n, this.F, this.F));
2253
2289
  super.merge(queue);
2254
2290
  }
2255
2291
  };
@@ -2260,25 +2296,25 @@ function createBoundary(fn, condition) {
2260
2296
  );
2261
2297
  const tree = createBoundChildren(owner, fn, queue, 0);
2262
2298
  new EagerComputation(void 0, () => {
2263
- const disabled = queue.t.read();
2299
+ const disabled = queue.u.read();
2264
2300
  tree.U = disabled ? ERROR_BIT | LOADING_BIT : 0;
2265
2301
  if (!disabled) {
2266
- queue.s.forEach((node) => queue.notify(node, LOADING_BIT, LOADING_BIT));
2302
+ queue.t.forEach((node) => queue.notify(node, LOADING_BIT, LOADING_BIT));
2267
2303
  queue.V.forEach((node) => queue.notify(node, ERROR_BIT, ERROR_BIT));
2268
- queue.s.clear();
2304
+ queue.t.clear();
2269
2305
  queue.V.clear();
2270
2306
  }
2271
2307
  });
2272
- return () => queue.t.read() ? void 0 : tree.read();
2308
+ return () => queue.u.read() ? void 0 : tree.read();
2273
2309
  }
2274
2310
  function createCollectionBoundary(type, fn, fallback) {
2275
2311
  const owner = new Owner();
2276
2312
  const queue = new CollectionQueue(type);
2277
2313
  const tree = createBoundChildren(owner, fn, queue, type);
2278
2314
  const decision = new Computation(void 0, () => {
2279
- if (!queue.t.read()) {
2315
+ if (!queue.u.read()) {
2280
2316
  const resolved = tree.read();
2281
- if (!queue.t.read())
2317
+ if (!queue.u.read())
2282
2318
  return resolved;
2283
2319
  }
2284
2320
  return fallback(queue);
@@ -2290,15 +2326,14 @@ function createSuspense(fn, fallback) {
2290
2326
  }
2291
2327
  function createErrorBoundary(fn, fallback) {
2292
2328
  return createCollectionBoundary(ERROR_BIT, fn, (queue) => {
2293
- let node = queue.d.values().next().value;
2294
- ActiveTransition && ActiveTransition.a.has(node) && (node = ActiveTransition.a.get(node));
2295
- return fallback(node.L, () => {
2329
+ let node = getTransitionSource(queue.d.values().next().value);
2330
+ return fallback(node.J, () => {
2296
2331
  incrementClock();
2297
2332
  for (let node2 of queue.d) {
2298
- if (ActiveTransition && !node2.h)
2333
+ if (ActiveTransition && !node2.e)
2299
2334
  node2 = cloneGraph(node2);
2300
2335
  node2.c = STATE_DIRTY;
2301
- node2.l?.enqueue(node2.A, node2.C.bind(node2));
2336
+ node2.m?.enqueue(node2.B, node2.C.bind(node2));
2302
2337
  }
2303
2338
  });
2304
2339
  });