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