@kitbag/router 0.13.4 → 0.14.0

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