@kitbag/router 0.4.0 → 0.4.2

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