@kitbag/router 0.20.9 → 0.20.11

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