@nodefony/studio 10.0.0-beta.6 → 10.0.0-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/dist/_virtual/{_@oxc-project_runtime@0.157.0 → _@oxc-project_runtime@0.158.0}/helpers/esm/decorate.js +1 -1
  2. package/dist/_virtual/{_@oxc-project_runtime@0.157.0 → _@oxc-project_runtime@0.158.0}/helpers/esm/decorateParam.js +1 -1
  3. package/dist/frontend/assets/Accordion-CpfkavHk.js +1 -0
  4. package/dist/frontend/assets/{ActionsLiveGraph-BByMDQ8p.js → ActionsLiveGraph-D1QeuUQm.js} +1 -1
  5. package/dist/frontend/assets/AgentsPreview-3-5OZZ37.js +12 -0
  6. package/dist/frontend/assets/ApiKeys-CtLUNnl0.js +2 -0
  7. package/dist/frontend/assets/{ArchitectureLiveGraph-B6IuvK3P.js → ArchitectureLiveGraph-CMuDgIZB.js} +1 -1
  8. package/dist/frontend/assets/Audit-B2FUlGqs.js +1 -0
  9. package/dist/frontend/assets/{BackplaneLiveGraph-BNBq8vxo.js → BackplaneLiveGraph-DPaKwgjB.js} +1 -1
  10. package/dist/frontend/assets/Breadcrumbs-Ct1K_zqN.js +1 -0
  11. package/dist/frontend/assets/BrickStoreChip-D1KnkCmc.js +1 -0
  12. package/dist/frontend/assets/Chat-DvhzrpTt.js +1 -0
  13. package/dist/frontend/assets/Chip-CzEO4TVP.js +1 -0
  14. package/dist/frontend/assets/{Cluster-CV4F6rSr.js → Cluster-4QkYbMbl.js} +1 -1
  15. package/dist/frontend/assets/{Collapse-BJqaENVr.js → Collapse-C38QJ_Ri.js} +1 -1
  16. package/dist/frontend/assets/ConfigPage-DSazrv0h.js +1 -0
  17. package/dist/frontend/assets/{ConnectorCard-Cbg_g5Du.js → ConnectorCard-GiShQva6.js} +2 -2
  18. package/dist/frontend/assets/Create-C-ZVQRdt.js +2 -0
  19. package/dist/frontend/assets/DashboardSupervision-deg6L71S.js +1 -0
  20. package/dist/frontend/assets/Database-BmezwQtb.js +1 -0
  21. package/dist/frontend/assets/{DbLogo-7aV10wM_.js → DbLogo-CckTvmdO.js} +1 -1
  22. package/dist/frontend/assets/Documentation-CmNFuMcO.js +1 -0
  23. package/dist/frontend/assets/{FanOutLiveGraph-D5IOJSwh.js → FanOutLiveGraph-C6KbaYVm.js} +1 -1
  24. package/dist/frontend/assets/Firewall-Htuj9USB.js +1 -0
  25. package/dist/frontend/assets/GatewayPreview-Bl4ilFGn.js +1 -0
  26. package/dist/frontend/assets/{IconAdjustmentsAlt-Caz_R5bs.js → IconAdjustmentsAlt-CPpJMDFd.js} +1 -1
  27. package/dist/frontend/assets/{IconAdjustmentsHorizontal-CM1uG9KB.js → IconAdjustmentsHorizontal-CzTgez2O.js} +1 -1
  28. package/dist/frontend/assets/{IconAffiliate-CvqXvNrd.js → IconAffiliate-B-8j6CaO.js} +1 -1
  29. package/dist/frontend/assets/{IconApi-3qAL5Yjr.js → IconApi-CBIbi8ns.js} +1 -1
  30. package/dist/frontend/assets/{IconAppWindow-Bnx8TK6W.js → IconAppWindow-BtbyDQML.js} +1 -1
  31. package/dist/frontend/assets/{IconApps-bjEy2ZUX.js → IconApps-BfSGoNRn.js} +1 -1
  32. package/dist/frontend/assets/{IconArchive-CmF90Nz1.js → IconArchive-DDq3xKRQ.js} +1 -1
  33. package/dist/frontend/assets/{IconArrowDown-DSfqVBEf.js → IconArrowDown-CypWBIm8.js} +1 -1
  34. package/dist/frontend/assets/{IconArrowLeft-BjCZ9CEd.js → IconArrowLeft-D0LQWE0c.js} +1 -1
  35. package/dist/frontend/assets/{IconArrowUp-Bzx15XR8.js → IconArrowUp-GGdt393_.js} +1 -1
  36. package/dist/frontend/assets/IconArrowsExchange-BP7tLAV_.js +1 -0
  37. package/dist/frontend/assets/{IconArrowsSplit2-BMuFjeYp.js → IconArrowsSplit2-BMV-DM2_.js} +1 -1
  38. package/dist/frontend/assets/IconBan-DF34c4Ac.js +1 -0
  39. package/dist/frontend/assets/{IconBook-DKUWpOeJ.js → IconBook-BS-zX7Sh.js} +1 -1
  40. package/dist/frontend/assets/{IconBooks-DjcVIQ-S.js → IconBooks-DYJgVlGf.js} +1 -1
  41. package/dist/frontend/assets/{IconBox-BAwdWaia.js → IconBox-DT4IcS8e.js} +1 -1
  42. package/dist/frontend/assets/{IconBrain-C6NOhqzz.js → IconBrain-CMyyVykF.js} +1 -1
  43. package/dist/frontend/assets/{IconCircleCheck-EFWqFKav.js → IconCircleCheck-BkiqnBmy.js} +1 -1
  44. package/dist/frontend/assets/{IconCircleDot-4fPWGW9L.js → IconCircleDot-DBpgsPm5.js} +1 -1
  45. package/dist/frontend/assets/IconCircuitResistor-BiMeCX9K.js +1 -0
  46. package/dist/frontend/assets/{IconCode-IC42sjug.js → IconCode-CkzeaOMf.js} +1 -1
  47. package/dist/frontend/assets/{IconDeviceDesktop-CRF_lI0H.js → IconDeviceDesktop-BhfcZEfk.js} +1 -1
  48. package/dist/frontend/assets/{IconDevices-34oQmjaK.js → IconDevices-DYaCW1Lf.js} +1 -1
  49. package/dist/frontend/assets/{IconDots-BOKu4rIh.js → IconDots-zMMjYLi7.js} +1 -1
  50. package/dist/frontend/assets/{IconDownload-B_lX7WPe.js → IconDownload-BIf4ZImv.js} +1 -1
  51. package/dist/frontend/assets/{IconEye-Cbm-k8Mf.js → IconEye-DXjnEUL5.js} +1 -1
  52. package/dist/frontend/assets/{IconFile-DAR2pS88.js → IconFile-D_AMs1iZ.js} +1 -1
  53. package/dist/frontend/assets/{IconFolder-DZtY_4Ju.js → IconFolder-DNvrDX-8.js} +1 -1
  54. package/dist/frontend/assets/{IconGitBranch-Du3OR1Qu.js → IconGitBranch-C9rgpIR2.js} +1 -1
  55. package/dist/frontend/assets/{IconHandStop-D5IEBW_F.js → IconHandStop-DQFq7Kla.js} +1 -1
  56. package/dist/frontend/assets/{IconHeartRateMonitor-B0WTzq7p.js → IconHeartRateMonitor-DURptc8j.js} +1 -1
  57. package/dist/frontend/assets/{IconHelpCircle-DK4LQvc5.js → IconHelpCircle-C6caw8cr.js} +1 -1
  58. package/dist/frontend/assets/{IconLayoutGrid-Bjd-AbP0.js → IconLayoutGrid-DqIXTdsq.js} +1 -1
  59. package/dist/frontend/assets/{IconListSearch-oqmmW_-J.js → IconListSearch-Dx8ldAwH.js} +1 -1
  60. package/dist/frontend/assets/{IconPackages-CYbFqLBF.js → IconPackages-Dswyo8q2.js} +1 -1
  61. package/dist/frontend/assets/{IconPencil-CDLSZvLB.js → IconPencil-B8AVKzwi.js} +1 -1
  62. package/dist/frontend/assets/{IconPlayerPause-D5zFqzRA.js → IconPlayerPause-BESNYgPM.js} +1 -1
  63. package/dist/frontend/assets/IconPlayerPlay-DhqKbQEW.js +1 -0
  64. package/dist/frontend/assets/{IconPlayerStop-Ceov1CKi.js → IconPlayerStop-BEsZkT6N.js} +1 -1
  65. package/dist/frontend/assets/IconPlus-DPedeEtY.js +1 -0
  66. package/dist/frontend/assets/{IconPuzzle-vE8cqLR_.js → IconPuzzle-CJhQUtbI.js} +1 -1
  67. package/dist/frontend/assets/{IconRecycle-C_twI1ht.js → IconRecycle-Ba6E065w.js} +1 -1
  68. package/dist/frontend/assets/{IconSend-D_wHD_TM.js → IconSend-YkuVPb0V.js} +1 -1
  69. package/dist/frontend/assets/{IconServer2-ZtG1_ODi.js → IconServer2-CQ-VREH3.js} +1 -1
  70. package/dist/frontend/assets/{IconShieldOff-D5UxWHhA.js → IconShieldOff-BsfIN8zc.js} +1 -1
  71. package/dist/frontend/assets/{IconSitemap-DDw0J5mh.js → IconSitemap-BVtH3lou.js} +1 -1
  72. package/dist/frontend/assets/{IconStack2-jDW18idi.js → IconStack2-CCZMRSRP.js} +1 -1
  73. package/dist/frontend/assets/{IconTerminal2-BUd47F6P.js → IconTerminal2-DTjQG6wa.js} +1 -1
  74. package/dist/frontend/assets/{IconTool-B58Tttir.js → IconTool-BSCYXvc-.js} +1 -1
  75. package/dist/frontend/assets/{IconUserOff-uhJAZPSA.js → IconUserOff-f9WTCDbr.js} +1 -1
  76. package/dist/frontend/assets/{IconWorld-CLmDLaDL.js → IconWorld-DSRVZK6z.js} +1 -1
  77. package/dist/frontend/assets/KnowledgePreview-DXIniW1c.js +1 -0
  78. package/dist/frontend/assets/List-B4NvgWxC.js +1 -0
  79. package/dist/frontend/assets/{LlmProvidersPreview-B3b8uMwc.js → LlmProvidersPreview-C6K_4T7y.js} +1 -1
  80. package/dist/frontend/assets/{LogVisuals-rhO3Rnnr.js → LogVisuals-DEasJmu2.js} +1 -1
  81. package/dist/frontend/assets/Logs-D4Lwm_D0.js +1 -0
  82. package/dist/frontend/assets/McpPreview-RM10Do9w.js +1 -0
  83. package/dist/frontend/assets/MemoryPreview-BIQuDHaJ.js +1 -0
  84. package/dist/frontend/assets/Migrations-Ct1DBgot.js +3 -0
  85. package/dist/frontend/assets/ModuleDetail-zR6tYvwc.js +1 -0
  86. package/dist/frontend/assets/Modules-yxw9R2M5.js +1 -0
  87. package/dist/frontend/assets/OrmConnector-CJZkJeNS.js +1 -0
  88. package/dist/frontend/assets/OrmEntity-PEj9Ff7K.js +1 -0
  89. package/dist/frontend/assets/OrmOverview-DETG6IpL.js +1 -0
  90. package/dist/frontend/assets/OrmWorker-8Etwr4fo.js +1 -0
  91. package/dist/frontend/assets/Playground-BWA7qAvx.js +1 -0
  92. package/dist/frontend/assets/{ProbesLiveGraph-c31FHQM2.js → ProbesLiveGraph-D94e1c6i.js} +1 -1
  93. package/dist/frontend/assets/{Profile-IJIE8V07.js → Profile-D0U83sV_.js} +2 -2
  94. package/dist/frontend/assets/{ProfileFields-Cq9vA8Ue.js → ProfileFields-dt4VO6bY.js} +1 -1
  95. package/dist/frontend/assets/Progress-COepY2v5.js +1 -0
  96. package/dist/frontend/assets/{ProtocoleLiveGraph-Bka1_XFf.js → ProtocoleLiveGraph-UmOlL04Y.js} +1 -1
  97. package/dist/frontend/assets/RealtimeConsole-CcZUTtHc.js +1 -0
  98. package/dist/frontend/assets/{RingProgress-ByEC92W0.js → RingProgress-QfUZ9GPc.js} +1 -1
  99. package/dist/frontend/assets/{Roadmap-3qxA5Dl5.js → Roadmap-DrseUgGd.js} +1 -1
  100. package/dist/frontend/assets/RoleSwitch-DZt4YgqK.js +1 -0
  101. package/dist/frontend/assets/{Roles-CV7vVmqC.js → Roles-Dhe0yW0U.js} +1 -1
  102. package/dist/frontend/assets/{RoutesView-B-5vtPFV.js → RoutesView-CXZ8Aoj_.js} +1 -1
  103. package/dist/frontend/assets/{Runtime-sp3mqqpQ.js → Runtime-BAWsvDqI.js} +1 -1
  104. package/dist/frontend/assets/Sessions-Dvi9WBmv.js +1 -0
  105. package/dist/frontend/assets/Skeleton-D4mSLrUF.js +1 -0
  106. package/dist/frontend/assets/Slider-BbJH89K3.js +1 -0
  107. package/dist/frontend/assets/StoresView-m9K9J-zE.js +1 -0
  108. package/dist/frontend/assets/System-DbcrHR18.js +1 -0
  109. package/dist/frontend/assets/TagsInput-DLA4PIhC.js +1 -0
  110. package/dist/frontend/assets/{Textarea-Bwjmjqa0.js → Textarea-nmioafgL.js} +1 -1
  111. package/dist/frontend/assets/Timeline-ouAOSjY1.js +1 -0
  112. package/dist/frontend/assets/TraceView-Bvtoz8-Z.js +1 -0
  113. package/dist/frontend/assets/{Twin-DcBpuqwJ.js → Twin-gbY-Ir8E.js} +1 -1
  114. package/dist/frontend/assets/TwinMap-DCpZouug.js +19 -0
  115. package/dist/frontend/assets/UserProfile-BaPNh-G3.js +1 -0
  116. package/dist/frontend/assets/{Users-ihZaRoqZ.js → Users-DoSedUDm.js} +1 -1
  117. package/dist/frontend/assets/VectorStoresPreview-BwYoGKio.js +1 -0
  118. package/dist/frontend/assets/Webhooks-Ck9n1qLs.js +1 -0
  119. package/dist/frontend/assets/Workspace-BZRv5E_W.js +1 -0
  120. package/dist/frontend/assets/{aiPreviewParts-BTj_x25N.js → aiPreviewParts-Dj8Ljhnn.js} +1 -1
  121. package/dist/frontend/assets/{apiKeysModel-BIHGwPUS.js → apiKeysModel-CJevQpt8.js} +1 -1
  122. package/dist/frontend/assets/auditFormat-jZN46_5Z.js +1 -0
  123. package/dist/frontend/assets/{auditModel-BvCxSmod.js → auditModel-Cz-3Rzik.js} +1 -1
  124. package/dist/frontend/assets/{configEdit-Dvwklp12.js → configEdit-p1JESVv_.js} +1 -1
  125. package/dist/frontend/assets/{eventFlow-B9uJqrQa.js → eventFlow-wonKPF8V.js} +1 -1
  126. package/dist/frontend/assets/{health-56mWKiAZ.js → health-7sMajsQI.js} +1 -1
  127. package/dist/frontend/assets/{hooks-DvZDRNGz.js → hooks-DL-ZhyoD.js} +1 -1
  128. package/dist/frontend/assets/{index-C4TOHTro.css → index-CA-mibvn.css} +1 -1
  129. package/dist/frontend/assets/index-PhNQVa0x.js +28 -0
  130. package/dist/frontend/assets/{logFormat-CcEvsf9s.js → logFormat-Bk36BvWi.js} +1 -1
  131. package/dist/frontend/assets/{ormConnectorInsights-Cb2YjiXI.js → ormConnectorInsights-C7902tKC.js} +1 -1
  132. package/dist/frontend/assets/{profileVisuals-Vkrgupl1.js → profileVisuals-Dz_Mb4iH.js} +1 -1
  133. package/dist/frontend/assets/stores-BPQ3jvDo.js +1 -0
  134. package/dist/frontend/assets/{ui-BE5Z8gxu.js → ui-B4vXT8-w.js} +31 -31
  135. package/dist/frontend/assets/useBlockSource-DTNNrdmz.js +1 -0
  136. package/dist/frontend/assets/{useSocketLiveData-DCSQAUUz.js → useSocketLiveData-CmMYezqs.js} +1 -1
  137. package/dist/frontend/assets/{usersFormat-DJmEzW8-.js → usersFormat-EIUaaMSm.js} +1 -1
  138. package/dist/frontend/index.html +15 -15
  139. package/dist/index.js +1 -1
  140. package/dist/nodefony/controller/StudioController.js +1 -1
  141. package/dist/nodefony/controller/StudioCreateController.js +2 -2
  142. package/dist/nodefony/controller/StudioRealtimeController.js +1 -1
  143. package/package.json +23 -23
  144. package/dist/frontend/assets/Accordion-ALba5ICd.js +0 -1
  145. package/dist/frontend/assets/AgentsPreview-qzmyxcol.js +0 -12
  146. package/dist/frontend/assets/ApiKeys-D2Di4HS3.js +0 -2
  147. package/dist/frontend/assets/Audit-B_Y8xC-6.js +0 -1
  148. package/dist/frontend/assets/Breadcrumbs-CMlMMkgY.js +0 -1
  149. package/dist/frontend/assets/BrickStoreChip-CA_GfR1O.js +0 -1
  150. package/dist/frontend/assets/Chat-zFVRIlFd.js +0 -1
  151. package/dist/frontend/assets/Chip-LuHDMUZa.js +0 -1
  152. package/dist/frontend/assets/ConfigPage-Cm7pRkQh.js +0 -1
  153. package/dist/frontend/assets/Create-B0PlzeBP.js +0 -2
  154. package/dist/frontend/assets/DashboardSupervision-DF7InKb9.js +0 -1
  155. package/dist/frontend/assets/Database-DBb4gwPi.js +0 -1
  156. package/dist/frontend/assets/Documentation-CdwQjy33.js +0 -1
  157. package/dist/frontend/assets/Firewall-CtFZmQ_M.js +0 -1
  158. package/dist/frontend/assets/GatewayPreview-CsYp5iZJ.js +0 -1
  159. package/dist/frontend/assets/IconArrowsExchange-BKfT7cil.js +0 -1
  160. package/dist/frontend/assets/IconBan-FT1sWj-T.js +0 -1
  161. package/dist/frontend/assets/IconCircuitResistor-CB_bM60O.js +0 -1
  162. package/dist/frontend/assets/IconPlayerPlay-BuQoHMlG.js +0 -1
  163. package/dist/frontend/assets/IconPlus-wcOf2tpK.js +0 -1
  164. package/dist/frontend/assets/KnowledgePreview-Dj3-LzX5.js +0 -1
  165. package/dist/frontend/assets/List-CECkvlG7.js +0 -1
  166. package/dist/frontend/assets/Logs-CRND6dqr.js +0 -1
  167. package/dist/frontend/assets/McpPreview-BREhLzsz.js +0 -1
  168. package/dist/frontend/assets/MemoryPreview-CauqEca-.js +0 -1
  169. package/dist/frontend/assets/Migrations-mRqTP2yg.js +0 -3
  170. package/dist/frontend/assets/ModuleDetail-BwY-ROFd.js +0 -1
  171. package/dist/frontend/assets/Modules-D2PUGpQ7.js +0 -1
  172. package/dist/frontend/assets/OrmConnector-BMEtXO3H.js +0 -1
  173. package/dist/frontend/assets/OrmEntity-DvHPhtGy.js +0 -1
  174. package/dist/frontend/assets/OrmOverview-DtAyGUiC.js +0 -1
  175. package/dist/frontend/assets/OrmWorker-CzRyK20W.js +0 -1
  176. package/dist/frontend/assets/Playground-BJFpJxXF.js +0 -1
  177. package/dist/frontend/assets/Progress-x0M71dKl.js +0 -1
  178. package/dist/frontend/assets/RealtimeConsole-BpVJhbUh.js +0 -1
  179. package/dist/frontend/assets/RoleSwitch-B5hdXz8L.js +0 -1
  180. package/dist/frontend/assets/Sessions-Dv5uIszb.js +0 -1
  181. package/dist/frontend/assets/Skeleton-Co-k5bg6.js +0 -1
  182. package/dist/frontend/assets/Slider-DLr1BvW7.js +0 -1
  183. package/dist/frontend/assets/StoresView-6i0oYI0t.js +0 -1
  184. package/dist/frontend/assets/System-8KWu2xGf.js +0 -1
  185. package/dist/frontend/assets/TagsInput-DrkhRdPp.js +0 -1
  186. package/dist/frontend/assets/Timeline-G0bEoS2W.js +0 -1
  187. package/dist/frontend/assets/TraceView-BRlpmJY-.js +0 -1
  188. package/dist/frontend/assets/TwinMap-DXVz_AWv.js +0 -19
  189. package/dist/frontend/assets/UserProfile-r96NX7gV.js +0 -1
  190. package/dist/frontend/assets/VectorStoresPreview-eAR2-Lt7.js +0 -1
  191. package/dist/frontend/assets/Webhooks-BccR4L9R.js +0 -1
  192. package/dist/frontend/assets/Workspace-Su3OYXke.js +0 -1
  193. package/dist/frontend/assets/auditFormat-iKBSSfyd.js +0 -1
  194. package/dist/frontend/assets/index-ByGs708T.js +0 -28
  195. package/dist/frontend/assets/stores-BaEZ5-YP.js +0 -1
  196. package/dist/frontend/assets/useBlockSource-CteanNtO.js +0 -1
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{$n as t,Bn as n,J as r,Kr as i,L as a,Wr as o,Z as s,Zr as c,_r as l,ba as u,dr as d,en as f,fr as p,g as m,hr as h,kr as g,n as ee,nr as te,on as _,s as v,vi as y}from"./ui-BE5Z8gxu.js";import{O as b}from"./stores-BaEZ5-YP.js";var x=e(u(),1),S=y(),C=`•••••`,w=/secret|password|passwd|passphrase|privatekey|keysetjson|clientsecret|credential/i;function T(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function E(e){if(e.properties||T(e.additionalProperties))return e;if(Array.isArray(e.anyOf)){let t=e.anyOf.find(e=>e.properties??T(e.additionalProperties));if(t)return t}return null}function D(e,t){if(!T(e))return null;let n=e;for(let e of t.split(`.`)){let t=E(n);if(!t)return null;let r=t.properties?.[e];if(r)n=r;else if(T(t.additionalProperties))n=t.additionalProperties;else return null}return n}function ne(e){if(Array.isArray(e.enum))return`enum`;if(Array.isArray(e.anyOf)){let t=e.anyOf.map(e=>e.type===`null`?`null`:e.type===`array`?`array`:typeof e.type==`string`?e.type:`object`);return Array.from(new Set(t)).join(` | `)}return e.type===`array`?`array`:typeof e.type==`string`?e.type:`object`}function O(e){return e===null?`null`:Array.isArray(e)?`array`:typeof e}function k(e){let t=new Set,n=e=>{Array.isArray(e)?e.forEach(e=>t.add(e)):e&&t.add(e)};return n(e.type),Array.isArray(e.anyOf)&&e.anyOf.forEach(e=>n(e.type)),[...t]}function A(e){if(e?.runtimeMutable!==!0||e.secret===!0)return;if(Array.isArray(e.enum)){let t=e.enum.filter(e=>typeof e==`string`);return t.length?{kind:`select`,options:t,nullable:e.enum.includes(null)}:void 0}let t=k(e);if(t.includes(`array`)||t.includes(`object`))return;let n=t.includes(`null`);if(t.includes(`boolean`))return{kind:`switch`};if(t.includes(`integer`)||t.includes(`number`))return{kind:`number`,min:e.minimum,max:e.maximum,integer:t.includes(`integer`)&&!t.includes(`number`),nullable:n};if(t.includes(`string`))return{kind:`text`,nullable:n}}function j(e){if(Array.isArray(e.enum))return e.enum.map(e=>e===null?`null`:a(e)).join(` · `);let t=[];return typeof e.minimum==`number`&&t.push(`≥ ${e.minimum}`),typeof e.maximum==`number`&&t.push(`≤ ${e.maximum}`),t.length?t.join(` · `):void 0}function M(e,t,n){if(e===void 0)return;let r=Array.isArray(e)&&e.length===0,i=T(e)&&Object.keys(e).length===0;return(e===``||r||i)&&t?(0,S.jsx)(p,{style:{fontSize:12},children:`auto`}):e===null?(0,S.jsx)(p,{style:{fontSize:12},children:`null`}):r?(0,S.jsx)(p,{style:{fontSize:12},children:`(aucun)`}):i?(0,S.jsx)(p,{style:{fontSize:12},children:`{}`}):Array.isArray(e)||T(e)?(0,S.jsx)(m,{value:e,title:n}):typeof e==`string`?(0,S.jsx)(p,{style:{fontSize:12},children:e===``?`""`:JSON.stringify(e)}):(0,S.jsx)(p,{style:{fontSize:12},children:a(e)})}function N(e,t,n,r){let i=e.slice(e.lastIndexOf(`.`)+1),a=t?.secret===!0||w.test(i),o=a?void 0:A(t);return{key:e,type:t?ne(t):O(n),constraint:t?j(t):void 0,defaultValue:t?M(t.default,t.kernelDerived,`${e} (défaut)`):void 0,description:t?.description,mutability:t?.runtimeMutable?`live`:`boot`,reserved:t?.reserved===!0,kernelDerived:t?.kernelDerived===!0,secret:a,source:r,env:typeof t?.env==`string`?t.env:void 0,editControl:o,editValue:o?n:void 0,effective:a?(0,S.jsx)(p,{style:{fontSize:12},children:C}):M(n,t?.kernelDerived,e)}}function P(e){let t=e?E(e):null;return!!(t?.properties&&Object.keys(t.properties).length>0)}function F(e,t,n,r){if(n.split(`.`).length>8)return;let i=t?E(t):null,a=new Set;if(i?.properties)for(let e of Object.keys(i.properties))a.add(e);if(T(e))for(let t of Object.keys(e))a.add(t);for(let t of a){let a=n?`${n}.${t}`:t,o=T(e)?e[t]:void 0,s=i?.properties?.[t]??(T(i?.additionalProperties)?i.additionalProperties:null);P(s)||T(o)&&Object.keys(o).length>0?F(o,s,a,r):r.push({path:a,node:s,value:o})}}function I(e,t,n){let r=T(e)?e:null,i=[];F(t,r,``,i);let a=[],o=new Map;for(let{path:e,node:t,value:r}of i){let i=N(e,t,r,n?.[e]),s=e.indexOf(`.`);if(s===-1)a.push(i);else{let t=e.slice(0,s),n=o.get(t);n?n.push(i):o.set(t,[i])}}let s=[];a.length&&s.push({title:`Général`,fields:a});for(let[t,n]of o){let r=D(e,t);s.push({title:t,description:r?.description,fields:n})}return s}function L(e,t){return`NF__${e.toUpperCase()}__${t.replace(/\./g,`__`).toUpperCase()}`}function R(e,t,n){return n===`env`?e.envKeys[t.toLowerCase()]??L(e.seg,t):e.overriddenBy[t]??`nodefony.config.ts`}function z(e,t,n){let r=[];for(let i of e)for(let e of i.fields){let i=e.source;if(i!==`app`&&i!==`env`&&i!==`runtime`)continue;let a=L(t,e.key);r.push({field:e.key,source:i,secret:!!e.secret,overrideKey:a,where:i===`runtime`?`édité à chaud (runtime)`:n?n(e.key,i):a})}return r}function B(e,t){return e.map(e=>({...e,fields:e.fields.map(e=>e.reserved?e:{...e,recipe:e.recipe??L(t,e.key)})}))}function V(e){let t=[],n=[],r={moduleCount:0,fieldCount:0,byProvenance:{default:0,app:0,env:0},secrets:0,live:0},i=[...e].sort((e,t)=>e.isApp===t.isApp?e.name.localeCompare(t.name):e.isApp?-1:1);for(let e of i){let i=I(e.configSchema,e.config,e.provenance);if(i.length===0)continue;let a=B(i,e.seg);t.push({entry:e,sections:a,schemaStatus:e.configSchema?`zod`:`none`});for(let t of a)for(let i of t.fields){r.fieldCount++;let t=i.source??`default`;t===`app`?r.byProvenance.app++:t===`env`?r.byProvenance.env++:r.byProvenance.default++,i.secret&&r.secrets++,i.mutability===`live`&&r.live++,(t===`app`||t===`env`)&&n.push({module:e.name,moduleKey:e.key,field:i.key,source:t,secret:!!i.secret,overrideKey:L(e.seg,i.key),where:R(e,i.key,t)})}}return r.moduleCount=t.length,{modules:t,overrides:n,stats:r}}var H={app:{label:`app`,color:`grape`},env:{label:`env`,color:`teal`},runtime:{label:`runtime`,color:`cyan`}};function U({value:e,label:t,hint:n,color:r}){return(0,S.jsxs)(o,{gap:8,wrap:`nowrap`,children:[(0,S.jsx)(g,{fz:22,fw:700,lh:1,c:e>0?r:`dimmed`,children:e}),(0,S.jsxs)(o,{gap:4,wrap:`nowrap`,children:[(0,S.jsx)(g,{size:`xs`,c:`dimmed`,tt:`uppercase`,fw:700,children:t}),n]})]})}function W({value:e}){return(0,S.jsxs)(o,{gap:4,wrap:`nowrap`,children:[(0,S.jsx)(p,{style:{fontSize:11},children:e}),(0,S.jsx)(d,{value:e,timeout:1500,children:({copied:t,copy:n})=>(0,S.jsx)(te,{label:t?`Copié`:`Copier`,withArrow:!0,children:(0,S.jsx)(i,{size:`sm`,variant:`subtle`,color:t?`teal`:`gray`,"aria-label":`Copier ${e}`,onClick:n,children:t?(0,S.jsx)(_,{size:14}):(0,S.jsx)(f,{size:14})})})})]})}var G=[{key:`field`,header:`Réglage`,sortable:!0,filterable:!0,value:e=>e.field,render:e=>(0,S.jsx)(p,{style:{fontSize:12},children:e.field})},{key:`source`,header:`Provenance`,sortable:!0,filterable:!0,filterType:`select`,filterOptions:Object.keys(H),value:e=>e.source,render:e=>(0,S.jsx)(l,{size:`sm`,variant:`light`,color:H[e.source].color,tt:`none`,children:H[e.source].label}),size:130},{key:`where`,header:`Surchargé par / recette`,sortable:!0,filterable:!0,value:e=>e.where,render:e=>e.source===`runtime`?(0,S.jsx)(g,{size:`xs`,c:`dimmed`,children:e.where}):(0,S.jsx)(W,{value:e.overrideKey})}];function K({overrides:e}){return(0,S.jsxs)(c,{withBorder:!0,p:`md`,radius:`md`,children:[(0,S.jsxs)(o,{gap:6,mb:`sm`,children:[(0,S.jsx)(g,{fw:600,size:`sm`,children:`Surcharges actives`}),(0,S.jsxs)(g,{size:`xs`,c:`dimmed`,children:[e.length,` réglage(s) ≠ défaut`]}),(0,S.jsx)(r,{title:`Surcharges actives`,summary:`Les réglages de ce module qui DIFFÈRENT du défaut du framework — d'où vient la valeur (app/env/runtime) et la recette 12-factor pour la piloter. C'est l'identité de ce module dans CE déploiement.`})]}),(0,S.jsx)(ee,{mode:`client`,data:e,columns:G,getRowId:e=>e.field,initialSort:{key:`field`,dir:`asc`},searchable:!0,searchPlaceholder:`Rechercher un réglage…`,emptyMessage:`Aucune surcharge : ce module tourne entièrement sur les défauts du framework.`})]})}function q({module:e,seg:n,schema:i,sections:a,editable:c=!1,onEdit:u,focusKey:d,renderHelp:f}){let p=(0,x.useMemo)(()=>z(a,n),[a,n]),{live:m,secrets:g}=(0,x.useMemo)(()=>{let e=0,t=0;for(let n of a)for(let r of n.fields)r.mutability===`live`&&e++,r.secret&&t++;return{live:e,secrets:t}},[a]);return(0,S.jsxs)(t,{gap:`lg`,children:[(0,S.jsx)(h,{withBorder:!0,radius:`md`,p:`md`,children:(0,S.jsxs)(o,{gap:`xl`,wrap:`wrap`,children:[(0,S.jsx)(U,{value:p.length,label:`Surcharges`,color:`grape`,hint:(0,S.jsx)(r,{title:`Surcharges`,summary:`Réglages dont la valeur effective diffère du défaut du framework (app, env, ou édition à chaud). 0 = ce module tourne en config stock.`,width:260})}),(0,S.jsx)(U,{value:m,label:`À chaud (dev)`,color:`teal`,hint:(0,S.jsx)(r,{title:`Éditables à chaud`,summary:`Réglages relus à chaque requête (ou recalculés via un seam) : modifiables en développement sans redémarrage, figés en production.`,width:280})}),(0,S.jsx)(U,{value:g,label:`Secrets`,color:`orange`,hint:(0,S.jsx)(r,{title:`Secrets`,summary:`Champs sensibles masqués ici et rédigés dans les logs (redaction côté serveur). Jamais éditables via l'API (recette *_FILE).`,width:260})})]})}),p.length>0?(0,S.jsx)(K,{overrides:p}):(0,S.jsx)(s,{title:`Module en configuration par défaut`,summary:`Aucun réglage ne diffère du défaut du framework — rien n'est surchargé par l'app, l'environnement ni une édition à chaud. État sain (config stock).`,children:(0,S.jsx)(l,{variant:`light`,color:`gray`,tt:`none`,children:`aucune surcharge`})}),(0,S.jsx)(v,{module:e,schema:i,sections:a,editable:c,onEdit:u,focusKey:d,renderHelp:f})]})}var J=`Chaque réglage a une valeur d'usine. nodefony.config.ts ou une variable d'environnement peuvent la changer — cherche-le, ou regarde le coup d'œil.`,Y=`La configuration, c'est le tableau de bord de ton application : chaque réglage a une valeur d'usine (le défaut). Tu peux la changer dans le fichier nodefony.config.ts, ou sans toucher au code par une variable d'environnement — c'est elle qui a le dernier mot. Ici, tu vois pour chaque réglage la valeur qui s'applique vraiment, et qui l'a posée.`,X=`Chercher un réglage : port, session, redis, durée, NF_…`,Z={modules:`Chaque module (serveur HTTP, sécurité, base de données…) a ses propres réglages, comme chaque appareil a son mode d'emploi. Une boîte par module : combien de réglages tu as changés, et un clic pour tout voir.`,core:`Le noyau, c'est le châssis : le domaine et les ports d'écoute, les journaux, la liste ordonnée des modules chargés. Ces réglages s'écrivent à la racine de nodefony.config.ts, directement dans defineConfig({ … }).`,overrides:`Ce qui diffère de la valeur d'usine. C'est l'identité de ce déploiement : si l'application se comporte autrement que prévu, c'est presque toujours une ligne de cette liste. La colonne « Surchargé par » dit qui a changé la valeur.`},re={default:`la valeur d'usine — personne ne l'a changée`,module:`posée par le module lui-même`,app:`posée dans nodefony.config.ts`,env:`posée par une variable d'environnement, qui l'emporte sur le fichier`,runtime:`modifiée à chaud depuis cette console (perdue au redémarrage)`},ie=/^[A-Za-z_$][\w$]*$/;function ae(e){return e.split(`.`).reduceRight((e,t)=>`{ ${ie.test(t)?t:JSON.stringify(t)}: ${e} }`,`…`)}function oe(e,t,n){let r=ae(t);return n?`defineConfig(${r})`:`use("${e}", ${r})`}function Q({field:e,moduleName:t,isApp:n}){let r=e.env??e.recipe,i=[{label:`Valeur actuelle`,body:re[e.source??`default`]},{label:`Dans le code`,body:(0,S.jsxs)(S.Fragment,{children:[`Dans `,(0,S.jsx)(p,{children:`nodefony.config.ts`}),` :`,` `,(0,S.jsx)(p,{block:!0,style:{fontSize:11,marginTop:4},children:oe(t,e.key,n)})]})}];return r&&i.push({label:`Sans toucher au code`,body:(0,S.jsxs)(S.Fragment,{children:[`Poser `,(0,S.jsx)(p,{children:`${r}=…`}),` dans le fichier `,(0,S.jsx)(p,{children:`.env`}),` `,`du poste, ou chez l'hébergeur en production. La variable l'emporte sur le fichier.`]})}),i.push({label:`Quand c'est pris en compte`,body:e.mutability===`live`?`Tout de suite : modifiable directement dans cette console en développement, sans redémarrer.`:`Au prochain démarrage de l'application.`}),(e.type||typeof e.constraint==`string`)&&i.push({label:`Valeurs possibles`,body:(0,S.jsxs)(g,{size:`xs`,span:!0,children:[e.type?(0,S.jsx)(p,{children:e.type}):null,typeof e.constraint==`string`?` · ${e.constraint}`:``]})}),e.secret&&i.push({label:`Secret`,body:`Jamais affiché ici ni écrit dans les journaux. En production, la valeur passe de préférence par un fichier (variable suffixée _FILE).`}),e.reserved&&i.push({label:`Réservé`,body:`Pas encore lu par le code : le changer n'a aucun effet aujourd'hui.`}),i}function se(e){let{field:t}=e;return(0,S.jsx)(r,{title:`Comment changer ${t.key} ?`,summary:typeof t.description==`string`&&t.description?t.description:`Le schéma de ce module ne décrit pas ce réglage.`,sections:Q(e),width:400})}function $(e,t){let r=n(e,t);return typeof r==`string`?r:void 0}function ce(e){if(e instanceof b){let t=$(e.body,`message`)??$(e.body,`error`)??e.message,n=$(e.body,`recipe`);return n?`${t} — recette : ${n}`:t}return e instanceof Error?e.message:String(e)}export{J as a,q as c,I as d,Y as i,V as l,se as n,X as o,Q as r,Z as s,ce as t,B as u};
1
+ import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{$r as t,Bn as n,J as r,Jr as i,Kr as a,L as o,Sa as s,Z as c,_r as l,bi as u,en as d,g as f,ir as p,jr as m,mr as h,n as g,on as ee,pr as _,s as te,tr as v,yr as y}from"./ui-B4vXT8-w.js";import{O as b}from"./stores-BPQ3jvDo.js";var x=e(s(),1),S=u(),C=`•••••`,w=/secret|password|passwd|passphrase|privatekey|keysetjson|clientsecret|credential/i;function T(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function E(e){if(e.properties||T(e.additionalProperties))return e;if(Array.isArray(e.anyOf)){let t=e.anyOf.find(e=>e.properties??T(e.additionalProperties));if(t)return t}return null}function ne(e,t){if(!T(e))return null;let n=e;for(let e of t.split(`.`)){let t=E(n);if(!t)return null;let r=t.properties?.[e];if(r)n=r;else if(T(t.additionalProperties))n=t.additionalProperties;else return null}return n}function D(e){if(Array.isArray(e.enum))return`enum`;if(Array.isArray(e.anyOf)){let t=e.anyOf.map(e=>e.type===`null`?`null`:e.type===`array`?`array`:typeof e.type==`string`?e.type:`object`);return Array.from(new Set(t)).join(` | `)}return e.type===`array`?`array`:typeof e.type==`string`?e.type:`object`}function O(e){return e===null?`null`:Array.isArray(e)?`array`:typeof e}function k(e){let t=new Set,n=e=>{Array.isArray(e)?e.forEach(e=>t.add(e)):e&&t.add(e)};return n(e.type),Array.isArray(e.anyOf)&&e.anyOf.forEach(e=>n(e.type)),[...t]}function A(e){if(e?.runtimeMutable!==!0||e.secret===!0)return;if(Array.isArray(e.enum)){let t=e.enum.filter(e=>typeof e==`string`);return t.length?{kind:`select`,options:t,nullable:e.enum.includes(null)}:void 0}let t=k(e);if(t.includes(`array`)||t.includes(`object`))return;let n=t.includes(`null`);if(t.includes(`boolean`))return{kind:`switch`};if(t.includes(`integer`)||t.includes(`number`))return{kind:`number`,min:e.minimum,max:e.maximum,integer:t.includes(`integer`)&&!t.includes(`number`),nullable:n};if(t.includes(`string`))return{kind:`text`,nullable:n}}function j(e){if(Array.isArray(e.enum))return e.enum.map(e=>e===null?`null`:o(e)).join(` · `);let t=[];return typeof e.minimum==`number`&&t.push(`≥ ${e.minimum}`),typeof e.maximum==`number`&&t.push(`≤ ${e.maximum}`),t.length?t.join(` · `):void 0}function M(e,t,n){if(e===void 0)return;let r=Array.isArray(e)&&e.length===0,i=T(e)&&Object.keys(e).length===0;return(e===``||r||i)&&t?(0,S.jsx)(h,{style:{fontSize:12},children:`auto`}):e===null?(0,S.jsx)(h,{style:{fontSize:12},children:`null`}):r?(0,S.jsx)(h,{style:{fontSize:12},children:`(aucun)`}):i?(0,S.jsx)(h,{style:{fontSize:12},children:`{}`}):Array.isArray(e)||T(e)?(0,S.jsx)(f,{value:e,title:n}):typeof e==`string`?(0,S.jsx)(h,{style:{fontSize:12},children:e===``?`""`:JSON.stringify(e)}):(0,S.jsx)(h,{style:{fontSize:12},children:o(e)})}function N(e,t,n,r){let i=e.slice(e.lastIndexOf(`.`)+1),a=t?.secret===!0||w.test(i),o=a?void 0:A(t);return{key:e,type:t?D(t):O(n),constraint:t?j(t):void 0,defaultValue:t?M(t.default,t.kernelDerived,`${e} (défaut)`):void 0,description:t?.description,mutability:t?.runtimeMutable?`live`:`boot`,reserved:t?.reserved===!0,kernelDerived:t?.kernelDerived===!0,secret:a,source:r,env:typeof t?.env==`string`?t.env:void 0,editControl:o,editValue:o?n:void 0,effective:a?(0,S.jsx)(h,{style:{fontSize:12},children:C}):M(n,t?.kernelDerived,e)}}function P(e){let t=e?E(e):null;return!!(t?.properties&&Object.keys(t.properties).length>0)}function F(e,t,n,r){if(n.split(`.`).length>8)return;let i=t?E(t):null,a=new Set;if(i?.properties)for(let e of Object.keys(i.properties))a.add(e);if(T(e))for(let t of Object.keys(e))a.add(t);for(let t of a){let a=n?`${n}.${t}`:t,o=T(e)?e[t]:void 0,s=i?.properties?.[t]??(T(i?.additionalProperties)?i.additionalProperties:null);P(s)||T(o)&&Object.keys(o).length>0?F(o,s,a,r):r.push({path:a,node:s,value:o})}}function I(e,t,n){let r=T(e)?e:null,i=[];F(t,r,``,i);let a=[],o=new Map;for(let{path:e,node:t,value:r}of i){let i=N(e,t,r,n?.[e]),s=e.indexOf(`.`);if(s===-1)a.push(i);else{let t=e.slice(0,s),n=o.get(t);n?n.push(i):o.set(t,[i])}}let s=[];a.length&&s.push({title:`Général`,fields:a});for(let[t,n]of o){let r=ne(e,t);s.push({title:t,description:r?.description,fields:n})}return s}function L(e,t){return`NF__${e.toUpperCase()}__${t.replace(/\./g,`__`).toUpperCase()}`}function R(e,t,n){return n===`env`?e.envKeys[t.toLowerCase()]??L(e.seg,t):e.overriddenBy[t]??`nodefony.config.ts`}function z(e,t,n){let r=[];for(let i of e)for(let e of i.fields){let i=e.source;if(i!==`app`&&i!==`env`&&i!==`runtime`)continue;let a=L(t,e.key);r.push({field:e.key,source:i,secret:!!e.secret,overrideKey:a,where:i===`runtime`?`édité à chaud (runtime)`:n?n(e.key,i):a})}return r}function B(e,t){return e.map(e=>({...e,fields:e.fields.map(e=>e.reserved?e:{...e,recipe:e.recipe??L(t,e.key)})}))}function V(e){let t=[],n=[],r={moduleCount:0,fieldCount:0,byProvenance:{default:0,app:0,env:0},secrets:0,live:0},i=[...e].sort((e,t)=>e.isApp===t.isApp?e.name.localeCompare(t.name):e.isApp?-1:1);for(let e of i){let i=I(e.configSchema,e.config,e.provenance);if(i.length===0)continue;let a=B(i,e.seg);t.push({entry:e,sections:a,schemaStatus:e.configSchema?`zod`:`none`});for(let t of a)for(let i of t.fields){r.fieldCount++;let t=i.source??`default`;t===`app`?r.byProvenance.app++:t===`env`?r.byProvenance.env++:r.byProvenance.default++,i.secret&&r.secrets++,i.mutability===`live`&&r.live++,(t===`app`||t===`env`)&&n.push({module:e.name,moduleKey:e.key,field:i.key,source:t,secret:!!i.secret,overrideKey:L(e.seg,i.key),where:R(e,i.key,t)})}}return r.moduleCount=t.length,{modules:t,overrides:n,stats:r}}var H={app:{label:`app`,color:`grape`},env:{label:`env`,color:`teal`},runtime:{label:`runtime`,color:`cyan`}};function U({value:e,label:t,hint:n,color:r}){return(0,S.jsxs)(a,{gap:8,wrap:`nowrap`,children:[(0,S.jsx)(m,{fz:22,fw:700,lh:1,c:e>0?r:`dimmed`,children:e}),(0,S.jsxs)(a,{gap:4,wrap:`nowrap`,children:[(0,S.jsx)(m,{size:`xs`,c:`dimmed`,tt:`uppercase`,fw:700,children:t}),n]})]})}function W({value:e}){return(0,S.jsxs)(a,{gap:4,wrap:`nowrap`,children:[(0,S.jsx)(h,{style:{fontSize:11},children:e}),(0,S.jsx)(_,{value:e,timeout:1500,children:({copied:t,copy:n})=>(0,S.jsx)(p,{label:t?`Copié`:`Copier`,withArrow:!0,children:(0,S.jsx)(i,{size:`sm`,variant:`subtle`,color:t?`teal`:`gray`,"aria-label":`Copier ${e}`,onClick:n,children:t?(0,S.jsx)(ee,{size:14}):(0,S.jsx)(d,{size:14})})})})]})}var G=[{key:`field`,header:`Réglage`,sortable:!0,filterable:!0,value:e=>e.field,render:e=>(0,S.jsx)(h,{style:{fontSize:12},children:e.field})},{key:`source`,header:`Provenance`,sortable:!0,filterable:!0,filterType:`select`,filterOptions:Object.keys(H),value:e=>e.source,render:e=>(0,S.jsx)(y,{size:`sm`,variant:`light`,color:H[e.source].color,tt:`none`,children:H[e.source].label}),size:130},{key:`where`,header:`Surchargé par / recette`,sortable:!0,filterable:!0,value:e=>e.where,render:e=>e.source===`runtime`?(0,S.jsx)(m,{size:`xs`,c:`dimmed`,children:e.where}):(0,S.jsx)(W,{value:e.overrideKey})}];function K({overrides:e}){return(0,S.jsxs)(t,{withBorder:!0,p:`md`,radius:`md`,children:[(0,S.jsxs)(a,{gap:6,mb:`sm`,children:[(0,S.jsx)(m,{fw:600,size:`sm`,children:`Surcharges actives`}),(0,S.jsxs)(m,{size:`xs`,c:`dimmed`,children:[e.length,` réglage(s) ≠ défaut`]}),(0,S.jsx)(r,{title:`Surcharges actives`,summary:`Les réglages de ce module qui DIFFÈRENT du défaut du framework — d'où vient la valeur (app/env/runtime) et la recette 12-factor pour la piloter. C'est l'identité de ce module dans CE déploiement.`})]}),(0,S.jsx)(g,{mode:`client`,data:e,columns:G,getRowId:e=>e.field,initialSort:{key:`field`,dir:`asc`},searchable:!0,searchPlaceholder:`Rechercher un réglage…`,emptyMessage:`Aucune surcharge : ce module tourne entièrement sur les défauts du framework.`})]})}function q({module:e,seg:t,schema:n,sections:i,editable:o=!1,onEdit:s,focusKey:u,renderHelp:d}){let f=(0,x.useMemo)(()=>z(i,t),[i,t]),{live:p,secrets:m}=(0,x.useMemo)(()=>{let e=0,t=0;for(let n of i)for(let r of n.fields)r.mutability===`live`&&e++,r.secret&&t++;return{live:e,secrets:t}},[i]);return(0,S.jsxs)(v,{gap:`lg`,children:[(0,S.jsx)(l,{withBorder:!0,radius:`md`,p:`md`,children:(0,S.jsxs)(a,{gap:`xl`,wrap:`wrap`,children:[(0,S.jsx)(U,{value:f.length,label:`Surcharges`,color:`grape`,hint:(0,S.jsx)(r,{title:`Surcharges`,summary:`Réglages dont la valeur effective diffère du défaut du framework (app, env, ou édition à chaud). 0 = ce module tourne en config stock.`,width:260})}),(0,S.jsx)(U,{value:p,label:`À chaud (dev)`,color:`teal`,hint:(0,S.jsx)(r,{title:`Éditables à chaud`,summary:`Réglages relus à chaque requête (ou recalculés via un seam) : modifiables en développement sans redémarrage, figés en production.`,width:280})}),(0,S.jsx)(U,{value:m,label:`Secrets`,color:`orange`,hint:(0,S.jsx)(r,{title:`Secrets`,summary:`Champs sensibles masqués ici et rédigés dans les logs (redaction côté serveur). Jamais éditables via l'API (recette *_FILE).`,width:260})})]})}),f.length>0?(0,S.jsx)(K,{overrides:f}):(0,S.jsx)(c,{title:`Module en configuration par défaut`,summary:`Aucun réglage ne diffère du défaut du framework — rien n'est surchargé par l'app, l'environnement ni une édition à chaud. État sain (config stock).`,children:(0,S.jsx)(y,{variant:`light`,color:`gray`,tt:`none`,children:`aucune surcharge`})}),(0,S.jsx)(te,{module:e,schema:n,sections:i,editable:o,onEdit:s,focusKey:u,renderHelp:d})]})}var J=`Chaque réglage a une valeur d'usine. nodefony.config.ts ou une variable d'environnement peuvent la changer — cherche-le, ou regarde le coup d'œil.`,Y=`La configuration, c'est le tableau de bord de ton application : chaque réglage a une valeur d'usine (le défaut). Tu peux la changer dans le fichier nodefony.config.ts, ou sans toucher au code par une variable d'environnement — c'est elle qui a le dernier mot. Ici, tu vois pour chaque réglage la valeur qui s'applique vraiment, et qui l'a posée.`,X=`Chercher un réglage : port, session, redis, durée, NF_…`,Z={modules:`Chaque module (serveur HTTP, sécurité, base de données…) a ses propres réglages, comme chaque appareil a son mode d'emploi. Une boîte par module : combien de réglages tu as changés, et un clic pour tout voir.`,core:`Le noyau, c'est le châssis : le domaine et les ports d'écoute, les journaux, la liste ordonnée des modules chargés. Ces réglages s'écrivent à la racine de nodefony.config.ts, directement dans defineConfig({ … }).`,overrides:`Ce qui diffère de la valeur d'usine. C'est l'identité de ce déploiement : si l'application se comporte autrement que prévu, c'est presque toujours une ligne de cette liste. La colonne « Surchargé par » dit qui a changé la valeur.`},re={default:`la valeur d'usine — personne ne l'a changée`,module:`posée par le module lui-même`,app:`posée dans nodefony.config.ts`,env:`posée par une variable d'environnement, qui l'emporte sur le fichier`,runtime:`modifiée à chaud depuis cette console (perdue au redémarrage)`},ie=/^[A-Za-z_$][\w$]*$/;function ae(e){return e.split(`.`).reduceRight((e,t)=>`{ ${ie.test(t)?t:JSON.stringify(t)}: ${e} }`,`…`)}function oe(e,t,n){let r=ae(t);return n?`defineConfig(${r})`:`use("${e}", ${r})`}function Q({field:e,moduleName:t,isApp:n}){let r=e.env??e.recipe,i=[{label:`Valeur actuelle`,body:re[e.source??`default`]},{label:`Dans le code`,body:(0,S.jsxs)(S.Fragment,{children:[`Dans `,(0,S.jsx)(h,{children:`nodefony.config.ts`}),` :`,` `,(0,S.jsx)(h,{block:!0,style:{fontSize:11,marginTop:4},children:oe(t,e.key,n)})]})}];return r&&i.push({label:`Sans toucher au code`,body:(0,S.jsxs)(S.Fragment,{children:[`Poser `,(0,S.jsx)(h,{children:`${r}=…`}),` dans le fichier `,(0,S.jsx)(h,{children:`.env`}),` `,`du poste, ou chez l'hébergeur en production. La variable l'emporte sur le fichier.`]})}),i.push({label:`Quand c'est pris en compte`,body:e.mutability===`live`?`Tout de suite : modifiable directement dans cette console en développement, sans redémarrer.`:`Au prochain démarrage de l'application.`}),(e.type||typeof e.constraint==`string`)&&i.push({label:`Valeurs possibles`,body:(0,S.jsxs)(m,{size:`xs`,span:!0,children:[e.type?(0,S.jsx)(h,{children:e.type}):null,typeof e.constraint==`string`?` · ${e.constraint}`:``]})}),e.secret&&i.push({label:`Secret`,body:`Jamais affiché ici ni écrit dans les journaux. En production, la valeur passe de préférence par un fichier (variable suffixée _FILE).`}),e.reserved&&i.push({label:`Réservé`,body:`Pas encore lu par le code : le changer n'a aucun effet aujourd'hui.`}),i}function se(e){let{field:t}=e;return(0,S.jsx)(r,{title:`Comment changer ${t.key} ?`,summary:typeof t.description==`string`&&t.description?t.description:`Le schéma de ce module ne décrit pas ce réglage.`,sections:Q(e),width:400})}function $(e,t){let r=n(e,t);return typeof r==`string`?r:void 0}function ce(e){if(e instanceof b){let t=$(e.body,`message`)??$(e.body,`error`)??e.message,n=$(e.body,`recipe`);return n?`${t} — recette : ${n}`:t}return e instanceof Error?e.message:String(e)}export{J as a,q as c,I as d,Y as i,V as l,se as n,X as o,Q as r,Z as s,ce as t,B as u};
@@ -1 +1 @@
1
- import{gn as e}from"./ui-BE5Z8gxu.js";import{O as t,k as n}from"./logFormat-CcEvsf9s.js";var r=e(`outline`,`route-2`,`Route2`,[[`path`,{d:`M3 19a2 2 0 1 0 4 0a2 2 0 0 0 -4 0`,key:`svg-0`}],[`path`,{d:`M19 7a2 2 0 1 0 0 -4a2 2 0 0 0 0 4`,key:`svg-1`}],[`path`,{d:`M14 5a2 2 0 0 0 -2 2v10a2 2 0 0 1 -2 2`,key:`svg-2`}]]),i=e(`outline`,`timeline`,`Timeline`,[[`path`,{d:`M4 16l6 -7l5 5l5 -6`,key:`svg-0`}],[`path`,{d:`M14 14a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-1`}],[`path`,{d:`M9 9a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-2`}],[`path`,{d:`M3 16a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-3`}],[`path`,{d:`M19 8a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-4`}]]),a={"request-in":{label:`Requête entrante`,color:`blue`,event:`onRequest (contexte)`,meaning:`Le contexte HTTP démarre le traitement de la requête.`},"body-received":{label:`Corps reçu`,color:`gray`,event:`onRequestEnd`,meaning:`Le corps de la requête est entièrement lu. Pour un GET (sans corps), ça arrive tout de suite → l'un des PREMIERS events, malgré le mot « End ».`},"route-matched":{label:`Route trouvée`,color:`blue`,event:`Match route`,meaning:`Le routeur a associé l'URL à un controller + une action.`},"kernel-dispatch":{label:`Dispatch kernel`,color:`blue`,event:`onRequest (KERNEL)`,meaning:`Le kernel passe la main au pipeline (firewall, controller…).`},session:{label:`Session`,color:`grape`,event:`NEW/MIGRATE/DESTROY SESSION, onSessionStart`,meaning:`Une session est créée, rouverte, migrée ou détruite pour cette requête (HTTP ou WS).`},response:{label:`Réponse envoyée`,color:`teal`,event:`onSend / ADD COOKIE`,meaning:`Les octets de réponse partent vers le client (cookies posés au passage).`},"session-saved":{label:`Session enregistrée`,color:`grape`,event:`onSaveSession / SAVE SESSION`,meaning:`L'état de session modifié est persisté avant la réponse.`},"request-end":{label:`Bilan requête`,color:`indigo`,event:`req`,meaning:`Ligne récapitulative de fin : méthode, statut, durée, IP, requestId. En WebSocket = fin du handshake.`},finish:{label:`Requête terminée`,color:`gray`,event:`onFinish`,meaning:`Nettoyage post-réponse (hooks onAfterResponse). Vraie fin du cycle.`},"ws-open":{label:`Connexion ouverte`,color:`teal`,event:`onConnect / client connected`,meaning:`Le handshake WebSocket est accepté — la socket est vivante.`},"ws-message":{label:`Message reçu`,color:`cyan`,event:`onMessage / subscribe`,meaning:`Une frame entrante au fil de l'eau (message applicatif, abonnement à un canal, ping…).`},"ws-close":{label:`Connexion fermée`,color:`gray`,event:`onClose`,meaning:`Le socket WebSocket se ferme.`}};function o(e){let r=n(e);if(!r)return null;let i=a[r];return{label:i.label,color:i.color,order:t[r].order}}function s(e){let n=Object.keys(a).filter(n=>{let r=t[n].protocol;return e===`all`||r===e||r===`both`}),r={http:0,both:1,ws:2};return n.sort((e,n)=>{let i=t[e].protocol,a=t[n].protocol;return i===a?t[e].order-t[n].order:r[i]-r[a]})}var c={http:`HTTP`,both:`Commun (session)`,ws:`WebSocket`};function l(e){let n=s(e),r=[];for(let e of[`http`,`both`,`ws`]){let i=n.filter(n=>t[n].protocol===e).map(e=>({value:e,label:a[e].label}));i.length&&r.push({group:c[e],items:i})}return r}var u=s(`all`).map(e=>({id:e,protocol:t[e].protocol,event:a[e].event,label:a[e].label,meaning:a[e].meaning}));export{i as a,s as i,o as n,r as o,l as r,u as t};
1
+ import{gn as e}from"./ui-B4vXT8-w.js";import{O as t,k as n}from"./logFormat-Bk36BvWi.js";var r=e(`outline`,`route-2`,`Route2`,[[`path`,{d:`M3 19a2 2 0 1 0 4 0a2 2 0 0 0 -4 0`,key:`svg-0`}],[`path`,{d:`M19 7a2 2 0 1 0 0 -4a2 2 0 0 0 0 4`,key:`svg-1`}],[`path`,{d:`M14 5a2 2 0 0 0 -2 2v10a2 2 0 0 1 -2 2`,key:`svg-2`}]]),i=e(`outline`,`timeline`,`Timeline`,[[`path`,{d:`M4 16l6 -7l5 5l5 -6`,key:`svg-0`}],[`path`,{d:`M14 14a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-1`}],[`path`,{d:`M9 9a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-2`}],[`path`,{d:`M3 16a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-3`}],[`path`,{d:`M19 8a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-4`}]]),a={"request-in":{label:`Requête entrante`,color:`blue`,event:`onRequest (contexte)`,meaning:`Le contexte HTTP démarre le traitement de la requête.`},"body-received":{label:`Corps reçu`,color:`gray`,event:`onRequestEnd`,meaning:`Le corps de la requête est entièrement lu. Pour un GET (sans corps), ça arrive tout de suite → l'un des PREMIERS events, malgré le mot « End ».`},"route-matched":{label:`Route trouvée`,color:`blue`,event:`Match route`,meaning:`Le routeur a associé l'URL à un controller + une action.`},"kernel-dispatch":{label:`Dispatch kernel`,color:`blue`,event:`onRequest (KERNEL)`,meaning:`Le kernel passe la main au pipeline (firewall, controller…).`},session:{label:`Session`,color:`grape`,event:`NEW/MIGRATE/DESTROY SESSION, onSessionStart`,meaning:`Une session est créée, rouverte, migrée ou détruite pour cette requête (HTTP ou WS).`},response:{label:`Réponse envoyée`,color:`teal`,event:`onSend / ADD COOKIE`,meaning:`Les octets de réponse partent vers le client (cookies posés au passage).`},"session-saved":{label:`Session enregistrée`,color:`grape`,event:`onSaveSession / SAVE SESSION`,meaning:`L'état de session modifié est persisté avant la réponse.`},"request-end":{label:`Bilan requête`,color:`indigo`,event:`req`,meaning:`Ligne récapitulative de fin : méthode, statut, durée, IP, requestId. En WebSocket = fin du handshake.`},finish:{label:`Requête terminée`,color:`gray`,event:`onFinish`,meaning:`Nettoyage post-réponse (hooks onAfterResponse). Vraie fin du cycle.`},"ws-open":{label:`Connexion ouverte`,color:`teal`,event:`onConnect / client connected`,meaning:`Le handshake WebSocket est accepté — la socket est vivante.`},"ws-message":{label:`Message reçu`,color:`cyan`,event:`onMessage / subscribe`,meaning:`Une frame entrante au fil de l'eau (message applicatif, abonnement à un canal, ping…).`},"ws-close":{label:`Connexion fermée`,color:`gray`,event:`onClose`,meaning:`Le socket WebSocket se ferme.`}};function o(e){let r=n(e);if(!r)return null;let i=a[r];return{label:i.label,color:i.color,order:t[r].order}}function s(e){let n=Object.keys(a).filter(n=>{let r=t[n].protocol;return e===`all`||r===e||r===`both`}),r={http:0,both:1,ws:2};return n.sort((e,n)=>{let i=t[e].protocol,a=t[n].protocol;return i===a?t[e].order-t[n].order:r[i]-r[a]})}var c={http:`HTTP`,both:`Commun (session)`,ws:`WebSocket`};function l(e){let n=s(e),r=[];for(let e of[`http`,`both`,`ws`]){let i=n.filter(n=>t[n].protocol===e).map(e=>({value:e,label:a[e].label}));i.length&&r.push({group:c[e],items:i})}return r}var u=s(`all`).map(e=>({id:e,protocol:t[e].protocol,event:a[e].event,label:a[e].label,meaning:a[e].meaning}));export{i as a,s as i,o as n,r as o,l as r,u as t};
@@ -1 +1 @@
1
- import{It as e,Nt as t,zt as n}from"./ui-BE5Z8gxu.js";var r=`nf.supervision.weights`,i={CPU:1,"Saturation (ELU)":1.5,"Event-loop":1.5,"Mémoire (heap)":1,"GC overhead":.8,Erreurs:1.2,Connecteurs:1,"Temps réel":.5};function a(e,t){let n=i;return e[t]??n[t]??1}function o(e,t,n){return n<=t?+(e<=t):e<=t?1:e>=n?0:(n-e)/(n-t)}function s(e){let t=e.filter(e=>e.value!=null&&e.weight>0);if(!t.length)return{score:null,label:`—`,color:`gray`,worst:null,parts:[]};let n=!1,r=0,i=0,a=null,s=2,c=[];for(let e of t){let t=o(e.value,e.good,e.crit),l=Math.max(t,e.floor??0);c.push({label:e.label,score:Math.round(l*100),weight:e.weight,kind:e.critical?`fail`:`sat`}),l<s&&(s=l,a=e),e.critical&&t<=0&&(n=!0),r+=e.weight,i+=e.weight*Math.log(Math.max(l,1e-9))}let l=n?0:Math.exp(i/r),u=Math.round(l*100),[d,f]=u>=90?[`Excellent`,`teal`]:u>=75?[`Bon`,`green`]:u>=50?[`À surveiller`,`yellow`]:u>=25?[`Dégradé`,`orange`]:[`Critique`,`red`];return{score:u,label:d,color:f,worst:a?.label??null,parts:c}}function c(){let a=n(t(`local`,r),t=>e(t)&&t>=0);return{...i,...a}}export{a,c as i,r as n,s as r,i as t};
1
+ import{It as e,Nt as t,zt as n}from"./ui-B4vXT8-w.js";var r=`nf.supervision.weights`,i={CPU:1,"Saturation (ELU)":1.5,"Event-loop":1.5,"Mémoire (heap)":1,"GC overhead":.8,Erreurs:1.2,Connecteurs:1,"Temps réel":.5};function a(e,t){let n=i;return e[t]??n[t]??1}function o(e,t,n){return n<=t?+(e<=t):e<=t?1:e>=n?0:(n-e)/(n-t)}function s(e){let t=e.filter(e=>e.value!=null&&e.weight>0);if(!t.length)return{score:null,label:`—`,color:`gray`,worst:null,parts:[]};let n=!1,r=0,i=0,a=null,s=2,c=[];for(let e of t){let t=o(e.value,e.good,e.crit),l=Math.max(t,e.floor??0);c.push({label:e.label,score:Math.round(l*100),weight:e.weight,kind:e.critical?`fail`:`sat`}),l<s&&(s=l,a=e),e.critical&&t<=0&&(n=!0),r+=e.weight,i+=e.weight*Math.log(Math.max(l,1e-9))}let l=n?0:Math.exp(i/r),u=Math.round(l*100),[d,f]=u>=90?[`Excellent`,`teal`]:u>=75?[`Bon`,`green`]:u>=50?[`À surveiller`,`yellow`]:u>=25?[`Dégradé`,`orange`]:[`Critique`,`red`];return{score:u,label:d,color:f,worst:a?.label??null,parts:c}}function c(){let a=n(t(`local`,r),t=>e(t)&&t>=0);return{...i,...a}}export{a,c as i,r as n,s as r,i as t};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{ba as t}from"./ui-BE5Z8gxu.js";var n=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,r=/^[\\/]{2}/;function i(e,t){return t+e.replace(/\\/g,`/`)}var a=`popstate`;function o(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function s(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return f(``,{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:p(t)}return h(t,n,null,e)}function c(e,t){if(e===!1||e==null)throw Error(t)}function l(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function u(){return Math.random().toString(36).substring(2,10)}function d(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 f(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?m(t):t,state:n,key:t&&t.key||r||u(),mask:i}}function p({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 m(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 h(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,c=i.history,l=`POP`,u=null,p=m();p??(p=0,c.replaceState({...c.state,idx:p},``));function m(){return(c.state||{idx:null}).idx}function h(){l=`POP`;let e=m(),t=e==null?null:e-p;p=e,u&&u({action:l,location:b.location,delta:t})}function _(e,t){l=`PUSH`;let r=o(e)?e:f(b.location,e,t);n&&n(r,e),p=m()+1;let a=d(r,p),h=b.createHref(r.mask||r);try{c.pushState(a,``,h)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(h)}s&&u&&u({action:l,location:b.location,delta:1})}function v(e,t){l=`REPLACE`;let r=o(e)?e:f(b.location,e,t);n&&n(r,e),p=m();let i=d(r,p),a=b.createHref(r.mask||r);c.replaceState(i,``,a),s&&u&&u({action:l,location:b.location,delta:0})}function y(e){return g(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(a,h),u=e,()=>{i.removeEventListener(a,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:_,replace:v,go(e){return c.go(e)}};return b}function g(e,t,n=!1){let i=`http://localhost`;e&&(i=e.location.origin===`null`?e.location.href:e.location.origin),c(i,`No window.location.(origin|href) available to create URL`);let a=typeof t==`string`?t:p(t);return a=a.replace(/ $/,`%20`),!n&&r.test(a)&&(a=i+a),new URL(a,i)}var _=e(t(),1),v=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)}},y=class extends Error{},b=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`,`unstable_validateParams`]);function x(e){return b.has(e)}var S=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`,`unstable_validateParams`]);function C(e){return S.has(e)}function w(e){return e.index===!0}function T(e){let t={};return e.Component&&Object.assign(t,{element:_.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:_.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:_.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function E(e,t=T,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(c(e.index!==!0||!e.children,`Cannot specify children on an index route`),c(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),w(e)){let n={...e,id:s};return r[s]=D(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=D(n,t(n)),e.children&&(n.children=E(e.children,t,o,r,i)),n}})}function D(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function O(e,t,n=`/`){return ee(e,t,n,!1)}function ee(e,t,n,r,i){let a=le((typeof t==`string`?m(t):t).pathname||`/`,n);if(a==null)return null;let o=i??te(e),s=null,c=ce(a);for(let e=0;s==null&&e<o.length;++e)s=B(o[e],c,r);return s}function k(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 te(e){let t=A(e);return M(t),t}function A(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let l={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(l.relativePath.startsWith(`/`)){if(!l.relativePath.startsWith(r)&&o)return;c(l.relativePath.startsWith(r),`Absolute route path "${l.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),l.relativePath=l.relativePath.slice(r.length)}let u=K([r,l.relativePath]),d=n.concat(l);e.children&&e.children.length>0&&(c(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),A(e.children,t,d,u,o)),(e.path!=null||e.index)&&t.push({path:u,score:ie(u,e.index),routesMeta:d.map((e,t)=>{let[n,r]=se(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 j(e.path))a(e,t,!0,n)}),t}function j(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=j(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 M(e){e.sort((e,t)=>e.score===t.score?ae(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var N=/^:[\w-]+$/,P=/^:[\w-]+/,ne=3.5,F=3,I=2,L=1,R=10,z=-2,re=e=>e===`*`;function ie(e,t){let n=e.split(`/`),r=n.length;return n.some(re)&&(r+=z),t&&(r+=I),n.filter(e=>!re(e)).reduce((e,t)=>e+(N.test(t)?F:P.test(t)?ne:t===``?L:R),r)}function ae(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 B(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?V(u,l,s.matcher,s.compiledParams):oe(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=oe({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:K([a,d.pathname]),pathnameBase:ge(K([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=K([a,d.pathnameBase]))}return o}function oe(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=se(e.path,e.caseSensitive,e.end);return V(e,t,n,r)}function V(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=he(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=he(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function se(e,t=!1,n=!0){l(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(/\/((?:[^/?()[\]*^\\]|\\.)+)\?(?=\/|$|\()/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 ce(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return l(!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 le(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 H({basename:e,pathname:t}){return t===`/`?e:K([e,t])}var ue=e=>n.test(e);function de(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?m(e):e,a;return n?(n=me(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?U(n.substring(1),`/`):U(n,t)):a=t,{pathname:a,search:q(r),hash:_e(i)}}function U(e,t){let n=he(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function fe(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 W(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function G(e){let t=W(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function pe(e,t,n,r=!1){let i;typeof e==`string`?i=m(e):(i={...e},c(!i.pathname||!i.pathname.includes(`?`),fe(`?`,`pathname`,`search`,i)),c(!i.pathname||!i.pathname.includes(`#`),fe(`#`,`pathname`,`hash`,i)),c(!i.search||!i.search.includes(`#`),fe(`#`,`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 l=de(i,s),u=o&&o!==`/`&&o.endsWith(`/`),d=(a||o===`.`)&&n.endsWith(`/`);return!l.pathname.endsWith(`/`)&&(u||d)&&(l.pathname+=`/`),l}var me=e=>e.replace(/[\\/]{2,}/g,`/`),K=e=>me(e.join(`/`));function he(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var ge=e=>he(e).replace(/^\/*/,`/`),q=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,_e=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,ve=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],ye=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 be(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function xe(e){return K(e.map(e=>e.route.path).filter(Boolean))||`/`}function Se(e,t){let n=new URL(typeof e==`string`||e instanceof URL?e:e.url),r=typeof t==`string`?m(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 Ce=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function we(e,t){let a=e;if(typeof a!=`string`||!n.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let o=a,s=!1;if(Ce)try{let e=new URL(window.location.href),n=r.test(a)?new URL(i(a,e.protocol)):new URL(a),o=le(n.pathname,t);n.origin===e.origin&&o!=null?a=o+n.search+n.hash:s=!0}catch{l(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:s,to:a}}var Te=Symbol(`Uninstrumented`),Ee=new WeakMap;function De(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)=>Ne(await J(n.lazy,void 0,()=>e(...t),Y))}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)=>Ne(await J(n[`lazy.middleware`],void 0,()=>t(...e),Y))})}if(typeof e.loader==`function`&&n[`lazy.loader`].length>0){let t=e.loader;r.lazy=Object.assign(r.lazy||{},{loader:async(...e)=>Ne(await J(n[`lazy.loader`],void 0,()=>t(...e),Y))})}if(typeof e.action==`function`&&n[`lazy.action`].length>0){let t=e.action;r.lazy=Object.assign(r.lazy||{},{action:async(...e)=>Ne(await J(n[`lazy.action`],void 0,()=>t(...e),Y))})}}if(typeof t.loader==`function`&&n.loader.length>0){let e=ke(t.loader),i=async(...t)=>Ne(await J(n.loader,Pe(t[0]),()=>e(...t),Y));e.hydrate===!0&&(i.hydrate=!0),Ae(i,e),r.loader=i}if(typeof t.action==`function`&&n.action.length>0){let e=ke(t.action),i=async(...t)=>Ne(await J(n.action,Pe(t[0]),()=>e(...t),Y));Ae(i,e),r.action=i}return t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=ke(e),r=async(...e)=>Ne(await J(n.middleware,Pe(e[0]),()=>t(...e),Y));return Ae(r,t),r})),r}function Oe(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=ke(e.navigate),r=async(...r)=>{let[i,a]=r,o,s={to:typeof i==`number`||typeof i==`string`?i:i?p(i):`.`,...Fe(e,a??{})};return Ne(await J(n.navigate,s,async()=>{if(typeof i==`number`)return await t(...r);let n=je(e,e=>{o=e});try{return await t(...r)}finally{n()}},e=>({...Y(e),meta:o})))};Ae(r,t),e.navigate=r}if(n.fetch.length>0){let t=ke(e.fetch),r=async(...r)=>{let[i,a,o,s]=r,c;return Ne(await J(n.fetch,{href:o??`.`,fetcherKey:i,...Fe(e,s??{})},async()=>{let n=je(e,e=>{c=e});try{return await t(...r)}finally{n()}},e=>({...Y(e),meta:c})))};Ae(r,t),e.fetch=r}return e}function ke(e){return e[Te]??e}function Ae(e,t){e[Te]=t}function je(e,t){return Ee.set(e,t),()=>{Ee.get(e)===t&&Ee.delete(e)}}function Me(e){let t=Ee.get(e);return Ee.delete(e),t}function Ne(e){if(e.type===`error`)throw e.value;return e.value}async function J(e,t,n,r,i={result:null,innerResult:null},a=e.length-1){let o=e[a];if(o){let s,l=async()=>(s?console.error(`You cannot call instrumented handlers more than once`):s=J(e,t,n,r,i,a-1),await s,c(i.innerResult,`Expected an inner result`),i.innerResult);try{await o(l,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}s||await l(),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={type:`error`,value:Error(`No result assigned in instrumentation chain.`)},i.innerResult=r(i.result,t)),i.result}function Y(e){return e.type===`error`&&e.value instanceof Error?{status:`error`,error:e.value}:{status:`success`,error:void 0}}function Pe(e){let{request:t,context:n,params:r}=e;return{...e,request:Ie(t),params:{...r},context:Le(n)}}function Fe(e,t){return{currentUrl:p(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 Ie(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Le(e){return{get:t=>e.get(t)}}var Re=class{#e=[];#t=[];#n;#r=0;constructor(e){this.#n=e}update(e){this.#e=e,this.#t=te(e),this.#r=this.#t.reduce((e,t)=>e+t.routesMeta.length,0)}get matchCost(){return this.#r}match(e,t=!1){return ee(this.#e,e,this.#n,t,this.#t)}},ze=new URL(`http://localhost`);function Be(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),ze)}catch{return ze}}function Ve(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function He(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function Ue(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Ve(i,n),s=!Ve(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!He(e,i)||!Ve(i,a)))throw Error(`External navigation is not allowed`)}var We=[`POST`,`PUT`,`PATCH`,`DELETE`],Ge=new Set(We),Ke=[`GET`,...We],qe=new Set(Ke),Je=new Set([301,302,303,307,308]),Ye=new Set([307,308]),Xe={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},Ze={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Qe={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},$e=`remix-router-transitions`,et=Symbol(`ResetLoaderData`);function tt(e,t){return e.unstable_routePatternMatching?(c(void 0,`You must call unstable_preloadRoutePattern() from "react-router/route-pattern" before enabling future.unstable_routePatternMatching.`),new(void 0)(t)):new Re(t)}var nt=class{#e;#t;#n;constructor(e,t){this.#e=e,this.#n=t,this.#n.update(e)}get stableRoutes(){return this.#e}get activeRoutes(){return this.#t??this.#e}get hasHMRRoutes(){return this.#t!=null}setRoutes(e){this.#e=e,this.#t||this.#n.update(e)}setHmrRoutes(e){this.#t=e,this.#n.update(e)}commitHmrRoutes(){this.#t&&(this.#e=this.#t,this.#t=void 0,this.#n.update(this.#e))}},rt=new WeakMap;function it(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;c(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let i=e.hydrationRouteProperties||[],a=e.mapRouteProperties,o=a||(()=>({}));if(e.instrumentations){let t=e.instrumentations;o=e=>({...a?.(e),...De(t.map(e=>e.route).filter(Boolean),e)})}let s={...e.future},u=e.basename||`/`;u.startsWith(`/`)||(u=`/${u}`);let d=tt(s,u),h={},_=new nt(E(e.routes,o,void 0,h),d),b=e.dataStrategy||xt,x=null,S=new Set,C=null,w=null,T=null,D=e.hydrationData!=null,O=d.match(e.history.location),ee=!1,te=null,A,j;if(O==null&&!e.patchRoutesOnNavigation){let t=X(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Wt(_.activeRoutes);A=!0,j=!A,O=n,te={[r.id]:t}}else if(O&&!e.hydrationData&&ht(O,e.history.location.pathname).active&&(O=null),!O){A=!1,j=!A,O=[];let t=ht(null,e.history.location.pathname);t.active&&t.matches&&(ee=!0,O=t.matches)}else if(O.some(e=>e.route.lazy))A=!1,j=!A;else if(!O.some(e=>lt(e.route)))A=!0,j=!A;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=O;if(n){let e=O.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}j=!1,A=!0,r.forEach(e=>{let r=ut(e.route,t,n);j||=r.renderFallback,A&&=!r.shouldLoad})}let M,N={historyAction:e.history.action,location:e.history.location,matches:O,initialized:A,renderFallback:j,navigation:Xe,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||te,fetchers:new Map,blockers:new Map},P=`POP`,ne=0,F,I=null,L=!1,R,z=!1,re=new Map,ie=null,ae=!1,B=!1,oe=new Set,V=new Map,se=0,ce=-1,H=new Map,de=new Set,U=new Map,fe=new Map,W=new Set,G=new Map,pe,me=null;function K(){if(x=e.history.listen(({action:t,location:n,delta:r})=>{if(pe){pe(),pe=void 0;return}l(G.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=et({currentLocation:N.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{pe=e});e.history.go(r*-1),$e(i,{state:`blocked`,location:n,proceed(){$e(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(N.blockers);e.set(i,Qe),q({blockers:e})}}),I?.resolve(),I=null}else return s.unstable_customRouteDiscovery&&(ne+=r||0),Se(t,n)}),n){pn(t,re);let e=()=>mn(t,re);t.addEventListener(`pagehide`,e),ie=()=>t.removeEventListener(`pagehide`,e)}return N.initialized||Se(`POP`,N.location,{initialHydration:!0}),M}function he(){x&&x(),ie&&ie(),S.clear(),R&&R.abort(),N.fetchers.forEach((e,t)=>Be(N.fetchers,t)),N.blockers.forEach((e,t)=>Je(t))}function ge(e){return S.add(e),()=>S.delete(e)}function q(e,t={}){let n=e.errors??null,r=n?rt.get(n):void 0;r!==void 0&&(n=r),(e.errors!==void 0||e.initialized)&&(N.errors&&rt.delete(N.errors),e.errors&&rt.set(e.errors,n)),e.matches&&=e.matches.map(e=>{let t=h[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),N={...N,...e};let i=[],a=[];N.fetchers.forEach((e,t)=>{e.state===`idle`&&(W.has(t)?i.push(t):a.push(t))}),W.forEach(e=>{!N.fetchers.has(e)&&!V.has(e)&&i.push(e)}),[...S].forEach(e=>e(N,{deletedFetchers:i,newErrors:n,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),i.forEach(e=>Be(N.fetchers,e)),a.forEach(e=>N.fetchers.delete(e))}function _e(t,n,{flushSync:r}={}){let i=N.actionData!=null&&N.navigation.formMethod!=null&&Q(N.navigation.formMethod)&&N.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?N.actionData:null;let o=n.loaderData?Vt(N.loaderData,n.loaderData,n.matches||[],n.errors):N.loaderData,s=N.blockers;s.size>0&&!ae&&(s=new Map(s),s.forEach((e,t)=>s.set(t,Qe)));let c=!ae&&pt(t,n.matches||N.matches),l=L===!0||N.navigation.formMethod!=null&&Q(N.navigation.formMethod)&&t.state?._isRedirect!==!0;_.commitHmrRoutes(),ae||P===`POP`||(P===`PUSH`?e.history.push(t,t.state):P===`REPLACE`&&e.history.replace(t,t.state));let u;if(P===`POP`&&!ae&&t!==N.location){let e=re.get(N.location.pathname);e&&e.has(t.pathname)?u={currentLocation:N.location,nextLocation:t}:re.has(t.pathname)&&(u={currentLocation:t,nextLocation:N.location})}else if(z){let e=re.get(N.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),re.set(N.location.pathname,e)),u={currentLocation:N.location,nextLocation:t}}q({...n,actionData:a,loaderData:o,historyAction:P,location:t,initialized:!0,renderFallback:!1,navigation:Xe,revalidation:`idle`,restoreScrollPosition:c,preventScrollReset:l,blockers:s},{viewTransitionOpts:u,flushSync:r===!0}),ve(),I?.resolve(),I=null,me?.resolve(),me=null}function ve(){ne=0,P=`POP`,L=!1,z=!1,ae=!1,B=H.size>0}async function ye(t,n){if(F&&await F,I?.resolve(),I=null,typeof t==`number`){I||=hn();let n=I.promise;return e.history.go(t),n}let i=Me(M),{path:a,submission:o,error:s}=st(!1,ot(N.location,N.matches,u,t,n?.fromRouteId,n?.relative),n),c;if(n?.mask){let t=typeof n.mask==`string`?m(n.mask):{...N.location.mask,...n.mask};if(c={pathname:t.pathname??``,search:t.search??``,hash:t.hash??``},r.test(c.pathname))throw Error(`External navigation is not allowed`);c.pathname.startsWith(`\\`)&&(c.pathname=c.pathname.replace(/^\\+/,`/`)),Ue(typeof n.mask==`string`?n.mask:p(n.mask),p(c),e.history.createURL(`/`),`reject`)}let l=N.location,d=f(l,a,n&&n.state,void 0,c);d={...d,...e.history.encodeLocation(d)},Ue(t==null?e.history.createHref(N.location):typeof t==`string`?t:p(t),e.history.createHref(d.mask||d),e.history.createURL(`/`),`reject`);let h=n&&n.replace!=null?n.replace:void 0,g=`PUSH`,_=N.location.pathname+N.location.search;h===!0?g=`REPLACE`:h===!1||o!=null&&Q(o.formMethod)&&(o.formAction===_||d.pathname+d.search===_)&&(g=`REPLACE`);let v=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,y=(n&&n.flushSync)===!0,b=et({currentLocation:l,nextLocation:d,historyAction:g});b?$e(b,{state:`blocked`,location:d,proceed(){$e(b,{state:`proceeding`,proceed:void 0,reset:void 0,location:d}),ye(t,n)},reset(){let e=new Map(N.blockers);e.set(b,Qe),q({blockers:e})}}):await Se(g,d,{submission:o,pendingError:s,preventScrollReset:v,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:y,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate,instrumentationNavigateMetaReceiver:i})}function xe(){if(F)return F.then(xe);me||=hn(),Fe(),q({revalidation:`loading`});let e=me.promise;return N.navigation.state===`submitting`?e:N.navigation.state===`idle`?(Se(N.historyAction,N.location,{startUninterruptedRevalidation:!0,dataStrategyInitiator:`revalidation`}),e):(Se(P||N.historyAction,N.navigation.location,{overrideNavigation:N.navigation,dataStrategyInitiator:`revalidation`,enableViewTransition:z===!0}),e)}async function Se(t,n,r){F&&await F,R&&R.abort(),R=null,P=t,ae=(r&&r.startUninterruptedRevalidation)===!0,ft(N.location,N.matches),L=(r&&r.preventScrollReset)===!0,z=(r&&r.enableViewTransition)===!0;let i=r?.initialHydration&&N.matches&&N.matches.length>0&&!ee?N.matches:d.match(n),a=(r&&r.flushSync)===!0;if(i&&N.initialized&&!B&&qt(N.location,n)&&!(r&&r.submission&&Q(r.submission.formMethod))){_e(n,{matches:i},{flushSync:a});return}let o=ht(i,n.pathname);if(o.active&&o.matches&&(i=o.matches),r?.instrumentationNavigateMetaReceiver){let t=sn(e.history,n,i);r.instrumentationNavigateMetaReceiver(t)}if(!i){let{error:e,notFoundMatches:t,route:r}=it(n.pathname);_e(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:a});return}let s=r&&r.overrideNavigation?{...r.overrideNavigation,matches:i,historyAction:t}:void 0;R=new AbortController;let c=It(e.history,n,R.signal,r&&r.submission),l=r?.initialHydration?`initialization`:r?.dataStrategyInitiator??`navigation`,u=e.getContext?await e.getContext():new v,f;if(r&&r.pendingError)f=[Ut(i).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Q(r.submission.formMethod)){let d=await we(c,l,n,r.submission,i,t,u,o.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:a});if(d.shortCircuited)return;if(d.pendingActionResult){let[e,t]=d.pendingActionResult;if(Z(t)&&be(t.error)&&t.error.status===404){R=null,_e(n,{matches:d.matches,loaderData:{},errors:{[e]:t.error}});return}}i=d.matches||i,f=d.pendingActionResult,s=ln(n,i,t,r.submission),a=!1,o.active=!1,c=It(e.history,c.url,c.signal)}let{shortCircuited:p,matches:m,loaderData:h,errors:g,workingFetchers:_}=await Te(c,l,n,i,t,u,o.active,s,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,a,f,r&&r.callSiteDefaultShouldRevalidate);p||(R=null,_e(n,{matches:m||i,...Ht(f),loaderData:h,errors:g,..._?{fetchers:_}:{}}))}function Ce(){let t=hn();F=t.promise;let n=ne,r=I;I=null,R?.abort(),R=null,ve(),me?.resolve(),me=null;let i=new Map(N.blockers);i.forEach((e,t)=>{e.state===`proceeding`&&i.set(t,Qe)});let a=new Map(N.fetchers),o=Ge(a);a.forEach((e,t)=>{e.state===`loading`&&!V.has(t)&&(a.set(t,$(e.data)),o=!0)}),oe.clear(),q({navigation:Xe,revalidation:`idle`,blockers:i,...o?{fetchers:a}:{}});function s(){F=void 0,r?.resolve(),t.resolve()}return n?(pe=s,e.history.go(-n)):s(),t.promise}async function we(t,n,r,a,c,l,d,f,p,m={}){if(s.unstable_customRouteDiscovery||Fe(),q({navigation:un(r,c,l,a)},{flushSync:m.flushSync===!0}),f){let e=await gt(c,r.pathname,t.signal);if(s.unstable_customRouteDiscovery&&t.signal.aborted||e.type===`aborted`)return{shortCircuited:!0};if(e.type===`cancelled`)return await Ce(),{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Wt(_.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Ut(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)c=e.matches;else{let{notFoundMatches:e,error:t,route:n}=it(r.pathname);return{matches:e,pendingActionResult:[n.id,{type:`error`,error:t}]}}}s.unstable_customRouteDiscovery&&Fe();let g,v=on(c,r);if(!v.route.action&&!v.route.lazy)g={type:`error`,error:X(405,{method:t.method,pathname:r.pathname,routeId:v.route.id})};else{let e=await Y(t,r,Dt(o,h,t,r,c,v,p?[]:i,d),d,null,n,l);if(g=e[v.route.id],!g){for(let t of c)if(e[t.route.id]){g=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(Qt(g)){let r;return r=m&&m.replace!=null?m.replace:Ft(g.response.headers.get(`Location`),new URL(t.url),u,e.history)===N.location.pathname+N.location.search,await J(t,g,!0,n,{submission:a,replace:r}),{shortCircuited:!0}}if(Z(g)){let e=Ut(c,v.route.id);return(m&&m.replace)!==!0&&(P=`PUSH`),{matches:c,pendingActionResult:[e.route.id,g,v.route.id]}}return{matches:c,pendingActionResult:[v.route.id,g]}}async function Te(t,n,r,a,c,l,u,f,p,m,g,v,y,b,x){let S=f||ln(r,a,c,p),C=p||m||cn(S),w=!ae&&!v;if(u){if(w){let e=Ee(b);q({navigation:S,...e===void 0?{}:{actionData:e}},{flushSync:y})}let e=await gt(a,r.pathname,t.signal);if(s.unstable_customRouteDiscovery&&t.signal.aborted||e.type===`aborted`)return{shortCircuited:!0};if(e.type===`cancelled`)return await Ce(),{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Wt(_.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Ut(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)a=e.matches,v&&!t.signal.aborted&&q({matches:a});else{let{error:e,notFoundMatches:t,route:n}=it(r.pathname);return{matches:t,loaderData:{},errors:{[n.id]:e}}}}let{dsMatches:T,revalidatingFetchers:E}=ct(t,l,o,h,e.history,N,a,C,r,v?[]:i,v===!0,B,oe,W,U,de,d,b,x);if(ce=++se,!e.dataStrategy&&!T.some(e=>e.shouldLoad)&&!T.some(e=>e.route.middleware&&e.route.middleware.length>0)&&E.length===0){let e=new Map(N.fetchers),t=Ge(e);return _e(r,{matches:a,loaderData:{},errors:b&&Z(b[1])?{[b[0]]:b[1].error}:null,...Ht(b),...t?{fetchers:e}:{}},{flushSync:y}),{shortCircuited:!0}}if(w){let e={};if(!u){e.navigation=S;let t=Ee(b);t!==void 0&&(e.actionData=t)}E.length>0&&(e.fetchers=ke(E)),q(e,{flushSync:y})}E.forEach(e=>{He(e.key),e.controller&&V.set(e.key,e.controller)});let D=()=>E.forEach(e=>{V.get(e.key)===e.controller&&He(e.key)});R&&R.signal.addEventListener(`abort`,D);let{loaderResults:O,fetcherResults:ee}=await Pe(T,E,t,r,l,n,c);if(t.signal.aborted)return{shortCircuited:!0};R&&R.signal.removeEventListener(`abort`,D),E.forEach(e=>{V.get(e.key)===e.controller&&V.delete(e.key)});let k=Gt(O);if(k)return await J(t,k.result,!0,n,{replace:g}),{shortCircuited:!0};if(k=Gt(ee),k)return de.add(k.key),await J(t,k.result,!0,n,{replace:g}),{shortCircuited:!0};let te=new Map(N.fetchers),{loaderData:A,errors:j}=Bt(N,a,O,b,E,ee,te);if(v&&N.errors){let e=j??null;j={...N.errors,...j},rt.set(j,e)}let M=Ge(te),P=Ke(ce,te),ne=M||P||E.length>0;return{matches:a,loaderData:A,errors:j,...ne?{workingFetchers:te}:{}}}function Ee(e){if(e&&!Z(e[1]))return{[e[0]]:e[1].data};if(N.actionData)return Object.keys(N.actionData).length===0?null:N.actionData}function ke(e){let t=new Map(N.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=dn(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function Ae(t,n,r,i){F&&await F,He(t);let a=(i&&i.flushSync)===!0,o=Me(M),s=ot(N.location,N.matches,u,r,n,i?.relative),c=d.match(s),l=ht(c,s);if(l.active&&l.matches&&(c=l.matches),o&&o(sn(e.history,s,c)),!c){Le(t,n,X(404,{pathname:s}),{flushSync:a});return}let{path:f,submission:p,error:m}=st(!0,s,i);if(m){Le(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new v,g=(i&&i.preventScrollReset)===!0;if(p&&Q(p.formMethod)){await je(t,n,f,c,h,l.active,a,g,p,i&&i.defaultShouldRevalidate);return}let _={routeId:n,path:f,isDiscovering:l.active};U.set(t,_),await Ne(t,_,c,h,a,g,p)}async function je(t,n,r,a,l,u,f,p,m,g){s.unstable_customRouteDiscovery||Fe(),U.delete(t);let _=N.fetchers.get(t);Ie(t,fn(m,_),{flushSync:f});let v=new AbortController;s.unstable_customRouteDiscovery&&V.set(t,v);let y=It(e.history,r,v.signal,m);if(u){let e=await gt(a,new URL(y.url).pathname,y.signal,t);if(s.unstable_customRouteDiscovery&&y.signal.aborted||e.type===`aborted`)return;if(e.type===`cancelled`){V.delete(t),U.delete(t),Ie(t,$(_?.data),{flushSync:f});return}if(e.type===`error`){Le(t,n,e.error,{flushSync:f});return}if(e.matches)a=e.matches;else{Le(t,n,X(404,{pathname:r}),{flushSync:f});return}}let b=on(a,r);if(!b.route.action&&!b.route.lazy){Le(t,n,X(405,{method:m.formMethod,pathname:r,routeId:n}),{flushSync:f});return}s.unstable_customRouteDiscovery&&Fe(),V.set(t,v);let x=se,S=Dt(o,h,y,r,a,b,i,l),C=await Y(y,r,S,l,t,`fetcher`),w=C[b.route.id];if(!w){for(let e of S)if(C[e.route.id]){w=C[e.route.id];break}}if(y.signal.aborted){V.get(t)===v&&V.delete(t);return}if(W.has(t)){if(Z(w)){Ie(t,$(void 0));return}Qt(w)&&(B=!0,w={type:`data`,data:void 0})}else{if(Qt(w)){if(ce>x)B=!0,w={type:`data`,data:void 0};else return V.delete(t),de.add(t),Ie(t,dn(m)),J(y,w,!1,`fetcher`,{fetcherSubmission:m,preventScrollReset:p})}if(Z(w)){Le(t,n,w.error);return}}B=!0;let T=N.navigation.location||N.location,E=It(e.history,T,v.signal),D=N.navigation.state===`idle`?N.matches:d.match(N.navigation.location);c(D,`Didn't find any matches after fetcher action`);let O=++se;H.set(t,O);let{dsMatches:ee,revalidatingFetchers:k}=ct(E,l,o,h,e.history,N,D,m,T,i,!1,B,oe,W,U,de,d,[b.route.id,w],g),te=dn(m,w.data),A=new Map(N.fetchers);A.set(t,te),k.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=A.get(t),r=dn(void 0,n?n.data:void 0);A.set(t,r),He(t),e.controller&&V.set(t,e.controller)}),q({fetchers:A});let j=()=>k.forEach(e=>{V.get(e.key)===e.controller&&He(e.key)});v.signal.addEventListener(`abort`,j);let{loaderResults:M,fetcherResults:ne}=await Pe(ee,k,E,T,l,`fetcher`);if(v.signal.aborted){H.get(t)===O&&H.delete(t);return}v.signal.removeEventListener(`abort`,j),H.delete(t),V.delete(t),k.forEach(e=>{V.get(e.key)===e.controller&&V.delete(e.key)});let F=N.fetchers.has(t),I=e=>{if(!F)return e;let n=new Map(e.fetchers);return n.set(t,$(w.data)),{...e,fetchers:n}},L=Gt(M);if(L)return N=I(N),J(E,L.result,!1,`fetcher`,{preventScrollReset:p});if(L=Gt(ne),L)return de.add(L.key),N=I(N),J(E,L.result,!1,`fetcher`,{preventScrollReset:p});let z=new Map(N.fetchers);F&&z.set(t,$(w.data));let{loaderData:re,errors:ie}=Bt(N,D,M,void 0,k,ne,z);Ke(O,z),N.navigation.state===`loading`&&O>ce?(c(P,`Expected pending action`),R&&R.abort(),Ge(z),_e(N.navigation.location,{matches:D,loaderData:re,errors:ie,fetchers:z})):(q({errors:ie,loaderData:Vt(N.loaderData,re,D,ie),fetchers:z}),B=H.size>0)}async function Ne(t,n,r,a,c,l,u){let{routeId:d,path:f}=n,p=N.fetchers.get(t);Ie(t,dn(u,p?p.data:void 0),{flushSync:c});let m=new AbortController;s.unstable_customRouteDiscovery&&V.set(t,m);let g=It(e.history,f,m.signal);if(n.isDiscovering){let e=await gt(r,new URL(g.url).pathname,g.signal,t);if(s.unstable_customRouteDiscovery&&g.signal.aborted||e.type===`aborted`)return;if(e.type===`cancelled`){V.delete(t),U.delete(t),Ie(t,$(p?.data),{flushSync:c});return}if(e.type===`error`){Le(t,d,e.error,{flushSync:c});return}if(e.matches)r=e.matches,n.isDiscovering=!1;else{Le(t,d,X(404,{pathname:f}),{flushSync:c});return}}let _=on(r,f);V.set(t,m);let v=se,y=await Y(g,f,Dt(o,h,g,f,r,_,i,a),a,t,`fetcher`),b=y[_.route.id];if(!b){for(let e of r)if(y[e.route.id]){b=y[e.route.id];break}}if(V.get(t)===m&&V.delete(t),!g.signal.aborted){if(W.has(t))Ie(t,$(void 0));else{if(Qt(b)){if(ce>v){Ie(t,$(void 0));return}de.add(t),await J(g,b,!1,`fetcher`,{preventScrollReset:l});return}Z(b)?Le(t,d,b.error):Ie(t,$(b.data))}}}async function J(r,i,a,o,{submission:s,fetcherSubmission:l,preventScrollReset:d,replace:p}={}){a||(I?.resolve(),I=null),i.response.headers.has(`X-Remix-Revalidate`)&&(B=!0);let m=i.response.headers.get(`Location`);c(m,`Expected a Location header on the redirect Response`);let h=m,_=new URL(r.url);m=Ft(m,_,u,e.history),Ue(h,m,_,`allow-explicit`);let v=f(N.location,m,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(ue(m)){let n=g(t,m,!0);e=n.origin!==t.location.origin||le(n.pathname,u)==null}if(e){p?t.location.replace(m):t.location.assign(m);return}}R=null;let y=p===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:b,formAction:x,formEncType:S}=N.navigation;!s&&!l&&b&&x&&S&&(s=cn(N.navigation));let C=s||l;Ye.has(i.response.status)&&C&&Q(C.formMethod)?await Se(y,v,{submission:{...C,formAction:m},preventScrollReset:d||L,enableViewTransition:a?z:void 0,dataStrategyInitiator:o}):await Se(y,v,{overrideNavigation:ln(v,[],y,s),fetcherSubmission:l,preventScrollReset:d||L,enableViewTransition:a?z:void 0,dataStrategyInitiator:o})}async function Y(e,t,n,r,i,a,o=null){let s,c={};try{s=await Ot(b,e,t,n,i,a,r,!1,o)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{c[t.route.id]={type:`error`,error:e}}),c}if(e.signal.aborted)return c;if(!Q(e.method))for(let e of n){if(s[e.route.id]?.type===`error`)break;s.hasOwnProperty(e.route.id)||N.loaderData.hasOwnProperty(e.route.id)||N.errors&&N.errors.hasOwnProperty(e.route.id)||!e.shouldCallHandler()||(s[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(s))if(Zt(r)){let i=r.result;c[t]={type:`redirect`,response:Mt(i,e,t,n,u)}}else c[t]=await jt(r);return c}async function Pe(e,t,n,r,i,a,o=null){let s=Y(n,r,e,i,null,a,o),c=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await Y(e.request,e.path,e.matches,i,e.key,a,o))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:X(404,{pathname:e.path})}})}));return{loaderResults:await s,fetcherResults:(await c).reduce((e,t)=>Object.assign(e,t),{})}}function Fe(){B=!0,U.forEach((e,t)=>{s.unstable_customRouteDiscovery&&e.isDiscovering||(V.has(t)&&oe.add(t),He(t))})}function Ie(e,t,n={}){let r=new Map(N.fetchers);r.set(e,t),q({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function Le(e,t,n,r={}){let i=Ut(N.matches,t),a=new Map(N.fetchers);Be(a,e),q({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Re(e){return fe.set(e,(fe.get(e)||0)+1),W.has(e)&&W.delete(e),N.fetchers.get(e)||Ze}function ze(e,t){He(e,t?.reason),U.delete(e),oe.delete(e),Ie(e,$(null))}function Be(e,t){let n=N.fetchers.get(t);V.has(t)&&!(n&&n.state===`loading`&&H.has(t))&&He(t),U.delete(t),H.delete(t),de.delete(t),W.delete(t),oe.delete(t),e.delete(t)}function Ve(e){let t=(fe.get(e)||0)-1;t<=0?(fe.delete(e),W.add(e)):fe.set(e,t),q({fetchers:new Map(N.fetchers)})}function He(e,t){let n=V.get(e);n&&(n.abort(t),V.delete(e))}function We(e,t){for(let n of e){let e=t.get(n);c(e,`Expected fetcher: ${n}`);let r=$(e.data);t.set(n,r)}}function Ge(e){let t=[],n=!1;for(let r of de){let i=e.get(r);c(i,`Expected fetcher: ${r}`),i.state===`loading`&&(de.delete(r),t.push(r),n=!0)}return We(t,e),n}function Ke(e,t){let n=[];for(let[r,i]of H)if(i<e){let e=t.get(r);c(e,`Expected fetcher: ${r}`),e.state===`loading`&&(He(r),H.delete(r),n.push(r))}return We(n,t),n.length>0}function qe(e,t){let n=N.blockers.get(e)||Qe;return G.get(e)!==t&&G.set(e,t),n}function Je(e){N.blockers.delete(e),G.delete(e)}function $e(e,t){let n=N.blockers.get(e)||Qe;c(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(N.blockers);r.set(e,t),q({blockers:r})}function et({currentLocation:e,nextLocation:t,historyAction:n}){if(G.size===0)return;G.size>1&&l(!1,`A router only supports one blocker at a time`);let r=Array.from(G.entries()),[i,a]=r[r.length-1],o=N.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function it(e){let t=X(404,{pathname:e}),n=_.activeRoutes,{matches:r,route:i}=Wt(n);return{notFoundMatches:r,route:i,error:t}}function at(e,t,n){if(C=e,T=t,w=n||null,!D&&N.navigation===Xe){D=!0;let e=pt(N.location,N.matches);e!=null&&q({restoreScrollPosition:e})}return()=>{C=null,T=null,w=null}}function dt(e,t){return w&&w(e,t.map(e=>k(e,N.loaderData)))||e.key}function ft(e,t){if(C&&T){let n=dt(e,t);C[n]=T()}}function pt(e,t){if(C){let n=dt(e,t),r=C[n];if(typeof r==`number`)return r}return null}function ht(t,n){if(e.patchRoutesOnNavigation){if(!t)return{active:!0,matches:d.match(n,!0)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:d.match(n,!0)}}return{active:!1,matches:null}}async function gt(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let a=t;for(;;){let t=h;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:a,fetcherKey:i,patch:(e,n)=>{r.aborted||mt(e,n,_,t,o,!1)}})}catch(e){if(s.unstable_customRouteDiscovery){if(r.aborted)return{type:`aborted`};if(e instanceof y)return{type:`cancelled`}}return{type:`error`,error:e,partialMatches:a}}if(r.aborted)return{type:`aborted`};let c=d.match(n),l=null;if(c&&(Object.keys(c[0].params).length===0||(l=d.match(n,!0),!(l&&a.length<l.length&&_t(a,l.slice(0,a.length))))))return{type:`success`,matches:c};if(l||=d.match(n,!0),!l||_t(a,l))return{type:`success`,matches:null};a=l}}function _t(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function vt(e){h={},_.setHmrRoutes(E(e,o,void 0,h))}function yt(e,t,n=!1){mt(e,t,_,h,o,n),_.hasHMRRoutes||q({})}return M={get basename(){return u},get future(){return s},get state(){return N},get routes(){return _.stableRoutes},match(e){return d.match(e)},get manifest(){return h},get window(){return t},initialize:K,subscribe:ge,enableScrollRestoration:at,navigate:ye,fetch:Ae,revalidate:xe,createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Re,resetFetcher:ze,deleteFetcher:Ve,dispose:he,getBlocker:qe,deleteBlocker:Je,patchRoutes:yt,_internalFetchControllers:V,_internalSetRoutes:vt,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){q(e)}},e.instrumentations&&(M=Oe(M,e.instrumentations.map(e=>e.router).filter(Boolean))),M}function at(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function ot(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=pe(r||`.`,G(o),le(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=an(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=H({basename:n,pathname:c.pathname})),p(c)}function st(e,t,n){if(!n||!at(n))return{path:t};if(n.formMethod&&!rn(n.formMethod))return{path:t,error:X(405,{method:n.formMethod})};let r=()=>({path:t,error:X(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Kt(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Q(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(!Q(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()}}}c(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Lt(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Lt(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Rt(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Rt(o)}catch{return r()}let l={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(Q(l.formMethod))return{path:t,submission:l};let u=m(t);return e&&u.search&&an(u.search)&&o.append(`index`,``),u.search=`?${o}`,{path:p(u),submission:l}}function ct(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){let y=_?Z(_[1])?_[1].error:_[1].data:void 0,b=i.createURL(a.location),x=i.createURL(c),S;if(u&&a.errors){let e=Object.keys(a.errors)[0];S=o.findIndex(t=>t.route.id===e)}else if(_&&Z(_[1])){let e=_[0];S=o.findIndex(t=>t.route.id===e)-1}let C=_?_[1].statusCode:void 0,w=C&&C>=400,T={currentUrl:b,currentParams:a.matches[0]?.params||{},nextUrl:x,nextParams:o[0].params,...s,actionResult:y,actionStatus:C},E=xe(o),D=o.map((i,o)=>{let{route:s}=i,f=null;if(S!=null&&o>S)f=!1;else if(s.lazy)f=!0;else if(!lt(s))f=!1;else if(u){let{shouldLoad:e}=ut(s,a.loaderData,a.errors);f=e}else dt(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Et(n,r,e,c,E,i,l,t,f);let p=!1;typeof v==`boolean`?p=v:w?p=!1:d||b.pathname+b.search===x.pathname+x.search?p=!0:b.search===x.search?ft(a.matches[o],i)&&(p=!0):p=!0;let m={...T,defaultShouldRevalidate:p};return Et(n,r,e,c,E,i,l,t,pt(i,m),m,v)}),O=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s)||e.isDiscovering)return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,_=g.match(e.path);if(!_){O.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let y=on(_,e.path),b=new AbortController,x=It(i,e.path,b.signal),S=null;if(f.has(s))f.delete(s),S=Dt(n,r,x,e.path,_,y,l,t);else if(m)d&&(S=Dt(n,r,x,e.path,_,y,l,t));else{let i;i=typeof v==`boolean`?v:!w&&d;let a={...T,defaultShouldRevalidate:i};pt(y,a)&&(S=Dt(n,r,x,e.path,_,y,l,t,a))}S&&O.push({key:s,routeId:e.routeId,path:e.path,matches:S,match:y,request:x,controller:b})}),{dsMatches:D,revalidatingFetchers:O}}function lt(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function ut(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!lt(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 dt(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function ft(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function pt(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function mt(e,t,n,r,i,a){let o;if(e){let t=r[e];c(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],l=[];if(t.forEach(e=>{let t=o.find(t=>ht(e,t));t?l.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=E(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&l.length>0)for(let e=0;e<l.length;e++){let{existingRoute:t,newRoute:n}=l[e],r=t,[a]=E([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 ht(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=>ht(e,t)))??!1}var gt=new WeakMap,_t=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(c(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=gt.get(i);o||(o={},gt.set(i,o));let s=o[e];if(s)return s;let u=(async()=>{let t=x(e),n=i[e]!==void 0;if(t)l(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)l(!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]=u,u.catch(()=>{o[e]===u&&delete o[e]}),u},vt=new WeakMap;function yt(e,t,n,r,i){let a=n[e.id];if(c(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=vt.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{c(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=C(e),o=a[e]!==void 0;i?l(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?l(!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 vt.set(a,n),n.catch(()=>{vt.get(a)===n&&vt.delete(a)}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],u;for(let a of o){if(i&&i.includes(a))continue;let o=_t({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(u=o))}let d=s.length>0?Promise.all(s).then(()=>{}):void 0;return d?.catch(()=>{}),u?.catch(()=>{}),{lazyRoutePromise:d,lazyHandlerPromise:u}}async function bt(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 xt(e){return e.matches.some(e=>e.route.middleware)?St(e,()=>bt(e)):bt(e)}function St(e,t){return Ct(e,t,e=>{if(nn(e))throw e;return e},Yt,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{[Ut(r,a).route.id]:{type:`error`,result:t}}}}}async function Ct(e,t,n,r,i){let{matches:a,...o}=e;return await wt(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function wt(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 wt(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 Tt(e,t,n,r,i){let a=_t({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=yt(r.route,Q(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Et(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=Tt(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?pt(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?pt(a,{...l,defaultShouldRevalidate:e}):pt(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Q(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Q(n.method)||!p)?kt({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 Dt(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Et(e,t,n,r,xe(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:Tt(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Ot(e,t,n,r,i,a,o,s,c=null){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let l={request:t,url:Se(t,n),pattern:xe(r),params:r[0].params,context:o,matches:r,unstable_initiator:a,unstable_navigationType:a===`navigation`?c:null},u=s?()=>{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=l;return St(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},d=await e({...l,fetcherKey:i,runClientMiddleware:u});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return d}async function kt({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Q(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:Se(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 X(405,{method:e.method,pathname:n,routeId:r.route.id})}else return await a,{type:`data`,result:void 0}}}else if(t)c=await f(t);else{let t=new URL(e.url);throw X(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function At(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 jt(e){let{result:t,type:n}=e;if(en(t)){let e;try{e=await At(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new ye(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?$t(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:Jt(t),statusCode:be(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:be(t)?t.status:void 0}:$t(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 Mt(e,t,n,r,i){let a=e.headers.get(`Location`);if(c(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!ue(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=ot(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var Nt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Pt(e){try{return Nt.includes(new URL(e).protocol)}catch{return!1}}function Ft(e,t,n,a){if(ue(e)){let a=e,o=r.test(a)?new URL(i(a,t.protocol)):new URL(a);if(Pt(o.toString()))throw Error(`Invalid redirect location`);let s=le(o.pathname,n)!=null;if(o.origin===t.origin&&s)return me(o.pathname)+o.search+o.hash}try{if(Pt(a.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function It(e,t,n,r){let i=e.createURL(Kt(t)).toString(),a={signal:n};if(r&&Q(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?Lt(r.formData):r.formData}return new Request(i,a)}function Lt(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Rt(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function zt(e,t,n,r=!1,i=!1){let a={},o=null,s,l=!1,u={},d=n&&Z(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(c(!Qt(p),`Cannot handle redirect results in processLoaderData`),Z(p)){let t=p.error;if(d!==void 0&&(t=d,d=void 0),o||={},i)o[f]=t;else{let n=Ut(e,f);o[n.route.id]??(o[n.route.id]=t)}r||(a[f]=et),l||(l=!0,s=be(p.error)?p.error.status:500),p.headers&&(u[f]=p.headers)}else a[f]=p.data,p.statusCode&&p.statusCode!==200&&!l&&(s=p.statusCode),p.headers&&(u[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:u}}function Bt(e,t,n,r,i,a,o){let{loaderData:s,errors:l}=zt(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,routeId:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(c(s,`Did not find corresponding fetcher result`),Z(s)){let t=Ut(e.matches,r);l&&l[t.route.id]||(l={...l,[t.route.id]:s.error}),o.delete(n)}else if(Qt(s))c(!1,`Unhandled fetcher revalidation redirect`);else{let e=$(s.data);o.set(n,e)}}),{loaderData:s,errors:l}}function Vt(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==et).reduce((e,[t,n])=>(e[t]=n,e),{}),a=0;for(let o of n){let n=o.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&o.route.loader&&(i[n]=e[n],a++),r&&r.hasOwnProperty(n))break}return Object.keys(t).length===0&&a===Object.keys(e).length?e:i}function Ht(e){return e?Z(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ut(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 Wt(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 X(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 ye(e||500,o,Error(s),!0)}function Gt(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 Kt(e){return p({...typeof e==`string`?m(e):e,hash:``})}function qt(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function Jt(e){return new ye(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function Yt(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&Xt(t))}function Xt(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function Zt(e){return en(e.result)&&Je.has(e.result.status)}function Z(e){return e.type===`error`}function Qt(e){return(e&&e.type)===`redirect`}function $t(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function en(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function tn(e){return Je.has(e)}function nn(e){return en(e)&&tn(e.status)&&e.headers.has(`Location`)}function rn(e){return qe.has(e.toUpperCase())}function Q(e){return Ge.has(e.toUpperCase())}function an(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function on(e,t){let n=typeof t==`string`?m(t).search:t.search;if(e[e.length-1].route.index&&an(n||``))return e[e.length-1];let r=W(e);return r[r.length-1]}function sn(e,t,n){return{url:Se(e.createURL(t),t),pattern:n?xe(n):``,params:n?.[0]?.params?{...n[0].params}:{}}}function cn(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 ln(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 un(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 dn(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 fn(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 $(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 pn(e,t){try{let n=e.sessionStorage.getItem($e);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 mn(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem($e,JSON.stringify(n))}catch(e){l(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function hn(){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 gn=_.createContext(null);gn.displayName=`DataRouter`;var _n=_.createContext(null);_n.displayName=`DataRouterState`;var vn=_.createContext(null);vn.displayName=`DataRouterData`;var yn=_.createContext(null);yn.displayName=`DataRouterNavigation`;var bn=_.createContext(!1);function xn(){return _.useContext(bn)}var Sn=_.createContext({isTransitioning:!1});Sn.displayName=`ViewTransition`;var Cn=_.createContext(null);Cn.displayName=`Fetchers`;var wn=_.createContext(null);wn.displayName=`Await`;var Tn=_.createContext(null);Tn.displayName=`Navigation`;var En=_.createContext(null);En.displayName=`Location`;var Dn=_.createContext({outlet:null,matches:[],isDataRoute:!1});Dn.displayName=`Route`;var On=_.createContext(!1);On.displayName=`IsDataRoute`;var kn=_.createContext(void 0);kn.displayName=`RouteId`;var An=_.createContext(null);An.displayName=`RouteError`;var jn=`REACT_ROUTER_ERROR`,Mn=`REDIRECT`,Nn=`ROUTE_ERROR_RESPONSE`;function Pn(e){if(e.startsWith(`${jn}:${Mn}:{`))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 Fn(e){if(e.startsWith(`${jn}:${Nn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new ye(t.status,t.statusText,t.data)}catch{}}function In(e,{relative:t}={}){c(Ln(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=_.useContext(Tn),{hash:i,pathname:a,search:o}=Gn(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:K([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Ln(){return _.useContext(En)!=null}function Rn(){return c(Ln(),`useLocation() may be used only in the context of a <Router> component.`),_.useContext(En).location}var zn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Bn(){return _.useContext(On)?lr():Vn()}function Vn(){c(Ln(),`useNavigate() may be used only in the context of a <Router> component.`);let e=_.useContext(gn),{basename:t,navigator:n}=_.useContext(Tn),{matches:r}=_.useContext(Dn),{pathname:i}=Rn(),a=JSON.stringify(G(r)),o=_.useRef(!1);return _.useLayoutEffect(()=>{o.current=!0}),_.useCallback((r,s={})=>{if(l(o.current,zn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=pe(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:K([t,c.pathname])),Ue(typeof r==`string`?r:p(r),n.createHref(c),Be(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Hn=_.createContext(null);function Un(e){let t=_.useContext(Dn).outlet;return _.useMemo(()=>t&&_.createElement(Hn.Provider,{value:e},t),[t,e])}function Wn(){let{matches:e}=_.useContext(Dn);return e[e.length-1]?.params??{}}function Gn(e,{relative:t}={}){let{matches:n}=_.useContext(Dn),{pathname:r}=Rn(),i=JSON.stringify(G(n));return _.useMemo(()=>pe(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Kn(e,t,n){c(Ln(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=_.useContext(Tn),{matches:i}=_.useContext(Dn),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let s=a?a.pathnameBase:`/`;a&&a.route;let l=Rn(),u;if(t){let e=typeof t==`string`?m(t):t;c(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.`),u=e}else u=l;let d=u.pathname||`/`,f=d;if(s!==`/`){let e=s.replace(/^\//,``).split(`/`);f=`/`+d.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let p;p=n?n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):n.router.match(n.state.location):O(e,{pathname:f});let h=$n(p&&p.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:K([s,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?s:K([s,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?_.createElement(En.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...u},navigationType:`POP`}},h):h}function qn(){let e=cr(),t=be(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return _.createElement(_.Fragment,null,_.createElement(`h2`,null,`Unexpected Application Error!`),_.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?_.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var Jn=_.createElement(qn,null),Yn=class extends _.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=bn;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=Fn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:_.createElement(Dn.Provider,{value:this.props.routeContext},_.createElement(On.Provider,{value:this.props.routeContext.isDataRoute},_.createElement(kn.Provider,{value:this.props.routeContext.matches[this.props.routeContext.matches.length-1]?.route.id},_.createElement(An.Provider,{value:e,children:this.props.component}))));return this.context?_.createElement(Zn,{error:e},t):t}},Xn=new WeakMap;function Zn({children:e,error:t}){let{basename:n,navigator:r}=_.useContext(Tn);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Pn(t.digest);if(e){let i=Xn.get(t);if(i)throw i;let a=we(e.location,n),o=a.absoluteURL||a.to;if(Ue(e.location,o,Be(r),`allow-explicit`),Pt(o))throw Error(`Invalid redirect location`);if(Ce&&!Xn.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw Xn.set(t,n),n}}return _.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function Qn({routeContext:e,match:t,children:n}){let r=_.useContext(gn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),_.createElement(Dn.Provider,{value:e},_.createElement(On.Provider,{value:e.isDataRoute},_.createElement(kn.Provider,{value:t.route.id},n)))}function $n(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);c(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 l=n?.onError,u=r&&l?(e,t)=>{l(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:xe(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let l,d=!1,f=null,p=null;r&&(l=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Jn,o&&(s<0&&c===0?(dr(`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=l?f:d?p:n.route.Component?_.createElement(n.route.Component,null):n.route.element?n.route.element:e,_.createElement(Qn,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?_.createElement(Yn,{location:r.location,revalidation:r.revalidation,component:f,error:l,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:u}):h()},null)}function er(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function tr(e){let t=_.useContext(gn);return c(t,er(e)),t}function nr(e){let t=_.useContext(_n);return c(t,er(e)),t}function rr(e){let t=_.useContext(vn);return c(t,er(e)),t}function ir(e){let t=_.useContext(yn);return c(t,er(e)),t}function ar(e){let t=_.useContext(kn);return c(t,`${e} can only be used on routes that contain a unique "id"`),t}function or(){let{navigation:e}=ir(`useNavigation`);return _.useMemo(()=>{let{matches:t,historyAction:n,...r}=e;return r},[e])}function sr(){let{matches:e}=nr(`useMatches`),{loaderData:t}=rr(`useMatches`);return _.useMemo(()=>e.map(e=>k(e,t)),[e,t])}function cr(){let e=_.useContext(An),t=rr(`useRouteError`),n=ar(`useRouteError`);return e===void 0?t.errors?.[n]:e}function lr(){let{router:e}=tr(`useNavigate`),t=ar(`useNavigate`),n=_.useRef(!1);return _.useLayoutEffect(()=>{n.current=!0}),_.useCallback(async(r,i={})=>{l(n.current,zn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var ur={};function dr(e,t,n){!t&&!ur[e]&&(ur[e]=!0,l(!1,n))}export{ye as A,s as B,Dn as C,it as D,rt as E,K as F,n as G,c as H,oe as I,we as L,T as M,G as N,Be as O,xe as P,pe as R,Tn as S,xn as T,m as U,p as V,l as W,vn as _,In as a,Cn as b,sr as c,Un as d,Wn as f,gn as g,wn as h,nr as i,ve as j,Ue as k,Bn as l,Kn as m,tr as n,Ln as o,Gn as p,rr as r,Rn as s,ar as t,or as u,yn as v,Sn as w,En as x,_n as y,le as z};
1
+ import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{Sa as t}from"./ui-B4vXT8-w.js";var n=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,r=/^[\\/]{2}/;function i(e,t){return t+e.replace(/\\/g,`/`)}var a=`popstate`;function o(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function s(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return f(``,{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:p(t)}return h(t,n,null,e)}function c(e,t){if(e===!1||e==null)throw Error(t)}function l(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function u(){return Math.random().toString(36).substring(2,10)}function d(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 f(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?m(t):t,state:n,key:t&&t.key||r||u(),mask:i}}function p({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 m(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 h(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,c=i.history,l=`POP`,u=null,p=m();p??(p=0,c.replaceState({...c.state,idx:p},``));function m(){return(c.state||{idx:null}).idx}function h(){l=`POP`;let e=m(),t=e==null?null:e-p;p=e,u&&u({action:l,location:b.location,delta:t})}function _(e,t){l=`PUSH`;let r=o(e)?e:f(b.location,e,t);n&&n(r,e),p=m()+1;let a=d(r,p),h=b.createHref(r.mask||r);try{c.pushState(a,``,h)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(h)}s&&u&&u({action:l,location:b.location,delta:1})}function v(e,t){l=`REPLACE`;let r=o(e)?e:f(b.location,e,t);n&&n(r,e),p=m();let i=d(r,p),a=b.createHref(r.mask||r);c.replaceState(i,``,a),s&&u&&u({action:l,location:b.location,delta:0})}function y(e){return g(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(a,h),u=e,()=>{i.removeEventListener(a,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:_,replace:v,go(e){return c.go(e)}};return b}function g(e,t,n=!1){let i=`http://localhost`;e&&(i=e.location.origin===`null`?e.location.href:e.location.origin),c(i,`No window.location.(origin|href) available to create URL`);let a=typeof t==`string`?t:p(t);return a=a.replace(/ $/,`%20`),!n&&r.test(a)&&(a=i+a),new URL(a,i)}var _=e(t(),1),v=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)}},y=class extends Error{},b=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`,`unstable_validateParams`]);function x(e){return b.has(e)}var S=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`,`unstable_validateParams`]);function C(e){return S.has(e)}function w(e){return e.index===!0}function T(e){let t={};return e.Component&&Object.assign(t,{element:_.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:_.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:_.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function E(e,t=T,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(c(e.index!==!0||!e.children,`Cannot specify children on an index route`),c(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),w(e)){let n={...e,id:s};return r[s]=D(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=D(n,t(n)),e.children&&(n.children=E(e.children,t,o,r,i)),n}})}function D(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function O(e,t,n=`/`){return ee(e,t,n,!1)}function ee(e,t,n,r,i){let a=le((typeof t==`string`?m(t):t).pathname||`/`,n);if(a==null)return null;let o=i??te(e),s=null,c=ce(a);for(let e=0;s==null&&e<o.length;++e)s=B(o[e],c,r);return s}function k(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 te(e){let t=A(e);return M(t),t}function A(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let l={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(l.relativePath.startsWith(`/`)){if(!l.relativePath.startsWith(r)&&o)return;c(l.relativePath.startsWith(r),`Absolute route path "${l.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),l.relativePath=l.relativePath.slice(r.length)}let u=K([r,l.relativePath]),d=n.concat(l);e.children&&e.children.length>0&&(c(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),A(e.children,t,d,u,o)),(e.path!=null||e.index)&&t.push({path:u,score:ie(u,e.index),routesMeta:d.map((e,t)=>{let[n,r]=se(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 j(e.path))a(e,t,!0,n)}),t}function j(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=j(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 M(e){e.sort((e,t)=>e.score===t.score?ae(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var N=/^:[\w-]+$/,P=/^:[\w-]+/,ne=3.5,F=3,I=2,L=1,R=10,z=-2,re=e=>e===`*`;function ie(e,t){let n=e.split(`/`),r=n.length;return n.some(re)&&(r+=z),t&&(r+=I),n.filter(e=>!re(e)).reduce((e,t)=>e+(N.test(t)?F:P.test(t)?ne:t===``?L:R),r)}function ae(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 B(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?V(u,l,s.matcher,s.compiledParams):oe(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=oe({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:K([a,d.pathname]),pathnameBase:ge(K([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=K([a,d.pathnameBase]))}return o}function oe(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=se(e.path,e.caseSensitive,e.end);return V(e,t,n,r)}function V(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=he(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=he(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function se(e,t=!1,n=!0){l(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(/\/((?:[^/?()[\]*^\\]|\\.)+)\?(?=\/|$|\()/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 ce(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return l(!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 le(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 H({basename:e,pathname:t}){return t===`/`?e:K([e,t])}var ue=e=>n.test(e);function de(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?m(e):e,a;return n?(n=me(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?U(n.substring(1),`/`):U(n,t)):a=t,{pathname:a,search:q(r),hash:_e(i)}}function U(e,t){let n=he(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function fe(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 W(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function G(e){let t=W(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function pe(e,t,n,r=!1){let i;typeof e==`string`?i=m(e):(i={...e},c(!i.pathname||!i.pathname.includes(`?`),fe(`?`,`pathname`,`search`,i)),c(!i.pathname||!i.pathname.includes(`#`),fe(`#`,`pathname`,`hash`,i)),c(!i.search||!i.search.includes(`#`),fe(`#`,`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 l=de(i,s),u=o&&o!==`/`&&o.endsWith(`/`),d=(a||o===`.`)&&n.endsWith(`/`);return!l.pathname.endsWith(`/`)&&(u||d)&&(l.pathname+=`/`),l}var me=e=>e.replace(/[\\/]{2,}/g,`/`),K=e=>me(e.join(`/`));function he(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var ge=e=>he(e).replace(/^\/*/,`/`),q=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,_e=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,ve=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],ye=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 be(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function xe(e){return K(e.map(e=>e.route.path).filter(Boolean))||`/`}function Se(e,t){let n=new URL(typeof e==`string`||e instanceof URL?e:e.url),r=typeof t==`string`?m(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 Ce=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function we(e,t){let a=e;if(typeof a!=`string`||!n.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let o=a,s=!1;if(Ce)try{let e=new URL(window.location.href),n=r.test(a)?new URL(i(a,e.protocol)):new URL(a),o=le(n.pathname,t);n.origin===e.origin&&o!=null?a=o+n.search+n.hash:s=!0}catch{l(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:s,to:a}}var Te=Symbol(`Uninstrumented`),Ee=new WeakMap;function De(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)=>Ne(await J(n.lazy,void 0,()=>e(...t),Y))}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)=>Ne(await J(n[`lazy.middleware`],void 0,()=>t(...e),Y))})}if(typeof e.loader==`function`&&n[`lazy.loader`].length>0){let t=e.loader;r.lazy=Object.assign(r.lazy||{},{loader:async(...e)=>Ne(await J(n[`lazy.loader`],void 0,()=>t(...e),Y))})}if(typeof e.action==`function`&&n[`lazy.action`].length>0){let t=e.action;r.lazy=Object.assign(r.lazy||{},{action:async(...e)=>Ne(await J(n[`lazy.action`],void 0,()=>t(...e),Y))})}}if(typeof t.loader==`function`&&n.loader.length>0){let e=ke(t.loader),i=async(...t)=>Ne(await J(n.loader,Pe(t[0]),()=>e(...t),Y));e.hydrate===!0&&(i.hydrate=!0),Ae(i,e),r.loader=i}if(typeof t.action==`function`&&n.action.length>0){let e=ke(t.action),i=async(...t)=>Ne(await J(n.action,Pe(t[0]),()=>e(...t),Y));Ae(i,e),r.action=i}return t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=ke(e),r=async(...e)=>Ne(await J(n.middleware,Pe(e[0]),()=>t(...e),Y));return Ae(r,t),r})),r}function Oe(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=ke(e.navigate),r=async(...r)=>{let[i,a]=r,o,s={to:typeof i==`number`||typeof i==`string`?i:i?p(i):`.`,...Fe(e,a??{})};return Ne(await J(n.navigate,s,async()=>{if(typeof i==`number`)return await t(...r);let n=je(e,e=>{o=e});try{return await t(...r)}finally{n()}},e=>({...Y(e),meta:o})))};Ae(r,t),e.navigate=r}if(n.fetch.length>0){let t=ke(e.fetch),r=async(...r)=>{let[i,a,o,s]=r,c;return Ne(await J(n.fetch,{href:o??`.`,fetcherKey:i,...Fe(e,s??{})},async()=>{let n=je(e,e=>{c=e});try{return await t(...r)}finally{n()}},e=>({...Y(e),meta:c})))};Ae(r,t),e.fetch=r}return e}function ke(e){return e[Te]??e}function Ae(e,t){e[Te]=t}function je(e,t){return Ee.set(e,t),()=>{Ee.get(e)===t&&Ee.delete(e)}}function Me(e){let t=Ee.get(e);return Ee.delete(e),t}function Ne(e){if(e.type===`error`)throw e.value;return e.value}async function J(e,t,n,r,i={result:null,innerResult:null},a=e.length-1){let o=e[a];if(o){let s,l=async()=>(s?console.error(`You cannot call instrumented handlers more than once`):s=J(e,t,n,r,i,a-1),await s,c(i.innerResult,`Expected an inner result`),i.innerResult);try{await o(l,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}s||await l(),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={type:`error`,value:Error(`No result assigned in instrumentation chain.`)},i.innerResult=r(i.result,t)),i.result}function Y(e){return e.type===`error`&&e.value instanceof Error?{status:`error`,error:e.value}:{status:`success`,error:void 0}}function Pe(e){let{request:t,context:n,params:r}=e;return{...e,request:Ie(t),params:{...r},context:Le(n)}}function Fe(e,t){return{currentUrl:p(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 Ie(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Le(e){return{get:t=>e.get(t)}}var Re=class{#e=[];#t=[];#n;#r=0;constructor(e){this.#n=e}update(e){this.#e=e,this.#t=te(e),this.#r=this.#t.reduce((e,t)=>e+t.routesMeta.length,0)}get matchCost(){return this.#r}match(e,t=!1){return ee(this.#e,e,this.#n,t,this.#t)}},ze=new URL(`http://localhost`);function Be(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),ze)}catch{return ze}}function Ve(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function He(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function Ue(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Ve(i,n),s=!Ve(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!He(e,i)||!Ve(i,a)))throw Error(`External navigation is not allowed`)}var We=[`POST`,`PUT`,`PATCH`,`DELETE`],Ge=new Set(We),Ke=[`GET`,...We],qe=new Set(Ke),Je=new Set([301,302,303,307,308]),Ye=new Set([307,308]),Xe={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},Ze={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Qe={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},$e=`remix-router-transitions`,et=Symbol(`ResetLoaderData`);function tt(e,t){return e.unstable_routePatternMatching?(c(void 0,`You must call unstable_preloadRoutePattern() from "react-router/route-pattern" before enabling future.unstable_routePatternMatching.`),new(void 0)(t)):new Re(t)}var nt=class{#e;#t;#n;constructor(e,t){this.#e=e,this.#n=t,this.#n.update(e)}get stableRoutes(){return this.#e}get activeRoutes(){return this.#t??this.#e}get hasHMRRoutes(){return this.#t!=null}setRoutes(e){this.#e=e,this.#t||this.#n.update(e)}setHmrRoutes(e){this.#t=e,this.#n.update(e)}commitHmrRoutes(){this.#t&&(this.#e=this.#t,this.#t=void 0,this.#n.update(this.#e))}},rt=new WeakMap;function it(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;c(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let i=e.hydrationRouteProperties||[],a=e.mapRouteProperties,o=a||(()=>({}));if(e.instrumentations){let t=e.instrumentations;o=e=>({...a?.(e),...De(t.map(e=>e.route).filter(Boolean),e)})}let s={...e.future},u=e.basename||`/`;u.startsWith(`/`)||(u=`/${u}`);let d=tt(s,u),h={},_=new nt(E(e.routes,o,void 0,h),d),b=e.dataStrategy||xt,x=null,S=new Set,C=null,w=null,T=null,D=e.hydrationData!=null,O=d.match(e.history.location),ee=!1,te=null,A,j;if(O==null&&!e.patchRoutesOnNavigation){let t=X(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Wt(_.activeRoutes);A=!0,j=!A,O=n,te={[r.id]:t}}else if(O&&!e.hydrationData&&ht(O,e.history.location.pathname).active&&(O=null),!O){A=!1,j=!A,O=[];let t=ht(null,e.history.location.pathname);t.active&&t.matches&&(ee=!0,O=t.matches)}else if(O.some(e=>e.route.lazy))A=!1,j=!A;else if(!O.some(e=>lt(e.route)))A=!0,j=!A;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=O;if(n){let e=O.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}j=!1,A=!0,r.forEach(e=>{let r=ut(e.route,t,n);j||=r.renderFallback,A&&=!r.shouldLoad})}let M,N={historyAction:e.history.action,location:e.history.location,matches:O,initialized:A,renderFallback:j,navigation:Xe,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||te,fetchers:new Map,blockers:new Map},P=`POP`,ne=0,F,I=null,L=!1,R,z=!1,re=new Map,ie=null,ae=!1,B=!1,oe=new Set,V=new Map,se=0,ce=-1,H=new Map,de=new Set,U=new Map,fe=new Map,W=new Set,G=new Map,pe,me=null;function K(){if(x=e.history.listen(({action:t,location:n,delta:r})=>{if(pe){pe(),pe=void 0;return}l(G.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=et({currentLocation:N.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{pe=e});e.history.go(r*-1),$e(i,{state:`blocked`,location:n,proceed(){$e(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(N.blockers);e.set(i,Qe),q({blockers:e})}}),I?.resolve(),I=null}else return s.unstable_customRouteDiscovery&&(ne+=r||0),Se(t,n)}),n){pn(t,re);let e=()=>mn(t,re);t.addEventListener(`pagehide`,e),ie=()=>t.removeEventListener(`pagehide`,e)}return N.initialized||Se(`POP`,N.location,{initialHydration:!0}),M}function he(){x&&x(),ie&&ie(),S.clear(),R&&R.abort(),N.fetchers.forEach((e,t)=>Be(N.fetchers,t)),N.blockers.forEach((e,t)=>Je(t))}function ge(e){return S.add(e),()=>S.delete(e)}function q(e,t={}){let n=e.errors??null,r=n?rt.get(n):void 0;r!==void 0&&(n=r),(e.errors!==void 0||e.initialized)&&(N.errors&&rt.delete(N.errors),e.errors&&rt.set(e.errors,n)),e.matches&&=e.matches.map(e=>{let t=h[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),N={...N,...e};let i=[],a=[];N.fetchers.forEach((e,t)=>{e.state===`idle`&&(W.has(t)?i.push(t):a.push(t))}),W.forEach(e=>{!N.fetchers.has(e)&&!V.has(e)&&i.push(e)}),[...S].forEach(e=>e(N,{deletedFetchers:i,newErrors:n,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),i.forEach(e=>Be(N.fetchers,e)),a.forEach(e=>N.fetchers.delete(e))}function _e(t,n,{flushSync:r}={}){let i=N.actionData!=null&&N.navigation.formMethod!=null&&Q(N.navigation.formMethod)&&N.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?N.actionData:null;let o=n.loaderData?Vt(N.loaderData,n.loaderData,n.matches||[],n.errors):N.loaderData,s=N.blockers;s.size>0&&!ae&&(s=new Map(s),s.forEach((e,t)=>s.set(t,Qe)));let c=!ae&&pt(t,n.matches||N.matches),l=L===!0||N.navigation.formMethod!=null&&Q(N.navigation.formMethod)&&t.state?._isRedirect!==!0;_.commitHmrRoutes(),ae||P===`POP`||(P===`PUSH`?e.history.push(t,t.state):P===`REPLACE`&&e.history.replace(t,t.state));let u;if(P===`POP`&&!ae&&t!==N.location){let e=re.get(N.location.pathname);e&&e.has(t.pathname)?u={currentLocation:N.location,nextLocation:t}:re.has(t.pathname)&&(u={currentLocation:t,nextLocation:N.location})}else if(z){let e=re.get(N.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),re.set(N.location.pathname,e)),u={currentLocation:N.location,nextLocation:t}}q({...n,actionData:a,loaderData:o,historyAction:P,location:t,initialized:!0,renderFallback:!1,navigation:Xe,revalidation:`idle`,restoreScrollPosition:c,preventScrollReset:l,blockers:s},{viewTransitionOpts:u,flushSync:r===!0}),ve(),I?.resolve(),I=null,me?.resolve(),me=null}function ve(){ne=0,P=`POP`,L=!1,z=!1,ae=!1,B=H.size>0}async function ye(t,n){if(F&&await F,I?.resolve(),I=null,typeof t==`number`){I||=hn();let n=I.promise;return e.history.go(t),n}let i=Me(M),{path:a,submission:o,error:s}=st(!1,ot(N.location,N.matches,u,t,n?.fromRouteId,n?.relative),n),c;if(n?.mask){let t=typeof n.mask==`string`?m(n.mask):{...N.location.mask,...n.mask};if(c={pathname:t.pathname??``,search:t.search??``,hash:t.hash??``},r.test(c.pathname))throw Error(`External navigation is not allowed`);c.pathname.startsWith(`\\`)&&(c.pathname=c.pathname.replace(/^\\+/,`/`)),Ue(typeof n.mask==`string`?n.mask:p(n.mask),p(c),e.history.createURL(`/`),`reject`)}let l=N.location,d=f(l,a,n&&n.state,void 0,c);d={...d,...e.history.encodeLocation(d)},Ue(t==null?e.history.createHref(N.location):typeof t==`string`?t:p(t),e.history.createHref(d.mask||d),e.history.createURL(`/`),`reject`);let h=n&&n.replace!=null?n.replace:void 0,g=`PUSH`,_=N.location.pathname+N.location.search;h===!0?g=`REPLACE`:h===!1||o!=null&&Q(o.formMethod)&&(o.formAction===_||d.pathname+d.search===_)&&(g=`REPLACE`);let v=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,y=(n&&n.flushSync)===!0,b=et({currentLocation:l,nextLocation:d,historyAction:g});b?$e(b,{state:`blocked`,location:d,proceed(){$e(b,{state:`proceeding`,proceed:void 0,reset:void 0,location:d}),ye(t,n)},reset(){let e=new Map(N.blockers);e.set(b,Qe),q({blockers:e})}}):await Se(g,d,{submission:o,pendingError:s,preventScrollReset:v,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:y,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate,instrumentationNavigateMetaReceiver:i})}function xe(){if(F)return F.then(xe);me||=hn(),Fe(),q({revalidation:`loading`});let e=me.promise;return N.navigation.state===`submitting`?e:N.navigation.state===`idle`?(Se(N.historyAction,N.location,{startUninterruptedRevalidation:!0,dataStrategyInitiator:`revalidation`}),e):(Se(P||N.historyAction,N.navigation.location,{overrideNavigation:N.navigation,dataStrategyInitiator:`revalidation`,enableViewTransition:z===!0}),e)}async function Se(t,n,r){F&&await F,R&&R.abort(),R=null,P=t,ae=(r&&r.startUninterruptedRevalidation)===!0,ft(N.location,N.matches),L=(r&&r.preventScrollReset)===!0,z=(r&&r.enableViewTransition)===!0;let i=r?.initialHydration&&N.matches&&N.matches.length>0&&!ee?N.matches:d.match(n),a=(r&&r.flushSync)===!0;if(i&&N.initialized&&!B&&qt(N.location,n)&&!(r&&r.submission&&Q(r.submission.formMethod))){_e(n,{matches:i},{flushSync:a});return}let o=ht(i,n.pathname);if(o.active&&o.matches&&(i=o.matches),r?.instrumentationNavigateMetaReceiver){let t=sn(e.history,n,i);r.instrumentationNavigateMetaReceiver(t)}if(!i){let{error:e,notFoundMatches:t,route:r}=it(n.pathname);_e(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:a});return}let s=r&&r.overrideNavigation?{...r.overrideNavigation,matches:i,historyAction:t}:void 0;R=new AbortController;let c=It(e.history,n,R.signal,r&&r.submission),l=r?.initialHydration?`initialization`:r?.dataStrategyInitiator??`navigation`,u=e.getContext?await e.getContext():new v,f;if(r&&r.pendingError)f=[Ut(i).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Q(r.submission.formMethod)){let d=await we(c,l,n,r.submission,i,t,u,o.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:a});if(d.shortCircuited)return;if(d.pendingActionResult){let[e,t]=d.pendingActionResult;if(Z(t)&&be(t.error)&&t.error.status===404){R=null,_e(n,{matches:d.matches,loaderData:{},errors:{[e]:t.error}});return}}i=d.matches||i,f=d.pendingActionResult,s=ln(n,i,t,r.submission),a=!1,o.active=!1,c=It(e.history,c.url,c.signal)}let{shortCircuited:p,matches:m,loaderData:h,errors:g,workingFetchers:_}=await Te(c,l,n,i,t,u,o.active,s,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,a,f,r&&r.callSiteDefaultShouldRevalidate);p||(R=null,_e(n,{matches:m||i,...Ht(f),loaderData:h,errors:g,..._?{fetchers:_}:{}}))}function Ce(){let t=hn();F=t.promise;let n=ne,r=I;I=null,R?.abort(),R=null,ve(),me?.resolve(),me=null;let i=new Map(N.blockers);i.forEach((e,t)=>{e.state===`proceeding`&&i.set(t,Qe)});let a=new Map(N.fetchers),o=Ge(a);a.forEach((e,t)=>{e.state===`loading`&&!V.has(t)&&(a.set(t,$(e.data)),o=!0)}),oe.clear(),q({navigation:Xe,revalidation:`idle`,blockers:i,...o?{fetchers:a}:{}});function s(){F=void 0,r?.resolve(),t.resolve()}return n?(pe=s,e.history.go(-n)):s(),t.promise}async function we(t,n,r,a,c,l,d,f,p,m={}){if(s.unstable_customRouteDiscovery||Fe(),q({navigation:un(r,c,l,a)},{flushSync:m.flushSync===!0}),f){let e=await gt(c,r.pathname,t.signal);if(s.unstable_customRouteDiscovery&&t.signal.aborted||e.type===`aborted`)return{shortCircuited:!0};if(e.type===`cancelled`)return await Ce(),{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Wt(_.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Ut(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)c=e.matches;else{let{notFoundMatches:e,error:t,route:n}=it(r.pathname);return{matches:e,pendingActionResult:[n.id,{type:`error`,error:t}]}}}s.unstable_customRouteDiscovery&&Fe();let g,v=on(c,r);if(!v.route.action&&!v.route.lazy)g={type:`error`,error:X(405,{method:t.method,pathname:r.pathname,routeId:v.route.id})};else{let e=await Y(t,r,Dt(o,h,t,r,c,v,p?[]:i,d),d,null,n,l);if(g=e[v.route.id],!g){for(let t of c)if(e[t.route.id]){g=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(Qt(g)){let r;return r=m&&m.replace!=null?m.replace:Ft(g.response.headers.get(`Location`),new URL(t.url),u,e.history)===N.location.pathname+N.location.search,await J(t,g,!0,n,{submission:a,replace:r}),{shortCircuited:!0}}if(Z(g)){let e=Ut(c,v.route.id);return(m&&m.replace)!==!0&&(P=`PUSH`),{matches:c,pendingActionResult:[e.route.id,g,v.route.id]}}return{matches:c,pendingActionResult:[v.route.id,g]}}async function Te(t,n,r,a,c,l,u,f,p,m,g,v,y,b,x){let S=f||ln(r,a,c,p),C=p||m||cn(S),w=!ae&&!v;if(u){if(w){let e=Ee(b);q({navigation:S,...e===void 0?{}:{actionData:e}},{flushSync:y})}let e=await gt(a,r.pathname,t.signal);if(s.unstable_customRouteDiscovery&&t.signal.aborted||e.type===`aborted`)return{shortCircuited:!0};if(e.type===`cancelled`)return await Ce(),{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Wt(_.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Ut(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)a=e.matches,v&&!t.signal.aborted&&q({matches:a});else{let{error:e,notFoundMatches:t,route:n}=it(r.pathname);return{matches:t,loaderData:{},errors:{[n.id]:e}}}}let{dsMatches:T,revalidatingFetchers:E}=ct(t,l,o,h,e.history,N,a,C,r,v?[]:i,v===!0,B,oe,W,U,de,d,b,x);if(ce=++se,!e.dataStrategy&&!T.some(e=>e.shouldLoad)&&!T.some(e=>e.route.middleware&&e.route.middleware.length>0)&&E.length===0){let e=new Map(N.fetchers),t=Ge(e);return _e(r,{matches:a,loaderData:{},errors:b&&Z(b[1])?{[b[0]]:b[1].error}:null,...Ht(b),...t?{fetchers:e}:{}},{flushSync:y}),{shortCircuited:!0}}if(w){let e={};if(!u){e.navigation=S;let t=Ee(b);t!==void 0&&(e.actionData=t)}E.length>0&&(e.fetchers=ke(E)),q(e,{flushSync:y})}E.forEach(e=>{He(e.key),e.controller&&V.set(e.key,e.controller)});let D=()=>E.forEach(e=>{V.get(e.key)===e.controller&&He(e.key)});R&&R.signal.addEventListener(`abort`,D);let{loaderResults:O,fetcherResults:ee}=await Pe(T,E,t,r,l,n,c);if(t.signal.aborted)return{shortCircuited:!0};R&&R.signal.removeEventListener(`abort`,D),E.forEach(e=>{V.get(e.key)===e.controller&&V.delete(e.key)});let k=Gt(O);if(k)return await J(t,k.result,!0,n,{replace:g}),{shortCircuited:!0};if(k=Gt(ee),k)return de.add(k.key),await J(t,k.result,!0,n,{replace:g}),{shortCircuited:!0};let te=new Map(N.fetchers),{loaderData:A,errors:j}=Bt(N,a,O,b,E,ee,te);if(v&&N.errors){let e=j??null;j={...N.errors,...j},rt.set(j,e)}let M=Ge(te),P=Ke(ce,te),ne=M||P||E.length>0;return{matches:a,loaderData:A,errors:j,...ne?{workingFetchers:te}:{}}}function Ee(e){if(e&&!Z(e[1]))return{[e[0]]:e[1].data};if(N.actionData)return Object.keys(N.actionData).length===0?null:N.actionData}function ke(e){let t=new Map(N.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=dn(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function Ae(t,n,r,i){F&&await F,He(t);let a=(i&&i.flushSync)===!0,o=Me(M),s=ot(N.location,N.matches,u,r,n,i?.relative),c=d.match(s),l=ht(c,s);if(l.active&&l.matches&&(c=l.matches),o&&o(sn(e.history,s,c)),!c){Le(t,n,X(404,{pathname:s}),{flushSync:a});return}let{path:f,submission:p,error:m}=st(!0,s,i);if(m){Le(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new v,g=(i&&i.preventScrollReset)===!0;if(p&&Q(p.formMethod)){await je(t,n,f,c,h,l.active,a,g,p,i&&i.defaultShouldRevalidate);return}let _={routeId:n,path:f,isDiscovering:l.active};U.set(t,_),await Ne(t,_,c,h,a,g,p)}async function je(t,n,r,a,l,u,f,p,m,g){s.unstable_customRouteDiscovery||Fe(),U.delete(t);let _=N.fetchers.get(t);Ie(t,fn(m,_),{flushSync:f});let v=new AbortController;s.unstable_customRouteDiscovery&&V.set(t,v);let y=It(e.history,r,v.signal,m);if(u){let e=await gt(a,new URL(y.url).pathname,y.signal,t);if(s.unstable_customRouteDiscovery&&y.signal.aborted||e.type===`aborted`)return;if(e.type===`cancelled`){V.delete(t),U.delete(t),Ie(t,$(_?.data),{flushSync:f});return}if(e.type===`error`){Le(t,n,e.error,{flushSync:f});return}if(e.matches)a=e.matches;else{Le(t,n,X(404,{pathname:r}),{flushSync:f});return}}let b=on(a,r);if(!b.route.action&&!b.route.lazy){Le(t,n,X(405,{method:m.formMethod,pathname:r,routeId:n}),{flushSync:f});return}s.unstable_customRouteDiscovery&&Fe(),V.set(t,v);let x=se,S=Dt(o,h,y,r,a,b,i,l),C=await Y(y,r,S,l,t,`fetcher`),w=C[b.route.id];if(!w){for(let e of S)if(C[e.route.id]){w=C[e.route.id];break}}if(y.signal.aborted){V.get(t)===v&&V.delete(t);return}if(W.has(t)){if(Z(w)){Ie(t,$(void 0));return}Qt(w)&&(B=!0,w={type:`data`,data:void 0})}else{if(Qt(w)){if(ce>x)B=!0,w={type:`data`,data:void 0};else return V.delete(t),de.add(t),Ie(t,dn(m)),J(y,w,!1,`fetcher`,{fetcherSubmission:m,preventScrollReset:p})}if(Z(w)){Le(t,n,w.error);return}}B=!0;let T=N.navigation.location||N.location,E=It(e.history,T,v.signal),D=N.navigation.state===`idle`?N.matches:d.match(N.navigation.location);c(D,`Didn't find any matches after fetcher action`);let O=++se;H.set(t,O);let{dsMatches:ee,revalidatingFetchers:k}=ct(E,l,o,h,e.history,N,D,m,T,i,!1,B,oe,W,U,de,d,[b.route.id,w],g),te=dn(m,w.data),A=new Map(N.fetchers);A.set(t,te),k.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=A.get(t),r=dn(void 0,n?n.data:void 0);A.set(t,r),He(t),e.controller&&V.set(t,e.controller)}),q({fetchers:A});let j=()=>k.forEach(e=>{V.get(e.key)===e.controller&&He(e.key)});v.signal.addEventListener(`abort`,j);let{loaderResults:M,fetcherResults:ne}=await Pe(ee,k,E,T,l,`fetcher`);if(v.signal.aborted){H.get(t)===O&&H.delete(t);return}v.signal.removeEventListener(`abort`,j),H.delete(t),V.delete(t),k.forEach(e=>{V.get(e.key)===e.controller&&V.delete(e.key)});let F=N.fetchers.has(t),I=e=>{if(!F)return e;let n=new Map(e.fetchers);return n.set(t,$(w.data)),{...e,fetchers:n}},L=Gt(M);if(L)return N=I(N),J(E,L.result,!1,`fetcher`,{preventScrollReset:p});if(L=Gt(ne),L)return de.add(L.key),N=I(N),J(E,L.result,!1,`fetcher`,{preventScrollReset:p});let z=new Map(N.fetchers);F&&z.set(t,$(w.data));let{loaderData:re,errors:ie}=Bt(N,D,M,void 0,k,ne,z);Ke(O,z),N.navigation.state===`loading`&&O>ce?(c(P,`Expected pending action`),R&&R.abort(),Ge(z),_e(N.navigation.location,{matches:D,loaderData:re,errors:ie,fetchers:z})):(q({errors:ie,loaderData:Vt(N.loaderData,re,D,ie),fetchers:z}),B=H.size>0)}async function Ne(t,n,r,a,c,l,u){let{routeId:d,path:f}=n,p=N.fetchers.get(t);Ie(t,dn(u,p?p.data:void 0),{flushSync:c});let m=new AbortController;s.unstable_customRouteDiscovery&&V.set(t,m);let g=It(e.history,f,m.signal);if(n.isDiscovering){let e=await gt(r,new URL(g.url).pathname,g.signal,t);if(s.unstable_customRouteDiscovery&&g.signal.aborted||e.type===`aborted`)return;if(e.type===`cancelled`){V.delete(t),U.delete(t),Ie(t,$(p?.data),{flushSync:c});return}if(e.type===`error`){Le(t,d,e.error,{flushSync:c});return}if(e.matches)r=e.matches,n.isDiscovering=!1;else{Le(t,d,X(404,{pathname:f}),{flushSync:c});return}}let _=on(r,f);V.set(t,m);let v=se,y=await Y(g,f,Dt(o,h,g,f,r,_,i,a),a,t,`fetcher`),b=y[_.route.id];if(!b){for(let e of r)if(y[e.route.id]){b=y[e.route.id];break}}if(V.get(t)===m&&V.delete(t),!g.signal.aborted){if(W.has(t))Ie(t,$(void 0));else{if(Qt(b)){if(ce>v){Ie(t,$(void 0));return}de.add(t),await J(g,b,!1,`fetcher`,{preventScrollReset:l});return}Z(b)?Le(t,d,b.error):Ie(t,$(b.data))}}}async function J(r,i,a,o,{submission:s,fetcherSubmission:l,preventScrollReset:d,replace:p}={}){a||(I?.resolve(),I=null),i.response.headers.has(`X-Remix-Revalidate`)&&(B=!0);let m=i.response.headers.get(`Location`);c(m,`Expected a Location header on the redirect Response`);let h=m,_=new URL(r.url);m=Ft(m,_,u,e.history),Ue(h,m,_,`allow-explicit`);let v=f(N.location,m,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(ue(m)){let n=g(t,m,!0);e=n.origin!==t.location.origin||le(n.pathname,u)==null}if(e){p?t.location.replace(m):t.location.assign(m);return}}R=null;let y=p===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:b,formAction:x,formEncType:S}=N.navigation;!s&&!l&&b&&x&&S&&(s=cn(N.navigation));let C=s||l;Ye.has(i.response.status)&&C&&Q(C.formMethod)?await Se(y,v,{submission:{...C,formAction:m},preventScrollReset:d||L,enableViewTransition:a?z:void 0,dataStrategyInitiator:o}):await Se(y,v,{overrideNavigation:ln(v,[],y,s),fetcherSubmission:l,preventScrollReset:d||L,enableViewTransition:a?z:void 0,dataStrategyInitiator:o})}async function Y(e,t,n,r,i,a,o=null){let s,c={};try{s=await Ot(b,e,t,n,i,a,r,!1,o)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{c[t.route.id]={type:`error`,error:e}}),c}if(e.signal.aborted)return c;if(!Q(e.method))for(let e of n){if(s[e.route.id]?.type===`error`)break;s.hasOwnProperty(e.route.id)||N.loaderData.hasOwnProperty(e.route.id)||N.errors&&N.errors.hasOwnProperty(e.route.id)||!e.shouldCallHandler()||(s[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(s))if(Zt(r)){let i=r.result;c[t]={type:`redirect`,response:Mt(i,e,t,n,u)}}else c[t]=await jt(r);return c}async function Pe(e,t,n,r,i,a,o=null){let s=Y(n,r,e,i,null,a,o),c=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await Y(e.request,e.path,e.matches,i,e.key,a,o))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:X(404,{pathname:e.path})}})}));return{loaderResults:await s,fetcherResults:(await c).reduce((e,t)=>Object.assign(e,t),{})}}function Fe(){B=!0,U.forEach((e,t)=>{s.unstable_customRouteDiscovery&&e.isDiscovering||(V.has(t)&&oe.add(t),He(t))})}function Ie(e,t,n={}){let r=new Map(N.fetchers);r.set(e,t),q({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function Le(e,t,n,r={}){let i=Ut(N.matches,t),a=new Map(N.fetchers);Be(a,e),q({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Re(e){return fe.set(e,(fe.get(e)||0)+1),W.has(e)&&W.delete(e),N.fetchers.get(e)||Ze}function ze(e,t){He(e,t?.reason),U.delete(e),oe.delete(e),Ie(e,$(null))}function Be(e,t){let n=N.fetchers.get(t);V.has(t)&&!(n&&n.state===`loading`&&H.has(t))&&He(t),U.delete(t),H.delete(t),de.delete(t),W.delete(t),oe.delete(t),e.delete(t)}function Ve(e){let t=(fe.get(e)||0)-1;t<=0?(fe.delete(e),W.add(e)):fe.set(e,t),q({fetchers:new Map(N.fetchers)})}function He(e,t){let n=V.get(e);n&&(n.abort(t),V.delete(e))}function We(e,t){for(let n of e){let e=t.get(n);c(e,`Expected fetcher: ${n}`);let r=$(e.data);t.set(n,r)}}function Ge(e){let t=[],n=!1;for(let r of de){let i=e.get(r);c(i,`Expected fetcher: ${r}`),i.state===`loading`&&(de.delete(r),t.push(r),n=!0)}return We(t,e),n}function Ke(e,t){let n=[];for(let[r,i]of H)if(i<e){let e=t.get(r);c(e,`Expected fetcher: ${r}`),e.state===`loading`&&(He(r),H.delete(r),n.push(r))}return We(n,t),n.length>0}function qe(e,t){let n=N.blockers.get(e)||Qe;return G.get(e)!==t&&G.set(e,t),n}function Je(e){N.blockers.delete(e),G.delete(e)}function $e(e,t){let n=N.blockers.get(e)||Qe;c(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(N.blockers);r.set(e,t),q({blockers:r})}function et({currentLocation:e,nextLocation:t,historyAction:n}){if(G.size===0)return;G.size>1&&l(!1,`A router only supports one blocker at a time`);let r=Array.from(G.entries()),[i,a]=r[r.length-1],o=N.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function it(e){let t=X(404,{pathname:e}),n=_.activeRoutes,{matches:r,route:i}=Wt(n);return{notFoundMatches:r,route:i,error:t}}function at(e,t,n){if(C=e,T=t,w=n||null,!D&&N.navigation===Xe){D=!0;let e=pt(N.location,N.matches);e!=null&&q({restoreScrollPosition:e})}return()=>{C=null,T=null,w=null}}function dt(e,t){return w&&w(e,t.map(e=>k(e,N.loaderData)))||e.key}function ft(e,t){if(C&&T){let n=dt(e,t);C[n]=T()}}function pt(e,t){if(C){let n=dt(e,t),r=C[n];if(typeof r==`number`)return r}return null}function ht(t,n){if(e.patchRoutesOnNavigation){if(!t)return{active:!0,matches:d.match(n,!0)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:d.match(n,!0)}}return{active:!1,matches:null}}async function gt(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let a=t;for(;;){let t=h;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:a,fetcherKey:i,patch:(e,n)=>{r.aborted||mt(e,n,_,t,o,!1)}})}catch(e){if(s.unstable_customRouteDiscovery){if(r.aborted)return{type:`aborted`};if(e instanceof y)return{type:`cancelled`}}return{type:`error`,error:e,partialMatches:a}}if(r.aborted)return{type:`aborted`};let c=d.match(n),l=null;if(c&&(Object.keys(c[0].params).length===0||(l=d.match(n,!0),!(l&&a.length<l.length&&_t(a,l.slice(0,a.length))))))return{type:`success`,matches:c};if(l||=d.match(n,!0),!l||_t(a,l))return{type:`success`,matches:null};a=l}}function _t(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function vt(e){h={},_.setHmrRoutes(E(e,o,void 0,h))}function yt(e,t,n=!1){mt(e,t,_,h,o,n),_.hasHMRRoutes||q({})}return M={get basename(){return u},get future(){return s},get state(){return N},get routes(){return _.stableRoutes},match(e){return d.match(e)},get manifest(){return h},get window(){return t},initialize:K,subscribe:ge,enableScrollRestoration:at,navigate:ye,fetch:Ae,revalidate:xe,createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Re,resetFetcher:ze,deleteFetcher:Ve,dispose:he,getBlocker:qe,deleteBlocker:Je,patchRoutes:yt,_internalFetchControllers:V,_internalSetRoutes:vt,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){q(e)}},e.instrumentations&&(M=Oe(M,e.instrumentations.map(e=>e.router).filter(Boolean))),M}function at(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function ot(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=pe(r||`.`,G(o),le(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=an(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=H({basename:n,pathname:c.pathname})),p(c)}function st(e,t,n){if(!n||!at(n))return{path:t};if(n.formMethod&&!rn(n.formMethod))return{path:t,error:X(405,{method:n.formMethod})};let r=()=>({path:t,error:X(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Kt(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Q(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(!Q(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()}}}c(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Lt(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Lt(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Rt(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Rt(o)}catch{return r()}let l={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(Q(l.formMethod))return{path:t,submission:l};let u=m(t);return e&&u.search&&an(u.search)&&o.append(`index`,``),u.search=`?${o}`,{path:p(u),submission:l}}function ct(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){let y=_?Z(_[1])?_[1].error:_[1].data:void 0,b=i.createURL(a.location),x=i.createURL(c),S;if(u&&a.errors){let e=Object.keys(a.errors)[0];S=o.findIndex(t=>t.route.id===e)}else if(_&&Z(_[1])){let e=_[0];S=o.findIndex(t=>t.route.id===e)-1}let C=_?_[1].statusCode:void 0,w=C&&C>=400,T={currentUrl:b,currentParams:a.matches[0]?.params||{},nextUrl:x,nextParams:o[0].params,...s,actionResult:y,actionStatus:C},E=xe(o),D=o.map((i,o)=>{let{route:s}=i,f=null;if(S!=null&&o>S)f=!1;else if(s.lazy)f=!0;else if(!lt(s))f=!1;else if(u){let{shouldLoad:e}=ut(s,a.loaderData,a.errors);f=e}else dt(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Et(n,r,e,c,E,i,l,t,f);let p=!1;typeof v==`boolean`?p=v:w?p=!1:d||b.pathname+b.search===x.pathname+x.search?p=!0:b.search===x.search?ft(a.matches[o],i)&&(p=!0):p=!0;let m={...T,defaultShouldRevalidate:p};return Et(n,r,e,c,E,i,l,t,pt(i,m),m,v)}),O=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s)||e.isDiscovering)return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,_=g.match(e.path);if(!_){O.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let y=on(_,e.path),b=new AbortController,x=It(i,e.path,b.signal),S=null;if(f.has(s))f.delete(s),S=Dt(n,r,x,e.path,_,y,l,t);else if(m)d&&(S=Dt(n,r,x,e.path,_,y,l,t));else{let i;i=typeof v==`boolean`?v:!w&&d;let a={...T,defaultShouldRevalidate:i};pt(y,a)&&(S=Dt(n,r,x,e.path,_,y,l,t,a))}S&&O.push({key:s,routeId:e.routeId,path:e.path,matches:S,match:y,request:x,controller:b})}),{dsMatches:D,revalidatingFetchers:O}}function lt(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function ut(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!lt(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 dt(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function ft(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function pt(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function mt(e,t,n,r,i,a){let o;if(e){let t=r[e];c(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],l=[];if(t.forEach(e=>{let t=o.find(t=>ht(e,t));t?l.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=E(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&l.length>0)for(let e=0;e<l.length;e++){let{existingRoute:t,newRoute:n}=l[e],r=t,[a]=E([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 ht(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=>ht(e,t)))??!1}var gt=new WeakMap,_t=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(c(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=gt.get(i);o||(o={},gt.set(i,o));let s=o[e];if(s)return s;let u=(async()=>{let t=x(e),n=i[e]!==void 0;if(t)l(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)l(!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]=u,u.catch(()=>{o[e]===u&&delete o[e]}),u},vt=new WeakMap;function yt(e,t,n,r,i){let a=n[e.id];if(c(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=vt.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{c(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=C(e),o=a[e]!==void 0;i?l(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?l(!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 vt.set(a,n),n.catch(()=>{vt.get(a)===n&&vt.delete(a)}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],u;for(let a of o){if(i&&i.includes(a))continue;let o=_t({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(u=o))}let d=s.length>0?Promise.all(s).then(()=>{}):void 0;return d?.catch(()=>{}),u?.catch(()=>{}),{lazyRoutePromise:d,lazyHandlerPromise:u}}async function bt(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 xt(e){return e.matches.some(e=>e.route.middleware)?St(e,()=>bt(e)):bt(e)}function St(e,t){return Ct(e,t,e=>{if(nn(e))throw e;return e},Yt,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{[Ut(r,a).route.id]:{type:`error`,result:t}}}}}async function Ct(e,t,n,r,i){let{matches:a,...o}=e;return await wt(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function wt(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 wt(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 Tt(e,t,n,r,i){let a=_t({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=yt(r.route,Q(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Et(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=Tt(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?pt(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?pt(a,{...l,defaultShouldRevalidate:e}):pt(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Q(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Q(n.method)||!p)?kt({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 Dt(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Et(e,t,n,r,xe(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:Tt(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Ot(e,t,n,r,i,a,o,s,c=null){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let l={request:t,url:Se(t,n),pattern:xe(r),params:r[0].params,context:o,matches:r,unstable_initiator:a,unstable_navigationType:a===`navigation`?c:null},u=s?()=>{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=l;return St(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},d=await e({...l,fetcherKey:i,runClientMiddleware:u});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return d}async function kt({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Q(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:Se(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 X(405,{method:e.method,pathname:n,routeId:r.route.id})}else return await a,{type:`data`,result:void 0}}}else if(t)c=await f(t);else{let t=new URL(e.url);throw X(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function At(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 jt(e){let{result:t,type:n}=e;if(en(t)){let e;try{e=await At(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new ye(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?$t(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:Jt(t),statusCode:be(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:be(t)?t.status:void 0}:$t(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 Mt(e,t,n,r,i){let a=e.headers.get(`Location`);if(c(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!ue(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=ot(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var Nt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Pt(e){try{return Nt.includes(new URL(e).protocol)}catch{return!1}}function Ft(e,t,n,a){if(ue(e)){let a=e,o=r.test(a)?new URL(i(a,t.protocol)):new URL(a);if(Pt(o.toString()))throw Error(`Invalid redirect location`);let s=le(o.pathname,n)!=null;if(o.origin===t.origin&&s)return me(o.pathname)+o.search+o.hash}try{if(Pt(a.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function It(e,t,n,r){let i=e.createURL(Kt(t)).toString(),a={signal:n};if(r&&Q(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?Lt(r.formData):r.formData}return new Request(i,a)}function Lt(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Rt(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function zt(e,t,n,r=!1,i=!1){let a={},o=null,s,l=!1,u={},d=n&&Z(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(c(!Qt(p),`Cannot handle redirect results in processLoaderData`),Z(p)){let t=p.error;if(d!==void 0&&(t=d,d=void 0),o||={},i)o[f]=t;else{let n=Ut(e,f);o[n.route.id]??(o[n.route.id]=t)}r||(a[f]=et),l||(l=!0,s=be(p.error)?p.error.status:500),p.headers&&(u[f]=p.headers)}else a[f]=p.data,p.statusCode&&p.statusCode!==200&&!l&&(s=p.statusCode),p.headers&&(u[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:u}}function Bt(e,t,n,r,i,a,o){let{loaderData:s,errors:l}=zt(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,routeId:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(c(s,`Did not find corresponding fetcher result`),Z(s)){let t=Ut(e.matches,r);l&&l[t.route.id]||(l={...l,[t.route.id]:s.error}),o.delete(n)}else if(Qt(s))c(!1,`Unhandled fetcher revalidation redirect`);else{let e=$(s.data);o.set(n,e)}}),{loaderData:s,errors:l}}function Vt(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==et).reduce((e,[t,n])=>(e[t]=n,e),{}),a=0;for(let o of n){let n=o.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&o.route.loader&&(i[n]=e[n],a++),r&&r.hasOwnProperty(n))break}return Object.keys(t).length===0&&a===Object.keys(e).length?e:i}function Ht(e){return e?Z(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ut(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 Wt(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 X(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 ye(e||500,o,Error(s),!0)}function Gt(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 Kt(e){return p({...typeof e==`string`?m(e):e,hash:``})}function qt(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function Jt(e){return new ye(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function Yt(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&Xt(t))}function Xt(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function Zt(e){return en(e.result)&&Je.has(e.result.status)}function Z(e){return e.type===`error`}function Qt(e){return(e&&e.type)===`redirect`}function $t(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function en(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function tn(e){return Je.has(e)}function nn(e){return en(e)&&tn(e.status)&&e.headers.has(`Location`)}function rn(e){return qe.has(e.toUpperCase())}function Q(e){return Ge.has(e.toUpperCase())}function an(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function on(e,t){let n=typeof t==`string`?m(t).search:t.search;if(e[e.length-1].route.index&&an(n||``))return e[e.length-1];let r=W(e);return r[r.length-1]}function sn(e,t,n){return{url:Se(e.createURL(t),t),pattern:n?xe(n):``,params:n?.[0]?.params?{...n[0].params}:{}}}function cn(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 ln(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 un(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 dn(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 fn(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 $(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 pn(e,t){try{let n=e.sessionStorage.getItem($e);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 mn(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem($e,JSON.stringify(n))}catch(e){l(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function hn(){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 gn=_.createContext(null);gn.displayName=`DataRouter`;var _n=_.createContext(null);_n.displayName=`DataRouterState`;var vn=_.createContext(null);vn.displayName=`DataRouterData`;var yn=_.createContext(null);yn.displayName=`DataRouterNavigation`;var bn=_.createContext(!1);function xn(){return _.useContext(bn)}var Sn=_.createContext({isTransitioning:!1});Sn.displayName=`ViewTransition`;var Cn=_.createContext(null);Cn.displayName=`Fetchers`;var wn=_.createContext(null);wn.displayName=`Await`;var Tn=_.createContext(null);Tn.displayName=`Navigation`;var En=_.createContext(null);En.displayName=`Location`;var Dn=_.createContext({outlet:null,matches:[],isDataRoute:!1});Dn.displayName=`Route`;var On=_.createContext(!1);On.displayName=`IsDataRoute`;var kn=_.createContext(void 0);kn.displayName=`RouteId`;var An=_.createContext(null);An.displayName=`RouteError`;var jn=`REACT_ROUTER_ERROR`,Mn=`REDIRECT`,Nn=`ROUTE_ERROR_RESPONSE`;function Pn(e){if(e.startsWith(`${jn}:${Mn}:{`))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 Fn(e){if(e.startsWith(`${jn}:${Nn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new ye(t.status,t.statusText,t.data)}catch{}}function In(e,{relative:t}={}){c(Ln(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=_.useContext(Tn),{hash:i,pathname:a,search:o}=Gn(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:K([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Ln(){return _.useContext(En)!=null}function Rn(){return c(Ln(),`useLocation() may be used only in the context of a <Router> component.`),_.useContext(En).location}var zn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Bn(){return _.useContext(On)?lr():Vn()}function Vn(){c(Ln(),`useNavigate() may be used only in the context of a <Router> component.`);let e=_.useContext(gn),{basename:t,navigator:n}=_.useContext(Tn),{matches:r}=_.useContext(Dn),{pathname:i}=Rn(),a=JSON.stringify(G(r)),o=_.useRef(!1);return _.useLayoutEffect(()=>{o.current=!0}),_.useCallback((r,s={})=>{if(l(o.current,zn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=pe(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:K([t,c.pathname])),Ue(typeof r==`string`?r:p(r),n.createHref(c),Be(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Hn=_.createContext(null);function Un(e){let t=_.useContext(Dn).outlet;return _.useMemo(()=>t&&_.createElement(Hn.Provider,{value:e},t),[t,e])}function Wn(){let{matches:e}=_.useContext(Dn);return e[e.length-1]?.params??{}}function Gn(e,{relative:t}={}){let{matches:n}=_.useContext(Dn),{pathname:r}=Rn(),i=JSON.stringify(G(n));return _.useMemo(()=>pe(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Kn(e,t,n){c(Ln(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=_.useContext(Tn),{matches:i}=_.useContext(Dn),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let s=a?a.pathnameBase:`/`;a&&a.route;let l=Rn(),u;if(t){let e=typeof t==`string`?m(t):t;c(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.`),u=e}else u=l;let d=u.pathname||`/`,f=d;if(s!==`/`){let e=s.replace(/^\//,``).split(`/`);f=`/`+d.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let p;p=n?n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):n.router.match(n.state.location):O(e,{pathname:f});let h=$n(p&&p.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:K([s,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?s:K([s,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?_.createElement(En.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...u},navigationType:`POP`}},h):h}function qn(){let e=cr(),t=be(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return _.createElement(_.Fragment,null,_.createElement(`h2`,null,`Unexpected Application Error!`),_.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?_.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var Jn=_.createElement(qn,null),Yn=class extends _.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=bn;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=Fn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:_.createElement(Dn.Provider,{value:this.props.routeContext},_.createElement(On.Provider,{value:this.props.routeContext.isDataRoute},_.createElement(kn.Provider,{value:this.props.routeContext.matches[this.props.routeContext.matches.length-1]?.route.id},_.createElement(An.Provider,{value:e,children:this.props.component}))));return this.context?_.createElement(Zn,{error:e},t):t}},Xn=new WeakMap;function Zn({children:e,error:t}){let{basename:n,navigator:r}=_.useContext(Tn);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Pn(t.digest);if(e){let i=Xn.get(t);if(i)throw i;let a=we(e.location,n),o=a.absoluteURL||a.to;if(Ue(e.location,o,Be(r),`allow-explicit`),Pt(o))throw Error(`Invalid redirect location`);if(Ce&&!Xn.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw Xn.set(t,n),n}}return _.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function Qn({routeContext:e,match:t,children:n}){let r=_.useContext(gn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),_.createElement(Dn.Provider,{value:e},_.createElement(On.Provider,{value:e.isDataRoute},_.createElement(kn.Provider,{value:t.route.id},n)))}function $n(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);c(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 l=n?.onError,u=r&&l?(e,t)=>{l(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:xe(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let l,d=!1,f=null,p=null;r&&(l=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Jn,o&&(s<0&&c===0?(dr(`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=l?f:d?p:n.route.Component?_.createElement(n.route.Component,null):n.route.element?n.route.element:e,_.createElement(Qn,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?_.createElement(Yn,{location:r.location,revalidation:r.revalidation,component:f,error:l,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:u}):h()},null)}function er(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function tr(e){let t=_.useContext(gn);return c(t,er(e)),t}function nr(e){let t=_.useContext(_n);return c(t,er(e)),t}function rr(e){let t=_.useContext(vn);return c(t,er(e)),t}function ir(e){let t=_.useContext(yn);return c(t,er(e)),t}function ar(e){let t=_.useContext(kn);return c(t,`${e} can only be used on routes that contain a unique "id"`),t}function or(){let{navigation:e}=ir(`useNavigation`);return _.useMemo(()=>{let{matches:t,historyAction:n,...r}=e;return r},[e])}function sr(){let{matches:e}=nr(`useMatches`),{loaderData:t}=rr(`useMatches`);return _.useMemo(()=>e.map(e=>k(e,t)),[e,t])}function cr(){let e=_.useContext(An),t=rr(`useRouteError`),n=ar(`useRouteError`);return e===void 0?t.errors?.[n]:e}function lr(){let{router:e}=tr(`useNavigate`),t=ar(`useNavigate`),n=_.useRef(!1);return _.useLayoutEffect(()=>{n.current=!0}),_.useCallback(async(r,i={})=>{l(n.current,zn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var ur={};function dr(e,t,n){!t&&!ur[e]&&(ur[e]=!0,l(!1,n))}export{ye as A,s as B,Dn as C,it as D,rt as E,K as F,n as G,c as H,oe as I,we as L,T as M,G as N,Be as O,xe as P,pe as R,Tn as S,xn as T,m as U,p as V,l as W,vn as _,In as a,Cn as b,sr as c,Un as d,Wn as f,gn as g,wn as h,nr as i,ve as j,Ue as k,Bn as l,Kn as m,tr as n,Ln as o,Gn as p,rr as r,Rn as s,ar as t,or as u,yn as v,Sn as w,En as x,_n as y,le as z};