@stoneforge/quarry 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (330) hide show
  1. package/LICENSE +13 -0
  2. package/README.md +160 -0
  3. package/dist/api/index.d.ts +8 -0
  4. package/dist/api/index.d.ts.map +1 -0
  5. package/dist/api/index.js +8 -0
  6. package/dist/api/index.js.map +1 -0
  7. package/dist/api/quarry-api.d.ts +268 -0
  8. package/dist/api/quarry-api.d.ts.map +1 -0
  9. package/dist/api/quarry-api.js +3905 -0
  10. package/dist/api/quarry-api.js.map +1 -0
  11. package/dist/api/types.d.ts +1359 -0
  12. package/dist/api/types.d.ts.map +1 -0
  13. package/dist/api/types.js +204 -0
  14. package/dist/api/types.js.map +1 -0
  15. package/dist/bin/sf.d.ts +3 -0
  16. package/dist/bin/sf.d.ts.map +1 -0
  17. package/dist/bin/sf.js +9 -0
  18. package/dist/bin/sf.js.map +1 -0
  19. package/dist/cli/commands/admin.d.ts +11 -0
  20. package/dist/cli/commands/admin.d.ts.map +1 -0
  21. package/dist/cli/commands/admin.js +465 -0
  22. package/dist/cli/commands/admin.js.map +1 -0
  23. package/dist/cli/commands/alias.d.ts +8 -0
  24. package/dist/cli/commands/alias.d.ts.map +1 -0
  25. package/dist/cli/commands/alias.js +70 -0
  26. package/dist/cli/commands/alias.js.map +1 -0
  27. package/dist/cli/commands/channel.d.ts +13 -0
  28. package/dist/cli/commands/channel.d.ts.map +1 -0
  29. package/dist/cli/commands/channel.js +680 -0
  30. package/dist/cli/commands/channel.js.map +1 -0
  31. package/dist/cli/commands/completion.d.ts +8 -0
  32. package/dist/cli/commands/completion.d.ts.map +1 -0
  33. package/dist/cli/commands/completion.js +87 -0
  34. package/dist/cli/commands/completion.js.map +1 -0
  35. package/dist/cli/commands/config.d.ts +12 -0
  36. package/dist/cli/commands/config.d.ts.map +1 -0
  37. package/dist/cli/commands/config.js +242 -0
  38. package/dist/cli/commands/config.js.map +1 -0
  39. package/dist/cli/commands/crud.d.ts +64 -0
  40. package/dist/cli/commands/crud.d.ts.map +1 -0
  41. package/dist/cli/commands/crud.js +805 -0
  42. package/dist/cli/commands/crud.js.map +1 -0
  43. package/dist/cli/commands/dep.d.ts +16 -0
  44. package/dist/cli/commands/dep.d.ts.map +1 -0
  45. package/dist/cli/commands/dep.js +499 -0
  46. package/dist/cli/commands/dep.js.map +1 -0
  47. package/dist/cli/commands/document.d.ts +12 -0
  48. package/dist/cli/commands/document.d.ts.map +1 -0
  49. package/dist/cli/commands/document.js +1039 -0
  50. package/dist/cli/commands/document.js.map +1 -0
  51. package/dist/cli/commands/embeddings.d.ts +12 -0
  52. package/dist/cli/commands/embeddings.d.ts.map +1 -0
  53. package/dist/cli/commands/embeddings.js +273 -0
  54. package/dist/cli/commands/embeddings.js.map +1 -0
  55. package/dist/cli/commands/entity.d.ts +16 -0
  56. package/dist/cli/commands/entity.d.ts.map +1 -0
  57. package/dist/cli/commands/entity.js +522 -0
  58. package/dist/cli/commands/entity.js.map +1 -0
  59. package/dist/cli/commands/gc.d.ts +10 -0
  60. package/dist/cli/commands/gc.d.ts.map +1 -0
  61. package/dist/cli/commands/gc.js +257 -0
  62. package/dist/cli/commands/gc.js.map +1 -0
  63. package/dist/cli/commands/help.d.ts +11 -0
  64. package/dist/cli/commands/help.d.ts.map +1 -0
  65. package/dist/cli/commands/help.js +169 -0
  66. package/dist/cli/commands/help.js.map +1 -0
  67. package/dist/cli/commands/history.d.ts +9 -0
  68. package/dist/cli/commands/history.d.ts.map +1 -0
  69. package/dist/cli/commands/history.js +160 -0
  70. package/dist/cli/commands/history.js.map +1 -0
  71. package/dist/cli/commands/identity.d.ts +18 -0
  72. package/dist/cli/commands/identity.d.ts.map +1 -0
  73. package/dist/cli/commands/identity.js +698 -0
  74. package/dist/cli/commands/identity.js.map +1 -0
  75. package/dist/cli/commands/inbox.d.ts +20 -0
  76. package/dist/cli/commands/inbox.d.ts.map +1 -0
  77. package/dist/cli/commands/inbox.js +493 -0
  78. package/dist/cli/commands/inbox.js.map +1 -0
  79. package/dist/cli/commands/init.d.ts +20 -0
  80. package/dist/cli/commands/init.d.ts.map +1 -0
  81. package/dist/cli/commands/init.js +144 -0
  82. package/dist/cli/commands/init.js.map +1 -0
  83. package/dist/cli/commands/install.d.ts +9 -0
  84. package/dist/cli/commands/install.d.ts.map +1 -0
  85. package/dist/cli/commands/install.js +200 -0
  86. package/dist/cli/commands/install.js.map +1 -0
  87. package/dist/cli/commands/library.d.ts +12 -0
  88. package/dist/cli/commands/library.d.ts.map +1 -0
  89. package/dist/cli/commands/library.js +665 -0
  90. package/dist/cli/commands/library.js.map +1 -0
  91. package/dist/cli/commands/message.d.ts +11 -0
  92. package/dist/cli/commands/message.d.ts.map +1 -0
  93. package/dist/cli/commands/message.js +608 -0
  94. package/dist/cli/commands/message.js.map +1 -0
  95. package/dist/cli/commands/plan.d.ts +17 -0
  96. package/dist/cli/commands/plan.d.ts.map +1 -0
  97. package/dist/cli/commands/plan.js +698 -0
  98. package/dist/cli/commands/plan.js.map +1 -0
  99. package/dist/cli/commands/playbook.d.ts +12 -0
  100. package/dist/cli/commands/playbook.d.ts.map +1 -0
  101. package/dist/cli/commands/playbook.js +730 -0
  102. package/dist/cli/commands/playbook.js.map +1 -0
  103. package/dist/cli/commands/reset.d.ts +12 -0
  104. package/dist/cli/commands/reset.d.ts.map +1 -0
  105. package/dist/cli/commands/reset.js +306 -0
  106. package/dist/cli/commands/reset.js.map +1 -0
  107. package/dist/cli/commands/serve.d.ts +11 -0
  108. package/dist/cli/commands/serve.d.ts.map +1 -0
  109. package/dist/cli/commands/serve.js +106 -0
  110. package/dist/cli/commands/serve.js.map +1 -0
  111. package/dist/cli/commands/stats.d.ts +8 -0
  112. package/dist/cli/commands/stats.d.ts.map +1 -0
  113. package/dist/cli/commands/stats.js +82 -0
  114. package/dist/cli/commands/stats.js.map +1 -0
  115. package/dist/cli/commands/sync.d.ts +14 -0
  116. package/dist/cli/commands/sync.d.ts.map +1 -0
  117. package/dist/cli/commands/sync.js +370 -0
  118. package/dist/cli/commands/sync.js.map +1 -0
  119. package/dist/cli/commands/task.d.ts +25 -0
  120. package/dist/cli/commands/task.d.ts.map +1 -0
  121. package/dist/cli/commands/task.js +1153 -0
  122. package/dist/cli/commands/task.js.map +1 -0
  123. package/dist/cli/commands/team.d.ts +13 -0
  124. package/dist/cli/commands/team.d.ts.map +1 -0
  125. package/dist/cli/commands/team.js +471 -0
  126. package/dist/cli/commands/team.js.map +1 -0
  127. package/dist/cli/commands/workflow.d.ts +16 -0
  128. package/dist/cli/commands/workflow.d.ts.map +1 -0
  129. package/dist/cli/commands/workflow.js +753 -0
  130. package/dist/cli/commands/workflow.js.map +1 -0
  131. package/dist/cli/completion.d.ts +28 -0
  132. package/dist/cli/completion.d.ts.map +1 -0
  133. package/dist/cli/completion.js +295 -0
  134. package/dist/cli/completion.js.map +1 -0
  135. package/dist/cli/db.d.ts +38 -0
  136. package/dist/cli/db.d.ts.map +1 -0
  137. package/dist/cli/db.js +90 -0
  138. package/dist/cli/db.js.map +1 -0
  139. package/dist/cli/formatter.d.ts +87 -0
  140. package/dist/cli/formatter.d.ts.map +1 -0
  141. package/dist/cli/formatter.js +464 -0
  142. package/dist/cli/formatter.js.map +1 -0
  143. package/dist/cli/index.d.ts +33 -0
  144. package/dist/cli/index.d.ts.map +1 -0
  145. package/dist/cli/index.js +38 -0
  146. package/dist/cli/index.js.map +1 -0
  147. package/dist/cli/parser.d.ts +45 -0
  148. package/dist/cli/parser.d.ts.map +1 -0
  149. package/dist/cli/parser.js +256 -0
  150. package/dist/cli/parser.js.map +1 -0
  151. package/dist/cli/plugin-loader.d.ts +39 -0
  152. package/dist/cli/plugin-loader.d.ts.map +1 -0
  153. package/dist/cli/plugin-loader.js +165 -0
  154. package/dist/cli/plugin-loader.js.map +1 -0
  155. package/dist/cli/plugin-registry.d.ts +50 -0
  156. package/dist/cli/plugin-registry.d.ts.map +1 -0
  157. package/dist/cli/plugin-registry.js +206 -0
  158. package/dist/cli/plugin-registry.js.map +1 -0
  159. package/dist/cli/plugin-types.d.ts +106 -0
  160. package/dist/cli/plugin-types.d.ts.map +1 -0
  161. package/dist/cli/plugin-types.js +103 -0
  162. package/dist/cli/plugin-types.js.map +1 -0
  163. package/dist/cli/runner.d.ts +35 -0
  164. package/dist/cli/runner.d.ts.map +1 -0
  165. package/dist/cli/runner.js +340 -0
  166. package/dist/cli/runner.js.map +1 -0
  167. package/dist/cli/suggest.d.ts +15 -0
  168. package/dist/cli/suggest.d.ts.map +1 -0
  169. package/dist/cli/suggest.js +49 -0
  170. package/dist/cli/suggest.js.map +1 -0
  171. package/dist/cli/types.d.ts +138 -0
  172. package/dist/cli/types.d.ts.map +1 -0
  173. package/dist/cli/types.js +63 -0
  174. package/dist/cli/types.js.map +1 -0
  175. package/dist/config/config.d.ts +86 -0
  176. package/dist/config/config.d.ts.map +1 -0
  177. package/dist/config/config.js +348 -0
  178. package/dist/config/config.js.map +1 -0
  179. package/dist/config/defaults.d.ts +66 -0
  180. package/dist/config/defaults.d.ts.map +1 -0
  181. package/dist/config/defaults.js +114 -0
  182. package/dist/config/defaults.js.map +1 -0
  183. package/dist/config/duration.d.ts +75 -0
  184. package/dist/config/duration.d.ts.map +1 -0
  185. package/dist/config/duration.js +190 -0
  186. package/dist/config/duration.js.map +1 -0
  187. package/dist/config/env.d.ts +67 -0
  188. package/dist/config/env.d.ts.map +1 -0
  189. package/dist/config/env.js +207 -0
  190. package/dist/config/env.js.map +1 -0
  191. package/dist/config/file.d.ts +97 -0
  192. package/dist/config/file.d.ts.map +1 -0
  193. package/dist/config/file.js +365 -0
  194. package/dist/config/file.js.map +1 -0
  195. package/dist/config/index.d.ts +35 -0
  196. package/dist/config/index.d.ts.map +1 -0
  197. package/dist/config/index.js +41 -0
  198. package/dist/config/index.js.map +1 -0
  199. package/dist/config/merge.d.ts +53 -0
  200. package/dist/config/merge.d.ts.map +1 -0
  201. package/dist/config/merge.js +226 -0
  202. package/dist/config/merge.js.map +1 -0
  203. package/dist/config/types.d.ts +257 -0
  204. package/dist/config/types.d.ts.map +1 -0
  205. package/dist/config/types.js +72 -0
  206. package/dist/config/types.js.map +1 -0
  207. package/dist/config/validation.d.ts +55 -0
  208. package/dist/config/validation.d.ts.map +1 -0
  209. package/dist/config/validation.js +251 -0
  210. package/dist/config/validation.js.map +1 -0
  211. package/dist/http/index.d.ts +8 -0
  212. package/dist/http/index.d.ts.map +1 -0
  213. package/dist/http/index.js +12 -0
  214. package/dist/http/index.js.map +1 -0
  215. package/dist/http/sync-handlers.d.ts +162 -0
  216. package/dist/http/sync-handlers.d.ts.map +1 -0
  217. package/dist/http/sync-handlers.js +271 -0
  218. package/dist/http/sync-handlers.js.map +1 -0
  219. package/dist/index.d.ts +25 -0
  220. package/dist/index.d.ts.map +1 -0
  221. package/dist/index.js +69 -0
  222. package/dist/index.js.map +1 -0
  223. package/dist/server/index.d.ts +34 -0
  224. package/dist/server/index.d.ts.map +1 -0
  225. package/dist/server/index.js +3329 -0
  226. package/dist/server/index.js.map +1 -0
  227. package/dist/server/static.d.ts +18 -0
  228. package/dist/server/static.d.ts.map +1 -0
  229. package/dist/server/static.js +71 -0
  230. package/dist/server/static.js.map +1 -0
  231. package/dist/server/ws/broadcaster.d.ts +8 -0
  232. package/dist/server/ws/broadcaster.d.ts.map +1 -0
  233. package/dist/server/ws/broadcaster.js +7 -0
  234. package/dist/server/ws/broadcaster.js.map +1 -0
  235. package/dist/server/ws/handler.d.ts +55 -0
  236. package/dist/server/ws/handler.d.ts.map +1 -0
  237. package/dist/server/ws/handler.js +160 -0
  238. package/dist/server/ws/handler.js.map +1 -0
  239. package/dist/services/blocked-cache.d.ts +297 -0
  240. package/dist/services/blocked-cache.d.ts.map +1 -0
  241. package/dist/services/blocked-cache.js +755 -0
  242. package/dist/services/blocked-cache.js.map +1 -0
  243. package/dist/services/dependency.d.ts +205 -0
  244. package/dist/services/dependency.d.ts.map +1 -0
  245. package/dist/services/dependency.js +566 -0
  246. package/dist/services/dependency.js.map +1 -0
  247. package/dist/services/embeddings/fusion.d.ts +33 -0
  248. package/dist/services/embeddings/fusion.d.ts.map +1 -0
  249. package/dist/services/embeddings/fusion.js +34 -0
  250. package/dist/services/embeddings/fusion.js.map +1 -0
  251. package/dist/services/embeddings/index.d.ts +12 -0
  252. package/dist/services/embeddings/index.d.ts.map +1 -0
  253. package/dist/services/embeddings/index.js +10 -0
  254. package/dist/services/embeddings/index.js.map +1 -0
  255. package/dist/services/embeddings/local-provider.d.ts +31 -0
  256. package/dist/services/embeddings/local-provider.d.ts.map +1 -0
  257. package/dist/services/embeddings/local-provider.js +80 -0
  258. package/dist/services/embeddings/local-provider.js.map +1 -0
  259. package/dist/services/embeddings/service.d.ts +76 -0
  260. package/dist/services/embeddings/service.d.ts.map +1 -0
  261. package/dist/services/embeddings/service.js +153 -0
  262. package/dist/services/embeddings/service.js.map +1 -0
  263. package/dist/services/embeddings/types.d.ts +70 -0
  264. package/dist/services/embeddings/types.d.ts.map +1 -0
  265. package/dist/services/embeddings/types.js +8 -0
  266. package/dist/services/embeddings/types.js.map +1 -0
  267. package/dist/services/id-length-cache.d.ts +156 -0
  268. package/dist/services/id-length-cache.d.ts.map +1 -0
  269. package/dist/services/id-length-cache.js +197 -0
  270. package/dist/services/id-length-cache.js.map +1 -0
  271. package/dist/services/inbox.d.ts +147 -0
  272. package/dist/services/inbox.d.ts.map +1 -0
  273. package/dist/services/inbox.js +428 -0
  274. package/dist/services/inbox.js.map +1 -0
  275. package/dist/services/index.d.ts +10 -0
  276. package/dist/services/index.d.ts.map +1 -0
  277. package/dist/services/index.js +10 -0
  278. package/dist/services/index.js.map +1 -0
  279. package/dist/services/priority-service.d.ts +145 -0
  280. package/dist/services/priority-service.d.ts.map +1 -0
  281. package/dist/services/priority-service.js +272 -0
  282. package/dist/services/priority-service.js.map +1 -0
  283. package/dist/services/search-utils.d.ts +47 -0
  284. package/dist/services/search-utils.d.ts.map +1 -0
  285. package/dist/services/search-utils.js +83 -0
  286. package/dist/services/search-utils.js.map +1 -0
  287. package/dist/sync/hash.d.ts +48 -0
  288. package/dist/sync/hash.d.ts.map +1 -0
  289. package/dist/sync/hash.js +136 -0
  290. package/dist/sync/hash.js.map +1 -0
  291. package/dist/sync/index.d.ts +11 -0
  292. package/dist/sync/index.d.ts.map +1 -0
  293. package/dist/sync/index.js +16 -0
  294. package/dist/sync/index.js.map +1 -0
  295. package/dist/sync/merge.d.ts +80 -0
  296. package/dist/sync/merge.d.ts.map +1 -0
  297. package/dist/sync/merge.js +310 -0
  298. package/dist/sync/merge.js.map +1 -0
  299. package/dist/sync/serialization.d.ts +132 -0
  300. package/dist/sync/serialization.d.ts.map +1 -0
  301. package/dist/sync/serialization.js +306 -0
  302. package/dist/sync/serialization.js.map +1 -0
  303. package/dist/sync/service.d.ts +102 -0
  304. package/dist/sync/service.d.ts.map +1 -0
  305. package/dist/sync/service.js +493 -0
  306. package/dist/sync/service.js.map +1 -0
  307. package/dist/sync/types.d.ts +275 -0
  308. package/dist/sync/types.d.ts.map +1 -0
  309. package/dist/sync/types.js +76 -0
  310. package/dist/sync/types.js.map +1 -0
  311. package/dist/systems/identity.d.ts +479 -0
  312. package/dist/systems/identity.d.ts.map +1 -0
  313. package/dist/systems/identity.js +817 -0
  314. package/dist/systems/identity.js.map +1 -0
  315. package/dist/systems/index.d.ts +8 -0
  316. package/dist/systems/index.d.ts.map +1 -0
  317. package/dist/systems/index.js +29 -0
  318. package/dist/systems/index.js.map +1 -0
  319. package/package.json +121 -0
  320. package/web/assets/charts-vendor-D1YcbGux.js +55 -0
  321. package/web/assets/dnd-vendor-DmxE-_ZH.js +5 -0
  322. package/web/assets/editor-vendor-BxraAWts.js +279 -0
  323. package/web/assets/index-B77vv208.js +341 -0
  324. package/web/assets/index-CF_XnVLh.css +1 -0
  325. package/web/assets/router-vendor-BCKpRBrB.js +41 -0
  326. package/web/assets/ui-vendor-DUahGnbT.js +45 -0
  327. package/web/assets/utils-vendor-CfYKiENT.js +813 -0
  328. package/web/favicon.ico +0 -0
  329. package/web/index.html +23 -0
  330. package/web/logo.png +0 -0
