@yuku123/z-cognition-component 2.0.1 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/dist-lib/BaseInput-DHrGPDB9.js +1096 -0
  2. package/dist-lib/ClockCircleOutlined-DP6fSLgk.js +12 -0
  3. package/dist-lib/Collapse-B77SsmFh.js +523 -0
  4. package/dist-lib/{ConceptsPage-BOeKdDKI.js → ConceptsPage-DOf_CJlz.js} +13 -16
  5. package/dist-lib/DeleteOutlined-BAZSAooQ.js +12 -0
  6. package/dist-lib/{DocsPage-BZOBFp3c.js → DocsPage-CiC7TU96.js} +4 -4
  7. package/dist-lib/EllipsisOutlined-Dr4orLLw.js +1109 -0
  8. package/dist-lib/EvidenceFormList-CrE2FzHk.js +90 -0
  9. package/dist-lib/{EyeOutlined-DGSrX-0M.js → EyeOutlined-CudyDdjH.js} +1 -1
  10. package/dist-lib/ImpactPage-CYiuqy0S.js +68 -0
  11. package/dist-lib/{LeftOutlined-Cgo6Izj-.js → LeftOutlined-CJasZIyX.js} +1 -1
  12. package/dist-lib/{OntologyDetailPage-B8DyU8WW.js → OntologyDetailPage-mgK_NQxP.js} +99 -93
  13. package/dist-lib/{OntologyInferPage-CvcjxpBB.js → OntologyInferPage-NUaoaQpN.js} +38 -40
  14. package/dist-lib/{OntologyListPage-Cb0XfpWE.js → OntologyListPage-C9wH01y0.js} +47 -49
  15. package/dist-lib/OntologyMaterializePage-D_fDqYHY.js +134 -0
  16. package/dist-lib/OntologyNodesPage-5kH7RHwE.js +2844 -0
  17. package/dist-lib/{OntologyValidatePage-abQVJwzV.js → OntologyValidatePage-DtkYK_l4.js} +49 -52
  18. package/dist-lib/Pagination-BJ8wnqAa.js +1112 -0
  19. package/dist-lib/PlusOutlined-BSTPGLOH.js +21 -0
  20. package/dist-lib/{ReloadOutlined-CS-e-TmN.js → ReloadOutlined-B26pDoyV.js} +19 -10
  21. package/dist-lib/{ResolvePage-rbQ-8nNZ.js → ResolvePage-Cz9HORZ3.js} +31 -33
  22. package/dist-lib/{RotateRightOutlined-q7zp2e47.js → RotateRightOutlined-DqyspFCO.js} +1 -1
  23. package/dist-lib/Skeleton-CxFsInYI.js +671 -0
  24. package/dist-lib/Table-Civ838nE.js +20514 -0
  25. package/dist-lib/{Table-CDagah-g.js → Table-J_7eBbi7.js} +414 -414
  26. package/dist-lib/TermDetailPage-BtkOpbPT.js +263 -0
  27. package/dist-lib/{TermsPage-CuufAyuL.js → TermsPage-BuzCMYov.js} +28 -31
  28. package/dist-lib/_commonjsHelpers-DaMA6jEr.js +8 -0
  29. package/dist-lib/accessAk-CA30m5eX.js +64 -0
  30. package/dist-lib/{agents-mAJW3cEN.js → agents-eZDKzePP.js} +41 -41
  31. package/dist-lib/{ai-BcYmZiRo.js → ai-CNSn3-sd.js} +32 -32
  32. package/dist-lib/{ai-chat-share-DO7GXjG4.js → ai-chat-share-Yrqt_J6a.js} +13 -14
  33. package/dist-lib/ak-manage-DklVFT5I.js +805 -0
  34. package/dist-lib/{approval-RPDUKg9-.js → approval-B-bCSmfi.js} +25 -26
  35. package/dist-lib/{approvals-CNjxJUpR.js → approvals-B0ggYiyD.js} +42 -43
  36. package/dist-lib/{assistant-FIQQziCn.js → assistant-Of0mgMsM.js} +33 -34
  37. package/dist-lib/{assistant-history-DsEGBJnq.js → assistant-history-DcyDhUzJ.js} +5 -5
  38. package/dist-lib/{assistant-summary-B-f3k55y.js → assistant-summary-CjLaTyFz.js} +1 -1
  39. package/dist-lib/{audit-NwnH1hm5.js → audit-wDNCfmOy.js} +1 -1
  40. package/dist-lib/{bios-CRwKtcit.js → bios-CIwO1AUK.js} +128 -130
  41. package/dist-lib/callSuper-CpMOVGin.js +7 -0
  42. package/dist-lib/callSuper-CwIeyYoc.js +7 -0
  43. package/dist-lib/category-9gqNseEa.js +76 -0
  44. package/dist-lib/causal-CzAYukj9.js +789 -0
  45. package/dist-lib/{changelog-DlL5u9o4.js → changelog-CQfIMS51.js} +2 -2
  46. package/dist-lib/changelog-sKJMQrlV.js +103 -0
  47. package/dist-lib/chat-panel-BPbqKckR.js +1543 -0
  48. package/dist-lib/chunk-6KYCQHYJ-DcgZQlO5.js +1627 -0
  49. package/dist-lib/code-space-D_ZE966E.js +1070 -0
  50. package/dist-lib/{colors-sdAcAcU3.js → colors-DpKdb8L-.js} +3 -3
  51. package/dist-lib/community-9_7ExHcm.js +70 -0
  52. package/dist-lib/community-CfWXxujB.js +217 -0
  53. package/dist-lib/community-material-page-Z_EZuBPl.js +747 -0
  54. package/dist-lib/connections-Bcqsp11M.js +1065 -0
  55. package/dist-lib/context-T27uno74.js +54 -0
  56. package/dist-lib/{createForOfIteratorHelper-DEx_aTey.js → createForOfIteratorHelper-CasBzL_Q.js} +1 -1
  57. package/dist-lib/{dayjs.min-BauDENhn.js → dayjs.min-DoEf5yCX.js} +1 -1
  58. package/dist-lib/detail-CV6xp_Jp.js +84 -0
  59. package/dist-lib/{detail-Cfb-zdr9.js → detail-DioaWKWj.js} +5847 -7224
  60. package/dist-lib/{detail-Dcfg3W8B.js → detail-EyLdjGpX.js} +71 -72
  61. package/dist-lib/development-CFcOIUKc.js +167 -0
  62. package/dist-lib/{docx-preview-B5nQuTwk.js → docx-preview-D4v2g8Yg.js} +1 -1
  63. package/dist-lib/{downloads-MkyxiHxi.js → downloads-DtV5hOQv.js} +3 -4
  64. package/dist-lib/{edit-DLGAM-Vo.js → edit-NtXUNj5N.js} +262 -266
  65. package/dist-lib/{editor-BtiheUpe.js → editor-KZhj-rwT.js} +25 -26
  66. package/dist-lib/editor-page-BaxK_OYm.js +1169 -0
  67. package/dist-lib/embed-mf8t3QXh.js +51841 -0
  68. package/dist-lib/embed.css +2 -2
  69. package/dist-lib/{evaluation-Dz9bUuhS.js → evaluation-CZTpC9v3.js} +14 -15
  70. package/dist-lib/execution-B6HmOA2_.js +159 -0
  71. package/dist-lib/focus-set-lt52maBX.js +38 -0
  72. package/dist-lib/{format-UGmYKemG.js → format-CWI99NCN.js} +1 -1
  73. package/dist-lib/graph-BllA9bmL.js +44 -0
  74. package/dist-lib/graph-DHV-rdiK.js +640 -0
  75. package/dist-lib/{index-o65vKUwa.js → index--AI-htgA.js} +44 -45
  76. package/dist-lib/index-2SysmGHo.js +1166 -0
  77. package/dist-lib/{index-CJSTTgTM.js → index-3J47mTL1.js} +10 -10
  78. package/dist-lib/index-4tbtbcAt.js +550 -0
  79. package/dist-lib/index-B12ZggsE.js +77 -0
  80. package/dist-lib/{index-D3GHtSlM.js → index-B5Roo82U.js} +49 -50
  81. package/dist-lib/{index-nQSVLWfW.js → index-B7SfTpox.js} +79 -81
  82. package/dist-lib/index-BEO8itgt.js +566 -0
  83. package/dist-lib/index-BPbOPT2j.js +413 -0
  84. package/dist-lib/index-BVgdmf6r.js +2487 -0
  85. package/dist-lib/index-Bd7AGv4a.js +34 -0
  86. package/dist-lib/index-BkJjYgKD.js +5012 -0
  87. package/dist-lib/{index-DBlG9uXV.js → index-BkTegt8T.js} +513 -590
  88. package/dist-lib/{index-BGB6NawZ.js → index-Bln3mJfp.js} +2 -2
  89. package/dist-lib/index-BoCtPJD4.js +915 -0
  90. package/dist-lib/{index-DMTPsTna.js → index-BqTsLClH.js} +3 -4
  91. package/dist-lib/index-Bs4MevzC.js +16075 -0
  92. package/dist-lib/index-BsoHetYT.js +236 -0
  93. package/dist-lib/{index-9aQ4BzIK.js → index-BvJ35WL3.js} +13 -14
  94. package/dist-lib/{index-BEjXaDfk.js → index-Bw4M9KLv.js} +84 -85
  95. package/dist-lib/index-C2CV4bte.js +242 -0
  96. package/dist-lib/{index-D_Qey9G8.js → index-CF0ucN_K.js} +12 -12
  97. package/dist-lib/{index-B57Fj7Y0.js → index-CLhLA2ig.js} +92 -94
  98. package/dist-lib/{index-Vu6sPBci.js → index-CSJA8wvL.js} +301 -296
  99. package/dist-lib/index-CSnvcFg-.js +543 -0
  100. package/dist-lib/{index-C3AMwzIi.js → index-CZipVp1G.js} +1 -1
  101. package/dist-lib/{index-ounfql2z.js → index-CdJ5ggvp.js} +26 -28
  102. package/dist-lib/index-CgwK2maq.js +1987 -0
  103. package/dist-lib/{index-Bc-Vin3j.js → index-CtqUgNxs.js} +53 -55
  104. package/dist-lib/index-CvxfA0ZK.js +215 -0
  105. package/dist-lib/{index-y7jVGGI0.js → index-CwyFMPcr.js} +16 -18
  106. package/dist-lib/index-D35Ry0PG.js +1162 -0
  107. package/dist-lib/{index-c2HokEFp.js → index-D6ns_Xmf.js} +10 -11
  108. package/dist-lib/{index-DsuUGhTA.js → index-DGbjbjBY.js} +46 -48
  109. package/dist-lib/index-DKAGVWMX.js +390 -0
  110. package/dist-lib/index-DQ16Zb7x.js +546 -0
  111. package/dist-lib/index-DRcTwC17.js +418 -0
  112. package/dist-lib/index-DU6bO95v.js +2075 -0
  113. package/dist-lib/index-DaMLYomP.js +853 -0
  114. package/dist-lib/index-Dd9pPAT3.js +2192 -0
  115. package/dist-lib/{index-DuI4K5e1.js → index-DgfIEgir.js} +29 -29
  116. package/dist-lib/{index-Cy9i4Kx7.js → index-DhSCFLtV.js} +113 -117
  117. package/dist-lib/index-DxzorPvG.js +13960 -0
  118. package/dist-lib/index-If4xc1-H.js +559 -0
  119. package/dist-lib/index-QZ9JPfVR.js +251 -0
  120. package/dist-lib/index-VeAMz0iC.js +1719 -0
  121. package/dist-lib/index-mUlorJxp.js +3279 -0
  122. package/dist-lib/{index-g16g7A4k.js → index-xQmDaKK3.js} +6 -6
  123. package/dist-lib/{index-BwVZgt5s.js → index-zXwXfn-X.js} +48 -50
  124. package/dist-lib/index.js +3 -4
  125. package/dist-lib/json-field-COcz5F2R.js +196 -0
  126. package/dist-lib/{jszip.min-DcEHhn-b.js → jszip.min-dcaDnWUw.js} +1 -1
  127. package/dist-lib/{kb-form-modal-BNoIhw6B.js → kb-form-modal-D9gnvXbE.js} +67 -67
  128. package/dist-lib/{kbTeam-EgcbWseM.js → kbTeam-CorrPJFr.js} +3 -3
  129. package/dist-lib/{knowledge-base-C023dnJ-.js → knowledge-base-DJkjMFHW.js} +103 -104
  130. package/dist-lib/{knowledge-hub-B4fGCn8m.js → knowledge-hub-DKiDlaZz.js} +54 -55
  131. package/dist-lib/login-56zv4aLO.js +36 -0
  132. package/dist-lib/{markdown-lite-EvJ9Fw7X.js → markdown-lite-p1tiuSZM.js} +198 -202
  133. package/dist-lib/material-DtPASeqq.js +204 -0
  134. package/dist-lib/material-draft-markdown-281d5_GN.js +443 -0
  135. package/dist-lib/material-original-preview-CPGjdmbe.js +214 -0
  136. package/dist-lib/{material-preview-docx-CH-09KeC.js → material-preview-docx-lp_xPipj.js} +1 -1
  137. package/dist-lib/{material-preview-pdf-CKAovvpc.js → material-preview-pdf-CTSo215V.js} +7 -7
  138. package/dist-lib/{material-preview-pptx-D8XGDF-u.js → material-preview-pptx-6Byitp0J.js} +1 -1
  139. package/dist-lib/material-workspace-model-QLsU5qUO.js +328 -0
  140. package/dist-lib/{member-BUg2QYlE.js → member-Cz-OIdj9.js} +1 -1
  141. package/dist-lib/memory-reorganization-DgJnWIrW.js +8 -0
  142. package/dist-lib/memory-spaces-D-orVNR7.js +2340 -0
  143. package/dist-lib/{message-GF-w8HuR.js → message-C9gfvpGg.js} +1 -1
  144. package/dist-lib/{message-Cwj8dO78.js → message-D6FhzB7J.js} +24 -25
  145. package/dist-lib/{messages-JID13L8-.js → messages-cctmEVcG.js} +15 -16
  146. package/dist-lib/meta-DT_O4zM9.js +708 -0
  147. package/dist-lib/{metrics-CT4eLzrq.js → metrics-BNeVcI8-.js} +2 -2
  148. package/dist-lib/mobile-D8kZjfQU.js +2413 -0
  149. package/dist-lib/{monitor-Bs9BfJOj.js → monitor-DTUyqumg.js} +4 -4
  150. package/dist-lib/{monitor-CmS65YSu.js → monitor-DexMYjzF.js} +8 -8
  151. package/dist-lib/{my-access-1Yj7UloI.js → my-access-DWBV6ohp.js} +120 -132
  152. package/dist-lib/{my-permissions-yQDHPLYI.js → my-permissions-B-gJZQYM.js} +22 -23
  153. package/dist-lib/navigation-DVlyWnpD.js +102 -0
  154. package/dist-lib/{new-BgkoBnZV.js → new-JmARyD88.js} +14 -15
  155. package/dist-lib/{ontology-BPrbXPor.js → ontology-B4rkO33J.js} +50 -52
  156. package/dist-lib/ontology-dataprep-BwD5TKs2.js +322 -0
  157. package/dist-lib/{ontology-domains-Cbqnm-po.js → ontology-domains-zxFrjn0v.js} +89 -92
  158. package/dist-lib/ontology-extract-BHOxruRO.js +3199 -0
  159. package/dist-lib/ontology-extract-iR_rXxFe.js +295 -0
  160. package/dist-lib/ontology-flow-CW0SzeK7.js +456 -0
  161. package/dist-lib/ontology-flow-Dv5iQ20f.js +154 -0
  162. package/dist-lib/ontology-modeling-B9wswveh.js +510 -0
  163. package/dist-lib/ontology-modeling-hakCluBi.js +15136 -0
  164. package/dist-lib/{ontology-scenarios-D3xy6IZL.js → ontology-scenarios-C2kp7Rs-.js} +1466 -1482
  165. package/dist-lib/ontology-scenarios-DKnfydG6.js +675 -0
  166. package/dist-lib/ontology-task-config-DmnWyCCB.js +122 -0
  167. package/dist-lib/ontology-terms-BoNB-5ar.js +66 -0
  168. package/dist-lib/ontology-terms-C-NhpcIZ.js +1195 -0
  169. package/dist-lib/pages-CticGC6S.js +512 -0
  170. package/dist-lib/pages.js +3 -3
  171. package/dist-lib/{permission-fTfxpEhV.js → permission-Dq1-AOQw.js} +41 -41
  172. package/dist-lib/pipeline-layout-CJlOMXJF.js +70 -0
  173. package/dist-lib/{pptx-preview.es-AUrdYKu3.js → pptx-preview.es-D4ODiBv2.js} +2 -2
  174. package/dist-lib/preset-Bp_mvsJm.js +56827 -0
  175. package/dist-lib/{preset-gh5SGoYT.js → preset-DCNSE--Y.js} +8 -8
  176. package/dist-lib/progress-CZxOOnIs.js +778 -0
  177. package/dist-lib/{quota-BlHnhkAT.js → quota-oICQRHFU.js} +4 -4
  178. package/dist-lib/row-By17TCiW.js +154 -0
  179. package/dist-lib/runs-DQTDpPaN.js +565 -0
  180. package/dist-lib/{save-blob-B-pzX8eT.js → save-blob-CwCZE1Dn.js} +2 -2
  181. package/dist-lib/{scenario-mapping-preview-DByQXh0y.js → scenario-mapping-preview-sJtjgmry.js} +46 -48
  182. package/dist-lib/scenario-simple-form-BvKSPFzw.js +989 -0
  183. package/dist-lib/{schedule-H4_9KnRj.js → schedule-CwkPPSuT.js} +8 -8
  184. package/dist-lib/script-gYJAFobb.js +2709 -0
  185. package/dist-lib/{settings-C3PI8KYa.js → settings-CJd5Jj4y.js} +133 -134
  186. package/dist-lib/{shared-DqeN-Wbb.js → shared-DG5-VCDM.js} +1 -1
  187. package/dist-lib/{shared-utils-DN3zT9P-.js → shared-utils-CFHws1DA.js} +2 -2
  188. package/dist-lib/{skills-eGlCExr0.js → skills-lxpJ5Lzx.js} +39 -40
  189. package/dist-lib/{source-selection-BCvClzc-.js → source-selection-DJnQQckl.js} +16 -16
  190. package/dist-lib/sources-C83LpCcV.js +279 -0
  191. package/dist-lib/style-B5THvtDY.js +191 -0
  192. package/dist-lib/{task-config-DEJVJ7zK.js → task-config-BNYoOb79.js} +4 -4
  193. package/dist-lib/{tech-C-4uM9bS.js → tech-LuZvKDo6.js} +3 -4
  194. package/dist-lib/templates-a-kbCamr.js +58 -0
  195. package/dist-lib/tenant-login-COB-5h_2.js +338 -0
  196. package/dist-lib/{tools-le6miafZ.js → tools-CrA6GrY6.js} +14 -14
  197. package/dist-lib/{use-domain-access-B3pDp3s5.js → use-domain-access-ehGJBGvU.js} +15 -15
  198. package/dist-lib/{use-g6-graph-WLX0PweO.js → use-g6-graph-DfRnsBS6.js} +1 -1
  199. package/dist-lib/{use-graph-layers-Dmp7uMHO.js → use-graph-layers-CrhEeHfD.js} +48 -50
  200. package/dist-lib/use-resizable-columns-BpMCRKif.js +59 -0
  201. package/dist-lib/useBreakpoint-Cul9y9Cu.js +87 -0
  202. package/dist-lib/{useForm-Byp1LopG.js → useForm-B-dwOwJ8.js} +11 -11
  203. package/dist-lib/{version-control-panel-WT1PobuV.js → version-control-panel-mWXkC-uB.js} +26 -27
  204. package/dist-lib/{version-management-DC0k1DRg.js → version-management-nPlG7wQO.js} +6 -7
  205. package/dist-lib/{welcome-VyWLrbth.js → welcome-Cqv1-rXT.js} +3 -4
  206. package/package.json +1 -1
  207. package/dist-lib/ApartmentOutlined-M6qSurnE.js +0 -12
  208. package/dist-lib/ArrowLeftOutlined-DowsrSUj.js +0 -12
  209. package/dist-lib/EvidenceFormList-DXqqSpPV.js +0 -91
  210. package/dist-lib/ImpactPage-DyhUR6fT.js +0 -71
  211. package/dist-lib/OntologyMaterializePage-B0f9TnJa.js +0 -136
  212. package/dist-lib/OntologyNodesPage-D4MWlm6q.js +0 -1268
  213. package/dist-lib/Pagination-Dxslodkq.js +0 -1344
  214. package/dist-lib/PlusOutlined-B_dXo_97.js +0 -12
  215. package/dist-lib/SearchOutlined-puH6bCY6.js +0 -979
  216. package/dist-lib/Skeleton-DXcERb5r.js +0 -557
  217. package/dist-lib/TagsOutlined-B4_qkn6-.js +0 -20
  218. package/dist-lib/TermDetailPage-CP0D6OvA.js +0 -242
  219. package/dist-lib/TextArea-DTpTS5HL.js +0 -1897
  220. package/dist-lib/ThunderboltOutlined-Bf54AaFE.js +0 -20
  221. package/dist-lib/callSuper-DZEfdkXG.js +0 -7
  222. package/dist-lib/changelog-Dj_Pv2nc.js +0 -69
  223. package/dist-lib/chunk-YDNE64FV-DGyyfCo0.js +0 -2004
  224. package/dist-lib/context-Buz0ggsK.js +0 -710
  225. package/dist-lib/context-DpmyNOn3.js +0 -21
  226. package/dist-lib/embed-DwLg9RDW.js +0 -31148
  227. package/dist-lib/focus-set-h0YtOUB2.js +0 -427
  228. package/dist-lib/index-CaXylbQR.js +0 -3419
  229. package/dist-lib/index-Cfu1W1H6.js +0 -535
  230. package/dist-lib/index-CrMcNEAZ.js +0 -9656
  231. package/dist-lib/index-CyKWCYMK.js +0 -218
  232. package/dist-lib/index-DBtGE89a.js +0 -168
  233. package/dist-lib/index-DjFPRXl5.js +0 -1484
  234. package/dist-lib/index-DvWHYX81.js +0 -450
  235. package/dist-lib/index-HieOUSwH.js +0 -340
  236. package/dist-lib/index-bOY1cBol.js +0 -4890
  237. package/dist-lib/meta-DPp5L3Uc.js +0 -540
  238. package/dist-lib/ontology-modeling-6k-m8fzr.js +0 -38946
  239. package/dist-lib/ontology-modeling-BT-EuDCs.js +0 -1039
  240. package/dist-lib/ontology-scenarios-DWYC2yxd.js +0 -660
  241. package/dist-lib/pages-CsexFuEz.js +0 -73
  242. package/dist-lib/row-B5MnGm9M.js +0 -156
  243. package/dist-lib/scenario-simple-form-Bw-6n9Kh.js +0 -2396
  244. package/dist-lib/useClosable-BY7FgWKy.js +0 -59
