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