@solidjs/signals 0.9.11 → 0.10.1
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 +559 -618
- package/dist/node.cjs +1024 -1075
- package/dist/prod.js +961 -1012
- package/dist/types/boundaries.d.ts +0 -5
- package/dist/types/core/action.d.ts +1 -0
- package/dist/types/core/async.d.ts +5 -0
- package/dist/types/core/context.d.ts +1 -1
- package/dist/types/core/core.d.ts +25 -104
- package/dist/types/core/effect.d.ts +4 -3
- package/dist/types/core/error.d.ts +4 -4
- package/dist/types/core/graph.d.ts +3 -0
- package/dist/types/core/heap.d.ts +1 -1
- package/dist/types/core/index.d.ts +4 -2
- package/dist/types/core/lanes.d.ts +52 -0
- package/dist/types/core/owner.d.ts +22 -0
- package/dist/types/core/scheduler.d.ts +6 -59
- package/dist/types/core/types.d.ts +74 -0
- package/dist/types/index.d.ts +3 -3
- package/dist/types/signals.d.ts +73 -76
- package/dist/types/store/index.d.ts +1 -1
- package/dist/types/store/optimistic.d.ts +9 -12
- package/dist/types/store/projection.d.ts +12 -4
- package/dist/types/store/store.d.ts +26 -1
- package/package.json +2 -2
package/dist/node.cjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
class NotReadyError extends Error {
|
|
3
|
-
|
|
3
|
+
source;
|
|
4
4
|
constructor(e) {
|
|
5
5
|
super();
|
|
6
|
-
this.
|
|
6
|
+
this.source = e;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
class StatusError extends Error {
|
|
10
|
-
|
|
10
|
+
source;
|
|
11
11
|
constructor(e, t) {
|
|
12
12
|
super(t instanceof Error ? t.message : String(t), { cause: t });
|
|
13
|
-
this.
|
|
13
|
+
this.source = e;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
class NoOwnerError extends Error {
|
|
@@ -43,182 +43,114 @@ const g = typeof Proxy === "function";
|
|
|
43
43
|
const w = {};
|
|
44
44
|
const S = Symbol("refresh");
|
|
45
45
|
function actualInsertIntoHeap(e, t) {
|
|
46
|
-
const n = (e.
|
|
47
|
-
if (n >= e.
|
|
48
|
-
const r = e.
|
|
49
|
-
const i = t.
|
|
50
|
-
if (i === undefined) t.
|
|
46
|
+
const n = (e.i?.t ? e.i.u?.o : e.i?.o) ?? -1;
|
|
47
|
+
if (n >= e.o) e.o = n + 1;
|
|
48
|
+
const r = e.o;
|
|
49
|
+
const i = t.l[r];
|
|
50
|
+
if (i === undefined) t.l[r] = e;
|
|
51
51
|
else {
|
|
52
|
-
const t = i.
|
|
53
|
-
t.
|
|
54
|
-
e.
|
|
55
|
-
i.
|
|
52
|
+
const t = i.p;
|
|
53
|
+
t.h = e;
|
|
54
|
+
e.p = t;
|
|
55
|
+
i.p = e;
|
|
56
56
|
}
|
|
57
|
-
if (r > t.
|
|
57
|
+
if (r > t.S) t.S = r;
|
|
58
58
|
}
|
|
59
59
|
function insertIntoHeap(e, o) {
|
|
60
|
-
let u = e.
|
|
60
|
+
let u = e.m;
|
|
61
61
|
if (u & (i | r)) return;
|
|
62
62
|
if (u & t) {
|
|
63
|
-
e.
|
|
64
|
-
} else e.
|
|
63
|
+
e.m = (u & -4) | n | i;
|
|
64
|
+
} else e.m = u | i;
|
|
65
65
|
if (!(u & s)) actualInsertIntoHeap(e, o);
|
|
66
66
|
}
|
|
67
67
|
function insertIntoHeapHeight(e, t) {
|
|
68
|
-
let n = e.
|
|
68
|
+
let n = e.m;
|
|
69
69
|
if (n & (i | r | s)) return;
|
|
70
|
-
e.
|
|
70
|
+
e.m = n | s;
|
|
71
71
|
actualInsertIntoHeap(e, t);
|
|
72
72
|
}
|
|
73
73
|
function deleteFromHeap(e, t) {
|
|
74
|
-
const n = e.
|
|
74
|
+
const n = e.m;
|
|
75
75
|
if (!(n & (i | s))) return;
|
|
76
|
-
e.
|
|
77
|
-
const r = e.
|
|
78
|
-
if (e.
|
|
76
|
+
e.m = n & -25;
|
|
77
|
+
const r = e.o;
|
|
78
|
+
if (e.p === e) t.l[r] = undefined;
|
|
79
79
|
else {
|
|
80
|
-
const n = e.
|
|
81
|
-
const i = t.
|
|
80
|
+
const n = e.h;
|
|
81
|
+
const i = t.l[r];
|
|
82
82
|
const s = n ?? i;
|
|
83
|
-
if (e === i) t.
|
|
84
|
-
else e.h
|
|
85
|
-
s.
|
|
83
|
+
if (e === i) t.l[r] = n;
|
|
84
|
+
else e.p.h = n;
|
|
85
|
+
s.p = e.p;
|
|
86
86
|
}
|
|
87
|
-
e.
|
|
88
|
-
e.
|
|
87
|
+
e.p = e;
|
|
88
|
+
e.h = undefined;
|
|
89
89
|
}
|
|
90
90
|
function markHeap(e) {
|
|
91
|
-
if (e.
|
|
92
|
-
e.
|
|
93
|
-
for (let t = 0; t <= e.
|
|
94
|
-
for (let n = e.
|
|
95
|
-
if (n.
|
|
91
|
+
if (e._) return;
|
|
92
|
+
e._ = true;
|
|
93
|
+
for (let t = 0; t <= e.S; t++) {
|
|
94
|
+
for (let n = e.l[t]; n !== undefined; n = n.h) {
|
|
95
|
+
if (n.m & i) markNode(n);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
function markNode(e, r = n) {
|
|
100
|
-
const i = e.
|
|
100
|
+
const i = e.m;
|
|
101
101
|
if ((i & (t | n)) >= r) return;
|
|
102
|
-
e.
|
|
103
|
-
for (let n = e.
|
|
104
|
-
markNode(n.
|
|
102
|
+
e.m = (i & -4) | r;
|
|
103
|
+
for (let n = e.O; n !== null; n = n.P) {
|
|
104
|
+
markNode(n.A, t);
|
|
105
105
|
}
|
|
106
|
-
if (e.
|
|
107
|
-
for (let n = e.
|
|
108
|
-
for (let e = n.
|
|
109
|
-
markNode(e.
|
|
106
|
+
if (e.k !== null) {
|
|
107
|
+
for (let n = e.k; n !== null; n = n.C) {
|
|
108
|
+
for (let e = n.O; e !== null; e = e.P) {
|
|
109
|
+
markNode(e.A, t);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
function runHeap(e, t) {
|
|
115
|
-
e.
|
|
116
|
-
for (e.
|
|
117
|
-
let n = e.
|
|
115
|
+
e._ = false;
|
|
116
|
+
for (e.W = 0; e.W <= e.S; e.W++) {
|
|
117
|
+
let n = e.l[e.W];
|
|
118
118
|
while (n !== undefined) {
|
|
119
|
-
if (n.
|
|
119
|
+
if (n.m & i) t(n);
|
|
120
120
|
else adjustHeight(n, e);
|
|
121
|
-
n = e.
|
|
121
|
+
n = e.l[e.W];
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
e.
|
|
124
|
+
e.S = 0;
|
|
125
125
|
}
|
|
126
126
|
function adjustHeight(e, t) {
|
|
127
127
|
deleteFromHeap(e, t);
|
|
128
|
-
let n = e.
|
|
129
|
-
for (let t = e.
|
|
130
|
-
const e = t.
|
|
131
|
-
const r = e.
|
|
132
|
-
if (r.
|
|
128
|
+
let n = e.o;
|
|
129
|
+
for (let t = e.j; t; t = t.N) {
|
|
130
|
+
const e = t.L;
|
|
131
|
+
const r = e.I || e;
|
|
132
|
+
if (r.H && r.o >= n) n = r.o + 1;
|
|
133
133
|
}
|
|
134
|
-
if (e.
|
|
135
|
-
e.
|
|
136
|
-
for (let n = e.
|
|
137
|
-
insertIntoHeapHeight(n.
|
|
134
|
+
if (e.o !== n) {
|
|
135
|
+
e.o = n;
|
|
136
|
+
for (let n = e.O; n !== null; n = n.P) {
|
|
137
|
+
insertIntoHeapHeight(n.A, t);
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
const m = new Set();
|
|
142
|
-
const
|
|
143
|
-
const
|
|
142
|
+
const b = { l: new Array(2e3).fill(undefined), _: false, W: 0, S: 0 };
|
|
143
|
+
const _ = { l: new Array(2e3).fill(undefined), _: false, W: 0, S: 0 };
|
|
144
144
|
let O = 0;
|
|
145
145
|
let x = null;
|
|
146
146
|
let v = false;
|
|
147
147
|
let P = false;
|
|
148
|
-
const C = new WeakMap();
|
|
149
|
-
const k = new Set();
|
|
150
|
-
let A = null;
|
|
151
|
-
function setCurrentOptimisticLane(e) {
|
|
152
|
-
A = e;
|
|
153
|
-
}
|
|
154
|
-
function getOrCreateLane(e) {
|
|
155
|
-
let t = C.get(e);
|
|
156
|
-
if (t) {
|
|
157
|
-
return findLane(t);
|
|
158
|
-
}
|
|
159
|
-
const n = e.T;
|
|
160
|
-
const r = n?.M ? findLane(n.M) : null;
|
|
161
|
-
t = { t: e, q: new Set(), F: [[], []], V: null, B: x, D: r };
|
|
162
|
-
C.set(e, t);
|
|
163
|
-
k.add(t);
|
|
164
|
-
e.G = e.K || 0;
|
|
165
|
-
return t;
|
|
166
|
-
}
|
|
167
|
-
function findLane(e) {
|
|
168
|
-
while (e.V) e = e.V;
|
|
169
|
-
return e;
|
|
170
|
-
}
|
|
171
|
-
function mergeLanes(e, t) {
|
|
172
|
-
e = findLane(e);
|
|
173
|
-
t = findLane(t);
|
|
174
|
-
if (e === t) return e;
|
|
175
|
-
t.V = e;
|
|
176
|
-
for (const n of t.q) e.q.add(n);
|
|
177
|
-
e.F[0].push(...t.F[0]);
|
|
178
|
-
e.F[1].push(...t.F[1]);
|
|
179
|
-
return e;
|
|
180
|
-
}
|
|
181
|
-
function clearLaneEntry(e) {
|
|
182
|
-
C.delete(e);
|
|
183
|
-
}
|
|
184
|
-
function resolveLane(e) {
|
|
185
|
-
const t = e.M;
|
|
186
|
-
if (!t) return undefined;
|
|
187
|
-
const n = findLane(t);
|
|
188
|
-
if (k.has(n)) return n;
|
|
189
|
-
e.M = undefined;
|
|
190
|
-
return undefined;
|
|
191
|
-
}
|
|
192
|
-
function hasActiveOverride(e) {
|
|
193
|
-
return !!(e.U && e.J !== y);
|
|
194
|
-
}
|
|
195
|
-
function assignOrMergeLane(e, t) {
|
|
196
|
-
const n = findLane(t);
|
|
197
|
-
const r = e.M;
|
|
198
|
-
if (r) {
|
|
199
|
-
if (r.V) {
|
|
200
|
-
e.M = t;
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
const i = findLane(r);
|
|
204
|
-
if (k.has(i)) {
|
|
205
|
-
if (i !== n && !hasActiveOverride(e)) {
|
|
206
|
-
if (n.D && findLane(n.D) === i) {
|
|
207
|
-
e.M = t;
|
|
208
|
-
} else if (i.D && findLane(i.D) === n);
|
|
209
|
-
else mergeLanes(n, i);
|
|
210
|
-
}
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
e.M = t;
|
|
215
|
-
}
|
|
216
148
|
function runLaneEffects(e) {
|
|
217
|
-
for (const t of
|
|
218
|
-
if (t.
|
|
219
|
-
const n = t.
|
|
149
|
+
for (const t of C) {
|
|
150
|
+
if (t.R || t.T.size > 0) continue;
|
|
151
|
+
const n = t.M[e - 1];
|
|
220
152
|
if (n.length) {
|
|
221
|
-
t.
|
|
153
|
+
t.M[e - 1] = [];
|
|
222
154
|
runQueue(n, e);
|
|
223
155
|
}
|
|
224
156
|
}
|
|
@@ -229,129 +161,129 @@ function setProjectionWriteActive(e) {
|
|
|
229
161
|
function schedule() {
|
|
230
162
|
if (v) return;
|
|
231
163
|
v = true;
|
|
232
|
-
if (!
|
|
164
|
+
if (!A.q) queueMicrotask(flush);
|
|
233
165
|
}
|
|
234
166
|
class Queue {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
167
|
+
i = null;
|
|
168
|
+
F = [[], []];
|
|
169
|
+
V = [];
|
|
238
170
|
created = O;
|
|
239
171
|
addChild(e) {
|
|
240
|
-
this.
|
|
241
|
-
e.
|
|
172
|
+
this.V.push(e);
|
|
173
|
+
e.i = this;
|
|
242
174
|
}
|
|
243
175
|
removeChild(e) {
|
|
244
|
-
const t = this.
|
|
176
|
+
const t = this.V.indexOf(e);
|
|
245
177
|
if (t >= 0) {
|
|
246
|
-
this.
|
|
247
|
-
e.
|
|
178
|
+
this.V.splice(t, 1);
|
|
179
|
+
e.i = null;
|
|
248
180
|
}
|
|
249
181
|
}
|
|
250
182
|
notify(e, t, n, r) {
|
|
251
|
-
if (this.
|
|
183
|
+
if (this.i) return this.i.notify(e, t, n, r);
|
|
252
184
|
return false;
|
|
253
185
|
}
|
|
254
186
|
run(e) {
|
|
255
|
-
if (this.
|
|
256
|
-
const t = this.
|
|
257
|
-
this.
|
|
187
|
+
if (this.F[e - 1].length) {
|
|
188
|
+
const t = this.F[e - 1];
|
|
189
|
+
this.F[e - 1] = [];
|
|
258
190
|
runQueue(t, e);
|
|
259
191
|
}
|
|
260
|
-
for (let t = 0; t < this.
|
|
192
|
+
for (let t = 0; t < this.V.length; t++) this.V[t].run?.(e);
|
|
261
193
|
}
|
|
262
194
|
enqueue(e, t) {
|
|
263
195
|
if (e) {
|
|
264
|
-
if (
|
|
265
|
-
const n = findLane(
|
|
266
|
-
n.
|
|
196
|
+
if (R) {
|
|
197
|
+
const n = findLane(R);
|
|
198
|
+
n.M[e - 1].push(t);
|
|
267
199
|
} else {
|
|
268
|
-
this.
|
|
200
|
+
this.F[e - 1].push(t);
|
|
269
201
|
}
|
|
270
202
|
}
|
|
271
203
|
schedule();
|
|
272
204
|
}
|
|
273
205
|
stashQueues(e) {
|
|
274
|
-
e.
|
|
275
|
-
e.
|
|
276
|
-
this.
|
|
277
|
-
for (let t = 0; t < this.
|
|
278
|
-
let n = this.
|
|
279
|
-
let r = e.
|
|
206
|
+
e.F[0].push(...this.F[0]);
|
|
207
|
+
e.F[1].push(...this.F[1]);
|
|
208
|
+
this.F = [[], []];
|
|
209
|
+
for (let t = 0; t < this.V.length; t++) {
|
|
210
|
+
let n = this.V[t];
|
|
211
|
+
let r = e.V[t];
|
|
280
212
|
if (!r) {
|
|
281
|
-
r = {
|
|
282
|
-
e.
|
|
213
|
+
r = { F: [[], []], V: [] };
|
|
214
|
+
e.V[t] = r;
|
|
283
215
|
}
|
|
284
216
|
n.stashQueues(r);
|
|
285
217
|
}
|
|
286
218
|
}
|
|
287
219
|
restoreQueues(e) {
|
|
288
|
-
this.
|
|
289
|
-
this.
|
|
290
|
-
for (let t = 0; t < e.
|
|
291
|
-
const n = e.
|
|
292
|
-
let r = this.
|
|
220
|
+
this.F[0].push(...e.F[0]);
|
|
221
|
+
this.F[1].push(...e.F[1]);
|
|
222
|
+
for (let t = 0; t < e.V.length; t++) {
|
|
223
|
+
const n = e.V[t];
|
|
224
|
+
let r = this.V[t];
|
|
293
225
|
if (r) r.restoreQueues(n);
|
|
294
226
|
}
|
|
295
227
|
}
|
|
296
228
|
}
|
|
297
229
|
class GlobalQueue extends Queue {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
static
|
|
303
|
-
static
|
|
304
|
-
static
|
|
230
|
+
q = false;
|
|
231
|
+
D = [];
|
|
232
|
+
B = [];
|
|
233
|
+
G = new Set();
|
|
234
|
+
static K;
|
|
235
|
+
static U;
|
|
236
|
+
static J = null;
|
|
305
237
|
flush() {
|
|
306
|
-
if (this.
|
|
307
|
-
this.
|
|
238
|
+
if (this.q) return;
|
|
239
|
+
this.q = true;
|
|
308
240
|
try {
|
|
309
|
-
runHeap(
|
|
241
|
+
runHeap(b, GlobalQueue.K);
|
|
310
242
|
if (x) {
|
|
311
243
|
const e = transitionComplete(x);
|
|
312
244
|
if (!e) {
|
|
313
245
|
let e = x;
|
|
314
|
-
runHeap(
|
|
315
|
-
this
|
|
316
|
-
this.
|
|
317
|
-
this.
|
|
246
|
+
runHeap(_, GlobalQueue.K);
|
|
247
|
+
this.D = [];
|
|
248
|
+
this.B = [];
|
|
249
|
+
this.G = new Set();
|
|
318
250
|
runLaneEffects(d);
|
|
319
251
|
runLaneEffects(p);
|
|
320
|
-
this.stashQueues(x.
|
|
252
|
+
this.stashQueues(x.X);
|
|
321
253
|
O++;
|
|
322
|
-
v =
|
|
323
|
-
reassignPendingTransition(x
|
|
254
|
+
v = b.S >= b.W;
|
|
255
|
+
reassignPendingTransition(x.D);
|
|
324
256
|
x = null;
|
|
325
257
|
finalizePureQueue(null, true);
|
|
326
258
|
return;
|
|
327
259
|
}
|
|
328
|
-
this
|
|
329
|
-
this.restoreQueues(x.
|
|
260
|
+
this.D !== x.D && this.D.push(...x.D);
|
|
261
|
+
this.restoreQueues(x.X);
|
|
330
262
|
m.delete(x);
|
|
331
263
|
const t = x;
|
|
332
264
|
x = null;
|
|
333
|
-
reassignPendingTransition(this
|
|
265
|
+
reassignPendingTransition(this.D);
|
|
334
266
|
finalizePureQueue(t);
|
|
335
267
|
} else {
|
|
336
|
-
if (m.size) runHeap(
|
|
268
|
+
if (m.size) runHeap(_, GlobalQueue.K);
|
|
337
269
|
finalizePureQueue();
|
|
338
270
|
}
|
|
339
271
|
O++;
|
|
340
|
-
v =
|
|
272
|
+
v = b.S >= b.W;
|
|
341
273
|
runLaneEffects(d);
|
|
342
274
|
this.run(d);
|
|
343
275
|
runLaneEffects(p);
|
|
344
276
|
this.run(p);
|
|
345
277
|
} finally {
|
|
346
|
-
this.
|
|
278
|
+
this.q = false;
|
|
347
279
|
}
|
|
348
280
|
}
|
|
349
281
|
notify(e, t, n, r) {
|
|
350
282
|
if (t & l) {
|
|
351
283
|
if (n & l) {
|
|
352
|
-
const t = r !== undefined ? r : e.
|
|
353
|
-
if (x && t && !x.
|
|
354
|
-
x.
|
|
284
|
+
const t = r !== undefined ? r : e.Y;
|
|
285
|
+
if (x && t && !x.Z.includes(t.source)) {
|
|
286
|
+
x.Z.push(t.source);
|
|
355
287
|
schedule();
|
|
356
288
|
}
|
|
357
289
|
}
|
|
@@ -362,172 +294,175 @@ class GlobalQueue extends Queue {
|
|
|
362
294
|
initTransition(e) {
|
|
363
295
|
if (e) e = currentTransition(e);
|
|
364
296
|
if (e && e === x) return;
|
|
365
|
-
if (!e && x && x
|
|
297
|
+
if (!e && x && x.$ === O) return;
|
|
366
298
|
if (!x) {
|
|
367
299
|
x = e ?? {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
300
|
+
$: O,
|
|
301
|
+
D: [],
|
|
302
|
+
Z: [],
|
|
303
|
+
B: [],
|
|
304
|
+
G: new Set(),
|
|
371
305
|
ee: [],
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
se: { Y: [[], []], Z: [] },
|
|
375
|
-
ce: false
|
|
306
|
+
X: { F: [[], []], V: [] },
|
|
307
|
+
te: false
|
|
376
308
|
};
|
|
377
309
|
} else if (e) {
|
|
378
310
|
const t = x;
|
|
379
|
-
t.
|
|
380
|
-
e.le.push(...t.le);
|
|
381
|
-
for (const n of k) {
|
|
382
|
-
if (n.B === t) n.B = e;
|
|
383
|
-
}
|
|
311
|
+
t.te = e;
|
|
384
312
|
e.ee.push(...t.ee);
|
|
385
|
-
for (const n of
|
|
386
|
-
|
|
313
|
+
for (const n of C) {
|
|
314
|
+
if (n.ne === t) n.ne = e;
|
|
315
|
+
}
|
|
316
|
+
e.B.push(...t.B);
|
|
317
|
+
for (const n of t.G) {
|
|
318
|
+
e.G.add(n);
|
|
387
319
|
}
|
|
388
320
|
m.delete(t);
|
|
389
321
|
x = e;
|
|
390
322
|
}
|
|
391
323
|
m.add(x);
|
|
392
|
-
x
|
|
393
|
-
for (let e = 0; e < this
|
|
394
|
-
const t = this
|
|
395
|
-
t.
|
|
396
|
-
x
|
|
324
|
+
x.$ = O;
|
|
325
|
+
for (let e = 0; e < this.D.length; e++) {
|
|
326
|
+
const t = this.D[e];
|
|
327
|
+
t.ne = x;
|
|
328
|
+
x.D.push(t);
|
|
397
329
|
}
|
|
398
|
-
this
|
|
399
|
-
for (let e = 0; e < this.
|
|
400
|
-
const t = this.
|
|
401
|
-
t.
|
|
402
|
-
x.
|
|
330
|
+
this.D = x.D;
|
|
331
|
+
for (let e = 0; e < this.B.length; e++) {
|
|
332
|
+
const t = this.B[e];
|
|
333
|
+
t.ne = x;
|
|
334
|
+
x.B.push(t);
|
|
403
335
|
}
|
|
404
|
-
this.
|
|
405
|
-
for (const e of
|
|
406
|
-
if (!e.
|
|
336
|
+
this.B = x.B;
|
|
337
|
+
for (const e of C) {
|
|
338
|
+
if (!e.ne) e.ne = x;
|
|
407
339
|
}
|
|
408
|
-
for (const e of this.
|
|
409
|
-
this.
|
|
340
|
+
for (const e of this.G) x.G.add(e);
|
|
341
|
+
this.G = x.G;
|
|
410
342
|
}
|
|
411
343
|
}
|
|
412
344
|
function insertSubs(e, t = false) {
|
|
413
|
-
const n = e.
|
|
414
|
-
for (let r = e.
|
|
345
|
+
const n = e.re || R;
|
|
346
|
+
for (let r = e.O; r !== null; r = r.P) {
|
|
415
347
|
if (t && n) {
|
|
416
|
-
r.
|
|
417
|
-
assignOrMergeLane(r.
|
|
348
|
+
r.A.m |= f;
|
|
349
|
+
assignOrMergeLane(r.A, n);
|
|
418
350
|
} else if (t) {
|
|
419
|
-
r.
|
|
420
|
-
r.
|
|
351
|
+
r.A.m |= f;
|
|
352
|
+
r.A.re = undefined;
|
|
421
353
|
}
|
|
422
|
-
const e = r.
|
|
423
|
-
if (e.
|
|
424
|
-
if (!e.
|
|
425
|
-
e.
|
|
426
|
-
e.
|
|
354
|
+
const e = r.A;
|
|
355
|
+
if (e.ie === h) {
|
|
356
|
+
if (!e.se) {
|
|
357
|
+
e.se = true;
|
|
358
|
+
e.oe.enqueue(p, e.ue);
|
|
427
359
|
}
|
|
428
360
|
continue;
|
|
429
361
|
}
|
|
430
|
-
const i = r.
|
|
431
|
-
if (i.
|
|
432
|
-
insertIntoHeap(r.
|
|
362
|
+
const i = r.A.m & o ? _ : b;
|
|
363
|
+
if (i.W > r.A.o) i.W = r.A.o;
|
|
364
|
+
insertIntoHeap(r.A, i);
|
|
433
365
|
}
|
|
434
366
|
}
|
|
435
367
|
function finalizePureQueue(e = null, t = false) {
|
|
436
368
|
let n = !t;
|
|
437
|
-
if (!t) checkBoundaryChildren(
|
|
438
|
-
if (
|
|
369
|
+
if (!t) checkBoundaryChildren(A);
|
|
370
|
+
if (b.S >= b.W) runHeap(b, GlobalQueue.K);
|
|
439
371
|
if (n) {
|
|
440
|
-
const t =
|
|
372
|
+
const t = A.D;
|
|
441
373
|
for (let e = 0; e < t.length; e++) {
|
|
442
374
|
const n = t[e];
|
|
443
|
-
if (n.
|
|
444
|
-
n.
|
|
445
|
-
n.
|
|
446
|
-
if (n.
|
|
375
|
+
if (n.fe !== y) {
|
|
376
|
+
n.le = n.fe;
|
|
377
|
+
n.fe = y;
|
|
378
|
+
if (n.ie && n.ie !== h) n.se = true;
|
|
447
379
|
}
|
|
448
|
-
n.
|
|
449
|
-
if (n.
|
|
380
|
+
n.ce &= ~a;
|
|
381
|
+
if (n.H) GlobalQueue.U(n, false, true);
|
|
450
382
|
}
|
|
451
383
|
t.length = 0;
|
|
452
|
-
const n = e ? e.
|
|
384
|
+
const n = e ? e.B : A.B;
|
|
453
385
|
for (let e = 0; e < n.length; e++) {
|
|
454
386
|
const t = n[e];
|
|
455
|
-
const r = t.
|
|
456
|
-
t.
|
|
457
|
-
if (r !== y && t.
|
|
458
|
-
t.
|
|
387
|
+
const r = t.fe;
|
|
388
|
+
t.re = undefined;
|
|
389
|
+
if (r !== y && t.le !== r) {
|
|
390
|
+
t.le = r;
|
|
459
391
|
insertSubs(t, true);
|
|
460
392
|
}
|
|
461
|
-
t.
|
|
462
|
-
t.
|
|
393
|
+
t.fe = y;
|
|
394
|
+
t.ne = null;
|
|
463
395
|
}
|
|
464
396
|
n.length = 0;
|
|
465
|
-
const r = e ? e.
|
|
466
|
-
if (GlobalQueue.
|
|
397
|
+
const r = e ? e.G : A.G;
|
|
398
|
+
if (GlobalQueue.J && r.size) {
|
|
467
399
|
for (const e of r) {
|
|
468
|
-
GlobalQueue.
|
|
400
|
+
GlobalQueue.J(e);
|
|
469
401
|
}
|
|
470
402
|
r.clear();
|
|
471
403
|
schedule();
|
|
472
404
|
}
|
|
473
|
-
for (const t of
|
|
474
|
-
const n = e ? t.
|
|
405
|
+
for (const t of C) {
|
|
406
|
+
const n = e ? t.ne === e : !t.ne;
|
|
475
407
|
if (!n) continue;
|
|
476
|
-
if (!t.
|
|
477
|
-
if (t.
|
|
478
|
-
if (t.
|
|
408
|
+
if (!t.R) {
|
|
409
|
+
if (t.M[0].length) runQueue(t.M[0], d);
|
|
410
|
+
if (t.M[1].length) runQueue(t.M[1], p);
|
|
479
411
|
}
|
|
480
|
-
if (t.
|
|
481
|
-
t.
|
|
482
|
-
t.
|
|
483
|
-
t.
|
|
484
|
-
|
|
485
|
-
|
|
412
|
+
if (t.ae.re === t) t.ae.re = undefined;
|
|
413
|
+
t.T.clear();
|
|
414
|
+
t.M[0].length = 0;
|
|
415
|
+
t.M[1].length = 0;
|
|
416
|
+
C.delete(t);
|
|
417
|
+
k.delete(t.ae);
|
|
486
418
|
}
|
|
487
419
|
}
|
|
488
420
|
}
|
|
489
421
|
function checkBoundaryChildren(e) {
|
|
490
|
-
for (const t of e.
|
|
422
|
+
for (const t of e.V) {
|
|
491
423
|
t.checkSources?.();
|
|
492
424
|
checkBoundaryChildren(t);
|
|
493
425
|
}
|
|
494
426
|
}
|
|
495
427
|
function trackOptimisticStore(e) {
|
|
496
|
-
|
|
428
|
+
A.G.add(e);
|
|
497
429
|
schedule();
|
|
498
430
|
}
|
|
499
431
|
function reassignPendingTransition(e) {
|
|
500
432
|
for (let t = 0; t < e.length; t++) {
|
|
501
|
-
e[t].
|
|
433
|
+
e[t].ne = x;
|
|
502
434
|
}
|
|
503
435
|
}
|
|
504
|
-
const
|
|
436
|
+
const A = new GlobalQueue();
|
|
505
437
|
function flush() {
|
|
506
438
|
while (v) {
|
|
507
|
-
|
|
439
|
+
A.flush();
|
|
508
440
|
}
|
|
509
441
|
}
|
|
510
442
|
function runQueue(e, t) {
|
|
511
443
|
for (let n = 0; n < e.length; n++) e[n](t);
|
|
512
444
|
}
|
|
513
445
|
function transitionComplete(e) {
|
|
514
|
-
if (e.
|
|
515
|
-
if (e.
|
|
446
|
+
if (e.te) return true;
|
|
447
|
+
if (e.ee.length) return false;
|
|
516
448
|
let t = true;
|
|
517
|
-
for (let n = 0; n < e.
|
|
518
|
-
const r = e.
|
|
519
|
-
if (r.
|
|
449
|
+
for (let n = 0; n < e.Z.length; n++) {
|
|
450
|
+
const r = e.Z[n];
|
|
451
|
+
if (r.ce & l && r.Y?.source === r) {
|
|
520
452
|
t = false;
|
|
521
453
|
break;
|
|
522
454
|
}
|
|
523
455
|
}
|
|
524
|
-
t && (e.
|
|
456
|
+
t && (e.te = true);
|
|
525
457
|
return t;
|
|
526
458
|
}
|
|
527
459
|
function currentTransition(e) {
|
|
528
|
-
while (e.
|
|
460
|
+
while (e.te && typeof e.te === "object") e = e.te;
|
|
529
461
|
return e;
|
|
530
462
|
}
|
|
463
|
+
function setActiveTransition(e) {
|
|
464
|
+
x = e;
|
|
465
|
+
}
|
|
531
466
|
function runInTransition(e, t) {
|
|
532
467
|
const n = x;
|
|
533
468
|
try {
|
|
@@ -537,195 +472,107 @@ function runInTransition(e, t) {
|
|
|
537
472
|
x = n;
|
|
538
473
|
}
|
|
539
474
|
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
475
|
+
const k = new WeakMap();
|
|
476
|
+
const C = new Set();
|
|
477
|
+
function getOrCreateLane(e) {
|
|
478
|
+
let t = k.get(e);
|
|
479
|
+
if (t) {
|
|
480
|
+
return findLane(t);
|
|
481
|
+
}
|
|
482
|
+
const n = e.de;
|
|
483
|
+
const r = n?.re ? findLane(n.re) : null;
|
|
484
|
+
t = { ae: e, T: new Set(), M: [[], []], R: null, ne: x, pe: r };
|
|
485
|
+
k.set(e, t);
|
|
486
|
+
C.add(t);
|
|
487
|
+
e.he = e.ye || 0;
|
|
488
|
+
return t;
|
|
545
489
|
}
|
|
546
|
-
function
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
const i = e(...t);
|
|
550
|
-
E.initTransition();
|
|
551
|
-
let s = x;
|
|
552
|
-
s.le.push(i);
|
|
553
|
-
const done = (e, t) => {
|
|
554
|
-
s = currentTransition(s);
|
|
555
|
-
const o = s.le.indexOf(i);
|
|
556
|
-
if (o >= 0) s.le.splice(o, 1);
|
|
557
|
-
x = s;
|
|
558
|
-
schedule();
|
|
559
|
-
t ? r(t) : n(e);
|
|
560
|
-
};
|
|
561
|
-
const step = (e, t) => {
|
|
562
|
-
let n;
|
|
563
|
-
try {
|
|
564
|
-
n = t ? i.throw(e) : i.next(e);
|
|
565
|
-
} catch (e) {
|
|
566
|
-
return done(undefined, e);
|
|
567
|
-
}
|
|
568
|
-
if (n instanceof Promise)
|
|
569
|
-
return void n.then(run, e => restoreTransition(s, () => step(e, true)));
|
|
570
|
-
run(n);
|
|
571
|
-
};
|
|
572
|
-
const run = e => {
|
|
573
|
-
if (e.done) return done(e.value);
|
|
574
|
-
if (e.value instanceof Promise)
|
|
575
|
-
return void e.value.then(
|
|
576
|
-
e => restoreTransition(s, () => step(e)),
|
|
577
|
-
e => restoreTransition(s, () => step(e, true))
|
|
578
|
-
);
|
|
579
|
-
restoreTransition(s, () => step(e.value));
|
|
580
|
-
};
|
|
581
|
-
step();
|
|
582
|
-
});
|
|
490
|
+
function findLane(e) {
|
|
491
|
+
while (e.R) e = e.R;
|
|
492
|
+
return e;
|
|
583
493
|
}
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
const
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
t.be = null;
|
|
613
|
-
t._ = r;
|
|
614
|
-
t.fe = O;
|
|
615
|
-
let p = t.J === y ? t.ye : t.J;
|
|
616
|
-
let g = t.u;
|
|
617
|
-
let w = W;
|
|
618
|
-
let S = A;
|
|
619
|
-
W = true;
|
|
620
|
-
if (s) {
|
|
621
|
-
const e = resolveLane(t);
|
|
622
|
-
if (e) setCurrentOptimisticLane(e);
|
|
623
|
-
}
|
|
624
|
-
try {
|
|
625
|
-
p = handleAsync(t, t.R(p));
|
|
626
|
-
clearStatus(t);
|
|
627
|
-
const e = resolveLane(t);
|
|
628
|
-
if (e) {
|
|
629
|
-
e.q.delete(t);
|
|
630
|
-
updatePendingSignal(e.t);
|
|
631
|
-
}
|
|
632
|
-
} catch (e) {
|
|
633
|
-
if (e instanceof NotReadyError && A) {
|
|
634
|
-
const e = findLane(A);
|
|
635
|
-
if (e.t !== t) {
|
|
636
|
-
e.q.add(t);
|
|
637
|
-
t.M = e;
|
|
638
|
-
updatePendingSignal(e.t);
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
notifyStatus(
|
|
642
|
-
t,
|
|
643
|
-
e instanceof NotReadyError ? l : c,
|
|
644
|
-
e,
|
|
645
|
-
undefined,
|
|
646
|
-
e instanceof NotReadyError ? t.M : undefined
|
|
647
|
-
);
|
|
648
|
-
} finally {
|
|
649
|
-
W = w;
|
|
650
|
-
t._ = e;
|
|
651
|
-
H = d;
|
|
652
|
-
}
|
|
653
|
-
if (!t.oe) {
|
|
654
|
-
const e = t.be;
|
|
655
|
-
let r = e !== null ? e.L : t.N;
|
|
656
|
-
if (r !== null) {
|
|
657
|
-
do {
|
|
658
|
-
r = unlinkSubs(r);
|
|
659
|
-
} while (r !== null);
|
|
660
|
-
if (e !== null) e.L = null;
|
|
661
|
-
else t.N = null;
|
|
494
|
+
function mergeLanes(e, t) {
|
|
495
|
+
e = findLane(e);
|
|
496
|
+
t = findLane(t);
|
|
497
|
+
if (e === t) return e;
|
|
498
|
+
t.R = e;
|
|
499
|
+
for (const n of t.T) e.T.add(n);
|
|
500
|
+
e.M[0].push(...t.M[0]);
|
|
501
|
+
e.M[1].push(...t.M[1]);
|
|
502
|
+
return e;
|
|
503
|
+
}
|
|
504
|
+
function resolveLane(e) {
|
|
505
|
+
const t = e.re;
|
|
506
|
+
if (!t) return undefined;
|
|
507
|
+
const n = findLane(t);
|
|
508
|
+
if (C.has(n)) return n;
|
|
509
|
+
e.re = undefined;
|
|
510
|
+
return undefined;
|
|
511
|
+
}
|
|
512
|
+
function hasActiveOverride(e) {
|
|
513
|
+
return !!(e.ge && e.fe !== y);
|
|
514
|
+
}
|
|
515
|
+
function assignOrMergeLane(e, t) {
|
|
516
|
+
const n = findLane(t);
|
|
517
|
+
const r = e.re;
|
|
518
|
+
if (r) {
|
|
519
|
+
if (r.R) {
|
|
520
|
+
e.re = t;
|
|
521
|
+
return;
|
|
662
522
|
}
|
|
663
|
-
const
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
const e = t.K || 0;
|
|
671
|
-
const n = t.G || 0;
|
|
672
|
-
if (e <= n) t.ye = p;
|
|
673
|
-
}
|
|
674
|
-
if (!u || s || t.ye !== e) {
|
|
675
|
-
insertSubs(t, s || u);
|
|
676
|
-
}
|
|
677
|
-
} else if (u) {
|
|
678
|
-
t.J = p;
|
|
679
|
-
} else if (t.u != g) {
|
|
680
|
-
for (let e = t.P; e !== null; e = e.C) {
|
|
681
|
-
insertIntoHeapHeight(e.k, e.k._ & o ? b : _);
|
|
523
|
+
const i = findLane(r);
|
|
524
|
+
if (C.has(i)) {
|
|
525
|
+
if (i !== n && !hasActiveOverride(e)) {
|
|
526
|
+
if (n.pe && findLane(n.pe) === i) {
|
|
527
|
+
e.re = t;
|
|
528
|
+
} else if (i.pe && findLane(i.pe) === n);
|
|
529
|
+
else mergeLanes(n, i);
|
|
682
530
|
}
|
|
531
|
+
return;
|
|
683
532
|
}
|
|
684
533
|
}
|
|
685
|
-
|
|
686
|
-
(!n || t.ge & l) && !t.B && !(x && t.U) && E.$.push(t);
|
|
687
|
-
t.B && i && x !== t.B && runInTransition(t.B, () => recompute(t));
|
|
534
|
+
e.re = t;
|
|
688
535
|
}
|
|
689
536
|
function handleAsync(e, t, r) {
|
|
690
537
|
const i = typeof t === "object" && t !== null;
|
|
691
538
|
const s = i && untrack(() => t[Symbol.asyncIterator]);
|
|
692
539
|
const o = !s && i && untrack(() => typeof t.then === "function");
|
|
693
540
|
if (!o && !s) {
|
|
694
|
-
e.
|
|
541
|
+
e.we = null;
|
|
695
542
|
return t;
|
|
696
543
|
}
|
|
697
|
-
e.
|
|
544
|
+
e.we = t;
|
|
698
545
|
let u;
|
|
699
546
|
const handleError = n => {
|
|
700
|
-
if (e.
|
|
701
|
-
|
|
547
|
+
if (e.we !== t) return;
|
|
548
|
+
A.initTransition(e.ne);
|
|
702
549
|
notifyStatus(e, n instanceof NotReadyError ? l : c, n);
|
|
703
|
-
e
|
|
550
|
+
e.$ = O;
|
|
704
551
|
};
|
|
705
552
|
const asyncWrite = (i, s) => {
|
|
706
|
-
if (e.
|
|
707
|
-
if (e.
|
|
708
|
-
|
|
553
|
+
if (e.we !== t) return;
|
|
554
|
+
if (e.m & (n | f)) return;
|
|
555
|
+
A.initTransition(e.ne);
|
|
709
556
|
clearStatus(e);
|
|
710
557
|
const o = resolveLane(e);
|
|
711
|
-
if (o) o.
|
|
558
|
+
if (o) o.T.delete(e);
|
|
712
559
|
if (r) r(i);
|
|
713
|
-
else if (e.
|
|
714
|
-
const t = e.
|
|
715
|
-
if (e.
|
|
560
|
+
else if (e.ge) {
|
|
561
|
+
const t = e.fe !== y;
|
|
562
|
+
if (e.H) e.fe = i;
|
|
716
563
|
if (!t) {
|
|
717
|
-
e.
|
|
564
|
+
e.le = i;
|
|
718
565
|
insertSubs(e);
|
|
719
566
|
}
|
|
720
|
-
e
|
|
567
|
+
e.$ = O;
|
|
721
568
|
} else if (o) {
|
|
722
|
-
const t = e.
|
|
723
|
-
const n = e.
|
|
569
|
+
const t = e.le;
|
|
570
|
+
const n = e.Se;
|
|
724
571
|
if (!n || !n(i, t)) {
|
|
725
|
-
e.
|
|
726
|
-
e
|
|
727
|
-
if (e.
|
|
728
|
-
setSignal(e.
|
|
572
|
+
e.le = i;
|
|
573
|
+
e.$ = O;
|
|
574
|
+
if (e.me) {
|
|
575
|
+
setSignal(e.me, i);
|
|
729
576
|
}
|
|
730
577
|
insertSubs(e, true);
|
|
731
578
|
}
|
|
@@ -752,8 +599,8 @@ function handleAsync(e, t, r) {
|
|
|
752
599
|
);
|
|
753
600
|
r = false;
|
|
754
601
|
if (!n) {
|
|
755
|
-
|
|
756
|
-
throw new NotReadyError(
|
|
602
|
+
A.initTransition(e.ne);
|
|
603
|
+
throw new NotReadyError(Q);
|
|
757
604
|
}
|
|
758
605
|
}
|
|
759
606
|
if (s) {
|
|
@@ -784,191 +631,196 @@ function handleAsync(e, t, r) {
|
|
|
784
631
|
};
|
|
785
632
|
const i = iterate();
|
|
786
633
|
if (!r && !i) {
|
|
787
|
-
|
|
788
|
-
throw new NotReadyError(
|
|
634
|
+
A.initTransition(e.ne);
|
|
635
|
+
throw new NotReadyError(Q);
|
|
789
636
|
}
|
|
790
637
|
}
|
|
791
638
|
return u;
|
|
792
639
|
}
|
|
793
640
|
function clearStatus(e) {
|
|
794
|
-
e.
|
|
795
|
-
e.
|
|
641
|
+
e.ce = e.ce & a;
|
|
642
|
+
e.Y = null;
|
|
796
643
|
updatePendingSignal(e);
|
|
797
|
-
e.
|
|
644
|
+
e.be?.();
|
|
798
645
|
}
|
|
799
646
|
function notifyStatus(e, t, n, r, i) {
|
|
800
647
|
if (t === c && !(n instanceof StatusError) && !(n instanceof NotReadyError))
|
|
801
648
|
n = new StatusError(e, n);
|
|
802
|
-
const s = n instanceof NotReadyError && n.
|
|
803
|
-
const o = t === l && e.
|
|
649
|
+
const s = n instanceof NotReadyError && n.source === e;
|
|
650
|
+
const o = t === l && e.ge && !s;
|
|
804
651
|
const u = o && hasActiveOverride(e);
|
|
805
652
|
if (!r) {
|
|
806
|
-
e.
|
|
807
|
-
e.
|
|
653
|
+
e.ce = t | (t !== c ? e.ce & a : 0);
|
|
654
|
+
e.Y = n;
|
|
808
655
|
updatePendingSignal(e);
|
|
809
656
|
}
|
|
810
657
|
if (i && !r) {
|
|
811
658
|
assignOrMergeLane(e, i);
|
|
812
659
|
}
|
|
813
660
|
if (u && x && n instanceof NotReadyError) {
|
|
814
|
-
const e = n.
|
|
815
|
-
if (!x.
|
|
816
|
-
x.
|
|
661
|
+
const e = n.source;
|
|
662
|
+
if (!x.Z.includes(e)) {
|
|
663
|
+
x.Z.push(e);
|
|
817
664
|
}
|
|
818
665
|
}
|
|
819
666
|
const f = r || u;
|
|
820
667
|
const d = r || o ? undefined : i;
|
|
821
|
-
if (e.
|
|
668
|
+
if (e.be) {
|
|
822
669
|
if (f) {
|
|
823
|
-
e.
|
|
670
|
+
e.be(t, n);
|
|
824
671
|
} else {
|
|
825
|
-
e.
|
|
672
|
+
e.be();
|
|
826
673
|
}
|
|
827
674
|
return;
|
|
828
675
|
}
|
|
829
|
-
for (let r = e.
|
|
830
|
-
r.
|
|
831
|
-
if (r.
|
|
832
|
-
!r.
|
|
833
|
-
notifyStatus(r.
|
|
676
|
+
for (let r = e.O; r !== null; r = r.P) {
|
|
677
|
+
r.A.$ = O;
|
|
678
|
+
if (r.A.Y !== n) {
|
|
679
|
+
!r.A.ne && A.D.push(r.A);
|
|
680
|
+
notifyStatus(r.A, t, n, f, d);
|
|
834
681
|
}
|
|
835
682
|
}
|
|
836
|
-
for (let r = e.
|
|
837
|
-
for (let e = r.
|
|
838
|
-
e.
|
|
839
|
-
if (e.
|
|
840
|
-
!e.
|
|
841
|
-
notifyStatus(e.
|
|
683
|
+
for (let r = e.k; r !== null; r = r.C) {
|
|
684
|
+
for (let e = r.O; e !== null; e = e.P) {
|
|
685
|
+
e.A.$ = O;
|
|
686
|
+
if (e.A.Y !== n) {
|
|
687
|
+
!e.A.ne && A.D.push(e.A);
|
|
688
|
+
notifyStatus(e.A, t, n, f, d);
|
|
842
689
|
}
|
|
843
690
|
}
|
|
844
691
|
}
|
|
845
692
|
}
|
|
846
|
-
function
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
693
|
+
function effect(e, t, n, r, i) {
|
|
694
|
+
let s = false;
|
|
695
|
+
const o = computed(i?.render ? t => staleValues(() => e(t)) : e, r, {
|
|
696
|
+
...i,
|
|
697
|
+
equals: () => {
|
|
698
|
+
o.se = !o.Y;
|
|
699
|
+
if (s) o.oe.enqueue(o.ie, runEffect.bind(o));
|
|
700
|
+
return false;
|
|
701
|
+
},
|
|
702
|
+
lazy: true
|
|
703
|
+
});
|
|
704
|
+
o._e = r;
|
|
705
|
+
o.Oe = t;
|
|
706
|
+
o.xe = n;
|
|
707
|
+
o.ve = undefined;
|
|
708
|
+
o.ie = i?.render ? d : p;
|
|
709
|
+
o.be = (e, t) => {
|
|
710
|
+
const n = e !== undefined ? e : o.ce;
|
|
711
|
+
const r = t !== undefined ? t : o.Y;
|
|
712
|
+
if (n & c) {
|
|
713
|
+
let e = r;
|
|
714
|
+
o.oe.notify(o, l, 0);
|
|
715
|
+
if (o.ie === p) {
|
|
716
|
+
try {
|
|
717
|
+
return o.xe
|
|
718
|
+
? o.xe(e, () => {
|
|
719
|
+
o.ve?.();
|
|
720
|
+
o.ve = undefined;
|
|
721
|
+
})
|
|
722
|
+
: console.error(e);
|
|
723
|
+
} catch (t) {
|
|
724
|
+
e = t;
|
|
725
|
+
}
|
|
856
726
|
}
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
function unlinkSubs(e) {
|
|
865
|
-
const t = e.I;
|
|
866
|
-
const n = e.L;
|
|
867
|
-
const r = e.C;
|
|
868
|
-
const i = e.Ce;
|
|
869
|
-
if (r !== null) r.Ce = i;
|
|
870
|
-
else t.ke = i;
|
|
871
|
-
if (i !== null) i.C = r;
|
|
872
|
-
else {
|
|
873
|
-
t.P = r;
|
|
874
|
-
if (r === null) {
|
|
875
|
-
t.Ae?.();
|
|
876
|
-
t.R && !t.Ee && unobserved(t);
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
return n;
|
|
880
|
-
}
|
|
881
|
-
function unobserved(e) {
|
|
882
|
-
deleteFromHeap(e, e._ & o ? b : _);
|
|
883
|
-
let t = e.N;
|
|
884
|
-
while (t !== null) {
|
|
885
|
-
t = unlinkSubs(t);
|
|
886
|
-
}
|
|
887
|
-
e.N = null;
|
|
888
|
-
disposeChildren(e, true);
|
|
889
|
-
}
|
|
890
|
-
function link(e, t) {
|
|
891
|
-
const n = t.be;
|
|
892
|
-
if (n !== null && n.I === e) return;
|
|
893
|
-
let i = null;
|
|
894
|
-
const s = t._ & r;
|
|
895
|
-
if (s) {
|
|
896
|
-
i = n !== null ? n.L : t.N;
|
|
897
|
-
if (i !== null && i.I === e) {
|
|
898
|
-
t.be = i;
|
|
899
|
-
return;
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
|
-
const o = e.ke;
|
|
903
|
-
if (o !== null && o.k === t && (!s || isValidLink(o, t))) return;
|
|
904
|
-
const u = (t.be = e.ke = { I: e, k: t, L: i, Ce: o, C: null });
|
|
905
|
-
if (n !== null) n.L = u;
|
|
906
|
-
else t.N = u;
|
|
907
|
-
if (o !== null) o.C = u;
|
|
908
|
-
else e.P = u;
|
|
727
|
+
if (!o.oe.notify(o, c, c)) throw e;
|
|
728
|
+
} else if (o.ie === d) o.oe.notify(o, l | c, n, r);
|
|
729
|
+
};
|
|
730
|
+
recompute(o, true);
|
|
731
|
+
!i?.defer && (o.ie === p ? o.oe.enqueue(o.ie, runEffect.bind(o)) : runEffect.call(o));
|
|
732
|
+
s = true;
|
|
733
|
+
onCleanup(() => o.ve?.());
|
|
909
734
|
}
|
|
910
|
-
function
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
735
|
+
function runEffect() {
|
|
736
|
+
if (!this.se || this.m & u) return;
|
|
737
|
+
this.ve?.();
|
|
738
|
+
this.ve = undefined;
|
|
739
|
+
try {
|
|
740
|
+
this.ve = this.Oe(this.le, this._e);
|
|
741
|
+
} catch (e) {
|
|
742
|
+
if (!this.oe.notify(this, c, c)) throw e;
|
|
743
|
+
} finally {
|
|
744
|
+
this._e = this.le;
|
|
745
|
+
this.se = false;
|
|
919
746
|
}
|
|
920
|
-
return false;
|
|
921
747
|
}
|
|
748
|
+
function trackedEffect(e, t) {
|
|
749
|
+
const run = () => {
|
|
750
|
+
if (!n.se || n.m & u) return;
|
|
751
|
+
n.se = false;
|
|
752
|
+
recompute(n);
|
|
753
|
+
};
|
|
754
|
+
const n = computed(
|
|
755
|
+
() => {
|
|
756
|
+
try {
|
|
757
|
+
n.ve?.();
|
|
758
|
+
n.ve = undefined;
|
|
759
|
+
n.ve = staleValues(e) || undefined;
|
|
760
|
+
} finally {
|
|
761
|
+
}
|
|
762
|
+
},
|
|
763
|
+
undefined,
|
|
764
|
+
{ ...t, lazy: true, pureWrite: true }
|
|
765
|
+
);
|
|
766
|
+
n.ve = undefined;
|
|
767
|
+
n.se = true;
|
|
768
|
+
n.ie = h;
|
|
769
|
+
n.ue = run;
|
|
770
|
+
n.oe.enqueue(p, run);
|
|
771
|
+
onCleanup(() => n.ve?.());
|
|
772
|
+
}
|
|
773
|
+
const W = {};
|
|
922
774
|
function markDisposal(e) {
|
|
923
|
-
let t = e.
|
|
775
|
+
let t = e.Pe;
|
|
924
776
|
while (t) {
|
|
925
|
-
t.
|
|
926
|
-
if (t.
|
|
927
|
-
deleteFromHeap(t,
|
|
928
|
-
insertIntoHeap(t,
|
|
777
|
+
t.m |= o;
|
|
778
|
+
if (t.m & i) {
|
|
779
|
+
deleteFromHeap(t, b);
|
|
780
|
+
insertIntoHeap(t, _);
|
|
929
781
|
}
|
|
930
782
|
markDisposal(t);
|
|
931
|
-
t = t.
|
|
783
|
+
t = t.Ae;
|
|
932
784
|
}
|
|
933
785
|
}
|
|
934
786
|
function dispose(e) {
|
|
935
|
-
let t = e.
|
|
787
|
+
let t = e.j || null;
|
|
936
788
|
do {
|
|
937
789
|
t = unlinkSubs(t);
|
|
938
790
|
} while (t !== null);
|
|
939
|
-
e.
|
|
940
|
-
e.
|
|
791
|
+
e.j = null;
|
|
792
|
+
e.ke = null;
|
|
941
793
|
disposeChildren(e, true);
|
|
942
794
|
}
|
|
943
795
|
function disposeChildren(e, t = false, n) {
|
|
944
|
-
if (e.
|
|
945
|
-
if (t) e.
|
|
946
|
-
let r = n ? e.
|
|
796
|
+
if (e.m & u) return;
|
|
797
|
+
if (t) e.m = u;
|
|
798
|
+
let r = n ? e.Ce : e.Pe;
|
|
947
799
|
while (r) {
|
|
948
|
-
const e = r.
|
|
949
|
-
if (r.
|
|
800
|
+
const e = r.Ae;
|
|
801
|
+
if (r.j) {
|
|
950
802
|
const e = r;
|
|
951
|
-
deleteFromHeap(e, e.
|
|
952
|
-
let t = e.
|
|
803
|
+
deleteFromHeap(e, e.m & o ? _ : b);
|
|
804
|
+
let t = e.j;
|
|
953
805
|
do {
|
|
954
806
|
t = unlinkSubs(t);
|
|
955
807
|
} while (t !== null);
|
|
956
|
-
e.
|
|
957
|
-
e.
|
|
808
|
+
e.j = null;
|
|
809
|
+
e.ke = null;
|
|
958
810
|
}
|
|
959
811
|
disposeChildren(r, true);
|
|
960
812
|
r = e;
|
|
961
813
|
}
|
|
962
814
|
if (n) {
|
|
963
|
-
e.
|
|
815
|
+
e.Ce = null;
|
|
964
816
|
} else {
|
|
965
|
-
e.
|
|
966
|
-
e.
|
|
817
|
+
e.Pe = null;
|
|
818
|
+
e.Ae = null;
|
|
967
819
|
}
|
|
968
820
|
runDisposal(e, n);
|
|
969
821
|
}
|
|
970
822
|
function runDisposal(e, t) {
|
|
971
|
-
let n = t ? e.
|
|
823
|
+
let n = t ? e.We : e.Ee;
|
|
972
824
|
if (!n) return;
|
|
973
825
|
if (Array.isArray(n)) {
|
|
974
826
|
for (let e = 0; e < n.length; e++) {
|
|
@@ -978,7 +830,7 @@ function runDisposal(e, t) {
|
|
|
978
830
|
} else {
|
|
979
831
|
n.call(n);
|
|
980
832
|
}
|
|
981
|
-
t ? (e.
|
|
833
|
+
t ? (e.We = null) : (e.Ee = null);
|
|
982
834
|
}
|
|
983
835
|
function getNextChildId(e) {
|
|
984
836
|
if (e.id != null) return formatId(e.id, e.je++);
|
|
@@ -989,319 +841,500 @@ function formatId(e, t) {
|
|
|
989
841
|
r = n.length - 1;
|
|
990
842
|
return e + (r ? String.fromCharCode(64 + r) : "") + n;
|
|
991
843
|
}
|
|
844
|
+
function getObserver() {
|
|
845
|
+
if (L || H) return W;
|
|
846
|
+
return E ? Q : null;
|
|
847
|
+
}
|
|
848
|
+
function getOwner() {
|
|
849
|
+
return Q;
|
|
850
|
+
}
|
|
851
|
+
function onCleanup(e) {
|
|
852
|
+
if (!Q) return e;
|
|
853
|
+
if (!Q.Ee) Q.Ee = e;
|
|
854
|
+
else if (Array.isArray(Q.Ee)) Q.Ee.push(e);
|
|
855
|
+
else Q.Ee = [Q.Ee, e];
|
|
856
|
+
return e;
|
|
857
|
+
}
|
|
858
|
+
function createOwner(e) {
|
|
859
|
+
const t = Q;
|
|
860
|
+
const n = {
|
|
861
|
+
id: e?.id ?? (t?.id != null ? getNextChildId(t) : undefined),
|
|
862
|
+
t: true,
|
|
863
|
+
u: t?.t ? t.u : t,
|
|
864
|
+
Pe: null,
|
|
865
|
+
Ae: null,
|
|
866
|
+
Ee: null,
|
|
867
|
+
oe: t?.oe ?? A,
|
|
868
|
+
Ne: t?.Ne || w,
|
|
869
|
+
je: 0,
|
|
870
|
+
We: null,
|
|
871
|
+
Ce: null,
|
|
872
|
+
i: t,
|
|
873
|
+
dispose(e = true) {
|
|
874
|
+
disposeChildren(n, e);
|
|
875
|
+
}
|
|
876
|
+
};
|
|
877
|
+
if (t) {
|
|
878
|
+
const e = t.Pe;
|
|
879
|
+
if (e === null) {
|
|
880
|
+
t.Pe = n;
|
|
881
|
+
} else {
|
|
882
|
+
n.Ae = e;
|
|
883
|
+
t.Pe = n;
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
return n;
|
|
887
|
+
}
|
|
888
|
+
function createRoot(e, t) {
|
|
889
|
+
const n = createOwner(t);
|
|
890
|
+
return runWithOwner(n, () => e(n.dispose));
|
|
891
|
+
}
|
|
892
|
+
function unlinkSubs(e) {
|
|
893
|
+
const t = e.L;
|
|
894
|
+
const n = e.N;
|
|
895
|
+
const r = e.P;
|
|
896
|
+
const i = e.Le;
|
|
897
|
+
if (r !== null) r.Le = i;
|
|
898
|
+
else t.Ie = i;
|
|
899
|
+
if (i !== null) i.P = r;
|
|
900
|
+
else {
|
|
901
|
+
t.O = r;
|
|
902
|
+
if (r === null) {
|
|
903
|
+
t.He?.();
|
|
904
|
+
t.H && !t.Qe && unobserved(t);
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
return n;
|
|
908
|
+
}
|
|
909
|
+
function unobserved(e) {
|
|
910
|
+
deleteFromHeap(e, e.m & o ? _ : b);
|
|
911
|
+
let t = e.j;
|
|
912
|
+
while (t !== null) {
|
|
913
|
+
t = unlinkSubs(t);
|
|
914
|
+
}
|
|
915
|
+
e.j = null;
|
|
916
|
+
disposeChildren(e, true);
|
|
917
|
+
}
|
|
918
|
+
function link(e, t) {
|
|
919
|
+
const n = t.ke;
|
|
920
|
+
if (n !== null && n.L === e) return;
|
|
921
|
+
let i = null;
|
|
922
|
+
const s = t.m & r;
|
|
923
|
+
if (s) {
|
|
924
|
+
i = n !== null ? n.N : t.j;
|
|
925
|
+
if (i !== null && i.L === e) {
|
|
926
|
+
t.ke = i;
|
|
927
|
+
return;
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
const o = e.Ie;
|
|
931
|
+
if (o !== null && o.A === t && (!s || isValidLink(o, t))) return;
|
|
932
|
+
const u = (t.ke = e.Ie = { L: e, A: t, N: i, Le: o, P: null });
|
|
933
|
+
if (n !== null) n.N = u;
|
|
934
|
+
else t.j = u;
|
|
935
|
+
if (o !== null) o.P = u;
|
|
936
|
+
else e.O = u;
|
|
937
|
+
}
|
|
938
|
+
function isValidLink(e, t) {
|
|
939
|
+
const n = t.ke;
|
|
940
|
+
if (n !== null) {
|
|
941
|
+
let r = t.j;
|
|
942
|
+
do {
|
|
943
|
+
if (r === e) return true;
|
|
944
|
+
if (r === n) break;
|
|
945
|
+
r = r.N;
|
|
946
|
+
} while (r !== null);
|
|
947
|
+
}
|
|
948
|
+
return false;
|
|
949
|
+
}
|
|
950
|
+
GlobalQueue.K = recompute;
|
|
951
|
+
GlobalQueue.U = disposeChildren;
|
|
952
|
+
let E = false;
|
|
953
|
+
let j = false;
|
|
954
|
+
let N = false;
|
|
955
|
+
let L = false;
|
|
956
|
+
let I = false;
|
|
957
|
+
let H = false;
|
|
958
|
+
let Q = null;
|
|
959
|
+
let R = null;
|
|
960
|
+
function recompute(t, n = false) {
|
|
961
|
+
const i = t.ie;
|
|
962
|
+
if (!n) {
|
|
963
|
+
if (t.ne && (!i || x) && x !== t.ne) A.initTransition(t.ne);
|
|
964
|
+
deleteFromHeap(t, t.m & o ? _ : b);
|
|
965
|
+
if (t.ne || i === h) disposeChildren(t);
|
|
966
|
+
else {
|
|
967
|
+
markDisposal(t);
|
|
968
|
+
t.We = t.Ee;
|
|
969
|
+
t.Ce = t.Pe;
|
|
970
|
+
t.Ee = null;
|
|
971
|
+
t.Pe = null;
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
const s = !!(t.m & f);
|
|
975
|
+
const u = hasActiveOverride(t);
|
|
976
|
+
const a = !!(t.ce & l);
|
|
977
|
+
const d = Q;
|
|
978
|
+
Q = t;
|
|
979
|
+
t.ke = null;
|
|
980
|
+
t.m = r;
|
|
981
|
+
t.$ = O;
|
|
982
|
+
let p = t.fe === y ? t.le : t.fe;
|
|
983
|
+
let g = t.o;
|
|
984
|
+
let w = E;
|
|
985
|
+
let S = R;
|
|
986
|
+
E = true;
|
|
987
|
+
if (s) {
|
|
988
|
+
const e = resolveLane(t);
|
|
989
|
+
if (e) R = e;
|
|
990
|
+
}
|
|
991
|
+
try {
|
|
992
|
+
p = handleAsync(t, t.H(p));
|
|
993
|
+
clearStatus(t);
|
|
994
|
+
const e = resolveLane(t);
|
|
995
|
+
if (e) {
|
|
996
|
+
e.T.delete(t);
|
|
997
|
+
updatePendingSignal(e.ae);
|
|
998
|
+
}
|
|
999
|
+
} catch (e) {
|
|
1000
|
+
if (e instanceof NotReadyError && R) {
|
|
1001
|
+
const e = findLane(R);
|
|
1002
|
+
if (e.ae !== t) {
|
|
1003
|
+
e.T.add(t);
|
|
1004
|
+
t.re = e;
|
|
1005
|
+
updatePendingSignal(e.ae);
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
notifyStatus(
|
|
1009
|
+
t,
|
|
1010
|
+
e instanceof NotReadyError ? l : c,
|
|
1011
|
+
e,
|
|
1012
|
+
undefined,
|
|
1013
|
+
e instanceof NotReadyError ? t.re : undefined
|
|
1014
|
+
);
|
|
1015
|
+
} finally {
|
|
1016
|
+
E = w;
|
|
1017
|
+
t.m = e;
|
|
1018
|
+
Q = d;
|
|
1019
|
+
}
|
|
1020
|
+
if (!t.Y) {
|
|
1021
|
+
const e = t.ke;
|
|
1022
|
+
let r = e !== null ? e.N : t.j;
|
|
1023
|
+
if (r !== null) {
|
|
1024
|
+
do {
|
|
1025
|
+
r = unlinkSubs(r);
|
|
1026
|
+
} while (r !== null);
|
|
1027
|
+
if (e !== null) e.N = null;
|
|
1028
|
+
else t.j = null;
|
|
1029
|
+
}
|
|
1030
|
+
const f = u ? t.le : t.fe === y ? t.le : t.fe;
|
|
1031
|
+
const l = !t.Se || !t.Se(f, p);
|
|
1032
|
+
if (l) {
|
|
1033
|
+
const e = u ? t.le : undefined;
|
|
1034
|
+
if (n || (i && x !== t.ne) || s) t.le = p;
|
|
1035
|
+
else t.fe = p;
|
|
1036
|
+
if (u && !s && a) {
|
|
1037
|
+
const e = t.ye || 0;
|
|
1038
|
+
const n = t.he || 0;
|
|
1039
|
+
if (e <= n) t.le = p;
|
|
1040
|
+
}
|
|
1041
|
+
if (!u || s || t.le !== e) {
|
|
1042
|
+
insertSubs(t, s || u);
|
|
1043
|
+
}
|
|
1044
|
+
} else if (u) {
|
|
1045
|
+
t.fe = p;
|
|
1046
|
+
} else if (t.o != g) {
|
|
1047
|
+
for (let e = t.O; e !== null; e = e.P) {
|
|
1048
|
+
insertIntoHeapHeight(e.A, e.A.m & o ? _ : b);
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
R = S;
|
|
1053
|
+
(!n || t.ce & l) && !t.ne && !(x && t.ge) && A.D.push(t);
|
|
1054
|
+
t.ne && i && x !== t.ne && runInTransition(t.ne, () => recompute(t));
|
|
1055
|
+
}
|
|
1056
|
+
function updateIfNecessary(r) {
|
|
1057
|
+
if (r.m & t) {
|
|
1058
|
+
for (let e = r.j; e; e = e.N) {
|
|
1059
|
+
const t = e.L;
|
|
1060
|
+
const i = t.I || t;
|
|
1061
|
+
if (i.H) {
|
|
1062
|
+
updateIfNecessary(i);
|
|
1063
|
+
}
|
|
1064
|
+
if (r.m & n) {
|
|
1065
|
+
break;
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
if (r.m & (n | f) || (r.Y && r.$ < O)) {
|
|
1070
|
+
recompute(r);
|
|
1071
|
+
}
|
|
1072
|
+
r.m = e;
|
|
1073
|
+
}
|
|
992
1074
|
function computed(t, n, r) {
|
|
993
1075
|
const i = {
|
|
994
|
-
id: r?.id ?? (
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1076
|
+
id: r?.id ?? (Q?.id != null ? getNextChildId(Q) : undefined),
|
|
1077
|
+
Se: r?.equals != null ? r.equals : isEqual,
|
|
1078
|
+
Re: !!r?.pureWrite,
|
|
1079
|
+
He: r?.unobserved,
|
|
1080
|
+
Ee: null,
|
|
1081
|
+
oe: Q?.oe ?? A,
|
|
1082
|
+
Ne: Q?.Ne ?? w,
|
|
1001
1083
|
je: 0,
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
be: null,
|
|
1010
|
-
P: null,
|
|
1084
|
+
H: t,
|
|
1085
|
+
le: n,
|
|
1086
|
+
o: 0,
|
|
1087
|
+
k: null,
|
|
1088
|
+
h: undefined,
|
|
1089
|
+
p: null,
|
|
1090
|
+
j: null,
|
|
1011
1091
|
ke: null,
|
|
1012
|
-
|
|
1092
|
+
O: null,
|
|
1093
|
+
Ie: null,
|
|
1094
|
+
i: Q,
|
|
1095
|
+
Ae: null,
|
|
1096
|
+
Pe: null,
|
|
1097
|
+
m: e,
|
|
1098
|
+
ce: a,
|
|
1099
|
+
$: O,
|
|
1100
|
+
fe: y,
|
|
1013
1101
|
We: null,
|
|
1014
|
-
|
|
1015
|
-
_: e,
|
|
1016
|
-
ge: a,
|
|
1017
|
-
fe: O,
|
|
1018
|
-
J: y,
|
|
1102
|
+
Ce: null,
|
|
1019
1103
|
we: null,
|
|
1020
|
-
|
|
1021
|
-
xe: null,
|
|
1022
|
-
B: null
|
|
1104
|
+
ne: null
|
|
1023
1105
|
};
|
|
1024
|
-
i.
|
|
1025
|
-
const s =
|
|
1026
|
-
if (
|
|
1027
|
-
const e =
|
|
1106
|
+
i.p = i;
|
|
1107
|
+
const s = Q?.t ? Q.u : Q;
|
|
1108
|
+
if (Q) {
|
|
1109
|
+
const e = Q.Pe;
|
|
1028
1110
|
if (e === null) {
|
|
1029
|
-
|
|
1111
|
+
Q.Pe = i;
|
|
1030
1112
|
} else {
|
|
1031
|
-
i.
|
|
1032
|
-
|
|
1113
|
+
i.Ae = e;
|
|
1114
|
+
Q.Pe = i;
|
|
1033
1115
|
}
|
|
1034
1116
|
}
|
|
1035
|
-
if (s) i.
|
|
1117
|
+
if (s) i.o = s.o + 1;
|
|
1036
1118
|
!r?.lazy && recompute(i, true);
|
|
1037
1119
|
return i;
|
|
1038
1120
|
}
|
|
1039
1121
|
function signal(e, t, n = null) {
|
|
1040
1122
|
const r = {
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1123
|
+
Se: t?.equals != null ? t.equals : isEqual,
|
|
1124
|
+
Re: !!t?.pureWrite,
|
|
1125
|
+
He: t?.unobserved,
|
|
1126
|
+
le: e,
|
|
1127
|
+
O: null,
|
|
1128
|
+
Ie: null,
|
|
1129
|
+
$: O,
|
|
1130
|
+
I: n,
|
|
1131
|
+
C: n?.k || null,
|
|
1132
|
+
fe: y
|
|
1051
1133
|
};
|
|
1052
|
-
n && (n.
|
|
1134
|
+
n && (n.k = r);
|
|
1053
1135
|
return r;
|
|
1054
1136
|
}
|
|
1055
1137
|
function optimisticSignal(e, t) {
|
|
1056
1138
|
const n = signal(e, t);
|
|
1057
|
-
n.
|
|
1139
|
+
n.ge = true;
|
|
1058
1140
|
return n;
|
|
1059
1141
|
}
|
|
1060
1142
|
function optimisticComputed(e, t, n) {
|
|
1061
1143
|
const r = computed(e, t, n);
|
|
1062
|
-
r.
|
|
1144
|
+
r.ge = true;
|
|
1063
1145
|
return r;
|
|
1064
1146
|
}
|
|
1065
|
-
function getPendingSignal(e) {
|
|
1066
|
-
if (!e.Qe) {
|
|
1067
|
-
e.Qe = optimisticSignal(false, { pureWrite: true });
|
|
1068
|
-
if (e.T) {
|
|
1069
|
-
e.Qe.T = e;
|
|
1070
|
-
}
|
|
1071
|
-
if (computePendingState(e)) setSignal(e.Qe, true);
|
|
1072
|
-
}
|
|
1073
|
-
return e.Qe;
|
|
1074
|
-
}
|
|
1075
|
-
function computePendingState(e) {
|
|
1076
|
-
const t = e;
|
|
1077
|
-
if (e.U && e.J !== y) {
|
|
1078
|
-
if (t.ge & l && !(t.ge & a)) return true;
|
|
1079
|
-
if (e.T) {
|
|
1080
|
-
const t = e.M ? findLane(e.M) : null;
|
|
1081
|
-
return !!(t && t.q.size > 0);
|
|
1082
|
-
}
|
|
1083
|
-
return true;
|
|
1084
|
-
}
|
|
1085
|
-
if (e.J !== y && !(t.ge & a)) return true;
|
|
1086
|
-
return !!(t.ge & l && !(t.ge & a));
|
|
1087
|
-
}
|
|
1088
|
-
function getPendingValueComputed(e) {
|
|
1089
|
-
if (!e.ve) {
|
|
1090
|
-
const t = I;
|
|
1091
|
-
I = false;
|
|
1092
|
-
const n = L;
|
|
1093
|
-
L = false;
|
|
1094
|
-
const r = H;
|
|
1095
|
-
H = null;
|
|
1096
|
-
e.ve = optimisticComputed(() => read(e));
|
|
1097
|
-
e.ve.T = e;
|
|
1098
|
-
H = r;
|
|
1099
|
-
L = n;
|
|
1100
|
-
I = t;
|
|
1101
|
-
}
|
|
1102
|
-
return e.ve;
|
|
1103
|
-
}
|
|
1104
|
-
function updatePendingSignal(e) {
|
|
1105
|
-
if (e.Qe) {
|
|
1106
|
-
const t = computePendingState(e);
|
|
1107
|
-
const n = e.Qe;
|
|
1108
|
-
setSignal(n, t);
|
|
1109
|
-
if (!t && n.M) {
|
|
1110
|
-
const t = resolveLane(e);
|
|
1111
|
-
if (t && t.q.size > 0) {
|
|
1112
|
-
const e = findLane(n.M);
|
|
1113
|
-
if (e !== t) {
|
|
1114
|
-
mergeLanes(t, e);
|
|
1115
|
-
}
|
|
1116
|
-
}
|
|
1117
|
-
clearLaneEntry(n);
|
|
1118
|
-
n.M = undefined;
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
1122
1147
|
function isEqual(e, t) {
|
|
1123
1148
|
return e === t;
|
|
1124
1149
|
}
|
|
1125
1150
|
function untrack(e) {
|
|
1126
|
-
if (!
|
|
1127
|
-
|
|
1151
|
+
if (!E) return e();
|
|
1152
|
+
E = false;
|
|
1128
1153
|
try {
|
|
1129
1154
|
return e();
|
|
1130
1155
|
} finally {
|
|
1131
|
-
|
|
1156
|
+
E = true;
|
|
1132
1157
|
}
|
|
1133
1158
|
}
|
|
1134
1159
|
function read(e) {
|
|
1135
|
-
if (
|
|
1160
|
+
if (H) {
|
|
1136
1161
|
const t = getPendingValueComputed(e);
|
|
1137
|
-
const n =
|
|
1138
|
-
|
|
1162
|
+
const n = H;
|
|
1163
|
+
H = false;
|
|
1139
1164
|
const r = read(t);
|
|
1140
|
-
|
|
1141
|
-
if (t.
|
|
1142
|
-
if (j &&
|
|
1143
|
-
const n = findLane(t.
|
|
1144
|
-
const r = findLane(
|
|
1145
|
-
if (n !== r && n.
|
|
1146
|
-
return e.
|
|
1165
|
+
H = n;
|
|
1166
|
+
if (t.ce & l) return e.le;
|
|
1167
|
+
if (j && R && t.re) {
|
|
1168
|
+
const n = findLane(t.re);
|
|
1169
|
+
const r = findLane(R);
|
|
1170
|
+
if (n !== r && n.T.size > 0) {
|
|
1171
|
+
return e.le;
|
|
1147
1172
|
}
|
|
1148
1173
|
}
|
|
1149
1174
|
return r;
|
|
1150
1175
|
}
|
|
1151
1176
|
if (L) {
|
|
1152
|
-
const t = e.
|
|
1177
|
+
const t = e.I || e;
|
|
1153
1178
|
const n = getPendingSignal(t);
|
|
1154
1179
|
const r = L;
|
|
1155
1180
|
L = false;
|
|
1156
1181
|
if (read(n)) {
|
|
1157
|
-
|
|
1182
|
+
I = true;
|
|
1158
1183
|
}
|
|
1159
1184
|
L = r;
|
|
1160
|
-
return e.
|
|
1185
|
+
return e.le;
|
|
1161
1186
|
}
|
|
1162
|
-
let t =
|
|
1163
|
-
if (t?.
|
|
1164
|
-
if (N && e.
|
|
1165
|
-
if (t &&
|
|
1166
|
-
if (e.
|
|
1187
|
+
let t = Q;
|
|
1188
|
+
if (t?.t) t = t.u;
|
|
1189
|
+
if (N && e.H) recompute(e);
|
|
1190
|
+
if (t && E) {
|
|
1191
|
+
if (e.H && e.m & u) recompute(e);
|
|
1167
1192
|
link(e, t);
|
|
1168
|
-
const n = e.
|
|
1169
|
-
if (n.
|
|
1170
|
-
const r = e.
|
|
1171
|
-
if (n.
|
|
1193
|
+
const n = e.I || e;
|
|
1194
|
+
if (n.H) {
|
|
1195
|
+
const r = e.m & o;
|
|
1196
|
+
if (n.o >= (r ? _.W : b.W)) {
|
|
1172
1197
|
markNode(t);
|
|
1173
|
-
markHeap(r ?
|
|
1198
|
+
markHeap(r ? _ : b);
|
|
1174
1199
|
updateIfNecessary(n);
|
|
1175
1200
|
}
|
|
1176
|
-
const i = n.
|
|
1177
|
-
if (i >= t.
|
|
1178
|
-
t.
|
|
1201
|
+
const i = n.o;
|
|
1202
|
+
if (i >= t.o && e.i !== t) {
|
|
1203
|
+
t.o = i + 1;
|
|
1179
1204
|
}
|
|
1180
1205
|
}
|
|
1181
1206
|
}
|
|
1182
|
-
const n = e.
|
|
1183
|
-
if (t && n.
|
|
1184
|
-
if (
|
|
1185
|
-
const r = n.
|
|
1186
|
-
const i = findLane(
|
|
1207
|
+
const n = e.I || e;
|
|
1208
|
+
if (t && n.ce & l && !(j && n.ne && x !== n.ne)) {
|
|
1209
|
+
if (R) {
|
|
1210
|
+
const r = n.re;
|
|
1211
|
+
const i = findLane(R);
|
|
1187
1212
|
if (r && findLane(r) === i && !hasActiveOverride(n)) {
|
|
1188
|
-
if (!
|
|
1189
|
-
throw n.
|
|
1213
|
+
if (!E) link(e, t);
|
|
1214
|
+
throw n.Y;
|
|
1190
1215
|
}
|
|
1191
1216
|
} else {
|
|
1192
|
-
if (!
|
|
1193
|
-
throw n.
|
|
1217
|
+
if (!E) link(e, t);
|
|
1218
|
+
throw n.Y;
|
|
1194
1219
|
}
|
|
1195
1220
|
}
|
|
1196
|
-
if (e.
|
|
1197
|
-
if (e
|
|
1221
|
+
if (e.H && e.ce & c) {
|
|
1222
|
+
if (e.$ < O) {
|
|
1198
1223
|
recompute(e, true);
|
|
1199
1224
|
return read(e);
|
|
1200
|
-
} else throw e.
|
|
1225
|
+
} else throw e.Y;
|
|
1201
1226
|
}
|
|
1202
|
-
return !t ||
|
|
1227
|
+
return !t || R !== null || e.fe === y || (j && e.ne && x !== e.ne) ? e.le : e.fe;
|
|
1203
1228
|
}
|
|
1204
1229
|
function setSignal(e, t) {
|
|
1205
|
-
if (e.
|
|
1206
|
-
const n = e.
|
|
1207
|
-
const r = n ? e.
|
|
1230
|
+
if (e.ne && x !== e.ne) A.initTransition(e.ne);
|
|
1231
|
+
const n = e.ge && !P;
|
|
1232
|
+
const r = n ? e.le : e.fe === y ? e.le : e.fe;
|
|
1208
1233
|
if (typeof t === "function") t = t(r);
|
|
1209
|
-
const i = !e.
|
|
1234
|
+
const i = !e.Se || !e.Se(r, t);
|
|
1210
1235
|
if (!i) {
|
|
1211
|
-
if (n && e.
|
|
1236
|
+
if (n && e.fe !== y && e.H) {
|
|
1212
1237
|
insertSubs(e, true);
|
|
1213
1238
|
schedule();
|
|
1214
1239
|
}
|
|
1215
1240
|
return t;
|
|
1216
1241
|
}
|
|
1217
1242
|
if (n) {
|
|
1218
|
-
const n =
|
|
1219
|
-
if (e.
|
|
1220
|
-
|
|
1243
|
+
const n = A.B.includes(e);
|
|
1244
|
+
if (e.ne && n) {
|
|
1245
|
+
A.initTransition(e.ne);
|
|
1221
1246
|
}
|
|
1222
|
-
if (e.
|
|
1223
|
-
e.
|
|
1247
|
+
if (e.fe === y) {
|
|
1248
|
+
e.fe = e.le;
|
|
1224
1249
|
}
|
|
1225
1250
|
if (!n) {
|
|
1226
|
-
|
|
1251
|
+
A.B.push(e);
|
|
1227
1252
|
}
|
|
1228
|
-
e.
|
|
1253
|
+
e.ye = (e.ye || 0) + 1;
|
|
1229
1254
|
const r = getOrCreateLane(e);
|
|
1230
|
-
e.
|
|
1231
|
-
e.
|
|
1255
|
+
e.re = r;
|
|
1256
|
+
e.le = t;
|
|
1232
1257
|
} else {
|
|
1233
|
-
if (e.
|
|
1234
|
-
e.
|
|
1258
|
+
if (e.fe === y) A.D.push(e);
|
|
1259
|
+
e.fe = t;
|
|
1235
1260
|
}
|
|
1236
1261
|
updatePendingSignal(e);
|
|
1237
|
-
if (e.
|
|
1238
|
-
setSignal(e.
|
|
1262
|
+
if (e.me) {
|
|
1263
|
+
setSignal(e.me, t);
|
|
1239
1264
|
}
|
|
1240
|
-
e
|
|
1265
|
+
e.$ = O;
|
|
1241
1266
|
insertSubs(e, n);
|
|
1242
1267
|
schedule();
|
|
1243
1268
|
return t;
|
|
1244
1269
|
}
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
}
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
else if (Array.isArray(H.Se)) H.Se.push(e);
|
|
1257
|
-
else H.Se = [H.Se, e];
|
|
1258
|
-
return e;
|
|
1270
|
+
function runWithOwner(e, t) {
|
|
1271
|
+
const n = Q;
|
|
1272
|
+
const r = E;
|
|
1273
|
+
Q = e;
|
|
1274
|
+
E = false;
|
|
1275
|
+
try {
|
|
1276
|
+
return t();
|
|
1277
|
+
} finally {
|
|
1278
|
+
Q = n;
|
|
1279
|
+
E = r;
|
|
1280
|
+
}
|
|
1259
1281
|
}
|
|
1260
|
-
function
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
l: t?.i ? t.l : t,
|
|
1266
|
-
_e: null,
|
|
1267
|
-
We: null,
|
|
1268
|
-
Se: null,
|
|
1269
|
-
pe: t?.pe ?? E,
|
|
1270
|
-
Le: t?.Le || w,
|
|
1271
|
-
je: 0,
|
|
1272
|
-
we: null,
|
|
1273
|
-
me: null,
|
|
1274
|
-
o: t,
|
|
1275
|
-
dispose(e = true) {
|
|
1276
|
-
disposeChildren(n, e);
|
|
1282
|
+
function getPendingSignal(e) {
|
|
1283
|
+
if (!e.Te) {
|
|
1284
|
+
e.Te = optimisticSignal(false, { pureWrite: true });
|
|
1285
|
+
if (e.de) {
|
|
1286
|
+
e.Te.de = e;
|
|
1277
1287
|
}
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1288
|
+
if (computePendingState(e)) setSignal(e.Te, true);
|
|
1289
|
+
}
|
|
1290
|
+
return e.Te;
|
|
1291
|
+
}
|
|
1292
|
+
function computePendingState(e) {
|
|
1293
|
+
const t = e;
|
|
1294
|
+
if (e.ge && e.fe !== y) {
|
|
1295
|
+
if (t.ce & l && !(t.ce & a)) return true;
|
|
1296
|
+
if (e.de) {
|
|
1297
|
+
const t = e.re ? findLane(e.re) : null;
|
|
1298
|
+
return !!(t && t.T.size > 0);
|
|
1286
1299
|
}
|
|
1300
|
+
return true;
|
|
1287
1301
|
}
|
|
1288
|
-
return
|
|
1302
|
+
if (e.fe !== y && !(t.ce & a)) return true;
|
|
1303
|
+
return !!(t.ce & l && !(t.ce & a));
|
|
1289
1304
|
}
|
|
1290
|
-
function
|
|
1291
|
-
|
|
1292
|
-
|
|
1305
|
+
function updatePendingSignal(e) {
|
|
1306
|
+
if (e.Te) {
|
|
1307
|
+
const t = computePendingState(e);
|
|
1308
|
+
const n = e.Te;
|
|
1309
|
+
setSignal(n, t);
|
|
1310
|
+
if (!t && n.re) {
|
|
1311
|
+
const t = resolveLane(e);
|
|
1312
|
+
if (t && t.T.size > 0) {
|
|
1313
|
+
const e = findLane(n.re);
|
|
1314
|
+
if (e !== t) {
|
|
1315
|
+
mergeLanes(t, e);
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
k.delete(n);
|
|
1319
|
+
n.re = undefined;
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1293
1322
|
}
|
|
1294
|
-
function
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1323
|
+
function getPendingValueComputed(e) {
|
|
1324
|
+
if (!e.me) {
|
|
1325
|
+
const t = H;
|
|
1326
|
+
H = false;
|
|
1327
|
+
const n = L;
|
|
1328
|
+
L = false;
|
|
1329
|
+
const r = Q;
|
|
1330
|
+
Q = null;
|
|
1331
|
+
e.me = optimisticComputed(() => read(e));
|
|
1332
|
+
e.me.de = e;
|
|
1333
|
+
Q = r;
|
|
1334
|
+
L = n;
|
|
1335
|
+
H = t;
|
|
1304
1336
|
}
|
|
1337
|
+
return e.me;
|
|
1305
1338
|
}
|
|
1306
1339
|
function staleValues(e, t = true) {
|
|
1307
1340
|
const n = j;
|
|
@@ -1313,27 +1346,27 @@ function staleValues(e, t = true) {
|
|
|
1313
1346
|
}
|
|
1314
1347
|
}
|
|
1315
1348
|
function pending(e) {
|
|
1316
|
-
const t =
|
|
1317
|
-
|
|
1349
|
+
const t = H;
|
|
1350
|
+
H = true;
|
|
1318
1351
|
try {
|
|
1319
1352
|
return e();
|
|
1320
1353
|
} finally {
|
|
1321
|
-
|
|
1354
|
+
H = t;
|
|
1322
1355
|
}
|
|
1323
1356
|
}
|
|
1324
1357
|
function isPending(e) {
|
|
1325
1358
|
const t = L;
|
|
1326
|
-
const n =
|
|
1359
|
+
const n = I;
|
|
1327
1360
|
L = true;
|
|
1328
|
-
|
|
1361
|
+
I = false;
|
|
1329
1362
|
try {
|
|
1330
1363
|
e();
|
|
1331
|
-
return
|
|
1364
|
+
return I;
|
|
1332
1365
|
} catch {
|
|
1333
|
-
return
|
|
1366
|
+
return I;
|
|
1334
1367
|
} finally {
|
|
1335
1368
|
L = t;
|
|
1336
|
-
|
|
1369
|
+
I = n;
|
|
1337
1370
|
}
|
|
1338
1371
|
}
|
|
1339
1372
|
function refresh(e) {
|
|
@@ -1362,7 +1395,7 @@ function getContext(e, t = getOwner()) {
|
|
|
1362
1395
|
if (!t) {
|
|
1363
1396
|
throw new NoOwnerError();
|
|
1364
1397
|
}
|
|
1365
|
-
const n = hasContext(e, t) ? t.
|
|
1398
|
+
const n = hasContext(e, t) ? t.Ne[e.id] : e.defaultValue;
|
|
1366
1399
|
if (isUndefined(n)) {
|
|
1367
1400
|
throw new ContextNotFoundError();
|
|
1368
1401
|
}
|
|
@@ -1372,93 +1405,57 @@ function setContext(e, t, n = getOwner()) {
|
|
|
1372
1405
|
if (!n) {
|
|
1373
1406
|
throw new NoOwnerError();
|
|
1374
1407
|
}
|
|
1375
|
-
n.
|
|
1408
|
+
n.Ne = { ...n.Ne, [e.id]: isUndefined(t) ? e.defaultValue : t };
|
|
1376
1409
|
}
|
|
1377
1410
|
function hasContext(e, t) {
|
|
1378
|
-
return !isUndefined(t?.
|
|
1411
|
+
return !isUndefined(t?.Ne[e.id]);
|
|
1379
1412
|
}
|
|
1380
1413
|
function isUndefined(e) {
|
|
1381
1414
|
return typeof e === "undefined";
|
|
1382
1415
|
}
|
|
1383
|
-
function
|
|
1384
|
-
|
|
1385
|
-
const
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1416
|
+
function restoreTransition(e, t) {
|
|
1417
|
+
A.initTransition(e);
|
|
1418
|
+
const n = t();
|
|
1419
|
+
flush();
|
|
1420
|
+
return n;
|
|
1421
|
+
}
|
|
1422
|
+
function action(e) {
|
|
1423
|
+
return (...t) =>
|
|
1424
|
+
new Promise((n, r) => {
|
|
1425
|
+
const i = e(...t);
|
|
1426
|
+
A.initTransition();
|
|
1427
|
+
let s = x;
|
|
1428
|
+
s.ee.push(i);
|
|
1429
|
+
const done = (e, t) => {
|
|
1430
|
+
s = currentTransition(s);
|
|
1431
|
+
const o = s.ee.indexOf(i);
|
|
1432
|
+
if (o >= 0) s.ee.splice(o, 1);
|
|
1433
|
+
setActiveTransition(s);
|
|
1434
|
+
schedule();
|
|
1435
|
+
t ? r(t) : n(e);
|
|
1436
|
+
};
|
|
1437
|
+
const step = (e, t) => {
|
|
1438
|
+
let n;
|
|
1406
1439
|
try {
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
o.Te = undefined;
|
|
1411
|
-
})
|
|
1412
|
-
: console.error(e);
|
|
1413
|
-
} catch (t) {
|
|
1414
|
-
e = t;
|
|
1440
|
+
n = t ? i.throw(e) : i.next(e);
|
|
1441
|
+
} catch (e) {
|
|
1442
|
+
return done(undefined, e);
|
|
1415
1443
|
}
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
} catch (e) {
|
|
1432
|
-
if (!this.pe.notify(this, c, c)) throw e;
|
|
1433
|
-
} finally {
|
|
1434
|
-
this.Ie = this.ye;
|
|
1435
|
-
this.de = false;
|
|
1436
|
-
}
|
|
1437
|
-
}
|
|
1438
|
-
function trackedEffect(e, t) {
|
|
1439
|
-
const run = () => {
|
|
1440
|
-
if (!n.de || n._ & u) return;
|
|
1441
|
-
n.de = false;
|
|
1442
|
-
recompute(n);
|
|
1443
|
-
};
|
|
1444
|
-
const n = computed(
|
|
1445
|
-
() => {
|
|
1446
|
-
try {
|
|
1447
|
-
n.Te?.();
|
|
1448
|
-
n.Te = undefined;
|
|
1449
|
-
n.Te = staleValues(e) || undefined;
|
|
1450
|
-
} finally {
|
|
1451
|
-
}
|
|
1452
|
-
},
|
|
1453
|
-
undefined,
|
|
1454
|
-
{ ...t, lazy: true, pureWrite: true }
|
|
1455
|
-
);
|
|
1456
|
-
n.Te = undefined;
|
|
1457
|
-
n.de = true;
|
|
1458
|
-
n.ae = h;
|
|
1459
|
-
n.he = run;
|
|
1460
|
-
n.pe.enqueue(p, run);
|
|
1461
|
-
onCleanup(() => n.Te?.());
|
|
1444
|
+
if (n instanceof Promise)
|
|
1445
|
+
return void n.then(run, e => restoreTransition(s, () => step(e, true)));
|
|
1446
|
+
run(n);
|
|
1447
|
+
};
|
|
1448
|
+
const run = e => {
|
|
1449
|
+
if (e.done) return done(e.value);
|
|
1450
|
+
if (e.value instanceof Promise)
|
|
1451
|
+
return void e.value.then(
|
|
1452
|
+
e => restoreTransition(s, () => step(e)),
|
|
1453
|
+
e => restoreTransition(s, () => step(e, true))
|
|
1454
|
+
);
|
|
1455
|
+
restoreTransition(s, () => step(e.value));
|
|
1456
|
+
};
|
|
1457
|
+
step();
|
|
1458
|
+
});
|
|
1462
1459
|
}
|
|
1463
1460
|
function createSignal(e, t, n) {
|
|
1464
1461
|
if (typeof e === "function") {
|
|
@@ -1523,7 +1520,7 @@ function createOptimistic(e, t, n) {
|
|
|
1523
1520
|
function onSettled(e) {
|
|
1524
1521
|
getOwner()
|
|
1525
1522
|
? createTrackedEffect(() => untrack(e))
|
|
1526
|
-
:
|
|
1523
|
+
: A.enqueue(p, () => {
|
|
1527
1524
|
const t = e();
|
|
1528
1525
|
t?.();
|
|
1529
1526
|
});
|
|
@@ -1531,7 +1528,8 @@ function onSettled(e) {
|
|
|
1531
1528
|
function unwrap(e) {
|
|
1532
1529
|
return e?.[F]?.[U] ?? e;
|
|
1533
1530
|
}
|
|
1534
|
-
function getOverrideValue(e, t, n, r) {
|
|
1531
|
+
function getOverrideValue(e, t, n, r, i) {
|
|
1532
|
+
if (i && r in i) return i[r];
|
|
1535
1533
|
return t && r in t ? t[r] : e[r];
|
|
1536
1534
|
}
|
|
1537
1535
|
function getAllKeys(e, t, n) {
|
|
@@ -1544,108 +1542,110 @@ function applyState(e, t, n, r) {
|
|
|
1544
1542
|
if (!i) return;
|
|
1545
1543
|
const s = i[G];
|
|
1546
1544
|
const o = i[K];
|
|
1547
|
-
|
|
1548
|
-
|
|
1545
|
+
const u = i[z];
|
|
1546
|
+
let f = i[U];
|
|
1547
|
+
if (e === s && !o && !u) return;
|
|
1549
1548
|
(i[Y] || ee).set(e, i[V]);
|
|
1550
1549
|
i[G] = e;
|
|
1551
1550
|
i[K] = undefined;
|
|
1552
1551
|
if (Array.isArray(s)) {
|
|
1553
1552
|
let t = false;
|
|
1554
|
-
const
|
|
1555
|
-
if (e.length &&
|
|
1556
|
-
let
|
|
1553
|
+
const l = getOverrideValue(s, o, f, "length", u);
|
|
1554
|
+
if (e.length && l && e[0] && n(e[0]) != null) {
|
|
1555
|
+
let c, a, d, p, h, y, g, w;
|
|
1557
1556
|
for (
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1557
|
+
d = 0, p = Math.min(l, e.length);
|
|
1558
|
+
d < p &&
|
|
1559
|
+
((y = getOverrideValue(s, o, f, d, u)) === e[d] || (y && e[d] && n(y) === n(e[d])));
|
|
1560
|
+
d++
|
|
1561
1561
|
) {
|
|
1562
|
-
applyState(e[
|
|
1562
|
+
applyState(e[d], wrap(y, i), n, r);
|
|
1563
1563
|
}
|
|
1564
|
-
const
|
|
1565
|
-
|
|
1564
|
+
const S = new Array(e.length),
|
|
1565
|
+
m = new Map();
|
|
1566
1566
|
for (
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
((
|
|
1571
|
-
|
|
1567
|
+
p = l - 1, h = e.length - 1;
|
|
1568
|
+
p >= d &&
|
|
1569
|
+
h >= d &&
|
|
1570
|
+
((y = getOverrideValue(s, o, f, p, u)) === e[h] || (y && e[h] && n(y) === n(e[h])));
|
|
1571
|
+
p--, h--
|
|
1572
1572
|
) {
|
|
1573
|
-
|
|
1573
|
+
S[h] = y;
|
|
1574
1574
|
}
|
|
1575
|
-
if (
|
|
1576
|
-
for (
|
|
1575
|
+
if (d > h || d > p) {
|
|
1576
|
+
for (a = d; a <= h; a++) {
|
|
1577
1577
|
t = true;
|
|
1578
|
-
i[U][
|
|
1578
|
+
i[U][a] && setSignal(i[U][a], wrap(e[a], i));
|
|
1579
1579
|
}
|
|
1580
|
-
for (;
|
|
1580
|
+
for (; a < e.length; a++) {
|
|
1581
1581
|
t = true;
|
|
1582
|
-
const s = wrap(
|
|
1583
|
-
i[U][
|
|
1584
|
-
applyState(e[
|
|
1582
|
+
const s = wrap(S[a], i);
|
|
1583
|
+
i[U][a] && setSignal(i[U][a], s);
|
|
1584
|
+
applyState(e[a], s, n, r);
|
|
1585
1585
|
}
|
|
1586
1586
|
t && i[U][M] && setSignal(i[U][M], void 0);
|
|
1587
|
-
|
|
1587
|
+
l !== e.length && i[U].length && setSignal(i[U].length, e.length);
|
|
1588
1588
|
return;
|
|
1589
1589
|
}
|
|
1590
|
-
|
|
1591
|
-
for (
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
}
|
|
1598
|
-
for (
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
if (
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1590
|
+
g = new Array(h + 1);
|
|
1591
|
+
for (a = h; a >= d; a--) {
|
|
1592
|
+
y = e[a];
|
|
1593
|
+
w = y ? n(y) : y;
|
|
1594
|
+
c = m.get(w);
|
|
1595
|
+
g[a] = c === undefined ? -1 : c;
|
|
1596
|
+
m.set(w, a);
|
|
1597
|
+
}
|
|
1598
|
+
for (c = d; c <= p; c++) {
|
|
1599
|
+
y = getOverrideValue(s, o, f, c, u);
|
|
1600
|
+
w = y ? n(y) : y;
|
|
1601
|
+
a = m.get(w);
|
|
1602
|
+
if (a !== undefined && a !== -1) {
|
|
1603
|
+
S[a] = y;
|
|
1604
|
+
a = g[a];
|
|
1605
|
+
m.set(w, a);
|
|
1606
1606
|
}
|
|
1607
1607
|
}
|
|
1608
|
-
for (
|
|
1609
|
-
if (
|
|
1610
|
-
const t = wrap(
|
|
1611
|
-
i[U][
|
|
1612
|
-
applyState(e[
|
|
1613
|
-
} else i[U][
|
|
1608
|
+
for (a = d; a < e.length; a++) {
|
|
1609
|
+
if (a in S) {
|
|
1610
|
+
const t = wrap(S[a], i);
|
|
1611
|
+
i[U][a] && setSignal(i[U][a], t);
|
|
1612
|
+
applyState(e[a], t, n, r);
|
|
1613
|
+
} else i[U][a] && setSignal(i[U][a], wrap(e[a], i));
|
|
1614
1614
|
}
|
|
1615
|
-
if (
|
|
1615
|
+
if (d < e.length) t = true;
|
|
1616
1616
|
} else if (e.length) {
|
|
1617
|
-
for (let t = 0,
|
|
1618
|
-
const
|
|
1619
|
-
isWrappable(
|
|
1617
|
+
for (let t = 0, l = e.length; t < l; t++) {
|
|
1618
|
+
const l = getOverrideValue(s, o, f, t, u);
|
|
1619
|
+
isWrappable(l) ? applyState(e[t], wrap(l, i), n, r) : i[U][t] && setSignal(i[U][t], e[t]);
|
|
1620
1620
|
}
|
|
1621
1621
|
}
|
|
1622
|
-
if (
|
|
1622
|
+
if (l !== e.length) {
|
|
1623
1623
|
t = true;
|
|
1624
1624
|
i[U].length && setSignal(i[U].length, e.length);
|
|
1625
1625
|
}
|
|
1626
1626
|
t && i[U][M] && setSignal(i[U][M], void 0);
|
|
1627
1627
|
return;
|
|
1628
1628
|
}
|
|
1629
|
-
if (
|
|
1630
|
-
const t =
|
|
1631
|
-
const
|
|
1632
|
-
for (let
|
|
1633
|
-
const
|
|
1634
|
-
const
|
|
1635
|
-
const
|
|
1636
|
-
let
|
|
1637
|
-
if (
|
|
1638
|
-
if (!
|
|
1629
|
+
if (f) {
|
|
1630
|
+
const t = f[M];
|
|
1631
|
+
const l = t || r ? getAllKeys(s, o, e) : Object.keys(f);
|
|
1632
|
+
for (let c = 0, a = l.length; c < a; c++) {
|
|
1633
|
+
const a = l[c];
|
|
1634
|
+
const d = f[a];
|
|
1635
|
+
const p = unwrap(getOverrideValue(s, o, f, a, u));
|
|
1636
|
+
let h = unwrap(e[a]);
|
|
1637
|
+
if (p === h) continue;
|
|
1638
|
+
if (!p || !isWrappable(p) || !isWrappable(h) || (n(p) != null && n(p) !== n(h))) {
|
|
1639
1639
|
t && setSignal(t, void 0);
|
|
1640
|
-
|
|
1641
|
-
} else applyState(
|
|
1640
|
+
d && setSignal(d, isWrappable(h) ? wrap(h, i) : h);
|
|
1641
|
+
} else applyState(h, wrap(p, i), n, r);
|
|
1642
1642
|
}
|
|
1643
1643
|
}
|
|
1644
|
-
if ((
|
|
1645
|
-
const t = Object.keys(
|
|
1644
|
+
if ((f = i[J])) {
|
|
1645
|
+
const t = Object.keys(f);
|
|
1646
1646
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
1647
1647
|
const r = t[n];
|
|
1648
|
-
setSignal(
|
|
1648
|
+
setSignal(f[r], r in e);
|
|
1649
1649
|
}
|
|
1650
1650
|
}
|
|
1651
1651
|
}
|
|
@@ -1690,7 +1690,7 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1690
1690
|
i !== r && i !== undefined && reconcile(i, n?.key || "id", n?.all)(s);
|
|
1691
1691
|
});
|
|
1692
1692
|
});
|
|
1693
|
-
r.
|
|
1693
|
+
r.Qe = true;
|
|
1694
1694
|
return { store: s, node: r };
|
|
1695
1695
|
}
|
|
1696
1696
|
function createProjection(e, t = {}, n) {
|
|
@@ -1736,8 +1736,8 @@ const M = Symbol(0),
|
|
|
1736
1736
|
q = Symbol(0),
|
|
1737
1737
|
F = Symbol(0),
|
|
1738
1738
|
V = Symbol(0),
|
|
1739
|
-
|
|
1740
|
-
const
|
|
1739
|
+
D = Symbol(0);
|
|
1740
|
+
const B = new WeakMap();
|
|
1741
1741
|
const G = "v",
|
|
1742
1742
|
K = "o",
|
|
1743
1743
|
z = "x",
|
|
@@ -1790,7 +1790,7 @@ function getNode(e, t, n, r, i = isEqual, s) {
|
|
|
1790
1790
|
},
|
|
1791
1791
|
r
|
|
1792
1792
|
);
|
|
1793
|
-
if (s) o.
|
|
1793
|
+
if (s) o.ge = true;
|
|
1794
1794
|
return (e[t] = o);
|
|
1795
1795
|
}
|
|
1796
1796
|
function trackSelf(e, t = M) {
|
|
@@ -1802,7 +1802,7 @@ function getKeys(e, t, n = true) {
|
|
|
1802
1802
|
const i = new Set(r);
|
|
1803
1803
|
const s = Reflect.ownKeys(t);
|
|
1804
1804
|
for (const e of s) {
|
|
1805
|
-
if (t[e] !==
|
|
1805
|
+
if (t[e] !== D) i.add(e);
|
|
1806
1806
|
else i.delete(e);
|
|
1807
1807
|
}
|
|
1808
1808
|
return Array.from(i);
|
|
@@ -1810,7 +1810,7 @@ function getKeys(e, t, n = true) {
|
|
|
1810
1810
|
function getPropertyDescriptor(e, t, n) {
|
|
1811
1811
|
let r = e;
|
|
1812
1812
|
if (t && n in t) {
|
|
1813
|
-
if (r[n] ===
|
|
1813
|
+
if (r[n] === D) return void 0;
|
|
1814
1814
|
if (!(n in r)) r = t;
|
|
1815
1815
|
}
|
|
1816
1816
|
return Reflect.getOwnPropertyDescriptor(r, n);
|
|
@@ -1836,15 +1836,15 @@ const re = {
|
|
|
1836
1836
|
if (e && e.get) return e.get.call(n);
|
|
1837
1837
|
}
|
|
1838
1838
|
if (writeOnly(n)) {
|
|
1839
|
-
let n = i && (o || !u) ? (i.
|
|
1840
|
-
n ===
|
|
1839
|
+
let n = i && (o || !u) ? (i.fe !== y ? (i.ge ? i.le : i.fe) : i.le) : f[t];
|
|
1840
|
+
n === D && (n = undefined);
|
|
1841
1841
|
if (!isWrappable(n)) return n;
|
|
1842
1842
|
const r = wrap(n, e);
|
|
1843
1843
|
ne?.add(r);
|
|
1844
1844
|
return r;
|
|
1845
1845
|
}
|
|
1846
1846
|
let l = i ? (o || !u ? read(r[t]) : (read(r[t]), f[t])) : f[t];
|
|
1847
|
-
l ===
|
|
1847
|
+
l === D && (l = undefined);
|
|
1848
1848
|
if (!i) {
|
|
1849
1849
|
if (!o && typeof l === "function" && !f.hasOwnProperty(t)) {
|
|
1850
1850
|
let t;
|
|
@@ -1859,7 +1859,7 @@ const re = {
|
|
|
1859
1859
|
},
|
|
1860
1860
|
has(e, t) {
|
|
1861
1861
|
if (t === V || t === M || t === "__proto__") return true;
|
|
1862
|
-
const n = e[z] && t in e[z] ? e[z][t] !==
|
|
1862
|
+
const n = e[z] && t in e[z] ? e[z][t] !== D : e[K] && t in e[K] ? e[K][t] !== D : t in e[G];
|
|
1863
1863
|
getObserver() && read(getNode(getNodes(e, J), t, n, e[Z], isEqual, e[$]));
|
|
1864
1864
|
return n;
|
|
1865
1865
|
},
|
|
@@ -1868,8 +1868,8 @@ const re = {
|
|
|
1868
1868
|
if (writeOnly(r)) {
|
|
1869
1869
|
if (e[$]) {
|
|
1870
1870
|
const t = e[Z];
|
|
1871
|
-
if (t?.
|
|
1872
|
-
|
|
1871
|
+
if (t?.ne) {
|
|
1872
|
+
A.initTransition(t.ne);
|
|
1873
1873
|
}
|
|
1874
1874
|
}
|
|
1875
1875
|
untrack(() => {
|
|
@@ -1886,8 +1886,8 @@ const re = {
|
|
|
1886
1886
|
else (e[u] || (e[u] = Object.create(null)))[t] = l;
|
|
1887
1887
|
const a = isWrappable(l);
|
|
1888
1888
|
if (isWrappable(f)) {
|
|
1889
|
-
const e =
|
|
1890
|
-
e && (e instanceof Set ? e.delete(r) :
|
|
1889
|
+
const e = B.get(f);
|
|
1890
|
+
e && (e instanceof Set ? e.delete(r) : B.delete(f));
|
|
1891
1891
|
}
|
|
1892
1892
|
if (recursivelyNotify(r, ee) && a) recursivelyAddParent(l, r);
|
|
1893
1893
|
e[J]?.[t] && setSignal(e[J][t], true);
|
|
@@ -1907,8 +1907,8 @@ const re = {
|
|
|
1907
1907
|
return true;
|
|
1908
1908
|
},
|
|
1909
1909
|
deleteProperty(e, t) {
|
|
1910
|
-
const n = e[z]?.[t] ===
|
|
1911
|
-
const r = e[K]?.[t] ===
|
|
1910
|
+
const n = e[z]?.[t] === D;
|
|
1911
|
+
const r = e[K]?.[t] === D;
|
|
1912
1912
|
if (writeOnly(e[V]) && !n && !r) {
|
|
1913
1913
|
untrack(() => {
|
|
1914
1914
|
const n = e[$] && !P;
|
|
@@ -1916,13 +1916,13 @@ const re = {
|
|
|
1916
1916
|
if (n) trackOptimisticStore(e[V]);
|
|
1917
1917
|
const i = e[z] && t in e[z] ? e[z][t] : e[K] && t in e[K] ? e[K][t] : e[G][t];
|
|
1918
1918
|
if (t in e[G] || (e[K] && t in e[K])) {
|
|
1919
|
-
(e[r] || (e[r] = Object.create(null)))[t] =
|
|
1919
|
+
(e[r] || (e[r] = Object.create(null)))[t] = D;
|
|
1920
1920
|
} else if (e[r] && t in e[r]) {
|
|
1921
1921
|
delete e[r][t];
|
|
1922
1922
|
} else return true;
|
|
1923
1923
|
if (isWrappable(i)) {
|
|
1924
|
-
const t =
|
|
1925
|
-
t && (t instanceof Set ? t.delete(e) :
|
|
1924
|
+
const t = B.get(i);
|
|
1925
|
+
t && (t instanceof Set ? t.delete(e) : B.delete(i));
|
|
1926
1926
|
}
|
|
1927
1927
|
if (e[J]?.[t]) setSignal(e[J][t], false);
|
|
1928
1928
|
const s = getNodes(e, U);
|
|
@@ -1938,7 +1938,7 @@ const re = {
|
|
|
1938
1938
|
if (e[z]) {
|
|
1939
1939
|
const n = new Set(t);
|
|
1940
1940
|
for (const t of Reflect.ownKeys(e[z])) {
|
|
1941
|
-
if (e[z][t] !==
|
|
1941
|
+
if (e[z][t] !== D) n.add(t);
|
|
1942
1942
|
else n.delete(t);
|
|
1943
1943
|
}
|
|
1944
1944
|
t = Array.from(n);
|
|
@@ -1948,7 +1948,7 @@ const re = {
|
|
|
1948
1948
|
getOwnPropertyDescriptor(e, t) {
|
|
1949
1949
|
if (t === V) return { value: e[V], writable: true, configurable: true };
|
|
1950
1950
|
if (e[z] && t in e[z]) {
|
|
1951
|
-
if (e[z][t] ===
|
|
1951
|
+
if (e[z][t] === D) return undefined;
|
|
1952
1952
|
const n = getPropertyDescriptor(e[G], e[K], t);
|
|
1953
1953
|
if (n) {
|
|
1954
1954
|
return { ...n, value: e[z][t] };
|
|
@@ -2000,7 +2000,7 @@ function recursivelyNotify(e, t) {
|
|
|
2000
2000
|
}
|
|
2001
2001
|
t = n[Y] || t;
|
|
2002
2002
|
}
|
|
2003
|
-
const i =
|
|
2003
|
+
const i = B.get(n?.[G] || e);
|
|
2004
2004
|
if (!i) return r;
|
|
2005
2005
|
if (i instanceof Set) {
|
|
2006
2006
|
for (let e of i) r = recursivelyNotify(e, t) || r;
|
|
@@ -2015,10 +2015,10 @@ function recursivelyAddParent(e, t) {
|
|
|
2015
2015
|
e = r[G];
|
|
2016
2016
|
}
|
|
2017
2017
|
if (t) {
|
|
2018
|
-
let n =
|
|
2019
|
-
if (!n)
|
|
2018
|
+
let n = B.get(e);
|
|
2019
|
+
if (!n) B.set(e, t);
|
|
2020
2020
|
else if (n !== t) {
|
|
2021
|
-
if (!(n instanceof Set))
|
|
2021
|
+
if (!(n instanceof Set)) B.set(e, (n = new Set([n])));
|
|
2022
2022
|
else if (n.has(t)) return;
|
|
2023
2023
|
n.add(t);
|
|
2024
2024
|
} else return;
|
|
@@ -2043,7 +2043,7 @@ function deep(e) {
|
|
|
2043
2043
|
return e[q];
|
|
2044
2044
|
}
|
|
2045
2045
|
function createOptimisticStore(e, t, n) {
|
|
2046
|
-
GlobalQueue.
|
|
2046
|
+
GlobalQueue.J ||= clearOptimisticStore;
|
|
2047
2047
|
const r = typeof e === "function";
|
|
2048
2048
|
const i = (r ? t : e) ?? {};
|
|
2049
2049
|
const s = r ? e : undefined;
|
|
@@ -2060,14 +2060,14 @@ function clearOptimisticStore(e) {
|
|
|
2060
2060
|
if (r) {
|
|
2061
2061
|
for (const e of Reflect.ownKeys(n)) {
|
|
2062
2062
|
if (r[e]) {
|
|
2063
|
-
r[e].
|
|
2063
|
+
r[e].re = undefined;
|
|
2064
2064
|
const n = t[K] && e in t[K] ? t[K][e] : t[G][e];
|
|
2065
|
-
const i = n ===
|
|
2065
|
+
const i = n === D ? undefined : n;
|
|
2066
2066
|
setSignal(r[e], isWrappable(i) ? wrap(i, t) : i);
|
|
2067
2067
|
}
|
|
2068
2068
|
}
|
|
2069
2069
|
if (r[M]) {
|
|
2070
|
-
r[M].
|
|
2070
|
+
r[M].re = undefined;
|
|
2071
2071
|
setSignal(r[M], undefined);
|
|
2072
2072
|
}
|
|
2073
2073
|
}
|
|
@@ -2118,7 +2118,7 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2118
2118
|
setProjectionWriteActive(false);
|
|
2119
2119
|
}
|
|
2120
2120
|
});
|
|
2121
|
-
r.
|
|
2121
|
+
r.Qe = true;
|
|
2122
2122
|
}
|
|
2123
2123
|
return { store: s, node: r };
|
|
2124
2124
|
}
|
|
@@ -2141,7 +2141,7 @@ function snapshot(e, t, n) {
|
|
|
2141
2141
|
const r = s?.length || e.length;
|
|
2142
2142
|
for (let i = 0; i < r; i++) {
|
|
2143
2143
|
f = s && i in s ? s[i] : e[i];
|
|
2144
|
-
if (f ===
|
|
2144
|
+
if (f === D) continue;
|
|
2145
2145
|
if ((u = snapshot(f, t, n)) !== f || o) {
|
|
2146
2146
|
if (!o) t.set(e, (o = [...e]));
|
|
2147
2147
|
o[i] = u;
|
|
@@ -2303,8 +2303,8 @@ function mapArray(e, t, n) {
|
|
|
2303
2303
|
qe: 0,
|
|
2304
2304
|
Fe: e,
|
|
2305
2305
|
Ve: [],
|
|
2306
|
-
|
|
2307
|
-
|
|
2306
|
+
De: t,
|
|
2307
|
+
Be: [],
|
|
2308
2308
|
Ge: [],
|
|
2309
2309
|
Ke: r,
|
|
2310
2310
|
ze: r || n?.keyed === false ? [] : undefined,
|
|
@@ -2325,7 +2325,7 @@ function updateKeyedMap() {
|
|
|
2325
2325
|
? () => {
|
|
2326
2326
|
this.ze[r] = signal(e[r], oe);
|
|
2327
2327
|
this.Ue && (this.Ue[r] = signal(r, oe));
|
|
2328
|
-
return this.
|
|
2328
|
+
return this.De(
|
|
2329
2329
|
read.bind(null, this.ze[r]),
|
|
2330
2330
|
this.Ue ? read.bind(null, this.Ue[r]) : undefined
|
|
2331
2331
|
);
|
|
@@ -2334,31 +2334,31 @@ function updateKeyedMap() {
|
|
|
2334
2334
|
? () => {
|
|
2335
2335
|
const t = e[r];
|
|
2336
2336
|
this.Ue[r] = signal(r, oe);
|
|
2337
|
-
return this.
|
|
2337
|
+
return this.De(() => t, read.bind(null, this.Ue[r]));
|
|
2338
2338
|
}
|
|
2339
2339
|
: () => {
|
|
2340
2340
|
const t = e[r];
|
|
2341
|
-
return this.
|
|
2341
|
+
return this.De(() => t);
|
|
2342
2342
|
};
|
|
2343
2343
|
if (t === 0) {
|
|
2344
2344
|
if (this.qe !== 0) {
|
|
2345
2345
|
this.Me.dispose(false);
|
|
2346
2346
|
this.Ge = [];
|
|
2347
2347
|
this.Ve = [];
|
|
2348
|
-
this.
|
|
2348
|
+
this.Be = [];
|
|
2349
2349
|
this.qe = 0;
|
|
2350
2350
|
this.ze && (this.ze = []);
|
|
2351
2351
|
this.Ue && (this.Ue = []);
|
|
2352
2352
|
}
|
|
2353
|
-
if (this.Je && !this.
|
|
2354
|
-
this.
|
|
2353
|
+
if (this.Je && !this.Be[0]) {
|
|
2354
|
+
this.Be[0] = runWithOwner((this.Ge[0] = createOwner()), this.Je);
|
|
2355
2355
|
}
|
|
2356
2356
|
} else if (this.qe === 0) {
|
|
2357
2357
|
if (this.Ge[0]) this.Ge[0].dispose();
|
|
2358
|
-
this.
|
|
2358
|
+
this.Be = new Array(t);
|
|
2359
2359
|
for (r = 0; r < t; r++) {
|
|
2360
2360
|
this.Ve[r] = e[r];
|
|
2361
|
-
this.
|
|
2361
|
+
this.Be[r] = runWithOwner((this.Ge[r] = createOwner()), i);
|
|
2362
2362
|
}
|
|
2363
2363
|
this.qe = t;
|
|
2364
2364
|
} else {
|
|
@@ -2387,7 +2387,7 @@ function updateKeyedMap() {
|
|
|
2387
2387
|
(this.Ve[o] === e[u] || (this.ze && compare(this.Ke, this.Ve[o], e[u])));
|
|
2388
2388
|
o--, u--
|
|
2389
2389
|
) {
|
|
2390
|
-
d[u] = this.
|
|
2390
|
+
d[u] = this.Be[o];
|
|
2391
2391
|
p[u] = this.Ge[o];
|
|
2392
2392
|
h && (h[u] = this.ze[o]);
|
|
2393
2393
|
y && (y[u] = this.Ue[o]);
|
|
@@ -2406,7 +2406,7 @@ function updateKeyedMap() {
|
|
|
2406
2406
|
l = this.Ke ? this.Ke(f) : f;
|
|
2407
2407
|
r = c.get(l);
|
|
2408
2408
|
if (r !== undefined && r !== -1) {
|
|
2409
|
-
d[r] = this.
|
|
2409
|
+
d[r] = this.Be[n];
|
|
2410
2410
|
p[r] = this.Ge[n];
|
|
2411
2411
|
h && (h[r] = this.ze[n]);
|
|
2412
2412
|
y && (y[r] = this.Ue[n]);
|
|
@@ -2416,7 +2416,7 @@ function updateKeyedMap() {
|
|
|
2416
2416
|
}
|
|
2417
2417
|
for (r = s; r < t; r++) {
|
|
2418
2418
|
if (r in d) {
|
|
2419
|
-
this.
|
|
2419
|
+
this.Be[r] = d[r];
|
|
2420
2420
|
this.Ge[r] = p[r];
|
|
2421
2421
|
if (h) {
|
|
2422
2422
|
this.ze[r] = h[r];
|
|
@@ -2427,14 +2427,14 @@ function updateKeyedMap() {
|
|
|
2427
2427
|
setSignal(this.Ue[r], r);
|
|
2428
2428
|
}
|
|
2429
2429
|
} else {
|
|
2430
|
-
this.
|
|
2430
|
+
this.Be[r] = runWithOwner((this.Ge[r] = createOwner()), i);
|
|
2431
2431
|
}
|
|
2432
2432
|
}
|
|
2433
|
-
this.
|
|
2433
|
+
this.Be = this.Be.slice(0, (this.qe = t));
|
|
2434
2434
|
this.Ve = e.slice(0);
|
|
2435
2435
|
}
|
|
2436
2436
|
});
|
|
2437
|
-
return this.
|
|
2437
|
+
return this.Be;
|
|
2438
2438
|
}
|
|
2439
2439
|
function repeat(e, t, n) {
|
|
2440
2440
|
return updateRepeat.bind({
|
|
@@ -2442,9 +2442,9 @@ function repeat(e, t, n) {
|
|
|
2442
2442
|
qe: 0,
|
|
2443
2443
|
Xe: 0,
|
|
2444
2444
|
Ye: e,
|
|
2445
|
-
|
|
2445
|
+
De: t,
|
|
2446
2446
|
Ge: [],
|
|
2447
|
-
|
|
2447
|
+
Be: [],
|
|
2448
2448
|
Ze: n?.from,
|
|
2449
2449
|
Je: n?.fallback
|
|
2450
2450
|
});
|
|
@@ -2457,11 +2457,11 @@ function updateRepeat() {
|
|
|
2457
2457
|
if (this.qe !== 0) {
|
|
2458
2458
|
this.Me.dispose(false);
|
|
2459
2459
|
this.Ge = [];
|
|
2460
|
-
this.
|
|
2460
|
+
this.Be = [];
|
|
2461
2461
|
this.qe = 0;
|
|
2462
2462
|
}
|
|
2463
|
-
if (this.Je && !this.
|
|
2464
|
-
this.
|
|
2463
|
+
if (this.Je && !this.Be[0]) {
|
|
2464
|
+
this.Be[0] = runWithOwner((this.Ge[0] = createOwner()), this.Je);
|
|
2465
2465
|
}
|
|
2466
2466
|
return;
|
|
2467
2467
|
}
|
|
@@ -2473,147 +2473,96 @@ function updateRepeat() {
|
|
|
2473
2473
|
let e = this.Xe;
|
|
2474
2474
|
while (e < t && e < this.qe) this.Ge[e++].dispose();
|
|
2475
2475
|
this.Ge.splice(0, t - this.Xe);
|
|
2476
|
-
this.
|
|
2476
|
+
this.Be.splice(0, t - this.Xe);
|
|
2477
2477
|
} else if (this.Xe > t) {
|
|
2478
2478
|
let n = r - this.Xe - 1;
|
|
2479
2479
|
let i = this.Xe - t;
|
|
2480
|
-
this.Ge.length = this.
|
|
2480
|
+
this.Ge.length = this.Be.length = e;
|
|
2481
2481
|
while (n >= i) {
|
|
2482
2482
|
this.Ge[n] = this.Ge[n - i];
|
|
2483
|
-
this.
|
|
2483
|
+
this.Be[n] = this.Be[n - i];
|
|
2484
2484
|
n--;
|
|
2485
2485
|
}
|
|
2486
2486
|
for (let e = 0; e < i; e++) {
|
|
2487
|
-
this.
|
|
2487
|
+
this.Be[e] = runWithOwner((this.Ge[e] = createOwner()), () => this.De(e + t));
|
|
2488
2488
|
}
|
|
2489
2489
|
}
|
|
2490
2490
|
for (let e = r; e < n; e++) {
|
|
2491
|
-
this.
|
|
2491
|
+
this.Be[e - t] = runWithOwner((this.Ge[e - t] = createOwner()), () => this.De(e));
|
|
2492
2492
|
}
|
|
2493
|
-
this.
|
|
2493
|
+
this.Be = this.Be.slice(0, e);
|
|
2494
2494
|
this.Xe = t;
|
|
2495
2495
|
this.qe = e;
|
|
2496
2496
|
});
|
|
2497
|
-
return this.
|
|
2497
|
+
return this.Be;
|
|
2498
2498
|
}
|
|
2499
2499
|
function compare(e, t, n) {
|
|
2500
2500
|
return e ? e(t) === e(n) : true;
|
|
2501
2501
|
}
|
|
2502
2502
|
function boundaryComputed(e, t) {
|
|
2503
2503
|
const n = computed(e, undefined, { lazy: true });
|
|
2504
|
-
n.
|
|
2505
|
-
const r = e !== undefined ? e : n.
|
|
2506
|
-
const i = t !== undefined ? t : n.
|
|
2507
|
-
n.
|
|
2508
|
-
n.
|
|
2504
|
+
n.be = (e, t) => {
|
|
2505
|
+
const r = e !== undefined ? e : n.ce;
|
|
2506
|
+
const i = t !== undefined ? t : n.Y;
|
|
2507
|
+
n.ce &= ~n.$e;
|
|
2508
|
+
n.oe.notify(n, n.$e, r, i);
|
|
2509
2509
|
};
|
|
2510
2510
|
n.$e = t;
|
|
2511
|
-
n.
|
|
2511
|
+
n.Qe = true;
|
|
2512
2512
|
recompute(n, true);
|
|
2513
2513
|
return n;
|
|
2514
2514
|
}
|
|
2515
2515
|
function createBoundChildren(e, t, n, r) {
|
|
2516
|
-
const i = e.
|
|
2517
|
-
i.addChild((e.
|
|
2518
|
-
onCleanup(() => i.removeChild(e.
|
|
2516
|
+
const i = e.oe;
|
|
2517
|
+
i.addChild((e.oe = n));
|
|
2518
|
+
onCleanup(() => i.removeChild(e.oe));
|
|
2519
2519
|
return runWithOwner(e, () => {
|
|
2520
2520
|
const e = computed(t);
|
|
2521
2521
|
return boundaryComputed(() => staleValues(() => flatten(read(e))), r);
|
|
2522
2522
|
});
|
|
2523
2523
|
}
|
|
2524
|
-
class
|
|
2524
|
+
class CollectionQueue extends Queue {
|
|
2525
2525
|
et;
|
|
2526
2526
|
tt = new Set();
|
|
2527
|
-
|
|
2527
|
+
nt = signal(false, { pureWrite: true });
|
|
2528
|
+
rt = false;
|
|
2528
2529
|
constructor(e) {
|
|
2529
2530
|
super();
|
|
2530
2531
|
this.et = e;
|
|
2531
2532
|
}
|
|
2532
2533
|
run(e) {
|
|
2533
|
-
if (!e || read(this.
|
|
2534
|
+
if (!e || read(this.nt)) return;
|
|
2534
2535
|
return super.run(e);
|
|
2535
2536
|
}
|
|
2536
2537
|
notify(e, t, n, r) {
|
|
2537
|
-
if (
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
this.$.add(e);
|
|
2541
|
-
t &= ~l;
|
|
2542
|
-
} else if (this.$.delete(e)) t &= ~l;
|
|
2543
|
-
}
|
|
2544
|
-
if (t & c) {
|
|
2545
|
-
if (n & c) {
|
|
2546
|
-
this.tt.add(e);
|
|
2547
|
-
t &= ~c;
|
|
2548
|
-
} else if (this.tt.delete(e)) t &= ~c;
|
|
2549
|
-
}
|
|
2550
|
-
}
|
|
2551
|
-
return t ? super.notify(e, t, n, r ?? e.oe) : true;
|
|
2552
|
-
}
|
|
2553
|
-
}
|
|
2554
|
-
class CollectionQueue extends Queue {
|
|
2555
|
-
nt;
|
|
2556
|
-
rt = new Set();
|
|
2557
|
-
et = signal(false, { pureWrite: true });
|
|
2558
|
-
it = false;
|
|
2559
|
-
constructor(e) {
|
|
2560
|
-
super();
|
|
2561
|
-
this.nt = e;
|
|
2562
|
-
}
|
|
2563
|
-
run(e) {
|
|
2564
|
-
if (!e || read(this.et)) return;
|
|
2565
|
-
return super.run(e);
|
|
2566
|
-
}
|
|
2567
|
-
notify(e, t, n, r) {
|
|
2568
|
-
if (!(t & this.nt) || (this.nt & l && this.it)) return super.notify(e, t, n, r);
|
|
2569
|
-
if (n & this.nt) {
|
|
2570
|
-
const t = r?.t || e.oe?.t;
|
|
2538
|
+
if (!(t & this.et) || (this.et & l && this.rt)) return super.notify(e, t, n, r);
|
|
2539
|
+
if (n & this.et) {
|
|
2540
|
+
const t = r?.source || e.Y?.source;
|
|
2571
2541
|
if (t) {
|
|
2572
|
-
const e = this.
|
|
2573
|
-
this.
|
|
2574
|
-
if (e) setSignal(this.
|
|
2542
|
+
const e = this.tt.size === 0;
|
|
2543
|
+
this.tt.add(t);
|
|
2544
|
+
if (e) setSignal(this.nt, true);
|
|
2575
2545
|
}
|
|
2576
2546
|
}
|
|
2577
|
-
t &= ~this.
|
|
2547
|
+
t &= ~this.et;
|
|
2578
2548
|
return t ? super.notify(e, t, n, r) : true;
|
|
2579
2549
|
}
|
|
2580
2550
|
checkSources() {
|
|
2581
|
-
for (const e of this.
|
|
2582
|
-
if (!(e.
|
|
2583
|
-
}
|
|
2584
|
-
if (!this.rt.size) setSignal(this.et, false);
|
|
2585
|
-
}
|
|
2586
|
-
}
|
|
2587
|
-
var ue;
|
|
2588
|
-
(function (e) {
|
|
2589
|
-
e["VISIBLE"] = "visible";
|
|
2590
|
-
e["HIDDEN"] = "hidden";
|
|
2591
|
-
})(ue || (ue = {}));
|
|
2592
|
-
function createBoundary(e, t) {
|
|
2593
|
-
const n = createOwner();
|
|
2594
|
-
const r = new ConditionalQueue(computed(() => t() === ue.HIDDEN));
|
|
2595
|
-
const i = createBoundChildren(n, e, r, 0);
|
|
2596
|
-
computed(() => {
|
|
2597
|
-
const e = read(r.et);
|
|
2598
|
-
i.$e = e ? c | l : 0;
|
|
2599
|
-
if (!e) {
|
|
2600
|
-
r.$.forEach(e => r.notify(e, l, l, e.oe));
|
|
2601
|
-
r.tt.forEach(e => r.notify(e, c, c, e.oe));
|
|
2602
|
-
r.$.clear();
|
|
2603
|
-
r.tt.clear();
|
|
2551
|
+
for (const e of this.tt) {
|
|
2552
|
+
if (!(e.ce & this.et)) this.tt.delete(e);
|
|
2604
2553
|
}
|
|
2605
|
-
|
|
2606
|
-
|
|
2554
|
+
if (!this.tt.size) setSignal(this.nt, false);
|
|
2555
|
+
}
|
|
2607
2556
|
}
|
|
2608
2557
|
function createCollectionBoundary(e, t, n) {
|
|
2609
2558
|
const r = createOwner();
|
|
2610
2559
|
const i = new CollectionQueue(e);
|
|
2611
2560
|
const s = createBoundChildren(r, t, i, e);
|
|
2612
2561
|
const o = computed(() => {
|
|
2613
|
-
if (!read(i.
|
|
2562
|
+
if (!read(i.nt)) {
|
|
2614
2563
|
const e = read(s);
|
|
2615
|
-
if (!untrack(() => read(i.
|
|
2616
|
-
i.
|
|
2564
|
+
if (!untrack(() => read(i.nt))) {
|
|
2565
|
+
i.rt = true;
|
|
2617
2566
|
return e;
|
|
2618
2567
|
}
|
|
2619
2568
|
}
|
|
@@ -2626,10 +2575,10 @@ function createLoadBoundary(e, t) {
|
|
|
2626
2575
|
}
|
|
2627
2576
|
function createErrorBoundary(e, t) {
|
|
2628
2577
|
return createCollectionBoundary(c, e, e => {
|
|
2629
|
-
let n = e.
|
|
2630
|
-
const r = n.
|
|
2578
|
+
let n = e.tt.values().next().value;
|
|
2579
|
+
const r = n.Y?.cause ?? n.Y;
|
|
2631
2580
|
return t(r, () => {
|
|
2632
|
-
for (const t of e.
|
|
2581
|
+
for (const t of e.tt) recompute(t);
|
|
2633
2582
|
schedule();
|
|
2634
2583
|
});
|
|
2635
2584
|
});
|
|
@@ -2691,7 +2640,6 @@ exports.NoOwnerError = NoOwnerError;
|
|
|
2691
2640
|
exports.NotReadyError = NotReadyError;
|
|
2692
2641
|
exports.SUPPORTS_PROXY = g;
|
|
2693
2642
|
exports.action = action;
|
|
2694
|
-
exports.createBoundary = createBoundary;
|
|
2695
2643
|
exports.createContext = createContext;
|
|
2696
2644
|
exports.createEffect = createEffect;
|
|
2697
2645
|
exports.createErrorBoundary = createErrorBoundary;
|
|
@@ -2699,6 +2647,7 @@ exports.createLoadBoundary = createLoadBoundary;
|
|
|
2699
2647
|
exports.createMemo = createMemo;
|
|
2700
2648
|
exports.createOptimistic = createOptimistic;
|
|
2701
2649
|
exports.createOptimisticStore = createOptimisticStore;
|
|
2650
|
+
exports.createOwner = createOwner;
|
|
2702
2651
|
exports.createProjection = createProjection;
|
|
2703
2652
|
exports.createReaction = createReaction;
|
|
2704
2653
|
exports.createRenderEffect = createRenderEffect;
|