@tonyclaw/agent-inspector 3.0.40 → 3.0.41
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/.output/nitro.json +1 -1
- package/.output/public/assets/{CompareDrawer-BEZv_kBv.js → CompareDrawer-D7CEZjaX.js} +1 -1
- package/.output/public/assets/{InspectorPet-ChiA4cY-.js → InspectorPet-CZC5A3d3.js} +1 -1
- package/.output/public/assets/{ProxyViewerContainer-DeEbzT2N.js → ProxyViewerContainer-DoCpLJM1.js} +18 -18
- package/.output/public/assets/{ReplayDialog-CwaZnm2I.js → ReplayDialog-O7zJrccK.js} +1 -1
- package/.output/public/assets/{RequestAnatomy-CF-q-pAd.js → RequestAnatomy-DzJwNU_L.js} +1 -1
- package/.output/public/assets/{ResponseView-B63ljLZR.js → ResponseView-NZExNRvM.js} +1 -1
- package/.output/public/assets/{StreamingChunkSequence-DLEG6OSP.js → StreamingChunkSequence-DXcrVPst.js} +1 -1
- package/.output/public/assets/{_sessionId-DeyIs1qC.js → _sessionId-B5lQVwmL.js} +1 -1
- package/.output/public/assets/{_sessionId-CXIp9Ho8.js → _sessionId-BOAAnQhC.js} +1 -1
- package/.output/public/assets/index-BlSm4bqn.js +76 -0
- package/.output/public/assets/{index-Cu4d716S.js → index-DswDeL6m.js} +1 -1
- package/.output/public/assets/{index-BLB8plMU.js → index-IpdII72q.js} +1 -1
- package/.output/public/assets/{index-BB7PKq5y.js → index-zdDXZ8fd.js} +1 -1
- package/.output/public/assets/{json-viewer-DGNoUded.js → json-viewer-C_vPvztu.js} +1 -1
- package/.output/public/assets/{jszip.min-BWEzkSYW.js → jszip.min-BLbXONM_.js} +1 -1
- package/.output/server/_libs/mistralai__mistralai.mjs +1 -1
- package/.output/server/_libs/modelcontextprotocol__core.mjs +1121 -0
- package/.output/server/_libs/modelcontextprotocol__server.mjs +10827 -11026
- package/.output/server/_libs/tanstack__router-core.mjs +200 -202
- package/.output/server/_libs/tanstack__virtual-core.mjs +37 -37
- package/.output/server/_libs/zod-to-json-schema.mjs +1 -1
- package/.output/server/_libs/zod.mjs +43 -38
- package/.output/server/{_sessionId-WNO01BLN.mjs → _sessionId-BDR3VoGL.mjs} +3 -2
- package/.output/server/{_sessionId-C2SNEFkW.mjs → _sessionId-XMJZJjKn.mjs} +2 -1
- package/.output/server/_ssr/{CompareDrawer-BEcSj30h.mjs → CompareDrawer-Dc10NRP-.mjs} +3 -2
- package/.output/server/_ssr/{InspectorPet-_PYmltfg.mjs → InspectorPet-bAbBl9xU.mjs} +2 -1
- package/.output/server/_ssr/{ProxyViewerContainer-BfcmY57q.mjs → ProxyViewerContainer-C833zSld.mjs} +10 -10
- package/.output/server/_ssr/{ReplayDialog-jyuLGtHe.mjs → ReplayDialog-irE6GkCe.mjs} +5 -4
- package/.output/server/_ssr/{RequestAnatomy-DQbESytq.mjs → RequestAnatomy-CCbfr4bA.mjs} +3 -2
- package/.output/server/_ssr/{ResponseView--51oa9DH.mjs → ResponseView-TE4dZ2zB.mjs} +3 -2
- package/.output/server/_ssr/{StreamingChunkSequence-CAqCHxk1.mjs → StreamingChunkSequence-C3-k9wrY.mjs} +3 -2
- package/.output/server/_ssr/{index-NOjwkApn.mjs → index-CORKk6yP.mjs} +3 -2
- package/.output/server/_ssr/{index-B1yEsvkn.mjs → index-CQt9ZYRA.mjs} +2 -1
- package/.output/server/_ssr/index.mjs +2 -2
- package/.output/server/_ssr/{json-viewer-CHdJjaMG.mjs → json-viewer-CPCoU-8e.mjs} +3 -2
- package/.output/server/_ssr/{router-C5WQ0dD2.mjs → router-CzPRr1HX.mjs} +7 -6
- package/.output/server/{_tanstack-start-manifest_v-DTpuiXMK.mjs → _tanstack-start-manifest_v-BRb947T9.mjs} +1 -1
- package/.output/server/index.mjs +93 -93
- package/package.json +25 -25
- package/.output/public/assets/index-BGsYO6pY.js +0 -76
|
@@ -2121,6 +2121,18 @@ function encodePathParam(value, decoder) {
|
|
|
2121
2121
|
function isNotFound(obj) {
|
|
2122
2122
|
return obj?.isNotFound === true;
|
|
2123
2123
|
}
|
|
2124
|
+
function getSafeSessionStorage() {
|
|
2125
|
+
try {
|
|
2126
|
+
return sessionStorage;
|
|
2127
|
+
} catch {
|
|
2128
|
+
return;
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
2131
|
+
const storageKey = "tsr-scroll-restoration-v1_3";
|
|
2132
|
+
getSafeSessionStorage();
|
|
2133
|
+
const defaultGetScrollRestorationKey = (location) => {
|
|
2134
|
+
return location.state.__TSR_key || location.href;
|
|
2135
|
+
};
|
|
2124
2136
|
function encode(obj, stringify = String) {
|
|
2125
2137
|
const result = new URLSearchParams();
|
|
2126
2138
|
for (const key in obj) {
|
|
@@ -2202,6 +2214,193 @@ function redirect(opts) {
|
|
|
2202
2214
|
function isRedirect(obj) {
|
|
2203
2215
|
return obj instanceof Response && !!obj.options;
|
|
2204
2216
|
}
|
|
2217
|
+
function composeRewrites(rewrites) {
|
|
2218
|
+
return {
|
|
2219
|
+
input: ({ url }) => {
|
|
2220
|
+
for (const rewrite of rewrites) url = executeRewriteInput(rewrite, url);
|
|
2221
|
+
return url;
|
|
2222
|
+
},
|
|
2223
|
+
output: ({ url }) => {
|
|
2224
|
+
for (let i = rewrites.length - 1; i >= 0; i--) url = executeRewriteOutput(rewrites[i], url);
|
|
2225
|
+
return url;
|
|
2226
|
+
}
|
|
2227
|
+
};
|
|
2228
|
+
}
|
|
2229
|
+
function rewriteBasepath(opts) {
|
|
2230
|
+
const trimmedBasepath = trimPath(opts.basepath);
|
|
2231
|
+
const normalizedBasepath = `/${trimmedBasepath}`;
|
|
2232
|
+
const checkBasepath = opts.caseSensitive ? normalizedBasepath : normalizedBasepath.toLowerCase();
|
|
2233
|
+
const checkBasepathWithSlash = `${checkBasepath}/`;
|
|
2234
|
+
return {
|
|
2235
|
+
input: ({ url }) => {
|
|
2236
|
+
const pathname = opts.caseSensitive ? url.pathname : url.pathname.toLowerCase();
|
|
2237
|
+
if (pathname === checkBasepath) url.pathname = "/";
|
|
2238
|
+
else if (pathname.startsWith(checkBasepathWithSlash)) url.pathname = url.pathname.slice(normalizedBasepath.length);
|
|
2239
|
+
return url;
|
|
2240
|
+
},
|
|
2241
|
+
output: ({ url }) => {
|
|
2242
|
+
url.pathname = joinPaths([
|
|
2243
|
+
"/",
|
|
2244
|
+
trimmedBasepath,
|
|
2245
|
+
url.pathname
|
|
2246
|
+
]);
|
|
2247
|
+
return url;
|
|
2248
|
+
}
|
|
2249
|
+
};
|
|
2250
|
+
}
|
|
2251
|
+
function executeRewriteInput(rewrite, url) {
|
|
2252
|
+
const res = rewrite?.input?.({ url });
|
|
2253
|
+
if (res) {
|
|
2254
|
+
if (typeof res === "string") return new URL(res);
|
|
2255
|
+
else if (res instanceof URL) return res;
|
|
2256
|
+
}
|
|
2257
|
+
return url;
|
|
2258
|
+
}
|
|
2259
|
+
function executeRewriteOutput(rewrite, url) {
|
|
2260
|
+
const res = rewrite?.output?.({ url });
|
|
2261
|
+
if (res) {
|
|
2262
|
+
if (typeof res === "string") return new URL(res);
|
|
2263
|
+
else if (res instanceof URL) return res;
|
|
2264
|
+
}
|
|
2265
|
+
return url;
|
|
2266
|
+
}
|
|
2267
|
+
function createNonReactiveMutableStore(initialValue) {
|
|
2268
|
+
let value = initialValue;
|
|
2269
|
+
return {
|
|
2270
|
+
get() {
|
|
2271
|
+
return value;
|
|
2272
|
+
},
|
|
2273
|
+
set(nextOrUpdater) {
|
|
2274
|
+
value = functionalUpdate(nextOrUpdater, value);
|
|
2275
|
+
}
|
|
2276
|
+
};
|
|
2277
|
+
}
|
|
2278
|
+
function createNonReactiveReadonlyStore(read) {
|
|
2279
|
+
return { get() {
|
|
2280
|
+
return read();
|
|
2281
|
+
} };
|
|
2282
|
+
}
|
|
2283
|
+
function createRouterStores(initialState, config) {
|
|
2284
|
+
const { createMutableStore, createReadonlyStore, batch, init } = config;
|
|
2285
|
+
const matchStores = /* @__PURE__ */ new Map();
|
|
2286
|
+
const pendingMatchStores = /* @__PURE__ */ new Map();
|
|
2287
|
+
const cachedMatchStores = /* @__PURE__ */ new Map();
|
|
2288
|
+
const status = createMutableStore(initialState.status);
|
|
2289
|
+
const loadedAt = createMutableStore(initialState.loadedAt);
|
|
2290
|
+
const isLoading = createMutableStore(initialState.isLoading);
|
|
2291
|
+
const isTransitioning = createMutableStore(initialState.isTransitioning);
|
|
2292
|
+
const location = createMutableStore(initialState.location);
|
|
2293
|
+
const resolvedLocation = createMutableStore(initialState.resolvedLocation);
|
|
2294
|
+
const statusCode = createMutableStore(initialState.statusCode);
|
|
2295
|
+
const redirect2 = createMutableStore(initialState.redirect);
|
|
2296
|
+
const matchesId = createMutableStore([]);
|
|
2297
|
+
const pendingIds = createMutableStore([]);
|
|
2298
|
+
const cachedIds = createMutableStore([]);
|
|
2299
|
+
const matches = createReadonlyStore(() => readPoolMatches(matchStores, matchesId.get()));
|
|
2300
|
+
const pendingMatches = createReadonlyStore(() => readPoolMatches(pendingMatchStores, pendingIds.get()));
|
|
2301
|
+
const cachedMatches = createReadonlyStore(() => readPoolMatches(cachedMatchStores, cachedIds.get()));
|
|
2302
|
+
const firstId = createReadonlyStore(() => matchesId.get()[0]);
|
|
2303
|
+
const hasPending = createReadonlyStore(() => matchesId.get().some((matchId) => {
|
|
2304
|
+
return matchStores.get(matchId)?.get().status === "pending";
|
|
2305
|
+
}));
|
|
2306
|
+
const matchRouteDeps = createReadonlyStore(() => ({
|
|
2307
|
+
locationHref: location.get().href,
|
|
2308
|
+
resolvedLocationHref: resolvedLocation.get()?.href,
|
|
2309
|
+
status: status.get()
|
|
2310
|
+
}));
|
|
2311
|
+
const __store = createReadonlyStore(() => ({
|
|
2312
|
+
status: status.get(),
|
|
2313
|
+
loadedAt: loadedAt.get(),
|
|
2314
|
+
isLoading: isLoading.get(),
|
|
2315
|
+
isTransitioning: isTransitioning.get(),
|
|
2316
|
+
matches: matches.get(),
|
|
2317
|
+
location: location.get(),
|
|
2318
|
+
resolvedLocation: resolvedLocation.get(),
|
|
2319
|
+
statusCode: statusCode.get(),
|
|
2320
|
+
redirect: redirect2.get()
|
|
2321
|
+
}));
|
|
2322
|
+
const matchStoreByRouteIdCache = createLRUCache(64);
|
|
2323
|
+
function getRouteMatchStore(routeId) {
|
|
2324
|
+
let cached = matchStoreByRouteIdCache.get(routeId);
|
|
2325
|
+
if (!cached) {
|
|
2326
|
+
cached = createReadonlyStore(() => {
|
|
2327
|
+
const ids = matchesId.get();
|
|
2328
|
+
for (const id of ids) {
|
|
2329
|
+
const matchStore = matchStores.get(id);
|
|
2330
|
+
if (matchStore && matchStore.routeId === routeId) return matchStore.get();
|
|
2331
|
+
}
|
|
2332
|
+
});
|
|
2333
|
+
matchStoreByRouteIdCache.set(routeId, cached);
|
|
2334
|
+
}
|
|
2335
|
+
return cached;
|
|
2336
|
+
}
|
|
2337
|
+
const store = {
|
|
2338
|
+
status,
|
|
2339
|
+
loadedAt,
|
|
2340
|
+
isLoading,
|
|
2341
|
+
isTransitioning,
|
|
2342
|
+
location,
|
|
2343
|
+
resolvedLocation,
|
|
2344
|
+
statusCode,
|
|
2345
|
+
redirect: redirect2,
|
|
2346
|
+
matchesId,
|
|
2347
|
+
pendingIds,
|
|
2348
|
+
cachedIds,
|
|
2349
|
+
matches,
|
|
2350
|
+
pendingMatches,
|
|
2351
|
+
cachedMatches,
|
|
2352
|
+
firstId,
|
|
2353
|
+
hasPending,
|
|
2354
|
+
matchRouteDeps,
|
|
2355
|
+
matchStores,
|
|
2356
|
+
pendingMatchStores,
|
|
2357
|
+
cachedMatchStores,
|
|
2358
|
+
__store,
|
|
2359
|
+
getRouteMatchStore,
|
|
2360
|
+
setMatches,
|
|
2361
|
+
setPending,
|
|
2362
|
+
setCached
|
|
2363
|
+
};
|
|
2364
|
+
setMatches(initialState.matches);
|
|
2365
|
+
init?.(store);
|
|
2366
|
+
function setMatches(nextMatches) {
|
|
2367
|
+
reconcileMatchPool(nextMatches, matchStores, matchesId, createMutableStore, batch);
|
|
2368
|
+
}
|
|
2369
|
+
function setPending(nextMatches) {
|
|
2370
|
+
reconcileMatchPool(nextMatches, pendingMatchStores, pendingIds, createMutableStore, batch);
|
|
2371
|
+
}
|
|
2372
|
+
function setCached(nextMatches) {
|
|
2373
|
+
reconcileMatchPool(nextMatches, cachedMatchStores, cachedIds, createMutableStore, batch);
|
|
2374
|
+
}
|
|
2375
|
+
return store;
|
|
2376
|
+
}
|
|
2377
|
+
function readPoolMatches(pool, ids) {
|
|
2378
|
+
const matches = [];
|
|
2379
|
+
for (const id of ids) {
|
|
2380
|
+
const matchStore = pool.get(id);
|
|
2381
|
+
if (matchStore) matches.push(matchStore.get());
|
|
2382
|
+
}
|
|
2383
|
+
return matches;
|
|
2384
|
+
}
|
|
2385
|
+
function reconcileMatchPool(nextMatches, pool, idStore, createMutableStore, batch) {
|
|
2386
|
+
const nextIds = nextMatches.map((d) => d.id);
|
|
2387
|
+
const nextIdSet = new Set(nextIds);
|
|
2388
|
+
batch(() => {
|
|
2389
|
+
for (const id of pool.keys()) if (!nextIdSet.has(id)) pool.delete(id);
|
|
2390
|
+
for (const nextMatch of nextMatches) {
|
|
2391
|
+
const existing = pool.get(nextMatch.id);
|
|
2392
|
+
if (!existing) {
|
|
2393
|
+
const matchStore = createMutableStore(nextMatch);
|
|
2394
|
+
matchStore.routeId = nextMatch.routeId;
|
|
2395
|
+
pool.set(nextMatch.id, matchStore);
|
|
2396
|
+
continue;
|
|
2397
|
+
}
|
|
2398
|
+
existing.routeId = nextMatch.routeId;
|
|
2399
|
+
if (existing.get() !== nextMatch) existing.set(nextMatch);
|
|
2400
|
+
}
|
|
2401
|
+
if (!arraysEqual(idStore.get(), nextIds)) idStore.set(nextIds);
|
|
2402
|
+
});
|
|
2403
|
+
}
|
|
2205
2404
|
const triggerOnReady = (inner) => {
|
|
2206
2405
|
if (!inner.rendered) {
|
|
2207
2406
|
inner.rendered = true;
|
|
@@ -2836,193 +3035,6 @@ const componentTypes = [
|
|
|
2836
3035
|
"pendingComponent",
|
|
2837
3036
|
"notFoundComponent"
|
|
2838
3037
|
];
|
|
2839
|
-
function composeRewrites(rewrites) {
|
|
2840
|
-
return {
|
|
2841
|
-
input: ({ url }) => {
|
|
2842
|
-
for (const rewrite of rewrites) url = executeRewriteInput(rewrite, url);
|
|
2843
|
-
return url;
|
|
2844
|
-
},
|
|
2845
|
-
output: ({ url }) => {
|
|
2846
|
-
for (let i = rewrites.length - 1; i >= 0; i--) url = executeRewriteOutput(rewrites[i], url);
|
|
2847
|
-
return url;
|
|
2848
|
-
}
|
|
2849
|
-
};
|
|
2850
|
-
}
|
|
2851
|
-
function rewriteBasepath(opts) {
|
|
2852
|
-
const trimmedBasepath = trimPath(opts.basepath);
|
|
2853
|
-
const normalizedBasepath = `/${trimmedBasepath}`;
|
|
2854
|
-
const checkBasepath = opts.caseSensitive ? normalizedBasepath : normalizedBasepath.toLowerCase();
|
|
2855
|
-
const checkBasepathWithSlash = `${checkBasepath}/`;
|
|
2856
|
-
return {
|
|
2857
|
-
input: ({ url }) => {
|
|
2858
|
-
const pathname = opts.caseSensitive ? url.pathname : url.pathname.toLowerCase();
|
|
2859
|
-
if (pathname === checkBasepath) url.pathname = "/";
|
|
2860
|
-
else if (pathname.startsWith(checkBasepathWithSlash)) url.pathname = url.pathname.slice(normalizedBasepath.length);
|
|
2861
|
-
return url;
|
|
2862
|
-
},
|
|
2863
|
-
output: ({ url }) => {
|
|
2864
|
-
url.pathname = joinPaths([
|
|
2865
|
-
"/",
|
|
2866
|
-
trimmedBasepath,
|
|
2867
|
-
url.pathname
|
|
2868
|
-
]);
|
|
2869
|
-
return url;
|
|
2870
|
-
}
|
|
2871
|
-
};
|
|
2872
|
-
}
|
|
2873
|
-
function executeRewriteInput(rewrite, url) {
|
|
2874
|
-
const res = rewrite?.input?.({ url });
|
|
2875
|
-
if (res) {
|
|
2876
|
-
if (typeof res === "string") return new URL(res);
|
|
2877
|
-
else if (res instanceof URL) return res;
|
|
2878
|
-
}
|
|
2879
|
-
return url;
|
|
2880
|
-
}
|
|
2881
|
-
function executeRewriteOutput(rewrite, url) {
|
|
2882
|
-
const res = rewrite?.output?.({ url });
|
|
2883
|
-
if (res) {
|
|
2884
|
-
if (typeof res === "string") return new URL(res);
|
|
2885
|
-
else if (res instanceof URL) return res;
|
|
2886
|
-
}
|
|
2887
|
-
return url;
|
|
2888
|
-
}
|
|
2889
|
-
function createNonReactiveMutableStore(initialValue) {
|
|
2890
|
-
let value = initialValue;
|
|
2891
|
-
return {
|
|
2892
|
-
get() {
|
|
2893
|
-
return value;
|
|
2894
|
-
},
|
|
2895
|
-
set(nextOrUpdater) {
|
|
2896
|
-
value = functionalUpdate(nextOrUpdater, value);
|
|
2897
|
-
}
|
|
2898
|
-
};
|
|
2899
|
-
}
|
|
2900
|
-
function createNonReactiveReadonlyStore(read) {
|
|
2901
|
-
return { get() {
|
|
2902
|
-
return read();
|
|
2903
|
-
} };
|
|
2904
|
-
}
|
|
2905
|
-
function createRouterStores(initialState, config) {
|
|
2906
|
-
const { createMutableStore, createReadonlyStore, batch, init } = config;
|
|
2907
|
-
const matchStores = /* @__PURE__ */ new Map();
|
|
2908
|
-
const pendingMatchStores = /* @__PURE__ */ new Map();
|
|
2909
|
-
const cachedMatchStores = /* @__PURE__ */ new Map();
|
|
2910
|
-
const status = createMutableStore(initialState.status);
|
|
2911
|
-
const loadedAt = createMutableStore(initialState.loadedAt);
|
|
2912
|
-
const isLoading = createMutableStore(initialState.isLoading);
|
|
2913
|
-
const isTransitioning = createMutableStore(initialState.isTransitioning);
|
|
2914
|
-
const location = createMutableStore(initialState.location);
|
|
2915
|
-
const resolvedLocation = createMutableStore(initialState.resolvedLocation);
|
|
2916
|
-
const statusCode = createMutableStore(initialState.statusCode);
|
|
2917
|
-
const redirect2 = createMutableStore(initialState.redirect);
|
|
2918
|
-
const matchesId = createMutableStore([]);
|
|
2919
|
-
const pendingIds = createMutableStore([]);
|
|
2920
|
-
const cachedIds = createMutableStore([]);
|
|
2921
|
-
const matches = createReadonlyStore(() => readPoolMatches(matchStores, matchesId.get()));
|
|
2922
|
-
const pendingMatches = createReadonlyStore(() => readPoolMatches(pendingMatchStores, pendingIds.get()));
|
|
2923
|
-
const cachedMatches = createReadonlyStore(() => readPoolMatches(cachedMatchStores, cachedIds.get()));
|
|
2924
|
-
const firstId = createReadonlyStore(() => matchesId.get()[0]);
|
|
2925
|
-
const hasPending = createReadonlyStore(() => matchesId.get().some((matchId) => {
|
|
2926
|
-
return matchStores.get(matchId)?.get().status === "pending";
|
|
2927
|
-
}));
|
|
2928
|
-
const matchRouteDeps = createReadonlyStore(() => ({
|
|
2929
|
-
locationHref: location.get().href,
|
|
2930
|
-
resolvedLocationHref: resolvedLocation.get()?.href,
|
|
2931
|
-
status: status.get()
|
|
2932
|
-
}));
|
|
2933
|
-
const __store = createReadonlyStore(() => ({
|
|
2934
|
-
status: status.get(),
|
|
2935
|
-
loadedAt: loadedAt.get(),
|
|
2936
|
-
isLoading: isLoading.get(),
|
|
2937
|
-
isTransitioning: isTransitioning.get(),
|
|
2938
|
-
matches: matches.get(),
|
|
2939
|
-
location: location.get(),
|
|
2940
|
-
resolvedLocation: resolvedLocation.get(),
|
|
2941
|
-
statusCode: statusCode.get(),
|
|
2942
|
-
redirect: redirect2.get()
|
|
2943
|
-
}));
|
|
2944
|
-
const matchStoreByRouteIdCache = createLRUCache(64);
|
|
2945
|
-
function getRouteMatchStore(routeId) {
|
|
2946
|
-
let cached = matchStoreByRouteIdCache.get(routeId);
|
|
2947
|
-
if (!cached) {
|
|
2948
|
-
cached = createReadonlyStore(() => {
|
|
2949
|
-
const ids = matchesId.get();
|
|
2950
|
-
for (const id of ids) {
|
|
2951
|
-
const matchStore = matchStores.get(id);
|
|
2952
|
-
if (matchStore && matchStore.routeId === routeId) return matchStore.get();
|
|
2953
|
-
}
|
|
2954
|
-
});
|
|
2955
|
-
matchStoreByRouteIdCache.set(routeId, cached);
|
|
2956
|
-
}
|
|
2957
|
-
return cached;
|
|
2958
|
-
}
|
|
2959
|
-
const store = {
|
|
2960
|
-
status,
|
|
2961
|
-
loadedAt,
|
|
2962
|
-
isLoading,
|
|
2963
|
-
isTransitioning,
|
|
2964
|
-
location,
|
|
2965
|
-
resolvedLocation,
|
|
2966
|
-
statusCode,
|
|
2967
|
-
redirect: redirect2,
|
|
2968
|
-
matchesId,
|
|
2969
|
-
pendingIds,
|
|
2970
|
-
cachedIds,
|
|
2971
|
-
matches,
|
|
2972
|
-
pendingMatches,
|
|
2973
|
-
cachedMatches,
|
|
2974
|
-
firstId,
|
|
2975
|
-
hasPending,
|
|
2976
|
-
matchRouteDeps,
|
|
2977
|
-
matchStores,
|
|
2978
|
-
pendingMatchStores,
|
|
2979
|
-
cachedMatchStores,
|
|
2980
|
-
__store,
|
|
2981
|
-
getRouteMatchStore,
|
|
2982
|
-
setMatches,
|
|
2983
|
-
setPending,
|
|
2984
|
-
setCached
|
|
2985
|
-
};
|
|
2986
|
-
setMatches(initialState.matches);
|
|
2987
|
-
init?.(store);
|
|
2988
|
-
function setMatches(nextMatches) {
|
|
2989
|
-
reconcileMatchPool(nextMatches, matchStores, matchesId, createMutableStore, batch);
|
|
2990
|
-
}
|
|
2991
|
-
function setPending(nextMatches) {
|
|
2992
|
-
reconcileMatchPool(nextMatches, pendingMatchStores, pendingIds, createMutableStore, batch);
|
|
2993
|
-
}
|
|
2994
|
-
function setCached(nextMatches) {
|
|
2995
|
-
reconcileMatchPool(nextMatches, cachedMatchStores, cachedIds, createMutableStore, batch);
|
|
2996
|
-
}
|
|
2997
|
-
return store;
|
|
2998
|
-
}
|
|
2999
|
-
function readPoolMatches(pool, ids) {
|
|
3000
|
-
const matches = [];
|
|
3001
|
-
for (const id of ids) {
|
|
3002
|
-
const matchStore = pool.get(id);
|
|
3003
|
-
if (matchStore) matches.push(matchStore.get());
|
|
3004
|
-
}
|
|
3005
|
-
return matches;
|
|
3006
|
-
}
|
|
3007
|
-
function reconcileMatchPool(nextMatches, pool, idStore, createMutableStore, batch) {
|
|
3008
|
-
const nextIds = nextMatches.map((d) => d.id);
|
|
3009
|
-
const nextIdSet = new Set(nextIds);
|
|
3010
|
-
batch(() => {
|
|
3011
|
-
for (const id of pool.keys()) if (!nextIdSet.has(id)) pool.delete(id);
|
|
3012
|
-
for (const nextMatch of nextMatches) {
|
|
3013
|
-
const existing = pool.get(nextMatch.id);
|
|
3014
|
-
if (!existing) {
|
|
3015
|
-
const matchStore = createMutableStore(nextMatch);
|
|
3016
|
-
matchStore.routeId = nextMatch.routeId;
|
|
3017
|
-
pool.set(nextMatch.id, matchStore);
|
|
3018
|
-
continue;
|
|
3019
|
-
}
|
|
3020
|
-
existing.routeId = nextMatch.routeId;
|
|
3021
|
-
if (existing.get() !== nextMatch) existing.set(nextMatch);
|
|
3022
|
-
}
|
|
3023
|
-
if (!arraysEqual(idStore.get(), nextIds)) idStore.set(nextIds);
|
|
3024
|
-
});
|
|
3025
|
-
}
|
|
3026
3038
|
function getLocationChangeInfo(location, resolvedLocation) {
|
|
3027
3039
|
const fromLocation = resolvedLocation;
|
|
3028
3040
|
const toLocation = location;
|
|
@@ -3034,7 +3046,6 @@ function getLocationChangeInfo(location, resolvedLocation) {
|
|
|
3034
3046
|
hashChanged: fromLocation?.hash !== toLocation.hash
|
|
3035
3047
|
};
|
|
3036
3048
|
}
|
|
3037
|
-
const locationHistoryActions = /* @__PURE__ */ new WeakMap();
|
|
3038
3049
|
var RouterCore = class {
|
|
3039
3050
|
/**
|
|
3040
3051
|
* @deprecated Use the `createRouter` function instead
|
|
@@ -3500,8 +3511,7 @@ var RouterCore = class {
|
|
|
3500
3511
|
this.startTransition(async () => {
|
|
3501
3512
|
try {
|
|
3502
3513
|
this.beforeLoad();
|
|
3503
|
-
if (historyAction)
|
|
3504
|
-
else locationHistoryActions.delete(this.latestLocation);
|
|
3514
|
+
if (historyAction) this._scroll.hash = historyAction === "PUSH" || historyAction === "REPLACE";
|
|
3505
3515
|
const next = this.latestLocation;
|
|
3506
3516
|
const locationChangeInfo = getLocationChangeInfo(next, this.stores.resolvedLocation.get());
|
|
3507
3517
|
if (!this.stores.redirect.get()) this.emit({
|
|
@@ -4115,18 +4125,6 @@ function extractStrictParams(route, accumulatedParams) {
|
|
|
4115
4125
|
Object.assign(accumulatedParams, result);
|
|
4116
4126
|
}
|
|
4117
4127
|
}
|
|
4118
|
-
function getSafeSessionStorage() {
|
|
4119
|
-
try {
|
|
4120
|
-
return sessionStorage;
|
|
4121
|
-
} catch {
|
|
4122
|
-
return;
|
|
4123
|
-
}
|
|
4124
|
-
}
|
|
4125
|
-
const storageKey = "tsr-scroll-restoration-v1_3";
|
|
4126
|
-
getSafeSessionStorage();
|
|
4127
|
-
const defaultGetScrollRestorationKey = (location) => {
|
|
4128
|
-
return location.state.__TSR_key || location.href;
|
|
4129
|
-
};
|
|
4130
4128
|
function getAssetCrossOrigin(assetCrossOrigin, kind) {
|
|
4131
4129
|
if (!assetCrossOrigin) return;
|
|
4132
4130
|
if (typeof assetCrossOrigin === "string") return assetCrossOrigin;
|
|
@@ -439,6 +439,9 @@ class Virtualizer {
|
|
|
439
439
|
this.rafId = null;
|
|
440
440
|
}
|
|
441
441
|
this.scrollState = null;
|
|
442
|
+
this._iosDeferredAdjustment = 0;
|
|
443
|
+
this._iosTouching = false;
|
|
444
|
+
this._iosJustTouchEnded = false;
|
|
442
445
|
this.scrollElement = null;
|
|
443
446
|
this.targetWindow = null;
|
|
444
447
|
};
|
|
@@ -591,33 +594,6 @@ class Virtualizer {
|
|
|
591
594
|
this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset === "function" ? this.options.initialOffset() : this.options.initialOffset);
|
|
592
595
|
return this.scrollOffset;
|
|
593
596
|
};
|
|
594
|
-
this.getFurthestMeasurement = (measurements, index) => {
|
|
595
|
-
const furthestMeasurementsFound = /* @__PURE__ */ new Map();
|
|
596
|
-
const furthestMeasurements = /* @__PURE__ */ new Map();
|
|
597
|
-
for (let m = index - 1; m >= 0; m--) {
|
|
598
|
-
const measurement = measurements[m];
|
|
599
|
-
if (furthestMeasurementsFound.has(measurement.lane)) {
|
|
600
|
-
continue;
|
|
601
|
-
}
|
|
602
|
-
const previousFurthestMeasurement = furthestMeasurements.get(
|
|
603
|
-
measurement.lane
|
|
604
|
-
);
|
|
605
|
-
if (previousFurthestMeasurement == null || measurement.end > previousFurthestMeasurement.end) {
|
|
606
|
-
furthestMeasurements.set(measurement.lane, measurement);
|
|
607
|
-
} else if (measurement.end < previousFurthestMeasurement.end) {
|
|
608
|
-
furthestMeasurementsFound.set(measurement.lane, true);
|
|
609
|
-
}
|
|
610
|
-
if (furthestMeasurementsFound.size === this.options.lanes) {
|
|
611
|
-
break;
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
return furthestMeasurements.size === this.options.lanes ? Array.from(furthestMeasurements.values()).sort((a, b) => {
|
|
615
|
-
if (a.end === b.end) {
|
|
616
|
-
return a.index - b.index;
|
|
617
|
-
}
|
|
618
|
-
return a.end - b.end;
|
|
619
|
-
})[0] : void 0;
|
|
620
|
-
};
|
|
621
597
|
this.getMeasurementOptions = memo(
|
|
622
598
|
() => [
|
|
623
599
|
this.options.count,
|
|
@@ -626,9 +602,10 @@ class Virtualizer {
|
|
|
626
602
|
this.options.getItemKey,
|
|
627
603
|
this.options.enabled,
|
|
628
604
|
this.options.lanes,
|
|
629
|
-
this.options.laneAssignmentMode
|
|
605
|
+
this.options.laneAssignmentMode,
|
|
606
|
+
this.options.gap
|
|
630
607
|
],
|
|
631
|
-
(count, paddingStart, scrollMargin, getItemKey, enabled, lanes, laneAssignmentMode) => {
|
|
608
|
+
(count, paddingStart, scrollMargin, getItemKey, enabled, lanes, laneAssignmentMode, gap) => {
|
|
632
609
|
const lanesChanged = this.prevLanes !== void 0 && this.prevLanes !== lanes;
|
|
633
610
|
if (lanesChanged) {
|
|
634
611
|
this.lanesChangedFlag = true;
|
|
@@ -642,7 +619,8 @@ class Virtualizer {
|
|
|
642
619
|
getItemKey,
|
|
643
620
|
enabled,
|
|
644
621
|
lanes,
|
|
645
|
-
laneAssignmentMode
|
|
622
|
+
laneAssignmentMode,
|
|
623
|
+
gap
|
|
646
624
|
};
|
|
647
625
|
},
|
|
648
626
|
{
|
|
@@ -658,7 +636,8 @@ class Virtualizer {
|
|
|
658
636
|
getItemKey,
|
|
659
637
|
enabled,
|
|
660
638
|
lanes,
|
|
661
|
-
laneAssignmentMode
|
|
639
|
+
laneAssignmentMode,
|
|
640
|
+
gap
|
|
662
641
|
}, _itemSizeCacheVersion) => {
|
|
663
642
|
const itemSizeCache = this.itemSizeCache;
|
|
664
643
|
if (!enabled) {
|
|
@@ -694,7 +673,6 @@ class Virtualizer {
|
|
|
694
673
|
this.lanesSettling = false;
|
|
695
674
|
}
|
|
696
675
|
if (lanes === 1) {
|
|
697
|
-
const gap = this.options.gap;
|
|
698
676
|
const need = count * 2;
|
|
699
677
|
let flat = this._flatMeasurements;
|
|
700
678
|
if (!flat || flat.length < need) {
|
|
@@ -726,10 +704,14 @@ class Virtualizer {
|
|
|
726
704
|
const laneLastIndex = new Array(lanes).fill(
|
|
727
705
|
void 0
|
|
728
706
|
);
|
|
707
|
+
const laneEnds = new Float64Array(lanes);
|
|
708
|
+
let filledLanes = 0;
|
|
729
709
|
for (let m = 0; m < min; m++) {
|
|
730
710
|
const item = measurements[m];
|
|
731
711
|
if (item) {
|
|
712
|
+
if (laneLastIndex[item.lane] === void 0) filledLanes++;
|
|
732
713
|
laneLastIndex[item.lane] = m;
|
|
714
|
+
laneEnds[item.lane] = item.end;
|
|
733
715
|
}
|
|
734
716
|
}
|
|
735
717
|
for (let i = min; i < count; i++) {
|
|
@@ -742,12 +724,28 @@ class Virtualizer {
|
|
|
742
724
|
lane = cachedLane;
|
|
743
725
|
const prevIndex = laneLastIndex[lane];
|
|
744
726
|
const prevInLane = prevIndex !== void 0 ? measurements[prevIndex] : void 0;
|
|
745
|
-
start = prevInLane ? prevInLane.end +
|
|
727
|
+
start = prevInLane ? prevInLane.end + gap : paddingStart + scrollMargin;
|
|
728
|
+
} else if (filledLanes === lanes) {
|
|
729
|
+
let bestLane = 0;
|
|
730
|
+
let bestEnd = laneEnds[0];
|
|
731
|
+
let bestIdx = laneLastIndex[0];
|
|
732
|
+
for (let l = 1; l < lanes; l++) {
|
|
733
|
+
const e = laneEnds[l];
|
|
734
|
+
if (e < bestEnd || e === bestEnd && laneLastIndex[l] < bestIdx) {
|
|
735
|
+
bestLane = l;
|
|
736
|
+
bestEnd = e;
|
|
737
|
+
bestIdx = laneLastIndex[l];
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
lane = bestLane;
|
|
741
|
+
start = bestEnd + gap;
|
|
742
|
+
if (shouldCacheLane) {
|
|
743
|
+
this.laneAssignments.set(i, lane);
|
|
744
|
+
}
|
|
746
745
|
} else {
|
|
747
|
-
|
|
748
|
-
start =
|
|
749
|
-
|
|
750
|
-
if (this.options.lanes > 1 && shouldCacheLane) {
|
|
746
|
+
lane = i % this.options.lanes;
|
|
747
|
+
start = paddingStart + scrollMargin;
|
|
748
|
+
if (shouldCacheLane) {
|
|
751
749
|
this.laneAssignments.set(i, lane);
|
|
752
750
|
}
|
|
753
751
|
}
|
|
@@ -762,7 +760,9 @@ class Virtualizer {
|
|
|
762
760
|
key,
|
|
763
761
|
lane
|
|
764
762
|
};
|
|
763
|
+
if (laneLastIndex[lane] === void 0) filledLanes++;
|
|
765
764
|
laneLastIndex[lane] = i;
|
|
765
|
+
laneEnds[lane] = end;
|
|
766
766
|
}
|
|
767
767
|
this.measurementsCache = measurements;
|
|
768
768
|
return measurements;
|