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