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