@kitbag/router 0.2.0 → 0.4.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,75 +1,138 @@
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 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 st, computed as H, toValue as lt, readonly as ct, watch as Ee, onUnmounted as Ot, defineComponent as it, openBlock as _t, createElementBlock as be, normalizeClass as Pe, renderSlot as qt, normalizeProps as Dt, guardReactiveProps as Mt, unref as Z, provide as Se, defineAsyncComponent as ke, createBlock as xe, resolveDynamicComponent as Ae, h as Tt, reactive as Le, ref as Ue, markRaw as pt } 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 mt 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 Wt = Symbol();
31
+ function Rt() {
32
+ const t = st(Wt);
33
+ if (!t)
34
+ throw new mt();
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 F 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 He(t, e = {}, n = {}) {
43
+ const r = Rt(), o = H(() => lt(t)), a = H(() => lt(e)), s = H(() => lt(n)), c = H(() => {
44
+ if (I(o.value))
45
+ return o.value;
46
+ try {
47
+ return r.resolve(o.value, a.value, s.value);
48
+ } catch (d) {
49
+ throw d instanceof F && console.error(`Failed to resolve route "${o.value.toString()}" in RouterLink.`, d), d;
50
+ }
51
+ }), u = H(() => r.find(c.value, s.value)), f = H(() => !!u.value && r.route.matches.includes(ct(u.value.matched))), R = H(() => !!u.value && r.route.matched === u.value.matched);
52
+ return {
53
+ route: u,
54
+ href: c,
55
+ isMatch: f,
56
+ isExactMatch: R,
57
+ push: (d) => r.push(c.value, {}, { ...s.value, ...d }),
58
+ replace: (d) => r.replace(c.value, {}, { ...s.value, ...d })
59
+ };
60
+ }
61
+ const Ft = Symbol();
62
+ function Ne() {
63
+ const t = st(Ft);
64
+ if (!t)
65
+ throw new mt();
66
+ return t;
67
+ }
68
+ function It(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 Ve(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 ? [It(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 = Rt();
123
+ function r() {
124
+ if (!t)
125
+ return;
126
+ if (!Ve(n.route, t, { exact: e }))
127
+ throw new Be(t, n.route.key);
128
+ }
129
+ return Ee(n.route, r, { immediate: !0, deep: !0 }), n.route;
71
130
  }
72
- class X {
131
+ const Jt = Symbol();
132
+ function gt() {
133
+ return st(Jt, 0);
134
+ }
135
+ class et {
73
136
  constructor() {
74
137
  $(this, "onBeforeRouteEnter", /* @__PURE__ */ new Set());
75
138
  $(this, "onBeforeRouteUpdate", /* @__PURE__ */ new Set());
@@ -79,132 +142,129 @@ class X {
79
142
  $(this, "onAfterRouteLeave", /* @__PURE__ */ new Set());
80
143
  }
81
144
  }
82
- class Le extends Error {
145
+ class Ut extends Error {
83
146
  }
84
- class F extends Error {
147
+ class G extends Error {
85
148
  constructor(n) {
86
149
  super("Error occurred during a router push operation.");
87
150
  $(this, "to");
88
151
  this.to = n;
89
152
  }
90
153
  }
91
- class fe extends Error {
154
+ class ht extends Error {
92
155
  constructor(n) {
93
156
  super(`Routing action rejected: ${n}`);
94
157
  $(this, "type");
95
158
  this.type = n;
96
159
  }
97
160
  }
98
- function M(e) {
99
- return Array.isArray(e) ? e : [e];
161
+ function W(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 _e(t, e) {
165
+ const n = new et();
166
+ return t.matches.forEach((r, o) => {
167
+ r.onBeforeRouteEnter && yt(t, e, o) && W(r.onBeforeRouteEnter).forEach((a) => n.onBeforeRouteEnter.add(a)), r.onBeforeRouteUpdate && wt(t, e, o) && W(r.onBeforeRouteUpdate).forEach((a) => n.onBeforeRouteUpdate.add(a));
168
+ }), e.matches.forEach((r, o) => {
169
+ r.onBeforeRouteLeave && vt(t, e, o) && W(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 qe(t, e) {
173
+ const n = new et();
174
+ return t.matches.forEach((r, o) => {
175
+ r.onAfterRouteEnter && yt(t, e, o) && W(r.onAfterRouteEnter).forEach((a) => n.onAfterRouteEnter.add(a)), r.onAfterRouteUpdate && wt(t, e, o) && W(r.onAfterRouteUpdate).forEach((a) => n.onAfterRouteUpdate.add(a));
176
+ }), e.matches.forEach((r, o) => {
177
+ r.onAfterRouteLeave && vt(t, e, o) && W(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 De() {
181
+ const t = (s) => {
182
+ throw new ht(s);
183
+ }, e = (...s) => {
184
+ throw new G(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 d = c ?? {};
188
+ throw new G([s, { ...d, replace: !0 }]);
129
189
  }
130
- const d = c, m = u ?? {};
131
- throw new F([s, d, { ...m, replace: !0 }]);
190
+ const f = c, R = u ?? {};
191
+ throw new G([s, f, { ...R, replace: !0 }]);
132
192
  }, r = () => {
133
- throw new Le();
193
+ throw new Ut();
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 = [
196
+ const { global: f, component: R } = u, d = _e(s, c), A = [
197
+ ...f.onBeforeRouteEnter,
137
198
  ...d.onBeforeRouteEnter,
138
- ...y.onBeforeRouteEnter,
199
+ ...f.onBeforeRouteUpdate,
139
200
  ...d.onBeforeRouteUpdate,
140
- ...y.onBeforeRouteUpdate,
141
- ...m.onBeforeRouteUpdate,
201
+ ...R.onBeforeRouteUpdate,
202
+ ...f.onBeforeRouteLeave,
142
203
  ...d.onBeforeRouteLeave,
143
- ...y.onBeforeRouteLeave,
144
- ...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 G)
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 ht)
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 Ut)
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 = [
178
- ...m.onAfterRouteLeave,
179
- ...y.onAfterRouteLeave,
237
+ const { global: f, component: R } = u, d = qe(s, c), A = [
238
+ ...R.onAfterRouteLeave,
180
239
  ...d.onAfterRouteLeave,
181
- ...m.onAfterRouteUpdate,
182
- ...y.onAfterRouteUpdate,
240
+ ...f.onAfterRouteLeave,
241
+ ...R.onAfterRouteUpdate,
183
242
  ...d.onAfterRouteUpdate,
184
- ...m.onAfterRouteEnter,
185
- ...y.onAfterRouteEnter,
186
- ...d.onAfterRouteEnter
243
+ ...f.onAfterRouteUpdate,
244
+ ...R.onAfterRouteEnter,
245
+ ...d.onAfterRouteEnter,
246
+ ...f.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 G)
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 ht)
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,198 +275,214 @@ 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 yt = (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
+ }, vt = (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 Bt(t) {
286
+ switch (t) {
227
287
  case "onBeforeRouteEnter":
228
288
  case "onAfterRouteEnter":
229
- return ye;
289
+ return yt;
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 vt;
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 Me {
241
301
  constructor() {
242
- $(this, "global", new X());
243
- $(this, "component", new X());
302
+ $(this, "global", new et());
303
+ $(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 = Bt(e), s = this[n][e], c = (u, f) => {
307
+ if (a(u, f.from, r))
308
+ return o(u, f);
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 = Bt(e), s = this[n][e], c = (u, f) => {
314
+ if (a(u, f.from, r))
315
+ return o(u, f);
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 Kt = Symbol();
321
+ function Te() {
322
+ const t = new Me();
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 Qt() {
334
+ const t = st(Kt);
335
+ if (!t)
336
+ throw new mt();
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 Gt(t) {
340
+ return (e) => {
341
+ const n = gt(), o = Qt().addBeforeRouteHook({ lifecycle: t, hook: e, depth: n, timing: "component" });
342
+ return Ot(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 Et(t) {
346
+ return (e) => {
347
+ const n = gt(), o = Qt().addAfterRouteHook({ lifecycle: t, hook: e, depth: n, timing: "component" });
348
+ return Ot(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 In = Gt("onBeforeRouteUpdate"), Jn = Gt("onBeforeRouteLeave"), Kn = Et("onAfterRouteEnter"), Qn = Et("onAfterRouteUpdate"), Gn = Et("onAfterRouteLeave"), We = ["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 = Rt(), r = H(() => I(e.to) ? e.to : e.to(n.resolve)), o = H(() => {
360
+ const { to: d, ...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 } = He(r), u = H(() => ({
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
+ })), f = H(() => {
366
+ const { host: d } = new URL(r.value, window.location.origin);
367
+ return d !== window.location.host;
311
368
  });
312
- function m(y) {
313
- y.preventDefault(), n.push(r.value, o.value);
369
+ function R(d) {
370
+ d.preventDefault(), n.push(a.value, o.value);
314
371
  }
315
- return (y, A) => (le(), Rt("a", {
372
+ return (d, A) => (_t(), be("a", {
316
373
  href: r.value,
317
- class: wt(["router-link", u.value]),
318
- onClick: m
374
+ class: Pe(["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
+ qt(d.$slots, "default", Dt(Mt({ resolved: r.value, isMatch: Z(s), isExactMatch: Z(c), isExternal: f.value })))
378
+ ], 10, We));
322
379
  }
323
- }), Fe = /* @__PURE__ */ se({
380
+ });
381
+ function zt(t) {
382
+ return "children" in t;
383
+ }
384
+ function Ie(t) {
385
+ return zt(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 Ke(t) {
391
+ return typeof t == "object" && t !== null && "components" in t;
392
+ }
393
+ const Yt = /* @__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 = Ne(), o = gt();
400
+ Se(Jt, o + 1);
401
+ const a = H(() => {
402
+ if (r.value)
403
+ return r.value.component;
404
+ const c = n.matches.at(o);
405
+ if (!c)
406
+ return null;
407
+ const f = s(c)[e];
408
+ return f ? typeof f == "function" ? ke(f) : f : 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 Ke(c) ? c.components : Je(c) ? { default: c.component } : {};
412
+ }
413
+ return (c, u) => qt(c.$slots, "default", Dt(Mt({ route: Z(n), component: a.value, rejection: Z(r) })), () => [
414
+ (_t(), xe(Ae(a.value)))
339
415
  ]);
340
416
  }
341
417
  });
342
- function On(e, t) {
343
- return se({
418
+ function zn(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 () => Tt(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", Qe = "hashchange", Xt = "popstate";
457
+ function Ht(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, l = h.search, v = h.hash, w = o.state || {};
462
+ return [w.idx, J({
387
463
  pathname: i,
388
- search: f,
389
- hash: w,
390
- state: v.usr || null,
391
- key: v.key || "default"
464
+ search: l,
465
+ hash: v,
466
+ state: w.usr || null,
467
+ key: w.key || "default"
392
468
  })];
393
469
  }
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)
401
- if (f != null) {
402
- var v = m - f;
403
- v && (s = {
404
- action: l,
405
- location: w,
475
+ var h = L.Pop, i = a(), l = i[0], v = i[1];
476
+ if (p.length)
477
+ if (l != null) {
478
+ var w = R - l;
479
+ w && (s = {
480
+ action: h,
481
+ location: v,
406
482
  retry: function() {
407
- E(v * -1);
483
+ E(w * -1);
408
484
  }
409
- }, E(v));
485
+ }, E(w));
410
486
  } else
411
487
  process.env.NODE_ENV !== "production" && D(
412
488
  !1,
@@ -416,87 +492,87 @@ 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
+ U(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(Xt, c);
499
+ var u = L.Pop, f = a(), R = f[0], d = f[1], A = K(), p = K();
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 j(h, i) {
507
+ return i === void 0 && (i = null), J(_({
508
+ pathname: d.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 V(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 B(h, i, l) {
524
+ return !p.length || (p.call({
525
+ action: h,
450
526
  location: i,
451
- retry: f
527
+ retry: l
452
528
  }), !1);
453
529
  }
454
- function B(l) {
455
- u = l;
530
+ function U(h) {
531
+ u = h;
456
532
  var i = a();
457
- m = i[0], y = i[1], A.call({
533
+ R = i[0], d = i[1], A.call({
458
534
  action: u,
459
- location: y
535
+ location: d
460
536
  });
461
537
  }
462
- function p(l, i) {
463
- var f = L.Push, w = N(l, i);
464
- function v() {
465
- p(l, i);
538
+ function m(h, i) {
539
+ var l = L.Push, v = j(h, i);
540
+ function w() {
541
+ m(h, i);
466
542
  }
467
- if (H(f, w, v)) {
468
- var S = j(w, m + 1), g = S[0], P = S[1];
543
+ if (B(l, v, w)) {
544
+ var k = V(v, R + 1), g = k[0], P = k[1];
469
545
  try {
470
546
  o.pushState(g, "", P);
471
547
  } catch {
472
548
  r.location.assign(P);
473
549
  }
474
- B(f);
550
+ U(l);
475
551
  }
476
552
  }
477
- function R(l, i) {
478
- var f = L.Replace, w = N(l, i);
479
- function v() {
480
- R(l, i);
553
+ function y(h, i) {
554
+ var l = L.Replace, v = j(h, i);
555
+ function w() {
556
+ y(h, i);
481
557
  }
482
- if (H(f, w, v)) {
483
- var S = j(w, m), g = S[0], P = S[1];
484
- o.replaceState(g, "", P), B(f);
558
+ if (B(l, v, w)) {
559
+ var k = V(v, R), g = k[0], P = k[1];
560
+ o.replaceState(g, "", P), U(l);
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 d;
496
572
  },
497
- createHref: k,
498
- push: p,
499
- replace: R,
573
+ createHref: S,
574
+ push: m,
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 l = p.push(i);
588
+ return p.length === 1 && r.addEventListener(nt, rt), function() {
589
+ l(), 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 Ge(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({
525
- pathname: w,
526
- search: S,
599
+ var i = z(r.location.hash.substr(1)), l = i.pathname, v = l === void 0 ? "/" : l, w = i.search, k = w === void 0 ? "" : w, g = i.hash, P = g === void 0 ? "" : g, x = o.state || {};
600
+ return [x.idx, J({
601
+ pathname: v,
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
- var i = L.Pop, f = a(), w = f[0], v = f[1];
538
- if (h.length)
539
- if (w != null) {
540
- var S = m - w;
541
- S && (s = {
613
+ var i = L.Pop, l = a(), v = l[0], w = l[1];
614
+ if (p.length)
615
+ if (v != null) {
616
+ var k = R - v;
617
+ k && (s = {
542
618
  action: i,
543
- location: v,
619
+ location: w,
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,97 +630,97 @@ 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
+ m(i);
558
634
  }
559
635
  }
560
- r.addEventListener(Qe, c), r.addEventListener(_t, function() {
561
- var i = a(), f = i[1];
562
- T(f) !== T(y) && c();
636
+ r.addEventListener(Xt, c), r.addEventListener(Qe, function() {
637
+ var i = a(), l = i[1];
638
+ M(l) !== M(d) && 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, f = a(), R = f[0], d = f[1], A = K(), p = K();
641
+ R == null && (R = 0, o.replaceState(_({}, o.state, {
642
+ idx: R
567
643
  }), ""));
568
- function k() {
569
- var i = document.querySelector("base"), f = "";
644
+ function S() {
645
+ var i = document.querySelector("base"), l = "";
570
646
  if (i && i.getAttribute("href")) {
571
- var w = r.location.href, v = w.indexOf("#");
572
- f = v === -1 ? w : w.slice(0, v);
647
+ var v = r.location.href, w = v.indexOf("#");
648
+ l = w === -1 ? v : v.slice(0, w);
573
649
  }
574
- return f;
650
+ return l;
575
651
  }
576
- function N(i) {
577
- return k() + "#" + (typeof i == "string" ? i : T(i));
652
+ function j(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 V(i, l) {
656
+ return l === void 0 && (l = null), J(_({
657
+ pathname: d.pathname,
582
658
  hash: "",
583
659
  search: ""
584
- }, typeof i == "string" ? W(i) : i, {
585
- state: f,
586
- key: te()
660
+ }, typeof i == "string" ? z(i) : i, {
661
+ state: l,
662
+ key: ot()
587
663
  }));
588
664
  }
589
- function H(i, f) {
665
+ function B(i, l) {
590
666
  return [{
591
667
  usr: i.state,
592
668
  key: i.key,
593
- idx: f
594
- }, N(i)];
669
+ idx: l
670
+ }, j(i)];
595
671
  }
596
- function B(i, f, w) {
597
- return !h.length || (h.call({
672
+ function U(i, l, v) {
673
+ return !p.length || (p.call({
598
674
  action: i,
599
- location: f,
600
- retry: w
675
+ location: l,
676
+ retry: v
601
677
  }), !1);
602
678
  }
603
- function p(i) {
679
+ function m(i) {
604
680
  u = i;
605
- var f = a();
606
- m = f[0], y = f[1], A.call({
681
+ var l = a();
682
+ R = l[0], d = l[1], A.call({
607
683
  action: u,
608
- location: y
684
+ location: d
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, l) {
688
+ var v = L.Push, w = V(i, l);
689
+ function k() {
690
+ y(i, l);
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(w.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(i) + ")"), U(v, w, k)) {
693
+ var g = B(w, 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
+ m(v);
624
700
  }
625
701
  }
626
- function E(i, f) {
627
- var w = L.Replace, v = j(i, f);
628
- function S() {
629
- E(i, f);
702
+ function E(i, l) {
703
+ var v = L.Replace, w = V(i, l);
704
+ function k() {
705
+ E(i, l);
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(w.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(i) + ")"), U(v, w, k)) {
708
+ var g = B(w, R), P = g[0], x = g[1];
709
+ o.replaceState(P, "", x), m(v);
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 d;
645
721
  },
646
- createHref: N,
647
- push: R,
722
+ createHref: j,
723
+ push: y,
648
724
  replace: E,
649
725
  go: b,
650
726
  back: function() {
@@ -653,78 +729,78 @@ function Vt(e) {
653
729
  forward: function() {
654
730
  b(1);
655
731
  },
656
- listen: function(f) {
657
- return A.push(f);
732
+ listen: function(l) {
733
+ return A.push(l);
658
734
  },
659
- 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);
735
+ block: function(l) {
736
+ var v = p.push(l);
737
+ return p.length === 1 && r.addEventListener(nt, rt), function() {
738
+ v(), 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 Nt(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(m) {
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 m == "string" ? z(m) : m));
754
+ return process.env.NODE_ENV !== "production" && D(y.pathname.charAt(0) === "/", "Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: " + JSON.stringify(m) + ")"), y;
755
+ }), s = $t(o ?? a.length - 1, 0, a.length - 1), c = L.Pop, u = a[s], f = K(), R = K();
756
+ function d(m) {
757
+ return typeof m == "string" ? m : M(m);
758
+ }
759
+ function A(m, 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 m == "string" ? z(m) : m, {
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(m, y, E) {
770
+ return !R.length || (R.call({
771
+ action: m,
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(m, y) {
777
+ c = m, u = y, f.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 j(m, y) {
783
+ var E = L.Push, b = A(m, y);
784
+ function h() {
785
+ j(m, 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(m) + ")"), 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 V(m, y) {
790
+ var E = L.Replace, b = A(m, y);
791
+ function h() {
792
+ V(m, 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(m) + ")"), 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 B(m) {
797
+ var y = $t(s + m, 0, a.length - 1), E = L.Pop, b = a[y];
798
+ function h() {
799
+ B(m);
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
- var B = {
803
+ var U = {
728
804
  get index() {
729
805
  return s;
730
806
  },
@@ -734,348 +810,350 @@ function He(e) {
734
810
  get location() {
735
811
  return u;
736
812
  },
737
- createHref: y,
738
- push: N,
739
- replace: j,
740
- go: H,
813
+ createHref: d,
814
+ push: j,
815
+ replace: V,
816
+ go: B,
741
817
  back: function() {
742
- H(-1);
818
+ B(-1);
743
819
  },
744
820
  forward: function() {
745
- H(1);
821
+ B(1);
746
822
  },
747
- listen: function(R) {
748
- return d.push(R);
823
+ listen: function(y) {
824
+ return f.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
- return B;
830
+ return U;
755
831
  }
756
- function $e(e, t, n) {
757
- return Math.min(Math.max(e, t), n);
832
+ function $t(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 K() {
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 ze(t, e) {
876
+ const n = Le({ ...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 Ye extends Error {
886
+ constructor(e) {
887
+ super(`Route disabled: "${e}"`);
888
+ }
833
889
  }
834
- const I = "[", G = "]";
835
- function Dt(e) {
836
- return e !== String && e !== Boolean && e !== Number && e !== Date;
890
+ class Xe extends Error {
891
+ constructor(e) {
892
+ super(`Route not found: "${e}"`);
893
+ }
837
894
  }
838
- function Tt(e) {
839
- return typeof e == "function" && Dt(e);
895
+ const Q = "[", Y = "]";
896
+ function Ze(t) {
897
+ return t !== String && t !== Boolean && t !== Number && t !== Date;
840
898
  }
841
- function We(e) {
842
- return typeof e == "object" && "get" in e && typeof e.get == "function" && "set" in e && typeof e.set == "function";
899
+ function tn(t) {
900
+ return typeof t == "function" && Ze(t);
843
901
  }
844
- function re(e) {
845
- return typeof e == "string" && e.length > 0;
902
+ function ft(t) {
903
+ return typeof t == "object" && "get" in t && typeof t.get == "function" && "set" in t && typeof t.set == "function";
846
904
  }
847
- function Mt(e, t) {
848
- return e[t] ?? String;
905
+ function Zt(t) {
906
+ return ft(t) ? t : {
907
+ get: (e) => St(e, t),
908
+ set: (e) => kt(e, t)
909
+ };
849
910
  }
850
- const Ge = Symbol();
851
- function ze(e) {
852
- return Ge in e;
911
+ const te = Symbol();
912
+ function bt(t) {
913
+ return te 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);
860
- },
861
- set: (t) => re(t) ? be(t, e) : ""
917
+ [te]: !0,
918
+ ...Zt(t)
919
+ };
920
+ }
921
+ function nn(t) {
922
+ return ft(t) && t.defaultValue !== void 0;
923
+ }
924
+ function Yn(t, e) {
925
+ return {
926
+ defaultValue: e,
927
+ ...Zt(t)
862
928
  };
863
929
  }
864
- const U = {
865
- invalid: (e) => {
866
- throw new ne(e);
930
+ function Pt(t) {
931
+ return typeof t == "string" && t.length > 0;
932
+ }
933
+ function rn(t, e) {
934
+ return t[e] ?? String;
935
+ }
936
+ const N = {
937
+ invalid: (t) => {
938
+ throw new F(t);
867
939
  }
868
- }, Jt = {
869
- get: (e) => e,
870
- set: (e, { invalid: t }) => {
871
- if (typeof e != "string")
872
- throw t();
873
- return e;
940
+ }, on = {
941
+ get: (t) => t,
942
+ set: (t, { invalid: e }) => {
943
+ if (typeof t != "string")
944
+ throw e();
945
+ return t;
874
946
  }
875
- }, Ye = {
876
- get: (e, { invalid: t }) => {
877
- if (e === "true")
947
+ }, ee = {
948
+ get: (t, { invalid: e }) => {
949
+ if (t === "true")
878
950
  return !0;
879
- if (e === "false")
951
+ if (t === "false")
880
952
  return !1;
881
- throw t();
953
+ throw e();
882
954
  },
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);
955
+ set: (t, { invalid: e }) => {
956
+ if (typeof t != "boolean")
957
+ throw e();
958
+ return t.toString();
959
+ }
960
+ }, ne = {
961
+ get: (t, { invalid: e }) => {
962
+ const n = Number(t);
891
963
  if (isNaN(n))
892
- throw t();
964
+ throw e();
893
965
  return n;
894
966
  },
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);
967
+ set: (t, { invalid: e }) => {
968
+ if (typeof t != "number")
969
+ throw e();
970
+ return t.toString();
971
+ }
972
+ }, re = {
973
+ get: (t, { invalid: e }) => {
974
+ const n = new Date(t);
904
975
  if (isNaN(n.getTime()))
905
- throw t();
976
+ throw e();
906
977
  return n;
907
978
  },
908
- set: (e, { invalid: t }) => {
909
- if (typeof e != "object" || !(e instanceof Date))
910
- throw t();
911
- return e.toISOString();
979
+ set: (t, { invalid: e }) => {
980
+ if (typeof t != "object" || !(t instanceof Date))
981
+ throw e();
982
+ return t.toISOString();
912
983
  }
913
- }, et = {
914
- get: (e, { invalid: t }) => {
984
+ }, oe = {
985
+ get: (t, { invalid: e }) => {
915
986
  try {
916
- return JSON.parse(e);
987
+ return JSON.parse(t);
917
988
  } catch {
918
- throw t();
989
+ throw e();
919
990
  }
920
991
  },
921
- set: (e, { invalid: t }) => {
992
+ set: (t, { invalid: e }) => {
922
993
  try {
923
- return JSON.stringify(e);
994
+ return JSON.stringify(t);
924
995
  } catch {
925
- throw t();
996
+ throw e();
926
997
  }
927
998
  }
928
999
  };
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();
1000
+ function St(t, e) {
1001
+ if (t === void 0 || !Pt(t)) {
1002
+ if (nn(e))
1003
+ return e.defaultValue;
1004
+ if (bt(e))
1005
+ return;
1006
+ throw new F();
953
1007
  }
954
- return e;
1008
+ if (e === String)
1009
+ return on.get(t, N);
1010
+ if (e === Boolean)
1011
+ return ee.get(t, N);
1012
+ if (e === Number)
1013
+ return ne.get(t, N);
1014
+ if (e === Date)
1015
+ return re.get(t, N);
1016
+ if (e === JSON)
1017
+ return oe.get(t, N);
1018
+ if (tn(e))
1019
+ return e(t, N);
1020
+ if (ft(e))
1021
+ return e.get(t, N);
1022
+ if (e instanceof RegExp) {
1023
+ if (e.test(t))
1024
+ return t;
1025
+ throw new F();
1026
+ }
1027
+ return t;
955
1028
  }
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);
1029
+ function kt(t, e) {
1030
+ if (t === void 0) {
1031
+ if (bt(e))
1032
+ return "";
1033
+ throw new F();
1034
+ }
1035
+ if (e === Boolean)
1036
+ return ee.set(t, N);
1037
+ if (e === Number)
1038
+ return ne.set(t, N);
1039
+ if (e === Date)
1040
+ return re.set(t, N);
1041
+ if (e === JSON)
1042
+ return oe.set(t, N);
1043
+ if (ft(e))
1044
+ return e.set(t, N);
967
1045
  try {
968
- return e.toString();
1046
+ return t.toString();
969
1047
  } catch {
970
- throw new ne();
1048
+ throw new F();
971
1049
  }
972
1050
  }
973
- function It(e) {
974
- const t = Pe(e.path.toString());
975
- return new RegExp(`^${t}$`, "i");
1051
+ function an(t) {
1052
+ const e = xt(t.path.toString());
1053
+ return new RegExp(`^${e}$`, "i");
976
1054
  }
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"));
1055
+ function sn(t) {
1056
+ const e = new URLSearchParams(t.query.toString());
1057
+ return Array.from(e.entries()).filter(([, n]) => !se(n)).map(([n, r]) => new RegExp(`${n}=${xt(r)}(&|$)`, "i"));
980
1058
  }
981
- function Pe(e) {
1059
+ function xt(t) {
982
1060
  return [
983
- Qt,
984
- Wt
985
- ].reduce((t, n) => n(t), e);
1061
+ cn,
1062
+ un
1063
+ ].reduce((e, n) => n(e), t);
986
1064
  }
987
- const ke = `\\${I}\\?([\\w]+)\\${G}`, tt = `\\${I}([\\w]+)\\${G}`;
988
- function Qt(e) {
989
- return e.replace(new RegExp(ke, "g"), ".*");
1065
+ const At = `\\${Q}\\?([\\w-_]+)\\${Y}`, ae = `\\${Q}([\\w-_]+)\\${Y}`;
1066
+ function cn(t) {
1067
+ return t.replace(new RegExp(At, "g"), ".*");
990
1068
  }
991
- function nt(e) {
992
- return new RegExp(ke, "g").test(e);
1069
+ function se(t) {
1070
+ return new RegExp(At, "g").test(t);
993
1071
  }
994
- function Wt(e) {
995
- return e.replace(new RegExp(tt, "g"), ".+");
1072
+ function un(t) {
1073
+ return t.replace(new RegExp(ae, "g"), ".+");
996
1074
  }
997
- function Gt(e) {
998
- const [t] = oe(e, new RegExp(ke, "g")), [n] = oe(e, new RegExp(tt, "g"));
999
- return t ?? n;
1075
+ function fn(t) {
1076
+ const [e] = at(t, new RegExp(At, "g")), [n] = at(t, new RegExp(ae, "g"));
1077
+ return e ?? n;
1000
1078
  }
1001
- function oe(e, t) {
1002
- return Array.from(e.matchAll(t)).flatMap(([, ...r]) => r.map((o) => re(o) ? o : ""));
1079
+ function at(t, e) {
1080
+ return Array.from(t.matchAll(e)).flatMap(([, ...r]) => r.map((o) => Pt(o) ? o : ""));
1003
1081
  }
1004
- function rt(e, t, n) {
1005
- const r = ot(t, n), [o] = oe(e, r);
1082
+ function ce(t, e, n) {
1083
+ const r = ie(e, n), [o] = at(t, r);
1006
1084
  return o;
1007
1085
  }
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);
1086
+ function ln(t, e) {
1087
+ if (!e)
1088
+ return t;
1089
+ const { name: n, param: r, value: o } = e, a = ie(t, n);
1090
+ return at(t, a).reduce((c, u) => u === void 0 ? c : c.replace(u, () => kt(o, r)), t);
1013
1091
  }
1014
- function ot(e, t) {
1092
+ function ie(t, e) {
1015
1093
  const n = [
1016
- Yt,
1017
- Xt,
1018
- Pe
1019
- ].reduce((r, o) => o(r, t), e);
1094
+ hn,
1095
+ pn,
1096
+ xt
1097
+ ].reduce((r, o) => o(r, e), t);
1020
1098
  return new RegExp(n, "g");
1021
1099
  }
1022
- function Yt(e, t) {
1023
- const n = new RegExp(`(\\${I}\\?${t})\\${G}`, "g");
1024
- return e.replace(n, "(.*)");
1100
+ function hn(t, e) {
1101
+ const n = new RegExp(`(\\${Q}\\?${e})\\${Y}`, "g");
1102
+ return t.replace(n, "(.*)");
1025
1103
  }
1026
- function Xt(e, t) {
1027
- const n = new RegExp(`(\\${I}${t})\\${G}`, "g");
1028
- return e.replace(n, "(.+)");
1104
+ function pn(t, e) {
1105
+ const n = new RegExp(`(\\${Q}${e})\\${Y}`, "g");
1106
+ return t.replace(n, "(.+)");
1029
1107
  }
1030
- function at(e, ...t) {
1031
- return t.reduce((n, r) => {
1108
+ function ue(t, ...e) {
1109
+ return e.reduce((n, r) => {
1032
1110
  if (!r)
1033
1111
  return n;
1034
1112
  const o = new URLSearchParams(r).toString();
1035
1113
  return Object.keys(o).length === 0 ? n : n.includes("?") ? `${n}&${o}` : `${n}?${o}`;
1036
- }, e);
1114
+ }, t);
1037
1115
  }
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);
1116
+ function dn(t, e = {}) {
1117
+ const { params: n = {}, query: r } = e, o = { ...t.path.params, ...t.query.params }, a = t.path.toString(), s = t.query.toString(), c = mn(a, o, n), u = Rn(s, o, n);
1118
+ return ue(c, u, r);
1041
1119
  }
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;
1120
+ function mn(t, e, n) {
1121
+ return t.length ? Object.entries(e).reduce((r, [o, a]) => ln(r, { name: o, param: a, value: n[o] }), t) : t;
1044
1122
  }
1045
- function tn(e, t, n) {
1046
- if (!e.length)
1123
+ function Rn(t, e, n) {
1124
+ if (!t.length)
1047
1125
  return {};
1048
- const r = new URLSearchParams(e);
1126
+ const r = new URLSearchParams(t);
1049
1127
  return Array.from(r.entries()).reduce((o, [a, s]) => {
1050
- const c = Gt(s);
1128
+ const c = fn(s);
1051
1129
  if (!c)
1052
1130
  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 };
1131
+ const f = kt(n[c], e[c]), R = n[c] === void 0 && f === "";
1132
+ return se(s) && R ? o : { ...o, [a]: f };
1055
1133
  }, {});
1056
1134
  }
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);
1135
+ function fe(t) {
1136
+ return (e, n, r) => {
1137
+ if (I(e))
1138
+ return ue(e, (n ?? {}).query);
1139
+ const o = n ?? {}, a = r ?? {}, s = t.find((u) => u.key === e);
1062
1140
  if (!s)
1063
- throw `Route not found: "${String(t)}"`;
1141
+ throw new Xe(String(e));
1064
1142
  if (s.matched.disabled)
1065
- throw `Route disabled: "${String(t)}"`;
1066
- return Zt(s, {
1143
+ throw new Ye(String(e));
1144
+ return dn(s, {
1067
1145
  params: o,
1068
1146
  query: a.query
1069
1147
  });
1070
1148
  };
1071
1149
  }
1072
- function z(e) {
1073
- return !e.startsWith("http") ? rn(e) : nn(e);
1150
+ function T(t) {
1151
+ return !t.startsWith("http") ? yn(t) : gn(t);
1074
1152
  }
1075
- function nn(e) {
1076
- const { protocol: t, host: n, pathname: r, search: o, searchParams: a, hash: s } = new URL(e, e);
1153
+ function gn(t) {
1154
+ const { protocol: e, host: n, pathname: r, search: o, searchParams: a, hash: s } = new URL(t, t);
1077
1155
  return {
1078
- protocol: t,
1156
+ protocol: e,
1079
1157
  host: n,
1080
1158
  pathname: r,
1081
1159
  search: o,
@@ -1083,104 +1161,113 @@ function nn(e) {
1083
1161
  hash: s
1084
1162
  };
1085
1163
  }
1086
- function rn(e) {
1087
- const { pathname: t, search: n, searchParams: r, hash: o } = new URL(e, "https://localhost");
1164
+ function yn(t) {
1165
+ const { pathname: e, search: n, searchParams: r, hash: o } = new URL(t, "https://localhost");
1088
1166
  return {
1089
- pathname: t,
1167
+ pathname: e,
1090
1168
  search: n,
1091
1169
  searchParams: r,
1092
1170
  hash: o
1093
1171
  };
1094
1172
  }
1095
- function ct(e) {
1096
- const t = new URLSearchParams(e);
1173
+ function le(t) {
1174
+ const e = new URLSearchParams(t);
1097
1175
  return {
1098
- get: (n) => t.get(n),
1099
- getAll: (n) => t.getAll(n)
1176
+ get: (n) => e.get(n),
1177
+ getAll: (n) => e.getAll(n)
1100
1178
  };
1101
1179
  }
1102
- const on = (e, t) => {
1180
+ const vn = (t, e) => {
1103
1181
  try {
1104
- it(e, t);
1182
+ he(t, e);
1105
1183
  } catch {
1106
1184
  return !1;
1107
1185
  }
1108
1186
  return !0;
1109
- }, it = (e, t) => {
1110
- const { pathname: n, search: r } = z(t);
1187
+ }, he = (t, e) => {
1188
+ const { pathname: n, search: r } = T(e);
1111
1189
  return {
1112
- ...an(e.path, n),
1113
- ...sn(e.query, r)
1190
+ ...wn(t.path, n),
1191
+ ...En(t.query, r)
1114
1192
  };
1115
1193
  };
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);
1194
+ function wn(t, e) {
1195
+ const n = {}, r = decodeURIComponent(e);
1196
+ for (const [o, a] of Object.entries(t.params)) {
1197
+ const s = ce(r, t.toString(), o), c = St(s, a);
1120
1198
  n[o] = c;
1121
1199
  }
1122
1200
  return n;
1123
1201
  }
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);
1202
+ function En(t, e) {
1203
+ const n = {}, r = new URLSearchParams(e);
1204
+ for (const [o, a] of Object.entries(t.params)) {
1205
+ const s = r.get(o) ?? void 0, c = St(s, a);
1128
1206
  n[o] = c;
1129
1207
  }
1130
1208
  return n;
1131
1209
  }
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));
1210
+ const bn = (t) => "name" in t.matched && !!t.matched.name, Pn = (t, e) => {
1211
+ const { host: n } = T(e), { host: r } = T(t.path.toString());
1212
+ return n === r;
1213
+ }, Sn = (t, e) => {
1214
+ const { pathname: n } = T(e);
1215
+ return an(t).test(n);
1216
+ }, kn = (t, e) => {
1217
+ const { search: n } = T(e);
1218
+ return sn(t).every((o) => o.test(n));
1138
1219
  };
1139
- function fn(e) {
1140
- const { searchParams: t, pathname: n } = z(e), r = -1, o = 1;
1220
+ function xn(t) {
1221
+ const { searchParams: e, pathname: n } = T(t), r = -1, o = 1;
1141
1222
  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;
1223
+ const c = Vt(a, e), u = jt(a, n), f = Vt(s, e), R = jt(s, n);
1224
+ return c + u > f + R ? r : c + u < f + R ? o : a.depth > s.depth ? r : a.depth < s.depth ? o : 0;
1144
1225
  };
1145
1226
  }
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);
1227
+ function jt(t, e) {
1228
+ const n = Object.entries(t.path.params).filter(([, o]) => bt(o)).map(([o]) => o), r = n.filter((o) => ce(e, t.path.toString(), o) === void 0);
1148
1229
  return n.length - r.length;
1149
1230
  }
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));
1231
+ function Vt(t, e) {
1232
+ const n = new URLSearchParams(t.query.toString()), r = Array.from(n.keys()), o = r.filter((a) => !e.has(a));
1152
1233
  return r.length - o.length;
1153
1234
  }
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)
1235
+ const An = [
1236
+ bn,
1237
+ Pn,
1238
+ Sn,
1239
+ kn,
1240
+ vn
1241
+ ];
1242
+ function pe(t, e) {
1243
+ const n = xn(e), r = t.filter((u) => An.every((f) => f(u, e))).sort(n);
1244
+ if (r.length === 0)
1157
1245
  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
1246
+ const [o] = r, { search: a } = T(e), s = le(a), c = he(o, e);
1247
+ return ct({
1248
+ matched: o.matched,
1249
+ matches: o.matches,
1250
+ key: o.key,
1251
+ query: s,
1252
+ params: c
1165
1253
  });
1166
1254
  }
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);
1255
+ function Ln(t) {
1256
+ return (e, n = {}) => {
1257
+ const o = fe(t)(e, n);
1258
+ return pe(t, o);
1172
1259
  };
1173
1260
  }
1174
- function ft() {
1261
+ function de() {
1175
1262
  return typeof window < "u" && typeof window.document < "u";
1176
1263
  }
1177
- function pn({ mode: e, listener: t }) {
1178
- const n = dn(e), r = (u, d) => {
1179
- if (d != null && d.replace)
1264
+ function Un({ mode: t, listener: e }) {
1265
+ const n = Bn(t), r = (u, f) => {
1266
+ if (f != null && f.replace)
1180
1267
  return n.replace(u);
1181
1268
  n.push(u);
1182
1269
  }, o = () => {
1183
- const u = T(n.location);
1270
+ const u = M(n.location);
1184
1271
  return n.replace(u);
1185
1272
  };
1186
1273
  let a;
@@ -1189,66 +1276,66 @@ function pn({ mode: e, listener: t }) {
1189
1276
  update: r,
1190
1277
  refresh: o,
1191
1278
  startListening: () => {
1192
- a == null || a(), a = n.listen(t);
1279
+ a == null || a(), a = n.listen(e);
1193
1280
  },
1194
1281
  stopListening: () => {
1195
1282
  a == null || a();
1196
1283
  }
1197
1284
  };
1198
1285
  }
1199
- function dn(e = "auto") {
1200
- switch (e) {
1286
+ function Bn(t = "auto") {
1287
+ switch (t) {
1201
1288
  case "auto":
1202
- return ft() ? Ue() : He();
1289
+ return de() ? Ht() : Nt();
1203
1290
  case "browser":
1204
- return Ue();
1291
+ return Ht();
1205
1292
  case "memory":
1206
- return He();
1293
+ return Nt();
1207
1294
  case "hash":
1208
- return Vt();
1295
+ return Ge();
1209
1296
  default:
1210
- const t = e;
1211
- throw new Error(`Switch is not exhaustive for mode: ${t}`);
1297
+ const e = t;
1298
+ throw new Error(`Switch is not exhaustive for mode: ${e}`);
1212
1299
  }
1213
1300
  }
1214
- function mn(e) {
1215
- return se(() => () => Ce("h1", e), {
1216
- name: e,
1301
+ function Hn(t) {
1302
+ return it(() => () => Tt("h1", t), {
1303
+ name: t,
1217
1304
  props: []
1218
1305
  });
1219
1306
  }
1220
- const Oe = Symbol();
1221
- function gn({
1222
- rejections: e
1307
+ const Ct = Symbol();
1308
+ function Nn({
1309
+ rejections: t
1223
1310
  }) {
1224
- const t = (s) => {
1311
+ const e = (s) => {
1225
1312
  const c = {
1226
- ...e
1313
+ ...t
1227
1314
  };
1228
- return he(c[s] ?? mn(s));
1315
+ return pt(c[s] ?? Hn(s));
1229
1316
  }, n = (s) => {
1230
- const c = he(t(s)), u = {
1317
+ const c = pt(e(s)), u = {
1231
1318
  name: s,
1232
1319
  path: "",
1233
1320
  component: c,
1234
1321
  meta: {}
1235
1322
  };
1236
- return ce({
1323
+ return ct({
1237
1324
  matched: u,
1238
1325
  matches: [u],
1239
1326
  key: s,
1240
- query: ct(""),
1327
+ query: le(""),
1241
1328
  params: {},
1242
- [Oe]: !0
1329
+ [Ct]: !0
1243
1330
  });
1244
- }, r = (s) => s[Oe] === !0, o = (s) => {
1331
+ }, r = (s) => s[Ct] === !0, o = (s) => {
1245
1332
  if (!s) {
1246
1333
  a.value = null;
1247
1334
  return;
1248
1335
  }
1249
- const c = t(s);
1336
+ const c = e(s);
1250
1337
  a.value = { type: s, component: c };
1251
- }, a = St(null);
1338
+ }, a = Ue(null);
1252
1339
  return {
1253
1340
  setRejection: o,
1254
1341
  rejection: a,
@@ -1256,128 +1343,128 @@ function gn({
1256
1343
  isRejectionRoute: r
1257
1344
  };
1258
1345
  }
1259
- class yn extends Error {
1346
+ class $n extends Error {
1260
1347
  constructor() {
1261
1348
  super("initialUrl must be set if window.location is unavailable");
1262
1349
  }
1263
1350
  }
1264
- function Rn(e) {
1265
- if (e)
1266
- return e;
1267
- if (ft())
1351
+ function jn(t) {
1352
+ if (t)
1353
+ return t;
1354
+ if (de())
1268
1355
  return window.location.toString();
1269
- throw new yn();
1356
+ throw new $n();
1270
1357
  }
1271
- function _n(e, t = {}) {
1272
- const n = st(e), r = pn({
1273
- mode: t.historyMode,
1358
+ function Xn(t, e = {}) {
1359
+ const n = fe(t), r = Un({
1360
+ mode: e.historyMode,
1274
1361
  listener: () => {
1275
- const g = T(location);
1276
- h(g);
1362
+ const g = M(location);
1363
+ p(g);
1277
1364
  }
1278
- }), { runBeforeRouteHooks: o, runAfterRouteHooks: a } = Ht(), {
1365
+ }), { runBeforeRouteHooks: o, runAfterRouteHooks: a } = De(), {
1279
1366
  hooks: s,
1280
1367
  onBeforeRouteEnter: c,
1281
1368
  onAfterRouteUpdate: u,
1282
- onBeforeRouteLeave: d,
1283
- onAfterRouteEnter: m,
1284
- onBeforeRouteUpdate: y,
1369
+ onBeforeRouteLeave: f,
1370
+ onAfterRouteEnter: R,
1371
+ onBeforeRouteUpdate: d,
1285
1372
  onAfterRouteLeave: A
1286
- } = Nt();
1287
- async function h(g, { replace: P } = {}) {
1373
+ } = Te();
1374
+ async function p(g, { replace: P } = {}) {
1288
1375
  r.stopListening();
1289
- const x = ut(e, g) ?? R("NotFound"), O = { ...b }, q = await o({ to: x, from: O, hooks: s });
1376
+ const x = pe(t, g) ?? y("NotFound"), C = { ...b }, q = await o({ to: x, from: C, hooks: s });
1290
1377
  switch (q.status) {
1291
1378
  case "ABORT":
1292
1379
  return;
1293
1380
  case "PUSH":
1294
- r.update(g, { replace: P }), await k(...q.to);
1381
+ r.update(g, { replace: P }), await S(...q.to);
1295
1382
  return;
1296
1383
  case "REJECT":
1297
- r.update(g, { replace: P }), B(q.type), i(x);
1384
+ r.update(g, { replace: P }), U(q.type), i(x);
1298
1385
  break;
1299
1386
  case "SUCCESS":
1300
- r.update(g, { replace: P }), B(null), i(x);
1387
+ r.update(g, { replace: P }), U(null), i(x);
1301
1388
  break;
1302
1389
  default:
1303
1390
  throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(q)}`);
1304
1391
  }
1305
- const _ = await a({ to: x, from: O, hooks: s });
1306
- switch (_.status) {
1392
+ const O = await a({ to: x, from: C, hooks: s });
1393
+ switch (O.status) {
1307
1394
  case "PUSH":
1308
- await k(..._.to);
1395
+ await S(...O.to);
1309
1396
  break;
1310
1397
  case "REJECT":
1311
- B(_.type);
1398
+ U(O.type);
1312
1399
  break;
1313
1400
  case "SUCCESS":
1314
1401
  break;
1315
1402
  default:
1316
- const Y = _;
1317
- throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(Y)}`);
1403
+ const X = O;
1404
+ throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(X)}`);
1318
1405
  }
1319
1406
  r.startListening();
1320
1407
  }
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 });
1408
+ const S = (g, P, x) => {
1409
+ if (I(g)) {
1410
+ const X = { ...P }, ye = n(g, X);
1411
+ return p(ye, { replace: X.replace });
1325
1412
  }
1326
- const O = { ...x }, _ = n(g, P ?? {}, O);
1327
- return h(_, { replace: O.replace });
1328
- }, N = (g, P, x) => {
1329
- if (Q(g)) {
1330
- const _ = { ...P, replace: !0 };
1331
- return k(g, _);
1413
+ const C = { ...x }, O = n(g, P ?? {}, C);
1414
+ return p(O, { replace: C.replace });
1415
+ }, j = (g, P, x) => {
1416
+ if (I(g)) {
1417
+ const O = { ...P, replace: !0 };
1418
+ return S(g, O);
1332
1419
  }
1333
- 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);
1420
+ const C = P ?? {}, q = { ...x, replace: !0 };
1421
+ return S(g, C, q);
1422
+ }, V = (g) => U(g), B = Ln(t), { setRejection: U, rejection: m, getRejectionRoute: y } = Nn(e), E = y("NotFound"), { currentRoute: b, routerRoute: h, updateRoute: i } = ze(E, S);
1336
1423
  r.startListening();
1337
- const f = Rn(t.initialUrl), w = h(f, { replace: !0 });
1338
- function v(g) {
1339
- g.component("RouterView", Fe), g.component("RouterLink", Ot), g.provide(De, S), g.provide(qe, p), g.provide(Ke, s);
1424
+ const l = jn(e.initialUrl), v = p(l, { replace: !0 });
1425
+ function w(g) {
1426
+ g.component("RouterView", Yt), g.component("RouterLink", Fe), g.provide(Wt, k), g.provide(Ft, m), g.provide(Kt, s);
1340
1427
  }
1341
- const S = {
1342
- route: l,
1428
+ const k = {
1429
+ route: h,
1343
1430
  resolve: n,
1344
- push: k,
1345
- replace: N,
1346
- reject: j,
1347
- find: H,
1431
+ push: S,
1432
+ replace: j,
1433
+ reject: V,
1434
+ find: B,
1348
1435
  refresh: r.refresh,
1349
1436
  forward: r.forward,
1350
1437
  back: r.back,
1351
1438
  go: r.go,
1352
- install: v,
1353
- initialized: w,
1439
+ install: w,
1440
+ initialized: v,
1354
1441
  onBeforeRouteEnter: c,
1355
1442
  onAfterRouteUpdate: u,
1356
- onBeforeRouteLeave: d,
1357
- onAfterRouteEnter: m,
1358
- onBeforeRouteUpdate: y,
1443
+ onBeforeRouteLeave: f,
1444
+ onAfterRouteEnter: R,
1445
+ onBeforeRouteUpdate: d,
1359
1446
  onAfterRouteLeave: A
1360
1447
  };
1361
- return S;
1448
+ return k;
1362
1449
  }
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);
1450
+ function me(t, e) {
1451
+ const n = new RegExp(`\\${Q}\\??([\\w-_]+)\\${Y}`, "g");
1452
+ return Array.from(t.matchAll(n)).reduce((o, [a, s]) => {
1453
+ const c = a.startsWith(`${Q}?`), u = rn(e, s);
1367
1454
  if (s in o)
1368
- throw new ie(s);
1369
- return o[s] = c ? Kt(u) : u, o;
1455
+ throw new ut(s);
1456
+ return o[s] = c ? en(u) : u, o;
1370
1457
  }, {});
1371
1458
  }
1372
- function ht(e, t) {
1459
+ function Re(t, e) {
1373
1460
  return {
1374
- path: e,
1375
- params: lt(e, t),
1376
- toString: () => e
1461
+ path: t,
1462
+ params: me(t, e),
1463
+ toString: () => t
1377
1464
  };
1378
1465
  }
1379
- function Se(e, t) {
1380
- const n = Object.keys(e), r = Object.keys(t), o = n.find((a) => r.includes(a));
1466
+ function Lt(t, e) {
1467
+ const n = Object.keys(t), r = Object.keys(e), o = n.find((a) => r.includes(a));
1381
1468
  return o ? {
1382
1469
  key: o,
1383
1470
  hasDuplicates: !0
@@ -1386,101 +1473,105 @@ function Se(e, t) {
1386
1473
  hasDuplicates: !1
1387
1474
  };
1388
1475
  }
1389
- function wn(e, t) {
1390
- const { hasDuplicates: n, key: r } = Se(e.params, t.params);
1476
+ function Vn(t, e) {
1477
+ const { hasDuplicates: n, key: r } = Lt(t.params, e.params);
1391
1478
  if (n)
1392
- throw new ie(r);
1393
- return ht(`${e.path}${t.path}`, { ...e.params, ...t.params });
1479
+ throw new ut(r);
1480
+ return Re(`${t.path}${e.path}`, { ...t.params, ...e.params });
1394
1481
  }
1395
- function pe(e, t) {
1482
+ function dt(t, e) {
1396
1483
  return {
1397
- query: e,
1398
- params: lt(e, t),
1399
- toString: () => e
1484
+ query: t,
1485
+ params: me(t, e),
1486
+ toString: () => t
1400
1487
  };
1401
1488
  }
1402
- function vn(e, t) {
1403
- const { hasDuplicates: n, key: r } = Se(e.params, t.params);
1489
+ function Cn(t, e) {
1490
+ const { hasDuplicates: n, key: r } = Lt(t.params, e.params);
1404
1491
  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);
1492
+ throw new ut(r);
1493
+ const o = [t.query, e.query].filter(Pt).join("&");
1494
+ return dt(o, { ...t.params, ...e.params });
1411
1495
  }
1412
- function En(e) {
1413
- return pt(e) && typeof e.path == "string";
1496
+ function ge(t) {
1497
+ return typeof t == "object" && t !== null && !Array.isArray(t);
1414
1498
  }
1415
- function bn(e) {
1416
- return En(e) ? e : ht(e, {});
1499
+ function On(t) {
1500
+ return ge(t) && typeof t.path == "string";
1417
1501
  }
1418
- function Pn(e) {
1419
- return pt(e) && typeof e.query == "string";
1502
+ function _n(t) {
1503
+ return On(t) ? t : Re(t, {});
1420
1504
  }
1421
- function kn(e) {
1422
- return e === void 0 ? pe("", {}) : Pn(e) ? e : pe(e, {});
1505
+ function qn(t) {
1506
+ return ge(t) && typeof t.query == "string";
1423
1507
  }
1424
- function Sn(e) {
1425
- return "children" in e;
1508
+ function Dn(t) {
1509
+ return t === void 0 ? dt("", {}) : qn(t) ? t : dt(t, {});
1426
1510
  }
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) => ({
1511
+ function Zn(t) {
1512
+ const e = t.reduce((n, r) => {
1513
+ const o = Mn(r);
1514
+ return zt(r) && n.push(...r.children.map((a) => ({
1434
1515
  ...a,
1435
- key: Te(o.key, a.key),
1436
- path: wn(o.path, a.path),
1437
- query: vn(o.query, a.query),
1516
+ key: It(o.key, a.key),
1517
+ path: Vn(o.path, a.path),
1518
+ query: Cn(o.query, a.query),
1438
1519
  matches: [o.matched, ...a.matches],
1439
1520
  depth: a.depth + 1
1440
1521
  }))), n.push(o), n;
1441
1522
  }, []);
1442
- return t.forEach(({ path: n, query: r }) => {
1443
- const { hasDuplicates: o, key: a } = Se(n.params, r.params);
1523
+ return e.forEach(({ path: n, query: r }) => {
1524
+ const { hasDuplicates: o, key: a } = Lt(n.params, r.params);
1444
1525
  if (o)
1445
- throw new ie(a);
1446
- }), t;
1526
+ throw new ut(a);
1527
+ }), e;
1447
1528
  }
1448
- function xn(e) {
1449
- const t = bn(e.path), n = kn(e.query), r = he({ meta: {}, ...e });
1529
+ function Mn(t) {
1530
+ const e = Tn(t), n = _n(t.path), r = Dn(t.query), o = pt({ meta: {}, ...e });
1450
1531
  return {
1451
- matched: r,
1452
- matches: [r],
1453
- key: e.name,
1454
- path: t,
1455
- query: n,
1532
+ matched: o,
1533
+ matches: [o],
1534
+ key: t.name,
1535
+ path: n,
1536
+ query: r,
1456
1537
  depth: 1,
1457
- disabled: e.disabled ?? !1
1538
+ disabled: t.disabled ?? !1
1458
1539
  };
1459
1540
  }
1541
+ function Tn(t) {
1542
+ return Ie(t) ? { ...t, component: Yt } : t;
1543
+ }
1460
1544
  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
1545
+ ut as DuplicateParamsError,
1546
+ Fe as RouterLink,
1547
+ mt as RouterNotInstalledError,
1548
+ Yt as RouterView,
1549
+ Be as UseRouteInvalidError,
1550
+ zn as component,
1551
+ Xn as createRouter,
1552
+ Zn as createRoutes,
1553
+ ft as isParamGetSet,
1554
+ tn as isParamGetter,
1555
+ nn as isParamWithDefault,
1556
+ zt as isParentRoute,
1557
+ Ie as isParentRouteWithoutComponent,
1558
+ Ve as isRoute,
1559
+ Je as isRouteWithComponent,
1560
+ Ke as isRouteWithComponents,
1561
+ Kn as onAfterRouteEnter,
1562
+ Qn as onAfterRouteLeave,
1563
+ Gn as onAfterRouteUpdate,
1564
+ In as onBeforeRouteLeave,
1565
+ Jn as onBeforeRouteUpdate,
1566
+ Y as paramEnd,
1567
+ Q as paramStart,
1568
+ Re as path,
1569
+ dt as query,
1570
+ Wt as routerInjectionKey,
1571
+ Ft as routerRejectionKey,
1572
+ He as useLink,
1573
+ Ne as useRejection,
1574
+ Oe as useRoute,
1575
+ Rt as useRouter,
1576
+ Yn as withDefault
1486
1577
  };