@kitbag/router 0.11.1 → 0.11.3

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