@kitbag/router 0.3.0 → 0.4.1

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