@kitbag/router 0.20.5 → 0.20.7

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 (203) hide show
  1. package/dist/components/echo.d.ts +6 -0
  2. package/dist/components/helloWorld.d.ts +2 -0
  3. package/dist/components/rejection.d.ts +2 -0
  4. package/dist/components/routerLink.browser.spec.d.ts +1 -0
  5. package/dist/components/routerLink.d.ts +36 -0
  6. package/dist/components/routerView.browser.spec.d.ts +1 -0
  7. package/dist/components/routerView.d.ts +20 -0
  8. package/dist/components/routerView.spec.d.ts +1 -0
  9. package/dist/compositions/useComponentsStore.d.ts +5 -0
  10. package/dist/compositions/useEventListener.d.ts +2 -0
  11. package/dist/compositions/useLink.d.ts +16 -0
  12. package/dist/compositions/usePrefetching.d.ts +14 -0
  13. package/dist/compositions/usePropStore.d.ts +7 -0
  14. package/dist/compositions/useQueryValue.browser.spec.d.ts +1 -0
  15. package/dist/compositions/useQueryValue.d.ts +15 -0
  16. package/dist/compositions/useRejection.d.ts +7 -0
  17. package/dist/compositions/useRoute.browser.spec.d.ts +1 -0
  18. package/dist/compositions/useRoute.d.ts +16 -0
  19. package/dist/compositions/useRouter.d.ts +3 -0
  20. package/dist/compositions/useRouterDepth.d.ts +8 -0
  21. package/dist/compositions/useRouterHooks.d.ts +4 -0
  22. package/dist/compositions/useVisibilityObserver.d.ts +8 -0
  23. package/dist/errors/callbackContextAbortError.d.ts +5 -0
  24. package/dist/errors/callbackContextPushError.d.ts +5 -0
  25. package/dist/errors/callbackContextRejectionError.d.ts +6 -0
  26. package/dist/errors/duplicateNamesError.d.ts +11 -0
  27. package/dist/errors/duplicateParamsError.d.ts +13 -0
  28. package/dist/errors/initialRouteMissingError.d.ts +3 -0
  29. package/dist/errors/invalidRouteParamValueError.d.ts +2 -0
  30. package/dist/errors/metaPropertyConflict.d.ts +8 -0
  31. package/dist/errors/routeNotFoundError.d.ts +6 -0
  32. package/dist/errors/routerNotInstalledError.d.ts +7 -0
  33. package/dist/errors/useRouteInvalidError.d.ts +13 -0
  34. package/dist/guards/routes.d.ts +46 -0
  35. package/dist/guards/routes.spec-d.d.ts +1 -0
  36. package/dist/keys.d.ts +3 -0
  37. package/dist/kitbag-router.d.ts +2 -1433
  38. package/dist/kitbag-router.js +1751 -1675
  39. package/dist/kitbag-router.umd.cjs +3 -3
  40. package/dist/main.d.ts +302 -0
  41. package/dist/models/RouteHooks.d.ts +9 -0
  42. package/dist/models/RouterRouteHooks.d.ts +10 -0
  43. package/dist/services/arrayOf.d.ts +7 -0
  44. package/dist/services/arrayOf.spec.d.ts +1 -0
  45. package/dist/services/combineHash.d.ts +4 -0
  46. package/dist/services/combineHash.spec.d.ts +1 -0
  47. package/dist/services/combineMeta.d.ts +2 -0
  48. package/dist/services/combineMeta.spec.d.ts +1 -0
  49. package/dist/services/combinePath.d.ts +12 -0
  50. package/dist/services/combinePath.spec-d.d.ts +1 -0
  51. package/dist/services/combinePath.spec.d.ts +1 -0
  52. package/dist/services/combineQuery.d.ts +13 -0
  53. package/dist/services/combineQuery.spec.d.ts +1 -0
  54. package/dist/services/combineState.d.ts +3 -0
  55. package/dist/services/combineState.spec.d.ts +1 -0
  56. package/dist/services/component.browser.spec.d.ts +1 -0
  57. package/dist/services/component.d.ts +12 -0
  58. package/dist/services/createCallbackContext.d.ts +38 -0
  59. package/dist/services/createComponentHooks.d.ts +11 -0
  60. package/dist/services/createComponentsStore.d.ts +7 -0
  61. package/dist/services/createCurrentRoute.d.ts +13 -0
  62. package/dist/services/createExternalRoute.d.ts +3 -0
  63. package/dist/services/createExternalRoute.spec.d.ts +1 -0
  64. package/dist/services/createIsExternal.d.ts +1 -0
  65. package/dist/services/createIsExternal.spec.d.ts +1 -0
  66. package/dist/services/createParam.d.ts +6 -0
  67. package/dist/services/createPropStore.d.ts +13 -0
  68. package/dist/services/createResolvedRoute.d.ts +4 -0
  69. package/dist/services/createResolvedRouteForUrl.browser.spec.d.ts +1 -0
  70. package/dist/services/createResolvedRouteForUrl.d.ts +3 -0
  71. package/dist/services/createResolvedRouteQuery.d.ts +5 -0
  72. package/dist/services/createRoute.d.ts +4 -0
  73. package/dist/services/createRoute.spec-d.d.ts +1 -0
  74. package/dist/services/createRoute.spec.d.ts +1 -0
  75. package/dist/services/createRouteId.d.ts +1 -0
  76. package/dist/services/createRouter.browser.spec.d.ts +1 -0
  77. package/dist/services/createRouter.d.ts +28 -0
  78. package/dist/services/createRouter.spec-d.d.ts +1 -0
  79. package/dist/services/createRouter.spec.d.ts +1 -0
  80. package/dist/services/createRouterAssets.d.ts +118 -0
  81. package/dist/services/createRouterHistory.browser.spec.d.ts +1 -0
  82. package/dist/services/createRouterHistory.d.ts +20 -0
  83. package/dist/services/createRouterHooks.d.ts +20 -0
  84. package/dist/services/createRouterKeyStore.d.ts +3 -0
  85. package/dist/services/createRouterPlugin.browser.spec.d.ts +1 -0
  86. package/dist/services/createRouterPlugin.d.ts +4 -0
  87. package/dist/services/createRouterReject.d.ts +16 -0
  88. package/dist/services/createRouterRoute.d.ts +7 -0
  89. package/dist/services/createRouterRoute.spec.d.ts +1 -0
  90. package/dist/services/createUniqueIdSequence.d.ts +2 -0
  91. package/dist/services/createVisibilityObserver.d.ts +7 -0
  92. package/dist/services/createVueAppStore.d.ts +8 -0
  93. package/dist/services/getGlobalHooksForRouter.d.ts +4 -0
  94. package/dist/services/getGlobalRouteHooks.d.ts +5 -0
  95. package/dist/services/getInitialUrl.browser.spec.d.ts +1 -0
  96. package/dist/services/getInitialUrl.d.ts +1 -0
  97. package/dist/services/getInitialUrl.spec.d.ts +1 -0
  98. package/dist/services/getMatchesForUrl.d.ts +2 -0
  99. package/dist/services/getMatchesForUrl.spec.d.ts +1 -0
  100. package/dist/services/getParamsForString.d.ts +2 -0
  101. package/dist/services/getRouteHooks.d.ts +4 -0
  102. package/dist/services/getRouteHooks.spec.d.ts +1 -0
  103. package/dist/services/getRoutesForRouter.d.ts +9 -0
  104. package/dist/services/getRoutesForRouter.spec.d.ts +1 -0
  105. package/dist/services/hooks.browser.spec.d.ts +1 -0
  106. package/dist/services/hooks.d.ts +8 -0
  107. package/dist/services/hooks.spec.d.ts +1 -0
  108. package/dist/services/insertBaseRoute.d.ts +2 -0
  109. package/dist/services/insertBaseRoute.spec.d.ts +1 -0
  110. package/dist/services/paramValidation.d.ts +4 -0
  111. package/dist/services/paramValidation.spec.d.ts +1 -0
  112. package/dist/services/params.d.ts +7 -0
  113. package/dist/services/params.spec.d.ts +1 -0
  114. package/dist/services/paramsFinder.d.ts +3 -0
  115. package/dist/services/paramsFinder.spec.d.ts +1 -0
  116. package/dist/services/routeMatchRules.d.ts +5 -0
  117. package/dist/services/routeMatchRules.spec.d.ts +1 -0
  118. package/dist/services/routeMatchScore.d.ts +7 -0
  119. package/dist/services/routeMatchScore.spec.d.ts +1 -0
  120. package/dist/services/routeRegex.d.ts +18 -0
  121. package/dist/services/routeRegex.spec.d.ts +1 -0
  122. package/dist/services/state.d.ts +9 -0
  123. package/dist/services/state.spec.d.ts +1 -0
  124. package/dist/services/tupleOf.d.ts +10 -0
  125. package/dist/services/tupleOf.spec.d.ts +1 -0
  126. package/dist/services/unionOf.d.ts +3 -0
  127. package/dist/services/unionOf.spec.d.ts +1 -0
  128. package/dist/services/urlAssembly.d.ts +10 -0
  129. package/dist/services/urlAssembly.spec.d.ts +1 -0
  130. package/dist/services/urlCombine.d.ts +2 -0
  131. package/dist/services/urlCombine.spec.d.ts +1 -0
  132. package/dist/services/urlCreator.d.ts +2 -0
  133. package/dist/services/urlCreator.spec.d.ts +1 -0
  134. package/dist/services/urlParser.d.ts +2 -0
  135. package/dist/services/urlParser.spec.d.ts +1 -0
  136. package/dist/services/valibot.d.ts +7 -0
  137. package/dist/services/valibot.spec-d.d.ts +1 -0
  138. package/dist/services/valibot.spec.d.ts +1 -0
  139. package/dist/services/withDefault.d.ts +5 -0
  140. package/dist/services/withParams.d.ts +15 -0
  141. package/dist/services/withParams.spec-d.d.ts +1 -0
  142. package/dist/services/withParams.spec.d.ts +1 -0
  143. package/dist/services/zod.d.ts +11 -0
  144. package/dist/services/zod.spec-d.d.ts +1 -0
  145. package/dist/services/zod.spec.d.ts +1 -0
  146. package/dist/tests/hooks.spec.d.ts +1 -0
  147. package/dist/tests/routeProps.browser.spec.d.ts +1 -0
  148. package/dist/tests/routeProps.spec.d.ts +1 -0
  149. package/dist/types/createRouteOptions.d.ts +120 -0
  150. package/dist/types/hooks.d.ts +111 -0
  151. package/dist/types/meta.d.ts +2 -0
  152. package/dist/types/name.d.ts +2 -0
  153. package/dist/types/paramTypes.d.ts +14 -0
  154. package/dist/types/params.d.ts +71 -0
  155. package/dist/types/prefetch.d.ts +27 -0
  156. package/dist/types/props.d.ts +23 -0
  157. package/dist/types/querySource.d.ts +1 -0
  158. package/dist/types/register.d.ts +57 -0
  159. package/dist/types/register.spec.d.ts +1 -0
  160. package/dist/types/resolved.d.ts +47 -0
  161. package/dist/types/resolved.spec-d.d.ts +1 -0
  162. package/dist/types/route.d.ts +76 -0
  163. package/dist/types/route.spec-d.d.ts +1 -0
  164. package/dist/types/routeMatchRule.d.ts +2 -0
  165. package/dist/types/routeUpdate.d.ts +9 -0
  166. package/dist/types/routeWithParams.d.ts +5 -0
  167. package/dist/types/routeWithParams.spec-d.d.ts +1 -0
  168. package/dist/types/router.d.ts +185 -0
  169. package/dist/types/routerLink.d.ts +16 -0
  170. package/dist/types/routerPlugin.d.ts +18 -0
  171. package/dist/types/routerPush.d.ts +33 -0
  172. package/dist/types/routerReject.d.ts +3 -0
  173. package/dist/types/routerReplace.d.ts +20 -0
  174. package/dist/types/routerResolve.d.ts +15 -0
  175. package/dist/types/routerRoute.d.ts +16 -0
  176. package/dist/types/routesMap.d.ts +9 -0
  177. package/dist/types/routesMap.spec-ts.d.ts +1 -0
  178. package/dist/types/state.d.ts +18 -0
  179. package/dist/types/url.d.ts +23 -0
  180. package/dist/types/useLink.d.ts +51 -0
  181. package/dist/types/utilities.d.ts +22 -0
  182. package/dist/utilities/array.d.ts +2 -0
  183. package/dist/utilities/checkDuplicateKeys.d.ts +1 -0
  184. package/dist/utilities/checkDuplicateKeys.spec.d.ts +1 -0
  185. package/dist/utilities/checkDuplicateNames.d.ts +2 -0
  186. package/dist/utilities/checkDuplicateNames.spec.d.ts +1 -0
  187. package/dist/utilities/components.d.ts +6 -0
  188. package/dist/utilities/components.spec.d.ts +1 -0
  189. package/dist/utilities/guards.d.ts +5 -0
  190. package/dist/utilities/guards.spec.d.ts +1 -0
  191. package/dist/utilities/index.d.ts +6 -0
  192. package/dist/utilities/isBrowser.browser.spec.d.ts +1 -0
  193. package/dist/utilities/isBrowser.d.ts +1 -0
  194. package/dist/utilities/isBrowser.spec.d.ts +1 -0
  195. package/dist/utilities/makeOptional.d.ts +9 -0
  196. package/dist/utilities/prefetch.d.ts +4 -0
  197. package/dist/utilities/prefetch.spec.d.ts +1 -0
  198. package/dist/utilities/promises.d.ts +1 -0
  199. package/dist/utilities/props.d.ts +6 -0
  200. package/dist/utilities/testHelpers.d.ts +144 -0
  201. package/dist/utilities/urlSearchParams.d.ts +2 -0
  202. package/dist/utilities/urlSearchParams.spec.d.ts +1 -0
  203. package/package.json +11 -11
