@solidjs/signals 2.0.0-beta.8 → 2.0.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev.js +172 -79
- package/dist/node.cjs +1091 -1043
- package/dist/prod.js +802 -752
- package/dist/types/boundaries.d.ts +35 -0
- package/dist/types/core/action.d.ts +34 -0
- package/dist/types/core/constants.d.ts +17 -0
- package/dist/types/core/core.d.ts +106 -7
- package/dist/types/core/dev.d.ts +1 -1
- package/dist/types/core/owner.d.ts +54 -3
- package/dist/types/core/scheduler.d.ts +18 -2
- package/dist/types/core/types.d.ts +2 -5
- package/dist/types/index.d.ts +1 -1
- package/dist/types/map.d.ts +32 -3
- package/dist/types/signals.d.ts +264 -11
- package/dist/types/store/optimistic.d.ts +38 -12
- package/dist/types/store/projection.d.ts +40 -14
- package/dist/types/store/reconcile.d.ts +22 -0
- package/dist/types/store/store.d.ts +64 -14
- package/dist/types/store/storePath.d.ts +28 -0
- package/dist/types/store/utils.d.ts +78 -7
- package/dist/types-cjs/boundaries.d.cts +35 -0
- package/dist/types-cjs/core/action.d.cts +34 -0
- package/dist/types-cjs/core/constants.d.cts +17 -0
- package/dist/types-cjs/core/core.d.cts +106 -7
- package/dist/types-cjs/core/dev.d.cts +1 -1
- package/dist/types-cjs/core/owner.d.cts +54 -3
- package/dist/types-cjs/core/scheduler.d.cts +18 -2
- package/dist/types-cjs/core/types.d.cts +2 -5
- package/dist/types-cjs/index.d.cts +1 -1
- package/dist/types-cjs/map.d.cts +32 -3
- package/dist/types-cjs/signals.d.cts +264 -11
- package/dist/types-cjs/store/optimistic.d.cts +38 -12
- package/dist/types-cjs/store/projection.d.cts +40 -14
- package/dist/types-cjs/store/reconcile.d.cts +22 -0
- package/dist/types-cjs/store/store.d.cts +64 -14
- package/dist/types-cjs/store/storePath.d.cts +28 -0
- package/dist/types-cjs/store/utils.d.cts +78 -7
- package/package.json +4 -3
package/dist/node.cjs
CHANGED
|
@@ -37,15 +37,21 @@ const c = 1 << 9;
|
|
|
37
37
|
const a = 1 << 0;
|
|
38
38
|
const d = 1 << 1;
|
|
39
39
|
const h = 1 << 2;
|
|
40
|
-
const p = 1;
|
|
41
|
-
const y =
|
|
42
|
-
const g =
|
|
43
|
-
const S =
|
|
44
|
-
const w =
|
|
45
|
-
const m =
|
|
46
|
-
const b =
|
|
47
|
-
const _ =
|
|
48
|
-
const O =
|
|
40
|
+
const p = 1 << 3;
|
|
41
|
+
const y = 1 << 4;
|
|
42
|
+
const g = 1 << 5;
|
|
43
|
+
const S = 1 << 0;
|
|
44
|
+
const w = 1 << 1;
|
|
45
|
+
const m = 1 << 2;
|
|
46
|
+
const b = 1;
|
|
47
|
+
const _ = 2;
|
|
48
|
+
const O = 3;
|
|
49
|
+
const v = {};
|
|
50
|
+
const x = {};
|
|
51
|
+
const P = "sp";
|
|
52
|
+
const k = typeof Proxy === "function";
|
|
53
|
+
const E = {};
|
|
54
|
+
const C = Symbol("refresh");
|
|
49
55
|
function actualInsertIntoHeap(e, t) {
|
|
50
56
|
const n = (e.i?.t ? e.i.u?.o : e.i?.o) ?? -1;
|
|
51
57
|
if (n >= e.o) e.o = n + 1;
|
|
@@ -142,38 +148,38 @@ function adjustHeight(e, t) {
|
|
|
142
148
|
}
|
|
143
149
|
}
|
|
144
150
|
}
|
|
145
|
-
const
|
|
146
|
-
const
|
|
147
|
-
const
|
|
148
|
-
const
|
|
149
|
-
let
|
|
150
|
-
let
|
|
151
|
-
let
|
|
152
|
-
let
|
|
153
|
-
let
|
|
154
|
-
const
|
|
151
|
+
const N = undefined;
|
|
152
|
+
const W = new Set();
|
|
153
|
+
const j = { l: new Array(2e3).fill(undefined), _: false, W: 0, S: 0 };
|
|
154
|
+
const R = { l: new Array(2e3).fill(undefined), _: false, W: 0, S: 0 };
|
|
155
|
+
let A = 0;
|
|
156
|
+
let L = null;
|
|
157
|
+
let I = false;
|
|
158
|
+
let T = false;
|
|
159
|
+
let H = null;
|
|
160
|
+
const Q = new Set();
|
|
155
161
|
function registerTransientStoreNode(e) {
|
|
156
|
-
|
|
162
|
+
Q.add(e);
|
|
157
163
|
}
|
|
158
164
|
function sweepTransientStoreNodes() {
|
|
159
|
-
if (
|
|
160
|
-
for (const e of
|
|
165
|
+
if (Q.size === 0) return;
|
|
166
|
+
for (const e of Q) {
|
|
161
167
|
if (e.O !== null) {
|
|
162
|
-
|
|
168
|
+
Q.delete(e);
|
|
163
169
|
continue;
|
|
164
170
|
}
|
|
165
|
-
if (e.T !==
|
|
166
|
-
if (e.H !== undefined && e.H !==
|
|
167
|
-
|
|
171
|
+
if (e.T !== v) continue;
|
|
172
|
+
if (e.H !== undefined && e.H !== v) continue;
|
|
173
|
+
Q.delete(e);
|
|
168
174
|
e.q?.();
|
|
169
175
|
}
|
|
170
176
|
}
|
|
171
177
|
function enforceLoadingBoundary(e) {}
|
|
172
178
|
function shouldReadStashedOptimisticValue(e) {
|
|
173
|
-
return !!
|
|
179
|
+
return !!H?.has(e);
|
|
174
180
|
}
|
|
175
181
|
function runLaneEffects(e) {
|
|
176
|
-
for (const t of
|
|
182
|
+
for (const t of D) {
|
|
177
183
|
if (t.M || t.D.size > 0) continue;
|
|
178
184
|
const n = t.F[e - 1];
|
|
179
185
|
if (n.length) {
|
|
@@ -186,25 +192,25 @@ function queueStashedOptimisticEffects(e) {
|
|
|
186
192
|
for (let t = e.O; t !== null; t = t.P) {
|
|
187
193
|
const e = t.k;
|
|
188
194
|
if (!e.V) continue;
|
|
189
|
-
if (e.V ===
|
|
195
|
+
if (e.V === O) {
|
|
190
196
|
if (!e.B) {
|
|
191
197
|
e.B = true;
|
|
192
|
-
e.K.enqueue(
|
|
198
|
+
e.K.enqueue(_, e.G);
|
|
193
199
|
}
|
|
194
200
|
continue;
|
|
195
201
|
}
|
|
196
|
-
const n = e.m & o ?
|
|
202
|
+
const n = e.m & o ? R : j;
|
|
197
203
|
if (n.W > e.o) n.W = e.o;
|
|
198
204
|
insertIntoHeap(e, n);
|
|
199
205
|
}
|
|
200
206
|
}
|
|
201
207
|
function setProjectionWriteActive(e) {
|
|
202
|
-
|
|
208
|
+
T = e;
|
|
203
209
|
}
|
|
204
210
|
function mergeTransitionState(e, t) {
|
|
205
211
|
t.U = e;
|
|
206
212
|
e.J.push(...t.J);
|
|
207
|
-
for (const n of
|
|
213
|
+
for (const n of D) if (n.X === t) n.X = e;
|
|
208
214
|
e.Y.push(...t.Y);
|
|
209
215
|
for (const n of t.Z) e.Z.add(n);
|
|
210
216
|
for (const [n, r] of t.$) {
|
|
@@ -212,56 +218,57 @@ function mergeTransitionState(e, t) {
|
|
|
212
218
|
if (!t) e.$.set(n, (t = new Set()));
|
|
213
219
|
for (const e of r) t.add(e);
|
|
214
220
|
}
|
|
221
|
+
for (const n of t.ee) e.ee.add(n);
|
|
215
222
|
}
|
|
216
223
|
function resolveOptimisticNodes(e) {
|
|
217
224
|
for (let t = 0; t < e.length; t++) {
|
|
218
225
|
const n = e[t];
|
|
219
|
-
n.
|
|
220
|
-
if (n.T !==
|
|
221
|
-
n.
|
|
222
|
-
n.T =
|
|
226
|
+
n.te = undefined;
|
|
227
|
+
if (n.T !== v) {
|
|
228
|
+
n.ne = n.T;
|
|
229
|
+
n.T = v;
|
|
223
230
|
}
|
|
224
231
|
const r = n.H;
|
|
225
|
-
n.H =
|
|
226
|
-
if (r !==
|
|
232
|
+
n.H = v;
|
|
233
|
+
if (r !== v && n.ne !== r) insertSubs(n, true);
|
|
227
234
|
n.X = null;
|
|
228
235
|
}
|
|
229
236
|
e.length = 0;
|
|
230
237
|
}
|
|
231
238
|
function cleanupCompletedLanes(e) {
|
|
232
|
-
for (const t of
|
|
239
|
+
for (const t of D) {
|
|
233
240
|
const n = e ? t.X === e : !t.X;
|
|
234
241
|
if (!n) continue;
|
|
235
242
|
if (!t.M) {
|
|
236
|
-
if (t.F[0].length) runQueue(t.F[0],
|
|
237
|
-
if (t.F[1].length) runQueue(t.F[1],
|
|
243
|
+
if (t.F[0].length) runQueue(t.F[0], b);
|
|
244
|
+
if (t.F[1].length) runQueue(t.F[1], _);
|
|
238
245
|
}
|
|
239
|
-
if (t.
|
|
246
|
+
if (t.re.te === t) t.re.te = undefined;
|
|
240
247
|
t.D.clear();
|
|
241
248
|
t.F[0].length = 0;
|
|
242
249
|
t.F[1].length = 0;
|
|
243
|
-
|
|
244
|
-
|
|
250
|
+
D.delete(t);
|
|
251
|
+
M.delete(t.re);
|
|
245
252
|
}
|
|
246
253
|
}
|
|
247
254
|
function schedule() {
|
|
248
|
-
if (
|
|
249
|
-
|
|
250
|
-
if (!
|
|
255
|
+
if (I) return;
|
|
256
|
+
I = true;
|
|
257
|
+
if (!q.ie && !T) queueMicrotask(flush);
|
|
251
258
|
}
|
|
252
259
|
class Queue {
|
|
253
260
|
i = null;
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
created =
|
|
261
|
+
se = [[], []];
|
|
262
|
+
oe = [];
|
|
263
|
+
created = A;
|
|
257
264
|
addChild(e) {
|
|
258
|
-
this.
|
|
265
|
+
this.oe.push(e);
|
|
259
266
|
e.i = this;
|
|
260
267
|
}
|
|
261
268
|
removeChild(e) {
|
|
262
|
-
const t = this.
|
|
269
|
+
const t = this.oe.indexOf(e);
|
|
263
270
|
if (t >= 0) {
|
|
264
|
-
this.
|
|
271
|
+
this.oe.splice(t, 1);
|
|
265
272
|
e.i = null;
|
|
266
273
|
}
|
|
267
274
|
}
|
|
@@ -270,122 +277,122 @@ class Queue {
|
|
|
270
277
|
return false;
|
|
271
278
|
}
|
|
272
279
|
run(e) {
|
|
273
|
-
if (this.
|
|
274
|
-
const t = this.
|
|
275
|
-
this.
|
|
280
|
+
if (this.se[e - 1].length) {
|
|
281
|
+
const t = this.se[e - 1];
|
|
282
|
+
this.se[e - 1] = [];
|
|
276
283
|
runQueue(t, e);
|
|
277
284
|
}
|
|
278
|
-
for (let t = 0; t < this.
|
|
285
|
+
for (let t = 0; t < this.oe.length; t++) this.oe[t].run?.(e);
|
|
279
286
|
}
|
|
280
287
|
enqueue(e, t) {
|
|
281
288
|
if (e) {
|
|
282
|
-
if (
|
|
283
|
-
const n = findLane(
|
|
289
|
+
if (Y) {
|
|
290
|
+
const n = findLane(Y);
|
|
284
291
|
n.F[e - 1].push(t);
|
|
285
292
|
} else {
|
|
286
|
-
this.
|
|
293
|
+
this.se[e - 1].push(t);
|
|
287
294
|
}
|
|
288
295
|
}
|
|
289
296
|
schedule();
|
|
290
297
|
}
|
|
291
298
|
stashQueues(e) {
|
|
292
|
-
e.
|
|
293
|
-
e.
|
|
294
|
-
this.
|
|
295
|
-
for (let t = 0; t < this.
|
|
296
|
-
let n = this.
|
|
297
|
-
let r = e.
|
|
299
|
+
e.se[0].push(...this.se[0]);
|
|
300
|
+
e.se[1].push(...this.se[1]);
|
|
301
|
+
this.se = [[], []];
|
|
302
|
+
for (let t = 0; t < this.oe.length; t++) {
|
|
303
|
+
let n = this.oe[t];
|
|
304
|
+
let r = e.oe[t];
|
|
298
305
|
if (!r) {
|
|
299
|
-
r = {
|
|
300
|
-
e.
|
|
306
|
+
r = { se: [[], []], oe: [] };
|
|
307
|
+
e.oe[t] = r;
|
|
301
308
|
}
|
|
302
309
|
n.stashQueues(r);
|
|
303
310
|
}
|
|
304
311
|
}
|
|
305
312
|
restoreQueues(e) {
|
|
306
|
-
this.
|
|
307
|
-
this.
|
|
308
|
-
for (let t = 0; t < e.
|
|
309
|
-
const n = e.
|
|
310
|
-
let r = this.
|
|
313
|
+
this.se[0].push(...e.se[0]);
|
|
314
|
+
this.se[1].push(...e.se[1]);
|
|
315
|
+
for (let t = 0; t < e.oe.length; t++) {
|
|
316
|
+
const n = e.oe[t];
|
|
317
|
+
let r = this.oe[t];
|
|
311
318
|
if (r) r.restoreQueues(n);
|
|
312
319
|
}
|
|
313
320
|
}
|
|
314
321
|
}
|
|
315
322
|
class GlobalQueue extends Queue {
|
|
316
|
-
|
|
317
|
-
|
|
323
|
+
ie = false;
|
|
324
|
+
ue = [];
|
|
318
325
|
Y = [];
|
|
319
326
|
Z = new Set();
|
|
320
|
-
static ue;
|
|
321
327
|
static fe;
|
|
322
|
-
static le
|
|
328
|
+
static le;
|
|
329
|
+
static ce = null;
|
|
323
330
|
flush() {
|
|
324
|
-
if (this.
|
|
325
|
-
this.
|
|
331
|
+
if (this.ie) return;
|
|
332
|
+
this.ie = true;
|
|
326
333
|
try {
|
|
327
|
-
runHeap(
|
|
328
|
-
if (
|
|
329
|
-
const e = transitionComplete(
|
|
334
|
+
runHeap(j, GlobalQueue.fe);
|
|
335
|
+
if (L) {
|
|
336
|
+
const e = transitionComplete(L);
|
|
330
337
|
if (!e) {
|
|
331
|
-
const e =
|
|
332
|
-
runHeap(
|
|
333
|
-
this.
|
|
338
|
+
const e = L;
|
|
339
|
+
runHeap(R, GlobalQueue.fe);
|
|
340
|
+
this.ue = [];
|
|
334
341
|
this.Y = [];
|
|
335
342
|
this.Z = new Set();
|
|
336
|
-
runLaneEffects(
|
|
337
|
-
runLaneEffects(
|
|
338
|
-
this.stashQueues(e.
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
reassignPendingTransition(e.
|
|
342
|
-
|
|
343
|
-
if (!e.J.length && e.Y.length) {
|
|
344
|
-
|
|
343
|
+
runLaneEffects(b);
|
|
344
|
+
runLaneEffects(_);
|
|
345
|
+
this.stashQueues(e.ae);
|
|
346
|
+
A++;
|
|
347
|
+
I = j.S >= j.W;
|
|
348
|
+
reassignPendingTransition(e.ue);
|
|
349
|
+
L = null;
|
|
350
|
+
if (!e.J.length && !e.$.size && e.Y.length) {
|
|
351
|
+
H = new Set();
|
|
345
352
|
for (let t = 0; t < e.Y.length; t++) {
|
|
346
353
|
const n = e.Y[t];
|
|
347
|
-
if (n.I || n.
|
|
348
|
-
|
|
354
|
+
if (n.I || n.de & a) continue;
|
|
355
|
+
H.add(n);
|
|
349
356
|
queueStashedOptimisticEffects(n);
|
|
350
357
|
}
|
|
351
358
|
}
|
|
352
359
|
try {
|
|
353
360
|
finalizePureQueue(null, true);
|
|
354
361
|
} finally {
|
|
355
|
-
|
|
362
|
+
H = null;
|
|
356
363
|
}
|
|
357
364
|
return;
|
|
358
365
|
}
|
|
359
|
-
this.
|
|
360
|
-
this.restoreQueues(
|
|
361
|
-
|
|
362
|
-
const t =
|
|
363
|
-
|
|
364
|
-
reassignPendingTransition(this.
|
|
366
|
+
this.ue !== L.ue && this.ue.push(...L.ue);
|
|
367
|
+
this.restoreQueues(L.ae);
|
|
368
|
+
W.delete(L);
|
|
369
|
+
const t = L;
|
|
370
|
+
L = null;
|
|
371
|
+
reassignPendingTransition(this.ue);
|
|
365
372
|
finalizePureQueue(t);
|
|
366
373
|
} else {
|
|
367
|
-
if (
|
|
374
|
+
if (W.size) runHeap(R, GlobalQueue.fe);
|
|
368
375
|
finalizePureQueue();
|
|
369
376
|
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
runLaneEffects(
|
|
373
|
-
this.run(
|
|
374
|
-
runLaneEffects(
|
|
375
|
-
this.run(
|
|
377
|
+
A++;
|
|
378
|
+
I = j.S >= j.W;
|
|
379
|
+
runLaneEffects(b);
|
|
380
|
+
this.run(b);
|
|
381
|
+
runLaneEffects(_);
|
|
382
|
+
this.run(_);
|
|
376
383
|
if (false);
|
|
377
384
|
} finally {
|
|
378
|
-
this.
|
|
385
|
+
this.ie = false;
|
|
379
386
|
}
|
|
380
387
|
}
|
|
381
388
|
notify(e, t, n, r) {
|
|
382
|
-
if (t &
|
|
383
|
-
if (n &
|
|
384
|
-
const t = r !== undefined ? r : e.
|
|
385
|
-
if (
|
|
389
|
+
if (t & S) {
|
|
390
|
+
if (n & S) {
|
|
391
|
+
const t = r !== undefined ? r : e.he;
|
|
392
|
+
if (L && t) {
|
|
386
393
|
const n = t.source;
|
|
387
|
-
let r =
|
|
388
|
-
if (!r)
|
|
394
|
+
let r = L.$.get(n);
|
|
395
|
+
if (!r) L.$.set(n, (r = new Set()));
|
|
389
396
|
const i = r.size;
|
|
390
397
|
r.add(e);
|
|
391
398
|
if (r.size !== i) schedule();
|
|
@@ -397,57 +404,58 @@ class GlobalQueue extends Queue {
|
|
|
397
404
|
}
|
|
398
405
|
initTransition(e) {
|
|
399
406
|
if (e) e = currentTransition(e);
|
|
400
|
-
if (e && e ===
|
|
401
|
-
if (!e &&
|
|
402
|
-
if (!
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
407
|
+
if (e && e === L) return;
|
|
408
|
+
if (!e && L && L.pe === A) return;
|
|
409
|
+
if (!L) {
|
|
410
|
+
L = e ?? {
|
|
411
|
+
pe: A,
|
|
412
|
+
ue: [],
|
|
406
413
|
$: new Map(),
|
|
407
414
|
Y: [],
|
|
408
415
|
Z: new Set(),
|
|
409
416
|
J: [],
|
|
410
|
-
|
|
411
|
-
U: false
|
|
417
|
+
ae: { se: [[], []], oe: [] },
|
|
418
|
+
U: false,
|
|
419
|
+
ee: new Set()
|
|
412
420
|
};
|
|
413
421
|
} else if (e) {
|
|
414
|
-
const t =
|
|
422
|
+
const t = L;
|
|
415
423
|
mergeTransitionState(e, t);
|
|
416
|
-
|
|
417
|
-
|
|
424
|
+
W.delete(t);
|
|
425
|
+
L = e;
|
|
418
426
|
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
if (this.
|
|
422
|
-
for (let e = 0; e < this.
|
|
423
|
-
const t = this.
|
|
424
|
-
t.X =
|
|
425
|
-
|
|
427
|
+
W.add(L);
|
|
428
|
+
L.pe = A;
|
|
429
|
+
if (this.ue !== L.ue) {
|
|
430
|
+
for (let e = 0; e < this.ue.length; e++) {
|
|
431
|
+
const t = this.ue[e];
|
|
432
|
+
t.X = L;
|
|
433
|
+
L.ue.push(t);
|
|
426
434
|
}
|
|
427
|
-
this.
|
|
435
|
+
this.ue = L.ue;
|
|
428
436
|
}
|
|
429
|
-
if (this.Y !==
|
|
437
|
+
if (this.Y !== L.Y) {
|
|
430
438
|
for (let e = 0; e < this.Y.length; e++) {
|
|
431
439
|
const t = this.Y[e];
|
|
432
|
-
t.X =
|
|
433
|
-
|
|
440
|
+
t.X = L;
|
|
441
|
+
L.Y.push(t);
|
|
434
442
|
}
|
|
435
|
-
this.Y =
|
|
443
|
+
this.Y = L.Y;
|
|
436
444
|
}
|
|
437
|
-
for (const e of
|
|
438
|
-
if (!e.X) e.X =
|
|
445
|
+
for (const e of D) {
|
|
446
|
+
if (!e.X) e.X = L;
|
|
439
447
|
}
|
|
440
|
-
if (this.Z !==
|
|
441
|
-
for (const e of this.Z)
|
|
442
|
-
this.Z =
|
|
448
|
+
if (this.Z !== L.Z) {
|
|
449
|
+
for (const e of this.Z) L.Z.add(e);
|
|
450
|
+
this.Z = L.Z;
|
|
443
451
|
}
|
|
444
452
|
}
|
|
445
453
|
}
|
|
446
454
|
function insertSubs(e, t = false) {
|
|
447
|
-
const n = e.
|
|
448
|
-
const r = e.
|
|
455
|
+
const n = e.te || Y;
|
|
456
|
+
const r = e.ye !== undefined;
|
|
449
457
|
for (let i = e.O; i !== null; i = i.P) {
|
|
450
|
-
if (r && i.k.
|
|
458
|
+
if (r && i.k.de & p) {
|
|
451
459
|
i.k.m |= l;
|
|
452
460
|
continue;
|
|
453
461
|
}
|
|
@@ -456,47 +464,63 @@ function insertSubs(e, t = false) {
|
|
|
456
464
|
assignOrMergeLane(i.k, n);
|
|
457
465
|
} else if (t) {
|
|
458
466
|
i.k.m |= f;
|
|
459
|
-
i.k.
|
|
467
|
+
i.k.te = undefined;
|
|
460
468
|
}
|
|
461
469
|
const e = i.k;
|
|
462
|
-
if (e.V ===
|
|
470
|
+
if (e.V === O) {
|
|
463
471
|
if (!e.B) {
|
|
464
472
|
e.B = true;
|
|
465
|
-
e.K.enqueue(
|
|
473
|
+
e.K.enqueue(_, e.G);
|
|
466
474
|
}
|
|
467
475
|
continue;
|
|
468
476
|
}
|
|
469
|
-
const s = i.k.m & o ?
|
|
477
|
+
const s = i.k.m & o ? R : j;
|
|
470
478
|
if (s.W > i.k.o) s.W = i.k.o;
|
|
471
479
|
insertIntoHeap(i.k, s);
|
|
472
480
|
}
|
|
473
481
|
}
|
|
474
482
|
function commitPendingNodes() {
|
|
475
|
-
const e =
|
|
483
|
+
const e = q.ue;
|
|
476
484
|
for (let t = 0; t < e.length; t++) {
|
|
477
485
|
const n = e[t];
|
|
478
|
-
if (n.T !==
|
|
479
|
-
n.
|
|
480
|
-
n.T =
|
|
481
|
-
if (n.V && n.V !==
|
|
486
|
+
if (n.T !== v) {
|
|
487
|
+
n.ne = n.T;
|
|
488
|
+
n.T = v;
|
|
489
|
+
if (n.V && n.V !== O) n.B = true;
|
|
482
490
|
}
|
|
483
|
-
if (!(n.ge &
|
|
484
|
-
if (n.I) GlobalQueue.
|
|
491
|
+
if (!(n.ge & S)) n.ge &= ~m;
|
|
492
|
+
if (n.I) GlobalQueue.le(n, false, true);
|
|
485
493
|
}
|
|
486
494
|
e.length = 0;
|
|
487
495
|
}
|
|
488
496
|
function finalizePureQueue(e = null, t = false) {
|
|
489
497
|
const n = !t;
|
|
490
498
|
if (n) commitPendingNodes();
|
|
491
|
-
if (!t) checkBoundaryChildren(
|
|
492
|
-
if (
|
|
499
|
+
if (!t) checkBoundaryChildren(q);
|
|
500
|
+
if (j.S >= j.W) runHeap(j, GlobalQueue.fe);
|
|
493
501
|
if (n) {
|
|
494
502
|
commitPendingNodes();
|
|
495
|
-
resolveOptimisticNodes(e ? e.Y :
|
|
496
|
-
|
|
497
|
-
|
|
503
|
+
resolveOptimisticNodes(e ? e.Y : q.Y);
|
|
504
|
+
if (e && e.ee.size) {
|
|
505
|
+
for (const t of e.ee) {
|
|
506
|
+
if (t.m & u) continue;
|
|
507
|
+
if (t.V === O) {
|
|
508
|
+
if (!t.B) {
|
|
509
|
+
t.B = true;
|
|
510
|
+
t.K.enqueue(_, t.G);
|
|
511
|
+
}
|
|
512
|
+
continue;
|
|
513
|
+
}
|
|
514
|
+
const e = t.m & o ? R : j;
|
|
515
|
+
if (e.W > t.o) e.W = t.o;
|
|
516
|
+
insertIntoHeap(t, e);
|
|
517
|
+
}
|
|
518
|
+
e.ee.clear();
|
|
519
|
+
}
|
|
520
|
+
const t = e ? e.Z : q.Z;
|
|
521
|
+
if (GlobalQueue.ce && t.size) {
|
|
498
522
|
for (const e of t) {
|
|
499
|
-
GlobalQueue.
|
|
523
|
+
GlobalQueue.ce(e);
|
|
500
524
|
}
|
|
501
525
|
t.clear();
|
|
502
526
|
schedule();
|
|
@@ -506,27 +530,27 @@ function finalizePureQueue(e = null, t = false) {
|
|
|
506
530
|
}
|
|
507
531
|
}
|
|
508
532
|
function checkBoundaryChildren(e) {
|
|
509
|
-
for (const t of e.
|
|
533
|
+
for (const t of e.oe) {
|
|
510
534
|
t.checkSources?.();
|
|
511
535
|
checkBoundaryChildren(t);
|
|
512
536
|
}
|
|
513
537
|
}
|
|
514
538
|
function trackOptimisticStore(e) {
|
|
515
|
-
|
|
539
|
+
q.Z.add(e);
|
|
516
540
|
schedule();
|
|
517
541
|
}
|
|
518
542
|
function reassignPendingTransition(e) {
|
|
519
543
|
for (let t = 0; t < e.length; t++) {
|
|
520
|
-
e[t].X =
|
|
544
|
+
e[t].X = L;
|
|
521
545
|
}
|
|
522
546
|
}
|
|
523
|
-
const
|
|
547
|
+
const q = new GlobalQueue();
|
|
524
548
|
function flush() {
|
|
525
|
-
if (
|
|
549
|
+
if (q.ie) {
|
|
526
550
|
return;
|
|
527
551
|
}
|
|
528
|
-
while (
|
|
529
|
-
|
|
552
|
+
while (I || L) {
|
|
553
|
+
q.flush();
|
|
530
554
|
}
|
|
531
555
|
}
|
|
532
556
|
function runQueue(e, t) {
|
|
@@ -542,7 +566,7 @@ function reporterBlocksSource(e, t) {
|
|
|
542
566
|
e = e.me;
|
|
543
567
|
}
|
|
544
568
|
}
|
|
545
|
-
return !!(e.ge &
|
|
569
|
+
return !!(e.ge & S && e.he instanceof NotReadyError && e.he.source === t);
|
|
546
570
|
}
|
|
547
571
|
function transitionComplete(e) {
|
|
548
572
|
if (e.U) return true;
|
|
@@ -558,7 +582,7 @@ function transitionComplete(e) {
|
|
|
558
582
|
r.delete(e);
|
|
559
583
|
}
|
|
560
584
|
if (!i) e.$.delete(n);
|
|
561
|
-
else if (n.ge &
|
|
585
|
+
else if (n.ge & S && n.he?.source === n) {
|
|
562
586
|
t = false;
|
|
563
587
|
break;
|
|
564
588
|
}
|
|
@@ -569,9 +593,9 @@ function transitionComplete(e) {
|
|
|
569
593
|
if (
|
|
570
594
|
hasActiveOverride(r) &&
|
|
571
595
|
"ge" in r &&
|
|
572
|
-
r.ge &
|
|
573
|
-
r.
|
|
574
|
-
r.
|
|
596
|
+
r.ge & S &&
|
|
597
|
+
r.he instanceof NotReadyError &&
|
|
598
|
+
r.he.source !== r
|
|
575
599
|
) {
|
|
576
600
|
t = false;
|
|
577
601
|
break;
|
|
@@ -586,29 +610,29 @@ function currentTransition(e) {
|
|
|
586
610
|
return e;
|
|
587
611
|
}
|
|
588
612
|
function setActiveTransition(e) {
|
|
589
|
-
|
|
613
|
+
L = e;
|
|
590
614
|
}
|
|
591
615
|
function runInTransition(e, t) {
|
|
592
|
-
const n =
|
|
616
|
+
const n = L;
|
|
593
617
|
try {
|
|
594
|
-
|
|
618
|
+
L = currentTransition(e);
|
|
595
619
|
return t();
|
|
596
620
|
} finally {
|
|
597
|
-
|
|
621
|
+
L = n;
|
|
598
622
|
}
|
|
599
623
|
}
|
|
600
|
-
const
|
|
601
|
-
const
|
|
624
|
+
const M = new WeakMap();
|
|
625
|
+
const D = new Set();
|
|
602
626
|
function getOrCreateLane(e) {
|
|
603
|
-
let t =
|
|
627
|
+
let t = M.get(e);
|
|
604
628
|
if (t) {
|
|
605
629
|
return findLane(t);
|
|
606
630
|
}
|
|
607
631
|
const n = e.me;
|
|
608
|
-
const r = n?.
|
|
609
|
-
t = {
|
|
610
|
-
|
|
611
|
-
|
|
632
|
+
const r = n?.te ? findLane(n.te) : null;
|
|
633
|
+
t = { re: e, D: new Set(), F: [[], []], M: null, X: L, be: r };
|
|
634
|
+
M.set(e, t);
|
|
635
|
+
D.add(t);
|
|
612
636
|
e._e = false;
|
|
613
637
|
return t;
|
|
614
638
|
}
|
|
@@ -627,39 +651,39 @@ function mergeLanes(e, t) {
|
|
|
627
651
|
return e;
|
|
628
652
|
}
|
|
629
653
|
function resolveLane(e) {
|
|
630
|
-
const t = e.
|
|
654
|
+
const t = e.te;
|
|
631
655
|
if (!t) return undefined;
|
|
632
656
|
const n = findLane(t);
|
|
633
|
-
if (
|
|
634
|
-
e.
|
|
657
|
+
if (D.has(n)) return n;
|
|
658
|
+
e.te = undefined;
|
|
635
659
|
return undefined;
|
|
636
660
|
}
|
|
637
661
|
function resolveTransition(e) {
|
|
638
662
|
return resolveLane(e)?.X ?? e.X;
|
|
639
663
|
}
|
|
640
664
|
function hasActiveOverride(e) {
|
|
641
|
-
return !!(e.H !== undefined && e.H !==
|
|
665
|
+
return !!(e.H !== undefined && e.H !== v);
|
|
642
666
|
}
|
|
643
667
|
function assignOrMergeLane(e, t) {
|
|
644
668
|
const n = findLane(t);
|
|
645
|
-
const r = e.
|
|
669
|
+
const r = e.te;
|
|
646
670
|
if (r) {
|
|
647
671
|
if (r.M) {
|
|
648
|
-
e.
|
|
672
|
+
e.te = t;
|
|
649
673
|
return;
|
|
650
674
|
}
|
|
651
675
|
const i = findLane(r);
|
|
652
|
-
if (
|
|
676
|
+
if (D.has(i)) {
|
|
653
677
|
if (i !== n && !hasActiveOverride(e)) {
|
|
654
678
|
if (n.be && findLane(n.be) === i) {
|
|
655
|
-
e.
|
|
679
|
+
e.te = t;
|
|
656
680
|
} else if (i.be && findLane(i.be) === n);
|
|
657
681
|
else mergeLanes(n, i);
|
|
658
682
|
}
|
|
659
683
|
return;
|
|
660
684
|
}
|
|
661
685
|
}
|
|
662
|
-
e.
|
|
686
|
+
e.te = t;
|
|
663
687
|
}
|
|
664
688
|
function unlinkSubs(e) {
|
|
665
689
|
const t = e.A;
|
|
@@ -673,43 +697,44 @@ function unlinkSubs(e) {
|
|
|
673
697
|
t.O = r;
|
|
674
698
|
if (r === null) {
|
|
675
699
|
t.q?.();
|
|
676
|
-
|
|
700
|
+
const e = t;
|
|
701
|
+
e.I && e.de & g && !(e.m & o) && unobserved(e);
|
|
677
702
|
}
|
|
678
703
|
}
|
|
679
704
|
return n;
|
|
680
705
|
}
|
|
681
706
|
function unobserved(e) {
|
|
682
|
-
deleteFromHeap(e, e.m & o ?
|
|
707
|
+
deleteFromHeap(e, e.m & o ? R : j);
|
|
683
708
|
let t = e.j;
|
|
684
709
|
while (t !== null) {
|
|
685
710
|
t = unlinkSubs(t);
|
|
686
711
|
}
|
|
687
712
|
e.j = null;
|
|
688
|
-
e.
|
|
713
|
+
e.xe = null;
|
|
689
714
|
disposeChildren(e, true);
|
|
690
715
|
}
|
|
691
716
|
function link(e, t) {
|
|
692
|
-
const n = t.
|
|
717
|
+
const n = t.xe;
|
|
693
718
|
if (n !== null && n.A === e) return;
|
|
694
719
|
let i = null;
|
|
695
720
|
const s = t.m & r;
|
|
696
721
|
if (s) {
|
|
697
722
|
i = n !== null ? n.R : t.j;
|
|
698
723
|
if (i !== null && i.A === e) {
|
|
699
|
-
t.
|
|
724
|
+
t.xe = i;
|
|
700
725
|
return;
|
|
701
726
|
}
|
|
702
727
|
}
|
|
703
728
|
const o = e.ve;
|
|
704
729
|
if (o !== null && o.k === t && (!s || isValidLink(o, t))) return;
|
|
705
|
-
const u = (t.
|
|
730
|
+
const u = (t.xe = e.ve = { A: e, k: t, R: i, Oe: o, P: null });
|
|
706
731
|
if (n !== null) n.R = u;
|
|
707
732
|
else t.j = u;
|
|
708
733
|
if (o !== null) o.P = u;
|
|
709
734
|
else e.O = u;
|
|
710
735
|
}
|
|
711
736
|
function isValidLink(e, t) {
|
|
712
|
-
const n = t.
|
|
737
|
+
const n = t.xe;
|
|
713
738
|
if (n !== null) {
|
|
714
739
|
let r = t.j;
|
|
715
740
|
do {
|
|
@@ -720,17 +745,17 @@ function isValidLink(e, t) {
|
|
|
720
745
|
}
|
|
721
746
|
return false;
|
|
722
747
|
}
|
|
723
|
-
const
|
|
748
|
+
const F = {};
|
|
724
749
|
function markDisposal(e) {
|
|
725
|
-
let t = e.
|
|
750
|
+
let t = e.Pe;
|
|
726
751
|
while (t) {
|
|
727
752
|
t.m |= o;
|
|
728
753
|
if (t.m & i) {
|
|
729
|
-
deleteFromHeap(t,
|
|
730
|
-
insertIntoHeap(t,
|
|
754
|
+
deleteFromHeap(t, j);
|
|
755
|
+
insertIntoHeap(t, R);
|
|
731
756
|
}
|
|
732
757
|
markDisposal(t);
|
|
733
|
-
t = t.
|
|
758
|
+
t = t.ke;
|
|
734
759
|
}
|
|
735
760
|
}
|
|
736
761
|
function dispose(e) {
|
|
@@ -739,39 +764,39 @@ function dispose(e) {
|
|
|
739
764
|
t = unlinkSubs(t);
|
|
740
765
|
} while (t !== null);
|
|
741
766
|
e.j = null;
|
|
742
|
-
e.
|
|
767
|
+
e.xe = null;
|
|
743
768
|
disposeChildren(e, true);
|
|
744
769
|
}
|
|
745
770
|
function disposeChildren(e, t = false, n) {
|
|
746
771
|
if (e.m & u) return;
|
|
747
772
|
if (t) e.m = u;
|
|
748
|
-
if (t && e.I) e.
|
|
749
|
-
let r = n ? e.
|
|
773
|
+
if (t && e.I) e.Ee = null;
|
|
774
|
+
let r = n ? e.Ce : e.Pe;
|
|
750
775
|
while (r) {
|
|
751
|
-
const e = r.
|
|
776
|
+
const e = r.ke;
|
|
752
777
|
if (r.j) {
|
|
753
778
|
const e = r;
|
|
754
|
-
deleteFromHeap(e, e.m & o ?
|
|
779
|
+
deleteFromHeap(e, e.m & o ? R : j);
|
|
755
780
|
let t = e.j;
|
|
756
781
|
do {
|
|
757
782
|
t = unlinkSubs(t);
|
|
758
783
|
} while (t !== null);
|
|
759
784
|
e.j = null;
|
|
760
|
-
e.
|
|
785
|
+
e.xe = null;
|
|
761
786
|
}
|
|
762
787
|
disposeChildren(r, true);
|
|
763
788
|
r = e;
|
|
764
789
|
}
|
|
765
790
|
if (n) {
|
|
766
|
-
e.
|
|
791
|
+
e.Ce = null;
|
|
767
792
|
} else {
|
|
768
|
-
e.
|
|
769
|
-
e.
|
|
793
|
+
e.Pe = null;
|
|
794
|
+
e.Ne = 0;
|
|
770
795
|
}
|
|
771
796
|
runDisposal(e, n);
|
|
772
797
|
}
|
|
773
798
|
function runDisposal(e, t) {
|
|
774
|
-
let n = t ? e.
|
|
799
|
+
let n = t ? e.We : e.je;
|
|
775
800
|
if (!n) return;
|
|
776
801
|
if (Array.isArray(n)) {
|
|
777
802
|
for (let e = 0; e < n.length; e++) {
|
|
@@ -781,12 +806,12 @@ function runDisposal(e, t) {
|
|
|
781
806
|
} else {
|
|
782
807
|
n.call(n);
|
|
783
808
|
}
|
|
784
|
-
t ? (e.
|
|
809
|
+
t ? (e.We = null) : (e.je = null);
|
|
785
810
|
}
|
|
786
811
|
function childId(e, t) {
|
|
787
812
|
let n = e;
|
|
788
|
-
while (n.
|
|
789
|
-
if (n.id != null) return formatId(n.id, t ? n.
|
|
813
|
+
while (n.de & h && n.i) n = n.i;
|
|
814
|
+
if (n.id != null) return formatId(n.id, t ? n.Ne++ : n.Ne);
|
|
790
815
|
throw new Error("Cannot get child id from owner without an id");
|
|
791
816
|
}
|
|
792
817
|
function getNextChildId(e) {
|
|
@@ -801,50 +826,50 @@ function formatId(e, t) {
|
|
|
801
826
|
return e + (r ? String.fromCharCode(64 + r) : "") + n;
|
|
802
827
|
}
|
|
803
828
|
function getObserver() {
|
|
804
|
-
if (
|
|
805
|
-
return
|
|
829
|
+
if (z || J) return F;
|
|
830
|
+
return B ? X : null;
|
|
806
831
|
}
|
|
807
832
|
function getOwner() {
|
|
808
|
-
return
|
|
833
|
+
return X;
|
|
809
834
|
}
|
|
810
835
|
function cleanup(e) {
|
|
811
|
-
if (!
|
|
812
|
-
if (!
|
|
813
|
-
else if (Array.isArray(
|
|
814
|
-
else
|
|
836
|
+
if (!X) return e;
|
|
837
|
+
if (!X.je) X.je = e;
|
|
838
|
+
else if (Array.isArray(X.je)) X.je.push(e);
|
|
839
|
+
else X.je = [X.je, e];
|
|
815
840
|
return e;
|
|
816
841
|
}
|
|
817
842
|
function isDisposed(e) {
|
|
818
843
|
return !!(e.m & (u | o));
|
|
819
844
|
}
|
|
820
845
|
function createOwner(e) {
|
|
821
|
-
const t =
|
|
846
|
+
const t = X;
|
|
822
847
|
const n = e?.transparent ?? false;
|
|
823
848
|
const r = {
|
|
824
849
|
id: e?.id ?? (n ? t?.id : t?.id != null ? getNextChildId(t) : undefined),
|
|
825
|
-
|
|
850
|
+
de: n ? h : 0,
|
|
826
851
|
t: true,
|
|
827
852
|
u: t?.t ? t.u : t,
|
|
853
|
+
Pe: null,
|
|
828
854
|
ke: null,
|
|
829
|
-
Ee: null,
|
|
830
|
-
Re: null,
|
|
831
|
-
K: t?.K ?? A,
|
|
832
|
-
Le: t?.Le || _,
|
|
833
|
-
We: 0,
|
|
834
855
|
je: null,
|
|
835
|
-
|
|
856
|
+
K: t?.K ?? q,
|
|
857
|
+
Re: t?.Re || E,
|
|
858
|
+
Ne: 0,
|
|
859
|
+
We: null,
|
|
860
|
+
Ce: null,
|
|
836
861
|
i: t,
|
|
837
862
|
dispose(e = true) {
|
|
838
863
|
disposeChildren(r, e);
|
|
839
864
|
}
|
|
840
865
|
};
|
|
841
866
|
if (t) {
|
|
842
|
-
const e = t.
|
|
867
|
+
const e = t.Pe;
|
|
843
868
|
if (e === null) {
|
|
844
|
-
t.
|
|
869
|
+
t.Pe = r;
|
|
845
870
|
} else {
|
|
846
|
-
r.
|
|
847
|
-
t.
|
|
871
|
+
r.ke = e;
|
|
872
|
+
t.Pe = r;
|
|
848
873
|
}
|
|
849
874
|
}
|
|
850
875
|
return r;
|
|
@@ -889,16 +914,16 @@ function clearPendingSources(e) {
|
|
|
889
914
|
}
|
|
890
915
|
function setPendingError(e, t, n) {
|
|
891
916
|
if (!t) {
|
|
892
|
-
e.
|
|
917
|
+
e.he = null;
|
|
893
918
|
return;
|
|
894
919
|
}
|
|
895
920
|
if (n instanceof NotReadyError && n.source === t) {
|
|
896
|
-
e.
|
|
921
|
+
e.he = n;
|
|
897
922
|
return;
|
|
898
923
|
}
|
|
899
|
-
const r = e.
|
|
924
|
+
const r = e.he;
|
|
900
925
|
if (!(r instanceof NotReadyError) || r.source !== t) {
|
|
901
|
-
e.
|
|
926
|
+
e.he = new NotReadyError(t);
|
|
902
927
|
}
|
|
903
928
|
}
|
|
904
929
|
function forEachDependent(e, t) {
|
|
@@ -913,30 +938,30 @@ function settlePendingSource(e) {
|
|
|
913
938
|
const settle = r => {
|
|
914
939
|
if (n.has(r) || !removePendingSource(r, e)) return;
|
|
915
940
|
n.add(r);
|
|
916
|
-
r.
|
|
941
|
+
r.pe = A;
|
|
917
942
|
const i = r.Se ?? r.we?.values().next().value;
|
|
918
943
|
if (i) {
|
|
919
944
|
setPendingError(r, i);
|
|
920
945
|
updatePendingSignal(r);
|
|
921
946
|
} else {
|
|
922
|
-
r.ge &= ~
|
|
947
|
+
r.ge &= ~S;
|
|
923
948
|
setPendingError(r);
|
|
924
949
|
updatePendingSignal(r);
|
|
925
|
-
if (r.
|
|
926
|
-
if (r.V ===
|
|
950
|
+
if (r.Ae) {
|
|
951
|
+
if (r.V === O) {
|
|
927
952
|
const e = r;
|
|
928
953
|
if (!e.B) {
|
|
929
954
|
e.B = true;
|
|
930
|
-
e.K.enqueue(
|
|
955
|
+
e.K.enqueue(_, e.G);
|
|
931
956
|
}
|
|
932
957
|
} else {
|
|
933
|
-
const e = r.m & o ?
|
|
958
|
+
const e = r.m & o ? R : j;
|
|
934
959
|
if (e.W > r.o) e.W = r.o;
|
|
935
960
|
insertIntoHeap(r, e);
|
|
936
961
|
}
|
|
937
962
|
t = true;
|
|
938
963
|
}
|
|
939
|
-
r.
|
|
964
|
+
r.Ae = false;
|
|
940
965
|
}
|
|
941
966
|
forEachDependent(r, settle);
|
|
942
967
|
};
|
|
@@ -948,42 +973,42 @@ function handleAsync(e, t, r) {
|
|
|
948
973
|
const s = i && untrack(() => t[Symbol.asyncIterator]);
|
|
949
974
|
const o = !s && i && untrack(() => typeof t.then === "function");
|
|
950
975
|
if (!o && !s) {
|
|
951
|
-
e.
|
|
976
|
+
e.Ee = null;
|
|
952
977
|
return t;
|
|
953
978
|
}
|
|
954
|
-
e.
|
|
979
|
+
e.Ee = t;
|
|
955
980
|
let u;
|
|
956
981
|
const handleError = n => {
|
|
957
|
-
if (e.
|
|
958
|
-
|
|
959
|
-
notifyStatus(e, n instanceof NotReadyError ?
|
|
960
|
-
e.
|
|
982
|
+
if (e.Ee !== t) return;
|
|
983
|
+
q.initTransition(resolveTransition(e));
|
|
984
|
+
notifyStatus(e, n instanceof NotReadyError ? S : w, n);
|
|
985
|
+
e.pe = A;
|
|
961
986
|
};
|
|
962
987
|
const asyncWrite = (i, s) => {
|
|
963
|
-
if (e.
|
|
988
|
+
if (e.Ee !== t) return;
|
|
964
989
|
if (e.m & (n | f)) return;
|
|
965
|
-
|
|
966
|
-
const o = !!(e.ge &
|
|
990
|
+
q.initTransition(resolveTransition(e));
|
|
991
|
+
const o = !!(e.ge & m);
|
|
967
992
|
clearStatus(e);
|
|
968
993
|
const u = resolveLane(e);
|
|
969
994
|
if (u) u.D.delete(e);
|
|
970
995
|
if (r) r(i);
|
|
971
996
|
else if (e.H !== undefined) {
|
|
972
|
-
if (e.H !== undefined && e.H !==
|
|
997
|
+
if (e.H !== undefined && e.H !== v) e.T = i;
|
|
973
998
|
else {
|
|
974
|
-
e.
|
|
999
|
+
e.ne = i;
|
|
975
1000
|
insertSubs(e);
|
|
976
1001
|
}
|
|
977
|
-
e.
|
|
1002
|
+
e.pe = A;
|
|
978
1003
|
} else if (u) {
|
|
979
1004
|
const t = e.V;
|
|
980
|
-
const n = e.
|
|
981
|
-
const r = e.
|
|
1005
|
+
const n = e.ne;
|
|
1006
|
+
const r = e.Le;
|
|
982
1007
|
if ((!t && o) || !r || !r(i, n)) {
|
|
983
|
-
e.
|
|
984
|
-
e.
|
|
985
|
-
if (e.
|
|
986
|
-
setSignal(e.
|
|
1008
|
+
e.ne = i;
|
|
1009
|
+
e.pe = A;
|
|
1010
|
+
if (e.Ie) {
|
|
1011
|
+
setSignal(e.Ie, i);
|
|
987
1012
|
}
|
|
988
1013
|
insertSubs(e, true);
|
|
989
1014
|
}
|
|
@@ -1011,8 +1036,8 @@ function handleAsync(e, t, r) {
|
|
|
1011
1036
|
);
|
|
1012
1037
|
r = false;
|
|
1013
1038
|
if (!n) {
|
|
1014
|
-
|
|
1015
|
-
throw new NotReadyError(
|
|
1039
|
+
q.initTransition(resolveTransition(e));
|
|
1040
|
+
throw new NotReadyError(X);
|
|
1016
1041
|
}
|
|
1017
1042
|
}
|
|
1018
1043
|
if (s) {
|
|
@@ -1039,7 +1064,7 @@ function handleAsync(e, t, r) {
|
|
|
1039
1064
|
s = n;
|
|
1040
1065
|
o = true;
|
|
1041
1066
|
if (n.done) i = true;
|
|
1042
|
-
} else if (e.
|
|
1067
|
+
} else if (e.Ee !== t) {
|
|
1043
1068
|
return;
|
|
1044
1069
|
} else if (!n.done) asyncWrite(n.value, iterate);
|
|
1045
1070
|
else {
|
|
@@ -1049,7 +1074,7 @@ function handleAsync(e, t, r) {
|
|
|
1049
1074
|
}
|
|
1050
1075
|
},
|
|
1051
1076
|
n => {
|
|
1052
|
-
if (!f && e.
|
|
1077
|
+
if (!f && e.Ee === t) {
|
|
1053
1078
|
i = true;
|
|
1054
1079
|
handleError(n);
|
|
1055
1080
|
}
|
|
@@ -1065,36 +1090,36 @@ function handleAsync(e, t, r) {
|
|
|
1065
1090
|
};
|
|
1066
1091
|
const s = iterate();
|
|
1067
1092
|
if (!r && !s) {
|
|
1068
|
-
|
|
1069
|
-
throw new NotReadyError(
|
|
1093
|
+
q.initTransition(resolveTransition(e));
|
|
1094
|
+
throw new NotReadyError(X);
|
|
1070
1095
|
}
|
|
1071
1096
|
}
|
|
1072
1097
|
return u;
|
|
1073
1098
|
}
|
|
1074
1099
|
function clearStatus(e, t = false) {
|
|
1075
1100
|
clearPendingSources(e);
|
|
1076
|
-
e.
|
|
1077
|
-
e.ge = t ? 0 : e.ge &
|
|
1101
|
+
e.Ae = false;
|
|
1102
|
+
e.ge = t ? 0 : e.ge & m;
|
|
1078
1103
|
setPendingError(e);
|
|
1079
1104
|
updatePendingSignal(e);
|
|
1080
|
-
e.
|
|
1105
|
+
e.Te?.();
|
|
1081
1106
|
}
|
|
1082
1107
|
function notifyStatus(e, t, n, r, i) {
|
|
1083
|
-
if (t ===
|
|
1108
|
+
if (t === w && !(n instanceof StatusError) && !(n instanceof NotReadyError))
|
|
1084
1109
|
n = new StatusError(e, n);
|
|
1085
|
-
const s = t ===
|
|
1110
|
+
const s = t === S && n instanceof NotReadyError ? n.source : undefined;
|
|
1086
1111
|
const o = s === e;
|
|
1087
|
-
const u = t ===
|
|
1112
|
+
const u = t === S && e.H !== undefined && !o;
|
|
1088
1113
|
const f = u && hasActiveOverride(e);
|
|
1089
1114
|
if (!r) {
|
|
1090
|
-
if (t ===
|
|
1115
|
+
if (t === S && s) {
|
|
1091
1116
|
addPendingSource(e, s);
|
|
1092
|
-
e.ge =
|
|
1117
|
+
e.ge = S | (e.ge & m);
|
|
1093
1118
|
setPendingError(e, s, n);
|
|
1094
1119
|
} else {
|
|
1095
1120
|
clearPendingSources(e);
|
|
1096
|
-
e.ge = t | (t !==
|
|
1097
|
-
e.
|
|
1121
|
+
e.ge = t | (t !== w ? e.ge & m : 0);
|
|
1122
|
+
e.he = n;
|
|
1098
1123
|
}
|
|
1099
1124
|
updatePendingSignal(e);
|
|
1100
1125
|
}
|
|
@@ -1103,34 +1128,34 @@ function notifyStatus(e, t, n, r, i) {
|
|
|
1103
1128
|
}
|
|
1104
1129
|
const l = r || f;
|
|
1105
1130
|
const c = r || u ? undefined : i;
|
|
1106
|
-
if (e.
|
|
1107
|
-
if (r && t ===
|
|
1131
|
+
if (e.Te) {
|
|
1132
|
+
if (r && t === S) {
|
|
1108
1133
|
return;
|
|
1109
1134
|
}
|
|
1110
1135
|
if (l) {
|
|
1111
|
-
e.
|
|
1136
|
+
e.Te(t, n);
|
|
1112
1137
|
} else {
|
|
1113
|
-
e.
|
|
1138
|
+
e.Te();
|
|
1114
1139
|
}
|
|
1115
1140
|
return;
|
|
1116
1141
|
}
|
|
1117
1142
|
forEachDependent(e, e => {
|
|
1118
|
-
e.
|
|
1143
|
+
e.pe = A;
|
|
1119
1144
|
if (
|
|
1120
|
-
(t ===
|
|
1121
|
-
(t !==
|
|
1145
|
+
(t === S && s && e.Se !== s && !e.we?.has(s)) ||
|
|
1146
|
+
(t !== S && (e.he !== n || e.Se || e.we))
|
|
1122
1147
|
) {
|
|
1123
|
-
if (!l && !e.X)
|
|
1148
|
+
if (!l && !e.X) q.ue.push(e);
|
|
1124
1149
|
notifyStatus(e, t, n, l, c);
|
|
1125
1150
|
}
|
|
1126
1151
|
});
|
|
1127
1152
|
}
|
|
1128
|
-
let
|
|
1153
|
+
let V = null;
|
|
1129
1154
|
function enableExternalSource(e) {
|
|
1130
1155
|
const { factory: t, untrack: n = e => e() } = e;
|
|
1131
|
-
if (
|
|
1132
|
-
const { factory: e, untrack: r } =
|
|
1133
|
-
|
|
1156
|
+
if (V) {
|
|
1157
|
+
const { factory: e, untrack: r } = V;
|
|
1158
|
+
V = {
|
|
1134
1159
|
factory: (n, r) => {
|
|
1135
1160
|
const i = e(n, r);
|
|
1136
1161
|
const s = t(e => i.track(e), r);
|
|
@@ -1145,139 +1170,153 @@ function enableExternalSource(e) {
|
|
|
1145
1170
|
untrack: e => r(() => n(e))
|
|
1146
1171
|
};
|
|
1147
1172
|
} else {
|
|
1148
|
-
|
|
1149
|
-
}
|
|
1150
|
-
}
|
|
1151
|
-
GlobalQueue.
|
|
1152
|
-
GlobalQueue.
|
|
1153
|
-
let
|
|
1154
|
-
let
|
|
1155
|
-
let M = false;
|
|
1156
|
-
let D = false;
|
|
1157
|
-
let F = false;
|
|
1158
|
-
let V = false;
|
|
1159
|
-
let B = null;
|
|
1160
|
-
let K = null;
|
|
1173
|
+
V = { factory: t, untrack: n };
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
GlobalQueue.fe = recompute;
|
|
1177
|
+
GlobalQueue.le = disposeChildren;
|
|
1178
|
+
let B = false;
|
|
1179
|
+
let K = false;
|
|
1161
1180
|
let G = false;
|
|
1162
|
-
let z =
|
|
1181
|
+
let z = false;
|
|
1182
|
+
let U = false;
|
|
1183
|
+
let J = false;
|
|
1184
|
+
let X = null;
|
|
1185
|
+
let Y = null;
|
|
1186
|
+
let Z = false;
|
|
1187
|
+
let $ = null;
|
|
1163
1188
|
function ownerInSnapshotScope(e) {
|
|
1164
1189
|
while (e) {
|
|
1165
|
-
if (e.
|
|
1190
|
+
if (e.He) return true;
|
|
1166
1191
|
e = e.i;
|
|
1167
1192
|
}
|
|
1168
1193
|
return false;
|
|
1169
1194
|
}
|
|
1170
1195
|
function setSnapshotCapture(e) {
|
|
1171
|
-
|
|
1172
|
-
if (e &&
|
|
1196
|
+
Z = e;
|
|
1197
|
+
if (e && !$) $ = new Set();
|
|
1173
1198
|
}
|
|
1174
1199
|
function markSnapshotScope(e) {
|
|
1175
|
-
e.
|
|
1200
|
+
e.He = true;
|
|
1176
1201
|
}
|
|
1177
1202
|
function releaseSnapshotScope(e) {
|
|
1178
|
-
e.
|
|
1203
|
+
e.He = false;
|
|
1179
1204
|
releaseSubtree(e);
|
|
1180
1205
|
schedule();
|
|
1181
1206
|
}
|
|
1182
1207
|
function releaseSubtree(e) {
|
|
1183
|
-
let t = e.
|
|
1208
|
+
let t = e.Pe;
|
|
1184
1209
|
while (t) {
|
|
1185
|
-
if (t.
|
|
1186
|
-
t = t.
|
|
1210
|
+
if (t.He) {
|
|
1211
|
+
t = t.ke;
|
|
1187
1212
|
continue;
|
|
1188
1213
|
}
|
|
1189
1214
|
if (t.I) {
|
|
1190
1215
|
const e = t;
|
|
1191
|
-
e.
|
|
1216
|
+
e.de &= ~p;
|
|
1192
1217
|
if (e.m & l) {
|
|
1193
1218
|
e.m &= ~l;
|
|
1194
1219
|
e.m |= n;
|
|
1195
|
-
if (
|
|
1196
|
-
insertIntoHeap(e,
|
|
1220
|
+
if (j.W > e.o) j.W = e.o;
|
|
1221
|
+
insertIntoHeap(e, j);
|
|
1197
1222
|
}
|
|
1198
1223
|
}
|
|
1199
1224
|
releaseSubtree(t);
|
|
1200
|
-
t = t.
|
|
1225
|
+
t = t.ke;
|
|
1201
1226
|
}
|
|
1202
1227
|
}
|
|
1203
1228
|
function clearSnapshots() {
|
|
1204
|
-
if (
|
|
1205
|
-
for (const e of
|
|
1206
|
-
delete e.
|
|
1207
|
-
delete e[
|
|
1229
|
+
if ($) {
|
|
1230
|
+
for (const e of $) {
|
|
1231
|
+
delete e.ye;
|
|
1232
|
+
delete e[P];
|
|
1208
1233
|
}
|
|
1209
|
-
|
|
1234
|
+
$ = null;
|
|
1210
1235
|
}
|
|
1211
|
-
|
|
1236
|
+
Z = false;
|
|
1212
1237
|
}
|
|
1213
1238
|
function recompute(t, n = false) {
|
|
1214
1239
|
const i = t.V;
|
|
1215
1240
|
if (!n) {
|
|
1216
|
-
if (t.X && (!i ||
|
|
1217
|
-
deleteFromHeap(t, t.m & o ?
|
|
1218
|
-
t.
|
|
1219
|
-
if (t.X || i ===
|
|
1241
|
+
if (t.X && (!i || L) && L !== t.X) q.initTransition(t.X);
|
|
1242
|
+
deleteFromHeap(t, t.m & o ? R : j);
|
|
1243
|
+
t.Ee = null;
|
|
1244
|
+
if (t.X || i === O) disposeChildren(t);
|
|
1220
1245
|
else {
|
|
1221
1246
|
markDisposal(t);
|
|
1222
|
-
t.
|
|
1223
|
-
t.
|
|
1224
|
-
t.
|
|
1225
|
-
t.
|
|
1226
|
-
t.
|
|
1227
|
-
}
|
|
1228
|
-
}
|
|
1229
|
-
|
|
1230
|
-
const u = t.H !== undefined && t.H !==
|
|
1231
|
-
const c = !!(t.ge &
|
|
1232
|
-
const
|
|
1233
|
-
const
|
|
1234
|
-
|
|
1235
|
-
t.
|
|
1247
|
+
t.We = t.je;
|
|
1248
|
+
t.Ce = t.Pe;
|
|
1249
|
+
t.je = null;
|
|
1250
|
+
t.Pe = null;
|
|
1251
|
+
t.Ne = 0;
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
let s = !!(t.m & f);
|
|
1255
|
+
const u = t.H !== undefined && t.H !== v;
|
|
1256
|
+
const c = !!(t.ge & S);
|
|
1257
|
+
const a = !!(t.ge & m);
|
|
1258
|
+
const d = X;
|
|
1259
|
+
X = t;
|
|
1260
|
+
t.xe = null;
|
|
1236
1261
|
t.m = r;
|
|
1237
|
-
t.
|
|
1238
|
-
let
|
|
1239
|
-
let
|
|
1240
|
-
let
|
|
1241
|
-
let
|
|
1242
|
-
|
|
1262
|
+
t.pe = A;
|
|
1263
|
+
let h = t.T === v ? t.ne : t.T;
|
|
1264
|
+
let p = t.o;
|
|
1265
|
+
let y = B;
|
|
1266
|
+
let g = Y;
|
|
1267
|
+
B = true;
|
|
1243
1268
|
if (s) {
|
|
1244
1269
|
const e = resolveLane(t);
|
|
1245
|
-
if (e)
|
|
1270
|
+
if (e) Y = e;
|
|
1271
|
+
} else if (L && !n && L.Y.length) {
|
|
1272
|
+
for (let e = t.j; e; e = e.R) {
|
|
1273
|
+
const n = e.A;
|
|
1274
|
+
if (n.m & f) {
|
|
1275
|
+
const e = resolveLane(n);
|
|
1276
|
+
if (e) {
|
|
1277
|
+
s = true;
|
|
1278
|
+
Y = e;
|
|
1279
|
+
t.m |= f;
|
|
1280
|
+
assignOrMergeLane(t, e);
|
|
1281
|
+
break;
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1246
1285
|
}
|
|
1247
1286
|
try {
|
|
1248
|
-
const e = t.
|
|
1249
|
-
const r = t.I(
|
|
1250
|
-
|
|
1287
|
+
const e = t.Ee;
|
|
1288
|
+
const r = t.I(h);
|
|
1289
|
+
h = t.Ee !== e ? r : handleAsync(t, r);
|
|
1251
1290
|
clearStatus(t, n);
|
|
1252
1291
|
const i = resolveLane(t);
|
|
1253
1292
|
if (i) {
|
|
1254
1293
|
i.D.delete(t);
|
|
1255
|
-
updatePendingSignal(i.
|
|
1294
|
+
updatePendingSignal(i.re);
|
|
1256
1295
|
}
|
|
1257
1296
|
} catch (e) {
|
|
1258
|
-
if (e instanceof NotReadyError &&
|
|
1259
|
-
const e = findLane(
|
|
1260
|
-
if (e.
|
|
1297
|
+
if (e instanceof NotReadyError && Y) {
|
|
1298
|
+
const e = findLane(Y);
|
|
1299
|
+
if (e.re !== t) {
|
|
1261
1300
|
e.D.add(t);
|
|
1262
|
-
t.
|
|
1263
|
-
updatePendingSignal(e.
|
|
1301
|
+
t.te = e;
|
|
1302
|
+
updatePendingSignal(e.re);
|
|
1264
1303
|
}
|
|
1265
1304
|
}
|
|
1266
|
-
if (e instanceof NotReadyError) t.
|
|
1305
|
+
if (e instanceof NotReadyError) t.Ae = true;
|
|
1267
1306
|
notifyStatus(
|
|
1268
1307
|
t,
|
|
1269
|
-
e instanceof NotReadyError ?
|
|
1308
|
+
e instanceof NotReadyError ? S : w,
|
|
1270
1309
|
e,
|
|
1271
1310
|
undefined,
|
|
1272
|
-
e instanceof NotReadyError ? t.
|
|
1311
|
+
e instanceof NotReadyError ? t.te : undefined
|
|
1273
1312
|
);
|
|
1274
1313
|
} finally {
|
|
1275
|
-
Q = b;
|
|
1276
|
-
t.m = e | (n ? t.m & l : 0);
|
|
1277
1314
|
B = y;
|
|
1315
|
+
t.m = e | (n ? t.m & l : 0);
|
|
1316
|
+
X = d;
|
|
1278
1317
|
}
|
|
1279
|
-
if (!t.
|
|
1280
|
-
const e = t.
|
|
1318
|
+
if (!t.he) {
|
|
1319
|
+
const e = t.xe;
|
|
1281
1320
|
let r = e !== null ? e.R : t.j;
|
|
1282
1321
|
if (r !== null) {
|
|
1283
1322
|
do {
|
|
@@ -1286,30 +1325,30 @@ function recompute(t, n = false) {
|
|
|
1286
1325
|
if (e !== null) e.R = null;
|
|
1287
1326
|
else t.j = null;
|
|
1288
1327
|
}
|
|
1289
|
-
const f = u ? t.H : t.T ===
|
|
1290
|
-
const l = (!i &&
|
|
1328
|
+
const f = u ? t.H : t.T === v ? t.ne : t.T;
|
|
1329
|
+
const l = (!i && a) || !t.Le || !t.Le(f, h);
|
|
1291
1330
|
if (l) {
|
|
1292
1331
|
const e = u ? t.H : undefined;
|
|
1293
|
-
if (n || (i &&
|
|
1294
|
-
t.
|
|
1332
|
+
if (n || (i && L !== t.X) || s) {
|
|
1333
|
+
t.ne = h;
|
|
1295
1334
|
if (u && s) {
|
|
1296
|
-
t.H =
|
|
1297
|
-
t.T =
|
|
1335
|
+
t.H = h;
|
|
1336
|
+
t.T = h;
|
|
1298
1337
|
}
|
|
1299
|
-
} else t.T =
|
|
1300
|
-
if (u && !s && c && !t._e) t.H =
|
|
1338
|
+
} else t.T = h;
|
|
1339
|
+
if (u && !s && c && !t._e) t.H = h;
|
|
1301
1340
|
if (!u || s || t.H !== e) insertSubs(t, s || u);
|
|
1302
1341
|
} else if (u) {
|
|
1303
|
-
t.T =
|
|
1304
|
-
} else if (t.o !=
|
|
1342
|
+
t.T = h;
|
|
1343
|
+
} else if (t.o != p) {
|
|
1305
1344
|
for (let e = t.O; e !== null; e = e.P) {
|
|
1306
|
-
insertIntoHeapHeight(e.k, e.k.m & o ?
|
|
1345
|
+
insertIntoHeapHeight(e.k, e.k.m & o ? R : j);
|
|
1307
1346
|
}
|
|
1308
1347
|
}
|
|
1309
1348
|
}
|
|
1310
|
-
|
|
1311
|
-
(!n || t.ge &
|
|
1312
|
-
t.X && i &&
|
|
1349
|
+
Y = g;
|
|
1350
|
+
(!n || t.ge & S) && !t.X && !(L && u) && q.ue.push(t);
|
|
1351
|
+
t.X && i && L !== t.X && runInTransition(t.X, () => recompute(t));
|
|
1313
1352
|
}
|
|
1314
1353
|
function updateIfNecessary(e) {
|
|
1315
1354
|
if (e.m & t) {
|
|
@@ -1324,7 +1363,7 @@ function updateIfNecessary(e) {
|
|
|
1324
1363
|
}
|
|
1325
1364
|
}
|
|
1326
1365
|
}
|
|
1327
|
-
if (e.m & (n | f) || (e.
|
|
1366
|
+
if (e.m & (n | f) || (e.he && e.pe < A && !e.Ee)) {
|
|
1328
1367
|
recompute(e);
|
|
1329
1368
|
}
|
|
1330
1369
|
e.m = e.m & (l | i | s);
|
|
@@ -1332,53 +1371,55 @@ function updateIfNecessary(e) {
|
|
|
1332
1371
|
function computed(t, n) {
|
|
1333
1372
|
const r = n?.transparent ?? false;
|
|
1334
1373
|
const i = {
|
|
1335
|
-
id: n?.id ?? (r ?
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1374
|
+
id: n?.id ?? (r ? X?.id : X?.id != null ? getNextChildId(X) : undefined),
|
|
1375
|
+
de:
|
|
1376
|
+
(r ? h : 0) |
|
|
1377
|
+
(n?.ownedWrite ? a : 0) |
|
|
1378
|
+
(!X || n?.lazy ? g : 0) |
|
|
1379
|
+
(Z && ownerInSnapshotScope(X) ? p : 0),
|
|
1380
|
+
Le: n?.equals != null ? n.equals : isEqual,
|
|
1339
1381
|
q: n?.unobserved,
|
|
1340
|
-
|
|
1341
|
-
K:
|
|
1342
|
-
|
|
1343
|
-
|
|
1382
|
+
je: null,
|
|
1383
|
+
K: X?.K ?? q,
|
|
1384
|
+
Re: X?.Re ?? E,
|
|
1385
|
+
Ne: 0,
|
|
1344
1386
|
I: t,
|
|
1345
|
-
|
|
1387
|
+
ne: undefined,
|
|
1346
1388
|
o: 0,
|
|
1347
1389
|
C: null,
|
|
1348
1390
|
p: undefined,
|
|
1349
1391
|
h: null,
|
|
1350
1392
|
j: null,
|
|
1351
|
-
|
|
1393
|
+
xe: null,
|
|
1352
1394
|
O: null,
|
|
1353
1395
|
ve: null,
|
|
1354
|
-
i:
|
|
1355
|
-
Ee: null,
|
|
1396
|
+
i: X,
|
|
1356
1397
|
ke: null,
|
|
1398
|
+
Pe: null,
|
|
1357
1399
|
m: n?.lazy ? c : e,
|
|
1358
|
-
ge:
|
|
1359
|
-
|
|
1360
|
-
T:
|
|
1361
|
-
|
|
1362
|
-
Ne: null,
|
|
1400
|
+
ge: m,
|
|
1401
|
+
pe: A,
|
|
1402
|
+
T: v,
|
|
1403
|
+
We: null,
|
|
1363
1404
|
Ce: null,
|
|
1405
|
+
Ee: null,
|
|
1364
1406
|
X: null
|
|
1365
1407
|
};
|
|
1366
1408
|
i.h = i;
|
|
1367
|
-
const s =
|
|
1368
|
-
if (
|
|
1369
|
-
const e =
|
|
1409
|
+
const s = X?.t ? X.u : X;
|
|
1410
|
+
if (X) {
|
|
1411
|
+
const e = X.Pe;
|
|
1370
1412
|
if (e === null) {
|
|
1371
|
-
|
|
1413
|
+
X.Pe = i;
|
|
1372
1414
|
} else {
|
|
1373
|
-
i.
|
|
1374
|
-
|
|
1415
|
+
i.ke = e;
|
|
1416
|
+
X.Pe = i;
|
|
1375
1417
|
}
|
|
1376
1418
|
}
|
|
1377
1419
|
if (s) i.o = s.o + 1;
|
|
1378
|
-
if (
|
|
1379
|
-
if (H) {
|
|
1420
|
+
if (V) {
|
|
1380
1421
|
const e = signal(undefined, { equals: false, ownedWrite: true });
|
|
1381
|
-
const t =
|
|
1422
|
+
const t = V.factory(i.I, () => {
|
|
1382
1423
|
setSignal(e, undefined);
|
|
1383
1424
|
});
|
|
1384
1425
|
cleanup(() => t.dispose());
|
|
@@ -1388,110 +1429,109 @@ function computed(t, n) {
|
|
|
1388
1429
|
};
|
|
1389
1430
|
}
|
|
1390
1431
|
!n?.lazy && recompute(i, true);
|
|
1391
|
-
if (
|
|
1392
|
-
if (!(i.ge &
|
|
1393
|
-
i.
|
|
1394
|
-
|
|
1432
|
+
if (Z && !n?.lazy) {
|
|
1433
|
+
if (!(i.ge & S)) {
|
|
1434
|
+
i.ye = i.ne === undefined ? x : i.ne;
|
|
1435
|
+
$.add(i);
|
|
1395
1436
|
}
|
|
1396
1437
|
}
|
|
1397
1438
|
return i;
|
|
1398
1439
|
}
|
|
1399
1440
|
function signal(e, t, n = null) {
|
|
1400
1441
|
const r = {
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
Me: !!t?.Me,
|
|
1442
|
+
Le: t?.equals != null ? t.equals : isEqual,
|
|
1443
|
+
de: (t?.ownedWrite ? a : 0) | (t?.Qe ? d : 0),
|
|
1404
1444
|
q: t?.unobserved,
|
|
1405
|
-
|
|
1445
|
+
ne: e,
|
|
1406
1446
|
O: null,
|
|
1407
1447
|
ve: null,
|
|
1408
|
-
|
|
1448
|
+
pe: A,
|
|
1409
1449
|
L: n,
|
|
1410
1450
|
N: n?.C || null,
|
|
1411
|
-
T:
|
|
1451
|
+
T: v
|
|
1412
1452
|
};
|
|
1413
1453
|
n && (n.C = r);
|
|
1414
|
-
if (
|
|
1415
|
-
r.
|
|
1416
|
-
|
|
1454
|
+
if (Z && !(r.de & d) && !((n?.ge ?? 0) & S)) {
|
|
1455
|
+
r.ye = e === undefined ? x : e;
|
|
1456
|
+
$.add(r);
|
|
1417
1457
|
}
|
|
1418
1458
|
return r;
|
|
1419
1459
|
}
|
|
1420
1460
|
function optimisticSignal(e, t) {
|
|
1421
1461
|
const n = signal(e, t);
|
|
1422
|
-
n.H =
|
|
1462
|
+
n.H = v;
|
|
1423
1463
|
return n;
|
|
1424
1464
|
}
|
|
1425
1465
|
function optimisticComputed(e, t) {
|
|
1426
1466
|
const n = computed(e, t);
|
|
1427
|
-
n.H =
|
|
1467
|
+
n.H = v;
|
|
1428
1468
|
return n;
|
|
1429
1469
|
}
|
|
1430
1470
|
function isEqual(e, t) {
|
|
1431
1471
|
return e === t;
|
|
1432
1472
|
}
|
|
1433
1473
|
function untrack(e, t) {
|
|
1434
|
-
if (!
|
|
1435
|
-
const n =
|
|
1436
|
-
|
|
1474
|
+
if (!V && !B && true) return e();
|
|
1475
|
+
const n = B;
|
|
1476
|
+
B = false;
|
|
1437
1477
|
try {
|
|
1438
|
-
if (
|
|
1478
|
+
if (V) return V.untrack(e);
|
|
1439
1479
|
return e();
|
|
1440
1480
|
} finally {
|
|
1441
|
-
|
|
1481
|
+
B = n;
|
|
1442
1482
|
}
|
|
1443
1483
|
}
|
|
1444
1484
|
function read(e) {
|
|
1445
|
-
if (
|
|
1485
|
+
if (J) {
|
|
1446
1486
|
const t = getLatestValueComputed(e);
|
|
1447
|
-
const n =
|
|
1448
|
-
|
|
1449
|
-
const r = e.H !== undefined && e.H !==
|
|
1487
|
+
const n = J;
|
|
1488
|
+
J = false;
|
|
1489
|
+
const r = e.H !== undefined && e.H !== v ? e.H : e.ne;
|
|
1450
1490
|
let i;
|
|
1451
1491
|
try {
|
|
1452
1492
|
i = read(t);
|
|
1453
1493
|
} catch (e) {
|
|
1454
|
-
if (!
|
|
1494
|
+
if (!X && e instanceof NotReadyError) return r;
|
|
1455
1495
|
throw e;
|
|
1456
1496
|
} finally {
|
|
1457
|
-
|
|
1497
|
+
J = n;
|
|
1458
1498
|
}
|
|
1459
|
-
if (t.ge &
|
|
1460
|
-
if (
|
|
1461
|
-
const e = findLane(t.
|
|
1462
|
-
const n = findLane(
|
|
1499
|
+
if (t.ge & S) return r;
|
|
1500
|
+
if (K && Y && t.te) {
|
|
1501
|
+
const e = findLane(t.te);
|
|
1502
|
+
const n = findLane(Y);
|
|
1463
1503
|
if (e !== n && e.D.size > 0) {
|
|
1464
1504
|
return r;
|
|
1465
1505
|
}
|
|
1466
1506
|
}
|
|
1467
1507
|
return i;
|
|
1468
1508
|
}
|
|
1469
|
-
if (
|
|
1509
|
+
if (z) {
|
|
1470
1510
|
const t = e.L;
|
|
1471
|
-
const n =
|
|
1472
|
-
|
|
1511
|
+
const n = z;
|
|
1512
|
+
z = false;
|
|
1473
1513
|
if (t && e.H !== undefined) {
|
|
1474
|
-
if (e.H !==
|
|
1475
|
-
|
|
1514
|
+
if (e.H !== v && (t.Ee || !!(t.ge & S))) {
|
|
1515
|
+
U = true;
|
|
1476
1516
|
}
|
|
1477
|
-
let n =
|
|
1517
|
+
let n = X;
|
|
1478
1518
|
if (n?.t) n = n.u;
|
|
1479
|
-
if (n &&
|
|
1519
|
+
if (n && B) link(e, n);
|
|
1480
1520
|
read(getPendingSignal(e));
|
|
1481
1521
|
read(getPendingSignal(t));
|
|
1482
1522
|
} else {
|
|
1483
|
-
if (read(getPendingSignal(e)))
|
|
1484
|
-
if (t && read(getPendingSignal(t)))
|
|
1523
|
+
if (read(getPendingSignal(e))) U = true;
|
|
1524
|
+
if (t && read(getPendingSignal(t))) U = true;
|
|
1485
1525
|
}
|
|
1486
|
-
|
|
1487
|
-
return e.
|
|
1526
|
+
z = n;
|
|
1527
|
+
return e.ne;
|
|
1488
1528
|
}
|
|
1489
|
-
let t =
|
|
1529
|
+
let t = X;
|
|
1490
1530
|
if (t?.t) t = t.u;
|
|
1491
1531
|
const n = e;
|
|
1492
1532
|
if (typeof n.I === "function") {
|
|
1493
1533
|
const t = e;
|
|
1494
|
-
if (
|
|
1534
|
+
if (G && !(t.m & u)) recompute(t);
|
|
1495
1535
|
if (t.m & c) {
|
|
1496
1536
|
t.m &= ~c;
|
|
1497
1537
|
recompute(t, true);
|
|
@@ -1500,13 +1540,13 @@ function read(e) {
|
|
|
1500
1540
|
}
|
|
1501
1541
|
}
|
|
1502
1542
|
const r = e.L || e;
|
|
1503
|
-
if (t &&
|
|
1543
|
+
if (t && B) {
|
|
1504
1544
|
link(e, t);
|
|
1505
1545
|
if (r.I) {
|
|
1506
1546
|
const n = e.m & o;
|
|
1507
|
-
if (r.o >= (n ?
|
|
1547
|
+
if (r.o >= (n ? R.W : j.W)) {
|
|
1508
1548
|
markNode(t);
|
|
1509
|
-
markHeap(n ?
|
|
1549
|
+
markHeap(n ? R : j);
|
|
1510
1550
|
updateIfNecessary(r);
|
|
1511
1551
|
}
|
|
1512
1552
|
const i = r.o;
|
|
@@ -1515,64 +1555,68 @@ function read(e) {
|
|
|
1515
1555
|
}
|
|
1516
1556
|
}
|
|
1517
1557
|
}
|
|
1518
|
-
if (r.ge &
|
|
1519
|
-
if (t && !(
|
|
1520
|
-
if (
|
|
1521
|
-
const n = r.
|
|
1522
|
-
const i = findLane(
|
|
1558
|
+
if (r.ge & S) {
|
|
1559
|
+
if (t && !(K && r.X && L !== r.X)) {
|
|
1560
|
+
if (Y) {
|
|
1561
|
+
const n = r.te;
|
|
1562
|
+
const i = findLane(Y);
|
|
1523
1563
|
if (n && findLane(n) === i && !hasActiveOverride(r)) {
|
|
1524
|
-
if (!
|
|
1525
|
-
throw r.
|
|
1564
|
+
if (!B && e !== t) link(e, t);
|
|
1565
|
+
throw r.he;
|
|
1526
1566
|
}
|
|
1527
1567
|
} else {
|
|
1528
|
-
if (!
|
|
1529
|
-
throw r.
|
|
1568
|
+
if (!B && e !== t) link(e, t);
|
|
1569
|
+
throw r.he;
|
|
1530
1570
|
}
|
|
1531
|
-
} else if (t && r !== e && r.ge &
|
|
1532
|
-
if (!
|
|
1533
|
-
throw r.
|
|
1534
|
-
} else if (!t && r.ge &
|
|
1535
|
-
throw r.
|
|
1571
|
+
} else if (t && r !== e && r.ge & m) {
|
|
1572
|
+
if (!B && e !== t) link(e, t);
|
|
1573
|
+
throw r.he;
|
|
1574
|
+
} else if (!t && r.ge & m) {
|
|
1575
|
+
throw r.he;
|
|
1536
1576
|
}
|
|
1537
1577
|
}
|
|
1538
|
-
if (e.I && e.ge &
|
|
1539
|
-
if (e.
|
|
1578
|
+
if (e.I && e.ge & w) {
|
|
1579
|
+
if (e.pe < A) {
|
|
1540
1580
|
recompute(e);
|
|
1541
1581
|
return read(e);
|
|
1542
|
-
} else throw e.
|
|
1582
|
+
} else throw e.he;
|
|
1543
1583
|
}
|
|
1544
|
-
if (
|
|
1545
|
-
const n = e.
|
|
1584
|
+
if (Z && t && t.de & p) {
|
|
1585
|
+
const n = e.ye;
|
|
1546
1586
|
if (n !== undefined) {
|
|
1547
|
-
const r = n ===
|
|
1548
|
-
const i = e.T !==
|
|
1587
|
+
const r = n === x ? undefined : n;
|
|
1588
|
+
const i = e.T !== v ? e.T : e.ne;
|
|
1549
1589
|
if (i !== r) t.m |= l;
|
|
1550
1590
|
return r;
|
|
1551
1591
|
}
|
|
1552
1592
|
}
|
|
1553
|
-
if (e.H !== undefined && e.H !==
|
|
1554
|
-
if (t &&
|
|
1593
|
+
if (e.H !== undefined && e.H !== v) {
|
|
1594
|
+
if (t && K && shouldReadStashedOptimisticValue(e)) return e.ne;
|
|
1555
1595
|
return e.H;
|
|
1556
1596
|
}
|
|
1597
|
+
if (L !== null && Y !== null && !J && e.T !== v && r === e && !e.I && t) {
|
|
1598
|
+
L.ee.add(t);
|
|
1599
|
+
return e.ne;
|
|
1600
|
+
}
|
|
1557
1601
|
const i =
|
|
1558
1602
|
!t ||
|
|
1559
|
-
(
|
|
1560
|
-
e.T ===
|
|
1561
|
-
(
|
|
1562
|
-
? e.
|
|
1603
|
+
(Y !== null && (e.H !== undefined || e.te || (r === e && K) || !!(r.ge & S))) ||
|
|
1604
|
+
e.T === v ||
|
|
1605
|
+
(K && e.X && L !== e.X)
|
|
1606
|
+
? e.ne
|
|
1563
1607
|
: e.T;
|
|
1564
|
-
if (!t && r === e && typeof n.I === "function" &&
|
|
1608
|
+
if (!t && r === e && typeof n.I === "function" && e.de & g && !(r.ge & S) && !e.O) {
|
|
1565
1609
|
unobserved(e);
|
|
1566
1610
|
}
|
|
1567
1611
|
return i;
|
|
1568
1612
|
}
|
|
1569
1613
|
function setSignal(e, t) {
|
|
1570
|
-
if (e.X &&
|
|
1571
|
-
const n = e.H !== undefined && !
|
|
1572
|
-
const r = e.H !== undefined && e.H !==
|
|
1573
|
-
const i = n ? (r ? e.H : e.
|
|
1614
|
+
if (e.X && L !== e.X) q.initTransition(e.X);
|
|
1615
|
+
const n = e.H !== undefined && !T;
|
|
1616
|
+
const r = e.H !== undefined && e.H !== v;
|
|
1617
|
+
const i = n ? (r ? e.H : e.ne) : e.T === v ? e.ne : e.T;
|
|
1574
1618
|
if (typeof t === "function") t = t(i);
|
|
1575
|
-
const s = !e.
|
|
1619
|
+
const s = !e.Le || !e.Le(i, t) || !!(e.ge & m);
|
|
1576
1620
|
if (!s) {
|
|
1577
1621
|
if (n && r && e.I) {
|
|
1578
1622
|
insertSubs(e, true);
|
|
@@ -1581,156 +1625,156 @@ function setSignal(e, t) {
|
|
|
1581
1625
|
return t;
|
|
1582
1626
|
}
|
|
1583
1627
|
if (n) {
|
|
1584
|
-
const n = e.H ===
|
|
1585
|
-
if (!n)
|
|
1628
|
+
const n = e.H === v;
|
|
1629
|
+
if (!n) q.initTransition(resolveTransition(e));
|
|
1586
1630
|
if (n) {
|
|
1587
|
-
e.T = e.
|
|
1588
|
-
|
|
1631
|
+
e.T = e.ne;
|
|
1632
|
+
q.Y.push(e);
|
|
1589
1633
|
}
|
|
1590
1634
|
e._e = true;
|
|
1591
1635
|
const r = getOrCreateLane(e);
|
|
1592
|
-
e.
|
|
1636
|
+
e.te = r;
|
|
1593
1637
|
e.H = t;
|
|
1594
1638
|
} else {
|
|
1595
|
-
if (e.T ===
|
|
1639
|
+
if (e.T === v) q.ue.push(e);
|
|
1596
1640
|
e.T = t;
|
|
1597
1641
|
}
|
|
1598
1642
|
updatePendingSignal(e);
|
|
1599
|
-
if (e.
|
|
1600
|
-
setSignal(e.
|
|
1643
|
+
if (e.Ie) {
|
|
1644
|
+
setSignal(e.Ie, t);
|
|
1601
1645
|
}
|
|
1602
|
-
e.
|
|
1646
|
+
e.pe = A;
|
|
1603
1647
|
insertSubs(e, n);
|
|
1604
1648
|
schedule();
|
|
1605
1649
|
return t;
|
|
1606
1650
|
}
|
|
1607
1651
|
function runWithOwner(e, t) {
|
|
1608
|
-
const n =
|
|
1609
|
-
const r =
|
|
1610
|
-
|
|
1611
|
-
|
|
1652
|
+
const n = X;
|
|
1653
|
+
const r = B;
|
|
1654
|
+
X = e;
|
|
1655
|
+
B = false;
|
|
1612
1656
|
try {
|
|
1613
1657
|
return t();
|
|
1614
1658
|
} finally {
|
|
1615
|
-
|
|
1616
|
-
|
|
1659
|
+
X = n;
|
|
1660
|
+
B = r;
|
|
1617
1661
|
}
|
|
1618
1662
|
}
|
|
1619
1663
|
function getPendingSignal(e) {
|
|
1620
|
-
if (!e.
|
|
1621
|
-
e.
|
|
1664
|
+
if (!e.qe) {
|
|
1665
|
+
e.qe = optimisticSignal(false, { ownedWrite: true });
|
|
1622
1666
|
if (e.me) {
|
|
1623
|
-
e.
|
|
1667
|
+
e.qe.me = e;
|
|
1624
1668
|
}
|
|
1625
|
-
if (computePendingState(e)) setSignal(e.
|
|
1669
|
+
if (computePendingState(e)) setSignal(e.qe, true);
|
|
1626
1670
|
}
|
|
1627
|
-
return e.
|
|
1671
|
+
return e.qe;
|
|
1628
1672
|
}
|
|
1629
1673
|
function computePendingState(e) {
|
|
1630
1674
|
const t = e;
|
|
1631
1675
|
const n = e.L;
|
|
1632
|
-
if (n && e.T !==
|
|
1633
|
-
return !n.
|
|
1676
|
+
if (n && e.T !== v) {
|
|
1677
|
+
return !n.Ee && !(n.ge & S);
|
|
1634
1678
|
}
|
|
1635
|
-
if (e.H !== undefined && e.H !==
|
|
1636
|
-
if (t.ge &
|
|
1679
|
+
if (e.H !== undefined && e.H !== v) {
|
|
1680
|
+
if (t.ge & S && !(t.ge & m)) return true;
|
|
1637
1681
|
if (e.me) {
|
|
1638
|
-
const t = e.
|
|
1682
|
+
const t = e.te ? findLane(e.te) : null;
|
|
1639
1683
|
return !!(t && t.D.size > 0);
|
|
1640
1684
|
}
|
|
1641
1685
|
return true;
|
|
1642
1686
|
}
|
|
1643
|
-
if (e.H !== undefined && e.H ===
|
|
1687
|
+
if (e.H !== undefined && e.H === v && !e.me) {
|
|
1644
1688
|
return false;
|
|
1645
1689
|
}
|
|
1646
|
-
if (e.T !==
|
|
1647
|
-
return !!(t.ge &
|
|
1690
|
+
if (e.T !== v && !(t.ge & m)) return true;
|
|
1691
|
+
return !!(t.ge & S && !(t.ge & m));
|
|
1648
1692
|
}
|
|
1649
1693
|
function updatePendingSignal(e) {
|
|
1650
|
-
if (e.
|
|
1694
|
+
if (e.qe) {
|
|
1651
1695
|
const t = computePendingState(e);
|
|
1652
|
-
const n = e.
|
|
1696
|
+
const n = e.qe;
|
|
1653
1697
|
setSignal(n, t);
|
|
1654
|
-
if (!t && n.
|
|
1698
|
+
if (!t && n.te) {
|
|
1655
1699
|
const t = resolveLane(e);
|
|
1656
1700
|
if (t && t.D.size > 0) {
|
|
1657
|
-
const e = findLane(n.
|
|
1701
|
+
const e = findLane(n.te);
|
|
1658
1702
|
if (e !== t) {
|
|
1659
1703
|
mergeLanes(t, e);
|
|
1660
1704
|
}
|
|
1661
1705
|
}
|
|
1662
|
-
|
|
1663
|
-
n.
|
|
1706
|
+
M.delete(n);
|
|
1707
|
+
n.te = undefined;
|
|
1664
1708
|
}
|
|
1665
1709
|
}
|
|
1666
1710
|
}
|
|
1667
1711
|
function getLatestValueComputed(e) {
|
|
1668
|
-
if (!e.
|
|
1669
|
-
const t =
|
|
1670
|
-
|
|
1671
|
-
const n =
|
|
1672
|
-
|
|
1673
|
-
const r =
|
|
1674
|
-
|
|
1675
|
-
e.
|
|
1676
|
-
e.
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
}
|
|
1681
|
-
return e.
|
|
1712
|
+
if (!e.Ie) {
|
|
1713
|
+
const t = J;
|
|
1714
|
+
J = false;
|
|
1715
|
+
const n = z;
|
|
1716
|
+
z = false;
|
|
1717
|
+
const r = X;
|
|
1718
|
+
X = null;
|
|
1719
|
+
e.Ie = optimisticComputed(() => read(e));
|
|
1720
|
+
e.Ie.me = e;
|
|
1721
|
+
X = r;
|
|
1722
|
+
z = n;
|
|
1723
|
+
J = t;
|
|
1724
|
+
}
|
|
1725
|
+
return e.Ie;
|
|
1682
1726
|
}
|
|
1683
1727
|
function staleValues(e, t = true) {
|
|
1684
|
-
const n =
|
|
1685
|
-
|
|
1728
|
+
const n = K;
|
|
1729
|
+
K = t;
|
|
1686
1730
|
try {
|
|
1687
1731
|
return e();
|
|
1688
1732
|
} finally {
|
|
1689
|
-
|
|
1733
|
+
K = n;
|
|
1690
1734
|
}
|
|
1691
1735
|
}
|
|
1692
1736
|
function latest(e) {
|
|
1693
|
-
const t =
|
|
1694
|
-
|
|
1737
|
+
const t = J;
|
|
1738
|
+
J = true;
|
|
1695
1739
|
try {
|
|
1696
1740
|
return e();
|
|
1697
1741
|
} finally {
|
|
1698
|
-
|
|
1742
|
+
J = t;
|
|
1699
1743
|
}
|
|
1700
1744
|
}
|
|
1701
1745
|
function isPending(e) {
|
|
1702
|
-
const t =
|
|
1703
|
-
const n =
|
|
1704
|
-
|
|
1705
|
-
|
|
1746
|
+
const t = z;
|
|
1747
|
+
const n = U;
|
|
1748
|
+
z = true;
|
|
1749
|
+
U = false;
|
|
1706
1750
|
try {
|
|
1707
1751
|
e();
|
|
1708
|
-
return
|
|
1752
|
+
return U;
|
|
1709
1753
|
} catch {
|
|
1710
|
-
return
|
|
1754
|
+
return U;
|
|
1711
1755
|
} finally {
|
|
1712
|
-
|
|
1713
|
-
|
|
1756
|
+
z = t;
|
|
1757
|
+
U = n;
|
|
1714
1758
|
}
|
|
1715
1759
|
}
|
|
1716
1760
|
function refresh(e) {
|
|
1717
|
-
let t =
|
|
1718
|
-
|
|
1761
|
+
let t = G;
|
|
1762
|
+
G = true;
|
|
1719
1763
|
try {
|
|
1720
1764
|
if (typeof e !== "function") {
|
|
1721
|
-
recompute(e[
|
|
1765
|
+
recompute(e[C]);
|
|
1722
1766
|
return e;
|
|
1723
1767
|
}
|
|
1724
1768
|
return untrack(e);
|
|
1725
1769
|
} finally {
|
|
1726
|
-
|
|
1770
|
+
G = t;
|
|
1727
1771
|
if (!t) {
|
|
1728
1772
|
schedule();
|
|
1729
1773
|
}
|
|
1730
1774
|
}
|
|
1731
1775
|
}
|
|
1732
1776
|
function isRefreshing() {
|
|
1733
|
-
return
|
|
1777
|
+
return G;
|
|
1734
1778
|
}
|
|
1735
1779
|
function createContext(e, t) {
|
|
1736
1780
|
return { id: Symbol(t), defaultValue: e };
|
|
@@ -1739,7 +1783,7 @@ function getContext(e, t = getOwner()) {
|
|
|
1739
1783
|
if (!t) {
|
|
1740
1784
|
throw new NoOwnerError();
|
|
1741
1785
|
}
|
|
1742
|
-
const n = hasContext(e, t) ? t.
|
|
1786
|
+
const n = hasContext(e, t) ? t.Re[e.id] : e.defaultValue;
|
|
1743
1787
|
if (isUndefined(n)) {
|
|
1744
1788
|
throw new ContextNotFoundError();
|
|
1745
1789
|
}
|
|
@@ -1749,10 +1793,10 @@ function setContext(e, t, n = getOwner()) {
|
|
|
1749
1793
|
if (!n) {
|
|
1750
1794
|
throw new NoOwnerError();
|
|
1751
1795
|
}
|
|
1752
|
-
n.
|
|
1796
|
+
n.Re = { ...n.Re, [e.id]: isUndefined(t) ? e.defaultValue : t };
|
|
1753
1797
|
}
|
|
1754
1798
|
function hasContext(e, t) {
|
|
1755
|
-
return !isUndefined(t?.
|
|
1799
|
+
return !isUndefined(t?.Re[e.id]);
|
|
1756
1800
|
}
|
|
1757
1801
|
function isUndefined(e) {
|
|
1758
1802
|
return typeof e === "undefined";
|
|
@@ -1763,59 +1807,60 @@ function effect(e, t, n, r) {
|
|
|
1763
1807
|
const o = computed(s ? e : t => staleValues(() => e(t)), {
|
|
1764
1808
|
...r,
|
|
1765
1809
|
equals: () => {
|
|
1766
|
-
o.B = !o.
|
|
1810
|
+
o.B = !o.he;
|
|
1767
1811
|
if (i) o.K.enqueue(o.V, runEffect.bind(o));
|
|
1768
1812
|
return false;
|
|
1769
1813
|
},
|
|
1770
1814
|
lazy: true
|
|
1771
1815
|
});
|
|
1772
|
-
o.
|
|
1773
|
-
o.
|
|
1774
|
-
o.
|
|
1775
|
-
o.
|
|
1776
|
-
o.
|
|
1777
|
-
o.
|
|
1816
|
+
o.de &= ~g;
|
|
1817
|
+
o.Me = undefined;
|
|
1818
|
+
o.De = t;
|
|
1819
|
+
o.Fe = n;
|
|
1820
|
+
o.Ve = undefined;
|
|
1821
|
+
o.V = s ? _ : b;
|
|
1822
|
+
o.Te = (e, t) => {
|
|
1778
1823
|
const n = e !== undefined ? e : o.ge;
|
|
1779
|
-
const r = t !== undefined ? t : o.
|
|
1780
|
-
if (n &
|
|
1824
|
+
const r = t !== undefined ? t : o.he;
|
|
1825
|
+
if (n & w) {
|
|
1781
1826
|
let e = r;
|
|
1782
|
-
o.K.notify(o,
|
|
1783
|
-
if (o.V ===
|
|
1827
|
+
o.K.notify(o, S, 0);
|
|
1828
|
+
if (o.V === _) {
|
|
1784
1829
|
try {
|
|
1785
|
-
return o.
|
|
1786
|
-
? o.
|
|
1787
|
-
o.
|
|
1788
|
-
o.
|
|
1830
|
+
return o.Fe
|
|
1831
|
+
? o.Fe(e, () => {
|
|
1832
|
+
o.Ve?.();
|
|
1833
|
+
o.Ve = undefined;
|
|
1789
1834
|
})
|
|
1790
1835
|
: console.error(e);
|
|
1791
1836
|
} catch (t) {
|
|
1792
1837
|
e = t;
|
|
1793
1838
|
}
|
|
1794
1839
|
}
|
|
1795
|
-
if (!o.K.notify(o,
|
|
1796
|
-
} else if (o.V ===
|
|
1797
|
-
o.K.notify(o,
|
|
1840
|
+
if (!o.K.notify(o, w, w)) throw e;
|
|
1841
|
+
} else if (o.V === b) {
|
|
1842
|
+
o.K.notify(o, S | w, n, r);
|
|
1798
1843
|
}
|
|
1799
1844
|
};
|
|
1800
1845
|
recompute(o, true);
|
|
1801
|
-
!r?.defer && (o.V ===
|
|
1846
|
+
!r?.defer && (o.V === _ || r?.schedule ? o.K.enqueue(o.V, runEffect.bind(o)) : runEffect.call(o));
|
|
1802
1847
|
i = true;
|
|
1803
|
-
cleanup(() => o.
|
|
1848
|
+
cleanup(() => o.Ve?.());
|
|
1804
1849
|
}
|
|
1805
1850
|
function runEffect() {
|
|
1806
1851
|
if (!this.B || this.m & u) return;
|
|
1807
|
-
this.
|
|
1808
|
-
this.
|
|
1852
|
+
this.Ve?.();
|
|
1853
|
+
this.Ve = undefined;
|
|
1809
1854
|
try {
|
|
1810
|
-
const e = this.
|
|
1855
|
+
const e = this.De(this.ne, this.Me);
|
|
1811
1856
|
if (false && e !== undefined && typeof e !== "function");
|
|
1812
|
-
this.
|
|
1857
|
+
this.Ve = e;
|
|
1813
1858
|
} catch (e) {
|
|
1814
|
-
this.
|
|
1815
|
-
this.ge |=
|
|
1816
|
-
if (!this.K.notify(this,
|
|
1859
|
+
this.he = new StatusError(this, e);
|
|
1860
|
+
this.ge |= w;
|
|
1861
|
+
if (!this.K.notify(this, w, w)) throw e;
|
|
1817
1862
|
} finally {
|
|
1818
|
-
this.
|
|
1863
|
+
this.Me = this.ne;
|
|
1819
1864
|
this.B = false;
|
|
1820
1865
|
}
|
|
1821
1866
|
}
|
|
@@ -1830,31 +1875,31 @@ function trackedEffect(e, t) {
|
|
|
1830
1875
|
};
|
|
1831
1876
|
const n = computed(
|
|
1832
1877
|
() => {
|
|
1833
|
-
n.
|
|
1834
|
-
n.
|
|
1878
|
+
n.Ve?.();
|
|
1879
|
+
n.Ve = undefined;
|
|
1835
1880
|
const t = staleValues(e);
|
|
1836
|
-
n.
|
|
1881
|
+
n.Ve = t;
|
|
1837
1882
|
},
|
|
1838
1883
|
{ ...t, lazy: true }
|
|
1839
1884
|
);
|
|
1840
|
-
n.
|
|
1841
|
-
n.
|
|
1885
|
+
n.Ve = undefined;
|
|
1886
|
+
n.de = (n.de & ~g) | y;
|
|
1842
1887
|
n.B = true;
|
|
1843
|
-
n.V =
|
|
1844
|
-
n.
|
|
1888
|
+
n.V = O;
|
|
1889
|
+
n.Te = (e, t) => {
|
|
1845
1890
|
const r = e !== undefined ? e : n.ge;
|
|
1846
|
-
if (r &
|
|
1847
|
-
n.K.notify(n,
|
|
1848
|
-
const e = t !== undefined ? t : n.
|
|
1849
|
-
if (!n.K.notify(n,
|
|
1891
|
+
if (r & w) {
|
|
1892
|
+
n.K.notify(n, S, 0);
|
|
1893
|
+
const e = t !== undefined ? t : n.he;
|
|
1894
|
+
if (!n.K.notify(n, w, w)) throw e;
|
|
1850
1895
|
}
|
|
1851
1896
|
};
|
|
1852
1897
|
n.G = run;
|
|
1853
|
-
n.K.enqueue(
|
|
1854
|
-
cleanup(() => n.
|
|
1898
|
+
n.K.enqueue(_, run);
|
|
1899
|
+
cleanup(() => n.Ve?.());
|
|
1855
1900
|
}
|
|
1856
1901
|
function restoreTransition(e, t) {
|
|
1857
|
-
|
|
1902
|
+
q.initTransition(e);
|
|
1858
1903
|
const n = t();
|
|
1859
1904
|
flush();
|
|
1860
1905
|
return n;
|
|
@@ -1863,8 +1908,8 @@ function action(e) {
|
|
|
1863
1908
|
return (...t) =>
|
|
1864
1909
|
new Promise((n, r) => {
|
|
1865
1910
|
const i = e(...t);
|
|
1866
|
-
|
|
1867
|
-
let s =
|
|
1911
|
+
q.initTransition();
|
|
1912
|
+
let s = L;
|
|
1868
1913
|
s.J.push(i);
|
|
1869
1914
|
const done = (e, t) => {
|
|
1870
1915
|
s = currentTransition(s);
|
|
@@ -1901,22 +1946,19 @@ function onCleanup(e) {
|
|
|
1901
1946
|
return cleanup(e);
|
|
1902
1947
|
}
|
|
1903
1948
|
function accessor(e) {
|
|
1904
|
-
|
|
1905
|
-
t.$r = true;
|
|
1906
|
-
return t;
|
|
1949
|
+
return read.bind(null, e);
|
|
1907
1950
|
}
|
|
1908
1951
|
function createSignal(e, t) {
|
|
1909
1952
|
if (typeof e === "function") {
|
|
1910
1953
|
const n = computed(e, t);
|
|
1911
|
-
n.
|
|
1954
|
+
n.de &= ~g;
|
|
1912
1955
|
return [accessor(n), setSignal.bind(null, n)];
|
|
1913
1956
|
}
|
|
1914
1957
|
const n = signal(e, t);
|
|
1915
1958
|
return [accessor(n), setSignal.bind(null, n)];
|
|
1916
1959
|
}
|
|
1917
1960
|
function createMemo(e, t) {
|
|
1918
|
-
|
|
1919
|
-
return accessor(n);
|
|
1961
|
+
return accessor(computed(e, t));
|
|
1920
1962
|
}
|
|
1921
1963
|
function createEffect(e, t, n) {
|
|
1922
1964
|
effect(e, t.effect || t, t.error, { user: true, ...n });
|
|
@@ -1966,7 +2008,7 @@ function resolve(e) {
|
|
|
1966
2008
|
function createOptimistic(e, t) {
|
|
1967
2009
|
if (typeof e === "function") {
|
|
1968
2010
|
const n = optimisticComputed(e, t);
|
|
1969
|
-
n.
|
|
2011
|
+
n.de &= ~g;
|
|
1970
2012
|
return [accessor(n), setSignal.bind(null, n)];
|
|
1971
2013
|
}
|
|
1972
2014
|
const n = optimisticSignal(e, t);
|
|
@@ -1974,15 +2016,15 @@ function createOptimistic(e, t) {
|
|
|
1974
2016
|
}
|
|
1975
2017
|
function onSettled(e) {
|
|
1976
2018
|
const t = getOwner();
|
|
1977
|
-
t && !t.
|
|
2019
|
+
t && !(t.de & y)
|
|
1978
2020
|
? createTrackedEffect(() => untrack(e), undefined)
|
|
1979
|
-
:
|
|
2021
|
+
: q.enqueue(_, () => {
|
|
1980
2022
|
const t = e();
|
|
1981
2023
|
t?.();
|
|
1982
2024
|
});
|
|
1983
2025
|
}
|
|
1984
2026
|
function unwrap(e) {
|
|
1985
|
-
return e?.[
|
|
2027
|
+
return e?.[te]?.[ue] ?? e;
|
|
1986
2028
|
}
|
|
1987
2029
|
function getOverrideValue(e, t, n, r, i) {
|
|
1988
2030
|
if (i && r in i) return i[r];
|
|
@@ -1994,16 +2036,16 @@ function getAllKeys(e, t, n) {
|
|
|
1994
2036
|
return Array.from(new Set([...r, ...i]));
|
|
1995
2037
|
}
|
|
1996
2038
|
function applyState(e, t, n) {
|
|
1997
|
-
const r = t?.[
|
|
2039
|
+
const r = t?.[te];
|
|
1998
2040
|
if (!r) return;
|
|
1999
|
-
const i = r[
|
|
2000
|
-
const s = r[
|
|
2001
|
-
const o = r[
|
|
2002
|
-
let u = r[
|
|
2041
|
+
const i = r[ie];
|
|
2042
|
+
const s = r[se];
|
|
2043
|
+
const o = r[oe];
|
|
2044
|
+
let u = r[ue];
|
|
2003
2045
|
if (e === i && !s && !o) return;
|
|
2004
|
-
(r[
|
|
2005
|
-
r[
|
|
2006
|
-
r[
|
|
2046
|
+
(r[ce] || he).set(e, r[ne]);
|
|
2047
|
+
r[ie] = e;
|
|
2048
|
+
r[se] = undefined;
|
|
2007
2049
|
if (Array.isArray(i)) {
|
|
2008
2050
|
let t = false;
|
|
2009
2051
|
const f = getOverrideValue(i, s, u, "length", o);
|
|
@@ -2031,16 +2073,16 @@ function applyState(e, t, n) {
|
|
|
2031
2073
|
if (a > h || a > d) {
|
|
2032
2074
|
for (c = a; c <= h; c++) {
|
|
2033
2075
|
t = true;
|
|
2034
|
-
r[
|
|
2076
|
+
r[ue][c] && setSignal(r[ue][c], wrap(e[c], r));
|
|
2035
2077
|
}
|
|
2036
2078
|
for (; c < e.length; c++) {
|
|
2037
2079
|
t = true;
|
|
2038
2080
|
const i = wrap(S[c], r);
|
|
2039
|
-
r[
|
|
2081
|
+
r[ue][c] && setSignal(r[ue][c], i);
|
|
2040
2082
|
applyState(e[c], i, n);
|
|
2041
2083
|
}
|
|
2042
|
-
t && r[
|
|
2043
|
-
f !== e.length && r[
|
|
2084
|
+
t && r[ue][ee] && setSignal(r[ue][ee], void 0);
|
|
2085
|
+
f !== e.length && r[ue].length && setSignal(r[ue].length, e.length);
|
|
2044
2086
|
return;
|
|
2045
2087
|
}
|
|
2046
2088
|
y = new Array(h + 1);
|
|
@@ -2064,26 +2106,26 @@ function applyState(e, t, n) {
|
|
|
2064
2106
|
for (c = a; c < e.length; c++) {
|
|
2065
2107
|
if (c in S) {
|
|
2066
2108
|
const t = wrap(S[c], r);
|
|
2067
|
-
r[
|
|
2109
|
+
r[ue][c] && setSignal(r[ue][c], t);
|
|
2068
2110
|
applyState(e[c], t, n);
|
|
2069
|
-
} else r[
|
|
2111
|
+
} else r[ue][c] && setSignal(r[ue][c], wrap(e[c], r));
|
|
2070
2112
|
}
|
|
2071
2113
|
if (a < e.length) t = true;
|
|
2072
2114
|
} else if (e.length) {
|
|
2073
2115
|
for (let t = 0, f = e.length; t < f; t++) {
|
|
2074
2116
|
const f = getOverrideValue(i, s, u, t, o);
|
|
2075
|
-
isWrappable(f) ? applyState(e[t], wrap(f, r), n) : r[
|
|
2117
|
+
isWrappable(f) ? applyState(e[t], wrap(f, r), n) : r[ue][t] && setSignal(r[ue][t], e[t]);
|
|
2076
2118
|
}
|
|
2077
2119
|
}
|
|
2078
2120
|
if (f !== e.length) {
|
|
2079
2121
|
t = true;
|
|
2080
|
-
r[
|
|
2122
|
+
r[ue].length && setSignal(r[ue].length, e.length);
|
|
2081
2123
|
}
|
|
2082
|
-
t && r[
|
|
2124
|
+
t && r[ue][ee] && setSignal(r[ue][ee], void 0);
|
|
2083
2125
|
return;
|
|
2084
2126
|
}
|
|
2085
2127
|
if (u) {
|
|
2086
|
-
const t = u[
|
|
2128
|
+
const t = u[ee];
|
|
2087
2129
|
const f = t ? getAllKeys(i, s, e) : Object.keys(u);
|
|
2088
2130
|
for (let l = 0, c = f.length; l < c; l++) {
|
|
2089
2131
|
const c = f[l];
|
|
@@ -2097,7 +2139,7 @@ function applyState(e, t, n) {
|
|
|
2097
2139
|
} else applyState(h, wrap(d, r), n);
|
|
2098
2140
|
}
|
|
2099
2141
|
}
|
|
2100
|
-
if ((u = r[
|
|
2142
|
+
if ((u = r[fe])) {
|
|
2101
2143
|
const t = Object.keys(u);
|
|
2102
2144
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
2103
2145
|
const r = t[n];
|
|
@@ -2119,9 +2161,9 @@ function createProjectionInternal(e, t, n) {
|
|
|
2119
2161
|
let r;
|
|
2120
2162
|
const i = new WeakMap();
|
|
2121
2163
|
const wrapper = e => {
|
|
2122
|
-
e[
|
|
2123
|
-
e[
|
|
2124
|
-
Object.defineProperty(e,
|
|
2164
|
+
e[le] = wrapProjection;
|
|
2165
|
+
e[ce] = i;
|
|
2166
|
+
Object.defineProperty(e, ae, {
|
|
2125
2167
|
get() {
|
|
2126
2168
|
return r;
|
|
2127
2169
|
},
|
|
@@ -2130,8 +2172,8 @@ function createProjectionInternal(e, t, n) {
|
|
|
2130
2172
|
};
|
|
2131
2173
|
const wrapProjection = e => {
|
|
2132
2174
|
if (i.has(e)) return i.get(e);
|
|
2133
|
-
if (e[
|
|
2134
|
-
const t = createStoreProxy(e,
|
|
2175
|
+
if (e[te]?.[le] === wrapProjection) return e;
|
|
2176
|
+
const t = createStoreProxy(e, ge, wrapper);
|
|
2135
2177
|
i.set(e, t);
|
|
2136
2178
|
return t;
|
|
2137
2179
|
};
|
|
@@ -2140,7 +2182,7 @@ function createProjectionInternal(e, t, n) {
|
|
|
2140
2182
|
if (!r) r = getOwner();
|
|
2141
2183
|
runProjectionComputed(s, e, n?.key || "id");
|
|
2142
2184
|
}, undefined);
|
|
2143
|
-
r.
|
|
2185
|
+
r.de &= ~g;
|
|
2144
2186
|
return { store: s, node: r };
|
|
2145
2187
|
}
|
|
2146
2188
|
function createProjection(e, t, n) {
|
|
@@ -2152,7 +2194,7 @@ function runProjectionComputed(e, t, n, r) {
|
|
|
2152
2194
|
let o;
|
|
2153
2195
|
const u = new Proxy(
|
|
2154
2196
|
e,
|
|
2155
|
-
createWriteTraps(() => !s || i.
|
|
2197
|
+
createWriteTraps(() => !s || i.Ee === o)
|
|
2156
2198
|
);
|
|
2157
2199
|
storeSetter(u, u => {
|
|
2158
2200
|
o = t(u);
|
|
@@ -2219,33 +2261,33 @@ function createWriteTraps(e) {
|
|
|
2219
2261
|
};
|
|
2220
2262
|
return t;
|
|
2221
2263
|
}
|
|
2222
|
-
const
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
const
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
function createStoreProxy(e, t =
|
|
2264
|
+
const ee = Symbol(0),
|
|
2265
|
+
te = Symbol(0),
|
|
2266
|
+
ne = Symbol(0),
|
|
2267
|
+
re = Symbol(0);
|
|
2268
|
+
const ie = "v",
|
|
2269
|
+
se = "o",
|
|
2270
|
+
oe = "x",
|
|
2271
|
+
ue = "n",
|
|
2272
|
+
fe = "h",
|
|
2273
|
+
le = "w",
|
|
2274
|
+
ce = "l",
|
|
2275
|
+
ae = "f",
|
|
2276
|
+
de = "p";
|
|
2277
|
+
function createStoreProxy(e, t = ge, n) {
|
|
2236
2278
|
let r;
|
|
2237
2279
|
if (Array.isArray(e)) {
|
|
2238
2280
|
r = [];
|
|
2239
2281
|
r.v = e;
|
|
2240
2282
|
} else r = { v: e };
|
|
2241
2283
|
n && n(r);
|
|
2242
|
-
return (r[
|
|
2284
|
+
return (r[ne] = new Proxy(r, t));
|
|
2243
2285
|
}
|
|
2244
|
-
const
|
|
2286
|
+
const he = new WeakMap();
|
|
2245
2287
|
function wrap(e, t) {
|
|
2246
|
-
if (t?.[
|
|
2247
|
-
let n = e[
|
|
2248
|
-
if (!n)
|
|
2288
|
+
if (t?.[le]) return t[le](e, t);
|
|
2289
|
+
let n = e[ne] || he.get(e);
|
|
2290
|
+
if (!n) he.set(e, (n = createStoreProxy(e)));
|
|
2249
2291
|
return n;
|
|
2250
2292
|
}
|
|
2251
2293
|
function isWrappable(e) {
|
|
@@ -2256,12 +2298,12 @@ function isWrappable(e) {
|
|
|
2256
2298
|
!(typeof Node !== "undefined" && e instanceof Node)
|
|
2257
2299
|
);
|
|
2258
2300
|
}
|
|
2259
|
-
let
|
|
2301
|
+
let pe = false;
|
|
2260
2302
|
function setWriteOverride(e) {
|
|
2261
|
-
|
|
2303
|
+
pe = e;
|
|
2262
2304
|
}
|
|
2263
2305
|
function writeOnly(e) {
|
|
2264
|
-
return
|
|
2306
|
+
return pe || !!ye?.has(e);
|
|
2265
2307
|
}
|
|
2266
2308
|
function getNodes(e, t) {
|
|
2267
2309
|
let n = e[t];
|
|
@@ -2281,17 +2323,17 @@ function getNode(e, t, n, r, i = isEqual, s, o) {
|
|
|
2281
2323
|
r
|
|
2282
2324
|
);
|
|
2283
2325
|
if (s) {
|
|
2284
|
-
u.H =
|
|
2326
|
+
u.H = v;
|
|
2285
2327
|
}
|
|
2286
2328
|
if (o && t in o) {
|
|
2287
2329
|
const e = o[t];
|
|
2288
|
-
u.
|
|
2289
|
-
|
|
2330
|
+
u.ye = e === undefined ? x : e;
|
|
2331
|
+
$?.add(u);
|
|
2290
2332
|
}
|
|
2291
2333
|
return (e[t] = u);
|
|
2292
2334
|
}
|
|
2293
|
-
function trackSelf(e, t =
|
|
2294
|
-
getObserver() && read(getNode(getNodes(e,
|
|
2335
|
+
function trackSelf(e, t = ee) {
|
|
2336
|
+
getObserver() && read(getNode(getNodes(e, ue), t, undefined, e[ae], false, e[de]));
|
|
2295
2337
|
}
|
|
2296
2338
|
function getKeys(e, t, n = true) {
|
|
2297
2339
|
const r = untrack(() => (n ? Object.keys(e) : Reflect.ownKeys(e)));
|
|
@@ -2299,65 +2341,65 @@ function getKeys(e, t, n = true) {
|
|
|
2299
2341
|
const i = new Set(r);
|
|
2300
2342
|
const s = Reflect.ownKeys(t);
|
|
2301
2343
|
for (const e of s) {
|
|
2302
|
-
if (t[e] !==
|
|
2344
|
+
if (t[e] !== re) i.add(e);
|
|
2303
2345
|
else i.delete(e);
|
|
2304
2346
|
}
|
|
2305
2347
|
return Array.from(i);
|
|
2306
2348
|
}
|
|
2307
2349
|
function getPropertyDescriptor(e, t, n) {
|
|
2308
2350
|
if (t && n in t) {
|
|
2309
|
-
if (t[n] ===
|
|
2351
|
+
if (t[n] === re) return void 0;
|
|
2310
2352
|
const r = Reflect.getOwnPropertyDescriptor(t, n);
|
|
2311
2353
|
if (r?.get || r?.set || !(n in e)) return r;
|
|
2312
2354
|
}
|
|
2313
2355
|
return Reflect.getOwnPropertyDescriptor(e, n);
|
|
2314
2356
|
}
|
|
2315
2357
|
function prepareStoreWrite(e, t, n) {
|
|
2316
|
-
if (e[
|
|
2317
|
-
const t = e[
|
|
2358
|
+
if (e[de]) {
|
|
2359
|
+
const t = e[ae];
|
|
2318
2360
|
if (t?.X) {
|
|
2319
|
-
|
|
2361
|
+
q.initTransition(t.X);
|
|
2320
2362
|
}
|
|
2321
2363
|
}
|
|
2322
|
-
const r = e[
|
|
2364
|
+
const r = e[ie];
|
|
2323
2365
|
const i = r[n];
|
|
2324
|
-
if (
|
|
2325
|
-
if (!e[
|
|
2326
|
-
e[
|
|
2327
|
-
|
|
2366
|
+
if (Z && typeof n !== "symbol" && !((e[ae]?.ge ?? 0) & S)) {
|
|
2367
|
+
if (!e[P]) {
|
|
2368
|
+
e[P] = Object.create(null);
|
|
2369
|
+
$?.add(e);
|
|
2328
2370
|
}
|
|
2329
|
-
if (!(n in e[
|
|
2330
|
-
e[
|
|
2371
|
+
if (!(n in e[P])) {
|
|
2372
|
+
e[P][n] = i;
|
|
2331
2373
|
}
|
|
2332
2374
|
}
|
|
2333
|
-
const s = e[
|
|
2334
|
-
const o = s ?
|
|
2375
|
+
const s = e[de] && !T;
|
|
2376
|
+
const o = s ? oe : se;
|
|
2335
2377
|
if (s) trackOptimisticStore(t);
|
|
2336
2378
|
return { base: i, overrideKey: o, state: r };
|
|
2337
2379
|
}
|
|
2338
2380
|
function upsertStoreNode(e, t, n, r, i) {
|
|
2339
2381
|
if (t[n]) return t[n];
|
|
2340
2382
|
const s = isWrappable(r) ? wrap(r, e) : r;
|
|
2341
|
-
const o = getNode(t, n, s, e[
|
|
2383
|
+
const o = getNode(t, n, s, e[ae], isEqual, e[de], i);
|
|
2342
2384
|
registerTransientStoreNode(o);
|
|
2343
2385
|
return o;
|
|
2344
2386
|
}
|
|
2345
2387
|
function notifyStoreProperty(e, t, n, r, i, s) {
|
|
2346
|
-
const o =
|
|
2388
|
+
const o = T || e[de];
|
|
2347
2389
|
const u = n !== "delete";
|
|
2348
|
-
const f = e[
|
|
2390
|
+
const f = e[fe]?.[t];
|
|
2349
2391
|
if (f) {
|
|
2350
2392
|
setSignal(f, u);
|
|
2351
2393
|
} else if (!o && n !== "invalidate" && s !== u) {
|
|
2352
|
-
const n = upsertStoreNode(e, getNodes(e,
|
|
2394
|
+
const n = upsertStoreNode(e, getNodes(e, fe), t, s);
|
|
2353
2395
|
setSignal(n, u);
|
|
2354
2396
|
}
|
|
2355
|
-
const l = getNodes(e,
|
|
2397
|
+
const l = getNodes(e, ue);
|
|
2356
2398
|
if (n === "set") {
|
|
2357
2399
|
if (l[t]) {
|
|
2358
2400
|
setSignal(l[t], () => (isWrappable(r) ? wrap(r, e) : r));
|
|
2359
2401
|
} else if (!o) {
|
|
2360
|
-
const n = upsertStoreNode(e, l, t, i, e[
|
|
2402
|
+
const n = upsertStoreNode(e, l, t, i, e[P]);
|
|
2361
2403
|
setSignal(n, () => (isWrappable(r) ? wrap(r, e) : r));
|
|
2362
2404
|
}
|
|
2363
2405
|
} else if (n === "invalidate") {
|
|
@@ -2369,83 +2411,88 @@ function notifyStoreProperty(e, t, n, r, i, s) {
|
|
|
2369
2411
|
if (l[t]) {
|
|
2370
2412
|
setSignal(l[t], undefined);
|
|
2371
2413
|
} else if (!o) {
|
|
2372
|
-
const n = upsertStoreNode(e, l, t, i, e[
|
|
2414
|
+
const n = upsertStoreNode(e, l, t, i, e[P]);
|
|
2373
2415
|
setSignal(n, undefined);
|
|
2374
2416
|
}
|
|
2375
2417
|
}
|
|
2376
|
-
l[
|
|
2418
|
+
l[ee] && setSignal(l[ee], undefined);
|
|
2377
2419
|
}
|
|
2378
|
-
let
|
|
2379
|
-
const
|
|
2420
|
+
let ye = null;
|
|
2421
|
+
const ge = {
|
|
2380
2422
|
get(e, t, n) {
|
|
2381
|
-
if (t ===
|
|
2382
|
-
if (t ===
|
|
2383
|
-
if (t ===
|
|
2384
|
-
if (t ===
|
|
2423
|
+
if (t === te) return e;
|
|
2424
|
+
if (t === ne) return n;
|
|
2425
|
+
if (t === C) return e[ae];
|
|
2426
|
+
if (t === ee) {
|
|
2385
2427
|
trackSelf(e);
|
|
2386
2428
|
return n;
|
|
2387
2429
|
}
|
|
2388
|
-
const r = getNodes(e,
|
|
2430
|
+
const r = getNodes(e, ue);
|
|
2389
2431
|
const i = r[t];
|
|
2390
|
-
const s = e[
|
|
2391
|
-
const o = s || (e[
|
|
2392
|
-
const u = !!e[
|
|
2393
|
-
const f = s ? e[
|
|
2432
|
+
const s = e[oe] && t in e[oe];
|
|
2433
|
+
const o = s || (e[se] && t in e[se]);
|
|
2434
|
+
const u = !!e[ie][te];
|
|
2435
|
+
const f = s ? e[oe] : e[se] && t in e[se] ? e[se] : e[ie];
|
|
2394
2436
|
if (!i) {
|
|
2395
2437
|
const e = Object.getOwnPropertyDescriptor(f, t);
|
|
2396
2438
|
if (e && e.get) return e.get.call(n);
|
|
2397
2439
|
}
|
|
2398
2440
|
if (writeOnly(n)) {
|
|
2399
2441
|
let n =
|
|
2400
|
-
i && (o || !u) ? (i.H !== undefined && i.H !==
|
|
2401
|
-
n ===
|
|
2442
|
+
i && (o || !u) ? (i.H !== undefined && i.H !== v ? i.H : i.T !== v ? i.T : i.ne) : f[t];
|
|
2443
|
+
n === re && (n = undefined);
|
|
2402
2444
|
if (!isWrappable(n)) return n;
|
|
2403
2445
|
const r = wrap(n, e);
|
|
2404
|
-
|
|
2446
|
+
ye?.add(r);
|
|
2405
2447
|
return r;
|
|
2406
2448
|
}
|
|
2407
2449
|
let l = i ? (o || !u ? read(r[t]) : (read(r[t]), f[t])) : f[t];
|
|
2408
|
-
l ===
|
|
2450
|
+
l === re && (l = undefined);
|
|
2409
2451
|
if (!i) {
|
|
2410
2452
|
if (!o && typeof l === "function" && !f.hasOwnProperty(t)) {
|
|
2411
2453
|
let t;
|
|
2412
|
-
return !Array.isArray(e[
|
|
2454
|
+
return !Array.isArray(e[ie]) && (t = Object.getPrototypeOf(e[ie])) && t !== Object.prototype
|
|
2413
2455
|
? l.bind(f)
|
|
2414
2456
|
: l;
|
|
2415
2457
|
} else if (getObserver()) {
|
|
2416
|
-
return read(getNode(r, t, isWrappable(l) ? wrap(l, e) : l, e[
|
|
2458
|
+
return read(getNode(r, t, isWrappable(l) ? wrap(l, e) : l, e[ae], isEqual, e[de], e[P]));
|
|
2417
2459
|
}
|
|
2418
2460
|
}
|
|
2419
2461
|
return isWrappable(l) ? wrap(l, e) : l;
|
|
2420
2462
|
},
|
|
2421
2463
|
has(e, t) {
|
|
2422
|
-
if (t ===
|
|
2423
|
-
const n =
|
|
2424
|
-
|
|
2425
|
-
|
|
2464
|
+
if (t === ne || t === ee || t === "__proto__") return true;
|
|
2465
|
+
const n =
|
|
2466
|
+
e[oe] && t in e[oe] ? e[oe][t] !== re : e[se] && t in e[se] ? e[se][t] !== re : t in e[ie];
|
|
2467
|
+
if (writeOnly(e[ne])) return n;
|
|
2468
|
+
const r = getNodes(e, fe);
|
|
2426
2469
|
if (r[t]) return read(r[t]);
|
|
2427
2470
|
if (getObserver()) {
|
|
2428
|
-
return read(getNode(r, t, n, e[
|
|
2471
|
+
return read(getNode(r, t, n, e[ae], isEqual, e[de]));
|
|
2429
2472
|
}
|
|
2430
2473
|
return n;
|
|
2431
2474
|
},
|
|
2432
2475
|
set(e, t, n) {
|
|
2433
|
-
const r = e[
|
|
2476
|
+
const r = e[ne];
|
|
2434
2477
|
if (writeOnly(r)) {
|
|
2435
2478
|
untrack(() => {
|
|
2436
2479
|
const { base: i, overrideKey: s, state: o } = prepareStoreWrite(e, r, t);
|
|
2437
|
-
const u = e[
|
|
2480
|
+
const u = e[oe] && t in e[oe] ? e[oe][t] : e[se] && t in e[se] ? e[se][t] : i;
|
|
2438
2481
|
const f =
|
|
2439
|
-
e[
|
|
2440
|
-
|
|
2482
|
+
e[oe] && t in e[oe]
|
|
2483
|
+
? e[oe][t] !== re
|
|
2484
|
+
: e[se] && t in e[se]
|
|
2485
|
+
? e[se][t] !== re
|
|
2486
|
+
: t in e[ie];
|
|
2487
|
+
const l = n?.[te]?.[ie] ?? n;
|
|
2441
2488
|
const c = Array.isArray(o) && t !== "length";
|
|
2442
2489
|
const a = c ? parseInt(t) + 1 : 0;
|
|
2443
2490
|
const d =
|
|
2444
2491
|
c &&
|
|
2445
|
-
(e[
|
|
2446
|
-
? e[
|
|
2447
|
-
: e[
|
|
2448
|
-
? e[
|
|
2492
|
+
(e[oe] && "length" in e[oe]
|
|
2493
|
+
? e[oe].length
|
|
2494
|
+
: e[se] && "length" in e[se]
|
|
2495
|
+
? e[se].length
|
|
2449
2496
|
: o.length);
|
|
2450
2497
|
const h = c && a > d ? a : undefined;
|
|
2451
2498
|
if (u === l && h === undefined) return true;
|
|
@@ -2457,11 +2504,11 @@ const ce = {
|
|
|
2457
2504
|
}
|
|
2458
2505
|
notifyStoreProperty(e, t, "set", l, u, f);
|
|
2459
2506
|
if (Array.isArray(o) && t !== "length" && h !== undefined) {
|
|
2460
|
-
const t = getNodes(e,
|
|
2507
|
+
const t = getNodes(e, ue);
|
|
2461
2508
|
if (t.length) {
|
|
2462
2509
|
setSignal(t.length, h);
|
|
2463
|
-
} else if (!
|
|
2464
|
-
const n = upsertStoreNode(e, t, "length", d, e[
|
|
2510
|
+
} else if (!T && !e[de]) {
|
|
2511
|
+
const n = upsertStoreNode(e, t, "length", d, e[P]);
|
|
2465
2512
|
setSignal(n, h);
|
|
2466
2513
|
}
|
|
2467
2514
|
}
|
|
@@ -2471,11 +2518,11 @@ const ce = {
|
|
|
2471
2518
|
return true;
|
|
2472
2519
|
},
|
|
2473
2520
|
defineProperty(e, t, n) {
|
|
2474
|
-
const r = e[
|
|
2521
|
+
const r = e[ne];
|
|
2475
2522
|
if (writeOnly(r)) {
|
|
2476
2523
|
untrack(() => {
|
|
2477
2524
|
const { base: i, overrideKey: s } = prepareStoreWrite(e, r, t);
|
|
2478
|
-
const o = "value" in n ? { ...n, value: n.value?.[
|
|
2525
|
+
const o = "value" in n ? { ...n, value: n.value?.[te]?.[ie] ?? n.value } : n;
|
|
2479
2526
|
Object.defineProperty(e[s] || (e[s] = Object.create(null)), t, o);
|
|
2480
2527
|
notifyStoreProperty(e, t, "invalidate");
|
|
2481
2528
|
if (false);
|
|
@@ -2484,16 +2531,16 @@ const ce = {
|
|
|
2484
2531
|
return true;
|
|
2485
2532
|
},
|
|
2486
2533
|
deleteProperty(e, t) {
|
|
2487
|
-
const n = e[
|
|
2488
|
-
const r = e[
|
|
2489
|
-
if (writeOnly(e[
|
|
2534
|
+
const n = e[oe]?.[t] === re;
|
|
2535
|
+
const r = e[se]?.[t] === re;
|
|
2536
|
+
if (writeOnly(e[ne]) && !n && !r) {
|
|
2490
2537
|
untrack(() => {
|
|
2491
|
-
const n = e[
|
|
2492
|
-
const r = n ?
|
|
2493
|
-
if (n) trackOptimisticStore(e[
|
|
2494
|
-
const i = e[
|
|
2495
|
-
if (t in e[
|
|
2496
|
-
(e[r] || (e[r] = Object.create(null)))[t] =
|
|
2538
|
+
const n = e[de] && !T;
|
|
2539
|
+
const r = n ? oe : se;
|
|
2540
|
+
if (n) trackOptimisticStore(e[ne]);
|
|
2541
|
+
const i = e[oe] && t in e[oe] ? e[oe][t] : e[se] && t in e[se] ? e[se][t] : e[ie][t];
|
|
2542
|
+
if (t in e[ie] || (e[se] && t in e[se])) {
|
|
2543
|
+
(e[r] || (e[r] = Object.create(null)))[t] = re;
|
|
2497
2544
|
} else if (e[r] && t in e[r]) {
|
|
2498
2545
|
delete e[r][t];
|
|
2499
2546
|
} else return true;
|
|
@@ -2504,11 +2551,11 @@ const ce = {
|
|
|
2504
2551
|
},
|
|
2505
2552
|
ownKeys(e) {
|
|
2506
2553
|
trackSelf(e);
|
|
2507
|
-
let t = getKeys(e[
|
|
2508
|
-
if (e[
|
|
2554
|
+
let t = getKeys(e[ie], e[se], false);
|
|
2555
|
+
if (e[oe]) {
|
|
2509
2556
|
const n = new Set(t);
|
|
2510
|
-
for (const t of Reflect.ownKeys(e[
|
|
2511
|
-
if (e[
|
|
2557
|
+
for (const t of Reflect.ownKeys(e[oe])) {
|
|
2558
|
+
if (e[oe][t] !== re) n.add(t);
|
|
2512
2559
|
else n.delete(t);
|
|
2513
2560
|
}
|
|
2514
2561
|
t = Array.from(n);
|
|
@@ -2516,27 +2563,27 @@ const ce = {
|
|
|
2516
2563
|
return t;
|
|
2517
2564
|
},
|
|
2518
2565
|
getOwnPropertyDescriptor(e, t) {
|
|
2519
|
-
if (t ===
|
|
2520
|
-
if (e[
|
|
2521
|
-
if (e[
|
|
2522
|
-
const n = Reflect.getOwnPropertyDescriptor(e[
|
|
2523
|
-
if (n?.get || n?.set || !(t in e[
|
|
2524
|
-
const r = getPropertyDescriptor(e[
|
|
2566
|
+
if (t === ne) return { value: e[ne], writable: true, configurable: true };
|
|
2567
|
+
if (e[oe] && t in e[oe]) {
|
|
2568
|
+
if (e[oe][t] === re) return undefined;
|
|
2569
|
+
const n = Reflect.getOwnPropertyDescriptor(e[oe], t);
|
|
2570
|
+
if (n?.get || n?.set || !(t in e[ie])) return n;
|
|
2571
|
+
const r = getPropertyDescriptor(e[ie], e[se], t);
|
|
2525
2572
|
if (r) {
|
|
2526
|
-
return { ...r, value: e[
|
|
2573
|
+
return { ...r, value: e[oe][t] };
|
|
2527
2574
|
}
|
|
2528
|
-
return { value: e[
|
|
2575
|
+
return { value: e[oe][t], writable: true, enumerable: true, configurable: true };
|
|
2529
2576
|
}
|
|
2530
|
-
return getPropertyDescriptor(e[
|
|
2577
|
+
return getPropertyDescriptor(e[ie], e[se], t);
|
|
2531
2578
|
},
|
|
2532
2579
|
getPrototypeOf(e) {
|
|
2533
|
-
return Object.getPrototypeOf(e[
|
|
2580
|
+
return Object.getPrototypeOf(e[ie]);
|
|
2534
2581
|
}
|
|
2535
2582
|
};
|
|
2536
2583
|
function storeSetter(e, t) {
|
|
2537
|
-
const n =
|
|
2538
|
-
|
|
2539
|
-
|
|
2584
|
+
const n = ye;
|
|
2585
|
+
ye = new Set();
|
|
2586
|
+
ye.add(e);
|
|
2540
2587
|
try {
|
|
2541
2588
|
const n = t(e);
|
|
2542
2589
|
if (n !== e && n !== undefined) {
|
|
@@ -2552,8 +2599,8 @@ function storeSetter(e, t) {
|
|
|
2552
2599
|
}
|
|
2553
2600
|
}
|
|
2554
2601
|
} finally {
|
|
2555
|
-
|
|
2556
|
-
|
|
2602
|
+
ye.clear();
|
|
2603
|
+
ye = n;
|
|
2557
2604
|
}
|
|
2558
2605
|
}
|
|
2559
2606
|
function createStore(e, t, n) {
|
|
@@ -2562,7 +2609,7 @@ function createStore(e, t, n) {
|
|
|
2562
2609
|
return [i, e => storeSetter(i, e)];
|
|
2563
2610
|
}
|
|
2564
2611
|
function createOptimisticStore(e, t, n) {
|
|
2565
|
-
GlobalQueue.
|
|
2612
|
+
GlobalQueue.ce ||= clearOptimisticStore;
|
|
2566
2613
|
const r = typeof e === "function";
|
|
2567
2614
|
const i = r ? t : e;
|
|
2568
2615
|
const s = r ? e : undefined;
|
|
@@ -2570,39 +2617,39 @@ function createOptimisticStore(e, t, n) {
|
|
|
2570
2617
|
return [o, e => storeSetter(o, e)];
|
|
2571
2618
|
}
|
|
2572
2619
|
function clearOptimisticStore(e) {
|
|
2573
|
-
const t = e[
|
|
2574
|
-
if (!t || !t[
|
|
2575
|
-
const n = t[
|
|
2576
|
-
const r = t[
|
|
2620
|
+
const t = e[te];
|
|
2621
|
+
if (!t || !t[oe]) return;
|
|
2622
|
+
const n = t[oe];
|
|
2623
|
+
const r = t[ue];
|
|
2577
2624
|
setProjectionWriteActive(true);
|
|
2578
2625
|
try {
|
|
2579
2626
|
if (r) {
|
|
2580
2627
|
for (const e of Reflect.ownKeys(n)) {
|
|
2581
2628
|
if (r[e]) {
|
|
2582
|
-
r[e].
|
|
2583
|
-
const n = t[
|
|
2584
|
-
const i = n ===
|
|
2629
|
+
r[e].te = undefined;
|
|
2630
|
+
const n = t[se] && e in t[se] ? t[se][e] : t[ie][e];
|
|
2631
|
+
const i = n === re ? undefined : n;
|
|
2585
2632
|
setSignal(r[e], isWrappable(i) ? wrap(i, t) : i);
|
|
2586
2633
|
}
|
|
2587
2634
|
}
|
|
2588
|
-
if (r[
|
|
2589
|
-
r[
|
|
2590
|
-
setSignal(r[
|
|
2635
|
+
if (r[ee]) {
|
|
2636
|
+
r[ee].te = undefined;
|
|
2637
|
+
setSignal(r[ee], undefined);
|
|
2591
2638
|
}
|
|
2592
2639
|
}
|
|
2593
2640
|
} finally {
|
|
2594
2641
|
setProjectionWriteActive(false);
|
|
2595
2642
|
}
|
|
2596
|
-
delete t[
|
|
2643
|
+
delete t[oe];
|
|
2597
2644
|
}
|
|
2598
2645
|
function createOptimisticProjectionInternal(e, t, n) {
|
|
2599
2646
|
let r;
|
|
2600
2647
|
const i = new WeakMap();
|
|
2601
2648
|
const wrapper = e => {
|
|
2602
|
-
e[
|
|
2603
|
-
e[
|
|
2604
|
-
e[
|
|
2605
|
-
Object.defineProperty(e,
|
|
2649
|
+
e[le] = wrapProjection;
|
|
2650
|
+
e[ce] = i;
|
|
2651
|
+
e[de] = true;
|
|
2652
|
+
Object.defineProperty(e, ae, {
|
|
2606
2653
|
get() {
|
|
2607
2654
|
return r;
|
|
2608
2655
|
},
|
|
@@ -2611,8 +2658,8 @@ function createOptimisticProjectionInternal(e, t, n) {
|
|
|
2611
2658
|
};
|
|
2612
2659
|
const wrapProjection = e => {
|
|
2613
2660
|
if (i.has(e)) return i.get(e);
|
|
2614
|
-
if (e[
|
|
2615
|
-
const t = createStoreProxy(e,
|
|
2661
|
+
if (e[te]?.[le] === wrapProjection) return e;
|
|
2662
|
+
const t = createStoreProxy(e, ge, wrapper);
|
|
2616
2663
|
i.set(e, t);
|
|
2617
2664
|
return t;
|
|
2618
2665
|
};
|
|
@@ -2634,11 +2681,11 @@ function createOptimisticProjectionInternal(e, t, n) {
|
|
|
2634
2681
|
setProjectionWriteActive(false);
|
|
2635
2682
|
}
|
|
2636
2683
|
}, undefined);
|
|
2637
|
-
r.
|
|
2684
|
+
r.de &= ~g;
|
|
2638
2685
|
}
|
|
2639
2686
|
return { store: s, node: r };
|
|
2640
2687
|
}
|
|
2641
|
-
const
|
|
2688
|
+
const Se = Symbol(0);
|
|
2642
2689
|
function updatePath(e, t, n = 0) {
|
|
2643
2690
|
let r,
|
|
2644
2691
|
i = e;
|
|
@@ -2682,7 +2729,7 @@ function updatePath(e, t, n = 0) {
|
|
|
2682
2729
|
if (s === i) return;
|
|
2683
2730
|
}
|
|
2684
2731
|
if (r === undefined && s == undefined) return;
|
|
2685
|
-
if (s ===
|
|
2732
|
+
if (s === Se) {
|
|
2686
2733
|
delete e[r];
|
|
2687
2734
|
} else if (r === undefined || (isWrappable(i) && isWrappable(s) && !Array.isArray(s))) {
|
|
2688
2735
|
const t = r !== undefined ? e[r] : e;
|
|
@@ -2697,26 +2744,26 @@ function updatePath(e, t, n = 0) {
|
|
|
2697
2744
|
e[r] = s;
|
|
2698
2745
|
}
|
|
2699
2746
|
}
|
|
2700
|
-
const
|
|
2747
|
+
const we = Object.assign(
|
|
2701
2748
|
function storePath(...e) {
|
|
2702
2749
|
return t => {
|
|
2703
2750
|
updatePath(t, e);
|
|
2704
2751
|
};
|
|
2705
2752
|
},
|
|
2706
|
-
{ DELETE:
|
|
2753
|
+
{ DELETE: Se }
|
|
2707
2754
|
);
|
|
2708
2755
|
function snapshotImpl(e, t, n, r) {
|
|
2709
2756
|
let i, s, o, u, f, l;
|
|
2710
2757
|
if (!isWrappable(e)) return e;
|
|
2711
2758
|
if (n && n.has(e)) return n.get(e);
|
|
2712
2759
|
if (!n) n = new Map();
|
|
2713
|
-
if ((i = e[
|
|
2714
|
-
if (t) trackSelf(i,
|
|
2715
|
-
o = i[
|
|
2716
|
-
s = Array.isArray(i[
|
|
2717
|
-
n.set(e, o ? (u = s ? [] : Object.create(Object.getPrototypeOf(i[
|
|
2718
|
-
e = i[
|
|
2719
|
-
r =
|
|
2760
|
+
if ((i = e[te] || r?.get(e)?.[te])) {
|
|
2761
|
+
if (t) trackSelf(i, ee);
|
|
2762
|
+
o = i[se];
|
|
2763
|
+
s = Array.isArray(i[ie]);
|
|
2764
|
+
n.set(e, o ? (u = s ? [] : Object.create(Object.getPrototypeOf(i[ie]))) : i[ie]);
|
|
2765
|
+
e = i[ie];
|
|
2766
|
+
r = he;
|
|
2720
2767
|
} else {
|
|
2721
2768
|
s = Array.isArray(e);
|
|
2722
2769
|
n.set(e, e);
|
|
@@ -2725,7 +2772,7 @@ function snapshotImpl(e, t, n, r) {
|
|
|
2725
2772
|
const s = o?.length || e.length;
|
|
2726
2773
|
for (let c = 0; c < s; c++) {
|
|
2727
2774
|
l = o && c in o ? o[c] : e[c];
|
|
2728
|
-
if (l ===
|
|
2775
|
+
if (l === re) continue;
|
|
2729
2776
|
if (t && isWrappable(l)) wrap(l, i);
|
|
2730
2777
|
if ((f = snapshotImpl(l, t, n, r)) !== l || u) {
|
|
2731
2778
|
if (!u) n.set(e, (u = [...e]));
|
|
@@ -2760,13 +2807,13 @@ function deep(e) {
|
|
|
2760
2807
|
function trueFn() {
|
|
2761
2808
|
return true;
|
|
2762
2809
|
}
|
|
2763
|
-
const
|
|
2810
|
+
const me = {
|
|
2764
2811
|
get(e, t, n) {
|
|
2765
|
-
if (t ===
|
|
2812
|
+
if (t === ne) return n;
|
|
2766
2813
|
return e.get(t);
|
|
2767
2814
|
},
|
|
2768
2815
|
has(e, t) {
|
|
2769
|
-
if (t ===
|
|
2816
|
+
if (t === ne) return true;
|
|
2770
2817
|
return e.has(t);
|
|
2771
2818
|
},
|
|
2772
2819
|
set: trueFn,
|
|
@@ -2789,23 +2836,23 @@ const he = {
|
|
|
2789
2836
|
function resolveSource(e) {
|
|
2790
2837
|
return !(e = typeof e === "function" ? e() : e) ? {} : e;
|
|
2791
2838
|
}
|
|
2792
|
-
const
|
|
2839
|
+
const be = Symbol(0);
|
|
2793
2840
|
function merge(...e) {
|
|
2794
2841
|
if (e.length === 1 && typeof e[0] !== "function") return e[0];
|
|
2795
2842
|
let t = false;
|
|
2796
2843
|
const n = [];
|
|
2797
2844
|
for (let r = 0; r < e.length; r++) {
|
|
2798
2845
|
const i = e[r];
|
|
2799
|
-
t = t || (!!i &&
|
|
2800
|
-
const s = !!i && i[
|
|
2846
|
+
t = t || (!!i && ne in i);
|
|
2847
|
+
const s = !!i && i[be];
|
|
2801
2848
|
if (s) n.push(...s);
|
|
2802
2849
|
else n.push(typeof i === "function" ? ((t = true), createMemo(i)) : i);
|
|
2803
2850
|
}
|
|
2804
|
-
if (
|
|
2851
|
+
if (k && t) {
|
|
2805
2852
|
return new Proxy(
|
|
2806
2853
|
{
|
|
2807
2854
|
get(e) {
|
|
2808
|
-
if (e ===
|
|
2855
|
+
if (e === be) return n;
|
|
2809
2856
|
for (let t = n.length - 1; t >= 0; t--) {
|
|
2810
2857
|
const r = resolveSource(n[t]);
|
|
2811
2858
|
if (e in r) return r[e];
|
|
@@ -2823,7 +2870,7 @@ function merge(...e) {
|
|
|
2823
2870
|
return [...new Set(e)];
|
|
2824
2871
|
}
|
|
2825
2872
|
},
|
|
2826
|
-
|
|
2873
|
+
me
|
|
2827
2874
|
);
|
|
2828
2875
|
}
|
|
2829
2876
|
const r = Object.create(null);
|
|
@@ -2855,12 +2902,12 @@ function merge(...e) {
|
|
|
2855
2902
|
if (n.get) Object.defineProperty(o, t, n);
|
|
2856
2903
|
else o[t] = n.value;
|
|
2857
2904
|
}
|
|
2858
|
-
o[
|
|
2905
|
+
o[be] = n;
|
|
2859
2906
|
return o;
|
|
2860
2907
|
}
|
|
2861
2908
|
function omit(e, ...t) {
|
|
2862
2909
|
const n = new Set(t);
|
|
2863
|
-
if (
|
|
2910
|
+
if (k && ne in e) {
|
|
2864
2911
|
return new Proxy(
|
|
2865
2912
|
{
|
|
2866
2913
|
get(t) {
|
|
@@ -2873,7 +2920,7 @@ function omit(e, ...t) {
|
|
|
2873
2920
|
return Object.keys(e).filter(e => !n.has(e));
|
|
2874
2921
|
}
|
|
2875
2922
|
},
|
|
2876
|
-
|
|
2923
|
+
me
|
|
2877
2924
|
);
|
|
2878
2925
|
}
|
|
2879
2926
|
const r = {};
|
|
@@ -2891,69 +2938,69 @@ function mapArray(e, t, n) {
|
|
|
2891
2938
|
const r = typeof n?.keyed === "function" ? n.keyed : undefined;
|
|
2892
2939
|
const i = t.length > 1;
|
|
2893
2940
|
const s = t;
|
|
2894
|
-
const o =
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
return accessor(
|
|
2941
|
+
const o = {
|
|
2942
|
+
Be: createOwner(),
|
|
2943
|
+
Ke: 0,
|
|
2944
|
+
Ge: e,
|
|
2945
|
+
ze: [],
|
|
2946
|
+
Ue: s,
|
|
2947
|
+
Je: [],
|
|
2948
|
+
Xe: [],
|
|
2949
|
+
Ye: r,
|
|
2950
|
+
Ze: r || n?.keyed === false ? [] : undefined,
|
|
2951
|
+
$e: i ? [] : undefined,
|
|
2952
|
+
et: n?.fallback
|
|
2953
|
+
};
|
|
2954
|
+
const u = computed(updateKeyedMap.bind(o));
|
|
2955
|
+
o.Be.u = u;
|
|
2956
|
+
u.de &= ~g;
|
|
2957
|
+
return accessor(u);
|
|
2911
2958
|
}
|
|
2912
|
-
const
|
|
2959
|
+
const _e = { ownedWrite: true };
|
|
2913
2960
|
function updateKeyedMap() {
|
|
2914
|
-
const e = this.
|
|
2961
|
+
const e = this.Ge() || [],
|
|
2915
2962
|
t = e.length;
|
|
2916
|
-
e[
|
|
2917
|
-
runWithOwner(this.
|
|
2963
|
+
e[ee];
|
|
2964
|
+
runWithOwner(this.Be, () => {
|
|
2918
2965
|
let n,
|
|
2919
2966
|
r,
|
|
2920
|
-
i = this.
|
|
2967
|
+
i = this.Ze
|
|
2921
2968
|
? () => {
|
|
2922
|
-
this.
|
|
2923
|
-
this
|
|
2924
|
-
return this.
|
|
2969
|
+
this.Ze[r] = signal(e[r], _e);
|
|
2970
|
+
this.$e && (this.$e[r] = signal(r, _e));
|
|
2971
|
+
return this.Ue(accessor(this.Ze[r]), this.$e ? accessor(this.$e[r]) : undefined);
|
|
2925
2972
|
}
|
|
2926
|
-
: this
|
|
2973
|
+
: this.$e
|
|
2927
2974
|
? () => {
|
|
2928
2975
|
const t = e[r];
|
|
2929
|
-
this
|
|
2930
|
-
return this.
|
|
2976
|
+
this.$e[r] = signal(r, _e);
|
|
2977
|
+
return this.Ue(() => t, accessor(this.$e[r]));
|
|
2931
2978
|
}
|
|
2932
2979
|
: () => {
|
|
2933
2980
|
const t = e[r];
|
|
2934
|
-
return this.
|
|
2981
|
+
return this.Ue(() => t);
|
|
2935
2982
|
};
|
|
2936
2983
|
if (t === 0) {
|
|
2937
|
-
if (this.
|
|
2938
|
-
this.
|
|
2939
|
-
this.$e = [];
|
|
2984
|
+
if (this.Ke !== 0) {
|
|
2985
|
+
this.Be.dispose(false);
|
|
2940
2986
|
this.Xe = [];
|
|
2941
|
-
this.
|
|
2942
|
-
this.
|
|
2943
|
-
this.
|
|
2944
|
-
this.
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
this.
|
|
2987
|
+
this.ze = [];
|
|
2988
|
+
this.Je = [];
|
|
2989
|
+
this.Ke = 0;
|
|
2990
|
+
this.Ze && (this.Ze = []);
|
|
2991
|
+
this.$e && (this.$e = []);
|
|
2992
|
+
}
|
|
2993
|
+
if (this.et && !this.Je[0]) {
|
|
2994
|
+
this.Je[0] = runWithOwner((this.Xe[0] = createOwner()), this.et);
|
|
2995
|
+
}
|
|
2996
|
+
} else if (this.Ke === 0) {
|
|
2997
|
+
if (this.Xe[0]) this.Xe[0].dispose();
|
|
2998
|
+
this.Je = new Array(t);
|
|
2952
2999
|
for (r = 0; r < t; r++) {
|
|
2953
|
-
this.
|
|
2954
|
-
this.
|
|
3000
|
+
this.ze[r] = e[r];
|
|
3001
|
+
this.Je[r] = runWithOwner((this.Xe[r] = createOwner()), i);
|
|
2955
3002
|
}
|
|
2956
|
-
this.
|
|
3003
|
+
this.Ke = t;
|
|
2957
3004
|
} else {
|
|
2958
3005
|
let s,
|
|
2959
3006
|
o,
|
|
@@ -2964,149 +3011,149 @@ function updateKeyedMap() {
|
|
|
2964
3011
|
a,
|
|
2965
3012
|
d = new Array(t),
|
|
2966
3013
|
h = new Array(t),
|
|
2967
|
-
p = this.
|
|
2968
|
-
y = this
|
|
3014
|
+
p = this.Ze ? new Array(t) : undefined,
|
|
3015
|
+
y = this.$e ? new Array(t) : undefined;
|
|
2969
3016
|
for (
|
|
2970
|
-
s = 0, o = Math.min(this.
|
|
2971
|
-
s < o && (this.
|
|
3017
|
+
s = 0, o = Math.min(this.Ke, t);
|
|
3018
|
+
s < o && (this.ze[s] === e[s] || (this.Ze && compare(this.Ye, this.ze[s], e[s])));
|
|
2972
3019
|
s++
|
|
2973
3020
|
) {
|
|
2974
|
-
if (this.
|
|
3021
|
+
if (this.Ze) setSignal(this.Ze[s], e[s]);
|
|
2975
3022
|
}
|
|
2976
3023
|
for (
|
|
2977
|
-
o = this.
|
|
3024
|
+
o = this.Ke - 1, u = t - 1;
|
|
2978
3025
|
o >= s &&
|
|
2979
3026
|
u >= s &&
|
|
2980
|
-
(this.
|
|
3027
|
+
(this.ze[o] === e[u] || (this.Ze && compare(this.Ye, this.ze[o], e[u])));
|
|
2981
3028
|
o--, u--
|
|
2982
3029
|
) {
|
|
2983
|
-
d[u] = this.
|
|
2984
|
-
h[u] = this
|
|
2985
|
-
p && (p[u] = this.
|
|
2986
|
-
y && (y[u] = this
|
|
3030
|
+
d[u] = this.Je[o];
|
|
3031
|
+
h[u] = this.Xe[o];
|
|
3032
|
+
p && (p[u] = this.Ze[o]);
|
|
3033
|
+
y && (y[u] = this.$e[o]);
|
|
2987
3034
|
}
|
|
2988
3035
|
c = new Map();
|
|
2989
3036
|
a = new Array(u + 1);
|
|
2990
3037
|
for (r = u; r >= s; r--) {
|
|
2991
3038
|
f = e[r];
|
|
2992
|
-
l = this.
|
|
3039
|
+
l = this.Ye ? this.Ye(f) : f;
|
|
2993
3040
|
n = c.get(l);
|
|
2994
3041
|
a[r] = n === undefined ? -1 : n;
|
|
2995
3042
|
c.set(l, r);
|
|
2996
3043
|
}
|
|
2997
3044
|
for (n = s; n <= o; n++) {
|
|
2998
|
-
f = this.
|
|
2999
|
-
l = this.
|
|
3045
|
+
f = this.ze[n];
|
|
3046
|
+
l = this.Ye ? this.Ye(f) : f;
|
|
3000
3047
|
r = c.get(l);
|
|
3001
3048
|
if (r !== undefined && r !== -1) {
|
|
3002
|
-
d[r] = this.
|
|
3003
|
-
h[r] = this
|
|
3004
|
-
p && (p[r] = this.
|
|
3005
|
-
y && (y[r] = this
|
|
3049
|
+
d[r] = this.Je[n];
|
|
3050
|
+
h[r] = this.Xe[n];
|
|
3051
|
+
p && (p[r] = this.Ze[n]);
|
|
3052
|
+
y && (y[r] = this.$e[n]);
|
|
3006
3053
|
r = a[r];
|
|
3007
3054
|
c.set(l, r);
|
|
3008
|
-
} else this
|
|
3055
|
+
} else this.Xe[n].dispose();
|
|
3009
3056
|
}
|
|
3010
3057
|
for (r = s; r < t; r++) {
|
|
3011
3058
|
if (r in d) {
|
|
3012
|
-
this.
|
|
3013
|
-
this
|
|
3059
|
+
this.Je[r] = d[r];
|
|
3060
|
+
this.Xe[r] = h[r];
|
|
3014
3061
|
if (p) {
|
|
3015
|
-
this.
|
|
3016
|
-
setSignal(this.
|
|
3062
|
+
this.Ze[r] = p[r];
|
|
3063
|
+
setSignal(this.Ze[r], e[r]);
|
|
3017
3064
|
}
|
|
3018
3065
|
if (y) {
|
|
3019
|
-
this
|
|
3020
|
-
setSignal(this
|
|
3066
|
+
this.$e[r] = y[r];
|
|
3067
|
+
setSignal(this.$e[r], r);
|
|
3021
3068
|
}
|
|
3022
3069
|
} else {
|
|
3023
|
-
this.
|
|
3070
|
+
this.Je[r] = runWithOwner((this.Xe[r] = createOwner()), i);
|
|
3024
3071
|
}
|
|
3025
3072
|
}
|
|
3026
|
-
this.
|
|
3027
|
-
this.
|
|
3073
|
+
this.Je = this.Je.slice(0, (this.Ke = t));
|
|
3074
|
+
this.ze = e.slice(0);
|
|
3028
3075
|
}
|
|
3029
3076
|
});
|
|
3030
|
-
return this.
|
|
3077
|
+
return this.Je;
|
|
3031
3078
|
}
|
|
3032
3079
|
function repeat(e, t, n) {
|
|
3033
3080
|
const r = t;
|
|
3034
3081
|
const i = computed(
|
|
3035
3082
|
updateRepeat.bind({
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3083
|
+
Be: createOwner(),
|
|
3084
|
+
Ke: 0,
|
|
3085
|
+
tt: 0,
|
|
3086
|
+
nt: e,
|
|
3087
|
+
Ue: r,
|
|
3088
|
+
Xe: [],
|
|
3089
|
+
Je: [],
|
|
3090
|
+
rt: n?.from,
|
|
3091
|
+
et: n?.fallback
|
|
3045
3092
|
})
|
|
3046
3093
|
);
|
|
3047
|
-
i.
|
|
3094
|
+
i.de &= ~g;
|
|
3048
3095
|
return accessor(i);
|
|
3049
3096
|
}
|
|
3050
3097
|
function updateRepeat() {
|
|
3051
|
-
const e = this.
|
|
3052
|
-
const t = this.
|
|
3053
|
-
runWithOwner(this.
|
|
3098
|
+
const e = this.nt();
|
|
3099
|
+
const t = this.rt?.() || 0;
|
|
3100
|
+
runWithOwner(this.Be, () => {
|
|
3054
3101
|
if (e === 0) {
|
|
3055
|
-
if (this.
|
|
3056
|
-
this.
|
|
3057
|
-
this
|
|
3058
|
-
this.
|
|
3059
|
-
this.
|
|
3102
|
+
if (this.Ke !== 0) {
|
|
3103
|
+
this.Be.dispose(false);
|
|
3104
|
+
this.Xe = [];
|
|
3105
|
+
this.Je = [];
|
|
3106
|
+
this.Ke = 0;
|
|
3060
3107
|
}
|
|
3061
|
-
if (this.
|
|
3062
|
-
this.
|
|
3108
|
+
if (this.et && !this.Je[0]) {
|
|
3109
|
+
this.Je[0] = runWithOwner((this.Xe[0] = createOwner()), this.et);
|
|
3063
3110
|
}
|
|
3064
3111
|
return;
|
|
3065
3112
|
}
|
|
3066
3113
|
const n = t + e;
|
|
3067
|
-
const r = this.
|
|
3068
|
-
if (this.
|
|
3069
|
-
for (let e = n; e < r; e++) this
|
|
3070
|
-
if (this.
|
|
3071
|
-
let e = this.
|
|
3072
|
-
while (e < t && e < this.
|
|
3073
|
-
this
|
|
3074
|
-
this.
|
|
3075
|
-
} else if (this.
|
|
3076
|
-
let n = r - this.
|
|
3077
|
-
let i = this.
|
|
3078
|
-
this
|
|
3114
|
+
const r = this.tt + this.Ke;
|
|
3115
|
+
if (this.Ke === 0 && this.Xe[0]) this.Xe[0].dispose();
|
|
3116
|
+
for (let e = n; e < r; e++) this.Xe[e - this.tt].dispose();
|
|
3117
|
+
if (this.tt < t) {
|
|
3118
|
+
let e = this.tt;
|
|
3119
|
+
while (e < t && e < this.Ke) this.Xe[e++].dispose();
|
|
3120
|
+
this.Xe.splice(0, t - this.tt);
|
|
3121
|
+
this.Je.splice(0, t - this.tt);
|
|
3122
|
+
} else if (this.tt > t) {
|
|
3123
|
+
let n = r - this.tt - 1;
|
|
3124
|
+
let i = this.tt - t;
|
|
3125
|
+
this.Xe.length = this.Je.length = e;
|
|
3079
3126
|
while (n >= i) {
|
|
3080
|
-
this
|
|
3081
|
-
this.
|
|
3127
|
+
this.Xe[n] = this.Xe[n - i];
|
|
3128
|
+
this.Je[n] = this.Je[n - i];
|
|
3082
3129
|
n--;
|
|
3083
3130
|
}
|
|
3084
3131
|
for (let e = 0; e < i; e++) {
|
|
3085
|
-
this.
|
|
3132
|
+
this.Je[e] = runWithOwner((this.Xe[e] = createOwner()), () => this.Ue(e + t));
|
|
3086
3133
|
}
|
|
3087
3134
|
}
|
|
3088
3135
|
for (let e = r; e < n; e++) {
|
|
3089
|
-
this.
|
|
3136
|
+
this.Je[e - t] = runWithOwner((this.Xe[e - t] = createOwner()), () => this.Ue(e));
|
|
3090
3137
|
}
|
|
3091
|
-
this.
|
|
3092
|
-
this.
|
|
3093
|
-
this.
|
|
3138
|
+
this.Je = this.Je.slice(0, e);
|
|
3139
|
+
this.tt = t;
|
|
3140
|
+
this.Ke = e;
|
|
3094
3141
|
});
|
|
3095
|
-
return this.
|
|
3142
|
+
return this.Je;
|
|
3096
3143
|
}
|
|
3097
3144
|
function compare(e, t, n) {
|
|
3098
3145
|
return e ? e(t) === e(n) : true;
|
|
3099
3146
|
}
|
|
3100
3147
|
function boundaryComputed(e, t) {
|
|
3101
3148
|
const n = computed(e, { lazy: true });
|
|
3102
|
-
n.
|
|
3149
|
+
n.Te = (e, t) => {
|
|
3103
3150
|
const r = e !== undefined ? e : n.ge;
|
|
3104
|
-
const i = t !== undefined ? t : n.
|
|
3105
|
-
n.ge &= ~n.
|
|
3106
|
-
n.K.notify(n, n.
|
|
3151
|
+
const i = t !== undefined ? t : n.he;
|
|
3152
|
+
n.ge &= ~n.it;
|
|
3153
|
+
n.K.notify(n, n.it, r, i);
|
|
3107
3154
|
};
|
|
3108
|
-
n.
|
|
3109
|
-
n.
|
|
3155
|
+
n.it = t;
|
|
3156
|
+
n.de &= ~g;
|
|
3110
3157
|
recompute(n, true);
|
|
3111
3158
|
return n;
|
|
3112
3159
|
}
|
|
@@ -3119,61 +3166,61 @@ function createBoundChildren(e, t, n, r) {
|
|
|
3119
3166
|
return boundaryComputed(() => staleValues(() => flatten(read(e))), r);
|
|
3120
3167
|
});
|
|
3121
3168
|
}
|
|
3122
|
-
const
|
|
3123
|
-
const
|
|
3124
|
-
let
|
|
3169
|
+
const Oe = Symbol();
|
|
3170
|
+
const ve = createContext(null);
|
|
3171
|
+
let xe = false;
|
|
3125
3172
|
const FALSE_ACCESSOR = () => false;
|
|
3126
3173
|
const SEQUENTIAL_ACCESSOR = () => "sequential";
|
|
3127
3174
|
function isRevealController(e) {
|
|
3128
3175
|
return e instanceof RevealController;
|
|
3129
3176
|
}
|
|
3130
3177
|
function isSlotReady(e) {
|
|
3131
|
-
return isRevealController(e) ? e.isReady() : e.
|
|
3178
|
+
return isRevealController(e) ? e.isReady() : e.st.size === 0 && !e.ot;
|
|
3132
3179
|
}
|
|
3133
3180
|
function isSlotMinimallyReady(e) {
|
|
3134
3181
|
return isRevealController(e) ? e.isMinimallyReady() : isSlotReady(e);
|
|
3135
3182
|
}
|
|
3136
3183
|
function setSlotState(e, t, n, r) {
|
|
3137
|
-
setSignal(e.
|
|
3138
|
-
setSignal(e.
|
|
3184
|
+
setSignal(e.ut, n);
|
|
3185
|
+
setSignal(e.ft, r);
|
|
3139
3186
|
if (isRevealController(e)) {
|
|
3140
|
-
if (!n && e.
|
|
3187
|
+
if (!n && e.lt === t) e.lt = undefined;
|
|
3141
3188
|
return e.evaluate(n, r);
|
|
3142
3189
|
}
|
|
3143
|
-
if (!n && e.
|
|
3190
|
+
if (!n && e.ct === t && e.dt) e.ct = undefined;
|
|
3144
3191
|
}
|
|
3145
3192
|
class RevealController {
|
|
3146
|
-
St;
|
|
3147
|
-
wt;
|
|
3148
|
-
bt = [];
|
|
3149
3193
|
ht;
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3194
|
+
yt;
|
|
3195
|
+
gt = [];
|
|
3196
|
+
lt;
|
|
3197
|
+
ut = signal(false, { ownedWrite: true, Qe: true });
|
|
3198
|
+
ft = signal(false, { ownedWrite: true, Qe: true });
|
|
3199
|
+
St = true;
|
|
3200
|
+
wt = true;
|
|
3201
|
+
bt = false;
|
|
3155
3202
|
constructor(e, t) {
|
|
3156
|
-
this.
|
|
3157
|
-
this.
|
|
3203
|
+
this.ht = e;
|
|
3204
|
+
this.yt = t;
|
|
3158
3205
|
}
|
|
3159
|
-
|
|
3160
|
-
for (let t = 0; t < this.
|
|
3161
|
-
const n = this.
|
|
3162
|
-
if ((isRevealController(n) ? n.
|
|
3206
|
+
_t(e) {
|
|
3207
|
+
for (let t = 0; t < this.gt.length; t++) {
|
|
3208
|
+
const n = this.gt[t];
|
|
3209
|
+
if ((isRevealController(n) ? n.lt : n.ct) !== this) continue;
|
|
3163
3210
|
if (e(n) === false) return false;
|
|
3164
3211
|
}
|
|
3165
3212
|
return true;
|
|
3166
3213
|
}
|
|
3167
3214
|
isReady() {
|
|
3168
|
-
return this.
|
|
3215
|
+
return this._t(isSlotReady);
|
|
3169
3216
|
}
|
|
3170
3217
|
isMinimallyReady() {
|
|
3171
|
-
const e = untrack(this.
|
|
3218
|
+
const e = untrack(this.ht);
|
|
3172
3219
|
if (e === "together") return this.isReady();
|
|
3173
3220
|
if (e === "natural") {
|
|
3174
3221
|
let e = false;
|
|
3175
3222
|
let t = false;
|
|
3176
|
-
this.
|
|
3223
|
+
this._t(n => {
|
|
3177
3224
|
e = true;
|
|
3178
3225
|
if (isSlotMinimallyReady(n)) {
|
|
3179
3226
|
t = true;
|
|
@@ -3183,58 +3230,58 @@ class RevealController {
|
|
|
3183
3230
|
return !e || t;
|
|
3184
3231
|
}
|
|
3185
3232
|
let t = true;
|
|
3186
|
-
this.
|
|
3233
|
+
this._t(e => {
|
|
3187
3234
|
t = isSlotMinimallyReady(e);
|
|
3188
3235
|
return false;
|
|
3189
3236
|
});
|
|
3190
3237
|
return t;
|
|
3191
3238
|
}
|
|
3192
3239
|
register(e) {
|
|
3193
|
-
if (this.
|
|
3194
|
-
this.
|
|
3195
|
-
const t = untrack(this.
|
|
3196
|
-
(setSignal(e.
|
|
3240
|
+
if (this.gt.includes(e)) return;
|
|
3241
|
+
this.gt.push(e);
|
|
3242
|
+
const t = untrack(this.ht);
|
|
3243
|
+
(setSignal(e.ut, true), setSignal(e.ft, t === "sequential" ? !!untrack(this.yt) : false));
|
|
3197
3244
|
untrack(() => this.evaluate());
|
|
3198
3245
|
}
|
|
3199
3246
|
unregister(e) {
|
|
3200
|
-
const t = this.
|
|
3201
|
-
if (t >= 0) this.
|
|
3247
|
+
const t = this.gt.indexOf(e);
|
|
3248
|
+
if (t >= 0) this.gt.splice(t, 1);
|
|
3202
3249
|
untrack(() => this.evaluate());
|
|
3203
3250
|
}
|
|
3204
3251
|
evaluate(e, t) {
|
|
3205
|
-
if (this.
|
|
3206
|
-
this.
|
|
3207
|
-
const n = this.
|
|
3208
|
-
const r = this.
|
|
3252
|
+
if (this.bt) return;
|
|
3253
|
+
this.bt = true;
|
|
3254
|
+
const n = this.St;
|
|
3255
|
+
const r = this.wt;
|
|
3209
3256
|
try {
|
|
3210
|
-
const n = e ?? read(this.
|
|
3211
|
-
r = untrack(this.
|
|
3212
|
-
i = r === "sequential" && !!untrack(this.
|
|
3257
|
+
const n = e ?? read(this.ut),
|
|
3258
|
+
r = untrack(this.ht),
|
|
3259
|
+
i = r === "sequential" && !!untrack(this.yt),
|
|
3213
3260
|
s = t ?? i;
|
|
3214
3261
|
if (n) {
|
|
3215
|
-
this.
|
|
3262
|
+
this._t(e => setSlotState(e, this, true, s));
|
|
3216
3263
|
} else if (r === "natural") {
|
|
3217
|
-
this.
|
|
3264
|
+
this._t(e => {
|
|
3218
3265
|
if (isRevealController(e)) {
|
|
3219
|
-
setSignal(e.
|
|
3220
|
-
setSignal(e.
|
|
3266
|
+
setSignal(e.ft, false);
|
|
3267
|
+
setSignal(e.ut, false);
|
|
3221
3268
|
e.evaluate(false, false);
|
|
3222
3269
|
} else {
|
|
3223
3270
|
setSlotState(e, this, !isSlotReady(e), false);
|
|
3224
3271
|
}
|
|
3225
3272
|
});
|
|
3226
3273
|
} else if (r === "together") {
|
|
3227
|
-
const e = this.
|
|
3228
|
-
this.
|
|
3274
|
+
const e = this._t(isSlotMinimallyReady);
|
|
3275
|
+
this._t(t => setSlotState(t, this, !e, false));
|
|
3229
3276
|
} else {
|
|
3230
3277
|
let e = false;
|
|
3231
|
-
this.
|
|
3278
|
+
this._t(t => {
|
|
3232
3279
|
if (e) return setSlotState(t, this, true, i);
|
|
3233
3280
|
if (isSlotReady(t)) return setSlotState(t, this, false, false);
|
|
3234
3281
|
e = true;
|
|
3235
3282
|
if (isRevealController(t)) {
|
|
3236
|
-
setSignal(t.
|
|
3237
|
-
setSignal(t.
|
|
3283
|
+
setSignal(t.ft, false);
|
|
3284
|
+
setSignal(t.ut, false);
|
|
3238
3285
|
t.evaluate(false, false);
|
|
3239
3286
|
} else {
|
|
3240
3287
|
setSlotState(t, this, true, false);
|
|
@@ -3242,92 +3289,92 @@ class RevealController {
|
|
|
3242
3289
|
});
|
|
3243
3290
|
}
|
|
3244
3291
|
} finally {
|
|
3245
|
-
this.
|
|
3246
|
-
this.
|
|
3247
|
-
this.
|
|
3292
|
+
this.St = this.isReady();
|
|
3293
|
+
this.wt = this.isMinimallyReady();
|
|
3294
|
+
this.bt = false;
|
|
3248
3295
|
}
|
|
3249
|
-
if (this.
|
|
3296
|
+
if (this.lt && (n !== this.St || r !== this.wt)) this.lt.evaluate();
|
|
3250
3297
|
}
|
|
3251
3298
|
}
|
|
3252
3299
|
class CollectionQueue extends Queue {
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3300
|
+
Ot;
|
|
3301
|
+
st = new Set();
|
|
3302
|
+
vt;
|
|
3303
|
+
ot = true;
|
|
3304
|
+
ut = signal(false, { ownedWrite: true, Qe: true });
|
|
3305
|
+
ft = signal(false, { ownedWrite: true, Qe: true });
|
|
3306
|
+
ct;
|
|
3307
|
+
dt = false;
|
|
3308
|
+
xt;
|
|
3309
|
+
Pt = Oe;
|
|
3263
3310
|
constructor(e) {
|
|
3264
3311
|
super();
|
|
3265
|
-
this.
|
|
3312
|
+
this.Ot = e;
|
|
3266
3313
|
}
|
|
3267
3314
|
run(e) {
|
|
3268
|
-
if (!e || (read(this.
|
|
3315
|
+
if (!e || (read(this.ut) && (!xe || read(this.ft)))) return;
|
|
3269
3316
|
return super.run(e);
|
|
3270
3317
|
}
|
|
3271
3318
|
notify(e, t, n, r) {
|
|
3272
|
-
if (!(t & this.
|
|
3273
|
-
if (this.
|
|
3319
|
+
if (!(t & this.Ot)) return super.notify(e, t, n, r);
|
|
3320
|
+
if (this.dt && this.xt) {
|
|
3274
3321
|
const e = untrack(() => {
|
|
3275
3322
|
try {
|
|
3276
|
-
return this.
|
|
3323
|
+
return this.xt();
|
|
3277
3324
|
} catch {
|
|
3278
|
-
return
|
|
3325
|
+
return Oe;
|
|
3279
3326
|
}
|
|
3280
3327
|
});
|
|
3281
|
-
if (e !== this.
|
|
3282
|
-
this.
|
|
3283
|
-
this.
|
|
3284
|
-
this.
|
|
3328
|
+
if (e !== this.Pt) {
|
|
3329
|
+
this.Pt = e;
|
|
3330
|
+
this.dt = false;
|
|
3331
|
+
this.st.clear();
|
|
3285
3332
|
}
|
|
3286
3333
|
}
|
|
3287
|
-
if (this.
|
|
3288
|
-
if (this.
|
|
3289
|
-
return super.notify(e,
|
|
3334
|
+
if (this.Ot & S && this.dt) return super.notify(e, t, n, r);
|
|
3335
|
+
if (this.Ot & S && n & w) {
|
|
3336
|
+
return super.notify(e, w, n, r);
|
|
3290
3337
|
}
|
|
3291
|
-
if (n & this.
|
|
3292
|
-
this.
|
|
3293
|
-
const t = r?.source || e.
|
|
3338
|
+
if (n & this.Ot) {
|
|
3339
|
+
this.ot = true;
|
|
3340
|
+
const t = r?.source || e.he?.source;
|
|
3294
3341
|
if (t) {
|
|
3295
|
-
const e = this.
|
|
3296
|
-
this.
|
|
3297
|
-
if (e) setSignal(this.
|
|
3342
|
+
const e = this.st.size === 0;
|
|
3343
|
+
this.st.add(t);
|
|
3344
|
+
if (e) setSignal(this.ut, true);
|
|
3298
3345
|
}
|
|
3299
3346
|
}
|
|
3300
|
-
t &= ~this.
|
|
3347
|
+
t &= ~this.Ot;
|
|
3301
3348
|
return t ? super.notify(e, t, n, r) : true;
|
|
3302
3349
|
}
|
|
3303
3350
|
checkSources() {
|
|
3304
|
-
for (const e of this.
|
|
3305
|
-
if (e.m & u || (!(e.ge & this.
|
|
3351
|
+
for (const e of this.st) {
|
|
3352
|
+
if (e.m & u || (!(e.ge & this.Ot) && !(this.Ot & w && e.ge & S))) this.st.delete(e);
|
|
3306
3353
|
}
|
|
3307
|
-
if (!this.
|
|
3308
|
-
if (this.
|
|
3309
|
-
this.
|
|
3354
|
+
if (!this.st.size) {
|
|
3355
|
+
if (this.Ot & S && this.ot && !this.dt && this.vt) {
|
|
3356
|
+
this.ot = !!(this.vt.ge & this.Ot);
|
|
3310
3357
|
} else {
|
|
3311
|
-
this.
|
|
3358
|
+
this.ot = false;
|
|
3312
3359
|
}
|
|
3313
|
-
if (!this.
|
|
3314
|
-
setSignal(this.
|
|
3315
|
-
if (this.
|
|
3360
|
+
if (!this.ot) {
|
|
3361
|
+
setSignal(this.ut, false);
|
|
3362
|
+
if (this.xt) {
|
|
3316
3363
|
try {
|
|
3317
|
-
this.
|
|
3364
|
+
this.Pt = untrack(() => this.xt());
|
|
3318
3365
|
} catch {}
|
|
3319
3366
|
}
|
|
3320
3367
|
}
|
|
3321
3368
|
}
|
|
3322
|
-
if (
|
|
3369
|
+
if (xe) this.ct?.evaluate();
|
|
3323
3370
|
}
|
|
3324
3371
|
}
|
|
3325
3372
|
function createCollectionBoundary(e, t, n, r) {
|
|
3326
3373
|
const i = createOwner();
|
|
3327
|
-
if (
|
|
3374
|
+
if (xe) setContext(ve, null, i);
|
|
3328
3375
|
const s = new CollectionQueue(e);
|
|
3329
|
-
if (r) s.
|
|
3330
|
-
const o = (s.
|
|
3376
|
+
if (r) s.xt = r;
|
|
3377
|
+
const o = (s.vt = createBoundChildren(i, t, s, e));
|
|
3331
3378
|
untrack(() => {
|
|
3332
3379
|
let t = false;
|
|
3333
3380
|
try {
|
|
@@ -3336,45 +3383,46 @@ function createCollectionBoundary(e, t, n, r) {
|
|
|
3336
3383
|
if (e instanceof NotReadyError) t = true;
|
|
3337
3384
|
else throw e;
|
|
3338
3385
|
}
|
|
3339
|
-
s.
|
|
3386
|
+
s.ot = t || !!(o.ge & e) || o.he instanceof NotReadyError;
|
|
3340
3387
|
});
|
|
3341
|
-
const u =
|
|
3388
|
+
const u = xe && e === S ? getContext(ve) : null;
|
|
3342
3389
|
if (u) {
|
|
3343
|
-
s.
|
|
3390
|
+
s.ct = u;
|
|
3344
3391
|
u.register(s);
|
|
3345
3392
|
cleanup(() => u.unregister(s));
|
|
3346
3393
|
}
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3394
|
+
return accessor(
|
|
3395
|
+
computed(() => {
|
|
3396
|
+
if (!read(s.ut)) {
|
|
3397
|
+
const e = read(o);
|
|
3398
|
+
if (!untrack(() => read(s.ut))) return ((s.dt = true), e);
|
|
3399
|
+
}
|
|
3400
|
+
if (xe && read(s.ft)) return undefined;
|
|
3401
|
+
return n(s);
|
|
3402
|
+
})
|
|
3403
|
+
);
|
|
3356
3404
|
}
|
|
3357
3405
|
function createLoadingBoundary(e, t, n) {
|
|
3358
|
-
return createCollectionBoundary(
|
|
3406
|
+
return createCollectionBoundary(S, e, () => t(), n?.on);
|
|
3359
3407
|
}
|
|
3360
3408
|
function createErrorBoundary(e, t) {
|
|
3361
|
-
return createCollectionBoundary(
|
|
3362
|
-
let n = e.
|
|
3363
|
-
const r = n.
|
|
3409
|
+
return createCollectionBoundary(w, e, e => {
|
|
3410
|
+
let n = e.st.values().next().value;
|
|
3411
|
+
const r = n.he?.cause ?? n.he;
|
|
3364
3412
|
return t(r, () => {
|
|
3365
|
-
for (const t of e.
|
|
3413
|
+
for (const t of e.st) recompute(t);
|
|
3366
3414
|
schedule();
|
|
3367
3415
|
});
|
|
3368
3416
|
});
|
|
3369
3417
|
}
|
|
3370
3418
|
function createRevealOrder(e, t) {
|
|
3371
|
-
|
|
3419
|
+
xe = true;
|
|
3372
3420
|
const n = createOwner();
|
|
3373
|
-
const r = getContext(
|
|
3421
|
+
const r = getContext(ve);
|
|
3374
3422
|
const i = t?.order || SEQUENTIAL_ACCESSOR,
|
|
3375
3423
|
s = t?.collapsed || FALSE_ACCESSOR;
|
|
3376
3424
|
const o = new RevealController(i, s);
|
|
3377
|
-
setContext(
|
|
3425
|
+
setContext(ve, o, n);
|
|
3378
3426
|
return runWithOwner(n, () => {
|
|
3379
3427
|
const t = e();
|
|
3380
3428
|
computed(() => {
|
|
@@ -3383,7 +3431,7 @@ function createRevealOrder(e, t) {
|
|
|
3383
3431
|
o.evaluate();
|
|
3384
3432
|
});
|
|
3385
3433
|
if (r) {
|
|
3386
|
-
o.
|
|
3434
|
+
o.lt = r;
|
|
3387
3435
|
r.register(o);
|
|
3388
3436
|
cleanup(() => r.unregister(o));
|
|
3389
3437
|
}
|
|
@@ -3439,16 +3487,16 @@ function flattenArray(e, t = [], n) {
|
|
|
3439
3487
|
if (r) throw r;
|
|
3440
3488
|
return i;
|
|
3441
3489
|
}
|
|
3442
|
-
const
|
|
3443
|
-
exports.$PROXY =
|
|
3444
|
-
exports.$REFRESH =
|
|
3445
|
-
exports.$TARGET =
|
|
3446
|
-
exports.$TRACK =
|
|
3490
|
+
const Pe = undefined;
|
|
3491
|
+
exports.$PROXY = ne;
|
|
3492
|
+
exports.$REFRESH = C;
|
|
3493
|
+
exports.$TARGET = te;
|
|
3494
|
+
exports.$TRACK = ee;
|
|
3447
3495
|
exports.ContextNotFoundError = ContextNotFoundError;
|
|
3448
|
-
exports.DEV =
|
|
3496
|
+
exports.DEV = Pe;
|
|
3449
3497
|
exports.NoOwnerError = NoOwnerError;
|
|
3450
3498
|
exports.NotReadyError = NotReadyError;
|
|
3451
|
-
exports.SUPPORTS_PROXY =
|
|
3499
|
+
exports.SUPPORTS_PROXY = k;
|
|
3452
3500
|
exports.action = action;
|
|
3453
3501
|
exports.clearSnapshots = clearSnapshots;
|
|
3454
3502
|
exports.createContext = createContext;
|
|
@@ -3498,5 +3546,5 @@ exports.runWithOwner = runWithOwner;
|
|
|
3498
3546
|
exports.setContext = setContext;
|
|
3499
3547
|
exports.setSnapshotCapture = setSnapshotCapture;
|
|
3500
3548
|
exports.snapshot = snapshot;
|
|
3501
|
-
exports.storePath =
|
|
3549
|
+
exports.storePath = we;
|
|
3502
3550
|
exports.untrack = untrack;
|