@@ -1,2004 +0,0 @@
1
- import * as i from "react";
2
- /**
3
- * react-router v7.18.6
4
- *
5
- * Copyright (c) Remix Software Inc.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE.md file in the root directory of this source tree.
9
- *
10
- * @license MIT
11
- */
12
- var K = /^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i, Le = /^[\\/]{2}/;
13
- function Qe(e, t) {
14
- return t + e.replace(/\\/g, "/");
15
- }
16
- var we = "popstate";
17
- function Ee(e) {
18
- return typeof e == "object" && e != null && "pathname" in e && "search" in e && "hash" in e && "state" in e && "key" in e;
19
- }
20
- function Ze(e = {}) {
21
- function t(a, o) {
22
- let {
23
- pathname: l = "/",
24
- search: u = "",
25
- hash: s = ""
26
- } = F(a.location.hash.substring(1));
27
- return !l.startsWith("/") && !l.startsWith(".") && (l = "/" + l), ne(
28
- "",
29
- { pathname: l, search: u, hash: s },
30
- // state defaults to `null` because `window.history.state` does
31
- o.state && o.state.usr || null,
32
- o.state && o.state.key || "default"
33
- );
34
- }
35
- function r(a, o) {
36
- let l = a.document.querySelector("base"), u = "";
37
- if (l && l.getAttribute("href")) {
38
- let s = a.location.href, c = s.indexOf("#");
39
- u = c === -1 ? s : s.slice(0, c);
40
- }
41
- return u + "#" + (typeof o == "string" ? o : D(o));
42
- }
43
- function n(a, o) {
44
- S(
45
- a.pathname.charAt(0) === "/",
46
- `relative pathnames are not supported in hash history.push(${JSON.stringify(
47
- o
48
- )})`
49
- );
50
- }
51
- return tt(
52
- t,
53
- r,
54
- n,
55
- e
56
- );
57
- }
58
- function E(e, t) {
59
- if (e === !1 || e === null || typeof e > "u")
60
- throw new Error(t);
61
- }
62
- function S(e, t) {
63
- if (!e) {
64
- typeof console < "u" && console.warn(t);
65
- try {
66
- throw new Error(t);
67
- } catch {
68
- }
69
- }
70
- }
71
- function et() {
72
- return Math.random().toString(36).substring(2, 10);
73
- }
74
- function xe(e, t) {
75
- return {
76
- usr: e.state,
77
- key: e.key,
78
- idx: t,
79
- masked: e.mask ? {
80
- pathname: e.pathname,
81
- search: e.search,
82
- hash: e.hash
83
- } : void 0
84
- };
85
- }
86
- function ne(e, t, r = null, n, a) {
87
- return {
88
- pathname: typeof e == "string" ? e : e.pathname,
89
- search: "",
90
- hash: "",
91
- ...typeof t == "string" ? F(t) : t,
92
- state: r,
93
- // TODO: This could be cleaned up. push/replace should probably just take
94
- // full Locations now and avoid the need to run through this flow at all
95
- // But that's a pretty big refactor to the current test suite so going to
96
- // keep as is for the time being and just let any incoming keys take precedence
97
- key: t && t.key || n || et(),
98
- mask: a
99
- };
100
- }
101
- function D({
102
- pathname: e = "/",
103
- search: t = "",
104
- hash: r = ""
105
- }) {
106
- return t && t !== "?" && (e += t.charAt(0) === "?" ? t : "?" + t), r && r !== "#" && (e += r.charAt(0) === "#" ? r : "#" + r), e;
107
- }
108
- function F(e) {
109
- let t = {};
110
- if (e) {
111
- let r = e.indexOf("#");
112
- r >= 0 && (t.hash = e.substring(r), e = e.substring(0, r));
113
- let n = e.indexOf("?");
114
- n >= 0 && (t.search = e.substring(n), e = e.substring(0, n)), e && (t.pathname = e);
115
- }
116
- return t;
117
- }
118
- function tt(e, t, r, n = {}) {
119
- let { window: a = document.defaultView, v5Compat: o = !1 } = n, l = a.history, u = "POP", s = null, c = f();
120
- c == null && (c = 0, l.replaceState({ ...l.state, idx: c }, ""));
121
- function f() {
122
- return (l.state || { idx: null }).idx;
123
- }
124
- function h() {
125
- u = "POP";
126
- let p = f(), m = p == null ? null : p - c;
127
- c = p, s && s({ action: u, location: g.location, delta: m });
128
- }
129
- function d(p, m) {
130
- u = "PUSH";
131
- let R = Ee(p) ? p : ne(g.location, p, m);
132
- r && r(R, p), c = f() + 1;
133
- let w = xe(R, c), C = g.createHref(R.mask || R);
134
- try {
135
- l.pushState(w, "", C);
136
- } catch (x) {
137
- if (x instanceof DOMException && x.name === "DataCloneError")
138
- throw x;
139
- a.location.assign(C);
140
- }
141
- o && s && s({ action: u, location: g.location, delta: 1 });
142
- }
143
- function y(p, m) {
144
- u = "REPLACE";
145
- let R = Ee(p) ? p : ne(g.location, p, m);
146
- r && r(R, p), c = f();
147
- let w = xe(R, c), C = g.createHref(R.mask || R);
148
- l.replaceState(w, "", C), o && s && s({ action: u, location: g.location, delta: 0 });
149
- }
150
- function v(p) {
151
- return rt(a, p);
152
- }
153
- let g = {
154
- get action() {
155
- return u;
156
- },
157
- get location() {
158
- return e(a, l);
159
- },
160
- listen(p) {
161
- if (s)
162
- throw new Error("A history only accepts one active listener");
163
- return a.addEventListener(we, h), s = p, () => {
164
- a.removeEventListener(we, h), s = null;
165
- };
166
- },
167
- createHref(p) {
168
- return t(a, p);
169
- },
170
- createURL: v,
171
- encodeLocation(p) {
172
- let m = v(p);
173
- return {
174
- pathname: m.pathname,
175
- search: m.search,
176
- hash: m.hash
177
- };
178
- },
179
- push: d,
180
- replace: y,
181
- go(p) {
182
- return l.go(p);
183
- }
184
- };
185
- return g;
186
- }
187
- function rt(e, t, r = !1) {
188
- let n = "http://localhost";
189
- e && (n = e.location.origin !== "null" ? e.location.origin : e.location.href), E(n, "No window.location.(origin|href) available to create URL");
190
- let a = typeof t == "string" ? t : D(t);
191
- return a = a.replace(/ $/, "%20"), !r && Le.test(a) && (a = n + a), new URL(a, n);
192
- }
193
- var ae = new URL("http://localhost");
194
- function ie(e) {
195
- if (e.createURL)
196
- return e.createURL("/");
197
- try {
198
- return new URL(e.createHref("/"), ae);
199
- } catch {
200
- return ae;
201
- }
202
- }
203
- function Z(e, t) {
204
- return e.origin === t.origin && (e.origin !== "null" || e.protocol === t.protocol && e.host === t.host);
205
- }
206
- function ke(e, t) {
207
- if (e.startsWith("//"))
208
- return !0;
209
- let r = t.protocol.toLowerCase();
210
- return e.toLowerCase().startsWith(r) ? t.host === "" || e.slice(r.length).startsWith("//") : !1;
211
- }
212
- function $e(e) {
213
- let t = e.replace(/[\t\n\r]/g, ""), r = 0;
214
- for (; t.charCodeAt(r) <= 32; ) r++;
215
- if (t = t.slice(r), !K.test(t)) return;
216
- let n;
217
- try {
218
- n = new URL(e, ae);
219
- } catch {
220
- return;
221
- }
222
- if (!ke(e, n))
223
- throw new Error("External navigation is not allowed");
224
- }
225
- function se(e, t, r, n) {
226
- let a = null;
227
- try {
228
- a = e == null ? null : new URL(e, r);
229
- } catch {
230
- }
231
- let o = new URL(t, r), l = a != null && !Z(a, r), u = !Z(o, r);
232
- if (n === "reject") {
233
- if (l || u)
234
- throw new Error("External navigation is not allowed");
235
- } else if (u && (a == null || !ke(e, a) || !Z(a, o)))
236
- throw new Error("External navigation is not allowed");
237
- }
238
- function Te(e, t, r = "/") {
239
- return nt(e, t, r, !1);
240
- }
241
- function nt(e, t, r, n, a) {
242
- let o = typeof t == "string" ? F(t) : t, l = T(o.pathname || "/", r);
243
- if (l == null)
244
- return null;
245
- let u = at(e), s = null, c = pt(l);
246
- for (let f = 0; s == null && f < u.length; ++f)
247
- s = mt(
248
- u[f],
249
- c,
250
- n
251
- );
252
- return s;
253
- }
254
- function at(e) {
255
- let t = Ne(e);
256
- return ot(t), t;
257
- }
258
- function Ne(e, t = [], r = [], n = "", a = !1) {
259
- let o = (l, u, s = a, c) => {
260
- let f = {
261
- relativePath: c === void 0 ? l.path || "" : c,
262
- caseSensitive: l.caseSensitive === !0,
263
- childrenIndex: u,
264
- route: l
265
- };
266
- if (f.relativePath.startsWith("/")) {
267
- if (!f.relativePath.startsWith(n) && s)
268
- return;
269
- E(
270
- f.relativePath.startsWith(n),
271
- `Absolute route path "${f.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`
272
- ), f.relativePath = f.relativePath.slice(n.length);
273
- }
274
- let h = P([n, f.relativePath]), d = r.concat(f);
275
- l.children && l.children.length > 0 && (E(
276
- // Our types know better, but runtime JS may not!
277
- // @ts-expect-error
278
- l.index !== !0,
279
- `Index routes must not have child routes. Please remove all child routes from route path "${h}".`
280
- ), Ne(
281
- l.children,
282
- t,
283
- d,
284
- h,
285
- s
286
- )), !(l.path == null && !l.index) && t.push({
287
- path: h,
288
- score: ht(h, l.index),
289
- routesMeta: d.map((y, v) => {
290
- let [g, p] = Fe(
291
- y.relativePath,
292
- y.caseSensitive,
293
- v === d.length - 1
294
- );
295
- return {
296
- ...y,
297
- matcher: g,
298
- compiledParams: p
299
- };
300
- })
301
- });
302
- };
303
- return e.forEach((l, u) => {
304
- var s;
305
- if (l.path === "" || !((s = l.path) != null && s.includes("?")))
306
- o(l, u);
307
- else
308
- for (let c of Ie(l.path))
309
- o(l, u, !0, c);
310
- }), t;
311
- }
312
- function Ie(e) {
313
- let t = e.split("/");
314
- if (t.length === 0) return [];
315
- let [r, ...n] = t, a = r.endsWith("?"), o = r.replace(/\?$/, "");
316
- if (n.length === 0)
317
- return a ? [o, ""] : [o];
318
- let l = Ie(n.join("/")), u = [];
319
- return u.push(
320
- ...l.map(
321
- (s) => s === "" ? o : [o, s].join("/")
322
- )
323
- ), a && u.push(...l), u.map(
324
- (s) => e.startsWith("/") && s === "" ? "/" : s
325
- );
326
- }
327
- function ot(e) {
328
- e.sort(
329
- (t, r) => t.score !== r.score ? r.score - t.score : dt(
330
- t.routesMeta.map((n) => n.childrenIndex),
331
- r.routesMeta.map((n) => n.childrenIndex)
332
- )
333
- );
334
- }
335
- var lt = /^:[\w-]+$/, it = 3, st = 2, ut = 1, ct = 10, ft = -2, Ce = (e) => e === "*";
336
- function ht(e, t) {
337
- let r = e.split("/"), n = r.length;
338
- return r.some(Ce) && (n += ft), t && (n += st), r.filter((a) => !Ce(a)).reduce(
339
- (a, o) => a + (lt.test(o) ? it : o === "" ? ut : ct),
340
- n
341
- );
342
- }
343
- function dt(e, t) {
344
- return e.length === t.length && e.slice(0, -1).every((n, a) => n === t[a]) ? (
345
- // If two routes are siblings, we should try to match the earlier sibling
346
- // first. This allows people to have fine-grained control over the matching
347
- // behavior by simply putting routes with identical paths in the order they
348
- // want them tried.
349
- e[e.length - 1] - t[t.length - 1]
350
- ) : (
351
- // Otherwise, it doesn't really make sense to rank non-siblings by index,
352
- // so they sort equally.
353
- 0
354
- );
355
- }
356
- function mt(e, t, r = !1) {
357
- let { routesMeta: n } = e, a = {}, o = "/", l = [];
358
- for (let u = 0; u < n.length; ++u) {
359
- let s = n[u], c = u === n.length - 1, f = o === "/" ? t : t.slice(o.length) || "/", h = {
360
- path: s.relativePath,
361
- caseSensitive: s.caseSensitive,
362
- end: c
363
- }, d = (
364
- // Use precomputed matcher if it exists
365
- s.matcher && s.compiledParams ? De(
366
- h,
367
- f,
368
- s.matcher,
369
- s.compiledParams
370
- ) : J(h, f)
371
- ), y = s.route;
372
- if (!d && c && r && !n[n.length - 1].route.index && (d = J(
373
- {
374
- path: s.relativePath,
375
- caseSensitive: s.caseSensitive,
376
- end: !1
377
- },
378
- f
379
- )), !d)
380
- return null;
381
- Object.assign(a, d.params), l.push({
382
- // TODO: Can this as be avoided?
383
- params: a,
384
- pathname: P([o, d.pathname]),
385
- pathnameBase: vt(
386
- P([o, d.pathnameBase])
387
- ),
388
- route: y
389
- }), d.pathnameBase !== "/" && (o = P([o, d.pathnameBase]));
390
- }
391
- return l;
392
- }
393
- function J(e, t) {
394
- typeof e == "string" && (e = { path: e, caseSensitive: !1, end: !0 });
395
- let [r, n] = Fe(
396
- e.path,
397
- e.caseSensitive,
398
- e.end
399
- );
400
- return De(e, t, r, n);
401
- }
402
- function De(e, t, r, n) {
403
- let a = t.match(r);
404
- if (!a) return null;
405
- let o = a[0], l = U(o, 1), u = a.slice(1);
406
- return {
407
- params: n.reduce(
408
- (c, { paramName: f, isOptional: h }, d) => {
409
- if (f === "*") {
410
- let v = u[d] || "";
411
- l = U(
412
- o.slice(0, o.length - v.length),
413
- 1
414
- );
415
- }
416
- const y = u[d];
417
- return h && !y ? c[f] = void 0 : c[f] = (y || "").replace(/%2F/g, "/"), c;
418
- },
419
- {}
420
- ),
421
- pathname: o,
422
- pathnameBase: l,
423
- pattern: e
424
- };
425
- }
426
- function Fe(e, t = !1, r = !0) {
427
- S(
428
- e === "*" || !e.endsWith("*") || e.endsWith("/*"),
429
- `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(/\*$/, "/*")}".`
430
- );
431
- let n = [], a = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(
432
- /\/:([\w-]+)(\?)?/g,
433
- (l, u, s, c, f) => {
434
- if (n.push({ paramName: u, isOptional: s != null }), s) {
435
- let h = f.charAt(c + l.length);
436
- return h && h !== "/" ? "/([^\\/]*)" : "(?:/([^\\/]*))?";
437
- }
438
- return "/([^\\/]+)";
439
- }
440
- ).replace(/\/([\w-]+)\?(\/|$)/g, "(/$1)?$2");
441
- return e.endsWith("*") ? (n.push({ paramName: "*" }), a += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : r ? a += "\\/*$" : e !== "" && e !== "/" && (a += "(?:(?=\\/|$))"), [new RegExp(a, t ? void 0 : "i"), n];
442
- }
443
- function pt(e) {
444
- try {
445
- return e.split("/").map((t) => decodeURIComponent(t).replace(/\//g, "%2F")).join("/");
446
- } catch (t) {
447
- return S(
448
- !1,
449
- `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}).`
450
- ), e;
451
- }
452
- }
453
- function T(e, t) {
454
- if (t === "/") return e;
455
- if (!e.toLowerCase().startsWith(t.toLowerCase()))
456
- return null;
457
- let r = t.endsWith("/") ? t.length - 1 : t.length, n = e.charAt(r);
458
- return n && n !== "/" ? null : e.slice(r) || "/";
459
- }
460
- function gt(e, t = "/") {
461
- let {
462
- pathname: r,
463
- search: n = "",
464
- hash: a = ""
465
- } = typeof e == "string" ? F(e) : e, o;
466
- return r ? (r = Ae(r), r.startsWith("/") || r.startsWith("\\") ? o = Se(r.substring(1), "/") : o = Se(r, t)) : o = t, {
467
- pathname: o,
468
- search: Rt(n),
469
- hash: wt(a)
470
- };
471
- }
472
- function Se(e, t) {
473
- let r = U(t).split("/");
474
- return e.split("/").forEach((a) => {
475
- a === ".." ? r.length > 1 && r.pop() : a !== "." && r.push(a);
476
- }), r.length > 1 ? r.join("/") : "/";
477
- }
478
- function ee(e, t, r, n) {
479
- return `Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(
480
- n
481
- )}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`;
482
- }
483
- function yt(e) {
484
- return e.filter(
485
- (t, r) => r === 0 || t.route.path && t.route.path.length > 0
486
- );
487
- }
488
- function ue(e) {
489
- let t = yt(e);
490
- return t.map(
491
- (r, n) => n === t.length - 1 ? r.pathname : r.pathnameBase
492
- );
493
- }
494
- function q(e, t, r, n = !1) {
495
- let a;
496
- typeof e == "string" ? a = F(e) : (a = { ...e }, E(
497
- !a.pathname || !a.pathname.includes("?"),
498
- ee("?", "pathname", "search", a)
499
- ), E(
500
- !a.pathname || !a.pathname.includes("#"),
501
- ee("#", "pathname", "hash", a)
502
- ), E(
503
- !a.search || !a.search.includes("#"),
504
- ee("#", "search", "hash", a)
505
- ));
506
- let o = e === "" || a.pathname === "", l = o ? "/" : a.pathname, u;
507
- if (l == null)
508
- u = r;
509
- else {
510
- let h = t.length - 1;
511
- if (!n && l.startsWith("..")) {
512
- let d = l.split("/");
513
- for (; d[0] === ".."; )
514
- d.shift(), h -= 1;
515
- a.pathname = d.join("/");
516
- }
517
- u = h >= 0 ? t[h] : "/";
518
- }
519
- let s = gt(a, u), c = l && l !== "/" && l.endsWith("/"), f = (o || l === ".") && r.endsWith("/");
520
- return !s.pathname.endsWith("/") && (c || f) && (s.pathname += "/"), s;
521
- }
522
- var Ae = (e) => e.replace(/[\\/]{2,}/g, "/"), P = (e) => Ae(e.join("/"));
523
- function U(e, t = 0) {
524
- let r = e.length;
525
- for (; r > t && e.charCodeAt(r - 1) === 47; )
526
- r--;
527
- return r === e.length ? e : e.slice(0, r);
528
- }
529
- var vt = (e) => U(e).replace(/^\/*/, "/"), Rt = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, wt = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e, Et = class {
530
- constructor(e, t, r, n = !1) {
531
- this.status = e, this.statusText = t || "", this.internal = n, r instanceof Error ? (this.data = r.toString(), this.error = r) : this.data = r;
532
- }
533
- };
534
- function xt(e) {
535
- return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
536
- }
537
- function Ct(e) {
538
- let t = e.map((r) => r.route.path).filter(Boolean);
539
- return P(t) || "/";
540
- }
541
- var Ue = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
542
- function Oe(e, t) {
543
- let r = e;
544
- if (typeof r != "string" || !K.test(r))
545
- return {
546
- absoluteURL: void 0,
547
- isExternal: !1,
548
- to: r
549
- };
550
- let n = r, a = !1;
551
- if (Ue)
552
- try {
553
- let o = new URL(window.location.href), l = Le.test(r) ? new URL(Qe(r, o.protocol)) : new URL(r), u = T(l.pathname, t);
554
- l.origin === o.origin && u != null ? r = u + l.search + l.hash : a = !0;
555
- } catch {
556
- S(
557
- !1,
558
- `<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
559
- );
560
- }
561
- return {
562
- absoluteURL: n,
563
- isExternal: a,
564
- to: r
565
- };
566
- }
567
- Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
568
- var He = [
569
- "POST",
570
- "PUT",
571
- "PATCH",
572
- "DELETE"
573
- ];
574
- new Set(
575
- He
576
- );
577
- var St = [
578
- "GET",
579
- ...He
580
- ];
581
- new Set(St);
582
- var bt = [
583
- "about:",
584
- "blob:",
585
- "chrome:",
586
- "chrome-untrusted:",
587
- "content:",
588
- "data:",
589
- "devtools:",
590
- "file:",
591
- "filesystem:",
592
- // eslint-disable-next-line no-script-url
593
- "javascript:"
594
- ];
595
- function Pt(e) {
596
- try {
597
- return bt.includes(new URL(e).protocol);
598
- } catch {
599
- return !1;
600
- }
601
- }
602
- var O = i.createContext(null);
603
- O.displayName = "DataRouter";
604
- var Y = i.createContext(null);
605
- Y.displayName = "DataRouterState";
606
- var _e = i.createContext(!1);
607
- function Lt() {
608
- return i.useContext(_e);
609
- }
610
- var Me = i.createContext({
611
- isTransitioning: !1
612
- });
613
- Me.displayName = "ViewTransition";
614
- var kt = i.createContext(
615
- /* @__PURE__ */ new Map()
616
- );
617
- kt.displayName = "Fetchers";
618
- var $t = i.createContext(null);
619
- $t.displayName = "Await";
620
- var b = i.createContext(
621
- null
622
- );
623
- b.displayName = "Navigation";
624
- var W = i.createContext(
625
- null
626
- );
627
- W.displayName = "Location";
628
- var L = i.createContext({
629
- outlet: null,
630
- matches: [],
631
- isDataRoute: !1
632
- });
633
- L.displayName = "Route";
634
- var ce = i.createContext(null);
635
- ce.displayName = "RouteError";
636
- var We = "REACT_ROUTER_ERROR", Tt = "REDIRECT", Nt = "ROUTE_ERROR_RESPONSE";
637
- function It(e) {
638
- if (e.startsWith(`${We}:${Tt}:{`))
639
- try {
640
- let t = JSON.parse(e.slice(28));
641
- 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")
642
- return t;
643
- } catch {
644
- }
645
- }
646
- function Dt(e) {
647
- if (e.startsWith(
648
- `${We}:${Nt}:{`
649
- ))
650
- try {
651
- let t = JSON.parse(e.slice(40));
652
- if (typeof t == "object" && t && typeof t.status == "number" && typeof t.statusText == "string")
653
- return new Et(
654
- t.status,
655
- t.statusText,
656
- t.data
657
- );
658
- } catch {
659
- }
660
- }
661
- function Ft(e, { relative: t } = {}) {
662
- E(
663
- H(),
664
- // TODO: This error is probably because they somehow have 2 versions of the
665
- // router loaded. We can help them understand how to avoid that.
666
- "useHref() may be used only in the context of a <Router> component."
667
- );
668
- let { basename: r, navigator: n } = i.useContext(b), { hash: a, pathname: o, search: l } = B(e, { relative: t }), u = o;
669
- return r !== "/" && (u = o === "/" ? r : P([r, o])), n.createHref({ pathname: u, search: l, hash: a });
670
- }
671
- function H() {
672
- return i.useContext(W) != null;
673
- }
674
- function k() {
675
- return E(
676
- H(),
677
- // TODO: This error is probably because they somehow have 2 versions of the
678
- // router loaded. We can help them understand how to avoid that.
679
- "useLocation() may be used only in the context of a <Router> component."
680
- ), i.useContext(W).location;
681
- }
682
- var Be = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
683
- function je(e) {
684
- i.useContext(b).static || i.useLayoutEffect(e);
685
- }
686
- function fe() {
687
- let { isDataRoute: e } = i.useContext(L);
688
- return e ? Kt() : At();
689
- }
690
- function At() {
691
- E(
692
- H(),
693
- // TODO: This error is probably because they somehow have 2 versions of the
694
- // router loaded. We can help them understand how to avoid that.
695
- "useNavigate() may be used only in the context of a <Router> component."
696
- );
697
- let e = i.useContext(O), { basename: t, navigator: r } = i.useContext(b), { matches: n } = i.useContext(L), { pathname: a } = k(), o = JSON.stringify(ue(n)), l = i.useRef(!1);
698
- return je(() => {
699
- l.current = !0;
700
- }), i.useCallback(
701
- (s, c = {}) => {
702
- if (S(l.current, Be), !l.current) return;
703
- if (typeof s == "number") {
704
- r.go(s);
705
- return;
706
- }
707
- let f = q(
708
- s,
709
- JSON.parse(o),
710
- a,
711
- c.relative === "path"
712
- );
713
- e == null && t !== "/" && (f.pathname = f.pathname === "/" ? t : P([t, f.pathname])), se(
714
- typeof s == "string" ? s : D(s),
715
- r.createHref(f),
716
- ie(r),
717
- "reject"
718
- ), (c.replace ? r.replace : r.push)(
719
- f,
720
- c.state,
721
- c
722
- );
723
- },
724
- [
725
- t,
726
- r,
727
- o,
728
- a,
729
- e
730
- ]
731
- );
732
- }
733
- i.createContext(null);
734
- function Tr() {
735
- let { matches: e } = i.useContext(L), t = e[e.length - 1];
736
- return (t == null ? void 0 : t.params) ?? {};
737
- }
738
- function B(e, { relative: t } = {}) {
739
- let { matches: r } = i.useContext(L), { pathname: n } = k(), a = JSON.stringify(ue(r));
740
- return i.useMemo(
741
- () => q(
742
- e,
743
- JSON.parse(a),
744
- n,
745
- t === "path"
746
- ),
747
- [e, a, n, t]
748
- );
749
- }
750
- function Ut(e, t) {
751
- return Ve(e, t);
752
- }
753
- function Ve(e, t, r) {
754
- var p;
755
- E(
756
- H(),
757
- // TODO: This error is probably because they somehow have 2 versions of the
758
- // router loaded. We can help them understand how to avoid that.
759
- "useRoutes() may be used only in the context of a <Router> component."
760
- );
761
- let { navigator: n } = i.useContext(b), { matches: a } = i.useContext(L), o = a[a.length - 1], l = o ? o.params : {}, u = o ? o.pathname : "/", s = o ? o.pathnameBase : "/", c = o && o.route;
762
- {
763
- let m = c && c.path || "";
764
- Je(
765
- u,
766
- !c || m.endsWith("*") || m.endsWith("*?"),
767
- `You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${m}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
768
-
769
- Please change the parent <Route path="${m}"> to <Route path="${m === "/" ? "*" : `${m}/*`}">.`
770
- );
771
- }
772
- let f = k(), h;
773
- if (t) {
774
- let m = typeof t == "string" ? F(t) : t;
775
- E(
776
- s === "/" || ((p = m.pathname) == null ? void 0 : p.startsWith(s)),
777
- `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 "${m.pathname}" was given in the \`location\` prop.`
778
- ), h = m;
779
- } else
780
- h = f;
781
- let d = h.pathname || "/", y = d;
782
- if (s !== "/") {
783
- let m = s.replace(/^\//, "").split("/");
784
- y = "/" + d.replace(/^\//, "").split("/").slice(m.length).join("/");
785
- }
786
- let v = r && r.state.matches.length ? (
787
- // If we're in a data router, use the matches we've already identified but ensure
788
- // we have the latest route instances from the manifest in case elements have changed
789
- r.state.matches.map(
790
- (m) => Object.assign(m, {
791
- route: r.manifest[m.route.id] || m.route
792
- })
793
- )
794
- ) : Te(e, { pathname: y });
795
- S(
796
- c || v != null,
797
- `No routes matched location "${h.pathname}${h.search}${h.hash}" `
798
- ), S(
799
- v == null || v[v.length - 1].route.element !== void 0 || v[v.length - 1].route.Component !== void 0 || v[v.length - 1].route.lazy !== void 0,
800
- `Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`
801
- );
802
- let g = Wt(
803
- v && v.map(
804
- (m) => Object.assign({}, m, {
805
- params: Object.assign({}, l, m.params),
806
- pathname: P([
807
- s,
808
- // Re-encode pathnames that were decoded inside matchRoutes.
809
- // Pre-encode `%`, `?` and `#` ahead of `encodeLocation` because it uses
810
- // `new URL()` internally and we need to prevent it from treating
811
- // them as separators
812
- n.encodeLocation ? n.encodeLocation(
813
- m.pathname.replace(/%/g, "%25").replace(/\?/g, "%3F").replace(/#/g, "%23")
814
- ).pathname : m.pathname
815
- ]),
816
- pathnameBase: m.pathnameBase === "/" ? s : P([
817
- s,
818
- // Re-encode pathnames that were decoded inside matchRoutes
819
- // Pre-encode `%`, `?` and `#` ahead of `encodeLocation` because it uses
820
- // `new URL()` internally and we need to prevent it from treating
821
- // them as separators
822
- n.encodeLocation ? n.encodeLocation(
823
- m.pathnameBase.replace(/%/g, "%25").replace(/\?/g, "%3F").replace(/#/g, "%23")
824
- ).pathname : m.pathnameBase
825
- ])
826
- })
827
- ),
828
- a,
829
- r
830
- );
831
- return t && g ? /* @__PURE__ */ i.createElement(
832
- W.Provider,
833
- {
834
- value: {
835
- location: {
836
- pathname: "/",
837
- search: "",
838
- hash: "",
839
- state: null,
840
- key: "default",
841
- mask: void 0,
842
- ...h
843
- },
844
- navigationType: "POP"
845
- /* Pop */
846
- }
847
- },
848
- g
849
- ) : g;
850
- }
851
- function Ot() {
852
- let e = Jt(), t = xt(e) ? `${e.status} ${e.statusText}` : e instanceof Error ? e.message : JSON.stringify(e), r = e instanceof Error ? e.stack : null, n = "rgba(200,200,200, 0.5)", a = { padding: "0.5rem", backgroundColor: n }, o = { padding: "2px 4px", backgroundColor: n }, l = null;
853
- return console.error(
854
- "Error handled by React Router default ErrorBoundary:",
855
- e
856
- ), l = /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ i.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ i.createElement("code", { style: o }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ i.createElement("code", { style: o }, "errorElement"), " prop on your route.")), /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ i.createElement("h3", { style: { fontStyle: "italic" } }, t), r ? /* @__PURE__ */ i.createElement("pre", { style: a }, r) : null, l);
857
- }
858
- var Ht = /* @__PURE__ */ i.createElement(Ot, null), ze = class extends i.Component {
859
- constructor(e) {
860
- super(e), this.state = {
861
- location: e.location,
862
- revalidation: e.revalidation,
863
- error: e.error
864
- };
865
- }
866
- static getDerivedStateFromError(e) {
867
- return { error: e };
868
- }
869
- static getDerivedStateFromProps(e, t) {
870
- return t.location !== e.location || t.revalidation !== "idle" && e.revalidation === "idle" ? {
871
- error: e.error,
872
- location: e.location,
873
- revalidation: e.revalidation
874
- } : {
875
- error: e.error !== void 0 ? e.error : t.error,
876
- location: t.location,
877
- revalidation: e.revalidation || t.revalidation
878
- };
879
- }
880
- componentDidCatch(e, t) {
881
- this.props.onError ? this.props.onError(e, t) : console.error(
882
- "React Router caught the following error during render",
883
- e
884
- );
885
- }
886
- render() {
887
- let e = this.state.error;
888
- if (this.context && typeof e == "object" && e && "digest" in e && typeof e.digest == "string") {
889
- const r = Dt(e.digest);
890
- r && (e = r);
891
- }
892
- let t = e !== void 0 ? /* @__PURE__ */ i.createElement(L.Provider, { value: this.props.routeContext }, /* @__PURE__ */ i.createElement(
893
- ce.Provider,
894
- {
895
- value: e,
896
- children: this.props.component
897
- }
898
- )) : this.props.children;
899
- return this.context ? /* @__PURE__ */ i.createElement(_t, { error: e }, t) : t;
900
- }
901
- };
902
- ze.contextType = _e;
903
- var te = /* @__PURE__ */ new WeakMap();
904
- function _t({
905
- children: e,
906
- error: t
907
- }) {
908
- let { basename: r, navigator: n } = i.useContext(b);
909
- if (typeof t == "object" && t && "digest" in t && typeof t.digest == "string") {
910
- let a = It(t.digest);
911
- if (a) {
912
- let o = te.get(t);
913
- if (o) throw o;
914
- let l = Oe(a.location, r), u = l.absoluteURL || l.to;
915
- if (se(
916
- a.location,
917
- u,
918
- ie(n),
919
- "allow-explicit"
920
- ), Pt(u))
921
- throw new Error("Invalid redirect location");
922
- if (Ue && !te.get(t))
923
- if (l.isExternal || a.reloadDocument)
924
- window.location.href = u;
925
- else {
926
- const s = Promise.resolve().then(
927
- () => window.__reactRouterDataRouter.navigate(l.to, {
928
- replace: a.replace
929
- })
930
- );
931
- throw te.set(t, s), s;
932
- }
933
- return /* @__PURE__ */ i.createElement("meta", { httpEquiv: "refresh", content: `0;url=${u}` });
934
- }
935
- }
936
- return e;
937
- }
938
- function Mt({ routeContext: e, match: t, children: r }) {
939
- let n = i.useContext(O);
940
- return n && n.static && n.staticContext && (t.route.errorElement || t.route.ErrorBoundary) && (n.staticContext._deepestRenderedBoundaryId = t.route.id), /* @__PURE__ */ i.createElement(L.Provider, { value: e }, r);
941
- }
942
- function Wt(e, t = [], r) {
943
- let n = r == null ? void 0 : r.state;
944
- if (e == null) {
945
- if (!n)
946
- return null;
947
- if (n.errors)
948
- e = n.matches;
949
- else if (t.length === 0 && !n.initialized && n.matches.length > 0)
950
- e = n.matches;
951
- else
952
- return null;
953
- }
954
- let a = e, o = n == null ? void 0 : n.errors;
955
- if (o != null) {
956
- let f = a.findIndex(
957
- (h) => h.route.id && (o == null ? void 0 : o[h.route.id]) !== void 0
958
- );
959
- E(
960
- f >= 0,
961
- `Could not find a matching route for errors on route IDs: ${Object.keys(
962
- o
963
- ).join(",")}`
964
- ), a = a.slice(
965
- 0,
966
- Math.min(a.length, f + 1)
967
- );
968
- }
969
- let l = !1, u = -1;
970
- if (r && n) {
971
- l = n.renderFallback;
972
- for (let f = 0; f < a.length; f++) {
973
- let h = a[f];
974
- if ((h.route.HydrateFallback || h.route.hydrateFallbackElement) && (u = f), h.route.id) {
975
- let { loaderData: d, errors: y } = n, v = h.route.loader && !d.hasOwnProperty(h.route.id) && (!y || y[h.route.id] === void 0);
976
- if (h.route.lazy || v) {
977
- r.isStatic && (l = !0), u >= 0 ? a = a.slice(0, u + 1) : a = [a[0]];
978
- break;
979
- }
980
- }
981
- }
982
- }
983
- let s = r == null ? void 0 : r.onError, c = n && s ? (f, h) => {
984
- var d, y;
985
- s(f, {
986
- location: n.location,
987
- params: ((y = (d = n.matches) == null ? void 0 : d[0]) == null ? void 0 : y.params) ?? {},
988
- pattern: Ct(n.matches),
989
- errorInfo: h
990
- });
991
- } : void 0;
992
- return a.reduceRight(
993
- (f, h, d) => {
994
- let y, v = !1, g = null, p = null;
995
- n && (y = o && h.route.id ? o[h.route.id] : void 0, g = h.route.errorElement || Ht, l && (u < 0 && d === 0 ? (Je(
996
- "route-fallback",
997
- !1,
998
- "No `HydrateFallback` element provided to render during initial hydration"
999
- ), v = !0, p = null) : u === d && (v = !0, p = h.route.hydrateFallbackElement || null)));
1000
- let m = t.concat(a.slice(0, d + 1)), R = () => {
1001
- let w;
1002
- return y ? w = g : v ? w = p : h.route.Component ? w = /* @__PURE__ */ i.createElement(h.route.Component, null) : h.route.element ? w = h.route.element : w = f, /* @__PURE__ */ i.createElement(
1003
- Mt,
1004
- {
1005
- match: h,
1006
- routeContext: {
1007
- outlet: f,
1008
- matches: m,
1009
- isDataRoute: n != null
1010
- },
1011
- children: w
1012
- }
1013
- );
1014
- };
1015
- return n && (h.route.ErrorBoundary || h.route.errorElement || d === 0) ? /* @__PURE__ */ i.createElement(
1016
- ze,
1017
- {
1018
- location: n.location,
1019
- revalidation: n.revalidation,
1020
- component: g,
1021
- error: y,
1022
- children: R(),
1023
- routeContext: { outlet: null, matches: m, isDataRoute: !0 },
1024
- onError: c
1025
- }
1026
- ) : R();
1027
- },
1028
- null
1029
- );
1030
- }
1031
- function he(e) {
1032
- return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
1033
- }
1034
- function Bt(e) {
1035
- let t = i.useContext(O);
1036
- return E(t, he(e)), t;
1037
- }
1038
- function jt(e) {
1039
- let t = i.useContext(Y);
1040
- return E(t, he(e)), t;
1041
- }
1042
- function Vt(e) {
1043
- let t = i.useContext(L);
1044
- return E(t, he(e)), t;
1045
- }
1046
- function de(e) {
1047
- let t = Vt(e), r = t.matches[t.matches.length - 1];
1048
- return E(
1049
- r.route.id,
1050
- `${e} can only be used on routes that contain a unique "id"`
1051
- ), r.route.id;
1052
- }
1053
- function zt() {
1054
- return de(
1055
- "useRouteId"
1056
- /* UseRouteId */
1057
- );
1058
- }
1059
- function Jt() {
1060
- var n;
1061
- let e = i.useContext(ce), t = jt(
1062
- "useRouteError"
1063
- /* UseRouteError */
1064
- ), r = de(
1065
- "useRouteError"
1066
- /* UseRouteError */
1067
- );
1068
- return e !== void 0 ? e : (n = t.errors) == null ? void 0 : n[r];
1069
- }
1070
- function Kt() {
1071
- let { router: e } = Bt(
1072
- "useNavigate"
1073
- /* UseNavigateStable */
1074
- ), t = de(
1075
- "useNavigate"
1076
- /* UseNavigateStable */
1077
- ), r = i.useRef(!1);
1078
- return je(() => {
1079
- r.current = !0;
1080
- }), i.useCallback(
1081
- async (a, o = {}) => {
1082
- S(r.current, Be), r.current && (typeof a == "number" ? await e.navigate(a) : await e.navigate(a, { fromRouteId: t, ...o }));
1083
- },
1084
- [e, t]
1085
- );
1086
- }
1087
- var be = {};
1088
- function Je(e, t, r) {
1089
- !t && !be[e] && (be[e] = !0, S(!1, r));
1090
- }
1091
- i.memo(qt);
1092
- function qt({
1093
- routes: e,
1094
- manifest: t,
1095
- future: r,
1096
- state: n,
1097
- isStatic: a,
1098
- onError: o
1099
- }) {
1100
- return Ve(e, void 0, {
1101
- manifest: t,
1102
- state: n,
1103
- isStatic: a,
1104
- onError: o
1105
- });
1106
- }
1107
- function Nr({
1108
- to: e,
1109
- replace: t,
1110
- state: r,
1111
- relative: n
1112
- }) {
1113
- E(
1114
- H(),
1115
- // TODO: This error is probably because they somehow have 2 versions of
1116
- // the router loaded. We can help them understand how to avoid that.
1117
- "<Navigate> may be used only in the context of a <Router> component."
1118
- );
1119
- let { static: a, navigator: o } = i.useContext(b);
1120
- S(
1121
- !a,
1122
- "<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change."
1123
- );
1124
- let { matches: l } = i.useContext(L), { pathname: u } = k(), s = fe(), c = q(
1125
- e,
1126
- ue(l),
1127
- u,
1128
- n === "path"
1129
- );
1130
- se(
1131
- typeof e == "string" ? e : D(e),
1132
- o.createHref(c),
1133
- ie(o),
1134
- "reject"
1135
- );
1136
- let f = JSON.stringify(c);
1137
- return i.useEffect(() => {
1138
- s(JSON.parse(f), { replace: t, state: r, relative: n });
1139
- }, [s, f, n, t, r]), null;
1140
- }
1141
- function Yt(e) {
1142
- E(
1143
- !1,
1144
- "A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>."
1145
- );
1146
- }
1147
- function Gt({
1148
- basename: e = "/",
1149
- children: t = null,
1150
- location: r,
1151
- navigationType: n = "POP",
1152
- navigator: a,
1153
- static: o = !1,
1154
- useTransitions: l
1155
- }) {
1156
- E(
1157
- !H(),
1158
- "You cannot render a <Router> inside another <Router>. You should never have more than one in your app."
1159
- );
1160
- let u = e.replace(/^\/*/, "/"), s = i.useMemo(
1161
- () => ({
1162
- basename: u,
1163
- navigator: a,
1164
- static: o,
1165
- useTransitions: l,
1166
- future: {}
1167
- }),
1168
- [u, a, o, l]
1169
- );
1170
- typeof r == "string" && (r = F(r));
1171
- let {
1172
- pathname: c = "/",
1173
- search: f = "",
1174
- hash: h = "",
1175
- state: d = null,
1176
- key: y = "default",
1177
- mask: v
1178
- } = r, g = i.useMemo(() => {
1179
- let p = T(c, u);
1180
- return p == null ? null : {
1181
- location: {
1182
- pathname: p,
1183
- search: f,
1184
- hash: h,
1185
- state: d,
1186
- key: y,
1187
- mask: v
1188
- },
1189
- navigationType: n
1190
- };
1191
- }, [u, c, f, h, d, y, n, v]);
1192
- return S(
1193
- g != null,
1194
- `<Router basename="${u}"> is not able to match the URL "${c}${f}${h}" because it does not start with the basename, so the <Router> won't render anything.`
1195
- ), g == null ? null : /* @__PURE__ */ i.createElement(b.Provider, { value: s }, /* @__PURE__ */ i.createElement(W.Provider, { children: t, value: g }));
1196
- }
1197
- function Ir({
1198
- children: e,
1199
- location: t
1200
- }) {
1201
- return Ut(oe(e), t);
1202
- }
1203
- function oe(e, t = []) {
1204
- let r = [];
1205
- return i.Children.forEach(e, (n, a) => {
1206
- if (!i.isValidElement(n))
1207
- return;
1208
- let o = [...t, a];
1209
- if (n.type === i.Fragment) {
1210
- r.push.apply(
1211
- r,
1212
- oe(n.props.children, o)
1213
- );
1214
- return;
1215
- }
1216
- E(
1217
- n.type === Yt,
1218
- `[${typeof n.type == "string" ? n.type : n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`
1219
- ), E(
1220
- !n.props.index || !n.props.children,
1221
- "An index route cannot have child routes."
1222
- );
1223
- let l = {
1224
- id: n.props.id || o.join("-"),
1225
- caseSensitive: n.props.caseSensitive,
1226
- element: n.props.element,
1227
- Component: n.props.Component,
1228
- index: n.props.index,
1229
- path: n.props.path,
1230
- middleware: n.props.middleware,
1231
- loader: n.props.loader,
1232
- action: n.props.action,
1233
- hydrateFallbackElement: n.props.hydrateFallbackElement,
1234
- HydrateFallback: n.props.HydrateFallback,
1235
- errorElement: n.props.errorElement,
1236
- ErrorBoundary: n.props.ErrorBoundary,
1237
- hasErrorBoundary: n.props.hasErrorBoundary === !0 || n.props.ErrorBoundary != null || n.props.errorElement != null,
1238
- shouldRevalidate: n.props.shouldRevalidate,
1239
- handle: n.props.handle,
1240
- lazy: n.props.lazy
1241
- };
1242
- n.props.children && (l.children = oe(
1243
- n.props.children,
1244
- o
1245
- )), r.push(l);
1246
- }), r;
1247
- }
1248
- var V = "get", z = "application/x-www-form-urlencoded";
1249
- function G(e) {
1250
- return typeof HTMLElement < "u" && e instanceof HTMLElement;
1251
- }
1252
- function Xt(e) {
1253
- return G(e) && e.tagName.toLowerCase() === "button";
1254
- }
1255
- function Qt(e) {
1256
- return G(e) && e.tagName.toLowerCase() === "form";
1257
- }
1258
- function Zt(e) {
1259
- return G(e) && e.tagName.toLowerCase() === "input";
1260
- }
1261
- function er(e) {
1262
- return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
1263
- }
1264
- function tr(e, t) {
1265
- return e.button === 0 && // Ignore everything but left clicks
1266
- (!t || t === "_self") && // Let browser handle "target=_blank" etc.
1267
- !er(e);
1268
- }
1269
- function le(e = "") {
1270
- return new URLSearchParams(
1271
- typeof e == "string" || Array.isArray(e) || e instanceof URLSearchParams ? e : Object.keys(e).reduce((t, r) => {
1272
- let n = e[r];
1273
- return t.concat(
1274
- Array.isArray(n) ? n.map((a) => [r, a]) : [[r, n]]
1275
- );
1276
- }, [])
1277
- );
1278
- }
1279
- function rr(e, t) {
1280
- let r = le(e);
1281
- return t && t.forEach((n, a) => {
1282
- r.has(a) || t.getAll(a).forEach((o) => {
1283
- r.append(a, o);
1284
- });
1285
- }), r;
1286
- }
1287
- var j = null;
1288
- function nr() {
1289
- if (j === null)
1290
- try {
1291
- new FormData(
1292
- document.createElement("form"),
1293
- // @ts-expect-error if FormData supports the submitter parameter, this will throw
1294
- 0
1295
- ), j = !1;
1296
- } catch {
1297
- j = !0;
1298
- }
1299
- return j;
1300
- }
1301
- var ar = /* @__PURE__ */ new Set([
1302
- "application/x-www-form-urlencoded",
1303
- "multipart/form-data",
1304
- "text/plain"
1305
- ]);
1306
- function re(e) {
1307
- return e != null && !ar.has(e) ? (S(
1308
- !1,
1309
- `"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${z}"`
1310
- ), null) : e;
1311
- }
1312
- function or(e, t) {
1313
- let r, n, a, o, l;
1314
- if (Qt(e)) {
1315
- let u = e.getAttribute("action");
1316
- n = u ? T(u, t) : null, r = e.getAttribute("method") || V, a = re(e.getAttribute("enctype")) || z, o = new FormData(e);
1317
- } else if (Xt(e) || Zt(e) && (e.type === "submit" || e.type === "image")) {
1318
- let u = e.form;
1319
- if (u == null)
1320
- throw new Error(
1321
- 'Cannot submit a <button> or <input type="submit"> without a <form>'
1322
- );
1323
- let s = e.getAttribute("formaction") || u.getAttribute("action");
1324
- if (n = s ? T(s, t) : null, r = e.getAttribute("formmethod") || u.getAttribute("method") || V, a = re(e.getAttribute("formenctype")) || re(u.getAttribute("enctype")) || z, o = new FormData(u, e), !nr()) {
1325
- let { name: c, type: f, value: h } = e;
1326
- if (f === "image") {
1327
- let d = c ? `${c}.` : "";
1328
- o.append(`${d}x`, "0"), o.append(`${d}y`, "0");
1329
- } else c && o.append(c, h);
1330
- }
1331
- } else {
1332
- if (G(e))
1333
- throw new Error(
1334
- 'Cannot submit element that is not <form>, <button>, or <input type="submit|image">'
1335
- );
1336
- r = V, n = null, a = z, l = e;
1337
- }
1338
- return o && a === "text/plain" && (l = o, o = void 0), { action: n, method: r.toLowerCase(), encType: a, formData: o, body: l };
1339
- }
1340
- Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
1341
- function me(e, t) {
1342
- if (e === !1 || e === null || typeof e > "u")
1343
- throw new Error(t);
1344
- }
1345
- function Ke(e, t, r, n) {
1346
- let a = typeof e == "string" ? new URL(
1347
- e,
1348
- // This can be called during the SSR flow via PrefetchPageLinksImpl so
1349
- // don't assume window is available
1350
- typeof window > "u" ? "server://singlefetch/" : window.location.origin
1351
- ) : e;
1352
- return r ? a.pathname.endsWith("/") ? a.pathname = `${a.pathname}_.${n}` : a.pathname = `${a.pathname}.${n}` : a.pathname === "/" ? a.pathname = `_root.${n}` : t && T(a.pathname, t) === "/" ? a.pathname = `${U(t)}/_root.${n}` : a.pathname = `${U(a.pathname)}.${n}`, a;
1353
- }
1354
- async function lr(e, t) {
1355
- if (e.id in t)
1356
- return t[e.id];
1357
- try {
1358
- let r = await import(
1359
- /* @vite-ignore */
1360
- /* webpackIgnore: true */
1361
- e.module
1362
- );
1363
- return t[e.id] = r, r;
1364
- } catch (r) {
1365
- return console.error(
1366
- `Error loading route module \`${e.module}\`, reloading page...`
1367
- ), console.error(r), window.__reactRouterContext && window.__reactRouterContext.isSpaMode, window.location.reload(), new Promise(() => {
1368
- });
1369
- }
1370
- }
1371
- function ir(e) {
1372
- return e == null ? !1 : e.href == null ? e.rel === "preload" && typeof e.imageSrcSet == "string" && typeof e.imageSizes == "string" : typeof e.rel == "string" && typeof e.href == "string";
1373
- }
1374
- async function sr(e, t, r) {
1375
- let n = await Promise.all(
1376
- e.map(async (a) => {
1377
- let o = t.routes[a.route.id];
1378
- if (o) {
1379
- let l = await lr(o, r);
1380
- return l.links ? l.links() : [];
1381
- }
1382
- return [];
1383
- })
1384
- );
1385
- return hr(
1386
- n.flat(1).filter(ir).filter((a) => a.rel === "stylesheet" || a.rel === "preload").map(
1387
- (a) => a.rel === "stylesheet" ? { ...a, rel: "prefetch", as: "style" } : { ...a, rel: "prefetch" }
1388
- )
1389
- );
1390
- }
1391
- function Pe(e, t, r, n, a, o) {
1392
- let l = (s, c) => r[c] ? s.route.id !== r[c].route.id : !0, u = (s, c) => {
1393
- var f;
1394
- return (
1395
- // param change, /users/123 -> /users/456
1396
- r[c].pathname !== s.pathname || // splat param changed, which is not present in match.path
1397
- // e.g. /files/images/avatar.jpg -> files/finances.xls
1398
- ((f = r[c].route.path) == null ? void 0 : f.endsWith("*")) && r[c].params["*"] !== s.params["*"]
1399
- );
1400
- };
1401
- return o === "assets" ? t.filter(
1402
- (s, c) => l(s, c) || u(s, c)
1403
- ) : o === "data" ? t.filter((s, c) => {
1404
- var h;
1405
- let f = n.routes[s.route.id];
1406
- if (!f || !f.hasLoader)
1407
- return !1;
1408
- if (l(s, c) || u(s, c))
1409
- return !0;
1410
- if (s.route.shouldRevalidate) {
1411
- let d = s.route.shouldRevalidate({
1412
- currentUrl: new URL(
1413
- a.pathname + a.search + a.hash,
1414
- window.origin
1415
- ),
1416
- currentParams: ((h = r[0]) == null ? void 0 : h.params) || {},
1417
- nextUrl: new URL(e, window.origin),
1418
- nextParams: s.params,
1419
- defaultShouldRevalidate: !0
1420
- });
1421
- if (typeof d == "boolean")
1422
- return d;
1423
- }
1424
- return !0;
1425
- }) : [];
1426
- }
1427
- function ur(e, t, { includeHydrateFallback: r } = {}) {
1428
- return cr(
1429
- e.map((n) => {
1430
- let a = t.routes[n.route.id];
1431
- if (!a) return [];
1432
- let o = [a.module];
1433
- return a.clientActionModule && (o = o.concat(a.clientActionModule)), a.clientLoaderModule && (o = o.concat(a.clientLoaderModule)), r && a.hydrateFallbackModule && (o = o.concat(a.hydrateFallbackModule)), a.imports && (o = o.concat(a.imports)), o;
1434
- }).flat(1)
1435
- );
1436
- }
1437
- function cr(e) {
1438
- return [...new Set(e)];
1439
- }
1440
- function fr(e) {
1441
- let t = {}, r = Object.keys(e).sort();
1442
- for (let n of r)
1443
- t[n] = e[n];
1444
- return t;
1445
- }
1446
- function hr(e, t) {
1447
- let r = /* @__PURE__ */ new Set();
1448
- return new Set(t), e.reduce((n, a) => {
1449
- let o = JSON.stringify(fr(a));
1450
- return r.has(o) || (r.add(o), n.push({ key: o, link: a })), n;
1451
- }, []);
1452
- }
1453
- function pe() {
1454
- let e = i.useContext(O);
1455
- return me(
1456
- e,
1457
- "You must render this element inside a <DataRouterContext.Provider> element"
1458
- ), e;
1459
- }
1460
- function dr() {
1461
- let e = i.useContext(Y);
1462
- return me(
1463
- e,
1464
- "You must render this element inside a <DataRouterStateContext.Provider> element"
1465
- ), e;
1466
- }
1467
- var ge = i.createContext(void 0);
1468
- ge.displayName = "FrameworkContext";
1469
- function X() {
1470
- let e = i.useContext(ge);
1471
- return me(
1472
- e,
1473
- "You must render this element inside a <HydratedRouter> element"
1474
- ), e;
1475
- }
1476
- function mr(e, t) {
1477
- let r = i.useContext(ge), [n, a] = i.useState(!1), [o, l] = i.useState(!1), { onFocus: u, onBlur: s, onMouseEnter: c, onMouseLeave: f, onTouchStart: h } = t, d = i.useRef(null);
1478
- i.useEffect(() => {
1479
- if (e === "render" && l(!0), e === "viewport") {
1480
- let g = (m) => {
1481
- m.forEach((R) => {
1482
- l(R.isIntersecting);
1483
- });
1484
- }, p = new IntersectionObserver(g, { threshold: 0.5 });
1485
- return d.current && p.observe(d.current), () => {
1486
- p.disconnect();
1487
- };
1488
- }
1489
- }, [e]), i.useEffect(() => {
1490
- if (n) {
1491
- let g = setTimeout(() => {
1492
- l(!0);
1493
- }, 100);
1494
- return () => {
1495
- clearTimeout(g);
1496
- };
1497
- }
1498
- }, [n]);
1499
- let y = () => {
1500
- a(!0);
1501
- }, v = () => {
1502
- a(!1), l(!1);
1503
- };
1504
- return r ? e !== "intent" ? [o, d, {}] : [
1505
- o,
1506
- d,
1507
- {
1508
- onFocus: M(u, y),
1509
- onBlur: M(s, v),
1510
- onMouseEnter: M(c, y),
1511
- onMouseLeave: M(f, v),
1512
- onTouchStart: M(h, y)
1513
- }
1514
- ] : [!1, d, {}];
1515
- }
1516
- function M(e, t) {
1517
- return (r) => {
1518
- e && e(r), r.defaultPrevented || t(r);
1519
- };
1520
- }
1521
- function pr({ page: e, ...t }) {
1522
- let r = Lt(), { nonce: n } = X(), { router: a } = pe(), o = i.useMemo(
1523
- () => Te(a.routes, e, a.basename),
1524
- [a.routes, e, a.basename]
1525
- );
1526
- return o ? (t.nonce == null && n && (t = { ...t, nonce: n }), r ? /* @__PURE__ */ i.createElement(yr, { page: e, matches: o, ...t }) : /* @__PURE__ */ i.createElement(vr, { page: e, matches: o, ...t })) : null;
1527
- }
1528
- function gr(e) {
1529
- let { manifest: t, routeModules: r } = X(), [n, a] = i.useState([]);
1530
- return i.useEffect(() => {
1531
- let o = !1;
1532
- return sr(e, t, r).then(
1533
- (l) => {
1534
- o || a(l);
1535
- }
1536
- ), () => {
1537
- o = !0;
1538
- };
1539
- }, [e, t, r]), n;
1540
- }
1541
- function yr({
1542
- page: e,
1543
- matches: t,
1544
- ...r
1545
- }) {
1546
- let n = k(), { future: a } = X(), { basename: o } = pe(), l = i.useMemo(() => {
1547
- if (e === n.pathname + n.search + n.hash)
1548
- return [];
1549
- let u = Ke(
1550
- e,
1551
- o,
1552
- a.v8_trailingSlashAwareDataRequests,
1553
- "rsc"
1554
- ), s = !1, c = [];
1555
- for (let f of t)
1556
- typeof f.route.shouldRevalidate == "function" ? s = !0 : c.push(f.route.id);
1557
- return s && c.length > 0 && u.searchParams.set("_routes", c.join(",")), [u.pathname + u.search];
1558
- }, [
1559
- o,
1560
- a.v8_trailingSlashAwareDataRequests,
1561
- e,
1562
- n,
1563
- t
1564
- ]);
1565
- return /* @__PURE__ */ i.createElement(i.Fragment, null, l.map((u) => /* @__PURE__ */ i.createElement("link", { key: u, rel: "prefetch", as: "fetch", href: u, ...r })));
1566
- }
1567
- function vr({
1568
- page: e,
1569
- matches: t,
1570
- ...r
1571
- }) {
1572
- let n = k(), { future: a, manifest: o, routeModules: l } = X(), { basename: u } = pe(), { loaderData: s, matches: c } = dr(), f = i.useMemo(
1573
- () => Pe(
1574
- e,
1575
- t,
1576
- c,
1577
- o,
1578
- n,
1579
- "data"
1580
- ),
1581
- [e, t, c, o, n]
1582
- ), h = i.useMemo(
1583
- () => Pe(
1584
- e,
1585
- t,
1586
- c,
1587
- o,
1588
- n,
1589
- "assets"
1590
- ),
1591
- [e, t, c, o, n]
1592
- ), d = i.useMemo(() => {
1593
- if (e === n.pathname + n.search + n.hash)
1594
- return [];
1595
- let g = /* @__PURE__ */ new Set(), p = !1;
1596
- if (t.forEach((R) => {
1597
- var C;
1598
- let w = o.routes[R.route.id];
1599
- !w || !w.hasLoader || (!f.some((x) => x.route.id === R.route.id) && R.route.id in s && ((C = l[R.route.id]) != null && C.shouldRevalidate) || w.hasClientLoader ? p = !0 : g.add(R.route.id));
1600
- }), g.size === 0)
1601
- return [];
1602
- let m = Ke(
1603
- e,
1604
- u,
1605
- a.v8_trailingSlashAwareDataRequests,
1606
- "data"
1607
- );
1608
- return p && g.size > 0 && m.searchParams.set(
1609
- "_routes",
1610
- t.filter((R) => g.has(R.route.id)).map((R) => R.route.id).join(",")
1611
- ), [m.pathname + m.search];
1612
- }, [
1613
- u,
1614
- a.v8_trailingSlashAwareDataRequests,
1615
- s,
1616
- n,
1617
- o,
1618
- f,
1619
- t,
1620
- e,
1621
- l
1622
- ]), y = i.useMemo(
1623
- () => ur(h, o),
1624
- [h, o]
1625
- ), v = gr(h);
1626
- return /* @__PURE__ */ i.createElement(i.Fragment, null, d.map((g) => /* @__PURE__ */ i.createElement("link", { key: g, rel: "prefetch", as: "fetch", href: g, ...r })), y.map((g) => /* @__PURE__ */ i.createElement("link", { key: g, rel: "modulepreload", href: g, ...r })), v.map(({ key: g, link: p }) => (
1627
- // these don't spread `linkProps` because they are full link descriptors
1628
- // already with their own props
1629
- /* @__PURE__ */ i.createElement(
1630
- "link",
1631
- {
1632
- key: g,
1633
- nonce: r.nonce,
1634
- ...p,
1635
- crossOrigin: p.crossOrigin ?? r.crossOrigin
1636
- }
1637
- )
1638
- )));
1639
- }
1640
- function Rr(...e) {
1641
- return (t) => {
1642
- e.forEach((r) => {
1643
- typeof r == "function" ? r(t) : r != null && (r.current = t);
1644
- });
1645
- };
1646
- }
1647
- var wr = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
1648
- try {
1649
- wr && (window.__reactRouterVersion = // @ts-expect-error
1650
- "7.18.6");
1651
- } catch {
1652
- }
1653
- function Dr({
1654
- basename: e,
1655
- children: t,
1656
- useTransitions: r,
1657
- window: n
1658
- }) {
1659
- let a = i.useRef();
1660
- a.current == null && (a.current = Ze({ window: n, v5Compat: !0 }));
1661
- let o = a.current, [l, u] = i.useState({
1662
- action: o.action,
1663
- location: o.location
1664
- }), s = i.useCallback(
1665
- (c) => {
1666
- r === !1 ? u(c) : i.startTransition(() => u(c));
1667
- },
1668
- [r]
1669
- );
1670
- return i.useLayoutEffect(() => o.listen(s), [o, s]), /* @__PURE__ */ i.createElement(
1671
- Gt,
1672
- {
1673
- basename: e,
1674
- children: t,
1675
- location: l.location,
1676
- navigationType: l.action,
1677
- navigator: o,
1678
- useTransitions: r
1679
- }
1680
- );
1681
- }
1682
- var qe = i.forwardRef(
1683
- function({
1684
- onClick: t,
1685
- discover: r = "render",
1686
- prefetch: n = "none",
1687
- relative: a,
1688
- reloadDocument: o,
1689
- replace: l,
1690
- mask: u,
1691
- state: s,
1692
- target: c,
1693
- to: f,
1694
- preventScrollReset: h,
1695
- viewTransition: d,
1696
- defaultShouldRevalidate: y,
1697
- ...v
1698
- }, g) {
1699
- let { basename: p, navigator: m, useTransitions: R } = i.useContext(b), w = typeof f == "string" && K.test(f), C = Oe(f, p);
1700
- f = C.to;
1701
- let x = Ft(f, { relative: a }), $ = k(), N = null;
1702
- if (u) {
1703
- let I = q(
1704
- u,
1705
- [],
1706
- $.mask ? $.mask.pathname : "/",
1707
- !0
1708
- );
1709
- p !== "/" && (I.pathname = I.pathname === "/" ? p : P([p, I.pathname])), N = m.createHref(I);
1710
- }
1711
- let [A, _, Q] = mr(
1712
- n,
1713
- v
1714
- ), Ge = Sr(f, {
1715
- replace: l,
1716
- mask: u,
1717
- state: s,
1718
- target: c,
1719
- preventScrollReset: h,
1720
- relative: a,
1721
- viewTransition: d,
1722
- defaultShouldRevalidate: y,
1723
- useTransitions: R
1724
- });
1725
- function Xe(I) {
1726
- t && t(I), I.defaultPrevented || Ge(I);
1727
- }
1728
- let ye = !(C.isExternal || o), ve = (ye ? N : void 0) || C.absoluteURL || x;
1729
- $e(ve);
1730
- let Re = (
1731
- // eslint-disable-next-line jsx-a11y/anchor-has-content
1732
- /* @__PURE__ */ i.createElement(
1733
- "a",
1734
- {
1735
- ...v,
1736
- ...Q,
1737
- href: ve,
1738
- onClick: ye ? Xe : t,
1739
- ref: Rr(g, _),
1740
- target: c,
1741
- "data-discover": !w && r === "render" ? "true" : void 0
1742
- }
1743
- )
1744
- );
1745
- return A && !w ? /* @__PURE__ */ i.createElement(i.Fragment, null, Re, /* @__PURE__ */ i.createElement(pr, { page: x })) : Re;
1746
- }
1747
- );
1748
- qe.displayName = "Link";
1749
- var Er = i.forwardRef(
1750
- function({
1751
- "aria-current": t = "page",
1752
- caseSensitive: r = !1,
1753
- className: n = "",
1754
- end: a = !1,
1755
- style: o,
1756
- to: l,
1757
- viewTransition: u,
1758
- children: s,
1759
- ...c
1760
- }, f) {
1761
- let h = B(l, { relative: c.relative }), d = k(), y = i.useContext(Y), { navigator: v, basename: g } = i.useContext(b), p = y != null && // Conditional usage is OK here because the usage of a data router is static
1762
- // eslint-disable-next-line react-hooks/rules-of-hooks
1763
- $r(h) && u === !0, m = v.encodeLocation ? v.encodeLocation(h).pathname : h.pathname, R = d.pathname, w = y && y.navigation && y.navigation.location ? y.navigation.location.pathname : null;
1764
- r || (R = R.toLowerCase(), w = w ? w.toLowerCase() : null, m = m.toLowerCase()), w && g && (w = T(w, g) || w);
1765
- const C = m !== "/" && m.endsWith("/") ? m.length - 1 : m.length;
1766
- let x = R === m || !a && R.startsWith(m) && R.charAt(C) === "/", $ = w != null && (w === m || !a && w.startsWith(m) && w.charAt(m.length) === "/"), N = {
1767
- isActive: x,
1768
- isPending: $,
1769
- isTransitioning: p
1770
- }, A = x ? t : void 0, _;
1771
- typeof n == "function" ? _ = n(N) : _ = [
1772
- n,
1773
- x ? "active" : null,
1774
- $ ? "pending" : null,
1775
- p ? "transitioning" : null
1776
- ].filter(Boolean).join(" ");
1777
- let Q = typeof o == "function" ? o(N) : o;
1778
- return /* @__PURE__ */ i.createElement(
1779
- qe,
1780
- {
1781
- ...c,
1782
- "aria-current": A,
1783
- className: _,
1784
- ref: f,
1785
- style: Q,
1786
- to: l,
1787
- viewTransition: u
1788
- },
1789
- typeof s == "function" ? s(N) : s
1790
- );
1791
- }
1792
- );
1793
- Er.displayName = "NavLink";
1794
- var xr = i.forwardRef(
1795
- ({
1796
- discover: e = "render",
1797
- fetcherKey: t,
1798
- navigate: r,
1799
- reloadDocument: n,
1800
- replace: a,
1801
- state: o,
1802
- method: l = V,
1803
- action: u,
1804
- onSubmit: s,
1805
- relative: c,
1806
- preventScrollReset: f,
1807
- viewTransition: h,
1808
- defaultShouldRevalidate: d,
1809
- ...y
1810
- }, v) => {
1811
- let { useTransitions: g } = i.useContext(b), p = Lr(), m = kr(u, { relative: c }), R = l.toLowerCase() === "get" ? "get" : "post", w = typeof u == "string" && K.test(u), C = (x) => {
1812
- if (s && s(x), x.defaultPrevented) return;
1813
- x.preventDefault();
1814
- let $ = x.nativeEvent.submitter, N = ($ == null ? void 0 : $.getAttribute("formmethod")) || l, A = () => p($ || x.currentTarget, {
1815
- fetcherKey: t,
1816
- method: N,
1817
- navigate: r,
1818
- replace: a,
1819
- state: o,
1820
- relative: c,
1821
- preventScrollReset: f,
1822
- viewTransition: h,
1823
- defaultShouldRevalidate: d
1824
- });
1825
- g && r !== !1 ? i.startTransition(() => A()) : A();
1826
- };
1827
- return /* @__PURE__ */ i.createElement(
1828
- "form",
1829
- {
1830
- ref: v,
1831
- method: R,
1832
- action: m,
1833
- onSubmit: n ? s : C,
1834
- ...y,
1835
- "data-discover": !w && e === "render" ? "true" : void 0
1836
- }
1837
- );
1838
- }
1839
- );
1840
- xr.displayName = "Form";
1841
- function Cr(e) {
1842
- return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
1843
- }
1844
- function Ye(e) {
1845
- let t = i.useContext(O);
1846
- return E(t, Cr(e)), t;
1847
- }
1848
- function Sr(e, {
1849
- target: t,
1850
- replace: r,
1851
- mask: n,
1852
- state: a,
1853
- preventScrollReset: o,
1854
- relative: l,
1855
- viewTransition: u,
1856
- defaultShouldRevalidate: s,
1857
- useTransitions: c
1858
- } = {}) {
1859
- let f = fe(), h = k(), d = B(e, { relative: l });
1860
- return i.useCallback(
1861
- (y) => {
1862
- if (tr(y, t)) {
1863
- y.preventDefault();
1864
- let v = r !== void 0 ? r : D(h) === D(d), g = () => f(e, {
1865
- replace: v,
1866
- mask: n,
1867
- state: a,
1868
- preventScrollReset: o,
1869
- relative: l,
1870
- viewTransition: u,
1871
- defaultShouldRevalidate: s
1872
- });
1873
- c ? i.startTransition(() => g()) : g();
1874
- }
1875
- },
1876
- [
1877
- h,
1878
- f,
1879
- d,
1880
- r,
1881
- n,
1882
- a,
1883
- t,
1884
- e,
1885
- o,
1886
- l,
1887
- u,
1888
- s,
1889
- c
1890
- ]
1891
- );
1892
- }
1893
- function Fr(e) {
1894
- S(
1895
- typeof URLSearchParams < "u",
1896
- "You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params."
1897
- );
1898
- let t = i.useRef(le(e)), r = i.useRef(!1), n = k(), a = i.useMemo(
1899
- () => (
1900
- // Only merge in the defaults if we haven't yet called setSearchParams.
1901
- // Once we call that we want those to take precedence, otherwise you can't
1902
- // remove a param with setSearchParams({}) if it has an initial value
1903
- rr(
1904
- n.search,
1905
- r.current ? null : t.current
1906
- )
1907
- ),
1908
- [n.search]
1909
- ), o = fe(), l = i.useCallback(
1910
- (u, s) => {
1911
- const c = le(
1912
- typeof u == "function" ? u(new URLSearchParams(a)) : u
1913
- );
1914
- r.current = !0, o("?" + c, s);
1915
- },
1916
- [o, a]
1917
- );
1918
- return [a, l];
1919
- }
1920
- var br = 0, Pr = () => `__${String(++br)}__`;
1921
- function Lr() {
1922
- let { router: e } = Ye(
1923
- "useSubmit"
1924
- /* UseSubmit */
1925
- ), { basename: t } = i.useContext(b), r = zt(), n = e.fetch, a = e.navigate;
1926
- return i.useCallback(
1927
- async (o, l = {}) => {
1928
- let { action: u, method: s, encType: c, formData: f, body: h } = or(
1929
- o,
1930
- t
1931
- );
1932
- if (l.navigate === !1) {
1933
- let d = l.fetcherKey || Pr();
1934
- await n(d, r, l.action || u, {
1935
- defaultShouldRevalidate: l.defaultShouldRevalidate,
1936
- preventScrollReset: l.preventScrollReset,
1937
- formData: f,
1938
- body: h,
1939
- formMethod: l.method || s,
1940
- formEncType: l.encType || c,
1941
- flushSync: l.flushSync
1942
- });
1943
- } else
1944
- await a(l.action || u, {
1945
- defaultShouldRevalidate: l.defaultShouldRevalidate,
1946
- preventScrollReset: l.preventScrollReset,
1947
- formData: f,
1948
- body: h,
1949
- formMethod: l.method || s,
1950
- formEncType: l.encType || c,
1951
- replace: l.replace,
1952
- state: l.state,
1953
- fromRouteId: r,
1954
- flushSync: l.flushSync,
1955
- viewTransition: l.viewTransition
1956
- });
1957
- },
1958
- [n, a, t, r]
1959
- );
1960
- }
1961
- function kr(e, { relative: t } = {}) {
1962
- let { basename: r } = i.useContext(b), n = i.useContext(L);
1963
- E(n, "useFormAction must be used inside a RouteContext");
1964
- let [a] = n.matches.slice(-1), o = { ...B(e || ".", { relative: t }) }, l = k();
1965
- if (e == null) {
1966
- o.search = l.search;
1967
- let s = new URLSearchParams(o.search), c = s.getAll("index");
1968
- if (c.some((h) => h === "")) {
1969
- s.delete("index"), c.filter((d) => d).forEach((d) => s.append("index", d));
1970
- let h = s.toString();
1971
- o.search = h ? `?${h}` : "";
1972
- }
1973
- }
1974
- (!e || e === ".") && a.route.index && (o.search = o.search ? o.search.replace(/^\?/, "?index&") : "?index"), r !== "/" && (o.pathname = o.pathname === "/" ? r : P([r, o.pathname]));
1975
- let u = D(o);
1976
- return $e(u), u;
1977
- }
1978
- function $r(e, { relative: t } = {}) {
1979
- let r = i.useContext(Me);
1980
- E(
1981
- r != null,
1982
- "`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
1983
- );
1984
- let { basename: n } = Ye(
1985
- "useViewTransitionState"
1986
- /* useViewTransitionState */
1987
- ), a = B(e, { relative: t });
1988
- if (!r.isTransitioning)
1989
- return !1;
1990
- let o = T(r.currentLocation.pathname, n) || r.currentLocation.pathname, l = T(r.nextLocation.pathname, n) || r.nextLocation.pathname;
1991
- return J(a.pathname, l) != null || J(a.pathname, o) != null;
1992
- }
1993
- export {
1994
- Dr as H,
1995
- qe as L,
1996
- Nr as N,
1997
- Ir as R,
1998
- k as a,
1999
- Fr as b,
2000
- Tr as c,
2001
- Yt as d,
2002
- J as m,
2003
- fe as u
2004
- };