@vielzeug/wayfinder 2.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +2 -2
  2. package/dist/_dev.cjs.map +1 -1
  3. package/dist/_dev.js.map +1 -1
  4. package/dist/compile.cjs +1 -1
  5. package/dist/compile.cjs.map +1 -1
  6. package/dist/compile.d.ts.map +1 -1
  7. package/dist/compile.js +1 -1
  8. package/dist/compile.js.map +1 -1
  9. package/dist/context.cjs +1 -1
  10. package/dist/context.cjs.map +1 -1
  11. package/dist/context.d.ts +4 -4
  12. package/dist/context.d.ts.map +1 -1
  13. package/dist/context.js +2 -2
  14. package/dist/context.js.map +1 -1
  15. package/dist/errors.cjs +1 -1
  16. package/dist/errors.cjs.map +1 -1
  17. package/dist/errors.d.ts +0 -1
  18. package/dist/errors.d.ts.map +1 -1
  19. package/dist/errors.js +1 -4
  20. package/dist/errors.js.map +1 -1
  21. package/dist/guards.cjs.map +1 -1
  22. package/dist/guards.d.ts +1 -1
  23. package/dist/guards.js.map +1 -1
  24. package/dist/history.cjs +1 -1
  25. package/dist/history.cjs.map +1 -1
  26. package/dist/history.d.ts.map +1 -1
  27. package/dist/history.js +3 -1
  28. package/dist/history.js.map +1 -1
  29. package/dist/index.cjs +1 -1
  30. package/dist/index.d.ts +3 -3
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +3 -3
  33. package/dist/path.cjs +1 -1
  34. package/dist/path.cjs.map +1 -1
  35. package/dist/path.d.ts.map +1 -1
  36. package/dist/path.js +6 -2
  37. package/dist/path.js.map +1 -1
  38. package/dist/router.cjs +1 -1
  39. package/dist/router.cjs.map +1 -1
  40. package/dist/router.d.ts +3 -4
  41. package/dist/router.d.ts.map +1 -1
  42. package/dist/router.js +100 -96
  43. package/dist/router.js.map +1 -1
  44. package/dist/types.d.ts +13 -14
  45. package/dist/types.d.ts.map +1 -1
  46. package/dist/wayfinder.cjs +1 -1
  47. package/dist/wayfinder.cjs.map +1 -1
  48. package/dist/wayfinder.iife.js +1 -1
  49. package/dist/wayfinder.iife.js.map +1 -1
  50. package/dist/wayfinder.js +1 -1
  51. package/dist/wayfinder.js.map +1 -1
  52. package/package.json +22 -28
  53. package/dist/devtools.cjs +0 -2
  54. package/dist/devtools.cjs.map +0 -1
  55. package/dist/devtools.d.ts +0 -47
  56. package/dist/devtools.d.ts.map +0 -1
  57. package/dist/devtools.js +0 -13
  58. package/dist/devtools.js.map +0 -1
package/dist/router.js CHANGED
@@ -1,22 +1,22 @@
1
- import { createNavigationCoordinator as e } from "./_navigation.js";
2
- import { WayfinderDisposedError as t, WayfinderRedirectLoopError as n, WayfinderRouteError as r } from "./errors.js";
3
- import { buildPreloadKey as i, buildUrl as a, joinPaths as o, matchRouteFor as s, matchesPrefix as c, normalizePath as l, parseQuery as u, readLocation as d, stripBase as f } from "./path.js";
4
- import { compileRoutes as p } from "./compile.js";
5
- import { buildMatchBranch as m, createRouteContext as h, createRouteState as g, executeMiddlewarePipeline as _, reportError as v } from "./context.js";
6
- import { runLeaveBlockers as y } from "./guards.js";
7
- import { createBrowserHistory as b } from "./history.js";
1
+ import { WayfinderDisposedError as e, WayfinderRedirectLoopError as t, WayfinderRouteError as n } from "./errors.js";
2
+ import { createBrowserHistory as r } from "./history.js";
3
+ import { createNavigationCoordinator as i } from "./_navigation.js";
4
+ import { buildPreloadKey as a, buildUrl as o, joinPaths as s, matchRouteFor as c, matchesPrefix as l, normalizePath as u, parseQuery as d, readLocation as f, stripBase as p } from "./path.js";
5
+ import { compileRoutes as m } from "./compile.js";
6
+ import { buildMatchBranch as h, createRouteContext as g, createRouteState as _, executeMiddlewarePipeline as v, reportError as y } from "./context.js";
7
+ import { runLeaveBlockers as b } from "./guards.js";
8
8
  import { createHydrationManager as x } from "./hydration.js";
