@kitbag/router 0.13.4 → 0.14.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/dist/kitbag-router.d.ts +37 -47
- package/dist/kitbag-router.js +1243 -1181
- package/dist/kitbag-router.umd.cjs +1 -1
- package/package.json +4 -4
package/dist/kitbag-router.js
CHANGED
|
@@ -1,85 +1,109 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { inject as
|
|
1
|
+
var fr = Object.defineProperty;
|
|
2
|
+
var lr = (e, t, r) => t in e ? fr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var I = (e, t, r) => lr(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { inject as ae, toRefs as hr, computed as N, reactive as xe, defineComponent as se, h as Z, ref as $e, markRaw as ye, watch as ge, defineAsyncComponent as pr, toValue as $, openBlock as yt, createElementBlock as dr, normalizeClass as mr, renderSlot as gt, normalizeProps as vt, guardReactiveProps as yr, unref as ue, getCurrentInstance as gr, resolveComponent as vr, provide as Rr, mergeProps as wr, createBlock as Pr, resolveDynamicComponent as Er, createCommentVNode as br, onUnmounted as Rt } from "vue";
|
|
5
|
+
function O(e) {
|
|
6
|
+
return typeof e != "string" ? !1 : /^(https?:\/\/|\/).*/g.test(e);
|
|
7
|
+
}
|
|
8
|
+
function wt(e) {
|
|
9
|
+
return O(e) ? e : `/${e}`;
|
|
10
|
+
}
|
|
11
|
+
class Sr extends Error {
|
|
12
|
+
/**
|
|
13
|
+
* Constructs a new DuplicateParamsError instance with a message indicating the problematic parameter.
|
|
14
|
+
* @param paramName - The name of the parameter that was duplicated.
|
|
15
|
+
*/
|
|
16
|
+
constructor(t) {
|
|
17
|
+
super(`Invalid Param "${t}": Router does not support multiple params by the same name. All param names must be unique.`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
class kr extends Error {
|
|
21
|
+
constructor(t) {
|
|
22
|
+
super(`Child property on meta for ${t} conflicts with the parent meta.`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
5
25
|
class pe extends Error {
|
|
6
26
|
constructor() {
|
|
7
27
|
super("Router not installed");
|
|
8
28
|
}
|
|
9
29
|
}
|
|
30
|
+
class Ar extends Error {
|
|
31
|
+
/**
|
|
32
|
+
* Constructs a new UseRouteInvalidError instance with a message that specifies both the given and expected route names.
|
|
33
|
+
* This detailed error message aids in quickly identifying and resolving mismatches in route usage.
|
|
34
|
+
* @param routeName - The route name that was incorrectly used.
|
|
35
|
+
* @param actualRouteName - The expected route name that should have been used.
|
|
36
|
+
*/
|
|
37
|
+
constructor(t, r) {
|
|
38
|
+
super(`useRoute called with incorrect route. Given ${t}, expected ${r}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const Pt = Symbol();
|
|
42
|
+
function qe() {
|
|
43
|
+
const e = ae(Pt);
|
|
44
|
+
if (!e)
|
|
45
|
+
throw new pe();
|
|
46
|
+
return e;
|
|
47
|
+
}
|
|
10
48
|
function de(e) {
|
|
11
49
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
12
50
|
}
|
|
13
|
-
function
|
|
51
|
+
function xr(e) {
|
|
14
52
|
return e.every((t) => Array.isArray(t));
|
|
15
53
|
}
|
|
16
|
-
function
|
|
54
|
+
function F(e) {
|
|
17
55
|
return typeof e == "string" && e.length > 0;
|
|
18
56
|
}
|
|
19
|
-
function
|
|
57
|
+
function ve(e) {
|
|
20
58
|
return {
|
|
21
|
-
value:
|
|
59
|
+
value: F(e) ? e.replace(/^#*/, "") : void 0
|
|
22
60
|
};
|
|
23
61
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
26
|
-
}
|
|
27
|
-
class xn extends Error {
|
|
28
|
-
constructor(t) {
|
|
29
|
-
super(`Child property on meta for ${t} conflicts with the parent meta.`);
|
|
30
|
-
}
|
|
62
|
+
function Ur(e, t) {
|
|
63
|
+
return ve(`${e.value ?? ""}${t.value ?? ""}`);
|
|
31
64
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
65
|
+
function Lr(e, t) {
|
|
66
|
+
return Cr(e, t), { ...e, ...t };
|
|
34
67
|
}
|
|
35
|
-
function
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
38
|
-
throw new
|
|
68
|
+
function Cr(e, t) {
|
|
69
|
+
const r = Object.keys(e).find((n) => n in t && typeof t[n] != typeof e[n]);
|
|
70
|
+
if (r)
|
|
71
|
+
throw new kr(r);
|
|
39
72
|
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Constructs a new DuplicateParamsError instance with a message indicating the problematic parameter.
|
|
43
|
-
* @param paramName - The name of the parameter that was duplicated.
|
|
44
|
-
*/
|
|
45
|
-
constructor(t) {
|
|
46
|
-
super(`Invalid Param "${t}": Router does not support multiple params by the same name. All param names must be unique.`);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
function X(e) {
|
|
73
|
+
function ee(e) {
|
|
50
74
|
return Array.isArray(e) ? e : [e];
|
|
51
75
|
}
|
|
52
|
-
function
|
|
53
|
-
return e.filter((
|
|
76
|
+
function Et(e, t) {
|
|
77
|
+
return e.filter((r) => t === r).length;
|
|
54
78
|
}
|
|
55
|
-
function
|
|
56
|
-
const t = e.flatMap((
|
|
57
|
-
for (const
|
|
58
|
-
if (
|
|
59
|
-
throw new
|
|
79
|
+
function ce(...e) {
|
|
80
|
+
const t = e.flatMap((r) => Array.isArray(r) ? r : Object.keys(r).map(Br));
|
|
81
|
+
for (const r of t)
|
|
82
|
+
if (Et(t, r) > 1)
|
|
83
|
+
throw new Sr(r);
|
|
60
84
|
}
|
|
61
|
-
function
|
|
85
|
+
function Br(e) {
|
|
62
86
|
return e.startsWith("?") ? e.slice(1) : e;
|
|
63
87
|
}
|
|
64
|
-
function
|
|
65
|
-
return
|
|
88
|
+
function Nr(e, t) {
|
|
89
|
+
return ce(e.params, t.params), {
|
|
66
90
|
value: `${e.value}${t.value}`,
|
|
67
91
|
params: { ...e.params, ...t.params }
|
|
68
92
|
};
|
|
69
93
|
}
|
|
70
|
-
function
|
|
71
|
-
return
|
|
72
|
-
value: [e.value, t.value].filter(
|
|
94
|
+
function Vr(e, t) {
|
|
95
|
+
return ce(e.params, t.params), {
|
|
96
|
+
value: [e.value, t.value].filter(F).join("&"),
|
|
73
97
|
params: { ...e.params, ...t.params }
|
|
74
98
|
};
|
|
75
99
|
}
|
|
76
|
-
function
|
|
77
|
-
return
|
|
100
|
+
function Hr(e, t) {
|
|
101
|
+
return ce(e, t), { ...e, ...t };
|
|
78
102
|
}
|
|
79
|
-
function
|
|
103
|
+
function jr(e) {
|
|
80
104
|
return "host" in e && !!e.host;
|
|
81
105
|
}
|
|
82
|
-
function
|
|
106
|
+
function bt(e) {
|
|
83
107
|
return "parent" in e && !!e.parent;
|
|
84
108
|
}
|
|
85
109
|
function _e(e) {
|
|
@@ -88,58 +112,58 @@ function _e(e) {
|
|
|
88
112
|
function Me(e) {
|
|
89
113
|
return "components" in e && !!e.components;
|
|
90
114
|
}
|
|
91
|
-
function $
|
|
115
|
+
function $r(e) {
|
|
92
116
|
return "state" in e && !!e.state;
|
|
93
117
|
}
|
|
94
|
-
function
|
|
118
|
+
function St(e, t) {
|
|
95
119
|
return {
|
|
96
120
|
...t,
|
|
97
|
-
path:
|
|
98
|
-
query:
|
|
99
|
-
meta:
|
|
100
|
-
state:
|
|
101
|
-
hash:
|
|
121
|
+
path: Nr(e.path, t.path),
|
|
122
|
+
query: Vr(e.query, t.query),
|
|
123
|
+
meta: Lr(e.meta, t.meta),
|
|
124
|
+
state: Hr(e.state, t.state),
|
|
125
|
+
hash: Ur(e.hash, t.hash),
|
|
102
126
|
matches: [...e.matches, t.matched],
|
|
103
127
|
host: e.host,
|
|
104
128
|
depth: e.depth + 1
|
|
105
129
|
};
|
|
106
130
|
}
|
|
107
|
-
function
|
|
131
|
+
function We() {
|
|
108
132
|
return typeof window < "u" && typeof window.document < "u";
|
|
109
133
|
}
|
|
110
|
-
class
|
|
134
|
+
class ie extends Error {
|
|
111
135
|
}
|
|
112
|
-
const
|
|
113
|
-
function
|
|
136
|
+
const J = "[", K = "]";
|
|
137
|
+
function qr(e) {
|
|
114
138
|
return e !== String && e !== Boolean && e !== Number && e !== Date;
|
|
115
139
|
}
|
|
116
|
-
function
|
|
117
|
-
return typeof e == "function" &&
|
|
140
|
+
function _r(e) {
|
|
141
|
+
return typeof e == "function" && qr(e);
|
|
118
142
|
}
|
|
119
|
-
function
|
|
143
|
+
function Ue(e) {
|
|
120
144
|
return typeof e == "object" && "get" in e && typeof e.get == "function" && "set" in e && typeof e.set == "function";
|
|
121
145
|
}
|
|
122
|
-
function
|
|
123
|
-
return
|
|
146
|
+
function Mr(e) {
|
|
147
|
+
return Ue(e) && e.defaultValue !== void 0;
|
|
124
148
|
}
|
|
125
149
|
function fo(e, t) {
|
|
126
|
-
return
|
|
150
|
+
return Tr(e, t);
|
|
127
151
|
}
|
|
128
|
-
function
|
|
152
|
+
function Wr(e, t) {
|
|
129
153
|
return e[t] ?? String;
|
|
130
154
|
}
|
|
131
|
-
const
|
|
155
|
+
const q = {
|
|
132
156
|
invalid: (e) => {
|
|
133
|
-
throw new
|
|
157
|
+
throw new ie(e);
|
|
134
158
|
}
|
|
135
|
-
},
|
|
159
|
+
}, Dr = {
|
|
136
160
|
get: (e) => e,
|
|
137
161
|
set: (e, { invalid: t }) => {
|
|
138
162
|
if (typeof e != "string")
|
|
139
163
|
throw t();
|
|
140
164
|
return e;
|
|
141
165
|
}
|
|
142
|
-
},
|
|
166
|
+
}, kt = {
|
|
143
167
|
get: (e, { invalid: t }) => {
|
|
144
168
|
if (e === "true")
|
|
145
169
|
return !0;
|
|
@@ -152,31 +176,31 @@ const O = {
|
|
|
152
176
|
throw t();
|
|
153
177
|
return e.toString();
|
|
154
178
|
}
|
|
155
|
-
},
|
|
179
|
+
}, At = {
|
|
156
180
|
get: (e, { invalid: t }) => {
|
|
157
|
-
const
|
|
158
|
-
if (isNaN(
|
|
181
|
+
const r = Number(e);
|
|
182
|
+
if (isNaN(r))
|
|
159
183
|
throw t();
|
|
160
|
-
return
|
|
184
|
+
return r;
|
|
161
185
|
},
|
|
162
186
|
set: (e, { invalid: t }) => {
|
|
163
187
|
if (typeof e != "number")
|
|
164
188
|
throw t();
|
|
165
189
|
return e.toString();
|
|
166
190
|
}
|
|
167
|
-
},
|
|
191
|
+
}, xt = {
|
|
168
192
|
get: (e, { invalid: t }) => {
|
|
169
|
-
const
|
|
170
|
-
if (isNaN(
|
|
193
|
+
const r = new Date(e);
|
|
194
|
+
if (isNaN(r.getTime()))
|
|
171
195
|
throw t();
|
|
172
|
-
return
|
|
196
|
+
return r;
|
|
173
197
|
},
|
|
174
198
|
set: (e, { invalid: t }) => {
|
|
175
199
|
if (typeof e != "object" || !(e instanceof Date))
|
|
176
200
|
throw t();
|
|
177
201
|
return e.toISOString();
|
|
178
202
|
}
|
|
179
|
-
},
|
|
203
|
+
}, Ut = {
|
|
180
204
|
get: (e, { invalid: t }) => {
|
|
181
205
|
try {
|
|
182
206
|
return JSON.parse(e);
|
|
@@ -192,84 +216,83 @@ const O = {
|
|
|
192
216
|
}
|
|
193
217
|
}
|
|
194
218
|
};
|
|
195
|
-
function fe(e, t,
|
|
196
|
-
if (e === void 0 || !
|
|
197
|
-
if (
|
|
219
|
+
function fe(e, t, r = !1) {
|
|
220
|
+
if (e === void 0 || !F(e)) {
|
|
221
|
+
if (Mr(t))
|
|
198
222
|
return t.defaultValue;
|
|
199
|
-
if (
|
|
223
|
+
if (r)
|
|
200
224
|
return;
|
|
201
|
-
throw new
|
|
225
|
+
throw new ie();
|
|
202
226
|
}
|
|
203
227
|
if (t === String)
|
|
204
|
-
return
|
|
228
|
+
return Dr.get(e, q);
|
|
205
229
|
if (t === Boolean)
|
|
206
|
-
return
|
|
230
|
+
return kt.get(e, q);
|
|
207
231
|
if (t === Number)
|
|
208
|
-
return
|
|
232
|
+
return At.get(e, q);
|
|
209
233
|
if (t === Date)
|
|
210
|
-
return
|
|
234
|
+
return xt.get(e, q);
|
|
211
235
|
if (t === JSON)
|
|
212
|
-
return
|
|
213
|
-
if (
|
|
214
|
-
return t(e,
|
|
215
|
-
if (
|
|
216
|
-
return t.get(e,
|
|
236
|
+
return Ut.get(e, q);
|
|
237
|
+
if (_r(t))
|
|
238
|
+
return t(e, q);
|
|
239
|
+
if (Ue(t))
|
|
240
|
+
return t.get(e, q);
|
|
217
241
|
if (t instanceof RegExp) {
|
|
218
242
|
if (t.test(e))
|
|
219
243
|
return e;
|
|
220
|
-
throw new
|
|
244
|
+
throw new ie();
|
|
221
245
|
}
|
|
222
246
|
return e;
|
|
223
247
|
}
|
|
224
|
-
function le(e, t,
|
|
248
|
+
function le(e, t, r = !1) {
|
|
225
249
|
if (e === void 0) {
|
|
226
|
-
if (
|
|
250
|
+
if (r)
|
|
227
251
|
return "";
|
|
228
|
-
throw new
|
|
252
|
+
throw new ie();
|
|
229
253
|
}
|
|
230
254
|
if (t === Boolean)
|
|
231
|
-
return
|
|
255
|
+
return kt.set(e, q);
|
|
232
256
|
if (t === Number)
|
|
233
|
-
return
|
|
257
|
+
return At.set(e, q);
|
|
234
258
|
if (t === Date)
|
|
235
|
-
return
|
|
259
|
+
return xt.set(e, q);
|
|
236
260
|
if (t === JSON)
|
|
237
|
-
return
|
|
238
|
-
if (
|
|
239
|
-
return t.set(e,
|
|
261
|
+
return Ut.set(e, q);
|
|
262
|
+
if (Ue(t))
|
|
263
|
+
return t.set(e, q);
|
|
240
264
|
try {
|
|
241
265
|
return e.toString();
|
|
242
266
|
} catch {
|
|
243
|
-
throw new
|
|
267
|
+
throw new ie();
|
|
244
268
|
}
|
|
245
269
|
}
|
|
246
|
-
function
|
|
247
|
-
return
|
|
248
|
-
get: (
|
|
249
|
-
set: (
|
|
270
|
+
function Tr(e, t) {
|
|
271
|
+
return Ue(e) ? { ...e, defaultValue: t ?? e.defaultValue } : {
|
|
272
|
+
get: (r) => fe(r, e),
|
|
273
|
+
set: (r) => le(r, e),
|
|
250
274
|
defaultValue: t
|
|
251
275
|
};
|
|
252
276
|
}
|
|
253
|
-
function
|
|
254
|
-
return
|
|
277
|
+
function G() {
|
|
278
|
+
return G = Object.assign ? Object.assign.bind() : function(e) {
|
|
255
279
|
for (var t = 1; t < arguments.length; t++) {
|
|
256
|
-
var
|
|
257
|
-
for (var
|
|
258
|
-
Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
280
|
+
var r = arguments[t];
|
|
281
|
+
for (var n in r) ({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
259
282
|
}
|
|
260
283
|
return e;
|
|
261
|
-
},
|
|
284
|
+
}, G.apply(null, arguments);
|
|
262
285
|
}
|
|
263
|
-
var
|
|
286
|
+
var V;
|
|
264
287
|
(function(e) {
|
|
265
288
|
e.Pop = "POP", e.Push = "PUSH", e.Replace = "REPLACE";
|
|
266
|
-
})(
|
|
267
|
-
var
|
|
289
|
+
})(V || (V = {}));
|
|
290
|
+
var re = process.env.NODE_ENV !== "production" ? function(e) {
|
|
268
291
|
return Object.freeze(e);
|
|
269
292
|
} : function(e) {
|
|
270
293
|
return e;
|
|
271
294
|
};
|
|
272
|
-
function
|
|
295
|
+
function Y(e, t) {
|
|
273
296
|
if (!e) {
|
|
274
297
|
typeof console < "u" && console.warn(t);
|
|
275
298
|
try {
|
|
@@ -278,16 +301,16 @@ function K(e, t) {
|
|
|
278
301
|
}
|
|
279
302
|
}
|
|
280
303
|
}
|
|
281
|
-
var
|
|
282
|
-
function
|
|
304
|
+
var Re = "beforeunload", Ir = "hashchange", Lt = "popstate";
|
|
305
|
+
function at(e) {
|
|
283
306
|
e === void 0 && (e = {});
|
|
284
|
-
var t = e,
|
|
307
|
+
var t = e, r = t.window, n = r === void 0 ? document.defaultView : r, o = n.history;
|
|
285
308
|
function a() {
|
|
286
|
-
var
|
|
287
|
-
return [k.idx,
|
|
288
|
-
pathname:
|
|
289
|
-
search:
|
|
290
|
-
hash:
|
|
309
|
+
var g = n.location, l = g.pathname, y = g.search, S = g.hash, k = o.state || {};
|
|
310
|
+
return [k.idx, re({
|
|
311
|
+
pathname: l,
|
|
312
|
+
search: y,
|
|
313
|
+
hash: S,
|
|
291
314
|
state: k.usr || null,
|
|
292
315
|
key: k.key || "default"
|
|
293
316
|
})];
|
|
@@ -297,19 +320,19 @@ function ot(e) {
|
|
|
297
320
|
if (s)
|
|
298
321
|
p.call(s), s = null;
|
|
299
322
|
else {
|
|
300
|
-
var
|
|
323
|
+
var g = V.Pop, l = a(), y = l[0], S = l[1];
|
|
301
324
|
if (p.length)
|
|
302
|
-
if (
|
|
303
|
-
var k = f -
|
|
325
|
+
if (y != null) {
|
|
326
|
+
var k = f - y;
|
|
304
327
|
k && (s = {
|
|
305
|
-
action:
|
|
306
|
-
location:
|
|
328
|
+
action: g,
|
|
329
|
+
location: S,
|
|
307
330
|
retry: function() {
|
|
308
331
|
x(k * -1);
|
|
309
332
|
}
|
|
310
333
|
}, x(k));
|
|
311
334
|
} else
|
|
312
|
-
process.env.NODE_ENV !== "production" &&
|
|
335
|
+
process.env.NODE_ENV !== "production" && Y(
|
|
313
336
|
!1,
|
|
314
337
|
// TODO: Write up a doc that explains our blocking strategy in
|
|
315
338
|
// detail and link to it here so people can understand better what
|
|
@@ -317,87 +340,87 @@ function ot(e) {
|
|
|
317
340
|
"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."
|
|
318
341
|
);
|
|
319
342
|
else
|
|
320
|
-
A(
|
|
343
|
+
A(g);
|
|
321
344
|
}
|
|
322
345
|
}
|
|
323
|
-
|
|
324
|
-
var
|
|
325
|
-
f == null && (f = 0, o.replaceState(
|
|
346
|
+
n.addEventListener(Lt, c);
|
|
347
|
+
var i = V.Pop, u = a(), f = u[0], d = u[1], P = ne(), p = ne();
|
|
348
|
+
f == null && (f = 0, o.replaceState(G({}, o.state, {
|
|
326
349
|
idx: f
|
|
327
350
|
}), ""));
|
|
328
|
-
function
|
|
329
|
-
return typeof
|
|
351
|
+
function h(g) {
|
|
352
|
+
return typeof g == "string" ? g : X(g);
|
|
330
353
|
}
|
|
331
|
-
function
|
|
332
|
-
return
|
|
333
|
-
pathname:
|
|
354
|
+
function v(g, l) {
|
|
355
|
+
return l === void 0 && (l = null), re(G({
|
|
356
|
+
pathname: d.pathname,
|
|
334
357
|
hash: "",
|
|
335
358
|
search: ""
|
|
336
|
-
}, typeof
|
|
337
|
-
state:
|
|
338
|
-
key:
|
|
359
|
+
}, typeof g == "string" ? he(g) : g, {
|
|
360
|
+
state: l,
|
|
361
|
+
key: Pe()
|
|
339
362
|
}));
|
|
340
363
|
}
|
|
341
|
-
function
|
|
364
|
+
function R(g, l) {
|
|
342
365
|
return [{
|
|
343
|
-
usr:
|
|
344
|
-
key:
|
|
345
|
-
idx:
|
|
346
|
-
},
|
|
366
|
+
usr: g.state,
|
|
367
|
+
key: g.key,
|
|
368
|
+
idx: l
|
|
369
|
+
}, h(g)];
|
|
347
370
|
}
|
|
348
|
-
function
|
|
371
|
+
function E(g, l, y) {
|
|
349
372
|
return !p.length || (p.call({
|
|
350
|
-
action:
|
|
351
|
-
location:
|
|
352
|
-
retry:
|
|
373
|
+
action: g,
|
|
374
|
+
location: l,
|
|
375
|
+
retry: y
|
|
353
376
|
}), !1);
|
|
354
377
|
}
|
|
355
|
-
function A(
|
|
356
|
-
|
|
357
|
-
var
|
|
358
|
-
f =
|
|
359
|
-
action:
|
|
360
|
-
location:
|
|
378
|
+
function A(g) {
|
|
379
|
+
i = g;
|
|
380
|
+
var l = a();
|
|
381
|
+
f = l[0], d = l[1], P.call({
|
|
382
|
+
action: i,
|
|
383
|
+
location: d
|
|
361
384
|
});
|
|
362
385
|
}
|
|
363
|
-
function
|
|
364
|
-
var
|
|
386
|
+
function m(g, l) {
|
|
387
|
+
var y = V.Push, S = v(g, l);
|
|
365
388
|
function k() {
|
|
366
|
-
|
|
389
|
+
m(g, l);
|
|
367
390
|
}
|
|
368
|
-
if (
|
|
369
|
-
var
|
|
391
|
+
if (E(y, S, k)) {
|
|
392
|
+
var C = R(S, f + 1), B = C[0], H = C[1];
|
|
370
393
|
try {
|
|
371
|
-
o.pushState(
|
|
394
|
+
o.pushState(B, "", H);
|
|
372
395
|
} catch {
|
|
373
|
-
|
|
396
|
+
n.location.assign(H);
|
|
374
397
|
}
|
|
375
|
-
A(
|
|
398
|
+
A(y);
|
|
376
399
|
}
|
|
377
400
|
}
|
|
378
|
-
function
|
|
379
|
-
var
|
|
401
|
+
function w(g, l) {
|
|
402
|
+
var y = V.Replace, S = v(g, l);
|
|
380
403
|
function k() {
|
|
381
|
-
|
|
404
|
+
w(g, l);
|
|
382
405
|
}
|
|
383
|
-
if (
|
|
384
|
-
var
|
|
385
|
-
o.replaceState(
|
|
406
|
+
if (E(y, S, k)) {
|
|
407
|
+
var C = R(S, f), B = C[0], H = C[1];
|
|
408
|
+
o.replaceState(B, "", H), A(y);
|
|
386
409
|
}
|
|
387
410
|
}
|
|
388
|
-
function x(
|
|
389
|
-
o.go(
|
|
411
|
+
function x(g) {
|
|
412
|
+
o.go(g);
|
|
390
413
|
}
|
|
391
414
|
var U = {
|
|
392
415
|
get action() {
|
|
393
|
-
return
|
|
416
|
+
return i;
|
|
394
417
|
},
|
|
395
418
|
get location() {
|
|
396
|
-
return
|
|
419
|
+
return d;
|
|
397
420
|
},
|
|
398
|
-
createHref:
|
|
399
|
-
push:
|
|
400
|
-
replace:
|
|
421
|
+
createHref: h,
|
|
422
|
+
push: m,
|
|
423
|
+
replace: w,
|
|
401
424
|
go: x,
|
|
402
425
|
back: function() {
|
|
403
426
|
x(-1);
|
|
@@ -405,29 +428,29 @@ function ot(e) {
|
|
|
405
428
|
forward: function() {
|
|
406
429
|
x(1);
|
|
407
430
|
},
|
|
408
|
-
listen: function(
|
|
409
|
-
return
|
|
431
|
+
listen: function(l) {
|
|
432
|
+
return P.push(l);
|
|
410
433
|
},
|
|
411
|
-
block: function(
|
|
412
|
-
var
|
|
413
|
-
return p.length === 1 &&
|
|
414
|
-
|
|
434
|
+
block: function(l) {
|
|
435
|
+
var y = p.push(l);
|
|
436
|
+
return p.length === 1 && n.addEventListener(Re, we), function() {
|
|
437
|
+
y(), p.length || n.removeEventListener(Re, we);
|
|
415
438
|
};
|
|
416
439
|
}
|
|
417
440
|
};
|
|
418
441
|
return U;
|
|
419
442
|
}
|
|
420
|
-
function
|
|
443
|
+
function Or(e) {
|
|
421
444
|
e === void 0 && (e = {});
|
|
422
|
-
var t = e,
|
|
445
|
+
var t = e, r = t.window, n = r === void 0 ? document.defaultView : r, o = n.history;
|
|
423
446
|
function a() {
|
|
424
|
-
var
|
|
425
|
-
return [
|
|
426
|
-
pathname:
|
|
427
|
-
search:
|
|
428
|
-
hash:
|
|
429
|
-
state:
|
|
430
|
-
key:
|
|
447
|
+
var l = he(n.location.hash.substr(1)), y = l.pathname, S = y === void 0 ? "/" : y, k = l.search, C = k === void 0 ? "" : k, B = l.hash, H = B === void 0 ? "" : B, M = o.state || {};
|
|
448
|
+
return [M.idx, re({
|
|
449
|
+
pathname: S,
|
|
450
|
+
search: C,
|
|
451
|
+
hash: H,
|
|
452
|
+
state: M.usr || null,
|
|
453
|
+
key: M.key || "default"
|
|
431
454
|
})];
|
|
432
455
|
}
|
|
433
456
|
var s = null;
|
|
@@ -435,19 +458,19 @@ function In(e) {
|
|
|
435
458
|
if (s)
|
|
436
459
|
p.call(s), s = null;
|
|
437
460
|
else {
|
|
438
|
-
var
|
|
461
|
+
var l = V.Pop, y = a(), S = y[0], k = y[1];
|
|
439
462
|
if (p.length)
|
|
440
|
-
if (
|
|
441
|
-
var
|
|
442
|
-
|
|
443
|
-
action:
|
|
463
|
+
if (S != null) {
|
|
464
|
+
var C = f - S;
|
|
465
|
+
C && (s = {
|
|
466
|
+
action: l,
|
|
444
467
|
location: k,
|
|
445
468
|
retry: function() {
|
|
446
|
-
U(
|
|
469
|
+
U(C * -1);
|
|
447
470
|
}
|
|
448
|
-
}, U(
|
|
471
|
+
}, U(C));
|
|
449
472
|
} else
|
|
450
|
-
process.env.NODE_ENV !== "production" &&
|
|
473
|
+
process.env.NODE_ENV !== "production" && Y(
|
|
451
474
|
!1,
|
|
452
475
|
// TODO: Write up a doc that explains our blocking strategy in
|
|
453
476
|
// detail and link to it here so people can understand better
|
|
@@ -455,97 +478,97 @@ function In(e) {
|
|
|
455
478
|
"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."
|
|
456
479
|
);
|
|
457
480
|
else
|
|
458
|
-
|
|
481
|
+
m(l);
|
|
459
482
|
}
|
|
460
483
|
}
|
|
461
|
-
|
|
462
|
-
var
|
|
463
|
-
|
|
484
|
+
n.addEventListener(Lt, c), n.addEventListener(Ir, function() {
|
|
485
|
+
var l = a(), y = l[1];
|
|
486
|
+
X(y) !== X(d) && c();
|
|
464
487
|
});
|
|
465
|
-
var
|
|
466
|
-
f == null && (f = 0, o.replaceState(
|
|
488
|
+
var i = V.Pop, u = a(), f = u[0], d = u[1], P = ne(), p = ne();
|
|
489
|
+
f == null && (f = 0, o.replaceState(G({}, o.state, {
|
|
467
490
|
idx: f
|
|
468
491
|
}), ""));
|
|
469
|
-
function
|
|
470
|
-
var
|
|
471
|
-
if (
|
|
472
|
-
var
|
|
473
|
-
|
|
492
|
+
function h() {
|
|
493
|
+
var l = document.querySelector("base"), y = "";
|
|
494
|
+
if (l && l.getAttribute("href")) {
|
|
495
|
+
var S = n.location.href, k = S.indexOf("#");
|
|
496
|
+
y = k === -1 ? S : S.slice(0, k);
|
|
474
497
|
}
|
|
475
|
-
return
|
|
498
|
+
return y;
|
|
476
499
|
}
|
|
477
|
-
function
|
|
478
|
-
return
|
|
500
|
+
function v(l) {
|
|
501
|
+
return h() + "#" + (typeof l == "string" ? l : X(l));
|
|
479
502
|
}
|
|
480
|
-
function
|
|
481
|
-
return
|
|
482
|
-
pathname:
|
|
503
|
+
function R(l, y) {
|
|
504
|
+
return y === void 0 && (y = null), re(G({
|
|
505
|
+
pathname: d.pathname,
|
|
483
506
|
hash: "",
|
|
484
507
|
search: ""
|
|
485
|
-
}, typeof
|
|
486
|
-
state:
|
|
487
|
-
key:
|
|
508
|
+
}, typeof l == "string" ? he(l) : l, {
|
|
509
|
+
state: y,
|
|
510
|
+
key: Pe()
|
|
488
511
|
}));
|
|
489
512
|
}
|
|
490
|
-
function
|
|
513
|
+
function E(l, y) {
|
|
491
514
|
return [{
|
|
492
|
-
usr:
|
|
493
|
-
key:
|
|
494
|
-
idx:
|
|
495
|
-
},
|
|
515
|
+
usr: l.state,
|
|
516
|
+
key: l.key,
|
|
517
|
+
idx: y
|
|
518
|
+
}, v(l)];
|
|
496
519
|
}
|
|
497
|
-
function A(
|
|
520
|
+
function A(l, y, S) {
|
|
498
521
|
return !p.length || (p.call({
|
|
499
|
-
action:
|
|
500
|
-
location:
|
|
501
|
-
retry:
|
|
522
|
+
action: l,
|
|
523
|
+
location: y,
|
|
524
|
+
retry: S
|
|
502
525
|
}), !1);
|
|
503
526
|
}
|
|
504
|
-
function
|
|
505
|
-
|
|
506
|
-
var
|
|
507
|
-
f =
|
|
508
|
-
action:
|
|
509
|
-
location:
|
|
527
|
+
function m(l) {
|
|
528
|
+
i = l;
|
|
529
|
+
var y = a();
|
|
530
|
+
f = y[0], d = y[1], P.call({
|
|
531
|
+
action: i,
|
|
532
|
+
location: d
|
|
510
533
|
});
|
|
511
534
|
}
|
|
512
|
-
function
|
|
513
|
-
var
|
|
514
|
-
function
|
|
515
|
-
|
|
535
|
+
function w(l, y) {
|
|
536
|
+
var S = V.Push, k = R(l, y);
|
|
537
|
+
function C() {
|
|
538
|
+
w(l, y);
|
|
516
539
|
}
|
|
517
|
-
if (process.env.NODE_ENV !== "production" &&
|
|
518
|
-
var
|
|
540
|
+
if (process.env.NODE_ENV !== "production" && Y(k.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(l) + ")"), A(S, k, C)) {
|
|
541
|
+
var B = E(k, f + 1), H = B[0], M = B[1];
|
|
519
542
|
try {
|
|
520
|
-
o.pushState(
|
|
543
|
+
o.pushState(H, "", M);
|
|
521
544
|
} catch {
|
|
522
|
-
|
|
545
|
+
n.location.assign(M);
|
|
523
546
|
}
|
|
524
|
-
|
|
547
|
+
m(S);
|
|
525
548
|
}
|
|
526
549
|
}
|
|
527
|
-
function x(
|
|
528
|
-
var
|
|
529
|
-
function
|
|
530
|
-
x(
|
|
550
|
+
function x(l, y) {
|
|
551
|
+
var S = V.Replace, k = R(l, y);
|
|
552
|
+
function C() {
|
|
553
|
+
x(l, y);
|
|
531
554
|
}
|
|
532
|
-
if (process.env.NODE_ENV !== "production" &&
|
|
533
|
-
var
|
|
534
|
-
o.replaceState(
|
|
555
|
+
if (process.env.NODE_ENV !== "production" && Y(k.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(l) + ")"), A(S, k, C)) {
|
|
556
|
+
var B = E(k, f), H = B[0], M = B[1];
|
|
557
|
+
o.replaceState(H, "", M), m(S);
|
|
535
558
|
}
|
|
536
559
|
}
|
|
537
|
-
function U(
|
|
538
|
-
o.go(
|
|
560
|
+
function U(l) {
|
|
561
|
+
o.go(l);
|
|
539
562
|
}
|
|
540
|
-
var
|
|
563
|
+
var g = {
|
|
541
564
|
get action() {
|
|
542
|
-
return
|
|
565
|
+
return i;
|
|
543
566
|
},
|
|
544
567
|
get location() {
|
|
545
|
-
return
|
|
568
|
+
return d;
|
|
546
569
|
},
|
|
547
|
-
createHref:
|
|
548
|
-
push:
|
|
570
|
+
createHref: v,
|
|
571
|
+
push: w,
|
|
549
572
|
replace: x,
|
|
550
573
|
go: U,
|
|
551
574
|
back: function() {
|
|
@@ -554,76 +577,76 @@ function In(e) {
|
|
|
554
577
|
forward: function() {
|
|
555
578
|
U(1);
|
|
556
579
|
},
|
|
557
|
-
listen: function(
|
|
558
|
-
return
|
|
580
|
+
listen: function(y) {
|
|
581
|
+
return P.push(y);
|
|
559
582
|
},
|
|
560
|
-
block: function(
|
|
561
|
-
var
|
|
562
|
-
return p.length === 1 &&
|
|
563
|
-
|
|
583
|
+
block: function(y) {
|
|
584
|
+
var S = p.push(y);
|
|
585
|
+
return p.length === 1 && n.addEventListener(Re, we), function() {
|
|
586
|
+
S(), p.length || n.removeEventListener(Re, we);
|
|
564
587
|
};
|
|
565
588
|
}
|
|
566
589
|
};
|
|
567
|
-
return
|
|
590
|
+
return g;
|
|
568
591
|
}
|
|
569
|
-
function
|
|
592
|
+
function st(e) {
|
|
570
593
|
e === void 0 && (e = {});
|
|
571
|
-
var t = e,
|
|
572
|
-
var
|
|
594
|
+
var t = e, r = t.initialEntries, n = r === void 0 ? ["/"] : r, o = t.initialIndex, a = n.map(function(m) {
|
|
595
|
+
var w = re(G({
|
|
573
596
|
pathname: "/",
|
|
574
597
|
search: "",
|
|
575
598
|
hash: "",
|
|
576
599
|
state: null,
|
|
577
|
-
key:
|
|
578
|
-
}, typeof
|
|
579
|
-
return process.env.NODE_ENV !== "production" &&
|
|
580
|
-
}), s =
|
|
581
|
-
function
|
|
582
|
-
return typeof
|
|
583
|
-
}
|
|
584
|
-
function m
|
|
585
|
-
return
|
|
586
|
-
pathname:
|
|
600
|
+
key: Pe()
|
|
601
|
+
}, typeof m == "string" ? he(m) : m));
|
|
602
|
+
return process.env.NODE_ENV !== "production" && Y(w.pathname.charAt(0) === "/", "Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: " + JSON.stringify(m) + ")"), w;
|
|
603
|
+
}), s = ct(o ?? a.length - 1, 0, a.length - 1), c = V.Pop, i = a[s], u = ne(), f = ne();
|
|
604
|
+
function d(m) {
|
|
605
|
+
return typeof m == "string" ? m : X(m);
|
|
606
|
+
}
|
|
607
|
+
function P(m, w) {
|
|
608
|
+
return w === void 0 && (w = null), re(G({
|
|
609
|
+
pathname: i.pathname,
|
|
587
610
|
search: "",
|
|
588
611
|
hash: ""
|
|
589
|
-
}, typeof
|
|
590
|
-
state:
|
|
591
|
-
key:
|
|
612
|
+
}, typeof m == "string" ? he(m) : m, {
|
|
613
|
+
state: w,
|
|
614
|
+
key: Pe()
|
|
592
615
|
}));
|
|
593
616
|
}
|
|
594
|
-
function p(
|
|
617
|
+
function p(m, w, x) {
|
|
595
618
|
return !f.length || (f.call({
|
|
596
|
-
action:
|
|
597
|
-
location:
|
|
619
|
+
action: m,
|
|
620
|
+
location: w,
|
|
598
621
|
retry: x
|
|
599
622
|
}), !1);
|
|
600
623
|
}
|
|
601
|
-
function
|
|
602
|
-
c =
|
|
624
|
+
function h(m, w) {
|
|
625
|
+
c = m, i = w, u.call({
|
|
603
626
|
action: c,
|
|
604
|
-
location:
|
|
627
|
+
location: i
|
|
605
628
|
});
|
|
606
629
|
}
|
|
607
|
-
function
|
|
608
|
-
var x =
|
|
609
|
-
function
|
|
610
|
-
|
|
630
|
+
function v(m, w) {
|
|
631
|
+
var x = V.Push, U = P(m, w);
|
|
632
|
+
function g() {
|
|
633
|
+
v(m, w);
|
|
611
634
|
}
|
|
612
|
-
process.env.NODE_ENV !== "production" &&
|
|
635
|
+
process.env.NODE_ENV !== "production" && Y(i.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.push(" + JSON.stringify(m) + ")"), p(x, U, g) && (s += 1, a.splice(s, a.length, U), h(x, U));
|
|
613
636
|
}
|
|
614
|
-
function
|
|
615
|
-
var x =
|
|
616
|
-
function
|
|
617
|
-
|
|
637
|
+
function R(m, w) {
|
|
638
|
+
var x = V.Replace, U = P(m, w);
|
|
639
|
+
function g() {
|
|
640
|
+
R(m, w);
|
|
618
641
|
}
|
|
619
|
-
process.env.NODE_ENV !== "production" &&
|
|
642
|
+
process.env.NODE_ENV !== "production" && Y(i.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.replace(" + JSON.stringify(m) + ")"), p(x, U, g) && (a[s] = U, h(x, U));
|
|
620
643
|
}
|
|
621
|
-
function
|
|
622
|
-
var
|
|
623
|
-
function
|
|
624
|
-
|
|
644
|
+
function E(m) {
|
|
645
|
+
var w = ct(s + m, 0, a.length - 1), x = V.Pop, U = a[w];
|
|
646
|
+
function g() {
|
|
647
|
+
E(m);
|
|
625
648
|
}
|
|
626
|
-
p(x, U,
|
|
649
|
+
p(x, U, g) && (s = w, h(x, U));
|
|
627
650
|
}
|
|
628
651
|
var A = {
|
|
629
652
|
get index() {
|
|
@@ -633,31 +656,31 @@ function at(e) {
|
|
|
633
656
|
return c;
|
|
634
657
|
},
|
|
635
658
|
get location() {
|
|
636
|
-
return
|
|
659
|
+
return i;
|
|
637
660
|
},
|
|
638
|
-
createHref:
|
|
639
|
-
push:
|
|
640
|
-
replace:
|
|
641
|
-
go:
|
|
661
|
+
createHref: d,
|
|
662
|
+
push: v,
|
|
663
|
+
replace: R,
|
|
664
|
+
go: E,
|
|
642
665
|
back: function() {
|
|
643
|
-
|
|
666
|
+
E(-1);
|
|
644
667
|
},
|
|
645
668
|
forward: function() {
|
|
646
|
-
|
|
669
|
+
E(1);
|
|
647
670
|
},
|
|
648
|
-
listen: function(
|
|
649
|
-
return
|
|
671
|
+
listen: function(w) {
|
|
672
|
+
return u.push(w);
|
|
650
673
|
},
|
|
651
|
-
block: function(
|
|
652
|
-
return f.push(
|
|
674
|
+
block: function(w) {
|
|
675
|
+
return f.push(w);
|
|
653
676
|
}
|
|
654
677
|
};
|
|
655
678
|
return A;
|
|
656
679
|
}
|
|
657
|
-
function
|
|
658
|
-
return Math.min(Math.max(e, t),
|
|
680
|
+
function ct(e, t, r) {
|
|
681
|
+
return Math.min(Math.max(e, t), r);
|
|
659
682
|
}
|
|
660
|
-
function
|
|
683
|
+
function we(e) {
|
|
661
684
|
e.preventDefault(), e.returnValue = "";
|
|
662
685
|
}
|
|
663
686
|
function ne() {
|
|
@@ -666,321 +689,298 @@ function ne() {
|
|
|
666
689
|
get length() {
|
|
667
690
|
return e.length;
|
|
668
691
|
},
|
|
669
|
-
push: function(
|
|
670
|
-
return e.push(
|
|
671
|
-
e = e.filter(function(
|
|
672
|
-
return
|
|
692
|
+
push: function(r) {
|
|
693
|
+
return e.push(r), function() {
|
|
694
|
+
e = e.filter(function(n) {
|
|
695
|
+
return n !== r;
|
|
673
696
|
});
|
|
674
697
|
};
|
|
675
698
|
},
|
|
676
|
-
call: function(
|
|
677
|
-
e.forEach(function(
|
|
678
|
-
return
|
|
699
|
+
call: function(r) {
|
|
700
|
+
e.forEach(function(n) {
|
|
701
|
+
return n && n(r);
|
|
679
702
|
});
|
|
680
703
|
}
|
|
681
704
|
};
|
|
682
705
|
}
|
|
683
|
-
function
|
|
706
|
+
function Pe() {
|
|
684
707
|
return Math.random().toString(36).substr(2, 8);
|
|
685
708
|
}
|
|
686
|
-
function
|
|
687
|
-
var t = e.pathname,
|
|
688
|
-
return o && o !== "?" && (
|
|
709
|
+
function X(e) {
|
|
710
|
+
var t = e.pathname, r = t === void 0 ? "/" : t, n = e.search, o = n === void 0 ? "" : n, a = e.hash, s = a === void 0 ? "" : a;
|
|
711
|
+
return o && o !== "?" && (r += o.charAt(0) === "?" ? o : "?" + o), s && s !== "#" && (r += s.charAt(0) === "#" ? s : "#" + s), r;
|
|
689
712
|
}
|
|
690
713
|
function he(e) {
|
|
691
714
|
var t = {};
|
|
692
715
|
if (e) {
|
|
693
|
-
var
|
|
694
|
-
|
|
695
|
-
var
|
|
696
|
-
|
|
716
|
+
var r = e.indexOf("#");
|
|
717
|
+
r >= 0 && (t.hash = e.substr(r), e = e.substr(0, r));
|
|
718
|
+
var n = e.indexOf("?");
|
|
719
|
+
n >= 0 && (t.search = e.substr(n), e = e.substr(0, n)), e && (t.pathname = e);
|
|
697
720
|
}
|
|
698
721
|
return t;
|
|
699
722
|
}
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
* This detailed error message aids in quickly identifying and resolving mismatches in route usage.
|
|
704
|
-
* @param routeName - The route name that was incorrectly used.
|
|
705
|
-
* @param actualRouteName - The expected route name that should have been used.
|
|
706
|
-
*/
|
|
707
|
-
constructor(t, n) {
|
|
708
|
-
super(`useRoute called with incorrect route. Given ${t}, expected ${n}`);
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
const xt = Symbol();
|
|
712
|
-
function Jn() {
|
|
713
|
-
const e = oe(xt);
|
|
714
|
-
if (!e)
|
|
715
|
-
throw new pe();
|
|
716
|
-
return e;
|
|
717
|
-
}
|
|
718
|
-
const Ut = Symbol();
|
|
719
|
-
function We() {
|
|
720
|
-
const e = oe(Ut);
|
|
723
|
+
const Ct = Symbol();
|
|
724
|
+
function Fr() {
|
|
725
|
+
const e = ae(Ct);
|
|
721
726
|
if (!e)
|
|
722
727
|
throw new pe();
|
|
723
728
|
return e;
|
|
724
729
|
}
|
|
725
730
|
const Bt = Symbol("isRouterRouteSymbol");
|
|
726
|
-
function
|
|
731
|
+
function Jr(e) {
|
|
727
732
|
return typeof e == "object" && e !== null && Bt in e;
|
|
728
733
|
}
|
|
729
|
-
function
|
|
730
|
-
function
|
|
734
|
+
function Qr(e, t) {
|
|
735
|
+
function r(R, E, A) {
|
|
731
736
|
if (typeof R == "object") {
|
|
732
|
-
const
|
|
737
|
+
const w = {
|
|
733
738
|
...e.params,
|
|
734
739
|
...R
|
|
735
740
|
};
|
|
736
|
-
return t(e.name,
|
|
741
|
+
return t(e.name, w, E);
|
|
737
742
|
}
|
|
738
|
-
const
|
|
743
|
+
const m = {
|
|
739
744
|
...e.params,
|
|
740
|
-
[R]:
|
|
745
|
+
[R]: E
|
|
741
746
|
};
|
|
742
|
-
return t(e.name,
|
|
747
|
+
return t(e.name, m, A);
|
|
743
748
|
}
|
|
744
|
-
const
|
|
745
|
-
const
|
|
746
|
-
|
|
749
|
+
const n = (...R) => {
|
|
750
|
+
const E = new URLSearchParams(e.query);
|
|
751
|
+
E.set(...R), r({}, { query: E });
|
|
747
752
|
}, o = (...R) => {
|
|
748
|
-
const
|
|
749
|
-
|
|
753
|
+
const E = new URLSearchParams(e.query);
|
|
754
|
+
E.append(...R), r({}, { query: E });
|
|
750
755
|
}, a = (...R) => {
|
|
751
|
-
const
|
|
752
|
-
|
|
753
|
-
}, { id: s, matched: c, matches:
|
|
756
|
+
const E = new URLSearchParams(e.query);
|
|
757
|
+
E.delete(...R), r({}, { query: E });
|
|
758
|
+
}, { id: s, matched: c, matches: i, name: u, hash: f, href: d } = hr(e), P = N({
|
|
754
759
|
get() {
|
|
755
760
|
return new Proxy(e.params, {
|
|
756
|
-
set(R,
|
|
757
|
-
return
|
|
761
|
+
set(R, E, A) {
|
|
762
|
+
return r(E, A), !0;
|
|
758
763
|
}
|
|
759
764
|
});
|
|
760
765
|
},
|
|
761
766
|
set(R) {
|
|
762
|
-
|
|
767
|
+
r(R);
|
|
763
768
|
}
|
|
764
|
-
}),
|
|
769
|
+
}), p = N({
|
|
765
770
|
get() {
|
|
766
771
|
return new Proxy(e.query, {
|
|
767
|
-
get(R,
|
|
768
|
-
switch (
|
|
772
|
+
get(R, E, A) {
|
|
773
|
+
switch (E) {
|
|
769
774
|
case "append":
|
|
770
775
|
return o;
|
|
771
776
|
case "set":
|
|
772
|
-
return
|
|
777
|
+
return n;
|
|
773
778
|
case "delete":
|
|
774
779
|
return a;
|
|
775
780
|
default:
|
|
776
|
-
return Reflect.get(R,
|
|
781
|
+
return Reflect.get(R, E, A);
|
|
777
782
|
}
|
|
778
783
|
}
|
|
779
784
|
});
|
|
780
785
|
},
|
|
781
786
|
set(R) {
|
|
782
|
-
|
|
787
|
+
r({}, { query: R });
|
|
783
788
|
}
|
|
784
|
-
}),
|
|
789
|
+
}), h = N({
|
|
785
790
|
get() {
|
|
786
791
|
return new Proxy(e.state, {
|
|
787
|
-
set(R,
|
|
788
|
-
return
|
|
792
|
+
set(R, E, A) {
|
|
793
|
+
return r({}, { state: { ...e.state, [E]: A } }), !0;
|
|
789
794
|
}
|
|
790
795
|
});
|
|
791
796
|
},
|
|
792
797
|
set(R) {
|
|
793
|
-
|
|
798
|
+
r({}, { state: R });
|
|
794
799
|
}
|
|
795
800
|
});
|
|
796
|
-
return
|
|
801
|
+
return xe({
|
|
797
802
|
id: s,
|
|
798
803
|
matched: c,
|
|
799
|
-
matches:
|
|
800
|
-
state:
|
|
801
|
-
query:
|
|
804
|
+
matches: i,
|
|
805
|
+
state: h,
|
|
806
|
+
query: p,
|
|
802
807
|
hash: f,
|
|
803
|
-
params:
|
|
804
|
-
name:
|
|
805
|
-
|
|
808
|
+
params: P,
|
|
809
|
+
name: u,
|
|
810
|
+
href: d,
|
|
811
|
+
update: r,
|
|
806
812
|
[Bt]: !0
|
|
807
813
|
});
|
|
808
814
|
}
|
|
809
|
-
const
|
|
810
|
-
function
|
|
811
|
-
const
|
|
812
|
-
Object.assign(
|
|
813
|
-
[
|
|
815
|
+
const Nt = Symbol();
|
|
816
|
+
function zr(e, t) {
|
|
817
|
+
const r = xe({ ...e }), n = (s) => {
|
|
818
|
+
Object.assign(r, {
|
|
819
|
+
[Nt]: !1,
|
|
814
820
|
...s
|
|
815
821
|
});
|
|
816
|
-
}, o =
|
|
822
|
+
}, o = r, a = Qr(o, t);
|
|
817
823
|
return {
|
|
818
824
|
currentRoute: o,
|
|
819
825
|
routerRoute: a,
|
|
820
|
-
updateRoute:
|
|
826
|
+
updateRoute: n
|
|
821
827
|
};
|
|
822
828
|
}
|
|
823
|
-
function
|
|
824
|
-
return !e.startsWith("http") ?
|
|
829
|
+
function _(e) {
|
|
830
|
+
return !e.startsWith("http") ? Kr(e) : Gr(e);
|
|
825
831
|
}
|
|
826
|
-
function
|
|
827
|
-
const { protocol: t, host:
|
|
832
|
+
function Gr(e) {
|
|
833
|
+
const { protocol: t, host: r, pathname: n, search: o, searchParams: a, hash: s } = new URL(e, e);
|
|
828
834
|
return {
|
|
829
835
|
protocol: t,
|
|
830
|
-
host:
|
|
831
|
-
pathname:
|
|
836
|
+
host: r,
|
|
837
|
+
pathname: n,
|
|
832
838
|
search: o,
|
|
833
839
|
searchParams: a,
|
|
834
840
|
hash: s
|
|
835
841
|
};
|
|
836
842
|
}
|
|
837
|
-
function
|
|
838
|
-
const { pathname: t, search:
|
|
843
|
+
function Kr(e) {
|
|
844
|
+
const { pathname: t, search: r, searchParams: n, hash: o } = new URL(e, "https://localhost");
|
|
839
845
|
return {
|
|
840
846
|
pathname: t,
|
|
841
|
-
search:
|
|
842
|
-
searchParams:
|
|
847
|
+
search: r,
|
|
848
|
+
searchParams: n,
|
|
843
849
|
hash: o
|
|
844
850
|
};
|
|
845
851
|
}
|
|
846
|
-
function
|
|
852
|
+
function Yr(e) {
|
|
847
853
|
return (t) => {
|
|
848
|
-
const { host:
|
|
849
|
-
return !(
|
|
854
|
+
const { host: r } = _(t);
|
|
855
|
+
return !(r === void 0 || r === e);
|
|
850
856
|
};
|
|
851
857
|
}
|
|
852
|
-
function
|
|
853
|
-
const
|
|
854
|
-
if (
|
|
855
|
-
|
|
858
|
+
function Xr({ mode: e, listener: t }) {
|
|
859
|
+
const r = Zr(e), n = (i, u) => {
|
|
860
|
+
if (u != null && u.replace) {
|
|
861
|
+
r.replace(i, u.state);
|
|
856
862
|
return;
|
|
857
863
|
}
|
|
858
|
-
|
|
864
|
+
r.push(i, u == null ? void 0 : u.state);
|
|
859
865
|
}, o = () => {
|
|
860
|
-
const
|
|
861
|
-
|
|
866
|
+
const i = X(r.location);
|
|
867
|
+
r.replace(i);
|
|
862
868
|
};
|
|
863
869
|
let a;
|
|
864
870
|
return {
|
|
865
|
-
...
|
|
866
|
-
update:
|
|
871
|
+
...r,
|
|
872
|
+
update: n,
|
|
867
873
|
refresh: o,
|
|
868
874
|
startListening: () => {
|
|
869
|
-
a == null || a(), a =
|
|
875
|
+
a == null || a(), a = r.listen(t);
|
|
870
876
|
},
|
|
871
877
|
stopListening: () => {
|
|
872
878
|
a == null || a();
|
|
873
879
|
}
|
|
874
880
|
};
|
|
875
881
|
}
|
|
876
|
-
function
|
|
882
|
+
function Zr(e = "auto") {
|
|
877
883
|
switch (e) {
|
|
878
884
|
case "auto":
|
|
879
|
-
return
|
|
885
|
+
return We() ? at() : st();
|
|
880
886
|
case "browser":
|
|
881
|
-
return ot();
|
|
882
|
-
case "memory":
|
|
883
887
|
return at();
|
|
888
|
+
case "memory":
|
|
889
|
+
return st();
|
|
884
890
|
case "hash":
|
|
885
|
-
return
|
|
891
|
+
return Or();
|
|
886
892
|
default:
|
|
887
893
|
const t = e;
|
|
888
894
|
throw new Error(`Switch is not exhaustive for mode: ${t}`);
|
|
889
895
|
}
|
|
890
896
|
}
|
|
891
|
-
class
|
|
897
|
+
class Ee {
|
|
892
898
|
constructor() {
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
+
I(this, "onBeforeRouteEnter", /* @__PURE__ */ new Set());
|
|
900
|
+
I(this, "onBeforeRouteUpdate", /* @__PURE__ */ new Set());
|
|
901
|
+
I(this, "onBeforeRouteLeave", /* @__PURE__ */ new Set());
|
|
902
|
+
I(this, "onAfterRouteEnter", /* @__PURE__ */ new Set());
|
|
903
|
+
I(this, "onAfterRouteUpdate", /* @__PURE__ */ new Set());
|
|
904
|
+
I(this, "onAfterRouteLeave", /* @__PURE__ */ new Set());
|
|
899
905
|
}
|
|
900
906
|
}
|
|
901
|
-
class
|
|
907
|
+
class Vt extends Error {
|
|
902
908
|
constructor() {
|
|
903
909
|
super("Uncaught CallbackContextAbortError");
|
|
904
|
-
|
|
910
|
+
I(this, "response");
|
|
905
911
|
this.response = { status: "ABORT" };
|
|
906
912
|
}
|
|
907
913
|
}
|
|
908
|
-
class
|
|
909
|
-
constructor(
|
|
914
|
+
class te extends Error {
|
|
915
|
+
constructor(r) {
|
|
910
916
|
super("Uncaught CallbackContextPushError");
|
|
911
|
-
|
|
912
|
-
this.response = { status: "PUSH", to:
|
|
917
|
+
I(this, "response");
|
|
918
|
+
this.response = { status: "PUSH", to: r };
|
|
913
919
|
}
|
|
914
920
|
}
|
|
915
|
-
class
|
|
916
|
-
constructor(
|
|
921
|
+
class be extends Error {
|
|
922
|
+
constructor(r) {
|
|
917
923
|
super("Uncaught CallbackContextRejectionError");
|
|
918
|
-
|
|
919
|
-
this.response = { status: "REJECT", type:
|
|
920
|
-
}
|
|
921
|
-
}
|
|
922
|
-
function
|
|
923
|
-
const
|
|
924
|
-
return e.matches.forEach((
|
|
925
|
-
|
|
926
|
-
}), t.matches.forEach((
|
|
927
|
-
|
|
928
|
-
}),
|
|
929
|
-
}
|
|
930
|
-
function
|
|
931
|
-
const
|
|
932
|
-
return e.matches.forEach((
|
|
933
|
-
|
|
934
|
-
}), t.matches.forEach((
|
|
935
|
-
|
|
936
|
-
}),
|
|
937
|
-
}
|
|
938
|
-
function
|
|
939
|
-
return typeof e != "string" ? !1 : /^(https?:\/\/|\/).*/g.test(e);
|
|
940
|
-
}
|
|
941
|
-
function rr(e) {
|
|
942
|
-
return M(e) ? e : `/${e}`;
|
|
943
|
-
}
|
|
944
|
-
function Nt() {
|
|
924
|
+
I(this, "response");
|
|
925
|
+
this.response = { status: "REJECT", type: r };
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
function en(e, t) {
|
|
929
|
+
const r = new Ee();
|
|
930
|
+
return e.matches.forEach((n, o) => {
|
|
931
|
+
n.onBeforeRouteEnter && De(e, t, o) && ee(n.onBeforeRouteEnter).forEach((a) => r.onBeforeRouteEnter.add(a)), n.onBeforeRouteUpdate && Ie(e, t, o) && ee(n.onBeforeRouteUpdate).forEach((a) => r.onBeforeRouteUpdate.add(a));
|
|
932
|
+
}), t.matches.forEach((n, o) => {
|
|
933
|
+
n.onBeforeRouteLeave && Te(e, t, o) && ee(n.onBeforeRouteLeave).forEach((a) => r.onBeforeRouteLeave.add(a));
|
|
934
|
+
}), r;
|
|
935
|
+
}
|
|
936
|
+
function tn(e, t) {
|
|
937
|
+
const r = new Ee();
|
|
938
|
+
return e.matches.forEach((n, o) => {
|
|
939
|
+
n.onAfterRouteEnter && De(e, t, o) && ee(n.onAfterRouteEnter).forEach((a) => r.onAfterRouteEnter.add(a)), n.onAfterRouteUpdate && Ie(e, t, o) && ee(n.onAfterRouteUpdate).forEach((a) => r.onAfterRouteUpdate.add(a));
|
|
940
|
+
}), t.matches.forEach((n, o) => {
|
|
941
|
+
n.onAfterRouteLeave && Te(e, t, o) && ee(n.onAfterRouteLeave).forEach((a) => r.onAfterRouteLeave.add(a));
|
|
942
|
+
}), r;
|
|
943
|
+
}
|
|
944
|
+
function Ht() {
|
|
945
945
|
return { reject: (o) => {
|
|
946
|
-
throw new
|
|
946
|
+
throw new be(o);
|
|
947
947
|
}, push: (...o) => {
|
|
948
|
-
throw new
|
|
948
|
+
throw new te(o);
|
|
949
949
|
}, replace: (o, a, s) => {
|
|
950
|
-
if (
|
|
951
|
-
const
|
|
952
|
-
throw new
|
|
950
|
+
if (O(o)) {
|
|
951
|
+
const u = a ?? {};
|
|
952
|
+
throw new te([o, { ...u, replace: !0 }]);
|
|
953
953
|
}
|
|
954
|
-
const c = a,
|
|
955
|
-
throw new
|
|
954
|
+
const c = a, i = s ?? {};
|
|
955
|
+
throw new te([o, c, { ...i, replace: !0 }]);
|
|
956
956
|
}, abort: () => {
|
|
957
|
-
throw new
|
|
957
|
+
throw new Vt();
|
|
958
958
|
} };
|
|
959
959
|
}
|
|
960
|
-
function
|
|
961
|
-
const { reject: e, push: t, replace:
|
|
962
|
-
async function o({ to: s, from: c, hooks:
|
|
963
|
-
const { global:
|
|
964
|
-
...
|
|
965
|
-
...
|
|
966
|
-
...
|
|
967
|
-
...
|
|
960
|
+
function rn() {
|
|
961
|
+
const { reject: e, push: t, replace: r, abort: n } = Ht();
|
|
962
|
+
async function o({ to: s, from: c, hooks: i }) {
|
|
963
|
+
const { global: u, component: f } = i, d = en(s, c), P = [
|
|
964
|
+
...u.onBeforeRouteEnter,
|
|
965
|
+
...d.onBeforeRouteEnter,
|
|
966
|
+
...u.onBeforeRouteUpdate,
|
|
967
|
+
...d.onBeforeRouteUpdate,
|
|
968
968
|
...f.onBeforeRouteUpdate,
|
|
969
|
-
...
|
|
970
|
-
...
|
|
969
|
+
...u.onBeforeRouteLeave,
|
|
970
|
+
...d.onBeforeRouteLeave,
|
|
971
971
|
...f.onBeforeRouteLeave
|
|
972
972
|
];
|
|
973
973
|
try {
|
|
974
|
-
const p =
|
|
974
|
+
const p = P.map((h) => h(s, {
|
|
975
975
|
from: c,
|
|
976
976
|
reject: e,
|
|
977
977
|
push: t,
|
|
978
|
-
replace:
|
|
979
|
-
abort:
|
|
978
|
+
replace: r,
|
|
979
|
+
abort: n
|
|
980
980
|
}));
|
|
981
981
|
await Promise.all(p);
|
|
982
982
|
} catch (p) {
|
|
983
|
-
if (p instanceof
|
|
983
|
+
if (p instanceof te || p instanceof be || p instanceof Vt)
|
|
984
984
|
return p.response;
|
|
985
985
|
throw p;
|
|
986
986
|
}
|
|
@@ -988,28 +988,28 @@ function or() {
|
|
|
988
988
|
status: "SUCCESS"
|
|
989
989
|
};
|
|
990
990
|
}
|
|
991
|
-
async function a({ to: s, from: c, hooks:
|
|
992
|
-
const { global:
|
|
991
|
+
async function a({ to: s, from: c, hooks: i }) {
|
|
992
|
+
const { global: u, component: f } = i, d = tn(s, c), P = [
|
|
993
993
|
...f.onAfterRouteLeave,
|
|
994
|
-
...
|
|
995
|
-
...
|
|
994
|
+
...d.onAfterRouteLeave,
|
|
995
|
+
...u.onAfterRouteLeave,
|
|
996
996
|
...f.onAfterRouteUpdate,
|
|
997
|
-
...
|
|
998
|
-
...
|
|
997
|
+
...d.onAfterRouteUpdate,
|
|
998
|
+
...u.onAfterRouteUpdate,
|
|
999
999
|
...f.onAfterRouteEnter,
|
|
1000
|
-
...
|
|
1001
|
-
...
|
|
1000
|
+
...d.onAfterRouteEnter,
|
|
1001
|
+
...u.onAfterRouteEnter
|
|
1002
1002
|
];
|
|
1003
1003
|
try {
|
|
1004
|
-
const p =
|
|
1004
|
+
const p = P.map((h) => h(s, {
|
|
1005
1005
|
from: c,
|
|
1006
1006
|
reject: e,
|
|
1007
1007
|
push: t,
|
|
1008
|
-
replace:
|
|
1008
|
+
replace: r
|
|
1009
1009
|
}));
|
|
1010
1010
|
await Promise.all(p);
|
|
1011
1011
|
} catch (p) {
|
|
1012
|
-
if (p instanceof
|
|
1012
|
+
if (p instanceof te || p instanceof be)
|
|
1013
1013
|
return p.response;
|
|
1014
1014
|
throw p;
|
|
1015
1015
|
}
|
|
@@ -1022,57 +1022,57 @@ function or() {
|
|
|
1022
1022
|
runAfterRouteHooks: a
|
|
1023
1023
|
};
|
|
1024
1024
|
}
|
|
1025
|
-
const De = (e, t,
|
|
1025
|
+
const De = (e, t, r) => {
|
|
1026
1026
|
var a;
|
|
1027
|
-
const
|
|
1028
|
-
return
|
|
1029
|
-
},
|
|
1027
|
+
const n = e.matches, o = (t == null ? void 0 : t.matches) ?? [];
|
|
1028
|
+
return n.length < r || n[r].id !== ((a = o[r]) == null ? void 0 : a.id);
|
|
1029
|
+
}, Te = (e, t, r) => {
|
|
1030
1030
|
var a;
|
|
1031
|
-
const
|
|
1032
|
-
return
|
|
1033
|
-
},
|
|
1034
|
-
var
|
|
1035
|
-
return e.matches[
|
|
1031
|
+
const n = e.matches, o = (t == null ? void 0 : t.matches) ?? [];
|
|
1032
|
+
return n.length < r || n[r].id !== ((a = o[r]) == null ? void 0 : a.id);
|
|
1033
|
+
}, Ie = (e, t, r) => {
|
|
1034
|
+
var n;
|
|
1035
|
+
return e.matches[r].id === ((n = t == null ? void 0 : t.matches[r]) == null ? void 0 : n.id);
|
|
1036
1036
|
};
|
|
1037
|
-
function
|
|
1037
|
+
function ut(e) {
|
|
1038
1038
|
switch (e) {
|
|
1039
1039
|
case "onBeforeRouteEnter":
|
|
1040
1040
|
case "onAfterRouteEnter":
|
|
1041
1041
|
return De;
|
|
1042
1042
|
case "onBeforeRouteUpdate":
|
|
1043
1043
|
case "onAfterRouteUpdate":
|
|
1044
|
-
return
|
|
1044
|
+
return Ie;
|
|
1045
1045
|
case "onBeforeRouteLeave":
|
|
1046
1046
|
case "onAfterRouteLeave":
|
|
1047
|
-
return
|
|
1047
|
+
return Te;
|
|
1048
1048
|
default:
|
|
1049
1049
|
throw new Error(`Switch is not exhaustive for lifecycle: ${e}`);
|
|
1050
1050
|
}
|
|
1051
1051
|
}
|
|
1052
|
-
function
|
|
1052
|
+
function nn() {
|
|
1053
1053
|
const e = {
|
|
1054
|
-
global: new
|
|
1055
|
-
component: new
|
|
1054
|
+
global: new Ee(),
|
|
1055
|
+
component: new Ee()
|
|
1056
1056
|
};
|
|
1057
|
-
function t({ lifecycle:
|
|
1058
|
-
const c =
|
|
1059
|
-
if (c(f,
|
|
1060
|
-
return s(f,
|
|
1057
|
+
function t({ lifecycle: n, timing: o, depth: a, hook: s }) {
|
|
1058
|
+
const c = ut(n), i = e[o][n], u = (f, d) => {
|
|
1059
|
+
if (c(f, d.from, a))
|
|
1060
|
+
return s(f, d);
|
|
1061
1061
|
};
|
|
1062
|
-
return
|
|
1062
|
+
return i.add(u), () => i.delete(u);
|
|
1063
1063
|
}
|
|
1064
|
-
function
|
|
1065
|
-
const c =
|
|
1066
|
-
if (c(f,
|
|
1067
|
-
return s(f,
|
|
1064
|
+
function r({ lifecycle: n, timing: o, depth: a, hook: s }) {
|
|
1065
|
+
const c = ut(n), i = e[o][n], u = (f, d) => {
|
|
1066
|
+
if (c(f, d.from, a))
|
|
1067
|
+
return s(f, d);
|
|
1068
1068
|
};
|
|
1069
|
-
return
|
|
1069
|
+
return i.add(u), () => i.delete(u);
|
|
1070
1070
|
}
|
|
1071
|
-
return { ...e, addBeforeRouteHook: t, addAfterRouteHook:
|
|
1071
|
+
return { ...e, addBeforeRouteHook: t, addAfterRouteHook: r };
|
|
1072
1072
|
}
|
|
1073
|
-
const
|
|
1074
|
-
function
|
|
1075
|
-
const e =
|
|
1073
|
+
const jt = Symbol();
|
|
1074
|
+
function on() {
|
|
1075
|
+
const e = nn();
|
|
1076
1076
|
return {
|
|
1077
1077
|
onBeforeRouteEnter: (c) => e.addBeforeRouteHook({ lifecycle: "onBeforeRouteEnter", hook: c, timing: "global", depth: 0 }),
|
|
1078
1078
|
onBeforeRouteUpdate: (c) => e.addBeforeRouteHook({ lifecycle: "onBeforeRouteUpdate", hook: c, timing: "global", depth: 0 }),
|
|
@@ -1083,52 +1083,57 @@ function sr() {
|
|
|
1083
1083
|
hooks: e
|
|
1084
1084
|
};
|
|
1085
1085
|
}
|
|
1086
|
-
function
|
|
1087
|
-
return
|
|
1086
|
+
function an(e) {
|
|
1087
|
+
return se(() => () => Z("h1", e), {
|
|
1088
1088
|
name: e,
|
|
1089
1089
|
props: []
|
|
1090
1090
|
});
|
|
1091
1091
|
}
|
|
1092
|
-
function
|
|
1092
|
+
function Oe(e) {
|
|
1093
1093
|
const t = new URLSearchParams(e);
|
|
1094
1094
|
return {
|
|
1095
|
-
get: (...
|
|
1096
|
-
getAll: (...
|
|
1097
|
-
set: (...
|
|
1098
|
-
t.set(...
|
|
1095
|
+
get: (...r) => t.get(...r),
|
|
1096
|
+
getAll: (...r) => t.getAll(...r),
|
|
1097
|
+
set: (...r) => {
|
|
1098
|
+
t.set(...r);
|
|
1099
1099
|
},
|
|
1100
|
-
append: (...
|
|
1101
|
-
t.append(...
|
|
1100
|
+
append: (...r) => {
|
|
1101
|
+
t.append(...r);
|
|
1102
1102
|
},
|
|
1103
|
-
delete: (...
|
|
1104
|
-
t.delete(...
|
|
1103
|
+
delete: (...r) => {
|
|
1104
|
+
t.delete(...r);
|
|
1105
1105
|
},
|
|
1106
|
-
toString: (...
|
|
1107
|
-
forEach: (...
|
|
1108
|
-
t.forEach(...
|
|
1106
|
+
toString: (...r) => t.toString(...r),
|
|
1107
|
+
forEach: (...r) => {
|
|
1108
|
+
t.forEach(...r);
|
|
1109
1109
|
},
|
|
1110
|
-
entries: (...
|
|
1111
|
-
keys: (...
|
|
1112
|
-
values: (...
|
|
1113
|
-
has: (...
|
|
1110
|
+
entries: (...r) => t.entries(...r),
|
|
1111
|
+
keys: (...r) => t.keys(...r),
|
|
1112
|
+
values: (...r) => t.values(...r),
|
|
1113
|
+
has: (...r) => t.has(...r),
|
|
1114
|
+
size: t.size,
|
|
1115
|
+
sort: () => {
|
|
1116
|
+
t.sort();
|
|
1117
|
+
},
|
|
1118
|
+
[Symbol.iterator]: () => t[Symbol.iterator]()
|
|
1114
1119
|
};
|
|
1115
1120
|
}
|
|
1116
|
-
function
|
|
1121
|
+
function $t() {
|
|
1117
1122
|
let e = 0;
|
|
1118
1123
|
return () => (++e).toString();
|
|
1119
1124
|
}
|
|
1120
|
-
const
|
|
1121
|
-
function
|
|
1125
|
+
const Fe = $t();
|
|
1126
|
+
function sn({
|
|
1122
1127
|
rejections: e
|
|
1123
1128
|
}) {
|
|
1124
1129
|
const t = (a) => {
|
|
1125
1130
|
const s = {
|
|
1126
1131
|
...e
|
|
1127
1132
|
};
|
|
1128
|
-
return
|
|
1129
|
-
},
|
|
1130
|
-
const s =
|
|
1131
|
-
id:
|
|
1133
|
+
return ye(s[a] ?? an(a));
|
|
1134
|
+
}, r = (a) => {
|
|
1135
|
+
const s = ye(t(a)), c = {
|
|
1136
|
+
id: Fe(),
|
|
1132
1137
|
component: s,
|
|
1133
1138
|
meta: {},
|
|
1134
1139
|
state: {}
|
|
@@ -1138,673 +1143,709 @@ function ur({
|
|
|
1138
1143
|
matched: c,
|
|
1139
1144
|
matches: [c],
|
|
1140
1145
|
name: a,
|
|
1141
|
-
query:
|
|
1146
|
+
query: Oe(""),
|
|
1142
1147
|
params: {},
|
|
1143
1148
|
state: {},
|
|
1144
|
-
|
|
1149
|
+
href: "/",
|
|
1150
|
+
hash: "",
|
|
1151
|
+
[Nt]: !0
|
|
1145
1152
|
};
|
|
1146
|
-
},
|
|
1153
|
+
}, n = (a) => {
|
|
1147
1154
|
if (!a) {
|
|
1148
1155
|
o.value = null;
|
|
1149
1156
|
return;
|
|
1150
1157
|
}
|
|
1151
1158
|
const s = t(a);
|
|
1152
1159
|
o.value = { type: a, component: s };
|
|
1153
|
-
}, o =
|
|
1160
|
+
}, o = $e(null);
|
|
1154
1161
|
return {
|
|
1155
|
-
setRejection:
|
|
1162
|
+
setRejection: n,
|
|
1156
1163
|
rejection: o,
|
|
1157
|
-
getRejectionRoute:
|
|
1164
|
+
getRejectionRoute: r
|
|
1158
1165
|
};
|
|
1159
1166
|
}
|
|
1160
|
-
class
|
|
1161
|
-
constructor(
|
|
1162
|
-
super(
|
|
1167
|
+
class cn extends Error {
|
|
1168
|
+
constructor() {
|
|
1169
|
+
super("initialUrl must be set if window.location is unavailable");
|
|
1163
1170
|
}
|
|
1164
1171
|
}
|
|
1165
|
-
function
|
|
1172
|
+
function un(e) {
|
|
1173
|
+
if (e)
|
|
1174
|
+
return e;
|
|
1175
|
+
if (We())
|
|
1176
|
+
return window.location.toString();
|
|
1177
|
+
throw new cn();
|
|
1178
|
+
}
|
|
1179
|
+
function Je(e) {
|
|
1166
1180
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1167
1181
|
}
|
|
1168
|
-
function
|
|
1169
|
-
const
|
|
1170
|
-
if (
|
|
1182
|
+
function fn(e, t) {
|
|
1183
|
+
const r = Array.from(e.matchAll(t));
|
|
1184
|
+
if (r.length === 0)
|
|
1171
1185
|
return [e];
|
|
1172
|
-
let
|
|
1173
|
-
const o =
|
|
1174
|
-
const
|
|
1175
|
-
|
|
1176
|
-
const [
|
|
1177
|
-
return s.push(
|
|
1178
|
-
}, []), a = e.slice(
|
|
1186
|
+
let n = 0;
|
|
1187
|
+
const o = r.reduce((s, c) => {
|
|
1188
|
+
const i = Je(e.slice(n, c.index));
|
|
1189
|
+
i.length && s.push(i);
|
|
1190
|
+
const [u] = c;
|
|
1191
|
+
return s.push(u), n = c.index + u.length, s;
|
|
1192
|
+
}, []), a = e.slice(n);
|
|
1179
1193
|
return a && o.push(a), o;
|
|
1180
1194
|
}
|
|
1181
|
-
function
|
|
1182
|
-
const t =
|
|
1195
|
+
function ln(e) {
|
|
1196
|
+
const t = qt(e.path.value);
|
|
1183
1197
|
return new RegExp(`^${t}$`, "i");
|
|
1184
1198
|
}
|
|
1185
|
-
function
|
|
1199
|
+
function hn(e) {
|
|
1186
1200
|
const t = new URLSearchParams(e.query.value);
|
|
1187
|
-
return Array.from(t.entries()).filter(([,
|
|
1188
|
-
const o =
|
|
1189
|
-
return new RegExp(`${
|
|
1201
|
+
return Array.from(t.entries()).filter(([, r]) => !Ve(r)).map(([r, n]) => {
|
|
1202
|
+
const o = qt(n);
|
|
1203
|
+
return new RegExp(`${Je(r)}=${o}(&|$)`, "i");
|
|
1190
1204
|
});
|
|
1191
1205
|
}
|
|
1192
|
-
function
|
|
1193
|
-
return
|
|
1206
|
+
function qt(e) {
|
|
1207
|
+
return fn(e, new RegExp(pn, "g")).map((t) => t.startsWith(J) ? _t(t) : Je(t)).join("");
|
|
1194
1208
|
}
|
|
1195
|
-
function
|
|
1209
|
+
function _t(e) {
|
|
1196
1210
|
return [
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
].reduce((t,
|
|
1211
|
+
dn,
|
|
1212
|
+
mn
|
|
1213
|
+
].reduce((t, r) => r(t), e);
|
|
1200
1214
|
}
|
|
1201
|
-
const
|
|
1202
|
-
function
|
|
1203
|
-
return e.replace(new RegExp(
|
|
1215
|
+
const pn = `\\${J}\\??([\\w-_]+)\\${K}`, Qe = `\\${J}\\?([\\w-_]+)\\${K}`, Mt = `\\${J}([\\w-_]+)\\${K}`;
|
|
1216
|
+
function dn(e) {
|
|
1217
|
+
return e.replace(new RegExp(Qe, "g"), ".*");
|
|
1204
1218
|
}
|
|
1205
1219
|
function Ve(e) {
|
|
1206
|
-
return new RegExp(
|
|
1220
|
+
return new RegExp(Qe, "g").test(e);
|
|
1207
1221
|
}
|
|
1208
|
-
function
|
|
1209
|
-
return e.replace(new RegExp(
|
|
1222
|
+
function mn(e) {
|
|
1223
|
+
return e.replace(new RegExp(Mt, "g"), ".+");
|
|
1210
1224
|
}
|
|
1211
|
-
function
|
|
1212
|
-
const [t] =
|
|
1213
|
-
return t ??
|
|
1225
|
+
function Le(e) {
|
|
1226
|
+
const [t] = Se(e, new RegExp(Qe, "g")), [r] = Se(e, new RegExp(Mt, "g"));
|
|
1227
|
+
return t ?? r;
|
|
1214
1228
|
}
|
|
1215
|
-
function
|
|
1216
|
-
return Array.from(e.matchAll(t)).flatMap(([, ...
|
|
1229
|
+
function Se(e, t) {
|
|
1230
|
+
return Array.from(e.matchAll(t)).flatMap(([, ...n]) => n.map((o) => F(o) ? o : ""));
|
|
1217
1231
|
}
|
|
1218
|
-
function
|
|
1219
|
-
const r =
|
|
1232
|
+
function ze(e, t) {
|
|
1233
|
+
const r = new RegExp(`\\${J}(\\??[\\w-_]+)\\${K}`, "g");
|
|
1234
|
+
return Array.from(e.matchAll(r)).reduce((o, [a, s]) => {
|
|
1235
|
+
const c = Le(a);
|
|
1236
|
+
if (!c)
|
|
1237
|
+
return o;
|
|
1238
|
+
const i = Wr(t, c);
|
|
1239
|
+
return ce([c], o), o[s] = i, o;
|
|
1240
|
+
}, {});
|
|
1241
|
+
}
|
|
1242
|
+
function He(e, t) {
|
|
1243
|
+
return {
|
|
1244
|
+
value: e,
|
|
1245
|
+
params: ze(e, t)
|
|
1246
|
+
};
|
|
1247
|
+
}
|
|
1248
|
+
function yn(e, t) {
|
|
1249
|
+
return F(t) ? e.map((r) => {
|
|
1250
|
+
const n = `${t}${r.path.value}`;
|
|
1251
|
+
return {
|
|
1252
|
+
...r,
|
|
1253
|
+
path: He(n, r.path.params)
|
|
1254
|
+
};
|
|
1255
|
+
}) : e;
|
|
1256
|
+
}
|
|
1257
|
+
function Wt(e) {
|
|
1258
|
+
return !!e && typeof e == "object";
|
|
1259
|
+
}
|
|
1260
|
+
const ke = !0;
|
|
1261
|
+
function gn(e, t, r) {
|
|
1262
|
+
if (Wt(e) && t in e) {
|
|
1263
|
+
const n = e[t];
|
|
1264
|
+
return typeof n == "string" ? fe(n, r, ke) : n;
|
|
1265
|
+
}
|
|
1266
|
+
return fe(void 0, r, ke);
|
|
1267
|
+
}
|
|
1268
|
+
function Dt(e, t) {
|
|
1269
|
+
const r = {};
|
|
1270
|
+
for (const [n, o] of Object.entries(e)) {
|
|
1271
|
+
const a = gn(t, n, o);
|
|
1272
|
+
r[n] = a;
|
|
1273
|
+
}
|
|
1274
|
+
return r;
|
|
1275
|
+
}
|
|
1276
|
+
function vn(e, t, r) {
|
|
1277
|
+
if (Wt(e) && t in e) {
|
|
1278
|
+
const n = e[t];
|
|
1279
|
+
return le(n, r, ke);
|
|
1280
|
+
}
|
|
1281
|
+
return le(void 0, r, ke);
|
|
1282
|
+
}
|
|
1283
|
+
const Rn = (e, t) => {
|
|
1284
|
+
const r = {};
|
|
1285
|
+
for (const [n, o] of Object.entries(e)) {
|
|
1286
|
+
const a = vn(t, n, o);
|
|
1287
|
+
r[n] = a;
|
|
1288
|
+
}
|
|
1289
|
+
return r;
|
|
1290
|
+
};
|
|
1291
|
+
class wn extends Error {
|
|
1292
|
+
/**
|
|
1293
|
+
* Constructs a new DuplicateNamesError instance with a message indicating the problematic name.
|
|
1294
|
+
* @param name - The name of the name that was duplicated.
|
|
1295
|
+
*/
|
|
1296
|
+
constructor(t) {
|
|
1297
|
+
super(`Invalid Name "${t}": Router does not support multiple routes with the same name. All name names must be unique.`);
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
function Pn(e) {
|
|
1301
|
+
const t = e.map(({ name: r }) => r);
|
|
1302
|
+
for (const r of t)
|
|
1303
|
+
if (Et(t, r) > 1)
|
|
1304
|
+
throw new wn(r);
|
|
1305
|
+
}
|
|
1306
|
+
function En() {
|
|
1307
|
+
const e = xe(/* @__PURE__ */ new Map()), t = We() ? s() : null, r = (c) => {
|
|
1308
|
+
e.set(c, !1), t == null || t.observe(c);
|
|
1309
|
+
}, n = (c) => {
|
|
1310
|
+
e.delete(c), t == null || t.unobserve(c);
|
|
1311
|
+
}, o = () => {
|
|
1312
|
+
t == null || t.disconnect();
|
|
1313
|
+
}, a = (c) => e.get(c) ?? !1;
|
|
1314
|
+
function s() {
|
|
1315
|
+
return new IntersectionObserver((c) => {
|
|
1316
|
+
c.forEach((i) => {
|
|
1317
|
+
e.set(i.target, i.isIntersecting);
|
|
1318
|
+
});
|
|
1319
|
+
});
|
|
1320
|
+
}
|
|
1321
|
+
return {
|
|
1322
|
+
observe: r,
|
|
1323
|
+
unobserve: n,
|
|
1324
|
+
disconnect: o,
|
|
1325
|
+
isElementVisible: a
|
|
1326
|
+
};
|
|
1327
|
+
}
|
|
1328
|
+
const Tt = Symbol("visibilityObserver");
|
|
1329
|
+
function bn(e) {
|
|
1330
|
+
const t = ae(Tt);
|
|
1331
|
+
if (!t)
|
|
1332
|
+
throw new pe();
|
|
1333
|
+
return ge(e, (n, o) => {
|
|
1334
|
+
n && t.observe(n), o && t.unobserve(o);
|
|
1335
|
+
}, { immediate: !0 }), {
|
|
1336
|
+
isElementVisible: N(() => e.value ? t.isElementVisible(e.value) : !1)
|
|
1337
|
+
};
|
|
1338
|
+
}
|
|
1339
|
+
class Sn extends Error {
|
|
1340
|
+
constructor(t) {
|
|
1341
|
+
super(`Route not found: "${t}"`);
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
function It(e, t, r) {
|
|
1345
|
+
const n = Ft(t, r), [o] = Se(e, n);
|
|
1220
1346
|
return o;
|
|
1221
1347
|
}
|
|
1222
|
-
function
|
|
1348
|
+
function Ot(e, t) {
|
|
1223
1349
|
if (!t)
|
|
1224
1350
|
return e;
|
|
1225
|
-
const { name:
|
|
1226
|
-
return
|
|
1227
|
-
}
|
|
1228
|
-
function
|
|
1229
|
-
const
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
].reduce((
|
|
1234
|
-
return new RegExp(
|
|
1235
|
-
}
|
|
1236
|
-
function
|
|
1351
|
+
const { name: r, param: n, value: o } = t, a = Ft(e, r);
|
|
1352
|
+
return Se(e, a).reduce((c, i) => i === void 0 ? c : c.replace(i, () => le(o, n, r.startsWith("?"))), e);
|
|
1353
|
+
}
|
|
1354
|
+
function Ft(e, t) {
|
|
1355
|
+
const r = [
|
|
1356
|
+
kn,
|
|
1357
|
+
An,
|
|
1358
|
+
_t
|
|
1359
|
+
].reduce((n, o) => o(n, t), e);
|
|
1360
|
+
return new RegExp(r, "g");
|
|
1361
|
+
}
|
|
1362
|
+
function kn(e, t) {
|
|
1237
1363
|
if (!t.startsWith("?"))
|
|
1238
1364
|
return e;
|
|
1239
|
-
const
|
|
1240
|
-
return e.replace(
|
|
1365
|
+
const r = new RegExp(`\\${J}\\${t}\\${K}`, "g");
|
|
1366
|
+
return e.replace(r, "(.*)");
|
|
1241
1367
|
}
|
|
1242
|
-
function
|
|
1368
|
+
function An(e, t) {
|
|
1243
1369
|
if (t.startsWith("?"))
|
|
1244
1370
|
return e;
|
|
1245
|
-
const
|
|
1246
|
-
return e.replace(
|
|
1371
|
+
const r = new RegExp(`\\${J}${t}\\${K}`, "g");
|
|
1372
|
+
return e.replace(r, "(.+)");
|
|
1247
1373
|
}
|
|
1248
|
-
function
|
|
1374
|
+
function Jt({ protocol: e, host: t, pathname: r, search: n, searchParams: o, hash: a }) {
|
|
1249
1375
|
const s = new URL("https://localhost");
|
|
1250
|
-
e && (s.protocol = e), t && (s.host = t),
|
|
1376
|
+
e && (s.protocol = e), t && (s.host = t), r && (s.pathname = r), o ? s.search = new URLSearchParams(o).toString() : n && (s.search = n), a && (s.hash = a);
|
|
1251
1377
|
const c = s.toString().replace(/^https:\/\/localhost\/*/, "/");
|
|
1252
|
-
return
|
|
1253
|
-
}
|
|
1254
|
-
function
|
|
1255
|
-
const
|
|
1256
|
-
for (const
|
|
1257
|
-
n
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
}
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
}
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1378
|
+
return wt(c);
|
|
1379
|
+
}
|
|
1380
|
+
function Ge(...e) {
|
|
1381
|
+
const t = new URLSearchParams();
|
|
1382
|
+
for (const r of e) {
|
|
1383
|
+
const n = new URLSearchParams(r);
|
|
1384
|
+
for (const [o, a] of n.entries())
|
|
1385
|
+
t.append(o, a);
|
|
1386
|
+
}
|
|
1387
|
+
return t;
|
|
1388
|
+
}
|
|
1389
|
+
function xn(e, t = {}) {
|
|
1390
|
+
const { params: r = {}, query: n } = t, o = Cn(e.query, r), a = Ge(o, n), s = Ln(e.path, r), c = ve(e.hash.value ?? t.hash).value, i = Un(e.host, r), { protocol: u, host: f } = _(i);
|
|
1391
|
+
return Jt({ protocol: u, host: f, pathname: s, searchParams: a, hash: c });
|
|
1392
|
+
}
|
|
1393
|
+
function Un(e, t) {
|
|
1394
|
+
const r = e.value && !e.value.startsWith("http") ? `https://${e.value}` : e.value;
|
|
1395
|
+
return Object.entries(e.params).reduce((n, [o, a]) => {
|
|
1396
|
+
const s = Le(`${J}${o}${K}`);
|
|
1397
|
+
return s ? Ot(n, { name: o, param: a, value: t[s] }) : n;
|
|
1398
|
+
}, r);
|
|
1399
|
+
}
|
|
1400
|
+
function Ln(e, t) {
|
|
1401
|
+
return Object.entries(e.params).reduce((r, [n, o]) => {
|
|
1402
|
+
const a = Le(`${J}${n}${K}`);
|
|
1403
|
+
return a ? Ot(r, { name: n, param: o, value: t[a] }) : r;
|
|
1275
1404
|
}, e.value);
|
|
1276
1405
|
}
|
|
1277
|
-
function
|
|
1278
|
-
const
|
|
1406
|
+
function Cn(e, t) {
|
|
1407
|
+
const r = new URLSearchParams(e.value);
|
|
1279
1408
|
if (!e.value)
|
|
1280
|
-
return
|
|
1281
|
-
for (const [
|
|
1282
|
-
const a =
|
|
1409
|
+
return r;
|
|
1410
|
+
for (const [n, o] of Array.from(r.entries())) {
|
|
1411
|
+
const a = Le(o);
|
|
1283
1412
|
if (!a)
|
|
1284
1413
|
continue;
|
|
1285
|
-
const c = le(t[a], e.params[a], Ve(o)),
|
|
1286
|
-
Ve(o) &&
|
|
1287
|
-
}
|
|
1288
|
-
return n;
|
|
1289
|
-
}
|
|
1290
|
-
function br(e) {
|
|
1291
|
-
return (t, n, r) => {
|
|
1292
|
-
if (M(t)) {
|
|
1293
|
-
const u = n ?? {}, { searchParams: i, ...f } = T(t);
|
|
1294
|
-
return Object.entries(u.query ?? {}).forEach(([l, m]) => {
|
|
1295
|
-
i.append(l, m);
|
|
1296
|
-
}), Wt({ ...f, searchParams: i });
|
|
1297
|
-
}
|
|
1298
|
-
const o = n ?? {}, a = r ?? {}, s = e.find((u) => u.name === t);
|
|
1299
|
-
if (!s)
|
|
1300
|
-
throw new ir(String(t));
|
|
1301
|
-
return Rr(s, {
|
|
1302
|
-
params: o,
|
|
1303
|
-
query: a.query,
|
|
1304
|
-
hash: a.hash
|
|
1305
|
-
});
|
|
1306
|
-
};
|
|
1307
|
-
}
|
|
1308
|
-
class Sr extends Error {
|
|
1309
|
-
constructor() {
|
|
1310
|
-
super("initialUrl must be set if window.location is unavailable");
|
|
1414
|
+
const c = le(t[a], e.params[a], Ve(o)), i = t[a] === void 0 && c === "";
|
|
1415
|
+
Ve(o) && i ? r.delete(n, o) : r.set(n, c);
|
|
1311
1416
|
}
|
|
1417
|
+
return r;
|
|
1312
1418
|
}
|
|
1313
|
-
|
|
1314
|
-
if (e)
|
|
1315
|
-
return e;
|
|
1316
|
-
if (Te())
|
|
1317
|
-
return window.location.toString();
|
|
1318
|
-
throw new Sr();
|
|
1319
|
-
}
|
|
1320
|
-
const Ar = (e, t) => {
|
|
1419
|
+
const Bn = (e, t) => {
|
|
1321
1420
|
try {
|
|
1322
|
-
|
|
1421
|
+
Ke(e, t);
|
|
1323
1422
|
} catch {
|
|
1324
1423
|
return !1;
|
|
1325
1424
|
}
|
|
1326
1425
|
return !0;
|
|
1327
|
-
},
|
|
1328
|
-
const { pathname:
|
|
1426
|
+
}, Ke = (e, t) => {
|
|
1427
|
+
const { pathname: r, search: n } = _(t);
|
|
1329
1428
|
return {
|
|
1330
|
-
...
|
|
1331
|
-
...
|
|
1429
|
+
...Nn(e.path, r),
|
|
1430
|
+
...Vn(e.query, n)
|
|
1332
1431
|
};
|
|
1333
1432
|
};
|
|
1334
|
-
function
|
|
1335
|
-
const
|
|
1433
|
+
function Nn(e, t) {
|
|
1434
|
+
const r = {}, n = decodeURIComponent(t);
|
|
1336
1435
|
for (const [o, a] of Object.entries(e.params)) {
|
|
1337
|
-
const s = o.startsWith("?"), c = s ? o.slice(1) : o,
|
|
1338
|
-
|
|
1436
|
+
const s = o.startsWith("?"), c = s ? o.slice(1) : o, i = It(n, e.value, o), u = fe(i, a, s);
|
|
1437
|
+
r[c] = u;
|
|
1339
1438
|
}
|
|
1340
|
-
return
|
|
1439
|
+
return r;
|
|
1341
1440
|
}
|
|
1342
|
-
function
|
|
1343
|
-
const
|
|
1441
|
+
function Vn(e, t) {
|
|
1442
|
+
const r = {}, n = new URLSearchParams(t);
|
|
1344
1443
|
for (const [o, a] of Object.entries(e.params)) {
|
|
1345
|
-
const s = o.startsWith("?"), c = s ? o.slice(1) : o,
|
|
1346
|
-
|
|
1347
|
-
}
|
|
1348
|
-
return
|
|
1349
|
-
}
|
|
1350
|
-
const Br = (e) => "name" in e.matched && !!e.matched.name, Cr = (e, t) => {
|
|
1351
|
-
const { pathname: n } = T(t);
|
|
1352
|
-
return lr(e).test(n);
|
|
1353
|
-
}, Lr = (e, t) => {
|
|
1354
|
-
const { search: n } = T(t);
|
|
1355
|
-
return hr(e).every((o) => o.test(n));
|
|
1356
|
-
}, $e = (e, t) => {
|
|
1357
|
-
const { hash: n } = T(t), { value: r } = e.hash;
|
|
1358
|
-
return r === void 0 || `#${r.toLowerCase()}` === n.toLowerCase();
|
|
1359
|
-
};
|
|
1360
|
-
function Nr(e) {
|
|
1361
|
-
const { searchParams: t, pathname: n } = T(e), r = -1, o = 1;
|
|
1362
|
-
return (a, s) => {
|
|
1363
|
-
const c = it(a, t), u = ut(a, n), i = it(s, t), f = ut(s, n);
|
|
1364
|
-
return a.depth > s.depth ? r : a.depth < s.depth ? o : c + u > i + f ? r : c + u < i + f ? o : $e(a, e) ? r : $e(s, e) ? o : 0;
|
|
1365
|
-
};
|
|
1366
|
-
}
|
|
1367
|
-
function ut(e, t) {
|
|
1368
|
-
const n = Object.keys(e.path.params).filter((o) => o.startsWith("?")).map((o) => o), r = n.filter((o) => _t(t, e.path.value, o) === void 0);
|
|
1369
|
-
return n.length - r.length;
|
|
1370
|
-
}
|
|
1371
|
-
function it(e, t) {
|
|
1372
|
-
const n = new URLSearchParams(e.query.value), r = Array.from(n.keys()), o = r.filter((a) => !t.has(a));
|
|
1373
|
-
return r.length - o.length;
|
|
1374
|
-
}
|
|
1375
|
-
function It(e) {
|
|
1376
|
-
return !!e && typeof e == "object";
|
|
1444
|
+
const s = o.startsWith("?"), c = s ? o.slice(1) : o, i = n.get(c) ?? void 0, u = fe(i, a, s);
|
|
1445
|
+
r[c] = u;
|
|
1446
|
+
}
|
|
1447
|
+
return r;
|
|
1377
1448
|
}
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
}
|
|
1385
|
-
return fe(void 0, n, Ae);
|
|
1386
|
-
}
|
|
1387
|
-
function jr(e, t) {
|
|
1388
|
-
const n = {};
|
|
1389
|
-
for (const [r, o] of Object.entries(e)) {
|
|
1390
|
-
const a = Hr(t, r, o);
|
|
1391
|
-
n[r] = a;
|
|
1392
|
-
}
|
|
1393
|
-
return n;
|
|
1394
|
-
}
|
|
1395
|
-
function Vr(e, t, n) {
|
|
1396
|
-
if (It(e) && t in e) {
|
|
1397
|
-
const r = e[t];
|
|
1398
|
-
return le(r, n, Ae);
|
|
1399
|
-
}
|
|
1400
|
-
return le(void 0, n, Ae);
|
|
1401
|
-
}
|
|
1402
|
-
const ft = (e, t) => {
|
|
1403
|
-
const n = {};
|
|
1404
|
-
for (const [r, o] of Object.entries(e)) {
|
|
1405
|
-
const a = Vr(t, r, o);
|
|
1406
|
-
n[r] = a;
|
|
1407
|
-
}
|
|
1408
|
-
return n;
|
|
1409
|
-
}, $r = [
|
|
1410
|
-
Br,
|
|
1411
|
-
Cr,
|
|
1412
|
-
Lr,
|
|
1413
|
-
$e,
|
|
1414
|
-
Ar
|
|
1415
|
-
];
|
|
1416
|
-
function Ne(e, t, n) {
|
|
1417
|
-
const r = Nr(t), o = e.filter((u) => $r.every((i) => i(u, t))).sort(r);
|
|
1418
|
-
if (o.length === 0)
|
|
1419
|
-
return;
|
|
1420
|
-
const [a] = o, { search: s, hash: c } = T(t);
|
|
1449
|
+
function Hn(e, t = {}, r = {}) {
|
|
1450
|
+
const n = xn(e, {
|
|
1451
|
+
params: t,
|
|
1452
|
+
query: r.query,
|
|
1453
|
+
hash: r.hash
|
|
1454
|
+
}), { search: o, hash: a } = _(n);
|
|
1421
1455
|
return {
|
|
1422
|
-
id:
|
|
1423
|
-
matched:
|
|
1424
|
-
matches:
|
|
1425
|
-
name:
|
|
1426
|
-
query:
|
|
1427
|
-
params:
|
|
1428
|
-
state:
|
|
1429
|
-
hash:
|
|
1456
|
+
id: e.id,
|
|
1457
|
+
matched: e.matched,
|
|
1458
|
+
matches: e.matches,
|
|
1459
|
+
name: e.name,
|
|
1460
|
+
query: Oe(o),
|
|
1461
|
+
params: Ke(e, n),
|
|
1462
|
+
state: Dt(e.state, r.state),
|
|
1463
|
+
hash: a,
|
|
1464
|
+
href: n
|
|
1430
1465
|
};
|
|
1431
1466
|
}
|
|
1432
|
-
|
|
1433
|
-
const
|
|
1434
|
-
return
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
}
|
|
1442
|
-
function
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1467
|
+
const jn = (e) => "name" in e.matched && !!e.matched.name, $n = (e, t) => {
|
|
1468
|
+
const { pathname: r } = _(t);
|
|
1469
|
+
return ln(e).test(r);
|
|
1470
|
+
}, qn = (e, t) => {
|
|
1471
|
+
const { search: r } = _(t);
|
|
1472
|
+
return hn(e).every((o) => o.test(r));
|
|
1473
|
+
}, je = (e, t) => {
|
|
1474
|
+
const { hash: r } = _(t), { value: n } = e.hash;
|
|
1475
|
+
return n === void 0 || `#${n.toLowerCase()}` === r.toLowerCase();
|
|
1476
|
+
};
|
|
1477
|
+
function _n(e) {
|
|
1478
|
+
const { searchParams: t, pathname: r } = _(e), n = -1, o = 1;
|
|
1479
|
+
return (a, s) => {
|
|
1480
|
+
const c = ft(a, t), i = it(a, r), u = ft(s, t), f = it(s, r);
|
|
1481
|
+
return a.depth > s.depth ? n : a.depth < s.depth ? o : c + i > u + f ? n : c + i < u + f ? o : je(a, e) ? n : je(s, e) ? o : 0;
|
|
1446
1482
|
};
|
|
1447
1483
|
}
|
|
1448
|
-
function
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
function _r(e) {
|
|
1467
|
-
const t = e.map(({ name: n }) => n);
|
|
1468
|
-
for (const n of t)
|
|
1469
|
-
if (Rt(t, n) > 1)
|
|
1470
|
-
throw new qr(n);
|
|
1484
|
+
function it(e, t) {
|
|
1485
|
+
const r = Object.keys(e.path.params).filter((o) => o.startsWith("?")).map((o) => o), n = r.filter((o) => It(t, e.path.value, o) === void 0);
|
|
1486
|
+
return r.length - n.length;
|
|
1487
|
+
}
|
|
1488
|
+
function ft(e, t) {
|
|
1489
|
+
const r = new URLSearchParams(t), n = new URLSearchParams(e.query.value), o = Array.from(n.keys()), a = o.filter((s) => !r.has(s));
|
|
1490
|
+
return o.length - a.length;
|
|
1491
|
+
}
|
|
1492
|
+
const Mn = [
|
|
1493
|
+
jn,
|
|
1494
|
+
$n,
|
|
1495
|
+
qn,
|
|
1496
|
+
je,
|
|
1497
|
+
Bn
|
|
1498
|
+
];
|
|
1499
|
+
function Wn(e, t) {
|
|
1500
|
+
const r = _n(t);
|
|
1501
|
+
return e.filter((n) => Mn.every((o) => o(n, t))).sort(r);
|
|
1471
1502
|
}
|
|
1472
|
-
function
|
|
1473
|
-
const
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
}, o = () => {
|
|
1478
|
-
t == null || t.disconnect();
|
|
1479
|
-
}, a = (c) => e.get(c) ?? !1;
|
|
1480
|
-
function s() {
|
|
1481
|
-
return new IntersectionObserver((c) => {
|
|
1482
|
-
c.forEach((u) => {
|
|
1483
|
-
e.set(u.target, u.isIntersecting);
|
|
1484
|
-
});
|
|
1485
|
-
});
|
|
1486
|
-
}
|
|
1503
|
+
function Dn(e, t, r) {
|
|
1504
|
+
const n = Wn(e, t);
|
|
1505
|
+
if (!n.length)
|
|
1506
|
+
return;
|
|
1507
|
+
const [o] = n, { searchParams: a, hash: s } = _(t);
|
|
1487
1508
|
return {
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1509
|
+
id: o.id,
|
|
1510
|
+
matched: o.matched,
|
|
1511
|
+
matches: o.matches,
|
|
1512
|
+
name: o.name,
|
|
1513
|
+
query: Oe(a),
|
|
1514
|
+
params: Ke(o, t),
|
|
1515
|
+
state: Dt(o.state, r),
|
|
1516
|
+
hash: s,
|
|
1517
|
+
href: wt(t)
|
|
1492
1518
|
};
|
|
1493
1519
|
}
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1520
|
+
function lt(e, t) {
|
|
1521
|
+
const r = typeof e == "string" ? _(e) : e, n = typeof t == "string" ? _(t) : t, o = r.searchParams ?? new URLSearchParams(r.search), a = n.searchParams ?? new URLSearchParams(n.search);
|
|
1522
|
+
return Jt({
|
|
1523
|
+
protocol: F(n.protocol) ? n.protocol : r.protocol,
|
|
1524
|
+
host: F(n.host) ? n.host : r.host,
|
|
1525
|
+
pathname: F(n.pathname) ? n.pathname : r.pathname,
|
|
1526
|
+
searchParams: Ge(a, o),
|
|
1527
|
+
hash: F(n.hash) ? n.hash : r.hash
|
|
1528
|
+
});
|
|
1500
1529
|
}
|
|
1501
1530
|
function lo(e, t) {
|
|
1502
|
-
const
|
|
1503
|
-
|
|
1504
|
-
const o =
|
|
1531
|
+
const r = xr(e) ? e.flat() : e, n = yn(r, t == null ? void 0 : t.base);
|
|
1532
|
+
Pn(n);
|
|
1533
|
+
const o = $t(), a = Gn(), s = En(), c = Xr({
|
|
1505
1534
|
mode: t == null ? void 0 : t.historyMode,
|
|
1506
|
-
listener: ({ location:
|
|
1507
|
-
const
|
|
1508
|
-
A(
|
|
1535
|
+
listener: ({ location: b }) => {
|
|
1536
|
+
const L = X(b);
|
|
1537
|
+
A(L, { state: b.state, replace: !0 });
|
|
1509
1538
|
}
|
|
1510
|
-
}), { runBeforeRouteHooks: i, runAfterRouteHooks:
|
|
1511
|
-
hooks:
|
|
1512
|
-
onBeforeRouteEnter:
|
|
1513
|
-
onAfterRouteUpdate:
|
|
1514
|
-
onBeforeRouteLeave:
|
|
1515
|
-
onAfterRouteEnter:
|
|
1539
|
+
}), { runBeforeRouteHooks: i, runAfterRouteHooks: u } = rn(), {
|
|
1540
|
+
hooks: f,
|
|
1541
|
+
onBeforeRouteEnter: d,
|
|
1542
|
+
onAfterRouteUpdate: P,
|
|
1543
|
+
onBeforeRouteLeave: p,
|
|
1544
|
+
onAfterRouteEnter: h,
|
|
1516
1545
|
onBeforeRouteUpdate: v,
|
|
1517
|
-
onAfterRouteLeave:
|
|
1518
|
-
} =
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1546
|
+
onAfterRouteLeave: R
|
|
1547
|
+
} = on();
|
|
1548
|
+
function E(b, L = {}) {
|
|
1549
|
+
return Dn(n, b, L);
|
|
1550
|
+
}
|
|
1551
|
+
async function A(b, L = {}) {
|
|
1552
|
+
const Q = o();
|
|
1553
|
+
if (c.stopListening(), tt(b)) {
|
|
1554
|
+
c.update(b, L);
|
|
1523
1555
|
return;
|
|
1524
1556
|
}
|
|
1525
|
-
const
|
|
1526
|
-
switch (
|
|
1557
|
+
const W = E(b, L) ?? y("NotFound"), j = { ...k }, z = await i({ to: W, from: j, hooks: f });
|
|
1558
|
+
switch (z.status) {
|
|
1527
1559
|
// On abort do nothing
|
|
1528
1560
|
case "ABORT":
|
|
1529
1561
|
return;
|
|
1530
1562
|
// On push update the history, and push new route, and return
|
|
1531
1563
|
case "PUSH":
|
|
1532
|
-
|
|
1564
|
+
c.update(b, L), await w(...z.to);
|
|
1533
1565
|
return;
|
|
1534
1566
|
// On reject update the history, the route, and set the rejection type
|
|
1535
1567
|
case "REJECT":
|
|
1536
|
-
|
|
1568
|
+
c.update(b, L), g(z.type);
|
|
1537
1569
|
break;
|
|
1538
1570
|
// On success update history, set the route, and clear the rejection
|
|
1539
1571
|
case "SUCCESS":
|
|
1540
|
-
|
|
1572
|
+
c.update(b, L), g(null);
|
|
1541
1573
|
break;
|
|
1542
1574
|
default:
|
|
1543
|
-
throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(
|
|
1575
|
+
throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(z)}`);
|
|
1544
1576
|
}
|
|
1545
|
-
const
|
|
1546
|
-
a.setProps(
|
|
1547
|
-
if (
|
|
1548
|
-
switch (
|
|
1577
|
+
const Ce = Q;
|
|
1578
|
+
a.setProps(W).then((T) => {
|
|
1579
|
+
if (Ce === Q)
|
|
1580
|
+
switch (T.status) {
|
|
1549
1581
|
case "SUCCESS":
|
|
1550
1582
|
break;
|
|
1551
1583
|
case "PUSH":
|
|
1552
|
-
|
|
1584
|
+
w(...T.to);
|
|
1553
1585
|
break;
|
|
1554
1586
|
case "REJECT":
|
|
1555
|
-
|
|
1587
|
+
g(T.type);
|
|
1556
1588
|
break;
|
|
1557
1589
|
default:
|
|
1558
|
-
const
|
|
1559
|
-
throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify(
|
|
1590
|
+
const Be = T;
|
|
1591
|
+
throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify(Be)}`);
|
|
1560
1592
|
}
|
|
1561
|
-
}),
|
|
1562
|
-
const
|
|
1563
|
-
switch (
|
|
1593
|
+
}), B(W);
|
|
1594
|
+
const D = await u({ to: W, from: j, hooks: f });
|
|
1595
|
+
switch (D.status) {
|
|
1564
1596
|
case "PUSH":
|
|
1565
|
-
await
|
|
1597
|
+
await w(...D.to);
|
|
1566
1598
|
break;
|
|
1567
1599
|
case "REJECT":
|
|
1568
|
-
|
|
1600
|
+
g(D.type);
|
|
1569
1601
|
break;
|
|
1570
1602
|
case "SUCCESS":
|
|
1571
1603
|
break;
|
|
1572
1604
|
default:
|
|
1573
|
-
const
|
|
1574
|
-
throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(
|
|
1605
|
+
const T = D;
|
|
1606
|
+
throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(T)}`);
|
|
1575
1607
|
}
|
|
1576
|
-
|
|
1577
|
-
}
|
|
1578
|
-
const
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1608
|
+
c.startListening();
|
|
1609
|
+
}
|
|
1610
|
+
const m = (b, L = {}, Q = {}) => {
|
|
1611
|
+
const W = n.find((j) => j.name === b);
|
|
1612
|
+
if (!W)
|
|
1613
|
+
throw new Sn(String(b));
|
|
1614
|
+
return Hn(W, L, Q);
|
|
1615
|
+
}, w = (b, L, Q) => {
|
|
1616
|
+
if (O(b)) {
|
|
1617
|
+
const D = { ...L }, T = lt(b, {
|
|
1618
|
+
searchParams: D.query,
|
|
1619
|
+
hash: D.hash
|
|
1620
|
+
});
|
|
1621
|
+
return A(T, D);
|
|
1582
1622
|
}
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1623
|
+
if (typeof b == "string") {
|
|
1624
|
+
const D = { ...Q }, T = { ...L }, Be = m(b, T, D), { replace: ur, state: ir } = D;
|
|
1625
|
+
return w(Be, { replace: ur, state: ir });
|
|
1626
|
+
}
|
|
1627
|
+
const { replace: W, ...j } = { ...L }, z = Rn({ ...b.matched.state }, { ...b.state, ...j.state }), Ce = lt(b.href, {
|
|
1628
|
+
searchParams: j.query,
|
|
1629
|
+
hash: j.hash
|
|
1630
|
+
});
|
|
1631
|
+
return A(Ce, { replace: W, state: z });
|
|
1632
|
+
}, x = (b, L, Q) => {
|
|
1633
|
+
if (O(b)) {
|
|
1634
|
+
const j = { ...L, replace: !0 };
|
|
1635
|
+
return w(b, j);
|
|
1589
1636
|
}
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
y(w);
|
|
1594
|
-
}, U = (w, C = {}) => {
|
|
1595
|
-
if (!M(w)) {
|
|
1596
|
-
const I = c(w, C);
|
|
1597
|
-
return Ne(r, I);
|
|
1637
|
+
if (typeof b == "string") {
|
|
1638
|
+
const j = { ...Q, replace: !0 }, z = { ...L };
|
|
1639
|
+
return w(b, z, j);
|
|
1598
1640
|
}
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
},
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
push:
|
|
1618
|
-
replace:
|
|
1619
|
-
reject:
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
onAfterRouteEnter: R,
|
|
1641
|
+
const W = { ...L, replace: !0 };
|
|
1642
|
+
return w(b, W);
|
|
1643
|
+
}, U = (b) => {
|
|
1644
|
+
g(b);
|
|
1645
|
+
}, { setRejection: g, rejection: l, getRejectionRoute: y } = sn(t ?? {}), S = y("NotFound"), { currentRoute: k, routerRoute: C, updateRoute: B } = zr(S, w);
|
|
1646
|
+
c.startListening();
|
|
1647
|
+
const H = un(t == null ? void 0 : t.initialUrl), M = c.location.state, { host: et } = _(H), tt = Yr(et);
|
|
1648
|
+
let rt = !1;
|
|
1649
|
+
async function nt() {
|
|
1650
|
+
rt || (await A(H, { replace: !0, state: M }), rt = !0);
|
|
1651
|
+
}
|
|
1652
|
+
function cr(b) {
|
|
1653
|
+
b.component("RouterView", so), b.component("RouterLink", to), b.provide(Ct, l), b.provide(jt, f), b.provide(tr, a), b.provide(Tt, s), b.provide(Pt, ot), nt();
|
|
1654
|
+
}
|
|
1655
|
+
const ot = {
|
|
1656
|
+
route: C,
|
|
1657
|
+
resolve: m,
|
|
1658
|
+
find: E,
|
|
1659
|
+
push: w,
|
|
1660
|
+
replace: x,
|
|
1661
|
+
reject: U,
|
|
1662
|
+
refresh: c.refresh,
|
|
1663
|
+
forward: c.forward,
|
|
1664
|
+
back: c.back,
|
|
1665
|
+
go: c.go,
|
|
1666
|
+
install: cr,
|
|
1667
|
+
isExternal: tt,
|
|
1668
|
+
onBeforeRouteEnter: d,
|
|
1669
|
+
onAfterRouteUpdate: P,
|
|
1670
|
+
onBeforeRouteLeave: p,
|
|
1671
|
+
onAfterRouteEnter: h,
|
|
1631
1672
|
onBeforeRouteUpdate: v,
|
|
1632
|
-
onAfterRouteLeave:
|
|
1673
|
+
onAfterRouteLeave: R,
|
|
1633
1674
|
prefetch: t == null ? void 0 : t.prefetch,
|
|
1634
|
-
start:
|
|
1675
|
+
start: nt
|
|
1635
1676
|
};
|
|
1636
|
-
return
|
|
1677
|
+
return ot;
|
|
1637
1678
|
}
|
|
1638
|
-
function
|
|
1679
|
+
function ht(e, t) {
|
|
1639
1680
|
return {
|
|
1640
1681
|
value: e,
|
|
1641
|
-
params:
|
|
1682
|
+
params: ze(e, t)
|
|
1642
1683
|
};
|
|
1643
1684
|
}
|
|
1644
|
-
function
|
|
1685
|
+
function Qt(e, t) {
|
|
1645
1686
|
return {
|
|
1646
1687
|
value: e,
|
|
1647
|
-
params:
|
|
1688
|
+
params: ze(e, t)
|
|
1648
1689
|
};
|
|
1649
1690
|
}
|
|
1650
|
-
function
|
|
1691
|
+
function Tn(e) {
|
|
1651
1692
|
return de(e) && typeof e.hash == "string";
|
|
1652
1693
|
}
|
|
1653
|
-
function
|
|
1654
|
-
return e === void 0 ?
|
|
1694
|
+
function zt(e) {
|
|
1695
|
+
return e === void 0 ? ve() : Tn(e) ? e : ve(e);
|
|
1655
1696
|
}
|
|
1656
1697
|
function Gt(e) {
|
|
1657
1698
|
return e === void 0 ? "" : e;
|
|
1658
1699
|
}
|
|
1659
|
-
function
|
|
1700
|
+
function In(e) {
|
|
1660
1701
|
return de(e) && typeof e.value == "string";
|
|
1661
1702
|
}
|
|
1662
1703
|
function Kt(e) {
|
|
1663
|
-
return e === void 0 ?
|
|
1704
|
+
return e === void 0 ? He("", {}) : In(e) ? e : He(e, {});
|
|
1664
1705
|
}
|
|
1665
|
-
function
|
|
1706
|
+
function On(e) {
|
|
1666
1707
|
return de(e) && typeof e.value == "string";
|
|
1667
1708
|
}
|
|
1668
|
-
function
|
|
1669
|
-
return e === void 0 ?
|
|
1709
|
+
function Yt(e) {
|
|
1710
|
+
return e === void 0 ? ht("", {}) : On(e) ? e : ht(e, {});
|
|
1670
1711
|
}
|
|
1671
|
-
function
|
|
1672
|
-
const t =
|
|
1712
|
+
function oe(e) {
|
|
1713
|
+
const t = Fe(), r = Gt(e.name), n = Kt(e.path), o = Yt(e.query), a = zt(e.hash), s = e.meta ?? {}, c = $r(e) ? e.state : {}, i = ye({ id: t, meta: {}, state: {}, ...e }), u = {
|
|
1673
1714
|
id: t,
|
|
1674
|
-
matched:
|
|
1675
|
-
matches: [
|
|
1676
|
-
name:
|
|
1677
|
-
path:
|
|
1715
|
+
matched: i,
|
|
1716
|
+
matches: [i],
|
|
1717
|
+
name: r,
|
|
1718
|
+
path: n,
|
|
1678
1719
|
query: o,
|
|
1679
1720
|
hash: a,
|
|
1680
1721
|
meta: s,
|
|
1681
1722
|
state: c,
|
|
1682
1723
|
depth: 1,
|
|
1683
|
-
host:
|
|
1724
|
+
host: Qt("", {}),
|
|
1684
1725
|
prefetch: e.prefetch
|
|
1685
|
-
}, f =
|
|
1686
|
-
return
|
|
1726
|
+
}, f = bt(e) ? St(e.parent, u) : u;
|
|
1727
|
+
return ce(f.path.params, f.query.params), f;
|
|
1687
1728
|
}
|
|
1688
|
-
const
|
|
1729
|
+
const Ae = { template: "<div>This is component</div>" }, Ye = oe({
|
|
1689
1730
|
name: "parentA",
|
|
1690
1731
|
path: "/parentA/[paramA]"
|
|
1691
|
-
}),
|
|
1692
|
-
parent:
|
|
1732
|
+
}), Xt = oe({
|
|
1733
|
+
parent: Ye,
|
|
1693
1734
|
name: "parentA.childA",
|
|
1694
1735
|
path: "/[?paramB]"
|
|
1695
|
-
}),
|
|
1696
|
-
parent:
|
|
1736
|
+
}), Fn = oe({
|
|
1737
|
+
parent: Ye,
|
|
1697
1738
|
name: "parentA.childB",
|
|
1698
1739
|
path: "/[paramD]",
|
|
1699
|
-
component:
|
|
1700
|
-
}),
|
|
1701
|
-
parent:
|
|
1740
|
+
component: Ae
|
|
1741
|
+
}), Jn = oe({
|
|
1742
|
+
parent: Xt,
|
|
1702
1743
|
name: "parentA.childA.grandChildA",
|
|
1703
1744
|
path: "/[paramC]",
|
|
1704
|
-
component:
|
|
1745
|
+
component: Ae
|
|
1705
1746
|
});
|
|
1706
|
-
|
|
1747
|
+
oe({
|
|
1707
1748
|
name: "parentB",
|
|
1708
1749
|
path: "/parentB",
|
|
1709
|
-
component:
|
|
1710
|
-
}),
|
|
1750
|
+
component: Ae
|
|
1751
|
+
}), oe({
|
|
1711
1752
|
name: "parentC",
|
|
1712
1753
|
path: "/",
|
|
1713
|
-
component:
|
|
1754
|
+
component: Ae
|
|
1714
1755
|
});
|
|
1715
|
-
const
|
|
1756
|
+
const Qn = "lazy", zn = {
|
|
1716
1757
|
components: !0,
|
|
1717
1758
|
props: !1
|
|
1718
1759
|
};
|
|
1719
|
-
function
|
|
1760
|
+
function me(e) {
|
|
1720
1761
|
return ["eager", "lazy"].includes(e);
|
|
1721
1762
|
}
|
|
1722
|
-
function
|
|
1723
|
-
const o =
|
|
1763
|
+
function Zt({ routerPrefetch: e, routePrefetch: t, linkPrefetch: r }, n) {
|
|
1764
|
+
const o = Ne(r, n), a = Ne(t, n), s = Ne(e, n), c = [
|
|
1724
1765
|
o,
|
|
1725
1766
|
a,
|
|
1726
1767
|
s,
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
].reduce((
|
|
1730
|
-
return
|
|
1768
|
+
zn[n],
|
|
1769
|
+
Qn
|
|
1770
|
+
].reduce((i, u) => me(i) ? i : i === !0 && me(u) ? u : i === !0 && !me(u) ? i : i === void 0 ? u : i, void 0);
|
|
1771
|
+
return me(c) ? c : !1;
|
|
1731
1772
|
}
|
|
1732
|
-
function
|
|
1773
|
+
function Ne(e, t) {
|
|
1733
1774
|
return de(e) ? e[t] : e;
|
|
1734
1775
|
}
|
|
1735
|
-
function
|
|
1776
|
+
function er(e) {
|
|
1736
1777
|
return typeof e == "object" && e !== null && "then" in e;
|
|
1737
1778
|
}
|
|
1738
|
-
function
|
|
1779
|
+
function pt(e) {
|
|
1739
1780
|
try {
|
|
1740
1781
|
const t = e();
|
|
1741
|
-
return
|
|
1782
|
+
return er(t) ? t.catch((r) => r) : t;
|
|
1742
1783
|
} catch (t) {
|
|
1743
1784
|
return t;
|
|
1744
1785
|
}
|
|
1745
1786
|
}
|
|
1746
|
-
const
|
|
1747
|
-
function
|
|
1748
|
-
const e =
|
|
1749
|
-
if (!
|
|
1750
|
-
return
|
|
1751
|
-
const A =
|
|
1787
|
+
const tr = Symbol();
|
|
1788
|
+
function Gn() {
|
|
1789
|
+
const e = xe(/* @__PURE__ */ new Map()), { push: t, replace: r, reject: n } = Ht(), o = (d, P, p) => P.matches.filter((h) => Zt({ ...p, routePrefetch: h.prefetch }, "props") === d).flatMap((h) => u(h)).reduce((h, { id: v, name: R, props: E }) => {
|
|
1790
|
+
if (!E)
|
|
1791
|
+
return h;
|
|
1792
|
+
const A = i(v, R, P), m = pt(() => E(P, {
|
|
1752
1793
|
push: t,
|
|
1753
|
-
replace:
|
|
1754
|
-
reject:
|
|
1794
|
+
replace: r,
|
|
1795
|
+
reject: n
|
|
1755
1796
|
}));
|
|
1756
|
-
return
|
|
1757
|
-
}, {}), a = (
|
|
1758
|
-
Object.entries(
|
|
1759
|
-
e.set(
|
|
1797
|
+
return h[A] = m, h;
|
|
1798
|
+
}, {}), a = (d) => {
|
|
1799
|
+
Object.entries(d).forEach(([P, p]) => {
|
|
1800
|
+
e.set(P, p);
|
|
1760
1801
|
});
|
|
1761
|
-
}, s = async (
|
|
1762
|
-
const
|
|
1763
|
-
for (const { id:
|
|
1764
|
-
if (!
|
|
1802
|
+
}, s = async (d) => {
|
|
1803
|
+
const P = d.matches.flatMap(u), p = [], h = [];
|
|
1804
|
+
for (const { id: v, name: R, props: E } of P) {
|
|
1805
|
+
if (!E)
|
|
1765
1806
|
continue;
|
|
1766
|
-
const A =
|
|
1807
|
+
const A = i(v, R, d);
|
|
1767
1808
|
if (p.push(A), !e.has(A)) {
|
|
1768
|
-
const
|
|
1809
|
+
const m = pt(() => E(d, {
|
|
1769
1810
|
push: t,
|
|
1770
|
-
replace:
|
|
1771
|
-
reject:
|
|
1811
|
+
replace: r,
|
|
1812
|
+
reject: n
|
|
1772
1813
|
}));
|
|
1773
|
-
e.set(A,
|
|
1814
|
+
e.set(A, m);
|
|
1774
1815
|
}
|
|
1775
|
-
|
|
1776
|
-
const
|
|
1777
|
-
if (
|
|
1778
|
-
throw
|
|
1816
|
+
h.push((async () => {
|
|
1817
|
+
const m = await e.get(A);
|
|
1818
|
+
if (m instanceof Error)
|
|
1819
|
+
throw m;
|
|
1779
1820
|
})());
|
|
1780
1821
|
}
|
|
1781
1822
|
f(p);
|
|
1782
1823
|
try {
|
|
1783
|
-
return await Promise.all(
|
|
1784
|
-
} catch (
|
|
1785
|
-
if (
|
|
1786
|
-
return
|
|
1787
|
-
throw
|
|
1824
|
+
return await Promise.all(h), { status: "SUCCESS" };
|
|
1825
|
+
} catch (v) {
|
|
1826
|
+
if (v instanceof te || v instanceof be)
|
|
1827
|
+
return v.response;
|
|
1828
|
+
throw v;
|
|
1788
1829
|
}
|
|
1789
|
-
}, c = (
|
|
1790
|
-
const
|
|
1791
|
-
return e.get(
|
|
1830
|
+
}, c = (d, P, p) => {
|
|
1831
|
+
const h = i(d, P, p);
|
|
1832
|
+
return e.get(h);
|
|
1792
1833
|
};
|
|
1793
|
-
function
|
|
1794
|
-
return [
|
|
1834
|
+
function i(d, P, p) {
|
|
1835
|
+
return [d, P, p.id, JSON.stringify(p.params)].join("-");
|
|
1795
1836
|
}
|
|
1796
|
-
function
|
|
1797
|
-
return Me(
|
|
1837
|
+
function u(d) {
|
|
1838
|
+
return Me(d) ? Object.entries(d.props ?? {}).map(([P, p]) => ({ id: d.id, name: P, props: p })) : _e(d) ? [
|
|
1798
1839
|
{
|
|
1799
|
-
id:
|
|
1840
|
+
id: d.id,
|
|
1800
1841
|
name: "default",
|
|
1801
|
-
props:
|
|
1842
|
+
props: d.props
|
|
1802
1843
|
}
|
|
1803
1844
|
] : [];
|
|
1804
1845
|
}
|
|
1805
|
-
function f(
|
|
1806
|
-
for (const
|
|
1807
|
-
|
|
1846
|
+
function f(d) {
|
|
1847
|
+
for (const P in e.keys())
|
|
1848
|
+
d.includes(P) || e.delete(P);
|
|
1808
1849
|
}
|
|
1809
1850
|
return {
|
|
1810
1851
|
getPrefetchProps: o,
|
|
@@ -1813,122 +1854,96 @@ function Kr() {
|
|
|
1813
1854
|
setProps: s
|
|
1814
1855
|
};
|
|
1815
1856
|
}
|
|
1816
|
-
function
|
|
1817
|
-
const e =
|
|
1857
|
+
function rr() {
|
|
1858
|
+
const e = ae(tr);
|
|
1818
1859
|
if (!e)
|
|
1819
1860
|
throw new pe();
|
|
1820
1861
|
return e;
|
|
1821
1862
|
}
|
|
1822
|
-
const
|
|
1863
|
+
const Kn = pr(() => new Promise((e) => {
|
|
1823
1864
|
e({ default: { template: "foo" } });
|
|
1824
1865
|
}));
|
|
1825
|
-
function
|
|
1826
|
-
return e.name ===
|
|
1866
|
+
function dt(e) {
|
|
1867
|
+
return e.name === Kn.name && "__asyncLoader" in e;
|
|
1827
1868
|
}
|
|
1828
|
-
function
|
|
1829
|
-
const t = /* @__PURE__ */ new Map(),
|
|
1830
|
-
const
|
|
1831
|
-
o(
|
|
1869
|
+
function Yn(e) {
|
|
1870
|
+
const t = /* @__PURE__ */ new Map(), r = $e(), { getPrefetchProps: n, setPrefetchProps: o } = rr(), { isElementVisible: a } = bn(r), s = () => {
|
|
1871
|
+
const i = Array.from(t.values()).reduce((u, f) => (Object.assign(u, f), u), {});
|
|
1872
|
+
o(i);
|
|
1832
1873
|
};
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
a(n.value);
|
|
1839
|
-
}), pn(() => {
|
|
1840
|
-
n.value && s(n.value);
|
|
1841
|
-
}), je(() => ue(e), ({ route: f, ...l }) => {
|
|
1842
|
-
t.clear(), f && i("eager", f, l);
|
|
1843
|
-
}, { immediate: !0 }), je(() => !!(n.value && c(n.value)), (f) => {
|
|
1844
|
-
const { route: l, ...m } = ue(e);
|
|
1845
|
-
!l || !f || i("lazy", l, m);
|
|
1874
|
+
ge(() => $(e), ({ route: i, ...u }) => {
|
|
1875
|
+
t.clear(), i && c("eager", i, u);
|
|
1876
|
+
}, { immediate: !0 }), ge(a, (i) => {
|
|
1877
|
+
const { route: u, ...f } = $(e);
|
|
1878
|
+
!u || !i || c("lazy", u, f);
|
|
1846
1879
|
}, { immediate: !0 });
|
|
1847
|
-
function i
|
|
1848
|
-
|
|
1880
|
+
function c(i, u, f) {
|
|
1881
|
+
Xn(i, u, f), t.has(i) || t.set(i, n(i, u, f));
|
|
1849
1882
|
}
|
|
1850
1883
|
return {
|
|
1851
|
-
element:
|
|
1852
|
-
commit:
|
|
1884
|
+
element: r,
|
|
1885
|
+
commit: s
|
|
1853
1886
|
};
|
|
1854
1887
|
}
|
|
1855
|
-
function
|
|
1856
|
-
t.matches.forEach((
|
|
1857
|
-
|
|
1858
|
-
...
|
|
1859
|
-
routePrefetch:
|
|
1860
|
-
}, "components") === e && (_e(
|
|
1861
|
-
|
|
1888
|
+
function Xn(e, t, r) {
|
|
1889
|
+
t.matches.forEach((n) => {
|
|
1890
|
+
Zt({
|
|
1891
|
+
...r,
|
|
1892
|
+
routePrefetch: n.prefetch
|
|
1893
|
+
}, "components") === e && (_e(n) && dt(n.component) && n.component.__asyncLoader(), Me(n) && Object.values(n.components).forEach((a) => {
|
|
1894
|
+
dt(a) && a.__asyncLoader();
|
|
1862
1895
|
}));
|
|
1863
1896
|
});
|
|
1864
1897
|
}
|
|
1865
|
-
function
|
|
1866
|
-
return
|
|
1867
|
-
}
|
|
1868
|
-
function
|
|
1869
|
-
const
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
})), f = N(() => {
|
|
1898
|
+
function nr(e, t, { exact: r } = {}) {
|
|
1899
|
+
return Jr(e) ? t === void 0 ? !0 : r ? e.matched.name === t : e.matches.map((n) => n.name).includes(t) : !1;
|
|
1900
|
+
}
|
|
1901
|
+
function Zn(e, t = {}, r = {}) {
|
|
1902
|
+
const n = qe(), o = N(() => {
|
|
1903
|
+
const h = $(e);
|
|
1904
|
+
return typeof h != "string" ? h : O(h) ? n.find(h, $(r)) : n.resolve(h, $(t), $(r));
|
|
1905
|
+
}), a = N(() => {
|
|
1906
|
+
if (o.value)
|
|
1907
|
+
return o.value.href;
|
|
1908
|
+
const h = $(e);
|
|
1909
|
+
if (O(h))
|
|
1910
|
+
return h;
|
|
1911
|
+
console.error(new Error("Failed to resolve route in RouterLink."));
|
|
1912
|
+
}), s = N(() => nr(n.route) && n.route.matches.some((h) => {
|
|
1881
1913
|
var v;
|
|
1882
|
-
return
|
|
1883
|
-
}),
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1914
|
+
return h.id === ((v = o.value) == null ? void 0 : v.id);
|
|
1915
|
+
})), c = N(() => {
|
|
1916
|
+
var h;
|
|
1917
|
+
return n.route.id === ((h = o.value) == null ? void 0 : h.id);
|
|
1918
|
+
}), i = N(() => !!a.value && n.isExternal(a.value)), u = N(() => {
|
|
1919
|
+
const h = $(e);
|
|
1920
|
+
return typeof h != "string" || O(h) ? $(t) : $(r);
|
|
1921
|
+
}), { element: f, commit: d } = Yn(() => ({
|
|
1922
|
+
route: o.value,
|
|
1923
|
+
routerPrefetch: n.prefetch,
|
|
1924
|
+
linkPrefetch: u.value.prefetch
|
|
1925
|
+
})), P = (h) => {
|
|
1926
|
+
d();
|
|
1927
|
+
const v = {
|
|
1928
|
+
replace: (h == null ? void 0 : h.replace) ?? u.value.replace,
|
|
1929
|
+
query: Ge(u.value.query, h == null ? void 0 : h.query),
|
|
1930
|
+
hash: (h == null ? void 0 : h.hash) ?? u.value.hash,
|
|
1931
|
+
state: { ...u.value.state, ...h == null ? void 0 : h.state }
|
|
1932
|
+
}, R = $(e);
|
|
1933
|
+
return O(R) || typeof R == "object" ? n.push(R, v) : n.push(R, $(t), v);
|
|
1934
|
+
};
|
|
1888
1935
|
return {
|
|
1889
|
-
element:
|
|
1890
|
-
route:
|
|
1891
|
-
href:
|
|
1892
|
-
isMatch:
|
|
1893
|
-
isExactMatch:
|
|
1894
|
-
isExternal:
|
|
1936
|
+
element: f,
|
|
1937
|
+
route: o,
|
|
1938
|
+
href: a,
|
|
1939
|
+
isMatch: s,
|
|
1940
|
+
isExactMatch: c,
|
|
1941
|
+
isExternal: i,
|
|
1895
1942
|
push: P,
|
|
1896
|
-
replace: (
|
|
1897
|
-
};
|
|
1898
|
-
}
|
|
1899
|
-
function eo(e, t) {
|
|
1900
|
-
const n = We();
|
|
1901
|
-
function r() {
|
|
1902
|
-
if (!e)
|
|
1903
|
-
return;
|
|
1904
|
-
if (!nn(n.route, e, t))
|
|
1905
|
-
throw new Fn(e, n.route.name);
|
|
1906
|
-
}
|
|
1907
|
-
return je(n.route, r, { immediate: !0, deep: !0 }), n.route;
|
|
1908
|
-
}
|
|
1909
|
-
const rn = Symbol();
|
|
1910
|
-
function Ye() {
|
|
1911
|
-
return oe(rn, 0);
|
|
1912
|
-
}
|
|
1913
|
-
function on() {
|
|
1914
|
-
const e = oe(Ht);
|
|
1915
|
-
if (!e)
|
|
1916
|
-
throw new pe();
|
|
1917
|
-
return e;
|
|
1918
|
-
}
|
|
1919
|
-
function an(e) {
|
|
1920
|
-
return (t) => {
|
|
1921
|
-
const n = Ye(), o = on().addBeforeRouteHook({ lifecycle: e, hook: t, depth: n, timing: "component" });
|
|
1922
|
-
return mt(o), o;
|
|
1943
|
+
replace: (h) => P({ ...h, replace: !0 })
|
|
1923
1944
|
};
|
|
1924
1945
|
}
|
|
1925
|
-
|
|
1926
|
-
return (t) => {
|
|
1927
|
-
const n = Ye(), o = on().addAfterRouteHook({ lifecycle: e, hook: t, depth: n, timing: "component" });
|
|
1928
|
-
return mt(o), o;
|
|
1929
|
-
};
|
|
1930
|
-
}
|
|
1931
|
-
const ho = an("onBeforeRouteUpdate"), po = an("onBeforeRouteLeave"), mo = Xe("onAfterRouteEnter"), go = Xe("onAfterRouteUpdate"), yo = Xe("onAfterRouteLeave"), to = ["href"], no = /* @__PURE__ */ ae({
|
|
1946
|
+
const eo = ["href"], to = /* @__PURE__ */ se({
|
|
1932
1947
|
__name: "routerLink",
|
|
1933
1948
|
props: {
|
|
1934
1949
|
to: {},
|
|
@@ -1939,130 +1954,177 @@ const ho = an("onBeforeRouteUpdate"), po = an("onBeforeRouteLeave"), mo = Xe("on
|
|
|
1939
1954
|
state: {}
|
|
1940
1955
|
},
|
|
1941
1956
|
setup(e) {
|
|
1942
|
-
const t = e,
|
|
1943
|
-
const { to:
|
|
1944
|
-
return
|
|
1945
|
-
}), { element:
|
|
1946
|
-
"router-link--match":
|
|
1947
|
-
"router-link--exact-match":
|
|
1957
|
+
const t = e, r = qe(), n = N(() => P(t.to)), o = N(() => p(t.to)), a = N(() => {
|
|
1958
|
+
const { to: v, ...R } = t;
|
|
1959
|
+
return R;
|
|
1960
|
+
}), { element: s, isMatch: c, isExactMatch: i, isExternal: u, push: f } = Zn(() => typeof t.to == "function" ? t.to(r.resolve) : t.to, a), d = N(() => ({
|
|
1961
|
+
"router-link--match": c.value,
|
|
1962
|
+
"router-link--exact-match": i.value
|
|
1948
1963
|
}));
|
|
1949
|
-
function
|
|
1950
|
-
|
|
1964
|
+
function P(v) {
|
|
1965
|
+
if (typeof v == "function") {
|
|
1966
|
+
const R = v(r.resolve);
|
|
1967
|
+
return P(R);
|
|
1968
|
+
}
|
|
1969
|
+
return O(v) ? r.find(v) : v;
|
|
1970
|
+
}
|
|
1971
|
+
function p(v) {
|
|
1972
|
+
if (typeof v == "function") {
|
|
1973
|
+
const R = v(r.resolve);
|
|
1974
|
+
return p(R);
|
|
1975
|
+
}
|
|
1976
|
+
return O(v) ? v : v == null ? void 0 : v.href;
|
|
1951
1977
|
}
|
|
1952
|
-
|
|
1978
|
+
function h(v) {
|
|
1979
|
+
v.preventDefault(), f();
|
|
1980
|
+
}
|
|
1981
|
+
return (v, R) => (yt(), dr("a", {
|
|
1953
1982
|
ref_key: "element",
|
|
1954
|
-
ref:
|
|
1955
|
-
href:
|
|
1956
|
-
class:
|
|
1957
|
-
onClick:
|
|
1983
|
+
ref: s,
|
|
1984
|
+
href: o.value,
|
|
1985
|
+
class: mr(["router-link", d.value]),
|
|
1986
|
+
onClick: h
|
|
1958
1987
|
}, [
|
|
1959
|
-
|
|
1960
|
-
], 10,
|
|
1988
|
+
gt(v.$slots, "default", vt(yr({ route: n.value, isMatch: ue(c), isExactMatch: ue(i), isExternal: ue(u) })))
|
|
1989
|
+
], 10, eo));
|
|
1961
1990
|
}
|
|
1962
1991
|
});
|
|
1963
1992
|
function ro(e, t) {
|
|
1964
|
-
|
|
1993
|
+
const r = qe();
|
|
1994
|
+
function n() {
|
|
1995
|
+
if (!e)
|
|
1996
|
+
return;
|
|
1997
|
+
if (!nr(r.route, e, t))
|
|
1998
|
+
throw new Ar(e, r.route.name);
|
|
1999
|
+
}
|
|
2000
|
+
return ge(r.route, n, { immediate: !0, deep: !0 }), r.route;
|
|
2001
|
+
}
|
|
2002
|
+
const or = Symbol();
|
|
2003
|
+
function Xe() {
|
|
2004
|
+
return ae(or, 0);
|
|
2005
|
+
}
|
|
2006
|
+
function no(e, t) {
|
|
2007
|
+
return se({
|
|
1965
2008
|
name: "PropsWrapper",
|
|
1966
2009
|
expose: [],
|
|
1967
2010
|
setup() {
|
|
1968
|
-
const
|
|
1969
|
-
return () =>
|
|
2011
|
+
const r = t(), n = gr();
|
|
2012
|
+
return () => r instanceof Error ? "" : er(r) ? n != null && n.suspense ? Z(ao(e, r)) : Z(oo(e, r)) : Z(e, r);
|
|
1970
2013
|
}
|
|
1971
2014
|
});
|
|
1972
2015
|
}
|
|
1973
2016
|
function oo(e, t) {
|
|
1974
|
-
return
|
|
2017
|
+
return se({
|
|
1975
2018
|
name: "AsyncPropsWrapper",
|
|
1976
2019
|
expose: [],
|
|
1977
2020
|
setup() {
|
|
1978
|
-
const
|
|
1979
|
-
return (async () =>
|
|
2021
|
+
const r = $e();
|
|
2022
|
+
return (async () => r.value = await t)(), () => r.value instanceof Error ? "" : r.value ? Z(e, r.value) : "";
|
|
1980
2023
|
}
|
|
1981
2024
|
});
|
|
1982
2025
|
}
|
|
1983
2026
|
function ao(e, t) {
|
|
1984
|
-
return
|
|
2027
|
+
return se({
|
|
1985
2028
|
name: "SuspenseAsyncPropsWrapper",
|
|
1986
2029
|
expose: [],
|
|
1987
2030
|
async setup() {
|
|
1988
|
-
const
|
|
1989
|
-
return () =>
|
|
2031
|
+
const r = await t;
|
|
2032
|
+
return () => Z(e, r);
|
|
1990
2033
|
}
|
|
1991
2034
|
});
|
|
1992
2035
|
}
|
|
1993
|
-
const so = /* @__PURE__ */
|
|
2036
|
+
const so = /* @__PURE__ */ se({
|
|
1994
2037
|
__name: "routerView",
|
|
1995
2038
|
props: {
|
|
1996
2039
|
name: { default: "default" }
|
|
1997
2040
|
},
|
|
1998
2041
|
setup(e) {
|
|
1999
|
-
const t =
|
|
2000
|
-
|
|
2042
|
+
const t = ro(), r = Fr(), n = Xe(), { getProps: o } = rr(), a = vr("RouterView", !0);
|
|
2043
|
+
Rr(or, n + 1);
|
|
2001
2044
|
const s = N(() => {
|
|
2002
|
-
if (
|
|
2003
|
-
return
|
|
2004
|
-
const
|
|
2005
|
-
if (!
|
|
2045
|
+
if (r.value)
|
|
2046
|
+
return r.value.component;
|
|
2047
|
+
const u = t.matches.at(n);
|
|
2048
|
+
if (!u)
|
|
2006
2049
|
return null;
|
|
2007
|
-
const f = c(
|
|
2008
|
-
return f ?
|
|
2050
|
+
const f = c(u), d = o(u.id, e.name, t);
|
|
2051
|
+
return f ? d ? no(f, () => d) : f : null;
|
|
2009
2052
|
});
|
|
2010
|
-
function c(
|
|
2011
|
-
return u
|
|
2053
|
+
function c(u) {
|
|
2054
|
+
return i(u)[e.name];
|
|
2012
2055
|
}
|
|
2013
|
-
function u
|
|
2014
|
-
return Me(
|
|
2056
|
+
function i(u) {
|
|
2057
|
+
return Me(u) ? u.components : _e(u) ? { default: u.component } : typeof a == "string" ? {} : { default: a };
|
|
2015
2058
|
}
|
|
2016
|
-
return (
|
|
2017
|
-
(
|
|
2018
|
-
]) :
|
|
2059
|
+
return (u, f) => s.value ? gt(u.$slots, "default", vt(wr({ key: 0 }, { route: ue(t), component: s.value, rejection: ue(r) })), () => [
|
|
2060
|
+
(yt(), Pr(Er(s.value)))
|
|
2061
|
+
]) : br("", !0);
|
|
2019
2062
|
}
|
|
2020
2063
|
});
|
|
2064
|
+
function ar() {
|
|
2065
|
+
const e = ae(jt);
|
|
2066
|
+
if (!e)
|
|
2067
|
+
throw new pe();
|
|
2068
|
+
return e;
|
|
2069
|
+
}
|
|
2070
|
+
function sr(e) {
|
|
2071
|
+
return (t) => {
|
|
2072
|
+
const r = Xe(), o = ar().addBeforeRouteHook({ lifecycle: e, hook: t, depth: r, timing: "component" });
|
|
2073
|
+
return Rt(o), o;
|
|
2074
|
+
};
|
|
2075
|
+
}
|
|
2076
|
+
function Ze(e) {
|
|
2077
|
+
return (t) => {
|
|
2078
|
+
const r = Xe(), o = ar().addAfterRouteHook({ lifecycle: e, hook: t, depth: r, timing: "component" });
|
|
2079
|
+
return Rt(o), o;
|
|
2080
|
+
};
|
|
2081
|
+
}
|
|
2082
|
+
const ho = sr("onBeforeRouteUpdate"), po = sr("onBeforeRouteLeave"), mo = Ze("onAfterRouteEnter"), yo = Ze("onAfterRouteUpdate"), go = Ze("onAfterRouteLeave");
|
|
2021
2083
|
function co(e) {
|
|
2022
2084
|
return de(e) && typeof e.value == "string";
|
|
2023
2085
|
}
|
|
2024
|
-
function
|
|
2025
|
-
return co(e) ? e :
|
|
2086
|
+
function mt(e) {
|
|
2087
|
+
return co(e) ? e : Qt(e, {});
|
|
2026
2088
|
}
|
|
2027
2089
|
function vo(e) {
|
|
2028
|
-
const t =
|
|
2090
|
+
const t = Fe(), r = Gt(e.name), n = Kt(e.path), o = Yt(e.query), a = zt(e.hash), s = e.meta ?? {}, c = jr(e) ? mt(e.host) : mt(""), i = ye({ id: t, meta: {}, state: {}, ...e }), u = {
|
|
2029
2091
|
id: t,
|
|
2030
|
-
matched:
|
|
2031
|
-
matches: [
|
|
2032
|
-
name:
|
|
2092
|
+
matched: i,
|
|
2093
|
+
matches: [i],
|
|
2094
|
+
name: r,
|
|
2033
2095
|
host: c,
|
|
2034
|
-
path:
|
|
2096
|
+
path: n,
|
|
2035
2097
|
query: o,
|
|
2036
2098
|
hash: a,
|
|
2037
2099
|
meta: s,
|
|
2038
2100
|
depth: 1,
|
|
2039
2101
|
state: {}
|
|
2040
|
-
}, f =
|
|
2041
|
-
return
|
|
2102
|
+
}, f = bt(e) ? St(e.parent, u) : u;
|
|
2103
|
+
return ce(f.path.params, f.query.params, f.host.params), f;
|
|
2042
2104
|
}
|
|
2043
2105
|
export {
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2106
|
+
Sr as DuplicateParamsError,
|
|
2107
|
+
kr as MetaPropertyConflict,
|
|
2108
|
+
to as RouterLink,
|
|
2047
2109
|
pe as RouterNotInstalledError,
|
|
2048
2110
|
so as RouterView,
|
|
2049
|
-
|
|
2050
|
-
|
|
2111
|
+
Ar as UseRouteInvalidError,
|
|
2112
|
+
wt as asUrl,
|
|
2051
2113
|
vo as createExternalRoute,
|
|
2052
|
-
|
|
2053
|
-
|
|
2114
|
+
Tr as createParam,
|
|
2115
|
+
oe as createRoute,
|
|
2054
2116
|
lo as createRouter,
|
|
2055
|
-
|
|
2056
|
-
|
|
2117
|
+
nr as isRoute,
|
|
2118
|
+
O as isUrl,
|
|
2057
2119
|
mo as onAfterRouteEnter,
|
|
2058
|
-
|
|
2059
|
-
|
|
2120
|
+
yo as onAfterRouteLeave,
|
|
2121
|
+
go as onAfterRouteUpdate,
|
|
2060
2122
|
ho as onBeforeRouteLeave,
|
|
2061
2123
|
po as onBeforeRouteUpdate,
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2124
|
+
He as path,
|
|
2125
|
+
ht as query,
|
|
2126
|
+
Zn as useLink,
|
|
2127
|
+
ro as useRoute,
|
|
2128
|
+
qe as useRouter,
|
|
2067
2129
|
fo as withDefault
|
|
2068
2130
|
};
|