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