@kitbag/router 0.16.1 → 0.17.2

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