@kitbag/router 0.16.1 → 0.17.2
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/kitbag-router.d.ts +64 -25
- package/dist/kitbag-router.js +1325 -1052
- package/dist/kitbag-router.umd.cjs +4 -1
- package/package.json +12 -6
package/dist/kitbag-router.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { inject as
|
|
5
|
-
|
|
1
|
+
var Mr = Object.defineProperty;
|
|
2
|
+
var Tr = (e, t, r) => t in e ? Mr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var M = (e, t, r) => Tr(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { inject as oe, toRefs as Jr, computed as V, reactive as He, defineComponent as de, h as ue, ref as _e, markRaw as Ae, watch as ee, onUnmounted as qe, getCurrentInstance as Wr, provide as Zr, renderSlot as xt, normalizeProps as Lt, mergeProps as Gr, unref as ge, openBlock as Ut, createBlock as Qr, resolveDynamicComponent as Kr, createCommentVNode as zr, defineAsyncComponent as Yr, toValue as H, createElementBlock as Xr, normalizeClass as en, guardReactiveProps as tn } from "vue";
|
|
5
|
+
import { ZodString as ke, ZodBoolean as Bt, ZodDate as Ct, ZodNumber as Nt, ZodLiteral as Vt, ZodObject as jt, ZodEnum as $t, ZodNativeEnum as Ht, ZodArray as _t, ZodTuple as qt, ZodUnion as Ot, ZodDiscriminatedUnion as It, ZodRecord as Dt, ZodMap as Ft, ZodSet as Mt, ZodIntersection as Tt, ZodPromise as Jt, ZodFunction as Wt, ZodSchema as Zt } from "zod";
|
|
6
|
+
function T(e) {
|
|
6
7
|
return typeof e != "string" ? !1 : /^(https?:\/\/|\/).*/g.test(e);
|
|
7
8
|
}
|
|
8
|
-
function
|
|
9
|
-
return
|
|
9
|
+
function Gt(e) {
|
|
10
|
+
return T(e) ? e : `/${e}`;
|
|
10
11
|
}
|
|
11
|
-
class
|
|
12
|
+
class rn extends Error {
|
|
12
13
|
/**
|
|
13
14
|
* Constructs a new DuplicateParamsError instance with a message indicating the problematic parameter.
|
|
14
15
|
* @param paramName - The name of the parameter that was duplicated.
|
|
@@ -17,17 +18,17 @@ class br extends Error {
|
|
|
17
18
|
super(`Invalid Param "${t}": Router does not support multiple params by the same name. All param names must be unique.`);
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
|
-
class
|
|
21
|
+
class nn extends Error {
|
|
21
22
|
constructor(t) {
|
|
22
23
|
super(`Child property on meta for ${t} conflicts with the parent meta.`);
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
|
-
class
|
|
26
|
+
class me extends Error {
|
|
26
27
|
constructor() {
|
|
27
28
|
super("Router not installed");
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
|
-
class
|
|
31
|
+
class on extends Error {
|
|
31
32
|
/**
|
|
32
33
|
* Constructs a new UseRouteInvalidError instance with a message that specifies both the given and expected route names.
|
|
33
34
|
* This detailed error message aids in quickly identifying and resolving mismatches in route usage.
|
|
@@ -38,135 +39,269 @@ class Ar extends Error {
|
|
|
38
39
|
super(`useRoute called with incorrect route. Given ${t}, expected ${r}`);
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
|
-
const
|
|
42
|
-
function
|
|
43
|
-
const e =
|
|
42
|
+
const Qt = Symbol();
|
|
43
|
+
function Ge() {
|
|
44
|
+
const e = oe(Qt);
|
|
44
45
|
if (!e)
|
|
45
|
-
throw new
|
|
46
|
+
throw new me();
|
|
46
47
|
return e;
|
|
47
48
|
}
|
|
48
49
|
function ve(e) {
|
|
49
50
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
50
51
|
}
|
|
51
|
-
function
|
|
52
|
+
function W(e) {
|
|
52
53
|
return typeof e == "string" && e.length > 0;
|
|
53
54
|
}
|
|
54
|
-
function
|
|
55
|
+
function xe(e) {
|
|
55
56
|
return {
|
|
56
|
-
value:
|
|
57
|
+
value: W(e) ? e.replace(/^#*/, "") : void 0
|
|
57
58
|
};
|
|
58
59
|
}
|
|
59
|
-
function
|
|
60
|
-
return
|
|
60
|
+
function an(e, t) {
|
|
61
|
+
return xe(`${e.value ?? ""}${t.value ?? ""}`);
|
|
61
62
|
}
|
|
62
|
-
function
|
|
63
|
-
return
|
|
63
|
+
function sn(e, t) {
|
|
64
|
+
return cn(e, t), { ...e, ...t };
|
|
64
65
|
}
|
|
65
|
-
function
|
|
66
|
+
function cn(e, t) {
|
|
66
67
|
const r = Object.keys(e).find((n) => n in t && typeof t[n] != typeof e[n]);
|
|
67
68
|
if (r)
|
|
68
|
-
throw new
|
|
69
|
+
throw new nn(r);
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
+
function ie(e) {
|
|
71
72
|
return Array.isArray(e) ? e : [e];
|
|
72
73
|
}
|
|
73
|
-
function
|
|
74
|
+
function Kt(e, t) {
|
|
74
75
|
return e.filter((r) => t === r).length;
|
|
75
76
|
}
|
|
76
|
-
function
|
|
77
|
-
const t = e.flatMap((r) => Array.isArray(r) ? r : Object.keys(r).map(
|
|
77
|
+
function ye(...e) {
|
|
78
|
+
const t = e.flatMap((r) => Array.isArray(r) ? r : Object.keys(r).map(un));
|
|
78
79
|
for (const r of t)
|
|
79
|
-
if (
|
|
80
|
-
throw new
|
|
80
|
+
if (Kt(t, r) > 1)
|
|
81
|
+
throw new rn(r);
|
|
81
82
|
}
|
|
82
|
-
function
|
|
83
|
+
function un(e) {
|
|
83
84
|
return e.startsWith("?") ? e.slice(1) : e;
|
|
84
85
|
}
|
|
85
|
-
function
|
|
86
|
-
return
|
|
86
|
+
function fn(e, t) {
|
|
87
|
+
return ye(e.params, t.params), {
|
|
87
88
|
value: `${e.value}${t.value}`,
|
|
88
89
|
params: { ...e.params, ...t.params }
|
|
89
90
|
};
|
|
90
91
|
}
|
|
91
|
-
function
|
|
92
|
-
return
|
|
93
|
-
value: [e.value, t.value].filter(
|
|
92
|
+
function ln(e, t) {
|
|
93
|
+
return ye(e.params, t.params), {
|
|
94
|
+
value: [e.value, t.value].filter(W).join("&"),
|
|
94
95
|
params: { ...e.params, ...t.params }
|
|
95
96
|
};
|
|
96
97
|
}
|
|
97
|
-
function
|
|
98
|
-
return
|
|
98
|
+
function hn(e, t) {
|
|
99
|
+
return ye(e, t), { ...e, ...t };
|
|
99
100
|
}
|
|
100
|
-
function
|
|
101
|
+
function pn(e) {
|
|
101
102
|
return "host" in e && !!e.host;
|
|
102
103
|
}
|
|
103
|
-
function
|
|
104
|
+
function zt(e) {
|
|
104
105
|
return "parent" in e && !!e.parent;
|
|
105
106
|
}
|
|
106
|
-
function
|
|
107
|
+
function Yt(e) {
|
|
107
108
|
return "component" in e && !!e.component;
|
|
108
109
|
}
|
|
109
|
-
function
|
|
110
|
+
function lt(e) {
|
|
110
111
|
return "props" in e && typeof e.props == "function";
|
|
111
112
|
}
|
|
112
|
-
function
|
|
113
|
+
function Xt(e) {
|
|
113
114
|
return "components" in e && !!e.components;
|
|
114
115
|
}
|
|
115
|
-
function
|
|
116
|
+
function ht(e) {
|
|
116
117
|
return "props" in e && typeof e.props == "object";
|
|
117
118
|
}
|
|
118
|
-
function
|
|
119
|
+
function dn(e) {
|
|
119
120
|
return "state" in e && !!e.state;
|
|
120
121
|
}
|
|
121
|
-
function
|
|
122
|
+
function er(e, t) {
|
|
122
123
|
return {
|
|
123
124
|
...t,
|
|
124
|
-
path:
|
|
125
|
-
query:
|
|
126
|
-
meta:
|
|
127
|
-
state:
|
|
128
|
-
hash:
|
|
125
|
+
path: fn(e.path, t.path),
|
|
126
|
+
query: ln(e.query, t.query),
|
|
127
|
+
meta: sn(e.meta, t.meta),
|
|
128
|
+
state: hn(e.state, t.state),
|
|
129
|
+
hash: an(e.hash, t.hash),
|
|
129
130
|
matches: [...e.matches, t.matched],
|
|
130
131
|
host: e.host,
|
|
131
132
|
depth: e.depth + 1
|
|
132
133
|
};
|
|
133
134
|
}
|
|
134
|
-
function
|
|
135
|
+
function Qe() {
|
|
135
136
|
return typeof window < "u" && typeof window.document < "u";
|
|
136
137
|
}
|
|
137
|
-
class
|
|
138
|
+
class Z extends Error {
|
|
138
139
|
}
|
|
139
|
-
const G = "[",
|
|
140
|
-
function
|
|
140
|
+
const G = "[", z = "]";
|
|
141
|
+
function mn(e) {
|
|
141
142
|
return e !== String && e !== Boolean && e !== Number && e !== Date;
|
|
142
143
|
}
|
|
143
|
-
function
|
|
144
|
-
return typeof e == "function" &&
|
|
144
|
+
function yn(e) {
|
|
145
|
+
return typeof e == "function" && mn(e);
|
|
145
146
|
}
|
|
146
|
-
function
|
|
147
|
+
function Oe(e) {
|
|
147
148
|
return typeof e == "object" && "get" in e && typeof e.get == "function" && "set" in e && typeof e.set == "function";
|
|
148
149
|
}
|
|
149
|
-
function
|
|
150
|
-
return
|
|
150
|
+
function tr(e) {
|
|
151
|
+
return typeof e == "string" || typeof e == "number" || typeof e == "boolean";
|
|
152
|
+
}
|
|
153
|
+
function gn(e) {
|
|
154
|
+
return Oe(e) && e.defaultValue !== void 0;
|
|
151
155
|
}
|
|
152
|
-
function
|
|
153
|
-
return
|
|
156
|
+
function zo(e, t) {
|
|
157
|
+
return bn(e, t);
|
|
154
158
|
}
|
|
155
|
-
function
|
|
159
|
+
function rr(e) {
|
|
160
|
+
return {
|
|
161
|
+
get: (t, { invalid: r }) => {
|
|
162
|
+
try {
|
|
163
|
+
return Te(t, e);
|
|
164
|
+
} catch {
|
|
165
|
+
throw r();
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
set: (t, { invalid: r }) => {
|
|
169
|
+
try {
|
|
170
|
+
return Je(t, e);
|
|
171
|
+
} catch {
|
|
172
|
+
throw r();
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
const Rn = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
|
178
|
+
function ae(e, t) {
|
|
179
|
+
if (typeof t == "string" && Rn.test(t)) {
|
|
180
|
+
const r = new Date(t);
|
|
181
|
+
return isNaN(r.getTime()) ? t : r;
|
|
182
|
+
}
|
|
183
|
+
return t;
|
|
184
|
+
}
|
|
185
|
+
function ce(e) {
|
|
186
|
+
for (const t of e)
|
|
187
|
+
try {
|
|
188
|
+
return t();
|
|
189
|
+
} catch {
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
throw new Error("All functions failed");
|
|
193
|
+
}
|
|
194
|
+
function Le(e, t) {
|
|
195
|
+
return e instanceof ke ? 1 : t instanceof ke ? -1 : 0;
|
|
196
|
+
}
|
|
197
|
+
function Te(e, t) {
|
|
198
|
+
if (t instanceof ke)
|
|
199
|
+
return t.parse(e);
|
|
200
|
+
if (t instanceof Bt)
|
|
201
|
+
return t.parse(!!e);
|
|
202
|
+
if (t instanceof Ct)
|
|
203
|
+
return t.parse(new Date(e));
|
|
204
|
+
if (t instanceof Nt)
|
|
205
|
+
return t.parse(Number(e));
|
|
206
|
+
if (t instanceof Vt)
|
|
207
|
+
return ce([
|
|
208
|
+
() => t.parse(Number(e)),
|
|
209
|
+
() => t.parse(!!e),
|
|
210
|
+
() => t.parse(e)
|
|
211
|
+
]);
|
|
212
|
+
if (t instanceof jt)
|
|
213
|
+
return t.parse(JSON.parse(e, ae));
|
|
214
|
+
if (t instanceof $t)
|
|
215
|
+
return t.parse(e);
|
|
216
|
+
if (t instanceof Ht)
|
|
217
|
+
return ce([
|
|
218
|
+
() => t.parse(Number(e)),
|
|
219
|
+
() => t.parse(e)
|
|
220
|
+
]);
|
|
221
|
+
if (t instanceof _t || t instanceof qt)
|
|
222
|
+
return t.parse(JSON.parse(e, ae));
|
|
223
|
+
if (t instanceof Ot) {
|
|
224
|
+
const r = Array.from(t._def.options).sort(Le).map((n) => () => Te(e, n));
|
|
225
|
+
return ce(r);
|
|
226
|
+
}
|
|
227
|
+
if (t instanceof It) {
|
|
228
|
+
const r = Array.from(t.options).sort(Le).map((n) => () => Te(e, n));
|
|
229
|
+
return ce(r);
|
|
230
|
+
}
|
|
231
|
+
if (t instanceof Dt)
|
|
232
|
+
return t.parse(JSON.parse(e, ae));
|
|
233
|
+
if (t instanceof Ft)
|
|
234
|
+
return t.parse(new Map(JSON.parse(e, ae)));
|
|
235
|
+
if (t instanceof Mt)
|
|
236
|
+
return t.parse(new Set(JSON.parse(e, ae)));
|
|
237
|
+
if (t instanceof Tt)
|
|
238
|
+
throw new Error("Intersection schemas are not supported");
|
|
239
|
+
if (t instanceof Jt)
|
|
240
|
+
throw new Error("Promise schemas are not supported");
|
|
241
|
+
if (t instanceof Wt)
|
|
242
|
+
throw new Error("Function schemas are not supported");
|
|
243
|
+
return t.parse(e);
|
|
244
|
+
}
|
|
245
|
+
function Je(e, t) {
|
|
246
|
+
if (t instanceof ke)
|
|
247
|
+
return t.parse(e);
|
|
248
|
+
if (t instanceof Bt)
|
|
249
|
+
return t.parse(e).toString();
|
|
250
|
+
if (t instanceof Ct)
|
|
251
|
+
return t.parse(e).toISOString();
|
|
252
|
+
if (t instanceof Nt)
|
|
253
|
+
return t.parse(Number(e)).toString();
|
|
254
|
+
if (t instanceof Vt)
|
|
255
|
+
return t.parse(e).toString();
|
|
256
|
+
if (t instanceof jt)
|
|
257
|
+
return JSON.stringify(t.parse(e));
|
|
258
|
+
if (t instanceof $t)
|
|
259
|
+
return t.parse(e);
|
|
260
|
+
if (t instanceof Ht)
|
|
261
|
+
return t.parse(e).toString();
|
|
262
|
+
if (t instanceof _t || t instanceof qt)
|
|
263
|
+
return JSON.stringify(t.parse(e));
|
|
264
|
+
if (t instanceof Ot) {
|
|
265
|
+
const r = Array.from(t._def.options).sort(Le).map((n) => () => Je(e, n));
|
|
266
|
+
return ce(r);
|
|
267
|
+
}
|
|
268
|
+
if (t instanceof It) {
|
|
269
|
+
const r = Array.from(t.options).sort(Le).map((n) => () => Je(e, n));
|
|
270
|
+
return ce(r);
|
|
271
|
+
}
|
|
272
|
+
if (t instanceof Dt)
|
|
273
|
+
return JSON.stringify(t.parse(e));
|
|
274
|
+
if (t instanceof Ft) {
|
|
275
|
+
const r = t.parse(e);
|
|
276
|
+
return JSON.stringify(Array.from(r.entries()));
|
|
277
|
+
}
|
|
278
|
+
if (t instanceof Mt) {
|
|
279
|
+
const r = t.parse(e);
|
|
280
|
+
return JSON.stringify(Array.from(r.values()));
|
|
281
|
+
}
|
|
282
|
+
if (t instanceof Tt)
|
|
283
|
+
throw new Error("Intersection schemas are not supported");
|
|
284
|
+
if (t instanceof Jt)
|
|
285
|
+
throw new Error("Promise schemas are not supported");
|
|
286
|
+
if (t instanceof Wt)
|
|
287
|
+
throw new Error("Function schemas are not supported");
|
|
288
|
+
return JSON.stringify(t.parse(e));
|
|
289
|
+
}
|
|
290
|
+
function vn(e, t) {
|
|
156
291
|
return e[t] ?? String;
|
|
157
292
|
}
|
|
158
|
-
const
|
|
293
|
+
const C = {
|
|
159
294
|
invalid: (e) => {
|
|
160
|
-
throw new
|
|
295
|
+
throw new Z(e);
|
|
161
296
|
}
|
|
162
|
-
},
|
|
297
|
+
}, nr = {
|
|
163
298
|
get: (e) => e,
|
|
164
299
|
set: (e, { invalid: t }) => {
|
|
165
300
|
if (typeof e != "string")
|
|
166
301
|
throw t();
|
|
167
302
|
return e;
|
|
168
303
|
}
|
|
169
|
-
},
|
|
304
|
+
}, Ke = {
|
|
170
305
|
get: (e, { invalid: t }) => {
|
|
171
306
|
if (e === "true")
|
|
172
307
|
return !0;
|
|
@@ -179,7 +314,7 @@ const _ = {
|
|
|
179
314
|
throw t();
|
|
180
315
|
return e.toString();
|
|
181
316
|
}
|
|
182
|
-
},
|
|
317
|
+
}, ze = {
|
|
183
318
|
get: (e, { invalid: t }) => {
|
|
184
319
|
const r = Number(e);
|
|
185
320
|
if (isNaN(r))
|
|
@@ -191,7 +326,7 @@ const _ = {
|
|
|
191
326
|
throw t();
|
|
192
327
|
return e.toString();
|
|
193
328
|
}
|
|
194
|
-
},
|
|
329
|
+
}, or = {
|
|
195
330
|
get: (e, { invalid: t }) => {
|
|
196
331
|
const r = new Date(e);
|
|
197
332
|
if (isNaN(r.getTime()))
|
|
@@ -203,7 +338,7 @@ const _ = {
|
|
|
203
338
|
throw t();
|
|
204
339
|
return e.toISOString();
|
|
205
340
|
}
|
|
206
|
-
},
|
|
341
|
+
}, ar = {
|
|
207
342
|
get: (e, { invalid: t }) => {
|
|
208
343
|
try {
|
|
209
344
|
return JSON.parse(e);
|
|
@@ -219,78 +354,120 @@ const _ = {
|
|
|
219
354
|
}
|
|
220
355
|
}
|
|
221
356
|
};
|
|
222
|
-
function
|
|
223
|
-
|
|
224
|
-
|
|
357
|
+
function wn(e, t) {
|
|
358
|
+
switch (typeof t) {
|
|
359
|
+
case "string":
|
|
360
|
+
return nr.get(e, C) === t;
|
|
361
|
+
case "number":
|
|
362
|
+
return ze.get(e, C) === t;
|
|
363
|
+
case "boolean":
|
|
364
|
+
return Ke.get(e, C) === t;
|
|
365
|
+
default:
|
|
366
|
+
return !1;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
function te(e, t, r = !1) {
|
|
370
|
+
if (e === void 0 || !W(e)) {
|
|
371
|
+
if (gn(t))
|
|
225
372
|
return t.defaultValue;
|
|
226
373
|
if (r)
|
|
227
374
|
return;
|
|
228
|
-
throw new
|
|
375
|
+
throw new Z();
|
|
229
376
|
}
|
|
230
377
|
if (t === String)
|
|
231
|
-
return
|
|
378
|
+
return nr.get(e, C);
|
|
232
379
|
if (t === Boolean)
|
|
233
|
-
return
|
|
380
|
+
return Ke.get(e, C);
|
|
234
381
|
if (t === Number)
|
|
235
|
-
return
|
|
382
|
+
return ze.get(e, C);
|
|
236
383
|
if (t === Date)
|
|
237
|
-
return
|
|
384
|
+
return or.get(e, C);
|
|
238
385
|
if (t === JSON)
|
|
239
|
-
return
|
|
240
|
-
if (
|
|
241
|
-
return t(e,
|
|
242
|
-
if (
|
|
243
|
-
return t.get(e,
|
|
386
|
+
return ar.get(e, C);
|
|
387
|
+
if (yn(t))
|
|
388
|
+
return t(e, C);
|
|
389
|
+
if (Oe(t))
|
|
390
|
+
return t.get(e, C);
|
|
244
391
|
if (t instanceof RegExp) {
|
|
245
392
|
if (t.test(e))
|
|
246
393
|
return e;
|
|
247
|
-
throw new
|
|
394
|
+
throw new Z();
|
|
395
|
+
}
|
|
396
|
+
if (tr(t)) {
|
|
397
|
+
if (wn(e, t))
|
|
398
|
+
return t;
|
|
399
|
+
throw new Z();
|
|
400
|
+
}
|
|
401
|
+
return t instanceof Zt ? rr(t).get(e, C) : e;
|
|
402
|
+
}
|
|
403
|
+
function En(e, t, r = !1) {
|
|
404
|
+
try {
|
|
405
|
+
return te(e, t, r);
|
|
406
|
+
} catch (n) {
|
|
407
|
+
if (n instanceof Z)
|
|
408
|
+
return;
|
|
409
|
+
throw n;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
function Pn(e, t, r = !1) {
|
|
413
|
+
try {
|
|
414
|
+
return re(e, t, r);
|
|
415
|
+
} catch (n) {
|
|
416
|
+
if (n instanceof Z)
|
|
417
|
+
return;
|
|
418
|
+
throw n;
|
|
248
419
|
}
|
|
249
|
-
return e;
|
|
250
420
|
}
|
|
251
|
-
function
|
|
421
|
+
function re(e, t, r = !1) {
|
|
252
422
|
if (e === void 0) {
|
|
253
423
|
if (r)
|
|
254
424
|
return "";
|
|
255
|
-
throw new
|
|
425
|
+
throw new Z();
|
|
256
426
|
}
|
|
257
427
|
if (t === Boolean)
|
|
258
|
-
return
|
|
428
|
+
return Ke.set(e, C);
|
|
259
429
|
if (t === Number)
|
|
260
|
-
return
|
|
430
|
+
return ze.set(e, C);
|
|
261
431
|
if (t === Date)
|
|
262
|
-
return
|
|
432
|
+
return or.set(e, C);
|
|
263
433
|
if (t === JSON)
|
|
264
|
-
return
|
|
265
|
-
if (
|
|
266
|
-
return t.set(e,
|
|
434
|
+
return ar.set(e, C);
|
|
435
|
+
if (Oe(t))
|
|
436
|
+
return t.set(e, C);
|
|
437
|
+
if (tr(t)) {
|
|
438
|
+
if (t !== e)
|
|
439
|
+
throw new Z();
|
|
440
|
+
return e.toString();
|
|
441
|
+
}
|
|
442
|
+
if (t instanceof Zt)
|
|
443
|
+
return rr(t).set(e, C);
|
|
267
444
|
try {
|
|
268
445
|
return e.toString();
|
|
269
446
|
} catch {
|
|
270
|
-
throw new
|
|
447
|
+
throw new Z();
|
|
271
448
|
}
|
|
272
449
|
}
|
|
273
|
-
function
|
|
274
|
-
return
|
|
275
|
-
get: (r) =>
|
|
276
|
-
set: (r) =>
|
|
450
|
+
function bn(e, t) {
|
|
451
|
+
return Oe(e) ? { ...e, defaultValue: t ?? e.defaultValue } : {
|
|
452
|
+
get: (r) => te(r, e),
|
|
453
|
+
set: (r) => re(r, e),
|
|
277
454
|
defaultValue: t
|
|
278
455
|
};
|
|
279
456
|
}
|
|
280
|
-
function
|
|
281
|
-
return
|
|
457
|
+
function K() {
|
|
458
|
+
return K = Object.assign ? Object.assign.bind() : function(e) {
|
|
282
459
|
for (var t = 1; t < arguments.length; t++) {
|
|
283
460
|
var r = arguments[t];
|
|
284
461
|
for (var n in r) ({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
285
462
|
}
|
|
286
463
|
return e;
|
|
287
|
-
},
|
|
464
|
+
}, K.apply(null, arguments);
|
|
288
465
|
}
|
|
289
|
-
var
|
|
466
|
+
var j;
|
|
290
467
|
(function(e) {
|
|
291
468
|
e.Pop = "POP", e.Push = "PUSH", e.Replace = "REPLACE";
|
|
292
|
-
})(
|
|
293
|
-
var
|
|
469
|
+
})(j || (j = {}));
|
|
470
|
+
var le = process.env.NODE_ENV !== "production" ? function(e) {
|
|
294
471
|
return Object.freeze(e);
|
|
295
472
|
} : function(e) {
|
|
296
473
|
return e;
|
|
@@ -304,36 +481,36 @@ function Y(e, t) {
|
|
|
304
481
|
}
|
|
305
482
|
}
|
|
306
483
|
}
|
|
307
|
-
var
|
|
308
|
-
function
|
|
484
|
+
var Ue = "beforeunload", Sn = "hashchange", sr = "popstate";
|
|
485
|
+
function pt(e) {
|
|
309
486
|
e === void 0 && (e = {});
|
|
310
487
|
var t = e, r = t.window, n = r === void 0 ? document.defaultView : r, o = n.history;
|
|
311
488
|
function a() {
|
|
312
|
-
var
|
|
313
|
-
return [
|
|
489
|
+
var d = n.location, l = d.pathname, w = d.search, A = d.hash, x = o.state || {};
|
|
490
|
+
return [x.idx, le({
|
|
314
491
|
pathname: l,
|
|
315
|
-
search:
|
|
316
|
-
hash:
|
|
317
|
-
state:
|
|
318
|
-
key:
|
|
492
|
+
search: w,
|
|
493
|
+
hash: A,
|
|
494
|
+
state: x.usr || null,
|
|
495
|
+
key: x.key || "default"
|
|
319
496
|
})];
|
|
320
497
|
}
|
|
321
498
|
var s = null;
|
|
322
|
-
function
|
|
499
|
+
function i() {
|
|
323
500
|
if (s)
|
|
324
|
-
|
|
501
|
+
y.call(s), s = null;
|
|
325
502
|
else {
|
|
326
|
-
var
|
|
327
|
-
if (
|
|
328
|
-
if (
|
|
329
|
-
var
|
|
330
|
-
|
|
331
|
-
action:
|
|
332
|
-
location:
|
|
503
|
+
var d = j.Pop, l = a(), w = l[0], A = l[1];
|
|
504
|
+
if (y.length)
|
|
505
|
+
if (w != null) {
|
|
506
|
+
var x = m - w;
|
|
507
|
+
x && (s = {
|
|
508
|
+
action: d,
|
|
509
|
+
location: A,
|
|
333
510
|
retry: function() {
|
|
334
|
-
|
|
511
|
+
b(x * -1);
|
|
335
512
|
}
|
|
336
|
-
},
|
|
513
|
+
}, b(x));
|
|
337
514
|
} else
|
|
338
515
|
process.env.NODE_ENV !== "production" && Y(
|
|
339
516
|
!1,
|
|
@@ -343,131 +520,131 @@ function nt(e) {
|
|
|
343
520
|
"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."
|
|
344
521
|
);
|
|
345
522
|
else
|
|
346
|
-
|
|
523
|
+
S(d);
|
|
347
524
|
}
|
|
348
525
|
}
|
|
349
|
-
n.addEventListener(
|
|
350
|
-
var
|
|
351
|
-
|
|
352
|
-
idx:
|
|
526
|
+
n.addEventListener(sr, i);
|
|
527
|
+
var f = j.Pop, u = a(), m = u[0], E = u[1], L = he(), y = he();
|
|
528
|
+
m == null && (m = 0, o.replaceState(K({}, o.state, {
|
|
529
|
+
idx: m
|
|
353
530
|
}), ""));
|
|
354
|
-
function
|
|
355
|
-
return typeof
|
|
531
|
+
function p(d) {
|
|
532
|
+
return typeof d == "string" ? d : X(d);
|
|
356
533
|
}
|
|
357
|
-
function
|
|
358
|
-
return l === void 0 && (l = null),
|
|
359
|
-
pathname:
|
|
534
|
+
function g(d, l) {
|
|
535
|
+
return l === void 0 && (l = null), le(K({
|
|
536
|
+
pathname: E.pathname,
|
|
360
537
|
hash: "",
|
|
361
538
|
search: ""
|
|
362
|
-
}, typeof
|
|
539
|
+
}, typeof d == "string" ? Re(d) : d, {
|
|
363
540
|
state: l,
|
|
364
|
-
key:
|
|
541
|
+
key: Ce()
|
|
365
542
|
}));
|
|
366
543
|
}
|
|
367
|
-
function
|
|
544
|
+
function c(d, l) {
|
|
368
545
|
return [{
|
|
369
|
-
usr:
|
|
370
|
-
key:
|
|
546
|
+
usr: d.state,
|
|
547
|
+
key: d.key,
|
|
371
548
|
idx: l
|
|
372
|
-
},
|
|
549
|
+
}, p(d)];
|
|
373
550
|
}
|
|
374
|
-
function d
|
|
375
|
-
return !
|
|
376
|
-
action:
|
|
551
|
+
function h(d, l, w) {
|
|
552
|
+
return !y.length || (y.call({
|
|
553
|
+
action: d,
|
|
377
554
|
location: l,
|
|
378
|
-
retry:
|
|
555
|
+
retry: w
|
|
379
556
|
}), !1);
|
|
380
557
|
}
|
|
381
|
-
function
|
|
382
|
-
|
|
558
|
+
function S(d) {
|
|
559
|
+
f = d;
|
|
383
560
|
var l = a();
|
|
384
|
-
|
|
385
|
-
action:
|
|
386
|
-
location:
|
|
561
|
+
m = l[0], E = l[1], L.call({
|
|
562
|
+
action: f,
|
|
563
|
+
location: E
|
|
387
564
|
});
|
|
388
565
|
}
|
|
389
|
-
function
|
|
390
|
-
var
|
|
391
|
-
function
|
|
392
|
-
|
|
566
|
+
function R(d, l) {
|
|
567
|
+
var w = j.Push, A = g(d, l);
|
|
568
|
+
function x() {
|
|
569
|
+
R(d, l);
|
|
393
570
|
}
|
|
394
|
-
if (
|
|
395
|
-
var B =
|
|
571
|
+
if (h(w, A, x)) {
|
|
572
|
+
var B = c(A, m + 1), N = B[0], $ = B[1];
|
|
396
573
|
try {
|
|
397
|
-
o.pushState(
|
|
574
|
+
o.pushState(N, "", $);
|
|
398
575
|
} catch {
|
|
399
|
-
n.location.assign(
|
|
576
|
+
n.location.assign($);
|
|
400
577
|
}
|
|
401
|
-
|
|
578
|
+
S(w);
|
|
402
579
|
}
|
|
403
580
|
}
|
|
404
|
-
function
|
|
405
|
-
var
|
|
406
|
-
function
|
|
407
|
-
|
|
581
|
+
function v(d, l) {
|
|
582
|
+
var w = j.Replace, A = g(d, l);
|
|
583
|
+
function x() {
|
|
584
|
+
v(d, l);
|
|
408
585
|
}
|
|
409
|
-
if (
|
|
410
|
-
var B =
|
|
411
|
-
o.replaceState(
|
|
586
|
+
if (h(w, A, x)) {
|
|
587
|
+
var B = c(A, m), N = B[0], $ = B[1];
|
|
588
|
+
o.replaceState(N, "", $), S(w);
|
|
412
589
|
}
|
|
413
590
|
}
|
|
414
|
-
function
|
|
415
|
-
o.go(
|
|
591
|
+
function b(d) {
|
|
592
|
+
o.go(d);
|
|
416
593
|
}
|
|
417
594
|
var k = {
|
|
418
595
|
get action() {
|
|
419
|
-
return
|
|
596
|
+
return f;
|
|
420
597
|
},
|
|
421
598
|
get location() {
|
|
422
|
-
return
|
|
599
|
+
return E;
|
|
423
600
|
},
|
|
424
|
-
createHref:
|
|
425
|
-
push:
|
|
426
|
-
replace:
|
|
427
|
-
go:
|
|
601
|
+
createHref: p,
|
|
602
|
+
push: R,
|
|
603
|
+
replace: v,
|
|
604
|
+
go: b,
|
|
428
605
|
back: function() {
|
|
429
|
-
|
|
606
|
+
b(-1);
|
|
430
607
|
},
|
|
431
608
|
forward: function() {
|
|
432
|
-
|
|
609
|
+
b(1);
|
|
433
610
|
},
|
|
434
611
|
listen: function(l) {
|
|
435
|
-
return
|
|
612
|
+
return L.push(l);
|
|
436
613
|
},
|
|
437
614
|
block: function(l) {
|
|
438
|
-
var
|
|
439
|
-
return
|
|
440
|
-
|
|
615
|
+
var w = y.push(l);
|
|
616
|
+
return y.length === 1 && n.addEventListener(Ue, Be), function() {
|
|
617
|
+
w(), y.length || n.removeEventListener(Ue, Be);
|
|
441
618
|
};
|
|
442
619
|
}
|
|
443
620
|
};
|
|
444
621
|
return k;
|
|
445
622
|
}
|
|
446
|
-
function
|
|
623
|
+
function An(e) {
|
|
447
624
|
e === void 0 && (e = {});
|
|
448
625
|
var t = e, r = t.window, n = r === void 0 ? document.defaultView : r, o = n.history;
|
|
449
626
|
function a() {
|
|
450
|
-
var l =
|
|
451
|
-
return [
|
|
452
|
-
pathname:
|
|
627
|
+
var l = Re(n.location.hash.substr(1)), w = l.pathname, A = w === void 0 ? "/" : w, x = l.search, B = x === void 0 ? "" : x, N = l.hash, $ = N === void 0 ? "" : N, O = o.state || {};
|
|
628
|
+
return [O.idx, le({
|
|
629
|
+
pathname: A,
|
|
453
630
|
search: B,
|
|
454
|
-
hash:
|
|
455
|
-
state:
|
|
456
|
-
key:
|
|
631
|
+
hash: $,
|
|
632
|
+
state: O.usr || null,
|
|
633
|
+
key: O.key || "default"
|
|
457
634
|
})];
|
|
458
635
|
}
|
|
459
636
|
var s = null;
|
|
460
|
-
function
|
|
637
|
+
function i() {
|
|
461
638
|
if (s)
|
|
462
|
-
|
|
639
|
+
y.call(s), s = null;
|
|
463
640
|
else {
|
|
464
|
-
var l =
|
|
465
|
-
if (
|
|
466
|
-
if (
|
|
467
|
-
var B =
|
|
641
|
+
var l = j.Pop, w = a(), A = w[0], x = w[1];
|
|
642
|
+
if (y.length)
|
|
643
|
+
if (A != null) {
|
|
644
|
+
var B = m - A;
|
|
468
645
|
B && (s = {
|
|
469
646
|
action: l,
|
|
470
|
-
location:
|
|
647
|
+
location: x,
|
|
471
648
|
retry: function() {
|
|
472
649
|
k(B * -1);
|
|
473
650
|
}
|
|
@@ -481,98 +658,98 @@ function Mr(e) {
|
|
|
481
658
|
"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."
|
|
482
659
|
);
|
|
483
660
|
else
|
|
484
|
-
|
|
661
|
+
R(l);
|
|
485
662
|
}
|
|
486
663
|
}
|
|
487
|
-
n.addEventListener(
|
|
488
|
-
var l = a(),
|
|
489
|
-
X(
|
|
664
|
+
n.addEventListener(sr, i), n.addEventListener(Sn, function() {
|
|
665
|
+
var l = a(), w = l[1];
|
|
666
|
+
X(w) !== X(E) && i();
|
|
490
667
|
});
|
|
491
|
-
var
|
|
492
|
-
|
|
493
|
-
idx:
|
|
668
|
+
var f = j.Pop, u = a(), m = u[0], E = u[1], L = he(), y = he();
|
|
669
|
+
m == null && (m = 0, o.replaceState(K({}, o.state, {
|
|
670
|
+
idx: m
|
|
494
671
|
}), ""));
|
|
495
|
-
function
|
|
496
|
-
var l = document.querySelector("base"),
|
|
672
|
+
function p() {
|
|
673
|
+
var l = document.querySelector("base"), w = "";
|
|
497
674
|
if (l && l.getAttribute("href")) {
|
|
498
|
-
var
|
|
499
|
-
|
|
675
|
+
var A = n.location.href, x = A.indexOf("#");
|
|
676
|
+
w = x === -1 ? A : A.slice(0, x);
|
|
500
677
|
}
|
|
501
|
-
return
|
|
678
|
+
return w;
|
|
502
679
|
}
|
|
503
|
-
function
|
|
504
|
-
return
|
|
680
|
+
function g(l) {
|
|
681
|
+
return p() + "#" + (typeof l == "string" ? l : X(l));
|
|
505
682
|
}
|
|
506
|
-
function
|
|
507
|
-
return
|
|
508
|
-
pathname:
|
|
683
|
+
function c(l, w) {
|
|
684
|
+
return w === void 0 && (w = null), le(K({
|
|
685
|
+
pathname: E.pathname,
|
|
509
686
|
hash: "",
|
|
510
687
|
search: ""
|
|
511
|
-
}, typeof l == "string" ?
|
|
512
|
-
state:
|
|
513
|
-
key:
|
|
688
|
+
}, typeof l == "string" ? Re(l) : l, {
|
|
689
|
+
state: w,
|
|
690
|
+
key: Ce()
|
|
514
691
|
}));
|
|
515
692
|
}
|
|
516
|
-
function
|
|
693
|
+
function h(l, w) {
|
|
517
694
|
return [{
|
|
518
695
|
usr: l.state,
|
|
519
696
|
key: l.key,
|
|
520
|
-
idx:
|
|
521
|
-
},
|
|
697
|
+
idx: w
|
|
698
|
+
}, g(l)];
|
|
522
699
|
}
|
|
523
|
-
function
|
|
524
|
-
return !
|
|
700
|
+
function S(l, w, A) {
|
|
701
|
+
return !y.length || (y.call({
|
|
525
702
|
action: l,
|
|
526
|
-
location:
|
|
527
|
-
retry:
|
|
703
|
+
location: w,
|
|
704
|
+
retry: A
|
|
528
705
|
}), !1);
|
|
529
706
|
}
|
|
530
|
-
function
|
|
531
|
-
|
|
532
|
-
var
|
|
533
|
-
|
|
534
|
-
action:
|
|
535
|
-
location:
|
|
707
|
+
function R(l) {
|
|
708
|
+
f = l;
|
|
709
|
+
var w = a();
|
|
710
|
+
m = w[0], E = w[1], L.call({
|
|
711
|
+
action: f,
|
|
712
|
+
location: E
|
|
536
713
|
});
|
|
537
714
|
}
|
|
538
|
-
function
|
|
539
|
-
var
|
|
715
|
+
function v(l, w) {
|
|
716
|
+
var A = j.Push, x = c(l, w);
|
|
540
717
|
function B() {
|
|
541
|
-
|
|
718
|
+
v(l, w);
|
|
542
719
|
}
|
|
543
|
-
if (process.env.NODE_ENV !== "production" && Y(
|
|
544
|
-
var
|
|
720
|
+
if (process.env.NODE_ENV !== "production" && Y(x.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(l) + ")"), S(A, x, B)) {
|
|
721
|
+
var N = h(x, m + 1), $ = N[0], O = N[1];
|
|
545
722
|
try {
|
|
546
|
-
o.pushState(
|
|
723
|
+
o.pushState($, "", O);
|
|
547
724
|
} catch {
|
|
548
|
-
n.location.assign(
|
|
725
|
+
n.location.assign(O);
|
|
549
726
|
}
|
|
550
|
-
|
|
727
|
+
R(A);
|
|
551
728
|
}
|
|
552
729
|
}
|
|
553
|
-
function
|
|
554
|
-
var
|
|
730
|
+
function b(l, w) {
|
|
731
|
+
var A = j.Replace, x = c(l, w);
|
|
555
732
|
function B() {
|
|
556
|
-
|
|
733
|
+
b(l, w);
|
|
557
734
|
}
|
|
558
|
-
if (process.env.NODE_ENV !== "production" && Y(
|
|
559
|
-
var
|
|
560
|
-
o.replaceState(
|
|
735
|
+
if (process.env.NODE_ENV !== "production" && Y(x.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(l) + ")"), S(A, x, B)) {
|
|
736
|
+
var N = h(x, m), $ = N[0], O = N[1];
|
|
737
|
+
o.replaceState($, "", O), R(A);
|
|
561
738
|
}
|
|
562
739
|
}
|
|
563
740
|
function k(l) {
|
|
564
741
|
o.go(l);
|
|
565
742
|
}
|
|
566
|
-
var
|
|
743
|
+
var d = {
|
|
567
744
|
get action() {
|
|
568
|
-
return
|
|
745
|
+
return f;
|
|
569
746
|
},
|
|
570
747
|
get location() {
|
|
571
|
-
return
|
|
748
|
+
return E;
|
|
572
749
|
},
|
|
573
|
-
createHref:
|
|
574
|
-
push:
|
|
575
|
-
replace:
|
|
750
|
+
createHref: g,
|
|
751
|
+
push: v,
|
|
752
|
+
replace: b,
|
|
576
753
|
go: k,
|
|
577
754
|
back: function() {
|
|
578
755
|
k(-1);
|
|
@@ -580,113 +757,113 @@ function Mr(e) {
|
|
|
580
757
|
forward: function() {
|
|
581
758
|
k(1);
|
|
582
759
|
},
|
|
583
|
-
listen: function(
|
|
584
|
-
return
|
|
760
|
+
listen: function(w) {
|
|
761
|
+
return L.push(w);
|
|
585
762
|
},
|
|
586
|
-
block: function(
|
|
587
|
-
var
|
|
588
|
-
return
|
|
589
|
-
|
|
763
|
+
block: function(w) {
|
|
764
|
+
var A = y.push(w);
|
|
765
|
+
return y.length === 1 && n.addEventListener(Ue, Be), function() {
|
|
766
|
+
A(), y.length || n.removeEventListener(Ue, Be);
|
|
590
767
|
};
|
|
591
768
|
}
|
|
592
769
|
};
|
|
593
|
-
return
|
|
770
|
+
return d;
|
|
594
771
|
}
|
|
595
|
-
function
|
|
772
|
+
function dt(e) {
|
|
596
773
|
e === void 0 && (e = {});
|
|
597
|
-
var t = e, r = t.initialEntries, n = r === void 0 ? ["/"] : r, o = t.initialIndex, a = n.map(function(
|
|
598
|
-
var
|
|
774
|
+
var t = e, r = t.initialEntries, n = r === void 0 ? ["/"] : r, o = t.initialIndex, a = n.map(function(R) {
|
|
775
|
+
var v = le(K({
|
|
599
776
|
pathname: "/",
|
|
600
777
|
search: "",
|
|
601
778
|
hash: "",
|
|
602
779
|
state: null,
|
|
603
|
-
key:
|
|
604
|
-
}, typeof
|
|
605
|
-
return process.env.NODE_ENV !== "production" && Y(
|
|
606
|
-
}), s =
|
|
607
|
-
function
|
|
608
|
-
return typeof
|
|
609
|
-
}
|
|
610
|
-
function
|
|
611
|
-
return
|
|
612
|
-
pathname:
|
|
780
|
+
key: Ce()
|
|
781
|
+
}, typeof R == "string" ? Re(R) : R));
|
|
782
|
+
return process.env.NODE_ENV !== "production" && Y(v.pathname.charAt(0) === "/", "Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: " + JSON.stringify(R) + ")"), v;
|
|
783
|
+
}), s = mt(o ?? a.length - 1, 0, a.length - 1), i = j.Pop, f = a[s], u = he(), m = he();
|
|
784
|
+
function E(R) {
|
|
785
|
+
return typeof R == "string" ? R : X(R);
|
|
786
|
+
}
|
|
787
|
+
function L(R, v) {
|
|
788
|
+
return v === void 0 && (v = null), le(K({
|
|
789
|
+
pathname: f.pathname,
|
|
613
790
|
search: "",
|
|
614
791
|
hash: ""
|
|
615
|
-
}, typeof
|
|
616
|
-
state:
|
|
617
|
-
key:
|
|
792
|
+
}, typeof R == "string" ? Re(R) : R, {
|
|
793
|
+
state: v,
|
|
794
|
+
key: Ce()
|
|
618
795
|
}));
|
|
619
796
|
}
|
|
620
|
-
function
|
|
621
|
-
return !
|
|
622
|
-
action:
|
|
623
|
-
location:
|
|
624
|
-
retry:
|
|
797
|
+
function y(R, v, b) {
|
|
798
|
+
return !m.length || (m.call({
|
|
799
|
+
action: R,
|
|
800
|
+
location: v,
|
|
801
|
+
retry: b
|
|
625
802
|
}), !1);
|
|
626
803
|
}
|
|
627
|
-
function R
|
|
628
|
-
|
|
629
|
-
action:
|
|
630
|
-
location:
|
|
804
|
+
function p(R, v) {
|
|
805
|
+
i = R, f = v, u.call({
|
|
806
|
+
action: i,
|
|
807
|
+
location: f
|
|
631
808
|
});
|
|
632
809
|
}
|
|
633
|
-
function
|
|
634
|
-
var
|
|
635
|
-
function
|
|
636
|
-
|
|
810
|
+
function g(R, v) {
|
|
811
|
+
var b = j.Push, k = L(R, v);
|
|
812
|
+
function d() {
|
|
813
|
+
g(R, v);
|
|
637
814
|
}
|
|
638
|
-
process.env.NODE_ENV !== "production" && Y(
|
|
815
|
+
process.env.NODE_ENV !== "production" && Y(f.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.push(" + JSON.stringify(R) + ")"), y(b, k, d) && (s += 1, a.splice(s, a.length, k), p(b, k));
|
|
639
816
|
}
|
|
640
|
-
function
|
|
641
|
-
var
|
|
642
|
-
function
|
|
643
|
-
|
|
817
|
+
function c(R, v) {
|
|
818
|
+
var b = j.Replace, k = L(R, v);
|
|
819
|
+
function d() {
|
|
820
|
+
c(R, v);
|
|
644
821
|
}
|
|
645
|
-
process.env.NODE_ENV !== "production" && Y(
|
|
822
|
+
process.env.NODE_ENV !== "production" && Y(f.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.replace(" + JSON.stringify(R) + ")"), y(b, k, d) && (a[s] = k, p(b, k));
|
|
646
823
|
}
|
|
647
|
-
function
|
|
648
|
-
var
|
|
649
|
-
function
|
|
650
|
-
|
|
824
|
+
function h(R) {
|
|
825
|
+
var v = mt(s + R, 0, a.length - 1), b = j.Pop, k = a[v];
|
|
826
|
+
function d() {
|
|
827
|
+
h(R);
|
|
651
828
|
}
|
|
652
|
-
|
|
829
|
+
y(b, k, d) && (s = v, p(b, k));
|
|
653
830
|
}
|
|
654
|
-
var
|
|
831
|
+
var S = {
|
|
655
832
|
get index() {
|
|
656
833
|
return s;
|
|
657
834
|
},
|
|
658
835
|
get action() {
|
|
659
|
-
return
|
|
836
|
+
return i;
|
|
660
837
|
},
|
|
661
838
|
get location() {
|
|
662
|
-
return
|
|
839
|
+
return f;
|
|
663
840
|
},
|
|
664
|
-
createHref:
|
|
665
|
-
push:
|
|
666
|
-
replace:
|
|
667
|
-
go:
|
|
841
|
+
createHref: E,
|
|
842
|
+
push: g,
|
|
843
|
+
replace: c,
|
|
844
|
+
go: h,
|
|
668
845
|
back: function() {
|
|
669
|
-
|
|
846
|
+
h(-1);
|
|
670
847
|
},
|
|
671
848
|
forward: function() {
|
|
672
|
-
|
|
849
|
+
h(1);
|
|
673
850
|
},
|
|
674
|
-
listen: function(
|
|
675
|
-
return
|
|
851
|
+
listen: function(v) {
|
|
852
|
+
return u.push(v);
|
|
676
853
|
},
|
|
677
|
-
block: function(
|
|
678
|
-
return
|
|
854
|
+
block: function(v) {
|
|
855
|
+
return m.push(v);
|
|
679
856
|
}
|
|
680
857
|
};
|
|
681
|
-
return
|
|
858
|
+
return S;
|
|
682
859
|
}
|
|
683
|
-
function
|
|
860
|
+
function mt(e, t, r) {
|
|
684
861
|
return Math.min(Math.max(e, t), r);
|
|
685
862
|
}
|
|
686
|
-
function
|
|
863
|
+
function Be(e) {
|
|
687
864
|
e.preventDefault(), e.returnValue = "";
|
|
688
865
|
}
|
|
689
|
-
function
|
|
866
|
+
function he() {
|
|
690
867
|
var e = [];
|
|
691
868
|
return {
|
|
692
869
|
get length() {
|
|
@@ -706,14 +883,14 @@ function ae() {
|
|
|
706
883
|
}
|
|
707
884
|
};
|
|
708
885
|
}
|
|
709
|
-
function
|
|
886
|
+
function Ce() {
|
|
710
887
|
return Math.random().toString(36).substr(2, 8);
|
|
711
888
|
}
|
|
712
889
|
function X(e) {
|
|
713
890
|
var t = e.pathname, r = t === void 0 ? "/" : t, n = e.search, o = n === void 0 ? "" : n, a = e.hash, s = a === void 0 ? "" : a;
|
|
714
891
|
return o && o !== "?" && (r += o.charAt(0) === "?" ? o : "?" + o), s && s !== "#" && (r += s.charAt(0) === "#" ? s : "#" + s), r;
|
|
715
892
|
}
|
|
716
|
-
function
|
|
893
|
+
function Re(e) {
|
|
717
894
|
var t = {};
|
|
718
895
|
if (e) {
|
|
719
896
|
var r = e.indexOf("#");
|
|
@@ -723,57 +900,57 @@ function me(e) {
|
|
|
723
900
|
}
|
|
724
901
|
return t;
|
|
725
902
|
}
|
|
726
|
-
const
|
|
727
|
-
function
|
|
728
|
-
const e =
|
|
903
|
+
const cr = Symbol();
|
|
904
|
+
function kn() {
|
|
905
|
+
const e = oe(cr);
|
|
729
906
|
if (!e)
|
|
730
|
-
throw new
|
|
907
|
+
throw new me();
|
|
731
908
|
return e;
|
|
732
909
|
}
|
|
733
|
-
const
|
|
734
|
-
function
|
|
735
|
-
return typeof e == "object" && e !== null &&
|
|
910
|
+
const ur = Symbol("isRouterRouteSymbol");
|
|
911
|
+
function xn(e) {
|
|
912
|
+
return typeof e == "object" && e !== null && ur in e;
|
|
736
913
|
}
|
|
737
|
-
function
|
|
738
|
-
function r(
|
|
739
|
-
if (typeof
|
|
740
|
-
const
|
|
914
|
+
function Ln(e, t) {
|
|
915
|
+
function r(c, h, S) {
|
|
916
|
+
if (typeof c == "object") {
|
|
917
|
+
const v = {
|
|
741
918
|
...e.params,
|
|
742
|
-
...
|
|
919
|
+
...c
|
|
743
920
|
};
|
|
744
|
-
return t(e.name,
|
|
921
|
+
return t(e.name, v, h);
|
|
745
922
|
}
|
|
746
|
-
const
|
|
923
|
+
const R = {
|
|
747
924
|
...e.params,
|
|
748
|
-
[
|
|
925
|
+
[c]: h
|
|
749
926
|
};
|
|
750
|
-
return t(e.name,
|
|
751
|
-
}
|
|
752
|
-
const n = (...
|
|
753
|
-
const
|
|
754
|
-
|
|
755
|
-
}, o = (...
|
|
756
|
-
const
|
|
757
|
-
|
|
758
|
-
}, a = (...
|
|
759
|
-
const
|
|
760
|
-
|
|
761
|
-
}, { id: s, matched:
|
|
927
|
+
return t(e.name, R, S);
|
|
928
|
+
}
|
|
929
|
+
const n = (...c) => {
|
|
930
|
+
const h = new URLSearchParams(e.query);
|
|
931
|
+
h.set(...c), r({}, { query: h });
|
|
932
|
+
}, o = (...c) => {
|
|
933
|
+
const h = new URLSearchParams(e.query);
|
|
934
|
+
h.append(...c), r({}, { query: h });
|
|
935
|
+
}, a = (...c) => {
|
|
936
|
+
const h = new URLSearchParams(e.query);
|
|
937
|
+
h.delete(...c), r({}, { query: h });
|
|
938
|
+
}, { id: s, matched: i, matches: f, name: u, hash: m, href: E } = Jr(e), L = V({
|
|
762
939
|
get() {
|
|
763
940
|
return new Proxy(e.params, {
|
|
764
|
-
set(
|
|
765
|
-
return r(
|
|
941
|
+
set(c, h, S) {
|
|
942
|
+
return r(h, S), !0;
|
|
766
943
|
}
|
|
767
944
|
});
|
|
768
945
|
},
|
|
769
|
-
set(
|
|
770
|
-
r(
|
|
946
|
+
set(c) {
|
|
947
|
+
r(c);
|
|
771
948
|
}
|
|
772
|
-
}),
|
|
949
|
+
}), y = V({
|
|
773
950
|
get() {
|
|
774
951
|
return new Proxy(e.query, {
|
|
775
|
-
get(
|
|
776
|
-
switch (
|
|
952
|
+
get(c, h, S) {
|
|
953
|
+
switch (h) {
|
|
777
954
|
case "append":
|
|
778
955
|
return o;
|
|
779
956
|
case "set":
|
|
@@ -781,48 +958,48 @@ function Gr(e, t) {
|
|
|
781
958
|
case "delete":
|
|
782
959
|
return a;
|
|
783
960
|
default:
|
|
784
|
-
return Reflect.get(
|
|
961
|
+
return Reflect.get(c, h, S);
|
|
785
962
|
}
|
|
786
963
|
}
|
|
787
964
|
});
|
|
788
965
|
},
|
|
789
|
-
set(
|
|
790
|
-
r({}, { query:
|
|
966
|
+
set(c) {
|
|
967
|
+
r({}, { query: c });
|
|
791
968
|
}
|
|
792
|
-
}),
|
|
969
|
+
}), p = V({
|
|
793
970
|
get() {
|
|
794
971
|
return new Proxy(e.state, {
|
|
795
|
-
set(
|
|
796
|
-
return r({}, { state: { ...e.state, [
|
|
972
|
+
set(c, h, S) {
|
|
973
|
+
return r({}, { state: { ...e.state, [h]: S } }), !0;
|
|
797
974
|
}
|
|
798
975
|
});
|
|
799
976
|
},
|
|
800
|
-
set(
|
|
801
|
-
r({}, { state:
|
|
977
|
+
set(c) {
|
|
978
|
+
r({}, { state: c });
|
|
802
979
|
}
|
|
803
980
|
});
|
|
804
|
-
return
|
|
981
|
+
return He({
|
|
805
982
|
id: s,
|
|
806
|
-
matched:
|
|
807
|
-
matches:
|
|
808
|
-
state:
|
|
809
|
-
query:
|
|
810
|
-
hash:
|
|
811
|
-
params:
|
|
812
|
-
name:
|
|
813
|
-
href:
|
|
983
|
+
matched: i,
|
|
984
|
+
matches: f,
|
|
985
|
+
state: p,
|
|
986
|
+
query: y,
|
|
987
|
+
hash: m,
|
|
988
|
+
params: L,
|
|
989
|
+
name: u,
|
|
990
|
+
href: E,
|
|
814
991
|
update: r,
|
|
815
|
-
[
|
|
992
|
+
[ur]: !0
|
|
816
993
|
});
|
|
817
994
|
}
|
|
818
|
-
const
|
|
819
|
-
function
|
|
820
|
-
const r =
|
|
995
|
+
const ir = Symbol();
|
|
996
|
+
function Un(e, t) {
|
|
997
|
+
const r = He({ ...e }), n = (s) => {
|
|
821
998
|
Object.assign(r, {
|
|
822
|
-
[
|
|
999
|
+
[ir]: !1,
|
|
823
1000
|
...s
|
|
824
1001
|
});
|
|
825
|
-
}, o = r, a =
|
|
1002
|
+
}, o = r, a = Ln(o, t);
|
|
826
1003
|
return {
|
|
827
1004
|
currentRoute: o,
|
|
828
1005
|
routerRoute: a,
|
|
@@ -830,9 +1007,9 @@ function Qr(e, t) {
|
|
|
830
1007
|
};
|
|
831
1008
|
}
|
|
832
1009
|
function q(e) {
|
|
833
|
-
return !e.startsWith("http") ?
|
|
1010
|
+
return !e.startsWith("http") ? Cn(e) : Bn(e);
|
|
834
1011
|
}
|
|
835
|
-
function
|
|
1012
|
+
function Bn(e) {
|
|
836
1013
|
const { protocol: t, host: r, pathname: n, search: o, searchParams: a, hash: s } = new URL(e, e);
|
|
837
1014
|
return {
|
|
838
1015
|
protocol: t,
|
|
@@ -843,7 +1020,7 @@ function zr(e) {
|
|
|
843
1020
|
hash: s
|
|
844
1021
|
};
|
|
845
1022
|
}
|
|
846
|
-
function
|
|
1023
|
+
function Cn(e) {
|
|
847
1024
|
const { pathname: t, search: r, searchParams: n, hash: o } = new URL(e, "https://localhost");
|
|
848
1025
|
return {
|
|
849
1026
|
pathname: t,
|
|
@@ -852,22 +1029,22 @@ function Kr(e) {
|
|
|
852
1029
|
hash: o
|
|
853
1030
|
};
|
|
854
1031
|
}
|
|
855
|
-
function
|
|
1032
|
+
function Nn(e) {
|
|
856
1033
|
return (t) => {
|
|
857
1034
|
const { host: r } = q(t);
|
|
858
1035
|
return !(r === void 0 || r === e);
|
|
859
1036
|
};
|
|
860
1037
|
}
|
|
861
|
-
function
|
|
862
|
-
const r =
|
|
863
|
-
if (
|
|
864
|
-
r.replace(
|
|
1038
|
+
function Vn({ mode: e, listener: t }) {
|
|
1039
|
+
const r = jn(e), n = (f, u) => {
|
|
1040
|
+
if (u != null && u.replace) {
|
|
1041
|
+
r.replace(f, u.state);
|
|
865
1042
|
return;
|
|
866
1043
|
}
|
|
867
|
-
r.push(
|
|
1044
|
+
r.push(f, u == null ? void 0 : u.state);
|
|
868
1045
|
}, o = () => {
|
|
869
|
-
const
|
|
870
|
-
r.replace(
|
|
1046
|
+
const f = X(r.location);
|
|
1047
|
+
r.replace(f);
|
|
871
1048
|
};
|
|
872
1049
|
let a;
|
|
873
1050
|
return {
|
|
@@ -882,226 +1059,226 @@ function Xr({ mode: e, listener: t }) {
|
|
|
882
1059
|
}
|
|
883
1060
|
};
|
|
884
1061
|
}
|
|
885
|
-
function
|
|
1062
|
+
function jn(e = "auto") {
|
|
886
1063
|
switch (e) {
|
|
887
1064
|
case "auto":
|
|
888
|
-
return
|
|
1065
|
+
return Qe() ? pt() : dt();
|
|
889
1066
|
case "browser":
|
|
890
|
-
return
|
|
1067
|
+
return pt();
|
|
891
1068
|
case "memory":
|
|
892
|
-
return
|
|
1069
|
+
return dt();
|
|
893
1070
|
case "hash":
|
|
894
|
-
return
|
|
1071
|
+
return An();
|
|
895
1072
|
default:
|
|
896
1073
|
const t = e;
|
|
897
1074
|
throw new Error(`Switch is not exhaustive for mode: ${t}`);
|
|
898
1075
|
}
|
|
899
1076
|
}
|
|
900
|
-
class
|
|
1077
|
+
class fr extends Error {
|
|
901
1078
|
constructor() {
|
|
902
1079
|
super("Uncaught CallbackContextAbortError");
|
|
903
|
-
|
|
1080
|
+
M(this, "response");
|
|
904
1081
|
this.response = { status: "ABORT" };
|
|
905
1082
|
}
|
|
906
1083
|
}
|
|
907
|
-
class
|
|
1084
|
+
class fe extends Error {
|
|
908
1085
|
constructor(r) {
|
|
909
1086
|
super("Uncaught CallbackContextPushError");
|
|
910
|
-
|
|
1087
|
+
M(this, "response");
|
|
911
1088
|
this.response = { status: "PUSH", to: r };
|
|
912
1089
|
}
|
|
913
1090
|
}
|
|
914
|
-
class
|
|
1091
|
+
class Ne extends Error {
|
|
915
1092
|
constructor(r) {
|
|
916
1093
|
super("Uncaught CallbackContextRejectionError");
|
|
917
|
-
|
|
1094
|
+
M(this, "response");
|
|
918
1095
|
this.response = { status: "REJECT", type: r };
|
|
919
1096
|
}
|
|
920
1097
|
}
|
|
921
|
-
function
|
|
1098
|
+
function lr() {
|
|
922
1099
|
return { reject: (o) => {
|
|
923
|
-
throw new
|
|
1100
|
+
throw new Ne(o);
|
|
924
1101
|
}, push: (...o) => {
|
|
925
|
-
throw new
|
|
1102
|
+
throw new fe(o);
|
|
926
1103
|
}, replace: (o, a, s) => {
|
|
927
|
-
if (
|
|
928
|
-
const
|
|
929
|
-
throw new
|
|
1104
|
+
if (T(o)) {
|
|
1105
|
+
const u = a ?? {};
|
|
1106
|
+
throw new fe([o, { ...u, replace: !0 }]);
|
|
930
1107
|
}
|
|
931
|
-
const
|
|
932
|
-
throw new
|
|
1108
|
+
const i = a, f = s ?? {};
|
|
1109
|
+
throw new fe([o, i, { ...f, replace: !0 }]);
|
|
933
1110
|
}, abort: () => {
|
|
934
|
-
throw new
|
|
1111
|
+
throw new fr();
|
|
935
1112
|
} };
|
|
936
1113
|
}
|
|
937
|
-
class
|
|
1114
|
+
class ne {
|
|
938
1115
|
constructor() {
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
1116
|
+
M(this, "onBeforeRouteEnter", /* @__PURE__ */ new Set());
|
|
1117
|
+
M(this, "onBeforeRouteUpdate", /* @__PURE__ */ new Set());
|
|
1118
|
+
M(this, "onBeforeRouteLeave", /* @__PURE__ */ new Set());
|
|
1119
|
+
M(this, "onAfterRouteEnter", /* @__PURE__ */ new Set());
|
|
1120
|
+
M(this, "onAfterRouteUpdate", /* @__PURE__ */ new Set());
|
|
1121
|
+
M(this, "onAfterRouteLeave", /* @__PURE__ */ new Set());
|
|
945
1122
|
}
|
|
946
1123
|
}
|
|
947
|
-
const
|
|
1124
|
+
const we = (e, t, r) => {
|
|
948
1125
|
var a, s;
|
|
949
1126
|
const n = e.matches, o = (t == null ? void 0 : t.matches) ?? [];
|
|
950
1127
|
return ((a = n.at(r)) == null ? void 0 : a.id) !== ((s = o.at(r)) == null ? void 0 : s.id);
|
|
951
|
-
},
|
|
1128
|
+
}, Ee = (e, t, r) => {
|
|
952
1129
|
var a, s;
|
|
953
1130
|
const n = e.matches, o = (t == null ? void 0 : t.matches) ?? [];
|
|
954
1131
|
return ((a = n.at(r)) == null ? void 0 : a.id) !== ((s = o.at(r)) == null ? void 0 : s.id);
|
|
955
|
-
},
|
|
1132
|
+
}, Pe = (e, t, r) => {
|
|
956
1133
|
var n, o;
|
|
957
1134
|
return ((n = e.matches.at(r)) == null ? void 0 : n.id) === ((o = t == null ? void 0 : t.matches.at(r)) == null ? void 0 : o.id);
|
|
958
1135
|
};
|
|
959
|
-
function
|
|
1136
|
+
function yt(e) {
|
|
960
1137
|
switch (e) {
|
|
961
1138
|
case "onBeforeRouteEnter":
|
|
962
1139
|
case "onAfterRouteEnter":
|
|
963
|
-
return
|
|
1140
|
+
return we;
|
|
964
1141
|
case "onBeforeRouteUpdate":
|
|
965
1142
|
case "onAfterRouteUpdate":
|
|
966
|
-
return
|
|
1143
|
+
return Pe;
|
|
967
1144
|
case "onBeforeRouteLeave":
|
|
968
1145
|
case "onAfterRouteLeave":
|
|
969
|
-
return
|
|
1146
|
+
return Ee;
|
|
970
1147
|
default:
|
|
971
1148
|
throw new Error(`Switch is not exhaustive for lifecycle: ${e}`);
|
|
972
1149
|
}
|
|
973
1150
|
}
|
|
974
|
-
function
|
|
975
|
-
const r = new
|
|
1151
|
+
function $n(e, t) {
|
|
1152
|
+
const r = new ne();
|
|
976
1153
|
return e.matches.forEach((n, o) => {
|
|
977
|
-
n.onBeforeRouteEnter &&
|
|
1154
|
+
n.onBeforeRouteEnter && we(e, t, o) && ie(n.onBeforeRouteEnter).forEach((a) => r.onBeforeRouteEnter.add(a)), n.onBeforeRouteUpdate && Pe(e, t, o) && ie(n.onBeforeRouteUpdate).forEach((a) => r.onBeforeRouteUpdate.add(a));
|
|
978
1155
|
}), t == null || t.matches.forEach((n, o) => {
|
|
979
|
-
n.onBeforeRouteLeave &&
|
|
1156
|
+
n.onBeforeRouteLeave && Ee(e, t, o) && ie(n.onBeforeRouteLeave).forEach((a) => r.onBeforeRouteLeave.add(a));
|
|
980
1157
|
}), r;
|
|
981
1158
|
}
|
|
982
|
-
function
|
|
983
|
-
const r = new
|
|
1159
|
+
function Hn(e, t) {
|
|
1160
|
+
const r = new ne();
|
|
984
1161
|
return e.matches.forEach((n, o) => {
|
|
985
|
-
n.onAfterRouteEnter &&
|
|
1162
|
+
n.onAfterRouteEnter && we(e, t, o) && ie(n.onAfterRouteEnter).forEach((a) => r.onAfterRouteEnter.add(a)), n.onAfterRouteUpdate && Pe(e, t, o) && ie(n.onAfterRouteUpdate).forEach((a) => r.onAfterRouteUpdate.add(a));
|
|
986
1163
|
}), t == null || t.matches.forEach((n, o) => {
|
|
987
|
-
n.onAfterRouteLeave &&
|
|
1164
|
+
n.onAfterRouteLeave && Ee(e, t, o) && ie(n.onAfterRouteLeave).forEach((a) => r.onAfterRouteLeave.add(a));
|
|
988
1165
|
}), r;
|
|
989
1166
|
}
|
|
990
|
-
function
|
|
991
|
-
const n = new
|
|
1167
|
+
function _n(e, t, r) {
|
|
1168
|
+
const n = new ne();
|
|
992
1169
|
return e.matches.forEach((o, a) => {
|
|
993
|
-
|
|
1170
|
+
we(e, t, a) && r.onBeforeRouteEnter.forEach((s) => n.onBeforeRouteEnter.add(s)), Pe(e, t, a) && r.onBeforeRouteUpdate.forEach((s) => n.onBeforeRouteUpdate.add(s));
|
|
994
1171
|
}), t == null || t.matches.forEach((o, a) => {
|
|
995
|
-
|
|
1172
|
+
Ee(e, t, a) && r.onBeforeRouteLeave.forEach((s) => n.onBeforeRouteLeave.add(s));
|
|
996
1173
|
}), n;
|
|
997
1174
|
}
|
|
998
|
-
function
|
|
999
|
-
const n = new
|
|
1175
|
+
function qn(e, t, r) {
|
|
1176
|
+
const n = new ne();
|
|
1000
1177
|
return e.matches.forEach((o, a) => {
|
|
1001
|
-
|
|
1178
|
+
we(e, t, a) && r.onAfterRouteEnter.forEach((s) => n.onAfterRouteEnter.add(s)), Pe(e, t, a) && r.onAfterRouteUpdate.forEach((s) => n.onAfterRouteUpdate.add(s));
|
|
1002
1179
|
}), t == null || t.matches.forEach((o, a) => {
|
|
1003
|
-
|
|
1180
|
+
Ee(e, t, a) && r.onAfterRouteLeave.forEach((s) => n.onAfterRouteLeave.add(s));
|
|
1004
1181
|
}), n;
|
|
1005
1182
|
}
|
|
1006
|
-
const
|
|
1007
|
-
function
|
|
1183
|
+
const hr = Symbol();
|
|
1184
|
+
function On() {
|
|
1008
1185
|
const e = {
|
|
1009
|
-
global: new
|
|
1010
|
-
component: new
|
|
1011
|
-
}, { reject: t, push: r, replace: n, abort: o } =
|
|
1012
|
-
async function
|
|
1013
|
-
const { global:
|
|
1014
|
-
...
|
|
1015
|
-
...
|
|
1016
|
-
...
|
|
1017
|
-
...w.onBeforeRouteUpdate,
|
|
1186
|
+
global: new ne(),
|
|
1187
|
+
component: new ne()
|
|
1188
|
+
}, { reject: t, push: r, replace: n, abort: o } = lr(), a = (c) => (e.global.onBeforeRouteEnter.add(c), () => e.global.onBeforeRouteEnter.delete(c)), s = (c) => (e.global.onBeforeRouteUpdate.add(c), () => e.global.onBeforeRouteUpdate.delete(c)), i = (c) => (e.global.onBeforeRouteLeave.add(c), () => e.global.onBeforeRouteLeave.delete(c)), f = (c) => (e.global.onAfterRouteEnter.add(c), () => e.global.onAfterRouteEnter.delete(c)), u = (c) => (e.global.onAfterRouteUpdate.add(c), () => e.global.onAfterRouteUpdate.delete(c)), m = (c) => (e.global.onAfterRouteLeave.add(c), () => e.global.onAfterRouteLeave.delete(c));
|
|
1189
|
+
async function E({ to: c, from: h }) {
|
|
1190
|
+
const { global: S, component: R } = e, v = $n(c, h), b = _n(c, h, S), k = [
|
|
1191
|
+
...b.onBeforeRouteEnter,
|
|
1192
|
+
...v.onBeforeRouteEnter,
|
|
1193
|
+
...b.onBeforeRouteUpdate,
|
|
1018
1194
|
...v.onBeforeRouteUpdate,
|
|
1019
|
-
...
|
|
1020
|
-
...
|
|
1021
|
-
...v.onBeforeRouteLeave
|
|
1195
|
+
...R.onBeforeRouteUpdate,
|
|
1196
|
+
...b.onBeforeRouteLeave,
|
|
1197
|
+
...v.onBeforeRouteLeave,
|
|
1198
|
+
...R.onBeforeRouteLeave
|
|
1022
1199
|
];
|
|
1023
1200
|
try {
|
|
1024
|
-
const
|
|
1025
|
-
from:
|
|
1201
|
+
const d = k.map((l) => l(c, {
|
|
1202
|
+
from: h,
|
|
1026
1203
|
reject: t,
|
|
1027
1204
|
push: r,
|
|
1028
1205
|
replace: n,
|
|
1029
1206
|
abort: o
|
|
1030
1207
|
}));
|
|
1031
|
-
await Promise.all(
|
|
1032
|
-
} catch (
|
|
1033
|
-
if (
|
|
1034
|
-
return
|
|
1035
|
-
throw
|
|
1208
|
+
await Promise.all(d);
|
|
1209
|
+
} catch (d) {
|
|
1210
|
+
if (d instanceof fe || d instanceof Ne || d instanceof fr)
|
|
1211
|
+
return d.response;
|
|
1212
|
+
throw d;
|
|
1036
1213
|
}
|
|
1037
1214
|
return {
|
|
1038
1215
|
status: "SUCCESS"
|
|
1039
1216
|
};
|
|
1040
1217
|
}
|
|
1041
|
-
async function
|
|
1042
|
-
const { global:
|
|
1218
|
+
async function L({ to: c, from: h }) {
|
|
1219
|
+
const { global: S, component: R } = e, v = Hn(c, h), b = qn(c, h, S), k = [
|
|
1220
|
+
...R.onAfterRouteLeave,
|
|
1043
1221
|
...v.onAfterRouteLeave,
|
|
1044
|
-
...
|
|
1045
|
-
...
|
|
1222
|
+
...b.onAfterRouteLeave,
|
|
1223
|
+
...R.onAfterRouteUpdate,
|
|
1046
1224
|
...v.onAfterRouteUpdate,
|
|
1047
|
-
...
|
|
1048
|
-
...
|
|
1225
|
+
...b.onAfterRouteUpdate,
|
|
1226
|
+
...R.onAfterRouteEnter,
|
|
1049
1227
|
...v.onAfterRouteEnter,
|
|
1050
|
-
...
|
|
1051
|
-
...S.onAfterRouteEnter
|
|
1228
|
+
...b.onAfterRouteEnter
|
|
1052
1229
|
];
|
|
1053
1230
|
try {
|
|
1054
|
-
const
|
|
1055
|
-
from:
|
|
1231
|
+
const d = k.map((l) => l(c, {
|
|
1232
|
+
from: h,
|
|
1056
1233
|
reject: t,
|
|
1057
1234
|
push: r,
|
|
1058
1235
|
replace: n
|
|
1059
1236
|
}));
|
|
1060
|
-
await Promise.all(
|
|
1061
|
-
} catch (
|
|
1062
|
-
if (
|
|
1063
|
-
return
|
|
1064
|
-
throw
|
|
1237
|
+
await Promise.all(d);
|
|
1238
|
+
} catch (d) {
|
|
1239
|
+
if (d instanceof fe || d instanceof Ne)
|
|
1240
|
+
return d.response;
|
|
1241
|
+
throw d;
|
|
1065
1242
|
}
|
|
1066
1243
|
return {
|
|
1067
1244
|
status: "SUCCESS"
|
|
1068
1245
|
};
|
|
1069
1246
|
}
|
|
1070
1247
|
return {
|
|
1071
|
-
runBeforeRouteHooks:
|
|
1072
|
-
runAfterRouteHooks:
|
|
1073
|
-
addComponentBeforeRouteHook: ({ lifecycle:
|
|
1074
|
-
const
|
|
1075
|
-
if (
|
|
1076
|
-
return
|
|
1248
|
+
runBeforeRouteHooks: E,
|
|
1249
|
+
runAfterRouteHooks: L,
|
|
1250
|
+
addComponentBeforeRouteHook: ({ lifecycle: c, depth: h, hook: S }) => {
|
|
1251
|
+
const R = yt(c), v = e.component[c], b = (k, d) => {
|
|
1252
|
+
if (R(k, d.from, h))
|
|
1253
|
+
return S(k, d);
|
|
1077
1254
|
};
|
|
1078
|
-
return
|
|
1255
|
+
return v.add(b), () => v.delete(b);
|
|
1079
1256
|
},
|
|
1080
|
-
addComponentAfterRouteHook: ({ lifecycle:
|
|
1081
|
-
const
|
|
1082
|
-
if (
|
|
1083
|
-
return
|
|
1257
|
+
addComponentAfterRouteHook: ({ lifecycle: c, depth: h, hook: S }) => {
|
|
1258
|
+
const R = yt(c), v = e.component[c], b = (k, d) => {
|
|
1259
|
+
if (R(k, d.from, h))
|
|
1260
|
+
return S(k, d);
|
|
1084
1261
|
};
|
|
1085
|
-
return
|
|
1262
|
+
return v.add(b), () => v.delete(b);
|
|
1086
1263
|
},
|
|
1087
|
-
addGlobalRouteHooks: (
|
|
1088
|
-
|
|
1264
|
+
addGlobalRouteHooks: (c) => {
|
|
1265
|
+
c.onBeforeRouteEnter.forEach((h) => a(h)), c.onBeforeRouteUpdate.forEach((h) => s(h)), c.onBeforeRouteLeave.forEach((h) => i(h)), c.onAfterRouteEnter.forEach((h) => f(h)), c.onAfterRouteUpdate.forEach((h) => u(h)), c.onAfterRouteLeave.forEach((h) => m(h));
|
|
1089
1266
|
},
|
|
1090
1267
|
onBeforeRouteEnter: a,
|
|
1091
1268
|
onBeforeRouteUpdate: s,
|
|
1092
|
-
onBeforeRouteLeave:
|
|
1093
|
-
onAfterRouteEnter:
|
|
1094
|
-
onAfterRouteUpdate:
|
|
1095
|
-
onAfterRouteLeave:
|
|
1269
|
+
onBeforeRouteLeave: i,
|
|
1270
|
+
onAfterRouteEnter: f,
|
|
1271
|
+
onAfterRouteUpdate: u,
|
|
1272
|
+
onAfterRouteLeave: m
|
|
1096
1273
|
};
|
|
1097
1274
|
}
|
|
1098
|
-
function
|
|
1099
|
-
return
|
|
1275
|
+
function In(e) {
|
|
1276
|
+
return de(() => () => ue("h1", e), {
|
|
1100
1277
|
name: e,
|
|
1101
1278
|
props: []
|
|
1102
1279
|
});
|
|
1103
1280
|
}
|
|
1104
|
-
function
|
|
1281
|
+
function Ye(e) {
|
|
1105
1282
|
const t = new URLSearchParams(e);
|
|
1106
1283
|
return {
|
|
1107
1284
|
get: (...r) => t.get(...r),
|
|
@@ -1130,34 +1307,34 @@ function Me(e) {
|
|
|
1130
1307
|
[Symbol.iterator]: () => t[Symbol.iterator]()
|
|
1131
1308
|
};
|
|
1132
1309
|
}
|
|
1133
|
-
function
|
|
1310
|
+
function Xe() {
|
|
1134
1311
|
let e = 0;
|
|
1135
1312
|
return () => (++e).toString();
|
|
1136
1313
|
}
|
|
1137
|
-
const
|
|
1138
|
-
function
|
|
1139
|
-
return e ===
|
|
1314
|
+
const Dn = Xe()();
|
|
1315
|
+
function Fn(e) {
|
|
1316
|
+
return e === Dn;
|
|
1140
1317
|
}
|
|
1141
|
-
const
|
|
1142
|
-
function
|
|
1143
|
-
const t = (a) =>
|
|
1144
|
-
const s =
|
|
1145
|
-
id:
|
|
1318
|
+
const et = Xe();
|
|
1319
|
+
function Mn(e) {
|
|
1320
|
+
const t = (a) => Ae(e[a] ?? In(a)), r = (a) => {
|
|
1321
|
+
const s = Ae(t(a)), i = {
|
|
1322
|
+
id: et(),
|
|
1146
1323
|
component: s,
|
|
1147
1324
|
meta: {},
|
|
1148
1325
|
state: {}
|
|
1149
1326
|
};
|
|
1150
1327
|
return {
|
|
1151
|
-
id:
|
|
1152
|
-
matched:
|
|
1153
|
-
matches: [
|
|
1328
|
+
id: i.id,
|
|
1329
|
+
matched: i,
|
|
1330
|
+
matches: [i],
|
|
1154
1331
|
name: a,
|
|
1155
|
-
query:
|
|
1332
|
+
query: Ye(""),
|
|
1156
1333
|
params: {},
|
|
1157
1334
|
state: {},
|
|
1158
1335
|
href: "/",
|
|
1159
1336
|
hash: "",
|
|
1160
|
-
[
|
|
1337
|
+
[ir]: !0
|
|
1161
1338
|
};
|
|
1162
1339
|
}, n = (a) => {
|
|
1163
1340
|
if (!a) {
|
|
@@ -1166,71 +1343,71 @@ function un(e) {
|
|
|
1166
1343
|
}
|
|
1167
1344
|
const s = t(a);
|
|
1168
1345
|
o.value = { type: a, component: s };
|
|
1169
|
-
}, o =
|
|
1346
|
+
}, o = _e(null);
|
|
1170
1347
|
return {
|
|
1171
1348
|
setRejection: n,
|
|
1172
1349
|
rejection: o,
|
|
1173
1350
|
getRejectionRoute: r
|
|
1174
1351
|
};
|
|
1175
1352
|
}
|
|
1176
|
-
class
|
|
1353
|
+
class Tn extends Error {
|
|
1177
1354
|
constructor() {
|
|
1178
1355
|
super("initialUrl must be set if window.location is unavailable");
|
|
1179
1356
|
}
|
|
1180
1357
|
}
|
|
1181
|
-
function
|
|
1358
|
+
function Jn(e) {
|
|
1182
1359
|
if (e)
|
|
1183
1360
|
return e;
|
|
1184
|
-
if (
|
|
1361
|
+
if (Qe())
|
|
1185
1362
|
return window.location.toString();
|
|
1186
|
-
throw new
|
|
1363
|
+
throw new Tn();
|
|
1187
1364
|
}
|
|
1188
|
-
function
|
|
1365
|
+
function pr(e) {
|
|
1189
1366
|
return !!e && typeof e == "object";
|
|
1190
1367
|
}
|
|
1191
|
-
const
|
|
1192
|
-
function
|
|
1193
|
-
if (
|
|
1368
|
+
const Ve = !0;
|
|
1369
|
+
function Wn(e, t, r) {
|
|
1370
|
+
if (pr(e) && t in e) {
|
|
1194
1371
|
const n = e[t];
|
|
1195
|
-
return typeof n == "string" ?
|
|
1372
|
+
return typeof n == "string" ? te(n, r, Ve) : n;
|
|
1196
1373
|
}
|
|
1197
|
-
return
|
|
1374
|
+
return te(void 0, r, Ve);
|
|
1198
1375
|
}
|
|
1199
|
-
function
|
|
1376
|
+
function dr(e, t) {
|
|
1200
1377
|
const r = {};
|
|
1201
1378
|
for (const [n, o] of Object.entries(e)) {
|
|
1202
|
-
const a =
|
|
1379
|
+
const a = Wn(t, n, o);
|
|
1203
1380
|
r[n] = a;
|
|
1204
1381
|
}
|
|
1205
1382
|
return r;
|
|
1206
1383
|
}
|
|
1207
|
-
function
|
|
1208
|
-
if (
|
|
1384
|
+
function Zn(e, t, r) {
|
|
1385
|
+
if (pr(e) && t in e) {
|
|
1209
1386
|
const n = e[t];
|
|
1210
|
-
return
|
|
1387
|
+
return re(n, r, Ve);
|
|
1211
1388
|
}
|
|
1212
|
-
return
|
|
1389
|
+
return re(void 0, r, Ve);
|
|
1213
1390
|
}
|
|
1214
|
-
const
|
|
1391
|
+
const gt = (e, t) => {
|
|
1215
1392
|
const r = {};
|
|
1216
1393
|
for (const [n, o] of Object.entries(e)) {
|
|
1217
|
-
const a =
|
|
1394
|
+
const a = Zn(t, n, o);
|
|
1218
1395
|
r[n] = a;
|
|
1219
1396
|
}
|
|
1220
1397
|
return r;
|
|
1221
1398
|
};
|
|
1222
|
-
function
|
|
1223
|
-
const e =
|
|
1224
|
-
e.set(
|
|
1225
|
-
}, n = (
|
|
1226
|
-
e.delete(
|
|
1399
|
+
function Gn() {
|
|
1400
|
+
const e = He(/* @__PURE__ */ new Map()), t = Qe() ? s() : null, r = (i) => {
|
|
1401
|
+
e.set(i, !1), t == null || t.observe(i);
|
|
1402
|
+
}, n = (i) => {
|
|
1403
|
+
e.delete(i), t == null || t.unobserve(i);
|
|
1227
1404
|
}, o = () => {
|
|
1228
1405
|
t == null || t.disconnect();
|
|
1229
|
-
}, a = (
|
|
1406
|
+
}, a = (i) => e.get(i) ?? !1;
|
|
1230
1407
|
function s() {
|
|
1231
|
-
return new IntersectionObserver((
|
|
1232
|
-
|
|
1233
|
-
e.set(
|
|
1408
|
+
return new IntersectionObserver((i) => {
|
|
1409
|
+
i.forEach((f) => {
|
|
1410
|
+
e.set(f.target, f.isIntersecting);
|
|
1234
1411
|
});
|
|
1235
1412
|
});
|
|
1236
1413
|
}
|
|
@@ -1241,114 +1418,114 @@ function dn() {
|
|
|
1241
1418
|
isElementVisible: a
|
|
1242
1419
|
};
|
|
1243
1420
|
}
|
|
1244
|
-
const
|
|
1245
|
-
function
|
|
1246
|
-
const t =
|
|
1421
|
+
const mr = Symbol("visibilityObserver");
|
|
1422
|
+
function Qn(e) {
|
|
1423
|
+
const t = oe(mr);
|
|
1247
1424
|
if (!t)
|
|
1248
|
-
throw new
|
|
1249
|
-
return
|
|
1425
|
+
throw new me();
|
|
1426
|
+
return ee(e, (n, o) => {
|
|
1250
1427
|
n && t.observe(n), o && t.unobserve(o);
|
|
1251
|
-
}, { immediate: !0 }),
|
|
1428
|
+
}, { immediate: !0 }), qe(() => {
|
|
1252
1429
|
e.value && t.unobserve(e.value);
|
|
1253
1430
|
}), {
|
|
1254
|
-
isElementVisible:
|
|
1431
|
+
isElementVisible: V(() => e.value ? t.isElementVisible(e.value) : !1)
|
|
1255
1432
|
};
|
|
1256
1433
|
}
|
|
1257
|
-
class
|
|
1434
|
+
class Kn extends Error {
|
|
1258
1435
|
constructor(t) {
|
|
1259
1436
|
super(`Route not found: "${t}"`);
|
|
1260
1437
|
}
|
|
1261
1438
|
}
|
|
1262
|
-
function
|
|
1439
|
+
function tt(e) {
|
|
1263
1440
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1264
1441
|
}
|
|
1265
|
-
function
|
|
1442
|
+
function zn(e, t) {
|
|
1266
1443
|
const r = Array.from(e.matchAll(t));
|
|
1267
1444
|
if (r.length === 0)
|
|
1268
1445
|
return [e];
|
|
1269
1446
|
let n = 0;
|
|
1270
|
-
const o = r.reduce((s,
|
|
1271
|
-
const
|
|
1272
|
-
|
|
1273
|
-
const [
|
|
1274
|
-
return s.push(
|
|
1447
|
+
const o = r.reduce((s, i) => {
|
|
1448
|
+
const f = tt(e.slice(n, i.index));
|
|
1449
|
+
f.length && s.push(f);
|
|
1450
|
+
const [u] = i;
|
|
1451
|
+
return s.push(u), n = i.index + u.length, s;
|
|
1275
1452
|
}, []), a = e.slice(n);
|
|
1276
1453
|
return a && o.push(a), o;
|
|
1277
1454
|
}
|
|
1278
|
-
function
|
|
1279
|
-
const t =
|
|
1455
|
+
function Yn(e) {
|
|
1456
|
+
const t = yr(e.path.value);
|
|
1280
1457
|
return new RegExp(`^${t}$`, "i");
|
|
1281
1458
|
}
|
|
1282
|
-
function
|
|
1459
|
+
function Xn(e) {
|
|
1283
1460
|
const t = new URLSearchParams(e.query.value);
|
|
1284
|
-
return Array.from(t.entries()).filter(([, r]) => !
|
|
1285
|
-
const o =
|
|
1286
|
-
return new RegExp(`${
|
|
1461
|
+
return Array.from(t.entries()).filter(([, r]) => !nt(r)).map(([r, n]) => {
|
|
1462
|
+
const o = yr(n);
|
|
1463
|
+
return new RegExp(`${tt(r)}=${o}(&|$)`, "i");
|
|
1287
1464
|
});
|
|
1288
1465
|
}
|
|
1289
|
-
function
|
|
1290
|
-
return
|
|
1466
|
+
function yr(e) {
|
|
1467
|
+
return zn(e, new RegExp(eo, "g")).map((t) => t.startsWith(G) ? gr(t) : tt(t)).join("");
|
|
1291
1468
|
}
|
|
1292
|
-
function
|
|
1469
|
+
function gr(e) {
|
|
1293
1470
|
return [
|
|
1294
|
-
|
|
1295
|
-
|
|
1471
|
+
to,
|
|
1472
|
+
ro
|
|
1296
1473
|
].reduce((t, r) => r(t), e);
|
|
1297
1474
|
}
|
|
1298
|
-
const
|
|
1299
|
-
function
|
|
1300
|
-
return e.replace(new RegExp(
|
|
1475
|
+
const eo = `\\${G}\\??([\\w-_]+)\\${z}`, rt = `\\${G}\\?([\\w-_]+)\\${z}`, Rr = `\\${G}([\\w-_]+)\\${z}`;
|
|
1476
|
+
function to(e) {
|
|
1477
|
+
return e.replace(new RegExp(rt, "g"), ".*");
|
|
1301
1478
|
}
|
|
1302
|
-
function
|
|
1303
|
-
return new RegExp(
|
|
1479
|
+
function nt(e) {
|
|
1480
|
+
return new RegExp(rt, "g").test(e);
|
|
1304
1481
|
}
|
|
1305
|
-
function
|
|
1306
|
-
return e.replace(new RegExp(
|
|
1482
|
+
function ro(e) {
|
|
1483
|
+
return e.replace(new RegExp(Rr, "g"), ".+");
|
|
1307
1484
|
}
|
|
1308
|
-
function
|
|
1309
|
-
const [t] =
|
|
1485
|
+
function be(e) {
|
|
1486
|
+
const [t] = je(e, new RegExp(rt, "g")), [r] = je(e, new RegExp(Rr, "g"));
|
|
1310
1487
|
return t ?? r;
|
|
1311
1488
|
}
|
|
1312
|
-
function
|
|
1313
|
-
return Array.from(e.matchAll(t)).flatMap(([, ...n]) => n.map((o) =>
|
|
1489
|
+
function je(e, t) {
|
|
1490
|
+
return Array.from(e.matchAll(t)).flatMap(([, ...n]) => n.map((o) => W(o) ? o : ""));
|
|
1314
1491
|
}
|
|
1315
|
-
function
|
|
1316
|
-
const n =
|
|
1492
|
+
function vr(e, t, r) {
|
|
1493
|
+
const n = Er(t, r), [o] = je(e, n);
|
|
1317
1494
|
return o;
|
|
1318
1495
|
}
|
|
1319
|
-
function
|
|
1496
|
+
function wr(e, t) {
|
|
1320
1497
|
if (!t)
|
|
1321
1498
|
return e;
|
|
1322
|
-
const { name: r, param: n, value: o } = t, a =
|
|
1323
|
-
return
|
|
1499
|
+
const { name: r, param: n, value: o } = t, a = Er(e, r);
|
|
1500
|
+
return je(e, a).reduce((i, f) => f === void 0 ? i : i.replace(f, () => re(o, n, r.startsWith("?"))), e);
|
|
1324
1501
|
}
|
|
1325
|
-
function
|
|
1502
|
+
function Er(e, t) {
|
|
1326
1503
|
const r = [
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1504
|
+
no,
|
|
1505
|
+
oo,
|
|
1506
|
+
gr
|
|
1330
1507
|
].reduce((n, o) => o(n, t), e);
|
|
1331
1508
|
return new RegExp(r, "g");
|
|
1332
1509
|
}
|
|
1333
|
-
function
|
|
1510
|
+
function no(e, t) {
|
|
1334
1511
|
if (!t.startsWith("?"))
|
|
1335
1512
|
return e;
|
|
1336
|
-
const r = new RegExp(`\\${G}\\${t}\\${
|
|
1513
|
+
const r = new RegExp(`\\${G}\\${t}\\${z}`, "g");
|
|
1337
1514
|
return e.replace(r, "(.*)");
|
|
1338
1515
|
}
|
|
1339
|
-
function
|
|
1516
|
+
function oo(e, t) {
|
|
1340
1517
|
if (t.startsWith("?"))
|
|
1341
1518
|
return e;
|
|
1342
|
-
const r = new RegExp(`\\${G}${t}\\${
|
|
1519
|
+
const r = new RegExp(`\\${G}${t}\\${z}`, "g");
|
|
1343
1520
|
return e.replace(r, "(.+)");
|
|
1344
1521
|
}
|
|
1345
|
-
function
|
|
1522
|
+
function Pr({ protocol: e, host: t, pathname: r, search: n, searchParams: o, hash: a }) {
|
|
1346
1523
|
const s = new URL("https://localhost");
|
|
1347
1524
|
e && (s.protocol = e), t && (s.host = t), r && (s.pathname = r), o ? s.search = new URLSearchParams(o).toString() : n && (s.search = n), a && (s.hash = a);
|
|
1348
|
-
const
|
|
1349
|
-
return
|
|
1525
|
+
const i = s.toString().replace(/^https:\/\/localhost\/*/, "/");
|
|
1526
|
+
return Gt(i);
|
|
1350
1527
|
}
|
|
1351
|
-
function
|
|
1528
|
+
function ot(...e) {
|
|
1352
1529
|
const t = new URLSearchParams();
|
|
1353
1530
|
for (const r of e) {
|
|
1354
1531
|
const n = new URLSearchParams(r);
|
|
@@ -1357,71 +1534,71 @@ function Ke(...e) {
|
|
|
1357
1534
|
}
|
|
1358
1535
|
return t;
|
|
1359
1536
|
}
|
|
1360
|
-
function
|
|
1361
|
-
const { params: r = {}, query: n } = t, o =
|
|
1362
|
-
return
|
|
1537
|
+
function ao(e, t = {}) {
|
|
1538
|
+
const { params: r = {}, query: n } = t, o = uo(e.query, r), a = ot(o, n), s = co(e.path, r), i = xe(e.hash.value ?? t.hash).value, f = so(e.host, r), { protocol: u, host: m } = q(f);
|
|
1539
|
+
return Pr({ protocol: u, host: m, pathname: s, searchParams: a, hash: i });
|
|
1363
1540
|
}
|
|
1364
|
-
function
|
|
1541
|
+
function so(e, t) {
|
|
1365
1542
|
const r = e.value && !e.value.startsWith("http") ? `https://${e.value}` : e.value;
|
|
1366
1543
|
return Object.entries(e.params).reduce((n, [o, a]) => {
|
|
1367
|
-
const s =
|
|
1368
|
-
return s ?
|
|
1544
|
+
const s = be(`${G}${o}${z}`);
|
|
1545
|
+
return s ? wr(n, { name: o, param: a, value: t[s] }) : n;
|
|
1369
1546
|
}, r);
|
|
1370
1547
|
}
|
|
1371
|
-
function
|
|
1548
|
+
function co(e, t) {
|
|
1372
1549
|
return Object.entries(e.params).reduce((r, [n, o]) => {
|
|
1373
|
-
const a =
|
|
1374
|
-
return a ?
|
|
1550
|
+
const a = be(`${G}${n}${z}`);
|
|
1551
|
+
return a ? wr(r, { name: n, param: o, value: t[a] }) : r;
|
|
1375
1552
|
}, e.value);
|
|
1376
1553
|
}
|
|
1377
|
-
function
|
|
1554
|
+
function uo(e, t) {
|
|
1378
1555
|
const r = new URLSearchParams(e.value);
|
|
1379
1556
|
if (!e.value)
|
|
1380
1557
|
return r;
|
|
1381
1558
|
for (const [n, o] of Array.from(r.entries())) {
|
|
1382
|
-
const a =
|
|
1559
|
+
const a = be(o);
|
|
1383
1560
|
if (!a)
|
|
1384
1561
|
continue;
|
|
1385
|
-
const
|
|
1386
|
-
|
|
1562
|
+
const i = nt(o), f = i ? `?${a}` : a, u = re(t[a], e.params[f], i), m = t[a] === void 0 && u === "";
|
|
1563
|
+
i && m ? r.delete(n, o) : r.set(n, u);
|
|
1387
1564
|
}
|
|
1388
1565
|
return r;
|
|
1389
1566
|
}
|
|
1390
|
-
const
|
|
1567
|
+
const io = (e, t) => {
|
|
1391
1568
|
try {
|
|
1392
|
-
|
|
1569
|
+
at(e, t);
|
|
1393
1570
|
} catch {
|
|
1394
1571
|
return !1;
|
|
1395
1572
|
}
|
|
1396
1573
|
return !0;
|
|
1397
|
-
},
|
|
1574
|
+
}, at = (e, t) => {
|
|
1398
1575
|
const { pathname: r, search: n } = q(t);
|
|
1399
1576
|
return {
|
|
1400
|
-
...
|
|
1401
|
-
...
|
|
1577
|
+
...fo(e.path, r),
|
|
1578
|
+
...lo(e.query, n)
|
|
1402
1579
|
};
|
|
1403
1580
|
};
|
|
1404
|
-
function
|
|
1581
|
+
function fo(e, t) {
|
|
1405
1582
|
const r = {}, n = decodeURIComponent(t);
|
|
1406
1583
|
for (const [o, a] of Object.entries(e.params)) {
|
|
1407
|
-
const s = o.startsWith("?"),
|
|
1408
|
-
r[
|
|
1584
|
+
const s = o.startsWith("?"), i = s ? o.slice(1) : o, f = vr(n, e.value, o), u = te(f, a, s);
|
|
1585
|
+
r[i] = u;
|
|
1409
1586
|
}
|
|
1410
1587
|
return r;
|
|
1411
1588
|
}
|
|
1412
|
-
function
|
|
1589
|
+
function lo(e, t) {
|
|
1413
1590
|
const r = {}, n = new URLSearchParams(e.value), o = new URLSearchParams(t);
|
|
1414
1591
|
for (const [a, s] of Array.from(n.entries())) {
|
|
1415
|
-
const
|
|
1416
|
-
if (!
|
|
1592
|
+
const i = be(s);
|
|
1593
|
+
if (!i)
|
|
1417
1594
|
continue;
|
|
1418
|
-
const
|
|
1419
|
-
r[
|
|
1595
|
+
const u = nt(s), m = u ? `?${i}` : i, E = o.get(a) ?? void 0, L = te(E, e.params[m], u);
|
|
1596
|
+
r[i] = L;
|
|
1420
1597
|
}
|
|
1421
1598
|
return r;
|
|
1422
1599
|
}
|
|
1423
|
-
function
|
|
1424
|
-
const n =
|
|
1600
|
+
function ho(e, t = {}, r = {}) {
|
|
1601
|
+
const n = ao(e, {
|
|
1425
1602
|
params: t,
|
|
1426
1603
|
query: r.query,
|
|
1427
1604
|
hash: r.hash
|
|
@@ -1431,51 +1608,51 @@ function Nn(e, t = {}, r = {}) {
|
|
|
1431
1608
|
matched: e.matched,
|
|
1432
1609
|
matches: e.matches,
|
|
1433
1610
|
name: e.name,
|
|
1434
|
-
query:
|
|
1435
|
-
params:
|
|
1436
|
-
state:
|
|
1611
|
+
query: Ye(o),
|
|
1612
|
+
params: at(e, n),
|
|
1613
|
+
state: dr(e.state, r.state),
|
|
1437
1614
|
hash: a,
|
|
1438
1615
|
href: n
|
|
1439
1616
|
};
|
|
1440
1617
|
}
|
|
1441
|
-
const
|
|
1618
|
+
const po = (e) => "name" in e.matched && !!e.matched.name, mo = (e, t) => {
|
|
1442
1619
|
const { pathname: r } = q(t);
|
|
1443
|
-
return
|
|
1444
|
-
},
|
|
1620
|
+
return Yn(e).test(r);
|
|
1621
|
+
}, yo = (e, t) => {
|
|
1445
1622
|
const { search: r } = q(t);
|
|
1446
|
-
return
|
|
1447
|
-
},
|
|
1623
|
+
return Xn(e).every((o) => o.test(r));
|
|
1624
|
+
}, We = (e, t) => {
|
|
1448
1625
|
const { hash: r } = q(t), { value: n } = e.hash;
|
|
1449
1626
|
return n === void 0 || `#${n.toLowerCase()}` === r.toLowerCase();
|
|
1450
1627
|
};
|
|
1451
|
-
function
|
|
1628
|
+
function go(e) {
|
|
1452
1629
|
const { searchParams: t, pathname: r } = q(e), n = -1, o = 1;
|
|
1453
1630
|
return (a, s) => {
|
|
1454
|
-
const
|
|
1455
|
-
return a.depth > s.depth ? n : a.depth < s.depth ? o :
|
|
1631
|
+
const i = vt(a, t), f = Rt(a, r), u = vt(s, t), m = Rt(s, r);
|
|
1632
|
+
return a.depth > s.depth ? n : a.depth < s.depth ? o : i + f > u + m ? n : i + f < u + m ? o : We(a, e) ? n : We(s, e) ? o : 0;
|
|
1456
1633
|
};
|
|
1457
1634
|
}
|
|
1458
|
-
function
|
|
1459
|
-
const r = Object.keys(e.path.params).filter((o) => o.startsWith("?")).map((o) => o), n = r.filter((o) =>
|
|
1635
|
+
function Rt(e, t) {
|
|
1636
|
+
const r = Object.keys(e.path.params).filter((o) => o.startsWith("?")).map((o) => o), n = r.filter((o) => vr(t, e.path.value, o) === void 0);
|
|
1460
1637
|
return r.length - n.length;
|
|
1461
1638
|
}
|
|
1462
|
-
function
|
|
1639
|
+
function vt(e, t) {
|
|
1463
1640
|
const r = new URLSearchParams(t), n = new URLSearchParams(e.query.value), o = Array.from(n.keys()), a = o.filter((s) => !r.has(s));
|
|
1464
1641
|
return o.length - a.length;
|
|
1465
1642
|
}
|
|
1466
|
-
const
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1643
|
+
const Ro = [
|
|
1644
|
+
po,
|
|
1645
|
+
mo,
|
|
1646
|
+
yo,
|
|
1647
|
+
We,
|
|
1648
|
+
io
|
|
1472
1649
|
];
|
|
1473
|
-
function
|
|
1474
|
-
const r =
|
|
1475
|
-
return e.filter((n) =>
|
|
1650
|
+
function vo(e, t) {
|
|
1651
|
+
const r = go(t);
|
|
1652
|
+
return e.filter((n) => Ro.every((o) => o(n, t))).sort(r);
|
|
1476
1653
|
}
|
|
1477
|
-
function
|
|
1478
|
-
const n =
|
|
1654
|
+
function wo(e, t, r) {
|
|
1655
|
+
const n = vo(e, t);
|
|
1479
1656
|
if (!n.length)
|
|
1480
1657
|
return;
|
|
1481
1658
|
const [o] = n, { searchParams: a, hash: s } = q(t);
|
|
@@ -1484,49 +1661,49 @@ function In(e, t, r) {
|
|
|
1484
1661
|
matched: o.matched,
|
|
1485
1662
|
matches: o.matches,
|
|
1486
1663
|
name: o.name,
|
|
1487
|
-
query:
|
|
1488
|
-
params:
|
|
1489
|
-
state:
|
|
1664
|
+
query: Ye(a),
|
|
1665
|
+
params: at(o, t),
|
|
1666
|
+
state: dr(o.state, r),
|
|
1490
1667
|
hash: s,
|
|
1491
|
-
href:
|
|
1668
|
+
href: Gt(t)
|
|
1492
1669
|
};
|
|
1493
1670
|
}
|
|
1494
|
-
function
|
|
1671
|
+
function wt(e, t) {
|
|
1495
1672
|
const r = typeof e == "string" ? q(e) : e, n = typeof t == "string" ? q(t) : t, o = r.searchParams ?? new URLSearchParams(r.search), a = n.searchParams ?? new URLSearchParams(n.search);
|
|
1496
|
-
return
|
|
1497
|
-
protocol:
|
|
1498
|
-
host:
|
|
1499
|
-
pathname:
|
|
1500
|
-
searchParams:
|
|
1501
|
-
hash:
|
|
1673
|
+
return Pr({
|
|
1674
|
+
protocol: W(n.protocol) ? n.protocol : r.protocol,
|
|
1675
|
+
host: W(n.host) ? n.host : r.host,
|
|
1676
|
+
pathname: W(n.pathname) ? n.pathname : r.pathname,
|
|
1677
|
+
searchParams: ot(a, o),
|
|
1678
|
+
hash: W(n.hash) ? n.hash : r.hash
|
|
1502
1679
|
});
|
|
1503
1680
|
}
|
|
1504
|
-
function
|
|
1505
|
-
const r = new RegExp(`\\${G}(\\??[\\w-_]+)\\${
|
|
1681
|
+
function st(e, t) {
|
|
1682
|
+
const r = new RegExp(`\\${G}(\\??[\\w-_]+)\\${z}`, "g");
|
|
1506
1683
|
return Array.from(e.matchAll(r)).reduce((o, [a, s]) => {
|
|
1507
|
-
const
|
|
1508
|
-
if (!
|
|
1684
|
+
const i = be(a);
|
|
1685
|
+
if (!i)
|
|
1509
1686
|
return o;
|
|
1510
|
-
const
|
|
1511
|
-
return
|
|
1687
|
+
const f = vn(t, i);
|
|
1688
|
+
return ye([i], o), o[s] = f, o;
|
|
1512
1689
|
}, {});
|
|
1513
1690
|
}
|
|
1514
|
-
function
|
|
1691
|
+
function Ze(e, t) {
|
|
1515
1692
|
return {
|
|
1516
1693
|
value: e,
|
|
1517
|
-
params:
|
|
1694
|
+
params: st(e, t)
|
|
1518
1695
|
};
|
|
1519
1696
|
}
|
|
1520
|
-
function
|
|
1521
|
-
return
|
|
1697
|
+
function Eo(e, t) {
|
|
1698
|
+
return W(t) ? e.map((r) => {
|
|
1522
1699
|
const n = `${t}${r.path.value}`;
|
|
1523
1700
|
return {
|
|
1524
1701
|
...r,
|
|
1525
|
-
path:
|
|
1702
|
+
path: Ze(n, r.path.params)
|
|
1526
1703
|
};
|
|
1527
1704
|
}) : e;
|
|
1528
1705
|
}
|
|
1529
|
-
class
|
|
1706
|
+
class Po extends Error {
|
|
1530
1707
|
/**
|
|
1531
1708
|
* Constructs a new DuplicateNamesError instance with a message indicating the problematic name.
|
|
1532
1709
|
* @param name - The name of the name that was duplicated.
|
|
@@ -1535,169 +1712,261 @@ class Wn extends Error {
|
|
|
1535
1712
|
super(`Invalid Name "${t}": Router does not support multiple routes with the same name. All name names must be unique.`);
|
|
1536
1713
|
}
|
|
1537
1714
|
}
|
|
1538
|
-
function
|
|
1715
|
+
function bo(e) {
|
|
1539
1716
|
const t = e.map(({ name: r }) => r);
|
|
1540
1717
|
for (const r of t)
|
|
1541
|
-
if (
|
|
1542
|
-
throw new
|
|
1718
|
+
if (Kt(t, r) > 1)
|
|
1719
|
+
throw new Po(r);
|
|
1543
1720
|
}
|
|
1544
|
-
function
|
|
1721
|
+
function So(e, t = [], r) {
|
|
1545
1722
|
const n = [
|
|
1546
1723
|
...e,
|
|
1547
1724
|
...t.map((o) => o.routes)
|
|
1548
1725
|
].flat();
|
|
1549
|
-
return
|
|
1726
|
+
return bo(n), Eo(n, r);
|
|
1550
1727
|
}
|
|
1551
|
-
function
|
|
1552
|
-
const r = new
|
|
1553
|
-
return
|
|
1728
|
+
function Ao(e = {}, t = []) {
|
|
1729
|
+
const r = new ne();
|
|
1730
|
+
return se("onBeforeRouteEnter", e, t).forEach((n) => r.onBeforeRouteEnter.add(n)), se("onBeforeRouteUpdate", e, t).forEach((n) => r.onBeforeRouteUpdate.add(n)), se("onBeforeRouteLeave", e, t).forEach((n) => r.onBeforeRouteLeave.add(n)), se("onAfterRouteEnter", e, t).forEach((n) => r.onAfterRouteEnter.add(n)), se("onAfterRouteUpdate", e, t).forEach((n) => r.onAfterRouteUpdate.add(n)), se("onAfterRouteLeave", e, t).forEach((n) => r.onAfterRouteLeave.add(n)), r;
|
|
1554
1731
|
}
|
|
1555
|
-
function
|
|
1732
|
+
function se(e, t, r) {
|
|
1556
1733
|
return [
|
|
1557
1734
|
t[e],
|
|
1558
1735
|
...r.map((o) => o[e])
|
|
1559
1736
|
].flat().filter((o) => o !== void 0);
|
|
1560
1737
|
}
|
|
1561
|
-
function
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1738
|
+
function br(e) {
|
|
1739
|
+
return typeof e == "object" && e !== null && "then" in e;
|
|
1740
|
+
}
|
|
1741
|
+
function Sr(e, t, { exact: r } = {}) {
|
|
1742
|
+
return xn(e) ? t === void 0 ? !0 : r ? e.matched.name === t : e.matches.map((n) => n.name).includes(t) : !1;
|
|
1743
|
+
}
|
|
1744
|
+
function Ar(e, t) {
|
|
1745
|
+
const r = Ge();
|
|
1746
|
+
function n() {
|
|
1747
|
+
if (!e)
|
|
1748
|
+
return;
|
|
1749
|
+
if (!Sr(r.route, e, t))
|
|
1750
|
+
throw new on(e, r.route.name);
|
|
1751
|
+
}
|
|
1752
|
+
return ee(r.route, n, { immediate: !0, deep: !0 }), r.route;
|
|
1753
|
+
}
|
|
1754
|
+
function ko(e, t, r) {
|
|
1755
|
+
return de({
|
|
1756
|
+
name: "PropsWrapper",
|
|
1757
|
+
expose: [],
|
|
1758
|
+
setup() {
|
|
1759
|
+
const n = Wr(), o = _r(), a = Ar();
|
|
1760
|
+
return () => {
|
|
1761
|
+
const s = o.getProps(e.id, t, a);
|
|
1762
|
+
return s instanceof Error ? "" : br(s) ? n != null && n.suspense ? ue(Lo, { component: r, props: s }) : ue(xo, { component: r, props: s }) : ue(r, s);
|
|
1763
|
+
};
|
|
1764
|
+
}
|
|
1765
|
+
});
|
|
1766
|
+
}
|
|
1767
|
+
const xo = de((e) => {
|
|
1768
|
+
const t = _e();
|
|
1769
|
+
return ee(() => e.props, async (r) => {
|
|
1770
|
+
t.value = await r;
|
|
1771
|
+
}, { immediate: !0, deep: !0 }), () => t.value instanceof Error ? "" : t.value ? ue(e.component, t.value) : "";
|
|
1772
|
+
}, {
|
|
1773
|
+
props: ["component", "props"]
|
|
1774
|
+
}), Lo = de(async (e) => {
|
|
1775
|
+
const t = _e();
|
|
1776
|
+
return t.value = await e.props, ee(() => t.value, async (r) => {
|
|
1777
|
+
t.value = await r;
|
|
1778
|
+
}, { deep: !0 }), () => t.value instanceof Error ? "" : t.value ? ue(e.component, t.value) : "";
|
|
1779
|
+
}, {
|
|
1780
|
+
props: ["component", "props"]
|
|
1781
|
+
}), kr = Symbol();
|
|
1782
|
+
function ct() {
|
|
1783
|
+
return oe(kr, 0);
|
|
1784
|
+
}
|
|
1785
|
+
function Uo() {
|
|
1786
|
+
const e = oe(Lr);
|
|
1787
|
+
if (!e)
|
|
1788
|
+
throw new me();
|
|
1789
|
+
return e;
|
|
1790
|
+
}
|
|
1791
|
+
const xr = /* @__PURE__ */ de({
|
|
1792
|
+
__name: "routerView",
|
|
1793
|
+
props: {
|
|
1794
|
+
name: { default: "default" }
|
|
1795
|
+
},
|
|
1796
|
+
setup(e) {
|
|
1797
|
+
const t = Ar(), r = kn(), n = ct(), { getRouteComponents: o } = Uo();
|
|
1798
|
+
Zr(kr, n + 1);
|
|
1799
|
+
const a = V(() => {
|
|
1800
|
+
if (r.value)
|
|
1801
|
+
return r.value.component;
|
|
1802
|
+
const s = t.matches.at(n);
|
|
1803
|
+
return s ? o(s)[e.name] : null;
|
|
1804
|
+
});
|
|
1805
|
+
return (s, i) => a.value ? xt(s.$slots, "default", Lt(Gr({ key: 0 }, { route: ge(t), component: a.value, rejection: ge(r) })), () => [
|
|
1806
|
+
(Ut(), Qr(Kr(a.value)))
|
|
1807
|
+
]) : zr("", !0);
|
|
1808
|
+
}
|
|
1809
|
+
}), Lr = Symbol();
|
|
1810
|
+
function Bo() {
|
|
1811
|
+
const e = /* @__PURE__ */ new Map();
|
|
1812
|
+
return {
|
|
1813
|
+
getRouteComponents: (r) => {
|
|
1814
|
+
const n = e.get(r.id);
|
|
1815
|
+
if (n)
|
|
1816
|
+
return n;
|
|
1817
|
+
const o = Co(r);
|
|
1818
|
+
return e.set(r.id, o), o;
|
|
1819
|
+
}
|
|
1820
|
+
};
|
|
1821
|
+
}
|
|
1822
|
+
function Co(e) {
|
|
1823
|
+
return Xt(e) ? Et(e, e.components) : Yt(e) ? Et(e, { default: e.component }) : { default: xr };
|
|
1824
|
+
}
|
|
1825
|
+
function Et(e, t) {
|
|
1826
|
+
return Object.fromEntries(
|
|
1827
|
+
Object.entries(t).map(([r, n]) => [r, ko(e, r, n)])
|
|
1828
|
+
);
|
|
1829
|
+
}
|
|
1830
|
+
function Yo(e, t, r = []) {
|
|
1831
|
+
const n = So(e, r, t == null ? void 0 : t.base), o = On();
|
|
1832
|
+
o.addGlobalRouteHooks(Ao(t, r));
|
|
1833
|
+
const a = Xe(), s = Io(), i = Bo(), f = Gn(), u = Vn({
|
|
1565
1834
|
mode: t == null ? void 0 : t.historyMode,
|
|
1566
|
-
listener: ({ location:
|
|
1567
|
-
const U = X(
|
|
1568
|
-
|
|
1835
|
+
listener: ({ location: P }) => {
|
|
1836
|
+
const U = X(P);
|
|
1837
|
+
E(U, { state: P.state, replace: !0 });
|
|
1569
1838
|
}
|
|
1570
1839
|
});
|
|
1571
|
-
function
|
|
1572
|
-
return
|
|
1840
|
+
function m(P, U = {}) {
|
|
1841
|
+
return wo(n, P, U.state);
|
|
1573
1842
|
}
|
|
1574
|
-
async function
|
|
1575
|
-
const
|
|
1576
|
-
if (u.stopListening(),
|
|
1577
|
-
u.update(
|
|
1843
|
+
async function E(P, U = {}) {
|
|
1844
|
+
const J = a();
|
|
1845
|
+
if (u.stopListening(), A(P)) {
|
|
1846
|
+
u.update(P, U);
|
|
1578
1847
|
return;
|
|
1579
1848
|
}
|
|
1580
|
-
const
|
|
1849
|
+
const I = m(P, U) ?? S("NotFound"), _ = it(J), Q = await o.runBeforeRouteHooks({ to: I, from: _ });
|
|
1581
1850
|
switch (Q.status) {
|
|
1582
1851
|
// On abort do nothing
|
|
1583
1852
|
case "ABORT":
|
|
1584
1853
|
return;
|
|
1585
1854
|
// On push update the history, and push new route, and return
|
|
1586
1855
|
case "PUSH":
|
|
1587
|
-
u.update(
|
|
1856
|
+
u.update(P, U), await y(...Q.to);
|
|
1588
1857
|
return;
|
|
1589
1858
|
// On reject update the history, the route, and set the rejection type
|
|
1590
1859
|
case "REJECT":
|
|
1591
|
-
u.update(
|
|
1860
|
+
u.update(P, U), c(Q.type);
|
|
1592
1861
|
break;
|
|
1593
1862
|
// On success update history, set the route, and clear the rejection
|
|
1594
1863
|
case "SUCCESS":
|
|
1595
|
-
u.update(
|
|
1864
|
+
u.update(P, U), c(null);
|
|
1596
1865
|
break;
|
|
1597
1866
|
default:
|
|
1598
1867
|
throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(Q)}`);
|
|
1599
1868
|
}
|
|
1600
|
-
const
|
|
1601
|
-
s.setProps(
|
|
1602
|
-
if (
|
|
1603
|
-
switch (
|
|
1869
|
+
const Ie = J;
|
|
1870
|
+
s.setProps(I).then((D) => {
|
|
1871
|
+
if (Ie === J)
|
|
1872
|
+
switch (D.status) {
|
|
1604
1873
|
case "SUCCESS":
|
|
1605
1874
|
break;
|
|
1606
1875
|
case "PUSH":
|
|
1607
|
-
|
|
1876
|
+
y(...D.to);
|
|
1608
1877
|
break;
|
|
1609
1878
|
case "REJECT":
|
|
1610
|
-
|
|
1879
|
+
c(D.type);
|
|
1611
1880
|
break;
|
|
1612
1881
|
default:
|
|
1613
|
-
const
|
|
1614
|
-
throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify(
|
|
1882
|
+
const De = D;
|
|
1883
|
+
throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify(De)}`);
|
|
1615
1884
|
}
|
|
1616
|
-
}),
|
|
1617
|
-
const
|
|
1618
|
-
switch (
|
|
1885
|
+
}), k(I);
|
|
1886
|
+
const F = await o.runAfterRouteHooks({ to: I, from: _ });
|
|
1887
|
+
switch (F.status) {
|
|
1619
1888
|
case "PUSH":
|
|
1620
|
-
await
|
|
1889
|
+
await y(...F.to);
|
|
1621
1890
|
break;
|
|
1622
1891
|
case "REJECT":
|
|
1623
|
-
|
|
1892
|
+
c(F.type);
|
|
1624
1893
|
break;
|
|
1625
1894
|
case "SUCCESS":
|
|
1626
1895
|
break;
|
|
1627
1896
|
default:
|
|
1628
|
-
const
|
|
1629
|
-
throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(
|
|
1897
|
+
const D = F;
|
|
1898
|
+
throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(D)}`);
|
|
1630
1899
|
}
|
|
1631
1900
|
u.startListening();
|
|
1632
1901
|
}
|
|
1633
|
-
const
|
|
1634
|
-
const
|
|
1635
|
-
if (!
|
|
1636
|
-
throw new
|
|
1637
|
-
return
|
|
1638
|
-
},
|
|
1639
|
-
if (
|
|
1640
|
-
const
|
|
1641
|
-
searchParams:
|
|
1642
|
-
hash:
|
|
1902
|
+
const L = (P, U = {}, J = {}) => {
|
|
1903
|
+
const I = n.find((_) => _.name === P);
|
|
1904
|
+
if (!I)
|
|
1905
|
+
throw new Kn(String(P));
|
|
1906
|
+
return ho(I, U, J);
|
|
1907
|
+
}, y = (P, U, J) => {
|
|
1908
|
+
if (T(P)) {
|
|
1909
|
+
const F = { ...U }, D = wt(P, {
|
|
1910
|
+
searchParams: F.query,
|
|
1911
|
+
hash: F.hash
|
|
1643
1912
|
});
|
|
1644
|
-
return
|
|
1913
|
+
return E(D, F);
|
|
1645
1914
|
}
|
|
1646
|
-
if (typeof
|
|
1647
|
-
const { replace:
|
|
1648
|
-
return
|
|
1915
|
+
if (typeof P == "string") {
|
|
1916
|
+
const { replace: F, ...D } = { ...J }, De = { ...U }, Fe = L(P, De, D), Fr = gt({ ...Fe.matched.state }, { ...Fe.state, ...D.state });
|
|
1917
|
+
return E(Fe.href, { replace: F, state: Fr });
|
|
1649
1918
|
}
|
|
1650
|
-
const { replace:
|
|
1651
|
-
searchParams:
|
|
1652
|
-
hash:
|
|
1919
|
+
const { replace: I, ..._ } = { ...U }, Q = gt({ ...P.matched.state }, { ...P.state, ..._.state }), Ie = wt(P.href, {
|
|
1920
|
+
searchParams: _.query,
|
|
1921
|
+
hash: _.hash
|
|
1653
1922
|
});
|
|
1654
|
-
return
|
|
1655
|
-
},
|
|
1656
|
-
if (
|
|
1657
|
-
const
|
|
1658
|
-
return
|
|
1923
|
+
return E(Ie, { replace: I, state: Q });
|
|
1924
|
+
}, p = (P, U, J) => {
|
|
1925
|
+
if (T(P)) {
|
|
1926
|
+
const _ = { ...U, replace: !0 };
|
|
1927
|
+
return y(P, _);
|
|
1659
1928
|
}
|
|
1660
|
-
if (typeof
|
|
1661
|
-
const
|
|
1662
|
-
return
|
|
1929
|
+
if (typeof P == "string") {
|
|
1930
|
+
const _ = { ...J, replace: !0 }, Q = { ...U };
|
|
1931
|
+
return y(P, Q, _);
|
|
1663
1932
|
}
|
|
1664
|
-
const
|
|
1665
|
-
return
|
|
1666
|
-
},
|
|
1667
|
-
|
|
1668
|
-
}, { setRejection:
|
|
1669
|
-
...r.reduce((
|
|
1933
|
+
const I = { ...U, replace: !0 };
|
|
1934
|
+
return y(P, I);
|
|
1935
|
+
}, g = (P) => {
|
|
1936
|
+
c(P);
|
|
1937
|
+
}, { setRejection: c, rejection: h, getRejectionRoute: S } = Mn({
|
|
1938
|
+
...r.reduce((P, U) => ({ ...P, ...U.rejections }), {}),
|
|
1670
1939
|
...t == null ? void 0 : t.rejections
|
|
1671
|
-
}),
|
|
1940
|
+
}), R = S("NotFound"), { currentRoute: v, routerRoute: b, updateRoute: k } = Un(R, y), d = Jn(t == null ? void 0 : t.initialUrl), l = u.location.state, { host: w } = q(d), A = Nn(w);
|
|
1672
1941
|
let x = !1;
|
|
1673
|
-
const { promise:
|
|
1674
|
-
async function
|
|
1942
|
+
const { promise: B, resolve: N } = Promise.withResolvers();
|
|
1943
|
+
async function $() {
|
|
1675
1944
|
if (x)
|
|
1676
|
-
return
|
|
1677
|
-
x = !0, await
|
|
1945
|
+
return B;
|
|
1946
|
+
x = !0, await E(d, { replace: !0, state: l }), u.startListening(), N();
|
|
1678
1947
|
}
|
|
1679
|
-
function
|
|
1948
|
+
function O() {
|
|
1680
1949
|
u.stopListening();
|
|
1681
1950
|
}
|
|
1682
|
-
function
|
|
1683
|
-
return
|
|
1951
|
+
function it(P) {
|
|
1952
|
+
return Fn(P) ? null : { ...v };
|
|
1684
1953
|
}
|
|
1685
|
-
function
|
|
1686
|
-
|
|
1954
|
+
function Dr(P) {
|
|
1955
|
+
P.component("RouterView", xr), P.component("RouterLink", Wo), P.provide(cr, h), P.provide(hr, o), P.provide(Hr, s), P.provide(Lr, i), P.provide(mr, f), P.provide(Qt, ft), $();
|
|
1687
1956
|
}
|
|
1688
|
-
const
|
|
1689
|
-
route:
|
|
1690
|
-
resolve:
|
|
1691
|
-
find:
|
|
1692
|
-
push:
|
|
1693
|
-
replace:
|
|
1694
|
-
reject:
|
|
1957
|
+
const ft = {
|
|
1958
|
+
route: b,
|
|
1959
|
+
resolve: L,
|
|
1960
|
+
find: m,
|
|
1961
|
+
push: y,
|
|
1962
|
+
replace: p,
|
|
1963
|
+
reject: g,
|
|
1695
1964
|
refresh: u.refresh,
|
|
1696
1965
|
forward: u.forward,
|
|
1697
1966
|
back: u.back,
|
|
1698
1967
|
go: u.go,
|
|
1699
|
-
install:
|
|
1700
|
-
isExternal:
|
|
1968
|
+
install: Dr,
|
|
1969
|
+
isExternal: A,
|
|
1701
1970
|
onBeforeRouteEnter: o.onBeforeRouteEnter,
|
|
1702
1971
|
onBeforeRouteUpdate: o.onBeforeRouteUpdate,
|
|
1703
1972
|
onBeforeRouteLeave: o.onBeforeRouteLeave,
|
|
@@ -1705,297 +1974,370 @@ function mo(e, t, r = []) {
|
|
|
1705
1974
|
onAfterRouteUpdate: o.onAfterRouteUpdate,
|
|
1706
1975
|
onAfterRouteLeave: o.onAfterRouteLeave,
|
|
1707
1976
|
prefetch: t == null ? void 0 : t.prefetch,
|
|
1708
|
-
start:
|
|
1709
|
-
stop:
|
|
1977
|
+
start: $,
|
|
1978
|
+
stop: O
|
|
1710
1979
|
};
|
|
1711
|
-
return
|
|
1980
|
+
return ft;
|
|
1712
1981
|
}
|
|
1713
|
-
function
|
|
1982
|
+
function Pt(e, t) {
|
|
1714
1983
|
return {
|
|
1715
1984
|
value: e,
|
|
1716
|
-
params:
|
|
1985
|
+
params: st(e, t)
|
|
1717
1986
|
};
|
|
1718
1987
|
}
|
|
1719
|
-
function
|
|
1988
|
+
function Xo(e) {
|
|
1720
1989
|
return {
|
|
1721
1990
|
routes: e.routes ?? [],
|
|
1722
1991
|
rejections: e.rejections ?? {},
|
|
1723
1992
|
...e
|
|
1724
1993
|
};
|
|
1725
1994
|
}
|
|
1726
|
-
function
|
|
1995
|
+
function No(...e) {
|
|
1996
|
+
return {
|
|
1997
|
+
get: (t, { invalid: r }) => {
|
|
1998
|
+
for (const n of e) {
|
|
1999
|
+
const o = En(t, n);
|
|
2000
|
+
if (o !== void 0)
|
|
2001
|
+
return o;
|
|
2002
|
+
}
|
|
2003
|
+
throw r(`Value ${t} does not satisfy any of the possible values`);
|
|
2004
|
+
},
|
|
2005
|
+
set: (t, { invalid: r }) => {
|
|
2006
|
+
for (const n of e) {
|
|
2007
|
+
const o = Pn(t, n);
|
|
2008
|
+
if (o !== void 0)
|
|
2009
|
+
return o;
|
|
2010
|
+
}
|
|
2011
|
+
throw r(`Value ${t} does not satisfy any of the possible values`);
|
|
2012
|
+
}
|
|
2013
|
+
};
|
|
2014
|
+
}
|
|
2015
|
+
function ea(...e) {
|
|
2016
|
+
const t = No(...e);
|
|
2017
|
+
return {
|
|
2018
|
+
get: (r, n) => r.split(",").map((o) => t.get(o, n)),
|
|
2019
|
+
set: (r, n) => {
|
|
2020
|
+
if (!Array.isArray(r))
|
|
2021
|
+
throw n.invalid("Expected an array");
|
|
2022
|
+
return r.map((o) => t.set(o, n)).join(",");
|
|
2023
|
+
}
|
|
2024
|
+
};
|
|
2025
|
+
}
|
|
2026
|
+
function ta(...e) {
|
|
2027
|
+
return {
|
|
2028
|
+
get: (t) => {
|
|
2029
|
+
const r = t.split(",");
|
|
2030
|
+
return e.map((n, o) => te(r.at(o), n));
|
|
2031
|
+
},
|
|
2032
|
+
set: (t, { invalid: r }) => {
|
|
2033
|
+
if (!Array.isArray(t))
|
|
2034
|
+
throw r("Expected a tuple");
|
|
2035
|
+
if (t.length !== e.length)
|
|
2036
|
+
throw r(`Expected tuple with ${e.length} values but received ${t.length} values`);
|
|
2037
|
+
return e.map((n, o) => re(t.at(o), n)).join(",");
|
|
2038
|
+
}
|
|
2039
|
+
};
|
|
2040
|
+
}
|
|
2041
|
+
function Ur(e, t) {
|
|
1727
2042
|
return {
|
|
1728
2043
|
value: e,
|
|
1729
|
-
params:
|
|
2044
|
+
params: st(e, t)
|
|
1730
2045
|
};
|
|
1731
2046
|
}
|
|
1732
|
-
function
|
|
2047
|
+
function Vo(e) {
|
|
1733
2048
|
return ve(e) && typeof e.hash == "string";
|
|
1734
2049
|
}
|
|
1735
|
-
function
|
|
1736
|
-
return e === void 0 ?
|
|
2050
|
+
function Br(e) {
|
|
2051
|
+
return e === void 0 ? xe() : Vo(e) ? e : xe(e);
|
|
1737
2052
|
}
|
|
1738
|
-
function
|
|
2053
|
+
function Cr(e) {
|
|
1739
2054
|
return e === void 0 ? "" : e;
|
|
1740
2055
|
}
|
|
1741
|
-
function
|
|
2056
|
+
function jo(e) {
|
|
1742
2057
|
return ve(e) && typeof e.value == "string";
|
|
1743
2058
|
}
|
|
1744
|
-
function
|
|
1745
|
-
return e === void 0 ?
|
|
2059
|
+
function Nr(e) {
|
|
2060
|
+
return e === void 0 ? Ze("", {}) : jo(e) ? e : Ze(e, {});
|
|
1746
2061
|
}
|
|
1747
|
-
function
|
|
2062
|
+
function $o(e) {
|
|
1748
2063
|
return ve(e) && typeof e.value == "string";
|
|
1749
2064
|
}
|
|
1750
|
-
function
|
|
1751
|
-
return e === void 0 ?
|
|
2065
|
+
function Vr(e) {
|
|
2066
|
+
return e === void 0 ? Pt("", {}) : $o(e) ? e : Pt(e, {});
|
|
1752
2067
|
}
|
|
1753
|
-
function
|
|
1754
|
-
const r =
|
|
2068
|
+
function pe(e, t) {
|
|
2069
|
+
const r = et(), n = Cr(e.name), o = Nr(e.path), a = Vr(e.query), s = Br(e.hash), i = e.meta ?? {}, f = dn(e) ? e.state : {}, u = Ae({ id: r, meta: {}, state: {}, ...e, props: t }), m = {
|
|
1755
2070
|
id: r,
|
|
1756
|
-
matched:
|
|
1757
|
-
matches: [
|
|
2071
|
+
matched: u,
|
|
2072
|
+
matches: [u],
|
|
1758
2073
|
name: n,
|
|
1759
2074
|
path: o,
|
|
1760
2075
|
query: a,
|
|
1761
2076
|
hash: s,
|
|
1762
|
-
meta:
|
|
1763
|
-
state:
|
|
2077
|
+
meta: i,
|
|
2078
|
+
state: f,
|
|
1764
2079
|
depth: 1,
|
|
1765
|
-
host:
|
|
2080
|
+
host: Ur("", {}),
|
|
1766
2081
|
prefetch: e.prefetch
|
|
1767
|
-
},
|
|
1768
|
-
return
|
|
2082
|
+
}, E = zt(e) ? er(e.parent, m) : m;
|
|
2083
|
+
return ye(E.path.params, E.query.params), E;
|
|
1769
2084
|
}
|
|
1770
|
-
const
|
|
2085
|
+
const $e = { template: "<div>This is component</div>" }, ut = pe({
|
|
1771
2086
|
name: "parentA",
|
|
1772
2087
|
path: "/parentA/[paramA]"
|
|
1773
|
-
}),
|
|
1774
|
-
parent:
|
|
2088
|
+
}), jr = pe({
|
|
2089
|
+
parent: ut,
|
|
1775
2090
|
name: "parentA.childA",
|
|
1776
2091
|
path: "/childA/[?paramB]"
|
|
1777
|
-
}),
|
|
1778
|
-
parent:
|
|
2092
|
+
}), Ho = pe({
|
|
2093
|
+
parent: ut,
|
|
1779
2094
|
name: "parentA.childB",
|
|
1780
2095
|
path: "/childB/[paramD]",
|
|
1781
|
-
component:
|
|
1782
|
-
}),
|
|
1783
|
-
parent:
|
|
2096
|
+
component: $e
|
|
2097
|
+
}), _o = pe({
|
|
2098
|
+
parent: jr,
|
|
1784
2099
|
name: "parentA.childA.grandChildA",
|
|
1785
2100
|
path: "/[paramC]",
|
|
1786
|
-
component:
|
|
2101
|
+
component: $e
|
|
1787
2102
|
});
|
|
1788
|
-
|
|
2103
|
+
pe({
|
|
1789
2104
|
name: "parentB",
|
|
1790
2105
|
path: "/parentB",
|
|
1791
|
-
component:
|
|
1792
|
-
}),
|
|
2106
|
+
component: $e
|
|
2107
|
+
}), pe({
|
|
1793
2108
|
name: "parentC",
|
|
1794
2109
|
path: "/",
|
|
1795
|
-
component:
|
|
2110
|
+
component: $e
|
|
1796
2111
|
});
|
|
1797
|
-
const
|
|
2112
|
+
const qo = "lazy", Oo = {
|
|
1798
2113
|
components: !0,
|
|
1799
2114
|
props: !1
|
|
1800
2115
|
};
|
|
1801
|
-
function
|
|
2116
|
+
function Se(e) {
|
|
1802
2117
|
return ["eager", "lazy", "intent"].includes(e);
|
|
1803
2118
|
}
|
|
1804
|
-
function
|
|
1805
|
-
const o =
|
|
2119
|
+
function $r({ routerPrefetch: e, routePrefetch: t, linkPrefetch: r }, n) {
|
|
2120
|
+
const o = Me(r, n), a = Me(t, n), s = Me(e, n), i = [
|
|
1806
2121
|
o,
|
|
1807
2122
|
a,
|
|
1808
2123
|
s,
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
].reduce((
|
|
1812
|
-
return
|
|
2124
|
+
Oo[n],
|
|
2125
|
+
qo
|
|
2126
|
+
].reduce((f, u) => Se(f) ? f : f === !0 && Se(u) ? u : f === !0 && !Se(u) ? f : f === void 0 ? u : f, void 0);
|
|
2127
|
+
return Se(i) ? i : !1;
|
|
1813
2128
|
}
|
|
1814
|
-
function
|
|
2129
|
+
function Me(e, t) {
|
|
1815
2130
|
return ve(e) ? e[t] : e;
|
|
1816
2131
|
}
|
|
1817
|
-
function
|
|
1818
|
-
return typeof e == "object" && e !== null && "then" in e;
|
|
1819
|
-
}
|
|
1820
|
-
function ht(e) {
|
|
2132
|
+
function bt(e) {
|
|
1821
2133
|
try {
|
|
1822
2134
|
const t = e();
|
|
1823
|
-
return
|
|
2135
|
+
return br(t) ? t.catch((r) => r) : t;
|
|
1824
2136
|
} catch (t) {
|
|
1825
2137
|
return t;
|
|
1826
2138
|
}
|
|
1827
2139
|
}
|
|
1828
|
-
const
|
|
1829
|
-
function
|
|
1830
|
-
const e =
|
|
1831
|
-
if (!
|
|
1832
|
-
return
|
|
1833
|
-
const
|
|
2140
|
+
const Hr = Symbol();
|
|
2141
|
+
function Io() {
|
|
2142
|
+
const e = He(/* @__PURE__ */ new Map()), { push: t, replace: r, reject: n } = lr(), o = (y, p, g) => p.matches.filter((c) => $r({ ...g, routePrefetch: c.prefetch }, "props") === y).flatMap((c) => E(c)).reduce((c, { id: h, name: S, props: R }) => {
|
|
2143
|
+
if (!R)
|
|
2144
|
+
return c;
|
|
2145
|
+
const v = m(h, S, p), b = bt(() => R(p, {
|
|
1834
2146
|
push: t,
|
|
1835
2147
|
replace: r,
|
|
1836
|
-
reject: n
|
|
2148
|
+
reject: n,
|
|
2149
|
+
parent: f(p, !0)
|
|
1837
2150
|
}));
|
|
1838
|
-
return
|
|
1839
|
-
}, {}), a = (
|
|
1840
|
-
Object.entries(
|
|
1841
|
-
e.set(
|
|
2151
|
+
return c[v] = b, c;
|
|
2152
|
+
}, {}), a = (y) => {
|
|
2153
|
+
Object.entries(y).forEach(([p, g]) => {
|
|
2154
|
+
e.set(p, g);
|
|
1842
2155
|
});
|
|
1843
|
-
}, s = async (
|
|
1844
|
-
const
|
|
1845
|
-
for (const { id:
|
|
1846
|
-
if (!
|
|
2156
|
+
}, s = async (y) => {
|
|
2157
|
+
const p = y.matches.flatMap(E), g = [], c = [];
|
|
2158
|
+
for (const { id: h, name: S, props: R } of p) {
|
|
2159
|
+
if (!R)
|
|
1847
2160
|
continue;
|
|
1848
|
-
const
|
|
1849
|
-
if (
|
|
1850
|
-
const
|
|
2161
|
+
const v = m(h, S, y);
|
|
2162
|
+
if (g.push(v), !e.has(v)) {
|
|
2163
|
+
const b = bt(() => R(y, {
|
|
1851
2164
|
push: t,
|
|
1852
2165
|
replace: r,
|
|
1853
|
-
reject: n
|
|
2166
|
+
reject: n,
|
|
2167
|
+
parent: f(y)
|
|
1854
2168
|
}));
|
|
1855
|
-
e.set(
|
|
2169
|
+
e.set(v, b);
|
|
1856
2170
|
}
|
|
1857
|
-
|
|
1858
|
-
const
|
|
1859
|
-
if (
|
|
1860
|
-
throw
|
|
2171
|
+
c.push((async () => {
|
|
2172
|
+
const b = await e.get(v);
|
|
2173
|
+
if (b instanceof Error)
|
|
2174
|
+
throw b;
|
|
1861
2175
|
})());
|
|
1862
2176
|
}
|
|
1863
|
-
|
|
2177
|
+
L(g);
|
|
1864
2178
|
try {
|
|
1865
|
-
return await Promise.all(
|
|
1866
|
-
} catch (
|
|
1867
|
-
if (
|
|
1868
|
-
return
|
|
1869
|
-
throw
|
|
2179
|
+
return await Promise.all(c), { status: "SUCCESS" };
|
|
2180
|
+
} catch (h) {
|
|
2181
|
+
if (h instanceof fe || h instanceof Ne)
|
|
2182
|
+
return h.response;
|
|
2183
|
+
throw h;
|
|
1870
2184
|
}
|
|
1871
|
-
},
|
|
1872
|
-
const
|
|
1873
|
-
return e.get(
|
|
2185
|
+
}, i = (y, p, g) => {
|
|
2186
|
+
const c = m(y, p, g);
|
|
2187
|
+
return e.get(c);
|
|
1874
2188
|
};
|
|
1875
|
-
function
|
|
1876
|
-
|
|
2189
|
+
function f(y, p = !1) {
|
|
2190
|
+
const g = y.matches.at(-2);
|
|
2191
|
+
if (g)
|
|
2192
|
+
return lt(g) ? {
|
|
2193
|
+
name: g.name ?? "",
|
|
2194
|
+
get props() {
|
|
2195
|
+
return u(g, "default", y, p);
|
|
2196
|
+
}
|
|
2197
|
+
} : ht(g) ? {
|
|
2198
|
+
name: g.name ?? "",
|
|
2199
|
+
props: new Proxy({}, {
|
|
2200
|
+
get(c, h) {
|
|
2201
|
+
return typeof h != "string" ? Reflect.get(c, h) : u(g, h, y, p);
|
|
2202
|
+
}
|
|
2203
|
+
})
|
|
2204
|
+
} : {
|
|
2205
|
+
name: g.name ?? "",
|
|
2206
|
+
props: void 0
|
|
2207
|
+
};
|
|
1877
2208
|
}
|
|
1878
|
-
function c
|
|
1879
|
-
|
|
2209
|
+
function u(y, p, g, c = !1) {
|
|
2210
|
+
const h = i(y.id, p, g);
|
|
2211
|
+
if (c && !h) {
|
|
2212
|
+
const S = y.name ?? "unknown", R = g.name || "unknown";
|
|
2213
|
+
console.warn(`
|
|
2214
|
+
Unable to access parent props "${p}" from route "${S}" while prefetching props for route "${R}".
|
|
2215
|
+
This may occur if the parent route's props were not also prefetched.
|
|
2216
|
+
`);
|
|
2217
|
+
}
|
|
2218
|
+
return h;
|
|
2219
|
+
}
|
|
2220
|
+
function m(y, p, g) {
|
|
2221
|
+
return [y, p, g.id, JSON.stringify(g.params)].join("-");
|
|
2222
|
+
}
|
|
2223
|
+
function E(y) {
|
|
2224
|
+
return lt(y) ? [
|
|
1880
2225
|
{
|
|
1881
|
-
id:
|
|
2226
|
+
id: y.id,
|
|
1882
2227
|
name: "default",
|
|
1883
|
-
props:
|
|
2228
|
+
props: y.props
|
|
1884
2229
|
}
|
|
1885
|
-
] :
|
|
2230
|
+
] : ht(y) ? Object.entries(y.props).map(([p, g]) => ({ id: y.id, name: p, props: g })) : [];
|
|
1886
2231
|
}
|
|
1887
|
-
function
|
|
1888
|
-
for (const
|
|
1889
|
-
|
|
2232
|
+
function L(y) {
|
|
2233
|
+
for (const p of e.keys())
|
|
2234
|
+
y.includes(p) || e.delete(p);
|
|
1890
2235
|
}
|
|
1891
2236
|
return {
|
|
1892
2237
|
getPrefetchProps: o,
|
|
1893
2238
|
setPrefetchProps: a,
|
|
1894
|
-
getProps:
|
|
2239
|
+
getProps: i,
|
|
1895
2240
|
setProps: s
|
|
1896
2241
|
};
|
|
1897
2242
|
}
|
|
1898
|
-
function
|
|
1899
|
-
const e =
|
|
2243
|
+
function _r() {
|
|
2244
|
+
const e = oe(Hr);
|
|
1900
2245
|
if (!e)
|
|
1901
|
-
throw new
|
|
2246
|
+
throw new me();
|
|
1902
2247
|
return e;
|
|
1903
2248
|
}
|
|
1904
|
-
const
|
|
2249
|
+
const Do = Yr(() => new Promise((e) => {
|
|
1905
2250
|
e({ default: { template: "foo" } });
|
|
1906
2251
|
}));
|
|
1907
|
-
function
|
|
1908
|
-
return e.name ===
|
|
2252
|
+
function St(e) {
|
|
2253
|
+
return e.name === Do.name && "__asyncLoader" in e;
|
|
1909
2254
|
}
|
|
1910
|
-
function
|
|
1911
|
-
|
|
2255
|
+
function At(e, t, r) {
|
|
2256
|
+
ee(e, (n, o) => {
|
|
1912
2257
|
n && n.addEventListener(t, r), o && o.removeEventListener(t, r);
|
|
1913
|
-
}, { immediate: !0 }),
|
|
2258
|
+
}, { immediate: !0 }), qe(() => {
|
|
1914
2259
|
e.value && e.value.removeEventListener(t, r);
|
|
1915
2260
|
});
|
|
1916
2261
|
}
|
|
1917
|
-
function
|
|
1918
|
-
const t = /* @__PURE__ */ new Map(), r =
|
|
1919
|
-
const
|
|
1920
|
-
o(
|
|
2262
|
+
function Fo(e) {
|
|
2263
|
+
const t = /* @__PURE__ */ new Map(), r = _e(), { getPrefetchProps: n, setPrefetchProps: o } = _r(), { isElementVisible: a } = Qn(r), s = () => {
|
|
2264
|
+
const u = Array.from(t.values()).reduce((m, E) => (Object.assign(m, E), m), {});
|
|
2265
|
+
o(u);
|
|
1921
2266
|
};
|
|
1922
|
-
|
|
1923
|
-
t.clear(),
|
|
1924
|
-
}, { immediate: !0 }),
|
|
1925
|
-
const { route:
|
|
1926
|
-
!
|
|
1927
|
-
}, { immediate: !0 }),
|
|
1928
|
-
function
|
|
1929
|
-
const { route:
|
|
1930
|
-
|
|
1931
|
-
}
|
|
1932
|
-
function u
|
|
1933
|
-
|
|
2267
|
+
ee(() => H(e), ({ route: u, ...m }) => {
|
|
2268
|
+
t.clear(), u && f("eager", u, m);
|
|
2269
|
+
}, { immediate: !0 }), ee(a, (u) => {
|
|
2270
|
+
const { route: m, ...E } = H(e);
|
|
2271
|
+
!m || !u || f("lazy", m, E);
|
|
2272
|
+
}, { immediate: !0 }), At(r, "focusin", i), At(r, "mouseover", i);
|
|
2273
|
+
function i() {
|
|
2274
|
+
const { route: u, ...m } = H(e);
|
|
2275
|
+
u && f("intent", u, m);
|
|
2276
|
+
}
|
|
2277
|
+
function f(u, m, E) {
|
|
2278
|
+
Mo(u, m, E), t.has(u) || t.set(u, n(u, m, E));
|
|
1934
2279
|
}
|
|
1935
2280
|
return {
|
|
1936
2281
|
element: r,
|
|
1937
2282
|
commit: s
|
|
1938
2283
|
};
|
|
1939
2284
|
}
|
|
1940
|
-
function
|
|
2285
|
+
function Mo(e, t, r) {
|
|
1941
2286
|
t.matches.forEach((n) => {
|
|
1942
|
-
|
|
2287
|
+
$r({
|
|
1943
2288
|
...r,
|
|
1944
2289
|
routePrefetch: n.prefetch
|
|
1945
|
-
}, "components") === e && (
|
|
1946
|
-
|
|
2290
|
+
}, "components") === e && (Yt(n) && St(n.component) && n.component.__asyncLoader(), Xt(n) && Object.values(n.components).forEach((a) => {
|
|
2291
|
+
St(a) && a.__asyncLoader();
|
|
1947
2292
|
}));
|
|
1948
2293
|
});
|
|
1949
2294
|
}
|
|
1950
|
-
function
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
const R = j(e);
|
|
1956
|
-
return typeof R != "string" ? R : M(R) ? n.find(R, j(r)) : n.resolve(R, j(t), j(r));
|
|
1957
|
-
}), a = N(() => {
|
|
2295
|
+
function To(e, t = {}, r = {}) {
|
|
2296
|
+
const n = Ge(), o = V(() => {
|
|
2297
|
+
const p = H(e);
|
|
2298
|
+
return typeof p != "string" ? p : T(p) ? n.find(p, H(r)) : n.resolve(p, H(t), H(r));
|
|
2299
|
+
}), a = V(() => {
|
|
1958
2300
|
if (o.value)
|
|
1959
2301
|
return o.value.href;
|
|
1960
|
-
const
|
|
1961
|
-
if (
|
|
1962
|
-
return
|
|
2302
|
+
const p = H(e);
|
|
2303
|
+
if (T(p))
|
|
2304
|
+
return p;
|
|
1963
2305
|
console.error(new Error("Failed to resolve route in RouterLink."));
|
|
1964
|
-
}), s =
|
|
1965
|
-
var
|
|
1966
|
-
return
|
|
1967
|
-
})),
|
|
1968
|
-
var
|
|
1969
|
-
return n.route.id === ((
|
|
1970
|
-
}),
|
|
1971
|
-
const
|
|
1972
|
-
return typeof
|
|
1973
|
-
}), { element:
|
|
2306
|
+
}), s = V(() => Sr(n.route) && n.route.matches.some((p) => {
|
|
2307
|
+
var g;
|
|
2308
|
+
return p.id === ((g = o.value) == null ? void 0 : g.id);
|
|
2309
|
+
})), i = V(() => {
|
|
2310
|
+
var p;
|
|
2311
|
+
return n.route.id === ((p = o.value) == null ? void 0 : p.id);
|
|
2312
|
+
}), f = V(() => !!a.value && n.isExternal(a.value)), u = V(() => {
|
|
2313
|
+
const p = H(e);
|
|
2314
|
+
return typeof p != "string" || T(p) ? H(t) : H(r);
|
|
2315
|
+
}), { element: m, commit: E } = Fo(() => ({
|
|
1974
2316
|
route: o.value,
|
|
1975
2317
|
routerPrefetch: n.prefetch,
|
|
1976
|
-
linkPrefetch:
|
|
1977
|
-
})),
|
|
1978
|
-
|
|
1979
|
-
const
|
|
1980
|
-
replace: (
|
|
1981
|
-
query:
|
|
1982
|
-
hash: (
|
|
1983
|
-
state: { ...
|
|
1984
|
-
},
|
|
1985
|
-
return
|
|
2318
|
+
linkPrefetch: u.value.prefetch
|
|
2319
|
+
})), L = (p) => {
|
|
2320
|
+
E();
|
|
2321
|
+
const g = {
|
|
2322
|
+
replace: (p == null ? void 0 : p.replace) ?? u.value.replace,
|
|
2323
|
+
query: ot(u.value.query, p == null ? void 0 : p.query),
|
|
2324
|
+
hash: (p == null ? void 0 : p.hash) ?? u.value.hash,
|
|
2325
|
+
state: { ...u.value.state, ...p == null ? void 0 : p.state }
|
|
2326
|
+
}, c = H(e);
|
|
2327
|
+
return T(c) || typeof c == "object" ? n.push(c, g) : n.push(c, H(t), g);
|
|
1986
2328
|
};
|
|
1987
2329
|
return {
|
|
1988
|
-
element:
|
|
2330
|
+
element: m,
|
|
1989
2331
|
route: o,
|
|
1990
2332
|
href: a,
|
|
1991
2333
|
isMatch: s,
|
|
1992
|
-
isExactMatch:
|
|
1993
|
-
isExternal:
|
|
1994
|
-
push:
|
|
1995
|
-
replace: (
|
|
2334
|
+
isExactMatch: i,
|
|
2335
|
+
isExternal: f,
|
|
2336
|
+
push: L,
|
|
2337
|
+
replace: (p) => L({ ...p, replace: !0 })
|
|
1996
2338
|
};
|
|
1997
2339
|
}
|
|
1998
|
-
const
|
|
2340
|
+
const Jo = ["href"], Wo = /* @__PURE__ */ de({
|
|
1999
2341
|
__name: "routerLink",
|
|
2000
2342
|
props: {
|
|
2001
2343
|
to: {},
|
|
@@ -2006,177 +2348,108 @@ const no = ["href"], oo = /* @__PURE__ */ ue({
|
|
|
2006
2348
|
state: {}
|
|
2007
2349
|
},
|
|
2008
2350
|
setup(e) {
|
|
2009
|
-
const t = e, r =
|
|
2010
|
-
const { to:
|
|
2011
|
-
return
|
|
2012
|
-
}), { element: s, isMatch:
|
|
2013
|
-
"router-link--match":
|
|
2014
|
-
"router-link--exact-match":
|
|
2351
|
+
const t = e, r = Ge(), n = V(() => L(t.to)), o = V(() => y(t.to)), a = V(() => {
|
|
2352
|
+
const { to: g, ...c } = t;
|
|
2353
|
+
return c;
|
|
2354
|
+
}), { element: s, isMatch: i, isExactMatch: f, isExternal: u, push: m } = To(() => typeof t.to == "function" ? t.to(r.resolve) : t.to, a), E = V(() => ({
|
|
2355
|
+
"router-link--match": i.value,
|
|
2356
|
+
"router-link--exact-match": f.value
|
|
2015
2357
|
}));
|
|
2016
|
-
function
|
|
2017
|
-
if (typeof
|
|
2018
|
-
const
|
|
2019
|
-
return
|
|
2358
|
+
function L(g) {
|
|
2359
|
+
if (typeof g == "function") {
|
|
2360
|
+
const c = g(r.resolve);
|
|
2361
|
+
return L(c);
|
|
2020
2362
|
}
|
|
2021
|
-
return
|
|
2363
|
+
return T(g) ? r.find(g) : g;
|
|
2022
2364
|
}
|
|
2023
|
-
function
|
|
2024
|
-
if (typeof
|
|
2025
|
-
const
|
|
2026
|
-
return
|
|
2365
|
+
function y(g) {
|
|
2366
|
+
if (typeof g == "function") {
|
|
2367
|
+
const c = g(r.resolve);
|
|
2368
|
+
return y(c);
|
|
2027
2369
|
}
|
|
2028
|
-
return
|
|
2370
|
+
return T(g) ? g : g == null ? void 0 : g.href;
|
|
2029
2371
|
}
|
|
2030
|
-
function
|
|
2031
|
-
|
|
2372
|
+
function p(g) {
|
|
2373
|
+
g.preventDefault(), m();
|
|
2032
2374
|
}
|
|
2033
|
-
return (
|
|
2375
|
+
return (g, c) => (Ut(), Xr("a", {
|
|
2034
2376
|
ref_key: "element",
|
|
2035
2377
|
ref: s,
|
|
2036
2378
|
href: o.value,
|
|
2037
|
-
class:
|
|
2038
|
-
onClick:
|
|
2379
|
+
class: en(["router-link", E.value]),
|
|
2380
|
+
onClick: p
|
|
2039
2381
|
}, [
|
|
2040
|
-
|
|
2041
|
-
], 10,
|
|
2042
|
-
}
|
|
2043
|
-
});
|
|
2044
|
-
function ao(e, t) {
|
|
2045
|
-
const r = De();
|
|
2046
|
-
function n() {
|
|
2047
|
-
if (!e)
|
|
2048
|
-
return;
|
|
2049
|
-
if (!nr(r.route, e, t))
|
|
2050
|
-
throw new Ar(e, r.route.name);
|
|
2051
|
-
}
|
|
2052
|
-
return le(r.route, n, { immediate: !0, deep: !0 }), r.route;
|
|
2053
|
-
}
|
|
2054
|
-
const or = Symbol();
|
|
2055
|
-
function et() {
|
|
2056
|
-
return ce(or, 0);
|
|
2057
|
-
}
|
|
2058
|
-
function so(e, t) {
|
|
2059
|
-
return ue({
|
|
2060
|
-
name: "PropsWrapper",
|
|
2061
|
-
expose: [],
|
|
2062
|
-
setup() {
|
|
2063
|
-
const r = t(), n = Rr();
|
|
2064
|
-
return () => r instanceof Error ? "" : er(r) ? n != null && n.suspense ? te(uo(e, r)) : te(co(e, r)) : te(e, r);
|
|
2065
|
-
}
|
|
2066
|
-
});
|
|
2067
|
-
}
|
|
2068
|
-
function co(e, t) {
|
|
2069
|
-
return ue({
|
|
2070
|
-
name: "AsyncPropsWrapper",
|
|
2071
|
-
expose: [],
|
|
2072
|
-
setup() {
|
|
2073
|
-
const r = We();
|
|
2074
|
-
return (async () => r.value = await t)(), () => r.value instanceof Error ? "" : r.value ? te(e, r.value) : "";
|
|
2075
|
-
}
|
|
2076
|
-
});
|
|
2077
|
-
}
|
|
2078
|
-
function uo(e, t) {
|
|
2079
|
-
return ue({
|
|
2080
|
-
name: "SuspenseAsyncPropsWrapper",
|
|
2081
|
-
expose: [],
|
|
2082
|
-
async setup() {
|
|
2083
|
-
const r = await t;
|
|
2084
|
-
return () => te(e, r);
|
|
2085
|
-
}
|
|
2086
|
-
});
|
|
2087
|
-
}
|
|
2088
|
-
const io = /* @__PURE__ */ ue({
|
|
2089
|
-
__name: "routerView",
|
|
2090
|
-
props: {
|
|
2091
|
-
name: { default: "default" }
|
|
2092
|
-
},
|
|
2093
|
-
setup(e) {
|
|
2094
|
-
const t = ao(), r = Tr(), n = et(), { getProps: o } = rr(), a = vr("RouterView", !0);
|
|
2095
|
-
yr(or, n + 1);
|
|
2096
|
-
const s = N(() => {
|
|
2097
|
-
if (r.value)
|
|
2098
|
-
return r.value.component;
|
|
2099
|
-
const c = t.matches.at(n);
|
|
2100
|
-
if (!c)
|
|
2101
|
-
return null;
|
|
2102
|
-
const h = f(c), m = o(c.id, e.name, t);
|
|
2103
|
-
return h ? m ? so(h, () => m) : h : null;
|
|
2104
|
-
});
|
|
2105
|
-
function f(c) {
|
|
2106
|
-
return u(c)[e.name];
|
|
2107
|
-
}
|
|
2108
|
-
function u(c) {
|
|
2109
|
-
return St(c) ? c.components : bt(c) ? { default: c.component } : typeof a == "string" ? {} : { default: a };
|
|
2110
|
-
}
|
|
2111
|
-
return (c, h) => s.value ? vt(c.$slots, "default", yt(gr({ key: 0 }, { route: fe(t), component: s.value, rejection: fe(r) })), () => [
|
|
2112
|
-
(Rt(), wr(Er(s.value)))
|
|
2113
|
-
]) : Pr("", !0);
|
|
2382
|
+
xt(g.$slots, "default", Lt(tn({ route: n.value, isMatch: ge(i), isExactMatch: ge(f), isExternal: ge(u) })))
|
|
2383
|
+
], 10, Jo));
|
|
2114
2384
|
}
|
|
2115
2385
|
});
|
|
2116
|
-
function
|
|
2117
|
-
const e =
|
|
2386
|
+
function qr() {
|
|
2387
|
+
const e = oe(hr);
|
|
2118
2388
|
if (!e)
|
|
2119
|
-
throw new
|
|
2389
|
+
throw new me();
|
|
2120
2390
|
return e;
|
|
2121
2391
|
}
|
|
2122
|
-
function
|
|
2392
|
+
function Or(e) {
|
|
2123
2393
|
return (t) => {
|
|
2124
|
-
const r =
|
|
2125
|
-
return
|
|
2394
|
+
const r = ct(), o = qr().addComponentBeforeRouteHook({ lifecycle: e, hook: t, depth: r - 1 });
|
|
2395
|
+
return qe(o), o;
|
|
2126
2396
|
};
|
|
2127
2397
|
}
|
|
2128
|
-
function
|
|
2398
|
+
function Ir(e) {
|
|
2129
2399
|
return (t) => {
|
|
2130
|
-
const r =
|
|
2131
|
-
return
|
|
2400
|
+
const r = ct(), o = qr().addComponentAfterRouteHook({ lifecycle: e, hook: t, depth: r - 1 });
|
|
2401
|
+
return qe(o), o;
|
|
2132
2402
|
};
|
|
2133
2403
|
}
|
|
2134
|
-
const
|
|
2135
|
-
function
|
|
2404
|
+
const ra = Or("onBeforeRouteLeave"), na = Or("onBeforeRouteUpdate"), oa = Ir("onAfterRouteLeave"), aa = Ir("onAfterRouteUpdate");
|
|
2405
|
+
function Zo(e) {
|
|
2136
2406
|
return ve(e) && typeof e.value == "string";
|
|
2137
2407
|
}
|
|
2138
|
-
function
|
|
2139
|
-
return
|
|
2408
|
+
function kt(e) {
|
|
2409
|
+
return Zo(e) ? e : Ur(e, {});
|
|
2140
2410
|
}
|
|
2141
|
-
function
|
|
2142
|
-
const t =
|
|
2411
|
+
function sa(e) {
|
|
2412
|
+
const t = et(), r = Cr(e.name), n = Nr(e.path), o = Vr(e.query), a = Br(e.hash), s = e.meta ?? {}, i = pn(e) ? kt(e.host) : kt(""), f = Ae({ id: t, meta: {}, state: {}, ...e }), u = {
|
|
2143
2413
|
id: t,
|
|
2144
|
-
matched:
|
|
2145
|
-
matches: [
|
|
2414
|
+
matched: f,
|
|
2415
|
+
matches: [f],
|
|
2146
2416
|
name: r,
|
|
2147
|
-
host:
|
|
2417
|
+
host: i,
|
|
2148
2418
|
path: n,
|
|
2149
2419
|
query: o,
|
|
2150
2420
|
hash: a,
|
|
2151
2421
|
meta: s,
|
|
2152
2422
|
depth: 1,
|
|
2153
2423
|
state: {}
|
|
2154
|
-
},
|
|
2155
|
-
return
|
|
2424
|
+
}, m = zt(e) ? er(e.parent, u) : u;
|
|
2425
|
+
return ye(m.path.params, m.query.params, m.host.params), m;
|
|
2156
2426
|
}
|
|
2157
2427
|
export {
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2428
|
+
rn as DuplicateParamsError,
|
|
2429
|
+
nn as MetaPropertyConflict,
|
|
2430
|
+
Wo as RouterLink,
|
|
2431
|
+
me as RouterNotInstalledError,
|
|
2432
|
+
xr as RouterView,
|
|
2433
|
+
on as UseRouteInvalidError,
|
|
2434
|
+
ea as arrayOf,
|
|
2435
|
+
Gt as asUrl,
|
|
2436
|
+
sa as createExternalRoute,
|
|
2437
|
+
bn as createParam,
|
|
2438
|
+
pe as createRoute,
|
|
2439
|
+
Yo as createRouter,
|
|
2440
|
+
Xo as createRouterPlugin,
|
|
2441
|
+
Sr as isRoute,
|
|
2442
|
+
T as isUrl,
|
|
2443
|
+
oa as onAfterRouteLeave,
|
|
2444
|
+
aa as onAfterRouteUpdate,
|
|
2445
|
+
ra as onBeforeRouteLeave,
|
|
2446
|
+
na as onBeforeRouteUpdate,
|
|
2447
|
+
Ze as path,
|
|
2448
|
+
Pt as query,
|
|
2449
|
+
ta as tupleOf,
|
|
2450
|
+
No as unionOf,
|
|
2451
|
+
To as useLink,
|
|
2452
|
+
Ar as useRoute,
|
|
2453
|
+
Ge as useRouter,
|
|
2454
|
+
zo as withDefault
|
|
2182
2455
|
};
|