@benjavicente/angular-router-experimental 1.142.13 → 1.142.15
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/fesm2022/tanstack-angular-router-experimental-experimental.mjs +57 -58
- package/dist/fesm2022/tanstack-angular-router-experimental.mjs +551 -543
- package/dist/types/tanstack-angular-router-experimental-experimental.d.ts +13 -13
- package/dist/types/tanstack-angular-router-experimental.d.ts +13 -13
- package/package.json +3 -5
- package/src/document/install-unified-document-sync.ts +8 -2
- package/src/document/provide-tanstack-body-managed-tags.ts +4 -2
- package/src/document/provide-tanstack-document-title.ts +1 -2
- package/src/document/provide-tanstack-head-managed-tags.ts +4 -2
- package/src/ssr-scroll-restoration.ts +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { batch as e, createAtom as t } from "@tanstack/store";
|
|
2
2
|
import * as n from "@angular/core";
|
|
3
|
-
import { ChangeDetectionStrategy as r,
|
|
4
|
-
import { DOCUMENT as C } from "@angular/common";
|
|
3
|
+
import { ChangeDetectionStrategy as r, DOCUMENT as i, DestroyRef as a, ElementRef as o, EnvironmentInjector as s, InjectionToken as c, Injector as l, Renderer2 as u, ViewContainerRef as d, afterNextRender as f, assertInInjectionContext as p, computed as m, effect as h, inject as g, input as _, inputBinding as v, isDevMode as y, linkedSignal as b, runInInjectionContext as x, signal as S, untracked as C } from "@angular/core";
|
|
5
4
|
//#region ../router-core/dist/esm/utils.js
|
|
6
5
|
function w(e) {
|
|
7
6
|
return e[e.length - 1];
|
|
@@ -91,7 +90,7 @@ function k(e, t, n) {
|
|
|
91
90
|
}
|
|
92
91
|
return !1;
|
|
93
92
|
}
|
|
94
|
-
function
|
|
93
|
+
function ce(e) {
|
|
95
94
|
let t, n, r = new Promise((e, r) => {
|
|
96
95
|
t = e, n = r;
|
|
97
96
|
});
|
|
@@ -101,19 +100,19 @@ function A(e) {
|
|
|
101
100
|
r.status = "rejected", n(e);
|
|
102
101
|
}, r;
|
|
103
102
|
}
|
|
104
|
-
function
|
|
103
|
+
function A(e) {
|
|
105
104
|
return !!(e && typeof e == "object" && typeof e.then == "function");
|
|
106
105
|
}
|
|
107
|
-
function
|
|
106
|
+
function le(e, t) {
|
|
108
107
|
for (let n = e.length - 1; n >= 0; n--) {
|
|
109
108
|
let r = e[n];
|
|
110
109
|
if (t(r)) return r;
|
|
111
110
|
}
|
|
112
111
|
}
|
|
113
|
-
function
|
|
112
|
+
function ue(e) {
|
|
114
113
|
return e.replace(/[\x00-\x1f\x7f]/g, "");
|
|
115
114
|
}
|
|
116
|
-
function
|
|
115
|
+
function de(e) {
|
|
117
116
|
let t;
|
|
118
117
|
try {
|
|
119
118
|
t = decodeURI(e);
|
|
@@ -126,15 +125,15 @@ function ue(e) {
|
|
|
126
125
|
}
|
|
127
126
|
});
|
|
128
127
|
}
|
|
129
|
-
return
|
|
128
|
+
return ue(t);
|
|
130
129
|
}
|
|
131
|
-
var
|
|
130
|
+
var fe = [
|
|
132
131
|
"http:",
|
|
133
132
|
"https:",
|
|
134
133
|
"mailto:",
|
|
135
134
|
"tel:"
|
|
136
135
|
];
|
|
137
|
-
function
|
|
136
|
+
function pe(e, t) {
|
|
138
137
|
if (!e) return !1;
|
|
139
138
|
try {
|
|
140
139
|
let n = new URL(e);
|
|
@@ -143,24 +142,24 @@ function fe(e, t) {
|
|
|
143
142
|
return !1;
|
|
144
143
|
}
|
|
145
144
|
}
|
|
146
|
-
var
|
|
145
|
+
var me = {
|
|
147
146
|
"&": "\\u0026",
|
|
148
147
|
">": "\\u003e",
|
|
149
148
|
"<": "\\u003c",
|
|
150
149
|
"\u2028": "\\u2028",
|
|
151
150
|
"\u2029": "\\u2029"
|
|
152
|
-
},
|
|
153
|
-
function he(e) {
|
|
154
|
-
return e.replace(me, (e) => pe[e]);
|
|
155
|
-
}
|
|
151
|
+
}, he = /[&><\u2028\u2029]/g;
|
|
156
152
|
function ge(e) {
|
|
153
|
+
return e.replace(he, (e) => me[e]);
|
|
154
|
+
}
|
|
155
|
+
function j(e) {
|
|
157
156
|
if (!e || !/[%\\\x00-\x1f\x7f]/.test(e) && !e.startsWith("//")) return {
|
|
158
157
|
path: e,
|
|
159
158
|
handledProtocolRelativeURL: !1
|
|
160
159
|
};
|
|
161
160
|
let t = /%25|%5C/gi, n = 0, r = "", i;
|
|
162
|
-
for (; (i = t.exec(e)) !== null;) r +=
|
|
163
|
-
r +=
|
|
161
|
+
for (; (i = t.exec(e)) !== null;) r += de(e.slice(n, i.index)) + i[0], n = t.lastIndex;
|
|
162
|
+
r += de(n ? e.slice(n) : e);
|
|
164
163
|
let a = !1;
|
|
165
164
|
return r.startsWith("//") && (a = !0, r = "/" + r.replace(/^\/+/, "")), {
|
|
166
165
|
path: r,
|
|
@@ -183,7 +182,7 @@ function ye() {
|
|
|
183
182
|
}
|
|
184
183
|
//#endregion
|
|
185
184
|
//#region ../router-core/dist/esm/lru-cache.js
|
|
186
|
-
function
|
|
185
|
+
function M(e) {
|
|
187
186
|
let t = /* @__PURE__ */ new Map(), n, r, i = (e) => {
|
|
188
187
|
e.next && (e.prev ? (e.prev.next = e.next, e.next.prev = e.prev, e.next = void 0, r && (r.next = e, e.prev = r)) : (e.next.prev = void 0, n = e.next, e.next = void 0, r && (e.prev = r, r.next = e)), r = e);
|
|
189
188
|
};
|
|
@@ -215,14 +214,14 @@ function be(e) {
|
|
|
215
214
|
}
|
|
216
215
|
//#endregion
|
|
217
216
|
//#region ../router-core/dist/esm/new-process-route-tree.js
|
|
218
|
-
var
|
|
219
|
-
function
|
|
217
|
+
var N = 4, be = 5;
|
|
218
|
+
function xe(e) {
|
|
220
219
|
let t = e.indexOf("{");
|
|
221
220
|
if (t === -1) return null;
|
|
222
221
|
let n = e.indexOf("}", t);
|
|
223
222
|
return n === -1 || t + 1 >= e.length ? null : [t, n];
|
|
224
223
|
}
|
|
225
|
-
function
|
|
224
|
+
function Se(e, t, n = new Uint16Array(6)) {
|
|
226
225
|
let r = e.indexOf("/", t), i = r === -1 ? e.length : r, a = e.substring(t, i);
|
|
227
226
|
if (!a || !a.includes("$")) return n[0] = 0, n[1] = t, n[2] = t, n[3] = i, n[4] = i, n[5] = i, n;
|
|
228
227
|
if (a === "$") {
|
|
@@ -230,7 +229,7 @@ function Ce(e, t, n = new Uint16Array(6)) {
|
|
|
230
229
|
return n[0] = 2, n[1] = t, n[2] = t, n[3] = r, n[4] = r, n[5] = r, n;
|
|
231
230
|
}
|
|
232
231
|
if (a.charCodeAt(0) === 36) return n[0] = 1, n[1] = t, n[2] = t + 1, n[3] = i, n[4] = i, n[5] = i, n;
|
|
233
|
-
let o =
|
|
232
|
+
let o = xe(a);
|
|
234
233
|
if (o) {
|
|
235
234
|
let [r, s] = o, c = a.charCodeAt(r + 1);
|
|
236
235
|
if (c === 45) {
|
|
@@ -245,13 +244,13 @@ function Ce(e, t, n = new Uint16Array(6)) {
|
|
|
245
244
|
}
|
|
246
245
|
return n[0] = 0, n[1] = t, n[2] = t, n[3] = i, n[4] = i, n[5] = i, n;
|
|
247
246
|
}
|
|
248
|
-
function
|
|
247
|
+
function Ce(e, t, n, r, i, a, o) {
|
|
249
248
|
o?.(n);
|
|
250
249
|
let s = r;
|
|
251
250
|
{
|
|
252
251
|
let r = n.fullPath ?? n.from, o = r.length, c = n.options?.caseSensitive ?? e, l = n.options?.params?.parse ?? n.options?.parseParams;
|
|
253
252
|
for (; s < o;) {
|
|
254
|
-
let e =
|
|
253
|
+
let e = Se(r, s, t), o, u = s, d = e[5];
|
|
255
254
|
switch (s = d + 1, a++, e[0]) {
|
|
256
255
|
case 0: {
|
|
257
256
|
let t = r.substring(e[2], e[3]);
|
|
@@ -260,7 +259,7 @@ function we(e, t, n, r, i, a, o) {
|
|
|
260
259
|
if (e) o = e;
|
|
261
260
|
else {
|
|
262
261
|
i.static ??= /* @__PURE__ */ new Map();
|
|
263
|
-
let e =
|
|
262
|
+
let e = F(n.fullPath ?? n.from);
|
|
264
263
|
e.parent = i, e.depth = a, o = e, i.static.set(t, e);
|
|
265
264
|
}
|
|
266
265
|
} else {
|
|
@@ -268,7 +267,7 @@ function we(e, t, n, r, i, a, o) {
|
|
|
268
267
|
if (r) o = r;
|
|
269
268
|
else {
|
|
270
269
|
i.staticInsensitive ??= /* @__PURE__ */ new Map();
|
|
271
|
-
let t =
|
|
270
|
+
let t = F(n.fullPath ?? n.from);
|
|
272
271
|
t.parent = i, t.depth = a, o = t, i.staticInsensitive.set(e, t);
|
|
273
272
|
}
|
|
274
273
|
}
|
|
@@ -278,7 +277,7 @@ function we(e, t, n, r, i, a, o) {
|
|
|
278
277
|
let t = r.substring(u, e[1]), s = r.substring(e[4], d), f = c && !!(t || s), p = t ? f ? t : t.toLowerCase() : void 0, m = s ? f ? s : s.toLowerCase() : void 0, h = !l && i.dynamic?.find((e) => !e.parse && e.caseSensitive === f && e.prefix === p && e.suffix === m);
|
|
279
278
|
if (h) o = h;
|
|
280
279
|
else {
|
|
281
|
-
let e =
|
|
280
|
+
let e = Te(1, n.fullPath ?? n.from, f, p, m);
|
|
282
281
|
o = e, e.depth = a, e.parent = i, i.dynamic ??= [], i.dynamic.push(e);
|
|
283
282
|
}
|
|
284
283
|
break;
|
|
@@ -287,32 +286,32 @@ function we(e, t, n, r, i, a, o) {
|
|
|
287
286
|
let t = r.substring(u, e[1]), s = r.substring(e[4], d), f = c && !!(t || s), p = t ? f ? t : t.toLowerCase() : void 0, m = s ? f ? s : s.toLowerCase() : void 0, h = !l && i.optional?.find((e) => !e.parse && e.caseSensitive === f && e.prefix === p && e.suffix === m);
|
|
288
287
|
if (h) o = h;
|
|
289
288
|
else {
|
|
290
|
-
let e =
|
|
289
|
+
let e = Te(3, n.fullPath ?? n.from, f, p, m);
|
|
291
290
|
o = e, e.parent = i, e.depth = a, i.optional ??= [], i.optional.push(e);
|
|
292
291
|
}
|
|
293
292
|
break;
|
|
294
293
|
}
|
|
295
294
|
case 2: {
|
|
296
|
-
let t = r.substring(u, e[1]), s = r.substring(e[4], d), l = c && !!(t || s), f = t ? l ? t : t.toLowerCase() : void 0, p = s ? l ? s : s.toLowerCase() : void 0, m =
|
|
295
|
+
let t = r.substring(u, e[1]), s = r.substring(e[4], d), l = c && !!(t || s), f = t ? l ? t : t.toLowerCase() : void 0, p = s ? l ? s : s.toLowerCase() : void 0, m = Te(2, n.fullPath ?? n.from, l, f, p);
|
|
297
296
|
o = m, m.parent = i, m.depth = a, i.wildcard ??= [], i.wildcard.push(m);
|
|
298
297
|
}
|
|
299
298
|
}
|
|
300
299
|
i = o;
|
|
301
300
|
}
|
|
302
301
|
if (l && n.children && !n.isRoot && n.id && n.id.charCodeAt(n.id.lastIndexOf("/") + 1) === 95) {
|
|
303
|
-
let e =
|
|
304
|
-
e.kind =
|
|
302
|
+
let e = F(n.fullPath ?? n.from);
|
|
303
|
+
e.kind = be, e.parent = i, a++, e.depth = a, i.pathless ??= [], i.pathless.push(e), i = e;
|
|
305
304
|
}
|
|
306
305
|
let u = (n.path || !n.children) && !n.isRoot;
|
|
307
306
|
if (u && r.endsWith("/")) {
|
|
308
|
-
let e =
|
|
309
|
-
e.kind =
|
|
307
|
+
let e = F(n.fullPath ?? n.from);
|
|
308
|
+
e.kind = N, e.parent = i, a++, e.depth = a, i.index = e, i = e;
|
|
310
309
|
}
|
|
311
310
|
i.parse = l ?? null, u && !i.route && (i.route = n, i.fullPath = n.fullPath ?? n.from);
|
|
312
311
|
}
|
|
313
|
-
if (n.children) for (let r of n.children)
|
|
312
|
+
if (n.children) for (let r of n.children) Ce(e, t, r, s, i, a, o);
|
|
314
313
|
}
|
|
315
|
-
function
|
|
314
|
+
function we(e, t) {
|
|
316
315
|
if (e.parse && !t.parse) return -1;
|
|
317
316
|
if (!e.parse && t.parse) return 1;
|
|
318
317
|
if (e.prefix && t.prefix && e.prefix !== t.prefix) {
|
|
@@ -325,24 +324,24 @@ function Te(e, t) {
|
|
|
325
324
|
}
|
|
326
325
|
return e.prefix && !t.prefix ? -1 : !e.prefix && t.prefix ? 1 : e.suffix && !t.suffix ? -1 : !e.suffix && t.suffix ? 1 : e.caseSensitive && !t.caseSensitive ? -1 : !e.caseSensitive && t.caseSensitive ? 1 : 0;
|
|
327
326
|
}
|
|
328
|
-
function
|
|
329
|
-
if (e.pathless) for (let t of e.pathless)
|
|
330
|
-
if (e.static) for (let t of e.static.values())
|
|
331
|
-
if (e.staticInsensitive) for (let t of e.staticInsensitive.values())
|
|
327
|
+
function P(e) {
|
|
328
|
+
if (e.pathless) for (let t of e.pathless) P(t);
|
|
329
|
+
if (e.static) for (let t of e.static.values()) P(t);
|
|
330
|
+
if (e.staticInsensitive) for (let t of e.staticInsensitive.values()) P(t);
|
|
332
331
|
if (e.dynamic?.length) {
|
|
333
|
-
e.dynamic.sort(
|
|
334
|
-
for (let t of e.dynamic)
|
|
332
|
+
e.dynamic.sort(we);
|
|
333
|
+
for (let t of e.dynamic) P(t);
|
|
335
334
|
}
|
|
336
335
|
if (e.optional?.length) {
|
|
337
|
-
e.optional.sort(
|
|
338
|
-
for (let t of e.optional)
|
|
336
|
+
e.optional.sort(we);
|
|
337
|
+
for (let t of e.optional) P(t);
|
|
339
338
|
}
|
|
340
339
|
if (e.wildcard?.length) {
|
|
341
|
-
e.wildcard.sort(
|
|
342
|
-
for (let t of e.wildcard)
|
|
340
|
+
e.wildcard.sort(we);
|
|
341
|
+
for (let t of e.wildcard) P(t);
|
|
343
342
|
}
|
|
344
343
|
}
|
|
345
|
-
function
|
|
344
|
+
function F(e) {
|
|
346
345
|
return {
|
|
347
346
|
kind: 0,
|
|
348
347
|
depth: 0,
|
|
@@ -359,7 +358,7 @@ function P(e) {
|
|
|
359
358
|
parse: null
|
|
360
359
|
};
|
|
361
360
|
}
|
|
362
|
-
function
|
|
361
|
+
function Te(e, t, n, r, i) {
|
|
363
362
|
return {
|
|
364
363
|
kind: e,
|
|
365
364
|
depth: 0,
|
|
@@ -379,56 +378,56 @@ function Ee(e, t, n, r, i) {
|
|
|
379
378
|
suffix: i
|
|
380
379
|
};
|
|
381
380
|
}
|
|
382
|
-
function
|
|
383
|
-
let n =
|
|
384
|
-
for (let t of e)
|
|
385
|
-
|
|
381
|
+
function Ee(e, t) {
|
|
382
|
+
let n = F("/"), r = new Uint16Array(6);
|
|
383
|
+
for (let t of e) Ce(!1, r, t, 1, n, 0);
|
|
384
|
+
P(n), t.masksTree = n, t.flatCache = M(1e3);
|
|
386
385
|
}
|
|
387
|
-
function
|
|
386
|
+
function De(e, t) {
|
|
388
387
|
e ||= "/";
|
|
389
388
|
let n = t.flatCache.get(e);
|
|
390
389
|
if (n) return n;
|
|
391
|
-
let r =
|
|
390
|
+
let r = Me(e, t.masksTree);
|
|
392
391
|
return t.flatCache.set(e, r), r;
|
|
393
392
|
}
|
|
394
|
-
function
|
|
393
|
+
function Oe(e, t, n, r, i) {
|
|
395
394
|
e ||= "/", r ||= "/";
|
|
396
395
|
let a = t ? `case\0${e}` : e, o = i.singleCache.get(a);
|
|
397
|
-
return o || (o =
|
|
396
|
+
return o || (o = F("/"), Ce(t, new Uint16Array(6), { from: e }, 1, o, 0), i.singleCache.set(a, o)), Me(r, o, n);
|
|
398
397
|
}
|
|
399
|
-
function
|
|
398
|
+
function ke(e, t, n = !1) {
|
|
400
399
|
let r = n ? e : `nofuzz\0${e}`, i = t.matchCache.get(r);
|
|
401
400
|
if (i !== void 0) return i;
|
|
402
401
|
e ||= "/";
|
|
403
402
|
let a;
|
|
404
403
|
try {
|
|
405
|
-
a =
|
|
404
|
+
a = Me(e, t.segmentTree, n);
|
|
406
405
|
} catch (e) {
|
|
407
406
|
if (e instanceof URIError) a = null;
|
|
408
407
|
else throw e;
|
|
409
408
|
}
|
|
410
|
-
return a && (a.branch =
|
|
409
|
+
return a && (a.branch = Pe(a.route)), t.matchCache.set(r, a), a;
|
|
411
410
|
}
|
|
412
|
-
function
|
|
411
|
+
function Ae(e) {
|
|
413
412
|
return e === "/" ? e : e.replace(/\/{1,}$/, "");
|
|
414
413
|
}
|
|
415
|
-
function
|
|
416
|
-
let r =
|
|
417
|
-
return
|
|
414
|
+
function je(e, t = !1, n) {
|
|
415
|
+
let r = F(e.fullPath), i = new Uint16Array(6), a = {}, o = {}, s = 0;
|
|
416
|
+
return Ce(t, i, e, 1, r, 0, (e) => {
|
|
418
417
|
if (n?.(e, s), e.id in a) {
|
|
419
418
|
if (process.env.NODE_ENV !== "production") throw Error(`Invariant failed: Duplicate routes found with id: ${String(e.id)}`);
|
|
420
419
|
ye();
|
|
421
420
|
}
|
|
422
421
|
if (a[e.id] = e, s !== 0 && e.path) {
|
|
423
|
-
let t =
|
|
422
|
+
let t = Ae(e.fullPath);
|
|
424
423
|
(!o[t] || e.fullPath.endsWith("/")) && (o[t] = e);
|
|
425
424
|
}
|
|
426
425
|
s++;
|
|
427
|
-
}),
|
|
426
|
+
}), P(r), {
|
|
428
427
|
processedTree: {
|
|
429
428
|
segmentTree: r,
|
|
430
|
-
singleCache:
|
|
431
|
-
matchCache:
|
|
429
|
+
singleCache: M(1e3),
|
|
430
|
+
matchCache: M(1e3),
|
|
432
431
|
flatCache: null,
|
|
433
432
|
masksTree: null
|
|
434
433
|
},
|
|
@@ -436,21 +435,21 @@ function Me(e, t = !1, n) {
|
|
|
436
435
|
routesByPath: o
|
|
437
436
|
};
|
|
438
437
|
}
|
|
439
|
-
function
|
|
440
|
-
let r = e.split("/"), i =
|
|
438
|
+
function Me(e, t, n = !1) {
|
|
439
|
+
let r = e.split("/"), i = Ie(e, r, t, n);
|
|
441
440
|
if (!i) return null;
|
|
442
|
-
let [a] =
|
|
441
|
+
let [a] = Ne(e, r, i);
|
|
443
442
|
return {
|
|
444
443
|
route: i.node.route,
|
|
445
444
|
rawParams: a
|
|
446
445
|
};
|
|
447
446
|
}
|
|
448
|
-
function
|
|
449
|
-
let r =
|
|
447
|
+
function Ne(e, t, n) {
|
|
448
|
+
let r = Fe(n.node), i = null, a = Object.create(null), o = n.extract?.part ?? 0, s = n.extract?.node ?? 0, c = n.extract?.path ?? 0, l = n.extract?.segment ?? 0;
|
|
450
449
|
for (; s < r.length; o++, s++, c++, l++) {
|
|
451
450
|
let u = r[s];
|
|
452
|
-
if (u.kind ===
|
|
453
|
-
if (u.kind ===
|
|
451
|
+
if (u.kind === N) break;
|
|
452
|
+
if (u.kind === be) {
|
|
454
453
|
l--, o--, c--;
|
|
455
454
|
continue;
|
|
456
455
|
}
|
|
@@ -486,19 +485,19 @@ function Pe(e, t, n) {
|
|
|
486
485
|
segment: l
|
|
487
486
|
}];
|
|
488
487
|
}
|
|
489
|
-
function
|
|
488
|
+
function Pe(e) {
|
|
490
489
|
let t = [e];
|
|
491
490
|
for (; e.parentRoute;) e = e.parentRoute, t.push(e);
|
|
492
491
|
return t.reverse(), t;
|
|
493
492
|
}
|
|
494
|
-
function
|
|
493
|
+
function Fe(e) {
|
|
495
494
|
let t = Array(e.depth + 1);
|
|
496
495
|
do
|
|
497
496
|
t[e.depth] = e, e = e.parent;
|
|
498
497
|
while (e);
|
|
499
498
|
return t;
|
|
500
499
|
}
|
|
501
|
-
function
|
|
500
|
+
function Ie(e, t, n, r) {
|
|
502
501
|
if (e === "/" && n.index) return {
|
|
503
502
|
node: n.index,
|
|
504
503
|
skipped: 0
|
|
@@ -514,14 +513,14 @@ function Le(e, t, n, r) {
|
|
|
514
513
|
}], c = null, l = null;
|
|
515
514
|
for (; s.length;) {
|
|
516
515
|
let n = s.pop(), { node: i, index: u, skipped: d, depth: f, statics: p, dynamics: m, optionals: h } = n, { extract: g, rawParams: _ } = n;
|
|
517
|
-
if (i.kind === 2 && i.route && !
|
|
516
|
+
if (i.kind === 2 && i.route && !Be(l, n)) continue;
|
|
518
517
|
if (i.parse) {
|
|
519
|
-
if (!
|
|
518
|
+
if (!ze(e, t, n)) continue;
|
|
520
519
|
_ = n.rawParams, g = n.extract;
|
|
521
520
|
}
|
|
522
|
-
r && i.route && i.kind !==
|
|
521
|
+
r && i.route && i.kind !== N && Be(c, n) && (c = n);
|
|
523
522
|
let v = u === o;
|
|
524
|
-
if (v && (i.route && (!a || i.kind ===
|
|
523
|
+
if (v && (i.route && (!a || i.kind === N || i.kind === 2) && Be(l, n) && (l = n), !i.optional && !i.wildcard && !i.index && !i.pathless)) continue;
|
|
525
524
|
let y = v ? void 0 : t[u], b;
|
|
526
525
|
if (v && i.index) {
|
|
527
526
|
let n = {
|
|
@@ -535,9 +534,9 @@ function Le(e, t, n, r) {
|
|
|
535
534
|
extract: g,
|
|
536
535
|
rawParams: _
|
|
537
536
|
}, r = !0;
|
|
538
|
-
if (i.index.parse && (
|
|
539
|
-
if (!m && !h && !d &&
|
|
540
|
-
|
|
537
|
+
if (i.index.parse && (ze(e, t, n) || (r = !1)), r) {
|
|
538
|
+
if (!m && !h && !d && Re(p, o)) return n;
|
|
539
|
+
Be(l, n) && (l = n);
|
|
541
540
|
}
|
|
542
541
|
}
|
|
543
542
|
if (i.wildcard) for (let e = i.wildcard.length - 1; e >= 0; e--) {
|
|
@@ -590,7 +589,7 @@ function Le(e, t, n, r) {
|
|
|
590
589
|
depth: t,
|
|
591
590
|
statics: p,
|
|
592
591
|
dynamics: m,
|
|
593
|
-
optionals: h +
|
|
592
|
+
optionals: h + Le(o, u),
|
|
594
593
|
extract: g,
|
|
595
594
|
rawParams: _
|
|
596
595
|
});
|
|
@@ -608,7 +607,7 @@ function Le(e, t, n, r) {
|
|
|
608
607
|
skipped: d,
|
|
609
608
|
depth: f + 1,
|
|
610
609
|
statics: p,
|
|
611
|
-
dynamics: m +
|
|
610
|
+
dynamics: m + Le(o, u),
|
|
612
611
|
optionals: h,
|
|
613
612
|
extract: g,
|
|
614
613
|
rawParams: _
|
|
@@ -621,7 +620,7 @@ function Le(e, t, n, r) {
|
|
|
621
620
|
index: u + 1,
|
|
622
621
|
skipped: d,
|
|
623
622
|
depth: f + 1,
|
|
624
|
-
statics: p +
|
|
623
|
+
statics: p + Le(o, u),
|
|
625
624
|
dynamics: m,
|
|
626
625
|
optionals: h,
|
|
627
626
|
extract: g,
|
|
@@ -635,7 +634,7 @@ function Le(e, t, n, r) {
|
|
|
635
634
|
index: u + 1,
|
|
636
635
|
skipped: d,
|
|
637
636
|
depth: f + 1,
|
|
638
|
-
statics: p +
|
|
637
|
+
statics: p + Le(o, u),
|
|
639
638
|
dynamics: m,
|
|
640
639
|
optionals: h,
|
|
641
640
|
extract: g,
|
|
@@ -669,16 +668,16 @@ function Le(e, t, n, r) {
|
|
|
669
668
|
}
|
|
670
669
|
return null;
|
|
671
670
|
}
|
|
672
|
-
function
|
|
671
|
+
function Le(e, t) {
|
|
673
672
|
return 2 ** (e - t - 1);
|
|
674
673
|
}
|
|
675
|
-
function
|
|
674
|
+
function Re(e, t) {
|
|
676
675
|
return e === 2 ** (t - 1) - 1;
|
|
677
676
|
}
|
|
678
|
-
function
|
|
677
|
+
function ze(e, t, n) {
|
|
679
678
|
let r, i;
|
|
680
679
|
try {
|
|
681
|
-
[r, i] =
|
|
680
|
+
[r, i] = Ne(e, t, n);
|
|
682
681
|
} catch {
|
|
683
682
|
return null;
|
|
684
683
|
}
|
|
@@ -688,34 +687,34 @@ function Be(e, t, n) {
|
|
|
688
687
|
} catch {}
|
|
689
688
|
return !0;
|
|
690
689
|
}
|
|
691
|
-
function
|
|
692
|
-
return e ? t.statics > e.statics || t.statics === e.statics && (t.dynamics > e.dynamics || t.dynamics === e.dynamics && (t.optionals > e.optionals || t.optionals === e.optionals && ((t.node.kind ===
|
|
690
|
+
function Be(e, t) {
|
|
691
|
+
return e ? t.statics > e.statics || t.statics === e.statics && (t.dynamics > e.dynamics || t.dynamics === e.dynamics && (t.optionals > e.optionals || t.optionals === e.optionals && ((t.node.kind === N) > (e.node.kind === N) || t.node.kind === N == (e.node.kind === N) && t.depth > e.depth))) : !0;
|
|
693
692
|
}
|
|
694
693
|
//#endregion
|
|
695
694
|
//#region ../router-core/dist/esm/path.js
|
|
696
|
-
function
|
|
697
|
-
return
|
|
695
|
+
function Ve(e) {
|
|
696
|
+
return He(e.filter((e) => e !== void 0).join("/"));
|
|
698
697
|
}
|
|
699
|
-
function
|
|
698
|
+
function He(e) {
|
|
700
699
|
return e.replace(/\/{2,}/g, "/");
|
|
701
700
|
}
|
|
702
|
-
function
|
|
701
|
+
function Ue(e) {
|
|
703
702
|
return e === "/" ? e : e.replace(/^\/{1,}/, "");
|
|
704
703
|
}
|
|
705
|
-
function
|
|
704
|
+
function I(e) {
|
|
706
705
|
let t = e.length;
|
|
707
706
|
return t > 1 && e[t - 1] === "/" ? e.replace(/\/{1,}$/, "") : e;
|
|
708
707
|
}
|
|
709
|
-
function
|
|
710
|
-
return
|
|
708
|
+
function We(e) {
|
|
709
|
+
return I(Ue(e));
|
|
711
710
|
}
|
|
712
|
-
function
|
|
711
|
+
function Ge(e, t) {
|
|
713
712
|
return e?.endsWith("/") && e !== "/" && e !== `${t}/` ? e.slice(0, -1) : e;
|
|
714
713
|
}
|
|
715
|
-
function
|
|
716
|
-
return
|
|
714
|
+
function Ke(e, t, n) {
|
|
715
|
+
return Ge(e, n) === Ge(t, n);
|
|
717
716
|
}
|
|
718
|
-
function
|
|
717
|
+
function qe({ base: e, to: t, trailingSlash: n = "never", cache: r }) {
|
|
719
718
|
let i = t.startsWith("/"), a = !i && t === ".", o;
|
|
720
719
|
if (r) {
|
|
721
720
|
o = i ? t : a ? e : e + "\0" + t;
|
|
@@ -734,18 +733,18 @@ function Je({ base: e, to: t, trailingSlash: n = "never", cache: r }) {
|
|
|
734
733
|
}
|
|
735
734
|
}
|
|
736
735
|
s.length > 1 && (w(s) === "" ? n === "never" && s.pop() : n === "always" && s.push(""));
|
|
737
|
-
let c =
|
|
736
|
+
let c = He(s.join("/")) || "/";
|
|
738
737
|
return o && r && r.set(o, c), c;
|
|
739
738
|
}
|
|
740
|
-
function
|
|
739
|
+
function Je(e) {
|
|
741
740
|
let t = new Map(e.map((e) => [encodeURIComponent(e), e])), n = Array.from(t.keys()).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|"), r = new RegExp(n, "g");
|
|
742
741
|
return (e) => e.replace(r, (e) => t.get(e) ?? e);
|
|
743
742
|
}
|
|
744
|
-
function
|
|
743
|
+
function Ye(e, t, n) {
|
|
745
744
|
let r = t[e];
|
|
746
|
-
return typeof r == "string" ? e === "_splat" ? /^[a-zA-Z0-9\-._~!/]*$/.test(r) ? r : r.split("/").map((e) =>
|
|
745
|
+
return typeof r == "string" ? e === "_splat" ? /^[a-zA-Z0-9\-._~!/]*$/.test(r) ? r : r.split("/").map((e) => Ze(e, n)).join("/") : Ze(r, n) : r;
|
|
747
746
|
}
|
|
748
|
-
function
|
|
747
|
+
function Xe({ path: e, params: t, decoder: n, ...r }) {
|
|
749
748
|
let i = !1, a = Object.create(null);
|
|
750
749
|
if (!e || e === "/") return {
|
|
751
750
|
interpolatedPath: "/",
|
|
@@ -760,7 +759,7 @@ function Ze({ path: e, params: t, decoder: n, ...r }) {
|
|
|
760
759
|
let o = e.length, s = 0, c, l = "";
|
|
761
760
|
for (; s < o;) {
|
|
762
761
|
let r = s;
|
|
763
|
-
c =
|
|
762
|
+
c = Se(e, r, c);
|
|
764
763
|
let o = c[5];
|
|
765
764
|
if (s = o + 1, r === o) continue;
|
|
766
765
|
let u = c[0];
|
|
@@ -776,14 +775,14 @@ function Ze({ path: e, params: t, decoder: n, ...r }) {
|
|
|
776
775
|
i = !0, (u || d) && (l += "/" + u + d);
|
|
777
776
|
continue;
|
|
778
777
|
}
|
|
779
|
-
let f =
|
|
778
|
+
let f = Ye("_splat", t, n);
|
|
780
779
|
l += "/" + u + f + d;
|
|
781
780
|
continue;
|
|
782
781
|
}
|
|
783
782
|
if (u === 1) {
|
|
784
783
|
let s = e.substring(c[2], c[3]);
|
|
785
784
|
!i && !(s in t) && (i = !0), a[s] = t[s];
|
|
786
|
-
let u = e.substring(r, c[1]), d = e.substring(c[4], o), f =
|
|
785
|
+
let u = e.substring(r, c[1]), d = e.substring(c[4], o), f = Ye(s, t, n) ?? "undefined";
|
|
787
786
|
l += "/" + u + f + d;
|
|
788
787
|
continue;
|
|
789
788
|
}
|
|
@@ -791,7 +790,7 @@ function Ze({ path: e, params: t, decoder: n, ...r }) {
|
|
|
791
790
|
let i = e.substring(c[2], c[3]), s = t[i];
|
|
792
791
|
if (s == null) continue;
|
|
793
792
|
a[i] = s;
|
|
794
|
-
let u = e.substring(r, c[1]), d = e.substring(c[4], o), f =
|
|
793
|
+
let u = e.substring(r, c[1]), d = e.substring(c[4], o), f = Ye(i, t, n) ?? "";
|
|
795
794
|
l += "/" + u + f + d;
|
|
796
795
|
continue;
|
|
797
796
|
}
|
|
@@ -802,31 +801,31 @@ function Ze({ path: e, params: t, decoder: n, ...r }) {
|
|
|
802
801
|
isMissingParams: i
|
|
803
802
|
};
|
|
804
803
|
}
|
|
805
|
-
function
|
|
804
|
+
function Ze(e, t) {
|
|
806
805
|
let n = encodeURIComponent(e);
|
|
807
806
|
return t?.(n) ?? n;
|
|
808
807
|
}
|
|
809
808
|
//#endregion
|
|
810
809
|
//#region ../router-core/dist/esm/not-found.js
|
|
811
|
-
function
|
|
810
|
+
function Qe(e = {}) {
|
|
812
811
|
if (e.isNotFound = !0, e.throw) throw e;
|
|
813
812
|
return e;
|
|
814
813
|
}
|
|
815
|
-
function
|
|
814
|
+
function L(e) {
|
|
816
815
|
return e?.isNotFound === !0;
|
|
817
816
|
}
|
|
818
817
|
//#endregion
|
|
819
818
|
//#region ../router-core/dist/esm/scroll-restoration.js
|
|
820
|
-
function
|
|
819
|
+
function $e() {
|
|
821
820
|
try {
|
|
822
821
|
return typeof window < "u" && typeof window.sessionStorage == "object" ? window.sessionStorage : void 0;
|
|
823
822
|
} catch {
|
|
824
823
|
return;
|
|
825
824
|
}
|
|
826
825
|
}
|
|
827
|
-
var
|
|
828
|
-
function
|
|
829
|
-
let e =
|
|
826
|
+
var et = "tsr-scroll-restoration-v1_3";
|
|
827
|
+
function tt() {
|
|
828
|
+
let e = $e();
|
|
830
829
|
if (!e) return null;
|
|
831
830
|
let t = {};
|
|
832
831
|
try {
|
|
@@ -842,29 +841,29 @@ function nt() {
|
|
|
842
841
|
},
|
|
843
842
|
persist: () => {
|
|
844
843
|
try {
|
|
845
|
-
e.setItem(
|
|
844
|
+
e.setItem(et, JSON.stringify(t));
|
|
846
845
|
} catch {
|
|
847
846
|
process.env.NODE_ENV !== "production" && console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.");
|
|
848
847
|
}
|
|
849
848
|
}
|
|
850
849
|
};
|
|
851
850
|
}
|
|
852
|
-
var
|
|
853
|
-
function
|
|
851
|
+
var nt = tt(), rt = (e) => e.state.__TSR_key || e.href;
|
|
852
|
+
function it(e) {
|
|
854
853
|
let t = [], n;
|
|
855
854
|
for (; n = e.parentNode;) t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children, e) + 1})`), e = n;
|
|
856
855
|
return `${t.reverse().join(" > ")}`.toLowerCase();
|
|
857
856
|
}
|
|
858
|
-
var
|
|
859
|
-
function
|
|
860
|
-
if (!
|
|
861
|
-
let n =
|
|
857
|
+
var at = !1, R = "window", ot = "data-scroll-restoration-id";
|
|
858
|
+
function st(e, t) {
|
|
859
|
+
if (!nt) return;
|
|
860
|
+
let n = nt;
|
|
862
861
|
if ((t ?? e.options.scrollRestoration ?? !1) && (e.isScrollRestoring = !0), e.isScrollRestorationSetup || !n) return;
|
|
863
|
-
e.isScrollRestorationSetup = !0,
|
|
864
|
-
let r = e.options.getScrollRestorationKey ||
|
|
862
|
+
e.isScrollRestorationSetup = !0, at = !1;
|
|
863
|
+
let r = e.options.getScrollRestorationKey || rt, i = /* @__PURE__ */ new Map();
|
|
865
864
|
window.history.scrollRestoration = "manual";
|
|
866
865
|
let a = (t) => {
|
|
867
|
-
if (!(
|
|
866
|
+
if (!(at || !e.isScrollRestoring)) if (t.target === document || t.target === window) i.set(R, {
|
|
868
867
|
scrollX: window.scrollX || 0,
|
|
869
868
|
scrollY: window.scrollY || 0
|
|
870
869
|
});
|
|
@@ -880,10 +879,10 @@ function lt(e, t) {
|
|
|
880
879
|
let r = n.state[t] ||= {};
|
|
881
880
|
for (let [e, t] of i) {
|
|
882
881
|
let n;
|
|
883
|
-
if (e ===
|
|
882
|
+
if (e === R) n = R;
|
|
884
883
|
else if (e.isConnected) {
|
|
885
|
-
let t = e.getAttribute(
|
|
886
|
-
n = t ? `[${
|
|
884
|
+
let t = e.getAttribute(ot);
|
|
885
|
+
n = t ? `[${ot}="${t}"]` : it(e);
|
|
887
886
|
}
|
|
888
887
|
n && (r[n] = t);
|
|
889
888
|
}
|
|
@@ -899,7 +898,7 @@ function lt(e, t) {
|
|
|
899
898
|
return;
|
|
900
899
|
}
|
|
901
900
|
if (!(typeof e.options.scrollRestoration == "function" && !e.options.scrollRestoration({ location: e.latestLocation }))) {
|
|
902
|
-
|
|
901
|
+
at = !0;
|
|
903
902
|
try {
|
|
904
903
|
let t = e.isScrollRestoring ? n.state[a] : void 0, r = !1;
|
|
905
904
|
if (t) for (let e in t) {
|
|
@@ -907,7 +906,7 @@ function lt(e, t) {
|
|
|
907
906
|
if (!O(n)) continue;
|
|
908
907
|
let { scrollX: i, scrollY: a } = n;
|
|
909
908
|
if (!(!Number.isFinite(i) || !Number.isFinite(a))) {
|
|
910
|
-
if (e ===
|
|
909
|
+
if (e === R) window.scrollTo({
|
|
911
910
|
top: a,
|
|
912
911
|
left: i,
|
|
913
912
|
behavior: o
|
|
@@ -938,14 +937,14 @@ function lt(e, t) {
|
|
|
938
937
|
behavior: o
|
|
939
938
|
};
|
|
940
939
|
if (window.scrollTo(e), s) for (let t of s) {
|
|
941
|
-
if (t ===
|
|
940
|
+
if (t === R) continue;
|
|
942
941
|
let n = typeof t == "function" ? t() : document.querySelector(t);
|
|
943
942
|
n && n.scrollTo(e);
|
|
944
943
|
}
|
|
945
944
|
}
|
|
946
945
|
}
|
|
947
946
|
} finally {
|
|
948
|
-
|
|
947
|
+
at = !1;
|
|
949
948
|
}
|
|
950
949
|
e.isScrollRestoring && n.set((e) => (e[a] ||= {}, e));
|
|
951
950
|
}
|
|
@@ -953,7 +952,7 @@ function lt(e, t) {
|
|
|
953
952
|
}
|
|
954
953
|
//#endregion
|
|
955
954
|
//#region ../router-core/dist/esm/qss.js
|
|
956
|
-
function
|
|
955
|
+
function ct(e, t = String) {
|
|
957
956
|
let n = new URLSearchParams();
|
|
958
957
|
for (let r in e) {
|
|
959
958
|
let i = e[r];
|
|
@@ -961,24 +960,24 @@ function ut(e, t = String) {
|
|
|
961
960
|
}
|
|
962
961
|
return n.toString();
|
|
963
962
|
}
|
|
964
|
-
function
|
|
963
|
+
function lt(e) {
|
|
965
964
|
return e ? e === "false" ? !1 : e === "true" ? !0 : e * 0 == 0 && +e + "" === e ? +e : e : "";
|
|
966
965
|
}
|
|
967
|
-
function
|
|
966
|
+
function ut(e) {
|
|
968
967
|
let t = new URLSearchParams(e), n = Object.create(null);
|
|
969
968
|
for (let [e, r] of t.entries()) {
|
|
970
969
|
let t = n[e];
|
|
971
|
-
t == null ? n[e] =
|
|
970
|
+
t == null ? n[e] = lt(r) : Array.isArray(t) ? t.push(lt(r)) : n[e] = [t, lt(r)];
|
|
972
971
|
}
|
|
973
972
|
return n;
|
|
974
973
|
}
|
|
975
974
|
//#endregion
|
|
976
975
|
//#region ../router-core/dist/esm/searchParams.js
|
|
977
|
-
var
|
|
978
|
-
function
|
|
976
|
+
var dt = pt(JSON.parse), ft = mt(JSON.stringify, JSON.parse);
|
|
977
|
+
function pt(e) {
|
|
979
978
|
return (t) => {
|
|
980
979
|
t[0] === "?" && (t = t.substring(1));
|
|
981
|
-
let n =
|
|
980
|
+
let n = ut(t);
|
|
982
981
|
for (let t in n) {
|
|
983
982
|
let r = n[t];
|
|
984
983
|
if (typeof r == "string") try {
|
|
@@ -988,7 +987,7 @@ function ht(e) {
|
|
|
988
987
|
return n;
|
|
989
988
|
};
|
|
990
989
|
}
|
|
991
|
-
function
|
|
990
|
+
function mt(e, t) {
|
|
992
991
|
let n = typeof t == "function";
|
|
993
992
|
function r(r) {
|
|
994
993
|
if (typeof r == "object" && r) try {
|
|
@@ -1000,16 +999,16 @@ function gt(e, t) {
|
|
|
1000
999
|
return r;
|
|
1001
1000
|
}
|
|
1002
1001
|
return (e) => {
|
|
1003
|
-
let t =
|
|
1002
|
+
let t = ct(e, r);
|
|
1004
1003
|
return t ? `?${t}` : "";
|
|
1005
1004
|
};
|
|
1006
1005
|
}
|
|
1007
1006
|
//#endregion
|
|
1008
1007
|
//#region ../router-core/dist/esm/root.js
|
|
1009
|
-
var
|
|
1008
|
+
var z = "__root__";
|
|
1010
1009
|
//#endregion
|
|
1011
1010
|
//#region ../router-core/dist/esm/redirect.js
|
|
1012
|
-
function
|
|
1011
|
+
function ht(e) {
|
|
1013
1012
|
if (e.statusCode = e.statusCode || e.code || 307, !e._builtLocation && !e.reloadDocument && typeof e.href == "string") try {
|
|
1014
1013
|
new URL(e.href), e.reloadDocument = !0;
|
|
1015
1014
|
} catch {}
|
|
@@ -1022,38 +1021,38 @@ function _t(e) {
|
|
|
1022
1021
|
if (n.options = e, e.throw) throw n;
|
|
1023
1022
|
return n;
|
|
1024
1023
|
}
|
|
1025
|
-
function
|
|
1024
|
+
function B(e) {
|
|
1026
1025
|
return e instanceof Response && !!e.options;
|
|
1027
1026
|
}
|
|
1028
1027
|
//#endregion
|
|
1029
1028
|
//#region ../router-core/dist/esm/rewrite.js
|
|
1030
|
-
function
|
|
1029
|
+
function gt(e) {
|
|
1031
1030
|
return {
|
|
1032
1031
|
input: ({ url: t }) => {
|
|
1033
|
-
for (let n of e) t =
|
|
1032
|
+
for (let n of e) t = vt(n, t);
|
|
1034
1033
|
return t;
|
|
1035
1034
|
},
|
|
1036
1035
|
output: ({ url: t }) => {
|
|
1037
|
-
for (let n = e.length - 1; n >= 0; n--) t =
|
|
1036
|
+
for (let n = e.length - 1; n >= 0; n--) t = yt(e[n], t);
|
|
1038
1037
|
return t;
|
|
1039
1038
|
}
|
|
1040
1039
|
};
|
|
1041
1040
|
}
|
|
1042
|
-
function
|
|
1043
|
-
let t =
|
|
1041
|
+
function _t(e) {
|
|
1042
|
+
let t = We(e.basepath), n = `/${t}`, r = `${n}/`, i = e.caseSensitive ? n : n.toLowerCase(), a = e.caseSensitive ? r : r.toLowerCase();
|
|
1044
1043
|
return {
|
|
1045
1044
|
input: ({ url: t }) => {
|
|
1046
1045
|
let r = e.caseSensitive ? t.pathname : t.pathname.toLowerCase();
|
|
1047
1046
|
return r === i ? t.pathname = "/" : r.startsWith(a) && (t.pathname = t.pathname.slice(n.length)), t;
|
|
1048
1047
|
},
|
|
1049
|
-
output: ({ url: e }) => (e.pathname =
|
|
1048
|
+
output: ({ url: e }) => (e.pathname = Ve([
|
|
1050
1049
|
"/",
|
|
1051
1050
|
t,
|
|
1052
1051
|
e.pathname
|
|
1053
1052
|
]), e)
|
|
1054
1053
|
};
|
|
1055
1054
|
}
|
|
1056
|
-
function
|
|
1055
|
+
function vt(e, t) {
|
|
1057
1056
|
let n = e?.input?.({ url: t });
|
|
1058
1057
|
if (n) {
|
|
1059
1058
|
if (typeof n == "string") return new URL(n);
|
|
@@ -1061,7 +1060,7 @@ function bt(e, t) {
|
|
|
1061
1060
|
}
|
|
1062
1061
|
return t;
|
|
1063
1062
|
}
|
|
1064
|
-
function
|
|
1063
|
+
function yt(e, t) {
|
|
1065
1064
|
let n = e?.output?.({ url: t });
|
|
1066
1065
|
if (n) {
|
|
1067
1066
|
if (typeof n == "string") return new URL(n);
|
|
@@ -1069,8 +1068,8 @@ function xt(e, t) {
|
|
|
1069
1068
|
}
|
|
1070
1069
|
return t;
|
|
1071
1070
|
}
|
|
1072
|
-
function
|
|
1073
|
-
let { createMutableStore: n, createReadonlyStore: r, batch: i, init: a } = t, o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = n(e.status), u = n(e.loadedAt), d = n(e.isLoading), f = n(e.isTransitioning), p = n(e.location), m = n(e.resolvedLocation), h = n(e.statusCode), g = n(e.redirect), _ = n([]), v = n([]), y = n([]), b = r(() =>
|
|
1071
|
+
function bt(e, t) {
|
|
1072
|
+
let { createMutableStore: n, createReadonlyStore: r, batch: i, init: a } = t, o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = n(e.status), u = n(e.loadedAt), d = n(e.isLoading), f = n(e.isTransitioning), p = n(e.location), m = n(e.resolvedLocation), h = n(e.statusCode), g = n(e.redirect), _ = n([]), v = n([]), y = n([]), b = r(() => xt(o, _.get())), x = r(() => xt(s, v.get())), S = r(() => xt(c, y.get())), C = r(() => _.get()[0]), w = r(() => _.get().some((e) => o.get(e)?.get().status === "pending")), ee = r(() => ({
|
|
1074
1073
|
locationHref: p.get().href,
|
|
1075
1074
|
resolvedLocationHref: m.get()?.href,
|
|
1076
1075
|
status: l.get()
|
|
@@ -1084,7 +1083,7 @@ function St(e, t) {
|
|
|
1084
1083
|
resolvedLocation: m.get(),
|
|
1085
1084
|
statusCode: h.get(),
|
|
1086
1085
|
redirect: g.get()
|
|
1087
|
-
})), te =
|
|
1086
|
+
})), te = M(64);
|
|
1088
1087
|
function ne(e) {
|
|
1089
1088
|
let t = te.get(e);
|
|
1090
1089
|
return t || (t = r(() => {
|
|
@@ -1124,17 +1123,17 @@ function St(e, t) {
|
|
|
1124
1123
|
};
|
|
1125
1124
|
ie(e.matches), a?.(re);
|
|
1126
1125
|
function ie(e) {
|
|
1127
|
-
|
|
1126
|
+
St(e, o, _, n, i);
|
|
1128
1127
|
}
|
|
1129
1128
|
function E(e) {
|
|
1130
|
-
|
|
1129
|
+
St(e, s, v, n, i);
|
|
1131
1130
|
}
|
|
1132
1131
|
function D(e) {
|
|
1133
|
-
|
|
1132
|
+
St(e, c, y, n, i);
|
|
1134
1133
|
}
|
|
1135
1134
|
return re;
|
|
1136
1135
|
}
|
|
1137
|
-
function
|
|
1136
|
+
function xt(e, t) {
|
|
1138
1137
|
let n = [];
|
|
1139
1138
|
for (let r of t) {
|
|
1140
1139
|
let t = e.get(r);
|
|
@@ -1142,7 +1141,7 @@ function Ct(e, t) {
|
|
|
1142
1141
|
}
|
|
1143
1142
|
return n;
|
|
1144
1143
|
}
|
|
1145
|
-
function
|
|
1144
|
+
function St(e, t, n, r, i) {
|
|
1146
1145
|
let a = e.map((e) => e.id), o = new Set(a);
|
|
1147
1146
|
i(() => {
|
|
1148
1147
|
for (let e of t.keys()) o.has(e) || t.delete(e);
|
|
@@ -1160,9 +1159,9 @@ function wt(e, t, n, r, i) {
|
|
|
1160
1159
|
}
|
|
1161
1160
|
//#endregion
|
|
1162
1161
|
//#region ../router-core/dist/esm/load-matches.js
|
|
1163
|
-
var
|
|
1162
|
+
var Ct = (e) => {
|
|
1164
1163
|
if (!e.rendered) return e.rendered = !0, e.onReady?.();
|
|
1165
|
-
},
|
|
1164
|
+
}, wt = (e) => e.stores.matchesId.get().some((t) => e.stores.matchStores.get(t)?.get()._forcePending), Tt = (e, t) => !!(e.preload && !e.router.stores.matchStores.has(t)), V = (e, t, n = !0) => {
|
|
1166
1165
|
let r = { ...e.router.options.context ?? {} }, i = n ? t : t - 1;
|
|
1167
1166
|
for (let t = 0; t <= i; t++) {
|
|
1168
1167
|
let n = e.matches[t];
|
|
@@ -1171,7 +1170,7 @@ var Tt = (e) => {
|
|
|
1171
1170
|
i && Object.assign(r, i.__routeContext, i.__beforeLoadContext);
|
|
1172
1171
|
}
|
|
1173
1172
|
return r;
|
|
1174
|
-
},
|
|
1173
|
+
}, Et = (e, t) => {
|
|
1175
1174
|
if (!e.matches.length) return;
|
|
1176
1175
|
let n = t.routeId, r = e.matches.findIndex((t) => t.routeId === e.router.routeTree.id), i = r >= 0 ? r : 0, a = n ? e.matches.findIndex((e) => e.routeId === n) : e.firstBadMatchIndex ?? e.matches.length - 1;
|
|
1177
1176
|
a < 0 && (a = i);
|
|
@@ -1180,31 +1179,31 @@ var Tt = (e) => {
|
|
|
1180
1179
|
if (e.router.looseRoutesById[n.routeId].options.notFoundComponent) return t;
|
|
1181
1180
|
}
|
|
1182
1181
|
return n ? a : i;
|
|
1183
|
-
},
|
|
1184
|
-
if (!(!
|
|
1182
|
+
}, H = (e, t, n) => {
|
|
1183
|
+
if (!(!B(n) && !L(n))) throw B(n) && n.redirectHandled && !n.options.reloadDocument ? n : (t && (t._nonReactive.beforeLoadPromise?.resolve(), t._nonReactive.loaderPromise?.resolve(), t._nonReactive.beforeLoadPromise = void 0, t._nonReactive.loaderPromise = void 0, t._nonReactive.error = n, e.updateMatch(t.id, (r) => ({
|
|
1185
1184
|
...r,
|
|
1186
|
-
status:
|
|
1187
|
-
context:
|
|
1185
|
+
status: B(n) ? "redirected" : L(n) ? "notFound" : r.status === "pending" ? "success" : r.status,
|
|
1186
|
+
context: V(e, t.index),
|
|
1188
1187
|
isFetching: !1,
|
|
1189
1188
|
error: n
|
|
1190
|
-
})),
|
|
1191
|
-
},
|
|
1189
|
+
})), L(n) && !n.routeId && (n.routeId = t.routeId), t._nonReactive.loadPromise?.resolve()), B(n) && (e.rendered = !0, n.options._fromLocation = e.location, n.redirectHandled = !0, n = e.router.resolveRedirect(n)), n);
|
|
1190
|
+
}, Dt = (e, t) => {
|
|
1192
1191
|
let n = e.router.getMatch(t);
|
|
1193
1192
|
return !!(!n || n._nonReactive.dehydrated);
|
|
1194
|
-
},
|
|
1195
|
-
let r =
|
|
1193
|
+
}, Ot = (e, t, n) => {
|
|
1194
|
+
let r = V(e, n);
|
|
1196
1195
|
e.updateMatch(t, (e) => ({
|
|
1197
1196
|
...e,
|
|
1198
1197
|
context: r
|
|
1199
1198
|
}));
|
|
1200
|
-
},
|
|
1199
|
+
}, U = (e, t, n, r) => {
|
|
1201
1200
|
let { id: i, routeId: a } = e.matches[t], o = e.router.looseRoutesById[a];
|
|
1202
1201
|
if (n instanceof Promise) throw n;
|
|
1203
|
-
n.routerCode = r, e.firstBadMatchIndex ??= t,
|
|
1202
|
+
n.routerCode = r, e.firstBadMatchIndex ??= t, H(e, e.router.getMatch(i), n);
|
|
1204
1203
|
try {
|
|
1205
1204
|
o.options.onError?.(n);
|
|
1206
1205
|
} catch (t) {
|
|
1207
|
-
n = t,
|
|
1206
|
+
n = t, H(e, e.router.getMatch(i), n);
|
|
1208
1207
|
}
|
|
1209
1208
|
e.updateMatch(i, (e) => (e._nonReactive.beforeLoadPromise?.resolve(), e._nonReactive.beforeLoadPromise = void 0, e._nonReactive.loadPromise?.resolve(), {
|
|
1210
1209
|
...e,
|
|
@@ -1213,32 +1212,32 @@ var Tt = (e) => {
|
|
|
1213
1212
|
isFetching: !1,
|
|
1214
1213
|
updatedAt: Date.now(),
|
|
1215
1214
|
abortController: new AbortController()
|
|
1216
|
-
})), !e.preload && !
|
|
1217
|
-
},
|
|
1215
|
+
})), !e.preload && !B(n) && !L(n) && (e.serialError ??= n);
|
|
1216
|
+
}, kt = (e, t, n, r) => {
|
|
1218
1217
|
if (r._nonReactive.pendingTimeout !== void 0) return;
|
|
1219
1218
|
let i = n.options.pendingMs ?? e.router.options.defaultPendingMs;
|
|
1220
|
-
if (e.onReady && !
|
|
1219
|
+
if (e.onReady && !Tt(e, t) && (n.options.loader || n.options.beforeLoad || Bt(n)) && typeof i == "number" && i !== Infinity && (n.options.pendingComponent ?? e.router.options?.defaultPendingComponent)) {
|
|
1221
1220
|
let t = setTimeout(() => {
|
|
1222
|
-
|
|
1221
|
+
Ct(e);
|
|
1223
1222
|
}, i);
|
|
1224
1223
|
r._nonReactive.pendingTimeout = t;
|
|
1225
1224
|
}
|
|
1226
|
-
},
|
|
1225
|
+
}, At = (e, t, n) => {
|
|
1227
1226
|
let r = e.router.getMatch(t);
|
|
1228
1227
|
if (!r._nonReactive.beforeLoadPromise && !r._nonReactive.loaderPromise) return;
|
|
1229
|
-
|
|
1228
|
+
kt(e, t, n, r);
|
|
1230
1229
|
let i = () => {
|
|
1231
1230
|
let n = e.router.getMatch(t);
|
|
1232
|
-
n.preload && (n.status === "redirected" || n.status === "notFound") &&
|
|
1231
|
+
n.preload && (n.status === "redirected" || n.status === "notFound") && H(e, n, n.error);
|
|
1233
1232
|
};
|
|
1234
1233
|
return r._nonReactive.beforeLoadPromise ? r._nonReactive.beforeLoadPromise.then(i) : i();
|
|
1235
|
-
},
|
|
1234
|
+
}, jt = (e, t, n, r) => {
|
|
1236
1235
|
let i = e.router.getMatch(t), a = i._nonReactive.loadPromise;
|
|
1237
|
-
i._nonReactive.loadPromise =
|
|
1236
|
+
i._nonReactive.loadPromise = ce(() => {
|
|
1238
1237
|
a?.resolve(), a = void 0;
|
|
1239
1238
|
});
|
|
1240
1239
|
let { paramsError: o, searchError: s } = i;
|
|
1241
|
-
o &&
|
|
1240
|
+
o && U(e, n, o, "PARSE_PARAMS"), s && U(e, n, s, "VALIDATE_SEARCH"), kt(e, t, r, i);
|
|
1242
1241
|
let c = new AbortController(), l = !1, u = () => {
|
|
1243
1242
|
l || (l = !0, e.updateMatch(t, (e) => ({
|
|
1244
1243
|
...e,
|
|
@@ -1258,11 +1257,11 @@ var Tt = (e) => {
|
|
|
1258
1257
|
});
|
|
1259
1258
|
return;
|
|
1260
1259
|
}
|
|
1261
|
-
i._nonReactive.beforeLoadPromise =
|
|
1260
|
+
i._nonReactive.beforeLoadPromise = ce();
|
|
1262
1261
|
let f = {
|
|
1263
|
-
...
|
|
1262
|
+
...V(e, n, !1),
|
|
1264
1263
|
...i.__routeContext
|
|
1265
|
-
}, { search: p, params: m, cause: h } = i, g =
|
|
1264
|
+
}, { search: p, params: m, cause: h } = i, g = Tt(e, t), _ = {
|
|
1266
1265
|
search: p,
|
|
1267
1266
|
abortController: c,
|
|
1268
1267
|
params: m,
|
|
@@ -1285,7 +1284,7 @@ var Tt = (e) => {
|
|
|
1285
1284
|
});
|
|
1286
1285
|
return;
|
|
1287
1286
|
}
|
|
1288
|
-
(
|
|
1287
|
+
(B(r) || L(r)) && (u(), U(e, n, r, "BEFORE_LOAD")), e.router.batch(() => {
|
|
1289
1288
|
u(), e.updateMatch(t, (e) => ({
|
|
1290
1289
|
...e,
|
|
1291
1290
|
__beforeLoadContext: r
|
|
@@ -1293,21 +1292,21 @@ var Tt = (e) => {
|
|
|
1293
1292
|
});
|
|
1294
1293
|
}, y;
|
|
1295
1294
|
try {
|
|
1296
|
-
if (y = r.options.beforeLoad(_),
|
|
1297
|
-
|
|
1295
|
+
if (y = r.options.beforeLoad(_), A(y)) return u(), y.catch((t) => {
|
|
1296
|
+
U(e, n, t, "BEFORE_LOAD");
|
|
1298
1297
|
}).then(v);
|
|
1299
1298
|
} catch (t) {
|
|
1300
|
-
u(),
|
|
1299
|
+
u(), U(e, n, t, "BEFORE_LOAD");
|
|
1301
1300
|
}
|
|
1302
1301
|
v(y);
|
|
1303
|
-
},
|
|
1304
|
-
let { id: n, routeId: r } = e.matches[t], i = e.router.looseRoutesById[r], a = () => s(), o = () =>
|
|
1305
|
-
if (
|
|
1306
|
-
let t =
|
|
1307
|
-
return
|
|
1302
|
+
}, Mt = (e, t) => {
|
|
1303
|
+
let { id: n, routeId: r } = e.matches[t], i = e.router.looseRoutesById[r], a = () => s(), o = () => jt(e, n, t, i), s = () => {
|
|
1304
|
+
if (Dt(e, n)) return;
|
|
1305
|
+
let t = At(e, n, i);
|
|
1306
|
+
return A(t) ? t.then(o) : o();
|
|
1308
1307
|
};
|
|
1309
1308
|
return a();
|
|
1310
|
-
},
|
|
1309
|
+
}, Nt = (e, t, n) => {
|
|
1311
1310
|
let r = e.router.getMatch(t);
|
|
1312
1311
|
if (!r || !n.options.head && !n.options.scripts && !n.options.headers) return;
|
|
1313
1312
|
let i = {
|
|
@@ -1329,8 +1328,8 @@ var Tt = (e) => {
|
|
|
1329
1328
|
scripts: t,
|
|
1330
1329
|
styles: e?.styles
|
|
1331
1330
|
}));
|
|
1332
|
-
},
|
|
1333
|
-
let a = t[r - 1], { params: o, loaderDeps: s, abortController: c, cause: l } = e.router.getMatch(n), u =
|
|
1331
|
+
}, Pt = (e, t, n, r, i) => {
|
|
1332
|
+
let a = t[r - 1], { params: o, loaderDeps: s, abortController: c, cause: l } = e.router.getMatch(n), u = V(e, r), d = Tt(e, n);
|
|
1334
1333
|
return {
|
|
1335
1334
|
params: o,
|
|
1336
1335
|
deps: s,
|
|
@@ -1347,18 +1346,18 @@ var Tt = (e) => {
|
|
|
1347
1346
|
route: i,
|
|
1348
1347
|
...e.router.options.additionalContext
|
|
1349
1348
|
};
|
|
1350
|
-
},
|
|
1349
|
+
}, Ft = async (e, t, n, r, i) => {
|
|
1351
1350
|
try {
|
|
1352
1351
|
let a = e.router.getMatch(n);
|
|
1353
1352
|
try {
|
|
1354
|
-
|
|
1355
|
-
let o = i.options.loader, s = typeof o == "function" ? o : o?.handler, c = s?.(
|
|
1353
|
+
zt(i);
|
|
1354
|
+
let o = i.options.loader, s = typeof o == "function" ? o : o?.handler, c = s?.(Pt(e, t, n, r, i)), l = !!s && A(c);
|
|
1356
1355
|
if ((l || i._lazyPromise || i._componentsPromise || i.options.head || i.options.scripts || i.options.headers || a._nonReactive.minPendingPromise) && e.updateMatch(n, (e) => ({
|
|
1357
1356
|
...e,
|
|
1358
1357
|
isFetching: "loader"
|
|
1359
1358
|
})), s) {
|
|
1360
1359
|
let t = l ? await c : c;
|
|
1361
|
-
|
|
1360
|
+
H(e, e.router.getMatch(n), t), t !== void 0 && e.updateMatch(n, (e) => ({
|
|
1362
1361
|
...e,
|
|
1363
1362
|
loaderData: t
|
|
1364
1363
|
}));
|
|
@@ -1368,7 +1367,7 @@ var Tt = (e) => {
|
|
|
1368
1367
|
u && await u, i._componentsPromise && await i._componentsPromise, e.updateMatch(n, (t) => ({
|
|
1369
1368
|
...t,
|
|
1370
1369
|
error: void 0,
|
|
1371
|
-
context:
|
|
1370
|
+
context: V(e, r),
|
|
1372
1371
|
status: "success",
|
|
1373
1372
|
isFetching: !1,
|
|
1374
1373
|
updatedAt: Date.now()
|
|
@@ -1384,56 +1383,56 @@ var Tt = (e) => {
|
|
|
1384
1383
|
...t,
|
|
1385
1384
|
status: t.status === "pending" ? "success" : t.status,
|
|
1386
1385
|
isFetching: !1,
|
|
1387
|
-
context:
|
|
1386
|
+
context: V(e, r)
|
|
1388
1387
|
}));
|
|
1389
1388
|
return;
|
|
1390
1389
|
}
|
|
1391
1390
|
let s = a._nonReactive.minPendingPromise;
|
|
1392
|
-
s && await s,
|
|
1391
|
+
s && await s, L(t) && await i.options.notFoundComponent?.preload?.(), H(e, e.router.getMatch(n), t);
|
|
1393
1392
|
try {
|
|
1394
1393
|
i.options.onError?.(t);
|
|
1395
1394
|
} catch (t) {
|
|
1396
|
-
o = t,
|
|
1395
|
+
o = t, H(e, e.router.getMatch(n), t);
|
|
1397
1396
|
}
|
|
1398
|
-
!
|
|
1397
|
+
!B(o) && !L(o) && await zt(i, ["errorComponent"]), e.updateMatch(n, (t) => ({
|
|
1399
1398
|
...t,
|
|
1400
1399
|
error: o,
|
|
1401
|
-
context:
|
|
1400
|
+
context: V(e, r),
|
|
1402
1401
|
status: "error",
|
|
1403
1402
|
isFetching: !1
|
|
1404
1403
|
}));
|
|
1405
1404
|
}
|
|
1406
1405
|
} catch (t) {
|
|
1407
1406
|
let r = e.router.getMatch(n);
|
|
1408
|
-
r && (r._nonReactive.loaderPromise = void 0),
|
|
1407
|
+
r && (r._nonReactive.loaderPromise = void 0), H(e, r, t);
|
|
1409
1408
|
}
|
|
1410
|
-
},
|
|
1409
|
+
}, It = async (e, t, n) => {
|
|
1411
1410
|
async function r(r, a, c, l, d) {
|
|
1412
|
-
let f = Date.now() - a.updatedAt, p = r ? d.options.preloadStaleTime ?? e.router.options.defaultPreloadStaleTime ?? 3e4 : d.options.staleTime ?? e.router.options.defaultStaleTime ?? 0, m = d.options.shouldReload, h = typeof m == "function" ? m(
|
|
1411
|
+
let f = Date.now() - a.updatedAt, p = r ? d.options.preloadStaleTime ?? e.router.options.defaultPreloadStaleTime ?? 3e4 : d.options.staleTime ?? e.router.options.defaultStaleTime ?? 0, m = d.options.shouldReload, h = typeof m == "function" ? m(Pt(e, t, i, n, d)) : m, { status: g, invalid: _ } = l, v = f >= p && (!!e.forceStaleReload || l.cause === "enter" || c !== void 0 && c !== l.id);
|
|
1413
1412
|
o = g === "success" && (_ || (h ?? v)), r && d.options.preload === !1 || (o && !e.sync && u ? (s = !0, (async () => {
|
|
1414
1413
|
try {
|
|
1415
|
-
await
|
|
1414
|
+
await Ft(e, t, i, n, d);
|
|
1416
1415
|
let r = e.router.getMatch(i);
|
|
1417
1416
|
r._nonReactive.loaderPromise?.resolve(), r._nonReactive.loadPromise?.resolve(), r._nonReactive.loaderPromise = void 0, r._nonReactive.loadPromise = void 0;
|
|
1418
1417
|
} catch (t) {
|
|
1419
|
-
|
|
1418
|
+
B(t) && await e.router.navigate(t.options);
|
|
1420
1419
|
}
|
|
1421
|
-
})()) : g !== "success" || o ? await
|
|
1420
|
+
})()) : g !== "success" || o ? await Ft(e, t, i, n, d) : Ot(e, i, n));
|
|
1422
1421
|
}
|
|
1423
1422
|
let { id: i, routeId: a } = e.matches[n], o = !1, s = !1, c = e.router.looseRoutesById[a], l = c.options.loader, u = ((typeof l == "function" ? void 0 : l?.staleReloadMode) ?? e.router.options.defaultStaleReloadMode) !== "blocking";
|
|
1424
|
-
if (
|
|
1423
|
+
if (Dt(e, i)) {
|
|
1425
1424
|
if (!e.router.getMatch(i)) return e.matches[n];
|
|
1426
|
-
|
|
1425
|
+
Ot(e, i, n);
|
|
1427
1426
|
} else {
|
|
1428
|
-
let t = e.router.getMatch(i), o = e.router.stores.matchesId.get()[n], s = (o && e.router.stores.matchStores.get(o) || null)?.routeId === a ? o : e.router.stores.matches.get().find((e) => e.routeId === a)?.id, l =
|
|
1427
|
+
let t = e.router.getMatch(i), o = e.router.stores.matchesId.get()[n], s = (o && e.router.stores.matchStores.get(o) || null)?.routeId === a ? o : e.router.stores.matches.get().find((e) => e.routeId === a)?.id, l = Tt(e, i);
|
|
1429
1428
|
if (t._nonReactive.loaderPromise) {
|
|
1430
1429
|
if (t.status === "success" && !e.sync && !t.preload && u) return t;
|
|
1431
1430
|
await t._nonReactive.loaderPromise;
|
|
1432
1431
|
let n = e.router.getMatch(i), a = n._nonReactive.error || n.error;
|
|
1433
|
-
a &&
|
|
1432
|
+
a && H(e, n, a), n.status === "pending" && await r(l, t, s, n, c);
|
|
1434
1433
|
} else {
|
|
1435
1434
|
let n = l && !e.router.stores.matchStores.has(i), a = e.router.getMatch(i);
|
|
1436
|
-
a._nonReactive.loaderPromise =
|
|
1435
|
+
a._nonReactive.loaderPromise = ce(), n !== a.preload && e.updateMatch(i, (e) => ({
|
|
1437
1436
|
...e,
|
|
1438
1437
|
preload: n
|
|
1439
1438
|
})), await r(l, t, s, a, c);
|
|
@@ -1448,24 +1447,24 @@ var Tt = (e) => {
|
|
|
1448
1447
|
invalid: !1
|
|
1449
1448
|
})), e.router.getMatch(i)) : d;
|
|
1450
1449
|
};
|
|
1451
|
-
async function
|
|
1450
|
+
async function Lt(e) {
|
|
1452
1451
|
let t = e, n = [];
|
|
1453
|
-
|
|
1452
|
+
wt(t.router) && Ct(t);
|
|
1454
1453
|
let r;
|
|
1455
1454
|
for (let e = 0; e < t.matches.length; e++) {
|
|
1456
1455
|
try {
|
|
1457
|
-
let n =
|
|
1458
|
-
|
|
1456
|
+
let n = Mt(t, e);
|
|
1457
|
+
A(n) && await n;
|
|
1459
1458
|
} catch (e) {
|
|
1460
|
-
if (
|
|
1461
|
-
if (
|
|
1459
|
+
if (B(e)) throw e;
|
|
1460
|
+
if (L(e)) r = e;
|
|
1462
1461
|
else if (!t.preload) throw e;
|
|
1463
1462
|
break;
|
|
1464
1463
|
}
|
|
1465
1464
|
if (t.serialError || t.firstBadMatchIndex != null) break;
|
|
1466
1465
|
}
|
|
1467
|
-
let i = t.firstBadMatchIndex ?? t.matches.length, a = r && !t.preload ?
|
|
1468
|
-
for (let e = 0; e < o; e++) n.push(
|
|
1466
|
+
let i = t.firstBadMatchIndex ?? t.matches.length, a = r && !t.preload ? Et(t, r) : void 0, o = r && t.preload ? 0 : a === void 0 ? i : Math.min(a + 1, i), s, c;
|
|
1467
|
+
for (let e = 0; e < o; e++) n.push(It(t, n, e));
|
|
1469
1468
|
try {
|
|
1470
1469
|
await Promise.all(n);
|
|
1471
1470
|
} catch {
|
|
@@ -1473,15 +1472,15 @@ async function zt(e) {
|
|
|
1473
1472
|
for (let t of e) {
|
|
1474
1473
|
if (t.status !== "rejected") continue;
|
|
1475
1474
|
let e = t.reason;
|
|
1476
|
-
if (
|
|
1477
|
-
|
|
1475
|
+
if (B(e)) throw e;
|
|
1476
|
+
L(e) ? s ??= e : c ??= e;
|
|
1478
1477
|
}
|
|
1479
1478
|
if (c !== void 0) throw c;
|
|
1480
1479
|
}
|
|
1481
1480
|
let l = s ?? (r && !t.preload ? r : void 0), u = t.firstBadMatchIndex === void 0 ? t.matches.length - 1 : t.firstBadMatchIndex;
|
|
1482
1481
|
if (!l && r && t.preload) return t.matches;
|
|
1483
1482
|
if (l) {
|
|
1484
|
-
let e =
|
|
1483
|
+
let e = Et(t, l);
|
|
1485
1484
|
if (e === void 0) {
|
|
1486
1485
|
if (process.env.NODE_ENV !== "production") throw Error("Invariant failed: Could not find match for notFound boundary");
|
|
1487
1486
|
ye();
|
|
@@ -1500,7 +1499,7 @@ async function zt(e) {
|
|
|
1500
1499
|
error: l
|
|
1501
1500
|
},
|
|
1502
1501
|
isFetching: !1
|
|
1503
|
-
})), u = e, await
|
|
1502
|
+
})), u = e, await zt(r, ["notFoundComponent"]);
|
|
1504
1503
|
} else if (!t.preload) {
|
|
1505
1504
|
let e = t.matches[0];
|
|
1506
1505
|
e.globalNotFound || t.router.getMatch(e.id)?.globalNotFound && t.updateMatch(e.id, (e) => ({
|
|
@@ -1511,12 +1510,12 @@ async function zt(e) {
|
|
|
1511
1510
|
}
|
|
1512
1511
|
if (t.serialError && t.firstBadMatchIndex !== void 0) {
|
|
1513
1512
|
let e = t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];
|
|
1514
|
-
await
|
|
1513
|
+
await zt(e, ["errorComponent"]);
|
|
1515
1514
|
}
|
|
1516
1515
|
for (let e = 0; e <= u; e++) {
|
|
1517
1516
|
let { id: n, routeId: r } = t.matches[e], i = t.router.looseRoutesById[r];
|
|
1518
1517
|
try {
|
|
1519
|
-
let e =
|
|
1518
|
+
let e = Nt(t, n, i);
|
|
1520
1519
|
if (e) {
|
|
1521
1520
|
let r = await e;
|
|
1522
1521
|
t.updateMatch(n, (e) => ({
|
|
@@ -1528,42 +1527,42 @@ async function zt(e) {
|
|
|
1528
1527
|
console.error(`Error executing head for route ${r}:`, e);
|
|
1529
1528
|
}
|
|
1530
1529
|
}
|
|
1531
|
-
let d =
|
|
1532
|
-
if (
|
|
1530
|
+
let d = Ct(t);
|
|
1531
|
+
if (A(d) && await d, l) throw l;
|
|
1533
1532
|
if (t.serialError && !t.preload && !t.onReady) throw t.serialError;
|
|
1534
1533
|
return t.matches;
|
|
1535
1534
|
}
|
|
1536
|
-
function
|
|
1535
|
+
function Rt(e, t) {
|
|
1537
1536
|
let n = t.map((t) => e.options[t]?.preload?.()).filter(Boolean);
|
|
1538
1537
|
if (n.length !== 0) return Promise.all(n);
|
|
1539
1538
|
}
|
|
1540
|
-
function
|
|
1539
|
+
function zt(e, t = Vt) {
|
|
1541
1540
|
!e._lazyLoaded && e._lazyPromise === void 0 && (e.lazyFn ? e._lazyPromise = e.lazyFn().then((t) => {
|
|
1542
1541
|
let { id: n, ...r } = t.options;
|
|
1543
1542
|
Object.assign(e.options, r), e._lazyLoaded = !0, e._lazyPromise = void 0;
|
|
1544
1543
|
}) : e._lazyLoaded = !0);
|
|
1545
|
-
let n = () => e._componentsLoaded ? void 0 : t ===
|
|
1544
|
+
let n = () => e._componentsLoaded ? void 0 : t === Vt ? (() => {
|
|
1546
1545
|
if (e._componentsPromise === void 0) {
|
|
1547
|
-
let t =
|
|
1546
|
+
let t = Rt(e, Vt);
|
|
1548
1547
|
t ? e._componentsPromise = t.then(() => {
|
|
1549
1548
|
e._componentsLoaded = !0, e._componentsPromise = void 0;
|
|
1550
1549
|
}) : e._componentsLoaded = !0;
|
|
1551
1550
|
}
|
|
1552
1551
|
return e._componentsPromise;
|
|
1553
|
-
})() :
|
|
1552
|
+
})() : Rt(e, t);
|
|
1554
1553
|
return e._lazyPromise ? e._lazyPromise.then(n) : n();
|
|
1555
1554
|
}
|
|
1556
|
-
function
|
|
1557
|
-
for (let t of
|
|
1555
|
+
function Bt(e) {
|
|
1556
|
+
for (let t of Vt) if (e.options[t]?.preload) return !0;
|
|
1558
1557
|
return !1;
|
|
1559
1558
|
}
|
|
1560
|
-
var
|
|
1559
|
+
var Vt = [
|
|
1561
1560
|
"component",
|
|
1562
1561
|
"errorComponent",
|
|
1563
1562
|
"pendingComponent",
|
|
1564
1563
|
"notFoundComponent"
|
|
1565
|
-
],
|
|
1566
|
-
function
|
|
1564
|
+
], W = "__TSR_index", Ht = "popstate", Ut = "beforeunload";
|
|
1565
|
+
function Wt(e) {
|
|
1567
1566
|
let t = e.getLocation(), n = /* @__PURE__ */ new Set(), r = (r) => {
|
|
1568
1567
|
t = e.getLocation(), n.forEach((e) => e({
|
|
1569
1568
|
location: t,
|
|
@@ -1578,7 +1577,7 @@ function Gt(e) {
|
|
|
1578
1577
|
}
|
|
1579
1578
|
let a = e.getBlockers?.() ?? [], o = i.type === "PUSH" || i.type === "REPLACE";
|
|
1580
1579
|
if (typeof document < "u" && a.length && o) for (let n of a) {
|
|
1581
|
-
let r =
|
|
1580
|
+
let r = G(i.path, i.state);
|
|
1582
1581
|
if (await n.blockerFn({
|
|
1583
1582
|
currentLocation: t,
|
|
1584
1583
|
nextLocation: r,
|
|
@@ -1602,8 +1601,8 @@ function Gt(e) {
|
|
|
1602
1601
|
n.delete(e);
|
|
1603
1602
|
}),
|
|
1604
1603
|
push: (n, i, o) => {
|
|
1605
|
-
let s = t.state[
|
|
1606
|
-
i =
|
|
1604
|
+
let s = t.state[W];
|
|
1605
|
+
i = Gt(s + 1, i), a({
|
|
1607
1606
|
task: () => {
|
|
1608
1607
|
e.pushState(n, i), r({ type: "PUSH" });
|
|
1609
1608
|
},
|
|
@@ -1614,8 +1613,8 @@ function Gt(e) {
|
|
|
1614
1613
|
});
|
|
1615
1614
|
},
|
|
1616
1615
|
replace: (n, i, o) => {
|
|
1617
|
-
let s = t.state[
|
|
1618
|
-
i =
|
|
1616
|
+
let s = t.state[W];
|
|
1617
|
+
i = Gt(s, i), a({
|
|
1619
1618
|
task: () => {
|
|
1620
1619
|
e.replaceState(n, i), r({ type: "REPLACE" });
|
|
1621
1620
|
},
|
|
@@ -1655,7 +1654,7 @@ function Gt(e) {
|
|
|
1655
1654
|
type: "FORWARD"
|
|
1656
1655
|
});
|
|
1657
1656
|
},
|
|
1658
|
-
canGoBack: () => t.state[
|
|
1657
|
+
canGoBack: () => t.state[W] !== 0,
|
|
1659
1658
|
createHref: (t) => e.createHref(t),
|
|
1660
1659
|
block: (t) => {
|
|
1661
1660
|
if (!e.setBlockers) return () => {};
|
|
@@ -1670,22 +1669,22 @@ function Gt(e) {
|
|
|
1670
1669
|
notify: r
|
|
1671
1670
|
};
|
|
1672
1671
|
}
|
|
1673
|
-
function
|
|
1672
|
+
function Gt(e, t) {
|
|
1674
1673
|
t ||= {};
|
|
1675
|
-
let n =
|
|
1674
|
+
let n = Xt();
|
|
1676
1675
|
return {
|
|
1677
1676
|
...t,
|
|
1678
1677
|
key: n,
|
|
1679
1678
|
__TSR_key: n,
|
|
1680
|
-
[
|
|
1679
|
+
[W]: e
|
|
1681
1680
|
};
|
|
1682
1681
|
}
|
|
1683
|
-
function
|
|
1684
|
-
let t = e?.window ?? (typeof window < "u" ? window : void 0), n = t.history.pushState, r = t.history.replaceState, i = [], a = () => i, o = (e) => i = e, s = e?.createHref ?? ((e) => e), c = e?.parseLocation ?? (() =>
|
|
1682
|
+
function Kt(e) {
|
|
1683
|
+
let t = e?.window ?? (typeof window < "u" ? window : void 0), n = t.history.pushState, r = t.history.replaceState, i = [], a = () => i, o = (e) => i = e, s = e?.createHref ?? ((e) => e), c = e?.parseLocation ?? (() => G(`${t.location.pathname}${t.location.search}${t.location.hash}`, t.history.state));
|
|
1685
1684
|
if (!t.history.state?.__TSR_key && !t.history.state?.key) {
|
|
1686
|
-
let e =
|
|
1685
|
+
let e = Xt();
|
|
1687
1686
|
t.history.replaceState({
|
|
1688
|
-
[
|
|
1687
|
+
[W]: 0,
|
|
1689
1688
|
key: e,
|
|
1690
1689
|
__TSR_key: e
|
|
1691
1690
|
}, "");
|
|
@@ -1694,7 +1693,7 @@ function qt(e) {
|
|
|
1694
1693
|
g && (C._ignoreSubscribers = !0, (g.isPush ? t.history.pushState : t.history.replaceState)(g.state, "", g.href), C._ignoreSubscribers = !1, g = void 0, _ = void 0, u = void 0);
|
|
1695
1694
|
}, y = (e, t, n) => {
|
|
1696
1695
|
let r = s(t);
|
|
1697
|
-
_ || (u = l), l =
|
|
1696
|
+
_ || (u = l), l = G(t, n), g = {
|
|
1698
1697
|
href: r,
|
|
1699
1698
|
state: n,
|
|
1700
1699
|
isPush: g?.isPush || e === "push"
|
|
@@ -1706,7 +1705,7 @@ function qt(e) {
|
|
|
1706
1705
|
f = !1;
|
|
1707
1706
|
return;
|
|
1708
1707
|
}
|
|
1709
|
-
let e = c(), n = e.state[
|
|
1708
|
+
let e = c(), n = e.state[W] - l.state[W], r = n === 1, i = n === -1, o = !r && !i || d;
|
|
1710
1709
|
d = !1;
|
|
1711
1710
|
let s = o ? "GO" : i ? "BACK" : "FORWARD", u = o ? {
|
|
1712
1711
|
type: "GO",
|
|
@@ -1745,7 +1744,7 @@ function qt(e) {
|
|
|
1745
1744
|
}
|
|
1746
1745
|
}
|
|
1747
1746
|
if (t) return e.preventDefault(), e.returnValue = "";
|
|
1748
|
-
}, C =
|
|
1747
|
+
}, C = Wt({
|
|
1749
1748
|
getLocation: h,
|
|
1750
1749
|
getLength: () => t.history.length,
|
|
1751
1750
|
pushState: (e, t) => y("push", e, t),
|
|
@@ -1760,7 +1759,7 @@ function qt(e) {
|
|
|
1760
1759
|
createHref: (e) => s(e),
|
|
1761
1760
|
flush: v,
|
|
1762
1761
|
destroy: () => {
|
|
1763
|
-
t.history.pushState = n, t.history.replaceState = r, t.removeEventListener(
|
|
1762
|
+
t.history.pushState = n, t.history.replaceState = r, t.removeEventListener(Ut, S, { capture: !0 }), t.removeEventListener(Ht, x);
|
|
1764
1763
|
},
|
|
1765
1764
|
onBlocked: () => {
|
|
1766
1765
|
u && l !== u && (l = u);
|
|
@@ -1769,7 +1768,7 @@ function qt(e) {
|
|
|
1769
1768
|
setBlockers: o,
|
|
1770
1769
|
notifyOnIndexChange: !1
|
|
1771
1770
|
});
|
|
1772
|
-
return t.addEventListener(
|
|
1771
|
+
return t.addEventListener(Ut, S, { capture: !0 }), t.addEventListener(Ht, x), t.history.pushState = function(...e) {
|
|
1773
1772
|
let r = n.apply(t.history, e);
|
|
1774
1773
|
return C._ignoreSubscribers || b("PUSH"), r;
|
|
1775
1774
|
}, t.history.replaceState = function(...e) {
|
|
@@ -1777,20 +1776,20 @@ function qt(e) {
|
|
|
1777
1776
|
return C._ignoreSubscribers || b("REPLACE"), n;
|
|
1778
1777
|
}, C;
|
|
1779
1778
|
}
|
|
1780
|
-
function
|
|
1779
|
+
function qt(e) {
|
|
1781
1780
|
let t = e?.window ?? (typeof window < "u" ? window : void 0);
|
|
1782
|
-
return
|
|
1781
|
+
return Kt({
|
|
1783
1782
|
window: t,
|
|
1784
1783
|
parseLocation: () => {
|
|
1785
1784
|
let e = t.location.hash.split("#").slice(1), n = e[0] ?? "/", r = t.location.search, i = e.slice(1);
|
|
1786
|
-
return
|
|
1785
|
+
return G(`${n}${r}${i.length === 0 ? "" : `#${i.join("#")}`}`, t.history.state);
|
|
1787
1786
|
},
|
|
1788
1787
|
createHref: (e) => `${t.location.pathname}${t.location.search}#${e}`
|
|
1789
1788
|
});
|
|
1790
1789
|
}
|
|
1791
|
-
function
|
|
1792
|
-
let t = e.initialEntries, n = e.initialIndex ? Math.min(Math.max(e.initialIndex, 0), t.length - 1) : t.length - 1, r = t.map((e, t) =>
|
|
1793
|
-
return
|
|
1790
|
+
function Jt(e = { initialEntries: ["/"] }) {
|
|
1791
|
+
let t = e.initialEntries, n = e.initialIndex ? Math.min(Math.max(e.initialIndex, 0), t.length - 1) : t.length - 1, r = t.map((e, t) => Gt(t, void 0)), i = () => G(t[n], r[n]), a = [];
|
|
1792
|
+
return Wt({
|
|
1794
1793
|
getLocation: i,
|
|
1795
1794
|
getLength: () => t.length,
|
|
1796
1795
|
pushState: (e, i) => {
|
|
@@ -1813,30 +1812,30 @@ function Yt(e = { initialEntries: ["/"] }) {
|
|
|
1813
1812
|
setBlockers: (e) => a = e
|
|
1814
1813
|
});
|
|
1815
1814
|
}
|
|
1816
|
-
function
|
|
1815
|
+
function Yt(e) {
|
|
1817
1816
|
let t = e.replace(/[\x00-\x1f\x7f]/g, "");
|
|
1818
1817
|
return t.startsWith("//") && (t = "/" + t.replace(/^\/+/, "")), t;
|
|
1819
1818
|
}
|
|
1820
|
-
function
|
|
1821
|
-
let n =
|
|
1819
|
+
function G(e, t) {
|
|
1820
|
+
let n = Yt(e), r = n.indexOf("#"), i = n.indexOf("?"), a = Xt();
|
|
1822
1821
|
return {
|
|
1823
1822
|
href: n,
|
|
1824
1823
|
pathname: n.substring(0, r > 0 ? i > 0 ? Math.min(r, i) : r : i > 0 ? i : n.length),
|
|
1825
1824
|
hash: r > -1 ? n.substring(r) : "",
|
|
1826
1825
|
search: i > -1 ? n.slice(i, r === -1 ? void 0 : r) : "",
|
|
1827
1826
|
state: t || {
|
|
1828
|
-
[
|
|
1827
|
+
[W]: 0,
|
|
1829
1828
|
key: a,
|
|
1830
1829
|
__TSR_key: a
|
|
1831
1830
|
}
|
|
1832
1831
|
};
|
|
1833
1832
|
}
|
|
1834
|
-
function
|
|
1833
|
+
function Xt() {
|
|
1835
1834
|
return (Math.random() + 1).toString(36).substring(7);
|
|
1836
1835
|
}
|
|
1837
1836
|
//#endregion
|
|
1838
1837
|
//#region ../router-core/dist/esm/router.js
|
|
1839
|
-
function
|
|
1838
|
+
function K(e, t) {
|
|
1840
1839
|
let n = t, r = e;
|
|
1841
1840
|
return {
|
|
1842
1841
|
fromLocation: n,
|
|
@@ -1846,7 +1845,7 @@ function G(e, t) {
|
|
|
1846
1845
|
hashChanged: n?.hash !== r.hash
|
|
1847
1846
|
};
|
|
1848
1847
|
}
|
|
1849
|
-
var
|
|
1848
|
+
var Zt = class {
|
|
1850
1849
|
constructor(e, t) {
|
|
1851
1850
|
this.tempLocationKey = `${Math.round(Math.random() * 1e7)}`, this.resetNextScroll = !0, this.shouldViewTransition = void 0, this.isViewTransitionTypesSupported = void 0, this.subscribers = /* @__PURE__ */ new Set(), this.isScrollRestoring = !1, this.isScrollRestorationSetup = !1, this.routeBranchCache = /* @__PURE__ */ new WeakMap(), this.startTransition = (e) => e(), this.update = (e) => {
|
|
1852
1851
|
process.env.NODE_ENV !== "production" && e.notFoundRoute && console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");
|
|
@@ -1854,33 +1853,33 @@ var Qt = class {
|
|
|
1854
1853
|
if (this.options = {
|
|
1855
1854
|
...t,
|
|
1856
1855
|
...e
|
|
1857
|
-
}, this.isServer = this.options.isServer ?? typeof document > "u", this.protocolAllowlist = new Set(this.options.protocolAllowlist), this.options.pathParamsAllowedCharacters && (this.pathParamsDecoder =
|
|
1856
|
+
}, this.isServer = this.options.isServer ?? typeof document > "u", this.protocolAllowlist = new Set(this.options.protocolAllowlist), this.options.pathParamsAllowedCharacters && (this.pathParamsDecoder = Je(this.options.pathParamsAllowedCharacters)), (!this.history || this.options.history && this.options.history !== this.history) && (this.options.history ? this.history = this.options.history : typeof window < "u" && (this.history = Kt())), this.origin = this.options.origin, !this.origin) {
|
|
1858
1857
|
let e = globalThis.window;
|
|
1859
1858
|
e && e.origin && e.origin !== "null" ? this.origin = e.origin : this.origin = "http://localhost";
|
|
1860
1859
|
}
|
|
1861
1860
|
if (this.history && this.updateLatestLocation(), this.options.routeTree !== this.routeTree) {
|
|
1862
1861
|
this.routeTree = this.options.routeTree;
|
|
1863
1862
|
let e;
|
|
1864
|
-
this.resolvePathCache =
|
|
1863
|
+
this.resolvePathCache = M(1e3), e = this.buildRouteTree(), this.setRoutes(e);
|
|
1865
1864
|
}
|
|
1866
1865
|
if (!this.stores && this.latestLocation) {
|
|
1867
1866
|
let e = this.getStoreConfig(this);
|
|
1868
|
-
this.batch = e.batch, this.stores =
|
|
1867
|
+
this.batch = e.batch, this.stores = bt(rn(this.latestLocation), e), st(this);
|
|
1869
1868
|
}
|
|
1870
1869
|
let a = !1, o = this.options.basepath ?? "/", s = this.options.rewrite;
|
|
1871
1870
|
if (r || n !== o || i !== s) {
|
|
1872
1871
|
this.basepath = o;
|
|
1873
|
-
let e = [], t =
|
|
1874
|
-
t && t !== "/" && e.push(
|
|
1872
|
+
let e = [], t = We(o);
|
|
1873
|
+
t && t !== "/" && e.push(_t({ basepath: o })), s && e.push(s), this.rewrite = e.length === 0 ? void 0 : e.length === 1 ? e[0] : gt(e), this.history && this.updateLatestLocation(), a = !0;
|
|
1875
1874
|
}
|
|
1876
1875
|
a && this.stores && this.stores.location.set(this.latestLocation), typeof window < "u" && "CSS" in window && typeof window.CSS?.supports == "function" && (this.isViewTransitionTypesSupported = window.CSS.supports("selector(:active-view-transition-type(a))"));
|
|
1877
1876
|
}, this.updateLatestLocation = () => {
|
|
1878
1877
|
this.latestLocation = this.parseLocation(this.history.location, this.latestLocation);
|
|
1879
1878
|
}, this.buildRouteTree = () => {
|
|
1880
|
-
let e =
|
|
1879
|
+
let e = je(this.routeTree, this.options.caseSensitive, (e, t) => {
|
|
1881
1880
|
e.init({ originalIndex: t });
|
|
1882
1881
|
});
|
|
1883
|
-
return this.options.routeMasks &&
|
|
1882
|
+
return this.options.routeMasks && Ee(this.options.routeMasks, e.processedTree), e;
|
|
1884
1883
|
}, this.subscribe = (e, t) => {
|
|
1885
1884
|
let n = {
|
|
1886
1885
|
eventType: e,
|
|
@@ -1900,23 +1899,23 @@ var Qt = class {
|
|
|
1900
1899
|
return {
|
|
1901
1900
|
href: e + o + r,
|
|
1902
1901
|
publicHref: e + o + r,
|
|
1903
|
-
pathname:
|
|
1902
|
+
pathname: j(e).path,
|
|
1904
1903
|
external: !1,
|
|
1905
1904
|
searchStr: o,
|
|
1906
1905
|
search: E(t?.search, i),
|
|
1907
|
-
hash:
|
|
1906
|
+
hash: j(r.slice(1)).path,
|
|
1908
1907
|
state: D(t?.state, a)
|
|
1909
1908
|
};
|
|
1910
1909
|
}
|
|
1911
|
-
let o = new URL(i, this.origin), s =
|
|
1910
|
+
let o = new URL(i, this.origin), s = vt(this.rewrite, o), c = this.options.parseSearch(s.search), l = this.options.stringifySearch(c);
|
|
1912
1911
|
return s.search = l, {
|
|
1913
1912
|
href: s.href.replace(s.origin, ""),
|
|
1914
1913
|
publicHref: i,
|
|
1915
|
-
pathname:
|
|
1914
|
+
pathname: j(s.pathname).path,
|
|
1916
1915
|
external: !!this.rewrite && s.origin !== this.origin,
|
|
1917
1916
|
searchStr: l,
|
|
1918
1917
|
search: E(t?.search, c),
|
|
1919
|
-
hash:
|
|
1918
|
+
hash: j(s.hash.slice(1)).path,
|
|
1920
1919
|
state: D(t?.state, a)
|
|
1921
1920
|
};
|
|
1922
1921
|
}, r = n(e), { __tempLocation: i, __tempKey: a } = r.state;
|
|
@@ -1928,15 +1927,15 @@ var Qt = class {
|
|
|
1928
1927
|
};
|
|
1929
1928
|
}
|
|
1930
1929
|
return r;
|
|
1931
|
-
}, this.resolvePathWithBase = (e, t) =>
|
|
1930
|
+
}, this.resolvePathWithBase = (e, t) => qe({
|
|
1932
1931
|
base: e,
|
|
1933
|
-
to: t.includes("//") ?
|
|
1932
|
+
to: t.includes("//") ? He(t) : t,
|
|
1934
1933
|
trailingSlash: this.options.trailingSlash,
|
|
1935
1934
|
cache: this.resolvePathCache
|
|
1936
1935
|
}), this.matchRoutes = (e, t, n) => typeof e == "string" ? this.matchRoutesInternal({
|
|
1937
1936
|
pathname: e,
|
|
1938
1937
|
search: t
|
|
1939
|
-
}, n) : this.matchRoutesInternal(e, t), this.getMatchedRoutes = (e) =>
|
|
1938
|
+
}, n) : this.matchRoutesInternal(e, t), this.getMatchedRoutes = (e) => on({
|
|
1940
1939
|
pathname: e,
|
|
1941
1940
|
routesById: this.routesById,
|
|
1942
1941
|
processedTree: this.processedTree
|
|
@@ -1955,10 +1954,10 @@ var Qt = class {
|
|
|
1955
1954
|
let t = (t = {}) => {
|
|
1956
1955
|
let n = t._fromLocation || this.pendingBuiltLocation || this.latestLocation, r = this.matchRoutesLightweight(n);
|
|
1957
1956
|
if (t.from && process.env.NODE_ENV !== "production" && t._isNavigate) {
|
|
1958
|
-
let e = this.getMatchedRoutes(t.from).matchedRoutes, n =
|
|
1957
|
+
let e = this.getMatchedRoutes(t.from).matchedRoutes, n = le(r.matchedRoutes, (e) => tn(e.fullPath, t.from)), i = le(e, (e) => tn(e.fullPath, r.fullPath));
|
|
1959
1958
|
!n && !i && console.warn(`Could not find match for from: ${t.from}`);
|
|
1960
1959
|
}
|
|
1961
|
-
let i = t.unsafeRelative === "path" ? n.pathname : t.from ?? r.fullPath, a = t.to ? `${t.to}` : void 0, o = r.search, s = Object.assign(Object.create(null), r.params), c = a?.charCodeAt(0) === 47 ? "/" : this.resolvePathWithBase(i, "."), l = a ? this.resolvePathWithBase(c, a) : c, u = t.params === !1 || t.params === null ? Object.create(null) : (t.params ?? !0) === !0 ? s : Object.assign(s, T(t.params, s)), d = this.routesByPath[
|
|
1960
|
+
let i = t.unsafeRelative === "path" ? n.pathname : t.from ?? r.fullPath, a = t.to ? `${t.to}` : void 0, o = r.search, s = Object.assign(Object.create(null), r.params), c = a?.charCodeAt(0) === 47 ? "/" : this.resolvePathWithBase(i, "."), l = a ? this.resolvePathWithBase(c, a) : c, u = t.params === !1 || t.params === null ? Object.create(null) : (t.params ?? !0) === !0 ? s : Object.assign(s, T(t.params, s)), d = this.routesByPath[I(l)], f;
|
|
1962
1961
|
if (d) f = this.getRouteBranch(d);
|
|
1963
1962
|
else if (l.includes("$")) f = [];
|
|
1964
1963
|
else {
|
|
@@ -1971,7 +1970,7 @@ var Qt = class {
|
|
|
1971
1970
|
Object.assign(u, t(u));
|
|
1972
1971
|
} catch {}
|
|
1973
1972
|
}
|
|
1974
|
-
let p = e.leaveParams ? l :
|
|
1973
|
+
let p = e.leaveParams ? l : j(Xe({
|
|
1975
1974
|
path: l,
|
|
1976
1975
|
params: u,
|
|
1977
1976
|
decoder: this.pathParamsDecoder,
|
|
@@ -1985,14 +1984,14 @@ var Qt = class {
|
|
|
1985
1984
|
let e = {};
|
|
1986
1985
|
f.forEach((t) => {
|
|
1987
1986
|
if (t.options.validateSearch) try {
|
|
1988
|
-
Object.assign(e,
|
|
1987
|
+
Object.assign(e, an(t.options.validateSearch, {
|
|
1989
1988
|
...e,
|
|
1990
1989
|
...m
|
|
1991
1990
|
}));
|
|
1992
1991
|
} catch {}
|
|
1993
1992
|
}), m = e;
|
|
1994
1993
|
}
|
|
1995
|
-
m =
|
|
1994
|
+
m = sn({
|
|
1996
1995
|
search: m,
|
|
1997
1996
|
dest: t,
|
|
1998
1997
|
destRoutes: f,
|
|
@@ -2002,7 +2001,7 @@ var Qt = class {
|
|
|
2002
2001
|
v = D(n.state, v);
|
|
2003
2002
|
let y = `${p}${h}${_}`, b, x, S = !1;
|
|
2004
2003
|
if (this.rewrite) {
|
|
2005
|
-
let e = new URL(y, this.origin), t =
|
|
2004
|
+
let e = new URL(y, this.origin), t = yt(this.rewrite, e);
|
|
2006
2005
|
b = e.href.replace(e.origin, ""), t.origin === this.origin ? x = t.pathname + t.search + t.hash : (x = t.href, S = !0);
|
|
2007
2006
|
} else b = _e(y), x = b;
|
|
2008
2007
|
return {
|
|
@@ -2021,7 +2020,7 @@ var Qt = class {
|
|
|
2021
2020
|
if (!a) {
|
|
2022
2021
|
let n = Object.create(null);
|
|
2023
2022
|
if (this.options.routeMasks) {
|
|
2024
|
-
let o =
|
|
2023
|
+
let o = De(i.pathname, this.processedTree);
|
|
2025
2024
|
if (o) {
|
|
2026
2025
|
Object.assign(n, o.rawParams);
|
|
2027
2026
|
let { from: i, params: s, ...c } = o.route, l = s === !1 || s === null ? Object.create(null) : (s ?? !0) === !0 ? n : Object.assign(n, T(s, n));
|
|
@@ -2054,8 +2053,8 @@ var Qt = class {
|
|
|
2054
2053
|
return e.forEach((e) => {
|
|
2055
2054
|
delete n.state[e];
|
|
2056
2055
|
}), t;
|
|
2057
|
-
}, i =
|
|
2058
|
-
if (this.commitLocationPromise =
|
|
2056
|
+
}, i = I(this.latestLocation.href) === I(n.href), a = this.commitLocationPromise;
|
|
2057
|
+
if (this.commitLocationPromise = ce(() => {
|
|
2059
2058
|
a?.resolve(), a = void 0;
|
|
2060
2059
|
}), i && r()) this.load();
|
|
2061
2060
|
else {
|
|
@@ -2082,8 +2081,8 @@ var Qt = class {
|
|
|
2082
2081
|
return this.resetNextScroll = n.resetScroll ?? !0, this.history.subscribers.size || this.load(), this.commitLocationPromise;
|
|
2083
2082
|
}, this.buildAndCommitLocation = ({ replace: e, resetScroll: t, hashScrollIntoView: n, viewTransition: r, ignoreBlocker: i, href: a, ...o } = {}) => {
|
|
2084
2083
|
if (a) {
|
|
2085
|
-
let t = this.history.location.state.__TSR_index, n =
|
|
2086
|
-
o.to =
|
|
2084
|
+
let t = this.history.location.state.__TSR_index, n = G(a, { __TSR_index: e ? t : t + 1 }), r = new URL(n.pathname, this.origin);
|
|
2085
|
+
o.to = vt(this.rewrite, r).pathname, o.search = this.options.parseSearch(n.search), o.hash = n.hash.slice(1);
|
|
2087
2086
|
}
|
|
2088
2087
|
let s = this.buildLocation({
|
|
2089
2088
|
...o,
|
|
@@ -2115,7 +2114,7 @@ var Qt = class {
|
|
|
2115
2114
|
n ??= t.publicHref, r ??= t.publicHref;
|
|
2116
2115
|
}
|
|
2117
2116
|
let t = !a && r ? r : n;
|
|
2118
|
-
if (
|
|
2117
|
+
if (pe(t, this.protocolAllowlist)) return process.env.NODE_ENV !== "production" && console.warn(`Blocked navigation to dangerous protocol: ${t}`), Promise.resolve();
|
|
2119
2118
|
if (!i.ignoreBlocker) {
|
|
2120
2119
|
let e = this.history.getBlockers?.() ?? [];
|
|
2121
2120
|
for (let t of e) if (t?.blockerFn && await t.blockerFn({
|
|
@@ -2144,14 +2143,14 @@ var Qt = class {
|
|
|
2144
2143
|
this.startTransition(async () => {
|
|
2145
2144
|
try {
|
|
2146
2145
|
this.beforeLoad();
|
|
2147
|
-
let t = this.latestLocation, n =
|
|
2146
|
+
let t = this.latestLocation, n = K(t, this.stores.resolvedLocation.get());
|
|
2148
2147
|
this.stores.redirect.get() || this.emit({
|
|
2149
2148
|
type: "onBeforeNavigate",
|
|
2150
2149
|
...n
|
|
2151
2150
|
}), this.emit({
|
|
2152
2151
|
type: "onBeforeLoad",
|
|
2153
2152
|
...n
|
|
2154
|
-
}), await
|
|
2153
|
+
}), await Lt({
|
|
2155
2154
|
router: this,
|
|
2156
2155
|
sync: e?.sync,
|
|
2157
2156
|
forceStaleReload: i.href === t.href,
|
|
@@ -2181,11 +2180,11 @@ var Qt = class {
|
|
|
2181
2180
|
}
|
|
2182
2181
|
});
|
|
2183
2182
|
} catch (e) {
|
|
2184
|
-
|
|
2183
|
+
B(e) ? (t = e, this.navigate({
|
|
2185
2184
|
...t.options,
|
|
2186
2185
|
replace: !0,
|
|
2187
2186
|
ignoreBlocker: !0
|
|
2188
|
-
})) :
|
|
2187
|
+
})) : L(e) && (n = e);
|
|
2189
2188
|
let r = t ? t.status : n ? 404 : this.stores.matches.get().some((e) => e.status === "error") ? 500 : 200;
|
|
2190
2189
|
this.batch(() => {
|
|
2191
2190
|
this.stores.statusCode.set(r), this.stores.redirect.set(t);
|
|
@@ -2201,7 +2200,7 @@ var Qt = class {
|
|
|
2201
2200
|
if (this.shouldViewTransition = void 0, t && typeof document < "u" && "startViewTransition" in document && typeof document.startViewTransition == "function") {
|
|
2202
2201
|
let n;
|
|
2203
2202
|
if (typeof t == "object" && this.isViewTransitionTypesSupported) {
|
|
2204
|
-
let r = this.latestLocation, i = this.stores.resolvedLocation.get(), a = typeof t.types == "function" ? t.types(
|
|
2203
|
+
let r = this.latestLocation, i = this.stores.resolvedLocation.get(), a = typeof t.types == "function" ? t.types(K(r, i)) : t.types;
|
|
2205
2204
|
if (a === !1) {
|
|
2206
2205
|
e();
|
|
2207
2206
|
return;
|
|
@@ -2255,7 +2254,7 @@ var Qt = class {
|
|
|
2255
2254
|
e.options.href = t, e.headers.set("Location", t);
|
|
2256
2255
|
}
|
|
2257
2256
|
} catch {}
|
|
2258
|
-
if (e.options.href && !e.options._builtLocation &&
|
|
2257
|
+
if (e.options.href && !e.options._builtLocation && pe(e.options.href, this.protocolAllowlist)) throw Error(process.env.NODE_ENV === "production" ? "Redirect blocked: unsafe protocol" : `Redirect blocked: unsafe protocol in href "${e.options.href}". Allowed protocols: ${Array.from(this.protocolAllowlist).join(", ")}.`);
|
|
2259
2258
|
return e.headers.get("Location") || e.headers.set("Location", e.options.href), e;
|
|
2260
2259
|
}, this.clearCache = (e) => {
|
|
2261
2260
|
let t = e?.filter;
|
|
@@ -2268,7 +2267,7 @@ var Qt = class {
|
|
|
2268
2267
|
let r = (t.preload ? n.options.preloadGcTime ?? this.options.defaultPreloadGcTime : n.options.gcTime ?? this.options.defaultGcTime) ?? 300 * 1e3;
|
|
2269
2268
|
return t.status === "error" ? !0 : e - t.updatedAt >= r;
|
|
2270
2269
|
} });
|
|
2271
|
-
}, this.loadRouteChunk =
|
|
2270
|
+
}, this.loadRouteChunk = zt, this.preloadRoute = async (e) => {
|
|
2272
2271
|
let t = e._builtLocation ?? this.buildLocation(e), n = this.matchRoutes(t, {
|
|
2273
2272
|
throwOnError: !0,
|
|
2274
2273
|
preload: !0,
|
|
@@ -2279,7 +2278,7 @@ var Qt = class {
|
|
|
2279
2278
|
this.stores.setCached([...e, ...a]);
|
|
2280
2279
|
}
|
|
2281
2280
|
try {
|
|
2282
|
-
return n = await
|
|
2281
|
+
return n = await Lt({
|
|
2283
2282
|
router: this,
|
|
2284
2283
|
matches: n,
|
|
2285
2284
|
location: t,
|
|
@@ -2289,11 +2288,11 @@ var Qt = class {
|
|
|
2289
2288
|
}
|
|
2290
2289
|
}), n;
|
|
2291
2290
|
} catch (e) {
|
|
2292
|
-
if (
|
|
2291
|
+
if (B(e)) return e.options.reloadDocument ? void 0 : await this.preloadRoute({
|
|
2293
2292
|
...e.options,
|
|
2294
2293
|
_fromLocation: t
|
|
2295
2294
|
});
|
|
2296
|
-
|
|
2295
|
+
L(e) || console.error(e);
|
|
2297
2296
|
return;
|
|
2298
2297
|
}
|
|
2299
2298
|
}, this.matchRoute = (e, t) => {
|
|
@@ -2304,7 +2303,7 @@ var Qt = class {
|
|
|
2304
2303
|
leaveParams: !0
|
|
2305
2304
|
}, r = this.buildLocation(n);
|
|
2306
2305
|
if (t?.pending && this.stores.status.get() !== "pending") return !1;
|
|
2307
|
-
let i = (t?.pending === void 0 ? !this.stores.isLoading.get() : t.pending) ? this.latestLocation : this.stores.resolvedLocation.get() || this.stores.location.get(), a =
|
|
2306
|
+
let i = (t?.pending === void 0 ? !this.stores.isLoading.get() : t.pending) ? this.latestLocation : this.stores.resolvedLocation.get() || this.stores.location.get(), a = Oe(r.pathname, t?.caseSensitive ?? !1, t?.fuzzy ?? !1, i.pathname, this.processedTree);
|
|
2308
2307
|
return !a || e.params && !k(a.rawParams, e.params, { partial: !0 }) ? !1 : t?.includeSearch ?? !0 ? k(i.search, r.search, { partial: !0 }) ? a.rawParams : !1 : a.rawParams;
|
|
2309
2308
|
}, this.hasNotFoundMatch = () => this.stores.matches.get().some((e) => e.status === "notFound" || e.globalNotFound), this.getStoreConfig = t, this.update({
|
|
2310
2309
|
defaultPreloadDelay: 50,
|
|
@@ -2314,9 +2313,9 @@ var Qt = class {
|
|
|
2314
2313
|
...e,
|
|
2315
2314
|
caseSensitive: e.caseSensitive ?? !1,
|
|
2316
2315
|
notFoundMode: e.notFoundMode ?? "fuzzy",
|
|
2317
|
-
stringifySearch: e.stringifySearch ??
|
|
2318
|
-
parseSearch: e.parseSearch ??
|
|
2319
|
-
protocolAllowlist: e.protocolAllowlist ??
|
|
2316
|
+
stringifySearch: e.stringifySearch ?? ft,
|
|
2317
|
+
parseSearch: e.parseSearch ?? dt,
|
|
2318
|
+
protocolAllowlist: e.protocolAllowlist ?? fe
|
|
2320
2319
|
}), typeof document < "u" && (self.__TSR_ROUTER__ = this);
|
|
2321
2320
|
}
|
|
2322
2321
|
isShell() {
|
|
@@ -2335,7 +2334,7 @@ var Qt = class {
|
|
|
2335
2334
|
}
|
|
2336
2335
|
getRouteBranch(e) {
|
|
2337
2336
|
let t = this.routeBranchCache.get(e);
|
|
2338
|
-
return t || (t =
|
|
2337
|
+
return t || (t = Pe(e), this.routeBranchCache.set(e, t)), t;
|
|
2339
2338
|
}
|
|
2340
2339
|
get looseRoutesById() {
|
|
2341
2340
|
return this.routesById;
|
|
@@ -2345,15 +2344,15 @@ var Qt = class {
|
|
|
2345
2344
|
}
|
|
2346
2345
|
matchRoutesInternal(e, t) {
|
|
2347
2346
|
let n = this.getMatchedRoutes(e.pathname), { foundRoute: r, routeParams: i } = n, { matchedRoutes: a } = n, o = !1;
|
|
2348
|
-
(r ? r.path !== "/" && i["**"] :
|
|
2349
|
-
let s = o ?
|
|
2347
|
+
(r ? r.path !== "/" && i["**"] : I(e.pathname)) && (this.options.notFoundRoute ? a = [...a, this.options.notFoundRoute] : o = !0);
|
|
2348
|
+
let s = o ? ln(this.options.notFoundMode, a) : void 0, c = Array(a.length), l = /* @__PURE__ */ new Map();
|
|
2350
2349
|
for (let e of this.stores.matchStores.values()) e.routeId && l.set(e.routeId, e.get());
|
|
2351
2350
|
for (let n = 0; n < a.length; n++) {
|
|
2352
2351
|
let r = a[n], o = c[n - 1], u, d, f;
|
|
2353
2352
|
{
|
|
2354
2353
|
let n = o?.search ?? e.search, i = o?._strictSearch ?? void 0;
|
|
2355
2354
|
try {
|
|
2356
|
-
let e =
|
|
2355
|
+
let e = an(r.options.validateSearch, { ...n }) ?? void 0;
|
|
2357
2356
|
u = {
|
|
2358
2357
|
...n,
|
|
2359
2358
|
...e
|
|
@@ -2363,20 +2362,20 @@ var Qt = class {
|
|
|
2363
2362
|
}, f = void 0;
|
|
2364
2363
|
} catch (e) {
|
|
2365
2364
|
let r = e;
|
|
2366
|
-
if (e instanceof
|
|
2365
|
+
if (e instanceof Qt || (r = new Qt(e.message, { cause: e })), t?.throwOnError) throw r;
|
|
2367
2366
|
u = n, d = {}, f = r;
|
|
2368
2367
|
}
|
|
2369
2368
|
}
|
|
2370
|
-
let p = r.options.loaderDeps?.({ search: u }) ?? "", m = p ? JSON.stringify(p) : "", { interpolatedPath: h, usedParams: g } =
|
|
2369
|
+
let p = r.options.loaderDeps?.({ search: u }) ?? "", m = p ? JSON.stringify(p) : "", { interpolatedPath: h, usedParams: g } = Xe({
|
|
2371
2370
|
path: r.fullPath,
|
|
2372
2371
|
params: i,
|
|
2373
2372
|
decoder: this.pathParamsDecoder,
|
|
2374
2373
|
server: this.isServer
|
|
2375
2374
|
}), _ = r.id + h + m, v = this.getMatch(_), y = l.get(r.id), b = v?._strictParams ?? g, x;
|
|
2376
2375
|
if (!v) try {
|
|
2377
|
-
|
|
2376
|
+
un(r, b);
|
|
2378
2377
|
} catch (e) {
|
|
2379
|
-
if (x =
|
|
2378
|
+
if (x = L(e) || B(e) ? e : new $t(e.message, { cause: e }), t?.throwOnError) throw x;
|
|
2380
2379
|
}
|
|
2381
2380
|
Object.assign(i, b);
|
|
2382
2381
|
let S = y ? "stay" : "enter", C;
|
|
@@ -2389,7 +2388,7 @@ var Qt = class {
|
|
|
2389
2388
|
_strictSearch: d
|
|
2390
2389
|
};
|
|
2391
2390
|
else {
|
|
2392
|
-
let e = r.options.loader || r.options.beforeLoad || r.lazyFn ||
|
|
2391
|
+
let e = r.options.loader || r.options.beforeLoad || r.lazyFn || Bt(r) ? "pending" : "success";
|
|
2393
2392
|
C = {
|
|
2394
2393
|
id: _,
|
|
2395
2394
|
ssr: r.options.ssr,
|
|
@@ -2407,7 +2406,7 @@ var Qt = class {
|
|
|
2407
2406
|
error: void 0,
|
|
2408
2407
|
paramsError: x,
|
|
2409
2408
|
__routeContext: void 0,
|
|
2410
|
-
_nonReactive: { loadPromise:
|
|
2409
|
+
_nonReactive: { loadPromise: ce() },
|
|
2411
2410
|
__beforeLoadContext: void 0,
|
|
2412
2411
|
context: {},
|
|
2413
2412
|
abortController: new AbortController(),
|
|
@@ -2467,14 +2466,14 @@ var Qt = class {
|
|
|
2467
2466
|
matchRoutesLightweight(e) {
|
|
2468
2467
|
let { matchedRoutes: t, routeParams: n } = this.getMatchedRoutes(e.pathname), r = w(t), i = { ...e.search };
|
|
2469
2468
|
for (let e of t) try {
|
|
2470
|
-
Object.assign(i,
|
|
2469
|
+
Object.assign(i, an(e.options.validateSearch, i));
|
|
2471
2470
|
} catch {}
|
|
2472
2471
|
let a = w(this.stores.matchesId.get()), o = a && this.stores.matchStores.get(a)?.get(), s = o && o.routeId === r.id && o.pathname === e.pathname, c;
|
|
2473
2472
|
if (s) c = o.params;
|
|
2474
2473
|
else {
|
|
2475
2474
|
let e = Object.assign(Object.create(null), n);
|
|
2476
2475
|
for (let n of t) try {
|
|
2477
|
-
|
|
2476
|
+
un(n, e);
|
|
2478
2477
|
} catch {}
|
|
2479
2478
|
c = e;
|
|
2480
2479
|
}
|
|
@@ -2485,14 +2484,14 @@ var Qt = class {
|
|
|
2485
2484
|
params: c
|
|
2486
2485
|
};
|
|
2487
2486
|
}
|
|
2488
|
-
},
|
|
2489
|
-
function
|
|
2490
|
-
return
|
|
2487
|
+
}, Qt = class extends Error {}, $t = class extends Error {}, en = (e) => e.endsWith("/") && e.length > 1 ? e.slice(0, -1) : e;
|
|
2488
|
+
function tn(e, t) {
|
|
2489
|
+
return en(e) === en(t);
|
|
2491
2490
|
}
|
|
2492
|
-
function
|
|
2491
|
+
function nn(e, t) {
|
|
2493
2492
|
return async (...n) => (await e())[t || "default"](...n);
|
|
2494
2493
|
}
|
|
2495
|
-
function
|
|
2494
|
+
function rn(e) {
|
|
2496
2495
|
return {
|
|
2497
2496
|
loadedAt: 0,
|
|
2498
2497
|
isLoading: !1,
|
|
@@ -2504,28 +2503,28 @@ function an(e) {
|
|
|
2504
2503
|
statusCode: 200
|
|
2505
2504
|
};
|
|
2506
2505
|
}
|
|
2507
|
-
function
|
|
2506
|
+
function an(e, t) {
|
|
2508
2507
|
if (e == null) return {};
|
|
2509
2508
|
if ("~standard" in e) {
|
|
2510
2509
|
let n = e["~standard"].validate(t);
|
|
2511
|
-
if (n instanceof Promise) throw new
|
|
2512
|
-
if (n.issues) throw new
|
|
2510
|
+
if (n instanceof Promise) throw new Qt("Async validation not supported");
|
|
2511
|
+
if (n.issues) throw new Qt(JSON.stringify(n.issues, void 0, 2), { cause: n });
|
|
2513
2512
|
return n.value;
|
|
2514
2513
|
}
|
|
2515
2514
|
return "parse" in e ? e.parse(t) : typeof e == "function" ? e(t) : {};
|
|
2516
2515
|
}
|
|
2517
|
-
function
|
|
2518
|
-
let r = Object.create(null), i =
|
|
2516
|
+
function on({ pathname: e, routesById: t, processedTree: n }) {
|
|
2517
|
+
let r = Object.create(null), i = I(e), a, o = ke(i, n, !0);
|
|
2519
2518
|
return o && (a = o.route, Object.assign(r, o.rawParams)), {
|
|
2520
2519
|
matchedRoutes: o?.branch || [t.__root__],
|
|
2521
2520
|
routeParams: r,
|
|
2522
2521
|
foundRoute: a
|
|
2523
2522
|
};
|
|
2524
2523
|
}
|
|
2525
|
-
function
|
|
2526
|
-
return
|
|
2524
|
+
function sn({ search: e, dest: t, destRoutes: n, _includeValidateSearch: r }) {
|
|
2525
|
+
return cn(n)(e, t, r ?? !1);
|
|
2527
2526
|
}
|
|
2528
|
-
function
|
|
2527
|
+
function cn(e) {
|
|
2529
2528
|
let t = {
|
|
2530
2529
|
dest: null,
|
|
2531
2530
|
_includeValidateSearch: !1,
|
|
@@ -2542,7 +2541,7 @@ function ln(e) {
|
|
|
2542
2541
|
try {
|
|
2543
2542
|
return {
|
|
2544
2543
|
...i,
|
|
2545
|
-
...
|
|
2544
|
+
...an(n.options.validateSearch, i) ?? void 0
|
|
2546
2545
|
};
|
|
2547
2546
|
} catch {
|
|
2548
2547
|
return i;
|
|
@@ -2564,14 +2563,14 @@ function ln(e) {
|
|
|
2564
2563
|
return t.dest = r, t._includeValidateSearch = i, n(0, e, t.middlewares);
|
|
2565
2564
|
};
|
|
2566
2565
|
}
|
|
2567
|
-
function
|
|
2566
|
+
function ln(e, t) {
|
|
2568
2567
|
if (e !== "root") for (let e = t.length - 1; e >= 0; e--) {
|
|
2569
2568
|
let n = t[e];
|
|
2570
2569
|
if (n.children) return n.id;
|
|
2571
2570
|
}
|
|
2572
|
-
return
|
|
2571
|
+
return z;
|
|
2573
2572
|
}
|
|
2574
|
-
function
|
|
2573
|
+
function un(e, t) {
|
|
2575
2574
|
let n = e.options.params?.parse ?? e.options.parseParams;
|
|
2576
2575
|
if (n) {
|
|
2577
2576
|
let e = n(t);
|
|
@@ -2581,7 +2580,7 @@ function dn(e, t) {
|
|
|
2581
2580
|
}
|
|
2582
2581
|
//#endregion
|
|
2583
2582
|
//#region ../router-core/dist/esm/link.js
|
|
2584
|
-
var
|
|
2583
|
+
var dn = "Error preloading route! ☝️", fn = class {
|
|
2585
2584
|
get to() {
|
|
2586
2585
|
return this._to;
|
|
2587
2586
|
}
|
|
@@ -2598,43 +2597,43 @@ var fn = "Error preloading route! ☝️", pn = class {
|
|
|
2598
2597
|
if (this.init = (e) => {
|
|
2599
2598
|
this.originalIndex = e.originalIndex;
|
|
2600
2599
|
let t = this.options, n = !t?.path && !t?.id;
|
|
2601
|
-
if (this.parentRoute = this.options.getParentRoute?.(), n) this._path =
|
|
2600
|
+
if (this.parentRoute = this.options.getParentRoute?.(), n) this._path = z;
|
|
2602
2601
|
else if (!this.parentRoute) {
|
|
2603
2602
|
if (process.env.NODE_ENV !== "production") throw Error("Invariant failed: Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.");
|
|
2604
2603
|
ye();
|
|
2605
2604
|
}
|
|
2606
|
-
let r = n ?
|
|
2607
|
-
r && r !== "/" && (r =
|
|
2608
|
-
let i = t?.id || r, a = n ?
|
|
2609
|
-
r === "__root__" && (r = "/"), a !== "__root__" && (a =
|
|
2610
|
-
let o = a === "__root__" ? "/" :
|
|
2611
|
-
this._path = r, this._id = a, this._fullPath = o, this._to =
|
|
2612
|
-
}, this.addChildren = (e) => this._addFileChildren(e), this._addFileChildren = (e) => (Array.isArray(e) && (this.children = e), typeof e == "object" && e && (this.children = Object.values(e)), this), this._addFileTypes = () => this, this.updateLoader = (e) => (Object.assign(this.options, e), this), this.update = (e) => (Object.assign(this.options, e), this), this.lazy = (e) => (this.lazyFn = e, this), this.redirect = (e) =>
|
|
2605
|
+
let r = n ? z : t?.path;
|
|
2606
|
+
r && r !== "/" && (r = Ue(r));
|
|
2607
|
+
let i = t?.id || r, a = n ? z : Ve([this.parentRoute.id === "__root__" ? "" : this.parentRoute.id, i]);
|
|
2608
|
+
r === "__root__" && (r = "/"), a !== "__root__" && (a = Ve(["/", a]));
|
|
2609
|
+
let o = a === "__root__" ? "/" : Ve([this.parentRoute.fullPath, r]);
|
|
2610
|
+
this._path = r, this._id = a, this._fullPath = o, this._to = I(o);
|
|
2611
|
+
}, this.addChildren = (e) => this._addFileChildren(e), this._addFileChildren = (e) => (Array.isArray(e) && (this.children = e), typeof e == "object" && e && (this.children = Object.values(e)), this), this._addFileTypes = () => this, this.updateLoader = (e) => (Object.assign(this.options, e), this), this.update = (e) => (Object.assign(this.options, e), this), this.lazy = (e) => (this.lazyFn = e, this), this.redirect = (e) => ht({
|
|
2613
2612
|
from: this.fullPath,
|
|
2614
2613
|
...e
|
|
2615
2614
|
}), this.options = e || {}, this.isRoot = !e?.getParentRoute, e?.id && e?.path) throw Error("Route cannot have both an 'id' and a 'path' option.");
|
|
2616
2615
|
}
|
|
2617
|
-
},
|
|
2616
|
+
}, pn = class {
|
|
2618
2617
|
constructor({ id: e }) {
|
|
2619
|
-
this.notFound = (e) =>
|
|
2618
|
+
this.notFound = (e) => Qe({
|
|
2620
2619
|
routeId: this.id,
|
|
2621
2620
|
...e
|
|
2622
|
-
}), this.redirect = (e) =>
|
|
2621
|
+
}), this.redirect = (e) => ht({
|
|
2623
2622
|
from: this.id,
|
|
2624
2623
|
...e
|
|
2625
2624
|
}), this.id = e;
|
|
2626
2625
|
}
|
|
2627
|
-
},
|
|
2626
|
+
}, mn = class extends fn {
|
|
2628
2627
|
constructor(e) {
|
|
2629
2628
|
super(e);
|
|
2630
2629
|
}
|
|
2631
|
-
},
|
|
2630
|
+
}, hn = (e) => ({
|
|
2632
2631
|
serializationAdapters: e.serializationAdapters,
|
|
2633
2632
|
defaultSsr: e.defaultSsr
|
|
2634
2633
|
});
|
|
2635
2634
|
//#endregion
|
|
2636
2635
|
//#region ../router-core/dist/esm/searchMiddleware.js
|
|
2637
|
-
function
|
|
2636
|
+
function gn(e) {
|
|
2638
2637
|
return ({ search: t, next: n }) => {
|
|
2639
2638
|
let r = n(t);
|
|
2640
2639
|
if (e === !0) return {
|
|
@@ -2649,7 +2648,7 @@ function _n(e) {
|
|
|
2649
2648
|
}
|
|
2650
2649
|
//#endregion
|
|
2651
2650
|
//#region ../router-core/dist/esm/hash-scroll.js
|
|
2652
|
-
function
|
|
2651
|
+
function _n(e) {
|
|
2653
2652
|
if (typeof document < "u" && document.querySelector) {
|
|
2654
2653
|
let t = e.stores.location.get(), n = t.state.__hashScrollIntoViewOptions ?? !0;
|
|
2655
2654
|
if (n && t.hash !== "") {
|
|
@@ -2660,7 +2659,7 @@ function vn(e) {
|
|
|
2660
2659
|
}
|
|
2661
2660
|
//#endregion
|
|
2662
2661
|
//#region src/routerStores.ts
|
|
2663
|
-
function
|
|
2662
|
+
function vn(e, t) {
|
|
2664
2663
|
e.childMatchIdByRouteId = t(() => {
|
|
2665
2664
|
let t = e.matchesId.get(), n = {};
|
|
2666
2665
|
for (let r = 0; r < t.length - 1; r++) {
|
|
@@ -2677,42 +2676,42 @@ function yn(e, t) {
|
|
|
2677
2676
|
return n;
|
|
2678
2677
|
});
|
|
2679
2678
|
}
|
|
2680
|
-
var
|
|
2679
|
+
var yn = (n) => ({
|
|
2681
2680
|
createMutableStore: t,
|
|
2682
2681
|
createReadonlyStore: t,
|
|
2683
2682
|
batch: e,
|
|
2684
|
-
init: (e) =>
|
|
2685
|
-
}),
|
|
2683
|
+
init: (e) => vn(e, t)
|
|
2684
|
+
}), bn = (e) => new xn(e), xn = class extends Zt {
|
|
2686
2685
|
constructor(e) {
|
|
2687
|
-
super(e,
|
|
2686
|
+
super(e, yn);
|
|
2688
2687
|
}
|
|
2689
|
-
},
|
|
2688
|
+
}, Sn = {
|
|
2690
2689
|
matchId: () => void 0,
|
|
2691
2690
|
routeId: () => void 0,
|
|
2692
2691
|
match: () => void 0,
|
|
2693
2692
|
hasPending: () => !1
|
|
2694
|
-
},
|
|
2693
|
+
}, q = new n.InjectionToken("MATCH_CONTEXT_INJECTOR", {
|
|
2695
2694
|
providedIn: "root",
|
|
2696
|
-
factory: () =>
|
|
2697
|
-
}),
|
|
2698
|
-
function
|
|
2699
|
-
return typeof document > "u" ?
|
|
2695
|
+
factory: () => Sn
|
|
2696
|
+
}), Cn = new n.InjectionToken("ROUTER");
|
|
2697
|
+
function wn() {
|
|
2698
|
+
return typeof document > "u" ? Cn : window.__TSR_ROUTER_INJECTION_KEY__ ? window.__TSR_ROUTER_INJECTION_KEY__ : (window.__TSR_ROUTER_INJECTION_KEY__ = Cn, Cn);
|
|
2700
2699
|
}
|
|
2701
2700
|
//#endregion
|
|
2702
2701
|
//#region src/injectRouter.ts
|
|
2703
|
-
function
|
|
2704
|
-
let t = n.inject(
|
|
2702
|
+
function J(e) {
|
|
2703
|
+
let t = n.inject(wn(), { optional: !0 });
|
|
2705
2704
|
return process.env.NODE_ENV !== "production" && (e?.warn ?? !0) && !t && console.warn("Warning: injectRouter must be used inside a <router-provider> component!"), t;
|
|
2706
2705
|
}
|
|
2707
2706
|
//#endregion
|
|
2708
2707
|
//#region src/store/injectSelector.ts
|
|
2709
|
-
function
|
|
2710
|
-
return t || (
|
|
2708
|
+
function Tn(e, t) {
|
|
2709
|
+
return t || (p(e), g(l));
|
|
2711
2710
|
}
|
|
2712
|
-
function
|
|
2713
|
-
return
|
|
2714
|
-
let r = typeof e == "function" ? e : () => e, i =
|
|
2715
|
-
return
|
|
2711
|
+
function En(e, t = (e) => e, n) {
|
|
2712
|
+
return x(Tn(En, n?.injector), () => {
|
|
2713
|
+
let r = typeof e == "function" ? e : () => e, i = b(() => t(r().get()), { equal: n?.compare });
|
|
2714
|
+
return h((e) => {
|
|
2716
2715
|
let { unsubscribe: n } = r().subscribe((e) => {
|
|
2717
2716
|
i.set(t(e));
|
|
2718
2717
|
});
|
|
@@ -2722,9 +2721,9 @@ function Dn(e, t = (e) => e, n) {
|
|
|
2722
2721
|
}
|
|
2723
2722
|
//#endregion
|
|
2724
2723
|
//#region src/store/injectStore.ts
|
|
2725
|
-
function
|
|
2724
|
+
function Y(e, t = (e) => e, n) {
|
|
2726
2725
|
let { equal: r, injector: i, ...a } = n ?? {};
|
|
2727
|
-
return
|
|
2726
|
+
return En(e, t, {
|
|
2728
2727
|
...a,
|
|
2729
2728
|
compare: r,
|
|
2730
2729
|
injector: i
|
|
@@ -2732,15 +2731,15 @@ function J(e, t = (e) => e, n) {
|
|
|
2732
2731
|
}
|
|
2733
2732
|
//#endregion
|
|
2734
2733
|
//#region src/injectMatch.ts
|
|
2735
|
-
var
|
|
2734
|
+
var Dn = {
|
|
2736
2735
|
get: () => void 0,
|
|
2737
2736
|
subscribe: () => ({ unsubscribe: () => {} })
|
|
2738
2737
|
};
|
|
2739
|
-
function
|
|
2740
|
-
let t =
|
|
2738
|
+
function X(e) {
|
|
2739
|
+
let t = J(), r = e.from ? void 0 : n.inject(q), i = Y(e.from ? t.stores.getRouteMatchStore(e.from) : () => {
|
|
2741
2740
|
let e = r?.matchId();
|
|
2742
|
-
return e ? t.stores.matchStores.get(e) ??
|
|
2743
|
-
}, (e) => e), a =
|
|
2741
|
+
return e ? t.stores.matchStores.get(e) ?? Dn : Dn;
|
|
2742
|
+
}, (e) => e), a = Y(t.stores.pendingRouteIds, (e) => e), o = Y(t.stores.isTransitioning, (e) => e);
|
|
2744
2743
|
return n.computed(() => {
|
|
2745
2744
|
let t = i();
|
|
2746
2745
|
if (t !== void 0) return e.select ? e.select(t) : t;
|
|
@@ -2752,8 +2751,8 @@ function Y(e) {
|
|
|
2752
2751
|
}
|
|
2753
2752
|
//#endregion
|
|
2754
2753
|
//#region src/injectLoaderData.ts
|
|
2755
|
-
function
|
|
2756
|
-
return
|
|
2754
|
+
function On(e) {
|
|
2755
|
+
return X({
|
|
2757
2756
|
from: e.from,
|
|
2758
2757
|
strict: e.strict,
|
|
2759
2758
|
select: (t) => e.select ? e.select(t.loaderData) : t.loaderData
|
|
@@ -2761,17 +2760,17 @@ function kn(e) {
|
|
|
2761
2760
|
}
|
|
2762
2761
|
//#endregion
|
|
2763
2762
|
//#region src/injectLoaderDeps.ts
|
|
2764
|
-
function
|
|
2763
|
+
function kn(e) {
|
|
2765
2764
|
let { select: t, ...n } = e;
|
|
2766
|
-
return
|
|
2765
|
+
return X({
|
|
2767
2766
|
...n,
|
|
2768
2767
|
select: (e) => t ? t(e.loaderDeps) : e.loaderDeps
|
|
2769
2768
|
});
|
|
2770
2769
|
}
|
|
2771
2770
|
//#endregion
|
|
2772
2771
|
//#region src/injectNavigate.ts
|
|
2773
|
-
function
|
|
2774
|
-
let t =
|
|
2772
|
+
function An(e) {
|
|
2773
|
+
let t = J();
|
|
2775
2774
|
return ((n) => t.navigate({
|
|
2776
2775
|
...n,
|
|
2777
2776
|
from: n.from ?? e?.from
|
|
@@ -2780,7 +2779,7 @@ function X(e) {
|
|
|
2780
2779
|
//#endregion
|
|
2781
2780
|
//#region src/injectParams.ts
|
|
2782
2781
|
function jn(e) {
|
|
2783
|
-
return
|
|
2782
|
+
return X({
|
|
2784
2783
|
from: e.from,
|
|
2785
2784
|
strict: e.strict,
|
|
2786
2785
|
shouldThrow: e.shouldThrow,
|
|
@@ -2790,7 +2789,7 @@ function jn(e) {
|
|
|
2790
2789
|
//#endregion
|
|
2791
2790
|
//#region src/injectRouteContext.ts
|
|
2792
2791
|
function Mn(e) {
|
|
2793
|
-
return
|
|
2792
|
+
return X({
|
|
2794
2793
|
...e,
|
|
2795
2794
|
select: (t) => e.select ? e.select(t.context) : t.context
|
|
2796
2795
|
});
|
|
@@ -2798,7 +2797,7 @@ function Mn(e) {
|
|
|
2798
2797
|
//#endregion
|
|
2799
2798
|
//#region src/injectSearch.ts
|
|
2800
2799
|
function Nn(e) {
|
|
2801
|
-
return
|
|
2800
|
+
return X({
|
|
2802
2801
|
from: e.from,
|
|
2803
2802
|
strict: e.strict,
|
|
2804
2803
|
shouldThrow: e.shouldThrow,
|
|
@@ -2810,9 +2809,9 @@ function Nn(e) {
|
|
|
2810
2809
|
function Pn(e) {
|
|
2811
2810
|
return new Fn({ id: e });
|
|
2812
2811
|
}
|
|
2813
|
-
var Fn = class extends
|
|
2812
|
+
var Fn = class extends pn {
|
|
2814
2813
|
constructor({ id: e }) {
|
|
2815
|
-
super({ id: e }), this.injectMatch = (e) =>
|
|
2814
|
+
super({ id: e }), this.injectMatch = (e) => X({
|
|
2816
2815
|
select: e?.select,
|
|
2817
2816
|
from: this.id
|
|
2818
2817
|
}), this.injectRouteContext = (e) => Mn({
|
|
@@ -2824,25 +2823,25 @@ var Fn = class extends mn {
|
|
|
2824
2823
|
}), this.injectParams = (e) => jn({
|
|
2825
2824
|
select: e?.select,
|
|
2826
2825
|
from: this.id
|
|
2827
|
-
}), this.injectLoaderDeps = (e) =>
|
|
2826
|
+
}), this.injectLoaderDeps = (e) => kn({
|
|
2828
2827
|
...e,
|
|
2829
2828
|
from: this.id,
|
|
2830
2829
|
strict: !1
|
|
2831
|
-
}), this.injectLoaderData = (e) =>
|
|
2830
|
+
}), this.injectLoaderData = (e) => On({
|
|
2832
2831
|
...e,
|
|
2833
2832
|
from: this.id,
|
|
2834
2833
|
strict: !1
|
|
2835
|
-
}), this.injectNavigate = () =>
|
|
2834
|
+
}), this.injectNavigate = () => An({ from: J().routesById[this.id].fullPath }), this.notFound = (e) => Qe({
|
|
2836
2835
|
routeId: this.id,
|
|
2837
2836
|
...e
|
|
2838
2837
|
});
|
|
2839
2838
|
}
|
|
2840
|
-
}, In = class extends
|
|
2839
|
+
}, In = class extends fn {
|
|
2841
2840
|
constructor(e) {
|
|
2842
|
-
super(e), this.injectMatch = (e) =>
|
|
2841
|
+
super(e), this.injectMatch = (e) => X({
|
|
2843
2842
|
select: e?.select,
|
|
2844
2843
|
from: this.id
|
|
2845
|
-
}), this.injectRouteContext = (e) =>
|
|
2844
|
+
}), this.injectRouteContext = (e) => X({
|
|
2846
2845
|
...e,
|
|
2847
2846
|
from: this.id,
|
|
2848
2847
|
select: (t) => e?.select ? e.select(t.context) : t.context
|
|
@@ -2852,13 +2851,13 @@ var Fn = class extends mn {
|
|
|
2852
2851
|
}), this.injectParams = (e) => jn({
|
|
2853
2852
|
select: e?.select,
|
|
2854
2853
|
from: this.id
|
|
2855
|
-
}), this.injectLoaderDeps = (e) =>
|
|
2854
|
+
}), this.injectLoaderDeps = (e) => kn({
|
|
2856
2855
|
...e,
|
|
2857
2856
|
from: this.id
|
|
2858
|
-
}), this.injectLoaderData = (e) =>
|
|
2857
|
+
}), this.injectLoaderData = (e) => On({
|
|
2859
2858
|
...e,
|
|
2860
2859
|
from: this.id
|
|
2861
|
-
}), this.injectNavigate = () =>
|
|
2860
|
+
}), this.injectNavigate = () => An({ from: this.fullPath });
|
|
2862
2861
|
}
|
|
2863
2862
|
};
|
|
2864
2863
|
function Ln(e) {
|
|
@@ -2867,12 +2866,12 @@ function Ln(e) {
|
|
|
2867
2866
|
function Rn() {
|
|
2868
2867
|
return (e) => Hn(e);
|
|
2869
2868
|
}
|
|
2870
|
-
var zn = class extends
|
|
2869
|
+
var zn = class extends mn {
|
|
2871
2870
|
constructor(e) {
|
|
2872
|
-
super(e), this.injectMatch = (e) =>
|
|
2871
|
+
super(e), this.injectMatch = (e) => X({
|
|
2873
2872
|
select: e?.select,
|
|
2874
2873
|
from: this.id
|
|
2875
|
-
}), this.injectRouteContext = (e) =>
|
|
2874
|
+
}), this.injectRouteContext = (e) => X({
|
|
2876
2875
|
...e,
|
|
2877
2876
|
from: this.id,
|
|
2878
2877
|
select: (t) => e?.select ? e.select(t.context) : t.context
|
|
@@ -2882,13 +2881,13 @@ var zn = class extends hn {
|
|
|
2882
2881
|
}), this.injectParams = (e) => jn({
|
|
2883
2882
|
select: e?.select,
|
|
2884
2883
|
from: this.id
|
|
2885
|
-
}), this.injectLoaderDeps = (e) =>
|
|
2884
|
+
}), this.injectLoaderDeps = (e) => kn({
|
|
2886
2885
|
...e,
|
|
2887
2886
|
from: this.id
|
|
2888
|
-
}), this.injectLoaderData = (e) =>
|
|
2887
|
+
}), this.injectLoaderData = (e) => On({
|
|
2889
2888
|
...e,
|
|
2890
2889
|
from: this.id
|
|
2891
|
-
}), this.injectNavigate = () =>
|
|
2890
|
+
}), this.injectNavigate = () => An({ from: this.fullPath });
|
|
2892
2891
|
}
|
|
2893
2892
|
};
|
|
2894
2893
|
function Bn(e) {
|
|
@@ -2919,7 +2918,7 @@ var Wn = class {
|
|
|
2919
2918
|
}
|
|
2920
2919
|
}, Gn = class {
|
|
2921
2920
|
constructor(e) {
|
|
2922
|
-
this.injectMatch = (e) =>
|
|
2921
|
+
this.injectMatch = (e) => X({
|
|
2923
2922
|
select: e?.select,
|
|
2924
2923
|
from: this.options.id
|
|
2925
2924
|
}), this.injectRouteContext = (e) => Mn({
|
|
@@ -2931,13 +2930,13 @@ var Wn = class {
|
|
|
2931
2930
|
}), this.injectParams = (e) => jn({
|
|
2932
2931
|
select: e?.select,
|
|
2933
2932
|
from: this.options.id
|
|
2934
|
-
}), this.injectLoaderDeps = (e) =>
|
|
2933
|
+
}), this.injectLoaderDeps = (e) => kn({
|
|
2935
2934
|
...e,
|
|
2936
2935
|
from: this.options.id
|
|
2937
|
-
}), this.injectLoaderData = (e) =>
|
|
2936
|
+
}), this.injectLoaderData = (e) => On({
|
|
2938
2937
|
...e,
|
|
2939
2938
|
from: this.options.id
|
|
2940
|
-
}), this.injectNavigate = () =>
|
|
2939
|
+
}), this.injectNavigate = () => An({ from: J().routesById[this.options.id].fullPath }), this.options = e;
|
|
2941
2940
|
}
|
|
2942
2941
|
};
|
|
2943
2942
|
function Kn(e) {
|
|
@@ -2955,22 +2954,22 @@ function qn(e) {
|
|
|
2955
2954
|
//#endregion
|
|
2956
2955
|
//#region src/renderer/injectRender.ts
|
|
2957
2956
|
function Jn(e) {
|
|
2958
|
-
let t =
|
|
2959
|
-
|
|
2957
|
+
let t = g(d), n = g(l), r = [];
|
|
2958
|
+
h(() => {
|
|
2960
2959
|
let i = e(), a = Yn(i);
|
|
2961
2960
|
if (Xn(r, a)) return;
|
|
2962
2961
|
r.length > 0 && t.clear(), r = a;
|
|
2963
2962
|
let o = i?.component;
|
|
2964
2963
|
if (!o) return;
|
|
2965
|
-
let s = i.providers ?? [],
|
|
2964
|
+
let s = i.providers ?? [], c = l.create({
|
|
2966
2965
|
providers: s,
|
|
2967
2966
|
parent: n
|
|
2968
|
-
}), u = Object.entries(i.inputs ?? {}).map(([e, t]) =>
|
|
2967
|
+
}), u = Object.entries(i.inputs ?? {}).map(([e, t]) => v(e, t));
|
|
2969
2968
|
t.createComponent(o, {
|
|
2970
|
-
injector:
|
|
2969
|
+
injector: c,
|
|
2971
2970
|
bindings: u
|
|
2972
2971
|
}).changeDetectorRef.markForCheck();
|
|
2973
|
-
}),
|
|
2972
|
+
}), g(a).onDestroy(() => {
|
|
2974
2973
|
t.clear();
|
|
2975
2974
|
});
|
|
2976
2975
|
}
|
|
@@ -3018,13 +3017,13 @@ function $n() {
|
|
|
3018
3017
|
//#endregion
|
|
3019
3018
|
//#region src/injectRouterState.ts
|
|
3020
3019
|
function er(e) {
|
|
3021
|
-
let t =
|
|
3022
|
-
return e?.select ?
|
|
3020
|
+
let t = J({ warn: e?.router === void 0 }), n = e?.router ?? t;
|
|
3021
|
+
return e?.select ? Y(n.stores.__store, e.select, { equal: k }) : Y(n.stores.__store);
|
|
3023
3022
|
}
|
|
3024
3023
|
//#endregion
|
|
3025
3024
|
//#region src/renderer/injectIsCatchingError.ts
|
|
3026
3025
|
function tr({ matchId: e }) {
|
|
3027
|
-
let t =
|
|
3026
|
+
let t = J(), r = er({ select: (e) => e.matches }), i = n.computed(() => r().findIndex((t) => t.id === e()));
|
|
3028
3027
|
return n.computed(() => {
|
|
3029
3028
|
if (t.options.defaultErrorComponent != null) return;
|
|
3030
3029
|
let e = i();
|
|
@@ -3044,7 +3043,7 @@ var nr = {
|
|
|
3044
3043
|
subscribe: () => ({ unsubscribe: () => {} })
|
|
3045
3044
|
}, rr = class e {
|
|
3046
3045
|
constructor() {
|
|
3047
|
-
this.state =
|
|
3046
|
+
this.state = g(Qn), this.message = m(() => {
|
|
3048
3047
|
let e = this.state.error;
|
|
3049
3048
|
return e instanceof Error ? e.stack ?? e.message : String(e);
|
|
3050
3049
|
});
|
|
@@ -3069,26 +3068,26 @@ var nr = {
|
|
|
3069
3068
|
}
|
|
3070
3069
|
};
|
|
3071
3070
|
function ir({ parentRouteIsRoot: e }) {
|
|
3072
|
-
let t =
|
|
3071
|
+
let t = J({ warn: !1 }), n = g(s), r = g(a), i = Y(t.stores.resolvedLocation, (e) => e?.state?.__TSR_key), o = Y(t.stores.loadedAt, (e) => e), c, l = 0;
|
|
3073
3072
|
r.onDestroy(() => {
|
|
3074
3073
|
l++;
|
|
3075
|
-
}),
|
|
3074
|
+
}), h(() => {
|
|
3076
3075
|
if (!e()) return;
|
|
3077
|
-
|
|
3076
|
+
i(), o();
|
|
3078
3077
|
let r = ++l;
|
|
3079
|
-
|
|
3078
|
+
f({ read: () => {
|
|
3080
3079
|
if (r !== l || !e() || t.isServer) return;
|
|
3081
3080
|
let n = t.latestLocation.href;
|
|
3082
3081
|
c !== void 0 && c === n || (c = n, t.emit({
|
|
3083
3082
|
type: "onRendered",
|
|
3084
|
-
...
|
|
3083
|
+
...K(t.stores.location.get(), t.stores.resolvedLocation.get())
|
|
3085
3084
|
}));
|
|
3086
3085
|
} }, { injector: n });
|
|
3087
3086
|
});
|
|
3088
3087
|
}
|
|
3089
3088
|
var ar = class e {
|
|
3090
3089
|
constructor() {
|
|
3091
|
-
this.matchId =
|
|
3090
|
+
this.matchId = _.required(), this.router = J(), this.match = m(() => this.matchSignal()), this.matchSignal = Y(() => this.router.stores.matchStores.get(this.matchId()) ?? nr, (e) => e), this.matchData = m(() => {
|
|
3092
3091
|
let e = this.match();
|
|
3093
3092
|
if (!e) return null;
|
|
3094
3093
|
let t = e.routeId, n = this.router.routesById[t], r = n.parentRoute?.id ?? null, i = (n.options.remountDeps ?? this.router.options.defaultRemountDeps)?.({
|
|
@@ -3103,18 +3102,18 @@ var ar = class e {
|
|
|
3103
3102
|
match: e,
|
|
3104
3103
|
parentRouteId: r
|
|
3105
3104
|
};
|
|
3106
|
-
}), this.isFistRouteInRouteTree =
|
|
3105
|
+
}), this.isFistRouteInRouteTree = m(() => this.matchData()?.parentRouteId === z), this.resolvedNoSsr = m(() => {
|
|
3107
3106
|
let e = this.matchData()?.match;
|
|
3108
3107
|
return e ? e.ssr === !1 || e.ssr === "data-only" : !0;
|
|
3109
|
-
}), this.shouldClientOnly =
|
|
3108
|
+
}), this.shouldClientOnly = m(() => {
|
|
3110
3109
|
let e = this.matchData()?.match;
|
|
3111
3110
|
return e ? this.resolvedNoSsr() || !!e._displayPending : !0;
|
|
3112
|
-
}), this.parentRouteIdSignal =
|
|
3111
|
+
}), this.parentRouteIdSignal = m(() => this.matchData()?.parentRouteId ?? ""), this.rootRouteIdSignal = m(() => z), this.hasPendingMatch = m(() => {
|
|
3113
3112
|
let e = this.matchData()?.route.id;
|
|
3114
3113
|
return e ? !!this.pendingRouteIds()[e] : !1;
|
|
3115
|
-
}), this.pendingRouteIds =
|
|
3114
|
+
}), this.pendingRouteIds = Y(this.router.stores.pendingRouteIds, (e) => e), this.nearestMatchContext = {
|
|
3116
3115
|
matchId: this.matchId,
|
|
3117
|
-
routeId:
|
|
3116
|
+
routeId: m(() => this.matchData()?.route.id),
|
|
3118
3117
|
match: this.match,
|
|
3119
3118
|
hasPending: this.hasPendingMatch
|
|
3120
3119
|
}, this.catchingErrorMatch = tr({ matchId: this.matchId }), this.render = Jn(() => {
|
|
@@ -3147,7 +3146,7 @@ var ar = class e {
|
|
|
3147
3146
|
key: e.key,
|
|
3148
3147
|
component: t,
|
|
3149
3148
|
providers: [{
|
|
3150
|
-
provide:
|
|
3149
|
+
provide: q,
|
|
3151
3150
|
useValue: this.nearestMatchContext
|
|
3152
3151
|
}]
|
|
3153
3152
|
} : { component: Z(n.options.pendingComponent) ?? Z(this.router.options.defaultPendingComponent) };
|
|
@@ -3157,12 +3156,12 @@ var ar = class e {
|
|
|
3157
3156
|
key: e.key,
|
|
3158
3157
|
component: t,
|
|
3159
3158
|
providers: [{
|
|
3160
|
-
provide:
|
|
3159
|
+
provide: q,
|
|
3161
3160
|
useValue: this.nearestMatchContext
|
|
3162
3161
|
}]
|
|
3163
3162
|
};
|
|
3164
3163
|
}
|
|
3165
|
-
}), this.onRendered = ir({ parentRouteIsRoot:
|
|
3164
|
+
}), this.onRendered = ir({ parentRouteIsRoot: m(() => this.parentRouteIdSignal() === z) });
|
|
3166
3165
|
}
|
|
3167
3166
|
static {
|
|
3168
3167
|
this.ɵfac = function(t) {
|
|
@@ -3191,10 +3190,10 @@ var ar = class e {
|
|
|
3191
3190
|
}
|
|
3192
3191
|
}, or = class e {
|
|
3193
3192
|
constructor() {
|
|
3194
|
-
this.router =
|
|
3193
|
+
this.router = J(), this.nearestMatch = g(q), this.currentMatch = Y(() => {
|
|
3195
3194
|
let e = this.nearestMatch.matchId();
|
|
3196
3195
|
return e ? this.router.stores.matchStores.get(e) ?? nr : nr;
|
|
3197
|
-
}, (e) => e), this.routeId =
|
|
3196
|
+
}, (e) => e), this.routeId = m(() => this.currentMatch()?.routeId), this.route = m(() => this.router.routesById[this.routeId()]), this.parentGlobalNotFound = m(() => this.currentMatch()?.globalNotFound ?? !1), this.childMatchIdByRouteId = Y(this.router.stores.childMatchIdByRouteId, (e) => e), this.childMatchId = m(() => {
|
|
3198
3197
|
let e = this.routeId();
|
|
3199
3198
|
return e ? this.childMatchIdByRouteId()[e] ?? null : null;
|
|
3200
3199
|
}), this.render = Jn(() => this.parentGlobalNotFound() ? { component: sr(this.router, this.route()) } : this.childMatchId() ? {
|
|
@@ -3227,10 +3226,10 @@ function Z(e) {
|
|
|
3227
3226
|
return typeof e == "function" ? e() : e;
|
|
3228
3227
|
}
|
|
3229
3228
|
function sr(e, t) {
|
|
3230
|
-
return (Z(t.options.notFoundComponent) ?? Z(e.options.defaultNotFoundComponent)) || (
|
|
3229
|
+
return (Z(t.options.notFoundComponent) ?? Z(e.options.defaultNotFoundComponent)) || (y() && !t.options.notFoundComponent && console.warn(`A notFoundError was encountered on the route with ID "${t.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Page not found</p>)`), Zn);
|
|
3231
3230
|
}
|
|
3232
3231
|
function cr(e, t) {
|
|
3233
|
-
return (Z(t.options.errorComponent) ?? Z(e.options.defaultErrorComponent)) || (
|
|
3232
|
+
return (Z(t.options.errorComponent) ?? Z(e.options.defaultErrorComponent)) || (y() && !t.options.errorComponent && console.warn(`An error was encountered on the route with ID "${t.id}", but an errorComponent option was not configured, nor was a router level defaultErrorComponent configured. Consider configuring at least one of these to avoid TanStack Router's generic defaultErrorComponent.`), rr);
|
|
3234
3233
|
}
|
|
3235
3234
|
//#endregion
|
|
3236
3235
|
//#region ../router-core/dist/esm/scroll-restoration-script/client.js
|
|
@@ -3241,8 +3240,8 @@ function lr(e) {
|
|
|
3241
3240
|
//#region src/ssr-scroll-restoration.ts
|
|
3242
3241
|
var ur = "data-tsr-scroll-restoration-inline";
|
|
3243
3242
|
function dr() {
|
|
3244
|
-
let e =
|
|
3245
|
-
e.isServer &&
|
|
3243
|
+
let e = J(), t = g(i), n = g(s);
|
|
3244
|
+
e.isServer && f(() => {
|
|
3246
3245
|
let n = e.options.scrollRestoration;
|
|
3247
3246
|
if (!n || typeof n == "function" && !n({ location: e.latestLocation }) || t.querySelector(`script[${ur}]`)) return;
|
|
3248
3247
|
let r = lr(e);
|
|
@@ -3260,9 +3259,9 @@ var fr = {
|
|
|
3260
3259
|
mounted: !1
|
|
3261
3260
|
};
|
|
3262
3261
|
function pr() {
|
|
3263
|
-
let e =
|
|
3262
|
+
let e = J(), t = n.inject(n.EnvironmentInjector);
|
|
3264
3263
|
if (e.isServer) return;
|
|
3265
|
-
let r = n.inject(n.DestroyRef), i = !1, a =
|
|
3264
|
+
let r = n.inject(n.DestroyRef), i = !1, a = Y(e.stores.isLoading, (e) => e), o = Y(e.stores.isTransitioning, (e) => e), s = Y(e.stores.hasPending, (e) => e), c = Y(e.stores.status, (e) => e), l = Y(e.stores.location, (e) => e), u = Y(e.stores.resolvedLocation, (e) => e), d = n.computed(() => a() || o() || s()), f = n.computed(() => a() || s()), p = mr(() => a()), m = mr(() => d()), h = mr(() => f());
|
|
3266
3265
|
e.startTransition = (r) => {
|
|
3267
3266
|
e.stores.isTransitioning.set(!0);
|
|
3268
3267
|
let a = () => {
|
|
@@ -3285,7 +3284,7 @@ function pr() {
|
|
|
3285
3284
|
state: !0,
|
|
3286
3285
|
_includeValidateSearch: !0
|
|
3287
3286
|
});
|
|
3288
|
-
|
|
3287
|
+
I(e.latestLocation.href) !== I(t.href) && e.commitLocation({
|
|
3289
3288
|
...t,
|
|
3290
3289
|
replace: !0
|
|
3291
3290
|
});
|
|
@@ -3310,24 +3309,24 @@ function pr() {
|
|
|
3310
3309
|
if (_()) try {
|
|
3311
3310
|
p() && !a() && e.emit({
|
|
3312
3311
|
type: "onLoad",
|
|
3313
|
-
...
|
|
3312
|
+
...K(l(), u())
|
|
3314
3313
|
});
|
|
3315
3314
|
} catch {}
|
|
3316
3315
|
}), n.effect(() => {
|
|
3317
3316
|
if (_()) try {
|
|
3318
3317
|
h() && !f() && e.emit({
|
|
3319
3318
|
type: "onBeforeRouteMount",
|
|
3320
|
-
...
|
|
3319
|
+
...K(l(), u())
|
|
3321
3320
|
});
|
|
3322
3321
|
} catch {}
|
|
3323
3322
|
}), n.effect(() => {
|
|
3324
3323
|
if (_()) try {
|
|
3325
3324
|
if (m() && !d() && c() === "pending" && (e.stores.status.set("idle"), e.stores.resolvedLocation.set(l())), m() && !d()) {
|
|
3326
|
-
let t =
|
|
3325
|
+
let t = K(l(), u());
|
|
3327
3326
|
e.emit({
|
|
3328
3327
|
type: "onResolved",
|
|
3329
3328
|
...t
|
|
3330
|
-
}), t.hrefChanged &&
|
|
3329
|
+
}), t.hrefChanged && _n(e);
|
|
3331
3330
|
}
|
|
3332
3331
|
} catch {}
|
|
3333
3332
|
});
|
|
@@ -3343,7 +3342,7 @@ function mr(e) {
|
|
|
3343
3342
|
//#region src/Matches.ts
|
|
3344
3343
|
var hr = class e {
|
|
3345
3344
|
constructor() {
|
|
3346
|
-
this.router =
|
|
3345
|
+
this.router = J(), this.matchId = Y(this.router.stores.firstId, (e) => e), this.ssrScrollRestoration = dr(), this.transitioner = pr(), this.render = Jn(() => {
|
|
3347
3346
|
let e = this.matchId();
|
|
3348
3347
|
return e ? {
|
|
3349
3348
|
component: ar,
|
|
@@ -3367,15 +3366,15 @@ var hr = class e {
|
|
|
3367
3366
|
encapsulation: 2
|
|
3368
3367
|
});
|
|
3369
3368
|
}
|
|
3370
|
-
}, gr = new
|
|
3369
|
+
}, gr = new c("CONTEXT", {
|
|
3371
3370
|
providedIn: "root",
|
|
3372
3371
|
factory: () => ({})
|
|
3373
|
-
}), _r = new
|
|
3372
|
+
}), _r = new c("OPTIONS", {
|
|
3374
3373
|
providedIn: "root",
|
|
3375
3374
|
factory: () => ({})
|
|
3376
3375
|
});
|
|
3377
3376
|
function vr(e) {
|
|
3378
|
-
let t =
|
|
3377
|
+
let t = g(s);
|
|
3379
3378
|
return {
|
|
3380
3379
|
inject: t.get.bind(t),
|
|
3381
3380
|
...e
|
|
@@ -3384,7 +3383,7 @@ function vr(e) {
|
|
|
3384
3383
|
function yr({ router: e, context: t, options: n }) {
|
|
3385
3384
|
return [
|
|
3386
3385
|
{
|
|
3387
|
-
provide:
|
|
3386
|
+
provide: wn(),
|
|
3388
3387
|
useValue: e
|
|
3389
3388
|
},
|
|
3390
3389
|
{
|
|
@@ -3399,12 +3398,12 @@ function yr({ router: e, context: t, options: n }) {
|
|
|
3399
3398
|
}
|
|
3400
3399
|
var br = class e {
|
|
3401
3400
|
constructor() {
|
|
3402
|
-
this.injectedContext =
|
|
3401
|
+
this.injectedContext = g(gr), this.injectedOptions = g(_r), this.injectedRouter = g(wn(), { optional: !0 }), this.context = _(this.injectedContext), this.options = _(this.injectedOptions), this.routerInput = _(void 0, { alias: "router" }), this.router = m(() => {
|
|
3403
3402
|
let e = this.routerInput();
|
|
3404
3403
|
if (e) return e;
|
|
3405
3404
|
if (this.injectedRouter) return this.injectedRouter;
|
|
3406
3405
|
throw Error("No router provided to <router-provider>. Provide a router with provideTanstackRouter or the router input");
|
|
3407
|
-
}), this.updateRouter =
|
|
3406
|
+
}), this.updateRouter = h(() => {
|
|
3408
3407
|
let e = this.router(), t = this.context(), n = this.options();
|
|
3409
3408
|
e.update({
|
|
3410
3409
|
...e.options,
|
|
@@ -3415,11 +3414,11 @@ var br = class e {
|
|
|
3415
3414
|
}
|
|
3416
3415
|
});
|
|
3417
3416
|
}), this.render = Jn(() => {
|
|
3418
|
-
let e =
|
|
3417
|
+
let e = C(this.router);
|
|
3419
3418
|
return {
|
|
3420
3419
|
component: hr,
|
|
3421
3420
|
providers: [{
|
|
3422
|
-
provide:
|
|
3421
|
+
provide: wn(),
|
|
3423
3422
|
useValue: e
|
|
3424
3423
|
}]
|
|
3425
3424
|
};
|
|
@@ -3630,7 +3629,7 @@ function Br(e, t) {
|
|
|
3630
3629
|
type: "application/ld+json",
|
|
3631
3630
|
nonce: t
|
|
3632
3631
|
},
|
|
3633
|
-
children:
|
|
3632
|
+
children: ge(e)
|
|
3634
3633
|
});
|
|
3635
3634
|
} catch {}
|
|
3636
3635
|
continue;
|
|
@@ -3745,11 +3744,16 @@ function Xr(e, t) {
|
|
|
3745
3744
|
}
|
|
3746
3745
|
//#endregion
|
|
3747
3746
|
//#region src/document/install-unified-document-sync.ts
|
|
3748
|
-
function Zr(
|
|
3747
|
+
function Zr(e) {
|
|
3748
|
+
return !!e?.head && !!e?.body;
|
|
3749
|
+
}
|
|
3750
|
+
function Qr({ document: e, initialTitle: t, headCollection: n, bodyCollection: r, nextContent: i }) {
|
|
3749
3751
|
i.title === void 0 ? e.title = t : e.title = i.title, n.sync(i.head), r.sync(i.body);
|
|
3750
3752
|
}
|
|
3751
|
-
function
|
|
3752
|
-
let t = n.inject(
|
|
3753
|
+
function $r(e) {
|
|
3754
|
+
let t = n.inject(n.DOCUMENT);
|
|
3755
|
+
if (!Zr(t)) return;
|
|
3756
|
+
let r = n.inject(n.RendererFactory2, { optional: !0 }), i = n.inject(n.DestroyRef), a = Y(e.stores.matches, (e) => e), o = r?.createRenderer(null, null) ?? null, s = t.title, c = Dr({
|
|
3753
3757
|
root: t.head,
|
|
3754
3758
|
bucket: "head",
|
|
3755
3759
|
renderer: o
|
|
@@ -3760,7 +3764,7 @@ function Qr(e) {
|
|
|
3760
3764
|
}), u = Ir(e), d = () => Lr($(e), u);
|
|
3761
3765
|
c.mount(), l.mount();
|
|
3762
3766
|
let f = d();
|
|
3763
|
-
|
|
3767
|
+
Qr({
|
|
3764
3768
|
document: t,
|
|
3765
3769
|
initialTitle: s,
|
|
3766
3770
|
headCollection: c,
|
|
@@ -3770,7 +3774,7 @@ function Qr(e) {
|
|
|
3770
3774
|
let p = n.effect(() => {
|
|
3771
3775
|
a();
|
|
3772
3776
|
let e = d();
|
|
3773
|
-
Yr(f, e) || (f = e,
|
|
3777
|
+
Yr(f, e) || (f = e, Qr({
|
|
3774
3778
|
document: t,
|
|
3775
3779
|
initialTitle: s,
|
|
3776
3780
|
headCollection: c,
|
|
@@ -3784,8 +3788,10 @@ function Qr(e) {
|
|
|
3784
3788
|
}
|
|
3785
3789
|
//#endregion
|
|
3786
3790
|
//#region src/document/provide-tanstack-body-managed-tags.ts
|
|
3787
|
-
function
|
|
3788
|
-
let t = n.inject(
|
|
3791
|
+
function ei(e) {
|
|
3792
|
+
let t = n.inject(n.DOCUMENT);
|
|
3793
|
+
if (!t.body) return;
|
|
3794
|
+
let r = n.inject(n.RendererFactory2, { optional: !0 }), i = n.inject(n.DestroyRef), a = Y(e.stores.matches, (e) => e), o = Ir(e), s = () => o.length === 0 ? $(e).body : Tr([...o, ...$(e).body]), c = r?.createRenderer(null, null) ?? null, l = Dr({
|
|
3789
3795
|
root: t.body,
|
|
3790
3796
|
bucket: "body",
|
|
3791
3797
|
renderer: c
|
|
@@ -3802,19 +3808,19 @@ function $r(e) {
|
|
|
3802
3808
|
d.destroy(), l.destroy();
|
|
3803
3809
|
});
|
|
3804
3810
|
}
|
|
3805
|
-
function
|
|
3806
|
-
|
|
3811
|
+
function ti() {
|
|
3812
|
+
ei(n.inject(Q));
|
|
3807
3813
|
}
|
|
3808
|
-
function
|
|
3814
|
+
function ni(e) {
|
|
3809
3815
|
return n.makeEnvironmentProviders([{
|
|
3810
3816
|
provide: Q,
|
|
3811
3817
|
useValue: e
|
|
3812
|
-
}, n.provideEnvironmentInitializer(
|
|
3818
|
+
}, n.provideEnvironmentInitializer(ti)]);
|
|
3813
3819
|
}
|
|
3814
3820
|
//#endregion
|
|
3815
3821
|
//#region src/document/provide-tanstack-document-title.ts
|
|
3816
|
-
function
|
|
3817
|
-
let t = n.inject(
|
|
3822
|
+
function ri(e) {
|
|
3823
|
+
let t = n.inject(n.DOCUMENT), r = n.inject(n.DestroyRef), i = Y(e.stores.matches, (e) => e), a = t.title, o = $(e).title, s = (e) => {
|
|
3818
3824
|
e === void 0 ? t.title = a : t.title = e;
|
|
3819
3825
|
};
|
|
3820
3826
|
s(o);
|
|
@@ -3827,19 +3833,21 @@ function ni(e) {
|
|
|
3827
3833
|
c.destroy(), t.title = a;
|
|
3828
3834
|
});
|
|
3829
3835
|
}
|
|
3830
|
-
function
|
|
3831
|
-
|
|
3836
|
+
function ii() {
|
|
3837
|
+
ri(n.inject(Q));
|
|
3832
3838
|
}
|
|
3833
|
-
function
|
|
3839
|
+
function ai(e) {
|
|
3834
3840
|
return n.makeEnvironmentProviders([{
|
|
3835
3841
|
provide: Q,
|
|
3836
3842
|
useValue: e
|
|
3837
|
-
}, n.provideEnvironmentInitializer(
|
|
3843
|
+
}, n.provideEnvironmentInitializer(ii)]);
|
|
3838
3844
|
}
|
|
3839
3845
|
//#endregion
|
|
3840
3846
|
//#region src/document/provide-tanstack-head-managed-tags.ts
|
|
3841
|
-
function
|
|
3842
|
-
let t = n.inject(
|
|
3847
|
+
function oi(e) {
|
|
3848
|
+
let t = n.inject(n.DOCUMENT);
|
|
3849
|
+
if (!t.head) return;
|
|
3850
|
+
let r = n.inject(n.RendererFactory2, { optional: !0 }), i = n.inject(n.DestroyRef), a = Y(e.stores.matches, (e) => e), o = r?.createRenderer(null, null) ?? null, s = Dr({
|
|
3843
3851
|
root: t.head,
|
|
3844
3852
|
bucket: "head",
|
|
3845
3853
|
renderer: o
|
|
@@ -3856,25 +3864,25 @@ function ai(e) {
|
|
|
3856
3864
|
l.destroy(), s.destroy();
|
|
3857
3865
|
});
|
|
3858
3866
|
}
|
|
3859
|
-
function
|
|
3860
|
-
|
|
3867
|
+
function si() {
|
|
3868
|
+
oi(n.inject(Q));
|
|
3861
3869
|
}
|
|
3862
|
-
function
|
|
3870
|
+
function ci(e) {
|
|
3863
3871
|
return n.makeEnvironmentProviders([{
|
|
3864
3872
|
provide: Q,
|
|
3865
3873
|
useValue: e
|
|
3866
|
-
}, n.provideEnvironmentInitializer(
|
|
3874
|
+
}, n.provideEnvironmentInitializer(si)]);
|
|
3867
3875
|
}
|
|
3868
3876
|
//#endregion
|
|
3869
3877
|
//#region src/document/provide-tanstack-document.ts
|
|
3870
|
-
var
|
|
3878
|
+
var li = {
|
|
3871
3879
|
title: !0,
|
|
3872
3880
|
headTags: !0,
|
|
3873
3881
|
bodyScripts: !0
|
|
3874
3882
|
};
|
|
3875
|
-
function
|
|
3883
|
+
function ui(e, t = {}) {
|
|
3876
3884
|
let r = {
|
|
3877
|
-
...
|
|
3885
|
+
...li,
|
|
3878
3886
|
...t
|
|
3879
3887
|
}, i = r.title && r.headTags && r.bodyScripts;
|
|
3880
3888
|
return n.makeEnvironmentProviders([{
|
|
@@ -3882,41 +3890,41 @@ function li(e, t = {}) {
|
|
|
3882
3890
|
useValue: e
|
|
3883
3891
|
}, n.provideEnvironmentInitializer(() => {
|
|
3884
3892
|
if (i) {
|
|
3885
|
-
|
|
3893
|
+
$r(e);
|
|
3886
3894
|
return;
|
|
3887
3895
|
}
|
|
3888
|
-
r.title &&
|
|
3896
|
+
r.title && ri(e), r.headTags && oi(e), r.bodyScripts && ei(e);
|
|
3889
3897
|
})]);
|
|
3890
3898
|
}
|
|
3891
|
-
function
|
|
3892
|
-
return
|
|
3899
|
+
function di(e) {
|
|
3900
|
+
return ui(e);
|
|
3893
3901
|
}
|
|
3894
3902
|
//#endregion
|
|
3895
3903
|
//#region src/injectMatches.ts
|
|
3896
|
-
function
|
|
3897
|
-
return J(
|
|
3904
|
+
function fi(e) {
|
|
3905
|
+
return Y(J().stores.matches, (t) => {
|
|
3898
3906
|
let n = t;
|
|
3899
3907
|
return e?.select ? e.select(n) : n;
|
|
3900
3908
|
}, { equal: k });
|
|
3901
3909
|
}
|
|
3902
|
-
function
|
|
3903
|
-
let t = n.inject(
|
|
3904
|
-
return
|
|
3910
|
+
function pi(e) {
|
|
3911
|
+
let t = n.inject(q);
|
|
3912
|
+
return fi({ select: (n) => {
|
|
3905
3913
|
let r = n.slice(0, n.findIndex((e) => e.id === t.matchId()));
|
|
3906
3914
|
return e?.select ? e.select(r) : r;
|
|
3907
3915
|
} });
|
|
3908
3916
|
}
|
|
3909
|
-
function
|
|
3910
|
-
let t = n.inject(
|
|
3911
|
-
return
|
|
3917
|
+
function mi(e) {
|
|
3918
|
+
let t = n.inject(q);
|
|
3919
|
+
return fi({ select: (n) => {
|
|
3912
3920
|
let r = n.slice(n.findIndex((e) => e.id === t.matchId()) + 1);
|
|
3913
3921
|
return e?.select ? e.select(r) : r;
|
|
3914
3922
|
} });
|
|
3915
3923
|
}
|
|
3916
3924
|
//#endregion
|
|
3917
3925
|
//#region src/injectMatchRoute.ts
|
|
3918
|
-
function
|
|
3919
|
-
let e =
|
|
3926
|
+
function hi() {
|
|
3927
|
+
let e = J(), t = Y(e.stores.matchRouteDeps, (e) => e);
|
|
3920
3928
|
return (r) => n.computed(() => {
|
|
3921
3929
|
let { pending: n, caseSensitive: i, fuzzy: a, includeSearch: o, ...s } = r;
|
|
3922
3930
|
return t(), e.matchRoute(s, {
|
|
@@ -3929,20 +3937,20 @@ function mi() {
|
|
|
3929
3937
|
}
|
|
3930
3938
|
//#endregion
|
|
3931
3939
|
//#region src/injectIsShell.ts
|
|
3932
|
-
function
|
|
3933
|
-
let e =
|
|
3934
|
-
return
|
|
3940
|
+
function gi() {
|
|
3941
|
+
let e = J();
|
|
3942
|
+
return m(() => e.isShell());
|
|
3935
3943
|
}
|
|
3936
3944
|
//#endregion
|
|
3937
3945
|
//#region src/injectLocation.ts
|
|
3938
|
-
function
|
|
3939
|
-
let t =
|
|
3940
|
-
return e?.select ?
|
|
3946
|
+
function _i(e) {
|
|
3947
|
+
let t = J();
|
|
3948
|
+
return e?.select ? Y(t.stores.location, e.select, { equal: k }) : Y(t.stores.location);
|
|
3941
3949
|
}
|
|
3942
3950
|
//#endregion
|
|
3943
3951
|
//#region src/injectBlocker.ts
|
|
3944
|
-
function
|
|
3945
|
-
let { shouldBlockFn: t, enableBeforeUnload: r = !0, disabled: i = !1, withResolver: a = !1 } = e, o =
|
|
3952
|
+
function vi(e) {
|
|
3953
|
+
let { shouldBlockFn: t, enableBeforeUnload: r = !0, disabled: i = !1, withResolver: a = !1 } = e, o = J(), { history: s } = o, c = n.signal({
|
|
3946
3954
|
status: "idle",
|
|
3947
3955
|
current: void 0,
|
|
3948
3956
|
next: void 0,
|
|
@@ -4004,12 +4012,12 @@ function _i(e) {
|
|
|
4004
4012
|
}
|
|
4005
4013
|
//#endregion
|
|
4006
4014
|
//#region src/injectCanGoBack.ts
|
|
4007
|
-
function
|
|
4008
|
-
return J(
|
|
4015
|
+
function yi() {
|
|
4016
|
+
return Y(J().stores.location, (e) => (e.state?.__TSR_index ?? 0) !== 0);
|
|
4009
4017
|
}
|
|
4010
4018
|
//#endregion
|
|
4011
4019
|
//#region src/injectIntersectionObserver.ts
|
|
4012
|
-
function
|
|
4020
|
+
function bi(e, t, r) {
|
|
4013
4021
|
let i = n.inject(n.ElementRef);
|
|
4014
4022
|
n.afterRenderEffect((n) => {
|
|
4015
4023
|
let a = typeof IntersectionObserver == "function", o = i.nativeElement;
|
|
@@ -4022,40 +4030,40 @@ function yi(e, t, r) {
|
|
|
4022
4030
|
}
|
|
4023
4031
|
//#endregion
|
|
4024
4032
|
//#region src/Link.ts
|
|
4025
|
-
var
|
|
4033
|
+
var xi = class e {
|
|
4026
4034
|
constructor() {
|
|
4027
|
-
this.passiveEvents =
|
|
4035
|
+
this.passiveEvents = Ci(() => ({ touchstart: this.handleTouchStart })), this.options = _.required({ alias: "link" }), this.router = J(), this.isTransitioning = S(!1), this.from = m(() => C(() => this.options().from)), this.disabled = m(() => this._options().disabled ?? !1), this.target = m(() => this._options().target), this._options = m(() => ({
|
|
4028
4036
|
...this.options(),
|
|
4029
4037
|
from: this.from()
|
|
4030
|
-
})), this.nextLocation =
|
|
4038
|
+
})), this.nextLocation = m(() => {
|
|
4031
4039
|
let e = this.location();
|
|
4032
4040
|
return this.router.buildLocation({
|
|
4033
4041
|
_fromLocation: e,
|
|
4034
4042
|
...this._options()
|
|
4035
4043
|
});
|
|
4036
|
-
}), this.hrefOption =
|
|
4044
|
+
}), this.hrefOption = m(() => {
|
|
4037
4045
|
if (this._options().disabled) return;
|
|
4038
4046
|
let e = this.nextLocation().maskedLocation ?? this.nextLocation(), t = e.external;
|
|
4039
4047
|
return {
|
|
4040
4048
|
href: t ? e.publicHref : this.router.history.createHref(e.publicHref) || "/",
|
|
4041
4049
|
external: t
|
|
4042
4050
|
};
|
|
4043
|
-
}), this.externalLink =
|
|
4051
|
+
}), this.externalLink = m(() => {
|
|
4044
4052
|
let e = this.hrefOption();
|
|
4045
4053
|
if (e?.external) return e.href;
|
|
4046
4054
|
try {
|
|
4047
4055
|
return new URL(this.options().to), this.options().to;
|
|
4048
4056
|
} catch {}
|
|
4049
|
-
}), this.preload =
|
|
4057
|
+
}), this.preload = m(() => this.options().reloadDocument ? !1 : this.options().preload ?? this.router.options.defaultPreload), this.preloadDelay = m(() => this.options().preloadDelay ?? this.router.options.defaultPreloadDelay ?? 0), this.location = _i(), this.isActiveProps = m(() => {
|
|
4050
4058
|
let e = this.options(), t = this.isActive() ? e.activeProps : e.inactiveProps;
|
|
4051
4059
|
if (!(!t || typeof t != "object")) return t;
|
|
4052
|
-
}), this.isActive =
|
|
4060
|
+
}), this.isActive = m(() => {
|
|
4053
4061
|
if (this.externalLink()) return !1;
|
|
4054
4062
|
let e = this.options().activeOptions;
|
|
4055
4063
|
if (e?.exact) {
|
|
4056
|
-
if (!
|
|
4064
|
+
if (!Ke(this.location().pathname, this.nextLocation().pathname, this.router.basepath)) return !1;
|
|
4057
4065
|
} else {
|
|
4058
|
-
let e =
|
|
4066
|
+
let e = Ge(this.location().pathname, this.router.basepath), t = Ge(this.nextLocation().pathname, this.router.basepath);
|
|
4059
4067
|
if (!(e.startsWith(t) && (e.length === t.length || e[t.length] === "/"))) return !1;
|
|
4060
4068
|
}
|
|
4061
4069
|
return (e?.includeSearch ?? !0) && !k(this.location().search, this.nextLocation().search, {
|
|
@@ -4064,15 +4072,15 @@ var bi = class e {
|
|
|
4064
4072
|
}) ? !1 : e?.includeHash ? this.location().hash === this.nextLocation().hash : !0;
|
|
4065
4073
|
}), this.doPreload = () => {
|
|
4066
4074
|
this.router.preloadRoute(this.options()).catch((e) => {
|
|
4067
|
-
console.warn(e), console.warn(
|
|
4075
|
+
console.warn(e), console.warn(dn);
|
|
4068
4076
|
});
|
|
4069
4077
|
}, this.preloadViewportIoCallback = (e) => {
|
|
4070
4078
|
e?.isIntersecting && this.doPreload();
|
|
4071
|
-
}, this.viewportPreloader =
|
|
4079
|
+
}, this.viewportPreloader = bi(this.preloadViewportIoCallback, { rootMargin: "100px" }, () => !!this._options().disabled || this.preload() !== "viewport"), this.hasRenderFetched = !1, this.rendererPreloader = h(() => {
|
|
4072
4080
|
this.hasRenderFetched || !this._options().disabled && this.preload() === "render" && (this.doPreload(), this.hasRenderFetched = !0);
|
|
4073
4081
|
}), this.handleClick = (e) => {
|
|
4074
4082
|
let t = e.currentTarget.getAttribute("target"), n = this._options().target, r = n === void 0 ? t : n;
|
|
4075
|
-
if (!this._options().disabled && !
|
|
4083
|
+
if (!this._options().disabled && !Si(e) && !e.defaultPrevented && (!r || r === "_self") && e.button === 0) {
|
|
4076
4084
|
e.preventDefault(), this.isTransitioning.set(!0);
|
|
4077
4085
|
let t = this.router.subscribe("onResolved", () => {
|
|
4078
4086
|
t(), this.isTransitioning.set(!1);
|
|
@@ -4137,19 +4145,19 @@ var bi = class e {
|
|
|
4137
4145
|
});
|
|
4138
4146
|
}
|
|
4139
4147
|
};
|
|
4140
|
-
function
|
|
4148
|
+
function Si(e) {
|
|
4141
4149
|
return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
|
|
4142
4150
|
}
|
|
4143
|
-
function
|
|
4144
|
-
let t =
|
|
4145
|
-
|
|
4146
|
-
for (let [n,
|
|
4147
|
-
let e = r.listen(t, n,
|
|
4148
|
-
|
|
4151
|
+
function Ci(e) {
|
|
4152
|
+
let t = g(o).nativeElement, n = g(a), r = g(u), i = [];
|
|
4153
|
+
f(() => {
|
|
4154
|
+
for (let [n, a] of Object.entries(e())) {
|
|
4155
|
+
let e = r.listen(t, n, a, { passive: !0 });
|
|
4156
|
+
i.push(e);
|
|
4149
4157
|
}
|
|
4150
4158
|
}), n.onDestroy(() => {
|
|
4151
|
-
for (;
|
|
4159
|
+
for (; i.length;) i.pop()?.();
|
|
4152
4160
|
});
|
|
4153
4161
|
}
|
|
4154
4162
|
//#endregion
|
|
4155
|
-
export { Gn as LazyRoute,
|
|
4163
|
+
export { Gn as LazyRoute, xi as Link, hr as Matches, Vn as NotFoundRoute, or as Outlet, zn as RootRoute, In as Route, Fn as RouteApi, ar as RouteMatch, xn as Router, br as RouterProvider, Rr as buildManagedDocumentContent, $ as buildMatchManagedDocumentContent, Kt as createBrowserHistory, Un as createFileRoute, qt as createHashHistory, Wt as createHistory, qn as createLazyFileRoute, Kn as createLazyRoute, Jt as createMemoryHistory, Hn as createRootRoute, Rn as createRootRouteWithContext, Ln as createRoute, Bn as createRouteMask, bn as createRouter, hn as createRouterConfig, Pn as getRouteApi, vi as injectBlocker, yi as injectCanGoBack, mi as injectChildMatches, $n as injectErrorState, gi as injectIsShell, On as injectLoaderData, kn as injectLoaderDeps, _i as injectLocation, X as injectMatch, hi as injectMatchRoute, fi as injectMatches, An as injectNavigate, jn as injectParams, pi as injectParentMatches, Mn as injectRouteContext, J as injectRouter, er as injectRouterState, Nn as injectSearch, dr as injectSsrScrollRestorationScript, Y as injectStore, B as isRedirect, nn as lazyFn, Qe as notFound, di as provideHeadContent, ni as provideTanstackBodyManagedTags, ui as provideTanstackDocument, ai as provideTanstackDocumentTitle, ci as provideTanstackHeadManagedTags, yr as provideTanstackRouter, ht as redirect, gn as retainSearchParams };
|