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