@kitbag/router 0.6.0 → 0.7.1

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