9
9
  import { createPreloadManager as S } from "./preload.js";
10
10
  //#region src/router.ts
11
11
  function C(e, t) {
12
- let n = t.get(e);
13
- if (n) return n;
12
+ let r = t.get(e);
13
+ if (r) return r;
14
14
  let i = [...t.keys()].join(", ");
15
- throw new r(i ? `Unknown route name: ${e}. Available routes: ${i}` : `Unknown route name: ${e}`);
15
+ throw new n(i ? `Unknown route name: ${e}. Available routes: ${i}` : `Unknown route name: ${e}`);
16
16
  }
17
17
  function w(e, t, n = "/") {
18
18
  if ("path" in e) return e.path;
19
- let r = C(e.name, t), i = a(n, r.path, e.params, e.query);
19
+ let r = C(e.name, t), i = o(n, r.path, e.params, e.query);
20
20
  return e.hash ? `${i}#${e.hash}` : i;
21
21
  }
22
22
  var T = Symbol("wayfinder.errorContext");
@@ -40,7 +40,7 @@ var k = class {
40
40
  #s;
41
41
  #c;
42
42
  #l = /* @__PURE__ */ new Set();
43
- #u = e();
43
+ #u = i();
44
44
  #d;
45
45
  #f = !1;
46
46
  #p = new AbortController();
@@ -52,8 +52,8 @@ var k = class {
52
52
  #y;
53
53
  ready;
54
54
  constructor(e) {
55
- let t = p(e);
56
- if (this.#e = l(e.base ?? "/"), this.#t = e.middleware ?? [], this.#n = e.coerceSearch, this.#r = e.history ?? b(), this.#s = e.viewTransition ?? !1, this.#o = e.scroll, this.#c = e.onError, this.#i = t.records, this.#a = t.routesByName, this.#_ = x(), this.#v = S(), this.#d = g({
55
+ let t = m(e);
56
+ if (this.#e = u(e.base ?? "/"), this.#t = e.middleware ?? [], this.#n = e.coerceSearch, this.#r = e.history ?? r(), this.#s = e.viewTransition ?? !1, this.#o = e.scroll, this.#c = e.onError, this.#i = t.records, this.#a = t.routesByName, this.#_ = x(), this.#v = S(), this.#d = _({
57
57
  location: {
58
58
  hash: "",
59
59
  historyState: null,
@@ -82,14 +82,14 @@ var k = class {
82
82
  };
83
83
  } else this.#g = null;
84
84
  this.#y = this.#x();
85
- let { hash: n, pathname: r, search: i } = this.#r.location;
86
- this.#m = `${r}${i}${n}`;
87
- let a = this.#u.begin();
88
- this.ready = this.#F(a, d(this.#e, this.#r), void 0, 0, !1, (e, t) => {
89
- if (!a.isCurrent()) return;
85
+ let { hash: n, pathname: i, search: a } = this.#r.location;
86
+ this.#m = `${i}${a}${n}`;
87
+ let o = this.#u.begin();
88
+ this.ready = this.#F(o, f(this.#e, this.#r), (e, t) => {
89
+ if (!o.isCurrent()) return;
90
90
  let n = this.#z(e);
91
91
  t && this.#r.replace(n, e.historyState), this.#m = n;
92
- }).then(() => void 0), this.#w(this.ready, { source: "initial-navigation" }), this.beforeLeave = this.beforeLeave.bind(this), this.dispose = this.dispose.bind(this), this.getSnapshot = this.getSnapshot.bind(this), this.isActive = this.isActive.bind(this), this.loadPath = this.loadPath.bind(this), this.matchPath = this.matchPath.bind(this), this.navigate = this.navigate.bind(this), this.preload = this.preload.bind(this), this.subscribe = this.subscribe.bind(this), this.url = this.url.bind(this), this.waitFor = this.waitFor.bind(this);
92
+ }, void 0, 0, !1).then(() => void 0), this.#w(this.ready, { source: "initial-navigation" }), this.beforeLeave = this.beforeLeave.bind(this), this.dispose = this.dispose.bind(this), this.getSnapshot = this.getSnapshot.bind(this), this.isActive = this.isActive.bind(this), this.load = this.load.bind(this), this.match = this.match.bind(this), this.navigate = this.navigate.bind(this), this.preload = this.preload.bind(this), this.subscribe = this.subscribe.bind(this), this.url = this.url.bind(this), this.waitFor = this.waitFor.bind(this);
93
93
  }
