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