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