94
94
  getSnapshot() {
95
95
  return this.#d;
@@ -105,34 +105,34 @@ var k = class {
105
105
  }
106
106
  url(e, t, n) {
107
107
  let r = C(e, this.#a);
108
- return a(this.#e, r.path, t, n);
108
+ return o(this.#e, r.path, t, n);
109
109
  }
110
110
  isActive(e, t = {}) {
111
111
  let n = C(e, this.#a), r = this.#d.location.pathname;
112
- return t.exact ?? !1 ? s(r, [n]).record != null : c(r, n);
112
+ return t.exact ?? !1 ? c(r, [n]).record != null : l(r, n);
113
113
  }
114
- matchPath(e) {
115
- let t = f(l(e), this.#e), { params: n, record: r } = s(t, this.#i);
114
+ match(e) {
115
+ let t = p(u(e), this.#e), { params: n, record: r } = c(t, this.#i);
116
116
  if (!r || r.redirect) return null;
117
- let i = this.#_.effectiveDefs(r), a = m(i, n, t, i.map(() => void 0));
117
+ let i = this.#_.effectiveDefs(r), a = h(i, n, t, i.map(() => void 0));
118
118
  return a.length ? a : null;
119
119
  }
120
- async loadPath(e, t) {
120
+ async load(e, t) {
121
121
  let n = await this.#k(e);
122
122
  if (n.type !== "matched") return null;
123
123
  let { location: r, params: i, record: a, resolvedQuery: o } = n, s = this.#_.effectiveDefs(a), c = s.some((e) => e.dataFn != null), l = s.map(() => void 0), u, d = "idle";
124
124
  if (c) {
125
- let e = t?.signal ?? new AbortController().signal, n = m(s, i, r.pathname, l), a = h(r, o, i, n, () => Promise.resolve());
125
+ let e = t?.signal ?? new AbortController().signal, n = h(s, i, r.pathname, l), a = g(r, o, i, n, () => Promise.resolve());
126
126
  try {
127
127
  l = await this.#D(s, a, e);
128
128
  } catch (e) {
129
129
  u = e, d = "error";
130
130
  }
131
131
  }
132
- return g({
132
+ return _({
133
133
  error: u,
134
134
  location: r,
135
- matches: m(s, i, r.pathname, l),
135
+ matches: h(s, i, r.pathname, l),
136
136
  status: d
137
137
  });
138
138
  }
@@ -157,12 +157,12 @@ var k = class {
157
157
  }
158
158
  async preload(e, t, n) {
159
159
  this.#b();
160
- let r = C(e, this.#a), a = i(this.#e, r.path, t, n), o = this.#v.getInflight(a);
160
+ let r = C(e, this.#a), i = a(this.#e, r.path, t, n), o = this.#v.getInflight(i);
161
161
  if (o) return o;
162
- let s = this.#A(a, this.#p.signal, n).finally(() => {
163
- this.#v.untrack(a);
162
+ let s = this.#A(i, this.#p.signal, n).finally(() => {
163
+ this.#v.untrack(i);
164
164
  });
165
- this.#v.track(a, s);
165
+ this.#v.track(i, s);
166
166
  try {
167
167
  return await s;
168
168
  } catch (e) {
@@ -186,13 +186,13 @@ var k = class {
186
186
  return this.#f;
187
187
  }
188
188
  dispose() {
189
- this.#f || (this.#f = !0, this.#l.clear(), this.#h.clear(), this.#u.invalidate(new t()), this.#y(), this.#p.abort(new t()));
189
+ this.#f || (this.#f = !0, this.#l.clear(), this.#h.clear(), this.#u.invalidate(new e()), this.#y(), this.#p.abort(new e()));
190
190
  }
191
191
  [Symbol.dispose]() {
192
192
  this.dispose();
193
193
  }
194
194
  #b() {
195
- if (this.#f) throw new t();
195
+ if (this.#f) throw new e();
196
196
  }
197
197
  #x() {
198
198
  return this.#r.onPopstate(() => {
@@ -201,21 +201,21 @@ var k = class {
201
201
  });
202
202
  }
203
203
  async #S(e, t) {
204
- let n = this.#u.begin(), r = this.#d.matches.map((e) => e.name), i = this.#B(e), a = await y(this.#l, r, i);
204
+ let n = this.#u.begin(), r = this.#d.matches.map((e) => e.name), i = this.#B(e), a = await b(this.#l, r, i);
205
205
  if (!n.isCurrent()) return;
206
206
  if (!a) {
207
207
  this.#r.replace(t, this.#d.location.historyState);
208
208
  return;
209
209
  }
210
- let o = await this.#F(n, d(this.#e, this.#r), void 0, 0, !1, (e, t) => {
210
+ let o = await this.#F(n, f(this.#e, this.#r), (e, t) => {
211
211
  if (!n.isCurrent()) return;
212
212
  let r = this.#z(e);
213
213
  t && this.#r.replace(r, e.historyState), this.#m = r;
214
- });
214
+ }, void 0, 0, !1);
215
215
  n.isCurrent() && !o && this.#r.replace(t, this.#d.location.historyState);
216
216
  }
217
217
  #C(e, t) {
218
- v(e, t, this.#c);
218
+ y(e, t, this.#c);
219
219
  }
220
220
  #w(e, t) {
221
221
  e.catch((e) => {
@@ -223,7 +223,9 @@ var k = class {
223
223
  });
224
224
  }
225
225
  #T() {
226
- this.#h.forEach((e) => e(this.#d));
226
+ this.#h.forEach((e) => {
227
+ e(this.#d);
228
+ });
227
229
  }
228
230
  async #E(e, t) {
229
231
  let n;
@@ -281,9 +283,9 @@ var k = class {
281
283
  if (!r()) return;
282
284
  l[n] = t;
283
285
  let o = e.map((e, t) => s.includes(t) ? "streaming" : "idle");
284
- this.#d = g({
286
+ this.#d = _({
285
287
  location: i,
286
- matches: m(e, a, i.pathname, l, o),
288
+ matches: h(e, a, i.pathname, l, o),
287
289
  status: "streaming"
288
290
  }), this.#T();
289
291
  };
@@ -302,29 +304,29 @@ var k = class {
302
304
  })), l;
303
305
  }
304
306
  async #k(e) {
305
- let t = e;
307
+ let n = e;
306
308
  for (let e = 0; e < 5; e += 1) {
307
- let e = new URL(t, "http://localhost"), n = {
309
+ let e = new URL(n, "http://localhost"), t = {
308
310
  hash: e.hash.replace(/^#/, ""),
309
311
  historyState: null,
310
- pathname: f(e.pathname, this.#e),
311
- query: u(e.search)
312
- }, r = await this.#j(n);
312
+ pathname: p(e.pathname, this.#e),
313
+ query: d(e.search)
314
+ }, r = await this.#j(t);
313
315
  if (r.type !== "redirect") return r;
314
- t = this.#L(r.redirectTo);
316
+ n = this.#L(r.redirectTo);
315
317
  }
316
- throw new n();
318
+ throw new t();
317
319
  }
318
320
  async #A(e, t, n) {
319
321
  let r = await this.#k(e);
320
322
  if (r.type !== "matched") return;
321
- let { location: a, params: o, record: s, resolvedQuery: c } = r, l = this.#_.effectiveDefs(s);
323
+ let { location: i, params: o, record: s, resolvedQuery: c } = r, l = this.#_.effectiveDefs(s);
322
324
  if (!l.some((e) => e.dataFn != null)) return;
323
- let u = m(l, o, a.pathname, l.map(() => void 0)), d = h(a, c, o, u, () => Promise.resolve()), f = await this.#D(l, d, t);
324
- this.#v.set(i(this.#e, s.path, o, n ?? a.query), f);
325
+ let u = h(l, o, i.pathname, l.map(() => void 0)), d = g(i, c, o, u, () => Promise.resolve()), f = await this.#D(l, d, t);
326
+ this.#v.set(a(this.#e, s.path, o, n ?? i.query), f);
325
327
  }
326
328
  async #j(e) {
327
- let { params: t, record: n } = s(e.pathname, this.#i);
329
+ let { params: t, record: n } = c(e.pathname, this.#i);
328
330
  if (!n) return {
329
331
  location: e,
330
332
  params: t,
@@ -345,7 +347,7 @@ var k = class {
345
347
  await this.#_.hydrate(n);
346
348
  let a = this.#_.effectiveDefs(n);
347
349
  return {
348
- branch: m(a, t, e.pathname, a.map(() => void 0)),
350
+ branch: h(a, t, e.pathname, a.map(() => void 0)),
349
351
  location: e,
350
352
  params: t,
351
353
  record: n,
@@ -366,27 +368,27 @@ var k = class {
366
368
  throw await e.return(void 0).catch(() => void 0), t;
367
369
  }
368
370
  }
369
- async #N(e, t, n, r, a, o, s) {
370
- if (!s()) return;
371
- let c = this.#_.effectiveDefs(e), l = c.some((e) => e.dataFn != null), u = c.map(() => void 0);
372
- if (l) {
373
- let a = i(this.#e, e.path, r, n.query), l = this.#v.consume(a);
374
- if (l) u = l;
371
+ async #N(e, t, n, r, i, o) {
372
+ if (!o()) return;
373
+ let s = this.#_.effectiveDefs(e), c = s.some((e) => e.dataFn != null), l = s.map(() => void 0);
374
+ if (c) {
375
+ let c = a(this.#e, e.path, r, n.query), u = this.#v.consume(c);
376
+ if (u) l = u;
375
377
  else {
376
- let i = c.map((e) => e.dataFn ? "loading" : "idle");
377
- this.#d = g({
378
+ let a = s.map((e) => e.dataFn ? "loading" : "idle");
379
+ this.#d = _({
378
380
  location: n,
379
- matches: m(c, r, n.pathname, u, i),
381
+ matches: h(s, r, n.pathname, l, a),
380
382
  status: "loading"
381
383
  }), this.#T();
382
384
  try {
383
- u = await this.#O(c, t, o, s, n, r);
385
+ l = await this.#O(s, t, i, o, n, r);
384
386
  } catch (t) {
385
- if (!s()) return;
386
- throw this.#d = g({
387
+ if (!o()) return;
388
+ throw this.#d = _({
387
389
  error: t,
388
390
  location: n,
389
- matches: m(c, r, n.pathname, u),
391
+ matches: h(s, r, n.pathname, l),
390
392
  status: "error"
391
393
  }), E(t, {
392
394
  routeName: e.leaf.name,
@@ -395,9 +397,9 @@ var k = class {
395
397
  }
396
398
  }
397
399
  }
398
- s() && (this.#d = g({
400
+ o() && (this.#d = _({
399
401
  location: n,
400
- matches: m(c, r, n.pathname, u),
402
+ matches: h(s, r, n.pathname, l),
401
403
  status: "idle"
402
404
  }));
403
405
  }
@@ -411,50 +413,50 @@ var k = class {
411
413
  }
412
414
  await e();
413
415
  }
414
- async #F(e, t, r, i = 0, a = !1, o = () => void 0) {
415
- let s = this.#d, c = () => e.isCurrent() && !this.#f, l = await this.#j(t);
416
+ async #F(e, n, r, i, a = 0, o = !1) {
417
+ let s = this.#d, c = () => e.isCurrent() && !this.#f, l = await this.#j(n);
416
418
  if (!c()) return !1;
417
419
  if (l.type === "redirect") {
418
- if (i >= 5) throw new n();
419
- return this.#F(e, this.#R(l.redirectTo, t.historyState), r, i + 1, !0, o);
420
+ if (a >= 5) throw new t();
421
+ return this.#F(e, this.#R(l.redirectTo, n.historyState), r, i, a + 1, !0);
420
422
  }
421
423
  if (l.type === "unmatched") {
422
424
  if (this.#g) {
423
- let n = [this.#g.leaf], i = m(n, {}, t.pathname, [void 0]), l = !1, u = !1, d = t.query;
425
+ let t = [this.#g.leaf], a = h(t, {}, n.pathname, [void 0]), l = !1, u = !1, d = n.query;
424
426
  if (this.#n) try {
425
- d = this.#n(t.query);
427
+ d = this.#n(n.query);
426
428
  } catch (e) {
427
429
  this.#C(e, { source: "coerce-search" });
428
430
  }
429
431
  let f = async () => {
430
432
  if (!c()) return;
431
- let n = h(t, d, {}, i, (e, t) => this.navigate(e, t));
432
- u = await _(n, [...this.#t, ...this.#g.ownMiddleware], async () => {
433
- c() && (l = !0, o(t, a), c() && await this.#N(this.#g, n, t, {}, i, e.signal, c));
433
+ let t = g(n, d, {}, a, (e, t) => this.navigate(e, t));
434
+ u = await v(t, [...this.#t, ...this.#g.ownMiddleware], async () => {
435
+ c() && (l = !0, r(n, o), c() && await this.#N(this.#g, t, n, {}, e.signal, c));
434
436
  });
435
437
  };
436
438
  try {
437
- await this.#P(f, r);
439
+ await this.#P(f, i);
438
440
  } finally {
439
441
  c() && l && (this.#T(), this.#I(this.#d, s));
440
442
  }
441
443
  return u && l;
442
444
  }
443
- return !c() || (o(l.location, a), !c()) ? !1 : (this.#d = g({
445
+ return !c() || (r(l.location, o), !c()) ? !1 : (this.#d = _({
444
446
  location: l.location,
445
447
  matches: [],
446
448
  status: "idle"
447
449
  }), this.#T(), this.#I(this.#d, s), !0);
448
450
  }
449
- let { branch: u, location: d, params: f, record: p, resolvedQuery: v } = l, y = !1, b = !1, x = async () => {
451
+ let { branch: u, location: d, params: f, record: p, resolvedQuery: m } = l, y = !1, b = !1, x = async () => {
450
452
  if (!c()) return;
451
- let t = h(d, v, f, u, (e, t) => this.navigate(e, t));
452
- b = await _(t, [...this.#t, ...p.ownMiddleware], async () => {
453
- c() && (y = !0, o(d, a), c() && await this.#N(p, t, d, f, u, e.signal, c));
453
+ let t = g(d, m, f, u, (e, t) => this.navigate(e, t));
454
+ b = await v(t, [...this.#t, ...p.ownMiddleware], async () => {
455
+ c() && (y = !0, r(d, o), c() && await this.#N(p, t, d, f, e.signal, c));
454
456
  });
455
457
  };
456
458
  try {
457
- await this.#P(x, r);
459
+ await this.#P(x, i);
458
460
  } finally {
459
461
  c() && y && (this.#T(), this.#I(this.#d, s));
460
462
  }
@@ -472,43 +474,45 @@ var k = class {
472
474
  }
473
475
  }
474
476
  #L(e) {
475
- let t = new URL(e, "http://localhost"), n = f(t.pathname, this.#e);
476
- return `${o(this.#e, n)}${t.search}${t.hash}`;
477
+ let t = new URL(e, "http://localhost"), n = p(t.pathname, this.#e);
478
+ return `${s(this.#e, n)}${t.search}${t.hash}`;
477
479
  }
478
480
  #R(e, t) {
479
481
  let n = new URL(this.#L(e), "http://localhost");
480
482
  return {
481
483
  hash: n.hash.replace(/^#/, ""),
482
484
  historyState: t,
483
- pathname: f(n.pathname, this.#e),
484
- query: u(n.search)
485
+ pathname: p(n.pathname, this.#e),
486
+ query: d(n.search)
485
487
  };
486
488
  }
487
489
  #z(e) {
488
490
  let t = new URLSearchParams();
489
- for (let [n, r] of Object.entries(e.query)) Array.isArray(r) ? r.forEach((e) => t.append(n, e)) : t.set(n, r);
491
+ for (let [n, r] of Object.entries(e.query)) Array.isArray(r) ? r.forEach((e) => {
492
+ t.append(n, e);
493
+ }) : t.set(n, r);
490
494
  let n = t.toString(), r = e.hash ? `#${e.hash}` : "";
491
- return `${o(this.#e, e.pathname)}${n ? `?${n}` : ""}${r}`;
495
+ return `${s(this.#e, e.pathname)}${n ? `?${n}` : ""}${r}`;
492
496
  }
493
497
  #B(e) {
494
- let t = new URL(e, "http://localhost"), n = f(t.pathname, this.#e), { params: r, record: i } = s(n, this.#i);
498
+ let t = new URL(e, "http://localhost"), n = p(t.pathname, this.#e), { params: r, record: i } = c(n, this.#i);
495
499
  return {
496
500
  name: i?.leaf.name,
497
501
  params: r,
498
502
  pathname: n,
499
- query: u(t.search)
503
+ query: d(t.search)
500
504
  };
501
505
  }
502
506
  async #V(e, t = {}) {
503
507
  this.#b();
504
508
  let n = this.#L(e);
505
509
  if (!t.force && n === this.#m) return;
506
- let r = this.#u.begin(), i = this.#d.matches.map((e) => e.name), a = await y(this.#l, i, this.#B(n));
507
- !r.isCurrent() || !a || await this.#F(r, this.#R(n, t.state), t.viewTransition, 0, t.replace ?? !1, (e, t) => {
510
+ let r = this.#u.begin(), i = this.#d.matches.map((e) => e.name), a = await b(this.#l, i, this.#B(n));
511
+ !r.isCurrent() || !a || await this.#F(r, this.#R(n, t.state), (e, t) => {
508
512
  if (!r.isCurrent()) return;
509
513
  let n = this.#z(e);
510
514
  t ? this.#r.replace(n, e.historyState) : this.#r.push(n, e.historyState), this.#m = n;
511
- });
515
+ }, t.viewTransition, 0, t.replace ?? !1);
512
516
  }
513
517
  };
514
518
  function A(e) {