@kitbag/router 0.3.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/kitbag-router.d.ts +793 -41
- package/dist/kitbag-router.js +770 -728
- package/dist/kitbag-router.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/kitbag-router.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
var we = (t, e, n) => e in t ?
|
|
3
|
-
var
|
|
4
|
-
import { inject as
|
|
5
|
-
class
|
|
1
|
+
var ve = Object.defineProperty;
|
|
2
|
+
var we = (t, e, n) => e in t ? ve(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var $ = (t, e, n) => (we(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
+
import { inject as ct, computed as H, toValue as ft, toRefs as Ee, reactive as Ot, watch as Pe, onUnmounted as _t, defineComponent as Y, openBlock as qt, createElementBlock as be, normalizeClass as Se, renderSlot as Dt, normalizeProps as Mt, guardReactiveProps as Tt, unref as tt, provide as ke, defineAsyncComponent as xe, createBlock as Ae, resolveDynamicComponent as Le, h as et, ref as Ue, markRaw as ht } from "vue";
|
|
5
|
+
class it extends Error {
|
|
6
6
|
/**
|
|
7
7
|
* Constructs a new DuplicateParamsError instance with a message indicating the problematic parameter.
|
|
8
8
|
* @param paramName - The name of the parameter that was duplicated.
|
|
@@ -11,7 +11,7 @@ class ut extends Error {
|
|
|
11
11
|
super(`Invalid Param "${e}": Router does not support multiple params by the same name. All param names must be unique.`);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
class
|
|
14
|
+
class mt extends Error {
|
|
15
15
|
constructor() {
|
|
16
16
|
super("Router not installed");
|
|
17
17
|
}
|
|
@@ -27,76 +27,84 @@ class Be extends Error {
|
|
|
27
27
|
super(`useRoute called with incorrect route. Given ${e}, expected ${n}`);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
const
|
|
31
|
-
function
|
|
32
|
-
const t =
|
|
30
|
+
const Wt = Symbol();
|
|
31
|
+
function Rt() {
|
|
32
|
+
const t = ct(Wt);
|
|
33
33
|
if (!t)
|
|
34
|
-
throw new
|
|
34
|
+
throw new mt();
|
|
35
35
|
return t;
|
|
36
36
|
}
|
|
37
|
-
class
|
|
37
|
+
class I extends Error {
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function T(t) {
|
|
40
40
|
return typeof t != "string" ? !1 : /^(https?:\/\/|\/).*/g.test(t);
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
const r =
|
|
44
|
-
if (
|
|
42
|
+
function He(t, e = {}, n = {}) {
|
|
43
|
+
const r = Rt(), o = H(() => ft(t)), a = H(() => ft(e)), s = H(() => ft(n)), c = H(() => {
|
|
44
|
+
if (T(o.value))
|
|
45
45
|
return o.value;
|
|
46
46
|
try {
|
|
47
47
|
return r.resolve(o.value, a.value, s.value);
|
|
48
|
-
} catch (
|
|
49
|
-
throw
|
|
48
|
+
} catch (d) {
|
|
49
|
+
throw d instanceof I && console.error(`Failed to resolve route "${o.value.toString()}" in RouterLink.`, d), d;
|
|
50
50
|
}
|
|
51
|
-
}), u =
|
|
51
|
+
}), u = H(() => r.find(c.value, s.value)), f = H(() => !!u.value && r.route.matches.includes(u.value.matched)), h = H(() => !!u.value && r.route.matched === u.value.matched);
|
|
52
52
|
return {
|
|
53
53
|
route: u,
|
|
54
54
|
href: c,
|
|
55
|
-
isMatch:
|
|
56
|
-
isExactMatch:
|
|
57
|
-
push: (
|
|
58
|
-
replace: (
|
|
55
|
+
isMatch: f,
|
|
56
|
+
isExactMatch: h,
|
|
57
|
+
push: (d) => r.push(c.value, {}, { ...s.value, ...d }),
|
|
58
|
+
replace: (d) => r.replace(c.value, {}, { ...s.value, ...d })
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
const
|
|
62
|
-
function
|
|
63
|
-
const t =
|
|
61
|
+
const Ft = Symbol();
|
|
62
|
+
function Ne() {
|
|
63
|
+
const t = ct(Ft);
|
|
64
64
|
if (!t)
|
|
65
|
-
throw new
|
|
65
|
+
throw new mt();
|
|
66
66
|
return t;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function It(t, e) {
|
|
69
69
|
return [t, e].filter((n) => !!n).join(".");
|
|
70
70
|
}
|
|
71
|
-
const
|
|
71
|
+
const Jt = Symbol("isRouterRouteSymbol");
|
|
72
72
|
function $e(t) {
|
|
73
|
-
return typeof t == "object" && t !== null &&
|
|
73
|
+
return typeof t == "object" && t !== null && Jt in t;
|
|
74
74
|
}
|
|
75
75
|
function je(t, e) {
|
|
76
|
-
function n(
|
|
77
|
-
if (typeof
|
|
78
|
-
const
|
|
76
|
+
function n(f, h, d) {
|
|
77
|
+
if (typeof f == "object") {
|
|
78
|
+
const p = {
|
|
79
79
|
...t.params,
|
|
80
|
-
...
|
|
80
|
+
...f
|
|
81
81
|
};
|
|
82
|
-
return e(t.key,
|
|
82
|
+
return e(t.key, p, h);
|
|
83
83
|
}
|
|
84
|
-
const
|
|
84
|
+
const b = {
|
|
85
85
|
...t.params,
|
|
86
|
-
[
|
|
86
|
+
[f]: h
|
|
87
87
|
};
|
|
88
|
-
return e(t.key,
|
|
88
|
+
return e(t.key, b, d);
|
|
89
89
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
90
|
+
const { matched: r, matches: o, key: a, query: s, params: c } = Ee(t), u = Ot({
|
|
91
|
+
matched: r,
|
|
92
|
+
matches: o,
|
|
93
|
+
query: s,
|
|
94
|
+
params: c,
|
|
95
|
+
key: a,
|
|
96
|
+
update: n,
|
|
97
|
+
[Jt]: !0
|
|
98
|
+
});
|
|
99
|
+
return new Proxy(u, {
|
|
100
|
+
get: (f, h, d) => h === "params" ? new Proxy(t.params, {
|
|
101
|
+
set(b, p, E) {
|
|
102
|
+
return n(p, E), !0;
|
|
95
103
|
}
|
|
96
|
-
}) : Reflect.get(
|
|
104
|
+
}) : Reflect.get(f, h, d)
|
|
97
105
|
});
|
|
98
106
|
}
|
|
99
|
-
function
|
|
107
|
+
function Ve(t, e, { exact: n } = {}) {
|
|
100
108
|
if (!$e(t))
|
|
101
109
|
return !1;
|
|
102
110
|
if (e === void 0)
|
|
@@ -110,7 +118,7 @@ function Ne(t, e, { exact: n } = {}) {
|
|
|
110
118
|
}
|
|
111
119
|
function Ce(t) {
|
|
112
120
|
return t.matches.map((n) => n.name).reduce((n, r) => {
|
|
113
|
-
const o = n.pop(), a = r ? [
|
|
121
|
+
const o = n.pop(), a = r ? [It(o, r)] : [];
|
|
114
122
|
return o ? [
|
|
115
123
|
...n,
|
|
116
124
|
o,
|
|
@@ -119,92 +127,92 @@ function Ce(t) {
|
|
|
119
127
|
}, []);
|
|
120
128
|
}
|
|
121
129
|
function Oe(t, { exact: e } = {}) {
|
|
122
|
-
const n =
|
|
130
|
+
const n = Rt();
|
|
123
131
|
function r() {
|
|
124
132
|
if (!t)
|
|
125
133
|
return;
|
|
126
|
-
if (!
|
|
134
|
+
if (!Ve(n.route, t, { exact: e }))
|
|
127
135
|
throw new Be(t, n.route.key);
|
|
128
136
|
}
|
|
129
|
-
return
|
|
137
|
+
return Pe(n.route, r, { immediate: !0, deep: !0 }), n.route;
|
|
130
138
|
}
|
|
131
|
-
const
|
|
132
|
-
function
|
|
133
|
-
return
|
|
139
|
+
const Kt = Symbol();
|
|
140
|
+
function yt() {
|
|
141
|
+
return ct(Kt, 0);
|
|
134
142
|
}
|
|
135
|
-
class
|
|
143
|
+
class nt {
|
|
136
144
|
constructor() {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
145
|
+
$(this, "onBeforeRouteEnter", /* @__PURE__ */ new Set());
|
|
146
|
+
$(this, "onBeforeRouteUpdate", /* @__PURE__ */ new Set());
|
|
147
|
+
$(this, "onBeforeRouteLeave", /* @__PURE__ */ new Set());
|
|
148
|
+
$(this, "onAfterRouteEnter", /* @__PURE__ */ new Set());
|
|
149
|
+
$(this, "onAfterRouteUpdate", /* @__PURE__ */ new Set());
|
|
150
|
+
$(this, "onAfterRouteLeave", /* @__PURE__ */ new Set());
|
|
143
151
|
}
|
|
144
152
|
}
|
|
145
|
-
class
|
|
153
|
+
class Ut extends Error {
|
|
146
154
|
}
|
|
147
|
-
class
|
|
155
|
+
class G extends Error {
|
|
148
156
|
constructor(n) {
|
|
149
157
|
super("Error occurred during a router push operation.");
|
|
150
|
-
|
|
158
|
+
$(this, "to");
|
|
151
159
|
this.to = n;
|
|
152
160
|
}
|
|
153
161
|
}
|
|
154
162
|
class lt extends Error {
|
|
155
163
|
constructor(n) {
|
|
156
164
|
super(`Routing action rejected: ${n}`);
|
|
157
|
-
|
|
165
|
+
$(this, "type");
|
|
158
166
|
this.type = n;
|
|
159
167
|
}
|
|
160
168
|
}
|
|
161
169
|
function F(t) {
|
|
162
170
|
return Array.isArray(t) ? t : [t];
|
|
163
171
|
}
|
|
164
|
-
function
|
|
165
|
-
const n = new
|
|
172
|
+
function _e(t, e) {
|
|
173
|
+
const n = new nt();
|
|
166
174
|
return t.matches.forEach((r, o) => {
|
|
167
175
|
r.onBeforeRouteEnter && gt(t, e, o) && F(r.onBeforeRouteEnter).forEach((a) => n.onBeforeRouteEnter.add(a)), r.onBeforeRouteUpdate && wt(t, e, o) && F(r.onBeforeRouteUpdate).forEach((a) => n.onBeforeRouteUpdate.add(a));
|
|
168
176
|
}), e.matches.forEach((r, o) => {
|
|
169
|
-
r.onBeforeRouteLeave &&
|
|
177
|
+
r.onBeforeRouteLeave && vt(t, e, o) && F(r.onBeforeRouteLeave).forEach((a) => n.onBeforeRouteLeave.add(a));
|
|
170
178
|
}), n;
|
|
171
179
|
}
|
|
172
|
-
function
|
|
173
|
-
const n = new
|
|
180
|
+
function qe(t, e) {
|
|
181
|
+
const n = new nt();
|
|
174
182
|
return t.matches.forEach((r, o) => {
|
|
175
183
|
r.onAfterRouteEnter && gt(t, e, o) && F(r.onAfterRouteEnter).forEach((a) => n.onAfterRouteEnter.add(a)), r.onAfterRouteUpdate && wt(t, e, o) && F(r.onAfterRouteUpdate).forEach((a) => n.onAfterRouteUpdate.add(a));
|
|
176
184
|
}), e.matches.forEach((r, o) => {
|
|
177
|
-
r.onAfterRouteLeave &&
|
|
185
|
+
r.onAfterRouteLeave && vt(t, e, o) && F(r.onAfterRouteLeave).forEach((a) => n.onAfterRouteLeave.add(a));
|
|
178
186
|
}), n;
|
|
179
187
|
}
|
|
180
|
-
function
|
|
188
|
+
function De() {
|
|
181
189
|
const t = (s) => {
|
|
182
190
|
throw new lt(s);
|
|
183
191
|
}, e = (...s) => {
|
|
184
|
-
throw new
|
|
192
|
+
throw new G(s);
|
|
185
193
|
}, n = (s, c, u) => {
|
|
186
|
-
if (
|
|
187
|
-
const
|
|
188
|
-
throw new
|
|
194
|
+
if (T(s)) {
|
|
195
|
+
const d = c ?? {};
|
|
196
|
+
throw new G([s, { ...d, replace: !0 }]);
|
|
189
197
|
}
|
|
190
|
-
const
|
|
191
|
-
throw new
|
|
198
|
+
const f = c, h = u ?? {};
|
|
199
|
+
throw new G([s, f, { ...h, replace: !0 }]);
|
|
192
200
|
}, r = () => {
|
|
193
|
-
throw new
|
|
201
|
+
throw new Ut();
|
|
194
202
|
};
|
|
195
203
|
async function o({ to: s, from: c, hooks: u }) {
|
|
196
|
-
const { global:
|
|
197
|
-
...
|
|
198
|
-
...
|
|
199
|
-
...
|
|
200
|
-
...
|
|
201
|
-
...
|
|
202
|
-
...
|
|
203
|
-
...
|
|
204
|
-
...
|
|
204
|
+
const { global: f, component: h } = u, d = _e(s, c), b = [
|
|
205
|
+
...f.onBeforeRouteEnter,
|
|
206
|
+
...d.onBeforeRouteEnter,
|
|
207
|
+
...f.onBeforeRouteUpdate,
|
|
208
|
+
...d.onBeforeRouteUpdate,
|
|
209
|
+
...h.onBeforeRouteUpdate,
|
|
210
|
+
...f.onBeforeRouteLeave,
|
|
211
|
+
...d.onBeforeRouteLeave,
|
|
212
|
+
...h.onBeforeRouteLeave
|
|
205
213
|
];
|
|
206
214
|
try {
|
|
207
|
-
const p =
|
|
215
|
+
const p = b.map((E) => E(s, {
|
|
208
216
|
from: c,
|
|
209
217
|
reject: t,
|
|
210
218
|
push: e,
|
|
@@ -213,7 +221,7 @@ function qe() {
|
|
|
213
221
|
}));
|
|
214
222
|
await Promise.all(p);
|
|
215
223
|
} catch (p) {
|
|
216
|
-
if (p instanceof
|
|
224
|
+
if (p instanceof G)
|
|
217
225
|
return {
|
|
218
226
|
status: "PUSH",
|
|
219
227
|
to: p.to
|
|
@@ -223,7 +231,7 @@ function qe() {
|
|
|
223
231
|
status: "REJECT",
|
|
224
232
|
type: p.type
|
|
225
233
|
};
|
|
226
|
-
if (p instanceof
|
|
234
|
+
if (p instanceof Ut)
|
|
227
235
|
return {
|
|
228
236
|
status: "ABORT"
|
|
229
237
|
};
|
|
@@ -234,19 +242,19 @@ function qe() {
|
|
|
234
242
|
};
|
|
235
243
|
}
|
|
236
244
|
async function a({ to: s, from: c, hooks: u }) {
|
|
237
|
-
const { global:
|
|
238
|
-
...
|
|
239
|
-
...
|
|
240
|
-
...
|
|
241
|
-
...
|
|
242
|
-
...
|
|
243
|
-
...
|
|
244
|
-
...
|
|
245
|
-
...
|
|
246
|
-
...
|
|
245
|
+
const { global: f, component: h } = u, d = qe(s, c), b = [
|
|
246
|
+
...h.onAfterRouteLeave,
|
|
247
|
+
...d.onAfterRouteLeave,
|
|
248
|
+
...f.onAfterRouteLeave,
|
|
249
|
+
...h.onAfterRouteUpdate,
|
|
250
|
+
...d.onAfterRouteUpdate,
|
|
251
|
+
...f.onAfterRouteUpdate,
|
|
252
|
+
...h.onAfterRouteEnter,
|
|
253
|
+
...d.onAfterRouteEnter,
|
|
254
|
+
...f.onAfterRouteEnter
|
|
247
255
|
];
|
|
248
256
|
try {
|
|
249
|
-
const p =
|
|
257
|
+
const p = b.map((E) => E(s, {
|
|
250
258
|
from: c,
|
|
251
259
|
reject: t,
|
|
252
260
|
push: e,
|
|
@@ -254,7 +262,7 @@ function qe() {
|
|
|
254
262
|
}));
|
|
255
263
|
await Promise.all(p);
|
|
256
264
|
} catch (p) {
|
|
257
|
-
if (p instanceof
|
|
265
|
+
if (p instanceof G)
|
|
258
266
|
return {
|
|
259
267
|
status: "PUSH",
|
|
260
268
|
to: p.to
|
|
@@ -278,11 +286,11 @@ function qe() {
|
|
|
278
286
|
const gt = (t, e, n) => {
|
|
279
287
|
const r = t.matches, o = (e == null ? void 0 : e.matches) ?? [];
|
|
280
288
|
return r.length < n || r[n] !== o[n];
|
|
281
|
-
},
|
|
289
|
+
}, vt = (t, e, n) => {
|
|
282
290
|
const r = t.matches, o = (e == null ? void 0 : e.matches) ?? [];
|
|
283
291
|
return r.length < n || r[n] !== o[n];
|
|
284
292
|
}, wt = (t, e, n) => t.matches[n] === (e == null ? void 0 : e.matches[n]);
|
|
285
|
-
function
|
|
293
|
+
function Bt(t) {
|
|
286
294
|
switch (t) {
|
|
287
295
|
case "onBeforeRouteEnter":
|
|
288
296
|
case "onAfterRouteEnter":
|
|
@@ -292,34 +300,34 @@ function Lt(t) {
|
|
|
292
300
|
return wt;
|
|
293
301
|
case "onBeforeRouteLeave":
|
|
294
302
|
case "onAfterRouteLeave":
|
|
295
|
-
return
|
|
303
|
+
return vt;
|
|
296
304
|
default:
|
|
297
305
|
throw new Error(`Switch is not exhaustive for lifecycle: ${t}`);
|
|
298
306
|
}
|
|
299
307
|
}
|
|
300
|
-
class
|
|
308
|
+
class Me {
|
|
301
309
|
constructor() {
|
|
302
|
-
|
|
303
|
-
|
|
310
|
+
$(this, "global", new nt());
|
|
311
|
+
$(this, "component", new nt());
|
|
304
312
|
}
|
|
305
313
|
addBeforeRouteHook({ lifecycle: e, timing: n, depth: r, hook: o }) {
|
|
306
|
-
const a =
|
|
307
|
-
if (a(u,
|
|
308
|
-
return o(u,
|
|
314
|
+
const a = Bt(e), s = this[n][e], c = (u, f) => {
|
|
315
|
+
if (a(u, f.from, r))
|
|
316
|
+
return o(u, f);
|
|
309
317
|
};
|
|
310
318
|
return s.add(c), () => s.delete(c);
|
|
311
319
|
}
|
|
312
320
|
addAfterRouteHook({ lifecycle: e, timing: n, depth: r, hook: o }) {
|
|
313
|
-
const a =
|
|
314
|
-
if (a(u,
|
|
315
|
-
return o(u,
|
|
321
|
+
const a = Bt(e), s = this[n][e], c = (u, f) => {
|
|
322
|
+
if (a(u, f.from, r))
|
|
323
|
+
return o(u, f);
|
|
316
324
|
};
|
|
317
325
|
return s.add(c), () => s.delete(c);
|
|
318
326
|
}
|
|
319
327
|
}
|
|
320
|
-
const
|
|
321
|
-
function
|
|
322
|
-
const t = new
|
|
328
|
+
const Qt = Symbol();
|
|
329
|
+
function Te() {
|
|
330
|
+
const t = new Me();
|
|
323
331
|
return {
|
|
324
332
|
onBeforeRouteEnter: (c) => t.addBeforeRouteHook({ lifecycle: "onBeforeRouteEnter", hook: c, timing: "global", depth: 0 }),
|
|
325
333
|
onBeforeRouteUpdate: (c) => t.addBeforeRouteHook({ lifecycle: "onBeforeRouteUpdate", hook: c, timing: "global", depth: 0 }),
|
|
@@ -330,25 +338,25 @@ function Me() {
|
|
|
330
338
|
hooks: t
|
|
331
339
|
};
|
|
332
340
|
}
|
|
333
|
-
function
|
|
334
|
-
const t =
|
|
341
|
+
function Gt() {
|
|
342
|
+
const t = ct(Qt);
|
|
335
343
|
if (!t)
|
|
336
|
-
throw new
|
|
344
|
+
throw new mt();
|
|
337
345
|
return t;
|
|
338
346
|
}
|
|
339
|
-
function
|
|
347
|
+
function zt(t) {
|
|
340
348
|
return (e) => {
|
|
341
|
-
const n =
|
|
342
|
-
return
|
|
349
|
+
const n = yt(), o = Gt().addBeforeRouteHook({ lifecycle: t, hook: e, depth: n, timing: "component" });
|
|
350
|
+
return _t(o), o;
|
|
343
351
|
};
|
|
344
352
|
}
|
|
345
|
-
function
|
|
353
|
+
function Et(t) {
|
|
346
354
|
return (e) => {
|
|
347
|
-
const n =
|
|
348
|
-
return
|
|
355
|
+
const n = yt(), o = Gt().addAfterRouteHook({ lifecycle: t, hook: e, depth: n, timing: "component" });
|
|
356
|
+
return _t(o), o;
|
|
349
357
|
};
|
|
350
358
|
}
|
|
351
|
-
const
|
|
359
|
+
const Jn = zt("onBeforeRouteUpdate"), Kn = zt("onBeforeRouteLeave"), Qn = Et("onAfterRouteEnter"), Gn = Et("onAfterRouteUpdate"), zn = Et("onAfterRouteLeave"), We = ["href"], Fe = /* @__PURE__ */ Y({
|
|
352
360
|
__name: "routerLink",
|
|
353
361
|
props: {
|
|
354
362
|
to: { type: [String, Function] },
|
|
@@ -356,75 +364,239 @@ const Fn = Kt("onBeforeRouteUpdate"), In = Kt("onBeforeRouteLeave"), Jn = vt("on
|
|
|
356
364
|
replace: { type: Boolean }
|
|
357
365
|
},
|
|
358
366
|
setup(t) {
|
|
359
|
-
const e = t, n =
|
|
360
|
-
const { to:
|
|
361
|
-
return
|
|
362
|
-
}), { href: a, isMatch: s, isExactMatch: c } =
|
|
367
|
+
const e = t, n = Rt(), r = H(() => T(e.to) ? e.to : e.to(n.resolve)), o = H(() => {
|
|
368
|
+
const { to: d, ...b } = e;
|
|
369
|
+
return b;
|
|
370
|
+
}), { href: a, isMatch: s, isExactMatch: c } = He(r), u = H(() => ({
|
|
363
371
|
"router-link--match": s.value,
|
|
364
372
|
"router-link--exact-match": c.value
|
|
365
|
-
})),
|
|
366
|
-
const { host:
|
|
367
|
-
return
|
|
373
|
+
})), f = H(() => {
|
|
374
|
+
const { host: d } = new URL(r.value, window.location.origin);
|
|
375
|
+
return d !== window.location.host;
|
|
368
376
|
});
|
|
369
|
-
function
|
|
370
|
-
|
|
377
|
+
function h(d) {
|
|
378
|
+
d.preventDefault(), n.push(a.value, o.value);
|
|
371
379
|
}
|
|
372
|
-
return (
|
|
380
|
+
return (d, b) => (qt(), be("a", {
|
|
373
381
|
href: r.value,
|
|
374
|
-
class:
|
|
375
|
-
onClick:
|
|
382
|
+
class: Se(["router-link", u.value]),
|
|
383
|
+
onClick: h
|
|
376
384
|
}, [
|
|
377
|
-
|
|
378
|
-
], 10,
|
|
385
|
+
Dt(d.$slots, "default", Mt(Tt({ resolved: r.value, isMatch: tt(s), isExactMatch: tt(c), isExternal: f.value })))
|
|
386
|
+
], 10, We));
|
|
379
387
|
}
|
|
380
388
|
});
|
|
381
|
-
function
|
|
389
|
+
function Yt(t) {
|
|
382
390
|
return "children" in t;
|
|
383
391
|
}
|
|
384
392
|
function Ie(t) {
|
|
385
|
-
return
|
|
393
|
+
return Yt(t) && !("component" in t) && !("components" in t);
|
|
386
394
|
}
|
|
387
395
|
function Je(t) {
|
|
388
396
|
return typeof t == "object" && t !== null && "component" in t;
|
|
389
397
|
}
|
|
390
|
-
function
|
|
398
|
+
function Ke(t) {
|
|
391
399
|
return typeof t == "object" && t !== null && "components" in t;
|
|
392
400
|
}
|
|
393
|
-
const
|
|
401
|
+
const Xt = /* @__PURE__ */ Y({
|
|
394
402
|
__name: "routerView",
|
|
395
403
|
props: {
|
|
396
404
|
name: {}
|
|
397
405
|
},
|
|
398
406
|
setup(t) {
|
|
399
|
-
const { name: e = "default" } = t, n = Oe(), r =
|
|
400
|
-
|
|
401
|
-
const a =
|
|
407
|
+
const { name: e = "default" } = t, n = Oe(), r = Ne(), o = yt();
|
|
408
|
+
ke(Kt, o + 1);
|
|
409
|
+
const a = H(() => {
|
|
402
410
|
if (r.value)
|
|
403
411
|
return r.value.component;
|
|
404
412
|
const c = n.matches.at(o);
|
|
405
413
|
if (!c)
|
|
406
414
|
return null;
|
|
407
|
-
const
|
|
408
|
-
return
|
|
415
|
+
const f = s(c)[e];
|
|
416
|
+
return f ? typeof f == "function" ? xe(f) : f : null;
|
|
409
417
|
});
|
|
410
418
|
function s(c) {
|
|
411
|
-
return
|
|
419
|
+
return Ke(c) ? c.components : Je(c) ? { default: c.component } : {};
|
|
412
420
|
}
|
|
413
|
-
return (c, u) =>
|
|
414
|
-
(
|
|
421
|
+
return (c, u) => Dt(c.$slots, "default", Mt(Tt({ route: tt(n), component: a.value, rejection: tt(r) })), () => [
|
|
422
|
+
(qt(), Ae(Le(a.value)))
|
|
415
423
|
]);
|
|
416
424
|
}
|
|
417
425
|
});
|
|
418
|
-
function
|
|
419
|
-
return
|
|
426
|
+
function Yn(t, e) {
|
|
427
|
+
return Y({
|
|
420
428
|
name: "PropsWrapper",
|
|
421
429
|
expose: [],
|
|
430
|
+
setup() {
|
|
431
|
+
const n = e();
|
|
432
|
+
return "then" in n ? () => et(Qe(t, n)) : () => et(t, n);
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
function Qe(t, e) {
|
|
437
|
+
return Y({
|
|
438
|
+
name: "AsyncPropsWrapper",
|
|
439
|
+
expose: [],
|
|
422
440
|
async setup() {
|
|
423
|
-
const n = await e
|
|
424
|
-
return () =>
|
|
441
|
+
const n = await e;
|
|
442
|
+
return () => et(t, n);
|
|
425
443
|
}
|
|
426
444
|
});
|
|
427
445
|
}
|
|
446
|
+
const Zt = Symbol();
|
|
447
|
+
function Pt(t) {
|
|
448
|
+
return Zt in t;
|
|
449
|
+
}
|
|
450
|
+
function Ge(t) {
|
|
451
|
+
return {
|
|
452
|
+
[Zt]: !0,
|
|
453
|
+
...oe(t)
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
const J = "[", X = "]";
|
|
457
|
+
function ze(t) {
|
|
458
|
+
return t !== String && t !== Boolean && t !== Number && t !== Date;
|
|
459
|
+
}
|
|
460
|
+
function Ye(t) {
|
|
461
|
+
return typeof t == "function" && ze(t);
|
|
462
|
+
}
|
|
463
|
+
function ut(t) {
|
|
464
|
+
return typeof t == "object" && "get" in t && typeof t.get == "function" && "set" in t && typeof t.set == "function";
|
|
465
|
+
}
|
|
466
|
+
function Xe(t) {
|
|
467
|
+
return ut(t) && t.defaultValue !== void 0;
|
|
468
|
+
}
|
|
469
|
+
function Xn(t, e) {
|
|
470
|
+
return oe(t, e);
|
|
471
|
+
}
|
|
472
|
+
function bt(t) {
|
|
473
|
+
return typeof t == "string" && t.length > 0;
|
|
474
|
+
}
|
|
475
|
+
function Ze(t, e) {
|
|
476
|
+
return t[e] ?? String;
|
|
477
|
+
}
|
|
478
|
+
const N = {
|
|
479
|
+
invalid: (t) => {
|
|
480
|
+
throw new I(t);
|
|
481
|
+
}
|
|
482
|
+
}, tn = {
|
|
483
|
+
get: (t) => t,
|
|
484
|
+
set: (t, { invalid: e }) => {
|
|
485
|
+
if (typeof t != "string")
|
|
486
|
+
throw e();
|
|
487
|
+
return t;
|
|
488
|
+
}
|
|
489
|
+
}, te = {
|
|
490
|
+
get: (t, { invalid: e }) => {
|
|
491
|
+
if (t === "true")
|
|
492
|
+
return !0;
|
|
493
|
+
if (t === "false")
|
|
494
|
+
return !1;
|
|
495
|
+
throw e();
|
|
496
|
+
},
|
|
497
|
+
set: (t, { invalid: e }) => {
|
|
498
|
+
if (typeof t != "boolean")
|
|
499
|
+
throw e();
|
|
500
|
+
return t.toString();
|
|
501
|
+
}
|
|
502
|
+
}, ee = {
|
|
503
|
+
get: (t, { invalid: e }) => {
|
|
504
|
+
const n = Number(t);
|
|
505
|
+
if (isNaN(n))
|
|
506
|
+
throw e();
|
|
507
|
+
return n;
|
|
508
|
+
},
|
|
509
|
+
set: (t, { invalid: e }) => {
|
|
510
|
+
if (typeof t != "number")
|
|
511
|
+
throw e();
|
|
512
|
+
return t.toString();
|
|
513
|
+
}
|
|
514
|
+
}, ne = {
|
|
515
|
+
get: (t, { invalid: e }) => {
|
|
516
|
+
const n = new Date(t);
|
|
517
|
+
if (isNaN(n.getTime()))
|
|
518
|
+
throw e();
|
|
519
|
+
return n;
|
|
520
|
+
},
|
|
521
|
+
set: (t, { invalid: e }) => {
|
|
522
|
+
if (typeof t != "object" || !(t instanceof Date))
|
|
523
|
+
throw e();
|
|
524
|
+
return t.toISOString();
|
|
525
|
+
}
|
|
526
|
+
}, re = {
|
|
527
|
+
get: (t, { invalid: e }) => {
|
|
528
|
+
try {
|
|
529
|
+
return JSON.parse(t);
|
|
530
|
+
} catch {
|
|
531
|
+
throw e();
|
|
532
|
+
}
|
|
533
|
+
},
|
|
534
|
+
set: (t, { invalid: e }) => {
|
|
535
|
+
try {
|
|
536
|
+
return JSON.stringify(t);
|
|
537
|
+
} catch {
|
|
538
|
+
throw e();
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
};
|
|
542
|
+
function St(t, e) {
|
|
543
|
+
if (t === void 0 || !bt(t)) {
|
|
544
|
+
if (Xe(e))
|
|
545
|
+
return e.defaultValue;
|
|
546
|
+
if (Pt(e))
|
|
547
|
+
return;
|
|
548
|
+
throw new I();
|
|
549
|
+
}
|
|
550
|
+
if (e === String)
|
|
551
|
+
return tn.get(t, N);
|
|
552
|
+
if (e === Boolean)
|
|
553
|
+
return te.get(t, N);
|
|
554
|
+
if (e === Number)
|
|
555
|
+
return ee.get(t, N);
|
|
556
|
+
if (e === Date)
|
|
557
|
+
return ne.get(t, N);
|
|
558
|
+
if (e === JSON)
|
|
559
|
+
return re.get(t, N);
|
|
560
|
+
if (Ye(e))
|
|
561
|
+
return e(t, N);
|
|
562
|
+
if (ut(e))
|
|
563
|
+
return e.get(t, N);
|
|
564
|
+
if (e instanceof RegExp) {
|
|
565
|
+
if (e.test(t))
|
|
566
|
+
return t;
|
|
567
|
+
throw new I();
|
|
568
|
+
}
|
|
569
|
+
return t;
|
|
570
|
+
}
|
|
571
|
+
function kt(t, e) {
|
|
572
|
+
if (t === void 0) {
|
|
573
|
+
if (Pt(e))
|
|
574
|
+
return "";
|
|
575
|
+
throw new I();
|
|
576
|
+
}
|
|
577
|
+
if (e === Boolean)
|
|
578
|
+
return te.set(t, N);
|
|
579
|
+
if (e === Number)
|
|
580
|
+
return ee.set(t, N);
|
|
581
|
+
if (e === Date)
|
|
582
|
+
return ne.set(t, N);
|
|
583
|
+
if (e === JSON)
|
|
584
|
+
return re.set(t, N);
|
|
585
|
+
if (ut(e))
|
|
586
|
+
return e.set(t, N);
|
|
587
|
+
try {
|
|
588
|
+
return t.toString();
|
|
589
|
+
} catch {
|
|
590
|
+
throw new I();
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
function oe(t, e) {
|
|
594
|
+
return ut(t) ? { ...t, defaultValue: e ?? t.defaultValue } : {
|
|
595
|
+
get: (n) => St(n, t),
|
|
596
|
+
set: (n) => kt(n, t),
|
|
597
|
+
defaultValue: e
|
|
598
|
+
};
|
|
599
|
+
}
|
|
428
600
|
function _() {
|
|
429
601
|
return _ = Object.assign ? Object.assign.bind() : function(t) {
|
|
430
602
|
for (var e = 1; e < arguments.length; e++) {
|
|
@@ -439,7 +611,7 @@ var L;
|
|
|
439
611
|
(function(t) {
|
|
440
612
|
t.Pop = "POP", t.Push = "PUSH", t.Replace = "REPLACE";
|
|
441
613
|
})(L || (L = {}));
|
|
442
|
-
var
|
|
614
|
+
var K = process.env.NODE_ENV !== "production" ? function(t) {
|
|
443
615
|
return Object.freeze(t);
|
|
444
616
|
} : function(t) {
|
|
445
617
|
return t;
|
|
@@ -453,18 +625,18 @@ function D(t, e) {
|
|
|
453
625
|
}
|
|
454
626
|
}
|
|
455
627
|
}
|
|
456
|
-
var
|
|
457
|
-
function
|
|
628
|
+
var rt = "beforeunload", en = "hashchange", ae = "popstate";
|
|
629
|
+
function Ht(t) {
|
|
458
630
|
t === void 0 && (t = {});
|
|
459
631
|
var e = t, n = e.window, r = n === void 0 ? document.defaultView : n, o = r.history;
|
|
460
632
|
function a() {
|
|
461
|
-
var
|
|
462
|
-
return [
|
|
633
|
+
var m = r.location, i = m.pathname, l = m.search, v = m.hash, w = o.state || {};
|
|
634
|
+
return [w.idx, K({
|
|
463
635
|
pathname: i,
|
|
464
|
-
search:
|
|
465
|
-
hash:
|
|
466
|
-
state:
|
|
467
|
-
key:
|
|
636
|
+
search: l,
|
|
637
|
+
hash: v,
|
|
638
|
+
state: w.usr || null,
|
|
639
|
+
key: w.key || "default"
|
|
468
640
|
})];
|
|
469
641
|
}
|
|
470
642
|
var s = null;
|
|
@@ -472,17 +644,17 @@ function Bt(t) {
|
|
|
472
644
|
if (s)
|
|
473
645
|
p.call(s), s = null;
|
|
474
646
|
else {
|
|
475
|
-
var
|
|
647
|
+
var m = L.Pop, i = a(), l = i[0], v = i[1];
|
|
476
648
|
if (p.length)
|
|
477
|
-
if (
|
|
478
|
-
var
|
|
479
|
-
|
|
480
|
-
action:
|
|
481
|
-
location:
|
|
649
|
+
if (l != null) {
|
|
650
|
+
var w = h - l;
|
|
651
|
+
w && (s = {
|
|
652
|
+
action: m,
|
|
653
|
+
location: v,
|
|
482
654
|
retry: function() {
|
|
483
|
-
|
|
655
|
+
P(w * -1);
|
|
484
656
|
}
|
|
485
|
-
},
|
|
657
|
+
}, P(w));
|
|
486
658
|
} else
|
|
487
659
|
process.env.NODE_ENV !== "production" && D(
|
|
488
660
|
!1,
|
|
@@ -492,117 +664,117 @@ function Bt(t) {
|
|
|
492
664
|
"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."
|
|
493
665
|
);
|
|
494
666
|
else
|
|
495
|
-
|
|
667
|
+
U(m);
|
|
496
668
|
}
|
|
497
669
|
}
|
|
498
|
-
r.addEventListener(
|
|
499
|
-
var u = L.Pop,
|
|
500
|
-
|
|
501
|
-
idx:
|
|
670
|
+
r.addEventListener(ae, c);
|
|
671
|
+
var u = L.Pop, f = a(), h = f[0], d = f[1], b = Q(), p = Q();
|
|
672
|
+
h == null && (h = 0, o.replaceState(_({}, o.state, {
|
|
673
|
+
idx: h
|
|
502
674
|
}), ""));
|
|
503
|
-
function
|
|
504
|
-
return typeof
|
|
675
|
+
function E(m) {
|
|
676
|
+
return typeof m == "string" ? m : M(m);
|
|
505
677
|
}
|
|
506
|
-
function
|
|
507
|
-
return i === void 0 && (i = null),
|
|
508
|
-
pathname:
|
|
678
|
+
function j(m, i) {
|
|
679
|
+
return i === void 0 && (i = null), K(_({
|
|
680
|
+
pathname: d.pathname,
|
|
509
681
|
hash: "",
|
|
510
682
|
search: ""
|
|
511
|
-
}, typeof
|
|
683
|
+
}, typeof m == "string" ? z(m) : m, {
|
|
512
684
|
state: i,
|
|
513
|
-
key:
|
|
685
|
+
key: at()
|
|
514
686
|
}));
|
|
515
687
|
}
|
|
516
|
-
function
|
|
688
|
+
function V(m, i) {
|
|
517
689
|
return [{
|
|
518
|
-
usr:
|
|
519
|
-
key:
|
|
690
|
+
usr: m.state,
|
|
691
|
+
key: m.key,
|
|
520
692
|
idx: i
|
|
521
|
-
},
|
|
693
|
+
}, E(m)];
|
|
522
694
|
}
|
|
523
|
-
function
|
|
695
|
+
function B(m, i, l) {
|
|
524
696
|
return !p.length || (p.call({
|
|
525
|
-
action:
|
|
697
|
+
action: m,
|
|
526
698
|
location: i,
|
|
527
|
-
retry:
|
|
699
|
+
retry: l
|
|
528
700
|
}), !1);
|
|
529
701
|
}
|
|
530
|
-
function
|
|
531
|
-
u =
|
|
702
|
+
function U(m) {
|
|
703
|
+
u = m;
|
|
532
704
|
var i = a();
|
|
533
|
-
|
|
705
|
+
h = i[0], d = i[1], b.call({
|
|
534
706
|
action: u,
|
|
535
|
-
location:
|
|
707
|
+
location: d
|
|
536
708
|
});
|
|
537
709
|
}
|
|
538
|
-
function
|
|
539
|
-
var
|
|
540
|
-
function
|
|
541
|
-
|
|
710
|
+
function R(m, i) {
|
|
711
|
+
var l = L.Push, v = j(m, i);
|
|
712
|
+
function w() {
|
|
713
|
+
R(m, i);
|
|
542
714
|
}
|
|
543
|
-
if (
|
|
544
|
-
var
|
|
715
|
+
if (B(l, v, w)) {
|
|
716
|
+
var x = V(v, h + 1), y = x[0], k = x[1];
|
|
545
717
|
try {
|
|
546
|
-
o.pushState(
|
|
718
|
+
o.pushState(y, "", k);
|
|
547
719
|
} catch {
|
|
548
|
-
r.location.assign(
|
|
720
|
+
r.location.assign(k);
|
|
549
721
|
}
|
|
550
|
-
|
|
722
|
+
U(l);
|
|
551
723
|
}
|
|
552
724
|
}
|
|
553
|
-
function
|
|
554
|
-
var
|
|
555
|
-
function
|
|
556
|
-
|
|
725
|
+
function g(m, i) {
|
|
726
|
+
var l = L.Replace, v = j(m, i);
|
|
727
|
+
function w() {
|
|
728
|
+
g(m, i);
|
|
557
729
|
}
|
|
558
|
-
if (
|
|
559
|
-
var
|
|
560
|
-
o.replaceState(
|
|
730
|
+
if (B(l, v, w)) {
|
|
731
|
+
var x = V(v, h), y = x[0], k = x[1];
|
|
732
|
+
o.replaceState(y, "", k), U(l);
|
|
561
733
|
}
|
|
562
734
|
}
|
|
563
|
-
function
|
|
564
|
-
o.go(
|
|
735
|
+
function P(m) {
|
|
736
|
+
o.go(m);
|
|
565
737
|
}
|
|
566
|
-
var
|
|
738
|
+
var S = {
|
|
567
739
|
get action() {
|
|
568
740
|
return u;
|
|
569
741
|
},
|
|
570
742
|
get location() {
|
|
571
|
-
return
|
|
743
|
+
return d;
|
|
572
744
|
},
|
|
573
|
-
createHref:
|
|
574
|
-
push:
|
|
575
|
-
replace:
|
|
576
|
-
go:
|
|
745
|
+
createHref: E,
|
|
746
|
+
push: R,
|
|
747
|
+
replace: g,
|
|
748
|
+
go: P,
|
|
577
749
|
back: function() {
|
|
578
|
-
|
|
750
|
+
P(-1);
|
|
579
751
|
},
|
|
580
752
|
forward: function() {
|
|
581
|
-
|
|
753
|
+
P(1);
|
|
582
754
|
},
|
|
583
755
|
listen: function(i) {
|
|
584
|
-
return
|
|
756
|
+
return b.push(i);
|
|
585
757
|
},
|
|
586
758
|
block: function(i) {
|
|
587
|
-
var
|
|
588
|
-
return p.length === 1 && r.addEventListener(
|
|
589
|
-
|
|
759
|
+
var l = p.push(i);
|
|
760
|
+
return p.length === 1 && r.addEventListener(rt, ot), function() {
|
|
761
|
+
l(), p.length || r.removeEventListener(rt, ot);
|
|
590
762
|
};
|
|
591
763
|
}
|
|
592
764
|
};
|
|
593
|
-
return
|
|
765
|
+
return S;
|
|
594
766
|
}
|
|
595
|
-
function
|
|
767
|
+
function nn(t) {
|
|
596
768
|
t === void 0 && (t = {});
|
|
597
769
|
var e = t, n = e.window, r = n === void 0 ? document.defaultView : n, o = r.history;
|
|
598
770
|
function a() {
|
|
599
|
-
var i = z(r.location.hash.substr(1)),
|
|
600
|
-
return [
|
|
601
|
-
pathname:
|
|
602
|
-
search:
|
|
603
|
-
hash:
|
|
604
|
-
state:
|
|
605
|
-
key:
|
|
771
|
+
var i = z(r.location.hash.substr(1)), l = i.pathname, v = l === void 0 ? "/" : l, w = i.search, x = w === void 0 ? "" : w, y = i.hash, k = y === void 0 ? "" : y, A = o.state || {};
|
|
772
|
+
return [A.idx, K({
|
|
773
|
+
pathname: v,
|
|
774
|
+
search: x,
|
|
775
|
+
hash: k,
|
|
776
|
+
state: A.usr || null,
|
|
777
|
+
key: A.key || "default"
|
|
606
778
|
})];
|
|
607
779
|
}
|
|
608
780
|
var s = null;
|
|
@@ -610,17 +782,17 @@ function Qe(t) {
|
|
|
610
782
|
if (s)
|
|
611
783
|
p.call(s), s = null;
|
|
612
784
|
else {
|
|
613
|
-
var i = L.Pop,
|
|
785
|
+
var i = L.Pop, l = a(), v = l[0], w = l[1];
|
|
614
786
|
if (p.length)
|
|
615
|
-
if (
|
|
616
|
-
var
|
|
617
|
-
|
|
787
|
+
if (v != null) {
|
|
788
|
+
var x = h - v;
|
|
789
|
+
x && (s = {
|
|
618
790
|
action: i,
|
|
619
|
-
location:
|
|
791
|
+
location: w,
|
|
620
792
|
retry: function() {
|
|
621
|
-
|
|
793
|
+
S(x * -1);
|
|
622
794
|
}
|
|
623
|
-
},
|
|
795
|
+
}, S(x));
|
|
624
796
|
} else
|
|
625
797
|
process.env.NODE_ENV !== "production" && D(
|
|
626
798
|
!1,
|
|
@@ -630,177 +802,177 @@ function Qe(t) {
|
|
|
630
802
|
"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."
|
|
631
803
|
);
|
|
632
804
|
else
|
|
633
|
-
|
|
805
|
+
R(i);
|
|
634
806
|
}
|
|
635
807
|
}
|
|
636
|
-
r.addEventListener(
|
|
637
|
-
var i = a(),
|
|
638
|
-
M(
|
|
808
|
+
r.addEventListener(ae, c), r.addEventListener(en, function() {
|
|
809
|
+
var i = a(), l = i[1];
|
|
810
|
+
M(l) !== M(d) && c();
|
|
639
811
|
});
|
|
640
|
-
var u = L.Pop,
|
|
641
|
-
|
|
642
|
-
idx:
|
|
812
|
+
var u = L.Pop, f = a(), h = f[0], d = f[1], b = Q(), p = Q();
|
|
813
|
+
h == null && (h = 0, o.replaceState(_({}, o.state, {
|
|
814
|
+
idx: h
|
|
643
815
|
}), ""));
|
|
644
|
-
function
|
|
645
|
-
var i = document.querySelector("base"),
|
|
816
|
+
function E() {
|
|
817
|
+
var i = document.querySelector("base"), l = "";
|
|
646
818
|
if (i && i.getAttribute("href")) {
|
|
647
|
-
var
|
|
648
|
-
|
|
819
|
+
var v = r.location.href, w = v.indexOf("#");
|
|
820
|
+
l = w === -1 ? v : v.slice(0, w);
|
|
649
821
|
}
|
|
650
|
-
return
|
|
822
|
+
return l;
|
|
651
823
|
}
|
|
652
|
-
function
|
|
653
|
-
return
|
|
824
|
+
function j(i) {
|
|
825
|
+
return E() + "#" + (typeof i == "string" ? i : M(i));
|
|
654
826
|
}
|
|
655
|
-
function
|
|
656
|
-
return
|
|
657
|
-
pathname:
|
|
827
|
+
function V(i, l) {
|
|
828
|
+
return l === void 0 && (l = null), K(_({
|
|
829
|
+
pathname: d.pathname,
|
|
658
830
|
hash: "",
|
|
659
831
|
search: ""
|
|
660
832
|
}, typeof i == "string" ? z(i) : i, {
|
|
661
|
-
state:
|
|
662
|
-
key:
|
|
833
|
+
state: l,
|
|
834
|
+
key: at()
|
|
663
835
|
}));
|
|
664
836
|
}
|
|
665
|
-
function
|
|
837
|
+
function B(i, l) {
|
|
666
838
|
return [{
|
|
667
839
|
usr: i.state,
|
|
668
840
|
key: i.key,
|
|
669
|
-
idx:
|
|
670
|
-
},
|
|
841
|
+
idx: l
|
|
842
|
+
}, j(i)];
|
|
671
843
|
}
|
|
672
|
-
function
|
|
844
|
+
function U(i, l, v) {
|
|
673
845
|
return !p.length || (p.call({
|
|
674
846
|
action: i,
|
|
675
|
-
location:
|
|
676
|
-
retry:
|
|
847
|
+
location: l,
|
|
848
|
+
retry: v
|
|
677
849
|
}), !1);
|
|
678
850
|
}
|
|
679
|
-
function
|
|
851
|
+
function R(i) {
|
|
680
852
|
u = i;
|
|
681
|
-
var
|
|
682
|
-
|
|
853
|
+
var l = a();
|
|
854
|
+
h = l[0], d = l[1], b.call({
|
|
683
855
|
action: u,
|
|
684
|
-
location:
|
|
856
|
+
location: d
|
|
685
857
|
});
|
|
686
858
|
}
|
|
687
|
-
function
|
|
688
|
-
var
|
|
689
|
-
function
|
|
690
|
-
|
|
859
|
+
function g(i, l) {
|
|
860
|
+
var v = L.Push, w = V(i, l);
|
|
861
|
+
function x() {
|
|
862
|
+
g(i, l);
|
|
691
863
|
}
|
|
692
|
-
if (process.env.NODE_ENV !== "production" && D(
|
|
693
|
-
var
|
|
864
|
+
if (process.env.NODE_ENV !== "production" && D(w.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(i) + ")"), U(v, w, x)) {
|
|
865
|
+
var y = B(w, h + 1), k = y[0], A = y[1];
|
|
694
866
|
try {
|
|
695
|
-
o.pushState(
|
|
867
|
+
o.pushState(k, "", A);
|
|
696
868
|
} catch {
|
|
697
|
-
r.location.assign(
|
|
869
|
+
r.location.assign(A);
|
|
698
870
|
}
|
|
699
|
-
|
|
871
|
+
R(v);
|
|
700
872
|
}
|
|
701
873
|
}
|
|
702
|
-
function
|
|
703
|
-
var
|
|
704
|
-
function
|
|
705
|
-
|
|
874
|
+
function P(i, l) {
|
|
875
|
+
var v = L.Replace, w = V(i, l);
|
|
876
|
+
function x() {
|
|
877
|
+
P(i, l);
|
|
706
878
|
}
|
|
707
|
-
if (process.env.NODE_ENV !== "production" && D(
|
|
708
|
-
var
|
|
709
|
-
o.replaceState(
|
|
879
|
+
if (process.env.NODE_ENV !== "production" && D(w.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(i) + ")"), U(v, w, x)) {
|
|
880
|
+
var y = B(w, h), k = y[0], A = y[1];
|
|
881
|
+
o.replaceState(k, "", A), R(v);
|
|
710
882
|
}
|
|
711
883
|
}
|
|
712
|
-
function
|
|
884
|
+
function S(i) {
|
|
713
885
|
o.go(i);
|
|
714
886
|
}
|
|
715
|
-
var
|
|
887
|
+
var m = {
|
|
716
888
|
get action() {
|
|
717
889
|
return u;
|
|
718
890
|
},
|
|
719
891
|
get location() {
|
|
720
|
-
return
|
|
892
|
+
return d;
|
|
721
893
|
},
|
|
722
|
-
createHref:
|
|
723
|
-
push:
|
|
724
|
-
replace:
|
|
725
|
-
go:
|
|
894
|
+
createHref: j,
|
|
895
|
+
push: g,
|
|
896
|
+
replace: P,
|
|
897
|
+
go: S,
|
|
726
898
|
back: function() {
|
|
727
|
-
|
|
899
|
+
S(-1);
|
|
728
900
|
},
|
|
729
901
|
forward: function() {
|
|
730
|
-
|
|
902
|
+
S(1);
|
|
731
903
|
},
|
|
732
|
-
listen: function(
|
|
733
|
-
return
|
|
904
|
+
listen: function(l) {
|
|
905
|
+
return b.push(l);
|
|
734
906
|
},
|
|
735
|
-
block: function(
|
|
736
|
-
var
|
|
737
|
-
return p.length === 1 && r.addEventListener(
|
|
738
|
-
|
|
907
|
+
block: function(l) {
|
|
908
|
+
var v = p.push(l);
|
|
909
|
+
return p.length === 1 && r.addEventListener(rt, ot), function() {
|
|
910
|
+
v(), p.length || r.removeEventListener(rt, ot);
|
|
739
911
|
};
|
|
740
912
|
}
|
|
741
913
|
};
|
|
742
|
-
return
|
|
914
|
+
return m;
|
|
743
915
|
}
|
|
744
|
-
function
|
|
916
|
+
function Nt(t) {
|
|
745
917
|
t === void 0 && (t = {});
|
|
746
|
-
var e = t, n = e.initialEntries, r = n === void 0 ? ["/"] : n, o = e.initialIndex, a = r.map(function(
|
|
747
|
-
var
|
|
918
|
+
var e = t, n = e.initialEntries, r = n === void 0 ? ["/"] : n, o = e.initialIndex, a = r.map(function(R) {
|
|
919
|
+
var g = K(_({
|
|
748
920
|
pathname: "/",
|
|
749
921
|
search: "",
|
|
750
922
|
hash: "",
|
|
751
923
|
state: null,
|
|
752
|
-
key:
|
|
753
|
-
}, typeof
|
|
754
|
-
return process.env.NODE_ENV !== "production" && D(
|
|
755
|
-
}), s =
|
|
756
|
-
function
|
|
757
|
-
return typeof
|
|
758
|
-
}
|
|
759
|
-
function
|
|
760
|
-
return
|
|
924
|
+
key: at()
|
|
925
|
+
}, typeof R == "string" ? z(R) : R));
|
|
926
|
+
return process.env.NODE_ENV !== "production" && D(g.pathname.charAt(0) === "/", "Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: " + JSON.stringify(R) + ")"), g;
|
|
927
|
+
}), s = $t(o ?? a.length - 1, 0, a.length - 1), c = L.Pop, u = a[s], f = Q(), h = Q();
|
|
928
|
+
function d(R) {
|
|
929
|
+
return typeof R == "string" ? R : M(R);
|
|
930
|
+
}
|
|
931
|
+
function b(R, g) {
|
|
932
|
+
return g === void 0 && (g = null), K(_({
|
|
761
933
|
pathname: u.pathname,
|
|
762
934
|
search: "",
|
|
763
935
|
hash: ""
|
|
764
|
-
}, typeof
|
|
765
|
-
state:
|
|
766
|
-
key:
|
|
936
|
+
}, typeof R == "string" ? z(R) : R, {
|
|
937
|
+
state: g,
|
|
938
|
+
key: at()
|
|
767
939
|
}));
|
|
768
940
|
}
|
|
769
|
-
function p(
|
|
770
|
-
return !
|
|
771
|
-
action:
|
|
772
|
-
location:
|
|
773
|
-
retry:
|
|
941
|
+
function p(R, g, P) {
|
|
942
|
+
return !h.length || (h.call({
|
|
943
|
+
action: R,
|
|
944
|
+
location: g,
|
|
945
|
+
retry: P
|
|
774
946
|
}), !1);
|
|
775
947
|
}
|
|
776
|
-
function
|
|
777
|
-
c =
|
|
948
|
+
function E(R, g) {
|
|
949
|
+
c = R, u = g, f.call({
|
|
778
950
|
action: c,
|
|
779
951
|
location: u
|
|
780
952
|
});
|
|
781
953
|
}
|
|
782
|
-
function
|
|
783
|
-
var
|
|
784
|
-
function
|
|
785
|
-
|
|
954
|
+
function j(R, g) {
|
|
955
|
+
var P = L.Push, S = b(R, g);
|
|
956
|
+
function m() {
|
|
957
|
+
j(R, g);
|
|
786
958
|
}
|
|
787
|
-
process.env.NODE_ENV !== "production" && D(u.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.push(" + JSON.stringify(
|
|
959
|
+
process.env.NODE_ENV !== "production" && D(u.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.push(" + JSON.stringify(R) + ")"), p(P, S, m) && (s += 1, a.splice(s, a.length, S), E(P, S));
|
|
788
960
|
}
|
|
789
|
-
function
|
|
790
|
-
var
|
|
791
|
-
function
|
|
792
|
-
|
|
961
|
+
function V(R, g) {
|
|
962
|
+
var P = L.Replace, S = b(R, g);
|
|
963
|
+
function m() {
|
|
964
|
+
V(R, g);
|
|
793
965
|
}
|
|
794
|
-
process.env.NODE_ENV !== "production" && D(u.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.replace(" + JSON.stringify(
|
|
966
|
+
process.env.NODE_ENV !== "production" && D(u.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.replace(" + JSON.stringify(R) + ")"), p(P, S, m) && (a[s] = S, E(P, S));
|
|
795
967
|
}
|
|
796
|
-
function
|
|
797
|
-
var
|
|
798
|
-
function
|
|
799
|
-
|
|
968
|
+
function B(R) {
|
|
969
|
+
var g = $t(s + R, 0, a.length - 1), P = L.Pop, S = a[g];
|
|
970
|
+
function m() {
|
|
971
|
+
B(R);
|
|
800
972
|
}
|
|
801
|
-
p(
|
|
973
|
+
p(P, S, m) && (s = g, E(P, S));
|
|
802
974
|
}
|
|
803
|
-
var
|
|
975
|
+
var U = {
|
|
804
976
|
get index() {
|
|
805
977
|
return s;
|
|
806
978
|
},
|
|
@@ -810,32 +982,32 @@ function Ut(t) {
|
|
|
810
982
|
get location() {
|
|
811
983
|
return u;
|
|
812
984
|
},
|
|
813
|
-
createHref:
|
|
814
|
-
push:
|
|
815
|
-
replace:
|
|
816
|
-
go:
|
|
985
|
+
createHref: d,
|
|
986
|
+
push: j,
|
|
987
|
+
replace: V,
|
|
988
|
+
go: B,
|
|
817
989
|
back: function() {
|
|
818
|
-
|
|
990
|
+
B(-1);
|
|
819
991
|
},
|
|
820
992
|
forward: function() {
|
|
821
|
-
|
|
993
|
+
B(1);
|
|
822
994
|
},
|
|
823
|
-
listen: function(
|
|
824
|
-
return
|
|
995
|
+
listen: function(g) {
|
|
996
|
+
return f.push(g);
|
|
825
997
|
},
|
|
826
|
-
block: function(
|
|
827
|
-
return
|
|
998
|
+
block: function(g) {
|
|
999
|
+
return h.push(g);
|
|
828
1000
|
}
|
|
829
1001
|
};
|
|
830
|
-
return
|
|
1002
|
+
return U;
|
|
831
1003
|
}
|
|
832
|
-
function
|
|
1004
|
+
function $t(t, e, n) {
|
|
833
1005
|
return Math.min(Math.max(t, e), n);
|
|
834
1006
|
}
|
|
835
|
-
function
|
|
1007
|
+
function ot(t) {
|
|
836
1008
|
t.preventDefault(), t.returnValue = "";
|
|
837
1009
|
}
|
|
838
|
-
function
|
|
1010
|
+
function Q() {
|
|
839
1011
|
var t = [];
|
|
840
1012
|
return {
|
|
841
1013
|
get length() {
|
|
@@ -855,7 +1027,7 @@ function W() {
|
|
|
855
1027
|
}
|
|
856
1028
|
};
|
|
857
1029
|
}
|
|
858
|
-
function
|
|
1030
|
+
function at() {
|
|
859
1031
|
return Math.random().toString(36).substr(2, 8);
|
|
860
1032
|
}
|
|
861
1033
|
function M(t) {
|
|
@@ -872,222 +1044,84 @@ function z(t) {
|
|
|
872
1044
|
}
|
|
873
1045
|
return e;
|
|
874
1046
|
}
|
|
875
|
-
function
|
|
876
|
-
const n =
|
|
1047
|
+
function rn(t, e) {
|
|
1048
|
+
const n = Ot({ ...t }), r = (s) => {
|
|
877
1049
|
Object.assign(n, { ...s });
|
|
878
|
-
}, o =
|
|
1050
|
+
}, o = n, a = je(o, e);
|
|
879
1051
|
return {
|
|
880
1052
|
currentRoute: o,
|
|
881
1053
|
routerRoute: a,
|
|
882
1054
|
updateRoute: r
|
|
883
1055
|
};
|
|
884
1056
|
}
|
|
885
|
-
class
|
|
1057
|
+
class on extends Error {
|
|
886
1058
|
constructor(e) {
|
|
887
1059
|
super(`Route disabled: "${e}"`);
|
|
888
1060
|
}
|
|
889
1061
|
}
|
|
890
|
-
class
|
|
1062
|
+
class an extends Error {
|
|
891
1063
|
constructor(e) {
|
|
892
1064
|
super(`Route not found: "${e}"`);
|
|
893
1065
|
}
|
|
894
1066
|
}
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
return t !== String && t !== Boolean && t !== Number && t !== Date;
|
|
898
|
-
}
|
|
899
|
-
function Ze(t) {
|
|
900
|
-
return typeof t == "function" && Xe(t);
|
|
901
|
-
}
|
|
902
|
-
function Yt(t) {
|
|
903
|
-
return typeof t == "object" && "get" in t && typeof t.get == "function" && "set" in t && typeof t.set == "function";
|
|
904
|
-
}
|
|
905
|
-
function Et(t) {
|
|
906
|
-
return typeof t == "string" && t.length > 0;
|
|
907
|
-
}
|
|
908
|
-
function tn(t, e) {
|
|
909
|
-
return t[e] ?? String;
|
|
910
|
-
}
|
|
911
|
-
const Xt = Symbol();
|
|
912
|
-
function Zt(t) {
|
|
913
|
-
return Xt in t;
|
|
914
|
-
}
|
|
915
|
-
function en(t) {
|
|
916
|
-
return {
|
|
917
|
-
[Xt]: !0,
|
|
918
|
-
get: (e) => {
|
|
919
|
-
if (Et(e))
|
|
920
|
-
return bt(e, t);
|
|
921
|
-
},
|
|
922
|
-
set: (e) => e === void 0 ? "" : Pt(e, t)
|
|
923
|
-
};
|
|
924
|
-
}
|
|
925
|
-
const U = {
|
|
926
|
-
invalid: (t) => {
|
|
927
|
-
throw new G(t);
|
|
928
|
-
}
|
|
929
|
-
}, nn = {
|
|
930
|
-
get: (t) => t,
|
|
931
|
-
set: (t, { invalid: e }) => {
|
|
932
|
-
if (typeof t != "string")
|
|
933
|
-
throw e();
|
|
934
|
-
return t;
|
|
935
|
-
}
|
|
936
|
-
}, te = {
|
|
937
|
-
get: (t, { invalid: e }) => {
|
|
938
|
-
if (t === "true")
|
|
939
|
-
return !0;
|
|
940
|
-
if (t === "false")
|
|
941
|
-
return !1;
|
|
942
|
-
throw e();
|
|
943
|
-
},
|
|
944
|
-
set: (t, { invalid: e }) => {
|
|
945
|
-
if (typeof t != "boolean")
|
|
946
|
-
throw e();
|
|
947
|
-
return t.toString();
|
|
948
|
-
}
|
|
949
|
-
}, ee = {
|
|
950
|
-
get: (t, { invalid: e }) => {
|
|
951
|
-
const n = Number(t);
|
|
952
|
-
if (isNaN(n))
|
|
953
|
-
throw e();
|
|
954
|
-
return n;
|
|
955
|
-
},
|
|
956
|
-
set: (t, { invalid: e }) => {
|
|
957
|
-
if (typeof t != "number")
|
|
958
|
-
throw e();
|
|
959
|
-
return t.toString();
|
|
960
|
-
}
|
|
961
|
-
}, ne = {
|
|
962
|
-
get: (t, { invalid: e }) => {
|
|
963
|
-
const n = new Date(t);
|
|
964
|
-
if (isNaN(n.getTime()))
|
|
965
|
-
throw e();
|
|
966
|
-
return n;
|
|
967
|
-
},
|
|
968
|
-
set: (t, { invalid: e }) => {
|
|
969
|
-
if (typeof t != "object" || !(t instanceof Date))
|
|
970
|
-
throw e();
|
|
971
|
-
return t.toISOString();
|
|
972
|
-
}
|
|
973
|
-
}, re = {
|
|
974
|
-
get: (t, { invalid: e }) => {
|
|
975
|
-
try {
|
|
976
|
-
return JSON.parse(t);
|
|
977
|
-
} catch {
|
|
978
|
-
throw e();
|
|
979
|
-
}
|
|
980
|
-
},
|
|
981
|
-
set: (t, { invalid: e }) => {
|
|
982
|
-
try {
|
|
983
|
-
return JSON.stringify(t);
|
|
984
|
-
} catch {
|
|
985
|
-
throw e();
|
|
986
|
-
}
|
|
987
|
-
}
|
|
988
|
-
};
|
|
989
|
-
function bt(t, e) {
|
|
990
|
-
if (t === void 0) {
|
|
991
|
-
if (Zt(e))
|
|
992
|
-
return e.get(t, U);
|
|
993
|
-
throw new G();
|
|
994
|
-
}
|
|
995
|
-
if (e === String)
|
|
996
|
-
return nn.get(t, U);
|
|
997
|
-
if (e === Boolean)
|
|
998
|
-
return te.get(t, U);
|
|
999
|
-
if (e === Number)
|
|
1000
|
-
return ee.get(t, U);
|
|
1001
|
-
if (e === Date)
|
|
1002
|
-
return ne.get(t, U);
|
|
1003
|
-
if (e === JSON)
|
|
1004
|
-
return re.get(t, U);
|
|
1005
|
-
if (Ze(e))
|
|
1006
|
-
return e(t, U);
|
|
1007
|
-
if (Yt(e))
|
|
1008
|
-
return e.get(t, U);
|
|
1009
|
-
if (e instanceof RegExp) {
|
|
1010
|
-
if (e.test(t))
|
|
1011
|
-
return t;
|
|
1012
|
-
throw new G();
|
|
1013
|
-
}
|
|
1014
|
-
return t;
|
|
1015
|
-
}
|
|
1016
|
-
function Pt(t, e) {
|
|
1017
|
-
if (e === Boolean)
|
|
1018
|
-
return te.set(t, U);
|
|
1019
|
-
if (e === Number)
|
|
1020
|
-
return ee.set(t, U);
|
|
1021
|
-
if (e === Date)
|
|
1022
|
-
return ne.set(t, U);
|
|
1023
|
-
if (e === JSON)
|
|
1024
|
-
return re.set(t, U);
|
|
1025
|
-
if (Yt(e))
|
|
1026
|
-
return e.set(t, U);
|
|
1027
|
-
try {
|
|
1028
|
-
return t.toString();
|
|
1029
|
-
} catch {
|
|
1030
|
-
throw new G();
|
|
1031
|
-
}
|
|
1032
|
-
}
|
|
1033
|
-
function rn(t) {
|
|
1034
|
-
const e = St(t.path.toString());
|
|
1067
|
+
function sn(t) {
|
|
1068
|
+
const e = xt(t.path.toString());
|
|
1035
1069
|
return new RegExp(`^${e}$`, "i");
|
|
1036
1070
|
}
|
|
1037
|
-
function
|
|
1071
|
+
function cn(t) {
|
|
1038
1072
|
const e = new URLSearchParams(t.query.toString());
|
|
1039
|
-
return Array.from(e.entries()).filter(([, n]) => !
|
|
1073
|
+
return Array.from(e.entries()).filter(([, n]) => !ce(n)).map(([n, r]) => new RegExp(`${n}=${xt(r)}(&|$)`, "i"));
|
|
1040
1074
|
}
|
|
1041
|
-
function
|
|
1075
|
+
function xt(t) {
|
|
1042
1076
|
return [
|
|
1043
|
-
|
|
1044
|
-
|
|
1077
|
+
un,
|
|
1078
|
+
fn
|
|
1045
1079
|
].reduce((e, n) => n(e), t);
|
|
1046
1080
|
}
|
|
1047
|
-
const
|
|
1048
|
-
function
|
|
1049
|
-
return t.replace(new RegExp(
|
|
1081
|
+
const At = `\\${J}\\?([\\w-_]+)\\${X}`, se = `\\${J}([\\w-_]+)\\${X}`;
|
|
1082
|
+
function un(t) {
|
|
1083
|
+
return t.replace(new RegExp(At, "g"), ".*");
|
|
1050
1084
|
}
|
|
1051
|
-
function
|
|
1052
|
-
return new RegExp(
|
|
1085
|
+
function ce(t) {
|
|
1086
|
+
return new RegExp(At, "g").test(t);
|
|
1053
1087
|
}
|
|
1054
|
-
function
|
|
1055
|
-
return t.replace(new RegExp(
|
|
1088
|
+
function fn(t) {
|
|
1089
|
+
return t.replace(new RegExp(se, "g"), ".+");
|
|
1056
1090
|
}
|
|
1057
|
-
function
|
|
1058
|
-
const [e] =
|
|
1091
|
+
function ln(t) {
|
|
1092
|
+
const [e] = st(t, new RegExp(At, "g")), [n] = st(t, new RegExp(se, "g"));
|
|
1059
1093
|
return e ?? n;
|
|
1060
1094
|
}
|
|
1061
|
-
function
|
|
1062
|
-
return Array.from(t.matchAll(e)).flatMap(([, ...r]) => r.map((o) =>
|
|
1095
|
+
function st(t, e) {
|
|
1096
|
+
return Array.from(t.matchAll(e)).flatMap(([, ...r]) => r.map((o) => bt(o) ? o : ""));
|
|
1063
1097
|
}
|
|
1064
|
-
function
|
|
1065
|
-
const r =
|
|
1098
|
+
function ie(t, e, n) {
|
|
1099
|
+
const r = ue(e, n), [o] = st(t, r);
|
|
1066
1100
|
return o;
|
|
1067
1101
|
}
|
|
1068
|
-
function
|
|
1102
|
+
function hn(t, e) {
|
|
1069
1103
|
if (!e)
|
|
1070
1104
|
return t;
|
|
1071
|
-
const { name: n, param: r, value: o } = e, a =
|
|
1072
|
-
return
|
|
1105
|
+
const { name: n, param: r, value: o } = e, a = ue(t, n);
|
|
1106
|
+
return st(t, a).reduce((c, u) => u === void 0 ? c : c.replace(u, () => kt(o, r)), t);
|
|
1073
1107
|
}
|
|
1074
|
-
function
|
|
1108
|
+
function ue(t, e) {
|
|
1075
1109
|
const n = [
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1110
|
+
pn,
|
|
1111
|
+
dn,
|
|
1112
|
+
xt
|
|
1079
1113
|
].reduce((r, o) => o(r, e), t);
|
|
1080
1114
|
return new RegExp(n, "g");
|
|
1081
1115
|
}
|
|
1082
|
-
function
|
|
1083
|
-
const n = new RegExp(`(\\${
|
|
1116
|
+
function pn(t, e) {
|
|
1117
|
+
const n = new RegExp(`(\\${J}\\?${e})\\${X}`, "g");
|
|
1084
1118
|
return t.replace(n, "(.*)");
|
|
1085
1119
|
}
|
|
1086
|
-
function
|
|
1087
|
-
const n = new RegExp(`(\\${
|
|
1120
|
+
function dn(t, e) {
|
|
1121
|
+
const n = new RegExp(`(\\${J}${e})\\${X}`, "g");
|
|
1088
1122
|
return t.replace(n, "(.+)");
|
|
1089
1123
|
}
|
|
1090
|
-
function
|
|
1124
|
+
function fe(t, ...e) {
|
|
1091
1125
|
return e.reduce((n, r) => {
|
|
1092
1126
|
if (!r)
|
|
1093
1127
|
return n;
|
|
@@ -1095,44 +1129,44 @@ function ie(t, ...e) {
|
|
|
1095
1129
|
return Object.keys(o).length === 0 ? n : n.includes("?") ? `${n}&${o}` : `${n}?${o}`;
|
|
1096
1130
|
}, t);
|
|
1097
1131
|
}
|
|
1098
|
-
function
|
|
1099
|
-
const { params: n = {}, query: r } = e, o = { ...t.path.params, ...t.query.params }, a = t.path.toString(), s = t.query.toString(), c =
|
|
1100
|
-
return
|
|
1132
|
+
function mn(t, e = {}) {
|
|
1133
|
+
const { params: n = {}, query: r } = e, o = { ...t.path.params, ...t.query.params }, a = t.path.toString(), s = t.query.toString(), c = Rn(a, o, n), u = yn(s, o, n);
|
|
1134
|
+
return fe(c, u, r);
|
|
1101
1135
|
}
|
|
1102
|
-
function
|
|
1103
|
-
return t.length ? Object.entries(e).reduce((r, [o, a]) =>
|
|
1136
|
+
function Rn(t, e, n) {
|
|
1137
|
+
return t.length ? Object.entries(e).reduce((r, [o, a]) => hn(r, { name: o, param: a, value: n[o] }), t) : t;
|
|
1104
1138
|
}
|
|
1105
|
-
function
|
|
1139
|
+
function yn(t, e, n) {
|
|
1106
1140
|
if (!t.length)
|
|
1107
1141
|
return {};
|
|
1108
1142
|
const r = new URLSearchParams(t);
|
|
1109
1143
|
return Array.from(r.entries()).reduce((o, [a, s]) => {
|
|
1110
|
-
const c =
|
|
1144
|
+
const c = ln(s);
|
|
1111
1145
|
if (!c)
|
|
1112
1146
|
return { ...o, [a]: s };
|
|
1113
|
-
const
|
|
1114
|
-
return
|
|
1147
|
+
const f = kt(n[c], e[c]), h = n[c] === void 0 && f === "";
|
|
1148
|
+
return ce(s) && h ? o : { ...o, [a]: f };
|
|
1115
1149
|
}, {});
|
|
1116
1150
|
}
|
|
1117
|
-
function
|
|
1151
|
+
function le(t) {
|
|
1118
1152
|
return (e, n, r) => {
|
|
1119
|
-
if (
|
|
1120
|
-
return
|
|
1153
|
+
if (T(e))
|
|
1154
|
+
return fe(e, (n ?? {}).query);
|
|
1121
1155
|
const o = n ?? {}, a = r ?? {}, s = t.find((u) => u.key === e);
|
|
1122
1156
|
if (!s)
|
|
1123
|
-
throw new
|
|
1157
|
+
throw new an(String(e));
|
|
1124
1158
|
if (s.matched.disabled)
|
|
1125
|
-
throw new
|
|
1126
|
-
return
|
|
1159
|
+
throw new on(String(e));
|
|
1160
|
+
return mn(s, {
|
|
1127
1161
|
params: o,
|
|
1128
1162
|
query: a.query
|
|
1129
1163
|
});
|
|
1130
1164
|
};
|
|
1131
1165
|
}
|
|
1132
|
-
function
|
|
1133
|
-
return !t.startsWith("http") ?
|
|
1166
|
+
function W(t) {
|
|
1167
|
+
return !t.startsWith("http") ? vn(t) : gn(t);
|
|
1134
1168
|
}
|
|
1135
|
-
function
|
|
1169
|
+
function gn(t) {
|
|
1136
1170
|
const { protocol: e, host: n, pathname: r, search: o, searchParams: a, hash: s } = new URL(t, t);
|
|
1137
1171
|
return {
|
|
1138
1172
|
protocol: e,
|
|
@@ -1143,7 +1177,7 @@ function mn(t) {
|
|
|
1143
1177
|
hash: s
|
|
1144
1178
|
};
|
|
1145
1179
|
}
|
|
1146
|
-
function
|
|
1180
|
+
function vn(t) {
|
|
1147
1181
|
const { pathname: e, search: n, searchParams: r, hash: o } = new URL(t, "https://localhost");
|
|
1148
1182
|
return {
|
|
1149
1183
|
pathname: e,
|
|
@@ -1152,100 +1186,105 @@ function Rn(t) {
|
|
|
1152
1186
|
hash: o
|
|
1153
1187
|
};
|
|
1154
1188
|
}
|
|
1155
|
-
function
|
|
1189
|
+
function he(t) {
|
|
1156
1190
|
const e = new URLSearchParams(t);
|
|
1157
1191
|
return {
|
|
1158
1192
|
get: (n) => e.get(n),
|
|
1159
1193
|
getAll: (n) => e.getAll(n)
|
|
1160
1194
|
};
|
|
1161
1195
|
}
|
|
1162
|
-
const
|
|
1196
|
+
const wn = (t, e) => {
|
|
1163
1197
|
try {
|
|
1164
|
-
|
|
1198
|
+
pe(t, e);
|
|
1165
1199
|
} catch {
|
|
1166
1200
|
return !1;
|
|
1167
1201
|
}
|
|
1168
1202
|
return !0;
|
|
1169
|
-
},
|
|
1170
|
-
const { pathname: n, search: r } =
|
|
1203
|
+
}, pe = (t, e) => {
|
|
1204
|
+
const { pathname: n, search: r } = W(e);
|
|
1171
1205
|
return {
|
|
1172
|
-
...
|
|
1173
|
-
...
|
|
1206
|
+
...En(t.path, n),
|
|
1207
|
+
...Pn(t.query, r)
|
|
1174
1208
|
};
|
|
1175
1209
|
};
|
|
1176
|
-
function
|
|
1210
|
+
function En(t, e) {
|
|
1177
1211
|
const n = {}, r = decodeURIComponent(e);
|
|
1178
1212
|
for (const [o, a] of Object.entries(t.params)) {
|
|
1179
|
-
const s =
|
|
1213
|
+
const s = ie(r, t.toString(), o), c = St(s, a);
|
|
1180
1214
|
n[o] = c;
|
|
1181
1215
|
}
|
|
1182
1216
|
return n;
|
|
1183
1217
|
}
|
|
1184
|
-
function
|
|
1218
|
+
function Pn(t, e) {
|
|
1185
1219
|
const n = {}, r = new URLSearchParams(e);
|
|
1186
1220
|
for (const [o, a] of Object.entries(t.params)) {
|
|
1187
|
-
const s = r.get(o) ?? void 0, c =
|
|
1221
|
+
const s = r.get(o) ?? void 0, c = St(s, a);
|
|
1188
1222
|
n[o] = c;
|
|
1189
1223
|
}
|
|
1190
1224
|
return n;
|
|
1191
1225
|
}
|
|
1192
|
-
const
|
|
1193
|
-
const { host: n } =
|
|
1226
|
+
const bn = (t) => "name" in t.matched && !!t.matched.name, Sn = (t, e) => {
|
|
1227
|
+
const { host: n } = W(e), { host: r } = W(t.path.toString());
|
|
1194
1228
|
return n === r;
|
|
1195
|
-
},
|
|
1196
|
-
const { pathname: n } =
|
|
1197
|
-
return
|
|
1198
|
-
},
|
|
1199
|
-
const { search: n } =
|
|
1200
|
-
return
|
|
1229
|
+
}, kn = (t, e) => {
|
|
1230
|
+
const { pathname: n } = W(e);
|
|
1231
|
+
return sn(t).test(n);
|
|
1232
|
+
}, xn = (t, e) => {
|
|
1233
|
+
const { search: n } = W(e);
|
|
1234
|
+
return cn(t).every((o) => o.test(n));
|
|
1201
1235
|
};
|
|
1202
|
-
function
|
|
1203
|
-
const { searchParams: e, pathname: n } =
|
|
1236
|
+
function An(t) {
|
|
1237
|
+
const { searchParams: e, pathname: n } = W(t), r = -1, o = 1;
|
|
1204
1238
|
return (a, s) => {
|
|
1205
|
-
const c =
|
|
1206
|
-
return c + u >
|
|
1239
|
+
const c = Vt(a, e), u = jt(a, n), f = Vt(s, e), h = jt(s, n);
|
|
1240
|
+
return c + u > f + h ? r : c + u < f + h ? o : a.depth > s.depth ? r : a.depth < s.depth ? o : 0;
|
|
1207
1241
|
};
|
|
1208
1242
|
}
|
|
1209
|
-
function
|
|
1210
|
-
const n = Object.entries(t.path.params).filter(([, o]) =>
|
|
1243
|
+
function jt(t, e) {
|
|
1244
|
+
const n = Object.entries(t.path.params).filter(([, o]) => Pt(o)).map(([o]) => o), r = n.filter((o) => ie(e, t.path.toString(), o) === void 0);
|
|
1211
1245
|
return n.length - r.length;
|
|
1212
1246
|
}
|
|
1213
|
-
function
|
|
1247
|
+
function Vt(t, e) {
|
|
1214
1248
|
const n = new URLSearchParams(t.query.toString()), r = Array.from(n.keys()), o = r.filter((a) => !e.has(a));
|
|
1215
1249
|
return r.length - o.length;
|
|
1216
1250
|
}
|
|
1217
|
-
const
|
|
1218
|
-
vn,
|
|
1219
|
-
En,
|
|
1251
|
+
const Ln = [
|
|
1220
1252
|
bn,
|
|
1221
|
-
|
|
1222
|
-
|
|
1253
|
+
Sn,
|
|
1254
|
+
kn,
|
|
1255
|
+
xn,
|
|
1256
|
+
wn
|
|
1223
1257
|
];
|
|
1224
|
-
function
|
|
1225
|
-
const n =
|
|
1258
|
+
function pt(t, e) {
|
|
1259
|
+
const n = An(e), r = t.filter((u) => Ln.every((f) => f(u, e))).sort(n);
|
|
1226
1260
|
if (r.length === 0)
|
|
1227
1261
|
return;
|
|
1228
|
-
const [o] = r, { search: a } =
|
|
1229
|
-
return
|
|
1262
|
+
const [o] = r, { search: a } = W(e), s = he(a), c = pe(o, e);
|
|
1263
|
+
return {
|
|
1230
1264
|
matched: o.matched,
|
|
1231
1265
|
matches: o.matches,
|
|
1232
1266
|
key: o.key,
|
|
1233
1267
|
query: s,
|
|
1234
1268
|
params: c
|
|
1235
|
-
}
|
|
1269
|
+
};
|
|
1236
1270
|
}
|
|
1237
|
-
function
|
|
1271
|
+
function Un(t) {
|
|
1238
1272
|
return (e, n = {}) => {
|
|
1239
|
-
const
|
|
1240
|
-
|
|
1273
|
+
const r = le(t);
|
|
1274
|
+
if (T(e)) {
|
|
1275
|
+
const a = r(e);
|
|
1276
|
+
return pt(t, a);
|
|
1277
|
+
}
|
|
1278
|
+
const o = r(e, n);
|
|
1279
|
+
return pt(t, o);
|
|
1241
1280
|
};
|
|
1242
1281
|
}
|
|
1243
|
-
function
|
|
1282
|
+
function de() {
|
|
1244
1283
|
return typeof window < "u" && typeof window.document < "u";
|
|
1245
1284
|
}
|
|
1246
|
-
function
|
|
1247
|
-
const n =
|
|
1248
|
-
if (
|
|
1285
|
+
function Bn({ mode: t, listener: e }) {
|
|
1286
|
+
const n = Hn(t), r = (u, f) => {
|
|
1287
|
+
if (f != null && f.replace)
|
|
1249
1288
|
return n.replace(u);
|
|
1250
1289
|
n.push(u);
|
|
1251
1290
|
}, o = () => {
|
|
@@ -1265,36 +1304,36 @@ function An({ mode: t, listener: e }) {
|
|
|
1265
1304
|
}
|
|
1266
1305
|
};
|
|
1267
1306
|
}
|
|
1268
|
-
function
|
|
1307
|
+
function Hn(t = "auto") {
|
|
1269
1308
|
switch (t) {
|
|
1270
1309
|
case "auto":
|
|
1271
|
-
return
|
|
1310
|
+
return de() ? Ht() : Nt();
|
|
1272
1311
|
case "browser":
|
|
1273
|
-
return
|
|
1312
|
+
return Ht();
|
|
1274
1313
|
case "memory":
|
|
1275
|
-
return
|
|
1314
|
+
return Nt();
|
|
1276
1315
|
case "hash":
|
|
1277
|
-
return
|
|
1316
|
+
return nn();
|
|
1278
1317
|
default:
|
|
1279
1318
|
const e = t;
|
|
1280
1319
|
throw new Error(`Switch is not exhaustive for mode: ${e}`);
|
|
1281
1320
|
}
|
|
1282
1321
|
}
|
|
1283
|
-
function
|
|
1284
|
-
return
|
|
1322
|
+
function Nn(t) {
|
|
1323
|
+
return Y(() => () => et("h1", t), {
|
|
1285
1324
|
name: t,
|
|
1286
1325
|
props: []
|
|
1287
1326
|
});
|
|
1288
1327
|
}
|
|
1289
|
-
const
|
|
1290
|
-
function
|
|
1328
|
+
const Ct = Symbol();
|
|
1329
|
+
function $n({
|
|
1291
1330
|
rejections: t
|
|
1292
1331
|
}) {
|
|
1293
1332
|
const e = (s) => {
|
|
1294
1333
|
const c = {
|
|
1295
1334
|
...t
|
|
1296
1335
|
};
|
|
1297
|
-
return ht(c[s] ??
|
|
1336
|
+
return ht(c[s] ?? Nn(s));
|
|
1298
1337
|
}, n = (s) => {
|
|
1299
1338
|
const c = ht(e(s)), u = {
|
|
1300
1339
|
name: s,
|
|
@@ -1302,22 +1341,22 @@ function Un({
|
|
|
1302
1341
|
component: c,
|
|
1303
1342
|
meta: {}
|
|
1304
1343
|
};
|
|
1305
|
-
return
|
|
1344
|
+
return {
|
|
1306
1345
|
matched: u,
|
|
1307
1346
|
matches: [u],
|
|
1308
1347
|
key: s,
|
|
1309
|
-
query:
|
|
1348
|
+
query: he(""),
|
|
1310
1349
|
params: {},
|
|
1311
|
-
[
|
|
1312
|
-
}
|
|
1313
|
-
}, r = (s) =>
|
|
1350
|
+
[Ct]: !0
|
|
1351
|
+
};
|
|
1352
|
+
}, r = (s) => Ct in s, o = (s) => {
|
|
1314
1353
|
if (!s) {
|
|
1315
1354
|
a.value = null;
|
|
1316
1355
|
return;
|
|
1317
1356
|
}
|
|
1318
1357
|
const c = e(s);
|
|
1319
1358
|
a.value = { type: s, component: c };
|
|
1320
|
-
}, a =
|
|
1359
|
+
}, a = Ue(null);
|
|
1321
1360
|
return {
|
|
1322
1361
|
setRejection: o,
|
|
1323
1362
|
rejection: a,
|
|
@@ -1325,127 +1364,127 @@ function Un({
|
|
|
1325
1364
|
isRejectionRoute: r
|
|
1326
1365
|
};
|
|
1327
1366
|
}
|
|
1328
|
-
class
|
|
1367
|
+
class jn extends Error {
|
|
1329
1368
|
constructor() {
|
|
1330
1369
|
super("initialUrl must be set if window.location is unavailable");
|
|
1331
1370
|
}
|
|
1332
1371
|
}
|
|
1333
|
-
function
|
|
1372
|
+
function Vn(t) {
|
|
1334
1373
|
if (t)
|
|
1335
1374
|
return t;
|
|
1336
|
-
if (
|
|
1375
|
+
if (de())
|
|
1337
1376
|
return window.location.toString();
|
|
1338
|
-
throw new
|
|
1377
|
+
throw new jn();
|
|
1339
1378
|
}
|
|
1340
|
-
function
|
|
1341
|
-
const n =
|
|
1379
|
+
function Zn(t, e = {}) {
|
|
1380
|
+
const n = le(t), r = Bn({
|
|
1342
1381
|
mode: e.historyMode,
|
|
1343
1382
|
listener: () => {
|
|
1344
|
-
const
|
|
1345
|
-
p(
|
|
1383
|
+
const y = M(location);
|
|
1384
|
+
p(y);
|
|
1346
1385
|
}
|
|
1347
|
-
}), { runBeforeRouteHooks: o, runAfterRouteHooks: a } =
|
|
1386
|
+
}), { runBeforeRouteHooks: o, runAfterRouteHooks: a } = De(), {
|
|
1348
1387
|
hooks: s,
|
|
1349
1388
|
onBeforeRouteEnter: c,
|
|
1350
1389
|
onAfterRouteUpdate: u,
|
|
1351
|
-
onBeforeRouteLeave:
|
|
1352
|
-
onAfterRouteEnter:
|
|
1353
|
-
onBeforeRouteUpdate:
|
|
1354
|
-
onAfterRouteLeave:
|
|
1355
|
-
} =
|
|
1356
|
-
async function p(
|
|
1390
|
+
onBeforeRouteLeave: f,
|
|
1391
|
+
onAfterRouteEnter: h,
|
|
1392
|
+
onBeforeRouteUpdate: d,
|
|
1393
|
+
onAfterRouteLeave: b
|
|
1394
|
+
} = Te();
|
|
1395
|
+
async function p(y, { replace: k } = {}) {
|
|
1357
1396
|
r.stopListening();
|
|
1358
|
-
const
|
|
1397
|
+
const A = pt(t, y) ?? g("NotFound"), C = { ...S }, q = await o({ to: A, from: C, hooks: s });
|
|
1359
1398
|
switch (q.status) {
|
|
1360
1399
|
case "ABORT":
|
|
1361
1400
|
return;
|
|
1362
1401
|
case "PUSH":
|
|
1363
|
-
r.update(
|
|
1402
|
+
r.update(y, { replace: k }), await E(...q.to);
|
|
1364
1403
|
return;
|
|
1365
1404
|
case "REJECT":
|
|
1366
|
-
r.update(
|
|
1405
|
+
r.update(y, { replace: k }), U(q.type), i(A);
|
|
1367
1406
|
break;
|
|
1368
1407
|
case "SUCCESS":
|
|
1369
|
-
r.update(
|
|
1408
|
+
r.update(y, { replace: k }), U(null), i(A);
|
|
1370
1409
|
break;
|
|
1371
1410
|
default:
|
|
1372
1411
|
throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(q)}`);
|
|
1373
1412
|
}
|
|
1374
|
-
const
|
|
1375
|
-
switch (
|
|
1413
|
+
const O = await a({ to: A, from: C, hooks: s });
|
|
1414
|
+
switch (O.status) {
|
|
1376
1415
|
case "PUSH":
|
|
1377
|
-
await
|
|
1416
|
+
await E(...O.to);
|
|
1378
1417
|
break;
|
|
1379
1418
|
case "REJECT":
|
|
1380
|
-
|
|
1419
|
+
U(O.type);
|
|
1381
1420
|
break;
|
|
1382
1421
|
case "SUCCESS":
|
|
1383
1422
|
break;
|
|
1384
1423
|
default:
|
|
1385
|
-
const
|
|
1386
|
-
throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(
|
|
1424
|
+
const Z = O;
|
|
1425
|
+
throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(Z)}`);
|
|
1387
1426
|
}
|
|
1388
1427
|
r.startListening();
|
|
1389
1428
|
}
|
|
1390
|
-
const
|
|
1391
|
-
if (
|
|
1392
|
-
const
|
|
1393
|
-
return p(ge, { replace:
|
|
1429
|
+
const E = (y, k, A) => {
|
|
1430
|
+
if (T(y)) {
|
|
1431
|
+
const Z = { ...k }, ge = n(y, Z);
|
|
1432
|
+
return p(ge, { replace: Z.replace });
|
|
1394
1433
|
}
|
|
1395
|
-
const
|
|
1396
|
-
return p(
|
|
1397
|
-
},
|
|
1398
|
-
if (
|
|
1399
|
-
const
|
|
1400
|
-
return
|
|
1434
|
+
const C = { ...A }, O = n(y, k ?? {}, C);
|
|
1435
|
+
return p(O, { replace: C.replace });
|
|
1436
|
+
}, j = (y, k, A) => {
|
|
1437
|
+
if (T(y)) {
|
|
1438
|
+
const O = { ...k, replace: !0 };
|
|
1439
|
+
return E(y, O);
|
|
1401
1440
|
}
|
|
1402
|
-
const
|
|
1403
|
-
return
|
|
1404
|
-
},
|
|
1441
|
+
const C = k ?? {}, q = { ...A, replace: !0 };
|
|
1442
|
+
return E(y, C, q);
|
|
1443
|
+
}, V = (y) => U(y), B = Un(t), { setRejection: U, rejection: R, getRejectionRoute: g } = $n(e), P = g("NotFound"), { currentRoute: S, routerRoute: m, updateRoute: i } = rn(P, E);
|
|
1405
1444
|
r.startListening();
|
|
1406
|
-
const
|
|
1407
|
-
function
|
|
1408
|
-
|
|
1445
|
+
const l = Vn(e.initialUrl), v = p(l, { replace: !0 });
|
|
1446
|
+
function w(y) {
|
|
1447
|
+
y.component("RouterView", Xt), y.component("RouterLink", Fe), y.provide(Wt, x), y.provide(Ft, R), y.provide(Qt, s);
|
|
1409
1448
|
}
|
|
1410
|
-
const
|
|
1411
|
-
route:
|
|
1449
|
+
const x = {
|
|
1450
|
+
route: m,
|
|
1412
1451
|
resolve: n,
|
|
1413
|
-
push:
|
|
1414
|
-
replace:
|
|
1415
|
-
reject:
|
|
1416
|
-
find:
|
|
1452
|
+
push: E,
|
|
1453
|
+
replace: j,
|
|
1454
|
+
reject: V,
|
|
1455
|
+
find: B,
|
|
1417
1456
|
refresh: r.refresh,
|
|
1418
1457
|
forward: r.forward,
|
|
1419
1458
|
back: r.back,
|
|
1420
1459
|
go: r.go,
|
|
1421
|
-
install:
|
|
1422
|
-
initialized:
|
|
1460
|
+
install: w,
|
|
1461
|
+
initialized: v,
|
|
1423
1462
|
onBeforeRouteEnter: c,
|
|
1424
1463
|
onAfterRouteUpdate: u,
|
|
1425
|
-
onBeforeRouteLeave:
|
|
1426
|
-
onAfterRouteEnter:
|
|
1427
|
-
onBeforeRouteUpdate:
|
|
1428
|
-
onAfterRouteLeave:
|
|
1464
|
+
onBeforeRouteLeave: f,
|
|
1465
|
+
onAfterRouteEnter: h,
|
|
1466
|
+
onBeforeRouteUpdate: d,
|
|
1467
|
+
onAfterRouteLeave: b
|
|
1429
1468
|
};
|
|
1430
|
-
return
|
|
1469
|
+
return x;
|
|
1431
1470
|
}
|
|
1432
|
-
function
|
|
1433
|
-
const n = new RegExp(`\\${
|
|
1471
|
+
function me(t, e) {
|
|
1472
|
+
const n = new RegExp(`\\${J}\\??([\\w-_]+)\\${X}`, "g");
|
|
1434
1473
|
return Array.from(t.matchAll(n)).reduce((o, [a, s]) => {
|
|
1435
|
-
const c = a.startsWith(`${
|
|
1474
|
+
const c = a.startsWith(`${J}?`), u = Ze(e, s);
|
|
1436
1475
|
if (s in o)
|
|
1437
|
-
throw new
|
|
1438
|
-
return o[s] = c ?
|
|
1476
|
+
throw new it(s);
|
|
1477
|
+
return o[s] = c ? Ge(u) : u, o;
|
|
1439
1478
|
}, {});
|
|
1440
1479
|
}
|
|
1441
|
-
function
|
|
1480
|
+
function Re(t, e) {
|
|
1442
1481
|
return {
|
|
1443
1482
|
path: t,
|
|
1444
|
-
params:
|
|
1483
|
+
params: me(t, e),
|
|
1445
1484
|
toString: () => t
|
|
1446
1485
|
};
|
|
1447
1486
|
}
|
|
1448
|
-
function
|
|
1487
|
+
function Lt(t, e) {
|
|
1449
1488
|
const n = Object.keys(t), r = Object.keys(e), o = n.find((a) => r.includes(a));
|
|
1450
1489
|
return o ? {
|
|
1451
1490
|
key: o,
|
|
@@ -1455,103 +1494,106 @@ function xt(t, e) {
|
|
|
1455
1494
|
hasDuplicates: !1
|
|
1456
1495
|
};
|
|
1457
1496
|
}
|
|
1458
|
-
function
|
|
1459
|
-
const { hasDuplicates: n, key: r } =
|
|
1497
|
+
function Cn(t, e) {
|
|
1498
|
+
const { hasDuplicates: n, key: r } = Lt(t.params, e.params);
|
|
1460
1499
|
if (n)
|
|
1461
|
-
throw new
|
|
1462
|
-
return
|
|
1500
|
+
throw new it(r);
|
|
1501
|
+
return Re(`${t.path}${e.path}`, { ...t.params, ...e.params });
|
|
1463
1502
|
}
|
|
1464
|
-
function
|
|
1503
|
+
function dt(t, e) {
|
|
1465
1504
|
return {
|
|
1466
1505
|
query: t,
|
|
1467
|
-
params:
|
|
1506
|
+
params: me(t, e),
|
|
1468
1507
|
toString: () => t
|
|
1469
1508
|
};
|
|
1470
1509
|
}
|
|
1471
|
-
function
|
|
1472
|
-
const { hasDuplicates: n, key: r } =
|
|
1510
|
+
function On(t, e) {
|
|
1511
|
+
const { hasDuplicates: n, key: r } = Lt(t.params, e.params);
|
|
1473
1512
|
if (n)
|
|
1474
|
-
throw new
|
|
1475
|
-
const o = [t.query, e.query].filter(
|
|
1476
|
-
return
|
|
1513
|
+
throw new it(r);
|
|
1514
|
+
const o = [t.query, e.query].filter(bt).join("&");
|
|
1515
|
+
return dt(o, { ...t.params, ...e.params });
|
|
1477
1516
|
}
|
|
1478
|
-
function
|
|
1517
|
+
function ye(t) {
|
|
1479
1518
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
1480
1519
|
}
|
|
1481
|
-
function
|
|
1482
|
-
return
|
|
1520
|
+
function _n(t) {
|
|
1521
|
+
return ye(t) && typeof t.path == "string";
|
|
1483
1522
|
}
|
|
1484
|
-
function
|
|
1485
|
-
return
|
|
1523
|
+
function qn(t) {
|
|
1524
|
+
return _n(t) ? t : Re(t, {});
|
|
1486
1525
|
}
|
|
1487
|
-
function
|
|
1488
|
-
return
|
|
1526
|
+
function Dn(t) {
|
|
1527
|
+
return ye(t) && typeof t.query == "string";
|
|
1489
1528
|
}
|
|
1490
|
-
function
|
|
1491
|
-
return t === void 0 ?
|
|
1529
|
+
function Mn(t) {
|
|
1530
|
+
return t === void 0 ? dt("", {}) : Dn(t) ? t : dt(t, {});
|
|
1492
1531
|
}
|
|
1493
|
-
function
|
|
1532
|
+
function tr(t) {
|
|
1494
1533
|
const e = t.reduce((n, r) => {
|
|
1495
|
-
const o =
|
|
1496
|
-
return
|
|
1534
|
+
const o = Tn(r);
|
|
1535
|
+
return Yt(r) && n.push(...r.children.map((a) => ({
|
|
1497
1536
|
...a,
|
|
1498
|
-
key:
|
|
1499
|
-
path:
|
|
1500
|
-
query:
|
|
1537
|
+
key: It(o.key, a.key),
|
|
1538
|
+
path: Cn(o.path, a.path),
|
|
1539
|
+
query: On(o.query, a.query),
|
|
1501
1540
|
matches: [o.matched, ...a.matches],
|
|
1502
1541
|
depth: a.depth + 1
|
|
1503
1542
|
}))), n.push(o), n;
|
|
1504
1543
|
}, []);
|
|
1505
1544
|
return e.forEach(({ path: n, query: r }) => {
|
|
1506
|
-
const { hasDuplicates: o, key: a } =
|
|
1545
|
+
const { hasDuplicates: o, key: a } = Lt(n.params, r.params);
|
|
1507
1546
|
if (o)
|
|
1508
|
-
throw new
|
|
1547
|
+
throw new it(a);
|
|
1509
1548
|
}), e;
|
|
1510
1549
|
}
|
|
1511
|
-
function
|
|
1512
|
-
const e =
|
|
1550
|
+
function Tn(t) {
|
|
1551
|
+
const e = Wn(t), n = qn(t.path), r = Mn(t.query), o = ht({ meta: {}, ...e });
|
|
1513
1552
|
return {
|
|
1514
1553
|
matched: o,
|
|
1515
1554
|
matches: [o],
|
|
1516
|
-
key: t.name,
|
|
1555
|
+
key: t.name ?? "",
|
|
1517
1556
|
path: n,
|
|
1518
1557
|
query: r,
|
|
1519
1558
|
depth: 1,
|
|
1520
1559
|
disabled: t.disabled ?? !1
|
|
1521
1560
|
};
|
|
1522
1561
|
}
|
|
1523
|
-
function
|
|
1524
|
-
return Ie(t) ? { ...t, component:
|
|
1562
|
+
function Wn(t) {
|
|
1563
|
+
return Ie(t) ? { ...t, component: Xt } : t;
|
|
1525
1564
|
}
|
|
1526
1565
|
export {
|
|
1527
|
-
|
|
1566
|
+
it as DuplicateParamsError,
|
|
1528
1567
|
Fe as RouterLink,
|
|
1529
|
-
|
|
1530
|
-
|
|
1568
|
+
mt as RouterNotInstalledError,
|
|
1569
|
+
Xt as RouterView,
|
|
1531
1570
|
Be as UseRouteInvalidError,
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1571
|
+
Yn as component,
|
|
1572
|
+
oe as createParam,
|
|
1573
|
+
Zn as createRouter,
|
|
1574
|
+
tr as createRoutes,
|
|
1575
|
+
ut as isParamGetSet,
|
|
1576
|
+
Ye as isParamGetter,
|
|
1577
|
+
Xe as isParamWithDefault,
|
|
1578
|
+
Yt as isParentRoute,
|
|
1538
1579
|
Ie as isParentRouteWithoutComponent,
|
|
1539
|
-
|
|
1580
|
+
Ve as isRoute,
|
|
1540
1581
|
Je as isRouteWithComponent,
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1582
|
+
Ke as isRouteWithComponents,
|
|
1583
|
+
Qn as onAfterRouteEnter,
|
|
1584
|
+
Gn as onAfterRouteLeave,
|
|
1585
|
+
zn as onAfterRouteUpdate,
|
|
1586
|
+
Jn as onBeforeRouteLeave,
|
|
1587
|
+
Kn as onBeforeRouteUpdate,
|
|
1588
|
+
X as paramEnd,
|
|
1589
|
+
J as paramStart,
|
|
1590
|
+
Re as path,
|
|
1591
|
+
dt as query,
|
|
1592
|
+
Wt as routerInjectionKey,
|
|
1593
|
+
Ft as routerRejectionKey,
|
|
1594
|
+
He as useLink,
|
|
1595
|
+
Ne as useRejection,
|
|
1555
1596
|
Oe as useRoute,
|
|
1556
|
-
|
|
1597
|
+
Rt as useRouter,
|
|
1598
|
+
Xn as withDefault
|
|
1557
1599
|
};
|