@solidjs/signals 0.12.0 → 0.13.1
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/README.md +2 -2
- package/dist/dev.js +228 -184
- package/dist/node.cjs +902 -873
- package/dist/prod.js +787 -753
- package/dist/types/boundaries.d.ts +6 -2
- package/dist/types/core/external.d.ts +26 -0
- package/dist/types/core/index.d.ts +3 -2
- package/dist/types/core/lanes.d.ts +3 -5
- package/dist/types/core/scheduler.d.ts +3 -1
- package/dist/types/core/types.d.ts +1 -1
- package/dist/types/index.d.ts +5 -4
- package/dist/types/signals.d.ts +1 -0
- package/dist/types/store/index.d.ts +2 -2
- package/dist/types/store/reconcile.d.ts +1 -1
- package/dist/types/store/store.d.ts +2 -4
- package/dist/types/store/utils.d.ts +8 -0
- package/package.json +1 -1
package/dist/node.cjs
CHANGED
|
@@ -105,24 +105,24 @@ function markNode(e, r = n) {
|
|
|
105
105
|
if ((i & (t | n)) >= r) return;
|
|
106
106
|
e.m = (i & -4) | r;
|
|
107
107
|
for (let n = e.O; n !== null; n = n.P) {
|
|
108
|
-
markNode(n.
|
|
108
|
+
markNode(n.k, t);
|
|
109
109
|
}
|
|
110
|
-
if (e.
|
|
111
|
-
for (let n = e.
|
|
110
|
+
if (e.C !== null) {
|
|
111
|
+
for (let n = e.C; n !== null; n = n.j) {
|
|
112
112
|
for (let e = n.O; e !== null; e = e.P) {
|
|
113
|
-
markNode(e.
|
|
113
|
+
markNode(e.k, t);
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
function runHeap(e, t) {
|
|
119
119
|
e._ = false;
|
|
120
|
-
for (e.
|
|
121
|
-
let n = e.l[e.
|
|
120
|
+
for (e.A = 0; e.A <= e.S; e.A++) {
|
|
121
|
+
let n = e.l[e.A];
|
|
122
122
|
while (n !== undefined) {
|
|
123
123
|
if (n.m & i) t(n);
|
|
124
124
|
else adjustHeight(n, e);
|
|
125
|
-
n = e.l[e.
|
|
125
|
+
n = e.l[e.A];
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
e.S = 0;
|
|
@@ -138,41 +138,41 @@ function adjustHeight(e, t) {
|
|
|
138
138
|
if (e.o !== n) {
|
|
139
139
|
e.o = n;
|
|
140
140
|
for (let n = e.O; n !== null; n = n.P) {
|
|
141
|
-
insertIntoHeapHeight(n.
|
|
141
|
+
insertIntoHeapHeight(n.k, t);
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
const x = new Set();
|
|
146
|
-
const
|
|
147
|
-
const
|
|
148
|
-
let
|
|
149
|
-
let
|
|
150
|
-
let C = false;
|
|
146
|
+
const P = { l: new Array(2e3).fill(undefined), _: false, A: 0, S: 0 };
|
|
147
|
+
const v = { l: new Array(2e3).fill(undefined), _: false, A: 0, S: 0 };
|
|
148
|
+
let k = 0;
|
|
149
|
+
let C = null;
|
|
151
150
|
let E = false;
|
|
152
|
-
|
|
151
|
+
let j = false;
|
|
152
|
+
function enforceLoadingBoundary(e) {}
|
|
153
153
|
function runLaneEffects(e) {
|
|
154
154
|
for (const t of N) {
|
|
155
155
|
if (t.R || t.T.size > 0) continue;
|
|
156
|
-
const n = t.
|
|
156
|
+
const n = t.q[e - 1];
|
|
157
157
|
if (n.length) {
|
|
158
|
-
t.
|
|
158
|
+
t.q[e - 1] = [];
|
|
159
159
|
runQueue(n, e);
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
function setProjectionWriteActive(e) {
|
|
164
|
-
|
|
164
|
+
j = e;
|
|
165
165
|
}
|
|
166
166
|
function schedule() {
|
|
167
|
-
if (
|
|
168
|
-
|
|
169
|
-
if (!
|
|
167
|
+
if (E) return;
|
|
168
|
+
E = true;
|
|
169
|
+
if (!A.F && !j) queueMicrotask(flush);
|
|
170
170
|
}
|
|
171
171
|
class Queue {
|
|
172
172
|
i = null;
|
|
173
|
-
|
|
173
|
+
M = [[], []];
|
|
174
174
|
V = [];
|
|
175
|
-
created =
|
|
175
|
+
created = k;
|
|
176
176
|
addChild(e) {
|
|
177
177
|
this.V.push(e);
|
|
178
178
|
e.i = this;
|
|
@@ -189,41 +189,41 @@ class Queue {
|
|
|
189
189
|
return false;
|
|
190
190
|
}
|
|
191
191
|
run(e) {
|
|
192
|
-
if (this.
|
|
193
|
-
const t = this.
|
|
194
|
-
this.
|
|
192
|
+
if (this.M[e - 1].length) {
|
|
193
|
+
const t = this.M[e - 1];
|
|
194
|
+
this.M[e - 1] = [];
|
|
195
195
|
runQueue(t, e);
|
|
196
196
|
}
|
|
197
197
|
for (let t = 0; t < this.V.length; t++) this.V[t].run?.(e);
|
|
198
198
|
}
|
|
199
199
|
enqueue(e, t) {
|
|
200
200
|
if (e) {
|
|
201
|
-
if (
|
|
202
|
-
const n = findLane(
|
|
203
|
-
n.
|
|
201
|
+
if (V) {
|
|
202
|
+
const n = findLane(V);
|
|
203
|
+
n.q[e - 1].push(t);
|
|
204
204
|
} else {
|
|
205
|
-
this.
|
|
205
|
+
this.M[e - 1].push(t);
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
schedule();
|
|
209
209
|
}
|
|
210
210
|
stashQueues(e) {
|
|
211
|
-
e.
|
|
212
|
-
e.
|
|
213
|
-
this.
|
|
211
|
+
e.M[0].push(...this.M[0]);
|
|
212
|
+
e.M[1].push(...this.M[1]);
|
|
213
|
+
this.M = [[], []];
|
|
214
214
|
for (let t = 0; t < this.V.length; t++) {
|
|
215
215
|
let n = this.V[t];
|
|
216
216
|
let r = e.V[t];
|
|
217
217
|
if (!r) {
|
|
218
|
-
r = {
|
|
218
|
+
r = { M: [[], []], V: [] };
|
|
219
219
|
e.V[t] = r;
|
|
220
220
|
}
|
|
221
221
|
n.stashQueues(r);
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
restoreQueues(e) {
|
|
225
|
-
this.
|
|
226
|
-
this.
|
|
225
|
+
this.M[0].push(...e.M[0]);
|
|
226
|
+
this.M[1].push(...e.M[1]);
|
|
227
227
|
for (let t = 0; t < e.V.length; t++) {
|
|
228
228
|
const n = e.V[t];
|
|
229
229
|
let r = this.V[t];
|
|
@@ -232,7 +232,7 @@ class Queue {
|
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
234
|
class GlobalQueue extends Queue {
|
|
235
|
-
|
|
235
|
+
F = false;
|
|
236
236
|
D = [];
|
|
237
237
|
B = [];
|
|
238
238
|
G = new Set();
|
|
@@ -240,55 +240,55 @@ class GlobalQueue extends Queue {
|
|
|
240
240
|
static U;
|
|
241
241
|
static J = null;
|
|
242
242
|
flush() {
|
|
243
|
-
if (this.
|
|
244
|
-
this.
|
|
243
|
+
if (this.F) return;
|
|
244
|
+
this.F = true;
|
|
245
245
|
try {
|
|
246
|
-
runHeap(
|
|
247
|
-
if (
|
|
248
|
-
const e = transitionComplete(
|
|
246
|
+
runHeap(P, GlobalQueue.K);
|
|
247
|
+
if (C) {
|
|
248
|
+
const e = transitionComplete(C);
|
|
249
249
|
if (!e) {
|
|
250
|
-
let e =
|
|
251
|
-
runHeap(
|
|
250
|
+
let e = C;
|
|
251
|
+
runHeap(v, GlobalQueue.K);
|
|
252
252
|
this.D = [];
|
|
253
253
|
this.B = [];
|
|
254
254
|
this.G = new Set();
|
|
255
255
|
runLaneEffects(h);
|
|
256
256
|
runLaneEffects(y);
|
|
257
|
-
this.stashQueues(
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
reassignPendingTransition(
|
|
261
|
-
|
|
257
|
+
this.stashQueues(C.X);
|
|
258
|
+
k++;
|
|
259
|
+
E = P.S >= P.A;
|
|
260
|
+
reassignPendingTransition(C.D);
|
|
261
|
+
C = null;
|
|
262
262
|
finalizePureQueue(null, true);
|
|
263
263
|
return;
|
|
264
264
|
}
|
|
265
|
-
this.D !==
|
|
266
|
-
this.restoreQueues(
|
|
267
|
-
x.delete(
|
|
268
|
-
const t =
|
|
269
|
-
|
|
265
|
+
this.D !== C.D && this.D.push(...C.D);
|
|
266
|
+
this.restoreQueues(C.X);
|
|
267
|
+
x.delete(C);
|
|
268
|
+
const t = C;
|
|
269
|
+
C = null;
|
|
270
270
|
reassignPendingTransition(this.D);
|
|
271
271
|
finalizePureQueue(t);
|
|
272
272
|
} else {
|
|
273
|
-
if (x.size) runHeap(
|
|
273
|
+
if (x.size) runHeap(v, GlobalQueue.K);
|
|
274
274
|
finalizePureQueue();
|
|
275
275
|
}
|
|
276
|
-
|
|
277
|
-
|
|
276
|
+
k++;
|
|
277
|
+
E = P.S >= P.A;
|
|
278
278
|
runLaneEffects(h);
|
|
279
279
|
this.run(h);
|
|
280
280
|
runLaneEffects(y);
|
|
281
281
|
this.run(y);
|
|
282
282
|
} finally {
|
|
283
|
-
this.
|
|
283
|
+
this.F = false;
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
notify(e, t, n, r) {
|
|
287
287
|
if (t & a) {
|
|
288
288
|
if (n & a) {
|
|
289
289
|
const t = r !== undefined ? r : e.Y;
|
|
290
|
-
if (
|
|
291
|
-
|
|
290
|
+
if (C && t && !C.Z.includes(t.source)) {
|
|
291
|
+
C.Z.push(t.source);
|
|
292
292
|
schedule();
|
|
293
293
|
}
|
|
294
294
|
}
|
|
@@ -298,21 +298,21 @@ class GlobalQueue extends Queue {
|
|
|
298
298
|
}
|
|
299
299
|
initTransition(e) {
|
|
300
300
|
if (e) e = currentTransition(e);
|
|
301
|
-
if (e && e ===
|
|
302
|
-
if (!e &&
|
|
303
|
-
if (!
|
|
304
|
-
|
|
305
|
-
$:
|
|
301
|
+
if (e && e === C) return;
|
|
302
|
+
if (!e && C && C.$ === k) return;
|
|
303
|
+
if (!C) {
|
|
304
|
+
C = e ?? {
|
|
305
|
+
$: k,
|
|
306
306
|
D: [],
|
|
307
307
|
Z: [],
|
|
308
308
|
B: [],
|
|
309
309
|
G: new Set(),
|
|
310
310
|
ee: [],
|
|
311
|
-
X: {
|
|
311
|
+
X: { M: [[], []], V: [] },
|
|
312
312
|
te: false
|
|
313
313
|
};
|
|
314
314
|
} else if (e) {
|
|
315
|
-
const t =
|
|
315
|
+
const t = C;
|
|
316
316
|
t.te = e;
|
|
317
317
|
e.ee.push(...t.ee);
|
|
318
318
|
for (const n of N) {
|
|
@@ -323,45 +323,45 @@ class GlobalQueue extends Queue {
|
|
|
323
323
|
e.G.add(n);
|
|
324
324
|
}
|
|
325
325
|
x.delete(t);
|
|
326
|
-
|
|
326
|
+
C = e;
|
|
327
327
|
}
|
|
328
|
-
x.add(
|
|
329
|
-
|
|
328
|
+
x.add(C);
|
|
329
|
+
C.$ = k;
|
|
330
330
|
for (let e = 0; e < this.D.length; e++) {
|
|
331
331
|
const t = this.D[e];
|
|
332
|
-
t.ne =
|
|
333
|
-
|
|
332
|
+
t.ne = C;
|
|
333
|
+
C.D.push(t);
|
|
334
334
|
}
|
|
335
|
-
this.D =
|
|
335
|
+
this.D = C.D;
|
|
336
336
|
for (let e = 0; e < this.B.length; e++) {
|
|
337
337
|
const t = this.B[e];
|
|
338
|
-
t.ne =
|
|
339
|
-
|
|
338
|
+
t.ne = C;
|
|
339
|
+
C.B.push(t);
|
|
340
340
|
}
|
|
341
|
-
this.B =
|
|
341
|
+
this.B = C.B;
|
|
342
342
|
for (const e of N) {
|
|
343
|
-
if (!e.ne) e.ne =
|
|
343
|
+
if (!e.ne) e.ne = C;
|
|
344
344
|
}
|
|
345
|
-
for (const e of this.G)
|
|
346
|
-
this.G =
|
|
345
|
+
for (const e of this.G) C.G.add(e);
|
|
346
|
+
this.G = C.G;
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
349
|
function insertSubs(e, t = false) {
|
|
350
|
-
const n = e.re ||
|
|
350
|
+
const n = e.re || V;
|
|
351
351
|
const r = e.ie !== undefined;
|
|
352
352
|
for (let i = e.O; i !== null; i = i.P) {
|
|
353
|
-
if (r && i.
|
|
354
|
-
i.
|
|
353
|
+
if (r && i.k.se) {
|
|
354
|
+
i.k.m |= l;
|
|
355
355
|
continue;
|
|
356
356
|
}
|
|
357
357
|
if (t && n) {
|
|
358
|
-
i.
|
|
359
|
-
assignOrMergeLane(i.
|
|
358
|
+
i.k.m |= f;
|
|
359
|
+
assignOrMergeLane(i.k, n);
|
|
360
360
|
} else if (t) {
|
|
361
|
-
i.
|
|
362
|
-
i.
|
|
361
|
+
i.k.m |= f;
|
|
362
|
+
i.k.re = undefined;
|
|
363
363
|
}
|
|
364
|
-
const e = i.
|
|
364
|
+
const e = i.k;
|
|
365
365
|
if (e.oe === g) {
|
|
366
366
|
if (!e.ue) {
|
|
367
367
|
e.ue = true;
|
|
@@ -369,62 +369,73 @@ function insertSubs(e, t = false) {
|
|
|
369
369
|
}
|
|
370
370
|
continue;
|
|
371
371
|
}
|
|
372
|
-
const s = i.
|
|
373
|
-
if (s.
|
|
374
|
-
insertIntoHeap(i.
|
|
372
|
+
const s = i.k.m & o ? v : P;
|
|
373
|
+
if (s.A > i.k.o) s.A = i.k.o;
|
|
374
|
+
insertIntoHeap(i.k, s);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
function commitPendingNodes() {
|
|
378
|
+
const e = A.D;
|
|
379
|
+
for (let t = 0; t < e.length; t++) {
|
|
380
|
+
const n = e[t];
|
|
381
|
+
if (n.ce !== S) {
|
|
382
|
+
n.ae = n.ce;
|
|
383
|
+
n.ce = S;
|
|
384
|
+
if (n.oe && n.oe !== g) n.ue = true;
|
|
385
|
+
}
|
|
386
|
+
if (n.de & a) {
|
|
387
|
+
const e = n.Y?.source;
|
|
388
|
+
if (e && !(e.de & a)) {
|
|
389
|
+
n.de &= -6;
|
|
390
|
+
n.Y = null;
|
|
391
|
+
}
|
|
392
|
+
} else n.de &= ~p;
|
|
393
|
+
if (n.H) GlobalQueue.U(n, false, true);
|
|
375
394
|
}
|
|
395
|
+
e.length = 0;
|
|
376
396
|
}
|
|
377
397
|
function finalizePureQueue(e = null, t = false) {
|
|
378
398
|
let n = !t;
|
|
379
|
-
if (
|
|
380
|
-
if (
|
|
399
|
+
if (n) commitPendingNodes();
|
|
400
|
+
if (!t) checkBoundaryChildren(A);
|
|
401
|
+
if (P.S >= P.A) runHeap(P, GlobalQueue.K);
|
|
381
402
|
if (n) {
|
|
382
|
-
|
|
403
|
+
commitPendingNodes();
|
|
404
|
+
const t = e ? e.B : A.B;
|
|
383
405
|
for (let e = 0; e < t.length; e++) {
|
|
384
406
|
const n = t[e];
|
|
407
|
+
n.re = undefined;
|
|
385
408
|
if (n.ce !== S) {
|
|
386
409
|
n.ae = n.ce;
|
|
387
410
|
n.ce = S;
|
|
388
|
-
if (n.oe && n.oe !== g) n.ue = true;
|
|
389
411
|
}
|
|
390
|
-
|
|
391
|
-
|
|
412
|
+
const r = n.pe;
|
|
413
|
+
n.pe = S;
|
|
414
|
+
if (r !== S && n.ae !== r) insertSubs(n, true);
|
|
415
|
+
n.ne = null;
|
|
392
416
|
}
|
|
393
417
|
t.length = 0;
|
|
394
|
-
const n = e ? e.
|
|
395
|
-
|
|
396
|
-
const
|
|
397
|
-
const r = t.ce;
|
|
398
|
-
t.re = undefined;
|
|
399
|
-
if (r !== S && t.ae !== r) {
|
|
400
|
-
t.ae = r;
|
|
401
|
-
insertSubs(t, true);
|
|
402
|
-
}
|
|
403
|
-
t.ce = S;
|
|
404
|
-
t.ne = null;
|
|
405
|
-
}
|
|
406
|
-
n.length = 0;
|
|
407
|
-
const r = e ? e.G : j.G;
|
|
408
|
-
if (GlobalQueue.J && r.size) {
|
|
409
|
-
for (const e of r) {
|
|
418
|
+
const n = e ? e.G : A.G;
|
|
419
|
+
if (GlobalQueue.J && n.size) {
|
|
420
|
+
for (const e of n) {
|
|
410
421
|
GlobalQueue.J(e);
|
|
411
422
|
}
|
|
412
|
-
|
|
423
|
+
n.clear();
|
|
413
424
|
schedule();
|
|
414
425
|
}
|
|
415
426
|
for (const t of N) {
|
|
416
427
|
const n = e ? t.ne === e : !t.ne;
|
|
417
428
|
if (!n) continue;
|
|
418
429
|
if (!t.R) {
|
|
419
|
-
if (t.
|
|
420
|
-
if (t.
|
|
430
|
+
if (t.q[0].length) runQueue(t.q[0], h);
|
|
431
|
+
if (t.q[1].length) runQueue(t.q[1], y);
|
|
421
432
|
}
|
|
422
|
-
if (t.
|
|
433
|
+
if (t.he.re === t) t.he.re = undefined;
|
|
423
434
|
t.T.clear();
|
|
424
|
-
t.
|
|
425
|
-
t.
|
|
435
|
+
t.q[0].length = 0;
|
|
436
|
+
t.q[1].length = 0;
|
|
426
437
|
N.delete(t);
|
|
427
|
-
W.delete(t.
|
|
438
|
+
W.delete(t.he);
|
|
428
439
|
}
|
|
429
440
|
}
|
|
430
441
|
}
|
|
@@ -435,18 +446,18 @@ function checkBoundaryChildren(e) {
|
|
|
435
446
|
}
|
|
436
447
|
}
|
|
437
448
|
function trackOptimisticStore(e) {
|
|
438
|
-
|
|
449
|
+
A.G.add(e);
|
|
439
450
|
schedule();
|
|
440
451
|
}
|
|
441
452
|
function reassignPendingTransition(e) {
|
|
442
453
|
for (let t = 0; t < e.length; t++) {
|
|
443
|
-
e[t].ne =
|
|
454
|
+
e[t].ne = C;
|
|
444
455
|
}
|
|
445
456
|
}
|
|
446
|
-
const
|
|
457
|
+
const A = new GlobalQueue();
|
|
447
458
|
function flush() {
|
|
448
|
-
while (
|
|
449
|
-
|
|
459
|
+
while (E) {
|
|
460
|
+
A.flush();
|
|
450
461
|
}
|
|
451
462
|
}
|
|
452
463
|
function runQueue(e, t) {
|
|
@@ -471,15 +482,15 @@ function currentTransition(e) {
|
|
|
471
482
|
return e;
|
|
472
483
|
}
|
|
473
484
|
function setActiveTransition(e) {
|
|
474
|
-
|
|
485
|
+
C = e;
|
|
475
486
|
}
|
|
476
487
|
function runInTransition(e, t) {
|
|
477
|
-
const n =
|
|
488
|
+
const n = C;
|
|
478
489
|
try {
|
|
479
|
-
|
|
490
|
+
C = currentTransition(e);
|
|
480
491
|
return t();
|
|
481
492
|
} finally {
|
|
482
|
-
|
|
493
|
+
C = n;
|
|
483
494
|
}
|
|
484
495
|
}
|
|
485
496
|
const W = new WeakMap();
|
|
@@ -489,12 +500,12 @@ function getOrCreateLane(e) {
|
|
|
489
500
|
if (t) {
|
|
490
501
|
return findLane(t);
|
|
491
502
|
}
|
|
492
|
-
const n = e.
|
|
503
|
+
const n = e.ye;
|
|
493
504
|
const r = n?.re ? findLane(n.re) : null;
|
|
494
|
-
t = {
|
|
505
|
+
t = { he: e, T: new Set(), q: [[], []], R: null, ne: C, ge: r };
|
|
495
506
|
W.set(e, t);
|
|
496
507
|
N.add(t);
|
|
497
|
-
e.
|
|
508
|
+
e.Se = false;
|
|
498
509
|
return t;
|
|
499
510
|
}
|
|
500
511
|
function findLane(e) {
|
|
@@ -507,8 +518,8 @@ function mergeLanes(e, t) {
|
|
|
507
518
|
if (e === t) return e;
|
|
508
519
|
t.R = e;
|
|
509
520
|
for (const n of t.T) e.T.add(n);
|
|
510
|
-
e.
|
|
511
|
-
e.
|
|
521
|
+
e.q[0].push(...t.q[0]);
|
|
522
|
+
e.q[1].push(...t.q[1]);
|
|
512
523
|
return e;
|
|
513
524
|
}
|
|
514
525
|
function resolveLane(e) {
|
|
@@ -520,7 +531,7 @@ function resolveLane(e) {
|
|
|
520
531
|
return undefined;
|
|
521
532
|
}
|
|
522
533
|
function hasActiveOverride(e) {
|
|
523
|
-
return !!(e.
|
|
534
|
+
return !!(e.pe !== undefined && e.pe !== S);
|
|
524
535
|
}
|
|
525
536
|
function assignOrMergeLane(e, t) {
|
|
526
537
|
const n = findLane(t);
|
|
@@ -533,9 +544,9 @@ function assignOrMergeLane(e, t) {
|
|
|
533
544
|
const i = findLane(r);
|
|
534
545
|
if (N.has(i)) {
|
|
535
546
|
if (i !== n && !hasActiveOverride(e)) {
|
|
536
|
-
if (n.
|
|
547
|
+
if (n.ge && findLane(n.ge) === i) {
|
|
537
548
|
e.re = t;
|
|
538
|
-
} else if (i.
|
|
549
|
+
} else if (i.ge && findLane(i.ge) === n);
|
|
539
550
|
else mergeLanes(n, i);
|
|
540
551
|
}
|
|
541
552
|
return;
|
|
@@ -548,41 +559,40 @@ function handleAsync(e, t, r) {
|
|
|
548
559
|
const s = i && untrack(() => t[Symbol.asyncIterator]);
|
|
549
560
|
const o = !s && i && untrack(() => typeof t.then === "function");
|
|
550
561
|
if (!o && !s) {
|
|
551
|
-
e.
|
|
562
|
+
e.we = null;
|
|
552
563
|
return t;
|
|
553
564
|
}
|
|
554
|
-
e.
|
|
565
|
+
e.we = t;
|
|
555
566
|
let u;
|
|
556
567
|
const handleError = n => {
|
|
557
|
-
if (e.
|
|
558
|
-
|
|
568
|
+
if (e.we !== t) return;
|
|
569
|
+
A.initTransition(e.ne);
|
|
559
570
|
notifyStatus(e, n instanceof NotReadyError ? a : d, n);
|
|
560
|
-
e.$ =
|
|
571
|
+
e.$ = k;
|
|
561
572
|
};
|
|
562
573
|
const asyncWrite = (i, s) => {
|
|
563
|
-
if (e.
|
|
574
|
+
if (e.we !== t) return;
|
|
564
575
|
if (e.m & (n | f)) return;
|
|
565
|
-
|
|
576
|
+
A.initTransition(e.ne);
|
|
566
577
|
clearStatus(e);
|
|
567
578
|
const o = resolveLane(e);
|
|
568
579
|
if (o) o.T.delete(e);
|
|
569
580
|
if (r) r(i);
|
|
570
|
-
else if (e.
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
if (!t) {
|
|
581
|
+
else if (e.pe !== undefined) {
|
|
582
|
+
if (e.pe !== undefined && e.pe !== S) e.ce = i;
|
|
583
|
+
else {
|
|
574
584
|
e.ae = i;
|
|
575
585
|
insertSubs(e);
|
|
576
586
|
}
|
|
577
|
-
e.$ =
|
|
587
|
+
e.$ = k;
|
|
578
588
|
} else if (o) {
|
|
579
589
|
const t = e.ae;
|
|
580
|
-
const n = e.
|
|
590
|
+
const n = e.me;
|
|
581
591
|
if (!n || !n(i, t)) {
|
|
582
592
|
e.ae = i;
|
|
583
|
-
e.$ =
|
|
584
|
-
if (e.
|
|
585
|
-
setSignal(e.
|
|
593
|
+
e.$ = k;
|
|
594
|
+
if (e.be) {
|
|
595
|
+
setSignal(e.be, i);
|
|
586
596
|
}
|
|
587
597
|
insertSubs(e, true);
|
|
588
598
|
}
|
|
@@ -609,8 +619,8 @@ function handleAsync(e, t, r) {
|
|
|
609
619
|
);
|
|
610
620
|
r = false;
|
|
611
621
|
if (!n) {
|
|
612
|
-
|
|
613
|
-
throw new NotReadyError(
|
|
622
|
+
A.initTransition(e.ne);
|
|
623
|
+
throw new NotReadyError(M);
|
|
614
624
|
}
|
|
615
625
|
}
|
|
616
626
|
if (s) {
|
|
@@ -645,8 +655,8 @@ function handleAsync(e, t, r) {
|
|
|
645
655
|
};
|
|
646
656
|
const i = iterate();
|
|
647
657
|
if (!r && !i) {
|
|
648
|
-
|
|
649
|
-
throw new NotReadyError(
|
|
658
|
+
A.initTransition(e.ne);
|
|
659
|
+
throw new NotReadyError(M);
|
|
650
660
|
}
|
|
651
661
|
}
|
|
652
662
|
return u;
|
|
@@ -655,13 +665,13 @@ function clearStatus(e) {
|
|
|
655
665
|
e.de = e.de & p;
|
|
656
666
|
e.Y = null;
|
|
657
667
|
updatePendingSignal(e);
|
|
658
|
-
e.
|
|
668
|
+
e._e?.();
|
|
659
669
|
}
|
|
660
670
|
function notifyStatus(e, t, n, r, i) {
|
|
661
671
|
if (t === d && !(n instanceof StatusError) && !(n instanceof NotReadyError))
|
|
662
672
|
n = new StatusError(e, n);
|
|
663
673
|
const s = n instanceof NotReadyError && n.source === e;
|
|
664
|
-
const o = t === a && e.
|
|
674
|
+
const o = t === a && e.pe !== undefined && !s;
|
|
665
675
|
const u = o && hasActiveOverride(e);
|
|
666
676
|
if (!r) {
|
|
667
677
|
e.de = t | (t !== d ? e.de & p : 0);
|
|
@@ -671,35 +681,35 @@ function notifyStatus(e, t, n, r, i) {
|
|
|
671
681
|
if (i && !r) {
|
|
672
682
|
assignOrMergeLane(e, i);
|
|
673
683
|
}
|
|
674
|
-
if (u &&
|
|
684
|
+
if (u && C && n instanceof NotReadyError) {
|
|
675
685
|
const e = n.source;
|
|
676
|
-
if (!
|
|
677
|
-
|
|
686
|
+
if (!C.Z.includes(e)) {
|
|
687
|
+
C.Z.push(e);
|
|
678
688
|
}
|
|
679
689
|
}
|
|
680
690
|
const f = r || u;
|
|
681
691
|
const l = r || o ? undefined : i;
|
|
682
|
-
if (e.
|
|
692
|
+
if (e._e) {
|
|
683
693
|
if (f) {
|
|
684
|
-
e.
|
|
694
|
+
e._e(t, n);
|
|
685
695
|
} else {
|
|
686
|
-
e.
|
|
696
|
+
e._e();
|
|
687
697
|
}
|
|
688
698
|
return;
|
|
689
699
|
}
|
|
690
700
|
for (let r = e.O; r !== null; r = r.P) {
|
|
691
|
-
r.
|
|
692
|
-
if (r.
|
|
693
|
-
!r.
|
|
694
|
-
notifyStatus(r.
|
|
701
|
+
r.k.$ = k;
|
|
702
|
+
if (r.k.Y !== n) {
|
|
703
|
+
!r.k.ne && A.D.push(r.k);
|
|
704
|
+
notifyStatus(r.k, t, n, f, l);
|
|
695
705
|
}
|
|
696
706
|
}
|
|
697
|
-
for (let r = e.
|
|
707
|
+
for (let r = e.C; r !== null; r = r.j) {
|
|
698
708
|
for (let e = r.O; e !== null; e = e.P) {
|
|
699
|
-
e.
|
|
700
|
-
if (e.
|
|
701
|
-
!e.
|
|
702
|
-
notifyStatus(e.
|
|
709
|
+
e.k.$ = k;
|
|
710
|
+
if (e.k.Y !== n) {
|
|
711
|
+
!e.k.ne && A.D.push(e.k);
|
|
712
|
+
notifyStatus(e.k, t, n, f, l);
|
|
703
713
|
}
|
|
704
714
|
}
|
|
705
715
|
}
|
|
@@ -708,21 +718,21 @@ function unlinkSubs(e) {
|
|
|
708
718
|
const t = e.L;
|
|
709
719
|
const n = e.N;
|
|
710
720
|
const r = e.P;
|
|
711
|
-
const i = e.
|
|
712
|
-
if (r !== null) r.
|
|
713
|
-
else t.
|
|
721
|
+
const i = e.Oe;
|
|
722
|
+
if (r !== null) r.Oe = i;
|
|
723
|
+
else t.xe = i;
|
|
714
724
|
if (i !== null) i.P = r;
|
|
715
725
|
else {
|
|
716
726
|
t.O = r;
|
|
717
727
|
if (r === null) {
|
|
718
728
|
t.Pe?.();
|
|
719
|
-
t.H && !t.
|
|
729
|
+
t.H && !t.ve && !(t.m & o) && unobserved(t);
|
|
720
730
|
}
|
|
721
731
|
}
|
|
722
732
|
return n;
|
|
723
733
|
}
|
|
724
734
|
function unobserved(e) {
|
|
725
|
-
deleteFromHeap(e, e.m & o ?
|
|
735
|
+
deleteFromHeap(e, e.m & o ? v : P);
|
|
726
736
|
let t = e.W;
|
|
727
737
|
while (t !== null) {
|
|
728
738
|
t = unlinkSubs(t);
|
|
@@ -742,9 +752,9 @@ function link(e, t) {
|
|
|
742
752
|
return;
|
|
743
753
|
}
|
|
744
754
|
}
|
|
745
|
-
const o = e.
|
|
746
|
-
if (o !== null && o.
|
|
747
|
-
const u = (t.ke = e.
|
|
755
|
+
const o = e.xe;
|
|
756
|
+
if (o !== null && o.k === t && (!s || isValidLink(o, t))) return;
|
|
757
|
+
const u = (t.ke = e.xe = { L: e, k: t, N: i, Oe: o, P: null });
|
|
748
758
|
if (n !== null) n.N = u;
|
|
749
759
|
else t.W = u;
|
|
750
760
|
if (o !== null) o.P = u;
|
|
@@ -768,8 +778,8 @@ function markDisposal(e) {
|
|
|
768
778
|
while (t) {
|
|
769
779
|
t.m |= o;
|
|
770
780
|
if (t.m & i) {
|
|
771
|
-
deleteFromHeap(t,
|
|
772
|
-
insertIntoHeap(t,
|
|
781
|
+
deleteFromHeap(t, P);
|
|
782
|
+
insertIntoHeap(t, v);
|
|
773
783
|
}
|
|
774
784
|
markDisposal(t);
|
|
775
785
|
t = t.Ee;
|
|
@@ -792,7 +802,7 @@ function disposeChildren(e, t = false, n) {
|
|
|
792
802
|
const e = r.Ee;
|
|
793
803
|
if (r.W) {
|
|
794
804
|
const e = r;
|
|
795
|
-
deleteFromHeap(e, e.m & o ?
|
|
805
|
+
deleteFromHeap(e, e.m & o ? v : P);
|
|
796
806
|
let t = e.W;
|
|
797
807
|
do {
|
|
798
808
|
t = unlinkSubs(t);
|
|
@@ -807,13 +817,12 @@ function disposeChildren(e, t = false, n) {
|
|
|
807
817
|
e.je = null;
|
|
808
818
|
} else {
|
|
809
819
|
e.Ce = null;
|
|
810
|
-
e.
|
|
811
|
-
e.We = 0;
|
|
820
|
+
e.Ae = 0;
|
|
812
821
|
}
|
|
813
822
|
runDisposal(e, n);
|
|
814
823
|
}
|
|
815
824
|
function runDisposal(e, t) {
|
|
816
|
-
let n = t ? e.
|
|
825
|
+
let n = t ? e.We : e.Ne;
|
|
817
826
|
if (!n) return;
|
|
818
827
|
if (Array.isArray(n)) {
|
|
819
828
|
for (let e = 0; e < n.length; e++) {
|
|
@@ -823,12 +832,12 @@ function runDisposal(e, t) {
|
|
|
823
832
|
} else {
|
|
824
833
|
n.call(n);
|
|
825
834
|
}
|
|
826
|
-
t ? (e.
|
|
835
|
+
t ? (e.We = null) : (e.Ne = null);
|
|
827
836
|
}
|
|
828
837
|
function childId(e, t) {
|
|
829
838
|
let n = e;
|
|
830
|
-
while (n.
|
|
831
|
-
if (n.id != null) return formatId(n.id, t ? n.
|
|
839
|
+
while (n.Le && n.i) n = n.i;
|
|
840
|
+
if (n.id != null) return formatId(n.id, t ? n.Ae++ : n.Ae);
|
|
832
841
|
throw new Error("Cannot get child id from owner without an id");
|
|
833
842
|
}
|
|
834
843
|
function getNextChildId(e) {
|
|
@@ -843,37 +852,37 @@ function formatId(e, t) {
|
|
|
843
852
|
return e + (r ? String.fromCharCode(64 + r) : "") + n;
|
|
844
853
|
}
|
|
845
854
|
function getObserver() {
|
|
846
|
-
if (
|
|
847
|
-
return
|
|
855
|
+
if (T || F) return L;
|
|
856
|
+
return H ? M : null;
|
|
848
857
|
}
|
|
849
858
|
function getOwner() {
|
|
850
|
-
return
|
|
859
|
+
return M;
|
|
851
860
|
}
|
|
852
861
|
function onCleanup(e) {
|
|
853
|
-
if (!
|
|
854
|
-
if (!
|
|
855
|
-
else if (Array.isArray(
|
|
856
|
-
else
|
|
862
|
+
if (!M) return e;
|
|
863
|
+
if (!M.Ne) M.Ne = e;
|
|
864
|
+
else if (Array.isArray(M.Ne)) M.Ne.push(e);
|
|
865
|
+
else M.Ne = [M.Ne, e];
|
|
857
866
|
return e;
|
|
858
867
|
}
|
|
859
868
|
function isDisposed(e) {
|
|
860
869
|
return !!(e.m & (u | o));
|
|
861
870
|
}
|
|
862
871
|
function createOwner(e) {
|
|
863
|
-
const t =
|
|
872
|
+
const t = M;
|
|
864
873
|
const n = e?.transparent ?? false;
|
|
865
874
|
const r = {
|
|
866
875
|
id: e?.id ?? (n ? t?.id : t?.id != null ? getNextChildId(t) : undefined),
|
|
867
|
-
|
|
876
|
+
Le: n || undefined,
|
|
868
877
|
t: true,
|
|
869
878
|
u: t?.t ? t.u : t,
|
|
870
879
|
Ce: null,
|
|
871
880
|
Ee: null,
|
|
872
|
-
Le: null,
|
|
873
|
-
fe: t?.fe ?? j,
|
|
874
|
-
He: t?.He || _,
|
|
875
|
-
We: 0,
|
|
876
881
|
Ne: null,
|
|
882
|
+
fe: t?.fe ?? A,
|
|
883
|
+
Ie: t?.Ie || _,
|
|
884
|
+
Ae: 0,
|
|
885
|
+
We: null,
|
|
877
886
|
je: null,
|
|
878
887
|
i: t,
|
|
879
888
|
dispose(e = true) {
|
|
@@ -906,12 +915,12 @@ function effect(e, t, n, r, i) {
|
|
|
906
915
|
},
|
|
907
916
|
lazy: true
|
|
908
917
|
});
|
|
909
|
-
o.
|
|
910
|
-
o.
|
|
911
|
-
o.
|
|
912
|
-
o.
|
|
918
|
+
o.He = r;
|
|
919
|
+
o.Re = t;
|
|
920
|
+
o.Qe = n;
|
|
921
|
+
o.Te = undefined;
|
|
913
922
|
o.oe = i?.render ? h : y;
|
|
914
|
-
o.
|
|
923
|
+
o._e = (e, t) => {
|
|
915
924
|
const n = e !== undefined ? e : o.de;
|
|
916
925
|
const r = t !== undefined ? t : o.Y;
|
|
917
926
|
if (n & d) {
|
|
@@ -919,10 +928,10 @@ function effect(e, t, n, r, i) {
|
|
|
919
928
|
o.fe.notify(o, a, 0);
|
|
920
929
|
if (o.oe === y) {
|
|
921
930
|
try {
|
|
922
|
-
return o.
|
|
923
|
-
? o.
|
|
924
|
-
o.
|
|
925
|
-
o.
|
|
931
|
+
return o.Qe
|
|
932
|
+
? o.Qe(e, () => {
|
|
933
|
+
o.Te?.();
|
|
934
|
+
o.Te = undefined;
|
|
926
935
|
})
|
|
927
936
|
: console.error(e);
|
|
928
937
|
} catch (t) {
|
|
@@ -930,23 +939,25 @@ function effect(e, t, n, r, i) {
|
|
|
930
939
|
}
|
|
931
940
|
}
|
|
932
941
|
if (!o.fe.notify(o, d, d)) throw e;
|
|
933
|
-
} else if (o.oe === h)
|
|
942
|
+
} else if (o.oe === h) {
|
|
943
|
+
o.fe.notify(o, a | d, n, r);
|
|
944
|
+
}
|
|
934
945
|
};
|
|
935
946
|
recompute(o, true);
|
|
936
947
|
!i?.defer && (o.oe === y ? o.fe.enqueue(o.oe, runEffect.bind(o)) : runEffect.call(o));
|
|
937
948
|
s = true;
|
|
938
|
-
onCleanup(() => o.
|
|
949
|
+
onCleanup(() => o.Te?.());
|
|
939
950
|
}
|
|
940
951
|
function runEffect() {
|
|
941
952
|
if (!this.ue || this.m & u) return;
|
|
942
|
-
this.
|
|
943
|
-
this.
|
|
953
|
+
this.Te?.();
|
|
954
|
+
this.Te = undefined;
|
|
944
955
|
try {
|
|
945
|
-
this.
|
|
956
|
+
this.Te = this.Re(this.ae, this.He);
|
|
946
957
|
} catch (e) {
|
|
947
958
|
if (!this.fe.notify(this, d, d)) throw e;
|
|
948
959
|
} finally {
|
|
949
|
-
this.
|
|
960
|
+
this.He = this.ae;
|
|
950
961
|
this.ue = false;
|
|
951
962
|
}
|
|
952
963
|
}
|
|
@@ -959,34 +970,57 @@ function trackedEffect(e, t) {
|
|
|
959
970
|
const n = computed(
|
|
960
971
|
() => {
|
|
961
972
|
try {
|
|
962
|
-
n.
|
|
963
|
-
n.
|
|
964
|
-
n.
|
|
973
|
+
n.Te?.();
|
|
974
|
+
n.Te = undefined;
|
|
975
|
+
n.Te = staleValues(e) || undefined;
|
|
965
976
|
} finally {
|
|
966
977
|
}
|
|
967
978
|
},
|
|
968
979
|
undefined,
|
|
969
980
|
{ ...t, lazy: true }
|
|
970
981
|
);
|
|
971
|
-
n.
|
|
982
|
+
n.Te = undefined;
|
|
972
983
|
n.ue = true;
|
|
973
984
|
n.oe = g;
|
|
974
985
|
n.le = run;
|
|
975
986
|
n.fe.enqueue(y, run);
|
|
976
|
-
onCleanup(() => n.
|
|
987
|
+
onCleanup(() => n.Te?.());
|
|
988
|
+
}
|
|
989
|
+
let I = null;
|
|
990
|
+
function enableExternalSource(e) {
|
|
991
|
+
const { factory: t, untrack: n = e => e() } = e;
|
|
992
|
+
if (I) {
|
|
993
|
+
const { factory: e, untrack: r } = I;
|
|
994
|
+
I = {
|
|
995
|
+
factory: (n, r) => {
|
|
996
|
+
const i = e(n, r);
|
|
997
|
+
const s = t(e => i.track(e), r);
|
|
998
|
+
return {
|
|
999
|
+
track: e => s.track(e),
|
|
1000
|
+
dispose() {
|
|
1001
|
+
s.dispose();
|
|
1002
|
+
i.dispose();
|
|
1003
|
+
}
|
|
1004
|
+
};
|
|
1005
|
+
},
|
|
1006
|
+
untrack: e => r(() => n(e))
|
|
1007
|
+
};
|
|
1008
|
+
} else {
|
|
1009
|
+
I = { factory: t, untrack: n };
|
|
1010
|
+
}
|
|
977
1011
|
}
|
|
978
1012
|
GlobalQueue.K = recompute;
|
|
979
1013
|
GlobalQueue.U = disposeChildren;
|
|
980
|
-
let I = false;
|
|
981
1014
|
let H = false;
|
|
982
1015
|
let R = false;
|
|
983
1016
|
let Q = false;
|
|
984
1017
|
let T = false;
|
|
985
|
-
let
|
|
986
|
-
let
|
|
987
|
-
let
|
|
988
|
-
let V =
|
|
989
|
-
let D =
|
|
1018
|
+
let q = false;
|
|
1019
|
+
let F = false;
|
|
1020
|
+
let M = null;
|
|
1021
|
+
let V = null;
|
|
1022
|
+
let D = false;
|
|
1023
|
+
let B = null;
|
|
990
1024
|
function ownerInSnapshotScope(e) {
|
|
991
1025
|
while (e) {
|
|
992
1026
|
if (e.qe) return true;
|
|
@@ -995,8 +1029,8 @@ function ownerInSnapshotScope(e) {
|
|
|
995
1029
|
return false;
|
|
996
1030
|
}
|
|
997
1031
|
function setSnapshotCapture(e) {
|
|
998
|
-
|
|
999
|
-
if (e && !
|
|
1032
|
+
D = e;
|
|
1033
|
+
if (e && !B) B = new Set();
|
|
1000
1034
|
}
|
|
1001
1035
|
function markSnapshotScope(e) {
|
|
1002
1036
|
e.qe = true;
|
|
@@ -1019,8 +1053,8 @@ function releaseSubtree(e) {
|
|
|
1019
1053
|
if (e.m & l) {
|
|
1020
1054
|
e.m &= ~l;
|
|
1021
1055
|
e.m |= n;
|
|
1022
|
-
if (
|
|
1023
|
-
insertIntoHeap(e,
|
|
1056
|
+
if (P.A > e.o) P.A = e.o;
|
|
1057
|
+
insertIntoHeap(e, P);
|
|
1024
1058
|
}
|
|
1025
1059
|
}
|
|
1026
1060
|
releaseSubtree(t);
|
|
@@ -1028,46 +1062,46 @@ function releaseSubtree(e) {
|
|
|
1028
1062
|
}
|
|
1029
1063
|
}
|
|
1030
1064
|
function clearSnapshots() {
|
|
1031
|
-
if (
|
|
1032
|
-
for (const e of
|
|
1065
|
+
if (B) {
|
|
1066
|
+
for (const e of B) {
|
|
1033
1067
|
delete e.ie;
|
|
1034
1068
|
delete e[m];
|
|
1035
1069
|
}
|
|
1036
|
-
|
|
1070
|
+
B = null;
|
|
1037
1071
|
}
|
|
1038
|
-
|
|
1072
|
+
D = false;
|
|
1039
1073
|
}
|
|
1040
1074
|
function recompute(t, n = false) {
|
|
1041
1075
|
const i = t.oe;
|
|
1042
1076
|
if (!n) {
|
|
1043
|
-
if (t.ne && (!i ||
|
|
1044
|
-
deleteFromHeap(t, t.m & o ?
|
|
1077
|
+
if (t.ne && (!i || C) && C !== t.ne) A.initTransition(t.ne);
|
|
1078
|
+
deleteFromHeap(t, t.m & o ? v : P);
|
|
1045
1079
|
if (t.ne || i === g) disposeChildren(t);
|
|
1046
1080
|
else {
|
|
1047
1081
|
markDisposal(t);
|
|
1048
|
-
t.
|
|
1082
|
+
t.We = t.Ne;
|
|
1049
1083
|
t.je = t.Ce;
|
|
1050
|
-
t.
|
|
1084
|
+
t.Ne = null;
|
|
1051
1085
|
t.Ce = null;
|
|
1052
|
-
t.
|
|
1086
|
+
t.Ae = 0;
|
|
1053
1087
|
}
|
|
1054
1088
|
}
|
|
1055
1089
|
const s = !!(t.m & f);
|
|
1056
|
-
const u =
|
|
1090
|
+
const u = t.pe !== undefined && t.pe !== S;
|
|
1057
1091
|
const c = !!(t.de & a);
|
|
1058
|
-
const p =
|
|
1059
|
-
|
|
1092
|
+
const p = M;
|
|
1093
|
+
M = t;
|
|
1060
1094
|
t.ke = null;
|
|
1061
1095
|
t.m = r;
|
|
1062
|
-
t.$ =
|
|
1096
|
+
t.$ = k;
|
|
1063
1097
|
let h = t.ce === S ? t.ae : t.ce;
|
|
1064
1098
|
let y = t.o;
|
|
1065
|
-
let w =
|
|
1066
|
-
let m =
|
|
1067
|
-
|
|
1099
|
+
let w = H;
|
|
1100
|
+
let m = V;
|
|
1101
|
+
H = true;
|
|
1068
1102
|
if (s) {
|
|
1069
1103
|
const e = resolveLane(t);
|
|
1070
|
-
if (e)
|
|
1104
|
+
if (e) V = e;
|
|
1071
1105
|
}
|
|
1072
1106
|
try {
|
|
1073
1107
|
h = handleAsync(t, t.H(h));
|
|
@@ -1075,15 +1109,15 @@ function recompute(t, n = false) {
|
|
|
1075
1109
|
const e = resolveLane(t);
|
|
1076
1110
|
if (e) {
|
|
1077
1111
|
e.T.delete(t);
|
|
1078
|
-
updatePendingSignal(e.
|
|
1112
|
+
updatePendingSignal(e.he);
|
|
1079
1113
|
}
|
|
1080
1114
|
} catch (e) {
|
|
1081
|
-
if (e instanceof NotReadyError &&
|
|
1082
|
-
const e = findLane(
|
|
1083
|
-
if (e.
|
|
1115
|
+
if (e instanceof NotReadyError && V) {
|
|
1116
|
+
const e = findLane(V);
|
|
1117
|
+
if (e.he !== t) {
|
|
1084
1118
|
e.T.add(t);
|
|
1085
1119
|
t.re = e;
|
|
1086
|
-
updatePendingSignal(e.
|
|
1120
|
+
updatePendingSignal(e.he);
|
|
1087
1121
|
}
|
|
1088
1122
|
}
|
|
1089
1123
|
notifyStatus(
|
|
@@ -1094,9 +1128,9 @@ function recompute(t, n = false) {
|
|
|
1094
1128
|
e instanceof NotReadyError ? t.re : undefined
|
|
1095
1129
|
);
|
|
1096
1130
|
} finally {
|
|
1097
|
-
|
|
1131
|
+
H = w;
|
|
1098
1132
|
t.m = e | (n ? t.m & l : 0);
|
|
1099
|
-
|
|
1133
|
+
M = p;
|
|
1100
1134
|
}
|
|
1101
1135
|
if (!t.Y) {
|
|
1102
1136
|
const e = t.ke;
|
|
@@ -1108,31 +1142,30 @@ function recompute(t, n = false) {
|
|
|
1108
1142
|
if (e !== null) e.N = null;
|
|
1109
1143
|
else t.W = null;
|
|
1110
1144
|
}
|
|
1111
|
-
const f = u ? t.
|
|
1112
|
-
const l = !t.
|
|
1145
|
+
const f = u ? t.pe : t.ce === S ? t.ae : t.ce;
|
|
1146
|
+
const l = !t.me || !t.me(f, h);
|
|
1113
1147
|
if (l) {
|
|
1114
|
-
const e = u ? t.
|
|
1115
|
-
if (n || (i &&
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
}
|
|
1122
|
-
if (
|
|
1123
|
-
|
|
1124
|
-
}
|
|
1148
|
+
const e = u ? t.pe : undefined;
|
|
1149
|
+
if (n || (i && C !== t.ne) || s) {
|
|
1150
|
+
t.ae = h;
|
|
1151
|
+
if (u && s) {
|
|
1152
|
+
t.pe = h;
|
|
1153
|
+
t.ce = h;
|
|
1154
|
+
}
|
|
1155
|
+
} else t.ce = h;
|
|
1156
|
+
if (u && !s && c && !t.Se) t.pe = h;
|
|
1157
|
+
if (!u || s || t.pe !== e) insertSubs(t, s || u);
|
|
1125
1158
|
} else if (u) {
|
|
1126
1159
|
t.ce = h;
|
|
1127
1160
|
} else if (t.o != y) {
|
|
1128
1161
|
for (let e = t.O; e !== null; e = e.P) {
|
|
1129
|
-
insertIntoHeapHeight(e.
|
|
1162
|
+
insertIntoHeapHeight(e.k, e.k.m & o ? v : P);
|
|
1130
1163
|
}
|
|
1131
1164
|
}
|
|
1132
1165
|
}
|
|
1133
|
-
|
|
1134
|
-
(!n || t.de & a) && !t.ne && !(
|
|
1135
|
-
t.ne && i &&
|
|
1166
|
+
V = m;
|
|
1167
|
+
(!n || t.de & a) && !t.ne && !(C && u) && A.D.push(t);
|
|
1168
|
+
t.ne && i && C !== t.ne && runInTransition(t.ne, () => recompute(t));
|
|
1136
1169
|
}
|
|
1137
1170
|
function updateIfNecessary(r) {
|
|
1138
1171
|
if (r.m & t) {
|
|
@@ -1147,7 +1180,7 @@ function updateIfNecessary(r) {
|
|
|
1147
1180
|
}
|
|
1148
1181
|
}
|
|
1149
1182
|
}
|
|
1150
|
-
if (r.m & (n | f) || (r.Y && r.$ <
|
|
1183
|
+
if (r.m & (n | f) || (r.Y && r.$ < k && !r.we)) {
|
|
1151
1184
|
recompute(r);
|
|
1152
1185
|
}
|
|
1153
1186
|
r.m = e | (r.m & l);
|
|
@@ -1155,153 +1188,166 @@ function updateIfNecessary(r) {
|
|
|
1155
1188
|
function computed(t, n, r) {
|
|
1156
1189
|
const i = r?.transparent ?? false;
|
|
1157
1190
|
const s = {
|
|
1158
|
-
id: r?.id ?? (i ?
|
|
1159
|
-
|
|
1160
|
-
|
|
1191
|
+
id: r?.id ?? (i ? M?.id : M?.id != null ? getNextChildId(M) : undefined),
|
|
1192
|
+
Le: i || undefined,
|
|
1193
|
+
me: r?.equals != null ? r.equals : isEqual,
|
|
1161
1194
|
Fe: !!r?.pureWrite,
|
|
1162
1195
|
Pe: r?.unobserved,
|
|
1163
|
-
|
|
1164
|
-
fe:
|
|
1165
|
-
|
|
1166
|
-
|
|
1196
|
+
Ne: null,
|
|
1197
|
+
fe: M?.fe ?? A,
|
|
1198
|
+
Ie: M?.Ie ?? _,
|
|
1199
|
+
Ae: 0,
|
|
1167
1200
|
H: t,
|
|
1168
1201
|
ae: n,
|
|
1169
1202
|
o: 0,
|
|
1170
|
-
|
|
1203
|
+
C: null,
|
|
1171
1204
|
h: undefined,
|
|
1172
1205
|
p: null,
|
|
1173
1206
|
W: null,
|
|
1174
1207
|
ke: null,
|
|
1175
1208
|
O: null,
|
|
1176
|
-
|
|
1177
|
-
i:
|
|
1209
|
+
xe: null,
|
|
1210
|
+
i: M,
|
|
1178
1211
|
Ee: null,
|
|
1179
1212
|
Ce: null,
|
|
1180
1213
|
m: r?.lazy ? c : e,
|
|
1181
1214
|
de: p,
|
|
1182
|
-
$:
|
|
1215
|
+
$: k,
|
|
1183
1216
|
ce: S,
|
|
1184
|
-
|
|
1217
|
+
We: null,
|
|
1185
1218
|
je: null,
|
|
1186
|
-
|
|
1219
|
+
we: null,
|
|
1187
1220
|
ne: null
|
|
1188
1221
|
};
|
|
1189
1222
|
s.p = s;
|
|
1190
|
-
const o =
|
|
1191
|
-
if (
|
|
1192
|
-
const e =
|
|
1223
|
+
const o = M?.t ? M.u : M;
|
|
1224
|
+
if (M) {
|
|
1225
|
+
const e = M.Ce;
|
|
1193
1226
|
if (e === null) {
|
|
1194
|
-
|
|
1227
|
+
M.Ce = s;
|
|
1195
1228
|
} else {
|
|
1196
1229
|
s.Ee = e;
|
|
1197
|
-
|
|
1230
|
+
M.Ce = s;
|
|
1198
1231
|
}
|
|
1199
1232
|
}
|
|
1200
1233
|
if (o) s.o = o.o + 1;
|
|
1201
|
-
if (
|
|
1234
|
+
if (D && ownerInSnapshotScope(M)) s.se = true;
|
|
1235
|
+
if (I) {
|
|
1236
|
+
const e = signal(undefined, { equals: false, pureWrite: true });
|
|
1237
|
+
const t = I.factory(s.H, () => {
|
|
1238
|
+
setSignal(e, undefined);
|
|
1239
|
+
});
|
|
1240
|
+
onCleanup(() => t.dispose());
|
|
1241
|
+
s.H = n => {
|
|
1242
|
+
read(e);
|
|
1243
|
+
return t.track(n);
|
|
1244
|
+
};
|
|
1245
|
+
}
|
|
1202
1246
|
!r?.lazy && recompute(s, true);
|
|
1203
|
-
if (
|
|
1247
|
+
if (D && !r?.lazy) {
|
|
1204
1248
|
if (!(s.de & a)) {
|
|
1205
1249
|
s.ie = s.ae === undefined ? w : s.ae;
|
|
1206
|
-
|
|
1250
|
+
B.add(s);
|
|
1207
1251
|
}
|
|
1208
1252
|
}
|
|
1209
1253
|
return s;
|
|
1210
1254
|
}
|
|
1211
1255
|
function signal(e, t, n = null) {
|
|
1212
1256
|
const r = {
|
|
1213
|
-
|
|
1257
|
+
me: t?.equals != null ? t.equals : isEqual,
|
|
1214
1258
|
Fe: !!t?.pureWrite,
|
|
1215
1259
|
Pe: t?.unobserved,
|
|
1216
1260
|
ae: e,
|
|
1217
1261
|
O: null,
|
|
1218
|
-
|
|
1219
|
-
$:
|
|
1262
|
+
xe: null,
|
|
1263
|
+
$: k,
|
|
1220
1264
|
I: n,
|
|
1221
|
-
|
|
1265
|
+
j: n?.C || null,
|
|
1222
1266
|
ce: S
|
|
1223
1267
|
};
|
|
1224
|
-
n && (n.
|
|
1225
|
-
if (
|
|
1268
|
+
n && (n.C = r);
|
|
1269
|
+
if (D && !r.Fe && !((n?.de ?? 0) & a)) {
|
|
1226
1270
|
r.ie = e === undefined ? w : e;
|
|
1227
|
-
|
|
1271
|
+
B.add(r);
|
|
1228
1272
|
}
|
|
1229
1273
|
return r;
|
|
1230
1274
|
}
|
|
1231
1275
|
function optimisticSignal(e, t) {
|
|
1232
1276
|
const n = signal(e, t);
|
|
1233
|
-
n.
|
|
1277
|
+
n.pe = S;
|
|
1234
1278
|
return n;
|
|
1235
1279
|
}
|
|
1236
1280
|
function optimisticComputed(e, t, n) {
|
|
1237
1281
|
const r = computed(e, t, n);
|
|
1238
|
-
r.
|
|
1282
|
+
r.pe = S;
|
|
1239
1283
|
return r;
|
|
1240
1284
|
}
|
|
1241
1285
|
function isEqual(e, t) {
|
|
1242
1286
|
return e === t;
|
|
1243
1287
|
}
|
|
1244
1288
|
function untrack(e, t) {
|
|
1245
|
-
if (!I && true) return e();
|
|
1246
|
-
const n =
|
|
1247
|
-
|
|
1289
|
+
if (!I && !H && true) return e();
|
|
1290
|
+
const n = H;
|
|
1291
|
+
H = false;
|
|
1248
1292
|
try {
|
|
1293
|
+
if (I) return I.untrack(e);
|
|
1249
1294
|
return e();
|
|
1250
1295
|
} finally {
|
|
1251
|
-
|
|
1296
|
+
H = n;
|
|
1252
1297
|
}
|
|
1253
1298
|
}
|
|
1254
1299
|
function read(e) {
|
|
1255
|
-
if (
|
|
1300
|
+
if (F) {
|
|
1256
1301
|
const t = getLatestValueComputed(e);
|
|
1257
|
-
const n =
|
|
1258
|
-
|
|
1259
|
-
|
|
1302
|
+
const n = F;
|
|
1303
|
+
F = false;
|
|
1304
|
+
const r = e.pe !== undefined && e.pe !== S ? e.pe : e.ae;
|
|
1305
|
+
let i;
|
|
1260
1306
|
try {
|
|
1261
|
-
|
|
1262
|
-
} catch (
|
|
1263
|
-
if (!
|
|
1264
|
-
throw
|
|
1307
|
+
i = read(t);
|
|
1308
|
+
} catch (e) {
|
|
1309
|
+
if (!M && e instanceof NotReadyError) return r;
|
|
1310
|
+
throw e;
|
|
1265
1311
|
} finally {
|
|
1266
|
-
|
|
1312
|
+
F = n;
|
|
1267
1313
|
}
|
|
1268
|
-
if (t.de & a) return
|
|
1269
|
-
if (
|
|
1270
|
-
const
|
|
1271
|
-
const
|
|
1272
|
-
if (
|
|
1273
|
-
return
|
|
1314
|
+
if (t.de & a) return r;
|
|
1315
|
+
if (R && V && t.re) {
|
|
1316
|
+
const e = findLane(t.re);
|
|
1317
|
+
const n = findLane(V);
|
|
1318
|
+
if (e !== n && e.T.size > 0) {
|
|
1319
|
+
return r;
|
|
1274
1320
|
}
|
|
1275
1321
|
}
|
|
1276
|
-
return
|
|
1322
|
+
return i;
|
|
1277
1323
|
}
|
|
1278
|
-
if (
|
|
1324
|
+
if (T) {
|
|
1279
1325
|
const t = e.I || e;
|
|
1280
1326
|
const n = getPendingSignal(t);
|
|
1281
|
-
const r =
|
|
1282
|
-
|
|
1327
|
+
const r = T;
|
|
1328
|
+
T = false;
|
|
1283
1329
|
if (read(n)) {
|
|
1284
|
-
|
|
1330
|
+
q = true;
|
|
1285
1331
|
}
|
|
1286
|
-
|
|
1332
|
+
T = r;
|
|
1287
1333
|
return e.ae;
|
|
1288
1334
|
}
|
|
1289
|
-
let t =
|
|
1335
|
+
let t = M;
|
|
1290
1336
|
if (t?.t) t = t.u;
|
|
1291
|
-
if (
|
|
1337
|
+
if (Q && e.H) recompute(e);
|
|
1292
1338
|
if (e.m & c) {
|
|
1293
1339
|
e.m &= ~c;
|
|
1294
1340
|
recompute(e, true);
|
|
1295
1341
|
}
|
|
1296
1342
|
const n = e.I || e;
|
|
1297
|
-
if (t &&
|
|
1343
|
+
if (t && H) {
|
|
1298
1344
|
if (e.H && e.m & u) recompute(e);
|
|
1299
1345
|
link(e, t);
|
|
1300
1346
|
if (n.H) {
|
|
1301
1347
|
const r = e.m & o;
|
|
1302
|
-
if (n.o >= (r ?
|
|
1348
|
+
if (n.o >= (r ? v.A : P.A)) {
|
|
1303
1349
|
markNode(t);
|
|
1304
|
-
markHeap(r ?
|
|
1350
|
+
markHeap(r ? v : P);
|
|
1305
1351
|
updateIfNecessary(n);
|
|
1306
1352
|
}
|
|
1307
1353
|
const i = n.o;
|
|
@@ -1311,16 +1357,18 @@ function read(e) {
|
|
|
1311
1357
|
}
|
|
1312
1358
|
}
|
|
1313
1359
|
if (n.de & a) {
|
|
1314
|
-
|
|
1315
|
-
|
|
1360
|
+
const r = n.Y?.source;
|
|
1361
|
+
if (r && !(r.de & a)) clearStatus(n);
|
|
1362
|
+
else if (t && !(R && n.ne && C !== n.ne)) {
|
|
1363
|
+
if (V) {
|
|
1316
1364
|
const r = n.re;
|
|
1317
|
-
const i = findLane(
|
|
1365
|
+
const i = findLane(V);
|
|
1318
1366
|
if (r && findLane(r) === i && !hasActiveOverride(n)) {
|
|
1319
|
-
if (!
|
|
1367
|
+
if (!H && e !== t) link(e, t);
|
|
1320
1368
|
throw n.Y;
|
|
1321
1369
|
}
|
|
1322
1370
|
} else {
|
|
1323
|
-
if (!
|
|
1371
|
+
if (!H && e !== t) link(e, t);
|
|
1324
1372
|
throw n.Y;
|
|
1325
1373
|
}
|
|
1326
1374
|
} else if (!t && n.de & p) {
|
|
@@ -1328,12 +1376,12 @@ function read(e) {
|
|
|
1328
1376
|
}
|
|
1329
1377
|
}
|
|
1330
1378
|
if (e.H && e.de & d) {
|
|
1331
|
-
if (e.$ <
|
|
1379
|
+
if (e.$ < k) {
|
|
1332
1380
|
recompute(e, true);
|
|
1333
1381
|
return read(e);
|
|
1334
1382
|
} else throw e.Y;
|
|
1335
1383
|
}
|
|
1336
|
-
if (
|
|
1384
|
+
if (D && t && t.se) {
|
|
1337
1385
|
const n = e.ie;
|
|
1338
1386
|
if (n !== undefined) {
|
|
1339
1387
|
const r = n === w ? undefined : n;
|
|
@@ -1342,81 +1390,79 @@ function read(e) {
|
|
|
1342
1390
|
return r;
|
|
1343
1391
|
}
|
|
1344
1392
|
}
|
|
1393
|
+
if (e.pe !== undefined && e.pe !== S) return e.pe;
|
|
1345
1394
|
return !t ||
|
|
1346
|
-
(
|
|
1395
|
+
(V !== null && (e.pe !== undefined || e.re || n === e || !!(n.de & a))) ||
|
|
1347
1396
|
e.ce === S ||
|
|
1348
|
-
(
|
|
1397
|
+
(R && e.ne && C !== e.ne)
|
|
1349
1398
|
? e.ae
|
|
1350
1399
|
: e.ce;
|
|
1351
1400
|
}
|
|
1352
1401
|
function setSignal(e, t) {
|
|
1353
|
-
if (e.ne &&
|
|
1354
|
-
const n = e.
|
|
1355
|
-
const r =
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1402
|
+
if (e.ne && C !== e.ne) A.initTransition(e.ne);
|
|
1403
|
+
const n = e.pe !== undefined && !j;
|
|
1404
|
+
const r = e.pe !== undefined && e.pe !== S;
|
|
1405
|
+
const i = n ? (r ? e.pe : e.ae) : e.ce === S ? e.ae : e.ce;
|
|
1406
|
+
if (typeof t === "function") t = t(i);
|
|
1407
|
+
const s = !e.me || !e.me(i, t) || !!(e.de & p);
|
|
1408
|
+
if (!s) {
|
|
1409
|
+
if (n && r && e.H) {
|
|
1360
1410
|
insertSubs(e, true);
|
|
1361
1411
|
schedule();
|
|
1362
1412
|
}
|
|
1363
1413
|
return t;
|
|
1364
1414
|
}
|
|
1365
1415
|
if (n) {
|
|
1366
|
-
const n =
|
|
1367
|
-
if (e.ne
|
|
1368
|
-
|
|
1369
|
-
}
|
|
1370
|
-
if (e.ce === S) {
|
|
1416
|
+
const n = e.pe === S;
|
|
1417
|
+
if (!n && e.ne) A.initTransition(e.ne);
|
|
1418
|
+
if (n) {
|
|
1371
1419
|
e.ce = e.ae;
|
|
1420
|
+
A.B.push(e);
|
|
1372
1421
|
}
|
|
1373
|
-
|
|
1374
|
-
j.B.push(e);
|
|
1375
|
-
}
|
|
1376
|
-
e.Se = (e.Se || 0) + 1;
|
|
1422
|
+
e.Se = true;
|
|
1377
1423
|
const r = getOrCreateLane(e);
|
|
1378
1424
|
e.re = r;
|
|
1379
|
-
e.
|
|
1425
|
+
e.pe = t;
|
|
1380
1426
|
} else {
|
|
1381
|
-
if (e.ce === S)
|
|
1427
|
+
if (e.ce === S) A.D.push(e);
|
|
1382
1428
|
e.ce = t;
|
|
1383
1429
|
}
|
|
1384
1430
|
updatePendingSignal(e);
|
|
1385
|
-
if (e.
|
|
1386
|
-
setSignal(e.
|
|
1431
|
+
if (e.be) {
|
|
1432
|
+
setSignal(e.be, t);
|
|
1387
1433
|
}
|
|
1388
|
-
e.$ =
|
|
1434
|
+
e.$ = k;
|
|
1389
1435
|
insertSubs(e, n);
|
|
1390
1436
|
schedule();
|
|
1391
1437
|
return t;
|
|
1392
1438
|
}
|
|
1393
1439
|
function runWithOwner(e, t) {
|
|
1394
|
-
const n =
|
|
1395
|
-
const r =
|
|
1396
|
-
|
|
1397
|
-
|
|
1440
|
+
const n = M;
|
|
1441
|
+
const r = H;
|
|
1442
|
+
M = e;
|
|
1443
|
+
H = false;
|
|
1398
1444
|
try {
|
|
1399
1445
|
return t();
|
|
1400
1446
|
} finally {
|
|
1401
|
-
|
|
1402
|
-
|
|
1447
|
+
M = n;
|
|
1448
|
+
H = r;
|
|
1403
1449
|
}
|
|
1404
1450
|
}
|
|
1405
1451
|
function getPendingSignal(e) {
|
|
1406
|
-
if (!e.
|
|
1407
|
-
e.
|
|
1408
|
-
if (e.
|
|
1409
|
-
e.
|
|
1452
|
+
if (!e.Me) {
|
|
1453
|
+
e.Me = optimisticSignal(false, { pureWrite: true });
|
|
1454
|
+
if (e.ye) {
|
|
1455
|
+
e.Me.ye = e;
|
|
1410
1456
|
}
|
|
1411
|
-
if (computePendingState(e)) setSignal(e.
|
|
1457
|
+
if (computePendingState(e)) setSignal(e.Me, true);
|
|
1412
1458
|
}
|
|
1413
|
-
return e.
|
|
1459
|
+
return e.Me;
|
|
1414
1460
|
}
|
|
1415
1461
|
function computePendingState(e) {
|
|
1416
1462
|
const t = e;
|
|
1417
|
-
if (e.
|
|
1463
|
+
if (e.pe !== undefined && e.pe !== S) {
|
|
1418
1464
|
if (t.de & a && !(t.de & p)) return true;
|
|
1419
|
-
if (e.
|
|
1465
|
+
if (e.ye) {
|
|
1420
1466
|
const t = e.re ? findLane(e.re) : null;
|
|
1421
1467
|
return !!(t && t.T.size > 0);
|
|
1422
1468
|
}
|
|
@@ -1426,9 +1472,9 @@ function computePendingState(e) {
|
|
|
1426
1472
|
return !!(t.de & a && !(t.de & p));
|
|
1427
1473
|
}
|
|
1428
1474
|
function updatePendingSignal(e) {
|
|
1429
|
-
if (e.
|
|
1475
|
+
if (e.Me) {
|
|
1430
1476
|
const t = computePendingState(e);
|
|
1431
|
-
const n = e.
|
|
1477
|
+
const n = e.Me;
|
|
1432
1478
|
setSignal(n, t);
|
|
1433
1479
|
if (!t && n.re) {
|
|
1434
1480
|
const t = resolveLane(e);
|
|
@@ -1444,57 +1490,57 @@ function updatePendingSignal(e) {
|
|
|
1444
1490
|
}
|
|
1445
1491
|
}
|
|
1446
1492
|
function getLatestValueComputed(e) {
|
|
1447
|
-
if (!e.
|
|
1448
|
-
const t =
|
|
1449
|
-
|
|
1450
|
-
const n =
|
|
1451
|
-
|
|
1452
|
-
const r =
|
|
1453
|
-
|
|
1454
|
-
e.
|
|
1455
|
-
e.
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
}
|
|
1460
|
-
return e.
|
|
1493
|
+
if (!e.be) {
|
|
1494
|
+
const t = F;
|
|
1495
|
+
F = false;
|
|
1496
|
+
const n = T;
|
|
1497
|
+
T = false;
|
|
1498
|
+
const r = M;
|
|
1499
|
+
M = null;
|
|
1500
|
+
e.be = optimisticComputed(() => read(e));
|
|
1501
|
+
e.be.ye = e;
|
|
1502
|
+
M = r;
|
|
1503
|
+
T = n;
|
|
1504
|
+
F = t;
|
|
1505
|
+
}
|
|
1506
|
+
return e.be;
|
|
1461
1507
|
}
|
|
1462
1508
|
function staleValues(e, t = true) {
|
|
1463
|
-
const n =
|
|
1464
|
-
|
|
1509
|
+
const n = R;
|
|
1510
|
+
R = t;
|
|
1465
1511
|
try {
|
|
1466
1512
|
return e();
|
|
1467
1513
|
} finally {
|
|
1468
|
-
|
|
1514
|
+
R = n;
|
|
1469
1515
|
}
|
|
1470
1516
|
}
|
|
1471
1517
|
function latest(e) {
|
|
1472
|
-
const t =
|
|
1473
|
-
|
|
1518
|
+
const t = F;
|
|
1519
|
+
F = true;
|
|
1474
1520
|
try {
|
|
1475
1521
|
return e();
|
|
1476
1522
|
} finally {
|
|
1477
|
-
|
|
1523
|
+
F = t;
|
|
1478
1524
|
}
|
|
1479
1525
|
}
|
|
1480
1526
|
function isPending(e) {
|
|
1481
|
-
const t =
|
|
1482
|
-
const n =
|
|
1483
|
-
|
|
1484
|
-
|
|
1527
|
+
const t = T;
|
|
1528
|
+
const n = q;
|
|
1529
|
+
T = true;
|
|
1530
|
+
q = false;
|
|
1485
1531
|
try {
|
|
1486
1532
|
e();
|
|
1487
|
-
return
|
|
1533
|
+
return q;
|
|
1488
1534
|
} catch {
|
|
1489
|
-
return
|
|
1535
|
+
return q;
|
|
1490
1536
|
} finally {
|
|
1491
|
-
|
|
1492
|
-
|
|
1537
|
+
T = t;
|
|
1538
|
+
q = n;
|
|
1493
1539
|
}
|
|
1494
1540
|
}
|
|
1495
1541
|
function refresh(e) {
|
|
1496
|
-
let t =
|
|
1497
|
-
|
|
1542
|
+
let t = Q;
|
|
1543
|
+
Q = true;
|
|
1498
1544
|
try {
|
|
1499
1545
|
if (typeof e !== "function") {
|
|
1500
1546
|
recompute(e[O]);
|
|
@@ -1502,14 +1548,14 @@ function refresh(e) {
|
|
|
1502
1548
|
}
|
|
1503
1549
|
return untrack(e);
|
|
1504
1550
|
} finally {
|
|
1505
|
-
|
|
1551
|
+
Q = t;
|
|
1506
1552
|
if (!t) {
|
|
1507
1553
|
schedule();
|
|
1508
1554
|
}
|
|
1509
1555
|
}
|
|
1510
1556
|
}
|
|
1511
1557
|
function isRefreshing() {
|
|
1512
|
-
return
|
|
1558
|
+
return Q;
|
|
1513
1559
|
}
|
|
1514
1560
|
function createContext(e, t) {
|
|
1515
1561
|
return { id: Symbol(t), defaultValue: e };
|
|
@@ -1518,7 +1564,7 @@ function getContext(e, t = getOwner()) {
|
|
|
1518
1564
|
if (!t) {
|
|
1519
1565
|
throw new NoOwnerError();
|
|
1520
1566
|
}
|
|
1521
|
-
const n = hasContext(e, t) ? t.
|
|
1567
|
+
const n = hasContext(e, t) ? t.Ie[e.id] : e.defaultValue;
|
|
1522
1568
|
if (isUndefined(n)) {
|
|
1523
1569
|
throw new ContextNotFoundError();
|
|
1524
1570
|
}
|
|
@@ -1528,16 +1574,16 @@ function setContext(e, t, n = getOwner()) {
|
|
|
1528
1574
|
if (!n) {
|
|
1529
1575
|
throw new NoOwnerError();
|
|
1530
1576
|
}
|
|
1531
|
-
n.
|
|
1577
|
+
n.Ie = { ...n.Ie, [e.id]: isUndefined(t) ? e.defaultValue : t };
|
|
1532
1578
|
}
|
|
1533
1579
|
function hasContext(e, t) {
|
|
1534
|
-
return !isUndefined(t?.
|
|
1580
|
+
return !isUndefined(t?.Ie[e.id]);
|
|
1535
1581
|
}
|
|
1536
1582
|
function isUndefined(e) {
|
|
1537
1583
|
return typeof e === "undefined";
|
|
1538
1584
|
}
|
|
1539
1585
|
function restoreTransition(e, t) {
|
|
1540
|
-
|
|
1586
|
+
A.initTransition(e);
|
|
1541
1587
|
const n = t();
|
|
1542
1588
|
flush();
|
|
1543
1589
|
return n;
|
|
@@ -1546,8 +1592,8 @@ function action(e) {
|
|
|
1546
1592
|
return (...t) =>
|
|
1547
1593
|
new Promise((n, r) => {
|
|
1548
1594
|
const i = e(...t);
|
|
1549
|
-
|
|
1550
|
-
let s =
|
|
1595
|
+
A.initTransition();
|
|
1596
|
+
let s = C;
|
|
1551
1597
|
s.ee.push(i);
|
|
1552
1598
|
const done = (e, t) => {
|
|
1553
1599
|
s = currentTransition(s);
|
|
@@ -1580,17 +1626,22 @@ function action(e) {
|
|
|
1580
1626
|
step();
|
|
1581
1627
|
});
|
|
1582
1628
|
}
|
|
1629
|
+
function accessor(e) {
|
|
1630
|
+
const t = read.bind(null, e);
|
|
1631
|
+
t.$r = true;
|
|
1632
|
+
return t;
|
|
1633
|
+
}
|
|
1583
1634
|
function createSignal(e, t, n) {
|
|
1584
1635
|
if (typeof e === "function") {
|
|
1585
1636
|
const r = computed(e, t, n);
|
|
1586
|
-
return [
|
|
1637
|
+
return [accessor(r), setSignal.bind(null, r)];
|
|
1587
1638
|
}
|
|
1588
1639
|
const r = signal(e, t);
|
|
1589
|
-
return [
|
|
1640
|
+
return [accessor(r), setSignal.bind(null, r)];
|
|
1590
1641
|
}
|
|
1591
1642
|
function createMemo(e, t, n) {
|
|
1592
1643
|
let r = computed(e, t, n);
|
|
1593
|
-
return
|
|
1644
|
+
return accessor(r);
|
|
1594
1645
|
}
|
|
1595
1646
|
function createEffect(e, t, n, r) {
|
|
1596
1647
|
effect(e, t.effect || t, t.error, n, r);
|
|
@@ -1638,18 +1689,18 @@ function resolve(e) {
|
|
|
1638
1689
|
}
|
|
1639
1690
|
function createOptimistic(e, t, n) {
|
|
1640
1691
|
const r = typeof e === "function" ? optimisticComputed(e, t, n) : optimisticSignal(e, t);
|
|
1641
|
-
return [
|
|
1692
|
+
return [accessor(r), setSignal.bind(null, r)];
|
|
1642
1693
|
}
|
|
1643
1694
|
function onSettled(e) {
|
|
1644
1695
|
getOwner()
|
|
1645
1696
|
? createTrackedEffect(() => untrack(e))
|
|
1646
|
-
:
|
|
1697
|
+
: A.enqueue(y, () => {
|
|
1647
1698
|
const t = e();
|
|
1648
1699
|
t?.();
|
|
1649
1700
|
});
|
|
1650
1701
|
}
|
|
1651
1702
|
function unwrap(e) {
|
|
1652
|
-
return e?.[z]?.[
|
|
1703
|
+
return e?.[z]?.[$] ?? e;
|
|
1653
1704
|
}
|
|
1654
1705
|
function getOverrideValue(e, t, n, r, i) {
|
|
1655
1706
|
if (i && r in i) return i[r];
|
|
@@ -1660,135 +1711,135 @@ function getAllKeys(e, t, n) {
|
|
|
1660
1711
|
const i = Object.keys(n);
|
|
1661
1712
|
return Array.from(new Set([...r, ...i]));
|
|
1662
1713
|
}
|
|
1663
|
-
function applyState(e, t, n
|
|
1664
|
-
const
|
|
1665
|
-
if (!
|
|
1666
|
-
const
|
|
1667
|
-
const
|
|
1668
|
-
const
|
|
1669
|
-
let
|
|
1670
|
-
if (e ===
|
|
1671
|
-
(
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
if (Array.isArray(
|
|
1714
|
+
function applyState(e, t, n) {
|
|
1715
|
+
const r = t?.[z];
|
|
1716
|
+
if (!r) return;
|
|
1717
|
+
const i = r[X];
|
|
1718
|
+
const s = r[Y];
|
|
1719
|
+
const o = r[Z];
|
|
1720
|
+
let u = r[$];
|
|
1721
|
+
if (e === i && !s && !o) return;
|
|
1722
|
+
(r[ne] || se).set(e, r[U]);
|
|
1723
|
+
r[X] = e;
|
|
1724
|
+
r[Y] = undefined;
|
|
1725
|
+
if (Array.isArray(i)) {
|
|
1675
1726
|
let t = false;
|
|
1676
|
-
const
|
|
1677
|
-
if (e.length &&
|
|
1678
|
-
let c, a, d, p, h, y, g
|
|
1727
|
+
const f = getOverrideValue(i, s, u, "length", o);
|
|
1728
|
+
if (e.length && f && e[0] && n(e[0]) != null) {
|
|
1729
|
+
let l, c, a, d, p, h, y, g;
|
|
1679
1730
|
for (
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
((
|
|
1683
|
-
|
|
1731
|
+
a = 0, d = Math.min(f, e.length);
|
|
1732
|
+
a < d &&
|
|
1733
|
+
((h = getOverrideValue(i, s, u, a, o)) === e[a] || (h && e[a] && n(h) === n(e[a])));
|
|
1734
|
+
a++
|
|
1684
1735
|
) {
|
|
1685
|
-
applyState(e[
|
|
1736
|
+
applyState(e[a], wrap(h, r), n);
|
|
1686
1737
|
}
|
|
1687
|
-
const
|
|
1688
|
-
|
|
1738
|
+
const S = new Array(e.length),
|
|
1739
|
+
w = new Map();
|
|
1689
1740
|
for (
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
((
|
|
1694
|
-
|
|
1741
|
+
d = f - 1, p = e.length - 1;
|
|
1742
|
+
d >= a &&
|
|
1743
|
+
p >= a &&
|
|
1744
|
+
((h = getOverrideValue(i, s, u, d, o)) === e[p] || (h && e[p] && n(h) === n(e[p])));
|
|
1745
|
+
d--, p--
|
|
1695
1746
|
) {
|
|
1696
|
-
|
|
1747
|
+
S[p] = h;
|
|
1697
1748
|
}
|
|
1698
|
-
if (
|
|
1699
|
-
for (
|
|
1749
|
+
if (a > p || a > d) {
|
|
1750
|
+
for (c = a; c <= p; c++) {
|
|
1700
1751
|
t = true;
|
|
1701
|
-
|
|
1752
|
+
r[$][c] && setSignal(r[$][c], wrap(e[c], r));
|
|
1702
1753
|
}
|
|
1703
|
-
for (;
|
|
1754
|
+
for (; c < e.length; c++) {
|
|
1704
1755
|
t = true;
|
|
1705
|
-
const
|
|
1706
|
-
|
|
1707
|
-
applyState(e[
|
|
1756
|
+
const i = wrap(S[c], r);
|
|
1757
|
+
r[$][c] && setSignal(r[$][c], i);
|
|
1758
|
+
applyState(e[c], i, n);
|
|
1708
1759
|
}
|
|
1709
|
-
t &&
|
|
1710
|
-
|
|
1760
|
+
t && r[$][K] && setSignal(r[$][K], void 0);
|
|
1761
|
+
f !== e.length && r[$].length && setSignal(r[$].length, e.length);
|
|
1711
1762
|
return;
|
|
1712
1763
|
}
|
|
1713
|
-
|
|
1714
|
-
for (
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
}
|
|
1721
|
-
for (
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
if (
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1764
|
+
y = new Array(p + 1);
|
|
1765
|
+
for (c = p; c >= a; c--) {
|
|
1766
|
+
h = e[c];
|
|
1767
|
+
g = h ? n(h) : h;
|
|
1768
|
+
l = w.get(g);
|
|
1769
|
+
y[c] = l === undefined ? -1 : l;
|
|
1770
|
+
w.set(g, c);
|
|
1771
|
+
}
|
|
1772
|
+
for (l = a; l <= d; l++) {
|
|
1773
|
+
h = getOverrideValue(i, s, u, l, o);
|
|
1774
|
+
g = h ? n(h) : h;
|
|
1775
|
+
c = w.get(g);
|
|
1776
|
+
if (c !== undefined && c !== -1) {
|
|
1777
|
+
S[c] = h;
|
|
1778
|
+
c = y[c];
|
|
1779
|
+
w.set(g, c);
|
|
1729
1780
|
}
|
|
1730
1781
|
}
|
|
1731
|
-
for (
|
|
1732
|
-
if (
|
|
1733
|
-
const t = wrap(
|
|
1734
|
-
|
|
1735
|
-
applyState(e[
|
|
1736
|
-
} else
|
|
1782
|
+
for (c = a; c < e.length; c++) {
|
|
1783
|
+
if (c in S) {
|
|
1784
|
+
const t = wrap(S[c], r);
|
|
1785
|
+
r[$][c] && setSignal(r[$][c], t);
|
|
1786
|
+
applyState(e[c], t, n);
|
|
1787
|
+
} else r[$][c] && setSignal(r[$][c], wrap(e[c], r));
|
|
1737
1788
|
}
|
|
1738
|
-
if (
|
|
1789
|
+
if (a < e.length) t = true;
|
|
1739
1790
|
} else if (e.length) {
|
|
1740
|
-
for (let t = 0,
|
|
1741
|
-
const
|
|
1742
|
-
isWrappable(
|
|
1791
|
+
for (let t = 0, f = e.length; t < f; t++) {
|
|
1792
|
+
const f = getOverrideValue(i, s, u, t, o);
|
|
1793
|
+
isWrappable(f) ? applyState(e[t], wrap(f, r), n) : r[$][t] && setSignal(r[$][t], e[t]);
|
|
1743
1794
|
}
|
|
1744
1795
|
}
|
|
1745
|
-
if (
|
|
1796
|
+
if (f !== e.length) {
|
|
1746
1797
|
t = true;
|
|
1747
|
-
|
|
1798
|
+
r[$].length && setSignal(r[$].length, e.length);
|
|
1748
1799
|
}
|
|
1749
|
-
t &&
|
|
1800
|
+
t && r[$][K] && setSignal(r[$][K], void 0);
|
|
1750
1801
|
return;
|
|
1751
1802
|
}
|
|
1752
|
-
if (
|
|
1753
|
-
const t =
|
|
1754
|
-
const
|
|
1755
|
-
for (let
|
|
1756
|
-
const
|
|
1757
|
-
const
|
|
1758
|
-
const
|
|
1759
|
-
let
|
|
1760
|
-
if (
|
|
1761
|
-
if (!
|
|
1803
|
+
if (u) {
|
|
1804
|
+
const t = u[K];
|
|
1805
|
+
const f = t ? getAllKeys(i, s, e) : Object.keys(u);
|
|
1806
|
+
for (let l = 0, c = f.length; l < c; l++) {
|
|
1807
|
+
const c = f[l];
|
|
1808
|
+
const a = u[c];
|
|
1809
|
+
const d = unwrap(getOverrideValue(i, s, u, c, o));
|
|
1810
|
+
let p = unwrap(e[c]);
|
|
1811
|
+
if (d === p) continue;
|
|
1812
|
+
if (!d || !isWrappable(d) || !isWrappable(p) || (n(d) != null && n(d) !== n(p))) {
|
|
1762
1813
|
t && setSignal(t, void 0);
|
|
1763
|
-
|
|
1764
|
-
} else applyState(
|
|
1814
|
+
a && setSignal(a, isWrappable(p) ? wrap(p, r) : p);
|
|
1815
|
+
} else applyState(p, wrap(d, r), n);
|
|
1765
1816
|
}
|
|
1766
1817
|
}
|
|
1767
|
-
if ((
|
|
1768
|
-
const t = Object.keys(
|
|
1818
|
+
if ((u = r[ee])) {
|
|
1819
|
+
const t = Object.keys(u);
|
|
1769
1820
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
1770
1821
|
const r = t[n];
|
|
1771
|
-
setSignal(
|
|
1822
|
+
setSignal(u[r], r in e);
|
|
1772
1823
|
}
|
|
1773
1824
|
}
|
|
1774
1825
|
}
|
|
1775
|
-
function reconcile(e, t
|
|
1776
|
-
return
|
|
1777
|
-
if (
|
|
1778
|
-
const
|
|
1779
|
-
const
|
|
1780
|
-
if (
|
|
1826
|
+
function reconcile(e, t) {
|
|
1827
|
+
return n => {
|
|
1828
|
+
if (n == null) throw new Error("Cannot reconcile null or undefined state");
|
|
1829
|
+
const r = typeof t === "string" ? e => e[t] : t;
|
|
1830
|
+
const i = r(n);
|
|
1831
|
+
if (i !== undefined && r(e) !== r(n))
|
|
1781
1832
|
throw new Error("Cannot reconcile states with different identity");
|
|
1782
|
-
applyState(e,
|
|
1833
|
+
applyState(e, n, r);
|
|
1783
1834
|
};
|
|
1784
1835
|
}
|
|
1785
1836
|
function createProjectionInternal(e, t = {}, n) {
|
|
1786
1837
|
let r;
|
|
1787
1838
|
const i = new WeakMap();
|
|
1788
1839
|
const wrapper = e => {
|
|
1789
|
-
e[
|
|
1790
|
-
e[
|
|
1791
|
-
Object.defineProperty(e,
|
|
1840
|
+
e[te] = wrapProjection;
|
|
1841
|
+
e[ne] = i;
|
|
1842
|
+
Object.defineProperty(e, re, {
|
|
1792
1843
|
get() {
|
|
1793
1844
|
return r;
|
|
1794
1845
|
},
|
|
@@ -1797,28 +1848,28 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1797
1848
|
};
|
|
1798
1849
|
const wrapProjection = e => {
|
|
1799
1850
|
if (i.has(e)) return i.get(e);
|
|
1800
|
-
if (e[z]?.[
|
|
1801
|
-
const t = createStoreProxy(e,
|
|
1851
|
+
if (e[z]?.[te] === wrapProjection) return e;
|
|
1852
|
+
const t = createStoreProxy(e, fe, wrapper);
|
|
1802
1853
|
i.set(e, t);
|
|
1803
1854
|
return t;
|
|
1804
1855
|
};
|
|
1805
1856
|
const s = wrapProjection(t);
|
|
1806
1857
|
r = computed(() => {
|
|
1807
1858
|
const t = getOwner();
|
|
1808
|
-
storeSetter(new Proxy(s,
|
|
1859
|
+
storeSetter(new Proxy(s, G), r => {
|
|
1809
1860
|
const i = handleAsync(t, e(r), e => {
|
|
1810
|
-
e !== r && e !== undefined && storeSetter(s, reconcile(e, n?.key || "id"
|
|
1861
|
+
e !== r && e !== undefined && storeSetter(s, reconcile(e, n?.key || "id"));
|
|
1811
1862
|
});
|
|
1812
|
-
i !== r && i !== undefined && reconcile(i, n?.key || "id"
|
|
1863
|
+
i !== r && i !== undefined && reconcile(i, n?.key || "id")(s);
|
|
1813
1864
|
});
|
|
1814
1865
|
});
|
|
1815
|
-
r.
|
|
1866
|
+
r.ve = true;
|
|
1816
1867
|
return { store: s, node: r };
|
|
1817
1868
|
}
|
|
1818
1869
|
function createProjection(e, t = {}, n) {
|
|
1819
1870
|
return createProjectionInternal(e, t, n).store;
|
|
1820
1871
|
}
|
|
1821
|
-
const
|
|
1872
|
+
const G = {
|
|
1822
1873
|
get(e, t) {
|
|
1823
1874
|
let n;
|
|
1824
1875
|
setWriteOverride(true);
|
|
@@ -1829,7 +1880,7 @@ const B = {
|
|
|
1829
1880
|
setWriteOverride(false);
|
|
1830
1881
|
setProjectionWriteActive(false);
|
|
1831
1882
|
}
|
|
1832
|
-
return typeof n === "object" && n !== null ? new Proxy(n,
|
|
1883
|
+
return typeof n === "object" && n !== null ? new Proxy(n, G) : n;
|
|
1833
1884
|
},
|
|
1834
1885
|
set(e, t, n) {
|
|
1835
1886
|
setWriteOverride(true);
|
|
@@ -1854,22 +1905,20 @@ const B = {
|
|
|
1854
1905
|
return true;
|
|
1855
1906
|
}
|
|
1856
1907
|
};
|
|
1857
|
-
const
|
|
1858
|
-
K = Symbol(0),
|
|
1908
|
+
const K = Symbol(0),
|
|
1859
1909
|
z = Symbol(0),
|
|
1860
1910
|
U = Symbol(0),
|
|
1861
1911
|
J = Symbol(0);
|
|
1862
|
-
const X =
|
|
1863
|
-
|
|
1864
|
-
Z = "
|
|
1865
|
-
$ = "
|
|
1866
|
-
ee = "
|
|
1867
|
-
te = "
|
|
1868
|
-
ne = "
|
|
1869
|
-
re = "
|
|
1870
|
-
ie = "
|
|
1871
|
-
|
|
1872
|
-
function createStoreProxy(e, t = le, n) {
|
|
1912
|
+
const X = "v",
|
|
1913
|
+
Y = "o",
|
|
1914
|
+
Z = "x",
|
|
1915
|
+
$ = "n",
|
|
1916
|
+
ee = "h",
|
|
1917
|
+
te = "w",
|
|
1918
|
+
ne = "l",
|
|
1919
|
+
re = "f",
|
|
1920
|
+
ie = "p";
|
|
1921
|
+
function createStoreProxy(e, t = fe, n) {
|
|
1873
1922
|
let r;
|
|
1874
1923
|
if (Array.isArray(e)) {
|
|
1875
1924
|
r = [];
|
|
@@ -1878,22 +1927,22 @@ function createStoreProxy(e, t = le, n) {
|
|
|
1878
1927
|
n && n(r);
|
|
1879
1928
|
return (r[U] = new Proxy(r, t));
|
|
1880
1929
|
}
|
|
1881
|
-
const
|
|
1930
|
+
const se = new WeakMap();
|
|
1882
1931
|
function wrap(e, t) {
|
|
1883
|
-
if (t?.[
|
|
1884
|
-
let n = e[U] ||
|
|
1885
|
-
if (!n)
|
|
1932
|
+
if (t?.[te]) return t[te](e, t);
|
|
1933
|
+
let n = e[U] || se.get(e);
|
|
1934
|
+
if (!n) se.set(e, (n = createStoreProxy(e)));
|
|
1886
1935
|
return n;
|
|
1887
1936
|
}
|
|
1888
1937
|
function isWrappable(e) {
|
|
1889
1938
|
return e != null && typeof e === "object" && !Object.isFrozen(e);
|
|
1890
1939
|
}
|
|
1891
|
-
let
|
|
1940
|
+
let oe = false;
|
|
1892
1941
|
function setWriteOverride(e) {
|
|
1893
|
-
|
|
1942
|
+
oe = e;
|
|
1894
1943
|
}
|
|
1895
1944
|
function writeOnly(e) {
|
|
1896
|
-
return
|
|
1945
|
+
return oe || !!ue?.has(e);
|
|
1897
1946
|
}
|
|
1898
1947
|
function getNodes(e, t) {
|
|
1899
1948
|
let n = e[t];
|
|
@@ -1912,16 +1961,18 @@ function getNode(e, t, n, r, i = isEqual, s, o) {
|
|
|
1912
1961
|
},
|
|
1913
1962
|
r
|
|
1914
1963
|
);
|
|
1915
|
-
if (s)
|
|
1964
|
+
if (s) {
|
|
1965
|
+
u.pe = S;
|
|
1966
|
+
}
|
|
1916
1967
|
if (o && t in o) {
|
|
1917
1968
|
const e = o[t];
|
|
1918
1969
|
u.ie = e === undefined ? w : e;
|
|
1919
|
-
|
|
1970
|
+
B?.add(u);
|
|
1920
1971
|
}
|
|
1921
1972
|
return (e[t] = u);
|
|
1922
1973
|
}
|
|
1923
|
-
function trackSelf(e, t =
|
|
1924
|
-
getObserver() && read(getNode(getNodes(e,
|
|
1974
|
+
function trackSelf(e, t = K) {
|
|
1975
|
+
getObserver() && read(getNode(getNodes(e, $), t, undefined, e[re], false, e[ie]));
|
|
1925
1976
|
}
|
|
1926
1977
|
function getKeys(e, t, n = true) {
|
|
1927
1978
|
const r = untrack(() => (n ? Object.keys(e) : Reflect.ownKeys(e)));
|
|
@@ -1942,32 +1993,39 @@ function getPropertyDescriptor(e, t, n) {
|
|
|
1942
1993
|
}
|
|
1943
1994
|
return Reflect.getOwnPropertyDescriptor(r, n);
|
|
1944
1995
|
}
|
|
1945
|
-
let
|
|
1946
|
-
const
|
|
1996
|
+
let ue = null;
|
|
1997
|
+
const fe = {
|
|
1947
1998
|
get(e, t, n) {
|
|
1948
1999
|
if (t === z) return e;
|
|
1949
2000
|
if (t === U) return n;
|
|
1950
|
-
if (t === O) return e[
|
|
1951
|
-
if (t ===
|
|
1952
|
-
trackSelf(e
|
|
2001
|
+
if (t === O) return e[re];
|
|
2002
|
+
if (t === K) {
|
|
2003
|
+
trackSelf(e);
|
|
1953
2004
|
return n;
|
|
1954
2005
|
}
|
|
1955
|
-
const r = getNodes(e,
|
|
2006
|
+
const r = getNodes(e, $);
|
|
1956
2007
|
const i = r[t];
|
|
1957
|
-
const s = e[
|
|
1958
|
-
const o = s || (e[
|
|
1959
|
-
const u = !!e[
|
|
1960
|
-
const f = s ? e[
|
|
2008
|
+
const s = e[Z] && t in e[Z];
|
|
2009
|
+
const o = s || (e[Y] && t in e[Y]);
|
|
2010
|
+
const u = !!e[X][z];
|
|
2011
|
+
const f = s ? e[Z] : e[Y] && t in e[Y] ? e[Y] : e[X];
|
|
1961
2012
|
if (!i) {
|
|
1962
2013
|
const e = Object.getOwnPropertyDescriptor(f, t);
|
|
1963
2014
|
if (e && e.get) return e.get.call(n);
|
|
1964
2015
|
}
|
|
1965
2016
|
if (writeOnly(n)) {
|
|
1966
|
-
let n =
|
|
2017
|
+
let n =
|
|
2018
|
+
i && (o || !u)
|
|
2019
|
+
? i.pe !== undefined && i.pe !== S
|
|
2020
|
+
? i.pe
|
|
2021
|
+
: i.ce !== S
|
|
2022
|
+
? i.ce
|
|
2023
|
+
: i.ae
|
|
2024
|
+
: f[t];
|
|
1967
2025
|
n === J && (n = undefined);
|
|
1968
2026
|
if (!isWrappable(n)) return n;
|
|
1969
2027
|
const r = wrap(n, e);
|
|
1970
|
-
|
|
2028
|
+
ue?.add(r);
|
|
1971
2029
|
return r;
|
|
1972
2030
|
}
|
|
1973
2031
|
let l = i ? (o || !u ? read(r[t]) : (read(r[t]), f[t])) : f[t];
|
|
@@ -1975,106 +2033,97 @@ const le = {
|
|
|
1975
2033
|
if (!i) {
|
|
1976
2034
|
if (!o && typeof l === "function" && !f.hasOwnProperty(t)) {
|
|
1977
2035
|
let t;
|
|
1978
|
-
return !Array.isArray(e[
|
|
2036
|
+
return !Array.isArray(e[X]) && (t = Object.getPrototypeOf(e[X])) && t !== Object.prototype
|
|
1979
2037
|
? l.bind(f)
|
|
1980
2038
|
: l;
|
|
1981
2039
|
} else if (getObserver()) {
|
|
1982
|
-
return read(getNode(r, t, isWrappable(l) ? wrap(l, e) : l, e[
|
|
2040
|
+
return read(getNode(r, t, isWrappable(l) ? wrap(l, e) : l, e[re], isEqual, e[ie], e[m]));
|
|
1983
2041
|
}
|
|
1984
2042
|
}
|
|
1985
2043
|
return isWrappable(l) ? wrap(l, e) : l;
|
|
1986
2044
|
},
|
|
1987
2045
|
has(e, t) {
|
|
1988
|
-
if (t === U || t ===
|
|
1989
|
-
const n = e[
|
|
1990
|
-
getObserver() && read(getNode(getNodes(e,
|
|
2046
|
+
if (t === U || t === K || t === "__proto__") return true;
|
|
2047
|
+
const n = e[Z] && t in e[Z] ? e[Z][t] !== J : e[Y] && t in e[Y] ? e[Y][t] !== J : t in e[X];
|
|
2048
|
+
getObserver() && read(getNode(getNodes(e, ee), t, n, e[re], isEqual, e[ie]));
|
|
1991
2049
|
return n;
|
|
1992
2050
|
},
|
|
1993
2051
|
set(e, t, n) {
|
|
1994
2052
|
const r = e[U];
|
|
1995
2053
|
if (writeOnly(r)) {
|
|
1996
|
-
if (e[
|
|
1997
|
-
const t = e[
|
|
2054
|
+
if (e[ie]) {
|
|
2055
|
+
const t = e[re];
|
|
1998
2056
|
if (t?.ne) {
|
|
1999
|
-
|
|
2057
|
+
A.initTransition(t.ne);
|
|
2000
2058
|
}
|
|
2001
2059
|
}
|
|
2002
2060
|
untrack(() => {
|
|
2003
|
-
const i = e[
|
|
2061
|
+
const i = e[X];
|
|
2004
2062
|
const s = i[t];
|
|
2005
|
-
if (
|
|
2063
|
+
if (D && typeof t !== "symbol" && !((e[re]?.de ?? 0) & a)) {
|
|
2006
2064
|
if (!e[m]) {
|
|
2007
2065
|
e[m] = Object.create(null);
|
|
2008
|
-
|
|
2066
|
+
B?.add(e);
|
|
2009
2067
|
}
|
|
2010
2068
|
if (!(t in e[m])) {
|
|
2011
2069
|
e[m][t] = s;
|
|
2012
2070
|
}
|
|
2013
2071
|
}
|
|
2014
|
-
const o = e[
|
|
2015
|
-
const u = o ?
|
|
2072
|
+
const o = e[ie] && !j;
|
|
2073
|
+
const u = o ? Z : Y;
|
|
2016
2074
|
if (o) trackOptimisticStore(r);
|
|
2017
|
-
const f = e[
|
|
2018
|
-
const l = n?.[z]?.[
|
|
2075
|
+
const f = e[Z] && t in e[Z] ? e[Z][t] : e[Y] && t in e[Y] ? e[Y][t] : s;
|
|
2076
|
+
const l = n?.[z]?.[X] ?? n;
|
|
2019
2077
|
if (f === l) return true;
|
|
2020
|
-
const c = e[
|
|
2078
|
+
const c = e[Z]?.length || e[Y]?.length || i.length;
|
|
2021
2079
|
if (l !== undefined && l === s) delete e[u][t];
|
|
2022
2080
|
else (e[u] || (e[u] = Object.create(null)))[t] = l;
|
|
2023
|
-
const
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
}
|
|
2028
|
-
if (recursivelyNotify(r, oe) && a) recursivelyAddParent(l, r);
|
|
2029
|
-
e[te]?.[t] && setSignal(e[te][t], true);
|
|
2030
|
-
const d = getNodes(e, ee);
|
|
2031
|
-
d[t] && setSignal(d[t], () => (a ? wrap(l, e) : l));
|
|
2081
|
+
const d = isWrappable(l);
|
|
2082
|
+
e[ee]?.[t] && setSignal(e[ee][t], true);
|
|
2083
|
+
const p = getNodes(e, $);
|
|
2084
|
+
p[t] && setSignal(p[t], () => (d ? wrap(l, e) : l));
|
|
2032
2085
|
if (Array.isArray(i)) {
|
|
2033
2086
|
if (t === "length") {
|
|
2034
|
-
|
|
2087
|
+
p.length && setSignal(p.length, l);
|
|
2035
2088
|
} else {
|
|
2036
2089
|
const e = parseInt(t) + 1;
|
|
2037
|
-
if (e > c)
|
|
2090
|
+
if (e > c) p.length && setSignal(p.length, e);
|
|
2038
2091
|
}
|
|
2039
2092
|
}
|
|
2040
|
-
|
|
2093
|
+
p[K] && setSignal(p[K], undefined);
|
|
2041
2094
|
});
|
|
2042
2095
|
}
|
|
2043
2096
|
return true;
|
|
2044
2097
|
},
|
|
2045
2098
|
deleteProperty(e, t) {
|
|
2046
|
-
const n = e[
|
|
2047
|
-
const r = e[
|
|
2099
|
+
const n = e[Z]?.[t] === J;
|
|
2100
|
+
const r = e[Y]?.[t] === J;
|
|
2048
2101
|
if (writeOnly(e[U]) && !n && !r) {
|
|
2049
2102
|
untrack(() => {
|
|
2050
|
-
const n = e[
|
|
2051
|
-
const r = n ?
|
|
2103
|
+
const n = e[ie] && !j;
|
|
2104
|
+
const r = n ? Z : Y;
|
|
2052
2105
|
if (n) trackOptimisticStore(e[U]);
|
|
2053
|
-
const i = e[
|
|
2054
|
-
if (t in e[
|
|
2106
|
+
const i = e[Z] && t in e[Z] ? e[Z][t] : e[Y] && t in e[Y] ? e[Y][t] : e[X][t];
|
|
2107
|
+
if (t in e[X] || (e[Y] && t in e[Y])) {
|
|
2055
2108
|
(e[r] || (e[r] = Object.create(null)))[t] = J;
|
|
2056
2109
|
} else if (e[r] && t in e[r]) {
|
|
2057
2110
|
delete e[r][t];
|
|
2058
2111
|
} else return true;
|
|
2059
|
-
if (
|
|
2060
|
-
|
|
2061
|
-
t && (t instanceof Set ? t.delete(e) : X.delete(i));
|
|
2062
|
-
}
|
|
2063
|
-
if (e[te]?.[t]) setSignal(e[te][t], false);
|
|
2064
|
-
const s = getNodes(e, ee);
|
|
2112
|
+
if (e[ee]?.[t]) setSignal(e[ee][t], false);
|
|
2113
|
+
const s = getNodes(e, $);
|
|
2065
2114
|
s[t] && setSignal(s[t], undefined);
|
|
2066
|
-
s[
|
|
2115
|
+
s[K] && setSignal(s[K], undefined);
|
|
2067
2116
|
});
|
|
2068
2117
|
}
|
|
2069
2118
|
return true;
|
|
2070
2119
|
},
|
|
2071
2120
|
ownKeys(e) {
|
|
2072
2121
|
trackSelf(e);
|
|
2073
|
-
let t = getKeys(e[
|
|
2074
|
-
if (e[
|
|
2122
|
+
let t = getKeys(e[X], e[Y], false);
|
|
2123
|
+
if (e[Z]) {
|
|
2075
2124
|
const n = new Set(t);
|
|
2076
|
-
for (const t of Reflect.ownKeys(e[
|
|
2077
|
-
if (e[
|
|
2125
|
+
for (const t of Reflect.ownKeys(e[Z])) {
|
|
2126
|
+
if (e[Z][t] !== J) n.add(t);
|
|
2078
2127
|
else n.delete(t);
|
|
2079
2128
|
}
|
|
2080
2129
|
t = Array.from(n);
|
|
@@ -2083,24 +2132,24 @@ const le = {
|
|
|
2083
2132
|
},
|
|
2084
2133
|
getOwnPropertyDescriptor(e, t) {
|
|
2085
2134
|
if (t === U) return { value: e[U], writable: true, configurable: true };
|
|
2086
|
-
if (e[
|
|
2087
|
-
if (e[
|
|
2088
|
-
const n = getPropertyDescriptor(e[
|
|
2135
|
+
if (e[Z] && t in e[Z]) {
|
|
2136
|
+
if (e[Z][t] === J) return undefined;
|
|
2137
|
+
const n = getPropertyDescriptor(e[X], e[Y], t);
|
|
2089
2138
|
if (n) {
|
|
2090
|
-
return { ...n, value: e[
|
|
2139
|
+
return { ...n, value: e[Z][t] };
|
|
2091
2140
|
}
|
|
2092
|
-
return { value: e[
|
|
2141
|
+
return { value: e[Z][t], writable: true, enumerable: true, configurable: true };
|
|
2093
2142
|
}
|
|
2094
|
-
return getPropertyDescriptor(e[
|
|
2143
|
+
return getPropertyDescriptor(e[X], e[Y], t);
|
|
2095
2144
|
},
|
|
2096
2145
|
getPrototypeOf(e) {
|
|
2097
|
-
return Object.getPrototypeOf(e[
|
|
2146
|
+
return Object.getPrototypeOf(e[X]);
|
|
2098
2147
|
}
|
|
2099
2148
|
};
|
|
2100
2149
|
function storeSetter(e, t) {
|
|
2101
|
-
const n =
|
|
2102
|
-
|
|
2103
|
-
|
|
2150
|
+
const n = ue;
|
|
2151
|
+
ue = new Set();
|
|
2152
|
+
ue.add(e);
|
|
2104
2153
|
try {
|
|
2105
2154
|
const n = t(e);
|
|
2106
2155
|
if (n !== e && n !== undefined) {
|
|
@@ -2116,8 +2165,8 @@ function storeSetter(e, t) {
|
|
|
2116
2165
|
}
|
|
2117
2166
|
}
|
|
2118
2167
|
} finally {
|
|
2119
|
-
|
|
2120
|
-
|
|
2168
|
+
ue.clear();
|
|
2169
|
+
ue = n;
|
|
2121
2170
|
}
|
|
2122
2171
|
}
|
|
2123
2172
|
function createStore(e, t, n) {
|
|
@@ -2125,59 +2174,6 @@ function createStore(e, t, n) {
|
|
|
2125
2174
|
i = r ? createProjectionInternal(e, t, n).store : wrap(e);
|
|
2126
2175
|
return [i, e => storeSetter(i, e)];
|
|
2127
2176
|
}
|
|
2128
|
-
function recursivelyNotify(e, t) {
|
|
2129
|
-
let n = e[z] || t?.get(e)?.[z];
|
|
2130
|
-
let r = false;
|
|
2131
|
-
if (n) {
|
|
2132
|
-
const e = getNodes(n, ee)[K];
|
|
2133
|
-
if (e) {
|
|
2134
|
-
setSignal(e, undefined);
|
|
2135
|
-
r = true;
|
|
2136
|
-
}
|
|
2137
|
-
t = n[re] || t;
|
|
2138
|
-
}
|
|
2139
|
-
const i = X.get(n?.[Y] || e);
|
|
2140
|
-
if (!i) return r;
|
|
2141
|
-
if (i instanceof Set) {
|
|
2142
|
-
for (let e of i) r = recursivelyNotify(e, t) || r;
|
|
2143
|
-
} else r = recursivelyNotify(i, t) || r;
|
|
2144
|
-
return r;
|
|
2145
|
-
}
|
|
2146
|
-
function recursivelyAddParent(e, t) {
|
|
2147
|
-
let n;
|
|
2148
|
-
const r = e[z];
|
|
2149
|
-
if (r) {
|
|
2150
|
-
n = r[Z];
|
|
2151
|
-
e = r[Y];
|
|
2152
|
-
}
|
|
2153
|
-
if (t) {
|
|
2154
|
-
let n = X.get(e);
|
|
2155
|
-
if (!n) X.set(e, t);
|
|
2156
|
-
else if (n !== t) {
|
|
2157
|
-
if (!(n instanceof Set)) X.set(e, (n = new Set([n])));
|
|
2158
|
-
else if (n.has(t)) return;
|
|
2159
|
-
n.add(t);
|
|
2160
|
-
} else return;
|
|
2161
|
-
}
|
|
2162
|
-
if (Array.isArray(e)) {
|
|
2163
|
-
const t = n?.length || e.length;
|
|
2164
|
-
for (let r = 0; r < t; r++) {
|
|
2165
|
-
const t = n && r in n ? n[r] : e[r];
|
|
2166
|
-
isWrappable(t) && recursivelyAddParent(t, e);
|
|
2167
|
-
}
|
|
2168
|
-
} else {
|
|
2169
|
-
const t = getKeys(e, n);
|
|
2170
|
-
for (let r = 0; r < t.length; r++) {
|
|
2171
|
-
const i = t[r];
|
|
2172
|
-
const s = n && i in n ? n[i] : e[i];
|
|
2173
|
-
isWrappable(s) && recursivelyAddParent(s, e);
|
|
2174
|
-
}
|
|
2175
|
-
}
|
|
2176
|
-
}
|
|
2177
|
-
function deep(e) {
|
|
2178
|
-
recursivelyAddParent(e);
|
|
2179
|
-
return e[K];
|
|
2180
|
-
}
|
|
2181
2177
|
function createOptimisticStore(e, t, n) {
|
|
2182
2178
|
GlobalQueue.J ||= clearOptimisticStore;
|
|
2183
2179
|
const r = typeof e === "function";
|
|
@@ -2188,38 +2184,38 @@ function createOptimisticStore(e, t, n) {
|
|
|
2188
2184
|
}
|
|
2189
2185
|
function clearOptimisticStore(e) {
|
|
2190
2186
|
const t = e[z];
|
|
2191
|
-
if (!t || !t[
|
|
2192
|
-
const n = t[
|
|
2193
|
-
const r = t[
|
|
2187
|
+
if (!t || !t[Z]) return;
|
|
2188
|
+
const n = t[Z];
|
|
2189
|
+
const r = t[$];
|
|
2194
2190
|
setProjectionWriteActive(true);
|
|
2195
2191
|
try {
|
|
2196
2192
|
if (r) {
|
|
2197
2193
|
for (const e of Reflect.ownKeys(n)) {
|
|
2198
2194
|
if (r[e]) {
|
|
2199
2195
|
r[e].re = undefined;
|
|
2200
|
-
const n = t[
|
|
2196
|
+
const n = t[Y] && e in t[Y] ? t[Y][e] : t[X][e];
|
|
2201
2197
|
const i = n === J ? undefined : n;
|
|
2202
2198
|
setSignal(r[e], isWrappable(i) ? wrap(i, t) : i);
|
|
2203
2199
|
}
|
|
2204
2200
|
}
|
|
2205
|
-
if (r[
|
|
2206
|
-
r[
|
|
2207
|
-
setSignal(r[
|
|
2201
|
+
if (r[K]) {
|
|
2202
|
+
r[K].re = undefined;
|
|
2203
|
+
setSignal(r[K], undefined);
|
|
2208
2204
|
}
|
|
2209
2205
|
}
|
|
2210
2206
|
} finally {
|
|
2211
2207
|
setProjectionWriteActive(false);
|
|
2212
2208
|
}
|
|
2213
|
-
delete t[
|
|
2209
|
+
delete t[Z];
|
|
2214
2210
|
}
|
|
2215
2211
|
function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
2216
2212
|
let r;
|
|
2217
2213
|
const i = new WeakMap();
|
|
2218
2214
|
const wrapper = e => {
|
|
2219
|
-
e[
|
|
2220
|
-
e[
|
|
2221
|
-
e[
|
|
2222
|
-
Object.defineProperty(e,
|
|
2215
|
+
e[te] = wrapProjection;
|
|
2216
|
+
e[ne] = i;
|
|
2217
|
+
e[ie] = true;
|
|
2218
|
+
Object.defineProperty(e, re, {
|
|
2223
2219
|
get() {
|
|
2224
2220
|
return r;
|
|
2225
2221
|
},
|
|
@@ -2228,8 +2224,8 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2228
2224
|
};
|
|
2229
2225
|
const wrapProjection = e => {
|
|
2230
2226
|
if (i.has(e)) return i.get(e);
|
|
2231
|
-
if (e[z]?.[
|
|
2232
|
-
const t = createStoreProxy(e,
|
|
2227
|
+
if (e[z]?.[te] === wrapProjection) return e;
|
|
2228
|
+
const t = createStoreProxy(e, fe, wrapper);
|
|
2233
2229
|
i.set(e, t);
|
|
2234
2230
|
return t;
|
|
2235
2231
|
};
|
|
@@ -2239,26 +2235,26 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2239
2235
|
const t = getOwner();
|
|
2240
2236
|
setProjectionWriteActive(true);
|
|
2241
2237
|
try {
|
|
2242
|
-
storeSetter(new Proxy(s,
|
|
2238
|
+
storeSetter(new Proxy(s, G), r => {
|
|
2243
2239
|
const i = handleAsync(t, e(r), e => {
|
|
2244
2240
|
setProjectionWriteActive(true);
|
|
2245
2241
|
try {
|
|
2246
|
-
e !== r && e !== undefined && storeSetter(s, reconcile(e, n?.key || "id"
|
|
2242
|
+
e !== r && e !== undefined && storeSetter(s, reconcile(e, n?.key || "id"));
|
|
2247
2243
|
} finally {
|
|
2248
2244
|
setProjectionWriteActive(false);
|
|
2249
2245
|
}
|
|
2250
2246
|
});
|
|
2251
|
-
i !== r && i !== undefined && reconcile(i, n?.key || "id"
|
|
2247
|
+
i !== r && i !== undefined && reconcile(i, n?.key || "id")(s);
|
|
2252
2248
|
});
|
|
2253
2249
|
} finally {
|
|
2254
2250
|
setProjectionWriteActive(false);
|
|
2255
2251
|
}
|
|
2256
2252
|
});
|
|
2257
|
-
r.
|
|
2253
|
+
r.ve = true;
|
|
2258
2254
|
}
|
|
2259
2255
|
return { store: s, node: r };
|
|
2260
2256
|
}
|
|
2261
|
-
const
|
|
2257
|
+
const le = Symbol(0);
|
|
2262
2258
|
function updatePath(e, t, n = 0) {
|
|
2263
2259
|
let r,
|
|
2264
2260
|
i = e;
|
|
@@ -2302,7 +2298,7 @@ function updatePath(e, t, n = 0) {
|
|
|
2302
2298
|
if (s === i) return;
|
|
2303
2299
|
}
|
|
2304
2300
|
if (r === undefined && s == undefined) return;
|
|
2305
|
-
if (s ===
|
|
2301
|
+
if (s === le) {
|
|
2306
2302
|
delete e[r];
|
|
2307
2303
|
} else if (r === undefined || (isWrappable(i) && isWrappable(s) && !Array.isArray(s))) {
|
|
2308
2304
|
const t = r !== undefined ? e[r] : e;
|
|
@@ -2312,61 +2308,70 @@ function updatePath(e, t, n = 0) {
|
|
|
2312
2308
|
e[r] = s;
|
|
2313
2309
|
}
|
|
2314
2310
|
}
|
|
2315
|
-
const
|
|
2311
|
+
const ce = Object.assign(
|
|
2316
2312
|
function storePath(...e) {
|
|
2317
2313
|
return t => {
|
|
2318
2314
|
updatePath(t, e);
|
|
2319
2315
|
};
|
|
2320
2316
|
},
|
|
2321
|
-
{ DELETE:
|
|
2317
|
+
{ DELETE: le }
|
|
2322
2318
|
);
|
|
2323
|
-
function
|
|
2324
|
-
let
|
|
2319
|
+
function snapshotImpl(e, t, n, r) {
|
|
2320
|
+
let i, s, o, u, f, l;
|
|
2325
2321
|
if (!isWrappable(e)) return e;
|
|
2326
|
-
if (
|
|
2327
|
-
if (!
|
|
2328
|
-
if ((
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
e =
|
|
2333
|
-
|
|
2322
|
+
if (n && n.has(e)) return n.get(e);
|
|
2323
|
+
if (!n) n = new Map();
|
|
2324
|
+
if ((i = e[z] || r?.get(e)?.[z])) {
|
|
2325
|
+
if (t) trackSelf(i, K);
|
|
2326
|
+
o = i[Y];
|
|
2327
|
+
s = Array.isArray(i[X]);
|
|
2328
|
+
n.set(e, o ? (u = s ? [] : Object.create(Object.getPrototypeOf(i[X]))) : i[X]);
|
|
2329
|
+
e = i[X];
|
|
2330
|
+
r = se;
|
|
2334
2331
|
} else {
|
|
2335
|
-
|
|
2336
|
-
|
|
2332
|
+
s = Array.isArray(e);
|
|
2333
|
+
n.set(e, e);
|
|
2337
2334
|
}
|
|
2338
|
-
if (
|
|
2339
|
-
const
|
|
2340
|
-
for (let
|
|
2341
|
-
|
|
2342
|
-
if (
|
|
2343
|
-
if (
|
|
2344
|
-
|
|
2345
|
-
|
|
2335
|
+
if (s) {
|
|
2336
|
+
const s = o?.length || e.length;
|
|
2337
|
+
for (let c = 0; c < s; c++) {
|
|
2338
|
+
l = o && c in o ? o[c] : e[c];
|
|
2339
|
+
if (l === J) continue;
|
|
2340
|
+
if (t && isWrappable(l)) wrap(l, i);
|
|
2341
|
+
if ((f = snapshotImpl(l, t, n, r)) !== l || u) {
|
|
2342
|
+
if (!u) n.set(e, (u = [...e]));
|
|
2343
|
+
u[c] = f;
|
|
2346
2344
|
}
|
|
2347
2345
|
}
|
|
2348
2346
|
} else {
|
|
2349
|
-
const
|
|
2350
|
-
for (let
|
|
2351
|
-
let
|
|
2352
|
-
const
|
|
2353
|
-
if (
|
|
2354
|
-
|
|
2355
|
-
if (
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
Object.
|
|
2347
|
+
const s = getKeys(e, o);
|
|
2348
|
+
for (let c = 0, a = s.length; c < a; c++) {
|
|
2349
|
+
let a = s[c];
|
|
2350
|
+
const d = getPropertyDescriptor(e, o, a);
|
|
2351
|
+
if (d.get) continue;
|
|
2352
|
+
l = o && a in o ? o[a] : e[a];
|
|
2353
|
+
if (t && isWrappable(l)) wrap(l, i);
|
|
2354
|
+
if ((f = snapshotImpl(l, t, n, r)) !== e[a] || u) {
|
|
2355
|
+
if (!u) {
|
|
2356
|
+
u = Object.create(Object.getPrototypeOf(e));
|
|
2357
|
+
Object.assign(u, e);
|
|
2359
2358
|
}
|
|
2360
|
-
|
|
2359
|
+
u[a] = f;
|
|
2361
2360
|
}
|
|
2362
2361
|
}
|
|
2363
2362
|
}
|
|
2364
|
-
return
|
|
2363
|
+
return u || e;
|
|
2364
|
+
}
|
|
2365
|
+
function snapshot(e, t, n) {
|
|
2366
|
+
return snapshotImpl(e, false, t, n);
|
|
2367
|
+
}
|
|
2368
|
+
function deep(e) {
|
|
2369
|
+
return snapshotImpl(e, true);
|
|
2365
2370
|
}
|
|
2366
2371
|
function trueFn() {
|
|
2367
2372
|
return true;
|
|
2368
2373
|
}
|
|
2369
|
-
const
|
|
2374
|
+
const ae = {
|
|
2370
2375
|
get(e, t, n) {
|
|
2371
2376
|
if (t === U) return n;
|
|
2372
2377
|
return e.get(t);
|
|
@@ -2395,7 +2400,7 @@ const de = {
|
|
|
2395
2400
|
function resolveSource(e) {
|
|
2396
2401
|
return !(e = typeof e === "function" ? e() : e) ? {} : e;
|
|
2397
2402
|
}
|
|
2398
|
-
const
|
|
2403
|
+
const de = Symbol(0);
|
|
2399
2404
|
function merge(...e) {
|
|
2400
2405
|
if (e.length === 1 && typeof e[0] !== "function") return e[0];
|
|
2401
2406
|
let t = false;
|
|
@@ -2403,7 +2408,7 @@ function merge(...e) {
|
|
|
2403
2408
|
for (let r = 0; r < e.length; r++) {
|
|
2404
2409
|
const i = e[r];
|
|
2405
2410
|
t = t || (!!i && U in i);
|
|
2406
|
-
const s = !!i && i[
|
|
2411
|
+
const s = !!i && i[de];
|
|
2407
2412
|
if (s) n.push(...s);
|
|
2408
2413
|
else n.push(typeof i === "function" ? ((t = true), createMemo(i)) : i);
|
|
2409
2414
|
}
|
|
@@ -2411,7 +2416,7 @@ function merge(...e) {
|
|
|
2411
2416
|
return new Proxy(
|
|
2412
2417
|
{
|
|
2413
2418
|
get(e) {
|
|
2414
|
-
if (e ===
|
|
2419
|
+
if (e === de) return n;
|
|
2415
2420
|
for (let t = n.length - 1; t >= 0; t--) {
|
|
2416
2421
|
const r = resolveSource(n[t]);
|
|
2417
2422
|
if (e in r) return r[e];
|
|
@@ -2429,7 +2434,7 @@ function merge(...e) {
|
|
|
2429
2434
|
return [...new Set(e)];
|
|
2430
2435
|
}
|
|
2431
2436
|
},
|
|
2432
|
-
|
|
2437
|
+
ae
|
|
2433
2438
|
);
|
|
2434
2439
|
}
|
|
2435
2440
|
const r = Object.create(null);
|
|
@@ -2461,7 +2466,7 @@ function merge(...e) {
|
|
|
2461
2466
|
if (n.get) Object.defineProperty(o, t, n);
|
|
2462
2467
|
else o[t] = n.value;
|
|
2463
2468
|
}
|
|
2464
|
-
o[
|
|
2469
|
+
o[de] = n;
|
|
2465
2470
|
return o;
|
|
2466
2471
|
}
|
|
2467
2472
|
function omit(e, ...t) {
|
|
@@ -2479,7 +2484,7 @@ function omit(e, ...t) {
|
|
|
2479
2484
|
return Object.keys(e).filter(e => !n.has(e));
|
|
2480
2485
|
}
|
|
2481
2486
|
},
|
|
2482
|
-
|
|
2487
|
+
ae
|
|
2483
2488
|
);
|
|
2484
2489
|
}
|
|
2485
2490
|
const r = {};
|
|
@@ -2499,68 +2504,65 @@ function mapArray(e, t, n) {
|
|
|
2499
2504
|
const s = t;
|
|
2500
2505
|
return createMemo(
|
|
2501
2506
|
updateKeyedMap.bind({
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
+
Ve: createOwner(),
|
|
2508
|
+
De: 0,
|
|
2509
|
+
Be: e,
|
|
2510
|
+
Ge: [],
|
|
2511
|
+
Ke: s,
|
|
2512
|
+
ze: [],
|
|
2507
2513
|
Ue: [],
|
|
2508
|
-
Je:
|
|
2509
|
-
Xe: r,
|
|
2510
|
-
Ye:
|
|
2511
|
-
Ze:
|
|
2512
|
-
$e: n?.fallback
|
|
2514
|
+
Je: r,
|
|
2515
|
+
Xe: r || n?.keyed === false ? [] : undefined,
|
|
2516
|
+
Ye: i ? [] : undefined,
|
|
2517
|
+
Ze: n?.fallback
|
|
2513
2518
|
})
|
|
2514
2519
|
);
|
|
2515
2520
|
}
|
|
2516
|
-
const
|
|
2521
|
+
const pe = { pureWrite: true };
|
|
2517
2522
|
function updateKeyedMap() {
|
|
2518
|
-
const e = this.
|
|
2523
|
+
const e = this.Be() || [],
|
|
2519
2524
|
t = e.length;
|
|
2520
|
-
e[
|
|
2521
|
-
runWithOwner(this.
|
|
2525
|
+
e[K];
|
|
2526
|
+
runWithOwner(this.Ve, () => {
|
|
2522
2527
|
let n,
|
|
2523
2528
|
r,
|
|
2524
|
-
i = this.
|
|
2529
|
+
i = this.Xe
|
|
2525
2530
|
? () => {
|
|
2526
|
-
this.
|
|
2527
|
-
this.
|
|
2528
|
-
return this.
|
|
2529
|
-
read.bind(null, this.Ye[r]),
|
|
2530
|
-
this.Ze ? read.bind(null, this.Ze[r]) : undefined
|
|
2531
|
-
);
|
|
2531
|
+
this.Xe[r] = signal(e[r], pe);
|
|
2532
|
+
this.Ye && (this.Ye[r] = signal(r, pe));
|
|
2533
|
+
return this.Ke(accessor(this.Xe[r]), this.Ye ? accessor(this.Ye[r]) : undefined);
|
|
2532
2534
|
}
|
|
2533
|
-
: this.
|
|
2535
|
+
: this.Ye
|
|
2534
2536
|
? () => {
|
|
2535
2537
|
const t = e[r];
|
|
2536
|
-
this.
|
|
2537
|
-
return this.
|
|
2538
|
+
this.Ye[r] = signal(r, pe);
|
|
2539
|
+
return this.Ke(() => t, accessor(this.Ye[r]));
|
|
2538
2540
|
}
|
|
2539
2541
|
: () => {
|
|
2540
2542
|
const t = e[r];
|
|
2541
|
-
return this.
|
|
2543
|
+
return this.Ke(() => t);
|
|
2542
2544
|
};
|
|
2543
2545
|
if (t === 0) {
|
|
2544
|
-
if (this.
|
|
2545
|
-
this.
|
|
2546
|
-
this.Je = [];
|
|
2547
|
-
this.Ke = [];
|
|
2546
|
+
if (this.De !== 0) {
|
|
2547
|
+
this.Ve.dispose(false);
|
|
2548
2548
|
this.Ue = [];
|
|
2549
|
-
this.
|
|
2549
|
+
this.Ge = [];
|
|
2550
|
+
this.ze = [];
|
|
2551
|
+
this.De = 0;
|
|
2552
|
+
this.Xe && (this.Xe = []);
|
|
2550
2553
|
this.Ye && (this.Ye = []);
|
|
2551
|
-
this.Ze && (this.Ze = []);
|
|
2552
2554
|
}
|
|
2553
|
-
if (this
|
|
2554
|
-
this.
|
|
2555
|
+
if (this.Ze && !this.ze[0]) {
|
|
2556
|
+
this.ze[0] = runWithOwner((this.Ue[0] = createOwner()), this.Ze);
|
|
2555
2557
|
}
|
|
2556
|
-
} else if (this.
|
|
2557
|
-
if (this.
|
|
2558
|
-
this.
|
|
2558
|
+
} else if (this.De === 0) {
|
|
2559
|
+
if (this.Ue[0]) this.Ue[0].dispose();
|
|
2560
|
+
this.ze = new Array(t);
|
|
2559
2561
|
for (r = 0; r < t; r++) {
|
|
2560
|
-
this.
|
|
2561
|
-
this.
|
|
2562
|
+
this.Ge[r] = e[r];
|
|
2563
|
+
this.ze[r] = runWithOwner((this.Ue[r] = createOwner()), i);
|
|
2562
2564
|
}
|
|
2563
|
-
this.
|
|
2565
|
+
this.De = t;
|
|
2564
2566
|
} else {
|
|
2565
2567
|
let s,
|
|
2566
2568
|
o,
|
|
@@ -2571,145 +2573,145 @@ function updateKeyedMap() {
|
|
|
2571
2573
|
a,
|
|
2572
2574
|
d = new Array(t),
|
|
2573
2575
|
p = new Array(t),
|
|
2574
|
-
h = this.
|
|
2575
|
-
y = this.
|
|
2576
|
+
h = this.Xe ? new Array(t) : undefined,
|
|
2577
|
+
y = this.Ye ? new Array(t) : undefined;
|
|
2576
2578
|
for (
|
|
2577
|
-
s = 0, o = Math.min(this.
|
|
2578
|
-
s < o && (this.
|
|
2579
|
+
s = 0, o = Math.min(this.De, t);
|
|
2580
|
+
s < o && (this.Ge[s] === e[s] || (this.Xe && compare(this.Je, this.Ge[s], e[s])));
|
|
2579
2581
|
s++
|
|
2580
2582
|
) {
|
|
2581
|
-
if (this.
|
|
2583
|
+
if (this.Xe) setSignal(this.Xe[s], e[s]);
|
|
2582
2584
|
}
|
|
2583
2585
|
for (
|
|
2584
|
-
o = this.
|
|
2586
|
+
o = this.De - 1, u = t - 1;
|
|
2585
2587
|
o >= s &&
|
|
2586
2588
|
u >= s &&
|
|
2587
|
-
(this.
|
|
2589
|
+
(this.Ge[o] === e[u] || (this.Xe && compare(this.Je, this.Ge[o], e[u])));
|
|
2588
2590
|
o--, u--
|
|
2589
2591
|
) {
|
|
2590
|
-
d[u] = this.
|
|
2591
|
-
p[u] = this.
|
|
2592
|
-
h && (h[u] = this.
|
|
2593
|
-
y && (y[u] = this.
|
|
2592
|
+
d[u] = this.ze[o];
|
|
2593
|
+
p[u] = this.Ue[o];
|
|
2594
|
+
h && (h[u] = this.Xe[o]);
|
|
2595
|
+
y && (y[u] = this.Ye[o]);
|
|
2594
2596
|
}
|
|
2595
2597
|
c = new Map();
|
|
2596
2598
|
a = new Array(u + 1);
|
|
2597
2599
|
for (r = u; r >= s; r--) {
|
|
2598
2600
|
f = e[r];
|
|
2599
|
-
l = this.
|
|
2601
|
+
l = this.Je ? this.Je(f) : f;
|
|
2600
2602
|
n = c.get(l);
|
|
2601
2603
|
a[r] = n === undefined ? -1 : n;
|
|
2602
2604
|
c.set(l, r);
|
|
2603
2605
|
}
|
|
2604
2606
|
for (n = s; n <= o; n++) {
|
|
2605
|
-
f = this.
|
|
2606
|
-
l = this.
|
|
2607
|
+
f = this.Ge[n];
|
|
2608
|
+
l = this.Je ? this.Je(f) : f;
|
|
2607
2609
|
r = c.get(l);
|
|
2608
2610
|
if (r !== undefined && r !== -1) {
|
|
2609
|
-
d[r] = this.
|
|
2610
|
-
p[r] = this.
|
|
2611
|
-
h && (h[r] = this.
|
|
2612
|
-
y && (y[r] = this.
|
|
2611
|
+
d[r] = this.ze[n];
|
|
2612
|
+
p[r] = this.Ue[n];
|
|
2613
|
+
h && (h[r] = this.Xe[n]);
|
|
2614
|
+
y && (y[r] = this.Ye[n]);
|
|
2613
2615
|
r = a[r];
|
|
2614
2616
|
c.set(l, r);
|
|
2615
|
-
} else this.
|
|
2617
|
+
} else this.Ue[n].dispose();
|
|
2616
2618
|
}
|
|
2617
2619
|
for (r = s; r < t; r++) {
|
|
2618
2620
|
if (r in d) {
|
|
2619
|
-
this.
|
|
2620
|
-
this.
|
|
2621
|
+
this.ze[r] = d[r];
|
|
2622
|
+
this.Ue[r] = p[r];
|
|
2621
2623
|
if (h) {
|
|
2622
|
-
this.
|
|
2623
|
-
setSignal(this.
|
|
2624
|
+
this.Xe[r] = h[r];
|
|
2625
|
+
setSignal(this.Xe[r], e[r]);
|
|
2624
2626
|
}
|
|
2625
2627
|
if (y) {
|
|
2626
|
-
this.
|
|
2627
|
-
setSignal(this.
|
|
2628
|
+
this.Ye[r] = y[r];
|
|
2629
|
+
setSignal(this.Ye[r], r);
|
|
2628
2630
|
}
|
|
2629
2631
|
} else {
|
|
2630
|
-
this.
|
|
2632
|
+
this.ze[r] = runWithOwner((this.Ue[r] = createOwner()), i);
|
|
2631
2633
|
}
|
|
2632
2634
|
}
|
|
2633
|
-
this.
|
|
2634
|
-
this.
|
|
2635
|
+
this.ze = this.ze.slice(0, (this.De = t));
|
|
2636
|
+
this.Ge = e.slice(0);
|
|
2635
2637
|
}
|
|
2636
2638
|
});
|
|
2637
|
-
return this.
|
|
2639
|
+
return this.ze;
|
|
2638
2640
|
}
|
|
2639
2641
|
function repeat(e, t, n) {
|
|
2640
2642
|
const r = t;
|
|
2641
2643
|
return updateRepeat.bind({
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
Je: [],
|
|
2644
|
+
Ve: createOwner(),
|
|
2645
|
+
De: 0,
|
|
2646
|
+
$e: 0,
|
|
2647
|
+
et: e,
|
|
2648
|
+
Ke: r,
|
|
2648
2649
|
Ue: [],
|
|
2649
|
-
|
|
2650
|
-
|
|
2650
|
+
ze: [],
|
|
2651
|
+
tt: n?.from,
|
|
2652
|
+
Ze: n?.fallback
|
|
2651
2653
|
});
|
|
2652
2654
|
}
|
|
2653
2655
|
function updateRepeat() {
|
|
2654
|
-
const e = this.
|
|
2655
|
-
const t = this.
|
|
2656
|
-
runWithOwner(this.
|
|
2656
|
+
const e = this.et();
|
|
2657
|
+
const t = this.tt?.() || 0;
|
|
2658
|
+
runWithOwner(this.Ve, () => {
|
|
2657
2659
|
if (e === 0) {
|
|
2658
|
-
if (this.
|
|
2659
|
-
this.
|
|
2660
|
-
this.Je = [];
|
|
2660
|
+
if (this.De !== 0) {
|
|
2661
|
+
this.Ve.dispose(false);
|
|
2661
2662
|
this.Ue = [];
|
|
2662
|
-
this.
|
|
2663
|
+
this.ze = [];
|
|
2664
|
+
this.De = 0;
|
|
2663
2665
|
}
|
|
2664
|
-
if (this
|
|
2665
|
-
this.
|
|
2666
|
+
if (this.Ze && !this.ze[0]) {
|
|
2667
|
+
this.ze[0] = runWithOwner((this.Ue[0] = createOwner()), this.Ze);
|
|
2666
2668
|
}
|
|
2667
2669
|
return;
|
|
2668
2670
|
}
|
|
2669
2671
|
const n = t + e;
|
|
2670
|
-
const r = this
|
|
2671
|
-
if (this.
|
|
2672
|
-
for (let e = n; e < r; e++) this.
|
|
2673
|
-
if (this
|
|
2674
|
-
let e = this
|
|
2675
|
-
while (e < t && e < this.
|
|
2676
|
-
this.
|
|
2677
|
-
this.
|
|
2678
|
-
} else if (this
|
|
2679
|
-
let n = r - this
|
|
2680
|
-
let i = this
|
|
2681
|
-
this.
|
|
2672
|
+
const r = this.$e + this.De;
|
|
2673
|
+
if (this.De === 0 && this.Ue[0]) this.Ue[0].dispose();
|
|
2674
|
+
for (let e = n; e < r; e++) this.Ue[e - this.$e].dispose();
|
|
2675
|
+
if (this.$e < t) {
|
|
2676
|
+
let e = this.$e;
|
|
2677
|
+
while (e < t && e < this.De) this.Ue[e++].dispose();
|
|
2678
|
+
this.Ue.splice(0, t - this.$e);
|
|
2679
|
+
this.ze.splice(0, t - this.$e);
|
|
2680
|
+
} else if (this.$e > t) {
|
|
2681
|
+
let n = r - this.$e - 1;
|
|
2682
|
+
let i = this.$e - t;
|
|
2683
|
+
this.Ue.length = this.ze.length = e;
|
|
2682
2684
|
while (n >= i) {
|
|
2683
|
-
this.Je[n] = this.Je[n - i];
|
|
2684
2685
|
this.Ue[n] = this.Ue[n - i];
|
|
2686
|
+
this.ze[n] = this.ze[n - i];
|
|
2685
2687
|
n--;
|
|
2686
2688
|
}
|
|
2687
2689
|
for (let e = 0; e < i; e++) {
|
|
2688
|
-
this.
|
|
2690
|
+
this.ze[e] = runWithOwner((this.Ue[e] = createOwner()), () => this.Ke(e + t));
|
|
2689
2691
|
}
|
|
2690
2692
|
}
|
|
2691
2693
|
for (let e = r; e < n; e++) {
|
|
2692
|
-
this.
|
|
2694
|
+
this.ze[e - t] = runWithOwner((this.Ue[e - t] = createOwner()), () => this.Ke(e));
|
|
2693
2695
|
}
|
|
2694
|
-
this.
|
|
2695
|
-
this
|
|
2696
|
-
this.
|
|
2696
|
+
this.ze = this.ze.slice(0, e);
|
|
2697
|
+
this.$e = t;
|
|
2698
|
+
this.De = e;
|
|
2697
2699
|
});
|
|
2698
|
-
return this.
|
|
2700
|
+
return this.ze;
|
|
2699
2701
|
}
|
|
2700
2702
|
function compare(e, t, n) {
|
|
2701
2703
|
return e ? e(t) === e(n) : true;
|
|
2702
2704
|
}
|
|
2703
2705
|
function boundaryComputed(e, t) {
|
|
2704
2706
|
const n = computed(e, undefined, { lazy: true });
|
|
2705
|
-
n.
|
|
2707
|
+
n._e = (e, t) => {
|
|
2706
2708
|
const r = e !== undefined ? e : n.de;
|
|
2707
2709
|
const i = t !== undefined ? t : n.Y;
|
|
2708
|
-
n.de &= ~n.
|
|
2709
|
-
n.fe.notify(n, n.
|
|
2710
|
+
n.de &= ~n.nt;
|
|
2711
|
+
n.fe.notify(n, n.nt, r, i);
|
|
2710
2712
|
};
|
|
2711
|
-
n.
|
|
2712
|
-
n.
|
|
2713
|
+
n.nt = t;
|
|
2714
|
+
n.ve = true;
|
|
2713
2715
|
recompute(n, true);
|
|
2714
2716
|
return n;
|
|
2715
2717
|
}
|
|
@@ -2722,64 +2724,90 @@ function createBoundChildren(e, t, n, r) {
|
|
|
2722
2724
|
return boundaryComputed(() => staleValues(() => flatten(read(e))), r);
|
|
2723
2725
|
});
|
|
2724
2726
|
}
|
|
2727
|
+
const he = Symbol();
|
|
2725
2728
|
class CollectionQueue extends Queue {
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2729
|
+
rt;
|
|
2730
|
+
it = new Set();
|
|
2731
|
+
st = signal(false, { pureWrite: true });
|
|
2732
|
+
ot = false;
|
|
2733
|
+
ut;
|
|
2734
|
+
ft = he;
|
|
2730
2735
|
constructor(e) {
|
|
2731
2736
|
super();
|
|
2732
|
-
this.
|
|
2737
|
+
this.rt = e;
|
|
2733
2738
|
}
|
|
2734
2739
|
run(e) {
|
|
2735
|
-
if (!e || read(this.
|
|
2740
|
+
if (!e || read(this.st)) return;
|
|
2736
2741
|
return super.run(e);
|
|
2737
2742
|
}
|
|
2738
2743
|
notify(e, t, n, r) {
|
|
2739
|
-
if (!(t & this.
|
|
2740
|
-
if (
|
|
2744
|
+
if (!(t & this.rt)) return super.notify(e, t, n, r);
|
|
2745
|
+
if (this.ot && this.ut) {
|
|
2746
|
+
const e = untrack(() => {
|
|
2747
|
+
try {
|
|
2748
|
+
return this.ut();
|
|
2749
|
+
} catch {
|
|
2750
|
+
return he;
|
|
2751
|
+
}
|
|
2752
|
+
});
|
|
2753
|
+
if (e !== this.ft) {
|
|
2754
|
+
this.ft = e;
|
|
2755
|
+
this.ot = false;
|
|
2756
|
+
this.it.clear();
|
|
2757
|
+
}
|
|
2758
|
+
}
|
|
2759
|
+
if (this.rt & a && this.ot) return super.notify(e, t, n, r);
|
|
2760
|
+
if (n & this.rt) {
|
|
2741
2761
|
const t = r?.source || e.Y?.source;
|
|
2742
2762
|
if (t) {
|
|
2743
|
-
const e = this.
|
|
2744
|
-
this.
|
|
2745
|
-
if (e) setSignal(this.
|
|
2763
|
+
const e = this.it.size === 0;
|
|
2764
|
+
this.it.add(t);
|
|
2765
|
+
if (e) setSignal(this.st, true);
|
|
2746
2766
|
}
|
|
2747
2767
|
}
|
|
2748
|
-
t &= ~this.
|
|
2768
|
+
t &= ~this.rt;
|
|
2749
2769
|
return t ? super.notify(e, t, n, r) : true;
|
|
2750
2770
|
}
|
|
2751
2771
|
checkSources() {
|
|
2752
|
-
for (const e of this.
|
|
2753
|
-
if (!(e.de & this.
|
|
2772
|
+
for (const e of this.it) {
|
|
2773
|
+
if (!(e.de & this.rt)) this.it.delete(e);
|
|
2774
|
+
}
|
|
2775
|
+
if (!this.it.size) {
|
|
2776
|
+
setSignal(this.st, false);
|
|
2777
|
+
if (this.ut) {
|
|
2778
|
+
try {
|
|
2779
|
+
this.ft = untrack(() => this.ut());
|
|
2780
|
+
} catch {}
|
|
2781
|
+
}
|
|
2754
2782
|
}
|
|
2755
|
-
if (!this.st.size) setSignal(this.ot, false);
|
|
2756
2783
|
}
|
|
2757
2784
|
}
|
|
2758
|
-
function createCollectionBoundary(e, t, n) {
|
|
2759
|
-
const
|
|
2760
|
-
const
|
|
2761
|
-
|
|
2762
|
-
const o =
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2785
|
+
function createCollectionBoundary(e, t, n, r) {
|
|
2786
|
+
const i = createOwner();
|
|
2787
|
+
const s = new CollectionQueue(e);
|
|
2788
|
+
if (r) s.ut = r;
|
|
2789
|
+
const o = createBoundChildren(i, t, s, e);
|
|
2790
|
+
const u = computed(() => {
|
|
2791
|
+
if (!read(s.st)) {
|
|
2792
|
+
const e = read(o);
|
|
2793
|
+
if (!untrack(() => read(s.st))) {
|
|
2794
|
+
s.ot = true;
|
|
2767
2795
|
return e;
|
|
2768
2796
|
}
|
|
2769
2797
|
}
|
|
2770
|
-
return n(
|
|
2798
|
+
return n(s);
|
|
2771
2799
|
});
|
|
2772
|
-
return
|
|
2800
|
+
return accessor(u);
|
|
2773
2801
|
}
|
|
2774
|
-
function
|
|
2775
|
-
return createCollectionBoundary(a, e, () => t());
|
|
2802
|
+
function createLoadingBoundary(e, t, n) {
|
|
2803
|
+
return createCollectionBoundary(a, e, () => t(), n?.on);
|
|
2776
2804
|
}
|
|
2777
2805
|
function createErrorBoundary(e, t) {
|
|
2778
2806
|
return createCollectionBoundary(d, e, e => {
|
|
2779
|
-
let n = e.
|
|
2807
|
+
let n = e.it.values().next().value;
|
|
2780
2808
|
const r = n.Y?.cause ?? n.Y;
|
|
2781
2809
|
return t(r, () => {
|
|
2782
|
-
for (const t of e.
|
|
2810
|
+
for (const t of e.it) recompute(t);
|
|
2783
2811
|
schedule();
|
|
2784
2812
|
});
|
|
2785
2813
|
});
|
|
@@ -2836,7 +2864,7 @@ function flattenArray(e, t = [], n) {
|
|
|
2836
2864
|
exports.$PROXY = U;
|
|
2837
2865
|
exports.$REFRESH = O;
|
|
2838
2866
|
exports.$TARGET = z;
|
|
2839
|
-
exports.$TRACK =
|
|
2867
|
+
exports.$TRACK = K;
|
|
2840
2868
|
exports.ContextNotFoundError = ContextNotFoundError;
|
|
2841
2869
|
exports.NoOwnerError = NoOwnerError;
|
|
2842
2870
|
exports.NotReadyError = NotReadyError;
|
|
@@ -2846,7 +2874,7 @@ exports.clearSnapshots = clearSnapshots;
|
|
|
2846
2874
|
exports.createContext = createContext;
|
|
2847
2875
|
exports.createEffect = createEffect;
|
|
2848
2876
|
exports.createErrorBoundary = createErrorBoundary;
|
|
2849
|
-
exports.
|
|
2877
|
+
exports.createLoadingBoundary = createLoadingBoundary;
|
|
2850
2878
|
exports.createMemo = createMemo;
|
|
2851
2879
|
exports.createOptimistic = createOptimistic;
|
|
2852
2880
|
exports.createOptimisticStore = createOptimisticStore;
|
|
@@ -2859,6 +2887,8 @@ exports.createSignal = createSignal;
|
|
|
2859
2887
|
exports.createStore = createStore;
|
|
2860
2888
|
exports.createTrackedEffect = createTrackedEffect;
|
|
2861
2889
|
exports.deep = deep;
|
|
2890
|
+
exports.enableExternalSource = enableExternalSource;
|
|
2891
|
+
exports.enforceLoadingBoundary = enforceLoadingBoundary;
|
|
2862
2892
|
exports.flatten = flatten;
|
|
2863
2893
|
exports.flush = flush;
|
|
2864
2894
|
exports.getContext = getContext;
|
|
@@ -2885,8 +2915,7 @@ exports.repeat = repeat;
|
|
|
2885
2915
|
exports.resolve = resolve;
|
|
2886
2916
|
exports.runWithOwner = runWithOwner;
|
|
2887
2917
|
exports.setContext = setContext;
|
|
2888
|
-
exports.setOnUnhandledAsync = setOnUnhandledAsync;
|
|
2889
2918
|
exports.setSnapshotCapture = setSnapshotCapture;
|
|
2890
2919
|
exports.snapshot = snapshot;
|
|
2891
|
-
exports.storePath =
|
|
2920
|
+
exports.storePath = ce;
|
|
2892
2921
|
exports.untrack = untrack;
|