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