@@ -0,0 +1,41 @@
1
+ var Mn=t=>{throw TypeError(t)};var bs=(t,e,s)=>e.has(t)||Mn("Cannot "+s);var l=(t,e,s)=>(bs(t,e,"read from private field"),s?s.call(t):e.get(t)),T=(t,e,s)=>e.has(t)?Mn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),C=(t,e,s,n)=>(bs(t,e,"write to private field"),n?n.call(t,s):e.set(t,s),s),U=(t,e,s)=>(bs(t,e,"access private method"),s);var ts=(t,e,s,n)=>({set _(r){C(t,e,r,s)},get _(){return l(t,e,n)}});function mi(t,e){for(var s=0;s<e.length;s++){const n=e[s];if(typeof n!="string"&&!Array.isArray(n)){for(const r in n)if(r!=="default"&&!(r in t)){const i=Object.getOwnPropertyDescriptor(n,r);i&&Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>n[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var $a=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function an(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var xs={exports:{}},Fe={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var kn;function yi(){if(kn)return Fe;kn=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function s(n,r,i){var c=null;if(i!==void 0&&(c=""+i),r.key!==void 0&&(c=""+r.key),"key"in r){i={};for(var o in r)o!=="key"&&(i[o]=r[o])}else i=r;return r=i.ref,{$$typeof:t,type:n,key:c,ref:r!==void 0?r:null,props:i}}return Fe.Fragment=e,Fe.jsx=s,Fe.jsxs=s,Fe}var In;function gi(){return In||(In=1,xs.exports=yi()),xs.exports}var M=gi(),Cs={exports:{}},D={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Fn;function vi(){if(Fn)return D;Fn=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),c=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),a=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),d=Symbol.iterator;function m(p){return p===null||typeof p!="object"?null:(p=d&&p[d]||p["@@iterator"],typeof p=="function"?p:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,v={};function R(p,P,F){this.props=p,this.context=P,this.refs=v,this.updater=F||y}R.prototype.isReactComponent={},R.prototype.setState=function(p,P){if(typeof p!="object"&&typeof p!="function"&&p!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,p,P,"setState")},R.prototype.forceUpdate=function(p){this.updater.enqueueForceUpdate(this,p,"forceUpdate")};function b(){}b.prototype=R.prototype;function w(p,P,F){this.props=p,this.context=P,this.refs=v,this.updater=F||y}var _=w.prototype=new b;_.constructor=w,g(_,R.prototype),_.isPureReactComponent=!0;var k=Array.isArray;function I(){}var x={H:null,A:null,T:null,S:null},S=Object.prototype.hasOwnProperty;function E(p,P,F){var L=F.ref;return{$$typeof:t,type:p,key:P,ref:L!==void 0?L:null,props:F}}function j(p,P){return E(p.type,P,p.props)}function A(p){return typeof p=="object"&&p!==null&&p.$$typeof===t}function B(p){var P={"=":"=0",":":"=2"};return"$"+p.replace(/[=:]/g,function(F){return P[F]})}var H=/\/+/g;function N(p,P){return typeof p=="object"&&p!==null&&p.key!=null?B(""+p.key):P.toString(36)}function vt(p){switch(p.status){case"fulfilled":return p.value;case"rejected":throw p.reason;default:switch(typeof p.status=="string"?p.then(I,I):(p.status="pending",p.then(function(P){p.status==="pending"&&(p.status="fulfilled",p.value=P)},function(P){p.status==="pending"&&(p.status="rejected",p.reason=P)})),p.status){case"fulfilled":return p.value;case"rejected":throw p.reason}}throw p}function X(p,P,F,L,q){var Q=typeof p;(Q==="undefined"||Q==="boolean")&&(p=null);var K=!1;if(p===null)K=!0;else switch(Q){case"bigint":case"string":case"number":K=!0;break;case"object":switch(p.$$typeof){case t:case e:K=!0;break;case h:return K=p._init,X(K(p._payload),P,F,L,q)}}if(K)return q=q(p),K=L===""?"."+N(p,0):L,k(q)?(F="",K!=null&&(F=K.replace(H,"$&/")+"/"),X(q,P,F,"",function(fe){return fe})):q!=null&&(A(q)&&(q=j(q,F+(q.key==null||p&&p.key===q.key?"":(""+q.key).replace(H,"$&/")+"/")+K)),P.push(q)),1;K=0;var et=L===""?".":L+":";if(k(p))for(var Y=0;Y<p.length;Y++)L=p[Y],Q=et+N(L,Y),K+=X(L,P,F,Q,q);else if(Y=m(p),typeof Y=="function")for(p=Y.call(p),Y=0;!(L=p.next()).done;)L=L.value,Q=et+N(L,Y++),K+=X(L,P,F,Q,q);else if(Q==="object"){if(typeof p.then=="function")return X(vt(p),P,F,L,q);throw P=String(p),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(p).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return K}function St(p,P,F){if(p==null)return p;var L=[],q=0;return X(p,L,"","",function(Q){return P.call(F,Q,q++)}),L}function bn(p){if(p._status===-1){var P=p._result;P=P(),P.then(function(F){(p._status===0||p._status===-1)&&(p._status=1,p._result=F)},function(F){(p._status===0||p._status===-1)&&(p._status=2,p._result=F)}),p._status===-1&&(p._status=0,p._result=P)}if(p._status===1)return p._result.default;throw p._result}var Ie=typeof reportError=="function"?reportError:function(p){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof p=="object"&&p!==null&&typeof p.message=="string"?String(p.message):String(p),error:p});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",p);return}console.error(p)},Xe={map:St,forEach:function(p,P,F){St(p,function(){P.apply(this,arguments)},F)},count:function(p){var P=0;return St(p,function(){P++}),P},toArray:function(p){return St(p,function(P){return P})||[]},only:function(p){if(!A(p))throw Error("React.Children.only expected to receive a single React element child.");return p}};return D.Activity=f,D.Children=Xe,D.Component=R,D.Fragment=s,D.Profiler=r,D.PureComponent=w,D.StrictMode=n,D.Suspense=a,D.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=x,D.__COMPILER_RUNTIME={__proto__:null,c:function(p){return x.H.useMemoCache(p)}},D.cache=function(p){return function(){return p.apply(null,arguments)}},D.cacheSignal=function(){return null},D.cloneElement=function(p,P,F){if(p==null)throw Error("The argument must be a React element, but you passed "+p+".");var L=g({},p.props),q=p.key;if(P!=null)for(Q in P.key!==void 0&&(q=""+P.key),P)!S.call(P,Q)||Q==="key"||Q==="__self"||Q==="__source"||Q==="ref"&&P.ref===void 0||(L[Q]=P[Q]);var Q=arguments.length-2;if(Q===1)L.children=F;else if(1<Q){for(var K=Array(Q),et=0;et<Q;et++)K[et]=arguments[et+2];L.children=K}return E(p.type,q,L)},D.createContext=function(p){return p={$$typeof:c,_currentValue:p,_currentValue2:p,_threadCount:0,Provider:null,Consumer:null},p.Provider=p,p.Consumer={$$typeof:i,_context:p},p},D.createElement=function(p,P,F){var L,q={},Q=null;if(P!=null)for(L in P.key!==void 0&&(Q=""+P.key),P)S.call(P,L)&&L!=="key"&&L!=="__self"&&L!=="__source"&&(q[L]=P[L]);var K=arguments.length-2;if(K===1)q.children=F;else if(1<K){for(var et=Array(K),Y=0;Y<K;Y++)et[Y]=arguments[Y+2];q.children=et}if(p&&p.defaultProps)for(L in K=p.defaultProps,K)q[L]===void 0&&(q[L]=K[L]);return E(p,Q,q)},D.createRef=function(){return{current:null}},D.forwardRef=function(p){return{$$typeof:o,render:p}},D.isValidElement=A,D.lazy=function(p){return{$$typeof:h,_payload:{_status:-1,_result:p},_init:bn}},D.memo=function(p,P){return{$$typeof:u,type:p,compare:P===void 0?null:P}},D.startTransition=function(p){var P=x.T,F={};x.T=F;try{var L=p(),q=x.S;q!==null&&q(F,L),typeof L=="object"&&L!==null&&typeof L.then=="function"&&L.then(I,Ie)}catch(Q){Ie(Q)}finally{P!==null&&F.types!==null&&(P.types=F.types),x.T=P}},D.unstable_useCacheRefresh=function(){return x.H.useCacheRefresh()},D.use=function(p){return x.H.use(p)},D.useActionState=function(p,P,F){return x.H.useActionState(p,P,F)},D.useCallback=function(p,P){return x.H.useCallback(p,P)},D.useContext=function(p){return x.H.useContext(p)},D.useDebugValue=function(){},D.useDeferredValue=function(p,P){return x.H.useDeferredValue(p,P)},D.useEffect=function(p,P){return x.H.useEffect(p,P)},D.useEffectEvent=function(p){return x.H.useEffectEvent(p)},D.useId=function(){return x.H.useId()},D.useImperativeHandle=function(p,P,F){return x.H.useImperativeHandle(p,P,F)},D.useInsertionEffect=function(p,P){return x.H.useInsertionEffect(p,P)},D.useLayoutEffect=function(p,P){return x.H.useLayoutEffect(p,P)},D.useMemo=function(p,P){return x.H.useMemo(p,P)},D.useOptimistic=function(p,P){return x.H.useOptimistic(p,P)},D.useReducer=function(p,P,F){return x.H.useReducer(p,P,F)},D.useRef=function(p){return x.H.useRef(p)},D.useState=function(p){return x.H.useState(p)},D.useSyncExternalStore=function(p,P,F){return x.H.useSyncExternalStore(p,P,F)},D.useTransition=function(){return x.H.useTransition()},D.version="19.2.4",D}var An;function Ss(){return An||(An=1,Cs.exports=vi()),Cs.exports}var O=Ss();const Te=an(O),qa=mi({__proto__:null,default:Te},[O]);var Es={exports:{}},Z={};/**
18
+ * @license React
19
+ * react-dom.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Dn;function Si(){if(Dn)return Z;Dn=1;var t=Ss();function e(a){var u="https://react.dev/errors/"+a;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)u+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+a+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var n={d:{f:s,r:function(){throw Error(e(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},r=Symbol.for("react.portal");function i(a,u,h){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:f==null?null:""+f,children:a,containerInfo:u,implementation:h}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(a,u){if(a==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return Z.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,Z.createPortal=function(a,u){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(e(299));return i(a,u,null,h)},Z.flushSync=function(a){var u=c.T,h=n.p;try{if(c.T=null,n.p=2,a)return a()}finally{c.T=u,n.p=h,n.d.f()}},Z.preconnect=function(a,u){typeof a=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,n.d.C(a,u))},Z.prefetchDNS=function(a){typeof a=="string"&&n.d.D(a)},Z.preinit=function(a,u){if(typeof a=="string"&&u&&typeof u.as=="string"){var h=u.as,f=o(h,u.crossOrigin),d=typeof u.integrity=="string"?u.integrity:void 0,m=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;h==="style"?n.d.S(a,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:f,integrity:d,fetchPriority:m}):h==="script"&&n.d.X(a,{crossOrigin:f,integrity:d,fetchPriority:m,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},Z.preinitModule=function(a,u){if(typeof a=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var h=o(u.as,u.crossOrigin);n.d.M(a,{crossOrigin:h,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&n.d.M(a)},Z.preload=function(a,u){if(typeof a=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var h=u.as,f=o(h,u.crossOrigin);n.d.L(a,h,{crossOrigin:f,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},Z.preloadModule=function(a,u){if(typeof a=="string")if(u){var h=o(u.as,u.crossOrigin);n.d.m(a,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:h,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else n.d.m(a)},Z.requestFormReset=function(a){n.d.r(a)},Z.unstable_batchedUpdates=function(a,u){return a(u)},Z.useFormState=function(a,u,h){return c.H.useFormState(a,u,h)},Z.useFormStatus=function(){return c.H.useHostTransitionStatus()},Z.version="19.2.4",Z}var jn;function Ri(){if(jn)return Es.exports;jn=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Es.exports=Si(),Es.exports}var ke=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Pi={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Ft,on,gr,_i=(gr=class{constructor(){T(this,Ft,Pi);T(this,on,!1)}setTimeoutProvider(t){C(this,Ft,t)}setTimeout(t,e){return l(this,Ft).setTimeout(t,e)}clearTimeout(t){l(this,Ft).clearTimeout(t)}setInterval(t,e){return l(this,Ft).setInterval(t,e)}clearInterval(t){l(this,Ft).clearInterval(t)}},Ft=new WeakMap,on=new WeakMap,gr),zt=new _i;function wi(t){setTimeout(t,0)}var ce=typeof window>"u"||"Deno"in globalThis;function nt(){}function bi(t,e){return typeof t=="function"?t(e):t}function $s(t){return typeof t=="number"&&t>=0&&t!==1/0}function Or(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Kt(t,e){return typeof t=="function"?t(e):t}function lt(t,e){return typeof t=="function"?t(e):t}function Nn(t,e){const{type:s="all",exact:n,fetchStatus:r,predicate:i,queryKey:c,stale:o}=t;if(c){if(n){if(e.queryHash!==cn(c,e.options))return!1}else if(!Qe(e.queryKey,c))return!1}if(s!=="all"){const a=e.isActive();if(s==="active"&&!a||s==="inactive"&&a)return!1}return!(typeof o=="boolean"&&e.isStale()!==o||r&&r!==e.state.fetchStatus||i&&!i(e))}function Un(t,e){const{exact:s,status:n,predicate:r,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(s){if(ue(e.options.mutationKey)!==ue(i))return!1}else if(!Qe(e.options.mutationKey,i))return!1}return!(n&&e.state.status!==n||r&&!r(e))}function cn(t,e){return(e?.queryKeyHashFn||ue)(t)}function ue(t){return JSON.stringify(t,(e,s)=>qs(s)?Object.keys(s).sort().reduce((n,r)=>(n[r]=s[r],n),{}):s)}function Qe(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(s=>Qe(t[s],e[s])):!1}var xi=Object.prototype.hasOwnProperty;function Tr(t,e,s=0){if(t===e)return t;if(s>500)return e;const n=Bn(t)&&Bn(e);if(!n&&!(qs(t)&&qs(e)))return e;const i=(n?t:Object.keys(t)).length,c=n?e:Object.keys(e),o=c.length,a=n?new Array(o):{};let u=0;for(let h=0;h<o;h++){const f=n?h:c[h],d=t[f],m=e[f];if(d===m){a[f]=d,(n?h<i:xi.call(t,f))&&u++;continue}if(d===null||m===null||typeof d!="object"||typeof m!="object"){a[f]=m;continue}const y=Tr(d,m,s+1);a[f]=y,y===d&&u++}return i===o&&u===i?t:a}function us(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const s in t)if(t[s]!==e[s])return!1;return!0}function Bn(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function qs(t){if(!Hn(t))return!1;const e=t.constructor;if(e===void 0)return!0;const s=e.prototype;return!(!Hn(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Hn(t){return Object.prototype.toString.call(t)==="[object Object]"}function Ci(t){return new Promise(e=>{zt.setTimeout(e,t)})}function Qs(t,e,s){return typeof s.structuralSharing=="function"?s.structuralSharing(t,e):s.structuralSharing!==!1?Tr(t,e):e}function Ei(t,e,s=0){const n=[...t,e];return s&&n.length>s?n.slice(1):n}function Oi(t,e,s=0){const n=[e,...t];return s&&n.length>s?n.slice(0,-1):n}var un=Symbol();function Lr(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===un?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function ln(t,e){return typeof t=="function"?t(...e):!!t}function Ti(t,e,s){let n=!1,r;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(r??(r=e()),n||(n=!0,r.aborted?s():r.addEventListener("abort",s,{once:!0})),r)}),t}var Jt,At,ge,vr,Li=(vr=class extends ke{constructor(){super();T(this,Jt);T(this,At);T(this,ge);C(this,ge,e=>{if(!ce&&window.addEventListener){const s=()=>e();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){l(this,At)||this.setEventListener(l(this,ge))}onUnsubscribe(){var e;this.hasListeners()||((e=l(this,At))==null||e.call(this),C(this,At,void 0))}setEventListener(e){var s;C(this,ge,e),(s=l(this,At))==null||s.call(this),C(this,At,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){l(this,Jt)!==e&&(C(this,Jt,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(s=>{s(e)})}isFocused(){return typeof l(this,Jt)=="boolean"?l(this,Jt):globalThis.document?.visibilityState!=="hidden"}},Jt=new WeakMap,At=new WeakMap,ge=new WeakMap,vr),hn=new Li;function Ks(){let t,e;const s=new Promise((r,i)=>{t=r,e=i});s.status="pending",s.catch(()=>{});function n(r){Object.assign(s,r),delete s.resolve,delete s.reject}return s.resolve=r=>{n({status:"fulfilled",value:r}),t(r)},s.reject=r=>{n({status:"rejected",reason:r}),e(r)},s}var Mi=wi;function ki(){let t=[],e=0,s=o=>{o()},n=o=>{o()},r=Mi;const i=o=>{e?t.push(o):r(()=>{s(o)})},c=()=>{const o=t;t=[],o.length&&r(()=>{n(()=>{o.forEach(a=>{s(a)})})})};return{batch:o=>{let a;e++;try{a=o()}finally{e--,e||c()}return a},batchCalls:o=>(...a)=>{i(()=>{o(...a)})},schedule:i,setNotifyFunction:o=>{s=o},setBatchNotifyFunction:o=>{n=o},setScheduler:o=>{r=o}}}var G=ki(),ve,Dt,Se,Sr,Ii=(Sr=class extends ke{constructor(){super();T(this,ve,!0);T(this,Dt);T(this,Se);C(this,Se,e=>{if(!ce&&window.addEventListener){const s=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",n)}}})}onSubscribe(){l(this,Dt)||this.setEventListener(l(this,Se))}onUnsubscribe(){var e;this.hasListeners()||((e=l(this,Dt))==null||e.call(this),C(this,Dt,void 0))}setEventListener(e){var s;C(this,Se,e),(s=l(this,Dt))==null||s.call(this),C(this,Dt,e(this.setOnline.bind(this)))}setOnline(e){l(this,ve)!==e&&(C(this,ve,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return l(this,ve)}},ve=new WeakMap,Dt=new WeakMap,Se=new WeakMap,Sr),ls=new Ii;function Fi(t){return Math.min(1e3*2**t,3e4)}function Mr(t){return(t??"online")==="online"?ls.isOnline():!0}var Ws=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function kr(t){let e=!1,s=0,n;const r=Ks(),i=()=>r.status!=="pending",c=g=>{if(!i()){const v=new Ws(g);d(v),t.onCancel?.(v)}},o=()=>{e=!0},a=()=>{e=!1},u=()=>hn.isFocused()&&(t.networkMode==="always"||ls.isOnline())&&t.canRun(),h=()=>Mr(t.networkMode)&&t.canRun(),f=g=>{i()||(n?.(),r.resolve(g))},d=g=>{i()||(n?.(),r.reject(g))},m=()=>new Promise(g=>{n=v=>{(i()||u())&&g(v)},t.onPause?.()}).then(()=>{n=void 0,i()||t.onContinue?.()}),y=()=>{if(i())return;let g;const v=s===0?t.initialPromise:void 0;try{g=v??t.fn()}catch(R){g=Promise.reject(R)}Promise.resolve(g).then(f).catch(R=>{if(i())return;const b=t.retry??(ce?0:3),w=t.retryDelay??Fi,_=typeof w=="function"?w(s,R):w,k=b===!0||typeof b=="number"&&s<b||typeof b=="function"&&b(s,R);if(e||!k){d(R);return}s++,t.onFail?.(s,R),Ci(_).then(()=>u()?void 0:m()).then(()=>{e?d(R):y()})})};return{promise:r,status:()=>r.status,cancel:c,continue:()=>(n?.(),r),cancelRetry:o,continueRetry:a,canStart:h,start:()=>(h()?y():m().then(y),r)}}var Xt,Rr,Ir=(Rr=class{constructor(){T(this,Xt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),$s(this.gcTime)&&C(this,Xt,zt.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(ce?1/0:300*1e3))}clearGcTimeout(){l(this,Xt)&&(zt.clearTimeout(l(this,Xt)),C(this,Xt,void 0))}},Xt=new WeakMap,Rr),Zt,Re,ut,te,J,Ve,ee,yt,bt,Pr,Ai=(Pr=class extends Ir{constructor(e){super();T(this,yt);T(this,Zt);T(this,Re);T(this,ut);T(this,te);T(this,J);T(this,Ve);T(this,ee);C(this,ee,!1),C(this,Ve,e.defaultOptions),this.setOptions(e.options),this.observers=[],C(this,te,e.client),C(this,ut,l(this,te).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,C(this,Zt,qn(this.options)),this.state=e.state??l(this,Zt),this.scheduleGc()}get meta(){return this.options.meta}get promise(){return l(this,J)?.promise}setOptions(e){if(this.options={...l(this,Ve),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=qn(this.options);s.data!==void 0&&(this.setState($n(s.data,s.dataUpdatedAt)),C(this,Zt,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&l(this,ut).remove(this)}setData(e,s){const n=Qs(this.state.data,e,this.options);return U(this,yt,bt).call(this,{data:n,type:"success",dataUpdatedAt:s?.updatedAt,manual:s?.manual}),n}setState(e,s){U(this,yt,bt).call(this,{type:"setState",state:e,setStateOptions:s})}cancel(e){const s=l(this,J)?.promise;return l(this,J)?.cancel(e),s?s.then(nt).catch(nt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(l(this,Zt))}isActive(){return this.observers.some(e=>lt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===un||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Kt(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Or(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(s=>s.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),l(this,J)?.continue()}onOnline(){this.observers.find(s=>s.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),l(this,J)?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),l(this,ut).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(s=>s!==e),this.observers.length||(l(this,J)&&(l(this,ee)?l(this,J).cancel({revert:!0}):l(this,J).cancelRetry()),this.scheduleGc()),l(this,ut).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||U(this,yt,bt).call(this,{type:"invalidate"})}async fetch(e,s){if(this.state.fetchStatus!=="idle"&&l(this,J)?.status()!=="rejected"){if(this.state.data!==void 0&&s?.cancelRefetch)this.cancel({silent:!0});else if(l(this,J))return l(this,J).continueRetry(),l(this,J).promise}if(e&&this.setOptions(e),!this.options.queryFn){const a=this.observers.find(u=>u.options.queryFn);a&&this.setOptions(a.options)}const n=new AbortController,r=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(C(this,ee,!0),n.signal)})},i=()=>{const a=Lr(this.options,s),h=(()=>{const f={client:l(this,te),queryKey:this.queryKey,meta:this.meta};return r(f),f})();return C(this,ee,!1),this.options.persister?this.options.persister(a,h,this):a(h)},o=(()=>{const a={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:l(this,te),state:this.state,fetchFn:i};return r(a),a})();this.options.behavior?.onFetch(o,this),C(this,Re,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&U(this,yt,bt).call(this,{type:"fetch",meta:o.fetchOptions?.meta}),C(this,J,kr({initialPromise:s?.initialPromise,fn:o.fetchFn,onCancel:a=>{a instanceof Ws&&a.revert&&this.setState({...l(this,Re),fetchStatus:"idle"}),n.abort()},onFail:(a,u)=>{U(this,yt,bt).call(this,{type:"failed",failureCount:a,error:u})},onPause:()=>{U(this,yt,bt).call(this,{type:"pause"})},onContinue:()=>{U(this,yt,bt).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const a=await l(this,J).start();if(a===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(a),l(this,ut).config.onSuccess?.(a,this),l(this,ut).config.onSettled?.(a,this.state.error,this),a}catch(a){if(a instanceof Ws){if(a.silent)return l(this,J).promise;if(a.revert){if(this.state.data===void 0)throw a;return this.state.data}}throw U(this,yt,bt).call(this,{type:"error",error:a}),l(this,ut).config.onError?.(a,this),l(this,ut).config.onSettled?.(this.state.data,a,this),a}finally{this.scheduleGc()}}},Zt=new WeakMap,Re=new WeakMap,ut=new WeakMap,te=new WeakMap,J=new WeakMap,Ve=new WeakMap,ee=new WeakMap,yt=new WeakSet,bt=function(e){const s=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Fr(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...$n(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return C(this,Re,e.manual?r:void 0),r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=s(this.state),G.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),l(this,ut).notify({query:this,type:"updated",action:e})})},Pr);function Fr(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Mr(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function $n(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function qn(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,s=e!==void 0,n=s?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var ot,$,ze,st,se,Pe,xt,jt,Ge,_e,we,ne,re,Nt,be,W,Be,Vs,zs,Gs,Ys,Js,Xs,Zs,Ar,_r,Di=(_r=class extends ke{constructor(e,s){super();T(this,W);T(this,ot);T(this,$);T(this,ze);T(this,st);T(this,se);T(this,Pe);T(this,xt);T(this,jt);T(this,Ge);T(this,_e);T(this,we);T(this,ne);T(this,re);T(this,Nt);T(this,be,new Set);this.options=s,C(this,ot,e),C(this,jt,null),C(this,xt,Ks()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(l(this,$).addObserver(this),Qn(l(this,$),this.options)?U(this,W,Be).call(this):this.updateResult(),U(this,W,Ys).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return tn(l(this,$),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return tn(l(this,$),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,U(this,W,Js).call(this),U(this,W,Xs).call(this),l(this,$).removeObserver(this)}setOptions(e){const s=this.options,n=l(this,$);if(this.options=l(this,ot).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof lt(this.options.enabled,l(this,$))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");U(this,W,Zs).call(this),l(this,$).setOptions(this.options),s._defaulted&&!us(this.options,s)&&l(this,ot).getQueryCache().notify({type:"observerOptionsUpdated",query:l(this,$),observer:this});const r=this.hasListeners();r&&Kn(l(this,$),n,this.options,s)&&U(this,W,Be).call(this),this.updateResult(),r&&(l(this,$)!==n||lt(this.options.enabled,l(this,$))!==lt(s.enabled,l(this,$))||Kt(this.options.staleTime,l(this,$))!==Kt(s.staleTime,l(this,$)))&&U(this,W,Vs).call(this);const i=U(this,W,zs).call(this);r&&(l(this,$)!==n||lt(this.options.enabled,l(this,$))!==lt(s.enabled,l(this,$))||i!==l(this,Nt))&&U(this,W,Gs).call(this,i)}getOptimisticResult(e){const s=l(this,ot).getQueryCache().build(l(this,ot),e),n=this.createResult(s,e);return Ni(this,n)&&(C(this,st,n),C(this,Pe,this.options),C(this,se,l(this,$).state)),n}getCurrentResult(){return l(this,st)}trackResult(e,s){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),s?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&l(this,xt).status==="pending"&&l(this,xt).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){l(this,be).add(e)}getCurrentQuery(){return l(this,$)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const s=l(this,ot).defaultQueryOptions(e),n=l(this,ot).getQueryCache().build(l(this,ot),s);return n.fetch().then(()=>this.createResult(n,s))}fetch(e){return U(this,W,Be).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),l(this,st)))}createResult(e,s){const n=l(this,$),r=this.options,i=l(this,st),c=l(this,se),o=l(this,Pe),u=e!==n?e.state:l(this,ze),{state:h}=e;let f={...h},d=!1,m;if(s._optimisticResults){const E=this.hasListeners(),j=!E&&Qn(e,s),A=E&&Kn(e,n,s,r);(j||A)&&(f={...f,...Fr(h.data,e.options)}),s._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:y,errorUpdatedAt:g,status:v}=f;m=f.data;let R=!1;if(s.placeholderData!==void 0&&m===void 0&&v==="pending"){let E;i?.isPlaceholderData&&s.placeholderData===o?.placeholderData?(E=i.data,R=!0):E=typeof s.placeholderData=="function"?s.placeholderData(l(this,we)?.state.data,l(this,we)):s.placeholderData,E!==void 0&&(v="success",m=Qs(i?.data,E,s),d=!0)}if(s.select&&m!==void 0&&!R)if(i&&m===c?.data&&s.select===l(this,Ge))m=l(this,_e);else try{C(this,Ge,s.select),m=s.select(m),m=Qs(i?.data,m,s),C(this,_e,m),C(this,jt,null)}catch(E){C(this,jt,E)}l(this,jt)&&(y=l(this,jt),m=l(this,_e),g=Date.now(),v="error");const b=f.fetchStatus==="fetching",w=v==="pending",_=v==="error",k=w&&b,I=m!==void 0,S={status:v,fetchStatus:f.fetchStatus,isPending:w,isSuccess:v==="success",isError:_,isInitialLoading:k,isLoading:k,data:m,dataUpdatedAt:f.dataUpdatedAt,error:y,errorUpdatedAt:g,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:_&&!I,isPaused:f.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:_&&I,isStale:fn(e,s),refetch:this.refetch,promise:l(this,xt),isEnabled:lt(s.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const E=S.data!==void 0,j=S.status==="error"&&!E,A=N=>{j?N.reject(S.error):E&&N.resolve(S.data)},B=()=>{const N=C(this,xt,S.promise=Ks());A(N)},H=l(this,xt);switch(H.status){case"pending":e.queryHash===n.queryHash&&A(H);break;case"fulfilled":(j||S.data!==H.value)&&B();break;case"rejected":(!j||S.error!==H.reason)&&B();break}}return S}updateResult(){const e=l(this,st),s=this.createResult(l(this,$),this.options);if(C(this,se,l(this,$).state),C(this,Pe,this.options),l(this,se).data!==void 0&&C(this,we,l(this,$)),us(s,e))return;C(this,st,s);const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!l(this,be).size)return!0;const c=new Set(i??l(this,be));return this.options.throwOnError&&c.add("error"),Object.keys(l(this,st)).some(o=>{const a=o;return l(this,st)[a]!==e[a]&&c.has(a)})};U(this,W,Ar).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&U(this,W,Ys).call(this)}},ot=new WeakMap,$=new WeakMap,ze=new WeakMap,st=new WeakMap,se=new WeakMap,Pe=new WeakMap,xt=new WeakMap,jt=new WeakMap,Ge=new WeakMap,_e=new WeakMap,we=new WeakMap,ne=new WeakMap,re=new WeakMap,Nt=new WeakMap,be=new WeakMap,W=new WeakSet,Be=function(e){U(this,W,Zs).call(this);let s=l(this,$).fetch(this.options,e);return e?.throwOnError||(s=s.catch(nt)),s},Vs=function(){U(this,W,Js).call(this);const e=Kt(this.options.staleTime,l(this,$));if(ce||l(this,st).isStale||!$s(e))return;const n=Or(l(this,st).dataUpdatedAt,e)+1;C(this,ne,zt.setTimeout(()=>{l(this,st).isStale||this.updateResult()},n))},zs=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(l(this,$)):this.options.refetchInterval)??!1},Gs=function(e){U(this,W,Xs).call(this),C(this,Nt,e),!(ce||lt(this.options.enabled,l(this,$))===!1||!$s(l(this,Nt))||l(this,Nt)===0)&&C(this,re,zt.setInterval(()=>{(this.options.refetchIntervalInBackground||hn.isFocused())&&U(this,W,Be).call(this)},l(this,Nt)))},Ys=function(){U(this,W,Vs).call(this),U(this,W,Gs).call(this,U(this,W,zs).call(this))},Js=function(){l(this,ne)&&(zt.clearTimeout(l(this,ne)),C(this,ne,void 0))},Xs=function(){l(this,re)&&(zt.clearInterval(l(this,re)),C(this,re,void 0))},Zs=function(){const e=l(this,ot).getQueryCache().build(l(this,ot),this.options);if(e===l(this,$))return;const s=l(this,$);C(this,$,e),C(this,ze,e.state),this.hasListeners()&&(s?.removeObserver(this),e.addObserver(this))},Ar=function(e){G.batch(()=>{e.listeners&&this.listeners.forEach(s=>{s(l(this,st))}),l(this,ot).getQueryCache().notify({query:l(this,$),type:"observerResultsUpdated"})})},_r);function ji(t,e){return lt(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Qn(t,e){return ji(t,e)||t.state.data!==void 0&&tn(t,e,e.refetchOnMount)}function tn(t,e,s){if(lt(e.enabled,t)!==!1&&Kt(e.staleTime,t)!=="static"){const n=typeof s=="function"?s(t):s;return n==="always"||n!==!1&&fn(t,e)}return!1}function Kn(t,e,s,n){return(t!==e||lt(n.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&fn(t,s)}function fn(t,e){return lt(e.enabled,t)!==!1&&t.isStaleByTime(Kt(e.staleTime,t))}function Ni(t,e){return!us(t.getCurrentResult(),e)}function Wn(t){return{onFetch:(e,s)=>{const n=e.options,r=e.fetchOptions?.meta?.fetchMore?.direction,i=e.state.data?.pages||[],c=e.state.data?.pageParams||[];let o={pages:[],pageParams:[]},a=0;const u=async()=>{let h=!1;const f=y=>{Ti(y,()=>e.signal,()=>h=!0)},d=Lr(e.options,e.fetchOptions),m=async(y,g,v)=>{if(h)return Promise.reject();if(g==null&&y.pages.length)return Promise.resolve(y);const b=(()=>{const I={client:e.client,queryKey:e.queryKey,pageParam:g,direction:v?"backward":"forward",meta:e.options.meta};return f(I),I})(),w=await d(b),{maxPages:_}=e.options,k=v?Oi:Ei;return{pages:k(y.pages,w,_),pageParams:k(y.pageParams,g,_)}};if(r&&i.length){const y=r==="backward",g=y?Ui:Vn,v={pages:i,pageParams:c},R=g(n,v);o=await m(v,R,y)}else{const y=t??i.length;do{const g=a===0?c[0]??n.initialPageParam:Vn(n,o);if(a>0&&g==null)break;o=await m(o,g),a++}while(a<y)}return o};e.options.persister?e.fetchFn=()=>e.options.persister?.(u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s):e.fetchFn=u}}}function Vn(t,{pages:e,pageParams:s}){const n=e.length-1;return e.length>0?t.getNextPageParam(e[n],e,s[n],s):void 0}function Ui(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}var Ye,Rt,tt,ie,Pt,kt,wr,Bi=(wr=class extends Ir{constructor(e){super();T(this,Pt);T(this,Ye);T(this,Rt);T(this,tt);T(this,ie);C(this,Ye,e.client),this.mutationId=e.mutationId,C(this,tt,e.mutationCache),C(this,Rt,[]),this.state=e.state||Dr(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){l(this,Rt).includes(e)||(l(this,Rt).push(e),this.clearGcTimeout(),l(this,tt).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){C(this,Rt,l(this,Rt).filter(s=>s!==e)),this.scheduleGc(),l(this,tt).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){l(this,Rt).length||(this.state.status==="pending"?this.scheduleGc():l(this,tt).remove(this))}continue(){return l(this,ie)?.continue()??this.execute(this.state.variables)}async execute(e){const s=()=>{U(this,Pt,kt).call(this,{type:"continue"})},n={client:l(this,Ye),meta:this.options.meta,mutationKey:this.options.mutationKey};C(this,ie,kr({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(c,o)=>{U(this,Pt,kt).call(this,{type:"failed",failureCount:c,error:o})},onPause:()=>{U(this,Pt,kt).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>l(this,tt).canRun(this)}));const r=this.state.status==="pending",i=!l(this,ie).canStart();try{if(r)s();else{U(this,Pt,kt).call(this,{type:"pending",variables:e,isPaused:i}),l(this,tt).config.onMutate&&await l(this,tt).config.onMutate(e,this,n);const o=await this.options.onMutate?.(e,n);o!==this.state.context&&U(this,Pt,kt).call(this,{type:"pending",context:o,variables:e,isPaused:i})}const c=await l(this,ie).start();return await l(this,tt).config.onSuccess?.(c,e,this.state.context,this,n),await this.options.onSuccess?.(c,e,this.state.context,n),await l(this,tt).config.onSettled?.(c,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(c,null,e,this.state.context,n),U(this,Pt,kt).call(this,{type:"success",data:c}),c}catch(c){try{await l(this,tt).config.onError?.(c,e,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onError?.(c,e,this.state.context,n)}catch(o){Promise.reject(o)}try{await l(this,tt).config.onSettled?.(void 0,c,this.state.variables,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,c,e,this.state.context,n)}catch(o){Promise.reject(o)}throw U(this,Pt,kt).call(this,{type:"error",error:c}),c}finally{l(this,tt).runNext(this)}}},Ye=new WeakMap,Rt=new WeakMap,tt=new WeakMap,ie=new WeakMap,Pt=new WeakSet,kt=function(e){const s=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=s(this.state),G.batch(()=>{l(this,Rt).forEach(n=>{n.onMutationUpdate(e)}),l(this,tt).notify({mutation:this,type:"updated",action:e})})},wr);function Dr(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ct,gt,Je,br,Hi=(br=class extends ke{constructor(e={}){super();T(this,Ct);T(this,gt);T(this,Je);this.config=e,C(this,Ct,new Set),C(this,gt,new Map),C(this,Je,0)}build(e,s,n){const r=new Bi({client:e,mutationCache:this,mutationId:++ts(this,Je)._,options:e.defaultMutationOptions(s),state:n});return this.add(r),r}add(e){l(this,Ct).add(e);const s=es(e);if(typeof s=="string"){const n=l(this,gt).get(s);n?n.push(e):l(this,gt).set(s,[e])}this.notify({type:"added",mutation:e})}remove(e){if(l(this,Ct).delete(e)){const s=es(e);if(typeof s=="string"){const n=l(this,gt).get(s);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&l(this,gt).delete(s)}}this.notify({type:"removed",mutation:e})}canRun(e){const s=es(e);if(typeof s=="string"){const r=l(this,gt).get(s)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const s=es(e);return typeof s=="string"?l(this,gt).get(s)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){G.batch(()=>{l(this,Ct).forEach(e=>{this.notify({type:"removed",mutation:e})}),l(this,Ct).clear(),l(this,gt).clear()})}getAll(){return Array.from(l(this,Ct))}find(e){const s={exact:!0,...e};return this.getAll().find(n=>Un(s,n))}findAll(e={}){return this.getAll().filter(s=>Un(e,s))}notify(e){G.batch(()=>{this.listeners.forEach(s=>{s(e)})})}resumePausedMutations(){const e=this.getAll().filter(s=>s.state.isPaused);return G.batch(()=>Promise.all(e.map(s=>s.continue().catch(nt))))}},Ct=new WeakMap,gt=new WeakMap,Je=new WeakMap,br);function es(t){return t.options.scope?.id}var Et,Ut,at,Ot,Lt,is,en,xr,$i=(xr=class extends ke{constructor(e,s){super();T(this,Lt);T(this,Et);T(this,Ut);T(this,at);T(this,Ot);C(this,Et,e),this.setOptions(s),this.bindMethods(),U(this,Lt,is).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const s=this.options;this.options=l(this,Et).defaultMutationOptions(e),us(this.options,s)||l(this,Et).getMutationCache().notify({type:"observerOptionsUpdated",mutation:l(this,at),observer:this}),s?.mutationKey&&this.options.mutationKey&&ue(s.mutationKey)!==ue(this.options.mutationKey)?this.reset():l(this,at)?.state.status==="pending"&&l(this,at).setOptions(this.options)}onUnsubscribe(){this.hasListeners()||l(this,at)?.removeObserver(this)}onMutationUpdate(e){U(this,Lt,is).call(this),U(this,Lt,en).call(this,e)}getCurrentResult(){return l(this,Ut)}reset(){l(this,at)?.removeObserver(this),C(this,at,void 0),U(this,Lt,is).call(this),U(this,Lt,en).call(this)}mutate(e,s){return C(this,Ot,s),l(this,at)?.removeObserver(this),C(this,at,l(this,Et).getMutationCache().build(l(this,Et),this.options)),l(this,at).addObserver(this),l(this,at).execute(e)}},Et=new WeakMap,Ut=new WeakMap,at=new WeakMap,Ot=new WeakMap,Lt=new WeakSet,is=function(){const e=l(this,at)?.state??Dr();C(this,Ut,{...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset})},en=function(e){G.batch(()=>{if(l(this,Ot)&&this.hasListeners()){const s=l(this,Ut).variables,n=l(this,Ut).context,r={client:l(this,Et),meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{l(this,Ot).onSuccess?.(e.data,s,n,r)}catch(i){Promise.reject(i)}try{l(this,Ot).onSettled?.(e.data,null,s,n,r)}catch(i){Promise.reject(i)}}else if(e?.type==="error"){try{l(this,Ot).onError?.(e.error,s,n,r)}catch(i){Promise.reject(i)}try{l(this,Ot).onSettled?.(void 0,e.error,s,n,r)}catch(i){Promise.reject(i)}}}this.listeners.forEach(s=>{s(l(this,Ut))})})},xr),_t,Cr,qi=(Cr=class extends ke{constructor(e={}){super();T(this,_t);this.config=e,C(this,_t,new Map)}build(e,s,n){const r=s.queryKey,i=s.queryHash??cn(r,s);let c=this.get(i);return c||(c=new Ai({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(s),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(c)),c}add(e){l(this,_t).has(e.queryHash)||(l(this,_t).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const s=l(this,_t).get(e.queryHash);s&&(e.destroy(),s===e&&l(this,_t).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){G.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return l(this,_t).get(e)}getAll(){return[...l(this,_t).values()]}find(e){const s={exact:!0,...e};return this.getAll().find(n=>Nn(s,n))}findAll(e={}){const s=this.getAll();return Object.keys(e).length>0?s.filter(n=>Nn(e,n)):s}notify(e){G.batch(()=>{this.listeners.forEach(s=>{s(e)})})}onFocus(){G.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){G.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},_t=new WeakMap,Cr),z,Bt,Ht,xe,Ce,$t,Ee,Oe,Er,Qa=(Er=class{constructor(t={}){T(this,z);T(this,Bt);T(this,Ht);T(this,xe);T(this,Ce);T(this,$t);T(this,Ee);T(this,Oe);C(this,z,t.queryCache||new qi),C(this,Bt,t.mutationCache||new Hi),C(this,Ht,t.defaultOptions||{}),C(this,xe,new Map),C(this,Ce,new Map),C(this,$t,0)}mount(){ts(this,$t)._++,l(this,$t)===1&&(C(this,Ee,hn.subscribe(async t=>{t&&(await this.resumePausedMutations(),l(this,z).onFocus())})),C(this,Oe,ls.subscribe(async t=>{t&&(await this.resumePausedMutations(),l(this,z).onOnline())})))}unmount(){var t,e;ts(this,$t)._--,l(this,$t)===0&&((t=l(this,Ee))==null||t.call(this),C(this,Ee,void 0),(e=l(this,Oe))==null||e.call(this),C(this,Oe,void 0))}isFetching(t){return l(this,z).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return l(this,Bt).findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return l(this,z).get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=l(this,z).build(this,e),n=s.state.data;return n===void 0?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(Kt(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(n))}getQueriesData(t){return l(this,z).findAll(t).map(({queryKey:e,state:s})=>{const n=s.data;return[e,n]})}setQueryData(t,e,s){const n=this.defaultQueryOptions({queryKey:t}),i=l(this,z).get(n.queryHash)?.state.data,c=bi(e,i);if(c!==void 0)return l(this,z).build(this,n).setData(c,{...s,manual:!0})}setQueriesData(t,e,s){return G.batch(()=>l(this,z).findAll(t).map(({queryKey:n})=>[n,this.setQueryData(n,e,s)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return l(this,z).get(e.queryHash)?.state}removeQueries(t){const e=l(this,z);G.batch(()=>{e.findAll(t).forEach(s=>{e.remove(s)})})}resetQueries(t,e){const s=l(this,z);return G.batch(()=>(s.findAll(t).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const s={revert:!0,...e},n=G.batch(()=>l(this,z).findAll(t).map(r=>r.cancel(s)));return Promise.all(n).then(nt).catch(nt)}invalidateQueries(t,e={}){return G.batch(()=>(l(this,z).findAll(t).forEach(s=>{s.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const s={...e,cancelRefetch:e.cancelRefetch??!0},n=G.batch(()=>l(this,z).findAll(t).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let i=r.fetch(void 0,s);return s.throwOnError||(i=i.catch(nt)),r.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(nt)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const s=l(this,z).build(this,e);return s.isStaleByTime(Kt(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(nt).catch(nt)}fetchInfiniteQuery(t){return t.behavior=Wn(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(nt).catch(nt)}ensureInfiniteQueryData(t){return t.behavior=Wn(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return ls.isOnline()?l(this,Bt).resumePausedMutations():Promise.resolve()}getQueryCache(){return l(this,z)}getMutationCache(){return l(this,Bt)}getDefaultOptions(){return l(this,Ht)}setDefaultOptions(t){C(this,Ht,t)}setQueryDefaults(t,e){l(this,xe).set(ue(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...l(this,xe).values()],s={};return e.forEach(n=>{Qe(t,n.queryKey)&&Object.assign(s,n.defaultOptions)}),s}setMutationDefaults(t,e){l(this,Ce).set(ue(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...l(this,Ce).values()],s={};return e.forEach(n=>{Qe(t,n.mutationKey)&&Object.assign(s,n.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;const e={...l(this,Ht).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=cn(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===un&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...l(this,Ht).mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){l(this,z).clear(),l(this,Bt).clear()}},z=new WeakMap,Bt=new WeakMap,Ht=new WeakMap,xe=new WeakMap,Ce=new WeakMap,$t=new WeakMap,Ee=new WeakMap,Oe=new WeakMap,Er),jr=O.createContext(void 0),Nr=t=>{const e=O.useContext(jr);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Ka=({client:t,children:e})=>(O.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),M.jsx(jr.Provider,{value:t,children:e})),Ur=O.createContext(!1),Qi=()=>O.useContext(Ur);Ur.Provider;function Ki(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Wi=O.createContext(Ki()),Vi=()=>O.useContext(Wi),zi=(t,e,s)=>{const n=s?.state.error&&typeof t.throwOnError=="function"?ln(t.throwOnError,[s.state.error,s]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||n)&&(e.isReset()||(t.retryOnMount=!1))},Gi=t=>{O.useEffect(()=>{t.clearReset()},[t])},Yi=({result:t,errorResetBoundary:e,throwOnError:s,query:n,suspense:r})=>t.isError&&!e.isReset()&&!t.isFetching&&n&&(r&&t.data===void 0||ln(s,[t.error,n])),Ji=t=>{if(t.suspense){const s=r=>r==="static"?r:Math.max(r??1e3,1e3),n=t.staleTime;t.staleTime=typeof n=="function"?(...r)=>s(n(...r)):s(n),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},Xi=(t,e)=>t.isLoading&&t.isFetching&&!e,Zi=(t,e)=>t?.suspense&&e.isPending,zn=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function to(t,e,s){const n=Qi(),r=Vi(),i=Nr(),c=i.defaultQueryOptions(t);i.getDefaultOptions().queries?._experimental_beforeQuery?.(c);const o=i.getQueryCache().get(c.queryHash);c._optimisticResults=n?"isRestoring":"optimistic",Ji(c),zi(c,r,o),Gi(r);const a=!i.getQueryCache().get(c.queryHash),[u]=O.useState(()=>new e(i,c)),h=u.getOptimisticResult(c),f=!n&&t.subscribed!==!1;if(O.useSyncExternalStore(O.useCallback(d=>{const m=f?u.subscribe(G.batchCalls(d)):nt;return u.updateResult(),m},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),O.useEffect(()=>{u.setOptions(c)},[c,u]),Zi(c,h))throw zn(c,u,r);if(Yi({result:h,errorResetBoundary:r,throwOnError:c.throwOnError,query:o,suspense:c.suspense}))throw h.error;return i.getDefaultOptions().queries?._experimental_afterQuery?.(c,h),c.experimental_prefetchInRender&&!ce&&Xi(h,n)&&(a?zn(c,u,r):o?.promise)?.catch(nt).finally(()=>{u.updateResult()}),c.notifyOnChangeProps?h:u.trackResult(h)}function Wa(t,e){return to(t,Di)}function Va(t,e){const s=Nr(),[n]=O.useState(()=>new $i(s,t));O.useEffect(()=>{n.setOptions(t)},[n,t]);const r=O.useSyncExternalStore(O.useCallback(c=>n.subscribe(G.batchCalls(c)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),i=O.useCallback((c,o)=>{n.mutate(c,o).catch(nt)},[n]);if(r.error&&ln(n.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:i,mutateAsync:r.mutate}}const sn=new WeakMap,eo=new WeakMap,hs={current:[]};let Os=!1,$e=0;const He=new Set,ss=new Map;function Br(t){for(const e of t){if(hs.current.includes(e))continue;hs.current.push(e),e.recompute();const s=eo.get(e);if(s)for(const n of s){const r=sn.get(n);r?.length&&Br(r)}}}function so(t){const e={prevVal:t.prevState,currentVal:t.state};for(const s of t.listeners)s(e)}function no(t){const e={prevVal:t.prevState,currentVal:t.state};for(const s of t.listeners)s(e)}function Hr(t){if($e>0&&!ss.has(t)&&ss.set(t,t.prevState),He.add(t),!($e>0)&&!Os)try{for(Os=!0;He.size>0;){const e=Array.from(He);He.clear();for(const s of e){const n=ss.get(s)??s.prevState;s.prevState=n,so(s)}for(const s of e){const n=sn.get(s);n&&(hs.current.push(s),Br(n))}for(const s of e){const n=sn.get(s);if(n)for(const r of n)no(r)}}}finally{Os=!1,hs.current=[],ss.clear()}}function ro(t){$e++;try{t()}finally{if($e--,$e===0){const e=He.values().next().value;e&&Hr(e)}}}function io(t){return typeof t=="function"}class oo{constructor(e,s){this.listeners=new Set,this.subscribe=n=>{var r,i;this.listeners.add(n);const c=(i=(r=this.options)==null?void 0:r.onSubscribe)==null?void 0:i.call(r,n,this);return()=>{this.listeners.delete(n),c?.()}},this.prevState=e,this.state=e,this.options=s}setState(e){var s,n,r;this.prevState=this.state,(s=this.options)!=null&&s.updateFn?this.state=this.options.updateFn(this.prevState)(e):io(e)?this.state=e(this.prevState):this.state=e,(r=(n=this.options)==null?void 0:n.onUpdate)==null||r.call(n),Hr(this)}}const Wt="__TSR_index",Gn="popstate",Yn="beforeunload";function ao(t){let e=t.getLocation();const s=new Set,n=c=>{e=t.getLocation(),s.forEach(o=>o({location:e,action:c}))},r=c=>{t.notifyOnIndexChange??!0?n(c):e=t.getLocation()},i=async({task:c,navigateOpts:o,...a})=>{if(o?.ignoreBlocker??!1){c();return}const h=t.getBlockers?.()??[],f=a.type==="PUSH"||a.type==="REPLACE";if(typeof document<"u"&&h.length&&f)for(const d of h){const m=fs(a.path,a.state);if(await d.blockerFn({currentLocation:e,nextLocation:m,action:a.type})){t.onBlocked?.();return}}c()};return{get location(){return e},get length(){return t.getLength()},subscribers:s,subscribe:c=>(s.add(c),()=>{s.delete(c)}),push:(c,o,a)=>{const u=e.state[Wt];o=Jn(u+1,o),i({task:()=>{t.pushState(c,o),n({type:"PUSH"})},navigateOpts:a,type:"PUSH",path:c,state:o})},replace:(c,o,a)=>{const u=e.state[Wt];o=Jn(u,o),i({task:()=>{t.replaceState(c,o),n({type:"REPLACE"})},navigateOpts:a,type:"REPLACE",path:c,state:o})},go:(c,o)=>{i({task:()=>{t.go(c),r({type:"GO",index:c})},navigateOpts:o,type:"GO"})},back:c=>{i({task:()=>{t.back(c?.ignoreBlocker??!1),r({type:"BACK"})},navigateOpts:c,type:"BACK"})},forward:c=>{i({task:()=>{t.forward(c?.ignoreBlocker??!1),r({type:"FORWARD"})},navigateOpts:c,type:"FORWARD"})},canGoBack:()=>e.state[Wt]!==0,createHref:c=>t.createHref(c),block:c=>{if(!t.setBlockers)return()=>{};const o=t.getBlockers?.()??[];return t.setBlockers([...o,c]),()=>{const a=t.getBlockers?.()??[];t.setBlockers?.(a.filter(u=>u!==c))}},flush:()=>t.flush?.(),destroy:()=>t.destroy?.(),notify:n}}function Jn(t,e){e||(e={});const s=dn();return{...e,key:s,__TSR_key:s,[Wt]:t}}function co(t){const e=typeof document<"u"?window:void 0,s=e.history.pushState,n=e.history.replaceState;let r=[];const i=()=>r,c=S=>r=S,o=(S=>S),a=(()=>fs(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));if(!e.history.state?.__TSR_key&&!e.history.state?.key){const S=dn();e.history.replaceState({[Wt]:0,key:S,__TSR_key:S},"")}let u=a(),h,f=!1,d=!1,m=!1,y=!1;const g=()=>u;let v,R;const b=()=>{v&&(x._ignoreSubscribers=!0,(v.isPush?e.history.pushState:e.history.replaceState)(v.state,"",v.href),x._ignoreSubscribers=!1,v=void 0,R=void 0,h=void 0)},w=(S,E,j)=>{const A=o(E);R||(h=u),u=fs(E,j),v={href:A,state:j,isPush:v?.isPush||S==="push"},R||(R=Promise.resolve().then(()=>b()))},_=S=>{u=a(),x.notify({type:S})},k=async()=>{if(d){d=!1;return}const S=a(),E=S.state[Wt]-u.state[Wt],j=E===1,A=E===-1,B=!j&&!A||f;f=!1;const H=B?"GO":A?"BACK":"FORWARD",N=B?{type:"GO",index:E}:{type:A?"BACK":"FORWARD"};if(m)m=!1;else{const vt=i();if(typeof document<"u"&&vt.length){for(const X of vt)if(await X.blockerFn({currentLocation:u,nextLocation:S,action:H})){d=!0,e.history.go(1),x.notify(N);return}}}u=a(),x.notify(N)},I=S=>{if(y){y=!1;return}let E=!1;const j=i();if(typeof document<"u"&&j.length)for(const A of j){const B=A.enableBeforeUnload??!0;if(B===!0){E=!0;break}if(typeof B=="function"&&B()===!0){E=!0;break}}if(E)return S.preventDefault(),S.returnValue=""},x=ao({getLocation:g,getLength:()=>e.history.length,pushState:(S,E)=>w("push",S,E),replaceState:(S,E)=>w("replace",S,E),back:S=>(S&&(m=!0),y=!0,e.history.back()),forward:S=>{S&&(m=!0),y=!0,e.history.forward()},go:S=>{f=!0,e.history.go(S)},createHref:S=>o(S),flush:b,destroy:()=>{e.history.pushState=s,e.history.replaceState=n,e.removeEventListener(Yn,I,{capture:!0}),e.removeEventListener(Gn,k)},onBlocked:()=>{h&&u!==h&&(u=h)},getBlockers:i,setBlockers:c,notifyOnIndexChange:!1});return e.addEventListener(Yn,I,{capture:!0}),e.addEventListener(Gn,k),e.history.pushState=function(...S){const E=s.apply(e.history,S);return x._ignoreSubscribers||_("PUSH"),E},e.history.replaceState=function(...S){const E=n.apply(e.history,S);return x._ignoreSubscribers||_("REPLACE"),E},x}function uo(t){let e=t.replace(/[\x00-\x1f\x7f]/g,"");return e.startsWith("//")&&(e="/"+e.replace(/^\/+/,"")),e}function fs(t,e){const s=uo(t),n=s.indexOf("#"),r=s.indexOf("?"),i=dn();return{href:s,pathname:s.substring(0,n>0?r>0?Math.min(n,r):n:r>0?r:s.length),hash:n>-1?s.substring(n):"",search:r>-1?s.slice(r,n===-1?void 0:n):"",state:e||{[Wt]:0,key:i,__TSR_key:i}}}function dn(){return(Math.random()+1).toString(36).substring(7)}const lo=!1;function qe(t){let e;return ro(()=>{e=t()}),e}function Ke(t){return t[t.length-1]}function ho(t){return typeof t=="function"}function qt(t,e){return ho(t)?t(e):t}const fo=Object.prototype.hasOwnProperty,Xn=Object.prototype.propertyIsEnumerable;function it(t,e,s=0){if(t===e)return t;if(s>500)return e;const n=e,r=er(t)&&er(n);if(!r&&!(ds(t)&&ds(n)))return n;const i=r?t:Zn(t);if(!i)return n;const c=r?n:Zn(n);if(!c)return n;const o=i.length,a=c.length,u=r?new Array(a):{};let h=0;for(let f=0;f<a;f++){const d=r?f:c[f],m=t[d],y=n[d];if(m===y){u[d]=m,(r?f<o:fo.call(t,d))&&h++;continue}if(m===null||y===null||typeof m!="object"||typeof y!="object"){u[d]=y;continue}const g=it(m,y,s+1);u[d]=g,g===m&&h++}return o===a&&h===o?t:u}function Zn(t){const e=Object.getOwnPropertyNames(t);for(const r of e)if(!Xn.call(t,r))return!1;const s=Object.getOwnPropertySymbols(t);if(s.length===0)return e;const n=e;for(const r of s){if(!Xn.call(t,r))return!1;n.push(r)}return n}function ds(t){if(!tr(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const s=e.prototype;return!(!tr(s)||!s.hasOwnProperty("isPrototypeOf"))}function tr(t){return Object.prototype.toString.call(t)==="[object Object]"}function er(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function oe(t,e,s){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n<r;n++)if(!oe(t[n],e[n],s))return!1;return!0}if(ds(t)&&ds(e)){const n=s?.ignoreUndefined??!0;if(s?.partial){for(const c in e)if((!n||e[c]!==void 0)&&!oe(t[c],e[c],s))return!1;return!0}let r=0;if(!n)r=Object.keys(t).length;else for(const c in t)t[c]!==void 0&&r++;let i=0;for(const c in e)if((!n||e[c]!==void 0)&&(i++,i>r||!oe(t[c],e[c],s)))return!1;return r===i}return!1}function Le(t){let e,s;const n=new Promise((r,i)=>{e=r,s=i});return n.status="pending",n.resolve=r=>{n.status="resolved",n.value=r,e(r),t?.(r)},n.reject=r=>{n.status="rejected",s(r)},n}function me(t){return!!(t&&typeof t=="object"&&typeof t.then=="function")}function po(t){return t.replace(/[\x00-\x1f\x7f]/g,"")}function sr(t){let e;try{e=decodeURI(t)}catch{e=t.replaceAll(/%[0-9A-F]{2}/gi,s=>{try{return decodeURI(s)}catch{return s}})}return po(e)}const $r=["http:","https:","mailto:","tel:"];function ps(t){if(!t)return!1;try{const e=new URL(t);return!$r.includes(e.protocol)}catch{return!1}}function Ae(t,e){if(!t||!/[%\\\x00-\x1f\x7f]/.test(t)&&!t.startsWith("//"))return t;const s=/%25|%5C/gi;let n=0,r="",i;for(;(i=s.exec(t))!==null;)r+=sr(t.slice(n,i.index))+i[0],n=s.lastIndex;return r=r+sr(n?t.slice(n):t),r.startsWith("//")&&(r="/"+r.replace(/^\/+/,"")),r}function mo(t){return/\s|[^\u0000-\u007F]/.test(t)?t.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):t}var yo="Invariant failed";function Mt(t,e){if(!t)throw new Error(yo)}function ms(t){const e=new Map;let s,n;const r=i=>{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,n&&(n.next=i,i.prev=n)):(i.next.prev=void 0,s=i.next,i.next=void 0,n&&(i.prev=n,n.next=i)),n=i)};return{get(i){const c=e.get(i);if(c)return r(c),c.value},set(i,c){if(e.size>=t&&s){const a=s;e.delete(a.key),a.next&&(s=a.next,a.next.prev=void 0),a===n&&(n=void 0)}const o=e.get(i);if(o)o.value=c,r(o);else{const a={key:i,value:c,prev:n};n&&(n.next=a),n=a,s||(s=a),e.set(i,a)}},clear(){e.clear(),s=void 0,n=void 0}}}const Me=0,le=1,he=2,We=3,Gt=4,qr=5;function go(t){const e=t.indexOf("{");if(e===-1)return null;const s=t.indexOf("}",e);return s===-1||e+1>=t.length?null:[e,s]}function pn(t,e,s=new Uint16Array(6)){const n=t.indexOf("/",e),r=n===-1?t.length:n,i=t.substring(e,r);if(!i||!i.includes("$"))return s[0]=Me,s[1]=e,s[2]=e,s[3]=r,s[4]=r,s[5]=r,s;if(i==="$"){const o=t.length;return s[0]=he,s[1]=e,s[2]=e,s[3]=o,s[4]=o,s[5]=o,s}if(i.charCodeAt(0)===36)return s[0]=le,s[1]=e,s[2]=e+1,s[3]=r,s[4]=r,s[5]=r,s;const c=go(i);if(c){const[o,a]=c,u=i.charCodeAt(o+1);if(u===45){if(o+2<i.length&&i.charCodeAt(o+2)===36){const h=o+3,f=a;if(h<f)return s[0]=We,s[1]=e+o,s[2]=e+h,s[3]=e+f,s[4]=e+a+1,s[5]=r,s}}else if(u===36){const h=o+1,f=o+2;return f===a?(s[0]=he,s[1]=e+o,s[2]=e+h,s[3]=e+f,s[4]=e+a+1,s[5]=t.length,s):(s[0]=le,s[1]=e+o,s[2]=e+f,s[3]=e+a,s[4]=e+a+1,s[5]=r,s)}}return s[0]=Me,s[1]=e,s[2]=e,s[3]=r,s[4]=r,s[5]=r,s}function Rs(t,e,s,n,r,i,c){c?.(s);let o=n;{const a=s.fullPath??s.from,u=a.length,h=s.options?.caseSensitive??t,f=!!(s.options?.params?.parse&&s.options?.skipRouteOnParseError?.params);for(;o<u;){const m=pn(a,o,e);let y;const g=o,v=m[5];switch(o=v+1,i++,m[0]){case Me:{const b=a.substring(m[2],m[3]);if(h){const w=r.static?.get(b);if(w)y=w;else{r.static??(r.static=new Map);const _=Yt(s.fullPath??s.from);_.parent=r,_.depth=i,y=_,r.static.set(b,_)}}else{const w=b.toLowerCase(),_=r.staticInsensitive?.get(w);if(_)y=_;else{r.staticInsensitive??(r.staticInsensitive=new Map);const k=Yt(s.fullPath??s.from);k.parent=r,k.depth=i,y=k,r.staticInsensitive.set(w,k)}}break}case le:{const b=a.substring(g,m[1]),w=a.substring(m[4],v),_=h&&!!(b||w),k=b?_?b:b.toLowerCase():void 0,I=w?_?w:w.toLowerCase():void 0,x=!f&&r.dynamic?.find(S=>!S.skipOnParamError&&S.caseSensitive===_&&S.prefix===k&&S.suffix===I);if(x)y=x;else{const S=Ls(le,s.fullPath??s.from,_,k,I);y=S,S.depth=i,S.parent=r,r.dynamic??(r.dynamic=[]),r.dynamic.push(S)}break}case We:{const b=a.substring(g,m[1]),w=a.substring(m[4],v),_=h&&!!(b||w),k=b?_?b:b.toLowerCase():void 0,I=w?_?w:w.toLowerCase():void 0,x=!f&&r.optional?.find(S=>!S.skipOnParamError&&S.caseSensitive===_&&S.prefix===k&&S.suffix===I);if(x)y=x;else{const S=Ls(We,s.fullPath??s.from,_,k,I);y=S,S.parent=r,S.depth=i,r.optional??(r.optional=[]),r.optional.push(S)}break}case he:{const b=a.substring(g,m[1]),w=a.substring(m[4],v),_=h&&!!(b||w),k=b?_?b:b.toLowerCase():void 0,I=w?_?w:w.toLowerCase():void 0,x=Ls(he,s.fullPath??s.from,_,k,I);y=x,x.parent=r,x.depth=i,r.wildcard??(r.wildcard=[]),r.wildcard.push(x)}}r=y}if(f&&s.children&&!s.isRoot&&s.id&&s.id.charCodeAt(s.id.lastIndexOf("/")+1)===95){const m=Yt(s.fullPath??s.from);m.kind=qr,m.parent=r,i++,m.depth=i,r.pathless??(r.pathless=[]),r.pathless.push(m),r=m}const d=(s.path||!s.children)&&!s.isRoot;if(d&&a.endsWith("/")){const m=Yt(s.fullPath??s.from);m.kind=Gt,m.parent=r,i++,m.depth=i,r.index=m,r=m}r.parse=s.options?.params?.parse??null,r.skipOnParamError=f,r.parsingPriority=s.options?.skipRouteOnParseError?.priority??0,d&&!r.route&&(r.route=s,r.fullPath=s.fullPath??s.from)}if(s.children)for(const a of s.children)Rs(t,e,a,o,r,i,c)}function Ts(t,e){if(t.skipOnParamError&&!e.skipOnParamError)return-1;if(!t.skipOnParamError&&e.skipOnParamError)return 1;if(t.skipOnParamError&&e.skipOnParamError&&(t.parsingPriority||e.parsingPriority))return e.parsingPriority-t.parsingPriority;if(t.prefix&&e.prefix&&t.prefix!==e.prefix){if(t.prefix.startsWith(e.prefix))return-1;if(e.prefix.startsWith(t.prefix))return 1}if(t.suffix&&e.suffix&&t.suffix!==e.suffix){if(t.suffix.endsWith(e.suffix))return-1;if(e.suffix.endsWith(t.suffix))return 1}return t.prefix&&!e.prefix?-1:!t.prefix&&e.prefix?1:t.suffix&&!e.suffix?-1:!t.suffix&&e.suffix?1:t.caseSensitive&&!e.caseSensitive?-1:!t.caseSensitive&&e.caseSensitive?1:0}function It(t){if(t.pathless)for(const e of t.pathless)It(e);if(t.static)for(const e of t.static.values())It(e);if(t.staticInsensitive)for(const e of t.staticInsensitive.values())It(e);if(t.dynamic?.length){t.dynamic.sort(Ts);for(const e of t.dynamic)It(e)}if(t.optional?.length){t.optional.sort(Ts);for(const e of t.optional)It(e)}if(t.wildcard?.length){t.wildcard.sort(Ts);for(const e of t.wildcard)It(e)}}function Yt(t){return{kind:Me,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Ls(t,e,s,n,r){return{kind:t,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:s,prefix:n,suffix:r}}function vo(t,e){const s=Yt("/"),n=new Uint16Array(6);for(const r of t)Rs(!1,n,r,1,s,0);It(s),e.masksTree=s,e.flatCache=ms(1e3)}function So(t,e){t||(t="/");const s=e.flatCache.get(t);if(s)return s;const n=mn(t,e.masksTree);return e.flatCache.set(t,n),n}function Ro(t,e,s,n,r){t||(t="/"),n||(n="/");const i=e?`case\0${t}`:t;let c=r.singleCache.get(i);if(!c){c=Yt("/");const o=new Uint16Array(6);Rs(e,o,{from:t},1,c,0),r.singleCache.set(i,c)}return mn(n,c,s)}function Po(t,e,s=!1){const n=s?t:`nofuzz\0${t}`,r=e.matchCache.get(n);if(r!==void 0)return r;t||(t="/");let i;try{i=mn(t,e.segmentTree,s)}catch(c){if(c instanceof URIError)i=null;else throw c}return i&&(i.branch=bo(i.route)),e.matchCache.set(n,i),i}function _o(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}function wo(t,e=!1,s){const n=Yt(t.fullPath),r=new Uint16Array(6),i={},c={};let o=0;return Rs(e,r,t,1,n,0,u=>{if(s?.(u,o),Mt(!(u.id in i),`Duplicate routes found with id: ${String(u.id)}`),i[u.id]=u,o!==0&&u.path){const h=_o(u.fullPath);(!c[h]||u.fullPath.endsWith("/"))&&(c[h]=u)}o++}),It(n),{processedTree:{segmentTree:n,singleCache:ms(1e3),matchCache:ms(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:c}}function mn(t,e,s=!1){const n=t.split("/"),r=Co(t,n,e,s);if(!r)return null;const[i]=Qr(t,n,r);return{route:r.node.route,rawParams:i,parsedParams:r.parsedParams}}function Qr(t,e,s){const n=xo(s.node);let r=null;const i={};let c=s.extract?.part??0,o=s.extract?.node??0,a=s.extract?.path??0,u=s.extract?.segment??0;for(;o<n.length;c++,o++,a++,u++){const h=n[o];if(h.kind===Gt)break;if(h.kind===qr){u--,c--,a--;continue}const f=e[c],d=a;if(f&&(a+=f.length),h.kind===le){r??(r=s.node.fullPath.split("/"));const m=r[u],y=h.prefix?.length??0;if(m.charCodeAt(y)===123){const v=h.suffix?.length??0,R=m.substring(y+2,m.length-v-1),b=f.substring(y,f.length-v);i[R]=decodeURIComponent(b)}else{const v=m.substring(1);i[v]=decodeURIComponent(f)}}else if(h.kind===We){if(s.skipped&1<<o){c--,a=d-1;continue}r??(r=s.node.fullPath.split("/"));const m=r[u],y=h.prefix?.length??0,g=h.suffix?.length??0,v=m.substring(y+3,m.length-g-1),R=h.suffix||h.prefix?f.substring(y,f.length-g):f;R&&(i[v]=decodeURIComponent(R))}else if(h.kind===he){const m=h,y=t.substring(d+(m.prefix?.length??0),t.length-(m.suffix?.length??0)),g=decodeURIComponent(y);i["*"]=g,i._splat=g;break}}return s.rawParams&&Object.assign(i,s.rawParams),[i,{part:c,node:o,path:a,segment:u}]}function bo(t){const e=[t];for(;t.parentRoute;)t=t.parentRoute,e.push(t);return e.reverse(),e}function xo(t){const e=Array(t.depth+1);do e[t.depth]=t,t=t.parent;while(t);return e}function Co(t,e,s,n){if(t==="/"&&s.index)return{node:s.index,skipped:0};const r=!Ke(e),i=r&&t!=="/",c=e.length-(r?1:0),o=[{node:s,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let a=null,u=null,h=null;for(;o.length;){const f=o.pop(),{node:d,index:m,skipped:y,depth:g,statics:v,dynamics:R,optionals:b}=f;let{extract:w,rawParams:_,parsedParams:k}=f;if(d.skipOnParamError){if(!Ms(t,e,f))continue;_=f.rawParams,w=f.extract,k=f.parsedParams}n&&d.route&&d.kind!==Gt&&De(u,f)&&(u=f);const I=m===c;if(I&&(d.route&&!i&&De(h,f)&&(h=f),!d.optional&&!d.wildcard&&!d.index&&!d.pathless))continue;const x=I?void 0:e[m];let S;if(I&&d.index){const E={node:d.index,index:m,skipped:y,depth:g+1,statics:v,dynamics:R,optionals:b,extract:w,rawParams:_,parsedParams:k};let j=!0;if(d.index.skipOnParamError&&(Ms(t,e,E)||(j=!1)),j){if(v===c&&!R&&!b&&!y)return E;De(h,E)&&(h=E)}}if(d.wildcard&&De(a,f))for(const E of d.wildcard){const{prefix:j,suffix:A}=E;if(j&&(I||!(E.caseSensitive?x:S??(S=x.toLowerCase())).startsWith(j)))continue;if(A){if(I)continue;const H=e.slice(m).join("/").slice(-A.length);if((E.caseSensitive?H:H.toLowerCase())!==A)continue}const B={node:E,index:c,skipped:y,depth:g,statics:v,dynamics:R,optionals:b,extract:w,rawParams:_,parsedParams:k};if(!(E.skipOnParamError&&!Ms(t,e,B))){a=B;break}}if(d.optional){const E=y|1<<g,j=g+1;for(let A=d.optional.length-1;A>=0;A--){const B=d.optional[A];o.push({node:B,index:m,skipped:E,depth:j,statics:v,dynamics:R,optionals:b,extract:w,rawParams:_,parsedParams:k})}if(!I)for(let A=d.optional.length-1;A>=0;A--){const B=d.optional[A],{prefix:H,suffix:N}=B;if(H||N){const vt=B.caseSensitive?x:S??(S=x.toLowerCase());if(H&&!vt.startsWith(H)||N&&!vt.endsWith(N))continue}o.push({node:B,index:m+1,skipped:y,depth:j,statics:v,dynamics:R,optionals:b+1,extract:w,rawParams:_,parsedParams:k})}}if(!I&&d.dynamic&&x)for(let E=d.dynamic.length-1;E>=0;E--){const j=d.dynamic[E],{prefix:A,suffix:B}=j;if(A||B){const H=j.caseSensitive?x:S??(S=x.toLowerCase());if(A&&!H.startsWith(A)||B&&!H.endsWith(B))continue}o.push({node:j,index:m+1,skipped:y,depth:g+1,statics:v,dynamics:R+1,optionals:b,extract:w,rawParams:_,parsedParams:k})}if(!I&&d.staticInsensitive){const E=d.staticInsensitive.get(S??(S=x.toLowerCase()));E&&o.push({node:E,index:m+1,skipped:y,depth:g+1,statics:v+1,dynamics:R,optionals:b,extract:w,rawParams:_,parsedParams:k})}if(!I&&d.static){const E=d.static.get(x);E&&o.push({node:E,index:m+1,skipped:y,depth:g+1,statics:v+1,dynamics:R,optionals:b,extract:w,rawParams:_,parsedParams:k})}if(d.pathless){const E=g+1;for(let j=d.pathless.length-1;j>=0;j--){const A=d.pathless[j];o.push({node:A,index:m,skipped:y,depth:E,statics:v,dynamics:R,optionals:b,extract:w,rawParams:_,parsedParams:k})}}}if(h&&a)return De(a,h)?h:a;if(h)return h;if(a)return a;if(n&&u){let f=u.index;for(let m=0;m<u.index;m++)f+=e[m].length;const d=f===t.length?"/":t.slice(f);return u.rawParams??(u.rawParams={}),u.rawParams["**"]=decodeURIComponent(d),u}return null}function Ms(t,e,s){try{const[n,r]=Qr(t,e,s);s.rawParams=n,s.extract=r;const i=s.node.parse(n);return s.parsedParams=Object.assign({},s.parsedParams,i),!0}catch{return null}}function De(t,e){return t?e.statics>t.statics||e.statics===t.statics&&(e.dynamics>t.dynamics||e.dynamics===t.dynamics&&(e.optionals>t.optionals||e.optionals===t.optionals&&((e.node.kind===Gt)>(t.node.kind===Gt)||e.node.kind===Gt==(t.node.kind===Gt)&&e.depth>t.depth))):!0}function os(t){return yn(t.filter(e=>e!==void 0).join("/"))}function yn(t){return t.replace(/\/{2,}/g,"/")}function Kr(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}function Tt(t){const e=t.length;return e>1&&t[e-1]==="/"?t.replace(/\/{1,}$/,""):t}function Wr(t){return Tt(Kr(t))}function ys(t,e){return t?.endsWith("/")&&t!=="/"&&t!==`${e}/`?t.slice(0,-1):t}function Eo(t,e,s){return ys(t,s)===ys(e,s)}function Oo({base:t,to:e,trailingSlash:s="never",cache:n}){const r=e.startsWith("/"),i=!r&&e===".";let c;if(n){c=r?e:i?t:t+"\0"+e;const f=n.get(c);if(f)return f}let o;if(i)o=t.split("/");else if(r)o=e.split("/");else{for(o=t.split("/");o.length>1&&Ke(o)==="";)o.pop();const f=e.split("/");for(let d=0,m=f.length;d<m;d++){const y=f[d];y===""?d?d===m-1&&o.push(y):o=[y]:y===".."?o.pop():y==="."||o.push(y)}}o.length>1&&(Ke(o)===""?s==="never"&&o.pop():s==="always"&&o.push(""));let a,u="";for(let f=0;f<o.length;f++){f>0&&(u+="/");const d=o[f];if(!d)continue;a=pn(d,0,a);const m=a[0];if(m===Me){u+=d;continue}const y=a[5],g=d.substring(0,a[1]),v=d.substring(a[4],y),R=d.substring(a[2],a[3]);m===le?u+=g||v?`${g}{$${R}}${v}`:`$${R}`:m===he?u+=g||v?`${g}{$}${v}`:"$":u+=`${g}{-$${R}}${v}`}u=yn(u);const h=u||"/";return c&&n&&n.set(c,h),h}function To(t){const e=new Map(t.map(r=>[encodeURIComponent(r),r])),s=Array.from(e.keys()).map(r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),n=new RegExp(s,"g");return r=>r.replace(n,i=>e.get(i)??i)}function ks(t,e,s){const n=e[t];return typeof n!="string"?n:t==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(n)?n:n.split("/").map(r=>nr(r,s)).join("/"):nr(n,s)}function Is({path:t,params:e,decoder:s,server:n}){let r=!1;const i={};if(!t||t==="/")return{interpolatedPath:"/",usedParams:i,isMissingParams:r};if(!t.includes("$"))return{interpolatedPath:t,usedParams:i,isMissingParams:r};const c=t.length;let o=0,a,u="";for(;o<c;){const f=o;a=pn(t,f,a);const d=a[5];if(o=d+1,f===d)continue;const m=a[0];if(m===Me){u+="/"+t.substring(f,d);continue}if(m===he){const y=e._splat;i._splat=y,i["*"]=y;const g=t.substring(f,a[1]),v=t.substring(a[4],d);if(!y){r=!0,(g||v)&&(u+="/"+g+v);continue}const R=ks("_splat",e,s);u+="/"+g+R+v;continue}if(m===le){const y=t.substring(a[2],a[3]);!r&&!(y in e)&&(r=!0),i[y]=e[y];const g=t.substring(f,a[1]),v=t.substring(a[4],d),R=ks(y,e,s)??"undefined";u+="/"+g+R+v;continue}if(m===We){const y=t.substring(a[2],a[3]),g=e[y];if(g==null)continue;i[y]=g;const v=t.substring(f,a[1]),R=t.substring(a[4],d),b=ks(y,e,s)??"";u+="/"+v+b+R;continue}}return t.endsWith("/")&&(u+="/"),{usedParams:i,interpolatedPath:u||"/",isMissingParams:r}}function nr(t,e){const s=encodeURIComponent(t);return e?.(s)??s}function ct(t){return!!t?.isNotFound}function Lo(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const nn="tsr-scroll-restoration-v1_3",Mo=(t,e)=>{let s;return(...n)=>{s||(s=setTimeout(()=>{t(...n),s=null},e))}};function ko(){const t=Lo();if(!t)return null;const e=t.getItem(nn);let s=e?JSON.parse(e):{};return{state:s,set:n=>{s=qt(n,s)||s;try{t.setItem(nn,JSON.stringify(s))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const ns=ko(),Io=t=>t.state.__TSR_key||t.href;function Fo(t){const e=[];let s;for(;s=t.parentNode;)e.push(`${t.tagName}:nth-child(${Array.prototype.indexOf.call(s.children,t)+1})`),t=s;return`${e.reverse().join(" > ")}`.toLowerCase()}let gs=!1;function Ao({storageKey:t,key:e,behavior:s,shouldScrollRestoration:n,scrollToTopSelectors:r,location:i}){let c;try{c=JSON.parse(sessionStorage.getItem(t)||"{}")}catch(u){console.error(u);return}const o=e||window.history.state?.__TSR_key,a=c[o];gs=!0;t:{if(n&&a&&Object.keys(a).length>0){for(const f in a){const d=a[f];if(f==="window")window.scrollTo({top:d.scrollY,left:d.scrollX,behavior:s});else if(f){const m=document.querySelector(f);m&&(m.scrollLeft=d.scrollX,m.scrollTop=d.scrollY)}}break t}const u=(i??window.location).hash.split("#",2)[1];if(u){const f=window.history.state?.__hashScrollIntoViewOptions??!0;if(f){const d=document.getElementById(u);d&&d.scrollIntoView(f)}break t}const h={top:0,left:0,behavior:s};if(window.scrollTo(h),r)for(const f of r){if(f==="window")continue;const d=typeof f=="function"?f():document.querySelector(f);d&&d.scrollTo(h)}}gs=!1}function Do(t,e){if(!ns||((t.options.scrollRestoration??!1)&&(t.isScrollRestoring=!0),t.isScrollRestorationSetup||!ns))return;t.isScrollRestorationSetup=!0,gs=!1;const n=t.options.getScrollRestorationKey||Io;window.history.scrollRestoration="manual";const r=i=>{if(gs||!t.isScrollRestoring)return;let c="";if(i.target===document||i.target===window)c="window";else{const a=i.target.getAttribute("data-scroll-restoration-id");a?c=`[data-scroll-restoration-id="${a}"]`:c=Fo(i.target)}const o=n(t.state.location);ns.set(a=>{const u=a[o]||(a[o]={}),h=u[c]||(u[c]={});if(c==="window")h.scrollX=window.scrollX||0,h.scrollY=window.scrollY||0;else if(c){const f=document.querySelector(c);f&&(h.scrollX=f.scrollLeft||0,h.scrollY=f.scrollTop||0)}return a})};typeof document<"u"&&document.addEventListener("scroll",Mo(r,100),!0),t.subscribe("onRendered",i=>{const c=n(i.toLocation);if(!t.resetNextScroll){t.resetNextScroll=!0;return}typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation})||(Ao({storageKey:nn,key:c,behavior:t.options.scrollRestorationBehavior,shouldScrollRestoration:t.isScrollRestoring,scrollToTopSelectors:t.options.scrollToTopSelectors,location:t.history.location}),t.isScrollRestoring&&ns.set(o=>(o[c]||(o[c]={}),o)))})}function jo(t){if(typeof document<"u"&&document.querySelector){const e=t.state.location.state.__hashScrollIntoViewOptions??!0;if(e&&t.state.location.hash!==""){const s=document.getElementById(t.state.location.hash);s&&s.scrollIntoView(e)}}}function No(t,e=String){const s=new URLSearchParams;for(const n in t){const r=t[n];r!==void 0&&s.set(n,e(r))}return s.toString()}function Fs(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}function Uo(t){const e=new URLSearchParams(t),s={};for(const[n,r]of e.entries()){const i=s[n];i==null?s[n]=Fs(r):Array.isArray(i)?i.push(Fs(r)):s[n]=[i,Fs(r)]}return s}const Bo=$o(JSON.parse),Ho=qo(JSON.stringify,JSON.parse);function $o(t){return e=>{e[0]==="?"&&(e=e.substring(1));const s=Uo(e);for(const n in s){const r=s[n];if(typeof r=="string")try{s[n]=t(r)}catch{}}return s}}function qo(t,e){const s=typeof e=="function";function n(r){if(typeof r=="object"&&r!==null)try{return t(r)}catch{}else if(s&&typeof r=="string")try{return e(r),t(r)}catch{}return r}return r=>{const i=No(r,n);return i?`?${i}`:""}}const ht="__root__";function Qo(t){if(t.statusCode=t.statusCode||t.code||307,!t._builtLocation&&typeof t.href=="string"&&ps(t.href))throw new Error(`Redirect blocked: unsafe protocol in href "${t.href}". Only ${$r.join(", ")} protocols are allowed.`);if(!t._builtLocation&&!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}const e=new Headers(t.headers);t.href&&e.get("Location")===null&&e.set("Location",t.href);const s=new Response(null,{status:t.statusCode,headers:e});if(s.options=t,t.throw)throw s;return s}function ft(t){return t instanceof Response&&!!t.options}const as=t=>{if(!t.rendered)return t.rendered=!0,t.onReady?.()},Ps=(t,e)=>!!(t.preload&&!t.router.state.matches.some(s=>s.id===e)),ye=(t,e,s=!0)=>{const n={...t.router.options.context??{}},r=s?e:e-1;for(let i=0;i<=r;i++){const c=t.matches[i];if(!c)continue;const o=t.router.getMatch(c.id);o&&Object.assign(n,o.__routeContext,o.__beforeLoadContext)}return n},Vr=(t,e)=>{const s=t.router.routesById[e.routeId??""]??t.router.routeTree;!s.options.notFoundComponent&&t.router.options?.defaultNotFoundComponent&&(s.options.notFoundComponent=t.router.options.defaultNotFoundComponent),Mt(s.options.notFoundComponent);const n=t.matches.find(r=>r.routeId===s.id);Mt(n,"Could not find match for route: "+s.id),t.updateMatch(n.id,r=>({...r,status:"notFound",error:e,isFetching:!1})),e.routerCode==="BEFORE_LOAD"&&s.parentRoute&&(e.routeId=s.parentRoute.id,Vr(t,e))},Qt=(t,e,s)=>{if(!(!ft(s)&&!ct(s))){if(ft(s)&&s.redirectHandled&&!s.options.reloadDocument)throw s;if(e){e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.loaderPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loaderPromise=void 0;const n=ft(s)?"redirected":"notFound";e._nonReactive.error=s,t.updateMatch(e.id,r=>({...r,status:n,context:ye(t,e.index),isFetching:!1,error:s})),ct(s)&&!s.routeId&&(s.routeId=e.routeId),e._nonReactive.loadPromise?.resolve()}throw ft(s)?(t.rendered=!0,s.options._fromLocation=t.location,s.redirectHandled=!0,s=t.router.resolveRedirect(s),s):(Vr(t,s),s)}},zr=(t,e)=>!!t.router.getMatch(e)._nonReactive.dehydrated,je=(t,e,s,n)=>{const{id:r,routeId:i}=t.matches[e],c=t.router.looseRoutesById[i];if(s instanceof Promise)throw s;s.routerCode=n,t.firstBadMatchIndex??(t.firstBadMatchIndex=e),Qt(t,t.router.getMatch(r),s);try{c.options.onError?.(s)}catch(o){s=o,Qt(t,t.router.getMatch(r),s)}t.updateMatch(r,o=>(o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,o._nonReactive.loadPromise?.resolve(),{...o,error:s,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},Gr=(t,e,s,n)=>{if(n._nonReactive.pendingTimeout!==void 0)return;const r=s.options.pendingMs??t.router.options.defaultPendingMs;if(!!(t.onReady&&!Ps(t,e)&&(s.options.loader||s.options.beforeLoad||Xr(s))&&typeof r=="number"&&r!==1/0&&(s.options.pendingComponent??t.router.options?.defaultPendingComponent))){const c=setTimeout(()=>{as(t)},r);n._nonReactive.pendingTimeout=c}},Ko=(t,e,s)=>{const n=t.router.getMatch(e);if(!n._nonReactive.beforeLoadPromise&&!n._nonReactive.loaderPromise)return;Gr(t,e,s,n);const r=()=>{const i=t.router.getMatch(e);i.preload&&(i.status==="redirected"||i.status==="notFound")&&Qt(t,i,i.error)};return n._nonReactive.beforeLoadPromise?n._nonReactive.beforeLoadPromise.then(r):r()},Wo=(t,e,s,n)=>{const r=t.router.getMatch(e),i=r._nonReactive.loadPromise;r._nonReactive.loadPromise=Le(()=>{i?.resolve()});const{paramsError:c,searchError:o}=r;c&&je(t,s,c,"PARSE_PARAMS"),o&&je(t,s,o,"VALIDATE_SEARCH"),Gr(t,e,n,r);const a=new AbortController;let u=!1;const h=()=>{u||(u=!0,t.updateMatch(e,_=>({..._,isFetching:"beforeLoad",fetchCount:_.fetchCount+1,abortController:a})))},f=()=>{r._nonReactive.beforeLoadPromise?.resolve(),r._nonReactive.beforeLoadPromise=void 0,t.updateMatch(e,_=>({..._,isFetching:!1}))};if(!n.options.beforeLoad){qe(()=>{h(),f()});return}r._nonReactive.beforeLoadPromise=Le();const d={...ye(t,s,!1),...r.__routeContext},{search:m,params:y,cause:g}=r,v=Ps(t,e),R={search:m,abortController:a,params:y,preload:v,context:d,location:t.location,navigate:_=>t.router.navigate({..._,_fromLocation:t.location}),buildLocation:t.router.buildLocation,cause:v?"preload":g,matches:t.matches,...t.router.options.additionalContext},b=_=>{if(_===void 0){qe(()=>{h(),f()});return}(ft(_)||ct(_))&&(h(),je(t,s,_,"BEFORE_LOAD")),qe(()=>{h(),t.updateMatch(e,k=>({...k,__beforeLoadContext:_})),f()})};let w;try{if(w=n.options.beforeLoad(R),me(w))return h(),w.catch(_=>{je(t,s,_,"BEFORE_LOAD")}).then(b)}catch(_){h(),je(t,s,_,"BEFORE_LOAD")}b(w)},Vo=(t,e)=>{const{id:s,routeId:n}=t.matches[e],r=t.router.looseRoutesById[n],i=()=>o(),c=()=>Wo(t,s,e,r),o=()=>{if(zr(t,s))return;const a=Ko(t,s,r);return me(a)?a.then(c):c()};return i()},zo=(t,e,s)=>{const n=t.router.getMatch(e);if(!n||!s.options.head&&!s.options.scripts&&!s.options.headers)return;const r={ssr:t.router.options.ssr,matches:t.matches,match:n,params:n.params,loaderData:n.loaderData};return Promise.all([s.options.head?.(r),s.options.scripts?.(r),s.options.headers?.(r)]).then(([i,c,o])=>{const a=i?.meta,u=i?.links,h=i?.scripts,f=i?.styles;return{meta:a,links:u,headScripts:h,headers:o,scripts:c,styles:f}})},Yr=(t,e,s,n)=>{const r=t.matchPromises[s-1],{params:i,loaderDeps:c,abortController:o,cause:a}=t.router.getMatch(e),u=ye(t,s),h=Ps(t,e);return{params:i,deps:c,preload:!!h,parentMatchPromise:r,abortController:o,context:u,location:t.location,navigate:f=>t.router.navigate({...f,_fromLocation:t.location}),cause:h?"preload":a,route:n,...t.router.options.additionalContext}},rr=async(t,e,s,n)=>{try{const r=t.router.getMatch(e);try{(!(lo??t.router.isServer)||r.ssr===!0)&&Jr(n);const i=n.options.loader?.(Yr(t,e,s,n)),c=n.options.loader&&me(i);if(!!(c||n._lazyPromise||n._componentsPromise||n.options.head||n.options.scripts||n.options.headers||r._nonReactive.minPendingPromise)&&t.updateMatch(e,u=>({...u,isFetching:"loader"})),n.options.loader){const u=c?await i:i;Qt(t,t.router.getMatch(e),u),u!==void 0&&t.updateMatch(e,h=>({...h,loaderData:u}))}n._lazyPromise&&await n._lazyPromise;const a=r._nonReactive.minPendingPromise;a&&await a,n._componentsPromise&&await n._componentsPromise,t.updateMatch(e,u=>({...u,error:void 0,context:ye(t,s),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(i){let c=i;if(c?.name==="AbortError"){t.updateMatch(e,a=>({...a,status:a.status==="pending"?"success":a.status,isFetching:!1,context:ye(t,s)}));return}const o=r._nonReactive.minPendingPromise;o&&await o,ct(i)&&await n.options.notFoundComponent?.preload?.(),Qt(t,t.router.getMatch(e),i);try{n.options.onError?.(i)}catch(a){c=a,Qt(t,t.router.getMatch(e),a)}t.updateMatch(e,a=>({...a,error:c,context:ye(t,s),status:"error",isFetching:!1}))}}catch(r){const i=t.router.getMatch(e);i&&(i._nonReactive.loaderPromise=void 0),Qt(t,i,r)}},Go=async(t,e)=>{const{id:s,routeId:n}=t.matches[e];let r=!1,i=!1;const c=t.router.looseRoutesById[n];if(!zr(t,s)){const u=t.router.getMatch(s);if(u._nonReactive.loaderPromise){if(u.status==="success"&&!t.sync&&!u.preload)return u;await u._nonReactive.loaderPromise;const h=t.router.getMatch(s),f=h._nonReactive.error||h.error;f&&Qt(t,h,f)}else{const h=Date.now()-u.updatedAt,f=Ps(t,s),d=f?c.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:c.options.staleTime??t.router.options.defaultStaleTime??0,m=c.options.shouldReload,y=typeof m=="function"?m(Yr(t,s,e,c)):m,g=!!f&&!t.router.state.matches.some(w=>w.id===s),v=t.router.getMatch(s);v._nonReactive.loaderPromise=Le(),g!==v.preload&&t.updateMatch(s,w=>({...w,preload:g}));const{status:R,invalid:b}=v;r=R==="success"&&(b||(y??h>d)),f&&c.options.preload===!1||(r&&!t.sync?(i=!0,(async()=>{try{await rr(t,s,e,c);const w=t.router.getMatch(s);w._nonReactive.loaderPromise?.resolve(),w._nonReactive.loadPromise?.resolve(),w._nonReactive.loaderPromise=void 0}catch(w){ft(w)&&await t.router.navigate(w.options)}})()):(R!=="success"||r&&t.sync)&&await rr(t,s,e,c))}}const o=t.router.getMatch(s);i||(o._nonReactive.loaderPromise?.resolve(),o._nonReactive.loadPromise?.resolve()),clearTimeout(o._nonReactive.pendingTimeout),o._nonReactive.pendingTimeout=void 0,i||(o._nonReactive.loaderPromise=void 0),o._nonReactive.dehydrated=void 0;const a=i?o.isFetching:!1;return a!==o.isFetching||o.invalid!==!1?(t.updateMatch(s,u=>({...u,isFetching:a,invalid:!1})),t.router.getMatch(s)):o};async function ir(t){const e=Object.assign(t,{matchPromises:[]});e.router.state.matches.some(s=>s._forcePending)&&as(e);try{for(let o=0;o<e.matches.length;o++){const a=Vo(e,o);me(a)&&await a}const s=e.firstBadMatchIndex??e.matches.length;for(let o=0;o<s;o++)e.matchPromises.push(Go(e,o));const r=(await Promise.allSettled(e.matchPromises)).filter(o=>o.status==="rejected").map(o=>o.reason);let i;for(const o of r){if(ft(o))throw o;!i&&ct(o)&&(i=o)}for(const o of e.matches){const{id:a,routeId:u}=o,h=e.router.looseRoutesById[u];try{const f=zo(e,a,h);if(f){const d=await f;e.updateMatch(a,m=>({...m,...d}))}}catch(f){console.error(`Error executing head for route ${u}:`,f)}}if(i)throw i;const c=as(e);me(c)&&await c}catch(s){if(ct(s)&&!e.preload){const n=as(e);throw me(n)&&await n,s}if(ft(s))throw s}return e.matches}async function Jr(t){if(!t._lazyLoaded&&t._lazyPromise===void 0&&(t.lazyFn?t._lazyPromise=t.lazyFn().then(e=>{const{id:s,...n}=e.options;Object.assign(t.options,n),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0),!t._componentsLoaded&&t._componentsPromise===void 0){const e=()=>{const s=[];for(const n of Zr){const r=t.options[n]?.preload;r&&s.push(r())}if(s.length)return Promise.all(s).then(()=>{t._componentsLoaded=!0,t._componentsPromise=void 0});t._componentsLoaded=!0,t._componentsPromise=void 0};t._componentsPromise=t._lazyPromise?t._lazyPromise.then(e):e()}return t._componentsPromise}function Xr(t){for(const e of Zr)if(t.options[e]?.preload)return!0;return!1}const Zr=["component","errorComponent","pendingComponent","notFoundComponent"];function Yo(t){return{input:({url:e})=>{for(const s of t)e=rn(s,e);return e},output:({url:e})=>{for(let s=t.length-1;s>=0;s--)e=ti(t[s],e);return e}}}function Jo(t){const e=Wr(t.basepath),s=`/${e}`,n=`${s}/`,r=t.caseSensitive?s:s.toLowerCase(),i=t.caseSensitive?n:n.toLowerCase();return{input:({url:c})=>{const o=t.caseSensitive?c.pathname:c.pathname.toLowerCase();return o===r?c.pathname="/":o.startsWith(i)&&(c.pathname=c.pathname.slice(s.length)),c},output:({url:c})=>(c.pathname=os(["/",e,c.pathname]),c)}}function rn(t,e){const s=t?.input?.({url:e});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return e}function ti(t,e){const s=t?.output?.({url:e});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return e}function ae(t){const e=t.resolvedLocation,s=t.location,n=e?.pathname!==s.pathname,r=e?.href!==s.href,i=e?.hash!==s.hash;return{fromLocation:e,toLocation:s,pathChanged:n,hrefChanged:r,hashChanged:i}}class Xo{constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=s=>s(),this.update=s=>{s.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const n=this.options,r=this.basepath??n?.basepath??"/",i=this.basepath===void 0,c=n?.rewrite;if(this.options={...n,...s},this.isServer=this.options.isServer??typeof document>"u",this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=To(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=co()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let d;this.resolvePathCache=ms(1e3),d=this.buildRouteTree(),this.setRoutes(d)}!this.__store&&this.latestLocation&&(this.__store=new oo(ta(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(d=>!["redirected"].includes(d.status))}}}),Do(this));let o=!1;const a=this.options.basepath??"/",u=this.options.rewrite;if(i||r!==a||c!==u){this.basepath=a;const d=[],m=Wr(a);m&&m!=="/"&&d.push(Jo({basepath:a})),u&&d.push(u),this.rewrite=d.length===0?void 0:d.length===1?d[0]:Yo(d),this.history&&this.updateLatestLocation(),o=!0}o&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const s=wo(this.routeTree,this.options.caseSensitive,(n,r)=>{n.init({originalIndex:r})});return this.options.routeMasks&&vo(this.options.routeMasks,s.processedTree),s},this.subscribe=(s,n)=>{const r={eventType:s,fn:n};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=s=>{this.subscribers.forEach(n=>{n.eventType===s.type&&n.fn(s)})},this.parseLocation=(s,n)=>{const r=({pathname:a,search:u,hash:h,href:f,state:d})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(a)){const b=this.options.parseSearch(u),w=this.options.stringifySearch(b);return{href:a+w+h,publicHref:f,pathname:Ae(a),external:!1,searchStr:w,search:it(n?.search,b),hash:Ae(h.slice(1)),state:it(n?.state,d)}}const m=new URL(f,this.origin),y=rn(this.rewrite,m),g=this.options.parseSearch(y.search),v=this.options.stringifySearch(g);return y.search=v,{href:y.href.replace(y.origin,""),publicHref:f,pathname:Ae(y.pathname),external:!!this.rewrite&&y.origin!==this.origin,searchStr:v,search:it(n?.search,g),hash:Ae(y.hash.slice(1)),state:it(n?.state,d)}},i=r(s),{__tempLocation:c,__tempKey:o}=i.state;if(c&&(!o||o===this.tempLocationKey)){const a=r(c);return a.state.key=i.state.key,a.state.__TSR_key=i.state.__TSR_key,delete a.state.__tempLocation,{...a,maskedLocation:i}}return i},this.resolvePathWithBase=(s,n)=>Oo({base:s,to:yn(n),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(s,n,r)=>typeof s=="string"?this.matchRoutesInternal({pathname:s,search:n},r):this.matchRoutesInternal(s,n),this.getMatchedRoutes=s=>ea({pathname:s,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=s=>{const n=this.getMatch(s);n&&(n.abortController.abort(),clearTimeout(n._nonReactive.pendingTimeout),n._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const s=this.state.matches.filter(i=>i.status==="pending"),n=this.state.matches.filter(i=>i.isFetching==="loader");new Set([...this.state.pendingMatches??[],...s,...n]).forEach(i=>{this.cancelMatch(i.id)})},this.buildLocation=s=>{const n=(i={})=>{const c=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,o=this.matchRoutesLightweight(c);i.from;const a=i.unsafeRelative==="path"?c.pathname:i.from??o.fullPath,u=this.resolvePathWithBase(a,"."),h=o.search,f={...o.params},d=i.to?this.resolvePathWithBase(u,`${i.to}`):this.resolvePathWithBase(u,"."),m=i.params===!1||i.params===null?{}:(i.params??!0)===!0?f:Object.assign(f,qt(i.params,f)),y=Is({path:d,params:m,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,g=this.getMatchedRoutes(y);let v=g.matchedRoutes;(g.foundRoute?g.foundRoute.path!=="/"&&g.routeParams["**"]:Tt(y))&&this.options.notFoundRoute&&(v=[...v,this.options.notFoundRoute]);let b=!1;if(Object.keys(m).length>0)for(const H of v){const N=H.options.params?.stringify??H.options.stringifyParams;N&&(b=!0,Object.assign(m,N(m)))}const w=s.leaveParams?d:Ae(b?Is({path:d,params:m,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:y);let _=h;if(s._includeValidateSearch&&this.options.search?.strict){const H={};v.forEach(N=>{if(N.options.validateSearch)try{Object.assign(H,cs(N.options.validateSearch,{...H,..._}))}catch{}}),_=H}_=sa({search:_,dest:i,destRoutes:v,_includeValidateSearch:s._includeValidateSearch}),_=it(h,_);const k=this.options.stringifySearch(_),I=i.hash===!0?c.hash:i.hash?qt(i.hash,c.hash):void 0,x=I?`#${I}`:"";let S=i.state===!0?c.state:i.state?qt(i.state,c.state):{};S=it(c.state,S);const E=`${w}${k}${x}`;let j,A,B=!1;if(this.rewrite){const H=new URL(E,this.origin),N=ti(this.rewrite,H);j=H.href.replace(H.origin,""),N.origin!==this.origin?(A=N.href,B=!0):A=N.pathname+N.search+N.hash}else j=mo(E),A=j;return{publicHref:A,href:j,pathname:w,search:_,searchStr:k,state:S,hash:I??"",external:B,unmaskOnReload:i.unmaskOnReload}},r=(i={},c)=>{const o=n(i);let a=c?n(c):void 0;if(!a){const u={};if(this.options.routeMasks){const h=So(o.pathname,this.processedTree);if(h){Object.assign(u,h.rawParams);const{from:f,params:d,...m}=h.route,y=d===!1||d===null?{}:(d??!0)===!0?u:Object.assign(u,qt(d,u));c={from:s.from,...m,params:y},a=n(c)}}}return a&&(o.maskedLocation=a),o};return s.mask?r(s,{from:s.from,...s.mask}):r(s)},this.commitLocation=async({viewTransition:s,ignoreBlocker:n,...r})=>{const i=()=>{const a=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];a.forEach(h=>{r.state[h]=this.latestLocation.state[h]});const u=oe(r.state,this.latestLocation.state);return a.forEach(h=>{delete r.state[h]}),u},c=Tt(this.latestLocation.href)===Tt(r.href),o=this.commitLocationPromise;if(this.commitLocationPromise=Le(()=>{o?.resolve()}),c&&i())this.load();else{let{maskedLocation:a,hashScrollIntoView:u,...h}=r;a&&(h={...a,state:{...a.state,__tempKey:void 0,__tempLocation:{...h,search:h.searchStr,state:{...h.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(h.unmaskOnReload??this.options.unmaskOnReload??!1)&&(h.state.__tempKey=this.tempLocationKey)),h.state.__hashScrollIntoViewOptions=u??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=s,this.history[r.replace?"replace":"push"](h.publicHref,h.state,{ignoreBlocker:n})}return this.resetNextScroll=r.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:s,resetScroll:n,hashScrollIntoView:r,viewTransition:i,ignoreBlocker:c,href:o,...a}={})=>{if(o){const f=this.history.location.state.__TSR_index,d=fs(o,{__TSR_index:s?f:f+1}),m=new URL(d.pathname,this.origin),y=rn(this.rewrite,m);a.to=y.pathname,a.search=this.options.parseSearch(d.search),a.hash=d.hash.slice(1)}const u=this.buildLocation({...a,_includeValidateSearch:!0});this.pendingBuiltLocation=u;const h=this.commitLocation({...u,viewTransition:i,replace:s,resetScroll:n,hashScrollIntoView:r,ignoreBlocker:c});return Promise.resolve().then(()=>{this.pendingBuiltLocation===u&&(this.pendingBuiltLocation=void 0)}),h},this.navigate=async({to:s,reloadDocument:n,href:r,publicHref:i,...c})=>{let o=!1;if(r)try{new URL(`${r}`),o=!0}catch{}if(o&&!n&&(n=!0),n){if(s!==void 0||!r){const u=this.buildLocation({to:s,...c});r=r??u.publicHref,i=i??u.publicHref}const a=!o&&i?i:r;if(ps(a))return Promise.resolve();if(!c.ignoreBlocker){const h=this.history.getBlockers?.()??[];for(const f of h)if(f?.blockerFn&&await f.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return c.replace?window.location.replace(a):window.location.href=a,Promise.resolve()}return this.buildAndCommitLocation({...c,href:r,to:s,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const s=this.matchRoutes(this.latestLocation);this.__store.setState(n=>({...n,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:s,cachedMatches:n.cachedMatches.filter(r=>!s.some(i=>i.id===r.id))}))},this.load=async s=>{let n,r,i;for(i=new Promise(o=>{this.startTransition(async()=>{try{this.beforeLoad();const a=this.latestLocation,u=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...ae({resolvedLocation:u,location:a})}),this.emit({type:"onBeforeLoad",...ae({resolvedLocation:u,location:a})}),await ir({router:this,sync:s?.sync,matches:this.state.pendingMatches,location:a,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let h=[],f=[],d=[];qe(()=>{this.__store.setState(m=>{const y=m.matches,g=m.pendingMatches||m.matches;return h=y.filter(v=>!g.some(R=>R.id===v.id)),f=g.filter(v=>!y.some(R=>R.id===v.id)),d=g.filter(v=>y.some(R=>R.id===v.id)),{...m,isLoading:!1,loadedAt:Date.now(),matches:g,pendingMatches:void 0,cachedMatches:[...m.cachedMatches,...h.filter(v=>v.status!=="error"&&v.status!=="notFound")]}}),this.clearExpiredCache()}),[[h,"onLeave"],[f,"onEnter"],[d,"onStay"]].forEach(([m,y])=>{m.forEach(g=>{this.looseRoutesById[g.routeId].options[y]?.(g)})})})})}})}catch(a){ft(a)?(n=a,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):ct(a)&&(r=a),this.__store.setState(u=>({...u,statusCode:n?n.status:r?404:u.matches.some(h=>h.status==="error")?500:200,redirect:n}))}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),o()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let c;this.hasNotFoundMatch()?c=404:this.__store.state.matches.some(o=>o.status==="error")&&(c=500),c!==void 0&&this.__store.setState(o=>({...o,statusCode:c}))},this.startViewTransition=s=>{const n=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,n&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof n=="object"&&this.isViewTransitionTypesSupported){const i=this.latestLocation,c=this.state.resolvedLocation,o=typeof n.types=="function"?n.types(ae({resolvedLocation:c,location:i})):n.types;if(o===!1){s();return}r={update:s,types:o}}else r=s;document.startViewTransition(r)}else s()},this.updateMatch=(s,n)=>{this.startTransition(()=>{const r=this.state.pendingMatches?.some(i=>i.id===s)?"pendingMatches":this.state.matches.some(i=>i.id===s)?"matches":this.state.cachedMatches.some(i=>i.id===s)?"cachedMatches":"";r&&this.__store.setState(i=>({...i,[r]:i[r]?.map(c=>c.id===s?n(c):c)}))})},this.getMatch=s=>{const n=r=>r.id===s;return this.state.cachedMatches.find(n)??this.state.pendingMatches?.find(n)??this.state.matches.find(n)},this.invalidate=s=>{const n=r=>s?.filter?.(r)??!0?{...r,invalid:!0,...s?.forcePending||r.status==="error"||r.status==="notFound"?{status:"pending",error:void 0}:void 0}:r;return this.__store.setState(r=>({...r,matches:r.matches.map(n),cachedMatches:r.cachedMatches.map(n),pendingMatches:r.pendingMatches?.map(n)})),this.shouldViewTransition=!1,this.load({sync:s?.sync})},this.getParsedLocationHref=s=>s.publicHref||"/",this.resolveRedirect=s=>{const n=s.headers.get("Location");if(!s.options.href||s.options._builtLocation){const r=s.options._builtLocation??this.buildLocation(s.options),i=this.getParsedLocationHref(r);s.options.href=i,s.headers.set("Location",i)}else if(n)try{const r=new URL(n);if(this.origin&&r.origin===this.origin){const i=r.pathname+r.search+r.hash;s.options.href=i,s.headers.set("Location",i)}}catch{}return s.headers.get("Location")||s.headers.set("Location",s.options.href),s},this.clearCache=s=>{const n=s?.filter;n!==void 0?this.__store.setState(r=>({...r,cachedMatches:r.cachedMatches.filter(i=>!n(i))})):this.__store.setState(r=>({...r,cachedMatches:[]}))},this.clearExpiredCache=()=>{const s=n=>{const r=this.looseRoutesById[n.routeId];if(!r.options.loader)return!0;const i=(n.preload?r.options.preloadGcTime??this.options.defaultPreloadGcTime:r.options.gcTime??this.options.defaultGcTime)??300*1e3;return n.status==="error"?!0:Date.now()-n.updatedAt>=i};this.clearCache({filter:s})},this.loadRouteChunk=Jr,this.preloadRoute=async s=>{const n=this.buildLocation(s);let r=this.matchRoutes(n,{throwOnError:!0,preload:!0,dest:s});const i=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(o=>o.id)),c=new Set([...i,...this.state.cachedMatches.map(o=>o.id)]);qe(()=>{r.forEach(o=>{c.has(o.id)||this.__store.setState(a=>({...a,cachedMatches:[...a.cachedMatches,o]}))})});try{return r=await ir({router:this,matches:r,location:n,preload:!0,updateMatch:(o,a)=>{i.has(o)?r=r.map(u=>u.id===o?a(u):u):this.updateMatch(o,a)}}),r}catch(o){if(ft(o))return o.options.reloadDocument?void 0:await this.preloadRoute({...o.options,_fromLocation:n});ct(o)||console.error(o);return}},this.matchRoute=(s,n)=>{const r={...s,to:s.to?this.resolvePathWithBase(s.from||"",s.to):void 0,params:s.params||{},leaveParams:!0},i=this.buildLocation(r);if(n?.pending&&this.state.status!=="pending")return!1;const o=(n?.pending===void 0?!this.state.isLoading:n.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,a=Ro(i.pathname,n?.caseSensitive??!1,n?.fuzzy??!1,o.pathname,this.processedTree);return!a||s.params&&!oe(a.rawParams,s.params,{partial:!0})?!1:n?.includeSearch??!0?oe(o.search,i.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(s=>s.status==="notFound"||s.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??Ho,parseSearch:e.parseSearch??Bo}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:e,routesByPath:s,processedTree:n}){this.routesById=e,this.routesByPath=s,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}matchRoutesInternal(e,s){const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:c}=n;let{matchedRoutes:o}=n,a=!1;(r?r.path!=="/"&&i["**"]:Tt(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:a=!0);const u=a?ra(this.options.notFoundMode,o):void 0,h=[],f=d=>d?.id?d.context??this.options.context??void 0:this.options.context??void 0;return o.forEach((d,m)=>{const y=h[m-1],[g,v,R]=(()=>{const N=y?.search??e.search,vt=y?._strictSearch??void 0;try{const X=cs(d.options.validateSearch,{...N})??void 0;return[{...N,...X},{...vt,...X},void 0]}catch(X){let St=X;if(X instanceof vs||(St=new vs(X.message,{cause:X})),s?.throwOnError)throw St;return[N,{},St]}})(),b=d.options.loaderDeps?.({search:g})??"",w=b?JSON.stringify(b):"",{interpolatedPath:_,usedParams:k}=Is({path:d.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),I=d.id+_+w,x=this.getMatch(I),S=this.state.matches.find(N=>N.routeId===d.id),E=x?._strictParams??k;let j;if(!x)try{or(d,k,c,E)}catch(N){if(ct(N)||ft(N)?j=N:j=new Zo(N.message,{cause:N}),s?.throwOnError)throw j}Object.assign(i,E);const A=S?"stay":"enter";let B;if(x)B={...x,cause:A,params:S?it(S.params,i):i,_strictParams:E,search:it(S?S.search:x.search,g),_strictSearch:v};else{const N=d.options.loader||d.options.beforeLoad||d.lazyFn||Xr(d)?"pending":"success";B={id:I,ssr:d.options.ssr,index:m,routeId:d.id,params:S?it(S.params,i):i,_strictParams:E,pathname:_,updatedAt:Date.now(),search:S?it(S.search,g):g,_strictSearch:v,searchError:void 0,status:N,isFetching:!1,error:void 0,paramsError:j,__routeContext:void 0,_nonReactive:{loadPromise:Le()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:A,loaderDeps:S?it(S.loaderDeps,b):b,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:d.options.staticData||{},fullPath:d.fullPath}}s?.preload||(B.globalNotFound=u===d.id),B.searchError=R;const H=f(y);B.context={...H,...B.__routeContext,...B.__beforeLoadContext},h.push(B)}),h.forEach((d,m)=>{const y=this.looseRoutesById[d.routeId];if(!this.getMatch(d.id)){const v=h[m-1],R=f(v);if(y.options.context){const b={deps:d.loaderDeps,params:d.params,context:R??{},location:e,navigate:w=>this.navigate({...w,_fromLocation:e}),buildLocation:this.buildLocation,cause:d.cause,abortController:d.abortController,preload:!!d.preload,matches:h};d.__routeContext=y.options.context(b)??void 0}d.context={...R,...d.__routeContext,...d.__beforeLoadContext}}}),h}matchRoutesLightweight(e){const{matchedRoutes:s,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=Ke(s),c={...e.search};for(const h of s)try{Object.assign(c,cs(h.options.validateSearch,c))}catch{}const o=Ke(this.state.matches),a=o&&o.routeId===i.id&&e.pathname===this.state.location.pathname;let u;if(a)u=o.params;else{const h={...n};for(const f of s)try{or(f,n,r??{},h)}catch{}u=h}return{matchedRoutes:s,fullPath:i.fullPath,search:c,params:u}}}class vs extends Error{}class Zo extends Error{}function ta(t){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:t,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function cs(t,e){if(t==null)return{};if("~standard"in t){const s=t["~standard"].validate(e);if(s instanceof Promise)throw new vs("Async validation not supported");if(s.issues)throw new vs(JSON.stringify(s.issues,void 0,2),{cause:s});return s.value}return"parse"in t?t.parse(e):typeof t=="function"?t(e):{}}function ea({pathname:t,routesById:e,processedTree:s}){const n={},r=Tt(t);let i,c;const o=Po(r,s,!0);return o&&(i=o.route,Object.assign(n,o.rawParams),c=Object.assign({},o.parsedParams)),{matchedRoutes:o?.branch||[e[ht]],routeParams:n,foundRoute:i,parsedParams:c}}function sa({search:t,dest:e,destRoutes:s,_includeValidateSearch:n}){return na(s)(t,e,n??!1)}function na(t){const e={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const r of t){if("search"in r.options)r.options.search?.middlewares&&e.middlewares.push(...r.options.search.middlewares);else if(r.options.preSearchFilters||r.options.postSearchFilters){const i=({search:c,next:o})=>{let a=c;"preSearchFilters"in r.options&&r.options.preSearchFilters&&(a=r.options.preSearchFilters.reduce((h,f)=>f(h),c));const u=o(a);return"postSearchFilters"in r.options&&r.options.postSearchFilters?r.options.postSearchFilters.reduce((h,f)=>f(h),u):u};e.middlewares.push(i)}if(r.options.validateSearch){const i=({search:c,next:o})=>{const a=o(c);if(!e._includeValidateSearch)return a;try{return{...a,...cs(r.options.validateSearch,a)??void 0}}catch{return a}};e.middlewares.push(i)}}const s=({search:r})=>{const i=e.dest;return i.search?i.search===!0?r:qt(i.search,r):{}};e.middlewares.push(s);const n=(r,i,c)=>{if(r>=c.length)return i;const o=c[r];return o({search:i,next:u=>n(r+1,u,c)})};return function(i,c,o){return e.dest=c,e._includeValidateSearch=o,n(0,i,e.middlewares)}}function ra(t,e){if(t!=="root")for(let s=e.length-1;s>=0;s--){const n=e[s];if(n.children)return n.id}return ht}function or(t,e,s,n){const r=t.options.params?.parse??t.options.parseParams;if(r)if(t.options.skipRouteOnParseError)for(const i in e)i in s&&(n[i]=s[i]);else{const i=r(n);Object.assign(n,i)}}const ia="Error preloading route! ☝️";class ei{constructor(e){if(this.init=s=>{this.originalIndex=s.originalIndex;const n=this.options,r=!n?.path&&!n?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=ht:this.parentRoute||Mt(!1);let i=r?ht:n?.path;i&&i!=="/"&&(i=Kr(i));const c=n?.id||i;let o=r?ht:os([this.parentRoute.id===ht?"":this.parentRoute.id,c]);i===ht&&(i="/"),o!==ht&&(o=os(["/",o]));const a=o===ht?"/":os([this.parentRoute.fullPath,i]);this._path=i,this._id=o,this._fullPath=a,this._to=Tt(a)},this.addChildren=s=>this._addFileChildren(s),this._addFileChildren=s=>(Array.isArray(s)&&(this.children=s),typeof s=="object"&&s!==null&&(this.children=Object.values(s)),this),this._addFileTypes=()=>this,this.updateLoader=s=>(Object.assign(this.options,s),this),this.update=s=>(Object.assign(this.options,s),this),this.lazy=s=>(this.lazyFn=s,this),this.redirect=s=>Qo({from:this.fullPath,...s}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class oa extends ei{constructor(e){super(e)}}const rs=typeof window<"u"?O.useLayoutEffect:O.useEffect;function As(t){const e=O.useRef({value:t,prev:null}),s=e.current.value;return t!==s&&(e.current={value:t,prev:s}),e.current.prev}function aa(t,e,s={},n={}){O.useEffect(()=>{if(!t.current||n.disabled||typeof IntersectionObserver!="function")return;const r=new IntersectionObserver(([i])=>{e(i)},s);return r.observe(t.current),()=>{r.disconnect()}},[e,s,n.disabled,t])}function ca(t){const e=O.useRef(null);return O.useImperativeHandle(t,()=>e.current,[]),e}function gn(t){const e=t.errorComponent??vn;return M.jsx(ua,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:({error:s,reset:n})=>s?O.createElement(e,{error:s,reset:n}):t.children})}class ua extends O.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,s){s.error&&s.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,s){this.props.onCatch&&this.props.onCatch(e,s)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function vn({error:t}){const[e,s]=O.useState(!1);return M.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[M.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[M.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),M.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>s(n=>!n),children:e?"Hide Error":"Show Error"})]}),M.jsx("div",{style:{height:".25rem"}}),e?M.jsx("div",{children:M.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?M.jsx("code",{children:t.message}):null})}):null]})}function la({children:t,fallback:e=null}){return si()?M.jsx(Te.Fragment,{children:t}):M.jsx(Te.Fragment,{children:e})}function si(){return Te.useSyncExternalStore(ha,()=>!0,()=>!1)}function ha(){return()=>{}}var Ds={exports:{}},js={},Ns={exports:{}},Us={};/**
26
+ * @license React
27
+ * use-sync-external-store-shim.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var ar;function fa(){if(ar)return Us;ar=1;var t=Ss();function e(f,d){return f===d&&(f!==0||1/f===1/d)||f!==f&&d!==d}var s=typeof Object.is=="function"?Object.is:e,n=t.useState,r=t.useEffect,i=t.useLayoutEffect,c=t.useDebugValue;function o(f,d){var m=d(),y=n({inst:{value:m,getSnapshot:d}}),g=y[0].inst,v=y[1];return i(function(){g.value=m,g.getSnapshot=d,a(g)&&v({inst:g})},[f,m,d]),r(function(){return a(g)&&v({inst:g}),f(function(){a(g)&&v({inst:g})})},[f]),c(m),m}function a(f){var d=f.getSnapshot;f=f.value;try{var m=d();return!s(f,m)}catch{return!0}}function u(f,d){return d()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:o;return Us.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:h,Us}var cr;function da(){return cr||(cr=1,Ns.exports=fa()),Ns.exports}/**
34
+ * @license React
35
+ * use-sync-external-store-shim/with-selector.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var ur;function pa(){if(ur)return js;ur=1;var t=Ss(),e=da();function s(u,h){return u===h&&(u!==0||1/u===1/h)||u!==u&&h!==h}var n=typeof Object.is=="function"?Object.is:s,r=e.useSyncExternalStore,i=t.useRef,c=t.useEffect,o=t.useMemo,a=t.useDebugValue;return js.useSyncExternalStoreWithSelector=function(u,h,f,d,m){var y=i(null);if(y.current===null){var g={hasValue:!1,value:null};y.current=g}else g=y.current;y=o(function(){function R(I){if(!b){if(b=!0,w=I,I=d(I),m!==void 0&&g.hasValue){var x=g.value;if(m(x,I))return _=x}return _=I}if(x=_,n(w,I))return x;var S=d(I);return m!==void 0&&m(x,S)?(w=I,x):(w=I,_=S)}var b=!1,w,_,k=f===void 0?null:f;return[function(){return R(h())},k===null?void 0:function(){return R(k())}]},[h,f,d,m]);var v=r(u,y[0],y[1]);return c(function(){g.hasValue=!0,g.value=v},[v]),a(v),v},js}var lr;function ma(){return lr||(lr=1,Ds.exports=pa()),Ds.exports}var ni=ma();const za=an(ni);function ya(t,e=n=>n,s={}){const n=s.equal??ga;return ni.useSyncExternalStoreWithSelector(t.subscribe,()=>t.state,()=>t.state,e,n)}function ga(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[n,r]of t)if(!e.has(n)||!Object.is(r,e.get(n)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();const s=hr(t);if(s.length!==hr(e).length)return!1;for(let n=0;n<s.length;n++)if(!Object.prototype.hasOwnProperty.call(e,s[n])||!Object.is(t[s[n]],e[s[n]]))return!1;return!0}function hr(t){return Object.keys(t).concat(Object.getOwnPropertySymbols(t))}const Bs=O.createContext(null);function ri(){return typeof document>"u"?Bs:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Bs,Bs)}function pt(t){const e=O.useContext(ri());return t?.warn,e}function dt(t){const e=pt({warn:t?.router===void 0}),s=t?.router||e,n=O.useRef(void 0);return ya(s.__store,r=>{if(t?.select){if(t.structuralSharing??s.options.defaultStructuralSharing){const i=it(n.current,t.select(r));return n.current=i,i}return t.select(r)}return r})}const _s=O.createContext(void 0),va=O.createContext(void 0);function wt(t){const e=O.useContext(t.from?va:_s);return dt({select:n=>{const r=n.matches.find(i=>t.from?t.from===i.routeId:i.id===e);if(Mt(!((t.shouldThrow??!0)&&!r),`Could not find ${t.from?`an active match from "${t.from}"`:"a nearest match!"}`),r!==void 0)return t.select?t.select(r):r},structuralSharing:t.structuralSharing})}function Sn(t){return wt({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.loaderData):e.loaderData})}function Rn(t){const{select:e,...s}=t;return wt({...s,select:n=>e?e(n.loaderDeps):n.loaderDeps})}function Pn(t){return wt({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:e=>{const s=t.strict===!1?e.params:e._strictParams;return t.select?t.select(s):s}})}function _n(t){return wt({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.search):e.search})}function wn(t){const e=pt();return O.useCallback(s=>e.navigate({...s,from:s.from??t?.from}),[t?.from,e])}var ii=Ri();const Ga=an(ii);function Sa(t,e){const s=pt(),n=ca(e),{activeProps:r,inactiveProps:i,activeOptions:c,to:o,preload:a,preloadDelay:u,hashScrollIntoView:h,replace:f,startTransition:d,resetScroll:m,viewTransition:y,children:g,target:v,disabled:R,style:b,className:w,onClick:_,onFocus:k,onMouseEnter:I,onMouseLeave:x,onTouchStart:S,ignoreBlocker:E,params:j,search:A,hash:B,state:H,mask:N,reloadDocument:vt,unsafeRelative:X,from:St,_fromLocation:bn,...Ie}=t,Xe=si(),p=dt({select:V=>V.location.search,structuralSharing:!0}),P=t.from,F=O.useMemo(()=>({...t,from:P}),[s,p,P,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),L=O.useMemo(()=>s.buildLocation({...F}),[s,F]),q=L.maskedLocation?L.maskedLocation.publicHref:L.publicHref,Q=L.maskedLocation?L.maskedLocation.external:L.external,K=O.useMemo(()=>xa(q,Q,s.history,R),[R,Q,q,s.history]),et=O.useMemo(()=>{if(K?.external)return ps(K.href)?void 0:K.href;if(!Ca(o)&&!(typeof o!="string"||o.indexOf(":")===-1))try{return new URL(o),ps(o)?void 0:o}catch{}},[o,K]),Y=dt({select:V=>{if(et)return!1;if(c?.exact){if(!Eo(V.location.pathname,L.pathname,s.basepath))return!1}else{const rt=ys(V.location.pathname,s.basepath),mt=ys(L.pathname,s.basepath);if(!(rt.startsWith(mt)&&(rt.length===mt.length||rt[mt.length]==="/")))return!1}return(c?.includeSearch??!0)&&!oe(V.location.search,L.search,{partial:!c?.exact,ignoreUndefined:!c?.explicitUndefined})?!1:c?.includeHash?Xe&&V.location.hash===L.hash:!0}}),fe=Y?qt(r,{})??Ra:Hs,Ze=Y?Hs:qt(i,{})??Hs,xn=[w,fe.className,Ze.className].filter(Boolean).join(" "),Cn=(b||fe.style||Ze.style)&&{...b,...fe.style,...Ze.style},[ui,En]=O.useState(!1),On=O.useRef(!1),de=t.reloadDocument||et?!1:a??s.options.defaultPreload,ws=u??s.options.defaultPreloadDelay??0,Vt=O.useCallback(()=>{s.preloadRoute({...F}).catch(V=>{console.warn(V),console.warn(ia)})},[s,F]),li=O.useCallback(V=>{V?.isIntersecting&&Vt()},[Vt]);aa(n,li,ba,{disabled:!!R||de!=="viewport"}),O.useEffect(()=>{On.current||!R&&de==="render"&&(Vt(),On.current=!0)},[R,Vt,de]);const hi=V=>{const rt=V.currentTarget.getAttribute("target"),mt=v!==void 0?v:rt;if(!R&&!Ea(V)&&!V.defaultPrevented&&(!mt||mt==="_self")&&V.button===0){V.preventDefault(),ii.flushSync(()=>{En(!0)});const Ln=s.subscribe("onResolved",()=>{Ln(),En(!1)});s.navigate({...F,replace:f,resetScroll:m,hashScrollIntoView:h,startTransition:d,viewTransition:y,ignoreBlocker:E})}};if(et)return{...Ie,ref:n,href:et,...g&&{children:g},...v&&{target:v},...R&&{disabled:R},...b&&{style:b},...w&&{className:w},..._&&{onClick:_},...k&&{onFocus:k},...I&&{onMouseEnter:I},...x&&{onMouseLeave:x},...S&&{onTouchStart:S}};const Tn=V=>{R||de&&Vt()},fi=Tn,di=V=>{if(!(R||!de))if(!ws)Vt();else{const rt=V.target;if(Ne.has(rt))return;const mt=setTimeout(()=>{Ne.delete(rt),Vt()},ws);Ne.set(rt,mt)}},pi=V=>{if(R||!de||!ws)return;const rt=V.target,mt=Ne.get(rt);mt&&(clearTimeout(mt),Ne.delete(rt))};return{...Ie,...fe,...Ze,href:K?.href,ref:n,onClick:Ue([_,hi]),onFocus:Ue([k,Tn]),onMouseEnter:Ue([I,di]),onMouseLeave:Ue([x,pi]),onTouchStart:Ue([S,fi]),disabled:!!R,target:v,...Cn&&{style:Cn},...xn&&{className:xn},...R&&Pa,...Y&&_a,...Xe&&ui&&wa}}const Hs={},Ra={className:"active"},Pa={role:"link","aria-disabled":!0},_a={"data-status":"active","aria-current":"page"},wa={"data-transitioning":"transitioning"},Ne=new WeakMap,ba={rootMargin:"100px"},Ue=t=>e=>{for(const s of t)if(s){if(e.defaultPrevented)return;s(e)}};function xa(t,e,s,n){if(!n)return e?{href:t,external:!0}:{href:s.createHref(t)||"/",external:!1}}function Ca(t){if(typeof t!="string")return!1;const e=t.charCodeAt(0);return e===47?t.charCodeAt(1)!==47:e===46}const oi=O.forwardRef((t,e)=>{const{_asChild:s,...n}=t,{type:r,...i}=Sa(n,e),c=typeof n.children=="function"?n.children({isActive:i["data-status"]==="active"}):n.children;if(!s){const{disabled:o,...a}=i;return O.createElement("a",a,c)}return O.createElement(s,i,c)});function Ea(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}class Oa extends ei{constructor(e){super(e),this.useMatch=s=>wt({select:s?.select,from:this.id,structuralSharing:s?.structuralSharing}),this.useRouteContext=s=>wt({...s,from:this.id,select:n=>s?.select?s.select(n.context):n.context}),this.useSearch=s=>_n({select:s?.select,structuralSharing:s?.structuralSharing,from:this.id}),this.useParams=s=>Pn({select:s?.select,structuralSharing:s?.structuralSharing,from:this.id}),this.useLoaderDeps=s=>Rn({...s,from:this.id}),this.useLoaderData=s=>Sn({...s,from:this.id}),this.useNavigate=()=>wn({from:this.fullPath}),this.Link=Te.forwardRef((s,n)=>M.jsx(oi,{ref:n,from:this.fullPath,...s})),this.$$typeof=Symbol.for("react.memo")}}function Ta(t){return new Oa(t)}class La extends oa{constructor(e){super(e),this.useMatch=s=>wt({select:s?.select,from:this.id,structuralSharing:s?.structuralSharing}),this.useRouteContext=s=>wt({...s,from:this.id,select:n=>s?.select?s.select(n.context):n.context}),this.useSearch=s=>_n({select:s?.select,structuralSharing:s?.structuralSharing,from:this.id}),this.useParams=s=>Pn({select:s?.select,structuralSharing:s?.structuralSharing,from:this.id}),this.useLoaderDeps=s=>Rn({...s,from:this.id}),this.useLoaderData=s=>Sn({...s,from:this.id}),this.useNavigate=()=>wn({from:this.fullPath}),this.Link=Te.forwardRef((s,n)=>M.jsx(oi,{ref:n,from:this.fullPath,...s})),this.$$typeof=Symbol.for("react.memo")}}function Ya(t){return new La(t)}function fr(t){return typeof t=="object"?new dr(t,{silent:!0}).createRoute(t):new dr(t,{silent:!0}).createRoute}class dr{constructor(e,s){this.path=e,this.createRoute=n=>{this.silent;const r=Ta(n);return r.isRoot=!1,r},this.silent=s?.silent}}class pr{constructor(e){this.useMatch=s=>wt({select:s?.select,from:this.options.id,structuralSharing:s?.structuralSharing}),this.useRouteContext=s=>wt({from:this.options.id,select:n=>s?.select?s.select(n.context):n.context}),this.useSearch=s=>_n({select:s?.select,structuralSharing:s?.structuralSharing,from:this.options.id}),this.useParams=s=>Pn({select:s?.select,structuralSharing:s?.structuralSharing,from:this.options.id}),this.useLoaderDeps=s=>Rn({...s,from:this.options.id}),this.useLoaderData=s=>Sn({...s,from:this.options.id}),this.useNavigate=()=>{const s=pt();return wn({from:s.routesById[this.options.id].fullPath})},this.options=e,this.$$typeof=Symbol.for("react.memo")}}function mr(t){return typeof t=="object"?new pr(t):e=>new pr({id:t,...e})}function Ma(){const t=pt(),e=O.useRef({router:t,mounted:!1}),[s,n]=O.useState(!1),{hasPendingMatches:r,isLoading:i}=dt({select:f=>({isLoading:f.isLoading,hasPendingMatches:f.matches.some(d=>d.status==="pending")}),structuralSharing:!0}),c=As(i),o=i||s||r,a=As(o),u=i||r,h=As(u);return t.startTransition=f=>{n(!0),O.startTransition(()=>{f(),n(!1)})},O.useEffect(()=>{const f=t.history.subscribe(t.load),d=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Tt(t.latestLocation.publicHref)!==Tt(d.publicHref)&&t.commitLocation({...d,replace:!0}),()=>{f()}},[t,t.history]),rs(()=>{if(typeof window<"u"&&t.ssr||e.current.router===t&&e.current.mounted)return;e.current={router:t,mounted:!0},(async()=>{try{await t.load()}catch(d){console.error(d)}})()},[t]),rs(()=>{c&&!i&&t.emit({type:"onLoad",...ae(t.state)})},[c,t,i]),rs(()=>{h&&!u&&t.emit({type:"onBeforeRouteMount",...ae(t.state)})},[u,h,t]),rs(()=>{if(a&&!o){const f=ae(t.state);t.emit({type:"onResolved",...f}),t.__store.setState(d=>({...d,status:"idle",resolvedLocation:d.location})),f.hrefChanged&&jo(t)}},[o,a,t]),null}function ka(t){const e=dt({select:s=>`not-found-${s.location.pathname}-${s.status}`});return M.jsx(gn,{getResetKey:()=>e,onCatch:(s,n)=>{if(ct(s))t.onCatch?.(s,n);else throw s},errorComponent:({error:s})=>{if(ct(s))return t.fallback?.(s);throw s},children:t.children})}function Ia(){return M.jsx("p",{children:"Not Found"})}function pe(t){return M.jsx(M.Fragment,{children:t.children})}function ai(t,e,s){return e.options.notFoundComponent?M.jsx(e.options.notFoundComponent,{...s}):t.options.defaultNotFoundComponent?M.jsx(t.options.defaultNotFoundComponent,{...s}):M.jsx(Ia,{})}function Fa(){return pt().isScrollRestoring,null}const ci=O.memo(function({matchId:e}){const s=pt(),n=dt({select:g=>{const v=g.matches.findIndex(b=>b.id===e),R=g.matches[v];return Mt(R),{routeId:R.routeId,ssr:R.ssr,_displayPending:R._displayPending,resetKey:g.loadedAt,parentRouteId:g.matches[v-1]?.routeId}},structuralSharing:!0}),r=s.routesById[n.routeId],i=r.options.pendingComponent??s.options.defaultPendingComponent,c=i?M.jsx(i,{}):null,o=r.options.errorComponent??s.options.defaultErrorComponent,a=r.options.onCatch??s.options.defaultOnCatch,u=r.isRoot?r.options.notFoundComponent??s.options.notFoundRoute?.options.component:r.options.notFoundComponent,h=n.ssr===!1||n.ssr==="data-only",f=(!r.isRoot||r.options.wrapInSuspense||h)&&(r.options.wrapInSuspense??i??(r.options.errorComponent?.preload||h))?O.Suspense:pe,d=o?gn:pe,m=u?ka:pe,y=r.isRoot?r.options.shellComponent??pe:pe;return M.jsxs(y,{children:[M.jsx(_s.Provider,{value:e,children:M.jsx(f,{fallback:c,children:M.jsx(d,{getResetKey:()=>n.resetKey,errorComponent:o||vn,onCatch:(g,v)=>{if(ct(g))throw g;a?.(g,v)},children:M.jsx(m,{fallback:g=>{if(!u||g.routeId&&g.routeId!==n.routeId||!g.routeId&&!r.isRoot)throw g;return O.createElement(u,g)},children:h||n._displayPending?M.jsx(la,{fallback:c,children:M.jsx(yr,{matchId:e})}):M.jsx(yr,{matchId:e})})})})}),n.parentRouteId===ht&&s.options.scrollRestoration?M.jsxs(M.Fragment,{children:[M.jsx(Aa,{}),M.jsx(Fa,{})]}):null]})});function Aa(){const t=pt(),e=O.useRef(void 0);return M.jsx("script",{suppressHydrationWarning:!0,ref:s=>{s&&(e.current===void 0||e.current.href!==t.latestLocation.href)&&(t.emit({type:"onRendered",...ae(t.state)}),e.current=t.latestLocation)}},t.latestLocation.state.__TSR_key)}const yr=O.memo(function({matchId:e}){const s=pt(),{match:n,key:r,routeId:i}=dt({select:a=>{const u=a.matches.find(y=>y.id===e),h=u.routeId,d=(s.routesById[h].options.remountDeps??s.options.defaultRemountDeps)?.({routeId:h,loaderDeps:u.loaderDeps,params:u._strictParams,search:u._strictSearch});return{key:d?JSON.stringify(d):void 0,routeId:h,match:{id:u.id,status:u.status,error:u.error,invalid:u.invalid,_forcePending:u._forcePending,_displayPending:u._displayPending}}},structuralSharing:!0}),c=s.routesById[i],o=O.useMemo(()=>{const a=c.options.component??s.options.defaultComponent;return a?M.jsx(a,{},r):M.jsx(Da,{})},[r,c.options.component,s.options.defaultComponent]);if(n._displayPending)throw s.getMatch(n.id)?._nonReactive.displayPendingPromise;if(n._forcePending)throw s.getMatch(n.id)?._nonReactive.minPendingPromise;if(n.status==="pending"){const a=c.options.pendingMinMs??s.options.defaultPendingMinMs;if(a){const u=s.getMatch(n.id);if(u&&!u._nonReactive.minPendingPromise){const h=Le();u._nonReactive.minPendingPromise=h,setTimeout(()=>{h.resolve(),u._nonReactive.minPendingPromise=void 0},a)}}throw s.getMatch(n.id)?._nonReactive.loadPromise}if(n.status==="notFound")return Mt(ct(n.error)),ai(s,c,n.error);if(n.status==="redirected")throw Mt(ft(n.error)),s.getMatch(n.id)?._nonReactive.loadPromise;if(n.status==="error")throw n.error;return o}),Da=O.memo(function(){const e=pt(),s=O.useContext(_s),n=dt({select:u=>u.matches.find(h=>h.id===s)?.routeId}),r=e.routesById[n],i=dt({select:u=>{const f=u.matches.find(d=>d.id===s);return Mt(f),f.globalNotFound}}),c=dt({select:u=>{const h=u.matches,f=h.findIndex(d=>d.id===s);return h[f+1]?.id}}),o=e.options.defaultPendingComponent?M.jsx(e.options.defaultPendingComponent,{}):null;if(i)return ai(e,r,void 0);if(!c)return null;const a=M.jsx(ci,{matchId:c});return n===ht?M.jsx(O.Suspense,{fallback:o,children:a}):a});function ja(){const t=pt(),s=t.routesById[ht].options.pendingComponent??t.options.defaultPendingComponent,n=s?M.jsx(s,{}):null,r=typeof document<"u"&&t.ssr?pe:O.Suspense,i=M.jsxs(r,{fallback:n,children:[M.jsx(Ma,{}),M.jsx(Na,{})]});return t.options.InnerWrap?M.jsx(t.options.InnerWrap,{children:i}):i}function Na(){const t=pt(),e=dt({select:r=>r.matches[0]?.id}),s=dt({select:r=>r.loadedAt}),n=e?M.jsx(ci,{matchId:e}):null;return M.jsx(_s.Provider,{value:e,children:t.options.disableGlobalCatchBoundary?n:M.jsx(gn,{getResetKey:()=>s,errorComponent:vn,onCatch:r=>{r.message||r.toString()},children:n})})}const Ja=t=>new Ua(t);class Ua extends Xo{constructor(e){super(e)}}typeof globalThis<"u"?(globalThis.createFileRoute=fr,globalThis.createLazyFileRoute=mr):typeof window<"u"&&(window.createFileRoute=fr,window.createLazyFileRoute=mr);function Ba({router:t,children:e,...s}){Object.keys(s).length>0&&t.update({...t.options,...s,context:{...t.options.context,...s.context}});const n=ri(),r=M.jsx(n.Provider,{value:t,children:e});return t.options.Wrap?M.jsx(t.options.Wrap,{children:r}):r}function Xa({router:t,...e}){return M.jsx(Ba,{router:t,...e,children:M.jsx(ja,{})})}export{oi as L,Da as O,Qa as Q,Te as R,Ga as a,qa as b,ii as c,da as d,$a as e,Ss as f,an as g,Ri as h,Mt as i,M as j,Wa as k,Nr as l,Va as m,dt as n,wn as o,pt as p,_n as q,O as r,Ya as s,Ta as t,za as u,Ja as v,ni as w,Qo as x,Ka as y,Xa as z};