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