@kitbag/router 0.20.6 → 0.20.8

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