@@ -1,14 +1,5 @@
1
- var Zr = Object.defineProperty;
2
- var Or = (t, e, r) => e in t ? Zr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var T = (t, e, r) => Or(t, typeof e != "symbol" ? e + "" : e, r);
4
- import { inject as it, markRaw as Ut, reactive as qt, defineAsyncComponent as jr, watch as ot, onUnmounted as Ht, computed as O, ref as Pt, toValue as V, toRefs as $r, defineComponent as vt, createElementBlock as _r, openBlock as $e, normalizeClass as qr, renderSlot as _e, normalizeProps as qe, guardReactiveProps as Hr, unref as tt, h as dt, getCurrentInstance as Ir, onServerPrefetch as Dr, provide as Jr, createCommentVNode as Fr, mergeProps as Tr, createBlock as Mr, resolveDynamicComponent as Wr } from "vue";
5
- function M(t) {
6
- return typeof t != "string" ? !1 : /^(https?:\/\/|\/).*/g.test(t);
7
- }
8
- function He(t) {
9
- return M(t) ? t : `/${t}`;
10
- }
11
- class Gr extends Error {
1
+ import { markRaw as Bt, inject as at, provide as Or, onUnmounted as It, toRefs as jr, computed as j, reactive as Dt, watch as ot, defineComponent as gt, onServerPrefetch as Zr, h as X, defineAsyncComponent as Hr, ref as St, toValue as C, getCurrentInstance as $r } from "vue";
2
+ class qr extends Error {
12
3
  /**
13
4
  * Constructs a new DuplicateParamsError instance with a message indicating the problematic parameter.
14
5
  * @param paramName - The name of the parameter that was duplicated.
@@ -17,105 +8,77 @@ class Gr extends Error {
17
8
  super(`Invalid Param "${e}": Router does not support multiple params by the same name. All param names must be unique.`);
18
9
  }
19
10
  }
20
- class Qr extends Error {
21
- constructor(e) {
22
- super(`Child property on meta for ${e} conflicts with the parent meta.`);
23
- }
24
- }
25
- class Et extends Error {
26
- constructor() {
27
- super("Router not installed");
28
- }
29
- }
30
- class zr extends Error {
31
- /**
32
- * Constructs a new UseRouteInvalidError instance with a message that specifies both the given and expected route names.
33
- * This detailed error message aids in quickly identifying and resolving mismatches in route usage.
34
- * @param routeName - The route name that was incorrectly used.
35
- * @param actualRouteName - The expected route name that should have been used.
36
- */
37
- constructor(e, r) {
38
- super(`useRoute called with incorrect route. Given ${e}, expected ${r}`);
39
- }
40
- }
41
- const Ie = Symbol();
42
- function It() {
43
- const t = it(Ie);
44
- if (!t)
45
- throw new Et();
46
- return t;
47
- }
48
- function ht(t) {
11
+ function pt(t) {
49
12
  return Array.isArray(t) ? t : [t];
50
13
  }
51
14
  function De(t, e) {
52
15
  return t.filter((r) => e === r).length;
53
16
  }
54
- function bt(...t) {
17
+ function wt(...t) {
55
18
  const e = t.flatMap((r) => Array.isArray(r) ? r : Object.keys(r));
56
19
  for (const r of e)
57
20
  if (De(e, r) > 1)
58
- throw new Gr(r);
21
+ throw new qr(r);
59
22
  }
60
23
  class Q extends Error {
61
24
  }
62
- const At = "[", Dt = "]";
63
- function Kr(t) {
25
+ const Pt = "[", _t = "]";
26
+ function Ir(t) {
64
27
  return t !== String && t !== Boolean && t !== Number && t !== Date;
65
28
  }
66
- function Yr(t) {
67
- return typeof t == "function" && Kr(t);
29
+ function Dr(t) {
30
+ return typeof t == "function" && Ir(t);
68
31
  }
69
32
  function Jt(t) {
70
33
  return typeof t == "object" && "get" in t && typeof t.get == "function" && "set" in t && typeof t.set == "function";
71
34
  }
72
- function Je(t) {
35
+ function _e(t) {
73
36
  return typeof t == "string" || typeof t == "number" || typeof t == "boolean";
74
37
  }
75
- function Xr(t, e) {
38
+ function _r(t, e) {
76
39
  return Jt(t) ? { ...t, defaultValue: e ?? t.defaultValue } : {
77
- get: (r) => at(r, t),
40
+ get: (r) => st(r, t),
78
41
  set: (r) => z(r, t),
79
42
  defaultValue: e
80
43
  };
81
44
  }
82
- function tn(t) {
45
+ function Jr(t) {
83
46
  return Jt(t) && t.defaultValue !== void 0;
84
47
  }
85
- function Io(t, e) {
86
- return Xr(t, e);
48
+ function Vo(t, e) {
49
+ return _r(t, e);
87
50
  }
88
- function en(t) {
51
+ function Tr(t) {
89
52
  return t !== void 0;
90
53
  }
91
- function mt(t) {
54
+ function ht(t) {
92
55
  return typeof t == "object" && t !== null && !Array.isArray(t);
93
56
  }
94
- function W(t) {
57
+ function F(t) {
95
58
  return typeof t == "string" && t.length > 0;
96
59
  }
97
- let w = null;
98
- async function rn() {
60
+ let P = null;
61
+ async function Fr() {
99
62
  const {
100
63
  ZodSchema: t,
101
64
  ZodString: e,
102
65
  ZodBoolean: r,
103
66
  ZodDate: n,
104
67
  ZodNumber: o,
105
- ZodLiteral: a,
106
- ZodObject: s,
107
- ZodEnum: p,
108
- ZodNativeEnum: h,
109
- ZodArray: u,
110
- ZodTuple: m,
111
- ZodUnion: R,
112
- ZodDiscriminatedUnion: L,
113
- ZodRecord: S,
114
- ZodMap: U,
115
- ZodSet: v,
116
- ZodIntersection: i,
117
- ZodPromise: f,
118
- ZodFunction: c
68
+ ZodLiteral: s,
69
+ ZodObject: a,
70
+ ZodEnum: u,
71
+ ZodNativeEnum: f,
72
+ ZodArray: p,
73
+ ZodTuple: y,
74
+ ZodUnion: d,
75
+ ZodDiscriminatedUnion: A,
76
+ ZodRecord: E,
77
+ ZodMap: N,
78
+ ZodSet: R,
79
+ ZodIntersection: k,
80
+ ZodPromise: h,
81
+ ZodFunction: g
119
82
  } = await import("zod");
120
83
  return {
121
84
  ZodSchema: t,
@@ -123,37 +86,37 @@ async function rn() {
123
86
  ZodBoolean: r,
124
87
  ZodDate: n,
125
88
  ZodNumber: o,
126
- ZodLiteral: a,
127
- ZodObject: s,
128
- ZodEnum: p,
129
- ZodNativeEnum: h,
130
- ZodArray: u,
131
- ZodTuple: m,
132
- ZodUnion: R,
133
- ZodDiscriminatedUnion: L,
134
- ZodRecord: S,
135
- ZodMap: U,
136
- ZodSet: v,
137
- ZodIntersection: i,
138
- ZodPromise: f,
139
- ZodFunction: c
89
+ ZodLiteral: s,
90
+ ZodObject: a,
91
+ ZodEnum: u,
92
+ ZodNativeEnum: f,
93
+ ZodArray: p,
94
+ ZodTuple: y,
95
+ ZodUnion: d,
96
+ ZodDiscriminatedUnion: A,
97
+ ZodRecord: E,
98
+ ZodMap: N,
99
+ ZodSet: R,
100
+ ZodIntersection: k,
101
+ ZodPromise: h,
102
+ ZodFunction: g
140
103
  };
141
104
  }
142
- function nn(t) {
143
- return Object.values(t).some((e) => Object.values(e.host.params).some((r) => Gt(r)) || Object.values(e.path.params).some((r) => Gt(r)) || Object.values(e.query.params).some((r) => Gt(r)));
105
+ function Mr(t) {
106
+ return Object.values(t).some((e) => Object.values(e.host.params).some((r) => Qt(r)) || Object.values(e.path.params).some((r) => Qt(r)) || Object.values(e.query.params).some((r) => Qt(r)));
144
107
  }
145
- function Gt(t) {
146
- return mt(t) && "parse" in t && typeof t.parse == "function" && "~standard" in t && mt(t["~standard"]) && "vendor" in t["~standard"] && t["~standard"].vendor === "zod";
108
+ function Qt(t) {
109
+ return ht(t) && "parse" in t && typeof t.parse == "function" && "~standard" in t && ht(t["~standard"]) && "vendor" in t["~standard"] && t["~standard"].vendor === "zod";
147
110
  }
148
- async function on() {
111
+ async function Wr() {
149
112
  try {
150
- w = await rn();
113
+ P = await Fr();
151
114
  } catch {
152
115
  throw new Error("Failed to initialize Zod");
153
116
  }
154
117
  }
155
- function Fe(t) {
156
- return w ? t instanceof w.ZodSchema : !1;
118
+ function Je(t) {
119
+ return P ? t instanceof P.ZodSchema : !1;
157
120
  }
158
121
  function Te(t) {
159
122
  return {
@@ -166,22 +129,22 @@ function Te(t) {
166
129
  },
167
130
  set: (e, { invalid: r }) => {
168
131
  try {
169
- return Yt(e, t);
132
+ return Xt(e, t);
170
133
  } catch {
171
134
  throw r();
172
135
  }
173
136
  }
174
137
  };
175
138
  }
176
- const an = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
177
- function ct(t, e) {
178
- if (typeof e == "string" && an.test(e)) {
139
+ const Gr = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
140
+ function it(t, e) {
141
+ if (typeof e == "string" && Gr.test(e)) {
179
142
  const r = new Date(e);
180
143
  return isNaN(r.getTime()) ? e : r;
181
144
  }
182
145
  return e;
183
146
  }
184
- function lt(t) {
147
+ function ft(t) {
185
148
  for (const e of t)
186
149
  try {
187
150
  return e();
@@ -190,110 +153,110 @@ function lt(t) {
190
153
  }
191
154
  throw new Error("All functions failed");
192
155
  }
193
- function Bt(t, e) {
194
- return w != null && w.ZodString && t instanceof w.ZodString ? 1 : w != null && w.ZodString && e instanceof w.ZodString ? -1 : 0;
156
+ function Vt(t, e) {
157
+ return P?.ZodString && t instanceof P.ZodString ? 1 : P?.ZodString && e instanceof P.ZodString ? -1 : 0;
195
158
  }
196
159
  function Kt(t, e) {
197
- if (!w)
160
+ if (!P)
198
161
  throw new Error("Zod is not initialized");
199
- if (e instanceof w.ZodString)
162
+ if (e instanceof P.ZodString)
200
163
  return e.parse(t);
201
- if (e instanceof w.ZodBoolean)
164
+ if (e instanceof P.ZodBoolean)
202
165
  return e.parse(!!t);
203
- if (e instanceof w.ZodDate)
166
+ if (e instanceof P.ZodDate)
204
167
  return e.parse(new Date(t));
205
- if (e instanceof w.ZodNumber)
168
+ if (e instanceof P.ZodNumber)
206
169
  return e.parse(Number(t));
207
- if (e instanceof w.ZodLiteral)
208
- return lt([
170
+ if (e instanceof P.ZodLiteral)
171
+ return ft([
209
172
  () => e.parse(Number(t)),
210
173
  () => e.parse(!!t),
211
174
  () => e.parse(t)
212
175
  ]);
213
- if (e instanceof w.ZodObject)
214
- return e.parse(JSON.parse(t, ct));
215
- if (e instanceof w.ZodEnum)
176
+ if (e instanceof P.ZodObject)
177
+ return e.parse(JSON.parse(t, it));
178
+ if (e instanceof P.ZodEnum)
216
179
  return e.parse(t);
217
- if (e instanceof w.ZodNativeEnum)
218
- return lt([
180
+ if (e instanceof P.ZodNativeEnum)
181
+ return ft([
219
182
  () => e.parse(Number(t)),
220
183
  () => e.parse(t)
221
184
  ]);
222
- if (e instanceof w.ZodArray || e instanceof w.ZodTuple)
223
- return e.parse(JSON.parse(t, ct));
224
- if (e instanceof w.ZodUnion) {
225
- const r = Array.from(e._def.options).sort(Bt).map((n) => () => Kt(t, n));
226
- return lt(r);
227
- }
228
- if (e instanceof w.ZodDiscriminatedUnion) {
229
- const r = Array.from(e.options).sort(Bt).map((n) => () => Kt(t, n));
230
- return lt(r);
231
- }
232
- if (e instanceof w.ZodRecord)
233
- return e.parse(JSON.parse(t, ct));
234
- if (e instanceof w.ZodMap)
235
- return e.parse(new Map(JSON.parse(t, ct)));
236
- if (e instanceof w.ZodSet)
237
- return e.parse(new Set(JSON.parse(t, ct)));
238
- if (e instanceof w.ZodIntersection)
185
+ if (e instanceof P.ZodArray || e instanceof P.ZodTuple)
186
+ return e.parse(JSON.parse(t, it));
187
+ if (e instanceof P.ZodUnion) {
188
+ const r = Array.from(e._def.options).sort(Vt).map((n) => () => Kt(t, n));
189
+ return ft(r);
190
+ }
191
+ if (e instanceof P.ZodDiscriminatedUnion) {
192
+ const r = Array.from(e.options).sort(Vt).map((n) => () => Kt(t, n));
193
+ return ft(r);
194
+ }
195
+ if (e instanceof P.ZodRecord)
196
+ return e.parse(JSON.parse(t, it));
197
+ if (e instanceof P.ZodMap)
198
+ return e.parse(new Map(JSON.parse(t, it)));
199
+ if (e instanceof P.ZodSet)
200
+ return e.parse(new Set(JSON.parse(t, it)));
201
+ if (e instanceof P.ZodIntersection)
239
202
  throw new Error("Intersection schemas are not supported");
240
- if (e instanceof w.ZodPromise)
203
+ if (e instanceof P.ZodPromise)
241
204
  throw new Error("Promise schemas are not supported");
242
- if (e instanceof w.ZodFunction)
205
+ if (e instanceof P.ZodFunction)
243
206
  throw new Error("Function schemas are not supported");
244
207
  return e.parse(t);
245
208
  }
246
- function Yt(t, e) {
247
- if (!w)
209
+ function Xt(t, e) {
210
+ if (!P)
248
211
  throw new Error("Zod is not initialized");
249
- if (e instanceof w.ZodString)
212
+ if (e instanceof P.ZodString)
250
213
  return e.parse(t);
251
- if (e instanceof w.ZodBoolean)
214
+ if (e instanceof P.ZodBoolean)
252
215
  return e.parse(t).toString();
253
- if (e instanceof w.ZodDate)
216
+ if (e instanceof P.ZodDate)
254
217
  return e.parse(t).toISOString();
255
- if (e instanceof w.ZodNumber)
218
+ if (e instanceof P.ZodNumber)
256
219
  return e.parse(Number(t)).toString();
257
- if (e instanceof w.ZodLiteral)
220
+ if (e instanceof P.ZodLiteral)
258
221
  return e.parse(t).toString();
259
- if (e instanceof w.ZodObject)
222
+ if (e instanceof P.ZodObject)
260
223
  return JSON.stringify(e.parse(t));
261
- if (e instanceof w.ZodEnum)
224
+ if (e instanceof P.ZodEnum)
262
225
  return e.parse(t);
263
- if (e instanceof w.ZodNativeEnum)
226
+ if (e instanceof P.ZodNativeEnum)
264
227
  return e.parse(t).toString();
265
- if (e instanceof w.ZodArray || e instanceof w.ZodTuple)
228
+ if (e instanceof P.ZodArray || e instanceof P.ZodTuple)
266
229
  return JSON.stringify(e.parse(t));
267
- if (e instanceof w.ZodUnion) {
268
- const r = Array.from(e._def.options).sort(Bt).map((n) => () => Yt(t, n));
269
- return lt(r);
230
+ if (e instanceof P.ZodUnion) {
231
+ const r = Array.from(e._def.options).sort(Vt).map((n) => () => Xt(t, n));
232
+ return ft(r);
270
233
  }
271
- if (e instanceof w.ZodDiscriminatedUnion) {
272
- const r = Array.from(e.options).sort(Bt).map((n) => () => Yt(t, n));
273
- return lt(r);
234
+ if (e instanceof P.ZodDiscriminatedUnion) {
235
+ const r = Array.from(e.options).sort(Vt).map((n) => () => Xt(t, n));
236
+ return ft(r);
274
237
  }
275
- if (e instanceof w.ZodRecord)
238
+ if (e instanceof P.ZodRecord)
276
239
  return JSON.stringify(e.parse(t));
277
- if (e instanceof w.ZodMap) {
240
+ if (e instanceof P.ZodMap) {
278
241
  const r = e.parse(t);
279
242
  return JSON.stringify(Array.from(r.entries()));
280
243
  }
281
- if (e instanceof w.ZodSet) {
244
+ if (e instanceof P.ZodSet) {
282
245
  const r = e.parse(t);
283
246
  return JSON.stringify(Array.from(r.values()));
284
247
  }
285
- if (e instanceof w.ZodIntersection)
248
+ if (e instanceof P.ZodIntersection)
286
249
  throw new Error("Intersection schemas are not supported");
287
- if (e instanceof w.ZodPromise)
250
+ if (e instanceof P.ZodPromise)
288
251
  throw new Error("Promise schemas are not supported");
289
- if (e instanceof w.ZodFunction)
252
+ if (e instanceof P.ZodFunction)
290
253
  throw new Error("Function schemas are not supported");
291
254
  return JSON.stringify(e.parse(t));
292
255
  }
293
256
  function oe(t) {
294
257
  return typeof t == "object" && t !== null && "then" in t;
295
258
  }
296
- function N(t, e) {
259
+ function x(t, e) {
297
260
  const r = t["~standard"].validate(e);
298
261
  if (oe(r))
299
262
  throw new Error("Promise schemas are not supported");
@@ -301,39 +264,39 @@ function N(t, e) {
301
264
  throw new Error("Validation failed");
302
265
  return r.value;
303
266
  }
304
- function sn(t) {
305
- return mt(t) && "type" in t && typeof t.type == "string" && "~standard" in t && mt(t["~standard"]) && "vendor" in t["~standard"] && t["~standard"].vendor === "valibot";
267
+ function Qr(t) {
268
+ return ht(t) && "type" in t && typeof t.type == "string" && "~standard" in t && ht(t["~standard"]) && "vendor" in t["~standard"] && t["~standard"].vendor === "valibot";
306
269
  }
307
- function Me(t) {
308
- return sn(t);
270
+ function Fe(t) {
271
+ return Qr(t);
309
272
  }
310
- function We(t) {
273
+ function Me(t) {
311
274
  return {
312
275
  get: (e, { invalid: r }) => {
313
276
  try {
314
- return Xt(e, t);
277
+ return te(e, t);
315
278
  } catch {
316
279
  throw r();
317
280
  }
318
281
  },
319
282
  set: (e, { invalid: r }) => {
320
283
  try {
321
- return te(e, t);
284
+ return ee(e, t);
322
285
  } catch {
323
286
  throw r();
324
287
  }
325
288
  }
326
289
  };
327
290
  }
328
- const cn = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
291
+ const zr = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
329
292
  function ut(t, e) {
330
- if (typeof e == "string" && cn.test(e)) {
293
+ if (typeof e == "string" && zr.test(e)) {
331
294
  const r = new Date(e);
332
295
  return isNaN(r.getTime()) ? e : r;
333
296
  }
334
297
  return e;
335
298
  }
336
- function pt(t) {
299
+ function lt(t) {
337
300
  for (const e of t)
338
301
  try {
339
302
  return e();
@@ -345,82 +308,82 @@ function pt(t) {
345
308
  function Ct(t, e) {
346
309
  return t.type === "string" ? 1 : e.type === "string" ? -1 : 0;
347
310
  }
348
- function Xt(t, e) {
311
+ function te(t, e) {
349
312
  if (e.type === "boolean")
350
- return N(e, !!t);
313
+ return x(e, !!t);
351
314
  if (e.type === "date")
352
- return N(e, new Date(t));
315
+ return x(e, new Date(t));
353
316
  if (e.type === "number")
354
- return N(e, Number(t));
317
+ return x(e, Number(t));
355
318
  if (e.type === "literal")
356
- return pt([
357
- () => N(e, Number(t)),
358
- () => N(e, !!t),
359
- () => N(e, t)
319
+ return lt([
320
+ () => x(e, Number(t)),
321
+ () => x(e, !!t),
322
+ () => x(e, t)
360
323
  ]);
361
324
  if (e.type === "object")
362
- return N(e, JSON.parse(t, ut));
325
+ return x(e, JSON.parse(t, ut));
363
326
  if (e.type === "enum")
364
- return pt([
365
- () => N(e, Number(t)),
366
- () => N(e, !!t),
367
- () => N(e, t)
327
+ return lt([
328
+ () => x(e, Number(t)),
329
+ () => x(e, !!t),
330
+ () => x(e, t)
368
331
  ]);
369
332
  if (e.type === "array" || e.type === "tuple")
370
- return N(e, JSON.parse(t, ut));
333
+ return x(e, JSON.parse(t, ut));
371
334
  if (e.type === "union" && "options" in e) {
372
- const r = e.options.sort(Ct).map((n) => () => Xt(t, n));
373
- return pt(r);
335
+ const r = e.options.sort(Ct).map((n) => () => te(t, n));
336
+ return lt(r);
374
337
  }
375
338
  if (e.type === "variant" && "options" in e) {
376
- const r = e.options.sort(Ct).map((n) => () => Xt(t, n));
377
- return pt(r);
339
+ const r = e.options.sort(Ct).map((n) => () => te(t, n));
340
+ return lt(r);
378
341
  }
379
342
  if (e.type === "record")
380
- return N(e, JSON.parse(t, ut));
343
+ return x(e, JSON.parse(t, ut));
381
344
  if (e.type === "map")
382
- return N(e, new Map(JSON.parse(t, ut)));
345
+ return x(e, new Map(JSON.parse(t, ut)));
383
346
  if (e.type === "set")
384
- return N(e, new Set(JSON.parse(t, ut)));
347
+ return x(e, new Set(JSON.parse(t, ut)));
385
348
  if (e.type === "intersection")
386
349
  throw new Error("Intersection schemas are not supported");
387
350
  if (e.type === "promise")
388
351
  throw new Error("Promise schemas are not supported");
389
352
  if (e.type === "function")
390
353
  throw new Error("Function schemas are not supported");
391
- return N(e, t);
354
+ return x(e, t);
392
355
  }
393
- function te(t, e) {
356
+ function ee(t, e) {
394
357
  if (e.type === "string" || e.type === "boolean")
395
- return N(e, t).toString();
358
+ return x(e, t).toString();
396
359
  if (e.type === "date")
397
- return N(e, t).toISOString();
360
+ return x(e, t).toISOString();
398
361
  if (e.type === "number")
399
- return N(e, Number(t)).toString();
362
+ return x(e, Number(t)).toString();
400
363
  if (e.type === "literal")
401
- return N(e, t).toString();
364
+ return x(e, t).toString();
402
365
  if (e.type === "object")
403
- return JSON.stringify(N(e, t));
366
+ return JSON.stringify(x(e, t));
404
367
  if (e.type === "enum" || e.type === "nativeEnum")
405
- return N(e, t).toString();
368
+ return x(e, t).toString();
406
369
  if (e.type === "array" || e.type === "tuple")
407
- return JSON.stringify(N(e, t));
370
+ return JSON.stringify(x(e, t));
408
371
  if (e.type === "union" && "options" in e) {
409
- const r = e.options.sort(Ct).map((n) => () => te(t, n));
410
- return pt(r);
372
+ const r = e.options.sort(Ct).map((n) => () => ee(t, n));
373
+ return lt(r);
411
374
  }
412
375
  if (e.type === "variant" && "options" in e) {
413
- const r = e.options.sort(Ct).map((n) => () => te(t, n));
414
- return pt(r);
376
+ const r = e.options.sort(Ct).map((n) => () => ee(t, n));
377
+ return lt(r);
415
378
  }
416
379
  if (e.type === "record")
417
- return JSON.stringify(N(e, t));
380
+ return JSON.stringify(x(e, t));
418
381
  if (e.type === "map") {
419
- const r = N(e, t);
382
+ const r = x(e, t);
420
383
  return JSON.stringify(Array.from(r.entries()));
421
384
  }
422
385
  if (e.type === "set") {
423
- const r = N(e, t);
386
+ const r = x(e, t);
424
387
  return JSON.stringify(Array.from(r.values()));
425
388
  }
426
389
  if (e.type === "intersection")
@@ -429,23 +392,23 @@ function te(t, e) {
429
392
  throw new Error("Promise schemas are not supported");
430
393
  if (e.type === "function")
431
394
  throw new Error("Function schemas are not supported");
432
- return JSON.stringify(N(e, t));
395
+ return JSON.stringify(x(e, t));
433
396
  }
434
- function un(t, e) {
397
+ function Yr(t, e) {
435
398
  return t[e] ?? String;
436
399
  }
437
- const Z = {
400
+ const O = {
438
401
  invalid: (t) => {
439
402
  throw new Q(t);
440
403
  }
441
- }, Ge = {
404
+ }, We = {
442
405
  get: (t) => t,
443
406
  set: (t, { invalid: e }) => {
444
407
  if (typeof t != "string")
445
408
  throw e();
446
409
  return t;
447
410
  }
448
- }, ae = {
411
+ }, se = {
449
412
  get: (t, { invalid: e }) => {
450
413
  if (t === "true")
451
414
  return !0;
@@ -458,7 +421,7 @@ const Z = {
458
421
  throw e();
459
422
  return t.toString();
460
423
  }
461
- }, se = {
424
+ }, ae = {
462
425
  get: (t, { invalid: e }) => {
463
426
  const r = Number(t);
464
427
  if (isNaN(r))
@@ -470,7 +433,7 @@ const Z = {
470
433
  throw e();
471
434
  return t.toString();
472
435
  }
473
- }, Qe = {
436
+ }, Ge = {
474
437
  get: (t, { invalid: e }) => {
475
438
  const r = new Date(t);
476
439
  if (isNaN(r.getTime()))
@@ -482,7 +445,7 @@ const Z = {
482
445
  throw e();
483
446
  return t.toISOString();
484
447
  }
485
- }, ze = {
448
+ }, Qe = {
486
449
  get: (t, { invalid: e }) => {
487
450
  try {
488
451
  return JSON.parse(t);
@@ -498,62 +461,62 @@ const Z = {
498
461
  }
499
462
  }
500
463
  };
501
- function fn(t, e) {
464
+ function Kr(t, e) {
502
465
  switch (typeof e) {
503
466
  case "string":
504
- return Ge.get(t, Z) === e;
467
+ return We.get(t, O) === e;
505
468
  case "number":
506
- return se.get(t, Z) === e;
469
+ return ae.get(t, O) === e;
507
470
  case "boolean":
508
- return ae.get(t, Z) === e;
471
+ return se.get(t, O) === e;
509
472
  default:
510
473
  return !1;
511
474
  }
512
475
  }
513
- function at(t, e, r = !1) {
514
- if (t === void 0 || !W(t)) {
515
- if (tn(e))
476
+ function st(t, e, r = !1) {
477
+ if (t === void 0 || !F(t)) {
478
+ if (Jr(e))
516
479
  return e.defaultValue;
517
480
  if (r)
518
481
  return;
519
482
  throw new Q();
520
483
  }
521
484
  if (e === String)
522
- return Ge.get(t, Z);
485
+ return We.get(t, O);
523
486
  if (e === Boolean)
524
- return ae.get(t, Z);
487
+ return se.get(t, O);
525
488
  if (e === Number)
526
- return se.get(t, Z);
489
+ return ae.get(t, O);
527
490
  if (e === Date)
528
- return Qe.get(t, Z);
491
+ return Ge.get(t, O);
529
492
  if (e === JSON)
530
- return ze.get(t, Z);
531
- if (Yr(e))
532
- return e(t, Z);
493
+ return Qe.get(t, O);
494
+ if (Dr(e))
495
+ return e(t, O);
533
496
  if (Jt(e))
534
- return e.get(t, Z);
497
+ return e.get(t, O);
535
498
  if (e instanceof RegExp) {
536
499
  if (e.test(t))
537
500
  return t;
538
501
  throw new Q();
539
502
  }
540
- if (Je(e)) {
541
- if (fn(t, e))
503
+ if (_e(e)) {
504
+ if (Kr(t, e))
542
505
  return e;
543
506
  throw new Q();
544
507
  }
545
- return Fe(e) ? Te(e).get(t, Z) : Me(e) ? We(e).get(t, Z) : t;
508
+ return Je(e) ? Te(e).get(t, O) : Fe(e) ? Me(e).get(t, O) : t;
546
509
  }
547
- function ee(t, e, r = !1) {
510
+ function re(t, e, r = !1) {
548
511
  try {
549
- return at(t, e, r);
512
+ return st(t, e, r);
550
513
  } catch (n) {
551
514
  if (n instanceof Q)
552
515
  return;
553
516
  throw n;
554
517
  }
555
518
  }
556
- function ln(t, e, r = !1) {
519
+ function Xr(t, e, r = !1) {
557
520
  try {
558
521
  return z(t, e, r);
559
522
  } catch (n) {
@@ -569,24 +532,24 @@ function z(t, e, r = !1) {
569
532
  throw new Q();
570
533
  }
571
534
  if (e === Boolean)
572
- return ae.set(t, Z);
535
+ return se.set(t, O);
573
536
  if (e === Number)
574
- return se.set(t, Z);
537
+ return ae.set(t, O);
575
538
  if (e === Date)
576
- return Qe.set(t, Z);
539
+ return Ge.set(t, O);
577
540
  if (e === JSON)
578
- return ze.set(t, Z);
541
+ return Qe.set(t, O);
579
542
  if (Jt(e))
580
- return e.set(t, Z);
581
- if (Je(e)) {
543
+ return e.set(t, O);
544
+ if (_e(e)) {
582
545
  if (e !== t)
583
546
  throw new Q();
584
547
  return t.toString();
585
548
  }
549
+ if (Je(e))
550
+ return Te(e).set(t, O);
586
551
  if (Fe(e))
587
- return Te(e).set(t, Z);
588
- if (Me(e))
589
- return We(e).set(t, Z);
552
+ return Me(e).set(t, O);
590
553
  try {
591
554
  return t.toString();
592
555
  } catch {
@@ -596,287 +559,329 @@ function z(t, e, r = !1) {
596
559
  function ie(t) {
597
560
  return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
598
561
  }
599
- function pn(t, e) {
562
+ function tn(t, e) {
600
563
  const r = Array.from(t.matchAll(e));
601
564
  if (r.length === 0)
602
565
  return [t];
603
566
  let n = 0;
604
- const o = r.reduce((s, p) => {
605
- const h = ie(t.slice(n, p.index));
606
- h.length && s.push(h);
607
- const [u] = p;
608
- return s.push(u), n = p.index + u.length, s;
609
- }, []), a = t.slice(n);
610
- return a && o.push(a), o;
611
- }
612
- function dn(t) {
613
- const e = Ke(t.path.value);
567
+ const o = r.reduce((a, u) => {
568
+ const f = ie(t.slice(n, u.index));
569
+ f.length && a.push(f);
570
+ const [p] = u;
571
+ return a.push(p), n = u.index + p.length, a;
572
+ }, []), s = t.slice(n);
573
+ return s && o.push(s), o;
574
+ }
575
+ function en(t) {
576
+ const e = ze(t.path.value);
614
577
  return new RegExp(`^${e}$`, "i");
615
578
  }
616
- function hn(t) {
579
+ function rn(t) {
617
580
  const e = new URLSearchParams(t.query.value);
618
- return Array.from(e.entries()).filter(([, r]) => !ue(r)).map(([r, n]) => {
619
- const o = Ke(n);
581
+ return Array.from(e.entries()).filter(([, r]) => !ce(r)).map(([r, n]) => {
582
+ const o = ze(n);
620
583
  return new RegExp(`${ie(r)}=${o}(&|$)`, "i");
621
584
  });
622
585
  }
623
- function Ke(t) {
624
- return pn(t, new RegExp(Ft, "g")).map((e) => e.startsWith(At) ? Ye(e) : ie(e)).join("");
586
+ function ze(t) {
587
+ return tn(t, new RegExp(Tt, "g")).map((e) => e.startsWith(Pt) ? Ye(e) : ie(e)).join("");
625
588
  }
626
589
  function Ye(t) {
627
- return t.replace(new RegExp(Ft, "g"), ".+");
590
+ return t.replace(new RegExp(Tt, "g"), sn);
628
591
  }
629
- function yn(t, e) {
630
- const r = Xe(e);
631
- return t.replace(r, "(.*)");
592
+ function nn(t, e) {
593
+ const r = Ke(e);
594
+ return t.replace(r, an);
632
595
  }
633
- function ce(t, e) {
634
- return gn(e).test(t.value);
596
+ function ue(t, e) {
597
+ return un(e).test(t.value);
635
598
  }
636
- function ue(t) {
637
- return new RegExp(mn, "g").test(t);
599
+ function ce(t) {
600
+ return new RegExp(on, "g").test(t);
638
601
  }
639
- const Ft = `\\${At}\\??([\\w-_]+)\\${Dt}`, mn = `\\${At}\\?([\\w-_]+)\\${Dt}`;
602
+ const Tt = `\\${Pt}\\??([\\w-_]+)\\${_t}`, on = `\\${Pt}\\?([\\w-_]+)\\${_t}`, sn = ".*", an = "(.*)";
640
603
  function fe(t) {
641
- const [e] = tr(t, new RegExp(Ft, "g"));
604
+ const [e] = Xe(t, new RegExp(Tt, "g"));
642
605
  return e;
643
606
  }
644
- function Xe(t) {
645
- return new RegExp(`\\${At}\\??${t}\\${Dt}`, "g");
607
+ function Ke(t) {
608
+ return new RegExp(`\\${Pt}\\??${t}\\${_t}`, "g");
646
609
  }
647
- function gn(t) {
648
- return new RegExp(`\\${At}\\?${t}\\${Dt}`, "g");
610
+ function un(t) {
611
+ return new RegExp(`\\${Pt}\\?${t}\\${_t}`, "g");
649
612
  }
650
- function tr(t, e) {
651
- return Array.from(t.matchAll(e)).flatMap(([, ...n]) => n.map((o) => W(o) ? o : ""));
613
+ function Xe(t, e) {
614
+ return Array.from(t.matchAll(e)).flatMap(([, ...n]) => n.map((o) => F(o) ? o : ""));
652
615
  }
653
- function Rn(t = "", e = {}) {
654
- return W(t) ? Array.from(t.matchAll(new RegExp(Ft, "g"))).reduce((n, [o, a]) => {
655
- const s = fe(o);
656
- if (!s)
616
+ function cn(t = "", e = {}) {
617
+ return F(t) ? Array.from(t.matchAll(new RegExp(Tt, "g"))).reduce((n, [o, s]) => {
618
+ const a = fe(o);
619
+ if (!a)
657
620
  return n;
658
- const p = un(e, s);
659
- return bt([s], n), n[a] = p, n;
621
+ const u = Yr(e, a);
622
+ return wt([a], n), n[s] = u, n;
660
623
  }, {}) : {};
661
624
  }
662
- function wn(t) {
663
- return mt(t) && typeof t.value == "string";
625
+ function fn(t) {
626
+ return ht(t) && typeof t.value == "string";
664
627
  }
665
628
  function et(t) {
666
- return t === void 0 ? K() : wn(t) ? t : K(t, {});
629
+ return t === void 0 ? Y() : fn(t) ? t : Y(t, {});
667
630
  }
668
- function K(t, e) {
631
+ function Y(t, e) {
669
632
  return {
670
633
  value: t ?? "",
671
- params: Rn(t, e)
634
+ params: cn(t, e)
672
635
  };
673
636
  }
674
- function er(t, e) {
675
- bt(t.params, e.params);
637
+ function tr(t, e) {
638
+ wt(t.params, e.params);
676
639
  const r = `${t.value}${e.value}`;
677
- return K(r, { ...t.params, ...e.params });
640
+ return Y(r, { ...t.params, ...e.params });
678
641
  }
679
- function vn(t, e) {
680
- return er(t, e);
642
+ function ln(t, e) {
643
+ return tr(t, e);
681
644
  }
682
- function En(t, e) {
683
- return bn(t, e), { ...t, ...e };
645
+ class pn extends Error {
646
+ constructor(e) {
647
+ super(`Child property on meta for ${e} conflicts with the parent meta.`);
648
+ }
684
649
  }
685
- function bn(t, e) {
650
+ function dn(t, e) {
651
+ return hn(t, e), { ...t, ...e };
652
+ }
653
+ function hn(t, e) {
686
654
  const r = Object.keys(t).find((n) => n in e && typeof e[n] != typeof t[n]);
687
655
  if (r)
688
- throw new Qr(r);
656
+ throw new pn(r);
689
657
  }
690
- function Sn(t, e) {
691
- bt(t.params, e.params);
692
- const r = [t.value, e.value].filter(W).join("&");
693
- return K(r, { ...t.params, ...e.params });
658
+ function mn(t, e) {
659
+ wt(t.params, e.params);
660
+ const r = [t.value, e.value].filter(F).join("&");
661
+ return Y(r, { ...t.params, ...e.params });
694
662
  }
695
- function Pn(t, e) {
696
- return bt(t, e), { ...t, ...e };
663
+ function yn(t, e) {
664
+ return wt(t, e), { ...t, ...e };
697
665
  }
698
- function rr(t) {
666
+ function er(t) {
699
667
  return "parent" in t && !!t.parent;
700
668
  }
701
- function nr(t) {
669
+ function rr(t) {
702
670
  return "component" in t && !!t.component;
703
671
  }
704
- function be(t) {
672
+ function Pe(t) {
705
673
  return "props" in t && typeof t.props == "function";
706
674
  }
707
- function or(t) {
675
+ function nr(t) {
708
676
  return "components" in t && !!t.components;
709
677
  }
710
- function Se(t) {
678
+ function Ae(t) {
711
679
  return "props" in t && typeof t.props == "object";
712
680
  }
713
- function ar(t, e) {
681
+ function or(t, e) {
714
682
  return {
715
683
  ...e,
716
- path: er(t.path, e.path),
717
- query: Sn(t.query, e.query),
718
- meta: En(t.meta, e.meta),
719
- state: Pn(t.state, e.state),
720
- hash: vn(t.hash, e.hash),
684
+ path: tr(t.path, e.path),
685
+ query: mn(t.query, e.query),
686
+ meta: dn(t.meta, e.meta),
687
+ state: yn(t.state, e.state),
688
+ hash: ln(t.hash, e.hash),
721
689
  matches: [...t.matches, e.matched],
722
690
  host: t.host,
723
691
  depth: t.depth + 1
724
692
  };
725
693
  }
726
- function le() {
727
- return typeof window < "u" && typeof window.document < "u";
694
+ function G(t) {
695
+ return typeof t != "string" ? !1 : /^(https?:\/\/|\/).*/g.test(t);
728
696
  }
729
- function pe(t) {
730
- const e = new URLSearchParams(t);
731
- return {
732
- get: (...r) => e.get(...r),
733
- getAll: (...r) => e.getAll(...r),
734
- set: (...r) => {
735
- e.set(...r);
736
- },
737
- append: (...r) => {
738
- e.append(...r);
739
- },
740
- delete: (...r) => {
741
- e.delete(...r);
742
- },
743
- toString: (...r) => e.toString(...r),
744
- forEach: (...r) => {
745
- e.forEach(...r);
746
- },
747
- entries: (...r) => e.entries(...r),
748
- keys: (...r) => e.keys(...r),
749
- values: (...r) => e.values(...r),
750
- has: (...r) => e.has(...r),
751
- size: e.size,
752
- sort: () => {
753
- e.sort();
754
- },
755
- [Symbol.iterator]: () => e[Symbol.iterator]()
756
- };
697
+ function sr(t) {
698
+ return G(t) ? t : `/${t}`;
699
+ }
700
+ class vt extends Error {
701
+ constructor() {
702
+ super("Router not installed");
703
+ }
704
+ }
705
+ class Rn extends Error {
706
+ /**
707
+ * Constructs a new UseRouteInvalidError instance with a message that specifies both the given and expected route names.
708
+ * This detailed error message aids in quickly identifying and resolving mismatches in route usage.
709
+ * @param routeName - The route name that was incorrectly used.
710
+ * @param actualRouteName - The expected route name that should have been used.
711
+ */
712
+ constructor(e, r) {
713
+ super(`useRoute called with incorrect route. Given ${e}, expected ${r}`);
714
+ }
757
715
  }
758
- function de() {
716
+ function le() {
759
717
  let t = 0;
760
718
  return () => (++t).toString();
761
719
  }
762
- const An = de()();
763
- function kn(t) {
764
- return t === An;
720
+ const gn = le()();
721
+ function wn(t) {
722
+ return t === gn;
765
723
  }
766
- const he = de();
767
- function sr(t) {
724
+ const pe = le();
725
+ function ar(t) {
768
726
  return t === void 0 ? "" : t;
769
727
  }
770
- function gt(t, e) {
771
- const r = he(), n = sr(t.name), o = et(t.path), a = et(t.query), s = et(t.hash), p = t.meta ?? {}, h = t.state ?? {}, u = Ut({ id: r, meta: p, state: h, ...t, props: e }), m = {
728
+ function mt(t, e) {
729
+ const r = pe(), n = ar(t.name), o = et(t.path), s = et(t.query), a = et(t.hash), u = t.meta ?? {}, f = t.state ?? {}, p = Bt({ id: r, meta: u, state: f, ...t, props: e }), y = {
772
730
  id: r,
773
- matched: u,
774
- matches: [u],
731
+ matched: p,
732
+ matches: [p],
775
733
  name: n,
776
734
  path: o,
777
- query: a,
778
- hash: s,
779
- meta: p,
780
- state: h,
735
+ query: s,
736
+ hash: a,
737
+ meta: u,
738
+ state: f,
781
739
  depth: 1,
782
- host: K(),
740
+ host: Y(),
783
741
  prefetch: t.prefetch
784
- }, R = rr(t) ? ar(t.parent, m) : m;
785
- return bt(R.path.params, R.query.params, R.hash.params), R;
742
+ }, d = er(t) ? or(t.parent, y) : y;
743
+ return wt(d.path.params, d.query.params, d.hash.params), d;
786
744
  }
787
- const Vt = { template: "<div>This is component</div>" }, ye = gt({
788
- name: "parentA",
789
- path: "/parentA/[paramA]"
790
- }), ir = gt({
791
- parent: ye,
792
- name: "parentA.childA",
793
- path: "/childA/[?paramB]"
794
- }), xn = gt({
795
- parent: ye,
796
- name: "parentA.childB",
797
- path: "/childB/[paramD]",
798
- component: Vt
799
- }), Nn = gt({
800
- parent: ir,
801
- name: "parentA.childA.grandChildA",
802
- path: "/[paramC]",
803
- component: Vt
804
- });
805
- gt({
806
- name: "parentB",
807
- path: "/parentB",
808
- component: Vt
809
- }), gt({
810
- name: "parentC",
811
- path: "/",
812
- component: Vt
813
- });
814
- const Ln = "lazy", Un = {
815
- components: !0,
816
- props: !1
817
- };
818
- function Lt(t) {
819
- return ["eager", "lazy", "intent"].includes(t);
745
+ function Co(t) {
746
+ const e = pe(), r = ar(t.name), n = et(t.path), o = et(t.query), s = et(t.hash), a = t.meta ?? {}, u = et(t.host), f = Bt({ id: e, meta: {}, state: {}, ...t }), p = {
747
+ id: e,
748
+ matched: f,
749
+ matches: [f],
750
+ name: r,
751
+ host: u,
752
+ path: n,
753
+ query: o,
754
+ hash: s,
755
+ meta: a,
756
+ depth: 1,
757
+ state: {}
758
+ }, y = er(t) ? or(t.parent, p) : p;
759
+ return wt(y.path.params, y.query.params, y.host.params, y.hash.params), y;
820
760
  }
821
- function cr({ routerPrefetch: t, routePrefetch: e, linkPrefetch: r }, n) {
822
- const o = Qt(r, n), a = Qt(e, n), s = Qt(t, n), p = [
823
- o,
824
- a,
825
- s,
826
- Un[n],
827
- Ln
828
- ].reduce((h, u) => Lt(h) ? h : h === !0 && Lt(u) ? u : h === !0 && !Lt(u) ? h : h === void 0 ? u : h, void 0);
829
- return Lt(p) ? p : !1;
761
+ function At() {
762
+ const t = /* @__PURE__ */ new Map();
763
+ return (e) => {
764
+ const r = t.get(e);
765
+ if (!r) {
766
+ const n = Symbol();
767
+ return t.set(e, n), n;
768
+ }
769
+ return r;
770
+ };
830
771
  }
831
- function Qt(t, e) {
832
- return mt(t) ? t[e] : t;
772
+ const vn = At();
773
+ function de(t) {
774
+ const e = vn(t);
775
+ return ({ increment: r = !1 } = {}) => {
776
+ const n = at(e, 0);
777
+ return r && Or(e, n + 1), n;
778
+ };
833
779
  }
834
- class ur extends Error {
780
+ class ir extends Error {
781
+ response;
835
782
  constructor() {
836
- super("Uncaught CallbackContextAbortError");
837
- T(this, "response");
838
- this.response = { status: "ABORT" };
783
+ super("Uncaught CallbackContextAbortError"), this.response = { status: "ABORT" };
839
784
  }
840
785
  }
841
- class yt extends Error {
842
- constructor(r) {
843
- super("Uncaught CallbackContextPushError");
844
- T(this, "response");
845
- this.response = { status: "PUSH", to: r };
786
+ class dt extends Error {
787
+ response;
788
+ constructor(e) {
789
+ super("Uncaught CallbackContextPushError"), this.response = { status: "PUSH", to: e };
846
790
  }
847
791
  }
848
- class Zt extends Error {
849
- constructor(r) {
850
- super("Uncaught CallbackContextRejectionError");
851
- T(this, "response");
852
- this.response = { status: "REJECT", type: r };
792
+ class Ot extends Error {
793
+ response;
794
+ constructor(e) {
795
+ super("Uncaught CallbackContextRejectionError"), this.response = { status: "REJECT", type: e };
853
796
  }
854
797
  }
855
- function fr() {
798
+ function ur() {
856
799
  return { reject: (o) => {
857
- throw new Zt(o);
800
+ throw new Ot(o);
858
801
  }, push: (...o) => {
859
- throw new yt(o);
860
- }, replace: (o, a, s) => {
861
- if (M(o)) {
862
- const u = a ?? {};
863
- throw new yt([o, { ...u, replace: !0 }]);
802
+ throw new dt(o);
803
+ }, replace: (o, s, a) => {
804
+ if (G(o)) {
805
+ const p = s ?? {};
806
+ throw new dt([o, { ...p, replace: !0 }]);
864
807
  }
865
- const p = a, h = s ?? {};
866
- throw new yt([o, p, { ...h, replace: !0 }]);
808
+ const u = s, f = a ?? {};
809
+ throw new dt([o, u, { ...f, replace: !0 }]);
867
810
  }, abort: () => {
868
- throw new ur();
811
+ throw new ir();
869
812
  } };
870
813
  }
871
- function Pe(t) {
872
- try {
873
- const e = t();
874
- return oe(e) ? e.catch((r) => r) : e;
875
- } catch (e) {
876
- return e;
814
+ const kt = (t, e, r) => {
815
+ const n = t.matches, o = e?.matches ?? [];
816
+ return n.at(r)?.id !== o.at(r)?.id;
817
+ }, Lt = (t, e, r) => {
818
+ const n = t.matches, o = e?.matches ?? [];
819
+ return n.at(r)?.id !== o.at(r)?.id;
820
+ }, Ut = (t, e, r) => t.matches.at(r)?.id === e?.matches.at(r)?.id;
821
+ function ke(t) {
822
+ switch (t) {
823
+ case "onBeforeRouteEnter":
824
+ case "onAfterRouteEnter":
825
+ return kt;
826
+ case "onBeforeRouteUpdate":
827
+ case "onAfterRouteUpdate":
828
+ return Ut;
829
+ case "onBeforeRouteLeave":
830
+ case "onAfterRouteLeave":
831
+ return Lt;
832
+ default:
833
+ throw new Error(`Switch is not exhaustive for lifecycle: ${t}`);
877
834
  }
878
835
  }
879
- function lr() {
836
+ class cr {
837
+ onBeforeRouteEnter = /* @__PURE__ */ new Set();
838
+ onBeforeRouteUpdate = /* @__PURE__ */ new Set();
839
+ onBeforeRouteLeave = /* @__PURE__ */ new Set();
840
+ onAfterRouteEnter = /* @__PURE__ */ new Set();
841
+ onAfterRouteUpdate = /* @__PURE__ */ new Set();
842
+ onAfterRouteLeave = /* @__PURE__ */ new Set();
843
+ }
844
+ function En(t, e) {
845
+ const r = new cr();
846
+ return t.matches.forEach((n, o) => {
847
+ n.onBeforeRouteEnter && kt(t, e, o) && pt(n.onBeforeRouteEnter).forEach((s) => r.onBeforeRouteEnter.add(s)), n.onBeforeRouteUpdate && Ut(t, e, o) && pt(n.onBeforeRouteUpdate).forEach((s) => r.onBeforeRouteUpdate.add(s));
848
+ }), e?.matches.forEach((n, o) => {
849
+ n.onBeforeRouteLeave && Lt(t, e, o) && pt(n.onBeforeRouteLeave).forEach((s) => r.onBeforeRouteLeave.add(s));
850
+ }), r;
851
+ }
852
+ function bn(t, e) {
853
+ const r = new cr();
854
+ return t.matches.forEach((n, o) => {
855
+ n.onAfterRouteEnter && kt(t, e, o) && pt(n.onAfterRouteEnter).forEach((s) => r.onAfterRouteEnter.add(s)), n.onAfterRouteUpdate && Ut(t, e, o) && pt(n.onAfterRouteUpdate).forEach((s) => r.onAfterRouteUpdate.add(s));
856
+ }), e?.matches.forEach((n, o) => {
857
+ n.onAfterRouteLeave && Lt(t, e, o) && pt(n.onAfterRouteLeave).forEach((s) => r.onAfterRouteLeave.add(s));
858
+ }), r;
859
+ }
860
+ class Et {
861
+ onBeforeRouteEnter = /* @__PURE__ */ new Set();
862
+ onBeforeRouteUpdate = /* @__PURE__ */ new Set();
863
+ onBeforeRouteLeave = /* @__PURE__ */ new Set();
864
+ onAfterRouteEnter = /* @__PURE__ */ new Set();
865
+ onAfterRouteUpdate = /* @__PURE__ */ new Set();
866
+ onAfterRouteLeave = /* @__PURE__ */ new Set();
867
+ }
868
+ function Sn(t, e, r) {
869
+ const n = new Et();
870
+ return t.matches.forEach((o, s) => {
871
+ kt(t, e, s) && r.onBeforeRouteEnter.forEach((a) => n.onBeforeRouteEnter.add(a)), Ut(t, e, s) && r.onBeforeRouteUpdate.forEach((a) => n.onBeforeRouteUpdate.add(a));
872
+ }), e?.matches.forEach((o, s) => {
873
+ Lt(t, e, s) && r.onBeforeRouteLeave.forEach((a) => n.onBeforeRouteLeave.add(a));
874
+ }), n;
875
+ }
876
+ function Pn(t, e, r) {
877
+ const n = new Et();
878
+ return t.matches.forEach((o, s) => {
879
+ kt(t, e, s) && r.onAfterRouteEnter.forEach((a) => n.onAfterRouteEnter.add(a)), Ut(t, e, s) && r.onAfterRouteUpdate.forEach((a) => n.onAfterRouteUpdate.add(a));
880
+ }), e?.matches.forEach((o, s) => {
881
+ Lt(t, e, s) && r.onAfterRouteLeave.forEach((a) => n.onAfterRouteLeave.add(a));
882
+ }), n;
883
+ }
884
+ function fr() {
880
885
  let t = null;
881
886
  function e(n) {
882
887
  t = n;
@@ -889,696 +894,615 @@ function lr() {
889
894
  runWithContext: r
890
895
  };
891
896
  }
892
- const pr = Symbol();
893
- function Bn() {
894
- const { setVueApp: t, runWithContext: e } = lr(), r = qt(/* @__PURE__ */ new Map()), { push: n, replace: o, reject: a } = fr(), s = (v, i, f) => i.matches.filter((c) => cr({ ...f, routePrefetch: c.prefetch }, "props") === v).flatMap((c) => S(c)).reduce((c, { id: l, name: E, props: A }) => {
895
- if (!A)
896
- return c;
897
- const P = L(l, E, i), g = e(() => Pe(() => A(i, {
898
- push: n,
899
- replace: o,
900
- reject: a,
901
- parent: m(i, !0)
902
- })));
903
- return c[P] = g, c;
904
- }, {}), p = (v) => {
905
- Object.entries(v).forEach(([i, f]) => {
906
- r.set(i, f);
907
- });
908
- }, h = async (v) => {
909
- const i = v.matches.flatMap(S), f = [], c = [];
910
- for (const { id: l, name: E, props: A } of i) {
911
- if (!A)
912
- continue;
913
- const P = L(l, E, v);
914
- if (f.push(P), !r.has(P)) {
915
- const g = e(() => Pe(() => A(v, {
916
- push: n,
917
- replace: o,
918
- reject: a,
919
- parent: m(v)
920
- })));
921
- r.set(P, g);
922
- }
923
- c.push((async () => {
924
- const g = await r.get(P);
925
- if (g instanceof Error)
926
- throw g;
927
- })());
928
- }
929
- U(f);
897
+ const lr = At();
898
+ function An(t) {
899
+ const { setVueApp: e, runWithContext: r } = fr(), n = {
900
+ global: new Et(),
901
+ component: new Et()
902
+ }, { reject: o, push: s, replace: a, abort: u } = ur(), f = (i) => (n.global.onBeforeRouteEnter.add(i), () => n.global.onBeforeRouteEnter.delete(i)), p = (i) => (n.global.onBeforeRouteUpdate.add(i), () => n.global.onBeforeRouteUpdate.delete(i)), y = (i) => (n.global.onBeforeRouteLeave.add(i), () => n.global.onBeforeRouteLeave.delete(i)), d = (i) => (n.global.onAfterRouteEnter.add(i), () => n.global.onAfterRouteEnter.delete(i)), A = (i) => (n.global.onAfterRouteUpdate.add(i), () => n.global.onAfterRouteUpdate.delete(i)), E = (i) => (n.global.onAfterRouteLeave.add(i), () => n.global.onAfterRouteLeave.delete(i));
903
+ async function N({ to: i, from: c }) {
904
+ const { global: b, component: L } = n, m = En(i, c), l = Sn(i, c, b), w = [
905
+ ...l.onBeforeRouteEnter,
906
+ ...m.onBeforeRouteEnter,
907
+ ...l.onBeforeRouteUpdate,
908
+ ...m.onBeforeRouteUpdate,
909
+ ...L.onBeforeRouteUpdate,
910
+ ...l.onBeforeRouteLeave,
911
+ ...m.onBeforeRouteLeave,
912
+ ...L.onBeforeRouteLeave
913
+ ];
930
914
  try {
931
- return await Promise.all(c), { status: "SUCCESS" };
932
- } catch (l) {
933
- if (l instanceof yt || l instanceof Zt)
934
- return l.response;
935
- throw l;
915
+ const v = w.map((U) => r(() => U(i, {
916
+ from: c,
917
+ reject: o,
918
+ push: s,
919
+ replace: a,
920
+ abort: u
921
+ })));
922
+ await Promise.all(v);
923
+ } catch (v) {
924
+ if (v instanceof dt || v instanceof Ot || v instanceof ir)
925
+ return v.response;
926
+ throw v;
936
927
  }
937
- }, u = (v, i, f) => {
938
- const c = L(v, i, f);
939
- return r.get(c);
940
- };
941
- function m(v, i = !1) {
942
- const f = v.matches.at(-2);
943
- if (f)
944
- return be(f) ? {
945
- name: f.name ?? "",
946
- get props() {
947
- return R(f, "default", v, i);
948
- }
949
- } : Se(f) ? {
950
- name: f.name ?? "",
951
- props: new Proxy({}, {
952
- get(c, l) {
953
- return typeof l != "string" ? Reflect.get(c, l) : R(f, l, v, i);
954
- }
955
- })
956
- } : {
957
- name: f.name ?? "",
958
- props: void 0
959
- };
928
+ return {
929
+ status: "SUCCESS"
930
+ };
960
931
  }
961
- function R(v, i, f, c = !1) {
962
- const l = u(v.id, i, f);
963
- if (c && !l) {
964
- const E = v.name ?? "unknown", A = f.name || "unknown";
965
- console.warn(`
966
- Unable to access parent props "${i}" from route "${E}" while prefetching props for route "${A}".
967
- This may occur if the parent route's props were not also prefetched.
968
- `);
932
+ async function R({ to: i, from: c }) {
933
+ const { global: b, component: L } = n, m = bn(i, c), l = Pn(i, c, b), w = [
934
+ ...L.onAfterRouteLeave,
935
+ ...m.onAfterRouteLeave,
936
+ ...l.onAfterRouteLeave,
937
+ ...L.onAfterRouteUpdate,
938
+ ...m.onAfterRouteUpdate,
939
+ ...l.onAfterRouteUpdate,
940
+ ...L.onAfterRouteEnter,
941
+ ...m.onAfterRouteEnter,
942
+ ...l.onAfterRouteEnter
943
+ ];
944
+ try {
945
+ const v = w.map((U) => r(() => U(i, {
946
+ from: c,
947
+ reject: o,
948
+ push: s,
949
+ replace: a
950
+ })));
951
+ await Promise.all(v);
952
+ } catch (v) {
953
+ if (v instanceof dt || v instanceof Ot)
954
+ return v.response;
955
+ throw v;
969
956
  }
970
- return l;
971
- }
972
- function L(v, i, f) {
973
- return [v, i, f.id, JSON.stringify(f.params)].join("-");
974
- }
975
- function S(v) {
976
- return be(v) ? [
977
- {
978
- id: v.id,
979
- name: "default",
980
- props: v.props
981
- }
982
- ] : Se(v) ? Object.entries(v.props).map(([i, f]) => ({ id: v.id, name: i, props: f })) : [];
983
- }
984
- function U(v) {
985
- for (const i of r.keys())
986
- v.includes(i) || r.delete(i);
957
+ return {
958
+ status: "SUCCESS"
959
+ };
987
960
  }
988
961
  return {
989
- getPrefetchProps: s,
990
- setPrefetchProps: p,
991
- getProps: u,
992
- setProps: h,
993
- setVueApp: t
962
+ runBeforeRouteHooks: N,
963
+ runAfterRouteHooks: R,
964
+ addComponentBeforeRouteHook: ({ lifecycle: i, depth: c, hook: b }) => {
965
+ const L = ke(i), m = n.component[i], l = (w, v) => {
966
+ if (L(w, v.from, c))
967
+ return b(w, v);
968
+ };
969
+ return m.add(l), () => m.delete(l);
970
+ },
971
+ addComponentAfterRouteHook: ({ lifecycle: i, depth: c, hook: b }) => {
972
+ const L = ke(i), m = n.component[i], l = (w, v) => {
973
+ if (L(w, v.from, c))
974
+ return b(w, v);
975
+ };
976
+ return m.add(l), () => m.delete(l);
977
+ },
978
+ addGlobalRouteHooks: (i) => {
979
+ i.onBeforeRouteEnter.forEach((c) => f(c)), i.onBeforeRouteUpdate.forEach((c) => p(c)), i.onBeforeRouteLeave.forEach((c) => y(c)), i.onAfterRouteEnter.forEach((c) => d(c)), i.onAfterRouteUpdate.forEach((c) => A(c)), i.onAfterRouteLeave.forEach((c) => E(c));
980
+ },
981
+ onBeforeRouteEnter: f,
982
+ onBeforeRouteUpdate: p,
983
+ onBeforeRouteLeave: y,
984
+ onAfterRouteEnter: d,
985
+ onAfterRouteUpdate: A,
986
+ onAfterRouteLeave: E,
987
+ setVueApp: e
994
988
  };
995
989
  }
996
- function dr() {
997
- const t = it(pr);
998
- if (!t)
999
- throw new Et();
1000
- return t;
990
+ function pr(t) {
991
+ const e = lr(t);
992
+ return () => {
993
+ const r = at(e);
994
+ if (!r)
995
+ throw new vt();
996
+ return r;
997
+ };
1001
998
  }
1002
- const Cn = jr(() => new Promise((t) => {
1003
- t({ default: { template: "foo" } });
1004
- }));
1005
- function Ae(t) {
1006
- return t.name === Cn.name && "__asyncLoader" in t;
999
+ function Le(t, e) {
1000
+ const r = de(t), n = pr(t);
1001
+ return (o) => {
1002
+ const s = r(), u = n().addComponentBeforeRouteHook({ lifecycle: e, hook: o, depth: s - 1 });
1003
+ return It(u), u;
1004
+ };
1007
1005
  }
1008
- const hr = Symbol("visibilityObserver");
1009
- function Vn(t) {
1010
- const e = it(hr);
1011
- if (!e)
1012
- throw new Et();
1013
- return ot(t, (n, o) => {
1014
- n && e.observe(n), o && e.unobserve(o);
1015
- }, { immediate: !0 }), Ht(() => {
1016
- t.value && e.unobserve(t.value);
1017
- }), {
1018
- isElementVisible: O(() => t.value ? e.isElementVisible(t.value) : !1)
1006
+ function Ue(t, e) {
1007
+ const r = de(t), n = pr(t);
1008
+ return (o) => {
1009
+ const s = r(), u = n().addComponentAfterRouteHook({ lifecycle: e, hook: o, depth: s - 1 });
1010
+ return It(u), u;
1019
1011
  };
1020
1012
  }
1021
- function ke(t, e, r) {
1022
- ot(t, (n, o) => {
1023
- n && n.addEventListener(e, r), o && o.removeEventListener(e, r);
1024
- }, { immediate: !0 }), Ht(() => {
1025
- t.value && t.value.removeEventListener(e, r);
1026
- });
1013
+ function kn(t) {
1014
+ const e = Le(t, "onBeforeRouteLeave"), r = Le(t, "onBeforeRouteUpdate"), n = Ue(t, "onAfterRouteLeave"), o = Ue(t, "onAfterRouteUpdate");
1015
+ return {
1016
+ onBeforeRouteLeave: e,
1017
+ onBeforeRouteUpdate: r,
1018
+ onAfterRouteLeave: n,
1019
+ onAfterRouteUpdate: o
1020
+ };
1027
1021
  }
1028
- function Zn(t) {
1029
- const e = /* @__PURE__ */ new Map(), r = Pt(), { getPrefetchProps: n, setPrefetchProps: o } = dr(), { isElementVisible: a } = Vn(r), s = () => {
1030
- const u = Array.from(e.values()).reduce((m, R) => (Object.assign(m, R), m), {});
1031
- o(u);
1022
+ const dr = At();
1023
+ function Ln(t) {
1024
+ const e = dr(t);
1025
+ return () => {
1026
+ const r = at(e);
1027
+ if (!r)
1028
+ throw new vt();
1029
+ return r;
1032
1030
  };
1033
- ot(() => V(t), ({ route: u, ...m }) => {
1034
- e.clear(), u && h("eager", u, m);
1035
- }, { immediate: !0 }), ot(a, (u) => {
1036
- const { route: m, ...R } = V(t);
1037
- !m || !u || h("lazy", m, R);
1038
- }, { immediate: !0 }), ke(r, "focusin", p), ke(r, "mouseover", p);
1039
- function p() {
1040
- const { route: u, ...m } = V(t);
1041
- u && h("intent", u, m);
1042
- }
1043
- function h(u, m, R) {
1044
- On(u, m, R), e.has(u) || e.set(u, n(u, m, R));
1045
- }
1046
- return {
1047
- element: r,
1048
- commit: s
1031
+ }
1032
+ const hr = At();
1033
+ function Un(t) {
1034
+ const e = hr(t);
1035
+ return () => {
1036
+ const r = at(e);
1037
+ if (!r)
1038
+ throw new vt();
1039
+ return r;
1049
1040
  };
1050
1041
  }
1051
- function On(t, e, r) {
1052
- e.matches.forEach((n) => {
1053
- cr({
1054
- ...r,
1055
- routePrefetch: n.prefetch
1056
- }, "components") === t && (nr(n) && Ae(n.component) && n.component.__asyncLoader(), or(n) && Object.values(n.components).forEach((a) => {
1057
- Ae(a) && a.__asyncLoader();
1058
- }));
1059
- });
1042
+ function xt(t) {
1043
+ return () => {
1044
+ const e = at(t);
1045
+ if (!e)
1046
+ throw new vt();
1047
+ return e;
1048
+ };
1060
1049
  }
1061
- const yr = Symbol("isRouterRouteSymbol");
1062
- function jn(t) {
1063
- return typeof t == "object" && t !== null && yr in t;
1064
- }
1065
- function $n(t, e) {
1066
- function r(i, f, c) {
1067
- if (typeof i == "object") {
1068
- const E = {
1069
- ...t.params,
1070
- ...i
1050
+ const mr = Symbol("isRouterRouteSymbol");
1051
+ function xn(t, e) {
1052
+ return typeof e == "object" && e !== null && mr in e && t in e;
1053
+ }
1054
+ function Nn(t, e, r) {
1055
+ function n(h, g, i) {
1056
+ if (typeof h == "object") {
1057
+ const b = {
1058
+ ...e.params,
1059
+ ...h
1071
1060
  };
1072
- return e(t.name, E, f);
1061
+ return r(e.name, b, g);
1073
1062
  }
1074
- const l = {
1075
- ...t.params,
1076
- [i]: f
1063
+ const c = {
1064
+ ...e.params,
1065
+ [h]: g
1077
1066
  };
1078
- return e(t.name, l, c);
1079
- }
1080
- const n = (...i) => {
1081
- const f = new URLSearchParams(t.query);
1082
- f.set(...i), r({}, { query: f });
1083
- }, o = (...i) => {
1084
- const f = new URLSearchParams(t.query);
1085
- f.append(...i), r({}, { query: f });
1086
- }, a = (...i) => {
1087
- const f = new URLSearchParams(t.query);
1088
- f.delete(...i), r({}, { query: f });
1089
- }, { id: s, matched: p, matches: h, name: u, hash: m, href: R } = $r(t), L = O({
1067
+ return r(e.name, c, i);
1068
+ }
1069
+ const o = (...h) => {
1070
+ const g = new URLSearchParams(e.query);
1071
+ g.set(...h), n({}, { query: g });
1072
+ }, s = (...h) => {
1073
+ const g = new URLSearchParams(e.query);
1074
+ g.append(...h), n({}, { query: g });
1075
+ }, a = (...h) => {
1076
+ const g = new URLSearchParams(e.query);
1077
+ g.delete(...h), n({}, { query: g });
1078
+ }, { id: u, matched: f, matches: p, name: y, hash: d, href: A } = jr(e), E = j({
1090
1079
  get() {
1091
- return new Proxy(t.params, {
1092
- set(i, f, c) {
1093
- return r(f, c), !0;
1080
+ return new Proxy(e.params, {
1081
+ set(h, g, i) {
1082
+ return n(g, i), !0;
1094
1083
  }
1095
1084
  });
1096
1085
  },
1097
- set(i) {
1098
- r(i);
1086
+ set(h) {
1087
+ n(h);
1099
1088
  }
1100
- }), S = O({
1089
+ }), N = j({
1101
1090
  get() {
1102
- return new Proxy(t.query, {
1103
- get(i, f, c) {
1104
- switch (f) {
1091
+ return new Proxy(e.query, {
1092
+ get(h, g, i) {
1093
+ switch (g) {
1105
1094
  case "append":
1106
- return o;
1095
+ return s;
1107
1096
  case "set":
1108
- return n;
1097
+ return o;
1109
1098
  case "delete":
1110
1099
  return a;
1111
1100
  default:
1112
- return Reflect.get(i, f, c);
1101
+ return Reflect.get(h, g, i);
1113
1102
  }
1114
1103
  }
1115
1104
  });
1116
1105
  },
1117
- set(i) {
1118
- r({}, { query: i });
1106
+ set(h) {
1107
+ n({}, { query: h });
1119
1108
  }
1120
- }), U = O({
1109
+ }), R = j({
1121
1110
  get() {
1122
- return new Proxy(t.state, {
1123
- set(i, f, c) {
1124
- return r({}, { state: { ...t.state, [f]: c } }), !0;
1111
+ return new Proxy(e.state, {
1112
+ set(h, g, i) {
1113
+ return n({}, { state: { ...e.state, [g]: i } }), !0;
1125
1114
  }
1126
1115
  });
1127
1116
  },
1128
- set(i) {
1129
- r({}, { state: i });
1117
+ set(h) {
1118
+ n({}, { state: h });
1130
1119
  }
1131
1120
  });
1132
- return qt({
1133
- id: s,
1134
- matched: p,
1135
- matches: h,
1136
- state: U,
1137
- query: S,
1138
- hash: m,
1139
- params: L,
1140
- name: u,
1141
- href: R,
1142
- update: r,
1143
- [yr]: !0
1121
+ return Dt({
1122
+ id: u,
1123
+ matched: f,
1124
+ matches: p,
1125
+ state: R,
1126
+ query: N,
1127
+ hash: d,
1128
+ params: E,
1129
+ name: y,
1130
+ href: A,
1131
+ update: n,
1132
+ [mr]: !0,
1133
+ [t]: !0
1134
+ });
1135
+ }
1136
+ function he(t) {
1137
+ return (e, r, { exact: n } = {}) => xn(t, e) ? r === void 0 ? !0 : n ? e.matched.name === r : e.matches.map((o) => o.name).includes(r) : !1;
1138
+ }
1139
+ function Ft(t) {
1140
+ const e = xt(t), r = he(t);
1141
+ return (n, o) => {
1142
+ const s = e();
1143
+ function a() {
1144
+ if (!n)
1145
+ return;
1146
+ if (!r(s.route, n, o))
1147
+ throw new Rn(n, s.route.name);
1148
+ }
1149
+ return ot(s.route, a, { immediate: !0, deep: !0 }), s.route;
1150
+ };
1151
+ }
1152
+ function me(t) {
1153
+ const e = Ft(t), r = xt(t), n = Un(t), o = de(t), s = Ln(t);
1154
+ return gt((a, u) => {
1155
+ const f = e(), p = r(), y = n(), d = o({ increment: !0 });
1156
+ Zr(async () => {
1157
+ await p.start();
1158
+ });
1159
+ const { getRouteComponents: A } = s(), E = j(() => {
1160
+ if (!p.started.value)
1161
+ return null;
1162
+ if (y.value)
1163
+ return y.value.component;
1164
+ const N = f.matches.at(d);
1165
+ if (!N)
1166
+ return null;
1167
+ const R = A(N), k = a.name ?? "default";
1168
+ return R[k];
1169
+ });
1170
+ return () => u.slots.default ? u.slots.default({
1171
+ route: f,
1172
+ component: E,
1173
+ rejection: y.value
1174
+ }) : E.value ? X(E.value) : null;
1175
+ }, {
1176
+ name: "RouterView",
1177
+ // The prop types are defined above. Vue requires manually defining the prop names themselves here to distinguish from attrs
1178
+ // eslint-disable-next-line vue/require-prop-types
1179
+ props: ["name"]
1144
1180
  });
1145
1181
  }
1146
- function re(t, e, { exact: r } = {}) {
1147
- return jn(t) ? e === void 0 ? !0 : r ? t.matched.name === e : t.matches.map((n) => n.name).includes(e) : !1;
1182
+ const yr = At();
1183
+ function Rr(t) {
1184
+ const e = yr(t);
1185
+ return () => {
1186
+ const r = at(e);
1187
+ if (!r)
1188
+ throw new vt();
1189
+ return r;
1190
+ };
1191
+ }
1192
+ const Bn = "lazy", Vn = {
1193
+ components: !0,
1194
+ props: !1
1195
+ };
1196
+ function Nt(t) {
1197
+ return ["eager", "lazy", "intent"].includes(t);
1198
+ }
1199
+ function gr({ routerPrefetch: t, routePrefetch: e, linkPrefetch: r }, n) {
1200
+ const o = zt(r, n), s = zt(e, n), a = zt(t, n), u = [
1201
+ o,
1202
+ s,
1203
+ a,
1204
+ Vn[n],
1205
+ Bn
1206
+ ].reduce((f, p) => Nt(f) ? f : f === !0 && Nt(p) ? p : f === !0 && !Nt(p) ? f : f === void 0 ? p : f, void 0);
1207
+ return Nt(u) ? u : !1;
1208
+ }
1209
+ function zt(t, e) {
1210
+ return ht(t) ? t[e] : t;
1211
+ }
1212
+ const Cn = Hr(() => new Promise((t) => {
1213
+ t({ default: { template: "foo" } });
1214
+ }));
1215
+ function xe(t) {
1216
+ return t.name === Cn.name && "__asyncLoader" in t;
1217
+ }
1218
+ const wr = Symbol("visibilityObserver");
1219
+ function On(t) {
1220
+ const e = at(wr);
1221
+ if (!e)
1222
+ throw new vt();
1223
+ return ot(t, (n, o) => {
1224
+ n && e.observe(n), o && e.unobserve(o);
1225
+ }, { immediate: !0 }), It(() => {
1226
+ t.value && e.unobserve(t.value);
1227
+ }), {
1228
+ isElementVisible: j(() => t.value ? e.isElementVisible(t.value) : !1)
1229
+ };
1230
+ }
1231
+ function Ne(t, e, r) {
1232
+ ot(t, (n, o) => {
1233
+ n && n.addEventListener(e, r), o && o.removeEventListener(e, r);
1234
+ }, { immediate: !0 }), It(() => {
1235
+ t.value && t.value.removeEventListener(e, r);
1236
+ });
1148
1237
  }
1149
- function me(...t) {
1238
+ function jn(t) {
1239
+ const e = Rr(t);
1240
+ return (r) => {
1241
+ const n = /* @__PURE__ */ new Map(), o = St(), { getPrefetchProps: s, setPrefetchProps: a } = e(), { isElementVisible: u } = On(o), f = () => {
1242
+ const d = Array.from(n.values()).reduce((A, E) => (Object.assign(A, E), A), {});
1243
+ a(d);
1244
+ };
1245
+ ot(() => C(r), ({ route: d, ...A }) => {
1246
+ n.clear(), d && y("eager", d, A);
1247
+ }, { immediate: !0 }), ot(u, (d) => {
1248
+ const { route: A, ...E } = C(r);
1249
+ !A || !d || y("lazy", A, E);
1250
+ }, { immediate: !0 }), Ne(o, "focusin", p), Ne(o, "mouseover", p);
1251
+ function p() {
1252
+ const { route: d, ...A } = C(r);
1253
+ d && y("intent", d, A);
1254
+ }
1255
+ function y(d, A, E) {
1256
+ Zn(d, A, E), n.has(d) || n.set(d, s(d, A, E));
1257
+ }
1258
+ return {
1259
+ element: o,
1260
+ commit: f
1261
+ };
1262
+ };
1263
+ }
1264
+ function Zn(t, e, r) {
1265
+ e.matches.forEach((n) => {
1266
+ gr({
1267
+ ...r,
1268
+ routePrefetch: n.prefetch
1269
+ }, "components") === t && (rr(n) && xe(n.component) && n.component.__asyncLoader(), nr(n) && Object.values(n.components).forEach((s) => {
1270
+ xe(s) && s.__asyncLoader();
1271
+ }));
1272
+ });
1273
+ }
1274
+ function ye(...t) {
1150
1275
  const e = new URLSearchParams();
1151
1276
  for (const r of t) {
1152
1277
  const n = new URLSearchParams(r);
1153
- for (const [o, a] of n.entries())
1154
- e.append(o, a);
1278
+ for (const [o, s] of n.entries())
1279
+ e.append(o, s);
1155
1280
  }
1156
1281
  return e;
1157
1282
  }
1158
- function _n(t, e = {}, r = {}) {
1159
- const n = It(), o = O(() => {
1160
- const i = V(t);
1161
- return typeof i != "string" ? i : M(i) ? n.find(i, V(r)) : n.resolve(i, V(e), V(r));
1162
- }), a = O(() => {
1163
- if (o.value)
1164
- return o.value.href;
1165
- const i = V(t);
1166
- if (M(i))
1167
- return i;
1168
- console.error(new Error("Failed to resolve route in RouterLink."));
1169
- }), s = O(() => re(n.route) && n.route.matches.some((i) => {
1170
- var f;
1171
- return i.id === ((f = o.value) == null ? void 0 : f.id);
1172
- })), p = O(() => {
1173
- var i;
1174
- return n.route.id === ((i = o.value) == null ? void 0 : i.id);
1175
- }), h = O(() => re(n.route) && en(o.value) && n.route.href.startsWith(o.value.href)), u = O(() => {
1176
- var i;
1177
- return n.route.href === ((i = o.value) == null ? void 0 : i.href);
1178
- }), m = O(() => !!a.value && n.isExternal(a.value)), R = O(() => {
1179
- const i = V(t);
1180
- return typeof i != "string" || M(i) ? V(e) : V(r);
1181
- }), { element: L, commit: S } = Zn(() => ({
1182
- route: o.value,
1183
- routerPrefetch: n.prefetch,
1184
- linkPrefetch: R.value.prefetch
1185
- })), U = (i) => {
1186
- S();
1187
- const f = {
1188
- replace: (i == null ? void 0 : i.replace) ?? R.value.replace,
1189
- query: me(R.value.query, i == null ? void 0 : i.query),
1190
- hash: (i == null ? void 0 : i.hash) ?? R.value.hash,
1191
- state: { ...R.value.state, ...i == null ? void 0 : i.state }
1192
- }, c = V(t);
1193
- return M(c) || typeof c == "object" ? n.push(c, f) : n.push(c, V(e), f);
1194
- };
1195
- return {
1196
- element: L,
1197
- route: o,
1198
- href: a,
1199
- isMatch: s,
1200
- isExactMatch: p,
1201
- isActive: h,
1202
- isExactActive: u,
1203
- isExternal: m,
1204
- push: U,
1205
- replace: (i) => U({ ...i, replace: !0 })
1283
+ function vr(t) {
1284
+ const e = xt(t), r = jn(t), n = he(t);
1285
+ return (o, s = {}, a = {}) => {
1286
+ const u = e(), f = j(() => {
1287
+ const c = C(o);
1288
+ return typeof c != "string" ? c : G(c) ? u.find(c, C(a)) : u.resolve(c, C(s), C(a));
1289
+ }), p = j(() => {
1290
+ if (f.value)
1291
+ return f.value.href;
1292
+ const c = C(o);
1293
+ if (G(c))
1294
+ return c;
1295
+ console.error(new Error("Failed to resolve route in RouterLink."));
1296
+ }), y = j(() => n(u.route) && u.route.matches.some((c) => c.id === f.value?.id)), d = j(() => u.route.id === f.value?.id), A = j(() => n(u.route) && Tr(f.value) && u.route.href.startsWith(f.value.href)), E = j(() => u.route.href === f.value?.href), N = j(() => !!p.value && u.isExternal(p.value)), R = j(() => {
1297
+ const c = C(o);
1298
+ return typeof c != "string" || G(c) ? C(s) : C(a);
1299
+ }), { element: k, commit: h } = r(() => ({
1300
+ route: f.value,
1301
+ routerPrefetch: u.prefetch,
1302
+ linkPrefetch: R.value.prefetch
1303
+ })), g = (c) => {
1304
+ h();
1305
+ const b = {
1306
+ replace: c?.replace ?? R.value.replace,
1307
+ query: ye(R.value.query, c?.query),
1308
+ hash: c?.hash ?? R.value.hash,
1309
+ state: { ...R.value.state, ...c?.state }
1310
+ }, L = C(o);
1311
+ return G(L) || typeof L == "object" ? u.push(L, b) : u.push(L, C(s), b);
1312
+ };
1313
+ return {
1314
+ element: k,
1315
+ route: f,
1316
+ href: p,
1317
+ isMatch: y,
1318
+ isExactMatch: d,
1319
+ isActive: A,
1320
+ isExactActive: E,
1321
+ isExternal: N,
1322
+ push: g,
1323
+ replace: (c) => g({ ...c, replace: !0 })
1324
+ };
1206
1325
  };
1207
1326
  }
1208
- const qn = ["href"], Hn = {
1209
- name: "RouterLink"
1210
- }, In = /* @__PURE__ */ vt({
1211
- ...Hn,
1212
- props: {
1213
- to: {},
1214
- prefetch: { type: [Boolean, String, Object], default: void 0 },
1215
- query: {},
1216
- hash: {},
1217
- replace: { type: Boolean },
1218
- state: {}
1219
- },
1220
- setup(t) {
1221
- const e = t, r = It(), n = O(() => U(e.to)), o = O(() => v(e.to)), a = O(() => {
1222
- const { to: f, ...c } = e;
1223
- return c;
1224
- }), { element: s, isMatch: p, isExactMatch: h, isActive: u, isExactActive: m, isExternal: R, push: L } = _n(() => typeof e.to == "function" ? e.to(r.resolve) : e.to, a), S = O(() => ({
1225
- "router-link--match": p.value,
1226
- "router-link--exact-match": h.value,
1227
- "router-link--active": u.value,
1228
- "router-link--exact-active": m.value
1327
+ function Er(t) {
1328
+ const e = xt(t), r = vr(t);
1329
+ return gt((n, o) => {
1330
+ const s = e(), a = j(() => h(n.to)), u = j(() => g(n.to)), f = j(() => {
1331
+ const { to: c, ...b } = n;
1332
+ return b;
1333
+ }), { element: p, isMatch: y, isExactMatch: d, isActive: A, isExactActive: E, isExternal: N, push: R } = r(() => typeof n.to == "function" ? n.to(s.resolve) : n.to, f), k = j(() => ({
1334
+ "router-link--match": y.value,
1335
+ "router-link--exact-match": d.value,
1336
+ "router-link--active": A.value,
1337
+ "router-link--exact-active": E.value
1229
1338
  }));
1230
- function U(f) {
1231
- if (typeof f == "function") {
1232
- const c = f(r.resolve);
1233
- return U(c);
1339
+ function h(c) {
1340
+ if (typeof c == "function") {
1341
+ const b = c(s.resolve);
1342
+ return h(b);
1234
1343
  }
1235
- return M(f) ? r.find(f) : f;
1344
+ return G(c) ? s.find(c) : c;
1236
1345
  }
1237
- function v(f) {
1238
- if (typeof f == "function") {
1239
- const c = f(r.resolve);
1240
- return v(c);
1346
+ function g(c) {
1347
+ if (typeof c == "function") {
1348
+ const b = c(s.resolve);
1349
+ return g(b);
1241
1350
  }
1242
- return M(f) ? f : f == null ? void 0 : f.href;
1351
+ return G(c) ? c : c?.href;
1243
1352
  }
1244
- function i(f) {
1245
- f.preventDefault(), L();
1246
- }
1247
- return (f, c) => ($e(), _r("a", {
1248
- ref_key: "element",
1249
- ref: s,
1250
- href: o.value,
1251
- class: qr(["router-link", S.value]),
1252
- onClick: i
1253
- }, [
1254
- _e(f.$slots, "default", qe(Hr({ route: n.value, isMatch: tt(p), isExactMatch: tt(h), isActive: tt(u), isExactActive: tt(m), isExternal: tt(R) })))
1255
- ], 10, qn));
1256
- }
1257
- }), mr = Symbol();
1258
- function Dn() {
1259
- const t = it(mr);
1260
- if (!t)
1261
- throw new Et();
1262
- return t;
1263
- }
1264
- function ge(t, e) {
1265
- const r = It();
1266
- function n() {
1267
- if (!t)
1268
- return;
1269
- if (!re(r.route, t, e))
1270
- throw new zr(t, r.route.name);
1271
- }
1272
- return ot(r.route, n, { immediate: !0, deep: !0 }), r.route;
1273
- }
1274
- const gr = Symbol();
1275
- function Re() {
1276
- return it(gr, 0);
1277
- }
1278
- function Jn(t, e, r) {
1279
- return vt({
1280
- name: "PropsWrapper",
1281
- expose: [],
1282
- setup() {
1283
- const n = Ir(), o = dr(), a = ge();
1284
- return () => {
1285
- const s = o.getProps(t.id, e, a);
1286
- return s instanceof Error ? "" : oe(s) ? n != null && n.suspense ? dt(Tn, { component: r, props: s }) : dt(Fn, { component: r, props: s }) : dt(r, s);
1287
- };
1353
+ function i(c) {
1354
+ c.preventDefault(), R();
1288
1355
  }
1356
+ return () => X(
1357
+ "a",
1358
+ {
1359
+ href: u.value,
1360
+ class: ["router-link", k.value],
1361
+ ref: p,
1362
+ onClick: i
1363
+ },
1364
+ o.slots.default?.({
1365
+ route: a.value,
1366
+ isMatch: y.value,
1367
+ isExactMatch: d.value,
1368
+ isActive: A.value,
1369
+ isExactActive: E.value,
1370
+ isExternal: N.value
1371
+ })
1372
+ );
1373
+ }, {
1374
+ name: "RouterLink",
1375
+ // The prop types are defined above. Vue requires manually defining the prop names themselves here to distinguish from attrs
1376
+ // eslint-disable-next-line vue/require-prop-types
1377
+ props: ["to", "prefetch", "query", "hash", "replace", "state"]
1289
1378
  });
1290
1379
  }
1291
- const Fn = vt((t) => {
1292
- const e = Pt();
1293
- return ot(() => t.props, async (r) => {
1294
- e.value = await r;
1295
- }, { immediate: !0, deep: !0 }), () => e.value instanceof Error ? "" : e.value ? dt(t.component, e.value) : "";
1296
- }, {
1297
- props: ["component", "props"]
1298
- }), Tn = vt(async (t) => {
1299
- const e = Pt();
1300
- return e.value = await t.props, ot(() => e.value, async (r) => {
1301
- e.value = await r;
1302
- }, { deep: !0 }), () => e.value instanceof Error ? "" : e.value ? dt(t.component, e.value) : "";
1303
- }, {
1304
- props: ["component", "props"]
1305
- }), Rr = Symbol();
1306
- function Mn() {
1307
- const t = /* @__PURE__ */ new Map();
1308
- return {
1309
- getRouteComponents: (r) => {
1310
- const n = t.get(r.id);
1311
- if (n)
1312
- return n;
1313
- const o = Wn(r);
1314
- return t.set(r.id, o), o;
1315
- }
1380
+ function Hn(t) {
1381
+ const e = Ft(t);
1382
+ return (r, n = String) => {
1383
+ const o = e(), s = j({
1384
+ get() {
1385
+ const u = o.query.get(C(r));
1386
+ return u === null ? null : re(u, n);
1387
+ },
1388
+ set(u) {
1389
+ o.query.set(C(r), z(u, n));
1390
+ }
1391
+ }), a = j({
1392
+ get() {
1393
+ return o.query.getAll(C(r)).map((f) => re(f, n)).filter((f) => f !== null);
1394
+ },
1395
+ set(u) {
1396
+ const f = new URLSearchParams(o.query);
1397
+ f.delete(C(r)), u.forEach((p) => {
1398
+ f.append(C(r), z(p, n));
1399
+ }), o.query = f;
1400
+ }
1401
+ });
1402
+ return {
1403
+ value: s,
1404
+ values: a,
1405
+ remove: () => {
1406
+ o.query.delete(C(r));
1407
+ }
1408
+ };
1316
1409
  };
1317
1410
  }
1318
- function Wn(t) {
1319
- return or(t) ? xe(t, t.components) : nr(t) ? xe(t, { default: t.component }) : { default: wr };
1320
- }
1321
- function xe(t, e) {
1322
- return Object.fromEntries(
1323
- Object.entries(e).map(([r, n]) => [r, Jn(t, r, n)])
1324
- );
1411
+ function $n(t) {
1412
+ const e = typeof t == "object" ? t.key : t, {
1413
+ onBeforeRouteLeave: r,
1414
+ onBeforeRouteUpdate: n,
1415
+ onAfterRouteLeave: o,
1416
+ onAfterRouteUpdate: s
1417
+ } = kn(e), a = he(e), u = me(e), f = Er(e), p = Ft(e), y = xt(e), d = Hn(e), A = vr(e);
1418
+ return {
1419
+ onBeforeRouteLeave: r,
1420
+ onBeforeRouteUpdate: n,
1421
+ onAfterRouteLeave: o,
1422
+ onAfterRouteUpdate: s,
1423
+ isRoute: a,
1424
+ RouterView: u,
1425
+ RouterLink: f,
1426
+ useRoute: p,
1427
+ useRouter: y,
1428
+ useQueryValue: d,
1429
+ useLink: A
1430
+ };
1325
1431
  }
1326
- function Gn() {
1327
- const t = it(Rr);
1328
- if (!t)
1329
- throw new Et();
1330
- return t;
1432
+ function Oo(t) {
1433
+ return {
1434
+ routes: t.routes ?? [],
1435
+ rejections: t.rejections ?? {},
1436
+ ...t
1437
+ };
1331
1438
  }
1332
- const Qn = {
1333
- name: "RouterView"
1334
- }, wr = /* @__PURE__ */ vt({
1335
- ...Qn,
1336
- props: {
1337
- name: { default: "default" }
1338
- },
1339
- setup(t) {
1340
- const e = ge(), r = It(), n = Dn(), o = Re();
1341
- Dr(async () => {
1342
- await r.start();
1343
- });
1344
- const { getRouteComponents: a } = Gn();
1345
- Jr(gr, o + 1);
1346
- const s = O(() => {
1347
- if (!r.started.value)
1348
- return null;
1349
- if (n.value)
1350
- return n.value.component;
1351
- const p = e.matches.at(o);
1352
- return p ? a(p)[t.name] : null;
1353
- });
1354
- return (p, h) => s.value ? _e(p.$slots, "default", qe(Tr({ key: 0 }, { route: tt(e), component: s.value, rejection: tt(n) })), () => [
1355
- ($e(), Mr(Wr(s.value)))
1356
- ]) : Fr("", !0);
1357
- }
1358
- });
1359
- function Do(t, e = String) {
1360
- const r = ge(), n = O({
1361
- get() {
1362
- const a = r.query.get(V(t));
1363
- return a === null ? null : ee(a, e);
1364
- },
1365
- set(a) {
1366
- r.query.set(V(t), z(a, e));
1367
- }
1368
- }), o = O({
1369
- get() {
1370
- return r.query.getAll(V(t)).map((s) => ee(s, e)).filter((s) => s !== null);
1439
+ function qn(t) {
1440
+ return {
1441
+ get: (e, { invalid: r }) => {
1442
+ for (const n of t) {
1443
+ const o = re(e, n);
1444
+ if (o !== void 0)
1445
+ return o;
1446
+ }
1447
+ throw r(`Value ${e} does not satisfy any of the possible values`);
1371
1448
  },
1372
- set(a) {
1373
- const s = new URLSearchParams(r.query);
1374
- s.delete(V(t)), a.forEach((p) => {
1375
- s.append(V(t), z(p, e));
1376
- }), r.query = s;
1449
+ set: (e, { invalid: r }) => {
1450
+ for (const n of t) {
1451
+ const o = Xr(e, n);
1452
+ if (o !== void 0)
1453
+ return o;
1454
+ }
1455
+ throw r(`Value ${e} does not satisfy any of the possible values`);
1377
1456
  }
1378
- });
1457
+ };
1458
+ }
1459
+ const In = {
1460
+ separator: ","
1461
+ };
1462
+ function jo(t, e = {}) {
1463
+ const { separator: r } = { ...In, ...e }, n = qn(t);
1379
1464
  return {
1380
- value: n,
1381
- values: o,
1382
- remove: () => {
1383
- r.query.delete(V(t));
1465
+ get: (o, s) => o.split(r).map((a) => n.get(a, s)),
1466
+ set: (o, s) => {
1467
+ if (!Array.isArray(o))
1468
+ throw s.invalid("Expected an array");
1469
+ return o.map((a) => n.set(a, s)).join(r);
1384
1470
  }
1385
1471
  };
1386
1472
  }
1387
- class st {
1388
- constructor() {
1389
- T(this, "onBeforeRouteEnter", /* @__PURE__ */ new Set());
1390
- T(this, "onBeforeRouteUpdate", /* @__PURE__ */ new Set());
1391
- T(this, "onBeforeRouteLeave", /* @__PURE__ */ new Set());
1392
- T(this, "onAfterRouteEnter", /* @__PURE__ */ new Set());
1393
- T(this, "onAfterRouteUpdate", /* @__PURE__ */ new Set());
1394
- T(this, "onAfterRouteLeave", /* @__PURE__ */ new Set());
1395
- }
1396
- }
1397
- const kt = (t, e, r) => {
1398
- var a, s;
1399
- const n = t.matches, o = (e == null ? void 0 : e.matches) ?? [];
1400
- return ((a = n.at(r)) == null ? void 0 : a.id) !== ((s = o.at(r)) == null ? void 0 : s.id);
1401
- }, xt = (t, e, r) => {
1402
- var a, s;
1403
- const n = t.matches, o = (e == null ? void 0 : e.matches) ?? [];
1404
- return ((a = n.at(r)) == null ? void 0 : a.id) !== ((s = o.at(r)) == null ? void 0 : s.id);
1405
- }, Nt = (t, e, r) => {
1406
- var n, o;
1407
- return ((n = t.matches.at(r)) == null ? void 0 : n.id) === ((o = e == null ? void 0 : e.matches.at(r)) == null ? void 0 : o.id);
1473
+ const Dn = {
1474
+ separator: ","
1408
1475
  };
1409
- function Ne(t) {
1410
- switch (t) {
1411
- case "onBeforeRouteEnter":
1412
- case "onAfterRouteEnter":
1413
- return kt;
1414
- case "onBeforeRouteUpdate":
1415
- case "onAfterRouteUpdate":
1416
- return Nt;
1417
- case "onBeforeRouteLeave":
1418
- case "onAfterRouteLeave":
1419
- return xt;
1420
- default:
1421
- throw new Error(`Switch is not exhaustive for lifecycle: ${t}`);
1422
- }
1423
- }
1424
- function zn(t, e) {
1425
- const r = new st();
1426
- return t.matches.forEach((n, o) => {
1427
- n.onBeforeRouteEnter && kt(t, e, o) && ht(n.onBeforeRouteEnter).forEach((a) => r.onBeforeRouteEnter.add(a)), n.onBeforeRouteUpdate && Nt(t, e, o) && ht(n.onBeforeRouteUpdate).forEach((a) => r.onBeforeRouteUpdate.add(a));
1428
- }), e == null || e.matches.forEach((n, o) => {
1429
- n.onBeforeRouteLeave && xt(t, e, o) && ht(n.onBeforeRouteLeave).forEach((a) => r.onBeforeRouteLeave.add(a));
1430
- }), r;
1431
- }
1432
- function Kn(t, e) {
1433
- const r = new st();
1434
- return t.matches.forEach((n, o) => {
1435
- n.onAfterRouteEnter && kt(t, e, o) && ht(n.onAfterRouteEnter).forEach((a) => r.onAfterRouteEnter.add(a)), n.onAfterRouteUpdate && Nt(t, e, o) && ht(n.onAfterRouteUpdate).forEach((a) => r.onAfterRouteUpdate.add(a));
1436
- }), e == null || e.matches.forEach((n, o) => {
1437
- n.onAfterRouteLeave && xt(t, e, o) && ht(n.onAfterRouteLeave).forEach((a) => r.onAfterRouteLeave.add(a));
1438
- }), r;
1439
- }
1440
- function Yn(t, e, r) {
1441
- const n = new st();
1442
- return t.matches.forEach((o, a) => {
1443
- kt(t, e, a) && r.onBeforeRouteEnter.forEach((s) => n.onBeforeRouteEnter.add(s)), Nt(t, e, a) && r.onBeforeRouteUpdate.forEach((s) => n.onBeforeRouteUpdate.add(s));
1444
- }), e == null || e.matches.forEach((o, a) => {
1445
- xt(t, e, a) && r.onBeforeRouteLeave.forEach((s) => n.onBeforeRouteLeave.add(s));
1446
- }), n;
1447
- }
1448
- function Xn(t, e, r) {
1449
- const n = new st();
1450
- return t.matches.forEach((o, a) => {
1451
- kt(t, e, a) && r.onAfterRouteEnter.forEach((s) => n.onAfterRouteEnter.add(s)), Nt(t, e, a) && r.onAfterRouteUpdate.forEach((s) => n.onAfterRouteUpdate.add(s));
1452
- }), e == null || e.matches.forEach((o, a) => {
1453
- xt(t, e, a) && r.onAfterRouteLeave.forEach((s) => n.onAfterRouteLeave.add(s));
1454
- }), n;
1455
- }
1456
- const vr = Symbol();
1457
- function to() {
1458
- const { setVueApp: t, runWithContext: e } = lr(), r = {
1459
- global: new st(),
1460
- component: new st()
1461
- }, { reject: n, push: o, replace: a, abort: s } = fr(), p = (c) => (r.global.onBeforeRouteEnter.add(c), () => r.global.onBeforeRouteEnter.delete(c)), h = (c) => (r.global.onBeforeRouteUpdate.add(c), () => r.global.onBeforeRouteUpdate.delete(c)), u = (c) => (r.global.onBeforeRouteLeave.add(c), () => r.global.onBeforeRouteLeave.delete(c)), m = (c) => (r.global.onAfterRouteEnter.add(c), () => r.global.onAfterRouteEnter.delete(c)), R = (c) => (r.global.onAfterRouteUpdate.add(c), () => r.global.onAfterRouteUpdate.delete(c)), L = (c) => (r.global.onAfterRouteLeave.add(c), () => r.global.onAfterRouteLeave.delete(c));
1462
- async function S({ to: c, from: l }) {
1463
- const { global: E, component: A } = r, P = zn(c, l), g = Yn(c, l, E), d = [
1464
- ...g.onBeforeRouteEnter,
1465
- ...P.onBeforeRouteEnter,
1466
- ...g.onBeforeRouteUpdate,
1467
- ...P.onBeforeRouteUpdate,
1468
- ...A.onBeforeRouteUpdate,
1469
- ...g.onBeforeRouteLeave,
1470
- ...P.onBeforeRouteLeave,
1471
- ...A.onBeforeRouteLeave
1472
- ];
1473
- try {
1474
- const y = d.map((k) => e(() => k(c, {
1475
- from: l,
1476
- reject: n,
1477
- push: o,
1478
- replace: a,
1479
- abort: s
1480
- })));
1481
- await Promise.all(y);
1482
- } catch (y) {
1483
- if (y instanceof yt || y instanceof Zt || y instanceof ur)
1484
- return y.response;
1485
- throw y;
1486
- }
1487
- return {
1488
- status: "SUCCESS"
1489
- };
1490
- }
1491
- async function U({ to: c, from: l }) {
1492
- const { global: E, component: A } = r, P = Kn(c, l), g = Xn(c, l, E), d = [
1493
- ...A.onAfterRouteLeave,
1494
- ...P.onAfterRouteLeave,
1495
- ...g.onAfterRouteLeave,
1496
- ...A.onAfterRouteUpdate,
1497
- ...P.onAfterRouteUpdate,
1498
- ...g.onAfterRouteUpdate,
1499
- ...A.onAfterRouteEnter,
1500
- ...P.onAfterRouteEnter,
1501
- ...g.onAfterRouteEnter
1502
- ];
1503
- try {
1504
- const y = d.map((k) => e(() => k(c, {
1505
- from: l,
1506
- reject: n,
1507
- push: o,
1508
- replace: a
1509
- })));
1510
- await Promise.all(y);
1511
- } catch (y) {
1512
- if (y instanceof yt || y instanceof Zt)
1513
- return y.response;
1514
- throw y;
1515
- }
1516
- return {
1517
- status: "SUCCESS"
1518
- };
1519
- }
1476
+ function Zo(t, e = {}) {
1477
+ const { separator: r } = { ...Dn, ...e };
1520
1478
  return {
1521
- runBeforeRouteHooks: S,
1522
- runAfterRouteHooks: U,
1523
- addComponentBeforeRouteHook: ({ lifecycle: c, depth: l, hook: E }) => {
1524
- const A = Ne(c), P = r.component[c], g = (d, y) => {
1525
- if (A(d, y.from, l))
1526
- return E(d, y);
1527
- };
1528
- return P.add(g), () => P.delete(g);
1529
- },
1530
- addComponentAfterRouteHook: ({ lifecycle: c, depth: l, hook: E }) => {
1531
- const A = Ne(c), P = r.component[c], g = (d, y) => {
1532
- if (A(d, y.from, l))
1533
- return E(d, y);
1534
- };
1535
- return P.add(g), () => P.delete(g);
1536
- },
1537
- addGlobalRouteHooks: (c) => {
1538
- c.onBeforeRouteEnter.forEach((l) => p(l)), c.onBeforeRouteUpdate.forEach((l) => h(l)), c.onBeforeRouteLeave.forEach((l) => u(l)), c.onAfterRouteEnter.forEach((l) => m(l)), c.onAfterRouteUpdate.forEach((l) => R(l)), c.onAfterRouteLeave.forEach((l) => L(l));
1479
+ get: (n) => {
1480
+ const o = n.split(r);
1481
+ return t.map((s, a) => st(o.at(a), s));
1539
1482
  },
1540
- onBeforeRouteEnter: p,
1541
- onBeforeRouteUpdate: h,
1542
- onBeforeRouteLeave: u,
1543
- onAfterRouteEnter: m,
1544
- onAfterRouteUpdate: R,
1545
- onAfterRouteLeave: L,
1546
- setVueApp: t
1547
- };
1548
- }
1549
- function Er() {
1550
- const t = it(vr);
1551
- if (!t)
1552
- throw new Et();
1553
- return t;
1554
- }
1555
- function br(t) {
1556
- return (e) => {
1557
- const r = Re(), o = Er().addComponentBeforeRouteHook({ lifecycle: t, hook: e, depth: r - 1 });
1558
- return Ht(o), o;
1559
- };
1560
- }
1561
- function Sr(t) {
1562
- return (e) => {
1563
- const r = Re(), o = Er().addComponentAfterRouteHook({ lifecycle: t, hook: e, depth: r - 1 });
1564
- return Ht(o), o;
1483
+ set: (n, { invalid: o }) => {
1484
+ if (!Array.isArray(n))
1485
+ throw o("Expected a tuple");
1486
+ if (n.length !== t.length)
1487
+ throw o(`Expected tuple with ${t.length} values but received ${n.length} values`);
1488
+ return t.map((s, a) => z(n.at(a), s)).join(r);
1489
+ }
1565
1490
  };
1566
1491
  }
1567
- const Jo = br("onBeforeRouteLeave"), Fo = br("onBeforeRouteUpdate"), To = Sr("onAfterRouteLeave"), Mo = Sr("onAfterRouteUpdate");
1568
- function X() {
1569
- return X = Object.assign ? Object.assign.bind() : function(t) {
1492
+ function tt() {
1493
+ return tt = Object.assign ? Object.assign.bind() : function(t) {
1570
1494
  for (var e = 1; e < arguments.length; e++) {
1571
1495
  var r = arguments[e];
1572
1496
  for (var n in r) ({}).hasOwnProperty.call(r, n) && (t[n] = r[n]);
1573
1497
  }
1574
1498
  return t;
1575
- }, X.apply(null, arguments);
1499
+ }, tt.apply(null, arguments);
1576
1500
  }
1577
- var $;
1501
+ var H;
1578
1502
  (function(t) {
1579
1503
  t.Pop = "POP", t.Push = "PUSH", t.Replace = "REPLACE";
1580
- })($ || ($ = {}));
1581
- var Rt = process.env.NODE_ENV !== "production" ? function(t) {
1504
+ })(H || (H = {}));
1505
+ var yt = process.env.NODE_ENV !== "production" ? function(t) {
1582
1506
  return Object.freeze(t);
1583
1507
  } : function(t) {
1584
1508
  return t;
@@ -1592,36 +1516,36 @@ function rt(t, e) {
1592
1516
  }
1593
1517
  }
1594
1518
  }
1595
- var Ot = "beforeunload", eo = "hashchange", Pr = "popstate";
1596
- function Le(t) {
1519
+ var jt = "beforeunload", _n = "hashchange", br = "popstate";
1520
+ function Be(t) {
1597
1521
  t === void 0 && (t = {});
1598
1522
  var e = t, r = e.window, n = r === void 0 ? document.defaultView : r, o = n.history;
1599
- function a() {
1600
- var g = n.location, d = g.pathname, y = g.search, k = g.hash, x = o.state || {};
1601
- return [x.idx, Rt({
1602
- pathname: d,
1603
- search: y,
1604
- hash: k,
1605
- state: x.usr || null,
1606
- key: x.key || "default"
1523
+ function s() {
1524
+ var m = n.location, l = m.pathname, w = m.search, v = m.hash, U = o.state || {};
1525
+ return [U.idx, yt({
1526
+ pathname: l,
1527
+ search: w,
1528
+ hash: v,
1529
+ state: U.usr || null,
1530
+ key: U.key || "default"
1607
1531
  })];
1608
1532
  }
1609
- var s = null;
1610
- function p() {
1611
- if (s)
1612
- S.call(s), s = null;
1533
+ var a = null;
1534
+ function u() {
1535
+ if (a)
1536
+ E.call(a), a = null;
1613
1537
  else {
1614
- var g = $.Pop, d = a(), y = d[0], k = d[1];
1615
- if (S.length)
1616
- if (y != null) {
1617
- var x = m - y;
1618
- x && (s = {
1619
- action: g,
1620
- location: k,
1538
+ var m = H.Pop, l = s(), w = l[0], v = l[1];
1539
+ if (E.length)
1540
+ if (w != null) {
1541
+ var U = y - w;
1542
+ U && (a = {
1543
+ action: m,
1544
+ location: v,
1621
1545
  retry: function() {
1622
- A(x * -1);
1546
+ b(U * -1);
1623
1547
  }
1624
- }, A(x));
1548
+ }, b(U));
1625
1549
  } else
1626
1550
  process.env.NODE_ENV !== "production" && rt(
1627
1551
  !1,
@@ -1631,135 +1555,135 @@ function Le(t) {
1631
1555
  "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."
1632
1556
  );
1633
1557
  else
1634
- c(g);
1558
+ g(m);
1635
1559
  }
1636
1560
  }
1637
- n.addEventListener(Pr, p);
1638
- var h = $.Pop, u = a(), m = u[0], R = u[1], L = wt(), S = wt();
1639
- m == null && (m = 0, o.replaceState(X({}, o.state, {
1640
- idx: m
1561
+ n.addEventListener(br, u);
1562
+ var f = H.Pop, p = s(), y = p[0], d = p[1], A = Rt(), E = Rt();
1563
+ y == null && (y = 0, o.replaceState(tt({}, o.state, {
1564
+ idx: y
1641
1565
  }), ""));
1642
- function U(g) {
1643
- return typeof g == "string" ? g : nt(g);
1566
+ function N(m) {
1567
+ return typeof m == "string" ? m : nt(m);
1644
1568
  }
1645
- function v(g, d) {
1646
- return d === void 0 && (d = null), Rt(X({
1647
- pathname: R.pathname,
1569
+ function R(m, l) {
1570
+ return l === void 0 && (l = null), yt(tt({
1571
+ pathname: d.pathname,
1648
1572
  hash: "",
1649
1573
  search: ""
1650
- }, typeof g == "string" ? St(g) : g, {
1651
- state: d,
1652
- key: $t()
1574
+ }, typeof m == "string" ? bt(m) : m, {
1575
+ state: l,
1576
+ key: Ht()
1653
1577
  }));
1654
1578
  }
1655
- function i(g, d) {
1579
+ function k(m, l) {
1656
1580
  return [{
1657
- usr: g.state,
1658
- key: g.key,
1659
- idx: d
1660
- }, U(g)];
1661
- }
1662
- function f(g, d, y) {
1663
- return !S.length || (S.call({
1664
- action: g,
1665
- location: d,
1666
- retry: y
1581
+ usr: m.state,
1582
+ key: m.key,
1583
+ idx: l
1584
+ }, N(m)];
1585
+ }
1586
+ function h(m, l, w) {
1587
+ return !E.length || (E.call({
1588
+ action: m,
1589
+ location: l,
1590
+ retry: w
1667
1591
  }), !1);
1668
1592
  }
1669
- function c(g) {
1670
- h = g;
1671
- var d = a();
1672
- m = d[0], R = d[1], L.call({
1673
- action: h,
1674
- location: R
1593
+ function g(m) {
1594
+ f = m;
1595
+ var l = s();
1596
+ y = l[0], d = l[1], A.call({
1597
+ action: f,
1598
+ location: d
1675
1599
  });
1676
1600
  }
1677
- function l(g, d) {
1678
- var y = $.Push, k = v(g, d);
1679
- function x() {
1680
- l(g, d);
1601
+ function i(m, l) {
1602
+ var w = H.Push, v = R(m, l);
1603
+ function U() {
1604
+ i(m, l);
1681
1605
  }
1682
- if (f(y, k, x)) {
1683
- var C = i(k, m + 1), j = C[0], _ = C[1];
1606
+ if (h(w, v, U)) {
1607
+ var V = k(v, y + 1), Z = V[0], $ = V[1];
1684
1608
  try {
1685
- o.pushState(j, "", _);
1609
+ o.pushState(Z, "", $);
1686
1610
  } catch {
1687
- n.location.assign(_);
1611
+ n.location.assign($);
1688
1612
  }
1689
- c(y);
1613
+ g(w);
1690
1614
  }
1691
1615
  }
1692
- function E(g, d) {
1693
- var y = $.Replace, k = v(g, d);
1694
- function x() {
1695
- E(g, d);
1616
+ function c(m, l) {
1617
+ var w = H.Replace, v = R(m, l);
1618
+ function U() {
1619
+ c(m, l);
1696
1620
  }
1697
- if (f(y, k, x)) {
1698
- var C = i(k, m), j = C[0], _ = C[1];
1699
- o.replaceState(j, "", _), c(y);
1621
+ if (h(w, v, U)) {
1622
+ var V = k(v, y), Z = V[0], $ = V[1];
1623
+ o.replaceState(Z, "", $), g(w);
1700
1624
  }
1701
1625
  }
1702
- function A(g) {
1703
- o.go(g);
1626
+ function b(m) {
1627
+ o.go(m);
1704
1628
  }
1705
- var P = {
1629
+ var L = {
1706
1630
  get action() {
1707
- return h;
1631
+ return f;
1708
1632
  },
1709
1633
  get location() {
1710
- return R;
1634
+ return d;
1711
1635
  },
1712
- createHref: U,
1713
- push: l,
1714
- replace: E,
1715
- go: A,
1636
+ createHref: N,
1637
+ push: i,
1638
+ replace: c,
1639
+ go: b,
1716
1640
  back: function() {
1717
- A(-1);
1641
+ b(-1);
1718
1642
  },
1719
1643
  forward: function() {
1720
- A(1);
1644
+ b(1);
1721
1645
  },
1722
- listen: function(d) {
1723
- return L.push(d);
1646
+ listen: function(l) {
1647
+ return A.push(l);
1724
1648
  },
1725
- block: function(d) {
1726
- var y = S.push(d);
1727
- return S.length === 1 && n.addEventListener(Ot, jt), function() {
1728
- y(), S.length || n.removeEventListener(Ot, jt);
1649
+ block: function(l) {
1650
+ var w = E.push(l);
1651
+ return E.length === 1 && n.addEventListener(jt, Zt), function() {
1652
+ w(), E.length || n.removeEventListener(jt, Zt);
1729
1653
  };
1730
1654
  }
1731
1655
  };
1732
- return P;
1656
+ return L;
1733
1657
  }
1734
- function ro(t) {
1658
+ function Jn(t) {
1735
1659
  t === void 0 && (t = {});
1736
1660
  var e = t, r = e.window, n = r === void 0 ? document.defaultView : r, o = n.history;
1737
- function a() {
1738
- var d = St(n.location.hash.substr(1)), y = d.pathname, k = y === void 0 ? "/" : y, x = d.search, C = x === void 0 ? "" : x, j = d.hash, _ = j === void 0 ? "" : j, q = o.state || {};
1739
- return [q.idx, Rt({
1740
- pathname: k,
1741
- search: C,
1742
- hash: _,
1743
- state: q.usr || null,
1744
- key: q.key || "default"
1661
+ function s() {
1662
+ var l = bt(n.location.hash.substr(1)), w = l.pathname, v = w === void 0 ? "/" : w, U = l.search, V = U === void 0 ? "" : U, Z = l.hash, $ = Z === void 0 ? "" : Z, D = o.state || {};
1663
+ return [D.idx, yt({
1664
+ pathname: v,
1665
+ search: V,
1666
+ hash: $,
1667
+ state: D.usr || null,
1668
+ key: D.key || "default"
1745
1669
  })];
1746
1670
  }
1747
- var s = null;
1748
- function p() {
1749
- if (s)
1750
- S.call(s), s = null;
1671
+ var a = null;
1672
+ function u() {
1673
+ if (a)
1674
+ E.call(a), a = null;
1751
1675
  else {
1752
- var d = $.Pop, y = a(), k = y[0], x = y[1];
1753
- if (S.length)
1754
- if (k != null) {
1755
- var C = m - k;
1756
- C && (s = {
1757
- action: d,
1758
- location: x,
1676
+ var l = H.Pop, w = s(), v = w[0], U = w[1];
1677
+ if (E.length)
1678
+ if (v != null) {
1679
+ var V = y - v;
1680
+ V && (a = {
1681
+ action: l,
1682
+ location: U,
1759
1683
  retry: function() {
1760
- P(C * -1);
1684
+ L(V * -1);
1761
1685
  }
1762
- }, P(C));
1686
+ }, L(V));
1763
1687
  } else
1764
1688
  process.env.NODE_ENV !== "production" && rt(
1765
1689
  !1,
@@ -1769,212 +1693,212 @@ function ro(t) {
1769
1693
  "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."
1770
1694
  );
1771
1695
  else
1772
- l(d);
1696
+ i(l);
1773
1697
  }
1774
1698
  }
1775
- n.addEventListener(Pr, p), n.addEventListener(eo, function() {
1776
- var d = a(), y = d[1];
1777
- nt(y) !== nt(R) && p();
1699
+ n.addEventListener(br, u), n.addEventListener(_n, function() {
1700
+ var l = s(), w = l[1];
1701
+ nt(w) !== nt(d) && u();
1778
1702
  });
1779
- var h = $.Pop, u = a(), m = u[0], R = u[1], L = wt(), S = wt();
1780
- m == null && (m = 0, o.replaceState(X({}, o.state, {
1781
- idx: m
1703
+ var f = H.Pop, p = s(), y = p[0], d = p[1], A = Rt(), E = Rt();
1704
+ y == null && (y = 0, o.replaceState(tt({}, o.state, {
1705
+ idx: y
1782
1706
  }), ""));
1783
- function U() {
1784
- var d = document.querySelector("base"), y = "";
1785
- if (d && d.getAttribute("href")) {
1786
- var k = n.location.href, x = k.indexOf("#");
1787
- y = x === -1 ? k : k.slice(0, x);
1707
+ function N() {
1708
+ var l = document.querySelector("base"), w = "";
1709
+ if (l && l.getAttribute("href")) {
1710
+ var v = n.location.href, U = v.indexOf("#");
1711
+ w = U === -1 ? v : v.slice(0, U);
1788
1712
  }
1789
- return y;
1713
+ return w;
1790
1714
  }
1791
- function v(d) {
1792
- return U() + "#" + (typeof d == "string" ? d : nt(d));
1715
+ function R(l) {
1716
+ return N() + "#" + (typeof l == "string" ? l : nt(l));
1793
1717
  }
1794
- function i(d, y) {
1795
- return y === void 0 && (y = null), Rt(X({
1796
- pathname: R.pathname,
1718
+ function k(l, w) {
1719
+ return w === void 0 && (w = null), yt(tt({
1720
+ pathname: d.pathname,
1797
1721
  hash: "",
1798
1722
  search: ""
1799
- }, typeof d == "string" ? St(d) : d, {
1800
- state: y,
1801
- key: $t()
1723
+ }, typeof l == "string" ? bt(l) : l, {
1724
+ state: w,
1725
+ key: Ht()
1802
1726
  }));
1803
1727
  }
1804
- function f(d, y) {
1728
+ function h(l, w) {
1805
1729
  return [{
1806
- usr: d.state,
1807
- key: d.key,
1808
- idx: y
1809
- }, v(d)];
1810
- }
1811
- function c(d, y, k) {
1812
- return !S.length || (S.call({
1813
- action: d,
1814
- location: y,
1815
- retry: k
1730
+ usr: l.state,
1731
+ key: l.key,
1732
+ idx: w
1733
+ }, R(l)];
1734
+ }
1735
+ function g(l, w, v) {
1736
+ return !E.length || (E.call({
1737
+ action: l,
1738
+ location: w,
1739
+ retry: v
1816
1740
  }), !1);
1817
1741
  }
1818
- function l(d) {
1819
- h = d;
1820
- var y = a();
1821
- m = y[0], R = y[1], L.call({
1822
- action: h,
1823
- location: R
1742
+ function i(l) {
1743
+ f = l;
1744
+ var w = s();
1745
+ y = w[0], d = w[1], A.call({
1746
+ action: f,
1747
+ location: d
1824
1748
  });
1825
1749
  }
1826
- function E(d, y) {
1827
- var k = $.Push, x = i(d, y);
1828
- function C() {
1829
- E(d, y);
1750
+ function c(l, w) {
1751
+ var v = H.Push, U = k(l, w);
1752
+ function V() {
1753
+ c(l, w);
1830
1754
  }
1831
- if (process.env.NODE_ENV !== "production" && rt(x.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(d) + ")"), c(k, x, C)) {
1832
- var j = f(x, m + 1), _ = j[0], q = j[1];
1755
+ if (process.env.NODE_ENV !== "production" && rt(U.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(l) + ")"), g(v, U, V)) {
1756
+ var Z = h(U, y + 1), $ = Z[0], D = Z[1];
1833
1757
  try {
1834
- o.pushState(_, "", q);
1758
+ o.pushState($, "", D);
1835
1759
  } catch {
1836
- n.location.assign(q);
1760
+ n.location.assign(D);
1837
1761
  }
1838
- l(k);
1762
+ i(v);
1839
1763
  }
1840
1764
  }
1841
- function A(d, y) {
1842
- var k = $.Replace, x = i(d, y);
1843
- function C() {
1844
- A(d, y);
1765
+ function b(l, w) {
1766
+ var v = H.Replace, U = k(l, w);
1767
+ function V() {
1768
+ b(l, w);
1845
1769
  }
1846
- if (process.env.NODE_ENV !== "production" && rt(x.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(d) + ")"), c(k, x, C)) {
1847
- var j = f(x, m), _ = j[0], q = j[1];
1848
- o.replaceState(_, "", q), l(k);
1770
+ if (process.env.NODE_ENV !== "production" && rt(U.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(l) + ")"), g(v, U, V)) {
1771
+ var Z = h(U, y), $ = Z[0], D = Z[1];
1772
+ o.replaceState($, "", D), i(v);
1849
1773
  }
1850
1774
  }
1851
- function P(d) {
1852
- o.go(d);
1775
+ function L(l) {
1776
+ o.go(l);
1853
1777
  }
1854
- var g = {
1778
+ var m = {
1855
1779
  get action() {
1856
- return h;
1780
+ return f;
1857
1781
  },
1858
1782
  get location() {
1859
- return R;
1783
+ return d;
1860
1784
  },
1861
- createHref: v,
1862
- push: E,
1863
- replace: A,
1864
- go: P,
1785
+ createHref: R,
1786
+ push: c,
1787
+ replace: b,
1788
+ go: L,
1865
1789
  back: function() {
1866
- P(-1);
1790
+ L(-1);
1867
1791
  },
1868
1792
  forward: function() {
1869
- P(1);
1793
+ L(1);
1870
1794
  },
1871
- listen: function(y) {
1872
- return L.push(y);
1795
+ listen: function(w) {
1796
+ return A.push(w);
1873
1797
  },
1874
- block: function(y) {
1875
- var k = S.push(y);
1876
- return S.length === 1 && n.addEventListener(Ot, jt), function() {
1877
- k(), S.length || n.removeEventListener(Ot, jt);
1798
+ block: function(w) {
1799
+ var v = E.push(w);
1800
+ return E.length === 1 && n.addEventListener(jt, Zt), function() {
1801
+ v(), E.length || n.removeEventListener(jt, Zt);
1878
1802
  };
1879
1803
  }
1880
1804
  };
1881
- return g;
1805
+ return m;
1882
1806
  }
1883
- function Ue(t) {
1807
+ function Ve(t) {
1884
1808
  t === void 0 && (t = {});
1885
- var e = t, r = e.initialEntries, n = r === void 0 ? ["/"] : r, o = e.initialIndex, a = n.map(function(l) {
1886
- var E = Rt(X({
1809
+ var e = t, r = e.initialEntries, n = r === void 0 ? ["/"] : r, o = e.initialIndex, s = n.map(function(i) {
1810
+ var c = yt(tt({
1887
1811
  pathname: "/",
1888
1812
  search: "",
1889
1813
  hash: "",
1890
1814
  state: null,
1891
- key: $t()
1892
- }, typeof l == "string" ? St(l) : l));
1893
- return process.env.NODE_ENV !== "production" && rt(E.pathname.charAt(0) === "/", "Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: " + JSON.stringify(l) + ")"), E;
1894
- }), s = Be(o ?? a.length - 1, 0, a.length - 1), p = $.Pop, h = a[s], u = wt(), m = wt();
1895
- function R(l) {
1896
- return typeof l == "string" ? l : nt(l);
1897
- }
1898
- function L(l, E) {
1899
- return E === void 0 && (E = null), Rt(X({
1900
- pathname: h.pathname,
1815
+ key: Ht()
1816
+ }, typeof i == "string" ? bt(i) : i));
1817
+ return process.env.NODE_ENV !== "production" && rt(c.pathname.charAt(0) === "/", "Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: " + JSON.stringify(i) + ")"), c;
1818
+ }), a = Ce(o ?? s.length - 1, 0, s.length - 1), u = H.Pop, f = s[a], p = Rt(), y = Rt();
1819
+ function d(i) {
1820
+ return typeof i == "string" ? i : nt(i);
1821
+ }
1822
+ function A(i, c) {
1823
+ return c === void 0 && (c = null), yt(tt({
1824
+ pathname: f.pathname,
1901
1825
  search: "",
1902
1826
  hash: ""
1903
- }, typeof l == "string" ? St(l) : l, {
1904
- state: E,
1905
- key: $t()
1827
+ }, typeof i == "string" ? bt(i) : i, {
1828
+ state: c,
1829
+ key: Ht()
1906
1830
  }));
1907
1831
  }
1908
- function S(l, E, A) {
1909
- return !m.length || (m.call({
1910
- action: l,
1911
- location: E,
1912
- retry: A
1832
+ function E(i, c, b) {
1833
+ return !y.length || (y.call({
1834
+ action: i,
1835
+ location: c,
1836
+ retry: b
1913
1837
  }), !1);
1914
1838
  }
1915
- function U(l, E) {
1916
- p = l, h = E, u.call({
1917
- action: p,
1918
- location: h
1839
+ function N(i, c) {
1840
+ u = i, f = c, p.call({
1841
+ action: u,
1842
+ location: f
1919
1843
  });
1920
1844
  }
1921
- function v(l, E) {
1922
- var A = $.Push, P = L(l, E);
1923
- function g() {
1924
- v(l, E);
1845
+ function R(i, c) {
1846
+ var b = H.Push, L = A(i, c);
1847
+ function m() {
1848
+ R(i, c);
1925
1849
  }
1926
- process.env.NODE_ENV !== "production" && rt(h.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.push(" + JSON.stringify(l) + ")"), S(A, P, g) && (s += 1, a.splice(s, a.length, P), U(A, P));
1850
+ process.env.NODE_ENV !== "production" && rt(f.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.push(" + JSON.stringify(i) + ")"), E(b, L, m) && (a += 1, s.splice(a, s.length, L), N(b, L));
1927
1851
  }
1928
- function i(l, E) {
1929
- var A = $.Replace, P = L(l, E);
1930
- function g() {
1931
- i(l, E);
1852
+ function k(i, c) {
1853
+ var b = H.Replace, L = A(i, c);
1854
+ function m() {
1855
+ k(i, c);
1932
1856
  }
1933
- process.env.NODE_ENV !== "production" && rt(h.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.replace(" + JSON.stringify(l) + ")"), S(A, P, g) && (a[s] = P, U(A, P));
1857
+ process.env.NODE_ENV !== "production" && rt(f.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.replace(" + JSON.stringify(i) + ")"), E(b, L, m) && (s[a] = L, N(b, L));
1934
1858
  }
1935
- function f(l) {
1936
- var E = Be(s + l, 0, a.length - 1), A = $.Pop, P = a[E];
1937
- function g() {
1938
- f(l);
1859
+ function h(i) {
1860
+ var c = Ce(a + i, 0, s.length - 1), b = H.Pop, L = s[c];
1861
+ function m() {
1862
+ h(i);
1939
1863
  }
1940
- S(A, P, g) && (s = E, U(A, P));
1864
+ E(b, L, m) && (a = c, N(b, L));
1941
1865
  }
1942
- var c = {
1866
+ var g = {
1943
1867
  get index() {
1944
- return s;
1868
+ return a;
1945
1869
  },
1946
1870
  get action() {
1947
- return p;
1871
+ return u;
1948
1872
  },
1949
1873
  get location() {
1950
- return h;
1874
+ return f;
1951
1875
  },
1952
- createHref: R,
1953
- push: v,
1954
- replace: i,
1955
- go: f,
1876
+ createHref: d,
1877
+ push: R,
1878
+ replace: k,
1879
+ go: h,
1956
1880
  back: function() {
1957
- f(-1);
1881
+ h(-1);
1958
1882
  },
1959
1883
  forward: function() {
1960
- f(1);
1884
+ h(1);
1961
1885
  },
1962
- listen: function(E) {
1963
- return u.push(E);
1886
+ listen: function(c) {
1887
+ return p.push(c);
1964
1888
  },
1965
- block: function(E) {
1966
- return m.push(E);
1889
+ block: function(c) {
1890
+ return y.push(c);
1967
1891
  }
1968
1892
  };
1969
- return c;
1893
+ return g;
1970
1894
  }
1971
- function Be(t, e, r) {
1895
+ function Ce(t, e, r) {
1972
1896
  return Math.min(Math.max(t, e), r);
1973
1897
  }
1974
- function jt(t) {
1898
+ function Zt(t) {
1975
1899
  t.preventDefault(), t.returnValue = "";
1976
1900
  }
1977
- function wt() {
1901
+ function Rt() {
1978
1902
  var t = [];
1979
1903
  return {
1980
1904
  get length() {
@@ -1994,14 +1918,14 @@ function wt() {
1994
1918
  }
1995
1919
  };
1996
1920
  }
1997
- function $t() {
1921
+ function Ht() {
1998
1922
  return Math.random().toString(36).substr(2, 8);
1999
1923
  }
2000
1924
  function nt(t) {
2001
- var e = t.pathname, r = e === void 0 ? "/" : e, n = t.search, o = n === void 0 ? "" : n, a = t.hash, s = a === void 0 ? "" : a;
2002
- return o && o !== "?" && (r += o.charAt(0) === "?" ? o : "?" + o), s && s !== "#" && (r += s.charAt(0) === "#" ? s : "#" + s), r;
1925
+ var e = t.pathname, r = e === void 0 ? "/" : e, n = t.search, o = n === void 0 ? "" : n, s = t.hash, a = s === void 0 ? "" : s;
1926
+ return o && o !== "?" && (r += o.charAt(0) === "?" ? o : "?" + o), a && a !== "#" && (r += a.charAt(0) === "#" ? a : "#" + a), r;
2003
1927
  }
2004
- function St(t) {
1928
+ function bt(t) {
2005
1929
  var e = {};
2006
1930
  if (t) {
2007
1931
  var r = t.indexOf("#");
@@ -2011,35 +1935,33 @@ function St(t) {
2011
1935
  }
2012
1936
  return e;
2013
1937
  }
2014
- const Ar = Symbol();
2015
- function no(t, e) {
2016
- const r = qt({ ...t }), n = (s) => {
2017
- Object.assign(r, {
2018
- [Ar]: !1,
2019
- ...s
1938
+ function Tn(t, e, r) {
1939
+ const n = Dt({ ...e }), o = (u) => {
1940
+ Object.assign(n, {
1941
+ ...u
2020
1942
  });
2021
- }, o = r, a = $n(o, e);
1943
+ }, s = n, a = Nn(t, s, r);
2022
1944
  return {
2023
- currentRoute: o,
1945
+ currentRoute: s,
2024
1946
  routerRoute: a,
2025
- updateRoute: n
1947
+ updateRoute: o
2026
1948
  };
2027
1949
  }
2028
1950
  function I(t) {
2029
- return !t.startsWith("http") ? ao(t) : oo(t);
1951
+ return !t.startsWith("http") ? Mn(t) : Fn(t);
2030
1952
  }
2031
- function oo(t) {
2032
- const { protocol: e, host: r, pathname: n, search: o, searchParams: a, hash: s } = new URL(t, t);
1953
+ function Fn(t) {
1954
+ const { protocol: e, host: r, pathname: n, search: o, searchParams: s, hash: a } = new URL(t, t);
2033
1955
  return {
2034
1956
  protocol: e,
2035
1957
  host: r,
2036
1958
  pathname: n,
2037
1959
  search: o,
2038
- searchParams: a,
2039
- hash: s
1960
+ searchParams: s,
1961
+ hash: a
2040
1962
  };
2041
1963
  }
2042
- function ao(t) {
1964
+ function Mn(t) {
2043
1965
  const { pathname: e, search: r, searchParams: n, hash: o } = new URL(t, "https://localhost");
2044
1966
  return {
2045
1967
  pathname: e,
@@ -2048,149 +1970,291 @@ function ao(t) {
2048
1970
  hash: o
2049
1971
  };
2050
1972
  }
2051
- function so(t) {
1973
+ function Wn(t) {
2052
1974
  return (e) => {
2053
1975
  const { host: r } = I(e);
2054
1976
  return !(r === void 0 || r === t);
2055
1977
  };
2056
1978
  }
2057
- function io({ mode: t, listener: e }) {
2058
- const r = co(t), n = (h, u) => {
2059
- if (u != null && u.replace) {
2060
- r.replace(h, u.state);
1979
+ function Oe(t) {
1980
+ try {
1981
+ const e = t();
1982
+ return oe(e) ? e.catch((r) => r) : e;
1983
+ } catch (e) {
1984
+ return e;
1985
+ }
1986
+ }
1987
+ function Gn() {
1988
+ const { setVueApp: t, runWithContext: e } = fr(), r = Dt(/* @__PURE__ */ new Map()), { push: n, replace: o, reject: s } = ur(), a = (R, k, h) => k.matches.filter((g) => gr({ ...h, routePrefetch: g.prefetch }, "props") === R).flatMap((g) => E(g)).reduce((g, { id: i, name: c, props: b }) => {
1989
+ if (!b)
1990
+ return g;
1991
+ const L = A(i, c, k), m = e(() => Oe(() => b(k, {
1992
+ push: n,
1993
+ replace: o,
1994
+ reject: s,
1995
+ parent: y(k, !0)
1996
+ })));
1997
+ return g[L] = m, g;
1998
+ }, {}), u = (R) => {
1999
+ Object.entries(R).forEach(([k, h]) => {
2000
+ r.set(k, h);
2001
+ });
2002
+ }, f = async (R) => {
2003
+ const k = R.matches.flatMap(E), h = [], g = [];
2004
+ for (const { id: i, name: c, props: b } of k) {
2005
+ if (!b)
2006
+ continue;
2007
+ const L = A(i, c, R);
2008
+ if (h.push(L), !r.has(L)) {
2009
+ const m = e(() => Oe(() => b(R, {
2010
+ push: n,
2011
+ replace: o,
2012
+ reject: s,
2013
+ parent: y(R)
2014
+ })));
2015
+ r.set(L, m);
2016
+ }
2017
+ g.push((async () => {
2018
+ const m = await r.get(L);
2019
+ if (m instanceof Error)
2020
+ throw m;
2021
+ })());
2022
+ }
2023
+ N(h);
2024
+ try {
2025
+ return await Promise.all(g), { status: "SUCCESS" };
2026
+ } catch (i) {
2027
+ if (i instanceof dt || i instanceof Ot)
2028
+ return i.response;
2029
+ throw i;
2030
+ }
2031
+ }, p = (R, k, h) => {
2032
+ const g = A(R, k, h);
2033
+ return r.get(g);
2034
+ };
2035
+ function y(R, k = !1) {
2036
+ const h = R.matches.at(-2);
2037
+ if (h)
2038
+ return Pe(h) ? {
2039
+ name: h.name ?? "",
2040
+ get props() {
2041
+ return d(h, "default", R, k);
2042
+ }
2043
+ } : Ae(h) ? {
2044
+ name: h.name ?? "",
2045
+ props: new Proxy({}, {
2046
+ get(g, i) {
2047
+ return typeof i != "string" ? Reflect.get(g, i) : d(h, i, R, k);
2048
+ }
2049
+ })
2050
+ } : {
2051
+ name: h.name ?? "",
2052
+ props: void 0
2053
+ };
2054
+ }
2055
+ function d(R, k, h, g = !1) {
2056
+ const i = p(R.id, k, h);
2057
+ if (g && !i) {
2058
+ const c = R.name ?? "unknown", b = h.name || "unknown";
2059
+ console.warn(`
2060
+ Unable to access parent props "${k}" from route "${c}" while prefetching props for route "${b}".
2061
+ This may occur if the parent route's props were not also prefetched.
2062
+ `);
2063
+ }
2064
+ return i;
2065
+ }
2066
+ function A(R, k, h) {
2067
+ return [R, k, h.id, JSON.stringify(h.params)].join("-");
2068
+ }
2069
+ function E(R) {
2070
+ return Pe(R) ? [
2071
+ {
2072
+ id: R.id,
2073
+ name: "default",
2074
+ props: R.props
2075
+ }
2076
+ ] : Ae(R) ? Object.entries(R.props).map(([k, h]) => ({ id: R.id, name: k, props: h })) : [];
2077
+ }
2078
+ function N(R) {
2079
+ for (const k of r.keys())
2080
+ R.includes(k) || r.delete(k);
2081
+ }
2082
+ return {
2083
+ getPrefetchProps: a,
2084
+ setPrefetchProps: u,
2085
+ getProps: p,
2086
+ setProps: f,
2087
+ setVueApp: t
2088
+ };
2089
+ }
2090
+ function Re() {
2091
+ return typeof window < "u" && typeof window.document < "u";
2092
+ }
2093
+ function Qn({ mode: t, listener: e }) {
2094
+ const r = zn(t), n = (f, p) => {
2095
+ if (p?.replace) {
2096
+ r.replace(f, p.state);
2061
2097
  return;
2062
2098
  }
2063
- r.push(h, u == null ? void 0 : u.state);
2099
+ r.push(f, p?.state);
2064
2100
  }, o = () => {
2065
- const h = nt(r.location);
2066
- r.replace(h);
2101
+ const f = nt(r.location);
2102
+ r.replace(f);
2067
2103
  };
2068
- let a;
2104
+ let s;
2069
2105
  return {
2070
2106
  ...r,
2071
2107
  update: n,
2072
2108
  refresh: o,
2073
2109
  startListening: () => {
2074
- a == null || a(), a = r.listen(e);
2110
+ s?.(), s = r.listen(e);
2075
2111
  },
2076
2112
  stopListening: () => {
2077
- a == null || a();
2113
+ s?.();
2078
2114
  }
2079
2115
  };
2080
2116
  }
2081
- function co(t = "auto") {
2117
+ function zn(t = "auto") {
2082
2118
  switch (t) {
2083
2119
  case "auto":
2084
- return le() ? Le() : Ue();
2120
+ return Re() ? Be() : Ve();
2085
2121
  case "browser":
2086
- return Le();
2122
+ return Be();
2087
2123
  case "memory":
2088
- return Ue();
2124
+ return Ve();
2089
2125
  case "hash":
2090
- return ro();
2126
+ return Jn();
2091
2127
  default:
2092
2128
  const e = t;
2093
2129
  throw new Error(`Switch is not exhaustive for mode: ${e}`);
2094
2130
  }
2095
2131
  }
2096
- function uo(t) {
2097
- return vt(() => () => dt("h1", t), {
2132
+ function Yn(t) {
2133
+ return gt(() => () => X("h1", t), {
2098
2134
  name: t,
2099
2135
  props: []
2100
2136
  });
2101
2137
  }
2102
- function fo(t) {
2103
- const e = (a) => Ut(t[a] ?? uo(a)), r = (a) => {
2104
- const s = Ut(e(a)), p = {
2105
- id: he(),
2106
- component: s,
2138
+ function ge(t) {
2139
+ const e = new URLSearchParams(t);
2140
+ return {
2141
+ get: (...r) => e.get(...r),
2142
+ getAll: (...r) => e.getAll(...r),
2143
+ set: (...r) => {
2144
+ e.set(...r);
2145
+ },
2146
+ append: (...r) => {
2147
+ e.append(...r);
2148
+ },
2149
+ delete: (...r) => {
2150
+ e.delete(...r);
2151
+ },
2152
+ toString: (...r) => e.toString(...r),
2153
+ forEach: (...r) => {
2154
+ e.forEach(...r);
2155
+ },
2156
+ entries: (...r) => e.entries(...r),
2157
+ keys: (...r) => e.keys(...r),
2158
+ values: (...r) => e.values(...r),
2159
+ has: (...r) => e.has(...r),
2160
+ size: e.size,
2161
+ sort: () => {
2162
+ e.sort();
2163
+ },
2164
+ [Symbol.iterator]: () => e[Symbol.iterator]()
2165
+ };
2166
+ }
2167
+ function Kn(t) {
2168
+ const e = (s) => Bt(t[s] ?? Yn(s)), r = (s) => {
2169
+ const a = Bt(e(s)), u = {
2170
+ id: pe(),
2171
+ component: a,
2107
2172
  meta: {},
2108
2173
  state: {}
2109
2174
  };
2110
2175
  return {
2111
- id: p.id,
2112
- matched: p,
2113
- matches: [p],
2114
- name: a,
2115
- query: pe(""),
2176
+ id: u.id,
2177
+ matched: u,
2178
+ matches: [u],
2179
+ name: s,
2180
+ query: ge(""),
2116
2181
  params: {},
2117
2182
  state: {},
2118
2183
  href: "/",
2119
- hash: "",
2120
- [Ar]: !0
2184
+ hash: ""
2121
2185
  };
2122
- }, n = (a) => {
2123
- if (!a) {
2186
+ }, n = (s) => {
2187
+ if (!s) {
2124
2188
  o.value = null;
2125
2189
  return;
2126
2190
  }
2127
- const s = e(a);
2128
- o.value = { type: a, component: s };
2129
- }, o = Pt(null);
2191
+ const a = e(s);
2192
+ o.value = { type: s, component: a };
2193
+ }, o = St(null);
2130
2194
  return {
2131
2195
  setRejection: n,
2132
2196
  rejection: o,
2133
2197
  getRejectionRoute: r
2134
2198
  };
2135
2199
  }
2136
- class lo extends Error {
2200
+ class Xn extends Error {
2137
2201
  constructor() {
2138
2202
  super("initialUrl must be set if window.location is unavailable");
2139
2203
  }
2140
2204
  }
2141
- function po(t) {
2205
+ function to(t) {
2142
2206
  if (t)
2143
2207
  return t;
2144
- if (le())
2208
+ if (Re())
2145
2209
  return window.location.toString();
2146
- throw new lo();
2210
+ throw new Xn();
2147
2211
  }
2148
- function kr(t) {
2212
+ function Sr(t) {
2149
2213
  return !!t && typeof t == "object";
2150
2214
  }
2151
- const _t = !0;
2152
- function ho(t, e, r) {
2153
- if (kr(t) && e in t) {
2215
+ const $t = !0;
2216
+ function eo(t, e, r) {
2217
+ if (Sr(t) && e in t) {
2154
2218
  const n = t[e];
2155
- return typeof n == "string" ? at(n, r, _t) : n;
2219
+ return typeof n == "string" ? st(n, r, $t) : n;
2156
2220
  }
2157
- return at(void 0, r, _t);
2221
+ return st(void 0, r, $t);
2158
2222
  }
2159
- function xr(t, e) {
2223
+ function Pr(t, e) {
2160
2224
  const r = {};
2161
2225
  for (const [n, o] of Object.entries(t)) {
2162
- const a = ho(e, n, o);
2163
- r[n] = a;
2226
+ const s = eo(e, n, o);
2227
+ r[n] = s;
2164
2228
  }
2165
2229
  return r;
2166
2230
  }
2167
- function yo(t, e, r) {
2168
- if (kr(t) && e in t) {
2231
+ function ro(t, e, r) {
2232
+ if (Sr(t) && e in t) {
2169
2233
  const n = t[e];
2170
- return z(n, r, _t);
2234
+ return z(n, r, $t);
2171
2235
  }
2172
- return z(void 0, r, _t);
2236
+ return z(void 0, r, $t);
2173
2237
  }
2174
- const Ce = (t, e) => {
2238
+ const je = (t, e) => {
2175
2239
  const r = {};
2176
2240
  for (const [n, o] of Object.entries(t)) {
2177
- const a = yo(e, n, o);
2178
- r[n] = a;
2241
+ const s = ro(e, n, o);
2242
+ r[n] = s;
2179
2243
  }
2180
2244
  return r;
2181
2245
  };
2182
- function mo() {
2183
- const t = qt(/* @__PURE__ */ new Map()), e = le() ? s() : null, r = (p) => {
2184
- t.set(p, !1), e == null || e.observe(p);
2185
- }, n = (p) => {
2186
- t.delete(p), e == null || e.unobserve(p);
2246
+ function no() {
2247
+ const t = Dt(/* @__PURE__ */ new Map()), e = Re() ? a() : null, r = (u) => {
2248
+ t.set(u, !1), e?.observe(u);
2249
+ }, n = (u) => {
2250
+ t.delete(u), e?.unobserve(u);
2187
2251
  }, o = () => {
2188
- e == null || e.disconnect();
2189
- }, a = (p) => t.get(p) ?? !1;
2190
- function s() {
2191
- return new IntersectionObserver((p) => {
2192
- p.forEach((h) => {
2193
- t.set(h.target, h.isIntersecting);
2252
+ e?.disconnect();
2253
+ }, s = (u) => t.get(u) ?? !1;
2254
+ function a() {
2255
+ return new IntersectionObserver((u) => {
2256
+ u.forEach((f) => {
2257
+ t.set(f.target, f.isIntersecting);
2194
2258
  });
2195
2259
  });
2196
2260
  }
@@ -2198,53 +2262,53 @@ function mo() {
2198
2262
  observe: r,
2199
2263
  unobserve: n,
2200
2264
  disconnect: o,
2201
- isElementVisible: a
2265
+ isElementVisible: s
2202
2266
  };
2203
2267
  }
2204
- class go extends Error {
2268
+ class oo extends Error {
2205
2269
  constructor(e) {
2206
2270
  super(`Route not found: "${e}"`);
2207
2271
  }
2208
2272
  }
2209
- function Nr(t, e, r) {
2210
- const n = yn(e.value, r), o = Ye(n), [a] = tr(t, new RegExp(o, "g"));
2211
- return a;
2273
+ function Ar(t, e, r) {
2274
+ const n = nn(e.value, r), o = Ye(n), [s] = Xe(t, new RegExp(o, "g"));
2275
+ return s;
2212
2276
  }
2213
- function Lr(t, e, r, n) {
2214
- const o = ce(e, r), a = z(n, e.params[r], o);
2215
- return t.replace(Xe(r), a);
2277
+ function kr(t, e, r, n) {
2278
+ const o = ue(e, r), s = z(n, e.params[r], o);
2279
+ return t.replace(Ke(r), s);
2216
2280
  }
2217
- function Ur({ protocol: t, host: e, pathname: r, search: n, searchParams: o, hash: a }) {
2218
- const s = new URL("https://localhost");
2219
- t && (s.protocol = t), e && (s.host = e), r && (s.pathname = r), o ? s.search = new URLSearchParams(o).toString() : n && (s.search = n), a && (s.hash = a);
2220
- const p = s.toString().replace(/^https:\/\/localhost\/*/, "/");
2221
- return He(p);
2281
+ function Lr({ protocol: t, host: e, pathname: r, search: n, searchParams: o, hash: s }) {
2282
+ const a = new URL("https://localhost");
2283
+ t && (a.protocol = t), e && (a.host = e), r && (a.pathname = r), o ? a.search = new URLSearchParams(o).toString() : n && (a.search = n), s && (a.hash = s);
2284
+ const u = a.toString().replace(/^https:\/\/localhost\/*/, "/");
2285
+ return sr(u);
2222
2286
  }
2223
- function Ro(t, e = {}) {
2224
- const { params: r = {}, query: n } = e, o = vo(t.query, r), a = me(o, n), s = Ve(t.path, r), p = t.hash.value ? Ve(t.hash, r) : e.hash, h = wo(t.host, r), { protocol: u, host: m } = I(h);
2225
- return Ur({ protocol: u, host: m, pathname: s, searchParams: a, hash: p });
2287
+ function so(t, e = {}) {
2288
+ const { params: r = {}, query: n } = e, o = io(t.query, r), s = ye(o, n), a = Ze(t.path, r), u = t.hash.value ? Ze(t.hash, r) : e.hash, f = ao(t.host, r), { protocol: p, host: y } = I(f);
2289
+ return Lr({ protocol: p, host: y, pathname: a, searchParams: s, hash: u });
2226
2290
  }
2227
- function wo(t, e) {
2291
+ function ao(t, e) {
2228
2292
  const r = t.value && !t.value.startsWith("http") ? `https://${t.value}` : t.value;
2229
- return Object.keys(t.params).reduce((n, o) => Lr(n, t, o, e[o]), r);
2293
+ return Object.keys(t.params).reduce((n, o) => kr(n, t, o, e[o]), r);
2230
2294
  }
2231
- function Ve(t, e) {
2232
- return Object.keys(t.params).reduce((r, n) => Lr(r, t, n, e[n]), t.value);
2295
+ function Ze(t, e) {
2296
+ return Object.keys(t.params).reduce((r, n) => kr(r, t, n, e[n]), t.value);
2233
2297
  }
2234
- function vo(t, e) {
2298
+ function io(t, e) {
2235
2299
  const r = new URLSearchParams(t.value);
2236
2300
  if (!t.value)
2237
2301
  return r;
2238
2302
  for (const [n, o] of Array.from(r.entries())) {
2239
- const a = fe(o);
2240
- if (!a)
2303
+ const s = fe(o);
2304
+ if (!s)
2241
2305
  continue;
2242
- const p = ue(o), h = z(e[a], t.params[a], p), u = e[a] === void 0 && h === "";
2243
- p && u ? r.delete(n, o) : r.set(n, h);
2306
+ const u = ce(o), f = z(e[s], t.params[s], u), p = e[s] === void 0 && f === "";
2307
+ u && p ? r.delete(n, o) : r.set(n, f);
2244
2308
  }
2245
2309
  return r;
2246
2310
  }
2247
- const Eo = (t, e) => {
2311
+ const uo = (t, e) => {
2248
2312
  try {
2249
2313
  we(t, e);
2250
2314
  } catch {
@@ -2252,124 +2316,151 @@ const Eo = (t, e) => {
2252
2316
  }
2253
2317
  return !0;
2254
2318
  }, we = (t, e) => {
2255
- const { protocol: r, host: n, pathname: o, search: a, hash: s } = I(e);
2319
+ const { protocol: r, host: n, pathname: o, search: s, hash: a } = I(e);
2256
2320
  return {
2257
- ...zt(t.host, `${r}//${n}`),
2258
- ...zt(t.path, o),
2259
- ...bo(t.query, a),
2260
- ...zt(t.hash, s)
2321
+ ...Yt(t.host, `${r}//${n}`),
2322
+ ...Yt(t.path, o),
2323
+ ...co(t.query, s),
2324
+ ...Yt(t.hash, a)
2261
2325
  };
2262
2326
  };
2263
- function zt(t, e) {
2327
+ function Yt(t, e) {
2264
2328
  const r = {}, n = decodeURIComponent(e);
2265
- for (const [o, a] of Object.entries(t.params)) {
2266
- const s = Nr(n, t, o), p = ce(t, o), h = at(s, a, p);
2267
- r[o] = h;
2329
+ for (const [o, s] of Object.entries(t.params)) {
2330
+ const a = Ar(n, t, o), u = ue(t, o), f = st(a, s, u);
2331
+ r[o] = f;
2268
2332
  }
2269
2333
  return r;
2270
2334
  }
2271
- function bo(t, e) {
2335
+ function co(t, e) {
2272
2336
  const r = {}, n = new URLSearchParams(t.value), o = new URLSearchParams(e);
2273
- for (const [a, s] of Array.from(n.entries())) {
2274
- const p = fe(s);
2275
- if (!p)
2337
+ for (const [s, a] of Array.from(n.entries())) {
2338
+ const u = fe(a);
2339
+ if (!u)
2276
2340
  continue;
2277
- const u = ue(s), m = o.get(a) ?? void 0, R = at(m, t.params[p], u);
2278
- r[p] = R;
2341
+ const p = ce(a), y = o.get(s) ?? void 0, d = st(y, t.params[u], p);
2342
+ r[u] = d;
2279
2343
  }
2280
2344
  return r;
2281
2345
  }
2282
- function So(t, e = {}, r = {}) {
2283
- const n = Ro(t, {
2346
+ function fo(t, e = {}, r = {}) {
2347
+ const n = so(t, {
2284
2348
  params: e,
2285
2349
  query: r.query,
2286
2350
  hash: r.hash
2287
- }), { search: o, hash: a } = I(n);
2351
+ }), { search: o, hash: s } = I(n);
2288
2352
  return {
2289
2353
  id: t.id,
2290
2354
  matched: t.matched,
2291
2355
  matches: t.matches,
2292
2356
  name: t.name,
2293
- query: pe(o),
2357
+ query: ge(o),
2294
2358
  params: we(t, n),
2295
- state: xr(t.state, r.state),
2296
- hash: a,
2359
+ state: Pr(t.state, r.state),
2360
+ hash: s,
2297
2361
  href: n
2298
2362
  };
2299
2363
  }
2300
- const Po = (t) => "name" in t.matched && !!t.matched.name, Ao = (t, e) => {
2364
+ const qt = { template: "<div>This is component</div>" }, ve = mt({
2365
+ name: "parentA",
2366
+ path: "/parentA/[paramA]"
2367
+ }), Ur = mt({
2368
+ parent: ve,
2369
+ name: "parentA.childA",
2370
+ path: "/childA/[?paramB]"
2371
+ }), lo = mt({
2372
+ parent: ve,
2373
+ name: "parentA.childB",
2374
+ path: "/childB/[paramD]",
2375
+ component: qt
2376
+ }), po = mt({
2377
+ parent: Ur,
2378
+ name: "parentA.childA.grandChildA",
2379
+ path: "/[paramC]",
2380
+ component: qt
2381
+ });
2382
+ mt({
2383
+ name: "parentB",
2384
+ path: "/parentB",
2385
+ component: qt
2386
+ }), mt({
2387
+ name: "parentC",
2388
+ path: "/",
2389
+ component: qt
2390
+ });
2391
+ const ho = (t) => "name" in t.matched && !!t.matched.name, mo = (t, e) => {
2301
2392
  const { pathname: r } = I(e);
2302
- return dn(t).test(r);
2303
- }, ko = (t, e) => {
2393
+ return en(t).test(r);
2394
+ }, yo = (t, e) => {
2304
2395
  const { search: r } = I(e);
2305
- return hn(t).every((o) => o.test(r));
2396
+ return rn(t).every((o) => o.test(r));
2306
2397
  }, ne = (t, e) => {
2307
2398
  const { hash: r } = I(e), { value: n } = t.hash;
2308
- return W(n) ? `#${n.replace(/^#*/, "")}`.toLowerCase() === r.toLowerCase() : !0;
2399
+ return F(n) ? `#${n.replace(/^#*/, "")}`.toLowerCase() === r.toLowerCase() : !0;
2309
2400
  };
2310
- function xo(t) {
2401
+ function Ro(t) {
2311
2402
  const { searchParams: e, pathname: r } = I(t), n = -1, o = 1;
2312
- return (a, s) => {
2313
- const p = Oe(a, e), h = Ze(a, r), u = Oe(s, e), m = Ze(s, r);
2314
- return a.depth > s.depth ? n : a.depth < s.depth ? o : p + h > u + m ? n : p + h < u + m ? o : ne(a, t) ? n : ne(s, t) ? o : 0;
2403
+ return (s, a) => {
2404
+ const u = $e(s, e), f = He(s, r), p = $e(a, e), y = He(a, r);
2405
+ return s.depth > a.depth ? n : s.depth < a.depth ? o : u + f > p + y ? n : u + f < p + y ? o : ne(s, t) ? n : ne(a, t) ? o : 0;
2315
2406
  };
2316
2407
  }
2317
- function Ze(t, e) {
2318
- const r = Object.keys(t.path.params).filter((o) => ce(t.path, o)).map((o) => o), n = r.filter((o) => Nr(e, t.path, o) === void 0);
2408
+ function He(t, e) {
2409
+ const r = Object.keys(t.path.params).filter((o) => ue(t.path, o)).map((o) => o), n = r.filter((o) => Ar(e, t.path, o) === void 0);
2319
2410
  return r.length - n.length;
2320
2411
  }
2321
- function Oe(t, e) {
2322
- const r = new URLSearchParams(e), n = new URLSearchParams(t.query.value), o = Array.from(n.keys()), a = o.filter((s) => !r.has(s));
2323
- return o.length - a.length;
2412
+ function $e(t, e) {
2413
+ const r = new URLSearchParams(e), n = new URLSearchParams(t.query.value), o = Array.from(n.keys()), s = o.filter((a) => !r.has(a));
2414
+ return o.length - s.length;
2324
2415
  }
2325
- const No = [
2326
- Po,
2327
- Ao,
2328
- ko,
2416
+ const go = [
2417
+ ho,
2418
+ mo,
2419
+ yo,
2329
2420
  ne,
2330
- Eo
2421
+ uo
2331
2422
  ];
2332
- function Lo(t, e) {
2333
- const r = xo(e);
2334
- return t.filter((n) => No.every((o) => o(n, e))).sort(r);
2423
+ function wo(t, e) {
2424
+ const r = Ro(e);
2425
+ return t.filter((n) => go.every((o) => o(n, e))).sort(r);
2335
2426
  }
2336
- function Uo(t, e, r) {
2337
- const n = Lo(t, e);
2427
+ function vo(t, e, r) {
2428
+ const n = wo(t, e);
2338
2429
  if (!n.length)
2339
2430
  return;
2340
- const [o] = n, { searchParams: a, hash: s } = I(e);
2431
+ const [o] = n, { searchParams: s, hash: a } = I(e);
2341
2432
  return {
2342
2433
  id: o.id,
2343
2434
  matched: o.matched,
2344
2435
  matches: o.matches,
2345
2436
  name: o.name,
2346
- query: pe(a),
2437
+ query: ge(s),
2347
2438
  params: we(o, e),
2348
- state: xr(o.state, r),
2349
- hash: s,
2350
- href: He(e)
2439
+ state: Pr(o.state, r),
2440
+ hash: a,
2441
+ href: sr(e)
2351
2442
  };
2352
2443
  }
2353
- function je(t, e) {
2354
- const r = typeof t == "string" ? I(t) : t, n = typeof e == "string" ? I(e) : e, o = r.searchParams ?? new URLSearchParams(r.search), a = n.searchParams ?? new URLSearchParams(n.search);
2355
- return Ur({
2356
- protocol: W(n.protocol) ? n.protocol : r.protocol,
2357
- host: W(n.host) ? n.host : r.host,
2358
- pathname: W(n.pathname) ? n.pathname : r.pathname,
2359
- searchParams: me(a, o),
2360
- hash: W(n.hash) ? n.hash : r.hash
2444
+ function qe(t, e) {
2445
+ const r = typeof t == "string" ? I(t) : t, n = typeof e == "string" ? I(e) : e, o = r.searchParams ?? new URLSearchParams(r.search), s = n.searchParams ?? new URLSearchParams(n.search);
2446
+ return Lr({
2447
+ protocol: F(n.protocol) ? n.protocol : r.protocol,
2448
+ host: F(n.host) ? n.host : r.host,
2449
+ pathname: F(n.pathname) ? n.pathname : r.pathname,
2450
+ searchParams: ye(s, o),
2451
+ hash: F(n.hash) ? n.hash : r.hash
2361
2452
  });
2362
2453
  }
2363
- function Bo(t, e) {
2364
- return W(e) ? t.map((r) => {
2454
+ function Eo(t, e) {
2455
+ return F(e) ? t.map((r) => {
2365
2456
  const n = `${e}${r.path.value}`;
2366
2457
  return {
2367
2458
  ...r,
2368
- path: K(n, r.path.params)
2459
+ path: Y(n, r.path.params)
2369
2460
  };
2370
2461
  }) : t;
2371
2462
  }
2372
- class Co extends Error {
2463
+ class bo extends Error {
2373
2464
  /**
2374
2465
  * Constructs a new DuplicateNamesError instance with a message indicating the problematic name.
2375
2466
  * @param name - The name of the name that was duplicated.
@@ -2378,288 +2469,273 @@ class Co extends Error {
2378
2469
  super(`Invalid Name "${e}": Router does not support multiple routes with the same name. All name names must be unique.`);
2379
2470
  }
2380
2471
  }
2381
- function Vo(t) {
2472
+ function So(t) {
2382
2473
  const e = t.map(({ name: r }) => r);
2383
2474
  for (const r of e)
2384
2475
  if (De(e, r) > 1)
2385
- throw new Co(r);
2476
+ throw new bo(r);
2386
2477
  }
2387
- function Zo(t, e = [], r) {
2478
+ function Po(t, e = [], r) {
2388
2479
  const n = [
2389
2480
  ...t,
2390
2481
  ...e.map((o) => o.routes)
2391
- ].flat();
2392
- return Vo(n), Bo(n, r);
2482
+ ].flat().filter((o) => F(o.name));
2483
+ return So(n), Eo(n, r);
2393
2484
  }
2394
- function Oo(t = {}, e = []) {
2395
- const r = new st();
2396
- return ft("onBeforeRouteEnter", t, e).forEach((n) => r.onBeforeRouteEnter.add(n)), ft("onBeforeRouteUpdate", t, e).forEach((n) => r.onBeforeRouteUpdate.add(n)), ft("onBeforeRouteLeave", t, e).forEach((n) => r.onBeforeRouteLeave.add(n)), ft("onAfterRouteEnter", t, e).forEach((n) => r.onAfterRouteEnter.add(n)), ft("onAfterRouteUpdate", t, e).forEach((n) => r.onAfterRouteUpdate.add(n)), ft("onAfterRouteLeave", t, e).forEach((n) => r.onAfterRouteLeave.add(n)), r;
2485
+ function Ao(t = {}, e = []) {
2486
+ const r = new Et();
2487
+ return ct("onBeforeRouteEnter", t, e).forEach((n) => r.onBeforeRouteEnter.add(n)), ct("onBeforeRouteUpdate", t, e).forEach((n) => r.onBeforeRouteUpdate.add(n)), ct("onBeforeRouteLeave", t, e).forEach((n) => r.onBeforeRouteLeave.add(n)), ct("onAfterRouteEnter", t, e).forEach((n) => r.onAfterRouteEnter.add(n)), ct("onAfterRouteUpdate", t, e).forEach((n) => r.onAfterRouteUpdate.add(n)), ct("onAfterRouteLeave", t, e).forEach((n) => r.onAfterRouteLeave.add(n)), r;
2397
2488
  }
2398
- function ft(t, e, r) {
2489
+ function ct(t, e, r) {
2399
2490
  return [
2400
2491
  e[t],
2401
2492
  ...r.map((o) => o[t])
2402
2493
  ].flat().filter((o) => o !== void 0);
2403
2494
  }
2404
- function Wo(t, e, r = []) {
2405
- const n = Zo(t, r, e == null ? void 0 : e.base), o = to();
2406
- o.addGlobalRouteHooks(Oo(e, r));
2407
- const a = de(), s = Bn(), p = Mn(), h = mo(), u = io({
2408
- mode: e == null ? void 0 : e.historyMode,
2409
- listener: ({ location: b }) => {
2410
- const B = nt(b);
2411
- R(B, { state: b.state, replace: !0 });
2495
+ function ko(t, { match: e, name: r, component: n }) {
2496
+ const o = Rr(t), s = Ft(t);
2497
+ return gt({
2498
+ name: "PropsWrapper",
2499
+ expose: [],
2500
+ setup() {
2501
+ const a = $r(), u = o(), f = s();
2502
+ return () => {
2503
+ const p = u.getProps(e.id, r, f);
2504
+ return p instanceof Error ? "" : oe(p) ? a?.suspense ? X(Uo, { component: n, props: p }) : X(Lo, { component: n, props: p }) : X(n, p);
2505
+ };
2412
2506
  }
2413
2507
  });
2414
- function m(b, B = {}) {
2415
- return Uo(n, b, B.state);
2508
+ }
2509
+ const Lo = gt((t) => {
2510
+ const e = St();
2511
+ return ot(() => t.props, async (r) => {
2512
+ e.value = await r;
2513
+ }, { immediate: !0, deep: !0 }), () => e.value instanceof Error ? "" : e.value ? X(t.component, e.value) : "";
2514
+ }, {
2515
+ props: ["component", "props"]
2516
+ }), Uo = gt(async (t) => {
2517
+ const e = St();
2518
+ return e.value = await t.props, ot(() => e.value, async (r) => {
2519
+ e.value = await r;
2520
+ }, { deep: !0 }), () => e.value instanceof Error ? "" : e.value ? X(t.component, e.value) : "";
2521
+ }, {
2522
+ props: ["component", "props"]
2523
+ });
2524
+ function xo(t) {
2525
+ const e = /* @__PURE__ */ new Map();
2526
+ return {
2527
+ getRouteComponents: (n) => {
2528
+ const o = e.get(n.id);
2529
+ if (o)
2530
+ return o;
2531
+ const s = No(t, n);
2532
+ return e.set(n.id, s), s;
2533
+ }
2534
+ };
2535
+ }
2536
+ function No(t, e) {
2537
+ const r = me(t);
2538
+ return nr(e) ? Ie(t, e, e.components) : rr(e) ? Ie(t, e, { default: e.component }) : { default: r };
2539
+ }
2540
+ function Ie(t, e, r) {
2541
+ return Object.fromEntries(
2542
+ Object.entries(r).map(([n, o]) => [n, ko(t, { match: e, name: n, component: o })])
2543
+ );
2544
+ }
2545
+ const xr = Symbol();
2546
+ function Ho(t, e, r = []) {
2547
+ const o = e?.isGlobalRouter ?? !0 ? xr : Symbol(), s = Po(t, r, e?.base), a = An();
2548
+ a.addGlobalRouteHooks(Ao(e, r));
2549
+ const u = le(), f = Gn(), p = xo(o), y = no(), d = Qn({
2550
+ mode: e?.historyMode,
2551
+ listener: ({ location: S }) => {
2552
+ const B = nt(S);
2553
+ E(B, { state: S.state, replace: !0 });
2554
+ }
2555
+ });
2556
+ function A(S, B = {}) {
2557
+ return vo(s, S, B.state);
2416
2558
  }
2417
- async function R(b, B = {}) {
2418
- const G = a();
2419
- if (u.stopListening(), k(b)) {
2420
- u.update(b, B);
2559
+ async function E(S, B = {}) {
2560
+ const _ = u();
2561
+ if (d.stopListening(), V(S)) {
2562
+ d.update(S, B);
2421
2563
  return;
2422
2564
  }
2423
- const D = m(b, B) ?? c("NotFound"), H = Br(G), Y = await o.runBeforeRouteHooks({ to: D, from: H });
2424
- switch (Y.status) {
2565
+ const J = A(S, B) ?? c("NotFound"), q = Br(_), K = await a.runBeforeRouteHooks({ to: J, from: q });
2566
+ switch (K.status) {
2425
2567
  // On abort do nothing
2426
2568
  case "ABORT":
2427
2569
  return;
2428
2570
  // On push update the history, and push new route, and return
2429
2571
  case "PUSH":
2430
- u.update(b, B), await S(...Y.to);
2572
+ d.update(S, B), await R(...K.to);
2431
2573
  return;
2432
2574
  // On reject update the history, the route, and set the rejection type
2433
2575
  case "REJECT":
2434
- u.update(b, B), i(Y.type);
2576
+ d.update(S, B), g(K.type);
2435
2577
  break;
2436
2578
  // On success update history, set the route, and clear the rejection
2437
2579
  case "SUCCESS":
2438
- u.update(b, B), i(null);
2580
+ d.update(S, B), g(null);
2439
2581
  break;
2440
2582
  default:
2441
- throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(Y)}`);
2583
+ throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(K)}`);
2442
2584
  }
2443
- const Tt = G;
2444
- s.setProps(D).then((J) => {
2445
- if (Tt === G)
2446
- switch (J.status) {
2585
+ const Mt = _;
2586
+ f.setProps(J).then((T) => {
2587
+ if (Mt === _)
2588
+ switch (T.status) {
2447
2589
  case "SUCCESS":
2448
2590
  break;
2449
2591
  case "PUSH":
2450
- S(...J.to);
2592
+ R(...T.to);
2451
2593
  break;
2452
2594
  case "REJECT":
2453
- i(J.type);
2595
+ g(T.type);
2454
2596
  break;
2455
2597
  default:
2456
- const Mt = J;
2457
- throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify(Mt)}`);
2598
+ const Wt = T;
2599
+ throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify(Wt)}`);
2458
2600
  }
2459
- }), P(D);
2460
- const F = await o.runAfterRouteHooks({ to: D, from: H });
2461
- switch (F.status) {
2601
+ }), l(J);
2602
+ const W = await a.runAfterRouteHooks({ to: J, from: q });
2603
+ switch (W.status) {
2462
2604
  case "PUSH":
2463
- await S(...F.to);
2605
+ await R(...W.to);
2464
2606
  break;
2465
2607
  case "REJECT":
2466
- i(F.type);
2608
+ g(W.type);
2467
2609
  break;
2468
2610
  case "SUCCESS":
2469
2611
  break;
2470
2612
  default:
2471
- const J = F;
2472
- throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(J)}`);
2613
+ const T = W;
2614
+ throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(T)}`);
2473
2615
  }
2474
- u.startListening();
2475
- }
2476
- const L = (b, B = {}, G = {}) => {
2477
- const D = n.find((H) => H.name === b);
2478
- if (!D)
2479
- throw new go(String(b));
2480
- return So(D, B, G);
2481
- }, S = (b, B, G) => {
2482
- if (M(b)) {
2483
- const F = { ...B }, J = je(b, {
2484
- searchParams: F.query,
2485
- hash: F.hash
2616
+ d.startListening();
2617
+ }
2618
+ const N = (S, B = {}, _ = {}) => {
2619
+ const J = s.find((q) => q.name === S);
2620
+ if (!J)
2621
+ throw new oo(S);
2622
+ return fo(J, B, _);
2623
+ }, R = (S, B, _) => {
2624
+ if (G(S)) {
2625
+ const W = { ...B }, T = qe(S, {
2626
+ searchParams: W.query,
2627
+ hash: W.hash
2486
2628
  });
2487
- return R(J, F);
2629
+ return E(T, W);
2488
2630
  }
2489
- if (typeof b == "string") {
2490
- const { replace: F, ...J } = { ...G }, Mt = { ...B }, Wt = L(b, Mt, J), Vr = Ce({ ...Wt.matched.state }, { ...Wt.state, ...J.state });
2491
- return R(Wt.href, { replace: F, state: Vr });
2631
+ if (typeof S == "string") {
2632
+ const { replace: W, ...T } = { ..._ }, Wt = { ...B }, Gt = N(S, Wt, T), Cr = je({ ...Gt.matched.state }, { ...Gt.state, ...T.state });
2633
+ return E(Gt.href, { replace: W, state: Cr });
2492
2634
  }
2493
- const { replace: D, ...H } = { ...B }, Y = Ce({ ...b.matched.state }, { ...b.state, ...H.state }), Tt = je(b.href, {
2494
- searchParams: H.query,
2495
- hash: H.hash
2635
+ const { replace: J, ...q } = { ...B }, K = je({ ...S.matched.state }, { ...S.state, ...q.state }), Mt = qe(S.href, {
2636
+ searchParams: q.query,
2637
+ hash: q.hash
2496
2638
  });
2497
- return R(Tt, { replace: D, state: Y });
2498
- }, U = (b, B, G) => {
2499
- if (M(b)) {
2500
- const H = { ...B, replace: !0 };
2501
- return S(b, H);
2502
- }
2503
- if (typeof b == "string") {
2504
- const H = { ...G, replace: !0 }, Y = { ...B };
2505
- return S(b, Y, H);
2506
- }
2507
- const D = { ...B, replace: !0 };
2508
- return S(b, D);
2509
- }, v = (b) => {
2510
- i(b);
2511
- }, { setRejection: i, rejection: f, getRejectionRoute: c } = fo({
2512
- ...r.reduce((b, B) => ({ ...b, ...B.rejections }), {}),
2513
- ...e == null ? void 0 : e.rejections
2514
- }), l = c("NotFound"), { currentRoute: E, routerRoute: A, updateRoute: P } = no(l, S), g = po(e == null ? void 0 : e.initialUrl), d = u.location.state, { host: y } = I(g), k = so(y);
2515
- let x = !1;
2516
- const C = Pt(!1), { promise: j, resolve: _ } = Promise.withResolvers();
2517
- async function q() {
2518
- if (x)
2519
- return j;
2520
- x = !0, nn(n) && await on(), await R(g, { replace: !0, state: d }), u.startListening(), _(), C.value = !0;
2521
- }
2522
- function ve() {
2523
- u.stopListening();
2524
- }
2525
- function Br(b) {
2526
- return kn(b) ? null : { ...E };
2527
- }
2528
- function Cr(b) {
2529
- o.setVueApp(b), s.setVueApp(b), b.component("RouterView", wr), b.component("RouterLink", In), b.provide(mr, f), b.provide(vr, o), b.provide(pr, s), b.provide(Rr, p), b.provide(hr, h), b.provide(Ie, Ee), q();
2530
- }
2531
- const Ee = {
2532
- route: A,
2533
- resolve: L,
2534
- find: m,
2535
- push: S,
2536
- replace: U,
2537
- reject: v,
2538
- refresh: u.refresh,
2539
- forward: u.forward,
2540
- back: u.back,
2541
- go: u.go,
2542
- install: Cr,
2543
- isExternal: k,
2544
- onBeforeRouteEnter: o.onBeforeRouteEnter,
2545
- onBeforeRouteUpdate: o.onBeforeRouteUpdate,
2546
- onBeforeRouteLeave: o.onBeforeRouteLeave,
2547
- onAfterRouteEnter: o.onAfterRouteEnter,
2548
- onAfterRouteUpdate: o.onAfterRouteUpdate,
2549
- onAfterRouteLeave: o.onAfterRouteLeave,
2550
- prefetch: e == null ? void 0 : e.prefetch,
2551
- start: q,
2552
- started: C,
2553
- stop: ve
2554
- };
2555
- return Ee;
2556
- }
2557
- function Go(t) {
2558
- return {
2559
- routes: t.routes ?? [],
2560
- rejections: t.rejections ?? {},
2561
- ...t
2562
- };
2563
- }
2564
- function jo(t) {
2565
- return {
2566
- get: (e, { invalid: r }) => {
2567
- for (const n of t) {
2568
- const o = ee(e, n);
2569
- if (o !== void 0)
2570
- return o;
2571
- }
2572
- throw r(`Value ${e} does not satisfy any of the possible values`);
2573
- },
2574
- set: (e, { invalid: r }) => {
2575
- for (const n of t) {
2576
- const o = ln(e, n);
2577
- if (o !== void 0)
2578
- return o;
2579
- }
2580
- throw r(`Value ${e} does not satisfy any of the possible values`);
2639
+ return E(Mt, { replace: J, state: K });
2640
+ }, k = (S, B, _) => {
2641
+ if (G(S)) {
2642
+ const q = { ...B, replace: !0 };
2643
+ return R(S, q);
2581
2644
  }
2582
- };
2583
- }
2584
- const $o = {
2585
- separator: ","
2586
- };
2587
- function Qo(t, e = {}) {
2588
- const { separator: r } = { ...$o, ...e }, n = jo(t);
2589
- return {
2590
- get: (o, a) => o.split(r).map((s) => n.get(s, a)),
2591
- set: (o, a) => {
2592
- if (!Array.isArray(o))
2593
- throw a.invalid("Expected an array");
2594
- return o.map((s) => n.set(s, a)).join(r);
2595
- }
2596
- };
2597
- }
2598
- const _o = {
2599
- separator: ","
2600
- };
2601
- function zo(t, e = {}) {
2602
- const { separator: r } = { ..._o, ...e };
2603
- return {
2604
- get: (n) => {
2605
- const o = n.split(r);
2606
- return t.map((a, s) => at(o.at(s), a));
2607
- },
2608
- set: (n, { invalid: o }) => {
2609
- if (!Array.isArray(n))
2610
- throw o("Expected a tuple");
2611
- if (n.length !== t.length)
2612
- throw o(`Expected tuple with ${t.length} values but received ${n.length} values`);
2613
- return t.map((a, s) => z(n.at(s), a)).join(r);
2645
+ if (typeof S == "string") {
2646
+ const q = { ..._, replace: !0 }, K = { ...B };
2647
+ return R(S, K, q);
2614
2648
  }
2649
+ const J = { ...B, replace: !0 };
2650
+ return R(S, J);
2651
+ }, h = (S) => {
2652
+ g(S);
2653
+ }, { setRejection: g, rejection: i, getRejectionRoute: c } = Kn({
2654
+ ...r.reduce((S, B) => ({ ...S, ...B.rejections }), {}),
2655
+ ...e?.rejections
2656
+ }), b = c("NotFound"), { currentRoute: L, routerRoute: m, updateRoute: l } = Tn(o, b, R), w = to(e?.initialUrl), v = d.location.state, { host: U } = I(w), V = Wn(U);
2657
+ let Z = !1;
2658
+ const $ = St(!1), { promise: D, resolve: Ee } = Promise.withResolvers();
2659
+ async function be() {
2660
+ if (Z)
2661
+ return D;
2662
+ Z = !0, Mr(s) && await Wr(), await E(w, { replace: !0, state: v }), d.startListening(), Ee(), $.value = !0;
2663
+ }
2664
+ function Nr() {
2665
+ d.stopListening();
2666
+ }
2667
+ function Br(S) {
2668
+ return wn(S) ? null : { ...L };
2669
+ }
2670
+ function Vr(S) {
2671
+ a.setVueApp(S), f.setVueApp(S);
2672
+ const B = me(o), _ = Er(o);
2673
+ S.component("RouterView", B), S.component("RouterLink", _), S.provide(hr(o), i), S.provide(lr(o), a), S.provide(yr(o), f), S.provide(dr(o), p), S.provide(wr, y), S.provide(o, Se), be();
2674
+ }
2675
+ const Se = {
2676
+ route: m,
2677
+ resolve: N,
2678
+ find: A,
2679
+ push: R,
2680
+ replace: k,
2681
+ reject: h,
2682
+ refresh: d.refresh,
2683
+ forward: d.forward,
2684
+ back: d.back,
2685
+ go: d.go,
2686
+ install: Vr,
2687
+ isExternal: V,
2688
+ onBeforeRouteEnter: a.onBeforeRouteEnter,
2689
+ onBeforeRouteUpdate: a.onBeforeRouteUpdate,
2690
+ onBeforeRouteLeave: a.onBeforeRouteLeave,
2691
+ onAfterRouteEnter: a.onAfterRouteEnter,
2692
+ onAfterRouteUpdate: a.onAfterRouteUpdate,
2693
+ onAfterRouteLeave: a.onAfterRouteLeave,
2694
+ prefetch: e?.prefetch,
2695
+ start: be,
2696
+ started: $,
2697
+ stop: Nr,
2698
+ key: o
2615
2699
  };
2700
+ return Se;
2616
2701
  }
2617
- const Ko = K, Yo = K, Xo = K;
2618
- function ta(t) {
2619
- const e = he(), r = sr(t.name), n = et(t.path), o = et(t.query), a = et(t.hash), s = t.meta ?? {}, p = et(t.host), h = Ut({ id: e, meta: {}, state: {}, ...t }), u = {
2620
- id: e,
2621
- matched: h,
2622
- matches: [h],
2623
- name: r,
2624
- host: p,
2625
- path: n,
2626
- query: o,
2627
- hash: a,
2628
- meta: s,
2629
- depth: 1,
2630
- state: {}
2631
- }, m = rr(t) ? ar(t.parent, u) : u;
2632
- return bt(m.path.params, m.query.params, m.host.params, m.hash.params), m;
2633
- }
2702
+ const $o = Y, qo = Y, Io = Y, M = $n(xr), Do = M.onBeforeRouteLeave, _o = M.onBeforeRouteUpdate, Jo = M.onAfterRouteLeave, To = M.onAfterRouteUpdate, Fo = M.isRoute, Mo = M.RouterView, Wo = M.RouterLink, Go = M.useRoute, Qo = M.useRouter, zo = M.useQueryValue, Yo = M.useLink;
2634
2703
  export {
2635
- Gr as DuplicateParamsError,
2636
- Qr as MetaPropertyConflict,
2637
- In as RouterLink,
2638
- Et as RouterNotInstalledError,
2639
- wr as RouterView,
2640
- zr as UseRouteInvalidError,
2641
- Qo as arrayOf,
2642
- He as asUrl,
2643
- ta as createExternalRoute,
2644
- Xr as createParam,
2645
- gt as createRoute,
2646
- Wo as createRouter,
2647
- Go as createRouterPlugin,
2648
- Yo as host,
2649
- re as isRoute,
2650
- M as isUrl,
2651
- To as onAfterRouteLeave,
2652
- Mo as onAfterRouteUpdate,
2653
- Jo as onBeforeRouteLeave,
2654
- Fo as onBeforeRouteUpdate,
2655
- Ko as path,
2656
- Xo as query,
2657
- zo as tupleOf,
2658
- jo as unionOf,
2659
- _n as useLink,
2660
- Do as useQueryValue,
2661
- ge as useRoute,
2662
- It as useRouter,
2663
- Io as withDefault,
2664
- K as withParams
2704
+ qr as DuplicateParamsError,
2705
+ pn as MetaPropertyConflict,
2706
+ Wo as RouterLink,
2707
+ vt as RouterNotInstalledError,
2708
+ Mo as RouterView,
2709
+ Rn as UseRouteInvalidError,
2710
+ jo as arrayOf,
2711
+ sr as asUrl,
2712
+ or as combineRoutes,
2713
+ Co as createExternalRoute,
2714
+ _r as createParam,
2715
+ mt as createRoute,
2716
+ Ho as createRouter,
2717
+ $n as createRouterAssets,
2718
+ Oo as createRouterPlugin,
2719
+ qo as host,
2720
+ Fo as isRoute,
2721
+ G as isUrl,
2722
+ rr as isWithComponent,
2723
+ Pe as isWithComponentProps,
2724
+ Ae as isWithComponentPropsRecord,
2725
+ nr as isWithComponents,
2726
+ er as isWithParent,
2727
+ Jo as onAfterRouteLeave,
2728
+ To as onAfterRouteUpdate,
2729
+ Do as onBeforeRouteLeave,
2730
+ _o as onBeforeRouteUpdate,
2731
+ $o as path,
2732
+ Io as query,
2733
+ Zo as tupleOf,
2734
+ qn as unionOf,
2735
+ Yo as useLink,
2736
+ zo as useQueryValue,
2737
+ Go as useRoute,
2738
+ Qo as useRouter,
2739
+ Vo as withDefault,
2740
+ Y as withParams
2665
2741
  };