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