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