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