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