@solidjs/signals 2.0.0-beta.12 → 2.0.0-beta.13
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/README.md +5 -4
- package/dist/dev.js +30 -8
- package/dist/node.cjs +264 -247
- package/dist/prod.js +217 -200
- package/dist/types/boundaries.d.ts +7 -5
- package/dist/types/core/core.d.ts +11 -3
- package/dist/types-cjs/boundaries.d.cts +7 -5
- package/dist/types-cjs/core/core.d.cts +11 -3
- package/package.json +1 -1
package/dist/node.cjs
CHANGED
|
@@ -1291,7 +1291,8 @@ let te = false;
|
|
|
1291
1291
|
let ne = null;
|
|
1292
1292
|
let re = null;
|
|
1293
1293
|
let ie = false;
|
|
1294
|
-
let se =
|
|
1294
|
+
let se = false;
|
|
1295
|
+
let oe = null;
|
|
1295
1296
|
function ownerInSnapshotScope(e) {
|
|
1296
1297
|
while (e) {
|
|
1297
1298
|
if (e.Me) return true;
|
|
@@ -1300,8 +1301,8 @@ function ownerInSnapshotScope(e) {
|
|
|
1300
1301
|
return false;
|
|
1301
1302
|
}
|
|
1302
1303
|
function setSnapshotCapture(e) {
|
|
1303
|
-
|
|
1304
|
-
if (e && !
|
|
1304
|
+
se = e;
|
|
1305
|
+
if (e && !oe) oe = new Set();
|
|
1305
1306
|
}
|
|
1306
1307
|
function markSnapshotScope(e) {
|
|
1307
1308
|
e.Me = true;
|
|
@@ -1333,14 +1334,14 @@ function releaseSubtree(e) {
|
|
|
1333
1334
|
}
|
|
1334
1335
|
}
|
|
1335
1336
|
function clearSnapshots() {
|
|
1336
|
-
if (
|
|
1337
|
-
for (const e of
|
|
1337
|
+
if (oe) {
|
|
1338
|
+
for (const e of oe) {
|
|
1338
1339
|
delete e._e;
|
|
1339
1340
|
delete e[N];
|
|
1340
1341
|
}
|
|
1341
|
-
|
|
1342
|
+
oe = null;
|
|
1342
1343
|
}
|
|
1343
|
-
|
|
1344
|
+
se = false;
|
|
1344
1345
|
}
|
|
1345
1346
|
function recompute(t, n = false) {
|
|
1346
1347
|
const i = t.$;
|
|
@@ -1495,7 +1496,7 @@ function computed(t, n) {
|
|
|
1495
1496
|
(n?.ownedWrite ? d : 0) |
|
|
1496
1497
|
(!ne || n?.lazy ? y : 0) |
|
|
1497
1498
|
(n?.sync ? w : 0) |
|
|
1498
|
-
(
|
|
1499
|
+
(se && ownerInSnapshotScope(ne) ? g : 0),
|
|
1499
1500
|
He: n?.equals != null ? n.equals : isEqual,
|
|
1500
1501
|
Z: n?.unobserved,
|
|
1501
1502
|
Re: null,
|
|
@@ -1536,7 +1537,7 @@ function createEffectNode(e, t, n, r, i, s) {
|
|
|
1536
1537
|
(o ? h : 0) |
|
|
1537
1538
|
(s?.ownedWrite ? d : 0) |
|
|
1538
1539
|
(s?.sync ? w : 0) |
|
|
1539
|
-
(
|
|
1540
|
+
(se && ownerInSnapshotScope(ne) ? g : 0),
|
|
1540
1541
|
He: false,
|
|
1541
1542
|
Z: s?.unobserved,
|
|
1542
1543
|
Re: null,
|
|
@@ -1574,10 +1575,10 @@ function createEffectNode(e, t, n, r, i, s) {
|
|
|
1574
1575
|
$: r,
|
|
1575
1576
|
Fe: i
|
|
1576
1577
|
};
|
|
1577
|
-
setupComputedNode(u,
|
|
1578
|
+
setupComputedNode(u, ue);
|
|
1578
1579
|
return u;
|
|
1579
1580
|
}
|
|
1580
|
-
const
|
|
1581
|
+
const ue = { lazy: true };
|
|
1581
1582
|
function setupComputedNode(e, t) {
|
|
1582
1583
|
e.p = e;
|
|
1583
1584
|
const n = ne?.t ? ne.u : ne;
|
|
@@ -1604,10 +1605,10 @@ function setupComputedNode(e, t) {
|
|
|
1604
1605
|
};
|
|
1605
1606
|
}
|
|
1606
1607
|
!t?.lazy && recompute(e, true);
|
|
1607
|
-
if (
|
|
1608
|
+
if (se && !t?.lazy) {
|
|
1608
1609
|
if (!(e.be & m)) {
|
|
1609
1610
|
e._e = e.ue === undefined ? C : e.ue;
|
|
1610
|
-
|
|
1611
|
+
oe.add(e);
|
|
1611
1612
|
}
|
|
1612
1613
|
}
|
|
1613
1614
|
}
|
|
@@ -1625,9 +1626,9 @@ function signal(e, t, n = null) {
|
|
|
1625
1626
|
Y: x
|
|
1626
1627
|
};
|
|
1627
1628
|
n && (n.N = r);
|
|
1628
|
-
if (
|
|
1629
|
+
if (se && !(r.ye & p) && !((n?.be ?? 0) & m)) {
|
|
1629
1630
|
r._e = e === undefined ? C : e;
|
|
1630
|
-
|
|
1631
|
+
oe.add(r);
|
|
1631
1632
|
}
|
|
1632
1633
|
return r;
|
|
1633
1634
|
}
|
|
@@ -1684,6 +1685,14 @@ function read(e) {
|
|
|
1684
1685
|
const t = e.I;
|
|
1685
1686
|
const n = $;
|
|
1686
1687
|
$ = false;
|
|
1688
|
+
const r = t || e;
|
|
1689
|
+
if (ie && r.be & m && r.be & b) {
|
|
1690
|
+
let t = ne;
|
|
1691
|
+
if (t?.t) t = t.u;
|
|
1692
|
+
if (t && X) link(e, t);
|
|
1693
|
+
$ = n;
|
|
1694
|
+
throw r.we;
|
|
1695
|
+
}
|
|
1687
1696
|
if (t && e.G !== undefined) {
|
|
1688
1697
|
if (e.G !== x && (t.ke || !!(t.be & m))) {
|
|
1689
1698
|
ee = true;
|
|
@@ -1720,7 +1729,7 @@ function read(e) {
|
|
|
1720
1729
|
e._e === undefined &&
|
|
1721
1730
|
M === null &&
|
|
1722
1731
|
re === null &&
|
|
1723
|
-
!
|
|
1732
|
+
!se &&
|
|
1724
1733
|
true
|
|
1725
1734
|
) {
|
|
1726
1735
|
if (t && X) link(e, t);
|
|
@@ -1767,7 +1776,7 @@ function read(e) {
|
|
|
1767
1776
|
return read(e);
|
|
1768
1777
|
} else throw e.we;
|
|
1769
1778
|
}
|
|
1770
|
-
if (
|
|
1779
|
+
if (se && t && t.ye & g) {
|
|
1771
1780
|
const n = e._e;
|
|
1772
1781
|
if (n !== undefined) {
|
|
1773
1782
|
const r = n === C ? undefined : n;
|
|
@@ -1938,19 +1947,24 @@ function latest(e) {
|
|
|
1938
1947
|
te = t;
|
|
1939
1948
|
}
|
|
1940
1949
|
}
|
|
1941
|
-
function isPending(e) {
|
|
1942
|
-
const
|
|
1943
|
-
const
|
|
1950
|
+
function isPending(e, t) {
|
|
1951
|
+
const n = $;
|
|
1952
|
+
const r = ie;
|
|
1953
|
+
const i = ee;
|
|
1954
|
+
const s = t === true;
|
|
1944
1955
|
$ = true;
|
|
1956
|
+
ie = s;
|
|
1945
1957
|
ee = false;
|
|
1946
1958
|
try {
|
|
1947
1959
|
e();
|
|
1948
1960
|
return ee;
|
|
1949
|
-
} catch {
|
|
1961
|
+
} catch (e) {
|
|
1962
|
+
if (s && e instanceof NotReadyError) throw e;
|
|
1950
1963
|
return ee;
|
|
1951
1964
|
} finally {
|
|
1952
|
-
$ =
|
|
1953
|
-
|
|
1965
|
+
$ = n;
|
|
1966
|
+
ie = r;
|
|
1967
|
+
ee = i;
|
|
1954
1968
|
}
|
|
1955
1969
|
}
|
|
1956
1970
|
function refresh(e) {
|
|
@@ -2211,7 +2225,7 @@ function onSettled(e) {
|
|
|
2211
2225
|
});
|
|
2212
2226
|
}
|
|
2213
2227
|
function unwrap(e) {
|
|
2214
|
-
return e?.[
|
|
2228
|
+
return e?.[fe]?.[ge] ?? e;
|
|
2215
2229
|
}
|
|
2216
2230
|
function getOverrideValue(e, t, n, r) {
|
|
2217
2231
|
if (r && n in r) return r[n];
|
|
@@ -2223,19 +2237,19 @@ function getAllKeys(e, t, n) {
|
|
|
2223
2237
|
return Array.from(new Set([...r, ...i]));
|
|
2224
2238
|
}
|
|
2225
2239
|
function applyState(e, t, n) {
|
|
2226
|
-
const r = t?.[
|
|
2240
|
+
const r = t?.[fe];
|
|
2227
2241
|
if (!r) return;
|
|
2228
|
-
if (r[
|
|
2242
|
+
if (r[pe] || r[he]) {
|
|
2229
2243
|
applyStateSlow(e, r, n);
|
|
2230
2244
|
} else {
|
|
2231
2245
|
applyStateFast(e, r, n);
|
|
2232
2246
|
}
|
|
2233
2247
|
}
|
|
2234
2248
|
function applyStateFast(e, t, n) {
|
|
2235
|
-
const r = t[
|
|
2249
|
+
const r = t[de];
|
|
2236
2250
|
if (e === r) return;
|
|
2237
|
-
(t[
|
|
2238
|
-
t[
|
|
2251
|
+
(t[me] || Oe).set(e, t[ce]);
|
|
2252
|
+
t[de] = e;
|
|
2239
2253
|
if (Array.isArray(r)) {
|
|
2240
2254
|
let i = false;
|
|
2241
2255
|
const s = r.length;
|
|
@@ -2260,16 +2274,16 @@ function applyStateFast(e, t, n) {
|
|
|
2260
2274
|
if (l > c || l > f) {
|
|
2261
2275
|
for (u = l; u <= c; u++) {
|
|
2262
2276
|
i = true;
|
|
2263
|
-
t[
|
|
2277
|
+
t[ge][u] && setSignal(t[ge][u], wrap(e[u], t));
|
|
2264
2278
|
}
|
|
2265
2279
|
for (; u < e.length; u++) {
|
|
2266
2280
|
i = true;
|
|
2267
2281
|
const r = wrap(h[u], t);
|
|
2268
|
-
t[
|
|
2282
|
+
t[ge][u] && setSignal(t[ge][u], r);
|
|
2269
2283
|
applyState(e[u], r, n);
|
|
2270
2284
|
}
|
|
2271
|
-
i && t[
|
|
2272
|
-
s !== e.length && t[
|
|
2285
|
+
i && t[ge][le] && setSignal(t[ge][le], void 0);
|
|
2286
|
+
s !== e.length && t[ge].length && setSignal(t[ge].length, e.length);
|
|
2273
2287
|
return;
|
|
2274
2288
|
}
|
|
2275
2289
|
d = new Array(c + 1);
|
|
@@ -2293,27 +2307,27 @@ function applyStateFast(e, t, n) {
|
|
|
2293
2307
|
for (u = l; u < e.length; u++) {
|
|
2294
2308
|
if (u in h) {
|
|
2295
2309
|
const r = wrap(h[u], t);
|
|
2296
|
-
t[
|
|
2310
|
+
t[ge][u] && setSignal(t[ge][u], r);
|
|
2297
2311
|
applyState(e[u], r, n);
|
|
2298
|
-
} else t[
|
|
2312
|
+
} else t[ge][u] && setSignal(t[ge][u], wrap(e[u], t));
|
|
2299
2313
|
}
|
|
2300
2314
|
if (l < e.length) i = true;
|
|
2301
2315
|
} else if (e.length) {
|
|
2302
2316
|
for (let i = 0, s = e.length; i < s; i++) {
|
|
2303
2317
|
const s = r[i];
|
|
2304
|
-
isWrappable(s) ? applyState(e[i], wrap(s, t), n) : t[
|
|
2318
|
+
isWrappable(s) ? applyState(e[i], wrap(s, t), n) : t[ge][i] && setSignal(t[ge][i], e[i]);
|
|
2305
2319
|
}
|
|
2306
2320
|
}
|
|
2307
2321
|
if (s !== e.length) {
|
|
2308
2322
|
i = true;
|
|
2309
|
-
t[
|
|
2323
|
+
t[ge].length && setSignal(t[ge].length, e.length);
|
|
2310
2324
|
}
|
|
2311
|
-
i && t[
|
|
2325
|
+
i && t[ge][le] && setSignal(t[ge][le], void 0);
|
|
2312
2326
|
return;
|
|
2313
2327
|
}
|
|
2314
|
-
let i = t[
|
|
2328
|
+
let i = t[ge];
|
|
2315
2329
|
if (i) {
|
|
2316
|
-
const s = i[
|
|
2330
|
+
const s = i[le];
|
|
2317
2331
|
const o = s ? getAllKeys(r, undefined, e) : Object.keys(i);
|
|
2318
2332
|
for (let u = 0, l = o.length; u < l; u++) {
|
|
2319
2333
|
const l = o[u];
|
|
@@ -2327,7 +2341,7 @@ function applyStateFast(e, t, n) {
|
|
|
2327
2341
|
} else applyState(a, wrap(c, t), n);
|
|
2328
2342
|
}
|
|
2329
2343
|
}
|
|
2330
|
-
if ((i = t[
|
|
2344
|
+
if ((i = t[Se])) {
|
|
2331
2345
|
const t = Object.keys(i);
|
|
2332
2346
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
2333
2347
|
const r = t[n];
|
|
@@ -2336,13 +2350,13 @@ function applyStateFast(e, t, n) {
|
|
|
2336
2350
|
}
|
|
2337
2351
|
}
|
|
2338
2352
|
function applyStateSlow(e, t, n) {
|
|
2339
|
-
const r = t[
|
|
2340
|
-
const i = t[
|
|
2341
|
-
const s = t[
|
|
2342
|
-
let o = t[
|
|
2343
|
-
(t[
|
|
2344
|
-
t[
|
|
2345
|
-
t[
|
|
2353
|
+
const r = t[de];
|
|
2354
|
+
const i = t[pe];
|
|
2355
|
+
const s = t[he];
|
|
2356
|
+
let o = t[ge];
|
|
2357
|
+
(t[me] || Oe).set(e, t[ce]);
|
|
2358
|
+
t[de] = e;
|
|
2359
|
+
t[pe] = undefined;
|
|
2346
2360
|
if (Array.isArray(r)) {
|
|
2347
2361
|
let o = false;
|
|
2348
2362
|
const u = getOverrideValue(r, i, "length", s);
|
|
@@ -2369,16 +2383,16 @@ function applyStateSlow(e, t, n) {
|
|
|
2369
2383
|
if (c > d || c > a) {
|
|
2370
2384
|
for (f = c; f <= d; f++) {
|
|
2371
2385
|
o = true;
|
|
2372
|
-
t[
|
|
2386
|
+
t[ge][f] && setSignal(t[ge][f], wrap(e[f], t));
|
|
2373
2387
|
}
|
|
2374
2388
|
for (; f < e.length; f++) {
|
|
2375
2389
|
o = true;
|
|
2376
2390
|
const r = wrap(S[f], t);
|
|
2377
|
-
t[
|
|
2391
|
+
t[ge][f] && setSignal(t[ge][f], r);
|
|
2378
2392
|
applyState(e[f], r, n);
|
|
2379
2393
|
}
|
|
2380
|
-
o && t[
|
|
2381
|
-
u !== e.length && t[
|
|
2394
|
+
o && t[ge][le] && setSignal(t[ge][le], void 0);
|
|
2395
|
+
u !== e.length && t[ge].length && setSignal(t[ge].length, e.length);
|
|
2382
2396
|
return;
|
|
2383
2397
|
}
|
|
2384
2398
|
h = new Array(d + 1);
|
|
@@ -2402,26 +2416,26 @@ function applyStateSlow(e, t, n) {
|
|
|
2402
2416
|
for (f = c; f < e.length; f++) {
|
|
2403
2417
|
if (f in S) {
|
|
2404
2418
|
const r = wrap(S[f], t);
|
|
2405
|
-
t[
|
|
2419
|
+
t[ge][f] && setSignal(t[ge][f], r);
|
|
2406
2420
|
applyState(e[f], r, n);
|
|
2407
|
-
} else t[
|
|
2421
|
+
} else t[ge][f] && setSignal(t[ge][f], wrap(e[f], t));
|
|
2408
2422
|
}
|
|
2409
2423
|
if (c < e.length) o = true;
|
|
2410
2424
|
} else if (e.length) {
|
|
2411
2425
|
for (let o = 0, u = e.length; o < u; o++) {
|
|
2412
2426
|
const u = getOverrideValue(r, i, o, s);
|
|
2413
|
-
isWrappable(u) ? applyState(e[o], wrap(u, t), n) : t[
|
|
2427
|
+
isWrappable(u) ? applyState(e[o], wrap(u, t), n) : t[ge][o] && setSignal(t[ge][o], e[o]);
|
|
2414
2428
|
}
|
|
2415
2429
|
}
|
|
2416
2430
|
if (u !== e.length) {
|
|
2417
2431
|
o = true;
|
|
2418
|
-
t[
|
|
2432
|
+
t[ge].length && setSignal(t[ge].length, e.length);
|
|
2419
2433
|
}
|
|
2420
|
-
o && t[
|
|
2434
|
+
o && t[ge][le] && setSignal(t[ge][le], void 0);
|
|
2421
2435
|
return;
|
|
2422
2436
|
}
|
|
2423
2437
|
if (o) {
|
|
2424
|
-
const u = o[
|
|
2438
|
+
const u = o[le];
|
|
2425
2439
|
const l = u ? getAllKeys(r, i, e) : Object.keys(o);
|
|
2426
2440
|
for (let f = 0, c = l.length; f < c; f++) {
|
|
2427
2441
|
const c = l[f];
|
|
@@ -2435,7 +2449,7 @@ function applyStateSlow(e, t, n) {
|
|
|
2435
2449
|
} else applyState(p, wrap(d, t), n);
|
|
2436
2450
|
}
|
|
2437
2451
|
}
|
|
2438
|
-
if ((o = t[
|
|
2452
|
+
if ((o = t[Se])) {
|
|
2439
2453
|
const t = Object.keys(o);
|
|
2440
2454
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
2441
2455
|
const r = t[n];
|
|
@@ -2457,9 +2471,9 @@ function createProjectionInternal(e, t, n) {
|
|
|
2457
2471
|
let r;
|
|
2458
2472
|
const i = new WeakMap();
|
|
2459
2473
|
const wrapper = e => {
|
|
2460
|
-
e[
|
|
2461
|
-
e[
|
|
2462
|
-
Object.defineProperty(e,
|
|
2474
|
+
e[we] = wrapProjection;
|
|
2475
|
+
e[me] = i;
|
|
2476
|
+
Object.defineProperty(e, _e, {
|
|
2463
2477
|
get() {
|
|
2464
2478
|
return r;
|
|
2465
2479
|
},
|
|
@@ -2468,8 +2482,8 @@ function createProjectionInternal(e, t, n) {
|
|
|
2468
2482
|
};
|
|
2469
2483
|
const wrapProjection = e => {
|
|
2470
2484
|
if (i.has(e)) return i.get(e);
|
|
2471
|
-
if (e[
|
|
2472
|
-
const t = createStoreProxy(e,
|
|
2485
|
+
if (e[fe]?.[we] === wrapProjection) return e;
|
|
2486
|
+
const t = createStoreProxy(e, xe, wrapper);
|
|
2473
2487
|
i.set(e, t);
|
|
2474
2488
|
return t;
|
|
2475
2489
|
};
|
|
@@ -2557,56 +2571,56 @@ function createWriteTraps(e) {
|
|
|
2557
2571
|
};
|
|
2558
2572
|
return t;
|
|
2559
2573
|
}
|
|
2560
|
-
const
|
|
2561
|
-
le = Symbol(0),
|
|
2574
|
+
const le = Symbol(0),
|
|
2562
2575
|
fe = Symbol(0),
|
|
2563
|
-
ce = Symbol(0)
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
pe = "
|
|
2567
|
-
he = "
|
|
2568
|
-
ge = "
|
|
2569
|
-
Se = "
|
|
2570
|
-
ye = "
|
|
2571
|
-
we = "
|
|
2572
|
-
me = "
|
|
2573
|
-
_e = "
|
|
2574
|
-
|
|
2576
|
+
ce = Symbol(0),
|
|
2577
|
+
ae = Symbol(0);
|
|
2578
|
+
const de = "v",
|
|
2579
|
+
pe = "o",
|
|
2580
|
+
he = "x",
|
|
2581
|
+
ge = "n",
|
|
2582
|
+
Se = "h",
|
|
2583
|
+
ye = "c",
|
|
2584
|
+
we = "w",
|
|
2585
|
+
me = "l",
|
|
2586
|
+
_e = "f",
|
|
2587
|
+
be = "p";
|
|
2588
|
+
function createStoreProxy(e, t = xe, n) {
|
|
2575
2589
|
let r;
|
|
2576
2590
|
if (Array.isArray(e)) {
|
|
2577
2591
|
r = [];
|
|
2578
2592
|
r.v = e;
|
|
2579
2593
|
} else {
|
|
2580
2594
|
r = { v: e };
|
|
2581
|
-
const t = e?.[
|
|
2595
|
+
const t = e?.[fe]?.[de] ?? e;
|
|
2582
2596
|
const n = Object.getPrototypeOf(t);
|
|
2583
2597
|
if (n !== null && n !== Object.prototype) {
|
|
2584
|
-
r[
|
|
2598
|
+
r[ye] = true;
|
|
2585
2599
|
}
|
|
2586
2600
|
}
|
|
2587
2601
|
n && n(r);
|
|
2588
|
-
return (r[
|
|
2602
|
+
return (r[ce] = new Proxy(r, t));
|
|
2589
2603
|
}
|
|
2590
|
-
const
|
|
2604
|
+
const Oe = new WeakMap();
|
|
2591
2605
|
function wrap(e, t) {
|
|
2592
|
-
if (t?.[
|
|
2593
|
-
let n = e[
|
|
2594
|
-
if (!n)
|
|
2606
|
+
if (t?.[we]) return t[we](e, t);
|
|
2607
|
+
let n = e[ce] || Oe.get(e);
|
|
2608
|
+
if (!n) Oe.set(e, (n = createStoreProxy(e)));
|
|
2595
2609
|
return n;
|
|
2596
2610
|
}
|
|
2597
2611
|
function isWrappable(e) {
|
|
2598
2612
|
if (e == null || typeof e !== "object" || Object.isFrozen(e)) return false;
|
|
2599
2613
|
return typeof Node === "undefined" || !(e instanceof Node);
|
|
2600
2614
|
}
|
|
2601
|
-
let
|
|
2615
|
+
let ve = false;
|
|
2602
2616
|
function setWriteOverride(e) {
|
|
2603
|
-
|
|
2617
|
+
ve = e;
|
|
2604
2618
|
}
|
|
2605
2619
|
function writeOnly(e) {
|
|
2606
|
-
return
|
|
2620
|
+
return ve || !!Pe?.has(e);
|
|
2607
2621
|
}
|
|
2608
2622
|
function unwrapStoreValue(e) {
|
|
2609
|
-
return e?.[
|
|
2623
|
+
return e?.[fe]?.[de] ?? e;
|
|
2610
2624
|
}
|
|
2611
2625
|
function hasInheritedAccessor(e, t) {
|
|
2612
2626
|
let n = Object.getPrototypeOf(e);
|
|
@@ -2640,12 +2654,12 @@ function getNode(e, t, n, r, i = isEqual, s, o) {
|
|
|
2640
2654
|
if (o && t in o) {
|
|
2641
2655
|
const e = o[t];
|
|
2642
2656
|
u._e = e === undefined ? C : e;
|
|
2643
|
-
|
|
2657
|
+
oe?.add(u);
|
|
2644
2658
|
}
|
|
2645
2659
|
return (e[t] = u);
|
|
2646
2660
|
}
|
|
2647
|
-
function trackSelf(e, t =
|
|
2648
|
-
getObserver() && read(getNode(getNodes(e,
|
|
2661
|
+
function trackSelf(e, t = le) {
|
|
2662
|
+
getObserver() && read(getNode(getNodes(e, ge), t, undefined, e[_e], false, e[be]));
|
|
2649
2663
|
}
|
|
2650
2664
|
function getKeys(e, t, n = true) {
|
|
2651
2665
|
const r = untrack(() => (n ? Object.keys(e) : Reflect.ownKeys(e)));
|
|
@@ -2653,60 +2667,60 @@ function getKeys(e, t, n = true) {
|
|
|
2653
2667
|
const i = new Set(r);
|
|
2654
2668
|
const s = Reflect.ownKeys(t);
|
|
2655
2669
|
for (const e of s) {
|
|
2656
|
-
if (t[e] !==
|
|
2670
|
+
if (t[e] !== ae) i.add(e);
|
|
2657
2671
|
else i.delete(e);
|
|
2658
2672
|
}
|
|
2659
2673
|
return Array.from(i);
|
|
2660
2674
|
}
|
|
2661
2675
|
function getPropertyDescriptor(e, t, n) {
|
|
2662
2676
|
if (t && n in t) {
|
|
2663
|
-
if (t[n] ===
|
|
2677
|
+
if (t[n] === ae) return void 0;
|
|
2664
2678
|
const r = Reflect.getOwnPropertyDescriptor(t, n);
|
|
2665
2679
|
if (r?.get || r?.set || !(n in e)) return r;
|
|
2666
2680
|
}
|
|
2667
2681
|
return Reflect.getOwnPropertyDescriptor(e, n);
|
|
2668
2682
|
}
|
|
2669
2683
|
function prepareStoreWrite(e, t, n) {
|
|
2670
|
-
if (e[
|
|
2671
|
-
const t = e[
|
|
2684
|
+
if (e[be]) {
|
|
2685
|
+
const t = e[_e];
|
|
2672
2686
|
if (t?.V) {
|
|
2673
2687
|
z.initTransition(t.V);
|
|
2674
2688
|
}
|
|
2675
2689
|
}
|
|
2676
|
-
const r = e[
|
|
2690
|
+
const r = e[de];
|
|
2677
2691
|
const i = r[n];
|
|
2678
|
-
if (
|
|
2692
|
+
if (se && typeof n !== "symbol" && !((e[_e]?.be ?? 0) & m)) {
|
|
2679
2693
|
if (!e[N]) {
|
|
2680
2694
|
e[N] = Object.create(null);
|
|
2681
|
-
|
|
2695
|
+
oe?.add(e);
|
|
2682
2696
|
}
|
|
2683
2697
|
if (!(n in e[N])) {
|
|
2684
2698
|
e[N][n] = i;
|
|
2685
2699
|
}
|
|
2686
2700
|
}
|
|
2687
|
-
const s = e[
|
|
2688
|
-
const o = s ?
|
|
2701
|
+
const s = e[be] && !K;
|
|
2702
|
+
const o = s ? he : pe;
|
|
2689
2703
|
if (s) trackOptimisticStore(t);
|
|
2690
2704
|
return { base: i, overrideKey: o, state: r };
|
|
2691
2705
|
}
|
|
2692
2706
|
function upsertStoreNode(e, t, n, r, i) {
|
|
2693
2707
|
if (t[n]) return t[n];
|
|
2694
2708
|
const s = isWrappable(r) ? wrap(r, e) : r;
|
|
2695
|
-
const o = getNode(t, n, s, e[
|
|
2709
|
+
const o = getNode(t, n, s, e[_e], isEqual, e[be], i);
|
|
2696
2710
|
registerTransientStoreNode(o);
|
|
2697
2711
|
return o;
|
|
2698
2712
|
}
|
|
2699
2713
|
function notifyStoreProperty(e, t, n, r, i, s) {
|
|
2700
|
-
const o = K || e[
|
|
2714
|
+
const o = K || e[be];
|
|
2701
2715
|
const u = n !== "delete";
|
|
2702
|
-
const l = e[
|
|
2716
|
+
const l = e[Se]?.[t];
|
|
2703
2717
|
if (l) {
|
|
2704
2718
|
setSignal(l, u);
|
|
2705
2719
|
} else if (!o && n !== "invalidate" && s !== u) {
|
|
2706
|
-
const n = upsertStoreNode(e, getNodes(e,
|
|
2720
|
+
const n = upsertStoreNode(e, getNodes(e, Se), t, s);
|
|
2707
2721
|
setSignal(n, u);
|
|
2708
2722
|
}
|
|
2709
|
-
const f = getNodes(e,
|
|
2723
|
+
const f = getNodes(e, ge);
|
|
2710
2724
|
if (n === "set") {
|
|
2711
2725
|
if (f[t]) {
|
|
2712
2726
|
setSignal(f[t], () => (isWrappable(r) ? wrap(r, e) : r));
|
|
@@ -2727,43 +2741,43 @@ function notifyStoreProperty(e, t, n, r, i, s) {
|
|
|
2727
2741
|
setSignal(n, undefined);
|
|
2728
2742
|
}
|
|
2729
2743
|
}
|
|
2730
|
-
f[
|
|
2744
|
+
f[le] && setSignal(f[le], undefined);
|
|
2731
2745
|
}
|
|
2732
|
-
let
|
|
2733
|
-
const
|
|
2746
|
+
let Pe = null;
|
|
2747
|
+
const xe = {
|
|
2734
2748
|
get(e, t, n) {
|
|
2735
|
-
if (t ===
|
|
2736
|
-
if (t ===
|
|
2737
|
-
if (t === j) return e[
|
|
2738
|
-
if (t ===
|
|
2749
|
+
if (t === fe) return e;
|
|
2750
|
+
if (t === ce) return n;
|
|
2751
|
+
if (t === j) return e[_e];
|
|
2752
|
+
if (t === le) {
|
|
2739
2753
|
trackSelf(e);
|
|
2740
2754
|
return n;
|
|
2741
2755
|
}
|
|
2742
|
-
const r = getNodes(e,
|
|
2756
|
+
const r = getNodes(e, ge);
|
|
2743
2757
|
const i = r[t];
|
|
2744
|
-
const s = e[
|
|
2758
|
+
const s = e[de];
|
|
2745
2759
|
if (
|
|
2746
2760
|
!i &&
|
|
2747
|
-
!e[de] &&
|
|
2748
2761
|
!e[pe] &&
|
|
2749
|
-
!e[
|
|
2750
|
-
!e[
|
|
2762
|
+
!e[he] &&
|
|
2763
|
+
!e[ye] &&
|
|
2764
|
+
!e[be] &&
|
|
2751
2765
|
!e[N] &&
|
|
2752
|
-
!s[
|
|
2766
|
+
!s[fe] &&
|
|
2753
2767
|
!(t in s) &&
|
|
2754
2768
|
getObserver() &&
|
|
2755
2769
|
!writeOnly(n)
|
|
2756
2770
|
) {
|
|
2757
|
-
return read(getNode(r, t, undefined, e[
|
|
2771
|
+
return read(getNode(r, t, undefined, e[_e]));
|
|
2758
2772
|
}
|
|
2759
|
-
const o = e[
|
|
2760
|
-
const u = o || (e[
|
|
2761
|
-
const l = !!e[
|
|
2762
|
-
const f = o ? e[
|
|
2773
|
+
const o = e[he] && t in e[he];
|
|
2774
|
+
const u = o || (e[pe] && t in e[pe]);
|
|
2775
|
+
const l = !!e[de][fe];
|
|
2776
|
+
const f = o ? e[he] : e[pe] && t in e[pe] ? e[pe] : e[de];
|
|
2763
2777
|
if (!i) {
|
|
2764
2778
|
const r = Object.getOwnPropertyDescriptor(f, t);
|
|
2765
2779
|
if (r && r.get) return r.get.call(n);
|
|
2766
|
-
if (!r && !u && e[
|
|
2780
|
+
if (!r && !u && e[ye]) {
|
|
2767
2781
|
const e = unwrapStoreValue(f);
|
|
2768
2782
|
if (hasInheritedAccessor(e, t)) {
|
|
2769
2783
|
return Reflect.get(f, t, n);
|
|
@@ -2773,59 +2787,59 @@ const Pe = {
|
|
|
2773
2787
|
if (writeOnly(n)) {
|
|
2774
2788
|
let n =
|
|
2775
2789
|
i && (u || !l) ? (i.G !== undefined && i.G !== x ? i.G : i.Y !== x ? i.Y : i.ue) : f[t];
|
|
2776
|
-
n ===
|
|
2790
|
+
n === ae && (n = undefined);
|
|
2777
2791
|
if (!isWrappable(n)) return n;
|
|
2778
2792
|
const r = wrap(n, e);
|
|
2779
|
-
|
|
2793
|
+
Pe?.add(r);
|
|
2780
2794
|
return r;
|
|
2781
2795
|
}
|
|
2782
2796
|
let c = i ? (u || !l ? read(r[t]) : (read(r[t]), f[t])) : f[t];
|
|
2783
|
-
c ===
|
|
2797
|
+
c === ae && (c = undefined);
|
|
2784
2798
|
if (!i) {
|
|
2785
2799
|
if (!u && typeof c === "function" && !f.hasOwnProperty(t)) {
|
|
2786
2800
|
let t;
|
|
2787
|
-
return !Array.isArray(e[
|
|
2801
|
+
return !Array.isArray(e[de]) && (t = Object.getPrototypeOf(e[de])) && t !== Object.prototype
|
|
2788
2802
|
? c.bind(f)
|
|
2789
2803
|
: c;
|
|
2790
2804
|
} else if (getObserver()) {
|
|
2791
|
-
return read(getNode(r, t, isWrappable(c) ? wrap(c, e) : c, e[
|
|
2805
|
+
return read(getNode(r, t, isWrappable(c) ? wrap(c, e) : c, e[_e], isEqual, e[be], e[N]));
|
|
2792
2806
|
}
|
|
2793
2807
|
}
|
|
2794
2808
|
return isWrappable(c) ? wrap(c, e) : c;
|
|
2795
2809
|
},
|
|
2796
2810
|
has(e, t) {
|
|
2797
|
-
if (t ===
|
|
2811
|
+
if (t === ce || t === le || t === "__proto__") return true;
|
|
2798
2812
|
const n =
|
|
2799
|
-
e[
|
|
2800
|
-
if (writeOnly(e[
|
|
2801
|
-
const r = getNodes(e,
|
|
2813
|
+
e[he] && t in e[he] ? e[he][t] !== ae : e[pe] && t in e[pe] ? e[pe][t] !== ae : t in e[de];
|
|
2814
|
+
if (writeOnly(e[ce])) return n;
|
|
2815
|
+
const r = getNodes(e, Se);
|
|
2802
2816
|
if (r[t]) return read(r[t]);
|
|
2803
2817
|
if (getObserver()) {
|
|
2804
|
-
return read(getNode(r, t, n, e[
|
|
2818
|
+
return read(getNode(r, t, n, e[_e], isEqual, e[be]));
|
|
2805
2819
|
}
|
|
2806
2820
|
return n;
|
|
2807
2821
|
},
|
|
2808
2822
|
set(e, t, n) {
|
|
2809
|
-
const r = e[
|
|
2823
|
+
const r = e[ce];
|
|
2810
2824
|
if (writeOnly(r)) {
|
|
2811
2825
|
untrack(() => {
|
|
2812
2826
|
const { base: i, overrideKey: s, state: o } = prepareStoreWrite(e, r, t);
|
|
2813
|
-
const u = e[
|
|
2827
|
+
const u = e[he] && t in e[he] ? e[he][t] : e[pe] && t in e[pe] ? e[pe][t] : i;
|
|
2814
2828
|
const l =
|
|
2815
|
-
e[
|
|
2816
|
-
? e[
|
|
2817
|
-
: e[
|
|
2818
|
-
? e[
|
|
2819
|
-
: t in e[
|
|
2829
|
+
e[he] && t in e[he]
|
|
2830
|
+
? e[he][t] !== ae
|
|
2831
|
+
: e[pe] && t in e[pe]
|
|
2832
|
+
? e[pe][t] !== ae
|
|
2833
|
+
: t in e[de];
|
|
2820
2834
|
const f = unwrapStoreValue(n);
|
|
2821
2835
|
const c = Array.isArray(o) && t !== "length";
|
|
2822
2836
|
const a = c ? parseInt(t) + 1 : 0;
|
|
2823
2837
|
const d =
|
|
2824
2838
|
c &&
|
|
2825
|
-
(e[
|
|
2826
|
-
? e[
|
|
2827
|
-
: e[
|
|
2828
|
-
? e[
|
|
2839
|
+
(e[he] && "length" in e[he]
|
|
2840
|
+
? e[he].length
|
|
2841
|
+
: e[pe] && "length" in e[pe]
|
|
2842
|
+
? e[pe].length
|
|
2829
2843
|
: o.length);
|
|
2830
2844
|
const p = c && a > d ? a : undefined;
|
|
2831
2845
|
if (u === f && p === undefined) return true;
|
|
@@ -2837,10 +2851,10 @@ const Pe = {
|
|
|
2837
2851
|
}
|
|
2838
2852
|
notifyStoreProperty(e, t, "set", f, u, l);
|
|
2839
2853
|
if (Array.isArray(o) && t !== "length" && p !== undefined) {
|
|
2840
|
-
const t = getNodes(e,
|
|
2854
|
+
const t = getNodes(e, ge);
|
|
2841
2855
|
if (t.length) {
|
|
2842
2856
|
setSignal(t.length, p);
|
|
2843
|
-
} else if (!K && !e[
|
|
2857
|
+
} else if (!K && !e[be]) {
|
|
2844
2858
|
const n = upsertStoreNode(e, t, "length", d, e[N]);
|
|
2845
2859
|
setSignal(n, p);
|
|
2846
2860
|
}
|
|
@@ -2851,7 +2865,7 @@ const Pe = {
|
|
|
2851
2865
|
return true;
|
|
2852
2866
|
},
|
|
2853
2867
|
defineProperty(e, t, n) {
|
|
2854
|
-
const r = e[
|
|
2868
|
+
const r = e[ce];
|
|
2855
2869
|
if (writeOnly(r)) {
|
|
2856
2870
|
untrack(() => {
|
|
2857
2871
|
const { base: i, overrideKey: s } = prepareStoreWrite(e, r, t);
|
|
@@ -2864,16 +2878,16 @@ const Pe = {
|
|
|
2864
2878
|
return true;
|
|
2865
2879
|
},
|
|
2866
2880
|
deleteProperty(e, t) {
|
|
2867
|
-
const n = e[
|
|
2868
|
-
const r = e[
|
|
2869
|
-
if (writeOnly(e[
|
|
2881
|
+
const n = e[he]?.[t] === ae;
|
|
2882
|
+
const r = e[pe]?.[t] === ae;
|
|
2883
|
+
if (writeOnly(e[ce]) && !n && !r) {
|
|
2870
2884
|
untrack(() => {
|
|
2871
|
-
const n = e[
|
|
2872
|
-
const r = n ?
|
|
2873
|
-
if (n) trackOptimisticStore(e[
|
|
2874
|
-
const i = e[
|
|
2875
|
-
if (t in e[
|
|
2876
|
-
(e[r] || (e[r] = Object.create(null)))[t] =
|
|
2885
|
+
const n = e[be] && !K;
|
|
2886
|
+
const r = n ? he : pe;
|
|
2887
|
+
if (n) trackOptimisticStore(e[ce]);
|
|
2888
|
+
const i = e[he] && t in e[he] ? e[he][t] : e[pe] && t in e[pe] ? e[pe][t] : e[de][t];
|
|
2889
|
+
if (t in e[de] || (e[pe] && t in e[pe])) {
|
|
2890
|
+
(e[r] || (e[r] = Object.create(null)))[t] = ae;
|
|
2877
2891
|
} else if (e[r] && t in e[r]) {
|
|
2878
2892
|
delete e[r][t];
|
|
2879
2893
|
} else return true;
|
|
@@ -2884,11 +2898,11 @@ const Pe = {
|
|
|
2884
2898
|
},
|
|
2885
2899
|
ownKeys(e) {
|
|
2886
2900
|
trackSelf(e);
|
|
2887
|
-
let t = getKeys(e[
|
|
2888
|
-
if (e[
|
|
2901
|
+
let t = getKeys(e[de], e[pe], false);
|
|
2902
|
+
if (e[he]) {
|
|
2889
2903
|
const n = new Set(t);
|
|
2890
|
-
for (const t of Reflect.ownKeys(e[
|
|
2891
|
-
if (e[
|
|
2904
|
+
for (const t of Reflect.ownKeys(e[he])) {
|
|
2905
|
+
if (e[he][t] !== ae) n.add(t);
|
|
2892
2906
|
else n.delete(t);
|
|
2893
2907
|
}
|
|
2894
2908
|
t = Array.from(n);
|
|
@@ -2896,27 +2910,27 @@ const Pe = {
|
|
|
2896
2910
|
return t;
|
|
2897
2911
|
},
|
|
2898
2912
|
getOwnPropertyDescriptor(e, t) {
|
|
2899
|
-
if (t ===
|
|
2900
|
-
if (e[
|
|
2901
|
-
if (e[
|
|
2902
|
-
const n = Reflect.getOwnPropertyDescriptor(e[
|
|
2903
|
-
if (n?.get || n?.set || !(t in e[
|
|
2904
|
-
const r = getPropertyDescriptor(e[
|
|
2913
|
+
if (t === ce) return { value: e[ce], writable: true, configurable: true };
|
|
2914
|
+
if (e[he] && t in e[he]) {
|
|
2915
|
+
if (e[he][t] === ae) return undefined;
|
|
2916
|
+
const n = Reflect.getOwnPropertyDescriptor(e[he], t);
|
|
2917
|
+
if (n?.get || n?.set || !(t in e[de])) return n;
|
|
2918
|
+
const r = getPropertyDescriptor(e[de], e[pe], t);
|
|
2905
2919
|
if (r) {
|
|
2906
|
-
return { ...r, value: e[
|
|
2920
|
+
return { ...r, value: e[he][t] };
|
|
2907
2921
|
}
|
|
2908
|
-
return { value: e[
|
|
2922
|
+
return { value: e[he][t], writable: true, enumerable: true, configurable: true };
|
|
2909
2923
|
}
|
|
2910
|
-
return getPropertyDescriptor(e[
|
|
2924
|
+
return getPropertyDescriptor(e[de], e[pe], t);
|
|
2911
2925
|
},
|
|
2912
2926
|
getPrototypeOf(e) {
|
|
2913
|
-
return Object.getPrototypeOf(e[
|
|
2927
|
+
return Object.getPrototypeOf(e[de]);
|
|
2914
2928
|
}
|
|
2915
2929
|
};
|
|
2916
2930
|
function storeSetter(e, t) {
|
|
2917
|
-
const n =
|
|
2918
|
-
|
|
2919
|
-
|
|
2931
|
+
const n = Pe;
|
|
2932
|
+
Pe = new Set();
|
|
2933
|
+
Pe.add(e);
|
|
2920
2934
|
try {
|
|
2921
2935
|
const n = t(e);
|
|
2922
2936
|
if (n !== e && n !== undefined) {
|
|
@@ -2932,8 +2946,8 @@ function storeSetter(e, t) {
|
|
|
2932
2946
|
}
|
|
2933
2947
|
}
|
|
2934
2948
|
} finally {
|
|
2935
|
-
|
|
2936
|
-
|
|
2949
|
+
Pe.clear();
|
|
2950
|
+
Pe = n;
|
|
2937
2951
|
}
|
|
2938
2952
|
}
|
|
2939
2953
|
function createStore(e, t, n) {
|
|
@@ -2953,39 +2967,39 @@ function createOptimisticStore(e, t, n) {
|
|
|
2953
2967
|
return [o, e => storeSetter(o, e)];
|
|
2954
2968
|
}
|
|
2955
2969
|
function clearOptimisticStore(e) {
|
|
2956
|
-
const t = e[
|
|
2957
|
-
if (!t || !t[
|
|
2958
|
-
const n = t[
|
|
2959
|
-
const r = t[
|
|
2970
|
+
const t = e[fe];
|
|
2971
|
+
if (!t || !t[he]) return;
|
|
2972
|
+
const n = t[he];
|
|
2973
|
+
const r = t[ge];
|
|
2960
2974
|
setProjectionWriteActive(true);
|
|
2961
2975
|
try {
|
|
2962
2976
|
if (r) {
|
|
2963
2977
|
for (const e of Reflect.ownKeys(n)) {
|
|
2964
2978
|
if (r[e]) {
|
|
2965
2979
|
r[e].H = undefined;
|
|
2966
|
-
const n = t[
|
|
2967
|
-
const i = n ===
|
|
2980
|
+
const n = t[pe] && e in t[pe] ? t[pe][e] : t[de][e];
|
|
2981
|
+
const i = n === ae ? undefined : n;
|
|
2968
2982
|
setSignal(r[e], isWrappable(i) ? wrap(i, t) : i);
|
|
2969
2983
|
}
|
|
2970
2984
|
}
|
|
2971
|
-
if (r[
|
|
2972
|
-
r[
|
|
2973
|
-
setSignal(r[
|
|
2985
|
+
if (r[le]) {
|
|
2986
|
+
r[le].H = undefined;
|
|
2987
|
+
setSignal(r[le], undefined);
|
|
2974
2988
|
}
|
|
2975
2989
|
}
|
|
2976
2990
|
} finally {
|
|
2977
2991
|
setProjectionWriteActive(false);
|
|
2978
2992
|
}
|
|
2979
|
-
delete t[
|
|
2993
|
+
delete t[he];
|
|
2980
2994
|
}
|
|
2981
2995
|
function createOptimisticProjectionInternal(e, t, n) {
|
|
2982
2996
|
let r;
|
|
2983
2997
|
const i = new WeakMap();
|
|
2984
2998
|
const wrapper = e => {
|
|
2985
|
-
e[
|
|
2986
|
-
e[
|
|
2987
|
-
e[
|
|
2988
|
-
Object.defineProperty(e,
|
|
2999
|
+
e[we] = wrapProjection;
|
|
3000
|
+
e[me] = i;
|
|
3001
|
+
e[be] = true;
|
|
3002
|
+
Object.defineProperty(e, _e, {
|
|
2989
3003
|
get() {
|
|
2990
3004
|
return r;
|
|
2991
3005
|
},
|
|
@@ -2994,8 +3008,8 @@ function createOptimisticProjectionInternal(e, t, n) {
|
|
|
2994
3008
|
};
|
|
2995
3009
|
const wrapProjection = e => {
|
|
2996
3010
|
if (i.has(e)) return i.get(e);
|
|
2997
|
-
if (e[
|
|
2998
|
-
const t = createStoreProxy(e,
|
|
3011
|
+
if (e[fe]?.[we] === wrapProjection) return e;
|
|
3012
|
+
const t = createStoreProxy(e, xe, wrapper);
|
|
2999
3013
|
i.set(e, t);
|
|
3000
3014
|
return t;
|
|
3001
3015
|
};
|
|
@@ -3021,7 +3035,7 @@ function createOptimisticProjectionInternal(e, t, n) {
|
|
|
3021
3035
|
}
|
|
3022
3036
|
return { store: s, node: r };
|
|
3023
3037
|
}
|
|
3024
|
-
const
|
|
3038
|
+
const Ce = Symbol(0);
|
|
3025
3039
|
function isPrototypePollutionKey(e) {
|
|
3026
3040
|
return e === "__proto__" || e === "constructor" || e === "prototype";
|
|
3027
3041
|
}
|
|
@@ -3069,7 +3083,7 @@ function updatePath(e, t, n = 0) {
|
|
|
3069
3083
|
if (s === i) return;
|
|
3070
3084
|
}
|
|
3071
3085
|
if (r === undefined && s == undefined) return;
|
|
3072
|
-
if (s ===
|
|
3086
|
+
if (s === Ce) {
|
|
3073
3087
|
delete e[r];
|
|
3074
3088
|
} else if (r === undefined || (isWrappable(i) && isWrappable(s) && !Array.isArray(s))) {
|
|
3075
3089
|
const t = r !== undefined ? e[r] : e;
|
|
@@ -3085,26 +3099,26 @@ function updatePath(e, t, n = 0) {
|
|
|
3085
3099
|
e[r] = s;
|
|
3086
3100
|
}
|
|
3087
3101
|
}
|
|
3088
|
-
const
|
|
3102
|
+
const Ne = Object.assign(
|
|
3089
3103
|
function storePath(...e) {
|
|
3090
3104
|
return t => {
|
|
3091
3105
|
updatePath(t, e);
|
|
3092
3106
|
};
|
|
3093
3107
|
},
|
|
3094
|
-
{ DELETE:
|
|
3108
|
+
{ DELETE: Ce }
|
|
3095
3109
|
);
|
|
3096
3110
|
function snapshotImpl(e, t, n, r) {
|
|
3097
3111
|
let i, s, o, u, l, f;
|
|
3098
3112
|
if (!isWrappable(e)) return e;
|
|
3099
3113
|
if (n && n.has(e)) return n.get(e);
|
|
3100
3114
|
if (!n) n = new Map();
|
|
3101
|
-
if ((i = e[
|
|
3102
|
-
if (t) trackSelf(i,
|
|
3103
|
-
o = i[
|
|
3104
|
-
s = Array.isArray(i[
|
|
3105
|
-
n.set(e, o ? (u = s ? [] : Object.create(Object.getPrototypeOf(i[
|
|
3106
|
-
e = i[
|
|
3107
|
-
r =
|
|
3115
|
+
if ((i = e[fe] || r?.get(e)?.[fe])) {
|
|
3116
|
+
if (t) trackSelf(i, le);
|
|
3117
|
+
o = i[pe];
|
|
3118
|
+
s = Array.isArray(i[de]);
|
|
3119
|
+
n.set(e, o ? (u = s ? [] : Object.create(Object.getPrototypeOf(i[de]))) : i[de]);
|
|
3120
|
+
e = i[de];
|
|
3121
|
+
r = Oe;
|
|
3108
3122
|
} else {
|
|
3109
3123
|
s = Array.isArray(e);
|
|
3110
3124
|
n.set(e, e);
|
|
@@ -3113,7 +3127,7 @@ function snapshotImpl(e, t, n, r) {
|
|
|
3113
3127
|
const s = o?.length || e.length;
|
|
3114
3128
|
for (let c = 0; c < s; c++) {
|
|
3115
3129
|
f = o && c in o ? o[c] : e[c];
|
|
3116
|
-
if (f ===
|
|
3130
|
+
if (f === ae) continue;
|
|
3117
3131
|
if (t && isWrappable(f)) wrap(f, i);
|
|
3118
3132
|
if ((l = snapshotImpl(f, t, n, r)) !== f || u) {
|
|
3119
3133
|
if (!u) n.set(e, (u = [...e]));
|
|
@@ -3148,13 +3162,13 @@ function deep(e) {
|
|
|
3148
3162
|
function trueFn() {
|
|
3149
3163
|
return true;
|
|
3150
3164
|
}
|
|
3151
|
-
const
|
|
3165
|
+
const Ee = {
|
|
3152
3166
|
get(e, t, n) {
|
|
3153
|
-
if (t ===
|
|
3167
|
+
if (t === ce) return n;
|
|
3154
3168
|
return e.get(t);
|
|
3155
3169
|
},
|
|
3156
3170
|
has(e, t) {
|
|
3157
|
-
if (t ===
|
|
3171
|
+
if (t === ce) return true;
|
|
3158
3172
|
return e.has(t);
|
|
3159
3173
|
},
|
|
3160
3174
|
set: trueFn,
|
|
@@ -3177,15 +3191,15 @@ const Ne = {
|
|
|
3177
3191
|
function resolveSource(e) {
|
|
3178
3192
|
return !(e = typeof e === "function" ? e() : e) ? {} : e;
|
|
3179
3193
|
}
|
|
3180
|
-
const
|
|
3194
|
+
const ke = Symbol(0);
|
|
3181
3195
|
function merge(...e) {
|
|
3182
3196
|
if (e.length === 1 && typeof e[0] !== "function") return e[0];
|
|
3183
3197
|
let t = false;
|
|
3184
3198
|
const n = [];
|
|
3185
3199
|
for (let r = 0; r < e.length; r++) {
|
|
3186
3200
|
const i = e[r];
|
|
3187
|
-
t = t || (!!i &&
|
|
3188
|
-
const s = !!i && i[
|
|
3201
|
+
t = t || (!!i && ce in i);
|
|
3202
|
+
const s = !!i && i[ke];
|
|
3189
3203
|
if (s) {
|
|
3190
3204
|
for (let e = 0; e < s.length; e++) n.push(s[e]);
|
|
3191
3205
|
} else n.push(typeof i === "function" ? ((t = true), createMemo(i)) : i);
|
|
@@ -3194,7 +3208,7 @@ function merge(...e) {
|
|
|
3194
3208
|
return new Proxy(
|
|
3195
3209
|
{
|
|
3196
3210
|
get(e) {
|
|
3197
|
-
if (e ===
|
|
3211
|
+
if (e === ke) return n;
|
|
3198
3212
|
for (let t = n.length - 1; t >= 0; t--) {
|
|
3199
3213
|
const r = resolveSource(n[t]);
|
|
3200
3214
|
if (e in r) return r[e];
|
|
@@ -3215,7 +3229,7 @@ function merge(...e) {
|
|
|
3215
3229
|
return [...e];
|
|
3216
3230
|
}
|
|
3217
3231
|
},
|
|
3218
|
-
|
|
3232
|
+
Ee
|
|
3219
3233
|
);
|
|
3220
3234
|
}
|
|
3221
3235
|
const r = Object.create(null);
|
|
@@ -3247,11 +3261,11 @@ function merge(...e) {
|
|
|
3247
3261
|
if (n.get) Object.defineProperty(o, t, n);
|
|
3248
3262
|
else o[t] = n.value;
|
|
3249
3263
|
}
|
|
3250
|
-
o[
|
|
3264
|
+
o[ke] = n;
|
|
3251
3265
|
return o;
|
|
3252
3266
|
}
|
|
3253
3267
|
function omit(e, ...t) {
|
|
3254
|
-
if (E &&
|
|
3268
|
+
if (E && ce in e) {
|
|
3255
3269
|
return new Proxy(
|
|
3256
3270
|
{
|
|
3257
3271
|
get(n) {
|
|
@@ -3264,7 +3278,7 @@ function omit(e, ...t) {
|
|
|
3264
3278
|
return Object.keys(e).filter(e => !t.includes(e));
|
|
3265
3279
|
}
|
|
3266
3280
|
},
|
|
3267
|
-
|
|
3281
|
+
Ee
|
|
3268
3282
|
);
|
|
3269
3283
|
}
|
|
3270
3284
|
const n = {};
|
|
@@ -3303,29 +3317,29 @@ function mapArray(e, t, n) {
|
|
|
3303
3317
|
u.ye &= ~y;
|
|
3304
3318
|
return accessor(u);
|
|
3305
3319
|
}
|
|
3306
|
-
const
|
|
3320
|
+
const je = { ownedWrite: true };
|
|
3307
3321
|
function updateKeyedMap() {
|
|
3308
3322
|
const e = this.Xe() || [],
|
|
3309
3323
|
t = e.length;
|
|
3310
|
-
e[
|
|
3324
|
+
e[le];
|
|
3311
3325
|
runWithOwner(this.Ue, () => {
|
|
3312
3326
|
let n,
|
|
3313
3327
|
r,
|
|
3314
3328
|
i = this.nt
|
|
3315
3329
|
? this.it
|
|
3316
3330
|
? () => {
|
|
3317
|
-
this.nt[r] = signal(e[r],
|
|
3331
|
+
this.nt[r] = signal(e[r], je);
|
|
3318
3332
|
return this.Ze(accessor(this.nt[r]), r);
|
|
3319
3333
|
}
|
|
3320
3334
|
: () => {
|
|
3321
|
-
this.nt[r] = signal(e[r],
|
|
3322
|
-
this.rt && (this.rt[r] = signal(r,
|
|
3335
|
+
this.nt[r] = signal(e[r], je);
|
|
3336
|
+
this.rt && (this.rt[r] = signal(r, je));
|
|
3323
3337
|
return this.Ze(accessor(this.nt[r]), this.rt ? accessor(this.rt[r]) : undefined);
|
|
3324
3338
|
}
|
|
3325
3339
|
: this.rt
|
|
3326
3340
|
? () => {
|
|
3327
3341
|
const t = e[r];
|
|
3328
|
-
this.rt[r] = signal(r,
|
|
3342
|
+
this.rt[r] = signal(r, je);
|
|
3329
3343
|
return this.Ze(t, accessor(this.rt[r]));
|
|
3330
3344
|
}
|
|
3331
3345
|
: () => {
|
|
@@ -3518,9 +3532,9 @@ function createBoundChildren(e, t, n, r) {
|
|
|
3518
3532
|
return boundaryComputed(() => staleValues(() => flatten(read(e))), r);
|
|
3519
3533
|
});
|
|
3520
3534
|
}
|
|
3521
|
-
const
|
|
3522
|
-
const
|
|
3523
|
-
let
|
|
3535
|
+
const We = Symbol();
|
|
3536
|
+
const Re = createContext(null);
|
|
3537
|
+
let Ae = false;
|
|
3524
3538
|
const FALSE_ACCESSOR = () => false;
|
|
3525
3539
|
const SEQUENTIAL_ACCESSOR = () => "sequential";
|
|
3526
3540
|
function isRevealController(e) {
|
|
@@ -3654,17 +3668,18 @@ class CollectionQueue extends Queue {
|
|
|
3654
3668
|
Et;
|
|
3655
3669
|
dt = true;
|
|
3656
3670
|
ht = signal(false, { ownedWrite: true, ze: true });
|
|
3671
|
+
we;
|
|
3657
3672
|
gt = signal(false, { ownedWrite: true, ze: true });
|
|
3658
3673
|
yt;
|
|
3659
3674
|
wt = false;
|
|
3660
3675
|
kt;
|
|
3661
|
-
jt =
|
|
3676
|
+
jt = We;
|
|
3662
3677
|
constructor(e) {
|
|
3663
3678
|
super();
|
|
3664
3679
|
this.Nt = e;
|
|
3665
3680
|
}
|
|
3666
3681
|
run(e) {
|
|
3667
|
-
if (!e || (read(this.ht) && (!
|
|
3682
|
+
if (!e || (read(this.ht) && (!Ae || read(this.gt)))) return;
|
|
3668
3683
|
return super.run(e);
|
|
3669
3684
|
}
|
|
3670
3685
|
notify(e, t, n, r) {
|
|
@@ -3674,7 +3689,7 @@ class CollectionQueue extends Queue {
|
|
|
3674
3689
|
try {
|
|
3675
3690
|
return this.kt();
|
|
3676
3691
|
} catch {
|
|
3677
|
-
return
|
|
3692
|
+
return We;
|
|
3678
3693
|
}
|
|
3679
3694
|
});
|
|
3680
3695
|
if (e !== this.jt) {
|
|
@@ -3694,6 +3709,9 @@ class CollectionQueue extends Queue {
|
|
|
3694
3709
|
const e = this.ct.size === 0;
|
|
3695
3710
|
this.ct.add(t);
|
|
3696
3711
|
if (e) setSignal(this.ht, true);
|
|
3712
|
+
if (this.Nt & _) {
|
|
3713
|
+
setSignal(this.we, t.we?.cause ?? t.we);
|
|
3714
|
+
}
|
|
3697
3715
|
}
|
|
3698
3716
|
}
|
|
3699
3717
|
t &= ~this.Nt;
|
|
@@ -3718,13 +3736,14 @@ class CollectionQueue extends Queue {
|
|
|
3718
3736
|
}
|
|
3719
3737
|
}
|
|
3720
3738
|
}
|
|
3721
|
-
if (
|
|
3739
|
+
if (Ae) this.yt?.evaluate();
|
|
3722
3740
|
}
|
|
3723
3741
|
}
|
|
3724
3742
|
function createCollectionBoundary(e, t, n, r) {
|
|
3725
3743
|
const i = createOwner();
|
|
3726
|
-
if (
|
|
3744
|
+
if (Ae) setContext(Re, null, i);
|
|
3727
3745
|
const s = new CollectionQueue(e);
|
|
3746
|
+
if (e === _) s.we = signal(undefined, { ownedWrite: true, ze: true });
|
|
3728
3747
|
if (r) s.kt = r;
|
|
3729
3748
|
const o = (s.Et = createBoundChildren(i, t, s, e));
|
|
3730
3749
|
untrack(() => {
|
|
@@ -3737,7 +3756,7 @@ function createCollectionBoundary(e, t, n, r) {
|
|
|
3737
3756
|
}
|
|
3738
3757
|
s.dt = t || !!(o.be & e) || o.we instanceof NotReadyError;
|
|
3739
3758
|
});
|
|
3740
|
-
const u =
|
|
3759
|
+
const u = Ae && e === m ? getContext(Re) : null;
|
|
3741
3760
|
if (u) {
|
|
3742
3761
|
s.yt = u;
|
|
3743
3762
|
u.register(s);
|
|
@@ -3749,7 +3768,7 @@ function createCollectionBoundary(e, t, n, r) {
|
|
|
3749
3768
|
const e = read(o);
|
|
3750
3769
|
if (!untrack(() => read(s.ht))) return ((s.wt = true), e);
|
|
3751
3770
|
}
|
|
3752
|
-
if (
|
|
3771
|
+
if (Ae && read(s.gt)) return undefined;
|
|
3753
3772
|
return n(s);
|
|
3754
3773
|
})
|
|
3755
3774
|
);
|
|
@@ -3758,23 +3777,21 @@ function createLoadingBoundary(e, t, n) {
|
|
|
3758
3777
|
return createCollectionBoundary(m, e, () => t(), n?.on);
|
|
3759
3778
|
}
|
|
3760
3779
|
function createErrorBoundary(e, t) {
|
|
3761
|
-
return createCollectionBoundary(_, e, e =>
|
|
3762
|
-
|
|
3763
|
-
const r = n.we?.cause ?? n.we;
|
|
3764
|
-
return t(r, () => {
|
|
3780
|
+
return createCollectionBoundary(_, e, e =>
|
|
3781
|
+
t(accessor(e.we), () => {
|
|
3765
3782
|
for (const t of e.ct) recompute(t);
|
|
3766
3783
|
schedule();
|
|
3767
|
-
})
|
|
3768
|
-
|
|
3784
|
+
})
|
|
3785
|
+
);
|
|
3769
3786
|
}
|
|
3770
3787
|
function createRevealOrder(e, t) {
|
|
3771
|
-
|
|
3788
|
+
Ae = true;
|
|
3772
3789
|
const n = createOwner();
|
|
3773
|
-
const r = getContext(
|
|
3790
|
+
const r = getContext(Re);
|
|
3774
3791
|
const i = t?.order || SEQUENTIAL_ACCESSOR,
|
|
3775
3792
|
s = t?.collapsed || FALSE_ACCESSOR;
|
|
3776
3793
|
const o = new RevealController(i, s);
|
|
3777
|
-
setContext(
|
|
3794
|
+
setContext(Re, o, n);
|
|
3778
3795
|
return runWithOwner(n, () => {
|
|
3779
3796
|
const t = e();
|
|
3780
3797
|
computed(() => {
|
|
@@ -3839,13 +3856,13 @@ function flattenArray(e, t = [], n) {
|
|
|
3839
3856
|
if (r) throw r;
|
|
3840
3857
|
return i;
|
|
3841
3858
|
}
|
|
3842
|
-
const
|
|
3843
|
-
exports.$PROXY =
|
|
3859
|
+
const Ie = undefined;
|
|
3860
|
+
exports.$PROXY = ce;
|
|
3844
3861
|
exports.$REFRESH = j;
|
|
3845
|
-
exports.$TARGET =
|
|
3846
|
-
exports.$TRACK =
|
|
3862
|
+
exports.$TARGET = fe;
|
|
3863
|
+
exports.$TRACK = le;
|
|
3847
3864
|
exports.ContextNotFoundError = ContextNotFoundError;
|
|
3848
|
-
exports.DEV =
|
|
3865
|
+
exports.DEV = Ie;
|
|
3849
3866
|
exports.NoOwnerError = NoOwnerError;
|
|
3850
3867
|
exports.NotReadyError = NotReadyError;
|
|
3851
3868
|
exports.SUPPORTS_PROXY = E;
|
|
@@ -3898,5 +3915,5 @@ exports.runWithOwner = runWithOwner;
|
|
|
3898
3915
|
exports.setContext = setContext;
|
|
3899
3916
|
exports.setSnapshotCapture = setSnapshotCapture;
|
|
3900
3917
|
exports.snapshot = snapshot;
|
|
3901
|
-
exports.storePath =
|
|
3918
|
+
exports.storePath = Ne;
|
|
3902
3919
|
exports.untrack = untrack;
|