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