libre-webui 0.31.0 → 0.33.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 (244) hide show
  1. package/backend/dist/index.d.ts.map +1 -1
  2. package/backend/dist/index.js +6 -1
  3. package/backend/dist/index.js.map +1 -1
  4. package/backend/dist/middleware/staticAssets.d.ts +29 -0
  5. package/backend/dist/middleware/staticAssets.d.ts.map +1 -0
  6. package/backend/dist/middleware/staticAssets.js +141 -0
  7. package/backend/dist/middleware/staticAssets.js.map +1 -0
  8. package/backend/dist/routes/artifacts.d.ts.map +1 -1
  9. package/backend/dist/routes/artifacts.js +4 -2
  10. package/backend/dist/routes/artifacts.js.map +1 -1
  11. package/backend/dist/routes/plugins.d.ts.map +1 -1
  12. package/backend/dist/routes/plugins.js +13 -2
  13. package/backend/dist/routes/plugins.js.map +1 -1
  14. package/backend/dist/routes/preferences.d.ts.map +1 -1
  15. package/backend/dist/routes/preferences.js +40 -1
  16. package/backend/dist/routes/preferences.js.map +1 -1
  17. package/backend/dist/services/appearanceSettingsService.d.ts +20 -0
  18. package/backend/dist/services/appearanceSettingsService.d.ts.map +1 -0
  19. package/backend/dist/services/appearanceSettingsService.js +91 -0
  20. package/backend/dist/services/appearanceSettingsService.js.map +1 -0
  21. package/backend/dist/services/authService.d.ts +3 -0
  22. package/backend/dist/services/authService.d.ts.map +1 -1
  23. package/backend/dist/services/authService.js +2 -0
  24. package/backend/dist/services/authService.js.map +1 -1
  25. package/backend/dist/services/ollamaSettingsService.d.ts.map +1 -1
  26. package/backend/dist/services/ollamaSettingsService.js +7 -2
  27. package/backend/dist/services/ollamaSettingsService.js.map +1 -1
  28. package/backend/dist/services/preferencesService.d.ts +5 -0
  29. package/backend/dist/services/preferencesService.d.ts.map +1 -1
  30. package/backend/dist/services/preferencesService.js +15 -2
  31. package/backend/dist/services/preferencesService.js.map +1 -1
  32. package/backend/dist/services/workPreviewProxyService.d.ts.map +1 -1
  33. package/backend/dist/services/workPreviewProxyService.js +4 -2
  34. package/backend/dist/services/workPreviewProxyService.js.map +1 -1
  35. package/backend/dist/types/index.d.ts +1 -1
  36. package/backend/dist/types/index.d.ts.map +1 -1
  37. package/backend/package.json +1 -1
  38. package/frontend/dist/artifact-runtime/.build-fingerprint +1 -1
  39. package/frontend/dist/assets/index-DegYzMyw.js +70 -0
  40. package/frontend/dist/assets/index-gKj8Y1JB.css +1 -0
  41. package/frontend/dist/assets/xterm-B8QFf3JU.css +1 -0
  42. package/frontend/dist/index.html +62 -40
  43. package/frontend/dist/js/ArtifactContainer-BB6A8cT5.js +1 -0
  44. package/frontend/dist/js/{ArtifactDemoPage-BLF8Ok-o.js → ArtifactDemoPage-Bf1dW5Z3.js} +1 -1
  45. package/frontend/dist/js/{ArtifactSandboxFrame-Cs1Gu1WB.js → ArtifactSandboxFrame-DsZW0Axy.js} +1 -1
  46. package/frontend/dist/js/ArtifactSlideOutPanel-Cartcixp.js +1 -0
  47. package/frontend/dist/js/AutomationModal-BI_3nFeg.js +1 -0
  48. package/frontend/dist/js/AutomationsPage-ChMXj4UG.js +1 -0
  49. package/frontend/dist/js/AvatarUpload-gfZ9QWR3.js +1 -0
  50. package/frontend/dist/js/Button-BQ5JnUVj.js +1 -0
  51. package/frontend/dist/js/CalendarPage-Ce1ud5St.js +1 -0
  52. package/frontend/dist/js/ChannelsPage-kl8zJ2HA.js +1 -0
  53. package/frontend/dist/js/ChatPage-Bj98c6rc.js +14 -0
  54. package/frontend/dist/js/ConnectModels-CPftHmE3.js +1 -0
  55. package/frontend/dist/js/{EvaluationsPage-DOJLpauA.js → EvaluationsPage-Cydglp6R.js} +2 -2
  56. package/frontend/dist/js/FirstTimeSetup-C5cc-bc9.js +1 -0
  57. package/frontend/dist/js/GalleryPage-Dvq2GVoH.js +1 -0
  58. package/frontend/dist/js/HomePage-zVjADRoX.js +1 -0
  59. package/frontend/dist/js/LibreClawPage-x0Qmtcnc.js +1 -0
  60. package/frontend/dist/js/Logo-BlcOFpac.js +1 -0
  61. package/frontend/dist/js/LogoMark-CNeQ6eO9.js +1 -0
  62. package/frontend/dist/js/ModelManagerModals-K1oiXMTv.js +1 -0
  63. package/frontend/dist/js/NotesPage-BnqBv-n1.js +3 -0
  64. package/frontend/dist/js/OptimizedSyntaxHighlighter-CtQ_FGCX.js +2 -0
  65. package/frontend/dist/js/OptimizedSyntaxHighlighter-SkJc7ZMe.js +1 -0
  66. package/frontend/dist/js/PasswordStrengthMeter-DVFLKG_-.js +1 -0
  67. package/frontend/dist/js/{PersonasPage-C3D_6lIx.js → PersonasPage-DK9-SDZQ.js} +2 -2
  68. package/frontend/dist/js/PluginUsagePage-DX9uxdRr.js +1 -0
  69. package/frontend/dist/js/RichMessageContent-BzfhfzQ4.js +1 -0
  70. package/frontend/dist/js/RichMessageContent-XMkRvBen.js +3 -0
  71. package/frontend/dist/js/SettingsModal-CMOwEhkG.js +19 -0
  72. package/frontend/dist/js/SettingsToggle-B7UynBmZ.js +1 -0
  73. package/frontend/dist/js/ShareDialog-CZpU1itx.js +1 -0
  74. package/frontend/dist/js/SystemPage-BVaaKTRs.js +1 -0
  75. package/frontend/dist/js/TurnstileWidget-CEJst9eS.js +1 -0
  76. package/frontend/dist/js/UserManagementPage-DdpcN4-Q.js +1 -0
  77. package/frontend/dist/js/UserManagementPanel-BxAvybHj.js +1 -0
  78. package/frontend/dist/js/WhatsNewModal-CoFCdUpf.js +1 -0
  79. package/frontend/dist/js/WorkPage-Du6llCSU.js +7 -0
  80. package/frontend/dist/js/api-CatP45JH.js +1 -0
  81. package/frontend/dist/js/api-DQdJeQjd.js +14 -0
  82. package/frontend/dist/js/{appNavigation-DfHbXBey.js → appNavigation-DRM2Jr4r.js} +1 -1
  83. package/frontend/dist/js/appStore-BXbVcTeo.js +2 -0
  84. package/frontend/dist/js/appVersion-BUroqcki.js +1 -0
  85. package/frontend/dist/js/ar-C8Izi_rT.js +2 -0
  86. package/frontend/dist/js/authStore-DkqtNSYP.js +4 -0
  87. package/frontend/dist/js/authStore-bqAN5v4N.js +1 -0
  88. package/frontend/dist/js/axios-CYkJpKn8.js +1 -0
  89. package/frontend/dist/js/babel-CY5KOv-I.js +16 -0
  90. package/frontend/dist/js/bn-BJJgi-6Q.js +2 -0
  91. package/frontend/dist/js/chatStore-8jYk48hC.js +3 -0
  92. package/frontend/dist/js/{config-DJwXAf8i.js → config-D4dduT3C.js} +1 -1
  93. package/frontend/dist/js/cs-DheVrMUl.js +2 -0
  94. package/frontend/dist/js/da-BLszIs3a.js +2 -0
  95. package/frontend/dist/js/de-BvWdcr7T.js +2 -0
  96. package/frontend/dist/js/es-CQ8Yauda.js +2 -0
  97. package/frontend/dist/js/estree-CuT_pB8K.js +44 -0
  98. package/frontend/dist/js/{evaluationsApi-BKY-maUM.js → evaluationsApi-CBKjxZUn.js} +1 -1
  99. package/frontend/dist/js/fr-BD5h-w8z.js +2 -0
  100. package/frontend/dist/js/goober.modern-BaHbaW3_.js +1 -0
  101. package/frontend/dist/js/hi-IlRhC5IE.js +2 -0
  102. package/frontend/dist/js/html-Cdnr2qzU.js +25 -0
  103. package/frontend/dist/js/i18next-ChipS_AK.js +1 -0
  104. package/frontend/dist/js/id-DalGMQEJ.js +2 -0
  105. package/frontend/dist/js/is-DuQqmHeS.js +2 -0
  106. package/frontend/dist/js/it-DDaqAdB1.js +2 -0
  107. package/frontend/dist/js/ja-CYCu9F9Y.js +2 -0
  108. package/frontend/dist/js/ko-P3JZPOXE.js +2 -0
  109. package/frontend/dist/js/logger-DnuT4jgB.js +1 -0
  110. package/frontend/dist/js/markdown-CByV-4CU.js +70 -0
  111. package/frontend/dist/js/markdown-core-D067gSd8.js +31 -0
  112. package/frontend/dist/js/markdown-html-CQM6wA9G.js +2 -0
  113. package/frontend/dist/js/markdown-math-Dg-WB9ui.js +261 -0
  114. package/frontend/dist/js/markdownHtml-Djpz4yB3.js +1 -0
  115. package/frontend/dist/js/markdownMath-CoDj1i7z.js +1 -0
  116. package/frontend/dist/js/{messageCodeStyles-CkxF6yil.js → messageCodeStyles-0_YpQDk4.js} +2 -2
  117. package/frontend/dist/js/ms-B3ZIqlUn.js +2 -0
  118. package/frontend/dist/js/nl-1Qpsmmz1.js +2 -0
  119. package/frontend/dist/js/pl-ErrMri3_.js +2 -0
  120. package/frontend/dist/js/postcss-CifRAFe1.js +62 -0
  121. package/frontend/dist/js/pt-0T0R9AtX.js +2 -0
  122. package/frontend/dist/js/react-vendor-D0Ec-185.js +9 -0
  123. package/frontend/dist/js/rfb-NV_fh9Db.js +5 -0
  124. package/frontend/dist/js/router-vendor-CMbYTGdh.js +1 -0
  125. package/frontend/dist/js/ru-B34INyPg.js +2 -0
  126. package/frontend/dist/js/standalone-6z5x8CWe.js +29 -0
  127. package/frontend/dist/js/sv-BSqDwAur.js +2 -0
  128. package/frontend/dist/js/syntax-highlight-DTWfgxYh.js +7 -0
  129. package/frontend/dist/js/{teamEventStream-DUodK0-C.js → teamEventStream-RoMYo102.js} +1 -1
  130. package/frontend/dist/js/th-DK9M4-Iy.js +2 -0
  131. package/frontend/dist/js/tr-DUrkEwr1.js +2 -0
  132. package/frontend/dist/js/ttsBatching-kFVEE3Ip.js +2 -0
  133. package/frontend/dist/js/typescript-BPrdIZ70.js +22 -0
  134. package/frontend/dist/js/ui-UU79S5lB.js +2 -0
  135. package/frontend/dist/js/ui-vendor-6y6qiSk5.js +177 -0
  136. package/frontend/dist/js/uk-B5DYTi0e.js +2 -0
  137. package/frontend/dist/js/useChat-ImXXcy0q.js +10 -0
  138. package/frontend/dist/js/useDictation-eMIAncoT.js +1 -0
  139. package/frontend/dist/js/useQuery-BKulzCS7.js +1 -0
  140. package/frontend/dist/js/useTranslation-D0mJ4NnO.js +1 -0
  141. package/frontend/dist/js/{utils-nNyg0lfc.js → utils-Bn0RE9_8.js} +1 -1
  142. package/frontend/dist/js/utils-vendor-BbPbaAuC.js +9 -0
  143. package/frontend/dist/js/vi-CrtPQUIM.js +2 -0
  144. package/frontend/dist/js/workApi-BM8qVq_w.js +1 -0
  145. package/frontend/dist/js/workApi-xhF57amo.js +6 -0
  146. package/frontend/dist/js/xterm-C3BHN0de.js +16 -0
  147. package/frontend/dist/js/yaml-9ltHPDNO.js +154 -0
  148. package/frontend/dist/js/zh-gbOKajYe.js +2 -0
  149. package/frontend/dist/sw.js +3 -3
  150. package/package.json +2 -2
  151. package/frontend/dist/assets/index-B6xMZpzA.js +0 -76
  152. package/frontend/dist/assets/index-BjipfsCP.css +0 -1
  153. package/frontend/dist/assets/xterm-DHcfr8qj.css +0 -1
  154. package/frontend/dist/js/ArtifactContainer-Bn6iJtaJ.js +0 -1
  155. package/frontend/dist/js/ArtifactSlideOutPanel-CuKq5cL0.js +0 -1
  156. package/frontend/dist/js/AutomationModal-Dha4KgLI.js +0 -1
  157. package/frontend/dist/js/AutomationsPage-HcMCRV-D.js +0 -1
  158. package/frontend/dist/js/AvatarUpload-CFrlSszY.js +0 -1
  159. package/frontend/dist/js/Button-CgN11mgY.js +0 -1
  160. package/frontend/dist/js/CalendarPage-D_K-XrG9.js +0 -1
  161. package/frontend/dist/js/ChannelsPage-D3CoImOT.js +0 -1
  162. package/frontend/dist/js/ChatPage-C0iBDbOq.js +0 -14
  163. package/frontend/dist/js/ConnectModels-D_ZbZQub.js +0 -1
  164. package/frontend/dist/js/FirstTimeSetup-DDIP_4Dd.js +0 -1
  165. package/frontend/dist/js/GalleryPage-C8U_F7Ns.js +0 -1
  166. package/frontend/dist/js/HomePage-B_aotoDU.js +0 -1
  167. package/frontend/dist/js/LibreClawPage-cr2N6W00.js +0 -1
  168. package/frontend/dist/js/Logo-B7o7eaPU.js +0 -1
  169. package/frontend/dist/js/LogoMark-D9g6ls0h.js +0 -1
  170. package/frontend/dist/js/ModelManagerModals-C-J1d7GL.js +0 -1
  171. package/frontend/dist/js/NotesPage-Bgr7R_Vm.js +0 -3
  172. package/frontend/dist/js/OptimizedSyntaxHighlighter-BwKLuOu-.js +0 -1
  173. package/frontend/dist/js/OptimizedSyntaxHighlighter-oiyvxgDA.js +0 -1
  174. package/frontend/dist/js/PasswordStrengthMeter-DR-mGbLF.js +0 -1
  175. package/frontend/dist/js/PluginUsagePage-DK7MgSiu.js +0 -1
  176. package/frontend/dist/js/RichMessageContent-7FxrZ4A8.js +0 -1
  177. package/frontend/dist/js/RichMessageContent-CQkLI7Dt.js +0 -3
  178. package/frontend/dist/js/SettingsModal-CIV_Bgsf.js +0 -19
  179. package/frontend/dist/js/SettingsToggle-Cw4OhW7B.js +0 -1
  180. package/frontend/dist/js/ShareDialog-BCEVgtbN.js +0 -1
  181. package/frontend/dist/js/SystemPage-BNVZtLe9.js +0 -1
  182. package/frontend/dist/js/TurnstileWidget-lyEp7A0r.js +0 -1
  183. package/frontend/dist/js/UserManagementPage-pPC_Svj9.js +0 -1
  184. package/frontend/dist/js/WorkPage-Q33nIqkM.js +0 -7
  185. package/frontend/dist/js/api-D-5hpGht.js +0 -14
  186. package/frontend/dist/js/api-WR1CTYO5.js +0 -1
  187. package/frontend/dist/js/appStore-B136FGdu.js +0 -2
  188. package/frontend/dist/js/appVersion-Ck7dYiHe.js +0 -1
  189. package/frontend/dist/js/ar-Cq-nC6v9.js +0 -2
  190. package/frontend/dist/js/authStore-6AJLgQsD.js +0 -1
  191. package/frontend/dist/js/authStore-Ckz37pwu.js +0 -4
  192. package/frontend/dist/js/axios-CUerAKcc.js +0 -1
  193. package/frontend/dist/js/babel-8afoxhZ7.js +0 -16
  194. package/frontend/dist/js/bn-BFSKytYs.js +0 -2
  195. package/frontend/dist/js/chatStore-Dpm3g_Ln.js +0 -3
  196. package/frontend/dist/js/classPrivateMethodInitSpec-DE0XIqc_.js +0 -1
  197. package/frontend/dist/js/cs-BKWXa629.js +0 -2
  198. package/frontend/dist/js/da-Cra_DJnV.js +0 -2
  199. package/frontend/dist/js/de-BQa6_UuE.js +0 -2
  200. package/frontend/dist/js/es-BBOHFrx1.js +0 -2
  201. package/frontend/dist/js/estree-qxY7ACbu.js +0 -44
  202. package/frontend/dist/js/fr-C8kXs5c0.js +0 -2
  203. package/frontend/dist/js/hi-BEef4bjU.js +0 -2
  204. package/frontend/dist/js/html-B_cUU1Gi.js +0 -25
  205. package/frontend/dist/js/i18next-ChNMiFef.js +0 -1
  206. package/frontend/dist/js/id-Djipic7Y.js +0 -2
  207. package/frontend/dist/js/is-pazl6RLG.js +0 -2
  208. package/frontend/dist/js/it-DobPbTwl.js +0 -2
  209. package/frontend/dist/js/ja-DwYNaMNX.js +0 -2
  210. package/frontend/dist/js/ko-BQfXE7_o.js +0 -2
  211. package/frontend/dist/js/logger-CpCQz3Vi.js +0 -1
  212. package/frontend/dist/js/markdown-BAF0w-jL.js +0 -70
  213. package/frontend/dist/js/markdown-core-CsTEqgp1.js +0 -32
  214. package/frontend/dist/js/markdown-math-BhUmos36.js +0 -261
  215. package/frontend/dist/js/ms-CkPQoE5T.js +0 -2
  216. package/frontend/dist/js/nl-X_QsDAtu.js +0 -2
  217. package/frontend/dist/js/pl-CK39gUsy.js +0 -2
  218. package/frontend/dist/js/postcss-B2vYq4-H.js +0 -62
  219. package/frontend/dist/js/pt-C0dWyR_I.js +0 -2
  220. package/frontend/dist/js/react-vendor-BsJBHRYW.js +0 -9
  221. package/frontend/dist/js/rfb-BOfFBtVG.js +0 -5
  222. package/frontend/dist/js/router-vendor-CIwPu612.js +0 -1
  223. package/frontend/dist/js/ru-sNJkEz1G.js +0 -2
  224. package/frontend/dist/js/standalone-BqZmfuRy.js +0 -29
  225. package/frontend/dist/js/sv-Bh-uxdF3.js +0 -2
  226. package/frontend/dist/js/syntax-highlight-DY6Hwrri.js +0 -8
  227. package/frontend/dist/js/th-DPVtwZj2.js +0 -2
  228. package/frontend/dist/js/tr-BYNM_Tm7.js +0 -2
  229. package/frontend/dist/js/ttsBatching-7_-p2nxR.js +0 -2
  230. package/frontend/dist/js/typescript-DokwN-5Y.js +0 -22
  231. package/frontend/dist/js/ui-BK53RPmS.js +0 -2
  232. package/frontend/dist/js/ui-vendor-CPdYrKhz.js +0 -177
  233. package/frontend/dist/js/uk-kvNBuYin.js +0 -2
  234. package/frontend/dist/js/useChat-Czg2p4Rr.js +0 -10
  235. package/frontend/dist/js/useDictation-B2lYEYKn.js +0 -1
  236. package/frontend/dist/js/useQuery-ClAiNxQ7.js +0 -1
  237. package/frontend/dist/js/useTranslation-C7GwbUQA.js +0 -1
  238. package/frontend/dist/js/utils-vendor-CeUf_ngc.js +0 -9
  239. package/frontend/dist/js/vi-CmLoaP0K.js +0 -2
  240. package/frontend/dist/js/workApi-BoJb9aVF.js +0 -1
  241. package/frontend/dist/js/workApi-CFH097y5.js +0 -6
  242. package/frontend/dist/js/xterm-CdjKCQM7.js +0 -16
  243. package/frontend/dist/js/yaml-BXEpxPn2.js +0 -154
  244. package/frontend/dist/js/zh-D2zvmvrj.js +0 -2
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./react-vendor-D0Ec-185.js";import{o as n}from"./logger-DnuT4jgB.js";var r=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,i=/^[\\/]{2}/;function a(e,t){return t+e.replace(/\\/g,`/`)}var o=`popstate`;function s(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function c(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return m(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:h(t)}return _(t,n,null,e)}function l(e={}){function t(e,t){let{pathname:n=`/`,search:r=``,hash:i=``}=g(e.location.hash.substring(1));return!n.startsWith(`/`)&&!n.startsWith(`.`)&&(n=`/`+n),m(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){let n=e.document.querySelector(`base`),r=``;if(n&&n.getAttribute(`href`)){let t=e.location.href,n=t.indexOf(`#`);r=n===-1?t:t.slice(0,n)}return r+`#`+(typeof t==`string`?t:h(t))}function r(e,t){d(e.pathname.charAt(0)===`/`,`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}return _(t,n,r,e)}function u(e,t){if(e===!1||e==null)throw Error(t)}function d(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function f(){return Math.random().toString(36).substring(2,10)}function p(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function m(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?g(t):t,state:n,key:t&&t.key||r||f(),mask:i}}function h({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function g(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function _(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,c=i.history,l=`POP`,u=null,d=f();d??(d=0,c.replaceState({...c.state,idx:d},``));function f(){return(c.state||{idx:null}).idx}function h(){l=`POP`;let e=f(),t=e==null?null:e-d;d=e,u&&u({action:l,location:b.location,delta:t})}function g(e,t){l=`PUSH`;let r=s(e)?e:m(b.location,e,t);n&&n(r,e),d=f()+1;let o=p(r,d),h=b.createHref(r.mask||r);try{c.pushState(o,``,h)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(h)}a&&u&&u({action:l,location:b.location,delta:1})}function _(e,t){l=`REPLACE`;let r=s(e)?e:m(b.location,e,t);n&&n(r,e),d=f();let i=p(r,d),o=b.createHref(r.mask||r);c.replaceState(i,``,o),a&&u&&u({action:l,location:b.location,delta:0})}function y(e){return v(i,e)}let b={get action(){return l},get location(){return e(i,c)},listen(e){if(u)throw Error(`A history only accepts one active listener`);return i.addEventListener(o,h),u=e,()=>{i.removeEventListener(o,h),u=null}},createHref(e){return t(i,e)},createURL:y,encodeLocation(e){let t=y(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:g,replace:_,go(e){return c.go(e)}};return b}function v(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),u(r,`No window.location.(origin|href) available to create URL`);let a=typeof t==`string`?t:h(t);return a=a.replace(/ $/,`%20`),!n&&i.test(a)&&(a=r+a),new URL(a,r)}var y=e(t(),1),b=class{#e=new Map;constructor(e){if(e)for(let[t,n]of e)this.set(t,n)}get(e){if(this.#e.has(e))return this.#e.get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){this.#e.set(e,t)}},x=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function S(e){return x.has(e)}var C=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function w(e){return C.has(e)}function T(e){return e.index===!0}function E(e){let t={};return e.Component&&Object.assign(t,{element:y.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:y.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:y.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function D(e,t=E,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(u(e.index!==!0||!e.children,`Cannot specify children on an index route`),u(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),T(e)){let n={...e,id:s};return r[s]=O(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=O(n,t(n)),e.children&&(n.children=D(e.children,t,o,r,i)),n}})}function O(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function k(e,t,n=`/`){return A(e,t,n,!1)}function A(e,t,n,r,i){let a=B((typeof t==`string`?g(t):t).pathname||`/`,n);if(a==null)return null;let o=i??j(e),s=null,c=z(a);for(let e=0;s==null&&e<o.length;++e)s=ue(o[e],c,r);return s}function ee(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,loaderData:t[n.id],handle:n.handle}}function j(e){let t=M(e);return P(t),t}function M(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;u(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=H([r,c.relativePath]),d=n.concat(c);e.children&&e.children.length>0&&(u(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),M(e.children,t,d,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:ce(l,e.index),routesMeta:d.map((e,t)=>{let[n,r]=R(e.relativePath,e.caseSensitive,t===d.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of N(e.path))a(e,t,!0,n)}),t}function N(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=N(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function P(e){e.sort((e,t)=>e.score===t.score?le(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var te=/^:[\w-]+$/,F=/^:[\w-]+/,ne=3.5,re=3,ie=2,ae=1,oe=10,se=-2,I=e=>e===`*`;function ce(e,t){let n=e.split(`/`),r=n.length;return n.some(I)&&(r+=se),t&&(r+=ie),n.filter(e=>!I(e)).reduce((e,t)=>e+(te.test(t)?re:F.test(t)?ne:t===``?ae:oe),r)}function le(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function ue(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?de(u,l,s.matcher,s.compiledParams):L(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=L({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:H([a,d.pathname]),pathnameBase:xe(H([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=H([a,d.pathnameBase]))}return o}function L(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=R(e.path,e.caseSensitive,e.end);return de(e,t,n,r)}function de(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function R(e,t=!1,n=!0){d(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(?=\/|$|\()/g,`(?:/$1)?`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function z(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return d(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function B(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function fe({basename:e,pathname:t}){return t===`/`?e:H([e,t])}var pe=e=>r.test(e);function me(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?g(e):e,a;return n?(n=ye(n),a=n.startsWith(`/`)?he(n.substring(1),`/`):he(n,t)):a=t,{pathname:a,search:Se(r),hash:Ce(i)}}function he(e,t){let n=be(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function ge(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function _e(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function ve(e){let t=_e(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function V(e,t,n,r=!1){let i;typeof e==`string`?i=g(e):(i={...e},u(!i.pathname||!i.pathname.includes(`?`),ge(`?`,`pathname`,`search`,i)),u(!i.pathname||!i.pathname.includes(`#`),ge(`#`,`pathname`,`hash`,i)),u(!i.search||!i.search.includes(`#`),ge(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=me(i,s),l=o&&o!==`/`&&o.endsWith(`/`),d=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||d)&&(c.pathname+=`/`),c}var ye=e=>e.replace(/[\\/]{2,}/g,`/`),H=e=>ye(e.join(`/`)),be=e=>e.replace(/\/+$/,``),xe=e=>be(e).replace(/^\/*/,`/`),Se=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ce=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,we=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Te=class{status;statusText;data;error;internal;constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Ee(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function De(e){return H(e.map(e=>e.route.path).filter(Boolean))||`/`}function Oe(e,t){let n=new URL(typeof e==`string`||e instanceof URL?e:e.url),r=typeof t==`string`?g(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);let i=e.toString();n.search=i?`?${i}`:``}else n.search=``;return n.hash=r.hash||``,n}var ke=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Ae(e,t){let n=e;if(typeof n!=`string`||!r.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let o=n,s=!1;if(ke)try{let e=new URL(window.location.href),r=i.test(n)?new URL(a(n,e.protocol)):new URL(n),o=B(r.pathname,t);r.origin===e.origin&&o!=null?n=o+r.search+r.hash:s=!0}catch{d(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:s,to:n}}var je=Symbol(`Uninstrumented`),Me=new WeakMap;function Ne(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){e.lazy!=null&&n.lazy.push(e.lazy),e[`lazy.loader`]!=null&&n[`lazy.loader`].push(e[`lazy.loader`]),e[`lazy.action`]!=null&&n[`lazy.action`].push(e[`lazy.action`]),e[`lazy.middleware`]!=null&&n[`lazy.middleware`].push(e[`lazy.middleware`]),e.middleware!=null&&n.middleware.push(e.middleware),e.loader!=null&&n.loader.push(e.loader),e.action!=null&&n.action.push(e.action)}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=t.lazy;r.lazy=async(...t)=>Le(await G(n.lazy,void 0,()=>e(...t),K))}if(typeof t.lazy==`object`){let e=t.lazy;if(typeof e.middleware==`function`&&n[`lazy.middleware`].length>0){let t=e.middleware;r.lazy=Object.assign(r.lazy||{},{middleware:async(...e)=>Le(await G(n[`lazy.middleware`],void 0,()=>t(...e),K))})}if(typeof e.loader==`function`&&n[`lazy.loader`].length>0){let t=e.loader;r.lazy=Object.assign(r.lazy||{},{loader:async(...e)=>Le(await G(n[`lazy.loader`],void 0,()=>t(...e),K))})}if(typeof e.action==`function`&&n[`lazy.action`].length>0){let t=e.action;r.lazy=Object.assign(r.lazy||{},{action:async(...e)=>Le(await G(n[`lazy.action`],void 0,()=>t(...e),K))})}}if(typeof t.loader==`function`&&n.loader.length>0){let e=Fe(t.loader),i=async(...t)=>Le(await G(n.loader,Re(t[0]),()=>e(...t),K));e.hydrate===!0&&(i.hydrate=!0),U(i,e),r.loader=i}if(typeof t.action==`function`&&n.action.length>0){let e=Fe(t.action),i=async(...t)=>Le(await G(n.action,Re(t[0]),()=>e(...t),K));U(i,e),r.action=i}return t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=Fe(e),r=async(...e)=>Le(await G(n.middleware,Re(e[0]),()=>t(...e),K));return U(r,t),r})),r}function Pe(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){e.navigate!=null&&n.navigate.push(e.navigate),e.fetch!=null&&n.fetch.push(e.fetch)}})),n.navigate.length>0){let t=Fe(e.navigate),r=async(...r)=>{let[i,a]=r,o,s={to:typeof i==`number`||typeof i==`string`?i:i?h(i):`.`,...q(e,a??{})};return Le(await G(n.navigate,s,async()=>{if(typeof i==`number`)return await t(...r);let n=W(e,e=>{o=e});try{return await t(...r)}finally{n()}},e=>({...K(e),meta:o})))};U(r,t),e.navigate=r}if(n.fetch.length>0){let t=Fe(e.fetch),r=async(...r)=>{let[i,a,o,s]=r,c;return Le(await G(n.fetch,{href:o??`.`,fetcherKey:i,...q(e,s??{})},async()=>{let n=W(e,e=>{c=e});try{return await t(...r)}finally{n()}},e=>({...K(e),meta:c})))};U(r,t),e.fetch=r}return e}function Fe(e){return e[je]??e}function U(e,t){e[je]=t}function W(e,t){return Me.set(e,t),()=>{Me.get(e)===t&&Me.delete(e)}}function Ie(e){let t=Me.get(e);return Me.delete(e),t}function Le(e){if(e.type===`error`)throw e.value;return e.value}async function G(e,t,n,r,i={result:null,innerResult:null},a=e.length-1){let o=e[a];if(o){let s,c=async()=>(s?console.error(`You cannot call instrumented handlers more than once`):s=G(e,t,n,r,i,a-1),await s,u(i.innerResult,`Expected an inner result`),i.innerResult);try{await o(c,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}s||await c(),await s}else{try{i.result={type:`success`,value:await n()}}catch(e){i.result={type:`error`,value:e}}i.innerResult=r(i.result,t)}return i.result?i.result:(i.result={type:`error`,value:Error(`No result assigned in instrumentation chain.`)},i.innerResult=r(i.result,t),i.result)}function K(e){return e.type===`error`&&e.value instanceof Error?{status:`error`,error:e.value}:{status:`success`,error:void 0}}function Re(e){let{request:t,context:n,params:r}=e;return{...e,request:ze(t),params:{...r},context:Be(n)}}function q(e,t){return{currentUrl:h(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function ze(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Be(e){return{get:t=>e.get(t)}}var Ve=[`POST`,`PUT`,`PATCH`,`DELETE`],He=new Set(Ve),Ue=[`GET`,...Ve],We=new Set(Ue),Ge=new Set([301,302,303,307,308]),Ke=new Set([307,308]),qe={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Je={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ye={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Xe=`remix-router-transitions`,Ze=Symbol(`ResetLoaderData`),Qe=class{#e;#t;#n;#r;constructor(e){this.#e=e,this.#t=j(e)}get stableRoutes(){return this.#e}get activeRoutes(){return this.#n??this.#e}get branches(){return this.#r??this.#t}get hasHMRRoutes(){return this.#n!=null}setRoutes(e){this.#e=e,this.#t=j(e)}setHmrRoutes(e){this.#n=e,this.#r=j(e)}commitHmrRoutes(){this.#n&&(this.#e=this.#n,this.#t=this.#r,this.#n=void 0,this.#r=void 0)}};function $e(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;u(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties,a=i||(()=>({}));if(e.instrumentations){let t=e.instrumentations;a=e=>({...i?.(e),...Ne(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new Qe(D(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||gt,f={...e.future},p=null,h=new Set,_=null,y=null,x=null,S=null,C=e.hydrationData!=null,w=A(s.activeRoutes,e.history.location,c,!1,s.branches),T=!1,E=null,O,k;if(w==null&&!e.patchRoutesOnNavigation){let t=J(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=zt(s.activeRoutes);O=!0,k=!O,w=n,E={[r.id]:t}}else if(w&&!e.hydrationData&&st(w,s.activeRoutes,e.history.location.pathname).active&&(w=null),!w){O=!1,k=!O,w=[];let t=st(null,s.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(T=!0,w=t.matches)}else if(w.some(e=>e.route.lazy))O=!1,k=!O;else if(!w.some(e=>it(e.route)))O=!0,k=!O;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=w;if(n){let e=w.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}k=!1,O=!0,r.forEach(e=>{let r=at(e.route,t,n);k||=r.renderFallback,O&&=!r.shouldLoad})}let j,M={historyAction:e.history.action,location:e.history.location,matches:w,initialized:O,renderFallback:k,navigation:qe,restoreScrollPosition:e.hydrationData==null&&null,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||E,fetchers:new Map,blockers:new Map},N=`POP`,P=null,te=!1,F,ne=!1,re=new Map,ie=null,ae=!1,oe=!1,se=new Set,I=new Map,ce=0,le=-1,ue=new Map,L=new Set,de=new Map,R=new Map,z=new Set,fe=new Map,me,he=null;function ge(){if(p=e.history.listen(({action:t,location:n,delta:r})=>{if(me){me(),me=void 0;return}d(fe.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=Ge({currentLocation:M.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{me=e});e.history.go(r*-1),We(i,{state:`blocked`,location:n,proceed(){We(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(M.blockers);e.set(i,Ye),V({blockers:e})}}),P?.resolve(),P=null;return}return xe(t,n)}),n){ln(t,re);let e=()=>un(t,re);t.addEventListener(`pagehide`,e),ie=()=>t.removeEventListener(`pagehide`,e)}return M.initialized||xe(`POP`,M.location,{initialHydration:!0}),j}function _e(){p&&p(),ie&&ie(),h.clear(),F&&F.abort(),M.fetchers.forEach((e,t)=>K(M.fetchers,t)),M.blockers.forEach((e,t)=>Ue(t))}function ve(e){if(h.add(e),_){let{newErrors:t}=_;_=null,e(M,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>h.delete(e)}function V(e,t={}){e.matches&&=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),M={...M,...e};let n=[],r=[];M.fetchers.forEach((e,t)=>{e.state===`idle`&&(z.has(t)?n.push(t):r.push(t))}),z.forEach(e=>{!M.fetchers.has(e)&&!I.has(e)&&n.push(e)}),h.size===0&&(_={newErrors:e.errors??null}),[...h].forEach(r=>r(M,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>K(M.fetchers,e)),r.forEach(e=>M.fetchers.delete(e))}function ye(t,n,{flushSync:r}={}){let i=M.actionData!=null&&M.navigation.formMethod!=null&&X(M.navigation.formMethod)&&M.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?M.actionData:null;let o=n.loaderData?It(M.loaderData,n.loaderData,n.matches||[],n.errors):M.loaderData,c=M.blockers;c.size>0&&!ae&&(c=new Map(c),c.forEach((e,t)=>c.set(t,Ye)));let l=!ae&&ot(t,n.matches||M.matches),u=te===!0||M.navigation.formMethod!=null&&X(M.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),ae||N===`POP`||(N===`PUSH`?e.history.push(t,t.state):N===`REPLACE`&&e.history.replace(t,t.state));let d;if(N===`POP`){let e=re.get(M.location.pathname);e&&e.has(t.pathname)?d={currentLocation:M.location,nextLocation:t}:re.has(t.pathname)&&(d={currentLocation:t,nextLocation:M.location})}else if(ne){let e=re.get(M.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),re.set(M.location.pathname,e)),d={currentLocation:M.location,nextLocation:t}}V({...n,actionData:a,loaderData:o,historyAction:N,location:t,initialized:!0,renderFallback:!1,navigation:qe,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),N=`POP`,te=!1,ne=!1,ae=!1,oe=!1,P?.resolve(),P=null,he?.resolve(),he=null}async function H(t,n){if(P?.resolve(),P=null,typeof t==`number`){P||=dn();let n=P.promise;return e.history.go(t),n}let r=Ie(j),{path:i,submission:a,error:o}=nt(!1,tt(M.location,M.matches,c,t,n?.fromRouteId,n?.relative),n),s;n?.mask&&(s={pathname:``,search:``,hash:``,...typeof n.mask==`string`?g(n.mask):{...M.location.mask,...n.mask}});let l=M.location,u=m(l,i,n&&n.state,void 0,s);u={...u,...e.history.encodeLocation(u)};let d=n&&n.replace!=null?n.replace:void 0,f=`PUSH`;d===!0?f=`REPLACE`:d===!1||a!=null&&X(a.formMethod)&&a.formAction===M.location.pathname+M.location.search&&(f=`REPLACE`);let p=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,h=(n&&n.flushSync)===!0,_=Ge({currentLocation:l,nextLocation:u,historyAction:f});if(_){We(_,{state:`blocked`,location:u,proceed(){We(_,{state:`proceeding`,proceed:void 0,reset:void 0,location:u}),H(t,n)},reset(){let e=new Map(M.blockers);e.set(_,Ye),V({blockers:e})}});return}await xe(f,u,{submission:a,pendingError:o,preventScrollReset:p,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:h,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate,instrumentationNavigateMetaReceiver:r})}function be(){he||=dn(),Fe(),V({revalidation:`loading`});let e=he.promise;return M.navigation.state===`submitting`?e:M.navigation.state===`idle`?(xe(M.historyAction,M.location,{startUninterruptedRevalidation:!0}),e):(xe(N||M.historyAction,M.navigation.location,{overrideNavigation:M.navigation,enableViewTransition:ne===!0}),e)}async function xe(t,n,r){F&&F.abort(),F=null,N=t,ae=(r&&r.startUninterruptedRevalidation)===!0,et(M.location,M.matches),te=(r&&r.preventScrollReset)===!0,ne=(r&&r.enableViewTransition)===!0;let i=s.activeRoutes,a=r?.initialHydration&&M.matches&&M.matches.length>0&&!T?M.matches:A(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&M.initialized&&!oe&&Ht(M.location,n)&&!(r&&r.submission&&X(r.submission.formMethod))){ye(n,{matches:a},{flushSync:o});return}let l=st(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),r?.instrumentationNavigateMetaReceiver){let t=tn(e.history,n,a);r.instrumentationNavigateMetaReceiver(t)}if(!a){let{error:e,notFoundMatches:t,route:r}=Xe(n.pathname);ye(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:o});return}let u=r&&r.overrideNavigation?{...r.overrideNavigation,matches:a,historyAction:t}:void 0;F=new AbortController;let d=jt(e.history,n,F.signal,r&&r.submission),f=e.getContext?await e.getContext():new b,p;if(r&&r.pendingError)p=[Rt(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&X(r.submission.formMethod)){let i=await Se(d,n,r.submission,a,t,f,l.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:o});if(i.shortCircuited)return;if(i.pendingActionResult){let[e,t]=i.pendingActionResult;if(Y(t)&&Ee(t.error)&&t.error.status===404){F=null,ye(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=rn(n,a,t,r.submission),o=!1,l.active=!1,d=jt(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await Ce(d,n,a,t,f,l.active,u,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,o,p,r&&r.callSiteDefaultShouldRevalidate);m||(F=null,ye(n,{matches:h||a,...Lt(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function Se(t,n,i,l,u,d,f,p,m={}){if(Fe(),V({navigation:an(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await ct(l,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=zt(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Rt(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)l=e.matches;else{let{notFoundMatches:e,error:t,route:r}=Xe(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=en(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:J(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await je(t,n,St(a,o,t,n,l,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of l)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(qt(h)){let n;return n=m&&m.replace!=null?m.replace:At(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===M.location.pathname+M.location.search,await Ae(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(Y(h)){let e=Rt(l,g.route.id);return(m&&m.replace)!==!0&&(N=`PUSH`),{matches:l,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:l,pendingActionResult:[g.route.id,h]}}async function Ce(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||rn(n,i,l,p),x=p||m||nn(b),S=!ae&&!g;if(d){if(S){let e=we(v);V({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await ct(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=zt(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Rt(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=Xe(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:w,revalidatingFetchers:T}=rt(t,u,a,o,e.history,M,i,x,n,g?[]:r,g===!0,oe,se,z,de,L,C,c,e.patchRoutesOnNavigation!=null,s.branches,v,y);if(le=++ce,!e.dataStrategy&&!w.some(e=>e.shouldLoad)&&!w.some(e=>e.route.middleware&&e.route.middleware.length>0)&&T.length===0){let e=new Map(M.fetchers),t=Be(e);return ye(n,{matches:i,loaderData:{},errors:v&&Y(v[1])?{[v[0]]:v[1].error}:null,...Lt(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=we(v);t!==void 0&&(e.actionData=t)}T.length>0&&(e.fetchers=Te(T)),V(e,{flushSync:_})}T.forEach(e=>{q(e.key),e.controller&&I.set(e.key,e.controller)});let E=()=>T.forEach(e=>q(e.key));F&&F.signal.addEventListener(`abort`,E);let{loaderResults:D,fetcherResults:O}=await Me(w,T,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};F&&F.signal.removeEventListener(`abort`,E),T.forEach(e=>I.delete(e.key));let k=Bt(D);if(k)return await Ae(t,k.result,!0,{replace:h}),{shortCircuited:!0};if(k=Bt(O),k)return L.add(k.key),await Ae(t,k.result,!0,{replace:h}),{shortCircuited:!0};let A=new Map(M.fetchers),{loaderData:ee,errors:j}=Ft(M,i,D,v,T,O,A);g&&M.errors&&(j={...M.errors,...j});let N=Be(A),P=Ve(le,A),te=N||P||T.length>0;return{matches:i,loaderData:ee,errors:j,...te?{workingFetchers:A}:{}}}function we(e){if(e&&!Y(e[1]))return{[e[0]]:e[1].data};if(M.actionData)return Object.keys(M.actionData).length===0?null:M.actionData}function Te(e){let t=new Map(M.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=on(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function De(t,n,r,i){q(t);let a=(i&&i.flushSync)===!0,o=Ie(j),l=s.activeRoutes,u=tt(M.location,M.matches,c,r,n,i?.relative),d=A(l,u,c,!1,s.branches),f=st(d,l,u);if(f.active&&f.matches&&(d=f.matches),o&&o(tn(e.history,u,d)),!d){W(t,n,J(404,{pathname:u}),{flushSync:a});return}let{path:p,submission:m,error:h}=nt(!0,u,i);if(h){W(t,n,h,{flushSync:a});return}let g=e.getContext?await e.getContext():new b,_=(i&&i.preventScrollReset)===!0;if(m&&X(m.formMethod)){await Oe(t,n,p,d,g,f.active,a,_,m,i&&i.defaultShouldRevalidate);return}de.set(t,{routeId:n,path:p}),await ke(t,n,p,d,g,f.active,a,_,m)}async function Oe(t,n,i,l,d,f,p,m,h,g){Fe(),de.delete(t),U(t,sn(h,M.fetchers.get(t)),{flushSync:p});let _=new AbortController,v=jt(e.history,i,_.signal,h);if(f){let e=await ct(l,new URL(v.url).pathname,v.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){W(t,n,e.error,{flushSync:p});return}if(e.matches)l=e.matches;else{W(t,n,J(404,{pathname:i}),{flushSync:p});return}}let y=en(l,i);if(!y.route.action&&!y.route.lazy){W(t,n,J(405,{method:h.formMethod,pathname:i,routeId:n}),{flushSync:p});return}I.set(t,_);let b=ce,x=St(a,o,v,i,l,y,r,d),S=await je(v,i,x,d,t),C=S[y.route.id];if(!C){for(let e of x)if(S[e.route.id]){C=S[e.route.id];break}}if(v.signal.aborted){I.get(t)===_&&I.delete(t);return}if(z.has(t)){if(qt(C)||Y(C)){U(t,cn(void 0));return}}else{if(qt(C)){if(I.delete(t),le>b){U(t,cn(void 0));return}return L.add(t),U(t,on(h)),Ae(v,C,!1,{fetcherSubmission:h,preventScrollReset:m})}if(Y(C)){W(t,n,C.error);return}}let w=M.navigation.location||M.location,T=jt(e.history,w,_.signal),E=s.activeRoutes,D=M.navigation.state===`idle`?M.matches:A(E,M.navigation.location,c,!1,s.branches);u(D,`Didn't find any matches after fetcher action`);let O=++ce;ue.set(t,O);let{dsMatches:k,revalidatingFetchers:ee}=rt(T,d,a,o,e.history,M,D,h,w,r,!1,oe,se,z,de,L,E,c,e.patchRoutesOnNavigation!=null,s.branches,[y.route.id,C],g),j=on(h,C.data),P=new Map(M.fetchers);P.set(t,j),ee.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=P.get(t),r=on(void 0,n?n.data:void 0);P.set(t,r),q(t),e.controller&&I.set(t,e.controller)}),V({fetchers:P});let te=()=>ee.forEach(e=>q(e.key));_.signal.addEventListener(`abort`,te);let{loaderResults:ne,fetcherResults:re}=await Me(k,ee,T,w,d);if(_.signal.aborted)return;_.signal.removeEventListener(`abort`,te),ue.delete(t),I.delete(t),ee.forEach(e=>I.delete(e.key));let ie=M.fetchers.has(t),ae=e=>{if(!ie)return e;let n=new Map(e.fetchers);return n.set(t,cn(C.data)),{...e,fetchers:n}},R=Bt(ne);if(R)return M=ae(M),Ae(T,R.result,!1,{preventScrollReset:m});if(R=Bt(re),R)return L.add(R.key),M=ae(M),Ae(T,R.result,!1,{preventScrollReset:m});let B=new Map(M.fetchers);ie&&B.set(t,cn(C.data));let{loaderData:fe,errors:pe}=Ft(M,D,ne,void 0,ee,re,B);Ve(O,B),M.navigation.state===`loading`&&O>le?(u(N,`Expected pending action`),F&&F.abort(),ye(M.navigation.location,{matches:D,loaderData:fe,errors:pe,fetchers:B})):(V({errors:pe,loaderData:It(M.loaderData,fe,D,pe),fetchers:B}),oe=!1)}async function ke(t,n,i,s,c,l,u,d,f){let p=M.fetchers.get(t);U(t,on(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=jt(e.history,i,m.signal);if(l){let e=await ct(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){W(t,n,e.error,{flushSync:u});return}if(e.matches)s=e.matches;else{W(t,n,J(404,{pathname:i}),{flushSync:u});return}}let g=en(s,i);I.set(t,m);let _=ce,v=await je(h,i,St(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(I.get(t)===m&&I.delete(t),!h.signal.aborted){if(z.has(t)){U(t,cn(void 0));return}if(qt(y)){if(le>_){U(t,cn(void 0));return}L.add(t),await Ae(h,y,!1,{preventScrollReset:d});return}if(Y(y)){W(t,n,y.error);return}U(t,cn(y.data))}}async function Ae(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:d}={}){a||(P?.resolve(),P=null),i.response.headers.has(`X-Remix-Revalidate`)&&(oe=!0);let f=i.response.headers.get(`Location`);u(f,`Expected a Location header on the redirect Response`),f=At(f,new URL(r.url),c,e.history);let p=m(M.location,f,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(pe(f)){let n=v(t,f,!0);e=n.origin!==t.location.origin||B(n.pathname,c)==null}if(e){d?t.location.replace(f):t.location.assign(f);return}}F=null;let h=d===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:g,formAction:_,formEncType:y}=M.navigation;!o&&!s&&g&&_&&y&&(o=nn(M.navigation));let b=o||s;Ke.has(i.response.status)&&b&&X(b.formMethod)?await xe(h,p,{submission:{...b,formAction:f},preventScrollReset:l||te,enableViewTransition:a?ne:void 0}):await xe(h,p,{overrideNavigation:rn(p,[],h,o),fetcherSubmission:s,preventScrollReset:l||te,enableViewTransition:a?ne:void 0})}async function je(e,t,n,r,i){let a,o={};try{a=await Ct(l,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!X(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!M.loaderData.hasOwnProperty(e.route.id)&&(!M.errors||!M.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(Kt(r)){let i=r.result;o[t]={type:`redirect`,response:Dt(i,e,t,n,c)}}else o[t]=await Et(r);return o}async function Me(e,t,n,r,i){let a=je(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await je(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:J(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Fe(){oe=!0,de.forEach((e,t)=>{I.has(t)&&se.add(t),q(t)})}function U(e,t,n={}){let r=new Map(M.fetchers);r.set(e,t),V({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function W(e,t,n,r={}){let i=Rt(M.matches,t),a=new Map(M.fetchers);K(a,e),V({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Le(e){return R.set(e,(R.get(e)||0)+1),z.has(e)&&z.delete(e),M.fetchers.get(e)||Je}function G(e,t){q(e,t?.reason),U(e,cn(null))}function K(e,t){let n=M.fetchers.get(t);I.has(t)&&!(n&&n.state===`loading`&&ue.has(t))&&q(t),de.delete(t),ue.delete(t),L.delete(t),z.delete(t),se.delete(t),e.delete(t)}function Re(e){let t=(R.get(e)||0)-1;t<=0?(R.delete(e),z.add(e)):R.set(e,t),V({fetchers:new Map(M.fetchers)})}function q(e,t){let n=I.get(e);n&&(n.abort(t),I.delete(e))}function ze(e,t){for(let n of e){let e=t.get(n);u(e,`Expected fetcher: ${n}`);let r=cn(e.data);t.set(n,r)}}function Be(e){let t=[],n=!1;for(let r of L){let i=e.get(r);u(i,`Expected fetcher: ${r}`),i.state===`loading`&&(L.delete(r),t.push(r),n=!0)}return ze(t,e),n}function Ve(e,t){let n=[];for(let[r,i]of ue)if(i<e){let e=t.get(r);u(e,`Expected fetcher: ${r}`),e.state===`loading`&&(q(r),ue.delete(r),n.push(r))}return ze(n,t),n.length>0}function He(e,t){let n=M.blockers.get(e)||Ye;return fe.get(e)!==t&&fe.set(e,t),n}function Ue(e){M.blockers.delete(e),fe.delete(e)}function We(e,t){let n=M.blockers.get(e)||Ye;u(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(M.blockers);r.set(e,t),V({blockers:r})}function Ge({currentLocation:e,nextLocation:t,historyAction:n}){if(fe.size===0)return;fe.size>1&&d(!1,`A router only supports one blocker at a time`);let r=Array.from(fe.entries()),[i,a]=r[r.length-1],o=M.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function Xe(e){let t=J(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=zt(n);return{notFoundMatches:r,route:i,error:t}}function Ze(e,t,n){if(y=e,S=t,x=n||null,!C&&M.navigation===qe){C=!0;let e=ot(M.location,M.matches);e!=null&&V({restoreScrollPosition:e})}return()=>{y=null,S=null,x=null}}function $e(e,t){return x&&x(e,t.map(e=>ee(e,M.loaderData)))||e.key}function et(e,t){if(y&&S){let n=$e(e,t);y[n]=S()}}function ot(e,t){if(y){let n=$e(e,t),r=y[n];if(typeof r==`number`)return r}return null}function st(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:A(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:A(n,r,c,!0,e)}}return{active:!1,matches:null}}async function ct(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let l=t;for(;;){let t=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:l,fetcherKey:i,patch:(e,n)=>{r.aborted||lt(e,n,s,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}if(r.aborted)return{type:`aborted`};let u=s.branches,d=A(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=A(s.activeRoutes,n,c,!0,u),!(f&&l.length<f.length&&ut(l,f.slice(0,l.length))))))return{type:`success`,matches:d};if(f||=A(s.activeRoutes,n,c,!0,u),!f||ut(l,f))return{type:`success`,matches:null};l=f}}function ut(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function dt(e){o={},s.setHmrRoutes(D(e,a,void 0,o))}function ft(e,t,n=!1){lt(e,t,s,o,a,n),s.hasHMRRoutes||V({})}return j={get basename(){return c},get future(){return f},get state(){return M},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return o},get window(){return t},initialize:ge,subscribe:ve,enableScrollRestoration:Ze,navigate:H,fetch:De,revalidate:be,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Le,resetFetcher:G,deleteFetcher:Re,dispose:_e,getBlocker:He,deleteBlocker:Ue,patchRoutes:ft,_internalFetchControllers:I,_internalSetRoutes:dt,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){V(e)}},e.instrumentations&&(j=Pe(j,e.instrumentations.map(e=>e.router).filter(Boolean))),j}function et(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function tt(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=V(r||`.`,ve(o),B(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=$t(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=fe({basename:n,pathname:c.pathname})),h(c)}function nt(e,t,n){if(!n||!et(n))return{path:t};if(n.formMethod&&!Qt(n.formMethod))return{path:t,error:J(405,{method:n.formMethod})};let r=()=>({path:t,error:J(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Vt(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!X(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}\n`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if(n.formEncType===`application/json`){if(!X(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}u(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Mt(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Mt(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Nt(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Nt(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(X(c.formMethod))return{path:t,submission:c};let l=g(t);return e&&l.search&&$t(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:h(l),submission:c}}function rt(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?Y(b[1])?b[1].error:b[1].data:void 0,C=i.createURL(a.location),w=i.createURL(c),T;if(u&&a.errors){let e=Object.keys(a.errors)[0];T=o.findIndex(t=>t.route.id===e)}else if(b&&Y(b[1])){let e=b[0];T=o.findIndex(t=>t.route.id===e)-1}let E=b?b[1].statusCode:void 0,D=E&&E>=400,O={currentUrl:C,currentParams:a.matches[0]?.params||{},nextUrl:w,nextParams:o[0].params,...s,actionResult:S,actionStatus:E},k=De(o),ee=o.map((i,o)=>{let{route:s}=i,f=null;if(T!=null&&o>T)f=!1;else if(s.lazy)f=!0;else if(!it(s))f=!1;else if(u){let{shouldLoad:e}=at(s,a.loaderData,a.errors);f=e}else ot(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return xt(n,r,e,c,k,i,l,t,f);let p=!1;typeof x==`boolean`?p=x:D?p=!1:d||C.pathname+C.search===w.pathname+w.search?p=!0:C.search===w.search?st(a.matches[o],i)&&(p=!0):p=!0;let m={...O,defaultShouldRevalidate:p};return xt(n,r,e,c,k,i,l,t,ct(i,m),m,x)}),j=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,b=A(g,e.path,_??`/`,!1,y);if(!b){if(v&&m)return;j.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let S=en(b,e.path),C=new AbortController,w=jt(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=St(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=St(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:!D&&d;let a={...O,defaultShouldRevalidate:i};ct(S,a)&&(T=St(n,r,w,e.path,b,S,l,t,a))}T&&j.push({key:s,routeId:e.routeId,path:e.path,matches:T,match:S,request:w,controller:C})}),{dsMatches:ee,revalidatingFetchers:j}}function it(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function at(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!it(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function ot(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function st(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function ct(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function lt(e,t,n,r,i,a){let o;if(e){let t=r[e];u(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>ut(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=D(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=D([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function ut(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index!==t.index||e.path!==t.path||e.caseSensitive!==t.caseSensitive?!1:(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>ut(e,t)))??!1}var dt=new WeakMap,ft=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(u(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=dt.get(i);o||(o={},dt.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=S(e),n=i[e]!==void 0;if(t)d(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)d(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},pt=new WeakMap;function mt(e,t,n,r,i){let a=n[e.id];if(u(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=pt.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{u(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=w(e),o=a[e]!==void 0;i?d(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?d(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return pt.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=ft({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function ht(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function gt(e){return e.matches.some(e=>e.route.middleware)?_t(e,()=>ht(e)):ht(e)}function _t(e,t){return vt(e,t,e=>{if(Zt(e))throw e;return e},Wt,n);async function n(t,n,r){if(r)return Object.assign(r.value,{[n]:{type:`error`,result:t}});{let{matches:r}=e,i=Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0)),a=r[i].route.id;for(let e of r.slice(0,i+1))try{await e._lazyPromises?.route}catch{a=e.route.id;break}return{[Rt(r,a).route.id]:{type:`error`,result:t}}}}}async function vt(e,t,n,r,i){let{matches:a,...o}=e;return await yt(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function yt(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await yt(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function bt(e,t,n,r,i){let a=ft({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=mt(r.route,X(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function xt(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=bt(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?ct(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?ct(a,{...l,defaultShouldRevalidate:e}):ct(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!X(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(X(n.method)||!p)?wt({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function St(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?xt(e,t,n,r,De(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:bt(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Ct(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,url:Oe(t,n),pattern:De(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return _t(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function wt({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=X(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:Oe(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a){if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw J(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}}else if(t)c=await f(t);else{let t=new URL(e.url);throw J(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function Tt(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function Et(e){let{result:t,type:n}=e;if(Yt(t)){let e;try{e=await Tt(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new Te(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?Jt(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:Ut(t),statusCode:Ee(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:Ee(t)?t.status:void 0}:Jt(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function Dt(e,t,n,r,i){let a=e.headers.get(`Location`);if(u(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!pe(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=tt(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var Ot=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function kt(e){try{return Ot.includes(new URL(e).protocol)}catch{return!1}}function At(e,t,n,r){if(pe(e)){let r=e,o=i.test(r)?new URL(a(r,t.protocol)):new URL(r);if(kt(o.toString()))throw Error(`Invalid redirect location`);let s=B(o.pathname,n)!=null;if(o.origin===t.origin&&s)return ye(o.pathname)+o.search+o.hash}try{if(kt(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function jt(e,t,n,r){let i=e.createURL(Vt(t)).toString(),a={signal:n};if(r&&X(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):a.body=t===`text/plain`?r.text:t===`application/x-www-form-urlencoded`&&r.formData?Mt(r.formData):r.formData}return new Request(i,a)}function Mt(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Nt(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Pt(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},d=n&&Y(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let f=n.route.id,p=t[f];if(u(!qt(p),`Cannot handle redirect results in processLoaderData`),Y(p)){let t=p.error;if(d!==void 0&&(t=d,d=void 0),o||={},i)o[f]=t;else{let n=Rt(e,f);o[n.route.id]??(o[n.route.id]=t)}r||(a[f]=Ze),c||(c=!0,s=Ee(p.error)?p.error.status:500),p.headers&&(l[f]=p.headers)}else a[f]=p.data,p.statusCode&&p.statusCode!==200&&!c&&(s=p.statusCode),p.headers&&(l[f]=p.headers)}),d!==void 0&&n&&(o={[n[0]]:d},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function Ft(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=Pt(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(u(s,`Did not find corresponding fetcher result`),Y(s)){let t=Rt(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(qt(s))u(!1,`Unhandled fetcher revalidation redirect`);else{let e=cn(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function It(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==Ze).reduce((e,[t,n])=>(e[t]=n,e),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function Lt(e){return e?Y(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Rt(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.ErrorBoundary!=null||e.route.errorElement!=null)||e[0]}function zt(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function J(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new Te(e||500,o,Error(s),!0)}function Bt(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(qt(r))return{key:n,result:r}}}function Vt(e){return h({...typeof e==`string`?g(e):e,hash:``})}function Ht(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function Ut(e){return new Te(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function Wt(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&Gt(t))}function Gt(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function Kt(e){return Yt(e.result)&&Ge.has(e.result.status)}function Y(e){return e.type===`error`}function qt(e){return(e&&e.type)===`redirect`}function Jt(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function Yt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function Xt(e){return Ge.has(e)}function Zt(e){return Yt(e)&&Xt(e.status)&&e.headers.has(`Location`)}function Qt(e){return We.has(e.toUpperCase())}function X(e){return He.has(e.toUpperCase())}function $t(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function en(e,t){let n=typeof t==`string`?g(t).search:t.search;if(e[e.length-1].route.index&&$t(n||``))return e[e.length-1];let r=_e(e);return r[r.length-1]}function tn(e,t,n){return{url:Oe(e.createURL(t),t),pattern:n?De(n):``,params:n?.[0]?.params?{...n[0].params}:{}}}function nn(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function rn(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function an(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function on(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function sn(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function cn(e){return{state:`idle`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function ln(e,t){try{let n=e.sessionStorage.getItem(Xe);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function un(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Xe,JSON.stringify(n))}catch(e){d(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function dn(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var fn=y.createContext(null);fn.displayName=`DataRouter`;var pn=y.createContext(null);pn.displayName=`DataRouterState`;var mn=y.createContext(!1);function hn(){return y.useContext(mn)}var gn=y.createContext({isTransitioning:!1});gn.displayName=`ViewTransition`;var _n=y.createContext(new Map);_n.displayName=`Fetchers`;var vn=y.createContext(null);vn.displayName=`Await`;var Z=y.createContext(null);Z.displayName=`Navigation`;var yn=y.createContext(null);yn.displayName=`Location`;var Q=y.createContext({outlet:null,matches:[],isDataRoute:!1});Q.displayName=`Route`;var bn=y.createContext(null);bn.displayName=`RouteError`;var xn=`REACT_ROUTER_ERROR`,Sn=`REDIRECT`,Cn=`ROUTE_ERROR_RESPONSE`;function wn(e){if(e.startsWith(`${xn}:${Sn}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Tn(e){if(e.startsWith(`${xn}:${Cn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Te(t.status,t.statusText,t.data)}catch{}}function En(e,{relative:t}={}){u(Dn(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=y.useContext(Z),{hash:i,pathname:a,search:o}=Mn(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:H([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Dn(){return y.useContext(yn)!=null}function $(){return u(Dn(),`useLocation() may be used only in the context of a <Router> component.`),y.useContext(yn).location}var On=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function kn(){let{isDataRoute:e}=y.useContext(Q);return e?Zn():An()}function An(){u(Dn(),`useNavigate() may be used only in the context of a <Router> component.`);let e=y.useContext(fn),{basename:t,navigator:n}=y.useContext(Z),{matches:r}=y.useContext(Q),{pathname:i}=$(),a=JSON.stringify(ve(r)),o=y.useRef(!1);return y.useLayoutEffect(()=>{o.current=!0}),y.useCallback((r,s={})=>{if(d(o.current,On),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=V(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:H([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}y.createContext(null);function jn(){let{matches:e}=y.useContext(Q);return e[e.length-1]?.params??{}}function Mn(e,{relative:t}={}){let{matches:n}=y.useContext(Q),{pathname:r}=$(),i=JSON.stringify(ve(n));return y.useMemo(()=>V(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Nn(e,t){return Pn(e,t)}function Pn(e,t,n){u(Dn(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=y.useContext(Z),{matches:i}=y.useContext(Q),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let s=a?a.pathnameBase:`/`;a&&a.route;let c=$(),l;if(t){let e=typeof t==`string`?g(t):t;u(s===`/`||e.pathname?.startsWith(s),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${e.pathname}" was given in the \`location\` prop.`),l=e}else l=c;let d=l.pathname||`/`,f=d;if(s!==`/`){let e=s.replace(/^\//,``).split(`/`);f=`/`+d.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let p=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):k(e,{pathname:f}),m=Vn(p&&p.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:H([s,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?s:H([s,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&m?y.createElement(yn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...l},navigationType:`POP`}},m):m}function Fn(){let e=Jn(),t=Ee(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return y.createElement(y.Fragment,null,y.createElement(`h2`,null,`Unexpected Application Error!`),y.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?y.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var In=y.createElement(Fn,null),Ln=class extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=mn;static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Tn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:y.createElement(Q.Provider,{value:this.props.routeContext},y.createElement(bn.Provider,{value:e,children:this.props.component}));return this.context?y.createElement(zn,{error:e},t):t}},Rn=new WeakMap;function zn({children:e,error:t}){let{basename:n}=y.useContext(Z);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=wn(t.digest);if(e){let r=Rn.get(t);if(r)throw r;let i=Ae(e.location,n),a=i.absoluteURL||i.to;if(kt(a))throw Error(`Invalid redirect location`);if(ke&&!Rn.get(t)){if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw Rn.set(t,n),n}}return y.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function Bn({routeContext:e,match:t,children:n}){let r=y.useContext(fn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(Q.Provider,{value:e},n)}function Vn(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);u(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:De(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||In,o&&(s<0&&c===0?($n(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?y.createElement(n.route.Component,null):n.route.element?n.route.element:e,y.createElement(Bn,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?y.createElement(Ln,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Hn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Un(e){let t=y.useContext(fn);return u(t,Hn(e)),t}function Wn(e){let t=y.useContext(pn);return u(t,Hn(e)),t}function Gn(e){let t=y.useContext(Q);return u(t,Hn(e)),t}function Kn(e){let t=Gn(e),n=t.matches[t.matches.length-1];return u(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function qn(){return Kn(`useRouteId`)}function Jn(){let e=y.useContext(bn),t=Wn(`useRouteError`),n=Kn(`useRouteError`);return e===void 0?t.errors?.[n]:e}var Yn=0;function Xn(e){let{router:t,basename:n}=Un(`useBlocker`),r=Wn(`useBlocker`),[i,a]=y.useState(``),o=y.useCallback(t=>{if(typeof e!=`function`)return!!e;if(n===`/`)return e(t);let{currentLocation:r,nextLocation:i,historyAction:a}=t;return e({currentLocation:{...r,pathname:B(r.pathname,n)||r.pathname},nextLocation:{...i,pathname:B(i.pathname,n)||i.pathname},historyAction:a})},[n,e]);return y.useEffect(()=>{let e=String(++Yn);return a(e),()=>t.deleteBlocker(e)},[t]),y.useEffect(()=>{i!==``&&t.getBlocker(i,o)},[t,i,o]),i&&r.blockers.has(i)?r.blockers.get(i):Ye}function Zn(){let{router:e}=Un(`useNavigate`),t=Kn(`useNavigate`),n=y.useRef(!1);return y.useLayoutEffect(()=>{n.current=!0}),y.useCallback(async(r,i={})=>{d(n.current,On),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Qn={};function $n(e,t,n){!t&&!Qn[e]&&(Qn[e]=!0,d(!1,n))}var er={};function tr(e,t){!e&&!er[t]&&(er[t]=!0,console.warn(t))}var nr=[`HydrateFallback`,`hydrateFallbackElement`],rr=class{status=`pending`;promise;resolve;reject;constructor(){this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function ir({router:e,flushSync:t,onError:n,useTransitions:r}){r=hn()||r;let[i,a]=y.useState(e.state),[o,s]=(0,y.useOptimistic)(i),[c,l]=y.useState(),[u,d]=y.useState({isTransitioning:!1}),[f,p]=y.useState(),[m,h]=y.useState(),[g,_]=y.useState(),v=y.useRef(new Map),b=y.useCallback((i,{deletedFetchers:o,newErrors:c,flushSync:u,viewTransitionOpts:g})=>{c&&n&&Object.values(c).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},pattern:De(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&v.current.set(t,e.data)}),o.forEach(e=>v.current.delete(e)),tr(u===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let b=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(tr(g==null||b,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!g||!b){t&&u?t(()=>a(i)):r===!1?a(i):y.startTransition(()=>{r===!0&&s(e=>ar(e,i)),a(i)});return}if(t&&u){t(()=>{m&&(f?.resolve(),m.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:g.currentLocation,nextLocation:g.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})})}),t(()=>h(n));return}m?(f?.resolve(),m.skipTransition(),_({state:i,currentLocation:g.currentLocation,nextLocation:g.nextLocation})):(l(i),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}))},[e.window,t,m,f,r,s,n]);y.useLayoutEffect(()=>e.subscribe(b),[e,b]),y.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new rr)},[u]),y.useEffect(()=>{if(f&&c&&e.window){let t=c,n=f.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):y.startTransition(()=>{r===!0&&s(e=>ar(e,t)),a(t)}),await n});i.finished.finally(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})}),h(i)}},[c,f,e.window,r,s]),y.useEffect(()=>{f&&c&&o.location.key===c.location.key&&f.resolve()},[f,m,o.location,c]),y.useEffect(()=>{!u.isTransitioning&&g&&(l(g.state),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),_(void 0))},[u.isTransitioning,g]);let x=y.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),S=e.basename||`/`,C=y.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:n}),[e,x,S,n]);return y.createElement(y.Fragment,null,y.createElement(fn.Provider,{value:C},y.createElement(pn.Provider,{value:o},y.createElement(_n.Provider,{value:v.current},y.createElement(gn.Provider,{value:u},y.createElement(ur,{basename:S,location:o.location,navigationType:o.historyAction,navigator:x,useTransitions:r},y.createElement(or,{routes:e.routes,manifest:e.manifest,future:e.future,state:o,isStatic:!1,onError:n})))))),null)}function ar(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var or=y.memo(sr);function sr({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Pn(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function cr({to:e,replace:t,state:n,relative:r}){u(Dn(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=y.useContext(Z);d(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=y.useContext(Q),{pathname:o}=$(),s=kn(),c=V(e,ve(a),o,r===`path`),l=JSON.stringify(c);return y.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function lr(e){u(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function ur({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){u(!Dn(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=y.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=g(n));let{pathname:l=`/`,search:f=``,hash:p=``,state:m=null,key:h=`default`,mask:_}=n,v=y.useMemo(()=>{let e=B(l,s);return e==null?null:{location:{pathname:e,search:f,hash:p,state:m,key:h,mask:_},navigationType:r}},[s,l,f,p,m,h,r,_]);return d(v!=null,`<Router basename="${s}"> is not able to match the URL "${l}${f}${p}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:y.createElement(Z.Provider,{value:c},y.createElement(yn.Provider,{children:t,value:v}))}function dr({children:e,location:t}){return Nn(fr(e),t)}y.Component;function fr(e,t=[]){let n=[];return y.Children.forEach(e,(e,r)=>{if(!y.isValidElement(e))return;let i=[...t,r];if(e.type===y.Fragment){n.push.apply(n,fr(e.props.children,i));return}u(e.type===lr,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`);let a=e.props;u(!a.index||!a.children,`An index route cannot have child routes.`);let o={id:a.id||i.join(`-`),caseSensitive:a.caseSensitive,element:a.element,Component:a.Component,index:a.index,path:a.path,middleware:a.middleware,loader:a.loader,action:a.action,hydrateFallbackElement:a.hydrateFallbackElement,HydrateFallback:a.HydrateFallback,errorElement:a.errorElement,ErrorBoundary:a.ErrorBoundary,shouldRevalidate:a.shouldRevalidate,handle:a.handle,lazy:a.lazy};a.children&&(o.children=fr(a.children,i)),n.push(o)}),n}var pr=`application/x-www-form-urlencoded`;function mr(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function hr(e){return mr(e)&&e.tagName.toLowerCase()===`button`}function gr(e){return mr(e)&&e.tagName.toLowerCase()===`form`}function _r(e){return mr(e)&&e.tagName.toLowerCase()===`input`}function vr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function yr(e,t){return e.button===0&&(!t||t===`_self`)&&!vr(e)}function br(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function xr(e,t){let n=br(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Sr=null;function Cr(){if(Sr===null)try{new FormData(document.createElement(`form`),0),Sr=!1}catch{Sr=!0}return Sr}var wr=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Tr(e){return e!=null&&!wr.has(e)?(d(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${pr}"`),null):e}function Er(e,t){let n,r,i,a,o;if(gr(e)){let o=e.getAttribute(`action`);r=o?B(o,t):null,n=e.getAttribute(`method`)||`get`,i=Tr(e.getAttribute(`enctype`))||pr,a=new FormData(e)}else if(hr(e)||_r(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?B(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||`get`,i=Tr(e.getAttribute(`formenctype`))||Tr(o.getAttribute(`enctype`))||pr,a=new FormData(o,e),!Cr()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(mr(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=`get`,r=null,i=pr,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}function Dr(e,t){if(e===!1||e==null)throw Error(t)}function Or(e,t){let n=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n.pathname=n.pathname.endsWith(`/`)?`${n.pathname}_.${t}`:`${n.pathname}.${t}`,n}async function kr(e,t){if(e.id in t)return t[e.id];try{let r=await n(()=>import(e.module),[]);return t[e.id]=r,r}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ar(e){return e!=null&&typeof e.page==`string`}function jr(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Mr(e,t,n){return Lr((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await kr(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(jr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Nr(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Pr(e,t,{includeHydrateFallback:n}={}){return Fr(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Fr(e){return[...new Set(e)]}function Ir(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Lr(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Ar(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Ir(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Rr(){let e=y.useContext(fn);return Dr(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function zr(){let e=y.useContext(pn);return Dr(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Br=y.createContext(void 0);Br.displayName=`FrameworkContext`;function Vr(){let e=y.useContext(Br);return Dr(e,`You must render this element inside a <HydratedRouter> element`),e}function Hr(e,t){let n=y.useContext(Br),[r,i]=y.useState(!1),[a,o]=y.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=y.useRef(null);y.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),y.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Ur(s,p),onBlur:Ur(c,m),onMouseEnter:Ur(l,p),onMouseLeave:Ur(u,m),onTouchStart:Ur(d,p)}]:[a,f,{}]:[!1,f,{}]}function Ur(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Wr({page:e,...t}){let n=hn(),{nonce:r}=Vr(),{router:i}=Rr(),a=y.useMemo(()=>k(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?y.createElement(Kr,{page:e,matches:a,...t}):y.createElement(qr,{page:e,matches:a,...t})):null}function Gr(e){let{manifest:t,routeModules:n}=Vr(),[r,i]=y.useState([]);return y.useEffect(()=>{let r=!1;return Mr(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Kr({page:e,matches:t,...n}){let r=$(),i=y.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Or(e,`rsc`),i=!1,a=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?i=!0:a.push(e.route.id);return i&&a.length>0&&n.searchParams.set(`_routes`,a.join(`,`)),[n.pathname+n.search]},[e,r,t]);return y.createElement(y.Fragment,null,i.map(e=>y.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function qr({page:e,matches:t,...n}){let r=$(),{manifest:i,routeModules:a}=Vr(),{loaderData:o,matches:s}=zr(),c=y.useMemo(()=>Nr(e,t,s,i,r,`data`),[e,t,s,i,r]),l=y.useMemo(()=>Nr(e,t,s,i,r,`assets`),[e,t,s,i,r]),u=y.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,s=!1;if(t.forEach(e=>{let t=i.routes[e.route.id];!t||!t.hasLoader||(!c.some(t=>t.route.id===e.route.id)&&e.route.id in o&&a[e.route.id]?.shouldRevalidate||t.hasClientLoader?s=!0:n.add(e.route.id))}),n.size===0)return[];let l=Or(e,`data`);return s&&n.size>0&&l.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[l.pathname+l.search]},[o,r,i,c,t,e,a]),d=y.useMemo(()=>Pr(l,i),[l,i]),f=Gr(l);return y.createElement(y.Fragment,null,u.map(e=>y.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),d.map(e=>y.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),f.map(({key:e,link:t})=>y.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Jr(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var Yr=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Yr&&(window.__reactRouterVersion=`8.3.0`)}catch{}function Xr(e,t){return $e({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:c({window:t?.window}),hydrationData:t?.hydrationData||Qr(),routes:e,mapRouteProperties:E,hydrationRouteProperties:nr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function Zr(e,t){return $e({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:l({window:t?.window}),hydrationData:t?.hydrationData||Qr(),routes:e,mapRouteProperties:E,hydrationRouteProperties:nr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function Qr(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:$r(e.errors)}),e}function $r(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new Te(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&we.includes(r.__subType)){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}var ei=y.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:i,reloadDocument:a,replace:o,mask:s,state:c,target:l,to:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...m},h){let{basename:g,navigator:_,useTransitions:v}=y.useContext(Z),b=typeof u==`string`&&r.test(u),x=Ae(u,g);u=x.to;let S=En(u,{relative:i}),C=$(),w=null;if(s){let e=V(s,[],C.mask?C.mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:H([g,e.pathname])),w=_.createHref(e)}let[T,E,D]=Hr(n,m),O=ai(u,{replace:o,mask:s,state:c,target:l,preventScrollReset:d,relative:i,viewTransition:f,defaultShouldRevalidate:p,useTransitions:v});function k(t){e&&e(t),t.defaultPrevented||O(t)}let A=!(x.isExternal||a),ee=y.createElement(`a`,{...m,...D,href:(A?w:void 0)||x.absoluteURL||S,onClick:A?k:e,ref:Jr(h,E),target:l,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?y.createElement(y.Fragment,null,ee,y.createElement(Wr,{page:S})):ee});ei.displayName=`Link`;var ti=y.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Mn(a,{relative:c.relative}),d=$(),f=y.useContext(pn),{navigator:p,basename:m}=y.useContext(Z),h=f!=null&&di(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=B(v,m)||v);let b=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,x=_===g||!r&&_.startsWith(g)&&_.charAt(b)===`/`,S=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(b)===`/`),C={isActive:x,isPending:S,isTransitioning:h},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return y.createElement(ei,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});ti.displayName=`NavLink`;var ni=y.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:i,replace:a,state:o,method:s=`get`,action:c,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...m},h)=>{let{useTransitions:g}=y.useContext(Z),_=li(),v=ui(c,{relative:u}),b=s.toLowerCase()===`get`?`get`:`post`,x=typeof c==`string`&&r.test(c);return y.createElement(`form`,{ref:h,method:b,action:v,onSubmit:i?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,i=r?.getAttribute(`formmethod`)||s,c=()=>_(r||e.currentTarget,{fetcherKey:t,method:i,navigate:n,replace:a,state:o,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p});g&&n!==!1?y.startTransition(()=>c()):c()},...m,"data-discover":!x&&e===`render`?`true`:void 0})});ni.displayName=`Form`;function ri(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ii(e){let t=y.useContext(fn);return u(t,ri(e)),t}function ai(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=kn(),d=$(),f=Mn(e,{relative:o});return y.useCallback(p=>{if(yr(p,t)){p.preventDefault();let t=n===void 0?h(d)===h(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?y.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function oi(e){d(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=y.useRef(br(e)),n=y.useRef(!1),r=$(),i=y.useMemo(()=>xr(r.search,n.current?null:t.current),[r.search]),a=kn();return[i,y.useCallback((e,t)=>{let r=br(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var si=0,ci=()=>`__${String(++si)}__`;function li(){let{router:e}=ii(`useSubmit`),{basename:t}=y.useContext(Z),n=qn(),r=e.fetch,i=e.navigate;return y.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Er(e,t);a.navigate===!1?await r(a.fetcherKey||ci(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function ui(e,{relative:t}={}){let{basename:n}=y.useContext(Z),r=y.useContext(Q);u(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Mn(e||`.`,{relative:t})},o=$();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:H([n,a.pathname])),h(a)}function di(e,{relative:t}={}){let n=y.useContext(gn);u(n!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=ii(`useViewTransitionState`),i=Mn(e,{relative:t});if(!n.isTransitioning)return!1;let a=B(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=B(n.nextLocation.pathname,r)||n.nextLocation.pathname;return L(i.pathname,o)!=null||L(i.pathname,a)!=null}export{cr as a,dr as c,kn as d,jn as f,oi as i,Xn as l,Ee as m,Xr as n,lr as o,Jn as p,Zr as r,ir as s,ei as t,$ as u};